Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 30, 2005
2 parents a36f496 + 017fb98 commit c4a7c77
Show file tree
Hide file tree
Showing 25 changed files with 375 additions and 723 deletions.
2 changes: 0 additions & 2 deletions arch/sparc/kernel/setup.c
Expand Up @@ -249,8 +249,6 @@ struct tt_entry *sparc_ttable;

struct pt_regs fake_swapper_regs;

extern void paging_init(void);

void __init setup_arch(char **cmdline_p)
{
int i;
Expand Down
7 changes: 5 additions & 2 deletions arch/sparc64/kernel/head.S
Expand Up @@ -540,8 +540,11 @@ bootup_user_stack_end:
prom_tba: .xword 0
tlb_type: .word 0 /* Must NOT end up in BSS */
.section ".fixup",#alloc,#execinstr
.globl __ret_efault

.globl __ret_efault, __retl_efault
__ret_efault:
ret
restore %g0, -EFAULT, %o0

__retl_efault:
retl
mov -EFAULT, %o0
14 changes: 11 additions & 3 deletions arch/sparc64/kernel/ptrace.c
Expand Up @@ -31,6 +31,7 @@
#include <asm/visasm.h>
#include <asm/spitfire.h>
#include <asm/page.h>
#include <asm/cpudata.h>

/* Returning from ptrace is a bit tricky because the syscall return
* low level code assumes any value returned which is negative and
Expand Down Expand Up @@ -132,12 +133,16 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
if ((uaddr ^ (unsigned long) kaddr) & (1UL << 13)) {
unsigned long start = __pa(kaddr);
unsigned long end = start + len;
unsigned long dcache_line_size;

dcache_line_size = local_cpu_data().dcache_line_size;

if (tlb_type == spitfire) {
for (; start < end; start += 32)
for (; start < end; start += dcache_line_size)
spitfire_put_dcache_tag(start & 0x3fe0, 0x0);
} else {
for (; start < end; start += 32)
start &= ~(dcache_line_size - 1);
for (; start < end; start += dcache_line_size)
__asm__ __volatile__(
"stxa %%g0, [%0] %1\n\t"
"membar #Sync"
Expand All @@ -150,8 +155,11 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
if (write && tlb_type == spitfire) {
unsigned long start = (unsigned long) kaddr;
unsigned long end = start + len;
unsigned long icache_line_size;

icache_line_size = local_cpu_data().icache_line_size;

for (; start < end; start += 32)
for (; start < end; start += icache_line_size)
flushi(start);
}
}
Expand Down
21 changes: 0 additions & 21 deletions arch/sparc64/kernel/setup.c
Expand Up @@ -464,8 +464,6 @@ static void __init boot_flags_init(char *commands)
}
}

extern int prom_probe_memory(void);
extern unsigned long start, end;
extern void panic_setup(char *, int *);

extern unsigned short root_flags;
Expand All @@ -492,12 +490,8 @@ void register_prom_callbacks(void)
"' linux-.soft2 to .soft2");
}

extern void paging_init(void);

void __init setup_arch(char **cmdline_p)
{
int i;

/* Initialize PROM console and command line. */
*cmdline_p = prom_getbootargs();
strcpy(saved_command_line, *cmdline_p);
Expand All @@ -516,21 +510,6 @@ void __init setup_arch(char **cmdline_p)
boot_flags_init(*cmdline_p);

idprom_init();
(void) prom_probe_memory();

phys_base = 0xffffffffffffffffUL;
for (i = 0; sp_banks[i].num_bytes != 0; i++) {
unsigned long top;

if (sp_banks[i].base_addr < phys_base)
phys_base = sp_banks[i].base_addr;
top = sp_banks[i].base_addr +
sp_banks[i].num_bytes;
}
pfn_base = phys_base >> PAGE_SHIFT;

kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;

if (!root_flags)
root_mountflags &= ~MS_RDONLY;
Expand Down
170 changes: 98 additions & 72 deletions arch/sparc64/kernel/sys32.S
Expand Up @@ -157,173 +157,199 @@ sys32_socketcall: /* %o0=call, %o1=args */
or %g2, %lo(__socketcall_table_begin), %g2
jmpl %g2 + %o0, %g0
nop
do_einval:
retl
mov -EINVAL, %o0

/* Each entry is exactly 32 bytes. */
.align 32
__socketcall_table_begin:

/* Each entry is exactly 32 bytes. */
do_sys_socket: /* sys_socket(int, int, int) */
ldswa [%o1 + 0x0] %asi, %o0
1: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_socket), %g1
ldswa [%o1 + 0x8] %asi, %o2
2: ldswa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(sys_socket), %g0
ldswa [%o1 + 0x4] %asi, %o1
3: ldswa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_bind: /* sys_bind(int fd, struct sockaddr *, int) */
ldswa [%o1 + 0x0] %asi, %o0
4: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_bind), %g1
ldswa [%o1 + 0x8] %asi, %o2
5: ldswa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(sys_bind), %g0
lduwa [%o1 + 0x4] %asi, %o1
6: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_connect: /* sys_connect(int, struct sockaddr *, int) */
ldswa [%o1 + 0x0] %asi, %o0
7: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_connect), %g1
ldswa [%o1 + 0x8] %asi, %o2
8: ldswa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(sys_connect), %g0
lduwa [%o1 + 0x4] %asi, %o1
9: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_listen: /* sys_listen(int, int) */
ldswa [%o1 + 0x0] %asi, %o0
10: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_listen), %g1
jmpl %g1 + %lo(sys_listen), %g0
ldswa [%o1 + 0x4] %asi, %o1
11: ldswa [%o1 + 0x4] %asi, %o1
nop
nop
nop
nop
do_sys_accept: /* sys_accept(int, struct sockaddr *, int *) */
ldswa [%o1 + 0x0] %asi, %o0
12: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_accept), %g1
lduwa [%o1 + 0x8] %asi, %o2
13: lduwa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(sys_accept), %g0
lduwa [%o1 + 0x4] %asi, %o1
14: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_getsockname: /* sys_getsockname(int, struct sockaddr *, int *) */
ldswa [%o1 + 0x0] %asi, %o0
15: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_getsockname), %g1
lduwa [%o1 + 0x8] %asi, %o2
16: lduwa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(sys_getsockname), %g0
lduwa [%o1 + 0x4] %asi, %o1
17: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_getpeername: /* sys_getpeername(int, struct sockaddr *, int *) */
ldswa [%o1 + 0x0] %asi, %o0
18: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_getpeername), %g1
lduwa [%o1 + 0x8] %asi, %o2
19: lduwa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(sys_getpeername), %g0
lduwa [%o1 + 0x4] %asi, %o1
20: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_socketpair: /* sys_socketpair(int, int, int, int *) */
ldswa [%o1 + 0x0] %asi, %o0
21: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_socketpair), %g1
ldswa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
22: ldswa [%o1 + 0x8] %asi, %o2
23: lduwa [%o1 + 0xc] %asi, %o3
jmpl %g1 + %lo(sys_socketpair), %g0
ldswa [%o1 + 0x4] %asi, %o1
24: ldswa [%o1 + 0x4] %asi, %o1
nop
nop
do_sys_send: /* sys_send(int, void *, size_t, unsigned int) */
ldswa [%o1 + 0x0] %asi, %o0
25: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_send), %g1
lduwa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
26: lduwa [%o1 + 0x8] %asi, %o2
27: lduwa [%o1 + 0xc] %asi, %o3
jmpl %g1 + %lo(sys_send), %g0
lduwa [%o1 + 0x4] %asi, %o1
28: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
do_sys_recv: /* sys_recv(int, void *, size_t, unsigned int) */
ldswa [%o1 + 0x0] %asi, %o0
29: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_recv), %g1
lduwa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
30: lduwa [%o1 + 0x8] %asi, %o2
31: lduwa [%o1 + 0xc] %asi, %o3
jmpl %g1 + %lo(sys_recv), %g0
lduwa [%o1 + 0x4] %asi, %o1
32: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
do_sys_sendto: /* sys_sendto(int, u32, compat_size_t, unsigned int, u32, int) */
ldswa [%o1 + 0x0] %asi, %o0
33: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_sendto), %g1
lduwa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
lduwa [%o1 + 0x10] %asi, %o4
ldswa [%o1 + 0x14] %asi, %o5
34: lduwa [%o1 + 0x8] %asi, %o2
35: lduwa [%o1 + 0xc] %asi, %o3
36: lduwa [%o1 + 0x10] %asi, %o4
37: ldswa [%o1 + 0x14] %asi, %o5
jmpl %g1 + %lo(sys_sendto), %g0
lduwa [%o1 + 0x4] %asi, %o1
38: lduwa [%o1 + 0x4] %asi, %o1
do_sys_recvfrom: /* sys_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */
ldswa [%o1 + 0x0] %asi, %o0
39: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_recvfrom), %g1
lduwa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
lduwa [%o1 + 0x10] %asi, %o4
lduwa [%o1 + 0x14] %asi, %o5
40: lduwa [%o1 + 0x8] %asi, %o2
41: lduwa [%o1 + 0xc] %asi, %o3
42: lduwa [%o1 + 0x10] %asi, %o4
43: lduwa [%o1 + 0x14] %asi, %o5
jmpl %g1 + %lo(sys_recvfrom), %g0
lduwa [%o1 + 0x4] %asi, %o1
44: lduwa [%o1 + 0x4] %asi, %o1
do_sys_shutdown: /* sys_shutdown(int, int) */
ldswa [%o1 + 0x0] %asi, %o0
45: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(sys_shutdown), %g1
jmpl %g1 + %lo(sys_shutdown), %g0
ldswa [%o1 + 0x4] %asi, %o1
46: ldswa [%o1 + 0x4] %asi, %o1
nop
nop
nop
nop
do_sys_setsockopt: /* compat_sys_setsockopt(int, int, int, char *, int) */
ldswa [%o1 + 0x0] %asi, %o0
47: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(compat_sys_setsockopt), %g1
ldswa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
ldswa [%o1 + 0x10] %asi, %o4
48: ldswa [%o1 + 0x8] %asi, %o2
49: lduwa [%o1 + 0xc] %asi, %o3
50: ldswa [%o1 + 0x10] %asi, %o4
jmpl %g1 + %lo(compat_sys_setsockopt), %g0
ldswa [%o1 + 0x4] %asi, %o1
51: ldswa [%o1 + 0x4] %asi, %o1
nop
do_sys_getsockopt: /* compat_sys_getsockopt(int, int, int, u32, u32) */
ldswa [%o1 + 0x0] %asi, %o0
52: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(compat_sys_getsockopt), %g1
ldswa [%o1 + 0x8] %asi, %o2
lduwa [%o1 + 0xc] %asi, %o3
lduwa [%o1 + 0x10] %asi, %o4
53: ldswa [%o1 + 0x8] %asi, %o2
54: lduwa [%o1 + 0xc] %asi, %o3
55: lduwa [%o1 + 0x10] %asi, %o4
jmpl %g1 + %lo(compat_sys_getsockopt), %g0
ldswa [%o1 + 0x4] %asi, %o1
56: ldswa [%o1 + 0x4] %asi, %o1
nop
do_sys_sendmsg: /* compat_sys_sendmsg(int, struct compat_msghdr *, unsigned int) */
ldswa [%o1 + 0x0] %asi, %o0
57: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(compat_sys_sendmsg), %g1
lduwa [%o1 + 0x8] %asi, %o2
58: lduwa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(compat_sys_sendmsg), %g0
lduwa [%o1 + 0x4] %asi, %o1
59: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int) */
ldswa [%o1 + 0x0] %asi, %o0
60: ldswa [%o1 + 0x0] %asi, %o0
sethi %hi(compat_sys_recvmsg), %g1
lduwa [%o1 + 0x8] %asi, %o2
61: lduwa [%o1 + 0x8] %asi, %o2
jmpl %g1 + %lo(compat_sys_recvmsg), %g0
lduwa [%o1 + 0x4] %asi, %o1
62: lduwa [%o1 + 0x4] %asi, %o1
nop
nop
nop
__socketcall_table_end:

do_einval:
retl
mov -EINVAL, %o0
do_efault:
retl
mov -EFAULT, %o0

.section __ex_table
.align 4
.word __socketcall_table_begin, 0, __socketcall_table_end, do_efault
.word 1b, __retl_efault, 2b, __retl_efault
.word 3b, __retl_efault, 4b, __retl_efault
.word 5b, __retl_efault, 6b, __retl_efault
.word 7b, __retl_efault, 8b, __retl_efault
.word 9b, __retl_efault, 10b, __retl_efault
.word 11b, __retl_efault, 12b, __retl_efault
.word 13b, __retl_efault, 14b, __retl_efault
.word 15b, __retl_efault, 16b, __retl_efault
.word 17b, __retl_efault, 18b, __retl_efault
.word 19b, __retl_efault, 20b, __retl_efault
.word 21b, __retl_efault, 22b, __retl_efault
.word 23b, __retl_efault, 24b, __retl_efault
.word 25b, __retl_efault, 26b, __retl_efault
.word 27b, __retl_efault, 28b, __retl_efault
.word 29b, __retl_efault, 30b, __retl_efault
.word 31b, __retl_efault, 32b, __retl_efault
.word 33b, __retl_efault, 34b, __retl_efault
.word 35b, __retl_efault, 36b, __retl_efault
.word 37b, __retl_efault, 38b, __retl_efault
.word 39b, __retl_efault, 40b, __retl_efault
.word 41b, __retl_efault, 42b, __retl_efault
.word 43b, __retl_efault, 44b, __retl_efault
.word 45b, __retl_efault, 46b, __retl_efault
.word 47b, __retl_efault, 48b, __retl_efault
.word 49b, __retl_efault, 50b, __retl_efault
.word 51b, __retl_efault, 52b, __retl_efault
.word 53b, __retl_efault, 54b, __retl_efault
.word 55b, __retl_efault, 56b, __retl_efault
.word 57b, __retl_efault, 58b, __retl_efault
.word 59b, __retl_efault, 60b, __retl_efault
.word 61b, __retl_efault, 62b, __retl_efault
.previous

0 comments on commit c4a7c77

Please sign in to comment.