Commit 111610ab authored by David S. Miller's avatar David S. Miller

[SPARC64]: Lots of sparse work for arch/sparc64.

parent ab843583
...@@ -509,7 +509,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev) ...@@ -509,7 +509,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
fill_ebus_child(node, &regs[0], fill_ebus_child(node, &regs[0],
child, child_regs_nonstandard(dev)); child, child_regs_nonstandard(dev));
while ((node = prom_getsibling(node))) { while ((node = prom_getsibling(node)) != 0) {
child->next = ebus_alloc(sizeof(struct linux_ebus_child)); child->next = ebus_alloc(sizeof(struct linux_ebus_child));
child = child->next; child = child->next;
...@@ -611,7 +611,7 @@ void __init ebus_init(void) ...@@ -611,7 +611,7 @@ void __init ebus_init(void)
dev->bus = ebus; dev->bus = ebus;
fill_ebus_device(nd, dev); fill_ebus_device(nd, dev);
while ((nd = prom_getsibling(nd))) { while ((nd = prom_getsibling(nd)) != 0) {
dev->next = ebus_alloc(sizeof(struct linux_ebus_device)); dev->next = ebus_alloc(sizeof(struct linux_ebus_device));
dev = dev->next; dev = dev->next;
......
...@@ -60,11 +60,11 @@ static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -60,11 +60,11 @@ static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
u32 r, g, b; u32 r, g, b;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
ret = get_user(f.index, &(((struct fbcmap32 *)arg)->index)); ret = get_user(f.index, &(((struct fbcmap32 __user *)arg)->index));
ret |= __get_user(f.count, &(((struct fbcmap32 *)arg)->count)); ret |= __get_user(f.count, &(((struct fbcmap32 __user *)arg)->count));
ret |= __get_user(r, &(((struct fbcmap32 *)arg)->red)); ret |= __get_user(r, &(((struct fbcmap32 __user *)arg)->red));
ret |= __get_user(g, &(((struct fbcmap32 *)arg)->green)); ret |= __get_user(g, &(((struct fbcmap32 __user *)arg)->green));
ret |= __get_user(b, &(((struct fbcmap32 *)arg)->blue)); ret |= __get_user(b, &(((struct fbcmap32 __user *)arg)->blue));
if (ret) if (ret)
return -EFAULT; return -EFAULT;
if ((f.index < 0) || (f.index > 255)) return -EINVAL; if ((f.index < 0) || (f.index > 255)) return -EINVAL;
...@@ -113,16 +113,21 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -113,16 +113,21 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
u32 m, i; u32 m, i;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
ret = copy_from_user (&f, (struct fbcursor32 *)arg, 2 * sizeof (short) + 2 * sizeof(struct fbcurpos)); ret = copy_from_user (&f, (struct fbcursor32 __user *) arg,
ret |= __get_user(f.size.x, &(((struct fbcursor32 *)arg)->size.x)); 2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
ret |= __get_user(f.size.y, &(((struct fbcursor32 *)arg)->size.y)); ret |= __get_user(f.size.x,
ret |= __get_user(f.cmap.index, &(((struct fbcursor32 *)arg)->cmap.index)); &(((struct fbcursor32 __user *)arg)->size.x));
ret |= __get_user(f.cmap.count, &(((struct fbcursor32 *)arg)->cmap.count)); ret |= __get_user(f.size.y,
ret |= __get_user(r, &(((struct fbcursor32 *)arg)->cmap.red)); &(((struct fbcursor32 __user *)arg)->size.y));
ret |= __get_user(g, &(((struct fbcursor32 *)arg)->cmap.green)); ret |= __get_user(f.cmap.index,
ret |= __get_user(b, &(((struct fbcursor32 *)arg)->cmap.blue)); &(((struct fbcursor32 __user *)arg)->cmap.index));
ret |= __get_user(m, &(((struct fbcursor32 *)arg)->mask)); ret |= __get_user(f.cmap.count,
ret |= __get_user(i, &(((struct fbcursor32 *)arg)->image)); &(((struct fbcursor32 __user *)arg)->cmap.count));
ret |= __get_user(r, &(((struct fbcursor32 __user *)arg)->cmap.red));
ret |= __get_user(g, &(((struct fbcursor32 __user *)arg)->cmap.green));
ret |= __get_user(b, &(((struct fbcursor32 __user *)arg)->cmap.blue));
ret |= __get_user(m, &(((struct fbcursor32 __user *)arg)->mask));
ret |= __get_user(i, &(((struct fbcursor32 __user *)arg)->image));
if (ret) if (ret)
return -EFAULT; return -EFAULT;
if (f.set & FB_CUR_SETCMAP) { if (f.set & FB_CUR_SETCMAP) {
...@@ -167,7 +172,7 @@ typedef struct drm32_version { ...@@ -167,7 +172,7 @@ typedef struct drm32_version {
static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_version_t *uversion = (drm32_version_t *)arg; drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
char __user *name_ptr, *date_ptr, *desc_ptr; char __user *name_ptr, *date_ptr, *desc_ptr;
u32 tmp1, tmp2, tmp3; u32 tmp1, tmp2, tmp3;
drm_version_t kversion; drm_version_t kversion;
...@@ -245,7 +250,7 @@ typedef struct drm32_unique { ...@@ -245,7 +250,7 @@ typedef struct drm32_unique {
static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_unique_t *uarg = (drm32_unique_t *)arg; drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
drm_unique_t karg; drm_unique_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
char __user *uptr; char __user *uptr;
...@@ -309,7 +314,7 @@ typedef struct drm32_map { ...@@ -309,7 +314,7 @@ typedef struct drm32_map {
static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_map_t *uarg = (drm32_map_t *) arg; drm32_map_t __user *uarg = (drm32_map_t __user *) arg;
drm_map_t karg; drm_map_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
u32 tmp; u32 tmp;
...@@ -324,7 +329,7 @@ static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -324,7 +329,7 @@ static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
if (ret) if (ret)
return -EFAULT; return -EFAULT;
karg.handle = A(tmp); karg.handle = (void *) (unsigned long) tmp;
old_fs = get_fs(); old_fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
...@@ -354,7 +359,7 @@ typedef struct drm32_buf_info { ...@@ -354,7 +359,7 @@ typedef struct drm32_buf_info {
static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_buf_info_t *uarg = (drm32_buf_info_t *)arg; drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
drm_buf_desc_t __user *ulist; drm_buf_desc_t __user *ulist;
drm_buf_info_t karg; drm_buf_info_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
...@@ -400,7 +405,7 @@ typedef struct drm32_buf_free { ...@@ -400,7 +405,7 @@ typedef struct drm32_buf_free {
static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_buf_free_t *uarg = (drm32_buf_free_t *)arg; drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
drm_buf_free_t karg; drm_buf_free_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
int __user *ulist; int __user *ulist;
...@@ -448,7 +453,7 @@ typedef struct drm32_buf_map { ...@@ -448,7 +453,7 @@ typedef struct drm32_buf_map {
static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_buf_map_t *uarg = (drm32_buf_map_t *)arg; drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
drm32_buf_pub_t __user *ulist; drm32_buf_pub_t __user *ulist;
drm_buf_map_t karg; drm_buf_map_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
...@@ -460,7 +465,7 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -460,7 +465,7 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
get_user(tmp2, &uarg->list)) get_user(tmp2, &uarg->list))
return -EFAULT; return -EFAULT;
karg.virtual = A(tmp1); karg.virtual = (void *) (unsigned long) tmp1;
ulist = A(tmp2); ulist = A(tmp2);
orig_count = karg.count; orig_count = karg.count;
...@@ -477,7 +482,7 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -477,7 +482,7 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
get_user(tmp1, &ulist[i].address)) get_user(tmp1, &ulist[i].address))
goto out; goto out;
karg.list[i].address = A(tmp1); karg.list[i].address = (void *) (unsigned long) tmp1;
} }
old_fs = get_fs(); old_fs = get_fs();
...@@ -527,7 +532,7 @@ typedef struct drm32_dma { ...@@ -527,7 +532,7 @@ typedef struct drm32_dma {
*/ */
static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_dma_t *uarg = (drm32_dma_t *) arg; drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
int __user *u_si, *u_ss, *u_ri, *u_rs; int __user *u_si, *u_ss, *u_ri, *u_rs;
drm_dma_t karg; drm_dma_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
...@@ -637,7 +642,7 @@ typedef struct drm32_ctx_res { ...@@ -637,7 +642,7 @@ typedef struct drm32_ctx_res {
static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg) static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
drm32_ctx_res_t *uarg = (drm32_ctx_res_t *) arg; drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
drm_ctx_t __user *ulist; drm_ctx_t __user *ulist;
drm_ctx_res_t karg; drm_ctx_res_t karg;
mm_segment_t old_fs; mm_segment_t old_fs;
......
...@@ -1164,7 +1164,7 @@ static struct proc_dir_entry * irq_dir [NUM_IVECS]; ...@@ -1164,7 +1164,7 @@ static struct proc_dir_entry * irq_dir [NUM_IVECS];
#define HEX_DIGITS 16 #define HEX_DIGITS 16
static unsigned int parse_hex_value (const char *buffer, static unsigned int parse_hex_value (const char __user *buffer,
unsigned long count, unsigned long *ret) unsigned long count, unsigned long *ret)
{ {
unsigned char hexnum [HEX_DIGITS]; unsigned char hexnum [HEX_DIGITS];
...@@ -1233,7 +1233,7 @@ static inline void set_intr_affinity(int irq, unsigned long hw_aff) ...@@ -1233,7 +1233,7 @@ static inline void set_intr_affinity(int irq, unsigned long hw_aff)
*/ */
} }
static int irq_affinity_write_proc (struct file *file, const char *buffer, static int irq_affinity_write_proc (struct file *file, const char __user *buffer,
unsigned long count, void *data) unsigned long count, void *data)
{ {
int irq = (long) data, full_count = count, err; int irq = (long) data, full_count = count, err;
......
...@@ -31,7 +31,7 @@ static void module_unmap(void * addr) ...@@ -31,7 +31,7 @@ static void module_unmap(void * addr)
return; return;
} }
for (p = &modvmlist ; (tmp = *p) ; p = &tmp->next) { for (p = &modvmlist; (tmp = *p) != NULL; p = &tmp->next) {
if (tmp->addr == addr) { if (tmp->addr == addr) {
*p = tmp->next; *p = tmp->next;
goto found; goto found;
...@@ -66,7 +66,7 @@ static void *module_map(unsigned long size) ...@@ -66,7 +66,7 @@ static void *module_map(unsigned long size)
return NULL; return NULL;
addr = (void *) MODULES_VADDR; addr = (void *) MODULES_VADDR;
for (p = &modvmlist; (tmp = *p) ; p = &tmp->next) { for (p = &modvmlist; (tmp = *p) != NULL; p = &tmp->next) {
if (size + (unsigned long) addr < (unsigned long) tmp->addr) if (size + (unsigned long) addr < (unsigned long) tmp->addr)
break; break;
addr = (void *) (tmp->size + (unsigned long) tmp->addr); addr = (void *) (tmp->size + (unsigned long) tmp->addr);
......
This diff is collapsed.
...@@ -56,24 +56,24 @@ ...@@ -56,24 +56,24 @@
#define SCHIZO_STRBUF_CTRL_ENAB 0x0000000000000001UL /* Streaming Buffer Enable */ #define SCHIZO_STRBUF_CTRL_ENAB 0x0000000000000001UL /* Streaming Buffer Enable */
/* IOMMU control register. */ /* IOMMU control register. */
#define SCHIZO_IOMMU_CTRL_RESV 0xfffffffff9000000 /* Reserved */ #define SCHIZO_IOMMU_CTRL_RESV 0xfffffffff9000000UL /* Reserved */
#define SCHIZO_IOMMU_CTRL_XLTESTAT 0x0000000006000000 /* Translation Error Status */ #define SCHIZO_IOMMU_CTRL_XLTESTAT 0x0000000006000000UL /* Translation Error Status */
#define SCHIZO_IOMMU_CTRL_XLTEERR 0x0000000001000000 /* Translation Error encountered */ #define SCHIZO_IOMMU_CTRL_XLTEERR 0x0000000001000000UL /* Translation Error encountered */
#define SCHIZO_IOMMU_CTRL_LCKEN 0x0000000000800000 /* Enable translation locking */ #define SCHIZO_IOMMU_CTRL_LCKEN 0x0000000000800000UL /* Enable translation locking */
#define SCHIZO_IOMMU_CTRL_LCKPTR 0x0000000000780000 /* Translation lock pointer */ #define SCHIZO_IOMMU_CTRL_LCKPTR 0x0000000000780000UL /* Translation lock pointer */
#define SCHIZO_IOMMU_CTRL_TSBSZ 0x0000000000070000 /* TSB Size */ #define SCHIZO_IOMMU_CTRL_TSBSZ 0x0000000000070000UL /* TSB Size */
#define SCHIZO_IOMMU_TSBSZ_1K 0x0000000000000000 /* TSB Table 1024 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_1K 0x0000000000000000UL /* TSB Table 1024 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_2K 0x0000000000010000 /* TSB Table 2048 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_2K 0x0000000000010000UL /* TSB Table 2048 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_4K 0x0000000000020000 /* TSB Table 4096 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_4K 0x0000000000020000UL /* TSB Table 4096 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_8K 0x0000000000030000 /* TSB Table 8192 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_8K 0x0000000000030000UL /* TSB Table 8192 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_16K 0x0000000000040000 /* TSB Table 16k 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_16K 0x0000000000040000UL /* TSB Table 16k 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_32K 0x0000000000050000 /* TSB Table 32k 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_32K 0x0000000000050000UL /* TSB Table 32k 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_64K 0x0000000000060000 /* TSB Table 64k 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_64K 0x0000000000060000UL /* TSB Table 64k 8-byte entries */
#define SCHIZO_IOMMU_TSBSZ_128K 0x0000000000070000 /* TSB Table 128k 8-byte entries */ #define SCHIZO_IOMMU_TSBSZ_128K 0x0000000000070000UL /* TSB Table 128k 8-byte entries */
#define SCHIZO_IOMMU_CTRL_RESV2 0x000000000000fff8 /* Reserved */ #define SCHIZO_IOMMU_CTRL_RESV2 0x000000000000fff8UL /* Reserved */
#define SCHIZO_IOMMU_CTRL_TBWSZ 0x0000000000000004 /* Assumed page size, 0=8k 1=64k */ #define SCHIZO_IOMMU_CTRL_TBWSZ 0x0000000000000004UL /* Assumed page size, 0=8k 1=64k */
#define SCHIZO_IOMMU_CTRL_DENAB 0x0000000000000002 /* Diagnostic mode enable */ #define SCHIZO_IOMMU_CTRL_DENAB 0x0000000000000002UL /* Diagnostic mode enable */
#define SCHIZO_IOMMU_CTRL_ENAB 0x0000000000000001 /* IOMMU Enable */ #define SCHIZO_IOMMU_CTRL_ENAB 0x0000000000000001UL /* IOMMU Enable */
/* Schizo config space address format is nearly identical to /* Schizo config space address format is nearly identical to
* that of PSYCHO: * that of PSYCHO:
...@@ -1111,9 +1111,9 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs * ...@@ -1111,9 +1111,9 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *
/* Nearly identical to PSYCHO equivalents... */ /* Nearly identical to PSYCHO equivalents... */
#define SCHIZO_ECC_CTRL 0x10020UL #define SCHIZO_ECC_CTRL 0x10020UL
#define SCHIZO_ECCCTRL_EE 0x8000000000000000 /* Enable ECC Checking */ #define SCHIZO_ECCCTRL_EE 0x8000000000000000UL /* Enable ECC Checking */
#define SCHIZO_ECCCTRL_UE 0x4000000000000000 /* Enable UE Interrupts */ #define SCHIZO_ECCCTRL_UE 0x4000000000000000UL /* Enable UE Interrupts */
#define SCHIZO_ECCCTRL_CE 0x2000000000000000 /* Enable CE INterrupts */ #define SCHIZO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */
#define SCHIZO_SAFARI_ERRCTRL 0x10008UL #define SCHIZO_SAFARI_ERRCTRL 0x10008UL
#define SCHIZO_SAFERRCTRL_EN 0x8000000000000000UL #define SCHIZO_SAFERRCTRL_EN 0x8000000000000000UL
......
...@@ -160,39 +160,43 @@ EXPORT_SYMBOL(machine_restart); ...@@ -160,39 +160,43 @@ EXPORT_SYMBOL(machine_restart);
static void show_regwindow32(struct pt_regs *regs) static void show_regwindow32(struct pt_regs *regs)
{ {
struct reg_window32 *rw; struct reg_window32 __user *rw;
struct reg_window32 r_w; struct reg_window32 r_w;
mm_segment_t old_fs; mm_segment_t old_fs;
__asm__ __volatile__ ("flushw"); __asm__ __volatile__ ("flushw");
rw = (struct reg_window32 *)((long)(unsigned)regs->u_regs[14]); rw = (struct reg_window32 __user *)((long)(unsigned)regs->u_regs[14]);
old_fs = get_fs(); old_fs = get_fs();
set_fs (USER_DS); set_fs (USER_DS);
if (copy_from_user (&r_w, rw, sizeof(r_w))) { if (copy_from_user (&r_w, rw, sizeof(r_w))) {
set_fs (old_fs); set_fs (old_fs);
return; return;
} }
rw = &r_w;
set_fs (old_fs); set_fs (old_fs);
printk("l0: %08x l1: %08x l2: %08x l3: %08x " printk("l0: %08x l1: %08x l2: %08x l3: %08x "
"l4: %08x l5: %08x l6: %08x l7: %08x\n", "l4: %08x l5: %08x l6: %08x l7: %08x\n",
rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3], r_w.locals[0], r_w.locals[1], r_w.locals[2], r_w.locals[3],
rw->locals[4], rw->locals[5], rw->locals[6], rw->locals[7]); r_w.locals[4], r_w.locals[5], r_w.locals[6], r_w.locals[7]);
printk("i0: %08x i1: %08x i2: %08x i3: %08x " printk("i0: %08x i1: %08x i2: %08x i3: %08x "
"i4: %08x i5: %08x i6: %08x i7: %08x\n", "i4: %08x i5: %08x i6: %08x i7: %08x\n",
rw->ins[0], rw->ins[1], rw->ins[2], rw->ins[3], r_w.ins[0], r_w.ins[1], r_w.ins[2], r_w.ins[3],
rw->ins[4], rw->ins[5], rw->ins[6], rw->ins[7]); r_w.ins[4], r_w.ins[5], r_w.ins[6], r_w.ins[7]);
} }
static void show_regwindow(struct pt_regs *regs) static void show_regwindow(struct pt_regs *regs)
{ {
struct reg_window *rw; struct reg_window __user *rw;
struct reg_window *rwk;
struct reg_window r_w; struct reg_window r_w;
mm_segment_t old_fs; mm_segment_t old_fs;
if ((regs->tstate & TSTATE_PRIV) || !(test_thread_flag(TIF_32BIT))) { if ((regs->tstate & TSTATE_PRIV) || !(test_thread_flag(TIF_32BIT))) {
__asm__ __volatile__ ("flushw"); __asm__ __volatile__ ("flushw");
rw = (struct reg_window *)(regs->u_regs[14] + STACK_BIAS); rw = (struct reg_window __user *)
(regs->u_regs[14] + STACK_BIAS);
rwk = (struct reg_window *)
(regs->u_regs[14] + STACK_BIAS);
if (!(regs->tstate & TSTATE_PRIV)) { if (!(regs->tstate & TSTATE_PRIV)) {
old_fs = get_fs(); old_fs = get_fs();
set_fs (USER_DS); set_fs (USER_DS);
...@@ -200,7 +204,7 @@ static void show_regwindow(struct pt_regs *regs) ...@@ -200,7 +204,7 @@ static void show_regwindow(struct pt_regs *regs)
set_fs (old_fs); set_fs (old_fs);
return; return;
} }
rw = &r_w; rwk = &r_w;
set_fs (old_fs); set_fs (old_fs);
} }
} else { } else {
...@@ -208,15 +212,15 @@ static void show_regwindow(struct pt_regs *regs) ...@@ -208,15 +212,15 @@ static void show_regwindow(struct pt_regs *regs)
return; return;
} }
printk("l0: %016lx l1: %016lx l2: %016lx l3: %016lx\n", printk("l0: %016lx l1: %016lx l2: %016lx l3: %016lx\n",
rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3]); rwk->locals[0], rwk->locals[1], rwk->locals[2], rwk->locals[3]);
printk("l4: %016lx l5: %016lx l6: %016lx l7: %016lx\n", printk("l4: %016lx l5: %016lx l6: %016lx l7: %016lx\n",
rw->locals[4], rw->locals[5], rw->locals[6], rw->locals[7]); rwk->locals[4], rwk->locals[5], rwk->locals[6], rwk->locals[7]);
printk("i0: %016lx i1: %016lx i2: %016lx i3: %016lx\n", printk("i0: %016lx i1: %016lx i2: %016lx i3: %016lx\n",
rw->ins[0], rw->ins[1], rw->ins[2], rw->ins[3]); rwk->ins[0], rwk->ins[1], rwk->ins[2], rwk->ins[3]);
printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n", printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
rw->ins[4], rw->ins[5], rw->ins[6], rw->ins[7]); rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
if (regs->tstate & TSTATE_PRIV) if (regs->tstate & TSTATE_PRIV)
print_symbol("I7: <%s>\n", rw->ins[7]); print_symbol("I7: <%s>\n", rwk->ins[7]);
} }
void show_stackframe(struct sparc_stackf *sf) void show_stackframe(struct sparc_stackf *sf)
...@@ -471,10 +475,10 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) ...@@ -471,10 +475,10 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
if (!(test_thread_flag(TIF_32BIT))) { if (!(test_thread_flag(TIF_32BIT))) {
csp += STACK_BIAS; csp += STACK_BIAS;
psp += STACK_BIAS; psp += STACK_BIAS;
__get_user(fp, &(((struct reg_window *)psp)->ins[6])); __get_user(fp, &(((struct reg_window __user *)psp)->ins[6]));
fp += STACK_BIAS; fp += STACK_BIAS;
} else } else
__get_user(fp, &(((struct reg_window32 *)psp)->ins[6])); __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));
/* Now 8-byte align the stack as this is mandatory in the /* Now 8-byte align the stack as this is mandatory in the
* Sparc ABI due to how register windows work. This hides * Sparc ABI due to how register windows work. This hides
...@@ -487,11 +491,12 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) ...@@ -487,11 +491,12 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
if (copy_in_user((void __user *) rval, (void __user *) psp, distance)) if (copy_in_user((void __user *) rval, (void __user *) psp, distance))
rval = 0; rval = 0;
else if (test_thread_flag(TIF_32BIT)) { else if (test_thread_flag(TIF_32BIT)) {
if (put_user(((u32)csp), &(((struct reg_window32 *)rval)->ins[6]))) if (put_user(((u32)csp),
&(((struct reg_window32 __user *)rval)->ins[6])))
rval = 0; rval = 0;
} else { } else {
if (put_user(((u64)csp - STACK_BIAS), if (put_user(((u64)csp - STACK_BIAS),
&(((struct reg_window *)rval)->ins[6]))) &(((struct reg_window __user *)rval)->ins[6])))
rval = 0; rval = 0;
else else
rval = rval - STACK_BIAS; rval = rval - STACK_BIAS;
...@@ -533,7 +538,7 @@ void synchronize_user_stack(void) ...@@ -533,7 +538,7 @@ void synchronize_user_stack(void)
unsigned long sp = (t->rwbuf_stkptrs[window] + bias); unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
struct reg_window *rwin = &t->reg_window[window]; struct reg_window *rwin = &t->reg_window[window];
if (!copy_to_user((char *)sp, rwin, winsize)) { if (!copy_to_user((char __user *)sp, rwin, winsize)) {
shift_window_buffer(window, get_thread_wsaved() - 1, t); shift_window_buffer(window, get_thread_wsaved() - 1, t);
set_thread_wsaved(get_thread_wsaved() - 1); set_thread_wsaved(get_thread_wsaved() - 1);
} }
...@@ -562,7 +567,7 @@ void fault_in_user_windows(void) ...@@ -562,7 +567,7 @@ void fault_in_user_windows(void)
unsigned long sp = (t->rwbuf_stkptrs[window] + bias); unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
struct reg_window *rwin = &t->reg_window[window]; struct reg_window *rwin = &t->reg_window[window];
if (copy_to_user((char *)sp, rwin, winsize)) if (copy_to_user((char __user *)sp, rwin, winsize))
goto barf; goto barf;
} while (window--); } while (window--);
} }
...@@ -592,8 +597,8 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags, ...@@ -592,8 +597,8 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
return do_fork(clone_flags, stack_start, return do_fork(clone_flags, stack_start,
regs, stack_size, regs, stack_size,
(int *) parent_tid_ptr, (int __user *) parent_tid_ptr,
(int *) child_tid_ptr); (int __user *) child_tid_ptr);
} }
/* Copy a Sparc thread. The fork() return value conventions /* Copy a Sparc thread. The fork() return value conventions
...@@ -806,12 +811,15 @@ asmlinkage int sparc_execve(struct pt_regs *regs) ...@@ -806,12 +811,15 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
if (regs->u_regs[UREG_G1] == 0) if (regs->u_regs[UREG_G1] == 0)
base = 1; base = 1;
filename = getname((char *)regs->u_regs[base + UREG_I0]); filename = getname((char __user *)regs->u_regs[base + UREG_I0]);
error = PTR_ERR(filename); error = PTR_ERR(filename);
if (IS_ERR(filename)) if (IS_ERR(filename))
goto out; goto out;
error = do_execve(filename, (char **) regs->u_regs[base + UREG_I1], error = do_execve(filename,
(char **) regs->u_regs[base + UREG_I2], regs); (char __user * __user *)
regs->u_regs[base + UREG_I1],
(char __user * __user *)
regs->u_regs[base + UREG_I2], regs);
putname(filename); putname(filename);
if (!error) { if (!error) {
fprs_write(0); fprs_write(0);
......
...@@ -53,11 +53,15 @@ static inline void ...@@ -53,11 +53,15 @@ static inline void
pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
{ {
if (test_thread_flag(TIF_32BIT)) { if (test_thread_flag(TIF_32BIT)) {
if (put_user(value, (unsigned int *)addr)) if (put_user(value, (unsigned int __user *) addr)) {
return pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
return;
}
} else { } else {
if (put_user(value, addr)) if (put_user(value, (long __user *) addr)) {
return pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
return;
}
} }
regs->u_regs[UREG_I0] = 0; regs->u_regs[UREG_I0] = 0;
regs->tstate &= ~(TSTATE_ICARRY | TSTATE_XCARRY); regs->tstate &= ~(TSTATE_ICARRY | TSTATE_XCARRY);
...@@ -253,7 +257,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -253,7 +257,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
} }
case PTRACE_GETREGS: { case PTRACE_GETREGS: {
struct pt_regs32 *pregs = (struct pt_regs32 *) addr; struct pt_regs32 __user *pregs =
(struct pt_regs32 __user *) addr;
struct pt_regs *cregs = child->thread_info->kregs; struct pt_regs *cregs = child->thread_info->kregs;
int rval; int rval;
...@@ -277,7 +282,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -277,7 +282,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
} }
case PTRACE_GETREGS64: { case PTRACE_GETREGS64: {
struct pt_regs *pregs = (struct pt_regs *) addr; struct pt_regs __user *pregs = (struct pt_regs __user *) addr;
struct pt_regs *cregs = child->thread_info->kregs; struct pt_regs *cregs = child->thread_info->kregs;
unsigned long tpc = cregs->tpc; unsigned long tpc = cregs->tpc;
int rval; int rval;
...@@ -304,7 +309,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -304,7 +309,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
} }
case PTRACE_SETREGS: { case PTRACE_SETREGS: {
struct pt_regs32 *pregs = (struct pt_regs32 *) addr; struct pt_regs32 __user *pregs =
(struct pt_regs32 __user *) addr;
struct pt_regs *cregs = child->thread_info->kregs; struct pt_regs *cregs = child->thread_info->kregs;
unsigned int psr, pc, npc, y; unsigned int psr, pc, npc, y;
int i; int i;
...@@ -337,7 +343,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -337,7 +343,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
} }
case PTRACE_SETREGS64: { case PTRACE_SETREGS64: {
struct pt_regs *pregs = (struct pt_regs *) addr; struct pt_regs __user *pregs = (struct pt_regs __user *) addr;
struct pt_regs *cregs = child->thread_info->kregs; struct pt_regs *cregs = child->thread_info->kregs;
unsigned long tstate, tpc, tnpc, y; unsigned long tstate, tpc, tnpc, y;
int i; int i;
...@@ -385,7 +391,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -385,7 +391,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned int insnaddr; unsigned int insnaddr;
unsigned int insn; unsigned int insn;
} fpq[16]; } fpq[16];
} *fps = (struct fps *) addr; };
struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = child->thread_info->fpregs;
if (copy_to_user(&fps->regs[0], fpregs, if (copy_to_user(&fps->regs[0], fpregs,
...@@ -406,7 +413,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -406,7 +413,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
struct fps { struct fps {
unsigned int regs[64]; unsigned int regs[64];
unsigned long fsr; unsigned long fsr;
} *fps = (struct fps *) addr; };
struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = child->thread_info->fpregs;
if (copy_to_user(&fps->regs[0], fpregs, if (copy_to_user(&fps->regs[0], fpregs,
...@@ -430,7 +438,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -430,7 +438,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned int insnaddr; unsigned int insnaddr;
unsigned int insn; unsigned int insn;
} fpq[16]; } fpq[16];
} *fps = (struct fps *) addr; };
struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = child->thread_info->fpregs;
unsigned fsr; unsigned fsr;
...@@ -453,7 +462,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -453,7 +462,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
struct fps { struct fps {
unsigned int regs[64]; unsigned int regs[64];
unsigned long fsr; unsigned long fsr;
} *fps = (struct fps *) addr; };
struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = child->thread_info->fpregs;
if (copy_from_user(fpregs, &fps->regs[0], if (copy_from_user(fpregs, &fps->regs[0],
...@@ -472,7 +482,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -472,7 +482,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
case PTRACE_READTEXT: case PTRACE_READTEXT:
case PTRACE_READDATA: { case PTRACE_READDATA: {
int res = ptrace_readdata(child, addr, int res = ptrace_readdata(child, addr,
(void *)addr2, data); (char __user *)addr2, data);
if (res == data) { if (res == data) {
pt_succ_return(regs, 0); pt_succ_return(regs, 0);
goto flush_and_out; goto flush_and_out;
...@@ -485,7 +495,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -485,7 +495,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
case PTRACE_WRITETEXT: case PTRACE_WRITETEXT:
case PTRACE_WRITEDATA: { case PTRACE_WRITEDATA: {
int res = ptrace_writedata(child, (void *) addr2, int res = ptrace_writedata(child, (char __user *) addr2,
addr, data); addr, data);
if (res == data) { if (res == data) {
pt_succ_return(regs, 0); pt_succ_return(regs, 0);
......
...@@ -293,7 +293,7 @@ int prom_callback(long *args) ...@@ -293,7 +293,7 @@ int prom_callback(long *args)
unsigned long tte; unsigned long tte;
tte = args[3]; tte = args[3];
prom_printf("%lx ", (tte & 0x07FC000000000000) >> 50); prom_printf("%lx ", (tte & 0x07FC000000000000UL) >> 50);
args[2] = 2; args[2] = 2;
args[args[1] + 3] = 0; args[args[1] + 3] = 0;
......
...@@ -42,7 +42,8 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -42,7 +42,8 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
/* {set, get}context() needed for 64-bit SparcLinux userland. */ /* {set, get}context() needed for 64-bit SparcLinux userland. */
asmlinkage void sparc64_set_context(struct pt_regs *regs) asmlinkage void sparc64_set_context(struct pt_regs *regs)
{ {
struct ucontext *ucp = (struct ucontext __user *) regs->u_regs[UREG_I0]; struct ucontext __user *ucp = (struct ucontext __user *)
regs->u_regs[UREG_I0];
mc_gregset_t __user *grp; mc_gregset_t __user *grp;
unsigned long pc, npc, tstate; unsigned long pc, npc, tstate;
unsigned long fp, i7; unsigned long fp, i7;
...@@ -139,7 +140,8 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs) ...@@ -139,7 +140,8 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
asmlinkage void sparc64_get_context(struct pt_regs *regs) asmlinkage void sparc64_get_context(struct pt_regs *regs)
{ {
struct ucontext *ucp = (struct ucontext __user *) regs->u_regs[UREG_I0]; struct ucontext __user *ucp = (struct ucontext __user *)
regs->u_regs[UREG_I0];
mc_gregset_t __user *grp; mc_gregset_t __user *grp;
mcontext_t __user *mcp; mcontext_t __user *mcp;
unsigned long fp, i7; unsigned long fp, i7;
...@@ -427,7 +429,7 @@ void do_rt_sigreturn(struct pt_regs *regs) ...@@ -427,7 +429,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
call it and ignore errors. */ call it and ignore errors. */
old_fs = get_fs(); old_fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, (unsigned long)sf); do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf);
set_fs(old_fs); set_fs(old_fs);
sigdelsetmask(&set, ~_BLOCKABLE); sigdelsetmask(&set, ~_BLOCKABLE);
......
...@@ -345,8 +345,10 @@ asmlinkage void do_sigreturn32(struct pt_regs *regs) ...@@ -345,8 +345,10 @@ asmlinkage void do_sigreturn32(struct pt_regs *regs)
current_thread_info()->restart_block.fn = do_no_restart_syscall; current_thread_info()->restart_block.fn = do_no_restart_syscall;
synchronize_user_stack(); synchronize_user_stack();
if (test_thread_flag(TIF_NEWSIGNALS)) if (test_thread_flag(TIF_NEWSIGNALS)) {
return do_new_sigreturn32(regs); do_new_sigreturn32(regs);
return;
}
scptr = (struct sigcontext32 __user *) scptr = (struct sigcontext32 __user *)
(regs->u_regs[UREG_I0] & 0x00000000ffffffffUL); (regs->u_regs[UREG_I0] & 0x00000000ffffffffUL);
...@@ -469,7 +471,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) ...@@ -469,7 +471,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
call it and ignore errors. */ call it and ignore errors. */
old_fs = get_fs(); old_fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, (unsigned long)sf); do_sigaltstack((stack_t __user *) &st, NULL, (unsigned long)sf);
set_fs(old_fs); set_fs(old_fs);
switch (_NSIG_WORDS) { switch (_NSIG_WORDS) {
...@@ -1039,7 +1041,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs) ...@@ -1039,7 +1041,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
call it and ignore errors. */ call it and ignore errors. */
old_fs = get_fs(); old_fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, regs->u_regs[UREG_I6]); do_sigaltstack((stack_t __user *) &st, NULL, regs->u_regs[UREG_I6]);
set_fs(old_fs); set_fs(old_fs);
sigdelsetmask(&set, ~_BLOCKABLE); sigdelsetmask(&set, ~_BLOCKABLE);
...@@ -1361,7 +1363,8 @@ asmlinkage int do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp) ...@@ -1361,7 +1363,8 @@ asmlinkage int do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp)
uss.ss_sp = (void *) (long) u_ss_sp; uss.ss_sp = (void *) (long) u_ss_sp;
old_fs = get_fs(); old_fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
ret = do_sigaltstack(ussa ? &uss : NULL, uossa ? &uoss : NULL, sp); ret = do_sigaltstack(ussa ? (stack_t __user *) &uss : NULL,
uossa ? (stack_t __user *) &uoss : NULL, sp);
set_fs(old_fs); set_fs(old_fs);
if (!ret && uossa && (put_user((long)uoss.ss_sp, &((stack_t32 __user *)(long)uossa)->ss_sp) || if (!ret && uossa && (put_user((long)uoss.ss_sp, &((stack_t32 __user *)(long)uossa)->ss_sp) ||
__put_user(uoss.ss_flags, &((stack_t32 __user *)(long)uossa)->ss_flags) || __put_user(uoss.ss_flags, &((stack_t32 __user *)(long)uossa)->ss_flags) ||
......
...@@ -104,10 +104,11 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg) ...@@ -104,10 +104,11 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
if(cmd == TIOCSETD) { if(cmd == TIOCSETD) {
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
int *p, ntty = N_TTY; int __user *p;
int ntty = N_TTY;
int tmp; int tmp;
p = (int *)A(arg); p = (int __user *)A(arg);
ret = -EFAULT; ret = -EFAULT;
if(get_user(tmp, p)) if(get_user(tmp, p))
goto out; goto out;
...@@ -237,10 +238,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg) ...@@ -237,10 +238,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
/* Non posix grp */ /* Non posix grp */
case _IOW('t', 118, int): { case _IOW('t', 118, int): {
int oldval, newval, *ptr; int oldval, newval, __user *ptr;
cmd = TIOCSPGRP; cmd = TIOCSPGRP;
ptr = (int *) A(arg); ptr = (int __user *) A(arg);
ret = -EFAULT; ret = -EFAULT;
if(get_user(oldval, ptr)) if(get_user(oldval, ptr))
goto out; goto out;
...@@ -256,10 +257,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg) ...@@ -256,10 +257,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
} }
case _IOR('t', 119, int): { case _IOR('t', 119, int): {
int oldval, newval, *ptr; int oldval, newval, __user *ptr;
cmd = TIOCGPGRP; cmd = TIOCGPGRP;
ptr = (int *) A(arg); ptr = (int __user *) A(arg);
ret = -EFAULT; ret = -EFAULT;
if(get_user(oldval, ptr)) if(get_user(oldval, ptr))
goto out; goto out;
......
...@@ -208,10 +208,10 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir ...@@ -208,10 +208,10 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
if (call <= SEMCTL) if (call <= SEMCTL)
switch (call) { switch (call) {
case SEMOP: case SEMOP:
err = sys_semtimedop (first, (struct sembuf *)ptr, second, NULL); err = sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
goto out; goto out;
case SEMTIMEDOP: case SEMTIMEDOP:
err = sys_semtimedop (first, (struct sembuf *)ptr, second, (const struct timespec *) fifth); err = sys_semtimedop (first, (struct sembuf __user *)ptr, second, (const struct timespec __user *) fifth);
goto out; goto out;
case SEMGET: case SEMGET:
err = sys_semget (first, second, (int)third); err = sys_semget (first, second, (int)third);
...@@ -222,7 +222,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir ...@@ -222,7 +222,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
if (!ptr) if (!ptr)
goto out; goto out;
err = -EFAULT; err = -EFAULT;
if(get_user(fourth.__pad, (void **)ptr)) if (get_user(fourth.__pad, (void __user * __user *)ptr))
goto out; goto out;
err = sys_semctl (first, second | IPC_64, (int)third, fourth); err = sys_semctl (first, second | IPC_64, (int)third, fourth);
goto out; goto out;
...@@ -234,17 +234,17 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir ...@@ -234,17 +234,17 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
if (call <= MSGCTL) if (call <= MSGCTL)
switch (call) { switch (call) {
case MSGSND: case MSGSND:
err = sys_msgsnd (first, (struct msgbuf *) ptr, err = sys_msgsnd (first, (struct msgbuf __user *) ptr,
second, (int)third); second, (int)third);
goto out; goto out;
case MSGRCV: case MSGRCV:
err = sys_msgrcv (first, (struct msgbuf *) ptr, second, fifth, (int)third); err = sys_msgrcv (first, (struct msgbuf __user *) ptr, second, fifth, (int)third);
goto out; goto out;
case MSGGET: case MSGGET:
err = sys_msgget ((key_t) first, second); err = sys_msgget ((key_t) first, second);
goto out; goto out;
case MSGCTL: case MSGCTL:
err = sys_msgctl (first, second | IPC_64, (struct msqid_ds *) ptr); err = sys_msgctl (first, second | IPC_64, (struct msqid_ds __user *) ptr);
goto out; goto out;
default: default:
err = -ENOSYS; err = -ENOSYS;
...@@ -254,7 +254,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir ...@@ -254,7 +254,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
switch (call) { switch (call) {
case SHMAT: { case SHMAT: {
ulong raddr; ulong raddr;
err = do_shmat (first, (char *) ptr, second, &raddr); err = do_shmat (first, (char __user *) ptr, second, &raddr);
if (!err) { if (!err) {
if (put_user(raddr, (ulong __user *) third)) if (put_user(raddr, (ulong __user *) third))
err = -EFAULT; err = -EFAULT;
...@@ -262,13 +262,13 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir ...@@ -262,13 +262,13 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
goto out; goto out;
} }
case SHMDT: case SHMDT:
err = sys_shmdt ((char *)ptr); err = sys_shmdt ((char __user *)ptr);
goto out; goto out;
case SHMGET: case SHMGET:
err = sys_shmget (first, second, (int)third); err = sys_shmget (first, second, (int)third);
goto out; goto out;
case SHMCTL: case SHMCTL:
err = sys_shmctl (first, second | IPC_64, (struct shmid_ds *) ptr); err = sys_shmctl (first, second | IPC_64, (struct shmid_ds __user *) ptr);
goto out; goto out;
default: default:
err = -ENOSYS; err = -ENOSYS;
...@@ -636,8 +636,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar ...@@ -636,8 +636,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
switch(opcode) { switch(opcode) {
case PERFCTR_ON: case PERFCTR_ON:
current_thread_info()->pcr_reg = arg2; current_thread_info()->pcr_reg = arg2;
current_thread_info()->user_cntd0 = (u64 *) arg0; current_thread_info()->user_cntd0 = (u64 __user *) arg0;
current_thread_info()->user_cntd1 = (u64 *) arg1; current_thread_info()->user_cntd1 = (u64 __user *) arg1;
current_thread_info()->kernel_cntd0 = current_thread_info()->kernel_cntd0 =
current_thread_info()->kernel_cntd1 = 0; current_thread_info()->kernel_cntd1 = 0;
write_pcr(arg2); write_pcr(arg2);
...@@ -684,7 +684,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar ...@@ -684,7 +684,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
break; break;
case PERFCTR_SETPCR: { case PERFCTR_SETPCR: {
u64 *user_pcr = (u64 *)arg0; u64 __user *user_pcr = (u64 __user *)arg0;
if (!test_thread_flag(TIF_PERFCTR)) { if (!test_thread_flag(TIF_PERFCTR)) {
err = -EINVAL; err = -EINVAL;
break; break;
...@@ -698,7 +699,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar ...@@ -698,7 +699,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
} }
case PERFCTR_GETPCR: { case PERFCTR_GETPCR: {
u64 *user_pcr = (u64 *)arg0; u64 __user *user_pcr = (u64 __user *)arg0;
if (!test_thread_flag(TIF_PERFCTR)) { if (!test_thread_flag(TIF_PERFCTR)) {
err = -EINVAL; err = -EINVAL;
break; break;
......
This diff is collapsed.
This diff is collapsed.
...@@ -205,7 +205,7 @@ sunos_sys_table: ...@@ -205,7 +205,7 @@ sunos_sys_table:
.word sys_oldumount, sunos_nosys, sunos_nosys .word sys_oldumount, sunos_nosys, sunos_nosys
.word sys_getdomainname, sys_setdomainname .word sys_getdomainname, sys_setdomainname
.word sunos_nosys, sys_quotactl, sunos_nosys .word sunos_nosys, sys_quotactl, sunos_nosys
.word sunos_mount, sys_ustat, sunos_semsys .word sunos_nosys, sys_ustat, sunos_semsys
.word sunos_nosys, sunos_shmsys, sunos_audit .word sunos_nosys, sunos_shmsys, sunos_audit
.word sunos_nosys, sunos_getdents, sys_setsid .word sunos_nosys, sunos_getdents, sys_setsid
.word sys_fchdir, sunos_nosys, sunos_nosys .word sys_fchdir, sunos_nosys, sunos_nosys
......
...@@ -1708,7 +1708,7 @@ void instruction_dump (unsigned int *pc) ...@@ -1708,7 +1708,7 @@ void instruction_dump (unsigned int *pc)
printk("\n"); printk("\n");
} }
void user_instruction_dump (unsigned int *pc) static void user_instruction_dump (unsigned int __user *pc)
{ {
int i; int i;
unsigned int buf[9]; unsigned int buf[9];
...@@ -1813,7 +1813,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) ...@@ -1813,7 +1813,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
regs->tpc &= 0xffffffff; regs->tpc &= 0xffffffff;
regs->tnpc &= 0xffffffff; regs->tnpc &= 0xffffffff;
} }
user_instruction_dump ((unsigned int *) regs->tpc); user_instruction_dump ((unsigned int __user *) regs->tpc);
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
smp_report_regs(); smp_report_regs();
...@@ -1838,7 +1838,7 @@ void do_illegal_instruction(struct pt_regs *regs) ...@@ -1838,7 +1838,7 @@ void do_illegal_instruction(struct pt_regs *regs)
die_if_kernel("Kernel illegal instruction", regs); die_if_kernel("Kernel illegal instruction", regs);
if (test_thread_flag(TIF_32BIT)) if (test_thread_flag(TIF_32BIT))
pc = (u32)pc; pc = (u32)pc;
if (get_user(insn, (u32 *)pc) != -EFAULT) { if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
if ((insn & 0xc1ffc000) == 0x81700000) /* POPC */ { if ((insn & 0xc1ffc000) == 0x81700000) /* POPC */ {
if (handle_popc(insn, regs)) if (handle_popc(insn, regs))
return; return;
...@@ -1862,9 +1862,12 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo ...@@ -1862,9 +1862,12 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
if (regs->tstate & TSTATE_PRIV) { if (regs->tstate & TSTATE_PRIV) {
extern void kernel_unaligned_trap(struct pt_regs *regs, extern void kernel_unaligned_trap(struct pt_regs *regs,
unsigned int insn, unsigned int insn,
unsigned long sfar, unsigned long sfsr); unsigned long sfar,
unsigned long sfsr);
return kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc), sfar, sfsr); kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc),
sfar, sfsr);
return;
} }
info.si_signo = SIGBUS; info.si_signo = SIGBUS;
info.si_errno = 0; info.si_errno = 0;
......
...@@ -128,12 +128,12 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) ...@@ -128,12 +128,12 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
value = win->locals[reg - 16]; value = win->locals[reg - 16];
} else if (test_thread_flag(TIF_32BIT)) { } else if (test_thread_flag(TIF_32BIT)) {
struct reg_window32 *win32; struct reg_window32 __user *win32;
win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP])); win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
get_user(value, &win32->locals[reg - 16]); get_user(value, &win32->locals[reg - 16]);
} else { } else {
struct reg_window *win; struct reg_window __user *win;
win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
get_user(value, &win->locals[reg - 16]); get_user(value, &win->locals[reg - 16]);
} }
return value; return value;
...@@ -477,12 +477,12 @@ int handle_popc(u32 insn, struct pt_regs *regs) ...@@ -477,12 +477,12 @@ int handle_popc(u32 insn, struct pt_regs *regs)
regs->u_regs[rd] = ret; regs->u_regs[rd] = ret;
} else { } else {
if (test_thread_flag(TIF_32BIT)) { if (test_thread_flag(TIF_32BIT)) {
struct reg_window32 *win32; struct reg_window32 __user *win32;
win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP])); win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
put_user(ret, &win32->locals[rd - 16]); put_user(ret, &win32->locals[rd - 16]);
} else { } else {
struct reg_window *win; struct reg_window __user *win;
win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
put_user(ret, &win->locals[rd - 16]); put_user(ret, &win->locals[rd - 16]);
} }
} }
...@@ -540,10 +540,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs) ...@@ -540,10 +540,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
data_access_exception(regs, 0, addr); data_access_exception(regs, 0, addr);
return 1; return 1;
} }
if (put_user (first >> 32, (u32 *)addr) || if (put_user (first >> 32, (u32 __user *)addr) ||
__put_user ((u32)first, (u32 *)(addr + 4)) || __put_user ((u32)first, (u32 __user *)(addr + 4)) ||
__put_user (second >> 32, (u32 *)(addr + 8)) || __put_user (second >> 32, (u32 __user *)(addr + 8)) ||
__put_user ((u32)second, (u32 *)(addr + 12))) { __put_user ((u32)second, (u32 __user *)(addr + 12))) {
data_access_exception(regs, 0, addr); data_access_exception(regs, 0, addr);
return 1; return 1;
} }
...@@ -568,10 +568,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs) ...@@ -568,10 +568,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
data[i] = 0; data[i] = 0;
err = get_user (data[0], (u32 *)addr); err = get_user (data[0], (u32 __user *) addr);
if (!err) { if (!err) {
for (i = 1; i < size; i++) for (i = 1; i < size; i++)
err |= __get_user (data[i], (u32 *)(addr + 4*i)); err |= __get_user (data[i], (u32 __user *)(addr + 4*i));
} }
if (err && !(asi & 0x2 /* NF */)) { if (err && !(asi & 0x2 /* NF */)) {
data_access_exception(regs, 0, addr); data_access_exception(regs, 0, addr);
...@@ -620,13 +620,13 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs) ...@@ -620,13 +620,13 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs)
if ((insn & 0x780000) == 0x180000) if ((insn & 0x780000) == 0x180000)
reg[1] = 0; reg[1] = 0;
} else if (test_thread_flag(TIF_32BIT)) { } else if (test_thread_flag(TIF_32BIT)) {
put_user(0, (int *)reg); put_user(0, (int __user *) reg);
if ((insn & 0x780000) == 0x180000) if ((insn & 0x780000) == 0x180000)
put_user(0, ((int *)reg) + 1); put_user(0, ((int __user *) reg) + 1);
} else { } else {
put_user(0, reg); put_user(0, (unsigned long __user *) reg);
if ((insn & 0x780000) == 0x180000) if ((insn & 0x780000) == 0x180000)
put_user(0, reg + 1); put_user(0, (unsigned long __user *) reg + 1);
} }
advance(regs); advance(regs);
} }
...@@ -646,13 +646,13 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr ...@@ -646,13 +646,13 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
die_if_kernel("lddfmna from kernel", regs); die_if_kernel("lddfmna from kernel", regs);
if (test_thread_flag(TIF_32BIT)) if (test_thread_flag(TIF_32BIT))
pc = (u32)pc; pc = (u32)pc;
if (get_user(insn, (u32 *)pc) != -EFAULT) { if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
asi = sfsr >> 16; asi = sfsr >> 16;
if ((asi > ASI_SNFL) || if ((asi > ASI_SNFL) ||
(asi < ASI_P)) (asi < ASI_P))
goto daex; goto daex;
if (get_user(first, (u32 *)sfar) || if (get_user(first, (u32 __user *)sfar) ||
get_user(second, (u32 *)(sfar + 4))) { get_user(second, (u32 __user *)(sfar + 4))) {
if (asi & 0x2) /* NF */ { if (asi & 0x2) /* NF */ {
first = 0; second = 0; first = 0; second = 0;
} else } else
...@@ -698,7 +698,7 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr ...@@ -698,7 +698,7 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
die_if_kernel("stdfmna from kernel", regs); die_if_kernel("stdfmna from kernel", regs);
if (test_thread_flag(TIF_32BIT)) if (test_thread_flag(TIF_32BIT))
pc = (u32)pc; pc = (u32)pc;
if (get_user(insn, (u32 *)pc) != -EFAULT) { if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20);
asi = sfsr >> 16; asi = sfsr >> 16;
value = 0; value = 0;
...@@ -717,8 +717,8 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr ...@@ -717,8 +717,8 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
value = __swab64p(&value); break; value = __swab64p(&value); break;
default: goto daex; default: goto daex;
} }
if (put_user (value >> 32, (u32 *)sfar) || if (put_user (value >> 32, (u32 __user *) sfar) ||
__put_user ((u32)value, (u32 *)(sfar + 4))) __put_user ((u32)value, (u32 __user *)(sfar + 4)))
goto daex; goto daex;
} else { } else {
daex: data_access_exception(regs, sfsr, sfar); daex: data_access_exception(regs, sfsr, sfar);
......
...@@ -185,7 +185,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f) ...@@ -185,7 +185,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)
die_if_kernel("unfinished/unimplemented FPop from kernel", regs); die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
if (test_thread_flag(TIF_32BIT)) if (test_thread_flag(TIF_32BIT))
pc = (u32)pc; pc = (u32)pc;
if (get_user(insn, (u32 *)pc) != -EFAULT) { if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
if ((insn & 0xc1f80000) == 0x81a00000) /* FPOP1 */ { if ((insn & 0xc1f80000) == 0x81a00000) /* FPOP1 */ {
switch ((insn >> 5) & 0x1ff) { switch ((insn >> 5) & 0x1ff) {
/* QUAD - ftt == 3 */ /* QUAD - ftt == 3 */
...@@ -298,14 +298,14 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f) ...@@ -298,14 +298,14 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)
else if (freg < 16) else if (freg < 16)
XR = regs->u_regs[freg]; XR = regs->u_regs[freg];
else if (test_thread_flag(TIF_32BIT)) { else if (test_thread_flag(TIF_32BIT)) {
struct reg_window32 *win32; struct reg_window32 __user *win32;
flushw_user (); flushw_user ();
win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP])); win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
get_user(XR, &win32->locals[freg - 16]); get_user(XR, &win32->locals[freg - 16]);
} else { } else {
struct reg_window *win; struct reg_window __user *win;
flushw_user (); flushw_user ();
win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
get_user(XR, &win->locals[freg - 16]); get_user(XR, &win->locals[freg - 16]);
} }
IR = 0; IR = 0;
......
...@@ -116,12 +116,12 @@ typedef u32 compat_sigset_word; ...@@ -116,12 +116,12 @@ typedef u32 compat_sigset_word;
*/ */
typedef u32 compat_uptr_t; typedef u32 compat_uptr_t;
static inline void *compat_ptr(compat_uptr_t uptr) static inline void __user *compat_ptr(compat_uptr_t uptr)
{ {
return (void *)(unsigned long)uptr; return (void __user *)(unsigned long)uptr;
} }
static __inline__ void *compat_alloc_user_space(long len) static __inline__ void __user *compat_alloc_user_space(long len)
{ {
struct pt_regs *regs = current_thread_info()->kregs; struct pt_regs *regs = current_thread_info()->kregs;
unsigned long usp = regs->u_regs[UREG_I6]; unsigned long usp = regs->u_regs[UREG_I6];
...@@ -129,7 +129,7 @@ static __inline__ void *compat_alloc_user_space(long len) ...@@ -129,7 +129,7 @@ static __inline__ void *compat_alloc_user_space(long len)
if (!(test_thread_flag(TIF_32BIT))) if (!(test_thread_flag(TIF_32BIT)))
usp += STACK_BIAS; usp += STACK_BIAS;
return (void *) (usp - len); return (void __user *) (usp - len);
} }
#endif /* _ASM_SPARC64_COMPAT_H */ #endif /* _ASM_SPARC64_COMPAT_H */
...@@ -2,17 +2,19 @@ ...@@ -2,17 +2,19 @@
#ifndef _SPARC64_LSU_H #ifndef _SPARC64_LSU_H
#define _SPARC64_LSU_H #define _SPARC64_LSU_H
#include <asm/const.h>
/* LSU Control Register */ /* LSU Control Register */
#define LSU_CONTROL_PM 0x000001fe00000000 /* Phys-watchpoint byte mask */ #define LSU_CONTROL_PM _AC(0x000001fe00000000,UL) /* Phys-watchpoint byte mask*/
#define LSU_CONTROL_VM 0x00000001fe000000 /* Virt-watchpoint byte mask */ #define LSU_CONTROL_VM _AC(0x00000001fe000000,UL) /* Virt-watchpoint byte mask*/
#define LSU_CONTROL_PR 0x0000000001000000 /* Phys-read watchpoint enable */ #define LSU_CONTROL_PR _AC(0x0000000001000000,UL) /* Phys-rd watchpoint enable*/
#define LSU_CONTROL_PW 0x0000000000800000 /* Phys-write watchpoint enable */ #define LSU_CONTROL_PW _AC(0x0000000000800000,UL) /* Phys-wr watchpoint enable*/
#define LSU_CONTROL_VR 0x0000000000400000 /* Virt-read watchpoint enable */ #define LSU_CONTROL_VR _AC(0x0000000000400000,UL) /* Virt-rd watchpoint enable*/
#define LSU_CONTROL_VW 0x0000000000200000 /* Virt-write watchpoint enable */ #define LSU_CONTROL_VW _AC(0x0000000000200000,UL) /* Virt-wr watchpoint enable*/
#define LSU_CONTROL_FM 0x00000000000ffff0 /* Parity mask enables. */ #define LSU_CONTROL_FM _AC(0x00000000000ffff0,UL) /* Parity mask enables. */
#define LSU_CONTROL_DM 0x0000000000000008 /* Data MMU enable. */ #define LSU_CONTROL_DM _AC(0x0000000000000008,UL) /* Data MMU enable. */
#define LSU_CONTROL_IM 0x0000000000000004 /* Instruction MMU enable. */ #define LSU_CONTROL_IM _AC(0x0000000000000004,UL) /* Instruction MMU enable. */
#define LSU_CONTROL_DC 0x0000000000000002 /* Data cache enable. */ #define LSU_CONTROL_DC _AC(0x0000000000000002,UL) /* Data cache enable. */
#define LSU_CONTROL_IC 0x0000000000000001 /* Instruction cache enable. */ #define LSU_CONTROL_IC _AC(0x0000000000000001,UL) /* Instruction cache enable.*/
#endif /* !(_SPARC64_LSU_H) */ #endif /* !(_SPARC64_LSU_H) */
...@@ -99,7 +99,7 @@ typedef struct sigevent32 { ...@@ -99,7 +99,7 @@ typedef struct sigevent32 {
} _sigev_un; } _sigev_un;
} sigevent_t32; } sigevent_t32;
extern int copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from); extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -212,7 +212,7 @@ struct __new_sigaction32 { ...@@ -212,7 +212,7 @@ struct __new_sigaction32 {
struct k_sigaction { struct k_sigaction {
struct __new_sigaction sa; struct __new_sigaction sa;
void *ka_restorer; void __user *ka_restorer;
}; };
#endif #endif
......
...@@ -56,7 +56,8 @@ struct thread_info { ...@@ -56,7 +56,8 @@ struct thread_info {
unsigned long gsr[7]; unsigned long gsr[7];
unsigned long xfsr[7]; unsigned long xfsr[7];
__u64 *user_cntd0, *user_cntd1; __u64 __user *user_cntd0;
__u64 __user *user_cntd1;
__u64 kernel_cntd0, kernel_cntd1; __u64 kernel_cntd0, kernel_cntd1;
__u64 pcr_reg; __u64 pcr_reg;
......
...@@ -90,6 +90,10 @@ unsigned long search_extables_range(unsigned long addr, unsigned long *g2); ...@@ -90,6 +90,10 @@ unsigned long search_extables_range(unsigned long addr, unsigned long *g2);
extern void __ret_efault(void); extern void __ret_efault(void);
extern long not_a_user_address;
#define check_user_ptr(x) \
(void) ({ void __user * __userptr = (__typeof__(*(x)) *)&not_a_user_address; __userptr; })
/* Uh, these should become the main single-value transfer routines.. /* Uh, these should become the main single-value transfer routines..
* They automatically use the right size if we just have the right * They automatically use the right size if we just have the right
* pointer type.. * pointer type..
...@@ -101,10 +105,12 @@ extern void __ret_efault(void); ...@@ -101,10 +105,12 @@ extern void __ret_efault(void);
*/ */
#define put_user(x,ptr) ({ \ #define put_user(x,ptr) ({ \
unsigned long __pu_addr = (unsigned long)(ptr); \ unsigned long __pu_addr = (unsigned long)(ptr); \
check_user_ptr(ptr); \
__put_user_nocheck((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr))); }) __put_user_nocheck((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr))); })
#define get_user(x,ptr) ({ \ #define get_user(x,ptr) ({ \
unsigned long __gu_addr = (unsigned long)(ptr); \ unsigned long __gu_addr = (unsigned long)(ptr); \
check_user_ptr(ptr); \
__get_user_nocheck((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr))); }) __get_user_nocheck((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr))); })
#define __put_user(x,ptr) put_user(x,ptr) #define __put_user(x,ptr) put_user(x,ptr)
...@@ -263,12 +269,12 @@ extern unsigned long __copy_in_user(void __user *to, const void __user *from, ...@@ -263,12 +269,12 @@ extern unsigned long __copy_in_user(void __user *to, const void __user *from,
#define copy_to_user __copy_to_user #define copy_to_user __copy_to_user
#define copy_in_user __copy_in_user #define copy_in_user __copy_in_user
extern unsigned long __bzero_noasi(void *, unsigned long); extern unsigned long __bzero_noasi(void __user *, unsigned long);
static inline unsigned long __clear_user(void __user *addr, unsigned long size) static inline unsigned long __clear_user(void __user *addr, unsigned long size)
{ {
return __bzero_noasi((void *) addr, size); return __bzero_noasi(addr, size);
} }
#define clear_user __clear_user #define clear_user __clear_user
......
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