| 86 | } |
| 87 | |
| 88 | int |
| 89 | db_segsize(struct trapframe *tfp) |
| 90 | { |
| 91 | struct proc_ldt *plp; |
| 92 | struct segment_descriptor *sdp; |
| 93 | int sel; |
| 94 | |
| 95 | if (tfp == NULL) |
| 96 | return (32); |
| 97 | if (tfp->tf_eflags & PSL_VM) |
| 98 | return (16); |
| 99 | sel = tfp->tf_cs & 0xffff; |
| 100 | if (sel == GSEL(GCODE_SEL, SEL_KPL)) |
| 101 | return (32); |
| 102 | /* Rare cases follow. User mode cases are currently unreachable. */ |
| 103 | if (ISLDT(sel)) { |
| 104 | plp = curthread->td_proc->p_md.md_ldt; |
| 105 | sdp = (plp != NULL) ? &plp->ldt_sd : &ldt[0].sd; |
| 106 | } else { |
| 107 | sdp = &gdt[PCPU_GET(cpuid) * NGDT].sd; |
| 108 | } |
| 109 | return (sdp[IDXSEL(sel)].sd_def32 == 0 ? 16 : 32); |
| 110 | } |
| 111 | |
| 112 | void |
| 113 | db_show_mdpcpu(struct pcpu *pc) |
no outgoing calls
no test coverage detected