ReactOS  0.4.15-dev-1070-ge1a01de
bios.c File Reference
#include <hal.h>
#include <debug.h>
#include <setjmp.h>
Include dependency graph for bios.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

void __cdecl HalpTrap0D ()
 
BOOLEAN FASTCALL HalpOpcodeInvalid (IN PHAL_BIOS_FRAME BiosFrame)
 
BOOLEAN FASTCALL HalpPushInt (IN PHAL_BIOS_FRAME BiosFrame, IN ULONG Interrupt)
 
BOOLEAN FASTCALL HalpOpcodeINTnn (IN PHAL_BIOS_FRAME BiosFrame)
 
BOOLEAN FASTCALL HalpDispatchV86Opcode (IN PKTRAP_FRAME TrapFrame)
 
DECLSPEC_NORETURN VOID FASTCALL HalpTrap0DHandler (IN PKTRAP_FRAME TrapFrame)
 
VOID DECLSPEC_NORETURN HalpTrap06 (VOID)
 
VOID NTAPI HalpBiosCall (VOID)
 
VOID NTAPI HalpBorrowTss (VOID)
 
VOID NTAPI HalpReturnTss (VOID)
 
VOID NTAPI HalpStoreAndClearIopm (VOID)
 
VOID NTAPI HalpRestoreIopm (VOID)
 
VOID NTAPI HalpMapRealModeMemory (VOID)
 
VOID NTAPI HalpSwitchToRealModeTrapHandlers (VOID)
 
VOID NTAPI HalpSetupRealModeIoPermissionsAndTask (VOID)
 
VOID NTAPI HalpRestoreTrapHandlers (VOID)
 
VOID NTAPI HalpRestoreIoPermissionsAndTask (VOID)
 
VOID NTAPI HalpUnmapRealModeMemory (VOID)
 
BOOLEAN NTAPI HalpBiosDisplayReset (VOID)
 

Variables

ULONG HalpSavedPfn
 
HARDWARE_PTE HalpSavedPte
 
PVOID HalpGpfHandler
 
PVOID HalpBopHandler
 
ULONG HalpSavedEsp0
 
USHORT HalpSavedTss
 
USHORT HalpSavedIopmBase
 
PUSHORT HalpSavedIoMap
 
USHORT HalpSavedIoMapData [IOPM_SIZE/sizeof(USHORT)][2]
 
ULONG HalpSavedIoMapEntries
 
ULONG_PTR HalpSavedEsp
 
PVOID HalpRealModeEnd
 
jmp_buf HalpSavedContext
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file bios.c.

Function Documentation

◆ HalpBiosCall()

VOID NTAPI HalpBiosCall ( VOID  )

Definition at line 251 of file bios.c.

252 {
253  /* Must be volatile so it doesn't get optimized away! */
254  volatile KTRAP_FRAME V86TrapFrame;
255  ULONG_PTR StackOffset, CodeOffset;
256 
257  /* Save the context, check for return */
258  if (_setjmp(HalpSavedContext))
259  {
260  /* Returned from v86 */
261  return;
262  }
263 
264  /* Kill alignment faults */
266 
267  /* Set new stack address */
268  KeGetPcr()->TSS->Esp0 = (ULONG)&V86TrapFrame - 0x20 - sizeof(FX_SAVE_AREA);
269 
270  /* Compute segmented IP and SP offsets */
271  StackOffset = (ULONG_PTR)&HalpRealModeEnd - 4 - (ULONG_PTR)HalpRealModeStart;
272  CodeOffset = (ULONG_PTR)HalpRealModeStart & 0xFFF;
273 
274  /* Now build the V86 trap frame */
275  V86TrapFrame.V86Es = 0;
276  V86TrapFrame.V86Ds = 0;
277  V86TrapFrame.V86Gs = 0;
278  V86TrapFrame.V86Fs = 0;
279  V86TrapFrame.HardwareSegSs = 0x2000;
280  V86TrapFrame.HardwareEsp = StackOffset + CodeOffset;
281  V86TrapFrame.EFlags = __readeflags() | EFLAGS_V86_MASK | EFLAGS_IOPL;
282  V86TrapFrame.SegCs = 0x2000;
283  V86TrapFrame.Eip = CodeOffset;
284 
285  /* Exit to V86 mode */
286  HalpExitToV86((PKTRAP_FRAME)&V86TrapFrame);
287 }
VOID FASTCALL HalpExitToV86(PKTRAP_FRAME TrapFrame)
ULONG V86Es
Definition: ketypes.h:272
ULONG HardwareSegSs
Definition: ketypes.h:271
#define KeGetPcr()
Definition: ke.h:25
jmp_buf HalpSavedContext
Definition: bios.c:55
#define EFLAGS_V86_MASK
Definition: ketypes.h:129
uint32_t ULONG_PTR
Definition: typedefs.h:65
__INTRIN_INLINE uintptr_t __readeflags(void)
Definition: intrin_x86.h:1569
#define CR0_AM
Definition: asm.h:252
__INTRIN_INLINE void __writecr0(unsigned int Data)
Definition: intrin_x86.h:1684
USHORT SegCs
Definition: ketypes.h:380
ULONG HardwareEsp
Definition: ketypes.h:270
PVOID HalpRealModeEnd
#define EFLAGS_IOPL
Definition: cpu.c:17
__INTRIN_INLINE unsigned long __readcr0(void)
Definition: intrin_x86.h:1706
ULONG Eip
Definition: ketypes.h:267
ULONG V86Ds
Definition: ketypes.h:273
VOID __cdecl HalpRealModeStart(VOID)
ULONG V86Fs
Definition: ketypes.h:274
unsigned int ULONG
Definition: retypes.h:1
ULONG V86Gs
Definition: ketypes.h:275
#define ULONG_PTR
Definition: config.h:101
ULONG EFlags
Definition: ketypes.h:384

Referenced by HalpBiosDisplayReset().

◆ HalpBiosDisplayReset()

BOOLEAN NTAPI HalpBiosDisplayReset ( VOID  )

Definition at line 647 of file bios.c.

648 {
649 #if defined(SARCH_XBOX) || defined(SARCH_PC98)
650  /* There is no VGA BIOS on these machine types */
651  return FALSE;
652 #else
653  ULONG Flags;
654  PHARDWARE_PTE IdtPte;
655  BOOLEAN RestoreWriteProtection = FALSE;
656 
657  //
658  // Disable interrupts
659  //
660  Flags = __readeflags();
661  _disable();
662 
663  //
664  // Map memory available to the V8086 real-mode code
665  //
667 
668  //
669  // On P5, the first 7 entries of the IDT are write protected to work around
670  // the cmpxchg8b lock errata. Unprotect them here so we can set our custom
671  // invalid op-code handler.
672  //
673  IdtPte = HalAddressToPte(((PKIPCR)KeGetPcr())->IDT);
674  RestoreWriteProtection = IdtPte->Write != 0;
675  IdtPte->Write = 1;
676 
677  //
678  // Use special invalid opcode and GPF trap handlers
679  //
681 
682  //
683  // Configure the IOPM and TSS
684  //
686 
687  //
688  // Now jump to real mode
689  //
690  HalpBiosCall();
691 
692  //
693  // Restore kernel trap handlers
694  //
696 
697  //
698  // Restore write permission
699  //
700  IdtPte->Write = RestoreWriteProtection;
701 
702  //
703  // Restore TSS and IOPM
704  //
706 
707  //
708  // Restore low memory mapping
709  //
711 
712  //
713  // Restore interrupts if they were previously enabled
714  //
716  return TRUE;
717 #endif
718 }
#define TRUE
Definition: types.h:120
#define HalAddressToPte(x)
Definition: halp.h:163
#define KeGetPcr()
Definition: ke.h:25
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__INTRIN_INLINE uintptr_t __readeflags(void)
Definition: intrin_x86.h:1569
#define FALSE
Definition: types.h:117
VOID NTAPI HalpSwitchToRealModeTrapHandlers(VOID)
Definition: bios.c:516
unsigned char BOOLEAN
Definition: utils.h:177
VOID NTAPI HalpSetupRealModeIoPermissionsAndTask(VOID)
Definition: bios.c:538
__INTRIN_INLINE void __writeeflags(uintptr_t Value)
Definition: intrin_x86.h:1564
VOID NTAPI HalpMapRealModeMemory(VOID)
Definition: bios.c:449
ULONG64 Write
Definition: mmtypes.h:67
VOID NTAPI HalpBiosCall(VOID)
Definition: bios.c:251
void __cdecl _disable(void)
Definition: intrin_arm.h:365
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI HalpRestoreTrapHandlers(VOID)
Definition: bios.c:565
VOID NTAPI HalpUnmapRealModeMemory(VOID)
Definition: bios.c:611
VOID NTAPI HalpRestoreIoPermissionsAndTask(VOID)
Definition: bios.c:586

◆ HalpBorrowTss()

VOID NTAPI HalpBorrowTss ( VOID  )

Definition at line 294 of file bios.c.

295 {
296  USHORT Tss;
297  PKGDTENTRY TssGdt;
298  ULONG_PTR TssLimit;
299  PKTSS TssBase;
300 
301  //
302  // Get the current TSS and its GDT entry
303  //
304  Tss = Ke386GetTr();
305  TssGdt = &((PKIPCR)KeGetPcr())->GDT[Tss / sizeof(KGDTENTRY)];
306 
307  //
308  // Get the KTSS limit and check if it has IOPM space
309  //
310  TssLimit = TssGdt->LimitLow | TssGdt->HighWord.Bits.LimitHi << 16;
311 
312  //
313  // If the KTSS doesn't have enough space this is probably an NMI or DF
314  //
315  if (TssLimit > IOPM_SIZE)
316  {
317  //
318  // We are good to go
319  //
320  HalpSavedTss = 0;
321  return;
322  }
323 
324  //
325  // Get the "real" TSS
326  //
327  TssGdt = &((PKIPCR)KeGetPcr())->GDT[KGDT_TSS / sizeof(KGDTENTRY)];
328  TssBase = (PKTSS)(ULONG_PTR)(TssGdt->BaseLow |
329  TssGdt->HighWord.Bytes.BaseMid << 16 |
330  TssGdt->HighWord.Bytes.BaseHi << 24);
331 
332  //
333  // Switch to it
334  //
335  KeGetPcr()->TSS = TssBase;
336 
337  //
338  // Set it up
339  //
340  TssGdt->HighWord.Bits.Type = I386_TSS;
341  TssGdt->HighWord.Bits.Pres = 1;
342  TssGdt->HighWord.Bits.Dpl = 0;
343 
344  //
345  // Load new TSS and return old one
346  //
347  Ke386SetTr(KGDT_TSS);
348  HalpSavedTss = Tss;
349 }
#define IOPM_SIZE
Definition: ketypes.h:179
USHORT BaseLow
Definition: ketypes.h:336
struct _KIPCR * PKIPCR
#define KeGetPcr()
Definition: ke.h:25
uint32_t ULONG_PTR
Definition: typedefs.h:65
struct _KGDTENTRY::@2391::@2392 Bytes
Definition: ketypes.h:789
Definition: utils.h:160
#define KGDT_TSS
Definition: ketypes.h:79
#define PKTSS
Definition: ketypes.h:921
unsigned short USHORT
Definition: pedump.c:61
#define I386_TSS
Definition: ketypes.h:60
union _KGDTENTRY::@2391 HighWord
USHORT LimitLow
Definition: ketypes.h:335
USHORT HalpSavedTss
Definition: bios.c:38
struct _KGDTENTRY::@2391::@2393 Bits

Referenced by HalpSetupRealModeIoPermissionsAndTask().

◆ HalpDispatchV86Opcode()

BOOLEAN FASTCALL HalpDispatchV86Opcode ( IN PKTRAP_FRAME  TrapFrame)

Definition at line 158 of file bios.c.

159 {
160  UCHAR Instruction;
161  HAL_BIOS_FRAME BiosFrame;
162 
163  /* Fill out the BIOS frame */
164  BiosFrame.TrapFrame = TrapFrame;
165  BiosFrame.SegSs = TrapFrame->HardwareSegSs;
166  BiosFrame.Esp = TrapFrame->HardwareEsp;
167  BiosFrame.EFlags = TrapFrame->EFlags;
168  BiosFrame.SegCs = TrapFrame->SegCs;
169  BiosFrame.Eip = TrapFrame->Eip;
170  BiosFrame.Prefix = 0;
171 
172  /* Convert CS to linear */
173  BiosFrame.CsBase = BiosFrame.SegCs << 4;
174  BiosFrame.CsLimit = 0xFFFF;
175  BiosFrame.CsFlags = 0;
176 
177  /* Validate IP */
178  if (BiosFrame.Eip > BiosFrame.CsLimit) return FALSE;
179 
180  /* Read IP */
181  Instruction = *(PUCHAR)(BiosFrame.CsBase + BiosFrame.Eip);
182  if (Instruction != 0xCD)
183  {
184  /* We only support INT */
185  HalpOpcodeInvalid(&BiosFrame);
186  return FALSE;
187  }
188 
189  /* Handle the interrupt */
190  if (HalpOpcodeINTnn(&BiosFrame))
191  {
192  /* Update EIP */
193  TrapFrame->Eip = BiosFrame.Eip;
194 
195  /* We're done */
196  return TRUE;
197  }
198 
199  /* Failure */
200  return FALSE;
201 }
ULONG CsLimit
Definition: halp.h:21
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG CsBase
Definition: halp.h:22
#define FALSE
Definition: types.h:117
ULONG Esp
Definition: halp.h:16
BOOLEAN FASTCALL HalpOpcodeInvalid(IN PHAL_BIOS_FRAME BiosFrame)
Definition: bios.c:62
ULONG EFlags
Definition: halp.h:17
ULONG CsFlags
Definition: halp.h:23
ULONG SegSs
Definition: halp.h:15
ULONG SegCs
Definition: halp.h:18
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG Eip
Definition: halp.h:19
BOOLEAN FASTCALL HalpOpcodeINTnn(IN PHAL_BIOS_FRAME BiosFrame)
Definition: bios.c:120
PKTRAP_FRAME TrapFrame
Definition: halp.h:20
ULONG Prefix
Definition: halp.h:27

Referenced by HalpTrap0DHandler().

◆ HalpMapRealModeMemory()

VOID NTAPI HalpMapRealModeMemory ( VOID  )

Definition at line 449 of file bios.c.

450 {
451  PHARDWARE_PTE Pte, V86Pte;
452  ULONG i;
453 
454  //
455  // Get the page table directory for the lowest meg of memory
456  //
457  Pte = HalAddressToPde(0);
459  HalpSavedPte = *Pte;
460 
461  //
462  // Map it to the HAL reserved region and make it valid
463  //
464  Pte->Valid = 1;
465  Pte->Write = 1;
466  Pte->Owner = 1;
467  Pte->PageFrameNumber = (HalAddressToPde(0xFFC00000))->PageFrameNumber;
468 
469  //
470  // Flush the TLB
471  //
472  HalpFlushTLB();
473 
474  //
475  // Now loop the first meg of memory
476  //
477  for (i = 0; i < 0x100000; i += PAGE_SIZE)
478  {
479  //
480  // Identity map it
481  //
482  Pte = HalAddressToPte(i);
483  Pte->PageFrameNumber = i >> PAGE_SHIFT;
484  Pte->Valid = 1;
485  Pte->Write = 1;
486  Pte->Owner = 1;
487  }
488 
489  //
490  // Now get the entry for our real mode V86 code and the target
491  //
492  Pte = HalAddressToPte(0x20000);
494  do
495  {
496  //
497  // Map the physical address into our real-mode region
498  //
499  Pte->PageFrameNumber = V86Pte->PageFrameNumber;
500 
501  //
502  // Keep going until we've reached the end of our region
503  //
504  Pte++;
505  V86Pte++;
506  } while (V86Pte <= HalAddressToPte(&HalpRealModeEnd));
507 
508  //
509  // Flush the TLB
510  //
511  HalpFlushTLB();
512 }
ULONG64 Valid
Definition: mmtypes.h:66
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
VOID NTAPI HalpFlushTLB(VOID)
Definition: misc.c:161
ULONG64 Owner
Definition: mmtypes.h:68
#define HalAddressToPte(x)
Definition: halp.h:163
ULONG HalpSavedPfn
Definition: bios.c:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HalAddressToPde(x)
Definition: halp.h:162
PVOID HalpRealModeEnd
ULONG64 PageFrameNumber
Definition: mmtypes.h:78
#define PAGE_SIZE
Definition: env_spec_w32.h:49
HARDWARE_PTE HalpSavedPte
Definition: bios.c:26
VOID __cdecl HalpRealModeStart(VOID)
ULONG64 Write
Definition: mmtypes.h:67
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalpBiosDisplayReset().

◆ HalpOpcodeINTnn()

BOOLEAN FASTCALL HalpOpcodeINTnn ( IN PHAL_BIOS_FRAME  BiosFrame)

Definition at line 120 of file bios.c.

121 {
122  UCHAR Interrupt;
123  PKTRAP_FRAME TrapFrame;
124 
125  /* Convert SS to linear */
126  BiosFrame->SsBase = BiosFrame->SegSs << 4;
127  BiosFrame->SsLimit = 0xFFFF;
128  BiosFrame->SsFlags = 0;
129 
130  /* Increase EIP and validate */
131  BiosFrame->Eip++;
132  if (BiosFrame->Eip > BiosFrame->CsLimit) return FALSE;
133 
134  /* Read interrupt number */
135  Interrupt = *(PUCHAR)(BiosFrame->CsBase + BiosFrame->Eip);
136 
137  /* Increase EIP and push the interrupt */
138  BiosFrame->Eip++;
139  if (HalpPushInt(BiosFrame, Interrupt))
140  {
141  /* Update the trap frame */
142  TrapFrame = BiosFrame->TrapFrame;
143  TrapFrame->HardwareSegSs = BiosFrame->SegSs;
144  TrapFrame->HardwareEsp = BiosFrame->Esp;
145  TrapFrame->SegCs = BiosFrame->SegCs;
146  TrapFrame->EFlags = BiosFrame->EFlags;
147 
148  /* Success */
149  return TRUE;
150  }
151 
152  /* Failure */
153  return FALSE;
154 }
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG HardwareSegSs
Definition: ketypes.h:271
#define FALSE
Definition: types.h:117
USHORT SegCs
Definition: ketypes.h:380
ULONG HardwareEsp
Definition: ketypes.h:270
unsigned char UCHAR
Definition: xmlstorage.h:181
USHORT SegSs
Definition: ketypes.h:387
BOOLEAN FASTCALL HalpPushInt(IN PHAL_BIOS_FRAME BiosFrame, IN ULONG Interrupt)
Definition: bios.c:80
ULONG EFlags
Definition: ketypes.h:384
UINT64 TrapFrame
Definition: ketypes.h:368

Referenced by HalpDispatchV86Opcode().

◆ HalpOpcodeInvalid()

BOOLEAN FASTCALL HalpOpcodeInvalid ( IN PHAL_BIOS_FRAME  BiosFrame)

Definition at line 62 of file bios.c.

63 {
64  PUCHAR Inst = (PUCHAR)(BiosFrame->CsBase + BiosFrame->Eip);
65 
66  /* Print error message */
67  DPRINT1("HAL: An invalid V86 opcode was encountered at address %X:%X\n"
68  "Opcode: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
69  BiosFrame->SegCs, BiosFrame->Eip,
70  Inst[0], Inst[1], Inst[2], Inst[3], Inst[4],
71  Inst[5], Inst[6], Inst[7], Inst[8], Inst[9]);
72 
73  /* Break */
74  DbgBreakPoint();
75  return FALSE;
76 }
unsigned char * PUCHAR
Definition: retypes.h:3
void DbgBreakPoint()
Definition: mach.c:553
#define FALSE
Definition: types.h:117
#define DPRINT1
Definition: precomp.h:8

Referenced by HalpDispatchV86Opcode().

◆ HalpPushInt()

BOOLEAN FASTCALL HalpPushInt ( IN PHAL_BIOS_FRAME  BiosFrame,
IN ULONG  Interrupt 
)

Definition at line 80 of file bios.c.

82 {
83  PUSHORT Stack;
84  ULONG Eip;
85 
86  /* Calculate stack address (SP) */
87  Stack = (PUSHORT)(BiosFrame->SsBase + (BiosFrame->Esp & 0xFFFF));
88 
89  /* Push EFlags */
90  Stack--;
91  *Stack = BiosFrame->EFlags & 0xFFFF;
92 
93  /* Push CS */
94  Stack--;
95  *Stack = BiosFrame->SegCs & 0xFFFF;
96 
97  /* Push IP */
98  Stack--;
99  *Stack = BiosFrame->Eip & 0xFFFF;
100 
101  /* Compute new CS:IP from the IVT address for this interrupt entry */
102  Eip = *(PULONG)(Interrupt * 4);
103  BiosFrame->Eip = Eip & 0xFFFF;
104  BiosFrame->SegCs = Eip >> 16;
105 
106  /* Update stack address */
107  BiosFrame->Esp = (ULONG_PTR)Stack & 0xFFFF;
108 
109  /* Update CS to linear */
110  BiosFrame->CsBase = BiosFrame->SegCs << 4;
111  BiosFrame->CsLimit = 0xFFFF;
112  BiosFrame->CsFlags = 0;
113 
114  /* We're done */
115  return TRUE;
116 }
#define TRUE
Definition: types.h:120
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by HalpOpcodeINTnn().

◆ HalpRestoreIoPermissionsAndTask()

VOID NTAPI HalpRestoreIoPermissionsAndTask ( VOID  )

Definition at line 586 of file bios.c.

587 {
588  //
589  // Restore the stack pointer
590  //
591  KeGetPcr()->TSS->Esp0 = HalpSavedEsp0;
592 
593  //
594  // Restore the I/O Map
595  //
596  HalpRestoreIopm();
597 
598  //
599  // Restore the IOPM
600  //
601  KeGetPcr()->TSS->IoMapBase = HalpSavedIopmBase;
602 
603  //
604  // Restore the TSS
605  //
607 }
VOID NTAPI HalpReturnTss(VOID)
Definition: bios.c:353
#define KeGetPcr()
Definition: ke.h:25
USHORT HalpSavedIopmBase
Definition: bios.c:43
ULONG HalpSavedEsp0
Definition: bios.c:37
VOID NTAPI HalpRestoreIopm(VOID)
Definition: bios.c:431
USHORT HalpSavedTss
Definition: bios.c:38

Referenced by HalpBiosDisplayReset().

◆ HalpRestoreIopm()

VOID NTAPI HalpRestoreIopm ( VOID  )

Definition at line 431 of file bios.c.

432 {
434 
435  //
436  // Set default state
437  //
439 
440  //
441  // Restore the backed up copy, and initialize it
442  //
444 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
ULONG HalpSavedIoMapEntries
Definition: bios.c:46
unsigned int ULONG
Definition: retypes.h:1
#define IOPM_FULL_SIZE
Definition: ketypes.h:180
USHORT HalpSavedIoMapData[IOPM_SIZE/sizeof(USHORT)][2]
Definition: bios.c:45
PUSHORT HalpSavedIoMap
Definition: bios.c:44

Referenced by HalpRestoreIoPermissionsAndTask().

◆ HalpRestoreTrapHandlers()

VOID NTAPI HalpRestoreTrapHandlers ( VOID  )

Definition at line 565 of file bios.c.

566 {
567  //
568  // Keep dummy GPF handler in case we get an NMI during V8086
569  //
570  if (!HalpNMIInProgress)
571  {
572  //
573  // Not an NMI -- put back the original handler
574  //
576  }
577 
578  //
579  // Restore invalid opcode handler
580  //
582 }
BOOLEAN HalpNMIInProgress
Definition: nmi.c:18
PVOID HalpBopHandler
Definition: bios.c:32
FORCEINLINE VOID KeRegisterInterruptHandler(IN ULONG Vector, IN PVOID Handler)
Definition: ke.h:242
PVOID HalpGpfHandler
Definition: bios.c:31

Referenced by HalpBiosDisplayReset().

◆ HalpReturnTss()

VOID NTAPI HalpReturnTss ( VOID  )

Definition at line 353 of file bios.c.

354 {
355  PKGDTENTRY TssGdt;
356  PKTSS TssBase;
357 
358  //
359  // Get the original TSS
360  //
361  TssGdt = &((PKIPCR)KeGetPcr())->GDT[HalpSavedTss / sizeof(KGDTENTRY)];
362  TssBase = (PKTSS)(ULONG_PTR)(TssGdt->BaseLow |
363  TssGdt->HighWord.Bytes.BaseMid << 16 |
364  TssGdt->HighWord.Bytes.BaseHi << 24);
365 
366  //
367  // Switch to it
368  //
369  KeGetPcr()->TSS = TssBase;
370 
371  //
372  // Set it up
373  //
374  TssGdt->HighWord.Bits.Type = I386_TSS;
375  TssGdt->HighWord.Bits.Pres = 1;
376  TssGdt->HighWord.Bits.Dpl = 0;
377 
378  //
379  // Load old TSS
380  //
381  Ke386SetTr(HalpSavedTss);
382 }
USHORT BaseLow
Definition: ketypes.h:336
struct _KIPCR * PKIPCR
#define KeGetPcr()
Definition: ke.h:25
uint32_t ULONG_PTR
Definition: typedefs.h:65
struct _KGDTENTRY::@2391::@2392 Bytes
Definition: ketypes.h:789
Definition: utils.h:160
#define PKTSS
Definition: ketypes.h:921
#define I386_TSS
Definition: ketypes.h:60
union _KGDTENTRY::@2391 HighWord
USHORT HalpSavedTss
Definition: bios.c:38
struct _KGDTENTRY::@2391::@2393 Bits

Referenced by HalpRestoreIoPermissionsAndTask().

◆ HalpSetupRealModeIoPermissionsAndTask()

VOID NTAPI HalpSetupRealModeIoPermissionsAndTask ( VOID  )

Definition at line 538 of file bios.c.

539 {
540  //
541  // Switch to valid TSS
542  //
543  HalpBorrowTss();
544 
545  //
546  // Save a copy of the I/O Map and delete it
547  //
548  HalpSavedIoMap = (PUSHORT)KeGetPcr()->TSS->IoMaps[0].IoMap;
550 
551  //
552  // Save the IOPM and switch to the real-mode one
553  //
554  HalpSavedIopmBase = KeGetPcr()->TSS->IoMapBase;
555  KeGetPcr()->TSS->IoMapBase = KiComputeIopmOffset(1);
556 
557  //
558  // Save our stack pointer
559  //
560  HalpSavedEsp0 = KeGetPcr()->TSS->Esp0;
561 }
#define KeGetPcr()
Definition: ke.h:25
USHORT HalpSavedIopmBase
Definition: bios.c:43
VOID NTAPI HalpBorrowTss(VOID)
Definition: bios.c:294
#define KiComputeIopmOffset(MapNumber)
Definition: ketypes.h:265
VOID NTAPI HalpStoreAndClearIopm(VOID)
Definition: bios.c:386
ULONG HalpSavedEsp0
Definition: bios.c:37
unsigned short * PUSHORT
Definition: retypes.h:2
PUSHORT HalpSavedIoMap
Definition: bios.c:44

Referenced by HalpBiosDisplayReset().

◆ HalpStoreAndClearIopm()

VOID NTAPI HalpStoreAndClearIopm ( VOID  )

Definition at line 386 of file bios.c.

387 {
388  USHORT i, j;
390 
391  //
392  // Loop the I/O Map
393  //
394  for (i = j = 0; i < IOPM_SIZE / sizeof(USHORT); i++)
395  {
396  //
397  // Check for non-FFFF entry
398  //
399  if (*Entry != 0xFFFF)
400  {
401  //
402  // Save it
403  //
404  HalpSavedIoMapData[j][0] = i;
405  HalpSavedIoMapData[j][1] = *Entry;
406  j++;
407  }
408 
409  //
410  // Clear it
411  //
412  *Entry++ = 0;
413  }
414 
415  //
416  // Terminate it
417  //
418  while (i++ < IOPM_FULL_SIZE / sizeof(USHORT))
419  {
420  *Entry++ = 0xFFFF;
421  }
422 
423  //
424  // Return the entries we saved
425  //
427 }
#define IOPM_SIZE
Definition: ketypes.h:179
struct _Entry Entry
Definition: kefuncs.h:627
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
ULONG HalpSavedIoMapEntries
Definition: bios.c:46
unsigned short USHORT
Definition: pedump.c:61
#define IOPM_FULL_SIZE
Definition: ketypes.h:180
USHORT HalpSavedIoMapData[IOPM_SIZE/sizeof(USHORT)][2]
Definition: bios.c:45
unsigned short * PUSHORT
Definition: retypes.h:2
base of all file and directory entries
Definition: entries.h:82
PUSHORT HalpSavedIoMap
Definition: bios.c:44

Referenced by HalpSetupRealModeIoPermissionsAndTask().

◆ HalpSwitchToRealModeTrapHandlers()

VOID NTAPI HalpSwitchToRealModeTrapHandlers ( VOID  )

Definition at line 516 of file bios.c.

517 {
518  //
519  // Save the current Invalid Opcode and General Protection Fault Handlers
520  //
523 
524  //
525  // Now set our own GPF handler to handle exceptions while in real mode
526  //
528 
529  //
530  // And our own invalid opcode handler to detect the BOP to get us out
531  //
533 }
void __cdecl HalpTrap0D()
FORCEINLINE PVOID KeQueryInterruptHandler(IN ULONG Vector)
Definition: ke.h:268
VOID DECLSPEC_NORETURN HalpTrap06(VOID)
Definition: bios.c:232
PVOID HalpBopHandler
Definition: bios.c:32
FORCEINLINE VOID KeRegisterInterruptHandler(IN ULONG Vector, IN PVOID Handler)
Definition: ke.h:242
PVOID HalpGpfHandler
Definition: bios.c:31

Referenced by HalpBiosDisplayReset().

◆ HalpTrap06()

VOID DECLSPEC_NORETURN HalpTrap06 ( VOID  )

Definition at line 232 of file bios.c.

233 {
234  /* Restore ES/DS to known good values first */
235  Ke386SetEs(KGDT_R3_DATA | RPL_MASK);
236  Ke386SetDs(KGDT_R3_DATA | RPL_MASK);
237  Ke386SetFs(KGDT_R0_PCR);
238 
239  /* Restore the stack */
240  KeGetPcr()->TSS->Esp0 = HalpSavedEsp0;
241 
242  /* Return back to where we left */
244  UNREACHABLE;
245 }
#define KeGetPcr()
Definition: ke.h:25
jmp_buf HalpSavedContext
Definition: bios.c:55
#define RPL_MASK
Definition: ketypes.h:69
#define KGDT_R3_DATA
Definition: ketypes.h:78
int longjmp(jmp_buf buf, int retval)
#define KGDT_R0_PCR
Definition: ketypes.h:80
#define UNREACHABLE
ULONG HalpSavedEsp0
Definition: bios.c:37

Referenced by HalpSwitchToRealModeTrapHandlers().

◆ HalpTrap0D()

void __cdecl HalpTrap0D ( )

◆ HalpTrap0DHandler()

DECLSPEC_NORETURN VOID FASTCALL HalpTrap0DHandler ( IN PKTRAP_FRAME  TrapFrame)

Definition at line 209 of file bios.c.

210 {
211  /* Enter the trap */
212  KiEnterTrap(TrapFrame);
213 
214  /* Check if this is a V86 trap */
215  if (TrapFrame->EFlags & EFLAGS_V86_MASK)
216  {
217  /* Dispatch the opcode and exit the trap */
218  HalpDispatchV86Opcode(TrapFrame);
219  KiEoiHelper(TrapFrame);
220  }
221 
222  /* Strange, it isn't! This can happen during NMI */
223  DPRINT1("HAL: Trap0D while not in V86 mode\n");
224  KiDumpTrapFrame(TrapFrame);
225 
226  ERROR_FATAL();
227  while (TRUE); /* 'noreturn' function */
228 }
FORCEINLINE VOID KiDumpTrapFrame(IN PKTRAP_FRAME TrapFrame)
Definition: trap_x.h:31
#define TRUE
Definition: types.h:120
DECLSPEC_NORETURN VOID FASTCALL KiEoiHelper(IN PKTRAP_FRAME TrapFrame)
Definition: traphdlr.c:126
BOOLEAN FASTCALL HalpDispatchV86Opcode(IN PKTRAP_FRAME TrapFrame)
Definition: bios.c:158
#define EFLAGS_V86_MASK
Definition: ketypes.h:129
#define ERROR_FATAL(...)
Definition: debug.h:238
#define DPRINT1
Definition: precomp.h:8
FORCEINLINE VOID KiEnterTrap(IN PKTRAP_FRAME TrapFrame)
Definition: trap_x.h:402

◆ HalpUnmapRealModeMemory()

VOID NTAPI HalpUnmapRealModeMemory ( VOID  )

Definition at line 611 of file bios.c.

612 {
613  ULONG i;
614  PHARDWARE_PTE Pte;
615 
616  //
617  // Loop the first meg of memory
618  //
619  for (i = 0; i < 0x100000; i += PAGE_SIZE)
620  {
621  //
622  // Invalidate each PTE
623  //
624  Pte = HalAddressToPte(i);
625  Pte->Valid = 0;
626  Pte->Write = 0;
627  Pte->Owner = 0;
628  Pte->PageFrameNumber = 0;
629  }
630 
631  //
632  // Restore the PDE for the lowest megabyte of memory
633  //
634  Pte = HalAddressToPde(0);
635  *Pte = HalpSavedPte;
637 
638  //
639  // Flush the TLB
640  //
641  HalpFlushTLB();
642 }
ULONG64 Valid
Definition: mmtypes.h:66
VOID NTAPI HalpFlushTLB(VOID)
Definition: misc.c:161
ULONG64 Owner
Definition: mmtypes.h:68
#define HalAddressToPte(x)
Definition: halp.h:163
ULONG HalpSavedPfn
Definition: bios.c:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HalAddressToPde(x)
Definition: halp.h:162
ULONG64 PageFrameNumber
Definition: mmtypes.h:78
#define PAGE_SIZE
Definition: env_spec_w32.h:49
HARDWARE_PTE HalpSavedPte
Definition: bios.c:26
ULONG64 Write
Definition: mmtypes.h:67
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalpBiosDisplayReset().

Variable Documentation

◆ HalpBopHandler

PVOID HalpBopHandler

Definition at line 32 of file bios.c.

Referenced by HalpRestoreTrapHandlers(), and HalpSwitchToRealModeTrapHandlers().

◆ HalpGpfHandler

PVOID HalpGpfHandler

Definition at line 31 of file bios.c.

Referenced by HalpRestoreTrapHandlers(), and HalpSwitchToRealModeTrapHandlers().

◆ HalpRealModeEnd

PVOID HalpRealModeEnd

◆ HalpSavedContext

jmp_buf HalpSavedContext

Definition at line 55 of file bios.c.

Referenced by HalpBiosCall(), and HalpTrap06().

◆ HalpSavedEsp

ULONG_PTR HalpSavedEsp

Definition at line 49 of file bios.c.

◆ HalpSavedEsp0

ULONG HalpSavedEsp0

◆ HalpSavedIoMap

PUSHORT HalpSavedIoMap

◆ HalpSavedIoMapData

USHORT HalpSavedIoMapData[IOPM_SIZE/sizeof(USHORT)][2]

Definition at line 45 of file bios.c.

Referenced by HalpRestoreIopm(), and HalpStoreAndClearIopm().

◆ HalpSavedIoMapEntries

ULONG HalpSavedIoMapEntries

Definition at line 46 of file bios.c.

Referenced by HalpRestoreIopm(), and HalpStoreAndClearIopm().

◆ HalpSavedIopmBase

USHORT HalpSavedIopmBase

◆ HalpSavedPfn

ULONG HalpSavedPfn

Definition at line 25 of file bios.c.

Referenced by HalpMapRealModeMemory(), and HalpUnmapRealModeMemory().

◆ HalpSavedPte

HARDWARE_PTE HalpSavedPte

Definition at line 26 of file bios.c.

Referenced by HalpMapRealModeMemory(), and HalpUnmapRealModeMemory().

◆ HalpSavedTss

USHORT HalpSavedTss

Definition at line 38 of file bios.c.

Referenced by HalpBorrowTss(), HalpRestoreIoPermissionsAndTask(), and HalpReturnTss().