Adding a Kernel Module in base-hw
Martin Stein
martin.stein at ...1...
Thu Apr 16 13:43:14 CEST 2015
Hi Franc,
On 16.04.2015 12:01, Franc sylvester wrote:
> I used this explanation to write a system call but i am not able to get
> user argument value inside the system call.
> Can you provide some more information to get argument value inside the
> system call.
As you can see in the other system calls in [1] it should be sufficient
in the userland to do:
ret = call(call_id_<NAME>(), (Call_arg)arg_0, (Call_arg)arg_1, ...);
This method can mangle up to 6 arguments into the appropriate registers
(on ARM registers R0...R5, for details see [2]). In the kernel, you can
then read these arguments by calling the following methods on the
Kernel::Thread object of the user:
arg_0 = user_arg_0();
arg_1 = user_arg_1();
...
To pass a return value to the user, call the following on the users
Kernel::Thread object:
user_arg_0(ret);
The return value is then returned by the initially mentioned function in
the userland.
Cheers,
Martin
[1] base-hw/include/kernel/interface.h
[2] base-hw/src/base/arm/kernel/interface.cc
More information about the users
mailing list