source: rtems/cpukit/include/rtems/inttypes.h @ 59e7209f

5
Last change on this file since 59e7209f was 59e7209f, checked in by Sebastian Huber <sebastian.huber@…>, on 11/16/18 at 06:06:12

score: Remove support for RTEMS_USE_16_BIT_OBJECT

The RTEMS_USE_16_BIT_OBJECT define is not set by an RTEMS port. Remove
support for 16-bit object identifiers. If someone really wants to use
RTEMS on a 16-bit target, then it is better to use self-contained
objects instead of playing around with object identifier optimizations.

Update #3603.

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/**
2 * @file rtems/inttypes.h
3 *
4 * @brief Provide printf() PRIxxx Constante Beyond Standards
5 *
6 * This include file defines PRIxxx constants beyond those in
7 * the C and POSIX standards. These are used to write portable
8 * printf() format strings for POSIX and RTEMS types not in
9 * <inttypes.h>
10 */
11
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
27extern "C" {
28#endif
29
30/**
31 * @defgroup RTEMS inttypes.h Extensions
32 *
33 * This module defines portable PRIxxx constants beyond those
34 * in the C and POSIX standard.
35 */
36
37/** Helper macro to print "modet" in octal */
38#if __RTEMS_SIZEOF_MODE_T__ == 8
39#define PRIomode_t PRIo64
40#elif __RTEMS_SIZEOF_MODE_T__ == 4
41#define PRIomode_t PRIo32
42#else
43#error "PRIomode_t: unsupported size of mode_t"
44#endif
45
46/** Helper macro to print "off_t" in octal */
47#if __RTEMS_SIZEOF_OFF_T__ == 8
48#define PRIooff_t PRIo64
49#elif __RTEMS_SIZEOF_OFF_T__ == 4
50#define PRIooff_t PRIo32
51#else
52#error "PRIooff_t: unsupported size of off_t"
53#endif
54
55/** Helper macro to print "off_t" in decimal */
56#if __RTEMS_SIZEOF_OFF_T__ == 8
57#define PRIdoff_t PRId64
58#elif __RTEMS_SIZEOF_OFF_T__ == 4
59#define PRIdoff_t PRId32
60#else
61#error "PRIdoff_t: unsupported size of off_t"
62#endif
63
64/** Helper macro to print "time_t" in decimal */
65#if __RTEMS_SIZEOF_TIME_T__ == 8
66#define PRIdtime_t PRId64
67#elif __RTEMS_SIZEOF_TIME_T__ == 4
68#define PRIdtime_t PRId32
69#else
70#error "PRIdtime_t: unsupported size of time_t"
71#endif
72
73/** Helper macro to print "blksize_t" in hexadecimal */
74#if __RTEMS_SIZEOF_BLKSIZE_T__ == 8
75#define PRIxblksize_t PRIx64
76#elif __RTEMS_SIZEOF_BLKSIZE_T__ == 4
77#define PRIxblksize_t PRIx32
78#else
79/* Warn and fall back to "long" */
80#warning "unsupported size of blksize_t"
81#define PRIxblksize_t "lx"
82#endif
83
84/** Helper macro to print "blkcnt_t" in hexadecimal */
85#if __RTEMS_SIZEOF_BLKCNT_T__ == 8
86#define PRIxblkcnt_t PRIx64
87#elif __RTEMS_SIZEOF_BLKCNT_T__ == 4
88#define PRIxblkcnt_t PRIx32
89#else
90/* Warn and fall back to "long" */
91#warning "unsupported size of blkcnt_t"
92#define PRIxblkcnt_t "lx"
93#endif
94
95/*
96 * Various inttypes.h-stype macros to assist printing
97 * certain system types on different targets.
98 */
99
100#define PRIxrtems_id PRIx32
101
102/* c.f. cpukit/score/include/rtems/score/priority.h */
103#define PRIdPriority_Control PRIu64
104#define PRIxPriority_Control PRIx64
105/* rtems_task_priority is a typedef to Priority_Control */
106#define PRIdrtems_task_priority PRIu32
107#define PRIxrtems_task_priority PRIx32
108
109/* c.f. cpukit/score/include/rtems/score/watchdog.h */
110#define PRIdWatchdog_Interval PRIu32
111/* rtems_interval is a typedef to Watchdog_Interval */
112#define PRIdrtems_interval    PRIdWatchdog_Interval
113
114/* c.f. cpukit/score/include/rtems/score/thread.h */
115#define PRIdThread_Entry_numeric_type PRIuPTR
116/* rtems_task_argument is a typedef to Thread_Entry_numeric_type */
117#define PRIdrtems_task_argument PRIdThread_Entry_numeric_type
118
119/* rtems_event_set is a typedef to uint32_t */
120#define PRIxrtems_event_set PRIx32
121
122/* newlib defines pthread_t as a typedef to __uint32_t which matches
123 * RTEMS expectations for an Object ID.
124 */
125#define PRIxpthread_t PRIx32
126
127/* rtems_signal_set is a typedef to uint32_t */
128#define PRIxrtems_signal_set PRIx32
129
130/* newlib's ino_t is a typedef to "unsigned long" */
131#define PRIxino_t "lx"
132
133/* ioctl_command_t */
134#define PRIdioctl_command_t "ld"
135
136/* rtems_blkdev_bnum */
137#define PRIdrtems_blkdev_bnum PRId32
138
139/* rtems_blkdev_bnum */
140#define PRIdrtems_blkdev_bnum PRId32
141
142/* rtems_vector_number */
143#define PRIdrtems_vector_number PRId32
144
145/**@}*/
146
147#ifdef __cplusplus
148}
149#endif
150
151#endif
Note: See TracBrowser for help on using the repository browser.