blob: 510807bc9a7cb43936c0650faf490344bf3dd842 [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}
wdenk4fc95692003-02-28 00:49:47 +000040#elif defined(CONFIG_MIPS)/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
41#warning MIPS version not implemented yet
42 .global mon_getc
43 .type mon_getc,function
44mon_getc:
45 .global mon_tstc
46 .type mon_tstc,function
47mon_tstc:
48 .global mon_putc
49 .type mon_putc,function
50mon_putc:
51 .global mon_puts
52 .type mon_puts,function
53mon_puts:
54 .global mon_printf
55 .type mon_printf,function
56mon_printf:
57 .global mon_install_hdlr
58 .type mon_install_hdlr,function
59mon_install_hdlr:
60 .global mon_free_hdlr
61 .type mon_free_hdlr,function
62mon_free_hdlr:
63 .global mon_malloc
64 .type mon_malloc,function
65mon_malloc:
66 .global mon_free
67 .type mon_free,function
68mon_free:
69
70#else
wdenk591dda52002-11-18 00:14:45 +000071
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) ; \
78SYMBOL_NAME_LABEL(name) ; \
79 ret
80
81#endif /* CONFIG_I386 */
82
83#ifdef CONFIG_PPC
wdenkd3163d32002-09-07 20:53:01 +000084#define SYSCALL(name,n) \
85 .globl name ; \
86name: ; \
87 li r0,n ; \
88 sc ; \
89 blr
wdenk591dda52002-11-18 00:14:45 +000090#endif /* CONFIG_PPC */
wdenkd3163d32002-09-07 20:53:01 +000091
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)
wdenk452cfd62002-11-19 11:04:11 +0000108 SYSCALL(mon_udelay,SYSCALL_UDELAY)
109 SYSCALL(mon_get_timer,SYSCALL_GET_TIMER)
wdenkd3163d32002-09-07 20:53:01 +0000110#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */