VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/EmbeddedPkg/Include/libfdt_env.h@ 89983

Last change on this file since 89983 was 89983, checked in by vboxsync, 4 years ago

Devices/EFI: Merge edk-stable202105 and openssl 1.1.1j and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/** @file
2*
3* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
4*
5* SPDX-License-Identifier: BSD-2-Clause-Patent
6*
7**/
8
9#ifndef _LIBFDT_ENV_H
10#define _LIBFDT_ENV_H
11
12#include <Library/BaseLib.h>
13#include <Library/BaseMemoryLib.h>
14
15typedef UINT16 fdt16_t;
16typedef UINT32 fdt32_t;
17typedef UINT64 fdt64_t;
18
19typedef UINT8 uint8_t;
20typedef UINT16 uint16_t;
21typedef UINT32 uint32_t;
22typedef UINT64 uint64_t;
23typedef UINTN uintptr_t;
24typedef UINTN size_t;
25
26static inline uint16_t fdt16_to_cpu(fdt16_t x)
27{
28 return SwapBytes16 (x);
29}
30#define cpu_to_fdt16(x) fdt16_to_cpu(x)
31
32static inline uint32_t fdt32_to_cpu(fdt32_t x)
33{
34 return SwapBytes32 (x);
35}
36#define cpu_to_fdt32(x) fdt32_to_cpu(x)
37
38static inline uint64_t fdt64_to_cpu(fdt64_t x)
39{
40 return SwapBytes64 (x);
41}
42#define cpu_to_fdt64(x) fdt64_to_cpu(x)
43
44static inline void* memcpy(void* dest, const void* src, size_t len) {
45 return CopyMem (dest, src, len);
46}
47
48static inline void *memmove(void *dest, const void *src, size_t n) {
49 return CopyMem (dest, src, n);
50}
51
52static inline void *memset(void *s, int c, size_t n) {
53 return SetMem (s, n, c);
54}
55
56static inline int memcmp(const void* dest, const void* src, int len) {
57 return CompareMem (dest, src, len);
58}
59
60static inline void *memchr(const void *s, int c, size_t n) {
61 return ScanMem8 (s, n, c);
62}
63
64static inline size_t strlen (const char* str) {
65 return AsciiStrLen (str);
66}
67
68static inline char *strchr(const char *s, int c) {
69 char pattern[2];
70 pattern[0] = c;
71 pattern[1] = 0;
72 return AsciiStrStr (s, pattern);
73}
74
75static inline size_t strnlen (const char* str, size_t strsz ) {
76 return AsciiStrnLenS (str, strsz);
77}
78
79static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) {
80 return AsciiStrnCmp (str1, str2, strsz);
81}
82
83#endif /* _LIBFDT_ENV_H */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette