Subject: Re: m88k system call convention
To: None <netbsd-ports@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: netbsd-ports
Date: 02/09/2000 13:26:36
>> - LUNA Mach2.5
>>    issue "tb0 0,r0,128" after storing the system call number in r9.
>> 
>> - OpenBSD/m88k
>>    issue "tb0 0,r0,128" after storing the first 3 argments in r10,r11,r12,
>>    and system call number in r13.
>
> I guess the question boils down to: what is the normal function calling
> convention for the m88k?

Further research revealed my misunderstanding; it turned out OpenBSD
system call stab tries to save 9-11th args in r10-12 storing system
call number in r13.

r0 is hardwired zero, r1 for return address, and calling convention
defines r[2-9] for the first 8 arguments (double adjusts even/odd
pairs).  So, either follows pass-args-on-regs scheme, with a glitch.

Binary compatiblity can be approached by 'struct emul', if ever.  The
issue here is what 'NetBSD native m88k' should be.  Any info from
Tek88k/AViiON owners? 

Tohru Nishimura