Skip to content

Commit 63e6d1e

Browse files
tkchiaPerditionC
authored andcommitted
Supplement: rename intr( ) to intrf( )/_intrf( ), and
make its prototype agree with the corresponding functions in Open Watcom and (gcc-ia16 +) libi86 See FDOS#80 (comment) .
1 parent 5f018a4 commit 63e6d1e

File tree

5 files changed

+17
-24
lines changed

5 files changed

+17
-24
lines changed

suppl/compat/dos.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ union REGPACK {
3838
unsigned short ax, bx, cx, dx, bp, si, di, ds, es, flags;
3939
} x;
4040
};
41-
extern void intr(int nr, union REGPACK *r) __attribute__((stdcall));
41+
extern void _intrf(int nr, union REGPACK *r) __attribute__((regparmcall));
4242

4343
static inline unsigned getpsp(void)
4444
{

suppl/p-gcc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typedef struct {
8686
unsigned int r_es;
8787
unsigned int r_flags;
8888
} IREGS;
89-
#define intrpt(num,regs) intr((num), (union REGPACK*)(regs))
89+
#define intrpt(num,regs) _intrf((num), (union REGPACK*)(regs))
9090

9191
static inline unsigned short CS_(void)
9292
{

suppl/p-watcom.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef struct {
7171
unsigned int r_es;
7272
unsigned int r_flags;
7373
} IREGS;
74-
#define intrpt(num,regs) intr((num), (union REGPACK*)(regs))
74+
#define intrpt(num,regs) intrf((num), (union REGPACK*)(regs))
7575

7676
#ifdef __WATCOMC__
7777
unsigned CS_(void);

suppl/regproto.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extern unsigned _FLAGS;
8282
#define _DS reg.x.ds
8383
#define _ES reg.x.es
8484
#define _CFLAG (reg.x.flags & 1)
85-
#define geninterrupt(n) intr(n,&reg)
85+
#define geninterrupt(n) intrpt(n,&reg)
8686

8787
#else
8888

suppl/src/intr.asm

+13-20
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,34 @@ segment .text
3434

3535
bits 16
3636

37-
global intr
37+
global intrf
38+
global _intrf
3839

39-
intr:
40+
intrf:
41+
_intrf:
4042

4143
%elifidni COMPILER, WATCOM ; and Open Watcom
4244
%define COMPILE 1
4345

4446
segment _TEXT class=CODE
4547

4648

47-
global intr_
49+
global intrf_
50+
global _intrf_
4851

49-
intr_:
52+
intrf_:
53+
_intrf_:
5054
%endif
5155

5256
%ifdef COMPILE
5357
push bp ; Standard C entry
5458
%ifidn __OUTPUT_FORMAT__, elf
55-
mov bp,sp
56-
mov ax, [bp+4] ; interrupt number
57-
mov bx, [bp+6] ; regpack structure
58-
push es
59-
%else
59+
push es ; gcc-ia16 has es caller-saved
60+
%endif
6061
push bx
6162
push cx
6263
mov bx, dx
6364
push dx
64-
%endif
6565
push si
6666
push di
6767
push ds
@@ -87,11 +87,7 @@ intr_1:
8787
push bx
8888
mov bx, sp
8989
mov ds, [ss:bx+6]
90-
%ifidn __OUTPUT_FORMAT__, elf
91-
mov bx, [ss:bx+20] ; address of REGPACK
92-
%else
9390
mov bx, [ss:bx+12] ; address of REGPACK
94-
%endif
9591
mov [bx], ax
9692
pop word [bx+2]
9793
mov [bx+4], cx
@@ -106,15 +102,12 @@ intr_1:
106102
pop ds
107103
pop di
108104
pop si
109-
%ifidn __OUTPUT_FORMAT__, elf
110-
pop es
111-
pop bp
112-
ret 4
113-
%else
114105
pop dx
115106
pop cx
116107
pop bx
108+
%ifidn __OUTPUT_FORMAT__, elf
109+
pop es
110+
%endif
117111
pop bp
118112
ret ; retf/retn model specific, see model.inc
119113
%endif
120-
%endif

0 commit comments

Comments
 (0)