feat: start setup virtio
This commit is contained in:
21
include/endian.h
Normal file
21
include/endian.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by rick on 14-5-22.
|
||||
//
|
||||
|
||||
#ifndef NEW_KERNEL_ENDIAN_H
|
||||
#define NEW_KERNEL_ENDIAN_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
#define leu16_to_native(x) x
|
||||
#define leu32_to_native(x) x
|
||||
#else
|
||||
#define leu16_to_native(x) ((x) >> 8 | (x) << 8)
|
||||
#define leu32_to_native(x) (((x)>>24)&0xff) | \
|
||||
(((x)<<8)&0xff0000) | \
|
||||
(((x)>>8)&0xff00) | \
|
||||
(((x)<<24)&0xff000000)
|
||||
#endif
|
||||
|
||||
#endif //NEW_KERNEL_ENDIAN_H
|
||||
Reference in New Issue
Block a user