Skip to content

Commit

Permalink
sh: fixup many sparse errors.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Sep 8, 2008
1 parent 7d96169 commit fa43972
Show file tree
Hide file tree
Showing 33 changed files with 220 additions and 61 deletions.
2 changes: 1 addition & 1 deletion arch/sh/boot/compressed/misc_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ long* stack_start = &user_stack[STACK_SIZE];

void decompress_kernel(void)
{
output_data = 0;
output_data = NULL;
output_ptr = PHYSADDR((unsigned long)&_text+PAGE_SIZE);
#ifdef CONFIG_29BIT
output_ptr |= P2SEG;
Expand Down
1 change: 1 addition & 0 deletions arch/sh/include/asm/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct clk {

/* Should be defined by processor-specific code */
void arch_init_clk_ops(struct clk_ops **, int type);
int __init arch_clk_init(void);

/* arch/sh/kernel/cpu/clock.c */
int clk_init(void);
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ __BUILD_MEMORY_STRING(w, u16)

#define IO_SPACE_LIMIT 0xffffffff

extern unsigned long generic_io_base;

/*
* This function provides a method for the generic case where a board-specific
* ioport_map simply needs to return the port + some arbitrary port base.
Expand All @@ -203,8 +205,6 @@ __BUILD_MEMORY_STRING(w, u16)
*/
static inline void __set_io_port_base(unsigned long pbase)
{
extern unsigned long generic_io_base;

generic_io_base = pbase;
}

Expand Down
3 changes: 3 additions & 0 deletions arch/sh/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ static inline int generic_irq_demux(int irq)
#define irq_canonicalize(irq) (irq)
#define irq_demux(irq) sh_mv.mv_irq_demux(irq)

void init_IRQ(void);
asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);

#ifdef CONFIG_IRQSTACKS
extern void irq_ctx_init(int cpu);
extern void irq_ctx_exit(int cpu);
Expand Down
4 changes: 4 additions & 0 deletions arch/sh/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ enum cpu_type {

/* Forward decl */
struct sh_cpuinfo;
struct seq_operations;

extern struct pt_regs fake_swapper_regs;

/* arch/sh/kernel/setup.c */
const char *get_cpu_subtype(struct sh_cpuinfo *c);
extern const struct seq_operations cpuinfo_op;

#ifdef CONFIG_VSYSCALL
int vsyscall_init(void);
Expand Down
3 changes: 3 additions & 0 deletions arch/sh/include/asm/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifdef __KERNEL__

#include <linux/compiler.h>
#include <linux/linkage.h>
#include <asm/page.h>
#include <asm/types.h>
#include <asm/cache.h>
Expand Down Expand Up @@ -44,6 +45,8 @@ extern struct sh_cpuinfo cpu_data[];
#define current_cpu_data cpu_data[smp_processor_id()]
#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]

asmlinkage void __init sh_cpu_init(void);

/*
* User space process size: 2GB.
*
Expand Down
2 changes: 0 additions & 2 deletions arch/sh/include/asm/processor_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ struct thread_struct {
#define INIT_MMAP \
{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }

extern struct pt_regs fake_swapper_regs;

#define INIT_THREAD { \
.sp = sizeof(init_stack) + \
(long) &init_stack, \
Expand Down
1 change: 1 addition & 0 deletions arch/sh/include/asm/rtc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _ASM_RTC_H
#define _ASM_RTC_H

void time_init(void);
extern void (*board_time_init)(void);
extern void (*rtc_sh_get_time)(struct timespec *);
extern int (*rtc_sh_set_time)(const time_t);
Expand Down
2 changes: 2 additions & 0 deletions arch/sh/include/asm/setup.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _SH_SETUP_H
#define _SH_SETUP_H

#include <asm/mmzone.h>

#define COMMAND_LINE_SIZE 256

#ifdef __KERNEL__
Expand Down
25 changes: 25 additions & 0 deletions arch/sh/include/asm/syscalls.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef __ASM_SH_SYSCALLS_H
#define __ASM_SH_SYSCALLS_H

#ifdef __KERNEL__

struct old_utsname;

asmlinkage int old_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
int fd, unsigned long off);
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
asmlinkage int sys_ipc(uint call, int first, int second,
int third, void __user *ptr, long fifth);
asmlinkage int sys_uname(struct old_utsname __user *name);

#ifdef CONFIG_SUPERH32
# include "syscalls_32.h"
#else
# include "syscalls_64.h"
#endif

#endif /* __KERNEL__ */
#endif /* __ASM_SH_SYSCALLS_H */
56 changes: 56 additions & 0 deletions arch/sh/include/asm/syscalls_32.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#ifndef __ASM_SH_SYSCALLS_32_H
#define __ASM_SH_SYSCALLS_32_H

#ifdef __KERNEL__

#include <linux/compiler.h>
#include <linux/linkage.h>
#include <linux/types.h>

struct pt_regs;

asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
unsigned long parent_tidptr,
unsigned long child_tidptr,
struct pt_regs __regs);
asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv,
char __user * __user *uenvp, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act,
struct old_sigaction __user *oact);
asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
size_t count, long dummy, loff_t pos);
asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
size_t count, long dummy, loff_t pos);
asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1,
u32 len0, u32 len1, int advice);

/* Misc syscall related bits */
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
unsigned long thread_info_flags);

#endif /* __KERNEL__ */
#endif /* __ASM_SH_SYSCALLS_32_H */
34 changes: 34 additions & 0 deletions arch/sh/include/asm/syscalls_64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef __ASM_SH_SYSCALLS_64_H
#define __ASM_SH_SYSCALLS_64_H

#ifdef __KERNEL__

#include <linux/compiler.h>
#include <linux/linkage.h>
#include <linux/types.h>

struct pt_regs;

asmlinkage int sys_fork(unsigned long r2, unsigned long r3,
unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs *pregs);
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs *pregs);
asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs *pregs);
asmlinkage int sys_execve(char *ufilename, char **uargv,
char **uenvp, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs *pregs);

/* Misc syscall related bits */
asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs);
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);

#endif /* __KERNEL__ */
#endif /* __ASM_SH_SYSCALLS_64_H */
6 changes: 4 additions & 2 deletions arch/sh/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
})

extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
void free_initmem(void);
void free_initrd_mem(unsigned long start, unsigned long end);

extern void *set_exception_table_vec(unsigned int vec, void *handler);

Expand Down Expand Up @@ -179,8 +181,8 @@ BUILD_TRAP_HANDLER(fpu_state_restore);
#define arch_align_stack(x) (x)

struct mem_access {
unsigned long (*from)(void *dst, const void *src, unsigned long cnt);
unsigned long (*to)(void *dst, const void *src, unsigned long cnt);
unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt);
unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt);
};

#ifdef CONFIG_SUPERH32
Expand Down
16 changes: 16 additions & 0 deletions arch/sh/include/asm/system_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,20 @@ do { \
int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs,
struct mem_access *ma);

asmlinkage void do_address_error(struct pt_regs *regs,
unsigned long writeaccess,
unsigned long address);
asmlinkage void do_divide_error(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);

#endif /* __ASM_SH_SYSTEM_32_H */
5 changes: 3 additions & 2 deletions arch/sh/kernel/cpu/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,10 @@ arch_init_clk_ops(struct clk_ops **ops, int type)
{
}

void __init __attribute__ ((weak))
int __init __attribute__ ((weak))
arch_clk_init(void)
{
return 0;
}

static int show_clocks(char *buf, char **start, off_t off,
Expand Down Expand Up @@ -331,7 +332,7 @@ int __init clk_init(void)
ret |= clk_register(clk);
}

arch_clk_init();
ret |= arch_clk_init();

/* Kick the child clocks.. */
propagate_rate(&master_clk);
Expand Down
6 changes: 3 additions & 3 deletions arch/sh/kernel/io_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void generic_insb(unsigned long port, void *dst, unsigned long count)
volatile u8 *port_addr;
u8 *buf = dst;

port_addr = (volatile u8 *)__ioport_map(port, 1);
port_addr = (volatile u8 __force *)__ioport_map(port, 1);
while (count--)
*buf++ = *port_addr;
}
Expand All @@ -91,7 +91,7 @@ void generic_insw(unsigned long port, void *dst, unsigned long count)
volatile u16 *port_addr;
u16 *buf = dst;

port_addr = (volatile u16 *)__ioport_map(port, 2);
port_addr = (volatile u16 __force *)__ioport_map(port, 2);
while (count--)
*buf++ = *port_addr;

Expand All @@ -103,7 +103,7 @@ void generic_insl(unsigned long port, void *dst, unsigned long count)
volatile u32 *port_addr;
u32 *buf = dst;

port_addr = (volatile u32 *)__ioport_map(port, 4);
port_addr = (volatile u32 __force *)__ioport_map(port, 4);
while (count--)
*buf++ = *port_addr;

Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/machvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/string.h>
#include <asm/machvec.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/io.h>
#include <asm/irq.h>

Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <asm/system.h>
#include <asm/ubc.h>
#include <asm/fpu.h>
#include <asm/syscalls.h>

static int hlt_counter;
int ubc_usercnt = 0;
Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/io.h>
#include <asm/syscalls.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
Expand Down
6 changes: 4 additions & 2 deletions arch/sh/kernel/ptrace_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <asm/system.h>
#include <asm/processor.h>
#include <asm/mmu_context.h>
#include <asm/syscalls.h>

/*
* does not yet catch signals sent when the child dies.
Expand Down Expand Up @@ -105,6 +106,7 @@ void ptrace_disable(struct task_struct *child)
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
{
struct user * dummy = NULL;
unsigned long __user *datap = (unsigned long __user *)data;
int ret;

switch (request) {
Expand Down Expand Up @@ -133,7 +135,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
tmp = !!tsk_used_math(child);
else
tmp = 0;
ret = put_user(tmp, (unsigned long __user *)data);
ret = put_user(tmp, datap);
break;
}

Expand Down Expand Up @@ -202,7 +204,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
}

ret = 0;
if (put_user(tmp, (unsigned long *) data)) {
if (put_user(tmp, datap)) {
ret = -EFAULT;
break;
}
Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/ptrace_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <asm/system.h>
#include <asm/processor.h>
#include <asm/mmu_context.h>
#include <asm/syscalls.h>
#include <asm/fpu.h>

/* This mask defines the bits of the SR which the user is not allowed to
Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/err.h>
#include <linux/debugfs.h>
#include <linux/crash_dump.h>
#include <linux/mmzone.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/page.h>
Expand Down
Loading

0 comments on commit fa43972

Please sign in to comment.