Commit 4e3b04fb authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ARM initial annotations

Usual set of initial annotations for a platform.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1fe595bb
...@@ -58,6 +58,8 @@ tune-$(CONFIG_CPU_V6) :=-mtune=strongarm ...@@ -58,6 +58,8 @@ tune-$(CONFIG_CPU_V6) :=-mtune=strongarm
CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm
AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu
CHECK := $(CHECK) -D__arm__=1
#Default value #Default value
DATAADDR := . DATAADDR := .
......
...@@ -206,7 +206,7 @@ static int apm_suspend(void) ...@@ -206,7 +206,7 @@ static int apm_suspend(void)
return err; return err;
} }
static ssize_t apm_read(struct file *fp, char *buf, size_t count, loff_t *ppos) static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
{ {
struct apm_user *as = fp->private_data; struct apm_user *as = fp->private_data;
apm_event_t event; apm_event_t event;
......
...@@ -485,7 +485,7 @@ void ptrace_break(struct task_struct *tsk, struct pt_regs *regs) ...@@ -485,7 +485,7 @@ void ptrace_break(struct task_struct *tsk, struct pt_regs *regs)
info.si_signo = SIGTRAP; info.si_signo = SIGTRAP;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TRAP_BRKPT; info.si_code = TRAP_BRKPT;
info.si_addr = (void *)instruction_pointer(regs); info.si_addr = (void __user *)instruction_pointer(regs);
force_sig_info(SIGTRAP, &info, tsk); force_sig_info(SIGTRAP, &info, tsk);
} }
......
...@@ -419,7 +419,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, ...@@ -419,7 +419,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
__put_user_error(NULL, &frame->uc.uc_link, err); __put_user_error(NULL, &frame->uc.uc_link, err);
memset(&stack, 0, sizeof(stack)); memset(&stack, 0, sizeof(stack));
stack.ss_sp = (void *)current->sas_ss_sp; stack.ss_sp = (void __user *)current->sas_ss_sp;
stack.ss_flags = sas_ss_flags(regs->ARM_sp); stack.ss_flags = sas_ss_flags(regs->ARM_sp);
stack.ss_size = current->sas_ss_size; stack.ss_size = current->sas_ss_size;
err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack)); err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
......
...@@ -178,7 +178,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third, ...@@ -178,7 +178,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
union semun fourth; union semun fourth;
if (!ptr) if (!ptr)
return -EINVAL; return -EINVAL;
if (get_user(fourth.__pad, (void __user **) ptr)) if (get_user(fourth.__pad, (void __user * __user *) ptr))
return -EFAULT; return -EFAULT;
return sys_semctl (first, second, third, fourth); return sys_semctl (first, second, third, fourth);
} }
......
...@@ -263,7 +263,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs) ...@@ -263,7 +263,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
unsigned int instr; unsigned int instr;
struct undef_hook *hook; struct undef_hook *hook;
siginfo_t info; siginfo_t info;
void *pc; void __user *pc;
/* /*
* According to the ARM ARM, PC is 2 or 4 bytes ahead, * According to the ARM ARM, PC is 2 or 4 bytes ahead,
...@@ -272,11 +272,11 @@ asmlinkage void do_undefinstr(struct pt_regs *regs) ...@@ -272,11 +272,11 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
*/ */
regs->ARM_pc -= correction; regs->ARM_pc -= correction;
pc = (void *)instruction_pointer(regs); pc = (void __user *)instruction_pointer(regs);
if (thumb_mode(regs)) { if (thumb_mode(regs)) {
get_user(instr, (u16 *)pc); get_user(instr, (u16 __user *)pc);
} else { } else {
get_user(instr, (u32 *)pc); get_user(instr, (u32 __user *)pc);
} }
spin_lock_irq(&undef_lock); spin_lock_irq(&undef_lock);
...@@ -368,7 +368,7 @@ static int bad_syscall(int n, struct pt_regs *regs) ...@@ -368,7 +368,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
info.si_signo = SIGILL; info.si_signo = SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = ILL_ILLTRP; info.si_code = ILL_ILLTRP;
info.si_addr = (void *)instruction_pointer(regs) - info.si_addr = (void __user *)instruction_pointer(regs) -
(thumb_mode(regs) ? 2 : 4); (thumb_mode(regs) ? 2 : 4);
force_sig_info(SIGILL, &info, current); force_sig_info(SIGILL, &info, current);
...@@ -481,7 +481,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) ...@@ -481,7 +481,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
info.si_signo = SIGILL; info.si_signo = SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = ILL_ILLTRP; info.si_code = ILL_ILLTRP;
info.si_addr = (void *)instruction_pointer(regs) - info.si_addr = (void __user *)instruction_pointer(regs) -
(thumb_mode(regs) ? 2 : 4); (thumb_mode(regs) ? 2 : 4);
force_sig_info(SIGILL, &info, current); force_sig_info(SIGILL, &info, current);
...@@ -519,7 +519,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) ...@@ -519,7 +519,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
info.si_signo = SIGILL; info.si_signo = SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = ILL_ILLOPC; info.si_code = ILL_ILLOPC;
info.si_addr = (void *)addr; info.si_addr = (void __user *)addr;
force_sig_info(SIGILL, &info, current); force_sig_info(SIGILL, &info, current);
die_if_kernel("unknown data abort code", regs, instr); die_if_kernel("unknown data abort code", regs, instr);
......
...@@ -129,7 +129,7 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, ...@@ -129,7 +129,7 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
si.si_signo = SIGSEGV; si.si_signo = SIGSEGV;
si.si_errno = 0; si.si_errno = 0;
si.si_code = code; si.si_code = code;
si.si_addr = (void *)addr; si.si_addr = (void __user *)addr;
force_sig_info(SIGSEGV, &si, tsk); force_sig_info(SIGSEGV, &si, tsk);
} }
......
...@@ -502,7 +502,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc) ...@@ -502,7 +502,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
*/ */
arch_adjust_zones(node, zone_size, zhole_size); arch_adjust_zones(node, zone_size, zhole_size);
free_area_init_node(node, pgdat, 0, zone_size, free_area_init_node(node, pgdat, NULL, zone_size,
bdata->node_boot_start >> PAGE_SHIFT, zhole_size); bdata->node_boot_start >> PAGE_SHIFT, zhole_size);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* See arch/arm/kernel/sys-arm.c for ugly details.. * See arch/arm/kernel/sys-arm.c for ugly details..
*/ */
struct ipc_kludge { struct ipc_kludge {
struct msgbuf *msgp; struct msgbuf __user *msgp;
long msgtyp; long msgtyp;
}; };
......
...@@ -133,7 +133,11 @@ typedef unsigned long sigset_t; ...@@ -133,7 +133,11 @@ typedef unsigned long sigset_t;
#define SIG_SETMASK 2 /* for setting the signal mask */ #define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */ /* Type of a signal handler. */
typedef void (*__sighandler_t)(int); typedef void __signalfn_t(int);
typedef __signalfn_t __user *__sighandler_t;
typedef void __restorefn_t(void);
typedef __restorefn_t __user *__sigrestore_t;
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
...@@ -144,13 +148,13 @@ struct old_sigaction { ...@@ -144,13 +148,13 @@ struct old_sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
old_sigset_t sa_mask; old_sigset_t sa_mask;
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); __sigrestore_t sa_restorer;
}; };
struct sigaction { struct sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
...@@ -177,7 +181,7 @@ struct sigaction { ...@@ -177,7 +181,7 @@ struct sigaction {
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
typedef struct sigaltstack { typedef struct sigaltstack {
void *ss_sp; void __user *ss_sp;
int ss_flags; int ss_flags;
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;
......
...@@ -68,6 +68,7 @@ static inline void set_fs (mm_segment_t fs) ...@@ -68,6 +68,7 @@ static inline void set_fs (mm_segment_t fs)
/* We use 33-bit arithmetic here... */ /* We use 33-bit arithmetic here... */
#define __range_ok(addr,size) ({ \ #define __range_ok(addr,size) ({ \
unsigned long flag, sum; \ unsigned long flag, sum; \
__chk_user_ptr(addr); \
__asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \ __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
: "=&r" (flag), "=&r" (sum) \ : "=&r" (flag), "=&r" (sum) \
: "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \ : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
...@@ -117,7 +118,7 @@ extern int __get_user_bad(void); ...@@ -117,7 +118,7 @@ extern int __get_user_bad(void);
#define get_user(x,p) \ #define get_user(x,p) \
({ \ ({ \
const register typeof(*(p)) *__p asm("r0") = (p); \ const register typeof(*(p)) __user *__p asm("r0") = (p);\
register typeof(*(p)) __r1 asm("r1"); \ register typeof(*(p)) __r1 asm("r1"); \
register int __e asm("r0"); \ register int __e asm("r0"); \
switch (sizeof(*(__p))) { \ switch (sizeof(*(__p))) { \
...@@ -156,6 +157,7 @@ extern int __get_user_bad(void); ...@@ -156,6 +157,7 @@ extern int __get_user_bad(void);
do { \ do { \
unsigned long __gu_addr = (unsigned long)(ptr); \ unsigned long __gu_addr = (unsigned long)(ptr); \
unsigned long __gu_val; \ unsigned long __gu_val; \
__chk_user_ptr(ptr); \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \
case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \
...@@ -236,7 +238,7 @@ extern int __put_user_bad(void); ...@@ -236,7 +238,7 @@ extern int __put_user_bad(void);
#define put_user(x,p) \ #define put_user(x,p) \
({ \ ({ \
const register typeof(*(p)) __r1 asm("r1") = (x); \ const register typeof(*(p)) __r1 asm("r1") = (x); \
const register typeof(*(p)) *__p asm("r0") = (p); \ const register typeof(*(p)) __user *__p asm("r0") = (p);\
register int __e asm("r0"); \ register int __e asm("r0"); \
switch (sizeof(*(__p))) { \ switch (sizeof(*(__p))) { \
case 1: \ case 1: \
...@@ -273,6 +275,7 @@ extern int __put_user_bad(void); ...@@ -273,6 +275,7 @@ extern int __put_user_bad(void);
do { \ do { \
unsigned long __pu_addr = (unsigned long)(ptr); \ unsigned long __pu_addr = (unsigned long)(ptr); \
__typeof__(*(ptr)) __pu_val = (x); \ __typeof__(*(ptr)) __pu_val = (x); \
__chk_user_ptr(ptr); \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \
case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \ case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment