SYS.h (8269e7673cf033aba67dab8264fe719920c70f87) SYS.h (f21777224411fee14b8aea6d8465bd6c2b318429)
1/*-
2 * Copyright (c) 2014 Andrew Turner
3 * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
4 * All rights reserved.
5 *
6 * Portions of this software were developed by SRI International and the
7 * University of Cambridge Computer Laboratory under DARPA/AFRL contract
8 * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.

--- 26 unchanged lines hidden (view full) ---

35
36#include <sys/syscall.h>
37#include <machine/asm.h>
38
39#define _SYSCALL(name) \
40 li t0, SYS_ ## name; \
41 ecall
42
1/*-
2 * Copyright (c) 2014 Andrew Turner
3 * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
4 * All rights reserved.
5 *
6 * Portions of this software were developed by SRI International and the
7 * University of Cambridge Computer Laboratory under DARPA/AFRL contract
8 * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.

--- 26 unchanged lines hidden (view full) ---

35
36#include <sys/syscall.h>
37#include <machine/asm.h>
38
39#define _SYSCALL(name) \
40 li t0, SYS_ ## name; \
41 ecall
42
43#ifndef _SYSCALL_BODY
43#define _SYSCALL_BODY(name) \
44 _SYSCALL(name); \
45 bnez t0, 1f; \
46 ret; \
471: la t1, cerror; \
48 jr t1
44#define _SYSCALL_BODY(name) \
45 _SYSCALL(name); \
46 bnez t0, 1f; \
47 ret; \
481: la t1, cerror; \
49 jr t1
50#endif
49
50#define PSEUDO(name) \
51ENTRY(__sys_##name); \
52 WEAK_REFERENCE(__sys_##name, _##name); \
53 _SYSCALL_BODY(name); \
54END(__sys_##name)
55
56#define RSYSCALL(name) \
57ENTRY(__sys_##name); \
58 WEAK_REFERENCE(__sys_##name, name); \
59 WEAK_REFERENCE(__sys_##name, _##name); \
60 _SYSCALL_BODY(name); \
61END(__sys_##name)
51
52#define PSEUDO(name) \
53ENTRY(__sys_##name); \
54 WEAK_REFERENCE(__sys_##name, _##name); \
55 _SYSCALL_BODY(name); \
56END(__sys_##name)
57
58#define RSYSCALL(name) \
59ENTRY(__sys_##name); \
60 WEAK_REFERENCE(__sys_##name, name); \
61 WEAK_REFERENCE(__sys_##name, _##name); \
62 _SYSCALL_BODY(name); \
63END(__sys_##name)