SYS.h (8269e7673cf033aba67dab8264fe719920c70f87) SYS.h (f21777224411fee14b8aea6d8465bd6c2b318429)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2002 Benno Rice. All rights reserved.
5 * Copyright (c) 2002 David E. O'Brien. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

35#include <machine/asm.h>
36
37#define _SYSCALL(name) \
38 .text; \
39 .align 2; \
40 li 0,(SYS_##name); \
41 sc
42
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2002 Benno Rice. All rights reserved.
5 * Copyright (c) 2002 David E. O'Brien. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

35#include <machine/asm.h>
36
37#define _SYSCALL(name) \
38 .text; \
39 .align 2; \
40 li 0,(SYS_##name); \
41 sc
42
43#ifndef _SYSCALL_BODY
43#define _SYSCALL_BODY(name) \
44 _SYSCALL(name); \
45 bnslr; \
46 mflr %r0; \
47 std %r0,16(%r1); \
48 stdu %r1,-48(%r1); \
49 bl CNAME(HIDENAME(cerror)); \
50 nop; \
51 addi %r1,%r1,48; \
52 ld %r0,16(%r1); \
53 mtlr %r0; \
54 blr
44#define _SYSCALL_BODY(name) \
45 _SYSCALL(name); \
46 bnslr; \
47 mflr %r0; \
48 std %r0,16(%r1); \
49 stdu %r1,-48(%r1); \
50 bl CNAME(HIDENAME(cerror)); \
51 nop; \
52 addi %r1,%r1,48; \
53 ld %r0,16(%r1); \
54 mtlr %r0; \
55 blr
56#endif
55
56#define PSEUDO(name) \
57 .text; \
58 .align 2; \
59ENTRY(__sys_##name); \
60 WEAK_REFERENCE(__sys_##name, _##name); \
61 _SYSCALL_BODY(name); \
62END(__sys_##name)
63
64#define RSYSCALL(name) \
65 .text; \
66 .align 2; \
67ENTRY(__sys_##name); \
68 WEAK_REFERENCE(__sys_##name, name); \
69 WEAK_REFERENCE(__sys_##name, _##name); \
70 _SYSCALL_BODY(name); \
71END(__sys_##name)
57
58#define PSEUDO(name) \
59 .text; \
60 .align 2; \
61ENTRY(__sys_##name); \
62 WEAK_REFERENCE(__sys_##name, _##name); \
63 _SYSCALL_BODY(name); \
64END(__sys_##name)
65
66#define RSYSCALL(name) \
67 .text; \
68 .align 2; \
69ENTRY(__sys_##name); \
70 WEAK_REFERENCE(__sys_##name, name); \
71 WEAK_REFERENCE(__sys_##name, _##name); \
72 _SYSCALL_BODY(name); \
73END(__sys_##name)