|
Packit Service |
e79384 |
/* Module with specified TLS size and model.
|
|
Packit Service |
e79384 |
Copyright (C) 2020 Free Software Foundation, Inc.
|
|
Packit Service |
e79384 |
This file is part of the GNU C Library.
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
e79384 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
e79384 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
e79384 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
e79384 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
e79384 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
e79384 |
Lesser General Public License for more details.
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
e79384 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
e79384 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
/* This file is parameterized by macros N, SIZE and MODEL. */
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
#include <stdio.h>
|
|
Packit Service |
e79384 |
#include <string.h>
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
#define CONCATX(x, y) x ## y
|
|
Packit Service |
e79384 |
#define CONCAT(x, y) CONCATX (x, y)
|
|
Packit Service |
e79384 |
#define STRX(x) #x
|
|
Packit Service |
e79384 |
#define STR(x) STRX (x)
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
#define VAR CONCAT (var, N)
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
__attribute__ ((aligned (8), tls_model (MODEL)))
|
|
Packit Service |
e79384 |
__thread char VAR[SIZE];
|
|
Packit Service |
e79384 |
|
|
Packit Service |
e79384 |
void
|
|
Packit Service |
e79384 |
CONCAT (access, N) (void)
|
|
Packit Service |
e79384 |
{
|
|
Packit Service |
e79384 |
printf (STR (VAR) "[%d]:\t %p .. %p " MODEL "\n", SIZE, VAR, VAR + SIZE);
|
|
Packit Service |
e79384 |
fflush (stdout);
|
|
Packit Service |
e79384 |
memset (VAR, 1, SIZE);
|
|
Packit Service |
e79384 |
}
|