mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[dos] Do not install timer ISR, when ecmascript is not compiled in.
This commit is contained in:
parent
29bf0ee9bb
commit
f655bd03c7
@ -1013,15 +1013,11 @@ void os_seed_random(unsigned char **pool, int *pool_size)
|
||||
*pool_size = RANDOM_POOL_SIZE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
_go32_dpmi_seginfo OldISR, NewISR;
|
||||
#define TIMER 8
|
||||
//Simple Example of chaining interrupt handlers
|
||||
//Adopted from Matthew Mastracci's code
|
||||
|
||||
#include <pc.h>
|
||||
#include <dpmi.h>
|
||||
#include <go32.h>
|
||||
|
||||
//macros by Shawn Hargreaves from the Allegro library for locking
|
||||
//functions and variables.
|
||||
#define LOCK_VARIABLE(x) _go32_dpmi_lock_data((void *)&x,(long)sizeof(x));
|
||||
@ -1030,15 +1026,14 @@ _go32_dpmi_seginfo OldISR, NewISR;
|
||||
static void
|
||||
TickHandler(void)
|
||||
{
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
static int internal = 0;
|
||||
|
||||
if (internal++ >= 19) {
|
||||
internal = 0;
|
||||
check_heartbeats(NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void init_osdep(void)
|
||||
{
|
||||
@ -1071,6 +1066,7 @@ void init_osdep(void)
|
||||
sa.sa_flags = SA_RESTART;
|
||||
EINTRLOOP(rs, sigaction(SIGINT, &sa, NULL));
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
LOCK_FUNCTION(TickHandler);
|
||||
LOCK_FUNCTION(check_heartbeats);
|
||||
//load the address of the old timer ISR into the OldISR structure
|
||||
@ -1083,14 +1079,16 @@ void init_osdep(void)
|
||||
//timer ISR
|
||||
//will be called, then the new timer ISR
|
||||
_go32_dpmi_chain_protected_mode_interrupt_vector(TIMER, &NewISR);
|
||||
#endif
|
||||
}
|
||||
|
||||
void terminate_osdep(void)
|
||||
{
|
||||
if (screen_backbuffer)
|
||||
mem_free(screen_backbuffer);
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
_go32_dpmi_set_protected_mode_interrupt_vector(TIMER, &OldISR);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define LINKS_BIN_SEARCH(entries, eq, ab, key, result) \
|
||||
|
Loading…
Reference in New Issue
Block a user