Commit ed63dd2d authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.45

parent 9b77dcf1
......@@ -231,12 +231,13 @@ D: NET-2-HOWTO author.
D: RADIOLINUX Amateur Radio software for Linux list collator.
N: Todd J. Derr
E: tjd@cs.pitt.edu
E: tjd@fore.com
D: x86 VESA console blanking enhancements
D: maintainer of dual-monitor patches for 1.0+
D: MouseMan driver for selection
S: Department of Computer Science
S: University of Pittsburgh
S: Pittsburgh, Pennsylvania 15260
S: Fore Systems, Inc.
S: 5800 Corporate Drive
S: Pittsburgh, Pennsylvania 15237-5829
S: USA
N: Thomas Dunbar
......@@ -506,6 +507,13 @@ S: Schlehenweg 9
S: D-91080 Uttenreuth
S: Germany
N: Gero Kuhlmann
E: gero@gkminix.han.de
D: mounting root via NFS
S: Donarweg 4
S: D-30657 Hannover
S: Germany
N: Bas Laarhoven
E: bas@vimec.nl
D: Loadable modules and ftape driver
......
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 44
SUBLEVEL = 45
ARCH = i386
......
#
# ppc/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# 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
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Changes for PPC by Gary Thomas
#
# PowerPC (cross) tools
AS = as.ppc
ASFLAGS =
LD = ld.ppc
#LINKFLAGS = -T arch/ppc/ld.script -Ttext 0x90000000 -Map vmlinux.map
LINKFLAGS = -T arch/ppc/ld.script -Ttext 0x90000000
HOSTCC = gcc
CC = gcc.ppc
CFLAGS = -D__KERNEL__ -I$(TOPDIR)/include \
-Wstrict-prototypes \
-fomit-frame-pointer \
-fno-builtin \
-finhibit-size-directive \
-O2 -pipe
#-Wall
CPP = $(CC) -E $(CFLAGS)
AR = ar.ppc
RANLIB = ranlib.ppc
STRIP = strip.ppc
NM = nm.ppc
#
# Set these to indicate how to link it..
#
# -zmagic:
#
# ZLINKFLAGS = -Ttext 0x1000
# LINKFLAGS = -Ttext 0x100000
#
# -qmagic (we need to remove the 32 byte header for bootup purposes)
#
## ZLINKFLAGS =-qmagic -Ttext 0xfe0
## LINKFLAGS =-qmagic -Ttext 0xfffe0
## CFLAGS := $(CFLAGS) -pipe
## ifdef CONFIG_M486
## CFLAGS := $(CFLAGS) -m486
## else
## ifdef CONFIG_M586
## CFLAGS := $(CFLAGS) -mpentium
## else
## CFLAGS := $(CFLAGS) -m386
## endif
## endif
HEAD := arch/ppc/kernel/head.o
ARCH_SUBDIRS = arch/ppc/kernel arch/ppc/mm
SUBDIRS := $(SUBDIRS) $(ARCH_SUBDIRS)
ARCHIVES := arch/ppc/kernel/kernel.o arch/ppc/mm/mm.o $(ARCHIVES)
## ifdef CONFIG_IBCS
## SUBDIRS := $(SUBDIRS) arch/ppc/ibcs
## DRIVERS := $(DRIVERS) arch/ppc/ibcs/ibcs.o
## endif
## ifdef CONFIG_MATH_EMULATION
## SUBDIRS := $(SUBDIRS) arch/ppc/math-emu
## DRIVERS := $(DRIVERS) arch/ppc/math-emu/math.a
## endif
arch/ppc/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/ppc/kernel
arch/ppc/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/ppc/mm
## MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
##
## zImage: vmlinux
## @$(MAKEBOOT) zImage
##
## compressed: zImage
##
## zlilo: vmlinux
## @$(MAKEBOOT) zlilo
##
## zdisk: vmlinux
## @$(MAKEBOOT) zdisk
##
## install: vmlinux
## @$(MAKEBOOT) install
archclean:
# @$(MAKEBOOT) clean
archdep:
# @$(MAKEBOOT) dep
#
# arch/ppc/boot/Makefile
#
# 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
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Adapted for PowerPC by Gary Thomas
#
.c.s:
$(CC) $(CFLAGS) -S -o $*.s $<
.s.o:
$(AS) -o $*.o $<
.c.o:
$(CC) $(CFLAGS) -c -o $*.o $<
.S.s:
$(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $<
.S.o:
$(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
OBJECTS = head.o main.o
all: linux.boot
linux.boot: $(TOPDIR)/vmlinux
mkboot $(TOPDIR)/vmlinux $@ 0
clean:
rm -f linux.boot
dep:
This diff is collapsed.
#
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
.c.s:
$(CC) $(CFLAGS) -S $<
.s.o:
$(AS) $(ASFLAGS) -o $*.o $<
.c.o:
$(CC) $(CFLAGS) -c $<
.S.s:
# $(CPP) $(CFLAGS) -D__ASSEMBLY__ -traditional $< -o $*.s
$(CPP) $(CFLAGS) -D__ASSEMBLY__ $< -o $*.s
.S.o:
# $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
$(CPP) $(CFLAGS) -D__ASSEMBLY__ $< -o $*.s
$(AS) $(ASFLAGS) -o $*.o $*.s
HOST_CC = gcc
OBJS = misc.o setup.o port_io.o irq.o pci.o traps.o stubs.o process.o \
signal.o raw_printf.o ramdisk.o
all: head.o kernel.o cortstrip mkboot
head.o: head.s
head.s: head.S $(TOPDIR)/include/linux/tasks.h ppc_defs.h
ppc_defs.h: mk_defs $(TOPDIR)/include/asm/mmu.h $(TOPDIR)/include/asm/processor.h $(TOPDIR)/include/asm/pgtable.h $(TOPDIR)/include/asm/ptrace.h
# simppc mk_defs -- $@
mk_defs ppc_defs.h
ramdisk.o: ramdisk.s
ramdisk.s: ramdisk.image mk_ramdisk
mk_ramdisk ramdisk.image ramdisk.s
mk_ramdisk: mk_ramdisk.c
$(HOST_CC) -o mk_ramdisk mk_ramdisk.c
cortstrip : cortstrip.c
${HOST_CC} -o cortstrip cortstrip.c
mkboot : mkboot.c
${HOST_CC} -o mkboot mkboot.c
mk_defs: mk_defs.c $(TOPDIR)/include/asm/mmu.h $(TOPDIR)/include/asm/processor.h $(TOPDIR)/include/asm/pgtable.h $(TOPDIR)/include/asm/ptrace.h
# $(CC) ${CFLAGS} -c mk_defs -T ld.script-user -Ttext 0x1000 mk_defs.c
# $(LD) -T ld.script-user -Ttext 0x1000 -o mk_defs mk_defs.o
$(HOST_CC) -DMKDEFS ${CFLAGS} -o mk_defs mk_defs.c
kernel.o: $(OBJS)
$(LD) -r -o kernel.o $(OBJS)
sync
dep:
$(CPP) -M *.c > .depend
fastdep:
$(CPP) -M *.c > .depend
modules:
dummy:
#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
/* amount to skip */
/*#define PLACE 0x10000*/
/* size of read buffer */
#define SIZE 0x10000
void main(int argc, char **argv )
{
int fd, fdo;
unsigned char data[SIZE];
int i, n, skip;
if ( argc != 4 )
{
fprintf(stderr,"%s infile outfile skip\n", argv[0]);
exit(-1);
}
fd = open(argv[1], O_RDONLY);
if ( fd == -1 )
{
fprintf(stderr,"Couldn't open %s\n", argv[1]);
perror("open()");
exit(-1);
}
fdo = open(argv[2], O_WRONLY|O_CREAT, 755);
if ( fdo == -1 )
{
fprintf(stderr,"Couldn't open %s\n", argv[2]);
perror("open()");
exit(-1);
}
skip = atoi(argv[3]);
i = lseek(fd, skip, SEEK_SET);
printf("lseek'd %d bytes\n", i);
if ( i == -1 )
{
perror("lseek()");
}
while ( (n = read(fd, data, SIZE)) > 0 )
{
printf("Read %d bytes\n", n);
i = write(fdo, data, n);
printf("Wrote %d bytes\n", i);
}
close(fdo);
close(fd);
return(0);
}
This diff is collapsed.
/*
* linux/arch/ppc/kernel/irq.c
*
* Copyright (C) 1992 Linus Torvalds
* Adapted from arch/i386 by Gary Thomas
*
* This file contains the code used by various IRQ handling routines:
* asking for different IRQ's should be done through these routines
* instead of just grabbing them. Thus setups with different IRQ numbers
* shouldn't result in any weird surprises, and installing new handlers
* should be easier.
*/
/*
* IRQ's are in fact implemented a bit like signal handlers for the kernel.
* Naturally it's not a 1:1 relation, but there are similarities.
*/
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/bitops.h>
#define CR0_NE 32
static unsigned char cache_21 = 0xff;
static unsigned char cache_A1 = 0xff;
void disable_irq(unsigned int irq_nr)
{
unsigned char mask;
int s = _disable_interrupts();
mask = 1 << (irq_nr & 7);
if (irq_nr < 8) {
cache_21 |= mask;
outb(cache_21,0x21);
_enable_interrupts(s);
return;
}
cache_A1 |= mask;
outb(cache_A1,0xA1);
_enable_interrupts(s);
}
void enable_irq(unsigned int irq_nr)
{
unsigned char mask;
int s = _disable_interrupts();
mask = ~(1 << (irq_nr & 7));
if (irq_nr < 8) {
cache_21 &= mask;
outb(cache_21,0x21);
_enable_interrupts(s);
return;
}
cache_A1 &= mask;
outb(cache_A1,0xA1);
_enable_interrupts(s);
}
/*
* Irq handlers.
*/
struct irqaction {
void (*handler)(int, struct pt_regs *);
unsigned long flags;
unsigned long mask;
const char *name;
int notified;
};
static struct irqaction irq_action[16] = {
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL }
};
int get_irq_list(char *buf)
{
int i, len = 0;
struct irqaction * action = irq_action;
for (i = 0 ; i < 16 ; i++, action++) {
if (!action->handler)
continue;
len += sprintf(buf+len, "%2d: %8d %c %s\n",
i, kstat.interrupts[i],
(action->flags & SA_INTERRUPT) ? '+' : ' ',
action->name);
}
return len;
}
asmlinkage void handle_IRQ(struct pt_regs *regs)
{
int irq, s;
struct irqaction *action;
intr_count++;
/* Figure out IRQ#, etc. */
outb(0x0C, 0x20); /* Poll interrupt controller */
irq = inb(0x20);
irq &= 0x07; /* Caution! */
if (irq == 2)
{ /* Cascaded interrupt -> IRQ8..IRQ15 */
outb(0x0C, 0xA0);
irq = inb(0xA0) & 0x07;
irq += 8;
}
/* Mask interrupt & Issue EOI to interrupt controller */
if (irq > 7)
{
outb(cache_A1 | (1<<(irq-7)), 0xA1);
outb(0x20, 0xA0);
/* Need to ack cascade controller as well */
outb(0x20, 0x20);
} else
{
outb(cache_21 | (1<<irq), 0x21);
outb(0x20, 0x20);
}
action = irq + irq_action;
kstat.interrupts[irq]++;
if (action->handler)
{
action->handler(irq, regs);
} else
{
_printk("Bogus interrupt #%d\n", irq);
}
if (_disable_interrupts() && !action->notified)
{
action->notified = 1;
printk("*** WARNING! %s handler [IRQ %d] turned interrupts on!\n", action->name, irq);
}
/* Re-enable interrupt */
if (irq > 7)
{
outb(cache_A1, 0xA1);
} else
{
outb(cache_21, 0x21);
}
intr_count--;
}
/*
* This routine gets called when the SCSI times out on an operation.
* I don't know why this happens, but every so often it does and it
* seems to be a problem with the interrupt controller [state]. It
* happens a lot when there is also network activity (both devices
* are on the PCI bus with interrupts on the cascaded controller).
* Re-initializing the interrupt controller [which might lose some
* pending edge detected interrupts] seems to fix it.
*/
void check_irq(void )
{
int s = _disable_interrupts();
unsigned char _a0, _a1, _20, _21;
_a1 = inb(0xA1);
_21 = inb(0x21);
outb(0x0C, 0x20); _20 = inb(0x20);
outb(0x0C, 0xA0); _a0 = inb(0xA0);
#if 0
printk("IRQ 0x20 = %x, 0x21 = %x/%x, 0xA0 = %x, 0xA1 = %x/%x\n",
_20, _21, cache_21, _a0, _a1, cache_A1);
#endif
/* Reset interrupt controller - see if this fixes it! */
/* Initialize interrupt controllers */
outb(0x11, 0x20); /* Start init sequence */
outb(0x40, 0x21); /* Vector base */
outb(0x04, 0x21); /* Cascade (slave) on IRQ2 */
outb(0x01, 0x21); /* Select 8086 mode */
outb(0xFF, 0x21); /* Mask all */
outb(0x00, 0x4D0); /* All edge triggered */
outb(0x11, 0xA0); /* Start init sequence */
outb(0x48, 0xA1); /* Vector base */
outb(0x02, 0xA1); /* Cascade (slave) on IRQ2 */
outb(0x01, 0xA1); /* Select 8086 mode */
outb(0xFF, 0xA1); /* Mask all */
outb(0xCF, 0x4D1); /* Trigger mode */
outb(cache_A1, 0xA1);
outb(cache_21, 0x21);
enable_irq(2); /* Enable cascade interrupt */
_enable_interrupts(s);
}
#define SA_PROBE SA_ONESHOT
int request_irq(unsigned int irq, void (*handler)(int, struct pt_regs *),
unsigned long irqflags, const char * devname)
{
struct irqaction * action;
unsigned long flags;
#if 0
_printk("Request IRQ #%d, Handler: %x\n", irq, handler);
cnpause();
#endif
if (irq > 15)
return -EINVAL;
action = irq + irq_action;
if (action->handler)
return -EBUSY;
if (!handler)
return -EINVAL;
save_flags(flags);
cli();
action->handler = handler;
action->flags = irqflags;
action->mask = 0;
action->name = devname;
#if 0
if (!(action->flags & SA_PROBE)) { /* SA_ONESHOT is used by probing */
if (action->flags & SA_INTERRUPT)
set_intr_gate(0x20+irq,fast_interrupt[irq]);
else
set_intr_gate(0x20+irq,interrupt[irq]);
}
#endif
if (irq < 8) {
cache_21 &= ~(1<<irq);
outb(cache_21,0x21);
} else {
cache_21 &= ~(1<<2);
cache_A1 &= ~(1<<(irq-8));
outb(cache_21,0x21);
outb(cache_A1,0xA1);
}
restore_flags(flags);
return 0;
}
void free_irq(unsigned int irq)
{
struct irqaction * action = irq + irq_action;
unsigned long flags;
if (irq > 15) {
printk("Trying to free IRQ%d\n",irq);
return;
}
if (!action->handler) {
printk("Trying to free free IRQ%d\n",irq);
return;
}
save_flags(flags);
cli();
if (irq < 8) {
cache_21 |= 1 << irq;
outb(cache_21,0x21);
} else {
cache_A1 |= 1 << (irq-8);
outb(cache_A1,0xA1);
}
#if 0
set_intr_gate(0x20+irq,bad_interrupt[irq]);
#endif
action->handler = NULL;
action->flags = 0;
action->mask = 0;
action->name = NULL;
restore_flags(flags);
}
static void no_action(int cpl, struct pt_regs * regs) { }
unsigned /*int*/ long probe_irq_on (void)
{
unsigned int i, irqs = 0, irqmask;
unsigned long delay;
/* first, snaffle up any unassigned irqs */
for (i = 15; i > 0; i--) {
if (!request_irq(i, no_action, SA_PROBE, "probe")) {
enable_irq(i);
irqs |= (1 << i);
}
}
/* wait for spurious interrupts to mask themselves out again */
for (delay = jiffies + 2; delay > jiffies; ); /* min 10ms delay */
/* now filter out any obviously spurious interrupts */
irqmask = (((unsigned int)cache_A1)<<8) | (unsigned int)cache_21;
for (i = 15; i > 0; i--) {
if (irqs & (1 << i) & irqmask) {
irqs ^= (1 << i);
free_irq(i);
}
}
#ifdef DEBUG
printk("probe_irq_on: irqs=0x%04x irqmask=0x%04x\n", irqs, irqmask);
#endif
return irqs;
}
int probe_irq_off (unsigned /*int*/ long irqs)
{
unsigned int i, irqmask;
irqmask = (((unsigned int)cache_A1)<<8) | (unsigned int)cache_21;
for (i = 15; i > 0; i--) {
if (irqs & (1 << i)) {
free_irq(i);
}
}
#ifdef DEBUG
printk("probe_irq_off: irqs=0x%04x irqmask=0x%04x\n", irqs, irqmask);
#endif
irqs &= irqmask;
if (!irqs)
return 0;
i = ffz(~irqs);
if (irqs != (irqs & (1 << i)))
i = -i;
return i;
}
void init_IRQ(void)
{
unsigned long *vme2_ie = (unsigned long *)0xFEFF006C;
unsigned long *vme2_ic = (unsigned long *)0xFEFF0074;
unsigned long *vme2_il2 = (unsigned long *)0xFEFF007C;
unsigned long *vme2_ioc = (unsigned long *)0xFEFF0088;
unsigned char *vme2pci_ic = (unsigned char *)0x80802050;
unsigned char *ibc_pirq = (unsigned char *)0x80800860;
unsigned char *ibc_pcicon = (unsigned char *)0x80800840;
int i;
/* set the clock to 100 Hz */
outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
outb_p(LATCH & 0xff , 0x40); /* LSB */
outb(LATCH >> 8 , 0x40); /* MSB */
if (request_irq(2, no_action, SA_INTERRUPT, "cascade"))
printk("Unable to get IRQ2 for cascade\n");
request_region(0x20,0x20,"pic1");
request_region(0xa0,0x20,"pic2");
#if 0
/* Enable SIG0 */
*vme2_ie = (*vme2_ie & 0xFFFBFFFF) | 0x00040000;
/* Clear any pending interrupts */
*vme2_ic = 0xFFFFFFFF;
/* SIG0 -> Level 5 */
*vme2_il2 = (*vme2_il2 & 0xFFFFF0FF) | 0x00000500;
/* Master interrupt enable */
*vme2_ioc |= 0x00800000;
#endif
/* Enable interrupts from VMECHIP */
*vme2pci_ic |= 0x08;
/* Route PCI interrupts */
ibc_pirq[0] = 0x0A; /* PIRQ0 -> ISA10 */
ibc_pirq[1] = 0x0B; /* PIRQ1 -> ISA11 */
ibc_pirq[2] = 0x0E; /* PIRQ2 -> ISA14 */
ibc_pirq[3] = 0x0F; /* PIRQ3 -> ISA15 */
/* Enable PCI interrupts */
*ibc_pcicon |= 0x20;
}
PCI_irq(int irq)
{
static short _irq[] = {10, 11, 14, 15};
int res = _irq[(irq-1)&0x03];
#if 0
_printk("PCI IRQ #%d = %d\n", irq, res);
#endif
return (res);
}
OUTPUT_ARCH(powerpc)
SEARCH_DIR(/usr/local/lib/gcc-lib/powerpc-linux-elf/2.7.0/);
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
{
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.rel.text : { *(.rel.text) }
.rela.text : { *(.rela.text) }
.rel.data : { *(.rel.data) }
.rela.data : { *(.rela.data) }
.rel.rodata : { *(.rel.rodata) }
.rela.rodata : { *(.rela.rodata) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { *(.init) } =0
.plt : { *(.plt) }
.text :
{
*(.text)
}
_etext = .;
PROVIDE (etext = .);
.fini : { *(.fini) } =0
.ctors : { *(.ctors) }
.dtors : { *(.dtors) }
.rodata : { *(.rodata) }
.rodata1 : { *(.rodata1) }
/* Read-write section, merged into data segment: */
/* . = (. + 0x0FFF) & 0xFFFFF000; */
.data :
{
*(.data)
CONSTRUCTORS
}
.data1 : { *(.data1) }
.got : { *(.got.plt) *(.got) }
.dynamic : { *(.dynamic) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.sbss : { *(.sbss) *(.scommon) }
.bss :
{
*(.dynbss)
*(.bss)
*(COMMON)
}
_end = . ;
PROVIDE (end = .);
/* These are needed for ELF backends which have not yet been
converted to the new style linker. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
/* These must appear regardless of . */
}
This diff is collapsed.
/*
* This program is used to generate definitions needed by
* assembly language modules.
*/
#include <stdio.h>
#include <linux/config.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/head.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <asm/pgtable.h>
extern int errno;
main(int argc, char *argv[])
{
FILE *out;
struct task_struct task;
struct thread_struct tss;
struct pt_regs regs;
if (!(out = fopen(argv[1], "w")))
{
fprintf(stderr, "Can't create output file: %d\n", errno);
exit(1);
}
fprintf(out, "/*\n");
fprintf(out, " * WARNING! This file is automatically generated - DO NOT EDIT!\n");
fprintf(out, " */\n");
put_line(out, "STATE", (int)&task.state-(int)&task);
put_line(out, "COUNTER", (int)&task.counter-(int)&task);
put_line(out, "BLOCKED", (int)&task.blocked-(int)&task);
put_line(out, "SIGNAL", (int)&task.signal-(int)&task);
put_line(out, "KERNEL_STACK_PAGE", (int)&task.kernel_stack_page-(int)&task);
put_line(out, "TSS", (int)&task.tss-(int)&task);
put_line(out, "KSP", (int)&tss.ksp-(int)&tss);
put_line(out, "LAST_PC", (int)&tss.last_pc-(int)&tss);
put_line(out, "MMU_SEG0", (int)&tss.segs[0]-(int)&tss);
put_line(out, "MMU_SEG1", (int)&tss.segs[1]-(int)&tss);
put_line(out, "MMU_SEG2", (int)&tss.segs[2]-(int)&tss);
put_line(out, "MMU_SEG3", (int)&tss.segs[3]-(int)&tss);
put_line(out, "MMU_SEG4", (int)&tss.segs[4]-(int)&tss);
put_line(out, "MMU_SEG5", (int)&tss.segs[5]-(int)&tss);
put_line(out, "MMU_SEG6", (int)&tss.segs[6]-(int)&tss);
put_line(out, "MMU_SEG7", (int)&tss.segs[7]-(int)&tss);
put_line(out, "MMU_SEG8", (int)&tss.segs[8]-(int)&tss);
put_line(out, "MMU_SEG9", (int)&tss.segs[9]-(int)&tss);
put_line(out, "MMU_SEG10", (int)&tss.segs[10]-(int)&tss);
put_line(out, "MMU_SEG11", (int)&tss.segs[11]-(int)&tss);
put_line(out, "MMU_SEG12", (int)&tss.segs[12]-(int)&tss);
put_line(out, "MMU_SEG13", (int)&tss.segs[13]-(int)&tss);
put_line(out, "MMU_SEG14", (int)&tss.segs[14]-(int)&tss);
put_line(out, "MMU_SEG15", (int)&tss.segs[15]-(int)&tss);
put_line(out, "TSS_FPR0", (int)&tss.fpr[0]-(int)&tss);
put_line(out, "TSS_FPR1", (int)&tss.fpr[1]-(int)&tss);
put_line(out, "TSS_FPR2", (int)&tss.fpr[2]-(int)&tss);
put_line(out, "TSS_FPR3", (int)&tss.fpr[3]-(int)&tss);
put_line(out, "TSS_FPR4", (int)&tss.fpr[4]-(int)&tss);
put_line(out, "TSS_FPR5", (int)&tss.fpr[5]-(int)&tss);
put_line(out, "TSS_FPR6", (int)&tss.fpr[6]-(int)&tss);
put_line(out, "TSS_FPR7", (int)&tss.fpr[7]-(int)&tss);
put_line(out, "TSS_FPR8", (int)&tss.fpr[8]-(int)&tss);
put_line(out, "TSS_FPR9", (int)&tss.fpr[9]-(int)&tss);
put_line(out, "TSS_FPR10", (int)&tss.fpr[10]-(int)&tss);
put_line(out, "TSS_FPR11", (int)&tss.fpr[11]-(int)&tss);
put_line(out, "TSS_FPR12", (int)&tss.fpr[12]-(int)&tss);
put_line(out, "TSS_FPR13", (int)&tss.fpr[13]-(int)&tss);
put_line(out, "TSS_FPR14", (int)&tss.fpr[14]-(int)&tss);
put_line(out, "TSS_FPR15", (int)&tss.fpr[15]-(int)&tss);
put_line(out, "TSS_FPR16", (int)&tss.fpr[16]-(int)&tss);
put_line(out, "TSS_FPR17", (int)&tss.fpr[17]-(int)&tss);
put_line(out, "TSS_FPR18", (int)&tss.fpr[18]-(int)&tss);
put_line(out, "TSS_FPR19", (int)&tss.fpr[19]-(int)&tss);
put_line(out, "TSS_FPR20", (int)&tss.fpr[20]-(int)&tss);
put_line(out, "TSS_FPR21", (int)&tss.fpr[21]-(int)&tss);
put_line(out, "TSS_FPR22", (int)&tss.fpr[22]-(int)&tss);
put_line(out, "TSS_FPR23", (int)&tss.fpr[23]-(int)&tss);
put_line(out, "TSS_FPR24", (int)&tss.fpr[24]-(int)&tss);
put_line(out, "TSS_FPR25", (int)&tss.fpr[25]-(int)&tss);
put_line(out, "TSS_FPR26", (int)&tss.fpr[26]-(int)&tss);
put_line(out, "TSS_FPR27", (int)&tss.fpr[27]-(int)&tss);
put_line(out, "TSS_FPR28", (int)&tss.fpr[28]-(int)&tss);
put_line(out, "TSS_FPR29", (int)&tss.fpr[29]-(int)&tss);
put_line(out, "TSS_FPR30", (int)&tss.fpr[30]-(int)&tss);
put_line(out, "TSS_FPR31", (int)&tss.fpr[31]-(int)&tss);
/* Interrupt register frame */
put_line(out, "INT_FRAME_SIZE", sizeof(regs));
put_line(out, "GPR0", (int)&regs.gpr[0]-(int)&regs);
put_line(out, "GPR1", (int)&regs.gpr[1]-(int)&regs);
put_line(out, "GPR2", (int)&regs.gpr[2]-(int)&regs);
put_line(out, "GPR3", (int)&regs.gpr[3]-(int)&regs);
put_line(out, "GPR4", (int)&regs.gpr[4]-(int)&regs);
put_line(out, "GPR5", (int)&regs.gpr[5]-(int)&regs);
put_line(out, "GPR6", (int)&regs.gpr[6]-(int)&regs);
put_line(out, "GPR7", (int)&regs.gpr[7]-(int)&regs);
put_line(out, "GPR8", (int)&regs.gpr[8]-(int)&regs);
put_line(out, "GPR9", (int)&regs.gpr[9]-(int)&regs);
put_line(out, "GPR10", (int)&regs.gpr[10]-(int)&regs);
put_line(out, "GPR11", (int)&regs.gpr[11]-(int)&regs);
put_line(out, "GPR12", (int)&regs.gpr[12]-(int)&regs);
put_line(out, "GPR13", (int)&regs.gpr[13]-(int)&regs);
put_line(out, "GPR14", (int)&regs.gpr[14]-(int)&regs);
put_line(out, "GPR15", (int)&regs.gpr[15]-(int)&regs);
put_line(out, "GPR16", (int)&regs.gpr[16]-(int)&regs);
put_line(out, "GPR17", (int)&regs.gpr[17]-(int)&regs);
put_line(out, "GPR18", (int)&regs.gpr[18]-(int)&regs);
put_line(out, "GPR19", (int)&regs.gpr[19]-(int)&regs);
put_line(out, "GPR20", (int)&regs.gpr[20]-(int)&regs);
put_line(out, "GPR21", (int)&regs.gpr[21]-(int)&regs);
put_line(out, "GPR22", (int)&regs.gpr[22]-(int)&regs);
put_line(out, "GPR23", (int)&regs.gpr[23]-(int)&regs);
put_line(out, "GPR24", (int)&regs.gpr[24]-(int)&regs);
put_line(out, "GPR25", (int)&regs.gpr[25]-(int)&regs);
put_line(out, "GPR26", (int)&regs.gpr[26]-(int)&regs);
put_line(out, "GPR27", (int)&regs.gpr[27]-(int)&regs);
put_line(out, "GPR28", (int)&regs.gpr[28]-(int)&regs);
put_line(out, "GPR29", (int)&regs.gpr[29]-(int)&regs);
put_line(out, "GPR30", (int)&regs.gpr[30]-(int)&regs);
put_line(out, "GPR31", (int)&regs.gpr[31]-(int)&regs);
put_line(out, "FPR0", (int)&regs.fpr[0]-(int)&regs);
put_line(out, "FPR1", (int)&regs.fpr[1]-(int)&regs);
put_line(out, "FPR2", (int)&regs.fpr[2]-(int)&regs);
put_line(out, "FPR3", (int)&regs.fpr[3]-(int)&regs);
put_line(out, "FPCSR", (int)&regs.fpcsr-(int)&regs);
/* Note: these symbols include "_" because they overlap with special register names */
put_line(out, "_NIP", (int)&regs.nip-(int)&regs);
put_line(out, "_MSR", (int)&regs.msr-(int)&regs);
put_line(out, "_CTR", (int)&regs.ctr-(int)&regs);
put_line(out, "_LINK", (int)&regs.link-(int)&regs);
put_line(out, "_CCR", (int)&regs.ccr-(int)&regs);
put_line(out, "_XER", (int)&regs.xer-(int)&regs);
put_line(out, "_DAR", (int)&regs.dar-(int)&regs);
put_line(out, "_DSISR", (int)&regs.dsisr-(int)&regs);
put_line(out, "_HASH1", (int)&regs.hash1-(int)&regs);
put_line(out, "_HASH2", (int)&regs.hash2-(int)&regs);
put_line(out, "_IMISS", (int)&regs.imiss-(int)&regs);
put_line(out, "_DMISS", (int)&regs.dmiss-(int)&regs);
put_line(out, "_ICMP", (int)&regs.icmp-(int)&regs);
put_line(out, "_DCMP", (int)&regs.dcmp-(int)&regs);
put_line(out, "ORIG_GPR3", (int)&regs.orig_gpr3-(int)&regs);
put_line(out, "RESULT", (int)&regs.result-(int)&regs);
put_line(out, "TRAP", (int)&regs.trap-(int)&regs);
put_line(out, "MARKER", (int)&regs.marker-(int)&regs);
exit(0);
}
put_line(FILE *out, char *name, int offset)
{
fprintf(out, "#define %s %d\n", name, offset);
}
#include <stdio.h>
extern long ce_exec_config[];
main(int argc, char *argv[])
{
FILE *out, *in;
int i, cnt, pos;
unsigned char *lp;
unsigned char buf[4096];
if (argc != 3)
{
fprintf(stderr, "usage: %s <in-file> <out-file>\n", argv[0]);
exit(1);
}
if ((out = fopen(argv[2], "w")) == (FILE *)0)
{
fprintf(stderr, "Can't create '%s'\n", argv[2]);
exit(1);
}
if ((in = fopen(argv[1], "r")) == (FILE *)0)
{
fprintf(stderr, "Can't open '%s'\n", argv[1]);
exit(1);
}
fprintf(out, "#\n");
fprintf(out, "# Miscellaneous data structures:\n");
fprintf(out, "# WARNING - this file is automatically generated!\n");
fprintf(out, "#\n");
fprintf(out, "\n");
fprintf(out, "\t.data\n");
fprintf(out, "\t.globl builtin_ramdisk_image\n");
fprintf(out, "builtin_ramdisk_image:\n");
pos = 0;
while (fread(buf, sizeof(buf), 1, in) == 1)
{
cnt = 0;
lp = (unsigned char *)buf;
for (i = 0; i < sizeof(buf); i += 4)
{
if (cnt == 0)
{
fprintf(out, "\t.long\t");
}
fprintf(out, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
lp += 4;
if (++cnt == 4)
{
cnt = 0;
fprintf(out, " # %x \n", pos+i-12);
fflush(out);
} else
{
fprintf(out, ",");
}
}
pos += sizeof(buf);
}
fprintf(out, "\t.globl builtin_ramdisk_size\n");
fprintf(out, "builtin_ramdisk_size:\t.long\t0x%x\n", pos);
fflush(out);
fclose(out);
exit(0);
}
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
/* amount to skip */
#define PLACE 65536
/* size of read buffer */
#define SIZE 0x200000
void main(int argc, char **argv )
{
int fd, fdo;
unsigned char data[SIZE];
int i, n, skip;
if ( argc != 3 )
{
fprintf(stderr,"%s infile outfile\n", argv[0]);
exit(-1);
}
fd = open(argv[1], O_RDONLY);
if ( fd == -1 )
{
fprintf(stderr,"Couldn't open %s\n", argv[1]);
perror("open()");
exit(-1);
}
fdo = open(argv[2], O_WRONLY|O_CREAT);
if ( fdo == -1 )
{
fprintf(stderr,"Couldn't open %s\n", argv[2]);
perror("open()");
exit(-1);
}
#if 0
skip = atoi(argv[3]);
#else
skip = PLACE;
#endif
i = lseek(fd, skip, SEEK_SET);
printf("lseek'd %d bytes\n", i);
if ( i == -1 )
{
perror("lseek()");
}
while ( (n = read(fd, data, SIZE)) > 0 )
{
printf("Read %d bytes\n", n);
i = write(fdo, data, n);
printf("Wrote %d bytes\n", i);
}
close(fdo);
close(fd);
return(0);
}
/*
* PowerPC memory management structures
*/
#ifndef _PPC_MMU_H_
#define _PPC_MMU_H_
/* Hardware Page Table Entry */
typedef struct _PTE
{
unsigned long v:1; /* Entry is valid */
unsigned long vsid:24; /* Virtual segment identifier */
unsigned long h:1; /* Hash algorithm indicator */
unsigned long api:6; /* Abbreviated page index */
unsigned long rpn:20; /* Real (physical) page number */
unsigned long :3; /* Unused */
unsigned long r:1; /* Referenced */
unsigned long c:1; /* Changed */
unsigned long w:1; /* Write-thru cache mode */
unsigned long i:1; /* Cache inhibited */
unsigned long m:1; /* Memory coherence */
unsigned long g:1; /* Guarded */
unsigned long :1; /* Unused */
unsigned long pp:2; /* Page protection */
} PTE;
/* Values for PP (assumes Ks=0, Kp=1) */
#define PP_RWXX 0 /* Supervisor read/write, User none */
#define PP_RWRX 1 /* Supervisor read/write, User read */
#define PP_RWRW 2 /* Supervisor read/write, User read/write */
/* Segment Register */
typedef struct _SEGREG
{
unsigned long t:1; /* Normal or I/O type */
unsigned long ks:1; /* Supervisor 'key' (normally 0) */
unsigned long kp:1; /* User 'key' (normally 1) */
unsigned long n:1; /* No-execute */
unsigned long :4; /* Unused */
unsigned long vsid:24; /* Virtual Segment Identifier */
} SEGREG;
/* Block Address Translation (BAT) Registers */
typedef struct _BATU /* Upper part of BAT */
{
unsigned long bepi:15; /* Effective page index (virtual address) */
unsigned long :4; /* Unused */
unsigned long bl:11; /* Block size mask */
unsigned long vs:1; /* Supervisor valid */
unsigned long vp:1; /* User valid */
} BATU;
typedef struct _BATL /* Lower part of BAT */
{
unsigned long brpn:15; /* Real page index (physical address) */
unsigned long :10; /* Unused */
unsigned long w:1; /* Write-thru cache */
unsigned long i:1; /* Cache inhibit */
unsigned long m:1; /* Memory coherence */
unsigned long g:1; /* Guarded (MBZ) */
unsigned long :1; /* Unused */
unsigned long pp:2; /* Page access protections */
} BATL;
typedef struct _BAT
{
BATU batu; /* Upper register */
BATL batl; /* Lower register */
} BAT;
/* Block size masks */
#define BL_128K 0x000
#define BL_256K 0x001
#define BL_512K 0x003
#define BL_1M 0x007
#define BL_2M 0x00F
#define BL_4M 0x01F
#define BL_8M 0x03F
#define BL_16M 0x07F
#define BL_32M 0x0FF
#define BL_64M 0x1FF
#define BL_128M 0x3FF
#define BL_256M 0x7FF
/* BAT Access Protection */
#define BPP_XX 0x00 /* No access */
#define BPP_RX 0x01 /* Read only */
#define BPP_RW 0x02 /* Read/write */
/*
* Simulated two-level MMU. This structure is used by the kernel
* to keep track of MMU mappings and is used to update/maintain
* the hardware HASH table which is really a cache of mappings.
*
* The simulated structures mimic the hardware available on other
* platforms, notably the 80x86 and 680x0.
*/
typedef struct _pte
{
unsigned long page_num:20;
unsigned long unused:6;
unsigned long acc:3; /* Read/write/execute permissions */
unsigned long r:1; /* Page has been referenced */
unsigned long m:1; /* Page has been modified */
unsigned long v:1; /* Entry is valid */
} pte;
#define ACC_Rxx 0x04
#define ACC_xWx 0x02
#define ACC_xxX 0x01
#define ACC_RWX (ACC_Rxx|ACC_xWx|ACC_xxX)
#define PD_SHIFT (10+12) /* Page directory */
#define PD_MASK 0x02FF
#define PT_SHIFT (12) /* Page Table */
#define PT_MASK 0x02FF
#define PG_SHIFT (12) /* Page Entry */
/* MMU context */
typedef struct _MMU_context
{
SEGREG segs[16]; /* Segment registers */
pte **pmap; /* Two-level page-map structure */
} MMU_context;
#if 0
BAT ibat[4]; /* Instruction BAT images */
BAT dbat[4]; /* Data BAT images */
PTE *hash_table; /* Hardware hashed page table */
int hash_table_size;
int hash_table_mask;
unsigned long sdr; /* Hardware image of SDR */
#endif
/* Used to set up SDR register */
#define HASH_TABLE_SIZE_64K 0x00010000
#define HASH_TABLE_SIZE_128K 0x00020000
#define HASH_TABLE_SIZE_256K 0x00040000
#define HASH_TABLE_SIZE_512K 0x00080000
#define HASH_TABLE_SIZE_1M 0x00100000
#define HASH_TABLE_SIZE_2M 0x00200000
#define HASH_TABLE_SIZE_4M 0x00400000
#define HASH_TABLE_MASK_64K 0x000
#define HASH_TABLE_MASK_128K 0x001
#define HASH_TABLE_MASK_256K 0x003
#define HASH_TABLE_MASK_512K 0x007
#define HASH_TABLE_MASK_1M 0x00F
#define HASH_TABLE_MASK_2M 0x01F
#define HASH_TABLE_MASK_4M 0x03F
#define MMU_PAGE_SIZE 4096
#endif
/*
* WARNING! This file is automatically generated - DO NOT EDIT!
*/
#define STATE 0
#define COUNTER 4
#define BLOCKED 16
#define SIGNAL 12
#define KERNEL_STACK_PAGE 88
#define TSS 504
#define KSP 0
#define MMU_SEG0 8
#define MMU_SEG1 12
#define MMU_SEG2 16
#define MMU_SEG3 20
#define MMU_SEG4 24
#define MMU_SEG5 28
#define MMU_SEG6 32
#define MMU_SEG7 36
#define MMU_SEG8 40
#define MMU_SEG9 44
#define MMU_SEG10 48
#define MMU_SEG11 52
#define MMU_SEG12 56
#define MMU_SEG13 60
#define MMU_SEG14 64
#define MMU_SEG15 68
#define TSS_FPR0 72
#define TSS_FPR1 80
#define TSS_FPR2 88
#define TSS_FPR3 96
#define TSS_FPR4 104
#define TSS_FPR5 112
#define TSS_FPR6 120
#define TSS_FPR7 128
#define TSS_FPR8 136
#define TSS_FPR9 144
#define TSS_FPR10 152
#define TSS_FPR11 160
#define TSS_FPR12 168
#define TSS_FPR13 176
#define TSS_FPR14 184
#define TSS_FPR15 192
#define TSS_FPR16 200
#define TSS_FPR17 208
#define TSS_FPR18 216
#define TSS_FPR19 224
#define TSS_FPR20 232
#define TSS_FPR21 240
#define TSS_FPR22 248
#define TSS_FPR23 256
#define TSS_FPR24 264
#define TSS_FPR25 272
#define TSS_FPR26 280
#define TSS_FPR27 288
#define TSS_FPR28 296
#define TSS_FPR29 304
#define TSS_FPR30 312
#define TSS_FPR31 320
#define INT_FRAME_SIZE 384
#define GPR0 56
#define GPR1 60
#define GPR2 64
#define GPR3 68
#define GPR4 72
#define GPR5 76
#define GPR6 80
#define GPR7 84
#define GPR8 88
#define GPR9 92
#define GPR10 96
#define GPR11 100
#define GPR12 104
#define GPR13 108
#define GPR14 112
#define GPR15 116
#define GPR16 120
#define GPR17 124
#define GPR18 128
#define GPR19 132
#define GPR20 136
#define GPR21 140
#define GPR22 144
#define GPR23 148
#define GPR24 152
#define GPR25 156
#define GPR26 160
#define GPR27 164
#define GPR28 168
#define GPR29 172
#define GPR30 176
#define GPR31 180
#define FPR0 256
#define FPR1 264
#define FPR2 272
#define FPR3 280
#define FPCSR 288
#define _NIP 184
#define _MSR 188
#define _CTR 192
#define _LINK 196
#define _CCR 200
#define _XER 208
#define _DAR 212
#define _DSISR 216
#define _HASH1 220
#define _HASH2 224
#define _IMISS 228
#define _DMISS 232
#define _ICMP 236
#define _DCMP 240
#define ORIG_GPR3 244
#define RESULT 248
#define TRAP 296
#define MARKER 300
/*
* PCI support
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/bios32.h>
#include <linux/pci.h>
/* #define PCI_DEBUG */
int PCI_conversions[2];
unsigned long pcibios_init(unsigned long mem_start,
unsigned long mem_end)
{
printk("PPC init stub -- cort\n");
return mem_start;
}
unsigned long pcibios_fixup(unsigned long mem_start, unsigned long mem_end)
{
return mem_start;
}
unsigned long
_LE_to_BE_long(unsigned long val)
{
unsigned char *p = (unsigned char *)&val;
PCI_conversions[0]++;
return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | (p[0] << 0));
}
unsigned short
_LE_to_BE_short(unsigned long val)
{
unsigned char *p = (unsigned char *)&val;
PCI_conversions[1]++;
return ((p[3] << 8) | (p[2] << 0));
}
int
pcibios_present (void)
{
#ifdef PCI_DEBUG
_printk("PCI [BIOS] present?\n");
#endif
return (1);
}
int
pcibios_read_config_dword (unsigned char bus,
unsigned char dev, unsigned char offset, unsigned int *val)
{
unsigned long _val;
unsigned long *ptr;
dev >>= 3;
#ifdef PCI_DEBUG
_printk("PCI Read config dword[%d.%d.%x] = ", bus, dev, offset);
#endif
if ((bus != 0) || (dev < 11) || (dev > 16))
{
*val = 0xFFFFFFFF;
return PCIBIOS_DEVICE_NOT_FOUND;
} else
{
ptr = (unsigned long *)(0x80800000 | (1<<dev) | offset);
#ifdef PCI_DEBUG
_printk("[%x] ", ptr);
#endif
_val = _LE_to_BE_long(*ptr);
}
#ifdef PCI_DEBUG
_printk("%x\n", _val);
#endif
*val = _val;
return PCIBIOS_SUCCESSFUL;
}
int
pcibios_read_config_word (unsigned char bus,
unsigned char dev, unsigned char offset, unsigned short *val)
{
unsigned short _val;
unsigned short *ptr;
dev >>= 3;
#ifdef PCI_DEBUG
_printk("PCI Read config word[%d.%d.%x] = ", bus, dev, offset);
#endif
if ((bus != 0) || (dev < 11) || (dev > 16))
{
*val = 0xFFFFFFFF;
return PCIBIOS_DEVICE_NOT_FOUND;
} else
{
ptr = (unsigned short *)(0x80800000 | (1<<dev) | offset);
#ifdef PCI_DEBUG
_printk("[%x] ", ptr);
#endif
_val = _LE_to_BE_short(*ptr);
}
#ifdef PCI_DEBUG
_printk("%x\n", _val);
#endif
*val = _val;
return PCIBIOS_SUCCESSFUL;
}
int
pcibios_read_config_byte (unsigned char bus,
unsigned char dev, unsigned char offset, unsigned char *val)
{
unsigned char _val;
unsigned char *ptr;
dev >>= 3;
#ifdef PCI_DEBUG
_printk("PCI Read config byte[%d.%d.%x] = ", bus, dev, offset);
#endif
if ((bus != 0) || (dev < 11) || (dev > 16))
{
*val = 0xFFFFFFFF;
return PCIBIOS_DEVICE_NOT_FOUND;
} else
{
ptr = (unsigned char *)(0x80800000 | (1<<dev) | offset ^ 1);
#ifdef PCI_DEBUG
_printk("[%x] ", ptr);
#endif
_val = *ptr;
}
#ifdef PCI_DEBUG
_printk("%x\n", _val);
#endif
*val = _val;
return PCIBIOS_SUCCESSFUL;
}
int
pcibios_write_config_dword (unsigned char bus,
unsigned char dev, unsigned char offset, unsigned int val)
{
unsigned long _val;
unsigned long *ptr;
dev >>= 3;
_val = _LE_to_BE_long(val);
#ifdef PCI_DEBUG
_printk("PCI Write config dword[%d.%d.%x] = %x\n", bus, dev, offset, _val);
#endif
if ((bus != 0) || (dev < 11) || (dev > 16))
{
return PCIBIOS_DEVICE_NOT_FOUND;
} else
{
ptr = (unsigned long *)(0x80800000 | (1<<dev) | offset);
*ptr = _val;
}
return PCIBIOS_SUCCESSFUL;
}
int
pcibios_write_config_word (unsigned char bus,
unsigned char dev, unsigned char offset, unsigned short val)
{
unsigned short _val;
unsigned short *ptr;
dev >>= 3;
_val = _LE_to_BE_short(val);
#ifdef PCI_DEBUG
_printk("PCI Write config word[%d.%d.%x] = %x\n", bus, dev, offset, _val);
#endif
if ((bus != 0) || (dev < 11) || (dev > 16))
{
return PCIBIOS_DEVICE_NOT_FOUND;
} else
{
ptr = (unsigned short *)(0x80800000 | (1<<dev) | offset);
*ptr = _val;
}
return PCIBIOS_SUCCESSFUL;
}
int
pcibios_write_config_byte (unsigned char bus,
unsigned char dev, unsigned char offset, unsigned char val)
{
unsigned char _val;
unsigned char *ptr;
dev >>= 3;
_val = val;
#ifdef PCI_DEBUG
_printk("PCI Write config byte[%d.%d.%x] = %x\n", bus, dev, offset, _val);
#endif
if ((bus != 0) || (dev < 11) || (dev > 16))
{
return PCIBIOS_DEVICE_NOT_FOUND;
} else
{
ptr = (unsigned char *)(0x80800000 | (1<<dev) | offset ^ 1);
*ptr = _val;
}
return PCIBIOS_SUCCESSFUL;
}
int
pcibios_find_device (unsigned short vendor, unsigned short device_id,
unsigned short index, unsigned char *bus,
unsigned char *dev)
{
unsigned long w, desired = (device_id << 16) | vendor;
int devnr;
if (vendor == 0xffff) {
return PCIBIOS_BAD_VENDOR_ID;
}
for (devnr = 11; devnr < 16; devnr++)
{
pcibios_read_config_dword(0, devnr<<3, PCI_VENDOR_ID, &w);
if (w == desired) {
if (index == 0) {
*bus = 0;
*dev = devnr<<3;
return PCIBIOS_SUCCESSFUL;
}
--index;
}
}
return PCIBIOS_DEVICE_NOT_FOUND;
}
int
pcibios_find_class (unsigned int class_code, unsigned short index,
unsigned char *bus, unsigned char *dev)
{
printk("pcibios_find_class\n");
return PCIBIOS_FUNC_NOT_SUPPORTED;
}
const char *pcibios_strerror(int error) { _panic("pcibios_strerror"); }
/*int get_pci_list(char *buf) { _panic("get_pci_list"); } */
/*
* I/O 'port' access routines
*/
/* This is really only correct for the MVME16xx (PreP)? */
#define _IO_BASE ((unsigned long)0x80000000)
unsigned char
inb(int port)
{
return (*((unsigned char *)(_IO_BASE+port)));
}
unsigned short
inw(int port)
{
return (_LE_to_BE_short(*((unsigned short *)(_IO_BASE+port))));
}
unsigned long
inl(int port)
{
return (_LE_to_BE_long(*((unsigned long *)(_IO_BASE+port))));
}
void insl(int port, long *ptr, int len)
{
unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
while (len-- > 0)
{
*ptr++ = _LE_to_BE_long(*io_ptr);
}
}
unsigned char inb_p(int port) {return (inb(port)); }
unsigned short inw_p(int port) {return (inw(port)); }
unsigned long inl_p(int port) {return (inl(port)); }
unsigned char
outb(unsigned char val,int port)
{
*((unsigned char *)(_IO_BASE+port)) = (val);
return (val);
}
unsigned short
outw(unsigned short val,int port)
{
*((unsigned short *)(_IO_BASE+port)) = _LE_to_BE_short(val);
return (val);
}
unsigned long
outl(unsigned long val,int port)
{
*((unsigned long *)(_IO_BASE+port)) = _LE_to_BE_long(val);
return (val);
}
void outsl(int port, long *ptr, int len)
{
unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
while (len-- > 0)
{
*io_ptr = _LE_to_BE_long(*ptr++);
}
}
unsigned char outb_p(unsigned char val,int port) { return (outb(val,port)); }
unsigned short outw_p(unsigned short val,int port) { return (outw(val,port)); }
unsigned long outl_p(unsigned long val,int port) { return (outl(val,port)); }
/*
* This file contains all the macros and symbols which define
* a PowerPC assembly language environment.
*/
#define _TEXT()\
.text
#if 0 /* Old way */
#define _EXTERN(n) .##n
#define _GLOBAL(n)\
.globl n;\
n: .long _EXTERN(n);\
.globl _EXTERN(n);\
_EXTERN(n):
#else
#define _EXTERN(n) n
#define _GLOBAL(n)\
.globl n;\
n:
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#define _ORG(n)\
.org n
/* Register names */
#define r0 0
#define r1 1
#define r2 2
#define r3 3
#define r4 4
#define r5 5
#define r6 6
#define r7 7
#define r8 8
#define r9 9
#define r10 10
#define r11 11
#define r12 12
#define r13 13
#define r14 14
#define r15 15
#define r16 16
#define r17 17
#define r18 18
#define r19 19
#define r20 20
#define r21 21
#define r22 22
#define r23 23
#define r24 24
#define r25 25
#define r26 26
#define r27 27
#define r28 28
#define r29 29
#define r30 30
#define r31 31
#define fr0 0
#define fr1 1
#define fr2 2
#define fr3 3
#define fr4 4
#define fr5 5
#define fr6 6
#define fr7 7
#define fr8 8
#define fr9 9
#define fr10 10
#define fr11 11
#define fr12 12
#define fr13 13
#define fr14 14
#define fr15 15
#define fr16 16
#define fr17 17
#define fr18 18
#define fr19 19
#define fr20 20
#define fr21 21
#define fr22 22
#define fr23 23
#define fr24 24
#define fr25 25
#define fr26 26
#define fr27 27
#define fr28 28
#define fr29 29
#define fr30 30
#define fr31 31
/* Some special registers */
#define TBRU 269 /* Time base Upper/Lower (Reading) */
#define TBRL 268
#define TBWU 284 /* Time base Upper/Lower (Writing) */
#define TBWL 285
#define XER 1
#define LR 8
#define CTR 9
#define HID0 1008 /* Hardware Implementation */
#define PVR 287 /* Processor Version */
#define IBAT0U 528 /* Instruction BAT #0 Upper/Lower */
#define IBAT0L 529
#define IBAT1U 530 /* Instruction BAT #1 Upper/Lower */
#define IBAT1L 531
#define IBAT2U 532 /* Instruction BAT #2 Upper/Lower */
#define IBAT2L 533
#define IBAT3U 534 /* Instruction BAT #3 Upper/Lower */
#define IBAT3L 535
#define DBAT0U 536 /* Data BAT #0 Upper/Lower */
#define DBAT0L 537
#define DBAT1U 538 /* Data BAT #1 Upper/Lower */
#define DBAT1L 539
#define DBAT2U 540 /* Data BAT #2 Upper/Lower */
#define DBAT2L 541
#define DBAT3U 542 /* Data BAT #3 Upper/Lower */
#define DBAT3L 543
#define DMISS 976 /* TLB Lookup/Refresh registers */
#define DCMP 977
#define HASH1 978
#define HASH2 979
#define IMISS 980
#define ICMP 981
#define RPA 982
#define SDR1 25 /* MMU hash base register */
#define DAR 19 /* Data Address Register */
#define SPR0 272 /* Supervisor Private Registers */
#define SPR1 273
#define SPR2 274
#define SPR3 275
#define DSISR 18
#define SRR0 26 /* Saved Registers (exception) */
#define SRR1 27
#define IABR 1010 /* Instruction Address Breakpoint */
#define DEC 22 /* Decrementer */
#define EAR 282 /* External Address Register */
/* Segment Registers */
#define SR0 0
#define SR1 1
#define SR2 2
#define SR3 3
#define SR4 4
#define SR5 5
#define SR6 6
#define SR7 7
#define SR8 8
#define SR9 9
#define SR10 10
#define SR11 11
#define SR12 12
#define SR13 13
#define SR14 14
#define SR15 15
/* Missing instructions */
#define bdne bc 0,2,
#include "ppc_machine.h"
/*
* WARNING! This file is automatically generated - DO NOT EDIT!
*/
#define STATE 0
#define COUNTER 4
#define BLOCKED 16
#define SIGNAL 12
#define KERNEL_STACK_PAGE 88
#define TSS 504
#define KSP 0
#define LAST_PC 72
#define MMU_SEG0 8
#define MMU_SEG1 12
#define MMU_SEG2 16
#define MMU_SEG3 20
#define MMU_SEG4 24
#define MMU_SEG5 28
#define MMU_SEG6 32
#define MMU_SEG7 36
#define MMU_SEG8 40
#define MMU_SEG9 44
#define MMU_SEG10 48
#define MMU_SEG11 52
#define MMU_SEG12 56
#define MMU_SEG13 60
#define MMU_SEG14 64
#define MMU_SEG15 68
#define TSS_FPR0 80
#define TSS_FPR1 88
#define TSS_FPR2 96
#define TSS_FPR3 104
#define TSS_FPR4 112
#define TSS_FPR5 120
#define TSS_FPR6 128
#define TSS_FPR7 136
#define TSS_FPR8 144
#define TSS_FPR9 152
#define TSS_FPR10 160
#define TSS_FPR11 168
#define TSS_FPR12 176
#define TSS_FPR13 184
#define TSS_FPR14 192
#define TSS_FPR15 200
#define TSS_FPR16 208
#define TSS_FPR17 216
#define TSS_FPR18 224
#define TSS_FPR19 232
#define TSS_FPR20 240
#define TSS_FPR21 248
#define TSS_FPR22 256
#define TSS_FPR23 264
#define TSS_FPR24 272
#define TSS_FPR25 280
#define TSS_FPR26 288
#define TSS_FPR27 296
#define TSS_FPR28 304
#define TSS_FPR29 312
#define TSS_FPR30 320
#define TSS_FPR31 328
#define INT_FRAME_SIZE 384
#define GPR0 56
#define GPR1 60
#define GPR2 64
#define GPR3 68
#define GPR4 72
#define GPR5 76
#define GPR6 80
#define GPR7 84
#define GPR8 88
#define GPR9 92
#define GPR10 96
#define GPR11 100
#define GPR12 104
#define GPR13 108
#define GPR14 112
#define GPR15 116
#define GPR16 120
#define GPR17 124
#define GPR18 128
#define GPR19 132
#define GPR20 136
#define GPR21 140
#define GPR22 144
#define GPR23 148
#define GPR24 152
#define GPR25 156
#define GPR26 160
#define GPR27 164
#define GPR28 168
#define GPR29 172
#define GPR30 176
#define GPR31 180
#define FPR0 248
#define FPR1 256
#define FPR2 264
#define FPR3 272
#define FPCSR 280
#define _NIP 184
#define _MSR 188
#define _CTR 192
#define _LINK 196
#define _CCR 200
#define _XER 204
#define _DAR 208
#define _DSISR 212
#define _HASH1 216
#define _HASH2 220
#define _IMISS 224
#define _DMISS 228
#define _ICMP 232
#define _DCMP 236
#define ORIG_GPR3 240
#define RESULT 244
#define TRAP 288
#define MARKER 292
/*
* PowerPC machine specifics
*/
#ifndef _PPC_MACHINE_H_
#define _PPC_MACHINE_H_
/* Bit encodings for Machine State Register (MSR) */
#define MSR_POW (1<<18) /* Enable Power Management */
#define MSR_TGPR (1<<17) /* TLB Update registers in use */
#define MSR_ILE (1<<16) /* Interrupt Little-Endian enable */
#define MSR_EE (1<<15) /* External Interrupt enable */
#define MSR_PR (1<<14) /* Supervisor/User privelege */
#define MSR_FP (1<<13) /* Floating Point enable */
#define MSR_ME (1<<12) /* Machine Check enable */
#define MSR_FE0 (1<<11) /* Floating Exception mode 0 */
#define MSR_SE (1<<10) /* Single Step */
#define MSR_BE (1<<9) /* Branch Trace */
#define MSR_FE1 (1<<8) /* Floating Exception mode 1 */
#define MSR_IP (1<<6) /* Exception prefix 0x000/0xFFF */
#define MSR_IR (1<<5) /* Instruction MMU enable */
#define MSR_DR (1<<4) /* Data MMU enable */
#define MSR_RI (1<<1) /* Recoverable Exception */
#define MSR_LE (1<<0) /* Little-Endian enable */
#define MSR_ MSR_FP|MSR_FE0|MSR_FE1|MSR_ME
#define MSR_USER MSR_|MSR_PR|MSR_EE|MSR_IR|MSR_DR
/* Bit encodings for Hardware Implementation Register (HID0) */
#define HID0_EMCP (1<<31) /* Enable Machine Check pin */
#define HID0_EBA (1<<29) /* Enable Bus Address Parity */
#define HID0_EBD (1<<28) /* Enable Bus Data Parity */
#define HID0_SBCLK (1<<27)
#define HID0_EICE (1<<26)
#define HID0_ECLK (1<<25)
#define HID0_PAR (1<<24)
#define HID0_DOZE (1<<23)
#define HID0_NAP (1<<22)
#define HID0_SLEEP (1<<21)
#define HID0_DPM (1<<20)
#define HID0_ICE (1<<15) /* Instruction Cache Enable */
#define HID0_DCE (1<<14) /* Data Cache Enable */
#define HID0_ILOCK (1<<13) /* Instruction Cache Lock */
#define HID0_DLOCK (1<<12) /* Data Cache Lock */
#define HID0_ICFI (1<<11) /* Instruction Cache Flash Invalidate */
#define HID0_DCI (1<<10) /* Data Cache Invalidate */
#endif
/* * Last edited: Nov 8 12:32 1995 (cort) */
/*
* linux/arch/ppc/kernel/process.c
*
* Copyright (C) 1995 Linus Torvalds
* Adapted for PowerPC by Gary Thomas
*/
/*
* This file handles the architecture-dependent parts of process handling..
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/ldt.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <asm/pgtable.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/processor.h>
int dump_fpu (struct user_i387_struct* fpu)
{
return 1; /* all ppc's have a fpu */
}
void
switch_to(struct task_struct *new)
{
struct pt_regs *regs;
struct thread_struct *new_tss, *old_tss;
int s;
regs = (struct pt_regs *)new->tss.ksp;
/*
printk("Task %x(%d) -> %x(%d)", current, current->pid, new, new->pid);
printk(" - IP: %x, SR: %x, SP: %x\n", regs->nip, regs->msr, regs);
*/
s = _disable_interrupts();
new_tss = &new->tss;
old_tss = &current->tss;
current = new;
_switch(old_tss, new_tss);
/* printk("Back in task %x(%d)\n", current, current->pid);*/
_enable_interrupts(s);
}
asmlinkage int sys_idle(void)
{
if (current->pid != 0)
return -EPERM;
/*panic("process.c: sys_idle()\n");*/
/* endless idle loop with no priority at all */
current->counter = -100;
for (;;) {
schedule();
}
}
void hard_reset_now(void)
{
halt();
}
void show_regs(struct pt_regs * regs)
{
_panic("show_regs");
}
/*
* Free current thread data structures etc..
*/
void exit_thread(void)
{
}
void flush_thread(void)
{
}
/*
* Copy a thread..
*/
void copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
struct task_struct * p, struct pt_regs * regs)
{
int i;
SEGREG *segs;
struct pt_regs * childregs;
/*printk("copy thread - NR: %d, Flags: %x, USP: %x, Task: %x, Regs: %x\n", nr, clone_flags, usp, p, regs);*/
/* Construct segment registers */
segs = (SEGREG *)p->tss.segs;
for (i = 0; i < 8; i++)
{
segs[i].ks = 0;
segs[i].kp = 1;
segs[i].vsid = i | (nr << 4);
}
/* Last 8 are shared with kernel & everybody else... */
for (i = 8; i < 16; i++)
{
segs[i].ks = 0;
segs[i].kp = 1;
segs[i].vsid = i;
}
/* Copy registers */
childregs = ((struct pt_regs *) (p->kernel_stack_page + 2*PAGE_SIZE)) - 2;
*childregs = *regs; /* STRUCT COPY */
childregs->gpr[3] = 0; /* Result from fork() */
p->tss.ksp = childregs;
if (usp >= (unsigned long)regs)
{ /* Stack is in kernel space - must adjust */
childregs->gpr[1] = childregs+1;
} else
{ /* Provided stack is in user space */
childregs->gpr[1] = usp;
}
}
/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
}
#if 0 /* mfisk */
/*
* Do necessary setup to start up a newly executed thread.
*/
void start_thread(struct pt_regs * regs, unsigned long eip, unsigned long esp)
{
regs->nip = eip;
regs->gpr[1] = esp;
regs->msr = MSR_USER;
#if 0
/* printk("current = %x current->mm = %x\n", current, current->mm);
printk("task[0] = %x task[0]->mm = %x\n", task[0],task[0]->mm);*/
printk("Start thread [%x] at PC: %x, SR: %x, SP: %x\n",
regs, eip, regs->msr, esp);
/* dump_buf(esp, 64);*/
/* dump_buf(eip, 64);*/
#endif
}
#endif
asmlinkage int sys_newselect(int p1, int p2, int p3, int p4, int p5, int p6, struct pt_regs *regs)
{
panic("sys_newselect unimplemented");
}
asmlinkage int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6, struct pt_regs *regs)
{
printk("process.c: sys_fork() called\n");
return do_fork( CLONE_VM|SIGCHLD, regs->gpr[1], regs);
}
asmlinkage int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs *regs)
{
int error;
char * filename;
/* printk("process.c: sys_execve(a0 = %s, a1 = %x, a2 = %x)\n",a0,a1,a2);*/
#if 1
/* paranoia check. I really don't trust head.S -- Cort */
if ( regs->marker != 0xDEADDEAD )
{
panic("process.c: sys_execve(): regs->marker != DEADDEAD\n");
}
#endif
error = getname((char *) a0, &filename);
if (error)
return error;
error = do_execve(filename, (char **) a1, (char **) a2, regs);
#if 0
if (error)
{
printk("EXECVE - file = '%s', error = %d\n", filename, error);
}
#endif
putname(filename);
return error;
}
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long usp, unsigned long a2,
unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs *regs)
{
int i;
if (!usp)
usp = regs->gpr[1];
i = do_fork(CLONE_VM/*clone_flags*/, /*usp*/regs->gpr[1], regs);
/* printk("sys_clone going to return %d\n", i);*/
return i;
}
void
print_backtrace(void)
{
unsigned long *sp = (unsigned long *)_get_SP();
int cnt = 0;
printk("... Call backtrace:\n");
while (*sp)
{
printk("%08X ", sp[2]);
sp = *sp;
if (++cnt == 8)
{
printk("\n");
}
if (cnt > 16) break;
}
printk("\n");
}
This diff is collapsed.
/*
* linux/arch/ppc/kernel/setup.c
*
* Copyright (C) 1995 Linus Torvalds
* Adapted from 'alpha' version by Gary Thomas
*/
/*
* bootup setup stuff..
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/ldt.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/tty.h>
#include <asm/pgtable.h>
extern PTE *Hash;
extern unsigned long Hash_size, Hash_mask;
char sda_root[] = "root=/dev/sda1";
unsigned char aux_device_present;
int get_cpuinfo(char *buffer)
{
}
/*
* The format of "screen_info" is strange, and due to early
* i386-setup code. This is just enough to make the console
* code think we're on a EGA+ colour display.
*/
struct screen_info screen_info = {
0, 0, /* orig-x, orig-y */
0, 0, /* unused */
0, /* orig-video-page */
0, /* orig-video-mode */
80, /* orig-video-cols */
0,0,0, /* ega_ax, ega_bx, ega_cx */
25 /* orig-video-lines */
};
unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
{
return memory_start;
}
unsigned long find_end_of_memory(void)
{
unsigned char dram_size = inb(0x0804);
unsigned long total;
_printk("DRAM Size = %x\n", dram_size);
_printk("Config registers = %x/%x/%x\n", inb(0x0800), inb(0x0801), inb(0x0802));
switch (dram_size & 0x07)
{
case 0:
total = 0x08000000; /* 128M */
break;
case 1:
total = 0x02000000; /* 32M */
break;
case 2:
total = 0x00800000; /* 8M */
break;
case 3:
total = 0x00400000; /* 4M - can't happen! */
break;
case 4:
total = 0x10000000; /* 256M */
break;
case 5:
total = 0x04000000; /* 64M */
break;
case 6:
total = 0x01000000; /* 16M */
break;
case 7:
total = 0x04000000; /* Can't happen */
break;
}
switch ((dram_size>>4) & 0x07)
{
case 0:
total += 0x08000000; /* 128M */
break;
case 1:
total += 0x02000000; /* 32M */
break;
case 2:
total += 0x00800000; /* 8M */
break;
case 3:
total += 0x00000000; /* Module not present */
break;
case 4:
total += 0x10000000; /* 256M */
break;
case 5:
total += 0x04000000; /* 64M */
break;
case 6:
total += 0x01000000; /* 16M */
break;
case 7:
total += 0x00000000; /* Module not present */
break;
}
_printk("register total = %08X\n", total);
/* TEMP */ total = 0x01000000;
/*_cnpause(); */
/* CAUTION!! This can be done more elegantly! */
if (total < 0x01000000)
{
Hash_size = HASH_TABLE_SIZE_64K;
Hash_mask = HASH_TABLE_MASK_64K;
} else
{
Hash_size = HASH_TABLE_SIZE_128K;
Hash_mask = HASH_TABLE_MASK_128K;
}
Hash = (PTE *)((total-Hash_size)+KERNELBASE);
bzero(Hash, Hash_size);
return ((unsigned long)Hash);
}
int size_memory;
#define DEFAULT_ROOT_DEVICE 0x0200 /* fd0 */
void setup_arch(char **cmdline_p,
unsigned long * memory_start_p, unsigned long * memory_end_p)
{
extern int _end;
extern char cmd_line[];
ROOT_DEV = DEFAULT_ROOT_DEVICE;
aux_device_present = 0xaa;
*cmdline_p = cmd_line;
*memory_start_p = (unsigned long) &_end;
*memory_end_p = (unsigned long *)Hash;
size_memory = *memory_end_p - KERNELBASE; /* Relative size of memory */
/* _printk("setup_arch() done! memory_start = %08X memory_end = %08X\n"
,*memory_start_p,*memory_end_p);*/
}
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
{
return -EIO;
}
extern char builtin_ramdisk_image;
extern long builtin_ramdisk_size;
void
builtin_ramdisk_init(void)
{
if (ROOT_DEV == DEFAULT_ROOT_DEVICE)
{
rd_preloaded_init(&builtin_ramdisk_image, builtin_ramdisk_size);
}
}
This diff is collapsed.
#include <linux/in.h>
void sys_ptrace(void) { _panic("sys_ptrace"); }
void sys_iopl(void) { _panic("sys_iopl"); }
void sys_vm86(void) { _panic("sys_vm86"); }
void sys_modify_ldt(void) { _panic("sys_modify_ldt"); }
void sys_quotactl(void) { _panic("sys_quotactl"); }
void sys_pipe(void) {_panic("sys_pipe"); }
void sys_ipc(void) {_panic("sys_ipc"); }
void sys_mmap(void) {_panic("sys_mmap"); }
void sys_readdir(void) {_panic("sys_readdir"); }
halt()
{
_printk("\n...Halt!\n");
abort();
}
_panic(char *msg)
{
_printk("Panic: %s\n", msg);
printk("Panic: %s\n", msg);
abort();
}
_warn(char *msg)
{
_printk("*** Warning: %s UNIMPLEMENTED!\n", msg);
}
extern unsigned short _ip_fast_csum(unsigned char *buf, int len);
unsigned short
ip_fast_csum(unsigned char *buf, int len)
{
unsigned short _val;
_val = _ip_fast_csum(buf, len);
#if 0
printk("IP CKSUM(%x, %d) = %x\n", buf, len, _val);
#endif
return (_val);
}
extern unsigned short _ip_compute_csum(unsigned char *buf, int len);
unsigned short
ip_compute_csum(unsigned char *buf, int len)
{
unsigned short _val;
_val = _ip_compute_csum(buf, len);
#if 0
printk("Compute IP CKSUM(%x, %d) = %x\n", buf, len, _val);
#endif
return (_val);
}
unsigned short
_udp_check(unsigned char *buf, int len, int saddr, int daddr, int hdr);
unsigned short
udp_check(unsigned char *buf, int len, int saddr, int daddr)
{
unsigned short _val;
int hdr;
hdr = (len << 16) + IPPROTO_UDP;
_val = _udp_check(buf, len, saddr, daddr, hdr);
#if 0
printk("UDP CSUM(%x,%d,%x,%x) = %x\n", buf, len, saddr, daddr, _val);
dump_buf(buf, len);
#endif
return (_val);
}
#if 0
unsigned short
_tcp_check(unsigned char *buf, int len, int saddr, int daddr, int hdr);
unsigned short
tcp_check(unsigned char *buf, int len, int saddr, int daddr)
{
unsigned short _val;
int hdr;
hdr = (len << 16) + IPPROTO_TCP;
if (saddr == 0) saddr = ip_my_addr();
_val = _tcp_check(buf, len, saddr, daddr, hdr);
#if 0
printk("TCP CSUM(%x,%d,%x,%x) = %x\n", buf, len, saddr, daddr, _val);
dump_buf(buf, len);
#endif
return (_val);
}
#endif
_do_bottom_half()
{
_enable_interrupts(1);
do_bottom_half();
_disable_interrupts();
}
unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum)
{
panic("csum_partial");
}
unsigned int csum_partial_copy(char *src, char *dst, int len, int sum)
{
panic("csum_partial_copy");
}
unsigned int csum_tcpudp_magic()
{
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# Makefile for the linux ppc-specific parts of the memory manager.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
.c.o:
$(CC) $(CFLAGS) -c $<
.s.o:
$(AS) -o $*.o $<
.c.s:
$(CC) $(CFLAGS) -S $<
OBJS = fault.o init.o
mm.o: $(OBJS)
$(LD) -r -o mm.o $(OBJS)
modules:
dep:
$(CPP) -M *.c > .depend
#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $Id: signal.c,v 1.19 1995/11/25 00:58:24 davem Exp $
/* $Id: signal.c,v 1.20 1995/11/26 02:29:09 davem Exp $
* linux/arch/sparc/kernel/signal.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -87,7 +87,6 @@ extern unsigned long nwindows;
asmlinkage void do_sigreturn(struct pt_regs *regs)
{
int wsvd;
struct sigcontext_struct *scptr =
(struct sigcontext_struct *) regs->u_regs[UREG_I0];
......
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