From 5ff361314c29667581cad64e082d61fc7d3e9f85 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Thu, 12 Jul 2018 14:27:03 -0400 Subject: [PATCH] ia16-elf-gcc: eliminate DOSDATA, DOSTEXT and C use of TGROUP. Now that it understands relocations those are no longer necessary. --- kernel/globals.h | 7 ------- kernel/init-dat.h | 7 ------- kernel/init-mod.h | 9 --------- kernel/inithma.c | 7 ------- kernel/main.c | 4 ++-- 5 files changed, 2 insertions(+), 32 deletions(-) diff --git a/kernel/globals.h b/kernel/globals.h index bc4eaf3..9c877cd 100644 --- a/kernel/globals.h +++ b/kernel/globals.h @@ -160,14 +160,7 @@ extern struct dhdr FAR ASM clk_dev; /* Clock device driver */ extern struct dhdr FAR ASM con_dev; /* Console device driver */ extern struct dhdr FAR ASM prn_dev; /* Generic printer device driver */ extern struct dhdr FAR ASM aux_dev; /* Generic aux device driver */ -#ifndef __GNUC__ extern struct dhdr FAR ASM blk_dev; /* Block device (Disk) driver */ -#else -extern struct dhdr ASM blk_dev; -#define DosTextSeg 0x70 -#define DOSTEXT(x) (*(typeof(x) FAR *)MK_FP(DosTextSeg, (size_t)&(x))) -#define blk_dev DOSTEXT(blk_dev) -#endif extern COUNT *error_tos, /* error stack */ disk_api_tos, /* API handler stack - disk fns */ char_api_tos; /* API handler stack - char fns */ diff --git a/kernel/init-dat.h b/kernel/init-dat.h index 7d91716..126dc46 100644 --- a/kernel/init-dat.h +++ b/kernel/init-dat.h @@ -1,7 +1,5 @@ #undef DOSFAR #undef DOSTEXTFAR -#define DOSDATA(x) (x) -#define DOSTEXT(x) (x) /* Included by initialisation functions */ @@ -27,13 +25,8 @@ extern __segment DosTextSeg; #elif defined(__GNUC__) -#define DosTextSeg 0x70 #define DOSFAR FAR #define DOSTEXTFAR FAR -#undef DOSDATA -#undef DOSTEXT -#define DOSDATA(x) (*(typeof(x) FAR *)MK_FP(DosDataSeg, (size_t)&(x))) -#define DOSTEXT(x) (*(typeof(x) FAR *)MK_FP(DosTextSeg, (size_t)&(x))) #elif !defined(I86) diff --git a/kernel/init-mod.h b/kernel/init-mod.h index 16739b9..2b9868d 100644 --- a/kernel/init-mod.h +++ b/kernel/init-mod.h @@ -218,9 +218,6 @@ VOID ASMCFUNC FAR int2a_handler(void); VOID ASMCFUNC FAR int2f_handler(void); VOID ASMCFUNC FAR cpm_entry(void); -#define cpm_entry DOSDATA(cpm_entry) -#define int29_handler DOSTEXT(int29_handler) - /* kernel.asm */ #ifdef __GNUC__ VOID ASMCFUNC init_call_p_0(struct config FAR *Config) FAR __attribute__((noreturn)); @@ -240,7 +237,6 @@ int VA_CDECL init_sprintf(char * buff, CONST char * fmt, ...); /* procsupt.asm */ VOID ASMCFUNC FAR got_cbreak(void); -#define got_cbreak DOSTEXT(got_cbreak) /* initclk.c */ extern void Init_clk_driver(void); @@ -248,12 +244,7 @@ extern void Init_clk_driver(void); extern UWORD HMAFree; /* first byte in HMA not yet used */ extern unsigned CurrentKernelSegment; -#ifdef __GNUC__ -extern struct _KernelConfig ASM LowKernelConfig; -#define LowKernelConfig *(typeof(LowKernelConfig) FAR *)MK_FP(DOS_PSP, &LowKernelConfig) -#else extern struct _KernelConfig FAR ASM LowKernelConfig; -#endif extern WORD days[2][13]; extern BYTE FAR *lpTop; extern BYTE ASM _ib_start[], ASM _ib_end[], ASM _init_end[]; diff --git a/kernel/inithma.c b/kernel/inithma.c index fe15a58..7838a3b 100644 --- a/kernel/inithma.c +++ b/kernel/inithma.c @@ -312,14 +312,7 @@ void MoveKernel(unsigned NewKernelSegment) unsigned jmpseg = CurrentKernelSegment; if (CurrentKernelSegment == 0) -#ifdef __GNUC__ - { - extern char TGROUP[] asm("TGROUP"); - CurrentKernelSegment = (unsigned)TGROUP; - } -#else CurrentKernelSegment = FP_SEG(_HMATextEnd); -#endif if (CurrentKernelSegment == 0xffff) return; diff --git a/kernel/main.c b/kernel/main.c index 1d2ec22..32cbc9d 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -263,10 +263,10 @@ STATIC void setup_int_vectors(void) for (plvec = intvec_table; plvec < intvec_table + 5; plvec++) plvec->isv = getvec(plvec->intno); for (i = 0x23; i <= 0x3f; i++) - setvec(i, DOSDATA(empty_handler)); + setvec(i, empty_handler); HaltCpuWhileIdle = 0; for (pvec = vectors; pvec < vectors + (sizeof vectors/sizeof *pvec); pvec++) - setvec(pvec->intno, (intvec)MK_FP(FP_SEG(DOSDATA(empty_handler)), pvec->handleroff)); + setvec(pvec->intno, (intvec)MK_FP(FP_SEG(empty_handler), pvec->handleroff)); pokeb(0, 0x30 * 4, 0xea); pokel(0, 0x30 * 4 + 1, (ULONG)cpm_entry);