/* ______ ___ ___ * /\ _ \ /\_ \ /\_ \ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ * /\____/ * \_/__/ * * Interrupt wrapper functions for djgpp. Unlike the libc * _go32_dpmi_* wrapper functions, these can deal with * reentrant interrupts. * * By Shawn Hargreaves. * * See readme.txt for copyright information. */ #include "allegro.h" #include "allegro/internal/aintern.h" #include "allegro/platform/aintdos.h" #include "../i386/asmdefs.inc" #ifndef ALLEGRO_DOS #error something is wrong with the makefile #endif #define MAX_IRQS 8 /* timer + keyboard + soundcard + spares */ #define STACK_SIZE 8192 /* an 8k stack should be plenty */ _IRQ_HANDLER _irq_handler[MAX_IRQS]; unsigned char *_irq_stack[IRQ_STACKS]; extern void _irq_wrapper_0(void), _irq_wrapper_1(void), _irq_wrapper_2(void), _irq_wrapper_3(void), _irq_wrapper_4(void), _irq_wrapper_5(void), _irq_wrapper_6(void), _irq_wrapper_7(void), _irq_wrapper_0_end(void); /* _dos_irq_init: * Initialises this module. */ void _dos_irq_init(void) { int c; LOCK_VARIABLE(_irq_handler); LOCK_VARIABLE(_irq_stack); LOCK_FUNCTION(_irq_wrapper_0); for (c=0; c