mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
* use ATT assembler in profile
* use AS output in graph
This commit is contained in:
parent
1a4dad3029
commit
db3c25a7de
@ -27,6 +27,12 @@ unit GRAPH;
|
||||
{$define Test_Linear}
|
||||
{$endif DEBUG}
|
||||
|
||||
{ Output to AT&T for as }
|
||||
{$OUTPUT_FORMAT AS}
|
||||
|
||||
{ Use the direct assembler parser }
|
||||
{$ASMMODE DIRECT}
|
||||
|
||||
{ Don't use smartlinking, because of the direct assembler that is used }
|
||||
{$SMARTLINK OFF}
|
||||
|
||||
@ -1010,7 +1016,11 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 1999-02-01 13:19:01 pierre
|
||||
Revision 1.3 1999-03-02 13:56:34 peter
|
||||
* use ATT assembler in profile
|
||||
* use AS output in graph
|
||||
|
||||
Revision 1.2 1999/02/01 13:19:01 pierre
|
||||
* getgraphmode returns -1 if not in graphic mode
|
||||
|
||||
Revision 1.1 1998/12/21 13:07:03 peter
|
||||
|
@ -61,28 +61,22 @@ procedure mcount;
|
||||
|
||||
implementation
|
||||
|
||||
{$asmmode ATT}
|
||||
|
||||
uses
|
||||
go32,dpmiexcp;
|
||||
|
||||
type
|
||||
plongint = ^longint;
|
||||
var
|
||||
starttext, endtext : longint;
|
||||
const
|
||||
cache : pMTABE = nil;
|
||||
|
||||
(*
|
||||
{$ASMMODE DIRECT}
|
||||
procedure sbrk_getmem(var p : pointer;size : longint);assembler;
|
||||
asm
|
||||
movl size,%eax
|
||||
pushl %eax
|
||||
call ___sbrk
|
||||
addl $4,%esp
|
||||
movl %eax,p
|
||||
end;
|
||||
var
|
||||
djgpp_timer_hdlr : pointer;external name '___djgpp_timer_hdlr';
|
||||
djgpp_old_timer : tseginfo;external name '___djgpp_old_timer';
|
||||
endtext : longint;external name '_etext';
|
||||
starttext : longint;external name 'start';
|
||||
|
||||
this nice piece of code make serious problems !!! PM *)
|
||||
|
||||
procedure sbrk_getmem(var p : pointer;size : longint);
|
||||
|
||||
@ -90,7 +84,6 @@ procedure sbrk_getmem(var p : pointer;size : longint);
|
||||
system.getmem(p,size);
|
||||
end;
|
||||
|
||||
{$ASMMODE ATT}
|
||||
|
||||
{ problem how to avoid mcount calling itself !! }
|
||||
procedure mcount; [public, alias : 'MCOUNT'];
|
||||
@ -223,14 +216,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{$ASMMODE DIRECT}
|
||||
var
|
||||
___djgpp_timer_countdown:longint;external name '___djgpp_timer_countdown';
|
||||
|
||||
function timer(x : longint) : longint;
|
||||
begin
|
||||
if reload>0 then
|
||||
asm
|
||||
movl _RELOAD,%eax
|
||||
movl %eax,___djgpp_timer_countdown
|
||||
end;
|
||||
___djgpp_timer_countdown:=RELOAD;
|
||||
timer:=mcount_tick(x);
|
||||
{ _raise(SIGPROF); }
|
||||
end;
|
||||
@ -287,31 +279,12 @@ procedure mcount_init;
|
||||
this is called to initialize profiling before the program starts
|
||||
}
|
||||
|
||||
function djgpp_timer_hdlr : pointer;
|
||||
begin
|
||||
asm
|
||||
movl $___djgpp_timer_hdlr,%eax
|
||||
movl %eax,__RESULT
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure set_old_timer_handler;
|
||||
begin
|
||||
asm
|
||||
movl $_OLD_TIMER,%eax
|
||||
movl $___djgpp_old_timer,%ebx
|
||||
movl (%eax),%ecx
|
||||
movl %ecx,(%ebx)
|
||||
movw 4(%eax),%ax
|
||||
movw %ax,4(%ebx)
|
||||
end;
|
||||
djgpp_old_timer:=Old_Timer;
|
||||
end;
|
||||
|
||||
begin
|
||||
asm
|
||||
movl $_etext,_ENDTEXT
|
||||
movl $start,_STARTTEXT
|
||||
end;
|
||||
h.low := starttext;
|
||||
h.high := endtext;
|
||||
histlen := ((h.high-h.low) div 16) * 2; { must be even }
|
||||
@ -341,13 +314,9 @@ begin
|
||||
{$endif DEBUG}
|
||||
set_pm_interrupt($8,new_timer);
|
||||
reload:=1;
|
||||
asm
|
||||
movl _RELOAD,%eax
|
||||
movl %eax,___djgpp_timer_countdown
|
||||
end;
|
||||
___djgpp_timer_countdown:=RELOAD;
|
||||
mcount_skip := 0;
|
||||
end;
|
||||
{$ASMMODE ATT}
|
||||
|
||||
|
||||
begin
|
||||
@ -355,7 +324,11 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 1998-12-21 13:07:03 peter
|
||||
Revision 1.2 1999-03-02 13:56:35 peter
|
||||
* use ATT assembler in profile
|
||||
* use AS output in graph
|
||||
|
||||
Revision 1.1 1998/12/21 13:07:03 peter
|
||||
* use -FE
|
||||
|
||||
Revision 1.4 1998/11/18 09:22:10 pierre
|
||||
|
Loading…
Reference in New Issue
Block a user