Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull sparc fixes from David Miller:
 "Two small fixes for Sparc, nobody uses sparc, so these are low risk :-)

   1) Piggyback is too picky about the symbol types that _start and _end
      have in the final kernel image, and it thus breaks with newer
      binutils.  Future proof by getting rid of the symbol type checks.

   2) exit_group() should kill register windows on sparc64 the same way
      we do for plain exit().  Thanks to Al Viro for spotting this."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: Fix piggyback with newer binutils.
  sparc64: exit_group should kill register windows just like plain exit.
This commit is contained in:
Linus Torvalds 2012-12-04 08:42:29 -08:00
commit 609e3ff3ff
4 changed files with 20 additions and 10 deletions

View File

@ -81,18 +81,18 @@ static void usage(void)
static int start_line(const char *line) static int start_line(const char *line)
{ {
if (strcmp(line + 8, " T _start\n") == 0) if (strcmp(line + 10, " _start\n") == 0)
return 1; return 1;
else if (strcmp(line + 16, " T _start\n") == 0) else if (strcmp(line + 18, " _start\n") == 0)
return 1; return 1;
return 0; return 0;
} }
static int end_line(const char *line) static int end_line(const char *line)
{ {
if (strcmp(line + 8, " A _end\n") == 0) if (strcmp(line + 10, " _end\n") == 0)
return 1; return 1;
else if (strcmp (line + 16, " A _end\n") == 0) else if (strcmp (line + 18, " _end\n") == 0)
return 1; return 1;
return 0; return 0;
} }
@ -100,8 +100,8 @@ static int end_line(const char *line)
/* /*
* Find address for start and end in System.map. * Find address for start and end in System.map.
* The file looks like this: * The file looks like this:
* f0004000 T _start * f0004000 ... _start
* f0379f79 A _end * f0379f79 ... _end
* 1234567890123456 * 1234567890123456
* ^coloumn 1 * ^coloumn 1
* There is support for 64 bit addresses too. * There is support for 64 bit addresses too.

View File

@ -47,7 +47,7 @@ STUB: sra REG1, 0, REG1; \
sra REG4, 0, REG4 sra REG4, 0, REG4
SIGN1(sys32_exit, sparc_exit, %o0) SIGN1(sys32_exit, sparc_exit, %o0)
SIGN1(sys32_exit_group, sys_exit_group, %o0) SIGN1(sys32_exit_group, sparc_exit_group, %o0)
SIGN1(sys32_wait4, compat_sys_wait4, %o2) SIGN1(sys32_wait4, compat_sys_wait4, %o2)
SIGN1(sys32_creat, sys_creat, %o1) SIGN1(sys32_creat, sys_creat, %o1)
SIGN1(sys32_mknod, sys_mknod, %o1) SIGN1(sys32_mknod, sys_mknod, %o1)

View File

@ -118,10 +118,20 @@ ret_from_syscall:
ba,pt %xcc, ret_sys_call ba,pt %xcc, ret_sys_call
ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0
.globl sparc_exit_group
.type sparc_exit_group,#function
sparc_exit_group:
sethi %hi(sys_exit_group), %g7
ba,pt %xcc, 1f
or %g7, %lo(sys_exit_group), %g7
.size sparc_exit_group,.-sparc_exit_group
.globl sparc_exit .globl sparc_exit
.type sparc_exit,#function .type sparc_exit,#function
sparc_exit: sparc_exit:
rdpr %pstate, %g2 sethi %hi(sys_exit), %g7
or %g7, %lo(sys_exit), %g7
1: rdpr %pstate, %g2
wrpr %g2, PSTATE_IE, %pstate wrpr %g2, PSTATE_IE, %pstate
rdpr %otherwin, %g1 rdpr %otherwin, %g1
rdpr %cansave, %g3 rdpr %cansave, %g3
@ -129,7 +139,7 @@ sparc_exit:
wrpr %g3, 0x0, %cansave wrpr %g3, 0x0, %cansave
wrpr %g0, 0x0, %otherwin wrpr %g0, 0x0, %otherwin
wrpr %g2, 0x0, %pstate wrpr %g2, 0x0, %pstate
ba,pt %xcc, sys_exit jmpl %g7, %g0
stb %g0, [%g6 + TI_WSAVED] stb %g0, [%g6 + TI_WSAVED]
.size sparc_exit,.-sparc_exit .size sparc_exit,.-sparc_exit

View File

@ -133,7 +133,7 @@ sys_call_table:
/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
.word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall /*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
.word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname .word sys_setpgid, sys_fremovexattr, sys_tkill, sparc_exit_group, sys_newuname
/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl /*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
.word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall /*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall