Last change
on this file since 575 was
444,
checked in by satin@…, 7 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
824 bytes
|
Line | |
---|
1 | /* reentrant system call template */ |
---|
2 | |
---|
3 | /* Lots of system calls are trivial functions, so we build their source files |
---|
4 | from a template. New syscalls can be added simply by editing the |
---|
5 | Makefile! |
---|
6 | |
---|
7 | The system calls aren't necessarily reentrant. If we were being used in |
---|
8 | an embedded system they could be. Reentrant syscalls are also used, |
---|
9 | however, to provide ANSI C namespace clean access to the host o/s. |
---|
10 | |
---|
11 | Usage: Compile this file with "func" set to the name of the syscall. */ |
---|
12 | |
---|
13 | #include "syscallasm.h" |
---|
14 | |
---|
15 | #define concat(a,b) a##b |
---|
16 | #define concat3(a,b,c) a##b##c |
---|
17 | #define makesys(a) concat (SYS_, a) |
---|
18 | #define make_r_fn(a) concat3 (_, a, _r) |
---|
19 | |
---|
20 | /* The leading _'s get turned into #'s by the Makefile. */ |
---|
21 | |
---|
22 | _ifdef REENT |
---|
23 | defsyscall_r (make_r_fn (func), makesys (func)) |
---|
24 | _else |
---|
25 | defsyscall (func, makesys (func)) |
---|
26 | _endif |
---|
Note: See
TracBrowser
for help on using the repository browser.