Last change
on this file since 450 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
520 bytes
|
Line | |
---|
1 | // Perform a system call. |
---|
2 | // Unused parameters should be set to 0. |
---|
3 | int __trap0(unsigned long func, unsigned long p1, unsigned long p2, unsigned long p3) |
---|
4 | { |
---|
5 | int ret = 0; |
---|
6 | asm volatile ("nop\n\tor %%4,%%0,%0" : : "r"(func)); |
---|
7 | asm volatile ("nop\n\tor %%5,%%0,%0" : : "r"(p1)); |
---|
8 | asm volatile ("nop\n\tor %%6,%%0,%0" : : "r"(p2)); |
---|
9 | asm volatile ("nop\n\tor %%7,%%0,%0" : : "r"(p3)); |
---|
10 | asm volatile ("nop\n\tor %%11,%%0,%0" : : "r"(func)); |
---|
11 | asm volatile ("syscall\n\tnop\n\tor %0,%%0,%%2" : "=r"(ret)); |
---|
12 | return ret; |
---|
13 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.