Changeset 59976 in vbox
- Timestamp:
- Mar 10, 2016 12:53:55 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r59975 r59976 84 84 bs3-cmn-RegCtxRestore.asm \ 85 85 bs3-cmn-RegCtxConvertToRingX.c \ 86 bs3-cmn-RegCtxPrint.c \ 86 87 bs3-cmn-SelProtFar32ToFlat32.c \ 87 88 bs3-cmn-SlabInit.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c32-Trap32Generic.asm
r59975 r59976 238 238 mov ecx, [ebp + 12] 239 239 mov [esp + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], ecx 240 mov c l, [ebp + 8]240 mov cx, [ebp + 8] 241 241 mov [esp + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx 242 242 test dword [ebp + 12], X86_EFL_VM … … 269 269 mov byte [esp + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], 3 270 270 or byte [esp + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], BS3_MODE_CODE_V86 ; paranoia ^ 2 271 lea ecx, [ebp + 12]271 movzx ecx, word [ebp + 16] 272 272 mov [esp + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], ecx 273 273 mov cx, [ebp + 20] -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxConvertToRingX.c
r59975 r59976 38 38 * @param bRing The target ring. 39 39 */ 40 staticuint16_t bs3RegCtxConvertRealSegToRingX(uint16_t uSeg, uint8_t bRing)40 uint16_t bs3RegCtxConvertRealSegToRingX(uint16_t uSeg, uint8_t bRing) 41 41 { 42 42 uint16_t uSel; 43 if (uSeg == 0) 43 if ( uSeg == 0 44 || uSeg == BS3_SEL_R0_SS16) 44 45 uSel = BS3_SEL_R0_SS16 + ((uint16_t)bRing << BS3_SEL_RING_SHIFT); 45 else if (uSeg == (BS3_ADDR_BS3TEXT16 >> 4)) 46 else if ( uSeg == (BS3_ADDR_BS3TEXT16 >> 4) 47 || uSeg == BS3_SEL_R0_CS16) 46 48 uSel = BS3_SEL_R0_CS16 + ((uint16_t)bRing << BS3_SEL_RING_SHIFT); 47 else if (uSeg == (BS3_ADDR_BS3DATA16 >> 4)) 49 else if ( uSeg == (BS3_ADDR_BS3DATA16 >> 4) 50 || uSeg == BS3_SEL_R0_DS16) 48 51 uSel = BS3_SEL_R0_DS16 + ((uint16_t)bRing << BS3_SEL_RING_SHIFT); 49 52 else if (uSeg == (BS3_ADDR_BS3SYSTEM16 >> 4)) … … 51 54 else if (!(uSeg & 0xfff)) 52 55 uSel = (uSeg >> (12 - X86_SEL_SHIFT)) + BS3_SEL_TILED; 56 else if (uSeg == BS3_SEL_R0_DS16) 57 uSel = (uSeg >> (12 - X86_SEL_SHIFT)) + BS3_SEL_TILED; 53 58 else 54 59 { 60 Bs3Printf("uSeg=%#x\n", uSeg); 55 61 BS3_ASSERT(0); 56 62 return 0; … … 68 74 * @param bRing The target ring. 69 75 */ 70 staticuint16_t bs3RegCtxConvertProtSelToRingX(uint16_t uSel, uint8_t bRing)76 uint16_t bs3RegCtxConvertProtSelToRingX(uint16_t uSel, uint8_t bRing) 71 77 { 72 78 if ( uSel > X86_SEL_RPL … … 110 116 || pRegCtx->bMode == BS3_MODE_RM) 111 117 { 118 pRegCtx->rflags.u32 &= ~X86_EFL_VM; 119 pRegCtx->bMode &= ~BS3_MODE_CODE_MASK; 120 pRegCtx->bMode |= BS3_MODE_CODE_16; 112 121 pRegCtx->cs = bs3RegCtxConvertRealSegToRingX(pRegCtx->cs, bRing); 113 122 pRegCtx->ss = bs3RegCtxConvertRealSegToRingX(pRegCtx->ss, bRing); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm
r59975 r59976 89 89 ; Check what the CPU can do. 90 90 ; 91 cmp byte [es: g_uBs3CpuDetected], BS3CPU_8038691 cmp byte [es:BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80386 92 92 jae .restore_full 93 93 94 94 ; Do the 80286 specifics first. 95 cmp byte [es: g_uBs3CpuDetected], BS3CPU_8028695 cmp byte [es:BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80286 96 96 jb .restore_16_bit_ancient 97 97 98 98 lmsw [bx + BS3REGCTX.cr0] 99 cmp byte [es: g_bBs3CurrentMode], BS3_MODE_RM99 cmp byte [es:BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 100 100 je .restore_16_bit_ancient 101 101 lldt [bx + BS3REGCTX.ldtr] … … 110 110 ; Do the return frame and final registers (keep short as we're not quite 111 111 ; NMI safe here if pRegCtx is on the stack). 112 cmp byte [es: g_bBs3CurrentMode], BS3_MODE_RM112 cmp byte [es:BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 113 113 mov di, [bx + BS3REGCTX.rsp] 114 114 je .restore_16_bit_same_privilege … … 132 132 mov es, [bx + BS3REGCTX.es] 133 133 mov ax, [bx + BS3REGCTX.rbx] 134 mov bp, [bx + BS3REGCTX.rbp] ; restore late for better stacks.134 mov bp, [bx + BS3REGCTX.rbp] ; restore late for better stacks. 135 135 mov bx, [bx + BS3REGCTX.rbx] 136 136 … … 139 139 140 140 .restore_16_bit_same_privilege: 141 sub di, 2* 4; iret frame + pop ds141 sub di, 2*5 ; iret frame + pop ds 142 142 mov [bx + BS3REGCTX.rsp], di 143 mov es, [bx + BS3REGCTX.ss] ; ES is target stack segment.143 mov es, [bx + BS3REGCTX.ss] ; ES is target stack segment. 144 144 cld 145 145 146 146 mov ax, [bx + BS3REGCTX.ds] 147 stosw 148 mov ax, [bx + BS3REGCTX.rbp] 147 149 stosw 148 150 mov ax, [bx + BS3REGCTX.rip] … … 156 158 mov es, [bx + BS3REGCTX.es] 157 159 mov ax, [bx + BS3REGCTX.rbx] 158 mov bp, [bx + BS3REGCTX.rbp] ; restore late for better stacks.159 160 mov ss, [bx + BS3REGCTX.ss] 160 mov sp, [bx + BS3REGCTX.rsp] ; adjusted, see above.161 mov sp, [bx + BS3REGCTX.rsp] ; adjusted, see above. 161 162 mov bx, [bx + BS3REGCTX.rbx] 162 163 163 164 pop ds 165 pop bp 164 166 iret 165 167 %endif … … 210 212 %if TMPL_BITS != 64 211 213 ; We cannot restore ldtr and tr if we're in real-mode. 212 cmp byte [ es:g_bBs3CurrentMode], BS3_MODE_RM214 cmp byte [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 213 215 je .skip_control_regs 214 216 %endif … … 287 289 ; 32-bit/16-bit is more complicated as we have three different iret frames. 288 290 ; 289 cmp byte [ es:g_bBs3CurrentMode], BS3_MODE_RM291 cmp byte [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM 290 292 je .iretd_same_cpl_rm 291 293 … … 354 356 .es_edi_is_pointing_to_return_frame_location: 355 357 cld 358 mov ax, [xBX + BS3REGCTX.ds] 359 o32 stosd 356 360 mov eax, [xBX + BS3REGCTX.rbp] ; Restore esp as late as possible for better stacks. 357 o32 stosd358 mov ax, [xBX + BS3REGCTX.ds]359 361 o32 stosd 360 362 mov eax, [xBX + BS3REGCTX.rip] -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing0.asm
r59949 r59976 54 54 je .return 55 55 56 ; If V8086 mode: Have to make the system call (v8086 mode is ring-3).56 ; If V8086 mode: Always do syscall and add a lock prefix to make sure it gets to the VMM. 57 57 and al, BS3_MODE_CODE_MASK 58 58 cmp al, BS3_MODE_CODE_V86 59 je .just_do_it 59 jne .not_v8086 60 61 mov xAX, BS3_SYSCALL_TO_RING0 62 lock int BS3_TRAP_SYSCALL 63 jmp .return 64 65 .not_v8086: 60 66 %endif 61 67 … … 65 71 jz .return 66 72 67 .just_do_it:68 73 mov xAX, BS3_SYSCALL_TO_RING0 69 74 int BS3_TRAP_SYSCALL -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapDefaultHandler.c
r59975 r59976 31 31 32 32 33 #if TMPL_BITS != 64 34 static void bs3TrapDefaultHandlerV8086Syscall(PBS3TRAPFRAME pTrapFrame) 35 { 36 /* Minimal syscall. */ 37 if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_PRINT_CHR) 38 Bs3PrintChr(pTrapFrame->Ctx.rax.u8); 39 else if ( pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING0 40 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING1 41 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING2 42 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING3) 43 { 44 Bs3RegCtxConvertToRingX(&pTrapFrame->Ctx, pTrapFrame->Ctx.rax.u16 - BS3_SYSCALL_TO_RING0); 45 } 46 else 47 Bs3Panic(); 48 } 49 #endif 50 33 51 BS3_DECL(void) Bs3TrapDefaultHandler(PBS3TRAPFRAME pTrapFrame) 34 52 { 35 53 #if TMPL_BITS != 64 36 54 /* 37 * Deal with GPs in V8086 mode.55 * v8086 VMM tasks. 38 56 */ 39 Bs3Printf("bXcpt=%#x\n", pTrapFrame->bXcpt); 40 Bs3Printf("bXcpt=%#x\n", pTrapFrame->bXcpt); 41 Bs3Printf("eflags=%#RX32 (%d)\n", pTrapFrame->Ctx.rflags.u32, RT_BOOL(pTrapFrame->Ctx.rflags.u32 & X86_EFL_VM)); 42 Bs3Printf("cs=%#x\n", pTrapFrame->Ctx.cs); 43 for (;;) { } 44 if ( pTrapFrame->bXcpt == X86_XCPT_GP 45 && (pTrapFrame->Ctx.rflags.u32 & X86_EFL_VM) 46 && pTrapFrame->Ctx.cs == BS3_SEL_TEXT16) 57 if (pTrapFrame->Ctx.rflags.u32 & X86_EFL_VM) 47 58 { 48 59 bool fHandled = true; … … 52 63 uint8_t const BS3_FAR *pbCode; 53 64 uint16_t BS3_FAR *pusStack; 54 for (;;) { }55 65 56 66 pusStack = (uint16_t BS3_FAR *)BS3_MAKE_PROT_R0PTR_FROM_REAL(pTrapFrame->Ctx.ss, pTrapFrame->Ctx.rsp.u16); … … 58 68 pbCodeStart = pbCode; 59 69 60 bOpCode = *++pbCode; 61 if (bOpCode == 0x66) 70 /* 71 * Deal with GPs in V8086 mode. 72 */ 73 if (pTrapFrame->bXcpt == X86_XCPT_GP) 62 74 { 63 cBitsOpcode = 32; 64 bOpCode = *++pbCode; 65 } 75 bOpCode = *pbCode++; 76 if (bOpCode == 0x66) 77 { 78 cBitsOpcode = 32; 79 bOpCode = *pbCode++; 80 } 66 81 67 /* INT xx: Real mode behaviour, but intercepting and implementing most of our syscall interface. */ 68 if (bOpCode == 0xcd) 69 { 70 uint8_t bVector = *++pbCode; 71 if (bVector == BS3_TRAP_SYSCALL) 82 /* INT xx: Real mode behaviour, but intercepting and implementing most of our syscall interface. */ 83 if (bOpCode == 0xcd) 72 84 { 73 /* Minimal syscall. */ 74 if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_PRINT_CHR) 75 Bs3PrintChr(pTrapFrame->Ctx.rax.u8); 76 else if ( pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING0 77 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING1 78 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING2 79 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING3) 85 uint8_t bVector = *pbCode++; 86 if (bVector == BS3_TRAP_SYSCALL) 87 bs3TrapDefaultHandlerV8086Syscall(pTrapFrame); 88 else 80 89 { 81 Bs3RegCtxConvertToRingX(&pTrapFrame->Ctx, pTrapFrame->Ctx.rax.u16 - BS3_SYSCALL_TO_RING0); 82 for (;;) { } 90 /* Real mode behaviour. */ 91 uint16_t BS3_FAR *pusIvte = (uint16_t BS3_FAR *)BS3_MAKE_PROT_R0PTR_FROM_REAL(0, 0); 92 pusIvte += (uint16_t)bVector *2; 93 94 pusStack[0] = pTrapFrame->Ctx.rflags.u16; 95 pusStack[1] = pTrapFrame->Ctx.cs; 96 pusStack[2] = pTrapFrame->Ctx.rip.u16 + (uint16_t)(pbCode - pbCodeStart); 97 98 pTrapFrame->Ctx.rip.u16 = pusIvte[0]; 99 pTrapFrame->Ctx.cs = pusIvte[1]; 100 pTrapFrame->Ctx.rflags.u16 &= ~X86_EFL_IF; /** @todo this isn't all, but it'll do for now, I hope. */ 101 Bs3RegCtxRestore(&pTrapFrame->Ctx, 0/*fFlags*/); /* does not return. */ 102 } 103 } 104 /* PUSHF: Real mode behaviour. */ 105 else if (bOpCode == 0x9c) 106 { 107 if (cBitsOpcode == 32) 108 *pusStack++ = pTrapFrame->Ctx.rflags.au16[1] & ~(X86_EFL_VM | X86_EFL_RF); 109 *pusStack++ = pTrapFrame->Ctx.rflags.u16; 110 pTrapFrame->Ctx.rsp.u16 += cBitsOpcode / 8; 111 } 112 /* POPF: Real mode behaviour. */ 113 else if (bOpCode == 0x9d) 114 { 115 if (cBitsOpcode == 32) 116 { 117 pTrapFrame->Ctx.rflags.u32 &= ~X86_EFL_POPF_BITS; 118 pTrapFrame->Ctx.rflags.u32 |= X86_EFL_POPF_BITS & *(uint32_t const *)pusStack; 83 119 } 84 120 else 85 Bs3Panic(); 121 { 122 pTrapFrame->Ctx.rflags.u32 &= ~(X86_EFL_POPF_BITS | UINT32_C(0xffff0000)) & ~X86_EFL_RF; 123 pTrapFrame->Ctx.rflags.u16 |= (uint16_t)X86_EFL_POPF_BITS & *pusStack; 124 } 125 pTrapFrame->Ctx.rsp.u16 -= cBitsOpcode / 8; 86 126 } 127 /* CLI: Real mode behaviour. */ 128 else if (bOpCode == 0xfa) 129 pTrapFrame->Ctx.rflags.u16 &= ~X86_EFL_IF; 130 /* STI: Real mode behaviour. */ 131 else if (bOpCode == 0xfb) 132 pTrapFrame->Ctx.rflags.u16 |= X86_EFL_IF; 133 /* Unexpected. */ 87 134 else 88 { 89 /* Real mode behaviour. */ 90 uint16_t BS3_FAR *pusIvte = (uint16_t BS3_FAR *)BS3_MAKE_PROT_R0PTR_FROM_REAL(0, 0); 91 pusIvte += (uint16_t)bVector *2; 92 93 pusStack[0] = pTrapFrame->Ctx.rflags.u16; 94 pusStack[1] = pTrapFrame->Ctx.cs; 95 pusStack[2] = pTrapFrame->Ctx.rip.u16 + (uint16_t)(pbCode - pbCodeStart); 96 97 pTrapFrame->Ctx.rip.u16 = pusIvte[0]; 98 pTrapFrame->Ctx.cs = pusIvte[1]; 99 pTrapFrame->Ctx.rflags.u16 &= ~X86_EFL_IF; /** @todo this isn't all, but it'll do for now, I hope. */ 100 Bs3RegCtxRestore(&pTrapFrame->Ctx, 0/*fFlags*/); /* does not return. */ 101 } 135 fHandled = false; 102 136 } 103 /* PUSHF: Real mode behaviour. */ 104 else if (bOpCode == 0x9c) 137 /* 138 * Deal with lock prefixed int xxh syscall in v8086 mode. 139 */ 140 else if ( pTrapFrame->bXcpt == X86_XCPT_UD 141 && pbCode[0] == 0xf0 142 && pbCode[1] == 0xcd 143 && pbCode[2] == BS3_TRAP_SYSCALL 144 && pTrapFrame->Ctx.cs == BS3_SEL_TEXT16) 105 145 { 106 if (cBitsOpcode == 32) 107 *pusStack++ = pTrapFrame->Ctx.rflags.au16[1] & ~(X86_EFL_VM | X86_EFL_RF); 108 *pusStack++ = pTrapFrame->Ctx.rflags.u16; 109 pTrapFrame->Ctx.rsp.u16 += cBitsOpcode / 8; 146 pbCode += 3; 147 bs3TrapDefaultHandlerV8086Syscall(pTrapFrame); 110 148 } 111 /* POPF: Real mode behaviour. */112 else if (bOpCode == 0x9d)113 {114 if (cBitsOpcode == 32)115 {116 pTrapFrame->Ctx.rflags.u32 &= ~X86_EFL_POPF_BITS;117 pTrapFrame->Ctx.rflags.u32 |= X86_EFL_POPF_BITS & *(uint32_t const *)pusStack;118 }119 else120 {121 pTrapFrame->Ctx.rflags.u32 &= ~(X86_EFL_POPF_BITS | UINT32_C(0xffff0000)) & ~X86_EFL_RF;122 pTrapFrame->Ctx.rflags.u16 |= (uint16_t)X86_EFL_POPF_BITS & *pusStack;123 }124 pTrapFrame->Ctx.rsp.u16 -= cBitsOpcode / 8;125 }126 /* CLI: Real mode behaviour. */127 else if (bOpCode == 0xfa)128 pTrapFrame->Ctx.rflags.u16 &= ~X86_EFL_IF;129 /* STI: Real mode behaviour. */130 else if (bOpCode == 0xfb)131 pTrapFrame->Ctx.rflags.u16 |= X86_EFL_IF;132 /* Unexpected. */133 149 else 134 150 fHandled = false; 135 for (;;) { }136 151 if (fHandled) 137 152 { 138 153 pTrapFrame->Ctx.rip.u16 += (uint16_t)(pbCode - pbCodeStart); 154 Bs3Printf("Calling Bs3RegCtxRestore\n"); 155 Bs3RegCtxPrint(&pTrapFrame->Ctx); 139 156 Bs3RegCtxRestore(&pTrapFrame->Ctx, 0 /*fFlags*/); /* does not return. */ 140 157 return; 141 158 } 142 159 } 143 144 160 #endif 145 161 162 /* 163 * Fatal. 164 */ 146 165 Bs3TrapPrintFrame(pTrapFrame); 147 166 Bs3Panic(); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapPrintFrame.c
r59975 r59976 39 39 pTrapFrame->Ctx.cs, 40 40 pTrapFrame->Ctx.rip.u64); 41 Bs3RegCtxPrint(&pTrapFrame->Ctx); 41 42 } 42 43 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r59975 r59976 171 171 BS3_DECL(void) TMPL_NM(Bs3TestDoModes)(PCBS3TESTMODEENTRY paEntries, size_t cEntries) 172 172 { 173 bool const fDoV86Mode = false; 173 bool const fDoV86Modes = true; 174 bool const fDoWeirdV86Modes = false; 174 175 uint16_t const uCpuDetected = BS3_DATA_NM(g_uBs3CpuDetected); 175 176 uint8_t const bCpuType = uCpuDetected & BS3CPU_TYPE_MASK; … … 221 222 } 222 223 223 if (paEntries[i].pfnDoPE16_V86 && fDo V86Mode)224 if (paEntries[i].pfnDoPE16_V86 && fDoWeirdV86Modes) 224 225 { 225 226 bErrNo = TMPL_NM(Bs3TestCallDoerInPE16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE16_V86)); … … 242 243 } 243 244 244 if (paEntries[i].pfnDoPEV86 && fDoV86Mode )245 if (paEntries[i].pfnDoPEV86 && fDoV86Modes) 245 246 { 246 247 bErrNo = TMPL_NM(Bs3TestCallDoerInPEV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPEV86)); … … 266 267 } 267 268 268 if (paEntries[i].pfnDoPP16_V86 && fDo V86Mode)269 if (paEntries[i].pfnDoPP16_V86 && fDoWeirdV86Modes) 269 270 { 270 271 bErrNo = TMPL_NM(Bs3TestCallDoerInPP16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP16_V86)); … … 287 288 } 288 289 289 if (paEntries[i].pfnDoPPV86 && fDoV86Mode )290 if (paEntries[i].pfnDoPPV86 && fDoV86Modes) 290 291 { 291 292 bErrNo = TMPL_NM(Bs3TestCallDoerInPPV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPPV86)); … … 314 315 } 315 316 316 if (paEntries[i].pfnDoPAE16_V86 && fDo V86Mode)317 if (paEntries[i].pfnDoPAE16_V86 && fDoWeirdV86Modes) 317 318 { 318 319 bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE16_V86)); … … 335 336 } 336 337 337 if (paEntries[i].pfnDoPAEV86 /*&& fDoV86Mode*/)338 if (paEntries[i].pfnDoPAEV86 && fDoV86Modes) 338 339 { 339 340 bErrNo = TMPL_NM(Bs3TestCallDoerInPAEV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAEV86)); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r59975 r59976 430 430 # define BS3_MAKE_PROT_R0PTR_FROM_REAL(a_uSeg, a_off) BS3_FP_MAKE(((a_uSeg) << 3) + BS3_SEL_TILED, a_off) 431 431 #else 432 # define BS3_MAKE_PROT_R0PTR_FROM_REAL(a_uSeg, a_off) ( (void *)(uintptr_t)(((uint32_t)(a_uSeg) << 16) |(uint16_t)(a_off)) )432 # define BS3_MAKE_PROT_R0PTR_FROM_REAL(a_uSeg, a_off) ( (void *)(uintptr_t)(((uint32_t)(a_uSeg) << 4) + (uint16_t)(a_off)) ) 433 433 #endif 434 434 … … 2030 2030 #define BS3REGCTXRESTORE_F_SKIP_CRX UINT16_C(0x0001) 2031 2031 2032 /** 2033 * Prints the register context. 2034 * 2035 * @param pRegCtx The register context to be printed. 2036 */ 2037 BS3_DECL(void) Bs3RegCtxPrint_c16(PCBS3REGCTX pRegCtx); 2038 BS3_DECL(void) Bs3RegCtxPrint_c32(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxPrint_c16 */ 2039 BS3_DECL(void) Bs3RegCtxPrint_c64(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxPrint_c16 */ 2040 #define Bs3RegCtxPrint BS3_CMN_NM(Bs3RegCtxPrint) /**< Selects #Bs3RegCtxPrint_c16, #Bs3RegCtxPrint_c32 or #Bs3RegCtxPrint_c64. */ 2041 2032 2042 2033 2043 /** … … 2036 2046 typedef struct BS3TRAPFRAME 2037 2047 { 2038 /** Exception/interrupt number. */2048 /** 0x00: Exception/interrupt number. */ 2039 2049 uint8_t bXcpt; 2040 /** Explicit alignment. */2050 /** 0x01: Explicit alignment. */ 2041 2051 uint8_t bAlignment; 2042 /** The handler CS. */2052 /** 0x02: The handler CS. */ 2043 2053 uint16_t uHandlerCc; 2044 /** The handler SS. */2054 /** 0x04: The handler SS. */ 2045 2055 uint16_t uHandlerSs; 2046 /** Explicit alignment. */2056 /** 0x06: Explicit alignment. */ 2047 2057 uint16_t usAlignment; 2048 /** The handler RSP (top of iret frame). */2058 /** 0x08: The handler RSP (top of iret frame). */ 2049 2059 uint64_t uHandlerRsp; 2050 /** The handler RFLAGS value. */2060 /** 0x10: The handler RFLAGS value. */ 2051 2061 uint64_t fHandlerRfl; 2052 /** The error code (if applicable). */2062 /** 0x18: The error code (if applicable). */ 2053 2063 uint64_t uErrCd; 2054 /** The register context. */2064 /** 0x20: The register context. */ 2055 2065 BS3REGCTX Ctx; 2056 2066 } BS3TRAPFRAME; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r59975 r59976 950 950 %define BS3_MODE_R0_NM_022h(a_Name) _ %+ a_Name %+ _pe32 951 951 %define BS3_MODE_R0_NM_021h(a_Name) _ %+ a_Name %+ _pe32_16 952 %define BS3_MODE_R0_NM_023h(a_Name) _ %+ a_Name %+ _pe32 952 %define BS3_MODE_R0_NM_023h(a_Name) _ %+ a_Name %+ _pe32_16 953 953 %define BS3_MODE_R0_NM_031h(a_Name) _ %+ a_Name %+ _pp16 954 954 %define BS3_MODE_R0_NM_032h(a_Name) _ %+ a_Name %+ _pp16_32 … … 956 956 %define BS3_MODE_R0_NM_042h(a_Name) _ %+ a_Name %+ _pp32 957 957 %define BS3_MODE_R0_NM_041h(a_Name) _ %+ a_Name %+ _pp32_16 958 %define BS3_MODE_R0_NM_043h(a_Name) _ %+ a_Name %+ _pp32 958 %define BS3_MODE_R0_NM_043h(a_Name) _ %+ a_Name %+ _pp32_16 959 959 %define BS3_MODE_R0_NM_051h(a_Name) _ %+ a_Name %+ _pae16 960 960 %define BS3_MODE_R0_NM_052h(a_Name) _ %+ a_Name %+ _pae16_32 … … 962 962 %define BS3_MODE_R0_NM_062h(a_Name) _ %+ a_Name %+ _pae32 963 963 %define BS3_MODE_R0_NM_061h(a_Name) _ %+ a_Name %+ _pae32_16 964 %define BS3_MODE_R0_NM_063h(a_Name) _ %+ a_Name %+ _pae32 964 %define BS3_MODE_R0_NM_063h(a_Name) _ %+ a_Name %+ _pae32_16 965 965 %define BS3_MODE_R0_NM_071h(a_Name) _ %+ a_Name %+ _lm16 966 966 %define BS3_MODE_R0_NM_072h(a_Name) _ %+ a_Name %+ _lm32
Note:
See TracChangeset
for help on using the changeset viewer.