blob: 9934490433d5ad6a96778ec05be1254e2e693ec6 [file] [log] [blame]
wdenkd3163d32002-09-07 20:53:01 +00001#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
9mon_getc:
10 .global mon_tstc
11 .type mon_tstc,function
12mon_tstc:
13 .global mon_putc
14 .type mon_putc,function
15mon_putc:
16 .global mon_puts
17 .type mon_puts,function
18mon_puts:
19 .global mon_printf
20 .type mon_printf,function
21mon_printf:
22 .global mon_install_hdlr
23 .type mon_install_hdlr,function
24mon_install_hdlr:
25 .global mon_free_hdlr
26 .type mon_free_hdlr,function
27mon_free_hdlr:
28 .global mon_malloc
29 .type mon_malloc,function
30mon_malloc:
31 .global mon_free
32 .type mon_free,function
33mon_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}
40#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
wdenk2262cfe2002-11-18 00:14:45 +000041
42#ifdef CONFIG_I386 /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
43#define SYMBOL_NAME(X) X
44#define SYMBOL_NAME_LABEL(X) X##:
45
46#define SYSCALL(name,n) \
47 .globl SYMBOL_NAME(name) ; \
48SYMBOL_NAME_LABEL(name) ; \
49 ret
50
51#endif /* CONFIG_I386 */
52
53#ifdef CONFIG_PPC
wdenkd3163d32002-09-07 20:53:01 +000054#define SYSCALL(name,n) \
55 .globl name ; \
56name: ; \
57 li r0,n ; \
58 sc ; \
59 blr
wdenk2262cfe2002-11-18 00:14:45 +000060#endif /* CONFIG_PPC */
wdenkd3163d32002-09-07 20:53:01 +000061
62 .text
63
64 /*
65 * Make sure these functions are in the same order as they
66 * appear in the "include/syscall.h" header file !!!
67 */
68
69 SYSCALL(mon_getc,SYSCALL_GETC)
70 SYSCALL(mon_tstc,SYSCALL_TSTC)
71 SYSCALL(mon_putc,SYSCALL_PUTC)
72 SYSCALL(mon_puts,SYSCALL_PUTS)
73 SYSCALL(mon_printf,SYSCALL_PRINTF)
74 SYSCALL(mon_install_hdlr,SYSCALL_INSTALL_HDLR)
75 SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR)
76 SYSCALL(mon_malloc,SYSCALL_MALLOC)
77 SYSCALL(mon_free,SYSCALL_FREE)
78#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */