]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
EdkCompatibilityPkg: Remove EdkCompatibilityPkg
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Thunk16 / Thunk16Lib.h
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
deleted file mode 100644 (file)
index 6c16e25..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  Thunk16Lib.h\r
-\r
-Abstract:\r
-\r
-  Real Mode Thunk Header file\r
-\r
---*/\r
-\r
-#ifndef __THUNK_16_LIB_H__\r
-#define __THUNK_16_LIB_H__\r
-#include "Tiano.h"\r
-\r
-//\r
-// Thunk Flags\r
-//\r
-#define THUNK_SAVE_FP_STATE         0x1\r
-#define THUNK_USER_STACK            0x2\r
-#define THUNK_INTERRUPT             0x10000\r
-\r
-//\r
-// Byte packed structure for 16-bit Real Mode FLAGS\r
-//\r
-typedef union {\r
-  struct {\r
-    UINT32  CF:1;           // Carry Flag\r
-    UINT32  Reserved_0:1;   // Reserved\r
-    UINT32  PF:1;           // Parity Flag\r
-    UINT32  Reserved_1:1;   // Reserved\r
-    UINT32  AF:1;           // Auxiliary Carry Flag\r
-    UINT32  Reserved_2:1;   // Reserved\r
-    UINT32  ZF:1;           // Zero Flag\r
-    UINT32  SF:1;           // Sign Flag\r
-    UINT32  TF:1;           // Trap Flag\r
-    UINT32  IF:1;           // Interrupt Enable Flag\r
-    UINT32  DF:1;           // Direction Flag\r
-    UINT32  OF:1;           // Overflow Flag\r
-    UINT32  IOPL:2;         // I/O Privilege Level\r
-    UINT32  NT:1;           // Nested Task\r
-    UINT32  Reserved_3:1;   // Reserved\r
-  } Bits;\r
-  UINTN     UintN;\r
-} IA32_FLAGS16;\r
-\r
-//\r
-// Byte packed structure for EFLAGS\r
-// 32-bits on IA32\r
-// 64-bits on X64\r
-//\r
-\r
-typedef union {\r
-  struct {\r
-    UINT32  CF:1;           // Carry Flag\r
-    UINT32  Reserved_0:1;   // Reserved\r
-    UINT32  PF:1;           // Parity Flag\r
-    UINT32  Reserved_1:1;   // Reserved\r
-    UINT32  AF:1;           // Auxiliary Carry Flag\r
-    UINT32  Reserved_2:1;   // Reserved\r
-    UINT32  ZF:1;           // Zero Flag\r
-    UINT32  SF:1;           // Sign Flag\r
-    UINT32  TF:1;           // Trap Flag\r
-    UINT32  IF:1;           // Interrupt Enable Flag\r
-    UINT32  DF:1;           // Direction Flag\r
-    UINT32  OF:1;           // Overflow Flag\r
-    UINT32  IOPL:2;         // I/O Privilege Level\r
-    UINT32  NT:1;           // Nested Task\r
-    UINT32  Reserved_3:1;   // Reserved\r
-    UINT32  RF:1;           // Resume Flag\r
-    UINT32  VM:1;           // Virtual 8086 Mode\r
-    UINT32  AC:1;           // Alignment Check\r
-    UINT32  VIF:1;          // Virtual Interrupt Flag\r
-    UINT32  VIP:1;          // Virtual Interrupt Pending\r
-    UINT32  ID:1;           // ID Flag\r
-    UINT32  Reserved_4:10;  // Reserved\r
-  } Bits;\r
-  UINTN     UintN;\r
-} IA32_EFLAGS32;\r
-\r
-//\r
-// Byte packed structure for an FP/SSE/SSE2 context\r
-//\r
-typedef struct {\r
-  UINT8  Buffer[512];\r
-} IA32_FX_BUFFER;\r
-\r
-//\r
-// Structures for the 16-bit real mode thunks\r
-//\r
-typedef struct {\r
-  UINT32                            Reserved1;\r
-  UINT32                            Reserved2;\r
-  UINT32                            Reserved3;\r
-  UINT32                            Reserved4;\r
-  UINT8                             BL;\r
-  UINT8                             BH;\r
-  UINT16                            Reserved5;\r
-  UINT8                             DL;\r
-  UINT8                             DH;\r
-  UINT16                            Reserved6;\r
-  UINT8                             CL;\r
-  UINT8                             CH;\r
-  UINT16                            Reserved7;\r
-  UINT8                             AL;\r
-  UINT8                             AH;\r
-  UINT16                            Reserved8;\r
-} IA32_BYTE_REGS;\r
-\r
-typedef struct {\r
-  UINT16                            DI;\r
-  UINT16                            Reserved1;\r
-  UINT16                            SI;\r
-  UINT16                            Reserved2;\r
-  UINT16                            BP;\r
-  UINT16                            Reserved3;\r
-  UINT16                            SP;\r
-  UINT16                            Reserved4;\r
-  UINT16                            BX;\r
-  UINT16                            Reserved5;\r
-  UINT16                            DX;\r
-  UINT16                            Reserved6;\r
-  UINT16                            CX;\r
-  UINT16                            Reserved7;\r
-  UINT16                            AX;\r
-  UINT16                            Reserved8;\r
-  UINT16                            DS;\r
-  UINT16                            ES;\r
-  UINT16                            FS;\r
-  UINT16                            GS;\r
-  IA32_FLAGS16                      Flags;\r
-  UINT16                            IP;\r
-  UINT16                            Reserved10;\r
-  UINT16                            CS;\r
-  UINT16                            SS;\r
-} IA32_WORD_REGS;\r
-\r
-typedef struct {\r
-  UINT32                            EDI;\r
-  UINT32                            ESI;\r
-  UINT32                            EBP;\r
-  UINT32                            ESP;\r
-  UINT32                            EBX;\r
-  UINT32                            EDX;\r
-  UINT32                            ECX;\r
-  UINT32                            EAX;\r
-  UINT16                            DS;\r
-  UINT16                            ES;\r
-  UINT16                            FS;\r
-  UINT16                            GS;\r
-  IA32_EFLAGS32                     EFLAGS;\r
-  UINT32                            EIP;\r
-  UINT16                            CS;\r
-  UINT16                            SS;\r
-} IA32_DWORD_REGS;\r
-\r
-typedef union {\r
-  IA32_DWORD_REGS                   E;\r
-  IA32_WORD_REGS                    X;\r
-  IA32_BYTE_REGS                    H;\r
-} IA32_REGISTER_SET;\r
-\r
-//\r
-// Byte packed structure for an 16-bit real mode thunks\r
-//\r
-typedef struct {\r
-  UINT32                            RealModeBuffer;\r
-  UINT32                            DefaultStack;\r
-} THUNK_CONTEXT;\r
-\r
-//\r
-// 16-bit thunking services\r
-//\r
-\r
-UINTN\r
-EFIAPI\r
-AsmThunk16GetProperties (\r
-  OUT     UINTN                     *MinimumStackSize OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Returns the properties of this real mode thunk implementation. Currently\r
-  there are 2 properties has been defined, the minimum real mode buffer size\r
-  and the minimum stack size.\r
-\r
-Arguments:\r
-\r
-  MinimumStackSize  - The minimum size required for a 16-bit stack.\r
-\r
-Returns:\r
-\r
-  The minimum size of the real mode buffer needed by this thunk implementation\r
-  is returned.\r
-\r
---*/\r
-;\r
-\r
-THUNK_CONTEXT *\r
-EFIAPI\r
-AsmThunk16SetProperties (\r
-  OUT     THUNK_CONTEXT             *ThunkContext,\r
-  IN      VOID                      *RealModeBuffer,\r
-  IN      UINTN                     BufferSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Tell this real mode thunk implementation the address and size of the real\r
-  mode buffer needed.\r
-\r
-Arguments:\r
-\r
-  ThunkContext    - The thunk context whose properties to set.\r
-  RealModeBuffer  - The address of the buffer allocated by caller. It should be\r
-                    aligned on a 16-byte boundary.\r
-                    This buffer must be in identity mapped pages.\r
-  BufferSize      - The size of RealModeBuffer. Must be larger than the minimum\r
-                    size required as returned by AsmThunk16GetProperties().\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-AsmThunk16SetUserStack (\r
-  IN THUNK_CONTEXT             *ThunkContext,\r
-  IN VOID                      *Stack,\r
-  IN UINTN                     StackSize\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-AsmThunk16Destroy (\r
-  IN OUT  THUNK_CONTEXT             *ThunkContext\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Reset all internal states to their initial values. The caller should not\r
-  release the real mode buffer until after a call to this function.\r
-\r
-Arguments:\r
-\r
-  ThunkContext  - The thunk context to destroy.\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-;\r
-\r
-IA32_REGISTER_SET *\r
-EFIAPI\r
-AsmThunk16FarCall86 (\r
-  IN      THUNK_CONTEXT             *ThunkContext,\r
-  IN OUT  IA32_REGISTER_SET         *RegisterSet,\r
-  IN      UINT32                    ThunkFlags\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Make a far call to 16-bit code.\r
-\r
-  NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts\r
-        disabled because of GDTR and IDTR manipulations.\r
-        This function must be placed in identity mapped pages.\r
-\r
-Arguments:\r
-\r
-  ThunkContext  - Thunk context to use.\r
-  RegisterSet   - CPU registers would be set to the values contained in this\r
-                  structure before making the far call. Then CPU registers are\r
-                  copied back to this structure.\r
-                  CS:EIP points to the real mode code being called on input.\r
-                  SS:ESP points to the real mode stack if THUNK_USER_STACK is\r
-                  set on input, otherwise ignored.\r
-                  EFlages is ignored on input.\r
-                  On output, values of CS, EIP, SS and ESP should be ignored.\r
-  ThunkFlags    - 2 flags have currently been defined, THUNK_SAVE_FP_STATE and\r
-                  THUNK_USER_STACK.\r
-                  THUNK_SAVE_FP_STATE - FPU state would be saved/restored\r
-                                        before/after calling real mode code.\r
-                  THUNK_USER_STACK    - The stack specified by SS:ESP would be\r
-                                        used instead of the default stack.\r
-\r
-Returns:\r
-\r
-  RegisterSet is returned.\r
-\r
---*/\r
-;\r
-\r
-IA32_REGISTER_SET *\r
-EFIAPI\r
-AsmThunk16Int86 (\r
-  IN      THUNK_CONTEXT             *ThunkContext,\r
-  IN      UINT8                     IntNumber,\r
-  IN OUT  IA32_REGISTER_SET         *RegisterSet,\r
-  IN      UINT32                    ThunkFlags\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Invoke a 16-bit interrupt handler.\r
-\r
-  NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts\r
-        disabled because of GDTR and IDTR manipulations.\r
-        This function must be placed in identity mapped pages.\r
-\r
-Arguments:\r
-\r
-  ThunkContext  - Thunk context to use.\r
-  IntNumber     - The ordinal of the interrupt handler ranging from 0 to 255.\r
-  RegisterSet   - CPU registers would be set to the values contained in this\r
-                  structure before making the far call. Then CPU registers are\r
-                  copied back to this structure.\r
-                  SS:ESP points to the real mode stack if THUNK_USER_STACK is\r
-                  set on input, otherwise ignored.\r
-                  EFlages is ignored on input.\r
-                  On output, values of CS, EIP, SS and ESP should be ignored.\r
-  ThunkFlags    - 2 flags have currently been defined, THUNK_SAVE_FP_STATE and\r
-                  THUNK_USER_STACK.\r
-                  THUNK_SAVE_FP_STATE - FPU state would be saved/restored\r
-                                        before/after calling real mode code.\r
-                  THUNK_USER_STACK    - The stack specified by SS:ESP would be\r
-                                        used instead of the default stack.\r
-\r
-Returns:\r
-\r
-  RegisterSet is returned.\r
-\r
---*/\r
-;\r
-\r
-#endif\r