blob: 2af6f480d17d7e1da2dce99764ed3ce2f0330707 [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}
wdenk6069ff22003-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
wdenk2262cfe2002-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) ; \
wdenk7a8e9bed2003-05-31 18:35:21 +000079 movl $n, %eax ;\
80 pushl %ebx; \
81 pushl %ecx; \
82 int $0x40 ;\
83
wdenk2262cfe2002-11-18 00:14:45 +000084
85#endif /* CONFIG_I386 */
86
87#ifdef CONFIG_PPC
wdenkd3163d32002-09-07 20:53:01 +000088#define SYSCALL(name,n) \
89 .globl name ; \
90name: ; \
91 li r0,n ; \
92 sc ; \
93 blr
wdenk2262cfe2002-11-18 00:14:45 +000094#endif /* CONFIG_PPC */
wdenkd3163d32002-09-07 20:53:01 +000095
96 .text
97
98 /*
99 * Make sure these functions are in the same order as they
100 * appear in the "include/syscall.h" header file !!!
101 */
102
103 SYSCALL(mon_getc,SYSCALL_GETC)
104 SYSCALL(mon_tstc,SYSCALL_TSTC)
105 SYSCALL(mon_putc,SYSCALL_PUTC)
106 SYSCALL(mon_puts,SYSCALL_PUTS)
107 SYSCALL(mon_printf,SYSCALL_PRINTF)
108 SYSCALL(mon_install_hdlr,SYSCALL_INSTALL_HDLR)
109 SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR)
110 SYSCALL(mon_malloc,SYSCALL_MALLOC)
111 SYSCALL(mon_free,SYSCALL_FREE)
wdenkc7de8292002-11-19 11:04:11 +0000112 SYSCALL(mon_udelay,SYSCALL_UDELAY)
113 SYSCALL(mon_get_timer,SYSCALL_GET_TIMER)
wdenkd3163d32002-09-07 20:53:01 +0000114#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */