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

  • TabularUnified trunk/src/VBox/Devices/EFI/FirmwareNew/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h

    r89983 r99404  
    22  Common header file for CPU Exception Handler Library.
    33
    4   Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>
    55  SPDX-License-Identifier: BSD-2-Clause-Patent
    66
     
    2121#include <Library/CpuExceptionHandlerLib.h>
    2222
    23 #define  CPU_EXCEPTION_NUM          32
    24 #define  CPU_INTERRUPT_NUM         256
    25 #define  HOOKAFTER_STUB_SIZE        16
     23#define  CPU_EXCEPTION_NUM    32
     24#define  CPU_INTERRUPT_NUM    256
     25#define  HOOKAFTER_STUB_SIZE  18
    2626
    2727//
    2828// Exception Error Code of Page-Fault Exception
    2929//
    30 #define IA32_PF_EC_P                BIT0
    31 #define IA32_PF_EC_WR               BIT1
    32 #define IA32_PF_EC_US               BIT2
    33 #define IA32_PF_EC_RSVD             BIT3
    34 #define IA32_PF_EC_ID               BIT4
    35 #define IA32_PF_EC_PK               BIT5
    36 #define IA32_PF_EC_SS               BIT6
    37 #define IA32_PF_EC_SGX              BIT15
     30#define IA32_PF_EC_P     BIT0
     31#define IA32_PF_EC_WR    BIT1
     32#define IA32_PF_EC_US    BIT2
     33#define IA32_PF_EC_RSVD  BIT3
     34#define IA32_PF_EC_ID    BIT4
     35#define IA32_PF_EC_PK    BIT5
     36#define IA32_PF_EC_SS    BIT6
     37#define IA32_PF_EC_SGX   BIT15
    3838
    3939#include "ArchInterruptDefs.h"
     
    4848  FixedPcdGet32 (PcdCpuKnownGoodStackSize)
    4949
    50 #define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)
     50#define CPU_TSS_GDT_SIZE  (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)
    5151
    5252//
     
    5454//
    5555typedef struct {
    56   UINTN ExceptionStart;
    57   UINTN ExceptionStubHeaderSize;
    58   UINTN HookAfterStubHeaderStart;
     56  UINTN    ExceptionStart;
     57  UINTN    ExceptionStubHeaderSize;
     58  UINTN    HookAfterStubHeaderStart;
    5959} EXCEPTION_HANDLER_TEMPLATE_MAP;
    6060
    6161typedef struct {
    62   UINTN                       IdtEntryCount;
    63   SPIN_LOCK                   DisplayMessageSpinLock;
    64   RESERVED_VECTORS_DATA       *ReservedVectors;
    65   EFI_CPU_INTERRUPT_HANDLER   *ExternalInterruptHandler;
     62  UINTN                        IdtEntryCount;
     63  SPIN_LOCK                    DisplayMessageSpinLock;
     64  RESERVED_VECTORS_DATA        *ReservedVectors;
     65  EFI_CPU_INTERRUPT_HANDLER    *ExternalInterruptHandler;
    6666} EXCEPTION_HANDLER_DATA;
    6767
    68 extern CONST UINT32                mErrorCodeFlag;
    69 extern CONST UINTN                 mDoFarReturnFlag;
     68extern CONST UINT32  mErrorCodeFlag;
     69extern CONST UINTN   mDoFarReturnFlag;
    7070
    7171/**
     
    7878EFIAPI
    7979AsmGetTemplateAddressMap (
    80   OUT EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap
     80  OUT EXCEPTION_HANDLER_TEMPLATE_MAP  *AddressMap
    8181  );
    8282
     
    9191VOID
    9292ArchUpdateIdtEntry (
    93   OUT IA32_IDT_GATE_DESCRIPTOR       *IdtEntry,
    94   IN  UINTN                          InterruptHandler
     93  OUT IA32_IDT_GATE_DESCRIPTOR  *IdtEntry,
     94  IN  UINTN                     InterruptHandler
    9595  );
    9696
     
    103103UINTN
    104104ArchGetIdtHandler (
    105   IN IA32_IDT_GATE_DESCRIPTOR        *IdtEntry
     105  IN IA32_IDT_GATE_DESCRIPTOR  *IdtEntry
    106106  );
    107107
     
    129129VOID
    130130DumpModuleImageInfo (
    131   IN  UINTN              CurrentEip
     131  IN  UINTN  CurrentEip
    132132  );
    133133
     
    140140VOID
    141141DumpImageAndCpuContent (
    142   IN EFI_EXCEPTION_TYPE   ExceptionType,
    143   IN EFI_SYSTEM_CONTEXT   SystemContext
     142  IN EFI_EXCEPTION_TYPE  ExceptionType,
     143  IN EFI_SYSTEM_CONTEXT  SystemContext
    144144  );
    145145
     
    158158EFI_STATUS
    159159InitializeCpuExceptionHandlersWorker (
    160   IN EFI_VECTOR_HANDOFF_INFO       *VectorInfo OPTIONAL,
    161   IN OUT EXCEPTION_HANDLER_DATA    *ExceptionHandlerData
     160  IN EFI_VECTOR_HANDOFF_INFO     *VectorInfo OPTIONAL,
     161  IN OUT EXCEPTION_HANDLER_DATA  *ExceptionHandlerData
    162162  );
    163163
     
    181181EFI_STATUS
    182182RegisterCpuInterruptHandlerWorker (
    183   IN EFI_EXCEPTION_TYPE            InterruptType,
    184   IN EFI_CPU_INTERRUPT_HANDLER     InterruptHandler,
    185   IN EXCEPTION_HANDLER_DATA        *ExceptionHandlerData
     183  IN EFI_EXCEPTION_TYPE         InterruptType,
     184  IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler,
     185  IN EXCEPTION_HANDLER_DATA     *ExceptionHandlerData
    186186  );
    187187
     
    211211VOID
    212212ArchSaveExceptionContext (
    213   IN UINTN                        ExceptionType,
    214   IN EFI_SYSTEM_CONTEXT           SystemContext,
    215   IN EXCEPTION_HANDLER_DATA       *ExceptionHandlerData
     213  IN UINTN                   ExceptionType,
     214  IN EFI_SYSTEM_CONTEXT      SystemContext,
     215  IN EXCEPTION_HANDLER_DATA  *ExceptionHandlerData
    216216  );
    217217
     
    225225VOID
    226226ArchRestoreExceptionContext (
    227   IN UINTN                        ExceptionType,
    228   IN EFI_SYSTEM_CONTEXT           SystemContext,
    229   IN EXCEPTION_HANDLER_DATA       *ExceptionHandlerData
     227  IN UINTN                   ExceptionType,
     228  IN EFI_SYSTEM_CONTEXT      SystemContext,
     229  IN EXCEPTION_HANDLER_DATA  *ExceptionHandlerData
    230230  );
    231231
     
    241241EFIAPI
    242242AsmVectorNumFixup (
    243   IN VOID    *NewVectorAddr,
    244   IN UINT8   VectorNum,
    245   IN VOID    *OldVectorAddr
     243  IN VOID   *NewVectorAddr,
     244  IN UINT8  VectorNum,
     245  IN VOID   *OldVectorAddr
    246246  );
    247247
     
    259259EFI_STATUS
    260260ReadAndVerifyVectorInfo (
    261   IN  EFI_VECTOR_HANDOFF_INFO       *VectorInfo,
    262   OUT RESERVED_VECTORS_DATA         *ReservedVector,
    263   IN  UINTN                         VectorCount
     261  IN  EFI_VECTOR_HANDOFF_INFO  *VectorInfo,
     262  OUT RESERVED_VECTORS_DATA    *ReservedVector,
     263  IN  UINTN                    VectorCount
    264264  );
    265265
     
    273273CONST CHAR8 *
    274274GetExceptionNameStr (
    275   IN EFI_EXCEPTION_TYPE          ExceptionType
     275  IN EFI_EXCEPTION_TYPE  ExceptionType
    276276  );
    277277
     
    285285VOID
    286286CommonExceptionHandlerWorker (
    287   IN EFI_EXCEPTION_TYPE          ExceptionType,
    288   IN EFI_SYSTEM_CONTEXT          SystemContext,
    289   IN EXCEPTION_HANDLER_DATA      *ExceptionHandlerData
    290   );
    291 
    292 /**
    293   Setup separate stack for specific exceptions.
    294 
    295   @param[in] StackSwitchData      Pointer to data required for setuping up
    296                                   stack switch.
    297 
    298   @retval EFI_SUCCESS             The exceptions have been successfully
    299                                   initialized with new stack.
    300   @retval EFI_INVALID_PARAMETER   StackSwitchData contains invalid content.
     287  IN EFI_EXCEPTION_TYPE      ExceptionType,
     288  IN EFI_SYSTEM_CONTEXT      SystemContext,
     289  IN EXCEPTION_HANDLER_DATA  *ExceptionHandlerData
     290  );
     291
     292/**
     293  Setup separate stacks for certain exception handlers.
     294
     295  @param[in]       Buffer        Point to buffer used to separate exception stack.
     296  @param[in, out]  BufferSize    On input, it indicates the byte size of Buffer.
     297                                 If the size is not enough, the return status will
     298                                 be EFI_BUFFER_TOO_SMALL, and output BufferSize
     299                                 will be the size it needs.
     300
     301  @retval EFI_SUCCESS             The stacks are assigned successfully.
     302  @retval EFI_BUFFER_TOO_SMALL    This BufferSize is too small.
     303  @retval EFI_UNSUPPORTED         This function is not supported.
    301304**/
    302305EFI_STATUS
    303306ArchSetupExceptionStack (
    304   IN CPU_EXCEPTION_INIT_DATA        *StackSwitchData
     307  IN     VOID   *Buffer,
     308  IN OUT UINTN  *BufferSize
    305309  );
    306310
     
    319323
    320324#endif
    321 
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