00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00033
00034
00035 #ifndef _XED_TYPES_H_
00036 # define _XED_TYPES_H_
00037
00039
00040 #include "xed-common-hdrs.h"
00041
00042 #if defined(__GNUC__) || defined(__ICC)
00043 # include <stdint.h>
00044 # define xed_uint8_t uint8_t
00045 # define xed_uint16_t uint16_t
00046 # define xed_uint32_t uint32_t
00047 # define xed_uint64_t uint64_t
00048 # define xed_int8_t int8_t
00049 # define xed_int16_t int16_t
00050 # define xed_int32_t int32_t
00051 # define xed_int64_t int64_t
00052 #elif defined(_WIN32)
00053 # define xed_uint8_t unsigned __int8
00054 # define xed_uint16_t unsigned __int16
00055 # define xed_uint32_t unsigned __int32
00056 # define xed_uint64_t unsigned __int64
00057 # define xed_int8_t __int8
00058 # define xed_int16_t __int16
00059 # define xed_int32_t __int32
00060 # define xed_int64_t __int64
00061 #else
00062 # error "XED types unsupported platform? Need windows, gcc, or icc."
00063 #endif
00064
00065 typedef unsigned int xed_uint_t;
00066 typedef int xed_int_t;
00067 typedef unsigned int xed_bits_t;
00068 typedef unsigned int xed_bool_t;
00069
00070 typedef union {
00071 xed_uint8_t byte[2];
00072 xed_int8_t s_byte[2];
00073
00074 struct {
00075 xed_uint8_t b0;
00076 xed_uint8_t b1;
00077 } b;
00078 xed_int16_t i16;
00079 xed_uint16_t u16;
00080 } xed_union16_t ;
00081
00082 typedef union {
00083 xed_uint8_t byte[4];
00084 xed_uint16_t word[2];
00085 xed_int8_t s_byte[4];
00086 xed_int16_t s_word[2];
00087
00088 struct {
00089 xed_uint8_t b0;
00090 xed_uint8_t b1;
00091 xed_uint8_t b2;
00092 xed_uint8_t b3;
00093 } b;
00094
00095 struct {
00096 xed_uint16_t w0;
00097 xed_uint16_t w1;
00098 } w;
00099 xed_int32_t i32;
00100 xed_uint32_t u32;
00101 } xed_union32_t ;
00102
00103 typedef union {
00104 xed_uint8_t byte[8];
00105 xed_uint16_t word[4];
00106 xed_uint32_t dword[2];
00107 xed_int8_t s_byte[8];
00108 xed_int16_t s_word[4];
00109 xed_int32_t s_dword[2];
00110
00111 struct {
00112 xed_uint8_t b0;
00113 xed_uint8_t b1;
00114 xed_uint8_t b2;
00115 xed_uint8_t b3;
00116 xed_uint8_t b4;
00117 xed_uint8_t b5;
00118 xed_uint8_t b6;
00119 xed_uint8_t b7;
00120 } b;
00121
00122 struct {
00123 xed_uint16_t w0;
00124 xed_uint16_t w1;
00125 xed_uint16_t w2;
00126 xed_uint16_t w3;
00127 } w;
00128 struct {
00129 xed_uint32_t lo32;
00130 xed_uint32_t hi32;
00131 } s;
00132 xed_uint64_t u64;
00133 xed_int64_t i64;
00134 } xed_union64_t ;
00135
00137 #endif