ia16-elf-gcc port: use CDECL = __attribute__((cdecl)) instead of varargs.

This commit is contained in:
Bart Oldeman 2018-07-12 10:56:26 -04:00
parent ca7fb8e71b
commit 8ee8135d4f
11 changed files with 23 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -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;