瀏覽代碼

* sparc fixes

peter 22 年之前
父節點
當前提交
1b633246b9

+ 18 - 13
compiler/ncgadd.pas

@@ -228,20 +228,18 @@ interface
     procedure tcgaddnode.release_reg_left_right;
     procedure tcgaddnode.release_reg_left_right;
       begin
       begin
         if (right.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
         if (right.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
-           ((location.loc<>LOC_REGISTER) or
-            (
-             (location.register.enum <> right.location.register.enum) and
-             (location.register.number <> right.location.register.number)
-            )
-           ) then
+           not(
+               (location.loc=LOC_REGISTER) and
+               (location.register.enum=right.location.register.enum) and
+               (location.register.number=right.location.register.number)
+              ) then
           location_release(exprasmlist,right.location);
           location_release(exprasmlist,right.location);
         if (left.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
         if (left.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
-           ((location.loc<>LOC_REGISTER) or
-            (
-             (location.register.enum <> left.location.register.enum) and
-             (location.register.number <> left.location.register.number)
-            )
-           ) then
+           not(
+               (location.loc=LOC_REGISTER) and
+               (location.register.enum=left.location.register.enum) and
+               (location.register.number=left.location.register.number)
+              ) then
           location_release(exprasmlist,left.location);
           location_release(exprasmlist,left.location);
       end;
       end;
 
 
@@ -568,6 +566,8 @@ interface
         { emit overflow check if enabled }
         { emit overflow check if enabled }
         if checkoverflow then
         if checkoverflow then
            cg.g_overflowcheck(exprasmlist,Location,ResultType.Def);
            cg.g_overflowcheck(exprasmlist,Location,ResultType.Def);
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -697,6 +697,8 @@ interface
         { emit overflow check if required }
         { emit overflow check if required }
         if checkoverflow then
         if checkoverflow then
           cg.g_overflowcheck(exprasmlist,Location,ResultType.Def);
           cg.g_overflowcheck(exprasmlist,Location,ResultType.Def);
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -752,7 +754,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  2003-07-06 17:44:12  peter
+  Revision 1.15  2003-07-08 21:24:59  peter
+    * sparc fixes
+
+  Revision 1.14  2003/07/06 17:44:12  peter
     * cleanup and first sparc implementation
     * cleanup and first sparc implementation
 
 
   Revision 1.13  2003/06/12 16:43:07  peter
   Revision 1.13  2003/06/12 16:43:07  peter

+ 35 - 21
compiler/ncgcal.pas

@@ -59,6 +59,7 @@ interface
           function  align_parasize:longint;virtual;
           function  align_parasize:longint;virtual;
           procedure pop_parasize(pop_size:longint);virtual;
           procedure pop_parasize(pop_size:longint);virtual;
           procedure push_framepointer;virtual;
           procedure push_framepointer;virtual;
+          procedure free_pushed_framepointer;virtual;
           procedure extra_interrupt_code;virtual;
           procedure extra_interrupt_code;virtual;
        public
        public
           procedure pass_2;override;
           procedure pass_2;override;
@@ -390,6 +391,12 @@ implementation
       end;
       end;
 
 
 
 
+    procedure tcgcallnode.free_pushed_framepointer;
+      begin
+        paramanager.freeintparaloc(exprasmlist,1);
+      end;
+
+
     procedure tcgcallnode.handle_return_value;
     procedure tcgcallnode.handle_return_value;
       var
       var
         cgsize : tcgsize;
         cgsize : tcgsize;
@@ -651,7 +658,6 @@ implementation
       {$endif}
       {$endif}
          pushedother : tpushedsavedother;
          pushedother : tpushedsavedother;
          oldpushedparasize : longint;
          oldpushedparasize : longint;
-         paraitem : tparaitem;
          { adress returned from an I/O-error }
          { adress returned from an I/O-error }
          iolabel : tasmlabel;
          iolabel : tasmlabel;
          { help reference pointer }
          { help reference pointer }
@@ -664,6 +670,26 @@ implementation
 {$endif x86}
 {$endif x86}
          vmtreg,vmtreg2 : tregister;
          vmtreg,vmtreg2 : tregister;
          oldaktcallnode : tcallnode;
          oldaktcallnode : tcallnode;
+
+         procedure freeparas;
+         var
+           paraitem : tparaitem;
+         begin
+           { free the resources allocated for the parameters }
+           paraitem:=tparaitem(procdefinition.para.first);
+           while assigned(paraitem) do
+             begin
+               paramanager.freeparaloc(exprasmlist,paraitem.callerparaloc);
+               paraitem:=tparaitem(paraitem.next);
+             end;
+           { free pushed base pointer }
+           if (right=nil) and
+              (current_procinfo.procdef.parast.symtablelevel>=normal_function_level) and
+              assigned(tprocdef(procdefinition).parast) and
+              ((tprocdef(procdefinition).parast.symtablelevel)>normal_function_level) then
+             free_pushed_framepointer;
+         end;
+
       begin
       begin
          if not assigned(procdefinition) then
          if not assigned(procdefinition) then
            internalerror(200305264);
            internalerror(200305264);
@@ -920,12 +946,7 @@ implementation
                    cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,vmtreg,vmtreg2);
                    cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,vmtreg,vmtreg2);
 {$endif newra}
 {$endif newra}
                    { free the resources allocated for the parameters }
                    { free the resources allocated for the parameters }
-                   paraitem:=tparaitem(procdefinition.para.first);
-                   while assigned(paraitem) do
-                     begin
-                       paramanager.freeparaloc(exprasmlist,paraitem.callerparaloc);
-                       paraitem:=tparaitem(paraitem.next);
-                     end;
+                   freeparas;
 
 
 {$ifdef newra}
 {$ifdef newra}
                    rg.allocexplicitregistersint(exprasmlist,regs_to_alloc);
                    rg.allocexplicitregistersint(exprasmlist,regs_to_alloc);
@@ -941,13 +962,8 @@ implementation
                 end
                 end
               else
               else
                 begin
                 begin
-                 { free the resources allocated for the parameters }
-                  paraitem:=tparaitem(procdefinition.para.first);
-                  while assigned(paraitem) do
-                    begin
-                      paramanager.freeparaloc(exprasmlist,paraitem.callerparaloc);
-                      paraitem:=tparaitem(paraitem.next);
-                    end;
+                  { free the resources allocated for the parameters }
+                  freeparas;
 
 
 {$ifdef newra}
 {$ifdef newra}
                   rg.allocexplicitregistersint(exprasmlist,regs_to_alloc);
                   rg.allocexplicitregistersint(exprasmlist,regs_to_alloc);
@@ -992,12 +1008,7 @@ implementation
 {$endif newra}
 {$endif newra}
 
 
               { free the resources allocated for the parameters }
               { free the resources allocated for the parameters }
-              paraitem:=tparaitem(procdefinition.para.first);
-              while assigned(paraitem) do
-                begin
-                  paramanager.freeparaloc(exprasmlist,paraitem.callerparaloc);
-                  paraitem:=tparaitem(paraitem.next);
-                end;
+              freeparas;
 
 
 {$ifdef newra}
 {$ifdef newra}
               rg.allocexplicitregistersint(exprasmlist,regs_to_alloc);
               rg.allocexplicitregistersint(exprasmlist,regs_to_alloc);
@@ -1518,7 +1529,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.100  2003-07-06 21:50:33  jonas
+  Revision 1.101  2003-07-08 21:24:59  peter
+    * sparc fixes
+
+  Revision 1.100  2003/07/06 21:50:33  jonas
     * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
     * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
       so that it doesn't include ebp and esp anymore
       so that it doesn't include ebp and esp anymore
 
 

+ 5 - 2
compiler/paramgr.pas

@@ -56,7 +56,7 @@ unit paramgr;
           { Returns true if a parameter needs to be copied on the stack, this
           { Returns true if a parameter needs to be copied on the stack, this
             is required for cdecl procedures
             is required for cdecl procedures
           }
           }
-          function copy_value_on_stack(def : tdef;calloption : tproccalloption) : boolean;
+          function copy_value_on_stack(def : tdef;calloption : tproccalloption) : boolean;virtual;
           {# Returns a structure giving the information on
           {# Returns a structure giving the information on
             the storage of the parameter (which must be
             the storage of the parameter (which must be
             an integer parameter). This is only used when calling
             an integer parameter). This is only used when calling
@@ -443,7 +443,10 @@ end.
 
 
 {
 {
    $Log$
    $Log$
-   Revision 1.48  2003-07-05 20:11:41  jonas
+   Revision 1.49  2003-07-08 21:24:59  peter
+     * sparc fixes
+
+   Revision 1.48  2003/07/05 20:11:41  jonas
      * create_paraloc_info() is now called separately for the caller and
      * create_paraloc_info() is now called separately for the caller and
        callee info
        callee info
      * fixed ppc cycle
      * fixed ppc cycle

+ 10 - 1
compiler/powerpc/nppccal.pas

@@ -33,6 +33,7 @@ interface
        tppccallnode = class(tcgcallnode)
        tppccallnode = class(tcgcallnode)
           function pass_1 : tnode;override;
           function pass_1 : tnode;override;
           procedure push_framepointer;override;
           procedure push_framepointer;override;
+          procedure free_pushed_framepointer;override;
        end;
        end;
 
 
 implementation
 implementation
@@ -120,12 +121,20 @@ implementation
          internalerror(2002081303);
          internalerror(2002081303);
     end;
     end;
 
 
+
+  procedure tppccallnode.free_pushed_framepointer;
+    begin
+    end;
+
 begin
 begin
    ccallnode:=tppccallnode;
    ccallnode:=tppccallnode;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.19  2003-07-06 20:25:03  jonas
+  Revision 1.20  2003-07-08 21:24:59  peter
+    * sparc fixes
+
+  Revision 1.19  2003/07/06 20:25:03  jonas
     * fixed ppc compiler
     * fixed ppc compiler
 
 
   Revision 1.18  2003/06/13 21:19:32  peter
   Revision 1.18  2003/06/13 21:19:32  peter

+ 6 - 1
compiler/pstatmnt.pas

@@ -1140,6 +1140,7 @@ implementation
          include(current_procinfo.flags,pi_is_assembler);
          include(current_procinfo.flags,pi_is_assembler);
          p:=_asm_statement;
          p:=_asm_statement;
 
 
+{$ifndef sparc}
          { set the framepointer to esp for assembler functions when the
          { set the framepointer to esp for assembler functions when the
            following conditions are met:
            following conditions are met:
            - if the are no local variables (except the allocated result)
            - if the are no local variables (except the allocated result)
@@ -1171,6 +1172,7 @@ implementation
                  then
                  then
                  OptimizeFramePointer(tasmnode(p));
                  OptimizeFramePointer(tasmnode(p));
             end;
             end;
+{$endif sparc}
 
 
         { Flag the result as assigned when it is returned in a
         { Flag the result as assigned when it is returned in a
           register.
           register.
@@ -1189,7 +1191,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.105  2003-06-17 16:34:44  jonas
+  Revision 1.106  2003-07-08 21:24:59  peter
+    * sparc fixes
+
+  Revision 1.105  2003/06/17 16:34:44  jonas
     * lots of newra fixes (need getfuncretparaloc implementation for i386)!
     * lots of newra fixes (need getfuncretparaloc implementation for i386)!
     * renamed all_intregisters to volatile_intregisters and made it
     * renamed all_intregisters to volatile_intregisters and made it
       processor dependent
       processor dependent

+ 10 - 5
compiler/sparc/cgcpu.pas

@@ -119,8 +119,8 @@ implementation
           InternalError(2002100804);
           InternalError(2002100804);
         result :=not(assigned(ref.symbol))and
         result :=not(assigned(ref.symbol))and
                   (((ref.index.number = NR_NO) and
                   (((ref.index.number = NR_NO) and
-                   (ref.offset >= low(smallint)) and
-                    (ref.offset <= high(smallint))) or
+                   (ref.offset >= simm13lo) and
+                    (ref.offset <= simm13hi)) or
                   ((ref.index.number <> NR_NO) and
                   ((ref.index.number <> NR_NO) and
                   (ref.offset = 0)));
                   (ref.offset = 0)));
       end;
       end;
@@ -1005,7 +1005,8 @@ implementation
          if not issimpleref(source) or
          if not issimpleref(source) or
             (
             (
               (source.index.number<>NR_NO) and
               (source.index.number<>NR_NO) and
-              ((source.offset+longint(len))>high(smallint))
+              (((source.offset+longint(len))>simm13hi) or
+               ((source.offset+longint(len))<simm13lo))
             ) then
             ) then
            begin
            begin
 {$ifdef newra}
 {$ifdef newra}
@@ -1027,7 +1028,8 @@ implementation
         if not issimpleref(dest) or
         if not issimpleref(dest) or
            (
            (
             (dest.index.number<>NR_NO) and
             (dest.index.number<>NR_NO) and
-            ((dest.offset + longint(len)) > high(smallint))
+            (((dest.offset + longint(len)) > simm13hi) or
+             ((dest.offset + longint(len)) < simm13lo))
            ) then
            ) then
           begin
           begin
 {$ifdef newra}
 {$ifdef newra}
@@ -1255,7 +1257,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.64  2003-07-06 22:10:13  peter
+  Revision 1.65  2003-07-08 21:24:59  peter
+    * sparc fixes
+
+  Revision 1.64  2003/07/06 22:10:13  peter
     * operand order of cmp fixed
     * operand order of cmp fixed
 
 
   Revision 1.63  2003/07/06 17:58:22  peter
   Revision 1.63  2003/07/06 17:58:22  peter

+ 9 - 5
compiler/sparc/cpugas.pas

@@ -48,11 +48,10 @@ unit cpugas;
           begin
           begin
             inc(offset,offsetfixup);
             inc(offset,offsetfixup);
             offsetfixup:=0;
             offsetfixup:=0;
-            if assigned(symbol) then
+            if (base.number=NR_NO) and (index.number=NR_NO) then
               begin
               begin
-                 if (base.number<>NR_NO) or (index.number<>NR_NO) then
-                   internalerror(2003052601);
-                 GetReferenceString:=symbol.name;
+                 if assigned(symbol) then
+                   GetReferenceString:=symbol.name;
                  if offset>0 then
                  if offset>0 then
                    GetReferenceString:=GetReferenceString+'+'+ToStr(offset)
                    GetReferenceString:=GetReferenceString+'+'+ToStr(offset)
                  else if offset<0 then
                  else if offset<0 then
@@ -66,6 +65,8 @@ unit cpugas;
               end
               end
             else
             else
               begin
               begin
+                if assigned(symbol) then
+                  internalerror(2003052601);
                 GetReferenceString:='[';
                 GetReferenceString:='[';
                 if base.number<>NR_NO then
                 if base.number<>NR_NO then
                   GetReferenceString:=GetReferenceString+std_reg2str[base.enum];
                   GetReferenceString:=GetReferenceString+std_reg2str[base.enum];
@@ -204,7 +205,10 @@ begin
 end.
 end.
 {
 {
     $Log$
     $Log$
-    Revision 1.20  2003-07-02 22:18:04  peter
+    Revision 1.21  2003-07-08 21:25:00  peter
+      * sparc fixes
+
+    Revision 1.20  2003/07/02 22:18:04  peter
       * paraloc splitted in callerparaloc,calleeparaloc
       * paraloc splitted in callerparaloc,calleeparaloc
       * sparc calling convention updates
       * sparc calling convention updates
 
 

+ 35 - 2
compiler/sparc/cpupara.pas

@@ -26,11 +26,13 @@ interface
 
 
     uses
     uses
       cpubase,
       cpubase,
-      aasmtai,
+      aasmtai,globtype,
       symconst,symbase,symtype,symdef,paramgr;
       symconst,symbase,symtype,symdef,paramgr;
 
 
     type
     type
       TSparcParaManager=class(TParaManager)
       TSparcParaManager=class(TParaManager)
+        function copy_value_on_stack(def : tdef;calloption : tproccalloption) : boolean;override;
+        function push_addr_param(def : tdef;calloption : tproccalloption) : boolean;override;
         {Returns a structure giving the information on the storage of the parameter
         {Returns a structure giving the information on the storage of the parameter
         (which must be an integer parameter)
         (which must be an integer parameter)
         @param(nr Parameter number of routine, starting from 1)}
         @param(nr Parameter number of routine, starting from 1)}
@@ -54,6 +56,34 @@ implementation
       cpuinfo,cginfo,cgbase,
       cpuinfo,cginfo,cgbase,
       defutil,rgobj;
       defutil,rgobj;
 
 
+    function tsparcparamanager.copy_value_on_stack(def : tdef;calloption : tproccalloption) : boolean;
+      begin
+        result:=false;
+      end;
+
+
+    { true if a parameter is too large to copy and only the address is pushed }
+    function tsparcparamanager.push_addr_param(def : tdef;calloption : tproccalloption) : boolean;
+      begin
+        push_addr_param:=false;
+        case def.deftype of
+          recorddef,
+          arraydef,
+          variantdef,
+          formaldef :
+            push_addr_param:=true;
+          objectdef :
+            push_addr_param:=is_object(def);
+          stringdef :
+            push_addr_param:=(tstringdef(def).string_typ in [st_shortstring,st_longstring]);
+          procvardef :
+            push_addr_param:=(po_methodpointer in tprocvardef(def).procoptions);
+          setdef :
+            push_addr_param:=(tsetdef(def).settype<>smallset);
+        end;
+      end;
+
+
     function TSparcParaManager.GetIntParaLoc(List:TAasmOutput;nr:longint):TParaLocation;
     function TSparcParaManager.GetIntParaLoc(List:TAasmOutput;nr:longint):TParaLocation;
       begin
       begin
         if nr<1 then
         if nr<1 then
@@ -278,7 +308,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  2003-07-06 22:10:56  peter
+  Revision 1.26  2003-07-08 21:25:00  peter
+    * sparc fixes
+
+  Revision 1.25  2003/07/06 22:10:56  peter
     * big endian first allocates high
     * big endian first allocates high
 
 
   Revision 1.24  2003/07/06 17:58:22  peter
   Revision 1.24  2003/07/06 17:58:22  peter

+ 17 - 2
compiler/sparc/ncpuadd.pas

@@ -153,7 +153,9 @@ interface
           location.register:=right.location.register;
           location.register:=right.location.register;
 
 
         exprasmlist.concat(taicpu.op_reg_reg_reg(op,
         exprasmlist.concat(taicpu.op_reg_reg_reg(op,
-           left.location.register,right.location.register,location.register))
+           left.location.register,right.location.register,location.register));
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -175,6 +177,8 @@ interface
            left.location.register,right.location.register));
            left.location.register,right.location.register));
         { Delay slot (can only contain integer operation) }
         { Delay slot (can only contain integer operation) }
         exprasmlist.concat(taicpu.op_none(A_NOP));
         exprasmlist.concat(taicpu.op_none(A_NOP));
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -195,6 +199,8 @@ interface
 
 
         location_reset(location,LOC_FLAGS,OS_NO);
         location_reset(location,LOC_FLAGS,OS_NO);
         location.resflags:=getresflags(true);
         location.resflags:=getresflags(true);
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -215,6 +221,8 @@ interface
 
 
         location_reset(location,LOC_FLAGS,OS_NO);
         location_reset(location,LOC_FLAGS,OS_NO);
         location.resflags:=getresflags(true);
         location.resflags:=getresflags(true);
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -228,6 +236,8 @@ interface
 
 
         location_reset(location,LOC_FLAGS,OS_NO);
         location_reset(location,LOC_FLAGS,OS_NO);
         location.resflags:=getresflags(unsigned);
         location.resflags:=getresflags(unsigned);
+
+        release_reg_left_right;
       end;
       end;
 
 
 
 
@@ -252,6 +262,8 @@ interface
 
 
         location_reset(location,LOC_FLAGS,OS_NO);
         location_reset(location,LOC_FLAGS,OS_NO);
         location.resflags:=getresflags(unsigned);
         location.resflags:=getresflags(unsigned);
+
+        release_reg_left_right;
       end;
       end;
 
 
 begin
 begin
@@ -259,7 +271,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2003-07-06 22:09:50  peter
+  Revision 1.18  2003-07-08 21:25:00  peter
+    * sparc fixes
+
+  Revision 1.17  2003/07/06 22:09:50  peter
     * signed compare fixed
     * signed compare fixed
 
 
   Revision 1.16  2003/07/06 17:44:12  peter
   Revision 1.16  2003/07/06 17:44:12  peter

+ 9 - 2
rtl/linux/systypes.inc

@@ -69,13 +69,17 @@ type
 {$ifdef powerpc}
 {$ifdef powerpc}
   dev_t = cardinal;
   dev_t = cardinal;
 {$else powerpc}
 {$else powerpc}
+{$ifdef sparc}
+  dev_t = cardinal;
+{$else sparc}
 {$error dev_t unknown for this processor}
 {$error dev_t unknown for this processor}
+{$endif sparc}
 {$endif powerpc}
 {$endif powerpc}
 {$endif m68k}
 {$endif m68k}
 {$endif i386}
 {$endif i386}
 
 
 { definition of stat record type }
 { definition of stat record type }
-{$i stat.inc}  
+{$i stat.inc}
   PStat=^Stat;
   PStat=^Stat;
   TStat=Stat;
   TStat=Stat;
 
 
@@ -126,7 +130,10 @@ type
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2003-07-08 14:18:40  peter
+  Revision 1.10  2003-07-08 21:23:24  peter
+    * sparc fixes
+
+  Revision 1.9  2003/07/08 14:18:40  peter
     * fdset changed to 1024 bits
     * fdset changed to 1024 bits
 
 
   Revision 1.8  2003/05/15 22:50:50  jonas
   Revision 1.8  2003/05/15 22:50:50  jonas

+ 7 - 1
rtl/linux/unixsysc.inc

@@ -856,6 +856,8 @@ end;
       Port IO functions
       Port IO functions
 --------------------------------}
 --------------------------------}
 
 
+{$ifdef i386}
+
 Function  IOperm (From,Num : Cardinal; Value : Longint) : boolean;
 Function  IOperm (From,Num : Cardinal; Value : Longint) : boolean;
 {
 {
   Set permissions on NUM ports starting with port FROM to VALUE
   Set permissions on NUM ports starting with port FROM to VALUE
@@ -882,10 +884,14 @@ begin
   LinuxError:=Errno;
   LinuxError:=Errno;
 end;
 end;
 
 
+{$endif i386}
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2002-12-18 16:43:26  marco
+  Revision 1.9  2003-07-08 21:23:24  peter
+    * sparc fixes
+
+  Revision 1.8  2002/12/18 16:43:26  marco
    * new unix rtl, linux part.....
    * new unix rtl, linux part.....
 
 
   Revision 1.7  2002/09/07 16:01:20  peter
   Revision 1.7  2002/09/07 16:01:20  peter

+ 9 - 6
rtl/unix/unix.pp

@@ -422,15 +422,15 @@ type
 function MMap(const m:tmmapargs):longint;
 function MMap(const m:tmmapargs):longint;
 function MUnMap (P : Pointer; Size : Longint) : Boolean;
 function MUnMap (P : Pointer; Size : Longint) : Boolean;
 
 
-{**************************
-     Port IO functions
-***************************}
+{***********************************
+  Port IO functions (x86 specific)
+***********************************}
 
 
+{$ifdef i386}
 Function  IOperm (From,Num : Cardinal; Value : Longint) : boolean;
 Function  IOperm (From,Num : Cardinal; Value : Longint) : boolean;
 {$ifndef BSD}
 {$ifndef BSD}
 Function  IoPL(Level : longint) : Boolean;
 Function  IoPL(Level : longint) : Boolean;
 {$endif}
 {$endif}
-{$ifdef i386}
 Procedure WritePort (Port : Longint; Value : Byte);
 Procedure WritePort (Port : Longint; Value : Byte);
 Procedure WritePort (Port : Longint; Value : Word);
 Procedure WritePort (Port : Longint; Value : Word);
 Procedure WritePort (Port : Longint; Value : Longint);
 Procedure WritePort (Port : Longint; Value : Longint);
@@ -449,7 +449,7 @@ function  ReadPortL (Port : Longint): LongInt;
 Procedure ReadPortL (Port : Longint; Var Buf; Count: longint);
 Procedure ReadPortL (Port : Longint; Var Buf; Count: longint);
 Procedure ReadPortW (Port : Longint; Var Buf; Count: longint);
 Procedure ReadPortW (Port : Longint; Var Buf; Count: longint);
 Procedure ReadPortB (Port : Longint; Var Buf; Count: longint);
 Procedure ReadPortB (Port : Longint; Var Buf; Count: longint);
-{$endif}
+{$endif i386}
 
 
 {**************************
 {**************************
     Utility functions
     Utility functions
@@ -3059,7 +3059,10 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.29  2003-05-30 19:58:40  marco
+  Revision 1.30  2003-07-08 21:23:24  peter
+    * sparc fixes
+
+  Revision 1.29  2003/05/30 19:58:40  marco
    * Getting NetBSD/i386 to compile.
    * Getting NetBSD/i386 to compile.
 
 
   Revision 1.28  2003/05/29 19:16:16  marco
   Revision 1.28  2003/05/29 19:16:16  marco