Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
r48674 r58459 4 4 ;------------------------------------------------------------------------------ 5 5 ; 6 ; Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>6 ; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 7 7 ; This program and the accompanying materials 8 8 ; are licensed and made available under the terms and conditions of the BSD License … … 158 158 mov fs, ecx 159 159 mov gs, ecx 160 mov cr0, eax 161 mov cr4, ebp ; real mode starts at next instruction 160 mov cr0, eax ; real mode starts at next instruction 161 ; which (per SDM) *must* be a far JMP. 162 DB 0eah 163 _RealAddr DW 0,0 ; filled in by InternalAsmThunk16 164 165 mov cr4, ebp 162 166 mov ss, esi ; set up 16-bit stack segment 163 167 xchg sp, bx ; set up 16-bit stack pointer 164 DB 66h 165 call @Base ; push eip 166 @Base: 167 pop bp ; ebp <- address of @Base 168 DB 67h ; address size override 169 push [esp + sizeof (IA32_REGS) + 2] 170 lea eax, [esi + (@RealMode - @Base)] 171 push eax 172 retf 173 @RealMode: 174 mov cs:[esi + (SavedSs - @Base)], edx 175 mov cs:[esi + (SavedEsp - @Base)], bx 176 DB 66h 177 lidt fword ptr cs:[esi + (_16Idtr - @Base)] 168 169 ; mov bp, [esp + sizeof(IA32_REGS) 170 DB 67h 171 mov ebp, [esp + sizeof(IA32_REGS)] ; BackFromUserCode address from stack 172 173 ; mov cs:[bp + (SavedSs - _BackFromUserCode)], dx 174 mov cs:[esi + (SavedSs - _BackFromUserCode)], edx 175 176 ; mov cs:[bp + (SavedEsp - _BackFromUserCode)], ebx 177 DB 2eh, 66h, 89h, 9eh 178 DW SavedEsp - _BackFromUserCode 179 180 ; lidt cs:[bp + (_16Idtr - _BackFromUserCode)] 181 DB 2eh, 66h, 0fh, 01h, 9eh 182 DW _16Idtr - _BackFromUserCode 183 178 184 popaw ; popad actually 179 185 pop ds … … 231 237 mov ax, cx 232 238 stosd ; [edi] <- return address of user code 239 add eax, _RealAddr + 4 - _BackFromUserCode 240 mov dword ptr [edx + (_RealAddr - SavedCr0)], eax 233 241 sgdt fword ptr [edx + (SavedGdt - SavedCr0)] 234 242 sidt fword ptr [esp + 36] ; save IDT stack in argument space … … 238 246 mov ebp, cr4 239 247 mov [edx + (SavedCr4 - SavedCr0)], ebp 240 and ebp, 300h ; clear all but PCE and OSFXSRbits248 and ebp, NOT 30h ; clear PAE, PSE bits 241 249 push 10h 242 250 pop ecx ; ecx <- selector for data segments
Note:
See TracChangeset
for help on using the changeset viewer.