Commit f6d64aee authored by Ralf Bächle's avatar Ralf Bächle Committed by Linus Torvalds

[PATCH] MIPS merge, generic mips bits.

This contains all the generic 32-bit MIPS code, so all arch/mips/ and
include/asm-mips/ stuff.
parent 2e7f53ec
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
The code for the Algorithmics P4032 evaluation board is currently under
development. I'll release it when it's up to the same strength as
the other ports.
Ralf
......@@ -3,11 +3,9 @@
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995, 1998, 2001 by Ralf Baechle
# Copyright (C) 1995, 1998, 2001, 2002 by Ralf Baechle
#
OBJS = milo.o a.out.o
#
# Some DECstations need all possible sections of an ECOFF executable
#
......@@ -21,25 +19,33 @@ endif
# Drop some uninteresting sections in the kernel.
# This is only relevant for ELF kernels but doesn't hurt a.out
#
drop-sections = .reginfo .mdebug
drop-sections = .reginfo .mdebug .comment .note
strip-flags = $(addprefix --remove-section=,$(drop-sections))
all: vmlinux.ecoff addinitrd
vmlinux.ecoff: elf2ecoff $(TOPDIR)/vmlinux
./elf2ecoff $(TOPDIR)/vmlinux vmlinux.ecoff $(E2EFLAGS)
vmlinux.rm200: vmlinux
$(OBJCOPY) \
--change-addresses=0xfffffffc \
-O elf32-tradlittlemips \
$(strip-flags) \
$< $@
vmlinux.ecoff: $(obj)/elf2ecoff vmlinux
./elf2ecoff vmlinux $(obj)/vmlinux.ecoff $(E2EFLAGS)
elf2ecoff: elf2ecoff.c
$(obj)/elf2ecoff: $(obj)/elf2ecoff.c
$(HOSTCC) -o $@ $^
addinitrd: addinitrd.c
$(obj)/addinitrd: $(obj)/addinitrd.c
$(HOSTCC) -o $@ $^
clean:
rm -f vmlinux.ecoff
rm -f zImage zImage.tmp
archhelp:
@echo '* vmlinux.rm200 - Bootable kernel image for RM200C'
mrproper:
rm -f vmlinux.ecoff
rm -f addinitrd
rm -f elf2ecoff
CLEAN_FILES += addinitrd \
elf2ecoff \
vmlinux.ecoff \
vmlinux.rm200 \
zImage.tmp \
zImage
......@@ -8,6 +8,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <netinet/in.h>
#include "ecoff.h"
......@@ -44,7 +46,7 @@ int main (int argc, char *argv[])
char buf[1024];
unsigned long loadaddr;
unsigned long initrd_header[2];
int i;
int i,cnt;
int swab = 0;
if (argc != 4) {
......@@ -60,7 +62,6 @@ int main (int argc, char *argv[])
die ("read aout header");
if (read (fd_vmlinux, esecs, sizeof esecs) != sizeof esecs)
die ("read section headers");
/*
* check whether the file is good for us
*/
......@@ -81,7 +82,7 @@ int main (int argc, char *argv[])
die ("open initrd");
if (fstat (fd_initrd, &st) < 0)
die ("fstat initrd");
loadaddr = ((SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size)
loadaddr = ((SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size)
+ MIPS_PAGE_SIZE-1) & ~MIPS_PAGE_MASK) - 8;
if (loadaddr < (SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size)))
loadaddr += MIPS_PAGE_SIZE;
......@@ -98,9 +99,20 @@ int main (int argc, char *argv[])
die ("write aout header");
if (write (fd_outfile, esecs, sizeof esecs) != sizeof esecs)
die ("write section headers");
while ((i = read (fd_vmlinux, buf, sizeof buf)) > 0)
/* skip padding */
if(lseek(fd_vmlinux, SWAB(esecs[0].s_scnptr), SEEK_SET) == (off_t)-1)
die ("lseek vmlinux");
if(lseek(fd_outfile, SWAB(esecs[0].s_scnptr), SEEK_SET) == (off_t)-1)
die ("lseek outfile");
/* copy text segment */
cnt = SWAB(eaout.tsize);
while (cnt) {
if ((i = read (fd_vmlinux, buf, sizeof buf)) <= 0)
die ("read vmlinux");
if (write (fd_outfile, buf, i) != i)
die ("write vmlinux");
cnt -= i;
}
if (write (fd_outfile, initrd_header, sizeof initrd_header) != sizeof initrd_header)
die ("write initrd header");
while ((i = read (fd_initrd, buf, sizeof buf)) > 0)
......
This diff is collapsed.
......@@ -2,45 +2,45 @@
# Makefile for the Linux/MIPS kernel.
#
# EXTRA_AFLAGS = -mips3 -mcpu=r4000 # not used?
extra-y := head.o init_task.o
obj-y += branch.o cpu-probe.o process.o signal.o entry.o traps.o \
ptrace.o irq.o reset.o semaphore.o setup.o syscall.o \
sysmips.o ipc.o scall_o32.o time.o unaligned.o
extra-y := head.o init_task.o
obj-y += branch.o process.o signal.o entry.o \
traps.o ptrace.o vm86.o ioport.o reset.o \
semaphore.o setup.o syscall.o sysmips.o \
ipc.o scall_o32.o unaligned.o
obj-$(CONFIG_MODULES) += mips_ksyms.o
ifdef CONFIG_CPU_R3000
obj-y += r2300_misc.o r2300_fpu.o r2300_switch.o
else
obj-y += r4k_misc.o r4k_switch.o
ifdef CONFIG_CPU_R6000
obj-y += r6000_fpu.o
else
obj-y += r4k_fpu.o
endif
endif
obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o
obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o
obj-$(CONFIG_CPU_TX49XX) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R4000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_VR41XX) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R4300) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R4X00) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R5000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R5432) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_RM7000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_NEVADA) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R10000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_SB1) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_MIPS32) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_MIPS64) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o
obj-$(CONFIG_SMP) += smp.o
# Old style irq support, going to die in 2.5.
obj-$(CONFIG_NEW_IRQ) += irq.o
obj-$(CONFIG_ROTTEN_IRQ) += old-irq.o
obj-$(CONFIG_I8259) += i8259.o
# transition from old time.c to new time.c
# some boards uses old-time.c, some use time.c, and some use their own ones
obj-$(CONFIG_OLD_TIME_C) += old-time.o
obj-$(CONFIG_NEW_TIME_C) += time.o
obj-$(CONFIG_IRQ_CPU) += irq_cpu.o
obj-$(CONFIG_BINFMT_IRIX) += irixelf.o irixioctl.o irixsig.o sysirix.o \
irixinv.o
obj-$(CONFIG_REMOTE_DEBUG) += gdb-low.o gdb-stub.o
obj-$(CONFIG_PCI) += pci-dma.o
obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o
obj-$(CONFIG_PROC_FS) += proc.o
ifdef CONFIG_PCI
obj-$(CONFIG_NEW_PCI) += pci.o
obj-$(CONFIG_PCI_AUTO) += pci_auto.o
ifndef CONFIG_MAPPED_PCI_IO
obj-y += pci-dma.o
endif
obj-$(CONFIG_MODULES) += module.o
EXTRA_AFLAGS := $(CFLAGS)
......@@ -16,7 +16,6 @@
#include <asm/inst.h>
#include <asm/ptrace.h>
#include <asm/uaccess.h>
#include <asm/bootinfo.h>
#include <asm/processor.h>
/*
......@@ -164,10 +163,10 @@ int __compute_return_epc(struct pt_regs *regs)
* And now the FPA/cp1 branch instructions.
*/
case cop1_op:
if(!(mips_cpu.options & MIPS_CPU_FPU))
if (!cpu_has_fpu)
fcr31 = current->thread.fpu.soft.sr;
else
asm ("cfc1\t%0,$31":"=r" (fcr31));
asm volatile("cfc1\t%0,$31" : "=r" (fcr31));
bit = (insn.i_format.rt >> 2);
bit += (bit != 0);
bit += 23;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/init_task.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
/*
* Initial task structure.
* Initial thread structure.
*
* We need to make sure that this is 8192-byte aligned due to the
* way process stacks are handled. This is done by making sure
......@@ -20,6 +22,13 @@ struct mm_struct init_mm = INIT_MM(init_mm);
*
* The things we do for performance..
*/
union task_union init_task_union
__attribute__((__section__(".text"))) =
{ INIT_TASK(init_task_union.task) };
union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
* Initial task structure.
*
* All other task structs will be allocated on slabs in fork.c
*/
struct task_struct init_task = INIT_TASK(init_task);
/*
* linux/arch/mips/kernel/ioport.c
*/
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
/*
* This changes the io permissions bitmap in the current task.
*/
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{
return -ENOSYS;
}
/*
* sys_iopl has to be used when you want to access the IO ports
* beyond the 0x3ff range: to get the full 65536 ports bitmapped
* you'd need 8kB of bitmaps/process, which is a bit excessive.
*
* Here we just change the eflags value on the stack: we allow
* only the super-user to do it. This depends on the stack-layout
* on system-call entry - see also fork() and the signal handling
* code.
*/
asmlinkage int sys_iopl(long ebx,long ecx,long edx,
long esi, long edi, long ebp, long eax, long ds,
long es, long fs, long gs, long orig_eax,
long eip,long cs,long eflags,long esp,long ss)
{
return -ENOSYS;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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