Functions | |
Copyright (c) 2006-2013 | |
_BackFromUserCode () takes control in real mode after 'retf'has been executed | |
_ToUserCode () takes control in real mode before passing control to user code. | |
Variables | |
Intel Corporation All rights reserved< BR > This program and the accompanying | materials |
are licensed and made available under the terms and conditions of the BSD | License |
which accompanies this distribution The full text of the license may be found | at |
http | __pad0__ |
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS | BASIS |
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY | KIND |
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY EITHER EXPRESS OR | IMPLIED |
Module | Name |
Thunk | asm |
Abstract | __pad1__ |
Real mode | thunk |
global (m16Size) global(mThunk16Attr) global(m16Gdt) global(m16GdtrBase) global(mTransition) global(m16Start) struc IA32_REGS._EDI | |
These are global constant to convey information to C | code |
m16Size | DW (InternalAsmThunk16)-(m16Start)(mThunk16Attr) DW _BackFromUserCode.ThunkAttrEnd-4-(m16Start)(m16Gdt) DW _NullSeg-(m16Start)(m16GdtrBase) DW _16GdtrBase-(m16Start)(mTransition) DW _EntryPoint-(m16Start) SECTION.text(m16Start) |
by user code It will be shadowed to somewhere in memory | below |
_BackFromUserCode | __pad2__ |
The order of saved registers on the stack matches the order they | appears |
in IA32_REGS structure This facilitates wrapper function to extract | them |
into that | structure |
BITS push ss push | cs |
Note | __pad3__ |
in NASM | through |
call dword | Base |
reserved high order bits of EFlags pushfd | cli |
disable interrupts push gs push fs push es push ds pushad mov | edx |
disable interrupts push gs push fs push es push ds pushad mov strict dword | ThunkAttrEnd |
disable interrupts push gs push fs push es push ds pushad mov strict dword THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 jz mov | ax |
disable interrupts | jnc |
disable interrupts THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL jz in | al |
disable interrupts THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL jz in or | out |
deactivate | A20M |
deactivate eax mov ss lea | ebp |
deactivate eax mov ss lea | mov [bp-IA32_REGS.size+IA32_REGS._ESP] |
deactivate eax mov ss lea ebp mov | ebx |
deactivate eax mov ss lea ebp mov shl | eax |
add eax mov cs shl lea eax mov strict dword | SavedCr4End |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt[cs:bx+(SavedGdt-.Base)] mov | ecx |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt[cs:bx+(SavedGdt-.Base)] mov rdmsr or | ah |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt[cs:bx+(SavedGdt-.Base)] mov rdmsr or wrmsr mov strict dword | SavedCr0End |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt[cs:bx+(SavedGdt-.Base)] mov rdmsr or wrmsr mov strict dword eax | jmp |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt[cs:bx+(SavedGdt-.Base)] mov rdmsr or wrmsr mov strict dword eax strict qword | SavedSpEnd |
_ToUserCode | __pad4__ |
_ToUserCode | dx |
set new segment selectors mov | ds |
set new segment selectors mov dx mov | es |
set new segment selectors mov dx mov dx mov | fs |
set new segment selectors mov dx mov dx mov dx mov | gs |
set new segment selectors mov dx mov dx mov dx mov dx mov mov | cr0 |
real mode starts at next instruction rdmsr and wrmsr mov | cr4 |
real mode starts at next instruction rdmsr and wrmsr mov ebp mov | ss |
real mode starts at next instruction rdmsr and wrmsr mov ebp mov | si |
set up bit stack segment mov | esp |
_BackFromUserCode | ( | ) |
_ToUserCode | ( | ) |
Copyright | ( | c | ) |
http __pad0__ |
Abstract __pad1__ |
_BackFromUserCode __pad2__ |
Note __pad3__ |
_ToUserCode __pad4__ |
deactivate A20M |
real mode starts at next instruction rdmsr and ah |
disable interrupts THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL jz in or al |
Referenced by IoRead8(), and IoWrite8().
The order of saved registers on the stack matches the order they appears |
Thunk asm |
which accompanies this distribution The full text of the license may be found at |
Referenced by AsmReadCs(), AsmReadDs(), AsmReadEs(), AsmReadFs(), AsmReadGs(), AsmReadLdtr(), AsmReadSs(), AsmReadTr(), AsmWriteLdtr(), InternalSyncCompareExchange16(), IoRead16(), and IoWrite16().
push eip Base |
Referenced by PeCoffLoaderLoadImage().
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS |
It will be shadowed to somewhere in memory below |
disable interrupts push gs push fs push es push ds pushad mov strict dword THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 jz mov int cli |
Referenced by __declspec(), DisableInterrupts(), EnableDisableInterrupts(), and InternalX86WriteIdtr().
Referenced by __declspec(), AsmDisableCache(), AsmEnableCache(), AsmReadCr0(), and AsmWriteCr0().
real mode starts at next instruction rdmsr and wrmsr mov cr4 |
Referenced by AsmReadCs().
Referenced by AsmReadDs().
m16Size DW(InternalAsmThunk16)-(m16Start)(mThunk16Attr) DW _BackFromUserCode.ThunkAttrEnd-4-(m16Start)(m16Gdt) DW _NullSeg-(m16Start)(m16GdtrBase) DW _16GdtrBase-(m16Start)(mTransition) DW _EntryPoint-(m16Start) SECTION.text(m16Start) |
_ToUserCode dx |
Referenced by InternalSyncCompareExchange16(), IoRead16(), IoRead32(), IoRead8(), IoWrite16(), IoWrite32(), and IoWrite8().
Referenced by __declspec(), _declspec(), AsmCpuid(), AsmCpuidEx(), AsmDisableCache(), AsmEnableCache(), AsmFlushCacheLine(), AsmMonitor(), AsmMwait(), AsmReadCr0(), AsmReadCr2(), AsmReadCr3(), AsmReadCs(), AsmReadDr0(), AsmReadDr1(), AsmReadDr2(), AsmReadDr3(), AsmReadDr6(), AsmReadDr7(), AsmReadDs(), AsmReadEflags(), AsmReadEs(), AsmReadFs(), AsmReadGs(), AsmReadMm0(), AsmReadMm1(), AsmReadMm2(), AsmReadMm3(), AsmReadMm4(), AsmReadMm5(), AsmReadMm6(), AsmReadMm7(), AsmReadSs(), AsmWriteCr0(), AsmWriteCr2(), AsmWriteCr3(), AsmWriteCr4(), AsmWriteDr0(), AsmWriteDr1(), AsmWriteDr2(), AsmWriteDr3(), AsmWriteDr4(), AsmWriteDr5(), AsmWriteDr6(), AsmWriteDr7(), AsmWriteLdtr(), AsmWriteMsr64(), CpuFlushTlb(), InternalMathARShiftU64(), InternalMathDivRemU64x32(), InternalMathDivU64x32(), InternalMathLRotU64(), InternalMathLShiftU64(), InternalMathModU64x32(), InternalMathMultU64x32(), InternalMathMultU64x64(), InternalMathRRotU64(), InternalMathRShiftU64(), InternalMathSwapBytes64(), InternalSyncCompareExchange32(), InternalSyncCompareExchange64(), InternalSyncDecrement(), InternalSyncIncrement(), InternalX86FxRestore(), InternalX86FxSave(), InternalX86ReadGdtr(), InternalX86ReadIdtr(), InternalX86WriteGdtr(), InternalX86WriteIdtr(), IoRead32(), and IoWrite32().
add ebp |
Referenced by __declspec(), and _declspec().
Referenced by __declspec(), _declspec(), AsmCpuid(), AsmCpuidEx(), AsmMonitor(), AsmMwait(), AsmReadMsr64(), AsmReadPmc(), AsmWriteMsr64(), InternalMathDivRemU64x32(), InternalMathDivU64x32(), InternalMathLRotU64(), InternalMathModU64x32(), InternalMathMultU64x32(), InternalMathMultU64x64(), InternalMathRRotU64(), InternalSyncCompareExchange16(), InternalSyncCompareExchange32(), and InternalSyncCompareExchange64().
Referenced by __declspec(), _declspec(), AsmCpuid(), AsmCpuidEx(), AsmFlushCacheLine(), AsmMonitor(), AsmReadMm0(), AsmReadMm1(), AsmReadMm2(), AsmReadMm3(), AsmReadMm4(), AsmReadMm5(), AsmReadMm6(), AsmReadMm7(), AsmWriteMsr64(), InternalMathARShiftU64(), InternalMathDivRemU64x32(), InternalMathDivU64x32(), InternalMathLRotU64(), InternalMathLShiftU64(), InternalMathModU64x32(), InternalMathMultU64x32(), InternalMathMultU64x64(), InternalMathRRotU64(), InternalMathRShiftU64(), InternalMathSwapBytes64(), InternalSyncCompareExchange32(), and InternalSyncCompareExchange64().
Referenced by __declspec(), _declspec(), AsmReadMm0(), AsmReadMm1(), AsmReadMm2(), AsmReadMm3(), AsmReadMm4(), AsmReadMm5(), AsmReadMm6(), and AsmReadMm7().
global(m16Size) global(mThunk16Attr) global(m16Gdt) global(m16GdtrBase) global(mTransition) global(m16Start) struc IA32_REGS._EDI |
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY EITHER EXPRESS OR IMPLIED |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt [cs:bx + (SavedGdt - .Base)] mov rdmsr or wrmsr mov strict dword eax jmp |
Referenced by __declspec(), _declspec(), and AsmFlushCacheLine().
disable interrupts jnc |
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND |
are licensed and made available under the terms and conditions of the BSD License |
Referenced by __declspec(), _declspec(), AsmCpuid(), AsmCpuidEx(), AsmDisableCache(), AsmEnableCache(), AsmFlushCacheLine(), AsmMonitor(), AsmMwait(), AsmReadCr0(), AsmReadCr2(), AsmReadCr3(), AsmReadCs(), AsmReadDr0(), AsmReadDr1(), AsmReadDr2(), AsmReadDr3(), AsmReadDr6(), AsmReadDr7(), AsmReadDs(), AsmReadEs(), AsmReadFs(), AsmReadGs(), AsmReadMsr64(), AsmReadPmc(), AsmReadSs(), AsmWriteCr0(), AsmWriteCr2(), AsmWriteCr3(), AsmWriteCr4(), AsmWriteDr0(), AsmWriteDr1(), AsmWriteDr2(), AsmWriteDr3(), AsmWriteDr4(), AsmWriteDr5(), AsmWriteDr6(), AsmWriteDr7(), AsmWriteLdtr(), AsmWriteMsr64(), CpuFlushTlb(), InternalMathARShiftU64(), InternalMathDivRemU64x32(), InternalMathDivU64x32(), InternalMathLRotU64(), InternalMathLShiftU64(), InternalMathModU64x32(), InternalMathMultU64x32(), InternalMathMultU64x64(), InternalMathRRotU64(), InternalMathRShiftU64(), InternalMathSwapBytes64(), InternalSyncCompareExchange16(), InternalSyncCompareExchange32(), InternalSyncCompareExchange64(), InternalSyncDecrement(), InternalSyncIncrement(), InternalX86FxRestore(), InternalX86FxSave(), InternalX86ReadGdtr(), InternalX86ReadIdtr(), InternalX86WriteGdtr(), InternalX86WriteIdtr(), IoRead16(), IoRead32(), IoRead8(), IoWrite16(), IoWrite32(), and IoWrite8().
Module Name |
disable interrupts THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL jz in or out |
Referenced by IoWrite16(), IoWrite32(), and IoWrite8().
add eax mov cs shl lea eax mov strict dword eax o32 lgdt [cs:bx + (SavedGdt - .Base)] mov rdmsr or wrmsr mov strict dword SavedCr0End |
add eax mov cs shl lea eax mov strict dword eax o32 lgdt [cs:bx + (SavedGdt - .Base)] mov rdmsr or wrmsr mov strict dword eax strict qword SavedSpEnd |
Referenced by AsmReadSs().
into that structure |
in NASM through |
Real mode thunk |