mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:09:25 +02:00
* disable some x86_64 specific assembly routines
git-svn-id: trunk@44921 -
This commit is contained in:
parent
79a4409587
commit
c474b95dfc
@ -105,7 +105,9 @@ Const
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
{$asmmode att}
|
{$asmmode att}
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
|
||||||
var
|
var
|
||||||
{$ifdef VER3_0}
|
{$ifdef VER3_0}
|
||||||
@ -131,11 +133,13 @@ asm
|
|||||||
end;
|
end;
|
||||||
{$endif FPC_USE_WIN64_SEH}
|
{$endif FPC_USE_WIN64_SEH}
|
||||||
|
|
||||||
|
{$if defined(CPUX86_64)}
|
||||||
{$define FPC_SYSTEM_HAS_STACKTOP}
|
{$define FPC_SYSTEM_HAS_STACKTOP}
|
||||||
function StackTop: pointer; assembler;nostackframe;
|
function StackTop: pointer; assembler;nostackframe;
|
||||||
asm
|
asm
|
||||||
movq %gs:(8),%rax
|
movq %gs:(8),%rax
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{ include system independent routines }
|
{ include system independent routines }
|
||||||
{$I system.inc}
|
{$I system.inc}
|
||||||
@ -219,6 +223,7 @@ procedure Exe_entry(constref info: TEntryInformation);[public,alias:'_FPC_EXE_En
|
|||||||
install_exception_handlers;
|
install_exception_handlers;
|
||||||
{$endif FPC_USE_WIN64_SEH}
|
{$endif FPC_USE_WIN64_SEH}
|
||||||
ExitCode:=0;
|
ExitCode:=0;
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
asm
|
asm
|
||||||
xorq %rax,%rax
|
xorq %rax,%rax
|
||||||
movw %ss,%ax
|
movw %ss,%ax
|
||||||
@ -246,6 +251,9 @@ procedure Exe_entry(constref info: TEntryInformation);[public,alias:'_FPC_EXE_En
|
|||||||
{$endif VER3_0}
|
{$endif VER3_0}
|
||||||
movq %rsi,%rbp
|
movq %rsi,%rbp
|
||||||
end ['RSI','RBP']; { <-- specifying RSI allows compiler to save/restore it properly }
|
end ['RSI','RBP']; { <-- specifying RSI allows compiler to save/restore it properly }
|
||||||
|
{$else CPUX86_64}
|
||||||
|
info.PascalMain();
|
||||||
|
{$endif CPUX86_64}
|
||||||
{ if we pass here there was no error ! }
|
{ if we pass here there was no error ! }
|
||||||
system_exit;
|
system_exit;
|
||||||
end;
|
end;
|
||||||
@ -352,10 +360,12 @@ procedure JumpToHandleErrorFrame;
|
|||||||
error : longint;
|
error : longint;
|
||||||
begin
|
begin
|
||||||
// save ebp
|
// save ebp
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
asm
|
asm
|
||||||
movq (%rbp),%rax
|
movq (%rbp),%rax
|
||||||
movq %rax,rbp
|
movq %rax,rbp
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
if exceptLevel>0 then
|
if exceptLevel>0 then
|
||||||
dec(exceptLevel);
|
dec(exceptLevel);
|
||||||
|
|
||||||
@ -368,6 +378,7 @@ procedure JumpToHandleErrorFrame;
|
|||||||
if resetFPU[exceptLevel] then
|
if resetFPU[exceptLevel] then
|
||||||
SysResetFPU;
|
SysResetFPU;
|
||||||
{ build a fake stack }
|
{ build a fake stack }
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
asm
|
asm
|
||||||
movq rbp,%r8
|
movq rbp,%r8
|
||||||
movq rip,%rdx
|
movq rip,%rdx
|
||||||
@ -381,6 +392,7 @@ procedure JumpToHandleErrorFrame;
|
|||||||
jmpl HandleErrorAddrFrame
|
jmpl HandleErrorAddrFrame
|
||||||
{$endif SYSTEMEXCEPTIONDEBUG}
|
{$endif SYSTEMEXCEPTIONDEBUG}
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user