Skip to content

Commit

Permalink
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…davem/sparc-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Fix missing load-twin usage in Niagara-1 memcpy.
  [SPARC64]: Fix put_user() calls in binfmt_aout32.c
  [SPARC]: Fix EBUS use of uninitialized variable.
  • Loading branch information
Linus Torvalds committed Oct 2, 2007
2 parents 2b3b290 + 25e5566 commit 114d5b1
Show file tree
Hide file tree
Showing 6 changed files with 229 additions and 169 deletions.
2 changes: 2 additions & 0 deletions arch/sparc/kernel/ebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
dev->prom_node = dp;

regs = of_get_property(dp, "reg", &len);
if (!regs)
len = 0;
if (len % sizeof(struct linux_prom_registers)) {
prom_printf("UGH: proplen for %s was %d, need multiple of %d\n",
dev->prom_node->name, len,
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc64/kernel/binfmt_aout32.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bpr
get_user(c,p++);
} while (c);
}
put_user(NULL,argv);
put_user(0,argv);
current->mm->arg_end = current->mm->env_start = (unsigned long) p;
while (envc-->0) {
char c;
Expand All @@ -186,7 +186,7 @@ static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bpr
get_user(c,p++);
} while (c);
}
put_user(NULL,envp);
put_user(0,envp);
current->mm->env_end = (unsigned long) p;
return sp;
}
Expand Down
5 changes: 4 additions & 1 deletion arch/sparc64/kernel/ebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de
dev->num_addrs = 0;
dev->num_irqs = 0;
} else {
(void) of_get_property(dp, "reg", &len);
const int *regs = of_get_property(dp, "reg", &len);

if (!regs)
len = 0;
dev->num_addrs = len / sizeof(struct linux_prom_registers);

for (i = 0; i < dev->num_addrs; i++)
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc64/lib/NGcopy_from_user.S
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* NGcopy_from_user.S: Niagara optimized copy from userspace.
*
* Copyright (C) 2006 David S. Miller (davem@davemloft.net)
* Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net)
*/

#define EX_LD(x) \
98: x; \
.section .fixup; \
.align 4; \
99: wr %g0, ASI_AIUS, %asi;\
retl; \
mov 1, %o0; \
ret; \
restore %g0, 1, %o0; \
.section __ex_table,"a";\
.align 4; \
.word 98b, 99b; \
Expand All @@ -24,7 +24,7 @@
#define LOAD(type,addr,dest) type##a [addr] ASI_AIUS, dest
#define LOAD_TWIN(addr_reg,dest0,dest1) \
ldda [addr_reg] ASI_BLK_INIT_QUAD_LDD_AIUS, dest0
#define EX_RETVAL(x) 0
#define EX_RETVAL(x) %g0

#ifdef __KERNEL__
#define PREAMBLE \
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc64/lib/NGcopy_to_user.S
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* NGcopy_to_user.S: Niagara optimized copy to userspace.
*
* Copyright (C) 2006 David S. Miller (davem@davemloft.net)
* Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net)
*/

#define EX_ST(x) \
98: x; \
.section .fixup; \
.align 4; \
99: wr %g0, ASI_AIUS, %asi;\
retl; \
mov 1, %o0; \
ret; \
restore %g0, 1, %o0; \
.section __ex_table,"a";\
.align 4; \
.word 98b, 99b; \
Expand All @@ -23,7 +23,7 @@
#define FUNC_NAME NGcopy_to_user
#define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
#define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
#define EX_RETVAL(x) 0
#define EX_RETVAL(x) %g0

#ifdef __KERNEL__
/* Writing to %asi is _expensive_ so we hardcode it.
Expand Down
Loading

0 comments on commit 114d5b1

Please sign in to comment.