ia16-elf-gcc: remove need for far function wrappers

This commit is contained in:
Tee-Kiah Chia 2018-07-08 18:10:18 +08:00 committed by Kenneth J Davis
parent a4e7d1bf08
commit 656afa7873
4 changed files with 7 additions and 22 deletions

View File

@ -41,7 +41,7 @@ Linux 16.04 LTS (Xenial Xerus) or Ubuntu Linux 14.04 LTS (Trusty
Tahr), there are precompiled ia16-elf-gcc packages at Tahr), there are precompiled ia16-elf-gcc packages at
https://launchpad.net/~tkchia/+archive/ubuntu/build-ia16/. https://launchpad.net/~tkchia/+archive/ubuntu/build-ia16/.
Otherwise, for now ia16-elf-gcc needs to be compiled from source. Otherwise, for now ia16-elf-gcc needs to be compiled from source.
Only releases 20180419 and later are supported. Only releases 20180708 and later are supported.
Notes: Notes:
====== ======

View File

@ -337,7 +337,11 @@ typedef signed long LONG;
#define FP_SEG(fp) ((unsigned)((ULONG)(VOID FAR *)(fp)>>16)) #define FP_SEG(fp) ((unsigned)((ULONG)(VOID FAR *)(fp)>>16))
#endif #endif
#if defined(__GNUC__) && defined(__BUILTIN_IA16_FP_OFF)
#define FP_OFF(fp) __builtin_ia16_FP_OFF(fp)
#else
#define FP_OFF(fp) ((unsigned)(fp)) #define FP_OFF(fp) ((unsigned)(fp))
#endif
#endif #endif
#endif #endif

View File

@ -938,18 +938,6 @@ global %1lshrsi3
; reserve space for far jump to cp/m routine ; reserve space for far jump to cp/m routine
times 5 db 0 times 5 db 0
%ifdef gcc
blk_driver_wrap:mov ax, _blk_driver
jmp short blkclk
clk_driver_wrap:mov ax, _clk_driver
blkclk: pop si
pop di
call ax
push di
push si
retf
%endif
;End of HMA segment ;End of HMA segment
segment HMA_TEXT_END segment HMA_TEXT_END
global __HMATextEnd global __HMATextEnd
@ -1042,21 +1030,13 @@ _cpm_entry: jmp 0:reloc_call_cpm_entry
global _reloc_call_blk_driver global _reloc_call_blk_driver
extern _blk_driver extern _blk_driver
_reloc_call_blk_driver: _reloc_call_blk_driver:
%ifdef gcc
jmp 0:blk_driver_wrap
%else
jmp 0:_blk_driver jmp 0:_blk_driver
%endif
call near forceEnableA20 call near forceEnableA20
global _reloc_call_clk_driver global _reloc_call_clk_driver
extern _clk_driver extern _clk_driver
_reloc_call_clk_driver: _reloc_call_clk_driver:
%ifdef gcc
jmp 0:clk_driver_wrap
%else
jmp 0:_clk_driver jmp 0:_clk_driver
%endif
call near forceEnableA20 call near forceEnableA20
global _CharMapSrvc ; in _DATA (see AARD) global _CharMapSrvc ; in _DATA (see AARD)

View File

@ -54,8 +54,9 @@ CFLAGSC=
# -Wno-pointer-to-int-cast do not warn about FP_OFF # -Wno-pointer-to-int-cast do not warn about FP_OFF
# -Wno-pragmas do not warn about #pragma pack # -Wno-pragmas do not warn about #pragma pack
# -Werror treat all warnings as errors # -Werror treat all warnings as errors
# -mfar-function-if-far-return-type treat `int __far f ();' as a far function
ALLCFLAGS+=-I../hdr $(TARGETOPT) -mcmodel=small -fleading-underscore -fno-common -fpack-struct -ffreestanding -fcall-used-es -mrtd -Wno-pointer-to-int-cast -Wno-pragmas -Werror -Os -fno-strict-aliasing ALLCFLAGS+=-I../hdr $(TARGETOPT) -mcmodel=small -fleading-underscore -fno-common -fpack-struct -ffreestanding -fcall-used-es -mrtd -Wno-pointer-to-int-cast -Wno-pragmas -Werror -Os -fno-strict-aliasing -mfar-function-if-far-return-type
INITCFLAGS=$(ALLCFLAGS) -o $@ INITCFLAGS=$(ALLCFLAGS) -o $@
CFLAGS=$(ALLCFLAGS) -o $@ CFLAGS=$(ALLCFLAGS) -o $@