VirtualBox

Ignore:
Timestamp:
Apr 14, 2023 3:17:44 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156854
Message:

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/EmbeddedPkg/Include/libfdt_env.h

    r89983 r99404  
    1313#include <Library/BaseMemoryLib.h>
    1414
    15 typedef UINT16 fdt16_t;
    16 typedef UINT32 fdt32_t;
    17 typedef UINT64 fdt64_t;
     15typedef UINT16  fdt16_t;
     16typedef UINT32  fdt32_t;
     17typedef UINT64  fdt64_t;
    1818
    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;
     19typedef UINT8   uint8_t;
     20typedef UINT16  uint16_t;
     21typedef UINT32  uint32_t;
     22typedef UINT64  uint64_t;
     23typedef UINTN   uintptr_t;
     24typedef UINTN   size_t;
    2525
    26 static inline uint16_t fdt16_to_cpu(fdt16_t x)
     26static inline uint16_t
     27fdt16_to_cpu (
     28  fdt16_t  x
     29  )
    2730{
    2831  return SwapBytes16 (x);
    2932}
    30 #define cpu_to_fdt16(x) fdt16_to_cpu(x)
    3133
    32 static inline uint32_t fdt32_to_cpu(fdt32_t x)
     34#define cpu_to_fdt16(x)  fdt16_to_cpu(x)
     35
     36static inline uint32_t
     37fdt32_to_cpu (
     38  fdt32_t  x
     39  )
    3340{
    3441  return SwapBytes32 (x);
    3542}
    36 #define cpu_to_fdt32(x) fdt32_to_cpu(x)
    3743
    38 static inline uint64_t fdt64_to_cpu(fdt64_t x)
     44#define cpu_to_fdt32(x)  fdt32_to_cpu(x)
     45
     46static inline uint64_t
     47fdt64_to_cpu (
     48  fdt64_t  x
     49  )
    3950{
    4051  return SwapBytes64 (x);
    4152}
    42 #define cpu_to_fdt64(x) fdt64_to_cpu(x)
    4353
    44 static inline void* memcpy(void* dest, const void* src, size_t len) {
     54#define cpu_to_fdt64(x)  fdt64_to_cpu(x)
     55
     56static inline void *
     57memcpy (
     58  void        *dest,
     59  const void  *src,
     60  size_t      len
     61  )
     62{
    4563  return CopyMem (dest, src, len);
    4664}
    4765
    48 static inline void *memmove(void *dest, const void *src, size_t n) {
     66static inline void *
     67memmove (
     68  void        *dest,
     69  const void  *src,
     70  size_t      n
     71  )
     72{
    4973  return CopyMem (dest, src, n);
    5074}
    5175
    52 static inline void *memset(void *s, int c, size_t n) {
     76static inline void *
     77memset (
     78  void    *s,
     79  int     c,
     80  size_t  n
     81  )
     82{
    5383  return SetMem (s, n, c);
    5484}
    5585
    56 static inline int memcmp(const void* dest, const void* src, int len) {
     86static inline int
     87memcmp (
     88  const void  *dest,
     89  const void  *src,
     90  int         len
     91  )
     92{
    5793  return CompareMem (dest, src, len);
    5894}
    5995
    60 static inline void *memchr(const void *s, int c, size_t n) {
     96static inline void *
     97memchr (
     98  const void  *s,
     99  int         c,
     100  size_t      n
     101  )
     102{
    61103  return ScanMem8 (s, n, c);
    62104}
    63105
    64 static inline size_t strlen (const char* str) {
     106static inline size_t
     107strlen (
     108  const char  *str
     109  )
     110{
    65111  return AsciiStrLen (str);
    66112}
    67113
    68 static inline char *strchr(const char *s, int c) {
    69   char pattern[2];
     114static inline char *
     115strchr (
     116  const char  *s,
     117  int         c
     118  )
     119{
     120  char  pattern[2];
     121
    70122  pattern[0] = c;
    71123  pattern[1] = 0;
     
    73125}
    74126
    75 static inline size_t strnlen (const char* str, size_t strsz ) {
     127static inline size_t
     128strnlen (
     129  const char  *str,
     130  size_t      strsz
     131  )
     132{
    76133  return AsciiStrnLenS (str, strsz);
    77134}
    78135
    79 static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) {
     136static inline size_t
     137strcmp (
     138  const char  *str1,
     139  const char  *str2
     140  )
     141{
     142  return AsciiStrCmp (str1, str2);
     143}
     144
     145static inline size_t
     146strncmp (
     147  const char  *str1,
     148  const char  *str2,
     149  size_t      strsz
     150  )
     151{
    80152  return AsciiStrnCmp (str1, str2, strsz);
    81153}
    82154
     155static inline size_t
     156strncpy (
     157  char        *dest,
     158  const char  *source,
     159  size_t      dest_max
     160  )
     161{
     162  return AsciiStrCpyS (dest, dest_max, source);
     163}
     164
    83165#endif /* _LIBFDT_ENV_H */
Note: See TracChangeset for help on using the changeset viewer.

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