]>
git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Include/libfdt_env.h
3 * Copyright (c) 2011-2014, ARM Limited. All rights reserved.
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <Library/BaseLib.h>
13 #include <Library/BaseMemoryLib.h>
15 typedef UINT16 fdt16_t
;
16 typedef UINT32 fdt32_t
;
17 typedef UINT64 fdt64_t
;
19 typedef UINT8
uint8_t;
20 typedef UINT16
uint16_t;
21 typedef UINT32
uint32_t;
22 typedef UINT64
uint64_t;
23 typedef UINTN
uintptr_t;
26 static inline uint16_t fdt16_to_cpu(fdt16_t x
)
28 return SwapBytes16 (x
);
30 #define cpu_to_fdt16(x) fdt16_to_cpu(x)
32 static inline uint32_t fdt32_to_cpu(fdt32_t x
)
34 return SwapBytes32 (x
);
36 #define cpu_to_fdt32(x) fdt32_to_cpu(x)
38 static inline uint64_t fdt64_to_cpu(fdt64_t x
)
40 return SwapBytes64 (x
);
42 #define cpu_to_fdt64(x) fdt64_to_cpu(x)
44 static inline void* memcpy(void* dest
, const void* src
, size_t len
) {
45 return CopyMem (dest
, src
, len
);
48 static inline void *memmove(void *dest
, const void *src
, size_t n
) {
49 return CopyMem (dest
, src
, n
);
52 static inline void *memset(void *s
, int c
, size_t n
) {
53 return SetMem (s
, n
, c
);
56 static inline int memcmp(const void* dest
, const void* src
, int len
) {
57 return CompareMem (dest
, src
, len
);
60 static inline void *memchr(const void *s
, int c
, size_t n
) {
61 return ScanMem8 (s
, n
, c
);
64 static inline size_t strlen (const char* str
) {
65 return AsciiStrLen (str
);
68 static inline char *strchr(const char *s
, int c
) {
72 return AsciiStrStr (s
, pattern
);
75 static inline size_t strnlen (const char* str
, size_t strsz
) {
76 return AsciiStrnLenS (str
, strsz
);
79 #endif /* _LIBFDT_ENV_H */