Commit 5606f2f2 authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.davemloft.net:/disk1/BK/sparc-2.6

into kernel.bkbits.net:/home/davem/sparc-2.6
parents c517cfc4 111610ab
...@@ -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
...@@ -694,7 +699,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ...@@ -694,7 +699,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
* So we stash 'fn' and 'arg' into global registers which * So we stash 'fn' and 'arg' into global registers which
* will not be modified by the parent. * will not be modified by the parent.
*/ */
__asm__ __volatile("mov %4, %%g2\n\t" /* Save FN into global */ __asm__ __volatile__("mov %4, %%g2\n\t" /* Save FN into global */
"mov %5, %%g3\n\t" /* Save ARG into global */ "mov %5, %%g3\n\t" /* Save ARG into global */
"mov %1, %%g1\n\t" /* Clone syscall nr. */ "mov %1, %%g1\n\t" /* Clone syscall nr. */
"mov %2, %%o0\n\t" /* Clone flags. */ "mov %2, %%o0\n\t" /* Clone flags. */
...@@ -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);
......
...@@ -810,17 +810,17 @@ unsigned int sbus_build_irq(void *buscookie, unsigned int ino) ...@@ -810,17 +810,17 @@ unsigned int sbus_build_irq(void *buscookie, unsigned int ino)
/* Error interrupt handling. */ /* Error interrupt handling. */
#define SYSIO_UE_AFSR 0x0030UL #define SYSIO_UE_AFSR 0x0030UL
#define SYSIO_UE_AFAR 0x0038UL #define SYSIO_UE_AFAR 0x0038UL
#define SYSIO_UEAFSR_PPIO 0x8000000000000000 /* Primary PIO is cause */ #define SYSIO_UEAFSR_PPIO 0x8000000000000000UL /* Primary PIO cause */
#define SYSIO_UEAFSR_PDRD 0x4000000000000000 /* Primary DVMA read is cause */ #define SYSIO_UEAFSR_PDRD 0x4000000000000000UL /* Primary DVMA read cause */
#define SYSIO_UEAFSR_PDWR 0x2000000000000000 /* Primary DVMA write is cause */ #define SYSIO_UEAFSR_PDWR 0x2000000000000000UL /* Primary DVMA write cause */
#define SYSIO_UEAFSR_SPIO 0x1000000000000000 /* Secondary PIO is cause */ #define SYSIO_UEAFSR_SPIO 0x1000000000000000UL /* Secondary PIO is cause */
#define SYSIO_UEAFSR_SDRD 0x0800000000000000 /* Secondary DVMA read is cause */ #define SYSIO_UEAFSR_SDRD 0x0800000000000000UL /* Secondary DVMA read cause */
#define SYSIO_UEAFSR_SDWR 0x0400000000000000 /* Secondary DVMA write is cause*/ #define SYSIO_UEAFSR_SDWR 0x0400000000000000UL /* Secondary DVMA write cause*/
#define SYSIO_UEAFSR_RESV1 0x03ff000000000000 /* Reserved */ #define SYSIO_UEAFSR_RESV1 0x03ff000000000000UL /* Reserved */
#define SYSIO_UEAFSR_DOFF 0x0000e00000000000 /* Doubleword Offset */ #define SYSIO_UEAFSR_DOFF 0x0000e00000000000UL /* Doubleword Offset */
#define SYSIO_UEAFSR_SIZE 0x00001c0000000000 /* Bad transfer size is 2**SIZE */ #define SYSIO_UEAFSR_SIZE 0x00001c0000000000UL /* Bad transfer size 2^SIZE */
#define SYSIO_UEAFSR_MID 0x000003e000000000 /* UPA MID causing the fault */ #define SYSIO_UEAFSR_MID 0x000003e000000000UL /* UPA MID causing the fault */
#define SYSIO_UEAFSR_RESV2 0x0000001fffffffff /* Reserved */ #define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct sbus_bus *sbus = dev_id; struct sbus_bus *sbus = dev_id;
...@@ -881,18 +881,18 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs) ...@@ -881,18 +881,18 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs)
#define SYSIO_CE_AFSR 0x0040UL #define SYSIO_CE_AFSR 0x0040UL
#define SYSIO_CE_AFAR 0x0048UL #define SYSIO_CE_AFAR 0x0048UL
#define SYSIO_CEAFSR_PPIO 0x8000000000000000 /* Primary PIO is cause */ #define SYSIO_CEAFSR_PPIO 0x8000000000000000UL /* Primary PIO cause */
#define SYSIO_CEAFSR_PDRD 0x4000000000000000 /* Primary DVMA read is cause */ #define SYSIO_CEAFSR_PDRD 0x4000000000000000UL /* Primary DVMA read cause */
#define SYSIO_CEAFSR_PDWR 0x2000000000000000 /* Primary DVMA write is cause */ #define SYSIO_CEAFSR_PDWR 0x2000000000000000UL /* Primary DVMA write cause */
#define SYSIO_CEAFSR_SPIO 0x1000000000000000 /* Secondary PIO is cause */ #define SYSIO_CEAFSR_SPIO 0x1000000000000000UL /* Secondary PIO cause */
#define SYSIO_CEAFSR_SDRD 0x0800000000000000 /* Secondary DVMA read is cause */ #define SYSIO_CEAFSR_SDRD 0x0800000000000000UL /* Secondary DVMA read cause */
#define SYSIO_CEAFSR_SDWR 0x0400000000000000 /* Secondary DVMA write is cause*/ #define SYSIO_CEAFSR_SDWR 0x0400000000000000UL /* Secondary DVMA write cause*/
#define SYSIO_CEAFSR_RESV1 0x0300000000000000 /* Reserved */ #define SYSIO_CEAFSR_RESV1 0x0300000000000000UL /* Reserved */
#define SYSIO_CEAFSR_ESYND 0x00ff000000000000 /* Syndrome Bits */ #define SYSIO_CEAFSR_ESYND 0x00ff000000000000UL /* Syndrome Bits */
#define SYSIO_CEAFSR_DOFF 0x0000e00000000000 /* Double Offset */ #define SYSIO_CEAFSR_DOFF 0x0000e00000000000UL /* Double Offset */
#define SYSIO_CEAFSR_SIZE 0x00001c0000000000 /* Bad transfer size is 2**SIZE */ #define SYSIO_CEAFSR_SIZE 0x00001c0000000000UL /* Bad transfer size 2^SIZE */
#define SYSIO_CEAFSR_MID 0x000003e000000000 /* UPA MID causing the fault */ #define SYSIO_CEAFSR_MID 0x000003e000000000UL /* UPA MID causing the fault */
#define SYSIO_CEAFSR_RESV2 0x0000001fffffffff /* Reserved */ #define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct sbus_bus *sbus = dev_id; struct sbus_bus *sbus = dev_id;
...@@ -958,18 +958,18 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs) ...@@ -958,18 +958,18 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs)
#define SYSIO_SBUS_AFSR 0x2010UL #define SYSIO_SBUS_AFSR 0x2010UL
#define SYSIO_SBUS_AFAR 0x2018UL #define SYSIO_SBUS_AFAR 0x2018UL
#define SYSIO_SBAFSR_PLE 0x8000000000000000 /* Primary Late PIO Error */ #define SYSIO_SBAFSR_PLE 0x8000000000000000UL /* Primary Late PIO Error */
#define SYSIO_SBAFSR_PTO 0x4000000000000000 /* Primary SBUS Timeout */ #define SYSIO_SBAFSR_PTO 0x4000000000000000UL /* Primary SBUS Timeout */
#define SYSIO_SBAFSR_PBERR 0x2000000000000000 /* Primary SBUS Error ACK */ #define SYSIO_SBAFSR_PBERR 0x2000000000000000UL /* Primary SBUS Error ACK */
#define SYSIO_SBAFSR_SLE 0x1000000000000000 /* Secondary Late PIO Error */ #define SYSIO_SBAFSR_SLE 0x1000000000000000UL /* Secondary Late PIO Error */
#define SYSIO_SBAFSR_STO 0x0800000000000000 /* Secondary SBUS Timeout */ #define SYSIO_SBAFSR_STO 0x0800000000000000UL /* Secondary SBUS Timeout */
#define SYSIO_SBAFSR_SBERR 0x0400000000000000 /* Secondary SBUS Error ACK */ #define SYSIO_SBAFSR_SBERR 0x0400000000000000UL /* Secondary SBUS Error ACK */
#define SYSIO_SBAFSR_RESV1 0x03ff000000000000 /* Reserved */ #define SYSIO_SBAFSR_RESV1 0x03ff000000000000UL /* Reserved */
#define SYSIO_SBAFSR_RD 0x0000800000000000 /* Primary was late PIO read */ #define SYSIO_SBAFSR_RD 0x0000800000000000UL /* Primary was late PIO read */
#define SYSIO_SBAFSR_RESV2 0x0000600000000000 /* Reserved */ #define SYSIO_SBAFSR_RESV2 0x0000600000000000UL /* Reserved */
#define SYSIO_SBAFSR_SIZE 0x00001c0000000000 /* Size of transfer */ #define SYSIO_SBAFSR_SIZE 0x00001c0000000000UL /* Size of transfer */
#define SYSIO_SBAFSR_MID 0x000003e000000000 /* MID causing the error */ #define SYSIO_SBAFSR_MID 0x000003e000000000UL /* MID causing the error */
#define SYSIO_SBAFSR_RESV3 0x0000001fffffffff /* Reserved */ #define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */
static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct sbus_bus *sbus = dev_id; struct sbus_bus *sbus = dev_id;
...@@ -1030,9 +1030,9 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_reg ...@@ -1030,9 +1030,9 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_reg
} }
#define ECC_CONTROL 0x0020UL #define ECC_CONTROL 0x0020UL
#define SYSIO_ECNTRL_ECCEN 0x8000000000000000 /* Enable ECC Checking */ #define SYSIO_ECNTRL_ECCEN 0x8000000000000000UL /* Enable ECC Checking */
#define SYSIO_ECNTRL_UEEN 0x4000000000000000 /* Enable UE Interrupts */ #define SYSIO_ECNTRL_UEEN 0x4000000000000000UL /* Enable UE Interrupts */
#define SYSIO_ECNTRL_CEEN 0x2000000000000000 /* Enable CE Interrupts */ #define SYSIO_ECNTRL_CEEN 0x2000000000000000UL /* Enable CE Interrupts */
#define SYSIO_UE_INO 0x34 #define SYSIO_UE_INO 0x34
#define SYSIO_CE_INO 0x35 #define SYSIO_CE_INO 0x35
......
...@@ -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;
......
This diff is collapsed.
...@@ -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 */
/* const.h: Macros for dealing with constants. */
#ifndef _SPARC64_CONST_H
#define _SPARC64_CONST_H
/* Some constant macros are used in both assembler and
* C code. Therefore we cannot annotate them always with
* 'UL' and other type specificers unilaterally. We
* use the following macros to deal with this.
*/
#ifdef __ASSEMBLY__
#define _AC(X,Y) X
#else
#define _AC(X,Y) (X##Y)
#endif
#endif /* !(_SPARC64_CONST_H) */
...@@ -55,15 +55,6 @@ typedef struct { ...@@ -55,15 +55,6 @@ typedef struct {
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT) #define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
/*
* The hardirq mask has to be large enough to have
* space for potentially all IRQ sources in the system
* nesting on a single CPU:
*/
#if (1 << HARDIRQ_BITS) < NR_IRQS
# error HARDIRQ_BITS is too low!
#endif
/* /*
* Are we doing bottom half or hardware interrupt processing? * Are we doing bottom half or hardware interrupt processing?
* Are we in a softirq context? Interrupt context? * Are we in a softirq context? Interrupt context?
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
#define _SPARC64_IOMMU_H #define _SPARC64_IOMMU_H
/* The format of an iopte in the page tables. */ /* The format of an iopte in the page tables. */
#define IOPTE_VALID 0x8000000000000000 /* IOPTE is valid */ #define IOPTE_VALID 0x8000000000000000UL /* IOPTE is valid */
#define IOPTE_64K 0x2000000000000000 /* IOPTE is for 64k page */ #define IOPTE_64K 0x2000000000000000UL /* IOPTE is for 64k page */
#define IOPTE_STBUF 0x1000000000000000 /* DVMA can use streaming buffer */ #define IOPTE_STBUF 0x1000000000000000UL /* DVMA can use streaming buffer */
#define IOPTE_INTRA 0x0800000000000000 /* SBUS slot-->slot direct transfer */ #define IOPTE_INTRA 0x0800000000000000UL /* SBUS slot-->slot direct transfer*/
#define IOPTE_CONTEXT 0x07ff800000000000 /* Context number */ #define IOPTE_CONTEXT 0x07ff800000000000UL /* Context number */
#define IOPTE_PAGE 0x00007fffffffe000 /* Physical page number (PA[42:13]) */ #define IOPTE_PAGE 0x00007fffffffe000UL /* Physical page number (PA[42:13])*/
#define IOPTE_CACHE 0x0000000000000010 /* Cached (in UPA E-cache) */ #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */
#define IOPTE_WRITE 0x0000000000000002 /* Writeable */ #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */
#endif /* !(_SPARC_IOMMU_H) */ #endif /* !(_SPARC_IOMMU_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) */
...@@ -4,18 +4,12 @@ ...@@ -4,18 +4,12 @@
#define _SPARC64_PAGE_H #define _SPARC64_PAGE_H
#include <linux/config.h> #include <linux/config.h>
#include <asm/const.h>
#define PAGE_SHIFT 13 #define PAGE_SHIFT 13
#ifndef __ASSEMBLY__ #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
/* I have my suspicions... -DaveM */
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#else
#define PAGE_SIZE (1 << PAGE_SHIFT)
#endif
#define PAGE_MASK (~(PAGE_SIZE-1)) #define PAGE_MASK (~(PAGE_SIZE-1))
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -99,13 +93,13 @@ typedef unsigned long iopgprot_t; ...@@ -99,13 +93,13 @@ typedef unsigned long iopgprot_t;
#endif #endif
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
#define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) #define HPAGE_MASK (~(HPAGE_SIZE - 1UL))
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
#endif #endif
#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \
(0x0000000070000000UL) : (PAGE_OFFSET)) (_AC(0x0000000070000000,UL)) : (PAGE_OFFSET))
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
...@@ -115,7 +109,7 @@ typedef unsigned long iopgprot_t; ...@@ -115,7 +109,7 @@ typedef unsigned long iopgprot_t;
/* We used to stick this into a hard-coded global register (%g4) /* We used to stick this into a hard-coded global register (%g4)
* but that does not make sense anymore. * but that does not make sense anymore.
*/ */
#define PAGE_OFFSET 0xFFFFF80000000000 #define PAGE_OFFSET _AC(0xFFFFF80000000000,UL)
#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
......
...@@ -168,7 +168,7 @@ extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask); ...@@ -168,7 +168,7 @@ extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
* can drive enough of the 64 bits. * can drive enough of the 64 bits.
*/ */
#define PCI64_REQUIRED_MASK (~(dma64_addr_t)0) #define PCI64_REQUIRED_MASK (~(dma64_addr_t)0)
#define PCI64_ADDR_BASE 0xfffc000000000000 #define PCI64_ADDR_BASE 0xfffc000000000000UL
/* Usage of the pci_dac_foo interfaces is only valid if this /* Usage of the pci_dac_foo interfaces is only valid if this
* test passes. * test passes.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/const.h>
/* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 16MB). /* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 16MB).
* The page copy blockops use 0x1000000 to 0x18000000 (16MB --> 24MB). * The page copy blockops use 0x1000000 to 0x18000000 (16MB --> 24MB).
...@@ -26,14 +27,14 @@ ...@@ -26,14 +27,14 @@
* There is a single static kernel PMD which maps from 0x0 to address * There is a single static kernel PMD which maps from 0x0 to address
* 0x400000000. * 0x400000000.
*/ */
#define TLBTEMP_BASE 0x0000000001000000 #define TLBTEMP_BASE _AC(0x0000000001000000,UL)
#define MODULES_VADDR 0x0000000002000000 #define MODULES_VADDR _AC(0x0000000002000000,UL)
#define MODULES_LEN 0x000000007e000000 #define MODULES_LEN _AC(0x000000007e000000,UL)
#define MODULES_END 0x0000000080000000 #define MODULES_END _AC(0x0000000080000000,UL)
#define VMALLOC_START 0x0000000140000000 #define VMALLOC_START _AC(0x0000000140000000,UL)
#define VMALLOC_END 0x0000000200000000 #define VMALLOC_END _AC(0x0000000200000000,UL)
#define LOW_OBP_ADDRESS 0x00000000f0000000 #define LOW_OBP_ADDRESS _AC(0x00000000f0000000,UL)
#define HI_OBP_ADDRESS 0x0000000100000000 #define HI_OBP_ADDRESS _AC(0x0000000100000000,UL)
/* XXX All of this needs to be rethought so we can take advantage /* XXX All of this needs to be rethought so we can take advantage
* XXX cheetah's full 64-bit virtual address space, ie. no more hole * XXX cheetah's full 64-bit virtual address space, ie. no more hole
...@@ -49,7 +50,9 @@ ...@@ -49,7 +50,9 @@
* long). Finally, the higher few bits determine pgde#. * long). Finally, the higher few bits determine pgde#.
*/ */
/* PMD_SHIFT determines the size of the area a second-level page table can map */ /* PMD_SHIFT determines the size of the area a second-level page
* table can map
*/
#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3))
#define PMD_SIZE (1UL << PMD_SHIFT) #define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE-1)) #define PMD_MASK (~(PMD_SIZE-1))
...@@ -78,7 +81,8 @@ ...@@ -78,7 +81,8 @@
*/ */
#define REAL_PTRS_PER_PMD (1UL << PMD_BITS) #define REAL_PTRS_PER_PMD (1UL << PMD_BITS)
#define PTRS_PER_PMD ((const int)(test_thread_flag(TIF_32BIT) ? \ #define PTRS_PER_PMD ((const int)(test_thread_flag(TIF_32BIT) ? \
(1UL << (32 - (PAGE_SHIFT-3) - PAGE_SHIFT)) : (REAL_PTRS_PER_PMD))) (1UL << (32 - (PAGE_SHIFT-3) - PAGE_SHIFT)) : \
(REAL_PTRS_PER_PMD)))
/* /*
* We cannot use the top address range because VPTE table lives there. This * We cannot use the top address range because VPTE table lives there. This
...@@ -102,33 +106,33 @@ ...@@ -102,33 +106,33 @@
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
/* Spitfire/Cheetah TTE bits. */ /* Spitfire/Cheetah TTE bits. */
#define _PAGE_VALID 0x8000000000000000 /* Valid TTE */ #define _PAGE_VALID _AC(0x8000000000000000,UL) /* Valid TTE */
#define _PAGE_R 0x8000000000000000 /* Used to keep ref bit up to date */ #define _PAGE_R _AC(0x8000000000000000,UL) /* Keep ref bit up to date */
#define _PAGE_SZ4MB 0x6000000000000000 /* 4MB Page */ #define _PAGE_SZ4MB _AC(0x6000000000000000,UL) /* 4MB Page */
#define _PAGE_SZ512K 0x4000000000000000 /* 512K Page */ #define _PAGE_SZ512K _AC(0x4000000000000000,UL) /* 512K Page */
#define _PAGE_SZ64K 0x2000000000000000 /* 64K Page */ #define _PAGE_SZ64K _AC(0x2000000000000000,UL) /* 64K Page */
#define _PAGE_SZ8K 0x0000000000000000 /* 8K Page */ #define _PAGE_SZ8K _AC(0x0000000000000000,UL) /* 8K Page */
#define _PAGE_NFO 0x1000000000000000 /* No Fault Only */ #define _PAGE_NFO _AC(0x1000000000000000,UL) /* No Fault Only */
#define _PAGE_IE 0x0800000000000000 /* Invert Endianness */ #define _PAGE_IE _AC(0x0800000000000000,UL) /* Invert Endianness */
#define _PAGE_SN 0x0000800000000000 /* (Cheetah) Snoop */ #define _PAGE_SN _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */
#define _PAGE_PADDR_SF 0x000001FFFFFFE000 /* (Spitfire) Phys Address [40:13] */ #define _PAGE_PADDR_SF _AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr [40:13]*/
#define _PAGE_PADDR 0x000007FFFFFFE000 /* (Cheetah) Phys Address [42:13] */ #define _PAGE_PADDR _AC(0x000007FFFFFFE000,UL) /* (Cheetah) paddr [42:13] */
#define _PAGE_SOFT 0x0000000000001F80 /* Software bits */ #define _PAGE_SOFT _AC(0x0000000000001F80,UL) /* Software bits */
#define _PAGE_L 0x0000000000000040 /* Locked TTE */ #define _PAGE_L _AC(0x0000000000000040,UL) /* Locked TTE */
#define _PAGE_CP 0x0000000000000020 /* Cacheable in Physical Cache */ #define _PAGE_CP _AC(0x0000000000000020,UL) /* Cacheable in P-Cache */
#define _PAGE_CV 0x0000000000000010 /* Cacheable in Virtual Cache */ #define _PAGE_CV _AC(0x0000000000000010,UL) /* Cacheable in V-Cache */
#define _PAGE_E 0x0000000000000008 /* side-Effect */ #define _PAGE_E _AC(0x0000000000000008,UL) /* side-Effect */
#define _PAGE_P 0x0000000000000004 /* Privileged Page */ #define _PAGE_P _AC(0x0000000000000004,UL) /* Privileged Page */
#define _PAGE_W 0x0000000000000002 /* Writable */ #define _PAGE_W _AC(0x0000000000000002,UL) /* Writable */
#define _PAGE_G 0x0000000000000001 /* Global */ #define _PAGE_G _AC(0x0000000000000001,UL) /* Global */
/* Here are the SpitFire software bits we use in the TTE's. */ /* Here are the SpitFire software bits we use in the TTE's. */
#define _PAGE_FILE 0x0000000000001000 /* Pagecache page */ #define _PAGE_FILE _AC(0x0000000000001000,UL) /* Pagecache page */
#define _PAGE_MODIFIED 0x0000000000000800 /* Modified Page (ie. dirty) */ #define _PAGE_MODIFIED _AC(0x0000000000000800,UL) /* Modified (dirty) */
#define _PAGE_ACCESSED 0x0000000000000400 /* Accessed Page (ie. referenced) */ #define _PAGE_ACCESSED _AC(0x0000000000000400,UL) /* Accessed (ref'd) */
#define _PAGE_READ 0x0000000000000200 /* Readable SW Bit */ #define _PAGE_READ _AC(0x0000000000000200,UL) /* Readable SW Bit */
#define _PAGE_WRITE 0x0000000000000100 /* Writable SW Bit */ #define _PAGE_WRITE _AC(0x0000000000000100,UL) /* Writable SW Bit */
#define _PAGE_PRESENT 0x0000000000000080 /* Present Page (ie. not swapped out) */ #define _PAGE_PRESENT _AC(0x0000000000000080,UL) /* Present */
#if PAGE_SHIFT == 13 #if PAGE_SHIFT == 13
#define _PAGE_SZBITS _PAGE_SZ8K #define _PAGE_SZBITS _PAGE_SZ8K
...@@ -173,7 +177,8 @@ ...@@ -173,7 +177,8 @@
#define _PFN_MASK _PAGE_PADDR #define _PFN_MASK _PAGE_PADDR
#define pg_iobits (_PAGE_VALID | _PAGE_PRESENT | __DIRTY_BITS | __ACCESS_BITS | _PAGE_E) #define pg_iobits (_PAGE_VALID | _PAGE_PRESENT | __DIRTY_BITS | \
__ACCESS_BITS | _PAGE_E)
#define __P000 PAGE_NONE #define __P000 PAGE_NONE
#define __P001 PAGE_READONLY #define __P001 PAGE_READONLY
...@@ -260,9 +265,12 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) ...@@ -260,9 +265,12 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
#define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED) #define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED)
#define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) #define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED)
#define pte_wrprotect(pte) (__pte(pte_val(pte) & ~(_PAGE_WRITE|_PAGE_W))) #define pte_wrprotect(pte) (__pte(pte_val(pte) & ~(_PAGE_WRITE|_PAGE_W)))
#define pte_rdprotect(pte) (__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_READ)) #define pte_rdprotect(pte) \
#define pte_mkclean(pte) (__pte(pte_val(pte) & ~(_PAGE_MODIFIED|_PAGE_W))) (__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_READ))
#define pte_mkold(pte) (__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_ACCESSED)) #define pte_mkclean(pte) \
(__pte(pte_val(pte) & ~(_PAGE_MODIFIED|_PAGE_W)))
#define pte_mkold(pte) \
(__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_ACCESSED))
/* Permanent address of a page. */ /* Permanent address of a page. */
#define __page_address(page) page_address(page) #define __page_address(page) page_address(page)
...@@ -280,11 +288,13 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) ...@@ -280,11 +288,13 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
#define pgd_offset_k(address) pgd_offset(&init_mm, address) #define pgd_offset_k(address) pgd_offset(&init_mm, address)
/* Find an entry in the second-level page table.. */ /* Find an entry in the second-level page table.. */
#define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \ #define pmd_offset(dir, address) \
((pmd_t *) pgd_page(*(dir)) + \
((address >> PMD_SHIFT) & (REAL_PTRS_PER_PMD-1))) ((address >> PMD_SHIFT) & (REAL_PTRS_PER_PMD-1)))
/* Find an entry in the third-level page table.. */ /* Find an entry in the third-level page table.. */
#define pte_index(dir, address) ((pte_t *) __pmd_page(*(dir)) + \ #define pte_index(dir, address) \
((pte_t *) __pmd_page(*(dir)) + \
((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
#define pte_offset_kernel pte_index #define pte_offset_kernel pte_index
#define pte_offset_map pte_index #define pte_offset_map pte_index
...@@ -305,7 +315,8 @@ extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); ...@@ -305,7 +315,8 @@ extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
{ {
pte_t pte; pte_t pte;
pte_val(pte) = ((page) | pgprot_val(prot) | _PAGE_E) & ~(unsigned long)_PAGE_CACHE; pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) &
~(unsigned long)_PAGE_CACHE);
pte_val(pte) |= (((unsigned long)space) << 32); pte_val(pte) |= (((unsigned long)space) << 32);
return pte; return pte;
} }
...@@ -365,7 +376,8 @@ extern unsigned long *sparc64_valid_addr_bitmap; ...@@ -365,7 +376,8 @@ extern unsigned long *sparc64_valid_addr_bitmap;
#define kern_addr_valid(addr) \ #define kern_addr_valid(addr) \
(test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
unsigned long offset,
unsigned long size, pgprot_t prot, int space); unsigned long size, pgprot_t prot, int space);
#include <asm-generic/pgtable.h> #include <asm-generic/pgtable.h>
...@@ -376,7 +388,9 @@ extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, u ...@@ -376,7 +388,9 @@ extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, u
/* We provide a special get_unmapped_area for framebuffer mmaps to try and use /* We provide a special get_unmapped_area for framebuffer mmaps to try and use
* the largest alignment possible such that larget PTEs can be used. * the largest alignment possible such that larget PTEs can be used.
*/ */
extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, unsigned long, unsigned long, unsigned long); extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long,
unsigned long, unsigned long,
unsigned long);
#define HAVE_ARCH_FB_UNMAPPED_AREA #define HAVE_ARCH_FB_UNMAPPED_AREA
/* /*
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#ifndef _SPARC64_PSTATE_H #ifndef _SPARC64_PSTATE_H
#define _SPARC64_PSTATE_H #define _SPARC64_PSTATE_H
#include <asm/const.h>
/* The V9 PSTATE Register (with SpitFire extensions). /* The V9 PSTATE Register (with SpitFire extensions).
* *
* ----------------------------------------------------------------------- * -----------------------------------------------------------------------
...@@ -9,20 +11,20 @@ ...@@ -9,20 +11,20 @@
* ----------------------------------------------------------------------- * -----------------------------------------------------------------------
* 63 12 11 10 9 8 7 6 5 4 3 2 1 0 * 63 12 11 10 9 8 7 6 5 4 3 2 1 0
*/ */
#define PSTATE_IG 0x0000000000000800 /* Interrupt Globals. */ #define PSTATE_IG _AC(0x0000000000000800,UL) /* Interrupt Globals. */
#define PSTATE_MG 0x0000000000000400 /* MMU Globals. */ #define PSTATE_MG _AC(0x0000000000000400,UL) /* MMU Globals. */
#define PSTATE_CLE 0x0000000000000200 /* Current Little Endian. */ #define PSTATE_CLE _AC(0x0000000000000200,UL) /* Current Little Endian.*/
#define PSTATE_TLE 0x0000000000000100 /* Trap Little Endian. */ #define PSTATE_TLE _AC(0x0000000000000100,UL) /* Trap Little Endian. */
#define PSTATE_MM 0x00000000000000c0 /* Memory Model. */ #define PSTATE_MM _AC(0x00000000000000c0,UL) /* Memory Model. */
#define PSTATE_TSO 0x0000000000000000 /* MM: Total Store Order */ #define PSTATE_TSO _AC(0x0000000000000000,UL) /* MM: TotalStoreOrder */
#define PSTATE_PSO 0x0000000000000040 /* MM: Partial Store Order */ #define PSTATE_PSO _AC(0x0000000000000040,UL) /* MM: PartialStoreOrder */
#define PSTATE_RMO 0x0000000000000080 /* MM: Relaxed Memory Order */ #define PSTATE_RMO _AC(0x0000000000000080,UL) /* MM: RelaxedMemoryOrder*/
#define PSTATE_RED 0x0000000000000020 /* Reset Error Debug State. */ #define PSTATE_RED _AC(0x0000000000000020,UL) /* Reset Error Debug. */
#define PSTATE_PEF 0x0000000000000010 /* Floating Point Enable. */ #define PSTATE_PEF _AC(0x0000000000000010,UL) /* Floating Point Enable.*/
#define PSTATE_AM 0x0000000000000008 /* Address Mask. */ #define PSTATE_AM _AC(0x0000000000000008,UL) /* Address Mask. */
#define PSTATE_PRIV 0x0000000000000004 /* Privilege. */ #define PSTATE_PRIV _AC(0x0000000000000004,UL) /* Privilege. */
#define PSTATE_IE 0x0000000000000002 /* Interrupt Enable. */ #define PSTATE_IE _AC(0x0000000000000002,UL) /* Interrupt Enable. */
#define PSTATE_AG 0x0000000000000001 /* Alternate Globals. */ #define PSTATE_AG _AC(0x0000000000000001,UL) /* Alternate Globals. */
/* The V9 TSTATE Register (with SpitFire and Linux extensions). /* The V9 TSTATE Register (with SpitFire and Linux extensions).
* *
...@@ -31,35 +33,35 @@ ...@@ -31,35 +33,35 @@
* --------------------------------------------------------------- * ---------------------------------------------------------------
* 63 40 39 32 31 24 23 20 19 8 7 5 4 0 * 63 40 39 32 31 24 23 20 19 8 7 5 4 0
*/ */
#define TSTATE_CCR 0x000000ff00000000 /* Condition Codes. */ #define TSTATE_CCR _AC(0x000000ff00000000,UL) /* Condition Codes. */
#define TSTATE_XCC 0x000000f000000000 /* Condition Codes. */ #define TSTATE_XCC _AC(0x000000f000000000,UL) /* Condition Codes. */
#define TSTATE_XNEG 0x0000008000000000 /* %xcc Negative. */ #define TSTATE_XNEG _AC(0x0000008000000000,UL) /* %xcc Negative. */
#define TSTATE_XZERO 0x0000004000000000 /* %xcc Zero. */ #define TSTATE_XZERO _AC(0x0000004000000000,UL) /* %xcc Zero. */
#define TSTATE_XOVFL 0x0000002000000000 /* %xcc Overflow. */ #define TSTATE_XOVFL _AC(0x0000002000000000,UL) /* %xcc Overflow. */
#define TSTATE_XCARRY 0x0000001000000000 /* %xcc Carry. */ #define TSTATE_XCARRY _AC(0x0000001000000000,UL) /* %xcc Carry. */
#define TSTATE_ICC 0x0000000f00000000 /* Condition Codes. */ #define TSTATE_ICC _AC(0x0000000f00000000,UL) /* Condition Codes. */
#define TSTATE_INEG 0x0000000800000000 /* %icc Negative. */ #define TSTATE_INEG _AC(0x0000000800000000,UL) /* %icc Negative. */
#define TSTATE_IZERO 0x0000000400000000 /* %icc Zero. */ #define TSTATE_IZERO _AC(0x0000000400000000,UL) /* %icc Zero. */
#define TSTATE_IOVFL 0x0000000200000000 /* %icc Overflow. */ #define TSTATE_IOVFL _AC(0x0000000200000000,UL) /* %icc Overflow. */
#define TSTATE_ICARRY 0x0000000100000000 /* %icc Carry. */ #define TSTATE_ICARRY _AC(0x0000000100000000,UL) /* %icc Carry. */
#define TSTATE_ASI 0x00000000ff000000 /* Address Space Identifier. */ #define TSTATE_ASI _AC(0x00000000ff000000,UL) /* AddrSpace ID. */
#define TSTATE_PIL 0x0000000000f00000 /* %pil (Linux traps set this) */ #define TSTATE_PIL _AC(0x0000000000f00000,UL) /* %pil (Linux traps)*/
#define TSTATE_PSTATE 0x00000000000fff00 /* PSTATE. */ #define TSTATE_PSTATE _AC(0x00000000000fff00,UL) /* PSTATE. */
#define TSTATE_IG 0x0000000000080000 /* Interrupt Globals. */ #define TSTATE_IG _AC(0x0000000000080000,UL) /* Interrupt Globals.*/
#define TSTATE_MG 0x0000000000040000 /* MMU Globals. */ #define TSTATE_MG _AC(0x0000000000040000,UL) /* MMU Globals. */
#define TSTATE_CLE 0x0000000000020000 /* Current Little Endian. */ #define TSTATE_CLE _AC(0x0000000000020000,UL) /* CurrLittleEndian. */
#define TSTATE_TLE 0x0000000000010000 /* Trap Little Endian. */ #define TSTATE_TLE _AC(0x0000000000010000,UL) /* TrapLittleEndian. */
#define TSTATE_MM 0x000000000000c000 /* Memory Model. */ #define TSTATE_MM _AC(0x000000000000c000,UL) /* Memory Model. */
#define TSTATE_TSO 0x0000000000000000 /* MM: Total Store Order */ #define TSTATE_TSO _AC(0x0000000000000000,UL) /* MM: TSO */
#define TSTATE_PSO 0x0000000000004000 /* MM: Partial Store Order */ #define TSTATE_PSO _AC(0x0000000000004000,UL) /* MM: PSO */
#define TSTATE_RMO 0x0000000000008000 /* MM: Relaxed Memory Order */ #define TSTATE_RMO _AC(0x0000000000008000,UL) /* MM: RMO */
#define TSTATE_RED 0x0000000000002000 /* Reset Error Debug State. */ #define TSTATE_RED _AC(0x0000000000002000,UL) /* Reset Error Debug.*/
#define TSTATE_PEF 0x0000000000001000 /* Floating Point Enable. */ #define TSTATE_PEF _AC(0x0000000000001000,UL) /* FPU Enable. */
#define TSTATE_AM 0x0000000000000800 /* Address Mask. */ #define TSTATE_AM _AC(0x0000000000000800,UL) /* Address Mask. */
#define TSTATE_PRIV 0x0000000000000400 /* Privilege. */ #define TSTATE_PRIV _AC(0x0000000000000400,UL) /* Privilege. */
#define TSTATE_IE 0x0000000000000200 /* Interrupt Enable. */ #define TSTATE_IE _AC(0x0000000000000200,UL) /* Interrupt Enable. */
#define TSTATE_AG 0x0000000000000100 /* Alternate Globals. */ #define TSTATE_AG _AC(0x0000000000000100,UL) /* Alternate Globals.*/
#define TSTATE_CWP 0x000000000000001f /* Current Window Pointer. */ #define TSTATE_CWP _AC(0x000000000000001f,UL) /* Curr Win-Pointer. */
/* Floating-Point Registers State Register. /* Floating-Point Registers State Register.
* *
...@@ -68,9 +70,9 @@ ...@@ -68,9 +70,9 @@
* -------------------------------- * --------------------------------
* 63 3 2 1 0 * 63 3 2 1 0
*/ */
#define FPRS_FEF 0x0000000000000004 /* Enable Floating Point. */ #define FPRS_FEF _AC(0x0000000000000004,UL) /* FPU Enable. */
#define FPRS_DU 0x0000000000000002 /* Dirty Upper. */ #define FPRS_DU _AC(0x0000000000000002,UL) /* Dirty Upper. */
#define FPRS_DL 0x0000000000000001 /* Dirty Lower. */ #define FPRS_DL _AC(0x0000000000000001,UL) /* Dirty Lower. */
/* Version Register. /* Version Register.
* *
...@@ -79,10 +81,10 @@ ...@@ -79,10 +81,10 @@
* ------------------------------------------------------ * ------------------------------------------------------
* 63 48 47 32 31 24 23 16 15 8 7 5 4 0 * 63 48 47 32 31 24 23 16 15 8 7 5 4 0
*/ */
#define VERS_MANUF 0xffff000000000000 /* Manufacturer. */ #define VERS_MANUF _AC(0xffff000000000000,UL) /* Manufacturer. */
#define VERS_IMPL 0x0000ffff00000000 /* Implementation. */ #define VERS_IMPL _AC(0x0000ffff00000000,UL) /* Implementation. */
#define VERS_MASK 0x00000000ff000000 /* Mask Set Revision. */ #define VERS_MASK _AC(0x00000000ff000000,UL) /* Mask Set Revision.*/
#define VERS_MAXTL 0x000000000000ff00 /* Maximum Trap Level. */ #define VERS_MAXTL _AC(0x000000000000ff00,UL) /* Max Trap Level. */
#define VERS_MAXWIN 0x000000000000001f /* Maximum Reg Window Index. */ #define VERS_MAXWIN _AC(0x000000000000001f,UL) /* Max RegWindow Idx.*/
#endif /* !(_SPARC64_PSTATE_H) */ #endif /* !(_SPARC64_PSTATE_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)
...@@ -163,7 +169,7 @@ __asm__ __volatile__( \ ...@@ -163,7 +169,7 @@ __asm__ __volatile__( \
".previous\n\n\t" \ ".previous\n\n\t" \
: "=r" (foo) : "r" (x), "r" (__m(addr))); \ : "=r" (foo) : "r" (x), "r" (__m(addr))); \
else \ else \
__asm__ __volatile( \ __asm__ __volatile__( \
"/* Put user asm ret, inline. */\n" \ "/* Put user asm ret, inline. */\n" \
"1:\t" "st"#size "a %1, [%2] %%asi\n\n\t" \ "1:\t" "st"#size "a %1, [%2] %%asi\n\n\t" \
".section .fixup,#alloc,#execinstr\n\t" \ ".section .fixup,#alloc,#execinstr\n\t" \
...@@ -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