- 時間撮記:
- 2016-3-7 下午11:15:22 (9 年 以前)
- 位置:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- 檔案:
-
- 修改 21 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16Bit.asm
r59934 r59949 43 43 mov ax, seg g_bBs3CurrentMode 44 44 mov ds, ax 45 mov al, [ g_bBs3CurrentMode]45 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 46 46 and al, BS3_MODE_CODE_MASK 47 47 cmp al, BS3_MODE_CODE_V86 … … 99 99 100 100 ; Update globals. 101 and byte [ g_bBs3CurrentMode], ~BS3_MODE_CODE_MASK102 or byte [ g_bBs3CurrentMode], BS3_MODE_CODE_16101 and byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], ~BS3_MODE_CODE_MASK 102 or byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_16 103 103 104 104 popfd -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16BitV86.asm
r59941 r59949 43 43 ; Construct basic v8086 return frame. 44 44 BS3_ONLY_16BIT_STMT movzx esp, sp 45 push dword 0 ; +0x20: GS46 push dword 0 ; +0x1c: FS47 push dword BS3_SEL_DATA16 ; +0x18: ES48 push dword BS3_SEL_DATA16 ; +0x14: DS49 push dword 0 ; +0x10: SS - later50 push dword 0 ; +0x0c: return ESP, later.45 push dword 0 ; +0x20: GS 46 push dword 0 ; +0x1c: FS 47 push dword BS3_SEL_DATA16 ; +0x18: ES 48 push dword BS3_SEL_DATA16 ; +0x14: DS 49 push dword 0 ; +0x10: SS - later 50 push dword 0 ; +0x0c: return ESP, later. 51 51 pushfd 52 or dword [esp], X86_EFL_VM ; +0x08: Set the VM flag in EFLAGS.53 push dword BS3_SEL_TEXT16 ; +0x0452 or dword [esp], X86_EFL_VM | X86_EFL_IOPL ; +0x08: Set IOPL=3 and the VM flag (EFLAGS). 53 push dword BS3_SEL_TEXT16 ; +0x04 54 54 push word 0 55 55 %if TMPL_BITS == 16 56 push word [esp + 2 + 8 * 4 + 2] ; +0x0056 push word [esp + 2 + 8 * 4 + 2] ; +0x00 57 57 %else 58 push word [esp + 2 + 8 * 4] ; +0x0058 push word [esp + 2 + 8 * 4] ; +0x00 59 59 %endif 60 60 ; Save registers and stuff. … … 69 69 mov ax, seg g_bBs3CurrentMode 70 70 mov ds, ax 71 mov al, [ g_bBs3CurrentMode]71 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 72 72 and al, BS3_MODE_CODE_MASK 73 73 cmp al, BS3_MODE_CODE_V86 … … 91 91 jz .is_ring0 92 92 call Bs3SwitchToRing0 93 %if TMPL_BITS == 16 94 mov ax, seg g_bBs3CurrentMode 95 mov ds, ax ; parnoia 96 %endif 93 97 .is_ring0: 94 98 95 99 ; Update globals. 96 and byte [ g_bBs3CurrentMode], ~BS3_MODE_CODE_MASK97 or byte [ g_bBs3CurrentMode], BS3_MODE_CODE_16100 and byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], ~BS3_MODE_CODE_MASK 101 or byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 98 102 99 103 %if TMPL_BITS != 16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo32Bit.asm
r59941 r59949 61 61 mov ax, seg g_bBs3CurrentMode 62 62 mov ds, ax 63 mov al, [ g_bBs3CurrentMode]63 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 64 64 and al, BS3_MODE_CODE_MASK 65 65 cmp al, BS3_MODE_CODE_V86 … … 128 128 129 129 ; Update globals. 130 and byte [ g_bBs3CurrentMode], ~BS3_MODE_CODE_MASK131 or byte [ g_bBs3CurrentMode], BS3_MODE_CODE_32130 and byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], ~BS3_MODE_CODE_MASK 131 or byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_32 132 132 133 133 %if TMPL_BITS == 16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo64Bit.asm
r59934 r59949 58 58 ; Check that this is LM16 59 59 mov ax, seg g_bBs3CurrentMode 60 cmp byte [ g_bBs3CurrentMode], BS3_MODE_LM1660 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_LM16 61 61 je .ok_lm16 62 62 int3 … … 90 90 91 91 ; Update globals. 92 and byte [BS3_ WRT_RIP(g_bBs3CurrentMode)], ~BS3_MODE_CODE_MASK93 or byte [BS3_ WRT_RIP(g_bBs3CurrentMode)], BS3_MODE_CODE_6492 and byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], ~BS3_MODE_CODE_MASK 93 or byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_64 94 94 95 95 %if TMPL_BITS == 16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing0.asm
r59287 r59949 5 5 6 6 ; 7 ; Copyright (C) 2007-201 5Oracle Corporation7 ; Copyright (C) 2007-2016 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 %include "bs3kit-template-header.mac" 28 28 29 30 %if TMPL_BITS == 16 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 %endif 33 TMPL_BEGIN_TEXT 34 35 29 36 ;; 30 37 ; @cproto BS3_DECL(void) Bs3SwitchToRing0(void); … … 33 40 ; 34 41 BS3_PROC_BEGIN_CMN Bs3SwitchToRing0 35 push sAX42 push xAX 36 43 37 44 %if TMPL_BITS == 16 38 smsw ax 39 test ax, X86_CR0_PE 40 jz .return ; real mode. 45 ; Check the current mode. 46 push ds 47 mov ax, seg g_bBs3CurrentMode 48 mov ds, ax 49 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 50 pop ds 51 52 ; If real mode: Nothing to do, it's considered ring-0 here. 53 cmp al, BS3_MODE_RM 54 je .return 55 56 ; If V8086 mode: Have to make the system call (v8086 mode is ring-3). 57 and al, BS3_MODE_CODE_MASK 58 cmp al, BS3_MODE_CODE_V86 59 je .just_do_it 41 60 %endif 61 62 ; In protected mode: Check the CPL we're currently at skip syscall if ring-0 already. 42 63 mov ax, cs 43 64 test ax, 3 44 65 jz .return 45 66 46 mov eax, BS3_SYSCALL_TO_RING0 67 .just_do_it: 68 mov xAX, BS3_SYSCALL_TO_RING0 47 69 int BS3_TRAP_SYSCALL 48 70 49 71 .return: 50 pop sAX72 pop xAX 51 73 ret 52 74 BS3_PROC_END_CMN Bs3SwitchToRing0 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing1.asm
r59287 r59949 5 5 6 6 ; 7 ; Copyright (C) 2007-201 5Oracle Corporation7 ; Copyright (C) 2007-2016 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 %include "bs3kit-template-header.mac" 28 28 29 30 %if TMPL_BITS == 16 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 %endif 33 TMPL_BEGIN_TEXT 34 35 29 36 ;; 30 37 ; @cproto BS3_DECL(void) Bs3SwitchToRing1(void); … … 33 40 ; 34 41 BS3_PROC_BEGIN_CMN Bs3SwitchToRing1 35 push sAX42 push xAX 36 43 44 %if TMPL_BITS == 16 45 ; Check the current mode. 46 push ds 47 mov ax, seg g_bBs3CurrentMode 48 mov ds, ax 49 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 50 pop ds 51 52 ; If real mode: assert, shouldn't call this function in real mode! 53 cmp al, BS3_MODE_RM 54 jne .not_real_mode 55 int3 56 jmp .return 57 .not_real_mode: 58 59 ; If V8086 mode: Have to make the system call (v8086 mode is kind of like ring-3). 60 and al, BS3_MODE_CODE_MASK 61 cmp al, BS3_MODE_CODE_V86 62 je .just_do_it 63 %endif 64 65 ; In protected mode: Check the CPL we're currently at skip syscall if ring-1 already. 37 66 mov ax, cs 38 67 and ax, 3 … … 40 69 je .return 41 70 42 mov eax, BS3_SYSCALL_TO_RING1 71 .just_do_it: 72 mov xAX, BS3_SYSCALL_TO_RING1 43 73 int BS3_TRAP_SYSCALL 44 74 45 75 .return: 46 pop sAX76 pop xAX 47 77 ret 48 78 BS3_PROC_END_CMN Bs3SwitchToRing1 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing2.asm
r59287 r59949 5 5 6 6 ; 7 ; Copyright (C) 2007-201 5Oracle Corporation7 ; Copyright (C) 2007-2016 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 %include "bs3kit-template-header.mac" 28 28 29 30 %if TMPL_BITS == 16 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 %endif 33 TMPL_BEGIN_TEXT 34 35 29 36 ;; 30 37 ; @cproto BS3_DECL(void) Bs3SwitchToRing2(void); … … 33 40 ; 34 41 BS3_PROC_BEGIN_CMN Bs3SwitchToRing2 35 push sAX42 push xAX 36 43 44 %if TMPL_BITS == 16 45 ; Check the current mode. 46 push ds 47 mov ax, seg g_bBs3CurrentMode 48 mov ds, ax 49 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 50 pop ds 51 52 ; If real mode: assert, shouldn't call this function in real mode! 53 cmp al, BS3_MODE_RM 54 jne .not_real_mode 55 int3 56 jmp .return 57 .not_real_mode: 58 59 ; If V8086 mode: Have to make the system call (v8086 mode is kind of like ring-3). 60 and al, BS3_MODE_CODE_MASK 61 cmp al, BS3_MODE_CODE_V86 62 je .just_do_it 63 %endif 64 65 ; In protected mode: Check the CPL we're currently at skip syscall if ring-2 already. 37 66 mov ax, cs 38 67 and ax, 3 … … 40 69 je .return 41 70 42 mov eax, BS3_SYSCALL_TO_RING2 71 .just_do_it: 72 mov xAX, BS3_SYSCALL_TO_RING2 43 73 int BS3_TRAP_SYSCALL 44 74 45 75 .return: 46 pop sAX76 pop xAX 47 77 ret 48 78 BS3_PROC_END_CMN Bs3SwitchToRing2 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing3.asm
r59287 r59949 5 5 6 6 ; 7 ; Copyright (C) 2007-201 5Oracle Corporation7 ; Copyright (C) 2007-2016 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 %include "bs3kit-template-header.mac" 28 28 29 30 %if TMPL_BITS == 16 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 %endif 33 TMPL_BEGIN_TEXT 34 35 29 36 ;; 30 37 ; @cproto BS3_DECL(void) Bs3SwitchToRing3(void); … … 33 40 ; 34 41 BS3_PROC_BEGIN_CMN Bs3SwitchToRing3 35 push sAX42 push xAX 36 43 44 %if TMPL_BITS == 16 45 ; Check the current mode. 46 push ds 47 mov ax, seg g_bBs3CurrentMode 48 mov ds, ax 49 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 50 pop ds 51 52 ; If real mode: assert, shouldn't call this function in real mode! 53 cmp al, BS3_MODE_RM 54 jne .not_real_mode 55 int3 56 jmp .return 57 .not_real_mode: 58 59 ; If V8086 mode: Have to make the system call (we don't consider v8086 ring-3 here). 60 and al, BS3_MODE_CODE_MASK 61 cmp al, BS3_MODE_CODE_V86 62 je .just_do_it 63 %endif 64 65 ; In protected mode: Check the CPL we're currently at skip syscall if ring-3 already. 37 66 mov ax, cs 38 67 and ax, 3 … … 40 69 je .return 41 70 42 mov eax, BS3_SYSCALL_TO_RING3 71 .just_do_it: 72 mov xAX, BS3_SYSCALL_TO_RING3 43 73 int BS3_TRAP_SYSCALL 44 74 45 75 .return: 46 pop sAX76 pop xAX 47 77 ret 48 78 BS3_PROC_END_CMN Bs3SwitchToRing3 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithStr.asm
r59863 r59949 43 43 BS3_ONLY_16BIT_STMT push ds 44 44 45 cmp byte [g_fbBs3VMMDevTesting], 0 45 mov ax, seg g_fbBs3VMMDevTesting 46 mov ds, ax 47 cmp byte [BS3_DATA16_WRT(g_fbBs3VMMDevTesting)], 0 46 48 je .no_vmmdev 47 49 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithU32.asm
r59863 r59949 42 42 push xSI 43 43 44 cmp byte [g_fbBs3VMMDevTesting], 0 44 BS3_ONLY_16BIT_STMT push ds 45 mov ax, seg g_fbBs3VMMDevTesting 46 mov ds, ax 47 cmp byte [BS3_DATA16_WRT(g_fbBs3VMMDevTesting)], 0 48 BS3_ONLY_16BIT_STMT pop ds 45 49 je .no_vmmdev 46 50 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-CpuDetect.asm
r59945 r59949 245 245 BS3_ONLY_16BIT_STMT mov bx, seg g_uBs3CpuDetected 246 246 BS3_ONLY_16BIT_STMT mov ds, bx 247 mov [ g_uBs3CpuDetected], ax247 mov [BS3_DATA16_WRT(g_uBs3CpuDetected)], ax 248 248 BS3_ONLY_16BIT_STMT pop ds 249 249 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-EnteredMode.asm
r59941 r59949 172 172 ; Set global indicating CPU mode. 173 173 ; 174 mov byte [BS3_ WRT_RIP(g_bBs3CurrentMode)], TMPL_MODE174 mov byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], TMPL_MODE 175 175 176 176 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForLM64.asm
r59941 r59949 55 55 BS3_ONLY_16BIT_STMT push BS3DATA16 56 56 BS3_ONLY_16BIT_STMT pop ds 57 mov eax, [ g_PhysPagingRootLM TMPL_WRT_DATA16_OR_FLAT]57 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootLM)] 58 58 BS3_ONLY_16BIT_STMT pop ds 59 59 cmp eax, 0ffffffffh … … 96 96 BS3_ONLY_16BIT_STMT push BS3DATA16 97 97 BS3_ONLY_16BIT_STMT pop ds 98 mov eax, [ g_PhysPagingRootLM TMPL_WRT_DATA16_OR_FLAT]98 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootLM)] 99 99 100 100 BS3_ONLY_16BIT_STMT pop ds -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPAE32.asm
r59941 r59949 55 55 BS3_ONLY_16BIT_STMT push BS3DATA16 56 56 BS3_ONLY_16BIT_STMT pop ds 57 mov eax, [ g_PhysPagingRootPAE TMPL_WRT_DATA16_OR_FLAT]57 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPAE)] 58 58 BS3_ONLY_16BIT_STMT pop ds 59 59 cmp eax, 0ffffffffh … … 97 97 BS3_ONLY_16BIT_STMT push BS3DATA16 98 98 BS3_ONLY_16BIT_STMT pop ds 99 mov eax, [ g_PhysPagingRootPAE TMPL_WRT_DATA16_OR_FLAT]99 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPAE)] 100 100 101 101 BS3_ONLY_16BIT_STMT pop ds -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPP32.asm
r59941 r59949 55 55 BS3_ONLY_16BIT_STMT push BS3DATA16 56 56 BS3_ONLY_16BIT_STMT pop ds 57 mov eax, [ g_PhysPagingRootPP TMPL_WRT_DATA16_OR_FLAT]57 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPP)] 58 58 BS3_ONLY_16BIT_STMT pop ds 59 59 cmp eax, 0ffffffffh … … 97 97 BS3_ONLY_16BIT_STMT push BS3DATA16 98 98 BS3_ONLY_16BIT_STMT pop ds 99 mov eax, [ g_PhysPagingRootPP TMPL_WRT_DATA16_OR_FLAT]99 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPP)] 100 100 101 101 BS3_ONLY_16BIT_STMT pop ds -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE16.asm
r59287 r59949 89 89 90 90 ; 91 ; Make sure both PAE and PSE are enabled (requires pentium pro).92 ;93 mov eax, cr494 mov ecx, eax95 or eax, X86_CR4_PAE | X86_CR4_PSE96 cmp eax, ecx97 je .cr4_is_fine98 mov cr4, eax99 .cr4_is_fine:100 101 ;102 91 ; Get the page directory (returned in eax). 103 92 ; Will lazy init page tables (in 16-bit prot mode). … … 108 97 cli 109 98 mov cr3, eax 99 100 ; 101 ; Make sure PAE, PSE, and VME are enabled (former two require pentium pro, latter 486). 102 ; 103 mov eax, cr4 104 mov ecx, eax 105 or eax, X86_CR4_PAE | X86_CR4_PSE | X86_CR4_VME 106 cmp eax, ecx 107 je .cr4_is_fine 108 mov cr4, eax 109 .cr4_is_fine: 110 110 111 111 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE32.asm
r59287 r59949 76 76 77 77 ; 78 ; Make sure both PAE and PSE are enabled (requires pentium pro).79 ;80 mov eax, cr481 mov ecx, eax82 or eax, X86_CR4_PAE | X86_CR4_PSE83 cmp eax, ecx84 je .cr4_is_fine85 mov cr4, eax86 .cr4_is_fine:87 88 ;89 78 ; Get the page directory (returned in eax). 90 79 ; Will lazy init page tables (in 16-bit prot mode). … … 95 84 cli 96 85 mov cr3, eax 86 87 ; 88 ; Make sure PAE, PSE, and VME are enabled (former two require pentium pro, latter 486). 89 ; 90 mov eax, cr4 91 mov ecx, eax 92 or eax, X86_CR4_PAE | X86_CR4_PSE | X86_CR4_VME 93 cmp eax, ecx 94 je .cr4_is_fine 95 mov cr4, eax 96 .cr4_is_fine: 97 97 98 98 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToRM.asm
r59934 r59949 31 31 BS3_EXTERN_DATA16 g_uBs3CpuDetected 32 32 %endif 33 33 34 TMPL_BEGIN_TEXT 34 35 … … 50 51 ret 51 52 53 %elif BS3_MODE_IS_V86(TMPL_MODE) 54 ; 55 ; V8086 - Switch to 16-bit ring-0 and call worker for that mode. 56 ; 57 extern BS3_CMN_NM(Bs3SwitchToRing0) 58 call BS3_CMN_NM(Bs3SwitchToRing0) 59 60 %if TMPL_MODE == BS3_MODE_PE16_V86 61 extern _Bs3SwitchToRM_pe16 62 jmp _Bs3SwitchToRM_pe16 63 %elif TMPL_MODE == BS3_MODE_PEV86 64 extern _Bs3SwitchToRM_pe32_16 65 jmp _Bs3SwitchToRM_pe32_16 66 %elif TMPL_MODE == BS3_MODE_PP16_V86 67 extern _Bs3SwitchToRM_pp16 68 jmp _Bs3SwitchToRM_pp16 69 %elif TMPL_MODE == BS3_MODE_PPV86 70 extern _Bs3SwitchToRM_pp32_16 71 jmp _Bs3SwitchToRM_pp32_16 72 %elif TMPL_MODE == BS3_MODE_PAE16_V86 73 extern _Bs3SwitchToRM_pae16 74 jmp _Bs3SwitchToRM_pae16 75 %elif TMPL_MODE == BS3_MODE_PAEV86 76 extern _Bs3SwitchToRM_pae32_16 77 jmp _Bs3SwitchToRM_pae32_16 78 %else 79 %error "Unexpected TMPL_MODE=" TMPL_MODE 80 %endif 81 52 82 %else 83 ; 84 ; Protected mode. 85 ; 53 86 push sAX 54 87 push sBX … … 67 100 ; On 80286 we must reset the CPU to get back to real mode. 68 101 ; 69 mov ax, seg g_uBs3CpuDetected102 mov ax, BS3_SEL_DATA16 70 103 mov ds, ax 71 cmp byte [ g_uBs3CpuDetected], BS3CPU_80286104 cmp byte [BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80286 72 105 jne .is_386_or_better 73 106 .implement_this_later: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapSystemCallHandler.asm
r59287 r59949 149 149 jmp .return 150 150 151 152 ; 153 ; Switch the caller to ring-0. 154 ; 151 155 .to_ring0: 152 156 int3 157 153 158 jmp .return 154 159 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.mac
r59946 r59949 408 408 %endif 409 409 410 ;; @def TMPL_DATA16_WRT 411 ; WRT DATA16 in 16-bit mode, WRT FLAT in 32- and 64-bit modes. 412 ; This is important when accessing global variables. 413 ; 414 %if TMPL_BITS == 16 415 %define TMPL_DATA16_WRT(a_Var) a_Var wrt BS3DATA16 416 %elif TMPL_BITS == 32 417 %define TMPL_DATA16_WRT(a_Var) a_Var wrt FLAT 418 %elif TMPL_BITS == 64 419 %define TMPL_DATA16_WRT(a_Var) rel a_Var wrt FLAT 420 %else 421 %error TMPL_BITS 422 %endif 423 410 424 ;; @def TMPL_WRT_SYSTEM16_OR_FLAT 411 425 ; WRT BS3SYSTEM16 in 16-bit mode, WRT FLAT in 32- and 64-bit modes. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r59935 r59949 189 189 %undef BS3_WRT_RIP 190 190 %if %1 == 64 191 %ifdef __YASM__ 192 %define BS3_WRT_RIP(a_Sym) a_Sym wrt rip 193 %else 194 %define BS3_WRT_RIP(a_Sym) rel a_Sym ; Baka! Why couldn't they do 'wrt rip' like yasm? 195 %endif 191 %define BS3_WRT_RIP(a_Sym) rel a_Sym 196 192 %else 197 193 %define BS3_WRT_RIP(a_Sym) a_Sym … … 203 199 %else 204 200 %define BS3_LEA_MOV_WRT_RIP(a_DstReg, a_Sym) mov a_DstReg, a_Sym 201 %endif 202 203 ;; @def BS3_DATA16_WRT 204 ; For accessing BS3DATA16 correctly. 205 ; @param a_Var The BS3DATA16 variable. 206 %undef BS3_DATA16_WRT 207 %if %1 == 16 208 %define BS3_DATA16_WRT(a_Var) a_Var wrt BS3DATA16 209 %elif %1 == 32 210 %define BS3_DATA16_WRT(a_Var) a_Var wrt FLAT 211 %else 212 %define BS3_DATA16_WRT(a_Var) BS3_WRT_RIP(a_Var) wrt FLAT 205 213 %endif 206 214
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器