LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
libxenon
drivers
libfdt
libfdt_env.h
Go to the documentation of this file.
1
#ifndef _LIBFDT_ENV_H
2
#define _LIBFDT_ENV_H
3
4
#include <stddef.h>
5
#include <
xetypes.h
>
6
#include <
nocfe/lib_types.h
>
7
#include "string.h"
8
9
typedef
u8
uint8_t
;
10
typedef
u16
uint16_t
;
11
typedef
u32
uint32_t
;
12
typedef
u64
uint64_t
;
13
14
typedef
s8
int8_t
;
15
typedef
s16
int16_t
;
16
typedef
s32
int32_t
;
17
typedef
s64
int64_t
;
18
19
#define _B(n) ((unsigned long long)((uint8_t *)&x)[n])
20
static
inline
uint32_t
fdt32_to_cpu(
uint32_t
x)
21
{
22
return
(
_B
(0) << 24) | (
_B
(1) << 16) | (
_B
(2) << 8) |
_B
(3);
23
}
24
#define cpu_to_fdt32(x) fdt32_to_cpu(x)
25
26
static
inline
uint64_t
fdt64_to_cpu(
uint64_t
x)
27
{
28
return
(
_B
(0) << 56) | (
_B
(1) << 48) | (
_B
(2) << 40) | (
_B
(3) << 32)
29
| (
_B
(4) << 24) | (
_B
(5) << 16) | (
_B
(6) << 8) |
_B
(7);
30
}
31
#define cpu_to_fdt64(x) fdt64_to_cpu(x)
32
#undef _B
33
34
#endif
/* _LIBFDT_ENV_H */
lib_types.h
int32_t
s32 int32_t
Definition:
libfdt_env.h:16
uint32_t
u32 uint32_t
Definition:
libfdt_env.h:11
int8_t
s8 int8_t
Definition:
libfdt_env.h:14
int16_t
s16 int16_t
Definition:
libfdt_env.h:15
uint16_t
u16 uint16_t
Definition:
libfdt_env.h:10
_B
#define _B(n)
Definition:
libfdt_env.h:19
uint64_t
u64 uint64_t
Definition:
libfdt_env.h:12
uint8_t
u8 uint8_t
Definition:
libfdt_env.h:9
int64_t
s64 int64_t
Definition:
libfdt_env.h:17
xetypes.h
s64
int64_t s64
64bit signed integer
Definition:
xetypes.h:20
u64
uint64_t u64
64bit unsigned integer
Definition:
xetypes.h:15
u8
uint8_t u8
8bit unsigned integer
Definition:
xetypes.h:12
s8
int8_t s8
8bit signed integer
Definition:
xetypes.h:17
s16
int16_t s16
16bit signed integer
Definition:
xetypes.h:18
u16
uint16_t u16
16bit unsigned integer
Definition:
xetypes.h:13
s32
int32_t s32
32bit signed integer
Definition:
xetypes.h:19
u32
uint32_t u32
32bit unsigned integer
Definition:
xetypes.h:14
Generated by
1.9.5