summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/config.in5
-rw-r--r--arch/mips/defconfig33
-rw-r--r--arch/mips/kernel/ipc.c129
-rw-r--r--arch/mips/kernel/irixelf.c12
-rw-r--r--arch/mips/kernel/mips_ksyms.c3
-rw-r--r--arch/mips/kernel/process.c36
-rw-r--r--arch/mips/kernel/scall_o32.S3
-rw-r--r--arch/mips/kernel/syscalls.h5
-rw-r--r--arch/mips/mm/init.c18
-rw-r--r--arch/mips/mm/umap.c2
10 files changed, 144 insertions, 102 deletions
diff --git a/arch/mips/config.in b/arch/mips/config.in
index 14256b262..c6a6bd704 100644
--- a/arch/mips/config.in
+++ b/arch/mips/config.in
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.35 2000/01/26 00:07:44 ralf Exp $
+# $Id: config.in,v 1.36 2000/01/27 23:45:24 ralf Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
@@ -110,6 +110,9 @@ else
bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN
fi
+if [ "$CONFIG_PROC_FS" = "y" ]; then
+ define_bool CONFIG_KCORE_ELF y
+fi
define_bool CONFIG_ELF_KERNEL y
if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index 3e8d63570..48c4298cb 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -39,6 +39,7 @@ CONFIG_CPU_HAS_LLSC=y
# General setup
#
# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_KCORE_ELF=y
CONFIG_ELF_KERNEL=y
CONFIG_BINFMT_IRIX=y
CONFIG_FORWARD_KEYBOARD=y
@@ -58,16 +59,6 @@ CONFIG_MODULES=y
CONFIG_KMOD=y
#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
# Plug and Play configuration
#
# CONFIG_PNP is not set
@@ -171,10 +162,20 @@ CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SGIWD93=y
#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
# Network device support
#
CONFIG_NETDEVICES=y
-CONFIG_DUMMY=y
+# CONFIG_DUMMY is not set
# CONFIG_SLIP is not set
# CONFIG_PPP is not set
CONFIG_SGISEEQ=y
@@ -201,6 +202,10 @@ CONFIG_PSMOUSE=y
# CONFIG_82C710_MOUSE is not set
# CONFIG_PC110_PAD is not set
# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
@@ -225,6 +230,11 @@ CONFIG_PSMOUSE=y
# CONFIG_DRM is not set
#
+# PCMCIA character device support
+#
+# CONFIG_PCMCIA_SERIAL_CS is not set
+
+#
# USB drivers - not for the faint of heart
#
# CONFIG_USB is not set
@@ -242,6 +252,7 @@ CONFIG_AUTOFS_FS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_UMSDOS_FS is not set
diff --git a/arch/mips/kernel/ipc.c b/arch/mips/kernel/ipc.c
index 8e48497f7..4db570ec8 100644
--- a/arch/mips/kernel/ipc.c
+++ b/arch/mips/kernel/ipc.c
@@ -30,84 +30,69 @@ asmlinkage int sys_ipc (uint call, int first, int second,
version = call >> 16; /* hack for backward compatibility */
call &= 0xffff;
- if (call <= SEMCTL)
- switch (call) {
- case SEMOP:
- return sys_semop (first, (struct sembuf *)ptr, second);
- case SEMGET:
- return sys_semget (first, second, third);
- case SEMCTL: {
- union semun fourth;
+ switch (call) {
+ case SEMOP:
+ return sys_semop (first, (struct sembuf *)ptr, second);
+ case SEMGET:
+ return sys_semget (first, second, third);
+ case SEMCTL: {
+ union semun fourth;
+ if (!ptr)
+ return -EINVAL;
+ if (get_user(fourth.__pad, (void **) ptr))
+ return -EFAULT;
+ return sys_semctl (first, second, third, fourth);
+ }
+
+ case MSGSND:
+ return sys_msgsnd (first, (struct msgbuf *) ptr,
+ second, third);
+ case MSGRCV:
+ switch (version) {
+ case 0: {
+ struct ipc_kludge tmp;
if (!ptr)
return -EINVAL;
- if (get_user(fourth.__pad, (void **) ptr))
+
+ if (copy_from_user(&tmp,
+ (struct ipc_kludge *) ptr,
+ sizeof (tmp)))
return -EFAULT;
- return sys_semctl (first, second, third, fourth);
- }
+ return sys_msgrcv (first, tmp.msgp, second,
+ tmp.msgtyp, third);
+ }
default:
- return -EINVAL;
+ return sys_msgrcv (first,
+ (struct msgbuf *) ptr,
+ second, fifth, third);
}
+ case MSGGET:
+ return sys_msgget ((key_t) first, second);
+ case MSGCTL:
+ return sys_msgctl (first, second, (struct msqid_ds *) ptr);
- if (call <= MSGCTL)
- switch (call) {
- case MSGSND:
- return sys_msgsnd (first, (struct msgbuf *) ptr,
- second, third);
- case MSGRCV:
- switch (version) {
- case 0: {
- struct ipc_kludge tmp;
- if (!ptr)
- return -EINVAL;
-
- if (copy_from_user(&tmp,
- (struct ipc_kludge *) ptr,
- sizeof (tmp)))
- return -EFAULT;
- return sys_msgrcv (first, tmp.msgp, second,
- tmp.msgtyp, third);
- }
- default:
- return sys_msgrcv (first,
- (struct msgbuf *) ptr,
- second, fifth, third);
- }
- case MSGGET:
- return sys_msgget ((key_t) first, second);
- case MSGCTL:
- return sys_msgctl (first, second,
- (struct msqid_ds *) ptr);
- default:
- return -EINVAL;
+ case SHMAT:
+ switch (version) {
+ default: {
+ ulong raddr;
+ ret = sys_shmat (first, (char *) ptr, second, &raddr);
+ if (ret)
+ return ret;
+ return put_user (raddr, (ulong *) third);
}
- if (call <= SHMCTL)
- switch (call) {
- case SHMAT:
- switch (version) {
- default: {
- ulong raddr;
- ret = sys_shmat (first, (char *) ptr,
- second, &raddr);
- if (ret)
- return ret;
- return put_user (raddr, (ulong *) third);
- }
- case 1: /* iBCS2 emulator entry point */
- if (!segment_eq(get_fs(), get_ds()))
- return -EINVAL;
- return sys_shmat (first, (char *) ptr,
- second, (ulong *) third);
- }
- case SHMDT:
- return sys_shmdt ((char *)ptr);
- case SHMGET:
- return sys_shmget (first, second, third);
- case SHMCTL:
- return sys_shmctl (first, second,
- (struct shmid_ds *) ptr);
- default:
- return -EINVAL;
+ case 1: /* iBCS2 emulator entry point */
+ if (!segment_eq(get_fs(), get_ds()))
+ return -EINVAL;
+ return sys_shmat (first, (char *) ptr, second, (ulong *) third);
}
-
- return -EINVAL;
+ case SHMDT:
+ return sys_shmdt ((char *)ptr);
+ case SHMGET:
+ return sys_shmget (first, second, third);
+ case SHMCTL:
+ return sys_shmctl (first, second,
+ (struct shmid_ds *) ptr);
+ default:
+ return -EINVAL;
+ }
}
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 86883ea45..080e08cfb 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -1,4 +1,4 @@
-/* $Id: irixelf.c,v 1.21 1999/09/28 22:25:46 ralf Exp $
+/* $Id: irixelf.c,v 1.22 1999/10/09 00:00:58 ralf Exp $
*
* irixelf.c: Code to load IRIX ELF executables which conform to
* the MIPS ABI.
@@ -404,9 +404,8 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
/* Check sanity of IRIX elf executable header. */
static int verify_binary(struct elfhdr *ehp, struct linux_binprm *bprm)
{
- if (ehp->e_ident[0] != 0x7f || strncmp(&ehp->e_ident[1], "ELF", 3)) {
- return -ENOEXEC;
- }
+ if (memcmp(ehp->e_ident, ELFMAG, SELFMAG) != 0)
+ return -ENOEXEC;
/* First of all, some simple consistency checks */
if((ehp->e_type != ET_EXEC && ehp->e_type != ET_DYN) ||
@@ -495,7 +494,7 @@ out:
static inline int verify_irix_interpreter(struct elfhdr *ihp)
{
- if(ihp->e_ident[0] != 0x7f || strncmp(&ihp->e_ident[1], "ELF", 3))
+ if (memcmp(ihp->e_ident, ELFMAG, SELFMAG) != 0)
return -ELIBBAD;
return 0;
}
@@ -872,8 +871,7 @@ static inline int do_load_irix_library(struct file *file)
if (error != sizeof(elf_ex))
return -ENOEXEC;
- if (elf_ex.e_ident[0] != 0x7f ||
- strncmp(&elf_ex.e_ident[1], "ELF",3) != 0)
+ if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
return -ENOEXEC;
/* First of all, some simple consistency checks. */
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 2b12f0e34..74d7373d4 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -1,4 +1,4 @@
-/* $Id: mips_ksyms.c,v 1.21 1999/10/21 00:23:04 ralf Exp $
+/* $Id: mips_ksyms.c,v 1.22 1999/12/04 03:59:00 ralf Exp $
*
* Export MIPS-specific functions needed for loadable modules.
*
@@ -125,3 +125,4 @@ EXPORT_SYMBOL(unregister_fpe);
EXPORT_SYMBOL(screen_info);
#endif
+EXPORT_SYMBOL(get_wchan);
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index f0c346b61..959e7b339 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.16 1999/10/09 00:00:58 ralf Exp $
+/* $Id: process.c,v 1.17 1999/12/04 03:59:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -186,3 +186,37 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
return retval;
}
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched ((unsigned long) scheduling_functions_start_here)
+#define last_sched ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+ unsigned long schedule_frame;
+ unsigned long pc;
+
+ if (!p || p == current || p->state == TASK_RUNNING)
+ return 0;
+
+ pc = thread_saved_pc(&p->thread);
+ if (pc == (unsigned long) interruptible_sleep_on
+ || pc == (unsigned long) sleep_on) {
+ schedule_frame = ((unsigned long *)p->thread.reg30)[9];
+ return ((unsigned long *)schedule_frame)[15];
+ }
+ if (pc == (unsigned long) interruptible_sleep_on_timeout
+ || pc == (unsigned long) sleep_on_timeout) {
+ schedule_frame = ((unsigned long *)p->thread.reg30)[9];
+ return ((unsigned long *)schedule_frame)[16];
+ }
+ if (pc >= first_sched && pc < last_sched) {
+ printk(KERN_DEBUG "Bug in %s\n", __FUNCTION__);
+ }
+
+ return pc;
+}
diff --git a/arch/mips/kernel/scall_o32.S b/arch/mips/kernel/scall_o32.S
index a6e4d2e90..5d7b42a2a 100644
--- a/arch/mips/kernel/scall_o32.S
+++ b/arch/mips/kernel/scall_o32.S
@@ -1,4 +1,4 @@
-/* $Id: scall_o32.S,v 1.7 1999/07/26 19:42:40 harald Exp $
+/* $Id: scall_o32.S,v 1.8 1999/12/04 03:59:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -189,3 +189,4 @@ illegal_syscall:
li t0, 1 # set error flag
sw t0, PT_R7(sp)
j ret_from_sys_call
+ END(handle_sys)
diff --git a/arch/mips/kernel/syscalls.h b/arch/mips/kernel/syscalls.h
index 688162211..7dd03b640 100644
--- a/arch/mips/kernel/syscalls.h
+++ b/arch/mips/kernel/syscalls.h
@@ -1,4 +1,4 @@
-/* $Id: syscalls.h,v 1.17 1999/09/28 22:25:48 ralf Exp $
+/* $Id: syscalls.h,v 1.18 1999/10/09 00:00:58 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -91,7 +91,7 @@ SYS(sys_sigsuspend, 0)
SYS(sys_sigpending, 1)
SYS(sys_sethostname, 2)
SYS(sys_setrlimit, 2) /* 4075 */
-SYS(sys_getrlimit, 2)
+SYS(sys_old_getrlimit, 2)
SYS(sys_getrusage, 2)
SYS(sys_gettimeofday, 2)
SYS(sys_settimeofday, 2)
@@ -225,3 +225,4 @@ SYS(sys_sigaltstack, 0)
SYS(sys_sendfile, 3)
SYS(sys_ni_syscall, 0)
SYS(sys_ni_syscall, 0)
+SYS(sys_getrlimit, 2) /* 4210 */
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 182024ce8..afd1c6b70 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.22 2000/01/27 23:21:57 ralf Exp $
+/* $Id: init.c,v 1.23 2000/01/27 23:45:25 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -20,6 +20,7 @@
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
+#include <linux/highmem.h>
#include <linux/swap.h>
#include <linux/swapctl.h>
#ifdef CONFIG_BLK_DEV_INITRD
@@ -248,10 +249,17 @@ extern char __init_begin, __init_end;
void __init paging_init(void)
{
+ unsigned int zones_size[2];
+
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2);
return free_area_init(max_low_pfn);
+
+ zones_size[0] = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
+ zones_size[1] = max_low_pfn - zones_size[0];
+
+ free_area_init(zones_size);
}
extern int page_is_ram(unsigned long pagenr);
@@ -279,9 +287,9 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_fdata;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
- printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, "
+ printk("Memory: %uk/%luk available (%ldk kernel code, %ldk reserved, "
"%ldk data, %ldk init)\n",
- (unsigned long) nr_free_pages << (PAGE_SHIFT-10),
+ (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
ram << (PAGE_SHIFT-10),
codesize >> 10,
reservedpages << (PAGE_SHIFT-10),
@@ -314,10 +322,10 @@ void si_meminfo(struct sysinfo *val)
{
val->totalram = totalram_pages;
val->sharedram = 0;
- val->freeram = nr_free_pages;
+ val->freeram = nr_free_pages();
val->bufferram = atomic_read(&buffermem_pages);
val->totalhigh = 0;
- val->freehigh = 0;
+ val->freehigh = nr_free_highpages();
val->mem_unit = PAGE_SIZE;
return;
diff --git a/arch/mips/mm/umap.c b/arch/mips/mm/umap.c
index 73b5d643d..3ca4424eb 100644
--- a/arch/mips/mm/umap.c
+++ b/arch/mips/mm/umap.c
@@ -123,7 +123,7 @@ static inline void free_pte(pte_t page)
current->mm->rss--;
return;
}
- swap_free(page);
+ swap_free(pte_to_swp_entry(page));
}
static inline void forget_pte(pte_t page)