Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
types.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Intel Corporation
3
* Copyright (c) 2017 ARM Ltd
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
8
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_TYPES_H_
9
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_TYPES_H_
10
11
#include <
stdint.h
>
12
#include <
sys/_types.h
>
13
14
typedef
unsigned
int
mode_t
;
15
16
#if !defined(__ssize_t_defined)
17
#define __ssize_t_defined
18
19
/* Static code analysis tool can raise a violation
20
* in the line below where name of macro 'unsigned' is the same
21
* as keyword. It is made on purpose, deliberated deviation.
22
*
23
* We trick compiler to make sure the type of ssize_t won't be unsigned long.
24
* As otherwise the type of ssize_t will be unsigned long
25
* which is not correct. More details view in commit b889120
26
*/
27
#define unsigned signed
/* parasoft-suppress MISRAC2012-RULE_20_4-a MISRAC2012-RULE_20_4-b */
28
typedef
__SIZE_TYPE__
ssize_t
;
29
#undef unsigned
30
31
#endif
32
33
#if !defined(__off_t_defined)
34
#define __off_t_defined
35
36
#if defined(__i386) || defined(__x86_64) || defined(__ARC64__)
37
typedef
long
int
off_t;
/* "long" works for all of i386, X32 and true 64 bit */
38
#elif defined(__ARM_ARCH)
39
typedef
int
off_t;
40
#elif defined(__arc__)
41
typedef
int
off_t;
42
#elif defined(__NIOS2__)
43
typedef
int
off_t;
44
#elif defined(__riscv)
45
typedef
int
off_t;
46
#elif defined(__XTENSA__)
47
typedef
int
off_t;
48
#elif defined(__sparc__)
49
typedef
int
off_t;
50
#else
51
#error "The minimal libc library does not recognize the architecture!\n"
52
#endif
53
54
#endif
55
56
#if !defined(__time_t_defined)
57
#define __time_t_defined
58
typedef
_TIME_T_
time_t
;
59
#endif
60
61
#if !defined(__suseconds_t_defined)
62
#define __suseconds_t_defined
63
typedef
_SUSECONDS_T_
suseconds_t
;
64
#endif
65
66
#if !defined(__mem_word_t_defined)
67
#define __mem_word_t_defined
68
69
/*
70
* The mem_word_t should match the optimal memory access word width
71
* on the target platform. Here we defaults it to uintptr_t.
72
*/
73
74
typedef
uintptr_t
mem_word_t
;
75
76
#define Z_MEM_WORD_T_WIDTH __INTPTR_WIDTH__
77
78
#endif
79
80
#endif
/* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_TYPES_H_ */
_types.h
mem_word_t
uintptr_t mem_word_t
Definition:
types.h:74
ssize_t
__SIZE_TYPE__ ssize_t
Definition:
types.h:28
time_t
_TIME_T_ time_t
Definition:
types.h:58
suseconds_t
_SUSECONDS_T_ suseconds_t
Definition:
types.h:63
mode_t
unsigned int mode_t
Definition:
types.h:14
stdint.h
uintptr_t
__UINTPTR_TYPE__ uintptr_t
Definition:
stdint.h:75
lib
libc
minimal
include
sys
types.h
Generated on Sun Oct 9 2022 09:21:57 for Zephyr API Documentation by
1.9.4