Skip to content

Commit

Permalink
ow: use safer form of #pragma aux, using ISO standard compiler reserv…
Browse files Browse the repository at this point in the history
…ed namespace
  • Loading branch information
jmalak committed Apr 28, 2024
1 parent c08313a commit 925f41b
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 175 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
24 changes: 12 additions & 12 deletions hdr/portab.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void __emit__(char, ...);
#define enable() __emit__(0xfb)
#endif

#elif defined (_MSC_VER)
#elif defined (_MSC_VER)

#define I86
#define asm __asm
Expand Down Expand Up @@ -110,22 +110,22 @@ static unsigned short __inline getSS(void)
#endif
#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 Expand Up @@ -234,7 +234,7 @@ typedef unsigned size_t;
#define PARASIZE 16 /* "paragraph" size */
typedef unsigned size_t;
#endif
/* functions, that are shared between C and ASM _must_
/* functions, that are shared between C and ASM _must_
have a certain calling standard. These are declared
as 'ASMCFUNC', and is (and will be ?-) cdecl */
#define ASMCFUNC CDECL
Expand Down Expand Up @@ -301,7 +301,7 @@ typedef unsigned short CLUSTER;
typedef unsigned short UNICODE;

#if defined(STATICS) || defined(__WATCOMC__) || defined(__GNUC__)
#define STATIC static /* local calls inside module */
#define STATIC static /* local calls inside module */
#else
#define STATIC
#endif
Expand Down Expand Up @@ -333,7 +333,7 @@ typedef signed long LONG;
#ifndef MK_FP

#if defined(__WATCOMC__)
#define MK_FP(seg,ofs) (((UWORD)(seg)):>((VOID *)(ofs)))
#define MK_FP(seg,ofs) (((UWORD)(seg)):>((VOID *)(ofs)))
#elif defined(__TURBOC__) && (__TURBOC__ > 0x202)
#define MK_FP(seg,ofs) ((void _seg *)(seg) + (void near *)(ofs))
#else
Expand Down Expand Up @@ -385,9 +385,9 @@ typedef VOID (FAR ASMCFUNC * intvec) (void);
#endif

/*
this suppresses the warning
unreferenced parameter 'x'
and (hopefully) generates no code
this suppresses the warning
unreferenced parameter 'x'
and (hopefully) generates no code
*/
#define UNREFERENCED_PARAMETER(x) (void)x;

Expand Down
16 changes: 8 additions & 8 deletions 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 Expand Up @@ -366,7 +366,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp)
unsigned c;
unsigned cu_pos = scr_pos;
unsigned count = 0, stored_pos = 0;
unsigned size = kp->kb_size, stored_size = kp->kb_count;
unsigned size = kp->kb_size, stored_size = kp->kb_count;
BOOL insert = FALSE, first = TRUE;

if (size == 0)
Expand All @@ -375,11 +375,11 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp)
/* the stored line is invalid unless it ends with a CR */
if (kp->kb_buf[stored_size] != CR)
stored_size = 0;

do
{
unsigned new_pos = stored_size;

c = read_char_check_break(sft_in, sft_out);
if (c == 0)
c = (unsigned)read_char_check_break(sft_in, sft_out) << 8;
Expand All @@ -402,7 +402,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp)
if (stored_pos < stored_size && count < size - 1)
local_buffer[count++] = echo_char(kp->kb_buf[stored_pos++], sft_out);
break;

case F2:
case F4:
/* insert/delete up to character c */
Expand Down Expand Up @@ -430,7 +430,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp)
}
stored_pos = new_pos;
break;

case F5:
fmemcpy(kp->kb_buf, local_buffer, count);
stored_size = count;
Expand All @@ -440,7 +440,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp)
case INS:
insert = !insert;
break;

case DEL:
stored_pos++;
break;
Expand Down Expand Up @@ -522,7 +522,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp)
size_t read_line_handle(int sft_idx, size_t n, char FAR * bp)
{
size_t chars_left;

if (inputptr == NULL)
{
/* can we reuse kb_buf or was it overwritten? */
Expand Down
46 changes: 23 additions & 23 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 Expand Up @@ -374,7 +374,7 @@ STATIC WORD getbpb(ddt * pddt)
unsigned secs_per_cyl;
WORD ret;

/* pddt->ddt_descflags |= DF_NOACCESS;
/* pddt->ddt_descflags |= DF_NOACCESS;
* disabled for now - problems with FORMAT ?? */

/* set drive to not accessible and changed */
Expand Down Expand Up @@ -426,7 +426,7 @@ STATIC WORD getbpb(ddt * pddt)
#endif
extended_BPB_signature = DiskTransferBuffer[0x26];

/* 0x29 is usual signature value for serial#,vol label,& fstype;
/* 0x29 is usual signature value for serial#,vol label,& fstype;
0x28 older EBPB signature indicating only serial# is valid */
if ((extended_BPB_signature == 0x29) || (extended_BPB_signature == 0x28))
{
Expand Down Expand Up @@ -716,7 +716,7 @@ STATIC WORD Genblkdev(rqptr rp, ddt * pddt)

/* return error if media lacks extended BPB with serial # */
{
register BYTE extended_BPB_signature =
register BYTE extended_BPB_signature =
DiskTransferBuffer[(pddt->ddt_bpb.bpb_nfsect != 0 ? 0x26 : 0x42)];
if ((extended_BPB_signature != 0x29) || (extended_BPB_signature != 0x28))
return failure(E_MEDIA);
Expand Down Expand Up @@ -954,22 +954,22 @@ STATIC unsigned DMA_max_transfer(void FAR * buffer, unsigned count)
UWORD *transferred sectors actually transferred
Read/Write/Write+verify some sectors, using LBA addressing.
This function handles all the minor details, including:
retry in case of errors
crossing the 64K DMA boundary
translation to CHS addressing if necessary
crossing track boundaries (necessary for some BIOSes
High memory doesn't work very well, use internal buffer
write with verify details for LBA
*/

STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
Expand All @@ -988,9 +988,9 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,

int num_retries;

UWORD bytes_sector = pddt->ddt_bpb.bpb_nbyte; /* bytes per sector, usually 512 */
UWORD bytes_sector = pddt->ddt_bpb.bpb_nbyte; /* bytes per sector, usually 512 */
*transferred = 0;

/* only low-level format floppies for now ! */
if (mode == LBA_FORMAT && hd(pddt->ddt_descflags))
return 0;
Expand All @@ -1009,8 +1009,8 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
fl_reset(driveno);
}
}
/*

/*
if (LBA_address+totaltodo > pddt->total_sectors)
{
printf("LBA-Transfer error : address overflow = %lu > %lu max\n",LBA_address+totaltodo,driveParam->total_sectors);
Expand All @@ -1027,7 +1027,7 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
/* avoid overflowing 64K DMA boundary
for drives that don't handle this transparently */
count = DMA_max_transfer(buffer, totaltodo);
}
}

if (FP_SEG(buffer) >= 0xa000 || count == 0)
{
Expand Down
14 changes: 7 additions & 7 deletions kernel/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ extern BYTE ASM NetDelay, ASM NetRetry;

extern UWORD ASM first_mcb, /* Start of user memory */
ASM uppermem_root; /* Start of umb chain (usually 9fff) */
extern char * ASM inputptr; /* pointer to unread CON input */
extern char * ASM inputptr; /* pointer to unread CON input */
extern sfttbl FAR * ASM sfthead; /* System File Table head */
extern struct dhdr FAR * ASM clock; /* CLOCK$ device */
extern struct dhdr FAR * ASM syscon;/* console device */
Expand Down Expand Up @@ -264,8 +264,8 @@ extern BYTE ASM ErrorMode, /* Critical error flag */
ASM InDOS, /* In DOS critical section */
ASM OpenMode, /* File Open Attributes */
ASM SAttr, /* Attrib Mask for Dir Search */
ASM dosidle_flag, ASM Server_Call, ASM CritErrLocus, ASM CritErrAction,
ASM CritErrClass, ASM VgaSet,
ASM dosidle_flag, ASM Server_Call, ASM CritErrLocus, ASM CritErrAction,
ASM CritErrClass, ASM VgaSet,
ASM njoined; /* number of joined devices */

extern VOID FAR * ASM setverPtr; /* Pointer to SETVER list */
Expand Down 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
Loading

0 comments on commit 925f41b

Please sign in to comment.