1 #ifndef __SPARC_KERNEL_H 2 #define __SPARC_KERNEL_H 3 4 #include <linux/interrupt.h> 5 #include <linux/ftrace.h> 6 7 #include <asm/traps.h> 8 #include <asm/head.h> 9 #include <asm/io.h> 10 11 /* cpu.c */ 12 extern const char *sparc_pmu_type; 13 extern unsigned int fsr_storage; 14 extern int ncpus_probed; 15 16 #ifdef CONFIG_SPARC64 17 /* setup_64.c */ 18 struct seq_file; 19 void cpucap_info(struct seq_file *); 20 21 static inline unsigned long kimage_addr_to_ra(const void *p) 22 { 23 unsigned long val = (unsigned long) p; 24 25 return kern_base + (val - KERNBASE); 26 } 27 28 /* sys_sparc_64.c */ 29 asmlinkage long sys_kern_features(void); 30 31 /* unaligned_64.c */ 32 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 33 int handle_popc(u32 insn, struct pt_regs *regs); 34 void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); 35 void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); 36 37 /* smp_64.c */ 38 void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs); 39 void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs); 40 void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs); 41 void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs); 42 43 /* kgdb_64.c */ 44 void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs); 45 46 /* pci.c */ 47 int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask); 48 49 /* signal32.c */ 50 void do_sigreturn32(struct pt_regs *regs); 51 asmlinkage void do_rt_sigreturn32(struct pt_regs *regs); 52 void do_signal32(struct pt_regs * regs); 53 asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp); 54 55 /* time_64.c */ 56 void __init time_init_early(void); 57 58 /* compat_audit.c */ 59 extern unsigned int sparc32_dir_class[]; 60 extern unsigned int sparc32_chattr_class[]; 61 extern unsigned int sparc32_write_class[]; 62 extern unsigned int sparc32_read_class[]; 63 extern unsigned int sparc32_signal_class[]; 64 int sparc32_classify_syscall(unsigned int syscall); 65 #endif 66 67 #ifdef CONFIG_SPARC32 68 /* setup_32.c */ 69 struct linux_romvec; 70 void sparc32_start_kernel(struct linux_romvec *rp); 71 72 /* cpu.c */ 73 void cpu_probe(void); 74 75 /* traps_32.c */ 76 void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, 77 unsigned long npc, unsigned long psr); 78 /* irq_32.c */ 79 extern struct irqaction static_irqaction[]; 80 extern int static_irq_count; 81 extern spinlock_t irq_action_lock; 82 83 void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); 84 void init_IRQ(void); 85 86 /* sun4m_irq.c */ 87 void sun4m_init_IRQ(void); 88 void sun4m_unmask_profile_irq(void); 89 void sun4m_clear_profile_irq(int cpu); 90 91 /* sun4m_smp.c */ 92 void sun4m_cpu_pre_starting(void *arg); 93 void sun4m_cpu_pre_online(void *arg); 94 void __init smp4m_boot_cpus(void); 95 int smp4m_boot_one_cpu(int i, struct task_struct *idle); 96 void __init smp4m_smp_done(void); 97 void smp4m_cross_call_irq(void); 98 void smp4m_percpu_timer_interrupt(struct pt_regs *regs); 99 100 /* sun4d_irq.c */ 101 extern spinlock_t sun4d_imsk_lock; 102 103 void sun4d_init_IRQ(void); 104 int sun4d_request_irq(unsigned int irq, 105 irq_handler_t handler, 106 unsigned long irqflags, 107 const char *devname, void *dev_id); 108 int show_sun4d_interrupts(struct seq_file *, void *); 109 void sun4d_distribute_irqs(void); 110 void sun4d_free_irq(unsigned int irq, void *dev_id); 111 112 /* sun4d_smp.c */ 113 void sun4d_cpu_pre_starting(void *arg); 114 void sun4d_cpu_pre_online(void *arg); 115 void __init smp4d_boot_cpus(void); 116 int smp4d_boot_one_cpu(int i, struct task_struct *idle); 117 void __init smp4d_smp_done(void); 118 void smp4d_cross_call_irq(void); 119 void smp4d_percpu_timer_interrupt(struct pt_regs *regs); 120 121 /* leon_smp.c */ 122 void leon_cpu_pre_starting(void *arg); 123 void leon_cpu_pre_online(void *arg); 124 void leonsmp_ipi_interrupt(void); 125 void leon_cross_call_irq(void); 126 127 /* head_32.S */ 128 extern unsigned int t_nmi[]; 129 extern unsigned int linux_trap_ipi15_sun4d[]; 130 extern unsigned int linux_trap_ipi15_sun4m[]; 131 132 extern struct tt_entry trapbase; 133 extern struct tt_entry trapbase_cpu1; 134 extern struct tt_entry trapbase_cpu2; 135 extern struct tt_entry trapbase_cpu3; 136 137 extern char cputypval[]; 138 139 /* entry.S */ 140 extern unsigned long lvl14_save[4]; 141 extern unsigned int real_irq_entry[]; 142 extern unsigned int smp4d_ticker[]; 143 extern unsigned int patchme_maybe_smp_msg[]; 144 145 void floppy_hardint(void); 146 147 /* trampoline_32.S */ 148 extern unsigned long sun4m_cpu_startup; 149 extern unsigned long sun4d_cpu_startup; 150 151 /* process_32.c */ 152 asmlinkage int sparc_do_fork(unsigned long clone_flags, 153 unsigned long stack_start, 154 struct pt_regs *regs, 155 unsigned long stack_size); 156 157 /* signal_32.c */ 158 asmlinkage void do_sigreturn(struct pt_regs *regs); 159 asmlinkage void do_rt_sigreturn(struct pt_regs *regs); 160 void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, 161 unsigned long thread_info_flags); 162 asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, 163 struct sigstack __user *ossptr, 164 unsigned long sp); 165 166 /* ptrace_32.c */ 167 asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); 168 169 /* unaligned_32.c */ 170 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 171 asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); 172 173 /* windows.c */ 174 void try_to_clear_window_buffer(struct pt_regs *regs, int who); 175 176 /* auxio_32.c */ 177 void __init auxio_probe(void); 178 void __init auxio_power_probe(void); 179 180 /* pcic.c */ 181 extern void __iomem *pcic_regs; 182 void pcic_nmi(unsigned int pend, struct pt_regs *regs); 183 184 /* time_32.c */ 185 void __init time_init(void); 186 187 #else /* CONFIG_SPARC32 */ 188 #endif /* CONFIG_SPARC32 */ 189 #endif /* !(__SPARC_KERNEL_H) */ 190