Changeset 99404 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/EmbeddedPkg/Include/libfdt_env.h
- Timestamp:
- Apr 14, 2023 3:17:44 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156854
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-145445 /vendor/edk2/current 103735-103757,103769-103776,129194-156846
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/EmbeddedPkg/Include/libfdt_env.h
r89983 r99404 13 13 #include <Library/BaseMemoryLib.h> 14 14 15 typedef UINT16 fdt16_t;16 typedef UINT32 fdt32_t;17 typedef UINT64 fdt64_t;15 typedef UINT16 fdt16_t; 16 typedef UINT32 fdt32_t; 17 typedef UINT64 fdt64_t; 18 18 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;24 typedef UINTN size_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; 24 typedef UINTN size_t; 25 25 26 static inline uint16_t fdt16_to_cpu(fdt16_t x) 26 static inline uint16_t 27 fdt16_to_cpu ( 28 fdt16_t x 29 ) 27 30 { 28 31 return SwapBytes16 (x); 29 32 } 30 #define cpu_to_fdt16(x) fdt16_to_cpu(x)31 33 32 static inline uint32_t fdt32_to_cpu(fdt32_t x) 34 #define cpu_to_fdt16(x) fdt16_to_cpu(x) 35 36 static inline uint32_t 37 fdt32_to_cpu ( 38 fdt32_t x 39 ) 33 40 { 34 41 return SwapBytes32 (x); 35 42 } 36 #define cpu_to_fdt32(x) fdt32_to_cpu(x)37 43 38 static inline uint64_t fdt64_to_cpu(fdt64_t x) 44 #define cpu_to_fdt32(x) fdt32_to_cpu(x) 45 46 static inline uint64_t 47 fdt64_to_cpu ( 48 fdt64_t x 49 ) 39 50 { 40 51 return SwapBytes64 (x); 41 52 } 42 #define cpu_to_fdt64(x) fdt64_to_cpu(x)43 53 44 static inline void* memcpy(void* dest, const void* src, size_t len) { 54 #define cpu_to_fdt64(x) fdt64_to_cpu(x) 55 56 static inline void * 57 memcpy ( 58 void *dest, 59 const void *src, 60 size_t len 61 ) 62 { 45 63 return CopyMem (dest, src, len); 46 64 } 47 65 48 static inline void *memmove(void *dest, const void *src, size_t n) { 66 static inline void * 67 memmove ( 68 void *dest, 69 const void *src, 70 size_t n 71 ) 72 { 49 73 return CopyMem (dest, src, n); 50 74 } 51 75 52 static inline void *memset(void *s, int c, size_t n) { 76 static inline void * 77 memset ( 78 void *s, 79 int c, 80 size_t n 81 ) 82 { 53 83 return SetMem (s, n, c); 54 84 } 55 85 56 static inline int memcmp(const void* dest, const void* src, int len) { 86 static inline int 87 memcmp ( 88 const void *dest, 89 const void *src, 90 int len 91 ) 92 { 57 93 return CompareMem (dest, src, len); 58 94 } 59 95 60 static inline void *memchr(const void *s, int c, size_t n) { 96 static inline void * 97 memchr ( 98 const void *s, 99 int c, 100 size_t n 101 ) 102 { 61 103 return ScanMem8 (s, n, c); 62 104 } 63 105 64 static inline size_t strlen (const char* str) { 106 static inline size_t 107 strlen ( 108 const char *str 109 ) 110 { 65 111 return AsciiStrLen (str); 66 112 } 67 113 68 static inline char *strchr(const char *s, int c) { 69 char pattern[2]; 114 static inline char * 115 strchr ( 116 const char *s, 117 int c 118 ) 119 { 120 char pattern[2]; 121 70 122 pattern[0] = c; 71 123 pattern[1] = 0; … … 73 125 } 74 126 75 static inline size_t strnlen (const char* str, size_t strsz ) { 127 static inline size_t 128 strnlen ( 129 const char *str, 130 size_t strsz 131 ) 132 { 76 133 return AsciiStrnLenS (str, strsz); 77 134 } 78 135 79 static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) { 136 static inline size_t 137 strcmp ( 138 const char *str1, 139 const char *str2 140 ) 141 { 142 return AsciiStrCmp (str1, str2); 143 } 144 145 static inline size_t 146 strncmp ( 147 const char *str1, 148 const char *str2, 149 size_t strsz 150 ) 151 { 80 152 return AsciiStrnCmp (str1, str2, strsz); 81 153 } 82 154 155 static inline size_t 156 strncpy ( 157 char *dest, 158 const char *source, 159 size_t dest_max 160 ) 161 { 162 return AsciiStrCpyS (dest, dest_max, source); 163 } 164 83 165 #endif /* _LIBFDT_ENV_H */
Note:
See TracChangeset
for help on using the changeset viewer.