Blame nptl/tst-audit-threads.h

Packit Service 0b8cad
/* Helper header for test-audit-threads.
Packit Service 0b8cad
Packit Service 0b8cad
   Copyright (C) 2018 Free Software Foundation, Inc.
Packit Service 0b8cad
   This file is part of the GNU C Library.
Packit Service 0b8cad
Packit Service 0b8cad
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 0b8cad
   modify it under the terms of the GNU Lesser General Public
Packit Service 0b8cad
   License as published by the Free Software Foundation; either
Packit Service 0b8cad
   version 2.1 of the License, or (at your option) any later version.
Packit Service 0b8cad
Packit Service 0b8cad
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 0b8cad
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 0b8cad
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 0b8cad
   Lesser General Public License for more details.
Packit Service 0b8cad
Packit Service 0b8cad
   You should have received a copy of the GNU Lesser General Public
Packit Service 0b8cad
   License along with the GNU C Library; if not, see
Packit Service 0b8cad
   <http://www.gnu.org/licenses/>.  */
Packit Service 0b8cad
Packit Service 0b8cad
/* We use this helper to create a large number of functions, all of
Packit Service 0b8cad
   which will be resolved lazily and thus have their PLT updated.
Packit Service 0b8cad
   This is done to provide enough functions that we can statistically
Packit Service 0b8cad
   observe a thread vs. PLT resolution failure if one exists.  */
Packit Service 0b8cad
Packit Service 0b8cad
#define CONCAT(a, b) a ## b
Packit Service 0b8cad
#define NUM(x, y) CONCAT (x, y)
Packit Service 0b8cad
Packit Service 0b8cad
#define FUNC10(x)	\
Packit Service 0b8cad
  FUNC (NUM (x, 0));	\
Packit Service 0b8cad
  FUNC (NUM (x, 1));	\
Packit Service 0b8cad
  FUNC (NUM (x, 2));	\
Packit Service 0b8cad
  FUNC (NUM (x, 3));	\
Packit Service 0b8cad
  FUNC (NUM (x, 4));	\
Packit Service 0b8cad
  FUNC (NUM (x, 5));	\
Packit Service 0b8cad
  FUNC (NUM (x, 6));	\
Packit Service 0b8cad
  FUNC (NUM (x, 7));	\
Packit Service 0b8cad
  FUNC (NUM (x, 8));	\
Packit Service 0b8cad
  FUNC (NUM (x, 9))
Packit Service 0b8cad
Packit Service 0b8cad
#define FUNC100(x)	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 0));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 1));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 2));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 3));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 4));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 5));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 6));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 7));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 8));	\
Packit Service 0b8cad
  FUNC10 (NUM (x, 9))
Packit Service 0b8cad
Packit Service 0b8cad
#define FUNC1000(x)		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 0));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 1));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 2));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 3));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 4));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 5));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 6));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 7));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 8));		\
Packit Service 0b8cad
  FUNC100 (NUM (x, 9))
Packit Service 0b8cad
Packit Service 0b8cad
#define FUNC7000()	\
Packit Service 0b8cad
  FUNC1000 (1);		\
Packit Service 0b8cad
  FUNC1000 (2);		\
Packit Service 0b8cad
  FUNC1000 (3);		\
Packit Service 0b8cad
  FUNC1000 (4);		\
Packit Service 0b8cad
  FUNC1000 (5);		\
Packit Service 0b8cad
  FUNC1000 (6);		\
Packit Service 0b8cad
  FUNC1000 (7);
Packit Service 0b8cad
Packit Service 0b8cad
#ifdef FUNC
Packit Service 0b8cad
# undef FUNC
Packit Service 0b8cad
#endif
Packit Service 0b8cad
Packit Service 0b8cad
#ifdef externnum
Packit Service 0b8cad
# define FUNC(x) extern int CONCAT (retNum, x) (void)
Packit Service 0b8cad
#endif
Packit Service 0b8cad
Packit Service 0b8cad
#ifdef definenum
Packit Service 0b8cad
# define FUNC(x) int CONCAT (retNum, x) (void) { return x; }
Packit Service 0b8cad
#endif
Packit Service 0b8cad
Packit Service 0b8cad
#ifdef callnum
Packit Service 0b8cad
# define FUNC(x) CONCAT (retNum, x) (); sync_all (x)
Packit Service 0b8cad
#endif
Packit Service 0b8cad
Packit Service 0b8cad
/* A value of 7000 functions is chosen as an arbitrarily large
Packit Service 0b8cad
   number of functions that will allow us enough attempts to
Packit Service 0b8cad
   verify lazy resolution operation.  */
Packit Service 0b8cad
FUNC7000 ();