diff --git a/.gitattributes b/.gitattributes index d427a2f666..db5ce8e0cc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9308,6 +9308,7 @@ rtl/haiku/unxconst.inc svneol=native#text/plain rtl/haiku/unxfunc.inc svneol=native#text/plain rtl/i386/cpu.pp svneol=native#text/plain rtl/i386/cpuh.inc svneol=native#text/plain +rtl/i386/cpuinnr.inc svneol=native#text/plain rtl/i386/fastmove.inc svneol=native#text/plain rtl/i386/i386.inc svneol=native#text/plain rtl/i386/int64p.inc svneol=native#text/plain @@ -9323,6 +9324,7 @@ rtl/i386/strings.inc svneol=native#text/plain rtl/i386/stringss.inc svneol=native#text/plain rtl/i8086/cpu.pp svneol=native#text/plain rtl/i8086/cpuh.inc svneol=native#text/plain +rtl/i8086/cpuinnr.inc svneol=native#text/plain rtl/i8086/hugeptr.inc svneol=native#text/plain rtl/i8086/i8086.inc svneol=native#text/plain rtl/i8086/int32p.inc svneol=native#text/plain @@ -10527,6 +10529,7 @@ rtl/wince/wininc/struct.inc svneol=native#text/plain rtl/wince/winres.inc svneol=native#text/plain rtl/x86_64/cpu.pp svneol=native#text/pascal rtl/x86_64/cpuh.inc svneol=native#text/plain +rtl/x86_64/cpuinnr.inc svneol=native#text/plain rtl/x86_64/int64p.inc svneol=native#text/plain rtl/x86_64/makefile.cpu svneol=native#text/plain rtl/x86_64/math.inc svneol=native#text/plain diff --git a/rtl/i386/cpuh.inc b/rtl/i386/cpuh.inc index 7eaa8fce54..a6547baf19 100644 --- a/rtl/i386/cpuh.inc +++ b/rtl/i386/cpuh.inc @@ -15,6 +15,7 @@ **********************************************************************} const + {$I cpuinnr.inc} { Always i386 or newer } Test8086 : byte = 2; { Always 387 or newer. Emulated if needed. } diff --git a/rtl/i386/cpuinnr.inc b/rtl/i386/cpuinnr.inc new file mode 100644 index 0000000000..374e84fdd0 --- /dev/null +++ b/rtl/i386/cpuinnr.inc @@ -0,0 +1,20 @@ +{ + + This file is part of the Free Pascal run time library. + Copyright (c) 2018 by the Free Pascal development team. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + + fpc_in_x86_inportb = fpc_in_cpu_first; + fpc_in_x86_inportw = fpc_in_cpu_first+1; + fpc_in_x86_inportl = fpc_in_cpu_first+2; + fpc_in_x86_outportb = fpc_in_cpu_first+3; + fpc_in_x86_outportw = fpc_in_cpu_first+4; + fpc_in_x86_outportl = fpc_in_cpu_first+5; diff --git a/rtl/i8086/cpuh.inc b/rtl/i8086/cpuh.inc index 12b9df5c7c..3702b9328e 100644 --- a/rtl/i8086/cpuh.inc +++ b/rtl/i8086/cpuh.inc @@ -15,6 +15,7 @@ **********************************************************************} const + {$I cpuinnr.inc} { will be detected at startup } { 0=8086/8088/80186/80188/NEC V20/NEC V30, 1=80286, 2=80386 or newer } Test8086 : byte = 0; public name '__Test8086'; diff --git a/rtl/i8086/cpuinnr.inc b/rtl/i8086/cpuinnr.inc new file mode 100644 index 0000000000..6eb609de27 --- /dev/null +++ b/rtl/i8086/cpuinnr.inc @@ -0,0 +1,20 @@ +{ + + This file is part of the Free Pascal run time library. + Copyright (c) 2018 by the Free Pascal development team. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + + fpc_in_x86_inportb = fpc_in_cpu_first; + fpc_in_x86_inportw = fpc_in_cpu_first+1; +// fpc_in_x86_inportl = fpc_in_cpu_first+2; + fpc_in_x86_outportb = fpc_in_cpu_first+3; + fpc_in_x86_outportw = fpc_in_cpu_first+4; +// fpc_in_x86_outportl = fpc_in_cpu_first+5; diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc index dd8c382f1f..08df955d8b 100644 --- a/rtl/inc/systemh.inc +++ b/rtl/inc/systemh.inc @@ -692,6 +692,9 @@ type (* means that default handling should be used. *) TCtrlBreakHandler = function (CtrlBreak: boolean): boolean; +{ Numbers for routines that have compiler magic } +{$I innr.inc} + { CPU specific stuff } {$i cpuh.inc} @@ -791,9 +794,6 @@ Var function StackTop: Pointer; -{ Numbers for routines that have compiler magic } -{$I innr.inc} - {**************************************************************************** Processor specific routines diff --git a/rtl/msdos/ports.pp b/rtl/msdos/ports.pp index 3b603506c3..b4f9f7f5fb 100644 --- a/rtl/msdos/ports.pp +++ b/rtl/msdos/ports.pp @@ -47,14 +47,6 @@ var portw : tportw; portl : tportl; -const - fpc_in_x86_inportb = fpc_in_cpu_first; - fpc_in_x86_inportw = fpc_in_cpu_first+1; -// fpc_in_x86_inportl = fpc_in_cpu_first+2; - fpc_in_x86_outportb = fpc_in_cpu_first+3; - fpc_in_x86_outportw = fpc_in_cpu_first+4; -// fpc_in_x86_outportl = fpc_in_cpu_first+5; - function inportb(port : word) : byte;[internproc:fpc_in_x86_inportb]; function inportw(port : word) : word;[internproc:fpc_in_x86_inportw]; //function inportl(port : word) : longint;[internproc:fpc_in_x86_inportl]; diff --git a/rtl/x86_64/cpuh.inc b/rtl/x86_64/cpuh.inc index e3f3caf416..b2e6610bec 100644 --- a/rtl/x86_64/cpuh.inc +++ b/rtl/x86_64/cpuh.inc @@ -13,3 +13,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************} + +const + {$I cpuinnr.inc} diff --git a/rtl/x86_64/cpuinnr.inc b/rtl/x86_64/cpuinnr.inc new file mode 100644 index 0000000000..374e84fdd0 --- /dev/null +++ b/rtl/x86_64/cpuinnr.inc @@ -0,0 +1,20 @@ +{ + + This file is part of the Free Pascal run time library. + Copyright (c) 2018 by the Free Pascal development team. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + + fpc_in_x86_inportb = fpc_in_cpu_first; + fpc_in_x86_inportw = fpc_in_cpu_first+1; + fpc_in_x86_inportl = fpc_in_cpu_first+2; + fpc_in_x86_outportb = fpc_in_cpu_first+3; + fpc_in_x86_outportw = fpc_in_cpu_first+4; + fpc_in_x86_outportl = fpc_in_cpu_first+5;