mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 02:29:12 +02:00
don't save the FP explicitly on a syscall, as they preserve all regs anyway except scratch regs
git-svn-id: trunk@27078 -
This commit is contained in:
parent
088c4fce57
commit
73f8c956e0
@ -50,27 +50,19 @@ implementation
|
|||||||
procedure tm68kcallnode.do_syscall;
|
procedure tm68kcallnode.do_syscall;
|
||||||
var
|
var
|
||||||
tmpref: treference;
|
tmpref: treference;
|
||||||
tmpref2: treference;
|
|
||||||
begin
|
begin
|
||||||
case target_info.system of
|
case target_info.system of
|
||||||
system_m68k_amiga:
|
system_m68k_amiga:
|
||||||
begin
|
begin
|
||||||
if po_syscall_legacy in tprocdef(procdefinition).procoptions then
|
if po_syscall_legacy in tprocdef(procdefinition).procoptions then
|
||||||
begin
|
begin
|
||||||
{ save base pointer on syscalls }
|
{ according to Amiga Developer CD 2.1, system functions destroy the
|
||||||
{ FIXME: probably this will need to be extended to save all regs (KB) }
|
scratch regs D0-D1 and A0-A1, but preserve all other regs. A6 is
|
||||||
reference_reset_base(tmpref2, NR_STACK_POINTER_REG, 0, 4);
|
not used as FP on Amiga any more (we use A5), so we don't need to
|
||||||
tmpref2.direction := dir_dec;
|
save it. (KB)
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_ref(A_MOVE,S_L,NR_FRAME_POINTER_REG,tmpref2));
|
http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0290.html }
|
||||||
|
|
||||||
{ the actuall call }
|
|
||||||
reference_reset_base(tmpref,NR_A6,-tprocdef(procdefinition).extnumber,4);
|
reference_reset_base(tmpref,NR_A6,-tprocdef(procdefinition).extnumber,4);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_JSR,S_NO,tmpref));
|
current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_JSR,S_NO,tmpref));
|
||||||
|
|
||||||
{ restore frame pointer }
|
|
||||||
reference_reset_base(tmpref2, NR_STACK_POINTER_REG, 0, 4);
|
|
||||||
tmpref2.direction := dir_inc;
|
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(A_MOVE,S_L,tmpref2,NR_FRAME_POINTER_REG));
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
internalerror(2005010403);
|
internalerror(2005010403);
|
||||||
|
Loading…
Reference in New Issue
Block a user