Skip to content

Commit

Permalink
ow: use safer form of #pragma aux
Browse files Browse the repository at this point in the history
using ISO standard reserved word form of #pragma aux
  • Loading branch information
jmalak authored and PerditionC committed Jul 11, 2024
1 parent 5304e65 commit 2985b33
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion hdr/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ WORD ASMCFUNC FAR clk_driver(rqptr rp);
/* execrh.asm */
#if defined(__WATCOMC__) && _M_IX86 >= 300
WORD execrh(request FAR *, struct dhdr FAR *);
#pragma aux execrh "^" parm reverse routine [] modify [ax bx cx dx es fs gs]
#pragma aux execrh "^" __parm __reverse __routine [] __modify [__ax __bx __cx __dx __es __fs __gs]
#else
WORD ASMPASCAL execrh(request FAR *, struct dhdr FAR *);
#endif
Expand Down
10 changes: 5 additions & 5 deletions hdr/portab.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,22 @@ static unsigned short __inline getSS(void)
#define I86
#define __int__(intno) asm int intno;
void disable(void);
#pragma aux disable = "cli" modify exact [];
#pragma aux disable = "cli" __modify __exact [];
void enable(void);
#pragma aux enable = "sti" modify exact [];
#pragma aux enable = "sti" __modify __exact [];
#define asm __asm
#define far __far
#define CDECL __cdecl
#define VA_CDECL
#define PASCAL pascal
#define _CS getCS()
unsigned short getCS(void);
#pragma aux getCS = "mov dx,cs" value [dx] modify exact[dx];
#pragma aux getCS = "mov dx,cs" __value [__dx] __modify __exact[__dx];
#define _SS getSS()
unsigned short getSS(void);
#pragma aux getSS = "mov dx,ss" value [dx] modify exact[dx];
#pragma aux getSS = "mov dx,ss" __value [__dx] __modify __exact[__dx];
#if !defined(FORSYS) && !defined(EXEFLAT) && _M_IX86 >= 300
#pragma aux default parm [ax dx cx] modify [ax dx es fs] /* min.unpacked size */
#pragma aux __default __parm [__ax __dx __cx] __modify [__ax __dx __es __fs] /* min.unpacked size */
#endif

/* enable Possible loss of precision warning for compatibility with Borland */
Expand Down
2 changes: 1 addition & 1 deletion kernel/chario.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int ndread(struct dhdr FAR **pdev)

#ifdef __WATCOMC__
void fast_put_char(char c);
#pragma aux fast_put_char = "int 29h" parm[al] modify exact [bx]
#pragma aux fast_put_char = "int 29h" __parm[__al] __modify __exact [__bx]
#else

/* writes a character in raw mode using int29 for speed */
Expand Down
12 changes: 6 additions & 6 deletions kernel/dsk.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ extern COUNT ASMPASCAL fl_lba_ReadWrite(BYTE drive, WORD mode,
* dap_p);
UWORD ASMPASCAL floppy_change(UWORD);
#ifdef __WATCOMC__
#pragma aux (pascal) fl_reset modify exact [ax dx]
#pragma aux (pascal) fl_diskchanged modify exact [ax dx]
#pragma aux (pascal) fl_setdisktype modify exact [ax bx dx]
#pragma aux (pascal) fl_readkey modify exact [ax]
#pragma aux (pascal) fl_lba_ReadWrite modify exact [ax dx]
#pragma aux (pascal) floppy_change modify exact [ax cx dx]
#pragma aux (__pascal) fl_reset __modify __exact [__ax __dx]
#pragma aux (__pascal) fl_diskchanged __modify __exact [__ax __dx]
#pragma aux (__pascal) fl_setdisktype __modify __exact [__ax __bx __dx]
#pragma aux (__pascal) fl_readkey __modify __exact [__ax]
#pragma aux (__pascal) fl_lba_ReadWrite __modify __exact [__ax __dx]
#pragma aux (__pascal) floppy_change __modify __exact [__ax __cx __dx]
#endif

STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
Expand Down
8 changes: 4 additions & 4 deletions kernel/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ VOID ASMPASCAL WriteATClock(BYTE *, BYTE, BYTE, BYTE);
VOID ASMPASCAL WritePCClock(ULONG);
intvec getvec(unsigned char);
#ifdef __WATCOMC__
#pragma aux (pascal) ReadPCClock modify exact [ax cx dx]
#pragma aux (pascal) WriteATClock modify exact [ax bx cx dx]
#pragma aux (pascal) WritePCClock modify exact [ax cx dx]
#pragma aux (__pascal) ReadPCClock __modify __exact [__ax __cx __dx]
#pragma aux (__pascal) WriteATClock __modify __exact [__ax __bx __cx __dx]
#pragma aux (__pascal) WritePCClock __modify __exact [__ax __cx __dx]
#endif

/* */
Expand Down Expand Up @@ -410,7 +410,7 @@ void setvec(unsigned char intno, intvec vector);

/* ^Break handling */
#ifdef __WATCOMC__
#pragma aux (cdecl) spawn_int23 aborts;
#pragma aux (__cdecl) spawn_int23 __aborts;
#endif
void ASMCFUNC spawn_int23(void); /* procsupt.asm */
void ASMCFUNC DosIdle_hlt(void); /* dosidle.asm */
Expand Down
44 changes: 22 additions & 22 deletions kernel/init-mod.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ char * ASMPASCAL strchr(const char *s, int ch);
#ifdef __WATCOMC__
/* bx, cx, dx and es not used or clobbered for all asmsupt.asm functions except
(f)memchr/(f)strchr (which clobber dx) */
#pragma aux (pascal) pascal_ax modify exact [ax]
#pragma aux (__pascal) pascal_ax __modify __exact [__ax]
#pragma aux (pascal_ax) memset
#pragma aux (pascal_ax) fmemset
#pragma aux (pascal_ax) memcpy
#pragma aux (pascal_ax) fmemcpy
#pragma aux (pascal_ax) memcmp modify nomemory
#pragma aux (pascal_ax) fmemcmp modify nomemory
#pragma aux (pascal_ax) memcmp __modify __nomemory
#pragma aux (pascal_ax) fmemcmp __modify __nomemory
#pragma aux (pascal_ax) strcpy
#pragma aux (pascal_ax) fstrcpy
#pragma aux (pascal_ax) strlen modify nomemory
#pragma aux (pascal_ax) fstrlen modify nomemory
#pragma aux (pascal) strchr modify exact [ax dx] nomemory
#pragma aux (pascal_ax) strlen __modify __nomemory
#pragma aux (pascal_ax) fstrlen __modify __nomemory
#pragma aux (__pascal) strchr __modify __exact [__ax __dx] __nomemory
#endif

#undef LINESIZE
Expand Down Expand Up @@ -147,7 +147,7 @@ COUNT ASMPASCAL Umb_Test(void);
COUNT ASMPASCAL UMB_get_largest(void FAR * driverAddress,
UCOUNT * seg, UCOUNT * size);
#ifdef __WATCOMC__
#pragma aux (pascal) UMB_get_largest modify exact [ax bx cx dx]
#pragma aux (__pascal) UMB_get_largest __modify __exact [__ax __bx __cx __dx]
#endif

/* inithma.c */
Expand Down Expand Up @@ -185,18 +185,18 @@ int ASMPASCAL init_switchar(int chr);
void ASMPASCAL keycheck(void);
void ASMPASCAL set_DTA(void far *dta);
#ifdef __WATCOMC__
#pragma aux (pascal) init_call_intr modify exact [ax]
#pragma aux (pascal) read modify exact [ax bx cx dx]
#pragma aux (pascal) init_DosOpen modify exact [ax bx dx]
#pragma aux (pascal) close modify exact [ax bx]
#pragma aux (pascal) dup2 modify exact [ax bx cx]
#pragma aux (pascal) allocmem modify exact [ax bx]
#pragma aux (pascal) init_PSPSet modify exact [ax bx]
#pragma aux (pascal) init_DosExec modify exact [ax bx dx es]
#pragma aux (pascal) init_setdrive modify exact [ax bx dx]
#pragma aux (pascal) init_switchar modify exact [ax bx dx]
#pragma aux (pascal) keycheck modify exact [ax]
#pragma aux (pascal) set_DTA modify exact [ax bx dx]
#pragma aux (__pascal) init_call_intr __modify __exact [__ax]
#pragma aux (__pascal) read __modify __exact [__ax __bx __cx __dx]
#pragma aux (__pascal) init_DosOpen __modify __exact [__ax __bx __dx]
#pragma aux (__pascal) close __modify __exact [__ax __bx]
#pragma aux (__pascal) dup2 __modify __exact [__ax __bx __cx]
#pragma aux (__pascal) allocmem __modify __exact [__ax __bx]
#pragma aux (__pascal) init_PSPSet __modify __exact [__ax __bx]
#pragma aux (__pascal) init_DosExec __modify __exact [__ax __bx __dx __es]
#pragma aux (__pascal) init_setdrive __modify __exact [__ax __bx __dx]
#pragma aux (__pascal) init_switchar __modify __exact [__ax __bx __dx]
#pragma aux (__pascal) keycheck __modify __exact [__ax]
#pragma aux (__pascal) set_DTA __modify __exact [__ax __bx __dx]
#endif

/* irqstack.asm */
Expand Down Expand Up @@ -333,9 +333,9 @@ extern void FAR * ASMPASCAL DetectXMSDriver(VOID);
extern int ASMPASCAL init_call_XMScall(void FAR * driverAddress, UWORD ax,
UWORD dx);
#ifdef __WATCOMC__
#pragma aux (pascal) DetectXMSDriver modify exact [ax dx]
#pragma aux (pascal) _EnableA20 modify exact [ax]
#pragma aux (pascal) _DisableA20 modify exact [ax]
#pragma aux (__pascal) DetectXMSDriver __modify __exact [__ax __dx]
#pragma aux (__pascal) _EnableA20 __modify __exact [__ax]
#pragma aux (__pascal) _DisableA20 __modify __exact [__ax]
#endif

#if defined(WATCOM) && 0
Expand Down
6 changes: 3 additions & 3 deletions kernel/prf.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ void put_console(int c)
#else
#ifdef __WATCOMC__
void int29(char c);
#pragma aux int29 = "int 0x29" parm [al] modify exact [bx];
#pragma aux int29 = "int 0x29" __parm [__al] __modify __exact [__bx];

#ifdef DEBUG_PRINT_COMPORT
void fastComPrint(char c);
#pragma aux fastComPrint = \
"mov bx, 0xFD05" \
"int 0x29" parm [al] modify exact [bx];
"int 0x29" __parm [__al] __modify __exact [__bx];
#endif
#endif

Expand Down Expand Up @@ -428,7 +428,7 @@ void hexd(char *title, UBYTE FAR * p, COUNT numBytes)
{
put_unsigned(p[loop], 16, 2);
put_console(' ');
}
}
for (loop = start; loop < numBytes && loop < start+16;loop++)
put_console(p[loop] < 0x20 ? '.' : p[loop]);
put_console('\n');
Expand Down
30 changes: 15 additions & 15 deletions kernel/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ unsigned char ctrl_break_pressed(void);
unsigned char check_handle_break(struct dhdr FAR **pdev);
void handle_break(struct dhdr FAR **pdev, int sft_out);
#ifdef __WATCOMC__
#pragma aux handle_break aborts;
#pragma aux handle_break __aborts;
#endif

/* chario.c */
Expand Down Expand Up @@ -127,8 +127,8 @@ COUNT DosTruename(const char FAR * src, char FAR * dest);
VOID ASMCFUNC DosIdle_int(void);
VOID ASMCFUNC DosIdle_hlt(void);
#ifdef __WATCOMC__
#pragma aux (cdecl) DosIdle_int modify exact []
#pragma aux (cdecl) DosIdle_hlt modify exact []
#pragma aux (__cdecl) DosIdle_int __modify __exact []
#pragma aux (__cdecl) DosIdle_hlt __modify __exact []
#endif

/* error.c */
Expand Down Expand Up @@ -222,9 +222,9 @@ UWORD ASMPASCAL call_intr(WORD nr, iregs FAR * rp);
COUNT ASMPASCAL res_DosExec(COUNT mode, exec_blk * ep, BYTE * lp);
UCOUNT ASMPASCAL res_read(int fd, void *buf, UCOUNT count);
#ifdef __WATCOMC__
#pragma aux (pascal) call_intr modify exact [ax]
#pragma aux (pascal) res_DosExec modify exact [ax bx dx es]
#pragma aux (pascal) res_read modify exact [ax bx cx dx]
#pragma aux (__pascal) call_intr __modify __exact [__ax]
#pragma aux (__pascal) res_DosExec __modify __exact [__ax __bx __dx __es]
#pragma aux (__pascal) res_read __modify __exact [__ax __bx __cx __dx]
#endif

/* ioctl.c */
Expand Down Expand Up @@ -318,21 +318,21 @@ int /*ASMCFUNC*/ ASMPASCAL fmemcmp(const void FAR *m1, const void FAR *m2, size_
#ifdef __WATCOMC__
/* bx, cx, dx and es not used or clobbered for all asmsupt.asm functions except
(f)memchr/(f)strchr (which clobber dx) */
#pragma aux (pascal) pascal_ax modify exact [ax]
#pragma aux (__pascal) pascal_ax __modify __exact [__ax]
#pragma aux (pascal_ax) fmemcpy
#pragma aux (pascal_ax) memcpy
#pragma aux (pascal_ax) fmemset
#pragma aux (pascal_ax) memset
#pragma aux (pascal_ax) fmemcmp modify nomemory
#pragma aux (pascal_ax) memcmp modify nomemory
#pragma aux (pascal_ax) fmemcmp __modify __nomemory
#pragma aux (pascal_ax) memcmp __modify __nomemory
#pragma aux (pascal_ax) fstrcpy
#pragma aux (pascal_ax) strcpy
#pragma aux (pascal_ax) fstrlen modify nomemory
#pragma aux (pascal_ax) strlen modify nomemory
#pragma aux (pascal) memchr modify exact [ax dx] nomemory
#pragma aux (pascal) fmemchr modify exact [ax dx] nomemory
#pragma aux (pascal) strchr modify exact [ax dx] nomemory
#pragma aux (pascal) fstrchr modify exact [ax dx] nomemory
#pragma aux (pascal_ax) fstrlen __modify __nomemory
#pragma aux (pascal_ax) strlen __modify __nomemory
#pragma aux (__pascal) memchr __modify __exact [__ax __dx] __nomemory
#pragma aux (__pascal) fmemchr __modify __exact [__ax __dx] __nomemory
#pragma aux (__pascal) strchr __modify __exact [__ax __dx] __nomemory
#pragma aux (__pascal) fstrchr __modify __exact [__ax __dx] __nomemory
#endif

/* sysclk.c */
Expand Down
4 changes: 2 additions & 2 deletions sys/fdkrncfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ unsigned long lseek(int fildes, unsigned long offset, int whence);
#pragma aux lseek = \
"mov ah, 0x42" \
"int 0x21" \
parm [bx] [dx cx] [ax] \
value [dx ax];
__parm [__bx] [__dx __cx] [__ax] \
__value [__dx __ax];

#elif defined(__GNUC__)
#include <unistd.h>
Expand Down
46 changes: 23 additions & 23 deletions sys/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ unsigned getcurdrive(void);
"mov ah, 0x19" \
"int 0x21" \
"xor ah, ah" \
value [ax];
__value [__ax];


long filelength(int __handle);
Expand All @@ -248,9 +248,9 @@ long filelength(int __handle);
"int 0x21" \
"pop dx" \
"pop ax" \
parm [bx] \
modify [cx] \
value [dx ax];
__parm [__bx] \
__modify [__cx] \
__value [__dx __ax];

extern int unlink(const char *pathname);

Expand Down Expand Up @@ -1076,9 +1076,9 @@ int absread(int DosDrive, int nsects, int foo, void *diskReadPacket);
"sbb ax, ax" \
"popf" \
"pop bp" \
parm [ax] [cx] [dx] [bx] \
modify [si di] \
value [ax];
__parm [__ax] [__cx] [__dx] [__bx] \
__modify [__si __di] \
__value [__ax];

int abswrite(int DosDrive, int nsects, int foo, void *diskReadPacket);
#pragma aux abswrite = \
Expand All @@ -1087,19 +1087,19 @@ int abswrite(int DosDrive, int nsects, int foo, void *diskReadPacket);
"sbb ax, ax" \
"popf" \
"pop bp" \
parm [ax] [cx] [dx] [bx] \
modify [si di] \
value [ax];
__parm [__ax] [__cx] [__dx] [__bx] \
__modify [__si __di] \
__value [__ax];

int fat32readwrite(int DosDrive, void *diskReadPacket, unsigned intno);
#pragma aux fat32readwrite = \
"mov ax, 0x7305" \
"mov cx, 0xffff" \
"int 0x21" \
"sbb ax, ax" \
parm [dx] [bx] [si] \
modify [cx dx si] \
value [ax];
__parm [__dx] [__bx] [__si] \
__modify [__cx __dx __si] \
__value [__ax];

void reset_drive(int DosDrive);
#pragma aux reset_drive = \
Expand All @@ -1110,22 +1110,22 @@ void reset_drive(int DosDrive);
"mov ah,0x32" \
"int 0x21" \
"pop ds" \
parm [dx] \
modify [ax bx];
__parm [__dx] \
__modify [__ax __bx];

void truename(char far *dest, const char *src);
#pragma aux truename = \
"mov ah,0x60" \
"int 0x21" \
parm [es di] [si];
__parm [__es __di] [__si];

int generic_block_ioctl(unsigned drive, unsigned cx, unsigned char *par);
#pragma aux generic_block_ioctl = \
"mov ax, 0x440d" \
"int 0x21" \
"sbb ax, ax" \
value [ax] \
parm [bx] [cx] [dx]; /* BH must be 0 for lock! */
__value [__ax] \
__parm [__bx] [__cx] [__dx]; /* BH must be 0 for lock! */

#else

Expand Down Expand Up @@ -1162,7 +1162,7 @@ int fat32readwrite(int DosDrive, void *diskReadPacket, unsigned intno)
regs.x.cx = 0xffff;
regs.x.si = intno;
intdos(&regs, &regs);

return regs.x.cflag;
} /* fat32readwrite */

Expand Down Expand Up @@ -1237,8 +1237,8 @@ unsigned getextdrivespace(void far *drivename, void *buf, unsigned buf_size);
"stc" \
"int 0x21" \
"sbb ax, ax" \
parm [es dx] [di] [cx] \
value [ax];
__parm [__es __dx] [__di] [__cx] \
__value [__ax];

#else /* !defined __WATCOMC__ */

Expand Down Expand Up @@ -1279,8 +1279,8 @@ BOOL haveLBA(void); /* return TRUE if we have LBA BIOS, FALSE otherwise */
"and cx, 1" \
"xchg cx, ax" \
"quit:" \
modify [bx cx dx] \
value [ax];
__modify [__bx __cx __dx] \
__value [__ax];
#else

BOOL haveLBA(void)
Expand Down

0 comments on commit 2985b33

Please sign in to comment.