Commit 5e6b6426 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.

- Make SUNOS_EMUL depend upon BINFMT_AOUT32
- Make SOLARIS_EMUL depend upon SPARC32_COMPAT
- Add CONFIG_COMPAT guards, where necessary.
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent d8527cac
......@@ -382,6 +382,7 @@ source "fs/Kconfig.binfmt"
config SUNOS_EMUL
bool "SunOS binary emulation"
depends on BINFMT_AOUT32
help
This allows you to run most SunOS binaries. If you want to do this,
say Y here and place appropriate files in /usr/gnemul/sunos. See
......@@ -391,7 +392,7 @@ config SUNOS_EMUL
config SOLARIS_EMUL
tristate "Solaris binary emulation (EXPERIMENTAL)"
depends on EXPERIMENTAL
depends on SPARC32_COMPAT && EXPERIMENTAL
help
This is experimental code which will enable you to run (many)
Solaris binaries on your SPARC Linux machine.
......
......@@ -1496,28 +1496,30 @@ sunos_getgid:
/* SunOS's execv() call only specifies the argv argument, the
* environment settings are the same as the calling processes.
*/
.globl sunos_execv, sys_execve, sys32_execve
.globl sunos_execv
sys_execve:
sethi %hi(sparc_execve), %g1
ba,pt %xcc, execve_merge
or %g1, %lo(sparc_execve), %g1
#ifdef CONFIG_COMPAT
.globl sys_execve
sunos_execv:
stx %g0, [%sp + PTREGS_OFF + PT_V9_I2]
.globl sys32_execve
sys32_execve:
sethi %hi(sparc32_execve), %g1
or %g1, %lo(sparc32_execve), %g1
#endif
execve_merge:
flushw
jmpl %g1, %g0
add %sp, PTREGS_OFF, %o0
.globl sys_pipe, sys_sigpause, sys_nis_syscall
.globl sys_sigsuspend, sys_rt_sigsuspend, sys32_rt_sigsuspend
.globl sys_sigsuspend, sys_rt_sigsuspend
.globl sys_rt_sigreturn
.globl sys32_sigreturn, sys32_rt_sigreturn
.globl sys32_execve, sys_ptrace
.globl sys_sigaltstack, sys32_sigaltstack
.globl sys32_sigstack
.globl sys_ptrace
.globl sys_sigaltstack
.align 32
sys_pipe: ba,pt %xcc, sparc_pipe
add %sp, PTREGS_OFF, %o0
......@@ -1528,12 +1530,15 @@ sys_memory_ordering:
add %sp, PTREGS_OFF, %o1
sys_sigaltstack:ba,pt %xcc, do_sigaltstack
add %i6, STACK_BIAS, %o2
#ifdef CONFIG_COMPAT
.globl sys32_sigstack
sys32_sigstack: ba,pt %xcc, do_sys32_sigstack
mov %i6, %o2
.globl sys32_sigaltstack
sys32_sigaltstack:
ba,pt %xcc, do_sys32_sigaltstack
mov %i6, %o2
#endif
.align 32
sys_sigsuspend: add %sp, PTREGS_OFF, %o0
call do_sigsuspend
......@@ -1544,31 +1549,40 @@ sys_rt_sigsuspend: /* NOTE: %o0,%o1 have a correct value already */
call do_rt_sigsuspend
add %o7, 1f-.-4, %o7
nop
#ifdef CONFIG_COMPAT
.globl sys32_rt_sigsuspend
sys32_rt_sigsuspend: /* NOTE: %o0,%o1 have a correct value already */
srl %o0, 0, %o0
add %sp, PTREGS_OFF, %o2
call do_rt_sigsuspend32
add %o7, 1f-.-4, %o7
#endif
/* NOTE: %o0 has a correct value already */
sys_sigpause: add %sp, PTREGS_OFF, %o1
call do_sigpause
add %o7, 1f-.-4, %o7
nop
#ifdef CONFIG_COMPAT
.globl sys32_sigreturn
sys32_sigreturn:
add %sp, PTREGS_OFF, %o0
call do_sigreturn32
add %o7, 1f-.-4, %o7
nop
#endif
sys_rt_sigreturn:
add %sp, PTREGS_OFF, %o0
call do_rt_sigreturn
add %o7, 1f-.-4, %o7
nop
#ifdef CONFIG_COMPAT
.globl sys32_rt_sigreturn
sys32_rt_sigreturn:
add %sp, PTREGS_OFF, %o0
call do_rt_sigreturn32
add %o7, 1f-.-4, %o7
nop
#endif
sys_ptrace: add %sp, PTREGS_OFF, %o0
call do_ptrace
add %o7, 1f-.-4, %o7
......
......@@ -12,6 +12,7 @@
#include <stdarg.h>
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
......@@ -28,6 +29,7 @@
#include <linux/config.h>
#include <linux/reboot.h>
#include <linux/delay.h>
#include <linux/compat.h>
#include <linux/init.h>
#include <asm/oplib.h>
......@@ -588,10 +590,13 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
clone_flags &= ~CLONE_IDLETASK;
#ifdef CONFIG_COMPAT
if (test_thread_flag(TIF_32BIT)) {
parent_tid_ptr = compat_ptr(regs->u_regs[UREG_I2]);
child_tid_ptr = compat_ptr(regs->u_regs[UREG_I4]);
} else {
} else
#endif
{
parent_tid_ptr = (int __user *) regs->u_regs[UREG_I2];
child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
}
......
......@@ -15,6 +15,7 @@
.text
.align 4
#ifdef CONFIG_COMPAT
/* First, the 32-bit Linux native syscall table. */
.globl sys_call_table32
......@@ -77,6 +78,8 @@ sys_call_table32:
.word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, sys_ni_syscall
/*280*/ .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall
#endif /* CONFIG_COMPAT */
/* Now the 64-bit native Linux syscall table. */
.align 4
......@@ -85,7 +88,7 @@ sys_call_table64:
sys_call_table:
/*0*/ .word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write
/*5*/ .word sys_open, sys_close, sys_wait4, sys_creat, sys_link
/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown, sys_mknod
/*10*/ .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod
/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek
/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
/*25*/ .word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
......
......@@ -14,8 +14,11 @@
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/compat.h>
#ifdef CONFIG_COMPAT
typedef union sigval32 {
int sival_int;
u32 sival_ptr;
......@@ -72,6 +75,7 @@ typedef struct siginfo32 {
} _sigpoll;
} _sifields;
} siginfo_t32;
#endif /* CONFIG_COMPAT */
#endif /* __KERNEL__ */
......@@ -85,6 +89,8 @@ typedef struct siginfo32 {
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT
typedef struct sigevent32 {
sigval_t32 sigev_value;
int sigev_signo;
......@@ -101,6 +107,8 @@ typedef struct sigevent32 {
extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
#endif /* CONFIG_COMPAT */
#endif /* __KERNEL__ */
#endif
......@@ -6,6 +6,7 @@
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#include <linux/config.h>
#include <linux/personality.h>
#include <linux/types.h>
#include <linux/compat.h>
......@@ -208,12 +209,15 @@ struct __new_sigaction {
};
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT
struct __new_sigaction32 {
unsigned sa_handler;
unsigned int sa_flags;
unsigned sa_restorer; /* not used by Linux/SPARC yet */
compat_sigset_t sa_mask;
};
#endif
struct k_sigaction {
struct __new_sigaction sa;
......@@ -229,6 +233,8 @@ struct __old_sigaction {
};
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT
struct __old_sigaction32 {
unsigned sa_handler;
compat_old_sigset_t sa_mask;
......@@ -237,6 +243,8 @@ struct __old_sigaction32 {
};
#endif
#endif
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
......@@ -244,11 +252,14 @@ typedef struct sigaltstack {
} stack_t;
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT
typedef struct sigaltstack32 {
u32 ss_sp;
int ss_flags;
compat_size_t ss_size;
} stack_t32;
#endif
struct signal_deliver_cookie {
int restart_syscall;
......
......@@ -123,7 +123,11 @@
#else
#define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
#endif
#ifdef CONFIG_COMPAT
#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
#else
#define LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
#endif
#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
#define GETCC_TRAP TRAP(getcc)
#define SETCC_TRAP TRAP(setcc)
......
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