mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:09:23 +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;
|
||||
var
|
||||
tmpref: treference;
|
||||
tmpref2: treference;
|
||||
begin
|
||||
case target_info.system of
|
||||
system_m68k_amiga:
|
||||
begin
|
||||
if po_syscall_legacy in tprocdef(procdefinition).procoptions then
|
||||
begin
|
||||
{ save base pointer on syscalls }
|
||||
{ FIXME: probably this will need to be extended to save all regs (KB) }
|
||||
reference_reset_base(tmpref2, NR_STACK_POINTER_REG, 0, 4);
|
||||
tmpref2.direction := dir_dec;
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_ref(A_MOVE,S_L,NR_FRAME_POINTER_REG,tmpref2));
|
||||
|
||||
{ the actuall call }
|
||||
{ according to Amiga Developer CD 2.1, system functions destroy the
|
||||
scratch regs D0-D1 and A0-A1, but preserve all other regs. A6 is
|
||||
not used as FP on Amiga any more (we use A5), so we don't need to
|
||||
save it. (KB)
|
||||
http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0290.html }
|
||||
reference_reset_base(tmpref,NR_A6,-tprocdef(procdefinition).extnumber,4);
|
||||
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
|
||||
else
|
||||
internalerror(2005010403);
|
||||
|
Loading…
Reference in New Issue
Block a user