- 時間撮記:
- 2015-12-22 下午07:47:07 (9 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo64Bit.asm
r58812 r59215 37 37 %else 38 38 %if TMPL_BITS == 16 39 sub sp, 6 40 push bp 41 mov bp, sp 39 sub sp, 6 ; Space for extended return value (corrected in 64-bit mode). 42 40 %else 43 push xPRE [xSP] ; duplicate the return address 41 push xPRE [xSP] ; Duplicate the return address. 42 and dword [xSP + xCB], 0 ; Clear the high dword or it. 44 43 %endif 44 push dword 0 45 45 push sAX 46 47 %if TMPL_BITS == 16 48 ; Convert the 16-bit near return into a 32-bit far return 49 movzx eax, word [bp + 8] 50 add eax, BS3_ADDR_BS3TEXT16 51 mov [bp + 2], eax 52 %endif 46 push dword 0 47 pushfd 48 cli 53 49 54 50 ; Calc ring addend. 55 51 mov ax, cs 56 and ax, 3 57 shl ax, BS3_SEL_RING_SHIFT 52 and xAX, 3 53 shl xAX, BS3_SEL_RING_SHIFT 54 add xAX, BS3_SEL_R0_CS32 58 55 59 ; Set return segment. 60 add ax, BS3_SEL_R0_CS64 61 %if TMPL_BITS == 16 62 mov [bp + 6], eax 63 %else 64 mov [xSP + xCB*2], eax 65 %endif 56 ; setup far return. 57 push sAX 58 %if TMPL_BITS == 16 59 push dword .sixty_four_bit 60 o32 retf 61 %else 62 push .sixty_four_bit 63 retf 64 %endif 66 65 66 BS3_SET_BITS 64 67 .sixty_four_bit: 67 68 ; Load 64-bit segment registers (SS64==DS64). 68 add ax, BS3_SEL_R0_DS64 - BS3_SEL_R0_CS6469 add eax, BS3_SEL_R0_DS64 - BS3_SEL_R0_CS64 69 70 mov ss, ax 70 71 mov ds, ax 71 72 mov es, ax 72 73 73 ; Restore and return. 74 pop sAX 75 %if TMPL_BITS == 16 76 leave 77 o32 retf 78 %else 79 retf 74 %if TMPL_BITS == 16 75 movzx eax, word [rsp + 8*2+6] 76 add eax, BS3_ADDR_BS3TEXT16 77 mov [rsp + 8*2], rax 78 %endif 79 80 popf 81 pop rax 82 ret 80 83 %endif 81 %endif82 84 BS3_PROC_END_CMN Bs3SwitchTo64Bit 83 85
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器