mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
[MIPS] IRIX: Goodbye and thanks for all the fish
Never terribly functional or popular, plagued by hard to fix bugs the time to say goodbye has more than arrived. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
@@ -2064,10 +2064,6 @@ source "fs/Kconfig.binfmt"
|
||||
config TRAD_SIGNALS
|
||||
bool
|
||||
|
||||
config BINFMT_IRIX
|
||||
bool "Include IRIX binary compatibility"
|
||||
depends on CPU_BIG_ENDIAN && 32BIT && BROKEN
|
||||
|
||||
config MIPS32_COMPAT
|
||||
bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
|
||||
depends on 64BIT
|
||||
|
||||
@@ -20,9 +20,6 @@ obj-$(CONFIG_CSRC_R4K) += csrc-r4k.o
|
||||
obj-$(CONFIG_CSRC_SB1250) += csrc-sb1250.o
|
||||
obj-$(CONFIG_SYNC_R4K) += sync-r4k.o
|
||||
|
||||
binfmt_irix-objs := irixelf.o irixinv.o irixioctl.o irixsig.o \
|
||||
irix5sys.o sysirix.o
|
||||
|
||||
obj-$(CONFIG_STACKTRACE) += stacktrace.o
|
||||
obj-$(CONFIG_MODULES) += mips_ksyms.o module.o
|
||||
|
||||
@@ -70,7 +67,6 @@ obj-$(CONFIG_IRQ_GIC) += irq-gic.o
|
||||
|
||||
obj-$(CONFIG_32BIT) += scall32-o32.o
|
||||
obj-$(CONFIG_64BIT) += scall64-64.o
|
||||
obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o
|
||||
obj-$(CONFIG_MIPS32_COMPAT) += linux32.o ptrace32.o signal32.o
|
||||
obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o
|
||||
obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Support the inventory interface for IRIX binaries
|
||||
* This is invoked before the mm layer is working, so we do not
|
||||
* use the linked lists for the inventory yet.
|
||||
*
|
||||
* Miguel de Icaza, 1997.
|
||||
*/
|
||||
#include <linux/mm.h>
|
||||
#include <asm/inventory.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#define MAX_INVENTORY 50
|
||||
int inventory_items = 0;
|
||||
|
||||
static inventory_t inventory [MAX_INVENTORY];
|
||||
|
||||
void add_to_inventory(int class, int type, int controller, int unit, int state)
|
||||
{
|
||||
inventory_t *ni = &inventory [inventory_items];
|
||||
|
||||
if (inventory_items == MAX_INVENTORY)
|
||||
return;
|
||||
|
||||
ni->inv_class = class;
|
||||
ni->inv_type = type;
|
||||
ni->inv_controller = controller;
|
||||
ni->inv_unit = unit;
|
||||
ni->inv_state = state;
|
||||
ni->inv_next = ni;
|
||||
inventory_items++;
|
||||
}
|
||||
|
||||
int dump_inventory_to_user(void __user *userbuf, int size)
|
||||
{
|
||||
inventory_t *inv = &inventory [0];
|
||||
inventory_t __user *user = userbuf;
|
||||
int v;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, userbuf, size))
|
||||
return -EFAULT;
|
||||
|
||||
for (v = 0; v < inventory_items; v++){
|
||||
inv = &inventory [v];
|
||||
if (copy_to_user (user, inv, sizeof (inventory_t)))
|
||||
return -EFAULT;
|
||||
user++;
|
||||
}
|
||||
return inventory_items * sizeof(inventory_t);
|
||||
}
|
||||
|
||||
int __init init_inventory(void)
|
||||
{
|
||||
/*
|
||||
* gross hack while we put the right bits all over the kernel
|
||||
* most likely this will not let just anyone run the X server
|
||||
* until we put the right values all over the place
|
||||
*/
|
||||
add_to_inventory(10, 3, 0, 0, 16400);
|
||||
add_to_inventory(1, 1, 150, -1, 12);
|
||||
add_to_inventory(1, 3, 0, 0, 8976);
|
||||
add_to_inventory(1, 2, 0, 0, 8976);
|
||||
add_to_inventory(4, 8, 0, 0, 2);
|
||||
add_to_inventory(5, 5, 0, 0, 1);
|
||||
add_to_inventory(3, 3, 0, 0, 32768);
|
||||
add_to_inventory(3, 4, 0, 0, 32768);
|
||||
add_to_inventory(3, 8, 0, 0, 524288);
|
||||
add_to_inventory(3, 9, 0, 0, 64);
|
||||
add_to_inventory(3, 1, 0, 0, 67108864);
|
||||
add_to_inventory(12, 3, 0, 0, 16);
|
||||
add_to_inventory(8, 7, 17, 0, 16777472);
|
||||
add_to_inventory(8, 0, 0, 0, 1);
|
||||
add_to_inventory(2, 1, 0, 13, 2);
|
||||
add_to_inventory(2, 2, 0, 2, 0);
|
||||
add_to_inventory(2, 2, 0, 1, 0);
|
||||
add_to_inventory(7, 14, 0, 0, 6);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
/*
|
||||
* irixioctl.c: A fucking mess...
|
||||
*
|
||||
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/sockios.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/ioctl.h>
|
||||
#include <asm/ioctls.h>
|
||||
|
||||
#undef DEBUG_IOCTLS
|
||||
#undef DEBUG_MISSING_IOCTL
|
||||
|
||||
struct irix_termios {
|
||||
tcflag_t c_iflag, c_oflag, c_cflag, c_lflag;
|
||||
cc_t c_cc[NCCS];
|
||||
};
|
||||
|
||||
asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
|
||||
{
|
||||
struct tty_struct *tp, *rtp;
|
||||
mm_segment_t old_fs;
|
||||
int i, error = 0;
|
||||
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("[%s:%d] irix_ioctl(%d, ", current->comm, current->pid, fd);
|
||||
#endif
|
||||
switch(cmd) {
|
||||
case 0x00005401:
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TCGETA, %08lx) ", arg);
|
||||
#endif
|
||||
error = sys_ioctl(fd, TCGETA, arg);
|
||||
break;
|
||||
|
||||
case 0x0000540d: {
|
||||
struct termios kt;
|
||||
struct irix_termios __user *it =
|
||||
(struct irix_termios __user *) arg;
|
||||
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TCGETS, %08lx) ", arg);
|
||||
#endif
|
||||
if (!access_ok(VERIFY_WRITE, it, sizeof(*it))) {
|
||||
error = -EFAULT;
|
||||
break;
|
||||
}
|
||||
old_fs = get_fs(); set_fs(get_ds());
|
||||
error = sys_ioctl(fd, TCGETS, (unsigned long) &kt);
|
||||
set_fs(old_fs);
|
||||
if (error)
|
||||
break;
|
||||
|
||||
error = __put_user(kt.c_iflag, &it->c_iflag);
|
||||
error |= __put_user(kt.c_oflag, &it->c_oflag);
|
||||
error |= __put_user(kt.c_cflag, &it->c_cflag);
|
||||
error |= __put_user(kt.c_lflag, &it->c_lflag);
|
||||
|
||||
for (i = 0; i < NCCS; i++)
|
||||
error |= __put_user(kt.c_cc[i], &it->c_cc[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x0000540e: {
|
||||
struct termios kt;
|
||||
struct irix_termios *it = (struct irix_termios *) arg;
|
||||
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TCSETS, %08lx) ", arg);
|
||||
#endif
|
||||
if (!access_ok(VERIFY_READ, it, sizeof(*it))) {
|
||||
error = -EFAULT;
|
||||
break;
|
||||
}
|
||||
old_fs = get_fs(); set_fs(get_ds());
|
||||
error = sys_ioctl(fd, TCGETS, (unsigned long) &kt);
|
||||
set_fs(old_fs);
|
||||
if (error)
|
||||
break;
|
||||
|
||||
error = __get_user(kt.c_iflag, &it->c_iflag);
|
||||
error |= __get_user(kt.c_oflag, &it->c_oflag);
|
||||
error |= __get_user(kt.c_cflag, &it->c_cflag);
|
||||
error |= __get_user(kt.c_lflag, &it->c_lflag);
|
||||
|
||||
for (i = 0; i < NCCS; i++)
|
||||
error |= __get_user(kt.c_cc[i], &it->c_cc[i]);
|
||||
|
||||
if (error)
|
||||
break;
|
||||
old_fs = get_fs(); set_fs(get_ds());
|
||||
error = sys_ioctl(fd, TCSETS, (unsigned long) &kt);
|
||||
set_fs(old_fs);
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x0000540f:
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TCSETSW, %08lx) ", arg);
|
||||
#endif
|
||||
error = sys_ioctl(fd, TCSETSW, arg);
|
||||
break;
|
||||
|
||||
case 0x00005471:
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TIOCNOTTY, %08lx) ", arg);
|
||||
#endif
|
||||
error = sys_ioctl(fd, TIOCNOTTY, arg);
|
||||
break;
|
||||
|
||||
case 0x00007416: {
|
||||
pid_t pid;
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TIOCGSID, %08lx) ", arg);
|
||||
#endif
|
||||
old_fs = get_fs(); set_fs(get_ds());
|
||||
error = sys_ioctl(fd, TIOCGSID, (unsigned long)&pid);
|
||||
set_fs(old_fs);
|
||||
if (!error)
|
||||
error = put_user(pid, (unsigned long __user *) arg);
|
||||
break;
|
||||
}
|
||||
case 0x746e:
|
||||
/* TIOCSTART, same effect as hitting ^Q */
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TIOCSTART, %08lx) ", arg);
|
||||
#endif
|
||||
error = sys_ioctl(fd, TCXONC, TCOON);
|
||||
break;
|
||||
|
||||
case 0x20006968:
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("SIOCGETLABEL, %08lx) ", arg);
|
||||
#endif
|
||||
error = -ENOPKG;
|
||||
break;
|
||||
|
||||
case 0x40047477:
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TIOCGPGRP, %08lx) ", arg);
|
||||
#endif
|
||||
error = sys_ioctl(fd, TIOCGPGRP, arg);
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("arg=%d ", *(int *)arg);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x40087468:
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("TIOCGWINSZ, %08lx) ", arg);
|
||||
#endif
|
||||
error = sys_ioctl(fd, TIOCGWINSZ, arg);
|
||||
break;
|
||||
|
||||
case 0x8004667e:
|
||||
error = sys_ioctl(fd, FIONBIO, arg);
|
||||
break;
|
||||
|
||||
case 0x80047476:
|
||||
error = sys_ioctl(fd, TIOCSPGRP, arg);
|
||||
break;
|
||||
|
||||
case 0x8020690c:
|
||||
error = sys_ioctl(fd, SIOCSIFADDR, arg);
|
||||
break;
|
||||
|
||||
case 0x80206910:
|
||||
error = sys_ioctl(fd, SIOCSIFFLAGS, arg);
|
||||
break;
|
||||
|
||||
case 0xc0206911:
|
||||
error = sys_ioctl(fd, SIOCGIFFLAGS, arg);
|
||||
break;
|
||||
|
||||
case 0xc020691b:
|
||||
error = sys_ioctl(fd, SIOCGIFMETRIC, arg);
|
||||
break;
|
||||
|
||||
default: {
|
||||
#ifdef DEBUG_MISSING_IOCTL
|
||||
char *msg = "Unimplemented IOCTL cmd tell linux-mips@linux-mips.org\n";
|
||||
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("UNIMP_IOCTL, %08lx)\n", arg);
|
||||
#endif
|
||||
old_fs = get_fs(); set_fs(get_ds());
|
||||
sys_write(2, msg, strlen(msg));
|
||||
set_fs(old_fs);
|
||||
printk("[%s:%d] Does unimplemented IRIX ioctl cmd %08lx\n",
|
||||
current->comm, current->pid, cmd);
|
||||
do_exit(255);
|
||||
#else
|
||||
error = sys_ioctl(fd, cmd, arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
#ifdef DEBUG_IOCTLS
|
||||
printk("error=%d\n", error);
|
||||
#endif
|
||||
return error;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -125,13 +125,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
||||
*childregs = *regs;
|
||||
childregs->regs[7] = 0; /* Clear error flag */
|
||||
|
||||
#if defined(CONFIG_BINFMT_IRIX)
|
||||
if (current->personality != PER_LINUX) {
|
||||
/* Under IRIX things are a little different. */
|
||||
childregs->regs[3] = 1;
|
||||
regs->regs[3] = 0;
|
||||
}
|
||||
#endif
|
||||
childregs->regs[2] = 0; /* Child gets zero as return value */
|
||||
regs->regs[2] = p->pid;
|
||||
|
||||
|
||||
@@ -34,12 +34,8 @@ NESTED(handle_sys, PT_SIZE, sp)
|
||||
|
||||
lw t1, PT_EPC(sp) # skip syscall on return
|
||||
|
||||
#if defined(CONFIG_BINFMT_IRIX)
|
||||
sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number
|
||||
#else
|
||||
subu v0, v0, __NR_O32_Linux # check syscall number
|
||||
sltiu t0, v0, __NR_O32_Linux_syscalls + 1
|
||||
#endif
|
||||
addiu t1, 4 # skip to next instruction
|
||||
sw t1, PT_EPC(sp)
|
||||
beqz t0, illegal_syscall
|
||||
@@ -264,22 +260,14 @@ bad_alignment:
|
||||
END(sys_sysmips)
|
||||
|
||||
LEAF(sys_syscall)
|
||||
#if defined(CONFIG_BINFMT_IRIX)
|
||||
sltiu v0, a0, MAX_SYSCALL_NO + 1 # check syscall number
|
||||
#else
|
||||
subu t0, a0, __NR_O32_Linux # check syscall number
|
||||
sltiu v0, t0, __NR_O32_Linux_syscalls + 1
|
||||
#endif
|
||||
sll t1, t0, 3
|
||||
beqz v0, einval
|
||||
|
||||
lw t2, sys_call_table(t1) # syscall routine
|
||||
|
||||
#if defined(CONFIG_BINFMT_IRIX)
|
||||
li v1, 4000 # nr of sys_syscall
|
||||
#else
|
||||
li v1, 4000 - __NR_O32_Linux # index of sys_syscall
|
||||
#endif
|
||||
beq t0, v1, einval # do not recurse
|
||||
|
||||
/* Some syscalls like execve get their arguments from struct pt_regs
|
||||
@@ -324,13 +312,6 @@ einval: li v0, -EINVAL
|
||||
.endm
|
||||
|
||||
.macro syscalltable
|
||||
#if defined(CONFIG_BINFMT_IRIX)
|
||||
mille sys_ni_syscall 0 /* 0 - 999 SVR4 flavour */
|
||||
mille sys_ni_syscall 0 /* 1000 - 1999 32-bit IRIX */
|
||||
mille sys_ni_syscall 0 /* 2000 - 2999 BSD43 flavour */
|
||||
mille sys_ni_syscall 0 /* 3000 - 3999 POSIX flavour */
|
||||
#endif
|
||||
|
||||
sys sys_syscall 8 /* 4000 */
|
||||
sys sys_exit 1
|
||||
sys sys_fork 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Miguel de Icaza
|
||||
*/
|
||||
#ifndef __ASM_INVENTORY_H
|
||||
#define __ASM_INVENTORY_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
typedef struct inventory_s {
|
||||
struct inventory_s *inv_next;
|
||||
int inv_class;
|
||||
int inv_type;
|
||||
int inv_controller;
|
||||
int inv_unit;
|
||||
int inv_state;
|
||||
} inventory_t;
|
||||
|
||||
extern int inventory_items;
|
||||
|
||||
extern void add_to_inventory(int class, int type, int controller, int unit, int state);
|
||||
extern int dump_inventory_to_user(void __user *userbuf, int size);
|
||||
extern int __init init_inventory(void);
|
||||
|
||||
#endif /* __ASM_INVENTORY_H */
|
||||
@@ -1,26 +1,11 @@
|
||||
#ifndef _ASM_NAMEI_H
|
||||
#define _ASM_NAMEI_H
|
||||
|
||||
#include <linux/personality.h>
|
||||
#include <linux/stddef.h>
|
||||
/*
|
||||
* This dummy routine maybe changed to something useful
|
||||
* for /usr/gnemul/ emulation stuff.
|
||||
*/
|
||||
|
||||
#define IRIX_EMUL "/usr/gnemul/irix/"
|
||||
#define RISCOS_EMUL "/usr/gnemul/riscos/"
|
||||
|
||||
static inline char *__emul_prefix(void)
|
||||
{
|
||||
switch (current->personality) {
|
||||
case PER_IRIX32:
|
||||
case PER_IRIXN32:
|
||||
case PER_IRIX64:
|
||||
return IRIX_EMUL;
|
||||
|
||||
case PER_RISCOS:
|
||||
return RISCOS_EMUL;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#define __emul_prefix() NULL
|
||||
|
||||
#endif /* _ASM_NAMEI_H */
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* IRIX prctl interface
|
||||
*
|
||||
* The IRIX kernel maps a page at PRDA_ADDRESS with the
|
||||
* contents of prda and fills it the bits on prda_sys.
|
||||
*/
|
||||
|
||||
#ifndef __PRCTL_H__
|
||||
#define __PRCTL_H__
|
||||
|
||||
#define PRDA_ADDRESS 0x200000L
|
||||
#define PRDA ((struct prda *) PRDA_ADDRESS)
|
||||
|
||||
struct prda_sys {
|
||||
pid_t t_pid;
|
||||
u32 t_hint;
|
||||
u32 t_dlactseq;
|
||||
u32 t_fpflags;
|
||||
u32 t_prid; /* processor type, $prid CP0 register */
|
||||
u32 t_dlendseq;
|
||||
u64 t_unused1[5];
|
||||
pid_t t_rpid;
|
||||
s32 t_resched;
|
||||
u32 t_unused[8];
|
||||
u32 t_cpu; /* current/last cpu */
|
||||
|
||||
/* FIXME: The signal information, not supported by Linux now */
|
||||
u32 t_flags; /* if true, then the sigprocmask is in userspace */
|
||||
u32 t_sigprocmask [1]; /* the sigprocmask */
|
||||
};
|
||||
|
||||
struct prda {
|
||||
char fill [0xe00];
|
||||
struct prda_sys prda_sys;
|
||||
};
|
||||
|
||||
#define t_sys prda_sys
|
||||
|
||||
ptrdiff_t prctl(int op, int v1, int v2);
|
||||
|
||||
#endif
|
||||
@@ -119,9 +119,6 @@ struct sigaction {
|
||||
|
||||
struct k_sigaction {
|
||||
struct sigaction sa;
|
||||
#ifdef CONFIG_BINFMT_IRIX
|
||||
void (*sa_restorer)(void);
|
||||
#endif
|
||||
};
|
||||
|
||||
/* IRIX compatible stack_t */
|
||||
|
||||
Reference in New Issue
Block a user