- 時間撮記:
- 2016-3-26 下午01:17:53 (9 年 以前)
- 位置:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- 檔案:
-
- 新增 1 筆資料
- 修改 6 筆資料
- 複製 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60137 r60194 124 124 bs3-cmn-Trap32Init.c \ 125 125 bs3-cmn-Trap32SetGate.c \ 126 bs3-cmn-Trap64Init.c \ 126 127 bs3-cmn-Trap64SetGate.c \ 127 128 bs3-cmn-TrapDefaultHandler.c \ … … 191 192 bs3kit-common-64-asm_DEFS = TMPL_LM64 BS3_CMN_ONLY 192 193 bs3kit-common-64-asm_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE 193 bs3kit-common-64-asm_SOURCES = $(filter %.asm,$(VBOX_BS3KIT_COMMON_SOURCES)) 194 bs3kit-common-64-asm_SOURCES = $(filter %.asm,$(VBOX_BS3KIT_COMMON_SOURCES)) \ 195 bs3-c64-Trap64Generic.asm 194 196 195 197 # The 64-bit BS3Kit library. … … 234 236 bs3-mode-PagingGetRootForPAE32.asm \ 235 237 bs3-mode-PagingGetRootForLM64.asm \ 238 bs3-mode-TrapInit.c \ 236 239 bs3-mode-TrapSystemCallHandler.asm \ 237 240 bs3-mode-TestDoModes.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c64-Trap64Generic.asm
r60188 r60194 1 1 ; $Id$ 2 2 ;; @file 3 ; BS3Kit - Trap, 32-bit assembly handlers.3 ; BS3Kit - Trap, 64-bit assembly handlers. 4 4 ; 5 5 … … 30 30 %include "bs3kit-template-header.mac" 31 31 32 %ifndef TMPL_ 32BIT33 %error " 32-bit only template"32 %ifndef TMPL_64BIT 33 %error "64-bit only template" 34 34 %endif 35 35 … … 39 39 ;********************************************************************************************************************************* 40 40 BS3_EXTERN_DATA16 g_bBs3CurrentMode 41 BS3_EXTERN_SYSTEM16 Bs3Gdt42 41 TMPL_BEGIN_TEXT 43 42 BS3_EXTERN_CMN Bs3TrapDefaultHandler … … 50 49 ;********************************************************************************************************************************* 51 50 BS3_BEGIN_DATA16 52 ;; Easy to access flat address of Bs3Trap32GenericEntries. 53 BS3_GLOBAL_DATA g_Bs3Trap32GenericEntriesFlatAddr, 4 54 dd Bs3Trap32GenericEntries wrt FLAT 55 ;; Easy to access flat address of Bs3Trap32DoubleFaultHandler. 56 BS3_GLOBAL_DATA g_Bs3Trap32DoubleFaultHandlerFlatAddr, 4 57 dd Bs3Trap32DoubleFaultHandler wrt FLAT 58 59 BS3_BEGIN_DATA32 51 ;; Easy to access flat address of Bs3Trap64GenericEntries. 52 BS3_GLOBAL_DATA g_Bs3Trap64GenericEntriesFlatAddr, 4 53 dd Bs3Trap64GenericEntries wrt FLAT 54 55 BS3_BEGIN_DATA64 60 56 ;; Pointer C trap handlers. 61 BS3_GLOBAL_DATA g_apfnBs3TrapHandlers_c 32, 102462 res d25657 BS3_GLOBAL_DATA g_apfnBs3TrapHandlers_c64, 2048 58 resq 256 63 59 64 60 … … 67 63 ; Generic entry points for IDT handlers, 8 byte spacing. 68 64 ; 69 BS3_PROC_BEGIN Bs3Trap 32GenericEntries70 %macro Bs3Trap 32GenericEntry 165 BS3_PROC_BEGIN Bs3Trap64GenericEntries 66 %macro Bs3Trap64GenericEntry 1 71 67 db 06ah, i ; push imm8 - note that this is a signextended value. 72 68 jmp %1 … … 76 72 77 73 %assign i 0 ; start counter. 78 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 079 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 180 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 281 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 382 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 483 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 584 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 685 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 786 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; 887 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 988 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; a89 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; b90 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; c91 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; d92 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; e93 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; f (reserved)94 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1095 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; 1196 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1297 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1398 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1499 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 15 (reserved)100 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 16 (reserved)101 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 17 (reserved)102 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 18 (reserved)103 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 19 (reserved)104 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1a (reserved)105 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1b (reserved)106 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1c (reserved)107 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1d (reserved)108 Bs3Trap 32GenericEntry bs3Trap32GenericTrapErrCode ; 1e109 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt ; 1f (reserved)74 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 0 75 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 1 76 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 2 77 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 3 78 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 4 79 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 5 80 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 6 81 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 7 82 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; 8 83 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 9 84 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; a 85 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; b 86 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; c 87 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; d 88 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; e 89 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; f (reserved) 90 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 10 91 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; 11 92 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 12 93 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 13 94 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 14 95 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 15 (reserved) 96 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 16 (reserved) 97 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 17 (reserved) 98 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 18 (reserved) 99 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 19 (reserved) 100 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 1a (reserved) 101 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 1b (reserved) 102 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 1c (reserved) 103 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 1d (reserved) 104 Bs3Trap64GenericEntry Bs3Trap64GenericTrapErrCode ; 1e 105 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt ; 1f (reserved) 110 106 %rep 224 111 Bs3Trap 32GenericEntry bs3Trap32GenericTrapOrInt107 Bs3Trap64GenericEntry Bs3Trap64GenericTrapOrInt 112 108 %endrep 113 BS3_PROC_END Bs3Trap 32GenericEntries109 BS3_PROC_END Bs3Trap64GenericEntries 114 110 115 111 … … 119 115 ; Trap or interrupt (no error code). 120 116 ; 121 BS3_PROC_BEGIN bs3Trap32GenericTrapOrInt122 push ebp ; 0123 mov ebp, esp124 pushf d ; -04h117 BS3_PROC_BEGIN Bs3Trap64GenericTrapOrInt 118 push rbp ; 0 119 mov rbp, rsp 120 pushfq ; -08h 125 121 cli 126 122 cld 127 push eax ; -08h 128 push edi ; -0ch 129 lea eax, [esp + (4 + 1)*4] ; 4 pushes above, 1 exception number push. 130 push eax ; -10h = handler ESP 131 add eax, 3*4 ; 3 dword iret frame 132 push eax ; -14h = caller ESP if same CPL 133 push ss ; -18h 134 push ds ; -1ch 135 136 ; Make sure we've got a flat DS (ASSUMES ring-0). It makes everything so much simpler. 137 mov ax, BS3_SEL_R0_DS32 138 mov ds, ax 139 140 ; 141 ; We may be comming from 16-bit code with a 16-bit SS. Thunk it as 142 ; the C code may assume flat SS and we'll mess up by using EBP/ESP/EDI 143 ; instead of BP/SP/SS:DI. ASSUMES standard GDT selector. 144 ; 145 mov ax, ss 146 lar eax, ax 147 test eax, X86LAR_F_D 148 jz .stack_thunk 149 mov ax, BS3_SEL_R0_SS32 150 mov ss, ax 151 jmp .stack_flat 152 .stack_thunk: 153 mov di, ss 154 and edi, X86_SEL_MASK_OFF_RPL 155 mov al, [X86DESCGENERIC_BIT_OFF_BASE_HIGH1 / 8 + edi + Bs3Gdt wrt FLAT] 156 mov ah, [X86DESCGENERIC_BIT_OFF_BASE_HIGH2 / 8 + edi + Bs3Gdt wrt FLAT] 157 shl eax, 16 158 mov ax, [X86DESCGENERIC_BIT_OFF_BASE_LOW / 8 + edi + Bs3Gdt wrt FLAT] ; eax = SS.base 159 movzx ebp, bp ; SS:BP -> flat EBP. 160 add ebp, eax 161 movzx edi, sp ; SS:SP -> flat ESP in EAX. 162 add eax, edi 163 mov di, BS3_SEL_R0_SS32 164 mov ss, di 165 mov esp, eax 166 sub dword [ebp - 10h], (4+1)*4 ; Recalc handler ESP in case of wraparound. 167 add word [ebp - 10h], (4+1)*4 168 sub dword [ebp - 10h], (4+1+3)*4 ; Recalc caller ESP in case of wraparound. 169 add word [ebp - 10h], (4+1+3)*4 170 .stack_flat: 123 push rdi 171 124 172 125 ; Reserve space for the the register and trap frame. 173 mov eax, (BS3TRAPFRAME_size + 7) / 8 174 AssertCompileSizeAlignment(BS3TRAPFRAME, 8) 126 mov edi, (BS3TRAPFRAME_size + 15) / 16 175 127 .more_zeroed_space: 176 push dword 0177 push dword 0178 dec e ax128 push qword 0 129 push qword 0 130 dec edi 179 131 jnz .more_zeroed_space 180 mov edi, esp ; edi points to trapframe structure. 132 mov rdi, rsp ; rdi points to trapframe structure. 133 134 ; Free up rax. 135 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], rax 181 136 182 137 ; Copy stuff from the stack over. 183 mov al, [ebp + 4] 184 mov [edi + BS3TRAPFRAME.bXcpt], al 185 mov eax, [ebp] 186 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], eax 187 mov eax, [ebp - 04h] 188 mov [edi + BS3TRAPFRAME.fHandlerRfl], eax 189 mov eax, [ebp - 08h] 190 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax 191 mov eax, [ebp - 0ch] 192 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], eax 193 mov eax, [ebp - 10h] 194 mov [edi + BS3TRAPFRAME.uHandlerRsp], eax 195 mov eax, [ebp - 14h] 196 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], eax 197 mov ax, [ebp - 18h] 198 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], ax 199 mov [edi + BS3TRAPFRAME.uHandlerSs], ax 200 mov ax, [ebp - 1ch] 201 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ax 202 203 lea ebp, [ebp + 4] ; iret - 4 (i.e. ebp frame chain location) 204 jmp bs3Trap32GenericCommon 205 BS3_PROC_END bs3Trap32GenericTrapOrInt 138 mov al, [rbp + 08h] 139 mov [rdi + BS3TRAPFRAME.bXcpt], al 140 mov rax, [rbp] 141 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], rax 142 mov rax, [rbp - 08h] 143 mov [rdi + BS3TRAPFRAME.fHandlerRfl], rax 144 mov rax, [rbp - 10h] 145 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], rax 146 147 lea rbp, [rbp + 08h] ; iret - 8 (i.e. rbp frame chain location) 148 jmp Bs3Trap64GenericCommon 149 BS3_PROC_END Bs3Trap64GenericTrapOrInt 206 150 207 151 … … 209 153 ; Trap with error code. 210 154 ; 211 BS3_PROC_BEGIN bs3Trap32GenericTrapErrCode212 push ebp ; 0213 mov ebp, esp214 pushf d ; -04h155 BS3_PROC_BEGIN Bs3Trap64GenericTrapErrCode 156 push rbp ; 0 157 mov rbp, rsp 158 pushfq ; -08h 215 159 cli 216 160 cld 217 push eax ; -08h 218 push edi ; -0ch 219 lea eax, [esp + (4+1+1)*4] ; 4 pushes above, 1 exception number push, 1 error code. 220 push eax ; -10h = handler ESP 221 add eax, 3*4 ; 3 dword iret frame 222 push eax ; -14h = caller ESP if same CPL 223 push ss ; -18h 224 push ds ; -1ch 225 226 ; Make sure we've got a flat DS (ASSUMES ring-0). It makes everything so much simpler. 227 mov ax, BS3_SEL_R0_DS32 228 mov ds, ax 229 230 ; 231 ; We may be comming from 16-bit code with a 16-bit SS. Thunk it as 232 ; the C code may assume flat SS and we'll mess up by using EBP/ESP/EDI 233 ; instead of BP/SP/SS:DI. ASSUMES standard GDT selector. 234 ; 235 mov ax, ss 236 lar eax, ax 237 test eax, X86LAR_F_D 238 jz .stack_thunk 239 mov ax, BS3_SEL_R0_SS32 240 mov ss, ax 241 jmp .stack_flat 242 .stack_thunk: 243 mov di, ss 244 and edi, X86_SEL_MASK_OFF_RPL 245 mov al, [X86DESCGENERIC_BIT_OFF_BASE_HIGH1 / 8 + edi + Bs3Gdt wrt FLAT] 246 mov ah, [X86DESCGENERIC_BIT_OFF_BASE_HIGH2 / 8 + edi + Bs3Gdt wrt FLAT] 247 shl eax, 16 248 mov ax, [X86DESCGENERIC_BIT_OFF_BASE_LOW / 8 + edi + Bs3Gdt wrt FLAT] ; eax = SS.base 249 movzx ebp, bp ; SS:BP -> flat EBP. 250 add ebp, eax 251 movzx edi, sp ; SS:SP -> flat ESP in EAX. 252 add eax, edi 253 mov di, BS3_SEL_R0_SS32 254 mov ss, di 255 mov esp, eax 256 sub dword [ebp - 10h], (4+1+1)*4 ; Recalc handler ESP in case of wraparound. 257 add word [ebp - 10h], (4+1+1)*4 258 sub dword [ebp - 14h], (4+1+1+3)*4 ; Recalc caller ESP in case of wraparound. 259 add word [ebp - 14h], (4+1+1+3)*4 260 .stack_flat: 161 push rdi 261 162 262 163 ; Reserve space for the the register and trap frame. 263 mov eax, (BS3TRAPFRAME_size + 7) / 8 264 AssertCompileSizeAlignment(BS3TRAPFRAME, 8) 164 mov edi, (BS3TRAPFRAME_size + 15) / 16 265 165 .more_zeroed_space: 266 push dword 0267 push dword 0268 dec e ax166 push qword 0 167 push qword 0 168 dec edi 269 169 jnz .more_zeroed_space 270 mov edi, esp ; edi points to trapframe structure. 170 mov rdi, rsp ; rdi points to trapframe structure. 171 172 ; Free up rax. 173 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], rax 271 174 272 175 ; Copy stuff from the stack over. 273 mov eax, [ebp + 8] 274 ;; @todo Do voodoo checks for 'int xx' or misguided hardware interrupts. 275 mov [edi + BS3TRAPFRAME.uErrCd], eax 276 mov al, [ebp + 4] 277 mov [edi + BS3TRAPFRAME.bXcpt], al 278 mov eax, [ebp] 279 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], eax 280 mov eax, [ebp - 04h] 281 mov [edi + BS3TRAPFRAME.fHandlerRfl], eax 282 mov eax, [ebp - 08h] 283 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax 284 mov eax, [ebp - 0ch] 285 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], eax 286 mov eax, [ebp - 10h] 287 mov [edi + BS3TRAPFRAME.uHandlerRsp], eax 288 mov eax, [ebp - 14h] 289 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], eax 290 mov ax, [ebp - 18h] 291 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], ax 292 mov [edi + BS3TRAPFRAME.uHandlerSs], ax 293 mov ax, [ebp - 1ch] 294 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ax 295 296 lea ebp, [ebp + 8] ; iret - 4 (i.e. ebp frame chain location) 297 jmp bs3Trap32GenericCommon 298 BS3_PROC_END bs3Trap32GenericTrapErrCode 176 mov rax, [rbp + 10h] 177 mov [rdi + BS3TRAPFRAME.uErrCd], rax 178 mov al, [rbp + 08h] 179 mov [rdi + BS3TRAPFRAME.bXcpt], al 180 mov rax, [rbp] 181 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], rax 182 mov rax, [rbp - 08h] 183 mov [rdi + BS3TRAPFRAME.fHandlerRfl], rax 184 mov rax, [rbp - 10h] 185 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], rax 186 187 lea rbp, [rbp + 10h] ; iret - 8 (i.e. rbp frame chain location) 188 jmp Bs3Trap64GenericCommon 189 BS3_PROC_END Bs3Trap64GenericTrapErrCode 299 190 300 191 … … 302 193 ; Common context saving code and dispatching. 303 194 ; 304 ; @param edi Pointer to the trap frame. The following members have been195 ; @param rdi Pointer to the trap frame. The following members have been 305 196 ; filled in by the previous code: 306 197 ; - bXcpt 307 198 ; - uErrCd 308 199 ; - fHandlerRfl 309 ; - uHandlerRsp310 ; - uHandlerSs311 200 ; - Ctx.rax 312 201 ; - Ctx.rbp 313 202 ; - Ctx.rdi 314 ; - Ctx.rsp - assuming same CPL 315 ; - Ctx.ds 316 ; - Ctx.ss 317 ; 318 ; @param ebp Pointer to the dword before the iret frame, i.e. where ebp 203 ; 204 ; @param rbp Pointer to the dword before the iret frame, i.e. where rbp 319 205 ; would be saved if this was a normal call. 320 206 ; 321 BS3_PROC_BEGIN bs3Trap32GenericCommon322 ; 323 ; Fake EBP frame.324 ; 325 mov eax, [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp]326 mov [ ebp], eax207 BS3_PROC_BEGIN Bs3Trap64GenericCommon 208 ; 209 ; Fake RBP frame. 210 ; 211 mov rax, [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp] 212 mov [rbp], rax 327 213 328 214 ; 329 215 ; Save the remaining GPRs and segment registers. 330 216 ; 331 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], ecx 332 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx 333 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], ebx 334 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], esi 335 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.es], es 336 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], fs 337 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], gs 338 339 ; 340 ; Load 32-bit data selector for the DPL we're executing at into DS and ES. 217 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], rcx 218 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], rdx 219 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], rbx 220 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], rsi 221 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r8 ], r8 222 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r9 ], r9 223 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r10], r10 224 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r11], r11 225 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r12], r12 226 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r13], r13 227 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r14], r14 228 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.r15], r15 229 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ds 230 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.es], es 231 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], fs 232 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], gs 233 lea rax, [rbp + 8h] 234 mov [rdi + BS3TRAPFRAME.uHandlerRsp], rax 235 mov [rdi + BS3TRAPFRAME.uHandlerSs], ss 236 237 ; 238 ; Load 32-bit data selector for the DPL we're executing at into DS, ES and SS. 341 239 ; Save the handler CS value first. 342 240 ; 343 241 mov ax, cs 344 mov [ edi + BS3TRAPFRAME.uHandlerCs], ax242 mov [rdi + BS3TRAPFRAME.uHandlerCs], ax 345 243 and ax, 3 346 mov cx, ax 244 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], al 245 246 mov cx, ax ; AX is CPL, see above. 347 247 shl ax, BS3_SEL_RING_SHIFT 348 248 or ax, cx 349 add ax, BS3_SEL_R0_DS 32249 add ax, BS3_SEL_R0_DS64 350 250 mov ds, ax 351 251 mov es, ax 352 353 ; 354 ; Copy and update the mode now that we've got a flat DS. 252 mov ss, ax 253 254 ; 255 ; Copy and update the mode. 355 256 ; 356 257 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 357 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], al258 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], al 358 259 and al, ~BS3_MODE_CODE_MASK 359 or al, BS3_MODE_CODE_ 32260 or al, BS3_MODE_CODE_64 360 261 mov [BS3_DATA16_WRT(g_bBs3CurrentMode)], al 361 262 362 263 ; 363 ; Copy iret info. 364 ; 365 mov ecx, [ebp + 4] 366 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rip], ecx 367 mov ecx, [ebp + 12] 368 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], ecx 369 mov cx, [ebp + 8] 370 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx 371 test dword [ebp + 12], X86_EFL_VM 372 jnz .iret_frame_v8086 373 mov ax, ss 374 and al, 3 375 and cl, 3 376 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], cl 377 cmp cl, al 378 je .iret_frame_same_cpl 379 380 .iret_frame_different_cpl: 381 mov ecx, [ebp + 16] 382 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], ecx 383 mov cx, [ebp + 20] 384 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 385 mov byte [edi + BS3TRAPFRAME.cbIretFrame], 5*4 386 jmp .iret_frame_done 387 388 .iret_frame_v8086: 389 mov byte [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], 3 390 or byte [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], BS3_MODE_CODE_V86 ; paranoia ^ 2 391 movzx ecx, word [ebp + 16] 392 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], ecx 393 mov cx, [ebp + 20] 394 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 395 mov cx, [ebp + 24] 396 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.es], cx 397 mov cx, [ebp + 28] 398 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], cx 399 mov cx, [ebp + 32] 400 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], cx 401 mov cx, [ebp + 36] 402 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], cx 403 mov byte [edi + BS3TRAPFRAME.cbIretFrame], 9*4 404 jmp .iret_frame_done 405 406 .iret_frame_same_cpl: ; (caller already set SS:RSP and uHandlerRsp for same CPL iret frames) 407 mov byte [edi + BS3TRAPFRAME.cbIretFrame], 3*4 408 409 .iret_frame_done: 264 ; Copy iret info. Bless AMD for only doing one 64-bit iret frame layout. 265 ; 266 mov rcx, [rbp + 08] 267 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rip], rcx 268 mov cx, [rbp + 10h] 269 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx 270 mov rcx, [rbp + 18h] 271 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], rcx 272 mov rcx, [rbp + 20h] 273 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], rcx 274 mov cx, [rbp + 28h] 275 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 276 mov byte [rdi + BS3TRAPFRAME.cbIretFrame], 5*8 277 410 278 ; 411 279 ; Control registers. 412 280 ; 413 mov eax, cr0414 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], eax415 mov eax, cr2416 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr2], eax417 mov eax, cr3418 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr3], eax419 mov eax, cr4420 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], eax281 mov rax, cr0 282 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], rax 283 mov rax, cr2 284 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr2], rax 285 mov rax, cr3 286 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr3], rax 287 mov rax, cr4 288 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], rax 421 289 str ax 422 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.tr], ax290 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.tr], ax 423 291 sldt ax 424 mov [ edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr], ax292 mov [rdi + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr], ax 425 293 426 294 ; 427 295 ; Dispatch it to C code. 428 296 ; 429 .dispatch_to_handler: ; The double fault code joins us here. 430 movzx ebx, byte [edi + BS3TRAPFRAME.bXcpt]431 mov eax, [ebx * 4 + BS3_DATA16_WRT(_g_apfnBs3TrapHandlers_c32)]432 or eax, eax297 movzx ebx, byte [rdi + BS3TRAPFRAME.bXcpt] 298 lea rax, [BS3_DATA16_WRT(_g_apfnBs3TrapHandlers_c64)] 299 mov rax, [rax + rbx * 8] 300 or rax, rax 433 301 jnz .call_handler 434 mov eax, Bs3TrapDefaultHandler302 lea rax, [BS3_WRT_RIP(Bs3TrapDefaultHandler)] 435 303 .call_handler: 436 push edi 437 call eax 304 sub rsp, 20h 305 mov [rsp], rdi 306 mov rcx, rdi 307 call rax 438 308 439 309 ; 440 310 ; Resume execution using trap frame. 441 311 ; 442 push 0 443 add edi, BS3TRAPFRAME.Ctx 444 push edi 312 xor edx, edx ; fFlags 313 mov [rsp + 8], rdx 314 lea rcx, [rdi + BS3TRAPFRAME.Ctx] ; pCtx 315 mov [rsp], rcx 445 316 call Bs3RegCtxRestore 446 317 .panic: 447 318 hlt 448 319 jmp .panic 449 BS3_PROC_END bs3Trap32GenericCommon 450 451 452 ;; 453 ; Helper. 454 ; 455 ; @retruns Flat address in eax. 456 ; @param ax 457 ; @uses eax 458 ; 459 bs3Trap32TssInAxToFlatInEax: 460 ; Get the GDT base address and find the descriptor address (EAX) 461 sub esp, 8+2 462 sgdt [esp] 463 and eax, 0fff8h 464 add eax, [esp + 2] ; GDT base address. 465 add esp, 8+2 466 467 ; Get the flat TSS address from the descriptor. 468 mov al, [eax + (X86DESCGENERIC_BIT_OFF_BASE_HIGH1 / 8)] 469 mov ah, [eax + (X86DESCGENERIC_BIT_OFF_BASE_HIGH2 / 8)] 470 shl eax, 16 471 mov ax, [eax + (X86DESCGENERIC_BIT_OFF_BASE_LOW / 8)] 472 ret 473 474 ;; 475 ; Double fault handler. 476 ; 477 ; We don't have to load any selectors or clear anything in EFLAGS because the 478 ; TSS specified sane values which got loaded during the task switch. 479 ; 480 BS3_PROC_BEGIN Bs3Trap32DoubleFaultHandler 481 push 0 ; We'll copy the rip from the other TSS here later to create a more sensible call chain. 482 push ebp 483 mov ebp, esp 484 485 pushfd ; Get handler flags. 486 pop ecx 487 488 xor edx, edx ; NULL register. 489 490 ; 491 ; Allocate a zero filled trap frame. 492 ; 493 mov eax, (BS3TRAPFRAME_size + 7) / 8 494 AssertCompileSizeAlignment(BS3TRAPFRAME, 8) 495 .more_zeroed_space: 496 push edx 497 push edx 498 dec eax 499 jz .more_zeroed_space 500 mov edi, esp 501 502 ; 503 ; Fill in the non-context trap frame bits. 504 ; 505 mov [edi + BS3TRAPFRAME.fHandlerRfl], ecx 506 mov word [edi + BS3TRAPFRAME.bXcpt], X86_XCPT_DF 507 mov [edi + BS3TRAPFRAME.uHandlerCs], cs 508 mov [edi + BS3TRAPFRAME.uHandlerSs], ss 509 lea ecx, [ebp + 3*4] ; two pushes, one error code. 510 mov [edi + BS3TRAPFRAME.uHandlerRsp], ecx 511 mov ecx, [ebp + 8] 512 mov [edi + BS3TRAPFRAME.uErrCd], ecx 513 514 ; 515 ; Copy the register state from the previous task segment. 516 ; 517 518 ; Find our TSS. 519 str ax 520 call bs3Trap32TssInAxToFlatInEax 521 522 ; Find the previous TSS. 523 mov ax, [eax + X86TSS32.selPrev] 524 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.tr], ax 525 call bs3Trap32TssInAxToFlatInEax 526 527 ; Do the copying. 528 mov ecx, [eax + X86TSS32.eax] 529 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], ecx 530 mov ecx, [eax + X86TSS32.ecx] 531 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], ecx 532 mov ecx, [eax + X86TSS32.edx] 533 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], ecx 534 mov ecx, [eax + X86TSS32.ebx] 535 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], ecx 536 mov ecx, [eax + X86TSS32.esp] 537 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], ecx 538 mov ecx, [eax + X86TSS32.ebp] 539 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], ecx 540 mov [ebp], ecx ; For better call stacks. 541 mov ecx, [eax + X86TSS32.esi] 542 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], ecx 543 mov ecx, [eax + X86TSS32.edi] 544 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], ecx 545 mov ecx, [eax + X86TSS32.esi] 546 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], ecx 547 mov ecx, [eax + X86TSS32.eflags] 548 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], ecx 549 mov ecx, [eax + X86TSS32.eip] 550 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.rip], ecx 551 mov [ebp + 4], ecx ; For better call stacks. 552 mov cx, [eax + X86TSS32.cs] 553 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx 554 mov cx, [eax + X86TSS32.ds] 555 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], cx 556 mov cx, [eax + X86TSS32.es] 557 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.es], cx 558 mov cx, [eax + X86TSS32.fs] 559 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], cx 560 mov cx, [eax + X86TSS32.gs] 561 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], cx 562 mov cx, [eax + X86TSS32.ss] 563 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 564 mov cx, [eax + X86TSS32.selLdt] ; Note! This isn't necessarily the ldtr at the time of the fault. 565 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr], cx 566 mov cx, [eax + X86TSS32.cr3] ; Note! This isn't necessarily the cr3 at the time of the fault. 567 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr3], ecx 568 569 ; 570 ; Set CPL; copy and update mode. 571 ; 572 mov cl, [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.ss] 573 and cl, 3 574 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], cl 575 576 mov cl, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 577 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], cl 578 and cl, ~BS3_MODE_CODE_MASK 579 or cl, BS3_MODE_CODE_32 580 mov [BS3_DATA16_WRT(g_bBs3CurrentMode)], cl 581 582 ; 583 ; Control registers. 584 ; 585 mov ecx, cr0 586 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], ecx 587 mov ecx, cr2 588 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr2], ecx 589 mov ecx, cr4 590 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], ecx 591 592 ; 593 ; Join code paths with the generic handler code. 594 ; 595 jmp bs3Trap32GenericCommon.dispatch_to_handler 596 BS3_PROC_END Bs3Trap32DoubleFaultHandler 597 320 BS3_PROC_END Bs3Trap64GenericCommon 321 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm
r60119 r60194 192 192 cmp sAX, sDX 193 193 je .skip_cr4 194 hlt 194 195 mov cr4, sAX 195 196 .skip_cr4: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap64Init.c
r60188 r60194 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3Trap 32Init3 * BS3Kit - Bs3Trap64Init 4 4 */ 5 5 … … 31 31 32 32 33 /********************************************************************************************************************************* 34 * Global Variables * 35 *********************************************************************************************************************************/ 36 extern uint32_t BS3_DATA_NM(g_Bs3Trap32DoubleFaultHandlerFlatAddr); 37 38 39 BS3_DECL(void) Bs3Trap32Init(void) 33 BS3_DECL(void) Bs3Trap64Init(void) 40 34 { 41 X86TSS 32BS3_FAR *pTss;35 X86TSS64 BS3_FAR *pTss; 42 36 unsigned iIdt; 43 37 44 38 /* 45 39 * IDT entries, except the system call gate. 40 * The #DF entry get IST=1, all others IST=0. 46 41 */ 47 42 for (iIdt = 0; iIdt < BS3_TRAP_SYSCALL; iIdt++) 48 Bs3Trap 32SetGate(iIdt, X86_SEL_TYPE_SYS_386_INT_GATE, 0 /*bDpl*/,49 BS3_SEL_R0_CS 32, BS3_DATA_NM(g_Bs3Trap32GenericEntriesFlatAddr) + iIdt * 8, 0 /*cParams*/);43 Bs3Trap64SetGate(iIdt, AMD64_SEL_TYPE_SYS_INT_GATE, 0 /*bDpl*/, 44 BS3_SEL_R0_CS64, BS3_DATA_NM(g_Bs3Trap64GenericEntriesFlatAddr) + iIdt * 8, iIdt == X86_XCPT_DF /*bIst*/); 50 45 for (iIdt = BS3_TRAP_SYSCALL + 1; iIdt < 256; iIdt++) 51 Bs3Trap 32SetGate(iIdt, X86_SEL_TYPE_SYS_386_INT_GATE, 0 /*bDpl*/,52 BS3_SEL_R0_CS 32, BS3_DATA_NM(g_Bs3Trap32GenericEntriesFlatAddr) + iIdt * 8, 0 /*cParams*/);46 Bs3Trap64SetGate(iIdt, AMD64_SEL_TYPE_SYS_INT_GATE, 0 /*bDpl*/, 47 BS3_SEL_R0_CS64, BS3_DATA_NM(g_Bs3Trap64GenericEntriesFlatAddr) + iIdt * 8, 0 /*bIst*/); 53 48 54 49 /* 55 50 * Initialize the normal TSS so we can do ring transitions via the IDT. 56 51 */ 57 pTss = &BS3_DATA_NM(Bs3Tss 32);52 pTss = &BS3_DATA_NM(Bs3Tss64); 58 53 Bs3MemZero(pTss, sizeof(*pTss)); 59 pTss->esp0 = BS3_ADDR_STACK_R0; 60 pTss->ss0 = BS3_SEL_R0_SS32; 61 pTss->esp1 = BS3_ADDR_STACK_R1; 62 pTss->ss1 = BS3_SEL_R1_SS32 | 1; 63 pTss->esp2 = BS3_ADDR_STACK_R2; 64 pTss->ss2 = BS3_SEL_R2_SS32 | 2; 65 66 /* 67 * Initialize the double fault TSS. 68 * cr3 is filled in by switcher code, when needed. 69 */ 70 pTss = &BS3_DATA_NM(Bs3Tss32DoubleFault); 71 Bs3MemZero(pTss, sizeof(*pTss)); 72 pTss->esp0 = BS3_ADDR_STACK_R0; 73 pTss->ss0 = BS3_SEL_R0_SS32; 74 pTss->esp1 = BS3_ADDR_STACK_R1; 75 pTss->ss1 = BS3_SEL_R1_SS32 | 1; 76 pTss->esp2 = BS3_ADDR_STACK_R2; 77 pTss->ss2 = BS3_SEL_R2_SS32 | 2; 78 pTss->eip = BS3_DATA_NM(g_Bs3Trap32DoubleFaultHandlerFlatAddr); 79 pTss->eflags = X86_EFL_1; 80 pTss->esp = BS3_ADDR_STACK_R0_IST1; 81 pTss->es = BS3_SEL_R0_DS32; 82 pTss->ds = BS3_SEL_R0_DS32; 83 pTss->cs = BS3_SEL_R0_CS32; 84 pTss->ss = BS3_SEL_R0_SS32; 85 86 Bs3Trap32SetGate(X86_XCPT_DF, X86_SEL_TYPE_SYS_TASK_GATE, 0 /*bDpl*/, BS3_SEL_TSS32_DF, 0, 0 /*cParams*/); 54 pTss->rsp0 = BS3_ADDR_STACK_R0; 55 pTss->rsp1 = BS3_ADDR_STACK_R1; 56 pTss->rsp2 = BS3_ADDR_STACK_R2; 57 pTss->ist1 = BS3_ADDR_STACK_R0_IST1; 58 pTss->ist2 = BS3_ADDR_STACK_R0_IST2; 59 pTss->ist3 = BS3_ADDR_STACK_R0_IST3; 60 pTss->ist4 = BS3_ADDR_STACK_R0_IST4; 61 pTss->ist5 = BS3_ADDR_STACK_R0_IST5; 62 pTss->ist6 = BS3_ADDR_STACK_R0_IST6; 63 pTss->ist7 = BS3_ADDR_STACK_R0_IST7; 87 64 } 88 65 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapSetJmp.asm
r60097 r60194 93 93 %else 94 94 mov xDI, [xBP + xCB*2] 95 mov cx, BS3TRAPFRAME_size / 495 mov ecx, BS3TRAPFRAME_size / 4 96 96 mov xAX, 0feedfaceh 97 97 rep stosd -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapSystemCallHandler.asm
r60019 r60194 90 90 mov xBP, xSP 91 91 %if TMPL_BITS == 64 92 push 0 ; dummy DS entry 92 push 0 93 mov [rsp+2], es 94 mov [rsp], ds 93 95 %else 94 96 push ds … … 330 332 iret 331 333 %else 332 leave ; skips fake ds 334 mov es, [rsp+2] 335 mov ds, [rsp] 336 leave ; skips ds 333 337 iretq 334 338 %endif -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
r60024 r60194 37 37 Bs3CpuDetect_rm(); 38 38 Bs3InitMemory_rm(); 39 //if (BS3_DATA_NM(g_uBs3CpuDetected) & BS3CPU_F_LONG_MODE)40 //Bs3Trap64Init();39 if (BS3_DATA_NM(g_uBs3CpuDetected) & BS3CPU_F_LONG_MODE) 40 Bs3Trap64Init(); 41 41 if ((BS3_DATA_NM(g_uBs3CpuDetected) & BS3CPU_TYPE_MASK) >= BS3CPU_80386) 42 42 Bs3Trap32Init(); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60184 r60194 43 43 * implemented in C and functions that does not have parameters. 44 44 */ 45 #define BS3_KIT_WITH_NO_RETURN 45 46 #ifndef BS3_KIT_WITH_NO_RETURN 46 47 # undef DECL_NO_RETURN … … 1870 1871 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c64(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */ 1871 1872 #define Bs3RegCtxRestore BS3_CMN_NM(Bs3RegCtxRestore) /**< Selects #Bs3RegCtxRestore_c16, #Bs3RegCtxRestore_c32 or #Bs3RegCtxRestore_c64. */ 1872 #if /*!defined(BS3_KIT_WITH_NO_RETURN) &&*/defined(__WATCOMC__)1873 #if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__) 1873 1874 # pragma aux Bs3RegCtxRestore_c16 "_Bs3RegCtxRestore_aborts_c16" __aborts 1874 1875 # pragma aux Bs3RegCtxRestore_c32 "_Bs3RegCtxRestore_aborts_c32" __aborts … … 1899 1900 uint8_t cbIretFrame; 1900 1901 /** 0x02: The handler CS. */ 1901 uint16_t uHandlerC c;1902 uint16_t uHandlerCs; 1902 1903 /** 0x04: The handler SS. */ 1903 1904 uint16_t uHandlerSs; … … 2481 2482 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_ppv86) a_Parameters; \ 2482 2483 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16) a_Parameters; \ 2483 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_ 16) a_Parameters; \2484 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_32) a_Parameters; \ 2484 2485 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_v86)a_Parameters; \ 2485 2486 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32) a_Parameters; \ … … 2561 2562 extern uint16_t BS3_DATA_NM(g_uBs3CpuDetected); 2562 2563 2564 /** 2565 * Initializes trap handling for the current system. 2566 * 2567 * Calls the appropriate Bs3Trap16Init, Bs3Trap32Init or Bs3Trap64Init function. 2568 */ 2569 BS3_MODE_EXPAND_PROTOTYPES(void, Bs3TrapInit,(void)); 2563 2570 2564 2571 /** … … 2570 2577 BS3_MODE_EXPAND_PROTOTYPES(void, Bs3TestDoModes, (PCBS3TESTMODEENTRY paEntries, size_t cEntries)); 2571 2578 2579 2572 2580 /** @} */ 2573 2581
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器