Browse Source

* updated the go32 unit port access functions to use the new x86 port access
compiler intrinsics

git-svn-id: trunk@39385 -

nickysn 7 years ago
parent
commit
25cd354f87
1 changed files with 43 additions and 0 deletions
  1. 43 0
      rtl/go32v2/go32.pp

+ 43 - 0
rtl/go32v2/go32.pp

@@ -15,6 +15,7 @@
 unit go32;
 
 {$S-,R-,I-,Q-} {no stack check, used by DPMIEXCP !! }
+{$inline ON}
 
 interface
 
@@ -159,6 +160,7 @@ interface
     procedure disable;
     procedure enable;
 
+{$ifdef VER3_0}
     function inportb(port : word) : byte;
     function inportw(port : word) : word;
     function inportl(port : word) : longint;
@@ -166,6 +168,15 @@ interface
     procedure outportb(port : word;data : byte);
     procedure outportw(port : word;data : word);
     procedure outportl(port : word;data : longint);
+{$else VER3_0}
+    function inportb(port : word) : byte;inline;
+    function inportw(port : word) : word;inline;
+    function inportl(port : word) : longint;inline;
+
+    procedure outportb(port : word;data : byte);inline;
+    procedure outportw(port : word;data : word);inline;
+    procedure outportl(port : word;data : longint);inline;
+{$endif VER3_0}
     function get_run_mode : word;
 
     function transfer_buffer : longint;
@@ -447,6 +458,7 @@ interface
            end ['ECX','EAX'];
       end;
 
+{$ifdef VER3_0}
     procedure outportb(port : word;data : byte);
 
       begin
@@ -506,6 +518,37 @@ interface
             movl %eax,__RESULT
          end ['EAX','EDX'];
       end;
+{$else VER3_0}
+    procedure outportb(port : word;data : byte);inline;
+      begin
+	    fpc_x86_outportb(port,data);
+      end;
+
+    procedure outportw(port : word;data : word);inline;
+      begin
+	    fpc_x86_outportw(port,data);
+      end;
+
+    procedure outportl(port : word;data : longint);inline;
+      begin
+	    fpc_x86_outportl(port,data);
+      end;
+
+    function inportb(port : word) : byte;inline;
+      begin
+	    inportb:=fpc_x86_inportb(port);
+      end;
+
+    function inportw(port : word) : word;inline;
+      begin
+	    inportw:=fpc_x86_inportw(port);
+      end;
+
+    function inportl(port : word) : longint;inline;
+      begin
+	    inportl:=fpc_x86_inportl(port);
+      end;
+{$endif VER3_0}