[klibc] HUGE change soon coming to a klibc near you

H. Peter Anvin hpa at zytor.com
Mon Aug 23 08:35:24 PDT 2004


Olaf Hering wrote:
>>
>>I'm a little confused by this statement -- is "long int" handled 
>>differently than "void *" in the ppc64 calling convention?
> 
> Probably not. This patch fixes it for me, minips, sleep and printf works
> now. ash does not work, some signal handling problems.
> 

Right; that seems to be common for all bigendian 64-bit platforms, which makes 
me think it needs prototypes at least.

> An error condition is flagged in the CR register, see
> asm-ppc64/unistd.h how it was handled. I'm just checking that and return
> gpr3 if its ok. Otherswise branch to the __syscall_error function, not
> its descriptor :)

Heh.  I know very little about ppc, and in general I would probably have tried 
to push more into the __syscall_common function, instead of branching out only 
on error.

> diff -purNx linux /tmp/klibc-0.167/klibc/arch/ppc64/sysstub.ph klibc-0.167/klibc/arch/ppc64/sysstub.ph
> --- /tmp/klibc-0.167/klibc/arch/ppc64/sysstub.ph        2004-06-07 06:55:06.000000000 +0000
> +++ klibc-0.167/klibc/arch/ppc64/sysstub.ph     2004-08-23 13:25:33.739727291 +0000
> @@ -23,8 +23,10 @@ sub make_sysstub($$$$@) {
>      print OUT ".${fname}:\n";
>      print OUT "\tli 0,__NR_${sname}\n";
>      print OUT "\tsc\n";
> -    print OUT "\tbnslr\n";
> -    print OUT "\tb __syscall_error\n";
> +    print OUT "\tmfcr 0\n";
> +    print OUT "\trldicl. 9,0,36,63\n";
> +    print OUT "\tbeqlr- 0\n";
> +    print OUT "\tb .__syscall_error\n";
>      print OUT "\t.size .${fname},.-.${fname}\n";
>      close(OUT);
>  }



More information about the klibc mailing list