VirtualBox

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

最後變更 在這個檔案從89977是 85718,由 vboxsync 提交於 5 年 前

Devices/EFI: Merge edk-stable202005 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.6 KB
 
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
79#endif /* _LIBFDT_ENV_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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