RTEMS  5.1
inttypes.h
Go to the documentation of this file.
1 
12 /*
13  * COPYRIGHT (c) 2017 On-Line Applications Research Corporation.
14  *
15  * The license and distribution terms for this file may be
16  * found in the file LICENSE in this distribution or at
17  * http://www.rtems.org/license/LICENSE.
18  */
19 
20 #ifndef _RTEMS_INTTYPES_H
21 #define _RTEMS_INTTYPES_H
22 
23 #include <inttypes.h>
24 #include <rtems/score/cpuopts.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
40 #if __RTEMS_SIZEOF_MODE_T__ == 8
41 #define PRIomode_t PRIo64
42 #elif __RTEMS_SIZEOF_MODE_T__ == 4
43 #define PRIomode_t PRIo32
44 #else
45 #error "PRIomode_t: unsupported size of mode_t"
46 #endif
47 
49 #if __RTEMS_SIZEOF_OFF_T__ == 8
50 #define PRIooff_t PRIo64
51 #elif __RTEMS_SIZEOF_OFF_T__ == 4
52 #define PRIooff_t PRIo32
53 #else
54 #error "PRIooff_t: unsupported size of off_t"
55 #endif
56 
58 #if __RTEMS_SIZEOF_OFF_T__ == 8
59 #define PRIdoff_t PRId64
60 #elif __RTEMS_SIZEOF_OFF_T__ == 4
61 #define PRIdoff_t PRId32
62 #else
63 #error "PRIdoff_t: unsupported size of off_t"
64 #endif
65 
67 #if __RTEMS_SIZEOF_TIME_T__ == 8
68 #define PRIdtime_t PRId64
69 #elif __RTEMS_SIZEOF_TIME_T__ == 4
70 #define PRIdtime_t PRId32
71 #else
72 #error "PRIdtime_t: unsupported size of time_t"
73 #endif
74 
76 #if __RTEMS_SIZEOF_BLKSIZE_T__ == 8
77 #define PRIxblksize_t PRIx64
78 #elif __RTEMS_SIZEOF_BLKSIZE_T__ == 4
79 #define PRIxblksize_t PRIx32
80 #else
81 /* Warn and fall back to "long" */
82 #warning "unsupported size of blksize_t"
83 #define PRIxblksize_t "lx"
84 #endif
85 
87 #if __RTEMS_SIZEOF_BLKCNT_T__ == 8
88 #define PRIxblkcnt_t PRIx64
89 #elif __RTEMS_SIZEOF_BLKCNT_T__ == 4
90 #define PRIxblkcnt_t PRIx32
91 #else
92 /* Warn and fall back to "long" */
93 #warning "unsupported size of blkcnt_t"
94 #define PRIxblkcnt_t "lx"
95 #endif
96 
97 /*
98  * Various inttypes.h-stype macros to assist printing
99  * certain system types on different targets.
100  */
101 
102 #define PRIxrtems_id PRIx32
103 
104 /* c.f. cpukit/score/include/rtems/score/priority.h */
105 #define PRIdPriority_Control PRIu64
106 #define PRIxPriority_Control PRIx64
107 /* rtems_task_priority is a typedef to Priority_Control */
108 #define PRIdrtems_task_priority PRIu32
109 #define PRIxrtems_task_priority PRIx32
110 
111 /* c.f. cpukit/score/include/rtems/score/watchdog.h */
112 #define PRIdWatchdog_Interval PRIu32
113 /* rtems_interval is a typedef to Watchdog_Interval */
114 #define PRIdrtems_interval PRIdWatchdog_Interval
115 
116 /* c.f. cpukit/score/include/rtems/score/thread.h */
117 #define PRIdThread_Entry_numeric_type PRIuPTR
118 /* rtems_task_argument is a typedef to Thread_Entry_numeric_type */
119 #define PRIdrtems_task_argument PRIdThread_Entry_numeric_type
120 
121 /* rtems_event_set is a typedef to uint32_t */
122 #define PRIxrtems_event_set PRIx32
123 
124 /* newlib defines pthread_t as a typedef to __uint32_t which matches
125  * RTEMS expectations for an Object ID.
126  */
127 #define PRIxpthread_t PRIx32
128 
129 /* rtems_signal_set is a typedef to uint32_t */
130 #define PRIxrtems_signal_set PRIx32
131 
132 /* newlib's ino_t is a typedef to __uint64_t */
133 #define PRIuino_t PRIu64
134 
135 /* newlib's ino_t is a typedef to __uint64_t */
136 #define PRIxino_t PRIx64
137 
138 /* ioctl_command_t */
139 #define PRIdioctl_command_t "ld"
140 
141 /* rtems_blkdev_bnum */
142 #define PRIdrtems_blkdev_bnum PRId32
143 
144 /* rtems_blkdev_bnum */
145 #define PRIdrtems_blkdev_bnum PRId32
146 
147 /* rtems_vector_number */
148 #define PRIdrtems_vector_number PRId32
149 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif
Provide printf() PRIxxx Constante Beyond Standards.