- Timestamp:
- May 7, 2018 1:03:51 PM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 3 added
- 28 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r72133 r72138 132 132 bs3-cmn-RegSetDr7.asm \ 133 133 bs3-cmn-RegSetDrX.asm \ 134 bs3-cmn-RegGetTr.asm \ 135 bs3-cmn-RegSetTr.asm \ 136 bs3-cmn-RegGetLdtr.asm \ 137 bs3-cmn-RegSetLdtr.asm \ 134 138 bs3-cmn-ExtCtxInit.c \ 135 139 bs3-cmn-ExtCtxSave.asm \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetCr0.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetCr0, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, cr0 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_CRX 56 71 mov dl, 0 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, cr064 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetCr0 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetCr2.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetCr2, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, cr2 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_CRX 56 71 mov dl, 2 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, cr264 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetCr2 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetCr3.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetCr3, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, cr3 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_CRX 56 71 mov dl, 3 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, cr364 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetCr3 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetCr4.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetCr4, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, cr4 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_CRX 56 71 mov dl, 4 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, cr464 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetCr4 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDr0.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetDr0, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, dr0 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_DRX 56 71 mov dl, 0 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, dr064 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetDr0 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDr1.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetDr1, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, dr1 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_DRX 56 71 mov dl, 1 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, dr164 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetDr1 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDr2.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetDr2, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, dr2 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_DRX 56 71 mov dl, 2 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, dr264 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetDr2 72 79 73 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDr3.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetDr3, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, dr3 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_DRX 56 71 mov dl, 3 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, dr364 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetDr3 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDr6.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 37 37 38 38 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(RTCCUINTXREG, Bs3RegGetDr 7,(void));39 ; @cproto BS3_CMN_PROTO_STUB(RTCCUINTXREG, Bs3RegGetDr6,(void)); 40 40 ; 41 41 ; @returns Register value. … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetDr6, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, dr6 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_DRX 56 71 mov dl, 6 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, dr664 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetDr6 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDr7.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 45 45 ; 46 46 BS3_PROC_BEGIN_CMN Bs3RegGetDr7, BS3_PBC_HYBRID_SAFE 47 BS3_CALL_CONV_PROLOG 147 BS3_CALL_CONV_PROLOG 0 48 48 push xBP 49 49 mov xBP, xSP … … 52 52 ; If V8086 mode we have to go thru a syscall. 53 53 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 54 jz .direct_access 54 jnz .via_system_call 55 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 56 je .direct_access 57 %endif 58 ; If not in ring-0, we have to make a system call. 59 mov ax, ss 60 and ax, X86_SEL_RPL 61 jnz .via_system_call 62 63 .direct_access: 64 mov sAX, dr7 65 TONLY16 mov edx, eax 66 TONLY16 shr edx, 16 67 jmp .return 68 69 .via_system_call: 55 70 mov xAX, BS3_SYSCALL_GET_DRX 56 71 mov dl, 7 57 72 call Bs3Syscall 58 jmp .return59 60 .direct_access:61 %endif62 ; Switch (iRegister)63 mov sAX, dr764 TONLY16 mov edx, eax65 TONLY16 shr edx, 1666 73 67 74 .return: 68 75 pop xBP 69 BS3_CALL_CONV_EPILOG 176 BS3_CALL_CONV_EPILOG 0 70 77 BS3_HYBRID_RET 71 78 BS3_PROC_END_CMN Bs3RegGetDr7 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetDrX.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 54 54 ; If V8086 mode we have to go thru a syscall. 55 55 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 56 jz .direct_access 57 mov xAX, BS3_SYSCALL_GET_DRX 58 mov dl, [xBP + xCB + cbCurRetAddr] 59 call Bs3Syscall 60 jmp .return_syscall 56 jnz .via_system_call 57 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 58 je .direct_access 59 %endif 60 ; If not in ring-0, we have to make a system call. 61 mov ax, ss 62 and ax, X86_SEL_RPL 63 jnz .via_system_call 61 64 62 65 .direct_access: 63 %endif64 66 ; Switch (iRegister) 65 67 mov al, [xBP + xCB + cbCurRetAddr] … … 84 86 .get_dr0: 85 87 mov sAX, dr0 86 jmp .return 88 jmp .return_fixup 87 89 .get_dr1: 88 90 mov sAX, dr1 89 jmp .return 91 jmp .return_fixup 90 92 .get_dr2: 91 93 mov sAX, dr2 92 jmp .return 94 jmp .return_fixup 93 95 .get_dr3: 94 96 mov sAX, dr3 95 jmp .return 97 jmp .return_fixup 96 98 .get_dr4: 97 99 mov sAX, dr4 98 jmp .return 100 jmp .return_fixup 99 101 .get_dr5: 100 102 mov sAX, dr5 101 jmp .return 103 jmp .return_fixup 102 104 .get_dr7: 103 105 mov sAX, dr7 104 jmp .return 106 jmp .return_fixup 105 107 .get_dr6: 106 108 mov sAX, dr6 107 .return: 109 jmp .return_fixup 110 111 .via_system_call: 112 mov xAX, BS3_SYSCALL_GET_DRX 113 mov dl, [xBP + xCB + cbCurRetAddr] 114 call Bs3Syscall 115 jmp .return 116 117 .return_fixup: 108 118 TONLY16 mov edx, eax 109 119 TONLY16 shr edx, 16 110 .return _syscall:120 .return: 111 121 pop xBP 112 122 BS3_CALL_CONV_EPILOG 1 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetCr0.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_CRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov cr0, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 0 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov cr0, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetCr2.asm
r72133 r72138 1 1 ; $Id$ 2 2 ;; @file 3 ; BS3Kit - Bs3RegSetCr 13 ; BS3Kit - Bs3RegSetCr2 4 4 ; 5 5 … … 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 45 44 ; @uses No GPRs. 46 45 ; 47 BS3_PROC_BEGIN_CMN Bs3RegSetCr 1, BS3_PBC_HYBRID_SAFE46 BS3_PROC_BEGIN_CMN Bs3RegSetCr2, BS3_PBC_HYBRID_SAFE 48 47 BS3_CALL_CONV_PROLOG 1 49 48 push xBP … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_CRX 63 mov dl, 1 64 call Bs3Syscall 65 66 pop dx 67 pop ax 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov cr2, sSI 68 67 jmp .return 69 68 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov cr1, sSI 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 75 mov dl, 2 76 call Bs3Syscall 77 pop xAX 78 pop xDX 74 79 75 80 .return: … … 78 83 BS3_CALL_CONV_EPILOG 1 79 84 BS3_HYBRID_RET 80 BS3_PROC_END_CMN Bs3RegSetCr 185 BS3_PROC_END_CMN Bs3RegSetCr2 81 86 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetCr3.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_CRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov cr3, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 3 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov cr3, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetCr4.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_CRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov cr4, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 4 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov cr4, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDr0.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 37 36 38 37 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr X,(RTCCUINTXREG uValue));38 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr0,(RTCCUINTXREG uValue)); 40 39 ; 41 40 ; @param uValue The value to set. … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_DRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov dr0, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 0 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov dr0, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: … … 80 85 BS3_PROC_END_CMN Bs3RegSetDr0 81 86 82 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDr1.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 37 36 38 37 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr X,(RTCCUINTXREG uValue));38 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr1,(RTCCUINTXREG uValue)); 40 39 ; 41 40 ; @param uValue The value to set. … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_DRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov dr1, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 1 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov dr1, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: … … 80 85 BS3_PROC_END_CMN Bs3RegSetDr1 81 86 82 83 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDr2.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 37 36 38 37 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr X,(RTCCUINTXREG uValue));38 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr2,(RTCCUINTXREG uValue)); 40 39 ; 41 40 ; @param uValue The value to set. … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_DRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov dr2, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 2 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov dr2, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDr3.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 37 36 38 37 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr X,(RTCCUINTXREG uValue));38 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr3,(RTCCUINTXREG uValue)); 40 39 ; 41 40 ; @param uValue The value to set. … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_DRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov dr3, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 3 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov dr3, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDr6.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 37 36 38 37 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr X,(RTCCUINTXREG uValue));38 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr6,(RTCCUINTXREG uValue)); 40 39 ; 41 40 ; @param uValue The value to set. … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_DRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov dr6, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 6 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov dr6, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: … … 80 85 BS3_PROC_END_CMN Bs3RegSetDr6 81 86 82 83 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDr7.asm
r72133 r72138 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif … … 37 36 38 37 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr X,(RTCCUINTXREG uValue));38 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetDr7,(RTCCUINTXREG uValue)); 40 39 ; 41 40 ; @param uValue The value to set. … … 51 50 push sSI 52 51 53 mov sSI, [xBP + xCB + cbCurRetAddr]54 55 52 %if TMPL_BITS == 16 56 53 ; If V8086 mode we have to go thru a syscall. 57 54 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 55 jnz .via_system_call 56 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 57 je .direct_access 58 %endif 59 ; If not in ring-0, we have to make a system call. 60 mov si, ss 61 and si, X86_SEL_RPL 62 jnz .via_system_call 61 63 62 mov ax, BS3_SYSCALL_SET_DRX 64 .direct_access: 65 mov sSI, [xBP + xCB + cbCurRetAddr] 66 mov dr7, sSI 67 jmp .return 68 69 .via_system_call: 70 push xDX 71 push xAX 72 73 mov sSI, [xBP + xCB + cbCurRetAddr] 74 mov xAX, BS3_SYSCALL_SET_DRX 63 75 mov dl, 7 64 76 call Bs3Syscall 65 66 pop dx 67 pop ax 68 jmp .return 69 70 .direct_access: 71 %endif 72 ; Switch (iRegister) 73 mov dr7, sSI 77 pop xAX 78 pop xDX 74 79 75 80 .return: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetDrX.asm
r72133 r72138 29 29 30 30 BS3_EXTERN_CMN Bs3Panic 31 BS3_EXTERN_CMN Bs3Syscall 31 32 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 33 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 34 %endif … … 49 49 ; 50 50 BS3_PROC_BEGIN_CMN Bs3RegSetDrX, BS3_PBC_HYBRID_SAFE 51 BS3_CALL_CONV_PROLOG 151 BS3_CALL_CONV_PROLOG 2 52 52 push xBP 53 53 mov xBP, xSP … … 55 55 push xDX 56 56 57 mov dl, [xBP + xCB + cbCurRetAddr]58 57 mov sSI, [xBP + xCB + cbCurRetAddr + xCB] 59 58 … … 61 60 ; If V8086 mode we have to go thru a syscall. 62 61 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 63 j z .direct_access64 push ax65 66 mov xAX, BS3_SYSCALL_SET_DRX 67 call Bs3Syscall68 69 pop ax70 j mp .return62 jnz .via_system_call 63 cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 64 je .direct_access 65 %endif 66 ; If not in ring-0, we have to make a system call. 67 mov dx, ss 68 and dx, X86_SEL_RPL 69 jnz .via_system_call 71 70 72 71 .direct_access: 73 %endif74 72 ; Switch (iRegister) 73 mov dl, [xBP + xCB + cbCurRetAddr] 75 74 cmp dl, 6 76 75 jz .set_dr6 … … 115 114 .set_dr6: 116 115 mov dr6, sSI 116 jmp .return 117 118 .via_system_call: 119 mov dl, [xBP + xCB + cbCurRetAddr] 120 push xAX 121 mov xAX, BS3_SYSCALL_SET_DRX 122 call Bs3Syscall 123 pop xAX 117 124 118 125 .return: … … 120 127 pop sSI 121 128 pop xBP 122 BS3_CALL_CONV_EPILOG 1129 BS3_CALL_CONV_EPILOG 2 123 130 BS3_HYBRID_RET 124 131 BS3_PROC_END_CMN Bs3RegSetDrX -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetTr.asm
r72136 r72138 1 1 ; $Id$ 2 2 ;; @file 3 ; BS3Kit - Bs3RegSet Cr03 ; BS3Kit - Bs3RegSetTr 4 4 ; 5 5 … … 28 28 29 29 30 BS3_EXTERN_CMN Bs3 Panic30 BS3_EXTERN_CMN Bs3Syscall 31 31 %if TMPL_BITS == 16 32 BS3_EXTERN_CMN Bs3Syscall33 32 BS3_EXTERN_DATA16 g_bBs3CurrentMode 34 33 %endif 34 BS3_EXTERN_SYSTEM16 Bs3Gdt 35 35 TMPL_BEGIN_TEXT 36 36 37 37 38 38 ;; 39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSet Cr0,(RTCCUINTXREGuValue));39 ; @cproto BS3_CMN_PROTO_STUB(void, Bs3RegSetTr,(uint16_t uValue)); 40 40 ; 41 41 ; @param uValue The value to set. … … 45 45 ; @uses No GPRs. 46 46 ; 47 BS3_PROC_BEGIN_CMN Bs3RegSet Cr0, BS3_PBC_HYBRID_SAFE47 BS3_PROC_BEGIN_CMN Bs3RegSetTr, BS3_PBC_HYBRID_SAFE 48 48 BS3_CALL_CONV_PROLOG 1 49 49 push xBP 50 50 mov xBP, xSP 51 push sSI 51 push xDX 52 push xAX 53 push xDI 52 54 53 mov sSI, [xBP + xCB + cbCurRetAddr]55 mov dx, [xBP + xCB + cbCurRetAddr] 54 56 55 57 %if TMPL_BITS == 16 56 58 ; If V8086 mode we have to go thru a syscall. 57 59 test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 58 jz .direct_access 59 push ax 60 push dx 60 jnz .via_system_call 61 %endif 62 ; If not in ring-0, we have to make a system call. 63 mov ax, ss 64 and ax, X86_SEL_RPL 65 jnz .via_system_call 61 66 62 mov ax, BS3_SYSCALL_SET_CRX 63 mov dl, 0 67 ; Before we can load it, we must mark it non-busy. 68 %if TMPL_BITS == 16 69 push ds 70 mov ax, BS3_SEL_SYSTEM16 71 mov ds, ax 72 add xDI, Bs3Gdt wrt BS3SYSTEM16 73 %else 74 add xDI, Bs3Gdt wrt FLAT 75 %endif 76 add xDI, X86DESCGENERIC_BIT_OFF_TYPE / 8 77 and byte [xDI], ~(X86_SEL_TYPE_SYS_TSS_BUSY_MASK << (X86DESCGENERIC_BIT_OFF_TYPE % 8)) 78 %if TMPL_BITS == 16 79 pop ds 80 %endif 81 ltr dx 82 jmp .return 83 84 .via_system_call: 85 mov ax, BS3_SYSCALL_SET_TR 64 86 call Bs3Syscall 65 87 66 pop dx67 pop ax68 jmp .return69 70 .direct_access:71 %endif72 ; Switch (iRegister)73 mov cr0, sSI74 75 88 .return: 76 pop sSI 89 pop xDI 90 pop xAX 91 pop xDX 77 92 pop xBP 78 93 BS3_CALL_CONV_EPILOG 1 79 94 BS3_HYBRID_RET 80 BS3_PROC_END_CMN Bs3RegSet Cr095 BS3_PROC_END_CMN Bs3RegSetTr 81 96 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapDefaultHandler.c
r72133 r72138 125 125 pTrapFrame->Ctx.rdx.u32 = uValue >> 16; 126 126 } 127 else if (uSyscallNo == BS3_SYSCALL_SET_TR) 128 Bs3RegSetTr(pTrapFrame->Ctx.rdx.u16); 129 else if (uSyscallNo == BS3_SYSCALL_GET_TR) 130 pTrapFrame->Ctx.rax.u16 = ASMGetTR(); 131 else if (uSyscallNo == BS3_SYSCALL_SET_LDTR) 132 Bs3RegSetLdtr(pTrapFrame->Ctx.rdx.u16); 133 else if (uSyscallNo == BS3_SYSCALL_GET_LDTR) 134 pTrapFrame->Ctx.rax.u16 = ASMGetLDTR(); 127 135 else 128 136 Bs3Panic(); … … 137 145 * v8086 VMM tasks. 138 146 */ 139 //Bs3TestHostPrintf("Bs3____DefaultHandler: %02xh %04RX16:%08RX32 %08RX32 %04RX16:%08RX32 %d %d\n", pTrapFrame->bXcpt, 140 // pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32, pTrapFrame->Ctx.ss, pTrapFrame->Ctx.rsp.u32, g_fBs3TrapNoV86Assist, 42); 147 //Bs3TestHostPrintf("Bs3____DefaultHandler: %02xh %04RX16:%08RX32 %08RX32 %04RX16:%08RX32 %d %d\n", pTrapFrame->bXcpt, 148 // pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32, pTrapFrame->Ctx.ss, 149 // pTrapFrame->Ctx.rsp.u32, g_fBs3TrapNoV86Assist, 42); 141 150 if ( (pTrapFrame->Ctx.rflags.u32 & X86_EFL_VM) 142 151 && !g_fBs3TrapNoV86Assist) … … 152 161 pbCode = (uint8_t const BS3_FAR *)BS3_MAKE_PROT_R0PTR_FROM_REAL(pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u16); 153 162 pbCodeStart = pbCode; 154 //Bs3TestHostPrintf("Bs3TrapDefaultHandler: V86 assist...\n");155 163 156 164 /* … … 159 167 if (pTrapFrame->bXcpt == X86_XCPT_GP) 160 168 { 161 //Bs3TestHostPrintf("Bs3TrapDefaultHandler: #GP %04RX16:%08RX32 %08RX32\n", pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32);162 169 bOpCode = *pbCode++; 163 170 if (bOpCode == 0x66) … … 262 269 else 263 270 { 264 //Bs3TestHostPrintf("Bs3TrapDefaultHandler: %02x %04RX16:%08RX32 %08RX32\n", pTrapFrame->bXcpt, pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32);265 271 fHandled = false; 266 272 } … … 273 279 # endif 274 280 Bs3RegCtxRestore(&pTrapFrame->Ctx, 0 /*fFlags*/); /* does not return. */ 275 Bs3TestHostPrintf("Bs3TrapDefaultHandler: => Handled\n");276 281 return; 277 282 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r72133 r72138 105 105 #define Bs3RegGetDr7 BS3_CMN_MANGLER(Bs3RegGetDr7) 106 106 #define Bs3RegGetDrX BS3_CMN_MANGLER(Bs3RegGetDrX) 107 #define Bs3RegGetLdtr BS3_CMN_MANGLER(Bs3RegGetLdtr) 108 #define Bs3RegGetTr BS3_CMN_MANGLER(Bs3RegGetTr) 107 109 #define Bs3RegSetCr0 BS3_CMN_MANGLER(Bs3RegSetCr0) 108 110 #define Bs3RegSetCr2 BS3_CMN_MANGLER(Bs3RegSetCr2) … … 116 118 #define Bs3RegSetDr7 BS3_CMN_MANGLER(Bs3RegSetDr7) 117 119 #define Bs3RegSetDrX BS3_CMN_MANGLER(Bs3RegSetDrX) 120 #define Bs3RegSetLdtr BS3_CMN_MANGLER(Bs3RegSetLdtr) 121 #define Bs3RegSetTr BS3_CMN_MANGLER(Bs3RegSetTr) 118 122 #define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32) 119 123 #define Bs3SelFar32ToFlat32NoClobber BS3_CMN_MANGLER(Bs3SelFar32ToFlat32NoClobber) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r72133 r72138 105 105 #undef Bs3RegGetDr7 106 106 #undef Bs3RegGetDrX 107 #undef Bs3RegGetLdtr 108 #undef Bs3RegGetTr 107 109 #undef Bs3RegSetCr0 108 110 #undef Bs3RegSetCr2 … … 116 118 #undef Bs3RegSetDr7 117 119 #undef Bs3RegSetDrX 120 #undef Bs3RegSetLdtr 121 #undef Bs3RegSetTr 118 122 #undef Bs3SelFar32ToFlat32 119 123 #undef Bs3SelFar32ToFlat32NoClobber -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r72133 r72138 836 836 /** Get CRx register (register number in dl, value returned in ax:dx). */ 837 837 #define BS3_SYSCALL_GET_CRX UINT16_C(0x000b) 838 /** Set the task register (value in ESI). */ 839 #define BS3_SYSCALL_SET_TR UINT16_C(0x000c) 840 /** Get the task register (value returned in ax). */ 841 #define BS3_SYSCALL_GET_TR UINT16_C(0x000d) 842 /** Set the LDT register (value in ESI). */ 843 #define BS3_SYSCALL_SET_LDTR UINT16_C(0x000e) 844 /** Get the LDT register (value returned in ax). */ 845 #define BS3_SYSCALL_GET_LDTR UINT16_C(0x000f) 838 846 /** @} */ 839 847 … … 2843 2851 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr3,(void)); 2844 2852 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr4,(void)); 2853 BS3_CMN_PROTO_NOSB(uint16_t, Bs3RegGetTr,(void)); 2854 BS3_CMN_PROTO_NOSB(uint16_t, Bs3RegGetLdtr,(void)); 2845 2855 2846 2856 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr0,(RTCCUINTXREG uValue)); … … 2848 2858 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr3,(RTCCUINTXREG uValue)); 2849 2859 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr4,(RTCCUINTXREG uValue)); 2860 BS3_CMN_PROTO_NOSB(void, Bs3RegSetTr,(uint16_t uValue)); 2861 BS3_CMN_PROTO_NOSB(void, Bs3RegSetLdtr,(uint16_t uValue)); 2850 2862 /** @} */ 2851 2863 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r72133 r72138 1507 1507 ;; Get CRx register (register number in dl, value returned in ax:dx). 1508 1508 %define BS3_SYSCALL_GET_CRX 000bh 1509 ;; Set the task register (value in dx). */ 1510 %define BS3_SYSCALL_SET_TR 000ch 1511 ;; Get the task register (value returned in ax). 1512 %define BS3_SYSCALL_GET_TR 000dh 1513 ;; Set the LDT register (value in dx). 1514 %define BS3_SYSCALL_SET_LDTR 000eh 1515 ;; Get the LDT register (value returned in ax). 1516 %define BS3_SYSCALL_GET_LDTR 000fh 1509 1517 ;; The last system call value. 1510 %define BS3_SYSCALL_LAST BS3_SYSCALL_GET_ CRX1518 %define BS3_SYSCALL_LAST BS3_SYSCALL_GET_LDTR 1511 1519 ;; @} 1512 1520
Note:
See TracChangeset
for help on using the changeset viewer.