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:
3 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Include/X64/Nasm.inc

    r89983 r99404  
    11;------------------------------------------------------------------------------
    22;
    3 ; Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
     3; Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>
    44; SPDX-License-Identifier: BSD-2-Clause-Patent
    55;
     
    1010;------------------------------------------------------------------------------
    1111
    12 %macro SAVEPREVSSP     0
    13     DB 0xF3, 0x0F, 0x01, 0xEA
     12;
     13; Macro for the PVALIDATE instruction, defined in AMD APM volume 3.
     14; NASM feature request URL: https://bugzilla.nasm.us/show_bug.cgi?id=3392753
     15;
     16%macro PVALIDATE       0
     17    DB 0xF2, 0x0F, 0x01, 0xFF
    1418%endmacro
    1519
    16 %macro CLRSSBSY_RAX    0
    17     DB 0xF3, 0x0F, 0xAE, 0x30
    18 %endmacro
    19 
    20 %macro RSTORSSP_RAX    0
    21     DB 0xF3, 0x0F, 0x01, 0x28
    22 %endmacro
    23 
    24 %macro SETSSBSY        0
    25     DB 0xF3, 0x0F, 0x01, 0xE8
    26 %endmacro
    27 
    28 %macro READSSP_RAX     0
    29     DB 0xF3, 0x48, 0x0F, 0x1E, 0xC8
    30 %endmacro
    31 
    32 %macro INCSSP_RAX      0
    33     DB 0xF3, 0x48, 0x0F, 0xAE, 0xE8
     20;
     21; Macro for the RMPADJUST instruction, defined in AMD APM volume 3.
     22; NASM feature request URL: https://bugzilla.nasm.us/show_bug.cgi?id=3392754
     23;
     24%macro RMPADJUST       0
     25    DB 0xF3, 0x0F, 0x01, 0xFE
    3426%endmacro
    3527
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Include/X64/ProcessorBind.h

    r85718 r99404  
    1818// Make sure we are using the correct packing rules per EFI specification
    1919//
    20 #if !defined(__GNUC__)
    21 #pragma pack()
    22 #endif
    23 
    24 #if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)  && !defined(__APPLE__)
     20#if !defined (__GNUC__)
     21  #pragma pack()
     22#endif
     23
     24#if defined (__GNUC__) && defined (__pic__) && !defined (USING_LTO)  && !defined (__APPLE__)
    2525//
    2626// Mark all symbol declarations and references as hidden, meaning they will
     
    3333// pragma in that case (and doing so will cause other issues).
    3434//
    35 #pragma GCC visibility push (hidden)
    36 #endif
    37 
    38 #if defined(__INTEL_COMPILER)
     35  #pragma GCC visibility push (hidden)
     36#endif
     37
     38#if defined (__INTEL_COMPILER)
    3939//
    4040// Disable ICC's remark #869: "Parameter" was never referenced warning.
    4141// This is legal ANSI C code so we disable the remark that is turned on with -Wall
    4242//
    43 #pragma warning ( disable : 869 )
     43  #pragma warning ( disable : 869 )
    4444
    4545//
     
    4747// This is legal ANSI C code so we disable the remark that is turned on with /W4
    4848//
    49 #pragma warning ( disable : 1418 )
     49  #pragma warning ( disable : 1418 )
    5050
    5151//
     
    5353// This is legal ANSI C code so we disable the remark that is turned on with /W4
    5454//
    55 #pragma warning ( disable : 1419 )
     55  #pragma warning ( disable : 1419 )
    5656
    5757//
     
    5959// This is legal ANSI C code so we disable the remark that is turned on with /W4
    6060//
    61 #pragma warning ( disable : 593 )
    62 
    63 #endif
    64 
    65 
    66 #if defined(_MSC_EXTENSIONS)
     61  #pragma warning ( disable : 593 )
     62
     63#endif
     64
     65#if defined (_MSC_EXTENSIONS)
    6766
    6867//
     
    7473// Disabling bitfield type checking warnings.
    7574//
    76 #pragma warning ( disable : 4214 )
     75  #pragma warning ( disable : 4214 )
    7776
    7877//
    7978// Disabling the unreferenced formal parameter warnings.
    8079//
    81 #pragma warning ( disable : 4100 )
     80  #pragma warning ( disable : 4100 )
    8281
    8382//
     
    8584// to a constant string.
    8685//
    87 #pragma warning ( disable : 4057 )
     86  #pragma warning ( disable : 4057 )
    8887
    8988//
    9089// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
    9190//
    92 #pragma warning ( disable : 4127 )
     91  #pragma warning ( disable : 4127 )
    9392
    9493//
    9594// This warning is caused by functions defined but not used. For precompiled header only.
    9695//
    97 #pragma warning ( disable : 4505 )
     96  #pragma warning ( disable : 4505 )
    9897
    9998//
    10099// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
    101100//
    102 #pragma warning ( disable : 4206 )
    103 
    104 #if defined(_MSC_VER) && _MSC_VER >= 1800
     101  #pragma warning ( disable : 4206 )
     102
     103  #if defined (_MSC_VER) && _MSC_VER >= 1800
    105104
    106105//
     
    112111// positive issues in VS2013 and VS2015 build
    113112//
    114 #pragma warning ( disable : 4701 )
     113    #pragma warning ( disable : 4701 )
    115114
    116115//
     
    118117// false positive issues in VS2013 and VS2015 build
    119118//
    120 #pragma warning ( disable : 4703 )
    121 
    122 #endif
    123 
    124 #endif
    125 
    126 
    127 #if defined(_MSC_EXTENSIONS)
    128   //
    129   // use Microsoft C compiler dependent integer width types
    130   //
    131 
    132   ///
    133   /// 8-byte unsigned value
    134   ///
    135   typedef unsigned __int64    UINT64;
    136   ///
    137   /// 8-byte signed value
    138   ///
    139   typedef __int64             INT64;
    140   ///
    141   /// 4-byte unsigned value
    142   ///
    143   typedef unsigned __int32    UINT32;
    144   ///
    145   /// 4-byte signed value
    146   ///
    147   typedef __int32             INT32;
    148   ///
    149   /// 2-byte unsigned value
    150   ///
    151   typedef unsigned short      UINT16;
    152   ///
    153   /// 2-byte Character.  Unless otherwise specified all strings are stored in the
    154   /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
    155   ///
    156   typedef unsigned short      CHAR16;
    157   ///
    158   /// 2-byte signed value
    159   ///
    160   typedef short               INT16;
    161   ///
    162   /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
    163   /// values are undefined.
    164   ///
    165   typedef unsigned char       BOOLEAN;
    166   ///
    167   /// 1-byte unsigned value
    168   ///
    169   typedef unsigned char       UINT8;
    170   ///
    171   /// 1-byte Character
    172   ///
    173   typedef char                CHAR8;
    174   ///
    175   /// 1-byte signed value
    176   ///
    177   typedef signed char         INT8;
     119    #pragma warning ( disable : 4703 )
     120
     121  #endif
     122
     123#endif
     124
     125#if defined (_MSC_EXTENSIONS)
     126//
     127// use Microsoft C compiler dependent integer width types
     128//
     129
     130///
     131/// 8-byte unsigned value
     132///
     133typedef unsigned __int64 UINT64;
     134///
     135/// 8-byte signed value
     136///
     137typedef __int64 INT64;
     138///
     139/// 4-byte unsigned value
     140///
     141typedef unsigned __int32 UINT32;
     142///
     143/// 4-byte signed value
     144///
     145typedef __int32 INT32;
     146///
     147/// 2-byte unsigned value
     148///
     149typedef unsigned short UINT16;
     150///
     151/// 2-byte Character.  Unless otherwise specified all strings are stored in the
     152/// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
     153///
     154typedef unsigned short CHAR16;
     155///
     156/// 2-byte signed value
     157///
     158typedef short INT16;
     159///
     160/// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
     161/// values are undefined.
     162///
     163typedef unsigned char BOOLEAN;
     164///
     165/// 1-byte unsigned value
     166///
     167typedef unsigned char UINT8;
     168///
     169/// 1-byte Character
     170///
     171typedef char CHAR8;
     172///
     173/// 1-byte signed value
     174///
     175typedef signed char INT8;
    178176#else
    179   ///
    180   /// 8-byte unsigned value
    181   ///
    182   typedef unsigned long long UINT64;
    183   ///
    184   /// 8-byte signed value
    185   ///
    186   typedef long long          INT64;
    187   ///
    188   /// 4-byte unsigned value
    189   ///
    190   typedef unsigned int        UINT32;
    191   ///
    192   /// 4-byte signed value
    193   ///
    194   typedef int                INT32;
    195   ///
    196   /// 2-byte unsigned value
    197   ///
    198   typedef unsigned short      UINT16;
    199   ///
    200   /// 2-byte Character.  Unless otherwise specified all strings are stored in the
    201   /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
    202   ///
    203   typedef unsigned short      CHAR16;
    204   ///
    205   /// 2-byte signed value
    206   ///
    207   typedef short              INT16;
    208   ///
    209   /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
    210   /// values are undefined.
    211   ///
    212   typedef unsigned char      BOOLEAN;
    213   ///
    214   /// 1-byte unsigned value
    215   ///
    216   typedef unsigned char      UINT8;
    217   ///
    218   /// 1-byte Character
    219   ///
    220   typedef char                CHAR8;
    221   ///
    222   /// 1-byte signed value
    223   ///
    224   typedef signed char        INT8;
     177///
     178/// 8-byte unsigned value
     179///
     180typedef unsigned long long UINT64;
     181///
     182/// 8-byte signed value
     183///
     184typedef long long INT64;
     185///
     186/// 4-byte unsigned value
     187///
     188typedef unsigned int UINT32;
     189///
     190/// 4-byte signed value
     191///
     192typedef int INT32;
     193///
     194/// 2-byte unsigned value
     195///
     196typedef unsigned short UINT16;
     197///
     198/// 2-byte Character.  Unless otherwise specified all strings are stored in the
     199/// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
     200///
     201typedef unsigned short CHAR16;
     202///
     203/// 2-byte signed value
     204///
     205typedef short INT16;
     206///
     207/// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
     208/// values are undefined.
     209///
     210typedef unsigned char BOOLEAN;
     211///
     212/// 1-byte unsigned value
     213///
     214typedef unsigned char UINT8;
     215///
     216/// 1-byte Character
     217///
     218typedef char CHAR8;
     219///
     220/// 1-byte signed value
     221///
     222typedef signed char INT8;
    225223#endif
    226224
     
    229227/// 8 bytes on supported 64-bit processor instructions)
    230228///
    231 typedef UINT64  UINTN;
     229typedef UINT64 UINTN;
    232230///
    233231/// Signed value of native width.  (4 bytes on supported 32-bit processor instructions,
    234232/// 8 bytes on supported 64-bit processor instructions)
    235233///
    236 typedef INT64   INTN;
    237 
     234typedef INT64 INTN;
    238235
    239236//
     
    244241/// A value of native width with the highest bit set.
    245242///
    246 #define MAX_BIT     0x8000000000000000ULL
     243#define MAX_BIT  0x8000000000000000ULL
    247244///
    248245/// A value of native width with the two highest bits set.
     
    253250/// Maximum legal x64 address
    254251///
    255 #define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL
     252#define MAX_ADDRESS  0xFFFFFFFFFFFFFFFFULL
    256253
    257254///
    258255/// Maximum usable address at boot time
    259256///
    260 #define MAX_ALLOC_ADDRESS   MAX_ADDRESS
     257#define MAX_ALLOC_ADDRESS  MAX_ADDRESS
    261258
    262259///
     
    269266/// Minimum legal x64 INTN value.
    270267///
    271 #define MIN_INTN   (((INTN)-9223372036854775807LL) - 1)
     268#define MIN_INTN  (((INTN)-9223372036854775807LL) - 1)
    272269
    273270///
    274271/// The stack alignment required for x64
    275272///
    276 #define CPU_STACK_ALIGNMENT   16
     273#define CPU_STACK_ALIGNMENT  16
    277274
    278275///
    279276/// Page allocation granularity for x64
    280277///
    281 #define DEFAULT_PAGE_ALLOCATION_GRANULARITY   (0x1000)
    282 #define RUNTIME_PAGE_ALLOCATION_GRANULARITY   (0x1000)
     278#define DEFAULT_PAGE_ALLOCATION_GRANULARITY  (0x1000)
     279#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x1000)
    283280
    284281//
     
    288285//
    289286#ifdef EFIAPI
    290   ///
    291   /// If EFIAPI is already defined, then we use that definition.
    292   ///
    293 #elif defined(_MSC_EXTENSIONS)
    294   ///
    295   /// Microsoft* compiler specific method for EFIAPI calling convention.
    296   ///
    297   #define EFIAPI __cdecl
    298 #elif defined(__GNUC__)
    299   ///
    300   /// Define the standard calling convention regardless of optimization level.
    301   /// The GCC support assumes a GCC compiler that supports the EFI ABI. The EFI
    302   /// ABI is much closer to the x64 Microsoft* ABI than standard x64 (x86-64)
    303   /// GCC ABI. Thus a standard x64 (x86-64) GCC compiler can not be used for
    304   /// x64. Warning the assembly code in the MDE x64 does not follow the correct
    305   /// ABI for the standard x64 (x86-64) GCC.
    306   ///
    307   #define EFIAPI
     287///
     288/// If EFIAPI is already defined, then we use that definition.
     289///
     290#elif defined (_MSC_EXTENSIONS)
     291///
     292/// Microsoft* compiler specific method for EFIAPI calling convention.
     293///
     294#define EFIAPI __cdecl
     295#elif defined (__GNUC__)
     296///
     297/// Define the standard calling convention regardless of optimization level.
     298/// The GCC support assumes a GCC compiler that supports the EFI ABI. The EFI
     299/// ABI is much closer to the x64 Microsoft* ABI than standard x64 (x86-64)
     300/// GCC ABI. Thus a standard x64 (x86-64) GCC compiler can not be used for
     301/// x64. Warning the assembly code in the MDE x64 does not follow the correct
     302/// ABI for the standard x64 (x86-64) GCC.
     303///
     304#define EFIAPI
    308305#else
    309   ///
    310   /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI
    311   /// is the standard.
    312   ///
    313   #define EFIAPI
    314 #endif
    315 
    316 #if defined(__GNUC__) || defined(__clang__)
    317   ///
    318   /// For GNU assembly code, .global or .globl can declare global symbols.
    319   /// Define this macro to unify the usage.
    320   ///
    321   #define ASM_GLOBAL .globl
     306///
     307/// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI
     308/// is the standard.
     309///
     310#define EFIAPI
     311#endif
     312
     313#if defined (__GNUC__) || defined (__clang__)
     314///
     315/// For GNU assembly code, .global or .globl can declare global symbols.
     316/// Define this macro to unify the usage.
     317///
     318#define ASM_GLOBAL .globl
    322319#endif
    323320
     
    332329
    333330**/
    334 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
     331#define FUNCTION_ENTRY_POINT(FunctionPointer)  (VOID *)(UINTN)(FunctionPointer)
    335332
    336333#ifndef __USER_LABEL_PREFIX__
     
    339336
    340337#endif
    341 
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