Browse Source

PowerPC: in MorphOS syscalls the explicit paraloc size should always be OS_ADDR

git-svn-id: trunk@28686 -
Károly Balogh 11 years ago
parent
commit
c22dd6f022
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/powerpc/cpupara.pas

+ 5 - 1
compiler/powerpc/cpupara.pas

@@ -670,7 +670,11 @@ unit cpupara;
               p.paraloc[callerside].intsize:=tcgsize2size[paracgsize];
               p.paraloc[callerside].intsize:=tcgsize2size[paracgsize];
               paraloc:=p.paraloc[callerside].add_location;
               paraloc:=p.paraloc[callerside].add_location;
               paraloc^.loc:=LOC_REFERENCE;
               paraloc^.loc:=LOC_REFERENCE;
-              paraloc^.size:=paracgsize;
+              { The OS side should be zero extended and the entire "virtual"
+                68k register should be overwritten. This is what the C ppcinline
+                macros do as well, by casting all arguments to ULONG. A call
+                which breaks w/o this is for example exec/RawPutChar (KB) }
+              paraloc^.size:=OS_ADDR;
               paraloc^.def:=p.vardef;
               paraloc^.def:=p.vardef;
               paraloc^.reference.index:=newreg(R_INTREGISTER,RS_R2,R_SUBWHOLE);
               paraloc^.reference.index:=newreg(R_INTREGISTER,RS_R2,R_SUBWHOLE);
               { pattern is always uppercase'd }
               { pattern is always uppercase'd }