Skip to content

Commit

Permalink
* aros64: recent developments hanged the library call ABI, lets try t…
Browse files Browse the repository at this point in the history
…o follow it (aros64 is experimental)
  • Loading branch information
chainq committed Feb 6, 2022
1 parent 4f30936 commit 568d4de
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/pdecsub.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/syscinfo.pas
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ tsyscalldefaultinfo = record
( 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;
Expand Down
15 changes: 15 additions & 0 deletions compiler/x86_64/cpupara.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,21 @@ paraloc^.def:=classes[i].def;
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
Expand Down
6 changes: 3 additions & 3 deletions compiler/x86_64/nx64cal.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 568d4de

Please sign in to comment.