Decoupling Architectural-specific Code (#35)
[lunaix-os.git] / lunaix-os / arch / generic / includes / sys / abi.h
1 #ifndef __LUNAIX_ARCH_ABI_H
2 #define __LUNAIX_ARCH_ABI_H
3
4 #include <lunaix/types.h>
5
6 #define stack_alignment 0
7
8 #ifndef __ASM__
9 #define align_stack(ptr) ((ptr) & stack_alignment)
10 #define store_retval(retval) (void)
11
12 #define store_retval_to(th, retval) (void)
13
14 static inline void must_inline noret
15 j_usr(ptr_t sp, ptr_t pc) 
16 {
17
18 }
19
20
21 static inline void must_inline noret
22 switch_context() {
23     unreachable;
24 }
25
26 #define push_arg1(stack_ptr, arg) (void)
27
28 #define push_arg2(stack_ptr, arg1, arg2)                                       \
29     { }
30
31 #define push_arg3(stack_ptr, arg1, arg2, arg3)                                 \
32     { }
33
34 #define push_arg4(stack_ptr, arg1, arg2, arg3, arg4)                           \
35     { }
36
37
38 static inline ptr_t must_inline
39 abi_get_callframe()
40 {
41     return 0;
42 }
43
44 static inline ptr_t
45 abi_get_retaddr()
46 {
47     return 0;
48 }
49
50 static inline ptr_t
51 abi_get_retaddrat(ptr_t fp)
52 {
53     return 0;
54 }
55
56 #endif
57 #endif /* __LUNAIX_ABI_H */
58