From 8ee8135d4f5202684fd020a6adb3b9898d4b2624 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Thu, 12 Jul 2018 10:56:26 -0400 Subject: [PATCH] ia16-elf-gcc port: use CDECL = __attribute__((cdecl)) instead of varargs. --- hdr/device.h | 4 ++-- hdr/portab.h | 6 +++++- kernel/config.c | 2 +- kernel/dsk.c | 2 +- kernel/globals.h | 2 +- kernel/init-mod.h | 4 ++-- kernel/inthndlr.c | 8 ++++---- kernel/nls.c | 4 ++-- kernel/proto.h | 6 +++--- kernel/sysclk.c | 2 +- kernel/task.c | 2 +- 11 files changed, 23 insertions(+), 19 deletions(-) diff --git a/hdr/device.h b/hdr/device.h index ec08cd7..b192505 100644 --- a/hdr/device.h +++ b/hdr/device.h @@ -483,14 +483,14 @@ extern request /* I/O Request packets */ ASM CharReqHdr, ASM IoReqHdr, ASM MediaReqHdr; /* dsk.c */ -COUNT ASMCFUNC FAR blk_driver(rqptr rp, ...); +COUNT ASMCFUNC FAR blk_driver(rqptr rp); ddt * getddt(int dev); /* error.c */ COUNT char_error(request * rq, struct dhdr FAR * lpDevice); COUNT block_error(request * rq, COUNT nDrive, struct dhdr FAR * lpDevice, int mode); /* sysclk.c */ -WORD ASMCFUNC FAR clk_driver(rqptr rp, ...); +WORD ASMCFUNC FAR clk_driver(rqptr rp); /* execrh.asm */ #if defined(__WATCOMC__) && _M_IX86 >= 300 diff --git a/hdr/portab.h b/hdr/portab.h index 54e3198..98f5086 100644 --- a/hdr/portab.h +++ b/hdr/portab.h @@ -153,7 +153,7 @@ static inline void enable(void) asm volatile("sti"); } #define far __far -#define CDECL +#define CDECL __attribute__((cdecl)) #define VA_CDECL #define PASCAL @@ -232,7 +232,11 @@ typedef unsigned size_t; as 'ASMCFUNC', and is (and will be ?-) cdecl */ #define ASMCFUNC CDECL #define ASMPASCAL PASCAL +#if defined(__GNUC__) +#define ASM +#else #define ASM ASMCFUNC +#endif /* variables that can be near or far: redefined in init-dat.h */ #define DOSFAR diff --git a/kernel/config.c b/kernel/config.c index 73afc3f..580b896 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -630,7 +630,7 @@ struct memdiskinfo { }; /* query_memdisk() based on similar subroutine in Eric Auer's public domain getargs.asm which is based on IFMEMDSK */ -struct memdiskinfo FAR * ASMCFUNC query_memdisk(UBYTE drive, ...); +struct memdiskinfo FAR * ASMCFUNC query_memdisk(UBYTE drive); struct memdiskopt { BYTE * name; diff --git a/kernel/dsk.c b/kernel/dsk.c index 18556c2..41f32c4 100644 --- a/kernel/dsk.c +++ b/kernel/dsk.c @@ -170,7 +170,7 @@ static dsk_proc * const dispatch[NENTRY] = /* F U N C T I O N S --------------------------------------------------- */ /* ----------------------------------------------------------------------- */ -COUNT ASMCFUNC FAR blk_driver(rqptr rp, ...) +COUNT ASMCFUNC FAR blk_driver(rqptr rp) { if (rp->r_unit >= blk_dev.dh_name[0] && rp->r_command != C_INIT) return failure(E_UNIT); diff --git a/kernel/globals.h b/kernel/globals.h index d800086..bc4eaf3 100644 --- a/kernel/globals.h +++ b/kernel/globals.h @@ -363,7 +363,7 @@ VOID ASMCFUNC FAR cpm_entry(VOID) /*INRPT FAR handle_break(VOID) */ ; COUNT ASMCFUNC CriticalError(COUNT nFlag, COUNT nDrive, COUNT nError, - struct dhdr FAR * lpDevice, ...); + struct dhdr FAR * lpDevice); VOID ASMCFUNC FAR CharMapSrvc(VOID); #if 0 diff --git a/kernel/init-mod.h b/kernel/init-mod.h index 3a65120..949b3c8 100644 --- a/kernel/init-mod.h +++ b/kernel/init-mod.h @@ -198,7 +198,7 @@ void ASMPASCAL set_DTA(void far *dta); /* irqstack.asm */ VOID ASMCFUNC init_stacks(VOID FAR * stack_base, COUNT nStacks, - WORD stackSize, ...); + WORD stackSize); /* inthndlr.c */ VOID ASMCFUNC FAR int0_handler(void); @@ -223,7 +223,7 @@ VOID ASMCFUNC FAR cpm_entry(void); /* kernel.asm */ #ifdef __GNUC__ -VOID ASMCFUNC init_call_p_0(struct config FAR *Config, ...) asm("init_call_p_0"); +VOID ASMCFUNC init_call_p_0(struct config FAR *Config) asm("init_call_p_0"); #else VOID ASMCFUNC FAR init_call_p_0(struct config FAR *Config); /* P_0, actually */ #endif diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 2638344..8fa1978 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -63,7 +63,7 @@ struct HugeSectorBlock { /* variables needed for the rest of the handler. */ /* this here works on the users stack !! and only very few functions are allowed */ -VOID ASMCFUNC int21_syscall(iregs FAR * irp, ...) +VOID ASMCFUNC int21_syscall(iregs FAR * irp) { Int21AX = irp->AX; @@ -376,7 +376,7 @@ int int21_fat32(lregs *r) } #endif -VOID ASMCFUNC int21_service(iregs FAR * r, ...) +VOID ASMCFUNC int21_service(iregs FAR * r) { COUNT rc; long lrc; @@ -1625,7 +1625,7 @@ struct int25regs { /* this function is called from an assembler wrapper function */ -VOID ASMCFUNC int2526_handler(WORD mode, struct int25regs FAR * r, ...) +VOID ASMCFUNC int2526_handler(WORD mode, struct int25regs FAR * r) { ULONG blkno; UWORD nblks; @@ -1734,7 +1734,7 @@ struct int2f12regs { /* WARNING: modifications in `r' are used outside of int2F_12_handler() * On input r.AX==0x12xx, 0x4A01 or 0x4A02 */ -VOID ASMCFUNC int2F_12_handler(struct int2f12regs r, ...) +VOID ASMCFUNC int2F_12_handler(struct int2f12regs r) { COUNT rc; long lrc; diff --git a/kernel/nls.c b/kernel/nls.c index 849263f..d236402 100644 --- a/kernel/nls.c +++ b/kernel/nls.c @@ -509,7 +509,7 @@ VOID DosUpMem(VOID FAR * str, unsigned len) * the HiByte of the first argument must remain unchanged. * See NLSSUPT.ASM -- 2000/03/30 ska */ -unsigned char ASMCFUNC DosUpChar(unsigned char ch, ...) +unsigned char ASMCFUNC DosUpChar(unsigned char ch) /* upcase a single character */ { log(("NLS: DosUpChar(): in ch=%u (%c)\n", ch, ch > 32 ? ch : ' ')); @@ -667,7 +667,7 @@ VOID FAR *DosGetDBCS(void) Return value: AL register to be returned if AL == 0, Carry must be cleared, otherwise set */ -UWORD ASMCFUNC syscall_MUX14(DIRECT_IREGS, ...) +UWORD ASMCFUNC syscall_MUX14(DIRECT_IREGS) { struct nlsPackage FAR *nls; /* addressed NLS package */ diff --git a/kernel/proto.h b/kernel/proto.h index c615137..b45a9fb 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -260,7 +260,7 @@ BYTE DosYesNo(UWORD ch); #ifndef DosUpMem VOID DosUpMem(VOID FAR * str, unsigned len); #endif -unsigned char ASMCFUNC DosUpChar(unsigned char ch, ...); +unsigned char ASMCFUNC DosUpChar(unsigned char ch); VOID DosUpString(char FAR * str); VOID DosUpFMem(VOID FAR * str, unsigned len); unsigned char DosUpFChar(unsigned char ch); @@ -276,7 +276,7 @@ COUNT DosSetCountry(UWORD cntry); COUNT DosGetCodepage(UWORD * actCP, UWORD * sysCP); COUNT DosSetCodepage(UWORD actCP, UWORD sysCP); VOID FAR *DosGetDBCS(void); -UWORD ASMCFUNC syscall_MUX14(DIRECT_IREGS, ...); +UWORD ASMCFUNC syscall_MUX14(DIRECT_IREGS); /* prf.c */ #ifdef DEBUG @@ -383,7 +383,7 @@ UWORD get_machine_name(BYTE FAR * netname); VOID set_machine_name(BYTE FAR * netname, UWORD name_num); /* procsupt.asm */ -VOID ASMCFUNC exec_user(iregs FAR * irp, int disable_a20, ...); +VOID ASMCFUNC exec_user(iregs FAR * irp, int disable_a20); /* new by TE */ diff --git a/kernel/sysclk.c b/kernel/sysclk.c index dc27bef..67df7b2 100644 --- a/kernel/sysclk.c +++ b/kernel/sysclk.c @@ -58,7 +58,7 @@ STATIC void DayToBcd(BYTE * x, unsigned mon, unsigned day, unsigned yr) x[2] = ByteToBcd(yr % 100); } -WORD ASMCFUNC FAR clk_driver(rqptr rp, ...) +WORD ASMCFUNC FAR clk_driver(rqptr rp) { BYTE bcd_days[4], bcd_minutes, bcd_hours, bcd_seconds; diff --git a/kernel/task.c b/kernel/task.c index eef0edf..b7a1e58 100644 --- a/kernel/task.c +++ b/kernel/task.c @@ -800,7 +800,7 @@ COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp) #include "config.h" /* config structure definition */ /* start process 0 (the shell) */ -VOID ASMCFUNC P_0(struct config FAR *Config, ...) +VOID ASMCFUNC P_0(struct config FAR *Config) { BYTE *tailp, *endp; exec_blk exb;