summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/boot/Makefile2
-rw-r--r--arch/alpha/config.in7
-rw-r--r--arch/alpha/kernel/core_cia.c12
-rw-r--r--arch/alpha/kernel/core_titan.c11
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/osf_sys.c2
-rw-r--r--arch/alpha/kernel/pci.c11
-rw-r--r--arch/alpha/kernel/setup.c2
-rw-r--r--arch/alpha/kernel/sys_cabriolet.c2
-rw-r--r--arch/alpha/kernel/sys_dp264.c12
-rw-r--r--arch/alpha/kernel/sys_eb64p.c9
-rw-r--r--arch/alpha/kernel/sys_noritake.c37
-rw-r--r--arch/arm/Makefile10
-rw-r--r--arch/arm/boot/compressed/Makefile2
-rw-r--r--arch/arm/boot/compressed/head-sa1100.S80
-rw-r--r--arch/arm/boot/compressed/setup-sa1100.S130
-rw-r--r--arch/arm/config.in41
-rw-r--r--arch/arm/kernel/Makefile22
-rw-r--r--arch/arm/kernel/arch.c40
-rw-r--r--arch/arm/kernel/armksyms.c9
-rw-r--r--arch/arm/kernel/bios32.c2
-rw-r--r--arch/arm/kernel/dma-a5k.c99
-rw-r--r--arch/arm/kernel/dma-arc.c260
-rw-r--r--arch/arm/kernel/dma-dummy.c34
-rw-r--r--arch/arm/kernel/dma-footbridge.c88
-rw-r--r--arch/arm/kernel/dma-isa.c44
-rw-r--r--arch/arm/kernel/dma-isa.h29
-rw-r--r--arch/arm/kernel/dma-rpc.c312
-rw-r--r--arch/arm/kernel/dma.c307
-rw-r--r--arch/arm/kernel/dma.h68
-rw-r--r--arch/arm/kernel/ecard.c11
-rw-r--r--arch/arm/kernel/hw-sa1100.c18
-rw-r--r--arch/arm/kernel/oldlatches.c57
-rw-r--r--arch/arm/kernel/process.c31
-rw-r--r--arch/arm/kernel/signal.c1
-rw-r--r--arch/arm/kernel/sys_arm.c3
-rw-r--r--arch/arm/kernel/time.c6
-rw-r--r--arch/arm/kernel/traps.c3
-rw-r--r--arch/arm/lib/Makefile3
-rw-r--r--arch/arm/mm/init.c26
-rw-r--r--arch/arm/mm/mm-sa1100.c20
-rw-r--r--arch/arm/vmlinux-armo.lds.in1
-rw-r--r--arch/arm/vmlinux-armv.lds.in5
-rw-r--r--arch/i386/boot/bootsect.S2
-rw-r--r--arch/i386/boot/setup.S6
-rw-r--r--arch/i386/kernel/acpi.c71
-rw-r--r--arch/i386/kernel/apm.c2
-rw-r--r--arch/i386/kernel/i8259.c2
-rw-r--r--arch/i386/kernel/io_apic.c4
-rw-r--r--arch/i386/kernel/irq.c2
-rw-r--r--arch/i386/kernel/traps.c2
-rw-r--r--arch/i386/lib/Makefile2
-rw-r--r--arch/ia64/kernel/irq.c2
-rw-r--r--arch/mips/baget/vacserial.c2
-rw-r--r--arch/mips/defconfig-cobalt6
-rw-r--r--arch/ppc/kernel/pci.c1
-rw-r--r--arch/ppc/kernel/pmac_backlight.c1
-rw-r--r--arch/ppc/kernel/pmac_setup.c2
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c11
-rw-r--r--arch/ppc/kernel/syscalls.c1
-rw-r--r--arch/s390/kernel/irq.c4
-rw-r--r--arch/sparc/Makefile5
-rw-r--r--arch/sparc/kernel/Makefile67
-rw-r--r--arch/sparc/kernel/check_asm.sh21
-rw-r--r--arch/sparc/kernel/irq.c2
-rw-r--r--arch/sparc/kernel/sun4d_irq.c2
-rw-r--r--arch/sparc/mm/hypersparc.S13
-rw-r--r--arch/sparc/mm/swift.S13
-rw-r--r--arch/sparc/mm/tsunami.S13
-rw-r--r--arch/sparc/mm/viking.S13
-rw-r--r--arch/sparc64/Makefile5
-rw-r--r--arch/sparc64/kernel/Makefile122
-rw-r--r--arch/sparc64/kernel/check_asm.sh22
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c11
-rw-r--r--arch/sparc64/kernel/systbls.S6
-rw-r--r--arch/sparc64/lib/blockops.S36
-rw-r--r--arch/sparc64/solaris/socksys.c3
77 files changed, 1269 insertions, 1079 deletions
diff --git a/arch/alpha/boot/Makefile b/arch/alpha/boot/Makefile
index 6bd6cb03f..47a472524 100644
--- a/arch/alpha/boot/Makefile
+++ b/arch/alpha/boot/Makefile
@@ -80,7 +80,7 @@ tools/bootph: bootpheader $(OBJSTRIP)
$(OBJSTRIP) -vb bootpheader tools/bootph
$(OBJSTRIP): $(OBJSTRIP).c
- $(HOSTCC) $(OBJSTRIP).c -o $(OBJSTRIP)
+ $(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP)
tools/mkbb: tools/mkbb.c
$(HOSTCC) tools/mkbb.c -o tools/mkbb
diff --git a/arch/alpha/config.in b/arch/alpha/config.in
index 687994802..ed44cb67c 100644
--- a/arch/alpha/config.in
+++ b/arch/alpha/config.in
@@ -92,6 +92,10 @@ then
define_bool CONFIG_ALPHA_EV4 y
define_bool CONFIG_ALPHA_APECS y
fi
+if [ "$CONFIG_ALPHA_CABRIOLET" = "y" ]
+then
+ define_bool CONFIG_ALPHA_EB64P y
+fi
if [ "$CONFIG_ALPHA_EB164" = "y" -o "$CONFIG_ALPHA_PC164" = "y" \
-o "$CONFIG_ALPHA_ALCOR" = "y" -o "$CONFIG_ALPHA_TAKARA" = "y" ]
then
@@ -175,7 +179,8 @@ if [ "$CONFIG_ALPHA_CABRIOLET" = "y" -o "$CONFIG_ALPHA_AVANTI" = "y" \
-o "$CONFIG_ALPHA_EB64P" = "y" -o "$CONFIG_ALPHA_PC164" = "y" \
-o "$CONFIG_ALPHA_TAKARA" = "y" -o "$CONFIG_ALPHA_EB164" = "y" \
-o "$CONFIG_ALPHA_ALCOR" = "y" -o "$CONFIG_ALPHA_MIATA" = "y" \
- -o "$CONFIG_ALPHA_LX164" = "y" -o "$CONFIG_ALPHA_SX164" = "y" ]
+ -o "$CONFIG_ALPHA_LX164" = "y" -o "$CONFIG_ALPHA_SX164" = "y" \
+ -o "$CONFIG_ALPHA_NAUTILUS" = "y" ]
then
bool 'Use SRM as bootloader' CONFIG_ALPHA_SRM
fi
diff --git a/arch/alpha/kernel/core_cia.c b/arch/alpha/kernel/core_cia.c
index 348bd843f..5aa00254b 100644
--- a/arch/alpha/kernel/core_cia.c
+++ b/arch/alpha/kernel/core_cia.c
@@ -779,8 +779,16 @@ cia_machine_check(unsigned long vector, unsigned long la_ptr,
cia = (void *)(la_ptr + com->sys_offset);
if (com->code == 0x202) {
- printk(KERN_CRIT "CIA PCI machine check: err0=%08x "
- "err1=%08x err2=%08x\n",
+ printk(KERN_CRIT "CIA PCI machine check: code=%x\n"
+ " cpu_err0=%08x cpu_err1=%08x cia_err=%08x\n"
+ " cia_stat=%08x err_mask=%08x cia_syn=%08x\n"
+ " mem_err0=%08x mem_err1=%08x\n"
+ " pci_err0=%08x pci_err1=%08x pci_err2=%08x\n",
+ (int) com->code,
+ (int) cia->cpu_err0, (int) cia->cpu_err1,
+ (int) cia->cia_err, (int) cia->cia_stat,
+ (int) cia->err_mask, (int) cia->cia_syn,
+ (int) cia->mem_err0, (int) cia->mem_err1,
(int) cia->pci_err0, (int) cia->pci_err1,
(int) cia->pci_err2);
expected = 1;
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index fac75cab5..5e53d091c 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -284,6 +284,17 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index)
hose->io_space = alloc_resource();
hose->mem_space = alloc_resource();
+ /* This is for userland consumption. For some reason, the 40-bit
+ PIO bias that we use in the kernel through KSEG didn't work for
+ the page table based user mappings. So make sure we get the
+ 43-bit PIO bias. */
+ hose->sparse_mem_base = 0;
+ hose->sparse_io_base = 0;
+ hose->dense_mem_base
+ = (TITAN_MEM(index) & 0xffffffffff) | 0x80000000000;
+ hose->dense_io_base
+ = (TITAN_IO(index) & 0xffffffffff) | 0x80000000000;
+
hose->config_space_base = TITAN_CONF(index);
hose->index = index;
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index ff1570406..066af7e1e 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -180,7 +180,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
case 0x202: reason = "system detected hard error"; break;
case 0x203: reason = "system detected uncorrectable ECC error"; break;
case 0x204: reason = "SIO SERR occurred on PCI bus"; break;
- case 0x205: reason = "parity error detected by CIA"; break;
+ case 0x205: reason = "parity error detected by core logic"; break;
case 0x206: reason = "SIO IOCHK occurred on ISA bus"; break;
case 0x207: reason = "non-existent memory error"; break;
case 0x208: reason = "MCHK_K_DCSR"; break;
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index fd5c2b5e1..6102f2213 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -1076,7 +1076,7 @@ osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp,
}
ret = -EINVAL;
- if (n < 0 || n > KFDS_NR)
+ if (n < 0 || n > current->files->max_fdset)
goto out_nofds;
/*
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 2dc6f00dd..1b83bdfb9 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -535,6 +535,12 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
struct pci_controler *hose;
struct pci_dev *dev;
+ /* from hose or from bus.devfn */
+ if (which & IOBASE_FROM_HOSE) {
+ for(hose = hose_head; hose; hose = hose->next)
+ if (hose->index == bus) break;
+ if (!hose) return -ENODEV;
+ } else {
/* Special hook for ISA access. */
if (bus == 0 && dfn == 0) {
hose = pci_isa_hose;
@@ -544,8 +550,9 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
return -ENODEV;
hose = dev->sysdata;
}
+ }
- switch (which) {
+ switch (which & ~IOBASE_FROM_HOSE) {
case IOBASE_HOSE:
return hose->index;
case IOBASE_SPARSE_MEM:
@@ -556,6 +563,8 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
return hose->sparse_io_base;
case IOBASE_DENSE_IO:
return hose->dense_io_base;
+ case IOBASE_ROOT_BUS:
+ return hose->bus->number;
}
return -EOPNOTSUPP;
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 073ee5381..4aded0d6a 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -752,7 +752,7 @@ get_sysvec(long type, long variation, long cpu)
{
&eb64p_mv,
&cabriolet_mv,
- NULL /* AlphaPCI64 */
+ &cabriolet_mv /* AlphaPCI64 */
};
static struct alpha_machine_vector *eb66_vecs[] __initlocaldata =
diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c
index 9b2b39d73..8f456ca54 100644
--- a/arch/alpha/kernel/sys_cabriolet.c
+++ b/arch/alpha/kernel/sys_cabriolet.c
@@ -323,8 +323,10 @@ struct alpha_machine_vector cabriolet_mv __initmv = {
pci_map_irq: cabriolet_map_irq,
pci_swizzle: common_swizzle,
};
+#ifndef CONFIG_ALPHA_EB64P
ALIAS_MV(cabriolet)
#endif
+#endif
#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EB164)
struct alpha_machine_vector eb164_mv __initmv = {
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 88f4afd68..9f9993b6a 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -545,6 +545,16 @@ monet_init_pci(void)
es1888_init();
}
+static void __init
+webbrick_init_arch(void)
+{
+ tsunami_init_arch();
+
+ /* Tsunami caches 4 PTEs at a time; DS10 has only 1 hose. */
+ hose_head->sg_isa->align_entry = 4;
+ hose_head->sg_pci->align_entry = 4;
+}
+
/*
* The System Vectors
@@ -611,7 +621,7 @@ struct alpha_machine_vector webbrick_mv __initmv = {
nr_irqs: 64,
device_interrupt: dp264_device_interrupt,
- init_arch: tsunami_init_arch,
+ init_arch: webbrick_init_arch,
init_irq: dp264_init_irq,
init_rtc: common_init_rtc,
init_pci: common_init_pci,
diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c
index b3e9e3867..6acbef05c 100644
--- a/arch/alpha/kernel/sys_eb64p.c
+++ b/arch/alpha/kernel/sys_eb64p.c
@@ -26,6 +26,7 @@
#include <asm/pgtable.h>
#include <asm/core_apecs.h>
#include <asm/core_lca.h>
+#include <asm/hwrpb.h>
#include "proto.h"
#include "irq_impl.h"
@@ -108,7 +109,7 @@ eb64p_init_irq(void)
{
long i;
-#ifdef CONFIG_ALPHA_GENERIC
+#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_CABRIOLET)
/*
* CABRIO SRM may not set variation correctly, so here we test
* the high word of the interrupt summary register for the RAZ
@@ -116,6 +117,12 @@ eb64p_init_irq(void)
*/
if (inw(0x806) != 0xffff) {
extern struct alpha_machine_vector cabriolet_mv;
+
+ printk("Detected Cabriolet: correcting HWRPB.\n");
+
+ hwrpb->sys_variation |= 2L << 10;
+ hwrpb_update_checksum(hwrpb);
+
alpha_mv = cabriolet_mv;
alpha_mv.init_irq();
return;
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index 8ef79db13..6e777c3ab 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -40,8 +40,10 @@ static inline void
noritake_update_irq_hw(int irq, int mask)
{
int port = 0x54a;
- if (irq >= 16) mask >>= 16;
- if (irq >= 16) port = 0x54c;
+ if (irq >= 32) {
+ mask >>= 16;
+ port = 0x54c;
+ }
outw(mask, port);
}
@@ -260,6 +262,35 @@ noritake_swizzle(struct pci_dev *dev, u8 *pinp)
return slot;
}
+#if defined(CONFIG_ALPHA_GENERIC) || !defined(CONFIG_ALPHA_PRIMO)
+static void
+noritake_apecs_machine_check(unsigned long vector, unsigned long la_ptr,
+ struct pt_regs * regs)
+{
+#define MCHK_NO_DEVSEL 0x205U
+#define MCHK_NO_TABT 0x204U
+
+ struct el_common *mchk_header;
+ unsigned int code;
+
+ mchk_header = (struct el_common *)la_ptr;
+
+ /* Clear the error before any reporting. */
+ mb();
+ mb(); /* magic */
+ draina();
+ apecs_pci_clr_err();
+ wrmces(0x7);
+ mb();
+
+ code = mchk_header->code;
+ process_mcheck_info(vector, la_ptr, regs, "NORITAKE APECS",
+ (mcheck_expected(0)
+ && (code == MCHK_NO_DEVSEL
+ || code == MCHK_NO_TABT)));
+}
+#endif
+
/*
* The System Vectors
@@ -272,7 +303,7 @@ struct alpha_machine_vector noritake_mv __initmv = {
DO_DEFAULT_RTC,
DO_APECS_IO,
DO_APECS_BUS,
- machine_check: apecs_machine_check,
+ machine_check: noritake_apecs_machine_check,
max_dma_address: ALPHA_MAX_DMA_ADDRESS,
min_io_address: EISA_DEFAULT_IO_BASE,
min_mem_address: APECS_AND_LCA_DEFAULT_MEM_BASE,
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 9f2e5347a..5bd7af915 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -114,12 +114,7 @@ LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS
-ifeq ($(CONFIG_ARCH_A5K),y)
-MACHINE = a5k
-ARCHDIR = arc
-endif
-
-ifeq ($(CONFIG_ARCH_ARC),y)
+ifeq ($(CONFIG_ARCH_ARCA5K),y)
MACHINE = arc
ARCHDIR = arc
endif
@@ -197,7 +192,8 @@ MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
# The following is a hack to get 'constants.h' up
# to date before starting compilation
-CONSTANTS := constants
+
+$(patsubst %, _dir_%, $(SUBDIRS)) : constants
constants: $(TOPDIR)/include/asm-arm/proc-fns.h dummy
@$(MAKE) -C arch/arm/lib constants.h
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index f8ff4124c..f3c45c553 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -48,7 +48,7 @@ ZRELADDR = 0x40008000
endif
ifeq ($(CONFIG_ARCH_SA1100),y)
-OBJS += head-sa1100.o
+OBJS += head-sa1100.o setup-sa1100.o
ZTEXTADDR = 0xc0008000
ZRELADDR = 0xc0008000
ifeq ($(CONFIG_SA1100_VICTOR),y)
diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S
index 7b12ecef6..6b0d4624d 100644
--- a/arch/arm/boot/compressed/head-sa1100.S
+++ b/arch/arm/boot/compressed/head-sa1100.S
@@ -3,10 +3,12 @@
*
* Copyright (C) 1999 Nicolas Pitre <nico@cam.org>
*
- * SA1100 specific tweaks. This is merged with head.S by the linker.
+ * SA1100 specific tweaks. This is merged into head.S by the linker.
+ *
*/
#include <linux/config.h>
+#include <linux/linkage.h>
#ifndef CONFIG_ARCH_SA1100
#error What am I doing here...
@@ -36,6 +38,9 @@ __SA1100_start:
#endif
#ifdef CONFIG_SA1100_VICTOR
+ teq r9, #26 @ MACH_TYPE_VICTOR
+ bne 10f
+
@ Copy cmdline to 0xc0000000
mov r1, #0xc0000000
cmp r0, #0
@@ -44,6 +49,7 @@ __SA1100_start:
cmpne r2, #0
strb r2, [r1], #1
bne 1b
+10:
#endif
@ Data cache might be active.
@@ -64,73 +70,13 @@ __SA1100_start:
bic r0, r0, #0x0d @ clear WB, DC, MMU
bic r0, r0, #0x1000 @ clear Icache
mcr p15, 0, r0, c1, c0, 0
-
-#if defined( CONFIG_SA1100_ASSABET ) || \
- defined( CONFIG_SA1100_BRUTUS )
- @ Initialize UART1 for early serial communication
- @ since UART3 is used by angelboot. It is routed to
- @ alternate GPIO functions on Brutus.
- b 1f
-
-#ifdef CONFIG_SA1100_BRUTUS
-#define ALT_UART
-#endif
-
-GPIO_BASE: .long 0x90040000
-#define GPDR 0x04
-#define GAFR 0x1c
-
-PPC_BASE: .long 0x90060000
-#define PPAR 0x08
-
-UART1_BASE: .long 0x80010000
-#define UTCR0 0x00
-#define UTCR1 0x04
-#define UTCR2 0x08
-#define UTCR3 0x0c
-#define UTSR0 0x1c
-#define UTSR1 0x20
-
-#define BAUD_DIV_230400 0x000
-#define BAUD_DIV_115200 0x001
-#define BAUD_DIV_57600 0x003
-#define BAUD_DIV_38400 0x005
-#define BAUD_DIV_19200 0x00b
-#define BAUD_DIV_9600 0x017
-#define BAUD_DIV BAUD_DIV_9600
-
-1:
-#ifdef ALT_UART
- ldr r0, GPIO_BASE
- ldr r1, [r0, #GPDR]
- bic r1, r1, #1<<15
- orr r1, r1, #1<<14
- str r1, [r0, #GPDR]
- ldr r1, [r0, #GAFR]
- orr r1, r1, #(1<<15)|(1<<14)
- str r1, [r0, #GAFR]
- ldr r0, PPC_BASE
- ldr r1, [r0, #PPAR]
- orr r1, r1, #1<<12
- str r1, [r0, #PPAR]
-#endif
- ldr r0, UART1_BASE
-1: ldr r1, [r0, #UTSR1]
- tst r1, #1<<0 @ TBY
+/*
+ * Pause for a short time so that we give enough time
+ * for the host to start a terminal up.
+ */
+ mov r0, #0x02000000
+1: subs r0, r0, #1
bne 1b
- mov r1, #0
- str r1, [r0, #UTCR3]
- mov r1, #0x08 @ 8N1
- str r1, [r0, #UTCR0]
- mov r1, #BAUD_DIV
- str r1, [r0, #UTCR2]
- mov r1, r1, lsr #8
- str r1, [r0, #UTCR1]
- mov r1, #0x03 @ RXE + TXE
- str r1, [r0, #UTCR3]
- mov r1, #0xff @ flush status reg
- str r1, [r0, #UTSR0]
-#endif
@ Restore initial r0/r1
mov r0, r8
diff --git a/arch/arm/boot/compressed/setup-sa1100.S b/arch/arm/boot/compressed/setup-sa1100.S
new file mode 100644
index 000000000..6fd5b84e6
--- /dev/null
+++ b/arch/arm/boot/compressed/setup-sa1100.S
@@ -0,0 +1,130 @@
+/*
+ * linux/arch/arm/boot/compressed/setup-sa1100.S
+ *
+ * Copyright (C) 2000 Nicolas Pitre <nico@cam.org>
+ *
+ * SA1100 setup routines, to be used after BSS has been cleared.
+ *
+ * John G Dorsey <john+@cs.cmu.edu> 2000/05/25 :
+ * Runtime test for Neponset added.
+ */
+
+#define __ASSEMBLY__
+#include <linux/linkage.h>
+
+ .text
+
+GPIO_BASE: .long 0x90040000
+#define GPLR 0x00
+#define GPDR 0x04
+#define GPSR 0x08
+#define GAFR 0x1c
+
+PPC_BASE: .long 0x90060000
+#define PPAR 0x08
+
+UART1_BASE: .long 0x80010000
+UART3_BASE: .long 0x80050000
+#define UTCR0 0x00
+#define UTCR1 0x04
+#define UTCR2 0x08
+#define UTCR3 0x0c
+#define UTSR0 0x1c
+#define UTSR1 0x20
+
+#define BAUD_DIV_230400 0x000
+#define BAUD_DIV_115200 0x001
+#define BAUD_DIV_57600 0x003
+#define BAUD_DIV_38400 0x005
+#define BAUD_DIV_19200 0x00b
+#define BAUD_DIV_9600 0x017
+#define BAUD_DIV BAUD_DIV_9600
+
+SCR_loc: .long SYMBOL_NAME(SCR_value)
+#define GPIO_2_9 0x3fc
+
+
+ENTRY(sa1100_setup)
+ mov r3, r0 @ keep machine type in r3
+
+@ Read System Configuration "Register" for Assabet.
+@ (taken from "Intel StrongARM SA-1110 Microprocessor Development Board
+@ User's Guide," p.4-9)
+
+ teq r3, #25 @ MACH_TYPE_ASSABET
+ bne skip_SCR
+
+ ldr r0, GPIO_BASE
+ ldr r1, [r0, #GPDR]
+ and r1, r1, #GPIO_2_9
+ str r1, [r0, #GPDR]
+ mov r1, #GPIO_2_9
+ str r1, [r0, #GPSR]
+ ldr r1, [r0, #GPDR]
+ bic r1, r1, #GPIO_2_9
+ str r1, [r0, #GPDR]
+
+ mov r2, #100
+1: ldr r1, [r0, #GPLR]
+ subs r2, r2, #1
+ bne 1b
+
+ and r2, r1, #GPIO_2_9
+ ldr r1, SCR_loc
+ str r2, [r1]
+
+ ldr r1, [r0, #GPDR]
+ and r1, r1, #GPIO_2_9
+ str r1, [r0, #GPDR]
+
+skip_SCR:
+
+ @ Initialize UART (if bootloader has not done it yet)...
+ teq r3, #16 @ MACH_TYPE_BRUTUS
+ teqne r3, #25 @ MACH_TYPE_ASSABET
+ bne skip_uart
+
+ @ UART3 if Assabet is used with Neponset
+ teq r3, #25 @ if Assabet
+ tsteq r2, #(1 << 9) @ ... and Neponset present
+ ldreq r0, UART3_BASE
+ beq uart_init
+
+ @ At least for Brutus, the UART1 is used through
+ @ the alternate GPIO function...
+ teq r3, #16 @ MACH_TYPE_BRUTUS
+ bne uart1
+
+alt_GPIO_uart: ldr r0, GPIO_BASE
+ ldr r1, [r0, #GPDR]
+ bic r1, r1, #1<<15
+ orr r1, r1, #1<<14
+ str r1, [r0, #GPDR]
+ ldr r1, [r0, #GAFR]
+ orr r1, r1, #(1<<15)|(1<<14)
+ str r1, [r0, #GAFR]
+ ldr r0, PPC_BASE
+ ldr r1, [r0, #PPAR]
+ orr r1, r1, #1<<12
+ str r1, [r0, #PPAR]
+
+uart1: ldr r0, UART1_BASE
+
+uart_init: ldr r1, [r0, #UTSR1]
+ tst r1, #1<<0 @ TBY
+ bne 1b
+ mov r1, #0
+ str r1, [r0, #UTCR3]
+ mov r1, #0x08 @ 8N1
+ str r1, [r0, #UTCR0]
+ mov r1, #BAUD_DIV
+ str r1, [r0, #UTCR2]
+ mov r1, r1, lsr #8
+ str r1, [r0, #UTCR1]
+ mov r1, #0x03 @ RXE + TXE
+ str r1, [r0, #UTCR3]
+ mov r1, #0xff @ flush status reg
+ str r1, [r0, #UTSR0]
+skip_uart:
+out: mov pc, lr
+
diff --git a/arch/arm/config.in b/arch/arm/config.in
index 7e7e337b6..95c94d666 100644
--- a/arch/arm/config.in
+++ b/arch/arm/config.in
@@ -28,8 +28,7 @@ mainmenu_option next_comment
comment 'System Type'
choice 'ARM system type' \
- "Archimedes CONFIG_ARCH_ARC \
- A5000 CONFIG_ARCH_A5K \
+ "Archimedes/A5000 CONFIG_ARCH_ARCA5K \
Co-EBSA285 CONFIG_ARCH_CO285 \
EBSA-110 CONFIG_ARCH_EBSA110 \
FootBridge CONFIG_ARCH_FOOTBRIDGE \
@@ -40,6 +39,14 @@ choice 'ARM system type' \
# Cirrus CL-PS7500FE CONFIG_ARCH_CLPS7500 \
# LinkUp-L7200 CONFIG_ARCH_L7200
+if [ "$CONFIG_ARCH_ARCA5K" = "y" ]; then
+ # These architectures will be combined. However, until this
+ # is complete... Note that the ARC will take precidence over
+ # A5K
+ comment 'Archimedes/A5000 Implementations (select only ONE)'
+ bool ' Archimedes support' CONFIG_ARCH_ARC
+ bool ' A5000 support' CONFIG_ARCH_A5K
+fi
if [ "$CONFIG_ARCH_FOOTBRIDGE" = "y" ]; then
comment 'Footbridge Implementations'
bool ' CATS support' CONFIG_ARCH_CATS
@@ -55,7 +62,7 @@ if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
bool ' Include support for Neponset' CONFIG_ASSABET_NEPONSET
fi
bool ' Include support for Brutus' CONFIG_SA1100_BRUTUS
- bool ' Include support for Compaq iPAQ 3600 (Bitsy)' CONFIG_SA1100_BITSY
+ bool ' Include support for Compaq iPAQ H3600 (Bitsy)' CONFIG_SA1100_BITSY
# bool ' Include support for Empeg' CONFIG_SA1100_EMPEG
# bool ' Include support for Itsy' CONFIG_SA1100_ITSY
bool ' Include support for LART' CONFIG_SA1100_LART
@@ -68,8 +75,7 @@ if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
fi
# Figure out whether this system uses 26-bit or 32-bit CPUs.
-if [ "$CONFIG_ARCH_ARC" = "y" -o \
- "$CONFIG_ARCH_A5K" = "y" ]; then
+if [ "$CONFIG_ARCH_ARCA5K" = "y" ]; then
define_bool CONFIG_CPU_32 n
define_bool CONFIG_CPU_26 y
bool '2MB physical memory' CONFIG_PAGESIZE_16
@@ -94,7 +100,7 @@ if [ "$CONFIG_ARCH_EBSA110" = "y" -o \
define_bool CONFIG_CPU_SA110 y
fi
if [ "$CONFIG_ARCH_CLPS7500" = "y" ]; then
- define_bool CONFIG_CPU_32v4 y
+ define_bool CONFIG_CPU_32v3 y
define_bool CONFIG_CPU_ARM7 y
fi
if [ "$CONFIG_ARCH_L7200" = "y" ]; then
@@ -107,8 +113,7 @@ if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
fi
# Select various configuration options depending on the machine type
-if [ "$CONFIG_ARCH_ARC" = "y" -o \
- "$CONFIG_ARCH_A5K" = "y" -o \
+if [ "$CONFIG_ARCH_ARCA5K" = "y" -o \
"$CONFIG_ARCH_RPC" = "y" ]; then
define_bool CONFIG_ARCH_ACORN y
else
@@ -154,9 +159,8 @@ else
define_bool CONFIG_PCI n
fi
-if [ "$CONFIG_ARCH_CATS" = "y" -o \
- "$CONFIG_ARCH_SHARK" = "y" -o \
- "$CONFIG_ARCH_NETWINDER" = "y" ]; then
+if [ "$CONFIG_FOOTBRIDGE_HOST" = "y" -o \
+ "$CONFIG_ARCH_SHARK" = "y" ]; then
define_bool CONFIG_ISA y
define_bool CONFIG_ISA_DMA y
else
@@ -185,6 +189,11 @@ choice 'Kernel core (/proc/kcore) format' \
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
+
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool 'Power Management support' CONFIG_PM
+fi
+
if [ "$CONFIG_CPU_32" = "y" ]; then
tristate 'RISC OS personality' CONFIG_ARTHUR
fi
@@ -219,9 +228,8 @@ fi
endmenu
source drivers/parport/Config.in
-
+source drivers/mtd/Config.in
source drivers/pnp/Config.in
-
source drivers/block/Config.in
if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
@@ -268,8 +276,6 @@ if [ "$CONFIG_SCSI" != "n" ]; then
fi
endmenu
-source drivers/mtd/Config.in
-
source drivers/ieee1394/Config.in
source drivers/i2o/Config.in
@@ -328,7 +334,10 @@ source drivers/usb/Config.in
mainmenu_option next_comment
comment 'Kernel hacking'
-bool 'Compile kernel with frame pointer (for useful debugging)' CONFIG_FRAME_POINTER
+# Always compile kernel with framepointer (until 2.4 real comes out)
+# Bug reports aren't much use without this.
+#bool 'Compile kernel with frame pointer (for useful debugging)' CONFIG_FRAME_POINTER
+define_bool CONFIG_FRAME_POINTER y
bool 'Verbose kernel error messages' CONFIG_DEBUG_ERRORS
bool 'Verbose user fault messages' CONFIG_DEBUG_USER
bool 'Include debugging information in kernel binary' CONFIG_DEBUG_INFO
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 7662f42ef..62c0ca60e 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -8,38 +8,32 @@
HEAD_OBJ = head-$(PROCESSOR).o
ENTRY_OBJ = entry-$(PROCESSOR).o
-ifeq ($(CONFIG_ISA_DMA),y)
- ISA_DMA_OBJS += dma-isa.o
-endif
-
O_OBJS_arc = dma-arc.o oldlatches.o
-O_OBJS_a5k = dma-a5k.o
O_OBJS_rpc = dma-rpc.o
-O_OBJS_ebsa110 = dma-dummy.o
-O_OBJS_footbridge = dma.o dma-footbridge.o $(ISA_DMA_OBJS) hw-footbridge.o isa.o
-O_OBJS_clps7500 = dma-dummy.o
-O_OBJS_nexuspci = dma-dummy.o
-O_OBJS_sa1100 = dma-dummy.o hw-sa1100.o
-O_OBJS_l7200 = dma-dummy.o fiq.o
+O_OBJS_footbridge = dma-footbridge.o hw-footbridge.o isa.o
+O_OBJS_sa1100 = hw-sa1100.o
+O_OBJS_l7200 = fiq.o
O_TARGET := kernel.o
# Object file lists.
-obj-y := arch.o $(ENTRY_OBJ) irq.o process.o ptrace.o \
+obj-y := arch.o dma.o $(ENTRY_OBJ) irq.o process.o ptrace.o \
semaphore.o setup.o signal.o sys_arm.o time.o \
traps.o $(O_OBJS_$(MACHINE))
obj-m :=
obj-n :=
obj- :=
-export-objs := armksyms.o dma.o ecard.o hw-footbridge.o hw-sa1100.o leds-$(MACHINE).o
+export-objs := armksyms.o dma.o ecard.o hw-footbridge.o \
+ hw-sa1100.o leds-$(MACHINE).o oldlatches.o
-obj-$(CONFIG_ARCH_ACORN) += dma.o ecard.o fiq.o time-acorn.o
+obj-$(CONFIG_ARCH_ACORN) += ecard.o fiq.o time-acorn.o
obj-$(CONFIG_DEBUG_LL) += debug-$(PROCESSOR).o
obj-$(CONFIG_MODULES) += armksyms.o
obj-$(CONFIG_LEDS) += leds-$(MACHINE).o
obj-$(CONFIG_ARTHUR) += arthur.o
+obj-$(CONFIG_ISA_DMA) += dma-isa.o
ifeq ($(MACHINE),nexuspci)
obj-$(CONFIG_PCI) += plx9080.o
diff --git a/arch/arm/kernel/arch.c b/arch/arm/kernel/arch.c
index 8b67943ce..0ce6d9d21 100644
--- a/arch/arm/kernel/arch.c
+++ b/arch/arm/kernel/arch.c
@@ -8,6 +8,8 @@
*/
#include <linux/config.h>
#include <linux/tty.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
#include <linux/init.h>
#include <asm/dec21285.h>
@@ -134,8 +136,10 @@ fixup_netwinder(struct machine_desc *desc, struct param_struct *params,
isapnp_disable = 1;
#endif
- if (params->u1.s.nr_pages != 0x2000 &&
- params->u1.s.nr_pages != 0x4000) {
+ if (params->u1.s.nr_pages != 0x02000 &&
+ params->u1.s.nr_pages != 0x04000 &&
+ params->u1.s.nr_pages != 0x08000 &&
+ params->u1.s.nr_pages != 0x10000) {
printk(KERN_WARNING "Warning: bad NeTTrom parameters "
"detected, using defaults\n");
@@ -207,6 +211,14 @@ MACHINE_END
#ifdef CONFIG_ARCH_SA1100
+static void victor_power_off(void)
+{
+ /* switch off power supply */
+ mdelay(2000);
+ GPCR = GPIO_GPIO23;
+ while (1);
+}
+
extern void select_sa1100_io_desc(void);
#define SET_BANK(__nr,__start,__size) \
mi->bank[__nr].start = (__start), \
@@ -219,9 +231,31 @@ fixup_sa1100(struct machine_desc *desc, struct param_struct *params,
select_sa1100_io_desc();
if (machine_is_assabet()) {
+ /*
+ * On Assabet, we must probe for the Neponset board *before*
+ * paging_init() has occured to actually determine the amount
+ * of RAM available.
+ */
+ extern void map_sa1100_gpio_regs(void);
+ extern void get_assabet_scr(void);
+ map_sa1100_gpio_regs();
+ get_assabet_scr();
+
SET_BANK( 0, 0xc0000000, 32*1024*1024 );
mi->nr_banks = 1;
+ if (machine_has_neponset()) {
+ printk("Neponset expansion board detected\n");
+ /*
+ * Note that Neponset RAM is slower...
+ * and still untested.
+ * This would be a candidate for
+ * _real_ NUMA support.
+ */
+ //SET_BANK( 1, 0xd0000000, 32*1024*1024 );
+ //mi->nr_banks = 2;
+ }
+
ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
setup_ramdisk( 1, 0, 0, 8192 );
setup_initrd( 0xc0800000, 3*1024*1024 );
@@ -297,6 +331,8 @@ fixup_sa1100(struct machine_desc *desc, struct param_struct *params,
/* power off if any problem */
strcat( *cmdline, " panic=1" );
+
+ pm_power_off = victor_power_off;
}
}
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 5ac0743be..6723291df 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -8,13 +8,14 @@
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/in6.h>
+#include <linux/interrupt.h>
+#include <linux/pm.h>
#include <linux/vt_kern.h>
#include <asm/byteorder.h>
#include <asm/elf.h>
#include <asm/io.h>
#include <asm/irq.h>
-#include <asm/dma.h>
#include <asm/pgalloc.h>
#include <asm/proc-fns.h>
#include <asm/processor.h>
@@ -28,9 +29,6 @@ extern int dump_fpu(struct pt_regs *, struct user_fp_struct *);
extern void inswb(unsigned int port, void *to, int len);
extern void outswb(unsigned int port, const void *to, int len);
-extern unsigned int local_bh_count[NR_CPUS];
-extern unsigned int local_irq_count[NR_CPUS];
-
extern void __bad_xchg(volatile void *ptr, int size);
/*
@@ -68,6 +66,7 @@ extern void __umodsi3(void);
extern void ret_from_exception(void);
extern void fpundefinstr(void);
extern void fp_enter(void);
+
#define EXPORT_SYMBOL_ALIAS(sym,orig) \
const char __kstrtab_##sym##[] __attribute__((section(".kstrtab"))) = \
__MODULE_STRING(##sym##); \
@@ -108,6 +107,8 @@ EXPORT_SYMBOL(__bad_xchg);
EXPORT_SYMBOL(__readwrite_bug);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
+EXPORT_SYMBOL(pm_idle);
+EXPORT_SYMBOL(pm_power_off);
/* processor dependencies */
#ifdef MULTI_CPU
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index a077f13b9..b2c644198 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -365,7 +365,7 @@ static u8 __init no_swizzle(struct pci_dev *dev, u8 *pin)
/* ebsa285 host-specific stuff */
#ifdef CONFIG_ARCH_EBSA285
-static int irqmap_ebsa285[] __initdata = { IRQ_IN1, IRQ_IN0, IRQ_PCI, IRQ_IN3 };
+static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
static u8 __init ebsa285_swizzle(struct pci_dev *dev, u8 *pin)
{
diff --git a/arch/arm/kernel/dma-a5k.c b/arch/arm/kernel/dma-a5k.c
deleted file mode 100644
index d79013af2..000000000
--- a/arch/arm/kernel/dma-a5k.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * arch/arm/kernel/dma-a5k.c
- *
- * Copyright (C) 1998 Russell King
- *
- * DMA functions specific to A5000 architecture
- */
-#include <linux/sched.h>
-#include <linux/init.h>
-
-#include <asm/dma.h>
-#include <asm/fiq.h>
-#include <asm/io.h>
-#include <asm/hardware.h>
-
-#include "dma.h"
-
-static struct fiq_handler fh = {
- name: "floppydma"
-};
-
-int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_id)
-{
- if (channel == DMA_VIRTUAL_FLOPPY)
- return 0;
- else
- return -EINVAL;
-}
-
-void arch_free_dma(dmach_t channel, dma_t *dma)
-{
- if (channel != DMA_VIRTUAL_FLOPPY)
- printk("arch_free_dma: invalid channel %d\n", channel);
-}
-
-int arch_get_dma_residue(dmach_t channel, dma_t *dma)
-{
- if (channel != DMA_VIRTUAL_FLOPPY)
- printk("arch_dma_count: invalid channel %d\n", channel);
- else {
- struct pt_regs regs;
- get_fiq_regs(&regs);
- return regs.ARM_r9;
- }
- return 0;
-}
-
-void arch_enable_dma(dmach_t channel, dma_t *dma)
-{
- if (channel != DMA_VIRTUAL_FLOPPY)
- printk("arch_enable_dma: invalid channel %d\n", channel);
- else {
- struct pt_regs regs;
- void *fiqhandler_start;
- unsigned int fiqhandler_length;
- extern void floppy_fiqsetup(unsigned long len, unsigned long addr,
- unsigned long port);
-
- if (dma->dma_mode == DMA_MODE_READ) {
- extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
- fiqhandler_start = &floppy_fiqin_start;
- fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
- } else {
- extern unsigned char floppy_fiqout_start, floppy_fiqout_end;
- fiqhandler_start = &floppy_fiqout_start;
- fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
- }
- if (claim_fiq(&fh)) {
- printk("floppydma: couldn't claim FIQ.\n");
- return;
- }
- memcpy((void *)0x1c, fiqhandler_start, fiqhandler_length);
- regs.ARM_r9 = dma->buf.length;
- regs.ARM_r10 = __bus_to_virt(dma->buf.address);
- regs.ARM_fp = (int)PCIO_FLOPPYDMABASE;
- set_fiq_regs(&regs);
- enable_irq(dma->dma_irq);
- }
-}
-
-void arch_disable_dma(dmach_t channel, dma_t *dma)
-{
- if (channel != DMA_VIRTUAL_FLOPPY)
- printk("arch_disable_dma: invalid channel %d\n", channel);
- else {
- disable_irq(dma->dma_irq);
- release_fiq(&fh);
- }
-}
-
-int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
-{
- return 0;
-}
-
-void __init arch_dma_init(dma_t *dma)
-{
- dma[DMA_VIRTUAL_FLOPPY].dma_irq = 64;
-}
diff --git a/arch/arm/kernel/dma-arc.c b/arch/arm/kernel/dma-arc.c
index 53ef12b1c..5a2f93b67 100644
--- a/arch/arm/kernel/dma-arc.c
+++ b/arch/arm/kernel/dma-arc.c
@@ -3,148 +3,200 @@
*
* Copyright (C) 1998-1999 Dave Gilbert / Russell King
*
- * DMA functions specific to Archimedes architecture
+ * DMA functions specific to Archimedes and A5000 architecture
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <asm/dma.h>
+#include <asm/fiq.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include "dma.h"
-#define DEBUG
+#define DPRINTK(x...) printk(KERN_DEBUG x)
-int arch_request_dma(dmach_t channel, dma_t *dma, const char * dev_id)
+#if defined(CONFIG_BLK_DEV_FD1772) || defined(CONFIG_BLK_DEV_FD1772_MODULE)
+static void arc_floppy_data_enable_dma(dmach_t channel, dma_t *dma)
{
- printk("arch_request_dma channel=%d F0=%d F1=%d\n",channel,DMA_VIRTUAL_FLOPPY0,DMA_VIRTUAL_FLOPPY1);
- if (channel == DMA_VIRTUAL_FLOPPY0 ||
- channel == DMA_VIRTUAL_FLOPPY1)
- return 0;
- else
- return -EINVAL;
-}
-
-void arch_free_dma(dmach_t channel, dma_t *dma)
-{
-}
-
-void arch_enable_dma(dmach_t channel, dma_t *dma)
-{
- printk("arch_enable_dma channel=%d F0=%d F1=%d\n",channel,DMA_VIRTUAL_FLOPPY0,DMA_VIRTUAL_FLOPPY1);
- switch (channel) {
-#ifdef CONFIG_BLK_DEV_FD1772
- case DMA_VIRTUAL_FLOPPY0: { /* Data DMA */
- switch (dma->dma_mode) {
- case DMA_MODE_READ: /* read */
- {
- extern unsigned char fdc1772_dma_read, fdc1772_dma_read_end;
- extern void fdc1772_setupdma(unsigned int count,unsigned int addr);
- unsigned long flags;
-#ifdef DEBUG
- printk("enable_dma fdc1772 data read\n");
-#endif
- save_flags(flags);
- cliIF();
+ DPRINTK("arc_floppy_data_enable_dma\n");
+ switch (dma->dma_mode) {
+ case DMA_MODE_READ: { /* read */
+ extern unsigned char fdc1772_dma_read, fdc1772_dma_read_end;
+ extern void fdc1772_setupdma(unsigned int count,unsigned int addr);
+ unsigned long flags;
+ DPRINTK("enable_dma fdc1772 data read\n");
+ save_flags(flags);
+ cliIF();
- memcpy ((void *)0x1c, (void *)&fdc1772_dma_read,
- &fdc1772_dma_read_end - &fdc1772_dma_read);
- fdc1772_setupdma(dma->buf.length, __bus_to_virt(dma->buf.address)); /* Sets data pointer up */
- enable_irq (64);
- restore_flags(flags);
- }
- break;
-
- case DMA_MODE_WRITE: /* write */
- {
- extern unsigned char fdc1772_dma_write, fdc1772_dma_write_end;
- extern void fdc1772_setupdma(unsigned int count,unsigned int addr);
- unsigned long flags;
-
-#ifdef DEBUG
- printk("enable_dma fdc1772 data write\n");
-#endif
- save_flags(flags);
- cliIF();
- memcpy ((void *)0x1c, (void *)&fdc1772_dma_write,
- &fdc1772_dma_write_end - &fdc1772_dma_write);
- fdc1772_setupdma(dma->buf.length, __bus_to_virt(dma->buf.address)); /* Sets data pointer up */
- enable_irq (64);
-
- restore_flags(flags);
- }
- break;
- default:
- printk ("enable_dma: dma%d not initialised\n", channel);
- return;
- }
- }
- break;
+ memcpy ((void *)0x1c, (void *)&fdc1772_dma_read,
+ &fdc1772_dma_read_end - &fdc1772_dma_read);
+ fdc1772_setupdma(dma->buf.length, __bus_to_virt(dma->buf.address)); /* Sets data pointer up */
+ enable_irq (64);
+ restore_flags(flags);
+ }
+ break;
- case DMA_VIRTUAL_FLOPPY1: { /* Command end FIQ - actually just sets a flag */
- /* Need to build a branch at the FIQ address */
- extern void fdc1772_comendhandler(void);
+ case DMA_MODE_WRITE: { /* write */
+ extern unsigned char fdc1772_dma_write, fdc1772_dma_write_end;
+ extern void fdc1772_setupdma(unsigned int count,unsigned int addr);
unsigned long flags;
-
- /*printk("enable_dma fdc1772 command end FIQ\n");*/
+ DPRINTK("enable_dma fdc1772 data write\n");
save_flags(flags);
cliIF();
-
- *((unsigned int *)0x1c)=0xea000000 | (((unsigned int)fdc1772_comendhandler-(0x1c+8))/4); /* B fdc1772_comendhandler */
+ memcpy ((void *)0x1c, (void *)&fdc1772_dma_write,
+ &fdc1772_dma_write_end - &fdc1772_dma_write);
+ fdc1772_setupdma(dma->buf.length, __bus_to_virt(dma->buf.address)); /* Sets data pointer up */
+ enable_irq (64);
restore_flags(flags);
- }
- break;
-#endif
+ }
+ break;
+ default:
+ printk ("enable_dma: dma%d not initialised\n", channel);
}
}
-int arch_get_dma_residue(dmach_t channel, dma_t *dma)
+static int arc_floppy_data_get_dma_residue(dmach_t channel, dma_t *dma)
{
- switch (channel) {
-#ifdef CONFIG_BLK_DEV_FD1772
- case DMA_VIRTUAL_FLOPPY0: { /* Data DMA */
- extern unsigned int fdc1772_bytestogo;
+ extern unsigned int fdc1772_bytestogo;
+
+ /* 10/1/1999 DAG - I presume its the number of bytes left? */
+ return fdc1772_bytestogo;
+}
+
+static void arc_floppy_cmdend_enable_dma(dmach_t channel, dma_t *dma)
+{
+ /* Need to build a branch at the FIQ address */
+ extern void fdc1772_comendhandler(void);
+ unsigned long flags;
+
+ DPRINTK("arc_floppy_cmdend_enable_dma\n");
+ /*printk("enable_dma fdc1772 command end FIQ\n");*/
+ save_flags(flags);
+ cliIF();
+
+ /* B fdc1772_comendhandler */
+ *((unsigned int *)0x1c)=0xea000000 |
+ (((unsigned int)fdc1772_comendhandler-(0x1c+8))/4);
- /* 10/1/1999 DAG - I presume its the number of bytes left? */
- return fdc1772_bytestogo;
- };
- break;
+ restore_flags(flags);
+}
+
+static int arc_floppy_cmdend_get_dma_residue(dmach_t channel, dma_t *dma)
+{
+ /* 10/1/1999 DAG - Presume whether there is an outstanding command? */
+ extern unsigned int fdc1772_fdc_int_done;
- case DMA_VIRTUAL_FLOPPY1: { /* Command completed */
- /* 10/1/1999 DAG - Presume whether there is an outstanding command? */
- extern unsigned int fdc1772_fdc_int_done;
+ * Explicit! If the int done is 0 then 1 int to go */
+ return (fdc1772_fdc_int_done==0)?1:0;
+}
- return (fdc1772_fdc_int_done==0)?1:0; /* Explicit! If the int done is 0 then 1 int to go */
- };
- break;
+static void arc_disable_dma(dmach_t channel, dma_t *dma)
+{
+ disable_irq(dma->dma_irq);
+}
+static struct dma_ops arc_floppy_data_dma_ops = {
+ type: "FIQDMA",
+ enable: arc_floppy_data_enable_dma,
+ disable: arc_disable_dma,
+ residue: arc_floppy_data_get_dma_residue,
+};
+
+static struct dma_ops arc_floppy_cmdend_dma_ops = {
+ type: "FIQCMD",
+ enable: arc_floppy_cmdend_enable_dma,
+ disable: arc_disable_dma,
+ residue: arc_floppy_cmdend_get_dma_residue,
+};
#endif
- default:
- printk("dma-arc.c:arch_get_dma_residue called with unknown/unconfigured DMA channel\n");
- return 0;
- };
+#ifdef CONFIG_ARCH_A5K
+static struct fiq_handler fh = {
+ name: "floppydata"
+};
+
+static int a5k_floppy_get_dma_residue(dmach_t channel, dma_t *dma)
+{
+ struct pt_regs regs;
+ get_fiq_regs(&regs);
+ return regs.ARM_r9;
+}
+
+static void a5k_floppy_enable_dma(dmach_t channel, dma_t *dma)
+{
+ struct pt_regs regs;
+ void *fiqhandler_start;
+ unsigned int fiqhandler_length;
+ extern void floppy_fiqsetup(unsigned long len, unsigned long addr,
+ unsigned long port);
+
+ if (dma->dma_mode == DMA_MODE_READ) {
+ extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
+ fiqhandler_start = &floppy_fiqin_start;
+ fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
+ } else {
+ extern unsigned char floppy_fiqout_start, floppy_fiqout_end;
+ fiqhandler_start = &floppy_fiqout_start;
+ fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
+ }
+ if (claim_fiq(&fh)) {
+ printk("floppydma: couldn't claim FIQ.\n");
+ return;
+ }
+ memcpy((void *)0x1c, fiqhandler_start, fiqhandler_length);
+ regs.ARM_r9 = dma->buf.length;
+ regs.ARM_r10 = __bus_to_virt(dma->buf.address);
+ regs.ARM_fp = (int)PCIO_FLOPPYDMABASE;
+ set_fiq_regs(&regs);
+ enable_irq(dma->dma_irq);
}
-void arch_disable_dma(dmach_t channel, dma_t *dma)
+static void a5k_floppy_disable_dma(dmach_t channel, dma_t *dma)
{
- if (channel != DMA_VIRTUAL_FLOPPY0 &&
- channel != DMA_VIRTUAL_FLOPPY1)
- printk("arch_disable_dma: invalid channel %d\n", channel);
- else
- disable_irq(dma->dma_irq);
+ disable_irq(dma->dma_irq);
+ release_fiq(&fh);
}
-int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
+static struct dma_ops a5k_floppy_dma_ops = {
+ type: "FIQDMA",
+ enable: a5k_floppy_enable_dma,
+ disable: a5k_floppy_disable_dma,
+ residue: a5k_floppy_get_dma_residue,
+};
+#endif
+
+/*
+ * This is virtual DMA - we don't need anything here
+ */
+static int sound_enable_disable_dma(dmach_t channel, dma_t *dma)
{
- return 0;
}
+static struct dma_ops sound_dma_ops = {
+ type: "VIRTUAL",
+ enable: sound_enable_disable_dma,
+ disable: sound_enable_disable_dma,
+};
+
void __init arch_dma_init(dma_t *dma)
{
- dma[DMA_VIRTUAL_FLOPPY0].dma_irq = 64;
- dma[DMA_VIRTUAL_FLOPPY1].dma_irq = 65;
+#if defined(CONFIG_BLK_DEV_FD1772) || defined(CONFIG_BLK_DEV_FD1772_MODULE)
+ if (machine_is_arc()) {
+ dma[DMA_VIRTUAL_FLOPPY0].dma_irq = 64;
+ dma[DMA_VIRTUAL_FLOPPY0].d_ops = &arc_floppy_data_dma_ops;
+ dma[DMA_VIRTUAL_FLOPPY1].dma_irq = 65;
+ dma[DMA_VIRTUAL_FLOPPY1].d_ops = &arc_floppy_cmdend_dma_ops;
+ }
+#endif
+#ifdef CONFIG_ARCH_A5K
+ if (machine_is_a5k()) {
+ dma[DMA_VIRTUAL_FLOPPY].dma_irq = 64;
+ dma[DMA_VIRTUAL_FLOPPY].d_ops = &a5k_floppy_dma_ops;
+ }
+#endif
+ dma[DMA_VIRTUAL_SOUND].d_ops = &sound_dma_ops;
}
diff --git a/arch/arm/kernel/dma-dummy.c b/arch/arm/kernel/dma-dummy.c
deleted file mode 100644
index ebb9755c1..000000000
--- a/arch/arm/kernel/dma-dummy.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * arch/arm/kernel/dma-dummy.c
- *
- * Copyright (C) 1998 Philip Blundell
- * Copyright (c) 1998 Russell King
- *
- * Dummy DMA functions
- */
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-
-spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
-
-int request_dma(int channel, const char *device_id)
-{
- return -EINVAL;
-}
-
-int no_dma(void)
-{
- return 0;
-}
-
-#define GLOBAL_ALIAS(_a,_b) asm (".set " #_a "," #_b "; .globl " #_a)
-GLOBAL_ALIAS(disable_dma, no_dma);
-GLOBAL_ALIAS(enable_dma, no_dma);
-GLOBAL_ALIAS(free_dma, no_dma);
-GLOBAL_ALIAS(get_dma_residue, no_dma);
-GLOBAL_ALIAS(get_dma_list, no_dma);
-GLOBAL_ALIAS(set_dma_mode, no_dma);
-GLOBAL_ALIAS(set_dma_count, no_dma);
-GLOBAL_ALIAS(set_dma_addr, no_dma);
-GLOBAL_ALIAS(init_dma, no_dma);
diff --git a/arch/arm/kernel/dma-footbridge.c b/arch/arm/kernel/dma-footbridge.c
index 1d2ef26c4..b9d4b62fa 100644
--- a/arch/arm/kernel/dma-footbridge.c
+++ b/arch/arm/kernel/dma-footbridge.c
@@ -15,94 +15,44 @@
#include <linux/sched.h>
#include <linux/init.h>
+#include <asm/dec21285.h>
#include <asm/dma.h>
#include <asm/io.h>
#include "dma.h"
-#include "dma-isa.h"
-#ifdef CONFIG_ISA_DMA
-static int has_isa_dma;
-#else
-#define has_isa_dma 0
-#endif
+extern void isa_init_dma(dma_t *dma);
-int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_name)
+#if 0
+static int fb_dma_request(dmach_t channel, dma_t *dma)
{
- switch (channel) {
- case _DC21285_DMA(0):
- case _DC21285_DMA(1): /* 21285 internal channels */
- return 0;
-
- case _ISA_DMA(0) ... _ISA_DMA(7):
- if (has_isa_dma)
- return isa_request_dma(channel - _ISA_DMA(0), dma, dev_name);
- }
-
return -EINVAL;
}
-void arch_free_dma(dmach_t channel, dma_t *dma)
-{
- /* nothing to do */
-}
-
-int arch_get_dma_residue(dmach_t channel, dma_t *dma)
-{
- int residue = 0;
-
- switch (channel) {
- case _DC21285_DMA(0):
- case _DC21285_DMA(1):
- break;
-
- case _ISA_DMA(0) ... _ISA_DMA(7):
- if (has_isa_dma)
- residue = isa_get_dma_residue(channel - _ISA_DMA(0), dma);
- }
- return residue;
-}
-
-void arch_enable_dma(dmach_t channel, dma_t *dma)
+static void fb_dma_enable(dmach_t channel, dma_t *dma)
{
- switch (channel) {
- case _DC21285_DMA(0):
- case _DC21285_DMA(1):
- /*
- * Not yet implemented
- */
- break;
-
- case _ISA_DMA(0) ... _ISA_DMA(7):
- if (has_isa_dma)
- isa_enable_dma(channel - _ISA_DMA(0), dma);
- }
}
-void arch_disable_dma(dmach_t channel, dma_t *dma)
+static void fb_dma_disable(dmach_t channel, dma_t *dma)
{
- switch (channel) {
- case _DC21285_DMA(0):
- case _DC21285_DMA(1):
- /*
- * Not yet implemented
- */
- break;
-
- case _ISA_DMA(0) ... _ISA_DMA(7):
- if (has_isa_dma)
- isa_disable_dma(channel - _ISA_DMA(0), dma);
- }
}
-int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
-{
- return 0;
-}
+static struct dma_ops fb_dma_ops = {
+ type: "fb",
+ request: fb_dma_request,
+ enable: fb_dma_enable,
+ disable: fb_dma_disable,
+};
+#endif
void __init arch_dma_init(dma_t *dma)
{
+#if 0
+ dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops;
+ dma[_DC21285_DMA(1)].d_ops = &fb_dma_ops;
+#endif
#ifdef CONFIG_ISA_DMA
- has_isa_dma = isa_init_dma();
+ if (footbridge_cfn_mode())
+ isa_init_dma(dma + _ISA_DMA(0));
#endif
}
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c
index 74967a055..f144d0436 100644
--- a/arch/arm/kernel/dma-isa.c
+++ b/arch/arm/kernel/dma-isa.c
@@ -1,12 +1,13 @@
/*
* arch/arm/kernel/dma-isa.c: ISA DMA primitives
*
- * Copyright (C) Russell King
+ * Copyright (C) 1999-2000 Russell King
*
* Taken from various sources, including:
* 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 and John Boyd, Nov. 1992.
+ * High DMA channel support & info by Hannu Savolainen and John Boyd,
+ * Nov. 1992.
* arch/arm/kernel/dma-ebsa285.c
* Copyright (C) 1998 Phil Blundell
*/
@@ -18,7 +19,6 @@
#include <asm/io.h>
#include "dma.h"
-#include "dma-isa.h"
#define ISA_DMA_MODE_READ 0x44
#define ISA_DMA_MODE_WRITE 0x48
@@ -45,17 +45,7 @@ static unsigned int isa_dma_port[8][7] = {
{ 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce }
};
-int isa_request_dma(int channel, dma_t *dma, const char *dev_name)
-{
- return 0;
-}
-
-void isa_free_dma(int channel, dma_t *dma)
-{
- /* nothing to do */
-}
-
-int isa_get_dma_residue(int channel, dma_t *dma)
+static int isa_get_dma_residue(dmach_t channel, dma_t *dma)
{
unsigned int io_port = isa_dma_port[channel][ISA_DMA_COUNT];
int count;
@@ -66,7 +56,7 @@ int isa_get_dma_residue(int channel, dma_t *dma)
return channel < 4 ? count : (count << 1);
}
-void isa_enable_dma(int channel, dma_t *dma)
+static void isa_enable_dma(dmach_t channel, dma_t *dma)
{
if (dma->invalid) {
unsigned long address, length;
@@ -121,11 +111,18 @@ void isa_enable_dma(int channel, dma_t *dma)
outb(channel & 3, isa_dma_port[channel][ISA_DMA_MASK]);
}
-void isa_disable_dma(int channel, dma_t *dma)
+static void isa_disable_dma(dmach_t channel, dma_t *dma)
{
outb(channel | 4, isa_dma_port[channel][ISA_DMA_MASK]);
}
+static struct dma_ops isa_dma_ops = {
+ type: "ISA",
+ enable: isa_enable_dma,
+ disable: isa_disable_dma,
+ residue: isa_get_dma_residue,
+};
+
static struct resource dma_resources[] = {
{ "dma1", 0x0000, 0x000f },
{ "dma low page", 0x0080, 0x008f },
@@ -133,7 +130,7 @@ static struct resource dma_resources[] = {
{ "dma high page", 0x0480, 0x048f }
};
-int __init isa_init_dma(void)
+void __init isa_init_dma(dma_t *dma)
{
int dmac_found;
@@ -148,8 +145,10 @@ int __init isa_init_dma(void)
if (dmac_found) {
int channel, i;
- for (channel = 0; channel < 8; channel++)
+ for (channel = 0; channel < 8; channel++) {
+ dma[channel].d_ops = &isa_dma_ops;
isa_disable_dma(channel, NULL);
+ }
outb(0x40, 0x0b);
outb(0x41, 0x0b);
@@ -167,10 +166,9 @@ int __init isa_init_dma(void)
outb(0x10, 0xd0);
/*
- * Is this correct? According to
- * my documentation, it doesn't
- * appear to be. It should be
- * outb(0x3f, 0x40b); outb(0x3f, 0x4d6);
+ * Is this correct? According to my documentation, it
+ * doesn't appear to be. It should be:
+ * outb(0x3f, 0x40b); outb(0x3f, 0x4d6);
*/
outb(0x30, 0x40b);
outb(0x31, 0x40b);
@@ -185,6 +183,4 @@ int __init isa_init_dma(void)
for (i = 0; i < sizeof(dma_resources) / sizeof(dma_resources[0]); i++)
request_resource(&ioport_resource, dma_resources + i);
}
-
- return dmac_found;
}
diff --git a/arch/arm/kernel/dma-isa.h b/arch/arm/kernel/dma-isa.h
deleted file mode 100644
index 2640f6c3a..000000000
--- a/arch/arm/kernel/dma-isa.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Request an ISA DMA channel
- */
-int isa_request_dma(int channel, dma_t *dma, const char *dev_name);
-
-/*
- * Free an ISA DMA channel
- */
-void isa_free_dma(int channel, dma_t *dma);
-
-/*
- * Get ISA DMA channel residue
- */
-int isa_get_dma_residue(int channel, dma_t *dma);
-
-/*
- * Enable (and set up) an ISA DMA channel
- */
-void isa_enable_dma(int channel, dma_t *dma);
-
-/*
- * Disable an ISA DMA channel
- */
-void isa_disable_dma(int channel, dma_t *dma);
-
-/*
- * Initialise DMA
- */
-int isa_init_dma(void);
diff --git a/arch/arm/kernel/dma-rpc.c b/arch/arm/kernel/dma-rpc.c
index f4bc97f1d..35e3c35a3 100644
--- a/arch/arm/kernel/dma-rpc.c
+++ b/arch/arm/kernel/dma-rpc.c
@@ -21,10 +21,6 @@
#include "dma.h"
-static struct fiq_handler fh = {
- name: "floppydma"
-};
-
#if 0
typedef enum {
dma_size_8 = 1,
@@ -51,7 +47,7 @@ typedef struct {
#define state_wait_a 1
#define state_wait_b 2
-static void arch_get_next_sg(dmasg_t *sg, dma_t *dma)
+static void iomd_get_next_sg(dmasg_t *sg, dma_t *dma)
{
unsigned long end, offset, flags = 0;
@@ -90,19 +86,19 @@ static void arch_get_next_sg(dmasg_t *sg, dma_t *dma)
sg->length |= flags;
}
-static inline void arch_setup_dma_a(dmasg_t *sg, dma_t *dma)
+static inline void iomd_setup_dma_a(dmasg_t *sg, dma_t *dma)
{
outl_t(sg->address, dma->dma_base + CURA);
outl_t(sg->length, dma->dma_base + ENDA);
}
-static inline void arch_setup_dma_b(dmasg_t *sg, dma_t *dma)
+static inline void iomd_setup_dma_b(dmasg_t *sg, dma_t *dma)
{
outl_t(sg->address, dma->dma_base + CURB);
outl_t(sg->length, dma->dma_base + ENDB);
}
-static void arch_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
+static void iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
{
dma_t *dma = (dma_t *)dev_id;
unsigned int status = 0, no_buffer = dma->sg == NULL;
@@ -110,26 +106,26 @@ static void arch_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
do {
switch (dma->state) {
case state_prog_a:
- arch_get_next_sg(&dma->cur_sg, dma);
- arch_setup_dma_a(&dma->cur_sg, dma);
+ iomd_get_next_sg(&dma->cur_sg, dma);
+ iomd_setup_dma_a(&dma->cur_sg, dma);
dma->state = state_wait_a;
case state_wait_a:
status = inb_t(dma->dma_base + ST);
switch (status & (DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB)) {
case DMA_ST_OFL|DMA_ST_INT:
- arch_get_next_sg(&dma->cur_sg, dma);
- arch_setup_dma_a(&dma->cur_sg, dma);
+ iomd_get_next_sg(&dma->cur_sg, dma);
+ iomd_setup_dma_a(&dma->cur_sg, dma);
break;
case DMA_ST_INT:
- arch_get_next_sg(&dma->cur_sg, dma);
- arch_setup_dma_b(&dma->cur_sg, dma);
+ iomd_get_next_sg(&dma->cur_sg, dma);
+ iomd_setup_dma_b(&dma->cur_sg, dma);
dma->state = state_wait_b;
break;
case DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB:
- arch_setup_dma_b(&dma->cur_sg, dma);
+ iomd_setup_dma_b(&dma->cur_sg, dma);
dma->state = state_wait_b;
break;
}
@@ -139,18 +135,18 @@ static void arch_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
status = inb_t(dma->dma_base + ST);
switch (status & (DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB)) {
case DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB:
- arch_get_next_sg(&dma->cur_sg, dma);
- arch_setup_dma_b(&dma->cur_sg, dma);
+ iomd_get_next_sg(&dma->cur_sg, dma);
+ iomd_setup_dma_b(&dma->cur_sg, dma);
break;
case DMA_ST_INT|DMA_ST_AB:
- arch_get_next_sg(&dma->cur_sg, dma);
- arch_setup_dma_a(&dma->cur_sg, dma);
+ iomd_get_next_sg(&dma->cur_sg, dma);
+ iomd_setup_dma_a(&dma->cur_sg, dma);
dma->state = state_wait_a;
break;
case DMA_ST_OFL|DMA_ST_INT:
- arch_setup_dma_a(&dma->cur_sg, dma);
+ iomd_setup_dma_a(&dma->cur_sg, dma);
dma->state = state_wait_a;
break;
}
@@ -162,167 +158,56 @@ static void arch_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
disable_irq(irq);
}
-int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_name)
+static int iomd_request_dma(dmach_t channel, dma_t *dma)
{
unsigned long flags;
int ret;
- switch (channel) {
- case DMA_0:
- case DMA_1:
- case DMA_2:
- case DMA_3:
- case DMA_S0:
- case DMA_S1:
- save_flags_cli(flags);
- ret = request_irq(dma->dma_irq, arch_dma_handle,
- SA_INTERRUPT, dev_name, dma);
- if (!ret)
- disable_irq(dma->dma_irq);
- restore_flags(flags);
- break;
-
- case DMA_VIRTUAL_FLOPPY:
- case DMA_VIRTUAL_SOUND:
- ret = 0;
- break;
-
- default:
- ret = -EINVAL;
- break;
- }
+ save_flags_cli(flags);
+ ret = request_irq(dma->dma_irq, iomd_dma_handle,
+ SA_INTERRUPT, dma->device_id, dma);
+ if (!ret)
+ disable_irq(dma->dma_irq);
+ restore_flags(flags);
return ret;
}
-void arch_free_dma(dmach_t channel, dma_t *dma)
+static void iomd_free_dma(dmach_t channel, dma_t *dma)
{
- switch (channel) {
- case DMA_0:
- case DMA_1:
- case DMA_2:
- case DMA_3:
- case DMA_S0:
- case DMA_S1:
- free_irq(dma->dma_irq, dma);
- break;
-
- default:
- break;
- }
+ free_irq(dma->dma_irq, dma);
}
-int arch_get_dma_residue(dmach_t channel, dma_t *dma)
-{
- int residue = 0;
-
- switch (channel) {
- case DMA_0: /* Physical DMA channels */
- case DMA_1:
- case DMA_2:
- case DMA_3:
- case DMA_S0:
- case DMA_S1:
- break;
-
- case DMA_VIRTUAL_FLOPPY: {
- struct pt_regs regs;
- get_fiq_regs(&regs);
- return regs.ARM_r9;
- }
- break;
- }
- return residue;
-}
-
-void arch_enable_dma(dmach_t channel, dma_t *dma)
+static void iomd_enable_dma(dmach_t channel, dma_t *dma)
{
unsigned long dma_base = dma->dma_base;
- unsigned int ctrl;
-
- switch (channel) {
- case DMA_0: /* Physical DMA channels */
- case DMA_1:
- case DMA_2:
- case DMA_3:
- case DMA_S0:
- case DMA_S1:
- ctrl = TRANSFER_SIZE | DMA_CR_E;
+ unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E;
- if (dma->invalid) {
- dma->invalid = 0;
+ if (dma->invalid) {
+ dma->invalid = 0;
- outb_t(DMA_CR_C, dma_base + CR);
- dma->state = state_prog_a;
- }
+ outb_t(DMA_CR_C, dma_base + CR);
+ dma->state = state_prog_a;
+ }
- if (dma->dma_mode == DMA_MODE_READ)
- ctrl |= DMA_CR_D;
+ if (dma->dma_mode == DMA_MODE_READ)
+ ctrl |= DMA_CR_D;
- outb_t(ctrl, dma_base + CR);
- enable_irq(dma->dma_irq);
- break;
-
- case DMA_VIRTUAL_FLOPPY: {
- void *fiqhandler_start;
- unsigned int fiqhandler_length;
- struct pt_regs regs;
-
- if (dma->dma_mode == DMA_MODE_READ) {
- extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
- fiqhandler_start = &floppy_fiqin_start;
- fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
- } else {
- extern unsigned char floppy_fiqout_start, floppy_fiqout_end;
- fiqhandler_start = &floppy_fiqout_start;
- fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
- }
-
- regs.ARM_r9 = dma->buf.length;
- regs.ARM_r10 = __bus_to_virt(dma->buf.address);
- regs.ARM_fp = (int)PCIO_FLOPPYDMABASE;
-
- if (claim_fiq(&fh)) {
- printk("floppydma: couldn't claim FIQ.\n");
- return;
- }
-
- set_fiq_handler(fiqhandler_start, fiqhandler_length);
- set_fiq_regs(&regs);
- enable_irq(dma->dma_irq);
- }
- break;
-
- default:
- break;
- }
+ outb_t(ctrl, dma_base + CR);
+ enable_irq(dma->dma_irq);
}
-void arch_disable_dma(dmach_t channel, dma_t *dma)
+static void iomd_disable_dma(dmach_t channel, dma_t *dma)
{
unsigned long dma_base = dma->dma_base;
unsigned int ctrl;
- switch (channel) {
- case DMA_0: /* Physical DMA channels */
- case DMA_1:
- case DMA_2:
- case DMA_3:
- case DMA_S0:
- case DMA_S1:
- disable_irq(dma->dma_irq);
- ctrl = inb_t(dma_base + CR);
- outb_t(ctrl & ~DMA_CR_E, dma_base + CR);
- break;
-
- case DMA_VIRTUAL_FLOPPY:
- disable_irq(dma->dma_irq);
- release_fiq(&fh);
- break;
- }
+ disable_irq(dma->dma_irq);
+ ctrl = inb_t(dma_base + CR);
+ outb_t(ctrl & ~DMA_CR_E, dma_base + CR);
}
-int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
+static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
{
int tcr, speed;
@@ -364,6 +249,82 @@ int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
return speed;
}
+static struct dma_ops iomd_dma_ops = {
+ type: "IOMD",
+ request: iomd_request_dma,
+ free: iomd_free_dma,
+ enable: iomd_enable_dma,
+ disable: iomd_disable_dma,
+ setspeed: iomd_set_dma_speed,
+};
+
+static struct fiq_handler fh = {
+ name: "floppydma"
+};
+
+static void floppy_enable_dma(dmach_t channel, dma_t *dma)
+{
+ void *fiqhandler_start;
+ unsigned int fiqhandler_length;
+ struct pt_regs regs;
+
+ if (dma->dma_mode == DMA_MODE_READ) {
+ extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
+ fiqhandler_start = &floppy_fiqin_start;
+ fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
+ } else {
+ extern unsigned char floppy_fiqout_start, floppy_fiqout_end;
+ fiqhandler_start = &floppy_fiqout_start;
+ fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
+ }
+
+ regs.ARM_r9 = dma->buf.length;
+ regs.ARM_r10 = __bus_to_virt(dma->buf.address);
+ regs.ARM_fp = (int)PCIO_FLOPPYDMABASE;
+
+ if (claim_fiq(&fh)) {
+ printk("floppydma: couldn't claim FIQ.\n");
+ return;
+ }
+
+ set_fiq_handler(fiqhandler_start, fiqhandler_length);
+ set_fiq_regs(&regs);
+ enable_irq(dma->dma_irq);
+}
+
+static void floppy_disable_dma(dmach_t channel, dma_t *dma)
+{
+ disable_irq(dma->dma_irq);
+ release_fiq(&fh);
+}
+
+static int floppy_get_residue(dmach_t channel, dma_t *dma)
+{
+ struct pt_regs regs;
+ get_fiq_regs(&regs);
+ return regs.ARM_r9;
+}
+
+static struct dma_ops floppy_dma_ops = {
+ type: "FIQDMA",
+ enable: floppy_enable_dma,
+ disable: floppy_disable_dma,
+ residue: floppy_get_residue,
+};
+
+/*
+ * This is virtual DMA - we don't need anything here.
+ */
+static int sound_enable_disable_dma(dmach_t channel, dma_t *dma)
+{
+}
+
+static struct dma_ops sound_dma_ops = {
+ type: "VIRTUAL",
+ enable: sound_enable_disable_dma,
+ disable: sound_enable_disable_dma,
+};
+
void __init arch_dma_init(dma_t *dma)
{
outb(0, IOMD_IO0CR);
@@ -373,21 +334,30 @@ void __init arch_dma_init(dma_t *dma)
outb(0xa0, IOMD_DMATCR);
- dma[0].dma_base = ioaddr(IOMD_IO0CURA);
- dma[0].dma_irq = IRQ_DMA0;
- dma[1].dma_base = ioaddr(IOMD_IO1CURA);
- dma[1].dma_irq = IRQ_DMA1;
- dma[2].dma_base = ioaddr(IOMD_IO2CURA);
- dma[2].dma_irq = IRQ_DMA2;
- dma[3].dma_base = ioaddr(IOMD_IO3CURA);
- dma[3].dma_irq = IRQ_DMA3;
- dma[4].dma_base = ioaddr(IOMD_SD0CURA);
- dma[4].dma_irq = IRQ_DMAS0;
- dma[5].dma_base = ioaddr(IOMD_SD1CURA);
- dma[5].dma_irq = IRQ_DMAS1;
- dma[6].dma_irq = 64;
-
- /* Setup DMA channels 2,3 to be for podules
+ dma[DMA_0].dma_base = ioaddr(IOMD_IO0CURA);
+ dma[DMA_0].dma_irq = IRQ_DMA0;
+ dma[DMA_0].d_ops = &iomd_dma_ops;
+ dma[DMA_1].dma_base = ioaddr(IOMD_IO1CURA);
+ dma[DMA_1].dma_irq = IRQ_DMA1;
+ dma[DMA_1].d_ops = &iomd_dma_ops;
+ dma[DMA_2].dma_base = ioaddr(IOMD_IO2CURA);
+ dma[DMA_2].dma_irq = IRQ_DMA2;
+ dma[DMA_2].d_ops = &iomd_dma_ops;
+ dma[DMA_3].dma_base = ioaddr(IOMD_IO3CURA);
+ dma[DMA_3].dma_irq = IRQ_DMA3;
+ dma[DMA_3].d_ops = &iomd_dma_ops;
+ dma[DMA_S0].dma_base = ioaddr(IOMD_SD0CURA);
+ dma[DMA_S0].dma_irq = IRQ_DMAS0;
+ dma[DMA_S0].d_ops = &iomd_dma_ops;
+ dma[DMA_S1].dma_base = ioaddr(IOMD_SD1CURA);
+ dma[DMA_S1].dma_irq = IRQ_DMAS1;
+ dma[DMA_S1].d_ops = &iomd_dma_ops;
+ dma[DMA_VIRTUAL_FLOPPY].dma_irq = 64;
+ dma[DMA_VIRTUAL_FLOPPY].d_ops = &floppy_dma_ops;
+ dma[DMA_VIRTUAL_SOUND].d_ops = &sound_dma_ops;
+
+ /*
+ * Setup DMA channels 2,3 to be for podules
* and channels 0,1 for internal devices
*/
outb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT);
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
index ff8322d34..7ed4c28ca 100644
--- a/arch/arm/kernel/dma.c
+++ b/arch/arm/kernel/dma.c
@@ -1,130 +1,123 @@
/*
* linux/arch/arm/kernel/dma.c
*
- * Copyright (C) 1995-1998 Russell King
+ * Copyright (C) 1995-2000 Russell King
*
- * Front-end to the DMA handling. You must provide the following
- * architecture-specific routines:
- *
- * int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_id);
- * void arch_free_dma(dmach_t channel, dma_t *dma);
- * void arch_enable_dma(dmach_t channel, dma_t *dma);
- * void arch_disable_dma(dmach_t channel, dma_t *dma);
- * int arch_get_dma_residue(dmach_t channel, dma_t *dma);
- *
- * Moved DMA resource allocation here...
+ * Front-end to the DMA handling. This handles the allocation/freeing
+ * of DMA channels, and provides a unified interface to the machines
+ * DMA facilities.
*/
+#include <linux/module.h>
#include <linux/malloc.h>
#include <linux/sched.h>
-#include <linux/module.h>
#include <linux/mman.h>
#include <linux/init.h>
#include <linux/spinlock.h>
-#include <asm/page.h>
-#include <asm/irq.h>
-#include <asm/hardware.h>
-#include <asm/io.h>
#include <asm/dma.h>
-
-/* A note on resource allocation:
- *
- * All drivers needing DMA channels, should allocate and release them
- * through the public routines `request_dma()' and `free_dma()'.
- *
- * In order to avoid problems, all processes should allocate resources in
- * the same sequence and release them in the reverse order.
- *
- * So, when allocating DMAs and IRQs, first allocate the IRQ, then the DMA.
- * When releasing them, first release the DMA, then release the IRQ.
- * If you don't, you may cause allocation requests to fail unnecessarily.
- * This doesn't really matter now, but it will once we get real semaphores
- * in the kernel.
- */
-
+#include "dma.h"
spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
-#include "dma.h"
-
-const char dma_str[] = "%s: dma %d not supported\n";
+#if MAX_DMA_CHANNELS > 0
static dma_t dma_chan[MAX_DMA_CHANNELS];
-/* Get dma list
- * for /proc/dma
+/*
+ * Get dma list for /proc/dma
*/
int get_dma_list(char *buf)
{
- int i, len = 0;
+ dma_t *dma;
+ char *p = buf;
+ int i;
- for (i = 0; i < MAX_DMA_CHANNELS; i++) {
- if (dma_chan[i].lock)
- len += sprintf(buf + len, "%2d: %s\n",
- i, dma_chan[i].device_id);
- }
- return len;
+ for (i = 0, dma = dma_chan; i < MAX_DMA_CHANNELS; i++, dma++)
+ if (dma->lock)
+ p += sprintf(p, "%2d: %14s %s\n", i,
+ dma->d_ops->type, dma->device_id);
+
+ return p - buf;
}
-/* Request DMA channel
+/*
+ * Request DMA channel
*
* On certain platforms, we have to allocate an interrupt as well...
*/
int request_dma(dmach_t channel, const char *device_id)
{
- if (channel < MAX_DMA_CHANNELS) {
- int ret;
-
- if (xchg(&dma_chan[channel].lock, 1) != 0)
- return -EBUSY;
-
- ret = arch_request_dma(channel, &dma_chan[channel], device_id);
- if (!ret) {
- dma_chan[channel].device_id = device_id;
- dma_chan[channel].active = 0;
- dma_chan[channel].invalid = 1;
- } else
- xchg(&dma_chan[channel].lock, 0);
-
- return ret;
- } else {
- printk (KERN_ERR "Trying to allocate DMA%d\n", channel);
- return -EINVAL;
- }
+ dma_t *dma = dma_chan + channel;
+ int ret;
+
+ if (channel >= MAX_DMA_CHANNELS || !dma->d_ops)
+ goto bad_dma;
+
+ if (xchg(&dma->lock, 1) != 0)
+ goto busy;
+
+ dma->device_id = device_id;
+ dma->active = 0;
+ dma->invalid = 1;
+
+ ret = 0;
+ if (dma->d_ops->request)
+ ret = dma->d_ops->request(channel, dma);
+
+ if (ret)
+ xchg(&dma->lock, 0);
+
+ return ret;
+
+bad_dma:
+ printk(KERN_ERR "dma: trying to allocate DMA%d\n", channel);
+ return -EINVAL;
+
+busy:
+ return -EBUSY;
}
-/* Free DMA channel
+/*
+ * Free DMA channel
*
* On certain platforms, we have to free interrupt as well...
*/
void free_dma(dmach_t channel)
{
- if (channel >= MAX_DMA_CHANNELS) {
- printk (KERN_ERR "Trying to free DMA%d\n", channel);
- return;
- }
+ dma_t *dma = dma_chan + channel;
+
+ if (channel >= MAX_DMA_CHANNELS || !dma->d_ops)
+ goto bad_dma;
- if (xchg(&dma_chan[channel].lock, 0) == 0) {
- if (dma_chan[channel].active) {
- printk (KERN_ERR "Freeing active DMA%d\n", channel);
- arch_disable_dma(channel, &dma_chan[channel]);
- dma_chan[channel].active = 0;
- }
+ if (dma->active) {
+ printk(KERN_ERR "dma%d: freeing active DMA\n", channel);
+ dma->d_ops->disable(channel, dma);
+ dma->active = 0;
+ }
- printk (KERN_ERR "Trying to free free DMA%d\n", channel);
+ if (xchg(&dma->lock, 0) != 0) {
+ if (dma->d_ops->free)
+ dma->d_ops->free(channel, dma);
return;
}
- arch_free_dma(channel, &dma_chan[channel]);
+
+ printk(KERN_ERR "dma%d: trying to free free DMA\n", channel);
+ return;
+
+bad_dma:
+ printk(KERN_ERR "dma: trying to free DMA%d\n", channel);
}
/* Set DMA Scatter-Gather list
*/
void set_dma_sg (dmach_t channel, dmasg_t *sg, int nr_sg)
{
- dma_chan[channel].sg = sg;
- dma_chan[channel].sgcount = nr_sg;
- dma_chan[channel].invalid = 1;
+ dma_t *dma = dma_chan + channel;
+
+ dma->sg = sg;
+ dma->sgcount = nr_sg;
+ dma->invalid = 1;
}
/* Set DMA address
@@ -133,15 +126,16 @@ void set_dma_sg (dmach_t channel, dmasg_t *sg, int nr_sg)
*/
void set_dma_addr (dmach_t channel, unsigned long physaddr)
{
- if (dma_chan[channel].active)
- printk(KERN_ERR "set_dma_addr: altering DMA%d"
- " address while DMA active\n",
- channel);
-
- dma_chan[channel].sg = &dma_chan[channel].buf;
- dma_chan[channel].sgcount = 1;
- dma_chan[channel].buf.address = physaddr;
- dma_chan[channel].invalid = 1;
+ dma_t *dma = dma_chan + channel;
+
+ if (dma->active)
+ printk(KERN_ERR "dma%d: altering DMA address while "
+ "DMA active\n", channel);
+
+ dma->sg = &dma->buf;
+ dma->sgcount = 1;
+ dma->buf.address = physaddr;
+ dma->invalid = 1;
}
/* Set DMA byte count
@@ -150,78 +144,137 @@ void set_dma_addr (dmach_t channel, unsigned long physaddr)
*/
void set_dma_count (dmach_t channel, unsigned long count)
{
- if (dma_chan[channel].active)
- printk(KERN_ERR "set_dma_count: altering DMA%d"
- " count while DMA active\n",
- channel);
-
- dma_chan[channel].sg = &dma_chan[channel].buf;
- dma_chan[channel].sgcount = 1;
- dma_chan[channel].buf.length = count;
- dma_chan[channel].invalid = 1;
+ dma_t *dma = dma_chan + channel;
+
+ if (dma->active)
+ printk(KERN_ERR "dma%d: altering DMA count while "
+ "DMA active\n", channel);
+
+ dma->sg = &dma->buf;
+ dma->sgcount = 1;
+ dma->buf.length = count;
+ dma->invalid = 1;
}
/* Set DMA direction mode
*/
void set_dma_mode (dmach_t channel, dmamode_t mode)
{
- if (dma_chan[channel].active)
- printk(KERN_ERR "set_dma_mode: altering DMA%d"
- " mode while DMA active\n",
- channel);
+ dma_t *dma = dma_chan + channel;
+
+ if (dma->active)
+ printk(KERN_ERR "dma%d: altering DMA mode while "
+ "DMA active\n", channel);
- dma_chan[channel].dma_mode = mode;
- dma_chan[channel].invalid = 1;
+ dma->dma_mode = mode;
+ dma->invalid = 1;
}
/* Enable DMA channel
*/
void enable_dma (dmach_t channel)
{
- if (dma_chan[channel].lock) {
- if (dma_chan[channel].active == 0) {
- dma_chan[channel].active = 1;
- arch_enable_dma(channel, &dma_chan[channel]);
- }
- } else
- printk (KERN_ERR "Trying to enable free DMA%d\n", channel);
+ dma_t *dma = dma_chan + channel;
+
+ if (!dma->lock)
+ goto free_dma;
+
+ if (dma->active == 0) {
+ dma->active = 1;
+ dma->d_ops->enable(channel, dma);
+ }
+ return;
+
+free_dma:
+ printk(KERN_ERR "dma%d: trying to enable free DMA\n", channel);
+ BUG();
}
/* Disable DMA channel
*/
void disable_dma (dmach_t channel)
{
- if (dma_chan[channel].lock) {
- if (dma_chan[channel].active == 1) {
- dma_chan[channel].active = 0;
- arch_disable_dma(channel, &dma_chan[channel]);
- }
- } else
- printk (KERN_ERR "Trying to disable free DMA%d\n", channel);
+ dma_t *dma = dma_chan + channel;
+
+ if (!dma->lock)
+ goto free_dma;
+
+ if (dma->active == 1) {
+ dma->active = 0;
+ dma->d_ops->disable(channel, dma);
+ }
+ return;
+
+free_dma:
+ printk(KERN_ERR "dma%d: trying to disable free DMA\n", channel);
+ BUG();
+}
+
+void set_dma_page(dmach_t channel, char pagenr)
+{
+ printk(KERN_ERR "dma%d: trying to set_dma_page\n", channel);
}
void set_dma_speed(dmach_t channel, int cycle_ns)
{
- dma_chan[channel].speed =
- arch_set_dma_speed(channel, &dma_chan[channel], cycle_ns);
+ dma_t *dma = dma_chan + channel;
+ int ret = 0;
+
+ if (dma->d_ops->setspeed)
+ ret = dma->d_ops->setspeed(channel, dma, cycle_ns);
+ dma->speed = ret;
}
int get_dma_residue(dmach_t channel)
{
- return arch_get_dma_residue(channel, &dma_chan[channel]);
+ dma_t *dma = dma_chan + channel;
+ int ret = 0;
+
+ if (dma->d_ops->residue)
+ ret = dma->d_ops->residue(channel, dma);
+
+ return ret;
+}
+
+void __init init_dma(void)
+{
+ arch_dma_init(dma_chan);
+}
+
+#else
+
+int request_dma(dmach_t channel, const char *device_id)
+{
+ return -EINVAL;
+}
+
+static int no_dma(void)
+{
+ return 0;
}
-EXPORT_SYMBOL(dma_str);
+#define GLOBAL_ALIAS(_a,_b) asm (".set " #_a "," #_b "; .globl " #_a)
+GLOBAL_ALIAS(disable_dma, no_dma);
+GLOBAL_ALIAS(enable_dma, no_dma);
+GLOBAL_ALIAS(free_dma, no_dma);
+GLOBAL_ALIAS(get_dma_residue, no_dma);
+GLOBAL_ALIAS(get_dma_list, no_dma);
+GLOBAL_ALIAS(set_dma_mode, no_dma);
+GLOBAL_ALIAS(set_dma_page, no_dma);
+GLOBAL_ALIAS(set_dma_count, no_dma);
+GLOBAL_ALIAS(set_dma_addr, no_dma);
+GLOBAL_ALIAS(set_dma_sg, no_dma);
+GLOBAL_ALIAS(set_dma_speed, no_dma);
+GLOBAL_ALIAS(init_dma, no_dma);
+
+#endif
+
EXPORT_SYMBOL(enable_dma);
EXPORT_SYMBOL(disable_dma);
EXPORT_SYMBOL(set_dma_addr);
EXPORT_SYMBOL(set_dma_count);
EXPORT_SYMBOL(set_dma_mode);
+EXPORT_SYMBOL(set_dma_page);
EXPORT_SYMBOL(get_dma_residue);
EXPORT_SYMBOL(set_dma_sg);
EXPORT_SYMBOL(set_dma_speed);
-
-void __init init_dma(void)
-{
- arch_dma_init(dma_chan);
-}
diff --git a/arch/arm/kernel/dma.h b/arch/arm/kernel/dma.h
index 33db3b03b..6cd96ed97 100644
--- a/arch/arm/kernel/dma.h
+++ b/arch/arm/kernel/dma.h
@@ -1,13 +1,26 @@
/*
- * arch/arm/kernel/dma.h
+ * linux/arch/arm/kernel/dma.h
*
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998-2000 Russell King
*
* This header file describes the interface between the generic DMA handler
* (dma.c) and the architecture-specific DMA backends (dma-*.c)
*/
-typedef struct {
+struct dma_struct;
+typedef struct dma_struct dma_t;
+
+struct dma_ops {
+ int (*request)(dmach_t, dma_t *); /* optional */
+ void (*free)(dmach_t, dma_t *); /* optional */
+ void (*enable)(dmach_t, dma_t *); /* mandatory */
+ void (*disable)(dmach_t, dma_t *); /* mandatory */
+ int (*residue)(dmach_t, dma_t *); /* optional */
+ int (*setspeed)(dmach_t, dma_t *, int); /* optional */
+ char *type;
+};
+
+struct dma_struct {
dmasg_t buf; /* single DMA */
int sgcount; /* number of DMA SG */
dmasg_t *sg; /* DMA Scatter-Gather List */
@@ -24,54 +37,9 @@ typedef struct {
int dma_irq; /* Controller IRQ */
int state; /* Controller state */
dmasg_t cur_sg; /* Current controller buffer */
-} dma_t;
-
-/* Prototype: int arch_request_dma(channel, dma, dev_id)
- * Purpose : Perform architecture specific claiming of a DMA channel
- * Params : channel - DMA channel number
- * : dma - DMA structure (above) for channel
- * : dev_id - device ID string passed with request
- * Returns : 0 on success, E????? number on error
- */
-int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_id);
-
-/* Prototype: int arch_free_dma(channel, dma)
- * Purpose : Perform architecture specific freeing of a DMA channel
- * Params : channel - DMA channel number
- * : dma - DMA structure for channel
- */
-void arch_free_dma(dmach_t channel, dma_t *dma);
-
-/* Prototype: void arch_enable_dma(channel, dma)
- * Purpose : Enable a claimed DMA channel
- * Params : channel - DMA channel number
- * : dma - DMA structure for channel
- */
-void arch_enable_dma(dmach_t channel, dma_t *dma);
-
-/* Prototype: void arch_disable_dma(channel, dma)
- * Purpose : Disable a claimed DMA channel
- * Params : channel - DMA channel number
- * : dma - DMA structure for channel
- */
-void arch_disable_dma(dmach_t channel, dma_t *dma);
-/* Prototype: int arch_get_dma_residue(channel, dma)
- * Purpose : Return number of bytes left to DMA
- * Params : channel - DMA channel number
- * : dma - DMA structure for channel
- * Returns : Number of bytes left to DMA
- */
-int arch_get_dma_residue(dmach_t channel, dma_t *dma);
-
-/* Prototype: int arch_set_dma_speed(channel, dma, cycle)
- * Purpose : Convert a cycle time to a register setting
- * Params : channel - DMA channel number
- * : dma - DMA structure for channel
- * : cycle - cycle time in NS
- * Returns : setting for 'dma->speed'
- */
-int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle);
+ struct dma_ops *d_ops;
+};
/* Prototype: void arch_dma_init(dma)
* Purpose : Initialise architecture specific DMA
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index b4d38e00f..5acfd9f24 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -44,12 +44,6 @@
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
-#ifdef CONFIG_ARCH_ARC
-#include <asm/arch/oldlatches.h>
-#else
-#define oldlatch_init()
-#endif
-
#ifndef CONFIG_ARCH_RPC
#define HAVE_EXPMASK
#endif
@@ -378,7 +372,8 @@ ecard_call(struct ecard_request *req)
ecard_task_reset(req);
} else {
if (ecard_pid <= 0)
- ecard_pid = kernel_thread(ecard_task, NULL, 0);
+ ecard_pid = kernel_thread(ecard_task, NULL,
+ CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
ecard_req = req;
@@ -1062,8 +1057,6 @@ void __init ecard_init(void)
{
int slot;
- oldlatch_init();
-
#ifdef CONFIG_CPU_32
init_waitqueue_head(&ecard_wait);
init_waitqueue_head(&ecard_done);
diff --git a/arch/arm/kernel/hw-sa1100.c b/arch/arm/kernel/hw-sa1100.c
index 862c3a2c4..27786cdd2 100644
--- a/arch/arm/kernel/hw-sa1100.c
+++ b/arch/arm/kernel/hw-sa1100.c
@@ -81,6 +81,24 @@ void __init get_assabet_scr(void)
#endif /* CONFIG_SA1100_ASSABET */
+/*
+ * Bitsy has extended, write-only memory-mapped GPIO's
+ */
+#if defined(CONFIG_SA1100_BITSY)
+static int bitsy_egpio = EGPIO_BITSY_RS232_ON;
+void clr_bitsy_egpio(unsigned long x)
+{
+ bitsy_egpio &= ~x;
+ *(volatile int *)0xdc000000 = bitsy_egpio;
+}
+void set_bitsy_egpio(unsigned long x)
+{
+ bitsy_egpio |= x;
+ *(volatile int *)0xdc000000 = bitsy_egpio;
+}
+EXPORT_SYMBOL(clr_bitsy_egpio);
+EXPORT_SYMBOL(set_bitsy_egpio);
+#endif
#ifdef CONFIG_SA1111
diff --git a/arch/arm/kernel/oldlatches.c b/arch/arm/kernel/oldlatches.c
index a908241d2..3d6758ff4 100644
--- a/arch/arm/kernel/oldlatches.c
+++ b/arch/arm/kernel/oldlatches.c
@@ -3,52 +3,53 @@
*
* (c) David Alan Gilbert 1995/1996
*/
+#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/hardware.h>
-#ifdef LATCHAADDR
-/*
- * They are static so that everyone who accesses them has to go through here
- */
-static unsigned char LatchACopy;
+static unsigned char latch_a_copy;
+static unsigned char latch_b_copy;
/* newval=(oldval & ~mask)|newdata */
void oldlatch_aupdate(unsigned char mask,unsigned char newdata)
{
- LatchACopy=(LatchACopy & ~mask)|newdata;
- outb(LatchACopy, LATCHAADDR);
-#ifdef DEBUG
- printk("oldlatch_A:0x%2x\n",LatchACopy);
-#endif
+ if (machine_is_arc()) {
+ latch_a_copy = (latch_a_copy & ~mask) | newdata;
+
+ printk("Latch: A = 0x%02x\n", latch_a_copy);
+ outb(latch_a_copy, LATCHAADDR);
+ } else
+ BUG();
}
-#endif
-#ifdef LATCHBADDR
-static unsigned char LatchBCopy;
/* newval=(oldval & ~mask)|newdata */
void oldlatch_bupdate(unsigned char mask,unsigned char newdata)
{
- LatchBCopy=(LatchBCopy & ~mask)|newdata;
- outb(LatchBCopy, LATCHBADDR);
-#ifdef DEBUG
- printk("oldlatch_B:0x%2x\n",LatchBCopy);
-#endif
+ if (machine_is_arc()) {
+ latch_b_copy = (latch_b_copy & ~mask) | newdata;
+
+ printk("Latch: B = 0x%02x\n", latch_b_copy);
+
+ outb(latch_b_copy, LATCHBADDR);
+ } else
+ BUG();
}
-#endif
-void __init oldlatch_init(void)
+static void __init oldlatch_init(void)
{
- printk("oldlatch: init\n");
-#ifdef LATCHAADDR
- oldlatch_aupdate(0xff,0xff);
-#endif
-#ifdef LATCHBADDR
- oldlatch_bupdate(0xff,0x8); /* Thats no FDC reset...*/
-#endif
- return ;
+ if (machine_is_arc()) {
+ oldlatch_aupdate(0xff, 0xff);
+ /* Thats no FDC reset...*/
+ oldlatch_bupdate(0xff, LATCHB_FDCRESET);
+ }
}
+
+initcall(oldlatch_init);
+
+EXPORT_SYMBOL(oldlatch_aupdate);
+EXPORT_SYMBOL(oldlatch_bupdate);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index f281f7337..3ef5bc59d 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -67,6 +67,12 @@ __setup("nohlt", nohlt_setup);
__setup("hlt", hlt_setup);
/*
+ * The following aren't currently used.
+ */
+void (*pm_idle)(void);
+void (*pm_power_off)(void);
+
+/*
* The idle thread. We try to conserve power, while trying to keep
* overall latency low. The architecture specific idle is passed
* a value to indicate the level of "idleness" of the system.
@@ -79,7 +85,11 @@ void cpu_idle(void)
current->counter = -100;
while (1) {
- arch_idle();
+ void (*idle)(void) = pm_idle;
+ if (!idle)
+ idle = arch_idle;
+ while (!current->need_resched)
+ idle();
schedule();
#ifndef CONFIG_NO_PGT_CACHE
check_pgt_cache();
@@ -97,6 +107,16 @@ int __init reboot_setup(char *str)
__setup("reboot=", reboot_setup);
+void machine_halt(void)
+{
+}
+
+void machine_power_off(void)
+{
+ if (pm_power_off)
+ pm_power_off();
+}
+
void machine_restart(char * __unused)
{
/*
@@ -125,15 +145,6 @@ void machine_restart(char * __unused)
while (1);
}
-void machine_halt(void)
-{
-}
-
-void machine_power_off(void)
-{
- arch_power_off();
-}
-
void show_regs(struct pt_regs * regs)
{
unsigned long flags;
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 3e6cf6cb4..4d489bcf3 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -586,7 +586,6 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
/* FALLTHRU */
default:
- lock_kernel();
sigaddset(&current->signal, signr);
recalc_sigpending(current);
current->flags |= PF_SIGNALED;
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 2c3cabadc..6d49e1427 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -11,9 +11,8 @@
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/malloc.h>
#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index d7f6640eb..da437639f 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -30,7 +30,7 @@
extern int setup_arm_irq(int, struct irqaction *);
extern void setup_timer(void);
extern rwlock_t xtime_lock;
-extern volatile unsigned long lost_ticks;
+extern unsigned long wall_jiffies;
/* change this if you have some constant time drift */
#define USECS_PER_JIFFY (1000000/HZ)
@@ -189,7 +189,7 @@ void do_gettimeofday(struct timeval *tv)
read_lock_irqsave(&xtime_lock, flags);
usec = gettimeoffset();
{
- unsigned long lost = lost_ticks;
+ unsigned long lost = jiffies - wall_jiffies;
if (lost)
usec += lost * USECS_PER_JIFFY;
@@ -218,7 +218,7 @@ void do_settimeofday(struct timeval *tv)
* would have done, and then undo it!
*/
tv->tv_usec -= gettimeoffset();
- tv->tv_usec -= lost_ticks * USECS_PER_JIFFY;
+ tv->tv_usec -= (jiffies - wall_jiffies) * USECS_PER_JIFFY;
while (tv->tv_usec < 0) {
tv->tv_usec += 1000000;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 188f89722..c76a95736 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -37,9 +37,6 @@ char *processor_modes[]=
"UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
};
-/* proc/system.h */
-const char xchg_str[] = "xchg";
-
static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
static inline void console_verbose(void)
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index e932164bf..991b4a3c8 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -14,8 +14,7 @@ L_OBJS := changebit.o csumipv6.o csumpartial.o csumpartialcopy.o \
O_TARGET := lib.o
O_OBJS := backtrace.o delay.o
-L_OBJS_arc := io-acorn.o
-L_OBJS_a5k := io-acorn.o floppydma.o
+L_OBJS_arc := io-acorn.o floppydma.o
L_OBJS_rpc := io-acorn.o floppydma.o
L_OBJS_clps7500 := io-acorn.o
L_OBJS_ebsa110 := io-ebsa110.o
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index e269e146c..589653111 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -623,17 +623,31 @@ void free_initmem(void)
}
#ifdef CONFIG_BLK_DEV_INITRD
+
+static int keep_initrd;
+
void free_initrd_mem(unsigned long start, unsigned long end)
{
unsigned long addr;
- for (addr = start; addr < end; addr += PAGE_SIZE) {
- ClearPageReserved(mem_map + MAP_NR(addr));
- set_page_count(mem_map+MAP_NR(addr), 1);
- free_page(addr);
- totalram_pages++;
+
+ if (!keep_initrd) {
+ for (addr = start; addr < end; addr += PAGE_SIZE) {
+ ClearPageReserved(mem_map + MAP_NR(addr));
+ set_page_count(mem_map+MAP_NR(addr), 1);
+ free_page(addr);
+ totalram_pages++;
+ }
+ printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
}
- printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
}
+
+static int __init keepinitrd_setup(char *__unused)
+{
+ keep_initrd = 1;
+ return 1;
+}
+
+__setup("keepinitrd", keepinitrd_setup);
#endif
void si_meminfo(struct sysinfo *val)
diff --git a/arch/arm/mm/mm-sa1100.c b/arch/arm/mm/mm-sa1100.c
index 328364e56..c1ecf3fb1 100644
--- a/arch/arm/mm/mm-sa1100.c
+++ b/arch/arm/mm/mm-sa1100.c
@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/bootmem.h>
+#include <asm/hardware.h>
#include <asm/pgtable.h>
#include <asm/page.h>
@@ -55,6 +56,7 @@ static struct map_desc assabet_io_desc[] __initdata = {
static struct map_desc bitsy_io_desc[] __initdata = {
#ifdef CONFIG_SA1100_BITSY
{ 0xd0000000, 0x00000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 0 */
+ { 0xdc000000, 0x49000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* EGPIO 0 */
SA1100_STD_IO_MAPPING
#endif
};
@@ -144,6 +146,7 @@ void __init select_sa1100_io_desc(void)
}
}
+
#ifdef CONFIG_DISCONTIGMEM
/*
@@ -161,3 +164,20 @@ pg_data_t sa1100_node_data[4] =
#endif
+
+/*
+ * On Assabet, we must probe for the Neponset board *before* paging_init()
+ * has occured to actually determine the amount of RAM available. To do so,
+ * we map the appropriate IO section in the page table here in order to
+ * access GPIO registers.
+ */
+void __init map_sa1100_gpio_regs( void )
+{
+ unsigned long phys = _GPLR & PMD_MASK;
+ unsigned long virt = io_p2v(phys);
+ int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
+ pmd_t pmd;
+ pmd_val(pmd) = phys | prot;
+ set_pmd(pmd_offset(pgd_offset_k(virt), virt), pmd);
+}
+
diff --git a/arch/arm/vmlinux-armo.lds.in b/arch/arm/vmlinux-armo.lds.in
index 9d5ee058d..656779195 100644
--- a/arch/arm/vmlinux-armo.lds.in
+++ b/arch/arm/vmlinux-armo.lds.in
@@ -36,6 +36,7 @@ SECTIONS
/DISCARD/ : { /* Exit code and data */
*(.text.exit)
*(.data.exit)
+ *(.exitcall.exit)
}
.text : {
diff --git a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in
index 1476ba939..4ef7377bb 100644
--- a/arch/arm/vmlinux-armv.lds.in
+++ b/arch/arm/vmlinux-armv.lds.in
@@ -29,8 +29,9 @@ SECTIONS
}
/DISCARD/ : { /* Exit code and data */
- *(.text.exit)
- *(.data.exit)
+ *(.text.exit)
+ *(.data.exit)
+ *(.exitcall.exit)
}
.text : { /* Real text segment */
diff --git a/arch/i386/boot/bootsect.S b/arch/i386/boot/bootsect.S
index f345ea100..26c67d5fd 100644
--- a/arch/i386/boot/bootsect.S
+++ b/arch/i386/boot/bootsect.S
@@ -151,7 +151,7 @@ probe_loop:
cbtw # extend to word
movw %ax, sectors
cmpw $disksizes+4, %si
- jae got_sectors # if all else fails, try 9
+ jae got_sectors # If all else fails, try 9
xchgw %cx, %ax # cx = track and sector
xorw %dx, %dx # drive 0, head 0
diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
index cfb9011d3..c91d8ff00 100644
--- a/arch/i386/boot/setup.S
+++ b/arch/i386/boot/setup.S
@@ -81,7 +81,7 @@ start_sys_seg: .word SYSSEG
type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin,
# Bootlin, SYSLX, bootsect...)
- # else it is set by the loader:
+ # Else it is set by the loader:
# 0xTV: T=0 for LILO
# T=1 for Loadlin
# T=2 for bootsect-loader
@@ -91,8 +91,8 @@ type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin,
# flags, unused bits must be zero (RFU) bit within loadflags
loadflags:
-LOADED_HIGH = 1 # if set, the kernel is loaded high
-CAN_USE_HEAP = 0x80 # if set, the loader also has set
+LOADED_HIGH = 1 # If set, the kernel is loaded high
+CAN_USE_HEAP = 0x80 # If set, the loader also has set
# heap_end_ptr to tell how much
# space behind setup.S can be used for
# heap purposes.
diff --git a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c
index 4e220dafb..9993d8331 100644
--- a/arch/i386/kernel/acpi.c
+++ b/arch/i386/kernel/acpi.c
@@ -96,6 +96,61 @@ static unsigned long acpi_enter_lvl3_lat = ACPI_INFINITE_LAT;
static unsigned long acpi_p_lvl2_lat = ACPI_INFINITE_LAT;
static unsigned long acpi_p_lvl3_lat = ACPI_INFINITE_LAT;
+/* Statistics.. */
+struct Cx_stat_struct {
+ unsigned long time;
+ unsigned long min;
+ unsigned long max;
+ unsigned long avg;
+} Cx_stat[3];
+
+static int acpi_do_stat(ctl_table *ctl,
+ int write,
+ struct file *file,
+ void *buffer,
+ size_t *len)
+{
+ int size;
+ char str[4*10];
+ struct Cx_stat_struct *stat = (struct Cx_stat_struct *)ctl->data;
+
+ if (write) {
+ stat->time = 0;
+ stat->min = 0;
+ stat->max = 0;
+ stat->avg = 0;
+ return 0;
+ }
+
+ if (file->f_pos) {
+ *len = 0;
+ return 0;
+ }
+ size = sprintf(str, "%9lu %9lu %9lu %9lu",
+ stat->time,
+ stat->min,
+ stat->max,
+ stat->avg);
+ if (*len < size) {
+ *len = 0;
+ return 0;
+ }
+ copy_to_user(buffer, str, size);
+ return 0;
+}
+
+static void cx_statistics(unsigned int x, unsigned long time)
+{
+ struct Cx_stat_struct *stat = Cx_stat + (x-1);
+
+ stat->time += time;
+ if (time <= stat->min-1)
+ stat->min = time;
+ if (time > stat->max)
+ stat->max = time;
+ stat->avg = time + (stat->avg >> 1);
+}
+
static unsigned long acpi_p_blk = 0;
static int acpi_p_lvl2_tested = 0;
@@ -230,6 +285,18 @@ static struct ctl_table acpi_table[] =
&acpi_enter_lvl3_lat, sizeof(acpi_enter_lvl3_lat),
0644, NULL, &acpi_do_ulong},
+ {ACPI_C1_TIME, "c1_time",
+ Cx_stat+0, sizeof(struct Cx_stat_struct),
+ 0644, NULL, &acpi_do_stat},
+
+ {ACPI_C2_TIME, "c2_time",
+ Cx_stat+1, sizeof(struct Cx_stat_struct),
+ 0644, NULL, &acpi_do_stat},
+
+ {ACPI_C3_TIME, "c3_time",
+ Cx_stat+2, sizeof(struct Cx_stat_struct),
+ 0644, NULL, &acpi_do_stat},
+
{ACPI_S0_SLP_TYP, "s0_slp_typ",
&acpi_slp_typ[ACPI_S0], sizeof(acpi_slp_typ[ACPI_S0]),
0600, NULL, &acpi_do_ulong},
@@ -1023,6 +1090,7 @@ sleep3:
time = TIME_END(pm_tmr, time);
__sti();
+ cx_statistics(3, time);
if (time < acpi_p_lvl3_lat)
goto sleep2;
}
@@ -1049,6 +1117,7 @@ sleep3_with_arbiter:
outb(arbiter, pm2_cntr); /* Enable arbiter again.. */
__sti();
+ cx_statistics(3, time);
if (time < acpi_p_lvl3_lat)
goto sleep2;
}
@@ -1074,6 +1143,7 @@ sleep2:
time = TIME_END(pm_tmr, time);
__sti();
+ cx_statistics(2, time);
if (time < acpi_p_lvl2_lat)
goto sleep1;
if (bm_activity(facp)) {
@@ -1097,6 +1167,7 @@ sleep1:
time = TIME_BEGIN(pm_tmr);
__asm__ __volatile__("sti ; hlt": : :"memory");
time = TIME_END(pm_tmr, time);
+ cx_statistics(1, time);
if (time > acpi_enter_lvl2_lat)
goto sleep2;
}
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index bd7c62bdf..b1debd5fe 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -1295,7 +1295,7 @@ static int do_release(struct inode * inode, struct file * filp)
as1->next = as->next;
}
unlock_kernel();
- kfree_s(as, sizeof(*as));
+ kfree(as);
return 0;
}
diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
index 905f694ce..46e270774 100644
--- a/arch/i386/kernel/i8259.c
+++ b/arch/i386/kernel/i8259.c
@@ -36,7 +36,7 @@
BUILD_COMMON_IRQ()
#define BI(x,y) \
- BUILD_IRQ(##x##y)
+ BUILD_IRQ(x##y)
#define BUILD_16_IRQS(x) \
BI(x,0) BI(x,1) BI(x,2) BI(x,3) \
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index ff0db7ca3..406a30771 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1059,8 +1059,6 @@ static int __init timer_irq_works(void)
return 0;
}
-extern atomic_t nmi_counter[NR_CPUS];
-
static int __init nmi_irq_works(void)
{
irq_cpustat_t tmp[NR_CPUS];
@@ -1072,7 +1070,7 @@ static int __init nmi_irq_works(void)
for (j = 0; j < smp_num_cpus; j++) {
cpu = cpu_logical_map(j);
- if (atomic_read(&nmi_counter(cpu)) - atomic_read(&tmp[cpu].__nmi_counter) <= 3) {
+ if (nmi_counter(cpu) - tmp[cpu].__nmi_counter <= 3) {
printk(KERN_WARNING "CPU#%d NMI appears to be stuck.\n", cpu);
return 0;
}
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index fb0fe277c..bfb2a6841 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -160,7 +160,7 @@ int get_irq_list(char *buf)
p += sprintf(p, "NMI: ");
for (j = 0; j < smp_num_cpus; j++)
p += sprintf(p, "%10u ",
- atomic_read(&nmi_counter(cpu_logical_map(j))));
+ nmi_counter(cpu_logical_map(j)));
p += sprintf(p, "\n");
#if CONFIG_SMP
p += sprintf(p, "LOC: ");
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index a9ea15597..eea525873 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -459,7 +459,7 @@ asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
unsigned char reason = inb(0x61);
- atomic_inc(&nmi_counter(smp_processor_id()));
+ ++nmi_counter(smp_processor_id());
if (!(reason & 0xc0)) {
#if CONFIG_X86_IO_APIC
/*
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile
index be8fcec0a..30e9a207c 100644
--- a/arch/i386/lib/Makefile
+++ b/arch/i386/lib/Makefile
@@ -3,7 +3,7 @@
#
.S.o:
- $(CC) $(AFLAGS) -traditional -c $< -o $*.o
+ $(CC) $(AFLAGS) -c $< -o $*.o
L_TARGET = lib.a
L_OBJS = checksum.o old-checksum.o delay.o \
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 279befd3b..ed7eb88fc 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -162,7 +162,7 @@ int get_irq_list(char *buf)
p += sprintf(p, "NMI: ");
for (j = 0; j < smp_num_cpus; j++)
p += sprintf(p, "%10u ",
- atomic_read(&nmi_counter(cpu_logical_map(j))));
+ nmi_counter(cpu_logical_map(j)));
p += sprintf(p, "\n");
#if defined(CONFIG_SMP) && defined(__i386__)
p += sprintf(p, "LOC: ");
diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c
index 4994d013e..cd56c6dd3 100644
--- a/arch/mips/baget/vacserial.c
+++ b/arch/mips/baget/vacserial.c
@@ -1978,7 +1978,7 @@ static int get_async_struct(int line, struct async_struct **ret_info)
info->tqueue.data = info;
info->state = sstate;
if (sstate->info) {
- kfree_s(info, sizeof(struct async_struct));
+ kfree(info);
*ret_info = sstate->info;
return 0;
}
diff --git a/arch/mips/defconfig-cobalt b/arch/mips/defconfig-cobalt
index c1e508fa5..dc709bf16 100644
--- a/arch/mips/defconfig-cobalt
+++ b/arch/mips/defconfig-cobalt
@@ -526,6 +526,7 @@ CONFIG_NLS=y
#
# Native Language Support
#
+CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
@@ -542,6 +543,10 @@ CONFIG_NLS_CODEPAGE_865=m
CONFIG_NLS_CODEPAGE_866=m
CONFIG_NLS_CODEPAGE_869=m
CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_950=m
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
CONFIG_NLS_ISO8859_3=m
@@ -554,6 +559,7 @@ CONFIG_NLS_ISO8859_9=m
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_UTF8=m
#
# Sound
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index cfa26b67d..6233e5f9b 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -4,7 +4,6 @@
*/
#include <linux/kernel.h>
-#include <linux/config.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/string.h>
diff --git a/arch/ppc/kernel/pmac_backlight.c b/arch/ppc/kernel/pmac_backlight.c
index c4426a0b0..8c6244632 100644
--- a/arch/ppc/kernel/pmac_backlight.c
+++ b/arch/ppc/kernel/pmac_backlight.c
@@ -6,6 +6,7 @@
*
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/reboot.h>
diff --git a/arch/ppc/kernel/pmac_setup.c b/arch/ppc/kernel/pmac_setup.c
index ec8c6eca4..658d7c226 100644
--- a/arch/ppc/kernel/pmac_setup.c
+++ b/arch/ppc/kernel/pmac_setup.c
@@ -120,6 +120,8 @@ static void init_uninorth(void);
void pmac_progress(char *s, unsigned short hex);
#endif
+sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
+
__pmac
int
pmac_get_cpuinfo(char *buffer)
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index b140dd25c..3f0b52ead 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -36,6 +36,7 @@
#include <asm/machdep.h>
#include <asm/hw_irq.h>
#include <asm/nvram.h>
+#include <asm/mmu_context.h>
#ifdef CONFIG_SMP
#include <asm/smplock.h>
#endif /* CONFIG_SMP */
@@ -83,9 +84,9 @@ EXPORT_SYMBOL(kernel_flag);
#endif /* CONFIG_SMP */
#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-EXPORT_SYMBOL(isa_io_base);
-EXPORT_SYMBOL(isa_mem_base);
-EXPORT_SYMBOL(pci_dram_offset);
+EXPORT_SYMBOL_NOVERS(isa_io_base);
+EXPORT_SYMBOL_NOVERS(isa_mem_base);
+EXPORT_SYMBOL_NOVERS(pci_dram_offset);
#endif
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
EXPORT_SYMBOL(DMA_MODE_READ);
@@ -223,6 +224,7 @@ EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
EXPORT_SYMBOL(pmu_enable_irled);
#endif CONFIG_PMAC_PBOOK
#if defined(CONFIG_ALL_PPC)
+EXPORT_SYMBOL_NOVERS(sys_ctrler);
EXPORT_SYMBOL(find_devices);
EXPORT_SYMBOL(find_type_devices);
EXPORT_SYMBOL(find_compatible_devices);
@@ -306,3 +308,6 @@ EXPORT_SYMBOL(debugger_fault_handler);
EXPORT_SYMBOL(ret_to_user_hook);
EXPORT_SYMBOL(do_softirq);
+EXPORT_SYMBOL(next_mmu_context);
+EXPORT_SYMBOL(set_context);
+EXPORT_SYMBOL(mmu_context_overflow);
diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
index 4c1802135..314c1240c 100644
--- a/arch/ppc/kernel/syscalls.c
+++ b/arch/ppc/kernel/syscalls.c
@@ -20,6 +20,7 @@
*
*/
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index 23165e3ba..298aa2482 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -45,8 +45,6 @@ int s390_request_irq( unsigned int irq,
const char *devname,
void *dev_id);
-atomic_t nmi_counter;
-
#if 0
/*
* The following vectors are part of the Linux architecture, there
@@ -105,7 +103,7 @@ int get_irq_list(char *buf)
} /* endfor */
- p += sprintf(p, "NMI: %10u\n", atomic_read(&nmi_counter));
+ p += sprintf(p, "NMI: %10u\n", nmi_counter);
#ifdef CONFIG_SMP
p += sprintf(p, "IPI: %10u\n", atomic_read(&ipi_count));
#endif
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 2fe7a2c18..b7156415a 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.46 2000/03/21 06:12:26 davem Exp $
+# $Id: Makefile,v 1.47 2000/07/15 00:04:27 davem Exp $
# sparc/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
@@ -56,8 +56,9 @@ archclean:
-$(MAKE) -C arch/sparc/boot clean
archmrproper:
+ rm -f $(TOPDIR)/include/asm-sparc/asm_offsets.h
-archdep:
+archdep: check_asm
check_asm:
$(MAKE) -C arch/sparc/kernel check_asm
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 623ab7958..615445364 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.56 2000/07/06 01:41:29 davem Exp $
+# $Id: Makefile,v 1.59 2000/07/16 18:21:24 ecd Exp $
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
@@ -50,6 +50,9 @@ head.o: head.S
$(CC) $(AFLAGS) -ansi -c $*.S -o $*.o
check_asm: dummy
+ @if [ ! -r $(HPATH)/asm/asm_offsets.h ] ; then \
+ touch $(HPATH)/asm/asm_offsets.h ; \
+ fi
@echo "/* Automatically generated. Do not edit. */" > asm_offsets.h
@echo "#ifndef __ASM_OFFSETS_H__" >> asm_offsets.h
@echo "#define __ASM_OFFSETS_H__" >> asm_offsets.h
@@ -62,21 +65,29 @@ check_asm: dummy
@echo "#undef CONFIG_SMP" >> tmp.c
@echo "#include <linux/sched.h>" >> tmp.c
$(CPP) $(CPPFLAGS) tmp.c -o tmp.i
+ @echo "/* Automatically generated. Do not edit. */" > check_asm_data.c
+ @echo "#include <linux/config.h>" >> check_asm_data.c
+ @echo "#undef CONFIG_SMP" >> check_asm_data.c
+ @echo "#include <linux/sched.h>" >> check_asm_data.c
+ @echo "unsigned int check_asm_data[] = {" >> check_asm_data.c
+ $(SH) ./check_asm.sh -data task tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data mm tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data thread tmp.i check_asm_data.c
+ @echo '};' >> check_asm_data.c
+ $(CC) $(CFLAGS) -S -o check_asm_data.s check_asm_data.c
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
- @echo "#include <linux/config.h>" >> check_asm.c
- @echo "#undef CONFIG_SMP" >> check_asm.c
- @echo "#include <linux/sched.h>" >> check_asm.c
- @echo 'struct task_struct _task;' >> check_asm.c
- @echo 'struct mm_struct _mm;' >> check_asm.c
- @echo 'struct thread_struct _thread;' >> check_asm.c
@echo 'extern int printf(const char *fmt, ...);' >>check_asm.c
+ @echo "unsigned int check_asm_data[] = {" >> check_asm.c
+ $(SH) ./check_asm.sh -ints check_asm_data.s check_asm.c
+ @echo "};" >> check_asm.c
@echo 'int main(void) {' >> check_asm.c
- $(SH) ./check_asm.sh task tmp.i check_asm.c
- $(SH) ./check_asm.sh mm tmp.i check_asm.c
- $(SH) ./check_asm.sh thread tmp.i check_asm.c
+ @echo 'int i = 0;' >> check_asm.c
+ $(SH) ./check_asm.sh -printf task tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf mm tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf thread tmp.i check_asm.c
@echo 'return 0; }' >> check_asm.c
- @rm -f tmp.[ci]
- $(CC) $(CFLAGS) -o check_asm check_asm.c
+ @rm -f tmp.[ci] check_asm_data.[cs]
+ $(HOSTCC) -o check_asm check_asm.c
./check_asm >> asm_offsets.h
@rm -f check_asm check_asm.c
@echo "" >> asm_offsets.h
@@ -87,22 +98,30 @@ check_asm: dummy
@echo "#define CONFIG_SMP 1" >> tmp.c
@echo "#include <linux/sched.h>" >> tmp.c
$(CPP) $(CPPFLAGS) tmp.c -o tmp.i
+ @echo "/* Automatically generated. Do not edit. */" > check_asm_data.c
+ @echo "#include <linux/config.h>" >> check_asm_data.c
+ @echo "#undef CONFIG_SMP" >> check_asm_data.c
+ @echo "#define CONFIG_SMP 1" >> check_asm_data.c
+ @echo "#include <linux/sched.h>" >> check_asm_data.c
+ @echo "unsigned int check_asm_data[] = {" >> check_asm_data.c
+ $(SH) ./check_asm.sh -data task tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data mm tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data thread tmp.i check_asm_data.c
+ @echo '};' >> check_asm_data.c
+ $(CC) $(CFLAGS) -S -o check_asm_data.s check_asm_data.c
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
- @echo "#include <linux/config.h>" >> check_asm.c
- @echo "#undef CONFIG_SMP" >> check_asm.c
- @echo "#define CONFIG_SMP 1" >> check_asm.c
- @echo "#include <linux/sched.h>" >> check_asm.c
- @echo 'struct task_struct _task;' >> check_asm.c
- @echo 'struct mm_struct _mm;' >> check_asm.c
- @echo 'struct thread_struct _thread;' >> check_asm.c
@echo 'extern int printf(const char *fmt, ...);' >>check_asm.c
+ @echo "unsigned int check_asm_data[] = {" >> check_asm.c
+ $(SH) ./check_asm.sh -ints check_asm_data.s check_asm.c
+ @echo "};" >> check_asm.c
@echo 'int main(void) {' >> check_asm.c
- $(SH) ./check_asm.sh task tmp.i check_asm.c
- $(SH) ./check_asm.sh mm tmp.i check_asm.c
- $(SH) ./check_asm.sh thread tmp.i check_asm.c
+ @echo 'int i = 0;' >> check_asm.c
+ $(SH) ./check_asm.sh -printf task tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf mm tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf thread tmp.i check_asm.c
@echo 'return 0; }' >> check_asm.c
- @rm -f tmp.[ci]
- $(CC) $(CFLAGS) -o check_asm check_asm.c
+ @rm -f tmp.[ci] check_asm_data.[cs]
+ $(HOSTCC) -o check_asm check_asm.c
./check_asm >> asm_offsets.h
@rm -f check_asm check_asm.c
@echo "" >> asm_offsets.h
diff --git a/arch/sparc/kernel/check_asm.sh b/arch/sparc/kernel/check_asm.sh
index 2d2fbd224..5f1ed770e 100644
--- a/arch/sparc/kernel/check_asm.sh
+++ b/arch/sparc/kernel/check_asm.sh
@@ -1,3 +1,20 @@
#!/bin/sh
-sed -n -e '/struct[ ]*'$1'_struct[ ]*{/,/};/p' < $2 | sed '/struct[ ]*'$1'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\
-/g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/printf ("#define AOFF_'$1'_\0 0x%08x\\n#define ASIZ_'$1'_\0 0x%08x\\n", ((char *)\&_'$1'.\0) - ((char *)\&_'$1'), sizeof(_'$1'.\0));/' >> $3
+case $1 in
+ -printf)
+ sed -n -e '/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\
+/g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/printf ("#define AOFF_'$2'_\0 0x%08x\\n", check_asm_data[i++]); printf("#define ASIZ_'$2'_\0 0x%08x\\n", check_asm_data[i++]);/' >> $4
+ echo "printf (\"#define ASIZ_$2\\t0x%08x\\n\", check_asm_data[i++]);" >> $4
+ ;;
+ -data)
+ sed -n -e '/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\
+/g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/ ((char *)\&((struct '$2'_struct *)0)->\0) - ((char *)((struct '$2'_struct *)0)), sizeof(((struct '$2'_struct *)0)->\0),/' >> $4
+ echo " sizeof(struct $2_struct)," >> $4
+ ;;
+ -ints)
+ sed -n -e '/check_asm_data:/,/\.size/p' <$2 | sed -e 's/check_asm_data://' -e 's/\.size.*//' -e 's/\.long[ ]\([0-9]*\)/\1,/' >>$3
+ ;;
+ *)
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index c0480ab5a..0e05908fe 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -187,7 +187,7 @@ void free_irq(unsigned int irq, void *dev_id)
else
*(cpu_irq + irq_action) = action->next;
- kfree_s(action, sizeof(struct irqaction));
+ kfree(action);
if (!(*(cpu_irq + irq_action)))
disable_irq(irq);
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index 192a6bb03..59f014efc 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -173,7 +173,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
else
*actionp = action->next;
- kfree_s(action, sizeof(struct irqaction));
+ kfree(action);
if (!(*actionp))
disable_irq(irq);
diff --git a/arch/sparc/mm/hypersparc.S b/arch/sparc/mm/hypersparc.S
index e5920a801..44441b6b5 100644
--- a/arch/sparc/mm/hypersparc.S
+++ b/arch/sparc/mm/hypersparc.S
@@ -1,4 +1,4 @@
-/* $Id: hypersparc.S,v 1.16 2000/06/04 06:23:52 anton Exp $
+/* $Id: hypersparc.S,v 1.17 2000/07/16 21:48:52 anton Exp $
* hypersparc.S: High speed Hypersparc mmu/cache operations.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -12,17 +12,6 @@
#include <linux/config.h>
#include <linux/init.h>
-#define WINDOW_FLUSH(tmp1, tmp2) \
- mov 0, tmp1; \
-98: ld [%g6 + AOFF_task_thread + AOFF_thread_uwinmask], tmp2; \
- orcc %g0, tmp2, %g0; \
- add tmp1, 1, tmp1; \
- bne 98b; \
- save %sp, -64, %sp; \
-99: subcc tmp1, 1, tmp1; \
- bne 99b; \
- restore %g0, %g0, %g0;
-
.text
.align 4
diff --git a/arch/sparc/mm/swift.S b/arch/sparc/mm/swift.S
index 2ba8a6610..1699bca41 100644
--- a/arch/sparc/mm/swift.S
+++ b/arch/sparc/mm/swift.S
@@ -1,4 +1,4 @@
-/* $Id: swift.S,v 1.6 2000/06/04 06:23:53 anton Exp $
+/* $Id: swift.S,v 1.7 2000/07/16 21:48:52 anton Exp $
* swift.S: MicroSparc-II mmu/cache operations.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
@@ -11,17 +11,6 @@
#include <asm/pgtsrmmu.h>
#include <asm/asm_offsets.h>
-#define WINDOW_FLUSH(tmp1, tmp2) \
- mov 0, tmp1; \
-98: ld [%g6 + AOFF_task_thread + AOFF_thread_uwinmask], tmp2; \
- orcc %g0, tmp2, %g0; \
- add tmp1, 1, tmp1; \
- bne 98b; \
- save %sp, -64, %sp; \
-99: subcc tmp1, 1, tmp1; \
- bne 99b; \
- restore %g0, %g0, %g0;
-
.text
.align 4
diff --git a/arch/sparc/mm/tsunami.S b/arch/sparc/mm/tsunami.S
index 316e00e3a..f3678c0ed 100644
--- a/arch/sparc/mm/tsunami.S
+++ b/arch/sparc/mm/tsunami.S
@@ -1,4 +1,4 @@
-/* $Id: tsunami.S,v 1.5 2000/06/04 06:23:53 anton Exp $
+/* $Id: tsunami.S,v 1.6 2000/07/16 21:48:52 anton Exp $
* tsunami.S: High speed MicroSparc-I mmu/cache operations.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -11,17 +11,6 @@
#include <asm/page.h>
#include <asm/pgtsrmmu.h>
-#define WINDOW_FLUSH(tmp1, tmp2) \
- mov 0, tmp1; \
-98: ld [%g6 + AOFF_task_thread + AOFF_thread_uwinmask], tmp2; \
- orcc %g0, tmp2, %g0; \
- add tmp1, 1, tmp1; \
- bne 98b; \
- save %sp, -64, %sp; \
-99: subcc tmp1, 1, tmp1; \
- bne 99b; \
- restore %g0, %g0, %g0;
-
.text
.align 4
diff --git a/arch/sparc/mm/viking.S b/arch/sparc/mm/viking.S
index ffbec2342..e03ec9803 100644
--- a/arch/sparc/mm/viking.S
+++ b/arch/sparc/mm/viking.S
@@ -1,4 +1,4 @@
-/* $Id: viking.S,v 1.17 2000/06/04 06:23:53 anton Exp $
+/* $Id: viking.S,v 1.18 2000/07/16 21:48:52 anton Exp $
* viking.S: High speed Viking cache/mmu operations
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
@@ -107,17 +107,6 @@ viking_mxcc_flush_page:
9: retl
nop
-#define WINDOW_FLUSH(tmp1, tmp2) \
- mov 0, tmp1; \
-98: ld [%g6 + AOFF_task_thread + AOFF_thread_uwinmask], tmp2; \
- orcc %g0, tmp2, %g0; \
- add tmp1, 1, tmp1; \
- bne 98b; \
- save %sp, -64, %sp; \
-99: subcc tmp1, 1, tmp1; \
- bne 99b; \
- restore %g0, %g0, %g0;
-
viking_flush_cache_page:
#ifndef CONFIG_SMP
ld [%o0 + 0x0], %o0 /* XXX vma->vm_mm, GROSS XXX */
diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile
index 585fa4a3b..9b90ca4af 100644
--- a/arch/sparc64/Makefile
+++ b/arch/sparc64/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.43 2000/03/21 06:12:28 davem Exp $
+# $Id: Makefile,v 1.44 2000/07/15 00:04:27 davem Exp $
# sparc64/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
@@ -94,8 +94,9 @@ archclean:
rm -f $(TOPDIR)/vmlinux.aout
archmrproper:
+ rm -f $(TOPDIR)/include/asm-sparc64/asm_offsets.h
-archdep:
+archdep: check_asm
check_asm:
$(MAKE) -C arch/sparc64/kernel check_asm
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 7697c63e5..dab4e3bcf 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.56 2000/07/06 01:41:29 davem Exp $
+# $Id: Makefile,v 1.60 2000/07/16 18:21:24 ecd Exp $
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
@@ -68,42 +68,41 @@ else
endif
check_asm: dummy
+ @if [ ! -r $(HPATH)/asm/asm_offsets.h ] ; then \
+ touch $(HPATH)/asm/asm_offsets.h ; \
+ fi
@echo "/* Automatically generated. Do not edit. */" > asm_offsets.h
@echo "#ifndef __ASM_OFFSETS_H__" >> asm_offsets.h
@echo -e "#define __ASM_OFFSETS_H__\n" >> asm_offsets.h
@echo -e "#include <linux/config.h>\n" >> asm_offsets.h
- @echo '#if defined(__KERNEL__) && !defined(__ASSEMBLY__)' >> asm_offsets.h
- @if $(CC) -c -m64 -mcmodel=medlow -o /dev/null /dev/null >/dev/null 2>&1; then \
- echo '# if !((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))' >> asm_offsets.h; \
- else \
- echo '# if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)' >> asm_offsets.h; \
- fi
- @echo -e "# error Please issue 'make check_asm' in linux top-level directory first\n# endif\n#endif\n" >> asm_offsets.h
@echo -e "#ifndef CONFIG_SMP\n" >> asm_offsets.h
@echo "#include <linux/config.h>" > tmp.c
@echo "#undef CONFIG_SMP" >> tmp.c
@echo "#include <linux/sched.h>" >> tmp.c
$(CPP) $(CPPFLAGS) tmp.c -o tmp.i
+ @echo "/* Automatically generated. Do not edit. */" > check_asm_data.c
+ @echo "#include <linux/config.h>" >> check_asm_data.c
+ @echo "#undef CONFIG_SMP" >> check_asm_data.c
+ @echo "#include <linux/sched.h>" >> check_asm_data.c
+ @echo 'unsigned int check_asm_data[] = {' >> check_asm_data.c
+ $(SH) ./check_asm.sh -data task tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data mm tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data thread tmp.i check_asm_data.c
+ @echo '};' >> check_asm_data.c
+ $(CC) $(CPPFLAGS) $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm_data.s check_asm_data.c
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
- @echo "#include <linux/config.h>" >> check_asm.c
- @echo "#undef CONFIG_SMP" >> check_asm.c
- @echo "#include <linux/sched.h>" >> check_asm.c
- @echo 'struct task_struct _task;' >> check_asm.c
- @echo 'struct mm_struct _mm;' >> check_asm.c
- @echo 'struct thread_struct _thread;' >> check_asm.c
@echo 'extern int printf(const char *fmt, ...);' >>check_asm.c
+ @echo 'unsigned int check_asm_data[] = {' >> check_asm.c
+ $(SH) ./check_asm.sh -ints check_asm_data.s check_asm.c
+ @echo '};' >> check_asm.c
@echo 'int main(void) {' >> check_asm.c
- $(SH) ./check_asm.sh task tmp.i check_asm.c
- $(SH) ./check_asm.sh mm tmp.i check_asm.c
- $(SH) ./check_asm.sh thread tmp.i check_asm.c
+ @echo 'int i = 0;' >> check_asm.c
+ $(SH) ./check_asm.sh -printf task tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf mm tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf thread tmp.i check_asm.c
@echo 'return 0; }' >> check_asm.c
- @rm -f tmp.[ci]
- #$(CC) -o check_asm check_asm.c
- # <hack> Until we can do this natively, a hack has to take place
- $(CC) $(CPPFLAGS) $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c
- $(HOSTCC) -Wa,-Av9a -o check_asm check_asm.s
- @rm -f check_asm.s
- # </hack>
+ @rm -f tmp.[ci] check_asm_data.[cs]
+ $(HOSTCC) -o check_asm check_asm.c
./check_asm >> asm_offsets.h
@rm -f check_asm check_asm.c
@echo -e "\n#else /* CONFIG_SMP */\n" >> asm_offsets.h
@@ -113,53 +112,59 @@ check_asm: dummy
@echo "#define CONFIG_SMP 1" >> tmp.c
@echo "#include <linux/sched.h>" >> tmp.c
$(CPP) $(CPPFLAGS) tmp.c -o tmp.i
+ @echo "/* Automatically generated. Do not edit. */" > check_asm_data.c
+ @echo "#include <linux/config.h>" >> check_asm_data.c
+ @echo "#undef CONFIG_SMP" >> check_asm_data.c
+ @echo "#define CONFIG_SMP 1" >> check_asm_data.c
+ @echo "#include <linux/sched.h>" >> check_asm_data.c
+ @echo 'unsigned int check_asm_data[] = {' >> check_asm_data.c
+ $(SH) ./check_asm.sh -data task tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data mm tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data thread tmp.i check_asm_data.c
+ @echo '};' >> check_asm_data.c
+ $(CC) $(CPPFLAGS) $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm_data.s check_asm_data.c
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
- @echo "#include <linux/config.h>" >> check_asm.c
- @echo "#undef CONFIG_SMP" >> check_asm.c
- @echo "#define CONFIG_SMP 1" >> check_asm.c
- @echo "#include <linux/sched.h>" >> check_asm.c
- @echo 'struct task_struct _task;' >> check_asm.c
- @echo 'struct mm_struct _mm;' >> check_asm.c
- @echo 'struct thread_struct _thread;' >> check_asm.c
@echo 'extern int printf(const char *fmt, ...);' >>check_asm.c
+ @echo 'unsigned int check_asm_data[] = {' >> check_asm.c
+ $(SH) ./check_asm.sh -ints check_asm_data.s check_asm.c
+ @echo '};' >> check_asm.c
@echo 'int main(void) {' >> check_asm.c
- $(SH) ./check_asm.sh task tmp.i check_asm.c
- $(SH) ./check_asm.sh mm tmp.i check_asm.c
- $(SH) ./check_asm.sh thread tmp.i check_asm.c
+ @echo 'int i = 0;' >> check_asm.c
+ $(SH) ./check_asm.sh -printf task tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf mm tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf thread tmp.i check_asm.c
@echo 'return 0; }' >> check_asm.c
- @rm -f tmp.[ci]
- #$(CC) -o check_asm check_asm.c
- # <hack> Until we can do this natively, a hack has to take place
- $(CC) $(CPPFLAGS) $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c
- $(HOSTCC) -Wa,-Av9a -o check_asm check_asm.s
- @rm -f check_asm.s
- # </hack>
+ @rm -f tmp.[ci] check_asm_data.[cs]
+ $(HOSTCC) -o check_asm check_asm.c
./check_asm >> asm_offsets.h
@rm -f check_asm check_asm.c
@echo -e "\n#else /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h
@echo "#include <linux/sched.h>" > tmp.c
$(CPP) $(CPPFLAGS) -DSPIN_LOCK_DEBUG tmp.c -o tmp.i
+ @echo "/* Automatically generated. Do not edit. */" > check_asm_data.c
+ @echo "#include <linux/config.h>" >> check_asm_data.c
+ @echo "#undef CONFIG_SMP" >> check_asm_data.c
+ @echo "#define CONFIG_SMP 1" >> check_asm_data.c
+ @echo "#include <linux/sched.h>" >> check_asm_data.c
+ @echo 'unsigned int check_asm_data[] = {' >> check_asm_data.c
+ $(SH) ./check_asm.sh -data task tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data mm tmp.i check_asm_data.c
+ $(SH) ./check_asm.sh -data thread tmp.i check_asm_data.c
+ @echo '};' >> check_asm_data.c
+ $(CC) $(CPPFLAGS) -DSPIN_LOCK_DEBUG $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm_data.s check_asm_data.c
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
- @echo "#include <linux/config.h>" >> check_asm.c
- @echo "#undef CONFIG_SMP" >> check_asm.c
- @echo "#define CONFIG_SMP 1" >> check_asm.c
- @echo "#include <linux/sched.h>" >> check_asm.c
- @echo 'struct task_struct _task;' >> check_asm.c
- @echo 'struct mm_struct _mm;' >> check_asm.c
- @echo 'struct thread_struct _thread;' >> check_asm.c
@echo 'extern int printf(const char *fmt, ...);' >>check_asm.c
+ @echo 'unsigned int check_asm_data[] = {' >> check_asm.c
+ $(SH) ./check_asm.sh -ints check_asm_data.s check_asm.c
+ @echo '};' >> check_asm.c
@echo 'int main(void) {' >> check_asm.c
- $(SH) ./check_asm.sh task tmp.i check_asm.c
- $(SH) ./check_asm.sh mm tmp.i check_asm.c
- $(SH) ./check_asm.sh thread tmp.i check_asm.c
+ @echo 'int i = 0;' >> check_asm.c
+ $(SH) ./check_asm.sh -printf task tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf mm tmp.i check_asm.c
+ $(SH) ./check_asm.sh -printf thread tmp.i check_asm.c
@echo 'return 0; }' >> check_asm.c
- @rm -f tmp.[ci]
- #$(CC) -DSPIN_LOCK_DEBUG -o check_asm check_asm.c
- # <hack> Until we can do this natively, a hack has to take place
- $(CC) $(CPPFLAGS) -DSPIN_LOCK_DEBUG $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c
- $(HOSTCC) -Wa,-Av9a -o check_asm check_asm.s
- @rm -f check_asm.s
- # </hack>
+ @rm -f tmp.[ci] check_asm_data.[cs]
+ $(HOSTCC) -o check_asm check_asm.c
./check_asm >> asm_offsets.h
@rm -f check_asm check_asm.c
@echo -e "#endif /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h
@@ -176,5 +181,4 @@ check_asm: dummy
mv -f asm_offsets.h $(HPATH)/asm/asm_offsets.h; \
fi
-
include $(TOPDIR)/Rules.make
diff --git a/arch/sparc64/kernel/check_asm.sh b/arch/sparc64/kernel/check_asm.sh
index fd56d4e3b..5f1ed770e 100644
--- a/arch/sparc64/kernel/check_asm.sh
+++ b/arch/sparc64/kernel/check_asm.sh
@@ -1,4 +1,20 @@
#!/bin/sh
-sed -n -e '/struct[ ]*'$1'_struct[ ]*{/,/};/p' < $2 | sed '/struct[ ]*'$1'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\
-/g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/printf ("#define AOFF_'$1'_\0 0x%08x\\n#define ASIZ_'$1'_\0 0x%08x\\n", ((char *)\&_'$1'.\0) - ((char *)\&_'$1'), sizeof(_'$1'.\0));/' >> $3
-echo "printf (\"#define ASIZ_$1\\t0x%08x\\n\", sizeof(_$1));" >> $3
+case $1 in
+ -printf)
+ sed -n -e '/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\
+/g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/printf ("#define AOFF_'$2'_\0 0x%08x\\n", check_asm_data[i++]); printf("#define ASIZ_'$2'_\0 0x%08x\\n", check_asm_data[i++]);/' >> $4
+ echo "printf (\"#define ASIZ_$2\\t0x%08x\\n\", check_asm_data[i++]);" >> $4
+ ;;
+ -data)
+ sed -n -e '/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\
+/g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/ ((char *)\&((struct '$2'_struct *)0)->\0) - ((char *)((struct '$2'_struct *)0)), sizeof(((struct '$2'_struct *)0)->\0),/' >> $4
+ echo " sizeof(struct $2_struct)," >> $4
+ ;;
+ -ints)
+ sed -n -e '/check_asm_data:/,/\.size/p' <$2 | sed -e 's/check_asm_data://' -e 's/\.size.*//' -e 's/\.long[ ]\([0-9]*\)/\1,/' >>$3
+ ;;
+ *)
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 7cadb3da5..89c1a90ea 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.155 2000/07/10 20:57:35 davem Exp $
+/* $Id: sys_sparc32.c,v 1.156 2000/07/13 10:59:13 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -4177,3 +4177,12 @@ out_sem:
out:
return ret;
}
+
+extern asmlinkage long sys_setpriority(int which, int who, int niceval);
+
+asmlinkage int sys_setpriority32(u32 which, u32 who, u32 niceval)
+{
+ return sys_setpriority((int) which,
+ (int) who,
+ (int) niceval);
+}
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 9c20a2752..f73486541 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -1,4 +1,4 @@
-/* $Id: systbls.S,v 1.73 2000/05/10 14:23:39 jj Exp $
+/* $Id: systbls.S,v 1.74 2000/07/13 10:59:13 davem Exp $
* systbls.S: System call entry point tables for OS compatibility.
* The native Linux system call table lives here also.
*
@@ -38,7 +38,7 @@ sys_call_table32:
/*80*/ .word sys32_setgroups16, sys_getpgrp, sys_setgroups, sys32_setitimer, sys32_ftruncate64
.word sys_swapon, sys32_getitimer, sys_setuid, sys_sethostname, sys_setgid
/*90*/ .word sys_dup2, sys_setfsuid, sys32_fcntl, sys32_select, sys_setfsgid
- .word sys_fsync, sys_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall
+ .word sys_fsync, sys_setpriority32, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall
/*100*/ .word sys_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending
.word sys32_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_setresuid, sys_getresuid
/*110*/ .word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall
@@ -170,7 +170,7 @@ sunos_sys_table:
.word sys32_getitimer, sys_gethostname, sys_sethostname
.word sunos_getdtablesize, sys_dup2, sunos_nop
.word sys32_fcntl, sunos_select, sunos_nop
- .word sys_fsync, sys_setpriority, sunos_socket
+ .word sys_fsync, sys_setpriority32, sunos_socket
.word sys_connect, sunos_accept
/*100*/ .word sys_getpriority, sunos_send, sunos_recv
.word sunos_nosys, sys_bind, sunos_setsockopt
diff --git a/arch/sparc64/lib/blockops.S b/arch/sparc64/lib/blockops.S
index 9668f86d8..8d2b749e1 100644
--- a/arch/sparc64/lib/blockops.S
+++ b/arch/sparc64/lib/blockops.S
@@ -1,4 +1,4 @@
-/* $Id: blockops.S,v 1.25 2000/04/13 04:45:58 davem Exp $
+/* $Id: blockops.S,v 1.27 2000/07/14 01:12:49 davem Exp $
* blockops.S: UltraSparc block zero optimized routines.
*
* Copyright (C) 1996, 1998, 1999, 2000 David S. Miller (davem@redhat.com)
@@ -83,21 +83,29 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
or %g2, %g3, %g2
add %o0, %o3, %o0
add %o0, %o1, %o1
- sethi %hi(TLBTEMP_ENT1), %o3
+ mov TLBTEMP_ENT1, %o3
rdpr %pstate, %g3
wrpr %g3, PSTATE_IE, %pstate
+ /* Do this now, before loading the fixed TLB entries for copying,
+ * so we do not risk a multiple TLB match condition later when
+ * restoring those entries.
+ */
+ ldub [%g6 + AOFF_task_thread + AOFF_thread_use_blkcommit], %g3
+
/* Spitfire Errata #32 workaround */
mov 0x8, %o4
stxa %g0, [%o4] ASI_DMMU
- flush %g6
+ sethi %hi(empty_zero_page), %o4
+ flush %o4
ldxa [%o3] ASI_DTLB_TAG_READ, %o4
/* Spitfire Errata #32 workaround */
mov 0x8, %o5
stxa %g0, [%o5] ASI_DMMU
- flush %g6
+ sethi %hi(empty_zero_page), %o5
+ flush %o5
ldxa [%o3] ASI_DTLB_DATA_ACCESS, %o5
stxa %o0, [%o2] ASI_DMMU
@@ -108,22 +116,23 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
/* Spitfire Errata #32 workaround */
mov 0x8, %g5
stxa %g0, [%g5] ASI_DMMU
- flush %g6
+ sethi %hi(empty_zero_page), %g5
+ flush %g5
ldxa [%o3] ASI_DTLB_TAG_READ, %g5
/* Spitfire Errata #32 workaround */
mov 0x8, %g7
stxa %g0, [%g7] ASI_DMMU
- flush %g6
+ sethi %hi(empty_zero_page), %g7
+ flush %g7
ldxa [%o3] ASI_DTLB_DATA_ACCESS, %g7
stxa %o1, [%o2] ASI_DMMU
stxa %g2, [%o3] ASI_DTLB_DATA_ACCESS
membar #Sync
- ldub [%g6 + AOFF_task_thread + AOFF_thread_use_blkcommit], %g2
- cmp %g2, 0
+ cmp %g3, 0
bne,pn %xcc, copy_page_using_blkcommit
nop
@@ -168,8 +177,9 @@ copy_user_page_continue:
stxa %o4, [%o2] ASI_DMMU
stxa %o5, [%o3] ASI_DTLB_DATA_ACCESS
membar #Sync
+ rdpr %pstate, %g3
jmpl %o7 + 0x8, %g0
- wrpr %g3, 0x0, %pstate
+ wrpr %g3, PSTATE_IE, %pstate
copy_page_using_blkcommit:
membar #LoadStore | #StoreStore | #StoreLoad
@@ -227,21 +237,23 @@ clear_user_page: /* %o0=dest, %o1=vaddr */
or %g3, (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_L | _PAGE_W), %g3
or %g1, %g3, %g1
add %o0, %o3, %o0
- sethi %hi(TLBTEMP_ENT2), %o3
+ mov TLBTEMP_ENT2, %o3
rdpr %pstate, %g3
wrpr %g3, PSTATE_IE, %pstate
/* Spitfire Errata #32 workaround */
mov 0x8, %g5
stxa %g0, [%g5] ASI_DMMU
- flush %g6
+ sethi %hi(empty_zero_page), %g5
+ flush %g5
ldxa [%o3] ASI_DTLB_TAG_READ, %g5
/* Spitfire Errata #32 workaround */
mov 0x8, %g7
stxa %g0, [%g7] ASI_DMMU
- flush %g6
+ sethi %hi(empty_zero_page), %g7
+ flush %g7
ldxa [%o3] ASI_DTLB_DATA_ACCESS, %g7
stxa %o0, [%o2] ASI_DMMU
diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c
index 01595faee..62c595e6d 100644
--- a/arch/sparc64/solaris/socksys.c
+++ b/arch/sparc64/solaris/socksys.c
@@ -1,4 +1,4 @@
-/* $Id: socksys.c,v 1.14 2000/06/22 11:42:25 davem Exp $
+/* $Id: socksys.c,v 1.15 2000/07/13 08:06:38 davem Exp $
* socksys.c: /dev/inet/ stuff for Solaris emulation.
*
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -19,7 +19,6 @@
#include <linux/malloc.h>
#include <linux/in.h>
#include <linux/devfs_fs_kernel.h>
-#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/termios.h>