delorie.com/djgpp/doc/libc/libc_431.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_go32_dpmi_allocate_iret_wrapper

Syntax

 
#include <dpmi.h>

int _go32_dpmi_allocate_iret_wrapper(_go32_dpmi_seginfo *info);

Description

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.

Return Value

Zero on success, nonzero on failure.

Portability

ANSI/ISO C No
POSIX No

Example

 
_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);


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004