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