Browse Source

* moved halt to system.inc
* syslinux doesn't use direct asm anymore

peter 25 years ago
parent
commit
6c15031ffd
3 changed files with 72 additions and 60 deletions
  1. 13 3
      rtl/inc/real2str.inc
  2. 41 30
      rtl/inc/system.inc
  3. 18 27
      rtl/linux/syslinux.pp

+ 13 - 3
rtl/inc/real2str.inc

@@ -77,26 +77,32 @@ const
       zero   = '0000000000000000000000000000000000000000';
 
 type
+{$ifdef SUPPORT_EXTENDED}
   TSplitExtended = packed record
     case byte of
       0: (bytes: Array[0..9] of byte);
       1: (words: Array[0..4] of word);
       2: (cards: Array[0..1] of cardinal; w: word);
   end;
-
+{$else}
+{$ifdef SUPPORT_DOUBLE}
   TSplitDouble = packed record
     case byte of
       0: (bytes: Array[0..7] of byte);
       1: (words: Array[0..3] of word);
       2: (cards: Array[0..1] of cardinal);
   end;
-
+{$else}
+{$ifdef SUPPORT_SINGLE}
   TSplitSingle = packed record
     case byte of
       0: (bytes: Array[0..3] of byte);
       1: (words: Array[0..1] of word);
       2: (cards: Array[0..0] of cardinal);
   end;
+{$endif SUPPORT_SINGLE}
+{$endif SUPPORT_DOUBLE}
+{$endif SUPPORT_EXTENDED}
 
 var correct : longint;  { Power correction }
     currprec : longint;
@@ -347,7 +353,11 @@ end;
 
 {
   $Log$
-  Revision 1.20  2000-01-17 13:00:51  jonas
+  Revision 1.21  2000-02-09 12:17:51  peter
+    * moved halt to system.inc
+    * syslinux doesn't use direct asm anymore
+
+  Revision 1.20  2000/01/17 13:00:51  jonas
     + support for NaN's, cleaner support for Inf
 
   Revision 1.19  2000/01/07 16:41:36  daniel

+ 41 - 30
rtl/inc/system.inc

@@ -416,6 +416,42 @@ end;
                           Error / Exit / ExitProc
 *****************************************************************************}
 
+Procedure system_exit;forward;
+
+Procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
+var
+  current_exit : Procedure;
+Begin
+  while exitProc<>nil Do
+   Begin
+     InOutRes:=0;
+     current_exit:=tProcedure(exitProc);
+     exitProc:=nil;
+     current_exit();
+   End;
+  { Finalize units }
+  FinalizeUnits;
+  { Show runtime error }
+  If erroraddr<>nil Then
+   Begin
+     Writeln(stdout,'Runtime error ',Errorcode,' at 0x',hexstr(Longint(Erroraddr),8));
+     { to get a nice symify }
+     Writeln(stdout,BackTraceStrFunc(Longint(Erroraddr)));
+     dump_stack(stdout,ErrorBase);
+     Writeln(stdout,'');
+   End;
+  { call system dependent exit code }
+  System_exit;
+End;
+
+
+Procedure Halt(ErrNum: Byte);
+Begin
+  ExitCode:=Errnum;
+  Do_Exit;
+end;
+
+
 function SysBackTraceStr (Addr: longint): ShortString;
 begin
   SysBackTraceStr:='  0x'+HexStr(addr,8);
@@ -492,35 +528,6 @@ Begin
 End;
 
 
-Procedure system_exit;forward;
-
-Procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
-var
-  current_exit : Procedure;
-Begin
-  while exitProc<>nil Do
-   Begin
-     InOutRes:=0;
-     current_exit:=tProcedure(exitProc);
-     exitProc:=nil;
-     current_exit();
-   End;
-  { Finalize units }
-  FinalizeUnits;
-  { Show runtime error }
-  If erroraddr<>nil Then
-   Begin
-     Writeln(stdout,'Runtime error ',Errorcode,' at 0x',hexstr(Longint(Erroraddr),8));
-     { to get a nice symify }
-     Writeln(stdout,BackTraceStrFunc(Longint(Erroraddr)));
-     dump_stack(stdout,ErrorBase);
-     Writeln(stdout,'');
-   End;
-  { call system dependent exit code }
-  System_exit;
-End;
-
-
 Type
   PExitProcInfo = ^TExitProcInfo;
   TExitProcInfo = Record
@@ -605,7 +612,11 @@ end;
 
 {
   $Log$
-  Revision 1.81  2000-02-06 17:19:22  peter
+  Revision 1.82  2000-02-09 12:17:51  peter
+    * moved halt to system.inc
+    * syslinux doesn't use direct asm anymore
+
+  Revision 1.81  2000/02/06 17:19:22  peter
     * lineinfo unit added which uses stabs to get lineinfo for backtraces
 
   Revision 1.80  2000/01/10 09:54:30  peter

+ 18 - 27
rtl/linux/syslinux.pp

@@ -84,21 +84,17 @@ Implementation
                        Misc. System Dependent Functions
 *****************************************************************************}
 
-{$ifdef i386}
-  {$ASMMODE DIRECT}
-{$endif}
+procedure prthaltproc;external name '_haltproc';
 
-Procedure Halt(ErrNum: Byte);
-Begin
-  ExitCode:=Errnum;
-  Do_Exit;
+procedure System_exit;
+begin
 {$ifdef i386}
   asm
-        jmp     _haltproc
+        jmp     prthaltproc
   end;
 {$else}
   asm
-        jmp     _haltproc
+        jmp     prthaltproc
   end;
 {$endif}
 End;
@@ -139,11 +135,7 @@ end;
 
 Procedure Randomize;
 Begin
-{$ifdef crtlib}
-  _rtl_gettime(longint(@randseed));
-{$else}
   randseed:=sys_time;
-{$endif}
 End;
 
 
@@ -151,14 +143,18 @@ End;
                               Heap Management
 *****************************************************************************}
 
+var
+  _HEAP : longint;external name 'HEAP';
+  _HEAPSIZE : longint;external name 'HEAPSIZE';
+
 function getheapstart:pointer;assembler;
 {$ifdef i386}
 asm
-        leal    HEAP,%eax
+        leal    _HEAP,%eax
 end ['EAX'];
 {$else}
 asm
-        lea.l   HEAP,a0
+        lea.l   _HEAP,a0
         move.l  a0,d0
 end;
 {$endif}
@@ -167,11 +163,11 @@ end;
 function getheapsize:longint;assembler;
 {$ifdef i386}
 asm
-        movl    HEAPSIZE,%eax
+        movl    _HEAPSIZE,%eax
 end ['EAX'];
 {$else}
 asm
-       move.l   HEAP_SIZE,d0
+       move.l   _HEAPSIZE,d0
 end ['D0'];
 {$endif}
 
@@ -623,15 +619,6 @@ begin
 end;
 
 
-{*****************************************************************************
-                         System Dependent Exit code
-*****************************************************************************}
-
-Procedure system_exit;
-begin
-end;
-
-
 {*****************************************************************************
                          SystemUnit Initialization
 *****************************************************************************}
@@ -735,7 +722,11 @@ End.
 
 {
   $Log$
-  Revision 1.35  2000-02-08 11:47:09  peter
+  Revision 1.36  2000-02-09 12:17:51  peter
+    * moved halt to system.inc
+    * syslinux doesn't use direct asm anymore
+
+  Revision 1.35  2000/02/08 11:47:09  peter
     * paramstr(0) support
 
   Revision 1.34  2000/01/20 23:38:02  peter