source: trunk/sys/dietlibc/include/sys/types.h @ 1

Last change on this file since 1 was 1, checked in by alain, 5 years ago

First import

File size: 2.5 KB
Line 
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
42typedef unsigned long uint_t;
43typedef signed long sint_t;
44typedef unsigned long bool_t;
45
46typedef uint_t time_t;
47typedef uint_t dev_t;
48typedef uint_t ino_t;
49typedef uint_t nlink_t;
50typedef int32_t off_t;
51typedef uint_t blksize_t;
52typedef uint_t blkcnt_t;
53typedef uint64_t fsblkcnt_t;
54typedef uint64_t fsfilcnt_t;
55typedef uint32_t fpos_t;
56typedef signed long error_t;
57
58typedef unsigned long pid_t;
59typedef unsigned long uid_t;
60typedef uint_t gid_t;
61
62typedef 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 ? */
72typedef int sig_atomic_t;
73
74/* Page Related Types */
75typedef unsigned long ppn_t;
76typedef unsigned long vma_t;
77typedef unsigned long pma_t;
78
79/* Time Related Types */
80typedef uint64_t clock_t;
81typedef signed long suseconds_t;        /* Used for time in microseconds. */
82typedef signed long useconds_t;         /* Used for time in microseconds. */
83
84/* Aligned Variable */
85struct __cache_line_s
86{
87  uint32_t value;
88  uint32_t values[__CONFIG_CACHE_LINE_LENGTH - 1];
89}__attribute__((packed));
90
91typedef struct __cache_line_s __cacheline_t;
92
93#define __CACHELINE __attribute__((aligned(__CONFIG_CACHE_LINE_SIZE)))
94
95#endif  /* _TYPES_H_ */
Note: See TracBrowser for help on using the repository browser.