MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_segsize

Function db_segsize

freebsd/i386/i386/db_interface.c:88–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88int
89db_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
112void
113db_show_mdpcpu(struct pcpu *pc)

Callers 2

db_backtraceFunction · 0.85
db_disasmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected