]>
Commit | Line | Data |
---|---|---|
d3163d3f WD |
1 | #include <ppc_asm.tmpl> |
2 | #include <ppc_defs.h> | |
3 | #include <syscall.h> | |
4 | ||
5 | #ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ | |
6 | #warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */ | |
7 | .global mon_getc | |
8 | .type mon_getc,function | |
9 | mon_getc: | |
10 | .global mon_tstc | |
11 | .type mon_tstc,function | |
12 | mon_tstc: | |
13 | .global mon_putc | |
14 | .type mon_putc,function | |
15 | mon_putc: | |
16 | .global mon_puts | |
17 | .type mon_puts,function | |
18 | mon_puts: | |
19 | .global mon_printf | |
20 | .type mon_printf,function | |
21 | mon_printf: | |
22 | .global mon_install_hdlr | |
23 | .type mon_install_hdlr,function | |
24 | mon_install_hdlr: | |
25 | .global mon_free_hdlr | |
26 | .type mon_free_hdlr,function | |
27 | mon_free_hdlr: | |
28 | .global mon_malloc | |
29 | .type mon_malloc,function | |
30 | mon_malloc: | |
31 | .global mon_free | |
32 | .type mon_free,function | |
33 | mon_free: | |
34 | @ args = 0, pretend = 0, frame = 0 | |
35 | @ frame_needed = 1, current_function_anonymous_args = 0 | |
36 | mov ip, sp | |
37 | stmfd sp!, {fp, ip, lr, pc} | |
38 | sub fp, ip, #4 | |
39 | ldmea fp, {fp, sp, pc} | |
6069ff26 WD |
40 | #elif defined(CONFIG_MIPS)/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ |
41 | #warning MIPS version not implemented yet | |
42 | .global mon_getc | |
43 | .type mon_getc,function | |
44 | mon_getc: | |
45 | .global mon_tstc | |
46 | .type mon_tstc,function | |
47 | mon_tstc: | |
48 | .global mon_putc | |
49 | .type mon_putc,function | |
50 | mon_putc: | |
51 | .global mon_puts | |
52 | .type mon_puts,function | |
53 | mon_puts: | |
54 | .global mon_printf | |
55 | .type mon_printf,function | |
56 | mon_printf: | |
57 | .global mon_install_hdlr | |
58 | .type mon_install_hdlr,function | |
59 | mon_install_hdlr: | |
60 | .global mon_free_hdlr | |
61 | .type mon_free_hdlr,function | |
62 | mon_free_hdlr: | |
63 | .global mon_malloc | |
64 | .type mon_malloc,function | |
65 | mon_malloc: | |
66 | .global mon_free | |
67 | .type mon_free,function | |
68 | mon_free: | |
69 | ||
70 | #else | |
2262cfee WD |
71 | |
72 | #ifdef CONFIG_I386 /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ | |
73 | #define SYMBOL_NAME(X) X | |
74 | #define SYMBOL_NAME_LABEL(X) X##: | |
75 | ||
76 | #define SYSCALL(name,n) \ | |
77 | .globl SYMBOL_NAME(name) ; \ | |
78 | SYMBOL_NAME_LABEL(name) ; \ | |
79 | ret | |
80 | ||
81 | #endif /* CONFIG_I386 */ | |
82 | ||
83 | #ifdef CONFIG_PPC | |
d3163d3f WD |
84 | #define SYSCALL(name,n) \ |
85 | .globl name ; \ | |
86 | name: ; \ | |
87 | li r0,n ; \ | |
88 | sc ; \ | |
89 | blr | |
2262cfee | 90 | #endif /* CONFIG_PPC */ |
d3163d3f WD |
91 | |
92 | .text | |
93 | ||
94 | /* | |
95 | * Make sure these functions are in the same order as they | |
96 | * appear in the "include/syscall.h" header file !!! | |
97 | */ | |
98 | ||
99 | SYSCALL(mon_getc,SYSCALL_GETC) | |
100 | SYSCALL(mon_tstc,SYSCALL_TSTC) | |
101 | SYSCALL(mon_putc,SYSCALL_PUTC) | |
102 | SYSCALL(mon_puts,SYSCALL_PUTS) | |
103 | SYSCALL(mon_printf,SYSCALL_PRINTF) | |
104 | SYSCALL(mon_install_hdlr,SYSCALL_INSTALL_HDLR) | |
105 | SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR) | |
106 | SYSCALL(mon_malloc,SYSCALL_MALLOC) | |
107 | SYSCALL(mon_free,SYSCALL_FREE) | |
c7de829c WD |
108 | SYSCALL(mon_udelay,SYSCALL_UDELAY) |
109 | SYSCALL(mon_get_timer,SYSCALL_GET_TIMER) | |
d3163d3f | 110 | #endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ |