]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.30 2.3.30
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:29:02 +0000 (15:29 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:29:02 +0000 (15:29 -0500)
49 files changed:
arch/alpha/kernel/irq.c
arch/alpha/kernel/irq_impl.h [deleted file]
arch/alpha/kernel/pci.c
arch/alpha/kernel/smp.c
arch/alpha/kernel/sys_alcor.c
arch/alpha/kernel/sys_cabriolet.c
arch/alpha/kernel/sys_dp264.c
arch/alpha/kernel/sys_eb64p.c
arch/alpha/kernel/sys_eiger.c
arch/alpha/kernel/sys_jensen.c
arch/alpha/kernel/sys_miata.c
arch/alpha/kernel/sys_mikasa.c
arch/alpha/kernel/sys_nautilus.c
arch/alpha/kernel/sys_noritake.c
arch/alpha/kernel/sys_rawhide.c
arch/alpha/kernel/sys_ruffian.c
arch/alpha/kernel/sys_rx164.c
arch/alpha/kernel/sys_sable.c
arch/alpha/kernel/sys_sio.c
arch/alpha/kernel/sys_sx164.c
arch/alpha/kernel/sys_takara.c
arch/alpha/kernel/time.c
drivers/block/loop.c
drivers/net/rrunner.c
drivers/pci/setup.c
drivers/sound/trident.c
fs/dquot.c
include/asm-alpha/cache.h
include/asm-alpha/hardirq.h
include/asm-alpha/hw_irq.h [new file with mode: 0644]
include/asm-alpha/irq.h
include/asm-i386/cache.h
include/asm-i386/hardirq.h
include/asm-i386/pgtable-3level.h
include/asm-i386/pgtable.h
include/asm-i386/system.h
include/linux/bootmem.h
include/linux/cache.h [new file with mode: 0644]
include/linux/fs.h
include/linux/irq.h
include/linux/quota.h
include/linux/quotaops.h
include/linux/sched.h
include/linux/slab.h
kernel/sysctl.c
mm/filemap.c
net/khttpd/datasending.c
net/khttpd/main.c
scripts/Menuconfig

index 86c58359da550d1762eec5fc5bf74ed007eb722e..8368be9b26677dcdae3e2cd986a6e6c3043ee7b1 100644 (file)
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/irq.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/irq.h>
 #include <asm/bitops.h>
 #include <asm/machvec.h>
+#include <asm/spinlock.h>
 
 #include "proto.h"
-#include "irq_impl.h"
 
 #define vulp   volatile unsigned long *
 #define vuip   volatile unsigned int *
@@ -182,7 +182,8 @@ srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
  */
 
 static struct irqaction timer_irq = { NULL, 0, 0, NULL, NULL, NULL};
-static struct irqaction *irq_action[NR_IRQS];
+spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;
+irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { [0 ... NR_IRQS-1] = {0,} };
 
 
 static inline void
@@ -230,12 +231,7 @@ enable_irq(unsigned int irq_nr)
 int
 check_irq(unsigned int irq)
 {
-       struct irqaction **p;
-
-       p = irq_action + irq;
-       if (*p == NULL)
-               return 0;
-       return -EBUSY;
+       return irq_desc[irq].action ? -EBUSY : 0;
 }
 
 int
@@ -253,7 +249,7 @@ request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
        if (!handler)
                return -EINVAL;
 
-       p = irq_action + irq;
+       p = &irq_desc[irq].action;
        action = *p;
        if (action) {
                /* Can't share interrupts unless both agree to */
@@ -314,14 +310,14 @@ free_irq(unsigned int irq, void *dev_id)
                printk("Trying to free reserved IRQ %d\n", irq);
                return;
        }
-       for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
+       for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) {
                if (action->dev_id != dev_id)
                        continue;
 
                /* Found it - now free it */
                save_and_cli(flags);
                *p = action->next;
-               if (!irq[irq_action])
+               if (!irq_desc[irq].action)
                        mask_irq(irq);
                restore_flags(flags);
                kfree(action);
@@ -344,7 +340,7 @@ int get_irq_list(char *buf)
 #endif
 
        for (i = 0; i < NR_IRQS; i++) {
-               action = irq_action[i];
+               action = irq_desc[i].action;
                if (!action) 
                        continue;
                p += sprintf(p, "%3d: ",i);
@@ -541,63 +537,6 @@ __global_restore_flags(unsigned long flags)
         }
 }
 
-#undef INIT_STUCK
-#define INIT_STUCK (1<<26)
-
-#undef STUCK
-#define STUCK                                                  \
-  if (!--stuck) {                                              \
-    printk("irq_enter stuck (irq=%d, cpu=%d, global=%d)\n",    \
-          irq, cpu, global_irq_holder);                        \
-    stuck = INIT_STUCK;                                                \
-  }
-
-#undef VERBOSE_IRQLOCK_DEBUGGING
-
-void
-irq_enter(int cpu, int irq)
-{
-#ifdef VERBOSE_IRQLOCK_DEBUGGING
-       extern void smp_show_backtrace_all_cpus(void);
-#endif
-       int stuck = INIT_STUCK;
-
-       hardirq_enter(cpu, irq);
-       barrier();
-       while (spin_is_locked(&global_irq_lock)) {
-               if (cpu == global_irq_holder) {
-                       int globl_locked = spin_is_locked(&global_irq_lock);
-                       int globl_icount = atomic_read(&global_irq_count);
-                       int local_count = local_irq_count(cpu);
-
-                       /* It is very important that we load the state
-                          variables before we do the first call to
-                          printk() as printk() could end up changing
-                          them...  */
-
-                       printk("CPU[%d]: where [%p] glocked[%d] gicnt[%d]"
-                              " licnt[%d]\n",
-                              cpu, previous_irqholder, globl_locked,
-                              globl_icount, local_count);
-#ifdef VERBOSE_IRQLOCK_DEBUGGING
-                       printk("Performing backtrace on all CPUs,"
-                              " write this down!\n");
-                       smp_show_backtrace_all_cpus();
-#endif
-                       break;
-               }
-               STUCK;
-               barrier();
-       }
-}
-
-void
-irq_exit(int cpu, int irq)
-{
-       hardirq_exit(cpu, irq);
-       release_irqlock(cpu);
-}
-
 static void
 show(char * str, void *where)
 {
@@ -698,12 +637,6 @@ synchronize_irq(void)
        }
 #endif
 }
-
-#else /* !__SMP__ */
-
-#define irq_enter(cpu, irq)    (++local_irq_count(cpu))
-#define irq_exit(cpu, irq)     (--local_irq_count(cpu))
-
 #endif /* __SMP__ */
 
 static void
@@ -720,7 +653,7 @@ unexpected_irq(int irq, struct pt_regs * regs)
        printk("PC = %016lx PS=%04lx\n", regs->pc, regs->ps);
        printk("Expecting: ");
        for (i = 0; i < ACTUAL_NR_IRQS; i++)
-               if ((action = irq_action[i]))
+               if ((action = irq_desc[i].action))
                        while (action->handler) {
                                printk("[%s:%d] ", action->name, i);
                                action = action->next;
@@ -774,7 +707,7 @@ handle_irq(int irq, int ack, struct pt_regs * regs)
 
        irq_enter(cpu, irq);
        kstat.irqs[cpu][irq] += 1;
-       action = irq_action[irq];
+       action = irq_desc[irq].action;
 
        /*
         * For normal interrupts, we mask it out, and then ACK it.
@@ -823,7 +756,7 @@ probe_irq_on(void)
                if (!(PROBE_MASK & (1UL << i))) {
                        continue;
                }
-               action = irq_action[i];
+               action = irq_desc[i].action;
                if (!action) {
                        enable_irq(i);
                        irqs |= (1UL << i);
diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h
deleted file mode 100644 (file)
index ae1d620..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *     linux/arch/alpha/kernel/irq.h
- *
- *     Copyright (C) 1995 Linus Torvalds
- *     Copyright (C) 1998 Richard Henderson
- *
- * This file contains declarations and inline functions for interfacing
- * with the IRQ handling routines in irq.c.
- */
-
-#include <linux/config.h>
-
-#define STANDARD_INIT_IRQ_PROLOG       \
-       outb(0, DMA1_RESET_REG);        \
-       outb(0, DMA2_RESET_REG);        \
-       outb(0, DMA1_CLR_MASK_REG);     \
-       outb(0, DMA2_CLR_MASK_REG)
-
-extern unsigned long _alpha_irq_masks[2];
-#define alpha_irq_mask _alpha_irq_masks[0]
-
-extern void common_ack_irq(unsigned long irq);
-extern void isa_device_interrupt(unsigned long vector, struct pt_regs * regs);
-extern void srm_device_interrupt(unsigned long vector, struct pt_regs * regs);
-
-extern void handle_irq(int irq, int ack, struct pt_regs * regs);
-
-#define RTC_IRQ    8
-#ifdef CONFIG_RTC
-#define TIMER_IRQ  0                    /* timer is the pit */
-#else
-#define TIMER_IRQ  RTC_IRQ              /* timer is the rtc */
-#endif
-
-/*
- * PROBE_MASK is the bitset of irqs that we consider for autoprobing.
- */
-
-/* NOTE: we only handle the first 64 IRQs in this code. */
-
-/* The normal mask includes all the IRQs except timer IRQ 0.  */
-#define _PROBE_MASK(nr_irqs)   \
-       (((nr_irqs > 63) ? ~0UL : ((1UL << (nr_irqs & 63)) - 1)) & ~1UL)
-
-/* Mask out unused timer irq 0 and RTC irq 8. */
-#define P2K_PROBE_MASK         (_PROBE_MASK(16) & ~0x101UL)
-
-/* Mask out unused timer irq 0, "irqs" 20-30, and the EISA cascade. */
-#define ALCOR_PROBE_MASK       (_PROBE_MASK(48) & ~0xfff000000001UL)
-
-/* Leave timer IRQ 0 in the mask.  */
-#define RUFFIAN_PROBE_MASK     (_PROBE_MASK(48) | 1UL)
-
-/* Do not probe/enable beyond the PCI devices. */
-#define TSUNAMI_PROBE_MASK     _PROBE_MASK(48)
-
-#if defined(CONFIG_ALPHA_GENERIC)
-# define PROBE_MASK    alpha_mv.irq_probe_mask
-#elif defined(CONFIG_ALPHA_P2K)
-# define PROBE_MASK    P2K_PROBE_MASK
-#elif defined(CONFIG_ALPHA_ALCOR) || defined(CONFIG_ALPHA_XLT)
-# define PROBE_MASK    ALCOR_PROBE_MASK
-#elif defined(CONFIG_ALPHA_RUFFIAN)
-# define PROBE_MASK    RUFFIAN_PROBE_MASK
-#elif defined(CONFIG_ALPHA_DP264)
-# define PROBE_MASK    TSUNAMI_PROBE_MASK
-#else
-# define PROBE_MASK    _PROBE_MASK(NR_IRQS)
-#endif
-
-
-extern char _stext;
-static inline void alpha_do_profile (unsigned long pc)
-{
-       if (prof_buffer && current->pid) {
-               pc -= (unsigned long) &_stext;
-               pc >>= prof_shift;
-               /*
-                * Don't ignore out-of-bounds PC values silently,
-                * put them into the last histogram slot, so if
-                * present, they will show up as a sharp peak.
-                */
-               if (pc > prof_len - 1)
-                       pc = prof_len - 1;
-               atomic_inc((atomic_t *)&prof_buffer[pc]);
-       }
-}
index 4fb054e3825c088b0a05e3c9aedca71694b1d6e3..9a61a4e992681cf47cc0f5d832ed7f4f8ffd31e1 100644 (file)
@@ -57,11 +57,32 @@ quirk_isa_bridge(struct pci_dev *dev)
        dev->class = PCI_CLASS_BRIDGE_ISA;
 }
 
+static void __init
+quirk_vga_enable_rom(struct pci_dev *dev)
+{
+       /* If it's a VGA, enable its BIOS ROM at C0000.
+          But if its a Cirrus 543x/544x DISABLE it, since
+          enabling ROM disables the memory... */
+       if ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA &&
+           /* But if its a Cirrus 543x/544x DISABLE it */
+           (dev->vendor != PCI_VENDOR_ID_CIRRUS ||
+            (dev->device < 0x00a0) || (dev->device > 0x00ac)))
+       {
+               u32 reg;
+
+               pci_read_config_dword(dev, dev->rom_base_reg, &reg);
+               reg |= PCI_ROM_ADDRESS_ENABLE;
+               pci_write_config_dword(dev, dev->rom_base_reg, reg);
+               dev->resource[PCI_ROM_RESOURCE].flags |= PCI_ROM_ADDRESS_ENABLE;
+       }
+}
+
 struct pci_fixup pcibios_fixups[] __initdata = {
        { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375,
          quirk_eisa_bridge },
        { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378,
          quirk_isa_bridge },
+       { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, quirk_vga_enable_rom },
        { 0 }
 };
 
@@ -71,7 +92,7 @@ struct pci_fixup pcibios_fixups[] __initdata = {
 #define MB                     (1024*KB)
 #define GB                     (1024*MB)
 
-void __init
+void
 pcibios_align_resource(void *data, struct resource *res, unsigned long size)
 {
        struct pci_dev * dev = data;
@@ -145,13 +166,13 @@ pcibios_align_resource(void *data, struct resource *res, unsigned long size)
 static void __init
 pcibios_assign_special(struct pci_dev * dev)
 {
+       int i;
+
        /* The first three resources of an IDE controler are often magic, 
           so leave them unchanged.  This is true, for instance, of the
           Contaq 82C693 as seen on SX164 and DP264.  */
 
        if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) {
-               int i;
-
                /* Resource 1 of IDE controller is the address of HD_CMD
                   register which actually occupies a single byte (0x3f6
                   for ide0) in reported 0x3f4-3f7 range. We have to fix
@@ -163,6 +184,16 @@ pcibios_assign_special(struct pci_dev * dev)
                        if (dev->resource[i].flags && dev->resource[i].start)
                                pci_claim_resource(dev, i);
        }
+       /*
+        * We don't have code that will init the CYPRESS bridge correctly
+        * so we do the next best thing, and depend on the previous
+        * console code to do the right thing, and ignore it here... :-\
+        */
+       else if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
+                dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
+               for (i = 0; i < PCI_NUM_RESOURCES; i++)
+                       if (dev->resource[i].flags && dev->resource[i].start)
+                               pci_claim_resource(dev, i);
 }
 
 
index a1beba5be236d74256771c3938f9e3d98bafc400..3fbf11495e866049d0f7aec7c0dab98e139c97dc 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
+#include <linux/irq.h>
 
 #include <asm/hwrpb.h>
 #include <asm/ptrace.h>
@@ -32,7 +33,6 @@
 #include <asm/unistd.h>
 
 #include "proto.h"
-#include "irq_impl.h"
 
 
 #define DEBUG_SMP 0
@@ -47,8 +47,8 @@ struct cpuinfo_alpha cpu_data[NR_CPUS];
 
 /* A collection of single bit ipi messages.  */
 static struct {
-       unsigned long bits __cacheline_aligned;
-} ipi_data[NR_CPUS];
+       unsigned long bits ____cacheline_aligned;
+} ipi_data[NR_CPUS] __cacheline_aligned;
 
 enum ipi_message_type {
         IPI_RESCHEDULE,
@@ -56,7 +56,7 @@ enum ipi_message_type {
         IPI_CPU_STOP,
 };
 
-spinlock_t kernel_flag __cacheline_aligned = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
 
 /* Set to a secondary's cpuid when it comes online.  */
 static unsigned long smp_secondary_alive;
index 684e9edec71d870da4114e9c134ce30d7131d28d..2a27bac5b6f8a641621cce1d89b80611c239c8d8 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/core_cia.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index d79913e8220ce83ca6bd1de7a12e5d8bc571321c..bc4d2c2ba7db2e815dcb8eb49af8ff83eff69304 100644 (file)
@@ -31,7 +31,7 @@
 #include <asm/core_pyxis.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
@@ -298,7 +298,6 @@ struct alpha_machine_vector eb164_mv __initmv = {
        init_irq:               cabriolet_init_irq,
        init_pit:               common_init_pit,
        init_pci:               cabriolet_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            cabriolet_map_irq,
        pci_swizzle:            common_swizzle,
 };
@@ -327,7 +326,6 @@ struct alpha_machine_vector eb66p_mv __initmv = {
        init_irq:               cabriolet_init_irq,
        init_pit:               common_init_pit,
        init_pci:               cabriolet_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            eb66p_map_irq,
        pci_swizzle:            common_swizzle,
 };
@@ -356,7 +354,6 @@ struct alpha_machine_vector lx164_mv __initmv = {
        init_irq:               cabriolet_init_irq,
        init_pit:               common_init_pit,
        init_pci:               alphapc164_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            alphapc164_map_irq,
        pci_swizzle:            common_swizzle,
 };
@@ -385,7 +382,6 @@ struct alpha_machine_vector pc164_mv __initmv = {
        init_irq:               cabriolet_init_irq,
        init_pit:               common_init_pit,
        init_pci:               alphapc164_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            alphapc164_map_irq,
        pci_swizzle:            common_swizzle,
 };
index 26e97a8ae3a772f7b4e476f5759d71b7f2aca3d6..f0ef471838a918ad571bfbe4b01ec6314d227723 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/hwrpb.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
 static void
 dp264_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
 {
-       if (irq >= 16) {
-               volatile unsigned long *csr;
+       volatile unsigned long *csr;
 
-               if (TSUNAMI_bootcpu < 2)
-                       if (!TSUNAMI_bootcpu)
-                               csr = &TSUNAMI_cchip->dim0.csr;
-                       else
-                               csr = &TSUNAMI_cchip->dim1.csr;
+       if (TSUNAMI_bootcpu < 2) {
+               if (!TSUNAMI_bootcpu)
+                       csr = &TSUNAMI_cchip->dim0.csr;
                else
-                       if (TSUNAMI_bootcpu == 2)
-                               csr = &TSUNAMI_cchip->dim2.csr;
-                       else
-                               csr = &TSUNAMI_cchip->dim3.csr;
-               
-               *csr = ~mask;
-               mb();
-               *csr;
+                       csr = &TSUNAMI_cchip->dim1.csr;
+       } else {
+               if (TSUNAMI_bootcpu == 2)
+                       csr = &TSUNAMI_cchip->dim2.csr;
+               else
+                       csr = &TSUNAMI_cchip->dim3.csr;
+       }
+
+       *csr = ~mask;
+       mb();
+       *csr;
+
+       if (irq < 16) {
+               if (irq >= 8)
+                       outb(mask >> 8, 0xA1);  /* ISA PIC2 */
+               else
+                       outb(mask, 0x21);       /* ISA PIC1 */
        }
-       else if (irq >= 8)
-               outb(mask >> 8, 0xA1);  /* ISA PIC2 */
-       else
-               outb(mask, 0x21);       /* ISA PIC1 */
 }
 
 static void
@@ -274,8 +276,19 @@ dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        struct pci_controler *hose = dev->sysdata;
        int irq = COMMON_TABLE_LOOKUP;
 
-       if (irq > 0)
+       if (irq > 0) {
                irq += 16 * hose->index;
+       } else {
+               /* ??? The Contaq IDE controler on the ISA bridge uses
+                  "legacy" interrupts 14 and 15.  I don't know if anything
+                  can wind up at the same slot+pin on hose1, so we'll
+                  just have to trust whatever value the console might
+                  have assigned.  */
+
+               u8 irq8;
+               pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
+               irq = irq8;
+       }
 
        return irq;
 }
index 4f15ec4f153e7f7fe06aa301f58f9448b89ea591..e8e22471539f4ed79203f5ff024ea2de555b1cbc 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/core_lca.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
@@ -212,7 +212,6 @@ struct alpha_machine_vector eb66_mv __initmv = {
        init_irq:               eb64p_init_irq,
        init_pit:               common_init_pit,
        init_pci:               common_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            eb64p_map_irq,
        pci_swizzle:            common_swizzle,
 };
index 07dbed7302eb537bbd1df629650f9931728ad711..433abddfb1792854faabca19b2ac92bb7d687d8f 100644 (file)
@@ -29,7 +29,7 @@
 #include <asm/hwrpb.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index 9923213318919384373c9530ea1c03069c7e4a9a..ad156c9f263550e44072999844754522359b796e 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/pgtable.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "machvec_impl.h"
 
 
index 4e5dd14b936335d1f95cb055c9fc4f7e745d532b..b2da23528f4383bd088acbace959e7007d53adde 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/core_pyxis.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index c93bcec4510d3f14bb2ec9722ee1572d04de4135..ac55371a65aef3ef3803bcce3aa5de0d3af2fea1 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/core_cia.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
@@ -223,7 +223,6 @@ struct alpha_machine_vector mikasa_primo_mv __initmv = {
        init_irq:               mikasa_init_irq,
        init_pit:               common_init_pit,
        init_pci:               common_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            mikasa_map_irq,
        pci_swizzle:            common_swizzle,
 };
index 48f79bd06a128953b894effa668c292aa38aac9d..b51eee67193d5c5364ccd68ef2586f88396c932b 100644 (file)
@@ -45,7 +45,7 @@
 #include <asm/hwrpb.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index 5a97b5e2c226beabb1c8195aa19875177471bf8b..c1a7933934bdd5d2f52bb478d37e5b272882d14d 100644 (file)
@@ -29,7 +29,7 @@
 #include <asm/core_cia.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
@@ -283,7 +283,6 @@ struct alpha_machine_vector noritake_primo_mv __initmv = {
        init_irq:               noritake_init_irq,
        init_pit:               common_init_pit,
        init_pci:               common_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            noritake_map_irq,
        pci_swizzle:            noritake_swizzle,
 };
index 89bac964485740c02050e7fc28c01eaa02ed99fd..0a0ce2267fe3f5e4790a9e2b1e682dadc50a8f40 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/core_mcpcia.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index 7d4aeedd4ab390011ab38b4add8e5e1d3d2cdc91..c03a91296049c125c932d165b266ed026810a189 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/core_pyxis.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index 0a13bb8f3f30a458a60783d1d1edb99d16d4679c..969d3561fe15429db5a6a81f7e78bcd4ee5b8be3 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/core_polaris.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index 327167d47ad5b2062491f51de1f7d4ffe597c514..53afe259bda9fc5f38c2be0180f15d1644ecb2a2 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/core_t2.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
@@ -283,7 +283,6 @@ struct alpha_machine_vector sable_gamma_mv __initmv = {
        init_irq:               sable_init_irq,
        init_pit:               common_init_pit,
        init_pci:               common_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            sable_map_irq,
        pci_swizzle:            common_swizzle,
 
index ade418eaf57871a2a7e3100723c0dc5417df9c2a..f26991f55813fadba636cd75ab81f65afd243416 100644 (file)
@@ -30,7 +30,7 @@
 #include <asm/core_lca.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
@@ -359,7 +359,6 @@ struct alpha_machine_vector avanti_mv __initmv = {
        init_irq:               sio_init_irq,
        init_pit:               common_init_pit,
        init_pci:               noname_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            noname_map_irq,
        pci_swizzle:            common_swizzle,
 
@@ -392,7 +391,6 @@ struct alpha_machine_vector noname_mv __initmv = {
        init_irq:               sio_init_irq,
        init_pit:               common_init_pit,
        init_pci:               noname_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            noname_map_irq,
        pci_swizzle:            common_swizzle,
 
@@ -434,7 +432,6 @@ struct alpha_machine_vector p2k_mv __initmv = {
        init_irq:               sio_init_irq,
        init_pit:               common_init_pit,
        init_pci:               noname_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            p2k_map_irq,
        pci_swizzle:            common_swizzle,
 
@@ -467,7 +464,6 @@ struct alpha_machine_vector xl_mv __initmv = {
        init_irq:               sio_init_irq,
        init_pit:               common_init_pit,
        init_pci:               noname_init_pci,
-       kill_arch:              common_kill_arch,
        pci_map_irq:            noname_map_irq,
        pci_swizzle:            common_swizzle,
 
index 63a09544a30bd7cacd637170b062f8ad710799b7..6ad08e4425c7bbef3701746f91fe5476a16cc730 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/core_pyxis.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index 4ca18d70d3eb9a7331d0b66ca9884edd1ae2c856..a17cd4de6cde81db8dec7ab9aede93a398e78414 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/core_cia.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
index f66418c6ce8806effaba5d46fe112437cdb3fa0d..6e528e08f1954b8666d955febd1bbdb7bf367bfe 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/timex.h>
 
 #include "proto.h"
-#include "irq_impl.h"
+#include <asm/hw_irq.h>
 
 extern rwlock_t xtime_lock;
 extern volatile unsigned long lost_ticks;      /* kernel/sched.c */
index cace2226cd5fdeecba27c89965366e1687e573a7..3459ec1fd01e4bedcca6115058bcfe66fc8a3439 100644 (file)
@@ -425,7 +425,7 @@ static int loop_set_fd(struct loop_device *lo, kdev_t dev, unsigned int arg)
                lo->lo_flags |= LO_FLAGS_READ_ONLY;
                set_device_ro(dev, 1);
        } else {
-               invalidate_inode_pages (inode);
+               vmtruncate (inode, 0);
                set_device_ro(dev, 0);
        }
 
index f2152543845835ace7c0d8b4612b8bf08967cb04..8e2e4f72e3c2b1db1baa0cb1f6caed357442e026 100644 (file)
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/mm.h>
+#include <linux/cache.h>
 #include <net/sock.h>
 
 #include <asm/system.h>
-#include <asm/cache.h>
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #include <asm/irq.h>
index 022af82fea14e9afb39e62fdf04e0fc6a3aa47b7..e47380c58224ef6698b350cd2defcd40562aa8a7 100644 (file)
@@ -16,8 +16,7 @@
 #include <linux/pci.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-
-#include <asm/cache.h>
+#include <linux/cache.h>
 
 
 #define DEBUG_CONFIG 0
@@ -271,7 +270,7 @@ pci_set_bus_ranges(void)
                pbus_set_ranges(bus, NULL);
 }
 
-static void
+static void __init
 pdev_fixup_irq(struct pci_dev *dev,
               u8 (*swizzle)(struct pci_dev *, u8 *),
               int (*map_irq)(struct pci_dev *, u8, u8))
index 9092998fa7d5a47733250d8b14c5faf5da072cd0..08c4acfa13a3ed6351130637b57a2ca02973b313 100644 (file)
@@ -32,6 +32,7 @@
 /*****************************************************************************/
 
       
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/string.h>
index a7686fe0ec784ab73a0249e0d5d478e7cbaa5f6d..1efafcf51a5142df772ed8ee9af15c7a7a060a31 100644 (file)
@@ -786,110 +786,113 @@ static inline void dquot_decr_blocks(struct dquot *dquot, unsigned long number)
        dquot->dq_flags |= DQ_MOD;
 }
 
-static inline char need_print_warning(short type, uid_t initiator, struct dquot *dquot)
+static inline int need_print_warning(struct dquot *dquot, int flag)
 {
-       switch (type) {
+       switch (dquot->dq_type) {
                case USRQUOTA:
-                       return(initiator == dquot->dq_id);
+                       return current->fsuid == dquot->dq_id && !(dquot->dq_flags & flag);
                case GRPQUOTA:
-                       return(initiator == dquot->dq_id);
+                       return in_group_p(dquot->dq_id) && !(dquot->dq_flags & flag);
        }
-       return(0);
+       return 0;
 }
 
-static inline char ignore_hardlimit(struct dquot *dquot, uid_t initiator)
+static void print_warning(struct dquot *dquot, int flag, char *fmtstr, ...)
 {
-       return(initiator == 0 && dquot->dq_mnt->mnt_dquot.rsquash[dquot->dq_type] == 0);
+       va_list args;
+
+       if (!need_print_warning(dquot, flag))
+               return;
+       va_start(args, fmtstr);
+       vsprintf(quotamessage, fmtstr, args);
+       va_end(args);
+       tty_write_message(current->tty, quotamessage);
+       dquot->dq_flags |= flag;
 }
 
-static int check_idq(struct dquot *dquot, short type, u_long inodes, uid_t initiator, 
-                       struct tty_struct *tty)
+static inline char ignore_hardlimit(struct dquot *dquot)
 {
+       return capable(CAP_SYS_RESOURCE) && !dquot->dq_mnt->mnt_dquot.rsquash[dquot->dq_type];
+}
+
+static int check_idq(struct dquot *dquot, u_long inodes)
+{
+       short type = dquot->dq_type;
+
        if (inodes <= 0 || dquot->dq_flags & DQ_FAKE)
-               return(QUOTA_OK);
+               return QUOTA_OK;
 
        if (dquot->dq_ihardlimit &&
           (dquot->dq_curinodes + inodes) > dquot->dq_ihardlimit &&
-            !ignore_hardlimit(dquot, initiator)) {
-               if ((dquot->dq_flags & DQ_INODES) == 0 &&
-                     need_print_warning(type, initiator, dquot)) {
-                       sprintf(quotamessage, "%s: write failed, %s file limit reached\n",
-                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
-                       tty_write_message(tty, quotamessage);
-                       dquot->dq_flags |= DQ_INODES;
-               }
-               return(NO_QUOTA);
+            !ignore_hardlimit(dquot)) {
+               print_warning(dquot, DQ_INODES, "%s: write failed, %s file limit reached\n",
+                             dquot->dq_mnt->mnt_dirname, quotatypes[type]);
+               return NO_QUOTA;
        }
 
        if (dquot->dq_isoftlimit &&
           (dquot->dq_curinodes + inodes) > dquot->dq_isoftlimit &&
            dquot->dq_itime && CURRENT_TIME >= dquot->dq_itime &&
-            !ignore_hardlimit(dquot, initiator)) {
-                if (need_print_warning(type, initiator, dquot)) {
-                       sprintf(quotamessage, "%s: warning, %s file quota exceeded too long.\n",
-                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
-                       tty_write_message(tty, quotamessage);
-               }
-               return(NO_QUOTA);
+            !ignore_hardlimit(dquot)) {
+               print_warning(dquot, DQ_INODES, "%s: warning, %s file quota exceeded too long.\n",
+                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
+               return NO_QUOTA;
        }
 
        if (dquot->dq_isoftlimit &&
           (dquot->dq_curinodes + inodes) > dquot->dq_isoftlimit &&
            dquot->dq_itime == 0) {
-                if (need_print_warning(type, initiator, dquot)) {
-                       sprintf(quotamessage, "%s: warning, %s file quota exceeded\n",
-                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
-                       tty_write_message(tty, quotamessage);
-               }
+               print_warning(dquot, 0, "%s: warning, %s file quota exceeded\n",
+                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
                dquot->dq_itime = CURRENT_TIME + dquot->dq_mnt->mnt_dquot.inode_expire[type];
        }
 
-       return(QUOTA_OK);
+       return QUOTA_OK;
 }
 
-static int check_bdq(struct dquot *dquot, short type, u_long blocks, uid_t initiator, 
-                       struct tty_struct *tty, char warn)
+static int check_bdq(struct dquot *dquot, u_long blocks, char prealloc)
 {
+       short type = dquot->dq_type;
+
        if (blocks <= 0 || dquot->dq_flags & DQ_FAKE)
-               return(QUOTA_OK);
+               return QUOTA_OK;
 
        if (dquot->dq_bhardlimit &&
           (dquot->dq_curblocks + blocks) > dquot->dq_bhardlimit &&
-            !ignore_hardlimit(dquot, initiator)) {
-               if (warn && (dquot->dq_flags & DQ_BLKS) == 0 &&
-                     need_print_warning(type, initiator, dquot)) {
-                       sprintf(quotamessage, "%s: write failed, %s disk limit reached.\n",
-                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
-                       tty_write_message(tty, quotamessage);
-                       dquot->dq_flags |= DQ_BLKS;
-               }
-               return(NO_QUOTA);
+            !ignore_hardlimit(dquot)) {
+               if (!prealloc)
+                       print_warning(dquot, DQ_BLKS, "%s: write failed, %s disk limit reached.\n",
+                                       dquot->dq_mnt->mnt_dirname, quotatypes[type]);
+               return NO_QUOTA;
        }
 
        if (dquot->dq_bsoftlimit &&
           (dquot->dq_curblocks + blocks) > dquot->dq_bsoftlimit &&
            dquot->dq_btime && CURRENT_TIME >= dquot->dq_btime &&
-            !ignore_hardlimit(dquot, initiator)) {
-                if (warn && need_print_warning(type, initiator, dquot)) {
-                       sprintf(quotamessage, "%s: write failed, %s disk quota exceeded too long.\n",
-                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
-                       tty_write_message(tty, quotamessage);
-               }
-               return(NO_QUOTA);
+            !ignore_hardlimit(dquot)) {
+               if (!prealloc)
+                       print_warning(dquot, DQ_BLKS, "%s: write failed, %s disk quota exceeded too long.\n",
+                                       dquot->dq_mnt->mnt_dirname, quotatypes[type]);
+               return NO_QUOTA;
        }
 
        if (dquot->dq_bsoftlimit &&
           (dquot->dq_curblocks + blocks) > dquot->dq_bsoftlimit &&
            dquot->dq_btime == 0) {
-                if (warn && need_print_warning(type, initiator, dquot)) {
-                       sprintf(quotamessage, "%s: warning, %s disk quota exceeded\n",
-                               dquot->dq_mnt->mnt_dirname, quotatypes[type]);
-                       tty_write_message(tty, quotamessage);
+               if (!prealloc) {
+                       print_warning(dquot, 0, "%s: warning, %s disk quota exceeded\n",
+                                       dquot->dq_mnt->mnt_dirname, quotatypes[type]);
+                       dquot->dq_btime = CURRENT_TIME + dquot->dq_mnt->mnt_dquot.block_expire[type];
                }
-               dquot->dq_btime = CURRENT_TIME + dquot->dq_mnt->mnt_dquot.block_expire[type];
+               else
+                       /*
+                        * We don't allow preallocation to exceed softlimit so exceeding will
+                        * be always printed
+                        */
+                       return NO_QUOTA;
        }
 
-       return(QUOTA_OK);
+       return QUOTA_OK;
 }
 
 /*
@@ -1102,11 +1105,9 @@ void dquot_drop(struct inode *inode)
 /*
  * Note: this is a blocking operation.
  */
-int dquot_alloc_block(const struct inode *inode, unsigned long number, uid_t initiator, 
-                       char warn)
+int dquot_alloc_block(const struct inode *inode, unsigned long number, char warn)
 {
        int cnt;
-       struct tty_struct *tty = current->tty;
        struct dquot *dquot[MAXQUOTAS];
 
        for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
@@ -1114,7 +1115,7 @@ int dquot_alloc_block(const struct inode *inode, unsigned long number, uid_t ini
                if (dquot[cnt] == NODQUOT)
                        continue;
                lock_dquot(dquot[cnt]);
-               if (check_bdq(dquot[cnt], cnt, number, initiator, tty, warn))
+               if (check_bdq(dquot[cnt], number, warn))
                        goto put_all;
        }
 
@@ -1140,10 +1141,9 @@ put_all:
 /*
  * Note: this is a blocking operation.
  */
-int dquot_alloc_inode(const struct inode *inode, unsigned long number, uid_t initiator)
+int dquot_alloc_inode(const struct inode *inode, unsigned long number)
 {
        int cnt;
-       struct tty_struct *tty = current->tty;
        struct dquot *dquot[MAXQUOTAS];
 
        for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
@@ -1151,7 +1151,7 @@ int dquot_alloc_inode(const struct inode *inode, unsigned long number, uid_t ini
                if (dquot[cnt] == NODQUOT)
                        continue;
                lock_dquot(dquot[cnt]);
-               if (check_idq(dquot[cnt], cnt, number, initiator, tty))
+               if (check_idq(dquot[cnt], number))
                        goto put_all;
        }
 
@@ -1213,13 +1213,12 @@ void dquot_free_inode(const struct inode *inode, unsigned long number)
  *
  * Note: this is a blocking operation.
  */
-int dquot_transfer(struct dentry *dentry, struct iattr *iattr, uid_t initiator)
+int dquot_transfer(struct dentry *dentry, struct iattr *iattr)
 {
        struct inode *inode = dentry -> d_inode;
        unsigned long blocks;
        struct dquot *transfer_from[MAXQUOTAS];
        struct dquot *transfer_to[MAXQUOTAS];
-       struct tty_struct *tty = current->tty;
        short cnt, disc;
        int error = -EDQUOT;
 
@@ -1293,8 +1292,8 @@ int dquot_transfer(struct dentry *dentry, struct iattr *iattr, uid_t initiator)
                 * invalidated or locked...
                 */
                if (!transfer_to[cnt]->dq_mnt || !transfer_from[cnt]->dq_mnt ||
-                   check_idq(transfer_to[cnt], cnt, 1, initiator, tty) == NO_QUOTA ||
-                   check_bdq(transfer_to[cnt], cnt, blocks, initiator, tty, 0) == NO_QUOTA) {
+                   check_idq(transfer_to[cnt], 1) == NO_QUOTA ||
+                   check_bdq(transfer_to[cnt], blocks, 0) == NO_QUOTA) {
                        cnt++;
                        goto put_all;
                }
@@ -1458,9 +1457,9 @@ out:
 static inline int check_quotafile_size(loff_t size)
 {
        ulong blocks = size >> BLOCK_SIZE_BITS;
-       size_t off = size & ~(BLOCK_SIZE - 1);
+       size_t off = size & (BLOCK_SIZE - 1);
 
-       return !((blocks % sizeof(struct dqblk) + off % sizeof(struct dqblk)) % sizeof(struct dqblk));
+       return !(((blocks % sizeof(struct dqblk)) * BLOCK_SIZE + off % sizeof(struct dqblk)) % sizeof(struct dqblk));
 }
 
 int quota_on(kdev_t dev, short type, char *path)
@@ -1555,7 +1554,7 @@ asmlinkage long sys_quotactl(int cmd, const char *special, int id, caddr_t addr)
                        break;
                case Q_GETQUOTA:
                        if (((type == USRQUOTA && current->euid != id) ||
-                            (type == GRPQUOTA && in_group_p(id))) &&
+                            (type == GRPQUOTA && in_egroup_p(id))) &&
                            !capable(CAP_SYS_RESOURCE))
                                goto out;
                        break;
index b7662d72657e918875551801179eb753917fa55c..5e46073a887010ff489c0a2d203dfc6765ac65c4 100644 (file)
@@ -10,6 +10,4 @@
 #define L1_CACHE_ALIGN(x)  (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
 #define SMP_CACHE_BYTES    L1_CACHE_BYTES
 
-#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES)))
-
 #endif
index 31cdbac06374a255a50b55afd7d881d8364faa81..67544e13d8b7f59cf5a4e8c3354d46374081730c 100644 (file)
@@ -28,8 +28,8 @@ extern int __local_irq_count;
 #define hardirq_trylock(cpu)   (local_irq_count(cpu) == 0)
 #define hardirq_endlock(cpu)   ((void) 0)
 
-#define hardirq_enter(cpu, irq)        (local_irq_count(cpu)++)
-#define hardirq_exit(cpu, irq) (local_irq_count(cpu)--)
+#define irq_enter(cpu, irq)    (local_irq_count(cpu)++)
+#define irq_exit(cpu, irq)     (local_irq_count(cpu)--)
 
 #define synchronize_irq()      barrier()
 
@@ -52,13 +52,16 @@ static inline void release_irqlock(int cpu)
         }
 }
 
-static inline void hardirq_enter(int cpu, int irq)
+static inline void irq_enter(int cpu, int irq)
 {
        ++local_irq_count(cpu);
         atomic_inc(&global_irq_count);
+
+       while (spin_is_locked(&global_irq_lock))
+               barrier();
 }
 
-static inline void hardirq_exit(int cpu, int irq)
+static inline void irq_exit(int cpu, int irq)
 {
        atomic_dec(&global_irq_count);
         --local_irq_count(cpu);
@@ -66,11 +69,10 @@ static inline void hardirq_exit(int cpu, int irq)
 
 static inline int hardirq_trylock(int cpu)
 {
-       return (!atomic_read(&global_irq_count)
-               && !spin_is_locked(&global_irq_lock));
+       return !local_irq_count(cpu) && !spin_is_locked(&global_irq_lock);
 }
 
-#define hardirq_endlock(cpu)  ((void)0)
+#define hardirq_endlock(cpu)   do { } while (0)
 
 extern void synchronize_irq(void);
 
diff --git a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h
new file mode 100644 (file)
index 0000000..c6af579
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef _ALPHA_HW_IRQ_H
+#define _ALPHA_HW_IRQ_H
+/*
+ *     linux/arch/alpha/kernel/irq.h
+ *
+ *     Copyright (C) 1995 Linus Torvalds
+ *     Copyright (C) 1998 Richard Henderson
+ *
+ * This file contains declarations and inline functions for interfacing
+ * with the IRQ handling routines in irq.c.
+ */
+
+#include <linux/config.h>
+
+#define STANDARD_INIT_IRQ_PROLOG       \
+       outb(0, DMA1_RESET_REG);        \
+       outb(0, DMA2_RESET_REG);        \
+       outb(0, DMA1_CLR_MASK_REG);     \
+       outb(0, DMA2_CLR_MASK_REG)
+
+extern unsigned long _alpha_irq_masks[2];
+#define alpha_irq_mask _alpha_irq_masks[0]
+
+extern void common_ack_irq(unsigned long irq);
+extern void isa_device_interrupt(unsigned long vector, struct pt_regs * regs);
+extern void srm_device_interrupt(unsigned long vector, struct pt_regs * regs);
+
+extern void handle_irq(int irq, int ack, struct pt_regs * regs);
+
+#define RTC_IRQ    8
+#ifdef CONFIG_RTC
+#define TIMER_IRQ  0                    /* timer is the pit */
+#else
+#define TIMER_IRQ  RTC_IRQ              /* timer is the rtc */
+#endif
+
+/*
+ * PROBE_MASK is the bitset of irqs that we consider for autoprobing.
+ */
+
+/* NOTE: we only handle the first 64 IRQs in this code. */
+
+/* The normal mask includes all the IRQs except timer IRQ 0.  */
+#define _PROBE_MASK(nr_irqs)   \
+       (((nr_irqs > 63) ? ~0UL : ((1UL << (nr_irqs & 63)) - 1)) & ~1UL)
+
+/* Mask out unused timer irq 0 and RTC irq 8. */
+#define P2K_PROBE_MASK         (_PROBE_MASK(16) & ~0x101UL)
+
+/* Mask out unused timer irq 0, "irqs" 20-30, and the EISA cascade. */
+#define ALCOR_PROBE_MASK       (_PROBE_MASK(48) & ~0xfff000000001UL)
+
+/* Leave timer IRQ 0 in the mask.  */
+#define RUFFIAN_PROBE_MASK     (_PROBE_MASK(48) | 1UL)
+
+/* Do not probe/enable beyond the PCI devices. */
+#define TSUNAMI_PROBE_MASK     _PROBE_MASK(48)
+
+#if defined(CONFIG_ALPHA_GENERIC)
+# define PROBE_MASK    alpha_mv.irq_probe_mask
+#elif defined(CONFIG_ALPHA_P2K)
+# define PROBE_MASK    P2K_PROBE_MASK
+#elif defined(CONFIG_ALPHA_ALCOR) || defined(CONFIG_ALPHA_XLT)
+# define PROBE_MASK    ALCOR_PROBE_MASK
+#elif defined(CONFIG_ALPHA_RUFFIAN)
+# define PROBE_MASK    RUFFIAN_PROBE_MASK
+#elif defined(CONFIG_ALPHA_DP264)
+# define PROBE_MASK    TSUNAMI_PROBE_MASK
+#else
+# define PROBE_MASK    _PROBE_MASK(NR_IRQS)
+#endif
+
+
+extern char _stext;
+static inline void alpha_do_profile (unsigned long pc)
+{
+       if (prof_buffer && current->pid) {
+               pc -= (unsigned long) &_stext;
+               pc >>= prof_shift;
+               /*
+                * Don't ignore out-of-bounds PC values silently,
+                * put them into the last histogram slot, so if
+                * present, they will show up as a sharp peak.
+                */
+               if (pc > prof_len - 1)
+                       pc = prof_len - 1;
+               atomic_inc((atomic_t *)&prof_buffer[pc]);
+       }
+}
+
+#endif
index 2d1a803513386cb79de80bdfdda40d58ae49296e..f9b4d9f12a76903e74b6d3cc0e9a9448ab200d93 100644 (file)
@@ -67,9 +67,6 @@ extern void disable_irq(unsigned int);
 extern void disable_irq_nosync(unsigned int);
 extern void enable_irq(unsigned int);
 
-extern void irq_enter(int cpu, int irq);
-extern void irq_exit(int cpu, int irq);
-
 struct pt_regs;
 extern void (*perf_irq)(unsigned long, struct pt_regs *);
 
index 379568491cbcdb21e7c061e1f18552d8522e2fb5..7260b50e4dc7466665558c43ae6d69b7678fea96 100644 (file)
 #define        L1_CACHE_BYTES  16
 #endif
 
-#define        L1_CACHE_ALIGN(x)       (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
-
-#define        SMP_CACHE_BYTES L1_CACHE_BYTES
-
-#ifdef MODULE
-#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES)))
-#else
-#define __cacheline_aligned                                    \
-  __attribute__((__aligned__(L1_CACHE_BYTES),                  \
-                __section__(".data.cacheline_aligned")))
-#endif
-
 #endif
index f96faa80649cb87426ceb83d1e0383ac0681d9cb..4679cb3ef63c62697d1b1443b4f9fc45bed0c813 100644 (file)
@@ -17,8 +17,8 @@ extern unsigned int local_irq_count[NR_CPUS];
 #define hardirq_trylock(cpu)   (local_irq_count[cpu] == 0)
 #define hardirq_endlock(cpu)   do { } while (0)
 
-#define hardirq_enter(cpu)     (local_irq_count[cpu]++)
-#define hardirq_exit(cpu)      (local_irq_count[cpu]--)
+#define irq_enter(cpu, irq)    (local_irq_count[cpu]++)
+#define irq_exit(cpu, irq)     (local_irq_count[cpu]--)
 
 #define synchronize_irq()      barrier()
 
@@ -39,13 +39,17 @@ static inline void release_irqlock(int cpu)
        }
 }
 
-static inline void hardirq_enter(int cpu)
+static inline void irq_enter(int cpu, int irq)
 {
        ++local_irq_count[cpu];
        atomic_inc(&global_irq_count);
+
+       while (test_bit(0,&global_irq_lock)) {
+               /* nothing */;
+       }
 }
 
-static inline void hardirq_exit(int cpu)
+static inline void irq_exit(int cpu, int irq)
 {
        atomic_dec(&global_irq_count);
        --local_irq_count[cpu];
index dad58bb937ea736c0d9f06204b0c6633f831f046..5ee848ef33386bd945db1b0492c6754150fdf8f9 100644 (file)
@@ -40,7 +40,8 @@
  * the 4 pgd entries internally, so there is no extra memory
  * load on TLB miss, despite one more level of indirection.
  */
-#define pgd_none(x)    (pgd_val(x) == 1ULL)
+#define EMPTY_PGD (__pa(empty_zero_page) + 1)
+#define pgd_none(x)    (pgd_val(x) == EMPTY_PGD)
 extern inline int pgd_bad(pgd_t pgd)           { return 0; }
 extern inline int pgd_present(pgd_t pgd)       { return !pgd_none(pgd); }
 
@@ -59,7 +60,7 @@ extern inline int pgd_present(pgd_t pgd)      { return !pgd_none(pgd); }
  */
 extern inline void __pgd_clear (pgd_t * pgd)
 {
-       set_pgd(pgd, __pgd(1ULL));
+       set_pgd(pgd, __pgd(EMPTY_PGD));
 }
 
 extern inline void pgd_clear (pgd_t * pgd)
index c0177923cc1f8cdcc4182cd1043225d8b4359915..336c27c67b8c957766e4b835c46dd4a95a396dc1 100644 (file)
@@ -37,6 +37,13 @@ do { unsigned long tmpreg; __asm__ __volatile__("movl %%cr3,%0\n\tmovl %0,%%cr3"
 __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr))
 #endif
 
+/*
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern unsigned long empty_zero_page[1024];
+#define ZERO_PAGE(vaddr) (mem_map + MAP_NR(empty_zero_page))
+
 #endif /* !__ASSEMBLY__ */
 
 /*
@@ -144,13 +151,6 @@ __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr))
 /* page table for 0-4MB for everybody */
 extern unsigned long pg0[1024];
 
-/*
- * ZERO_PAGE is a global shared page that is always zero: used
- * for zero-mapped memory areas etc..
- */
-extern unsigned long empty_zero_page[1024];
-#define ZERO_PAGE(vaddr) (mem_map + MAP_NR(empty_zero_page))
-
 /*
  * Handling allocation failures during page table setup.
  */
index 33f94edc7fa404609c7fd4d83be715368ae3bccc..e980ec02b208ec1820cc3976a2d14a6709e330e9 100644 (file)
@@ -145,7 +145,7 @@ extern inline void __set_64bit (unsigned long long * ptr,
 __asm__ __volatile__ (
        "1:     movl (%0), %%eax;
                movl 4(%0), %%edx;
-               lock; cmpxchg8b (%0);
+               cmpxchg8b (%0);
                jnz 1b"
        ::              "D"(ptr),
                        "b"(low),
index 4e373d7d041f21eb560695a734f9bb3d37476731..7b51fcb54026f398359e76274a675970d6a4a07c 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <asm/pgtable.h>
 #include <asm/dma.h>
-#include <asm/cache.h>
+#include <linux/cache.h>
 #include <linux/init.h>
 
 /*
diff --git a/include/linux/cache.h b/include/linux/cache.h
new file mode 100644 (file)
index 0000000..2030eb7
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef __LINUX_CACHE_H
+#define __LINUX_CACHE_H
+
+#include <asm/cache.h>
+
+#ifndef L1_CACHE_ALIGN
+#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+#endif
+
+#ifndef SMP_CACHE_BYTES
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#endif
+
+#ifndef ____cacheline_aligned
+#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
+#endif
+
+#ifndef __cacheline_aligned
+#ifdef MODULE
+#define __cacheline_aligned ____cacheline_aligned
+#else
+#define __cacheline_aligned                                    \
+  __attribute__((__aligned__(SMP_CACHE_BYTES),                 \
+                __section__(".data.cacheline_aligned")))
+#endif
+#endif /* __cacheline_aligned */
+
+#endif /* __LINUX_CACHE_H */
index 834c4aa29b2949bc6cea4f2b3713858387fa7fd4..9112e5f963ba0fc2d50b78a5c13eaecf2a949721 100644 (file)
 #include <linux/list.h>
 #include <linux/dcache.h>
 #include <linux/stat.h>
+#include <linux/cache.h>
 
 #include <asm/atomic.h>
 #include <asm/bitops.h>
-#include <asm/cache.h>
 
 struct poll_table_struct;
 
@@ -674,11 +674,11 @@ struct super_operations {
 struct dquot_operations {
        void (*initialize) (struct inode *, short);
        void (*drop) (struct inode *);
-       int (*alloc_block) (const struct inode *, unsigned long, uid_t, char);
-       int (*alloc_inode) (const struct inode *, unsigned long, uid_t);
+       int (*alloc_block) (const struct inode *, unsigned long, char);
+       int (*alloc_inode) (const struct inode *, unsigned long);
        void (*free_block) (const struct inode *, unsigned long);
        void (*free_inode) (const struct inode *, unsigned long);
-       int (*transfer) (struct dentry *, struct iattr *, uid_t);
+       int (*transfer) (struct dentry *, struct iattr *);
 };
 
 struct file_system_type {
index 4063fe74373d783cc92a7873f64f8cd45acb9eff..f8a16d730cfb706114cb2e95c72c79d546416ea6 100644 (file)
@@ -42,7 +42,7 @@ typedef struct {
                                           independent code */
        struct irqaction *action;               /* IRQ action list */
        unsigned int depth;                     /* Disable depth for nested irq disables */
-} irq_desc_t;
+} ____cacheline_aligned irq_desc_t;
 
 #include <asm/hw_irq.h> /* the arch dependent stuff */
 
@@ -52,27 +52,6 @@ extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
 extern spinlock_t irq_controller_lock;
 extern int setup_irq(unsigned int , struct irqaction * );
 
-#ifdef __SMP__
-
-#include <asm/atomic.h>
-
-static inline void irq_enter(int cpu, unsigned int irq)
-{
-       hardirq_enter(cpu);
-       while (test_bit(0,&global_irq_lock)) {
-               /* nothing */;
-       }
-}
-
-static inline void irq_exit(int cpu, unsigned int irq)
-{
-       hardirq_exit(cpu);
-}
-#else
-#define irq_enter(cpu, irq)    (++local_irq_count[cpu])
-#define irq_exit(cpu, irq)     (--local_irq_count[cpu])
-#endif
-
 extern hw_irq_controller no_irq_type;  /* needed in every arch ? */
 
 #endif /* __asm_h */
index de0f21dc1049bb6e2b0b599c26f5e9c9bc9f9179..ad23800191c6738647d2ebeed4b22ba1ad8dcee8 100644 (file)
@@ -44,8 +44,8 @@
 /*
  * Convert diskblocks to blocks and the other way around.
  */
-#define dbtob(num) (num << 10)
-#define btodb(num) (num >> 10)
+#define dbtob(num) (num << BLOCK_SIZE_BITS)
+#define btodb(num) (num >> BLOCK_SIZE_BITS)
 
 /*
  * Convert count of filesystem blocks to diskquota blocks, meant
index bb76e715bdd1cee4f4592d9771f0844daa63d873..17371e58c16b000639a644c47c3ceb5b5e3a53d8 100644 (file)
@@ -23,16 +23,13 @@ extern void invalidate_dquots(kdev_t dev, short type);
 extern int  quota_off(kdev_t dev, short type);
 extern int  sync_dquots(kdev_t dev, short type);
 
-extern int  dquot_alloc_block(const struct inode *inode, unsigned long number,
-                              uid_t initiator, char warn);
-extern int  dquot_alloc_inode(const struct inode *inode, unsigned long number,
-                              uid_t initiator);
+extern int  dquot_alloc_block(const struct inode *inode, unsigned long number, char prealloc);
+extern int  dquot_alloc_inode(const struct inode *inode, unsigned long number);
 
 extern void dquot_free_block(const struct inode *inode, unsigned long number);
 extern void dquot_free_inode(const struct inode *inode, unsigned long number);
 
-extern int  dquot_transfer(struct dentry *dentry, struct iattr *iattr,
-                           uid_t initiator);
+extern int  dquot_transfer(struct dentry *dentry, struct iattr *iattr);
 
 /*
  * Operations supported for diskquotas.
@@ -54,8 +51,7 @@ extern __inline__ void DQUOT_DROP(struct inode *inode)
 extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct inode *inode, int nr)
 {
        if (sb->dq_op) {
-               if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize),
-                                          current->fsuid, 0) == NO_QUOTA)
+               if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), 1) == NO_QUOTA)
                        return 1;
        }
        return 0;
@@ -64,8 +60,7 @@ extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct
 extern __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct inode *inode, int nr)
 {
        if (sb->dq_op) {
-               if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize),
-                                          current->fsuid, 1) == NO_QUOTA)
+               if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), 0) == NO_QUOTA)
                        return 1;
        }
        return 0;
@@ -75,7 +70,7 @@ extern __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode *in
 {
        if (sb->dq_op) {
                sb->dq_op->initialize (inode, -1);
-               if (sb->dq_op->alloc_inode (inode, 1, current->fsuid))
+               if (sb->dq_op->alloc_inode (inode, 1))
                        return 1;
        }
        inode->i_flags |= S_QUOTA;
@@ -100,7 +95,7 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr)
 
        if (dentry->d_inode->i_sb->dq_op) {
                dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1);
-               error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr, current->fsuid);
+               error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr);
        } else {
                error = notify_change(dentry, iattr);
        }
index 72ae514ee6a499abb634f5884df46eb95df939d4..36590d49cbdc8582f99e1e28d1f118c8a4098ed0 100644 (file)
@@ -513,6 +513,7 @@ extern void FASTCALL(wake_up_process(struct task_struct * tsk));
 #define wake_up_interruptible_sync(x)  __wake_up_sync((x),TASK_INTERRUPTIBLE)
 
 extern int in_group_p(gid_t);
+extern int in_egroup_p(gid_t);
 
 extern void flush_signals(struct task_struct *);
 extern void flush_signal_handlers(struct task_struct *);
index fa344d816a1738f4b154ab16dc4a8cd5024a618a..97f6923da66691cb973d88afa0a9c260426cc003 100644 (file)
@@ -12,7 +12,7 @@
 typedef struct kmem_cache_s kmem_cache_t;
 
 #include       <linux/mm.h>
-#include       <asm/cache.h>
+#include       <linux/cache.h>
 
 /* flags for kmem_cache_alloc() */
 #define        SLAB_BUFFER             GFP_BUFFER
index 23be264898112a14849ab78095152f562513e522..fa69edbac25d4ecc44d185cfa60e1f6edab0a100 100644 (file)
@@ -355,7 +355,7 @@ extern asmlinkage long sys_sysctl(struct __sysctl_args *args)
 }
 
 /* Like in_group_p, but testing against egid, not fsgid */
-static int in_egroup_p(gid_t grp)
+int in_egroup_p(gid_t grp)
 {
        if (grp != current->egid) {
                int i = current->ngroups;
index 2a3380504c0bb1033885413d506b2d5c2044d4e6..32e76e13e46fc6b1cab12d816e0d317ebb675458 100644 (file)
@@ -303,7 +303,6 @@ int shrink_mmap(int priority, int gfp_mask)
 
                /* is it a page-cache page? */
                if (page->mapping) {
-                       dispose = &old;
                        if (!pgcache_under_min())
                        {
                                remove_page_from_inode_queue(page);
index d435af64de5ce8b5e41885775e1cd98f686530ba..7a1afc1dfef108a965542c0d91b25b0b8b81899d 100644 (file)
@@ -55,16 +55,23 @@ This send_actor is for use with do_generic_file_read (ie sendfile())
 It sends the data to the socket indicated by desc->buf.
 
 */
-static int sock_send_actor(read_descriptor_t * desc, const char *area, unsigned long size)
+static int sock_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size)
 {
        int written;
+       unsigned long kaddr;
        unsigned long count = desc->count;
        struct socket *sock = (struct socket *) desc->buf;
+       mm_segment_t old_fs;
 
        if (size > count)
                size = count;
-       written = SendBuffer_async(sock,(char *)area,size);
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
 
+       kaddr = kmap(page);
+       written = SendBuffer_async(sock,(char *)kaddr + offset,size);
+       kunmap(page);
+       set_fs(old_fs);
        if (written < 0) {
                desc->error = written;
                written = 0;
index 5746bc4f753656921aaaeb65848ae64305c4258c..418037907b7aa4198db4650dfb0b504d319374fc 100644 (file)
@@ -50,6 +50,10 @@ Userspace
  *
  ****************************************************************/
 
+
+static int errno;
+#define __KERNEL_SYSCALLS__
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -176,9 +180,6 @@ static int MainDaemon(void *cpu_pointer)
 
 static int CountBuf[CONFIG_KHTTPD_NUMCPU];
 
-static int errno;
-inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options);
-
 
 
 /*
index f7e3ef11851efb0e2392dcec24ce9ab000f5f407..824d440144005dfd70bbefeefa43ca9829ec7cb2 100644 (file)
@@ -54,7 +54,7 @@
 # Change a lot of places to call set_x_info uniformly.
 # Take out message about preparing version (old sound driver cruft).
 #
-# 13 Dec 1998, Riley H Williams (rhw@bigfoot.com)
+# 13 Dec 1998, Riley H Williams <rhw@memalpha.cx>
 # When an error occurs, actually display the error message as well as
 # our comments thereon.
 #