diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-09-06 15:05:08 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-09-06 15:57:15 +0200 |
commit | 14b459a6f9c9c02a0901a8a3de5e7c706305ffdd (patch) | |
tree | 0cdc0dc8eff9dcc73c8b1d40cbe635342b6738c3 /include/bswap.h | |
parent | 96dbb2c0a24fdc6bbe4d8d834f0b879e01fdcae3 (diff) | |
download | qboot-14b459a6f9c9c02a0901a8a3de5e7c706305ffdd.zip qboot-14b459a6f9c9c02a0901a8a3de5e7c706305ffdd.tar.gz qboot-14b459a6f9c9c02a0901a8a3de5e7c706305ffdd.tar.bz2 |
use fw_cfg DMA for fw_cfg_read_entry
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/bswap.h')
-rw-r--r-- | include/bswap.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/bswap.h b/include/bswap.h new file mode 100644 index 0000000..2a72bd0 --- /dev/null +++ b/include/bswap.h @@ -0,0 +1,29 @@ +#ifndef BSWAP_H +#define BSWAP_H 1 + +static inline uint32_t bswap32(uint32_t x) +{ + return __builtin_bswap32(x); +} + +static inline uint64_t bswap64(uint64_t x) +{ + return __builtin_bswap64(x); +} + +static inline uint32_t ldl_le_p(const void *p) +{ + uint32_t val; + memcpy(&val, p, 4); + return val; +} + +static inline uint32_t ldl_be_p(const void *p) +{ + uint32_t val; + memcpy(&val, p, 4); + return bswap32(val); +} + + +#endif |