1 | /* |
---|
2 | This file is part of MutekP. |
---|
3 | |
---|
4 | MutekP is free software; you can redistribute it and/or modify it |
---|
5 | under the terms of the GNU General Public License as published by |
---|
6 | the Free Software Foundation; either version 2 of the License, or |
---|
7 | (at your option) any later version. |
---|
8 | |
---|
9 | MutekP is distributed in the hope that it will be useful, but |
---|
10 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | General Public License for more details. |
---|
13 | |
---|
14 | You should have received a copy of the GNU General Public License |
---|
15 | along with MutekP; if not, write to the Free Software Foundation, |
---|
16 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
17 | |
---|
18 | UPMC / LIP6 / SOC (c) 2007-2009 |
---|
19 | Copyright Ghassan Almaless <ghassan.almaless@lip6.fr> |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef _TYPES_H_ |
---|
23 | #define _TYPES_H_ |
---|
24 | |
---|
25 | #include <stdint.h> |
---|
26 | |
---|
27 | #define __CONFIG_CACHE_LINE_LENGTH 16 |
---|
28 | #define __CONFIG_CACHE_LINE_SIZE 64 |
---|
29 | |
---|
30 | /* General constants and return values */ |
---|
31 | #ifndef NULL |
---|
32 | #define NULL (void*) 0 |
---|
33 | #endif |
---|
34 | #define FALSE 0 |
---|
35 | #define false 0 |
---|
36 | #define TRUE 1 |
---|
37 | #define true 1 |
---|
38 | |
---|
39 | #define EXIT_SUCCESS 0 |
---|
40 | #define EXIT_FAILURE 1 |
---|
41 | |
---|
42 | typedef unsigned long uint_t; |
---|
43 | typedef signed long sint_t; |
---|
44 | typedef unsigned long bool_t; |
---|
45 | |
---|
46 | typedef uint_t time_t; |
---|
47 | typedef uint_t dev_t; |
---|
48 | typedef uint_t ino_t; |
---|
49 | typedef uint_t nlink_t; |
---|
50 | typedef int32_t off_t; |
---|
51 | typedef uint_t blksize_t; |
---|
52 | typedef uint_t blkcnt_t; |
---|
53 | typedef uint64_t fsblkcnt_t; |
---|
54 | typedef uint64_t fsfilcnt_t; |
---|
55 | typedef uint32_t fpos_t; |
---|
56 | typedef signed long error_t; |
---|
57 | |
---|
58 | typedef unsigned long pid_t; |
---|
59 | typedef unsigned long uid_t; |
---|
60 | typedef uint_t gid_t; |
---|
61 | |
---|
62 | typedef signed long id_t; /* Used as a general identifier; can be |
---|
63 | used to contain at least a pid_t, |
---|
64 | uid_t or a gid_t. */ |
---|
65 | |
---|
66 | /* non-susv2 types: */ |
---|
67 | __extension__ typedef signed long long loff_t; /* 64-bit offset */ |
---|
68 | |
---|
69 | __extension__ typedef signed long long off64_t; |
---|
70 | |
---|
71 | /* put in signal.h ? */ |
---|
72 | typedef int sig_atomic_t; |
---|
73 | |
---|
74 | /* Page Related Types */ |
---|
75 | typedef unsigned long ppn_t; |
---|
76 | typedef unsigned long vma_t; |
---|
77 | typedef unsigned long pma_t; |
---|
78 | |
---|
79 | /* Time Related Types */ |
---|
80 | typedef uint64_t clock_t; |
---|
81 | typedef signed long suseconds_t; /* Used for time in microseconds. */ |
---|
82 | typedef signed long useconds_t; /* Used for time in microseconds. */ |
---|
83 | |
---|
84 | /* Aligned Variable */ |
---|
85 | struct __cache_line_s |
---|
86 | { |
---|
87 | uint32_t value; |
---|
88 | uint32_t values[__CONFIG_CACHE_LINE_LENGTH - 1]; |
---|
89 | }__attribute__((packed)); |
---|
90 | |
---|
91 | typedef struct __cache_line_s __cacheline_t; |
---|
92 | |
---|
93 | #define __CACHELINE __attribute__((aligned(__CONFIG_CACHE_LINE_SIZE))) |
---|
94 | |
---|
95 | #endif /* _TYPES_H_ */ |
---|