ia64/xen-unstable

view xen/include/xen/byteorder/generic.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 fe76b80d081a
children
line source
1 #ifndef __XEN_BYTEORDER_GENERIC_H__
2 #define __XEN_BYTEORDER_GENERIC_H__
4 /*
5 * Generic Byte-reordering support
6 *
7 * The "... p" macros, like le64_to_cpup, can be used with pointers
8 * to unaligned data, but there will be a performance penalty on
9 * some architectures. Use get_unaligned for unaligned data.
10 *
11 * The following macros are to be defined by <asm/byteorder.h>:
12 *
13 * Conversion of XX-bit integers (16- 32- or 64-)
14 * between native CPU format and little/big endian format
15 * 64-bit stuff only defined for proper architectures
16 * cpu_to_[bl]eXX(__uXX x)
17 * [bl]eXX_to_cpu(__uXX x)
18 *
19 * The same, but takes a pointer to the value to convert
20 * cpu_to_[bl]eXXp(__uXX x)
21 * [bl]eXX_to_cpup(__uXX x)
22 *
23 * The same, but change in situ
24 * cpu_to_[bl]eXXs(__uXX x)
25 * [bl]eXX_to_cpus(__uXX x)
26 *
27 * See asm-foo/byteorder.h for examples of how to provide
28 * architecture-optimized versions
29 */
31 #define cpu_to_le64 __cpu_to_le64
32 #define le64_to_cpu __le64_to_cpu
33 #define cpu_to_le32 __cpu_to_le32
34 #define le32_to_cpu __le32_to_cpu
35 #define cpu_to_le16 __cpu_to_le16
36 #define le16_to_cpu __le16_to_cpu
37 #define cpu_to_be64 __cpu_to_be64
38 #define be64_to_cpu __be64_to_cpu
39 #define cpu_to_be32 __cpu_to_be32
40 #define be32_to_cpu __be32_to_cpu
41 #define cpu_to_be16 __cpu_to_be16
42 #define be16_to_cpu __be16_to_cpu
43 #define cpu_to_le64p __cpu_to_le64p
44 #define le64_to_cpup __le64_to_cpup
45 #define cpu_to_le32p __cpu_to_le32p
46 #define le32_to_cpup __le32_to_cpup
47 #define cpu_to_le16p __cpu_to_le16p
48 #define le16_to_cpup __le16_to_cpup
49 #define cpu_to_be64p __cpu_to_be64p
50 #define be64_to_cpup __be64_to_cpup
51 #define cpu_to_be32p __cpu_to_be32p
52 #define be32_to_cpup __be32_to_cpup
53 #define cpu_to_be16p __cpu_to_be16p
54 #define be16_to_cpup __be16_to_cpup
55 #define cpu_to_le64s __cpu_to_le64s
56 #define le64_to_cpus __le64_to_cpus
57 #define cpu_to_le32s __cpu_to_le32s
58 #define le32_to_cpus __le32_to_cpus
59 #define cpu_to_le16s __cpu_to_le16s
60 #define le16_to_cpus __le16_to_cpus
61 #define cpu_to_be64s __cpu_to_be64s
62 #define be64_to_cpus __be64_to_cpus
63 #define cpu_to_be32s __cpu_to_be32s
64 #define be32_to_cpus __be32_to_cpus
65 #define cpu_to_be16s __cpu_to_be16s
66 #define be16_to_cpus __be16_to_cpus
68 #endif /* __XEN_BYTEORDER_GENERIC_H__ */