ia64/xen-unstable

view xen/include/xen/inttypes.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents ddd290cc8f0d
children
line source
1 /* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 /*
20 * ISO C99: 7.8 Format conversion of integer types <inttypes.h>
21 */
23 #ifndef _XEN_INTTYPES_H
24 #define _XEN_INTTYPES_H 1
26 #include <xen/config.h>
27 #include <xen/types.h>
29 # if BITS_PER_LONG == 64
30 # define __PRI64_PREFIX "l"
31 # define __PRIPTR_PREFIX "l"
32 # else
33 # define __PRI64_PREFIX "ll"
34 # define __PRIPTR_PREFIX
35 # endif
37 /* Macros for printing format specifiers. */
39 /* Decimal notation. */
40 # define PRId8 "d"
41 # define PRId16 "d"
42 # define PRId32 "d"
43 # define PRId64 __PRI64_PREFIX "d"
45 # define PRIdLEAST8 "d"
46 # define PRIdLEAST16 "d"
47 # define PRIdLEAST32 "d"
48 # define PRIdLEAST64 __PRI64_PREFIX "d"
50 # define PRIdFAST8 "d"
51 # define PRIdFAST16 __PRIPTR_PREFIX "d"
52 # define PRIdFAST32 __PRIPTR_PREFIX "d"
53 # define PRIdFAST64 __PRI64_PREFIX "d"
56 # define PRIi8 "i"
57 # define PRIi16 "i"
58 # define PRIi32 "i"
59 # define PRIi64 __PRI64_PREFIX "i"
61 # define PRIiLEAST8 "i"
62 # define PRIiLEAST16 "i"
63 # define PRIiLEAST32 "i"
64 # define PRIiLEAST64 __PRI64_PREFIX "i"
66 # define PRIiFAST8 "i"
67 # define PRIiFAST16 __PRIPTR_PREFIX "i"
68 # define PRIiFAST32 __PRIPTR_PREFIX "i"
69 # define PRIiFAST64 __PRI64_PREFIX "i"
71 /* Octal notation. */
72 # define PRIo8 "o"
73 # define PRIo16 "o"
74 # define PRIo32 "o"
75 # define PRIo64 __PRI64_PREFIX "o"
77 # define PRIoLEAST8 "o"
78 # define PRIoLEAST16 "o"
79 # define PRIoLEAST32 "o"
80 # define PRIoLEAST64 __PRI64_PREFIX "o"
82 # define PRIoFAST8 "o"
83 # define PRIoFAST16 __PRIPTR_PREFIX "o"
84 # define PRIoFAST32 __PRIPTR_PREFIX "o"
85 # define PRIoFAST64 __PRI64_PREFIX "o"
87 /* Unsigned integers. */
88 # define PRIu8 "u"
89 # define PRIu16 "u"
90 # define PRIu32 "u"
91 # define PRIu64 __PRI64_PREFIX "u"
93 # define PRIuLEAST8 "u"
94 # define PRIuLEAST16 "u"
95 # define PRIuLEAST32 "u"
96 # define PRIuLEAST64 __PRI64_PREFIX "u"
98 # define PRIuFAST8 "u"
99 # define PRIuFAST16 __PRIPTR_PREFIX "u"
100 # define PRIuFAST32 __PRIPTR_PREFIX "u"
101 # define PRIuFAST64 __PRI64_PREFIX "u"
103 /* lowercase hexadecimal notation. */
104 # define PRIx8 "x"
105 # define PRIx16 "x"
106 # define PRIx32 "x"
107 # define PRIx64 __PRI64_PREFIX "x"
109 # define PRIxLEAST8 "x"
110 # define PRIxLEAST16 "x"
111 # define PRIxLEAST32 "x"
112 # define PRIxLEAST64 __PRI64_PREFIX "x"
114 # define PRIxFAST8 "x"
115 # define PRIxFAST16 __PRIPTR_PREFIX "x"
116 # define PRIxFAST32 __PRIPTR_PREFIX "x"
117 # define PRIxFAST64 __PRI64_PREFIX "x"
119 /* UPPERCASE hexadecimal notation. */
120 # define PRIX8 "X"
121 # define PRIX16 "X"
122 # define PRIX32 "X"
123 # define PRIX64 __PRI64_PREFIX "X"
125 # define PRIXLEAST8 "X"
126 # define PRIXLEAST16 "X"
127 # define PRIXLEAST32 "X"
128 # define PRIXLEAST64 __PRI64_PREFIX "X"
130 # define PRIXFAST8 "X"
131 # define PRIXFAST16 __PRIPTR_PREFIX "X"
132 # define PRIXFAST32 __PRIPTR_PREFIX "X"
133 # define PRIXFAST64 __PRI64_PREFIX "X"
136 /* Macros for printing `intmax_t' and `uintmax_t'. */
137 # define PRIdMAX __PRI64_PREFIX "d"
138 # define PRIiMAX __PRI64_PREFIX "i"
139 # define PRIoMAX __PRI64_PREFIX "o"
140 # define PRIuMAX __PRI64_PREFIX "u"
141 # define PRIxMAX __PRI64_PREFIX "x"
142 # define PRIXMAX __PRI64_PREFIX "X"
145 /* Macros for printing `intptr_t' and `uintptr_t'. */
146 # define PRIdPTR __PRIPTR_PREFIX "d"
147 # define PRIiPTR __PRIPTR_PREFIX "i"
148 # define PRIoPTR __PRIPTR_PREFIX "o"
149 # define PRIuPTR __PRIPTR_PREFIX "u"
150 # define PRIxPTR __PRIPTR_PREFIX "x"
151 # define PRIXPTR __PRIPTR_PREFIX "X"
154 /* Macros for scanning format specifiers. */
156 /* Signed decimal notation. */
157 # define SCNd8 "hhd"
158 # define SCNd16 "hd"
159 # define SCNd32 "d"
160 # define SCNd64 __PRI64_PREFIX "d"
162 # define SCNdLEAST8 "hhd"
163 # define SCNdLEAST16 "hd"
164 # define SCNdLEAST32 "d"
165 # define SCNdLEAST64 __PRI64_PREFIX "d"
167 # define SCNdFAST8 "hhd"
168 # define SCNdFAST16 __PRIPTR_PREFIX "d"
169 # define SCNdFAST32 __PRIPTR_PREFIX "d"
170 # define SCNdFAST64 __PRI64_PREFIX "d"
172 /* Signed decimal notation. */
173 # define SCNi8 "hhi"
174 # define SCNi16 "hi"
175 # define SCNi32 "i"
176 # define SCNi64 __PRI64_PREFIX "i"
178 # define SCNiLEAST8 "hhi"
179 # define SCNiLEAST16 "hi"
180 # define SCNiLEAST32 "i"
181 # define SCNiLEAST64 __PRI64_PREFIX "i"
183 # define SCNiFAST8 "hhi"
184 # define SCNiFAST16 __PRIPTR_PREFIX "i"
185 # define SCNiFAST32 __PRIPTR_PREFIX "i"
186 # define SCNiFAST64 __PRI64_PREFIX "i"
188 /* Unsigned decimal notation. */
189 # define SCNu8 "hhu"
190 # define SCNu16 "hu"
191 # define SCNu32 "u"
192 # define SCNu64 __PRI64_PREFIX "u"
194 # define SCNuLEAST8 "hhu"
195 # define SCNuLEAST16 "hu"
196 # define SCNuLEAST32 "u"
197 # define SCNuLEAST64 __PRI64_PREFIX "u"
199 # define SCNuFAST8 "hhu"
200 # define SCNuFAST16 __PRIPTR_PREFIX "u"
201 # define SCNuFAST32 __PRIPTR_PREFIX "u"
202 # define SCNuFAST64 __PRI64_PREFIX "u"
204 /* Octal notation. */
205 # define SCNo8 "hho"
206 # define SCNo16 "ho"
207 # define SCNo32 "o"
208 # define SCNo64 __PRI64_PREFIX "o"
210 # define SCNoLEAST8 "hho"
211 # define SCNoLEAST16 "ho"
212 # define SCNoLEAST32 "o"
213 # define SCNoLEAST64 __PRI64_PREFIX "o"
215 # define SCNoFAST8 "hho"
216 # define SCNoFAST16 __PRIPTR_PREFIX "o"
217 # define SCNoFAST32 __PRIPTR_PREFIX "o"
218 # define SCNoFAST64 __PRI64_PREFIX "o"
220 /* Hexadecimal notation. */
221 # define SCNx8 "hhx"
222 # define SCNx16 "hx"
223 # define SCNx32 "x"
224 # define SCNx64 __PRI64_PREFIX "x"
226 # define SCNxLEAST8 "hhx"
227 # define SCNxLEAST16 "hx"
228 # define SCNxLEAST32 "x"
229 # define SCNxLEAST64 __PRI64_PREFIX "x"
231 # define SCNxFAST8 "hhx"
232 # define SCNxFAST16 __PRIPTR_PREFIX "x"
233 # define SCNxFAST32 __PRIPTR_PREFIX "x"
234 # define SCNxFAST64 __PRI64_PREFIX "x"
237 /* Macros for scanning `intmax_t' and `uintmax_t'. */
238 # define SCNdMAX __PRI64_PREFIX "d"
239 # define SCNiMAX __PRI64_PREFIX "i"
240 # define SCNoMAX __PRI64_PREFIX "o"
241 # define SCNuMAX __PRI64_PREFIX "u"
242 # define SCNxMAX __PRI64_PREFIX "x"
244 /* Macros for scaning `intptr_t' and `uintptr_t'. */
245 # define SCNdPTR __PRIPTR_PREFIX "d"
246 # define SCNiPTR __PRIPTR_PREFIX "i"
247 # define SCNoPTR __PRIPTR_PREFIX "o"
248 # define SCNuPTR __PRIPTR_PREFIX "u"
249 # define SCNxPTR __PRIPTR_PREFIX "x"
251 #endif /* _XEN_INTTYPES_H */