1 /*
2  * Copyright (c) 2017, NVIDIA CORPORATION.  All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef	FORT_VARS_H
19 #define	FORT_VARS_H
20 #include <stdint.h>
21 
22 typedef	struct	__fort_vars {
23 	int32_t	debug;		/*   0: 1 if debugging                        */
24 	int32_t	zmem;		/*   4: zero all memory allocations           */
25 	int32_t	debugn;		/*   8: which process or -1 for all           */
26 	int32_t	ioproc;		/*  12: id of i/o proccess                    */
27 	int32_t	lcpu;		/*  16:                                       */
28 	int32_t	np2;		/*  20: smallest power of 2 >= __fort_tcpus   */
29 	int32_t	pario;		/*  24:                                       */
30 	int32_t	quiet;		/*  28: runtime statistics                    */
31 	int32_t	tcpus;		/*  32: total number of processors            */
32 	int32_t	test;		/*  36:                                       */
33 	int64_t	heapz;		/*  40: global heap size                      */
34 	int64_t	heap_block;	/*  48: prcoessor heap size (not power of 2)  */
35 	int32_t	*tids;		/*  56: tid for each processor                */
36 	int32_t	dummy1[16];	/*  64:                                       */
37 	char	*red_what;	/* 128: !! NOT THREAD-SAFE !!                 */
38 	int32_t	dummy2[30];	/* 136:                                       */
39 } __fort_vars_t;
40 
41 extern	__fort_vars_t	__fort_vars;
42 
43 #define	__fort_debug		(__fort_vars.debug)
44 #define	__fort_zmem		(__fort_vars.zmem)
45 #define	__fort_debugn		(__fort_vars.debugn)
46 #define	__fort_ioproc		(__fort_vars.ioproc)
47 #define	__fort_lcpu		(__fort_vars.lcpu)
48 #define	__fort_np2		(__fort_vars.np2)
49 #define	__fort_pario		(__fort_vars.pario)
50 #define	__fort_quiet		(__fort_vars.quiet)
51 #define	__fort_tcpus		(__fort_vars.tcpus)
52 #define	__fort_test		(__fort_vars.test)
53 #define	__fort_heapz		(__fort_vars.heapz)
54 #define	__fort_heap_block	(__fort_vars.heap_block)
55 #define	__fort_tids		(__fort_vars.tids)
56 #define	__fort_red_what		(__fort_vars.red_what)
57 
58 #endif	/* FORT_VARS_H */
59