diff options
| author | David S. Miller <davem@davemloft.net> | 2014-05-18 19:03:07 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-05-18 19:03:07 -0700 |
| commit | 311b8935ad4e13bac5880ae3f0c269b0c253d25f (patch) | |
| tree | f44f4feaf7561e74ca14b2d6b992a9c2347d7a31 /arch/sparc/kernel/kernel.h | |
| parent | Merge branch 'sparc32_generic_io_h' (diff) | |
| parent | sparc64: fix sparse warnings in int_64.c (diff) | |
| download | linux-311b8935ad4e13bac5880ae3f0c269b0c253d25f.tar.gz linux-311b8935ad4e13bac5880ae3f0c269b0c253d25f.zip | |
Merge branch 'sparc_sparse_fixes'
Sam Ravnborg says:
====================
sparc sparse fixes + diverse cleanup
v1 => v2
- audit of all patches. I deliberately waited a while
before doing so - in order to look at them with fresh eyes.
- Fix bogus sbus() use found by davem in iommu.c
- Split patch touching iommu.c and io-unit.c in two
- Fix bogus sbus use in time_32 (sbus_readw => sbus_readl)
- Dropped patch that touches signal_64.c
__put_user() does many magic things and I could not convince
myself that dropping a cast of a pointer to (u64) was correct.
- Updated a few changelogs to be more precise/descriptive
- In systbls.h rearrange include and move include to the common part
- Updated cover letter (this mail)
Fix build breakage of sparc32 in certain configurations
Fix sparse warnings in sparc32.
What is remaining:
- "shift too big" warnings in the soft floating point code.
This is too complex - so I dropped trying to fix these
Fix sparse warnings in sparc64.
What is remaining:
- "shift too big" warnings in the soft floating point code (like sparc32)
- pcr.c defines arch_irq_work_raise() which is also defined as __weak in common code.
As I recall there are some issues with weak functions with prototypes
so it is left as-is
- signal32.c issue a lot of "cast removes address space of expression"
This actually deserve an extra look - as I think this may be
some code that mixes two sizes to __put_user()
- viohs.c uses a variable length array
- init_64.c reference vmemmap_free which is properly declared in common code
but seems to be guarded by wrong ifdefs
- signal_64.c mix with __user pointers and wrong casts
None of the remaining sparse warnings looks simple to fix - and any
hints how to proceed are appreciated.
A lot of the sparse warnings are fixed by addding or moving function
prototypes to common files. Many prototypes are for functions
solely called from assembler so they are added only to shut up sparse.
But there is also a lot of prototypes that had local declarations
which are now visible both in the file where the function
is defined and in the file where the function is used.
Change all prototypes in sparc .h files so they do not use extern.
This change touches a lot of files.
Fix so we no longer assumes _NIG_WORDS can have more than one value,
and add a build time check to catch if the value changes anyway.
**The following patches require extra careful review:**
[PATCH 07/34] sparc32: fix sparse warnings in sys_sparc_32.c
The return type of a few syscalls has been changed for sparc32,
to align with sparc64.
I assume this is safe to do.
[PATCH 08/34] sparc32: remove cast from output constraints in math asm statements
[PATCH 09/34] sparc64: remove cast from output constraints in math asm statements
I have not much experience with gcc inline
assembler - so please check that this looks OK.
A cast in the output section of the inline
assembler is dropped - which should be OK.
[PATCH 23/34] sparc64: clean up compat_sigset_t.seta handling
This drops code that assumed _NSIG_WORDS could change.
But as _NIG_WORDS are always constant drop this code.
[PATCH 34/34] sparc64: fix sparse warnings in int_64.c
Introduces some ugly ifdef in the code.
Was not sure if there was a smarter way to do this.
It looked like some code was executed in the
!CONFIG_NEED_MULTIPLE_NODES case which is not required.
For now the simple solution with ifdef was used.
**The following patches touches files outside arch/sparc:**
[PATCH 24/34] sparc64: fix sparse warning in tsb.c
Touches kernel/sysctl.c - removes a few sparc64 specific lines
[PATCH 27/34] sparc: fix sparse warnings in smp_32.c + smp_64.c
Adds prototype for setup_profiling_timer to include/linux/profile.h.
I could not find any obvious candidates to cc: on this patch
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/kernel.h')
| -rw-r--r-- | arch/sparc/kernel/kernel.h | 86 |
1 files changed, 64 insertions, 22 deletions
diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h index de9ac1aa25e8..e7f652be9e61 100644 --- a/arch/sparc/kernel/kernel.h +++ b/arch/sparc/kernel/kernel.h @@ -2,6 +2,7 @@ #define __SPARC_KERNEL_H #include <linux/interrupt.h> +#include <linux/ftrace.h> #include <asm/traps.h> #include <asm/head.h> @@ -15,38 +16,75 @@ extern int ncpus_probed; #ifdef CONFIG_SPARC64 /* setup_64.c */ struct seq_file; -extern void cpucap_info(struct seq_file *); +void cpucap_info(struct seq_file *); -static inline unsigned long kimage_addr_to_ra(const char *p) +static inline unsigned long kimage_addr_to_ra(const void *p) { unsigned long val = (unsigned long) p; return kern_base + (val - KERNBASE); } + +/* sys_sparc_64.c */ +asmlinkage long sys_kern_features(void); + +/* unaligned_64.c */ +asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); +int handle_popc(u32 insn, struct pt_regs *regs); +void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); +void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); + +/* smp_64.c */ +void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs); +void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs); +void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs); +void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs); +void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs); + +/* kgdb_64.c */ +void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs); + +/* pci.c */ +int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask); + +/* signal32.c */ +void do_sigreturn32(struct pt_regs *regs); +asmlinkage void do_rt_sigreturn32(struct pt_regs *regs); +void do_signal32(struct pt_regs * regs); +asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp); + +/* compat_audit.c */ +extern unsigned sparc32_dir_class[]; +extern unsigned sparc32_chattr_class[]; +extern unsigned sparc32_write_class[]; +extern unsigned sparc32_read_class[]; +extern unsigned sparc32_signal_class[]; +int sparc32_classify_syscall(unsigned syscall); #endif #ifdef CONFIG_SPARC32 /* setup_32.c */ +struct linux_romvec; void sparc32_start_kernel(struct linux_romvec *rp); /* cpu.c */ -extern void cpu_probe(void); +void cpu_probe(void); /* traps_32.c */ -extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, - unsigned long npc, unsigned long psr); +void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, + unsigned long npc, unsigned long psr); /* irq_32.c */ extern struct irqaction static_irqaction[]; extern int static_irq_count; extern spinlock_t irq_action_lock; -extern void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); -extern void init_IRQ(void); +void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); +void init_IRQ(void); /* sun4m_irq.c */ -extern void sun4m_init_IRQ(void); -extern void sun4m_unmask_profile_irq(void); -extern void sun4m_clear_profile_irq(int cpu); +void sun4m_init_IRQ(void); +void sun4m_unmask_profile_irq(void); +void sun4m_clear_profile_irq(int cpu); /* sun4m_smp.c */ void sun4m_cpu_pre_starting(void *arg); @@ -60,14 +98,14 @@ void smp4m_percpu_timer_interrupt(struct pt_regs *regs); /* sun4d_irq.c */ extern spinlock_t sun4d_imsk_lock; -extern void sun4d_init_IRQ(void); -extern int sun4d_request_irq(unsigned int irq, - irq_handler_t handler, - unsigned long irqflags, - const char *devname, void *dev_id); -extern int show_sun4d_interrupts(struct seq_file *, void *); -extern void sun4d_distribute_irqs(void); -extern void sun4d_free_irq(unsigned int irq, void *dev_id); +void sun4d_init_IRQ(void); +int sun4d_request_irq(unsigned int irq, + irq_handler_t handler, + unsigned long irqflags, + const char *devname, void *dev_id); +int show_sun4d_interrupts(struct seq_file *, void *); +void sun4d_distribute_irqs(void); +void sun4d_free_irq(unsigned int irq, void *dev_id); /* sun4d_smp.c */ void sun4d_cpu_pre_starting(void *arg); @@ -101,7 +139,7 @@ extern unsigned int real_irq_entry[]; extern unsigned int smp4d_ticker[]; extern unsigned int patchme_maybe_smp_msg[]; -extern void floppy_hardint(void); +void floppy_hardint(void); /* trampoline_32.S */ extern unsigned long sun4m_cpu_startup; @@ -132,13 +170,17 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); /* windows.c */ void try_to_clear_window_buffer(struct pt_regs *regs, int who); -/* tadpole.c */ -void __init clock_stop_probe(void); - /* auxio_32.c */ void __init auxio_probe(void); void __init auxio_power_probe(void); +/* pcic.c */ +extern void __iomem *pcic_regs; +void pcic_nmi(unsigned int pend, struct pt_regs *regs); + +/* time_32.c */ +void __init time_init(void); + #else /* CONFIG_SPARC32 */ #endif /* CONFIG_SPARC32 */ #endif /* !(__SPARC_KERNEL_H) */ |
