6 /* #define DEBUG_INT */
20 typedef ACCESS
*LPACCESS
;
29 typedef DESCRIPTOR
*LPDESCRIPTOR
;
31 HANDLE
DPMI_GetNewSelector(WORD selcount
);
32 BOOL
DPMI_FreeSelector(HANDLE pmSel
);
33 BOOL
DPMI_SetDescriptor(HANDLE pmSel
, LPDESCRIPTOR lpDesc
);
35 /*************************************************************************/
37 int do_int31(struct sigcontext_struct
*context
)
40 dprintf_int(stddeb
,"do_int31 // context->sc_eax=%04X\n",
42 switch(context
->sc_eax
)
45 context
->sc_eax
= DPMI_GetNewSelector(context
->sc_ecx
);
48 context
->sc_eax
= DPMI_FreeSelector(context
->sc_ebx
);
51 lpDesc
= MAKELONG(context
->sc_edi
, context
->sc_es
);
52 context
->sc_eax
= DPMI_SetDescriptor(context
->sc_ebx
, lpDesc
);
55 IntBarf(0x31, context
);
61 /*************************************************************************/
64 HANDLE
DPMI_GetNewSelector(WORD selcount
)
68 dprintf_int(stddeb
,"DPMI_GetNewSelector(%d); !\n", selcount
);
69 pmSel
= GlobalAlloc(GMEM_FIXED
, 4096);
70 ptr
= GlobalLock(pmSel
);
71 dprintf_int(stddeb
,"DPMI_GetNewSelector() return %04X !\n", pmSel
);
76 BOOL
DPMI_FreeSelector(HANDLE pmSel
)
78 dprintf_int(stddeb
,"DPMI_FreeSelector(%04X); !\n", pmSel
);
83 BOOL
DPMI_SetDescriptor(HANDLE pmSel
, LPDESCRIPTOR lpDesc
)
85 dprintf_int(stdnimp
,"DPMI_SetDescriptor(%04X, %08X); !\n",
87 dprintf_int(stdnimp
,"DPMI lpDesc->Limit=%u \n", lpDesc
->Limit
);
88 dprintf_int(stdnimp
,"DPMI lpDesc->addr_lo=%04X \n", lpDesc
->addr_lo
);
89 dprintf_int(stdnimp
,"DPMI lpDesc->addr_hi=%02X \n", lpDesc
->addr_hi
);
90 dprintf_int(stdnimp
,"DPMI lpDesc->access.accessed=%u \n",
91 lpDesc
->access
.accessed
);
92 dprintf_int(stdnimp
,"DPMI lpDesc->access.read_write=%u \n",
93 lpDesc
->access
.read_write
);
94 dprintf_int(stdnimp
,"DPMI lpDesc->access.conf_exp=%u \n",
95 lpDesc
->access
.conf_exp
);
96 dprintf_int(stdnimp
,"DPMI lpDesc->access.code=%u \n",
98 dprintf_int(stdnimp
,"DPMI lpDesc->access.xsystem=%u \n",
99 lpDesc
->access
.xsystem
);
100 dprintf_int(stdnimp
,"DPMI lpDesc->access.dpl=%u \n",
102 dprintf_int(stdnimp
,"DPMI lpDesc->access.present=%u \n",
103 lpDesc
->access
.present
);
104 dprintf_int(stdnimp
,"DPMI lpDesc->reserved=%04X \n", lpDesc
->reserved
);