diff options
author | Anthony Green <green@moxielogic.com> | 2003-06-06 16:07:57 +0000 |
---|---|---|
committer | Anthony Green <green@moxielogic.com> | 2003-06-06 16:07:57 +0000 |
commit | 045e4d2e0829b6c07ef10171bf5d00ab85cbb497 (patch) | |
tree | 36b49868598b46c77d7edeb97df54c291c5f881e /libgloss/iq2000/trap.c | |
parent | 75d7d177004358ba5e410a2cd98f2249b6c4e1b3 (diff) | |
download | cygnal-045e4d2e0829b6c07ef10171bf5d00ab85cbb497.tar.gz cygnal-045e4d2e0829b6c07ef10171bf5d00ab85cbb497.tar.bz2 cygnal-045e4d2e0829b6c07ef10171bf5d00ab85cbb497.zip |
iq2000 port.
Diffstat (limited to 'libgloss/iq2000/trap.c')
-rw-r--r-- | libgloss/iq2000/trap.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libgloss/iq2000/trap.c b/libgloss/iq2000/trap.c new file mode 100644 index 000000000..217cef233 --- /dev/null +++ b/libgloss/iq2000/trap.c @@ -0,0 +1,13 @@ +// Perform a system call. +// Unused parameters should be set to 0. +int __trap0(unsigned long func, unsigned long p1, unsigned long p2, unsigned long p3) +{ + int ret = 0; + asm volatile ("nop\n\tor %%4,%%0,%0" : : "r"(func)); + asm volatile ("nop\n\tor %%5,%%0,%0" : : "r"(p1)); + asm volatile ("nop\n\tor %%6,%%0,%0" : : "r"(p2)); + asm volatile ("nop\n\tor %%7,%%0,%0" : : "r"(p3)); + asm volatile ("nop\n\tor %%11,%%0,%0" : : "r"(func)); + asm volatile ("syscall\n\tnop\n\tor %0,%%0,%%2" : "=r"(ret)); + return ret; +} |