diff options
Diffstat (limited to 'include/acpi/acmacros.h')
-rw-r--r-- | include/acpi/acmacros.h | 71 |
1 files changed, 3 insertions, 68 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 192fa095a515..8948a6461834 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2006, R. Byron Moore | 8 | * Copyright (C) 2000 - 2007, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -55,25 +55,12 @@ | |||
55 | #define ACPI_SET_BIT(target,bit) ((target) |= (bit)) | 55 | #define ACPI_SET_BIT(target,bit) ((target) |= (bit)) |
56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) | 56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) |
57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) | 57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) |
58 | #define ACPI_MAX(a,b) (((a)>(b))?(a):(b)) | ||
58 | 59 | ||
59 | /* Size calculation */ | 60 | /* Size calculation */ |
60 | 61 | ||
61 | #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) | 62 | #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) |
62 | 63 | ||
63 | #if ACPI_MACHINE_WIDTH == 16 | ||
64 | |||
65 | /* | ||
66 | * For 16-bit addresses, we have to assume that the upper 32 bits | ||
67 | * (out of 64) are zero. | ||
68 | */ | ||
69 | #define ACPI_LODWORD(l) ((u32)(l)) | ||
70 | #define ACPI_HIDWORD(l) ((u32)(0)) | ||
71 | |||
72 | #define ACPI_GET_ADDRESS(a) ((a).lo) | ||
73 | #define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(u32)(b);} | ||
74 | #define ACPI_VALID_ADDRESS(a) ((a).hi | (a).lo) | ||
75 | |||
76 | #else | ||
77 | #ifdef ACPI_NO_INTEGER64_SUPPORT | 64 | #ifdef ACPI_NO_INTEGER64_SUPPORT |
78 | /* | 65 | /* |
79 | * acpi_integer is 32-bits, no 64-bit support on this platform | 66 | * acpi_integer is 32-bits, no 64-bit support on this platform |
@@ -81,10 +68,6 @@ | |||
81 | #define ACPI_LODWORD(l) ((u32)(l)) | 68 | #define ACPI_LODWORD(l) ((u32)(l)) |
82 | #define ACPI_HIDWORD(l) ((u32)(0)) | 69 | #define ACPI_HIDWORD(l) ((u32)(0)) |
83 | 70 | ||
84 | #define ACPI_GET_ADDRESS(a) (a) | ||
85 | #define ACPI_STORE_ADDRESS(a,b) ((a)=(b)) | ||
86 | #define ACPI_VALID_ADDRESS(a) (a) | ||
87 | |||
88 | #else | 71 | #else |
89 | 72 | ||
90 | /* | 73 | /* |
@@ -92,11 +75,6 @@ | |||
92 | */ | 75 | */ |
93 | #define ACPI_LODWORD(l) ((u32)(u64)(l)) | 76 | #define ACPI_LODWORD(l) ((u32)(u64)(l)) |
94 | #define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi)) | 77 | #define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi)) |
95 | |||
96 | #define ACPI_GET_ADDRESS(a) (a) | ||
97 | #define ACPI_STORE_ADDRESS(a,b) ((a)=(acpi_physical_address)(b)) | ||
98 | #define ACPI_VALID_ADDRESS(a) (a) | ||
99 | #endif | ||
100 | #endif | 78 | #endif |
101 | 79 | ||
102 | /* | 80 | /* |
@@ -134,15 +112,8 @@ | |||
134 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) | 112 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) |
135 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) | 113 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) |
136 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) | 114 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) |
137 | |||
138 | #if ACPI_MACHINE_WIDTH == 16 | ||
139 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) | ||
140 | #define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) | ||
141 | #define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i)) | ||
142 | #else | ||
143 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) | 115 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
144 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 116 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
145 | #endif | ||
146 | 117 | ||
147 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | 118 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
148 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) | 119 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) |
@@ -223,28 +194,6 @@ | |||
223 | 194 | ||
224 | /* The hardware supports unaligned transfers, just do the little-endian move */ | 195 | /* The hardware supports unaligned transfers, just do the little-endian move */ |
225 | 196 | ||
226 | #if ACPI_MACHINE_WIDTH == 16 | ||
227 | |||
228 | /* No 64-bit integers */ | ||
229 | /* 16-bit source, 16/32/64 destination */ | ||
230 | |||
231 | #define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) | ||
232 | #define ACPI_MOVE_16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s) | ||
233 | #define ACPI_MOVE_16_TO_64(d,s) ACPI_MOVE_16_TO_32(d,s) | ||
234 | |||
235 | /* 32-bit source, 16/32/64 destination */ | ||
236 | |||
237 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | ||
238 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) | ||
239 | #define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) | ||
240 | |||
241 | /* 64-bit source, 16/32/64 destination */ | ||
242 | |||
243 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | ||
244 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | ||
245 | #define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) | ||
246 | |||
247 | #else | ||
248 | /* 16-bit source, 16/32/64 destination */ | 197 | /* 16-bit source, 16/32/64 destination */ |
249 | 198 | ||
250 | #define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) | 199 | #define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) |
@@ -262,7 +211,6 @@ | |||
262 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 211 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
263 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 212 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
264 | #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) | 213 | #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) |
265 | #endif | ||
266 | 214 | ||
267 | #else | 215 | #else |
268 | /* | 216 | /* |
@@ -307,10 +255,7 @@ | |||
307 | 255 | ||
308 | /* Macros based on machine integer width */ | 256 | /* Macros based on machine integer width */ |
309 | 257 | ||
310 | #if ACPI_MACHINE_WIDTH == 16 | 258 | #if ACPI_MACHINE_WIDTH == 32 |
311 | #define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) | ||
312 | |||
313 | #elif ACPI_MACHINE_WIDTH == 32 | ||
314 | #define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s) | 259 | #define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s) |
315 | 260 | ||
316 | #elif ACPI_MACHINE_WIDTH == 64 | 261 | #elif ACPI_MACHINE_WIDTH == 64 |
@@ -695,16 +640,6 @@ | |||
695 | #define ACPI_DEBUGGER_EXEC(a) | 640 | #define ACPI_DEBUGGER_EXEC(a) |
696 | #endif | 641 | #endif |
697 | 642 | ||
698 | /* | ||
699 | * For 16-bit code, we want to shrink some things even though | ||
700 | * we are using ACPI_DEBUG_OUTPUT to get the debug output | ||
701 | */ | ||
702 | #if ACPI_MACHINE_WIDTH == 16 | ||
703 | #undef ACPI_DEBUG_ONLY_MEMBERS | ||
704 | #undef _VERBOSE_STRUCTURES | ||
705 | #define ACPI_DEBUG_ONLY_MEMBERS(a) | ||
706 | #endif | ||
707 | |||
708 | #ifdef ACPI_DEBUG_OUTPUT | 643 | #ifdef ACPI_DEBUG_OUTPUT |
709 | /* | 644 | /* |
710 | * 1) Set name to blanks | 645 | * 1) Set name to blanks |