From 7a16abbfb20889029e6864b19d37fb4151f74c65 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Mon, 10 May 2004 20:15:37 +0000 Subject: [PATCH] Convert setvec into a function for the resident code (mostly from Lucho). git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@928 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/globals.h | 5 +++-- kernel/main.c | 3 +++ kernel/task.c | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/kernel/globals.h b/kernel/globals.h index 98aa4c7..c200fdb 100644 --- a/kernel/globals.h +++ b/kernel/globals.h @@ -408,9 +408,10 @@ VOID fputword(VOID FAR *, UWORD); VOID fputbyte(VOID FAR *, UBYTE); #endif -#ifdef I86 -#define setvec(n, isr) (void)(*(intvec FAR *)MK_FP(0,4 * (n)) = (isr)) +#ifndef __WATCOMC__ +#define setvec setvec_resident #endif +void setvec(unsigned char intno, intvec vector); /*#define is_leap_year(y) ((y) & 3 ? 0 : (y) % 100 ? 1 : (y) % 400 ? 0 : 1) */ /* ^Break handling */ diff --git a/kernel/main.c b/kernel/main.c index f59593f..1a48a59 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -207,12 +207,15 @@ STATIC void PSPInit(void) p->ps_cmd.ctBuffer[0] = 0xd; /* command tail */ } +#ifndef __WATCOMC__ +/* for WATCOMC we can use the one in task.c */ void setvec(unsigned char intno, intvec vector) { disable(); *(intvec FAR *)MK_FP(0,4 * intno) = vector; enable(); } +#endif STATIC void setup_int_vectors(void) { diff --git a/kernel/task.c b/kernel/task.c index 236b4cc..6ad97dc 100644 --- a/kernel/task.c +++ b/kernel/task.c @@ -65,6 +65,13 @@ static BYTE *RcsId = + 1 byte: '\0' -- 1999/04/21 ska */ +void setvec(unsigned char intno, intvec vector) +{ + disable(); + *(intvec FAR *)MK_FP(0,4 * intno) = vector; + enable(); +} + ULONG SftGetFsize(int sft_idx) { sft FAR *s = idx_to_sft(sft_idx);