Procházet zdrojové kódy

+ profiling support

carl před 23 roky
rodič
revize
7769191263
4 změnil soubory, kde provedl 172 přidání a 5 odebrání
  1. 67 0
      rtl/win32/gprt0.as
  2. 11 2
      rtl/win32/system.pp
  3. 50 2
      rtl/win32/wprt0.as
  4. 44 1
      rtl/win32/wprt0_10.as

+ 67 - 0
rtl/win32/gprt0.as

@@ -0,0 +1,67 @@
+// Startup code for WIN32 port of Free Pascal
+// with profiling enabled.
+     .text
+     .globl _mainCRTStartup
+_mainCRTStartup:
+     movb   $1,U_SYSTEM_ISCONSOLE
+     call   _FPC_EXE_Entry
+     .globl _WinMainCRTStartup
+_WinMainCRTStartup:
+     movb   $0,U_SYSTEM_ISCONSOLE
+     call   _FPC_EXE_Entry
+     
+     .globl asm_exit
+asm_exit:     
+    pushl  %eax
+    call   __mcleanup
+    popl   %eax
+    pushl  %eax
+	call   exitprocess
+	
+.text
+.globl	exitprocess
+exitprocess:
+	jmp	*.L10
+	.balign 4,144
+	
+.text
+	.balign 4,144
+
+.section .idata$2
+	.rva	.L7
+	.long	0,0
+	.rva	.L6
+	.rva	.L8
+
+.section .idata$4
+.L7:
+	.rva	.L9
+	.long	0
+
+.section .idata$5
+.L8:
+	
+
+.section .idata$5
+.L10:
+	.rva	.L9
+	.long	0
+
+.section .idata$6
+.L9:
+	.short	0
+	.ascii	"ExitProcess\000"
+	.balign 2,0
+
+.section .idata$7
+.L6:
+	.ascii	"kernel32.dll\000"
+     
+
+//
+// $Log$
+// Revision 1.1  2002-11-30 18:17:35  carl
+//   + profiling support
+//
+//
+//

+ 11 - 2
rtl/win32/system.pp

@@ -874,6 +874,7 @@ end;
   procedure PascalMain;external name 'PASCALMAIN';
   procedure fpc_do_exit;external name 'FPC_DO_EXIT';
   Procedure ExitDLL(Exitcode : longint); forward;
+  procedure asm_exit; external name 'asm_exit';
 
 Procedure system_exit;
 begin
@@ -889,7 +890,12 @@ begin
      { what about Input and Output ?? PM }
    end;
   remove_exception_handlers;
-  ExitProcess(ExitCode);
+  { call exitprocess, with cleanup as required }
+  asm
+    xorl %eax, %eax
+    movw exitcode,%ax    
+    call asm_exit
+  end;
 end;
 
 var
@@ -1499,7 +1505,10 @@ end.
 
 {
   $Log$
-  Revision 1.36  2002-10-31 15:17:58  carl
+  Revision 1.37  2002-11-30 18:17:35  carl
+    + profiling support
+
+  Revision 1.36  2002/10/31 15:17:58  carl
     * always allocate argument even if its empty (bugfix web bug 2202)
 
   Revision 1.35  2002/10/14 20:40:22  florian

+ 50 - 2
rtl/win32/wprt0.as

@@ -10,10 +10,58 @@ _mainCRTStartup:
 _WinMainCRTStartup:
      movb   $0,U_SYSTEM_ISCONSOLE
      call   _FPC_EXE_Entry
+     
+     .globl asm_exit
+asm_exit:     
+    pushl   %eax
+	call	exitprocess
 
-//
+.text
+.globl	exitprocess
+exitprocess:
+	jmp	*.L10
+	.balign 4,144
+	
+.text
+	.balign 4,144
+
+.section .idata$2
+	.rva	.L7
+	.long	0,0
+	.rva	.L6
+	.rva	.L8
+
+.section .idata$4
+.L7:
+	.rva	.L9
+	.long	0
+
+.section .idata$5
+.L8:
+	
+
+.section .idata$5
+.L10:
+	.rva	.L9
+	.long	0
+
+.section .idata$6
+.L9:
+	.short	0
+	.ascii	"ExitProcess\000"
+	.balign 2,0
+
+.section .idata$7
+.L6:
+	.ascii	"kernel32.dll\000"
+
+
+	
 // $Log$
-// Revision 1.3  2002-07-28 20:43:51  florian
+// Revision 1.4  2002-11-30 18:17:35  carl
+//   + profiling support
+//
+// Revision 1.3  2002/07/28 20:43:51  florian
 //   * several fixes for linux/powerpc
 //   * several fixes to MT
 //

+ 44 - 1
rtl/win32/wprt0_10.as

@@ -11,4 +11,47 @@ _mainCRTStartup:
 _WinMainCRTStartup:
      movb   $0,U_SYSWIN32_ISCONSOLE
      call   _FPC_EXE_Entry
- 
+     
+     .globl asm_exit
+asm_exit:     
+    pushl   %eax
+	call	exitprocess
+	
+.text
+.globl	exitprocess
+exitprocess:
+	jmp	*.L10
+	.balign 4,144
+	
+.text
+	.balign 4,144
+
+.section .idata$2
+	.rva	.L7
+	.long	0,0
+	.rva	.L6
+	.rva	.L8
+
+.section .idata$4
+.L7:
+	.rva	.L9
+	.long	0
+
+.section .idata$5
+.L8:
+	
+
+.section .idata$5
+.L10:
+	.rva	.L9
+	.long	0
+
+.section .idata$6
+.L9:
+	.short	0
+	.ascii	"ExitProcess\000"
+	.balign 2,0
+
+.section .idata$7
+.L6:
+	.ascii	"kernel32.dll\000"