]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
Merge branch 'fixes-2.6.23' of master.kernel.org:/pub/scm/linux/kernel/git/galak...
authorPaul Mackerras <paulus@samba.org>
Thu, 26 Jul 2007 06:43:24 +0000 (16:43 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 26 Jul 2007 06:43:24 +0000 (16:43 +1000)
151 files changed:
Makefile
arch/i386/boot/apm.c
arch/i386/boot/main.c
arch/i386/kernel/acpi/Makefile
arch/i386/kernel/setup.c
arch/i386/mm/init.c
arch/ia64/ia32/ia32_support.c
arch/ia64/ia32/ia32priv.h
arch/ia64/ia32/sys_ia32.c
arch/ia64/kernel/acpi.c
arch/ia64/kernel/head.S
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/machvec.c
arch/ia64/kernel/process.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/smp.c
arch/ia64/kernel/smpboot.c
arch/ia64/kernel/vmlinux.lds.S
arch/ia64/pci/pci.c
arch/m68knommu/Kconfig
arch/m68knommu/Makefile
arch/m68knommu/kernel/dma.c
arch/m68knommu/kernel/setup.c
arch/m68knommu/platform/5206/config.c
arch/m68knommu/platform/5206e/config.c
arch/m68knommu/platform/520x/config.c
arch/m68knommu/platform/523x/config.c
arch/m68knommu/platform/5249/config.c
arch/m68knommu/platform/5272/config.c
arch/m68knommu/platform/527x/config.c
arch/m68knommu/platform/528x/config.c
arch/m68knommu/platform/5307/config.c
arch/m68knommu/platform/5307/entry.S
arch/m68knommu/platform/532x/config.c
arch/m68knommu/platform/5407/config.c
arch/m68knommu/platform/68VZ328/config.c
arch/powerpc/boot/dts/kuroboxHD.dts
arch/powerpc/boot/dts/kuroboxHG.dts
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/iomap.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/prom_parse.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/mm/lmb.c
arch/powerpc/platforms/cell/spufs/context.c
arch/powerpc/platforms/cell/spufs/run.c
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/iseries/lpevents.c
arch/powerpc/platforms/maple/pci.c
arch/powerpc/sysdev/fsl_soc.c
arch/x86_64/kernel/acpi/Makefile
arch/x86_64/kernel/acpi/sleep.c
arch/x86_64/kernel/head.S
arch/x86_64/kernel/setup.c
drivers/acpi/Kconfig
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/button.c
drivers/acpi/container.c
drivers/acpi/ec.c
drivers/acpi/events/evrgnini.c
drivers/acpi/fan.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_throttling.c
drivers/acpi/sbs.c
drivers/acpi/scan.c
drivers/acpi/sleep/Makefile
drivers/acpi/sleep/main.c
drivers/acpi/sleep/poweroff.c
drivers/acpi/sleep/proc.c
drivers/acpi/sleep/wakeup.c
drivers/acpi/thermal.c
drivers/acpi/utilities/uteval.c
drivers/acpi/video.c
drivers/char/hpet.c
drivers/input/misc/atlas_btns.c
drivers/kvm/kvm_main.c
drivers/kvm/x86_emulate.c
drivers/misc/asus-laptop.c
drivers/misc/sony-laptop.c
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.h
drivers/pci/pci-acpi.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pnp/driver.c
drivers/pnp/pnpacpi/core.c
drivers/rtc/class.c
drivers/s390/net/ctcmain.c
drivers/s390/net/netiucv.c
drivers/serial/68328serial.c
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/acpi/actypes.h
include/acpi/acutils.h
include/asm-i386/acpi.h
include/asm-i386/bootparam.h
include/asm-i386/ist.h
include/asm-i386/suspend.h
include/asm-ia64/acpi.h
include/asm-ia64/ia32.h
include/asm-ia64/machvec.h
include/asm-ia64/processor.h
include/asm-ia64/smp.h
include/asm-m68knommu/hw_irq.h [new file with mode: 0644]
include/asm-m68knommu/mcfdma.h
include/asm-m68knommu/system.h
include/asm-m68knommu/timex.h
include/asm-powerpc/pci-bridge.h
include/asm-powerpc/ppc_asm.h
include/asm-powerpc/vio.h
include/asm-x86_64/acpi.h
include/asm-x86_64/ist.h [new file with mode: 0644]
include/asm-x86_64/suspend.h
include/linux/acpi.h
include/linux/apm_bios.h
include/linux/mod_devicetable.h
include/linux/pnp.h
include/linux/time.h
kernel/acct.c
kernel/hrtimer.c
kernel/sysctl.c
kernel/time.c
kernel/time/timekeeping.c
kernel/tsacct.c
net/rxrpc/af_rxrpc.c
net/rxrpc/ar-connection.c
net/rxrpc/ar-transport.c
net/rxrpc/rxkad.c
scripts/Makefile.build
scripts/Makefile.modpost
scripts/kconfig/conf.c
scripts/kconfig/expr.h
scripts/kconfig/gconf.c
scripts/kconfig/kxgettext.c
scripts/kconfig/lkc_proto.h
scripts/kconfig/mconf.c
scripts/kconfig/menu.c
scripts/kconfig/qconf.cc
scripts/kconfig/zconf.tab.c_shipped
scripts/kconfig/zconf.y
scripts/mod/file2alias.c
scripts/mod/modpost.c
scripts/ver_linux
security/selinux/xfrm.c

index 23f81c9f698eaf4f6c9c407a926de1fe3b74a9cd..dfe3d1610a7b3a7495507e9e95d6109592be4af1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -299,7 +299,7 @@ CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C
 MODFLAGS       = -DMODULE
 CFLAGS_MODULE   = $(MODFLAGS)
 AFLAGS_MODULE   = $(MODFLAGS)
-LDFLAGS_MODULE  = -r
+LDFLAGS_MODULE  =
 CFLAGS_KERNEL  =
 AFLAGS_KERNEL  =
 
index a34087c370c04b73a863c8698e11d4aeb619e6e0..eab50c55a3a565f626443fffe015fa5ad9c38b04 100644 (file)
@@ -40,14 +40,15 @@ int query_apm_bios(void)
        if (bx != 0x504d)       /* "PM" signature */
                return -1;
 
-       if (cx & 0x02)          /* 32 bits supported? */
+       if (!(cx & 0x02))               /* 32 bits supported? */
                return -1;
 
        /* Disconnect first, just in case */
        ax = 0x5304;
+       bx = 0;
        asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp"
-                    : "+a" (ax)
-                    : : "ebx", "ecx", "edx", "esi", "edi");
+                    : "+a" (ax), "+b" (bx)
+                    : : "ecx", "edx", "esi", "edi");
 
        /* Paranoia */
        ebx = esi = 0;
index 7f01f96c4fb8a3fa4aa563a271aa7e951674c15c..0eeef3989a17daadf47a0427edd4490b1417cf91 100644 (file)
@@ -73,15 +73,15 @@ static void keyboard_set_repeat(void)
 }
 
 /*
- * Get Intel SpeedStep IST information.
+ * Get Intel SpeedStep (IST) information.
  */
-static void query_speedstep_ist(void)
+static void query_ist(void)
 {
        asm("int $0x15"
-           : "=a" (boot_params.speedstep_info[0]),
-             "=b" (boot_params.speedstep_info[1]),
-             "=c" (boot_params.speedstep_info[2]),
-             "=d" (boot_params.speedstep_info[3])
+           : "=a" (boot_params.ist_info.signature),
+             "=b" (boot_params.ist_info.command),
+             "=c" (boot_params.ist_info.event),
+             "=d" (boot_params.ist_info.perf_level)
            : "a" (0x0000e980),  /* IST Support */
              "d" (0x47534943)); /* Request value */
 }
@@ -144,8 +144,8 @@ void main(void)
        query_voyager();
 #endif
 
-       /* Query SpeedStep IST information */
-       query_speedstep_ist();
+       /* Query Intel SpeedStep (IST) information */
+       query_ist();
 
        /* Query APM information */
 #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
index 7f7be01f44e66cd27257870d540ed38d3f1e1661..223f58fc9f46f32cff0d6e51bfe2438fb4072a34 100644 (file)
@@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI)              += boot.o
 ifneq ($(CONFIG_PCI),)
 obj-$(CONFIG_X86_IO_APIC)      += earlyquirk.o
 endif
-obj-$(CONFIG_ACPI_SLEEP)       += sleep.o wakeup.o
+obj-$(CONFIG_ACPI)             += sleep.o wakeup.o
 
 ifneq ($(CONFIG_ACPI_PROCESSOR),)
 obj-y                          += cstate.o processor.o
index d474cd639bcb8ece22f706d285950926a50541ac..7fe5da3c932e270f742290af4c35536a0ef29291 100644 (file)
@@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void)
         */
        reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
 #endif
-#ifdef CONFIG_ACPI_SLEEP
+#ifdef CONFIG_ACPI
        /*
         * Reserve low memory region for sleep support.
         */
index c3b9905af2d5024b71451e796c052a2ad1813718..1b1a1e66d099b7c5df78d91d7c4244eb51f06d4b 100644 (file)
@@ -432,7 +432,7 @@ static void __init pagetable_init (void)
        paravirt_pagetable_setup_done(pgd_base);
 }
 
-#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP)
+#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI)
 /*
  * Swap suspend & friends need this for resume because things like the intel-agp
  * driver might have split up a kernel 4MB mapping.
index e13a1a1db4b5ea096b09ee18293d283f917f1d19..d1d50cd1c38a700318a02ab3678a7bb16eca743d 100644 (file)
@@ -249,11 +249,11 @@ ia32_init (void)
 
 #if PAGE_SHIFT > IA32_PAGE_SHIFT
        {
-               extern struct kmem_cache *partial_page_cachep;
+               extern struct kmem_cache *ia64_partial_page_cachep;
 
-               partial_page_cachep = kmem_cache_create("partial_page_cache",
-                                               sizeof(struct partial_page),
-                                               0, SLAB_PANIC, NULL);
+               ia64_partial_page_cachep = kmem_cache_create("ia64_partial_page_cache",
+                                       sizeof(struct ia64_partial_page),
+                                       0, SLAB_PANIC, NULL);
        }
 #endif
        return 0;
index cfa0bc0026b5dd42b283242dfb13effc0e71ca7f..466bbcb138b2f57beed7181010beeda0d2513726 100644 (file)
@@ -25,8 +25,8 @@
  * partially mapped pages provide precise accounting of which 4k sub pages
  * are mapped and which ones are not, thereby improving IA-32 compatibility.
  */
-struct partial_page {
-       struct partial_page     *next; /* linked list, sorted by address */
+struct ia64_partial_page {
+       struct ia64_partial_page *next; /* linked list, sorted by address */
        struct rb_node          pp_rb;
        /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*64
         * should suffice.*/
@@ -34,17 +34,17 @@ struct partial_page {
        unsigned int            base;
 };
 
-struct partial_page_list {
-       struct partial_page     *pp_head; /* list head, points to the lowest
+struct ia64_partial_page_list {
+       struct ia64_partial_page *pp_head; /* list head, points to the lowest
                                           * addressed partial page */
        struct rb_root          ppl_rb;
-       struct partial_page     *pp_hint; /* pp_hint->next is the last
+       struct ia64_partial_page *pp_hint; /* pp_hint->next is the last
                                           * accessed partial page */
        atomic_t                pp_count; /* reference count */
 };
 
 #if PAGE_SHIFT > IA32_PAGE_SHIFT
-struct partial_page_list* ia32_init_pp_list (void);
+struct ia64_partial_page_list* ia32_init_pp_list (void);
 #else
 # define ia32_init_pp_list()   0
 #endif
index 0afb4fe7c35b8bfeff14d1aebd0e892a7a1a1d64..af10462d44d48b10f48ad3d600b6cf8d85a9dc2f 100644 (file)
@@ -253,17 +253,17 @@ mmap_subpage (struct file *file, unsigned long start, unsigned long end, int pro
        return ret;
 }
 
-/* SLAB cache for partial_page structures */
-struct kmem_cache *partial_page_cachep;
+/* SLAB cache for ia64_partial_page structures */
+struct kmem_cache *ia64_partial_page_cachep;
 
 /*
- * init partial_page_list.
+ * init ia64_partial_page_list.
  * return 0 means kmalloc fail.
  */
-struct partial_page_list*
+struct ia64_partial_page_list*
 ia32_init_pp_list(void)
 {
-       struct partial_page_list *p;
+       struct ia64_partial_page_list *p;
 
        if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL)
                return p;
@@ -280,12 +280,12 @@ ia32_init_pp_list(void)
  * Else, return 0 and provide @pprev, @rb_link, @rb_parent to
  * be used by later __ia32_insert_pp().
  */
-static struct partial_page *
-__ia32_find_pp(struct partial_page_list *ppl, unsigned int start,
-       struct partial_page **pprev, struct rb_node ***rb_link,
+static struct ia64_partial_page *
+__ia32_find_pp(struct ia64_partial_page_list *ppl, unsigned int start,
+       struct ia64_partial_page **pprev, struct rb_node ***rb_link,
        struct rb_node **rb_parent)
 {
-       struct partial_page *pp;
+       struct ia64_partial_page *pp;
        struct rb_node **__rb_link, *__rb_parent, *rb_prev;
 
        pp = ppl->pp_hint;
@@ -297,7 +297,7 @@ __ia32_find_pp(struct partial_page_list *ppl, unsigned int start,
 
        while (*__rb_link) {
                __rb_parent = *__rb_link;
-               pp = rb_entry(__rb_parent, struct partial_page, pp_rb);
+               pp = rb_entry(__rb_parent, struct ia64_partial_page, pp_rb);
 
                if (pp->base == start) {
                        ppl->pp_hint = pp;
@@ -314,7 +314,7 @@ __ia32_find_pp(struct partial_page_list *ppl, unsigned int start,
        *rb_parent = __rb_parent;
        *pprev = NULL;
        if (rb_prev)
-               *pprev = rb_entry(rb_prev, struct partial_page, pp_rb);
+               *pprev = rb_entry(rb_prev, struct ia64_partial_page, pp_rb);
        return NULL;
 }
 
@@ -322,9 +322,9 @@ __ia32_find_pp(struct partial_page_list *ppl, unsigned int start,
  * insert @pp into @ppl.
  */
 static void
-__ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp,
-        struct partial_page *prev, struct rb_node **rb_link,
-       struct rb_node *rb_parent)
+__ia32_insert_pp(struct ia64_partial_page_list *ppl,
+       struct ia64_partial_page *pp, struct ia64_partial_page *prev,
+       struct rb_node **rb_link, struct rb_node *rb_parent)
 {
        /* link list */
        if (prev) {
@@ -334,7 +334,7 @@ __ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp,
                ppl->pp_head = pp;
                if (rb_parent)
                        pp->next = rb_entry(rb_parent,
-                               struct partial_page, pp_rb);
+                               struct ia64_partial_page, pp_rb);
                else
                        pp->next = NULL;
        }
@@ -350,8 +350,8 @@ __ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp,
  * delete @pp from partial page list @ppl.
  */
 static void
-__ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp,
-       struct partial_page *prev)
+__ia32_delete_pp(struct ia64_partial_page_list *ppl,
+       struct ia64_partial_page *pp, struct ia64_partial_page *prev)
 {
        if (prev) {
                prev->next = pp->next;
@@ -363,15 +363,15 @@ __ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp,
                        ppl->pp_hint = pp->next;
        }
        rb_erase(&pp->pp_rb, &ppl->ppl_rb);
-       kmem_cache_free(partial_page_cachep, pp);
+       kmem_cache_free(ia64_partial_page_cachep, pp);
 }
 
-static struct partial_page *
-__pp_prev(struct partial_page *pp)
+static struct ia64_partial_page *
+__pp_prev(struct ia64_partial_page *pp)
 {
        struct rb_node *prev = rb_prev(&pp->pp_rb);
        if (prev)
-               return rb_entry(prev, struct partial_page, pp_rb);
+               return rb_entry(prev, struct ia64_partial_page, pp_rb);
        else
                return NULL;
 }
@@ -383,7 +383,7 @@ __pp_prev(struct partial_page *pp)
 static void
 __ia32_delete_pp_range(unsigned int start, unsigned int end)
 {
-       struct partial_page *pp, *prev;
+       struct ia64_partial_page *pp, *prev;
        struct rb_node **rb_link, *rb_parent;
 
        if (start >= end)
@@ -401,7 +401,7 @@ __ia32_delete_pp_range(unsigned int start, unsigned int end)
        }
 
        while (pp && pp->base < end) {
-               struct partial_page *tmp = pp->next;
+               struct ia64_partial_page *tmp = pp->next;
                __ia32_delete_pp(current->thread.ppl, pp, prev);
                pp = tmp;
        }
@@ -414,7 +414,7 @@ __ia32_delete_pp_range(unsigned int start, unsigned int end)
 static int
 __ia32_set_pp(unsigned int start, unsigned int end, int flags)
 {
-       struct partial_page *pp, *prev;
+       struct ia64_partial_page *pp, *prev;
        struct rb_node ** rb_link, *rb_parent;
        unsigned int pstart, start_bit, end_bit, i;
 
@@ -450,8 +450,8 @@ __ia32_set_pp(unsigned int start, unsigned int end, int flags)
                        return 0;
        }
 
-       /* new a partial_page */
-       pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL);
+       /* new a ia64_partial_page */
+       pp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL);
        if (!pp)
                return -ENOMEM;
        pp->base = pstart;
@@ -504,7 +504,7 @@ ia32_set_pp(unsigned int start, unsigned int end, int flags)
 static int
 __ia32_unset_pp(unsigned int start, unsigned int end)
 {
-       struct partial_page *pp, *prev;
+       struct ia64_partial_page *pp, *prev;
        struct rb_node ** rb_link, *rb_parent;
        unsigned int pstart, start_bit, end_bit, i;
        struct vm_area_struct *vma;
@@ -532,8 +532,8 @@ __ia32_unset_pp(unsigned int start, unsigned int end)
                return -ENOMEM;
        }
 
-       /* new a partial_page */
-       pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL);
+       /* new a ia64_partial_page */
+       pp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL);
        if (!pp)
                return -ENOMEM;
        pp->base = pstart;
@@ -605,7 +605,7 @@ ia32_unset_pp(unsigned int *startp, unsigned int *endp)
 static int
 __ia32_compare_pp(unsigned int start, unsigned int end)
 {
-       struct partial_page *pp, *prev;
+       struct ia64_partial_page *pp, *prev;
        struct rb_node ** rb_link, *rb_parent;
        unsigned int pstart, start_bit, end_bit, size;
        unsigned int first_bit, next_zero_bit;  /* the first range in bitmap */
@@ -682,13 +682,13 @@ ia32_compare_pp(unsigned int *startp, unsigned int *endp)
 }
 
 static void
-__ia32_drop_pp_list(struct partial_page_list *ppl)
+__ia32_drop_pp_list(struct ia64_partial_page_list *ppl)
 {
-       struct partial_page *pp = ppl->pp_head;
+       struct ia64_partial_page *pp = ppl->pp_head;
 
        while (pp) {
-               struct partial_page *next = pp->next;
-               kmem_cache_free(partial_page_cachep, pp);
+               struct ia64_partial_page *next = pp->next;
+               kmem_cache_free(ia64_partial_page_cachep, pp);
                pp = next;
        }
 
@@ -696,9 +696,9 @@ __ia32_drop_pp_list(struct partial_page_list *ppl)
 }
 
 void
-ia32_drop_partial_page_list(struct task_struct *task)
+ia32_drop_ia64_partial_page_list(struct task_struct *task)
 {
-       struct partial_page_list* ppl = task->thread.ppl;
+       struct ia64_partial_page_list* ppl = task->thread.ppl;
 
        if (ppl && atomic_dec_and_test(&ppl->pp_count))
                __ia32_drop_pp_list(ppl);
@@ -708,9 +708,9 @@ ia32_drop_partial_page_list(struct task_struct *task)
  * Copy current->thread.ppl to ppl (already initialized).
  */
 static int
-__ia32_copy_pp_list(struct partial_page_list *ppl)
+__ia32_copy_pp_list(struct ia64_partial_page_list *ppl)
 {
-       struct partial_page *pp, *tmp, *prev;
+       struct ia64_partial_page *pp, *tmp, *prev;
        struct rb_node **rb_link, *rb_parent;
 
        ppl->pp_head = NULL;
@@ -721,7 +721,7 @@ __ia32_copy_pp_list(struct partial_page_list *ppl)
        prev = NULL;
 
        for (pp = current->thread.ppl->pp_head; pp; pp = pp->next) {
-               tmp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL);
+               tmp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL);
                if (!tmp)
                        return -ENOMEM;
                *tmp = *pp;
@@ -734,7 +734,8 @@ __ia32_copy_pp_list(struct partial_page_list *ppl)
 }
 
 int
-ia32_copy_partial_page_list(struct task_struct *p, unsigned long clone_flags)
+ia32_copy_ia64_partial_page_list(struct task_struct *p,
+                               unsigned long clone_flags)
 {
        int retval = 0;
 
index 103dd8edda71bc161762b810b8d792a2079570bf..c6ede8780dedc0afdf2489a55b7f9d262ca653d1 100644 (file)
@@ -67,6 +67,8 @@ EXPORT_SYMBOL(pm_power_off);
 unsigned int acpi_cpei_override;
 unsigned int acpi_cpei_phys_cpuid;
 
+unsigned long acpi_wakeup_address = 0;
+
 const char __init *
 acpi_get_sysname(void)
 {
@@ -986,4 +988,21 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
+/*
+ * acpi_save_state_mem() - save kernel state
+ *
+ * TBD when when IA64 starts to support suspend...
+ */
+int acpi_save_state_mem(void) { return 0; } 
+
+/*
+ * acpi_restore_state()
+ */
+void acpi_restore_state_mem(void) {}
+
+/*
+ * do_suspend_lowlevel()
+ */
+void do_suspend_lowlevel(void) {}
+
 #endif                         /* CONFIG_ACPI */
index 44d540efa6d1cc4efdce77a896e0aae928f2bab9..4e5e27540e278288d33911b43d0219b004bb0fec 100644 (file)
@@ -178,7 +178,7 @@ swapper_pg_dir:
 halt_msg:
        stringz "Halting kernel\n"
 
-       .text
+       .section .text.head,"ax"
 
        .global start_ap
 
@@ -392,6 +392,8 @@ self:       hint @pause
        br.sptk.many self               // endless loop
 END(_start)
 
+       .text
+
 GLOBAL_ENTRY(ia64_save_debug_regs)
        alloc r16=ar.pfs,1,0,0,0
        mov r20=ar.lc                   // preserve ar.lc
index 91797c11116218a254fdfe5496bbb19561ee9320..fcb77338cc09aaadefbe65b735f3a426d313c4ab 100644 (file)
@@ -85,8 +85,8 @@ DEFINE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq) = {
        [0 ... IA64_NUM_VECTORS - 1] = IA64_SPURIOUS_INT_VECTOR
 };
 
-static cpumask_t vector_table[IA64_MAX_DEVICE_VECTORS] = {
-       [0 ... IA64_MAX_DEVICE_VECTORS - 1] = CPU_MASK_NONE
+static cpumask_t vector_table[IA64_NUM_VECTORS] = {
+       [0 ... IA64_NUM_VECTORS - 1] = CPU_MASK_NONE
 };
 
 static int irq_status[NR_IRQS] = {
@@ -123,17 +123,18 @@ static inline int find_unassigned_irq(void)
 static inline int find_unassigned_vector(cpumask_t domain)
 {
        cpumask_t mask;
-       int pos;
+       int pos, vector;
 
        cpus_and(mask, domain, cpu_online_map);
        if (cpus_empty(mask))
                return -EINVAL;
 
        for (pos = 0; pos < IA64_NUM_DEVICE_VECTORS; pos++) {
-               cpus_and(mask, domain, vector_table[pos]);
+               vector = IA64_FIRST_DEVICE_VECTOR + pos;
+               cpus_and(mask, domain, vector_table[vector]);
                if (!cpus_empty(mask))
                        continue;
-               return IA64_FIRST_DEVICE_VECTOR + pos;
+               return vector;
        }
        return -ENOSPC;
 }
@@ -141,7 +142,7 @@ static inline int find_unassigned_vector(cpumask_t domain)
 static int __bind_irq_vector(int irq, int vector, cpumask_t domain)
 {
        cpumask_t mask;
-       int cpu, pos;
+       int cpu;
        struct irq_cfg *cfg = &irq_cfg[irq];
 
        cpus_and(mask, domain, cpu_online_map);
@@ -156,8 +157,7 @@ static int __bind_irq_vector(int irq, int vector, cpumask_t domain)
        cfg->vector = vector;
        cfg->domain = domain;
        irq_status[irq] = IRQ_USED;
-       pos = vector - IA64_FIRST_DEVICE_VECTOR;
-       cpus_or(vector_table[pos], vector_table[pos], domain);
+       cpus_or(vector_table[vector], vector_table[vector], domain);
        return 0;
 }
 
@@ -174,7 +174,7 @@ int bind_irq_vector(int irq, int vector, cpumask_t domain)
 
 static void __clear_irq_vector(int irq)
 {
-       int vector, cpu, pos;
+       int vector, cpu;
        cpumask_t mask;
        cpumask_t domain;
        struct irq_cfg *cfg = &irq_cfg[irq];
@@ -189,8 +189,7 @@ static void __clear_irq_vector(int irq)
        cfg->vector = IRQ_VECTOR_UNASSIGNED;
        cfg->domain = CPU_MASK_NONE;
        irq_status[irq] = IRQ_UNUSED;
-       pos = vector - IA64_FIRST_DEVICE_VECTOR;
-       cpus_andnot(vector_table[pos], vector_table[pos], domain);
+       cpus_andnot(vector_table[vector], vector_table[vector], domain);
 }
 
 static void clear_irq_vector(int irq)
@@ -212,9 +211,6 @@ assign_irq_vector (int irq)
        vector = -ENOSPC;
 
        spin_lock_irqsave(&vector_lock, flags);
-       if (irq < 0) {
-               goto out;
-       }
        for_each_online_cpu(cpu) {
                domain = vector_allocation_domain(cpu);
                vector = find_unassigned_vector(domain);
@@ -223,6 +219,8 @@ assign_irq_vector (int irq)
        }
        if (vector < 0)
                goto out;
+       if (irq == AUTO_ASSIGN)
+               irq = vector;
        BUG_ON(__bind_irq_vector(irq, vector, domain));
  out:
        spin_unlock_irqrestore(&vector_lock, flags);
index 13df337508e7fe5f6b626ff66735026469acb1b3..7ccb228ceedc337e90ae956ad3d1934e66c25bda 100644 (file)
 struct ia64_machine_vector ia64_mv;
 EXPORT_SYMBOL(ia64_mv);
 
-static __initdata const char *mvec_name;
-static __init int setup_mvec(char *s)
-{
-       mvec_name = s;
-       return 0;
-}
-early_param("machvec", setup_mvec);
-
 static struct ia64_machine_vector * __init
 lookup_machvec (const char *name)
 {
@@ -41,7 +33,7 @@ machvec_init (const char *name)
        struct ia64_machine_vector *mv;
 
        if (!name)
-               name = mvec_name ? mvec_name : acpi_get_sysname();
+               name = acpi_get_sysname();
        mv = lookup_machvec(name);
        if (!mv)
                panic("generic kernel failed to find machine vector for"
@@ -51,6 +43,23 @@ machvec_init (const char *name)
        printk(KERN_INFO "booting generic kernel on platform %s\n", name);
 }
 
+void __init
+machvec_init_from_cmdline(const char *cmdline)
+{
+       char str[64];
+       const char *start;
+       char *end;
+
+       if (! (start = strstr(cmdline, "machvec=")) )
+               return machvec_init(NULL);
+
+       strlcpy(str, start + strlen("machvec="), sizeof(str));
+       if ( (end = strchr(str, ' ')) )
+               *end = '\0';
+
+       return machvec_init(str);
+}
+
 #endif /* CONFIG_IA64_GENERIC */
 
 void
index fa40cba433500df6e7288903eeab205ce283f54d..4158906c45aacce3ad80bd8c203f9d34fdc2c23b 100644 (file)
@@ -499,7 +499,8 @@ copy_thread (int nr, unsigned long clone_flags,
 
                /* Copy partially mapped page list */
                if (!retval)
-                       retval = ia32_copy_partial_page_list(p, clone_flags);
+                       retval = ia32_copy_ia64_partial_page_list(p,
+                                                               clone_flags);
        }
 #endif
 
@@ -728,7 +729,7 @@ flush_thread (void)
        ia64_drop_fpu(current);
 #ifdef CONFIG_IA32_SUPPORT
        if (IS_IA32_PROCESS(task_pt_regs(current))) {
-               ia32_drop_partial_page_list(current);
+               ia32_drop_ia64_partial_page_list(current);
                current->thread.task_size = IA32_PAGE_OFFSET;
                set_fs(USER_DS);
        }
@@ -754,7 +755,7 @@ exit_thread (void)
                pfm_release_debug_registers(current);
 #endif
        if (IS_IA32_PROCESS(task_pt_regs(current)))
-               ia32_drop_partial_page_list(current);
+               ia32_drop_ia64_partial_page_list(current);
 }
 
 unsigned long
index cf06fe799041d3ed269c849970df9d121283a7af..7cecd2964200dceb63ff6273e55f7aba26b2240e 100644 (file)
@@ -491,12 +491,17 @@ setup_arch (char **cmdline_p)
        efi_init();
        io_port_init();
 
-       parse_early_param();
-
 #ifdef CONFIG_IA64_GENERIC
-       machvec_init(NULL);
+       /* machvec needs to be parsed from the command line
+        * before parse_early_param() is called to ensure
+        * that ia64_mv is initialised before any command line
+        * settings may cause console setup to occur
+        */
+       machvec_init_from_cmdline(*cmdline_p);
 #endif
 
+       parse_early_param();
+
        if (early_console_setup(*cmdline_p) == 0)
                mark_bsp_online();
 
index 9f72838db26ec52c8c0fce68f31e7f6c8b032dbb..0982882bfb80ae6cd2390045eaad15f468a94890 100644 (file)
@@ -468,7 +468,7 @@ smp_send_stop (void)
        send_IPI_allbutself(IPI_CPU_STOP);
 }
 
-int __init
+int
 setup_profiling_timer (unsigned int multiplier)
 {
        return -EINVAL;
index 9f5c90b594b9361bf839c15b99a41d89bf9f28ce..62209dcf06d3095fc403b22f3bbff96f95bdec92 100644 (file)
@@ -487,7 +487,7 @@ struct create_idle {
        int cpu;
 };
 
-void
+void __cpuinit
 do_fork_idle(struct work_struct *work)
 {
        struct create_idle *c_idle =
@@ -497,7 +497,7 @@ do_fork_idle(struct work_struct *work)
        complete(&c_idle->done);
 }
 
-static int __devinit
+static int __cpuinit
 do_boot_cpu (int sapicid, int cpu)
 {
        int timeout;
@@ -808,7 +808,7 @@ set_cpu_sibling_map(int cpu)
        }
 }
 
-int __devinit
+int __cpuinit
 __cpu_up (unsigned int cpu)
 {
        int ret;
index 860f251d2fc26f7188551b627ef76c42e5f7f1bb..83e80677de707c42776fe85bc7f38dce58219e0f 100644 (file)
@@ -50,6 +50,8 @@ SECTIONS
        KPROBES_TEXT
        *(.gnu.linkonce.t*)
     }
+  .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
+       { *(.text.head) }
   .text2 : AT(ADDR(.text2) - LOAD_OFFSET)
        { *(.text2) }
 #ifdef CONFIG_SMP
index 07d0e92742c8ee604585a526668fd0f0baac8d60..488e48a5deeaefd75d390df505a59288ccb828f4 100644 (file)
@@ -581,7 +581,7 @@ pcibios_align_resource (void *data, struct resource *res,
 /*
  * PCI BIOS setup, always defaults to SAL interface
  */
-char * __init
+char * __devinit
 pcibios_setup (char *str)
 {
        return str;
index 1175ceff8b2a4cc2cc2182c826ab54ae66aa645a..185906b54cb03ff00bd94721a652c19c76a4dc1f 100644 (file)
@@ -216,6 +216,18 @@ config XCOPILOT_BUGS
        help
          Support the bugs of Xcopilot.
 
+config UC5272
+        bool 'Arcturus Networks uC5272 dimm board support'
+        depends on M5272
+        help
+          Support for the Arcturus Networks uC5272 dimm board.
+
+config UC5282
+       bool "Arcturus Networks uC5282 board support"
+          depends on M528x
+       help
+          Support for the Arcturus Networks uC5282 dimm board.
+
 config UCSIMM
        bool "uCsimm module support"
        depends on M68EZ328
@@ -342,6 +354,18 @@ config SOM5282EM
        depends on M528x
        help
          Support for the EMAC.Inc SOM5282EM module.  
+         
+config WILDFIRE
+       bool "Intec Automation Inc. WildFire board support"
+       depends on M528x
+       help
+         Support for the Intec Automation Inc. WildFire.
+         
+config WILDFIREMOD
+       bool "Intec Automation Inc. WildFire module support"
+       depends on M528x
+       help
+         Support for the Intec Automation Inc. WildFire module.
 
 config ARN5307
        bool "Arnewsh 5307 board support"
index 8951793fd8d4aa3446bb60169e23ac807fb40aa0..1305cc98002364a7de6da2544a642b91b6cbf6d6 100644 (file)
@@ -26,6 +26,8 @@ platform-$(CONFIG_M5407)      := 5407
 PLATFORM := $(platform-y)
 
 board-$(CONFIG_PILOT)          := pilot
+board-$(CONFIG_UC5272)          := UC5272
+board-$(CONFIG_UC5282)          := UC5282
 board-$(CONFIG_UCSIMM)         := ucsimm
 board-$(CONFIG_UCDIMM)         := ucdimm
 board-$(CONFIG_UCQUICC)                := uCquicc
index 0a25874a2aaefb5c4a4821688086c075a2e00532..e10eafc52789e5f8dc3ca428449ff8fd0adb0b1e 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/string.h>
+#include <linux/device.h>
 #include <asm/io.h>
 
 void *dma_alloc_coherent(struct device *dev, size_t size,
index 2203f694f26bb303ec057debe68bd3746891d4a3..a5ac0d40fbec4c83a309b37af115512ca462b93e 100644 (file)
@@ -132,6 +132,11 @@ void setup_arch(char **cmdline_p)
 
        config_BSP(&command_line[0], sizeof(command_line));
 
+#if defined(CONFIG_BOOTPARAM)
+       strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
+       command_line[sizeof(command_line) - 1] = 0;
+#endif
+
        printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n");
 
 #ifdef CONFIG_UCDIMM
index 3343830aad10f40ce267e522ce41a51d62727a18..d265ed4e5afccdee7a5c389917ac842db089d031 100644 (file)
@@ -98,14 +98,6 @@ int mcf_timerirqpending(int timer)
 void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
-
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_timer_init;
        mach_tick = coldfire_tick;
        mach_gettimeoffset = coldfire_timer_offset;
index 0f67320b4031aaea269cfc7e7004ed9ce6ef905c..7fa5e8254c313e83cbe6071b30609589f7f96674 100644 (file)
@@ -98,15 +98,10 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#elif defined(CONFIG_NETtel)
+#if defined(CONFIG_NETtel)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0004000, size);
        commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
 #endif /* CONFIG_NETtel */
 
        mach_sched_init = coldfire_timer_init;
index 58b2878deb61e8524de686639cd63ff5ef1fa018..85830f9882f3bfde4e7496fd7ba9701d000b3ab8 100644 (file)
@@ -48,13 +48,6 @@ void mcf_autovector(unsigned int vec)
 
 void config_BSP(char *commandp, int size)
 {
-#ifdef CONFIG_BOOTPARAM
-    strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-    commandp[size-1] = 0;
-#else
-    memset(commandp, 0, size);
-#endif
-
     mach_sched_init = coldfire_pit_init;
     mach_tick = coldfire_pit_tick;
     mach_gettimeoffset = coldfire_pit_offset;
index 9b054e6caee20a22df0adb1b0d79baf7db10403d..c0157e1100356abc0b994bd35a9a8cbf60bf5407 100644 (file)
@@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec)
 void config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-
-#ifdef CONFIG_BOOTPARAM
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_pit_init;
        mach_tick = coldfire_pit_tick;
        mach_gettimeoffset = coldfire_pit_offset;
index d6706079d64ab4ba1f08a1a64aee8902ec57ab5e..4cdeb719512df8c4e2f5c23f6ac6f8b0740471b3 100644 (file)
@@ -96,14 +96,6 @@ int mcf_timerirqpending(int timer)
 void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
-
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_timer_init;
        mach_tick = coldfire_tick;
        mach_gettimeoffset = coldfire_timer_offset;
index 6b437cc977763c6f19645b5114eafb58e47bd12d..609b10e4b9b9a049a842147438ba7251330ee6c0 100644 (file)
@@ -113,10 +113,7 @@ void config_BSP(char *commandp, int size)
 
        mcf_disableall();
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
+#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0004000, size);
        commandp[size-1] = 0;
@@ -128,8 +125,6 @@ void config_BSP(char *commandp, int size)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0010000, size);
        commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
 #endif
 
        mcf_timervector = 69;
index 28e7d964eef14d85e374e609b303893a033bba9a..126dac06648200c0c38d496a367d51afa35ca2fd 100644 (file)
@@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec)
 void config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-
-#ifdef CONFIG_BOOTPARAM
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_pit_init;
        mach_tick = coldfire_pit_tick;
        mach_gettimeoffset = coldfire_pit_offset;
index 805b4f74ff1948e04638255f7b072c3670f653ef..aab1ef0c1f7837f6dbd4fb99becded00c630af07 100644 (file)
@@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec)
 void config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-
-#ifdef CONFIG_BOOTPARAM
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_pit_init;
        mach_tick = coldfire_pit_tick;
        mach_gettimeoffset = coldfire_pit_offset;
index e04b84deb57d0cfdf83a161c6cff8c7b1cd85c6c..1f10e941b87c993babacdb886610e5b3e63b200e 100644 (file)
@@ -111,10 +111,7 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
+#if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
       defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \
       defined(CONFIG_CLEOPATRA)
        /* Copy command line from FLASH to local buffer... */
@@ -124,8 +121,6 @@ void config_BSP(char *commandp, int size)
        mcf_timervector = 30;
        mcf_profilevector = 31;
        mcf_timerlevel = 6;
-#else
-       memset(commandp, 0, size);
 #endif
 
        mach_sched_init = coldfire_timer_init;
index c358aebe0af37f1f5967b56b0642719ff1661071..a8cd867805caeeffa12db832275ad8e51bbf2601 100644 (file)
@@ -213,16 +213,12 @@ ENTRY(ret_from_interrupt)
  * Beware - when entering resume, prev (the current task) is
  * in a0, next (the new task) is in a1,so don't change these
  * registers until their contents are no longer needed.
+ * This is always called in supervisor mode, so don't bother to save
+ * and restore sr; user's process sr is actually in the stack.
  */
 ENTRY(resume)
        movel   %a0, %d1                        /* get prev thread in d1 */
 
-       movew   %sr,%d0                         /* save thread status reg */
-       movew   %d0,%a0@(TASK_THREAD+THREAD_SR)
-
-       oril    #0x700,%d0                      /* disable interrupts */
-       move    %d0,%sr
-
        movel   sw_usp,%d0                      /* save usp */
        movel   %d0,%a0@(TASK_THREAD+THREAD_USP)
 
@@ -233,7 +229,4 @@ ENTRY(resume)
 
        movel   %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */
        movel   %a0, sw_usp
-
-       movew   %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */
-       movew   %d0, %sr
        rts
index 664c3a12b0c128a6f927c82fc2ab2731add26f8d..dc39c466e33f69c7309048a53e78e94f502a4730 100644 (file)
@@ -92,10 +92,7 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
+#if !defined(CONFIG_BOOTPARAM)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0x4000, 4);
        if(strncmp(commandp, "kcl ", 4) == 0){
index 036f62876241f82b4aa16c5adec42828845acf71..fde417fdd6504209b108703a5e1a40c6e534719e 100644 (file)
@@ -102,13 +102,6 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
 #if defined(CONFIG_CLEOPATRA)
        /* Different timer setup - to prevent device clash */
        mcf_timervector = 30;
index 8abe0f6e7235b8e9984adca29f5d90ada099dde8..79dced929c97aa4fa7e8363477d70a6798038a3a 100644 (file)
@@ -191,13 +191,6 @@ void config_BSP(char *command, int size)
 {
        printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(command, CONFIG_BOOTPARAM_STRING, size);
-       command[size-1] = 0;
-#else
-       memset(command, 0, size);
-#endif
-
        init_hardware(command, size);
 
        mach_sched_init = (void *) m68328_timer_init;
index a983680c326384d3125ba1d39a65163b7455bada..122537419d9f75d9f99cde8fb25c9ff35f69bc0b 100644 (file)
@@ -33,12 +33,10 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
                PowerPC,603e { /* Really 8241 */
                        device_type = "cpu";
                        reg = <0>;
-                       clock-frequency = <bebc200>;    /* Fixed by bootwrapper */
-                       timebase-frequency = <1743000>; /* Fixed by bootwrapper */
-                       bus-frequency = <0>;            /* From bootloader */
+                       clock-frequency = <bebc200>;    /* Fixed by bootloader */
+                       timebase-frequency = <1743000>; /* Fixed by bootloader */
+                       bus-frequency = <0>;            /* Fixed by bootloader */
                        /* Following required by dtc but not used */
-                       i-cache-line-size = <0>;
-                       d-cache-line-size = <0>;
                        i-cache-size = <4000>;
                        d-cache-size = <4000>;
                };
@@ -64,11 +62,19 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
                          fef00000 fef00000 00100000>;  /* pci iack */
 
                i2c@80003000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <80003000 1000>;
                        interrupts = <5 2>;
                        interrupt-parent = <&mpic>;
+
+                       rtc@32 {
+                               device_type = "rtc";
+                               compatible = "ricoh,rs5c372b";
+                               reg = <32>;
+                       };
                };
 
                serial@80004500 {
@@ -91,7 +97,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
                        interrupt-parent = <&mpic>;
                };
 
-               mpic: pic@80040000 {
+               mpic: interrupt-controller@80040000 {
                        #interrupt-cells = <2>;
                        #address-cells = <0>;
                        device_type = "open-pic";
index 5cf42dc022dfa816985eb37033b2b1427a0b1e27..579aa8b967d94be8c6b28a7aa7530ec143f6b8e2 100644 (file)
@@ -33,12 +33,10 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
                PowerPC,603e { /* Really 8241 */
                        device_type = "cpu";
                        reg = <0>;
-                       clock-frequency = <fdad680>;    /* Fixed by bootwrapper */
-                       timebase-frequency = <1F04000>; /* Fixed by bootwrapper */
-                       bus-frequency = <0>;            /* From bootloader */
+                       clock-frequency = <fdad680>;    /* Fixed by bootloader */
+                       timebase-frequency = <1F04000>; /* Fixed by bootloader */
+                       bus-frequency = <0>;            /* Fixed by bootloader */
                        /* Following required by dtc but not used */
-                       i-cache-line-size = <0>;
-                       d-cache-line-size = <0>;
                        i-cache-size = <4000>;
                        d-cache-size = <4000>;
                };
@@ -64,11 +62,19 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
                          fef00000 fef00000 00100000>;  /* pci iack */
 
                i2c@80003000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <80003000 1000>;
                        interrupts = <5 2>;
                        interrupt-parent = <&mpic>;
+
+                       rtc@32 {
+                               device_type = "rtc";
+                               compatible = "ricoh,rs5c372b";
+                               reg = <32>;
+                       };
                };
 
                serial@80004500 {
@@ -91,8 +97,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
                        interrupt-parent = <&mpic>;
                };
 
-               mpic: pic@80040000 {
-                       interrupt-parent = <&mpic>;
+               mpic: interrupt-controller@80040000 {
                        #interrupt-cells = <2>;
                        #address-cells = <0>;
                        device_type = "open-pic";
index 8cdd48ea43912d7a39c5d82c34432787a67f30b2..1448af92c6a9b36a1c6129522af1ac4c482d415b 100644 (file)
@@ -809,8 +809,9 @@ system_reset_iSeries:
        mtmsrd  r24                     /* RI on */
        lhz     r24,PACAPACAINDEX(r13)  /* Get processor # */
        cmpwi   0,r24,0                 /* Are we processor 0? */
-       beq     .__start_initialization_iSeries /* Start up the first processor */
-       mfspr   r4,SPRN_CTRLF
+       bne     1f
+       b       .__start_initialization_iSeries /* Start up the first processor */
+1:     mfspr   r4,SPRN_CTRLF
        li      r5,CTRL_RUNLATCH        /* Turn off the run light */
        andc    r4,r4,r5
        mtspr   SPRN_CTRLT,r4
@@ -1611,7 +1612,7 @@ _GLOBAL(generic_secondary_smp_init)
 #endif
 
 #ifdef CONFIG_PPC_ISERIES
-_STATIC(__start_initialization_iSeries)
+_INIT_STATIC(__start_initialization_iSeries)
        /* Clear out the BSS */
        LOAD_REG_IMMEDIATE(r11,__bss_stop)
        LOAD_REG_IMMEDIATE(r8,__bss_start)
index 601ef79a591618d75d1e0d2c919c993e6b4dc2fc..2a5cf868037083b6695670f5d99d1d6100daa5a4 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/pci.h>
 #include <linux/mm.h>
 #include <asm/io.h>
+#include <asm/pci-bridge.h>
 
 /*
  * Here comes the ppc64 implementation of the IOMAP 
@@ -136,7 +137,12 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
 
 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 {
-       /* Nothing to do */
+       if (isa_vaddr_is_ioport(addr))
+               return;
+       if (pcibios_vaddr_is_ioport(addr))
+               return;
+       iounmap(addr);
 }
+
 EXPORT_SYMBOL(pci_iomap);
 EXPORT_SYMBOL(pci_iounmap);
index 7b41a99baae4d3d95c38e985f375c6a522d8292e..083cfbdbe0b2d7ed86edeb2ab55d5a7284fd8a91 100644 (file)
@@ -101,6 +101,29 @@ void pcibios_free_controller(struct pci_controller *phb)
                kfree(phb);
 }
 
+int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+       int ret = 0;
+       struct pci_controller *hose;
+       unsigned long size;
+
+       spin_lock(&hose_spinlock);
+       list_for_each_entry(hose, &hose_list, list_node) {
+#ifdef CONFIG_PPC64
+               size = hose->pci_io_size;
+#else
+               size = hose->io_resource.end - hose->io_resource.start + 1;
+#endif
+               if (address >= hose->io_base_virt &&
+                   address < (hose->io_base_virt + size)) {
+                       ret = 1;
+                       break;
+               }
+       }
+       spin_unlock(&hose_spinlock);
+       return ret;
+}
+
 /*
  * Return the domain number for this bus.
  */
index 3786dcc8a7b62752cc51ddd3fae9dd085a2b3726..b5c96af955c639ce43ea1532423bebebf0a6b177 100644 (file)
@@ -24,7 +24,7 @@
 /* Max address size we deal with */
 #define OF_MAX_ADDR_CELLS      4
 #define OF_CHECK_COUNTS(na, ns)        ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
-                       (ns) >= 0)
+                       (ns) > 0)
 
 static struct of_bus *of_match_bus(struct device_node *np);
 static int __of_address_to_resource(struct device_node *dev,
index 4924c48cb1ffc64df621b6d2dd6790c2b0683100..50ef38cffdbfc3db60df3b3a90827daac12aef47 100644 (file)
@@ -496,6 +496,10 @@ int check_legacy_ioport(unsigned long base_port)
                        break;
                }
                np = of_find_node_by_type(NULL, "8042");
+               /* Pegasos has no device_type on its 8042 node, look for the
+                * name instead */
+               if (!np)
+                       np = of_find_node_by_name(NULL, "8042");
                break;
        case FDC_BASE: /* FDC1 */
                np = of_find_node_by_type(NULL, "fdc");
index e3a1e8dc536a5bab3ea4c48f99e530cde5971e0b..8f4d2dc4cafb0e832039799c364d8bccfc67d51b 100644 (file)
@@ -138,8 +138,8 @@ void __init lmb_analyze(void)
 static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
                                  unsigned long size)
 {
-       unsigned long i, coalesced = 0;
-       long adjacent;
+       unsigned long coalesced = 0;
+       long adjacent, i;
 
        /* First try and coalesce this LMB with another. */
        for (i=0; i < rgn->cnt; i++) {
index 6694f86d7000899d6bb67080cc80cd93557f4d04..9cb081c26e7120f5ca84c8ecb2e7ff7ae7814df4 100644 (file)
@@ -59,7 +59,8 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
        INIT_LIST_HEAD(&ctx->aff_list);
        if (gang)
                spu_gang_add_ctx(gang, ctx);
-       ctx->cpus_allowed = current->cpus_allowed;
+
+       __spu_update_sched_info(ctx);
        spu_set_timeslice(ctx);
        ctx->stats.util_state = SPU_UTIL_IDLE_LOADED;
 
index 0b50fa5cb39d5af406047391ad7914eafd31d9be..6abdd8fe2098f29591a31ebd65a14952899067d4 100644 (file)
@@ -312,6 +312,7 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
        spu_acquire(ctx);
        if (ctx->state == SPU_STATE_SAVED) {
                __spu_update_sched_info(ctx);
+               spu_set_timeslice(ctx);
 
                ret = spu_activate(ctx, 0);
                if (ret) {
@@ -322,6 +323,9 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
                /*
                 * We have to update the scheduling priority under active_mutex
                 * to protect against find_victim().
+                *
+                * No need to update the timeslice ASAP, it will get updated
+                * once the current one has expired.
                 */
                spu_update_sched_info(ctx);
        }
index 227968b4779d3adc531fac2a71ef68dd1f18c386..758a80ac080a09fc177d8b43bb10e6166ece8a56 100644 (file)
@@ -927,10 +927,6 @@ int __init spu_sched_init(void)
                INIT_LIST_HEAD(&spu_prio->runq[i]);
                __clear_bit(i, spu_prio->bitmap);
        }
-       for (i = 0; i < MAX_NUMNODES; i++) {
-               mutex_init(&cbe_spu_info[i].list_mutex);
-               INIT_LIST_HEAD(&cbe_spu_info[i].spus);
-       }
        spin_lock_init(&spu_prio->runq_lock);
 
        setup_timer(&spusched_timer, spusched_wake, 0);
index 91df52a1899addd4aeaec8b39d1d5f9809cccc19..34bdbbe3ce590a73a70d04e5d91732189f1b43cb 100644 (file)
@@ -182,7 +182,7 @@ static int set_spread_lpevents(char *str)
 }
 __setup("spread_lpevents=", set_spread_lpevents);
 
-void setup_hvlpevent_queue(void)
+void __init setup_hvlpevent_queue(void)
 {
        void *eventStack;
 
index fceaae40fe7033c70947f3c9f65680d2b0671c0a..2542403288f92dd769e0e6d2b28d4228e649e894 100644 (file)
@@ -490,6 +490,9 @@ static int __init maple_add_bridge(struct device_node *dev)
        /* Fixup "bus-range" OF property */
        fixup_bus_range(dev);
 
+       /* Check for legacy IOs */
+       isa_bridge_find_early(hose);
+
        return 0;
 }
 
index 3289fab01e9245a49919a61d5ecdc285a2a49810..727453d3e8b919cac9d5d435a5980842abc46cbd 100644 (file)
@@ -305,6 +305,64 @@ err:
 
 arch_initcall(gfar_of_init);
 
+#ifdef CONFIG_I2C_BOARDINFO
+#include <linux/i2c.h>
+struct i2c_driver_device {
+       char    *of_device;
+       char    *i2c_driver;
+       char    *i2c_type;
+};
+
+static struct i2c_driver_device i2c_devices[] __initdata = {
+       {"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",},
+       {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
+       {"ricoh,rv5c386",  "rtc-rs5c372", "rv5c386",},
+       {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
+};
+
+static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
+               if (!of_device_is_compatible(node, i2c_devices[i].of_device))
+                       continue;
+               strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN);
+               strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
+               return 0;
+       }
+       return -ENODEV;
+}
+
+static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num)
+{
+       struct device_node *node = NULL;
+
+       while ((node = of_get_next_child(adap_node, node))) {
+               struct i2c_board_info info;
+               const u32 *addr;
+               int len;
+
+               addr = of_get_property(node, "reg", &len);
+               if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
+                       printk(KERN_WARNING "fsl_ioc.c: invalid i2c device entry\n");
+                       continue;
+               }
+
+               info.irq = irq_of_parse_and_map(node, 0);
+               if (info.irq == NO_IRQ)
+                       info.irq = -1;
+
+               if (of_find_i2c_driver(node, &info) < 0)
+                       continue;
+
+               info.platform_data = NULL;
+               info.addr = *addr;
+
+               i2c_register_board_info(bus_num, &info, 1);
+       }
+}
+
 static int __init fsl_i2c_of_init(void)
 {
        struct device_node *np;
@@ -349,6 +407,8 @@ static int __init fsl_i2c_of_init(void)
                                                    fsl_i2c_platform_data));
                if (ret)
                        goto unreg;
+
+               of_register_i2c_devices(np, i);
        }
 
        return 0;
@@ -360,6 +420,7 @@ err:
 }
 
 arch_initcall(fsl_i2c_of_init);
+#endif
 
 #ifdef CONFIG_PPC_83xx
 static int __init mpc83xx_wdt_init(void)
index 080b9963f1bc1a6f0213a8a59b7ef8898f6d829c..17595d23fee7be9c3e873ce9095d71fe0efa9a04 100644 (file)
@@ -1,6 +1,6 @@
 obj-y                  := boot.o
 boot-y                 := ../../../i386/kernel/acpi/boot.o
-obj-$(CONFIG_ACPI_SLEEP)       += sleep.o wakeup.o
+obj-y                  += sleep.o wakeup.o
 
 ifneq ($(CONFIG_ACPI_PROCESSOR),)
 obj-y                  += processor.o
index 4277f2b27e6dc8b4fb007546fe7a63cf5ed77f92..79475d2370713a96cff45a1cc5aada1a4eedc093 100644 (file)
@@ -51,8 +51,6 @@
                               Low-Level Sleep Support
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_SLEEP
-
 /* address in low memory of the wakeup routine. */
 unsigned long acpi_wakeup_address = 0;
 unsigned long acpi_realmode_flags;
@@ -117,8 +115,6 @@ static int __init acpi_sleep_setup(char *str)
 
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-#endif                         /*CONFIG_ACPI_SLEEP */
-
 void acpi_pci_link_exit(void)
 {
 }
index e89abcdbdde8172e25d6dff0ddb8323471495c66..3a16e417dd8dae1fc448043386041d9e211aca0c 100644 (file)
@@ -120,7 +120,7 @@ ident_complete:
        addq    %rbp, trampoline_level4_pgt + 0(%rip)
        addq    %rbp, trampoline_level4_pgt + (511*8)(%rip)
 #endif
-#ifdef CONFIG_ACPI_SLEEP
+#ifdef CONFIG_ACPI
        addq    %rbp, wakeup_level4_pgt + 0(%rip)
        addq    %rbp, wakeup_level4_pgt + (511*8)(%rip)
 #endif
index af838f6b0b7fc9b7e3ed4de0ab12992e48cf9f18..0f400f3c469494894b37d68f7d2badf44a246e97 100644 (file)
@@ -333,7 +333,7 @@ void __init setup_arch(char **cmdline_p)
        reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE);
 #endif
 
-#ifdef CONFIG_ACPI_SLEEP
+#ifdef CONFIG_ACPI
        /*
         * Reserve low memory region for sleep support.
         */
index 408b45168aba324a8e12e26a140dc244011c2837..251344cb29aea1f04f2e42935b52c68c09103ba3 100644 (file)
@@ -11,6 +11,9 @@ menuconfig ACPI
        depends on PCI
        depends on PM
        select PNP
+       # for sleep
+       select HOTPLUG_CPU if X86 && SMP
+       select SUSPEND_SMP if X86 && SMP
        default y
        ---help---
          Advanced Configuration and Power Interface (ACPI) support for 
@@ -42,51 +45,26 @@ menuconfig ACPI
 
 if ACPI
 
-config ACPI_SLEEP
-       bool "Sleep States"
-       depends on X86 && (!SMP || SUSPEND_SMP)
-       default y
-       ---help---
-         This option adds support for ACPI suspend states. 
-
-         With this option, you will be able to put the system "to sleep". 
-         Sleep states are low power states for the system and devices. All
-         of the system operating state is saved to either memory or disk
-         (depending on the state), to allow the system to resume operation
-         quickly at your request.
-
-         Although this option sounds really nifty, barely any of the device
-         drivers have been converted to the new driver model and hence few
-         have proper power management support. 
-
-         This option is not recommended for anyone except those doing driver
-         power management development.
-
-config ACPI_SLEEP_PROC_FS
-       bool
-       depends on ACPI_SLEEP && PROC_FS
-       default y
-
-config ACPI_SLEEP_PROC_SLEEP
-       bool "/proc/acpi/sleep (deprecated)"
-       depends on ACPI_SLEEP_PROC_FS
-       default n
-       ---help---
-         Create /proc/acpi/sleep
-         Deprecated by /sys/power/state
-
 config ACPI_PROCFS
-       bool "Procfs interface (deprecated)"
-       default y
+       bool "Deprecated /proc/acpi files"
+       depends on PROC_FS
        ---help---
-         The Procfs interface for ACPI is made optional for backward compatibility.
-         As the same functions are duplicated in the sysfs interface
-         and this proc interface will be removed some time later,
-         it's marked as deprecated.
-         ( /proc/acpi/debug_layer && debug_level are deprecated by
-           /sys/module/acpi/parameters/debug_layer && debug_level.
-           /proc/acpi/info is deprecated by
-           /sys/module/acpi/parameters/acpica_version )
+         For backwards compatibility, this option allows
+         depricated /proc/acpi/ files to exist, even when
+         they have been replaced by functions in /sys.
+         The deprecated files (and their replacements) include:
+
+         /proc/acpi/sleep (/sys/power/state)
+         /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version)
+         /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT)
+         /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP)
+         /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer)
+         /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level)
+
+         This option has no effect on /proc/acpi/ files
+         and functions which do not yet exist in /sys.
+
+         Say N to delete /proc/acpi/ files that have moved to /sys/
 
 config ACPI_AC
        tristate "AC Adapter"
index 37c7dc4f9fe5db6d15b7bba43803790f0c0ee588..d8b35093527a3bbb8962c180b1b7792f5a2eb48b 100644 (file)
@@ -34,7 +34,6 @@
 
 #define ACPI_AC_COMPONENT              0x00020000
 #define ACPI_AC_CLASS                  "ac_adapter"
-#define ACPI_AC_HID                    "ACPI0003"
 #define ACPI_AC_DEVICE_NAME            "AC Adapter"
 #define ACPI_AC_FILE_STATE             "state"
 #define ACPI_AC_NOTIFY_STATUS          0x80
@@ -56,10 +55,16 @@ static int acpi_ac_add(struct acpi_device *device);
 static int acpi_ac_remove(struct acpi_device *device, int type);
 static int acpi_ac_open_fs(struct inode *inode, struct file *file);
 
+const static struct acpi_device_id ac_device_ids[] = {
+       {"ACPI0003", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, ac_device_ids);
+
 static struct acpi_driver acpi_ac_driver = {
        .name = "ac",
        .class = ACPI_AC_CLASS,
-       .ids = ACPI_AC_HID,
+       .ids = ac_device_ids,
        .ops = {
                .add = acpi_ac_add,
                .remove = acpi_ac_remove,
index e65628a030852a736ab40a59407d1af14a883888..5f1127ad5a9538fde4cdaa8e4a6658f2880928a7 100644 (file)
@@ -53,10 +53,16 @@ static int acpi_memory_device_add(struct acpi_device *device);
 static int acpi_memory_device_remove(struct acpi_device *device, int type);
 static int acpi_memory_device_start(struct acpi_device *device);
 
+static const struct acpi_device_id memory_device_ids[] = {
+       {ACPI_MEMORY_DEVICE_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, memory_device_ids);
+
 static struct acpi_driver acpi_memory_device_driver = {
        .name = "acpi_memhotplug",
        .class = ACPI_MEMORY_DEVICE_CLASS,
-       .ids = ACPI_MEMORY_DEVICE_HID,
+       .ids = memory_device_ids,
        .ops = {
                .add = acpi_memory_device_add,
                .remove = acpi_memory_device_remove,
index 3cd79caad70c5c56f1da00ea016109e0b940e1d1..9c4bd220c44fdf30381046b169c336365f10214a 100644 (file)
@@ -56,7 +56,6 @@
 #define ACPI_HOTK_NAME          "Asus Laptop ACPI Extras Driver"
 #define ACPI_HOTK_CLASS         "hotkey"
 #define ACPI_HOTK_DEVICE_NAME   "Hotkey"
-#define ACPI_HOTK_HID           "ATK0100"
 
 /*
  * Some events we use, same for all Asus
@@ -426,14 +425,20 @@ static struct acpi_table_header *asus_info;
 static struct asus_hotk *hotk;
 
 /*
- * The hotkey driver declaration
+ * The hotkey driver and autoloading declaration
  */
 static int asus_hotk_add(struct acpi_device *device);
 static int asus_hotk_remove(struct acpi_device *device, int type);
+static const struct acpi_device_id asus_device_ids[] = {
+       {"ATK0100", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, asus_device_ids);
+
 static struct acpi_driver asus_hotk_driver = {
        .name = "asus_acpi",
        .class = ACPI_HOTK_CLASS,
-       .ids = ACPI_HOTK_HID,
+       .ids = asus_device_ids,
        .ops = {
                .add = asus_hotk_add,
                .remove = asus_hotk_remove,
index cad932de383d02c3f3426f3784a9ff2190a1e4b2..81651032791b32364e3ed3b4cc45c0341a9db355 100644 (file)
@@ -41,7 +41,6 @@
 
 #define ACPI_BATTERY_COMPONENT         0x00040000
 #define ACPI_BATTERY_CLASS             "battery"
-#define ACPI_BATTERY_HID               "PNP0C0A"
 #define ACPI_BATTERY_DEVICE_NAME       "Battery"
 #define ACPI_BATTERY_NOTIFY_STATUS     0x80
 #define ACPI_BATTERY_NOTIFY_INFO       0x81
@@ -74,10 +73,16 @@ static int acpi_battery_add(struct acpi_device *device);
 static int acpi_battery_remove(struct acpi_device *device, int type);
 static int acpi_battery_resume(struct acpi_device *device);
 
+static const struct acpi_device_id battery_device_ids[] = {
+       {"PNP0C0A", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, battery_device_ids);
+
 static struct acpi_driver acpi_battery_driver = {
        .name = "battery",
        .class = ACPI_BATTERY_CLASS,
-       .ids = ACPI_BATTERY_HID,
+       .ids = battery_device_ids,
        .ops = {
                .add = acpi_battery_add,
                .resume = acpi_battery_resume,
index cb4110b50cd0f19f15b0f6c6d124861bd62a82ef..540581338ef5fbd2dcc6d480652d2b63551af1cb 100644 (file)
@@ -66,6 +66,16 @@ MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION("ACPI Button Driver");
 MODULE_LICENSE("GPL");
 
+static const struct acpi_device_id button_device_ids[] = {
+       {ACPI_BUTTON_HID_LID,    0},
+       {ACPI_BUTTON_HID_SLEEP,  0},
+       {ACPI_BUTTON_HID_SLEEPF, 0},
+       {ACPI_BUTTON_HID_POWER,  0},
+       {ACPI_BUTTON_HID_POWERF, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, button_device_ids);
+
 static int acpi_button_add(struct acpi_device *device);
 static int acpi_button_remove(struct acpi_device *device, int type);
 static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
@@ -74,7 +84,7 @@ static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
 static struct acpi_driver acpi_button_driver = {
        .name = "button",
        .class = ACPI_BUTTON_CLASS,
-       .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E",
+       .ids = button_device_ids,
        .ops = {
                .add = acpi_button_add,
                .remove = acpi_button_remove,
index 0dd3bf7c0ed1f7c281dc576ac50fa436e97f2118..3c25ec7a187142dc224c748dcb481601df626501 100644 (file)
@@ -52,10 +52,18 @@ MODULE_LICENSE("GPL");
 static int acpi_container_add(struct acpi_device *device);
 static int acpi_container_remove(struct acpi_device *device, int type);
 
+static const struct acpi_device_id container_device_ids[] = {
+       {"ACPI0004", 0},
+       {"PNP0A05", 0},
+       {"PNP0A06", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, container_device_ids);
+
 static struct acpi_driver acpi_container_driver = {
        .name = "container",
        .class = ACPI_CONTAINER_CLASS,
-       .ids = "ACPI0004,PNP0A05,PNP0A06",
+       .ids = container_device_ids,
        .ops = {
                .add = acpi_container_add,
                .remove = acpi_container_remove,
index 10e851021ecabcc01e2c86354401eeda2b3cbd47..469f3f57f88133c43ad30f492fb8b7c28fd8658d 100644 (file)
@@ -41,7 +41,6 @@
 #include <acpi/actypes.h>
 
 #define ACPI_EC_CLASS                  "embedded_controller"
-#define ACPI_EC_HID                    "PNP0C09"
 #define ACPI_EC_DEVICE_NAME            "Embedded Controller"
 #define ACPI_EC_FILE_INFO              "info"
 
@@ -82,10 +81,15 @@ static int acpi_ec_start(struct acpi_device *device);
 static int acpi_ec_stop(struct acpi_device *device, int type);
 static int acpi_ec_add(struct acpi_device *device);
 
+static const struct acpi_device_id ec_device_ids[] = {
+       {"PNP0C09", 0},
+       {"", 0},
+};
+
 static struct acpi_driver acpi_ec_driver = {
        .name = "ec",
        .class = ACPI_EC_CLASS,
-       .ids = ACPI_EC_HID,
+       .ids = ec_device_ids,
        .ops = {
                .add = acpi_ec_add,
                .remove = acpi_ec_remove,
index 23ee7bc4a705459579f5122c31ea368bb43235d8..b1aaa0e84588f136b0d17b4bb7f71a78fe4313aa 100644 (file)
@@ -378,7 +378,7 @@ static u8 acpi_ev_match_pci_root_bridge(char *id)
 static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
 {
        acpi_status status;
-       struct acpi_device_id hid;
+       struct acpica_device_id hid;
        struct acpi_compatible_id_list *cid;
        acpi_native_uint i;
 
index ec655c53949225080bd90c76143831994f40444e..c81f6bdb68b8a8271e5a3d525effe39ea8b3ae18 100644 (file)
@@ -50,10 +50,16 @@ static int acpi_fan_remove(struct acpi_device *device, int type);
 static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
 static int acpi_fan_resume(struct acpi_device *device);
 
+static const struct acpi_device_id fan_device_ids[] = {
+       {"PNP0C0B", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, fan_device_ids);
+
 static struct acpi_driver acpi_fan_driver = {
        .name = "fan",
        .class = ACPI_FAN_CLASS,
-       .ids = "PNP0C0B",
+       .ids = fan_device_ids,
        .ops = {
                .add = acpi_fan_add,
                .remove = acpi_fan_remove,
index be4f2899de74e6b6d91af7978f6f411452f1391b..ab65b2c2560ec5901c743245d73716683093b070 100644 (file)
@@ -440,7 +440,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
        acpi_status status;
        struct acpi_namespace_node *node;
        u32 flags;
-       struct acpi_device_id hid;
+       struct acpica_device_id hid;
        struct acpi_compatible_id_list *cid;
        acpi_native_uint i;
 
index 3448edd61dc406d977afb3b90ec28b3a5e9dfc17..c9f526e55392b1260fb6896772b0ba77ef2ace8a 100644 (file)
@@ -46,7 +46,6 @@
 #define _COMPONENT             ACPI_PCI_COMPONENT
 ACPI_MODULE_NAME("pci_link");
 #define ACPI_PCI_LINK_CLASS            "pci_irq_routing"
-#define ACPI_PCI_LINK_HID              "PNP0C0F"
 #define ACPI_PCI_LINK_DEVICE_NAME      "PCI Interrupt Link"
 #define ACPI_PCI_LINK_FILE_INFO                "info"
 #define ACPI_PCI_LINK_FILE_STATUS      "state"
@@ -54,10 +53,16 @@ ACPI_MODULE_NAME("pci_link");
 static int acpi_pci_link_add(struct acpi_device *device);
 static int acpi_pci_link_remove(struct acpi_device *device, int type);
 
+static struct acpi_device_id link_device_ids[] = {
+       {"PNP0C0F", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, link_device_ids);
+
 static struct acpi_driver acpi_pci_link_driver = {
        .name = "pci_link",
        .class = ACPI_PCI_LINK_CLASS,
-       .ids = ACPI_PCI_LINK_HID,
+       .ids = link_device_ids,
        .ops = {
                .add = acpi_pci_link_add,
                .remove = acpi_pci_link_remove,
index ad4145a37786d93a974455575a411b080c4aad63..f14ff1ffab29c24156d2cff92d75340460337745 100644 (file)
 #define _COMPONENT             ACPI_PCI_COMPONENT
 ACPI_MODULE_NAME("pci_root");
 #define ACPI_PCI_ROOT_CLASS            "pci_bridge"
-#define ACPI_PCI_ROOT_HID              "PNP0A03"
 #define ACPI_PCI_ROOT_DEVICE_NAME      "PCI Root Bridge"
 static int acpi_pci_root_add(struct acpi_device *device);
 static int acpi_pci_root_remove(struct acpi_device *device, int type);
 static int acpi_pci_root_start(struct acpi_device *device);
 
+static struct acpi_device_id root_device_ids[] = {
+       {"PNP0A03", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, root_device_ids);
+
 static struct acpi_driver acpi_pci_root_driver = {
        .name = "pci_root",
        .class = ACPI_PCI_ROOT_CLASS,
-       .ids = ACPI_PCI_ROOT_HID,
+       .ids = root_device_ids,
        .ops = {
                .add = acpi_pci_root_add,
                .remove = acpi_pci_root_remove,
index 4ffecd17970277f46967bb959bce94c15dacffe0..57b9a2998fd0ce54e76f5ee22f0bb62a60dbdcbe 100644 (file)
@@ -59,10 +59,16 @@ static int acpi_power_remove(struct acpi_device *device, int type);
 static int acpi_power_resume(struct acpi_device *device);
 static int acpi_power_open_fs(struct inode *inode, struct file *file);
 
+static struct acpi_device_id power_device_ids[] = {
+       {ACPI_POWER_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, power_device_ids);
+
 static struct acpi_driver acpi_power_driver = {
        .name = "power",
        .class = ACPI_POWER_CLASS,
-       .ids = ACPI_POWER_HID,
+       .ids = power_device_ids,
        .ops = {
                .add = acpi_power_add,
                .remove = acpi_power_remove,
index 81aceb5da7c7948f905787fd040c5b9f7f810c1b..498422343f38a64550532c9ab8733d94397322d5 100644 (file)
@@ -88,10 +88,16 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr);
 extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
 
 
+static const struct acpi_device_id processor_device_ids[] = {
+       {ACPI_PROCESSOR_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, processor_device_ids);
+
 static struct acpi_driver acpi_processor_driver = {
        .name = "processor",
        .class = ACPI_PROCESSOR_CLASS,
-       .ids = ACPI_PROCESSOR_HID,
+       .ids = processor_device_ids,
        .ops = {
                .add = acpi_processor_add,
                .remove = acpi_processor_remove,
index 3f55d1f90c1170d0e308693076b822c514bd65f9..0b8204e7082a366232b3d29121926ff0892f57cd 100644 (file)
@@ -47,6 +47,9 @@ ACPI_MODULE_NAME("processor_throttling");
 static int acpi_processor_get_throttling(struct acpi_processor *pr);
 int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
 
+/*
+ * _TPC - Throttling Present Capabilities
+ */
 static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
 {
        acpi_status status = 0;
@@ -55,8 +58,10 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
        if (!pr)
                return -EINVAL;
        status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
-       if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
-               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
+       if (ACPI_FAILURE(status)) {
+               if (status != AE_NOT_FOUND) {
+                       ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
+               }
                return -ENODEV;
        }
        pr->throttling_platform_limit = (int)tpc;
@@ -68,9 +73,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
        return acpi_processor_get_platform_limit(pr);
 }
 
-/* --------------------------------------------------------------------------
-                             _PTC, _TSS, _TSD support 
  -------------------------------------------------------------------------- */
+/*
+ * _PTC - Processor Throttling Control (and status) register location
+ */
 static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
 {
        int result = 0;
@@ -81,7 +86,9 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
 
        status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC"));
+               if (status != AE_NOT_FOUND) {
+                       ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC"));
+               }
                return -ENODEV;
        }
 
@@ -132,6 +139,10 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
 
        return result;
 }
+
+/*
+ * _TSS - Throttling Supported States
+ */
 static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
 {
        int result = 0;
@@ -144,7 +155,9 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
 
        status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS"));
+               if (status != AE_NOT_FOUND) {
+                       ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS"));
+               }
                return -ENODEV;
        }
 
@@ -201,6 +214,10 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
 
        return result;
 }
+
+/*
+ * _TSD - T-State Dependencies
+ */
 static int acpi_processor_get_tsd(struct acpi_processor *pr)
 {
        int result = 0;
@@ -213,6 +230,9 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
 
        status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
+               if (status != AE_NOT_FOUND) {
+                       ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD"));
+               }
                return -ENODEV;
        }
 
@@ -525,9 +545,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        int result = 0;
        int step = 0;
        int i = 0;
-       int no_ptc = 0;
-       int no_tss = 0;
-       int no_tsd = 0;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
@@ -538,12 +555,14 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        if (!pr)
                return -EINVAL;
 
-       /* TBD: Support ACPI 2.0 objects */
-       no_ptc = acpi_processor_get_throttling_control(pr);
-       no_tss = acpi_processor_get_throttling_states(pr);
-       no_tsd = acpi_processor_get_tsd(pr);
-
-       if (no_ptc || no_tss) {
+       /*
+        * Evaluate _PTC, _TSS and _TPC
+        * They must all be present or none of them can be used.
+        */
+       if (acpi_processor_get_throttling_control(pr) ||
+               acpi_processor_get_throttling_states(pr) ||
+               acpi_processor_get_platform_limit(pr))
+       {
                pr->throttling.acpi_processor_get_throttling =
                    &acpi_processor_get_throttling_fadt;
                pr->throttling.acpi_processor_set_throttling =
@@ -555,6 +574,8 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
                    &acpi_processor_set_throttling_ptc;
        }
 
+       acpi_processor_get_tsd(pr);
+
        if (!pr->throttling.address) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
                return 0;
@@ -658,18 +679,20 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
                   pr->throttling.state_count - 1);
 
        seq_puts(seq, "states:\n");
-       if (acpi_processor_get_throttling == acpi_processor_get_throttling_fadt)
+       if (pr->throttling.acpi_processor_get_throttling ==
+                       acpi_processor_get_throttling_fadt) {
                for (i = 0; i < pr->throttling.state_count; i++)
                        seq_printf(seq, "   %cT%d:                  %02d%%\n",
                                   (i == pr->throttling.state ? '*' : ' '), i,
                                   (pr->throttling.states[i].performance ? pr->
                                    throttling.states[i].performance / 10 : 0));
-       else
+       } else {
                for (i = 0; i < pr->throttling.state_count; i++)
                        seq_printf(seq, "   %cT%d:                  %02d%%\n",
                                   (i == pr->throttling.state ? '*' : ' '), i,
                                   (int)pr->throttling.states_tss[i].
                                   freqpercentage);
+       }
 
       end:
        return 0;
index 974d00ccfe845209c6ced6ec09278f5dbe8b49bf..7d8e78ea13a514c4969aaecc069b73f2a3b400d8 100644 (file)
@@ -38,7 +38,6 @@
 #define ACPI_SBS_CLASS                 "sbs"
 #define ACPI_AC_CLASS                  "ac_adapter"
 #define ACPI_BATTERY_CLASS             "battery"
-#define ACPI_SBS_HID                   "ACPI0002"
 #define ACPI_SBS_DEVICE_NAME           "Smart Battery System"
 #define ACPI_SBS_FILE_INFO             "info"
 #define ACPI_SBS_FILE_STATE            "state"
@@ -124,10 +123,17 @@ static int acpi_sbs_add(struct acpi_device *device);
 static int acpi_sbs_remove(struct acpi_device *device, int type);
 static int acpi_sbs_resume(struct acpi_device *device);
 
+static const struct acpi_device_id sbs_device_ids[] = {
+       {"ACPI0001", 0},
+       {"ACPI0005", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, sbs_device_ids);
+
 static struct acpi_driver acpi_sbs_driver = {
        .name = "sbs",
        .class = ACPI_SBS_CLASS,
-       .ids = "ACPI0001,ACPI0005",
+       .ids = sbs_device_ids,
        .ops = {
                .add = acpi_sbs_add,
                .remove = acpi_sbs_remove,
index 6b3b8a522476f463ffb4d0df5c77fa799ad76b1b..be74347d135435e5c5b4508b8144528bc58a0459 100644 (file)
@@ -16,7 +16,7 @@ ACPI_MODULE_NAME("scan");
 extern struct acpi_device *acpi_root;
 
 #define ACPI_BUS_CLASS                 "system_bus"
-#define ACPI_BUS_HID                   "ACPI_BUS"
+#define ACPI_BUS_HID                   "LNXSYBUS"
 #define ACPI_BUS_DEVICE_NAME           "System Bus"
 
 static LIST_HEAD(acpi_device_list);
@@ -29,6 +29,62 @@ struct acpi_device_bus_id{
        unsigned int instance_no;
        struct list_head node;
 };
+
+/*
+ * Creates hid/cid(s) string needed for modalias and uevent
+ * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get:
+ * char *modalias: "acpi:IBM0001:ACPI0001"
+*/
+int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){
+
+       int len;
+
+       if (!acpi_dev->flags.hardware_id)
+               return -ENODEV;
+
+       len = snprintf(modalias, size, "acpi:%s:",
+                      acpi_dev->pnp.hardware_id);
+       if (len < 0 || len >= size)
+               return -EINVAL;
+       size -= len;
+
+       if (acpi_dev->flags.compatible_ids) {
+               struct acpi_compatible_id_list *cid_list;
+               int i;
+               int count;
+
+               cid_list = acpi_dev->pnp.cid_list;
+               for (i = 0; i < cid_list->count; i++) {
+                       count = snprintf(&modalias[len], size, "%s:",
+                                        cid_list->id[i].value);
+                       if (count < 0 || count >= size) {
+                               printk(KERN_ERR "acpi: %s cid[%i] exceeds event buffer size",
+                                      acpi_dev->pnp.device_name, i);
+                               break;
+                       }
+                       len += count;
+                       size -= count;
+               }
+       }
+
+       modalias[len] = '\0';
+       return len;
+}
+
+static ssize_t
+acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf) {
+       struct acpi_device *acpi_dev = to_acpi_device(dev);
+       int len;
+
+       /* Device has no HID and no CID or string is >1024 */
+       len = create_modalias(acpi_dev, buf, 1024);
+       if (len <= 0)
+               return 0;
+       buf[len++] = '\n';
+       return len;
+}
+static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
+
 static int acpi_eject_operation(acpi_handle handle, int lockable)
 {
        struct acpi_object_list arg_list;
@@ -154,6 +210,12 @@ static int acpi_device_setup_files(struct acpi_device *dev)
                        goto end;
        }
 
+       if (dev->flags.hardware_id || dev->flags.compatible_ids){
+               result = device_create_file(&dev->dev, &dev_attr_modalias);
+               if(result)
+                       goto end;
+       }
+
         /*
          * If device has _EJ0, 'eject' file is created that is used to trigger
          * hot-removal function from userland.
@@ -178,6 +240,9 @@ static void acpi_device_remove_files(struct acpi_device *dev)
        if (ACPI_SUCCESS(status))
                device_remove_file(&dev->dev, &dev_attr_eject);
 
+       if (dev->flags.hardware_id || dev->flags.compatible_ids)
+               device_remove_file(&dev->dev, &dev_attr_modalias);
+
        if(dev->flags.hardware_id)
                device_remove_file(&dev->dev, &dev_attr_hid);
        if(dev->handle)
@@ -186,6 +251,37 @@ static void acpi_device_remove_files(struct acpi_device *dev)
 /* --------------------------------------------------------------------------
                        ACPI Bus operations
    -------------------------------------------------------------------------- */
+
+int acpi_match_device_ids(struct acpi_device *device,
+                         const struct acpi_device_id *ids)
+{
+       const struct acpi_device_id *id;
+
+       if (device->flags.hardware_id) {
+               for (id = ids; id->id[0]; id++) {
+                       if (!strcmp((char*)id->id, device->pnp.hardware_id))
+                               return 0;
+               }
+       }
+
+       if (device->flags.compatible_ids) {
+               struct acpi_compatible_id_list *cid_list = device->pnp.cid_list;
+               int i;
+
+               for (id = ids; id->id[0]; id++) {
+                       /* compare multiple _CID entries against driver ids */
+                       for (i = 0; i < cid_list->count; i++) {
+                               if (!strcmp((char*)id->id,
+                                           cid_list->id[i].value))
+                                       return 0;
+                       }
+               }
+       }
+
+       return -ENOENT;
+}
+EXPORT_SYMBOL(acpi_match_device_ids);
+
 static void acpi_device_release(struct device *dev)
 {
        struct acpi_device *acpi_dev = to_acpi_device(dev);
@@ -219,37 +315,19 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv)
        struct acpi_device *acpi_dev = to_acpi_device(dev);
        struct acpi_driver *acpi_drv = to_acpi_driver(drv);
 
-       return !acpi_match_ids(acpi_dev, acpi_drv->ids);
+       return !acpi_match_device_ids(acpi_dev, acpi_drv->ids);
 }
 
 static int acpi_device_uevent(struct device *dev, char **envp, int num_envp,
-       char *buffer, int buffer_size)
+                             char *buffer, int buffer_size)
 {
        struct acpi_device *acpi_dev = to_acpi_device(dev);
-       int i = 0, length = 0, ret = 0;
-
-       if (acpi_dev->flags.hardware_id)
-               ret = add_uevent_var(envp, num_envp, &i,
-                       buffer, buffer_size, &length,
-                       "HWID=%s", acpi_dev->pnp.hardware_id);
-       if (ret)
-               return -ENOMEM;
-       if (acpi_dev->flags.compatible_ids) {
-               int j;
-               struct acpi_compatible_id_list *cid_list;
 
-               cid_list = acpi_dev->pnp.cid_list;
-
-               for (j = 0; j < cid_list->count; j++) {
-                       ret = add_uevent_var(envp, num_envp, &i, buffer,
-                               buffer_size, &length, "COMPTID=%s",
-                               cid_list->id[j].value);
-                       if (ret)
-                               return -ENOMEM;
-               }
+       strcpy(buffer, "MODALIAS=");
+       if (create_modalias(acpi_dev, buffer + 9, buffer_size - 9) > 0) {
+               envp[0] = buffer;
+               envp[1] = NULL;
        }
-
-       envp[i] = NULL;
        return 0;
 }
 
@@ -543,25 +621,6 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context)
        return;
 }
 
-int acpi_match_ids(struct acpi_device *device, char *ids)
-{
-       if (device->flags.hardware_id)
-               if (strstr(ids, device->pnp.hardware_id))
-                       return 0;
-
-       if (device->flags.compatible_ids) {
-               struct acpi_compatible_id_list *cid_list = device->pnp.cid_list;
-               int i;
-
-               /* compare multiple _CID entries against driver ids */
-               for (i = 0; i < cid_list->count; i++) {
-                       if (strstr(ids, cid_list->id[i].value))
-                               return 0;
-               }
-       }
-       return -ENOENT;
-}
-
 static int acpi_bus_get_perf_flags(struct acpi_device *device)
 {
        device->performance.state = ACPI_STATE_UNKNOWN;
@@ -624,6 +683,13 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *package = NULL;
 
+       struct acpi_device_id button_device_ids[] = {
+               {"PNP0C0D", 0},
+               {"PNP0C0C", 0},
+               {"PNP0C0E", 0},
+               {"", 0},
+       };
+
 
        /* _PRW */
        status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
@@ -643,7 +709,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
 
        device->wakeup.flags.valid = 1;
        /* Power button, Lid switch always enable wakeup */
-       if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E"))
+       if (!acpi_match_device_ids(device, button_device_ids))
                device->wakeup.flags.run_wake = 1;
 
       end:
index d6c017709c850dd075d903a280443f6ee96a1a85..01a993a1d08612b4e0a4fa5a2384806c8733d432 100644 (file)
@@ -1,5 +1,5 @@
 obj-y                                  := poweroff.o wakeup.o
-obj-$(CONFIG_ACPI_SLEEP)               += main.o
-obj-$(CONFIG_ACPI_SLEEP_PROC_FS)       += proc.o
+obj-y                                  += main.o
+obj-$(CONFIG_X86)                      += proc.o
 
 EXTRA_CFLAGS += $(ACPI_CFLAGS)
index 3279e72a94f81c0c532f72a9bd0284861a1ba345..ab21357c5c7b7d60dd15883981ea3016a94963b2 100644 (file)
@@ -34,35 +34,55 @@ static u32 acpi_suspend_states[] = {
 
 static int init_8259A_after_S1;
 
+extern int acpi_sleep_prepare(u32 acpi_state);
+extern void acpi_power_off(void);
+
+static u32 acpi_target_sleep_state = ACPI_STATE_S0;
+
+/**
+ *     acpi_pm_set_target - Set the target system sleep state to the state
+ *             associated with given @pm_state, if supported.
+ */
+
+static int acpi_pm_set_target(suspend_state_t pm_state)
+{
+       u32 acpi_state = acpi_suspend_states[pm_state];
+       int error = 0;
+
+       if (sleep_states[acpi_state]) {
+               acpi_target_sleep_state = acpi_state;
+       } else {
+               printk(KERN_ERR "ACPI does not support this state: %d\n",
+                       pm_state);
+               error = -ENOSYS;
+       }
+       return error;
+}
+
 /**
  *     acpi_pm_prepare - Do preliminary suspend work.
- *     @pm_state:              suspend state we're entering.
+ *     @pm_state: ignored
  *
- *     Make sure we support the state. If we do, and we need it, set the
- *     firmware waking vector and do arch-specific nastiness to get the 
- *     wakeup code to the waking vector. 
+ *     If necessary, set the firmware waking vector and do arch-specific
+ *     nastiness to get the wakeup code to the waking vector.
  */
 
-extern int acpi_sleep_prepare(u32 acpi_state);
-extern void acpi_power_off(void);
-
 static int acpi_pm_prepare(suspend_state_t pm_state)
 {
-       u32 acpi_state = acpi_suspend_states[pm_state];
+       int error = acpi_sleep_prepare(acpi_target_sleep_state);
 
-       if (!sleep_states[acpi_state]) {
-               printk("acpi_pm_prepare does not support %d \n", pm_state);
-               return -EPERM;
-       }
-       return acpi_sleep_prepare(acpi_state);
+       if (error)
+               acpi_target_sleep_state = ACPI_STATE_S0;
+
+       return error;
 }
 
 /**
  *     acpi_pm_enter - Actually enter a sleep state.
- *     @pm_state:              State we're entering.
+ *     @pm_state: ignored
  *
- *     Flush caches and go to sleep. For STR or STD, we have to call 
- *     arch-specific assembly, which in turn call acpi_enter_sleep_state().
+ *     Flush caches and go to sleep. For STR we have to call arch-specific
+ *     assembly, which in turn call acpi_enter_sleep_state().
  *     It's unfortunate, but it works. Please fix if you're feeling frisky.
  */
 
@@ -70,31 +90,31 @@ static int acpi_pm_enter(suspend_state_t pm_state)
 {
        acpi_status status = AE_OK;
        unsigned long flags = 0;
-       u32 acpi_state = acpi_suspend_states[pm_state];
+       u32 acpi_state = acpi_target_sleep_state;
 
        ACPI_FLUSH_CPU_CACHE();
 
        /* Do arch specific saving of state. */
-       if (pm_state > PM_SUSPEND_STANDBY) {
+       if (acpi_state == ACPI_STATE_S3) {
                int error = acpi_save_state_mem();
-               if (error)
+
+               if (error) {
+                       acpi_target_sleep_state = ACPI_STATE_S0;
                        return error;
+               }
        }
 
        local_irq_save(flags);
        acpi_enable_wakeup_device(acpi_state);
-       switch (pm_state) {
-       case PM_SUSPEND_STANDBY:
+       switch (acpi_state) {
+       case ACPI_STATE_S1:
                barrier();
                status = acpi_enter_sleep_state(acpi_state);
                break;
 
-       case PM_SUSPEND_MEM:
+       case ACPI_STATE_S3:
                do_suspend_lowlevel();
                break;
-
-       default:
-               return -EINVAL;
        }
 
        /* ACPI 3.0 specs (P62) says that it's the responsabilty
@@ -107,12 +127,8 @@ static int acpi_pm_enter(suspend_state_t pm_state)
        local_irq_restore(flags);
        printk(KERN_DEBUG "Back to C!\n");
 
-       /* restore processor state
-        * We should only be here if we're coming back from STR or STD.
-        * And, in the case of the latter, the memory image should have already
-        * been loaded from disk.
-        */
-       if (pm_state > PM_SUSPEND_STANDBY)
+       /* restore processor state */
+       if (acpi_state == ACPI_STATE_S3)
                acpi_restore_state_mem();
 
        return ACPI_SUCCESS(status) ? 0 : -EFAULT;
@@ -120,7 +136,7 @@ static int acpi_pm_enter(suspend_state_t pm_state)
 
 /**
  *     acpi_pm_finish - Finish up suspend sequence.
- *     @pm_state:              State we're coming out of.
+ *     @pm_state: ignored
  *
  *     This is called after we wake back up (or if entering the sleep state
  *     failed). 
@@ -128,7 +144,7 @@ static int acpi_pm_enter(suspend_state_t pm_state)
 
 static int acpi_pm_finish(suspend_state_t pm_state)
 {
-       u32 acpi_state = acpi_suspend_states[pm_state];
+       u32 acpi_state = acpi_target_sleep_state;
 
        acpi_leave_sleep_state(acpi_state);
        acpi_disable_wakeup_device(acpi_state);
@@ -136,10 +152,14 @@ static int acpi_pm_finish(suspend_state_t pm_state)
        /* reset firmware waking vector */
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
 
+       acpi_target_sleep_state = ACPI_STATE_S0;
+
+#ifdef CONFIG_X86
        if (init_8259A_after_S1) {
                printk("Broken toshiba laptop -> kicking interrupts\n");
                init_8259A(0);
        }
+#endif
        return 0;
 }
 
@@ -176,6 +196,7 @@ static int acpi_pm_state_valid(suspend_state_t pm_state)
 
 static struct pm_ops acpi_pm_ops = {
        .valid = acpi_pm_state_valid,
+       .set_target = acpi_pm_set_target,
        .prepare = acpi_pm_prepare,
        .enter = acpi_pm_enter,
        .finish = acpi_pm_finish,
@@ -235,6 +256,81 @@ static struct hibernation_ops acpi_hibernation_ops = {
 };
 #endif                         /* CONFIG_SOFTWARE_SUSPEND */
 
+/**
+ *     acpi_pm_device_sleep_state - return preferred power state of ACPI device
+ *             in the system sleep state given by %acpi_target_sleep_state
+ *     @dev: device to examine
+ *     @wake: if set, the device should be able to wake up the system
+ *     @d_min_p: used to store the upper limit of allowed states range
+ *     Return value: preferred power state of the device on success, -ENODEV on
+ *             failure (ie. if there's no 'struct acpi_device' for @dev)
+ *
+ *     Find the lowest power (highest number) ACPI device power state that
+ *     device @dev can be in while the system is in the sleep state represented
+ *     by %acpi_target_sleep_state.  If @wake is nonzero, the device should be
+ *     able to wake up the system from this sleep state.  If @d_min_p is set,
+ *     the highest power (lowest number) device power state of @dev allowed
+ *     in this system sleep state is stored at the location pointed to by it.
+ *
+ *     The caller must ensure that @dev is valid before using this function.
+ *     The caller is also responsible for figuring out if the device is
+ *     supposed to be able to wake up the system and passing this information
+ *     via @wake.
+ */
+
+int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
+{
+       acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
+       struct acpi_device *adev;
+       char acpi_method[] = "_SxD";
+       unsigned long d_min, d_max;
+
+       if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
+               printk(KERN_ERR "ACPI handle has no context!\n");
+               return -ENODEV;
+       }
+
+       acpi_method[2] = '0' + acpi_target_sleep_state;
+       /*
+        * If the sleep state is S0, we will return D3, but if the device has
+        * _S0W, we will use the value from _S0W
+        */
+       d_min = ACPI_STATE_D0;
+       d_max = ACPI_STATE_D3;
+
+       /*
+        * If present, _SxD methods return the minimum D-state (highest power
+        * state) we can use for the corresponding S-states.  Otherwise, the
+        * minimum D-state is D0 (ACPI 3.x).
+        *
+        * NOTE: We rely on acpi_evaluate_integer() not clobbering the integer
+        * provided -- that's our fault recovery, we ignore retval.
+        */
+       if (acpi_target_sleep_state > ACPI_STATE_S0)
+               acpi_evaluate_integer(handle, acpi_method, NULL, &d_min);
+
+       /*
+        * If _PRW says we can wake up the system from the target sleep state,
+        * the D-state returned by _SxD is sufficient for that (we assume a
+        * wakeup-aware driver if wake is set).  Still, if _SxW exists
+        * (ACPI 3.x), it should return the maximum (lowest power) D-state that
+        * can wake the system.  _S0W may be valid, too.
+        */
+       if (acpi_target_sleep_state == ACPI_STATE_S0 ||
+           (wake && adev->wakeup.state.enabled &&
+            adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
+               acpi_method[3] = 'W';
+               acpi_evaluate_integer(handle, acpi_method, NULL, &d_max);
+               /* Sanity check */
+               if (d_max < d_min)
+                       d_min = d_max;
+       }
+
+       if (d_min_p)
+               *d_min_p = d_min;
+       return d_max;
+}
+
 /*
  * Toshiba fails to preserve interrupts over S1, reinitialization
  * of 8259 is needed after S1 resume.
index 39e40d56b034ec9bd46e68c4a9e2d9467c3b9686..b3f68ef0669ed23ba6077e4c784a9b20eaab9564 100644 (file)
@@ -18,7 +18,6 @@
 
 int acpi_sleep_prepare(u32 acpi_state)
 {
-#ifdef CONFIG_ACPI_SLEEP
        /* do we have a wakeup address for S2 and S3? */
        if (acpi_state == ACPI_STATE_S3) {
                if (!acpi_wakeup_address) {
@@ -31,7 +30,6 @@ int acpi_sleep_prepare(u32 acpi_state)
        }
        ACPI_FLUSH_CPU_CACHE();
        acpi_enable_wakeup_device_prep(acpi_state);
-#endif
        acpi_gpe_sleep_prepare(acpi_state);
        acpi_enter_sleep_state_prep(acpi_state);
        return 0;
index 61f1822cc35050648c2958bf5b0de005f5920313..ed58e1168aed6b40c1631b23a5c8317fc4cda39c 100644 (file)
 #include "sleep.h"
 
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
+
+/*
+ * this file provides support for:
+ * /proc/acpi/sleep
+ * /proc/acpi/alarm
+ * /proc/acpi/wakeup
+ */
+
 ACPI_MODULE_NAME("sleep")
-#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
+#ifdef CONFIG_ACPI_PROCFS
 static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset)
 {
        int i;
@@ -68,7 +76,7 @@ acpi_system_write_sleep(struct file *file,
       Done:
        return error ? error : count;
 }
-#endif                         /* CONFIG_ACPI_SLEEP_PROC_SLEEP */
+#endif                         /* CONFIG_ACPI_PROCFS */
 
 #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)
 /* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */
@@ -463,7 +471,7 @@ static const struct file_operations acpi_system_wakeup_device_fops = {
        .release = single_release,
 };
 
-#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
+#ifdef CONFIG_ACPI_PROCFS
 static const struct file_operations acpi_system_sleep_fops = {
        .open = acpi_system_sleep_open_fs,
        .read = seq_read,
@@ -471,7 +479,7 @@ static const struct file_operations acpi_system_sleep_fops = {
        .llseek = seq_lseek,
        .release = single_release,
 };
-#endif                         /* CONFIG_ACPI_SLEEP_PROC_SLEEP */
+#endif                         /* CONFIG_ACPI_PROCFS */
 
 #ifdef HAVE_ACPI_LEGACY_ALARM
 static const struct file_operations acpi_system_alarm_fops = {
@@ -498,14 +506,14 @@ static int __init acpi_sleep_proc_init(void)
        if (acpi_disabled)
                return 0;
 
-#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
+#ifdef CONFIG_ACPI_PROCFS
        /* 'sleep' [R/W] */
        entry =
            create_proc_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR,
                              acpi_root_dir);
        if (entry)
                entry->proc_fops = &acpi_system_sleep_fops;
-#endif
+#endif                         /* CONFIG_ACPI_PROCFS */
 
 #ifdef HAVE_ACPI_LEGACY_ALARM
        /* 'alarm' [R/W] */
index fab8f2694f03284bf23f3dd256cd1a811ae6727f..97c27ddb144ddced0025b646825ab06bdac60287 100644 (file)
@@ -17,7 +17,6 @@ ACPI_MODULE_NAME("wakeup_devices")
 extern struct list_head acpi_wakeup_device_list;
 extern spinlock_t acpi_device_lock;
 
-#ifdef CONFIG_ACPI_SLEEP
 /**
  * acpi_enable_wakeup_device_prep - prepare wakeup devices
  *     @sleep_state:   ACPI state
@@ -180,7 +179,6 @@ static int __init acpi_wakeup_device_init(void)
 }
 
 late_initcall(acpi_wakeup_device_init);
-#endif
 
 /*
  * Disable all wakeup GPEs before entering requested sleep state.
index 58f1338981bca1d93ec525eb6a26a8532a392bbc..5a62de1b7f2a0e040f1d32a537bc8693a37b0584 100644 (file)
@@ -92,10 +92,16 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file);
 static ssize_t acpi_thermal_write_polling(struct file *, const char __user *,
                                          size_t, loff_t *);
 
+static const struct acpi_device_id  thermal_device_ids[] = {
+       {ACPI_THERMAL_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
+
 static struct acpi_driver acpi_thermal_driver = {
        .name = "thermal",
        .class = ACPI_THERMAL_CLASS,
-       .ids = ACPI_THERMAL_HID,
+       .ids = thermal_device_ids,
        .ops = {
                .add = acpi_thermal_add,
                .remove = acpi_thermal_remove,
index f112af433e36eb01afdfce5cfdcaeacf74dde19d..0042b7e78b269647508b41ed6d5d7fbc2f378ef8 100644 (file)
@@ -407,7 +407,7 @@ acpi_ut_copy_id_string(char *destination, char *source, acpi_size max_length)
 
 acpi_status
 acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
-                   struct acpi_device_id *hid)
+                   struct acpica_device_id *hid)
 {
        union acpi_operand_object *obj_desc;
        acpi_status status;
@@ -609,7 +609,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node,
 
 acpi_status
 acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
-                   struct acpi_device_id *uid)
+                   struct acpica_device_id *uid)
 {
        union acpi_operand_object *obj_desc;
        acpi_status status;
index 04ea697f72bff00b94cc2d1151df53d8b5d93e1e..d98701941981421837a7c622da0a416eccad8442 100644 (file)
@@ -74,10 +74,16 @@ MODULE_LICENSE("GPL");
 static int acpi_video_bus_add(struct acpi_device *device);
 static int acpi_video_bus_remove(struct acpi_device *device, int type);
 
+static const struct acpi_device_id video_device_ids[] = {
+       {ACPI_VIDEO_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, video_device_ids);
+
 static struct acpi_driver acpi_video_bus = {
        .name = "video",
        .class = ACPI_VIDEO_CLASS,
-       .ids = ACPI_VIDEO_HID,
+       .ids = video_device_ids,
        .ops = {
                .add = acpi_video_bus_add,
                .remove = acpi_video_bus_remove,
index ba0e74ad74bbbc778eb485ed95ae089b15cab6a1..9a2694e5f8b98311ff435f3ce4733333c5682266 100644 (file)
@@ -1007,9 +1007,15 @@ static int hpet_acpi_remove(struct acpi_device *device, int type)
        return -EINVAL;
 }
 
+static const struct acpi_device_id hpet_device_ids[] = {
+       {"PNP0103", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, hpet_device_ids);
+
 static struct acpi_driver hpet_acpi_driver = {
        .name = "hpet",
-       .ids = "PNP0103",
+       .ids = hpet_device_ids,
        .ops = {
                .add = hpet_acpi_add,
                .remove = hpet_acpi_remove,
index 0acc3a123604ef7f48745e887dd12f09fb36f090..e43e92fd9e2311f8a15c01f52b2eb769b003cb7c 100644 (file)
@@ -31,7 +31,6 @@
 
 #define ACPI_ATLAS_NAME                        "Atlas ACPI"
 #define ACPI_ATLAS_CLASS               "Atlas"
-#define ACPI_ATLAS_BUTTON_HID          "ASIM0000"
 
 static struct input_dev *input_dev;
 
@@ -130,10 +129,16 @@ static int atlas_acpi_button_remove(struct acpi_device *device, int type)
        return status;
 }
 
+static const struct acpi_device_id atlas_device_ids[] = {
+       {"ASIM0000", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, atlas_device_ids);
+
 static struct acpi_driver atlas_acpi_driver = {
        .name   = ACPI_ATLAS_NAME,
        .class  = ACPI_ATLAS_CLASS,
-       .ids    = ACPI_ATLAS_BUTTON_HID,
+       .ids    = atlas_device_ids,
        .ops    = {
                .add    = atlas_acpi_button_add,
                .remove = atlas_acpi_button_remove,
index bcbe6835beb4316be933f037f728f92d2df60e3d..96856097d15bb9f2cb2b897c87d6a25a6d9248ea 100644 (file)
@@ -297,9 +297,6 @@ static struct kvm *kvm_create_vm(void)
        kvm_io_bus_init(&kvm->pio_bus);
        spin_lock_init(&kvm->lock);
        INIT_LIST_HEAD(&kvm->active_mmu_pages);
-       spin_lock(&kvm_lock);
-       list_add(&kvm->vm_list, &vm_list);
-       spin_unlock(&kvm_lock);
        kvm_io_bus_init(&kvm->mmio_bus);
        for (i = 0; i < KVM_MAX_VCPUS; ++i) {
                struct kvm_vcpu *vcpu = &kvm->vcpus[i];
@@ -309,6 +306,9 @@ static struct kvm *kvm_create_vm(void)
                vcpu->kvm = kvm;
                vcpu->mmu.root_hpa = INVALID_PAGE;
        }
+       spin_lock(&kvm_lock);
+       list_add(&kvm->vm_list, &vm_list);
+       spin_unlock(&kvm_lock);
        return kvm;
 }
 
@@ -1070,18 +1070,16 @@ static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
                return 0;
        mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT);
        virt = kmap_atomic(page, KM_USER0);
-       if (memcmp(virt + offset_in_page(gpa), val, bytes)) {
-               kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes);
-               memcpy(virt + offset_in_page(gpa), val, bytes);
-       }
+       kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes);
+       memcpy(virt + offset_in_page(gpa), val, bytes);
        kunmap_atomic(virt, KM_USER0);
        return 1;
 }
 
-static int emulator_write_emulated(unsigned long addr,
-                                  const void *val,
-                                  unsigned int bytes,
-                                  struct x86_emulate_ctxt *ctxt)
+static int emulator_write_emulated_onepage(unsigned long addr,
+                                          const void *val,
+                                          unsigned int bytes,
+                                          struct x86_emulate_ctxt *ctxt)
 {
        struct kvm_vcpu      *vcpu = ctxt->vcpu;
        struct kvm_io_device *mmio_dev;
@@ -1113,6 +1111,26 @@ static int emulator_write_emulated(unsigned long addr,
        return X86EMUL_CONTINUE;
 }
 
+static int emulator_write_emulated(unsigned long addr,
+                                  const void *val,
+                                  unsigned int bytes,
+                                  struct x86_emulate_ctxt *ctxt)
+{
+       /* Crossing a page boundary? */
+       if (((addr + bytes - 1) ^ addr) & PAGE_MASK) {
+               int rc, now;
+
+               now = -addr & ~PAGE_MASK;
+               rc = emulator_write_emulated_onepage(addr, val, now, ctxt);
+               if (rc != X86EMUL_CONTINUE)
+                       return rc;
+               addr += now;
+               val += now;
+               bytes -= now;
+       }
+       return emulator_write_emulated_onepage(addr, val, bytes, ctxt);
+}
+
 static int emulator_cmpxchg_emulated(unsigned long addr,
                                     const void *old,
                                     const void *new,
@@ -2414,9 +2432,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu)
                        break;
                }
        }
-       if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) {
+       if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) {
                entry->edx &= ~(1 << 20);
-               printk(KERN_INFO ": guest NX capability removed\n");
+               printk(KERN_INFO "kvm: guest NX capability removed\n");
        }
 }
 
index 1b800fc00342c55dbdb47c21935345330b49c4ef..1f979cb0df314f82cab71e88f2c7892922454860 100644 (file)
@@ -1178,6 +1178,8 @@ pop_instruction:
 twobyte_insn:
        switch (b) {
        case 0x01: /* lgdt, lidt, lmsw */
+               /* Disable writeback. */
+               no_wb = 1;
                switch (modrm_reg) {
                        u16 size;
                        unsigned long address;
index 6b89854bd3ff9f006b4c66ff5ba865ef09d9f59f..d0fc4fd212e6814ae1ce4f6c852ac30f5e8ec137 100644 (file)
@@ -53,7 +53,6 @@
 #define ASUS_HOTK_NAME          "Asus Laptop Support"
 #define ASUS_HOTK_CLASS         "hotkey"
 #define ASUS_HOTK_DEVICE_NAME   "Hotkey"
-#define ASUS_HOTK_HID           "ATK0100"
 #define ASUS_HOTK_FILE          "asus-laptop"
 #define ASUS_HOTK_PREFIX        "\\_SB.ATKD."
 
@@ -197,12 +196,18 @@ static struct asus_hotk *hotk;
 /*
  * The hotkey driver declaration
  */
+static const struct acpi_device_id asus_device_ids[] = {
+       {"ATK0100", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, asus_device_ids);
+
 static int asus_hotk_add(struct acpi_device *device);
 static int asus_hotk_remove(struct acpi_device *device, int type);
 static struct acpi_driver asus_hotk_driver = {
        .name = ASUS_HOTK_NAME,
        .class = ASUS_HOTK_CLASS,
-       .ids = ASUS_HOTK_HID,
+       .ids = asus_device_ids,
        .ops = {
                .add = asus_hotk_add,
                .remove = asus_hotk_remove,
index 303e48ca0e8ae77459bb72dcf9c66d096b344636..14ee06c8f12727ebd3d0a950b7e870d440616305 100644 (file)
@@ -1124,10 +1124,22 @@ static int sony_nc_remove(struct acpi_device *device, int type)
        return 0;
 }
 
+static const struct acpi_device_id sony_device_ids[] = {
+       {SONY_NC_HID, 0},
+       {SONY_PIC_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, sony_device_ids);
+
+static const struct acpi_device_id sony_nc_device_ids[] = {
+       {SONY_NC_HID, 0},
+       {"", 0},
+};
+
 static struct acpi_driver sony_nc_driver = {
        .name = SONY_NC_DRIVER_NAME,
        .class = SONY_NC_CLASS,
-       .ids = SONY_NC_HID,
+       .ids = sony_nc_device_ids,
        .owner = THIS_MODULE,
        .ops = {
                .add = sony_nc_add,
@@ -2470,10 +2482,15 @@ static int sony_pic_resume(struct acpi_device *device)
        return 0;
 }
 
+static const struct acpi_device_id sony_pic_device_ids[] = {
+       {SONY_PIC_HID, 0},
+       {"", 0},
+};
+
 static struct acpi_driver sony_pic_driver = {
        .name = SONY_PIC_DRIVER_NAME,
        .class = SONY_PIC_CLASS,
-       .ids = SONY_PIC_HID,
+       .ids = sony_pic_device_ids,
        .owner = THIS_MODULE,
        .ops = {
                .add = sony_pic_add,
index f15a58f7403fd4b231ddd267ebb02f098d22957b..fa80f355e522ffc65f6a67caa96659e1e7f2e7d0 100644 (file)
@@ -411,12 +411,13 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
 
        sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name);
        ibm->acpi->driver->ids = ibm->acpi->hid;
+
        ibm->acpi->driver->ops.add = &tpacpi_device_add;
 
        rc = acpi_bus_register_driver(ibm->acpi->driver);
        if (rc < 0) {
                printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n",
-                      ibm->acpi->hid, rc);
+                      ibm->name, rc);
                kfree(ibm->acpi->driver);
                ibm->acpi->driver = NULL;
        } else if (!rc)
@@ -1316,8 +1317,13 @@ errexit:
        return res;
 }
 
+static const struct acpi_device_id ibm_htk_device_ids[] = {
+       {IBM_HKEY_HID, 0},
+       {"", 0},
+};
+
 static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = {
-       .hid = IBM_HKEY_HID,
+       .hid = ibm_htk_device_ids,
        .notify = hotkey_notify,
        .handle = &hkey_handle,
        .type = ACPI_DEVICE_NOTIFY,
@@ -2080,6 +2086,11 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK",     /* X30, X31, X40 */
 /* don't list other alternatives as we install a notify handler on the 570 */
 IBM_HANDLE(pci, root, "\\_SB.PCI");    /* 570 */
 
+static const struct acpi_device_id ibm_pci_device_ids[] = {
+       {PCI_ROOT_HID_STRING, 0},
+       {"", 0},
+};
+
 static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = {
        {
         .notify = dock_notify,
@@ -2090,7 +2101,7 @@ static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = {
        /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING.
         * We just use it to get notifications of dock hotplug
         * in very old thinkpads */
-        .hid = PCI_ROOT_HID_STRING,
+        .hid = ibm_pci_device_ids,
         .notify = dock_notify,
         .handle = &pci_handle,
         .type = ACPI_SYSTEM_NOTIFY,
@@ -2149,7 +2160,8 @@ static int __init dock_init2(struct ibm_init_struct *iibm)
 static void dock_notify(struct ibm_struct *ibm, u32 event)
 {
        int docked = dock_docked();
-       int pci = ibm->acpi->hid && strstr(ibm->acpi->hid, PCI_ROOT_HID_STRING);
+       int pci = ibm->acpi->hid && ibm->acpi->device &&
+               acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids);
 
        if (event == 1 && !pci) /* 570 */
                acpi_bus_generate_event(ibm->acpi->device, event, 1);   /* button */
index b7a4a888cc8b5d209e7a562f633001f37c8119ff..88af089d64945b41a5150e545a5064ce1b6f0a5a 100644 (file)
@@ -193,7 +193,7 @@ static void thinkpad_acpi_module_exit(void);
 struct ibm_struct;
 
 struct tp_acpi_drv_struct {
-       char *hid;
+       const struct acpi_device_id *hid;
        struct acpi_driver *driver;
 
        void (*notify) (struct ibm_struct *, u32);
index c8062494009f8fdb692adbbe15bb741a870064cd..67c63d1f15829453941f94f3283d0bef1da421f1 100644 (file)
@@ -245,16 +245,33 @@ EXPORT_SYMBOL(pci_osc_control_set);
  * currently we simply return _SxD, if present.
  */
 
-static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state)
+static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
+       pm_message_t state)
 {
-       /* TBD */
-
-       return -ENODEV;
+       int acpi_state;
+
+       acpi_state = acpi_pm_device_sleep_state(&pdev->dev,
+               device_may_wakeup(&pdev->dev), NULL);
+       if (acpi_state < 0)
+               return PCI_POWER_ERROR;
+
+       switch (acpi_state) {
+       case ACPI_STATE_D0:
+               return PCI_D0;
+       case ACPI_STATE_D1:
+               return PCI_D1;
+       case ACPI_STATE_D2:
+               return PCI_D2;
+       case ACPI_STATE_D3:
+               return PCI_D3hot;
+       }
+       return PCI_POWER_ERROR;
 }
 
 static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 {
        acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
+       acpi_handle tmp;
        static int state_conv[] = {
                [0] = 0,
                [1] = 1,
@@ -266,6 +283,9 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 
        if (!handle)
                return -ENODEV;
+       /* If the ACPI device has _EJ0, ignore the device */
+       if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp)))
+               return 0;
        return acpi_bus_set_power(handle, acpi_state);
 }
 
index c95485398687cb22e93c1259600a1e8ee602a20d..fba319d6fcc86bf178be1cc531e0d227adff0a6c 100644 (file)
@@ -499,7 +499,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
        return 0;
 }
 
-int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
+pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
  
 /**
  * pci_choose_state - Choose the power state of a PCI device
@@ -513,15 +513,15 @@ int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
 
 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
 {
-       int ret;
+       pci_power_t ret;
 
        if (!pci_find_capability(dev, PCI_CAP_ID_PM))
                return PCI_D0;
 
        if (platform_pci_choose_state) {
                ret = platform_pci_choose_state(dev, state);
-               if (ret >= 0)
-                       state.event = ret;
+               if (ret != PCI_POWER_ERROR)
+                       return ret;
        }
 
        switch (state.event) {
index 7b696cd66dc5be36fbd0c231dbc398bf668db648..c6e132d7c0f7eceba58069531a9fddd8ac20ba03 100644 (file)
@@ -12,7 +12,7 @@ extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
                                              resource_size_t, resource_size_t),
                                  void *alignf_data);
 /* Firmware callbacks */
-extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
+extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
 extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state);
 
 extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
index e161423b4300d7f76c6f2b5a207362e2e4688ed1..1432806451cd03cf751d2f3e9c896582bd7571cd 100644 (file)
@@ -167,6 +167,8 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state)
                        return error;
        }
 
+       if (pnp_dev->protocol && pnp_dev->protocol->suspend)
+               pnp_dev->protocol->suspend(pnp_dev, state);
        return 0;
 }
 
@@ -179,6 +181,9 @@ static int pnp_bus_resume(struct device *dev)
        if (!pnp_drv)
                return 0;
 
+       if (pnp_dev->protocol && pnp_dev->protocol->resume)
+               pnp_dev->protocol->resume(pnp_dev);
+
        if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) {
                error = pnp_start_dev(pnp_dev);
                if (error)
index a00548799e98f8655fbb9efcdd53c10e0837f06c..fcd32ac575c3493edacfb8ed322c5162ebdd2e61 100644 (file)
 
 #include <linux/acpi.h>
 #include <linux/pnp.h>
+#include <linux/mod_devicetable.h>
 #include <acpi/acpi_bus.h>
+#include <acpi/actypes.h>
+
 #include "pnpacpi.h"
 
 static int num = 0;
@@ -33,15 +36,17 @@ static int num = 0;
  * have irqs (PIC, Timer) because we call acpi_register_gsi.
  * Finaly only devices that have a CRS method need to be in this list.
  */
-static char __initdata excluded_id_list[] =
-       "PNP0C09," /* EC */
-       "PNP0C0F," /* Link device */
-       "PNP0000," /* PIC */
-       "PNP0100," /* Timer */
-       ;
+static __initdata struct acpi_device_id excluded_id_list[] ={
+       {"PNP0C09", 0}, /* EC */
+       {"PNP0C0F", 0}, /* Link device */
+       {"PNP0000", 0}, /* PIC */
+       {"PNP0100", 0}, /* Timer */
+       {"", 0},
+};
+
 static inline int is_exclusive_device(struct acpi_device *dev)
 {
-       return (!acpi_match_ids(dev, excluded_id_list));
+       return (!acpi_match_device_ids(dev, excluded_id_list));
 }
 
 /*
@@ -119,11 +124,25 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev)
        return ACPI_FAILURE(status) ? -ENODEV : 0;
 }
 
+static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
+{
+       return acpi_bus_set_power((acpi_handle)dev->data,
+               acpi_pm_device_sleep_state(&dev->dev,
+               device_may_wakeup(&dev->dev), NULL));
+}
+
+static int pnpacpi_resume(struct pnp_dev *dev)
+{
+       return acpi_bus_set_power((acpi_handle)dev->data, ACPI_STATE_D0);
+}
+
 static struct pnp_protocol pnpacpi_protocol = {
        .name   = "Plug and Play ACPI",
        .get    = pnpacpi_get_resources,
        .set    = pnpacpi_set_resources,
        .disable = pnpacpi_disable_resources,
+       .suspend = pnpacpi_suspend,
+       .resume = pnpacpi_resume,
 };
 
 static int __init pnpacpi_add_device(struct acpi_device *device)
index 8b3cd31d6a61898ae892539e84d7d3b8ebca6d39..10ab3b71ffc621694c509a4bc7582ef9468ccc54 100644 (file)
@@ -46,6 +46,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
 {
        struct rtc_device       *rtc = to_rtc_device(dev);
        struct rtc_time         tm;
+       struct timespec         ts = current_kernel_time();
 
        if (strncmp(rtc->dev.bus_id,
                                CONFIG_RTC_HCTOSYS_DEVICE,
@@ -57,8 +58,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
 
        /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */
        set_normalized_timespec(&delta,
-                               xtime.tv_sec - oldtime,
-                               xtime.tv_nsec - (NSEC_PER_SEC >> 1));
+                               ts.tv_sec - oldtime,
+                               ts.tv_nsec - (NSEC_PER_SEC >> 1));
 
        return 0;
 }
index b20fd068173388759e7d501c03102d3395ffc9a9..92e8a37b50220f85517bc5367667f1db526f653c 100644 (file)
@@ -674,7 +674,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg)
        int first = 1;
        int i;
        unsigned long duration;
-       struct timespec done_stamp = xtime;
+       struct timespec done_stamp = current_kernel_time();
 
        DBF_TEXT(trace, 4, __FUNCTION__);
 
@@ -730,7 +730,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg)
                spin_unlock(&ch->collect_lock);
                ch->ccw[1].count = ch->trans_skb->len;
                fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
-               ch->prof.send_stamp = xtime;
+               ch->prof.send_stamp = current_kernel_time();
                rc = ccw_device_start(ch->cdev, &ch->ccw[0],
                                      (unsigned long) ch, 0xff, 0);
                ch->prof.doios_multi++;
@@ -2281,7 +2281,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
                fsm_newstate(ch->fsm, CH_STATE_TX);
                fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
                spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
-               ch->prof.send_stamp = xtime;
+               ch->prof.send_stamp = current_kernel_time();
                rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx],
                                      (unsigned long) ch, 0xff, 0);
                spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags);
index 3d28e1a5bf799ea0369afeec25405e594dfd21e4..2688894743396c429196bfdd93e6c4e0d3d06498 100644 (file)
@@ -753,7 +753,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
 
        header.next = 0;
        memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
-       conn->prof.send_stamp = xtime;
+       conn->prof.send_stamp = current_kernel_time();
        txmsg.class = 0;
        txmsg.tag = 0;
        rc = iucv_message_send(conn->path, &txmsg, 0, 0,
@@ -1185,7 +1185,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
                memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header,  NETIUCV_HDRLEN);
 
                fsm_newstate(conn->fsm, CONN_STATE_TX);
-               conn->prof.send_stamp = xtime;
+               conn->prof.send_stamp = current_kernel_time();
 
                msg.tag = 1;
                msg.class = 0;
index cad426c9711e970d0b7d62718bf894b7ca54536c..aad4012bbb30510a66c2f7983f07473a9885f5d4 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/keyboard.h>
 #include <linux/init.h>
 #include <linux/pm.h>
-#include <linux/pm_legacy.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 
@@ -401,9 +400,9 @@ irqreturn_t rs_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static void do_softint(void *private)
+static void do_softint(struct work_struct *work)
 {
-       struct m68k_serial      *info = (struct m68k_serial *) private;
+       struct m68k_serial      *info = container_of(work, struct m68k_serial, tqueue);
        struct tty_struct       *tty;
        
        tty = info->tty;
@@ -425,9 +424,9 @@ static void do_softint(void *private)
  *     do_serial_hangup() -> tty->hangup() -> rs_hangup()
  * 
  */
-static void do_serial_hangup(void *private)
+static void do_serial_hangup(struct work_struct *work)
 {
-       struct m68k_serial      *info = (struct m68k_serial *) private;
+       struct m68k_serial      *info = container_of(work, struct m68k_serial, tqueue_hangup);
        struct tty_struct       *tty;
        
        tty = info->tty;
@@ -1324,59 +1323,6 @@ static void show_serial_version(void)
        printk("MC68328 serial driver version 1.00\n");
 }
 
-#ifdef CONFIG_PM_LEGACY
-/* Serial Power management
- *  The console (currently fixed at line 0) is a special case for power
- *  management because the kernel is so chatty. The console will be 
- *  explicitly disabled my our power manager as the last minute, so we won't
- *  mess with it here.
- */
-static struct pm_dev *serial_pm[NR_PORTS];
-
-static int serial_pm_callback(struct pm_dev *dev, pm_request_t request, void *data)
-{
-       struct m68k_serial *info = (struct m68k_serial *)dev->data;
-
-       if(info == NULL)
-               return -1;
-
-       /* special case for line 0 - pm restores it */
-       if(info->line == 0)
-               return 0; 
-
-       switch (request) {
-       case PM_SUSPEND:
-               shutdown(info);
-               break;
-
-       case PM_RESUME:
-               startup(info);
-               break;
-       }
-       return 0;
-}
-
-void shutdown_console(void)
-{
-       struct m68k_serial *info = &m68k_soft[0];
-
-       /* HACK: wait a bit for any pending printk's to be dumped */
-       {
-               int i = 10000;
-               while(i--);
-       }
-
-       shutdown(info);
-}
-
-void startup_console(void)
-{
-       struct m68k_serial *info = &m68k_soft[0];
-       startup(info);
-}
-#endif /* CONFIG_PM_LEGACY */
-
-
 static const struct tty_operations rs_ops = {
        .open = rs_open,
        .close = rs_close,
@@ -1444,8 +1390,8 @@ rs68328_init(void)
            info->event = 0;
            info->count = 0;
            info->blocked_open = 0;
-           INIT_WORK(&info->tqueue, do_softint, info);
-           INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info);
+           INIT_WORK(&info->tqueue, do_softint);
+           INIT_WORK(&info->tqueue_hangup, do_serial_hangup);
            init_waitqueue_head(&info->open_wait);
            init_waitqueue_head(&info->close_wait);
            info->line = i;
@@ -1467,11 +1413,6 @@ rs68328_init(void)
                            IRQ_FLG_STD,
                            "M68328_UART", NULL))
                 panic("Unable to attach 68328 serial interrupt\n");
-#ifdef CONFIG_PM_LEGACY
-           serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback);
-           if (serial_pm[i])
-                   serial_pm[i]->data = info;
-#endif
        }
        local_irq_restore(flags);
        return 0;
index 5e3dcf3299bf90c68ae537de9c07d9fbbb9d69f6..533ef40f7ccfa8f636acc097d65b4970b022732d 100644 (file)
@@ -131,7 +131,7 @@ struct acpi_device_ops {
 struct acpi_driver {
        char name[80];
        char class[80];
-       char *ids;              /* Supported Hardware IDs */
+       const struct acpi_device_id *ids; /* Supported Hardware IDs */
        struct acpi_device_ops ops;
        struct device_driver drv;
        struct module *owner;
@@ -341,7 +341,8 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
 int acpi_bus_trim(struct acpi_device *start, int rmdevice);
 int acpi_bus_start(struct acpi_device *device);
 acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
-int acpi_match_ids(struct acpi_device *device, char *ids);
+int acpi_match_device_ids(struct acpi_device *device,
+                         const struct acpi_device_id *ids);
 int acpi_create_dir(struct acpi_device *);
 void acpi_remove_dir(struct acpi_device *);
 
@@ -365,6 +366,8 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer);
 acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
 #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
 
+int acpi_pm_device_sleep_state(struct device *, int, int *);
+
 #endif                         /* CONFIG_ACPI */
 
 #endif /*__ACPI_BUS_H__*/
index 553515912c0bf3356b8b2185b2dba76a380e1d49..f85f77a538aa67afb418b4b35ba8c3ccd945516f 100644 (file)
 #define ACPI_BUS_COMPONENT             0x00010000
 #define ACPI_SYSTEM_COMPONENT          0x02000000
 
-/* _HID definitions */
+/*
+ * _HID definitions
+ * HIDs must conform to ACPI spec(6.1.4)
+ * Linux specific HIDs do not apply to this and begin with LNX:
+ */
 
-#define ACPI_POWER_HID                 "power_resource"
+#define ACPI_POWER_HID                 "LNXPOWER"
 #define ACPI_PROCESSOR_HID             "ACPI0007"
-#define ACPI_SYSTEM_HID                        "acpi_system"
-#define ACPI_THERMAL_HID               "thermal"
-#define ACPI_BUTTON_HID_POWERF         "button_power"
-#define ACPI_BUTTON_HID_SLEEPF         "button_sleep"
-#define ACPI_VIDEO_HID                 "video"
-#define ACPI_BAY_HID                   "bay"
+#define ACPI_SYSTEM_HID                        "LNXSYSTM"
+#define ACPI_THERMAL_HID               "LNXTHERM"
+#define ACPI_BUTTON_HID_POWERF         "LNXPWRBN"
+#define ACPI_BUTTON_HID_SLEEPF         "LNXSLPBN"
+#define ACPI_VIDEO_HID                 "LNXVIDEO"
+#define ACPI_BAY_HID                   "LNXIOBAY"
+
 /* --------------------------------------------------------------------------
                                        PCI
    -------------------------------------------------------------------------- */
@@ -142,10 +147,6 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)
 /*--------------------------------------------------------------------------
                                   Suspend/Resume
   -------------------------------------------------------------------------- */
-#ifdef CONFIG_ACPI_SLEEP
 extern int acpi_sleep_init(void);
-#else
-#define acpi_sleep_init() do {} while (0)
-#endif
 
 #endif /*__ACPI_DRIVERS_H__*/
index fe8abc2764370ed22204a0c05e7eeee1faea138a..e73a38939120f58e3927ab2c00d72615222c43bb 100644 (file)
@@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
 
 /* Common string version of device HIDs and UIDs */
 
-struct acpi_device_id {
+struct acpica_device_id {
        char value[ACPI_DEVICE_ID_LENGTH];
 };
 
@@ -859,8 +859,8 @@ struct acpi_device_info {
        u32 valid;              /* Indicates which fields below are valid */
        u32 current_status;     /* _STA value */
        acpi_integer address;   /* _ADR value if any */
-       struct acpi_device_id hardware_id;      /* _HID value if any */
-       struct acpi_device_id unique_id;        /* _UID value if any */
+       struct acpica_device_id hardware_id;    /* _HID value if any */
+       struct acpica_device_id unique_id;      /* _UID value if any */
        u8 highest_dstates[4];  /* _sx_d values: 0xFF indicates not valid */
        struct acpi_compatible_id_list compatibility_id;        /* List of _CIDs if any */
 };
index a87ef1c8d46bbaacf43b75361b9062e048a3c47a..a2918547c73f662fd1bd5fe9e7fb54e050b58a1d 100644 (file)
@@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name,
 
 acpi_status
 acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
-                   struct acpi_device_id *hid);
+                   struct acpica_device_id *hid);
 
 acpi_status
 acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
@@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node,
 
 acpi_status
 acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
-                   struct acpi_device_id *uid);
+                   struct acpica_device_id *uid);
 
 acpi_status
 acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
index 449f3f272e070753c25877e5b23445ffbd75ac4f..125179adf0440976fc4face93804ebff7800c79a 100644 (file)
@@ -121,19 +121,6 @@ static inline void acpi_disable_pci(void)
 }
 extern int acpi_irq_balance_set(char *str);
 
-#else  /* !CONFIG_ACPI */
-
-#define acpi_lapic 0
-#define acpi_ioapic 0
-static inline void acpi_noirq_set(void) { }
-static inline void acpi_disable_pci(void) { }
-static inline void disable_acpi(void) { }
-
-#endif /* !CONFIG_ACPI */
-
-
-#ifdef CONFIG_ACPI_SLEEP
-
 /* routines for saving/restoring kernel state */
 extern int acpi_save_state_mem(void);
 extern void acpi_restore_state_mem(void);
@@ -143,7 +130,15 @@ extern unsigned long acpi_wakeup_address;
 /* early initialization routine */
 extern void acpi_reserve_bootmem(void);
 
-#endif /*CONFIG_ACPI_SLEEP*/
+#else  /* !CONFIG_ACPI */
+
+#define acpi_lapic 0
+#define acpi_ioapic 0
+static inline void acpi_noirq_set(void) { }
+static inline void acpi_disable_pci(void) { }
+static inline void disable_acpi(void) { }
+
+#endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT    1
 
index 427d8652bfdece3e3061727335adf465ef1d0cba..b91b01783e4ba6247b020dde839842f49f22c650 100644 (file)
@@ -4,8 +4,9 @@
 #include <linux/types.h>
 #include <linux/screen_info.h>
 #include <linux/apm_bios.h>
-#include <asm/e820.h>
 #include <linux/edd.h>
+#include <asm/e820.h>
+#include <asm/ist.h>
 #include <video/edid.h>
 
 struct setup_header {
@@ -48,9 +49,9 @@ struct efi_info {
        u32 _pad1;
        u32 efi_systab;
        u32 efi_memdesc_size;
-       u32 efi_memdec_version;
+       u32 efi_memdesc_version;
        u32 efi_memmap;
-       u32 fi_memmap_size;
+       u32 efi_memmap_size;
        u32 _pad2[2];
 };
 
@@ -59,7 +60,7 @@ struct boot_params {
        struct screen_info screen_info;                 /* 0x000 */
        struct apm_bios_info apm_bios_info;             /* 0x040 */
        u8  _pad2[12];                                  /* 0x054 */
-       u32 speedstep_info[4];                          /* 0x060 */
+       struct ist_info ist_info;                       /* 0x060 */
        u8  _pad3[16];                                  /* 0x070 */
        u8  hd0_info[16];       /* obsolete! */         /* 0x080 */
        u8  hd1_info[16];       /* obsolete! */         /* 0x090 */
index d13d1e68afa972f7f76507289c63461b93f9a4cf..ef2003ebc6f9b3e588495125972db716bbe16af2 100644 (file)
 
 #ifdef __KERNEL__
 
+#include <linux/types.h>
+
 struct ist_info {
-       unsigned long   signature;
-       unsigned long   command;
-       unsigned long   event;
-       unsigned long   perf_level;
+       u32 signature;
+       u32 command;
+       u32 event;
+       u32 perf_level;
 };
 
 extern struct ist_info ist_info;
index 8dbaafe611ffc744b426d944bb893c54445f2e32..a2520732ffd6a30b8f769f7a053c31c505944eaf 100644 (file)
@@ -21,7 +21,7 @@ struct saved_context {
        unsigned long return_address;
 } __attribute__((packed));
 
-#ifdef CONFIG_ACPI_SLEEP
+#ifdef CONFIG_ACPI
 extern unsigned long saved_eip;
 extern unsigned long saved_esp;
 extern unsigned long saved_ebp;
index 5b526357d178fa4b6e4d8f327cc839bd90e4080b..49730ffbbae41f25251aa4e44bb9090e48b41341 100644 (file)
@@ -100,6 +100,11 @@ const char *acpi_get_sysname (void);
 int acpi_request_vector (u32 int_type);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
+/* routines for saving/restoring kernel state */
+extern int acpi_save_state_mem(void);
+extern void acpi_restore_state_mem(void);
+extern unsigned long acpi_wakeup_address;
+
 /*
  * Record the cpei override flag and current logical cpu. This is
  * useful for CPU removal.
index 5ff8d74c3e0051934bc43f010a923e02cdfeb024..2390ee145aa17e3ed7097277dcc4789e50b62a75 100644 (file)
@@ -27,11 +27,12 @@ extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs)
 extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
                              sigset_t *set, struct pt_regs *regs);
 #if PAGE_SHIFT > IA32_PAGE_SHIFT
-extern int ia32_copy_partial_page_list (struct task_struct *, unsigned long);
-extern void ia32_drop_partial_page_list (struct task_struct *);
+extern int ia32_copy_ia64_partial_page_list(struct task_struct *,
+                                       unsigned long);
+extern void ia32_drop_ia64_partial_page_list(struct task_struct *);
 #else
-# define ia32_copy_partial_page_list(a1, a2)   0
-# define ia32_drop_partial_page_list(a1)       do { ; } while (0)
+# define ia32_copy_ia64_partial_page_list(a1, a2)      0
+# define ia32_drop_ia64_partial_page_list(a1)  do { ; } while (0)
 #endif
 
 #endif /* !__ASSEMBLY__ */
index ca33eb181ff26949eabc5758b7203b47aa11a154..5cf8bf1e805e6931ee51ea50f24c82fa336b7cda 100644 (file)
@@ -275,6 +275,7 @@ struct ia64_machine_vector {
 
 extern struct ia64_machine_vector ia64_mv;
 extern void machvec_init (const char *name);
+extern void machvec_init_from_cmdline(const char *cmdline);
 
 # else
 #  error Unknown configuration.  Update asm-ia64/machvec.h.
index 6251c76437d22013dda68217e709d675638802c9..be3b0ae43270f81800945752f65843b849ef2460 100644 (file)
@@ -220,7 +220,7 @@ struct desc_struct {
 
 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
 
-struct partial_page_list;
+struct ia64_partial_page_list;
 #endif
 
 struct thread_struct {
@@ -242,7 +242,7 @@ struct thread_struct {
        __u64 fdr;                      /* IA32 fp except. data reg */
        __u64 old_k1;                   /* old value of ar.k1 */
        __u64 old_iob;                  /* old IOBase value */
-       struct partial_page_list *ppl;  /* partial page list for 4K page size issue */
+       struct ia64_partial_page_list *ppl; /* partial page list for 4K page size issue */
         /* cached TLS descriptors. */
        struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
 
index c60024989ebd59b70bd090d01cc0ada6a95ad9d4..6314b29e8c4d6e32f249f3fb9376bc02e86ec729 100644 (file)
@@ -116,7 +116,6 @@ max_xtp (void)
 extern int __cpu_disable (void);
 extern void __cpu_die (unsigned int cpu);
 extern void cpu_die (void) __attribute__ ((noreturn));
-extern int __cpu_up (unsigned int cpu);
 extern void __init smp_build_cpu_map(void);
 
 extern void __init init_smp_config (void);
diff --git a/include/asm-m68knommu/hw_irq.h b/include/asm-m68knommu/hw_irq.h
new file mode 100644 (file)
index 0000000..f3ec9e5
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef __M68KNOMMU_HW_IRQ_H__
+#define __M68KNOMMU_HW_IRQ_H__
+
+#endif /* __M68KNOMMU_HW_IRQ_H__ */
index ea729e81a6befe1f4f3b5b550277715de4beb532..705c52c79cd849334e3f48a78944e4957da92cf4 100644 (file)
 #define MCFDMA_DIR_ASCEN     0x0800 /* Address Sequence Complete (Completion) interrupt enable */
 #define MCFDMA_DIR_TEEN      0x0200 /* Transfer Error interrupt enable */
 #define MCFDMA_DIR_TCEN      0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */
-#define MCFDMA_DIR_INV       0x1000 /* Invalid Combination */
+#define MCFDMA_DIR_INV       0x0010 /* Invalid Combination */
 #define MCFDMA_DIR_ASC       0x0008 /* Address Sequence Complete (DMA Completion) */
 #define MCFDMA_DIR_TE        0x0002 /* Transfer Error */
 #define MCFDMA_DIR_TC        0x0001 /* Transfer Complete */
index 5e5ed18bb78f54185da3d69ecfc0b1e9fd2373f7..5da43a5d12a3fd5214d5d52f31ad93254432e5fc 100644 (file)
@@ -296,7 +296,7 @@ cmpxchg(volatile int *p, int old, int new)
 ({                                             \
        unsigned char volatile *reset;          \
        asm("move.w     #0x2700, %sr");         \
-       reset = ((volatile unsigned short *)(MCF_IPSBAR + 0x110000));   \
+       reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000));    \
        while(1)                                \
        *reset |= (0x01 << 7);\
 })
@@ -318,7 +318,7 @@ cmpxchg(volatile int *p, int old, int new)
 ({                                     \
        unsigned char volatile *reset;  \
        asm("move.w     #0x2700, %sr"); \
-       reset = ((volatile unsigned short *)(MCF_IPSBAR + 0xA0000));    \
+       reset = ((volatile unsigned char *)(MCF_IPSBAR + 0xA0000));     \
        while(1)                        \
                *reset |= 0x80;         \
 })
index 85069998db528d287df012b015a9c6ba1e55c1a7..109050f3fe91e9c3324c14badf827ec25c9a59f4 100644 (file)
@@ -1 +1,23 @@
-#include <asm-m68k/timex.h>
+/*
+ * linux/include/asm-m68knommu/timex.h
+ *
+ * m68knommu architecture timex specifications
+ */
+#ifndef _ASM_M68KNOMMU_TIMEX_H
+#define _ASM_M68KNOMMU_TIMEX_H
+
+#ifdef CONFIG_COLDFIRE
+#include <asm/coldfire.h>
+#define CLOCK_TICK_RATE        MCF_CLK
+#else
+#define CLOCK_TICK_RATE        1193180 /* Underlying HZ */
+#endif
+
+typedef unsigned long cycles_t;
+
+static inline cycles_t get_cycles(void)
+{
+       return 0;
+}
+
+#endif
index d53e0eb1de163a77ef879bd86de4e2fa90c089fb..e909769b641046a3b718170a20691fdc5fb2141f 100644 (file)
@@ -71,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
        return bus->sysdata;
 }
 
+static inline int isa_vaddr_is_ioport(void __iomem *address)
+{
+       /* No specific ISA handling on ppc32 at this stage, it
+        * all goes through PCI
+        */
+       return 0;
+}
+
 /* These are used for config access before all the PCI probing
    has been done. */
 int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
@@ -241,6 +249,13 @@ extern void pcibios_free_controller(struct pci_controller *phb);
 
 extern void isa_bridge_find_early(struct pci_controller *hose);
 
+static inline int isa_vaddr_is_ioport(void __iomem *address)
+{
+       /* Check if address hits the reserved legacy IO range */
+       unsigned long ea = (unsigned long)address;
+       return ea >= ISA_IO_BASE && ea < ISA_IO_END;
+}
+
 extern int pcibios_unmap_io_space(struct pci_bus *bus);
 extern int pcibios_map_io_space(struct pci_bus *bus);
 
@@ -271,11 +286,16 @@ extern struct pci_controller *
 pcibios_alloc_controller(struct device_node *dev);
 #ifdef CONFIG_PCI
 extern unsigned long pci_address_to_pio(phys_addr_t address);
+extern int pcibios_vaddr_is_ioport(void __iomem *address);
 #else
 static inline unsigned long pci_address_to_pio(phys_addr_t address)
 {
        return (unsigned long)-1;
 }
+static inline int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+       return 0;
+}
 #endif
 
 
index fa083d8e46632807b5a206a5ab7fa528e7676fea..65325721446deca505420cfc8dae4cf8c1430847 100644 (file)
@@ -181,6 +181,18 @@ name: \
        .type GLUE(.,name),@function; \
 GLUE(.,name):
 
+#define _INIT_STATIC(name) \
+       .section ".text.init.refok"; \
+       .align 2 ; \
+       .section ".opd","aw"; \
+name: \
+       .quad GLUE(.,name); \
+       .quad .TOC.@tocbase; \
+       .quad 0; \
+       .previous; \
+       .type GLUE(.,name),@function; \
+GLUE(.,name):
+
 #else /* 32-bit */
 
 #define _GLOBAL(n)     \
index 0117b544ecbce1ff1c7741f3e55938bd31f34081..3a0975e2adadad1ff673b6880ae04ed33f016449 100644 (file)
@@ -80,6 +80,11 @@ extern const void *vio_get_attribute(struct vio_dev *vdev, char *which,
 extern struct vio_dev *vio_find_node(struct device_node *vnode);
 extern int vio_enable_interrupts(struct vio_dev *dev);
 extern int vio_disable_interrupts(struct vio_dev *dev);
+#else
+static inline int vio_enable_interrupts(struct vio_dev *dev)
+{
+       return 0;
+}
 #endif
 
 static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
index 1da8f49c0fe23cc7c87a12db6a891bfaaf27d1c1..98173357dd89c4d6291cd2d0400bace25022adbd 100644 (file)
@@ -108,6 +108,15 @@ static inline void acpi_disable_pci(void)
 }
 extern int acpi_irq_balance_set(char *str);
 
+/* routines for saving/restoring kernel state */
+extern int acpi_save_state_mem(void);
+extern void acpi_restore_state_mem(void);
+
+extern unsigned long acpi_wakeup_address;
+
+/* early initialization routine */
+extern void acpi_reserve_bootmem(void);
+
 #else  /* !CONFIG_ACPI */
 
 #define acpi_lapic 0
@@ -121,19 +130,6 @@ extern int acpi_numa;
 extern int acpi_scan_nodes(unsigned long start, unsigned long end);
 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
 
-#ifdef CONFIG_ACPI_SLEEP
-
-/* routines for saving/restoring kernel state */
-extern int acpi_save_state_mem(void);
-extern void acpi_restore_state_mem(void);
-
-extern unsigned long acpi_wakeup_address;
-
-/* early initialization routine */
-extern void acpi_reserve_bootmem(void);
-
-#endif /*CONFIG_ACPI_SLEEP*/
-
 extern int acpi_disabled;
 extern int acpi_pci_disabled;
 
diff --git a/include/asm-x86_64/ist.h b/include/asm-x86_64/ist.h
new file mode 100644 (file)
index 0000000..338857e
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-i386/ist.h>
index 9c3f8de90d2da9c10de87d5ed3b52dfb1acc2862..b897e8cb55fbb7a73a43d4f1ac7a16a20f3d56d2 100644 (file)
@@ -44,7 +44,6 @@ extern unsigned long saved_context_eflags;
 
 extern void fix_processor_context(void);
 
-#ifdef CONFIG_ACPI_SLEEP
 extern unsigned long saved_rip;
 extern unsigned long saved_rsp;
 extern unsigned long saved_rbp;
@@ -54,4 +53,3 @@ extern unsigned long saved_rdi;
 
 /* routines for saving/restoring kernel state */
 extern int acpi_save_state_mem(void);
-#endif
index d5680cd7746a9b72b4ff0fbc4c07312dc1f97389..bf5e0009de75cd1f12c61e4f96a303f60dc907f0 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 
 #include <linux/list.h>
+#include <linux/mod_devicetable.h>
 
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
index 290aef326812024ff361164b13605365b1772626..5f921c84827ab19d1b29b779cb2865a4148554da 100644 (file)
@@ -21,20 +21,22 @@ typedef unsigned short      apm_eventinfo_t;
 
 #ifdef __KERNEL__
 
+#include <linux/types.h>
+
 #define APM_CS         (GDT_ENTRY_APMBIOS_BASE * 8)
 #define APM_CS_16      (APM_CS + 8)
 #define APM_DS         (APM_CS_16 + 8)
 
 struct apm_bios_info {
-       unsigned short  version;
-       unsigned short  cseg;
-       unsigned long   offset;
-       unsigned short  cseg_16;
-       unsigned short  dseg;
-       unsigned short  flags;
-       unsigned short  cseg_len;
-       unsigned short  cseg_16_len;
-       unsigned short  dseg_len;
+       u16     version;
+       u16     cseg;
+       u32     offset;
+       u16     cseg_16;
+       u16     dseg;
+       u16     flags;
+       u16     cseg_len;
+       u16     cseg_16_len;
+       u16     dseg_len;
 };
 
 /* Results of APM Installation Check */
index af04a555b52cc9d1637e6d7100c940966844f604..2ada8ee316b3b04e94ee25d3a9c1939384771c2b 100644 (file)
@@ -159,6 +159,12 @@ struct ap_device_id {
 
 #define AP_DEVICE_ID_MATCH_DEVICE_TYPE         0x01
 
+#define ACPI_ID_LEN    9
+
+struct acpi_device_id {
+       __u8 id[ACPI_ID_LEN];
+       kernel_ulong_t driver_data;
+};
 
 #define PNP_ID_LEN     8
 #define PNP_MAX_DEVICES        8
index 2a1897e6f9372a08a81054bd3d67cb8a43fe59c0..66edb2293184d05cf5c8b800b81d336f9cfe38c3 100644 (file)
@@ -335,6 +335,10 @@ struct pnp_protocol {
        int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res);
        int (*disable)(struct pnp_dev *dev);
 
+       /* protocol specific suspend/resume */
+       int (*suspend)(struct pnp_dev *dev, pm_message_t state);
+       int (*resume)(struct pnp_dev *dev);
+
        /* used by pnp layer only (look but don't touch) */
        unsigned char           number;         /* protocol number*/
        struct device           dev;            /* link to driver model */
index e6aea5146e5d9a15acb5dc9f6e0216cfe26cb8d8..6a5f503b4f1d6a7fbed3175f88aa3110ff1e6ea6 100644 (file)
@@ -99,15 +99,11 @@ extern int update_persistent_clock(struct timespec now);
 extern int no_sync_cmos_clock __read_mostly;
 void timekeeping_init(void);
 
-static inline unsigned long get_seconds(void)
-{
-       return xtime.tv_sec;
-}
-
+unsigned long get_seconds(void);
 struct timespec current_kernel_time(void);
 
 #define CURRENT_TIME           (current_kernel_time())
-#define CURRENT_TIME_SEC       ((struct timespec) { xtime.tv_sec, 0 })
+#define CURRENT_TIME_SEC       ((struct timespec) { get_seconds(), 0 })
 
 extern void do_gettimeofday(struct timeval *tv);
 extern int do_settimeofday(struct timespec *tv);
index 70d0d88e55541821ff0fd9561e30fcae12e49e17..24f0f8b2ba724567861b6b8983b554f8f0473b90 100644 (file)
@@ -468,7 +468,7 @@ static void do_acct_process(struct file *file)
        }
 #endif
        do_div(elapsed, AHZ);
-       ac.ac_btime = xtime.tv_sec - elapsed;
+       ac.ac_btime = get_seconds() - elapsed;
        /* we really need to bite the bullet and change layout */
        ac.ac_uid = current->uid;
        ac.ac_gid = current->gid;
index eb1ddebd2c0413bbcc3c857aa568ac31150c35c0..c21ca6bfaa6600dd864ef1b32798dc1a4ae8c081 100644 (file)
@@ -141,11 +141,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
 
        do {
                seq = read_seqbegin(&xtime_lock);
-#ifdef CONFIG_NO_HZ
-               getnstimeofday(&xts);
-#else
-               xts = xtime;
-#endif
+               xts = current_kernel_time();
                tom = wall_to_monotonic;
        } while (read_seqretry(&xtime_lock, seq));
 
index ddebf3f2affe937d8a9ccb694de85dc9d567f1fb..eb26f2ba51ed33eb30f3be4c359875faad721e9f 100644 (file)
@@ -689,7 +689,7 @@ static ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec,
        },
 #endif
-#ifdef CONFIG_ACPI_SLEEP
+#if defined(CONFIG_ACPI) && defined(CONFIG_X86)
        {
                .ctl_name       = KERN_ACPI_VIDEO_FLAGS,
                .procname       = "acpi_video_flags",
index 5b81da08bbdb48d9bb452784298a4e0c480664fb..2289a8d68314f35f3c6b10f7edf8e53b721b8857 100644 (file)
@@ -215,22 +215,6 @@ asmlinkage long sys_adjtimex(struct timex __user *txc_p)
        return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret;
 }
 
-inline struct timespec current_kernel_time(void)
-{
-        struct timespec now;
-        unsigned long seq;
-
-       do {
-               seq = read_seqbegin(&xtime_lock);
-               
-               now = xtime;
-       } while (read_seqretry(&xtime_lock, seq));
-
-       return now; 
-}
-
-EXPORT_SYMBOL(current_kernel_time);
-
 /**
  * current_fs_time - Return FS time
  * @sb: Superblock.
index 88c81026e0039ae8cf16e3da6b1de223d3c96312..acc417b5a9b7786de60d124fc66b2dc5eb1c2111 100644 (file)
@@ -47,10 +47,22 @@ EXPORT_SYMBOL(xtime_lock);
 struct timespec xtime __attribute__ ((aligned (16)));
 struct timespec wall_to_monotonic __attribute__ ((aligned (16)));
 static unsigned long total_sleep_time;         /* seconds */
-
 EXPORT_SYMBOL(xtime);
 
 
+#ifdef CONFIG_NO_HZ
+static struct timespec xtime_cache __attribute__ ((aligned (16)));
+static inline void update_xtime_cache(u64 nsec)
+{
+       xtime_cache = xtime;
+       timespec_add_ns(&xtime_cache, nsec);
+}
+#else
+#define xtime_cache xtime
+/* We do *not* want to evaluate the argument for this case */
+#define update_xtime_cache(n) do { } while (0)
+#endif
+
 static struct clocksource *clock; /* pointer to current clocksource */
 
 
@@ -478,6 +490,8 @@ void update_wall_time(void)
        xtime.tv_nsec = (s64)clock->xtime_nsec >> clock->shift;
        clock->xtime_nsec -= (s64)xtime.tv_nsec << clock->shift;
 
+       update_xtime_cache(cyc2ns(clock, offset));
+
        /* check to see if there is a new clocksource to use */
        change_clocksource();
        update_vsyscall(&xtime, clock);
@@ -509,3 +523,25 @@ void monotonic_to_bootbased(struct timespec *ts)
 {
        ts->tv_sec += total_sleep_time;
 }
+
+unsigned long get_seconds(void)
+{
+       return xtime_cache.tv_sec;
+}
+EXPORT_SYMBOL(get_seconds);
+
+
+struct timespec current_kernel_time(void)
+{
+       struct timespec now;
+       unsigned long seq;
+
+       do {
+               seq = read_seqbegin(&xtime_lock);
+
+               now = xtime_cache;
+       } while (read_seqretry(&xtime_lock, seq));
+
+       return now;
+}
+EXPORT_SYMBOL(current_kernel_time);
index 658f638c402c48fbb307b1a8242c6dfe16d9a1ac..c122131a122f54121f239ece78f830efbaf90d69 100644 (file)
@@ -39,7 +39,7 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
        ac_etime = timespec_to_ns(&ts);
        do_div(ac_etime, NSEC_PER_USEC);
        stats->ac_etime = ac_etime;
-       stats->ac_btime = xtime.tv_sec - ts.tv_sec;
+       stats->ac_btime = get_seconds() - ts.tv_sec;
        if (thread_group_leader(tsk)) {
                stats->ac_exitcode = tsk->exit_code;
                if (tsk->flags & PF_FORKNOEXEC)
index 16a68df4e36b9a8ba8c4e44ceb65f39c3bfb1fe6..c58fa0d1be26b7cea959ae4e00d8a4bbfe2bde0e 100644 (file)
@@ -787,7 +787,7 @@ static int __init af_rxrpc_init(void)
 
        BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb));
 
-       rxrpc_epoch = htonl(xtime.tv_sec);
+       rxrpc_epoch = htonl(get_seconds());
 
        ret = -ENOMEM;
        rxrpc_call_jar = kmem_cache_create(
index 482750efc2355b4ea3f875044cd8b0323f848c62..372b24466dc768fa1765de0a471e10dc8ba0ad9d 100644 (file)
@@ -791,7 +791,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
 
        ASSERTCMP(atomic_read(&conn->usage), >, 0);
 
-       conn->put_time = xtime.tv_sec;
+       conn->put_time = get_seconds();
        if (atomic_dec_and_test(&conn->usage)) {
                _debug("zombie");
                rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
@@ -835,7 +835,7 @@ void rxrpc_connection_reaper(struct work_struct *work)
 
        _enter("");
 
-       now = xtime.tv_sec;
+       now = get_seconds();
        earliest = ULONG_MAX;
 
        write_lock_bh(&rxrpc_connection_lock);
index d43d78f19302f9a126dd226d5bc1ffedf0bd9502..bb282a6a19f0d7e38ac75542296acbf231330e77 100644 (file)
@@ -183,7 +183,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
 
        ASSERTCMP(atomic_read(&trans->usage), >, 0);
 
-       trans->put_time = xtime.tv_sec;
+       trans->put_time = get_seconds();
        if (unlikely(atomic_dec_and_test(&trans->usage)))
                _debug("zombie");
                /* let the reaper determine the timeout to avoid a race with
@@ -219,7 +219,7 @@ static void rxrpc_transport_reaper(struct work_struct *work)
 
        _enter("");
 
-       now = xtime.tv_sec;
+       now = get_seconds();
        earliest = ULONG_MAX;
 
        /* extract all the transports that have been dead too long */
index 5ec705144e10f7500b51755699afc97f3aa0e2a5..ac3cabdca78cb9e2ec3285cf3d6084315c336015 100644 (file)
@@ -916,7 +916,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
                issue = be32_to_cpu(stamp);
        }
        p += 4;
-       now = xtime.tv_sec;
+       now = get_seconds();
        _debug("KIV ISSUE: %lx [%lx]", issue, now);
 
        /* check the ticket is in date */
index 3f7b451f39557a99cfd3a3e600e2f680cb5432b9..7fd6055bedfddc6a6687f1ccc3cced4cab8c3d34 100644 (file)
@@ -315,7 +315,7 @@ quiet_cmd_link_multi-y = LD      $@
 cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
 
 quiet_cmd_link_multi-m = LD [M]  $@
-cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
+cmd_link_multi-m = $(cmd_link_multi-y)
 
 # We would rather have a list of rules like
 #      foo.o: $(foo-objs)
index c6fcc597b3be7c55c82f31d629ca093ce2f1de91..d988f5d21e3df12b50e31b9eac86bc21e82b867c 100644 (file)
@@ -56,23 +56,24 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
 
 # Step 2), invoke modpost
 #  Includes step 3,4
+modpost = scripts/mod/modpost                    \
+ $(if $(CONFIG_MODVERSIONS),-m)                  \
+ $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)       \
+ $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile)   \
+ $(if $(KBUILD_EXTMOD),-I $(modulesymfile))      \
+ $(if $(KBUILD_EXTMOD),-o $(modulesymfile))      \
+ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
+
 quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
-      cmd_modpost = scripts/mod/modpost            \
-        $(if $(CONFIG_MODVERSIONS),-m)             \
-       $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)  \
-       $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
-       $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
-       $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
-       $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
+      cmd_modpost = $(modpost) -s
 
 PHONY += __modpost
 __modpost: $(modules:.ko=.o) FORCE
        $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^)
 
 quiet_cmd_kernel-mod = MODPOST $@
-      cmd_kernel-mod = $(cmd_modpost) $@
+      cmd_kernel-mod = $(modpost) $@
 
-PHONY += vmlinux
 vmlinux.o: FORCE
        $(call cmd,kernel-mod)
 
@@ -97,7 +98,7 @@ targets += $(modules:.ko=.mod.o)
 
 # Step 6), final link of the modules
 quiet_cmd_ld_ko_o = LD [M]  $@
-      cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@           \
+      cmd_ld_ko_o = $(LD) -r $(LDFLAGS) $(LDFLAGS_MODULE) -o $@                \
                          $(filter-out FORCE,$^)
 
 $(modules): %.ko :%.o %.mod.o FORCE
index 1199baf866ca1c24c08b46972144e24f43353ff5..8be6a4269e63b8864a0a6472443381f2372cbe55 100644 (file)
@@ -37,6 +37,14 @@ static struct menu *rootEntry;
 
 static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
 
+static const char *get_help(struct menu *menu)
+{
+       if (menu_has_help(menu))
+               return menu_get_help(menu);
+       else
+               return nohelp_text;
+}
+
 static void strip(char *str)
 {
        char *p = str;
@@ -171,7 +179,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
 int conf_string(struct menu *menu)
 {
        struct symbol *sym = menu->sym;
-       const char *def, *help;
+       const char *def;
 
        while (1) {
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
@@ -186,10 +194,7 @@ int conf_string(struct menu *menu)
                case '?':
                        /* print help */
                        if (line[1] == '\n') {
-                               help = nohelp_text;
-                               if (menu->sym->help)
-                                       help = menu->sym->help;
-                               printf("\n%s\n", menu->sym->help);
+                               printf("\n%s\n", get_help(menu));
                                def = NULL;
                                break;
                        }
@@ -207,7 +212,6 @@ static int conf_sym(struct menu *menu)
        struct symbol *sym = menu->sym;
        int type;
        tristate oldval, newval;
-       const char *help;
 
        while (1) {
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
@@ -233,7 +237,7 @@ static int conf_sym(struct menu *menu)
                        printf("/m");
                if (oldval != yes && sym_tristate_within_range(sym, yes))
                        printf("/y");
-               if (sym->help)
+               if (menu_has_help(menu))
                        printf("/?");
                printf("] ");
                conf_askvalue(sym, sym_get_string_value(sym));
@@ -269,10 +273,7 @@ static int conf_sym(struct menu *menu)
                if (sym_set_tristate_value(sym, newval))
                        return 0;
 help:
-               help = nohelp_text;
-               if (sym->help)
-                       help = sym->help;
-               printf("\n%s\n", help);
+               printf("\n%s\n", get_help(menu));
        }
 }
 
@@ -342,7 +343,7 @@ static int conf_choice(struct menu *menu)
                        goto conf_childs;
                }
                printf("[1-%d", cnt);
-               if (sym->help)
+               if (menu_has_help(menu))
                        printf("?");
                printf("]: ");
                switch (input_mode) {
@@ -359,8 +360,7 @@ static int conf_choice(struct menu *menu)
                        fgets(line, 128, stdin);
                        strip(line);
                        if (line[0] == '?') {
-                               printf("\n%s\n", menu->sym->help ?
-                                       menu->sym->help : nohelp_text);
+                               printf("\n%s\n", get_help(menu));
                                continue;
                        }
                        if (!line[0])
@@ -391,8 +391,7 @@ static int conf_choice(struct menu *menu)
                if (!child)
                        continue;
                if (line[strlen(line) - 1] == '?') {
-                       printf("\n%s\n", child->sym->help ?
-                               child->sym->help : nohelp_text);
+                       printf("\n%s\n", get_help(child));
                        continue;
                }
                sym_set_choice_value(sym, child->sym);
index 6084525f604b10e9871ada2aa6ca096d5be481ff..a195986eec6f83f0d7b76627782815855fc845fe 100644 (file)
@@ -71,14 +71,12 @@ enum {
 struct symbol {
        struct symbol *next;
        char *name;
-       char *help;
        enum symbol_type type;
        struct symbol_value curr;
        struct symbol_value def[4];
        tristate visible;
        int flags;
        struct property *prop;
-       struct expr *dep, *dep2;
        struct expr_value rev_dep;
 };
 
@@ -139,7 +137,7 @@ struct menu {
        struct property *prompt;
        struct expr *dep;
        unsigned int flags;
-       //char *help;
+       char *help;
        struct file *file;
        int lineno;
        void *data;
index 61d8166166ef86177cf28b65575a9004f7113c08..262908cfc2ac66a057eb18d4a7c1853f96f34f95 100644 (file)
@@ -38,9 +38,6 @@ static gboolean show_all = FALSE;
 static gboolean show_debug = FALSE;
 static gboolean resizeable = FALSE;
 
-static char nohelp_text[] =
-    N_("Sorry, no help available for this option yet.\n");
-
 GtkWidget *main_wnd = NULL;
 GtkWidget *tree1_w = NULL;     // left  frame
 GtkWidget *tree2_w = NULL;     // right frame
@@ -462,12 +459,9 @@ static void text_insert_help(struct menu *menu)
        GtkTextIter start, end;
        const char *prompt = menu_get_prompt(menu);
        gchar *name;
-       const char *help = _(nohelp_text);
+       const char *help;
 
-       if (!menu->sym)
-               help = "";
-       else if (menu->sym->help)
-               help = _(menu->sym->help);
+       help = _(menu_get_help(menu));
 
        if (menu->sym && menu->sym->name)
                name = g_strdup_printf(_(menu->sym->name));
index 11f7dab94715625911eb51ed2d6f24a339f12824..6eb72a7f2562fc2d79847d8e4da2ad3ebb539a25 100644 (file)
@@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu)
                     menu->file == NULL ? "Root Menu" : menu->file->name,
                     menu->lineno);
 
-       if (menu->sym != NULL && menu->sym->help != NULL)
-               message__add(menu->sym->help, menu->sym->name,
+       if (menu->sym != NULL && menu_has_help(menu))
+               message__add(menu_get_help(menu), menu->sym->name,
                             menu->file == NULL ? "Root Menu" : menu->file->name,
                             menu->lineno);
 
index 15030770d1ad4e937272a6f03d7d704ebad70dff..4d09f6ddefe3daa71bb9d5d8bcbe1b774b0b2821 100644 (file)
@@ -15,6 +15,8 @@ P(menu_is_visible,bool,(struct menu *menu));
 P(menu_get_prompt,const char *,(struct menu *menu));
 P(menu_get_root_menu,struct menu *,(struct menu *menu));
 P(menu_get_parent_menu,struct menu *,(struct menu *menu));
+P(menu_has_help,bool,(struct menu *menu));
+P(menu_get_help,const char *,(struct menu *menu));
 
 /* symbol.c */
 P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
index d2c2a429887b30152b57d26eaea78086a41bd3c3..bc5854ed60554e9459fca037ff507ed4f7e79d16 100644 (file)
@@ -725,11 +725,11 @@ static void show_help(struct menu *menu)
        struct gstr help = str_new();
        struct symbol *sym = menu->sym;
 
-       if (sym->help)
+       if (menu_has_help(menu))
        {
                if (sym->name) {
                        str_printf(&help, "CONFIG_%s:\n\n", sym->name);
-                       str_append(&help, _(sym->help));
+                       str_append(&help, _(menu_get_help(menu)));
                        str_append(&help, "\n");
                }
        } else {
index f14aeac67d4f282e9e5c3edbe4a1398af1a7c4fb..f9d0d91a3fe44e2407761a60bb5a31dc22926b41 100644 (file)
@@ -417,3 +417,15 @@ struct menu *menu_get_parent_menu(struct menu *menu)
        return menu;
 }
 
+bool menu_has_help(struct menu *menu)
+{
+       return menu->help != NULL;
+}
+
+const char *menu_get_help(struct menu *menu)
+{
+       if (menu->help)
+               return menu->help;
+       else
+               return "";
+}
index f2a23a9c39386492773a9832603b13fb9ec7fb10..e4eeb59a8c24aae7065144f1618220d2f22b8cec 100644 (file)
@@ -1041,7 +1041,7 @@ void ConfigInfoView::menuInfo(void)
                if (showDebug())
                        debug = debug_info(sym);
 
-               help = print_filter(_(sym->help));
+               help = print_filter(_(menu_get_help(menu)));
        } else if (menu->prompt) {
                head += "<big><b>";
                head += print_filter(_(menu->prompt->text));
index 9a06b6771eee0c0095792aceda5117f1a91a0503..ec21db77f78bad37d5c5d872b6487cf9a43912a4 100644 (file)
@@ -1722,7 +1722,7 @@ yyreduce:
   case 83:
 
     {
-       current_entry->sym->help = (yyvsp[0].string);
+       current_entry->help = (yyvsp[0].string);
 ;}
     break;
 
@@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu)
                        break;
                }
        }
-       if (sym->help) {
-               int len = strlen(sym->help);
-               while (sym->help[--len] == '\n')
-                       sym->help[len] = 0;
-               fprintf(out, "  help\n%s\n", sym->help);
+       if (menu->help) {
+               int len = strlen(menu->help);
+               while (menu->help[--len] == '\n')
+                       menu->help[len] = 0;
+               fprintf(out, "  help\n%s\n", menu->help);
        }
        fputc('\n', out);
 }
index 92eb02bdf9c5f3a70ff96b5525fbcd89307afe63..79db4cf22a5127000f90fabfbee7b13c90c2d415 100644 (file)
@@ -402,7 +402,7 @@ help_start: T_HELP T_EOL
 
 help: help_start T_HELPTEXT
 {
-       current_entry->sym->help = $2;
+       current_entry->help = $2;
 };
 
 /* depends option */
@@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu)
                        break;
                }
        }
-       if (sym->help) {
-               int len = strlen(sym->help);
-               while (sym->help[--len] == '\n')
-                       sym->help[len] = 0;
-               fprintf(out, "  help\n%s\n", sym->help);
+       if (menu->help) {
+               int len = strlen(menu->help);
+               while (menu->help[--len] == '\n')
+                       menu->help[len] = 0;
+               fprintf(out, "  help\n%s\n", menu->help);
        }
        fputc('\n', out);
 }
index f646381dc0159c8c92841e7933ea2f3cecf9c0c5..8a09021d8c59ab7da6474b90dfbec9f46e3582f6 100644 (file)
@@ -290,6 +290,14 @@ static int do_serio_entry(const char *filename,
        return 1;
 }
 
+/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */
+static int do_acpi_entry(const char *filename,
+                       struct acpi_device_id *id, char *alias)
+{
+       sprintf(alias, "acpi*:%s:", id->id);
+       return 1;
+}
+
 /* looks like: "pnp:dD" */
 static int do_pnp_entry(const char *filename,
                        struct pnp_device_id *id, char *alias)
@@ -551,6 +559,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
                do_table(symval, sym->st_size,
                         sizeof(struct serio_device_id), "serio",
                         do_serio_entry, mod);
+       else if (sym_is(symname, "__mod_acpi_device_table"))
+               do_table(symval, sym->st_size,
+                        sizeof(struct acpi_device_id), "acpi",
+                        do_acpi_entry, mod);
        else if (sym_is(symname, "__mod_pnp_device_table"))
                do_table(symval, sym->st_size,
                         sizeof(struct pnp_device_id), "pnp",
index 5ab7914d30ef66f9d8880372ed47123a550ae168..ee58ded021d77d815eaa350207befda54186c008 100644 (file)
@@ -23,6 +23,8 @@ int have_vmlinux = 0;
 static int all_versions = 0;
 /* If we are modposting external module set to 1 */
 static int external_module = 0;
+/* Warn about section mismatch in vmlinux if set to 1 */
+static int vmlinux_section_warnings = 1;
 /* Only warn about unresolved symbols */
 static int warn_unresolved = 0;
 /* How a symbol is exported */
@@ -584,13 +586,61 @@ static int strrcmp(const char *s, const char *sub)
         return memcmp(s + slen - sublen, sub, sublen);
 }
 
+/*
+ * Functions used only during module init is marked __init and is stored in
+ * a .init.text section. Likewise data is marked __initdata and stored in
+ * a .init.data section.
+ * If this section is one of these sections return 1
+ * See include/linux/init.h for the details
+ */
+static int init_section(const char *name)
+{
+       if (strcmp(name, ".init") == 0)
+               return 1;
+       if (strncmp(name, ".init.", strlen(".init.")) == 0)
+               return 1;
+       return 0;
+}
+
+/*
+ * Functions used only during module exit is marked __exit and is stored in
+ * a .exit.text section. Likewise data is marked __exitdata and stored in
+ * a .exit.data section.
+ * If this section is one of these sections return 1
+ * See include/linux/init.h for the details
+ **/
+static int exit_section(const char *name)
+{
+       if (strcmp(name, ".exit.text") == 0)
+               return 1;
+       if (strcmp(name, ".exit.data") == 0)
+               return 1;
+       return 0;
+
+}
+
+/*
+ * Data sections are named like this:
+ * .data | .data.rel | .data.rel.*
+ * Return 1 if the specified section is a data section
+ */
+static int data_section(const char *name)
+{
+       if ((strcmp(name, ".data") == 0) ||
+           (strcmp(name, ".data.rel") == 0) ||
+           (strncmp(name, ".data.rel.", strlen(".data.rel.")) == 0))
+               return 1;
+       else
+               return 0;
+}
+
 /**
  * Whitelist to allow certain references to pass with no warning.
  *
  * Pattern 0:
  *   Do not warn if funtion/data are marked with __init_refok/__initdata_refok.
  *   The pattern is identified by:
- *   fromsec = .text.init.refok | .data.init.refok
+ *   fromsec = .text.init.refok* | .data.init.refok*
  *
  * Pattern 1:
  *   If a module parameter is declared __initdata and permissions=0
@@ -608,8 +658,8 @@ static int strrcmp(const char *s, const char *sub)
  *   These functions may often be marked __init and we do not want to
  *   warn here.
  *   the pattern is identified by:
- *   tosec   = .init.text | .exit.text | .init.data
- *   fromsec = .data | .data.rel | .data.rel.*
+ *   tosec   = init or exit section
+ *   fromsec = data section
  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer
  *
  * Pattern 3:
@@ -625,12 +675,18 @@ static int strrcmp(const char *s, const char *sub)
  *   This pattern is identified by
  *   refsymname = __init_begin, _sinittext, _einittext
  *
+ * Pattern 5:
+ *   Xtensa uses literal sections for constants that are accessed PC-relative.
+ *   Literal sections may safely reference their text sections.
+ *   (Note that the name for the literal section omits any trailing '.text')
+ *   tosec = <section>[.text]
+ *   fromsec = <section>.literal
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
                            const char *fromsec, const char *atsym,
                            const char *refsymname)
 {
-       int f1 = 1, f2 = 1;
+       int len;
        const char **s;
        const char *pat2sym[] = {
                "driver",
@@ -652,36 +708,21 @@ static int secref_whitelist(const char *modname, const char *tosec,
        };
 
        /* Check for pattern 0 */
-       if ((strcmp(fromsec, ".text.init.refok") == 0) ||
-           (strcmp(fromsec, ".data.init.refok") == 0))
+       if ((strncmp(fromsec, ".text.init.refok", strlen(".text.init.refok")) == 0) ||
+           (strncmp(fromsec, ".data.init.refok", strlen(".data.init.refok")) == 0))
                return 1;
 
        /* Check for pattern 1 */
-       if (strcmp(tosec, ".init.data") != 0)
-               f1 = 0;
-       if (strncmp(fromsec, ".data", strlen(".data")) != 0)
-               f1 = 0;
-       if (strncmp(atsym, "__param", strlen("__param")) != 0)
-               f1 = 0;
-
-       if (f1)
-               return f1;
+       if ((strcmp(tosec, ".init.data") == 0) &&
+           (strncmp(fromsec, ".data", strlen(".data")) == 0) &&
+           (strncmp(atsym, "__param", strlen("__param")) == 0))
+               return 1;
 
        /* Check for pattern 2 */
-       if ((strcmp(tosec, ".init.text") != 0) &&
-           (strcmp(tosec, ".exit.text") != 0) &&
-           (strcmp(tosec, ".init.data") != 0))
-               f2 = 0;
-       if ((strcmp(fromsec, ".data") != 0) &&
-           (strcmp(fromsec, ".data.rel") != 0) &&
-           (strncmp(fromsec, ".data.rel.", strlen(".data.rel.")) != 0))
-               f2 = 0;
-
-       for (s = pat2sym; *s; s++)
-               if (strrcmp(atsym, *s) == 0)
-                       f1 = 1;
-       if (f1 && f2)
-               return 1;
+       if ((init_section(tosec) || exit_section(tosec)) && data_section(fromsec))
+               for (s = pat2sym; *s; s++)
+                       if (strrcmp(atsym, *s) == 0)
+                               return 1;
 
        /* Check for pattern 3 */
        if ((strcmp(fromsec, ".text.head") == 0) &&
@@ -694,6 +735,15 @@ static int secref_whitelist(const char *modname, const char *tosec,
                if (strcmp(refsymname, *s) == 0)
                        return 1;
 
+       /* Check for pattern 5 */
+       if (strrcmp(tosec, ".text") == 0)
+               len = strlen(tosec) - strlen(".text");
+       else
+               len = strlen(tosec);
+       if ((strncmp(tosec, fromsec, len) == 0) && (strlen(fromsec) > len) &&
+           (strcmp(fromsec + len, ".literal") == 0))
+               return 1;
+
        return 0;
 }
 
@@ -822,9 +872,9 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
                refsymname = elf->strtab + refsym->st_name;
 
        /* check whitelist - we may ignore it */
-       if (before &&
-           secref_whitelist(modname, secname, fromsec,
-                            elf->strtab + before->st_name, refsymname))
+       if (secref_whitelist(modname, secname, fromsec,
+                            before ? elf->strtab + before->st_name : "",
+                            refsymname))
                return;
 
        if (before && after) {
@@ -1077,6 +1127,8 @@ static int initexit_section_ref_ok(const char *name)
                ".smp_locks",
                ".stab",
                ".m68k_fixup",
+               ".xt.prop",             /* xtensa informational section */
+               ".xt.lit",              /* xtensa informational section */
                NULL
        };
        /* Start of section names */
@@ -1106,21 +1158,6 @@ static int initexit_section_ref_ok(const char *name)
        return 0;
 }
 
-/**
- * Functions used only during module init is marked __init and is stored in
- * a .init.text section. Likewise data is marked __initdata and stored in
- * a .init.data section.
- * If this section is one of these sections return 1
- * See include/linux/init.h for the details
- **/
-static int init_section(const char *name)
-{
-       if (strcmp(name, ".init") == 0)
-               return 1;
-       if (strncmp(name, ".init.", strlen(".init.")) == 0)
-               return 1;
-       return 0;
-}
 
 /*
  * Identify sections from which references to a .init section is OK.
@@ -1177,23 +1214,6 @@ static int init_section_ref_ok(const char *name)
        return 0;
 }
 
-/*
- * Functions used only during module exit is marked __exit and is stored in
- * a .exit.text section. Likewise data is marked __exitdata and stored in
- * a .exit.data section.
- * If this section is one of these sections return 1
- * See include/linux/init.h for the details
- **/
-static int exit_section(const char *name)
-{
-       if (strcmp(name, ".exit.text") == 0)
-               return 1;
-       if (strcmp(name, ".exit.data") == 0)
-               return 1;
-       return 0;
-
-}
-
 /*
  * Identify sections from which references to a .exit section is OK.
  */
@@ -1257,8 +1277,10 @@ static void read_symbols(char *modname)
                handle_modversions(mod, &info, sym, symname);
                handle_moddevtable(mod, &info, sym, symname);
        }
-       check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok);
-       check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok);
+       if (is_vmlinux(modname) && vmlinux_section_warnings) {
+               check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok);
+               check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok);
+       }
 
        version = get_modinfo(info.modinfo, info.modinfo_len, "version");
        if (version)
@@ -1626,7 +1648,7 @@ int main(int argc, char **argv)
        int opt;
        int err;
 
-       while ((opt = getopt(argc, argv, "i:I:mo:aw")) != -1) {
+       while ((opt = getopt(argc, argv, "i:I:mso:aw")) != -1) {
                switch(opt) {
                        case 'i':
                                kernel_read = optarg;
@@ -1644,6 +1666,9 @@ int main(int argc, char **argv)
                        case 'a':
                                all_versions = 1;
                                break;
+                       case 's':
+                               vmlinux_section_warnings = 0;
+                               break;
                        case 'w':
                                warn_unresolved = 1;
                                break;
index 72876dfadc8ae9fd6125737910cd8555ae8d17f1..8f8df93141a9c0b6c4e6a0a3075b77882ab2b196 100755 (executable)
@@ -66,8 +66,8 @@ showmount --version 2>&1 | grep nfs-utils | awk \
 'NR==1{print "nfs-utils             ", $NF}'
 
 ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
--e 's/\.so$//' | awk -F'[.-]'   '{print "Linux C Library        " \
-$(NF-2)"."$(NF-1)"."$NF}'
+-e 's/\.so$//' | sed -e 's/>//' | \
+awk -F'[.-]' '{print "Linux C Library        "$(NF-1)"."$NF}'
 
 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
 'NR==1{print "Dynamic linker (ldd)  ", $NF}'
index bd8d1ef40a905e9fb532d8be84c9082576bc5bfd..ba715f40b658e4dfd63a05024ab566bcb81daf9c 100644 (file)
@@ -216,7 +216,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp,
                return -ENOMEM;
 
        *ctxp = ctx = kmalloc(sizeof(*ctx) +
-                             uctx->ctx_len,
+                             uctx->ctx_len + 1,
                              GFP_KERNEL);
 
        if (!ctx)
@@ -229,6 +229,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp,
        memcpy(ctx->ctx_str,
               uctx+1,
               ctx->ctx_len);
+       ctx->ctx_str[ctx->ctx_len] = 0;
        rc = security_context_to_sid(ctx->ctx_str,
                                     ctx->ctx_len,
                                     &ctx->ctx_sid);