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