1 #include <linux/config.h>
2 #include <linux/module.h>
3 #include <linux/threads.h>
4 #include <linux/smp.h>
5 #include <linux/elfcore.h>
6 #include <linux/sched.h>
7 #include <linux/string.h>
8 #include <linux/interrupt.h>
9 #include <linux/tty.h>
10 #include <linux/vt_kern.h>
11 #include <linux/nvram.h>
12 #include <linux/spinlock.h>
13 #include <linux/console.h>
14 #include <linux/irq.h>
15 #include <linux/pci.h>
16 #include <linux/delay.h>
17 #include <linux/ide.h>
18 
19 #include <asm/page.h>
20 #include <asm/semaphore.h>
21 #include <asm/processor.h>
22 #include <asm/uaccess.h>
23 #include <asm/io.h>
24 #include <asm/ide.h>
25 #include <asm/atomic.h>
26 #include <asm/bitops.h>
27 #include <asm/checksum.h>
28 #include <asm/pgtable.h>
29 #include <linux/adb.h>
30 #include <linux/cuda.h>
31 #include <linux/pmu.h>
32 #include <asm/prom.h>
33 #include <asm/system.h>
34 #include <asm/pci-bridge.h>
35 #include <asm/irq.h>
36 #include <asm/pmac_feature.h>
37 #include <asm/dma.h>
38 #include <asm/machdep.h>
39 #include <asm/hw_irq.h>
40 #include <asm/nvram.h>
41 #include <asm/mmu_context.h>
42 #include <asm/backlight.h>
43 #ifdef CONFIG_SMP
44 #include <asm/smplock.h>
45 #include <asm/smp.h>
46 #endif /* CONFIG_SMP */
47 #include <asm/time.h>
48 #include <asm/cputable.h>
49 #include <asm/btext.h>
50 #include <asm/div64.h>
51 
52 #ifdef  CONFIG_8xx
53 #include <asm/commproc.h>
54 #endif
55 
56 /* Tell string.h we don't want memcpy etc. as cpp defines */
57 #define EXPORT_SYMTAB_STROPS
58 
59 extern void transfer_to_handler(void);
60 extern void syscall_trace(void);
61 extern void do_IRQ(struct pt_regs *regs);
62 extern void MachineCheckException(struct pt_regs *regs);
63 extern void AlignmentException(struct pt_regs *regs);
64 extern void ProgramCheckException(struct pt_regs *regs);
65 extern void SingleStepException(struct pt_regs *regs);
66 extern int do_signal(sigset_t *, struct pt_regs *);
67 extern int pmac_newworld;
68 extern int sys_sigreturn(struct pt_regs *regs);
69 
70 long long __ashrdi3(long long, int);
71 long long __ashldi3(long long, int);
72 long long __lshrdi3(long long, int);
73 int abs(int);
74 
75 extern unsigned char __res[];
76 
77 extern unsigned long ret_to_user_hook;
78 extern unsigned long mm_ptov (unsigned long paddr);
79 
80 EXPORT_SYMBOL(clear_page);
81 EXPORT_SYMBOL(do_signal);
82 EXPORT_SYMBOL(syscall_trace);
83 EXPORT_SYMBOL(transfer_to_handler);
84 EXPORT_SYMBOL(do_IRQ);
85 EXPORT_SYMBOL(MachineCheckException);
86 EXPORT_SYMBOL(AlignmentException);
87 EXPORT_SYMBOL(ProgramCheckException);
88 EXPORT_SYMBOL(SingleStepException);
89 EXPORT_SYMBOL(sys_sigreturn);
90 EXPORT_SYMBOL(ppc_n_lost_interrupts);
91 EXPORT_SYMBOL(ppc_lost_interrupts);
92 EXPORT_SYMBOL(enable_irq);
93 EXPORT_SYMBOL(disable_irq);
94 EXPORT_SYMBOL(disable_irq_nosync);
95 EXPORT_SYMBOL(probe_irq_mask);
96 #ifdef CONFIG_SMP
97 EXPORT_SYMBOL(kernel_flag);
98 #endif /* CONFIG_SMP */
99 
100 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
101 EXPORT_SYMBOL_NOVERS(DMA_MODE_READ);
102 EXPORT_SYMBOL(DMA_MODE_WRITE);
103 #if defined(CONFIG_ALL_PPC)
104 EXPORT_SYMBOL(_prep_type);
105 EXPORT_SYMBOL(ucSystemType);
106 #endif
107 
108 #if !__INLINE_BITOPS
109 EXPORT_SYMBOL(set_bit);
110 EXPORT_SYMBOL(clear_bit);
111 EXPORT_SYMBOL(change_bit);
112 EXPORT_SYMBOL(test_and_set_bit);
113 EXPORT_SYMBOL(test_and_clear_bit);
114 EXPORT_SYMBOL(test_and_change_bit);
115 #endif /* __INLINE_BITOPS */
116 
117 EXPORT_SYMBOL(strcpy);
118 EXPORT_SYMBOL(strncpy);
119 EXPORT_SYMBOL(strcat);
120 EXPORT_SYMBOL(strncat);
121 EXPORT_SYMBOL(strchr);
122 EXPORT_SYMBOL(strrchr);
123 EXPORT_SYMBOL(strpbrk);
124 EXPORT_SYMBOL(strtok);
125 EXPORT_SYMBOL(strstr);
126 EXPORT_SYMBOL(strlen);
127 EXPORT_SYMBOL(strnlen);
128 EXPORT_SYMBOL(strcmp);
129 EXPORT_SYMBOL(strncmp);
130 EXPORT_SYMBOL(strcasecmp);
131 EXPORT_SYMBOL(__div64_32);
132 
133 /* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */
134 EXPORT_SYMBOL(csum_partial_copy_generic);
135 EXPORT_SYMBOL(ip_fast_csum);
136 EXPORT_SYMBOL(csum_tcpudp_magic);
137 
138 EXPORT_SYMBOL(__copy_tofrom_user);
139 EXPORT_SYMBOL(__clear_user);
140 EXPORT_SYMBOL(__strncpy_from_user);
141 EXPORT_SYMBOL(__strnlen_user);
142 
143 /*
144 EXPORT_SYMBOL(inb);
145 EXPORT_SYMBOL(inw);
146 EXPORT_SYMBOL(inl);
147 EXPORT_SYMBOL(outb);
148 EXPORT_SYMBOL(outw);
149 EXPORT_SYMBOL(outl);
150 EXPORT_SYMBOL(outsl);*/
151 
152 EXPORT_SYMBOL(_insb);
153 EXPORT_SYMBOL(_outsb);
154 EXPORT_SYMBOL(_insw);
155 EXPORT_SYMBOL(_outsw);
156 EXPORT_SYMBOL(_insl);
157 EXPORT_SYMBOL(_outsl);
158 EXPORT_SYMBOL(_insw_ns);
159 EXPORT_SYMBOL(_outsw_ns);
160 EXPORT_SYMBOL(_insl_ns);
161 EXPORT_SYMBOL(_outsl_ns);
162 EXPORT_SYMBOL(iopa);
163 EXPORT_SYMBOL(mm_ptov);
164 EXPORT_SYMBOL(vmalloc_start);
165 EXPORT_SYMBOL(ioremap_bot);
166 EXPORT_SYMBOL(ioremap);
167 #ifdef CONFIG_PTE_64BIT
168 EXPORT_SYMBOL(ioremap64);
169 #endif
170 EXPORT_SYMBOL(__ioremap);
171 EXPORT_SYMBOL(iounmap);
172 
173 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) \
174 	|| defined(CONFIG_USB_STORAGE) || defined(CONFIG_USB_STORAGE_MODULE)
175 EXPORT_SYMBOL(ppc_ide_md);
176 #endif
177 
178 #ifdef CONFIG_PCI
179 EXPORT_SYMBOL_NOVERS(isa_io_base);
180 EXPORT_SYMBOL_NOVERS(isa_mem_base);
181 EXPORT_SYMBOL_NOVERS(pci_dram_offset);
182 EXPORT_SYMBOL(pci_alloc_consistent);
183 EXPORT_SYMBOL(pci_free_consistent);
184 EXPORT_SYMBOL(pci_bus_io_base);
185 EXPORT_SYMBOL(pci_bus_io_base_phys);
186 EXPORT_SYMBOL(pci_bus_mem_base_phys);
187 EXPORT_SYMBOL(pci_bus_to_hose);
188 EXPORT_SYMBOL(pci_resource_to_bus);
189 EXPORT_SYMBOL(pci_phys_to_bus);
190 EXPORT_SYMBOL(pci_bus_to_phys);
191 #endif /* CONFIG_PCI */
192 
193 #ifdef CONFIG_NOT_COHERENT_CACHE
194 EXPORT_SYMBOL(consistent_alloc);
195 EXPORT_SYMBOL(consistent_free);
196 EXPORT_SYMBOL(consistent_sync);
197 EXPORT_SYMBOL(consistent_sync_page);
198 EXPORT_SYMBOL(flush_dcache_all);
199 #endif
200 
201 EXPORT_SYMBOL(start_thread);
202 EXPORT_SYMBOL(kernel_thread);
203 
204 /*EXPORT_SYMBOL(__restore_flags);*/
205 /*EXPORT_SYMBOL(_disable_interrupts);
206   EXPORT_SYMBOL(_enable_interrupts);*/
207 EXPORT_SYMBOL(flush_instruction_cache);
208 EXPORT_SYMBOL(giveup_fpu);
209 EXPORT_SYMBOL(enable_kernel_fp);
210 EXPORT_SYMBOL(flush_icache_range);
211 EXPORT_SYMBOL(flush_dcache_range);
212 EXPORT_SYMBOL(flush_icache_user_range);
213 EXPORT_SYMBOL(flush_icache_page);
214 EXPORT_SYMBOL(flush_dcache_page);
215 EXPORT_SYMBOL(xchg_u32);
216 #ifdef CONFIG_ALTIVEC
217 EXPORT_SYMBOL(last_task_used_altivec);
218 EXPORT_SYMBOL(giveup_altivec);
219 #endif /* CONFIG_ALTIVEC */
220 #ifdef CONFIG_SMP
221 EXPORT_SYMBOL(global_irq_lock);
222 EXPORT_SYMBOL(global_irq_count);
223 EXPORT_SYMBOL(global_irq_holder);
224 EXPORT_SYMBOL(__global_cli);
225 EXPORT_SYMBOL(__global_sti);
226 EXPORT_SYMBOL(__global_save_flags);
227 EXPORT_SYMBOL(__global_restore_flags);
228 #if SPINLOCK_DEBUG
229 EXPORT_SYMBOL(_spin_lock);
230 EXPORT_SYMBOL(_spin_unlock);
231 EXPORT_SYMBOL(spin_trylock);
232 EXPORT_SYMBOL(_read_lock);
233 EXPORT_SYMBOL(_read_unlock);
234 EXPORT_SYMBOL(_write_lock);
235 EXPORT_SYMBOL(_write_unlock);
236 #endif
237 EXPORT_SYMBOL(smp_call_function);
238 EXPORT_SYMBOL(smp_hw_index);
239 EXPORT_SYMBOL(smp_num_cpus);
240 EXPORT_SYMBOL(synchronize_irq);
241 #endif
242 
243 EXPORT_SYMBOL(ppc_md);
244 
245 #ifdef CONFIG_ADB
246 EXPORT_SYMBOL(adb_request);
247 EXPORT_SYMBOL(adb_register);
248 EXPORT_SYMBOL(adb_unregister);
249 EXPORT_SYMBOL(adb_poll);
250 EXPORT_SYMBOL(adb_try_handler_change);
251 #endif /* CONFIG_ADB */
252 #ifdef CONFIG_ADB_CUDA
253 EXPORT_SYMBOL(cuda_request);
254 EXPORT_SYMBOL(cuda_poll);
255 #endif /* CONFIG_ADB_CUDA */
256 #ifdef CONFIG_PMAC_BACKLIGHT
257 EXPORT_SYMBOL(get_backlight_level);
258 EXPORT_SYMBOL(set_backlight_level);
259 EXPORT_SYMBOL(set_backlight_enable);
260 EXPORT_SYMBOL(register_backlight_controller);
261 #endif /* CONFIG_PMAC_BACKLIGHT */
262 #if defined(CONFIG_ALL_PPC)
263 EXPORT_SYMBOL(_machine);
264 EXPORT_SYMBOL_NOVERS(sys_ctrler);
265 EXPORT_SYMBOL(find_devices);
266 EXPORT_SYMBOL(find_type_devices);
267 EXPORT_SYMBOL(find_compatible_devices);
268 EXPORT_SYMBOL(find_path_device);
269 EXPORT_SYMBOL(find_phandle);
270 EXPORT_SYMBOL(device_is_compatible);
271 EXPORT_SYMBOL(machine_is_compatible);
272 EXPORT_SYMBOL(find_all_nodes);
273 EXPORT_SYMBOL(get_property);
274 EXPORT_SYMBOL(request_OF_resource);
275 EXPORT_SYMBOL(release_OF_resource);
276 EXPORT_SYMBOL(pci_device_to_OF_node);
277 EXPORT_SYMBOL(pci_device_from_OF_node);
278 EXPORT_SYMBOL(pmac_newworld);
279 EXPORT_SYMBOL(nvram_read_byte);
280 EXPORT_SYMBOL(nvram_write_byte);
281 EXPORT_SYMBOL(pmac_xpram_read);
282 EXPORT_SYMBOL(pmac_xpram_write);
283 #endif /* defined(CONFIG_ALL_PPC) */
284 #if defined(CONFIG_BOOTX_TEXT)
285 EXPORT_SYMBOL(btext_update_display);
286 #endif
287 #if defined(CONFIG_SCSI) && defined(CONFIG_ALL_PPC)
288 EXPORT_SYMBOL(note_scsi_host);
289 #endif
290 #ifdef CONFIG_VT
291 EXPORT_SYMBOL(kd_mksound);
292 #endif
293 EXPORT_SYMBOL(to_tm);
294 
295 EXPORT_SYMBOL_NOVERS(__ashrdi3);
296 EXPORT_SYMBOL_NOVERS(__ashldi3);
297 EXPORT_SYMBOL_NOVERS(__lshrdi3);
298 EXPORT_SYMBOL_NOVERS(memcpy);
299 EXPORT_SYMBOL_NOVERS(memset);
300 EXPORT_SYMBOL_NOVERS(memmove);
301 EXPORT_SYMBOL_NOVERS(memscan);
302 EXPORT_SYMBOL_NOVERS(memcmp);
303 EXPORT_SYMBOL_NOVERS(memchr);
304 
305 EXPORT_SYMBOL(abs);
306 
307 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_FB)
308 EXPORT_SYMBOL(screen_info);
309 #endif
310 
311 EXPORT_SYMBOL(__delay);
312 EXPORT_SYMBOL(__sti);
313 EXPORT_SYMBOL(__sti_end);
314 EXPORT_SYMBOL(__cli);
315 EXPORT_SYMBOL(__cli_end);
316 EXPORT_SYMBOL(__save_flags_ptr);
317 EXPORT_SYMBOL(__save_flags_ptr_end);
318 EXPORT_SYMBOL(__restore_flags);
319 EXPORT_SYMBOL(__restore_flags_end);
320 EXPORT_SYMBOL(timer_interrupt_intercept);
321 EXPORT_SYMBOL(timer_interrupt);
322 EXPORT_SYMBOL(do_IRQ_intercept);
323 EXPORT_SYMBOL(irq_desc);
324 void ppc_irq_dispatch_handler(struct pt_regs *, int);
325 EXPORT_SYMBOL(ppc_irq_dispatch_handler);
326 EXPORT_SYMBOL(tb_ticks_per_jiffy);
327 EXPORT_SYMBOL(get_wchan);
328 EXPORT_SYMBOL(console_drivers);
329 #ifdef CONFIG_XMON
330 extern void xmon_printf(char *fmt, ...);
331 EXPORT_SYMBOL(xmon);
332 EXPORT_SYMBOL(xmon_printf);
333 #endif
334 EXPORT_SYMBOL(__up);
335 EXPORT_SYMBOL(__down);
336 EXPORT_SYMBOL(__down_interruptible);
337 
338 #if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
339 extern void (*debugger)(struct pt_regs *regs);
340 extern int (*debugger_bpt)(struct pt_regs *regs);
341 extern int (*debugger_sstep)(struct pt_regs *regs);
342 extern int (*debugger_iabr_match)(struct pt_regs *regs);
343 extern int (*debugger_dabr_match)(struct pt_regs *regs);
344 extern void (*debugger_fault_handler)(struct pt_regs *regs);
345 
346 EXPORT_SYMBOL(debugger);
347 EXPORT_SYMBOL(debugger_bpt);
348 EXPORT_SYMBOL(debugger_sstep);
349 EXPORT_SYMBOL(debugger_iabr_match);
350 EXPORT_SYMBOL(debugger_dabr_match);
351 EXPORT_SYMBOL(debugger_fault_handler);
352 #endif
353 
354 #if defined(CONFIG_8xx) || defined(CONFIG_4xx)
355 EXPORT_SYMBOL(__res);
356 #endif
357 #ifdef  CONFIG_8xx
358 EXPORT_SYMBOL(cpm_install_handler);
359 EXPORT_SYMBOL(cpm_free_handler);
360 EXPORT_SYMBOL(m8xx_cpm_hostalloc);
361 EXPORT_SYMBOL(m8xx_cpm_dpalloc);
362 #ifdef CONFIG_8xx_WDT
363 extern int m8xx_wdt_get_timeout(void);
364 extern void m8xx_wdt_reset(void);
365 EXPORT_SYMBOL(m8xx_wdt_get_timeout);
366 EXPORT_SYMBOL(m8xx_wdt_reset);
367 #endif
368 #endif /* CONFIG_8xx */
369 
370 /* Those should really be inline */
371 EXPORT_SYMBOL(atomic_clear_mask);
372 EXPORT_SYMBOL(atomic_set_mask);
373 
374 EXPORT_SYMBOL(ret_to_user_hook);
375 EXPORT_SYMBOL(next_mmu_context);
376 EXPORT_SYMBOL(set_context);
377 EXPORT_SYMBOL(handle_mm_fault); /* For MOL */
378 #ifdef CONFIG_SMP
379 extern int *hash_table_lock;
380 EXPORT_SYMBOL_NOVERS(hash_table_lock); /* For MOL */
381 #endif
382 EXPORT_SYMBOL_NOVERS(disarm_decr);
383 #ifdef CONFIG_PPC_STD_MMU
384 EXPORT_SYMBOL(flush_hash_page); /* For MOL */
385 extern long *intercept_table;
386 EXPORT_SYMBOL(intercept_table);
387 #endif
388 extern long *ret_from_intercept;
389 EXPORT_SYMBOL(ret_from_intercept);
390 EXPORT_SYMBOL(cur_cpu_spec);
391 #if defined(CONFIG_ALL_PPC)
392 extern unsigned long agp_special_page;
393 EXPORT_SYMBOL_NOVERS(agp_special_page);
394 #endif /* defined(CONFIG_ALL_PPC) */
395