| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <dpmi.h> int _go32_dpmi_allocate_iret_wrapper(_go32_dpmi_seginfo *info); |
See section DPMI Overview.
This function creates a small assembler function that handles the
overhead of servicing an interrupt. To use, put the address of your
servicing function in the pm_offset field of info and call
this function. The pm_field will get replaced with the address
of the wrapper function, which you pass to both
_go32_dpmi_set_protected_mode_interrupt_vector and
_go32_dpmi_free_iret_wrapper.
Warning! Because of the way DPMI works, you may not
longjmp out of an interrupt handler or perform any system calls
(such as printf) from within an interrupt handler.
Do not enable interrupts with enable() or asm("sti") in your function.
See also _go32_dpmi_set_protected_mode_interrupt_vector, and _go32_dpmi_free_iret_wrapper.
Zero on success, nonzero on failure.
| ANSI/ISO C | No |
| POSIX | No |
_go32_dpmi_seginfo info; info.pm_offset = my_handler; _go32_dpmi_allocate_iret_wrapper(&info); _go32_dpmi_set_protected_mode_interrupt_handler(0x75, &info); ... _go32_dpmi_free_iret_wrapper(&info); |