|
Message
From: Matjaz Breskvar<phoenix@o...>
Date: Mon Apr 25 02:14:28 CEST 2005
Subject: [openrisc] Syscall Argument Passing
* Balaji V. Iyer (bviyer@n...) wrote: > Hello Everyone, > > I have a question about how syscalls are handled in OpenRISC 1200. Ok > let's say we have to use the _read function, and "read" generally has 3 > arguements taken in, they are: > > int read (int fd, char *buffer, int nbyte) > > > How are the values for fd, *buffer and nbyte passed into the function? Are > they passed through the parameter registers (r3, r4, r5 respectively,) > and the sys function will automatically know these registers to sample? Or > are they pushed into the stack with the stack base address stored at a > certain place (like the stack pointer, r1)?
this is defined as part of ABI and implemented in linux/include/asm-or32/unistd.h
loking into that file you'll notice that syscall that takes 3 arguments puts them into r3, r4, r5 (just like function call).
best regards, p.
|
 |