david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/arch/i386/include/biosint.h
Michael Brown 0a8a17e669 [i386] Free allocated base memory on exit, if possible
Code paths that automatically allocate memory from the FBMS at 40:13
should also free it, if possible.

Freeing this memory will not be possible if either

  1. The FBMS has been modified since our allocation, or

  2. We have not been able to unhook one or more BIOS interrupt vectors.
2008-11-18 19:43:13 +00:00

32 lines
883 B
C

#ifndef BIOSINT_H
#define BIOSINT_H
/**
* @file BIOS interrupts
*
*/
#include <realmode.h>
struct segoff;
/**
* Hooked interrupt count
*
* At exit, after unhooking all possible interrupts, this counter
* should be examined. If it is non-zero, it means that we failed to
* unhook at least one interrupt vector, and so must not free up the
* memory we are using. (Note that this also implies that we should
* re-hook INT 15 in order to hide ourselves from the memory map).
*/
extern uint16_t __text16 ( hooked_bios_interrupts );
#define hooked_bios_interrupts __use_text16 ( hooked_bios_interrupts )
extern void hook_bios_interrupt ( unsigned int interrupt, unsigned int handler,
struct segoff *chain_vector );
extern int unhook_bios_interrupt ( unsigned int interrupt,
unsigned int handler,
struct segoff *chain_vector );
#endif /* BIOSINT_H */