diff --git a/docs/build.txt b/docs/build.txt index fa64cf8..2e913e5 100644 --- a/docs/build.txt +++ b/docs/build.txt @@ -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 https://launchpad.net/~tkchia/+archive/ubuntu/build-ia16/. 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: ====== diff --git a/hdr/portab.h b/hdr/portab.h index 2abd402..54e3198 100644 --- a/hdr/portab.h +++ b/hdr/portab.h @@ -337,7 +337,11 @@ typedef signed long LONG; #define FP_SEG(fp) ((unsigned)((ULONG)(VOID FAR *)(fp)>>16)) #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)) +#endif #endif #endif diff --git a/kernel/kernel.asm b/kernel/kernel.asm index 5f9f866..71c53ea 100644 --- a/kernel/kernel.asm +++ b/kernel/kernel.asm @@ -938,18 +938,6 @@ global %1lshrsi3 ; reserve space for far jump to cp/m routine 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 segment HMA_TEXT_END global __HMATextEnd @@ -1042,21 +1030,13 @@ _cpm_entry: jmp 0:reloc_call_cpm_entry global _reloc_call_blk_driver extern _blk_driver _reloc_call_blk_driver: -%ifdef gcc - jmp 0:blk_driver_wrap -%else jmp 0:_blk_driver -%endif call near forceEnableA20 global _reloc_call_clk_driver extern _clk_driver _reloc_call_clk_driver: -%ifdef gcc - jmp 0:clk_driver_wrap -%else jmp 0:_clk_driver -%endif call near forceEnableA20 global _CharMapSrvc ; in _DATA (see AARD) diff --git a/mkfiles/gcc.mak b/mkfiles/gcc.mak index 0e167b1..dea06e2 100644 --- a/mkfiles/gcc.mak +++ b/mkfiles/gcc.mak @@ -54,8 +54,9 @@ CFLAGSC= # -Wno-pointer-to-int-cast do not warn about FP_OFF # -Wno-pragmas do not warn about #pragma pack # -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 $@ CFLAGS=$(ALLCFLAGS) -o $@