diff options
Diffstat (limited to 'umac.c')
-rw-r--r-- | umac.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -122,7 +122,11 @@ typedef unsigned int UWORD; /* Register */ | |||
122 | /* --- Endian Conversion --- Forcing assembly on some platforms */ | 122 | /* --- Endian Conversion --- Forcing assembly on some platforms */ |
123 | /* ---------------------------------------------------------------------- */ | 123 | /* ---------------------------------------------------------------------- */ |
124 | 124 | ||
125 | #if 0 | 125 | #if HAVE_SWAP32 |
126 | #define LOAD_UINT32_REVERSED(p) (swap32(*(UINT32 *)(p))) | ||
127 | #define STORE_UINT32_REVERSED(p,v) (*(UINT32 *)(p) = swap32(v)) | ||
128 | #else /* HAVE_SWAP32 */ | ||
129 | |||
126 | static UINT32 LOAD_UINT32_REVERSED(void *ptr) | 130 | static UINT32 LOAD_UINT32_REVERSED(void *ptr) |
127 | { | 131 | { |
128 | UINT32 temp = *(UINT32 *)ptr; | 132 | UINT32 temp = *(UINT32 *)ptr; |
@@ -137,15 +141,12 @@ static void STORE_UINT32_REVERSED(void *ptr, UINT32 x) | |||
137 | *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 ) | 141 | *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 ) |
138 | | ((i & 0x0000FF00) << 8 ) | (i << 24); | 142 | | ((i & 0x0000FF00) << 8 ) | (i << 24); |
139 | } | 143 | } |
140 | #endif | 144 | #endif /* HAVE_SWAP32 */ |
141 | 145 | ||
142 | /* The following definitions use the above reversal-primitives to do the right | 146 | /* The following definitions use the above reversal-primitives to do the right |
143 | * thing on endian specific load and stores. | 147 | * thing on endian specific load and stores. |
144 | */ | 148 | */ |
145 | 149 | ||
146 | #define LOAD_UINT32_REVERSED(p) (swap32(*(UINT32 *)(p))) | ||
147 | #define STORE_UINT32_REVERSED(p,v) (*(UINT32 *)(p) = swap32(v)) | ||
148 | |||
149 | #if (__LITTLE_ENDIAN__) | 150 | #if (__LITTLE_ENDIAN__) |
150 | #define LOAD_UINT32_LITTLE(ptr) (*(UINT32 *)(ptr)) | 151 | #define LOAD_UINT32_LITTLE(ptr) (*(UINT32 *)(ptr)) |
151 | #define STORE_UINT32_BIG(ptr,x) STORE_UINT32_REVERSED(ptr,x) | 152 | #define STORE_UINT32_BIG(ptr,x) STORE_UINT32_REVERSED(ptr,x) |
@@ -154,8 +155,6 @@ static void STORE_UINT32_REVERSED(void *ptr, UINT32 x) | |||
154 | #define STORE_UINT32_BIG(ptr,x) (*(UINT32 *)(ptr) = (UINT32)(x)) | 155 | #define STORE_UINT32_BIG(ptr,x) (*(UINT32 *)(ptr) = (UINT32)(x)) |
155 | #endif | 156 | #endif |
156 | 157 | ||
157 | |||
158 | |||
159 | /* ---------------------------------------------------------------------- */ | 158 | /* ---------------------------------------------------------------------- */ |
160 | /* ---------------------------------------------------------------------- */ | 159 | /* ---------------------------------------------------------------------- */ |
161 | /* ----- Begin KDF & PDF Section ---------------------------------------- */ | 160 | /* ----- Begin KDF & PDF Section ---------------------------------------- */ |