Anonymous user
ARM System Calls: Difference between revisions
no edit summary
[unchecked revision] | [unchecked revision] |
No edit summary |
No edit summary |
||
Line 2:
==System Calls==
<pre>swi
This is how you call the system on ARM. The instruction
<pre>
Most of the time you won't need to worry about returning from the interrupt, as GCC, set up to cross compile for ARM, lets you code the interrupt handlers in C:
<source lang="c">void swi_handler () __attribute__((interrupt));</source>
Line 19:
b . @ FIQ
</pre>
This is the ARM equivalent to the IDT, on the x86, and it is stored at address 0. The only entry, we need to worry about is the SWI Handler. To install our own SWI handler, we replace the <span style="font-family:monospace">b .
<pre>
interrupt_vector_table:
Line 38:
void __attribute__ ((interrupt ("SWI"))) swi_handler (int r0, int r1, int r2, int r3) {}
</source>
You have probably noticed from the first example (<span style="font-family:monospace">swi
<source lang="c">
asm volatile ("
</source>
[[Category:ARM]]
[[Category:In Progress]]
|