* aros64: recent developments hanged the library call ABI, lets try to follow it (aros64 is experimental)

This commit is contained in:
Karoly Balogh 2022-02-06 16:30:04 +01:00
parent 4f3093657e
commit 568d4de77e
4 changed files with 20 additions and 5 deletions

View File

@ -2197,7 +2197,7 @@ procedure pd_syscall(pd:tabstractprocdef);
system_i386_aros:
result:='eax';
system_x86_64_aros:
result:='rax';
result:='r12';
system_powerpc_morphos:
result:='r12';
else

View File

@ -81,7 +81,7 @@ const
( system: system_powerpc_morphos; procoption: po_syscall_legacy ),
( system: system_arm_aros; procoption: po_syscall_baselast ),
( system: system_i386_aros; procoption: po_syscall_baselast ),
( system: system_x86_64_aros; procoption: po_syscall_baselast ));
( system: system_x86_64_aros; procoption: po_syscall_basereg ));
var
default_syscall_convention: tprocoption = po_none;

View File

@ -1659,6 +1659,21 @@ unit cpupara;
begin
hp:=tparavarsym(paras[i]);
paradef:=hp.vardef;
{ in syscalls the libbase might be set as explicit paraloc }
if (vo_has_explicit_paraloc in hp.varoptions) then
if not (vo_is_syscall_lib in hp.varoptions) then
internalerror(2022010501)
else
begin
paracgsize:=def_cgsize(paradef);
hp.paraloc[side].def:=paradef;
hp.paraloc[side].size:=paracgsize;
hp.paraloc[side].intsize:=tcgsize2size[paracgsize];
hp.paraloc[side].alignment:=sizeof(pint);
continue;
end;
{ on win64, if a record has only one field and that field is a
single or double, it has to be handled like a single/double }
if use_ms_abi and

View File

@ -61,11 +61,11 @@ implementation
begin
current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('AROS SysCall')));
cg.getcpuregister(current_asmdata.CurrAsmList,NR_RAX);
get_syscall_call_ref(tmpref,NR_RAX);
cg.getcpuregister(current_asmdata.CurrAsmList,NR_R12);
get_syscall_call_ref(tmpref,NR_R12);
current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_CALL,S_NO,tmpref));
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_RAX);
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_R12);
exit;
end;
internalerror(2016120101);