$(TOPDIR)/drivers/sound/sound_firmware.c \
$(TOPDIR)/drivers/net/wan/syncppp.c \
$(TOPDIR)/drivers/net/wan/z85230.c \
+ $(TOPDIR)/fs/devfs/base.c \
$(TOPDIR)/kernel/pm.c \
$(TOPDIR)/kernel/ksyms.c \
$(TOPDIR)/net/netsyms.c \
</sect1>
</chapter>
+ <chapter id="devfs">
+ <title>The Device File System</title>
+!Efs/devfs/base.c
+ </chapter>
+
<chapter id="pmfuncs">
<title>Power Management</title>
!Ekernel/pm.c
function otherwise.
__devexit The same for __exit.
+Tips:
+ The module_init()/module_exit() functions (and all initialization
+ functions called only from these) should be marked __init/exit.
+ The struct pci_driver shouldn't be marked with any of these tags.
+ The ID table array should be marked __devinitdata.
+ The probe() and remove() functions (and all initialization
+ functions called only from these) should be marked __devinit/exit.
2. How to find PCI devices manually (the old style)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VERSION = 2
PATCHLEVEL = 3
SUBLEVEL = 99
-EXTRAVERSION = -pre8
+EXTRAVERSION = -pre9
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
{acpi_init_via},
};
-const static struct pci_device_id acpi_pci_tbl[] =
+const static struct pci_device_id acpi_pci_tbl[] __devinitdata =
{
{0x8086, 0x7113, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_INTEL_PIIX4},
{0x1106, 0x3040, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_586},
{0x1106, 0x3057, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_686A},
- {0,}, /* terminate list */
+ {0,} /* terminate list */
};
static int __init acpi_probe(struct pci_dev *dev,
int prof_old_multiplier[NR_CPUS] = { 1, };
int prof_counter[NR_CPUS] = { 1, };
-/*
- * IA s/w dev Vol 3, Section 7.4
- */
-#define APIC_DEFAULT_PHYS_BASE 0xfee00000
-
int get_maxlvt(void)
{
unsigned int v, ver, maxlvt;
* IRQ0 must be given a fixed assignment and initialized,
* because it's used before the IO-APIC is set up.
*/
- set_intr_gate(IRQ0_TRAP_VECTOR, interrupt[0]);
+ set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]);
/*
* The reschedule interrupt is a CPU-to-CPU reschedule-helper
/* MP IRQ source entries */
int mp_irq_entries = 0;
+#if CONFIG_SMP
+# define TARGET_CPUS cpu_online_map
+#else
+# define TARGET_CPUS 0x01
+#endif
/*
* Rough estimation of how many shared IRQs there are, can
* be changed anytime.
entry->pin = pin;
}
-#define __DO_ACTION(name,R,ACTION, FINAL) \
+#define __DO_ACTION(R, ACTION, FINAL) \
\
{ \
int pin; \
#define DO_ACTION(name,R,ACTION, FINAL) \
\
-static void name##_IO_APIC_irq(unsigned int irq) \
-__DO_ACTION(name,R,ACTION, FINAL)
+ static void name##_IO_APIC_irq (unsigned int irq) \
+ __DO_ACTION(R, ACTION, FINAL)
DO_ACTION( __mask, 0, |= 0x00010000, io_apic_sync(entry->apic))/* mask = 1 */
DO_ACTION( __unmask, 0, &= 0xfffeffff, ) /* mask = 0 */
return 0;
}
-int irq_vector[NR_IRQS] = { IRQ0_TRAP_VECTOR , 0 };
+int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 };
static int __init assign_irq_vector(int irq)
{
- static int current_vector = IRQ0_TRAP_VECTOR, offset = 0;
+ static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
if (IO_APIC_VECTOR(irq) > 0)
return IO_APIC_VECTOR(irq);
- if (current_vector == 0xFF)
- panic("ran out of interrupt sources!");
next:
current_vector += 8;
if (current_vector == SYSCALL_VECTOR)
goto next;
- if (current_vector > 0xFF) {
+ if (current_vector > FIRST_SYSTEM_VECTOR) {
offset++;
- current_vector = IRQ0_TRAP_VECTOR + offset;
+ current_vector = FIRST_DEVICE_VECTOR + offset;
}
+ if (current_vector == FIRST_SYSTEM_VECTOR)
+ panic("ran out of interrupt sources!");
+
IO_APIC_VECTOR(irq) = current_vector;
return current_vector;
}
entry.delivery_mode = dest_LowestPrio;
entry.dest_mode = 1; /* logical delivery */
entry.mask = 0; /* enable IRQ */
- entry.dest.logical.logical_dest = APIC_ALL_CPUS;
+ entry.dest.logical.logical_dest = TARGET_CPUS;
idx = find_irq_entry(apic,pin,mp_INT);
if (idx == -1) {
if (irq_trigger(idx)) {
entry.trigger = 1;
entry.mask = 1;
- entry.dest.logical.logical_dest = APIC_ALL_CPUS;
+ entry.dest.logical.logical_dest = TARGET_CPUS;
}
irq = pin_2_irq(idx, apic, pin);
*/
entry.dest_mode = 1; /* logical delivery */
entry.mask = 0; /* unmask IRQ now */
- entry.dest.logical.logical_dest = APIC_ALL_CPUS;
+ entry.dest.logical.logical_dest = TARGET_CPUS;
entry.delivery_mode = dest_LowestPrio;
entry.polarity = 0;
entry.trigger = 0;
mask = mask << 24;
spin_lock_irqsave(&ioapic_lock, flags);
- __DO_ACTION( target, 1, = mask, )
+ __DO_ACTION(1, = mask, )
spin_unlock_irqrestore(&ioapic_lock, flags);
}
struct proc_dir_entry *entry;
char name [MAX_NAMELEN];
- if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type))
+ if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
+ irq_dir[irq])
return;
memset(name, 0, MAX_NAMELEN);
/*
* Create entries for all existing IRQs.
*/
- for (i = 0; i < NR_IRQS; i++) {
- if (irq_desc[i].handler == &no_irq_type)
- continue;
+ for (i = 0; i < NR_IRQS; i++)
register_irq_proc(i);
- }
}
/* Bitmask of physically existing CPUs */
unsigned long phys_cpu_present_map = 0;
-/*
- * IA s/w dev Vol 3, Section 7.4
- */
-#define APIC_DEFAULT_PHYS_BASE 0xfee00000
-
/*
* Intel MP BIOS table parsing routines:
*/
static int __init mpf_checksum(unsigned char *mp, int len)
{
- int sum=0;
- while(len--)
- sum+=*mp++;
- return sum&0xFF;
+ int sum = 0;
+
+ while (len--)
+ sum += *mp++;
+
+ return sum & 0xFF;
}
/*
{ "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0, pirq_piix_get, pirq_piix_set },
{ "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, pirq_piix_get, pirq_piix_set },
{ "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0, pirq_piix_get, pirq_piix_set },
+ { "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82440MX_1, pirq_piix_get, pirq_piix_set },
{ "ALI", PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, pirq_ali_get, pirq_ali_set },
{ "VIA", PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, pirq_via_get, pirq_via_set },
{ "VIA", PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596, pirq_via_get, pirq_via_set },
if (!irq) {
DBG(" ... failed\n");
- if (newirq && mask == (1 << newirq)) {
+ if (assign && newirq && mask == (1 << newirq)) {
msg = "Guessed";
irq = newirq;
} else
e820.nr_map++;
} /* add_memory_region */
+#define E820_DEBUG 1
+
+static __init void print_e820_map (void)
+{
+ int i;
+
+ for (i = 0; i < e820.nr_map; i++) {
+ printk(" e820: %016Lx @ %016Lx ",
+ e820.map[i].size, e820.map[i].addr);
+ switch (e820.map[i].type) {
+ case E820_RAM: printk("(usable)\n");
+ break;
+ case E820_RESERVED:
+ printk("(reserved)\n");
+ break;
+ case E820_ACPI:
+ printk("(ACPI data)\n");
+ break;
+ case E820_NVS:
+ printk("(ACPI NVS)\n");
+ break;
+ default: printk("type %lu\n", e820.map[i].type);
+ break;
+ }
+ }
+}
/*
* Do NOT EVER look at the BIOS memory size location.
void __init setup_memory_region(void)
{
-#define E820_DEBUG 1
-#ifdef E820_DEBUG
- int i;
-#endif
-
/*
* If we're lucky and live on a modern system, the setup code
* will have given us a memory map that we can use to properly
if (e820.nr_map > E820MAX)
e820.nr_map = E820MAX;
memcpy(e820.map, E820_MAP, e820.nr_map * sizeof e820.map[0]);
-#ifdef E820_DEBUG
- for (i=0; i < e820.nr_map; i++) {
- printk("e820: %08x @ %08x ", (int)e820.map[i].size,
- (int)e820.map[i].addr);
- switch (e820.map[i].type) {
- case E820_RAM: printk("(usable)\n");
- break;
- case E820_RESERVED:
- printk("(reserved)\n");
- break;
- case E820_ACPI:
- printk("(ACPI data)\n");
- break;
- case E820_NVS:
- printk("(ACPI NVS)\n");
- break;
- default: printk("type %lu\n", e820.map[i].type);
- break;
- }
- }
-#endif
}
else {
/* otherwise fake a memory map; one section from 0k->640k,
add_memory_region(0, LOWMEMSIZE(), E820_RAM);
add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
}
+ printk("BIOS-provided physical RAM map:\n");
+ print_e820_map();
} /* setup_memory_region */
}
*to = '\0';
*cmdline_p = command_line;
+ if (usermem) {
+ printk("user-defined physical RAM map:\n");
+ print_e820_map();
+ }
}
void __init setup_arch(char **cmdline_p)
* On normal SMP PC this is used only with SMP, but we have to
* use it and set it up here to start the Cobalt clock
*/
- set_fixmap(FIX_APIC_BASE, APIC_PHYS_BASE);
+ set_fixmap(FIX_APIC_BASE, APIC_DEFAULT_PHYS_BASE);
printk("Local APIC ID %lx\n", apic_read(APIC_ID));
printk("Local APIC Version %lx\n", apic_read(APIC_LVR));
pte_t *pte;
pgd = swapper_pg_dir + __pgd_offset(vaddr);
+ if (pgd_none(*pgd)) {
+ printk("PAE BUG #00!\n");
+ return;
+ }
pmd = pmd_offset(pgd, vaddr);
+ if (pmd_none(*pmd)) {
+ printk("PAE BUG #01!\n");
+ return;
+ }
pte = pte_offset(pmd, vaddr);
+ if (pte_val(*pte))
+ pte_ERROR(*pte);
pgprot_val(prot) = pgprot_val(PAGE_KERNEL) | pgprot_val(flags);
set_pte(pte, mk_pte_phys(phys, prot));
pmd_t *pmd;
pte_t *pte;
int i, j;
+ unsigned long vaddr;
- i = __pgd_offset(start);
- j = __pmd_offset(start);
+ vaddr = start;
+ i = __pgd_offset(vaddr);
+ j = __pmd_offset(vaddr);
pgd = pgd_base + i;
- for ( ; (i < PTRS_PER_PGD) && (start != end); pgd++, i++) {
+ for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
#if CONFIG_X86_PAE
if (pgd_none(*pgd)) {
pmd = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
set_pgd(pgd, __pgd(__pa(pmd) + 0x1));
- if (pmd != pmd_offset(pgd, start))
- BUG();
+ if (pmd != pmd_offset(pgd, 0))
+ printk("PAE BUG #02!\n");
}
- pmd = pmd_offset(pgd, start);
+ pmd = pmd_offset(pgd, vaddr);
#else
pmd = (pmd_t *)pgd;
#endif
- for (; (j < PTRS_PER_PMD) && start; pmd++, j++) {
+ for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) {
if (pmd_none(*pmd)) {
pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte)));
if (pte != pte_offset(pmd, 0))
BUG();
}
- start += PMD_SIZE;
+ vaddr += PMD_SIZE;
}
j = 0;
}
}
-static void __init pagetable_init(void)
+static void __init pagetable_init (void)
{
+ unsigned long vaddr, end;
pgd_t *pgd, *pgd_base;
+ int i, j, k;
pmd_t *pmd;
pte_t *pte;
- int i, j, k;
- unsigned long vaddr, end;
- end = (unsigned long)__va(max_low_pfn*PAGE_SIZE) - 1;
+ /*
+ * This can be zero as well - no problem, in that case we exit
+ * the loops anyway due to the PTRS_PER_* conditions.
+ */
+ end = (unsigned long)__va(max_low_pfn*PAGE_SIZE);
- i = __pgd_offset(PAGE_OFFSET);
pgd_base = swapper_pg_dir;
+#if CONFIG_X86_PAE
+ for (i = 0; i < PTRS_PER_PGD; i++) {
+ pgd = pgd_base + i;
+ __pgd_clear(pgd);
+ }
+#endif
+ i = __pgd_offset(PAGE_OFFSET);
pgd = pgd_base + i;
for (; i < PTRS_PER_PGD; pgd++, i++) {
vaddr = i*PGDIR_SIZE;
- if (vaddr >= end)
+ if (end && (vaddr >= end))
break;
#if CONFIG_X86_PAE
pmd = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
BUG();
for (j = 0; j < PTRS_PER_PMD; pmd++, j++) {
vaddr = i*PGDIR_SIZE + j*PMD_SIZE;
- if (vaddr >= end)
+ if (end && (vaddr >= end))
break;
if (cpu_has_pse) {
unsigned long __pe;
for (k = 0; k < PTRS_PER_PTE; pte++, k++) {
vaddr = i*PGDIR_SIZE + j*PMD_SIZE + k*PAGE_SIZE;
- if (vaddr >= end)
+ if (end && (vaddr >= end))
break;
*pte = mk_pte_phys(__pa(vaddr), PAGE_KERNEL);
}
ifdef CONFIG_BAGET_MIPS
SUBDIRS += arch/mips/baget arch/mips/baget/prom
LIBS += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a
+LOADADDR += 0x80001000
endif
#
@$(MAKEBOOT) clean
$(MAKE) -C arch/$(ARCH)/kernel clean
$(MAKE) -C arch/$(ARCH)/tools clean
+ $(MAKE) -C arch/mips/baget clean
archmrproper:
-# $Id: Makefile,v 1.2 2000/01/13 00:11:11 ralf Exp $
+# $Id: Makefile,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
#
# Makefile for the SGI arcs prom monitor library routines
# under Linux.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: cmdline.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: cmdline.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <asm/sgialib.h>
-char * __init prom_getenv(char *name)
+PCHAR __init
+ArcGetEnvironmentVariable(CHAR *name)
{
return romvec->get_evar(name);
}
-long __init prom_setenv(char *name, char *value)
+LONG __init
+ArcSetEnvironmentVariable(PCHAR name, PCHAR value)
{
return romvec->set_evar(name, value);
}
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: file.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: file.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
*/
#include <linux/init.h>
#include <asm/sgialib.h>
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: identify.c,v 1.3 1999/10/21 00:23:04 ralf Exp $
+ * $Id: identify.c,v 1.2 1999/02/25 21:04:13 tsbogend Exp $
*/
#include <linux/init.h>
#include <linux/kernel.h>
-/* $Id: init.c,v 1.4 1999/10/09 00:00:57 ralf Exp $
+/* $Id: init.c,v 1.5 2000/03/07 15:45:27 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
* for more details.
extern void prom_testtree(void);
-int __init prom_init(int argc, char **argv, char **envp)
+int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
{
struct linux_promblock *pb;
#undef DEBUG
-extern char _end;
-
struct linux_mdesc * __init
ArcGetMemoryDescriptor(struct linux_mdesc *Current)
{
void __init prom_meminit(void)
{
struct prom_pmemblock *largest;
- unsigned long bootmap_size;
+ unsigned long bootmap_size, kbegin, kend;
struct linux_mdesc *p;
int totram;
int i = 0;
pblocks[i].size = 0;
max_low_pfn = find_max_low_pfn();
+
largest = find_largest_memblock();
bootmap_size = init_bootmem(largest->base >> PAGE_SHIFT, max_low_pfn);
prom_printf("CRITIAL: overwriting PROM data.\n");
BUG();
}
+
+ /* Reserve the memory bootmap itself */
reserve_bootmem(largest->base, bootmap_size);
printk("PROMLIB: Total free ram %dK / %dMB.\n",
-/* $Id: misc.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+/* $Id: misc.c,v 1.1 1998/10/18 13:32:09 tsbogend Exp $
*
* misc.c: Miscellaneous ARCS PROM routines.
*
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: salone.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: salone.c,v 1.1 1998/10/18 13:32:09 tsbogend Exp $
*/
#include <linux/init.h>
#include <asm/sgialib.h>
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: time.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: time.c,v 1.1 1998/10/18 13:32:10 tsbogend Exp $
*/
#include <linux/init.h>
#include <asm/sgialib.h>
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: tree.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: tree.c,v 1.1 1998/10/18 13:32:10 tsbogend Exp $
*/
#include <linux/init.h>
#include <asm/sgialib.h>
all: baget.a
-image: ../../../vmlinux
- cp -f $< $@
-
O_TARGET := baget.a
-O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o
+O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o wbflush.o
ifeq ($(CONFIG_SERIAL),y)
OX_OBJS += vacserial.o
##################### Baget Loader stuff ########################
-dummy.c:
- touch $@
+image: ../../../vmlinux
+ cp -f $< $@
image.bin: image
$(OBJCOPY) -O binary $< $@
ramdisk.bin:
echo "Dummy ramdisk used. Provide your own if needed !" > $@
+dummy.c:
+ touch $@
+
dummy.o: dummy.c image.bin ramdisk.bin
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJCOPY) --add-section=.vmlinux=image.bin \
balo.h: image
$(NM) $< | awk ' \
- BEGIN { printf "/* DO NOT EDIT THIS FILE */\n" } \
- /kernel_entry/ { printf "#define START 0x%s\n", $$1 } \
- /balo_ramdisk_base/ { printf "#define RAMDISK_BASE 0x%s\n", $$1 } \
- /balo_ramdisk_size/ { printf "#define RAMDISK_SIZE 0x%s\n", $$1 } \
+ BEGIN { printf "/* DO NOT EDIT THIS FILE */\n" } \
+ /_ftext/ { printf "#define LOADADDR 0x%s\n", $$1 } \
+ /kernel_entry/ { printf "#define START 0x%s\n", $$1 } \
+ /balo_ramdisk_base/ { printf "#define RAMDISK_BASE 0x%s\n", $$1 } \
+ /balo_ramdisk_size/ { printf "#define RAMDISK_SIZE 0x%s\n", $$1 } \
' > $@
balo.o: balo.c balo.h
$(CC) $(CFLAGS) -c $<
$(LD) $(LDFLAGS) -T ld.script.balo -o $@ $^
clean:
- rm -f balo.o balo.h dummy.o dummy.c hello.o image.bin image balo_supp.o
- rm -f $(O_OBJS) $(O_TARGET)
+ rm -f balo balo.h dummy.c image image.bin
include $(TOPDIR)/Rules.make
#include <asm/bootinfo.h>
#include <asm/mipsregs.h>
#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#include <asm/baget/baget.h>
-/*
- * Following values are set by BALO into RAM disk buffer parameters
- */
-unsigned long balo_ramdisk_base = 0xBA; /* Signature for BALO ! */
-unsigned long balo_ramdisk_size = 0;
-
-
/*
* Following code is based on routines from 'mm/vmalloc.c'
* Additional parameters ioaddr is needed to iterate across real I/O address.
-/* $Id: bagetIRQ.S,v 1.2 1999/08/18 23:37:42 ralf Exp $
+/* $Id: bagetIRQ.S,v 1.1 1999/01/17 03:49:37 ralf Exp $
* bagetIRQ.S: Interrupt exception dispatch code for Baget/MIPS
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
-/* $Id: balo.c,v 1.1 1999/01/17 03:49:37 ralf Exp $
+/* $Id$
*
* balo.c: BAget LOader
*
#include <asm/baget/baget.h>
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
+irq_cpustat_t irq_stat [NR_CPUS];
unsigned long spurious_count = 0;
/*
-/* $Id: print.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+/* $Id: print.c,v 1.1 1999/01/17 03:49:38 ralf Exp $
*
* print.c: Simple print fascility
*
-# $Id: Makefile,v 1.1 1999/01/17 03:49:40 ralf Exp $
+# $Id$
# Makefile for the Baget/MIPS prom emulator library routines.
#
# Note! Dependencies are done automagically by 'make dep', which also
-/* $Id: time.c,v 1.4 1999/10/09 00:00:57 ralf Exp $
+/* $Id: time.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
* time.c: Baget/MIPS specific time handling details
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
-/* $Id: vacserial.c,v 1.4 1999/10/09 00:00:57 ralf Exp $
+/* $Id: vacserial.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
* vacserial.c: VAC UART serial driver
* This code stealed and adopted from linux/drivers/char/serial.c
* See that for author info
-# $Id: Makefile,v 1.10 1999/10/17 19:55:22 harald Exp $
+# $Id: Makefile,v 1.9 1999/04/07 18:45:23 harald 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
-# $Id: config.in,v 1.42 2000/02/24 00:12:40 ralf Exp $
+# $Id: config.in,v 1.46 2000/03/26 22:59:01 ralf Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
#
# Select some configuration options automatically for certain systems.
#
+unset CONFIG_ARC32
+unset CONFIG_PCI
+unset CONFIG_ISA
unset CONFIG_MIPS_JAZZ
unset CONFIG_VIDEO_G364
define_bool CONFIG_SBUS n
-if [ "$CONFIG_ALGOR_P4032" = "y" -o "$CONFIG_SNI_RM200_PCI" = "y" -o \
- "$CONFIG_DDB5074" = "y" ]; then
+if [ "$CONFIG_ALGOR_P4032" = "y" ]; then
define_bool CONFIG_PCI y
-else
- define_bool CONFIG_PCI n
fi
-if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o "$CONFIG_OLIVETTI_M700" = "y" -o \
- "$CONFIG_SNI_RM200_PCI" = "y" -o "$CONFIG_ACER_PICA_61" = "y" ]; then
- define_bool CONFIG_ISA y
-else
- define_bool CONFIG_ISA n
-fi
-
if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o \
"$CONFIG_OLIVETTI_M700" = "y" ]; then
+ define_bool CONFIG_ARC32 y
define_bool CONFIG_HAVE_IO_PORTS y
- define_bool CONFIG_MIPS_JAZZ y
define_bool CONFIG_FB y
define_bool CONFIG_FB_G364 y
+ define_bool CONFIG_MIPS_JAZZ y
fi
if [ "$CONFIG_ACER_PICA_61" = "y" ]; then
+ define_bool CONFIG_ARC32 y
define_bool CONFIG_HAVE_IO_PORTS y
define_bool CONFIG_MIPS_JAZZ y
fi
+if [ "$CONFIG_SGI_IP22" = "y" ]; then
+ define_bool CONFIG_ARC32 y
+fi
if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then
+ define_bool CONFIG_ARC32 y
define_bool CONFIG_HAVE_IO_PORTS y
fi
if [ "$CONFIG_DDB5074" = "y" ]; then
define_bool CONFIG_HAVE_IO_PORTS y
+ define_bool CONFIG_ISA y
+ define_bool CONFIG_PCI y
+fi
+
+if [ "$CONFIG_ISA" != "y" ]; then
+ define_bool CONFIG_ISA n
+fi
+
+if [ "$CONFIG_PCI" != "y" ]; then
+ define_bool CONFIG_PCI n
fi
endmenu
mainmenu_option next_comment
-comment 'CPU selection'
-
-if [ "$CONFIG_CPU_ADVANCED" = "y" ]; then
- choice 'CPU core' \
- "R3000 CONFIG_CPU_R3000 \
- R4300 CONFIG_CPU_R4300 \
- R4x00 CONFIG_CPU_R4X00 \
- R5000 CONFIG_CPU_R5000 \
- R56x0 CONFIG_CPU_NEVADA \
- R10000 CONFIG_CPU_R10000" R4x00
-
- bool ' ll/sc Instructions available' CONFIG_CPU_HAS_LLSC
- bool ' Writeback Buffer available' CONFIG_CPU_HAS_WB
-else
- choice 'CPU type' \
- "R3000 CONFIG_CPU_R3000 \
- R6000 CONFIG_CPU_R6000 \
- R4300 CONFIG_CPU_R4300 \
- R4x00 CONFIG_CPU_R4X00 \
- R5000 CONFIG_CPU_R5000 \
- R56x0 CONFIG_CPU_NEVADA \
- R8000 CONFIG_CPU_R8000 \
- R10000 CONFIG_CPU_R10000 \
- Advanced CONFIG_CPU_ADVANCED" R4x00
-
- if [ "$CONFIG_CPU_R3000" = "y" ]; then
- if [ "$CONFIG_DECSTATION" = "y" ]; then
- define_bool CONFIG_CPU_HAS_LLSC n
- define_bool CONFIG_CPU_HAS_WB y
- else
- define_bool CONFIG_CPU_HAS_LLSC n
- define_bool CONFIG_CPU_HAS_WB n
- fi
- else
- define_bool CONFIG_CPU_HAS_LLSC y
- define_bool CONFIG_CPU_HAS_WB n
- fi
-fi
+ comment 'CPU selection'
+
+ choice 'CPU type' \
+ "R3000 CONFIG_CPU_R3000 \
+ R6000 CONFIG_CPU_R6000 \
+ R4300 CONFIG_CPU_R4300 \
+ R4x00 CONFIG_CPU_R4X00 \
+ R5000 CONFIG_CPU_R5000 \
+ R56x0 CONFIG_CPU_NEVADA \
+ R8000 CONFIG_CPU_R8000 \
+ R10000 CONFIG_CPU_R10000" R4x00
+
+ bool 'Advanced CPU Config' CONFIG_CPU_ADVANCED
+
+ if [ "$CONFIG_CPU_ADVANCED" = "y" ]; then
+ bool ' ll/sc Instructions available' CONFIG_CPU_HAS_LLSC
+ bool ' Writeback Buffer available' CONFIG_CPU_HAS_WB
+ else
+ if [ "$CONFIG_CPU_R3000" = "y" ]; then
+ if [ "$CONFIG_DECSTATION" = "y" ]; then
+ define_bool CONFIG_CPU_HAS_LLSC n
+ define_bool CONFIG_CPU_HAS_WB y
+ else
+ define_bool CONFIG_CPU_HAS_LLSC n
+ define_bool CONFIG_CPU_HAS_WB n
+ fi
+ else
+ define_bool CONFIG_CPU_HAS_LLSC y
+ define_bool CONFIG_CPU_HAS_WB n
+ fi
+ fi
endmenu
mainmenu_option next_comment
comment 'General setup'
-if [ "$CONFIG_DECSTATION" = "y" -o "$CONFIG_DDB5074" = "y" ]; then
- define_bool CONFIG_CPU_LITTLE_ENDIAN y
-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_DECSTATION" = "y" -o "$CONFIG_DDB5074" = "y" ]; then
+ define_bool CONFIG_CPU_LITTLE_ENDIAN y
+ else
+ bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN
+ fi
-if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then
- define_bool CONFIG_BINFMT_IRIX y
- define_bool CONFIG_FORWARD_KEYBOARD y
-fi
-define_bool CONFIG_BINFMT_AOUT n
-define_bool CONFIG_BINFMT_ELF y
-tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
+ if [ "$CONFIG_PROC_FS" = "y" ]; then
+ define_bool CONFIG_KCORE_ELF y
+ fi
+ define_bool CONFIG_ELF_KERNEL y
-bool 'Networking support' CONFIG_NET
+ if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then
+ bool 'Include IRIX binary compatibility' CONFIG_BINFMT_IRIX
+ bool 'Include forward keyboard' CONFIG_FORWARD_KEYBOARD
+ fi
-source drivers/pci/Config.in
+ define_bool CONFIG_BINFMT_AOUT n
+ define_bool CONFIG_BINFMT_ELF y
+ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
-bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
-if [ "$CONFIG_HOTPLUG" = "y" ]; then
- source drivers/pcmcia/Config.in
-else
- define_bool CONFIG_PCMCIA n
-fi
+ bool 'Networking support' CONFIG_NET
-bool 'System V IPC' CONFIG_SYSVIPC
-bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
-bool 'Sysctl support' CONFIG_SYSCTL
+ if [ "$CONFIG_PCI" = "y" ]; then
+ source drivers/pci/Config.in
+ fi
-if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then
- source drivers/parport/Config.in
-fi
-endmenu
+ bool 'System V IPC' CONFIG_SYSVIPC
+ bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
+ bool 'Sysctl support' CONFIG_SYSCTL
-mainmenu_option next_comment
-comment 'Loadable module support'
-bool 'Enable loadable module support' CONFIG_MODULES
-if [ "$CONFIG_MODULES" = "y" ]; then
- bool ' Set version information on all symbols for modules' CONFIG_MODVERSIONS
- bool ' Kernel module loader' CONFIG_KMOD
-fi
+ source drivers/parport/Config.in
-source drivers/pci/Config.in
+ bool 'Enable loadable module support' CONFIG_MODULES
+ if [ "$CONFIG_MODULES" = "y" ]; then
+ bool ' Set version information on all symbols for modules' CONFIG_MODVERSIONS
+ bool ' Kernel module loader' CONFIG_KMOD
+ fi
+ if [ "$CONFIG_DECSTATION" = "y" ]; then
+ bool 'TURBOchannel support' CONFIG_TC
+ fi
endmenu
-if [ "$CONFIG_DECSTATION" = "y" ]; then
- mainmenu_option next_comment
- comment 'TURBOchannel support'
- bool 'TURBOchannel support' CONFIG_TC
-# if [ "$CONFIG_TC" = "y" ]; then
-# tristate ' MAGMA Parallel port support' CONFIG_PARPORT
-# fi
- endmenu
+if [ "$CONFIG_ISA" = "y" ]; then
+ source drivers/pnp/Config.in
fi
-source drivers/pnp/Config.in
+if [ "$CONFIG_HOTPLUG" = "y" ] ; then
+ source drivers/pcmcia/Config.in
+else
+ define_bool CONFIG_PCMCIA n
+fi
source drivers/block/Config.in
source net/Config.in
fi
-mainmenu_option next_comment
-comment 'ATA/IDE/MFM/RLL support'
+if [ "$CONFIG_DECSTATION" != "n" -a \
+ "$CONFIG_SGI_IP22" != "n" ]; then
+ source drivers/telephony/Config.in
+fi
-tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
+if [ "$CONFIG_SGI_IP22" != "n" -a \
+ "$CONFIG_DECSTATION" != "n" ]; then
-if [ "$CONFIG_IDE" != "n" ]; then
- source drivers/ide/Config.in
-else
- define_bool CONFIG_BLK_DEV_IDE_MODES n
- define_bool CONFIG_BLK_DEV_HD n
+ mainmenu_option next_comment
+ comment 'ATA/IDE/MFM/RLL support'
+
+ tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
+
+ if [ "$CONFIG_IDE" != "n" ]; then
+ source drivers/ide/Config.in
+ else
+ define_bool CONFIG_BLK_DEV_IDE_MODES n
+ define_bool CONFIG_BLK_DEV_HD n
+ fi
+ endmenu
fi
-endmenu
mainmenu_option next_comment
comment 'SCSI support'
tristate 'SCSI support' CONFIG_SCSI
if [ "$CONFIG_SCSI" != "n" ]; then
- if [ "$CONFIG_SGI" = "y" -o "$CONFIG_DECSTATION" = "y" ]; then
- comment ' SCSI support type (disk, tape, CDrom)'
-
- dep_tristate ' SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI
- dep_tristate ' SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI
- dep_tristate ' SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI
- dep_tristate ' SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI
-
- comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs'
-
- bool ' Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN
-
- bool ' Verbose SCSI error reporting' CONFIG_SCSI_CONSTANTS
-
- #mainmenu_option next_comment
- comment 'SCSI low-level drivers'
- if [ "$CONFIG_SGI" = "y" ]; then
- dep_tristate 'SGI wd93 Scsi Driver' CONFIG_SCSI_SGIWD93 $CONFIG_SCSI
- else
- if [ "$CONFIG_TC" = "y" ]; then
- dep_tristate 'DEC NCR53C94 Scsi Driver' CONFIG_SCSI_DECNCR $CONFIG_SCSI
- fi
- dep_tristate 'DEC SII Scsi Driver' CONFIG_SCSI_DECSII $CONFIG_SCSI
- fi
- else
- source drivers/scsi/Config.in
- fi
+ source drivers/scsi/Config.in
fi
endmenu
+if [ "$CONFIG_DECSTATION" != "n" -a \
+ "$CONFIG_SGI_IP22" != "n" ]; then
+ source drivers/i2o/Config.in
+fi
+
if [ "$CONFIG_NET" = "y" ]; then
mainmenu_option next_comment
comment 'Network device support'
bool 'Network device support' CONFIG_NETDEVICES
if [ "$CONFIG_NETDEVICES" = "y" ]; then
- if [ "$CONFIG_SGI" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then
+
+ if [ "$CONFIG_SGI_IP22" != "y" -a \
+ "$CONFIG_DECSTATION" != "y" -a \
+ "$CONFIG_BAGET_MIPS" != "y" ]; then
+
source drivers/net/Config.in
+
+ if [ "$CONFIG_ATM" = "y" ]; then
+ source drivers/atm/Config.in
+ fi
else
- tristate ' Dummy net driver support' CONFIG_DUMMY
- tristate ' SLIP (serial line) support' CONFIG_SLIP
+ tristate 'Dummy net driver support' CONFIG_DUMMY
+ tristate 'SLIP (serial line) support' CONFIG_SLIP
if [ "$CONFIG_SLIP" != "n" ]; then
- bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED
- bool ' Keepalive and linefill' CONFIG_SLIP_SMART
+ bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED
+ bool ' Keepalive and linefill' CONFIG_SLIP_SMART
fi
- tristate ' PPP (point-to-point) support' CONFIG_PPP
+ tristate 'PPP (point-to-point) support' CONFIG_PPP
if [ ! "$CONFIG_PPP" = "n" ]; then
- comment ' CCP compressors for PPP are only built as modules.'
+ comment 'CCP compressors for PPP are only built as modules.'
+ fi
+ if [ "$CONFIG_SGI_IP22" = "y" ]; then
+ bool 'SGI Seeq ethernet controller support' CONFIG_SGISEEQ
+ fi
+ if [ "$CONFIG_DECSTATION" = "y" ]; then
+ bool 'DEC LANCE ethernet controller support' CONFIG_DECLANCE
+ fi
+ if [ "$CONFIG_BAGET_MIPS" = "y" ]; then
+ tristate 'Baget AMD LANCE support' CONFIG_BAGETLANCE
fi
- if [ "$CONFIG_SGI" = "y" ]; then
- bool ' SGI Seeq ethernet controller support' CONFIG_SGISEEQ
- fi
- fi
- if [ "$CONFIG_DECSTATION" = "y" ]; then
- bool ' DEC LANCE ethernet controller support' CONFIG_DECLANCE
- fi
- if [ "$CONFIG_BAGET_MIPS" = "y" ]; then
- tristate ' Baget AMD LANCE support' CONFIG_BAGETLANCE
- tristate ' Baget Backplane Shared Memory support' CONFIG_BAGETBSM
fi
fi
endmenu
fi
-if [ "$CONFIG_SGI" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then
- mainmenu_option next_comment
- # comment 'AX.25 network device drivers'
-
- source drivers/net/hamradio/Config.in
- endmenu
-
+if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then
mainmenu_option next_comment
comment 'ISDN subsystem'
endmenu
fi
-if [ "$CONFIG_DECSTATION" != "y" ]; then
+if [ "$CONFIG_DECSTATION" != "n" -a \
+ "$CONFIG_SGI_IP22" != "n" ]; then
source drivers/char/Config.in
-else
+fi
+
+if [ "$CONFIG_DECSTATION" = "y" ]; then
mainmenu_option next_comment
- comment 'DECstation Character devices'
+ comment 'DECStation Character devices'
bool 'Virtual terminal' CONFIG_VT
if [ "$CONFIG_VT" = "y" ]; then
bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE
fi
tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL
- if [ "$CONFIG_SGI_IP22" = "y" ]; then
- bool 'SGI PROM Console Support' CONFIG_SGI_PROM_CONSOLE
- fi
if [ "$CONFIG_SERIAL" = "y" ]; then
bool 'DZ11 Serial Support' CONFIG_DZ
if [ "$CONFIG_TC" = "y" ]; then
fi
bool 'Keyboard Support' CONFIG_KEYBOARD
bool 'Mouse Support' CONFIG_MOUSE
-# bool 'Enhanced Real Time Clock Support' CONFIG_RTC
+ bool 'Enhanced Real Time Clock Support' CONFIG_RTC
endmenu
fi
-
-#source drivers/misc/Config.in
-
-source fs/Config.in
-
-if [ "$CONFIG_VT" = "y" ]; then
+if [ "$CONFIG_SGI_IP22" = "y" ]; then
mainmenu_option next_comment
- comment 'Console drivers'
- if [ "$CONFIG_SGI_IP22" = "y" ]; then
+ comment 'SGI Character devices'
+ bool 'Virtual terminal' CONFIG_VT
+ if [ "$CONFIG_VT" = "y" ]; then
+ bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE
tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
else
define_bool CONFIG_FONT_8x16 y
fi
- else
+ bool 'SGI PROM Console Support' CONFIG_SGI_PROM_CONSOLE
+ fi
+ bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
+ if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
+ int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256
+ fi
+ endmenu
+fi
+
+source fs/Config.in
+
+if [ "$CONFIG_VT" = "y" ]; then
+ mainmenu_option next_comment
+
+ comment 'Console drivers'
if [ "$CONFIG_DECSTATION" != "y" ]; then
bool 'VGA text console' CONFIG_VGA_CONSOLE
fi
- bool 'Support for frame buffer devices' CONFIG_FB
- source drivers/video/Config.in
- fi
+ bool 'Support for frame buffer devices' CONFIG_FB
+ source drivers/video/Config.in
endmenu
fi
mainmenu_option next_comment
comment 'Kernel hacking'
-#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE
if [ "$CONFIG_MODULES" = "y" ]; then
bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE
#
# Note 2! The CFLAGS definitions are now in the main makefile...
#
-# $Id: Makefile,v 1.1 2000/01/26 00:07:44 ralf Exp $
+# $Id$
#
.S.s:
$(CC) $(CFLAGS) -c $< -o $*.o
O_TARGET = ddb5074.a
-O_OBJS = setup.o irq.o time.o prom.o pci.o int-handler.o nile4.o
+O_OBJS = setup.o irq.o time.o prom.o pci.o pci-dma.o int-handler.o nile4.o
include $(TOPDIR)/Rules.make
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: int-handler.S,v 1.2 2000/01/27 02:06:56 ralf Exp $
+ * $Id: int-handler.S,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
#include <asm/asm.h>
* arch/mips/ddb5074/irq.c -- NEC DDB Vrc-5074 interrupt routines
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* $Id: irq.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
extern asmlinkage void do_IRQ(int irq, struct pt_regs * regs);
-static void no_action(int cpl, void *dev_id, struct pt_regs *regs)
+void no_action(int cpl, void *dev_id, struct pt_regs *regs)
{
}
* arch/mips/ddb5074/nile4.c -- NEC Vrc-5074 Nile 4 support routines
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: nile4.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
+ * $Id$
*/
#include <linux/kernel.h>
--- /dev/null
+/*
+ * Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com>
+ *
+ *
+ * Dynamic DMA mapping support.
+ *
+ * swiped from i386, and cloned for MIPS by Geert.
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+
+void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+ dma_addr_t *dma_handle)
+{
+ void *ret;
+ int gfp = GFP_ATOMIC;
+
+ if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
+ gfp |= GFP_DMA;
+ ret = (void *)__get_free_pages(gfp, get_order(size));
+
+ if (ret != NULL) {
+ memset(ret, 0, size);
+ *dma_handle = virt_to_bus(ret);
+ }
+ return ret;
+}
+
+void pci_free_consistent(struct pci_dev *hwdev, size_t size,
+ void *vaddr, dma_addr_t dma_handle)
+{
+ free_pages((unsigned long)vaddr, get_order(size));
+}
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
* Albert Dorofeev <albert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* $Id: pci.c,v 1.4 2000/02/18 00:02:17 ralf Exp $
*/
nile4_pci_write_config_dword
};
+struct {
+ struct resource ram;
+ struct resource flash;
+ struct resource isa_io;
+ struct resource pci_io;
+ struct resource isa_mem;
+ struct resource pci_mem;
+ struct resource nile4;
+ struct resource boot;
+} ddb5074_resources = {
+ { "RAM", 0x00000000, 0x03ffffff,
+ IORESOURCE_MEM | PCI_BASE_ADDRESS_MEM_TYPE_64 },
+ { "Flash ROM", 0x04000000, 0x043fffff },
+ { "Nile4 ISA I/O", 0x06000000, 0x060fffff },
+ { "Nile4 PCI I/O", 0x06100000, 0x07ffffff },
+ { "Nile4 ISA mem", 0x08000000, 0x08ffffff, IORESOURCE_MEM },
+ { "Nile4 PCI mem", 0x09000000, 0x0fffffff, IORESOURCE_MEM },
+ { "Nile4 ctrl", 0x1fa00000, 0x1fbfffff,
+ IORESOURCE_MEM | PCI_BASE_ADDRESS_MEM_TYPE_64 },
+ { "Boot ROM", 0x1fc00000, 0x1fffffff }
+};
-static void __init pcibios_claim_resources(struct list_head *bus_list)
+static void __init ddb5074_pci_fixup(void)
{
- struct list_head *ln, *dn;
- struct pci_bus *bus;
struct pci_dev *dev;
- int idx;
-
- for (ln = bus_list->next; ln != bus_list; ln = ln->next) {
- bus = pci_bus_b(ln);
- for (dn = bus->devices.next; dn != &bus->devices; dn = dn->next) {
- dev = pci_dev_b(dn);
- for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
- struct resource *r = &dev->resource[idx];
- struct resource *pr;
- if (!r->start)
- continue;
- pr = pci_find_parent_resource(dev, r);
- if (!pr || request_resource(pr, r) < 0) {
- printk(KERN_ERR "PCI: Address space collision on region %d of device %s\n", idx, dev->name);
- /* We probably should disable the region, shouldn't we? */
- }
- }
+
+ pci_for_each_dev(dev) {
+ if (dev->vendor == PCI_VENDOR_ID_NEC &&
+ dev->device == PCI_DEVICE_ID_NEC_NILE4) {
+ /*
+ * The first 64-bit PCI base register should point to the Nile4
+ * control registers. Unfortunately this isn't the case, so we fix
+ * it ourselves. This allows the serial driver to find the UART.
+ */
+ dev->resource[0] = ddb5074_resources.nile4;
+ request_resource(&iomem_resource, &dev->resource[0]);
+ /*
+ * The second 64-bit PCI base register points to the first memory
+ * bank. Unfortunately the address is wrong, so we fix it (again).
+ */
+ dev->resource[2] = ddb5074_resources.ram;
+ request_resource(&iomem_resource, &dev->resource[2]);
+ } else if (dev->vendor == PCI_VENDOR_ID_AL &&
+ dev->device == PCI_DEVICE_ID_AL_M7101) {
+ /*
+ * It's nice to have the LEDs on the GPIO pins available for
+ * debugging
+ */
+ extern struct pci_dev *pci_pmu;
+ u8 t8;
+
+ pci_pmu = dev; /* for LEDs D2 and D3 */
+ /* Program the lines for LEDs D2 and D3 to output */
+ nile4_pci_read_config_byte(dev, 0x7d, &t8);
+ t8 |= 0xc0;
+ nile4_pci_write_config_byte(dev, 0x7d, t8);
+ /* Turn LEDs D2 and D3 off */
+ nile4_pci_read_config_byte(dev, 0x7e, &t8);
+ t8 |= 0xc0;
+ nile4_pci_write_config_byte(dev, 0x7e, t8);
}
- pcibios_claim_resources(&bus->children);
}
}
-
-void pcibios_init(void)
+static void __init pcibios_fixup_irqs(void)
{
- printk("PCI: Probing PCI hardware\n");
- ioport_resource.end = 0x1ffffff;
- pci_scan_bus(0, &nile4_pci_ops, NULL);
- pcibios_claim_resources(&pci_root_buses);
-}
-
-void pcibios_fixup_bus(struct pci_bus *bus)
-{
- struct list_head *dn;
struct pci_dev *dev;
- extern struct pci_dev *pci_pmu; /* for LEDs D2 and D3 */
- int slot_num, func_num;
- u8 t8;
-
- /*
- * FIXME: PMON doesn't autoconfigure the PCI devices
- * For now we just hardcode them for our configuration
- */
- printk("PCI: Configuring PCI devices (hardcoded)\n");
- for (dn = bus->devices.next; dn != &bus->devices; dn = dn->next) {
- dev = pci_dev_b(dn);
+ int slot_num;
+ pci_for_each_dev(dev) {
slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- printk(" Device %2d: ", slot_num);
switch (slot_num) {
case 0:
- printk("[onboard] Acer Labs M1533 Aladdin IV\n");
dev->irq = nile4_to_irq(NILE4_INT_INTE);
break;
case 1:
- printk("[onboard] DEC DC21140\n");
dev->irq = nile4_to_irq(NILE4_INT_INTA);
- dev->resource[0].start = 0x100000;
- dev->resource[0].end = dev->resource[0].start+0x7f;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[0].start);
- dev->resource[1].start = 0x1000000;
- dev->resource[1].end = dev->resource[1].start+0x7f;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[1].start);
break;
- case 2:
- printk("[slot 1] Realtek 8029\n");
+ case 2: /* slot 1 */
dev->irq = nile4_to_irq(NILE4_INT_INTA);
- dev->resource[0].start = 0x800000;
- dev->resource[0].end = dev->resource[0].start+0x1f;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[0].start);
break;
- case 3:
- printk("[slot 2] DEC DC21140 (#2)\n");
+ case 3: /* slot 2 */
dev->irq = nile4_to_irq(NILE4_INT_INTB);
- dev->resource[0].start = 0x1000000;
- dev->resource[0].end = dev->resource[0].start+0x7f;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[0].start);
- dev->resource[1].start = 0x4000000;
- dev->resource[1].end = dev->resource[1].start+0x7f;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[1].start);
break;
- case 4:
- printk("[slot 3] Promise Technology IDE UltraDMA/33");
- printk(" or 3Com 3c905 :-)\n");
+ case 4: /* slot 3 */
dev->irq = nile4_to_irq(NILE4_INT_INTC);
- dev->resource[0].start = 0x1800000;
- dev->resource[0].end = dev->resource[0].start+0x7fffff;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[0].start);
break;
case 5:
- printk("[onboard] NEC Vrc-5074 Nile 4 Host Bridge\n");
/*
* Fixup so the serial driver can use the UART
*/
dev->irq = nile4_to_irq(NILE4_INT_UART);
- dev->resource[0].start = PHYSADDR(NILE4_BASE);
- dev->resource[0].end = dev->resource[0].start+NILE4_SIZE-1;
- dev->resource[0].flags = IORESOURCE_MEM |
- PCI_BASE_ADDRESS_MEM_TYPE_64;
-
- break;
- case 10:
- printk("[onboard] Acer Labs M7101 PMU\n");
- pci_pmu = dev;
- /* Program the lines for LEDs D2 and D3 to output */
- nile4_pci_read_config_byte(dev, 0x7d, &t8);
- t8 |= 0xc0;
- nile4_pci_write_config_byte(dev, 0x7d, t8);
- /* Turn LEDs D2 and D3 off */
- nile4_pci_read_config_byte(dev, 0x7e, &t8);
- t8 |= 0xc0;
- nile4_pci_write_config_byte(dev, 0x7e, t8);
break;
case 13:
- printk("[onboard] Acer Labs M5237 USB\n");
dev->irq = nile4_to_irq(NILE4_INT_INTE);
- dev->resource[0].start = 0x1001000;
- dev->resource[0].end = dev->resource[0].start+0xfff;
- nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
- dev->resource[0].start);
break;
default:
- printk("\n");
break;
}
}
}
-char *pcibios_setup (char *str)
+void __init pcibios_init(void)
{
- return str;
+ printk("PCI: Probing PCI hardware\n");
+ ioport_resource.end = 0x1ffffff; /* 32 MB */
+ iomem_resource.end = 0x1fffffff; /* 512 MB */
+ /* `ram' and `nile4' are requested through the Nile4 pci_dev */
+ request_resource(&iomem_resource, &ddb5074_resources.flash);
+ request_resource(&iomem_resource, &ddb5074_resources.isa_io);
+ request_resource(&iomem_resource, &ddb5074_resources.pci_io);
+ request_resource(&iomem_resource, &ddb5074_resources.isa_mem);
+ request_resource(&iomem_resource, &ddb5074_resources.pci_mem);
+ request_resource(&iomem_resource, &ddb5074_resources.boot);
+
+ pci_scan_bus(0, &nile4_pci_ops, NULL);
+ ddb5074_pci_fixup();
+ pci_assign_unassigned_resources();
+ pci_set_bus_ranges();
+ pcibios_fixup_irqs();
}
-void __init pcibios_update_resource(struct pci_dev *dev, struct resource *root,
- struct resource *res, int resource)
+void __init pcibios_fixup_bus(struct pci_bus *bus)
{
- unsigned long where, size;
- u32 reg;
-
- where = PCI_BASE_ADDRESS_0 + (resource * 4);
- size = res->end - res->start;
- pci_read_config_dword(dev, where, ®);
- reg = (reg & size) | (((u32)(res->start - root->start)) & ~size);
- pci_write_config_dword(dev, where, reg);
+ bus->resource[1] = &ddb5074_resources.pci_mem;
+}
+
+char *pcibios_setup (char *str)
+{
+ return str;
}
void __init pcibios_update_irq(struct pci_dev *dev, int irq)
ranges->mem_end -= bus->resource[1]->start;
}
-int __init pcibios_enable_device(struct pci_dev *dev)
+int pcibios_enable_resources(struct pci_dev *dev)
+{
+ u16 cmd, old_cmd;
+ int idx;
+ struct resource *r;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ old_cmd = cmd;
+ for(idx=0; idx<6; idx++) {
+ r = &dev->resource[idx];
+ if (!r->start && r->end) {
+ printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
+ return -EINVAL;
+ }
+ if (r->flags & IORESOURCE_IO)
+ cmd |= PCI_COMMAND_IO;
+ if (r->flags & IORESOURCE_MEM)
+ cmd |= PCI_COMMAND_MEMORY;
+ }
+ if (cmd != old_cmd) {
+ printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd);
+ }
+ return 0;
+}
+
+int pcibios_enable_device(struct pci_dev *dev)
+{
+ return pcibios_enable_resources(dev);
+}
+
+void pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+ struct resource *res, int resource)
+{
+ u32 new, check;
+ int reg;
+
+ new = res->start | (res->flags & PCI_REGION_FLAG_MASK);
+ if (resource < 6) {
+ reg = PCI_BASE_ADDRESS_0 + 4*resource;
+ } else if (resource == PCI_ROM_RESOURCE) {
+ res->flags |= PCI_ROM_ADDRESS_ENABLE;
+ reg = dev->rom_base_reg;
+ } else {
+ /* Somebody might have asked allocation of a non-standard resource */
+ return;
+ }
+
+ pci_write_config_dword(dev, reg, new);
+ pci_read_config_dword(dev, reg, &check);
+ if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
+ printk(KERN_ERR "PCI: Error while updating region "
+ "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+ new, check);
+ }
+}
+
+void pcibios_align_resource(void *data, struct resource *res,
+ unsigned long size)
{
- printk("pcibios_enable_device for %04x:%04x\n", dev->vendor, dev->device);
- panic("pcibios_enable_device: not yet implemented\n");
+ struct pci_dev *dev = data;
+
+ if (res->flags & IORESOURCE_IO) {
+ unsigned long start = res->start;
+
+ /* We need to avoid collisions with `mirrored' VGA ports
+ and other strange ISA hardware, so we always want the
+ addresses kilobyte aligned. */
+ if (size > 0x100) {
+ printk(KERN_ERR "PCI: I/O Region %s/%d too large"
+ " (%ld bytes)\n", dev->slot_name,
+ dev->resource - res, size);
+ }
+
+ start = (start + 1024 - 1) & ~(1024 - 1);
+ res->start = start;
+ }
}
-void __init pcibios_align_resource(void *data, struct resource *res,
- unsigned long size)
-{}
struct pci_fixup pcibios_fixups[] = {};
* arch/mips/ddb5074/prom.c -- NEC DDB Vrc-5074 PROM routines
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: prom.c,v 1.2 2000/02/14 17:07:36 ralf Exp $
+ * $Id: prom.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
#include <linux/init.h>
* arch/mips/ddb5074/setup.c -- NEC DDB Vrc-5074 setup routines
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: setup.c,v 1.2 2000/02/14 17:07:36 ralf Exp $
+ * $Id: setup.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
#include <linux/config.h>
extern struct rtc_ops ddb_rtc_ops;
+static void (*back_to_prom)(void) = (void (*)(void))0xbfc00000;
+
static void ddb_machine_restart(char *command)
{
u32 t;
- // FIXME: This doesn't seem to work...
- printk("Restarting DDB Vrc-5074...");
/* PCI cold reset */
t = nile4_in32(NILE4_PCICTRL+4);
t |= 0x40000000;
t = nile4_in32(NILE4_CPUSTAT);
t |= 1;
nile4_out32(NILE4_CPUSTAT, t);
- printk("Restart failed!\n");
- do {} while (1);
+ /* Call the PROM */
+ back_to_prom();
}
static void ddb_machine_halt(void)
void __init ddb_setup(void)
{
+ extern int panic_timeout;
+
irq_setup = ddb_irq_setup;
mips_io_port_base = NILE4_PCI_IO_BASE;
isa_slot_offset = NILE4_PCI_MEM_BASE;
_machine_power_off = ddb_machine_power_off;
rtc_ops = &ddb_rtc_ops;
+
+ /* Reboot on panic */
+ panic_timeout = 180;
}
int __init page_is_ram(unsigned long pagenr)
/*
- * arch.mips/ddb5074/time.c -- Timer routines
+ * arch/mips/ddb5074/time.c -- Timer routines
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* $Id*
*/
extern volatile unsigned int *imr; /* address of the interrupt mask register */
extern decint_t dec_interrupt[NR_INTS];
+irq_cpustat_t irq_stat [NR_CPUS];
+
unsigned int local_bh_count[NR_CPUS];
unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
-# $Id: Makefile,v 1.2 2000/02/05 06:47:08 ralf Exp $
+# $Id: Makefile,v 1.1 1999/01/17 03:49:44 ralf Exp $
# Makefile for the DECstation prom monitor library routines
# under Linux.
#
*
* Copyright (C) 1998 Harald Koerfgen
*
- * $Id: init.c,v 1.4 1999/10/09 00:00:58 ralf Exp $
+ * $Id: init.c,v 1.3 1999/08/09 19:43:13 harald Exp $
*/
#include <linux/init.h>
#include <linux/config.h>
*
* Copyright (C) 1998 Harald Koerfgen, Frieder Streffer and Paul M. Antoine
*
- * $Id: memory.c,v 1.4 2000/02/13 20:52:05 harald Exp $
+ * $Id: memory.c,v 1.3 1999/10/09 00:00:58 ralf Exp $
*/
#include <linux/init.h>
#include <linux/config.h>
/*
- * $Id: reset.c,v 1.4 1999/04/11 17:06:16 harald Exp $
+ * $Id: $
*
* Reset a DECstation machine.
*
-/* $Id: rtc-dec.c,v 1.1 1999/01/17 03:49:42 ralf Exp $
+/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 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
#ifdef CONFIG_SERIAL_CONSOLE
#ifdef CONFIG_ZS
-extern long zs_serial_console_init(long, long);
+extern void zs_serial_console_init(void);
#endif
#ifdef CONFIG_DZ
-extern long dz_serial_console_init(long, long);
+extern void dz_serial_console_init(void);
#endif
#endif
#endif
}
+__initcall(rs_init);
+
#endif
#ifdef CONFIG_SERIAL_CONSOLE
/* serial_console_init handles the special case of starting
* up the console on the serial port
*/
-long __init serial_console_init(long kmem_start, long kmem_end)
+void __init serial_console_init(void)
{
#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
if (IOASIC)
- kmem_start = zs_serial_console_init(kmem_start, kmem_end);
+ zs_serial_console_init();
else
- kmem_start = dz_serial_console_init(kmem_start, kmem_end);
+ dz_serial_console_init();
#else
#ifdef CONFIG_ZS
- kmem_start = zs_serial_console_init(kmem_start, kmem_end);
+ zs_serial_console_init();
#endif
#ifdef CONFIG_DZ
- kmem_start = dz_serial_console_init(kmem_start, kmem_end);
+ dz_serial_console_init();
#endif
#endif
-
- return kmem_start;
}
#endif
CONFIG_SGI_IP22=y
# CONFIG_SNI_RM200_PCI is not set
# CONFIG_SBUS is not set
-# CONFIG_PCI is not set
+CONFIG_ARC32=y
# CONFIG_ISA is not set
+# CONFIG_PCI is not set
#
# CPU selection
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_NET=y
-# CONFIG_HOTPLUG is not set
-# CONFIG_PCMCIA is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
#
-# Loadable module support
+# Parallel port support
#
+# CONFIG_PARPORT is not set
CONFIG_MODULES=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
+# CONFIG_PCMCIA is not set
#
# Block devices
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
#
# Additional Block Devices
#
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_RAID15_DANGEROUS is not set
# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
#
# CONFIG_NET_SCHED is not set
-#
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
#
# SCSI support
#
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_DMA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_PPA is not set
-# CONFIG_SCSI_IMM is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_SYM53C416 is not set
# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_NCR53C7xx is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_PCI2000 is not set
# CONFIG_SCSI_PCI2220I is not set
# CONFIG_SCSI_PSI240I is not set
# CONFIG_SCSI_QLOGIC_FAS is not set
-# CONFIG_SCSI_SEAGATE is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_ULTRASTOR is not set
# CONFIG_SCSI_DEBUG is not set
#
# Network device support
#
CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_NET_SB1000 is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-# CONFIG_NET_ETHERNET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_YELLOWFIN is not set
-# CONFIG_ACENIC is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
# CONFIG_SLIP is not set
+# CONFIG_PPP is not set
+CONFIG_SGISEEQ=y
#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# AX.25 network device drivers
-#
-# CONFIG_MKISS is not set
-# CONFIG_6PACK is not set
-# CONFIG_BPQETHER is not set
-# CONFIG_DMASCC is not set
-# CONFIG_SCC is not set
-# CONFIG_BAYCOM_SER_FDX is not set
-# CONFIG_BAYCOM_SER_HDX is not set
-# CONFIG_BAYCOM_PAR is not set
-# CONFIG_BAYCOM_EPP is not set
-# CONFIG_SOUNDMODEM is not set
-# CONFIG_YAM is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
-# Character devices
+# SGI Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SGI_NEWPORT_CONSOLE=y
+CONFIG_FONT_8x16=y
+# CONFIG_SGI_PROM_CONSOLE is not set
# CONFIG_UNIX98_PTYS is not set
-# CONFIG_PRINTER is not set
-# CONFIG_PPDEV is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-CONFIG_MOUSE=y
-CONFIG_PSMOUSE=y
-# CONFIG_82C710_MOUSE is not set
-# CONFIG_PC110_PAD is not set
-
-#
-# Joysticks
-#
-# CONFIG_JOYSTICK 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
-
-#
-# Video For Linux
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_DRM is not set
-# CONFIG_DRM_TDFX is not set
-# CONFIG_AGP is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
#
# File systems
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y
# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_SYSV_FS is not set
+# CONFIG_SYSV_FS_WRITE is not set
# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V3 is not set
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_MOUNT_SUBDIR is not set
+# CONFIG_NCPFS_NDS_DOMAINS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
#
# Partition Types
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
-# CONFIG_MSDOS_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
# CONFIG_NLS is not set
#
# Console drivers
#
-CONFIG_SGI_NEWPORT_CONSOLE=y
-CONFIG_FONT_8x16=y
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_FB is not set
+
+#
+# Frame-buffer support
+#
+# CONFIG_FB is not set
#
# Sound
# SGI devices
#
CONFIG_SGI_SERIAL=y
+# CONFIG_SERIAL_CONSOLE is not set
CONFIG_SGI_DS1286=y
# CONFIG_SGI_NEWPORT_GFX is not set
+#
+# USB support
+#
+# CONFIG_USB is not set
+
#
# Kernel hacking
#
#
-# Automatically generated by make menuconfig: don't edit
+# Automatically generated make config: don't edit
#
#
# CONFIG_OLIVETTI_M700 is not set
# CONFIG_SGI_IP22 is not set
# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_SBUS is not set
+# CONFIG_ISA is not set
+# CONFIG_PCI is not set
#
# CPU selection
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_NET=y
-
-#
-# PCMCIA/CardBus support
-#
-# CONFIG_PCMCIA is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
#
-# Loadable module support
+# Parallel port support
#
+# CONFIG_PARPORT is not set
CONFIG_MODULES=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y
-
-#
-# TURBOchannel support
-#
CONFIG_TC=y
+# CONFIG_PCMCIA is not set
#
-# Plug and Play configuration
+# Block devices
#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
#
-# Block devices
+# Additional Block Devices
#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_IDE is not set
-# CONFIG_BLK_DEV_HD_ONLY is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_RAID15_DANGEROUS is not set
# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_ALIAS is not set
# CONFIG_SYN_COOKIES is not set
+
+#
+# (it is safe to leave these untouched)
+#
# CONFIG_SKB_LARGE is not set
# CONFIG_IPV6 is not set
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
+
+#
+#
+#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_DECNET is not set
# CONFIG_NET_SCHED is not set
#
-# Telephony Support
+# SCSI support
#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
+CONFIG_SCSI=y
#
-# SCSI support
+# SCSI support type (disk, tape, CD-ROM)
#
-CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
+CONFIG_SD_EXTRA_DEVS=40
# CONFIG_CHR_DEV_ST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_DEBUG_QUEUES is not set
# CONFIG_SCSI_MULTI_LUN is not set
CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_DECNCR=y
-# CONFIG_SCSI_DECSII is not set
+# CONFIG_SCSI_LOGGING is not set
#
-# I2O device support
+# SCSI low-level drivers
#
-# 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
+CONFIG_SCSI_DECNCR=y
+# CONFIG_SCSI_DECSII is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_DEBUG is not set
#
# Network device support
CONFIG_DECLANCE=y
#
-# DECstation Character devices
+# DECStation Character devices
#
# CONFIG_VT is not set
CONFIG_SERIAL=y
# CONFIG_UNIX98_PTYS is not set
# CONFIG_KEYBOARD is not set
# CONFIG_MOUSE is not set
+# CONFIG_RTC is not set
#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Filesystems
+# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
-# CONFIG_BFS_FS_WRITE is not set
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_UMSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX4FS_RW is not set
#
# CONFIG_CODA_FS is not set
# CONFIG_NFS_FS is not set
+# CONFIG_NFS_V3 is not set
# CONFIG_ROOT_NFS is not set
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
# CONFIG_LOCKD is not set
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_MOUNT_SUBDIR is not set
+# CONFIG_NCPFS_NDS_DOMAINS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
#
# Partition Types
# CONFIG_SUN_PARTITION is not set
# CONFIG_NLS is not set
+#
+# USB support
+#
+# CONFIG_USB is not set
+
#
# Kernel hacking
#
# CONFIG_OLIVETTI_M700 is not set
CONFIG_SGI_IP22=y
# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_SBUS is not set
+CONFIG_ARC32=y
+# CONFIG_ISA is not set
+# CONFIG_PCI is not set
#
# CPU selection
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_NET=y
-
-#
-# PCMCIA/CardBus support
-#
-# CONFIG_PCMCIA is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
#
-# Loadable module support
+# Parallel port support
#
+# CONFIG_PARPORT is not set
CONFIG_MODULES=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
+# CONFIG_PCMCIA is not set
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_IDE is not set
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_ONLY is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
#
# Additional Block Devices
#
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_RAID15_DANGEROUS is not set
# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
#
# CONFIG_NET_SCHED is not set
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-
#
# SCSI support
#
CONFIG_BLK_DEV_SD=y
CONFIG_SD_EXTRA_DEVS=40
CONFIG_CHR_DEV_ST=y
-CONFIG_ST_EXTRA_DEVS=2
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_SR_EXTRA_DEVS=2
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_DMA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_PPA is not set
-# CONFIG_SCSI_IMM is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_SYM53C416 is not set
# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_NCR53C7xx is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_PCI2000 is not set
# CONFIG_SCSI_PCI2220I is not set
# CONFIG_SCSI_PSI240I is not set
# CONFIG_SCSI_QLOGIC_FAS is not set
-# CONFIG_SCSI_SEAGATE is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_ULTRASTOR is not set
# CONFIG_SCSI_DEBUG is not set
-# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
-
-#
-# 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_SGISEEQ=y
#
-# Character devices
+# SGI Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SGI_NEWPORT_CONSOLE=y
+CONFIG_FONT_8x16=y
+# CONFIG_SGI_PROM_CONSOLE is not set
# CONFIG_UNIX98_PTYS is not set
-# CONFIG_PRINTER is not set
-# CONFIG_PPDEV is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-CONFIG_MOUSE=y
-CONFIG_PSMOUSE=y
-# CONFIG_82C710_MOUSE is not set
-# CONFIG_PC110_PAD is not set
-
-#
-# Joysticks
-#
-# CONFIG_JOYSTICK 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
-
-#
-# Video For Linux
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_DRM is not set
-# CONFIG_DRM_TDFX is not set
-# CONFIG_AGP is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
#
# File systems
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y
# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_SYSV_FS is not set
+# CONFIG_SYSV_FS_WRITE is not set
# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V3 is not set
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_MOUNT_SUBDIR is not set
+# CONFIG_NCPFS_NDS_DOMAINS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
#
# Partition Types
#
-# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
# CONFIG_NLS is not set
#
# Console drivers
#
-CONFIG_SGI_NEWPORT_CONSOLE=y
-CONFIG_FONT_8x16=y
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_FB is not set
+
+#
+# Frame-buffer support
+#
+# CONFIG_FB is not set
#
# Sound
# SGI devices
#
CONFIG_SGI_SERIAL=y
+# CONFIG_SERIAL_CONSOLE is not set
CONFIG_SGI_DS1286=y
# CONFIG_SGI_NEWPORT_GFX is not set
+#
+# USB support
+#
+# CONFIG_USB is not set
+
#
# Kernel hacking
#
-# $Id: Makefile,v 1.6 1999/02/25 21:57:01 tsbogend Exp $
+# $Id: Makefile,v 1.5 1999/01/03 17:50:47 ralf Exp $
#
# Makefile for the Jazz family specific parts of the kernel
#
-/* $Id: floppy-jazz.c,v 1.3 2000/02/24 00:12:40 ralf Exp $
+/* $Id: floppy-jazz.c,v 1.2 1998/10/18 13:18:25 tsbogend 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
-/* $Id: int-handler.S,v 1.15 1999/08/18 23:37:43 ralf Exp $
+/* $Id: int-handler.S,v 1.14 1999/05/01 22:40:34 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
-/* $Id: kbd-jazz.c,v 1.1 1999/01/03 17:50:48 ralf Exp $
+/* $Id: kbd-jazz.c,v 1.1 1998/10/28 12:38:10 ralf Exp $
*
* Low-level hardware access stuff for Jazz family machines.
*
*
* Reset a Jazz machine.
*
- * $Id: reset.c,v 1.3 1998/03/04 08:29:10 ralf Exp $
+ * $Id:$
*/
#include <linux/sched.h>
-/* $Id: rtc-jazz.c,v 1.2 1998/08/26 21:46:38 tsbogend Exp $
+/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 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
-/* $Id: setup.c,v 1.25 2000/01/27 01:05:23 ralf Exp $
+/* $Id: setup.c,v 1.24 1999/10/09 00:00:58 ralf Exp $
*
* Setup pointers to hardware-dependent routines.
*
-# $Id: Makefile,v 1.15 2000/01/26 00:07:44 ralf Exp $
+# $Id: Makefile,v 1.14 1999/10/09 00:00:58 ralf Exp $
#
# Makefile for the Linux/MIPS kernel.
#
-/* $Id: entry.S,v 1.20 2000/02/23 00:41:00 ralf Exp $
+/* $Id: entry.S,v 1.19 1999/12/08 22:05:10 harald Exp $
*
* Low level exception handling
*
*
* Copyright (C) 1997 Ralf Baechle
*
- * $Id: fpe.c,v 1.4 1999/05/01 22:40:35 ralf Exp $
+ * $Id: fpe.c,v 1.3 1998/04/05 11:23:50 ralf Exp $
*/
#include <linux/kernel.h>
#include <linux/module.h>
*
* Copyright (C) 1995 Andreas Busse
*
- * $Id: gdb-low.S,v 1.5 1999/08/18 23:37:43 ralf Exp $
+ * $Id: gdb-low.S,v 1.4 1997/12/01 17:57:26 ralf Exp $
*/
#include <linux/sys.h>
*
* Copyright (C) 1995 Andreas Busse
*
- * $Id: gdb-stub.c,v 1.7 1999/06/12 18:39:28 ulfc Exp $
+ * $Id: gdb-stub.c,v 1.6 1999/05/01 22:40:35 ralf Exp $
*/
/*
-/* $Id: head.S,v 1.17 1999/12/04 03:58:59 ralf Exp $
+/* $Id: head.S,v 1.18 2000/03/03 22:17:07 kevink Exp $
*
* arch/mips/kernel/head.S
*
#include <asm/mipsregs.h>
#include <asm/stackframe.h>
#include <asm/bootinfo.h>
-#include <asm/cpu.h>
.text
/*
eret
END(except_vec0_r4600)
- /* TLB refill, EXL == 0, R4xx0, non-R4600 version */
+ /* TLB refill, EXL == 0, R52x0 "Nevada" version */
.set noreorder
.set noat
LEAF(except_vec0_nevada)
mtc0 k0, CP0_ENTRYLO0 # load it
srl k1, k1, 6 # convert to entrylo1
mtc0 k1, CP0_ENTRYLO1 # load it
- tlbwr # write random tlb entry
- nop
+ nop # QED specified nops
nop
+ tlbwr # write random tlb entry
+ nop # traditional nop
eret # return from trap
END(except_vec0_nevada)
EXPORT(stext)
EXPORT(_stext)
- /* Determine which MIPS variant we are running on. */
- b cpu_probe
- nop
-
-probe_done:
-
/*
* Stack for kernel and init, current variable
*/
bne t0, t1, 1b
sw zero, (t0)
- jal prom_init /* prom_init(argc, argv, envp); */
- nop
-#ifdef CONFIG_SGI_IP22
- jal sgi_sysinit
- nop
-#endif
-
-#ifdef CONFIG_COBALT_MICRO_SERVER
- jal SetUpBootInfo
- nop
-#endif
-
- /*
- * Determine the mmu/cache attached to this machine,
- * then flush the tlb and caches. On the r4xx0
- * variants this also sets CP0_WIRED to zero.
- */
- jal loadmmu
- nop
-
- /* Disable coprocessors */
- mfc0 t0, CP0_STATUS
- li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX)
- and t0, t1
- or t0, ST0_CU0
- mtc0 t0, CP0_STATUS
-
-1: jal start_kernel
+ jal init_arch
nop
- /*
- * Main should never return here, but
- * just in case, we know what happens.
- */
- b 1b
- nop # delay slot
END(kernel_entry)
- /* CPU type probing code, called at Kernel entry. */
- LEAF(cpu_probe)
- mfc0 t0, CP0_PRID
- la t3, mips_cputype
- andi t1, t0, 0xff00
- li t2, PRID_IMP_R2000
- bne t1, t2, 1f
- andi t0, 0x00ff
-
- li t2, CPU_R2000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R3000
- bne t1, t2, 1f
- nop
-
- li t2, PRID_REV_R3000A
- bne t0, t2, 9f
- nop
-
- li t2, CPU_R3000A
- b probe_done
- sw t2, (t3)
-9:
- li t2, CPU_R3000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R6000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R6000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4000
- bne t1, t2, 1f
- nop
-
- li t2, PRID_REV_R4400
- bne t0, t2, 9f
- nop
-
- li t2, CPU_R4400SC
- b probe_done
- sw t2, (t3)
-9:
- li t2, CPU_R4000SC
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R6000A
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R6000A
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R10000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R10000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R8000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R8000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4600
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R4600
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4700
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R4700
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4650
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R4650
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R5000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R5000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_NEVADA
- bne t1, t2, 1f
- nop
-
- li t2, CPU_NEVADA
- b probe_done
- sw t2, (t3)
-1:
- li t2, CPU_UNKNOWN
- sw t2, (t3)
-
- b probe_done
- nop
- END(cpu_probe)
-
/*
* This buffer is reserved for the use of the cache error handler.
*/
-/* $Id: irix5sys.h,v 1.2 1998/08/25 09:14:39 ralf Exp $
+/* $Id: irix5sys.h,v 1.2 1998/08/17 10:16:25 ralf Exp $
*
* irix5sys.h: 32-bit IRIX5 ABI system call table.
*
-/* $Id: irixelf.c,v 1.24 2000/02/04 07:40:23 ralf Exp $
+/* $Id: irixelf.c,v 1.28 2000/03/23 02:25:42 ralf Exp $
*
* irixelf.c: Code to load IRIX ELF executables which conform to
* the MIPS ABI.
#include <linux/shm.h>
#include <linux/personality.h>
#include <linux/elfcore.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#endif
/* First of all, some simple consistency checks */
- if((interp_elf_ex->e_type != ET_EXEC &&
- interp_elf_ex->e_type != ET_DYN) ||
- !elf_check_arch(interp_elf_ex->e_machine) ||
- !interpreter->f_op->mmap) {
+ if ((interp_elf_ex->e_type != ET_EXEC &&
+ interp_elf_ex->e_type != ET_DYN) ||
+ !elf_check_arch(interp_elf_ex->e_machine) ||
+ !interpreter->f_op->mmap) {
printk("IRIX interp has bad e_type %d\n", interp_elf_ex->e_type);
return 0xffffffff;
}
struct elf_phdr *epp,
struct linux_binprm *bprm, int pnum)
{
- mm_segment_t old_fs;
int i;
int retval = -EINVAL;
struct file *file = NULL;
*name = NULL;
for(i = 0; i < pnum; i++, epp++) {
- if(epp->p_type != PT_INTERP)
+ if (epp->p_type != PT_INTERP)
continue;
/* It is illegal to have two interpreters for one executable. */
- if(*name != NULL)
+ if (*name != NULL)
goto out;
*name = (char *) kmalloc((epp->p_filesz +
strlen(IRIX_INTERP_PREFIX)),
GFP_KERNEL);
- if(!*name)
+ if (!*name)
return -ENOMEM;
strcpy(*name, IRIX_INTERP_PREFIX);
retval = kernel_read(bprm->file, epp->p_offset, (*name + 16),
- epp->p_filesz);
- if(retval < 0)
+ epp->p_filesz);
+ if (retval < 0)
goto out;
file = open_exec(*name);
- if(IS_ERR(file)) {
+ if (IS_ERR(file)) {
retval = PTR_ERR(file);
goto out;
}
retval = kernel_read(file, 0, bprm->buf, 128);
- if(retval < 0)
+ if (retval < 0)
goto dput_and_out;
- *interp_elf_ex = *((struct elfhdr *) bprm->buf);
+ *interp_elf_ex = *(struct elfhdr *) bprm->buf;
}
*interpreter = file;
return 0;
fput(interp);
- if(*eentry == 0xffffffff)
+ if (*eentry == 0xffffffff)
return -1;
}
return 0;
&interpreter,
&interp_elf_ex, elf_phdata, bprm,
elf_ex.e_phnum);
- if(retval)
+ if (retval)
goto out_free_file;
- if(elf_interpreter) {
+ if (elf_interpreter) {
retval = verify_irix_interpreter(&interp_elf_ex);
if(retval)
goto out_free_interp;
up(¤t->mm->mmap_sem);
k = elf_phdata->p_vaddr + elf_phdata->p_filesz;
- if(k > elf_bss) elf_bss = k;
-
+ if (k > elf_bss) elf_bss = k;
+
if (error != (elf_phdata->p_vaddr & 0xfffff000)) {
kfree(elf_phdata);
return error;
*
* Miguel de Icaza, 1997.
*
- * $Id: irixinv.c,v 1.4 1999/10/09 00:00:58 ralf Exp $
+ * $Id: irixinv.c,v 1.3 1998/04/05 11:23:51 ralf Exp $
*/
#include <linux/mm.h>
#include <linux/init.h>
-/* $Id: irixioctl.c,v 1.7 1999/09/28 22:25:46 ralf Exp $
+/* $Id: irixioctl.c,v 1.6 1999/02/06 05:12:56 adevries Exp $
* irixioctl.c: A fucking mess...
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: irixsig.c,v 1.14 2000/01/17 03:58:59 ralf Exp $
+ * $Id: irixsig.c,v 1.13 1999/10/09 00:00:58 ralf Exp $
*/
#include <linux/kernel.h>
#include <asm/sni.h>
#include <asm/nile4.h>
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
+
/*
* This contains the irq mask for both 8259A irq controllers, it's an
* int so we can deal with the third PIC in some systems like the RM300.
#include <asm/io.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
+#include <asm/semaphore.h>
#include <asm/sgi/sgihpc.h>
#include <asm/softirq.h>
#include <asm/uaccess.h>
EXPORT_SYMBOL_NOVERS(strpbrk);
EXPORT_SYMBOL(_clear_page);
-EXPORT_SYMBOL(local_bh_count);
-EXPORT_SYMBOL(local_irq_count);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(invalid_pte_table);
+/*
+ * Semaphore stuff
+ */
+EXPORT_SYMBOL(__down_read);
+EXPORT_SYMBOL(__down_write);
+EXPORT_SYMBOL(__rwsem_wake);
+
/*
* Base address of ports for Intel style I/O.
*/
const char *mach_sgi_names[] = GROUP_SGI_NAMES;
const char *mach_cobalt_names[] = GROUP_COBALT_NAMES;
const char *mach_nec_ddb_names[] = GROUP_NEC_DDB_NAMES;
+ const char *mach_baget_names[] = GROUP_BAGET_NAMES;
const char **mach_group_to_name[] = { mach_unknown_names,
mach_jazz_names,
mach_dec_names,
mach_acn_names,
mach_sgi_names,
mach_cobalt_names,
- mach_nec_ddb_names };
+ mach_nec_ddb_names,
+ mach_baget_names };
unsigned int version = read_32bit_cp0_register(CP0_PRID);
int len;
len += sprintf(buffer + len, "unaligned accesses\t: %lu\n",
unaligned_instructions);
len += sprintf(buffer + len, "wait instruction\t: %s\n",
- wait_available ? "yes" : "no");
+ cpu_wait ? "yes" : "no");
len += sprintf(buffer + len, "microsecond timers\t: %s\n",
cyclecounter_available ? "yes" : "no");
len += sprintf(buffer + len, "extra interrupt vector\t: %s\n",
return len;
}
+
+void init_irq_proc(void)
+{
+ /* Nothing, for now. */
+}
while (1) {
while (!current->need_resched)
- if (wait_available)
- __asm__(".set\tmips3\n\t"
- "wait\n\t"
- ".set\tmips0");
+ if (cpu_wait)
+ (*cpu_wait)();
schedule();
check_pgt_cache();
}
-/* $Id: ptrace.c,v 1.18 1999/10/09 00:00:58 ralf Exp $
+/* $Id: ptrace.c,v 1.17 1999/09/28 22:25:47 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
asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
{
struct task_struct *child;
- unsigned int flags;
int res;
extern void save_fp(void*);
res = 0;
goto out;
}
- if (pid == 1) { /* you may not mess with init */
- res = -EPERM;
+ res = -ESRCH;
+ read_lock(&tasklist_lock);
+ child = find_task_by_pid(pid);
+ if (child)
+ get_task_struct(child);
+ read_unlock(&tasklist_lock);
+ if (!child)
goto out;
- }
- if (!(child = find_task_by_pid(pid))) {
- res = -ESRCH;
+
+ res = -EPERM;
+ if (pid == 1) /* you may not mess with init */
goto out;
- }
+
if (request == PTRACE_ATTACH) {
- if (child == current) {
- res = -EPERM;
- goto out;
- }
+ if (child == current)
+ goto out_tsk;
if ((!child->dumpable ||
(current->uid != child->euid) ||
(current->uid != child->suid) ||
(current->gid != child->gid) ||
(!cap_issubset(child->cap_permitted,
current->cap_permitted)) ||
- (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)){
- res = -EPERM;
- goto out;
- }
+ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
+ goto out_tsk;
/* the same process cannot be attached many times */
if (child->flags & PF_PTRACED)
- goto out;
+ goto out_tsk;
child->flags |= PF_PTRACED;
- write_lock_irqsave(&tasklist_lock, flags);
+ write_lock_irq(&tasklist_lock);
if (child->p_pptr != current) {
REMOVE_LINKS(child);
child->p_pptr = current;
SET_LINKS(child);
}
- write_unlock_irqrestore(&tasklist_lock, flags);
+ write_unlock_irq(&tasklist_lock);
send_sig(SIGSTOP, child, 1);
res = 0;
- goto out;
- }
- if (!(child->flags & PF_PTRACED)) {
- res = -ESRCH;
- goto out;
+ goto out_tsk;
}
+ res = -ESRCH;
+ if (!(child->flags & PF_PTRACED))
+ goto out_tsk;
if (child->state != TASK_STOPPED) {
- if (request != PTRACE_KILL) {
- res = -ESRCH;
- goto out;
- }
- }
- if (child->p_pptr != current) {
- res = -ESRCH;
- goto out;
+ if (request != PTRACE_KILL)
+ goto out_tsk;
}
-
+ if (child->p_pptr != current)
+ goto out_tsk;
switch (request) {
case PTRACE_PEEKTEXT: /* read word at location addr. */
case PTRACE_PEEKDATA: {
copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
res = -EIO;
if (copied != sizeof(tmp))
- goto out;
+ break;
res = put_user(tmp,(unsigned long *) data);
goto out;
- }
+ }
/* Read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
res = 0;
if (access_process_vm(child, addr, &data, sizeof(data), 1)
== sizeof(data))
- goto out;
+ break;
res = -EIO;
goto out;
res = -EIO;
break;
}
- goto out;
+ break;
}
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
case PTRACE_CONT: { /* restart after signal. */
- if ((unsigned long) data > _NSIG) {
- res = -EIO;
- goto out;
- }
+ res = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
if (request == PTRACE_SYSCALL)
child->flags |= PF_TRACESYS;
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
wake_up_process(child);
- res = data;
- goto out;
+ res = 0;
+ break;
}
/*
* perhaps it should be put in the status that it wants to
* exit.
*/
- case PTRACE_KILL: {
- if (child->state != TASK_ZOMBIE) {
- child->exit_code = SIGKILL;
- wake_up_process(child);
- }
+ case PTRACE_KILL:
res = 0;
- goto out;
- }
+ if (child->state != TASK_ZOMBIE) /* already dead */
+ break;
+ child->exit_code = SIGKILL;
+ wake_up_process(child);
+ break;
- case PTRACE_DETACH: { /* detach a process that was attached. */
- if ((unsigned long) data > _NSIG) {
- res = -EIO;
- goto out;
- }
+ case PTRACE_DETACH: /* detach a process that was attached. */
+ res = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->exit_code = data;
+ write_lock_irq(&tasklist_lock);
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
SET_LINKS(child);
+ write_unlock_irq(&tasklist_lock);
wake_up_process(child);
res = 0;
- goto out;
- }
+ break;
default:
res = -EIO;
goto out;
}
+out_tsk:
+ free_task_struct(child);
out:
unlock_kernel();
return res;
-/* $Id: r2300_fpu.S,v 1.7 1999/09/28 22:25:47 ralf Exp $
+/* $Id: r2300_fpu.S,v 1.6 1999/08/09 19:43:14 harald Exp $
*
* r2300_fpu.S: Save/restore floating point context for signal handlers.
*
-/* $Id: r2300_switch.S,v 1.9 1999/10/12 17:33:49 harald Exp $
+/* $Id: r2300_switch.S,v 1.8 1999/08/18 23:37:44 ralf Exp $
*
* r2300_switch.S: R2300 specific task switching code.
*
cfc1 t1,fcr31
/* Store the 16 even double precision registers */
-1:
EX(sdc1 $f0,(SC_FPREGS+0)(a0))
EX(sdc1 $f2,(SC_FPREGS+16)(a0))
EX(sdc1 $f4,(SC_FPREGS+32)(a0))
* Restore the 16 even double precision registers
* when cp1 was enabled in the cp0 status register.
*/
-1: EX(ldc1 $f0,(SC_FPREGS+0)(a0))
+ EX(ldc1 $f0,(SC_FPREGS+0)(a0))
EX(ldc1 $f2,(SC_FPREGS+16)(a0))
EX(ldc1 $f4,(SC_FPREGS+32)(a0))
EX(ldc1 $f6,(SC_FPREGS+48)(a0))
-/* $Id: r4k_misc.S,v 1.9 1999/12/04 03:59:00 ralf Exp $
+/* $Id: r4k_misc.S,v 1.8 1999/10/09 00:00:58 ralf Exp $
*
* r4k_misc.S: Misc. exception handling code for r4k.
*
-/* $Id: r4k_switch.S,v 1.10 1999/10/09 00:00:58 ralf Exp $
+/* $Id: r4k_switch.S,v 1.9 1999/08/18 23:37:44 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
* Multi-arch abstraction and asm macros for easier reading:
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: r6000_fpu.S,v 1.6 1999/08/09 19:43:15 harald Exp $
+ * $Id: r6000_fpu.S,v 1.5 1999/05/01 22:40:37 ralf Exp $
*/
#include <asm/asm.h>
#include <asm/fpregdef.h>
-/* $Id: scall_o32.S,v 1.11 2000/02/23 01:33:55 ralf Exp $
+/* $Id: scall_o32.S,v 1.10 2000/02/23 00:41: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
-/* $Id: setup.c,v 1.22 2000/01/27 01:05:23 ralf Exp $
+/* $Id: setup.c,v 1.28 2000/03/13 22:21:44 harald 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
#include <asm/io.h>
#include <asm/stackframe.h>
#include <asm/system.h>
+#include <asm/cpu.h>
#ifdef CONFIG_SGI_IP22
#include <asm/sgialib.h>
#endif
struct mips_cpuinfo boot_cpu_data = { NULL, NULL, 0 };
/*
- * Not all of the MIPS CPUs have the "wait" instruction available. This
- * is set to true if it is available. The wait instruction stops the
- * pipeline and reduces the power consumption of the CPU very much.
+ * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
+ * the implementation of the "wait" feature differs between CPU families. This
+ * points to the function that implements CPU specific wait.
+ * The wait instruction stops the pipeline and reduces the power consumption of
+ * the CPU very much.
*/
-char wait_available;
+void (*cpu_wait)(void) = NULL;
/*
* Do we have a cyclecounter available?
*/
unsigned long isa_slot_offset;
+extern void sgi_sysinit(void);
+extern void SetUpBootInfo(void);
+extern void loadmmu(void);
+extern asmlinkage void start_kernel(void);
+extern int prom_init(int, char **, char **, int *);
+
+/*
+ * Probe whether cpu has config register by trying to play with
+ * alternate cache bit and see whether it matters.
+ * It's used by cpu_probe to distinguish between R3000A and R3081.
+ */
+static inline int cpu_has_confreg(void)
+{
+#ifdef CONFIG_CPU_R3000
+ extern unsigned long r3k_cache_size(unsigned long);
+ unsigned long size1, size2;
+ unsigned long cfg = read_32bit_cp0_register(CP0_CONF);
+
+ size1 = r3k_cache_size(ST0_DE);
+ write_32bit_cp0_register(CP0_CONF, cfg^CONF_AC);
+ size2 = r3k_cache_size(ST0_DE);
+ write_32bit_cp0_register(CP0_CONF, cfg);
+ return size1 != size2;
+#else
+ return 0;
+#endif
+}
+
+static inline void cpu_probe(void)
+{
+ unsigned int prid = read_32bit_cp0_register(CP0_PRID);
+ switch(prid & 0xff00) {
+ case PRID_IMP_R2000:
+ mips_cputype = CPU_R2000;
+ break;
+ case PRID_IMP_R3000:
+ if((prid & 0xff) == PRID_REV_R3000A)
+ if(cpu_has_confreg())
+ mips_cputype = CPU_R3081E;
+ else
+ mips_cputype = CPU_R3000A;
+ else
+ mips_cputype = CPU_R3000;
+ break;
+ case PRID_IMP_R4000:
+ if((prid & 0xff) == PRID_REV_R4400)
+ mips_cputype = CPU_R4400SC;
+ else
+ mips_cputype = CPU_R4000SC;
+ break;
+ case PRID_IMP_R4600:
+ mips_cputype = CPU_R4600;
+ break;
+ case PRID_IMP_R4650:
+ mips_cputype = CPU_R4650;
+ break;
+ case PRID_IMP_R4700:
+ mips_cputype = CPU_R4700;
+ break;
+ case PRID_IMP_R5000:
+ mips_cputype = CPU_R5000;
+ break;
+ case PRID_IMP_NEVADA:
+ mips_cputype = CPU_NEVADA;
+ break;
+ case PRID_IMP_R6000:
+ mips_cputype = CPU_R6000;
+ break;
+ case PRID_IMP_R6000A:
+ mips_cputype = CPU_R6000A;
+ break;
+ case PRID_IMP_R8000:
+ mips_cputype = CPU_R8000;
+ break;
+ case PRID_IMP_R10000:
+ mips_cputype = CPU_R10000;
+ break;
+ default:
+ mips_cputype = CPU_UNKNOWN;
+ }
+}
+
+asmlinkage void __init init_arch(int argc, char **argv, char **envp, int *prom_vec)
+{
+ unsigned int s;
+
+ /* Determine which MIPS variant we are running on. */
+ cpu_probe();
+
+ prom_init(argc, argv, envp, prom_vec);
+
+#ifdef CONFIG_SGI_IP22
+ sgi_sysinit();
+#endif
+#ifdef CONFIG_COBALT_MICRO_SERVER
+ SetUpBootInfo();
+#endif
+
+ /*
+ * Determine the mmu/cache attached to this machine,
+ * then flush the tlb and caches. On the r4xx0
+ * variants this also sets CP0_WIRED to zero.
+ */
+ loadmmu();
+
+ /* Disable coprocessors */
+ s = read_32bit_cp0_register(CP0_STATUS);
+ s &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX);
+ s |= ST0_CU0;
+ write_32bit_cp0_register(CP0_STATUS, s);
+
+ /*
+ * Main should never return here, but
+ * just in case, we know what happens.
+ */
+ for(;;)
+ start_kernel();
+}
+
static void __init default_irq_setup(void)
{
panic("Unknown machtype in init_IRQ");
switch(mips_machgroup)
{
#ifdef CONFIG_BAGET_MIPS
- case MACH_GROUP_UNKNOWN:
+ case MACH_GROUP_BAGET:
baget_setup();
break;
#endif
*memory_start_p = initrd_end;
}
#endif
+
+ paging_init();
+}
+
+void r3081_wait(void)
+{
+ unsigned long cfg = read_32bit_cp0_register(CP0_CONF);
+ write_32bit_cp0_register(CP0_CONF, cfg|CONF_HALT);
+}
+
+void r4k_wait(void)
+{
+ __asm__(".set\tmips3\n\t"
+ "wait\n\t"
+ ".set\tmips0");
}
-/* $Id: signal.c,v 1.25 2000/02/05 06:47:08 ralf Exp $
+/* $Id: signal.c,v 1.24 2000/02/04 07:40:23 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
insn: LOCK_KERNEL; \
la a1, 8f; \
TEXT(#insn); \
- la a1, nosim; \
+ la a0, nosim; \
UNLOCK_KERNEL; \
j done
int error;
char * filename;
- lock_kernel();
filename = getname((char *) (long)regs.regs[4]);
error = PTR_ERR(filename);
if (IS_ERR(filename))
putname(filename);
out:
- unlock_kernel();
return error;
}
SYS(sys_ptrace, 4)
SYS(sys_alarm, 1)
SYS(sys_fstat, 2)
-SYS(sys_ni_syscall, 0)
+SYS(sys_pause, 0)
SYS(sys_utime, 2) /* 4030 */
SYS(sys_ni_syscall, 0)
SYS(sys_ni_syscall, 0)
SYS(sys_lstat64, 3)
SYS(sys_fstat64, 3) /* 4215 */
SYS(sys_pivot_root, 2)
+SYS(sys_mincore, 3)
+SYS(sys_madvise, 3)
-/* $Id: sysirix.c,v 1.24 2000/02/05 06:47:08 ralf Exp $
+/* $Id: sysirix.c,v 1.26 2000/03/12 23:15:33 ralf Exp $
*
* sysirix.c: IRIX system call emulation.
*
int error, base = 0;
char *filename;
- lock_kernel();
if(regs->regs[2] == 1000)
base = 1;
filename = getname((char *) (long)regs->regs[base + 4]);
putname(filename);
out:
- unlock_kernel();
return error;
}
printk("[%s:%ld] Wheee.. irix_statvfs(%s,%p)\n",
current->comm, current->pid, fname, buf);
error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
- if(error)
+ if (error)
goto out;
error = user_path_walk(fname, &nd);
- if (err)
+ if (error)
goto out;
error = vfs_statfs(nd.dentry->d_inode->i_sb, &kbuf);
if (error)
*
* Copyright (C) 1995, 1996, 1997 by Ralf Baechle
*
- * $Id: sysmips.c,v 1.9 2000/02/18 00:24:30 ralf Exp $
+ * $Id: sysmips.c,v 1.8 2000/02/05 06:47:08 ralf Exp $
*/
#include <linux/errno.h>
#include <linux/linkage.h>
{
return -ENOSYS;
}
+
+asmlinkage int sys_pause(void)
+{
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ return -ERESTARTNOHAND;
+}
-/* $Id: traps.c,v 1.27 2000/01/16 01:29:05 ralf Exp $
+/* $Id: traps.c,v 1.28 2000/03/13 10:33:02 raiko 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
* for more details.
*
- * Copyright 1994, 1995, 1996, 1997, 1998 by Ralf Baechle
+ * Copyright (C) 1994 - 1999 by Ralf Baechle
* Modified for R3000 by Paul M. Antoine, 1995, 1996
* Complete output from die() by Ulf Carlsson, 1998
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*/
#include <linux/config.h>
#include <linux/init.h>
__die(str, regs, where, line);
}
+extern const struct exception_table_entry __start___dbe_table[];
+extern const struct exception_table_entry __stop___dbe_table[];
+
+static void __declare_dbe_table(void)
+{
+ __asm__ __volatile__(
+ ".section\t__dbe_table,\"a\"\n\t"
+ ".previous"
+ );
+}
+
+static inline unsigned long
+search_one_table(const struct exception_table_entry *first,
+ const struct exception_table_entry *last,
+ unsigned long value)
+{
+ const struct exception_table_entry *mid;
+ long diff;
+
+ while (first < last) {
+ mid = (last - first) / 2 + first;
+ diff = mid->insn - value;
+ if (diff < 0)
+ first = mid + 1;
+ else
+ last = mid;
+ }
+ return (first == last && first->insn == value) ? first->nextinsn : 0;
+}
+
+#define search_dbe_table(addr) \
+ search_one_table(__start___dbe_table, __stop___dbe_table - 1, (addr))
+
static void default_be_board_handler(struct pt_regs *regs)
{
+ unsigned long new_epc;
+ unsigned long fixup = search_dbe_table(regs->cp0_epc);
+
+ if (fixup) {
+ new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
+ regs->cp0_epc = new_epc;
+ return;
+ }
+
/*
* Assume it would be too dangerous to continue ...
*/
{
unsigned long pc;
unsigned int insn;
- extern void simfp(void*);
+ extern void simfp(unsigned int);
#ifdef CONFIG_MIPS_FPE_MODULE
if (fpe_handler != NULL) {
else
memcpy((void *)KSEG0, &except_vec0_r4000, 0x80);
- /* Cache error vector */
- memcpy((void *)(KSEG0 + 0x100), (void *) KSEG0, 0x80);
+ /* Cache error vector already set above. */
if (vce_available) {
memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000,
memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic,
0x80);
}
-
break;
case CPU_R6000:
case CPU_R2000:
case CPU_R3000:
case CPU_R3000A:
- memcpy((void *)KSEG0, &except_vec0_r2300, 0x80);
- memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80);
- break;
case CPU_R3041:
case CPU_R3051:
case CPU_R3052:
case CPU_R3081:
case CPU_R3081E:
+ memcpy((void *)KSEG0, &except_vec0_r2300, 0x80);
+ memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80);
+ break;
case CPU_R8000:
printk("Detected unsupported CPU type %s.\n",
cpu_names[mips_cputype]);
* for more details.
*
* Copyright (C) 1996, 1998 by Ralf Baechle
- *
- * $Id: unaligned.c,v 1.7 1999/12/04 03:59:00 ralf Exp $
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*
* This file contains exception handler for address error exception with the
* special capability to execute faulting instructions in software. The
-# $Id: Makefile,v 1.12 1999/12/04 03:59:00 ralf Exp $
+# $Id: Makefile,v 1.11 1999/10/17 19:55:22 harald Exp $
#
# Makefile for MIPS-specific library files..
#
-/* $Id: csum_partial.S,v 1.2 1998/05/07 23:44:01 ralf Exp $
+/* $Id: csum_partial.S,v 1.1 1998/05/04 09:12:52 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
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * $Id: csum_partial_copy.c,v 1.3 2000/02/05 06:47:08 ralf Exp $
+ * $Id: csum_partial_copy.c,v 1.2 1998/09/19 19:16:17 ralf Exp $
*/
#include <net/checksum.h>
#include <linux/types.h>
-/* $Id: floppy-no.c,v 1.1 1998/06/30 00:21:54 ralf Exp $
+/* $Id: floppy-no.c,v 1.1 1998/05/07 18:38:32 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
-/* $Id: floppy-std.c,v 1.3 2000/02/24 00:12:40 ralf Exp $
+/* $Id: floppy-std.c,v 1.2 1999/01/04 16:03:51 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
-/* $Id: ide-no.c,v 1.3 1999/06/17 13:25:49 ralf Exp $
+/* $Id: ide-no.c,v 1.2 1998/06/30 00:21:54 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
-/* $Id: ide-std.c,v 1.4 1999/06/17 13:25:49 ralf Exp $
+/* $Id: ide-std.c,v 1.4 1999/06/11 14:29:45 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
-/* $Id: kbd-no.c,v 1.1 1999/01/04 16:03:51 ralf Exp $
+/* $Id: kbd-no.c,v 1.1 1998/10/28 12:38:14 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
-/* $Id: kbd-std.c,v 1.2 1999/06/17 13:25:50 ralf Exp $
+/* $Id: kbd-std.c,v 1.2 1999/06/11 14:29:45 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
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * $Id: memcpy.S,v 1.4 2000/01/27 01:05:23 ralf Exp $
+ * $Id: memcpy.S,v 1.3 1998/07/10 01:14:49 ralf Exp $
*
* Unified implementation of memcpy, memmove and the __copy_user backend.
* For __rmemcpy and memmove an exception is always a kernel bug, therefore
*
* Copyright (C) 1998 by Ralf Baechle
*
- * $Id: memset.S,v 1.1 1998/05/04 09:12:54 ralf Exp $
+ * $Id: memset.S,v 1.2 1998/04/25 17:01:45 ralf Exp $
*/
#include <asm/asm.h>
#include <asm/offset.h>
for(i=first;i<=last;i++)
{
- write_32bit_cp0_register(CP0_INDEX, i);
+ write_32bit_cp0_register(CP0_INDEX, i<<8);
__asm__ __volatile__(
".set\tnoreorder\n\t"
"tlbr\n\t"
-/* $Id: rtc-no.c,v 1.1 1998/06/30 00:21:55 ralf Exp $
+/* $Id: rtc-no.c,v 1.2 1998/06/25 20:19:15 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
-/* $Id: rtc-std.c,v 1.1 1998/06/30 00:21:55 ralf Exp $
+/* $Id: rtc-std.c,v 1.2 1998/06/25 20:19:16 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
-/* $Id: strlen_user.S,v 1.4 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strlen_user.S,v 1.3 1999/08/21 22:19:11 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
-/* $Id: strncpy_user.S,v 1.4 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strncpy_user.S,v 1.3 1999/08/21 22:19:11 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
-/* $Id: strnlen_user.S,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strnlen_user.S,v 1.2 1999/11/19 20:35:21 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
-/* $Id: watch.S,v 1.3 1999/08/21 22:19:11 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: andes.c,v 1.11 2000/02/24 00:12:40 ralf Exp $
+/* $Id: andes.c,v 1.10 2000/02/13 20:52:05 harald Exp $
*
* andes.c: MMU and cache operations for the R10000 (ANDES).
*
-/* $Id: fault.c,v 1.16 2000/02/18 00:24:30 ralf Exp $
+/* $Id: fault.c,v 1.15 2000/02/04 07:40:23 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
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
- {
- int fault = handle_mm_fault(mm, vma, address, write);
- if (fault < 0)
- goto out_of_memory;
- if (!fault)
- goto do_sigbus;
+ switch (handle_mm_fault(mm, vma, address, write)) {
+ case 1:
+ tsk->min_flt++;
+ break;
+ case 2:
+ tsk->maj_flt++;
+ break;
+ case 0:
+ goto do_sigbus;
+ default:
+ goto out_of_memory;
}
up(&mm->mmap_sem);
-/* $Id: init.c,v 1.27 2000/02/23 01:33:56 ralf Exp $
+/* $Id: init.c,v 1.26 2000/02/23 00:41: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
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: loadmmu.c,v 1.15 2000/02/24 00:12:40 ralf Exp $
+ * $Id: loadmmu.c,v 1.17 2000/03/13 10:33:05 raiko Exp $
*/
#include <linux/config.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/bootinfo.h>
-#include <asm/sgialib.h>
/* memory functions */
void (*_clear_page)(void * page);
case CPU_R2000:
case CPU_R3000:
case CPU_R3000A:
+ case CPU_R3081E:
printk("Loading R[23]00 MMU routines.\n");
ld_mmu_r2300();
break;
* Copyright (C) 1998, 2000 Harald Koerfgen
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
*
- * $Id: r2300.c,v 1.15 2000/02/24 00:12:40 ralf Exp $
+ * $Id: r2300.c,v 1.16 2000/03/13 10:33:05 raiko Exp $
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
#include <asm/system.h>
-#include <asm/sgialib.h>
#include <asm/isadep.h>
#include <asm/io.h>
#include <asm/wbflush.h>
"I" (PAGE_SIZE));
}
-static unsigned long __init size_cache(unsigned long ca_flags)
+unsigned long __init r3k_cache_size(unsigned long ca_flags)
{
unsigned long flags, status, dummy, size;
volatile unsigned long *p;
static void __init probe_dcache(void)
{
- dcache_size = size_cache(ST0_DE);
+ dcache_size = r3k_cache_size(ST0_DE);
printk("Primary data cache %dkb, linesize 4 bytes\n",
dcache_size >> 10);
}
static void __init probe_icache(void)
{
- icache_size = size_cache(ST0_DE|ST0_CE);
+ icache_size = r3k_cache_size(ST0_DE|ST0_CE);
printk("Primary instruction cache %dkb, linesize 8 bytes\n",
icache_size >> 10);
}
-/* $Id: r4xx0.c,v 1.30 2000/02/24 01:12:37 ralf Exp $
+/* $Id: r4xx0.c,v 1.29 2000/02/24 00:12:40 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
-# $Id: Makefile,v 1.8 2000/02/05 06:47:08 ralf Exp $
+# $Id: Makefile,v 1.7 1999/05/07 18:00:16 ulfc Exp $
# Makefile for the SGI specific kernel interface routines
# under Linux.
#
-/* $Id: indyIRQ.S,v 1.4 1999/08/18 23:37:45 ralf Exp $
+/* $Id: indyIRQ.S,v 1.3 1998/03/22 23:27:17 ralf Exp $
* indyIRQ.S: Interrupt exception dispatch code for FullHouse and
* Guiness.
*
* Copyright (C) 1998 Ralf Baechle
*/
#include <linux/init.h>
+#include <linux/types.h>
#include <asm/addrspace.h>
#include <asm/sgi/sgihpc.h>
-/* $Id: indy_int.c,v 1.17 2000/02/04 07:40:23 ralf Exp $
+/* $Id: indy_int.c,v 1.18 2000/03/02 02:36:50 ralf Exp $
*
* indy_int.c: Routines for generic manipulation of the INT[23] ASIC
* found on INDY workstations..
#include <asm/sgialib.h>
#include <asm/gdb-stub.h>
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
+
/* #define DEBUG_SGINT */
struct sgi_int2_regs *sgi_i2regs;
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes
*
- * $Id: indy_mc.c,v 1.8 1999/12/06 23:13:20 ralf Exp $
+ * $Id: indy_mc.c,v 1.7 1999/12/04 03:59:00 ralf Exp $
*/
#include <linux/init.h>
#include <linux/kernel.h>
-/* $Id: indy_rtc.c,v 1.2 1999/10/21 00:23:05 ralf Exp $
+/* $Id: indy_rtc.c,v 1.1 1998/06/30 00:21: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
-/* $Id: indy_sc.c,v 1.13 1999/12/04 03:59:00 ralf Exp $
+/* $Id: indy_sc.c,v 1.14 2000/03/25 22:35:07 ralf Exp $
*
* indy_sc.c: Indy cache managment functions.
*
#define SC_SIZE 0x00080000
#define SC_LINE 32
#define CI_MASK (SC_SIZE - SC_LINE)
-#define SC_ROUND(n) ((n) + SC_LINE - 1)
#define SC_INDEX(n) ((n) & CI_MASK)
static inline void indy_sc_wipe(unsigned long first, unsigned long last)
{
+ unsigned long tmp;
+
__asm__ __volatile__("
.set noreorder
.set mips3
.set noat
- mfc0 $2, $12
+ mfc0 %2, $12
li $1, 0x80 # Go 64 bit
mtc0 $1, $12
bne %0, %1, 1b
daddu %0, 32
- mtc0 $2, $12 # Back to 32 bit
+ mtc0 %2, $12 # Back to 32 bit
nop; nop; nop; nop;
.set mips0
.set reorder"
- : /* no output */
- : "r" (first), "r" (last)
+ : "=r" (first), "=r" (last), "=&r" (tmp)
+ : "0" (first), "1" (last)
: "$1");
}
#ifdef DEBUG_CACHE
printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size);
#endif
+
+ if (!size)
+ return;
+
/* Which lines to flush? */
first_line = SC_INDEX(addr);
- if (size <= SC_LINE)
- last_line = SC_INDEX(addr);
- else
- last_line = SC_INDEX(addr + size - 1);
+ last_line = SC_INDEX(addr + size - 1);
__save_and_cli(flags);
if (first_line <= last_line) {
goto out;
}
- /* Cache index wrap around. Due to the way the buddy system works
- this case should not happen. We're prepared to handle it,
- though. */
indy_sc_wipe(first_line, SC_SIZE - SC_LINE);
indy_sc_wipe(0, last_line);
out:
printk("Enabling R4600 SCACHE\n");
#endif
__asm__ __volatile__("
- .set noreorder
- .set mips3
+ .set push
+ .set noreorder
+ .set mips3
mfc0 %2, $12
nop; nop; nop; nop;
li %1, 0x80
nop; nop; nop; nop;
mtc0 %2, $12
nop; nop; nop; nop;
- .set mips0
- .set reorder"
+ .set pop"
: "=r" (tmp1), "=r" (tmp2), "=r" (addr));
}
printk("Disabling R4600 SCACHE\n");
#endif
__asm__ __volatile__("
- .set noreorder
- .set mips3
+ .set push
+ .set noreorder
+ .set mips3
li %0, 0x1
dsll %0, 31
lui %1, 0x9000
nop; nop; nop; nop;
mtc0 %2, $12
nop; nop; nop; nop;
- .set mips2
- .set reorder
- " : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3));
+ .set pop"
+ : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3));
}
static inline int __init indy_sc_probe(void)
void __init indy_sc_init(void)
{
-return;
if (indy_sc_probe()) {
indy_sc_enable();
bcops = &indy_sc_ops;
-/* $Id: indy_timer.c,v 1.18 2000/02/04 07:40:23 ralf Exp $
+/* $Id: indy_timer.c,v 1.17 2000/01/21 22:34:03 ralf Exp $
*
* indy_timer.c: Setting up the clock on the INDY 8254 controller.
*
* Register console.
*/
-long __init sgi_prom_console_init(long kmem_start, long kmem_end)
+void __init sgi_prom_console_init(void )
{
register_console(&sercons);
- return kmem_start;
}
-/* $Id: reset.c,v 1.8 1999/10/21 00:23:05 ralf Exp $
+/* $Id: reset.c,v 1.7 1999/08/11 20:26:51 andrewb Exp $
*
* Reset a SGI.
*
#ifdef CONFIG_REMOTE_DEBUG
extern void rs_kgdb_hook(int);
extern void breakpoint(void);
+static int remote_debug = 0;
#endif
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE)
+#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SGI_PROM_CONSOLE)
extern void console_setup(char *);
#endif
void indy_reboot_setup(void);
void sgi_volume_set(unsigned char);
-static int remote_debug = 0;
-
#define sgi_kh ((struct hpc_keyb *) (KSEG1 + 0x1fbd9800 + 64))
#define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */
* graphics console, it is set to "d" for the first serial
* line and "d2" for the second serial line.
*/
- ctype = prom_getenv("console");
+ ctype = ArcGetEnvironmentVariable("console");
if(*ctype == 'd') {
if(*(ctype+1)=='2')
console_setup ("ttyS1");
#endif
#ifdef CONFIG_SGI_PROM_CONSOLE
- console_setup("ttyS0", NULL);
+ console_setup("ttyS0");
#endif
-
- sgi_volume_set(simple_strtoul(prom_getenv("volume"), NULL, 10));
+
+ sgi_volume_set(simple_strtoul(ArcGetEnvironmentVariable("volume"), NULL, 10));
#ifdef CONFIG_VT
#ifdef CONFIG_SGI_NEWPORT_CONSOLE
init_vino();
#endif
}
+__initcall(rs_init);
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: system.c,v 1.9 1999/10/21 00:23:05 ralf Exp $
+ * $Id: system.c,v 1.8 1999/10/09 00:00:59 ralf Exp $
*/
#include <linux/init.h>
#include <linux/kernel.h>
-/* $Id: time.c,v 1.3 1999/10/09 00:00:59 ralf Exp $
+/* $Id: time.c,v 1.2 1998/04/05 11:24:00 ralf Exp $
* time.c: Generic SGI time_init() code, this will dispatch to the
* appropriate per-architecture time/counter init code.
*
-# $Id: Makefile,v 1.4 2000/02/18 00:24:30 ralf Exp $
+# $Id: Makefile,v 1.3 1999/01/04 16:03:57 ralf Exp $
#
# Makefile for the SNI specific part of the kernel
#
-/* $Id: dma.c,v 1.2 2000/02/24 00:12:41 ralf Exp $
+/* $Id: dma.c,v 1.1 2000/02/18 00:24:30 ralf Exp $
*
* Dynamic DMA mapping support.
*
-/* $Id: int-handler.S,v 1.5 1999/08/18 23:37:46 ralf Exp $
+/* $Id: int-handler.S,v 1.4 1999/01/04 16:03:58 ralf Exp $
*
* SNI RM200 PCI specific interrupt handler code.
*
-/* $Id: io.c,v 1.5 1999/10/09 00:00:59 ralf Exp $
+/* $Id: io.c,v 1.4 1999/08/18 23:37:46 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
-/* $Id: pci.c,v 1.10 2000/02/05 06:47:09 ralf Exp $
+/* $Id: pci.c,v 1.9 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
-/* $Id: pcimt_scache.c,v 1.5 1999/10/09 00:00:59 ralf Exp $
+/* $Id: pcimt_scache.c,v 1.4 1999/01/04 16:03:59 ralf Exp $
*
* arch/mips/sni/pcimt_scache.c
*
-/* $Id: setup.c,v 1.14 2000/01/27 01:05:23 ralf Exp $
+/* $Id: setup.c,v 1.13 1999/12/04 03:59:00 ralf Exp $
*
* Setup pointers to hardware-dependent routines.
*
# Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
# Copyright (C) 1997 Ralf Baechle (ralf@gnu.ai.mit.edu)
#
-# $Id: Makefile,v 1.2 1997/12/01 17:57:41 ralf Exp $
+# $Id: Makefile,v 1.2 1997/09/23 06:23:49 ralf Exp $
#
TARGET := $(TOPDIR)/include/asm-$(ARCH)/offset.h
-/* $Id: offset.c,v 1.12 1999/10/09 00:00:59 ralf Exp $
+/* $Id: offset.c,v 1.11 1999/09/28 22:25:50 ralf Exp $
*
* offset.c: Calculate pt_regs and task_struct offsets.
*
-# $Id: Makefile,v 1.6 2000/01/29 01:41:59 ralf Exp $
+# $Id: Makefile,v 1.5 2000/01/21 22:34:03 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
-# $Id: Makefile,v 1.3 2000/01/17 23:32:46 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/20 21:13:32 ralf Exp $
#
# Makefile for the ARC prom monitor library routines under Linux.
#
-/* $Id: cmdline.c,v 1.2 1999/11/19 23:29:05 ralf Exp $
+/* $Id: cmdline.c,v 1.2 1999/10/19 20:51:44 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
-/* $Id: console.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: console.c,v 1.3 1999/10/19 20:51:44 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
-/* $Id: env.c,v 1.4 1999/11/19 23:29:05 ralf Exp $
+/* $Id: env.c,v 1.4 1999/10/19 20:51:44 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
-/* $Id: file.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: file.c,v 1.3 1999/10/19 20:51:44 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
-/* $Id: identify.c,v 1.5 2000/01/17 23:32:46 ralf Exp $
+/* $Id: identify.c,v 1.5 1999/11/19 20:35:21 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
-/* $Id: misc.c,v 1.4 2000/01/17 23:32:46 ralf Exp $
+/* $Id: misc.c,v 1.2 1999/08/21 21:42:59 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
-/* $Id: printf.c,v 1.2 1999/11/19 23:29:05 ralf Exp $
+/* $Id: printf.c,v 1.1 1999/08/20 21:13:33 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
-/* $Id: salone.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: salone.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
*
* Routines to load into memory and execute stand-along program images using
* ARCS PROM firmware.
-/* $Id: time.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: time.c,v 1.2 1999/08/21 21:42:59 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
-/* $Id: tree.c,v 1.4 1999/11/19 23:29:05 ralf Exp $
+/* $Id: tree.c,v 1.3 1999/09/27 16:01:37 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
-# $Id: Makefile,v 1.2 1999/12/04 03:59:00 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/18 21:46:52 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
-# $Id: config.in,v 1.14 2000/02/18 11:06:20 ulfc Exp $
+# $Id: config.in,v 1.19 2000/03/27 01:44:45 ralf Exp $
#
# For a description of the syntax of this configuration file,
# see the Configure script.
if [ "$CONFIG_SGI_IP27" = "y" ]; then
bool ' IP27 N-Mode' CONFIG_SGI_SN0_N_MODE
bool ' Discontiguous Memory Support' CONFIG_DISCONTIGMEM
+ bool ' Multi-Processing support (Experimental)' CONFIG_SMP
#bool ' IP27 XXL' CONFIG_SGI_SN0_XXL
fi
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool 'Symmetric Multi-Processing support' CONFIG_SMP
-fi
endmenu
#
# Select some configuration options automatically based on user selections
#
-unset CONFIG_BOOT_ELF32
-unset CONFIG_BOOT_ELF64
unset CONFIG_ARC32
unset CONFIG_ARC64
+unset CONFIG_BINFMT_ELF32
unset CONFIG_BOARD_SCACHE
+unset CONFIG_BOOT_ELF32
+unset CONFIG_BOOT_ELF64
unset CONFIG_COHERENT_IO
-unset CONFIG_BINFMT_ELF32
-
-define_bool CONFIG_ISA n
-define_bool CONFIG_SBUS n
+unset CONFIG_ISA
+unset CONFIG_PCI
if [ "$CONFIG_SGI_IP22" = "y" ]; then
define_bool CONFIG_BOOT_ELF32 y
define_bool CONFIG_COHERENT_IO y
define_bool CONFIG_PCI y
define_bool CONFIG_QL_ISP_A64 y
-else
+fi
+
+if [ "$CONFIG_ISA" != "y" ]; then
+ define_bool CONFIG_ISA n
+fi
+
+if [ "$CONFIG_PCI" != "y" ]; then
define_bool CONFIG_PCI n
fi
+define_bool CONFIG_SBUS n
+
mainmenu_option next_comment
comment 'CPU selection'
tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
+ else
+ define_bool CONFIG_FONT_8x16 y
fi
fi
endmenu
CONFIG_SGI_IP27=y
# CONFIG_SGI_SN0_N_MODE is not set
# CONFIG_DISCONTIGMEM is not set
-# CONFIG_ISA is not set
-# CONFIG_SBUS is not set
+# CONFIG_SMP is not set
CONFIG_BOOT_ELF64=y
CONFIG_ARC64=y
CONFIG_COHERENT_IO=y
CONFIG_PCI=y
CONFIG_QL_ISP_A64=y
+# CONFIG_ISA is not set
+# CONFIG_SBUS is not set
#
# CPU selection
# CONFIG_PCMCIA is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_SYSCTL is not set
+CONFIG_SYSCTL=y
CONFIG_BINFMT_ELF=y
CONFIG_MIPS32_COMPAT=y
CONFIG_BINFMT_ELF32=y
#
# Loadable module support
#
-# CONFIG_MODULES is not set
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
CONFIG_PCI_NAMES=y
#
#
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_RAID15_DANGEROUS is not set
# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_DMA is not set
CONFIG_SCSI_QLOGIC_ISP=y
# CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_SEAGATE is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_ULTRASTOR is not set
#
# I2O device support
# CONFIG_DRM is not set
# CONFIG_DRM_TDFX is not set
-#
-# USB support
-#
-# CONFIG_USB is not set
-
#
# File systems
#
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_SYSV_FS is not set
+# CONFIG_SYSV_FS_WRITE is not set
# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_MOUNT_SUBDIR is not set
+# CONFIG_NCPFS_NDS_DOMAINS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
#
# Partition Types
# CONFIG_MAC_PARTITION is not set
# CONFIG_MSDOS_PARTITION is not set
CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
# CONFIG_NLS is not set
CONFIG_KCORE_ELF=y
#
# CONFIG_SOUND is not set
+#
+# USB support
+#
+# CONFIG_USB is not set
+
#
# Kernel hacking
#
CONFIG_CROSSCOMPILE=y
+# CONFIG_MIPS_FPE_MODULE is not set
# CONFIG_REMOTE_DEBUG is not set
-CONFIG_MAGIC_SYSRQ=y
+# CONFIG_MAGIC_SYSRQ is not set
CONFIG_ARC32=y
CONFIG_BOARD_SCACHE=y
CONFIG_ARC_MEMORY=y
+# CONFIG_ISA is not set
+# CONFIG_PCI is not set
+# CONFIG_SBUS is not set
#
# CPU selection
#
# CONFIG_CPU_LITTLE_ENDIAN is not set
CONFIG_NET=y
-
-#
-# PCMCIA/CardBus support
-#
+# CONFIG_HOTPLUG is not set
# CONFIG_PCMCIA is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_SYSCTL is not set
+CONFIG_SYSCTL=y
CONFIG_BINFMT_ELF=y
# CONFIG_MIPS32_COMPAT is not set
# CONFIG_BINFMT_MISC is not set
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_IDE is not set
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_ONLY is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
#
# Additional Block Devices
#
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_RAID15_DANGEROUS is not set
# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
#
# Telephony Support
# CONFIG_PHONE is not set
# CONFIG_PHONE_IXJ is not set
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
#
# SCSI support
#
# 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_ARCNET is not set
# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_SB1000 is not set
# CONFIG_NET_RADIO is not set
#
-# Token Ring driver support
+# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_DRM is not set
# CONFIG_DRM_TDFX is not set
-#
-# USB support
-#
-# CONFIG_USB is not set
-
#
# File systems
#
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_SYSV_FS is not set
+# CONFIG_SYSV_FS_WRITE is not set
# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_MOUNT_SUBDIR is not set
+# CONFIG_NCPFS_NDS_DOMAINS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
#
# Partition Types
# Console drivers
#
CONFIG_SGI_NEWPORT_CONSOLE=y
+CONFIG_FONT_8x16=y
CONFIG_KCORE_ELF=y
#
# CONFIG_SGI_SERIAL is not set
CONFIG_SGI_DS1286=y
+#
+# USB support
+#
+# CONFIG_USB is not set
+
#
# Kernel hacking
#
CONFIG_SGI_IP27=y
# CONFIG_SGI_SN0_N_MODE is not set
# CONFIG_DISCONTIGMEM is not set
+# CONFIG_SMP is not set
CONFIG_BOOT_ELF64=y
CONFIG_ARC64=y
CONFIG_COHERENT_IO=y
CONFIG_PCI=y
CONFIG_QL_ISP_A64=y
+# CONFIG_ISA is not set
+# CONFIG_SBUS is not set
#
# CPU selection
# CONFIG_CPU_LITTLE_ENDIAN is not set
CONFIG_NET=y
CONFIG_PCI_NAMES=y
-
-#
-# PCMCIA/CardBus support
-#
+# CONFIG_HOTPLUG is not set
# CONFIG_PCMCIA is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_SYSCTL is not set
+CONFIG_SYSCTL=y
CONFIG_BINFMT_ELF=y
CONFIG_MIPS32_COMPAT=y
CONFIG_BINFMT_ELF32=y
#
# Loadable module support
#
-# CONFIG_MODULES is not set
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
CONFIG_PCI_NAMES=y
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_IDE is not set
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_ONLY is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
#
# Additional Block Devices
#
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_RAID15_DANGEROUS is not set
# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
#
# Telephony Support
# CONFIG_PHONE is not set
# CONFIG_PHONE_IXJ is not set
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
#
# SCSI support
#
CONFIG_BLK_DEV_SD=y
CONFIG_SD_EXTRA_DEVS=40
# CONFIG_CHR_DEV_ST is not set
-CONFIG_ST_EXTRA_DEVS=2
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
#
# SCSI low-level drivers
#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_7000FASST is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_DMA is not set
CONFIG_SCSI_QLOGIC_ISP=y
# CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_SEAGATE is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_ULTRASTOR is not set
#
# I2O device support
#
# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_SB1000 is not set
# CONFIG_NET_VENDOR_RACAL is not set
# CONFIG_DEPCA is not set
# CONFIG_NET_ISA is not set
-# CONFIG_NET_EISA is not set
+# CONFIG_NET_PCI is not set
# CONFIG_NET_POCKET is not set
#
# CONFIG_NET_RADIO is not set
#
-# Token Ring driver support
+# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_DRM_TDFX is not set
#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Filesystems
+# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX4FS_RW is not set
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_MOUNT_SUBDIR is not set
+# CONFIG_NCPFS_NDS_DOMAINS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
#
# Partition Types
#
-# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
# CONFIG_NLS is not set
CONFIG_KCORE_ELF=y
#
# CONFIG_SOUND is not set
+#
+# USB support
+#
+# CONFIG_USB is not set
+
#
# Kernel hacking
#
CONFIG_CROSSCOMPILE=y
+# CONFIG_MIPS_FPE_MODULE is not set
# CONFIG_REMOTE_DEBUG is not set
-CONFIG_MAGIC_SYSRQ=y
+# CONFIG_MAGIC_SYSRQ is not set
OX_OBJS := mips64_ksyms.o
ifdef CONFIG_MIPS32_COMPAT
-O_OBJS += linux32.o scall_o32.o signal32.o
+O_OBJS += linux32.o scall_o32.o signal32.o ioctl32.o
endif
ifdef CONFIG_BINFMT_ELF32
O_OBJS += binfmt_elf32.o
endif
+ifdef CONFIG_SMP
+O_OBJS += smp.o
+endif
+
clean:
include $(TOPDIR)/Rules.make
-/* $Id: binfmt_elf32.c,v 1.2 2000/01/17 23:32:46 ralf Exp $
+/* $Id: binfmt_elf32.c,v 1.1 1999/11/24 06:56:13 ralf Exp $
*
* Support for 32-bit Linux/MIPS ELF binaries.
*
-/* $Id: branch.c,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: branch.c,v 1.1 1999/10/09 20:55:05 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
* Copyright (C) 1999, 2000 Silicon Graphics
*/
#include <linux/config.h>
+
#include <asm/asm.h>
#include <asm/regdef.h>
#include <asm/mipsregs.h>
FEXPORT(ret_from_sys_call)
FEXPORT(ret_from_irq)
-#ifdef CONFIG_SMP
-#error Barffff...
-#else
la t1, softirq_state
+#ifdef CONFIG_SMP
+ lwu t0, TASK_PROCESSOR($28)
+ dsll t0, t0, 5
+ daddu t1, t0
#endif
lw t0, 0 (t1)
lw t1, 4 (t1) # unused delay slot
-/* $Id: head.S,v 1.4 2000/01/25 01:35:05 ralf Exp $
+/* $Id: head.S,v 1.6 2000/03/27 21:05:04 ulfc 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
#include <asm/mipsregs.h>
#include <asm/stackframe.h>
+#define ARC64_TWIDDLE_PC \
+#ifdef CONFIG_ARC64 \
+ /* We get launched at a XKPHYS address but the kernel is linked to \
+ run at a KSEG0 address, so jump there. */ \
+ la t0, 1f \
+ jr t0 \
+1: \
+#endif
+
.text
EXPORT(stext) # used for profiling
NESTED(kernel_entry, 16, sp) # kernel entry point
-#ifdef CONFIG_ARC64
- /* We get launched at a XKPHYS address but the kernel is linked to
- run at a KSEG0 address, so jump there. */
- la t0, 1f
- jr t0
-1:
-#endif
+ ARC64_TWIDDLE_PC
ori sp, 0xf # align stack on 16 byte.
xori sp, 0xf
CLI # disable interrupts
mfc0 t0, CP0_STATUS
- li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3)
+ /*
+ * On IP27, I am seeing the TS bit set when the
+ * kernel is loaded. Maybe because the kernel is
+ * in ckseg0 and not xkphys? Clear it anyway ...
+ */
+ li t1, ~(ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3)
and t0, t1
- or t0, (ST0_CU0|ST0_KX|ST0_SX)
- mtc0 t0, CP0_STATUS
+ or t0, (ST0_CU0|ST0_KX|ST0_SX|ST0_FR) # Bogosity: cu0 indicates kernel
+ mtc0 t0, CP0_STATUS # thread in copy_thread.
la $28, init_task_union # init current pointer
daddiu t0, $28, KERNEL_STACK_SIZE-32
sd t0, kernelsp
dsubu sp, t0, 4*SZREG # init stack pointer
-
+ move t0, $28
+#ifdef CONFIG_SMP
+ mtc0 t0, CP0_WATCHLO
+ dsrl32 t0, t0, 0
+ mtc0 t0, CP0_WATCHHI
+#endif
jal start_kernel
1: b 1b # just in case ...
END(kernel_entry)
+NESTED(bootstrap, 16, sp)
+ ARC64_TWIDDLE_PC
+ CLI
+ mfc0 t0, CP0_STATUS
+ li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3)
+ and t0, t1
+ or t0, (ST0_CU0|ST0_KX|ST0_SX|ST0_FR) # Bogosity: cu0 indicates kernel
+ mtc0 t0, CP0_STATUS # thread in copy_thread.
+ jal cboot
+ END(bootstrap)
+
__FINIT
.comm kernelsp, 8, 8 # current stackpointer
- .comm current_pgd, 8, 8 # current page tables
#define PAGE_SIZE 0x1000
page swapper_pg_dir, 1
page invalid_pte_table, 1
page invalid_pmd_table, 1
+ page empty_bad_page_table, 1
page empty_bad_page
- page empty_bad_page_table
--- /dev/null
+/* $Id: ioctl32.c,v 1.1 2000/04/05 00:43:25 ulfc Exp $
+ * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
+ *
+ * Copyright (C) 2000 Silicon Graphics, Inc.
+ * Written by Ulf Carlsson (ulfc@engr.sgi.com)
+ *
+ * Mostly from the sparc64 ioctl32 implementation.
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/file.h>
+#include <linux/vt.h>
+#include <linux/kd.h>
+#include <linux/netdevice.h>
+#include <linux/route.h>
+#include <asm/types.h>
+#include <asm/uaccess.h>
+
+#define A(__x) ((unsigned long)(__x))
+
+long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
+
+struct timeval32 {
+ int tv_sec;
+ int tv_usec;
+};
+
+#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
+#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
+#define EXT2_IOC32_GETVERSION _IOR('v', 1, int)
+#define EXT2_IOC32_SETVERSION _IOW('v', 2, int)
+
+static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct timeval32 *up = (struct timeval32 *)arg;
+ struct timeval ktv;
+ mm_segment_t old_fs = get_fs();
+ int err;
+
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, cmd, (unsigned long)&ktv);
+ set_fs(old_fs);
+ if(!err) {
+ err = put_user(ktv.tv_sec, &up->tv_sec);
+ err |= __put_user(ktv.tv_usec, &up->tv_usec);
+ }
+ return err;
+}
+
+struct ifmap32 {
+ unsigned int mem_start;
+ unsigned int mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+};
+
+struct ifreq32 {
+#define IFHWADDRLEN 6
+#define IFNAMSIZ 16
+ union {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap32 ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ __kernel_caddr_t32 ifru_data;
+ } ifr_ifru;
+};
+
+struct ifconf32 {
+ int ifc_len; /* size of buffer */
+ __kernel_caddr_t32 ifcbuf;
+};
+
+static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct ireq32 *uir32 = (struct ireq32 *)arg;
+ struct net_device *dev;
+ struct ifreq32 ifr32;
+
+ if (copy_from_user(&ifr32, uir32, sizeof(struct ifreq32)))
+ return -EFAULT;
+
+ read_lock(&dev_base_lock);
+ dev = __dev_get_by_index(ifr32.ifr_ifindex);
+ if (!dev) {
+ read_unlock(&dev_base_lock);
+ return -ENODEV;
+ }
+
+ strcpy(ifr32.ifr_name, dev->name);
+ read_unlock(&dev_base_lock);
+
+ if (copy_to_user(uir32, &ifr32, sizeof(struct ifreq32)))
+ return -EFAULT;
+
+ return 0;
+}
+
+static inline int dev_ifconf(unsigned int fd, unsigned int cmd,
+ unsigned long arg)
+{
+ struct ioconf32 *uifc32 = (struct ioconf32 *)arg;
+ struct ifconf32 ifc32;
+ struct ifconf ifc;
+ struct ifreq32 *ifr32;
+ struct ifreq *ifr;
+ mm_segment_t old_fs;
+ int len;
+ int err;
+
+ if (copy_from_user(&ifc32, uifc32, sizeof(struct ifconf32)))
+ return -EFAULT;
+
+ if(ifc32.ifcbuf == 0) {
+ ifc32.ifc_len = 0;
+ ifc.ifc_len = 0;
+ ifc.ifc_buf = NULL;
+ } else {
+ ifc.ifc_len = ((ifc32.ifc_len / sizeof (struct ifreq32))) *
+ sizeof (struct ifreq);
+ ifc.ifc_buf = kmalloc (ifc.ifc_len, GFP_KERNEL);
+ if (!ifc.ifc_buf)
+ return -ENOMEM;
+ }
+ ifr = ifc.ifc_req;
+ ifr32 = (struct ifreq32 *)A(ifc32.ifcbuf);
+ len = ifc32.ifc_len / sizeof (struct ifreq32);
+ while (len--) {
+ if (copy_from_user(ifr++, ifr32++, sizeof (struct ifreq32))) {
+ err = -EFAULT;
+ goto out;
+ }
+ }
+
+ old_fs = get_fs();
+ set_fs (KERNEL_DS);
+ err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)&ifc);
+ set_fs (old_fs);
+ if (err)
+ goto out;
+
+ ifr = ifc.ifc_req;
+ ifr32 = (struct ifreq32 *)A(ifc32.ifcbuf);
+ len = ifc.ifc_len / sizeof (struct ifreq);
+ ifc32.ifc_len = len * sizeof (struct ifreq32);
+
+ while (len--) {
+ if (copy_to_user(ifr32++, ifr++, sizeof (struct ifreq32))) {
+ err = -EFAULT;
+ goto out;
+ }
+ }
+
+ if (copy_to_user(uifc32, &ifc32, sizeof(struct ifconf32))) {
+ err = -EFAULT;
+ goto out;
+ }
+out:
+ if(ifc.ifc_buf != NULL)
+ kfree (ifc.ifc_buf);
+ return err;
+}
+
+static inline int dev_ifsioc(unsigned int fd, unsigned int cmd,
+ unsigned long arg)
+{
+ struct ifreq32 *uifr = (struct ifreq32 *)arg;
+ struct ifreq ifr;
+ mm_segment_t old_fs;
+ int err;
+
+ switch (cmd) {
+ case SIOCSIFMAP:
+ err = copy_from_user(&ifr, uifr, sizeof(ifr.ifr_name));
+ err |= __get_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start));
+ err |= __get_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end));
+ err |= __get_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr));
+ err |= __get_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq));
+ err |= __get_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma));
+ err |= __get_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port));
+ if (err)
+ return -EFAULT;
+ break;
+ default:
+ if (copy_from_user(&ifr, uifr, sizeof(struct ifreq32)))
+ return -EFAULT;
+ break;
+ }
+ old_fs = get_fs();
+ set_fs (KERNEL_DS);
+ err = sys_ioctl (fd, cmd, (unsigned long)&ifr);
+ set_fs (old_fs);
+ if (!err) {
+ switch (cmd) {
+ case SIOCGIFFLAGS:
+ case SIOCGIFMETRIC:
+ case SIOCGIFMTU:
+ case SIOCGIFMEM:
+ case SIOCGIFHWADDR:
+ case SIOCGIFINDEX:
+ case SIOCGIFADDR:
+ case SIOCGIFBRDADDR:
+ case SIOCGIFDSTADDR:
+ case SIOCGIFNETMASK:
+ case SIOCGIFTXQLEN:
+ if (copy_to_user(uifr, &ifr, sizeof(struct ifreq32)))
+ return -EFAULT;
+ break;
+ case SIOCGIFMAP:
+ err = copy_to_user(uifr, &ifr, sizeof(ifr.ifr_name));
+ err |= __put_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start));
+ err |= __put_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end));
+ err |= __put_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr));
+ err |= __put_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq));
+ err |= __put_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma));
+ err |= __put_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port));
+ if (err)
+ err = -EFAULT;
+ break;
+ }
+ }
+ return err;
+}
+
+struct rtentry32
+{
+ unsigned int rt_pad1;
+ struct sockaddr rt_dst; /* target address */
+ struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
+ struct sockaddr rt_genmask; /* target network mask (IP) */
+ unsigned short rt_flags;
+ short rt_pad2;
+ unsigned int rt_pad3;
+ unsigned int rt_pad4;
+ short rt_metric; /* +1 for binary compatibility! */
+ unsigned int rt_dev; /* forcing the device at add */
+ unsigned int rt_mtu; /* per route MTU/Window */
+#ifndef __KERNEL__
+#define rt_mss rt_mtu /* Compatibility :-( */
+#endif
+ unsigned int rt_window; /* Window clamping */
+ unsigned short rt_irtt; /* Initial RTT */
+};
+
+static inline int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct rtentry32 *ur = (struct rtentry32 *)arg;
+ struct rtentry r;
+ char devname[16];
+ u32 rtdev;
+ int ret;
+ mm_segment_t old_fs = get_fs();
+
+ ret = copy_from_user (&r.rt_dst, &(ur->rt_dst), 3 * sizeof(struct sockaddr));
+ ret |= __get_user (r.rt_flags, &(ur->rt_flags));
+ ret |= __get_user (r.rt_metric, &(ur->rt_metric));
+ ret |= __get_user (r.rt_mtu, &(ur->rt_mtu));
+ ret |= __get_user (r.rt_window, &(ur->rt_window));
+ ret |= __get_user (r.rt_irtt, &(ur->rt_irtt));
+ ret |= __get_user (rtdev, &(ur->rt_dev));
+ if (rtdev) {
+ ret |= copy_from_user (devname, (char *)A(rtdev), 15);
+ r.rt_dev = devname; devname[15] = 0;
+ } else
+ r.rt_dev = 0;
+ if (ret)
+ return -EFAULT;
+ set_fs (KERNEL_DS);
+ ret = sys_ioctl (fd, cmd, (long)&r);
+ set_fs (old_fs);
+ return ret;
+}
+
+static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ /* These are just misnamed, they actually get/put from/to user an int */
+ switch (cmd) {
+ case EXT2_IOC32_GETFLAGS: cmd = EXT2_IOC_GETFLAGS; break;
+ case EXT2_IOC32_SETFLAGS: cmd = EXT2_IOC_SETFLAGS; break;
+ case EXT2_IOC32_GETVERSION: cmd = EXT2_IOC_GETVERSION; break;
+ case EXT2_IOC32_SETVERSION: cmd = EXT2_IOC_SETVERSION; break;
+ }
+ return sys_ioctl(fd, cmd, arg);
+}
+
+static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ mm_segment_t old_fs = get_fs();
+ int err;
+ unsigned long val;
+
+ set_fs (KERNEL_DS);
+ err = sys_ioctl(fd, cmd, (unsigned long)&val);
+ set_fs (old_fs);
+ if (!err && put_user((unsigned int) val, (u32 *)arg))
+ return -EFAULT;
+ return err;
+}
+
+struct ioctl32_handler {
+ unsigned int cmd;
+ int (*function)(unsigned int, unsigned int, unsigned long);
+};
+
+struct ioctl32_list {
+ struct ioctl32_handler handler;
+ struct ioctl32_list *next;
+};
+
+#define IOCTL32_DEFAULT(cmd) { { cmd, (void *) sys_ioctl }, 0 }
+#define IOCTL32_HANDLER(cmd, handler) { { cmd, (void *) handler }, 0 }
+
+static struct ioctl32_list ioctl32_handler_table[] = {
+ IOCTL32_DEFAULT(TCGETA),
+ IOCTL32_DEFAULT(TCSETA),
+ IOCTL32_DEFAULT(TCSETAW),
+ IOCTL32_DEFAULT(TCSETAF),
+ IOCTL32_DEFAULT(TCSBRK),
+ IOCTL32_DEFAULT(TCXONC),
+ IOCTL32_DEFAULT(TCFLSH),
+ IOCTL32_DEFAULT(TCGETS),
+ IOCTL32_DEFAULT(TCSETS),
+ IOCTL32_DEFAULT(TCSETSW),
+ IOCTL32_DEFAULT(TCSETSF),
+ IOCTL32_DEFAULT(TIOCLINUX),
+
+ IOCTL32_DEFAULT(TIOCGETD),
+ IOCTL32_DEFAULT(TIOCSETD),
+ IOCTL32_DEFAULT(TIOCEXCL),
+ IOCTL32_DEFAULT(TIOCNXCL),
+ IOCTL32_DEFAULT(TIOCCONS),
+ IOCTL32_DEFAULT(TIOCGSOFTCAR),
+ IOCTL32_DEFAULT(TIOCSSOFTCAR),
+ IOCTL32_DEFAULT(TIOCSWINSZ),
+ IOCTL32_DEFAULT(TIOCGWINSZ),
+ IOCTL32_DEFAULT(TIOCMGET),
+ IOCTL32_DEFAULT(TIOCMBIC),
+ IOCTL32_DEFAULT(TIOCMBIS),
+ IOCTL32_DEFAULT(TIOCMSET),
+ IOCTL32_DEFAULT(TIOCPKT),
+ IOCTL32_DEFAULT(TIOCNOTTY),
+ IOCTL32_DEFAULT(TIOCSTI),
+ IOCTL32_DEFAULT(TIOCOUTQ),
+ IOCTL32_DEFAULT(TIOCSPGRP),
+ IOCTL32_DEFAULT(TIOCGPGRP),
+ IOCTL32_DEFAULT(TIOCSCTTY),
+ IOCTL32_DEFAULT(TIOCGPTN),
+ IOCTL32_DEFAULT(TIOCSPTLCK),
+ IOCTL32_DEFAULT(TIOCGSERIAL),
+ IOCTL32_DEFAULT(TIOCSSERIAL),
+ IOCTL32_DEFAULT(TIOCSERGETLSR),
+
+ IOCTL32_DEFAULT(FIOCLEX),
+ IOCTL32_DEFAULT(FIONCLEX),
+ IOCTL32_DEFAULT(FIOASYNC),
+ IOCTL32_DEFAULT(FIONBIO),
+ IOCTL32_DEFAULT(FIONREAD),
+
+ IOCTL32_DEFAULT(PIO_FONT),
+ IOCTL32_DEFAULT(GIO_FONT),
+ IOCTL32_DEFAULT(KDSIGACCEPT),
+ IOCTL32_DEFAULT(KDGETKEYCODE),
+ IOCTL32_DEFAULT(KDSETKEYCODE),
+ IOCTL32_DEFAULT(KIOCSOUND),
+ IOCTL32_DEFAULT(KDMKTONE),
+ IOCTL32_DEFAULT(KDGKBTYPE),
+ IOCTL32_DEFAULT(KDSETMODE),
+ IOCTL32_DEFAULT(KDGETMODE),
+ IOCTL32_DEFAULT(KDSKBMODE),
+ IOCTL32_DEFAULT(KDGKBMODE),
+ IOCTL32_DEFAULT(KDSKBMETA),
+ IOCTL32_DEFAULT(KDGKBMETA),
+ IOCTL32_DEFAULT(KDGKBENT),
+ IOCTL32_DEFAULT(KDSKBENT),
+ IOCTL32_DEFAULT(KDGKBSENT),
+ IOCTL32_DEFAULT(KDSKBSENT),
+ IOCTL32_DEFAULT(KDGKBDIACR),
+ IOCTL32_DEFAULT(KDSKBDIACR),
+ IOCTL32_DEFAULT(KDGKBLED),
+ IOCTL32_DEFAULT(KDSKBLED),
+ IOCTL32_DEFAULT(KDGETLED),
+ IOCTL32_DEFAULT(KDSETLED),
+ IOCTL32_DEFAULT(GIO_SCRNMAP),
+ IOCTL32_DEFAULT(PIO_SCRNMAP),
+ IOCTL32_DEFAULT(GIO_UNISCRNMAP),
+ IOCTL32_DEFAULT(PIO_UNISCRNMAP),
+ IOCTL32_DEFAULT(PIO_FONTRESET),
+ IOCTL32_DEFAULT(PIO_UNIMAPCLR),
+
+ IOCTL32_DEFAULT(VT_SETMODE),
+ IOCTL32_DEFAULT(VT_GETMODE),
+ IOCTL32_DEFAULT(VT_GETSTATE),
+ IOCTL32_DEFAULT(VT_OPENQRY),
+ IOCTL32_DEFAULT(VT_ACTIVATE),
+ IOCTL32_DEFAULT(VT_WAITACTIVE),
+ IOCTL32_DEFAULT(VT_RELDISP),
+ IOCTL32_DEFAULT(VT_DISALLOCATE),
+ IOCTL32_DEFAULT(VT_RESIZE),
+ IOCTL32_DEFAULT(VT_RESIZEX),
+ IOCTL32_DEFAULT(VT_LOCKSWITCH),
+ IOCTL32_DEFAULT(VT_UNLOCKSWITCH),
+
+ IOCTL32_HANDLER(SIOCGIFNAME, dev_ifname32),
+ IOCTL32_HANDLER(SIOCGIFCONF, dev_ifconf),
+ IOCTL32_HANDLER(SIOCGIFFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMETRIC, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMETRIC, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMTU, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMTU, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMEM, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMEM, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFHWADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFHWADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCADDMULTI, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCDELMULTI, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFINDEX, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMAP, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMAP, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFBRDADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFBRDADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFDSTADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFDSTADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFNETMASK, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFNETMASK, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFPFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFPFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFTXQLEN, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFTXQLEN, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCADDRT, routing_ioctl),
+ IOCTL32_HANDLER(SIOCDELRT, routing_ioctl),
+
+ IOCTL32_HANDLER(EXT2_IOC32_GETFLAGS, do_ext2_ioctl),
+ IOCTL32_HANDLER(EXT2_IOC32_SETFLAGS, do_ext2_ioctl),
+ IOCTL32_HANDLER(EXT2_IOC32_GETVERSION, do_ext2_ioctl),
+ IOCTL32_HANDLER(EXT2_IOC32_SETVERSION, do_ext2_ioctl),
+
+ IOCTL32_HANDLER(BLKGETSIZE, w_long)
+
+};
+
+#define NR_IOCTL32_HANDLERS (sizeof(ioctl32_handler_table) / \
+ sizeof(ioctl32_handler_table[0]))
+
+static struct ioctl32_list *ioctl32_hash_table[1024];
+
+static inline int ioctl32_hash(unsigned int cmd)
+{
+ return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
+}
+
+int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned int arg)
+{
+ int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
+ struct file *filp;
+ struct ioctl32_list *l;
+ int error;
+
+ l = ioctl32_hash_table[ioctl32_hash(cmd)];
+
+ error = -EBADF;
+
+ filp = fget(fd);
+ if (!filp)
+ return error;
+
+ if (!filp->f_op || !filp->f_op->ioctl) {
+ error = sys_ioctl (fd, cmd, arg);
+ goto out;
+ }
+
+ while (l && l->handler.cmd != cmd)
+ l = l->next;
+
+ if (l) {
+ handler = (void *)l->handler.function;
+ error = handler(fd, cmd, arg, filp);
+ } else {
+ error = -EINVAL;
+ printk("unknown ioctl: %08x\n", cmd);
+ }
+out:
+ fput(filp);
+ return error;
+}
+
+static void ioctl32_insert(struct ioctl32_list *entry)
+{
+ int hash = ioctl32_hash(entry->handler.cmd);
+ if (!ioctl32_hash_table[hash])
+ ioctl32_hash_table[hash] = entry;
+ else {
+ struct ioctl32_list *l;
+ l = ioctl32_hash_table[hash];
+ while (l->next)
+ l = l->next;
+ l->next = entry;
+ entry->next = 0;
+ }
+}
+
+static int __init init_ioctl32(void)
+{
+ int i;
+ for (i = 0; i < NR_IOCTL32_HANDLERS; i++)
+ ioctl32_insert(&ioctl32_handler_table[i]);
+ return 0;
+}
+
+__initcall(init_ioctl32);
-int sys32_newstat(void) {return 0;}
-int sys32_newlstat(void) {return 0;}
-int sys32_newfstat(void) {return 0;}
-int sys_mmap2(void) {return 0;}
-int sys_truncate64(void) {return 0;}
-int sys_ftruncate64(void) {return 0;}
-int sys_stat64(void) {return 0;}
-int sys_lstat64(void) {return 0;}
-int sys_fstat64(void) {return 0;}
+/* $Id: linux32.c,v 1.14 2000/03/23 00:30:53 ulfc Exp $
+ *
+ * Conversion between 32-bit and 64-bit native system calls.
+ *
+ * Copyright (C) 2000 Silicon Graphics, Inc.
+ * Written by Ulf Carlsson (ulfc@engr.sgi.com)
+ * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com)
+ */
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/file.h>
+#include <linux/smp_lock.h>
+#include <linux/highuid.h>
+#include <linux/dirent.h>
+#include <linux/resource.h>
+#include <linux/highmem.h>
+#include <linux/time.h>
+#include <linux/poll.h>
+#include <linux/slab.h>
+
+#include <asm/uaccess.h>
+#include <asm/mman.h>
+
+
+#define A(__x) ((unsigned long)(__x))
+
+#if 1
+static inline int
+putstat(struct stat32 *ubuf, struct stat *kbuf)
+{
+ int err;
+
+ err = put_user (kbuf->st_dev, &ubuf->st_dev);
+ err |= __put_user (kbuf->st_ino, &ubuf->st_ino);
+ err |= __put_user (kbuf->st_mode, &ubuf->st_mode);
+ err |= __put_user (kbuf->st_nlink, &ubuf->st_nlink);
+ err |= __put_user (kbuf->st_uid, &ubuf->st_uid);
+ err |= __put_user (kbuf->st_gid, &ubuf->st_gid);
+ err |= __put_user (kbuf->st_rdev, &ubuf->st_rdev);
+ err |= __put_user (kbuf->st_size, &ubuf->st_size);
+ err |= __put_user (kbuf->st_atime, &ubuf->st_atime);
+ err |= __put_user (kbuf->st_mtime, &ubuf->st_mtime);
+ err |= __put_user (kbuf->st_ctime, &ubuf->st_ctime);
+ err |= __put_user (kbuf->st_blksize, &ubuf->st_blksize);
+ err |= __put_user (kbuf->st_blocks, &ubuf->st_blocks);
+ return err;
+}
+
+extern asmlinkage long sys_newstat(char * filename, struct stat * statbuf);
+
+asmlinkage int
+sys32_newstat(char * filename, struct stat32 *statbuf)
+{
+ int ret;
+ struct stat s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_newstat(filename, &s);
+ set_fs (old_fs);
+ if (putstat (statbuf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage long sys_newlstat(char * filename, struct stat * statbuf);
+
+asmlinkage int
+sys32_newlstat(char * filename, struct stat32 *statbuf)
+{
+ int ret;
+ struct stat s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_newlstat(filename, &s);
+ set_fs (old_fs);
+ if (putstat (statbuf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf);
+
+asmlinkage int
+sys32_newfstat(unsigned int fd, struct stat32 *statbuf)
+{
+ int ret;
+ struct stat s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_newfstat(fd, &s);
+ set_fs (old_fs);
+ if (putstat (statbuf, &s))
+ return -EFAULT;
+ return ret;
+}
+#else
+/*
+ * Revalidate the inode. This is required for proper NFS attribute caching.
+ */
+static __inline__ int
+do_revalidate(struct dentry *dentry)
+{
+ struct inode * inode = dentry->d_inode;
+ if (inode->i_op && inode->i_op->revalidate)
+ return inode->i_op->revalidate(dentry);
+ return 0;
+}
+
+static int cp_new_stat32(struct inode * inode, struct stat32 * statbuf)
+{
+ struct stat32 tmp;
+ unsigned int blocks, indirect;
+
+ memset(&tmp, 0, sizeof(tmp));
+ tmp.st_dev = kdev_t_to_nr(inode->i_dev);
+ tmp.st_ino = inode->i_ino;
+ tmp.st_mode = inode->i_mode;
+ tmp.st_nlink = inode->i_nlink;
+ SET_STAT_UID(tmp, inode->i_uid);
+ SET_STAT_GID(tmp, inode->i_gid);
+ tmp.st_rdev = kdev_t_to_nr(inode->i_rdev);
+ tmp.st_size = inode->i_size;
+ tmp.st_atime = inode->i_atime;
+ tmp.st_mtime = inode->i_mtime;
+ tmp.st_ctime = inode->i_ctime;
+/*
+ * st_blocks and st_blksize are approximated with a simple algorithm if
+ * they aren't supported directly by the filesystem. The minix and msdos
+ * filesystems don't keep track of blocks, so they would either have to
+ * be counted explicitly (by delving into the file itself), or by using
+ * this simple algorithm to get a reasonable (although not 100% accurate)
+ * value.
+ */
+
+/*
+ * Use minix fs values for the number of direct and indirect blocks. The
+ * count is now exact for the minix fs except that it counts zero blocks.
+ * Everything is in units of BLOCK_SIZE until the assignment to
+ * tmp.st_blksize.
+ */
+#define D_B 7
+#define I_B (BLOCK_SIZE / sizeof(unsigned short))
+
+ if (!inode->i_blksize) {
+ blocks = (tmp.st_size + BLOCK_SIZE - 1) / BLOCK_SIZE;
+ if (blocks > D_B) {
+ indirect = (blocks - D_B + I_B - 1) / I_B;
+ blocks += indirect;
+ if (indirect > 1) {
+ indirect = (indirect - 1 + I_B - 1) / I_B;
+ blocks += indirect;
+ if (indirect > 1)
+ blocks++;
+ }
+ }
+ tmp.st_blocks = (BLOCK_SIZE / 512) * blocks;
+ tmp.st_blksize = BLOCK_SIZE;
+ } else {
+ tmp.st_blocks = inode->i_blocks;
+ tmp.st_blksize = inode->i_blksize;
+ }
+ return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+}
+asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf)
+{
+ struct dentry * dentry;
+ int error;
+
+ lock_kernel();
+ dentry = namei(filename);
+
+ error = PTR_ERR(dentry);
+ if (!IS_ERR(dentry)) {
+ error = do_revalidate(dentry);
+ if (!error)
+ error = cp_new_stat32(dentry->d_inode, statbuf);
+
+ dput(dentry);
+ }
+ unlock_kernel();
+ return error;
+}
+asmlinkage int sys32_newlstat(char *filename, struct stat32 * statbuf)
+{
+ struct dentry * dentry;
+ int error;
+
+ lock_kernel();
+ dentry = lnamei(filename);
+
+ error = PTR_ERR(dentry);
+ if (!IS_ERR(dentry)) {
+ error = do_revalidate(dentry);
+ if (!error)
+ error = cp_new_stat32(dentry->d_inode, statbuf);
+
+ dput(dentry);
+ }
+ unlock_kernel();
+ return error;
+}
+
+asmlinkage int sys32_newfstat(unsigned int fd, struct stat32 * statbuf)
+{
+ struct file * f;
+ int err = -EBADF;
+
+ lock_kernel();
+ f = fget(fd);
+ if (f) {
+ struct dentry * dentry = f->f_dentry;
+
+ err = do_revalidate(dentry);
+ if (!err)
+ err = cp_new_stat32(dentry->d_inode, statbuf);
+ fput(f);
+ }
+ unlock_kernel();
+ return err;
+}
+#endif
+asmlinkage int sys_mmap2(void) {return 0;}
+
+asmlinkage long sys_truncate(const char * path, unsigned long length);
+
+asmlinkage int sys_truncate64(const char *path, unsigned int high,
+ unsigned int low)
+{
+ if ((int)high < 0)
+ return -EINVAL;
+ return sys_truncate(path, (high << 32) | low);
+}
+
+asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
+
+asmlinkage int sys_ftruncate64(unsigned int fd, unsigned int high,
+ unsigned int low)
+{
+ if ((int)high < 0)
+ return -EINVAL;
+ return sys_ftruncate(fd, (high << 32) | low);
+}
+
+asmlinkage long sys_newstat(char * filename, struct stat * statbuf);
+
+asmlinkage int sys_stat64(char * filename, struct stat *statbuf)
+{
+ return sys_newstat(filename, statbuf);
+}
+
+asmlinkage long sys_newlstat(char * filename, struct stat * statbuf);
+
+asmlinkage int sys_lstat64(char * filename, struct stat *statbuf)
+{
+ return sys_newlstat(filename, statbuf);
+}
+
+asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf);
+
+asmlinkage int sys_fstat64(unsigned int fd, struct stat *statbuf)
+{
+ return sys_newfstat(fd, statbuf);
+}
+
+#if 0
+/*
+ * count32() counts the number of arguments/envelopes
+ */
+static int count32(u32 * argv, int max)
+{
+ int i = 0;
+
+ if (argv != NULL) {
+ for (;;) {
+ u32 p;
+ /* egcs is stupid */
+ if (!access_ok(VERIFY_READ, argv, sizeof (u32)))
+ return -EFAULT;
+ __get_user(p,argv);
+ if (!p)
+ break;
+ argv++;
+ if(++i > max)
+ return -E2BIG;
+ }
+ }
+ return i;
+}
+
+
+/*
+ * 'copy_strings32()' copies argument/envelope strings from user
+ * memory to free pages in kernel mem. These are in a format ready
+ * to be put directly into the top of new user memory.
+ */
+int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm)
+{
+ while (argc-- > 0) {
+ u32 str;
+ int len;
+ unsigned long pos;
+
+ if (get_user(str, argv+argc) || !str || !(len = strnlen_user((char *)A(str), bprm->p)))
+ return -EFAULT;
+ if (bprm->p < len)
+ return -E2BIG;
+
+ bprm->p -= len;
+ /* XXX: add architecture specific overflow check here. */
+
+ pos = bprm->p;
+ while (len > 0) {
+ char *kaddr;
+ int i, new, err;
+ struct page *page;
+ int offset, bytes_to_copy;
+
+ offset = pos % PAGE_SIZE;
+ i = pos/PAGE_SIZE;
+ page = bprm->page[i];
+ new = 0;
+ if (!page) {
+ page = alloc_page(GFP_HIGHUSER);
+ bprm->page[i] = page;
+ if (!page)
+ return -ENOMEM;
+ new = 1;
+ }
+ kaddr = (char *)kmap(page);
+
+ if (new && offset)
+ memset(kaddr, 0, offset);
+ bytes_to_copy = PAGE_SIZE - offset;
+ if (bytes_to_copy > len) {
+ bytes_to_copy = len;
+ if (new)
+ memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len);
+ }
+ err = copy_from_user(kaddr + offset, (char *)A(str), bytes_to_copy);
+ flush_page_to_ram(page);
+ kunmap(page);
+
+ if (err)
+ return -EFAULT;
+
+ pos += bytes_to_copy;
+ str += bytes_to_copy;
+ len -= bytes_to_copy;
+ }
+ }
+ return 0;
+}
+
+
+/*
+ * sys_execve32() executes a new program.
+ */
+int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
+{
+ struct linux_binprm bprm;
+ struct dentry * dentry;
+ int retval;
+ int i;
+
+ bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
+ memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
+
+ dentry = open_namei(filename, 0, 0);
+ retval = PTR_ERR(dentry);
+ if (IS_ERR(dentry))
+ return retval;
+
+ bprm.dentry = dentry;
+ bprm.filename = filename;
+ bprm.sh_bang = 0;
+ bprm.loader = 0;
+ bprm.exec = 0;
+ if ((bprm.argc = count32(argv, bprm.p / sizeof(u32))) < 0) {
+ dput(dentry);
+ return bprm.argc;
+ }
+
+ if ((bprm.envc = count32(envp, bprm.p / sizeof(u32))) < 0) {
+ dput(dentry);
+ return bprm.envc;
+ }
+
+ retval = prepare_binprm(&bprm);
+ if (retval < 0)
+ goto out;
+
+ retval = copy_strings_kernel(1, &bprm.filename, &bprm);
+ if (retval < 0)
+ goto out;
+
+ bprm.exec = bprm.p;
+ retval = copy_strings32(bprm.envc, envp, &bprm);
+ if (retval < 0)
+ goto out;
+
+ retval = copy_strings32(bprm.argc, argv, &bprm);
+ if (retval < 0)
+ goto out;
+
+ retval = search_binary_handler(&bprm,regs);
+ if (retval >= 0)
+ /* execve success */
+ return retval;
+
+out:
+ /* Something went wrong, return the inode and free the argument pages*/
+ if (bprm.dentry)
+ dput(bprm.dentry);
+
+ /* Assumes that free_page() can take a NULL argument. */
+ /* I hope this is ok for all architectures */
+ for (i = 0 ; i < MAX_ARG_PAGES ; i++)
+ if (bprm.page[i])
+ __free_page(bprm.page[i]);
+
+ return retval;
+}
+
+/*
+ * sys_execve() executes a new program.
+ */
+asmlinkage int sys32_execve(abi64_no_regargs, struct pt_regs regs)
+{
+ int error;
+ char * filename;
+
+ filename = getname((char *) (long)regs.regs[4]);
+ printk("Executing: %s\n", filename);
+ error = PTR_ERR(filename);
+ if (IS_ERR(filename))
+ goto out;
+ error = do_execve32(filename, (u32 *) (long)regs.regs[5],
+ (u32 *) (long)regs.regs[6], ®s);
+ putname(filename);
+
+out:
+ return error;
+}
+#else
+static int
+nargs(unsigned int arg, char **ap)
+{
+ char *ptr;
+ int n;
+
+ n = 0;
+ do {
+ /* egcs is stupid */
+ if (!access_ok(VERIFY_READ, arg, sizeof (unsigned int)))
+ return -EFAULT;
+ __get_user((long)ptr,(int *)A(arg));
+ if (ap)
+ *ap++ = ptr;
+ arg += sizeof(unsigned int);
+ n++;
+ } while (ptr);
+ return(n - 1);
+}
+
+asmlinkage int
+sys32_execve(abi64_no_regargs, struct pt_regs regs)
+{
+ extern asmlinkage int sys_execve(abi64_no_regargs, struct pt_regs regs);
+ extern asmlinkage long sys_munmap(unsigned long addr, size_t len);
+ unsigned int argv = (unsigned int)regs.regs[5];
+ unsigned int envp = (unsigned int)regs.regs[6];
+ char **av, **ae;
+ int na, ne, r, len;
+ char * filename;
+
+ na = nargs(argv, NULL);
+ ne = nargs(envp, NULL);
+ len = (na + ne + 2) * sizeof(*av);
+ /*
+ * kmalloc won't work because the `sys_exec' code will attempt
+ * to do a `get_user' on the arg list and `get_user' will fail
+ * on a kernel address (simplifies `get_user'). Instead we
+ * do an mmap to get a user address. Note that since a successful
+ * `execve' frees all current memory we only have to do an
+ * `munmap' if the `execve' failes.
+ */
+ down(¤t->mm->mmap_sem);
+ lock_kernel();
+
+ av = (char **) do_mmap_pgoff(0, 0, len, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, 0);
+
+ unlock_kernel();
+ up(¤t->mm->mmap_sem);
+
+ if (IS_ERR(av))
+ return((long) av);
+ ae = av + na + 1;
+ av[na] = (char *)0;
+ ae[ne] = (char *)0;
+ (void)nargs(argv, av);
+ (void)nargs(envp, ae);
+ filename = getname((char *) (long)regs.regs[4]);
+ r = PTR_ERR(filename);
+ if (IS_ERR(filename))
+ return(r);
+
+ r = do_execve(filename, av, ae, ®s);
+ putname(filename);
+ if (IS_ERR(r))
+ sys_munmap((unsigned long)av, len);
+ return(r);
+}
+#endif
+
+struct dirent32 {
+ unsigned int d_ino;
+ unsigned int d_off;
+ unsigned short d_reclen;
+ char d_name[NAME_MAX + 1];
+};
+
+static void
+xlate_dirent(void *dirent64, void *dirent32, long n)
+{
+ long off;
+ struct dirent *dirp;
+ struct dirent32 *dirp32;
+
+ off = 0;
+ while (off < n) {
+ dirp = (struct dirent *)(dirent64 + off);
+ dirp32 = (struct dirent32 *)(dirent32 + off);
+ off += dirp->d_reclen;
+ dirp32->d_ino = dirp->d_ino;
+ dirp32->d_off = (unsigned int)dirp->d_off;
+ dirp32->d_reclen = dirp->d_reclen;
+ strncpy(dirp32->d_name, dirp->d_name, dirp->d_reclen - ((3 * 4) + 2));
+ }
+ return;
+}
+
+asmlinkage long sys_getdents(unsigned int fd, void * dirent, unsigned int count);
+
+asmlinkage long
+sys32_getdents(unsigned int fd, void * dirent32, unsigned int count)
+{
+ long n;
+ void *dirent64;
+
+ dirent64 = (void *)((unsigned long)(dirent32 + (sizeof(long) - 1)) & ~(sizeof(long) - 1));
+ if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0)
+ return(n);
+ xlate_dirent(dirent64, dirent32, n);
+ return(n);
+}
+
+asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count);
+
+asmlinkage int
+sys32_readdir(unsigned int fd, void * dirent32, unsigned int count)
+{
+ int n;
+ struct dirent dirent64;
+
+ if ((n = old_readdir(fd, &dirent64, count)) < 0)
+ return(n);
+ xlate_dirent(&dirent64, dirent32, dirent64.d_reclen);
+ return(n);
+}
+
+struct timeval32
+{
+ int tv_sec, tv_usec;
+};
+
+struct itimerval32
+{
+ struct timeval32 it_interval;
+ struct timeval32 it_value;
+};
+
+struct rusage32 {
+ struct timeval32 ru_utime;
+ struct timeval32 ru_stime;
+ int ru_maxrss;
+ int ru_ixrss;
+ int ru_idrss;
+ int ru_isrss;
+ int ru_minflt;
+ int ru_majflt;
+ int ru_nswap;
+ int ru_inblock;
+ int ru_oublock;
+ int ru_msgsnd;
+ int ru_msgrcv;
+ int ru_nsignals;
+ int ru_nvcsw;
+ int ru_nivcsw;
+};
+
+static int
+put_rusage (struct rusage32 *ru, struct rusage *r)
+{
+ int err;
+
+ err = put_user (r->ru_utime.tv_sec, &ru->ru_utime.tv_sec);
+ err |= __put_user (r->ru_utime.tv_usec, &ru->ru_utime.tv_usec);
+ err |= __put_user (r->ru_stime.tv_sec, &ru->ru_stime.tv_sec);
+ err |= __put_user (r->ru_stime.tv_usec, &ru->ru_stime.tv_usec);
+ err |= __put_user (r->ru_maxrss, &ru->ru_maxrss);
+ err |= __put_user (r->ru_ixrss, &ru->ru_ixrss);
+ err |= __put_user (r->ru_idrss, &ru->ru_idrss);
+ err |= __put_user (r->ru_isrss, &ru->ru_isrss);
+ err |= __put_user (r->ru_minflt, &ru->ru_minflt);
+ err |= __put_user (r->ru_majflt, &ru->ru_majflt);
+ err |= __put_user (r->ru_nswap, &ru->ru_nswap);
+ err |= __put_user (r->ru_inblock, &ru->ru_inblock);
+ err |= __put_user (r->ru_oublock, &ru->ru_oublock);
+ err |= __put_user (r->ru_msgsnd, &ru->ru_msgsnd);
+ err |= __put_user (r->ru_msgrcv, &ru->ru_msgrcv);
+ err |= __put_user (r->ru_nsignals, &ru->ru_nsignals);
+ err |= __put_user (r->ru_nvcsw, &ru->ru_nvcsw);
+ err |= __put_user (r->ru_nivcsw, &ru->ru_nivcsw);
+ return err;
+}
+
+extern asmlinkage int sys_wait4(pid_t pid, unsigned int * stat_addr,
+ int options, struct rusage * ru);
+
+asmlinkage int
+sys32_wait4(__kernel_pid_t32 pid, unsigned int * stat_addr, int options,
+ struct rusage32 * ru)
+{
+ if (!ru)
+ return sys_wait4(pid, stat_addr, options, NULL);
+ else {
+ struct rusage r;
+ int ret;
+ unsigned int status;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs(KERNEL_DS);
+ ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r);
+ set_fs(old_fs);
+ if (put_rusage (ru, &r)) return -EFAULT;
+ if (stat_addr && put_user (status, stat_addr))
+ return -EFAULT;
+ return ret;
+ }
+}
+
+asmlinkage int
+sys32_waitpid(__kernel_pid_t32 pid, unsigned int *stat_addr, int options)
+{
+ return sys32_wait4(pid, stat_addr, options, NULL);
+}
+
+#define RLIM_INFINITY32 0x7fffffff
+#define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x)
+
+struct rlimit32 {
+ int rlim_cur;
+ int rlim_max;
+};
+
+extern asmlinkage int sys_old_getrlimit(unsigned int resource, struct rlimit *rlim);
+
+asmlinkage int
+sys32_getrlimit(unsigned int resource, struct rlimit32 *rlim)
+{
+ struct rlimit r;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ set_fs (KERNEL_DS);
+ ret = sys_old_getrlimit(resource, &r);
+ set_fs (old_fs);
+ if (!ret) {
+ ret = put_user (RESOURCE32(r.rlim_cur), &rlim->rlim_cur);
+ ret |= __put_user (RESOURCE32(r.rlim_max), &rlim->rlim_max);
+ }
+ return ret;
+}
+
+extern asmlinkage int sys_setrlimit(unsigned int resource, struct rlimit *rlim);
+
+asmlinkage int
+sys32_setrlimit(unsigned int resource, struct rlimit32 *rlim)
+{
+ struct rlimit r;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ if (resource >= RLIM_NLIMITS) return -EINVAL;
+ if (get_user (r.rlim_cur, &rlim->rlim_cur) ||
+ __get_user (r.rlim_max, &rlim->rlim_max))
+ return -EFAULT;
+ if (r.rlim_cur == RLIM_INFINITY32)
+ r.rlim_cur = RLIM_INFINITY;
+ if (r.rlim_max == RLIM_INFINITY32)
+ r.rlim_max = RLIM_INFINITY;
+ set_fs (KERNEL_DS);
+ ret = sys_setrlimit(resource, &r);
+ set_fs (old_fs);
+ return ret;
+}
+
+struct statfs32 {
+ int f_type;
+ int f_bsize;
+ int f_frsize;
+ int f_blocks;
+ int f_bfree;
+ int f_files;
+ int f_ffree;
+ int f_bavail;
+ __kernel_fsid_t32 f_fsid;
+ int f_namelen;
+ int f_spare[6];
+};
+
+static inline int
+put_statfs (struct statfs32 *ubuf, struct statfs *kbuf)
+{
+ int err;
+
+ err = put_user (kbuf->f_type, &ubuf->f_type);
+ err |= __put_user (kbuf->f_bsize, &ubuf->f_bsize);
+ err |= __put_user (kbuf->f_blocks, &ubuf->f_blocks);
+ err |= __put_user (kbuf->f_bfree, &ubuf->f_bfree);
+ err |= __put_user (kbuf->f_bavail, &ubuf->f_bavail);
+ err |= __put_user (kbuf->f_files, &ubuf->f_files);
+ err |= __put_user (kbuf->f_ffree, &ubuf->f_ffree);
+ err |= __put_user (kbuf->f_namelen, &ubuf->f_namelen);
+ err |= __put_user (kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]);
+ err |= __put_user (kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]);
+ return err;
+}
+
+extern asmlinkage int sys_statfs(const char * path, struct statfs * buf);
+
+asmlinkage int
+sys32_statfs(const char * path, struct statfs32 *buf)
+{
+ int ret;
+ struct statfs s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_statfs((const char *)path, &s);
+ set_fs (old_fs);
+ if (put_statfs(buf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage int sys_fstatfs(unsigned int fd, struct statfs * buf);
+
+asmlinkage int
+sys32_fstatfs(unsigned int fd, struct statfs32 *buf)
+{
+ int ret;
+ struct statfs s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_fstatfs(fd, &s);
+ set_fs (old_fs);
+ if (put_statfs(buf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage int
+sys_getrusage(int who, struct rusage *ru);
+
+asmlinkage int
+sys32_getrusage(int who, struct rusage32 *ru)
+{
+ struct rusage r;
+ int ret;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_getrusage(who, &r);
+ set_fs (old_fs);
+ if (put_rusage (ru, &r)) return -EFAULT;
+ return ret;
+}
+
+static inline long
+get_tv32(struct timeval *o, struct timeval32 *i)
+{
+ return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
+ (__get_user(o->tv_sec, &i->tv_sec) |
+ __get_user(o->tv_usec, &i->tv_usec)));
+ return ENOSYS;
+}
+
+static inline long
+get_it32(struct itimerval *o, struct itimerval32 *i)
+{
+ return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
+ (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) |
+ __get_user(o->it_interval.tv_usec, &i->it_interval.tv_usec) |
+ __get_user(o->it_value.tv_sec, &i->it_value.tv_sec) |
+ __get_user(o->it_value.tv_usec, &i->it_value.tv_usec)));
+ return ENOSYS;
+}
+
+static inline long
+put_tv32(struct timeval32 *o, struct timeval *i)
+{
+ return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
+ (__put_user(i->tv_sec, &o->tv_sec) |
+ __put_user(i->tv_usec, &o->tv_usec)));
+}
+
+static inline long
+put_it32(struct itimerval32 *o, struct itimerval *i)
+{
+ return (!access_ok(VERIFY_WRITE, i, sizeof(*i)) ||
+ (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) |
+ __put_user(i->it_interval.tv_usec, &o->it_interval.tv_usec) |
+ __put_user(i->it_value.tv_sec, &o->it_value.tv_sec) |
+ __put_user(i->it_value.tv_usec, &o->it_value.tv_usec)));
+ return ENOSYS;
+}
+
+extern int do_getitimer(int which, struct itimerval *value);
+
+asmlinkage int
+sys32_getitimer(int which, struct itimerval32 *it)
+{
+ struct itimerval kit;
+ int error;
+
+ error = do_getitimer(which, &kit);
+ if (!error && put_it32(it, &kit))
+ error = -EFAULT;
+
+ return error;
+}
+
+extern int do_setitimer(int which, struct itimerval *, struct itimerval *);
+
+
+asmlinkage int
+sys32_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out)
+{
+ struct itimerval kin, kout;
+ int error;
+
+ if (in) {
+ if (get_it32(&kin, in))
+ return -EFAULT;
+ } else
+ memset(&kin, 0, sizeof(kin));
+
+ error = do_setitimer(which, &kin, out ? &kout : NULL);
+ if (error || !out)
+ return error;
+ if (put_it32(out, &kout))
+ return -EFAULT;
+
+ return 0;
+
+}
+asmlinkage unsigned long
+sys32_alarm(unsigned int seconds)
+{
+ struct itimerval it_new, it_old;
+ unsigned int oldalarm;
+
+ it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0;
+ it_new.it_value.tv_sec = seconds;
+ it_new.it_value.tv_usec = 0;
+ do_setitimer(ITIMER_REAL, &it_new, &it_old);
+ oldalarm = it_old.it_value.tv_sec;
+ /* ehhh.. We can't return 0 if we have an alarm pending.. */
+ /* And we'd better return too much than too little anyway */
+ if (it_old.it_value.tv_usec)
+ oldalarm++;
+ return oldalarm;
+}
+
+/* Translations due to time_t size differences. Which affects all
+ sorts of things, like timeval and itimerval. */
+
+
+extern struct timezone sys_tz;
+extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
+
+asmlinkage int
+sys32_gettimeofday(struct timeval32 *tv, struct timezone *tz)
+{
+ if (tv) {
+ struct timeval ktv;
+ do_gettimeofday(&ktv);
+ if (put_tv32(tv, &ktv))
+ return -EFAULT;
+ }
+ if (tz) {
+ if (copy_to_user(tz, &sys_tz, sizeof(sys_tz)))
+ return -EFAULT;
+ }
+ return 0;
+}
+
+asmlinkage int
+sys32_settimeofday(struct timeval32 *tv, struct timezone *tz)
+{
+ struct timeval ktv;
+ struct timezone ktz;
+
+ if (tv) {
+ if (get_tv32(&ktv, tv))
+ return -EFAULT;
+ }
+ if (tz) {
+ if (copy_from_user(&ktz, tz, sizeof(ktz)))
+ return -EFAULT;
+ }
+
+ return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL);
+}
+
+extern asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
+ unsigned long offset_low, loff_t * result,
+ unsigned int origin);
+
+extern asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
+ unsigned int offset_low, loff_t * result,
+ unsigned int origin)
+{
+ return sys_llseek(fd, offset_high, offset_low, result, origin);
+}
+
+struct iovec32 { unsigned int iov_base; int iov_len; };
+
+typedef ssize_t (*IO_fn_t)(struct file *, char *, size_t, loff_t *);
+
+static long
+do_readv_writev32(int type, struct file *file, const struct iovec32 *vector,
+ u32 count)
+{
+ unsigned long tot_len;
+ struct iovec iovstack[UIO_FASTIOV];
+ struct iovec *iov=iovstack, *ivp;
+ struct inode *inode;
+ long retval, i;
+ IO_fn_t fn;
+
+ /* First get the "struct iovec" from user memory and
+ * verify all the pointers
+ */
+ if (!count)
+ return 0;
+ if(verify_area(VERIFY_READ, vector, sizeof(struct iovec32)*count))
+ return -EFAULT;
+ if (count > UIO_MAXIOV)
+ return -EINVAL;
+ if (count > UIO_FASTIOV) {
+ iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
+ if (!iov)
+ return -ENOMEM;
+ }
+
+ tot_len = 0;
+ i = count;
+ ivp = iov;
+ while(i > 0) {
+ u32 len;
+ u32 buf;
+
+ __get_user(len, &vector->iov_len);
+ __get_user(buf, &vector->iov_base);
+ tot_len += len;
+ ivp->iov_base = (void *)A(buf);
+ ivp->iov_len = (__kernel_size_t) len;
+ vector++;
+ ivp++;
+ i--;
+ }
+
+ inode = file->f_dentry->d_inode;
+ /* VERIFY_WRITE actually means a read, as we write to user space */
+ retval = locks_verify_area((type == VERIFY_WRITE
+ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
+ inode, file, file->f_pos, tot_len);
+ if (retval) {
+ if (iov != iovstack)
+ kfree(iov);
+ return retval;
+ }
+
+ /* Then do the actual IO. Note that sockets need to be handled
+ * specially as they have atomicity guarantees and can handle
+ * iovec's natively
+ */
+ if (inode->i_sock) {
+ int err;
+ err = sock_readv_writev(type, inode, file, iov, count, tot_len);
+ if (iov != iovstack)
+ kfree(iov);
+ return err;
+ }
+
+ if (!file->f_op) {
+ if (iov != iovstack)
+ kfree(iov);
+ return -EINVAL;
+ }
+ /* VERIFY_WRITE actually means a read, as we write to user space */
+ fn = file->f_op->read;
+ if (type == VERIFY_READ)
+ fn = (IO_fn_t) file->f_op->write;
+ ivp = iov;
+ while (count > 0) {
+ void * base;
+ int len, nr;
+
+ base = ivp->iov_base;
+ len = ivp->iov_len;
+ ivp++;
+ count--;
+ nr = fn(file, base, len, &file->f_pos);
+ if (nr < 0) {
+ if (retval)
+ break;
+ retval = nr;
+ break;
+ }
+ retval += nr;
+ if (nr != len)
+ break;
+ }
+ if (iov != iovstack)
+ kfree(iov);
+ return retval;
+}
+
+asmlinkage long
+sys32_readv(int fd, struct iovec32 *vector, u32 count)
+{
+ struct file *file;
+ long ret = -EBADF;
+
+ lock_kernel();
+ file = fget(fd);
+ if(!file)
+ goto bad_file;
+
+ if(!(file->f_mode & 1))
+ goto out;
+
+ ret = do_readv_writev32(VERIFY_WRITE, file,
+ vector, count);
+out:
+ fput(file);
+bad_file:
+ unlock_kernel();
+ return ret;
+}
+
+asmlinkage long
+sys32_writev(int fd, struct iovec32 *vector, u32 count)
+{
+ struct file *file;
+ int ret = -EBADF;
+
+ lock_kernel();
+ file = fget(fd);
+ if(!file)
+ goto bad_file;
+
+ if(!(file->f_mode & 2))
+ goto out;
+
+ ret = do_readv_writev32(VERIFY_READ, file,
+ vector, count);
+out:
+ fput(file);
+bad_file:
+ unlock_kernel();
+ return ret;
+}
+
+/*
+ * Ooo, nasty. We need here to frob 32-bit unsigned longs to
+ * 64-bit unsigned longs.
+ */
+
+static inline int
+get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
+{
+#ifdef __MIPSEB__
+ if (ufdset) {
+ unsigned long odd;
+
+ if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
+ return -EFAULT;
+
+ odd = n & 1UL;
+ n &= ~1UL;
+ while (n) {
+ unsigned long h, l;
+ __get_user(l, ufdset);
+ __get_user(h, ufdset+1);
+ ufdset += 2;
+ *fdset++ = h << 32 | l;
+ n -= 2;
+ }
+ if (odd)
+ __get_user(*fdset, ufdset);
+ } else {
+ /* Tricky, must clear full unsigned long in the
+ * kernel fdset at the end, this makes sure that
+ * actually happens.
+ */
+ memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
+ }
+ return 0;
+#else
+ <<Bomb - little endian support must define this>>
+#endif
+}
+
+static inline void
+set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
+{
+ unsigned long odd;
+
+ if (!ufdset)
+ return;
+
+ odd = n & 1UL;
+ n &= ~1UL;
+ while (n) {
+ unsigned long h, l;
+ l = *fdset++;
+ h = l >> 32;
+ __put_user(l, ufdset);
+ __put_user(h, ufdset+1);
+ ufdset += 2;
+ n -= 2;
+ }
+ if (odd)
+ __put_user(*fdset, ufdset);
+}
+
+/*
+ * We can actually return ERESTARTSYS instead of EINTR, but I'd
+ * like to be certain this leads to no problems. So I return
+ * EINTR just for safety.
+ *
+ * Update: ERESTARTSYS breaks at least the xview clock binary, so
+ * I'm trying ERESTARTNOHAND which restart only when you want to.
+ */
+#define MAX_SELECT_SECONDS \
+ ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
+
+asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, struct timeval32 *tvp)
+{
+ fd_set_bits fds;
+ char *bits;
+ unsigned long nn;
+ long timeout;
+ int ret, size;
+
+ timeout = MAX_SCHEDULE_TIMEOUT;
+ if (tvp) {
+ time_t sec, usec;
+
+ if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
+ || (ret = __get_user(sec, &tvp->tv_sec))
+ || (ret = __get_user(usec, &tvp->tv_usec)))
+ goto out_nofds;
+
+ ret = -EINVAL;
+ if(sec < 0 || usec < 0)
+ goto out_nofds;
+
+ if ((unsigned long) sec < MAX_SELECT_SECONDS) {
+ timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
+ timeout += sec * (unsigned long) HZ;
+ }
+ }
+
+ ret = -EINVAL;
+ if (n < 0)
+ goto out_nofds;
+ if (n > current->files->max_fdset)
+ n = current->files->max_fdset;
+
+ /*
+ * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
+ * since we used fdset we need to allocate memory in units of
+ * long-words.
+ */
+ ret = -ENOMEM;
+ size = FDS_BYTES(n);
+ bits = kmalloc(6 * size, GFP_KERNEL);
+ if (!bits)
+ goto out_nofds;
+ fds.in = (unsigned long *) bits;
+ fds.out = (unsigned long *) (bits + size);
+ fds.ex = (unsigned long *) (bits + 2*size);
+ fds.res_in = (unsigned long *) (bits + 3*size);
+ fds.res_out = (unsigned long *) (bits + 4*size);
+ fds.res_ex = (unsigned long *) (bits + 5*size);
+
+ nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
+ if ((ret = get_fd_set32(nn, fds.in, inp)) ||
+ (ret = get_fd_set32(nn, fds.out, outp)) ||
+ (ret = get_fd_set32(nn, fds.ex, exp)))
+ goto out;
+ zero_fd_set(n, fds.res_in);
+ zero_fd_set(n, fds.res_out);
+ zero_fd_set(n, fds.res_ex);
+
+ ret = do_select(n, &fds, &timeout);
+
+ if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
+ time_t sec = 0, usec = 0;
+ if (timeout) {
+ sec = timeout / HZ;
+ usec = timeout % HZ;
+ usec *= (1000000/HZ);
+ }
+ put_user(sec, &tvp->tv_sec);
+ put_user(usec, &tvp->tv_usec);
+ }
+
+ if (ret < 0)
+ goto out;
+ if (!ret) {
+ ret = -ERESTARTNOHAND;
+ if (signal_pending(current))
+ goto out;
+ ret = 0;
+ }
+
+ set_fd_set32(nn, inp, fds.res_in);
+ set_fd_set32(nn, outp, fds.res_out);
+ set_fd_set32(nn, exp, fds.res_ex);
+
+out:
+ kfree(bits);
+out_nofds:
+ return ret;
+}
+
+
+
+struct timespec32 {
+ int tv_sec;
+ int tv_nsec;
+};
+
+extern asmlinkage int sys_sched_rr_get_interval(pid_t pid,
+ struct timespec *interval);
+
+asmlinkage int
+sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct timespec32 *interval)
+{
+ struct timespec t;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ set_fs (KERNEL_DS);
+ ret = sys_sched_rr_get_interval(pid, &t);
+ set_fs (old_fs);
+ if (put_user (t.tv_sec, &interval->tv_sec) ||
+ __put_user (t.tv_nsec, &interval->tv_nsec))
+ return -EFAULT;
+ return ret;
+}
+
+
+extern asmlinkage int sys_nanosleep(struct timespec *rqtp,
+ struct timespec *rmtp);
+
+asmlinkage int
+sys32_nanosleep(struct timespec32 *rqtp, struct timespec32 *rmtp)
+{
+ struct timespec t;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ if (get_user (t.tv_sec, &rqtp->tv_sec) ||
+ __get_user (t.tv_nsec, &rqtp->tv_nsec))
+ return -EFAULT;
+
+ set_fs (KERNEL_DS);
+ ret = sys_nanosleep(&t, rmtp ? &t : NULL);
+ set_fs (old_fs);
+ if (rmtp && ret == -EINTR) {
+ if (__put_user (t.tv_sec, &rmtp->tv_sec) ||
+ __put_user (t.tv_nsec, &rmtp->tv_nsec))
+ return -EFAULT;
+ }
+ return ret;
+}
#include <asm/io.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
+#include <asm/semaphore.h>
#include <asm/softirq.h>
#include <asm/uaccess.h>
EXPORT_SYMBOL_NOVERS(strpbrk);
EXPORT_SYMBOL(_clear_page);
-EXPORT_SYMBOL(local_bh_count);
-EXPORT_SYMBOL(local_irq_count);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(kernel_thread);
*/
EXPORT_SYMBOL(_flush_page_to_ram);
EXPORT_SYMBOL(_flush_cache_all);
+#ifndef CONFIG_COHERENT_IO
EXPORT_SYMBOL(_dma_cache_wback_inv);
EXPORT_SYMBOL(_dma_cache_inv);
+#endif
EXPORT_SYMBOL(invalid_pte_table);
+/*
+ * Semaphore stuff
+ */
+EXPORT_SYMBOL(__down_read);
+EXPORT_SYMBOL(__down_write);
+EXPORT_SYMBOL(__rwsem_wake);
+
/*
* Base address of ports for Intel style I/O.
*/
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/smp.h>
#include <asm/bootinfo.h>
#include <asm/mipsregs.h>
#include <asm/processor.h>
len += sprintf(buffer + len, "BogoMIPS\t\t: %lu.%02lu\n",
(loops_per_sec + 2500) / 500000,
((loops_per_sec + 2500) / 5000) % 100);
+ len += sprintf(buffer + len, "Number of cpus\t\t: %d\n", smp_num_cpus);
#if defined (__MIPSEB__)
len += sprintf(buffer + len, "byteorder\t\t: big endian\n");
#endif
return len;
}
+
+void init_irq_proc(void)
+{
+ /* Nothing, for now. */
+}
-/* $Id: process.c,v 1.5 2000/01/29 01:41:59 ralf Exp $
+/* $Id: process.c,v 1.4 2000/01/16 01:34:01 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
* Copyright (C) 1994 - 1999 by Ralf Baechle and others.
* Copyright (C) 1999 Silicon Graphics, Inc.
*/
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
asmlinkage int cpu_idle(void)
{
/* endless idle loop with no priority at all */
+ init_idle();
current->priority = 0;
current->counter = -100;
while (1) {
void exit_thread(void)
{
/* Forget lazy fpu state */
- if (last_task_used_math == current) {
+ if (IS_FPU_OWNER()) {
set_cp0_status(ST0_CU1, ST0_CU1);
__asm__ __volatile__("cfc1\t$0,$31");
- last_task_used_math = NULL;
+ CLEAR_FPU_OWNER();
}
}
void flush_thread(void)
{
/* Forget lazy fpu state */
- if (last_task_used_math == current) {
+ if (IS_FPU_OWNER()) {
set_cp0_status(ST0_CU1, ST0_CU1);
__asm__ __volatile__("cfc1\t$0,$31");
- last_task_used_math = NULL;
+ CLEAR_FPU_OWNER();
}
}
childksp = (unsigned long)p + KERNEL_STACK_SIZE - 32;
- if (last_task_used_math == current) {
- set_cp0_status(ST0_CU1, ST0_CU1);
+ if (IS_FPU_OWNER()) {
save_fp(p);
}
/* set up new TSS. */
* Copyright (C) Linus Torvalds
* Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle
* Copyright (C) 1996 David S. Miller
+ * Copyright (C) 2000 Ulf Carlsson
*
* At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit
* binaries.
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/ptrace.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
+#include <linux/user.h>
+#include <asm/mipsregs.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+/* Tracing a 32-bit process with a 64-bit strace and vice verca will not
+ work. I don't know how to fix this. */
+
+asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
+{
+ struct task_struct *child;
+ int ret;
+
+ lock_kernel();
+#if 0
+ printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n",
+ (int) request, (int) pid, (unsigned long) addr,
+ (unsigned long) data);
+#endif
+ ret = -EPERM;
+ if (request == PTRACE_TRACEME) {
+ /* are we already being traced? */
+ if (current->flags & PF_PTRACED)
+ goto out;
+ /* set the ptrace bit in the process flags. */
+ current->flags |= PF_PTRACED;
+ ret = 0;
+ goto out;
+ }
+ ret = -ESRCH;
+ read_lock(&tasklist_lock);
+ child = find_task_by_pid(pid);
+ if (child)
+ get_task_struct(child);
+ read_unlock(&tasklist_lock);
+ if (!child)
+ goto out;
+
+ ret = -EPERM;
+ if (pid == 1) /* you may not mess with init */
+ goto out_tsk;
+
+ if (request == PTRACE_ATTACH) {
+ if (child == current)
+ goto out_tsk;
+ if ((!child->dumpable ||
+ (current->uid != child->euid) ||
+ (current->uid != child->suid) ||
+ (current->uid != child->uid) ||
+ (current->gid != child->egid) ||
+ (current->gid != child->sgid) ||
+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
+ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
+ goto out_tsk;
+ /* the same process cannot be attached many times */
+ if (child->flags & PF_PTRACED)
+ goto out_tsk;
+ child->flags |= PF_PTRACED;
+
+ write_lock_irq(&tasklist_lock);
+ if (child->p_pptr != current) {
+ REMOVE_LINKS(child);
+ child->p_pptr = current;
+ SET_LINKS(child);
+ }
+ write_unlock_irq(&tasklist_lock);
+
+ send_sig(SIGSTOP, child, 1);
+ ret = 0;
+ goto out_tsk;
+ }
+ ret = -ESRCH;
+ if (!(child->flags & PF_PTRACED))
+ goto out_tsk;
+ if (child->state != TASK_STOPPED) {
+ if (request != PTRACE_KILL)
+ goto out_tsk;
+ }
+ if (child->p_pptr != current)
+ goto out_tsk;
+
+ switch (request) {
+ /* when I and D space are separate, these will need to be fixed. */
+ case PTRACE_PEEKTEXT: /* read word at location addr. */
+ case PTRACE_PEEKDATA: {
+ unsigned int tmp;
+ int copied;
+
+ copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
+ ret = -EIO;
+ if (copied != sizeof(tmp))
+ break;
+ ret = put_user(tmp, (unsigned int *) data);
+ break;
+ }
+
+ /* read the word at location addr in the USER area. */
+ case PTRACE_PEEKUSR: {
+ struct pt_regs *regs;
+ unsigned int tmp;
+
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+ ret = 0;
+
+ switch (addr) {
+ case 0 ... 31:
+ tmp = regs->regs[addr];
+ break;
+ case FPR_BASE ... FPR_BASE + 31:
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ }
+#endif
+ tmp = child->thread.fpu.hard.fp_regs[addr - 32];
+ } else {
+ tmp = -EIO;
+ }
+ break;
+ case PC:
+ tmp = regs->cp0_epc;
+ break;
+ case CAUSE:
+ tmp = regs->cp0_cause;
+ break;
+ case BADVADDR:
+ tmp = regs->cp0_badvaddr;
+ break;
+ case MMHI:
+ tmp = regs->hi;
+ break;
+ case MMLO:
+ tmp = regs->lo;
+ break;
+ case FPC_CSR:
+ tmp = child->thread.fpu.hard.control;
+ break;
+ case FPC_EIR: { /* implementation / version register */
+ unsigned int flags;
+ __save_flags(flags);
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
+ __restore_flags(flags);
+ break;
+ }
+ default:
+ tmp = 0;
+ ret = -EIO;
+ goto out_tsk;
+ }
+ ret = put_user(tmp, (unsigned *) data);
+ break;
+ }
+ /* when I and D space are separate, this will have to be fixed. */
+ case PTRACE_POKETEXT: /* write the word at location addr. */
+ case PTRACE_POKEDATA:
+ ret = 0;
+ if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
+ break;
+ ret = -EIO;
+ break;
+
+ case PTRACE_POKEUSR: {
+ struct pt_regs *regs;
+ ret = 0;
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+
+ switch (addr) {
+ case 0 ... 31:
+ regs->regs[addr] = data;
+ break;
+ case FPR_BASE ... FPR_BASE + 31: {
+ unsigned long *fregs;
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ regs->cp0_status &= ~ST0_CU1;
+ }
+#endif
+ } else {
+ /* FP not yet used */
+ memset(&child->thread.fpu.hard, ~0,
+ sizeof(child->thread.fpu.hard));
+ child->thread.fpu.hard.control = 0;
+ }
+ fregs = child->thread.fpu.hard.fp_regs;
+ fregs[addr - FPR_BASE] = data;
+ break;
+ }
+ case PC:
+ regs->cp0_epc = data;
+ break;
+ case MMHI:
+ regs->hi = data;
+ break;
+ case MMLO:
+ regs->lo = data;
+ break;
+ case FPC_CSR:
+ child->thread.fpu.hard.control = data;
+ break;
+ default:
+ /* The rest are not allowed. */
+ ret = -EIO;
+ break;
+ }
+ goto out;
+ }
+ case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
+ case PTRACE_CONT: { /* restart after signal. */
+ ret = -EIO;
+ if ((unsigned int) data > _NSIG)
+ break;
+ if (request == PTRACE_SYSCALL)
+ child->flags |= PF_TRACESYS;
+ else
+ child->flags &= ~PF_TRACESYS;
+ child->exit_code = data;
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+/*
+ * make the child exit. Best I can do is send it a sigkill.
+ * perhaps it should be put in the status that it wants to
+ * exit.
+ */
+ case PTRACE_KILL: {
+ if (child->state == TASK_ZOMBIE) /* already dead */
+ break;
+ child->exit_code = SIGKILL;
+ wake_up_process(child);
+ break;
+ }
+
+ case PTRACE_DETACH: { /* detach a process that was attached. */
+ ret = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
+ child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->exit_code = data;
+ write_lock_irq(&tasklist_lock);
+ REMOVE_LINKS(child);
+ child->p_pptr = child->p_opptr;
+ SET_LINKS(child);
+ write_unlock_irq(&tasklist_lock);
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+ default:
+ ret = -EIO;
+ break;
+ }
+
+out_tsk:
+ free_task_struct(child);
+out:
+ unlock_kernel();
+ return ret;
+}
+
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
+{
+ struct task_struct *child;
+ int ret;
+
+ lock_kernel();
+#if 0
+ printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n",
+ (int) request, (int) pid, (unsigned long) addr,
+ (unsigned long) data);
+#endif
+ ret = -EPERM;
+ if (request == PTRACE_TRACEME) {
+ /* are we already being traced? */
+ if (current->flags & PF_PTRACED)
+ goto out;
+ /* set the ptrace bit in the process flags. */
+ current->flags |= PF_PTRACED;
+ ret = 0;
+ goto out;
+ }
+ ret = -ESRCH;
+ read_lock(&tasklist_lock);
+ child = find_task_by_pid(pid);
+ if (child)
+ get_task_struct(child);
+ read_unlock(&tasklist_lock);
+ if (!child)
+ goto out;
+
+ ret = -EPERM;
+ if (pid == 1) /* you may not mess with init */
+ goto out;
+
+ if (request == PTRACE_ATTACH) {
+ if (child == current)
+ goto out_tsk;
+ if ((!child->dumpable ||
+ (current->uid != child->euid) ||
+ (current->uid != child->suid) ||
+ (current->uid != child->uid) ||
+ (current->gid != child->egid) ||
+ (current->gid != child->sgid) ||
+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
+ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
+ goto out_tsk;
+ /* the same process cannot be attached many times */
+ if (child->flags & PF_PTRACED)
+ goto out_tsk;
+ child->flags |= PF_PTRACED;
+
+ write_lock_irq(&tasklist_lock);
+ if (child->p_pptr != current) {
+ REMOVE_LINKS(child);
+ child->p_pptr = current;
+ SET_LINKS(child);
+ }
+ write_unlock_irq(&tasklist_lock);
+
+ send_sig(SIGSTOP, child, 1);
+ ret = 0;
+ goto out_tsk;
+ }
+ ret = -ESRCH;
+ if (!(child->flags & PF_PTRACED))
+ goto out_tsk;
+ if (child->state != TASK_STOPPED) {
+ if (request != PTRACE_KILL)
+ goto out_tsk;
+ }
+ if (child->p_pptr != current)
+ goto out_tsk;
+
+ switch (request) {
+ /* when I and D space are separate, these will need to be fixed. */
+ case PTRACE_PEEKTEXT: /* read word at location addr. */
+ case PTRACE_PEEKDATA: {
+ unsigned long tmp;
+ int copied;
+
+ copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
+ ret = -EIO;
+ if (copied != sizeof(tmp))
+ break;
+ ret = put_user(tmp,(unsigned long *) data);
+ break;
+ }
+
+ /* read the word at location addr in the USER area. */
+ case PTRACE_PEEKUSR: {
+ struct pt_regs *regs;
+ unsigned long tmp;
+
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+ ret = 0;
+
+ switch (addr) {
+ case 0 ... 31:
+ tmp = regs->regs[addr];
+ break;
+ case FPR_BASE ... FPR_BASE + 31:
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ }
+#endif
+ tmp = child->thread.fpu.hard.fp_regs[addr - 32];
+ } else {
+ tmp = -EIO;
+ }
+ break;
+ case PC:
+ tmp = regs->cp0_epc;
+ break;
+ case CAUSE:
+ tmp = regs->cp0_cause;
+ break;
+ case BADVADDR:
+ tmp = regs->cp0_badvaddr;
+ break;
+ case MMHI:
+ tmp = regs->hi;
+ break;
+ case MMLO:
+ tmp = regs->lo;
+ break;
+ case FPC_CSR:
+ tmp = child->thread.fpu.hard.control;
+ break;
+ case FPC_EIR: { /* implementation / version register */
+ unsigned int flags;
+ __save_flags(flags);
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
+ __restore_flags(flags);
+ break;
+ }
+ default:
+ tmp = 0;
+ ret = -EIO;
+ goto out_tsk;
+ }
+ ret = put_user(tmp, (unsigned long *) data);
+ break;
+ }
+ /* when I and D space are separate, this will have to be fixed. */
+ case PTRACE_POKETEXT: /* write the word at location addr. */
+ case PTRACE_POKEDATA:
+ ret = 0;
+ if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
+ break;
+ ret = -EIO;
+ break;
+
+ case PTRACE_POKEUSR: {
+ struct pt_regs *regs;
+ ret = 0;
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+
+ switch (addr) {
+ case 0 ... 31:
+ regs->regs[addr] = data;
+ break;
+ case FPR_BASE ... FPR_BASE + 31: {
+ unsigned long *fregs;
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ regs->cp0_status &= ~ST0_CU1;
+ }
+#endif
+ } else {
+ /* FP not yet used */
+ memset(&child->thread.fpu.hard, ~0,
+ sizeof(child->thread.fpu.hard));
+ child->thread.fpu.hard.control = 0;
+ }
+ fregs = child->thread.fpu.hard.fp_regs;
+ fregs[addr - FPR_BASE] = data;
+ break;
+ }
+ case PC:
+ regs->cp0_epc = data;
+ break;
+ case MMHI:
+ regs->hi = data;
+ break;
+ case MMLO:
+ regs->lo = data;
+ break;
+ case FPC_CSR:
+ child->thread.fpu.hard.control = data;
+ break;
+ default:
+ /* The rest are not allowed. */
+ ret = -EIO;
+ break;
+ }
+ goto out;
+ }
+ case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
+ case PTRACE_CONT: { /* restart after signal. */
+ ret = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
+ if (request == PTRACE_SYSCALL)
+ child->flags |= PF_TRACESYS;
+ else
+ child->flags &= ~PF_TRACESYS;
+ child->exit_code = data;
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+/*
+ * make the child exit. Best I can do is send it a sigkill.
+ * perhaps it should be put in the status that it wants to
+ * exit.
+ */
+ case PTRACE_KILL: {
+ if (child->state == TASK_ZOMBIE) /* already dead */
+ break;
+ child->exit_code = SIGKILL;
+ wake_up_process(child);
+ break;
+ }
+
+ case PTRACE_DETACH: { /* detach a process that was attached. */
+ ret = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
+ child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->exit_code = data;
+ write_lock_irq(&tasklist_lock);
+ REMOVE_LINKS(child);
+ child->p_pptr = child->p_opptr;
+ SET_LINKS(child);
+ write_unlock_irq(&tasklist_lock);
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+ default:
+ ret = -EIO;
+ break;
+ }
+
+out_tsk:
+ free_task_struct(child);
+out:
+ unlock_kernel();
+ return ret;
+}
asmlinkage void syscall_trace(void)
{
-/* $Id: r4k_cache.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: r4k_cache.S,v 1.1 1999/10/10 18:49:17 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
-/* $Id: r4k_fpu.S,v 1.1 1999/09/28 22:25:52 ralf Exp $
+/* $Id: r4k_fpu.S,v 1.1 1999/09/27 16:01:38 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
-/* $Id: r4k_genex.S,v 1.3 2000/01/20 23:32:21 ralf Exp $
+/* $Id: r4k_genex.S,v 1.3 1999/11/23 17:12:49 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
NESTED(handle_\exception, PT_SIZE, sp)
.set noat
SAVE_ALL
+#if DEBUG_MIPS64
+jal dodebug2
+ld $4, PT_R4(sp)
+ld $5, PT_R5(sp)
+ld $6, PT_R6(sp)
+ld $7, PT_R7(sp)
+ld $2, PT_R2(sp)
+#endif
__BUILD_clear_\clear
.set at
__BUILD_\verbose \exception
* Copyright (C) 1994, 1995, 1996, by Andreas Busse
* Copyright (C) 1999 Silicon Graphics, Inc.
*/
+#include <linux/config.h>
#include <asm/asm.h>
#include <asm/bootinfo.h>
#include <asm/cachectl.h>
*/
move $28, a1
cpu_restore_nonscratch $28
+#ifndef CONFIG_SMP
daddiu t0, $28, KERNEL_STACK_SIZE-32
sd t0, kernelsp
+#else
+ mtc0 a1, CP0_WATCHLO
+ dsrl32 a1, a1, 0
+ mtc0 a1, CP0_WATCHHI
+#endif
mfc0 t1, CP0_STATUS /* Do we really need this? */
li a3, 0xff00
and t1, a3
beqz a0, 2f # Save floating point state
nor t3, zero, t3
- lw t1, ST_OFF(a0) # last thread looses fpu
+ ld t1, ST_OFF(a0) # last thread looses fpu
and t1, t3
sd t1, ST_OFF(a0)
sll t2, t1, 5
fpu_save_16even a0 t1 # clobbers t1
2:
+ beqz a1, 3f
+
sll t0, t0, 5 # load new fp state
bgez t0, 1f
ldc1 $f0, (THREAD_FPU + 0x00)($28)
1:
.set reorder
fpu_restore_16even $28, t0 # clobbers t0
+3:
jr ra
END(lazy_fpu_switch)
-/* $Id: r4k_tlb_debug.c,v 1.3 2000/01/29 01:41:59 ralf Exp $
+/* $Id: r4k_tlb_debug.c,v 1.2 2000/01/17 23:32:46 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
-/* $Id: r4k_tlb_glue.S,v 1.2 2000/01/17 23:32:46 ralf Exp $
+/* $Id: r4k_tlb_glue.S,v 1.5 1999/11/23 17:12:49 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
END(__tlb_refill_debug_tramp)
__FINIT
- .macro tlb_handler name
+ .macro __BUILD_cli
+ CLI
+ .endm
+
+ .macro __BUILD_sti
+ STI
+ .endm
+
+ .macro tlb_handler name interruptible
NESTED(__\name, PT_SIZE, sp)
SAVE_ALL
- CLI
+#if DEBUG_MIPS64
+jal dodebug2
+ld $4, PT_R4(sp)
+ld $5, PT_R5(sp)
+ld $6, PT_R6(sp)
+ld $7, PT_R7(sp)
+ld $2, PT_R2(sp)
+#endif
+ __BUILD_\interruptible
dmfc0 t0, CP0_BADVADDR
sd t0, PT_BVADDR(sp)
move a0, sp
END(__\name)
.endm
- tlb_handler tlb_refill_debug
- tlb_handler xtlb_refill_debug
- tlb_handler xtlb_mod_debug
- tlb_handler xtlb_tlbl_debug
- tlb_handler xtlb_tlbs_debug
+ tlb_handler tlb_refill_debug cli
+ tlb_handler xtlb_refill_debug cli
+ tlb_handler xtlb_mod_debug sti
+ tlb_handler xtlb_tlbl_debug sti
+ tlb_handler xtlb_tlbs_debug sti
/* This duplicates the definition from <asm/signal.h> */
#define SIGILL 4 /* Illegal instruction (ANSI). */
-/* Highest syscall handled here. */
-#define MAX_SYSCALL_NO __NR_Linux + __NR_Linux_syscalls
-
#ifndef CONFIG_MIPS32_COMPAT
#define handle_sys64 handle_sys
#endif
#ifndef CONFIG_MIPS32_COMPAT
.set noat
SAVE_SOME
+ STI
.set at
#endif
ld t1, PT_EPC(sp) # skip syscall on return
- sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number
+ subu t0, v0, __NR_Linux # check syscall number
+ sltiu t0, t0, __NR_Linux_syscalls + 1
daddiu t1, 4 # skip to next instruction
beqz t0, illegal_syscall
sd t1, PT_EPC(sp)
- dsll t0, v0, 3
+ dsll t0, v0, 3 # offset into table
ld t2, (sys_call_table - (__NR_Linux * 8))(t0) # syscall routine
- beqz t2, illegal_syscall;
sd a3, PT_R26(sp) # save a3 for syscall restarting
PTR sys_ni_syscall /* ptrace */
PTR sys_alarm
PTR sys_fstat
- PTR sys_ni_syscall
+ PTR sys_pause
PTR sys_utime /* 4030 */
PTR sys_ni_syscall
PTR sys_ni_syscall
PTR sys_ni_syscall
PTR sys_ni_syscall
PTR sys_pivot_root /* 4210 */
+ PTR sys_mincore
+ PTR sys_madvise
-/* $Id: scall_o32.S,v 1.8 2000/02/23 00:41:00 ralf Exp $
+/* $Id: scall_o32.S,v 1.18 2000/03/27 21:04:13 ulfc 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
SAVE_SOME
STI
.set at
- SAVE_ALL
- ld a1, PT_R2(sp)
- PRINT("Got syscall %d\n")
- RESTORE_ALL
-
+#if DEBUG_MIPS64
+ jal dodebug
+ ld $4, PT_R4(sp)
+ ld $5, PT_R5(sp)
+ ld $6, PT_R6(sp)
+ ld $7, PT_R7(sp)
+ ld $2, PT_R2(sp)
+#endif
ld t1, PT_EPC(sp) # skip syscall on return
- sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number
+ subu t0, v0, __NR_Linux32 # check syscall number
+ sltiu t0, t0, __NR_Linux32_syscalls + 1
daddiu t1, 4 # skip to next instruction
beqz t0, not_o32_scall
sd t1, PT_EPC(sp)
/* XXX Put both in one cacheline, should save a bit. */
- dsll t0, v0, 3
+ dsll t0, v0, 3 # offset into table
ld t2, (sys_call_table - (__NR_Linux32 * 8))(t0) # syscall routine
lbu t3, (sys_narg_table - __NR_Linux32)(v0) # number of arguments
- beqz t2, illegal_syscall;
subu t0, t3, 5 # 5 or more arguments?
sd a3, PT_R26(sp) # save a3 for syscall restarting
negu v0 # error
sd v0, PT_R0(sp) # set flag for syscall restarting
1: sd v0, PT_R2(sp) # result
-
+
FEXPORT(o32_ret_from_sys_call)
lw t0, softirq_state
lw t1, softirq_state+4 # unused delay slot
trace_a_syscall:
SAVE_STATIC
+ sd a4, PT_R8(sp)
+ sd a5, PT_R9(sp)
+ sd a6, PT_R10(sp)
+ sd a7, PT_R11(sp)
+
sd t2,PT_R1(sp)
jal syscall_trace
ld t2,PT_R1(sp)
ld a1, PT_R5(sp)
ld a2, PT_R6(sp)
ld a3, PT_R7(sp)
+ ld a4, PT_R8(sp)
+ ld a5, PT_R9(sp)
+
jalr t2
li t0, -EMAXERRNO - 1 # error?
1: sd v0, PT_R2(sp) # result
jal syscall_trace
- j ret_from_sys_call
+ j o32_ret_from_sys_call
/* ------------------------------------------------------------------------ */
sys sys_read 3
sys sys_write 3
sys sys_open 3 /* 4005 */
- sys sys_close 3
+ sys sys_close 1
sys sys_waitpid 3
sys sys_creat 2
sys sys_link 2
sys sys_unlink 1 /* 4010 */
- sys sys_execve 0
+ sys sys32_execve 0
sys sys_chdir 1
sys sys_time 1
sys sys_mknod 3
sys sys_setuid 1
sys sys_getuid 0
sys sys_stime 1 /* 4025 */
- sys sys_ni_syscall 0 /* ptrace */
- sys sys_alarm 1
+ sys sys32_ptrace 4
+ sys sys32_alarm 1
sys sys_fstat 2
- sys sys_ni_syscall 0
+ sys sys_pause 0
sys sys_utime 2 /* 4030 */
sys sys_ni_syscall 0
sys sys_ni_syscall 0
sys sys_acct 0
sys sys_umount 2
sys sys_ni_syscall 0
- sys sys_ioctl 3
+ sys sys32_ioctl 3
sys sys_fcntl 3 /* 4055 */
sys sys_ni_syscall 2
sys sys_setpgid 2
sys sys32_sigsuspend 0
sys sys32_sigpending 1
sys sys_sethostname 2
- sys sys_setrlimit 2 /* 4075 */
- sys sys_old_getrlimit 2
- sys sys_getrusage 2
- sys sys_gettimeofday 2
- sys sys_settimeofday 2
+ sys sys32_setrlimit 2 /* 4075 */
+ sys sys32_getrlimit 2
+ sys sys32_getrusage 2
+ sys sys32_gettimeofday 2
+ sys sys32_settimeofday 2
sys sys_getgroups 2 /* 4080 */
sys sys_setgroups 2
sys sys_ni_syscall 0 /* old_select */
sys sys_uselib 1
sys sys_swapon 2
sys sys_reboot 3
- sys old_readdir 3
+ sys sys32_readdir 3
sys sys_mmap 6 /* 4090 */
sys sys_munmap 2
sys sys_truncate 2
sys sys_getpriority 2
sys sys_setpriority 3
sys sys_ni_syscall 0
- sys sys_statfs 2
- sys sys_fstatfs 2 /* 4100 */
+ sys sys32_statfs 2
+ sys sys32_fstatfs 2 /* 4100 */
sys sys_ni_syscall 0 /* sys_ioperm */
sys sys_socketcall 2
sys sys_syslog 3
- sys sys_setitimer 3
- sys sys_getitimer 2 /* 4105 */
+ sys sys32_setitimer 3
+ sys sys32_getitimer 2 /* 4105 */
sys sys32_newstat 2
sys sys32_newlstat 2
sys sys32_newfstat 2
sys sys_vhangup 0
sys sys_ni_syscall 0 /* was sys_idle */
sys sys_ni_syscall 0 /* sys_vm86 */
- sys sys_wait4 4
+ sys sys32_wait4 4
sys sys_swapoff 1 /* 4115 */
sys sys_sysinfo 1
sys sys_ipc 6
sys sys_ni_syscall 0 /* sys_modify_ldt */
sys sys_adjtimex 1
sys sys_mprotect 3 /* 4125 */
- sys sys_sigprocmask 3
+ sys sys32_sigprocmask 3
sys sys_create_module 2
sys sys_init_module 5
sys sys_delete_module 1
sys sys_ni_syscall 0 /* for afs_syscall */
sys sys_setfsuid 1
sys sys_setfsgid 1
- sys sys_llseek 5 /* 4140 */
- sys sys_getdents 3
- sys sys_select 5
+ sys sys32_llseek 5 /* 4140 */
+ sys sys32_getdents 3
+ sys sys32_select 5
sys sys_flock 2
sys sys_msync 3
- sys sys_readv 3 /* 4145 */
- sys sys_writev 3
+ sys sys32_readv 3 /* 4145 */
+ sys sys32_writev 3
sys sys_cacheflush 3
sys sys_cachectl 3
sys sys_sysmips 4
sys sys_sched_yield 0
sys sys_sched_get_priority_max 1
sys sys_sched_get_priority_min 1
- sys sys_sched_rr_get_interval 2 /* 4165 */
- sys sys_nanosleep 2
+ sys sys32_sched_rr_get_interval 2 /* 4165 */
+ sys sys32_nanosleep 2
sys sys_mremap 4
sys sys_accept 3
sys sys_bind 3
sys sys_lstat64 3
sys sys_fstat64 3 /* 4210 */
sys sys_pivot_root 2
+ sys sys_mincore 3
+ sys sys_madvise 3
.endm
.macro sys function, nargs
-/* $Id: setup.c,v 1.7 2000/02/04 07:40:24 ralf Exp $
+/* $Id: setup.c,v 1.9 2000/03/14 01:39:27 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
#include <asm/system.h>
#ifdef CONFIG_SGI_IP27
+/* XXX Origin garbage has no business in this file */
#include <asm/sn/sn0/addrs.h>
#endif
-struct mips_cpuinfo boot_cpu_data;
+#ifndef CONFIG_SMP
+struct cpuinfo_mips cpu_data[1];
+#endif
#ifdef CONFIG_VT
struct screen_info screen_info;
* mips_io_port_base is the begin of the address space to which x86 style
* I/O ports are mapped.
*/
+#ifdef CONFIG_SGI_IP27
+/* XXX Origin garbage has no business in this file */
unsigned long mips_io_port_base = IO_BASE;
+#endif
extern void ip22_setup(void);
extern void ip27_setup(void);
*memory_start_p = initrd_end;
}
#endif
+
+ paging_init();
}
-/* $Id: signal.c,v 1.5 2000/02/04 07:40:24 ralf Exp $
+/* $Id: signal.c,v 1.4 2000/01/17 23:32:46 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
#include <asm/stackframe.h>
#include <asm/uaccess.h>
#include <asm/ucontext.h>
+#include <asm/system.h>
#define DEBUG_SIG 0
extern asmlinkage int save_fp_context(struct sigcontext *sc);
extern asmlinkage int restore_fp_context(struct sigcontext *sc);
+static inline int store_fp_context(struct sigcontext *sc)
+{
+ unsigned int fcr0;
+ int err = 0;
+
+ err |= __copy_to_user(&sc->sc_fpregs[0],
+ ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS *
+ sizeof(unsigned long));
+ err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control,
+ sizeof(unsigned int));
+ __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0));
+ err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int));
+
+ return err;
+}
+
+static inline int refill_fp_context(struct sigcontext *sc)
+{
+ int err = 0;
+
+ if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
+ return -EFAULT;
+ err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0],
+ &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
+ err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr,
+ sizeof(unsigned int));
+ return err;
+}
+
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
err |= __get_user(owned_fp, &sc->sc_ownedfp);
if (owned_fp) {
- err |= restore_fp_context(sc);
- last_task_used_math = current;
+ if (IS_FPU_OWNER()) {
+ CLEAR_FPU_OWNER();
+ regs->cp0_status &= ~ST0_CU1;
+ }
+ current->used_math = 1;
+ err |= refill_fp_context(sc);
}
return err;
static int inline
setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
{
- int owned_fp;
int err = 0;
err |= __put_user(regs->cp0_epc, &sc->sc_pc);
- err |= __put_user(regs->cp0_status, &sc->sc_status);
#define save_gp_reg(i) { \
err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \
err |= __put_user(regs->cp0_cause, &sc->sc_cause);
err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr);
- owned_fp = (current == last_task_used_math);
- err |= __put_user(owned_fp, &sc->sc_ownedfp);
-
if (current->used_math) { /* fp is active. */
- set_cp0_status(ST0_CU1, ST0_CU1);
- err |= save_fp_context(sc);
- last_task_used_math = NULL;
- regs->cp0_status &= ~ST0_CU1;
+ if (IS_FPU_OWNER()) {
+ lazy_fpu_switch(current, 0);
+ CLEAR_FPU_OWNER();
+ regs->cp0_status &= ~ST0_CU1;
+ }
+ err |= __put_user(1, &sc->sc_ownedfp);
+ err |= store_fp_context(sc);
current->used_math = 0;
+ } else {
+ err |= __put_user(0, &sc->sc_ownedfp);
}
+ err |= __put_user(regs->cp0_status, &sc->sc_status);
return err;
}
-/* $Id: signal32.c,v 1.2 2000/02/18 00:03:48 ralf Exp $
+/* $Id: signal32.c,v 1.4 2000/03/15 22:46:55 kanoj 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
* Copyright (C) 1994 - 1999 Ralf Baechle
* Copyright (C) 1999 Silicon Graphics, Inc.
*/
+#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <asm/stackframe.h>
#include <asm/uaccess.h>
#include <asm/ucontext.h>
+#include <asm/system.h>
#define DEBUG_SIG 0
/* 32-bit compatibility types */
-#define _NSIG32 128
#define _NSIG32_BPW 32
-#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
+#define _NSIG32_WORDS (_NSIG / _NSIG32_BPW)
typedef struct {
- unsigned int sig[_NSIG_WORDS];
+ unsigned int sig[_NSIG32_WORDS];
} sigset32_t;
typedef unsigned int __sighandler32_t;
} stack32_t;
+static inline int store_fp_context(struct sigcontext *sc)
+{
+ unsigned int fcr0;
+ int err = 0;
+
+ err |= __copy_to_user(&sc->sc_fpregs[0],
+ ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS *
+ sizeof(unsigned long));
+ err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control,
+ sizeof(unsigned int));
+ __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0));
+ err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int));
+
+ return err;
+}
+
+static inline int refill_fp_context(struct sigcontext *sc)
+{
+ int err = 0;
+
+ if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
+ return -EFAULT;
+ err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0],
+ &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
+ err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr,
+ sizeof(unsigned int));
+ return err;
+}
+
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
err |= __get_user(owned_fp, &sc->sc_ownedfp);
if (owned_fp) {
- err |= restore_fp_context(sc);
- last_task_used_math = current;
+ if (IS_FPU_OWNER()) {
+ CLEAR_FPU_OWNER();
+ regs->cp0_status &= ~ST0_CU1;
+ }
+ current->used_math = 1;
+ err |= refill_fp_context(sc);
}
return err;
{
struct sigframe *frame;
sigset_t blocked;
+
+#if DEBUG_MIPS64
printk("%s called.\n", __FUNCTION__);
+#endif
frame = (struct sigframe *) regs.regs[29];
if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
static int inline
setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
{
- int owned_fp;
int err = 0;
err |= __put_user(regs->cp0_epc, &sc->sc_pc);
- err |= __put_user(regs->cp0_status, &sc->sc_status);
#define save_gp_reg(i) { \
err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \
err |= __put_user(regs->cp0_cause, &sc->sc_cause);
err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr);
- owned_fp = (current == last_task_used_math);
- err |= __put_user(owned_fp, &sc->sc_ownedfp);
-
if (current->used_math) { /* fp is active. */
- set_cp0_status(ST0_CU1, ST0_CU1);
- err |= save_fp_context(sc);
- last_task_used_math = NULL;
- regs->cp0_status &= ~ST0_CU1;
+ if (IS_FPU_OWNER()) {
+ lazy_fpu_switch(current, 0);
+ CLEAR_FPU_OWNER();
+ regs->cp0_status &= ~ST0_CU1;
+ }
+ err |= __put_user(1, &sc->sc_ownedfp);
+ err |= store_fp_context(sc);
current->used_math = 0;
+ } else {
+ err |= __put_user(0, &sc->sc_ownedfp);
}
+ err |= __put_user(regs->cp0_status, &sc->sc_status);
return err;
}
/*
* Set up the return code ...
*
- * li v0, __NR_sigreturn
+ * li v0, __NR_Linux32_sigreturn
* syscall
*/
- err |= __put_user(0x24020000 + __NR_sigreturn,
+ err |= __put_user(0x24020000 + __NR_Linux32_sigreturn,
frame->sf_code + 0);
err |= __put_user(0x0000000c ,
frame->sf_code + 1);
/*
* Set up the return code ...
*
- * li v0, __NR_sigreturn
+ * li v0, __NR_Linux32_sigreturn
* syscall
*/
- err |= __put_user(0x24020000 + __NR_sigreturn,
+ err |= __put_user(0x24020000 + __NR_Linux32_sigreturn,
frame->rs_code + 0);
err |= __put_user(0x0000000c ,
frame->rs_code + 1);
{
struct k_sigaction *ka;
siginfo_t info;
+
+#if DEBUG_MIPS64
printk("%s: delivering signal.\n", current->comm);
+#endif
if (!oldset)
oldset = ¤t->blocked;
if (regs->regs[0])
syscall_restart(regs, ka);
/* Whee! Actually deliver the signal. */
+#if DEBUG_MIPS64
printk("%s: delivering signal.\n", __FUNCTION__);
+#endif
handle_signal(signr, ka, &info, oldset, regs);
return 1;
}
return 0;
}
+extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set,
+ old_sigset_t *oset);
+
+asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set,
+ old_sigset_t32 *oset)
+{
+ old_sigset_t s;
+ int ret;
+ mm_segment_t old_fs = get_fs();
+
+ if (set && get_user (s, set)) return -EFAULT;
+ set_fs (KERNEL_DS);
+ ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
+ set_fs (old_fs);
+ if (ret) return ret;
+ if (oset && put_user (s, oset)) return -EFAULT;
+ return 0;
+}
+
/* Dummies ... */
asmlinkage void sys32_sigpending(void) { panic(__FUNCTION__ " called."); }
--- /dev/null
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/threads.h>
+#include <linux/time.h>
+#include <linux/timex.h>
+#include <linux/sched.h>
+
+#include <asm/atomic.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/hardirq.h>
+#include <asm/softirq.h>
+#include <asm/mmu_context.h>
+
+#ifdef CONFIG_SGI_IP27
+
+#include <asm/sn/arch.h>
+#include <asm/sn/intr.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/agent.h>
+#include <asm/sn/sn0/ip27.h>
+
+#define DORESCHED 0xab
+#define DOCALL 0xbc
+
+#define IRQ_TO_SWLEVEL(i) i + 7 /* Delete this from here */
+
+static void sendintr(int destid, unsigned char status)
+{
+ int irq;
+
+#if (CPUS_PER_NODE == 2)
+ switch (status) {
+ case DORESCHED: irq = CPU_RESCHED_A_IRQ; break;
+ case DOCALL: irq = CPU_CALL_A_IRQ; break;
+ default: panic("sendintr");
+ }
+ irq += cputoslice(destid);
+
+ /*
+ * Convert the compact hub number to the NASID to get the correct
+ * part of the address space. Then set the interrupt bit associated
+ * with the CPU we want to send the interrupt to.
+ */
+ REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cputocnode(destid)),
+ IRQ_TO_SWLEVEL(irq));
+#else
+ << Bomb! Must redefine this for more than 2 CPUS. >>
+#endif
+}
+
+#endif /* CONFIG_SGI_IP27 */
+
+/* The 'big kernel lock' */
+spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+int smp_threads_ready = 0; /* Not used */
+atomic_t smp_commenced = ATOMIC_INIT(0);
+struct cpuinfo_mips cpu_data[NR_CPUS];
+int smp_num_cpus; /* Number that came online. */
+int __cpu_number_map[NR_CPUS];
+int __cpu_logical_map[NR_CPUS];
+cycles_t cacheflush_time;
+
+static void smp_tune_scheduling (void)
+{
+}
+
+void __init smp_boot_cpus(void)
+{
+ extern void allowboot(void);
+ extern int maxcpus;
+
+ init_new_context(current, &init_mm);
+ global_irq_holder = 0;
+ current->processor = 0;
+ init_idle();
+ smp_tune_scheduling();
+ smp_num_cpus = maxcpus;
+ allowboot();
+}
+
+void __init smp_commence(void)
+{
+ wmb();
+ atomic_set(&smp_commenced,1);
+}
+
+static void stop_this_cpu(void *dummy)
+{
+ /*
+ * Remove this CPU
+ */
+ for (;;);
+}
+
+void smp_send_stop(void)
+{
+ smp_call_function(stop_this_cpu, NULL, 1, 0);
+ smp_num_cpus = 1;
+}
+
+/*
+ * this function sends a 'reschedule' IPI to another CPU.
+ * it goes straight through and wastes no time serializing
+ * anything. Worst case is that we lose a reschedule ...
+ */
+void smp_send_reschedule(int cpu)
+{
+ sendintr(cpu, DORESCHED);
+}
+
+/* Not really SMP stuff ... */
+int setup_profiling_timer(unsigned int multiplier)
+{
+ return 0;
+}
+
+/*
+ * Run a function on all other CPUs.
+ * <func> The function to run. This must be fast and non-blocking.
+ * <info> An arbitrary pointer to pass to the function.
+ * <retry> If true, keep retrying until ready.
+ * <wait> If true, wait until function has completed on other CPUs.
+ * [RETURNS] 0 on success, else a negative status code.
+ *
+ * Does not return until remote CPUs are nearly ready to execute <func>
+ * or are or have executed.
+ */
+static volatile struct call_data_struct {
+ void (*func) (void *info);
+ void *info;
+ atomic_t started;
+ atomic_t finished;
+ int wait;
+} *call_data = NULL;
+
+int smp_call_function (void (*func) (void *info), void *info, int retry,
+ int wait)
+{
+ struct call_data_struct data;
+ int i, cpus = smp_num_cpus-1;
+ static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+
+ if (cpus == 0)
+ return 0;
+
+ data.func = func;
+ data.info = info;
+ atomic_set(&data.started, 0);
+ data.wait = wait;
+ if (wait)
+ atomic_set(&data.finished, 0);
+
+ spin_lock_bh(&lock);
+ call_data = &data;
+ /* Send a message to all other CPUs and wait for them to respond */
+ for (i = 0; i < smp_num_cpus; i++)
+ if (smp_processor_id() != i)
+ sendintr(i, DOCALL);
+
+ /* Wait for response */
+ /* FIXME: lock-up detection, backtrace on lock-up */
+ while (atomic_read(&data.started) != cpus)
+ barrier();
+
+ if (wait)
+ while (atomic_read(&data.finished) != cpus)
+ barrier();
+ spin_unlock_bh(&lock);
+ return 0;
+}
+
+void smp_call_function_interrupt(void)
+{
+ void (*func) (void *info) = call_data->func;
+ void *info = call_data->info;
+ int wait = call_data->wait;
+
+ /*
+ * Notify initiating CPU that I've grabbed the data and am
+ * about to execute the function.
+ */
+ atomic_inc(&call_data->started);
+
+ /*
+ * At this point the info structure may be out of scope unless wait==1.
+ */
+ (*func)(info);
+ if (wait)
+ atomic_inc(&call_data->finished);
+}
+
+
+static void flush_tlb_all_ipi(void *info)
+{
+ _flush_tlb_all();
+}
+
+void flush_tlb_all(void)
+{
+ smp_call_function(flush_tlb_all_ipi, 0, 1, 1);
+ _flush_tlb_all();
+}
+
+static void flush_tlb_mm_ipi(void *mm)
+{
+ _flush_tlb_mm((struct mm_struct *)mm);
+}
+
+void flush_tlb_mm(struct mm_struct *mm)
+{
+ smp_call_function(flush_tlb_mm_ipi, (void *)mm, 1, 1);
+ _flush_tlb_mm(mm);
+}
+
+struct flush_tlb_data {
+ struct mm_struct *mm;
+ struct vm_area_struct *vma;
+ unsigned long addr1;
+ unsigned long addr2;
+};
+
+static void flush_tlb_range_ipi(void *info)
+{
+ struct flush_tlb_data *fd = (struct flush_tlb_data *)info;
+
+ _flush_tlb_range(fd->mm, fd->addr1, fd->addr2);
+}
+
+void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end)
+{
+ struct flush_tlb_data fd;
+
+ fd.mm = mm;
+ fd.addr1 = start;
+ fd.addr2 = end;
+ smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1, 1);
+ _flush_tlb_range(mm, start, end);
+}
+
+static void flush_tlb_page_ipi(void *info)
+{
+ struct flush_tlb_data *fd = (struct flush_tlb_data *)info;
+
+ _flush_tlb_page(fd->vma, fd->addr1);
+}
+
+void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
+{
+ struct flush_tlb_data fd;
+
+ fd.vma = vma;
+ fd.addr1 = page;
+ smp_call_function(flush_tlb_page_ipi, (void *)&fd, 1, 1);
+ _flush_tlb_page(vma, page);
+}
+
-/* $Id: softfp.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: softfp.S,v 1.2 2000/03/21 23:50:42 ulfc 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
insn: LOCK_KERNEL; \
la a1, 8f; \
TEXT(#insn); \
- la a1, nosim; \
+ la a0, nosim; \
+ jal printk; \
UNLOCK_KERNEL; \
j done
.cpload $25
.set reorder
- subu sp, 16
+ dsubu sp, 16
.cprestore 20
- sw ra, 16(sp)
+ sd ra, 0(sp)
/* For now we assume that we get the opcode to simulate passed in as
an argument. */
*/
la ta1, lowtab
andi ta2, ta0, 0x3f
- sll ta2, ta2, 2
- addu ta1, ta2
- lw ta1, (ta1)
+ sll ta2, ta2, 3
+ daddu ta1, ta2
+ ld ta1, (ta1)
jr ta1
END(simfp)
* can keep the jump table significantly shorter.
*/
#define FMT_switch(insn,opc,temp0,temp1) \
-insn: srl temp0, opc, 19; \
+insn: srl temp0, opc, 18; \
andi temp0, 0x1c; \
la temp1, insn ## .tab; \
- addu temp0, temp1; \
- lw temp0, (temp0); \
+ daddu temp0, temp1; \
+ ld temp0, (temp0); \
jr temp0; \
\
.data; \
insn ## .tab: \
- .word insn ## .s, insn ## .d, unimp, unimp; \
- .word insn ## .w, insn ## .l, unimp, unimp; \
+ .dword insn ## .s, insn ## .d, unimp, unimp; \
+ .dword insn ## .w, insn ## .l, unimp, unimp; \
.previous
BITCH(add)
full fp simulation. */
/* Done, return. */
- lw ra, 16(sp)
- addu sp, 16
+ ld ra, 0(sp)
+ daddu sp, 16
jr ra
/* Convert a double fp to a fixed point integer. */
jal s_put_fpreg
/* Done, return. */
- lw ra, 16(sp)
- addu sp, 16
+ ld ra, 0(sp)
+ daddu sp, 16
jr ra
cvt.w.w = unimp # undefined result
/* Get the single precission register which's number is in ta1. */
s_get_fpreg:
.set noat
- sll AT, ta1, 2
sll ta1, 3
- addu ta1, AT
la AT, 1f
- addu AT, ta1
+ daddu AT, ta1
jr AT
.set at
*/
s_put_fpreg:
.set noat
- sll AT, ta1, 2
sll ta1, 3
- addu ta1, AT
la AT, 1f
- addu AT, ta1
+ daddu AT, ta1
jr AT
.set at
/* Get the double precission register which's number is in ta1 into ta1/ta2. */
d_get_fpreg:
.set noat
- sll ta1, 3
+ sll AT, ta1, 1
+ sll ta1, 2
+ daddu ta1, AT
la AT, 1f
- addu AT, ta1
+ daddu AT, ta1
jr AT
.set at
* Send an invalid operation exception.
*/
invalid:
- lw ra, 16(sp)
- addu sp, 16
+ ld ra, 0(sp)
+ daddu sp, 16
jr ra
/*
* Done, just skip over the current instruction
*/
done:
- lw ra, 16(sp)
- addu sp, 16
+ ld ra, 0(sp)
+ daddu sp, 16
jr ra
unimp:
on new, yet unsupported CPU types or when the faulting instruction
is being executed for cache but has been overwritten in memory. */
LOCK_KERNEL
- move a0, ta0
+ move a1, ta0
PRINT(KERN_DEBUG "FP support: unknown fp op %08lx, ")
PRINT("please mail to ralf@gnu.org.\n")
UNLOCK_KERNEL
move a1, $28
jal force_sig
- lw ra, 16(sp)
- addu sp, 16
+ ld ra, 0(sp)
+ daddu sp, 16
jr ra
/*
* Jump table for the lowest 6 bits of a cp1 instruction.
*/
.data
-lowtab: .word add, sub, mul, div, sqrt, abs, mov, neg
- .word round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w
- .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
- .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
- .word cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp
- .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
- .word c.f, c.un, c.eq, c.ueq, c.olt, c.ult, c.ole, c.ule
- .word c.sf, c.ngle,c.seq, c.ngl, c.lt, c.nge, c.le, c.ngt
+lowtab: .dword add, sub, mul, div, sqrt, abs, mov, neg
+ .dword round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w
+ .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
+ .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
+ .dword cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp
+ .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
+ .dword c.f, c.un, c.eq, c.ueq, c.olt, c.ult, c.ole, c.ule
+ .dword c.sf, c.ngle,c.seq, c.ngl, c.lt, c.nge, c.le, c.ngt
int error;
char * filename;
- lock_kernel();
filename = getname((char *) (long)regs.regs[4]);
error = PTR_ERR(filename);
if (IS_ERR(filename))
putname(filename);
out:
- unlock_kernel();
return error;
}
{
do_exit(SIGSEGV);
}
+
+asmlinkage int sys_pause(void)
+{
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ return -ERESTARTNOHAND;
+}
-/* $Id: traps.c,v 1.5 2000/02/24 00:12:41 ralf Exp $
+/* $Id: traps.c,v 1.4 2000/01/20 23:50:27 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
void do_ri(struct pt_regs *regs)
{
lock_kernel();
- printk("[%s:%ld] Illegal instruction at %08lx ra=%08lx\n",
- current->comm, current->pid, regs->cp0_epc, regs->regs[31]);
+ printk("Cpu%d[%s:%ld] Illegal instruction at %08lx ra=%08lx\n",
+ smp_processor_id(), current->comm, current->pid, regs->cp0_epc,
+ regs->regs[31]);
unlock_kernel();
if (compute_return_epc(regs))
return;
goto bad_cid;
regs->cp0_status |= ST0_CU1;
+#ifndef CONFIG_SMP
if (last_task_used_math == current)
return;
if (current->used_math) { /* Using the FPU again. */
- lazy_fpu_switch(last_task_used_math);
+ lazy_fpu_switch(last_task_used_math, current);
} else { /* First time FPU user. */
+ lazy_fpu_switch(last_task_used_math, 0);
init_fpu();
current->used_math = 1;
}
last_task_used_math = current;
+#else
+ if (current->used_math) {
+ lazy_fpu_switch(0, current);
+ } else {
+ init_fpu();
+ current->used_math = 1;
+ }
+ current->flags |= PF_USEDFPU;
+#endif
return;
bad_cid:
mips4_available = 1;
set_cp0_status(ST0_XX, ST0_XX);
}
- mips4_available = 0;
}
static inline void go_64(void)
atomic_inc(&init_mm.mm_count); /* XXX UP? */
current->active_mm = &init_mm;
- current_pgd = init_mm.pgd;
}
-/* $Id: unaligned.c,v 1.2 2000/01/17 23:32:46 ralf Exp $
+/* $Id: unaligned.c,v 1.2 1999/11/23 17:12:50 ralf Exp $
*
* Handle unaligned accesses by emulation.
*
-# $Id: Makefile,v 1.2 1999/12/04 03:59:00 ralf Exp $
+# $Id: Makefile,v 1.2 1999/11/19 20:35:22 ralf Exp $
#
# Makefile for MIPS-specific library files..
#
-/* $Id: csum_partial.S,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: csum_partial.S,v 1.1 1999/08/21 21:43: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
-/* $Id: csum_partial_copy.c,v 1.3 2000/02/05 06:47:09 ralf Exp $
+/* $Id: csum_partial_copy.c,v 1.2 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
-/* $Id: floppy-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: floppy-no.c,v 1.1 1999/08/21 21:43: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
-/* $Id: floppy-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: floppy-std.c,v 1.1 1999/08/21 21:43: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
-/* $Id: ide-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: ide-no.c,v 1.1 1999/08/21 21:43: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
-/* $Id: ide-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: ide-std.c,v 1.1 1999/08/21 21:43: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
-/* $Id: kbd-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: kbd-no.c,v 1.1 1999/08/21 21:43: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
-/* $Id: kbd-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: kbd-std.c,v 1.1 1999/08/21 21:43:01 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
-/* $Id: memcpy.S,v 1.4 2000/01/27 01:05:24 ralf Exp $
+/* $Id: memcpy.S,v 1.2 1999/10/19 20:51:51 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
-/* $Id: memset.S,v 1.3 2000/01/16 01:37:19 ralf Exp $
+/* $Id: memset.S,v 1.3 2000/01/15 23:48:55 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
-/* $Id: rtc-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: rtc-no.c,v 1.1 1999/08/21 21:43:01 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
-/* $Id: rtc-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: rtc-std.c,v 1.1 1999/08/21 21:43:01 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
-/* $Id: strlen_user.S,v 1.3 2000/01/17 23:32:46 ralf Exp $
+/* $Id: strlen_user.S,v 1.2 1999/11/19 20:35:22 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
-/* $Id: strncpy_user.S,v 1.3 2000/01/17 23:32:46 ralf Exp $
+/* $Id: strncpy_user.S,v 1.2 1999/11/19 20:35:23 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
-/* $Id: strnlen_user.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strnlen_user.S,v 1.1 1999/11/19 20:35:23 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
-/* $Id: watch.S,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: watch.S,v 1.1 1999/08/21 21:43:01 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
-# $Id: Makefile,v 1.5 2000/02/24 00:12:41 ralf Exp $
+# $Id: Makefile,v 1.4 2000/01/17 23:32:46 ralf Exp $
#
# Makefile for the Linux/MIPS-specific parts of the memory manager.
#
-/* $Id: andes.c,v 1.6 2000/02/24 00:12:41 ralf Exp $
+/* $Id: andes.c,v 1.7 2000/03/13 22:43:25 kanoj 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
static void
andes_flush_cache_mm(struct mm_struct *mm)
{
- if (mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
andes_flush_cache_range(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
- if (mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
#ifdef DEBUG_CACHE
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if (mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
static void andes_flush_tlb_mm(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
#ifdef DEBUG_TLB
printk("[tlbmm<%d>]", mm->context);
#endif
- save_and_cli(flags);
- get_new_mmu_context(mm, asid_cache);
+ __save_and_cli(flags);
+ get_new_cpu_mmu_context(mm, smp_processor_id());
if(mm == current->mm)
- set_entryhi(mm->context & 0xff);
- restore_flags(flags);
+ set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & 0xff);
+ __restore_flags(flags);
}
}
andes_flush_tlb_range(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
int size;
printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & 0xff),
start, end);
#endif
- save_and_cli(flags);
+ __save_and_cli(flags);
size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
size = (size + 1) >> 1;
if(size <= NTLB_ENTRIES_HALF) {
int oldpid = (get_entryhi() & 0xff);
- int newpid = (mm->context & 0xff);
+ int newpid = (CPU_CONTEXT(smp_processor_id(), mm) & 0xff);
start &= (PAGE_MASK << 1);
end += ((PAGE_SIZE << 1) - 1);
}
set_entryhi(oldpid);
} else {
- get_new_mmu_context(mm, asid_cache);
+ get_new_cpu_mmu_context(mm, smp_processor_id());
if(mm == current->mm)
- set_entryhi(mm->context & 0xff);
+ set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) &
+ 0xff);
}
__restore_flags(flags);
}
static void
andes_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
{
- if(vma->vm_mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) != 0) {
unsigned long flags;
int oldpid, newpid, idx;
#ifdef DEBUG_TLB
printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
#endif
- newpid = (vma->vm_mm->context & 0xff);
+ newpid = (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff);
page &= (PAGE_MASK << 1);
- save_and_cli(flags);
+ __save_and_cli(flags);
oldpid = (get_entryhi() & 0xff);
set_entryhi(page | newpid);
BARRIER;
finish:
BARRIER;
set_entryhi(oldpid);
- restore_flags(flags);
+ __restore_flags(flags);
}
}
pte_t *ptep;
int idx, pid;
+ __save_and_cli(flags);
pid = get_entryhi() & 0xff;
-#ifdef DEBUG_TLB
- if((pid != (vma->vm_mm->context & 0xff)) ||
- (vma->vm_mm->context == 0)) {
- printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d tlbpid=%d\n",
- (int) (vma->vm_mm->context & 0xff), pid);
+ if((pid != (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff)) ||
+ (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) == 0)) {
+ printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d
+ tlbpid=%d\n", (int) (CPU_CONTEXT(smp_processor_id(),
+ vma->vm_mm) & 0xff), pid);
}
-#endif
- __save_and_cli(flags);
address &= (PAGE_MASK << 1);
set_entryhi(address | (pid));
pgdp = pgd_offset(vma->vm_mm, address);
static void andes_show_regs(struct pt_regs *regs)
{
+ printk("Cpu %d\n", smp_processor_id());
/* Saved main processor registers. */
printk("$0 : %016lx %016lx %016lx %016lx\n",
0UL, regs->regs[1], regs->regs[2], regs->regs[3]);
write_32bit_cp0_register(CP0_PAGEMASK, PM_4K);
/* From this point on the ARC firmware is dead. */
- flush_tlb_all();
+ _flush_tlb_all();
/* Did I tell you that ARC SUCKS? */
}
-/* $Id: extable.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: extable.c,v 1.2 1999/11/23 17:12:50 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
-/* $Id: fault.c,v 1.6 2000/02/18 00:24:31 ralf Exp $
+/* $Id: fault.c,v 1.7 2000/03/13 22:43:25 kanoj 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
#include <asm/softirq.h>
#include <asm/system.h>
#include <asm/uaccess.h>
+#include <asm/ptrace.h>
#define development_version (LINUX_VERSION_CODE & 0x100)
extern void die(char *, struct pt_regs *, unsigned long write);
-unsigned long asid_cache;
-
/*
* Macro for exception fixup code to access integer registers.
*/
#define dpf_reg(r) (regs->regs[r])
+asmlinkage void
+dodebug(abi64_no_regargs, struct pt_regs regs)
+{
+ printk("Got syscall %d, cpu %d proc %s:%d epc 0x%lx\n", regs.regs[2], smp_processor_id(), current->comm, current->pid, regs.cp0_epc);
+}
+
+asmlinkage void
+dodebug2(abi64_no_regargs, struct pt_regs regs)
+{
+ unsigned long retaddr;
+
+ __asm__ __volatile__(
+ ".set noreorder\n\t"
+ "add %0,$0,$31\n\t"
+ ".set reorder"
+ : "=r" (retaddr));
+ printk("Got exception 0x%lx at 0x%lx\n", retaddr, regs.cp0_epc);
+}
+
/*
* This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate
*/
if (in_interrupt() || mm == &init_mm)
goto no_context;
-#if 0
- printk("[%s:%d:%08lx:%ld:%08lx]\n", current->comm, current->pid,
- address, write, regs->cp0_epc);
+#if DEBUG_MIPS64
+ printk("Cpu%d[%s:%d:%08lx:%ld:%08lx]\n", smp_processor_id(), current->comm,
+ current->pid, address, write, regs->cp0_epc);
#endif
down(&mm->mmap_sem);
vma = find_vma(mm, address);
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
- {
- int fault = handle_mm_fault(mm, vma, address, write);
- if (fault < 0)
- goto out_of_memory;
- if (!fault)
- goto do_sigbus;
+ switch (handle_mm_fault(mm, vma, address, write)) {
+ case 1:
+ tsk->min_flt++;
+ break;
+ case 2:
+ tsk->maj_flt++;
+ break;
+ case 0:
+ goto do_sigbus;
+ default:
+ goto out_of_memory;
}
up(&mm->mmap_sem);
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
*/
- printk(KERN_ALERT "Unable to handle kernel paging request at virtual "
+ printk(KERN_ALERT "Cpu %d Unable to handle kernel paging request at "
"address %08lx, epc == %08lx, ra == %08lx\n",
- address, regs->cp0_epc, regs->regs[31]);
-while(1);
+ smp_processor_id(), address, regs->cp0_epc, regs->regs[31]);
die("Oops", regs, write);
do_exit(SIGKILL);
if (ret) {
init = pgd_offset(&init_mm, 0);
pgd_init((unsigned long)ret);
+ memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
+ (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
}
return ret;
}
bp = pte_val(BAD_PAGE);
p = (unsigned long *) page;
- end = p + PTRS_PER_PTE;
+ end = p + (2 * PTRS_PER_PTE);
while (p < end) {
p[0] = p[1] = p[2] = p[3] =
unsigned long page;
page = (unsigned long) invalid_pmd_table;
- pte_init(page);
+ pmd_init(page);
return (pmd_t *) page;
}
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
- pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2);
pmd_init((unsigned long)invalid_pmd_table);
+ memset((void *)invalid_pte_table, 0, sizeof(pte_t) * 2 * PTRS_PER_PTE);
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
low = max_low_pfn;
-/* $Id: loadmmu.c,v 1.6 2000/02/24 00:12:41 ralf Exp $
+/* $Id: loadmmu.c,v 1.5 2000/01/27 01:05:24 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
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s16d16i16();
} else {
pgd_t *pgd;
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s32d16i16();
} else {
pgd_t *pgd;
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s64d16i16();
} else {
pgd_t *pgd;
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s128d16i16();
} else {
pgd_t *pgd;
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s32d32i32();
} else {
pgd_t *pgd;
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s64d32i32();
} else {
pgd_t *pgd;
struct vm_area_struct *vma;
unsigned long flags;
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
return;
start &= PAGE_MASK;
#endif
vma = find_vma(mm, start);
if(vma) {
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
r4k_flush_cache_all_s128d32i32();
} else {
pgd_t *pgd;
r4k_flush_cache_range_d16i16(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
#ifdef DEBUG_CACHE
r4k_flush_cache_range_d32i32(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
#ifdef DEBUG_CACHE
*/
static void r4k_flush_cache_mm_s16d16i16(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_s32d16i16(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_s64d16i16(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_s128d16i16(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_s32d32i32(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_s64d32i32(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_s128d32i32(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_d16i16(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
static void r4k_flush_cache_mm_d32i32(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
#ifdef DEBUG_CACHE
printk("cmm[%d]", (int)mm->context);
#endif
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
*/
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
*/
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
*/
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/*
* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/*
* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/*
* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* for every cache flush operation. So we do indexed flushes
* in that case, which doesn't overly flush the cache too much.
*/
- if(mm->context != current->mm->context) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) !=
+ CPU_CONTEXT(smp_processor_id(), current->mm)) {
/* Do indexed flush, too much work to get the (possible)
* tlb refills to work correctly.
*/
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
* If ownes no valid ASID yet, cannot possibly have gotten
* this page into the cache.
*/
- if(mm->context == 0)
+ if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
return;
#ifdef DEBUG_CACHE
printk("[tlball]");
#endif
- save_and_cli(flags);
+ __save_and_cli(flags);
/* Save old context and create impossible VPN2 value */
old_ctx = (get_entryhi() & 0xff);
set_entryhi(KSEG0);
}
BARRIER;
set_entryhi(old_ctx);
- restore_flags(flags);
+ __restore_flags(flags);
}
static void r4k_flush_tlb_mm(struct mm_struct *mm)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
#ifdef DEBUG_TLB
printk("[tlbmm<%d>]", mm->context);
#endif
- save_and_cli(flags);
- get_new_mmu_context(mm, asid_cache);
+ __save_and_cli(flags);
+ get_new_cpu_mmu_context(mm, smp_processor_id());
if(mm == current->mm)
- set_entryhi(mm->context & 0xff);
- restore_flags(flags);
+ set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & 0xff);
+ __restore_flags(flags);
}
}
static void r4k_flush_tlb_range(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
- if(mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
unsigned long flags;
int size;
printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & 0xff),
start, end);
#endif
- save_and_cli(flags);
+ __save_and_cli(flags);
size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
size = (size + 1) >> 1;
if(size <= NTLB_ENTRIES_HALF) {
int oldpid = (get_entryhi() & 0xff);
- int newpid = (mm->context & 0xff);
+ int newpid = (CPU_CONTEXT(smp_processor_id(), mm) & 0xff);
start &= (PAGE_MASK << 1);
end += ((PAGE_SIZE << 1) - 1);
}
set_entryhi(oldpid);
} else {
- get_new_mmu_context(mm, asid_cache);
+ get_new_cpu_mmu_context(mm, smp_processor_id());
if(mm == current->mm)
- set_entryhi(mm->context & 0xff);
+ set_entryhi(CPU_CONTEXT(smp_processor_id(),
+ mm) & 0xff);
}
__restore_flags(flags);
}
static void r4k_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
{
- if(vma->vm_mm->context != 0) {
+ if (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) != 0) {
unsigned long flags;
int oldpid, newpid, idx;
#ifdef DEBUG_TLB
printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
#endif
- newpid = (vma->vm_mm->context & 0xff);
+ newpid = (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff);
page &= (PAGE_MASK << 1);
- save_and_cli(flags);
+ __save_and_cli(flags);
oldpid = (get_entryhi() & 0xff);
set_entryhi(page | newpid);
BARRIER;
finish:
BARRIER;
set_entryhi(oldpid);
- restore_flags(flags);
+ __restore_flags(flags);
}
}
pte_t *ptep;
int idx, pid;
+ __save_and_cli(flags);
pid = (get_entryhi() & 0xff);
#ifdef DEBUG_TLB
- if((pid != (vma->vm_mm->context & 0xff)) || (vma->vm_mm->context == 0)) {
- printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d tlbpid=%d\n",
- (int) (vma->vm_mm->context & 0xff), pid);
+ if((pid != (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff)) ||
+ (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) == 0)) {
+ printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d
+ tlbpid=%d\n", (int) (CPU_CONTEXT(smp_processor_id(),
+ vma->vm_mm) & 0xff), pid);
}
#endif
- __save_and_cli(flags);
address &= (PAGE_MASK << 1);
set_entryhi(address | (pid));
pgdp = pgd_offset(vma->vm_mm, address);
* be set for 4kb pages.
*/
write_32bit_cp0_register(CP0_PAGEMASK, PM_4K);
- flush_tlb_all();
+ _flush_tlb_all();
}
-/* $Id: umap.c,v 1.5 2000/02/04 07:40:24 ralf Exp $
+/* $Id: umap.c,v 1.4 2000/01/29 01:41:59 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
-# $Id: Makefile,v 1.4 2000/01/21 22:34:03 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/20 21:13:33 ralf Exp $
#
# Makefile for the SGI specific kernel interface routines
# under Linux.
-/* $Id: ip22-berr.c,v 1.2 2000/02/24 00:12:41 ralf Exp $
+/* $Id: ip22-berr.c,v 1.1 2000/01/21 22:34:03 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
-/* $Id: ip22-hpc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-hpc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $
*
* ip22-hpc.c: Routines for generic manipulation of the HPC controllers.
*
-/* $Id: ip22-int.c,v 1.4 2000/02/04 07:40:24 ralf Exp $
+/* $Id: ip22-int.c,v 1.5 2000/03/02 02:36:50 ralf Exp $
*
* indy_int.c: Routines for generic manipulation of the INT[23] ASIC
* found on INDY workstations..
#include <asm/sgi/sgint23.h>
#include <asm/sgialib.h>
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
+
struct sgi_int2_regs *sgi_i2regs;
struct sgi_int3_regs *sgi_i3regs;
struct sgi_ioc_ints *ioc_icontrol;
int do_random, cpu;
cpu = smp_processor_id();
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq]++;
printk("Got irq %d, press a key.", irq);
add_interrupt_randomness(irq);
__cli();
}
- irq_exit(cpu);
+ irq_exit(cpu, irq);
/* unmasking and bottom half handling is done magically for us. */
}
action = local_irq_action[irq];
}
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq + 16]++;
action->handler(irq, action->dev_id, regs);
- irq_exit(cpu);
+ irq_exit(cpu, irq);
}
void indy_local1_irqdispatch(struct pt_regs *regs)
irq = lc1msk_to_irqnr[mask];
action = local_irq_action[irq];
}
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq + 24]++;
action->handler(irq, action->dev_id, regs);
- irq_exit(cpu);
+ irq_exit(cpu, irq);
}
void indy_buserror_irq(struct pt_regs *regs)
int cpu = smp_processor_id();
int irq = 6;
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq]++;
printk("Got a bus error IRQ, shouldn't happen yet\n");
show_regs(regs);
printk("Spinning...\n");
while(1);
- irq_exit(cpu);
+ irq_exit(cpu, irq);
}
/* Misc. crap just to keep the kernel linking... */
-/* $Id: ip22-irq.S,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-irq.S,v 1.1 1999/08/20 21:13:33 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
-/* $Id: ip22-mc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-mc.c,v 1.2 1999/10/19 20:51:52 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
-/* $Id: ip22-reset.c,v 1.3 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-reset.c,v 1.3 1999/10/08 21:07:51 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
-/* $Id: ip22-rtc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-rtc.c,v 1.1 1999/08/20 21:13:34 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
#define SC_SIZE 0x00080000
#define SC_LINE 32
#define CI_MASK (SC_SIZE - SC_LINE)
-#define SC_ROUND(n) ((n) + SC_LINE - 1)
#define SC_INDEX(n) ((n) & CI_MASK)
static inline void indy_sc_wipe(unsigned long first, unsigned long last)
#ifdef DEBUG_CACHE
printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size);
#endif
+
+ if (!size)
+ return;
+
/* Which lines to flush? */
first_line = SC_INDEX(addr);
- last_line = SC_INDEX(SC_ROUND(addr + size));
+ last_line = SC_INDEX(addr + size - 1);
__save_and_cli(flags);
if (first_line <= last_line) {
goto out;
}
- /* Cache index wrap around. Due to the way the buddy system works
- this case should not happen. We're prepared to handle it,
- though. */
- indy_sc_wipe(last_line, SC_SIZE);
- indy_sc_wipe(0, first_line);
+ indy_sc_wipe(first_line, SC_SIZE - SC_LINE);
+ indy_sc_wipe(0, last_line);
out:
__restore_flags(flags);
}
void __init indy_sc_init(void)
{
-return; /* Not for now, debugging ... */
if (indy_sc_probe()) {
indy_sc_enable();
bcops = &indy_sc_ops;
-/* $Id: ip22-setup.c,v 1.5 2000/01/27 01:05:24 ralf Exp $
+/* $Id: ip22-setup.c,v 1.4 1999/10/08 21:07:51 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
int cpu = smp_processor_id();
int irq = 4;
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq]++;
printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
prom_getchar();
ArcEnterInteractiveMode();
- irq_exit(cpu);
+ irq_exit(cpu, irq);
}
void do_gettimeofday(struct timeval *tv)
-/* $Id: system.c,v 1.3 1999/12/04 03:59:01 ralf Exp $
+/* $Id: system.c,v 1.3 1999/10/19 20:51:52 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
-/* $Id: time.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: time.c,v 1.1 1999/08/20 21:13:34 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
-# $Id: Makefile,v 1.4 2000/02/18 00:24:31 ralf Exp $
+# $Id: Makefile,v 1.3 2000/02/04 08:41:40 kanoj Exp $
#
# Makefile for the IP27 specific kernel interface routines under Linux.
#
L_TARGET = ip27.a
L_OBJS = ip27-berr.o ip27-irq.o ip27-irq-glue.o ip27-klconfig.o \
ip27-memory.o ip27-pci.o ip27-pci-dma.o ip27-reset.o ip27-setup.o \
- ip27-timer.o ip27-init.o
+ ip27-timer.o ip27-init.o ip27-nmi.o
include $(TOPDIR)/Rules.make
3. Need to figure out why address swaizzling is needed in inw/outw for
Qlogic scsi controllers.
4. Need to integrate ip27-klconfig.c:find_lboard and
-ip27-init.c:find_lbaord_real.
+ip27-init.c:find_lbaord_real. DONE
5. Is it okay to set calias space on all nodes as 0, instead of 8k as
in irix?
6. Investigate why things do not work without the setup_test() call
being invoked on all nodes in ip27-memory.c.
+7. Too many CLIs in the locore handlers :
+For the low level handlers set up by set_except_vector(),
+__tlb_refill_debug_tramp, __xtlb_refill_debug_tramp and cacheerror,
+investigate whether the code should do CLI, STI or KMODE.
+8. Too many do_page_faults invoked - investigate.
+9. start_thread must turn off UX64 ... and define tlb_refill_debug.
+10. Need a bad pmd table, bad pte table. __bad_pmd_table/__bad_pagetable
+does not agree with pgd_bad/pmd_bad.
+11. All intrs (ip27_do_irq handlers) are targetted at cpu A on the node.
+This might need to change later. Only the timer intr is set up to be
+received on both Cpu A and B. (ip27_do_irq()/bridge_startup())
+13. Cache flushing (specially the SMP version) has to be investigated.
-/* $Id: ip27-berr.c,v 1.1 2000/01/20 23:50:27 ralf Exp $
+/* $Id: ip27-berr.c,v 1.1 2000/01/20 22:50:29 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
#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sched.h>
#include <linux/mmzone.h> /* for numnodes */
+#include <linux/mm.h>
+#include <asm/pgalloc.h>
+#include <asm/pgtable.h>
#include <asm/sn/types.h>
#include <asm/sn/sn0/addrs.h>
#include <asm/sn/sn0/hubni.h>
#include <asm/ioc3.h>
#include <asm/mipsregs.h>
#include <asm/sn/gda.h>
+#include <asm/sn/intr.h>
+#include <asm/current.h>
+#include <asm/smp.h>
+#include <asm/processor.h>
+#include <asm/mmu_context.h>
+#include <asm/sn/launch.h>
+#include <asm/sn/sn_private.h>
+#include <asm/sn/sn0/ip27.h>
-typedef unsigned long cpumask_t; /* into asm/sn/types.h */
-typedef unsigned long cpuid_t;
+#define CPU_NONE (cpuid_t)-1
#define CPUMASK_CLRALL(p) (p) = 0
#define CPUMASK_SETB(p, bit) (p) |= 1 << (bit)
+#define CPUMASK_CLRB(p, bit) (p) &= ~(1ULL << (bit))
+#define CPUMASK_TSTB(p, bit) ((p) & (1ULL << (bit)))
+
+#define CNODEMASK_CLRALL(p) (p) = 0
+#define CNODEMASK_TSTB(p, bit) ((p) & (1ULL << (bit)))
+#define CNODEMASK_SETB(p, bit) ((p) |= 1ULL << (bit))
cpumask_t boot_cpumask;
+static volatile cpumask_t boot_barrier;
hubreg_t region_mask = 0;
static int fine_mode = 0;
+int maxcpus;
+static spinlock_t hub_mask_lock = SPIN_LOCK_UNLOCKED;
+static cnodemask_t hub_init_mask;
cnodeid_t nasid_to_compact_node[MAX_NASIDS];
nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
>> NSRI_REGIONSIZE_SHFT) & REGIONSIZE_FINE);
}
-lboard_t * find_lboard_real(lboard_t *start, unsigned char brd_type)
-{
- /* Search all boards stored on this node. */
- while (start) {
- if (start->brd_type == brd_type)
- return start;
- start = KLCF_NEXT(start);
- }
- /* Didn't find it. */
- return (lboard_t *)NULL;
-}
-
-klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char struct_type)
-{
- int index, j;
-
- if (kli == (klinfo_t *)NULL) {
- index = 0;
- } else {
- for (j = 0; j < KLCF_NUM_COMPS(brd); j++)
- if (kli == KLCF_COMP(brd, j))
- break;
- index = j;
- if (index == KLCF_NUM_COMPS(brd)) {
- printk("find_component: Bad pointer: 0x%p\n", kli);
- return (klinfo_t *)NULL;
- }
- index++; /* next component */
- }
-
- for (; index < KLCF_NUM_COMPS(brd); index++) {
- kli = KLCF_COMP(brd, index);
- if (KLCF_COMP_TYPE(kli) == struct_type)
- return kli;
- }
-
- /* Didn't find it. */
- return (klinfo_t *)NULL;
-}
-
-klinfo_t *find_first_component(lboard_t *brd, unsigned char struct_type)
-{
- return find_component(brd, (klinfo_t *)NULL, struct_type);
-}
-
nasid_t get_actual_nasid(lboard_t *brd)
{
klhub_t *hub;
int cpus_found = 0;
cpuid_t cpuid;
- brd = find_lboard_real((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27);
+ brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27);
do {
acpu = (klcpu_t *)find_first_component(brd, KLSTRUCT_CPU);
}
brd = KLCF_NEXT(brd);
if (brd)
- brd = find_lboard_real(brd,KLTYPE_IP27);
+ brd = find_lboard(brd,KLTYPE_IP27);
else
break;
} while (brd);
return(highest + 1);
}
+void alloc_cpupda(int i)
+{
+ cnodeid_t node;
+ nasid_t nasid;
+
+ node = get_cpu_cnode(i);
+ nasid = COMPACT_TO_NASID_NODEID(node);
+
+ cputonasid(i) = nasid;
+ cputocnode(i) = node;
+ cputoslice(i) = get_cpu_slice(i);
+}
+
+int cpu_enabled(cpuid_t cpu)
+{
+ if (cpu == CPU_NONE)
+ return 0;
+ return (CPUMASK_TSTB(boot_cpumask, cpu) != 0);
+}
+
+void initpdas(void)
+{
+ cpuid_t i;
+
+ for (i = 0; i < maxcpus; i++)
+ if (cpu_enabled(i))
+ alloc_cpupda(i);
+}
+
void mlreset (void)
{
- int i, maxcpus;
+ int i;
fine_mode = is_fine_dirmode();
*/
CPUMASK_CLRALL(boot_cpumask);
maxcpus = cpu_node_probe(&boot_cpumask, &numnodes);
+ printk("Discovered %d cpus on %d nodes\n", maxcpus, numnodes);
+ initpdas();
gen_region_mask(®ion_mask, numnodes);
+ CNODEMASK_CLRALL(hub_init_mask);
/*
* Set all nodes' calias sizes to 8k
}
}
+
+void intr_clear_bits(nasid_t nasid, volatile hubreg_t *pend, int base_level,
+ char *name)
+{
+ volatile hubreg_t bits;
+ int i;
+
+ /* Check pending interrupts */
+ if ((bits = HUB_L(pend)) != 0)
+ for (i = 0; i < N_INTPEND_BITS; i++)
+ if (bits & (1 << i))
+ LOCAL_HUB_CLR_INTR(base_level + i);
+}
+
+void intr_clear_all(nasid_t nasid)
+{
+ REMOTE_HUB_S(nasid, PI_INT_MASK0_A, 0);
+ REMOTE_HUB_S(nasid, PI_INT_MASK0_B, 0);
+ REMOTE_HUB_S(nasid, PI_INT_MASK1_A, 0);
+ REMOTE_HUB_S(nasid, PI_INT_MASK1_B, 0);
+ intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND0),
+ INT_PEND0_BASELVL, "INT_PEND0");
+ intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND1),
+ INT_PEND1_BASELVL, "INT_PEND1");
+}
+
+void sn_mp_setup(void)
+{
+ cnodeid_t cnode;
+#if 0
+ cpuid_t cpu;
+#endif
+
+ for (cnode = 0; cnode < numnodes; cnode++) {
+#if 0
+ init_platform_nodepda();
+#endif
+ intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
+ }
+#if 0
+ for (cpu = 0; cpu < maxcpus; cpu++) {
+ init_platform_pda();
+ }
+#endif
+}
+
+void per_hub_init(cnodeid_t cnode)
+{
+ cnodemask_t done;
+
+ spin_lock(&hub_mask_lock);
+ /* Test our bit. */
+ if (!(done = CNODEMASK_TSTB(hub_init_mask, cnode))) {
+ /* Turn our bit on in the mask. */
+ CNODEMASK_SETB(hub_init_mask, cnode);
+ }
+ spin_unlock(&hub_mask_lock);
+
+ /*
+ * Do the actual initialization if it hasn't been done yet.
+ * We don't need to hold a lock for this work.
+ */
+ if (!done) {
+ hub_rtc_init(cnode);
+ }
+}
+
+/*
+ * This is similar to hard_smp_processor_id().
+ */
+cpuid_t getcpuid(void)
+{
+ klcpu_t *klcpu;
+
+ klcpu = nasid_slice_to_cpuinfo(get_nasid(),LOCAL_HUB_L(PI_CPU_NUM));
+ return klcpu->cpu_info.virtid;
+}
+
+void per_cpu_init(void)
+{
+ extern void install_cpu_nmi_handler(int slice);
+ extern void load_mmu(void);
+ static int is_slave = 0;
+ cpuid_t cpu = getcpuid();
+ cnodeid_t cnode = get_compact_nodeid();
+
+ current_cpu_data.asid_cache = ASID_FIRST_VERSION;
+#if 0
+ intr_init();
+#endif
+ set_cp0_status(ST0_IM, 0);
+ per_hub_init(cnode);
+ cpu_time_init();
+ if (smp_processor_id()) /* master can't do this early, no kmalloc */
+ install_cpuintr(cpu);
+ /* Install our NMI handler if symmon hasn't installed one. */
+ install_cpu_nmi_handler(cputoslice(smp_processor_id()));
+#if 0
+ install_tlbintr(cpu);
+#endif
+ set_cp0_status(SRB_DEV0 | SRB_DEV1, SRB_DEV0 | SRB_DEV1);
+ if (is_slave) {
+ set_cp0_status(ST0_BEV, 0);
+ if (mips4_available)
+ set_cp0_status(ST0_XX, ST0_XX);
+ set_cp0_status(ST0_KX|ST0_SX|ST0_UX, ST0_KX|ST0_SX|ST0_UX);
+ sti();
+ load_mmu();
+ }
+ if (is_slave == 0)
+ is_slave = 1;
+}
+
+cnodeid_t get_compact_nodeid(void)
+{
+ nasid_t nasid;
+
+ nasid = get_nasid();
+ /*
+ * Map the physical node id to a virtual node id (virtual node ids
+ * are contiguous).
+ */
+ return NASID_TO_COMPACT_NODEID(nasid);
+}
+
+#ifdef CONFIG_SMP
+
+void __init smp_callin(void)
+{
+#if 0
+ calibrate_delay();
+ smp_store_cpu_info(cpuid);
+#endif
+}
+
+int __init start_secondary(void)
+{
+ extern int cpu_idle(void);
+ extern atomic_t smp_commenced;
+
+ smp_callin();
+ while (!atomic_read(&smp_commenced));
+ return cpu_idle();
+}
+
+static atomic_t numstarted = ATOMIC_INIT(0);
+void cboot(void)
+{
+ atomic_inc(&numstarted);
+ CPUMASK_CLRB(boot_barrier, getcpuid()); /* needs atomicity */
+ per_cpu_init();
+#if 0
+ ecc_init();
+ bte_lateinit();
+ init_mfhi_war();
+#endif
+ _flush_tlb_all();
+ flush_cache_all();
+ start_secondary();
+}
+
+void allowboot(void)
+{
+ int num_cpus = 0;
+ cpuid_t cpu;
+ cnodeid_t cnode;
+ extern void bootstrap(void);
+
+ sn_mp_setup();
+ /* Master has already done per_cpu_init() */
+ install_cpuintr(getcpuid());
+#if 0
+ bte_lateinit();
+ ecc_init();
+#endif
+
+ boot_barrier = boot_cpumask;
+ /* Launch slaves. */
+ for (cpu = 0; cpu < maxcpus; cpu++) {
+ if (cpu == smp_processor_id()) {
+ num_cpus++;
+ /* We're already started, clear our bit */
+ CPUMASK_CLRB(boot_barrier, cpu);
+ continue;
+ }
+
+ /* Skip holes in CPU space */
+ if (CPUMASK_TSTB(boot_cpumask, cpu)) {
+ struct task_struct *p;
+
+ /*
+ * The following code is purely to make sure
+ * Linux can schedule processes on this slave.
+ */
+ kernel_thread(0, NULL, CLONE_PID);
+ p = init_task.prev_task;
+ sprintf(p->comm, "%s%d", "Idle", num_cpus);
+ init_tasks[num_cpus] = p;
+ p->processor = num_cpus;
+ p->has_cpu = 1; /* we schedule the first task manually */
+ del_from_runqueue(p);
+ unhash_process(p);
+ /* Attach to the address space of init_task. */
+ atomic_inc(&init_mm.mm_count);
+ p->active_mm = &init_mm;
+
+ /*
+ * Launch a slave into bootstrap().
+ * It doesn't take an argument, and we
+ * set sp to the kernel stack of the newly
+ * created idle process, gp to the proc struct
+ * (so that current-> works).
+ */
+ LAUNCH_SLAVE(cputonasid(cpu), cputoslice(cpu),
+ (launch_proc_t)bootstrap, 0,
+ (void *)((unsigned long)p+KERNEL_STACK_SIZE - 32),
+ (void *)p);
+
+ /*
+ * Now optimistically set the mapping arrays. We
+ * need to wait here, verify the cpu booted up, then
+ * fire up the next cpu.
+ */
+ __cpu_number_map[cpu] = num_cpus;
+ __cpu_logical_map[num_cpus] = cpu;
+ num_cpus++;
+ /* smp_num_cpus++; Do after smp_send_reschedule works */
+ }
+ }
+
+ /* while(atomic_read(&numstarted) != (maxcpus - num_cpus)) */
+ if (maxcpus > 1) while(atomic_read(&numstarted) == 0);
+ printk("Holding %d cpus slave\n", atomic_read(&numstarted));
+
+#ifdef LATER
+ Wait logic goes here.
+#endif
+ for (cnode = 0; cnode < numnodes; cnode++) {
+#if 0
+ if (cnodetocpu(cnode) == -1) {
+ printk("Initializing headless hub,cnode %d", cnode);
+ per_hub_init(cnode);
+ }
+#endif
+ }
+#if 0
+ cpu_io_setup();
+ init_mfhi_war();
+#endif
+}
+
+#else /* CONFIG_SMP */
+void cboot(void) {}
+#endif /* CONFIG_SMP */
-/* $Id: ip27-irq-glue.S,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: ip27-irq.c,v 1.6 2000/02/10 05:58:56 dagum Exp $
+/* $Id: ip27-irq.c,v 1.9 2000/03/14 01:39:27 ralf Exp $
*
* ip27-irq.c: Highlevel interrupt handling for IP27 architecture.
*
#include <linux/init.h>
#include <linux/errno.h>
-#include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/timex.h>
#include <linux/malloc.h>
#include <linux/random.h>
-#include <linux/smp.h>
#include <linux/smp_lock.h>
+#include <linux/kernel_stat.h>
+#include <linux/delay.h>
#include <asm/bitops.h>
#include <asm/bootinfo.h>
#include <asm/sn/sn0/hub.h>
#include <asm/sn/sn0/ip27.h>
#include <asm/sn/arch.h>
+#include <asm/sn/intr.h>
+#include <asm/sn/intr_public.h>
+
+#undef DEBUG_IRQ
+#ifdef DEBUG_IRQ
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
extern asmlinkage void ip27_irq(void);
int (*irq_cannonicalize)(int irq);
+int intr_connect_level(cpuid_t cpu, int bit);
+int intr_disconnect_level(cpuid_t cpu, int bit);
unsigned int local_bh_count[NR_CPUS];
unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
+/*
+ * we need to map irq's up to at least bit 7 of the INT_MASK0_A register
+ * since bits 0-6 are pre-allocated for other purposes.
+ */
+#define IRQ_TO_SWLEVEL(i) i + 7
+#define SWLEVEL_TO_IRQ(s) s - 7
+/*
+ * use these macros to get the encoded nasid, widget id, and real irq
+ * from the irq value
+ */
+#define NASID_FROM_IRQ(i) ((i >> 16)&(0xff))
+#define WID_FROM_IRQ(i) ((i >> 8)&(0xff))
+#define IRQ_FROM_IRQ(i) ((i)&(0xff))
+
void disable_irq(unsigned int irq_nr)
{
panic("disable_irq() called ...");
int do_random, cpu;
cpu = smp_processor_id();
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[cpu][irq]++;
action = *(irq + irq_action);
add_interrupt_randomness(irq);
__cli();
}
- irq_exit(cpu);
+ irq_exit(cpu, irq);
/* unmasking and bottom half handling is done magically for us. */
}
/* For now ... */
void ip27_do_irq(struct pt_regs *regs)
{
- int irq;
+ int irq, swlevel;
hubreg_t pend0, mask0;
+ int pi_int_mask0 = ((cputoslice(smp_processor_id()) == 0) ?
+ PI_INT_MASK0_A : PI_INT_MASK0_B);
/* copied from Irix intpend0() */
while (((pend0 = LOCAL_HUB_L(PI_INT_PEND0)) &
- (mask0 = LOCAL_HUB_L(PI_INT_MASK0_A))) != 0) {
+ (mask0 = LOCAL_HUB_L(pi_int_mask0))) != 0) {
+ pend0 &= mask0;
do {
- irq = ms1bit(pend0);
- LOCAL_HUB_S(PI_INT_MASK0_A, mask0 & ~(1 << irq));
- LOCAL_HUB_S(PI_INT_PEND_MOD, irq);
- LOCAL_HUB_L(PI_INT_MASK0_A); /* Flush */
+ swlevel = ms1bit(pend0);
+ LOCAL_HUB_S(pi_int_mask0, mask0 & ~(1 << swlevel));
+ LOCAL_HUB_CLR_INTR(swlevel);
+ /* "map" swlevel to irq */
+ irq = SWLEVEL_TO_IRQ(swlevel);
do_IRQ(irq, regs);
- LOCAL_HUB_S(PI_INT_MASK0_A, mask0);
- pend0 ^= 1ULL << irq;
+ /* reset INT_MASK0 register */
+ LOCAL_HUB_S(pi_int_mask0, mask0);
+ /* clear bit in pend0 */
+ pend0 ^= 1ULL << swlevel;
} while (pend0);
}
}
/* Startup one of the (PCI ...) IRQs routes over a bridge. */
static unsigned int bridge_startup(unsigned int irq)
{
- bridge_t *bridge = (bridge_t *) 0x9200000008000000;
- bridgereg_t br;
- int pin;
-
- /* FIIIIIXME ... Temporary kludge. This knows how interrupts are
- setup in _my_ Origin. */
- switch (irq) {
- case IOC3_SERIAL_INT: pin = 3; break;
- case IOC3_ETH_INT: pin = 2; break;
- case SCSI1_INT: pin = 1; break;
- case SCSI0_INT: pin = 0; break;
- default: panic("bridge_startup: whoops?");
- }
-
- br = LOCAL_HUB_L(PI_INT_MASK0_A);
- LOCAL_HUB_S(PI_INT_MASK0_A, br | (1 << irq));
- LOCAL_HUB_L(PI_INT_MASK0_A); /* Flush */
-
- bridge->b_int_addr[pin].addr = 0x20000 | irq;
- bridge->b_int_enable |= (1 << pin);
- if (irq < 2) {
- bridgereg_t device;
+ bridge_t *bridge;
+ int pin, swlevel;
+ int real_irq = IRQ_FROM_IRQ(irq);
+
+ DBG("bridge_startup(): irq= 0x%x real_irq= %d\n", irq, real_irq);
+ bridge = (bridge_t *) NODE_SWIN_BASE(NASID_FROM_IRQ(irq), WID_FROM_IRQ(irq));
+
+ /* FIIIIIXME ... Temporary kludge. This knows how interrupts are
+ setup in _my_ Origin. */
+
+ if (irq != real_irq) /* pci device interrupt */
+ switch (real_irq) {
+ case IRQ_FROM_IRQ(IOC3_ETH_INT): pin = 2; break;
+ default: pin = real_irq; break;
+ }
+ else
+ switch (real_irq) {
+ case CPU_RESCHED_A_IRQ:
+ case CPU_RESCHED_B_IRQ:
+ case CPU_CALL_A_IRQ:
+ case CPU_CALL_B_IRQ:
+ return 0;
+ default: panic("bridge_startup: whoops? %d\n", irq);
+ }
+
+ /*
+ * "map" irq to a swlevel greater than 6 since the first 6 bits
+ * of INT_PEND0 are taken
+ */
+ swlevel = IRQ_TO_SWLEVEL(real_irq);
+ intr_connect_level(smp_processor_id(), swlevel);
+
+ bridge->b_int_addr[pin].addr = 0x20000 | swlevel;
+ bridge->b_int_enable |= (1 << pin);
+ /* set more stuff in int_enable reg */
+ bridge->b_int_enable |= 0x7ffffe00;
+
+ if (real_irq < 2 || real_irq==4 || real_irq==5) {
+ bridgereg_t device;
#if 0
- /*
- * Allocate enough RRBs on the bridge for the DMAs.
- * Right now allocating 2 RRBs on the normal channel
- * and 2 on the virtual channel for slot 0 on the bus.
- * And same for slot 1, to get ioc3 eth working.
- */
- Not touching b_even_resp /* boot doesn't go far */
- bridge->b_even_resp = 0xdd99cc88; /* boot doesn't go far */
- bridge->b_even_resp = 0xcccc8888; /* breaks eth0 */
- bridge->b_even_resp = 0xcc88; /* breaks eth0 */
+ /*
+ * Allocate enough RRBs on the bridge for the DMAs.
+ * Right now allocating 2 RRBs on the normal channel
+ * and 2 on the virtual channel for slot 0 on the bus.
+ * And same for slot 1, to get ioc3 eth working.
+ */
+ Not touching b_even_resp /* boot doesn't go far */
+ bridge->b_even_resp = 0xdd99cc88; /* boot doesn't go far */
+ bridge->b_even_resp = 0xcccc8888; /* breaks eth0 */
+ bridge->b_even_resp = 0xcc88; /* breaks eth0 */
#endif
- /* Turn on bridge swapping */
- device = bridge->b_device[irq].reg;
- device |= BRIDGE_DEV_SWAP_DIR;
- bridge->b_device[irq].reg = device;
- }
- bridge->b_widget.w_tflush; /* Flush */
-
- return 0; /* Never anything pending. */
+ /* Turn on bridge swapping */
+ device = bridge->b_device[real_irq].reg;
+ device |= BRIDGE_DEV_SWAP_DIR;
+ bridge->b_device[real_irq].reg = device;
+ /*
+ * Associate interrupt pin with device
+ * XXX This only works if b_int_device is initialized to 0!
+ */
+ device = bridge->b_int_device;
+ device |= (pin << (real_irq*3));
+ bridge->b_int_device = device;
+ }
+ bridge->b_widget.w_tflush; /* Flush */
+
+ return 0; /* Never anything pending. */
}
-/* Startup one of the (PCI ...) IRQs routes over a bridge. */
+/* Shutdown one of the (PCI ...) IRQs routes over a bridge. */
static unsigned int bridge_shutdown(unsigned int irq)
{
- bridge_t *bridge = (bridge_t *) 0x9200000008000000;
- bridgereg_t br;
- int pin;
-
- /* FIIIIIXME ... Temporary kludge. This knows how interrupts are
- setup in _my_ Origin. */
- switch (irq) {
- case IOC3_SERIAL_INT: pin = 3; break;
- case IOC3_ETH_INT: pin = 2; break;
- case SCSI1_INT: pin = 1; break;
- case SCSI0_INT: pin = 0; break;
- default: panic("bridge_startup: whoops?");
- }
-
- br = LOCAL_HUB_L(PI_INT_MASK0_A);
- LOCAL_HUB_S(PI_INT_MASK0_A, br & ~(1 << irq));
- LOCAL_HUB_L(PI_INT_MASK0_A); /* Flush */
-
- bridge->b_int_enable &= ~(1 << pin);
- bridge->b_widget.w_tflush; /* Flush */
-
- return 0; /* Never anything pending. */
+ bridge_t *bridge;
+ int pin, swlevel;
+ int real_irq = IRQ_FROM_IRQ(irq);
+ struct irqaction **p;
+
+ bridge = (bridge_t *) NODE_SWIN_BASE(NASID_FROM_IRQ(irq), WID_FROM_IRQ(irq));
+ DBG("bridge_shutdown: irq 0x%x\n", irq);
+ /* FIIIIIXME ... Temporary kludge. This knows how interrupts are
+ setup in _my_ Origin. */
+
+ if (irq != real_irq) /* pci device interrupt */
+ switch (real_irq) {
+ case IRQ_FROM_IRQ(IOC3_ETH_INT): pin = 2; break;
+ default: pin = real_irq; break;
+ }
+ else
+ switch (real_irq) {
+ case CPU_RESCHED_A_IRQ:
+ case CPU_RESCHED_B_IRQ:
+ case CPU_CALL_A_IRQ:
+ case CPU_CALL_B_IRQ:
+ return 0;
+ default: panic("bridge_startup: whoops?");
+ }
+
+ /*
+ * map irq to a swlevel greater than 6 since the first 6 bits
+ * of INT_PEND0 are taken
+ */
+ swlevel = IRQ_TO_SWLEVEL(real_irq);
+ intr_disconnect_level(smp_processor_id(), swlevel);
+
+ bridge->b_int_enable &= ~(1 << pin);
+ bridge->b_widget.w_tflush; /* Flush */
+
+ return 0; /* Never anything pending. */
}
static void bridge_init(void)
{
- bridge_t *bridge = (bridge_t *) 0x9200000008000000;
-
- /* Hmm... IRIX sets additional bits in the address which are
- documented as reserved in the bridge docs ... */
- bridge->b_int_mode = 0x0; /* Don't clear ints */
+ bridge_t *bridge;
+ nasid_t nasid;
+ char wid;
+ int bus;
+
+ nasid = get_nasid();
+
+ for (bus=0; bus<num_bridges; bus++) {
+ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus],bus_to_wid[bus]);
+ /* Hmm... IRIX sets additional bits in the address which are
+ documented as reserved in the bridge docs ... */
+ bridge->b_int_mode = 0x0; /* Don't clear ints */
#if 0
- bridge->b_wid_int_upper = 0x000a8000; /* Ints to node 0 */
- bridge->b_wid_int_lower = 0x01000090;
- bridge->b_dir_map = 0xa00000; /* DMA */
+ bridge->b_wid_int_upper = 0x000a8000; /* Ints to node 0 */
+ bridge->b_wid_int_lower = 0x01000090;
+ bridge->b_dir_map = 0xa00000; /* DMA */
#endif /* shouldn't lower= 0x01800090 ??? */
- bridge->b_wid_int_upper = 0x00098000; /* Ints to node 0 */
- bridge->b_wid_int_lower = 0x01800090;
- bridge->b_dir_map = 0x900000; /* DMA */
+ bridge->b_wid_int_upper = 0x000a8000; /* Ints to widget A */
+ bridge->b_wid_int_lower = 0x01800090;
+ bridge->b_dir_map = 0xa00000; /* DMA */
- bridge->b_int_enable = 0;
- bridge->b_widget.w_tflush; /* Flush */
- set_cp0_status(SRB_DEV0 | SRB_DEV1, SRB_DEV0 | SRB_DEV1);
+ bridge->b_int_enable = 0;
+ bridge->b_widget.w_tflush; /* Flush */
+ }
}
void irq_debug(void)
printk("PI_INT_MASK0_A = 0x%x\n", LOCAL_HUB_L(PI_INT_MASK0_A));
}
-int setup_irq(int irq, struct irqaction *new)
+int setup_irq(unsigned int irq, struct irqaction *new)
{
int shared = 0;
struct irqaction *old, **p;
unsigned long flags;
+ DBG("setup_irq: 0x%x\n", irq);
if (new->flags & SA_SAMPLE_RANDOM)
rand_initialize_irq(irq);
save_and_cli(flags);
- p = irq_action + irq;
+ p = irq_action + IRQ_FROM_IRQ(irq);
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ)) {
int retval;
struct irqaction *action;
- if (irq > 9)
+ DBG("request_irq(): irq= 0x%x\n", irq);
+ if (IRQ_FROM_IRQ(irq) > 9)
return -EINVAL;
if (!handler)
return -EINVAL;
action->next = NULL;
action->dev_id = dev_id;
+ DBG("request_irq(): %s devid= 0x%x\n", devname, dev_id);
retval = setup_irq(irq, action);
+ DBG("request_irq(): retval= %d\n", retval);
if (retval)
kfree(action);
return retval;
struct irqaction * action, **p;
unsigned long flags;
- if (irq > 9) {
+ if (IRQ_FROM_IRQ(irq) > 9) {
printk("Trying to free IRQ%d\n", irq);
return;
}
- for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
+ for (p = IRQ_FROM_IRQ(irq) + irq_action; (action = *p) != NULL; p = &action->next) {
if (action->dev_id != dev_id)
continue;
/* Useless ISA nonsense. */
unsigned long probe_irq_on (void)
{
+ panic("probe_irq_on called!\n");
return 0;
}
bridge_init();
set_except_vector(0, ip27_irq);
}
+
+
+#ifdef CONFIG_SMP
+
+/*
+ * This following are the global intr on off routines, copied almost
+ * entirely from i386 code.
+ */
+
+int global_irq_holder = NO_PROC_ID;
+spinlock_t global_irq_lock = SPIN_LOCK_UNLOCKED;
+
+extern void show_stack(unsigned long* esp);
+
+static void show(char * str)
+{
+ int i;
+ int cpu = smp_processor_id();
+
+ printk("\n%s, CPU %d:\n", str, cpu);
+ printk("irq: %d [",irqs_running());
+ for(i=0;i < smp_num_cpus;i++)
+ printk(" %d",local_irq_count(i));
+ printk(" ]\nbh: %d [",spin_is_locked(&global_bh_lock) ? 1 : 0);
+ for(i=0;i < smp_num_cpus;i++)
+ printk(" %d",local_bh_count(i));
+
+ printk(" ]\nStack dumps:");
+ for(i = 0; i < smp_num_cpus; i++) {
+ unsigned long esp;
+ if (i == cpu)
+ continue;
+ printk("\nCPU %d:",i);
+ printk("Code not developed yet\n");
+ /* show_stack(0); */
+ }
+ printk("\nCPU %d:",cpu);
+ printk("Code not developed yet\n");
+ /* show_stack(NULL); */
+ printk("\n");
+}
+
+#define MAXCOUNT 100000000
+#define SYNC_OTHER_CORES(x) udelay(x+1)
+
+static inline void wait_on_irq(int cpu)
+{
+ int count = MAXCOUNT;
+
+ for (;;) {
+
+ /*
+ * Wait until all interrupts are gone. Wait
+ * for bottom half handlers unless we're
+ * already executing in one..
+ */
+ if (!irqs_running())
+ if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock))
+ break;
+
+ /* Duh, we have to loop. Release the lock to avoid deadlocks */
+ spin_unlock(&global_irq_lock);
+
+ for (;;) {
+ if (!--count) {
+ show("wait_on_irq");
+ count = ~0;
+ }
+ __sti();
+ SYNC_OTHER_CORES(cpu);
+ __cli();
+ if (irqs_running())
+ continue;
+ if (spin_is_locked(&global_irq_lock))
+ continue;
+ if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock))
+ continue;
+ if (spin_trylock(&global_irq_lock))
+ break;
+ }
+ }
+}
+
+void synchronize_irq(void)
+{
+ if (irqs_running()) {
+ /* Stupid approach */
+ cli();
+ sti();
+ }
+}
+
+static inline void get_irqlock(int cpu)
+{
+ if (!spin_trylock(&global_irq_lock)) {
+ /* do we already hold the lock? */
+ if ((unsigned char) cpu == global_irq_holder)
+ return;
+ /* Uhhuh.. Somebody else got it. Wait.. */
+ spin_lock(&global_irq_lock);
+ }
+ /*
+ * We also to make sure that nobody else is running
+ * in an interrupt context.
+ */
+ wait_on_irq(cpu);
+
+ /*
+ * Ok, finally..
+ */
+ global_irq_holder = cpu;
+}
+
+void __global_cli(void)
+{
+ unsigned int flags;
+
+ __save_flags(flags);
+ if (flags & ST0_IE) {
+ int cpu = smp_processor_id();
+ __cli();
+ if (!local_irq_count(cpu))
+ get_irqlock(cpu);
+ }
+}
+
+void __global_sti(void)
+{
+ int cpu = smp_processor_id();
+
+ if (!local_irq_count(cpu))
+ release_irqlock(cpu);
+ __sti();
+}
+
+/*
+ * SMP flags value to restore to:
+ * 0 - global cli
+ * 1 - global sti
+ * 2 - local cli
+ * 3 - local sti
+ */
+unsigned long __global_save_flags(void)
+{
+ int retval;
+ int local_enabled;
+ unsigned long flags;
+ int cpu = smp_processor_id();
+
+ __save_flags(flags);
+ local_enabled = (flags & ST0_IE);
+ /* default to local */
+ retval = 2 + local_enabled;
+
+ /* check for global flags if we're not in an interrupt */
+ if (!local_irq_count(cpu)) {
+ if (local_enabled)
+ retval = 1;
+ if (global_irq_holder == cpu)
+ retval = 0;
+ }
+ return retval;
+}
+
+void __global_restore_flags(unsigned long flags)
+{
+ switch (flags) {
+ case 0:
+ __global_cli();
+ break;
+ case 1:
+ __global_sti();
+ break;
+ case 2:
+ __cli();
+ break;
+ case 3:
+ __sti();
+ break;
+ default:
+ printk("global_restore_flags: %08lx\n", flags);
+ }
+}
+
+#endif /* CONFIG_SMP */
+
+/*
+ * Get values that vary depending on which CPU and bit we're operating on.
+ */
+static hub_intmasks_t *intr_get_ptrs(cpuid_t cpu, int bit, int *new_bit,
+ hubreg_t **intpend_masks, int *ip)
+{
+ hub_intmasks_t *hub_intmasks;
+
+ hub_intmasks = &cpu_data[cpu].p_intmasks;
+ if (bit < N_INTPEND_BITS) {
+ *intpend_masks = hub_intmasks->intpend0_masks;
+ *ip = 0;
+ *new_bit = bit;
+ } else {
+ *intpend_masks = hub_intmasks->intpend1_masks;
+ *ip = 1;
+ *new_bit = bit - N_INTPEND_BITS;
+ }
+ return hub_intmasks;
+}
+
+int intr_connect_level(cpuid_t cpu, int bit)
+{
+ int ip;
+ int slice = cputoslice(cpu);
+ volatile hubreg_t *mask_reg;
+ hubreg_t *intpend_masks;
+ nasid_t nasid = COMPACT_TO_NASID_NODEID(cputocnode(cpu));
+
+ (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, &ip);
+
+ /* Make sure it's not already pending when we connect it. */
+ REMOTE_HUB_CLR_INTR(nasid, bit + ip * N_INTPEND_BITS);
+
+ intpend_masks[0] |= (1ULL << (u64)bit);
+
+ if (ip == 0) {
+ mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK0_A +
+ PI_INT_MASK_OFFSET * slice);
+ } else {
+ mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK1_A +
+ PI_INT_MASK_OFFSET * slice);
+ }
+ HUB_S(mask_reg, intpend_masks[0]);
+ return(0);
+}
+
+int intr_disconnect_level(cpuid_t cpu, int bit)
+{
+ int ip;
+ int slice = cputoslice(cpu);
+ volatile hubreg_t *mask_reg;
+ hubreg_t *intpend_masks;
+ nasid_t nasid = COMPACT_TO_NASID_NODEID(cputocnode(cpu));
+
+ (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, &ip);
+ intpend_masks[0] &= ~(1ULL << (u64)bit);
+ if (ip == 0) {
+ mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK0_A +
+ PI_INT_MASK_OFFSET * slice);
+ } else {
+ mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK1_A +
+ PI_INT_MASK_OFFSET * slice);
+ }
+ HUB_S(mask_reg, intpend_masks[0]);
+ return(0);
+}
+
+
+void handle_resched_intr(int irq, void *dev_id, struct pt_regs *regs)
+{
+ /* Nothing, the return from intr will work for us */
+}
+
+void install_cpuintr(cpuid_t cpu)
+{
+ int irq;
+ extern void smp_call_function_interrupt(void);
+ static int done = 0;
+
+ /*
+ * This is a hack till we have a pernode irqlist. Currently,
+ * just have the master cpu set up the handlers for the per
+ * cpu irqs.
+ */
+
+#ifdef CONFIG_SMP
+#if (CPUS_PER_NODE == 2)
+ irq = CPU_RESCHED_A_IRQ + cputoslice(cpu);
+ intr_connect_level(cpu, IRQ_TO_SWLEVEL(irq));
+ if (done == 0)
+ if (request_irq(irq, handle_resched_intr, 0, "resched", 0))
+ panic("intercpu intr unconnectible\n");
+ irq = CPU_CALL_A_IRQ + cputoslice(cpu);
+ intr_connect_level(cpu, IRQ_TO_SWLEVEL(irq));
+ if (done == 0)
+ if (request_irq(irq, smp_call_function_interrupt, 0,
+ "callfunc", 0))
+ panic("intercpu intr unconnectible\n");
+ /* HACK STARTS */
+ if (done)
+ return;
+ irq = CPU_RESCHED_A_IRQ + cputoslice(cpu) + 1;
+ if (request_irq(irq, handle_resched_intr, 0, "resched", 0))
+ panic("intercpu intr unconnectible\n");
+ irq = CPU_CALL_A_IRQ + cputoslice(cpu) + 1;
+ if (request_irq(irq, smp_call_function_interrupt, 0,
+ "callfunc", 0))
+ panic("intercpu intr unconnectible\n");
+ done = 1;
+ /* HACK ENDS */
+#else /* CPUS_PER_NODE */
+ << Bomb! Must redefine this for more than 2 CPUS. >>
+#endif /* CPUS_PER_NODE */
+#endif /* CONFIG_SMP */
+}
+
+void install_tlbintr(cpuid_t cpu)
+{
+ int intr_bit = N_INTPEND_BITS + TLB_INTR_A + cputoslice(cpu);
+
+ intr_connect_level(cpu, intr_bit);
+}
-/* $Id: ip27-klconfig.c,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
#include <linux/mm.h>
#include <asm/sn/klconfig.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/gda.h>
-lboard_t *find_lboard(unsigned int type)
+klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char struct_type)
{
- lboard_t *b;
+ int index, j;
- for (
-b = KL_CONFIG_INFO(get_nasid());
-b;
-b = KLCF_NEXT(b)) {
- if (KLCF_REMOTE(b))
- continue; /* Skip remote boards. */
+ if (kli == (klinfo_t *)NULL) {
+ index = 0;
+ } else {
+ for (j = 0; j < KLCF_NUM_COMPS(brd); j++)
+ if (kli == KLCF_COMP(brd, j))
+ break;
+ index = j;
+ if (index == KLCF_NUM_COMPS(brd)) {
+ printk("find_component: Bad pointer: 0x%p\n", kli);
+ return (klinfo_t *)NULL;
+ }
+ index++; /* next component */
+ }
+
+ for (; index < KLCF_NUM_COMPS(brd); index++) {
+ kli = KLCF_COMP(brd, index);
+ if (KLCF_COMP_TYPE(kli) == struct_type)
+ return kli;
+ }
+
+ /* Didn't find it. */
+ return (klinfo_t *)NULL;
+}
+
+klinfo_t *find_first_component(lboard_t *brd, unsigned char struct_type)
+{
+ return find_component(brd, (klinfo_t *)NULL, struct_type);
+}
+
+lboard_t * find_lboard(lboard_t *start, unsigned char brd_type)
+{
+ /* Search all boards stored on this node. */
+ while (start) {
+ if (start->brd_type == brd_type)
+ return start;
+ start = KLCF_NEXT(start);
+ }
+ /* Didn't find it. */
+ return (lboard_t *)NULL;
+}
+
+cnodeid_t get_cpu_cnode(int cpu)
+{
+ return CPUID_TO_COMPACT_NODEID(cpu);
+}
- if (b->brd_type == type)
- return (lboard_t *) b;
+klcpu_t * nasid_slice_to_cpuinfo(nasid_t nasid, int slice)
+{
+ lboard_t *brd;
+ klcpu_t *acpu;
+
+ if (!(brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27)))
+ return (klcpu_t *)NULL;
+
+ if (!(acpu = (klcpu_t *)find_first_component(brd, KLSTRUCT_CPU)))
+ return (klcpu_t *)NULL;
+
+ do {
+ if ((acpu->cpu_info.physid) == slice)
+ return acpu;
+ } while ((acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu,
+ KLSTRUCT_CPU)));
+ return (klcpu_t *)NULL;
+}
+
+klcpu_t * sn_get_cpuinfo(cpuid_t cpu)
+{
+ nasid_t nasid;
+ int slice;
+ klcpu_t *acpu;
+ gda_t *gdap = GDA;
+ cnodeid_t cnode;
+
+ if (!(cpu < MAXCPUS)) {
+ printk("sn_get_cpuinfo: illegal cpuid 0x%lx\n", cpu);
+ return NULL;
}
+ cnode = get_cpu_cnode(cpu);
+ if (cnode == INVALID_CNODEID)
+ return NULL;
+
+ if ((nasid = gdap->g_nasidtable[cnode]) == INVALID_NASID)
+ return NULL;
+
+ for (slice = 0; slice < CPUS_PER_NODE; slice++) {
+ acpu = nasid_slice_to_cpuinfo(nasid, slice);
+ if (acpu && acpu->cpu_info.virtid == cpu)
+ return acpu;
+ }
return NULL;
}
+
+int get_cpu_slice(cpuid_t cpu)
+{
+ klcpu_t *acpu;
+
+ if ((acpu = sn_get_cpuinfo(cpu)) == NULL)
+ return -1;
+ return acpu->cpu_info.physid;
+}
-/* $Id: ip27-memory.c,v 1.9 2000/02/10 09:07:31 kanoj Exp $
+/* $Id: ip27-memory.c,v 1.2 2000/01/27 01:05:24 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
*/
pfn_t node_getfirstfree(cnodeid_t cnode)
{
-#ifdef LATER
nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
- if (cnode == 0)
- return KDM_TO_PHYS((unsigned long)(&_end));
- return KDM_TO_PHYS(SYMMON_STK_ADDR(nasid, 0));
-#endif
if (cnode == 0)
return (KDM_TO_PHYS(PAGE_ALIGN((unsigned long)(&_end)) -
(CKSEG0 - K0BASE)) >> PAGE_SHIFT);
- return slot_getbasepfn(cnode, 0);
+ return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> PAGE_SHIFT);
}
/*
nasid = COMPACT_TO_NASID_NODEID(node);
/* Find the node board */
- brd = find_lboard_real((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27);
+ brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27);
if (!brd)
return 0;
void __init paging_init(void)
{
cnodeid_t node;
- unsigned int zones_size[MAX_NR_ZONES] = {0, 0, 0};
+ unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
- pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2);
pmd_init((unsigned long)invalid_pmd_table);
+ memset((void *)invalid_pte_table, 0, sizeof(pte_t) * 2 * PTRS_PER_PTE);
for (node = 0; node < numnodes; node++) {
pfn_t start_pfn = slot_getbasepfn(node, 0);
pfn_t end_pfn = node_getmaxclick(node);
zones_size[ZONE_DMA] = end_pfn + 1 - start_pfn;
- PLAT_NODE_DATA(node)->physstart = (start_pfn << PAGE_SHIFT);
- PLAT_NODE_DATA(node)->size = (zones_size[ZONE_DMA] << PAGE_SHIFT);
free_area_init_node(node, NODE_DATA(node), zones_size,
start_pfn << PAGE_SHIFT, 0);
- PLAT_NODE_DATA(node)->start_mapnr =
- (NODE_DATA(node)->node_mem_map - mem_map);
- if ((PLAT_NODE_DATA(node)->start_mapnr +
- PLAT_NODE_DATA(node)->size) > pagenr)
- pagenr = PLAT_NODE_DATA(node)->start_mapnr +
- PLAT_NODE_DATA(node)->size;
+ if ((PLAT_NODE_DATA_STARTNR(node) +
+ PLAT_NODE_DATA_SIZE(node)) > pagenr)
+ pagenr = PLAT_NODE_DATA_STARTNR(node) +
+ PLAT_NODE_DATA_SIZE(node);
}
}
for (nid = 0; nid < numnodes; nid++) {
+ /*
+ * Hack till free_area_init_core() zeroes free_pages
+ */
+ for (tmp = 0; tmp < MAX_NR_ZONES; tmp++)
+ PLAT_NODE_DATA(nid)->gendata.node_zones[tmp].free_pages=0;
/*
* This will free up the bootmem, ie, slot 0 memory.
*/
* We need to manually do the other slots.
*/
pg = NODE_DATA(nid)->node_mem_map + slot_getsize(nid, 0);
- pgnr = PLAT_NODE_DATA(nid)->start_mapnr + slot_getsize(nid, 0);
+ pgnr = PLAT_NODE_DATA_STARTNR(nid) + slot_getsize(nid, 0);
numslots = node_getlastslot(nid);
for (slot = 1; slot <= numslots; slot++) {
pslot = NODE_DATA(nid)->node_mem_map +
reservedpages = ram = 0;
for (nid = 0; nid < numnodes; nid++) {
- for (tmp = PLAT_NODE_DATA(nid)->start_mapnr; tmp <
- ((PLAT_NODE_DATA(nid)->start_mapnr) +
- (PLAT_NODE_DATA(nid)->size >> PAGE_SHIFT)); tmp++) {
+ for (tmp = PLAT_NODE_DATA_STARTNR(nid); tmp <
+ (PLAT_NODE_DATA_STARTNR(nid) +
+ PLAT_NODE_DATA_SIZE(nid)); tmp++) {
/* Ignore holes */
if (PageSkip(mem_map+tmp))
continue;
--- /dev/null
+#include <linux/kernel.h>
+#include <linux/mmzone.h>
+#include <linux/spinlock.h>
+#include <linux/smp.h>
+#include <asm/atomic.h>
+#include <asm/sn/types.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/nmi.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/sn0/hub.h>
+
+#if 0
+#define NODE_NUM_CPUS(n) CNODE_NUM_CPUS(n)
+#else
+#define NODE_NUM_CPUS(n) CPUS_PER_NODE
+#endif
+
+#define CNODEID_NONE (cnodeid_t)-1
+#define enter_panic_mode() spin_lock(&nmi_lock)
+
+typedef unsigned long machreg_t;
+
+spinlock_t nmi_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Lets see what else we need to do here. Set up sp, gp?
+ */
+void nmi_dump(void)
+{
+ void cont_nmi_dump(void);
+
+ cont_nmi_dump();
+}
+
+void install_cpu_nmi_handler(int slice)
+{
+ nmi_t *nmi_addr;
+
+ nmi_addr = (nmi_t *)NMI_ADDR(get_nasid(), slice);
+ if (nmi_addr->call_addr)
+ return;
+ nmi_addr->magic = NMI_MAGIC;
+ nmi_addr->call_addr = (void *)nmi_dump;
+ nmi_addr->call_addr_c =
+ (void *)(~((unsigned long)(nmi_addr->call_addr)));
+ nmi_addr->call_parm = 0;
+}
+
+/*
+ * Copy the cpu registers which have been saved in the IP27prom format
+ * into the eframe format for the node under consideration.
+ */
+
+void
+nmi_cpu_eframe_save(nasid_t nasid,
+ int slice)
+{
+ int i, numberof_nmi_cpu_regs;
+ machreg_t *prom_format;
+
+ /* Get the total number of registers being saved by the prom */
+ numberof_nmi_cpu_regs = sizeof(struct reg_struct) / sizeof(machreg_t);
+
+ /* Get the pointer to the current cpu's register set. */
+ prom_format =
+ (machreg_t *)(TO_UNCAC(TO_NODE(nasid, IP27_NMI_KREGS_OFFSET)) +
+ slice * IP27_NMI_KREGS_CPU_SIZE);
+
+ printk("NMI nasid %d: slice %d\n", nasid, slice);
+ for (i = 0; i < numberof_nmi_cpu_regs; i++)
+ printk("0x%lx ", prom_format[i]);
+ printk("\n\n");
+}
+
+/*
+ * Copy the cpu registers which have been saved in the IP27prom format
+ * into the eframe format for the node under consideration.
+ */
+void
+nmi_node_eframe_save(cnodeid_t cnode)
+{
+ int cpu;
+ nasid_t nasid;
+
+ /* Make sure that we have a valid node */
+ if (cnode == CNODEID_NONE)
+ return;
+
+ nasid = COMPACT_TO_NASID_NODEID(cnode);
+ if (nasid == INVALID_NASID)
+ return;
+
+ /* Save the registers into eframe for each cpu */
+ for(cpu = 0; cpu < NODE_NUM_CPUS(cnode); cpu++)
+ nmi_cpu_eframe_save(nasid, cpu);
+}
+
+/*
+ * Save the nmi cpu registers for all cpus in the system.
+ */
+void
+nmi_eframes_save(void)
+{
+ cnodeid_t cnode;
+
+ for(cnode = 0 ; cnode < numnodes; cnode++)
+ nmi_node_eframe_save(cnode);
+}
+
+void
+cont_nmi_dump(void)
+{
+#ifndef REAL_NMI_SIGNAL
+ static atomic_t nmied_cpus = ATOMIC_INIT(0);
+
+ atomic_inc(&nmied_cpus);
+#endif
+ /*
+ * Use enter_panic_mode to allow only 1 cpu to proceed
+ */
+ enter_panic_mode();
+
+#ifdef REAL_NMI_SIGNAL
+ /*
+ * Wait up to 15 seconds for the other cpus to respond to the NMI.
+ * If a cpu has not responded after 10 sec, send it 1 additional NMI.
+ * This is for 2 reasons:
+ * - sometimes a MMSC fail to NMI all cpus.
+ * - on 512p SN0 system, the MMSC will only send NMIs to
+ * half the cpus. Unfortunately, we dont know which cpus may be
+ * NMIed - it depends on how the site chooses to configure.
+ *
+ * Note: it has been measure that it takes the MMSC up to 2.3 secs to
+ * send NMIs to all cpus on a 256p system.
+ */
+ for (i=0; i < 1500; i++) {
+ for (node=0; node < numnodes; node++)
+ if (NODEPDA(node)->dump_count == 0)
+ break;
+ if (node == numnodes)
+ break;
+ if (i == 1000) {
+ for (node=0; node < numnodes; node++)
+ if (NODEPDA(node)->dump_count == 0) {
+ cpu = CNODE_TO_CPU_BASE(node);
+ for (n=0; n < CNODE_NUM_CPUS(node); cpu++, n++) {
+ CPUMASK_SETB(nmied_cpus, cpu);
+ SEND_NMI((cputonasid(cpu)), (cputoslice(cpu)));
+ }
+ }
+
+ }
+ udelay(10000);
+ }
+#else
+ while (atomic_read(&nmied_cpus) != smp_num_cpus);
+#endif
+
+ /*
+ * Save the nmi cpu registers for all cpu in the eframe format.
+ */
+ nmi_eframes_save();
+ LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
+}
+
-/* $Id: ip27-pci-dma.c,v 1.1 2000/02/18 00:24:31 ralf Exp $
+/* $Id: ip27-pci-dma.c,v 1.1 2000/02/16 21:22:00 ralf Exp $
*
* Dynamic DMA mapping support.
*
#include <asm/sn/arch.h>
#include <asm/pci/bridge.h>
#include <asm/paccess.h>
+#include <asm/sn/sn0/ip27.h>
+#include <asm/sn/sn0/hub.h>
/*
* The Bridge ASIC supports both type 0 and type 1 access. Type 1 is
*/
#define CF0_READ_PCI_CFG(dev,where,value,bm,mask) \
do { \
- bridge_t *bridge = (bridge_t *) 0x9200000008000000; \
+ bridge_t *bridge; \
int slot = PCI_SLOT(dev->devfn); \
int fn = PCI_FUNC(dev->devfn); \
volatile u32 *addr; \
u32 cf, __bit; \
+ unsigned int bus_id = (unsigned) dev->bus->number; \
\
- if (dev->bus->number) \
- return PCIBIOS_DEVICE_NOT_FOUND; \
+ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \
+ bus_to_wid[bus_id]); \
+ \
+ /*if (dev->bus->number) */ \
+ /* return PCIBIOS_DEVICE_NOT_FOUND; */ \
\
__bit = (((where) & (bm)) << 3); \
addr = &bridge->b_type0_cfg_dev[slot].f[fn].l[where >> 2]; \
#define CF0_WRITE_PCI_CFG(dev,where,value,bm,mask) \
do { \
- bridge_t *bridge = (bridge_t *) 0x9200000008000000; \
+ bridge_t *bridge; \
int slot = PCI_SLOT(dev->devfn); \
int fn = PCI_FUNC(dev->devfn); \
volatile u32 *addr; \
u32 cf, __bit; \
+ unsigned int bus_id = (unsigned) dev->bus->number; \
\
- if (dev->bus->number) \
- return PCIBIOS_DEVICE_NOT_FOUND; \
+ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \
+ bus_to_wid[bus_id]); \
+ \
+ /* if (dev->bus->number) */ \
+ /* return PCIBIOS_DEVICE_NOT_FOUND; */ \
\
if (dev->vendor == PCI_VENDOR_ID_SGI \
&& dev->device == PCI_DEVICE_ID_SGI_IOC3) \
{
struct pci_ops *ops = &bridge_pci_ops;
nasid_t nid = get_nasid();
+ int i;
ioport_resource.end = ~0UL;
- printk("PCI: Probing PCI hardware on host bus 0, node %d.\n", nid);
- pci_scan_bus(0, ops, NULL);
+ for (i=0; i<num_bridges; i++) {
+ printk("PCI: Probing PCI hardware on host bus %2d, node %d.\n", i, nid);
+ pci_scan_bus(i, ops, NULL);
+ }
}
static inline u8
static int __init
pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
- return (slot + (((pin-1) & 1) << 2)) & 7;
+ int rv;
+ rv = (slot + (((pin-1) & 1) << 2)) & 7;
+ rv |= (bus_to_wid[dev->bus->number] << 8);
+ rv |= (bus_to_nid[dev->bus->number] << 16);
+ return rv;
}
void __init
void __init
pcibios_fixup_bus(struct pci_bus *b)
{
- unsigned short command;
- struct list_head *ln;
- struct pci_dev *dev;
-
pci_fixup_irqs(pci_swizzle, pci_map_irq);
-
- /*
- * Older qlogicisp driver expects to have the IO space enable
- * bit set. Make that happen for qlogic in slots 0 and 1. Things
- * stop working if we program the controllers as not having
- * PCI_COMMAND_MEMORY, so we have to fudge the mem_flags.
- */
- for (ln=b->devices.next; ln != &b->devices; ln=ln->next) {
- dev = pci_dev_b(ln);
- if (PCI_FUNC(dev->devfn) == 0) {
- if ((PCI_SLOT(dev->devfn) == 0) ||
- (PCI_SLOT(dev->devfn) == 1)) {
- if (pci_read_config_word(dev, PCI_COMMAND,
- &command) == 0) {
- command |= PCI_COMMAND_IO;
- pci_write_config_word(dev, PCI_COMMAND,
- command);
- dev->resource[1].flags |= 1;
- }
- }
- }
- }
}
void __init
with tons of bogus information in the pci_dev. On Origins the
INTA, INTB and INTC pins are all wired together as if it'd only
use INTA. */
- printk("PCI: Fixing base addresses for device %s\n", d->slot_name);
+ printk("PCI: Fixing base addresses for IOC3 device %s\n", d->slot_name);
for (i = 1; i <= PCI_ROM_RESOURCE; i++) {
d->resource[i].start = 0UL;
d->irq = 1;
}
+static void __init
+pci_fixup_isp1020(struct pci_dev *d)
+{
+ unsigned short command;
+
+ printk("PCI: Fixing isp1020 in [bus:slot.fn] %s\n", d->slot_name);
+
+ /* Configure device to allow bus mastering, i/o and memory mapping.
+ * Older qlogicisp driver expects to have the IO space enable
+ * bit set. Things stop working if we program the controllers as not having
+ * PCI_COMMAND_MEMORY, so we have to fudge the mem_flags.
+ */
+
+ /* only turn on scsi's on main bus */
+ if (d->bus->number == 0) {
+ pci_set_master(d);
+ pci_read_config_word(d, PCI_COMMAND, &command);
+ command |= PCI_COMMAND_MEMORY;
+ command |= PCI_COMMAND_IO;
+ pci_write_config_word(d, PCI_COMMAND, command);
+ d->resource[1].flags |= 1;
+ }
+}
+static void __init
+pci_fixup_isp2x00(struct pci_dev *d)
+{
+ unsigned int bus_id = (unsigned) d->bus->number;
+ bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id],
+ bus_to_wid[bus_id]);
+ bridgereg_t devreg;
+ int i;
+ int slot = PCI_SLOT(d->devfn);
+ unsigned int start;
+ unsigned short command;
+
+ printk("PCI: Fixing isp2x00 in [bus:slot.fn] %s\n", d->slot_name);
+
+ /* set the resource struct for this device */
+ start = (u32) bridge; /* yes, we want to lose the upper 32 bits here */
+ start |= BRIDGE_DEVIO(slot);
+
+ d->resource[0].start = start;
+ d->resource[0].end = d->resource[0].start + 0xff;
+ d->resource[0].flags = IORESOURCE_IO;
+
+ d->resource[1].start = start;
+ d->resource[1].end = d->resource[0].start + 0xfff;
+ d->resource[1].flags = IORESOURCE_MEM;
+
+ /*
+ * set the bridge device(x) reg for this device
+ */
+ devreg = bridge->b_device[slot].reg;
+ /* point device(x) to it appropriate small window */
+ devreg &= ~BRIDGE_DEV_OFF_MASK;
+ devreg |= (start >> 20) & BRIDGE_DEV_OFF_MASK;
+
+ /* turn on byte swapping in direct map mode (how we currently run dma's) */
+ devreg |= BRIDGE_DEV_SWAP_DIR; /* turn on byte swapping */
+
+ bridge->b_device[slot].reg = devreg;
+
+ /* set card's base addr reg */
+ //pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_0, 0x500001);
+ //pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_1, 0x8b00000);
+ //pci_conf0_write_config_dword(d, PCI_ROM_ADDRESS, 0x8b20000);
+
+ /* I got these from booting irix on system...*/
+ pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_0, 0x200001);
+ //pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_1, 0xf800000);
+ pci_conf0_write_config_dword(d, PCI_ROM_ADDRESS, 0x10200000);
+
+ pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_1, start);
+ //pci_conf0_write_config_dword(d, PCI_ROM_ADDRESS, (start | 0x20000));
+
+
+ /* set cache line size */
+ pci_conf0_write_config_dword(d, PCI_CACHE_LINE_SIZE, 0xf080);
+
+ /* set pci bus timeout */
+ bridge->b_bus_timeout |= BRIDGE_BUS_PCI_RETRY_HLD(0x3);
+ bridge->b_wid_tflush;
+ printk("PCI: bridge bus timeout= 0x%x \n", bridge->b_bus_timeout);
+
+ /* set host error field */
+ bridge->b_int_host_err = 0x44;
+ bridge->b_wid_tflush;
+
+ bridge->b_wid_tflush; /* wait until Bridge PIO complete */
+ for (i=0; i<8; i++)
+ printk("PCI: device(%d)= 0x%x\n",i,bridge->b_device[i].reg);
+
+ /* configure device to allow bus mastering, i/o and memory mapping */
+ pci_set_master(d);
+ pci_read_config_word(d, PCI_COMMAND, &command);
+ command |= PCI_COMMAND_MEMORY;
+ command |= PCI_COMMAND_IO;
+ pci_write_config_word(d, PCI_COMMAND, command);
+ /*d->resource[1].flags |= 1;*/
+}
+
struct pci_fixup pcibios_fixups[] = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
pci_fixup_ioc3 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020,
+ pci_fixup_isp1020 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100,
+ pci_fixup_isp2x00 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200,
+ pci_fixup_isp2x00 },
{ 0 }
};
-/* $Id: ip27-reset.c,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* 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
* Copyright (C) 1997, 1998, 1999 by Ralf Baechle
* Copyright (C) 1999 Silicon Graphics, Inc.
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/timer.h>
+#include <linux/smp.h>
+#include <linux/mmzone.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/sgialib.h>
#include <asm/sgi/sgihpc.h>
#include <asm/sgi/sgint23.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/gda.h>
+#include <asm/sn/sn0/hub.h>
void machine_restart(char *command) __attribute__((noreturn));
void machine_halt(void) __attribute__((noreturn));
/* XXX How to pass the reboot command to the firmware??? */
void machine_restart(char *command)
{
- ArcReboot();
+ int i;
+
+ printk("Reboot started from CPU %d\n", smp_processor_id());
+#ifdef CONFIG_SMP
+ smp_send_stop();
+#endif
+#if 0
+ for (i = 0; i < numnodes; i++)
+ REMOTE_HUB_S(COMPACT_TO_NASID_NODEID(i), PROMOP_REG,
+ PROMOP_RESTART);
+#else
+ LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
+#endif
}
void machine_halt(void)
-/* $Id: ip27-setup.c,v 1.6 2000/02/05 02:12:32 kanoj Exp $
+/* $Id: ip27-setup.c,v 1.7 2000/03/07 15:45:29 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
#include <asm/sn/klconfig.h>
#include <asm/ioc3.h>
#include <asm/mipsregs.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/sn_private.h>
+#include <asm/pci/bridge.h>
+#include <asm/paccess.h>
+#include <asm/sn/sn0/ip27.h>
+#include <asm/sn/sn0/hubio.h>
/* Check against user dumbness. */
#ifdef CONFIG_VT
#error CONFIG_VT not allowed for IP27.
#endif
+#undef DEBUG_SETUP
+#ifdef DEBUG_SETUP
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+
/*
* get_nasid() returns the physical node id number of the caller.
*/
#endif
}
+#define XBOW_WIDGET_PART_NUM 0x0
+#define XXBOW_WIDGET_PART_NUM 0xd000 /* Xbridge */
+#define BASE_XBOW_PORT 8 /* Lowest external port */
+
+static void __init pcibr_setup(void)
+{
+ int i;
+ bridge_t *bridge;
+ volatile u64 hubreg;
+ nasid_t nasid;
+ xwidget_part_num_t partnum;
+ widgetreg_t widget_id;
+
+ num_bridges = 0;
+ /*
+ * find what's on our local node
+ */
+ nasid = 0;
+ hubreg = LOCAL_HUB_L(IIO_LLP_CSR);
+ if (hubreg & IIO_LLP_CSR_IS_UP) {
+ /* link is up */
+ widget_id = *(volatile widgetreg_t *)
+ (RAW_NODE_SWIN_BASE(nasid, 0x0) + WIDGET_ID);
+ partnum = XWIDGET_PART_NUM(widget_id);
+ printk("pcibr_setup(): found partnum= 0x%x ", partnum);
+ if (partnum == BRIDGE_WIDGET_PART_NUM) {
+ /*
+ * found direct connected bridge so must be Origin200
+ */
+ printk("...is bridge\n");
+ num_bridges = 1;
+ bus_to_wid[0] = 0x8;
+ bus_to_nid[0] = 0;
+ }
+ if (partnum == XBOW_WIDGET_PART_NUM) {
+ lboard_t *brd;
+ klxbow_t *xbow_p;
+ /*
+ * found xbow, so may have multiple bridges
+ * need to probe xbow
+ */
+ printk("...is xbow\n");
+
+ if ((brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid),
+ KLTYPE_MIDPLANE8)) == NULL)
+ printk("argh\n");
+ else
+ printk("brd= 0x%x\n", brd);
+ if ((xbow_p = (klxbow_t *)
+ find_component(brd, NULL, KLSTRUCT_XBOW)) == NULL)
+ printk("argh\n");
+ else {
+ for (i=HUB_WIDGET_ID_MIN; i<=HUB_WIDGET_ID_MAX; i++) {
+ if (!XBOW_PORT_IS_ENABLED(xbow_p, i))
+ continue;
+ if (XBOW_PORT_TYPE_IO(xbow_p, i)) {
+ widget_id = *(volatile widgetreg_t *)
+ (RAW_NODE_SWIN_BASE(nasid, i) + WIDGET_ID);
+ partnum = XWIDGET_PART_NUM(widget_id);
+ if (partnum == BRIDGE_WIDGET_PART_NUM) {
+ printk("widget 0x%x is a bridge\n", i);
+ bus_to_wid[num_bridges] = i;
+ bus_to_nid[num_bridges] = nasid;
+ num_bridges++;
+ }
+ }
+ }
+ }
+ }
+ if (partnum == XXBOW_WIDGET_PART_NUM) {
+ /*
+ * found xbridge, assume ibrick for now
+ */
+ printk("...is xbridge\n");
+ bus_to_wid[0] = 0xb;
+ bus_to_wid[1] = 0xe;
+ bus_to_wid[2] = 0xf;
+
+ bus_to_nid[0] = 0;
+ bus_to_nid[1] = 0;
+ bus_to_nid[2] = 0;
+
+ num_bridges = 3;
+ }
+ }
+ /*
+ * set bridge registers
+ */
+ for (i=0; i<num_bridges; i++) {
+ DBG("pcibr_setup: bus= %d bus_to_wid[%2d]= %d bus_to_nid[%2d]= %d\n",
+ i, i, bus_to_wid[i], i, bus_to_nid[i]);
+
+ /*
+ * point to this bridge
+ */
+ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[i],bus_to_wid[i]);
+ /*
+ * Clear all pending interrupts.
+ */
+ bridge->b_int_rst_stat = (BRIDGE_IRR_ALL_CLR);
+ /*
+ * Until otherwise set up, assume all interrupts are from slot 0
+ */
+ bridge->b_int_device = (u32) 0x0;
+ /*
+ * swap pio's to pci mem and io space (big windows)
+ */
+ bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP;
+ bridge->b_wid_control |= BRIDGE_CTRL_MEM_SWAP;
+
+ bridge->b_wid_tflush; /* wait until Bridge PIO complete */
+ }
+}
+
void __init ip27_setup(void)
{
nasid_t nid;
hubreg_t p, e;
- set_cp0_status(ST0_IM, 0);
+ /*
+ * hub_rtc init and cpu clock intr enabled for later calibrate_delay.
+ */
+ DBG("ip27_setup(): Entered.\n");
+ per_cpu_init();
nid = get_nasid();
printk("IP27: Running on node %d.\n", nid);
verify_mode();
ioc3_sio_init();
ioc3_eth_init();
+
+ DBG("ip27_setup(): calling pcibr_setup\n");
+ /* set some bridge registers */
+ pcibr_setup();
+ DBG("ip27_setup(): Exit.\n");
}
#include <asm/sn/klconfig.h>
#include <asm/sn/arch.h>
#include <asm/sn/addrs.h>
+#include <asm/sn/sn_private.h>
#include <asm/sn/sn0/ip27.h>
#include <asm/sn/sn0/hub.h>
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
- unsigned char save_control, save_freq_select;
struct m48t35_rtc *rtc;
nasid_t nid;
void rt_timer_interrupt(struct pt_regs *regs)
{
+ int cpu = smp_processor_id();
+ int cpuA = ((cputoslice(smp_processor_id())) == 0);
+ int user = user_mode(regs);
int irq = 7; /* XXX Assign number */
write_lock(&xtime_lock);
again:
- LOCAL_HUB_S(PI_RT_PEND_A, 0); /* Ack */
+ LOCAL_HUB_S(cpuA ? PI_RT_PEND_A : PI_RT_PEND_B, 0); /* Ack */
ct_cur += CYCLES_PER_JIFFY;
- LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur);
+ LOCAL_HUB_S(cpuA ? PI_RT_COMPARE_A : PI_RT_COMPARE_B, ct_cur);
if (LOCAL_HUB_L(PI_RT_COUNT) >= ct_cur)
goto again;
- kstat.irqs[0][irq]++;
+ kstat.irqs[cpu][irq]++; /* kstat+do_timer only for bootcpu? */
do_timer(regs);
+
+#ifdef CONFIG_SMP
+ if (current->pid) {
+ unsigned int *inc, *inc2;
+
+ update_one_process(current, 1, user, !user, cpu);
+ if (--current->counter <= 0) {
+ current->counter = 0;
+ current->need_resched = 1;
+ }
+
+ if (user) {
+ if (current->priority < DEF_PRIORITY) {
+ inc = &kstat.cpu_nice;
+ inc2 = &kstat.per_cpu_nice[cpu];
+ } else {
+ inc = &kstat.cpu_user;
+ inc2 = &kstat.per_cpu_user[cpu];
+ }
+ } else {
+ inc = &kstat.cpu_system;
+ inc2 = &kstat.per_cpu_system[cpu];
+ }
+ atomic_inc((atomic_t *)inc);
+ atomic_inc((atomic_t *)inc2);
+ }
+#endif /* CONFIG_SMP */
/*
* If we have an externally synchronized Linux clock, then update
nasid_t nid;
nid = get_nasid();
- rtc = KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0;
+ rtc = (struct m48t35_rtc *)(KL_CONFIG_CH_CONS_INFO(nid)->memory_base +
+ IOC3_BYTEBUS_DEV0);
rtc->control |= M48T35_RTC_READ;
sec = rtc->sec;
extern void ioc3_eth_init(void);
void __init time_init(void)
+{
+ xtime.tv_sec = get_m48t35_time();
+ xtime.tv_usec = 0;
+}
+
+void __init cpu_time_init(void)
{
lboard_t *board;
klcpu_t *cpu;
int cpuid;
- xtime.tv_sec = get_m48t35_time();
- xtime.tv_usec = 0;
-
/* Don't use ARCS. ARCS is fragile. Klconfig is simple and sane. */
- board = find_lboard(KLTYPE_IP27);
+ board = find_lboard(KL_CONFIG_INFO(get_nasid()), KLTYPE_IP27);
if (!board)
panic("Can't find board info for myself.");
if (!cpu)
panic("No information about myself?");
- printk("CPU clock is %dMHz.\n", cpu->cpu_speed);
-
- /* Don't worry about second CPU, it's disabled. */
- LOCAL_HUB_S(PI_RT_EN_A, 1);
- LOCAL_HUB_S(PI_PROF_EN_A, 0);
- ct_cur = CYCLES_PER_JIFFY;
- LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur);
- LOCAL_HUB_S(PI_RT_COUNT, 0);
- LOCAL_HUB_S(PI_RT_PEND_A, 0);
+ printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed);
set_cp0_status(SRB_TIMOCLK, SRB_TIMOCLK);
}
+
+void __init hub_rtc_init(cnodeid_t cnode)
+{
+ /*
+ * We only need to initialize the current node.
+ * If this is not the current node then it is a cpuless
+ * node and timeouts will not happen there.
+ */
+ if (get_compact_nodeid() == cnode) {
+ LOCAL_HUB_S(PI_RT_EN_A, 1);
+ LOCAL_HUB_S(PI_RT_EN_B, 1);
+ LOCAL_HUB_S(PI_PROF_EN_A, 0);
+ LOCAL_HUB_S(PI_PROF_EN_B, 0);
+ ct_cur = CYCLES_PER_JIFFY;
+ LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur);
+ LOCAL_HUB_S(PI_RT_COUNT, 0);
+ LOCAL_HUB_S(PI_RT_PEND_A, 0);
+ LOCAL_HUB_S(PI_RT_COMPARE_B, ct_cur);
+ LOCAL_HUB_S(PI_RT_COUNT, 0);
+ LOCAL_HUB_S(PI_RT_PEND_B, 0);
+ }
+}
-# $Id: Makefile,v 1.2 1999/12/04 03:59:01 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/18 21:46:53 ralf Exp $
#
# Makefile for MIPS kernel build tools.
#
offset("#define TASK_COUNTER ", struct task_struct, counter);
offset("#define TASK_PRIORITY ", struct task_struct, priority);
offset("#define TASK_MM ", struct task_struct, mm);
+ offset("#define TASK_PROCESSOR ", struct task_struct, processor);
size("#define TASK_STRUCT_SIZE ", struct task_struct);
linefeed;
}
0, 0, 0 /* FPGA */ },
{ PCI_VENDOR_ID_EF, PCI_DEVICE_ID_EF_ATM_ASIC, PCI_ANY_ID, PCI_ANY_ID,
0, 0, 1 /* ASIC */ },
- { 0 }
+ { 0, }
};
MODULE_DEVICE_TABLE(pci,eni_pci_tbl);
*/
-#define DAC960_DriverVersion "2.3.4"
-#define DAC960_DriverDate "23 September 1999"
+#define DAC960_DriverVersion "2.3.5"
+#define DAC960_DriverDate "23 January 2000"
+
#include <linux/version.h>
DAC960_Announce("***** DAC960 RAID Driver Version "
DAC960_DriverVersion " of "
DAC960_DriverDate " *****\n", Controller);
- DAC960_Announce("Copyright 1998-1999 by Leonard N. Zubkoff "
+ DAC960_Announce("Copyright 1998-2000 by Leonard N. Zubkoff "
"<lnz@dandelion.com>\n", Controller);
}
}
+/*
+ DAC960_WaitForCommand waits for a wake_up on Controller's Command Wait Queue.
+*/
+
+static void DAC960_WaitForCommand(DAC960_Controller_T *Controller)
+{
+ DECLARE_WAITQUEUE(WaitQueueEntry, current);
+ add_wait_queue(&Controller->CommandWaitQueue, &WaitQueueEntry);
+ current->state = TASK_UNINTERRUPTIBLE;
+ spin_unlock(&io_request_lock);
+ schedule();
+ current->state = TASK_RUNNING;
+ remove_wait_queue(&Controller->CommandWaitQueue, &WaitQueueEntry);
+ spin_lock_irq(&io_request_lock);
+}
+
+
/*
DAC960_QueueCommand queues Command.
*/
}
+/*
+ DAC960_ReportErrorStatus reports Controller BIOS Messages passed through
+ the Error Status Register when the driver performs the BIOS handshaking.
+ It returns true for fatal errors and false otherwise.
+*/
+
+static boolean DAC960_ReportErrorStatus(DAC960_Controller_T *Controller,
+ unsigned char ErrorStatus,
+ unsigned char Parameter0,
+ unsigned char Parameter1)
+{
+ switch (ErrorStatus)
+ {
+ case 0x00:
+ DAC960_Notice("Physical Drive %d:%d Not Responding\n",
+ Controller, Parameter1, Parameter0);
+ break;
+ case 0x08:
+ if (Controller->DriveSpinUpMessageDisplayed) break;
+ DAC960_Notice("Spinning Up Drives\n", Controller);
+ Controller->DriveSpinUpMessageDisplayed = true;
+ break;
+ case 0x30:
+ DAC960_Notice("Configuration Checksum Error\n", Controller);
+ break;
+ case 0x60:
+ DAC960_Notice("Mirror Race Recovery Failed\n", Controller);
+ break;
+ case 0x70:
+ DAC960_Notice("Mirror Race Recovery In Progress\n", Controller);
+ break;
+ case 0x90:
+ DAC960_Notice("Physical Drive %d:%d COD Mismatch\n",
+ Controller, Parameter1, Parameter0);
+ break;
+ case 0xA0:
+ DAC960_Notice("Logical Drive Installation Aborted\n", Controller);
+ break;
+ case 0xB0:
+ DAC960_Notice("Mirror Race On A Critical Logical Drive\n", Controller);
+ break;
+ case 0xD0:
+ DAC960_Notice("New Controller Configuration Found\n", Controller);
+ break;
+ case 0xF0:
+ DAC960_Error("Fatal Memory Parity Error for Controller at\n", Controller);
+ return true;
+ default:
+ DAC960_Error("Unknown Initialization Error %02X for Controller at\n",
+ Controller, ErrorStatus);
+ return true;
+ }
+ return false;
+}
+
+
/*
DAC960_EnableMemoryMailboxInterface enables the Memory Mailbox Interface.
*/
case DAC960_V5_Controller:
while (--TimeoutCounter >= 0)
{
- if (DAC960_V5_HardwareMailboxEmptyP(ControllerBaseAddress))
+ if (!DAC960_V5_HardwareMailboxFullP(ControllerBaseAddress))
break;
udelay(10);
}
unsigned long BaseAddress1 = pci_resource_start (PCI_Device, 1);
unsigned short SubsystemVendorID, SubsystemDeviceID;
int CommandIdentifier;
+ unsigned char ErrorStatus, Parameter0, Parameter1;
+ void *BaseAddress;
+
if (pci_enable_device(PCI_Device))
goto Ignore;
Controller->Device = Device;
Controller->Function = Function;
sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber);
- /*
- Acquire shared access to the IRQ Channel.
- */
- if (IRQ_Channel == 0)
- {
- DAC960_Error("IRQ Channel %d illegal for Controller at\n",
- Controller, IRQ_Channel);
- goto Failure;
- }
- strcpy(Controller->FullModelName, "DAC960");
- if (request_irq(IRQ_Channel, DAC960_InterruptHandler,
- SA_SHIRQ, Controller->FullModelName, Controller) < 0)
- {
- DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n",
- Controller, IRQ_Channel);
- goto Failure;
- }
- Controller->IRQ_Channel = IRQ_Channel;
/*
Map the Controller Register Window.
*/
"Controller at\n", Controller);
goto Failure;
}
+ BaseAddress = Controller->BaseAddress;
switch (ControllerType)
{
case DAC960_V5_Controller:
- DAC960_V5_DisableInterrupts(Controller->BaseAddress);
+ DAC960_V5_DisableInterrupts(BaseAddress);
+ DAC960_V5_AcknowledgeHardwareMailboxStatus(BaseAddress);
+ udelay(1000);
+ while (DAC960_V5_InitializationInProgressP(BaseAddress))
+ {
+ if (DAC960_V5_ReadErrorStatus(BaseAddress, &ErrorStatus,
+ &Parameter0, &Parameter1) &&
+ DAC960_ReportErrorStatus(Controller, ErrorStatus,
+ Parameter0, Parameter1))
+ goto Failure;
+ udelay(10);
+ }
if (!DAC960_EnableMemoryMailboxInterface(Controller))
{
DAC960_Error("Unable to Enable Memory Mailbox Interface "
"for Controller at\n", Controller);
goto Failure;
}
- DAC960_V5_EnableInterrupts(Controller->BaseAddress);
+ DAC960_V5_EnableInterrupts(BaseAddress);
break;
case DAC960_V4_Controller:
- DAC960_V4_DisableInterrupts(Controller->BaseAddress);
+ DAC960_V4_DisableInterrupts(BaseAddress);
+ DAC960_V4_AcknowledgeHardwareMailboxStatus(BaseAddress);
+ udelay(1000);
+ while (DAC960_V4_InitializationInProgressP(BaseAddress))
+ {
+ if (DAC960_V4_ReadErrorStatus(BaseAddress, &ErrorStatus,
+ &Parameter0, &Parameter1) &&
+ DAC960_ReportErrorStatus(Controller, ErrorStatus,
+ Parameter0, Parameter1))
+ goto Failure;
+ udelay(10);
+ }
if (!DAC960_EnableMemoryMailboxInterface(Controller))
{
DAC960_Error("Unable to Enable Memory Mailbox Interface "
"for Controller at\n", Controller);
goto Failure;
}
- DAC960_V4_EnableInterrupts(Controller->BaseAddress);
+ DAC960_V4_EnableInterrupts(BaseAddress);
break;
case DAC960_V3_Controller:
request_region(Controller->IO_Address, 0x80,
Controller->FullModelName);
- DAC960_V3_EnableInterrupts(Controller->BaseAddress);
+ DAC960_V3_DisableInterrupts(BaseAddress);
+ DAC960_V3_AcknowledgeStatus(BaseAddress);
+ udelay(1000);
+ while (DAC960_V3_InitializationInProgressP(BaseAddress))
+ {
+ if (DAC960_V3_ReadErrorStatus(BaseAddress, &ErrorStatus,
+ &Parameter0, &Parameter1) &&
+ DAC960_ReportErrorStatus(Controller, ErrorStatus,
+ Parameter0, Parameter1))
+ goto Failure;
+ udelay(10);
+ }
+ DAC960_V3_EnableInterrupts(BaseAddress);
break;
}
+ /*
+ Acquire shared access to the IRQ Channel.
+ */
+ if (IRQ_Channel == 0)
+ {
+ DAC960_Error("IRQ Channel %d illegal for Controller at\n",
+ Controller, IRQ_Channel);
+ goto Failure;
+ }
+ strcpy(Controller->FullModelName, "DAC960");
+ if (request_irq(IRQ_Channel, DAC960_InterruptHandler,
+ SA_SHIRQ, Controller->FullModelName, Controller) < 0)
+ {
+ DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n",
+ Controller, IRQ_Channel);
+ goto Failure;
+ }
+ Controller->IRQ_Channel = IRQ_Channel;
DAC960_ActiveControllerCount++;
for (CommandIdentifier = 0;
CommandIdentifier < DAC960_MaxChannels;
"0x%X PCI Address 0x%X\n", Controller,
Bus, Device, Function, IO_Address, PCI_Address);
if (Controller == NULL) break;
- if (Controller->IRQ_Channel > 0)
- free_irq(IRQ_Channel, Controller);
if (Controller->MemoryMappedAddress != NULL)
iounmap(Controller->MemoryMappedAddress);
DAC960_Controllers[Controller->ControllerNumber] = NULL;
+ if (Controller->IRQ_Channel > 0)
+ free_irq(IRQ_Channel, Controller);
Ignore:
kfree(Controller);
}
Command = DAC960_AllocateCommand(Controller);
if (Command != NULL) break;
if (!WaitForCommand) return false;
- spin_unlock(&io_request_lock);
- sleep_on(&Controller->CommandWaitQueue);
- spin_lock_irq(&io_request_lock);
+ DAC960_WaitForCommand(Controller);
}
DAC960_ClearCommand(Command);
if (Request->cmd == READ)
}
else if (NewEnquiry->RebuildFlag == DAC960_BackgroundCheckInProgress)
Controller->NeedConsistencyCheckProgress = true;
+ if (CommandType != DAC960_MonitoringCommand &&
+ Controller->RebuildFlagPending)
+ {
+ DAC960_Enquiry_T *Enquiry = (DAC960_Enquiry_T *)
+ Bus_to_Virtual(Command->CommandMailbox.Type3.BusAddress);
+ Enquiry->RebuildFlag = Controller->PendingRebuildFlag;
+ Controller->RebuildFlagPending = false;
+ }
+ else if (CommandType == DAC960_MonitoringCommand &&
+ NewEnquiry->RebuildFlag > DAC960_BackgroundCheckInProgress)
+ {
+ Controller->PendingRebuildFlag = NewEnquiry->RebuildFlag;
+ Controller->RebuildFlagPending = true;
+ }
}
else if (CommandOpcode == DAC960_PerformEventLogOperation)
{
Controller->RebuildProgress.LogicalDriveSize;
unsigned int BlocksCompleted =
LogicalDriveSize - Controller->RebuildProgress.RemainingBlocks;
+ if (CommandStatus == DAC960_NoRebuildOrCheckInProgress &&
+ Controller->LastRebuildStatus == DAC960_NormalCompletion)
+ CommandStatus = DAC960_RebuildSuccessful;
switch (CommandStatus)
{
case DAC960_NormalCompletion:
"Failure of Drive Being Rebuilt\n", Controller);
break;
case DAC960_NoRebuildOrCheckInProgress:
- if (Controller->LastRebuildStatus != DAC960_NormalCompletion)
- break;
+ break;
case DAC960_RebuildSuccessful:
DAC960_Progress("Rebuild Completed Successfully\n", Controller);
break;
+ case DAC960_RebuildSuccessfullyTerminated:
+ DAC960_Progress("Rebuild Successfully Terminated\n", Controller);
+ break;
}
Controller->LastRebuildStatus = CommandStatus;
+ if (CommandType != DAC960_MonitoringCommand &&
+ Controller->RebuildStatusPending)
+ {
+ Command->CommandStatus = Controller->PendingRebuildStatus;
+ Controller->RebuildStatusPending = false;
+ }
+ else if (CommandType == DAC960_MonitoringCommand &&
+ CommandStatus != DAC960_NormalCompletion &&
+ CommandStatus != DAC960_NoRebuildOrCheckInProgress)
+ {
+ Controller->PendingRebuildStatus = CommandStatus;
+ Controller->RebuildStatusPending = true;
+ }
}
else if (CommandOpcode == DAC960_RebuildStat)
{
if (CommandType == DAC960_QueuedCommand)
{
DAC960_KernelCommand_T *KernelCommand = Command->KernelCommand;
- KernelCommand->CommandStatus = CommandStatus;
+ KernelCommand->CommandStatus = Command->CommandStatus;
Command->KernelCommand = NULL;
if (CommandOpcode == DAC960_DCDB)
Controller->DirectCommandActive[KernelCommand->DCDB->Channel]
return;
}
/*
- Deallocate the Command, and wake up any processes waiting on a free Command.
+ Deallocate the Command.
*/
DAC960_DeallocateCommand(Command);
+ /*
+ Wake up any processes waiting on a free Command.
+ */
wake_up(&Controller->CommandWaitQueue);
}
}
if (CommandOpcode == DAC960_DCDB)
{
- while (true)
- {
- DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
- if (!Controller->DirectCommandActive[DCDB.Channel]
- [DCDB.TargetID])
- Command = DAC960_AllocateCommand(Controller);
- if (Command != NULL)
- Controller->DirectCommandActive[DCDB.Channel]
- [DCDB.TargetID] = true;
- DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
- if (Command != NULL) break;
- sleep_on(&Controller->CommandWaitQueue);
- }
+ DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
+ while (Controller->DirectCommandActive[DCDB.Channel]
+ [DCDB.TargetID] ||
+ (Command = DAC960_AllocateCommand(Controller)) == NULL)
+ DAC960_WaitForCommand(Controller);
+ Controller->DirectCommandActive[DCDB.Channel]
+ [DCDB.TargetID] = true;
+ DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
DAC960_ClearCommand(Command);
Command->CommandType = DAC960_ImmediateCommand;
memcpy(&Command->CommandMailbox, &UserCommand.CommandMailbox,
}
else
{
- while (true)
- {
- DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
- Command = DAC960_AllocateCommand(Controller);
- DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
- if (Command != NULL) break;
- sleep_on(&Controller->CommandWaitQueue);
- }
+ DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
+ while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
+ DAC960_WaitForCommand(Controller);
+ DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
DAC960_ClearCommand(Command);
Command->CommandType = DAC960_ImmediateCommand;
memcpy(&Command->CommandMailbox, &UserCommand.CommandMailbox,
DAC960_CommandMailbox_T *CommandMailbox;
ProcessorFlags_T ProcessorFlags;
unsigned char Channel, TargetID, LogicalDriveNumber;
- while (true)
- {
- DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
- Command = DAC960_AllocateCommand(Controller);
- DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
- if (Command != NULL) break;
- sleep_on(&Controller->CommandWaitQueue);
- }
+ DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
+ while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
+ DAC960_WaitForCommand(Controller);
+ DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
Controller->UserStatusLength = 0;
DAC960_ClearCommand(Command);
Command->CommandType = DAC960_ImmediateCommand;
/*
- Define a 32 bit I/O Address data type.
+ Define a 32/64 bit I/O Address data type.
*/
-typedef unsigned int DAC960_IO_Address_T;
+typedef unsigned long DAC960_IO_Address_T;
/*
- Define a 32 bit PCI Bus Address data type.
+ Define a 32/64 bit PCI Bus Address data type.
*/
-typedef unsigned int DAC960_PCI_Address_T;
+typedef unsigned long DAC960_PCI_Address_T;
/*
#define DAC960_RebuildFailed_BadBlocksOnOther 0x0003 /* Consistency */
#define DAC960_RebuildFailed_NewDriveFailed 0x0004 /* Consistency */
#define DAC960_RebuildSuccessful 0x0100 /* Consistency */
+#define DAC960_RebuildSuccessfullyTerminated 0x0107 /* Consistency */
#define DAC960_AddCapacityInProgress 0x0004 /* Consistency */
#define DAC960_AddCapacityFailedOrSuspended 0x00F4 /* Consistency */
#define DAC960_Config2ChecksumError 0x0002 /* Configuration */
unsigned char SynchronousMultiplier; /* Byte 4 */
unsigned char SynchronousOffset:5; /* Byte 5 Bits 0-4 */
unsigned char :3; /* Byte 5 Bits 5-7 */
- unsigned long DiskSize __attribute__ ((packed)); /* Bytes 6-9 */
+ unsigned int DiskSize __attribute__ ((packed)); /* Bytes 6-9 */
}
DAC960_DeviceState_T;
unsigned char LogicalDriveCount;
unsigned char GeometryTranslationHeads;
unsigned char GeometryTranslationSectors;
+ unsigned char PendingRebuildFlag;
unsigned short ControllerQueueDepth;
unsigned short DriverQueueDepth;
unsigned short MaxBlocksPerCommand;
boolean NeedRebuildProgress;
boolean NeedConsistencyCheckProgress;
boolean EphemeralProgressMessage;
+ boolean RebuildFlagPending;
+ boolean RebuildStatusPending;
+ boolean DriveSpinUpMessageDisplayed;
Timer_T MonitoringTimer;
GenericDiskInfo_T GenericDiskInfo;
DAC960_Command_T *FreeCommands;
DAC960_EventLogEntry_T EventLogEntry;
DAC960_RebuildProgress_T RebuildProgress;
DAC960_CommandStatus_T LastRebuildStatus;
+ DAC960_CommandStatus_T PendingRebuildStatus;
DAC960_LogicalDriveInformation_T
LogicalDriveInformation[2][DAC960_MaxLogicalDrives];
DAC960_LogicalDriveState_T LogicalDriveInitialState[DAC960_MaxLogicalDrives];
DAC960_V5_MailboxRegister11Offset = 0x5B,
DAC960_V5_MailboxRegister12Offset = 0x5C,
DAC960_V5_StatusCommandIdentifierRegOffset = 0x5D,
- DAC960_V5_StatusRegisterOffset = 0x5E
+ DAC960_V5_StatusRegisterOffset = 0x5E,
+ DAC960_V5_ErrorStatusRegisterOffset = 0x63
}
DAC960_V5_RegisterOffsets_T;
} Write;
struct {
boolean HardwareMailboxEmpty:1; /* Bit 0 */
- unsigned char :7; /* Bits 1-7 */
+ boolean InitializationNotInProgress:1; /* Bit 1 */
+ unsigned char :6; /* Bits 2-7 */
} Read;
}
DAC960_V5_InboundDoorBellRegister_T;
DAC960_V5_InterruptMaskRegister_T;
+/*
+ Define the structure of the DAC960 V5 Error Status Register.
+*/
+
+typedef union DAC960_V5_ErrorStatusRegister
+{
+ unsigned char All;
+ struct {
+ unsigned int :2; /* Bits 0-1 */
+ boolean ErrorStatusPending:1; /* Bit 2 */
+ unsigned int :5; /* Bits 3-7 */
+ } Bits;
+}
+DAC960_V5_ErrorStatusRegister_T;
+
+
/*
Define inline functions to provide an abstraction for reading and writing the
DAC960 V5 Controller Interface Registers.
}
static inline
-boolean DAC960_V5_HardwareMailboxEmptyP(void *ControllerBaseAddress)
+boolean DAC960_V5_HardwareMailboxFullP(void *ControllerBaseAddress)
+{
+ DAC960_V5_InboundDoorBellRegister_T InboundDoorBellRegister;
+ InboundDoorBellRegister.All =
+ readb(ControllerBaseAddress + DAC960_V5_InboundDoorBellRegisterOffset);
+ return !InboundDoorBellRegister.Read.HardwareMailboxEmpty;
+}
+
+static inline
+boolean DAC960_V5_InitializationInProgressP(void *ControllerBaseAddress)
{
DAC960_V5_InboundDoorBellRegister_T InboundDoorBellRegister;
InboundDoorBellRegister.All =
readb(ControllerBaseAddress + DAC960_V5_InboundDoorBellRegisterOffset);
- return InboundDoorBellRegister.Read.HardwareMailboxEmpty;
+ return !InboundDoorBellRegister.Read.InitializationNotInProgress;
}
static inline
void DAC960_V5_EnableInterrupts(void *ControllerBaseAddress)
{
DAC960_V5_InterruptMaskRegister_T InterruptMaskRegister;
- InterruptMaskRegister.All = 0;
+ InterruptMaskRegister.All = 0xFF;
InterruptMaskRegister.Bits.DisableInterrupts = false;
writeb(InterruptMaskRegister.All,
ControllerBaseAddress + DAC960_V5_InterruptMaskRegisterOffset);
void DAC960_V5_DisableInterrupts(void *ControllerBaseAddress)
{
DAC960_V5_InterruptMaskRegister_T InterruptMaskRegister;
- InterruptMaskRegister.All = 0;
+ InterruptMaskRegister.All = 0xFF;
InterruptMaskRegister.Bits.DisableInterrupts = true;
writeb(InterruptMaskRegister.All,
ControllerBaseAddress + DAC960_V5_InterruptMaskRegisterOffset);
NextCommandMailbox->Words[1] = CommandMailbox->Words[1];
NextCommandMailbox->Words[2] = CommandMailbox->Words[2];
NextCommandMailbox->Words[3] = CommandMailbox->Words[3];
+ wmb();
NextCommandMailbox->Words[0] = CommandMailbox->Words[0];
+ mb();
}
static inline
return readw(ControllerBaseAddress + DAC960_V5_StatusRegisterOffset);
}
+static inline boolean
+DAC960_V5_ReadErrorStatus(void *ControllerBaseAddress,
+ unsigned char *ErrorStatus,
+ unsigned char *Parameter0,
+ unsigned char *Parameter1)
+{
+ DAC960_V5_ErrorStatusRegister_T ErrorStatusRegister;
+ ErrorStatusRegister.All =
+ readb(ControllerBaseAddress + DAC960_V5_ErrorStatusRegisterOffset);
+ if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false;
+ ErrorStatusRegister.Bits.ErrorStatusPending = false;
+ *ErrorStatus = ErrorStatusRegister.All;
+ *Parameter0 =
+ readb(ControllerBaseAddress + DAC960_V5_CommandOpcodeRegisterOffset);
+ *Parameter1 =
+ readb(ControllerBaseAddress + DAC960_V5_CommandIdentifierRegisterOffset);
+ writeb(0xFF, ControllerBaseAddress + DAC960_V5_ErrorStatusRegisterOffset);
+ return true;
+}
+
static inline
void DAC960_V5_SaveMemoryMailboxInfo(DAC960_Controller_T *Controller)
{
DAC960_V4_MailboxRegister11Offset = 0x100B,
DAC960_V4_MailboxRegister12Offset = 0x100C,
DAC960_V4_StatusCommandIdentifierRegOffset = 0x1018,
- DAC960_V4_StatusRegisterOffset = 0x101A
+ DAC960_V4_StatusRegisterOffset = 0x101A,
+ DAC960_V4_ErrorStatusRegisterOffset = 0x103F
}
DAC960_V4_RegisterOffsets_T;
} Write;
struct {
boolean HardwareMailboxFull:1; /* Bit 0 */
- unsigned int :31; /* Bits 1-31 */
+ boolean InitializationInProgress:1; /* Bit 1 */
+ unsigned int :30; /* Bits 2-31 */
} Read;
}
DAC960_V4_InboundDoorBellRegister_T;
DAC960_V4_InterruptMaskRegister_T;
+/*
+ Define the structure of the DAC960 V4 Error Status Register.
+*/
+
+typedef union DAC960_V4_ErrorStatusRegister
+{
+ unsigned char All;
+ struct {
+ unsigned int :2; /* Bits 0-1 */
+ boolean ErrorStatusPending:1; /* Bit 2 */
+ unsigned int :5; /* Bits 3-7 */
+ } Bits;
+}
+DAC960_V4_ErrorStatusRegister_T;
+
+
/*
Define inline functions to provide an abstraction for reading and writing the
DAC960 V4 Controller Interface Registers.
return InboundDoorBellRegister.Read.HardwareMailboxFull;
}
+static inline
+boolean DAC960_V4_InitializationInProgressP(void *ControllerBaseAddress)
+{
+ DAC960_V4_InboundDoorBellRegister_T InboundDoorBellRegister;
+ InboundDoorBellRegister.All =
+ readl(ControllerBaseAddress + DAC960_V4_InboundDoorBellRegisterOffset);
+ return InboundDoorBellRegister.Read.InitializationInProgress;
+}
+
static inline
void DAC960_V4_AcknowledgeHardwareMailboxInterrupt(void *ControllerBaseAddress)
{
NextCommandMailbox->Words[1] = CommandMailbox->Words[1];
NextCommandMailbox->Words[2] = CommandMailbox->Words[2];
NextCommandMailbox->Words[3] = CommandMailbox->Words[3];
+ wmb();
NextCommandMailbox->Words[0] = CommandMailbox->Words[0];
+ mb();
}
static inline
return readw(ControllerBaseAddress + DAC960_V4_StatusRegisterOffset);
}
+static inline boolean
+DAC960_V4_ReadErrorStatus(void *ControllerBaseAddress,
+ unsigned char *ErrorStatus,
+ unsigned char *Parameter0,
+ unsigned char *Parameter1)
+{
+ DAC960_V4_ErrorStatusRegister_T ErrorStatusRegister;
+ ErrorStatusRegister.All =
+ readb(ControllerBaseAddress + DAC960_V4_ErrorStatusRegisterOffset);
+ if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false;
+ ErrorStatusRegister.Bits.ErrorStatusPending = false;
+ *ErrorStatus = ErrorStatusRegister.All;
+ *Parameter0 =
+ readb(ControllerBaseAddress + DAC960_V4_CommandOpcodeRegisterOffset);
+ *Parameter1 =
+ readb(ControllerBaseAddress + DAC960_V4_CommandIdentifierRegisterOffset);
+ writeb(0, ControllerBaseAddress + DAC960_V4_ErrorStatusRegisterOffset);
+ return true;
+}
+
static inline
void DAC960_V4_SaveMemoryMailboxInfo(DAC960_Controller_T *Controller)
{
void *ControllerBaseAddress = Controller->BaseAddress;
- writel(0xAABBFFFF,
+ writel(0x743C485E,
ControllerBaseAddress + DAC960_V4_CommandOpcodeRegisterOffset);
writel((unsigned long) Controller->FirstCommandMailbox,
ControllerBaseAddress + DAC960_V4_MailboxRegister4Offset);
{
void *ControllerBaseAddress = Controller->BaseAddress;
if (readl(ControllerBaseAddress
- + DAC960_V4_CommandOpcodeRegisterOffset) != 0xAABBFFFF)
+ + DAC960_V4_CommandOpcodeRegisterOffset) != 0x743C485E)
return;
*MemoryMailboxAddress =
(void *) readl(ControllerBaseAddress + DAC960_V4_MailboxRegister4Offset);
DAC960_V3_MailboxRegister12Offset = 0x0C,
DAC960_V3_StatusCommandIdentifierRegOffset = 0x0D,
DAC960_V3_StatusRegisterOffset = 0x0E,
+ DAC960_V3_ErrorStatusRegisterOffset = 0x3F,
DAC960_V3_InboundDoorBellRegisterOffset = 0x40,
DAC960_V3_OutboundDoorBellRegisterOffset = 0x41,
DAC960_V3_InterruptEnableRegisterOffset = 0x43
} Write;
struct {
boolean MailboxFull:1; /* Bit 0 */
- unsigned char :7; /* Bits 1-7 */
+ boolean InitializationInProgress:1; /* Bit 1 */
+ unsigned char :6; /* Bits 2-7 */
} Read;
}
DAC960_V3_InboundDoorBellRegister_T;
DAC960_V3_InterruptEnableRegister_T;
+/*
+ Define the structure of the DAC960 V3 Error Status Register.
+*/
+
+typedef union DAC960_V3_ErrorStatusRegister
+{
+ unsigned char All;
+ struct {
+ unsigned int :2; /* Bits 0-1 */
+ boolean ErrorStatusPending:1; /* Bit 2 */
+ unsigned int :5; /* Bits 3-7 */
+ } Bits;
+}
+DAC960_V3_ErrorStatusRegister_T;
+
+
/*
Define inline functions to provide an abstraction for reading and writing the
DAC960 V3 Controller Interface Registers.
return InboundDoorBellRegister.Read.MailboxFull;
}
+static inline
+boolean DAC960_V3_InitializationInProgressP(void *ControllerBaseAddress)
+{
+ DAC960_V3_InboundDoorBellRegister_T InboundDoorBellRegister;
+ InboundDoorBellRegister.All =
+ readb(ControllerBaseAddress + DAC960_V3_InboundDoorBellRegisterOffset);
+ return InboundDoorBellRegister.Read.InitializationInProgress;
+}
+
static inline
void DAC960_V3_AcknowledgeInterrupt(void *ControllerBaseAddress)
{
return readw(ControllerBaseAddress + DAC960_V3_StatusRegisterOffset);
}
+static inline boolean
+DAC960_V3_ReadErrorStatus(void *ControllerBaseAddress,
+ unsigned char *ErrorStatus,
+ unsigned char *Parameter0,
+ unsigned char *Parameter1)
+{
+ DAC960_V3_ErrorStatusRegister_T ErrorStatusRegister;
+ ErrorStatusRegister.All =
+ readb(ControllerBaseAddress + DAC960_V3_ErrorStatusRegisterOffset);
+ if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false;
+ ErrorStatusRegister.Bits.ErrorStatusPending = false;
+ *ErrorStatus = ErrorStatusRegister.All;
+ *Parameter0 =
+ readb(ControllerBaseAddress + DAC960_V3_CommandOpcodeRegisterOffset);
+ *Parameter1 =
+ readb(ControllerBaseAddress + DAC960_V3_CommandIdentifierRegisterOffset);
+ writeb(0, ControllerBaseAddress + DAC960_V3_ErrorStatusRegisterOffset);
+ return true;
+}
+
/*
Define compatibility macros between Linux 2.0 and Linux 2.1.
}
-static struct pci_device_id epca_pci_tbl[] __initdata = {
+static struct pci_device_id epca_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_DIGI, PCI_DEVICE_XR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xr },
{ PCI_VENDOR_DIGI, PCI_DEVICE_XEM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xem },
{ PCI_VENDOR_DIGI, PCI_DEVICE_CX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_cx },
{ PCI_VENDOR_DIGI, PCI_DEVICE_XRJ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xrj },
- { 0, }, /* terminate list */
+ { 0, }
};
+MODULE_DEVICE_TABLE(pci, epca_pci_tbl);
int __init init_PCI (void)
{ /* Begin init_PCI */
{ 0x10B7, 0x6560, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3CCFE656 },
{ 0x10B7, 0x6562, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3CCFEM656 },
{ 0x10B7, 0x4500, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C450 },
- {0,}, /* 0 terminated list. */
+ {0,} /* 0 terminated list. */
};
MODULE_DEVICE_TABLE(pci, vortex_pci_tbl);
/* {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MPX5030 },*/
{0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 },
{0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 },
- {0,},
+ {0,}
};
MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl);
dep_tristate ' PPP support for async serial ports' CONFIG_PPP_ASYNC $CONFIG_PPP
dep_tristate ' PPP support for sync tty ports' CONFIG_PPP_SYNC_TTY $CONFIG_PPP
dep_tristate ' PPP Deflate compression' CONFIG_PPP_DEFLATE $CONFIG_PPP
- dep_tristate ' PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP
+ dep_tristate ' PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP $CONFIG_PPP
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_tristate ' PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP
fi
s = get_options(s, 8, ints);
if (!ints[0])
return 1;
- dev = alloc_bootmem(sizeof(struct net_device) + 10);
- memset(dev, 0, sizeof(struct net_device) + 10);
- dev->name = (char *) (dev + 1);
+ dev = alloc_bootmem(sizeof(struct net_device));
+ memset(dev, 0, sizeof(struct net_device));
dev->init = arcrimi_probe;
switch (ints[0]) {
s = get_options(s, 8, ints);
if (!ints[0])
return 1;
- dev = alloc_bootmem(sizeof(struct net_device) + sizeof(struct arcnet_local) + 10);
- memset(dev, 0, sizeof(struct net_device) + sizeof(struct arcnet_local) + 10);
+ dev = alloc_bootmem(sizeof(struct net_device) + sizeof(struct arcnet_local));
+ memset(dev, 0, sizeof(struct net_device) + sizeof(struct arcnet_local));
lp = dev->priv = (struct arcnet_local *) (dev + 1);
- dev->name = (char *) (lp + 1);
dev->init = com20020isa_probe;
switch (ints[0]) {
{0,}
};
-static struct pci_driver com20020pci_driver __devinitdata = {
+MODULE_DEVICE_TABLE(pci, com20020pci_id_table);
+
+static struct pci_driver com20020pci_driver = {
name: "com20020",
id_table: com20020pci_id_table,
probe: com20020pci_probe,
s = get_options(s, 4, ints);
if (!ints[0])
return 0;
- dev = alloc_bootmem(sizeof(struct net_device) + 10);
- memset(dev, 0, sizeof(struct net_device) + 10);
- dev->name = (char *) (dev + 1);
+ dev = alloc_bootmem(sizeof(struct net_device));
+ memset(dev, 0, sizeof(struct net_device));
dev->init = com90io_probe;
switch (ints[0]) {
printk("com90xx: Disabled.\n");
return 1;
}
- dev = alloc_bootmem(sizeof(struct net_device) + 10);
- memset(dev, 0, sizeof(struct net_device) + 10);
- dev->name = (char *) (dev + 1);
+ dev = alloc_bootmem(sizeof(struct net_device));
+ memset(dev, 0, sizeof(struct net_device));
dev->init = com90xx_probe;
switch (ints[0]) {
-/* $Id: bagetlance.c,v 1.2 1999/10/09 00:01:21 ralf Exp $
+/* $Id$
* vmelance.c: Ethernet driver for VME Lance cards on Baget/MIPS
* This code stealed and adopted from linux/drivers/net/atarilance.c
* See that for author info
volatile struct lance_init_block *init_block;
volatile unsigned long *dma_ptr_reg;
+ spinlock_t lock;
+
int rx_new, tx_new;
int rx_old, tx_old;
struct net_device *dev; /* Backpointer */
struct lance_private *next_module;
+ struct timer_list multicast_timer;
/* Pointers to the ring buffers as seen from the CPU */
char *rx_buf_ptr_cpu[RX_RING_SIZE];
}
/* Setup the Lance Rx and Tx rings */
-/* Sets dev->tbusy */
static void lance_init_ring(struct net_device *dev)
{
struct lance_private *lp = (struct lance_private *) dev->priv;
ib = (struct lance_init_block *) (dev->mem_start);
/* Lock out other processes while setting up hardware */
- dev->tbusy = 1;
+ netif_stop_queue(dev);
lp->rx_new = lp->tx_new = 0;
lp->rx_old = lp->tx_old = 0;
- ib->mode = 0;
-
/* Copy the ethernet address to the lance init block.
* XXX bit 0 of the physical address registers has to be zero
*/
if (ZERO)
printk("TX ptr: %8.8x(%8.8x)\n", leptr, libdesc_offset(btx_ring, 0));
- /* Clear the multicast filter */
- ib->filter[0] = 0;
- ib->filter[2] = 0;
- ib->filter[4] = 0;
- ib->filter[6] = 0;
if (ZERO)
printk("TX rings:\n");
return 0;
}
-static int lance_tx(struct net_device *dev)
+static void lance_tx(struct net_device *dev)
{
struct lance_private *lp = (struct lance_private *) dev->priv;
volatile struct lance_init_block *ib;
ib = (struct lance_init_block *) (dev->mem_start);
j = lp->tx_old;
+ spin_lock(&lp->lock);
+
for (i = j; i != lp->tx_new; i = j) {
td = &ib->btx_ring[i];
/* If we hit a packet not owned by us, stop */
lance_init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- return 0;
+ goto out;
}
/* Buffer errors and underflows turn off the
* transmitter, restart the adapter.
lance_init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- return 0;
+ goto out;
}
} else if ((td->tmd1_bits & LE_T1_POK) == LE_T1_POK) {
/*
j = (j + 1) & TX_RING_MOD_MASK;
}
lp->tx_old = j;
- return 0;
+out:
+ if (netif_queue_stopped(dev) &&
+ TX_BUFFS_AVAIL > 0)
+ netif_wake_queue(dev);
+
+ spin_unlock(&lp->lock);
}
static void lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs)
volatile struct lance_regs *ll = lp->ll;
int csr0;
- if (dev->interrupt)
- printk("%s: again\n", dev->name);
-
- dev->interrupt = 1;
-
writereg(&ll->rap, LE_CSR0);
csr0 = ll->rdp;
if (csr0 & LE_C0_TINT)
lance_tx(dev);
- if ((TX_BUFFS_AVAIL >= 0) && dev->tbusy) {
- dev->tbusy = 0;
- mark_bh(NET_BH);
- }
if (csr0 & LE_C0_BABL)
lp->stats.tx_errors++;
lance_init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- dev->tbusy = 0;
+ netif_wake_queue(dev);
}
writereg(&ll->rdp, LE_C0_INEA);
writereg(&ll->rdp, LE_C0_INEA);
- dev->interrupt = 0;
}
struct net_device *last_dev = 0;
static int lance_open(struct net_device *dev)
{
+ volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start);
struct lance_private *lp = (struct lance_private *) dev->priv;
volatile struct lance_regs *ll = lp->ll;
int status = 0;
writereg(&ll->rap, LE_CSR0);
writereg(&ll->rdp, LE_C0_STOP);
+ /* Set mode and clear multicast filter only at device open,
+ * so that lance_init_ring() called at any error will not
+ * forget multicast filters.
+ *
+ * BTW it is common bug in all lance drivers! --ANK
+ */
+ ib->mode = 0;
+ ib->filter [0] = 0;
+ ib->filter [2] = 0;
+
lance_init_ring(dev);
load_csrs(lp);
- dev->tbusy = 0;
- dev->interrupt = 0;
- dev->start = 1;
+ netif_start_queue(dev);
status = init_restart_lance(lp);
struct lance_private *lp = (struct lance_private *) dev->priv;
volatile struct lance_regs *ll = lp->ll;
- dev->start = 0;
- dev->tbusy = 1;
+ netif_stop_queue(dev);
+ del_timer_sync(&lp->multicast_timer);
/* Stop the card */
writereg(&ll->rap, LE_CSR0);
lance_init_ring(dev);
load_csrs(lp);
dev->trans_start = jiffies;
- dev->interrupt = 0;
- dev->start = 1;
- dev->tbusy = 0;
status = init_restart_lance(lp);
-#ifdef DEBUG_DRIVER
- printk("Lance restart=%d\n", status);
-#endif
return status;
}
-static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static void lance_tx_timeout(struct net_device *dev)
{
struct lance_private *lp = (struct lance_private *) dev->priv;
volatile struct lance_regs *ll = lp->ll;
- volatile struct lance_init_block *ib;
- unsigned long flags;
- int entry, skblen, len;
- int status = 0;
- static int outs;
- ib = (struct lance_init_block *) (dev->mem_start);
-
- /* Transmitter timeout, serious problems */
- if (dev->tbusy) {
- int tickssofar = jiffies - dev->trans_start;
- if (tickssofar < 100) {
- status = -1;
- } else {
- printk("%s: transmit timed out, status %04x, reset\n",
+ printk(KERN_ERR "%s: transmit timed out, status %04x, reset\n",
dev->name, ll->rdp);
lance_reset(dev);
- }
- return status;
- }
- /* Block a timer-based transmit from overlapping. */
- if (test_and_set_bit(0, (void *) &dev->tbusy) != 0) {
- printk("Transmitter access conflict.\n");
- return -1;
- }
+ netif_wake_queue(dev);
+}
+
+static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct lance_private *lp = (struct lance_private *) dev->priv;
+ volatile struct lance_regs *ll = lp->ll;
+ volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start);
+ int entry, skblen, len;
+
skblen = skb->len;
- save_and_cli(flags);
- if (!TX_BUFFS_AVAIL) {
- restore_flags(flags);
- return -1;
- }
+
len = (skblen <= ETH_ZLEN) ? ETH_ZLEN : skblen;
lp->stats.tx_bytes += len;
ib->btx_ring[entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN);
lp->tx_new = (lp->tx_new + 1) & TX_RING_MOD_MASK;
- outs++;
+ if (TX_BUFFS_AVAIL <= 0)
+ netif_stop_queue(dev);
+
/* Kick the lance: transmit now */
writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD);
+
+ spin_unlock_irq(&lp->lock);
+
dev->trans_start = jiffies;
dev_kfree_skb(skb);
- if (TX_BUFFS_AVAIL)
- dev->tbusy = 0;
-
- restore_flags(flags);
- return status;
+ return 0;
}
static struct net_device_stats *lance_get_stats(struct net_device *dev)
ib = (struct lance_init_block *) (dev->mem_start);
- while (dev->tbusy)
- schedule();
- set_bit(0, (void *) &dev->tbusy);
- while (lp->tx_old != lp->tx_new)
- schedule();
+ if (!netif_running(dev))
+ return;
+
+ if (lp->tx_old != lp->tx_new) {
+ mod_timer(&lp->multicast_timer, jiffies + 4);
+ netif_wake_queue(dev);
+ return;
+ }
+
+ netif_stop_queue(dev);
writereg(&ll->rap, LE_CSR0);
writereg(&ll->rdp, LE_C0_STOP);
}
load_csrs(lp);
init_restart_lance(lp);
- dev->tbusy = 0;
+ netif_wake_queue(dev);
+}
+
+static void lance_set_multicast_retry(unsigned long _opaque)
+{
+ struct net_device *dev = (struct net_device *) _opaque;
+
+ lance_set_multicast(dev);
}
static int __init dec_lance_init(struct net_device *dev, const int type)
printk(" irq = %d\n", dev->irq);
- /* Fill the dev fields */
-
- dev->open = lance_open;
- dev->stop = lance_close;
- dev->hard_start_xmit = lance_start_xmit;
- dev->get_stats = lance_get_stats;
- dev->set_multicast_list = lance_set_multicast;
- dev->dma = 0;
+ lp->dev = dev;
+ dev->open = &lance_open;
+ dev->stop = &lance_close;
+ dev->hard_start_xmit = &lance_start_xmit;
+ dev->tx_timeout = &lance_tx_timeout;
+ dev->watchdog_timeo = 5*HZ;
+ dev->get_stats = &lance_get_stats;
+ dev->set_multicast_list = &lance_set_multicast;
/* lp->ll is the location of the registers for lance card */
lp->ll = ll;
* specification.
*/
lp->busmaster_regval = 0;
- lp->dev = dev;
+
+ dev->dma = 0;
ether_setup(dev);
-/*
- #ifdef MODULE
+
+ /* We cannot sleep if the chip is busy during a
+ * multicast list update event, because such events
+ * can occur from interrupts (ex. IPv6). So we
+ * use a timer to try again later when necessary. -DaveM
+ */
+ init_timer(&lp->multicast_timer);
+ lp->multicast_timer.data = (unsigned long) dev;
+ lp->multicast_timer.function = &lance_set_multicast_retry;
+
+#ifdef MODULE
dev->ifindex = dev_new_index();
lp->next_module = root_lance_dev;
root_lance_dev = lp;
- #endif
- */
+#endif
return 0;
}
/* Find all the lance cards on the system and initialize them */
-int __init dec_lance_probe(struct net_device *dev)
+static int __init dec_lance_probe(void)
{
+ struct net_device *dev = NULL;
static int called = 0;
+#ifdef MODULE
+ root_lance_dev = NULL;
+#endif
+
#ifdef CONFIG_TC
int slot = -1;
return dec_lance_init(dev, type);
}
-/*
- #ifdef MODULE
-
- int
- init_module(void)
- {
- root_lance_dev = NULL;
- return dec_lance_probe(NULL);
- }
-
- void
- cleanup_module(void)
- {
+static void __exit dec_lance_cleanup(void)
+{
+#ifdef MODULE
struct lance_private *lp;
while (root_lance_dev) {
kfree(root_lance_dev->dev);
root_lance_dev = lp;
}
- }
+#endif /* MODULE */
+}
- #endif -* MODULE */
+module_init(dec_lance_probe);
+module_exit(dec_lance_cleanup);
PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82559ER,
PCI_ANY_ID, PCI_ANY_ID, },
- { 0,},
+ { 0,}
};
MODULE_DEVICE_TABLE(pci, eepro100_pci_tbl);
{ 0x10B8, 0x0005, 0x1092, 0x0AB4, 0, 0, SMSC_83C170_0 },
{ 0x10B8, 0x0005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C170 },
{ 0x10B8, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C175 },
- { 0,},
+ { 0,}
};
MODULE_DEVICE_TABLE (pci, epic_pci_tbl);
int rx_pi; /* RX producer index */
int tx_ci; /* TX consumer index */
int tx_pi; /* TX producer index */
+ spinlock_t ioc3_lock;
};
/* We use this to acquire receive skb's that we can DMA directly into. */
struct sk_buff *skb;
u32 etcir;
+ spin_lock(&ip->ioc3_lock);
etcir = ioc3->etcir;
tx_entry = (etcir >> 7) & 127;
o_entry = ip->tx_ci;
skb = ip->tx_skbs[o_entry];
ip->stats.tx_packets++;
ip->stats.tx_bytes += skb->len;
- dev_kfree_skb(skb);
+ dev_kfree_skb_irq(skb);
ip->tx_skbs[o_entry] = NULL;
o_entry = (o_entry + 1) & 127; /* Next */
tx_entry = (etcir >> 7) & 127;
}
ip->tx_ci = o_entry;
+ spin_unlock(&ip->ioc3_lock);
}
/*
static void ioc3_probe1(struct net_device *dev, struct ioc3 *ioc3)
{
- struct ioc3_private *p;
+ struct ioc3_private *ip;
dev = init_etherdev(dev, 0);
- p = (struct ioc3_private *) kmalloc(sizeof(*p), GFP_KERNEL);
- memset(p, 0, sizeof(*p));
- dev->priv = p;
+
+ /*
+ * This probably needs to be register_netdevice, or call
+ * init_etherdev so that it calls register_netdevice. Quick
+ * hack for now.
+ */
+ netif_device_attach(dev);
+
+ ip = (struct ioc3_private *) kmalloc(sizeof(*ip), GFP_KERNEL);
+ memset(ip, 0, sizeof(*ip));
+ dev->priv = ip;
dev->irq = IOC3_ETH_INT;
- p->regs = ioc3;
+ ip->regs = ioc3;
- ioc3_eth_init(dev, p, ioc3);
- ioc3_ssram_disc(p);
+ ioc3_eth_init(dev, ip, ioc3);
+ ioc3_ssram_disc(ip);
ioc3_get_eaddr(dev, ioc3);
- ioc3_init_rings(dev, p, ioc3);
+ ioc3_init_rings(dev, ip, ioc3);
+
+ spin_lock_init(&ip->ioc3_lock);
/* Misc registers */
ioc3->erbar = 0;
return 1;
}
+ spin_lock_irq(&ip->ioc3_lock);
data = (unsigned long) skb->data;
len = skb->len;
}
desc->cmd = len | ETXD_INTWHENDONE | ETXD_D0V;
desc->bufcnt = len;
- } if ((data ^ (data + len)) & 0x4000) {
+ } else if ((data ^ (data + len)) & 0x4000) {
unsigned long b2, s1, s2;
b2 = (data | 0x3fffUL) + 1UL;
if (TX_BUFFS_AVAIL(ip))
netif_wake_queue(dev);
+ spin_unlock_irq(&ip->ioc3_lock);
return 0;
}
{ 0x1050, 0x5a5a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Winbond_W89C940F },
{ 0x12c3, 0x0058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80232 },
{ 0x12c3, 0x5598, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80229 },
- { 0, },
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, ne2k_pci_tbl);
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_PCNETHOME, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, 0x1014, 0x2000, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0 },
+ { 0, }
};
+MODULE_DEVICE_TABLE (pci, pcnet32_pci_tbl);
+
static u16 pcnet32_wio_read_csr (unsigned long addr, int index)
{
outw (index, addr+PCNET32_WIO_RAP);
-/* $Id: sgiseeq.c,v 1.9 1998/10/14 23:40:46 ralf Exp $
+/* $Id: sgiseeq.c,v 1.17 2000/03/27 23:02:57 ralf Exp $
*
* sgiseeq.c: Seeq8003 ethernet driver for SGI machines.
*
char *ep;
if (initialized) /* Already initialized? */
- return 0;
+ return 1;
initialized++;
- /* First get the ethernet address of the onboard
- * interface from ARCS.
+ /* First get the ethernet address of the onboard interface from ARCS.
* This is fragile; PROM doesn't like running from cache.
- * On MIPS64 it crashes for some other, yet unknown reason.
+ * On MIPS64 it crashes for some other, yet unknown reason ...
*/
- ep = romvec->get_evar("eaddr");
+ ep = ArcGetEnvironmentVariable("eaddr");
str2eaddr(onboard_eth_addr, ep);
return sgiseeq_init(dev,
(struct sgiseeq_regs *) (KSEG1ADDR(0x1fbd4000)),
-/* $Id: sgiseeq.h,v 1.5 1999/12/04 03:59:03 ralf Exp $
+/* $Id: sgiseeq.h,v 1.4 1999/10/09 00:01:24 ralf Exp $
* sgiseeq.h: Defines for the Seeq8003 ethernet controller.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
"SiS 900 PCI Fast Ethernet",
"SiS 7016 PCI Fast Ethernet"
};
-static struct pci_device_id sis900_pci_tbl [] __initdata = {
+static struct pci_device_id sis900_pci_tbl [] __devinitdata = {
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_900,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_900},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7016,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018}
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018},
+ {0,}
};
MODULE_DEVICE_TABLE (pci, sis900_pci_tbl);
static struct pci_device_id starfire_pci_tbl[] __devinitdata = {
{ 0x9004, 0x6915, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_6915 },
- { 0, },
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, starfire_pci_tbl);
{ 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 },
{ 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 },
{ 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
- {0},
+ {0, }
};
MODULE_DEVICE_TABLE(pci, tulip_pci_tbl);
{
{0x1106, 0x6100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A},
{0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT3043},
- {0,}, /* terminate list */
+ {0,} /* terminate list */
};
MODULE_DEVICE_TABLE(pci, via_rhine_pci_tbl);
#ifdef MODULE
static struct pci_device_id lmc_pci_tbl[] __devinitdata = {
{ 0x1011, 0x009, 0x1379, PCI_ANY_ID, 0, 0, 0},
- { 0 },
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, lmc_pci_tbl);
static struct pci_device_id yellowfin_pci_tbl[] __devinitdata = {
{ 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, YELLOWFIN_GNIC },
{ 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SYM83C885 },
- { 0, },
+ { 0, }
};
MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl);
PCI_ANY_ID, PCI_ANY_ID, 0, 0, afavlab_tk9902 },
{ PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, timedia_1889 },
- { 0, }, /* terminate list */
+ { 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl);
"EMU10K1",
};
-static struct pci_device_id emu10k1_pci_tbl[] = {
+static struct pci_device_id emu10k1_pci_tbl[] __devinitdata = {
{PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_EMU10K1,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, EMU10K1},
{0,}
static struct pci_device_id id_table[] __devinitdata = {
{ PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1370, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
- { 0, 0, 0, 0, 0, 0 }
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, id_table);
{ PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1371, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
{ PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_CT5880, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
{ PCI_VENDOR_ID_ECTIVA, PCI_DEVICE_ID_ECTIVA_EV1938, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
- { 0, 0, 0, 0, 0, 0 }
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, id_table);
static struct pci_device_id id_table[] __devinitdata = {
{ PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_SOLO1, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
- { 0, 0, 0, 0, 0, 0 }
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, id_table);
"Intel 440MX"
};
-static struct pci_device_id i810_pci_tbl [] __initdata = {
+static struct pci_device_id i810_pci_tbl [] __devinitdata = {
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA},
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82901,
ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
0,0,0,0,
0,1,1,-1},
+ {"Sound Blaster 16",
+ ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0025),
+ ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
+ 0,0,0,0,
+ 0,1,1,-1},
{"Sound Blaster 16",
ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0026),
ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0045),
0,0,0,0,
0,1,1,-1},
+ {"ESS 1688",
+ ISAPNP_VENDOR('E','S','S'), ISAPNP_DEVICE(0x0968),
+ ISAPNP_VENDOR('E','S','S'), ISAPNP_FUNCTION(0x0968),
+ 0,0,0,0,
+ 0,1,2,-1},
{"ESS 1868",
ISAPNP_VENDOR('E','S','S'), ISAPNP_DEVICE(0x1868),
ISAPNP_VENDOR('E','S','S'), ISAPNP_FUNCTION(0x1868),
ISAPNP_VENDOR('@','X','@'), ISAPNP_FUNCTION(0x2001),
ISAPNP_VENDOR('@','H','@'), ISAPNP_FUNCTION(0x0001),
1,0,0,0},
- {"Creative SB16 PnP",
- ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x002a),
- ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
- 0,0,0,0,
- 0,1,1,-1},
{0}
};
static struct pci_device_id id_table[] __devinitdata = {
{ PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_SONICVIBES, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
- { 0, 0, 0, 0, 0, 0 }
+ { 0, }
};
MODULE_DEVICE_TABLE(pci, id_table);
"ALi Audio Accelerator"
};
-static struct pci_device_id trident_pci_tbl [] __initdata = {
+static struct pci_device_id trident_pci_tbl [] __devinitdata = {
{PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_DX},
{PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX,
*/
-static struct pci_device_id via_pci_tbl[] __initdata = {
+static struct pci_device_id via_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- { 0, },
+ { 0, }
};
MODULE_DEVICE_TABLE(pci,via_pci_tbl);
-/* $Id: $
+/* $Id: tc.c,v 1.3 1999/10/09 00:01:32 ralf Exp $
* tc-init: We assume the TURBOchannel to be up and running so
* just probe for Modules and fill in the global data structure
* tc_bus.
#include <linux/string.h>
#include <linux/init.h>
+#include <linux/ioport.h>
#include <asm/addrspace.h>
#include <asm/errno.h>
#include <asm/dec/machtype.h>
tc_bus[i].name, tc_bus[i].firmware);
}
#endif
+ ioport_resource.end = KSEG2 - 1;
}
-
}
/*
- * Turbo Channel Services -- Exported Symbols
+ * TURBOchannel Services -- Exported Symbols
*
*/
#include <linux/module.h>
#include <asm/dec/tc.h>
-EXPORT_SYMBOL(get_tc_irq_nr);
-EXPORT_SYMBOL(claim_tc_card);
EXPORT_SYMBOL(search_tc_card);
-EXPORT_SYMBOL(get_tc_speed);
+EXPORT_SYMBOL(claim_tc_card);
+EXPORT_SYMBOL(release_tc_card);
EXPORT_SYMBOL(get_tc_base_addr);
+EXPORT_SYMBOL(get_tc_irq_nr);
+EXPORT_SYMBOL(get_tc_speed);
#include <asm/segment.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
+#include <asm/wbflush.h>
#include <asm/dec/interrupts.h>
#include <asm/dec/machtype.h>
#include <asm/dec/tc.h>
* memory if large numbers of serial ports are open.
*/
static unsigned char tmp_buf[4096]; /* This is cheating */
-static struct semaphore tmp_buf_sem = MUTEX;
+static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct dec_serial *info,
dev_t device, const char *routine)
if (reg != 0) {
*channel->control = reg & 0xf;
- RECOVERY_DELAY;
+ wbflush(); RECOVERY_DELAY;
}
retval = *channel->control;
RECOVERY_DELAY;
{
if (reg != 0) {
*channel->control = reg & 0xf;
- RECOVERY_DELAY;
+ wbflush(); RECOVERY_DELAY;
}
*channel->control = value;
- RECOVERY_DELAY;
+ wbflush(); RECOVERY_DELAY;
return;
}
unsigned char value)
{
*channel->data = value;
- RECOVERY_DELAY;
+ wbflush(); RECOVERY_DELAY;
return;
}
char_time = 1;
if (timeout)
char_time = MIN(char_time, timeout);
- while ((read_zsreg(info->zs_channel, 1) & ALL_SNT) == 0) {
+ while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(char_time);
if (signal_pending(current))
static int block_til_ready(struct tty_struct *tty, struct file * filp,
struct dec_serial *info)
{
- struct wait_queue wait = { current, NULL };
+ DECLARE_WAITQUEUE(wait, current);
int retval;
int do_clocal = 0;
info->tqueue.data = info;
info->callout_termios =callout_driver.init_termios;
info->normal_termios = serial_driver.init_termios;
- info->open_wait = 0;
- info->close_wait = 0;
+ init_waitqueue_head(&info->open_wait);
+ init_waitqueue_head(&info->close_wait);
printk("tty%02d at 0x%08x (irq = %d)", info->line,
info->port, info->irq);
printk(" is a Z85C30 SCC\n");
while (!(*(info->zs_channel->control) & Tx_BUF_EMP) && --loops)
RECOVERY_DELAY;
*(info->zs_channel->data) = ch;
- RECOVERY_DELAY;
+ wbflush(); RECOVERY_DELAY;
restore_flags(flags);
}
/*
* Register console.
*/
-long __init zs_serial_console_init(long kmem_start, long kmem_end)
+void __init zs_serial_console_init(void)
{
register_console(&sercons);
- return kmem_start;
}
#endif /* ifdef CONFIG_SERIAL_CONSOLE */
struct tq_struct tqueue_hangup;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
};
-/* $Id: newport_con.c,v 1.13 1999/04/11 10:37:08 ulfc Exp $
+/* $Id: newport_con.c,v 1.14 1999/06/24 01:10:24 ulfc Exp $
*
* newport_con.c: Abscon for newport hardware
*
* (C) 1998 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
- * (C) 1999 Ulf Carlsson (ulfc@bun.falkenberg.se)
+ * (C) 1999 Ulf Carlsson (ulfc@thepuffingruop.com)
*
* This driver is based on sgicons.c and cons_newport.
*
#include <asm/system.h>
#include <asm/page.h>
#include <asm/pgtable.h>
-#include <asm/newport.h>
+#include <video/newport.h>
#define INCLUDE_LINUX_LOGO_DATA
#include <asm/linux_logo.h>
+#include <video/font.h>
+
#define LOGO_W 80
#define LOGO_H 80
-extern unsigned char vga_font[];
+extern struct fbcon_font_desc font_vga_8x16;
+
+#define FONT_DATA ((unsigned char *)font_vga_8x16.data)
+
extern struct newport_regs *npregs;
static int logo_active;
for(i = 0; i < 128; i++) {
newport_bfwait();
if (i == 92 || i == 94)
- npregs->set.dcbdata0.hwords.s1 = 0xff00;
+ npregs->set.dcbdata0.byshort.s1 = 0xff00;
else
- npregs->set.dcbdata0.hwords.s1 = 0x0000;
+ npregs->set.dcbdata0.byshort.s1 = 0x0000;
}
newport_init_cmap();
/* turn off popup plane */
npregs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
XM9_CRS_CONFIG | NPORT_DMODE_W1);
- npregs->set.dcbdata0.bytes.b3 &= ~XM9_PUPMODE;
+ npregs->set.dcbdata0.bybytes.b3 &= ~XM9_PUPMODE;
npregs->set.dcbmode = (DCB_XMAP1 | R_DCB_XMAP9_PROTOCOL |
XM9_CRS_CONFIG | NPORT_DMODE_W1);
- npregs->set.dcbdata0.bytes.b3 &= ~XM9_PUPMODE;
+ npregs->set.dcbdata0.bybytes.b3 &= ~XM9_PUPMODE;
topscan = 0;
npregs->cset.topscan = 0x3ff;
NPORT_DMODE_W2 | VC2_PROTOCOL);
for(i = 0; i < 128; i++) {
newport_bfwait();
- linetable[i] = npregs->set.dcbdata0.hwords.s1;
+ linetable[i] = npregs->set.dcbdata0.byshort.s1;
}
newport_xsize = newport_ysize = 0;
NPORT_DMODE_W2 | VC2_PROTOCOL);
do {
newport_bfwait();
- treg = npregs->set.dcbdata0.hwords.s1;
+ treg = npregs->set.dcbdata0.byshort.s1;
if ((treg & 1) == 0)
cols += (treg >> 7) & 0xfe;
if ((treg & 0x80) == 0) {
newport_bfwait();
- treg = npregs->set.dcbdata0.hwords.s1;
+ treg = npregs->set.dcbdata0.byshort.s1;
}
} while ((treg & 0x8000) == 0);
if (cols) {
unsigned int bt445_rev;
unsigned int bitplanes;
- rex3_rev = npregs->cset.stat & NPORT_STAT_VERS;
+ rex3_rev = npregs->cset.status & NPORT_STAT_VERS;
npregs->set.dcbmode = (DCB_CMAP0 | NCMAP_PROTOCOL |
NCMAP_REGADDR_RREG | NPORT_DMODE_W1);
- tmp = npregs->set.dcbdata0.bytes.b3;
+ tmp = npregs->set.dcbdata0.bybytes.b3;
cmap_rev = tmp & 7;
board_rev = (tmp >> 4) & 7;
bitplanes = ((board_rev > 1) && (tmp & 0x80)) ? 8 : 24;
npregs->set.dcbmode = (DCB_CMAP1 | NCMAP_PROTOCOL |
NCMAP_REGADDR_RREG | NPORT_DMODE_W1);
- tmp = npregs->set.dcbdata0.bytes.b3;
+ tmp = npregs->set.dcbdata0.bybytes.b3;
if ((tmp & 7) < cmap_rev)
cmap_rev = (tmp & 7);
npregs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
XM9_CRS_REVISION | NPORT_DMODE_W1);
- xmap9_rev = npregs->set.dcbdata0.bytes.b3 & 7;
+ xmap9_rev = npregs->set.dcbdata0.bybytes.b3 & 7;
npregs->set.dcbmode = (DCB_BT445 | BT445_PROTOCOL |
BT445_CSR_ADDR_REG | NPORT_DMODE_W1);
- npregs->set.dcbdata0.bytes.b3 = BT445_REVISION_REG;
+ npregs->set.dcbdata0.bybytes.b3 = BT445_REVISION_REG;
npregs->set.dcbmode = (DCB_BT445 | BT445_PROTOCOL |
BT445_CSR_REVISION | NPORT_DMODE_W1);
- bt445_rev = (npregs->set.dcbdata0.bytes.b3 >> 4) - 0x0a;
+ bt445_rev = (npregs->set.dcbdata0.bybytes.b3 >> 4) - 0x0a;
#define L(a) (char)('A'+(a))
printk ("NG1: Revision %d, %d bitplanes, REX3 revision %c, VC2 revision %c, xmap9 revision %c, cmap revision %c, bt445 revision %c\n",
return NULL;
}
- p->set.xstarti = TESTVAL; if(p->set._xstart.i != XSTI_TO_FXSTART(TESTVAL)) {
+ p->set.xstarti = TESTVAL; if(p->set._xstart.word != XSTI_TO_FXSTART(TESTVAL)) {
return NULL;
}
{
unsigned char *p;
- p = &vga_font[(charattr & 0xff) << 4];
+ p = &FONT_DATA[(charattr & 0xff) << 4];
charattr = (charattr >> 8) & 0xff;
xpos <<= 3;
ypos <<= 4;
NPORT_DMODE0_L32);
for (i = 0; i < count; i++, xpos += 8) {
- p = &vga_font[(s[i] & 0xff) << 4];
+ p = &FONT_DATA[(s[i] & 0xff) << 4];
newport_wait();
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_VTNT2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_RIVA_VTNT2 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_UVTNT2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_RIVA_VTNT2 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_ITNT2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_RIVA_ITNT2 },
- { 0, }, /* terminate list */
+ { 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, rivafb_pci_tbl);
/* Support functions follow */
+
+/**
+ * search_for_entry_in_dir - Search for a devfs entry inside another devfs entry.
+ * @parent: The parent devfs entry.
+ * @name: The name of the entry.
+ * @namelen: The number of characters in @name.
+ * @traverse_symlink: If %TRUE then the entry is traversed if it is a symlink.
+ *
+ * Returns a pointer to the entry on success, else %NULL.
+ */
+
static struct devfs_entry *search_for_entry_in_dir (struct devfs_entry *parent,
const char *name,
unsigned int namelen,
int traverse_symlink)
-/* [SUMMARY] Search for a devfs entry inside another devfs entry.
- <parent> The parent devfs entry.
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>.
- <traverse_symlink> If TRUE then the entry is traversed if it is a symlink.
- [RETURNS] A pointer to the entry on success, else NULL.
-*/
{
struct devfs_entry *curr;
return new;
} /* End Function create_entry */
+
+/**
+ * get_root_entry - Get the root devfs entry.
+ *
+ * Returns the root devfs entry on success, else %NULL.
+ */
+
static struct devfs_entry *get_root_entry (void)
-/* [SUMMARY] Get the root devfs entry.
- [RETURNS] The root devfs entry on success, else NULL.
-*/
{
struct devfs_entry *new;
return root_entry;
} /* End Function get_root_entry */
+
+/**
+ * search_for_entry - Search for an entry in the devfs tree.
+ * @dir: The parent directory to search from. If this is %NULL the root is used
+ * @name: The name of the entry.
+ * @namelen: The number of characters in @name.
+ * @mkdir: If %TRUE intermediate directories are created as needed.
+ * @mkfile: If %TRUE the file entry is created if it doesn't exist.
+ * @is_new: If the returned entry was newly made, %TRUE is written here. If
+ * this is %NULL nothing is written here.
+ * @traverse_symlink: If %TRUE then symbolic links are traversed.
+ *
+ * If the entry is created, then it will be in the unregistered state.
+ * Returns a pointer to the entry on success, else %NULL.
+ */
+
static struct devfs_entry *search_for_entry (struct devfs_entry *dir,
const char *name,
unsigned int namelen, int mkdir,
int mkfile, int *is_new,
int traverse_symlink)
-/* [SUMMARY] Search for an entry in the devfs tree.
- <dir> The parent directory to search from. If this is NULL the root is used
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>.
- <mkdir> If TRUE intermediate directories are created as needed.
- <mkfile> If TRUE the file entry is created if it doesn't exist.
- <is_new> If the returned entry was newly made, TRUE is written here. If
- this is NULL nothing is written here.
- <traverse_symlink> If TRUE then symbolic links are traversed.
- [NOTE] If the entry is created, then it will be in the unregistered state.
- [RETURNS] A pointer to the entry on success, else NULL.
-*/
{
int len;
const char *subname, *stop, *ptr;
return NULL;
} /* End Function search_for_entry */
+
+/**
+ * find_by_dev - Find a devfs entry in a directory.
+ * @major: The major number to search for.
+ * @minor: The minor number to search for.
+ * @type: The type of special file to search for. This may be either
+ * %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK.
+ *
+ * Returns the devfs_entry pointer on success, else %NULL.
+ */
+
static struct devfs_entry *find_by_dev (struct devfs_entry *dir,
unsigned int major, unsigned int minor,
char type)
-/* [SUMMARY] Find a devfs entry in a directory.
- <major> The major number to search for.
- <minor> The minor number to search for.
- <type> The type of special file to search for. This may be either
- DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK.
- [RETURNS] The devfs_entry pointer on success, else NULL.
-*/
{
struct devfs_entry *entry, *de;
return NULL;
} /* End Function find_by_dev */
+
+/**
+ * find_entry - Find a devfs entry.
+ * @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ * name is relative to the root of the devfs.
+ * @name: The name of the entry. This is ignored if @handle is not %NULL.
+ * @namelen: The number of characters in @name, not including a %NULL
+ * terminator. If this is 0, then @name must be %NULL-terminated and the
+ * length is computed internally.
+ * @major: The major number. This is used if @handle and @name are %NULL.
+ * @minor: The minor number. This is used if @handle and @name are %NULL.
+ * NOTE: If @major and @minor are both 0, searching by major and minor
+ * numbers is disabled.
+ * @type: The type of special file to search for. This may be either
+ * %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK.
+ * @traverse_symlink: If %TRUE then symbolic links are traversed.
+ *
+ * FIXME: What the hell is @handle? - ch
+ * Returns the devfs_entry pointer on success, else %NULL.
+ */
+
static struct devfs_entry *find_entry (devfs_handle_t dir,
const char *name, unsigned int namelen,
unsigned int major, unsigned int minor,
char type, int traverse_symlink)
-/* [SUMMARY] Find a devfs entry.
- <dir> The handle to the parent devfs directory entry. If this is NULL the
- name is relative to the root of the devfs.
- <name> The name of the entry. This is ignored if <<handle>> is not NULL.
- <namelen> The number of characters in <<name>>, not including a NULL
- terminator. If this is 0, then <<name>> must be NULL-terminated and the
- length is computed internally.
- <major> The major number. This is used if <<handle>> and <<name>> are NULL.
- <minor> The minor number. This is used if <<handle>> and <<name>> are NULL.
- [NOTE] If <<major>> and <<minor>> are both 0, searching by major and minor
- numbers is disabled.
- <type> The type of special file to search for. This may be either
- DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK.
- <traverse_symlink> If TRUE then symbolic links are traversed.
- [RETURNS] The devfs_entry pointer on success, else NULL.
-*/
{
struct devfs_entry *entry;
return fs_info->table[inode->i_ino - FIRST_INODE];
} /* End Function get_devfs_inode_from_vfs_inode */
+
+/**
+ * free_dentries - Free the dentries for a device entry and invalidate inodes.
+ * @de: The entry.
+ */
+
static void free_dentries (struct devfs_entry *de)
-/* [SUMMARY] Free the dentries for a device entry and invalidate inodes.
- <de> The entry.
- [RETURNS] Nothing.
-*/
{
struct devfs_inode *di;
struct dentry *dentry;
}
} /* End Function free_dentries */
+
+/**
+ * is_devfsd_or_child - Test if the current process is devfsd or one of its children.
+ * fs_info: The filesystem information.
+ *
+ * Returns %TRUE if devfsd or child, else %FALSE.
+ */
+
static int is_devfsd_or_child (struct fs_info *fs_info)
-/* [SUMMARY] Test if the current process is devfsd or one of its children.
- <fs_info> The filesystem information.
- [RETURNS] TRUE if devfsd or child, else FALSE.
-*/
{
struct task_struct *p;
return (FALSE);
} /* End Function is_devfsd_or_child */
+
+/**
+ * devfsd_queue_empty - Test if devfsd has work pending in its event queue.
+ * @fs_info: The filesystem information.
+ *
+ * Returns %TRUE if the queue is empty, else %FALSE.
+ */
+
static inline int devfsd_queue_empty (struct fs_info *fs_info)
-/* [SUMMARY] Test if devfsd has work pending in its event queue.
- <fs_info> The filesystem information.
- [RETURNS] TRUE if the queue is empty, else FALSE.
-*/
{
return (fs_info->devfsd_buf_out == fs_info->devfsd_buf_in) ? TRUE : FALSE;
} /* End Function devfsd_queue_empty */
+
+/**
+ * wait_for_devfsd_finished - Wait for devfsd to finish processing its event queue.
+ * @fs_info: The filesystem information.
+ *
+ * Returns %TRUE if no more waiting will be required, else %FALSE.
+ */
+
static int wait_for_devfsd_finished (struct fs_info *fs_info)
-/* [SUMMARY] Wait for devfsd to finish processing its event queue.
- <fs_info> The filesystem information.
- [RETURNS] TRUE if no more waiting will be required, else FALSE.
-*/
{
DECLARE_WAITQUEUE (wait, current);
return (TRUE);
} /* End Function wait_for_devfsd_finished */
+
+/**
+ * devfsd_notify_one - Notify a single devfsd daemon of a change.
+ * @data: Data to be passed.
+ * @type: The type of change.
+ * @mode: The mode of the entry.
+ * @uid: The user ID.
+ * @gid: The group ID.
+ * @fs_info: The filesystem info.
+ *
+ * Returns %TRUE if an event was queued and devfsd woken up, else %FALSE.
+ */
+
static int devfsd_notify_one (void *data, unsigned int type, umode_t mode,
uid_t uid, gid_t gid, struct fs_info *fs_info)
-/* [SUMMARY] Notify a single devfsd daemon of a change.
- <data> Data to be passed.
- <type> The type of change.
- <mode> The mode of the entry.
- <uid> The user ID.
- <gid> The group ID.
- <fs_info> The filesystem info.
- [RETURNS] TRUE if an event was queued and devfsd woken up, else FALSE.
-*/
{
unsigned int next_pos;
unsigned long flags;
return (TRUE);
} /* End Function devfsd_notify_one */
+
+/**
+ * devfsd_notify - Notify all devfsd daemons of a change.
+ * @de: The devfs entry that has changed.
+ * @type: The type of change event.
+ * @wait: If TRUE, the functions waits for all daemons to finish processing
+ * the event.
+ */
+
static void devfsd_notify (struct devfs_entry *de, unsigned int type, int wait)
-/* [SUMMARY] Notify all devfsd daemons of a change.
- <de> The devfs entry that has changed.
- <type> The type of change event.
- <wait> If TRUE, the functions waits for all daemons to finish processing
- the event.
- [RETURNS] Nothing.
-*/
{
struct fs_info *fs_info;
}
} /* End Function devfsd_notify */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_register - Register a device entry.
+ * @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ * new name is relative to the root of the devfs.
+ * @name: The name of the entry.
+ * @namelen: The number of characters in @name, not including a %NULL
+ * terminator. If this is 0, then @name must be %NULL-terminated and the
+ * length is computed internally.
+ * @flags: A set of bitwise-ORed flags (DEVFS_FL_*).
+ * @major: The major number. Not needed for regular files.
+ * @minor: The minor number. Not needed for regular files.
+ * @mode: The default file mode.
+ * @uid: The default UID of the file.
+ * @guid: The default GID of the file.
+ * @ops: The &file_operations or &block_device_operations structure.
+ * This must not be externally deallocated.
+ * @info: An arbitrary pointer which will be written to the @private_data
+ * field of the &file structure passed to the device driver. You can set
+ * this to whatever you like, and change it once the file is opened (the next
+ * file opened will not see this change).
+ *
+ * Returns a handle which may later be used in a call to devfs_unregister().
+ * On failure %NULL is returned.
+ */
+
devfs_handle_t devfs_register (devfs_handle_t dir,
const char *name, unsigned int namelen,
unsigned int flags,
unsigned int major, unsigned int minor,
umode_t mode, uid_t uid, gid_t gid,
void *ops, void *info)
-/* [SUMMARY] Register a device entry.
- <dir> The handle to the parent devfs directory entry. If this is NULL the
- new name is relative to the root of the devfs.
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>, not including a NULL
- terminator. If this is 0, then <<name>> must be NULL-terminated and the
- length is computed internally.
- <flags> A set of bitwise-ORed flags (DEVFS_FL_*).
- <major> The major number. Not needed for regular files.
- <minor> The minor number. Not needed for regular files.
- <mode> The default file mode.
- <uid> The default UID of the file.
- <guid> The default GID of the file.
- <ops> The <<file_operations>> or <<block_device_operations>> structure.
- This must not be externally deallocated.
- <info> An arbitrary pointer which will be written to the <<private_data>>
- field of the <<file>> structure passed to the device driver. You can set
- this to whatever you like, and change it once the file is opened (the next
- file opened will not see this change).
- [RETURNS] A handle which may later be used in a call to
- [<devfs_unregister>]. On failure NULL is returned.
-*/
{
int is_new;
struct devfs_entry *de;
return de;
} /* End Function devfs_register */
+
+/**
+ * unregister - Unregister a device entry.
+ * @de: The entry to unregister.
+ */
+
static void unregister (struct devfs_entry *de)
-/* [SUMMARY] Unregister a device entry.
- <de> The entry to unregister.
- [RETURNS] Nothing.
-*/
{
struct devfs_entry *child;
}
} /* End Function unregister */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_unregister - Unregister a device entry.
+ * de: A handle previously created by devfs_register() or returned from
+ * devfs_find_handle(). If this is %NULL the routine does nothing.
+ */
+
void devfs_unregister (devfs_handle_t de)
-/* [SUMMARY] Unregister a device entry.
- <de> A handle previously created by [<devfs_register>] or returned from
- [<devfs_find_handle>]. If this is NULL the routine does nothing.
- [RETURNS] Nothing.
-*/
{
if (de == NULL) return;
#ifdef CONFIG_DEVFS_DEBUG
unregister (de);
} /* End Function devfs_unregister */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_mk_symlink Create a symbolic link in the devfs namespace.
+ * @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ * new name is relative to the root of the devfs.
+ * @name: The name of the entry.
+ * @namelen: The number of characters in @name, not including a %NULL
+ * terminator. If this is 0, then @name must be %NULL-terminated and the
+ * length is computed internally.
+ * @flags: A set of bitwise-ORed flags (DEVFS_FL_*).
+ * @link: The destination name.
+ * @linklength: The number of characters in @link, not including a %NULL
+ * terminator. If this is 0, then @link must be %NULL-terminated and the
+ * length is computed internally.
+ * @handle: The handle to the symlink entry is written here. This may be %NULL.
+ * @info: An arbitrary pointer which will be associated with the entry.
+ *
+ * Returns 0 on success, else a negative error code is returned.
+ */
+
int devfs_mk_symlink (devfs_handle_t dir,
const char *name, unsigned int namelen,
unsigned int flags,
const char *link, unsigned int linklength,
devfs_handle_t *handle, void *info)
-/* [SUMMARY] Create a symbolic link in the devfs namespace.
- <dir> The handle to the parent devfs directory entry. If this is NULL the
- new name is relative to the root of the devfs.
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>, not including a NULL
- terminator. If this is 0, then <<name>> must be NULL-terminated and the
- length is computed internally.
- <flags> A set of bitwise-ORed flags (DEVFS_FL_*).
- <link> The destination name.
- <linklength> The number of characters in <<link>>, not including a NULL
- terminator. If this is 0, then <<link>> must be NULL-terminated and the
- length is computed internally.
- <handle> The handle to the symlink entry is written here. This may be NULL.
- <info> An arbitrary pointer which will be associated with the entry.
- [RETURNS] 0 on success, else a negative error code is returned.
-*/
{
int is_new;
char *newname;
return 0;
} /* End Function devfs_mk_symlink */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_mk_dir - Create a directory in the devfs namespace.
+ * @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ * new name is relative to the root of the devfs.
+ * @name: The name of the entry.
+ * @namelen: The number of characters in @name, not including a %NULL
+ * terminator. If this is 0, then @name must be %NULL-terminated and the
+ * length is computed internally.
+ * @info: An arbitrary pointer which will be associated with the entry.
+ *
+ * Use of this function is optional. The devfs_register() function
+ * will automatically create intermediate directories as needed. This function
+ * is provided for efficiency reasons, as it provides a handle to a directory.
+ * Returns a handle which may later be used in a call to devfs_unregister().
+ * On failure %NULL is returned.
+ */
+
devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name,
unsigned int namelen, void *info)
-/* [SUMMARY] Create a directory in the devfs namespace.
- <dir> The handle to the parent devfs directory entry. If this is NULL the
- new name is relative to the root of the devfs.
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>, not including a NULL
- terminator. If this is 0, then <<name>> must be NULL-terminated and the
- length is computed internally.
- <info> An arbitrary pointer which will be associated with the entry.
- [NOTE] Use of this function is optional. The [<devfs_register>] function
- will automatically create intermediate directories as needed. This function
- is provided for efficiency reasons, as it provides a handle to a directory.
- [RETURNS] A handle which may later be used in a call to
- [<devfs_unregister>]. On failure NULL is returned.
-*/
{
int is_new;
struct devfs_entry *de;
return de;
} /* End Function devfs_mk_dir */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_find_handle - Find the handle of a devfs entry.
+ * @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ * name is relative to the root of the devfs.
+ * @name: The name of the entry.
+ * @namelen: The number of characters in @name, not including a %NULL
+ * terminator. If this is 0, then @name must be %NULL-terminated and the
+ * length is computed internally.
+ * @major: The major number. This is used if @name is %NULL.
+ * @minor: The minor number. This is used if @name is %NULL.
+ * @type: The type of special file to search for. This may be either
+ * %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK.
+ * @traverse_symlinks: If %TRUE then symlink entries in the devfs namespace are
+ * traversed. Symlinks pointing out of the devfs namespace will cause a
+ * failure. Symlink traversal consumes stack space.
+ *
+ * Returns a handle which may later be used in a call to devfs_unregister(),
+ * devfs_get_flags(), or devfs_set_flags(). On failure %NULL is returned.
+ */
+
devfs_handle_t devfs_find_handle (devfs_handle_t dir,
const char *name, unsigned int namelen,
unsigned int major, unsigned int minor,
char type, int traverse_symlinks)
-/* [SUMMARY] Find the handle of a devfs entry.
- <dir> The handle to the parent devfs directory entry. If this is NULL the
- name is relative to the root of the devfs.
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>, not including a NULL
- terminator. If this is 0, then <<name>> must be NULL-terminated and the
- length is computed internally.
- <major> The major number. This is used if <<name>> is NULL.
- <minor> The minor number. This is used if <<name>> is NULL.
- <type> The type of special file to search for. This may be either
- DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK.
- <traverse_symlinks> If TRUE then symlink entries in the devfs namespace are
- traversed. Symlinks pointing out of the devfs namespace will cause a
- failure. Symlink traversal consumes stack space.
- [RETURNS] A handle which may later be used in a call to
- [<devfs_unregister>], [<devfs_get_flags>], or [<devfs_set_flags>].
- On failure NULL is returned.
-*/
{
devfs_handle_t de;
return de;
} /* End Function devfs_find_handle */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_flags - Get the flags for a devfs entry.
+ * @de: The handle to the device entry.
+ * @flags: The flags are written here.
+ *
+ * Returns 0 on success, else a negative error code.
+ */
+
int devfs_get_flags (devfs_handle_t de, unsigned int *flags)
-/* [SUMMARY] Get the flags for a devfs entry.
- <de> The handle to the device entry.
- <flags> The flags are written here.
- [RETURNS] 0 on success, else a negative error code.
-*/
{
unsigned int fl = 0;
return 0;
} /* End Function devfs_get_flags */
-/*PUBLIC_FUNCTION*/
+
+/*
+ * devfs_set_flags - Set the flags for a devfs entry.
+ * @de: The handle to the device entry.
+ * @flags: The flags to set. Unset flags are cleared.
+ *
+ * Returns 0 on success, else a negative error code.
+ */
+
int devfs_set_flags (devfs_handle_t de, unsigned int flags)
-/* [SUMMARY] Set the flags for a devfs entry.
- <de> The handle to the device entry.
- <flags> The flags to set. Unset flags are cleared.
- [RETURNS] 0 on success, else a negative error code.
-*/
{
if (de == NULL) return -EINVAL;
if (!de->registered) return -ENODEV;
return 0;
} /* End Function devfs_set_flags */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_maj_min - Get the major and minor numbers for a devfs entry.
+ * @de: The handle to the device entry.
+ * @major: The major number is written here. This may be %NULL.
+ * @minor: The minor number is written here. This may be %NULL.
+ *
+ * Returns 0 on success, else a negative error code.
+ */
+
int devfs_get_maj_min (devfs_handle_t de, unsigned int *major,
unsigned int *minor)
-/* [SUMMARY] Get the major and minor numbers for a devfs entry.
- <de> The handle to the device entry.
- <major> The major number is written here. This may be NULL.
- <minor> The minor number is written here. This may be NULL.
- [RETURNS] 0 on success, else a negative error code.
-*/
{
if (de == NULL) return -EINVAL;
if (!de->registered) return -ENODEV;
return 0;
} /* End Function devfs_get_maj_min */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_handle_from_inode - Get the devfs handle for a VFS inode.
+ * @inode: The VFS inode.
+ *
+ * Returns the devfs handle on success, else %NULL.
+ */
+
devfs_handle_t devfs_get_handle_from_inode (struct inode *inode)
-/* [SUMMARY] Get the devfs handle for a VFS inode.
- <inode> The VFS inode.
- [RETURNS] The devfs handle on success, else NULL.
-*/
{
struct devfs_inode *di;
return di->de;
} /* End Function devfs_get_handle_from_inode */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_generate_path - Generate a pathname for an entry, relative to the devfs root.
+ * @de: The devfs entry.
+ * @path: The buffer to write the pathname to. The pathname and '\0'
+ * terminator will be written at the end of the buffer.
+ * @buflen: The length of the buffer.
+ *
+ * Returns the offset in the buffer where the pathname starts on success,
+ * else a negative error code.
+ */
+
int devfs_generate_path (devfs_handle_t de, char *path, int buflen)
-/* [SUMMARY] Generate a pathname for an entry, relative to the devfs root.
- <de> The devfs entry.
- <path> The buffer to write the pathname to. The pathname and '\0'
- terminator will be written at the end of the buffer.
- <buflen> The length of the buffer.
- [RETURNS] The offset in the buffer where the pathname starts on success,
- else a negative error code.
-*/
{
int pos;
return pos;
} /* End Function devfs_generate_path */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_ops - Get the device operations for a devfs entry.
+ * @de: The handle to the device entry.
+ *
+ * Returns a pointer to the device operations on success, else NULL.
+ */
+
void *devfs_get_ops (devfs_handle_t de)
-/* [SUMMARY] Get the device operations for a devfs entry.
- <de> The handle to the device entry.
- [RETURNS] A pointer to the device operations on success, else NULL.
-*/
{
if (de == NULL) return NULL;
if (!de->registered) return NULL;
return NULL;
} /* End Function devfs_get_ops */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_set_file_size - Set the file size for a devfs regular file.
+ * de: The handle to the device entry.
+ * size: The new file size.
+ *
+ * Returns 0 on success, else a negative error code.
+ */
+
int devfs_set_file_size (devfs_handle_t de, unsigned long size)
-/* [SUMMARY] Set the file size for a devfs regular file.
- <de> The handle to the device entry.
- <size> The new file size.
- [RETURNS] 0 on success, else a negative error code.
-*/
{
struct devfs_inode *di;
return 0;
} /* End Function devfs_set_file_size */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_info - Get the info pointer written to private_data of @de upon open.
+ * @de: The handle to the device entry.
+ *
+ * Returns the info pointer.
+ */
void *devfs_get_info (devfs_handle_t de)
-/* [SUMMARY] Get the info pointer written to <<private_data>> upon open.
- <de> The handle to the device entry.
- [RETURNS] The info pointer.
-*/
{
if (de == NULL) return NULL;
if (!de->registered) return NULL;
return de->info;
} /* End Function devfs_get_info */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_set_info - Set the info pointer written to private_data upon open.
+ * @de: The handle to the device entry.
+ *
+ * Returns 0 on success, else a negative error code.
+ */
int devfs_set_info (devfs_handle_t de, void *info)
-/* [SUMMARY] Set the info pointer written to <<private_data>> upon open.
- <de> The handle to the device entry.
- [RETURNS] 0 on success, else a negative error code.
-*/
{
if (de == NULL) return -EINVAL;
if (!de->registered) return -EINVAL;
return 0;
} /* End Function devfs_set_info */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_parent - Get the parent device entry.
+ * @de: The handle to the device entry.
+ *
+ * Returns the parent device entry if it exists, else %NULL.
+ */
devfs_handle_t devfs_get_parent (devfs_handle_t de)
-/* [SUMMARY] Get the parent device entry.
- <de> The handle to the device entry.
- [RETURNS] The parent device entry if it exists, else NULL.
-*/
{
if (de == NULL) return NULL;
if (!de->registered) return NULL;
return de->parent;
} /* End Function devfs_get_parent */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_first_child - Get the first leaf node in a directory.
+ * @de: The handle to the device entry.
+ *
+ * Returns the leaf node device entry if it exists, else %NULL.
+ */
+
devfs_handle_t devfs_get_first_child (devfs_handle_t de)
-/* [SUMMARY] Get the first leaf node in a directory.
- <de> The handle to the device entry.
- [RETURNS] The leaf node device entry if it exists, else NULL.
-*/
{
if (de == NULL) return NULL;
if (!de->registered) return NULL;
return de->u.dir.first;
} /* End Function devfs_get_first_child */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_next_sibling - Get the next sibling leaf node. for a device entry.
+ * @de: The handle to the device entry.
+ *
+ * Returns the leaf node device entry if it exists, else %NULL.
+ */
+
devfs_handle_t devfs_get_next_sibling (devfs_handle_t de)
-/* [SUMMARY] Get the next sibling leaf node. for a device entry.
- <de> The handle to the device entry.
- [RETURNS] The leaf node device entry if it exists, else NULL.
-*/
{
if (de == NULL) return NULL;
if (!de->registered) return NULL;
return de->next;
} /* End Function devfs_get_next_sibling */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_auto_unregister - Configure a devfs entry to be automatically unregistered.
+ * @master: The master devfs entry. Only one slave may be registered.
+ * @slave: The devfs entry which will be automatically unregistered when the
+ * master entry is unregistered. It is illegal to call devfs_unregister()
+ * on this entry.
+ */
+
void devfs_auto_unregister (devfs_handle_t master, devfs_handle_t slave)
-/* [SUMMARY] Configure a devfs entry to be automatically unregistered.
- <master> The master devfs entry. Only one slave may be registered.
- <slave> The devfs entry which will be automatically unregistered when the
- master entry is unregistered. It is illegal to call [<devfs_unregister>] on
- this entry.
- [RETURNS] Nothing.
-*/
{
if (master == NULL) return;
if (master->slave != NULL)
master->slave = slave;
} /* End Function devfs_auto_unregister */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_unregister_slave - Get the slave entry which will be automatically unregistered.
+ * @master: The master devfs entry.
+ *
+ * Returns the slave which will be unregistered when @master is unregistered.
+ */
+
devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master)
-/* [SUMMARY] Get the slave entry which will be automatically unregistered.
- <master> The master devfs entry.
- [RETURNS] The slave which will be unregistered when <<master>> is
- unregistered.
-*/
{
if (master == NULL) return NULL;
return master->slave;
} /* End Function devfs_get_unregister_slave */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_get_name - Get the name for a device entry in its parent directory.
+ * @de: The handle to the device entry.
+ * @namelen: The length of the name is written here. This may be %NULL.
+ *
+ * Returns the name on success, else %NULL.
+ */
+
const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen)
-/* [SUMMARY] Get the name for a device entry in its parent directory.
- <de> The handle to the device entry.
- <namelen> The length of the name is written here. This may be NULL.
- [RETURNS] The name on success, else NULL.
-*/
{
if (de == NULL) return NULL;
if (!de->registered) return NULL;
return de->name;
} /* End Function devfs_get_name */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_register_chrdev - Optionally register a conventional character driver.
+ * @major: The major number for the driver.
+ * @name: The name of the driver (as seen in /proc/devices).
+ * @fops: The &file_operations structure pointer.
+ *
+ * This function will register a character driver provided the "devfs=only"
+ * option was not provided at boot time.
+ * Returns 0 on success, else a negative error code on failure.
+ */
+
int devfs_register_chrdev (unsigned int major, const char *name,
struct file_operations *fops)
-/* [SUMMARY] Optionally register a conventional character driver.
- [PURPOSE] This function will register a character driver provided the
- "devfs=only" option was not provided at boot time.
- <major> The major number for the driver.
- <name> The name of the driver (as seen in /proc/devices).
- <fops> The file_operations structure pointer.
- [RETURNS] 0 on success, else a negative error code on failure.
-*/
{
if (boot_options & OPTION_ONLY) return 0;
return register_chrdev (major, name, fops);
} /* End Function devfs_register_chrdev */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_register_blkdev - Optionally register a conventional block driver.
+ * @major: The major number for the driver.
+ * @name: The name of the driver (as seen in /proc/devices).
+ * @bdops: The &block_device_operations structure pointer.
+ *
+ * This function will register a block driver provided the "devfs=only"
+ * option was not provided at boot time.
+ * Returns 0 on success, else a negative error code on failure.
+ */
+
int devfs_register_blkdev (unsigned int major, const char *name,
struct block_device_operations *bdops)
-/* [SUMMARY] Optionally register a conventional block driver.
- [PURPOSE] This function will register a block driver provided the
- "devfs=only" option was not provided at boot time.
- <major> The major number for the driver.
- <name> The name of the driver (as seen in /proc/devices).
- <bdops> The block_device_operations structure pointer.
- [RETURNS] 0 on success, else a negative error code on failure.
-*/
{
if (boot_options & OPTION_ONLY) return 0;
return register_blkdev (major, name, bdops);
} /* End Function devfs_register_blkdev */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_unregister_chrdev - Optionally unregister a conventional character driver.
+ * major: The major number for the driver.
+ * name: The name of the driver (as seen in /proc/devices).
+ *
+ * This function will unregister a character driver provided the "devfs=only"
+ * option was not provided at boot time.
+ * Returns 0 on success, else a negative error code on failure.
+ */
+
int devfs_unregister_chrdev (unsigned int major, const char *name)
-/* [SUMMARY] Optionally unregister a conventional character driver.
- [PURPOSE] This function will unregister a character driver provided the
- "devfs=only" option was not provided at boot time.
- <major> The major number for the driver.
- <name> The name of the driver (as seen in /proc/devices).
- [RETURNS] 0 on success, else a negative error code on failure.
-*/
{
if (boot_options & OPTION_ONLY) return 0;
return unregister_chrdev (major, name);
} /* End Function devfs_unregister_chrdev */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_unregister_blkdev - Optionally unregister a conventional block driver.
+ * @major: The major number for the driver.
+ * @name: The name of the driver (as seen in /proc/devices).
+ *
+ * This function will unregister a block driver provided the "devfs=only"
+ * option was not provided at boot time.
+ * Returns 0 on success, else a negative error code on failure.
+ */
+
int devfs_unregister_blkdev (unsigned int major, const char *name)
-/* [SUMMARY] Optionally unregister a conventional block driver.
- [PURPOSE] This function will unregister a block driver provided the
- "devfs=only" option was not provided at boot time.
- <major> The major number for the driver.
- <name> The name of the driver (as seen in /proc/devices).
- [RETURNS] 0 on success, else a negative error code on failure.
-*/
{
if (boot_options & OPTION_ONLY) return 0;
return unregister_blkdev (major, name);
#ifndef MODULE
-/*UNPUBLISHED_FUNCTION*/
+/**
+ * devfs_setup - Process kernel boot options.
+ * @str: The boot options after the "devfs=".
+ * @unused: Unused.
+ */
+
SETUP_STATIC int __init devfs_setup (char *str)
-/* [SUMMARY] Process kernel boot options.
- <str> The boot options after the "devfs=".
- <unused> Unused.
- [RETURNS] Nothing.
-*/
{
while ( (*str != '\0') && !isspace (*str) )
{
}
} /* End Function update_devfs_inode_from_entry */
+
+/**
+ * create_devfs_inode - Create a devfs inode entry.
+ * @de: The devfs entry to associate the new inode with.
+ * @fs_info: The FS info.
+ *
+ * Returns a pointer to the devfs inode on success, else %NULL.
+ */
+
static struct devfs_inode *create_devfs_inode (struct devfs_entry *de,
struct fs_info *fs_info)
-/* [SUMMARY] Create a devfs inode entry.
- <de> The devfs entry to associate the new inode with.
- <fs_info> The FS info.
- [RETURNS] A pointer to the devfs inode on success, else NULL.
-*/
{
struct devfs_inode *di, **table;
return di;
} /* End Function create_devfs_inode */
+
+/**
+ * try_modload - Notify devfsd of an inode lookup.
+ * @parent: The parent devfs entry.
+ * @fs_info: The filesystem info.
+ * @name: The device name.
+ * @namelen: The number of characters in @name.
+ * @buf: A working area that will be used. This must not go out of scope until
+ * devfsd is idle again.
+ *
+ * Returns 0 on success, else a negative error code.
+ */
+
static int try_modload (struct devfs_entry *parent, struct fs_info *fs_info,
const char *name, unsigned namelen,
char buf[STRING_LENGTH])
-/* [SUMMARY] Notify devfsd of an inode lookup.
- <parent> The parent devfs entry.
- <fs_info> The filesystem info.
- <name> The device name.
- <namelen> The number of characters in <<name>>.
- <buf> A working area that will be used. This must not go out of scope until
- devfsd is idle again.
- [RETURNS] 0 on success, else a negative error code.
-*/
{
int pos;
kfree (fs_info);
} /* End Function delete_fs */
+
+/**
+ * check_disc_changed - Check if a removable disc was changed.
+ * @de: The device.
+ *
+ * Returns 1 if the media was changed, else 0.
+ */
+
static int check_disc_changed (struct devfs_entry *de)
-/* [SUMMARY] Check if a removable disc was changed.
- <de> The device.
- [RETURNS] 1 if the media was changed, else 0.
-*/
{
int tmp;
kdev_t dev = MKDEV (de->u.fcb.u.device.major, de->u.fcb.u.device.minor);
return 1;
} /* End Function check_disc_changed */
+
+/**
+ * scan_dir_for_removable - Scan a directory for removable media devices and check media.
+ * @dir: The directory.
+ */
+
static void scan_dir_for_removable (struct devfs_entry *dir)
-/* [SUMMARY] Scan a directory for removable media devices and check media.
- <dir> The directory.
- [RETURNS] Nothing.
-*/
{
struct devfs_entry *de;
}
} /* End Function scan_dir_for_removable */
+/**
+ * get_removable_partition - Get removable media partition.
+ * @dir: The parent directory.
+ * @name: The name of the entry.
+ * @namelen: The number of characters in <<name>>.
+ *
+ * Returns 1 if the media was changed, else 0.
+ */
+
static int get_removable_partition (struct devfs_entry *dir, const char *name,
unsigned int namelen)
-/* [SUMMARY] Get removable media partition.
- <dir> The parent directory.
- <name> The name of the entry.
- <namelen> The number of characters in <<name>>.
- [RETURNS] 1 if the media was changed, else 0.
-*/
{
struct devfs_entry *de;
statfs: devfs_statfs,
};
+
+/**
+ * get_vfs_inode - Get a VFS inode.
+ * @sb: The super block.
+ * @di: The devfs inode.
+ * @dentry The dentry to register with the devfs inode.
+ *
+ * Returns the inode on success, else %NULL.
+ */
+
static struct inode *get_vfs_inode (struct super_block *sb,
struct devfs_inode *di,
struct dentry *dentry)
-/* [SUMMARY] Get a VFS inode.
- <sb> The super block.
- <di> The devfs inode.
- <dentry> The dentry to register with the devfs inode.
- [RETURNS] The inode on success, else NULL.
-*/
{
struct inode *inode;
/* Dentry operations for device entries follow */
+
+/**
+ * devfs_d_release - Callback for when a dentry is freed.
+ * @dentry: The dentry.
+ */
+
static void devfs_d_release (struct dentry *dentry)
-/* [SUMMARY] Callback for when a dentry is freed.
-*/
{
#ifdef CONFIG_DEVFS_DEBUG
struct inode *inode = dentry->d_inode;
#endif
} /* End Function devfs_d_release */
+/**
+ * devfs_d_iput - Callback for when a dentry loses its inode.
+ * @dentry: The dentry.
+ * @inode: The inode.
+ */
+
static void devfs_d_iput (struct dentry *dentry, struct inode *inode)
-/* [SUMMARY] Callback for when a dentry loses its inode.
-*/
{
struct devfs_inode *di;
d_revalidate: devfs_d_revalidate_wait,
};
+/**
+ * devfs_d_delete - Callback for when all files for a dentry are closed.
+ * @detry: The dentry.
+ */
+
static void devfs_d_delete (struct dentry *dentry)
-/* [SUMMARY] Callback for when all files for a dentry are closed.
-*/
{
struct inode *inode = dentry->d_inode;
struct devfs_inode *di;
/* Private functions follow */
+/**
+ * _devfs_convert_name - Convert from an old style location-based name to new style.
+ * @new: The new name will be written here.
+ * @old: The old name.
+ * @disc: If true, disc partitioning information should be processed.
+ */
+
static void __init _devfs_convert_name (char *new, const char *old, int disc)
-/* [SUMMARY] Convert from an old style location-based name to new style.
- <new> The new name will be written here.
- <old> The old name.
- <disc> If true, disc partitioning information should be processed.
- [RETURNS] Nothing.
-*/
{
int host, bus, target, lun;
char *ptr;
/* Public functions follow */
-/*PUBLIC_FUNCTION*/
+/**
+ * devfs_make_root - Create the root FS device entry if required.
+ * @name: The name of the root FS device, as passed by "root=".
+ */
+
void __init devfs_make_root (const char *name)
-/* [SUMMARY] Create the root FS device entry if required.
- <name> The name of the root FS device, as passed by "root=".
- [RETURNS] Nothing.
-*/
{
char dest[64];
devfs_mk_symlink (NULL, name, 0, DEVFS_FL_DEFAULT, dest, 0, NULL,NULL);
} /* End Function devfs_make_root */
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_register_tape - Register a tape device in the "/dev/tapes" hierarchy.
+ * @de: Any tape device entry in the device directory.
+ */
+
void devfs_register_tape (devfs_handle_t de)
-/* [SUMMARY] Register a tape device in the "/dev/tapes" hierarchy.
- <de> Any tape device entry in the device directory.
- [RETURNS] Nothing.
-*/
{
int pos;
devfs_handle_t parent, slave;
} /* End Function devfs_register_tape */
EXPORT_SYMBOL(devfs_register_tape);
-/*PUBLIC_FUNCTION*/
+
+/**
+ * devfs_register_series - Register a sequence of device entries.
+ * @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ * new names are relative to the root of the devfs.
+ * @format: The printf-style format string. A single "\%u" is allowed.
+ * @flags: A set of bitwise-ORed flags (DEVFS_FL_*).
+ * @major: The major number. Not needed for regular files.
+ * @minor_start: The starting minor number. Not needed for regular files.
+ * @mode: The default file mode.
+ * @uid: The default UID of the file.
+ * @guid: The default GID of the file.
+ * @ops: The &file_operations or &block_device_operations structure.
+ * This must not be externally deallocated.
+ * @info: An arbitrary pointer which will be written to the private_data
+ * field of the &file structure passed to the device driver. You can set
+ * this to whatever you like, and change it once the file is opened (the next
+ * file opened will not see this change).
+ */
+
void devfs_register_series (devfs_handle_t dir, const char *format,
unsigned int num_entries, unsigned int flags,
unsigned int major, unsigned int minor_start,
umode_t mode, uid_t uid, gid_t gid,
void *ops, void *info)
-/* [SUMMARY] Register a sequence of device entries.
- <dir> The handle to the parent devfs directory entry. If this is NULL the
- new names are relative to the root of the devfs.
- <format> The printf-style format string. A single "%u" is allowed.
- <flags> A set of bitwise-ORed flags (DEVFS_FL_*).
- <major> The major number. Not needed for regular files.
- <minor_start> The starting minor number. Not needed for regular files.
- <mode> The default file mode.
- <uid> The default UID of the file.
- <guid> The default GID of the file.
- <ops> The <<file_operations>> or <<block_device_operations>> structure.
- This must not be externally deallocated.
- <info> An arbitrary pointer which will be written to the <<private_data>>
- field of the <<file>> structure passed to the device driver. You can set
- this to whatever you like, and change it once the file is opened (the next
- file opened will not see this change).
- [RETURNS] Nothing.
-*/
{
unsigned int count;
char devname[128];
* Alan Cox <Alan.Cox@linux.org>, 1995.
* Ingo Molnar <mingo@redhat.com>, 1999, 2000
*/
-#define APIC_PHYS_BASE 0xfee00000 /* IA s/w dev Vol 3, Section 7.4 */
+
+#define APIC_DEFAULT_PHYS_BASE 0xfee00000
#define APIC_ID 0x20
#define GET_APIC_ID(x) (((x)>>24)&0x0F)
*/
/*
- * Special IRQ vectors used by the SMP architecture, 0x30-0x4f
+ * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
*
* some of the following vectors are 'rare', they are merged
* into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
* TLB, reschedule and local APIC vectors are performance-critical.
+ *
+ * Vectors 0xf0-0xfa are free (reserved for future Linux use).
*/
-#define INVALIDATE_TLB_VECTOR 0x30
-#define LOCAL_TIMER_VECTOR 0x31
-#define RESCHEDULE_VECTOR 0x40
-
-/* 'rare' vectors: */
-#define CALL_FUNCTION_VECTOR 0x41
+#define SPURIOUS_APIC_VECTOR 0xff
+#define ERROR_APIC_VECTOR 0xfe
+#define INVALIDATE_TLB_VECTOR 0xfd
+#define RESCHEDULE_VECTOR 0xfc
+#define CALL_FUNCTION_VECTOR 0xfb
/*
- * These IRQs should never really happen on perfect hardware running
- * a perfect kernel, but we nevertheless print a message to catch the
- * rest ;) Subtle, the APIC architecture mandates the spurious vector
- * to have bits 0-3 set to 1. Note that these vectors do not occur
- * normally, so we violate the 'only 2 vectors per priority level'
- * rule here.
+ * Local APIC timer IRQ vector is on a different priority level,
+ * to work around the 'lost local interrupt if more than 2 IRQ
+ * sources per level' errata.
*/
-#define SPURIOUS_APIC_VECTOR 0x3f
-#define ERROR_APIC_VECTOR 0x43
+#define LOCAL_TIMER_VECTOR 0xef
/*
- * First APIC vector available to drivers: (vectors 0x51-0xfe)
- * we start at 0x51 to spread out vectors between priority levels
- * evenly. (note that 0x80 is the syscall vector)
+ * First APIC vector available to drivers: (vectors 0x30-0xee)
+ * we start at 0x31 to spread out vectors evenly between priority
+ * levels. (0x80 is the syscall vector)
*/
-#define IRQ0_TRAP_VECTOR 0x51
+#define FIRST_DEVICE_VECTOR 0x31
+#define FIRST_SYSTEM_VECTOR 0xef
extern int irq_vector[NR_IRQS];
#define IO_APIC_VECTOR(irq) irq_vector[irq]
--- /dev/null
+/*
+ * 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 1999 Ralf Baechle (ralf@gnu.org)
+ * Copyright 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_ARC_TYPES_H
+#define _ASM_ARC_TYPES_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_ARC32
+
+typedef char CHAR;
+typedef short SHORT;
+typedef long LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
+typedef long LONG __attribute__ ((__mode__ (__SI__)));
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long ULONG __attribute__ ((__mode__ (__SI__)));
+typedef void VOID;
+
+/* The pointer types. Note that we're using a 64-bit compiler but all
+ pointer in the ARC structures are only 32-bit, so we need some disgusting
+ workarounds. Keep your vomit bag handy. */
+typedef LONG _PCHAR;
+typedef LONG _PSHORT;
+typedef LONG _PLARGE_INTEGER;
+typedef LONG _PLONG;
+typedef LONG _PUCHAR;
+typedef LONG _PUSHORT;
+typedef LONG _PULONG;
+typedef LONG _PVOID;
+
+#endif /* CONFIG_ARC32 */
+
+#ifdef CONFIG_ARC64
+
+typedef char CHAR;
+typedef short SHORT;
+typedef long LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
+typedef long LONG __attribute__ ((__mode__ (__DI__)));
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long ULONG __attribute__ ((__mode__ (__DI__)));
+typedef void VOID;
+
+/* The pointer types. We're 64-bit and the firmware is also 64-bit, so
+ live is sane ... */
+typedef CHAR *_PCHAR;
+typedef SHORT *_PSHORT;
+typedef LARGE_INTEGER *_PLARGE_INTEGER;
+typedef LONG *_PLONG;
+typedef UCHAR *_PUCHAR;
+typedef USHORT *_PUSHORT;
+typedef ULONG *_PULONG;
+typedef VOID *_PVOID;
+
+#endif /* CONFIG_ARC64 */
+
+typedef CHAR *PCHAR;
+typedef SHORT *PSHORT;
+typedef LARGE_INTEGER *PLARGE_INTEGER;
+typedef LONG *PLONG;
+typedef UCHAR *PUCHAR;
+typedef USHORT *PUSHORT;
+typedef ULONG *PULONG;
+typedef VOID *PVOID;
+
+#endif /* _ASM_ARC_TYPES_H */
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1998 Ralf Baechle
*
- * $Id: asmmacro.h,v 1.4 1999/08/18 23:37:49 ralf Exp $
+ * $Id: asmmacro.h,v 1.3 1998/03/27 04:47:58 ralf Exp $
*/
#ifndef __MIPS_ASMMACRO_H
#define __MIPS_ASMMACRO_H
*
* Copyright (C) 1996, 1997 by Ralf Baechle
*
- * $Id: atomic.h,v 1.7 1999/08/13 17:07:27 harald Exp $
+ * $Id: atomic.h,v 1.6 1999/07/26 19:42:42 harald Exp $
*/
-#ifndef __ASM_MIPS_ATOMIC_H
-#define __ASM_MIPS_ATOMIC_H
+#ifndef __ASM_ATOMIC_H
+#define __ASM_ATOMIC_H
#include <linux/config.h>
-/* $Id: baget.h,v 1.2 1999/04/11 17:03:40 harald Exp $
+/* $Id$
* baget.h: Definitions specific to Baget/MIPS machines.
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
-/* $Id: vac.h,v 1.2 1999/04/11 17:03:40 harald Exp $
+/* $Id$
*
* vac.h: Various VIC controller defines. The VIC is a VME controller
* used in Baget/MIPS series.
-/* $Id: vic.h,v 1.1 1999/01/27 23:59:07 ralf Exp $
+/* $Id$
*
* vic.h: Various VIC controller defines. The VIC is an interrupt controller
* used in Baget/MIPS series.
-/* $Id: bcache.h,v 1.2 1999/08/20 21:59:07 ralf Exp $
+/* $Id$
*
* 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
extern __inline__ int find_next_zero_bit (void * addr, int size, int offset);
extern __inline__ unsigned long ffz(unsigned long word);
-#include <asm/mipsregs.h>
-
#if defined(CONFIG_CPU_HAS_LLSC)
+#include <asm/mipsregs.h>
+
/*
* These functions for MIPS ISA > 1 are interrupt and SMP proof and
* interrupt friendly
-/* $Id: bootinfo.h,v 1.10 2000/01/26 00:07:45 ralf Exp $
+/* $Id: bootinfo.h,v 1.11 2000/03/06 11:14:32 raiko Exp $
*
* bootinfo.h -- Definition of the Linux/MIPS boot information structure
*
#define MACH_GROUP_SGI 6 /* Silicon Graphics workstations and servers */
#define MACH_GROUP_COBALT 7 /* Cobalt servers */
#define MACH_GROUP_NEC_DDB 8 /* NEC DDB */
+#define MACH_GROUP_BAGET 9 /* Baget */
#define GROUP_NAMES { "unknown", "Jazz", "Digital", "ARC", \
- "SNI", "ACN", "SGI", "Cobalt", "NEC DDB" }
+ "SNI", "ACN", "SGI", "Cobalt", "NEC DDB", "Baget" }
/*
* Valid machtype values for group unknown (low order halfword of mips_machtype)
#define GROUP_NEC_DDB_NAMES { "Vrc-5074" }
+/*
+ * Valid machtype for group BAGET
+ */
+#define MACH_BAGET201 0 /* BT23-201 */
+#define MACH_BAGET202 1 /* BT23-202 */
+
+#define GROUP_BAGET_NAMES { "BT23-201", "BT23-202" }
+
/*
* Valid cputype values
*/
*
* Copyright (C) 1996, 1997, 1998 by Ralf Baechle
*
- * $Id: branch.h,v 1.2 1998/05/04 09:13:00 ralf Exp $
+ * $Id: branch.h,v 1.2 1998/04/28 19:37:46 ralf Exp $
*/
#include <asm/ptrace.h>
{
printk("Checking for 'wait' instruction... ");
switch(mips_cputype) {
+ case CPU_R3081:
+ case CPU_R3081E:
+ cpu_wait = r3081_wait;
+ printk(" available.\n");
+ break;
case CPU_R4200:
case CPU_R4300:
case CPU_R4600:
case CPU_R4700:
case CPU_R5000:
case CPU_NEVADA:
- wait_available = 1;
+ cpu_wait = r4k_wait;
printk(" available.\n");
break;
default:
-/* $Id: byteorder.h,v 1.7 1999/01/04 16:09:20 ralf Exp $
+/* $Id: byteorder.h,v 1.8 1998/11/02 09:29:32 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
#include <linux/config.h>
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_R6000)
-#define L1_CACHE_BYTES 16
+#define L1_CACHE_BYTES 16
#else
-#define L1_CACHE_BYTES 32 /* A guess */
+#define L1_CACHE_BYTES 32 /* A guess */
#endif
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
+
#endif /* _ASM_CACHE_H */
-/* $Id: checksum.h,v 1.9 2000/02/18 22:06:19 ralf Exp $
+/* $Id: checksum.h,v 1.8 2000/02/18 00:24:48 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
-/* $Id: cpu.h,v 1.1.1.1 1997/06/01 03:17:12 ralf Exp $
+/* $Id: cpu.h,v 1.1 1996/06/23 09:38:33 dm Exp $
* cpu.h: Values of the PRId register used to match up
* various MIPS cpu types.
*
-/* $Id: current.h,v 1.6 1999/09/28 22:27:17 ralf Exp $
+/* $Id: current.h,v 1.5 1999/07/26 19:42:43 harald 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
* include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*/
extern void ddb5074_led_hex(int hex);
-/* $Id: delay.h,v 1.3 1999/08/18 23:37:49 ralf Exp $
+/* $Id: delay.h,v 1.2 1999/01/04 16:09:20 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
#include <linux/config.h>
+#include <linux/config.h>
+
extern __inline__ void
__delay(unsigned long loops)
{
-/* $Id: div64.h,v 1.1 2000/01/29 01:42:28 ralf Exp $
+/* $Id: div64.h,v 1.1 2000/01/28 23:18:43 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
-/* $Id: dma.h,v 1.7 2000/01/29 01:42:28 ralf Exp $
+/* $Id: dma.h,v 1.6 1999/12/30 14:22:47 raiko Exp $
* linux/include/asm/dma.h: Defines for using and allocating dma channels.
* Written by Hennus Bergman, 1992.
* High DMA channel support & info by Hannu Savolainen
-/* $Id: ds1286.h,v 1.2 1999/08/19 22:56:33 ralf Exp $
+/* $Id: ds1286.h,v 1.1 1998/07/10 01:14:55 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
/*
- * $Id: elf.h,v 1.7 1999/08/20 21:59:08 ralf Exp $
+ * $Id: elf.h,v 1.6 1999/02/15 02:22:10 ralf Exp $
*/
#ifndef __ASM_MIPS_ELF_H
#define __ASM_MIPS_ELF_H
-/* $Id: fcntl.h,v 1.5 1999/01/04 16:09:21 ralf Exp $
+/* $Id: fcntl.h,v 1.4 1998/09/19 19:19:36 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
-/* $Id: floppy.h,v 1.7 1999/08/18 23:37:49 ralf Exp $
+/* $Id: floppy.h,v 1.6 1999/01/04 16:09:21 ralf Exp $
*
* Architecture specific parts of the Floppy driver
*
-/* $Id: fp.h,v 1.2 1999/07/26 19:42:43 harald Exp $
+/* $Id: fp.h,v 1.1 1998/07/16 19:10:04 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
-/* $Id: gdb-stub.h,v 1.3 1998/08/25 09:21:55 ralf Exp $
+/* $Id: gdb-stub.h,v 1.3 1998/07/20 17:52:19 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
-/* $Id: gfx.h,v 1.5 1999/08/19 22:56:33 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: hardirq.h,v 1.7 2000/02/23 00:41:38 ralf Exp $
+/* $Id: hardirq.h,v 1.8 2000/03/02 02:37:13 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
* for more details.
*
- * Copyright (C) 1997, 1998, 1999 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_HARDIRQ_H
#define _ASM_HARDIRQ_H
+#include <linux/config.h>
+
#include <linux/config.h>
#include <linux/threads.h>
+#include <linux/irq.h>
+
+typedef struct {
+ unsigned int __local_irq_count;
+ unsigned int __local_bh_count;
+} ____cacheline_aligned irq_cpustat_t;
-extern unsigned int local_irq_count[NR_CPUS];
+extern irq_cpustat_t irq_stat [NR_CPUS];
+
+/*
+ * Simple wrappers reducing source bloat
+ */
+#define local_irq_count(cpu) (irq_stat[(cpu)].__local_irq_count)
+#define local_bh_count(cpu) (irq_stat[(cpu)].__local_bh_count)
+#define nmi_counter(cpu) (irq_stat[(cpu)].__nmi_counter)
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
*/
#define in_interrupt() ({ int __cpu = smp_processor_id(); \
- (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
-#define in_irq() (local_irq_count[smp_processor_id()] != 0)
+ (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+#define in_irq() (local_irq_count(smp_processor_id()) != 0)
#ifndef CONFIG_SMP
-#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
#define hardirq_endlock(cpu) do { } while (0)
-#define irq_enter(cpu) (local_irq_count[cpu]++)
-#define irq_exit(cpu) (local_irq_count[cpu]--)
+#define irq_enter(cpu) (local_irq_count(cpu)++)
+#define irq_exit(cpu) (local_irq_count(cpu)--)
#define synchronize_irq() barrier();
-/* $Id: hdreg.h,v 1.1 1999/06/17 14:09:00 ralf Exp $
+/* $Id: hdreg.h,v 1.4 1998/05/08 21:05:26 davem Exp $
*
* linux/include/asm-mips/hdreg.h
*
-/* $Id: highmem.h,v 1.2 2000/01/29 01:42:28 ralf Exp $
+/* $Id: highmem.h,v 1.1 2000/01/27 01:05:37 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
--- /dev/null
+/* This exists merely to satisfy <linux/irq.h>. There is
+ nothing that would go here of general interest.
+
+ Everything of consequence is in arch/alpha/kernel/irq_impl.h,
+ to be used only in arch/alpha/kernel/. */
#include <linux/config.h>
#ifndef MAX_HWIFS
+# ifdef CONFIG_BLK_DEV_IDEPCI
+#define MAX_HWIFS 10
+# else
#define MAX_HWIFS 6
+# endif
#endif
#define ide__sti() __sti()
/*
- * $Id: inventory.h,v 1.2 1997/12/06 23:55:49 ralf Exp $
+ * $Id:$
*/
#ifndef __ASM_MIPS_INVENTORY_H
#define __ASM_MIPS_INVENTORY_H
-/* $Id: ioctls.h,v 1.8 1998/08/25 09:21:56 ralf Exp $
+/* $Id: ioctls.h,v 1.5 1998/08/19 21:58:11 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
-/* $Id: irq.h,v 1.7 2000/02/23 00:41:38 ralf Exp $
+/* $Id: irq.h,v 1.6 2000/01/26 00:07:45 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
*
* Copyright (c) 1998 Harald Koerfgen
*
- * $Id: isadep.h,v 1.2 1999/08/13 17:07:27 harald Exp $
+ * $Id: isadep.h,v 1.1 1999/07/26 19:46:00 harald Exp $
*/
#include <linux/config.h>
-/* $Id: jazz.h,v 1.10 1998/10/18 13:16:02 tsbogend Exp $
+/* $Id: jazz.h,v 1.9 1998/09/19 19:19:37 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
/*
* Helpfile for jazzdma.c -- Mips Jazz R4030 DMA controller support
*
- * $Id: jazzdma.h,v 1.6 1998/03/04 09:51:22 ralf Exp $
+ * $Id:$
*/
#ifndef __ASM_MIPS_JAZZDMA_H
#define __ASM_MIPS_JAZZDMA_H
-/* $Id: linux_logo.h,v 1.4 1999/01/04 16:09:23 ralf Exp $
+/* $Id: linux_logo.h,v 1.3 1998/09/19 19:19:38 ralf Exp $
*
* include/asm-mips/linux_logo.h: This is a linux logo
* to be displayed on boot.
-/* $Id: mc146818rtc.h,v 1.3 1999/08/19 22:56:33 ralf Exp $
+/* $Id: mc146818rtc.h,v 1.2 1998/06/30 00:23:10 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
#define CP0_RANDOM $1
#define CP0_ENTRYLO0 $2
#define CP0_ENTRYLO1 $3
+#define CP0_CONF $3
#define CP0_CONTEXT $4
#define CP0_PAGEMASK $5
#define CP0_WIRED $6
#define CONF_DB (1 << 4)
#define CONF_IB (1 << 5)
#define CONF_SC (1 << 17)
+#define CONF_AC (1 << 23)
+#define CONF_HALT (1 << 25)
/*
* R10000 performance counter definitions.
#define MCL_CURRENT 1 /* lock all current mappings */
#define MCL_FUTURE 2 /* lock all future mappings */
+#define MADV_NORMAL 0x0 /* default page-in behavior */
+#define MADV_RANDOM 0x1 /* page-in minimum required */
+#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
+#define MADV_WILLNEED 0x3 /* pre-fault pages */
+#define MADV_DONTNEED 0x4 /* discard these pages */
+
/* compatibility flags */
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FILE 0
-/* $Id: mmu_context.h,v 1.8 2000/02/23 00:41:38 ralf Exp $
+/* $Id: mmu_context.h,v 1.7 2000/02/04 07:40:53 ralf Exp $
*
* Switch a MMU context.
*
*
* Included from linux/fs/namei.c
*
- * $Id: namei.h,v 1.7 1999/06/17 13:30:37 ralf Exp $
+ * $Id: namei.h,v 1.6 1999/01/04 16:09:23 ralf Exp $
*/
#ifndef __ASM_MIPS_NAMEI_H
#define __ASM_MIPS_NAMEI_H
-/* $Id: ng1.h,v 1.4 1999/08/19 22:56:33 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: ng1hw.h,v 1.5 1999/11/07 10:18:31 ulfc Exp $
+/* $Id: ng1hw.h,v 1.4 1999/08/04 06:01:51 ulfc Exp $
*
* ng1hw.h: Tweaks the newport.h structures and definations to be compatible
* with IRIX. Quite ugly, but it works.
* asm-mips/nile4.h -- NEC Vrc-5074 Nile 4 definitions
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* This file is based on the following documentation:
*
* $Id: nile4.h,v 1.1 2000/01/26 00:07:45 ralf Exp $
*/
-#include <asm/addrspace.h>
-
#define NILE4_BASE 0xbfa00000
#define NILE4_SIZE 0x00200000 /* 2 MB */
#define TASK_COUNTER 32
#define TASK_PRIORITY 36
#define TASK_MM 44
-#define TASK_STRUCT_SIZE 904
+#define TASK_STRUCT_SIZE 880
/* MIPS specific thread_struct offsets. */
#define THREAD_REG16 584
/* Linux mm_struct offsets. */
#define MM_USERS 16
#define MM_PGD 12
-#define MM_CONTEXT 64
+#define MM_CONTEXT 68
/* Linux sigcontext offsets. */
#define SC_REGS 16
--- /dev/null
+/* $Id: paccess.h,v 1.1 2000/04/07 12:55:57 raiko 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
+ * for more details.
+ *
+ * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ *
+ * Protected memory access. Used for everything that might take revenge
+ * by sending a DBE error like accessing possibly non-existant memory or
+ * devices.
+ */
+#ifndef _ASM_PACCESS_H
+#define _ASM_PACCESS_H
+
+#include <linux/errno.h>
+
+#define put_dbe(x,ptr) __put_dbe((x),(ptr),sizeof(*(ptr)))
+#define get_dbe(x,ptr) __get_dbe((x),(ptr),sizeof(*(ptr)))
+
+struct __large_pstruct { unsigned long buf[100]; };
+#define __mp(x) (*(struct __large_pstruct *)(x))
+
+#define __get_dbe(x,ptr,size) ({ \
+int __gu_err; \
+__typeof(*(ptr)) __gu_val; \
+unsigned long __gu_addr; \
+__asm__("":"=r" (__gu_val)); \
+__gu_addr = (unsigned long) (ptr); \
+__asm__("":"=r" (__gu_err)); \
+switch (size) { \
+case 1: __get_dbe_asm("lb"); break; \
+case 2: __get_dbe_asm("lh"); break; \
+case 4: __get_dbe_asm("lw"); break; \
+case 8: __get_dbe_asm("ld"); break; \
+default: __get_dbe_unknown(); break; \
+} x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
+
+#define __get_dbe_asm(insn) \
+({ \
+__asm__ __volatile__( \
+ ".set\tpush\n\t" \
+ ".set\tnoreorder\n\t" \
+ insn "\t%1,%2\n\t" \
+ "1:\tmove\t%0,$0\n" \
+ ".set\tpop\n\t" \
+ "2:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "3:\tli\t%0,%3\n\t" \
+ "move\t%1,$0\n\t" \
+ "j\t2b\n\t" \
+ ".previous\n\t" \
+ ".section\t__dbe_table,\"a\"\n\t" \
+ ".word\t1b-4,3b\n\t" \
+ ".previous" \
+ :"=r" (__gu_err), "=r" (__gu_val) \
+ :"o" (__mp(__gu_addr)), "i" (-EFAULT)); })
+
+extern void __get_dbe_unknown(void);
+
+#define __put_dbe(x,ptr,size) ({ \
+int __pu_err; \
+__typeof__(*(ptr)) __pu_val; \
+unsigned long __pu_addr; \
+__pu_val = (x); \
+__pu_addr = (unsigned long) (ptr); \
+__asm__("":"=r" (__pu_err)); \
+switch (size) { \
+case 1: __put_dbe_asm("sb"); break; \
+case 2: __put_dbe_asm("sh"); break; \
+case 4: __put_dbe_asm("sw"); break; \
+case 8: __put_dbe_asm("sd"); break; \
+default: __put_dbe_unknown(); break; \
+} __pu_err; })
+
+#define __put_dbe_asm(insn) \
+({ \
+__asm__ __volatile__( \
+ ".set\tpush\n\t" \
+ ".set\tnoreorder\n\t" \
+ insn "\t%1,%2\n\t" \
+ "1:\tmove\t%0,$0\n" \
+ ".set\tpop\n\t" \
+ "2:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "3:\tli\t%0,%3\n\t" \
+ "j\t2b\n\t" \
+ ".previous\n\t" \
+ ".section\t__dbe_table,\"a\"\n\t" \
+ ".word\t1b-4,3b\n\t" \
+ ".previous" \
+ :"=r" (__pu_err) \
+ :"r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); })
+
+extern void __put_dbe_unknown(void);
+
+#endif /* _ASM_PACCESS_H */
-/* $Id: parport.h,v 1.2 2000/02/18 00:24:48 ralf Exp $
- *
- * parport.h: ia32-specific parport initialisation
+/* $Id$
*
* Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
*
* This file should only be included by drivers/parport/parport_pc.c.
*/
#ifndef _ASM_PARPORT_H
-#define _ASM_PARPORT_H 1
+#define _ASM_PARPORT_H
static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
return parport_pc_find_isa_ports (autoirq, autodma);
}
-#endif /* !(_ASM_PARPORT_H) */
+#endif /* _ASM_PARPORT_H */
-/* $Id: pci.h,v 1.9 2000/02/24 00:13:19 ralf Exp $
+/* $Id: pci.h,v 1.10 2000/03/23 02:26: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
#include <linux/string.h>
#include <asm/io.h>
+#ifdef CONFIG_DDB5074
+#undef PCIBIOS_MIN_IO
+#undef PCIBIOS_MIN_MEM
+#define PCIBIOS_MIN_IO 0x0100000
+#define PCIBIOS_MIN_MEM 0x1000000
+#endif
+
struct pci_dev;
/*
-/* $Id: pgalloc.h,v 1.4 2000/02/24 00:13:19 ralf Exp $
+/* $Id: pgalloc.h,v 1.3 2000/02/23 00:41:38 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
#include <linux/config.h>
+#include <linux/config.h>
+
/* TLB flushing:
*
* - flush_tlb_all() flushes all processes TLB entries
-/* $Id: pgtable.h,v 1.30 2000/02/24 00:13:19 ralf Exp $
+/* $Id: pgtable.h,v 1.31 2000/03/02 02:37:13 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
extern int do_check_pgt_cache(int, int);
extern pgd_t swapper_pg_dir[1024];
+extern void paging_init(void);
extern void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte);
-/* $Id: posix_types.h,v 1.7 2000/02/16 01:07:48 ralf Exp $
+/* $Id: posix_types.h,v 1.6 2000/02/04 23:32:54 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
*
* The IRIX kernel maps a page at PRDA_ADDRESS with the
* contents of prda and fills it the bits on prda_sys.
- * $Id: prctl.h,v 1.1 1997/09/21 22:27:19 miguel Exp $
+ * $Id$
*/
#ifndef __PRCTL_H__
#ifndef _ASM_PROCESSOR_H
#define _ASM_PROCESSOR_H
+#include <linux/config.h>
+
#include <asm/isadep.h>
#include <linux/config.h>
* System setup and hardware flags..
* XXX: Should go into mips_cpuinfo.
*/
-extern char wait_available; /* only available on R4[26]00 */
+extern void (*cpu_wait)(void); /* only available on R4[26]00 and R3081 */
+extern void r3081_wait(void);
+extern void r4k_wait(void);
extern char cyclecounter_available; /* only available from R4000 upwards. */
extern char dedicated_iv_available; /* some embedded MIPS like Nevada */
extern char vce_available; /* Supports VCED / VCEI exceptions */
-/* $Id: ptrace.h,v 1.8 1999/10/12 17:33:50 harald Exp $
+/* $Id: ptrace.h,v 1.7 1999/09/28 22:27:17 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
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: r4kcache.h,v 1.5 1998/03/04 05:36:23 ralf Exp $
+ * $Id: r4kcache.h,v 1.7 1997/12/18 13:00:45 ralf Exp $
*
* FIXME: Handle split L2 caches.
*/
-/* $Id: resource.h,v 1.5 2000/02/04 07:40:53 ralf Exp $
+/* $Id: resource.h,v 1.4 2000/01/27 23:45:30 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
-/* $Id: semaphore-helper.h,v 1.7 1999/10/21 00:23:05 ralf Exp $
+/* $Id: semaphore-helper.h,v 1.6 1999/10/20 21:10:58 ralf Exp $
*
* SMP- and interrupt-safe semaphores helper functions.
*
"sc\t%0, %2\n\t"
"beqz\t%0, 1b\n\t"
"2:"
- ".text"
: "=r"(ret), "=r"(tmp), "=m"(__atomic_fool_gcc(&sem->waking))
: "0"(0));
-/* $Id: semaphore.h,v 1.13 2000/02/18 00:24:48 ralf Exp $
+/* $Id: semaphore.h,v 1.12 1999/12/08 22:05:10 harald Exp $
*
* SMP- and interrupt-safe semaphores..
*
#if WAITQUEUE_DEBUG
long __magic;
#endif
-};
+} __attribute__((aligned(8)));
#if WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) \
/* $Id: serial.h,v 1.9 2000/02/16 01:45:55 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
+ * for more details.
*
* Copyright (C) 1999 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
-/* $Id: sgi.h,v 1.1 1999/10/21 00:23:05 ralf Exp $
+/* $Id: sgi.h,v 1.1.1.1 1997/06/01 03:17:12 ralf Exp $
* sgi.h: Definitions specific to SGI machines.
*
* Copyright (C) 1996 David S. Miller (dm@sgi.com)
/* An HPC dma descriptor. */
struct hpc_dma_desc {
- unsigned long pbuf; /* physical address of data buffer */
- unsigned long cntinfo; /* counter and info bits */
+ unsigned int pbuf; /* physical address of data buffer */
+ unsigned int cntinfo; /* counter and info bits */
#define HPCDMA_EOX 0x80000000 /* last desc in chain for tx */
#define HPCDMA_EOR 0x80000000 /* last desc in chain for rx */
#define HPCDMA_EOXP 0x40000000 /* end of packet for tx */
#define HPCDMA_OWN 0x00004000 /* Denotes ring buffer ownership on rx */
#define HPCDMA_BCNT 0x00003fff /* size in bytes of this dma buffer */
- unsigned long pnext; /* paddr of next hpc_dma_desc if any */
+ unsigned int pnext; /* paddr of next hpc_dma_desc if any */
};
-typedef volatile unsigned long hpcreg;
+typedef volatile unsigned int hpcreg;
/* HPC1 stuff. */
-/* $Id: sgimc.h,v 1.2 1999/12/06 23:13:21 ralf Exp $
+/* $Id: sgimc.h,v 1.1.1.1 1997/06/01 03:17:13 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
+ * for more details.
+ *
* sgimc.h: Definitions for memory controller hardware found on
* SGI IP20, IP22, IP26, and IP28 machines.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 1999 Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*/
-
-#ifndef _MIPS_SGIMC_H
-#define _MIPS_SGIMC_H
+#ifndef _ASM_SGI_SGIMC_H
+#define _ASM_SGI_SGIMC_H
struct sgimc_misc_ctrl {
- unsigned long _unused1;
- volatile unsigned long cpuctrl0; /* CPU control register 0, readwrite */
+ u32 _unused1;
+ volatile u32 cpuctrl0; /* CPU control register 0, readwrite */
#define SGIMC_CCTRL0_REFS 0x0000000f /* REFS mask */
#define SGIMC_CCTRL0_EREFRESH 0x00000010 /* Memory refresh enable */
#define SGIMC_CCTRL0_EPERRGIO 0x00000020 /* GIO parity error enable */
#define SGIMC_CCTRL0_R4KNOCHKPARR 0x04000000 /* Don't chk parity on mem data reads */
#define SGIMC_CCTRL0_GIOBTOB 0x08000000 /* Allow GIO back to back writes */
- unsigned long _unused2;
- volatile unsigned long cpuctrl1; /* CPU control register 1, readwrite */
+ u32 _unused2;
+ volatile u32 cpuctrl1; /* CPU control register 1, readwrite */
#define SGIMC_CCTRL1_EGIOTIMEO 0x00000010 /* GIO bus timeout enable */
#define SGIMC_CCTRL1_FIXEDEHPC 0x00001000 /* Fixed HPC endianness */
#define SGIMC_CCTRL1_LITTLEHPC 0x00002000 /* Little endian HPC */
#define SGIMC_CCTRL1_FIXEDEEXP1 0x00010000 /* Fixed EXP1 endianness */
#define SGIMC_CCTRL1_LITTLEEXP1 0x00020000 /* Little endian EXP1 */
- unsigned long _unused3;
- volatile unsigned long watchdogt; /* Watchdog reg rdonly, write clears */
+ u32 _unused3;
+ volatile u32 watchdogt; /* Watchdog reg rdonly, write clears */
- unsigned long _unused4;
- volatile unsigned long systemid; /* MC system ID register, readonly */
+ u32 _unused4;
+ volatile u32 systemid; /* MC system ID register, readonly */
#define SGIMC_SYSID_MASKREV 0x0000000f /* Revision of MC controller */
#define SGIMC_SYSID_EPRESENT 0x00000010 /* Indicates presence of EISA bus */
- unsigned long _unused5[3];
- volatile unsigned long divider; /* Divider reg for RPSS */
+ u32 _unused5[3];
+ volatile u32 divider; /* Divider reg for RPSS */
- unsigned long _unused6;
+ u32 _unused6;
volatile unsigned char eeprom; /* EEPROM byte reg for r4k */
#define SGIMC_EEPROM_PRE 0x00000001 /* eeprom chip PRE pin assertion */
#define SGIMC_EEPROM_CSEL 0x00000002 /* Active high, eeprom chip select */
#define SGIMC_EEPROM_SDATAI 0x00000010 /* Serial EEPROM data-in */
unsigned char _unused7[3];
- unsigned long _unused8[3];
+ u32 _unused8[3];
volatile unsigned short rcntpre; /* Preload refresh counter */
unsigned short _unused9;
- unsigned long _unused9a;
+ u32 _unused9a;
volatile unsigned short rcounter; /* Readonly refresh counter */
unsigned short _unused10;
- unsigned long _unused11[13];
- volatile unsigned long gioparm; /* Parameter word for GIO64 */
+ u32 _unused11[13];
+ volatile u32 gioparm; /* Parameter word for GIO64 */
#define SGIMC_GIOPARM_HPC64 0x00000001 /* HPC talks to GIO using 64-bits */
#define SGIMC_GIOPARM_GFX64 0x00000002 /* GFX talks to GIO using 64-bits */
#define SGIMC_GIOPARM_EXP064 0x00000004 /* EXP(slot0) talks using 64-bits */
#define SGIMC_GIOPARM_PLINEEXP0 0x00004000 /* EXP(slot0) has pipeline attr */
#define SGIMC_GIOPARM_PLINEEXP1 0x00008000 /* EXP(slot1) has pipeline attr */
- unsigned long _unused13;
+ u32 _unused13;
volatile unsigned short cputp; /* CPU bus arb time period */
unsigned short _unused14;
- unsigned long _unused15[3];
+ u32 _unused15[3];
volatile unsigned short lbursttp; /* Time period for long bursts */
unsigned short _unused16;
- unsigned long _unused17[9];
- volatile unsigned long mconfig0; /* Memory config register zero */
- unsigned long _unused18;
- volatile unsigned long mconfig1; /* Memory config register one */
+ u32 _unused17[9];
+ volatile u32 mconfig0; /* Memory config register zero */
+ u32 _unused18;
+ volatile u32 mconfig1; /* Memory config register one */
/* These defines apply to both mconfig registers above. */
#define SGIMC_MCONFIG_FOURMB 0x00000000 /* Physical ram = 4megs */
#define SGIMC_MCONFIG_OTEIGHTMB 0x00001f00 /* Physical ram = 128megs */
#define SGIMC_MCONFIG_RMASK 0x00001f00 /* Ram config bitmask */
- unsigned long _unused19;
- volatile unsigned long cmacc; /* Mem access config for CPU */
- unsigned long _unused20;
- volatile unsigned long gmacc; /* Mem access config for GIO */
+ u32 _unused19;
+ volatile u32 cmacc; /* Mem access config for CPU */
+ u32 _unused20;
+ volatile u32 gmacc; /* Mem access config for GIO */
/* This define applies to both cmacc and gmacc registers above. */
#define SGIMC_MACC_ALIASBIG 0x20000000 /* 512MB home for alias */
/* Error address/status regs from GIO and CPU perspectives. */
- unsigned long _unused21;
- volatile unsigned long cerr; /* Error address reg for CPU */
- unsigned long _unused22;
- volatile unsigned long cstat; /* Status reg for CPU */
- unsigned long _unused23;
- volatile unsigned long gerr; /* Error address reg for GIO */
- unsigned long _unused24;
- volatile unsigned long gstat; /* Status reg for GIO */
+ u32 _unused21;
+ volatile u32 cerr; /* Error address reg for CPU */
+ u32 _unused22;
+ volatile u32 cstat; /* Status reg for CPU */
+ u32 _unused23;
+ volatile u32 gerr; /* Error address reg for GIO */
+ u32 _unused24;
+ volatile u32 gstat; /* Status reg for GIO */
/* Special hard bus locking registers. */
- unsigned long _unused25;
+ u32 _unused25;
volatile unsigned char syssembit; /* Uni-bit system semaphore */
unsigned char _unused26[3];
- unsigned long _unused27;
+ u32 _unused27;
volatile unsigned char mlock; /* Global GIO memory access lock */
unsigned char _unused28[3];
- unsigned long _unused29;
+ u32 _unused29;
volatile unsigned char elock; /* Locks EISA from GIO accesses */
/* GIO dma control registers. */
unsigned char _unused30[3];
- unsigned long _unused31[14];
- volatile unsigned long gio_dma_trans;/* DMA mask to translation GIO addrs */
- unsigned long _unused32;
- volatile unsigned long gio_dma_sbits;/* DMA GIO addr substitution bits */
- unsigned long _unused33;
- volatile unsigned long dma_intr_cause; /* DMA IRQ cause indicator bits */
- unsigned long _unused34;
- volatile unsigned long dma_ctrl; /* Main DMA control reg */
+ u32 _unused31[14];
+ volatile u32 gio_dma_trans;/* DMA mask to translation GIO addrs */
+ u32 _unused32;
+ volatile u32 gio_dma_sbits;/* DMA GIO addr substitution bits */
+ u32 _unused33;
+ volatile u32 dma_intr_cause; /* DMA IRQ cause indicator bits */
+ u32 _unused34;
+ volatile u32 dma_ctrl; /* Main DMA control reg */
/* DMA TLB entry 0 */
- unsigned long _unused35;
- volatile unsigned long dtlb_hi0;
- unsigned long _unused36;
- volatile unsigned long dtlb_lo0;
+ u32 _unused35;
+ volatile u32 dtlb_hi0;
+ u32 _unused36;
+ volatile u32 dtlb_lo0;
/* DMA TLB entry 1 */
- unsigned long _unused37;
- volatile unsigned long dtlb_hi1;
- unsigned long _unused38;
- volatile unsigned long dtlb_lo1;
+ u32 _unused37;
+ volatile u32 dtlb_hi1;
+ u32 _unused38;
+ volatile u32 dtlb_lo1;
/* DMA TLB entry 2 */
- unsigned long _unused39;
- volatile unsigned long dtlb_hi2;
- unsigned long _unused40;
- volatile unsigned long dtlb_lo2;
+ u32 _unused39;
+ volatile u32 dtlb_hi2;
+ u32 _unused40;
+ volatile u32 dtlb_lo2;
/* DMA TLB entry 3 */
- unsigned long _unused41;
- volatile unsigned long dtlb_hi3;
- unsigned long _unused42;
- volatile unsigned long dtlb_lo3;
+ u32 _unused41;
+ volatile u32 dtlb_hi3;
+ u32 _unused42;
+ volatile u32 dtlb_lo3;
};
/* MC misc control registers live at physical 0x1fa00000. */
extern struct sgimc_misc_ctrl *mcmisc_regs;
-extern u32 *rpsscounter; /* Chirps at 100ns */
+extern u32 *rpsscounter; /* Chirps at 100ns */
struct sgimc_dma_ctrl {
- unsigned long _unused1;
- volatile unsigned long maddronly; /* Address DMA goes at */
- unsigned long _unused2;
- volatile unsigned long maddrpdeflts; /* Same as above, plus set defaults */
- unsigned long _unused3;
- volatile unsigned long dmasz; /* DMA count */
- unsigned long _unused4;
- volatile unsigned long ssize; /* DMA stride size */
- unsigned long _unused5;
- volatile unsigned long gmaddronly; /* Set GIO DMA but do not start trans */
- unsigned long _unused6;
- volatile unsigned long dmaddnpgo; /* Set GIO DMA addr + start transfer */
- unsigned long _unused7;
- volatile unsigned long dmamode; /* DMA mode config bit settings */
- unsigned long _unused8;
- volatile unsigned long dmacount; /* Zoom and byte count for DMA */
- unsigned long _unused9;
- volatile unsigned long dmastart; /* Pedal to the metal. */
- unsigned long _unused10;
- volatile unsigned long dmarunning; /* DMA op is in progress */
- unsigned long _unused11;
+ u32 _unused1;
+ volatile u32 maddronly; /* Address DMA goes at */
+ u32 _unused2;
+ volatile u32 maddrpdeflts; /* Same as above, plus set defaults */
+ u32 _unused3;
+ volatile u32 dmasz; /* DMA count */
+ u32 _unused4;
+ volatile u32 ssize; /* DMA stride size */
+ u32 _unused5;
+ volatile u32 gmaddronly; /* Set GIO DMA but do not start trans */
+ u32 _unused6;
+ volatile u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */
+ u32 _unused7;
+ volatile u32 dmamode; /* DMA mode config bit settings */
+ u32 _unused8;
+ volatile u32 dmacount; /* Zoom and byte count for DMA */
+ u32 _unused9;
+ volatile u32 dmastart; /* Pedal to the metal. */
+ u32 _unused10;
+ volatile u32 dmarunning; /* DMA op is in progress */
+ u32 _unused11;
/* Set dma addr, defaults, and kick it */
- volatile unsigned long maddr_defl_go; /* go go go! -lm */
+ volatile u32 maddr_defl_go; /* go go go! -lm */
};
/* MC controller dma regs live at physical 0x1fa02000. */
#define SGIMC_SEG1_BADDR 0x20000000
/* Maximum size of the above banks are per machine. */
-extern unsigned long sgimc_seg0_size, sgimc_seg1_size;
+extern u32 sgimc_seg0_size, sgimc_seg1_size;
#define SGIMC_SEG0_SIZE_ALL 0x10000000 /* 256MB */
#define SGIMC_SEG1_SIZE_IP20_IP22 0x08000000 /* 128MB */
#define SGIMC_SEG1_SIZE_IP26_IP28 0x20000000 /* 512MB */
extern void sgimc_init(void);
-#endif /* !(_MIPS_SGIMC_H) */
+#endif /* _ASM_SGI_SGIMC_H */
-/* $Id: sgint23.h,v 1.1 1999/10/21 00:23:05 ralf Exp $
+/* $Id: sgint23.h,v 1.4 1999/09/28 21:02:12 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
+ * for more details.
*
* sgint23.h: Defines for the SGI INT2 and INT3 chipsets.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - INT2 corrections
*/
-#ifndef _ASM_SGINT23_H
-#define _ASM_SGINT23_H
+#ifndef _ASM_SGI_SGINT23_H
+#define _ASM_SGI_SGINT23_H
/* These are the virtual IRQ numbers, we divide all IRQ's into
* 'spaces', the 'space' determines where and how to enable/disable
struct sgi_int2_regs {
struct sgi_ioc_ints ints;
- volatile unsigned long ledbits; /* LED control bits */
+ volatile u32 ledbits; /* LED control bits */
#define INT2_LED_TXCLK 0x01 /* GPI to TXCLK enable */
#define INT2_LED_SERSLCT0 0x02 /* serial port0: 0=apple 1=pc */
#define INT2_LED_SERSLCT1 0x04 /* serial port1: 0=apple 1=pc */
/* I am guesing there are only two unused registers here
* but I could be wrong... - andrewb
*/
-/* unsigned long _unused[3]; */
- unsigned long _unused[2];
+/* u32 _unused[3]; */
+ u32 _unused[2];
struct sgi_ioc_timers timers;
};
#ifdef __MIPSEB__
unsigned char _unused0[3];
- volatile unsigned char tclear; /* Timer clear strobe address */
+ volatile unsigned char tclear; /* Timer clear strobe address */
#else
- volatile unsigned char tclear; /* Timer clear strobe address */
+ volatile unsigned char tclear; /* Timer clear strobe address */
unsigned char _unused0[3];
#endif
- volatile unsigned long estatus; /* Error status reg */
- unsigned long _unused1[2];
+ volatile u32 estatus; /* Error status reg */
+ u32 _unused1[2];
struct sgi_ioc_timers timers;
};
-/* $Id: sgialib.h,v 1.4 1999/02/25 20:55:07 tsbogend Exp $
+/* $Id: sgialib.h,v 1.5 2000/03/19 01:28:58 ralf Exp $
* sgialib.h: SGI ARCS firmware interface library for the Linux kernel.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*/
-#ifndef _MIPS_SGIALIB_H
-#define _MIPS_SGIALIB_H
+#ifndef _ASM_SGIALIB_H
+#define _ASM_SGIALIB_H
#include <asm/sgiarcs.h>
extern int prom_flags;
#define PROM_FLAG_ARCS 1
-/* Init the PROM library and it's internal data structures. Called
+/*
+ * Init the PROM library and it's internal data structures. Called
* at boot time from head.S before start_kernel is invoked.
*/
-extern int prom_init(int argc, char **argv, char **envp);
+extern int prom_init(int argc, char **argv, char **envp, int *prom_vec);
/* Simple char-by-char console I/O. */
extern void prom_putchar(char c);
extern void prom_identify_arch(void);
/* Environemt variable routines. */
-extern char *prom_getenv(char *name);
-extern long prom_setenv(char *name, char *value);
+extern PCHAR ArcGetEnvironmentVariable(CHAR *name);
+extern LONG SetEnvironmentVariable(PCHAR name, PCHAR value);
/* ARCS command line acquisition and parsing. */
extern char *prom_getcmdline(void);
extern struct linux_sysid *prom_getsysid(void);
extern void prom_cacheflush(void);
-#endif /* !(_MIPS_SGIALIB_H) */
+#endif /* _ASM_SGIALIB_H */
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*/
+#ifndef _ASM_SGIARCS_H
+#define _ASM_SGIARCS_H
-#ifndef _MIPS_SGIARCS_H
-#define _MIPS_SGIARCS_H
+#include <asm/arc/types.h>
/* Various ARCS error codes. */
#define PROM_ESUCCESS 0x00
long (*mount)(char *file, enum linux_mountops op);
/* Dealing with firmware environment variables. */
- char *(*get_evar)(char *name);
- long (*set_evar)(char *name, char *value);
+ PCHAR (*get_evar)(CHAR *name);
+ LONG (*set_evar)(PCHAR name, PCHAR value);
long (*get_finfo)(unsigned long fd, struct linux_finfo *buf);
long (*set_finfo)(unsigned long fd, unsigned long flags,
int smax; /* Max # of symbols. */
};
-#endif /* !(_MIPS_SGIARCS_H) */
+#endif /* _ASM_SGIARCS_H */
-/* $Id: shmparam.h,v 1.3 2000/01/29 01:42:28 ralf Exp $
+/* $Id: shmparam.h,v 1.3 2000/01/28 19:46:32 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
-/*
- * include/asm-mips/sigcontext.h
+/* $Id: sigcontext.h,v 1.5 1997/12/16 05:36:43 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
* for more details.
*
- * Copyright (C) 1996, 1997 by Ralf Baechle
- *
- * $Id: sigcontext.h,v 1.5 1997/12/16 05:36:43 ralf Exp $
+ * Copyright (C) 1996, 1997, 2000 by Ralf Baechle
*/
-#ifndef __ASM_MIPS_SIGCONTEXT_H
-#define __ASM_MIPS_SIGCONTEXT_H
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
/*
* Keep this struct definition in sync with the sigcontext fragment
unsigned long sc_sigset[4]; /* kernel's sigset_t */
};
-#endif /* __ASM_MIPS_SIGCONTEXT_H */
+#endif /* _ASM_SIGCONTEXT_H */
-/* $Id: siginfo.h,v 1.6 2000/02/18 00:24:48 ralf Exp $
+/* $Id: siginfo.h,v 1.5 1999/08/18 23:37:49 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
-/* $Id: signal.h,v 1.7 1999/09/28 22:27:17 ralf Exp $
+/* $Id: signal.h,v 1.6 1999/08/18 23:37:49 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
-/* $Id: sni.h,v 1.3 1999/01/04 16:09:26 ralf Exp $
+/* $Id: sni.h,v 1.2 1998/09/19 19:19:39 ralf Exp $
*
* SNI specific definitions
*
/*
- * $Id: socket.h,v 1.5 1998/03/17 22:16:17 ralf Exp $
+ * $Id: socket.h,v 1.6 2000/02/25 21:52:09 ralf Exp $
*/
-#ifndef __ASM_MIPS_SOCKET_H
-#define __ASM_MIPS_SOCKET_H
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
#include <asm/sockios.h>
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
+#ifdef __KERNEL__
+
#define SO_PEERNAME 28
/* Types of sockets. */
the dev level. For writing rarp and
other similar things on the user level. */
-#endif /* __ASM_MIPS_SOCKET_H */
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_SOCKET_H */
#include <asm/atomic.h>
#include <asm/hardirq.h>
-extern unsigned int local_bh_count[NR_CPUS];
-
-#define cpu_bh_disable(cpu) do { local_bh_count[(cpu)]++; barrier(); } while (0)
-#define cpu_bh_enable(cpu) do { barrier(); local_bh_count[(cpu)]--; } while (0)
+#define cpu_bh_disable(cpu) do { local_bh_count(cpu)++; barrier(); } while (0)
+#define cpu_bh_enable(cpu) do { barrier(); local_bh_count(cpu)--; } while (0)
#define local_bh_disable() cpu_bh_disable(smp_processor_id())
#define local_bh_enable() cpu_bh_enable(smp_processor_id())
-#define in_softirq() (local_bh_count[smp_processor_id()] != 0)
+#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#endif /* _ASM_SOFTIRQ_H */
-/* $Id: spinlock.h,v 1.9 2000/01/25 00:41:46 ralf Exp $
+/* $Id: spinlock.h,v 1.8 2000/01/23 21:15:52 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
*
* Copyright (C) 1994, 1995, 1996 by Ralf Baechle and Paul M. Antoine.
*
- * $Id: stackframe.h,v 1.11 1999/12/04 03:59:12 ralf Exp $
+ * $Id: stackframe.h,v 1.10 1999/08/13 17:07:27 harald Exp $
*/
#ifndef __ASM_MIPS_STACKFRAME_H
#define __ASM_MIPS_STACKFRAME_H
".set\tnoreorder\n\t"
".set\tnoat\n"
"1:\tlbu\t%3,(%0)\n\t"
-#if defined(CONFIG_CPU_R3000)
- "lbu\t$1,(%1)\n\t"
- "nop\n\t"
- "beqz\t%2,2f\n\t"
-#else
"beqz\t%2,2f\n\t"
"lbu\t$1,(%1)\n\t"
-#endif
"subu\t%2,1\n\t"
"bne\t$1,%3,3f\n\t"
"addiu\t%0,1\n\t"
"bnez\t%3,1b\n\t"
"addiu\t%1,1\n"
- "2:\tmove\t%3,$1\n"
+ "2:\n\t"
+#if defined(CONFIG_CPU_R3000)
+ "nop\n\t"
+#endif
+ "move\t%3,$1\n"
"3:\tsubu\t%3,$1\n\t"
".set\tat\n\t"
".set\treorder"
-/* $Id: system.h,v 1.21 1999/12/30 14:21:21 raiko Exp $
+/* $Id: system.h,v 1.20 1999/12/06 23:13:21 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
-/* $Id: termios.h,v 1.9 2000/02/18 00:24:48 ralf Exp $
+/* $Id: termios.h,v 1.8 2000/01/27 23:45:30 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
-/* $Id: timex.h,v 1.2 1999/02/15 02:22:14 ralf Exp $
+/* $Id: timex.h,v 1.1 1998/08/25 09:22:03 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
(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
<< (SHIFT_SCALE-SHIFT_HZ)) / HZ)
+#ifdef __KERNEL__
/*
* Standard way to access the cycle counter.
* Currently only used on SMP for scheduling.
{
return read_32bit_cp0_register(CP0_COUNT);
}
+#endif /* __KERNEL__ */
#endif /* __ASM_MIPS_TIMEX_H */
-/* $Id: types.h,v 1.4 2000/02/18 00:24:48 ralf Exp $
+/* $Id: types.h,v 1.3 1999/08/18 23:37:50 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
#define clear_user(addr,n) ({ \
void * __cl_addr = (addr); \
unsigned long __cl_size = (n); \
-if (__cl_size && __access_ok(VERIFY_WRITE, ((unsigned long)(__cl_addr)), __cl_size)) \
+if (__cl_size && access_ok(VERIFY_WRITE, ((unsigned long)(__cl_addr)), __cl_size)) \
__cl_size = __clear_user(__cl_addr, __cl_size); \
__cl_size; })
-/* $Id: ucontext.h,v 1.2 1999/09/28 22:27:17 ralf Exp $
+/* $Id: ucontext.h,v 1.2 1999/09/27 16:01:40 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
-/* $Id: unaligned.h,v 1.3 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
#define __NR_ptrace (__NR_Linux + 26)
#define __NR_alarm (__NR_Linux + 27)
#define __NR_oldfstat (__NR_Linux + 28)
-#define __NR_unused29 (__NR_Linux + 29)
+#define __NR_pause (__NR_Linux + 29)
#define __NR_utime (__NR_Linux + 30)
#define __NR_stty (__NR_Linux + 31)
#define __NR_gtty (__NR_Linux + 32)
#define __NR_lstat64 (__NR_Linux + 214)
#define __NR_fstat64 (__NR_Linux + 215)
#define __NR_pivot_root (__NR_Linux + 216)
+#define __NR_mincore (__NR_Linux + 217)
+#define __NR_madvise (__NR_Linux + 218)
/*
* Offset of the last Linux flavoured syscall
*/
-#define __NR_Linux_syscalls 216
+#define __NR_Linux_syscalls 218
#ifndef _LANGUAGE_ASSEMBLY
-/* $Id: watch.h,v 1.3 1998/08/25 09:22:05 ralf Exp $
+/* $Id: watch.h,v 1.3 1998/08/19 21:58:15 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
*
* Copyright (c) 1998 Harald Koerfgen
*
- * $Id: wbflush.h,v 1.3 1999/10/07 07:27:43 raiko Exp $
+ * $Id: wbflush.h,v 1.2 1999/08/13 17:07:28 harald Exp $
*/
#ifndef __ASM_MIPS_WBFLUSH_H
#define __ASM_MIPS_WBFLUSH_H
-/* $Id: a.out.h,v 1.2 2000/01/16 01:40:43 ralf Exp $
+/* $Id: a.out.h,v 1.1 1999/08/18 23:37:50 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
-/* $Id: addrspace.h,v 1.6 2000/02/10 20:20:15 kanoj Exp $
+/* $Id: addrspace.h,v 1.5 2000/02/01 00:32:01 kanoj 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
#endif
#define K2BASE 0xc000000000000000
+#if !defined (CONFIG_CPU_R8000)
+#define COMPAT_K1BASE32 0xffffffffa0000000
+#define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */
+#endif
+
#endif /* _ASM_ADDRSPACE_H */
-/* $Id: hinv.h,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* ARCS hardware/memory inventory/configuration and system ID definitions.
*/
-/* $Id: asm.h,v 1.3 2000/01/17 23:32:47 ralf Exp $
+/* $Id: asm.h,v 1.2 1999/12/04 03:59:12 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
-/* $Id: asmmacro.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: asmmacro.h,v 1.2 1999/10/19 20:51:53 ralf Exp $
*
* asmmacro.h: Assembler macros to make things easier to read.
*
-/* $Id: atomic.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
+/* $Id$
*
* Atomic operations that C can't guarantee us. Useful for
* resource counting etc..
#define _ASM_ATOMIC_H
#include <linux/config.h>
+
#include <asm/sgidefs.h>
#ifdef CONFIG_SMP
-/* $Id: bcache.h,v 1.3 2000/01/21 22:34:07 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: bitops.h,v 1.4 1999/12/04 03:59:12 ralf Exp $
+/* $Id: bitops.h,v 1.3 1999/08/20 21:59:08 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
#define ext2_find_first_zero_bit(addr, size) \
ext2_find_next_zero_bit((addr), (size), 0)
-extern inline unsigned long
+extern inline unsigned int
ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{
- unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
- unsigned long result = offset & ~31UL;
- unsigned long tmp;
+ unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
+ unsigned int result = offset & ~31UL;
+ unsigned int tmp;
if (offset >= size)
return size;
-/* $Id: bootinfo.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id: bootinfo.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
*
* bootinfo.h -- Definition of the Linux/MIPS boot information structure
*
-/* $Id: branch.h,v 1.1 1999/08/21 22:19:17 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: bugs.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
+/* $Id$
*
* Copyright (C) 1995 Waldorf Electronics
* Copyright (C) 1997, 1999 Ralf Baechle
-/* $Id: byteorder.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
+/* $Id$
*
* 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
#define _ASM_CACHE_H
/* bytes per L1 cache line */
-#define L1_CACHE_BYTES 32 /* A guess */
+#define L1_CACHE_BYTES 32 /* A guess */
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
#endif /* _ASM_CACHE_H */
#ifndef _ASM_CHECKSUM_H
#define _ASM_CHECKSUM_H
-#include <asm/checksum.h>
-
/*
* computes the checksum of a memory block at buff, length len,
* and adds in "sum" (32-bit)
-/* $Id: cpu.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: cpu.h,v 1.1 1999/10/19 20:51:53 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
-/* $Id: current.h,v 1.4 2000/01/17 23:32:47 ralf Exp $
+/* $Id: current.h,v 1.3 1999/12/04 03:59:12 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
register struct task_struct *current asm("$28");
#endif /* _LANGUAGE_C */
-#ifdef _LANGUAGE_ASSEMBLY
-
-/*
- * Special variant for use by exception handlers when the stack pointer
- * is not loaded.
- */
-#define _GET_CURRENT(reg) \
- lui reg, %hi(kernelsp); \
- .set push; \
- .set noreorder; \
- ld reg, %lo(kernelsp)(reg); \
- .set pop; \
- ori reg, 0x3fff; \
- xori reg, 0x3fff
-
-#endif
-
#endif /* _ASM_CURRENT_H */
-/* $Id: delay.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
+/* $Id$
*
* 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
#include <linux/config.h>
+#include <linux/config.h>
+
extern __inline__ void
__delay(unsigned long loops)
{
-/* $Id: div64.h,v 1.1 2000/01/29 01:42:28 ralf Exp $
+/* $Id: div64.h,v 1.1 2000/01/28 23:18:55 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
-/* $Id: dma.h,v 1.4 2000/01/29 01:42:28 ralf Exp $
+/* $Id: dma.h,v 1.5 2000/03/07 15:45:42 ralf Exp $
*
* linux/include/asm/dma.h: Defines for using and allocating dma channels.
* Written by Hennus Bergman, 1992.
extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
extern void free_dma(unsigned int dmanr); /* release it again */
+/* From PCI */
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy (0)
+#endif
+
#endif /* _ASM_DMA_H */
-/* $Id: ds1286.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: elf.h,v 1.4 2000/02/24 00:13:20 ralf Exp $
+/* $Id: elf.h,v 1.3 2000/01/17 23:32:47 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
-/* $Id: errno.h,v 1.2 1999/09/28 22:27:19 ralf Exp $
+/* $Id: errno.h,v 1.1 1999/08/18 23:37:51 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
-/* $Id: fcntl.h,v 1.1 1999/08/18 23:37:51 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: floppy.h,v 1.2 1999/08/21 22:19:17 ralf Exp $
+/* $Id$
*
* Architecture specific parts of the Floppy driver
*
-/* $Id: gfx.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: hardirq.h,v 1.4 2000/02/23 00:41:38 ralf Exp $
+/* $Id: hardirq.h,v 1.6 2000/03/07 15:45:42 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
* for more details.
*
- * Copyright (C) 1997, 1998, 1999 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1997 - 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_HARDIRQ_H
#define _ASM_HARDIRQ_H
#include <linux/config.h>
#include <linux/threads.h>
+#include <linux/irq.h>
-extern unsigned int local_irq_count[NR_CPUS];
+typedef struct {
+ unsigned long __local_irq_count;
+ unsigned long __local_bh_count;
+ unsigned long __pad[14];
+} ____cacheline_aligned irq_cpustat_t;
+
+extern irq_cpustat_t irq_stat [NR_CPUS];
+
+/*
+ * Simple wrappers reducing source bloat
+ */
+#define local_irq_count(cpu) (irq_stat[(cpu)].__local_irq_count)
+#define local_bh_count(cpu) (irq_stat[(cpu)].__local_bh_count)
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
*/
#define in_interrupt() ({ int __cpu = smp_processor_id(); \
- (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
-#define in_irq() (local_irq_count[smp_processor_id()] != 0)
+ (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+#define in_irq() (local_irq_count(smp_processor_id()) != 0)
#ifndef CONFIG_SMP
-#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
#define hardirq_endlock(cpu) do { } while (0)
-#define irq_enter(cpu) (local_irq_count[cpu]++)
-#define irq_exit(cpu) (local_irq_count[cpu]--)
+#define irq_enter(cpu, irq) (local_irq_count(cpu)++)
+#define irq_exit(cpu, irq) (local_irq_count(cpu)--)
#define synchronize_irq() barrier();
#else
-#error No habla MIPS SMP
+#include <asm/atomic.h>
+#include <linux/spinlock.h>
+#include <asm/smp.h>
+
+extern int global_irq_holder;
+extern spinlock_t global_irq_lock;
+
+static inline int irqs_running (void)
+{
+ int i;
+
+ for (i = 0; i < smp_num_cpus; i++)
+ if (local_irq_count(i))
+ return 1;
+ return 0;
+}
+
+static inline void release_irqlock(int cpu)
+{
+ /* if we didn't own the irq lock, just ignore.. */
+ if (global_irq_holder == cpu) {
+ global_irq_holder = NO_PROC_ID;
+ spin_unlock(&global_irq_lock);
+ }
+}
+
+static inline int hardirq_trylock(int cpu)
+{
+ return !local_irq_count(cpu) && !spin_is_locked(&global_irq_lock);
+}
+
+#define hardirq_endlock(cpu) do { } while (0)
+
+static inline void irq_enter(int cpu, int irq)
+{
+ ++local_irq_count(cpu);
+
+ while (spin_is_locked(&global_irq_lock))
+ barrier();
+}
+
+static inline void irq_exit(int cpu, int irq)
+{
+ --local_irq_count(cpu);
+}
+
+extern void synchronize_irq(void);
#endif /* CONFIG_SMP */
+
#endif /* _ASM_HARDIRQ_H */
-/* $Id: hdreg.h,v 1.1 1999/08/21 22:19:17 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: highmem.h,v 1.2 2000/01/29 01:42:28 ralf Exp $
+/* $Id: highmem.h,v 1.1 2000/01/27 01:05:37 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
--- /dev/null
+/* This exists merely to satisfy <linux/irq.h>. There is
+ nothing that would go here of general interest.
+
+ Everything of consequence is in arch/alpha/kernel/irq_impl.h,
+ to be used only in arch/alpha/kernel/. */
#include <linux/config.h>
#ifndef MAX_HWIFS
+# ifdef CONFIG_BLK_DEV_IDEPCI
+#define MAX_HWIFS 10
+# else
#define MAX_HWIFS 6
+# endif
#endif
#define ide__sti() __sti()
-/* $Id: init.h,v 1.1 1999/08/18 23:37:51 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: inst.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: inst.h,v 1.1 1999/10/09 20:55:09 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
-/* $Id: io.h,v 1.10 2000/02/24 00:13:20 ralf Exp $
+/* $Id: io.h,v 1.9 2000/02/04 07:40:53 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
return (void *)(address + PAGE_OFFSET);
}
-#define BRIDGE_DIRECT_MAPPED_BASE 0xa200000000000000ull
+#define BRIDGE_DIRECT_MAPPED_BASE 0xa180000000000000ull
/*
* IO bus memory addresses are also 1:1 with the physical address
* - you don't have to worry about side effects within the __builtin..
*/
#define outb(val,port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
- __outbc((val),(port)) : \
- __outb((val),(port)))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+ __outbc((val),(port)^(3)) : \
+ __outb((val),(port)^(3)))
#define inb(port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
- __inbc(port) : \
- __inb(port))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+ __inbc((port)^(3)) : \
+ __inb((port)^(3)))
#define outb_p(val,port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
- __outbc_p((val),(port)) : \
- __outb_p((val),(port)))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+ __outbc_p((val),(port)^(3)) : \
+ __outb_p((val),(port)^(3)))
#define inb_p(port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
- __inbc_p(port) : \
- __inb_p(port))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+ __inbc_p((port)^(3)) : \
+ __inb_p((port)^(3)))
#define outw(val,port) \
-((__builtin_constant_p((port^2)) && (port^2) < 32768) ? \
- __outwc((val),(port^2)) : \
- __outw((val),(port^2)))
+((__builtin_constant_p(((port)^(2))) && ((port)^(2)) < 32768) ? \
+ __outwc((val),((port)^(2))) : \
+ __outw((val),((port)^(2))))
#define inw(port) \
-((__builtin_constant_p((port^2)) && (port^2) < 32768) ? \
- __inwc(port^2) : \
- __inw(port^2))
+((__builtin_constant_p(((port)^(2))) && ((port)^(2)) < 32768) ? \
+ __inwc((port)^(2)) : \
+ __inw((port)^(2)))
#define outw_p(val,port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
- __outwc_p((val),(port)) : \
- __outw_p((val),(port)))
+((__builtin_constant_p((port)^(2)) && ((port)^(2)) < 32768) ? \
+ __outwc_p((val),(port)^(2)) : \
+ __outw_p((val),(port)^(2)))
#define inw_p(port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
- __inwc_p(port) : \
- __inw_p(port))
+((__builtin_constant_p((port)^(2)) && ((port)^(2)) < 32768) ? \
+ __inwc_p((port)^(2)) : \
+ __inw_p((port)^(2)))
#define outl(val,port) \
((__builtin_constant_p((port)) && (port) < 32768) ? \
-/* $Id: ioc3.h,v 1.2 2000/02/18 09:54:39 ulfc Exp $
+/* $Id: ioc3.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
*
* Copyright (C) 1999 Ralf Baechle
* This file is part of the Linux driver for the SGI IOC3.
-/* $Id: ioctl.h,v 1.1 1999/08/18 23:37:51 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: ioctls.h,v 1.1 1999/08/18 23:37:51 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: irq.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: linux_logo.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* include/asm-mips/linux_logo.h: This is a linux logo
* to be displayed on boot.
-/* $Id: mc146818rtc.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: mipsregs.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id: mipsregs.h,v 1.1 1999/08/18 23:37:51 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
#define ST0_CE 0x00020000
#define ST0_CH 0x00040000
#define ST0_SR 0x00100000
+#define ST0_TS 0x00200000
#define ST0_BEV 0x00400000
#define ST0_RE 0x02000000
#define ST0_FR 0x04000000
#define MCL_CURRENT 1 /* lock all current mappings */
#define MCL_FUTURE 2 /* lock all future mappings */
+#define MADV_NORMAL 0x0 /* default page-in behavior */
+#define MADV_RANDOM 0x1 /* page-in minimum required */
+#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
+#define MADV_WILLNEED 0x3 /* pre-fault pages */
+#define MADV_DONTNEED 0x4 /* discard these pages */
+
/* compatibility flags */
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FILE 0
#ifndef _ASM_MMU_CONTEXT_H
#define _ASM_MMU_CONTEXT_H
+#include <linux/config.h>
+#include <linux/slab.h>
#include <asm/pgalloc.h>
+#include <asm/processor.h>
-/* Fuck. The f-word is here so you can grep for it :-) */
-extern unsigned long asid_cache;
-extern pgd_t *current_pgd;
+#ifndef CONFIG_SMP
+#define CPU_CONTEXT(cpu, mm) (mm)->context
+#else
+#define CPU_CONTEXT(cpu, mm) (*((unsigned long *)((mm)->context) + cpu))
+#endif
+#define ASID_CACHE(cpu) cpu_data[cpu].asid_cache
#define ASID_INC 0x1
#define ASID_MASK 0xff
#define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1)
extern inline void
-get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
+get_new_cpu_mmu_context(struct mm_struct *mm, unsigned long cpu)
{
+ unsigned long asid = ASID_CACHE(cpu);
+
if (! ((asid += ASID_INC) & ASID_MASK) ) {
- flush_tlb_all(); /* start new asid cycle */
+ _flush_tlb_all(); /* start new asid cycle */
if (!asid) /* fix version if needed */
asid = ASID_FIRST_VERSION;
}
- mm->context = asid_cache = asid;
+ CPU_CONTEXT(cpu, mm) = ASID_CACHE(cpu) = asid;
}
/*
extern inline void
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
+#ifndef CONFIG_SMP
mm->context = 0;
+#else
+ /* Make sure not to do anything during a clone-vm operation */
+ if ((current == tsk) || (current->mm != mm)) {
+ mm->context = (unsigned long)kmalloc(smp_num_cpus *
+ sizeof(unsigned long), GFP_KERNEL);
+ /*
+ * Init the "context" values so that a tlbpid allocation
+ * happens on the first switch.
+ */
+ if (mm->context)
+ memset((void *)mm->context, 0, smp_num_cpus *
+ sizeof(unsigned long));
+ else
+ printk("Warning: init_new_context failed\n");
+ }
+#endif
}
extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk, unsigned cpu)
{
- unsigned long asid = asid_cache;
-
/* Check if our ASID is of an older version and thus invalid */
- if ((next->context ^ asid) & ASID_VERSION_MASK)
- get_new_mmu_context(next, asid);
+ if ((CPU_CONTEXT(cpu, next) ^ ASID_CACHE(cpu)) & ASID_VERSION_MASK)
+ get_new_cpu_mmu_context(next, cpu);
- current_pgd = next->pgd;
- set_entryhi(next->context);
+ set_entryhi(CPU_CONTEXT(cpu, next));
}
/*
*/
extern inline void destroy_context(struct mm_struct *mm)
{
- /* Nothing to do. */
+#ifdef CONFIG_SMP
+ if (mm->context)
+ kfree((void *)mm->context);
+#endif
}
/*
activate_mm(struct mm_struct *prev, struct mm_struct *next)
{
/* Unconditionally get a new ASID. */
- get_new_mmu_context(next, asid_cache);
+ get_new_cpu_mmu_context(next, smp_processor_id());
- current_pgd = next->pgd;
- set_entryhi(next->context);
+ set_entryhi(CPU_CONTEXT(smp_processor_id(), next));
}
#endif /* _ASM_MMU_CONTEXT_H */
typedef struct plat_pglist_data {
pg_data_t gendata;
- unsigned long physstart;
- unsigned long size;
- unsigned long start_mapnr;
} plat_pg_data_t;
/*
#define PHYSADDR_TO_NID(pa) NASID_TO_COMPACT_NODEID(NASID_GET(pa))
#define PLAT_NODE_DATA(n) (plat_node_data[n])
-#define PLAT_NODE_DATA_STARTNR(n) (PLAT_NODE_DATA(n)->start_mapnr)
+#define PLAT_NODE_DATA_STARTNR(n) (PLAT_NODE_DATA(n)->gendata.node_start_mapnr)
+#define PLAT_NODE_DATA_SIZE(n) (PLAT_NODE_DATA(n)->gendata.node_size)
#define PLAT_NODE_DATA_LOCALNR(p, n) \
- (((p) - PLAT_NODE_DATA(n)->physstart) >> PAGE_SHIFT)
-#define PAGE_TO_PLAT_NODE(p) (plat_pg_data_t *)((p)->zone->zone_pgdat)
+ (((p) - PLAT_NODE_DATA(n)->gendata.node_start_paddr) >> PAGE_SHIFT)
#ifdef CONFIG_DISCONTIGMEM
/*
* Given a kernel address, find the home node of the underlying memory.
- * For production kern_addr_valid, change to return "numnodes" instead
- * of panicing.
*/
#define KVADDR_TO_NID(kaddr) \
((NASID_TO_COMPACT_NODEID(NASID_GET(__pa(kaddr))) != -1) ? \
*/
#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
-/*
- * Given a mem_map_t, LOCAL_MAP_BASE finds the owning node for the
- * physical page and returns the kaddr for the mem_map of that node.
- */
-#define LOCAL_MAP_BASE(page) \
- NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(page)))
-
/*
* Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
* and returns the the mem_map of that node.
*/
#define LOCAL_BASE_ADDR(kaddr) ((unsigned long)(kaddr) & ~(NODE_MAX_MEM_SIZE-1))
+#define LOCAL_MAP_NR(kvaddr) \
+ (((unsigned long)(kvaddr)-LOCAL_BASE_ADDR((kvaddr))) >> PAGE_SHIFT)
+
+#define MAP_NR(kaddr) (((unsigned long)(kaddr) > (unsigned long)high_memory)\
+ ? (max_mapnr + 1) : (LOCAL_MAP_NR((kaddr)) + \
+ (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
+ sizeof(mem_map_t))))
+
+#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) > \
+ -1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \
+ NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap)))
+
#endif /* CONFIG_DISCONTIGMEM */
#endif /* _ASM_MMZONE_H_ */
-/* $Id: namei.h,v 1.1 1999/08/20 21:59:08 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: ng1.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
#define TASK_COUNTER 56
#define TASK_PRIORITY 64
#define TASK_MM 80
-#define TASK_STRUCT_SIZE 1480
+#define TASK_PROCESSOR 100
+#define TASK_STRUCT_SIZE 1432
/* MIPS specific thread_struct offsets. */
#define THREAD_REG16 896
-/* $Id: paccess.h,v 1.3 2000/02/04 07:40:53 ralf Exp $
+/* $Id: paccess.h,v 1.2 2000/01/21 22:34:07 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
-/* $Id: param.h,v 1.2 2000/01/19 02:08:47 ralf Exp $
+/* $Id: param.h,v 1.1 1999/08/18 23:37:51 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
-/* $Id: parport.h,v 1.2 2000/02/18 00:24:48 ralf Exp $
- *
- * parport.h: ia32-specific parport initialisation
+/* $Id$
*
* Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
*
* This file should only be included by drivers/parport/parport_pc.c.
*/
#ifndef _ASM_PARPORT_H
-#define _ASM_PARPORT_H 1
+#define _ASM_PARPORT_H
static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
return parport_pc_find_isa_ports (autoirq, autodma);
}
-#endif /* !(_ASM_PARPORT_H) */
+#endif /* _ASM_PARPORT_H */
-/* $Id: bridge.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
#define BRIDGE_INTERNAL_ATES 128
+/* ========================================================================
+ * Linux pci bus mappings to sn physical id's
+ */
+unsigned char bus_to_wid[256]; /* widget id for linux pci bus */
+unsigned char bus_to_nid[256]; /* nasid for linux pci bus */
+unsigned char num_bridges; /* number of bridges in the system */
+
#endif /* _ASM_PCI_BRIDGE_H */
#include <linux/config.h>
+#include <linux/config.h>
+
/* TLB flushing:
*
* - flush_tlb_all() flushes all processes TLB entries
* - flush_tlb_mm(mm) flushes the specified mm context TLB entries
* - flush_tlb_page(mm, vmaddr) flushes a single page
* - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*/
extern void (*_flush_tlb_all)(void);
extern void (*_flush_tlb_mm)(struct mm_struct *mm);
unsigned long end);
extern void (*_flush_tlb_page)(struct vm_area_struct *vma, unsigned long page);
+#ifndef CONFIG_SMP
+
#define flush_tlb_all() _flush_tlb_all()
#define flush_tlb_mm(mm) _flush_tlb_mm(mm)
#define flush_tlb_range(mm,vmaddr,end) _flush_tlb_range(mm, vmaddr, end)
#define flush_tlb_page(vma,page) _flush_tlb_page(vma, page)
+#else /* CONFIG_SMP */
+
+extern void flush_tlb_all(void);
+extern void flush_tlb_mm(struct mm_struct *);
+extern void flush_tlb_range(struct mm_struct *, unsigned long, unsigned long);
+extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
+
+#endif /* CONFIG_SMP */
+
extern inline void flush_tlb_pgtables(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
{
unsigned long *ret;
- if ((ret = (unsigned long *)pte_quicklist) != NULL) {
- pte_quicklist = (unsigned long *)(*ret);
+ if ((ret = (unsigned long *)pmd_quicklist) != NULL) {
+ pmd_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
return (pmd_t *)ret;
extern inline void free_pmd_fast(pmd_t *pmd)
{
- *(unsigned long *)pmd = (unsigned long) pte_quicklist;
- pte_quicklist = (unsigned long *) pmd;
+ *(unsigned long *)pmd = (unsigned long) pmd_quicklist;
+ pmd_quicklist = (unsigned long *) pmd;
pgtable_cache_size++;
}
-/* $Id: pgtable.h,v 1.12 2000/02/24 00:13:20 ralf Exp $
+/* $Id: pgtable.h,v 1.14 2000/03/02 02:37:13 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
#define PTRS_PER_PMD 1024
#define PTRS_PER_PTE 512
#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
+#define FIRST_USER_PGD_NR 0
#define VMALLOC_START XKSEG
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
-#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
+#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_COW)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
- _CACHE_CACHABLE_NONCOHERENT)
+ _CACHE_CACHABLE_COW)
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
- _CACHE_CACHABLE_NONCOHERENT)
+ _CACHE_CACHABLE_COW)
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
- _CACHE_CACHABLE_NONCOHERENT)
+ _CACHE_CACHABLE_COW)
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
- _CACHE_CACHABLE_NONCOHERENT)
+ _CACHE_CACHABLE_COW)
#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
_CACHE_UNCACHED)
#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
#define PAGE_PTR(address) \
((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
-extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)];
+extern pte_t invalid_pte_table[2*PAGE_SIZE/sizeof(pte_t)];
extern pmd_t invalid_pmd_table[2*PAGE_SIZE/sizeof(pmd_t)];
/*
#define PAGE_TO_PA(page) ((page - mem_map) << PAGE_SHIFT)
#else
#define PAGE_TO_PA(page) \
- ((((page)-(page)->zone->zone_pgdat->node_mem_map) << PAGE_SHIFT) \
- + ((PAGE_TO_PLAT_NODE(page))->physstart))
+ ((((page)-(page)->zone->zone_mem_map) << PAGE_SHIFT) \
+ + ((page)->zone->zone_start_paddr))
#endif
#define mk_pte(page, pgprot) \
({ \
extern void pmd_init(unsigned long page);
extern pgd_t swapper_pg_dir[1024];
+extern void paging_init(void);
extern void (*update_mmu_cache)(struct vm_area_struct *vma,
unsigned long address, pte_t pte);
-/* $Id: poll.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: posix_types.h,v 1.4 2000/02/16 01:07:49 ralf Exp $
+/* $Id: posix_types.h,v 1.5 2000/02/29 20:49:16 ulfc 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
int val[2];
} __kernel_fsid_t;
+/* Now 32bit compatibility types */
+typedef unsigned int __kernel_dev_t32;
+typedef unsigned int __kernel_ino_t32;
+typedef unsigned int __kernel_mode_t32;
+typedef unsigned int __kernel_nlink_t32;
+typedef int __kernel_off_t32;
+typedef int __kernel_pid_t32;
+typedef int __kernel_ipc_pid_t32;
+typedef int __kernel_uid_t32;
+typedef int __kernel_gid_t32;
+typedef unsigned int __kernel_size_t32;
+typedef int __kernel_ssize_t32;
+typedef int __kernel_ptrdiff_t32;
+typedef int __kernel_time_t32;
+typedef int __kernel_suseconds_t32;
+typedef int __kernel_clock_t32;
+typedef int __kernel_daddr_t32;
+typedef char * __kernel_caddr_t32;
+typedef __kernel_fsid_t __kernel_fsid_t32;
+
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#undef __FD_SET
-/* $Id: processor.h,v 1.10 2000/02/24 00:13:20 ralf Exp $
+/* $Id: processor.h,v 1.11 2000/03/14 01:39:27 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
#ifndef _ASM_PROCESSOR_H
#define _ASM_PROCESSOR_H
+#include <linux/config.h>
+
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
#include <asm/reg.h>
#include <asm/system.h>
-struct mips_cpuinfo {
+#if (defined(CONFIG_SGI_IP27))
+#include <asm/sn/types.h>
+#include <asm/sn/intr_public.h>
+#endif
+
+struct cpuinfo_mips {
unsigned long udelay_val;
unsigned long *pgd_quick;
unsigned long *pmd_quick;
unsigned long *pte_quick;
unsigned long pgtable_cache_sz;
-};
+ unsigned long last_asn;
+ unsigned int irq_count, bh_count;
+ unsigned long asid_cache;
+#if defined(CONFIG_SGI_IP27)
+ cnodeid_t p_nodeid; /* my node ID in compact-id-space */
+ nasid_t p_nasid; /* my node ID in numa-as-id-space */
+ unsigned char p_slice; /* Physical position on node board */
+ hub_intmasks_t p_intmasks; /* SN0 per-CPU interrupt masks */
+#endif
+} __attribute__((aligned(128)));
/*
* System setup and hardware flags..
extern char vce_available; /* Supports VCED / VCEI exceptions */
extern char mips4_available; /* CPU has MIPS IV ISA or better */
-extern struct mips_cpuinfo boot_cpu_data;
extern unsigned int vced_count, vcei_count;
+extern struct cpuinfo_mips cpu_data[];
#ifdef CONFIG_SMP
-extern struct mips_cpuinfo cpu_data[];
#define current_cpu_data cpu_data[smp_processor_id()]
#else
-#define cpu_data &boot_cpu_data
-#define current_cpu_data boot_cpu_data
+#define current_cpu_data cpu_data[0]
#endif
/*
/* Lazy FPU handling on uni-processor */
extern struct task_struct *last_task_used_math;
+#ifndef CONFIG_SMP
+#define IS_FPU_OWNER() (last_task_used_math == current)
+#define CLEAR_FPU_OWNER() last_task_used_math = NULL;
+#else
+#define IS_FPU_OWNER() (current->flags & PF_USEDFPU)
+#define CLEAR_FPU_OWNER() current->flags &= ~PF_USEDFPU;
+#endif
+
/*
* User space process size: 1TB. This is hardcoded into a few places,
* so don't change it unless you know what you are doing. TASK_SIZE
/*
* Do necessary setup to start up a newly executed thread.
*/
-#define start_thread(regs, new_pc, new_sp) do { \
+#define start_thread(regs, pc, sp) \
+do { \
+ unsigned long __status; \
+ \
/* New thread looses kernel privileges. */ \
- regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KSU_USER;\
- regs->cp0_epc = new_pc; \
- regs->regs[29] = new_sp; \
+ __status = regs->cp0_status & ~(ST0_CU0|ST0_FR|ST0_KSU); \
+ __status |= KSU_USER; \
+ __status |= (current->thread.mflags & MF_32BIT) ? 0 : ST0_FR; \
+ regs->cp0_status = __status; \
+ regs->cp0_epc = pc; \
+ regs->regs[29] = sp; \
current->thread.current_ds = USER_DS; \
-} while (0)
+} while(0)
unsigned long get_wchan(struct task_struct *p);
-/* $Id: ptrace.h,v 1.4 2000/02/24 00:13:20 ralf Exp $
+/* $Id: ptrace.h,v 1.3 1999/12/04 03:59:12 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
-/* $Id: r10kcache.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id: r10kcache.h,v 1.1 2000/01/16 01:27:14 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
-/* $Id: r10kcacheops.h,v 1.1 2000/01/16 01:27:14 ralf Exp $
+/* $Id: r10kcacheops.h,v 1.1 2000/01/12 23:18:32 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
-/* $Id: r4kcache.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: r4kcacheops.h,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: regdef.h,v 1.1 1999/08/20 21:59:08 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: resource.h,v 1.4 2000/02/04 07:40:53 ralf Exp $
+/* $Id: resource.h,v 1.3 2000/01/27 23:45:30 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
-/* $Id: semaphore-helper.h,v 1.3 1999/12/04 03:59:12 ralf Exp $
+/* $Id: semaphore-helper.h,v 1.2 1999/10/20 18:10:32 ralf Exp $
*
* SMP- and interrupt-safe semaphores helper functions.
*
-/* $Id: semaphore.h,v 1.6 2000/02/24 03:09:52 ulfc Exp $
+/* $Id: semaphore.h,v 1.5 2000/02/18 00:24:49 ralf Exp $
*
* License. See the file "COPYING" in the main directory of this archive
* for more details.
-/* $Id: serial.h,v 1.3 2000/02/04 07:40:53 ralf Exp $
+/* $Id: serial.h,v 1.2 2000/01/17 23:32:47 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
-/* $Id: io.h,v 1.1 2000/02/04 07:40:53 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: sgi.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgi.h,v 1.1 1999/08/20 21:13:37 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
-/* $Id: sgihpc.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgihpc.h,v 1.2 1999/10/19 20:51:54 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
-/* $Id: sgimc.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgimc.h,v 1.2 1999/10/19 20:51:54 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
-/* $Id: sgint23.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgint23.h,v 1.3 1999/10/20 18:10:32 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
-/* $Id: sgialib.h,v 1.4 2000/01/17 23:32:47 ralf Exp $
+/* $Id: sgialib.h,v 1.3 1999/12/04 03:59:12 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
-/* $Id: sgiarcs.h,v 1.5 2000/01/17 23:32:47 ralf Exp $
+/* $Id: sgiarcs.h,v 1.4 1999/12/04 03:59:12 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
-/* $Id: sgidefs.h,v 1.2 1999/08/20 21:59:08 ralf Exp $
+/* $Id: sgidefs.h,v 1.1 1999/08/18 23:37:52 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
-/* $Id: shmiq.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: shmparam.h,v 1.2 2000/01/29 01:42:28 ralf Exp $
+/* $Id: shmparam.h,v 1.1 1999/08/19 22:56:35 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
-/* $Id: sigcontext.h,v 1.2 1999/09/28 22:27:19 ralf Exp $
+/* $Id: sigcontext.h,v 1.2 1999/09/27 16:01:40 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
-/* $Id: siginfo.h,v 1.3 2000/02/18 00:24:49 ralf Exp $
+/* $Id: siginfo.h,v 1.2 2000/01/27 01:05:37 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
-/* $Id: signal.h,v 1.2 1999/09/28 22:27:19 ralf Exp $
+/* $Id: signal.h,v 1.2 1999/09/27 16:01:40 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
} sigset_t;
typedef unsigned long old_sigset_t; /* at least 32 bits */
+typedef unsigned int old_sigset_t32;
#define SIGHUP 1 /* Hangup (POSIX). */
#define SIGINT 2 /* Interrupt (ANSI). */
--- /dev/null
+#ifndef __ASM_SMP_H
+#define __ASM_SMP_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_SMP
+
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+#if 0
+struct cpuinfo_mips { /* XXX */
+ unsigned long loops_per_sec;
+ unsigned long last_asn;
+ unsigned long *pgd_cache;
+ unsigned long *pte_cache;
+ unsigned long pgtable_cache_sz;
+ unsigned long ipi_count;
+ unsigned long irq_attempt[NR_IRQS];
+ unsigned long smp_local_irq_count;
+ unsigned long prof_multiplier;
+ unsigned long prof_counter;
+ int irq_count, bh_count;
+} __attribute__((aligned(64)));
+
+extern struct cpuinfo_mips cpu_data[NR_CPUS];
+#endif
+
+#define smp_processor_id() (current->processor)
+
+#define PROC_CHANGE_PENALTY 20
+
+/* Map from cpu id to sequential logical cpu number. This will only
+ not be idempotent when cpus failed to come on-line. */
+extern int __cpu_number_map[NR_CPUS];
+#define cpu_number_map(cpu) __cpu_number_map[cpu]
+
+/* The reverse map from sequential logical cpu number to cpu id. */
+extern int __cpu_logical_map[NR_CPUS];
+#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
+
+/* Good enough for toy^Wupto 64 CPU Origins. */
+extern unsigned long cpu_present_mask;
+
+#endif
+
+#define NO_PROC_ID (-1)
+
+#endif __ASM_SMP_H
--- /dev/null
+/*
+ * <asm/smplock.h>
+ *
+ * Default SMP lock implementation
+ */
+#ifndef _ASM_SMPLOCK_H
+#define _ASM_SMPLOCK_H
+
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+
+extern spinlock_t kernel_flag;
+
+#define kernel_locked() spin_is_locked(&kernel_flag)
+
+/*
+ * Release global kernel lock and global interrupt lock
+ */
+static __inline__ void release_kernel_lock(struct task_struct *task, int cpu)
+{
+ if (task->lock_depth >= 0)
+ spin_unlock(&kernel_flag);
+ release_irqlock(cpu);
+ __sti();
+}
+
+/*
+ * Re-acquire the kernel lock
+ */
+static __inline__ void reacquire_kernel_lock(struct task_struct *task)
+{
+ if (task->lock_depth >= 0)
+ spin_lock(&kernel_flag);
+}
+
+/*
+ * Getting the big kernel lock.
+ *
+ * This cannot happen asynchronously,
+ * so we only need to worry about other
+ * CPU's.
+ */
+static __inline__ void lock_kernel(void)
+{
+ if (!++current->lock_depth)
+ spin_lock(&kernel_flag);
+}
+
+static __inline__ void unlock_kernel(void)
+{
+ if (--current->lock_depth < 0)
+ spin_unlock(&kernel_flag);
+}
+
+#endif /* _ASM_SMPLOCK_H */
-/* $Id: addrs.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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.
*
- * Derived from IRIX <sys/SN/addrs.h>.
- *
* Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
* Copyright (C) 1999 by Ralf Baechle
*/
#include <asm/reg.h>
#include <asm/sn/kldir.h>
+#if defined(CONFIG_SGI_IP27)
+#include <asm/sn/sn0/addrs.h>
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/sn/sn1/addrs.h>
+#endif
+
+
#if _LANGUAGE_C
+#if defined(CONFIG_SGI_IO) /* FIXME */
+#define PS_UINT_CAST (__psunsigned_t)
+#define UINT64_CAST (__uint64_t)
+#else /* CONFIG_SGI_IO */
#define PS_UINT_CAST (unsigned long)
#define UINT64_CAST (unsigned long)
+#endif /* CONFIG_SGI_IO */
+
#define HUBREG_CAST (volatile hubreg_t *)
#elif _LANGUAGE_ASSEMBLY
#define NASID_GET_META(_n) ((_n) >> NASID_LOCAL_BITS)
+#ifdef CONFIG_SGI_IP27
#define NASID_GET_LOCAL(_n) ((_n) & 0xf)
+#endif
#define NASID_MAKE(_m, _l) (((_m) << NASID_LOCAL_BITS) | (_l))
#define NODE_ADDRSPACE_MASK (NODE_ADDRSPACE_SIZE - 1)
* The bottom of ualias space is flipped depending on whether you're
* processor 0 or 1 within a node.
*/
+#ifdef CONFIG_SGI_IP27
#define UALIAS_FLIP_BASE UALIAS_BASE
#define UALIAS_FLIP_SIZE 0x20000
#define UALIAS_FLIP_BIT 0x10000
#define LBOOT_BASE (HSPEC_BASE + 0x10000000)
#define LBOOT_SIZE 0x10000000
#define LBOOT_LIMIT (LBOOT_BASE + LBOOT_SIZE)
+#define LBOOT_STRIDE 0 /* IP27 has only one CPU PROM */
+
+#endif
#define HUB_REGISTER_WIDGET 1
#define IALIAS_BASE NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET)
/*
* Macro for referring to Hub's RBOOT space
*/
+
+#ifdef CONFIG_SGI_IP27
#define RBOOT_SIZE 0x10000000 /* 256 Megabytes */
#define NODE_RBOOT_BASE(_n) (NODE_HSPEC_BASE(_n) + 0x30000000)
#define NODE_RBOOT_LIMIT(_n) (NODE_RBOOT_BASE(_n) + RBOOT_SIZE)
+#endif
+
/*
* Macros for referring the Hub's back door space
*
* BDDIR_ENTRY_HI returns the address of the high double-word of the entry.
* BDPRT_ENTRY returns the address of the double-word protection entry
* corresponding to the page containing the physical address.
+ * BDPRT_ENTRY_S Stores the value into the protection entry.
+ * BDPRT_ENTRY_L Load the value from the protection entry.
* BDECC_ENTRY returns the address of the ECC byte corresponding to a
* double-word at a specified physical address.
+ * BDECC_ENTRY_H returns the address of the two ECC bytes corresponding to a
+ * quad-word at a specified physical address.
*/
#define NODE_BDOOR_BASE(_n) (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2))
#define NODE_BDECC_BASE(_n) (NODE_BDOOR_BASE(_n))
#define NODE_BDDIR_BASE(_n) (NODE_BDOOR_BASE(_n) + (NODE_ADDRSPACE_SIZE/4))
-
+#ifdef CONFIG_SGI_IP27
#define BDDIR_ENTRY_LO(_pa) ((HSPEC_BASE + \
NODE_ADDRSPACE_SIZE * 3 / 4 + \
0x200) | \
UINT64_CAST (_pa) & NASID_MASK | \
UINT64_CAST (_pa) >> 2 & BDDIR_UPPER_MASK | \
(_rgn) << 3)
+#define BDPRT_ENTRY_ADDR(_pa,_rgn) (BDPRT_ENTRY((_pa),(_rgn)))
+#define BDPRT_ENTRY_S(_pa,_rgn,_val) (*(__psunsigned_t *)BDPRT_ENTRY((_pa),(_rgn))=(_val))
+#define BDPRT_ENTRY_L(_pa,_rgn) (*(__psunsigned_t *)BDPRT_ENTRY((_pa),(_rgn)))
#define BDECC_ENTRY(_pa) ((HSPEC_BASE + \
NODE_ADDRSPACE_SIZE / 2) | \
#define BDECC_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \
(UINT64_CAST (_ba) & BDECC_UPPER_MASK)<<2 | \
(UINT64_CAST (_ba) & 3) << 3)
+#endif /* CONFIG_SGI_IP27 */
/*
#define LOCAL_HUB(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
#define REMOTE_HUB(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
0x800000 + (_x)))
-
#endif /* _STANDALONE */
/*
#define LOCAL_HUB_ADDR(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
#define REMOTE_HUB_ADDR(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
0x800000 + (_x)))
+#ifdef CONFIG_SGI_IP27
+#define REMOTE_HUB_PI_ADDR(_n, _sn, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
+ 0x800000 + (_x)))
+#endif /* CONFIG_SGI_IP27 */
#if _LANGUAGE_C
#define LOCAL_HUB_S(_r, _d) HUB_S(LOCAL_HUB_ADDR(_r), (_d))
#define REMOTE_HUB_L(_n, _r) HUB_L(REMOTE_HUB_ADDR((_n), (_r)))
#define REMOTE_HUB_S(_n, _r, _d) HUB_S(REMOTE_HUB_ADDR((_n), (_r)), (_d))
+#define REMOTE_HUB_PI_L(_n, _sn, _r) HUB_L(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)))
+#define REMOTE_HUB_PI_S(_n, _sn, _r, _d) HUB_S(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)), (_d))
#endif /* _LANGUAGE_C */
/* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a
* relocatable program
*/
-#ifdef SN0XXL
-#define UNIX_DEBUG_LOADADDR 0x360000
-#else
#define UNIX_DEBUG_LOADADDR 0x300000
-#endif
#define SYMMON_LOADADDR(nasid) \
TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000))
#define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer
#define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size
+#define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET)
+
#endif /* _LANGUAGE_C */
-/* Fixme for SN1 */
-#include <asm/sn/sn0/addrs.h>
#endif /* _ASM_SN_ADDRS_H */
-/* $Id: agent.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
#include <asm/sn/addrs.h>
#include <asm/sn/arch.h>
-//#include <sys/SN/io.h>
+//#include <asm/sn/io.h>
+#if defined(CONFIG_SGI_IP27)
#include <asm/sn/sn0/hub.h>
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/sn/sn1/hub.h>
+#endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
/*
* NIC register macros
*/
+#if defined(CONFIG_SGI_IP27)
#define HUB_NIC_ADDR(_cpuid) \
REMOTE_HUB_ADDR(COMPACT_TO_NASID_NODEID(cputocnode(_cpuid)), \
MD_MLAN_CTL)
+#endif
#define SET_HUB_NIC(_my_cpuid, _val) \
(HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val)))
-/* $Id: arch.h,v 1.2 2000/02/10 07:28:35 kanoj Exp $
+/* $Id$
*
* 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.
*
- * SGI IP27 specific setup.
+ * SGI specific setup.
*
* Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
* Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
#define _ASM_SN_ARCH_H
#include <linux/types.h>
+#include <linux/config.h>
+#if !defined(CONFIG_SGI_IO)
#include <asm/sn/types.h>
#include <asm/sn/sn0/arch.h>
+#endif
+
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#if !defined(CONFIG_SGI_IO)
typedef u64 hubreg_t;
typedef u64 nic_t;
#endif
+#endif
+#ifdef CONFIG_SGI_IP27
#define CPUS_PER_NODE 2 /* CPUs on a single hub */
#define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */
+#define CPUS_PER_SUBNODE 2 /* CPUs on a single hub PI */
+#endif
#define CNODE_NUM_CPUS(_cnode) (NODEPDA(_cnode)->node_num_cpus)
+
#define CNODE_TO_CPU_BASE(_cnode) (NODEPDA(_cnode)->node_first_cpu)
#define cputocnode(cpu) \
- (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_nodeid))
+ (cpu_data[(cpu)].p_nodeid)
#define cputonasid(cpu) \
- (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_nasid))
+ (cpu_data[(cpu)].p_nasid)
#define cputoslice(cpu) \
- (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_slice))
+ (cpu_data[(cpu)].p_slice)
#define makespnum(_nasid, _slice) \
(((_nasid) << CPUS_PER_NODE_SHFT) | (_slice))
-
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
#define INVALID_NASID (nasid_t)-1
#define INVALID_PARTID (partid_t)-1
extern nasid_t get_nasid(void);
+extern cnodeid_t get_cpu_cnode(int);
+extern int get_cpu_slice(cpuid_t);
+
/*
* NO ONE should access these arrays directly. The only reason we refer to
* them here is to avoid the procedure call that would be required in the
((nnode) >> \
(is_fine_dirmode() ? NASID_TO_FINEREG_SHFT : NASID_TO_COARSEREG_SHFT))
+#if !defined(_STANDALONE)
+extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
+extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
+extern cnodeid_t cpuid_to_compact_node[MAXCPUS];
+#endif
+
#if !defined(DEBUG) && (!defined(SABLE) || defined(_STANDALONE))
#define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode])
#define SLOT_BITMASK (MAX_MEM_SLOTS - 1)
#define SLOT_SIZE (1LL<<SLOT_SHIFT)
-#if SABLE
-#define node_getnumslots(node) (1)
-#define NODE_MAX_MEM_SIZE SLOT_SIZE * 1
-#else
#define node_getnumslots(node) (MAX_MEM_SLOTS)
#define NODE_MAX_MEM_SIZE SLOT_SIZE * MAX_MEM_SLOTS
-#endif /* SABLE */
/*
* New stuff in here from Irix sys/pfdat.h.
-/**************************************************************************
- * *
- * Copyright (C) 1992-1997, Silicon Graphics, Inc. *
- * *
- * These coded instructions, statements, and computer programs contain *
- * unpublished proprietary information of Silicon Graphics, Inc., and *
- * are protected by Federal copyright law. They may not be disclosed *
- * to third parties or copied or duplicated in any form, in whole or *
- * in part, without the prior written consent of Silicon Graphics, Inc. *
- * *
- **************************************************************************/
-
-/*
+/* $Id$
+ *
+ * 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.
+ *
+ * Derived from IRIX <sys/SN/gda.h>.
+ *
+ * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
+ *
* gda.h -- Contains the data structure for the global data area,
* The GDA contains information communicated between the
* PROM, SYMMON, and the kernel.
*/
-
-#ifndef __SYS_SN_GDA_H__
-#define __SYS_SN_GDA_H__
+#ifndef _ASM_SN_GDA_H
+#define _ASM_SN_GDA_H
#include <asm/sn/addrs.h>
#define PROMOP_BIST1 0x0800 /* keep track of which BIST ran */
#define PROMOP_BIST2 0x1000 /* keep track of which BIST ran */
-#endif /* __SYS_SN_GDA_H__ */
+#endif /* _ASM_SN_GDA_H */
--- /dev/null
+/**************************************************************************
+ * *
+ * Copyright (C) 1992-1997, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+#ifndef __SYS_SN_INTR_H__
+#define __SYS_SN_INTR_H__
+
+/* Number of interrupt levels associated with each interrupt register. */
+#define N_INTPEND_BITS 64
+
+#define INT_PEND0_BASELVL 0
+#define INT_PEND1_BASELVL 64
+
+#define N_INTPENDJUNK_BITS 8
+#define INTPENDJUNK_CLRBIT 0x80
+
+#include <asm/sn/intr_public.h>
+
+#if _LANGUAGE_C
+
+/*
+ * Macros to manipulate the interrupt register on the calling hub chip.
+ */
+
+#define LOCAL_HUB_SEND_INTR(_level) LOCAL_HUB_S(PI_INT_PEND_MOD, \
+ (0x100|(_level)))
+#define REMOTE_HUB_SEND_INTR(_hub, _level) \
+ REMOTE_HUB_S((_hub), PI_INT_PEND_MOD, (0x100|(_level)))
+
+/*
+ * When clearing the interrupt, make sure this clear does make it
+ * to the hub. Otherwise we could end up losing interrupts.
+ * We do an uncached load of the int_pend0 register to ensure this.
+ */
+
+#define LOCAL_HUB_CLR_INTR(_level) \
+ LOCAL_HUB_S(PI_INT_PEND_MOD, (_level)), \
+ LOCAL_HUB_L(PI_INT_PEND0)
+#define REMOTE_HUB_CLR_INTR(_hub, _level) \
+ REMOTE_HUB_S((_hub), PI_INT_PEND_MOD, (_level)), \
+ REMOTE_HUB_L((_hub), PI_INT_PEND0)
+
+#else /* LANGUAGE_ASSEMBLY */
+
+#endif /* LANGUAGE_C */
+
+/*
+ * Hard-coded interrupt levels:
+ */
+
+/*
+ * L0 = SW1
+ * L1 = SW2
+ * L2 = INT_PEND0
+ * L3 = INT_PEND1
+ * L4 = RTC
+ * L5 = Profiling Timer
+ * L6 = Hub Errors
+ * L7 = Count/Compare (T5 counters)
+ */
+
+
+/* INT_PEND0 hard-coded bits. */
+#ifdef SABLE
+#define SDISK_INTR 63
+#endif
+#ifdef DEBUG_INTR_TSTAMP
+/* hard coded interrupt level for interrupt latency test interrupt */
+#define CPU_INTRLAT_B 62
+#define CPU_INTRLAT_A 61
+#endif
+
+/* Hardcoded bits required by software. */
+#define MSC_MESG_INTR 13
+#define CPU_ACTION_B 11
+#define CPU_ACTION_A 10
+
+/* These are determined by hardware: */
+#define CC_PEND_B 6
+#define CC_PEND_A 5
+#define UART_INTR 4
+#define PG_MIG_INTR 3
+#define GFX_INTR_B 2
+#define GFX_INTR_A 1
+#define RESERVED_INTR 0
+
+/* INT_PEND1 hard-coded bits: */
+#define MSC_PANIC_INTR 63
+#define NI_ERROR_INTR 62
+#define MD_COR_ERR_INTR 61
+#define COR_ERR_INTR_B 60
+#define COR_ERR_INTR_A 59
+#define CLK_ERR_INTR 58
+#define IO_ERROR_INTR 57 /* set up by prom */
+
+#define DEBUG_INTR_B 55 /* used by symmon to stop all cpus */
+#define DEBUG_INTR_A 54
+
+#define BRIDGE_ERROR_INTR 53 /* Setup by PROM to catch Bridge Errors */
+
+#define IP27_INTR_0 52 /* Reserved for PROM use */
+#define IP27_INTR_1 51 /* (do not use in Kernel) */
+#define IP27_INTR_2 50
+#define IP27_INTR_3 49
+#define IP27_INTR_4 48
+#define IP27_INTR_5 47
+#define IP27_INTR_6 46
+#define IP27_INTR_7 45
+
+#define TLB_INTR_B 44 /* used for tlb flush random */
+#define TLB_INTR_A 43
+
+#define LLP_PFAIL_INTR_B 42 /* see ml/SN/SN0/sysctlr.c */
+#define LLP_PFAIL_INTR_A 41
+
+#define NI_BRDCAST_ERR_B 40
+#define NI_BRDCAST_ERR_A 39
+
+#endif /* __SYS_SN_INTR_H__ */
--- /dev/null
+/**************************************************************************
+ * *
+ * Copyright (C) 1992-1997, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+#ifndef __SYS_SN_INTR_PUBLIC_H__
+#define __SYS_SN_INTR_PUBLIC_H__
+
+
+/* REMEMBER: If you change these, the whole world needs to be recompiled.
+ * It would also require changing the hubspl.s code and SN0/intr.c
+ * Currently, the spl code has no support for multiple INTPEND1 masks.
+ */
+
+#define N_INTPEND0_MASKS 1
+#define N_INTPEND1_MASKS 1
+
+#define INTPEND0_MAXMASK (N_INTPEND0_MASKS - 1)
+#define INTPEND1_MAXMASK (N_INTPEND1_MASKS - 1)
+
+#if _LANGUAGE_C
+#include <asm/sn/arch.h>
+
+struct intr_vecblk_s; /* defined in asm/sn/intr.h */
+
+/*
+ * The following are necessary to create the illusion of a CEL
+ * on the SN0 hub. We'll add more priority levels soon, but for
+ * now, any interrupt in a particular band effectively does an spl.
+ * These must be in the PDA since they're different for each processor.
+ * Users of this structure must hold the vector_lock in the appropriate vector
+ * block before modifying the mask arrays. There's only one vector block
+ * for each Hub so a lock in the PDA wouldn't be adequate.
+ */
+typedef struct hub_intmasks_s {
+ /*
+ * The masks are stored with the lowest-priority (most inclusive)
+ * in the lowest-numbered masks (i.e., 0, 1, 2...).
+ */
+ /* INT_PEND0: */
+ hubreg_t intpend0_masks[N_INTPEND0_MASKS];
+ /* INT_PEND1: */
+ hubreg_t intpend1_masks[N_INTPEND1_MASKS];
+ /* INT_PEND0: */
+ struct intr_vecblk_s *dispatch0;
+ /* INT_PEND1: */
+ struct intr_vecblk_s *dispatch1;
+} hub_intmasks_t;
+
+#endif /* _LANGUAGE_C */
+#endif /* __SYS_SN_INTR_PUBLIC_H__ */
+
-/* $Id: io.h,v 1.1 2000/02/04 07:40:53 ralf Exp $
+
+/* $Id: io.h,v 1.2 2000/02/02 16:35:57 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
#ifndef _ASM_SN_IO_H
#define _ASM_SN_IO_H
+#if !defined(CONFIG_SGI_IO)
#include <asm/sn/sn0/addrs.h>
#define IO_SPACE_BASE IO_BASE
/* No isa_* versions, the Origin doesn't have ISA / EISA bridges. */
+#else /* CONFIG_SGI_IO */
+
+#define IIO_ITTE_BASE 0x400160 /* base of translation table entries */
+#define IIO_ITTE(bigwin) (IIO_ITTE_BASE + 8*(bigwin))
+
+#define IIO_ITTE_OFFSET_BITS 5 /* size of offset field */
+#define IIO_ITTE_OFFSET_MASK ((1<<IIO_ITTE_OFFSET_BITS)-1)
+#define IIO_ITTE_OFFSET_SHIFT 0
+
+#define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */
+#define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1)
+#define IIO_ITTE_WIDGET_SHIFT 8
+
+#define IIO_ITTE_IOSP 1 /* I/O Space bit */
+#define IIO_ITTE_IOSP_MASK 1
+#define IIO_ITTE_IOSP_SHIFT 12
+#define HUB_PIO_MAP_TO_MEM 0
+#define HUB_PIO_MAP_TO_IO 1
+
+#define IIO_ITTE_INVALID_WIDGET 3 /* an invalid widget */
+
+#define IIO_ITTE_PUT(nasid, bigwin, io_or_mem, widget, addr) \
+ REMOTE_HUB_S((nasid), IIO_ITTE(bigwin), \
+ (((((addr) >> BWIN_SIZE_BITS) & \
+ IIO_ITTE_OFFSET_MASK) << IIO_ITTE_OFFSET_SHIFT) | \
+ (io_or_mem << IIO_ITTE_IOSP_SHIFT) | \
+ (((widget) & IIO_ITTE_WIDGET_MASK) << IIO_ITTE_WIDGET_SHIFT)))
+
+#define IIO_ITTE_DISABLE(nasid, bigwin) \
+ IIO_ITTE_PUT((nasid), HUB_PIO_MAP_TO_MEM, \
+ (bigwin), IIO_ITTE_INVALID_WIDGET, 0)
+
+#define IIO_ITTE_GET(nasid, bigwin) REMOTE_HUB_ADDR((nasid), IIO_ITTE(bigwin))
+
+/*
+ * Macro which takes the widget number, and returns the
+ * IO PRB address of that widget.
+ * value _x is expected to be a widget number in the range
+ * 0, 8 - 0xF
+ */
+#define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \
+ (_x) : \
+ (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) )
+
+#if defined (CONFIG_SGI_IP27)
+#include <asm/sn/sn0/hubio.h>
+#endif
+
+#endif /* CONFIG_SGI_IO */
+
#endif /* _ASM_SN_IO_H */
-/* $Id: klconfig.h,v 1.2 2000/01/16 01:39:08 ralf Exp $
+/* $Id$
*
* 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
#include <linux/types.h>
#include <asm/sn/types.h>
+#if defined(CONFIG_SGI_IP27)
#include <asm/sn/sn0/addrs.h>
//#include <sys/SN/router.h>
// XXX Stolen from <sys/SN/router.h>:
-#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */
+#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */
+#include <asm/sn/sn0/sn0_fru.h>
#include <asm/sn/agent.h>
//#include <sys/graph.h>
#include <asm/arc/types.h>
#include <asm/arc/hinv.h>
//#include <sys/xtalk/xbow.h>
-#include <asm/sn/sn0/sn0_fru.h>
-
+#if defined(CONFIG_SGI_IO)
+// The hack file has to be before vector and after sn0_fru....
+#include <asm/hack.h>
+#include <asm/sn/vector.h>
+#include <asm/xtalk/xtalk.h>
+#endif /* CONFIG_SGI_IO */
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/hack.h>
+#include <asm/sn/sn1/addrs.h>
+#include <asm/sn/vector.h>
+#include <sys/sn/router.h>
+#include <asm/sn/agent.h>
+#include <sys/graph.h>
+#include <asm/arc/types.h>
+#include <asm/arc/hinv.h>
+#include <asm/xtalk/xbow.h>
+#include <asm/xtalk/xtalk.h>
+#endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
#define KLCFGINFO_MAGIC 0xbeedbabe
typedef struct console_s {
+#if defined(CONFIG_SGI_IO) /* FIXME */
+ __psunsigned_t uart_base;
+ __psunsigned_t config_base;
+ __psunsigned_t memory_base;
+#else
unsigned long uart_base;
unsigned long config_base;
unsigned long memory_base;
+#endif
short baud;
short flag;
int type;
/* --- New Macros for the changed kl_config_hdr_t structure --- */
+#if defined(CONFIG_SGI_IO)
#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
- ((unsigned long)_k + (_k->ch_malloc_hdr_off)))
+ ((__psunsigned_t)_k + (_k->ch_malloc_hdr_off)))
+#else
+#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
+ (unsigned long)_k + (_k->ch_malloc_hdr_off)))
+#endif
#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
+#if defined(CONFIG_SGI_IO)
+#define PTR_CH_CONS_INFO(_k) ((console_t *)\
+ ((__psunsigned_t)_k + (_k->ch_cons_off)))
+#else
#define PTR_CH_CONS_INFO(_k) ((console_t *)\
((unsigned long)_k + (_k->ch_cons_off)))
+#endif
#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
#define KL_CPU_NONE (-1) /* no cpu present in slot */
/*
- * SN0 BOARD classes
+ * IP27 BOARD classes
*/
#define KLCLASS_MASK 0xf0
* hw ifc to xtalk and are not gfx
* class for sw purposes */
-#define KLCLASS_MAX 6 /* Bump this if a new CLASS is added */
-#define KLTYPE_MAX 8 /* Bump this if a new CLASS is added */
+#define KLCLASS_MAX 7 /* Bump this if a new CLASS is added */
+#define KLTYPE_MAX 10 /* Bump this if a new CLASS is added */
#define KLCLASS_UNKNOWN 0xf0
#define KLCLASS(_x) ((_x) & KLCLASS_MASK)
/*
- * SN0 board types
+ * IP27 board types
*/
#define KLTYPE_MASK 0x0f
#define KLTYPE_GSN_B (KLCLASS_IO | 0xD) /* Auxiliary GSN board */
#define KLTYPE_GFX (KLCLASS_GFX | 0x0) /* unknown graphics type */
-#define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on SN0 */
-#define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on SN0 */
+#define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on IP27 */
+#define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on IP27 */
#define KLTYPE_WEIRDROUTER (KLCLASS_ROUTER | 0x0)
#define KLTYPE_ROUTER (KLCLASS_ROUTER | 0x1)
#define KLTYPE_WEIRDMIDPLANE (KLCLASS_MIDPLANE | 0x0)
#define KLTYPE_MIDPLANE8 (KLCLASS_MIDPLANE | 0x1) /* 8 slot backplane */
#define KLTYPE_MIDPLANE KLTYPE_MIDPLANE8
+#define KLTYPE_PBRICK_XBOW (KLCLASS_MIDPLANE | 0x2)
+
+#define KLTYPE_IOBRICK (KLCLASS_IOBRICK | 0x0)
+#define KLTYPE_IBRICK (KLCLASS_IOBRICK | 0x1)
+#define KLTYPE_PBRICK (KLCLASS_IOBRICK | 0x2)
+#define KLTYPE_XBRICK (KLCLASS_IOBRICK | 0x3)
+
+#define KLTYPE_PBRICK_BRIDGE KLTYPE_PBRICK
/* The value of type should be more than 8 so that hinv prints
* out the board name from the NIC string. For values less than
/* external declarations of Linux kernel functions. */
-extern lboard_t *find_lboard(unsigned int type);
+extern lboard_t *find_lboard(lboard_t *start, unsigned char type);
+extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
+extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
+extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
+
+
+#if defined(CONFIG_SGI_IO)
+extern xwidgetnum_t nodevertex_widgetnum_get(vertex_hdl_t node_vtx);
+extern vertex_hdl_t nodevertex_xbow_peer_get(vertex_hdl_t node_vtx);
+extern lboard_t *find_gfxpipe(int pipenum);
+extern void setup_gfxpipe_link(vertex_hdl_t vhdl,int pipenum);
+extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
+extern lboard_t *find_lboard_module_class(lboard_t *start, moduleid_t mod,
+ unsigned char brd_class);
+extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
+extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
+extern lboard_t *find_lboard_modslot(lboard_t *start, moduleid_t mod, slotid_t slot);
+extern lboard_t *find_lboard_module(lboard_t *start, moduleid_t mod);
+extern lboard_t *get_board_name(nasid_t nasid, moduleid_t mod, slotid_t slot, char *name);
+extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
+extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
+extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
+extern klcpu_t *get_cpuinfo(cpuid_t cpu);
+extern int update_klcfg_cpuinfo(nasid_t, int);
+extern void board_to_path(lboard_t *brd, char *path);
+extern moduleid_t get_module_id(nasid_t nasid);
+extern void nic_name_convert(char *old_name, char *new_name);
+extern int module_brds(nasid_t nasid, lboard_t **module_brds, int n);
+extern lboard_t *brd_from_key(ulong_t key);
+extern void device_component_canonical_name_get(lboard_t *,klinfo_t *,
+ char *);
+extern int board_serial_number_get(lboard_t *,char *);
+extern int is_master_baseio(nasid_t,moduleid_t,slotid_t);
+extern nasid_t get_actual_nasid(lboard_t *brd) ;
+extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
+#else /* CONFIG_SGI_IO */
+extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
+#endif /* CONFIG_SGI_IO */
#endif /* _ASM_SN_KLCONFIG_H */
-/* $Id: kldir.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
#ifndef _ASM_SN_KLDIR_H
#define _ASM_SN_KLDIR_H
+#if defined(CONFIG_SGI_IO)
+#include <asm/hack.h>
+#endif
+
/*
* The kldir memory area resides at a fixed place in each node's memory and
- * provides pointers to most other SN0 memory areas. This allows us to
+ * provides pointers to most other IP27 memory areas. This allows us to
* resize and/or relocate memory areas at a later time without breaking all
* firmware and kernels that use them. Indices in the array are
* permanently dedicated to areas listed below. Some memory areas (marked
#define KLDIR_OFF_STRIDE 0x28
#endif /* LANGUAGE_ASSEMBLY */
+#if !defined(CONFIG_SGI_IO)
+
/*
* This is defined here because IP27_SYMMON_STK_SIZE must be at least what
* we define here. Since it's set up in the prom. We can't redefine it later
#define KLDIR_ENT_SIZE 0x40
#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
+#endif /* !CONFIG_SGI_IO */
+
#ifdef _LANGUAGE_C
typedef struct kldir_ent_s {
u64 magic; /* Indicates validity of entry */
off_t offset; /* Offset from start of node space */
+#if defined(CONFIG_SGI_IO) /* FIXME */
+ __psunsigned_t pointer; /* Pointer to area in some cases */
+#else
unsigned long pointer; /* Pointer to area in some cases */
+#endif
size_t size; /* Size in bytes */
u64 count; /* Repeat count if array, 1 if not */
size_t stride; /* Stride if array, 0 if not */
} kldir_ent_t;
#endif /* _LANGUAGE_C */
+#if defined(CONFIG_SGI_IO)
+
+#define KLDIR_ENT_SIZE 0x40
+#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
+
+/*
+ * The actual offsets of each memory area are machine-dependent
+ */
+#ifdef CONFIG_SGI_IP27
+// Not yet #include <asm/sn/sn0/kldir.h>
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/sn/sn1/kldir.h>
+#else
+#error "kldir.h is currently defined for IP27 and IP35 platforms only"
+#endif
+
+#endif /* CONFIG_SGI_IO */
+
#endif /* _ASM_SN_KLDIR_H */
--- /dev/null
+/* $Id: launch.h,v 1.3 2000/04/21 04:09:13 pfg 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
+ * for more details.
+ *
+ * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2000 by Colin Ngam
+ */
+#ifndef _ASM_SN_LAUNCH_H
+#define _ASM_SN_LAUNCH_H
+
+#include <linux/config.h>
+#include <asm/sn/types.h>
+#include <asm/sn/addrs.h>
+
+/*
+ * The launch data structure resides at a fixed place in each node's memory
+ * and is used to communicate between the master processor and the slave
+ * processors.
+ *
+ * The master stores launch parameters in the launch structure
+ * corresponding to a target processor that is in a slave loop, then sends
+ * an interrupt to the slave processor. The slave calls the desired
+ * function, then returns to the slave loop. The master may poll or wait
+ * for the slaves to finish.
+ *
+ * There is an array of launch structures, one per CPU on the node. One
+ * interrupt level is used per local CPU.
+ */
+
+#define LAUNCH_MAGIC 0xaddbead2addbead3
+#ifdef CONFIG_SGI_IP27
+#define LAUNCH_SIZEOF 0x100
+#define LAUNCH_PADSZ 0xa0
+#endif
+
+#define LAUNCH_OFF_MAGIC 0x00 /* Struct offsets for assembly */
+#define LAUNCH_OFF_BUSY 0x08
+#define LAUNCH_OFF_CALL 0x10
+#define LAUNCH_OFF_CALLC 0x18
+#define LAUNCH_OFF_CALLPARM 0x20
+#define LAUNCH_OFF_STACK 0x28
+#define LAUNCH_OFF_GP 0x30
+#define LAUNCH_OFF_BEVUTLB 0x38
+#define LAUNCH_OFF_BEVNORMAL 0x40
+#define LAUNCH_OFF_BEVECC 0x48
+
+#define LAUNCH_STATE_DONE 0 /* Return value of LAUNCH_POLL */
+#define LAUNCH_STATE_SENT 1
+#define LAUNCH_STATE_RECD 2
+
+/*
+ * The launch routine is called only if the complement address is correct.
+ *
+ * Before control is transferred to a routine, the compliment address
+ * is zeroed (invalidated) to prevent an accidental call from a spurious
+ * interrupt.
+ *
+ * The slave_launch routine turns on the BUSY flag, and the slave loop
+ * clears the BUSY flag after control is returned to it.
+ */
+
+#ifdef _LANGUAGE_C
+
+typedef int launch_state_t;
+typedef void (*launch_proc_t)(u64 call_parm);
+
+typedef struct launch_s {
+ volatile u64 magic; /* Magic number */
+ volatile u64 busy; /* Slave currently active */
+ volatile launch_proc_t call_addr; /* Func. for slave to call */
+ volatile u64 call_addr_c; /* 1's complement of call_addr*/
+ volatile u64 call_parm; /* Single parm passed to call*/
+ volatile void *stack_addr; /* Stack pointer for slave function */
+ volatile void *gp_addr; /* Global pointer for slave func. */
+ volatile char *bevutlb;/* Address of bev utlb ex handler */
+ volatile char *bevnormal;/*Address of bev normal ex handler */
+ volatile char *bevecc;/* Address of bev cache err handler */
+ volatile char pad[160]; /* Pad to LAUNCH_SIZEOF */
+} launch_t;
+
+/*
+ * PROM entry points for launch routines are determined by IPxxprom/start.s
+ */
+
+#define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \
+ launch_proc_t call_addr, \
+ u64 call_parm, \
+ void *stack_addr, \
+ void *gp_addr)) \
+ IP27PROM_LAUNCHSLAVE)
+
+#define LAUNCH_WAIT (*(void (*)(int nasid, int cpu, int timeout_msec)) \
+ IP27PROM_WAITSLAVE)
+
+#define LAUNCH_POLL (*(launch_state_t (*)(int nasid, int cpu)) \
+ IP27PROM_POLLSLAVE)
+
+#define LAUNCH_LOOP (*(void (*)(void)) \
+ IP27PROM_SLAVELOOP)
+
+#define LAUNCH_FLASH (*(void (*)(void)) \
+ IP27PROM_FLASHLEDS)
+
+#ifdef _STANDALONE
+
+launch_t *launch_get(int nasid, int cpu);
+launch_t *launch_get_current(void);
+void launch_loop(void);
+void launch_slave(int nasid, int cpu,
+ launch_proc_t call_addr,
+ __int64_t call_parm,
+ void *stack_addr,
+ void *gp_addr);
+int launch_wait(int nasid, int cpu, int timeout_msec);
+launch_state_t launch_poll(int nasid, int cpu);
+
+#endif /* _STANDALONE */
+
+#endif /* _LANGUAGE_C */
+
+#endif /* _ASM_SN_LAUNCH_H */
--- /dev/null
+/**************************************************************************
+ * *
+ * Copyright (C) 1992-1997, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+#ifndef __SYS_SN_NMI_H__
+#define __SYS_SN_NMI_H__
+
+#ident "$Revision: 1.1 $"
+
+#include <asm/sn/addrs.h>
+
+/*
+ * The launch data structure resides at a fixed place in each node's memory
+ * and is used to communicate between the master processor and the slave
+ * processors.
+ *
+ * The master stores launch parameters in the launch structure
+ * corresponding to a target processor that is in a slave loop, then sends
+ * an interrupt to the slave processor. The slave calls the desired
+ * function, followed by an optional rendezvous function, then returns to
+ * the slave loop. The master does not wait for the slaves before
+ * returning.
+ *
+ * There is an array of launch structures, one per CPU on the node. One
+ * interrupt level is used per CPU.
+ */
+
+#define NMI_MAGIC 0x48414d4d455201
+#define NMI_SIZEOF 0x40
+
+#define NMI_OFF_MAGIC 0x00 /* Struct offsets for assembly */
+#define NMI_OFF_FLAGS 0x08
+#define NMI_OFF_CALL 0x10
+#define NMI_OFF_CALLC 0x18
+#define NMI_OFF_CALLPARM 0x20
+#define NMI_OFF_GMASTER 0x28
+
+/*
+ * The NMI routine is called only if the complement address is
+ * correct.
+ *
+ * Before control is transferred to a routine, the compliment address
+ * is zeroed (invalidated) to prevent an accidental call from a spurious
+ * interrupt.
+ *
+ */
+
+#ifdef _LANGUAGE_C
+
+typedef struct nmi_s {
+ volatile unsigned long magic; /* Magic number */
+ volatile unsigned long flags; /* Combination of flags above */
+ volatile void *call_addr; /* Routine for slave to call */
+ volatile void *call_addr_c; /* 1's complement of address */
+ volatile void *call_parm; /* Single parm passed to call */
+ volatile unsigned long gmaster; /* Flag true only on global master*/
+} nmi_t;
+
+#endif /* _LANGUAGE_C */
+
+/* Following definitions are needed both in the prom & the kernel
+ * to identify the format of the nmi cpu register save area in the
+ * low memory on each node.
+ */
+#ifdef _LANGUAGE_C
+
+struct reg_struct {
+ unsigned long gpr[32];
+ unsigned long sr;
+ unsigned long cause;
+ unsigned long epc;
+ unsigned long badva;
+ unsigned long error_epc;
+ unsigned long cache_err;
+ unsigned long nmi_sr;
+};
+
+#endif /* _LANGUAGE_C */
+
+/* These are the assembly language offsets into the reg_struct structure */
+
+#define R0_OFF 0x0
+#define R1_OFF 0x8
+#define R2_OFF 0x10
+#define R3_OFF 0x18
+#define R4_OFF 0x20
+#define R5_OFF 0x28
+#define R6_OFF 0x30
+#define R7_OFF 0x38
+#define R8_OFF 0x40
+#define R9_OFF 0x48
+#define R10_OFF 0x50
+#define R11_OFF 0x58
+#define R12_OFF 0x60
+#define R13_OFF 0x68
+#define R14_OFF 0x70
+#define R15_OFF 0x78
+#define R16_OFF 0x80
+#define R17_OFF 0x88
+#define R18_OFF 0x90
+#define R19_OFF 0x98
+#define R20_OFF 0xa0
+#define R21_OFF 0xa8
+#define R22_OFF 0xb0
+#define R23_OFF 0xb8
+#define R24_OFF 0xc0
+#define R25_OFF 0xc8
+#define R26_OFF 0xd0
+#define R27_OFF 0xd8
+#define R28_OFF 0xe0
+#define R29_OFF 0xe8
+#define R30_OFF 0xf0
+#define R31_OFF 0xf8
+#define SR_OFF 0x100
+#define CAUSE_OFF 0x108
+#define EPC_OFF 0x110
+#define BADVA_OFF 0x118
+#define ERROR_EPC_OFF 0x120
+#define CACHE_ERR_OFF 0x128
+#define NMISR_OFF 0x130
+
+
+#endif /* __SYS_SN_NMI_H__ */
-/* $Id: addrs.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: arch.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: hub.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: hubio.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: hubni.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: hubpi.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: ip27.h,v 1.2 2000/01/26 06:11:50 kanoj Exp $
+/* $Id$
*
* 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
/* Sanity hazzard ... Below all the Origin hacks are following. */
-#define IOC3_SERIAL_INT 8
-#define IOC3_ETH_INT 9
-#define SCSI1_INT 1
#define SCSI0_INT 0
+#define SCSI1_INT 1
+#define CPU_RESCHED_A_IRQ 3
+#define CPU_RESCHED_B_IRQ 4
+#define QLOGICFC_SLOT5 5
+#define CPU_CALL_A_IRQ 6
+#define CPU_CALL_B_IRQ 7
+#define IOC3_SERIAL_INT 8
+/*#define IOC3_ETH_INT 9*/
+#define IOC3_ETH_INT 0x0809 /* nasid 0, wid 0x8 */
+#define SN00_BRIDGE 0x9200000008000000
+#define SN00I_BRIDGE0 0x920000000b000000
+#define SN00I_BRIDGE1 0x920000000e000000
+#define SN00I_BRIDGE2 0x920000000f000000
#endif /* _ASM_SN_SN0_IP27_H */
-/* $Id: sn0_fru.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
--- /dev/null
+extern cnodeid_t get_compact_nodeid(void);
+extern void hub_rtc_init(cnodeid_t);
+extern void cpu_time_init(void);
+extern void per_cpu_init(void);
+extern void install_cpuintr(cpuid_t cpu);
+extern void install_tlbintr(cpuid_t cpu);
-/* $Id: types.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
#include <linux/types.h>
+typedef unsigned long cpuid_t;
+typedef unsigned long cpumask_t;
+typedef unsigned long cnodemask_t;
typedef signed short nasid_t; /* node id in numa-as-id space */
typedef signed short cnodeid_t; /* node id in compact-id space */
typedef signed char partid_t; /* partition ID type */
-/* $Id: socket.h,v 1.1 1999/08/18 23:37:52 ralf Exp $
+/* $Id: socket.h,v 1.2 2000/02/25 21:52:09 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
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
+#ifdef __KERNEL__
+
#define SO_PEERNAME 28
/* Types of sockets. */
#define SOCK_PACKET 10 /* Linux specific way of getting packets at
the dev level. For writing rarp and
other similar things on the user level. */
+#endif /* __KERNEL__ */
#endif /* _ASM_SOCKET_H */
-/* $Id: sockios.h,v 1.1 1999/08/18 23:37:52 ralf Exp $
+/* $Id$
*
* 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
#include <asm/atomic.h>
#include <asm/hardirq.h>
-extern unsigned int local_bh_count[NR_CPUS];
-
-#define cpu_bh_disable(cpu) do { local_bh_count[(cpu)]++; barrier(); } while (0)
-#define cpu_bh_enable(cpu) do { barrier(); local_bh_count[(cpu)]--; } while (0)
+#define cpu_bh_disable(cpu) do { local_bh_count(cpu)++; barrier(); } while (0)
+#define cpu_bh_enable(cpu) do { barrier(); local_bh_count(cpu)--; } while (0)
#define local_bh_disable() cpu_bh_disable(smp_processor_id())
#define local_bh_enable() cpu_bh_enable(smp_processor_id())
-#define in_softirq() (local_bh_count[smp_processor_id()] != 0)
+#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#endif /* _ASM_SOFTIRQ_H */
#define spin_lock_init(x) do { (x)->lock = 0; } while(0);
+#define spin_is_locked(x) ((x)->lock != 0)
+#define spin_unlock_wait(x) ({ do { barrier(); } while ((x)->lock); })
+
/*
* Simple spin lock operations. There are two variants, one clears IRQ's
* on the local processor, one does not.
: "memory");
}
-#define spin_trylock(lock) (!test_and_set_bit(0,(lock)))
+static inline unsigned int spin_trylock(spinlock_t *lock)
+{
+ unsigned int temp, res;
+
+ __asm__ __volatile__(
+ ".set\tnoreorder\t\t\t# spin_trylock\n\t"
+ "1:\tll\t%0, %1\n\t"
+ "or\t%2, %0, %3\n\t"
+ "sc\t%2, %1\n\t"
+ "beqz\t%2, 1b\n\t"
+ " and\t%2, %0, %3\n\t"
+ ".set\treorder"
+ :"=&r" (temp), "=m" (*lock), "=&r" (res)
+ :"r" (1), "m" (*lock)
+ : "memory");
+
+ return res == 0;
+}
/*
* Read-write spinlocks, allowing multiple readers but only one writer.
"sub\t%1, 1\n\t"
"sc\t%1, %0\n\t"
"beqz\t%1, 1b\n\t"
+ "sync\n\t"
".set\treorder"
: "=o" (__dummy_lock(rw)), "=&r" (tmp)
: "o" (__dummy_lock(rw))
-/* $Id: stackframe.h,v 1.4 2000/02/24 03:24:38 ulfc Exp $
+/* $Id: stackframe.h,v 1.3 1999/12/04 03:59:12 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
#ifndef _ASM_STACKFRAME_H
#define _ASM_STACKFRAME_H
+#include <linux/config.h>
+
#include <asm/asm.h>
#include <asm/offset.h>
+#include <asm/processor.h>
+#include <asm/addrspace.h>
#ifdef _LANGUAGE_C
move k1, sp
.set reorder
/* Called from user mode, new stack. */
+#ifndef CONFIG_SMP
lui k1, %hi(kernelsp)
ld k1, %lo(kernelsp)(k1)
+#else
+ mfc0 k0, CP0_WATCHLO
+ mfc0 k1, CP0_WATCHHI
+ dsll32 k0, k0, 0 /* Get rid of sign extension */
+ dsrl32 k0, k0, 0 /* Get rid of sign extension */
+ dsll32 k1, k1, 0
+ or k1, k1, k0
+ li k0, K0BASE
+ or k1, k1, k0
+ daddiu k1, k1, KERNEL_STACK_SIZE-32
+#endif
8: move k0, sp
dsubu sp, k1, PT_SIZE
sd k0, PT_R29(sp)
unsigned int st_gen;
};
+struct stat32 {
+ __kernel_dev_t32 st_dev;
+ int st_pad1[3];
+ __kernel_ino_t32 st_ino;
+ __kernel_mode_t32 st_mode;
+ __kernel_nlink_t32 st_nlink;
+ __kernel_uid_t32 st_uid;
+ __kernel_gid_t32 st_gid;
+ __kernel_dev_t32 st_rdev;
+ int st_pad2[2];
+ __kernel_off_t32 st_size;
+ int st_pad3;
+ __kernel_time_t32 st_atime;
+ int reserved0;
+ __kernel_time_t32 st_mtime;
+ int reserved1;
+ __kernel_time_t32 st_ctime;
+ int reserved2;
+ int st_blksize;
+ int st_blocks;
+ char st_fstype[16]; /* Filesystem type name */
+ int st_pad4[8];
+ unsigned int st_flags;
+ unsigned int st_gen;
+};
+
struct stat {
dev_t st_dev;
long st_pad1[3]; /* Reserved for network id */
-/* $Id: statfs.h,v 1.1 1999/08/18 23:37:52 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: string.h,v 1.4 2000/01/16 01:37:19 ralf Exp $
+/* $Id: string.h,v 1.3 1999/12/04 03:59:12 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
-/* $Id: sysmips.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: sysmips.h,v 1.1 1999/10/08 21:07:57 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
#ifndef _ASM_SYSTEM_H
#define _ASM_SYSTEM_H
+#include <linux/config.h>
+
#include <asm/sgidefs.h>
#include <linux/kernel.h>
: "$8", "$9", "memory");
}
-/*
- * Non-SMP versions ...
- */
-#define sti() __sti()
+#ifdef CONFIG_SMP
+
+extern void __global_cli(void);
+extern void __global_sti(void);
+extern unsigned long __global_save_flags(void);
+extern void __global_restore_flags(unsigned long);
+#define cli() __global_cli()
+#define sti() __global_sti()
+#define save_flags(x) ((x)=__global_save_flags())
+#define restore_flags(x) __global_restore_flags(x)
+#define save_and_cli(x) do { save_flags(flags); cli(); } while(0)
+
+#else
+
#define cli() __cli()
+#define sti() __sti()
#define save_flags(x) __save_flags(x)
-#define save_and_cli(x) __save_and_cli(x)
#define restore_flags(x) __restore_flags(x)
+#define save_and_cli(x) __save_and_cli(x)
+
+#endif /* CONFIG_SMP */
/* For spinlocks etc */
#define local_irq_save(x) __save_and_cli(x);
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
#define prepare_to_switch() do { } while(0)
+
+extern asmlinkage void lazy_fpu_switch(void *, void *);
+extern asmlinkage void init_fpu(void);
+extern asmlinkage void save_fp(void *);
+
+#ifdef CONFIG_SMP
+#define SWITCH_DO_LAZY_FPU \
+ if (prev->flags & PF_USEDFPU) { \
+ lazy_fpu_switch(prev, 0); \
+ set_cp0_status(ST0_CU1, ~ST0_CU1); \
+ prev->flags &= ~PF_USEDFPU; \
+ }
+#else /* CONFIG_SMP */
+#define SWITCH_DO_LAZY_FPU do { } while(0)
+#endif /* CONFIG_SMP */
+
#define switch_to(prev,next,last) \
do { \
+ SWITCH_DO_LAZY_FPU; \
(last) = resume(prev, next); \
} while(0)
-/* $Id: termbits.h,v 1.1 1999/08/18 23:37:52 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: termios.h,v 1.3 2000/02/18 00:24:49 ralf Exp $
+/* $Id: termios.h,v 1.2 2000/01/27 23:45:30 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
static inline cycles_t get_cycles (void)
{
- return read_32bit_cp0_register(CP0_COUNT);
+ cycles_t val;
+
+ __asm__ __volatile__(
+ ".set noreorder\n\t"
+ "mfc0 %0, $9\n\t"
+ ".set reorder"
+ : "=r" (val));
+
+ return val;
}
#endif /* _ASM_TIMEX_H */
-/* $Id: types.h,v 1.3 2000/02/18 00:24:49 ralf Exp $
+/* $Id: types.h,v 1.2 1999/12/04 03:59:12 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
-/* $Id: uaccess.h,v 1.5 2000/02/21 18:05:07 ralf Exp $
+/* $Id: uaccess.h,v 1.4 2000/02/19 00:33:10 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
-/* $Id: ucontext.h,v 1.1 1999/09/28 22:27:20 ralf Exp $
+/* $Id: ucontext.h,v 1.1 1999/09/27 16:01:40 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
-/* $Id: unaligned.h,v 1.1 1999/08/19 22:56:35 ralf Exp $
+/* $Id$
*
* 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
#define __NR_Linux32_ptrace (__NR_Linux32 + 26)
#define __NR_Linux32_alarm (__NR_Linux32 + 27)
#define __NR_Linux32_oldfstat (__NR_Linux32 + 28)
-#define __NR_Linux32_unused29 (__NR_Linux32 + 29)
+#define __NR_Linux32_pause (__NR_Linux32 + 29)
#define __NR_Linux32_utime (__NR_Linux32 + 30)
#define __NR_Linux32_stty (__NR_Linux32 + 31)
#define __NR_Linux32_gtty (__NR_Linux32 + 32)
#define __NR_Linux32_lstat64 (__NR_Linux32 + 214)
#define __NR_Linux32_fstat64 (__NR_Linux32 + 215)
#define __NR_Linux32_root_pivot (__NR_Linux32 + 216)
+#define __NR_Linux32_mincore (__NR_Linux32 + 217)
+#define __NR_Linux32_madvise (__NR_Linux32 + 218)
/*
* Offset of the last Linux o32 flavoured syscall
*/
-#define __NR_Linux32_syscalls 216
+#define __NR_Linux32_syscalls 218
/*
* Linux 64-bit syscalls are in the range from 5000 to 5999.
#define __NR_ptrace (__NR_Linux + 26)
#define __NR_alarm (__NR_Linux + 27)
#define __NR_oldfstat (__NR_Linux + 28)
-#define __NR_unused29 (__NR_Linux + 29)
+#define __NR_pause (__NR_Linux + 29)
#define __NR_utime (__NR_Linux + 30)
#define __NR_stty (__NR_Linux + 31)
#define __NR_gtty (__NR_Linux + 32)
#define __NR_getpmsg (__NR_Linux + 208)
#define __NR_putpmsg (__NR_Linux + 209)
#define __NR_root_pivot (__NR_Linux + 210)
+#define __NR_mincore (__NR_Linux + 211)
+#define __NR_madvise (__NR_Linux + 212)
/*
* Offset of the last Linux flavoured syscall
*/
-#define __NR_Linux_syscalls 210
+#define __NR_Linux_syscalls 212
#ifndef _LANGUAGE_ASSEMBLY
-/* $Id: user.h,v 1.1 1999/08/20 21:59:09 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: usioctl.h,v 1.1 1999/08/19 22:56:35 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: watch.h,v 1.1 1999/09/28 22:27:20 ralf Exp $
+/* $Id: watch.h,v 1.1 1999/09/27 16:01:41 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
-/* $Id: xtalk.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
-/* $Id: xwidget.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
+/* $Id$
*
* 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
if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT)) {
p->p_opptr = current;
- if (!(current->flags & PF_PTRACED))
+ if (!(p->flags & PF_PTRACED))
p->p_pptr = current;
}
p->p_cptr = NULL;
int i;
for(i = 0; i < MAX_NR_ZONES; i++) {
zone_t *zone = pgdat->node_zones+ i;
+ if (tsk->need_resched)
+ schedule();
if (!zone->size || !zone->zone_wake_kswapd)
continue;
- something_to_do = 1;
+ if (zone->free_pages < zone->pages_low)
+ something_to_do = 1;
do_try_to_free_pages(GFP_KSWAPD);
}
run_task_queue(&tq_disk);
pgdat = pgdat->node_next;
} while (pgdat);
- if (tsk->need_resched || !something_to_do) {
+ if (!something_to_do) {
tsk->state = TASK_INTERRUPTIBLE;
interruptible_sleep_on(&kswapd_wait);
}