]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.27pre2 2.3.27pre2
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:28:25 +0000 (15:28 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:28:25 +0000 (15:28 -0500)
47 files changed:
Documentation/Configure.help
Documentation/acpi.txt [new file with mode: 0644]
Makefile
arch/alpha/kernel/alpha_ksyms.c
arch/alpha/kernel/process.c
arch/arm/kernel/armksyms.c
arch/arm/kernel/process.c
arch/m68k/kernel/m68k_ksyms.c
arch/m68k/kernel/process.c
arch/mips/kernel/mips_ksyms.c
arch/mips/kernel/process.c
arch/ppc/config.in
arch/ppc/defconfig
arch/ppc/kernel/head.S
arch/ppc/kernel/ppc_ksyms.c
arch/ppc/kernel/process.c
arch/ppc/kernel/traps.c
arch/sparc/kernel/process.c
arch/sparc/kernel/sparc_ksyms.c
arch/sparc64/kernel/process.c
arch/sparc64/kernel/sparc64_ksyms.c
drivers/char/keyboard.c
drivers/char/serial.c
drivers/misc/Config.in
drivers/misc/Makefile
drivers/misc/acpi.c
drivers/pci/pci.ids
drivers/usb/uhci.c
drivers/usb/usb.c
fs/ncpfs/dir.c
fs/proc/array.c
fs/proc/base.c
fs/proc/kcore.c
fs/proc/root.c
include/asm-alpha/div64.h [new file with mode: 0644]
include/asm-alpha/processor.h
include/asm-arm/processor.h
include/asm-i386/div64.h [new file with mode: 0644]
include/asm-m68k/processor.h
include/asm-mips/processor.h
include/asm-ppc/processor.h
include/asm-sparc/processor.h
include/asm-sparc64/processor.h
include/linux/acpi.h
include/linux/proc_fs.h
lib/vsprintf.c
mm/vmalloc.c

index 02983530ef3430a2d9904bd49b9a8d1037dc5ae6..e2cda118fafed4b32ad32e92f0bfb658f0e1d084 100644 (file)
@@ -7919,7 +7919,7 @@ CONFIG_USB_PROC
   Note that you must say Y to "/proc filesystem support" below for
   this to work.
 
-Generic ACPI support
+ACPI support
 CONFIG_ACPI
   Advanced Configuration and Power Interface (ACPI) is an interface
   specification to support power management of peripherals. If your
@@ -7929,13 +7929,6 @@ CONFIG_ACPI
   inserted in and removed from the running kernel whenever you want).
   The module will be called acpi.o. If you want to compile it as a
   module, say M here and read Documentation/modules.txt.
-  
-PIIX4 ACPI support
-CONFIG_PIIX4_ACPI
-  If you have a PIIX4 based motherboard (PCI ISA IDE Xcelerator
-  (PIIX4) is a multi-function PCI device) and you want support for
-  Advanced Configuration and Power Interface (ACPI) to support power
-  management of peripherals, say Y here.
 
 Minix fs support
 CONFIG_MINIX_FS
diff --git a/Documentation/acpi.txt b/Documentation/acpi.txt
new file mode 100644 (file)
index 0000000..6f86ab5
--- /dev/null
@@ -0,0 +1,125 @@
+ACPI Driver Interface
+---------------------
+
+Overview:
+1) Register each instance of a device with "acpi_register"
+2) Call "acpi_access" before accessing the hardware.
+   (this will ensure that the hardware is awake and ready)
+3) "acpi_transition" callback is called before entering D1-D3
+   or after entering D0
+4) Call "acpi_dev_idle" when the device is not being used
+   (not required by will improve idle detection)
+5) When unloaded, unregister the device with "acpi_unregister"
+
+/*
+ * Description: Register a device with the ACPI subsystem
+ *
+ * Parameters:
+ *   type - device type
+ *   adr - bus number and address or unique id
+ *   hid - PnP identifier (or 0 if unknown)
+ *   trans - device state transition callback
+ *
+ * Returns: Registered ACPI device or NULL on error
+ *
+ * Details: The device type, bus number, and bus address should be
+ *          enough information to reconstruct the device tree and
+ *          identify device dependencies
+ *
+ * Examples:
+ *   dev = acpi_register(ACPI_SYS_DEV, 0, ACPI_VGA_HID, vga_trans);
+ *
+ *   struct pci_dev *pci_dev = pci_find_dev(...);
+ *   dev = acpi_register(ACPI_PCI_DEV, ACPI_PCI_ADR(pci_dev), 0, trans);
+ */
+struct acpi_dev *acpi_register(acpi_dev_t type,
+                               unsigned long adr,
+                               acpi_hid_t hid,
+                               acpi_transition trans);
+
+/*
+ * Description: Unregister a device with ACPI
+ *
+ * Parameters:
+ *   dev - ACPI device previously returned from acpi_register
+ */
+void acpi_unregister(struct acpi_dev *dev);
+
+/*
+ * Device idle/use detection
+ *
+ * In general, drivers for all devices should call "acpi_access"
+ * before accessing the hardware (ie. before reading or modifying
+ * a hardware register).  Request or packet-driven drivers should
+ * additionally call "acpi_idle" when a device is not being used.
+ *
+ * Examples:
+ * 1) A keyboard driver would call acpi_access whenever a key is pressed
+ * 2) A network driver would call acpi_access before submitting
+ *    a packet for transmit or receive and acpi_idle when its
+ *    transfer and receive queues are empty.
+ * 3) A VGA driver would call acpi_access before it accesses any
+ *    of the video controller registers
+ *
+ * Ultimately, the ACPI policy manager uses the access and idle
+ * information to decide when to transition devices between
+ * device states.
+ */
+
+/*
+ * Description: Update device access time and wake up device, if necessary
+ *
+ * Parameters:
+ *   dev - ACPI device previously returned from acpi_register
+ *
+ * Details: If called from an interrupt handler acpi_access updates
+ *          access time but should never need to wake up the device
+ *          (if device is generating interrupts, it should be awake
+ *          already)  This is important as we can not wake up
+ *          devices (run AML, etc.) from an interrupt handler.
+ */
+void acpi_access(struct acpi_dev *dev);
+
+/*
+ * Description: Identify device as currently being idle
+ *
+ * Parameters:
+ *   dev - ACPI device previously returned from acpi_register
+ *
+ * Details: A call to acpi_idle might signal to the policy manager
+ *          to put a device to sleep.  If a new device request arrives
+ *          between the call to acpi_idle and the acpi_transition
+ *          callback, the driver should fail the acpi_transition request.
+ */
+void acpi_dev_idle(struct acpi_dev *dev);
+
+/*
+ * Transition function
+ *
+ * Parameters:
+ *   dev - ACPI device previously returned from acpi_register
+ *   state - the device state being entered
+ *
+ * Returns: 0 if the state transition is possible and context saved
+ *          EINVAL if the requested device state is not supported
+ *          EBUSY if the device is now busy and can not transition
+ *          ENOMEM if the device was unable to save context (out of memory)
+ *          
+ * Details: The device state transition function will be called
+ *          before the device is transitioned into the D1-D3 states
+ *          or after the device is transitioned into the D0 state.
+ *          The device driver should save (D1-D3) or restore (D0)
+ *          device context when the transition function is called.
+ *
+ *          For system devices, the ACPI subsystem will perform
+ *          the actual hardware state transition itself.  For bus
+ *          devices, after the driver's acpi_transition function
+ *          is called, the bus driver's acpi_transition function
+ *          is called to perform the actual hardware state transition.
+ *
+ *          Once a driver returns 0 (success) from a transition
+ *          to D1-3 request, it should not process any further
+ *          requests or access the device hardware until a
+ *          call to "acpi_access" is made.
+ */
+typedef int (*acpi_transition)(struct acpi_dev *dev, acpi_dstate_t state);
index 45a55b331ae7fa50cd7fd31b9b5ea155e3938939..19ebbe7e4c2ee484bb4b7dedc1fbc67d9da8abc8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 3
-SUBLEVEL = 26
+SUBLEVEL = 27
 EXTRAVERSION =
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
index f280e454165cc8203139255cec53b57cff91cf3e..ffd93ca9d3545d541662c9a73b1de0211f899d5a 100644 (file)
@@ -206,3 +206,5 @@ EXPORT_SYMBOL_NOVERS(__remq);
 EXPORT_SYMBOL_NOVERS(__remqu);
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(memset);
+
+EXPORT_SYMBOL(get_wchan);
index 354597ba28485c09fa221dbbfa3b0b21ca164a87..0390e31389e1e52ad23be704ce6cd663ff549adc 100644 (file)
@@ -406,3 +406,35 @@ out:
        unlock_kernel();
        return error;
 }
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long schedule_frame;
+       unsigned long pc;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+       /*
+        * This one depends on the frame size of schedule().  Do a
+        * "disass schedule" in gdb to find the frame size.  Also, the
+        * code assumes that sleep_on() follows immediately after
+        * interruptible_sleep_on() and that add_timer() follows
+        * immediately after interruptible_sleep().  Ugly, isn't it?
+        * Maybe adding a wchan field to task_struct would be better,
+        * after all...
+        */
+
+       pc = thread_saved_pc(&p->thread);
+       if (pc >= first_sched && pc < last_sched) {
+               schedule_frame = ((unsigned long *)p->thread.ksp)[6];
+               return ((unsigned long *)schedule_frame)[12];
+       }
+       return pc;
+}
index 8d9bac1a74c34c3a028d48fac203c21703dcdfb1..43cc0574f279984a0c2b03524902cd0e93c7dc1e 100644 (file)
@@ -237,3 +237,5 @@ EXPORT_SYMBOL_NOVERS(__down_failed);
 EXPORT_SYMBOL_NOVERS(__down_interruptible_failed);
 EXPORT_SYMBOL_NOVERS(__down_trylock_failed);
 EXPORT_SYMBOL_NOVERS(__up_wakeup);
+
+EXPORT_SYMBOL(get_wchan);
index ab92aae521f7f63cbd7eed5682cad336664ba3a8..3c82ee68c7188c423d6a11b85dadd14e9b267ba9 100644 (file)
@@ -337,3 +337,31 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
        return __ret;
 }
 
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long fp, lr;
+       unsigned long stack_page;
+       int count = 0;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+
+       stack_page = 4096 + (unsigned long)p;
+       fp = get_css_fp(&p->thread);
+       do {
+               if (fp < stack_page || fp > 4092+stack_page)
+                       return 0;
+               lr = pc_pointer (((unsigned long *)fp)[-1]);
+               if (lr < first_sched || lr > last_sched)
+                       return lr;
+               fp = *(unsigned long *) (fp - 12);
+       } while (count ++ < 16);
+       return 0;
+}
index 64af7cf7cfd5e8e09bd0da5575f7a8af956742d4..d9750560f4eab2f83e14e70c1f541c3964b6c0cc 100644 (file)
@@ -75,3 +75,5 @@ EXPORT_SYMBOL_NOVERS(__down_failed);
 EXPORT_SYMBOL_NOVERS(__down_failed_interruptible);
 EXPORT_SYMBOL_NOVERS(__down_failed_trylock);
 EXPORT_SYMBOL_NOVERS(__up_wakeup);
+
+EXPORT_SYMBOL(get_wchan);
index 724f4cb5e37308ba033aedb382aff409335b782a..030b3e136878be56b2cfd985fb771bdc437bb8fe 100644 (file)
@@ -346,3 +346,34 @@ out:
        unlock_kernel();
        return error;
 }
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long fp, pc;
+       unsigned long stack_page;
+       int count = 0;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+
+       stack_page = (unsigned long)p;
+       fp = ((struct switch_stack *)p->thread.ksp)->a6;
+       do {
+               if (fp < stack_page+sizeof(struct task_struct) ||
+                   fp >= 8184+stack_page)
+                       return 0;
+               pc = ((unsigned long *)fp)[1];
+               /* FIXME: This depends on the order of these functions. */
+               if (pc < first_sched || pc >= last_sched)
+                       return pc;
+               fp = *(unsigned long *) fp;
+       } while (count++ < 16);
+       return 0;
+}
index 2b57429f674bf8678ac1ed482016d4ce09abe0fb..af47fe0d82a466a5435b500ab1ebe9282c4a9c40 100644 (file)
@@ -122,3 +122,4 @@ EXPORT_SYMBOL(unregister_fpe);
 EXPORT_SYMBOL(screen_info);
 #endif
 
+EXPORT_SYMBOL(get_wchan);
index 0504bd089d5586d098f073764ab184668d684815..b8ec40679f7d35fa34a463b46f445402060fccb6 100644 (file)
@@ -182,3 +182,28 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 
        return retval;
 }
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long schedule_frame;
+       unsigned long pc;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+       /*
+        * The same comment as on the Alpha applies here, too ...
+        */
+       pc = thread_saved_pc(&p->tss);
+       if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) {
+               schedule_frame = ((unsigned long *)(long)p->tss.reg30)[16];
+               return (unsigned long)((unsigned long *)schedule_frame)[11];
+       }
+       return pc;
+}
index c21f6feca701e879f160ee023686392c0c3ac401..340776754c885f3139e6bab1c46b882dfe457cf1 100644 (file)
@@ -44,7 +44,7 @@ else
 fi
 
 bool 'Symmetric multi-processing support' CONFIG_SMP
-if [ "$CONFIG_6xx" != "y" ];then
+if [ "$CONFIG_6xx" = "y" ];then
   bool 'AltiVec Support' CONFIG_ALTIVEC
 fi
 
@@ -90,7 +90,7 @@ bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
 
 # only elf supported, a.out is not -- Cort
 if [ "$CONFIG_PROC_FS" = "y" ]; then
-   define_bool CONFIG_KCORE_ELF y
+   define_bool CONFIG_KCORE_ELF
 fi
 define_bool CONFIG_BINFMT_ELF y
 define_bool CONFIG_KERNEL_ELF y
index 04967cd9da76d3a6137e0977795de5ffc9a25c45..8b232d723cc76d60b82776d60c251b38b4443dd1 100644 (file)
@@ -2,6 +2,11 @@
 # Automatically generated make config: don't edit
 #
 
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
 #
 # Platform support
 #
@@ -10,55 +15,55 @@ CONFIG_6xx=y
 # CONFIG_PPC64 is not set
 # CONFIG_82xx is not set
 # CONFIG_8xx is not set
-# CONFIG_MPC821 is not set
-# CONFIG_MPC823 is not set
-# CONFIG_MPC850 is not set
-# CONFIG_MPC855 is not set
-# CONFIG_MPC860 is not set
-# CONFIG_MPC860T is not set
-# CONFIG_RPXLITE is not set
-# CONFIG_RPXCLASSIC is not set
-# CONFIG_BSEIP is not set
-# CONFIG_MBX is not set
-# CONFIG_WINCEPT is not set
 # CONFIG_PMAC is not set
 # CONFIG_PREP is not set
 # CONFIG_CHRP is not set
-# CONFIG_ALL_PPC is not set
-CONFIG_GEMINI=y
+CONFIG_ALL_PPC=y
+# CONFIG_GEMINI is not set
 # CONFIG_APUS is not set
 # CONFIG_SMP is not set
-CONFIG_MACH_SPECIFIC=y
 CONFIG_6xx=y
 
 #
-# General setup
+# Loadable module support
 #
-CONFIG_EXPERIMENTAL=y
 CONFIG_MODULES=y
 CONFIG_MODVERSIONS=y
 CONFIG_KMOD=y
+
+#
+# General setup
+#
 CONFIG_PCI=y
 CONFIG_NET=y
 CONFIG_SYSCTL=y
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_KCORE_AOUT is not set
-CONFIG_KCORE_ELF=y
 CONFIG_BINFMT_ELF=y
 CONFIG_KERNEL_ELF=y
 # CONFIG_BINFMT_MISC is not set
+
+#
+# PCMCIA/CardBus support
+#
+# CONFIG_PCMCIA is not set
 # CONFIG_PARPORT is not set
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_FB is not set
-# CONFIG_PMAC_PBOOK is not set
-# CONFIG_MAC_FLOPPY is not set
-# CONFIG_MAC_SERIAL is not set
-# CONFIG_ADB is not set
-# CONFIG_PROC_DEVICETREE is not set
+CONFIG_VGA_CONSOLE=y
+CONFIG_FB=y
+CONFIG_FB_COMPAT_XPMAC=y
+CONFIG_PMAC_PBOOK=y
+CONFIG_MAC_FLOPPY=y
+CONFIG_MAC_SERIAL=y
+CONFIG_ADB=y
+CONFIG_ADB_CUDA=y
+CONFIG_ADB_MACIO=y
+CONFIG_ADB_PMU=y
+CONFIG_ADB_KEYBOARD=y
+CONFIG_PROC_DEVICETREE=y
 # CONFIG_TOTALMP is not set
-# CONFIG_BOOTX_TEXT is not set
+CONFIG_BOOTX_TEXT=y
 # CONFIG_MOTOROLA_HOTSWAP is not set
+# CONFIG_CMDLINE_BOOL is not set
 
 #
 # Plug and Play configuration
@@ -68,26 +73,48 @@ CONFIG_KERNEL_ELF=y
 #
 # Block devices
 #
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_IDE is not set
+CONFIG_BLK_DEV_FD=y
+CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
-# CONFIG_BLK_DEV_HD_ONLY is not set
+# CONFIG_BLK_DEV_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
+# CONFIG_BLK_DEV_IDEPCI is not set
+CONFIG_BLK_DEV_SL82C105=y
+CONFIG_BLK_DEV_IDE_PMAC=y
+CONFIG_BLK_DEV_IDEDMA_PMAC=y
+CONFIG_IDEDMA_PMAC_AUTO=y
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_IDE_CHIPSETS is not set
 # CONFIG_BLK_CPQ_DA is not set
 
 #
 # Additional Block Devices
 #
-# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_MD is not set
-# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_INITRD=y
 # CONFIG_BLK_DEV_XD is not set
+# CONFIG_BLK_DEV_DAC960 is not set
 CONFIG_PARIDE_PARPORT=y
 # CONFIG_PARIDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
+CONFIG_BLK_DEV_IDE_MODES=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -124,7 +151,7 @@ CONFIG_SKB_LARGE=y
 #  
 #
 # CONFIG_IPX is not set
-# CONFIG_ATALK is not set
+CONFIG_ATALK=m
 # CONFIG_DECNET is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
@@ -149,7 +176,7 @@ CONFIG_SCSI=y
 # SCSI support type (disk, tape, CD-ROM)
 #
 CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
+CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_BLK_DEV_SR_VENDOR=y
 # CONFIG_CHR_DEV_SG is not set
@@ -169,7 +196,11 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_AHA152X is not set
 # CONFIG_SCSI_AHA1542 is not set
 # CONFIG_SCSI_AHA1740 is not set
-# CONFIG_SCSI_AIC7XXX is not set
+CONFIG_SCSI_AIC7XXX=y
+# CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT is not set
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_PROC_STATS=y
+CONFIG_AIC7XXX_RESET_DELAY=15
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
@@ -183,12 +214,11 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_G_NCR5380_PORT is not set
-# CONFIG_SCSI_G_NCR5380_MEM is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
 # CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_SIM710 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_NCR53C8XX is not set
 CONFIG_SCSI_SYM53C8XX=y
@@ -212,8 +242,9 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20
 # CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_ULTRASTOR is not set
 # CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_MESH is not set
-# CONFIG_SCSI_MAC53C94 is not set
+CONFIG_SCSI_MESH=y
+CONFIG_SCSI_MESH_SYNC_RATE=5
+CONFIG_SCSI_MAC53C94=y
 
 #
 # Network device support
@@ -233,28 +264,63 @@ CONFIG_NETDEVICES=y
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_MACE is not set
-# CONFIG_BMAC is not set
-CONFIG_NCR885E=y
+CONFIG_MACE=y
+CONFIG_BMAC=y
+# CONFIG_NCR885E is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_YELLOWFIN is not set
 # CONFIG_RTL8139 is not set
 # CONFIG_SIS900 is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_ACENIC is not set
+# CONFIG_DM9102 is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
 # CONFIG_NET_ISA is not set
-# CONFIG_NET_EISA is not set
+CONFIG_NET_EISA=y
+CONFIG_PCNET32=y
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_ACENIC is not set
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+CONFIG_DE4X5=y
+# CONFIG_DEC_ELCP is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEXPRESS_PRO100 is not set
+# CONFIG_LNE390 is not set
+# CONFIG_NE3210 is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_ES3210 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_ZNET is not set
 # CONFIG_NET_POCKET is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_LTPC is not set
+# CONFIG_COPS is not set
+# CONFIG_IPDDP is not set
+CONFIG_PPP=y
+# CONFIG_PPP_ASYNC is not set
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
 # CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
 # CONFIG_NET_RADIO is not set
 
 #
-# Token ring devices
+# Token Ring driver support
 #
 # CONFIG_TR is not set
 # CONFIG_NET_FC is not set
@@ -264,10 +330,7 @@ CONFIG_NCR885E=y
 #
 # Wan interfaces
 #
-# CONFIG_HOSTESS_SV11 is not set
-# CONFIG_COSA is not set
-# CONFIG_SEALEVEL_4021 is not set
-# CONFIG_DLCI is not set
+# CONFIG_WAN is not set
 
 #
 # Amateur Radio support
@@ -288,13 +351,51 @@ CONFIG_NCR885E=y
 # Console drivers
 #
 
+#
+# Frame-buffer support
+#
+CONFIG_FB=y
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FB_CLGEN is not set
+# CONFIG_FB_PM2 is not set
+CONFIG_FB_OF=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_IMSTT=y
+CONFIG_FB_CT65550=y
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+CONFIG_FB_MATROX=y
+# CONFIG_FB_MATROX_MILLENIUM is not set
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G100=y
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_ATY=y
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FBCON_ADVANCED is not set
+CONFIG_FBCON_CFB8=y
+CONFIG_FBCON_CFB16=y
+CONFIG_FBCON_CFB24=y
+CONFIG_FBCON_CFB32=y
+# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
+CONFIG_FBCON_FONTS=y
+# CONFIG_FONT_8x8 is not set
+CONFIG_FONT_8x16=y
+CONFIG_FONT_SUN8x16=y
+CONFIG_FONT_SUN12x22=y
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+
 #
 # Character devices
 #
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
-CONFIG_SERIAL=y
-CONFIG_SERIAL_CONSOLE=y
+CONFIG_SERIAL=m
 # CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 CONFIG_UNIX98_PTYS=y
@@ -307,13 +408,14 @@ CONFIG_BUSMOUSE=y
 # CONFIG_ATIXL_BUSMOUSE is not set
 # CONFIG_LOGIBUSMOUSE is not set
 # CONFIG_MS_BUSMOUSE is not set
+# CONFIG_ADBMOUSE is not set
 CONFIG_MOUSE=y
 CONFIG_PSMOUSE=y
 # CONFIG_82C710_MOUSE is not set
 # CONFIG_PC110_PAD is not set
 # CONFIG_QIC02_TAPE is not set
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
+CONFIG_NVRAM=y
 # CONFIG_RTC is not set
 
 #
@@ -333,14 +435,6 @@ CONFIG_PSMOUSE=y
 # Ftape, the floppy tape device driver
 #
 # CONFIG_FTAPE is not set
-# CONFIG_FT_NORMAL_DEBUG is not set
-# CONFIG_FT_FULL_DEBUG is not set
-# CONFIG_FT_NO_TRACE is not set
-# CONFIG_FT_NO_TRACE_AT_ALL is not set
-# CONFIG_FT_STD_FDC is not set
-# CONFIG_FT_MACH2 is not set
-# CONFIG_FT_PROBE_FC10 is not set
-# CONFIG_FT_ALT_FDC is not set
 # CONFIG_DRM is not set
 
 #
@@ -352,11 +446,14 @@ CONFIG_PSMOUSE=y
 # Filesystems
 #
 # CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS_FS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_FAT_FS is not set
+CONFIG_HFS_FS=y
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+# CONFIG_UMSDOS_FS is not set
+CONFIG_VFAT_FS=y
 # CONFIG_EFS_FS is not set
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
@@ -369,6 +466,7 @@ CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
+# CONFIG_BFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
 
@@ -376,10 +474,11 @@ CONFIG_EXT2_FS=y
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
-# CONFIG_NFS_FS is not set
-# CONFIG_NFSD is not set
-# CONFIG_SUNRPC is not set
-# CONFIG_LOCKD is not set
+CONFIG_NFS_FS=y
+CONFIG_NFSD=y
+# CONFIG_NFSD_SUN is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
 # CONFIG_SMB_FS is not set
 # CONFIG_NCP_FS is not set
 
@@ -394,16 +493,86 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
-# CONFIG_NLS is not set
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
 
 #
 # Sound
 #
-# CONFIG_SOUND is not set
+CONFIG_SOUND=y
+CONFIG_DMASOUND=y
+# CONFIG_SOUND_CMPCI is not set
+# CONFIG_SOUND_ES1370 is not set
+# CONFIG_SOUND_ES1371 is not set
+# CONFIG_SOUND_ESSSOLO1 is not set
+# CONFIG_SOUND_MAESTRO is not set
+# CONFIG_SOUND_SONICVIBES is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_OSS=y
+# CONFIG_SOUND_DMAP is not set
+# CONFIG_SOUND_AD1816 is not set
+# CONFIG_SOUND_SGALAXY is not set
+CONFIG_SOUND_CS4232=m
+# CONFIG_SOUND_SSCAPE is not set
+# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_VMIDI is not set
+# CONFIG_SOUND_TRIX is not set
+# CONFIG_SOUND_MSS is not set
+# CONFIG_SOUND_MPU401 is not set
+# CONFIG_SOUND_NM256 is not set
+# CONFIG_SOUND_MAD16 is not set
+# CONFIG_SOUND_PAS is not set
+# CONFIG_SOUND_PSS is not set
+# CONFIG_SOUND_SOFTOSS is not set
+# CONFIG_SOUND_SB is not set
+# CONFIG_SOUND_WAVEFRONT is not set
+# CONFIG_SOUND_MAUI is not set
+# CONFIG_SOUND_VIA82CXXX is not set
+# CONFIG_SOUND_YM3812 is not set
+# CONFIG_SOUND_OPL3SA1 is not set
+# CONFIG_SOUND_OPL3SA2 is not set
+# CONFIG_SOUND_UART6850 is not set
+
+#
+# Additional low level sound drivers
+#
+# CONFIG_LOWLEVEL_SOUND is not set
 
 #
 # Kernel hacking
 #
-# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_MAGIC_SYSRQ=y
 # CONFIG_KGDB is not set
-# CONFIG_XMON is not set
+CONFIG_XMON=y
index bcf656404fba28de379c67cb5773387d6757d39f..57ff53992dfc3f53df9346b5b2c630ae06fe8920 100644 (file)
@@ -817,6 +817,15 @@ giveup_altivec:
        srwi    r4,r4,16
        cmpi    0,r4,12
        bnelr
+       
+       /* enable altivec so we can save */
+       mfmsr   r4
+       oris    r4,r4,MSR_VEC@h
+       mtmsr   r4
+
+       /* make sure our tsk pointer is valid */
+       cmpi    0,r3,0
+       beqlr
 
        /* save altivec regs */
        addi    r4,r3,THREAD+THREAD_VRSAVE
@@ -830,6 +839,11 @@ giveup_altivec:
        lis     r6,MSR_VEC@h
        andi.   r5,r5,r6
        stw     r5,_MSR(r4)
+
+       /* we've given up the altivec - clear the pointer */
+       li      r3,0
+       lis     r4,last_task_used_altivec@h
+       stw     r3,last_task_used_altivec@l(r4)
 #endif /* CONFIG_ALTIVEC */
        blr
        
index 4bd37196ed43d76052639cea5dc9d30aea3862c2..7bd21c277ad439b1d25a7bbcfbc964ee61e68f32 100644 (file)
@@ -268,3 +268,4 @@ EXPORT_SYMBOL(irq_desc);
 void ppc_irq_dispatch_handler(struct pt_regs *, int);
 EXPORT_SYMBOL(ppc_irq_dispatch_handler);
 EXPORT_SYMBOL(decrementer_count);
+EXPORT_SYMBOL(get_wchan);
index 6907fc9c26ba0b6c055c4246e9b64a1b7ca8c0e4..a6592f12817e2019ebd332c6746c7e552a67834c 100644 (file)
@@ -210,6 +210,11 @@ _switch_to(struct task_struct *prev, struct task_struct *new,
        prev->last_processor = prev->processor;
        current_set[smp_processor_id()] = new;
 #endif /* __SMP__ */
+       /* Avoid the trap.  On smp this this never happens since
+        * we don't set last_task_used_altivec -- Cort
+        */
+       if ( last_task_used_altivec == new )
+               new->thread.regs->msr |= MSR_VEC;
        new_thread = &new->thread;
        old_thread = &current->thread;
        *last = _switch(old_thread, new_thread);
@@ -574,3 +579,32 @@ void __init ll_puts(const char *s)
        orig_y = y;
 }
 #endif
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long ip, sp;
+       unsigned long stack_page = (unsigned long) p;
+       int count = 0;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+       sp = p->thread.ksp;
+       do {
+               sp = *(unsigned long *)sp;
+               if (sp < stack_page || sp >= stack_page + 8188)
+                       return 0;
+               if (count > 0) {
+                       ip = *(unsigned long *)(sp + 4);
+                       if (ip < first_sched || ip >= last_sched)
+                               return ip;
+               }
+       } while (count++ < 16);
+       return 0;
+}
index 92e9ffc27d0b36cd7a8f024443b93587689df423..07e45db6b518af318b7df7729bbd6ffdda4ac3a8 100644 (file)
@@ -149,19 +149,19 @@ AltiVecUnavailable(struct pt_regs *regs)
                show_regs(regs);
                panic("Kernel Used Altivec with MSR_VEC off!\n");
        }
-#ifdef __SMP__
-       printk("User Mode altivec trap should not happen in SMP!\n");
-#else
+
        if ( last_task_used_altivec != current )
        {
                if ( last_task_used_altivec )
                        giveup_altivec(current);
                load_up_altivec(current);
+               /* on SMP we always save/restore on switch */
+#ifndef __SMP__                
                last_task_used_altivec = current;
+#endif         
        }
        /* enable altivec for the task on return */
        regs->msr |= MSR_VEC;
-#endif         
 }
 
 void
index 0f89687a3c1ec815b71881d43f9544ddaee3d219..88db458e0826d2ddd5535f5d8cff2bb621592b7d 100644 (file)
@@ -702,3 +702,37 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
                           "g1", "g2", "g3", "o0", "o1", "memory", "cc");
        return retval;
 }
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long pc, fp, bias = 0;
+       unsigned long task_base = (unsigned long) p;
+       struct reg_window *rw;
+       int count = 0;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+
+       fp = p->thread.ksp + bias;
+       do {
+               /* Bogus frame pointer? */
+               if (fp < (task_base + sizeof(struct task_struct)) ||
+                   fp >= (task_base + (2 * PAGE_SIZE)))
+                       break;
+               rw = (struct reg_window *) fp;
+               pc = rw->ins[7];
+               if (pc < first_sched || pc >= last_sched)
+                       return pc;
+               fp = rw->ins[6] + bias;
+       } while (++count < 16);
+       return 0;
+}
+#undef last_sched
+#undef first_sched
index 490e8e0af9ad6dcd2604cd2a46b32dd523588ae1..95c5e37bed7cc85012c39a2af130e051fd857ef0 100644 (file)
@@ -279,3 +279,5 @@ EXPORT_SYMBOL_DOT(mul);
 EXPORT_SYMBOL_DOT(umul);
 EXPORT_SYMBOL_DOT(div);
 EXPORT_SYMBOL_DOT(udiv);
+
+EXPORT_SYMBOL(get_wchan);
index 0e0f540b7064e88f623cc01a41373f0e3f501e31..20a5534cbfdda7f5ef7dd3de90fdf9194dedc0d5 100644 (file)
@@ -802,3 +802,35 @@ out:
        unlock_kernel();
        return error;
 }
+
+/*
+ * These bracket the sleeping functions..
+ */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched    ((unsigned long) scheduling_functions_start_here)
+#define last_sched     ((unsigned long) scheduling_functions_end_here)
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       unsigned long pc, fp, bias = 0;
+       unsigned long task_base = (unsigned long) p;
+       struct reg_window *rw;
+       int count = 0;
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+       bias = STACK_BIAS;
+       fp = p->thread.ksp + bias;
+       do {
+               /* Bogus frame pointer? */
+               if (fp < (task_base + sizeof(struct task_struct)) ||
+                   fp >= (task_base + (2 * PAGE_SIZE)))
+                       break;
+               rw = (struct reg_window *) fp;
+               pc = rw->ins[7];
+               if (pc < first_sched || pc >= last_sched)
+                       return pc;
+               fp = rw->ins[6] + bias;
+       } while (++count < 16);
+       return 0;
+}
index e57b8d6f7866e7bb3da9936412fc95b41bf62a09..434f22bf8f316b527c89d6d56adae444c63ac18b 100644 (file)
@@ -311,3 +311,5 @@ EXPORT_SYMBOL_NOVERS(memcmp);
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(memset);
 EXPORT_SYMBOL_NOVERS(memmove);
+
+EXPORT_SYMBOL(get_wchan);
index 7fb22dd462da6a956215d4fe4a8c516bd2fecb70..991e7b510ec14ac4379c0a4ac929dfc8e33e9500 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/vt_kern.h>
 #include <linux/kbd_ll.h>
 #include <linux/sysrq.h>
+#include <linux/acpi.h>
 
 #define SIZE(x) (sizeof(x)/sizeof((x)[0]))
 
@@ -159,6 +160,8 @@ static int sysrq_pressed;
 int sysrq_enabled = 1;
 #endif
 
+static struct acpi_dev *acpi_kbd = NULL;
+
 /*
  * Many other routines do put_queue, but I think either
  * they produce ASCII, or they produce some user-assigned
@@ -201,6 +204,8 @@ void handle_scancode(unsigned char scancode, int down)
        char up_flag = down ? 0 : 0200;
        char raw_mode;
 
+       acpi_access(acpi_kbd);
+
        do_poke_blanked_console = 1;
        mark_bh(CONSOLE_BH);
        add_keyboard_randomness(scancode | up_flag);
@@ -923,5 +928,8 @@ int __init kbd_init(void)
        kbd_init_hw();
        init_bh(KEYBOARD_BH, kbd_bh);
        mark_bh(KEYBOARD_BH);
+       
+       acpi_kbd = acpi_register(ACPI_SYS_DEV, 0, ACPI_KBC_HID, NULL);
+
        return 0;
 }
index 0511c78f40ec58a6f4ca630c1fb2ad113c6dd9f6..a87622c8e52993ed06922a4357dc35cd1735c269 100644 (file)
@@ -3457,11 +3457,13 @@ static void autoconfig(struct serial_state * state)
        }
        if (state->type == PORT_16550A) {
                /* Check for Oxford Semiconductor 16C950 */
+               unsigned char scratch4;
+
                scratch = serial_icr_read(info, UART_ID1);
-               scratch2 = serial_icr_read(info, UART_ID2);
+               scratch4 = serial_icr_read(info, UART_ID2);
                scratch3 = serial_icr_read(info, UART_ID3);
                
-               if (scratch == 0x16 && scratch2 == 0xC9 &&
+               if (scratch == 0x16 && scratch4 == 0xC9 &&
                    (scratch3 == 0x50 || scratch3 == 0x52 ||
                     scratch3 == 0x54)) {
                        state->type = PORT_16C950;
index 5b793e2149e67d6d2bfec7ee053de28b9ff10069..c060a00ae7da9d26fb91e92300c0d5cfaf0a0804 100644 (file)
@@ -4,6 +4,6 @@
 mainmenu_option next_comment
 comment 'Misc devices'
 
-tristate 'Generic ACPI support' CONFIG_ACPI
+bool 'ACPI support' CONFIG_ACPI
 
 endmenu
index 6183d1231e75aacd95e990915e15f4352214fb1a..c12f546e9f0569079b1d8d2eae2f963eeeae6c76 100644 (file)
@@ -19,11 +19,7 @@ O_OBJS   :=
 OX_OBJS  :=
 
 ifeq ($(CONFIG_ACPI),y)
-  O_OBJS += acpi.o
-else
-  ifeq ($(CONFIG_ACPI),m)
-    M_OBJS += acpi.o
-  endif
+  OX_OBJS += acpi.o
 endif
 
 include $(TOPDIR)/Rules.make
index 3fd6bcc3c8ae4b67209627c63f3f8145a0e10998..2b379dd7014d1480af10a1c42bc3709567862cf2 100644 (file)
@@ -54,6 +54,7 @@
 #define DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue * x = NULL
 #endif
 
+static int acpi_idle_thread(void *context);
 static int acpi_do_ulong(ctl_table *ctl,
                         int write,
                         struct file *file,
@@ -70,6 +71,8 @@ static int acpi_do_event(ctl_table *ctl,
                         void *buffer,
                         size_t *len);
 
+DECLARE_WAIT_QUEUE_HEAD(acpi_idle_wait);
+
 static struct ctl_table_header *acpi_sysctl = NULL;
 
 static struct acpi_facp *acpi_facp = NULL;
@@ -84,6 +87,9 @@ static volatile u32 acpi_gpe_status = 0;
 static volatile u32 acpi_gpe_level = 0;
 static DECLARE_WAIT_QUEUE_HEAD(acpi_event_wait);
 
+static spinlock_t acpi_devs_lock = SPIN_LOCK_UNLOCKED;
+static LIST_HEAD(acpi_devs);
+
 /* Make it impossible to enter L2/L3 until after we've initialized */
 static unsigned long acpi_p_lvl2_lat = ~0UL;
 static unsigned long acpi_p_lvl3_lat = ~0UL;
@@ -907,6 +913,8 @@ static int acpi_do_event(ctl_table *ctl,
  */
 static int __init acpi_init(void)
 {
+       int pid;
+
        if (acpi_find_tables() && acpi_find_piix4()) {
                // no ACPI tables and not PIIX4
                return -ENODEV;
@@ -927,6 +935,10 @@ static int __init acpi_init(void)
        acpi_claim_ioports(acpi_facp);
        acpi_sysctl = register_sysctl_table(acpi_dir_table, 1);
 
+       pid = kernel_thread(acpi_idle_thread,
+                           NULL,
+                           CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+
        /*
         * Set up the ACPI idle function. Note that we can't really
         * do this with multiple CPU's, we'd need a per-CPU ACPI
@@ -961,13 +973,81 @@ static void __exit acpi_exit(void)
        acpi_destroy_tables();
 }
 
-#ifdef MODULE
+/*
+ * Register a device with the ACPI subsystem
+ */
+struct acpi_dev* acpi_register(acpi_dev_t type,
+                              unsigned long adr,
+                              acpi_hid_t hid,
+                              acpi_transition trans)
+{
+       struct acpi_dev *dev = kmalloc(sizeof(struct acpi_dev), GFP_KERNEL);
+       if (dev) {
+               unsigned long flags;
+
+               memset(dev, 0, sizeof(*dev));
+               dev->type = type;
+               dev->adr = adr;
+               dev->hid = hid;
+               dev->transition = trans;
+
+               spin_lock_irqsave(&acpi_devs_lock, flags);
+               list_add(&dev->entry, &acpi_devs);
+               spin_unlock_irqrestore(&acpi_devs_lock, flags);
+       }
+       return dev;
+}
+
+/*
+ * Unregister a device with ACPI
+ */
+void acpi_unregister(struct acpi_dev *dev)
+{
+       if (dev) {
+               unsigned long flags;
 
-module_init(acpi_init)
-module_exit(acpi_exit)
+               spin_lock_irqsave(&acpi_devs_lock, flags);
+               list_del(&dev->entry);
+               spin_unlock_irqrestore(&acpi_devs_lock, flags);
 
-#else
+               kfree(dev);
+       }
+}
+
+/*
+ * Wake up a device
+ */
+void acpi_wakeup(struct acpi_dev *dev)
+{
+       // run _PS0 or tell parent bus to wake device up
+}
+
+/*
+ * Manage idle devices
+ */
+static int acpi_idle_thread(void *context)
+{
+       exit_mm(current);
+       exit_files(current);
+       strcpy(current->comm, "acpi");
+       
+       for(;;) {
+               interruptible_sleep_on(&acpi_idle_wait);
+               if (signal_pending(current))
+                       break;
+
+               // find all idle devices and set idle timer based on policy
+       }
+
+       return 0;
+}
 
 __initcall(acpi_init);
 
-#endif
+/*
+ * Module visible symbols
+ */
+EXPORT_SYMBOL(acpi_idle_wait);
+EXPORT_SYMBOL(acpi_register);
+EXPORT_SYMBOL(acpi_unregister);
+EXPORT_SYMBOL(acpi_wakeup);
index d9b44d1e009c4859c5367b998081b669cc2c312c..7d5837836637ce6e7a4a3557e9a65cb7cd2cd6bf 100644 (file)
        5000  NV5000SC
 4b10  Buslogic Inc.
 4c48  LUNG HWA Electronics
-4d51  MEDIAQ Inc.
+4d51  MediaQ Inc.
        0200  MQ-200
 4ddc  ILC Data Device Corp
 5053  Voyetra Technologies
index b1895fce78b4cc1acb282963051eea4825708631..b4582693782b06305949b29fbe9405c21d8d58ad 100644 (file)
@@ -156,7 +156,7 @@ static int uhci_td_result(struct uhci_device *dev, struct uhci_td *td, unsigned
                        if (rval)
                                *rval += actlength;
 
-                       if (explength != actlength) {
+                       if (explength != actlength && tmp->pipetype == PIPE_BULK) {
                                /* If the packet is short, none of the */
                                /*  packets after this were processed, so */
                                /*  fix the DT accordingly */
index 23da3fdb283f4bde5f7b68458ef76f62c6207df2..20d4168f30bfbdb9ea1180832db4afe1c8802ec9 100644 (file)
@@ -720,7 +720,7 @@ static int usb_parse_configuration(struct usb_device *dev, struct usb_config_des
        }
 
        memset(config->interface, 0,
-              config->bNumInterfaces*sizeof(struct usb_interface_descriptor));
+              config->bNumInterfaces * sizeof(struct usb_interface));
 
        buffer += config->bLength;
        size -= config->bLength;
index 984f300c180c1716c6d882238d8d7097079ca798..4ed7a9abe4e80aa1268aae3d5387c2e966f5177b 100644 (file)
@@ -405,14 +405,13 @@ ncp_d_validate(struct dentry *dentry)
 {
        unsigned long dent_addr = (unsigned long) dentry;
        unsigned long min_addr = PAGE_OFFSET;
-       unsigned long max_addr = min_addr + (max_mapnr << PAGE_SHIFT);
        unsigned long align_mask = 0x0F;
        unsigned int len;
        int valid = 0;
 
        if (dent_addr < min_addr)
                goto bad_addr;
-       if (dent_addr > max_addr - sizeof(struct dentry))
+       if (dent_addr > (unsigned long)high_memory - sizeof(struct dentry))
                goto bad_addr;
        if ((dent_addr & ~align_mask) != dent_addr)
                goto bad_align;
index 03802b89230edde40cc5155a895d8a6973c9500b..c707dd57221e5c14094a8015bceae85a9d70f7b8 100644 (file)
  *
  * Gerhard Wichert   :  added BIGMEM support
  * Siemens AG           <Gerhard.Wichert@pdb.siemens.de>
+ *
+ * Al Viro & Jeff Garzik :  moved most of the thing into base.c and
+ *                      :  proc_misc.c. The rest may eventually go into
+ *                      :  base.c too.
  */
 
 #include <linux/types.h>
index 658da356237b1b23502c8dcae2098c31587a16d1..866bb50d4ef020b73246c7a2ea26370083bbbc1e 100644 (file)
@@ -4,6 +4,13 @@
  *  Copyright (C) 1991, 1992 Linus Torvalds
  *
  *  proc base directory handling functions
+ *
+ *  1999, Al Viro. Rewritten. Now it covers the whole per-process part.
+ *  Instead of using magical inumbers to determine the kind of object
+ *  we allocate and fill in-core inodes upon lookup. They don't even
+ *  go into icache. We cache the reference to task_struct upon lookup too.
+ *  Eventually it should become a filesystem in its own. We don't use the
+ *  rest of procfs anymore.
  */
 
 #include <asm/uaccess.h>
 #include <linux/init.h>
 #include <linux/file.h>
 
+/*
+ * For hysterical raisins we keep the same inumbers as in the old procfs.
+ * Feel free to change the macro below - just keep the range distinct from
+ * inumbers of the rest of procfs (currently those are in 0x0000--0xffff).
+ * As soon as we'll get a separate superblock we will be able to forget
+ * about magical ranges too.
+ */
+
 #define fake_ino(pid,ino) (((pid)<<16)|(ino))
 
 ssize_t proc_pid_read_maps(struct task_struct*,struct file*,char*,size_t,loff_t*);
@@ -241,7 +256,7 @@ static struct file_operations proc_info_file_operations = {
     proc_info_read,            /* read    */
 };
 
-struct inode_operations proc_info_inode_operations = {
+static struct inode_operations proc_info_inode_operations = {
        &proc_info_file_operations,  /* default proc file-ops */
 };
 
@@ -466,6 +481,26 @@ struct pid_entry {
        mode_t mode;
 };
 
+enum pid_directory_inos {
+       PROC_PID_INO = 2,
+       PROC_PID_STATUS,
+       PROC_PID_MEM,
+       PROC_PID_CWD,
+       PROC_PID_ROOT,
+       PROC_PID_EXE,
+       PROC_PID_FD,
+       PROC_PID_ENVIRON,
+       PROC_PID_CMDLINE,
+       PROC_PID_STAT,
+       PROC_PID_STATM,
+       PROC_PID_MAPS,
+#if CONFIG_AP1000
+       PROC_PID_RINGBUF,
+#endif
+       PROC_PID_CPU,
+       PROC_PID_FD_DIR = 0x8000,       /* 0x8000-0xffff */
+};
+
 #define E(type,name,mode) {(type),sizeof(name)-1,(name),(mode)}
 static struct pid_entry base_stuff[] = {
   E(PROC_PID_FD,       "fd",           S_IFDIR|S_IRUSR|S_IXUSR),
@@ -582,7 +617,7 @@ static int proc_base_readdir(struct file * filp,
 
 /* building an inode */
 
-static struct inode *proc_pid_get_inode(struct super_block * sb, struct task_struct *task, int ino)
+static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task, int ino)
 {
        struct inode * inode;
 
@@ -694,7 +729,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry)
                        goto out;
        }
 
-       inode = proc_pid_get_inode(dir->i_sb, task, PROC_PID_FD_DIR+fd);
+       inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_FD_DIR+fd);
        if (!inode)
                goto out;
        /* FIXME */
@@ -778,7 +813,7 @@ static struct dentry *proc_base_lookup(struct inode *dir, struct dentry *dentry)
                goto out;
 
        error = -EINVAL;
-       inode = proc_pid_get_inode(dir->i_sb, task, p->type);
+       inode = proc_pid_make_inode(dir->i_sb, task, p->type);
        if (!inode)
                goto out;
 
@@ -899,7 +934,7 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry)
        if (!task)
                goto out;
 
-       inode = proc_pid_get_inode(dir->i_sb, task, PROC_PID_INO);
+       inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_INO);
 
        free_task_struct(task);
 
@@ -923,3 +958,60 @@ void proc_pid_delete_inode(struct inode *inode)
                fput(inode->u.proc_i.file);
        free_task_struct(inode->u.proc_i.task);
 }
+
+#define PROC_NUMBUF 10
+#define PROC_MAXPIDS 20
+
+/*
+ * Get a few pid's to return for filldir - we need to hold the
+ * tasklist lock while doing this, and we must release it before
+ * we actually do the filldir itself, so we use a temp buffer..
+ */
+static int get_pid_list(int index, unsigned int *pids)
+{
+       struct task_struct *p;
+       int nr_pids = 0;
+
+       index -= FIRST_PROCESS_ENTRY;
+       read_lock(&tasklist_lock);
+       for_each_task(p) {
+               int pid = p->pid;
+               if (!pid)
+                       continue;
+               if (--index >= 0)
+                       continue;
+               pids[nr_pids] = pid;
+               nr_pids++;
+               if (nr_pids >= PROC_MAXPIDS)
+                       break;
+       }
+       read_unlock(&tasklist_lock);
+       return nr_pids;
+}
+
+int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
+{
+       unsigned int pid_array[PROC_MAXPIDS];
+       char buf[PROC_NUMBUF];
+       unsigned int nr = filp->f_pos;
+       unsigned int nr_pids, i;
+
+       nr_pids = get_pid_list(nr, pid_array);
+
+       for (i = 0; i < nr_pids; i++) {
+               int pid = pid_array[i];
+               ino_t ino = fake_ino(pid,PROC_PID_INO);
+               unsigned long j = PROC_NUMBUF;
+
+               do {
+                       j--;
+                       buf[j] = '0' + (pid % 10);
+                       pid /= 10;
+               } while (pid);
+
+               if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino) < 0)
+                       break;
+               filp->f_pos++;
+       }
+       return 0;
+}
index 107f86e16333af04dee1969f79ee653547b27cd4..b50a00b602d2b8ede4e94b31cad62d29dc6c4705 100644 (file)
@@ -23,7 +23,7 @@
 ssize_t read_kcore(struct file * file, char * buf,
                         size_t count, loff_t *ppos)
 {
-       unsigned long p = *ppos, memsize;
+       unsigned long long p = *ppos, memsize;
        ssize_t read;
        ssize_t count1;
        char * pnt;
index 545e7cfada3d5bd9739634acd87a898f652ffd4f..d1b6cb659be1f01113aabcce56e7b5bd450a156e 100644 (file)
 #include <linux/zorro.h>
 #endif
 
-/*
- * Offset of the first process in the /proc root directory..
- */
-#define FIRST_PROCESS_ENTRY 256
-
 static int proc_root_readdir(struct file *, void *, filldir_t);
 static struct dentry *proc_root_lookup(struct inode *,struct dentry *);
 static int proc_unlink(struct inode *, struct dentry *);
@@ -46,13 +41,6 @@ static struct file_operations proc_dir_operations = {
        NULL,                   /* read - bad */
        NULL,                   /* write - bad */
        proc_readdir,           /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* can't fsync */
 };
 
 /*
@@ -62,23 +50,6 @@ struct inode_operations proc_dir_inode_operations = {
        &proc_dir_operations,   /* default net directory file-ops */
        NULL,                   /* create */
        proc_lookup,            /* lookup */
-       NULL,                   /* link */
-       NULL,                   /* unlink */
-       NULL,                   /* symlink */
-       NULL,                   /* mkdir */
-       NULL,                   /* rmdir */
-       NULL,                   /* mknod */
-       NULL,                   /* rename */
-       NULL,                   /* readlink */
-       NULL,                   /* follow_link */
-       NULL,                   /* get_block */
-       NULL,                   /* readpage */
-       NULL,                   /* writepage */
-       NULL,                   /* flushpage */
-       NULL,                   /* truncate */
-       NULL,                   /* permission */
-       NULL,                   /* smap */
-       NULL                    /* revalidate */
 };
 
 /*
@@ -90,21 +61,6 @@ struct inode_operations proc_dyna_dir_inode_operations = {
        proc_lookup,            /* lookup */
        NULL,                   /* link */
        proc_unlink,            /* unlink(struct inode *, struct dentry *) */
-       NULL,                   /* symlink      */
-       NULL,                   /* mkdir */
-       NULL,                   /* rmdir */
-       NULL,                   /* mknod */
-       NULL,                   /* rename */
-       NULL,                   /* readlink */
-       NULL,                   /* follow_link */
-       NULL,                   /* get_block */
-       NULL,                   /* readpage */
-       NULL,                   /* writepage */
-       NULL,                   /* flushpage */
-       NULL,                   /* truncate */
-       NULL,                   /* permission */
-       NULL,                   /* smap */
-       NULL                    /* revalidate */
 };
 
 /*
@@ -117,13 +73,6 @@ static struct file_operations proc_root_operations = {
        NULL,                   /* read - bad */
        NULL,                   /* write - bad */
        proc_root_readdir,      /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* no fsync */
 };
 
 /*
@@ -133,23 +82,6 @@ static struct inode_operations proc_root_inode_operations = {
        &proc_root_operations,  /* default base directory file-ops */
        NULL,                   /* create */
        proc_root_lookup,       /* lookup */
-       NULL,                   /* link */
-       NULL,                   /* unlink */
-       NULL,                   /* symlink */
-       NULL,                   /* mkdir */
-       NULL,                   /* rmdir */
-       NULL,                   /* mknod */
-       NULL,                   /* rename */
-       NULL,                   /* readlink */
-       NULL,                   /* follow_link */
-       NULL,                   /* get_block */
-       NULL,                   /* readpage */
-       NULL,                   /* writepage */
-       NULL,                   /* flushpage */
-       NULL,                   /* truncate */
-       NULL,                   /* permission */
-       NULL,                   /* smap */
-       NULL                    /* revalidate */
 };
 
 /*
@@ -268,36 +200,12 @@ static struct file_operations proc_openprom_operations = {
        NULL,                   /* read - bad */
        NULL,                   /* write - bad */
        OPENPROM_DEFREADDIR,    /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* can't fsync */
 };
 
 struct inode_operations proc_openprom_inode_operations = {
        &proc_openprom_operations,/* default net directory file-ops */
        NULL,                   /* create */
        OPENPROM_DEFLOOKUP,     /* lookup */
-       NULL,                   /* link */
-       NULL,                   /* unlink */
-       NULL,                   /* symlink */
-       NULL,                   /* mkdir */
-       NULL,                   /* rmdir */
-       NULL,                   /* mknod */
-       NULL,                   /* rename */
-       NULL,                   /* readlink */
-       NULL,                   /* follow_link */
-       NULL,                   /* get_block */
-       NULL,                   /* readpage */
-       NULL,                   /* writepage */
-       NULL,                   /* flushpage */
-       NULL,                   /* truncate */
-       NULL,                   /* permission */
-       NULL,                   /* smap */
-       NULL                    /* revalidate */
 };
 
 struct proc_dir_entry proc_openprom = {
@@ -612,7 +520,7 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry)
                        if (de->namelen != dentry->d_name.len)
                                continue;
                        if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
-                               int ino = de->low_ino | (dir->i_ino & ~(0xffff));
+                               int ino = de->low_ino;
                                error = -EINVAL;
                                inode = proc_get_inode(dir->i_sb, ino, de);
                                break;
@@ -700,7 +608,6 @@ int proc_readdir(struct file * filp,
                        filp->f_pos++;
                        /* fall through */
                default:
-                       ino &= ~0xffff;
                        de = de->subdir;
                        i -= 2;
                        for (;;) {
@@ -713,7 +620,7 @@ int proc_readdir(struct file * filp,
                        }
 
                        do {
-                               if (filldir(dirent, de->name, de->namelen, filp->f_pos, ino | de->low_ino) < 0)
+                               if (filldir(dirent, de->name, de->namelen, filp->f_pos, de->low_ino) < 0)
                                        return 0;
                                filp->f_pos++;
                                de = de->next;
@@ -722,69 +629,19 @@ int proc_readdir(struct file * filp,
        return 1;
 }
 
-#define PROC_NUMBUF 10
-#define PROC_MAXPIDS 20
-
-/*
- * Get a few pid's to return for filldir - we need to hold the
- * tasklist lock while doing this, and we must release it before
- * we actually do the filldir itself, so we use a temp buffer..
- */
-static int get_pid_list(int index, unsigned int *pids)
-{
-       struct task_struct *p;
-       int nr_pids = 0;
-
-       index -= FIRST_PROCESS_ENTRY;
-       read_lock(&tasklist_lock);
-       for_each_task(p) {
-               int pid = p->pid;
-               if (!pid)
-                       continue;
-               if (--index >= 0)
-                       continue;
-               pids[nr_pids] = pid;
-               nr_pids++;
-               if (nr_pids >= PROC_MAXPIDS)
-                       break;
-       }
-       read_unlock(&tasklist_lock);
-       return nr_pids;
-}
-
 static int proc_root_readdir(struct file * filp,
        void * dirent, filldir_t filldir)
 {
-       unsigned int pid_array[PROC_MAXPIDS];
-       char buf[PROC_NUMBUF];
        unsigned int nr = filp->f_pos;
-       unsigned int nr_pids, i;
 
        if (nr < FIRST_PROCESS_ENTRY) {
                int error = proc_readdir(filp, dirent, filldir);
                if (error <= 0)
                        return error;
-               filp->f_pos = nr = FIRST_PROCESS_ENTRY;
+               filp->f_pos = FIRST_PROCESS_ENTRY;
        }
 
-       nr_pids = get_pid_list(nr, pid_array);
-
-       for (i = 0; i < nr_pids; i++) {
-               int pid = pid_array[i];
-               ino_t ino = (pid << 16) + PROC_PID_INO;
-               unsigned long j = PROC_NUMBUF;
-
-               do {
-                       j--;
-                       buf[j] = '0' + (pid % 10);
-                       pid /= 10;
-               } while (pid);
-
-               if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino) < 0)
-                       break;
-               filp->f_pos++;
-       }
-       return 0;
+       return proc_pid_readdir(filp, dirent, filldir);
 }
 
 static int proc_unlink(struct inode *dir, struct dentry *dentry)
diff --git a/include/asm-alpha/div64.h b/include/asm-alpha/div64.h
new file mode 100644 (file)
index 0000000..6260adb
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __ALPHA_DIV64
+#define __ALPHA_DIV64
+
+/*
+ * Hey, we're already 64-bit, no
+ * need to play games..
+ */
+#define do_div(n,base) ({ \
+       int __res; \
+       __res = ((unsigned long) n) % (unsigned) base; \
+       n = ((unsigned long) n) / (unsigned) base; \
+       __res; })
+
+#endif
index f986d1c14b43c4ab3f94857def3761e2c9cfddeb..9f55ea0c3e7a05f6431d6bda904c0175952d4dd1 100644 (file)
@@ -126,40 +126,7 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long schedule_frame;
-       unsigned long pc;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-       /*
-        * This one depends on the frame size of schedule().  Do a
-        * "disass schedule" in gdb to find the frame size.  Also, the
-        * code assumes that sleep_on() follows immediately after
-        * interruptible_sleep_on() and that add_timer() follows
-        * immediately after interruptible_sleep().  Ugly, isn't it?
-        * Maybe adding a wchan field to task_struct would be better,
-        * after all...
-        */
-
-       pc = thread_saved_pc(&p->thread);
-       if (pc >= first_sched && pc < last_sched) {
-               schedule_frame = ((unsigned long *)p->thread.ksp)[6];
-               return ((unsigned long *)schedule_frame)[12];
-       }
-       return pc;
-}
-#undef last_sched
-#undef first_sched
-
+unsigned long get_wchan(struct task_struct *p);
 /*
 * See arch/alpha/kernel/ptrace.c for details.
 */
index 02cd7202906d613d022b6222cbed123b8f25cd9f..bac831217c9b5df953e85d3d4d8b273bbc8f0f47 100644 (file)
@@ -107,36 +107,7 @@ extern void release_thread(struct task_struct *);
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long fp, lr;
-       unsigned long stack_page;
-       int count = 0;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-
-       stack_page = 4096 + (unsigned long)p;
-       fp = get_css_fp(&p->thread);
-       do {
-               if (fp < stack_page || fp > 4092+stack_page)
-                       return 0;
-               lr = pc_pointer (((unsigned long *)fp)[-1]);
-               if (lr < first_sched || lr > last_sched)
-                       return lr;
-               fp = *(unsigned long *) (fp - 12);
-       } while (count ++ < 16);
-       return 0;
-}
-#undef last_sched
-#undef first_sched
+unsigned long get_wchan(struct task_struct *p);
 
 #ifdef CONFIG_CPU_26
 # define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1022])
diff --git a/include/asm-i386/div64.h b/include/asm-i386/div64.h
new file mode 100644 (file)
index 0000000..ef915df
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __I386_DIV64
+#define __I386_DIV64
+
+#define do_div(n,base) ({ \
+       unsigned long __upper, __low, __high, __mod; \
+       asm("":"=a" (__low), "=d" (__high):"A" (n)); \
+       __upper = __high; \
+       if (__high) { \
+               __upper = __high % (base); \
+               __high = __high / (base); \
+       } \
+       asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (base), "0" (__low), "1" (__upper)); \
+       asm("":"=A" (n):"a" (__low),"d" (__high)); \
+       __mod; \
+})
+
+#endif
index 545673d7c041052fc9db15f3c771efda6d0d535e..7b7c9e094f163f3bbbd0a9bed8619a356a0f7819 100644 (file)
@@ -134,38 +134,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t)
                return sw->retpc;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long fp, pc;
-       unsigned long stack_page;
-       int count = 0;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-
-       stack_page = (unsigned long)p;
-       fp = ((struct switch_stack *)p->thread.ksp)->a6;
-       do {
-               if (fp < stack_page+sizeof(struct task_struct) ||
-                   fp >= 8184+stack_page)
-                       return 0;
-               pc = ((unsigned long *)fp)[1];
-               /* FIXME: This depends on the order of these functions. */
-               if (pc < first_sched || pc >= last_sched)
-                       return pc;
-               fp = *(unsigned long *) fp;
-       } while (count++ < 16);
-       return 0;
-}
-#undef last_sched
-#undef first_sched
+unsigned long get_wchan(struct task_struct *p);
 
 #define        KSTK_EIP(tsk)   \
     ({                 \
index 4f277148ae7a53512e7fe7f6b810b5806dea7054..b2418de80352f2eeb3cb98afd3d840b69a50ec73 100644 (file)
@@ -206,32 +206,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t)
  */
 extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp);
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long schedule_frame;
-       unsigned long pc;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-       /*
-        * The same comment as on the Alpha applies here, too ...
-        */
-       pc = thread_saved_pc(&p->tss);
-       if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) {
-               schedule_frame = ((unsigned long *)(long)p->tss.reg30)[16];
-               return (unsigned long)((unsigned long *)schedule_frame)[11];
-       }
-       return pc;
-}
-#undef last_sched
-#undef first_sched
+unsigned long get_wchan(struct task_struct *p);
 
 #define PT_REG(reg)            ((long)&((struct pt_regs *)0)->reg \
                                 - sizeof(struct pt_regs))
index 167debde713b4bff2557d59e0d273afc980ae1ac..7030d2cf9373f6953f42f5d3c2df0d7e2fe245cb 100644 (file)
@@ -316,36 +316,7 @@ static inline unsigned long thread_saved_pc(struct thread_struct *t)
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long ip, sp;
-       unsigned long stack_page = (unsigned long) p;
-       int count = 0;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-       sp = p->thread.ksp;
-       do {
-               sp = *(unsigned long *)sp;
-               if (sp < stack_page || sp >= stack_page + 8188)
-                       return 0;
-               if (count > 0) {
-                       ip = *(unsigned long *)(sp + 4);
-                       if (ip < first_sched || ip >= last_sched)
-                               return ip;
-               }
-       } while (count++ < 16);
-       return 0;
-}
-#undef last_sched
-#undef first_sched
+unsigned long get_wchan(struct task_struct *p);
 
 #define KSTK_EIP(tsk)  ((tsk)->thread.regs->nip)
 #define KSTK_ESP(tsk)  ((tsk)->thread.regs->gpr[1])
index 662a8119f42ddc406f4042bb2d9586632afdfbd4..b9ed8b8047b57545676d20ec06f0f75b0456a6f3 100644 (file)
@@ -161,39 +161,7 @@ extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long pc, fp, bias = 0;
-       unsigned long task_base = (unsigned long) p;
-       struct reg_window *rw;
-       int count = 0;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-
-       fp = p->thread.ksp + bias;
-       do {
-               /* Bogus frame pointer? */
-               if (fp < (task_base + sizeof(struct task_struct)) ||
-                   fp >= (task_base + (2 * PAGE_SIZE)))
-                       break;
-               rw = (struct reg_window *) fp;
-               pc = rw->ins[7];
-               if (pc < first_sched || pc >= last_sched)
-                       return pc;
-               fp = rw->ins[6] + bias;
-       } while (++count < 16);
-       return 0;
-}
-#undef last_sched
-#undef first_sched
+unsigned long get_wchan(struct task_struct *p);
 
 #define KSTK_EIP(tsk)  ((tsk)->thread.kregs->pc)
 #define KSTK_ESP(tsk)  ((tsk)->thread.kregs->u_regs[UREG_FP])
index 56a116279dd9f7c32ed30da2939112608f096b95..35c54dd1a7ee35132cd2d1fcf0c3810f01c950e9 100644 (file)
@@ -209,39 +209,7 @@ extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
-/*
- * These bracket the sleeping functions..
- */
-extern void scheduling_functions_start_here(void);
-extern void scheduling_functions_end_here(void);
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-       unsigned long pc, fp, bias = 0;
-       unsigned long task_base = (unsigned long) p;
-       struct reg_window *rw;
-       int count = 0;
-       if (!p || p == current || p->state == TASK_RUNNING)
-               return 0;
-       bias = STACK_BIAS;
-       fp = p->thread.ksp + bias;
-       do {
-               /* Bogus frame pointer? */
-               if (fp < (task_base + sizeof(struct task_struct)) ||
-                   fp >= (task_base + (2 * PAGE_SIZE)))
-                       break;
-               rw = (struct reg_window *) fp;
-               pc = rw->ins[7];
-               if (pc < first_sched || pc >= last_sched)
-                       return pc;
-               fp = rw->ins[6] + bias;
-       } while (++count < 16);
-       return 0;
-}
-#undef last_sched
-#undef first_sched
+unsigned long get_wchan(struct task_struct *p);
 
 #define KSTK_EIP(tsk)  ((tsk)->thread.kregs->tpc)
 #define KSTK_ESP(tsk)  ((tsk)->thread.kregs->u_regs[UREG_FP])
index 36b4818c3ffedee2e36f74c7e51461baa56b2d4c..9be978d203dc97239bd9692cb31dbbd78a1e40ac 100644 (file)
 #include <linux/types.h>
 #include <linux/ioctl.h>
 
+#ifdef __KERNEL__
+
+#include <linux/sched.h>
+#include <linux/wait.h>
+
+/*
+ * Device types
+ */
+enum
+{
+       ACPI_SYS_DEV,   /* system device (fan, KB controller, ...) */
+       ACPI_PCI_DEV,   /* generic PCI device */
+       ACPI_PCI_BUS,   /* PCI bus */
+       ACPI_ISA_DEV,   /* generic ISA device */
+       ACPI_ISA_BUS,   /* ISA bus */
+       ACPI_USB_DEV,   /* generic USB device */
+       ACPI_USB_HUB,   /* USB hub device */
+       ACPI_USB_CTRL,  /* USB controller */
+       ACPI_SCSI_DEV,  /* generic SCSI device */
+       ACPI_SCSI_CTRL, /* SCSI controller */
+};
+
+typedef int acpi_dev_t;
+
+/*
+ * Device addresses
+ */
+#define ACPI_PCI_ADR(dev) ((dev)->bus->number << 16 | (dev)->devfn)
+
+/*
+ * HID (PnP) values
+ */
+enum
+{
+       ACPI_UNKNOWN_HID =  0x00000000, /* generic */
+       ACPI_KBC_HID =      0x41d00303, /* keyboard controller */
+       ACPI_COM_HID =      0x41d00500, /* serial port */
+       ACPI_FDC_HID =      0x41d00700, /* floppy controller */
+       ACPI_VGA_HID =      0x41d00900, /* VGA controller */
+       ACPI_ISA_HID =      0x41d00a00, /* ISA bus */
+       ACPI_EISA_HID =     0x41d00a01, /* EISA bus */
+       ACPI_PCI_HID =      0x41d00a03, /* PCI bus */
+};
+
+typedef int acpi_hid_t;
+
+/*
+ * Device states
+ */
+enum
+{
+       ACPI_D0, /* fully-on */
+       ACPI_D1, /* partial-on */
+       ACPI_D2, /* partial-on */
+       ACPI_D3, /* fully-off */
+};
+
+typedef int acpi_dstate_t;
+
+struct acpi_dev;
+
+/*
+ * Device state transition function
+ */
+typedef int (*acpi_transition)(struct acpi_dev *dev, acpi_dstate_t state);
+
+/*
+ * ACPI device information
+ */
+struct acpi_dev
+{
+       acpi_dev_t       type;       /* device type */
+       unsigned long    adr;        /* bus address or unique id */
+       acpi_hid_t       hid;        /* P&P identifier */
+       acpi_transition  transition; /* state transition callback */
+       acpi_dstate_t    state;      /* current D-state */
+       unsigned long    accessed;   /* last access time */
+       unsigned long    idle;       /* last idle time */
+       struct list_head entry;      /* linked list entry */
+};
+
+#ifdef CONFIG_ACPI
+
+extern wait_queue_head_t acpi_idle_wait;
+
+/*
+ * Register a device with the ACPI subsystem
+ */
+struct acpi_dev *acpi_register(acpi_dev_t type,
+                              unsigned long adr,
+                              acpi_hid_t hid,
+                              acpi_transition trans);
+
+/*
+ * Unregister a device with ACPI
+ */
+void acpi_unregister(struct acpi_dev *dev);
+
+/*
+ * Update device access time and wake up device, if necessary
+ */
+extern inline void acpi_access(struct acpi_dev *dev)
+{
+       extern void acpi_wakeup(struct acpi_dev *dev);
+       if (dev->state != ACPI_D0)
+               acpi_wakeup(dev);
+       dev->accessed = jiffies;
+}
+
+/*
+ * Identify device as currently being idle
+ */
+extern inline void acpi_dev_idle(struct acpi_dev *dev)
+{
+       dev->idle = jiffies;
+       if (waitqueue_active(&acpi_idle_wait))
+               wake_up(&acpi_idle_wait);
+}
+
+#else /* CONFIG_ACPI */
+
+extern inline struct acpi_dev*
+acpi_register(acpi_dev_t type,
+             unsigned long adr,
+             acpi_hid_t hid,
+             acpi_transition trans)
+{
+       return 0;
+}
+
+extern inline void acpi_unregister(struct acpi_dev *dev) {}
+extern inline void acpi_access(struct acpi_dev *dev) {}
+extern inline void acpi_dev_idle(struct acpi_dev *dev) {}
+
+#endif /* CONFIG_ACPI */
+
+extern void (*acpi_idle)(void);
+extern void (*acpi_power_off)(void);
+
+#endif /* __KERNEL__ */
+
 /* RSDP location */
 #define ACPI_BIOS_ROM_BASE (0x0e0000)
 #define ACPI_BIOS_ROM_END  (0x100000)
@@ -181,7 +322,8 @@ enum
        ACPI_P_LVL3,
        ACPI_P_LVL2_LAT,
        ACPI_P_LVL3_LAT,
-       ACPI_S5_SLP_TYP
+       ACPI_S5_SLP_TYP,
+       ACPI_KBD,
 };
 
 #define ACPI_P_LVL_DISABLED    0x80
@@ -224,11 +366,4 @@ enum
 #define ACPI_PIIX4_PMREGMISC   0x80
 #define          ACPI_PIIX4_PMIOSE     0x01
 
-#ifdef __KERNEL__
-
-extern void (*acpi_idle)(void);
-extern void (*acpi_power_off)(void);
-
-#endif
-
 #endif /* _LINUX_ACPI_H */
index a76f96bb726057241e972eeeba0bfd8fcdb5bd50..5638e1d2388cfbe1a107579c510b212f9dc32b27 100644 (file)
@@ -8,6 +8,12 @@
  * The proc filesystem constants/structures
  */
 
+/*
+ * Offset of the first process in the /proc root directory..
+ */
+#define FIRST_PROCESS_ENTRY 256
+
+
 /*
  * We always define these enumerators
  */
@@ -16,33 +22,6 @@ enum {
        PROC_ROOT_INO = 1,
 };
 
-enum pid_directory_inos {
-       PROC_PID_INO = 2,
-       PROC_PID_STATUS,
-       PROC_PID_MEM,
-       PROC_PID_CWD,
-       PROC_PID_ROOT,
-       PROC_PID_EXE,
-       PROC_PID_FD,
-       PROC_PID_ENVIRON,
-       PROC_PID_CMDLINE,
-       PROC_PID_STAT,
-       PROC_PID_STATM,
-       PROC_PID_MAPS,
-#if CONFIG_AP1000
-       PROC_PID_RINGBUF,
-#endif
-       PROC_PID_CPU,
-};
-
-enum pid_subdirectory_inos {
-       PROC_PID_FD_DIR = 0x8000,       /* 0x8000-0xffff */
-};
-
-enum net_directory_inos {
-       PROC_NET_LAST
-};
-
 enum scsi_directory_inos {
        PROC_SCSI_SCSI = 256,
        PROC_SCSI_ADVANSYS,
@@ -203,9 +182,12 @@ extern struct proc_dir_entry proc_root_kcore;
 extern struct inode_operations proc_scsi_inode_operations;
 
 extern void proc_root_init(void);
-extern void proc_base_init(void);
 extern void proc_misc_init(void);
 
+struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry);
+void proc_pid_delete_inode(struct inode *inode);
+int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
+
 extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
 extern int proc_unregister(struct proc_dir_entry *, int);
 
@@ -335,8 +317,6 @@ extern struct inode_operations proc_netdir_inode_operations;
 extern struct inode_operations proc_openprom_inode_operations;
 extern struct inode_operations proc_mem_inode_operations;
 extern struct inode_operations proc_sys_inode_operations;
-extern struct inode_operations proc_array_inode_operations;
-extern struct inode_operations proc_arraylong_inode_operations;
 extern struct inode_operations proc_kcore_inode_operations;
 extern struct inode_operations proc_profile_inode_operations;
 extern struct inode_operations proc_kmsg_inode_operations;
index 54904a2c879c686106201051300574b263f278c6..9f72e7453fa7b5c780525a4f28405e8536479a1b 100644 (file)
@@ -14,6 +14,8 @@
 #include <linux/string.h>
 #include <linux/ctype.h>
 
+#include <asm/div64.h>
+
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
 {
        unsigned long result = 0,value;
@@ -66,14 +68,7 @@ static int skip_atoi(const char **s)
 #define SPECIAL        32              /* 0x */
 #define LARGE  64              /* use 'ABCDEF' instead of 'abcdef' */
 
-#define do_div(n,base) ({ \
-int __res; \
-__res = ((unsigned long) n) % (unsigned) base; \
-n = ((unsigned long) n) / (unsigned) base; \
-__res; })
-
-static char * number(char * str, long num, int base, int size, int precision
-       ,int type)
+static char * number(char * str, long long num, int base, int size, int precision, int type)
 {
        char c,sign,tmp[66];
        const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
@@ -145,7 +140,7 @@ int sprintf(char * buf, const char *fmt, ...);
 int vsprintf(char *buf, const char *fmt, va_list args)
 {
        int len;
-       unsigned long num;
+       unsigned long long num;
        int i, base;
        char * str;
        const char *s;
@@ -295,18 +290,23 @@ int vsprintf(char *buf, const char *fmt, va_list args)
                                --fmt;
                        continue;
                }
-               if (qualifier == 'l')
+               if (qualifier == 'L')
+                       num = va_arg(args, long long);
+               else if (qualifier == 'l') {
                        num = va_arg(args, unsigned long);
-               else if (qualifier == 'z')
+                       if (flags & SIGN)
+                               num = (signed long) num;
+               } else if (qualifier == 'z') {
                        num = va_arg(args, size_t);
-               else if (qualifier == 'h') {
+               else if (qualifier == 'h') {
                        num = (unsigned short) va_arg(args, int);
                        if (flags & SIGN)
-                               num = (short) num;
-               } else if (flags & SIGN)
-                       num = va_arg(args, int);
-               else
+                               num = (signed short) num;
+               } else {
                        num = va_arg(args, unsigned int);
+                       if (flags & SIGN)
+                               num = (signed int) num;
+               }
                str = number(str, num, base, field_width, precision, flags);
        }
        *str = '\0';
index 018294759cd2cd40b5b659f7f04b6dcfa9995d60..43063a82d484d885dabdf888e66bc07f55e76cff 100644 (file)
@@ -204,7 +204,7 @@ void * vmalloc(unsigned long size)
        struct vm_struct *area;
 
        size = PAGE_ALIGN(size);
-       if (!size || size > (max_mapnr << PAGE_SHIFT)) {
+       if (!size || (size >> PAGE_SHIFT) > max_mapnr)) {
                BUG();
                return NULL;
        }