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

Function vm86_trap

freebsd/i386/i386/vm86.c:679–698  ·  view source on GitHub ↗

* vm86 trap handler; determines whether routine succeeded or not. * Called while in vm86 space, returns to calling process. */

Source from the content-addressed store, hash-verified

677 * Called while in vm86 space, returns to calling process.
678 */
679void
680vm86_trap(struct vm86frame *vmf)
681{
682 void (*p)(struct vm86frame *);
683 caddr_t addr;
684
685 /* "should not happen" */
686 if ((vmf->vmf_eflags & PSL_VM) == 0)
687 panic("vm86_trap called, but not in vm86 mode");
688
689 addr = MAKE_ADDR(vmf->vmf_cs, vmf->vmf_ip);
690 if (*(u_char *)addr == HLT)
691 vmf->vmf_trapno = vmf->vmf_eflags & PSL_C;
692 else
693 vmf->vmf_trapno = vmf->vmf_trapno << 16;
694
695 p = (void (*)(struct vm86frame *))((uintptr_t)vm86_biosret +
696 setidt_disp);
697 p(vmf);
698}
699
700int
701vm86_intcall(int intnum, struct vm86frame *vmf)

Callers 1

trapFunction · 0.85

Calls 2

MAKE_ADDRFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected