Last change
on this file since 141 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
616 bytes
|
Rev | Line | |
---|
[81] | 1 | #ifndef ENVIRONMENT_ENDIANNESS_H |
---|
| 2 | #define ENVIRONMENT_ENDIANNESS_H |
---|
| 3 | |
---|
| 4 | #include <stdint.h> |
---|
| 5 | |
---|
| 6 | namespace environment { |
---|
| 7 | namespace endianness { |
---|
| 8 | |
---|
| 9 | #define LittleEndian false |
---|
| 10 | #define BigEndian true |
---|
| 11 | |
---|
| 12 | typedef union |
---|
| 13 | { |
---|
| 14 | uint32_t word; |
---|
| 15 | |
---|
| 16 | struct |
---|
| 17 | { |
---|
| 18 | uint8_t byte1; |
---|
| 19 | uint8_t byte2; |
---|
| 20 | uint8_t byte3; |
---|
| 21 | uint8_t byte4; |
---|
| 22 | } bytes; |
---|
| 23 | } TestEndian ; |
---|
| 24 | |
---|
| 25 | bool hostEndianness (); |
---|
| 26 | bool cpuEndianness (uint32_t cpu_id); |
---|
| 27 | bool isSameEndianness (uint32_t cpu_id); |
---|
| 28 | char * swapBytes (char * string_src , |
---|
| 29 | uint32_t size_string, |
---|
| 30 | uint32_t size_access); |
---|
| 31 | |
---|
| 32 | }; |
---|
| 33 | }; |
---|
| 34 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.