1 /*
2  *  linux/arch/arm/kernel/armksyms.c
3  *
4  *  Copyright (C) 2000 Russell King
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #include <linux/config.h>
11 #include <linux/module.h>
12 #include <linux/user.h>
13 #include <linux/string.h>
14 #include <linux/fs.h>
15 #include <linux/mm.h>
16 #include <linux/mman.h>
17 #include <linux/pci.h>
18 #include <linux/delay.h>
19 #include <linux/in6.h>
20 #include <linux/interrupt.h>
21 #include <linux/pm.h>
22 #include <linux/vt_kern.h>
23 
24 #include <asm/byteorder.h>
25 #include <asm/elf.h>
26 #include <asm/io.h>
27 #include <asm/irq.h>
28 #include <asm/pgalloc.h>
29 #include <asm/proc-fns.h>
30 #include <asm/processor.h>
31 #include <asm/semaphore.h>
32 #include <asm/system.h>
33 #include <asm/uaccess.h>
34 #include <asm/checksum.h>
35 #include <asm/mach-types.h>
36 
37 extern void dump_thread(struct pt_regs *, struct user *);
38 extern int dump_fpu(struct pt_regs *, struct user_fp_struct *);
39 extern void inswb(unsigned int port, void *to, int len);
40 extern void outswb(unsigned int port, const void *to, int len);
41 
42 extern void __bad_xchg(volatile void *ptr, int size);
43 
44 /*
45  * syscalls
46  */
47 extern int sys_write(int, const char *, int);
48 extern int sys_read(int, char *, int);
49 extern int sys_lseek(int, off_t, int);
50 extern int sys_exit(int);
51 
52 /*
53  * libgcc functions - functions that are used internally by the
54  * compiler...  (prototypes are not correct though, but that
55  * doesn't really matter since they're not versioned).
56  */
57 extern void __ashldi3(void);
58 extern void __ashrdi3(void);
59 extern void __divsi3(void);
60 extern void __lshrdi3(void);
61 extern void __modsi3(void);
62 extern void __muldi3(void);
63 extern void __ucmpdi2(void);
64 extern void __udivdi3(void);
65 extern void __umoddi3(void);
66 extern void __udivmoddi4(void);
67 extern void __udivsi3(void);
68 extern void __umodsi3(void);
69 extern void abort(void);
70 
71 extern void ret_from_exception(void);
72 extern void fpundefinstr(void);
73 extern void fp_enter(void);
74 
75 /*
76  * This has a special calling convention; it doesn't
77  * modify any of the usual registers, except for LR.
78  */
79 extern void __do_softirq(void);
80 
81 #define EXPORT_SYMBOL_ALIAS(sym,orig)		\
82  const char __kstrtab_##sym[]			\
83   __attribute__((section(".kstrtab"))) =	\
84     __MODULE_STRING(sym);			\
85  const struct module_symbol __ksymtab_##sym	\
86   __attribute__((section("__ksymtab"))) =	\
87     { (unsigned long)&orig, __kstrtab_##sym };
88 
89 /*
90  * floating point math emulator support.
91  * These symbols will never change their calling convention...
92  */
93 EXPORT_SYMBOL_ALIAS(kern_fp_enter,fp_enter);
94 EXPORT_SYMBOL_ALIAS(fp_printk,printk);
95 EXPORT_SYMBOL_ALIAS(fp_send_sig,send_sig);
96 
97 #ifdef CONFIG_CPU_26
98 EXPORT_SYMBOL(fpundefinstr);
99 EXPORT_SYMBOL(ret_from_exception);
100 #endif
101 
102 #ifdef CONFIG_VT
103 EXPORT_SYMBOL(kd_mksound);
104 #endif
105 
106 EXPORT_SYMBOL_NOVERS(__do_softirq);
107 
108 	/* platform dependent support */
109 EXPORT_SYMBOL(dump_thread);
110 EXPORT_SYMBOL(dump_fpu);
111 EXPORT_SYMBOL(__udelay);
112 EXPORT_SYMBOL(__ndelay);
113 EXPORT_SYMBOL(__const_delay);
114 #ifdef CONFIG_CPU_32
115 EXPORT_SYMBOL(__ioremap);
116 EXPORT_SYMBOL(__iounmap);
117 #endif
118 EXPORT_SYMBOL(kernel_thread);
119 EXPORT_SYMBOL(system_rev);
120 EXPORT_SYMBOL(system_serial_low);
121 EXPORT_SYMBOL(system_serial_high);
122 #ifdef CONFIG_DEBUG_BUGVERBOSE
123 EXPORT_SYMBOL(__bug);
124 #endif
125 EXPORT_SYMBOL(__bad_xchg);
126 EXPORT_SYMBOL(__readwrite_bug);
127 EXPORT_SYMBOL(enable_irq);
128 EXPORT_SYMBOL(disable_irq);
129 EXPORT_SYMBOL(pm_idle);
130 EXPORT_SYMBOL(pm_power_off);
131 
132 	/* processor dependencies */
133 EXPORT_SYMBOL(__machine_arch_type);
134 
135 	/* networking */
136 EXPORT_SYMBOL(csum_partial_copy_nocheck);
137 EXPORT_SYMBOL(__csum_ipv6_magic);
138 
139 	/* io */
140 #ifndef __raw_readsb
141 EXPORT_SYMBOL_NOVERS(__raw_readsb);
142 #endif
143 #ifndef __raw_readsw
144 EXPORT_SYMBOL_NOVERS(__raw_readsw);
145 #endif
146 #ifndef __raw_readsl
147 EXPORT_SYMBOL_NOVERS(__raw_readsl);
148 #endif
149 #ifndef __raw_writesb
150 EXPORT_SYMBOL_NOVERS(__raw_writesb);
151 #endif
152 #ifndef __raw_writesw
153 EXPORT_SYMBOL_NOVERS(__raw_writesw);
154 #endif
155 #ifndef __raw_writesl
156 EXPORT_SYMBOL_NOVERS(__raw_writesl);
157 #endif
158 
159 	/* address translation */
160 #ifndef __virt_to_phys__is_a_macro
161 EXPORT_SYMBOL(__virt_to_phys);
162 #endif
163 #ifndef __phys_to_virt__is_a_macro
164 EXPORT_SYMBOL(__phys_to_virt);
165 #endif
166 #ifndef __virt_to_bus__is_a_macro
167 EXPORT_SYMBOL(__virt_to_bus);
168 #endif
169 #ifndef __bus_to_virt__is_a_macro
170 EXPORT_SYMBOL(__bus_to_virt);
171 #endif
172 
173 #ifndef CONFIG_NO_PGT_CACHE
174 EXPORT_SYMBOL(quicklists);
175 #endif
176 
177 	/* string / mem functions */
178 EXPORT_SYMBOL_NOVERS(strcpy);
179 EXPORT_SYMBOL_NOVERS(strncpy);
180 EXPORT_SYMBOL_NOVERS(strcat);
181 EXPORT_SYMBOL_NOVERS(strncat);
182 EXPORT_SYMBOL_NOVERS(strcmp);
183 EXPORT_SYMBOL_NOVERS(strncmp);
184 EXPORT_SYMBOL_NOVERS(strchr);
185 EXPORT_SYMBOL_NOVERS(strlen);
186 EXPORT_SYMBOL_NOVERS(strnlen);
187 EXPORT_SYMBOL_NOVERS(strpbrk);
188 EXPORT_SYMBOL_NOVERS(strtok);
189 EXPORT_SYMBOL_NOVERS(strrchr);
190 EXPORT_SYMBOL_NOVERS(strstr);
191 EXPORT_SYMBOL_NOVERS(memset);
192 EXPORT_SYMBOL_NOVERS(memcpy);
193 EXPORT_SYMBOL_NOVERS(memmove);
194 EXPORT_SYMBOL_NOVERS(memcmp);
195 EXPORT_SYMBOL_NOVERS(memscan);
196 EXPORT_SYMBOL_NOVERS(memchr);
197 EXPORT_SYMBOL_NOVERS(__memzero);
198 
199 	/* user mem (segment) */
200 #if defined(CONFIG_CPU_32)
201 EXPORT_SYMBOL(__arch_copy_from_user);
202 EXPORT_SYMBOL(__arch_copy_to_user);
203 EXPORT_SYMBOL(__arch_clear_user);
204 EXPORT_SYMBOL(__arch_strnlen_user);
205 
206 	/* consistent area handling */
207 EXPORT_SYMBOL(pci_alloc_consistent);
208 EXPORT_SYMBOL(consistent_alloc);
209 EXPORT_SYMBOL(consistent_free);
210 EXPORT_SYMBOL(consistent_sync);
211 
212 #elif defined(CONFIG_CPU_26)
213 EXPORT_SYMBOL(uaccess_kernel);
214 EXPORT_SYMBOL(uaccess_user);
215 #endif
216 
217 EXPORT_SYMBOL_NOVERS(__get_user_1);
218 EXPORT_SYMBOL_NOVERS(__get_user_2);
219 EXPORT_SYMBOL_NOVERS(__get_user_4);
220 EXPORT_SYMBOL_NOVERS(__get_user_8);
221 
222 EXPORT_SYMBOL_NOVERS(__put_user_1);
223 EXPORT_SYMBOL_NOVERS(__put_user_2);
224 EXPORT_SYMBOL_NOVERS(__put_user_4);
225 EXPORT_SYMBOL_NOVERS(__put_user_8);
226 
227 	/* gcc lib functions */
228 EXPORT_SYMBOL_NOVERS(__ashldi3);
229 EXPORT_SYMBOL_NOVERS(__ashrdi3);
230 EXPORT_SYMBOL_NOVERS(__divsi3);
231 EXPORT_SYMBOL_NOVERS(__lshrdi3);
232 EXPORT_SYMBOL_NOVERS(__modsi3);
233 EXPORT_SYMBOL_NOVERS(__muldi3);
234 EXPORT_SYMBOL_NOVERS(__ucmpdi2);
235 EXPORT_SYMBOL_NOVERS(__udivdi3);
236 EXPORT_SYMBOL_NOVERS(__umoddi3);
237 EXPORT_SYMBOL_NOVERS(__udivmoddi4);
238 EXPORT_SYMBOL_NOVERS(__udivsi3);
239 EXPORT_SYMBOL_NOVERS(__umodsi3);
240 EXPORT_SYMBOL_NOVERS(abort);
241 
242 	/* bitops */
243 EXPORT_SYMBOL(set_bit);
244 EXPORT_SYMBOL(test_and_set_bit);
245 EXPORT_SYMBOL(clear_bit);
246 EXPORT_SYMBOL(test_and_clear_bit);
247 EXPORT_SYMBOL(change_bit);
248 EXPORT_SYMBOL(test_and_change_bit);
249 EXPORT_SYMBOL(find_first_zero_bit);
250 EXPORT_SYMBOL(find_next_zero_bit);
251 
252 	/* elf */
253 EXPORT_SYMBOL(elf_platform);
254 EXPORT_SYMBOL(elf_hwcap);
255 
256 	/* syscalls */
257 EXPORT_SYMBOL(sys_write);
258 EXPORT_SYMBOL(sys_read);
259 EXPORT_SYMBOL(sys_lseek);
260 EXPORT_SYMBOL(sys_open);
261 EXPORT_SYMBOL(sys_exit);
262 EXPORT_SYMBOL(sys_wait4);
263 
264 	/* semaphores */
265 EXPORT_SYMBOL_NOVERS(__down_failed);
266 EXPORT_SYMBOL_NOVERS(__down_interruptible_failed);
267 EXPORT_SYMBOL_NOVERS(__down_trylock_failed);
268 EXPORT_SYMBOL_NOVERS(__up_wakeup);
269 
270 EXPORT_SYMBOL(get_wchan);
271