diff options
151 files changed, 1287 insertions, 755 deletions
| @@ -299,7 +299,7 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C | |||
| 299 | MODFLAGS = -DMODULE | 299 | MODFLAGS = -DMODULE |
| 300 | CFLAGS_MODULE = $(MODFLAGS) | 300 | CFLAGS_MODULE = $(MODFLAGS) |
| 301 | AFLAGS_MODULE = $(MODFLAGS) | 301 | AFLAGS_MODULE = $(MODFLAGS) |
| 302 | LDFLAGS_MODULE = -r | 302 | LDFLAGS_MODULE = |
| 303 | CFLAGS_KERNEL = | 303 | CFLAGS_KERNEL = |
| 304 | AFLAGS_KERNEL = | 304 | AFLAGS_KERNEL = |
| 305 | 305 | ||
diff --git a/arch/i386/boot/apm.c b/arch/i386/boot/apm.c index a34087c370c0..eab50c55a3a5 100644 --- a/arch/i386/boot/apm.c +++ b/arch/i386/boot/apm.c | |||
| @@ -40,14 +40,15 @@ int query_apm_bios(void) | |||
| 40 | if (bx != 0x504d) /* "PM" signature */ | 40 | if (bx != 0x504d) /* "PM" signature */ |
| 41 | return -1; | 41 | return -1; |
| 42 | 42 | ||
| 43 | if (cx & 0x02) /* 32 bits supported? */ | 43 | if (!(cx & 0x02)) /* 32 bits supported? */ |
| 44 | return -1; | 44 | return -1; |
| 45 | 45 | ||
| 46 | /* Disconnect first, just in case */ | 46 | /* Disconnect first, just in case */ |
| 47 | ax = 0x5304; | 47 | ax = 0x5304; |
| 48 | bx = 0; | ||
| 48 | asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp" | 49 | asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp" |
| 49 | : "+a" (ax) | 50 | : "+a" (ax), "+b" (bx) |
| 50 | : : "ebx", "ecx", "edx", "esi", "edi"); | 51 | : : "ecx", "edx", "esi", "edi"); |
| 51 | 52 | ||
| 52 | /* Paranoia */ | 53 | /* Paranoia */ |
| 53 | ebx = esi = 0; | 54 | ebx = esi = 0; |
diff --git a/arch/i386/boot/main.c b/arch/i386/boot/main.c index 7f01f96c4fb8..0eeef3989a17 100644 --- a/arch/i386/boot/main.c +++ b/arch/i386/boot/main.c | |||
| @@ -73,15 +73,15 @@ static void keyboard_set_repeat(void) | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | /* | 75 | /* |
| 76 | * Get Intel SpeedStep IST information. | 76 | * Get Intel SpeedStep (IST) information. |
| 77 | */ | 77 | */ |
| 78 | static void query_speedstep_ist(void) | 78 | static void query_ist(void) |
| 79 | { | 79 | { |
| 80 | asm("int $0x15" | 80 | asm("int $0x15" |
| 81 | : "=a" (boot_params.speedstep_info[0]), | 81 | : "=a" (boot_params.ist_info.signature), |
| 82 | "=b" (boot_params.speedstep_info[1]), | 82 | "=b" (boot_params.ist_info.command), |
| 83 | "=c" (boot_params.speedstep_info[2]), | 83 | "=c" (boot_params.ist_info.event), |
| 84 | "=d" (boot_params.speedstep_info[3]) | 84 | "=d" (boot_params.ist_info.perf_level) |
| 85 | : "a" (0x0000e980), /* IST Support */ | 85 | : "a" (0x0000e980), /* IST Support */ |
| 86 | "d" (0x47534943)); /* Request value */ | 86 | "d" (0x47534943)); /* Request value */ |
| 87 | } | 87 | } |
| @@ -144,8 +144,8 @@ void main(void) | |||
| 144 | query_voyager(); | 144 | query_voyager(); |
| 145 | #endif | 145 | #endif |
| 146 | 146 | ||
| 147 | /* Query SpeedStep IST information */ | 147 | /* Query Intel SpeedStep (IST) information */ |
| 148 | query_speedstep_ist(); | 148 | query_ist(); |
| 149 | 149 | ||
| 150 | /* Query APM information */ | 150 | /* Query APM information */ |
| 151 | #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) | 151 | #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) |
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile index 7f7be01f44e6..223f58fc9f46 100644 --- a/arch/i386/kernel/acpi/Makefile +++ b/arch/i386/kernel/acpi/Makefile | |||
| @@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI) += boot.o | |||
| 2 | ifneq ($(CONFIG_PCI),) | 2 | ifneq ($(CONFIG_PCI),) |
| 3 | obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o | 3 | obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o |
| 4 | endif | 4 | endif |
| 5 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o | 5 | obj-$(CONFIG_ACPI) += sleep.o wakeup.o |
| 6 | 6 | ||
| 7 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | 7 | ifneq ($(CONFIG_ACPI_PROCESSOR),) |
| 8 | obj-y += cstate.o processor.o | 8 | obj-y += cstate.o processor.o |
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index d474cd639bcb..7fe5da3c932e 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
| @@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void) | |||
| 422 | */ | 422 | */ |
| 423 | reserve_bootmem(PAGE_SIZE, PAGE_SIZE); | 423 | reserve_bootmem(PAGE_SIZE, PAGE_SIZE); |
| 424 | #endif | 424 | #endif |
| 425 | #ifdef CONFIG_ACPI_SLEEP | 425 | #ifdef CONFIG_ACPI |
| 426 | /* | 426 | /* |
| 427 | * Reserve low memory region for sleep support. | 427 | * Reserve low memory region for sleep support. |
| 428 | */ | 428 | */ |
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index c3b9905af2d5..1b1a1e66d099 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c | |||
| @@ -432,7 +432,7 @@ static void __init pagetable_init (void) | |||
| 432 | paravirt_pagetable_setup_done(pgd_base); | 432 | paravirt_pagetable_setup_done(pgd_base); |
| 433 | } | 433 | } |
| 434 | 434 | ||
| 435 | #if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP) | 435 | #if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI) |
| 436 | /* | 436 | /* |
| 437 | * Swap suspend & friends need this for resume because things like the intel-agp | 437 | * Swap suspend & friends need this for resume because things like the intel-agp |
| 438 | * driver might have split up a kernel 4MB mapping. | 438 | * driver might have split up a kernel 4MB mapping. |
diff --git a/arch/ia64/ia32/ia32_support.c b/arch/ia64/ia32/ia32_support.c index e13a1a1db4b5..d1d50cd1c38a 100644 --- a/arch/ia64/ia32/ia32_support.c +++ b/arch/ia64/ia32/ia32_support.c | |||
| @@ -249,11 +249,11 @@ ia32_init (void) | |||
| 249 | 249 | ||
| 250 | #if PAGE_SHIFT > IA32_PAGE_SHIFT | 250 | #if PAGE_SHIFT > IA32_PAGE_SHIFT |
| 251 | { | 251 | { |
| 252 | extern struct kmem_cache *partial_page_cachep; | 252 | extern struct kmem_cache *ia64_partial_page_cachep; |
| 253 | 253 | ||
| 254 | partial_page_cachep = kmem_cache_create("partial_page_cache", | 254 | ia64_partial_page_cachep = kmem_cache_create("ia64_partial_page_cache", |
| 255 | sizeof(struct partial_page), | 255 | sizeof(struct ia64_partial_page), |
| 256 | 0, SLAB_PANIC, NULL); | 256 | 0, SLAB_PANIC, NULL); |
| 257 | } | 257 | } |
| 258 | #endif | 258 | #endif |
| 259 | return 0; | 259 | return 0; |
diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h index cfa0bc0026b5..466bbcb138b2 100644 --- a/arch/ia64/ia32/ia32priv.h +++ b/arch/ia64/ia32/ia32priv.h | |||
| @@ -25,8 +25,8 @@ | |||
| 25 | * partially mapped pages provide precise accounting of which 4k sub pages | 25 | * partially mapped pages provide precise accounting of which 4k sub pages |
| 26 | * are mapped and which ones are not, thereby improving IA-32 compatibility. | 26 | * are mapped and which ones are not, thereby improving IA-32 compatibility. |
| 27 | */ | 27 | */ |
| 28 | struct partial_page { | 28 | struct ia64_partial_page { |
| 29 | struct partial_page *next; /* linked list, sorted by address */ | 29 | struct ia64_partial_page *next; /* linked list, sorted by address */ |
| 30 | struct rb_node pp_rb; | 30 | struct rb_node pp_rb; |
| 31 | /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*64 | 31 | /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*64 |
| 32 | * should suffice.*/ | 32 | * should suffice.*/ |
| @@ -34,17 +34,17 @@ struct partial_page { | |||
| 34 | unsigned int base; | 34 | unsigned int base; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | struct partial_page_list { | 37 | struct ia64_partial_page_list { |
| 38 | struct partial_page *pp_head; /* list head, points to the lowest | 38 | struct ia64_partial_page *pp_head; /* list head, points to the lowest |
| 39 | * addressed partial page */ | 39 | * addressed partial page */ |
| 40 | struct rb_root ppl_rb; | 40 | struct rb_root ppl_rb; |
| 41 | struct partial_page *pp_hint; /* pp_hint->next is the last | 41 | struct ia64_partial_page *pp_hint; /* pp_hint->next is the last |
| 42 | * accessed partial page */ | 42 | * accessed partial page */ |
| 43 | atomic_t pp_count; /* reference count */ | 43 | atomic_t pp_count; /* reference count */ |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | #if PAGE_SHIFT > IA32_PAGE_SHIFT | 46 | #if PAGE_SHIFT > IA32_PAGE_SHIFT |
| 47 | struct partial_page_list* ia32_init_pp_list (void); | 47 | struct ia64_partial_page_list* ia32_init_pp_list (void); |
| 48 | #else | 48 | #else |
| 49 | # define ia32_init_pp_list() 0 | 49 | # define ia32_init_pp_list() 0 |
| 50 | #endif | 50 | #endif |
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 0afb4fe7c35b..af10462d44d4 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
| @@ -253,17 +253,17 @@ mmap_subpage (struct file *file, unsigned long start, unsigned long end, int pro | |||
| 253 | return ret; | 253 | return ret; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | /* SLAB cache for partial_page structures */ | 256 | /* SLAB cache for ia64_partial_page structures */ |
| 257 | struct kmem_cache *partial_page_cachep; | 257 | struct kmem_cache *ia64_partial_page_cachep; |
| 258 | 258 | ||
| 259 | /* | 259 | /* |
| 260 | * init partial_page_list. | 260 | * init ia64_partial_page_list. |
| 261 | * return 0 means kmalloc fail. | 261 | * return 0 means kmalloc fail. |
| 262 | */ | 262 | */ |
| 263 | struct partial_page_list* | 263 | struct ia64_partial_page_list* |
| 264 | ia32_init_pp_list(void) | 264 | ia32_init_pp_list(void) |
| 265 | { | 265 | { |
| 266 | struct partial_page_list *p; | 266 | struct ia64_partial_page_list *p; |
| 267 | 267 | ||
| 268 | if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) | 268 | if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) |
| 269 | return p; | 269 | return p; |
| @@ -280,12 +280,12 @@ ia32_init_pp_list(void) | |||
| 280 | * Else, return 0 and provide @pprev, @rb_link, @rb_parent to | 280 | * Else, return 0 and provide @pprev, @rb_link, @rb_parent to |
| 281 | * be used by later __ia32_insert_pp(). | 281 | * be used by later __ia32_insert_pp(). |
| 282 | */ | 282 | */ |
| 283 | static struct partial_page * | 283 | static struct ia64_partial_page * |
| 284 | __ia32_find_pp(struct partial_page_list *ppl, unsigned int start, | 284 | __ia32_find_pp(struct ia64_partial_page_list *ppl, unsigned int start, |
| 285 | struct partial_page **pprev, struct rb_node ***rb_link, | 285 | struct ia64_partial_page **pprev, struct rb_node ***rb_link, |
| 286 | struct rb_node **rb_parent) | 286 | struct rb_node **rb_parent) |
| 287 | { | 287 | { |
| 288 | struct partial_page *pp; | 288 | struct ia64_partial_page *pp; |
| 289 | struct rb_node **__rb_link, *__rb_parent, *rb_prev; | 289 | struct rb_node **__rb_link, *__rb_parent, *rb_prev; |
| 290 | 290 | ||
| 291 | pp = ppl->pp_hint; | 291 | pp = ppl->pp_hint; |
| @@ -297,7 +297,7 @@ __ia32_find_pp(struct partial_page_list *ppl, unsigned int start, | |||
| 297 | 297 | ||
| 298 | while (*__rb_link) { | 298 | while (*__rb_link) { |
| 299 | __rb_parent = *__rb_link; | 299 | __rb_parent = *__rb_link; |
| 300 | pp = rb_entry(__rb_parent, struct partial_page, pp_rb); | 300 | pp = rb_entry(__rb_parent, struct ia64_partial_page, pp_rb); |
| 301 | 301 | ||
| 302 | if (pp->base == start) { | 302 | if (pp->base == start) { |
| 303 | ppl->pp_hint = pp; | 303 | ppl->pp_hint = pp; |
| @@ -314,7 +314,7 @@ __ia32_find_pp(struct partial_page_list *ppl, unsigned int start, | |||
| 314 | *rb_parent = __rb_parent; | 314 | *rb_parent = __rb_parent; |
| 315 | *pprev = NULL; | 315 | *pprev = NULL; |
| 316 | if (rb_prev) | 316 | if (rb_prev) |
| 317 | *pprev = rb_entry(rb_prev, struct partial_page, pp_rb); | 317 | *pprev = rb_entry(rb_prev, struct ia64_partial_page, pp_rb); |
| 318 | return NULL; | 318 | return NULL; |
| 319 | } | 319 | } |
| 320 | 320 | ||
| @@ -322,9 +322,9 @@ __ia32_find_pp(struct partial_page_list *ppl, unsigned int start, | |||
| 322 | * insert @pp into @ppl. | 322 | * insert @pp into @ppl. |
| 323 | */ | 323 | */ |
| 324 | static void | 324 | static void |
| 325 | __ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp, | 325 | __ia32_insert_pp(struct ia64_partial_page_list *ppl, |
| 326 | struct partial_page *prev, struct rb_node **rb_link, | 326 | struct ia64_partial_page *pp, struct ia64_partial_page *prev, |
| 327 | struct rb_node *rb_parent) | 327 | struct rb_node **rb_link, struct rb_node *rb_parent) |
| 328 | { | 328 | { |
| 329 | /* link list */ | 329 | /* link list */ |
| 330 | if (prev) { | 330 | if (prev) { |
| @@ -334,7 +334,7 @@ __ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp, | |||
| 334 | ppl->pp_head = pp; | 334 | ppl->pp_head = pp; |
| 335 | if (rb_parent) | 335 | if (rb_parent) |
| 336 | pp->next = rb_entry(rb_parent, | 336 | pp->next = rb_entry(rb_parent, |
| 337 | struct partial_page, pp_rb); | 337 | struct ia64_partial_page, pp_rb); |
| 338 | else | 338 | else |
| 339 | pp->next = NULL; | 339 | pp->next = NULL; |
| 340 | } | 340 | } |
| @@ -350,8 +350,8 @@ __ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp, | |||
| 350 | * delete @pp from partial page list @ppl. | 350 | * delete @pp from partial page list @ppl. |
| 351 | */ | 351 | */ |
| 352 | static void | 352 | static void |
| 353 | __ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp, | 353 | __ia32_delete_pp(struct ia64_partial_page_list *ppl, |
| 354 | struct partial_page *prev) | 354 | struct ia64_partial_page *pp, struct ia64_partial_page *prev) |
| 355 | { | 355 | { |
| 356 | if (prev) { | 356 | if (prev) { |
| 357 | prev->next = pp->next; | 357 | prev->next = pp->next; |
| @@ -363,15 +363,15 @@ __ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp, | |||
| 363 | ppl->pp_hint = pp->next; | 363 | ppl->pp_hint = pp->next; |
| 364 | } | 364 | } |
| 365 | rb_erase(&pp->pp_rb, &ppl->ppl_rb); | 365 | rb_erase(&pp->pp_rb, &ppl->ppl_rb); |
| 366 | kmem_cache_free(partial_page_cachep, pp); | 366 | kmem_cache_free(ia64_partial_page_cachep, pp); |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | static struct partial_page * | 369 | static struct ia64_partial_page * |
| 370 | __pp_prev(struct partial_page *pp) | 370 | __pp_prev(struct ia64_partial_page *pp) |
| 371 | { | 371 | { |
| 372 | struct rb_node *prev = rb_prev(&pp->pp_rb); | 372 | struct rb_node *prev = rb_prev(&pp->pp_rb); |
| 373 | if (prev) | 373 | if (prev) |
| 374 | return rb_entry(prev, struct partial_page, pp_rb); | 374 | return rb_entry(prev, struct ia64_partial_page, pp_rb); |
| 375 | else | 375 | else |
| 376 | return NULL; | 376 | return NULL; |
| 377 | } | 377 | } |
| @@ -383,7 +383,7 @@ __pp_prev(struct partial_page *pp) | |||
| 383 | static void | 383 | static void |
| 384 | __ia32_delete_pp_range(unsigned int start, unsigned int end) | 384 | __ia32_delete_pp_range(unsigned int start, unsigned int end) |
| 385 | { | 385 | { |
| 386 | struct partial_page *pp, *prev; | 386 | struct ia64_partial_page *pp, *prev; |
| 387 | struct rb_node **rb_link, *rb_parent; | 387 | struct rb_node **rb_link, *rb_parent; |
| 388 | 388 | ||
| 389 | if (start >= end) | 389 | if (start >= end) |
| @@ -401,7 +401,7 @@ __ia32_delete_pp_range(unsigned int start, unsigned int end) | |||
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | while (pp && pp->base < end) { | 403 | while (pp && pp->base < end) { |
| 404 | struct partial_page *tmp = pp->next; | 404 | struct ia64_partial_page *tmp = pp->next; |
| 405 | __ia32_delete_pp(current->thread.ppl, pp, prev); | 405 | __ia32_delete_pp(current->thread.ppl, pp, prev); |
| 406 | pp = tmp; | 406 | pp = tmp; |
| 407 | } | 407 | } |
| @@ -414,7 +414,7 @@ __ia32_delete_pp_range(unsigned int start, unsigned int end) | |||
| 414 | static int | 414 | static int |
| 415 | __ia32_set_pp(unsigned int start, unsigned int end, int flags) | 415 | __ia32_set_pp(unsigned int start, unsigned int end, int flags) |
| 416 | { | 416 | { |
| 417 | struct partial_page *pp, *prev; | 417 | struct ia64_partial_page *pp, *prev; |
| 418 | struct rb_node ** rb_link, *rb_parent; | 418 | struct rb_node ** rb_link, *rb_parent; |
| 419 | unsigned int pstart, start_bit, end_bit, i; | 419 | unsigned int pstart, start_bit, end_bit, i; |
| 420 | 420 | ||
| @@ -450,8 +450,8 @@ __ia32_set_pp(unsigned int start, unsigned int end, int flags) | |||
| 450 | return 0; | 450 | return 0; |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | /* new a partial_page */ | 453 | /* new a ia64_partial_page */ |
| 454 | pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); | 454 | pp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL); |
| 455 | if (!pp) | 455 | if (!pp) |
| 456 | return -ENOMEM; | 456 | return -ENOMEM; |
| 457 | pp->base = pstart; | 457 | pp->base = pstart; |
| @@ -504,7 +504,7 @@ ia32_set_pp(unsigned int start, unsigned int end, int flags) | |||
| 504 | static int | 504 | static int |
| 505 | __ia32_unset_pp(unsigned int start, unsigned int end) | 505 | __ia32_unset_pp(unsigned int start, unsigned int end) |
| 506 | { | 506 | { |
| 507 | struct partial_page *pp, *prev; | 507 | struct ia64_partial_page *pp, *prev; |
| 508 | struct rb_node ** rb_link, *rb_parent; | 508 | struct rb_node ** rb_link, *rb_parent; |
| 509 | unsigned int pstart, start_bit, end_bit, i; | 509 | unsigned int pstart, start_bit, end_bit, i; |
| 510 | struct vm_area_struct *vma; | 510 | struct vm_area_struct *vma; |
| @@ -532,8 +532,8 @@ __ia32_unset_pp(unsigned int start, unsigned int end) | |||
| 532 | return -ENOMEM; | 532 | return -ENOMEM; |
| 533 | } | 533 | } |
| 534 | 534 | ||
| 535 | /* new a partial_page */ | 535 | /* new a ia64_partial_page */ |
| 536 | pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); | 536 | pp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL); |
| 537 | if (!pp) | 537 | if (!pp) |
| 538 | return -ENOMEM; | 538 | return -ENOMEM; |
| 539 | pp->base = pstart; | 539 | pp->base = pstart; |
| @@ -605,7 +605,7 @@ ia32_unset_pp(unsigned int *startp, unsigned int *endp) | |||
| 605 | static int | 605 | static int |
| 606 | __ia32_compare_pp(unsigned int start, unsigned int end) | 606 | __ia32_compare_pp(unsigned int start, unsigned int end) |
| 607 | { | 607 | { |
| 608 | struct partial_page *pp, *prev; | 608 | struct ia64_partial_page *pp, *prev; |
| 609 | struct rb_node ** rb_link, *rb_parent; | 609 | struct rb_node ** rb_link, *rb_parent; |
| 610 | unsigned int pstart, start_bit, end_bit, size; | 610 | unsigned int pstart, start_bit, end_bit, size; |
| 611 | unsigned int first_bit, next_zero_bit; /* the first range in bitmap */ | 611 | 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) | |||
| 682 | } | 682 | } |
| 683 | 683 | ||
| 684 | static void | 684 | static void |
| 685 | __ia32_drop_pp_list(struct partial_page_list *ppl) | 685 | __ia32_drop_pp_list(struct ia64_partial_page_list *ppl) |
| 686 | { | 686 | { |
| 687 | struct partial_page *pp = ppl->pp_head; | 687 | struct ia64_partial_page *pp = ppl->pp_head; |
| 688 | 688 | ||
| 689 | while (pp) { | 689 | while (pp) { |
| 690 | struct partial_page *next = pp->next; | 690 | struct ia64_partial_page *next = pp->next; |
| 691 | kmem_cache_free(partial_page_cachep, pp); | 691 | kmem_cache_free(ia64_partial_page_cachep, pp); |
| 692 | pp = next; | 692 | pp = next; |
| 693 | } | 693 | } |
| 694 | 694 | ||
| @@ -696,9 +696,9 @@ __ia32_drop_pp_list(struct partial_page_list *ppl) | |||
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | void | 698 | void |
| 699 | ia32_drop_partial_page_list(struct task_struct *task) | 699 | ia32_drop_ia64_partial_page_list(struct task_struct *task) |
| 700 | { | 700 | { |
| 701 | struct partial_page_list* ppl = task->thread.ppl; | 701 | struct ia64_partial_page_list* ppl = task->thread.ppl; |
| 702 | 702 | ||
| 703 | if (ppl && atomic_dec_and_test(&ppl->pp_count)) | 703 | if (ppl && atomic_dec_and_test(&ppl->pp_count)) |
| 704 | __ia32_drop_pp_list(ppl); | 704 | __ia32_drop_pp_list(ppl); |
| @@ -708,9 +708,9 @@ ia32_drop_partial_page_list(struct task_struct *task) | |||
| 708 | * Copy current->thread.ppl to ppl (already initialized). | 708 | * Copy current->thread.ppl to ppl (already initialized). |
| 709 | */ | 709 | */ |
| 710 | static int | 710 | static int |
| 711 | __ia32_copy_pp_list(struct partial_page_list *ppl) | 711 | __ia32_copy_pp_list(struct ia64_partial_page_list *ppl) |
| 712 | { | 712 | { |
| 713 | struct partial_page *pp, *tmp, *prev; | 713 | struct ia64_partial_page *pp, *tmp, *prev; |
| 714 | struct rb_node **rb_link, *rb_parent; | 714 | struct rb_node **rb_link, *rb_parent; |
| 715 | 715 | ||
| 716 | ppl->pp_head = NULL; | 716 | ppl->pp_head = NULL; |
| @@ -721,7 +721,7 @@ __ia32_copy_pp_list(struct partial_page_list *ppl) | |||
| 721 | prev = NULL; | 721 | prev = NULL; |
| 722 | 722 | ||
| 723 | for (pp = current->thread.ppl->pp_head; pp; pp = pp->next) { | 723 | for (pp = current->thread.ppl->pp_head; pp; pp = pp->next) { |
| 724 | tmp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); | 724 | tmp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL); |
| 725 | if (!tmp) | 725 | if (!tmp) |
| 726 | return -ENOMEM; | 726 | return -ENOMEM; |
| 727 | *tmp = *pp; | 727 | *tmp = *pp; |
| @@ -734,7 +734,8 @@ __ia32_copy_pp_list(struct partial_page_list *ppl) | |||
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | int | 736 | int |
| 737 | ia32_copy_partial_page_list(struct task_struct *p, unsigned long clone_flags) | 737 | ia32_copy_ia64_partial_page_list(struct task_struct *p, |
| 738 | unsigned long clone_flags) | ||
| 738 | { | 739 | { |
| 739 | int retval = 0; | 740 | int retval = 0; |
| 740 | 741 | ||
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 103dd8edda71..c6ede8780ded 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
| @@ -67,6 +67,8 @@ EXPORT_SYMBOL(pm_power_off); | |||
| 67 | unsigned int acpi_cpei_override; | 67 | unsigned int acpi_cpei_override; |
| 68 | unsigned int acpi_cpei_phys_cpuid; | 68 | unsigned int acpi_cpei_phys_cpuid; |
| 69 | 69 | ||
| 70 | unsigned long acpi_wakeup_address = 0; | ||
| 71 | |||
| 70 | const char __init * | 72 | const char __init * |
| 71 | acpi_get_sysname(void) | 73 | acpi_get_sysname(void) |
| 72 | { | 74 | { |
| @@ -986,4 +988,21 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) | |||
| 986 | 988 | ||
| 987 | EXPORT_SYMBOL(acpi_unregister_ioapic); | 989 | EXPORT_SYMBOL(acpi_unregister_ioapic); |
| 988 | 990 | ||
| 991 | /* | ||
| 992 | * acpi_save_state_mem() - save kernel state | ||
| 993 | * | ||
| 994 | * TBD when when IA64 starts to support suspend... | ||
| 995 | */ | ||
| 996 | int acpi_save_state_mem(void) { return 0; } | ||
| 997 | |||
| 998 | /* | ||
| 999 | * acpi_restore_state() | ||
| 1000 | */ | ||
| 1001 | void acpi_restore_state_mem(void) {} | ||
| 1002 | |||
| 1003 | /* | ||
| 1004 | * do_suspend_lowlevel() | ||
| 1005 | */ | ||
| 1006 | void do_suspend_lowlevel(void) {} | ||
| 1007 | |||
| 989 | #endif /* CONFIG_ACPI */ | 1008 | #endif /* CONFIG_ACPI */ |
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index 44d540efa6d1..4e5e27540e27 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S | |||
| @@ -178,7 +178,7 @@ swapper_pg_dir: | |||
| 178 | halt_msg: | 178 | halt_msg: |
| 179 | stringz "Halting kernel\n" | 179 | stringz "Halting kernel\n" |
| 180 | 180 | ||
| 181 | .text | 181 | .section .text.head,"ax" |
| 182 | 182 | ||
| 183 | .global start_ap | 183 | .global start_ap |
| 184 | 184 | ||
| @@ -392,6 +392,8 @@ self: hint @pause | |||
| 392 | br.sptk.many self // endless loop | 392 | br.sptk.many self // endless loop |
| 393 | END(_start) | 393 | END(_start) |
| 394 | 394 | ||
| 395 | .text | ||
| 396 | |||
| 395 | GLOBAL_ENTRY(ia64_save_debug_regs) | 397 | GLOBAL_ENTRY(ia64_save_debug_regs) |
| 396 | alloc r16=ar.pfs,1,0,0,0 | 398 | alloc r16=ar.pfs,1,0,0,0 |
| 397 | mov r20=ar.lc // preserve ar.lc | 399 | mov r20=ar.lc // preserve ar.lc |
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 91797c111162..fcb77338cc09 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c | |||
| @@ -85,8 +85,8 @@ DEFINE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq) = { | |||
| 85 | [0 ... IA64_NUM_VECTORS - 1] = IA64_SPURIOUS_INT_VECTOR | 85 | [0 ... IA64_NUM_VECTORS - 1] = IA64_SPURIOUS_INT_VECTOR |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | static cpumask_t vector_table[IA64_MAX_DEVICE_VECTORS] = { | 88 | static cpumask_t vector_table[IA64_NUM_VECTORS] = { |
| 89 | [0 ... IA64_MAX_DEVICE_VECTORS - 1] = CPU_MASK_NONE | 89 | [0 ... IA64_NUM_VECTORS - 1] = CPU_MASK_NONE |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | static int irq_status[NR_IRQS] = { | 92 | static int irq_status[NR_IRQS] = { |
| @@ -123,17 +123,18 @@ static inline int find_unassigned_irq(void) | |||
| 123 | static inline int find_unassigned_vector(cpumask_t domain) | 123 | static inline int find_unassigned_vector(cpumask_t domain) |
| 124 | { | 124 | { |
| 125 | cpumask_t mask; | 125 | cpumask_t mask; |
| 126 | int pos; | 126 | int pos, vector; |
| 127 | 127 | ||
| 128 | cpus_and(mask, domain, cpu_online_map); | 128 | cpus_and(mask, domain, cpu_online_map); |
| 129 | if (cpus_empty(mask)) | 129 | if (cpus_empty(mask)) |
| 130 | return -EINVAL; | 130 | return -EINVAL; |
| 131 | 131 | ||
| 132 | for (pos = 0; pos < IA64_NUM_DEVICE_VECTORS; pos++) { | 132 | for (pos = 0; pos < IA64_NUM_DEVICE_VECTORS; pos++) { |
| 133 | cpus_and(mask, domain, vector_table[pos]); | 133 | vector = IA64_FIRST_DEVICE_VECTOR + pos; |
| 134 | cpus_and(mask, domain, vector_table[vector]); | ||
| 134 | if (!cpus_empty(mask)) | 135 | if (!cpus_empty(mask)) |
| 135 | continue; | 136 | continue; |
| 136 | return IA64_FIRST_DEVICE_VECTOR + pos; | 137 | return vector; |
| 137 | } | 138 | } |
| 138 | return -ENOSPC; | 139 | return -ENOSPC; |
| 139 | } | 140 | } |
| @@ -141,7 +142,7 @@ static inline int find_unassigned_vector(cpumask_t domain) | |||
| 141 | static int __bind_irq_vector(int irq, int vector, cpumask_t domain) | 142 | static int __bind_irq_vector(int irq, int vector, cpumask_t domain) |
| 142 | { | 143 | { |
| 143 | cpumask_t mask; | 144 | cpumask_t mask; |
| 144 | int cpu, pos; | 145 | int cpu; |
| 145 | struct irq_cfg *cfg = &irq_cfg[irq]; | 146 | struct irq_cfg *cfg = &irq_cfg[irq]; |
| 146 | 147 | ||
| 147 | cpus_and(mask, domain, cpu_online_map); | 148 | cpus_and(mask, domain, cpu_online_map); |
| @@ -156,8 +157,7 @@ static int __bind_irq_vector(int irq, int vector, cpumask_t domain) | |||
| 156 | cfg->vector = vector; | 157 | cfg->vector = vector; |
| 157 | cfg->domain = domain; | 158 | cfg->domain = domain; |
| 158 | irq_status[irq] = IRQ_USED; | 159 | irq_status[irq] = IRQ_USED; |
| 159 | pos = vector - IA64_FIRST_DEVICE_VECTOR; | 160 | cpus_or(vector_table[vector], vector_table[vector], domain); |
| 160 | cpus_or(vector_table[pos], vector_table[pos], domain); | ||
| 161 | return 0; | 161 | return 0; |
| 162 | } | 162 | } |
| 163 | 163 | ||
| @@ -174,7 +174,7 @@ int bind_irq_vector(int irq, int vector, cpumask_t domain) | |||
| 174 | 174 | ||
| 175 | static void __clear_irq_vector(int irq) | 175 | static void __clear_irq_vector(int irq) |
| 176 | { | 176 | { |
| 177 | int vector, cpu, pos; | 177 | int vector, cpu; |
| 178 | cpumask_t mask; | 178 | cpumask_t mask; |
| 179 | cpumask_t domain; | 179 | cpumask_t domain; |
| 180 | struct irq_cfg *cfg = &irq_cfg[irq]; | 180 | struct irq_cfg *cfg = &irq_cfg[irq]; |
| @@ -189,8 +189,7 @@ static void __clear_irq_vector(int irq) | |||
| 189 | cfg->vector = IRQ_VECTOR_UNASSIGNED; | 189 | cfg->vector = IRQ_VECTOR_UNASSIGNED; |
| 190 | cfg->domain = CPU_MASK_NONE; | 190 | cfg->domain = CPU_MASK_NONE; |
| 191 | irq_status[irq] = IRQ_UNUSED; | 191 | irq_status[irq] = IRQ_UNUSED; |
| 192 | pos = vector - IA64_FIRST_DEVICE_VECTOR; | 192 | cpus_andnot(vector_table[vector], vector_table[vector], domain); |
| 193 | cpus_andnot(vector_table[pos], vector_table[pos], domain); | ||
| 194 | } | 193 | } |
| 195 | 194 | ||
| 196 | static void clear_irq_vector(int irq) | 195 | static void clear_irq_vector(int irq) |
| @@ -212,9 +211,6 @@ assign_irq_vector (int irq) | |||
| 212 | vector = -ENOSPC; | 211 | vector = -ENOSPC; |
| 213 | 212 | ||
| 214 | spin_lock_irqsave(&vector_lock, flags); | 213 | spin_lock_irqsave(&vector_lock, flags); |
| 215 | if (irq < 0) { | ||
| 216 | goto out; | ||
| 217 | } | ||
| 218 | for_each_online_cpu(cpu) { | 214 | for_each_online_cpu(cpu) { |
| 219 | domain = vector_allocation_domain(cpu); | 215 | domain = vector_allocation_domain(cpu); |
| 220 | vector = find_unassigned_vector(domain); | 216 | vector = find_unassigned_vector(domain); |
| @@ -223,6 +219,8 @@ assign_irq_vector (int irq) | |||
| 223 | } | 219 | } |
| 224 | if (vector < 0) | 220 | if (vector < 0) |
| 225 | goto out; | 221 | goto out; |
| 222 | if (irq == AUTO_ASSIGN) | ||
| 223 | irq = vector; | ||
| 226 | BUG_ON(__bind_irq_vector(irq, vector, domain)); | 224 | BUG_ON(__bind_irq_vector(irq, vector, domain)); |
| 227 | out: | 225 | out: |
| 228 | spin_unlock_irqrestore(&vector_lock, flags); | 226 | spin_unlock_irqrestore(&vector_lock, flags); |
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c index 13df337508e7..7ccb228ceedc 100644 --- a/arch/ia64/kernel/machvec.c +++ b/arch/ia64/kernel/machvec.c | |||
| @@ -13,14 +13,6 @@ | |||
| 13 | struct ia64_machine_vector ia64_mv; | 13 | struct ia64_machine_vector ia64_mv; |
| 14 | EXPORT_SYMBOL(ia64_mv); | 14 | EXPORT_SYMBOL(ia64_mv); |
| 15 | 15 | ||
| 16 | static __initdata const char *mvec_name; | ||
| 17 | static __init int setup_mvec(char *s) | ||
| 18 | { | ||
| 19 | mvec_name = s; | ||
| 20 | return 0; | ||
| 21 | } | ||
| 22 | early_param("machvec", setup_mvec); | ||
| 23 | |||
| 24 | static struct ia64_machine_vector * __init | 16 | static struct ia64_machine_vector * __init |
| 25 | lookup_machvec (const char *name) | 17 | lookup_machvec (const char *name) |
| 26 | { | 18 | { |
| @@ -41,7 +33,7 @@ machvec_init (const char *name) | |||
| 41 | struct ia64_machine_vector *mv; | 33 | struct ia64_machine_vector *mv; |
| 42 | 34 | ||
| 43 | if (!name) | 35 | if (!name) |
| 44 | name = mvec_name ? mvec_name : acpi_get_sysname(); | 36 | name = acpi_get_sysname(); |
| 45 | mv = lookup_machvec(name); | 37 | mv = lookup_machvec(name); |
| 46 | if (!mv) | 38 | if (!mv) |
| 47 | panic("generic kernel failed to find machine vector for" | 39 | panic("generic kernel failed to find machine vector for" |
| @@ -51,6 +43,23 @@ machvec_init (const char *name) | |||
| 51 | printk(KERN_INFO "booting generic kernel on platform %s\n", name); | 43 | printk(KERN_INFO "booting generic kernel on platform %s\n", name); |
| 52 | } | 44 | } |
| 53 | 45 | ||
| 46 | void __init | ||
| 47 | machvec_init_from_cmdline(const char *cmdline) | ||
| 48 | { | ||
| 49 | char str[64]; | ||
| 50 | const char *start; | ||
| 51 | char *end; | ||
| 52 | |||
| 53 | if (! (start = strstr(cmdline, "machvec=")) ) | ||
| 54 | return machvec_init(NULL); | ||
| 55 | |||
| 56 | strlcpy(str, start + strlen("machvec="), sizeof(str)); | ||
| 57 | if ( (end = strchr(str, ' ')) ) | ||
| 58 | *end = '\0'; | ||
| 59 | |||
| 60 | return machvec_init(str); | ||
| 61 | } | ||
| 62 | |||
| 54 | #endif /* CONFIG_IA64_GENERIC */ | 63 | #endif /* CONFIG_IA64_GENERIC */ |
| 55 | 64 | ||
| 56 | void | 65 | void |
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index fa40cba43350..4158906c45aa 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
| @@ -499,7 +499,8 @@ copy_thread (int nr, unsigned long clone_flags, | |||
| 499 | 499 | ||
| 500 | /* Copy partially mapped page list */ | 500 | /* Copy partially mapped page list */ |
| 501 | if (!retval) | 501 | if (!retval) |
| 502 | retval = ia32_copy_partial_page_list(p, clone_flags); | 502 | retval = ia32_copy_ia64_partial_page_list(p, |
| 503 | clone_flags); | ||
| 503 | } | 504 | } |
| 504 | #endif | 505 | #endif |
| 505 | 506 | ||
| @@ -728,7 +729,7 @@ flush_thread (void) | |||
| 728 | ia64_drop_fpu(current); | 729 | ia64_drop_fpu(current); |
| 729 | #ifdef CONFIG_IA32_SUPPORT | 730 | #ifdef CONFIG_IA32_SUPPORT |
| 730 | if (IS_IA32_PROCESS(task_pt_regs(current))) { | 731 | if (IS_IA32_PROCESS(task_pt_regs(current))) { |
| 731 | ia32_drop_partial_page_list(current); | 732 | ia32_drop_ia64_partial_page_list(current); |
| 732 | current->thread.task_size = IA32_PAGE_OFFSET; | 733 | current->thread.task_size = IA32_PAGE_OFFSET; |
| 733 | set_fs(USER_DS); | 734 | set_fs(USER_DS); |
| 734 | } | 735 | } |
| @@ -754,7 +755,7 @@ exit_thread (void) | |||
| 754 | pfm_release_debug_registers(current); | 755 | pfm_release_debug_registers(current); |
| 755 | #endif | 756 | #endif |
| 756 | if (IS_IA32_PROCESS(task_pt_regs(current))) | 757 | if (IS_IA32_PROCESS(task_pt_regs(current))) |
| 757 | ia32_drop_partial_page_list(current); | 758 | ia32_drop_ia64_partial_page_list(current); |
| 758 | } | 759 | } |
| 759 | 760 | ||
| 760 | unsigned long | 761 | unsigned long |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index cf06fe799041..7cecd2964200 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
| @@ -491,12 +491,17 @@ setup_arch (char **cmdline_p) | |||
| 491 | efi_init(); | 491 | efi_init(); |
| 492 | io_port_init(); | 492 | io_port_init(); |
| 493 | 493 | ||
| 494 | parse_early_param(); | ||
| 495 | |||
| 496 | #ifdef CONFIG_IA64_GENERIC | 494 | #ifdef CONFIG_IA64_GENERIC |
| 497 | machvec_init(NULL); | 495 | /* machvec needs to be parsed from the command line |
| 496 | * before parse_early_param() is called to ensure | ||
| 497 | * that ia64_mv is initialised before any command line | ||
| 498 | * settings may cause console setup to occur | ||
| 499 | */ | ||
| 500 | machvec_init_from_cmdline(*cmdline_p); | ||
| 498 | #endif | 501 | #endif |
| 499 | 502 | ||
| 503 | parse_early_param(); | ||
| 504 | |||
| 500 | if (early_console_setup(*cmdline_p) == 0) | 505 | if (early_console_setup(*cmdline_p) == 0) |
| 501 | mark_bsp_online(); | 506 | mark_bsp_online(); |
| 502 | 507 | ||
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c index 9f72838db26e..0982882bfb80 100644 --- a/arch/ia64/kernel/smp.c +++ b/arch/ia64/kernel/smp.c | |||
| @@ -468,7 +468,7 @@ smp_send_stop (void) | |||
| 468 | send_IPI_allbutself(IPI_CPU_STOP); | 468 | send_IPI_allbutself(IPI_CPU_STOP); |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | int __init | 471 | int |
| 472 | setup_profiling_timer (unsigned int multiplier) | 472 | setup_profiling_timer (unsigned int multiplier) |
| 473 | { | 473 | { |
| 474 | return -EINVAL; | 474 | return -EINVAL; |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 9f5c90b594b9..62209dcf06d3 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
| @@ -487,7 +487,7 @@ struct create_idle { | |||
| 487 | int cpu; | 487 | int cpu; |
| 488 | }; | 488 | }; |
| 489 | 489 | ||
| 490 | void | 490 | void __cpuinit |
| 491 | do_fork_idle(struct work_struct *work) | 491 | do_fork_idle(struct work_struct *work) |
| 492 | { | 492 | { |
| 493 | struct create_idle *c_idle = | 493 | struct create_idle *c_idle = |
| @@ -497,7 +497,7 @@ do_fork_idle(struct work_struct *work) | |||
| 497 | complete(&c_idle->done); | 497 | complete(&c_idle->done); |
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | static int __devinit | 500 | static int __cpuinit |
| 501 | do_boot_cpu (int sapicid, int cpu) | 501 | do_boot_cpu (int sapicid, int cpu) |
| 502 | { | 502 | { |
| 503 | int timeout; | 503 | int timeout; |
| @@ -808,7 +808,7 @@ set_cpu_sibling_map(int cpu) | |||
| 808 | } | 808 | } |
| 809 | } | 809 | } |
| 810 | 810 | ||
| 811 | int __devinit | 811 | int __cpuinit |
| 812 | __cpu_up (unsigned int cpu) | 812 | __cpu_up (unsigned int cpu) |
| 813 | { | 813 | { |
| 814 | int ret; | 814 | int ret; |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 860f251d2fc2..83e80677de70 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
| @@ -50,6 +50,8 @@ SECTIONS | |||
| 50 | KPROBES_TEXT | 50 | KPROBES_TEXT |
| 51 | *(.gnu.linkonce.t*) | 51 | *(.gnu.linkonce.t*) |
| 52 | } | 52 | } |
| 53 | .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) | ||
| 54 | { *(.text.head) } | ||
| 53 | .text2 : AT(ADDR(.text2) - LOAD_OFFSET) | 55 | .text2 : AT(ADDR(.text2) - LOAD_OFFSET) |
| 54 | { *(.text2) } | 56 | { *(.text2) } |
| 55 | #ifdef CONFIG_SMP | 57 | #ifdef CONFIG_SMP |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 07d0e92742c8..488e48a5deea 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
| @@ -581,7 +581,7 @@ pcibios_align_resource (void *data, struct resource *res, | |||
| 581 | /* | 581 | /* |
| 582 | * PCI BIOS setup, always defaults to SAL interface | 582 | * PCI BIOS setup, always defaults to SAL interface |
| 583 | */ | 583 | */ |
| 584 | char * __init | 584 | char * __devinit |
| 585 | pcibios_setup (char *str) | 585 | pcibios_setup (char *str) |
| 586 | { | 586 | { |
| 587 | return str; | 587 | return str; |
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index 1175ceff8b2a..185906b54cb0 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig | |||
| @@ -216,6 +216,18 @@ config XCOPILOT_BUGS | |||
| 216 | help | 216 | help |
| 217 | Support the bugs of Xcopilot. | 217 | Support the bugs of Xcopilot. |
| 218 | 218 | ||
| 219 | config UC5272 | ||
| 220 | bool 'Arcturus Networks uC5272 dimm board support' | ||
| 221 | depends on M5272 | ||
| 222 | help | ||
| 223 | Support for the Arcturus Networks uC5272 dimm board. | ||
| 224 | |||
| 225 | config UC5282 | ||
| 226 | bool "Arcturus Networks uC5282 board support" | ||
| 227 | depends on M528x | ||
| 228 | help | ||
| 229 | Support for the Arcturus Networks uC5282 dimm board. | ||
| 230 | |||
| 219 | config UCSIMM | 231 | config UCSIMM |
| 220 | bool "uCsimm module support" | 232 | bool "uCsimm module support" |
| 221 | depends on M68EZ328 | 233 | depends on M68EZ328 |
| @@ -342,6 +354,18 @@ config SOM5282EM | |||
| 342 | depends on M528x | 354 | depends on M528x |
| 343 | help | 355 | help |
| 344 | Support for the EMAC.Inc SOM5282EM module. | 356 | Support for the EMAC.Inc SOM5282EM module. |
| 357 | |||
| 358 | config WILDFIRE | ||
| 359 | bool "Intec Automation Inc. WildFire board support" | ||
| 360 | depends on M528x | ||
| 361 | help | ||
| 362 | Support for the Intec Automation Inc. WildFire. | ||
| 363 | |||
| 364 | config WILDFIREMOD | ||
| 365 | bool "Intec Automation Inc. WildFire module support" | ||
| 366 | depends on M528x | ||
| 367 | help | ||
| 368 | Support for the Intec Automation Inc. WildFire module. | ||
| 345 | 369 | ||
| 346 | config ARN5307 | 370 | config ARN5307 |
| 347 | bool "Arnewsh 5307 board support" | 371 | bool "Arnewsh 5307 board support" |
diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile index 8951793fd8d4..1305cc980023 100644 --- a/arch/m68knommu/Makefile +++ b/arch/m68knommu/Makefile | |||
| @@ -26,6 +26,8 @@ platform-$(CONFIG_M5407) := 5407 | |||
| 26 | PLATFORM := $(platform-y) | 26 | PLATFORM := $(platform-y) |
| 27 | 27 | ||
| 28 | board-$(CONFIG_PILOT) := pilot | 28 | board-$(CONFIG_PILOT) := pilot |
| 29 | board-$(CONFIG_UC5272) := UC5272 | ||
| 30 | board-$(CONFIG_UC5282) := UC5282 | ||
| 29 | board-$(CONFIG_UCSIMM) := ucsimm | 31 | board-$(CONFIG_UCSIMM) := ucsimm |
| 30 | board-$(CONFIG_UCDIMM) := ucdimm | 32 | board-$(CONFIG_UCDIMM) := ucdimm |
| 31 | board-$(CONFIG_UCQUICC) := uCquicc | 33 | board-$(CONFIG_UCQUICC) := uCquicc |
diff --git a/arch/m68knommu/kernel/dma.c b/arch/m68knommu/kernel/dma.c index 0a25874a2aae..e10eafc52789 100644 --- a/arch/m68knommu/kernel/dma.c +++ b/arch/m68knommu/kernel/dma.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
| 10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
| 11 | #include <linux/device.h> | ||
| 11 | #include <asm/io.h> | 12 | #include <asm/io.h> |
| 12 | 13 | ||
| 13 | void *dma_alloc_coherent(struct device *dev, size_t size, | 14 | void *dma_alloc_coherent(struct device *dev, size_t size, |
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c index 2203f694f26b..a5ac0d40fbec 100644 --- a/arch/m68knommu/kernel/setup.c +++ b/arch/m68knommu/kernel/setup.c | |||
| @@ -132,6 +132,11 @@ void setup_arch(char **cmdline_p) | |||
| 132 | 132 | ||
| 133 | config_BSP(&command_line[0], sizeof(command_line)); | 133 | config_BSP(&command_line[0], sizeof(command_line)); |
| 134 | 134 | ||
| 135 | #if defined(CONFIG_BOOTPARAM) | ||
| 136 | strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); | ||
| 137 | command_line[sizeof(command_line) - 1] = 0; | ||
| 138 | #endif | ||
| 139 | |||
| 135 | printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n"); | 140 | printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n"); |
| 136 | 141 | ||
| 137 | #ifdef CONFIG_UCDIMM | 142 | #ifdef CONFIG_UCDIMM |
diff --git a/arch/m68knommu/platform/5206/config.c b/arch/m68knommu/platform/5206/config.c index 3343830aad10..d265ed4e5afc 100644 --- a/arch/m68knommu/platform/5206/config.c +++ b/arch/m68knommu/platform/5206/config.c | |||
| @@ -98,14 +98,6 @@ int mcf_timerirqpending(int timer) | |||
| 98 | void config_BSP(char *commandp, int size) | 98 | void config_BSP(char *commandp, int size) |
| 99 | { | 99 | { |
| 100 | mcf_setimr(MCFSIM_IMR_MASKALL); | 100 | mcf_setimr(MCFSIM_IMR_MASKALL); |
| 101 | |||
| 102 | #if defined(CONFIG_BOOTPARAM) | ||
| 103 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 104 | commandp[size-1] = 0; | ||
| 105 | #else | ||
| 106 | memset(commandp, 0, size); | ||
| 107 | #endif | ||
| 108 | |||
| 109 | mach_sched_init = coldfire_timer_init; | 101 | mach_sched_init = coldfire_timer_init; |
| 110 | mach_tick = coldfire_tick; | 102 | mach_tick = coldfire_tick; |
| 111 | mach_gettimeoffset = coldfire_timer_offset; | 103 | mach_gettimeoffset = coldfire_timer_offset; |
diff --git a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c index 0f67320b4031..7fa5e8254c31 100644 --- a/arch/m68knommu/platform/5206e/config.c +++ b/arch/m68knommu/platform/5206e/config.c | |||
| @@ -98,15 +98,10 @@ void config_BSP(char *commandp, int size) | |||
| 98 | { | 98 | { |
| 99 | mcf_setimr(MCFSIM_IMR_MASKALL); | 99 | mcf_setimr(MCFSIM_IMR_MASKALL); |
| 100 | 100 | ||
| 101 | #if defined(CONFIG_BOOTPARAM) | 101 | #if defined(CONFIG_NETtel) |
| 102 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 103 | commandp[size-1] = 0; | ||
| 104 | #elif defined(CONFIG_NETtel) | ||
| 105 | /* Copy command line from FLASH to local buffer... */ | 102 | /* Copy command line from FLASH to local buffer... */ |
| 106 | memcpy(commandp, (char *) 0xf0004000, size); | 103 | memcpy(commandp, (char *) 0xf0004000, size); |
| 107 | commandp[size-1] = 0; | 104 | commandp[size-1] = 0; |
| 108 | #else | ||
| 109 | memset(commandp, 0, size); | ||
| 110 | #endif /* CONFIG_NETtel */ | 105 | #endif /* CONFIG_NETtel */ |
| 111 | 106 | ||
| 112 | mach_sched_init = coldfire_timer_init; | 107 | mach_sched_init = coldfire_timer_init; |
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c index 58b2878deb61..85830f9882f3 100644 --- a/arch/m68knommu/platform/520x/config.c +++ b/arch/m68knommu/platform/520x/config.c | |||
| @@ -48,13 +48,6 @@ void mcf_autovector(unsigned int vec) | |||
| 48 | 48 | ||
| 49 | void config_BSP(char *commandp, int size) | 49 | void config_BSP(char *commandp, int size) |
| 50 | { | 50 | { |
| 51 | #ifdef CONFIG_BOOTPARAM | ||
| 52 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 53 | commandp[size-1] = 0; | ||
| 54 | #else | ||
| 55 | memset(commandp, 0, size); | ||
| 56 | #endif | ||
| 57 | |||
| 58 | mach_sched_init = coldfire_pit_init; | 51 | mach_sched_init = coldfire_pit_init; |
| 59 | mach_tick = coldfire_pit_tick; | 52 | mach_tick = coldfire_pit_tick; |
| 60 | mach_gettimeoffset = coldfire_pit_offset; | 53 | mach_gettimeoffset = coldfire_pit_offset; |
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c index 9b054e6caee2..c0157e110035 100644 --- a/arch/m68knommu/platform/523x/config.c +++ b/arch/m68knommu/platform/523x/config.c | |||
| @@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec) | |||
| 63 | void config_BSP(char *commandp, int size) | 63 | void config_BSP(char *commandp, int size) |
| 64 | { | 64 | { |
| 65 | mcf_disableall(); | 65 | mcf_disableall(); |
| 66 | |||
| 67 | #ifdef CONFIG_BOOTPARAM | ||
| 68 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 69 | commandp[size-1] = 0; | ||
| 70 | #else | ||
| 71 | memset(commandp, 0, size); | ||
| 72 | #endif | ||
| 73 | |||
| 74 | mach_sched_init = coldfire_pit_init; | 66 | mach_sched_init = coldfire_pit_init; |
| 75 | mach_tick = coldfire_pit_tick; | 67 | mach_tick = coldfire_pit_tick; |
| 76 | mach_gettimeoffset = coldfire_pit_offset; | 68 | mach_gettimeoffset = coldfire_pit_offset; |
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c index d6706079d64a..4cdeb719512d 100644 --- a/arch/m68knommu/platform/5249/config.c +++ b/arch/m68knommu/platform/5249/config.c | |||
| @@ -96,14 +96,6 @@ int mcf_timerirqpending(int timer) | |||
| 96 | void config_BSP(char *commandp, int size) | 96 | void config_BSP(char *commandp, int size) |
| 97 | { | 97 | { |
| 98 | mcf_setimr(MCFSIM_IMR_MASKALL); | 98 | mcf_setimr(MCFSIM_IMR_MASKALL); |
| 99 | |||
| 100 | #if defined(CONFIG_BOOTPARAM) | ||
| 101 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 102 | commandp[size-1] = 0; | ||
| 103 | #else | ||
| 104 | memset(commandp, 0, size); | ||
| 105 | #endif | ||
| 106 | |||
| 107 | mach_sched_init = coldfire_timer_init; | 99 | mach_sched_init = coldfire_timer_init; |
| 108 | mach_tick = coldfire_tick; | 100 | mach_tick = coldfire_tick; |
| 109 | mach_gettimeoffset = coldfire_timer_offset; | 101 | mach_gettimeoffset = coldfire_timer_offset; |
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c index 6b437cc97776..609b10e4b9b9 100644 --- a/arch/m68knommu/platform/5272/config.c +++ b/arch/m68knommu/platform/5272/config.c | |||
| @@ -113,10 +113,7 @@ void config_BSP(char *commandp, int size) | |||
| 113 | 113 | ||
| 114 | mcf_disableall(); | 114 | mcf_disableall(); |
| 115 | 115 | ||
| 116 | #if defined(CONFIG_BOOTPARAM) | 116 | #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) |
| 117 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 118 | commandp[size-1] = 0; | ||
| 119 | #elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES) | ||
| 120 | /* Copy command line from FLASH to local buffer... */ | 117 | /* Copy command line from FLASH to local buffer... */ |
| 121 | memcpy(commandp, (char *) 0xf0004000, size); | 118 | memcpy(commandp, (char *) 0xf0004000, size); |
| 122 | commandp[size-1] = 0; | 119 | commandp[size-1] = 0; |
| @@ -128,8 +125,6 @@ void config_BSP(char *commandp, int size) | |||
| 128 | /* Copy command line from FLASH to local buffer... */ | 125 | /* Copy command line from FLASH to local buffer... */ |
| 129 | memcpy(commandp, (char *) 0xf0010000, size); | 126 | memcpy(commandp, (char *) 0xf0010000, size); |
| 130 | commandp[size-1] = 0; | 127 | commandp[size-1] = 0; |
| 131 | #else | ||
| 132 | memset(commandp, 0, size); | ||
| 133 | #endif | 128 | #endif |
| 134 | 129 | ||
| 135 | mcf_timervector = 69; | 130 | mcf_timervector = 69; |
diff --git a/arch/m68knommu/platform/527x/config.c b/arch/m68knommu/platform/527x/config.c index 28e7d964eef1..126dac066482 100644 --- a/arch/m68knommu/platform/527x/config.c +++ b/arch/m68knommu/platform/527x/config.c | |||
| @@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec) | |||
| 63 | void config_BSP(char *commandp, int size) | 63 | void config_BSP(char *commandp, int size) |
| 64 | { | 64 | { |
| 65 | mcf_disableall(); | 65 | mcf_disableall(); |
| 66 | |||
| 67 | #ifdef CONFIG_BOOTPARAM | ||
| 68 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 69 | commandp[size-1] = 0; | ||
| 70 | #else | ||
| 71 | memset(commandp, 0, size); | ||
| 72 | #endif | ||
| 73 | |||
| 74 | mach_sched_init = coldfire_pit_init; | 66 | mach_sched_init = coldfire_pit_init; |
| 75 | mach_tick = coldfire_pit_tick; | 67 | mach_tick = coldfire_pit_tick; |
| 76 | mach_gettimeoffset = coldfire_pit_offset; | 68 | mach_gettimeoffset = coldfire_pit_offset; |
diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c index 805b4f74ff19..aab1ef0c1f78 100644 --- a/arch/m68knommu/platform/528x/config.c +++ b/arch/m68knommu/platform/528x/config.c | |||
| @@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec) | |||
| 63 | void config_BSP(char *commandp, int size) | 63 | void config_BSP(char *commandp, int size) |
| 64 | { | 64 | { |
| 65 | mcf_disableall(); | 65 | mcf_disableall(); |
| 66 | |||
| 67 | #ifdef CONFIG_BOOTPARAM | ||
| 68 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 69 | commandp[size-1] = 0; | ||
| 70 | #else | ||
| 71 | memset(commandp, 0, size); | ||
| 72 | #endif | ||
| 73 | |||
| 74 | mach_sched_init = coldfire_pit_init; | 66 | mach_sched_init = coldfire_pit_init; |
| 75 | mach_tick = coldfire_pit_tick; | 67 | mach_tick = coldfire_pit_tick; |
| 76 | mach_gettimeoffset = coldfire_pit_offset; | 68 | mach_gettimeoffset = coldfire_pit_offset; |
diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c index e04b84deb57d..1f10e941b87c 100644 --- a/arch/m68knommu/platform/5307/config.c +++ b/arch/m68knommu/platform/5307/config.c | |||
| @@ -111,10 +111,7 @@ void config_BSP(char *commandp, int size) | |||
| 111 | { | 111 | { |
| 112 | mcf_setimr(MCFSIM_IMR_MASKALL); | 112 | mcf_setimr(MCFSIM_IMR_MASKALL); |
| 113 | 113 | ||
| 114 | #if defined(CONFIG_BOOTPARAM) | 114 | #if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ |
| 115 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 116 | commandp[size-1] = 0; | ||
| 117 | #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ | ||
| 118 | defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ | 115 | defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ |
| 119 | defined(CONFIG_CLEOPATRA) | 116 | defined(CONFIG_CLEOPATRA) |
| 120 | /* Copy command line from FLASH to local buffer... */ | 117 | /* Copy command line from FLASH to local buffer... */ |
| @@ -124,8 +121,6 @@ void config_BSP(char *commandp, int size) | |||
| 124 | mcf_timervector = 30; | 121 | mcf_timervector = 30; |
| 125 | mcf_profilevector = 31; | 122 | mcf_profilevector = 31; |
| 126 | mcf_timerlevel = 6; | 123 | mcf_timerlevel = 6; |
| 127 | #else | ||
| 128 | memset(commandp, 0, size); | ||
| 129 | #endif | 124 | #endif |
| 130 | 125 | ||
| 131 | mach_sched_init = coldfire_timer_init; | 126 | mach_sched_init = coldfire_timer_init; |
diff --git a/arch/m68knommu/platform/5307/entry.S b/arch/m68knommu/platform/5307/entry.S index c358aebe0af3..a8cd867805ca 100644 --- a/arch/m68knommu/platform/5307/entry.S +++ b/arch/m68knommu/platform/5307/entry.S | |||
| @@ -213,16 +213,12 @@ ENTRY(ret_from_interrupt) | |||
| 213 | * Beware - when entering resume, prev (the current task) is | 213 | * Beware - when entering resume, prev (the current task) is |
| 214 | * in a0, next (the new task) is in a1,so don't change these | 214 | * in a0, next (the new task) is in a1,so don't change these |
| 215 | * registers until their contents are no longer needed. | 215 | * registers until their contents are no longer needed. |
| 216 | * This is always called in supervisor mode, so don't bother to save | ||
| 217 | * and restore sr; user's process sr is actually in the stack. | ||
| 216 | */ | 218 | */ |
| 217 | ENTRY(resume) | 219 | ENTRY(resume) |
| 218 | movel %a0, %d1 /* get prev thread in d1 */ | 220 | movel %a0, %d1 /* get prev thread in d1 */ |
| 219 | 221 | ||
| 220 | movew %sr,%d0 /* save thread status reg */ | ||
| 221 | movew %d0,%a0@(TASK_THREAD+THREAD_SR) | ||
| 222 | |||
| 223 | oril #0x700,%d0 /* disable interrupts */ | ||
| 224 | move %d0,%sr | ||
| 225 | |||
| 226 | movel sw_usp,%d0 /* save usp */ | 222 | movel sw_usp,%d0 /* save usp */ |
| 227 | movel %d0,%a0@(TASK_THREAD+THREAD_USP) | 223 | movel %d0,%a0@(TASK_THREAD+THREAD_USP) |
| 228 | 224 | ||
| @@ -233,7 +229,4 @@ ENTRY(resume) | |||
| 233 | 229 | ||
| 234 | movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ | 230 | movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ |
| 235 | movel %a0, sw_usp | 231 | movel %a0, sw_usp |
| 236 | |||
| 237 | movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */ | ||
| 238 | movew %d0, %sr | ||
| 239 | rts | 232 | rts |
diff --git a/arch/m68knommu/platform/532x/config.c b/arch/m68knommu/platform/532x/config.c index 664c3a12b0c1..dc39c466e33f 100644 --- a/arch/m68knommu/platform/532x/config.c +++ b/arch/m68knommu/platform/532x/config.c | |||
| @@ -92,10 +92,7 @@ void config_BSP(char *commandp, int size) | |||
| 92 | { | 92 | { |
| 93 | mcf_setimr(MCFSIM_IMR_MASKALL); | 93 | mcf_setimr(MCFSIM_IMR_MASKALL); |
| 94 | 94 | ||
| 95 | #if defined(CONFIG_BOOTPARAM) | 95 | #if !defined(CONFIG_BOOTPARAM) |
| 96 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 97 | commandp[size-1] = 0; | ||
| 98 | #else | ||
| 99 | /* Copy command line from FLASH to local buffer... */ | 96 | /* Copy command line from FLASH to local buffer... */ |
| 100 | memcpy(commandp, (char *) 0x4000, 4); | 97 | memcpy(commandp, (char *) 0x4000, 4); |
| 101 | if(strncmp(commandp, "kcl ", 4) == 0){ | 98 | if(strncmp(commandp, "kcl ", 4) == 0){ |
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c index 036f62876241..fde417fdd650 100644 --- a/arch/m68knommu/platform/5407/config.c +++ b/arch/m68knommu/platform/5407/config.c | |||
| @@ -102,13 +102,6 @@ void config_BSP(char *commandp, int size) | |||
| 102 | { | 102 | { |
| 103 | mcf_setimr(MCFSIM_IMR_MASKALL); | 103 | mcf_setimr(MCFSIM_IMR_MASKALL); |
| 104 | 104 | ||
| 105 | #if defined(CONFIG_BOOTPARAM) | ||
| 106 | strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); | ||
| 107 | commandp[size-1] = 0; | ||
| 108 | #else | ||
| 109 | memset(commandp, 0, size); | ||
| 110 | #endif | ||
| 111 | |||
| 112 | #if defined(CONFIG_CLEOPATRA) | 105 | #if defined(CONFIG_CLEOPATRA) |
| 113 | /* Different timer setup - to prevent device clash */ | 106 | /* Different timer setup - to prevent device clash */ |
| 114 | mcf_timervector = 30; | 107 | mcf_timervector = 30; |
diff --git a/arch/m68knommu/platform/68VZ328/config.c b/arch/m68knommu/platform/68VZ328/config.c index 8abe0f6e7235..79dced929c97 100644 --- a/arch/m68knommu/platform/68VZ328/config.c +++ b/arch/m68knommu/platform/68VZ328/config.c | |||
| @@ -191,13 +191,6 @@ void config_BSP(char *command, int size) | |||
| 191 | { | 191 | { |
| 192 | printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); | 192 | printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); |
| 193 | 193 | ||
| 194 | #if defined(CONFIG_BOOTPARAM) | ||
| 195 | strncpy(command, CONFIG_BOOTPARAM_STRING, size); | ||
| 196 | command[size-1] = 0; | ||
| 197 | #else | ||
| 198 | memset(command, 0, size); | ||
| 199 | #endif | ||
| 200 | |||
| 201 | init_hardware(command, size); | 194 | init_hardware(command, size); |
| 202 | 195 | ||
| 203 | mach_sched_init = (void *) m68328_timer_init; | 196 | mach_sched_init = (void *) m68328_timer_init; |
diff --git a/arch/powerpc/boot/dts/kuroboxHD.dts b/arch/powerpc/boot/dts/kuroboxHD.dts index a983680c3263..122537419d9f 100644 --- a/arch/powerpc/boot/dts/kuroboxHD.dts +++ b/arch/powerpc/boot/dts/kuroboxHD.dts | |||
| @@ -33,12 +33,10 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts" | |||
| 33 | PowerPC,603e { /* Really 8241 */ | 33 | PowerPC,603e { /* Really 8241 */ |
| 34 | device_type = "cpu"; | 34 | device_type = "cpu"; |
| 35 | reg = <0>; | 35 | reg = <0>; |
| 36 | clock-frequency = <bebc200>; /* Fixed by bootwrapper */ | 36 | clock-frequency = <bebc200>; /* Fixed by bootloader */ |
| 37 | timebase-frequency = <1743000>; /* Fixed by bootwrapper */ | 37 | timebase-frequency = <1743000>; /* Fixed by bootloader */ |
| 38 | bus-frequency = <0>; /* From bootloader */ | 38 | bus-frequency = <0>; /* Fixed by bootloader */ |
| 39 | /* Following required by dtc but not used */ | 39 | /* Following required by dtc but not used */ |
| 40 | i-cache-line-size = <0>; | ||
| 41 | d-cache-line-size = <0>; | ||
| 42 | i-cache-size = <4000>; | 40 | i-cache-size = <4000>; |
| 43 | d-cache-size = <4000>; | 41 | d-cache-size = <4000>; |
| 44 | }; | 42 | }; |
| @@ -64,11 +62,19 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts" | |||
| 64 | fef00000 fef00000 00100000>; /* pci iack */ | 62 | fef00000 fef00000 00100000>; /* pci iack */ |
| 65 | 63 | ||
| 66 | i2c@80003000 { | 64 | i2c@80003000 { |
| 65 | #address-cells = <1>; | ||
| 66 | #size-cells = <0>; | ||
| 67 | device_type = "i2c"; | 67 | device_type = "i2c"; |
| 68 | compatible = "fsl-i2c"; | 68 | compatible = "fsl-i2c"; |
| 69 | reg = <80003000 1000>; | 69 | reg = <80003000 1000>; |
| 70 | interrupts = <5 2>; | 70 | interrupts = <5 2>; |
| 71 | interrupt-parent = <&mpic>; | 71 | interrupt-parent = <&mpic>; |
| 72 | |||
| 73 | rtc@32 { | ||
| 74 | device_type = "rtc"; | ||
| 75 | compatible = "ricoh,rs5c372b"; | ||
| 76 | reg = <32>; | ||
| 77 | }; | ||
| 72 | }; | 78 | }; |
| 73 | 79 | ||
| 74 | serial@80004500 { | 80 | serial@80004500 { |
| @@ -91,7 +97,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts" | |||
| 91 | interrupt-parent = <&mpic>; | 97 | interrupt-parent = <&mpic>; |
| 92 | }; | 98 | }; |
| 93 | 99 | ||
| 94 | mpic: pic@80040000 { | 100 | mpic: interrupt-controller@80040000 { |
| 95 | #interrupt-cells = <2>; | 101 | #interrupt-cells = <2>; |
| 96 | #address-cells = <0>; | 102 | #address-cells = <0>; |
| 97 | device_type = "open-pic"; | 103 | device_type = "open-pic"; |
diff --git a/arch/powerpc/boot/dts/kuroboxHG.dts b/arch/powerpc/boot/dts/kuroboxHG.dts index 5cf42dc022df..579aa8b967d9 100644 --- a/arch/powerpc/boot/dts/kuroboxHG.dts +++ b/arch/powerpc/boot/dts/kuroboxHG.dts | |||
| @@ -33,12 +33,10 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts" | |||
| 33 | PowerPC,603e { /* Really 8241 */ | 33 | PowerPC,603e { /* Really 8241 */ |
| 34 | device_type = "cpu"; | 34 | device_type = "cpu"; |
| 35 | reg = <0>; | 35 | reg = <0>; |
| 36 | clock-frequency = <fdad680>; /* Fixed by bootwrapper */ | 36 | clock-frequency = <fdad680>; /* Fixed by bootloader */ |
| 37 | timebase-frequency = <1F04000>; /* Fixed by bootwrapper */ | 37 | timebase-frequency = <1F04000>; /* Fixed by bootloader */ |
| 38 | bus-frequency = <0>; /* From bootloader */ | 38 | bus-frequency = <0>; /* Fixed by bootloader */ |
| 39 | /* Following required by dtc but not used */ | 39 | /* Following required by dtc but not used */ |
| 40 | i-cache-line-size = <0>; | ||
| 41 | d-cache-line-size = <0>; | ||
| 42 | i-cache-size = <4000>; | 40 | i-cache-size = <4000>; |
| 43 | d-cache-size = <4000>; | 41 | d-cache-size = <4000>; |
| 44 | }; | 42 | }; |
| @@ -64,11 +62,19 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts" | |||
| 64 | fef00000 fef00000 00100000>; /* pci iack */ | 62 | fef00000 fef00000 00100000>; /* pci iack */ |
| 65 | 63 | ||
| 66 | i2c@80003000 { | 64 | i2c@80003000 { |
| 65 | #address-cells = <1>; | ||
| 66 | #size-cells = <0>; | ||
| 67 | device_type = "i2c"; | 67 | device_type = "i2c"; |
| 68 | compatible = "fsl-i2c"; | 68 | compatible = "fsl-i2c"; |
| 69 | reg = <80003000 1000>; | 69 | reg = <80003000 1000>; |
| 70 | interrupts = <5 2>; | 70 | interrupts = <5 2>; |
| 71 | interrupt-parent = <&mpic>; | 71 | interrupt-parent = <&mpic>; |
| 72 | |||
| 73 | rtc@32 { | ||
| 74 | device_type = "rtc"; | ||
| 75 | compatible = "ricoh,rs5c372b"; | ||
| 76 | reg = <32>; | ||
| 77 | }; | ||
| 72 | }; | 78 | }; |
| 73 | 79 | ||
| 74 | serial@80004500 { | 80 | serial@80004500 { |
| @@ -91,8 +97,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts" | |||
| 91 | interrupt-parent = <&mpic>; | 97 | interrupt-parent = <&mpic>; |
| 92 | }; | 98 | }; |
| 93 | 99 | ||
| 94 | mpic: pic@80040000 { | 100 | mpic: interrupt-controller@80040000 { |
| 95 | interrupt-parent = <&mpic>; | ||
| 96 | #interrupt-cells = <2>; | 101 | #interrupt-cells = <2>; |
| 97 | #address-cells = <0>; | 102 | #address-cells = <0>; |
| 98 | device_type = "open-pic"; | 103 | device_type = "open-pic"; |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 8cdd48ea4391..1448af92c6a9 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
| @@ -809,8 +809,9 @@ system_reset_iSeries: | |||
| 809 | mtmsrd r24 /* RI on */ | 809 | mtmsrd r24 /* RI on */ |
| 810 | lhz r24,PACAPACAINDEX(r13) /* Get processor # */ | 810 | lhz r24,PACAPACAINDEX(r13) /* Get processor # */ |
| 811 | cmpwi 0,r24,0 /* Are we processor 0? */ | 811 | cmpwi 0,r24,0 /* Are we processor 0? */ |
| 812 | beq .__start_initialization_iSeries /* Start up the first processor */ | 812 | bne 1f |
| 813 | mfspr r4,SPRN_CTRLF | 813 | b .__start_initialization_iSeries /* Start up the first processor */ |
| 814 | 1: mfspr r4,SPRN_CTRLF | ||
| 814 | li r5,CTRL_RUNLATCH /* Turn off the run light */ | 815 | li r5,CTRL_RUNLATCH /* Turn off the run light */ |
| 815 | andc r4,r4,r5 | 816 | andc r4,r4,r5 |
| 816 | mtspr SPRN_CTRLT,r4 | 817 | mtspr SPRN_CTRLT,r4 |
| @@ -1611,7 +1612,7 @@ _GLOBAL(generic_secondary_smp_init) | |||
| 1611 | #endif | 1612 | #endif |
| 1612 | 1613 | ||
| 1613 | #ifdef CONFIG_PPC_ISERIES | 1614 | #ifdef CONFIG_PPC_ISERIES |
| 1614 | _STATIC(__start_initialization_iSeries) | 1615 | _INIT_STATIC(__start_initialization_iSeries) |
| 1615 | /* Clear out the BSS */ | 1616 | /* Clear out the BSS */ |
| 1616 | LOAD_REG_IMMEDIATE(r11,__bss_stop) | 1617 | LOAD_REG_IMMEDIATE(r11,__bss_stop) |
| 1617 | LOAD_REG_IMMEDIATE(r8,__bss_start) | 1618 | LOAD_REG_IMMEDIATE(r8,__bss_start) |
diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 601ef79a5916..2a5cf8680370 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/pci.h> | 7 | #include <linux/pci.h> |
| 8 | #include <linux/mm.h> | 8 | #include <linux/mm.h> |
| 9 | #include <asm/io.h> | 9 | #include <asm/io.h> |
| 10 | #include <asm/pci-bridge.h> | ||
| 10 | 11 | ||
| 11 | /* | 12 | /* |
| 12 | * Here comes the ppc64 implementation of the IOMAP | 13 | * 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) | |||
| 136 | 137 | ||
| 137 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | 138 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) |
| 138 | { | 139 | { |
| 139 | /* Nothing to do */ | 140 | if (isa_vaddr_is_ioport(addr)) |
| 141 | return; | ||
| 142 | if (pcibios_vaddr_is_ioport(addr)) | ||
| 143 | return; | ||
| 144 | iounmap(addr); | ||
| 140 | } | 145 | } |
| 146 | |||
| 141 | EXPORT_SYMBOL(pci_iomap); | 147 | EXPORT_SYMBOL(pci_iomap); |
| 142 | EXPORT_SYMBOL(pci_iounmap); | 148 | EXPORT_SYMBOL(pci_iounmap); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 7b41a99baae4..083cfbdbe0b2 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
| @@ -101,6 +101,29 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
| 101 | kfree(phb); | 101 | kfree(phb); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | int pcibios_vaddr_is_ioport(void __iomem *address) | ||
| 105 | { | ||
| 106 | int ret = 0; | ||
| 107 | struct pci_controller *hose; | ||
| 108 | unsigned long size; | ||
| 109 | |||
| 110 | spin_lock(&hose_spinlock); | ||
| 111 | list_for_each_entry(hose, &hose_list, list_node) { | ||
| 112 | #ifdef CONFIG_PPC64 | ||
| 113 | size = hose->pci_io_size; | ||
| 114 | #else | ||
| 115 | size = hose->io_resource.end - hose->io_resource.start + 1; | ||
| 116 | #endif | ||
| 117 | if (address >= hose->io_base_virt && | ||
| 118 | address < (hose->io_base_virt + size)) { | ||
| 119 | ret = 1; | ||
| 120 | break; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | spin_unlock(&hose_spinlock); | ||
| 124 | return ret; | ||
| 125 | } | ||
| 126 | |||
| 104 | /* | 127 | /* |
| 105 | * Return the domain number for this bus. | 128 | * Return the domain number for this bus. |
| 106 | */ | 129 | */ |
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 3786dcc8a7b6..b5c96af955c6 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | /* Max address size we deal with */ | 24 | /* Max address size we deal with */ |
| 25 | #define OF_MAX_ADDR_CELLS 4 | 25 | #define OF_MAX_ADDR_CELLS 4 |
| 26 | #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ | 26 | #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ |
| 27 | (ns) >= 0) | 27 | (ns) > 0) |
| 28 | 28 | ||
| 29 | static struct of_bus *of_match_bus(struct device_node *np); | 29 | static struct of_bus *of_match_bus(struct device_node *np); |
| 30 | static int __of_address_to_resource(struct device_node *dev, | 30 | static int __of_address_to_resource(struct device_node *dev, |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 4924c48cb1ff..50ef38cffdbf 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -496,6 +496,10 @@ int check_legacy_ioport(unsigned long base_port) | |||
| 496 | break; | 496 | break; |
| 497 | } | 497 | } |
| 498 | np = of_find_node_by_type(NULL, "8042"); | 498 | np = of_find_node_by_type(NULL, "8042"); |
| 499 | /* Pegasos has no device_type on its 8042 node, look for the | ||
| 500 | * name instead */ | ||
| 501 | if (!np) | ||
| 502 | np = of_find_node_by_name(NULL, "8042"); | ||
| 499 | break; | 503 | break; |
| 500 | case FDC_BASE: /* FDC1 */ | 504 | case FDC_BASE: /* FDC1 */ |
| 501 | np = of_find_node_by_type(NULL, "fdc"); | 505 | np = of_find_node_by_type(NULL, "fdc"); |
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c index e3a1e8dc536a..8f4d2dc4cafb 100644 --- a/arch/powerpc/mm/lmb.c +++ b/arch/powerpc/mm/lmb.c | |||
| @@ -138,8 +138,8 @@ void __init lmb_analyze(void) | |||
| 138 | static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, | 138 | static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, |
| 139 | unsigned long size) | 139 | unsigned long size) |
| 140 | { | 140 | { |
| 141 | unsigned long i, coalesced = 0; | 141 | unsigned long coalesced = 0; |
| 142 | long adjacent; | 142 | long adjacent, i; |
| 143 | 143 | ||
| 144 | /* First try and coalesce this LMB with another. */ | 144 | /* First try and coalesce this LMB with another. */ |
| 145 | for (i=0; i < rgn->cnt; i++) { | 145 | for (i=0; i < rgn->cnt; i++) { |
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 6694f86d7000..9cb081c26e71 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c | |||
| @@ -59,7 +59,8 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) | |||
| 59 | INIT_LIST_HEAD(&ctx->aff_list); | 59 | INIT_LIST_HEAD(&ctx->aff_list); |
| 60 | if (gang) | 60 | if (gang) |
| 61 | spu_gang_add_ctx(gang, ctx); | 61 | spu_gang_add_ctx(gang, ctx); |
| 62 | ctx->cpus_allowed = current->cpus_allowed; | 62 | |
| 63 | __spu_update_sched_info(ctx); | ||
| 63 | spu_set_timeslice(ctx); | 64 | spu_set_timeslice(ctx); |
| 64 | ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; | 65 | ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; |
| 65 | 66 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index 0b50fa5cb39d..6abdd8fe2098 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
| @@ -312,6 +312,7 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) | |||
| 312 | spu_acquire(ctx); | 312 | spu_acquire(ctx); |
| 313 | if (ctx->state == SPU_STATE_SAVED) { | 313 | if (ctx->state == SPU_STATE_SAVED) { |
| 314 | __spu_update_sched_info(ctx); | 314 | __spu_update_sched_info(ctx); |
| 315 | spu_set_timeslice(ctx); | ||
| 315 | 316 | ||
| 316 | ret = spu_activate(ctx, 0); | 317 | ret = spu_activate(ctx, 0); |
| 317 | if (ret) { | 318 | if (ret) { |
| @@ -322,6 +323,9 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) | |||
| 322 | /* | 323 | /* |
| 323 | * We have to update the scheduling priority under active_mutex | 324 | * We have to update the scheduling priority under active_mutex |
| 324 | * to protect against find_victim(). | 325 | * to protect against find_victim(). |
| 326 | * | ||
| 327 | * No need to update the timeslice ASAP, it will get updated | ||
| 328 | * once the current one has expired. | ||
| 325 | */ | 329 | */ |
| 326 | spu_update_sched_info(ctx); | 330 | spu_update_sched_info(ctx); |
| 327 | } | 331 | } |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 227968b4779d..758a80ac080a 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
| @@ -927,10 +927,6 @@ int __init spu_sched_init(void) | |||
| 927 | INIT_LIST_HEAD(&spu_prio->runq[i]); | 927 | INIT_LIST_HEAD(&spu_prio->runq[i]); |
| 928 | __clear_bit(i, spu_prio->bitmap); | 928 | __clear_bit(i, spu_prio->bitmap); |
| 929 | } | 929 | } |
| 930 | for (i = 0; i < MAX_NUMNODES; i++) { | ||
| 931 | mutex_init(&cbe_spu_info[i].list_mutex); | ||
| 932 | INIT_LIST_HEAD(&cbe_spu_info[i].spus); | ||
| 933 | } | ||
| 934 | spin_lock_init(&spu_prio->runq_lock); | 930 | spin_lock_init(&spu_prio->runq_lock); |
| 935 | 931 | ||
| 936 | setup_timer(&spusched_timer, spusched_wake, 0); | 932 | setup_timer(&spusched_timer, spusched_wake, 0); |
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index 91df52a1899a..34bdbbe3ce59 100644 --- a/arch/powerpc/platforms/iseries/lpevents.c +++ b/arch/powerpc/platforms/iseries/lpevents.c | |||
| @@ -182,7 +182,7 @@ static int set_spread_lpevents(char *str) | |||
| 182 | } | 182 | } |
| 183 | __setup("spread_lpevents=", set_spread_lpevents); | 183 | __setup("spread_lpevents=", set_spread_lpevents); |
| 184 | 184 | ||
| 185 | void setup_hvlpevent_queue(void) | 185 | void __init setup_hvlpevent_queue(void) |
| 186 | { | 186 | { |
| 187 | void *eventStack; | 187 | void *eventStack; |
| 188 | 188 | ||
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index fceaae40fe70..2542403288f9 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c | |||
| @@ -490,6 +490,9 @@ static int __init maple_add_bridge(struct device_node *dev) | |||
| 490 | /* Fixup "bus-range" OF property */ | 490 | /* Fixup "bus-range" OF property */ |
| 491 | fixup_bus_range(dev); | 491 | fixup_bus_range(dev); |
| 492 | 492 | ||
| 493 | /* Check for legacy IOs */ | ||
| 494 | isa_bridge_find_early(hose); | ||
| 495 | |||
| 493 | return 0; | 496 | return 0; |
| 494 | } | 497 | } |
| 495 | 498 | ||
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 3289fab01e92..727453d3e8b9 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
| @@ -305,6 +305,64 @@ err: | |||
| 305 | 305 | ||
| 306 | arch_initcall(gfar_of_init); | 306 | arch_initcall(gfar_of_init); |
| 307 | 307 | ||
| 308 | #ifdef CONFIG_I2C_BOARDINFO | ||
| 309 | #include <linux/i2c.h> | ||
| 310 | struct i2c_driver_device { | ||
| 311 | char *of_device; | ||
| 312 | char *i2c_driver; | ||
| 313 | char *i2c_type; | ||
| 314 | }; | ||
| 315 | |||
| 316 | static struct i2c_driver_device i2c_devices[] __initdata = { | ||
| 317 | {"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",}, | ||
| 318 | {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",}, | ||
| 319 | {"ricoh,rv5c386", "rtc-rs5c372", "rv5c386",}, | ||
| 320 | {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",}, | ||
| 321 | }; | ||
| 322 | |||
| 323 | static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info) | ||
| 324 | { | ||
| 325 | int i; | ||
| 326 | |||
| 327 | for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { | ||
| 328 | if (!of_device_is_compatible(node, i2c_devices[i].of_device)) | ||
| 329 | continue; | ||
| 330 | strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN); | ||
| 331 | strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE); | ||
| 332 | return 0; | ||
| 333 | } | ||
| 334 | return -ENODEV; | ||
| 335 | } | ||
| 336 | |||
| 337 | static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num) | ||
| 338 | { | ||
| 339 | struct device_node *node = NULL; | ||
| 340 | |||
| 341 | while ((node = of_get_next_child(adap_node, node))) { | ||
| 342 | struct i2c_board_info info; | ||
| 343 | const u32 *addr; | ||
| 344 | int len; | ||
| 345 | |||
| 346 | addr = of_get_property(node, "reg", &len); | ||
| 347 | if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) { | ||
| 348 | printk(KERN_WARNING "fsl_ioc.c: invalid i2c device entry\n"); | ||
| 349 | continue; | ||
| 350 | } | ||
| 351 | |||
| 352 | info.irq = irq_of_parse_and_map(node, 0); | ||
| 353 | if (info.irq == NO_IRQ) | ||
| 354 | info.irq = -1; | ||
| 355 | |||
| 356 | if (of_find_i2c_driver(node, &info) < 0) | ||
| 357 | continue; | ||
| 358 | |||
| 359 | info.platform_data = NULL; | ||
| 360 | info.addr = *addr; | ||
| 361 | |||
| 362 | i2c_register_board_info(bus_num, &info, 1); | ||
| 363 | } | ||
| 364 | } | ||
| 365 | |||
| 308 | static int __init fsl_i2c_of_init(void) | 366 | static int __init fsl_i2c_of_init(void) |
| 309 | { | 367 | { |
| 310 | struct device_node *np; | 368 | struct device_node *np; |
| @@ -349,6 +407,8 @@ static int __init fsl_i2c_of_init(void) | |||
| 349 | fsl_i2c_platform_data)); | 407 | fsl_i2c_platform_data)); |
| 350 | if (ret) | 408 | if (ret) |
| 351 | goto unreg; | 409 | goto unreg; |
| 410 | |||
| 411 | of_register_i2c_devices(np, i); | ||
| 352 | } | 412 | } |
| 353 | 413 | ||
| 354 | return 0; | 414 | return 0; |
| @@ -360,6 +420,7 @@ err: | |||
| 360 | } | 420 | } |
| 361 | 421 | ||
| 362 | arch_initcall(fsl_i2c_of_init); | 422 | arch_initcall(fsl_i2c_of_init); |
| 423 | #endif | ||
| 363 | 424 | ||
| 364 | #ifdef CONFIG_PPC_83xx | 425 | #ifdef CONFIG_PPC_83xx |
| 365 | static int __init mpc83xx_wdt_init(void) | 426 | static int __init mpc83xx_wdt_init(void) |
diff --git a/arch/x86_64/kernel/acpi/Makefile b/arch/x86_64/kernel/acpi/Makefile index 080b9963f1bc..17595d23fee7 100644 --- a/arch/x86_64/kernel/acpi/Makefile +++ b/arch/x86_64/kernel/acpi/Makefile | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | obj-y := boot.o | 1 | obj-y := boot.o |
| 2 | boot-y := ../../../i386/kernel/acpi/boot.o | 2 | boot-y := ../../../i386/kernel/acpi/boot.o |
| 3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o | 3 | obj-y += sleep.o wakeup.o |
| 4 | 4 | ||
| 5 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | 5 | ifneq ($(CONFIG_ACPI_PROCESSOR),) |
| 6 | obj-y += processor.o | 6 | obj-y += processor.o |
diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c index 4277f2b27e6d..79475d237071 100644 --- a/arch/x86_64/kernel/acpi/sleep.c +++ b/arch/x86_64/kernel/acpi/sleep.c | |||
| @@ -51,8 +51,6 @@ | |||
| 51 | Low-Level Sleep Support | 51 | Low-Level Sleep Support |
| 52 | -------------------------------------------------------------------------- */ | 52 | -------------------------------------------------------------------------- */ |
| 53 | 53 | ||
| 54 | #ifdef CONFIG_ACPI_SLEEP | ||
| 55 | |||
| 56 | /* address in low memory of the wakeup routine. */ | 54 | /* address in low memory of the wakeup routine. */ |
| 57 | unsigned long acpi_wakeup_address = 0; | 55 | unsigned long acpi_wakeup_address = 0; |
| 58 | unsigned long acpi_realmode_flags; | 56 | unsigned long acpi_realmode_flags; |
| @@ -117,8 +115,6 @@ static int __init acpi_sleep_setup(char *str) | |||
| 117 | 115 | ||
| 118 | __setup("acpi_sleep=", acpi_sleep_setup); | 116 | __setup("acpi_sleep=", acpi_sleep_setup); |
| 119 | 117 | ||
| 120 | #endif /*CONFIG_ACPI_SLEEP */ | ||
| 121 | |||
| 122 | void acpi_pci_link_exit(void) | 118 | void acpi_pci_link_exit(void) |
| 123 | { | 119 | { |
| 124 | } | 120 | } |
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index e89abcdbdde8..3a16e417dd8d 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
| @@ -120,7 +120,7 @@ ident_complete: | |||
| 120 | addq %rbp, trampoline_level4_pgt + 0(%rip) | 120 | addq %rbp, trampoline_level4_pgt + 0(%rip) |
| 121 | addq %rbp, trampoline_level4_pgt + (511*8)(%rip) | 121 | addq %rbp, trampoline_level4_pgt + (511*8)(%rip) |
| 122 | #endif | 122 | #endif |
| 123 | #ifdef CONFIG_ACPI_SLEEP | 123 | #ifdef CONFIG_ACPI |
| 124 | addq %rbp, wakeup_level4_pgt + 0(%rip) | 124 | addq %rbp, wakeup_level4_pgt + 0(%rip) |
| 125 | addq %rbp, wakeup_level4_pgt + (511*8)(%rip) | 125 | addq %rbp, wakeup_level4_pgt + (511*8)(%rip) |
| 126 | #endif | 126 | #endif |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index af838f6b0b7f..0f400f3c4694 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
| @@ -333,7 +333,7 @@ void __init setup_arch(char **cmdline_p) | |||
| 333 | reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE); | 333 | reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE); |
| 334 | #endif | 334 | #endif |
| 335 | 335 | ||
| 336 | #ifdef CONFIG_ACPI_SLEEP | 336 | #ifdef CONFIG_ACPI |
| 337 | /* | 337 | /* |
| 338 | * Reserve low memory region for sleep support. | 338 | * Reserve low memory region for sleep support. |
| 339 | */ | 339 | */ |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 408b45168aba..251344cb29ae 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -11,6 +11,9 @@ menuconfig ACPI | |||
| 11 | depends on PCI | 11 | depends on PCI |
| 12 | depends on PM | 12 | depends on PM |
| 13 | select PNP | 13 | select PNP |
| 14 | # for sleep | ||
| 15 | select HOTPLUG_CPU if X86 && SMP | ||
| 16 | select SUSPEND_SMP if X86 && SMP | ||
| 14 | default y | 17 | default y |
| 15 | ---help--- | 18 | ---help--- |
| 16 | Advanced Configuration and Power Interface (ACPI) support for | 19 | Advanced Configuration and Power Interface (ACPI) support for |
| @@ -42,51 +45,26 @@ menuconfig ACPI | |||
| 42 | 45 | ||
| 43 | if ACPI | 46 | if ACPI |
| 44 | 47 | ||
| 45 | config ACPI_SLEEP | ||
| 46 | bool "Sleep States" | ||
| 47 | depends on X86 && (!SMP || SUSPEND_SMP) | ||
| 48 | default y | ||
| 49 | ---help--- | ||
| 50 | This option adds support for ACPI suspend states. | ||
| 51 | |||
| 52 | With this option, you will be able to put the system "to sleep". | ||
| 53 | Sleep states are low power states for the system and devices. All | ||
| 54 | of the system operating state is saved to either memory or disk | ||
| 55 | (depending on the state), to allow the system to resume operation | ||
| 56 | quickly at your request. | ||
| 57 | |||
| 58 | Although this option sounds really nifty, barely any of the device | ||
| 59 | drivers have been converted to the new driver model and hence few | ||
| 60 | have proper power management support. | ||
| 61 | |||
| 62 | This option is not recommended for anyone except those doing driver | ||
| 63 | power management development. | ||
| 64 | |||
| 65 | config ACPI_SLEEP_PROC_FS | ||
| 66 | bool | ||
| 67 | depends on ACPI_SLEEP && PROC_FS | ||
| 68 | default y | ||
| 69 | |||
| 70 | config ACPI_SLEEP_PROC_SLEEP | ||
| 71 | bool "/proc/acpi/sleep (deprecated)" | ||
| 72 | depends on ACPI_SLEEP_PROC_FS | ||
| 73 | default n | ||
| 74 | ---help--- | ||
| 75 | Create /proc/acpi/sleep | ||
| 76 | Deprecated by /sys/power/state | ||
| 77 | |||
| 78 | config ACPI_PROCFS | 48 | config ACPI_PROCFS |
| 79 | bool "Procfs interface (deprecated)" | 49 | bool "Deprecated /proc/acpi files" |
| 80 | default y | 50 | depends on PROC_FS |
| 81 | ---help--- | 51 | ---help--- |
| 82 | The Procfs interface for ACPI is made optional for backward compatibility. | 52 | For backwards compatibility, this option allows |
| 83 | As the same functions are duplicated in the sysfs interface | 53 | depricated /proc/acpi/ files to exist, even when |
| 84 | and this proc interface will be removed some time later, | 54 | they have been replaced by functions in /sys. |
| 85 | it's marked as deprecated. | 55 | The deprecated files (and their replacements) include: |
| 86 | ( /proc/acpi/debug_layer && debug_level are deprecated by | 56 | |
| 87 | /sys/module/acpi/parameters/debug_layer && debug_level. | 57 | /proc/acpi/sleep (/sys/power/state) |
| 88 | /proc/acpi/info is deprecated by | 58 | /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) |
| 89 | /sys/module/acpi/parameters/acpica_version ) | 59 | /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) |
| 60 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) | ||
| 61 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) | ||
| 62 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) | ||
| 63 | |||
| 64 | This option has no effect on /proc/acpi/ files | ||
| 65 | and functions which do not yet exist in /sys. | ||
| 66 | |||
| 67 | Say N to delete /proc/acpi/ files that have moved to /sys/ | ||
| 90 | 68 | ||
| 91 | config ACPI_AC | 69 | config ACPI_AC |
| 92 | tristate "AC Adapter" | 70 | tristate "AC Adapter" |
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 37c7dc4f9fe5..d8b35093527a 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | 34 | ||
| 35 | #define ACPI_AC_COMPONENT 0x00020000 | 35 | #define ACPI_AC_COMPONENT 0x00020000 |
| 36 | #define ACPI_AC_CLASS "ac_adapter" | 36 | #define ACPI_AC_CLASS "ac_adapter" |
| 37 | #define ACPI_AC_HID "ACPI0003" | ||
| 38 | #define ACPI_AC_DEVICE_NAME "AC Adapter" | 37 | #define ACPI_AC_DEVICE_NAME "AC Adapter" |
| 39 | #define ACPI_AC_FILE_STATE "state" | 38 | #define ACPI_AC_FILE_STATE "state" |
| 40 | #define ACPI_AC_NOTIFY_STATUS 0x80 | 39 | #define ACPI_AC_NOTIFY_STATUS 0x80 |
| @@ -56,10 +55,16 @@ static int acpi_ac_add(struct acpi_device *device); | |||
| 56 | static int acpi_ac_remove(struct acpi_device *device, int type); | 55 | static int acpi_ac_remove(struct acpi_device *device, int type); |
| 57 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); | 56 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); |
| 58 | 57 | ||
| 58 | const static struct acpi_device_id ac_device_ids[] = { | ||
| 59 | {"ACPI0003", 0}, | ||
| 60 | {"", 0}, | ||
| 61 | }; | ||
| 62 | MODULE_DEVICE_TABLE(acpi, ac_device_ids); | ||
| 63 | |||
| 59 | static struct acpi_driver acpi_ac_driver = { | 64 | static struct acpi_driver acpi_ac_driver = { |
| 60 | .name = "ac", | 65 | .name = "ac", |
| 61 | .class = ACPI_AC_CLASS, | 66 | .class = ACPI_AC_CLASS, |
| 62 | .ids = ACPI_AC_HID, | 67 | .ids = ac_device_ids, |
| 63 | .ops = { | 68 | .ops = { |
| 64 | .add = acpi_ac_add, | 69 | .add = acpi_ac_add, |
| 65 | .remove = acpi_ac_remove, | 70 | .remove = acpi_ac_remove, |
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index e65628a03085..5f1127ad5a95 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
| @@ -53,10 +53,16 @@ static int acpi_memory_device_add(struct acpi_device *device); | |||
| 53 | static int acpi_memory_device_remove(struct acpi_device *device, int type); | 53 | static int acpi_memory_device_remove(struct acpi_device *device, int type); |
| 54 | static int acpi_memory_device_start(struct acpi_device *device); | 54 | static int acpi_memory_device_start(struct acpi_device *device); |
| 55 | 55 | ||
| 56 | static const struct acpi_device_id memory_device_ids[] = { | ||
| 57 | {ACPI_MEMORY_DEVICE_HID, 0}, | ||
| 58 | {"", 0}, | ||
| 59 | }; | ||
| 60 | MODULE_DEVICE_TABLE(acpi, memory_device_ids); | ||
| 61 | |||
| 56 | static struct acpi_driver acpi_memory_device_driver = { | 62 | static struct acpi_driver acpi_memory_device_driver = { |
| 57 | .name = "acpi_memhotplug", | 63 | .name = "acpi_memhotplug", |
| 58 | .class = ACPI_MEMORY_DEVICE_CLASS, | 64 | .class = ACPI_MEMORY_DEVICE_CLASS, |
| 59 | .ids = ACPI_MEMORY_DEVICE_HID, | 65 | .ids = memory_device_ids, |
| 60 | .ops = { | 66 | .ops = { |
| 61 | .add = acpi_memory_device_add, | 67 | .add = acpi_memory_device_add, |
| 62 | .remove = acpi_memory_device_remove, | 68 | .remove = acpi_memory_device_remove, |
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 3cd79caad70c..9c4bd220c44f 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
| @@ -56,7 +56,6 @@ | |||
| 56 | #define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver" | 56 | #define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver" |
| 57 | #define ACPI_HOTK_CLASS "hotkey" | 57 | #define ACPI_HOTK_CLASS "hotkey" |
| 58 | #define ACPI_HOTK_DEVICE_NAME "Hotkey" | 58 | #define ACPI_HOTK_DEVICE_NAME "Hotkey" |
| 59 | #define ACPI_HOTK_HID "ATK0100" | ||
| 60 | 59 | ||
| 61 | /* | 60 | /* |
| 62 | * Some events we use, same for all Asus | 61 | * Some events we use, same for all Asus |
| @@ -426,14 +425,20 @@ static struct acpi_table_header *asus_info; | |||
| 426 | static struct asus_hotk *hotk; | 425 | static struct asus_hotk *hotk; |
| 427 | 426 | ||
| 428 | /* | 427 | /* |
| 429 | * The hotkey driver declaration | 428 | * The hotkey driver and autoloading declaration |
| 430 | */ | 429 | */ |
| 431 | static int asus_hotk_add(struct acpi_device *device); | 430 | static int asus_hotk_add(struct acpi_device *device); |
| 432 | static int asus_hotk_remove(struct acpi_device *device, int type); | 431 | static int asus_hotk_remove(struct acpi_device *device, int type); |
| 432 | static const struct acpi_device_id asus_device_ids[] = { | ||
| 433 | {"ATK0100", 0}, | ||
| 434 | {"", 0}, | ||
| 435 | }; | ||
| 436 | MODULE_DEVICE_TABLE(acpi, asus_device_ids); | ||
| 437 | |||
| 433 | static struct acpi_driver asus_hotk_driver = { | 438 | static struct acpi_driver asus_hotk_driver = { |
| 434 | .name = "asus_acpi", | 439 | .name = "asus_acpi", |
| 435 | .class = ACPI_HOTK_CLASS, | 440 | .class = ACPI_HOTK_CLASS, |
| 436 | .ids = ACPI_HOTK_HID, | 441 | .ids = asus_device_ids, |
| 437 | .ops = { | 442 | .ops = { |
| 438 | .add = asus_hotk_add, | 443 | .add = asus_hotk_add, |
| 439 | .remove = asus_hotk_remove, | 444 | .remove = asus_hotk_remove, |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index cad932de383d..81651032791b 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -41,7 +41,6 @@ | |||
| 41 | 41 | ||
| 42 | #define ACPI_BATTERY_COMPONENT 0x00040000 | 42 | #define ACPI_BATTERY_COMPONENT 0x00040000 |
| 43 | #define ACPI_BATTERY_CLASS "battery" | 43 | #define ACPI_BATTERY_CLASS "battery" |
| 44 | #define ACPI_BATTERY_HID "PNP0C0A" | ||
| 45 | #define ACPI_BATTERY_DEVICE_NAME "Battery" | 44 | #define ACPI_BATTERY_DEVICE_NAME "Battery" |
| 46 | #define ACPI_BATTERY_NOTIFY_STATUS 0x80 | 45 | #define ACPI_BATTERY_NOTIFY_STATUS 0x80 |
| 47 | #define ACPI_BATTERY_NOTIFY_INFO 0x81 | 46 | #define ACPI_BATTERY_NOTIFY_INFO 0x81 |
| @@ -74,10 +73,16 @@ static int acpi_battery_add(struct acpi_device *device); | |||
| 74 | static int acpi_battery_remove(struct acpi_device *device, int type); | 73 | static int acpi_battery_remove(struct acpi_device *device, int type); |
| 75 | static int acpi_battery_resume(struct acpi_device *device); | 74 | static int acpi_battery_resume(struct acpi_device *device); |
| 76 | 75 | ||
| 76 | static const struct acpi_device_id battery_device_ids[] = { | ||
| 77 | {"PNP0C0A", 0}, | ||
| 78 | {"", 0}, | ||
| 79 | }; | ||
| 80 | MODULE_DEVICE_TABLE(acpi, battery_device_ids); | ||
| 81 | |||
| 77 | static struct acpi_driver acpi_battery_driver = { | 82 | static struct acpi_driver acpi_battery_driver = { |
| 78 | .name = "battery", | 83 | .name = "battery", |
| 79 | .class = ACPI_BATTERY_CLASS, | 84 | .class = ACPI_BATTERY_CLASS, |
| 80 | .ids = ACPI_BATTERY_HID, | 85 | .ids = battery_device_ids, |
| 81 | .ops = { | 86 | .ops = { |
| 82 | .add = acpi_battery_add, | 87 | .add = acpi_battery_add, |
| 83 | .resume = acpi_battery_resume, | 88 | .resume = acpi_battery_resume, |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index cb4110b50cd0..540581338ef5 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
| @@ -66,6 +66,16 @@ MODULE_AUTHOR("Paul Diefenbaugh"); | |||
| 66 | MODULE_DESCRIPTION("ACPI Button Driver"); | 66 | MODULE_DESCRIPTION("ACPI Button Driver"); |
| 67 | MODULE_LICENSE("GPL"); | 67 | MODULE_LICENSE("GPL"); |
| 68 | 68 | ||
| 69 | static const struct acpi_device_id button_device_ids[] = { | ||
| 70 | {ACPI_BUTTON_HID_LID, 0}, | ||
| 71 | {ACPI_BUTTON_HID_SLEEP, 0}, | ||
| 72 | {ACPI_BUTTON_HID_SLEEPF, 0}, | ||
| 73 | {ACPI_BUTTON_HID_POWER, 0}, | ||
| 74 | {ACPI_BUTTON_HID_POWERF, 0}, | ||
| 75 | {"", 0}, | ||
| 76 | }; | ||
| 77 | MODULE_DEVICE_TABLE(acpi, button_device_ids); | ||
| 78 | |||
| 69 | static int acpi_button_add(struct acpi_device *device); | 79 | static int acpi_button_add(struct acpi_device *device); |
| 70 | static int acpi_button_remove(struct acpi_device *device, int type); | 80 | static int acpi_button_remove(struct acpi_device *device, int type); |
| 71 | static int acpi_button_info_open_fs(struct inode *inode, struct file *file); | 81 | 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); | |||
| 74 | static struct acpi_driver acpi_button_driver = { | 84 | static struct acpi_driver acpi_button_driver = { |
| 75 | .name = "button", | 85 | .name = "button", |
| 76 | .class = ACPI_BUTTON_CLASS, | 86 | .class = ACPI_BUTTON_CLASS, |
| 77 | .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E", | 87 | .ids = button_device_ids, |
| 78 | .ops = { | 88 | .ops = { |
| 79 | .add = acpi_button_add, | 89 | .add = acpi_button_add, |
| 80 | .remove = acpi_button_remove, | 90 | .remove = acpi_button_remove, |
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 0dd3bf7c0ed1..3c25ec7a1871 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
| @@ -52,10 +52,18 @@ MODULE_LICENSE("GPL"); | |||
| 52 | static int acpi_container_add(struct acpi_device *device); | 52 | static int acpi_container_add(struct acpi_device *device); |
| 53 | static int acpi_container_remove(struct acpi_device *device, int type); | 53 | static int acpi_container_remove(struct acpi_device *device, int type); |
| 54 | 54 | ||
| 55 | static const struct acpi_device_id container_device_ids[] = { | ||
| 56 | {"ACPI0004", 0}, | ||
| 57 | {"PNP0A05", 0}, | ||
| 58 | {"PNP0A06", 0}, | ||
| 59 | {"", 0}, | ||
| 60 | }; | ||
| 61 | MODULE_DEVICE_TABLE(acpi, container_device_ids); | ||
| 62 | |||
| 55 | static struct acpi_driver acpi_container_driver = { | 63 | static struct acpi_driver acpi_container_driver = { |
| 56 | .name = "container", | 64 | .name = "container", |
| 57 | .class = ACPI_CONTAINER_CLASS, | 65 | .class = ACPI_CONTAINER_CLASS, |
| 58 | .ids = "ACPI0004,PNP0A05,PNP0A06", | 66 | .ids = container_device_ids, |
| 59 | .ops = { | 67 | .ops = { |
| 60 | .add = acpi_container_add, | 68 | .add = acpi_container_add, |
| 61 | .remove = acpi_container_remove, | 69 | .remove = acpi_container_remove, |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 10e851021eca..469f3f57f881 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
| @@ -41,7 +41,6 @@ | |||
| 41 | #include <acpi/actypes.h> | 41 | #include <acpi/actypes.h> |
| 42 | 42 | ||
| 43 | #define ACPI_EC_CLASS "embedded_controller" | 43 | #define ACPI_EC_CLASS "embedded_controller" |
| 44 | #define ACPI_EC_HID "PNP0C09" | ||
| 45 | #define ACPI_EC_DEVICE_NAME "Embedded Controller" | 44 | #define ACPI_EC_DEVICE_NAME "Embedded Controller" |
| 46 | #define ACPI_EC_FILE_INFO "info" | 45 | #define ACPI_EC_FILE_INFO "info" |
| 47 | 46 | ||
| @@ -82,10 +81,15 @@ static int acpi_ec_start(struct acpi_device *device); | |||
| 82 | static int acpi_ec_stop(struct acpi_device *device, int type); | 81 | static int acpi_ec_stop(struct acpi_device *device, int type); |
| 83 | static int acpi_ec_add(struct acpi_device *device); | 82 | static int acpi_ec_add(struct acpi_device *device); |
| 84 | 83 | ||
| 84 | static const struct acpi_device_id ec_device_ids[] = { | ||
| 85 | {"PNP0C09", 0}, | ||
| 86 | {"", 0}, | ||
| 87 | }; | ||
| 88 | |||
| 85 | static struct acpi_driver acpi_ec_driver = { | 89 | static struct acpi_driver acpi_ec_driver = { |
| 86 | .name = "ec", | 90 | .name = "ec", |
| 87 | .class = ACPI_EC_CLASS, | 91 | .class = ACPI_EC_CLASS, |
| 88 | .ids = ACPI_EC_HID, | 92 | .ids = ec_device_ids, |
| 89 | .ops = { | 93 | .ops = { |
| 90 | .add = acpi_ec_add, | 94 | .add = acpi_ec_add, |
| 91 | .remove = acpi_ec_remove, | 95 | .remove = acpi_ec_remove, |
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c index 23ee7bc4a705..b1aaa0e84588 100644 --- a/drivers/acpi/events/evrgnini.c +++ b/drivers/acpi/events/evrgnini.c | |||
| @@ -378,7 +378,7 @@ static u8 acpi_ev_match_pci_root_bridge(char *id) | |||
| 378 | static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) | 378 | static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) |
| 379 | { | 379 | { |
| 380 | acpi_status status; | 380 | acpi_status status; |
| 381 | struct acpi_device_id hid; | 381 | struct acpica_device_id hid; |
| 382 | struct acpi_compatible_id_list *cid; | 382 | struct acpi_compatible_id_list *cid; |
| 383 | acpi_native_uint i; | 383 | acpi_native_uint i; |
| 384 | 384 | ||
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index ec655c539492..c81f6bdb68b8 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
| @@ -50,10 +50,16 @@ static int acpi_fan_remove(struct acpi_device *device, int type); | |||
| 50 | static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); | 50 | static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); |
| 51 | static int acpi_fan_resume(struct acpi_device *device); | 51 | static int acpi_fan_resume(struct acpi_device *device); |
| 52 | 52 | ||
| 53 | static const struct acpi_device_id fan_device_ids[] = { | ||
| 54 | {"PNP0C0B", 0}, | ||
| 55 | {"", 0}, | ||
| 56 | }; | ||
| 57 | MODULE_DEVICE_TABLE(acpi, fan_device_ids); | ||
| 58 | |||
| 53 | static struct acpi_driver acpi_fan_driver = { | 59 | static struct acpi_driver acpi_fan_driver = { |
| 54 | .name = "fan", | 60 | .name = "fan", |
| 55 | .class = ACPI_FAN_CLASS, | 61 | .class = ACPI_FAN_CLASS, |
| 56 | .ids = "PNP0C0B", | 62 | .ids = fan_device_ids, |
| 57 | .ops = { | 63 | .ops = { |
| 58 | .add = acpi_fan_add, | 64 | .add = acpi_fan_add, |
| 59 | .remove = acpi_fan_remove, | 65 | .remove = acpi_fan_remove, |
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c index be4f2899de74..ab65b2c2560e 100644 --- a/drivers/acpi/namespace/nsxfeval.c +++ b/drivers/acpi/namespace/nsxfeval.c | |||
| @@ -440,7 +440,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, | |||
| 440 | acpi_status status; | 440 | acpi_status status; |
| 441 | struct acpi_namespace_node *node; | 441 | struct acpi_namespace_node *node; |
| 442 | u32 flags; | 442 | u32 flags; |
| 443 | struct acpi_device_id hid; | 443 | struct acpica_device_id hid; |
| 444 | struct acpi_compatible_id_list *cid; | 444 | struct acpi_compatible_id_list *cid; |
| 445 | acpi_native_uint i; | 445 | acpi_native_uint i; |
| 446 | 446 | ||
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 3448edd61dc4..c9f526e55392 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
| @@ -46,7 +46,6 @@ | |||
| 46 | #define _COMPONENT ACPI_PCI_COMPONENT | 46 | #define _COMPONENT ACPI_PCI_COMPONENT |
| 47 | ACPI_MODULE_NAME("pci_link"); | 47 | ACPI_MODULE_NAME("pci_link"); |
| 48 | #define ACPI_PCI_LINK_CLASS "pci_irq_routing" | 48 | #define ACPI_PCI_LINK_CLASS "pci_irq_routing" |
| 49 | #define ACPI_PCI_LINK_HID "PNP0C0F" | ||
| 50 | #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" | 49 | #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" |
| 51 | #define ACPI_PCI_LINK_FILE_INFO "info" | 50 | #define ACPI_PCI_LINK_FILE_INFO "info" |
| 52 | #define ACPI_PCI_LINK_FILE_STATUS "state" | 51 | #define ACPI_PCI_LINK_FILE_STATUS "state" |
| @@ -54,10 +53,16 @@ ACPI_MODULE_NAME("pci_link"); | |||
| 54 | static int acpi_pci_link_add(struct acpi_device *device); | 53 | static int acpi_pci_link_add(struct acpi_device *device); |
| 55 | static int acpi_pci_link_remove(struct acpi_device *device, int type); | 54 | static int acpi_pci_link_remove(struct acpi_device *device, int type); |
| 56 | 55 | ||
| 56 | static struct acpi_device_id link_device_ids[] = { | ||
| 57 | {"PNP0C0F", 0}, | ||
| 58 | {"", 0}, | ||
| 59 | }; | ||
| 60 | MODULE_DEVICE_TABLE(acpi, link_device_ids); | ||
| 61 | |||
| 57 | static struct acpi_driver acpi_pci_link_driver = { | 62 | static struct acpi_driver acpi_pci_link_driver = { |
| 58 | .name = "pci_link", | 63 | .name = "pci_link", |
| 59 | .class = ACPI_PCI_LINK_CLASS, | 64 | .class = ACPI_PCI_LINK_CLASS, |
| 60 | .ids = ACPI_PCI_LINK_HID, | 65 | .ids = link_device_ids, |
| 61 | .ops = { | 66 | .ops = { |
| 62 | .add = acpi_pci_link_add, | 67 | .add = acpi_pci_link_add, |
| 63 | .remove = acpi_pci_link_remove, | 68 | .remove = acpi_pci_link_remove, |
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index ad4145a37786..f14ff1ffab29 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
| @@ -38,16 +38,21 @@ | |||
| 38 | #define _COMPONENT ACPI_PCI_COMPONENT | 38 | #define _COMPONENT ACPI_PCI_COMPONENT |
| 39 | ACPI_MODULE_NAME("pci_root"); | 39 | ACPI_MODULE_NAME("pci_root"); |
| 40 | #define ACPI_PCI_ROOT_CLASS "pci_bridge" | 40 | #define ACPI_PCI_ROOT_CLASS "pci_bridge" |
| 41 | #define ACPI_PCI_ROOT_HID "PNP0A03" | ||
| 42 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" | 41 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" |
| 43 | static int acpi_pci_root_add(struct acpi_device *device); | 42 | static int acpi_pci_root_add(struct acpi_device *device); |
| 44 | static int acpi_pci_root_remove(struct acpi_device *device, int type); | 43 | static int acpi_pci_root_remove(struct acpi_device *device, int type); |
| 45 | static int acpi_pci_root_start(struct acpi_device *device); | 44 | static int acpi_pci_root_start(struct acpi_device *device); |
| 46 | 45 | ||
| 46 | static struct acpi_device_id root_device_ids[] = { | ||
| 47 | {"PNP0A03", 0}, | ||
| 48 | {"", 0}, | ||
| 49 | }; | ||
| 50 | MODULE_DEVICE_TABLE(acpi, root_device_ids); | ||
| 51 | |||
| 47 | static struct acpi_driver acpi_pci_root_driver = { | 52 | static struct acpi_driver acpi_pci_root_driver = { |
| 48 | .name = "pci_root", | 53 | .name = "pci_root", |
| 49 | .class = ACPI_PCI_ROOT_CLASS, | 54 | .class = ACPI_PCI_ROOT_CLASS, |
| 50 | .ids = ACPI_PCI_ROOT_HID, | 55 | .ids = root_device_ids, |
| 51 | .ops = { | 56 | .ops = { |
| 52 | .add = acpi_pci_root_add, | 57 | .add = acpi_pci_root_add, |
| 53 | .remove = acpi_pci_root_remove, | 58 | .remove = acpi_pci_root_remove, |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 4ffecd179702..57b9a2998fd0 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
| @@ -59,10 +59,16 @@ static int acpi_power_remove(struct acpi_device *device, int type); | |||
| 59 | static int acpi_power_resume(struct acpi_device *device); | 59 | static int acpi_power_resume(struct acpi_device *device); |
| 60 | static int acpi_power_open_fs(struct inode *inode, struct file *file); | 60 | static int acpi_power_open_fs(struct inode *inode, struct file *file); |
| 61 | 61 | ||
| 62 | static struct acpi_device_id power_device_ids[] = { | ||
| 63 | {ACPI_POWER_HID, 0}, | ||
| 64 | {"", 0}, | ||
| 65 | }; | ||
| 66 | MODULE_DEVICE_TABLE(acpi, power_device_ids); | ||
| 67 | |||
| 62 | static struct acpi_driver acpi_power_driver = { | 68 | static struct acpi_driver acpi_power_driver = { |
| 63 | .name = "power", | 69 | .name = "power", |
| 64 | .class = ACPI_POWER_CLASS, | 70 | .class = ACPI_POWER_CLASS, |
| 65 | .ids = ACPI_POWER_HID, | 71 | .ids = power_device_ids, |
| 66 | .ops = { | 72 | .ops = { |
| 67 | .add = acpi_power_add, | 73 | .add = acpi_power_add, |
| 68 | .remove = acpi_power_remove, | 74 | .remove = acpi_power_remove, |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 81aceb5da7c7..498422343f38 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
| @@ -88,10 +88,16 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr); | |||
| 88 | extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 88 | extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | static const struct acpi_device_id processor_device_ids[] = { | ||
| 92 | {ACPI_PROCESSOR_HID, 0}, | ||
| 93 | {"", 0}, | ||
| 94 | }; | ||
| 95 | MODULE_DEVICE_TABLE(acpi, processor_device_ids); | ||
| 96 | |||
| 91 | static struct acpi_driver acpi_processor_driver = { | 97 | static struct acpi_driver acpi_processor_driver = { |
| 92 | .name = "processor", | 98 | .name = "processor", |
| 93 | .class = ACPI_PROCESSOR_CLASS, | 99 | .class = ACPI_PROCESSOR_CLASS, |
| 94 | .ids = ACPI_PROCESSOR_HID, | 100 | .ids = processor_device_ids, |
| 95 | .ops = { | 101 | .ops = { |
| 96 | .add = acpi_processor_add, | 102 | .add = acpi_processor_add, |
| 97 | .remove = acpi_processor_remove, | 103 | .remove = acpi_processor_remove, |
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index 3f55d1f90c11..0b8204e7082a 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
| @@ -47,6 +47,9 @@ ACPI_MODULE_NAME("processor_throttling"); | |||
| 47 | static int acpi_processor_get_throttling(struct acpi_processor *pr); | 47 | static int acpi_processor_get_throttling(struct acpi_processor *pr); |
| 48 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state); | 48 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state); |
| 49 | 49 | ||
| 50 | /* | ||
| 51 | * _TPC - Throttling Present Capabilities | ||
| 52 | */ | ||
| 50 | static int acpi_processor_get_platform_limit(struct acpi_processor *pr) | 53 | static int acpi_processor_get_platform_limit(struct acpi_processor *pr) |
| 51 | { | 54 | { |
| 52 | acpi_status status = 0; | 55 | acpi_status status = 0; |
| @@ -55,8 +58,10 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) | |||
| 55 | if (!pr) | 58 | if (!pr) |
| 56 | return -EINVAL; | 59 | return -EINVAL; |
| 57 | status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); | 60 | status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); |
| 58 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | 61 | if (ACPI_FAILURE(status)) { |
| 59 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); | 62 | if (status != AE_NOT_FOUND) { |
| 63 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); | ||
| 64 | } | ||
| 60 | return -ENODEV; | 65 | return -ENODEV; |
| 61 | } | 66 | } |
| 62 | pr->throttling_platform_limit = (int)tpc; | 67 | pr->throttling_platform_limit = (int)tpc; |
| @@ -68,9 +73,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr) | |||
| 68 | return acpi_processor_get_platform_limit(pr); | 73 | return acpi_processor_get_platform_limit(pr); |
| 69 | } | 74 | } |
| 70 | 75 | ||
| 71 | /* -------------------------------------------------------------------------- | 76 | /* |
| 72 | _PTC, _TSS, _TSD support | 77 | * _PTC - Processor Throttling Control (and status) register location |
| 73 | -------------------------------------------------------------------------- */ | 78 | */ |
| 74 | static int acpi_processor_get_throttling_control(struct acpi_processor *pr) | 79 | static int acpi_processor_get_throttling_control(struct acpi_processor *pr) |
| 75 | { | 80 | { |
| 76 | int result = 0; | 81 | int result = 0; |
| @@ -81,7 +86,9 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) | |||
| 81 | 86 | ||
| 82 | status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); | 87 | status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); |
| 83 | if (ACPI_FAILURE(status)) { | 88 | if (ACPI_FAILURE(status)) { |
| 84 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); | 89 | if (status != AE_NOT_FOUND) { |
| 90 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); | ||
| 91 | } | ||
| 85 | return -ENODEV; | 92 | return -ENODEV; |
| 86 | } | 93 | } |
| 87 | 94 | ||
| @@ -132,6 +139,10 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) | |||
| 132 | 139 | ||
| 133 | return result; | 140 | return result; |
| 134 | } | 141 | } |
| 142 | |||
| 143 | /* | ||
| 144 | * _TSS - Throttling Supported States | ||
| 145 | */ | ||
| 135 | static int acpi_processor_get_throttling_states(struct acpi_processor *pr) | 146 | static int acpi_processor_get_throttling_states(struct acpi_processor *pr) |
| 136 | { | 147 | { |
| 137 | int result = 0; | 148 | int result = 0; |
| @@ -144,7 +155,9 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) | |||
| 144 | 155 | ||
| 145 | status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); | 156 | status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); |
| 146 | if (ACPI_FAILURE(status)) { | 157 | if (ACPI_FAILURE(status)) { |
| 147 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); | 158 | if (status != AE_NOT_FOUND) { |
| 159 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); | ||
| 160 | } | ||
| 148 | return -ENODEV; | 161 | return -ENODEV; |
| 149 | } | 162 | } |
| 150 | 163 | ||
| @@ -201,6 +214,10 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) | |||
| 201 | 214 | ||
| 202 | return result; | 215 | return result; |
| 203 | } | 216 | } |
| 217 | |||
| 218 | /* | ||
| 219 | * _TSD - T-State Dependencies | ||
| 220 | */ | ||
| 204 | static int acpi_processor_get_tsd(struct acpi_processor *pr) | 221 | static int acpi_processor_get_tsd(struct acpi_processor *pr) |
| 205 | { | 222 | { |
| 206 | int result = 0; | 223 | int result = 0; |
| @@ -213,6 +230,9 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) | |||
| 213 | 230 | ||
| 214 | status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); | 231 | status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); |
| 215 | if (ACPI_FAILURE(status)) { | 232 | if (ACPI_FAILURE(status)) { |
| 233 | if (status != AE_NOT_FOUND) { | ||
| 234 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD")); | ||
| 235 | } | ||
| 216 | return -ENODEV; | 236 | return -ENODEV; |
| 217 | } | 237 | } |
| 218 | 238 | ||
| @@ -525,9 +545,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) | |||
| 525 | int result = 0; | 545 | int result = 0; |
| 526 | int step = 0; | 546 | int step = 0; |
| 527 | int i = 0; | 547 | int i = 0; |
| 528 | int no_ptc = 0; | ||
| 529 | int no_tss = 0; | ||
| 530 | int no_tsd = 0; | ||
| 531 | 548 | ||
| 532 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 549 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 533 | "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", | 550 | "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) | |||
| 538 | if (!pr) | 555 | if (!pr) |
| 539 | return -EINVAL; | 556 | return -EINVAL; |
| 540 | 557 | ||
| 541 | /* TBD: Support ACPI 2.0 objects */ | 558 | /* |
| 542 | no_ptc = acpi_processor_get_throttling_control(pr); | 559 | * Evaluate _PTC, _TSS and _TPC |
| 543 | no_tss = acpi_processor_get_throttling_states(pr); | 560 | * They must all be present or none of them can be used. |
| 544 | no_tsd = acpi_processor_get_tsd(pr); | 561 | */ |
| 545 | 562 | if (acpi_processor_get_throttling_control(pr) || | |
| 546 | if (no_ptc || no_tss) { | 563 | acpi_processor_get_throttling_states(pr) || |
| 564 | acpi_processor_get_platform_limit(pr)) | ||
| 565 | { | ||
| 547 | pr->throttling.acpi_processor_get_throttling = | 566 | pr->throttling.acpi_processor_get_throttling = |
| 548 | &acpi_processor_get_throttling_fadt; | 567 | &acpi_processor_get_throttling_fadt; |
| 549 | pr->throttling.acpi_processor_set_throttling = | 568 | pr->throttling.acpi_processor_set_throttling = |
| @@ -555,6 +574,8 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) | |||
| 555 | &acpi_processor_set_throttling_ptc; | 574 | &acpi_processor_set_throttling_ptc; |
| 556 | } | 575 | } |
| 557 | 576 | ||
| 577 | acpi_processor_get_tsd(pr); | ||
| 578 | |||
| 558 | if (!pr->throttling.address) { | 579 | if (!pr->throttling.address) { |
| 559 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); | 580 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); |
| 560 | return 0; | 581 | return 0; |
| @@ -658,18 +679,20 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq, | |||
| 658 | pr->throttling.state_count - 1); | 679 | pr->throttling.state_count - 1); |
| 659 | 680 | ||
| 660 | seq_puts(seq, "states:\n"); | 681 | seq_puts(seq, "states:\n"); |
| 661 | if (acpi_processor_get_throttling == acpi_processor_get_throttling_fadt) | 682 | if (pr->throttling.acpi_processor_get_throttling == |
| 683 | acpi_processor_get_throttling_fadt) { | ||
| 662 | for (i = 0; i < pr->throttling.state_count; i++) | 684 | for (i = 0; i < pr->throttling.state_count; i++) |
| 663 | seq_printf(seq, " %cT%d: %02d%%\n", | 685 | seq_printf(seq, " %cT%d: %02d%%\n", |
| 664 | (i == pr->throttling.state ? '*' : ' '), i, | 686 | (i == pr->throttling.state ? '*' : ' '), i, |
| 665 | (pr->throttling.states[i].performance ? pr-> | 687 | (pr->throttling.states[i].performance ? pr-> |
| 666 | throttling.states[i].performance / 10 : 0)); | 688 | throttling.states[i].performance / 10 : 0)); |
| 667 | else | 689 | } else { |
| 668 | for (i = 0; i < pr->throttling.state_count; i++) | 690 | for (i = 0; i < pr->throttling.state_count; i++) |
| 669 | seq_printf(seq, " %cT%d: %02d%%\n", | 691 | seq_printf(seq, " %cT%d: %02d%%\n", |
| 670 | (i == pr->throttling.state ? '*' : ' '), i, | 692 | (i == pr->throttling.state ? '*' : ' '), i, |
| 671 | (int)pr->throttling.states_tss[i]. | 693 | (int)pr->throttling.states_tss[i]. |
| 672 | freqpercentage); | 694 | freqpercentage); |
| 695 | } | ||
| 673 | 696 | ||
| 674 | end: | 697 | end: |
| 675 | return 0; | 698 | return 0; |
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 974d00ccfe84..7d8e78ea13a5 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
| @@ -38,7 +38,6 @@ | |||
| 38 | #define ACPI_SBS_CLASS "sbs" | 38 | #define ACPI_SBS_CLASS "sbs" |
| 39 | #define ACPI_AC_CLASS "ac_adapter" | 39 | #define ACPI_AC_CLASS "ac_adapter" |
| 40 | #define ACPI_BATTERY_CLASS "battery" | 40 | #define ACPI_BATTERY_CLASS "battery" |
| 41 | #define ACPI_SBS_HID "ACPI0002" | ||
| 42 | #define ACPI_SBS_DEVICE_NAME "Smart Battery System" | 41 | #define ACPI_SBS_DEVICE_NAME "Smart Battery System" |
| 43 | #define ACPI_SBS_FILE_INFO "info" | 42 | #define ACPI_SBS_FILE_INFO "info" |
| 44 | #define ACPI_SBS_FILE_STATE "state" | 43 | #define ACPI_SBS_FILE_STATE "state" |
| @@ -124,10 +123,17 @@ static int acpi_sbs_add(struct acpi_device *device); | |||
| 124 | static int acpi_sbs_remove(struct acpi_device *device, int type); | 123 | static int acpi_sbs_remove(struct acpi_device *device, int type); |
| 125 | static int acpi_sbs_resume(struct acpi_device *device); | 124 | static int acpi_sbs_resume(struct acpi_device *device); |
| 126 | 125 | ||
| 126 | static const struct acpi_device_id sbs_device_ids[] = { | ||
| 127 | {"ACPI0001", 0}, | ||
| 128 | {"ACPI0005", 0}, | ||
| 129 | {"", 0}, | ||
| 130 | }; | ||
| 131 | MODULE_DEVICE_TABLE(acpi, sbs_device_ids); | ||
| 132 | |||
| 127 | static struct acpi_driver acpi_sbs_driver = { | 133 | static struct acpi_driver acpi_sbs_driver = { |
| 128 | .name = "sbs", | 134 | .name = "sbs", |
| 129 | .class = ACPI_SBS_CLASS, | 135 | .class = ACPI_SBS_CLASS, |
| 130 | .ids = "ACPI0001,ACPI0005", | 136 | .ids = sbs_device_ids, |
| 131 | .ops = { | 137 | .ops = { |
| 132 | .add = acpi_sbs_add, | 138 | .add = acpi_sbs_add, |
| 133 | .remove = acpi_sbs_remove, | 139 | .remove = acpi_sbs_remove, |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 6b3b8a522476..be74347d1354 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -16,7 +16,7 @@ ACPI_MODULE_NAME("scan"); | |||
| 16 | extern struct acpi_device *acpi_root; | 16 | extern struct acpi_device *acpi_root; |
| 17 | 17 | ||
| 18 | #define ACPI_BUS_CLASS "system_bus" | 18 | #define ACPI_BUS_CLASS "system_bus" |
| 19 | #define ACPI_BUS_HID "ACPI_BUS" | 19 | #define ACPI_BUS_HID "LNXSYBUS" |
| 20 | #define ACPI_BUS_DEVICE_NAME "System Bus" | 20 | #define ACPI_BUS_DEVICE_NAME "System Bus" |
| 21 | 21 | ||
| 22 | static LIST_HEAD(acpi_device_list); | 22 | static LIST_HEAD(acpi_device_list); |
| @@ -29,6 +29,62 @@ struct acpi_device_bus_id{ | |||
| 29 | unsigned int instance_no; | 29 | unsigned int instance_no; |
| 30 | struct list_head node; | 30 | struct list_head node; |
| 31 | }; | 31 | }; |
| 32 | |||
| 33 | /* | ||
| 34 | * Creates hid/cid(s) string needed for modalias and uevent | ||
| 35 | * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get: | ||
| 36 | * char *modalias: "acpi:IBM0001:ACPI0001" | ||
| 37 | */ | ||
| 38 | int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){ | ||
| 39 | |||
| 40 | int len; | ||
| 41 | |||
| 42 | if (!acpi_dev->flags.hardware_id) | ||
| 43 | return -ENODEV; | ||
| 44 | |||
| 45 | len = snprintf(modalias, size, "acpi:%s:", | ||
| 46 | acpi_dev->pnp.hardware_id); | ||
| 47 | if (len < 0 || len >= size) | ||
| 48 | return -EINVAL; | ||
| 49 | size -= len; | ||
| 50 | |||
| 51 | if (acpi_dev->flags.compatible_ids) { | ||
| 52 | struct acpi_compatible_id_list *cid_list; | ||
| 53 | int i; | ||
| 54 | int count; | ||
| 55 | |||
| 56 | cid_list = acpi_dev->pnp.cid_list; | ||
| 57 | for (i = 0; i < cid_list->count; i++) { | ||
| 58 | count = snprintf(&modalias[len], size, "%s:", | ||
| 59 | cid_list->id[i].value); | ||
| 60 | if (count < 0 || count >= size) { | ||
| 61 | printk(KERN_ERR "acpi: %s cid[%i] exceeds event buffer size", | ||
| 62 | acpi_dev->pnp.device_name, i); | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | len += count; | ||
| 66 | size -= count; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | modalias[len] = '\0'; | ||
| 71 | return len; | ||
| 72 | } | ||
| 73 | |||
| 74 | static ssize_t | ||
| 75 | acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { | ||
| 76 | struct acpi_device *acpi_dev = to_acpi_device(dev); | ||
| 77 | int len; | ||
| 78 | |||
| 79 | /* Device has no HID and no CID or string is >1024 */ | ||
| 80 | len = create_modalias(acpi_dev, buf, 1024); | ||
| 81 | if (len <= 0) | ||
| 82 | return 0; | ||
| 83 | buf[len++] = '\n'; | ||
| 84 | return len; | ||
| 85 | } | ||
| 86 | static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); | ||
| 87 | |||
| 32 | static int acpi_eject_operation(acpi_handle handle, int lockable) | 88 | static int acpi_eject_operation(acpi_handle handle, int lockable) |
| 33 | { | 89 | { |
| 34 | struct acpi_object_list arg_list; | 90 | struct acpi_object_list arg_list; |
| @@ -154,6 +210,12 @@ static int acpi_device_setup_files(struct acpi_device *dev) | |||
| 154 | goto end; | 210 | goto end; |
| 155 | } | 211 | } |
| 156 | 212 | ||
| 213 | if (dev->flags.hardware_id || dev->flags.compatible_ids){ | ||
| 214 | result = device_create_file(&dev->dev, &dev_attr_modalias); | ||
| 215 | if(result) | ||
| 216 | goto end; | ||
| 217 | } | ||
| 218 | |||
| 157 | /* | 219 | /* |
| 158 | * If device has _EJ0, 'eject' file is created that is used to trigger | 220 | * If device has _EJ0, 'eject' file is created that is used to trigger |
| 159 | * hot-removal function from userland. | 221 | * hot-removal function from userland. |
| @@ -178,6 +240,9 @@ static void acpi_device_remove_files(struct acpi_device *dev) | |||
| 178 | if (ACPI_SUCCESS(status)) | 240 | if (ACPI_SUCCESS(status)) |
| 179 | device_remove_file(&dev->dev, &dev_attr_eject); | 241 | device_remove_file(&dev->dev, &dev_attr_eject); |
| 180 | 242 | ||
| 243 | if (dev->flags.hardware_id || dev->flags.compatible_ids) | ||
| 244 | device_remove_file(&dev->dev, &dev_attr_modalias); | ||
| 245 | |||
| 181 | if(dev->flags.hardware_id) | 246 | if(dev->flags.hardware_id) |
| 182 | device_remove_file(&dev->dev, &dev_attr_hid); | 247 | device_remove_file(&dev->dev, &dev_attr_hid); |
| 183 | if(dev->handle) | 248 | if(dev->handle) |
| @@ -186,6 +251,37 @@ static void acpi_device_remove_files(struct acpi_device *dev) | |||
| 186 | /* -------------------------------------------------------------------------- | 251 | /* -------------------------------------------------------------------------- |
| 187 | ACPI Bus operations | 252 | ACPI Bus operations |
| 188 | -------------------------------------------------------------------------- */ | 253 | -------------------------------------------------------------------------- */ |
| 254 | |||
| 255 | int acpi_match_device_ids(struct acpi_device *device, | ||
| 256 | const struct acpi_device_id *ids) | ||
| 257 | { | ||
| 258 | const struct acpi_device_id *id; | ||
| 259 | |||
| 260 | if (device->flags.hardware_id) { | ||
| 261 | for (id = ids; id->id[0]; id++) { | ||
| 262 | if (!strcmp((char*)id->id, device->pnp.hardware_id)) | ||
| 263 | return 0; | ||
| 264 | } | ||
| 265 | } | ||
| 266 | |||
| 267 | if (device->flags.compatible_ids) { | ||
| 268 | struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; | ||
| 269 | int i; | ||
| 270 | |||
| 271 | for (id = ids; id->id[0]; id++) { | ||
| 272 | /* compare multiple _CID entries against driver ids */ | ||
| 273 | for (i = 0; i < cid_list->count; i++) { | ||
| 274 | if (!strcmp((char*)id->id, | ||
| 275 | cid_list->id[i].value)) | ||
| 276 | return 0; | ||
| 277 | } | ||
| 278 | } | ||
| 279 | } | ||
| 280 | |||
| 281 | return -ENOENT; | ||
| 282 | } | ||
| 283 | EXPORT_SYMBOL(acpi_match_device_ids); | ||
| 284 | |||
| 189 | static void acpi_device_release(struct device *dev) | 285 | static void acpi_device_release(struct device *dev) |
| 190 | { | 286 | { |
| 191 | struct acpi_device *acpi_dev = to_acpi_device(dev); | 287 | 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) | |||
| 219 | struct acpi_device *acpi_dev = to_acpi_device(dev); | 315 | struct acpi_device *acpi_dev = to_acpi_device(dev); |
| 220 | struct acpi_driver *acpi_drv = to_acpi_driver(drv); | 316 | struct acpi_driver *acpi_drv = to_acpi_driver(drv); |
| 221 | 317 | ||
| 222 | return !acpi_match_ids(acpi_dev, acpi_drv->ids); | 318 | return !acpi_match_device_ids(acpi_dev, acpi_drv->ids); |
| 223 | } | 319 | } |
| 224 | 320 | ||
| 225 | static int acpi_device_uevent(struct device *dev, char **envp, int num_envp, | 321 | static int acpi_device_uevent(struct device *dev, char **envp, int num_envp, |
| 226 | char *buffer, int buffer_size) | 322 | char *buffer, int buffer_size) |
| 227 | { | 323 | { |
| 228 | struct acpi_device *acpi_dev = to_acpi_device(dev); | 324 | struct acpi_device *acpi_dev = to_acpi_device(dev); |
| 229 | int i = 0, length = 0, ret = 0; | ||
| 230 | |||
| 231 | if (acpi_dev->flags.hardware_id) | ||
| 232 | ret = add_uevent_var(envp, num_envp, &i, | ||
| 233 | buffer, buffer_size, &length, | ||
| 234 | "HWID=%s", acpi_dev->pnp.hardware_id); | ||
| 235 | if (ret) | ||
| 236 | return -ENOMEM; | ||
| 237 | if (acpi_dev->flags.compatible_ids) { | ||
| 238 | int j; | ||
| 239 | struct acpi_compatible_id_list *cid_list; | ||
| 240 | 325 | ||
| 241 | cid_list = acpi_dev->pnp.cid_list; | 326 | strcpy(buffer, "MODALIAS="); |
| 242 | 327 | if (create_modalias(acpi_dev, buffer + 9, buffer_size - 9) > 0) { | |
| 243 | for (j = 0; j < cid_list->count; j++) { | 328 | envp[0] = buffer; |
| 244 | ret = add_uevent_var(envp, num_envp, &i, buffer, | 329 | envp[1] = NULL; |
| 245 | buffer_size, &length, "COMPTID=%s", | ||
| 246 | cid_list->id[j].value); | ||
| 247 | if (ret) | ||
| 248 | return -ENOMEM; | ||
| 249 | } | ||
| 250 | } | 330 | } |
| 251 | |||
| 252 | envp[i] = NULL; | ||
| 253 | return 0; | 331 | return 0; |
| 254 | } | 332 | } |
| 255 | 333 | ||
| @@ -543,25 +621,6 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) | |||
| 543 | return; | 621 | return; |
| 544 | } | 622 | } |
| 545 | 623 | ||
| 546 | int acpi_match_ids(struct acpi_device *device, char *ids) | ||
| 547 | { | ||
| 548 | if (device->flags.hardware_id) | ||
| 549 | if (strstr(ids, device->pnp.hardware_id)) | ||
| 550 | return 0; | ||
| 551 | |||
| 552 | if (device->flags.compatible_ids) { | ||
| 553 | struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; | ||
| 554 | int i; | ||
| 555 | |||
| 556 | /* compare multiple _CID entries against driver ids */ | ||
| 557 | for (i = 0; i < cid_list->count; i++) { | ||
| 558 | if (strstr(ids, cid_list->id[i].value)) | ||
| 559 | return 0; | ||
| 560 | } | ||
| 561 | } | ||
| 562 | return -ENOENT; | ||
| 563 | } | ||
| 564 | |||
| 565 | static int acpi_bus_get_perf_flags(struct acpi_device *device) | 624 | static int acpi_bus_get_perf_flags(struct acpi_device *device) |
| 566 | { | 625 | { |
| 567 | device->performance.state = ACPI_STATE_UNKNOWN; | 626 | device->performance.state = ACPI_STATE_UNKNOWN; |
| @@ -624,6 +683,13 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
| 624 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 683 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
| 625 | union acpi_object *package = NULL; | 684 | union acpi_object *package = NULL; |
| 626 | 685 | ||
| 686 | struct acpi_device_id button_device_ids[] = { | ||
| 687 | {"PNP0C0D", 0}, | ||
| 688 | {"PNP0C0C", 0}, | ||
| 689 | {"PNP0C0E", 0}, | ||
| 690 | {"", 0}, | ||
| 691 | }; | ||
| 692 | |||
| 627 | 693 | ||
| 628 | /* _PRW */ | 694 | /* _PRW */ |
| 629 | status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); | 695 | 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) | |||
| 643 | 709 | ||
| 644 | device->wakeup.flags.valid = 1; | 710 | device->wakeup.flags.valid = 1; |
| 645 | /* Power button, Lid switch always enable wakeup */ | 711 | /* Power button, Lid switch always enable wakeup */ |
| 646 | if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E")) | 712 | if (!acpi_match_device_ids(device, button_device_ids)) |
| 647 | device->wakeup.flags.run_wake = 1; | 713 | device->wakeup.flags.run_wake = 1; |
| 648 | 714 | ||
| 649 | end: | 715 | end: |
diff --git a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile index d6c017709c85..01a993a1d086 100644 --- a/drivers/acpi/sleep/Makefile +++ b/drivers/acpi/sleep/Makefile | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | obj-y := poweroff.o wakeup.o | 1 | obj-y := poweroff.o wakeup.o |
| 2 | obj-$(CONFIG_ACPI_SLEEP) += main.o | 2 | obj-y += main.o |
| 3 | obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o | 3 | obj-$(CONFIG_X86) += proc.o |
| 4 | 4 | ||
| 5 | EXTRA_CFLAGS += $(ACPI_CFLAGS) | 5 | EXTRA_CFLAGS += $(ACPI_CFLAGS) |
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 3279e72a94f8..ab21357c5c7b 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
| @@ -34,35 +34,55 @@ static u32 acpi_suspend_states[] = { | |||
| 34 | 34 | ||
| 35 | static int init_8259A_after_S1; | 35 | static int init_8259A_after_S1; |
| 36 | 36 | ||
| 37 | extern int acpi_sleep_prepare(u32 acpi_state); | ||
| 38 | extern void acpi_power_off(void); | ||
| 39 | |||
| 40 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | ||
| 41 | |||
| 42 | /** | ||
| 43 | * acpi_pm_set_target - Set the target system sleep state to the state | ||
| 44 | * associated with given @pm_state, if supported. | ||
| 45 | */ | ||
| 46 | |||
| 47 | static int acpi_pm_set_target(suspend_state_t pm_state) | ||
| 48 | { | ||
| 49 | u32 acpi_state = acpi_suspend_states[pm_state]; | ||
| 50 | int error = 0; | ||
| 51 | |||
| 52 | if (sleep_states[acpi_state]) { | ||
| 53 | acpi_target_sleep_state = acpi_state; | ||
| 54 | } else { | ||
| 55 | printk(KERN_ERR "ACPI does not support this state: %d\n", | ||
| 56 | pm_state); | ||
| 57 | error = -ENOSYS; | ||
| 58 | } | ||
| 59 | return error; | ||
| 60 | } | ||
| 61 | |||
| 37 | /** | 62 | /** |
| 38 | * acpi_pm_prepare - Do preliminary suspend work. | 63 | * acpi_pm_prepare - Do preliminary suspend work. |
| 39 | * @pm_state: suspend state we're entering. | 64 | * @pm_state: ignored |
| 40 | * | 65 | * |
| 41 | * Make sure we support the state. If we do, and we need it, set the | 66 | * If necessary, set the firmware waking vector and do arch-specific |
| 42 | * firmware waking vector and do arch-specific nastiness to get the | 67 | * nastiness to get the wakeup code to the waking vector. |
| 43 | * wakeup code to the waking vector. | ||
| 44 | */ | 68 | */ |
| 45 | 69 | ||
| 46 | extern int acpi_sleep_prepare(u32 acpi_state); | ||
| 47 | extern void acpi_power_off(void); | ||
| 48 | |||
| 49 | static int acpi_pm_prepare(suspend_state_t pm_state) | 70 | static int acpi_pm_prepare(suspend_state_t pm_state) |
| 50 | { | 71 | { |
| 51 | u32 acpi_state = acpi_suspend_states[pm_state]; | 72 | int error = acpi_sleep_prepare(acpi_target_sleep_state); |
| 52 | 73 | ||
| 53 | if (!sleep_states[acpi_state]) { | 74 | if (error) |
| 54 | printk("acpi_pm_prepare does not support %d \n", pm_state); | 75 | acpi_target_sleep_state = ACPI_STATE_S0; |
| 55 | return -EPERM; | 76 | |
| 56 | } | 77 | return error; |
| 57 | return acpi_sleep_prepare(acpi_state); | ||
| 58 | } | 78 | } |
| 59 | 79 | ||
| 60 | /** | 80 | /** |
| 61 | * acpi_pm_enter - Actually enter a sleep state. | 81 | * acpi_pm_enter - Actually enter a sleep state. |
| 62 | * @pm_state: State we're entering. | 82 | * @pm_state: ignored |
| 63 | * | 83 | * |
| 64 | * Flush caches and go to sleep. For STR or STD, we have to call | 84 | * Flush caches and go to sleep. For STR we have to call arch-specific |
| 65 | * arch-specific assembly, which in turn call acpi_enter_sleep_state(). | 85 | * assembly, which in turn call acpi_enter_sleep_state(). |
| 66 | * It's unfortunate, but it works. Please fix if you're feeling frisky. | 86 | * It's unfortunate, but it works. Please fix if you're feeling frisky. |
| 67 | */ | 87 | */ |
| 68 | 88 | ||
| @@ -70,31 +90,31 @@ static int acpi_pm_enter(suspend_state_t pm_state) | |||
| 70 | { | 90 | { |
| 71 | acpi_status status = AE_OK; | 91 | acpi_status status = AE_OK; |
| 72 | unsigned long flags = 0; | 92 | unsigned long flags = 0; |
| 73 | u32 acpi_state = acpi_suspend_states[pm_state]; | 93 | u32 acpi_state = acpi_target_sleep_state; |
| 74 | 94 | ||
| 75 | ACPI_FLUSH_CPU_CACHE(); | 95 | ACPI_FLUSH_CPU_CACHE(); |
| 76 | 96 | ||
| 77 | /* Do arch specific saving of state. */ | 97 | /* Do arch specific saving of state. */ |
| 78 | if (pm_state > PM_SUSPEND_STANDBY) { | 98 | if (acpi_state == ACPI_STATE_S3) { |
| 79 | int error = acpi_save_state_mem(); | 99 | int error = acpi_save_state_mem(); |
| 80 | if (error) | 100 | |
| 101 | if (error) { | ||
| 102 | acpi_target_sleep_state = ACPI_STATE_S0; | ||
| 81 | return error; | 103 | return error; |
| 104 | } | ||
| 82 | } | 105 | } |
| 83 | 106 | ||
| 84 | local_irq_save(flags); | 107 | local_irq_save(flags); |
| 85 | acpi_enable_wakeup_device(acpi_state); | 108 | acpi_enable_wakeup_device(acpi_state); |
| 86 | switch (pm_state) { | 109 | switch (acpi_state) { |
| 87 | case PM_SUSPEND_STANDBY: | 110 | case ACPI_STATE_S1: |
| 88 | barrier(); | 111 | barrier(); |
| 89 | status = acpi_enter_sleep_state(acpi_state); | 112 | status = acpi_enter_sleep_state(acpi_state); |
| 90 | break; | 113 | break; |
| 91 | 114 | ||
| 92 | case PM_SUSPEND_MEM: | 115 | case ACPI_STATE_S3: |
| 93 | do_suspend_lowlevel(); | 116 | do_suspend_lowlevel(); |
| 94 | break; | 117 | break; |
| 95 | |||
| 96 | default: | ||
| 97 | return -EINVAL; | ||
| 98 | } | 118 | } |
| 99 | 119 | ||
| 100 | /* ACPI 3.0 specs (P62) says that it's the responsabilty | 120 | /* 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) | |||
| 107 | local_irq_restore(flags); | 127 | local_irq_restore(flags); |
| 108 | printk(KERN_DEBUG "Back to C!\n"); | 128 | printk(KERN_DEBUG "Back to C!\n"); |
| 109 | 129 | ||
| 110 | /* restore processor state | 130 | /* restore processor state */ |
| 111 | * We should only be here if we're coming back from STR or STD. | 131 | if (acpi_state == ACPI_STATE_S3) |
| 112 | * And, in the case of the latter, the memory image should have already | ||
| 113 | * been loaded from disk. | ||
| 114 | */ | ||
| 115 | if (pm_state > PM_SUSPEND_STANDBY) | ||
| 116 | acpi_restore_state_mem(); | 132 | acpi_restore_state_mem(); |
| 117 | 133 | ||
| 118 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; | 134 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; |
| @@ -120,7 +136,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) | |||
| 120 | 136 | ||
| 121 | /** | 137 | /** |
| 122 | * acpi_pm_finish - Finish up suspend sequence. | 138 | * acpi_pm_finish - Finish up suspend sequence. |
| 123 | * @pm_state: State we're coming out of. | 139 | * @pm_state: ignored |
| 124 | * | 140 | * |
| 125 | * This is called after we wake back up (or if entering the sleep state | 141 | * This is called after we wake back up (or if entering the sleep state |
| 126 | * failed). | 142 | * failed). |
| @@ -128,7 +144,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) | |||
| 128 | 144 | ||
| 129 | static int acpi_pm_finish(suspend_state_t pm_state) | 145 | static int acpi_pm_finish(suspend_state_t pm_state) |
| 130 | { | 146 | { |
| 131 | u32 acpi_state = acpi_suspend_states[pm_state]; | 147 | u32 acpi_state = acpi_target_sleep_state; |
| 132 | 148 | ||
| 133 | acpi_leave_sleep_state(acpi_state); | 149 | acpi_leave_sleep_state(acpi_state); |
| 134 | acpi_disable_wakeup_device(acpi_state); | 150 | acpi_disable_wakeup_device(acpi_state); |
| @@ -136,10 +152,14 @@ static int acpi_pm_finish(suspend_state_t pm_state) | |||
| 136 | /* reset firmware waking vector */ | 152 | /* reset firmware waking vector */ |
| 137 | acpi_set_firmware_waking_vector((acpi_physical_address) 0); | 153 | acpi_set_firmware_waking_vector((acpi_physical_address) 0); |
| 138 | 154 | ||
| 155 | acpi_target_sleep_state = ACPI_STATE_S0; | ||
| 156 | |||
| 157 | #ifdef CONFIG_X86 | ||
| 139 | if (init_8259A_after_S1) { | 158 | if (init_8259A_after_S1) { |
| 140 | printk("Broken toshiba laptop -> kicking interrupts\n"); | 159 | printk("Broken toshiba laptop -> kicking interrupts\n"); |
| 141 | init_8259A(0); | 160 | init_8259A(0); |
| 142 | } | 161 | } |
| 162 | #endif | ||
| 143 | return 0; | 163 | return 0; |
| 144 | } | 164 | } |
| 145 | 165 | ||
| @@ -176,6 +196,7 @@ static int acpi_pm_state_valid(suspend_state_t pm_state) | |||
| 176 | 196 | ||
| 177 | static struct pm_ops acpi_pm_ops = { | 197 | static struct pm_ops acpi_pm_ops = { |
| 178 | .valid = acpi_pm_state_valid, | 198 | .valid = acpi_pm_state_valid, |
| 199 | .set_target = acpi_pm_set_target, | ||
| 179 | .prepare = acpi_pm_prepare, | 200 | .prepare = acpi_pm_prepare, |
| 180 | .enter = acpi_pm_enter, | 201 | .enter = acpi_pm_enter, |
| 181 | .finish = acpi_pm_finish, | 202 | .finish = acpi_pm_finish, |
| @@ -235,6 +256,81 @@ static struct hibernation_ops acpi_hibernation_ops = { | |||
| 235 | }; | 256 | }; |
| 236 | #endif /* CONFIG_SOFTWARE_SUSPEND */ | 257 | #endif /* CONFIG_SOFTWARE_SUSPEND */ |
| 237 | 258 | ||
| 259 | /** | ||
| 260 | * acpi_pm_device_sleep_state - return preferred power state of ACPI device | ||
| 261 | * in the system sleep state given by %acpi_target_sleep_state | ||
| 262 | * @dev: device to examine | ||
| 263 | * @wake: if set, the device should be able to wake up the system | ||
| 264 | * @d_min_p: used to store the upper limit of allowed states range | ||
| 265 | * Return value: preferred power state of the device on success, -ENODEV on | ||
| 266 | * failure (ie. if there's no 'struct acpi_device' for @dev) | ||
| 267 | * | ||
| 268 | * Find the lowest power (highest number) ACPI device power state that | ||
| 269 | * device @dev can be in while the system is in the sleep state represented | ||
| 270 | * by %acpi_target_sleep_state. If @wake is nonzero, the device should be | ||
| 271 | * able to wake up the system from this sleep state. If @d_min_p is set, | ||
| 272 | * the highest power (lowest number) device power state of @dev allowed | ||
| 273 | * in this system sleep state is stored at the location pointed to by it. | ||
| 274 | * | ||
| 275 | * The caller must ensure that @dev is valid before using this function. | ||
| 276 | * The caller is also responsible for figuring out if the device is | ||
| 277 | * supposed to be able to wake up the system and passing this information | ||
| 278 | * via @wake. | ||
| 279 | */ | ||
| 280 | |||
| 281 | int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) | ||
| 282 | { | ||
| 283 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); | ||
| 284 | struct acpi_device *adev; | ||
| 285 | char acpi_method[] = "_SxD"; | ||
| 286 | unsigned long d_min, d_max; | ||
| 287 | |||
| 288 | if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { | ||
| 289 | printk(KERN_ERR "ACPI handle has no context!\n"); | ||
| 290 | return -ENODEV; | ||
| 291 | } | ||
| 292 | |||
| 293 | acpi_method[2] = '0' + acpi_target_sleep_state; | ||
| 294 | /* | ||
| 295 | * If the sleep state is S0, we will return D3, but if the device has | ||
| 296 | * _S0W, we will use the value from _S0W | ||
| 297 | */ | ||
| 298 | d_min = ACPI_STATE_D0; | ||
| 299 | d_max = ACPI_STATE_D3; | ||
| 300 | |||
| 301 | /* | ||
| 302 | * If present, _SxD methods return the minimum D-state (highest power | ||
| 303 | * state) we can use for the corresponding S-states. Otherwise, the | ||
| 304 | * minimum D-state is D0 (ACPI 3.x). | ||
| 305 | * | ||
| 306 | * NOTE: We rely on acpi_evaluate_integer() not clobbering the integer | ||
| 307 | * provided -- that's our fault recovery, we ignore retval. | ||
| 308 | */ | ||
| 309 | if (acpi_target_sleep_state > ACPI_STATE_S0) | ||
| 310 | acpi_evaluate_integer(handle, acpi_method, NULL, &d_min); | ||
| 311 | |||
| 312 | /* | ||
| 313 | * If _PRW says we can wake up the system from the target sleep state, | ||
| 314 | * the D-state returned by _SxD is sufficient for that (we assume a | ||
| 315 | * wakeup-aware driver if wake is set). Still, if _SxW exists | ||
| 316 | * (ACPI 3.x), it should return the maximum (lowest power) D-state that | ||
| 317 | * can wake the system. _S0W may be valid, too. | ||
| 318 | */ | ||
| 319 | if (acpi_target_sleep_state == ACPI_STATE_S0 || | ||
| 320 | (wake && adev->wakeup.state.enabled && | ||
| 321 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { | ||
| 322 | acpi_method[3] = 'W'; | ||
| 323 | acpi_evaluate_integer(handle, acpi_method, NULL, &d_max); | ||
| 324 | /* Sanity check */ | ||
| 325 | if (d_max < d_min) | ||
| 326 | d_min = d_max; | ||
| 327 | } | ||
| 328 | |||
| 329 | if (d_min_p) | ||
| 330 | *d_min_p = d_min; | ||
| 331 | return d_max; | ||
| 332 | } | ||
| 333 | |||
| 238 | /* | 334 | /* |
| 239 | * Toshiba fails to preserve interrupts over S1, reinitialization | 335 | * Toshiba fails to preserve interrupts over S1, reinitialization |
| 240 | * of 8259 is needed after S1 resume. | 336 | * of 8259 is needed after S1 resume. |
diff --git a/drivers/acpi/sleep/poweroff.c b/drivers/acpi/sleep/poweroff.c index 39e40d56b034..b3f68ef0669e 100644 --- a/drivers/acpi/sleep/poweroff.c +++ b/drivers/acpi/sleep/poweroff.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | int acpi_sleep_prepare(u32 acpi_state) | 19 | int acpi_sleep_prepare(u32 acpi_state) |
| 20 | { | 20 | { |
| 21 | #ifdef CONFIG_ACPI_SLEEP | ||
| 22 | /* do we have a wakeup address for S2 and S3? */ | 21 | /* do we have a wakeup address for S2 and S3? */ |
| 23 | if (acpi_state == ACPI_STATE_S3) { | 22 | if (acpi_state == ACPI_STATE_S3) { |
| 24 | if (!acpi_wakeup_address) { | 23 | if (!acpi_wakeup_address) { |
| @@ -31,7 +30,6 @@ int acpi_sleep_prepare(u32 acpi_state) | |||
| 31 | } | 30 | } |
| 32 | ACPI_FLUSH_CPU_CACHE(); | 31 | ACPI_FLUSH_CPU_CACHE(); |
| 33 | acpi_enable_wakeup_device_prep(acpi_state); | 32 | acpi_enable_wakeup_device_prep(acpi_state); |
| 34 | #endif | ||
| 35 | acpi_gpe_sleep_prepare(acpi_state); | 33 | acpi_gpe_sleep_prepare(acpi_state); |
| 36 | acpi_enter_sleep_state_prep(acpi_state); | 34 | acpi_enter_sleep_state_prep(acpi_state); |
| 37 | return 0; | 35 | return 0; |
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 61f1822cc350..ed58e1168aed 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c | |||
| @@ -14,8 +14,16 @@ | |||
| 14 | #include "sleep.h" | 14 | #include "sleep.h" |
| 15 | 15 | ||
| 16 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | 16 | #define _COMPONENT ACPI_SYSTEM_COMPONENT |
| 17 | |||
| 18 | /* | ||
| 19 | * this file provides support for: | ||
| 20 | * /proc/acpi/sleep | ||
| 21 | * /proc/acpi/alarm | ||
| 22 | * /proc/acpi/wakeup | ||
| 23 | */ | ||
| 24 | |||
| 17 | ACPI_MODULE_NAME("sleep") | 25 | ACPI_MODULE_NAME("sleep") |
| 18 | #ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP | 26 | #ifdef CONFIG_ACPI_PROCFS |
| 19 | static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) | 27 | static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) |
| 20 | { | 28 | { |
| 21 | int i; | 29 | int i; |
| @@ -68,7 +76,7 @@ acpi_system_write_sleep(struct file *file, | |||
| 68 | Done: | 76 | Done: |
| 69 | return error ? error : count; | 77 | return error ? error : count; |
| 70 | } | 78 | } |
| 71 | #endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ | 79 | #endif /* CONFIG_ACPI_PROCFS */ |
| 72 | 80 | ||
| 73 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) | 81 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) |
| 74 | /* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */ | 82 | /* 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 = { | |||
| 463 | .release = single_release, | 471 | .release = single_release, |
| 464 | }; | 472 | }; |
| 465 | 473 | ||
| 466 | #ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP | 474 | #ifdef CONFIG_ACPI_PROCFS |
| 467 | static const struct file_operations acpi_system_sleep_fops = { | 475 | static const struct file_operations acpi_system_sleep_fops = { |
| 468 | .open = acpi_system_sleep_open_fs, | 476 | .open = acpi_system_sleep_open_fs, |
| 469 | .read = seq_read, | 477 | .read = seq_read, |
| @@ -471,7 +479,7 @@ static const struct file_operations acpi_system_sleep_fops = { | |||
| 471 | .llseek = seq_lseek, | 479 | .llseek = seq_lseek, |
| 472 | .release = single_release, | 480 | .release = single_release, |
| 473 | }; | 481 | }; |
| 474 | #endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ | 482 | #endif /* CONFIG_ACPI_PROCFS */ |
| 475 | 483 | ||
| 476 | #ifdef HAVE_ACPI_LEGACY_ALARM | 484 | #ifdef HAVE_ACPI_LEGACY_ALARM |
| 477 | static const struct file_operations acpi_system_alarm_fops = { | 485 | static const struct file_operations acpi_system_alarm_fops = { |
| @@ -498,14 +506,14 @@ static int __init acpi_sleep_proc_init(void) | |||
| 498 | if (acpi_disabled) | 506 | if (acpi_disabled) |
| 499 | return 0; | 507 | return 0; |
| 500 | 508 | ||
| 501 | #ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP | 509 | #ifdef CONFIG_ACPI_PROCFS |
| 502 | /* 'sleep' [R/W] */ | 510 | /* 'sleep' [R/W] */ |
| 503 | entry = | 511 | entry = |
| 504 | create_proc_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR, | 512 | create_proc_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR, |
| 505 | acpi_root_dir); | 513 | acpi_root_dir); |
| 506 | if (entry) | 514 | if (entry) |
| 507 | entry->proc_fops = &acpi_system_sleep_fops; | 515 | entry->proc_fops = &acpi_system_sleep_fops; |
| 508 | #endif | 516 | #endif /* CONFIG_ACPI_PROCFS */ |
| 509 | 517 | ||
| 510 | #ifdef HAVE_ACPI_LEGACY_ALARM | 518 | #ifdef HAVE_ACPI_LEGACY_ALARM |
| 511 | /* 'alarm' [R/W] */ | 519 | /* 'alarm' [R/W] */ |
diff --git a/drivers/acpi/sleep/wakeup.c b/drivers/acpi/sleep/wakeup.c index fab8f2694f03..97c27ddb144d 100644 --- a/drivers/acpi/sleep/wakeup.c +++ b/drivers/acpi/sleep/wakeup.c | |||
| @@ -17,7 +17,6 @@ ACPI_MODULE_NAME("wakeup_devices") | |||
| 17 | extern struct list_head acpi_wakeup_device_list; | 17 | extern struct list_head acpi_wakeup_device_list; |
| 18 | extern spinlock_t acpi_device_lock; | 18 | extern spinlock_t acpi_device_lock; |
| 19 | 19 | ||
| 20 | #ifdef CONFIG_ACPI_SLEEP | ||
| 21 | /** | 20 | /** |
| 22 | * acpi_enable_wakeup_device_prep - prepare wakeup devices | 21 | * acpi_enable_wakeup_device_prep - prepare wakeup devices |
| 23 | * @sleep_state: ACPI state | 22 | * @sleep_state: ACPI state |
| @@ -180,7 +179,6 @@ static int __init acpi_wakeup_device_init(void) | |||
| 180 | } | 179 | } |
| 181 | 180 | ||
| 182 | late_initcall(acpi_wakeup_device_init); | 181 | late_initcall(acpi_wakeup_device_init); |
| 183 | #endif | ||
| 184 | 182 | ||
| 185 | /* | 183 | /* |
| 186 | * Disable all wakeup GPEs before entering requested sleep state. | 184 | * Disable all wakeup GPEs before entering requested sleep state. |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 58f1338981bc..5a62de1b7f2a 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
| @@ -92,10 +92,16 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file); | |||
| 92 | static ssize_t acpi_thermal_write_polling(struct file *, const char __user *, | 92 | static ssize_t acpi_thermal_write_polling(struct file *, const char __user *, |
| 93 | size_t, loff_t *); | 93 | size_t, loff_t *); |
| 94 | 94 | ||
| 95 | static const struct acpi_device_id thermal_device_ids[] = { | ||
| 96 | {ACPI_THERMAL_HID, 0}, | ||
| 97 | {"", 0}, | ||
| 98 | }; | ||
| 99 | MODULE_DEVICE_TABLE(acpi, thermal_device_ids); | ||
| 100 | |||
| 95 | static struct acpi_driver acpi_thermal_driver = { | 101 | static struct acpi_driver acpi_thermal_driver = { |
| 96 | .name = "thermal", | 102 | .name = "thermal", |
| 97 | .class = ACPI_THERMAL_CLASS, | 103 | .class = ACPI_THERMAL_CLASS, |
| 98 | .ids = ACPI_THERMAL_HID, | 104 | .ids = thermal_device_ids, |
| 99 | .ops = { | 105 | .ops = { |
| 100 | .add = acpi_thermal_add, | 106 | .add = acpi_thermal_add, |
| 101 | .remove = acpi_thermal_remove, | 107 | .remove = acpi_thermal_remove, |
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c index f112af433e36..0042b7e78b26 100644 --- a/drivers/acpi/utilities/uteval.c +++ b/drivers/acpi/utilities/uteval.c | |||
| @@ -407,7 +407,7 @@ acpi_ut_copy_id_string(char *destination, char *source, acpi_size max_length) | |||
| 407 | 407 | ||
| 408 | acpi_status | 408 | acpi_status |
| 409 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, | 409 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, |
| 410 | struct acpi_device_id *hid) | 410 | struct acpica_device_id *hid) |
| 411 | { | 411 | { |
| 412 | union acpi_operand_object *obj_desc; | 412 | union acpi_operand_object *obj_desc; |
| 413 | acpi_status status; | 413 | acpi_status status; |
| @@ -609,7 +609,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node, | |||
| 609 | 609 | ||
| 610 | acpi_status | 610 | acpi_status |
| 611 | acpi_ut_execute_UID(struct acpi_namespace_node *device_node, | 611 | acpi_ut_execute_UID(struct acpi_namespace_node *device_node, |
| 612 | struct acpi_device_id *uid) | 612 | struct acpica_device_id *uid) |
| 613 | { | 613 | { |
| 614 | union acpi_operand_object *obj_desc; | 614 | union acpi_operand_object *obj_desc; |
| 615 | acpi_status status; | 615 | acpi_status status; |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 04ea697f72bf..d98701941981 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
| @@ -74,10 +74,16 @@ MODULE_LICENSE("GPL"); | |||
| 74 | static int acpi_video_bus_add(struct acpi_device *device); | 74 | static int acpi_video_bus_add(struct acpi_device *device); |
| 75 | static int acpi_video_bus_remove(struct acpi_device *device, int type); | 75 | static int acpi_video_bus_remove(struct acpi_device *device, int type); |
| 76 | 76 | ||
| 77 | static const struct acpi_device_id video_device_ids[] = { | ||
| 78 | {ACPI_VIDEO_HID, 0}, | ||
| 79 | {"", 0}, | ||
| 80 | }; | ||
| 81 | MODULE_DEVICE_TABLE(acpi, video_device_ids); | ||
| 82 | |||
| 77 | static struct acpi_driver acpi_video_bus = { | 83 | static struct acpi_driver acpi_video_bus = { |
| 78 | .name = "video", | 84 | .name = "video", |
| 79 | .class = ACPI_VIDEO_CLASS, | 85 | .class = ACPI_VIDEO_CLASS, |
| 80 | .ids = ACPI_VIDEO_HID, | 86 | .ids = video_device_ids, |
| 81 | .ops = { | 87 | .ops = { |
| 82 | .add = acpi_video_bus_add, | 88 | .add = acpi_video_bus_add, |
| 83 | .remove = acpi_video_bus_remove, | 89 | .remove = acpi_video_bus_remove, |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index ba0e74ad74bb..9a2694e5f8b9 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
| @@ -1007,9 +1007,15 @@ static int hpet_acpi_remove(struct acpi_device *device, int type) | |||
| 1007 | return -EINVAL; | 1007 | return -EINVAL; |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| 1010 | static const struct acpi_device_id hpet_device_ids[] = { | ||
| 1011 | {"PNP0103", 0}, | ||
| 1012 | {"", 0}, | ||
| 1013 | }; | ||
| 1014 | MODULE_DEVICE_TABLE(acpi, hpet_device_ids); | ||
| 1015 | |||
| 1010 | static struct acpi_driver hpet_acpi_driver = { | 1016 | static struct acpi_driver hpet_acpi_driver = { |
| 1011 | .name = "hpet", | 1017 | .name = "hpet", |
| 1012 | .ids = "PNP0103", | 1018 | .ids = hpet_device_ids, |
| 1013 | .ops = { | 1019 | .ops = { |
| 1014 | .add = hpet_acpi_add, | 1020 | .add = hpet_acpi_add, |
| 1015 | .remove = hpet_acpi_remove, | 1021 | .remove = hpet_acpi_remove, |
diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c index 0acc3a123604..e43e92fd9e23 100644 --- a/drivers/input/misc/atlas_btns.c +++ b/drivers/input/misc/atlas_btns.c | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | 31 | ||
| 32 | #define ACPI_ATLAS_NAME "Atlas ACPI" | 32 | #define ACPI_ATLAS_NAME "Atlas ACPI" |
| 33 | #define ACPI_ATLAS_CLASS "Atlas" | 33 | #define ACPI_ATLAS_CLASS "Atlas" |
| 34 | #define ACPI_ATLAS_BUTTON_HID "ASIM0000" | ||
| 35 | 34 | ||
| 36 | static struct input_dev *input_dev; | 35 | static struct input_dev *input_dev; |
| 37 | 36 | ||
| @@ -130,10 +129,16 @@ static int atlas_acpi_button_remove(struct acpi_device *device, int type) | |||
| 130 | return status; | 129 | return status; |
| 131 | } | 130 | } |
| 132 | 131 | ||
| 132 | static const struct acpi_device_id atlas_device_ids[] = { | ||
| 133 | {"ASIM0000", 0}, | ||
| 134 | {"", 0}, | ||
| 135 | }; | ||
| 136 | MODULE_DEVICE_TABLE(acpi, atlas_device_ids); | ||
| 137 | |||
| 133 | static struct acpi_driver atlas_acpi_driver = { | 138 | static struct acpi_driver atlas_acpi_driver = { |
| 134 | .name = ACPI_ATLAS_NAME, | 139 | .name = ACPI_ATLAS_NAME, |
| 135 | .class = ACPI_ATLAS_CLASS, | 140 | .class = ACPI_ATLAS_CLASS, |
| 136 | .ids = ACPI_ATLAS_BUTTON_HID, | 141 | .ids = atlas_device_ids, |
| 137 | .ops = { | 142 | .ops = { |
| 138 | .add = atlas_acpi_button_add, | 143 | .add = atlas_acpi_button_add, |
| 139 | .remove = atlas_acpi_button_remove, | 144 | .remove = atlas_acpi_button_remove, |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index bcbe6835beb4..96856097d15b 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
| @@ -297,9 +297,6 @@ static struct kvm *kvm_create_vm(void) | |||
| 297 | kvm_io_bus_init(&kvm->pio_bus); | 297 | kvm_io_bus_init(&kvm->pio_bus); |
| 298 | spin_lock_init(&kvm->lock); | 298 | spin_lock_init(&kvm->lock); |
| 299 | INIT_LIST_HEAD(&kvm->active_mmu_pages); | 299 | INIT_LIST_HEAD(&kvm->active_mmu_pages); |
| 300 | spin_lock(&kvm_lock); | ||
| 301 | list_add(&kvm->vm_list, &vm_list); | ||
| 302 | spin_unlock(&kvm_lock); | ||
| 303 | kvm_io_bus_init(&kvm->mmio_bus); | 300 | kvm_io_bus_init(&kvm->mmio_bus); |
| 304 | for (i = 0; i < KVM_MAX_VCPUS; ++i) { | 301 | for (i = 0; i < KVM_MAX_VCPUS; ++i) { |
| 305 | struct kvm_vcpu *vcpu = &kvm->vcpus[i]; | 302 | struct kvm_vcpu *vcpu = &kvm->vcpus[i]; |
| @@ -309,6 +306,9 @@ static struct kvm *kvm_create_vm(void) | |||
| 309 | vcpu->kvm = kvm; | 306 | vcpu->kvm = kvm; |
| 310 | vcpu->mmu.root_hpa = INVALID_PAGE; | 307 | vcpu->mmu.root_hpa = INVALID_PAGE; |
| 311 | } | 308 | } |
| 309 | spin_lock(&kvm_lock); | ||
| 310 | list_add(&kvm->vm_list, &vm_list); | ||
| 311 | spin_unlock(&kvm_lock); | ||
| 312 | return kvm; | 312 | return kvm; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| @@ -1070,18 +1070,16 @@ static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa, | |||
| 1070 | return 0; | 1070 | return 0; |
| 1071 | mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT); | 1071 | mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT); |
| 1072 | virt = kmap_atomic(page, KM_USER0); | 1072 | virt = kmap_atomic(page, KM_USER0); |
| 1073 | if (memcmp(virt + offset_in_page(gpa), val, bytes)) { | 1073 | kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); |
| 1074 | kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); | 1074 | memcpy(virt + offset_in_page(gpa), val, bytes); |
| 1075 | memcpy(virt + offset_in_page(gpa), val, bytes); | ||
| 1076 | } | ||
| 1077 | kunmap_atomic(virt, KM_USER0); | 1075 | kunmap_atomic(virt, KM_USER0); |
| 1078 | return 1; | 1076 | return 1; |
| 1079 | } | 1077 | } |
| 1080 | 1078 | ||
| 1081 | static int emulator_write_emulated(unsigned long addr, | 1079 | static int emulator_write_emulated_onepage(unsigned long addr, |
| 1082 | const void *val, | 1080 | const void *val, |
| 1083 | unsigned int bytes, | 1081 | unsigned int bytes, |
| 1084 | struct x86_emulate_ctxt *ctxt) | 1082 | struct x86_emulate_ctxt *ctxt) |
| 1085 | { | 1083 | { |
| 1086 | struct kvm_vcpu *vcpu = ctxt->vcpu; | 1084 | struct kvm_vcpu *vcpu = ctxt->vcpu; |
| 1087 | struct kvm_io_device *mmio_dev; | 1085 | struct kvm_io_device *mmio_dev; |
| @@ -1113,6 +1111,26 @@ static int emulator_write_emulated(unsigned long addr, | |||
| 1113 | return X86EMUL_CONTINUE; | 1111 | return X86EMUL_CONTINUE; |
| 1114 | } | 1112 | } |
| 1115 | 1113 | ||
| 1114 | static int emulator_write_emulated(unsigned long addr, | ||
| 1115 | const void *val, | ||
| 1116 | unsigned int bytes, | ||
| 1117 | struct x86_emulate_ctxt *ctxt) | ||
| 1118 | { | ||
| 1119 | /* Crossing a page boundary? */ | ||
| 1120 | if (((addr + bytes - 1) ^ addr) & PAGE_MASK) { | ||
| 1121 | int rc, now; | ||
| 1122 | |||
| 1123 | now = -addr & ~PAGE_MASK; | ||
| 1124 | rc = emulator_write_emulated_onepage(addr, val, now, ctxt); | ||
| 1125 | if (rc != X86EMUL_CONTINUE) | ||
| 1126 | return rc; | ||
| 1127 | addr += now; | ||
| 1128 | val += now; | ||
| 1129 | bytes -= now; | ||
| 1130 | } | ||
| 1131 | return emulator_write_emulated_onepage(addr, val, bytes, ctxt); | ||
| 1132 | } | ||
| 1133 | |||
| 1116 | static int emulator_cmpxchg_emulated(unsigned long addr, | 1134 | static int emulator_cmpxchg_emulated(unsigned long addr, |
| 1117 | const void *old, | 1135 | const void *old, |
| 1118 | const void *new, | 1136 | const void *new, |
| @@ -2414,9 +2432,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu) | |||
| 2414 | break; | 2432 | break; |
| 2415 | } | 2433 | } |
| 2416 | } | 2434 | } |
| 2417 | if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) { | 2435 | if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) { |
| 2418 | entry->edx &= ~(1 << 20); | 2436 | entry->edx &= ~(1 << 20); |
| 2419 | printk(KERN_INFO ": guest NX capability removed\n"); | 2437 | printk(KERN_INFO "kvm: guest NX capability removed\n"); |
| 2420 | } | 2438 | } |
| 2421 | } | 2439 | } |
| 2422 | 2440 | ||
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index 1b800fc00342..1f979cb0df31 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c | |||
| @@ -1178,6 +1178,8 @@ pop_instruction: | |||
| 1178 | twobyte_insn: | 1178 | twobyte_insn: |
| 1179 | switch (b) { | 1179 | switch (b) { |
| 1180 | case 0x01: /* lgdt, lidt, lmsw */ | 1180 | case 0x01: /* lgdt, lidt, lmsw */ |
| 1181 | /* Disable writeback. */ | ||
| 1182 | no_wb = 1; | ||
| 1181 | switch (modrm_reg) { | 1183 | switch (modrm_reg) { |
| 1182 | u16 size; | 1184 | u16 size; |
| 1183 | unsigned long address; | 1185 | unsigned long address; |
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index 6b89854bd3ff..d0fc4fd212e6 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c | |||
| @@ -53,7 +53,6 @@ | |||
| 53 | #define ASUS_HOTK_NAME "Asus Laptop Support" | 53 | #define ASUS_HOTK_NAME "Asus Laptop Support" |
| 54 | #define ASUS_HOTK_CLASS "hotkey" | 54 | #define ASUS_HOTK_CLASS "hotkey" |
| 55 | #define ASUS_HOTK_DEVICE_NAME "Hotkey" | 55 | #define ASUS_HOTK_DEVICE_NAME "Hotkey" |
| 56 | #define ASUS_HOTK_HID "ATK0100" | ||
| 57 | #define ASUS_HOTK_FILE "asus-laptop" | 56 | #define ASUS_HOTK_FILE "asus-laptop" |
| 58 | #define ASUS_HOTK_PREFIX "\\_SB.ATKD." | 57 | #define ASUS_HOTK_PREFIX "\\_SB.ATKD." |
| 59 | 58 | ||
| @@ -197,12 +196,18 @@ static struct asus_hotk *hotk; | |||
| 197 | /* | 196 | /* |
| 198 | * The hotkey driver declaration | 197 | * The hotkey driver declaration |
| 199 | */ | 198 | */ |
| 199 | static const struct acpi_device_id asus_device_ids[] = { | ||
| 200 | {"ATK0100", 0}, | ||
| 201 | {"", 0}, | ||
| 202 | }; | ||
| 203 | MODULE_DEVICE_TABLE(acpi, asus_device_ids); | ||
| 204 | |||
| 200 | static int asus_hotk_add(struct acpi_device *device); | 205 | static int asus_hotk_add(struct acpi_device *device); |
| 201 | static int asus_hotk_remove(struct acpi_device *device, int type); | 206 | static int asus_hotk_remove(struct acpi_device *device, int type); |
| 202 | static struct acpi_driver asus_hotk_driver = { | 207 | static struct acpi_driver asus_hotk_driver = { |
| 203 | .name = ASUS_HOTK_NAME, | 208 | .name = ASUS_HOTK_NAME, |
| 204 | .class = ASUS_HOTK_CLASS, | 209 | .class = ASUS_HOTK_CLASS, |
| 205 | .ids = ASUS_HOTK_HID, | 210 | .ids = asus_device_ids, |
| 206 | .ops = { | 211 | .ops = { |
| 207 | .add = asus_hotk_add, | 212 | .add = asus_hotk_add, |
| 208 | .remove = asus_hotk_remove, | 213 | .remove = asus_hotk_remove, |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 303e48ca0e8a..14ee06c8f127 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
| @@ -1124,10 +1124,22 @@ static int sony_nc_remove(struct acpi_device *device, int type) | |||
| 1124 | return 0; | 1124 | return 0; |
| 1125 | } | 1125 | } |
| 1126 | 1126 | ||
| 1127 | static const struct acpi_device_id sony_device_ids[] = { | ||
| 1128 | {SONY_NC_HID, 0}, | ||
| 1129 | {SONY_PIC_HID, 0}, | ||
| 1130 | {"", 0}, | ||
| 1131 | }; | ||
| 1132 | MODULE_DEVICE_TABLE(acpi, sony_device_ids); | ||
| 1133 | |||
| 1134 | static const struct acpi_device_id sony_nc_device_ids[] = { | ||
| 1135 | {SONY_NC_HID, 0}, | ||
| 1136 | {"", 0}, | ||
| 1137 | }; | ||
| 1138 | |||
| 1127 | static struct acpi_driver sony_nc_driver = { | 1139 | static struct acpi_driver sony_nc_driver = { |
| 1128 | .name = SONY_NC_DRIVER_NAME, | 1140 | .name = SONY_NC_DRIVER_NAME, |
| 1129 | .class = SONY_NC_CLASS, | 1141 | .class = SONY_NC_CLASS, |
| 1130 | .ids = SONY_NC_HID, | 1142 | .ids = sony_nc_device_ids, |
| 1131 | .owner = THIS_MODULE, | 1143 | .owner = THIS_MODULE, |
| 1132 | .ops = { | 1144 | .ops = { |
| 1133 | .add = sony_nc_add, | 1145 | .add = sony_nc_add, |
| @@ -2470,10 +2482,15 @@ static int sony_pic_resume(struct acpi_device *device) | |||
| 2470 | return 0; | 2482 | return 0; |
| 2471 | } | 2483 | } |
| 2472 | 2484 | ||
| 2485 | static const struct acpi_device_id sony_pic_device_ids[] = { | ||
| 2486 | {SONY_PIC_HID, 0}, | ||
| 2487 | {"", 0}, | ||
| 2488 | }; | ||
| 2489 | |||
| 2473 | static struct acpi_driver sony_pic_driver = { | 2490 | static struct acpi_driver sony_pic_driver = { |
| 2474 | .name = SONY_PIC_DRIVER_NAME, | 2491 | .name = SONY_PIC_DRIVER_NAME, |
| 2475 | .class = SONY_PIC_CLASS, | 2492 | .class = SONY_PIC_CLASS, |
| 2476 | .ids = SONY_PIC_HID, | 2493 | .ids = sony_pic_device_ids, |
| 2477 | .owner = THIS_MODULE, | 2494 | .owner = THIS_MODULE, |
| 2478 | .ops = { | 2495 | .ops = { |
| 2479 | .add = sony_pic_add, | 2496 | .add = sony_pic_add, |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index f15a58f7403f..fa80f355e522 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
| @@ -411,12 +411,13 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) | |||
| 411 | 411 | ||
| 412 | sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name); | 412 | sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name); |
| 413 | ibm->acpi->driver->ids = ibm->acpi->hid; | 413 | ibm->acpi->driver->ids = ibm->acpi->hid; |
| 414 | |||
| 414 | ibm->acpi->driver->ops.add = &tpacpi_device_add; | 415 | ibm->acpi->driver->ops.add = &tpacpi_device_add; |
| 415 | 416 | ||
| 416 | rc = acpi_bus_register_driver(ibm->acpi->driver); | 417 | rc = acpi_bus_register_driver(ibm->acpi->driver); |
| 417 | if (rc < 0) { | 418 | if (rc < 0) { |
| 418 | printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n", | 419 | printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n", |
| 419 | ibm->acpi->hid, rc); | 420 | ibm->name, rc); |
| 420 | kfree(ibm->acpi->driver); | 421 | kfree(ibm->acpi->driver); |
| 421 | ibm->acpi->driver = NULL; | 422 | ibm->acpi->driver = NULL; |
| 422 | } else if (!rc) | 423 | } else if (!rc) |
| @@ -1316,8 +1317,13 @@ errexit: | |||
| 1316 | return res; | 1317 | return res; |
| 1317 | } | 1318 | } |
| 1318 | 1319 | ||
| 1320 | static const struct acpi_device_id ibm_htk_device_ids[] = { | ||
| 1321 | {IBM_HKEY_HID, 0}, | ||
| 1322 | {"", 0}, | ||
| 1323 | }; | ||
| 1324 | |||
| 1319 | static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = { | 1325 | static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = { |
| 1320 | .hid = IBM_HKEY_HID, | 1326 | .hid = ibm_htk_device_ids, |
| 1321 | .notify = hotkey_notify, | 1327 | .notify = hotkey_notify, |
| 1322 | .handle = &hkey_handle, | 1328 | .handle = &hkey_handle, |
| 1323 | .type = ACPI_DEVICE_NOTIFY, | 1329 | .type = ACPI_DEVICE_NOTIFY, |
| @@ -2080,6 +2086,11 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ | |||
| 2080 | /* don't list other alternatives as we install a notify handler on the 570 */ | 2086 | /* don't list other alternatives as we install a notify handler on the 570 */ |
| 2081 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ | 2087 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ |
| 2082 | 2088 | ||
| 2089 | static const struct acpi_device_id ibm_pci_device_ids[] = { | ||
| 2090 | {PCI_ROOT_HID_STRING, 0}, | ||
| 2091 | {"", 0}, | ||
| 2092 | }; | ||
| 2093 | |||
| 2083 | static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { | 2094 | static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { |
| 2084 | { | 2095 | { |
| 2085 | .notify = dock_notify, | 2096 | .notify = dock_notify, |
| @@ -2090,7 +2101,7 @@ static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { | |||
| 2090 | /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING. | 2101 | /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING. |
| 2091 | * We just use it to get notifications of dock hotplug | 2102 | * We just use it to get notifications of dock hotplug |
| 2092 | * in very old thinkpads */ | 2103 | * in very old thinkpads */ |
| 2093 | .hid = PCI_ROOT_HID_STRING, | 2104 | .hid = ibm_pci_device_ids, |
| 2094 | .notify = dock_notify, | 2105 | .notify = dock_notify, |
| 2095 | .handle = &pci_handle, | 2106 | .handle = &pci_handle, |
| 2096 | .type = ACPI_SYSTEM_NOTIFY, | 2107 | .type = ACPI_SYSTEM_NOTIFY, |
| @@ -2149,7 +2160,8 @@ static int __init dock_init2(struct ibm_init_struct *iibm) | |||
| 2149 | static void dock_notify(struct ibm_struct *ibm, u32 event) | 2160 | static void dock_notify(struct ibm_struct *ibm, u32 event) |
| 2150 | { | 2161 | { |
| 2151 | int docked = dock_docked(); | 2162 | int docked = dock_docked(); |
| 2152 | int pci = ibm->acpi->hid && strstr(ibm->acpi->hid, PCI_ROOT_HID_STRING); | 2163 | int pci = ibm->acpi->hid && ibm->acpi->device && |
| 2164 | acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids); | ||
| 2153 | 2165 | ||
| 2154 | if (event == 1 && !pci) /* 570 */ | 2166 | if (event == 1 && !pci) /* 570 */ |
| 2155 | acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ | 2167 | acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ |
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index b7a4a888cc8b..88af089d6494 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
| @@ -193,7 +193,7 @@ static void thinkpad_acpi_module_exit(void); | |||
| 193 | struct ibm_struct; | 193 | struct ibm_struct; |
| 194 | 194 | ||
| 195 | struct tp_acpi_drv_struct { | 195 | struct tp_acpi_drv_struct { |
| 196 | char *hid; | 196 | const struct acpi_device_id *hid; |
| 197 | struct acpi_driver *driver; | 197 | struct acpi_driver *driver; |
| 198 | 198 | ||
| 199 | void (*notify) (struct ibm_struct *, u32); | 199 | void (*notify) (struct ibm_struct *, u32); |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index c8062494009f..67c63d1f1582 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
| @@ -245,16 +245,33 @@ EXPORT_SYMBOL(pci_osc_control_set); | |||
| 245 | * currently we simply return _SxD, if present. | 245 | * currently we simply return _SxD, if present. |
| 246 | */ | 246 | */ |
| 247 | 247 | ||
| 248 | static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state) | 248 | static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, |
| 249 | pm_message_t state) | ||
| 249 | { | 250 | { |
| 250 | /* TBD */ | 251 | int acpi_state; |
| 251 | 252 | ||
| 252 | return -ENODEV; | 253 | acpi_state = acpi_pm_device_sleep_state(&pdev->dev, |
| 254 | device_may_wakeup(&pdev->dev), NULL); | ||
| 255 | if (acpi_state < 0) | ||
| 256 | return PCI_POWER_ERROR; | ||
| 257 | |||
| 258 | switch (acpi_state) { | ||
| 259 | case ACPI_STATE_D0: | ||
| 260 | return PCI_D0; | ||
| 261 | case ACPI_STATE_D1: | ||
| 262 | return PCI_D1; | ||
| 263 | case ACPI_STATE_D2: | ||
| 264 | return PCI_D2; | ||
| 265 | case ACPI_STATE_D3: | ||
| 266 | return PCI_D3hot; | ||
| 267 | } | ||
| 268 | return PCI_POWER_ERROR; | ||
| 253 | } | 269 | } |
| 254 | 270 | ||
| 255 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 271 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
| 256 | { | 272 | { |
| 257 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); | 273 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); |
| 274 | acpi_handle tmp; | ||
| 258 | static int state_conv[] = { | 275 | static int state_conv[] = { |
| 259 | [0] = 0, | 276 | [0] = 0, |
| 260 | [1] = 1, | 277 | [1] = 1, |
| @@ -266,6 +283,9 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
| 266 | 283 | ||
| 267 | if (!handle) | 284 | if (!handle) |
| 268 | return -ENODEV; | 285 | return -ENODEV; |
| 286 | /* If the ACPI device has _EJ0, ignore the device */ | ||
| 287 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp))) | ||
| 288 | return 0; | ||
| 269 | return acpi_bus_set_power(handle, acpi_state); | 289 | return acpi_bus_set_power(handle, acpi_state); |
| 270 | } | 290 | } |
| 271 | 291 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c95485398687..fba319d6fcc8 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -499,7 +499,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
| 499 | return 0; | 499 | return 0; |
| 500 | } | 500 | } |
| 501 | 501 | ||
| 502 | int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); | 502 | pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); |
| 503 | 503 | ||
| 504 | /** | 504 | /** |
| 505 | * pci_choose_state - Choose the power state of a PCI device | 505 | * 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); | |||
| 513 | 513 | ||
| 514 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) | 514 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) |
| 515 | { | 515 | { |
| 516 | int ret; | 516 | pci_power_t ret; |
| 517 | 517 | ||
| 518 | if (!pci_find_capability(dev, PCI_CAP_ID_PM)) | 518 | if (!pci_find_capability(dev, PCI_CAP_ID_PM)) |
| 519 | return PCI_D0; | 519 | return PCI_D0; |
| 520 | 520 | ||
| 521 | if (platform_pci_choose_state) { | 521 | if (platform_pci_choose_state) { |
| 522 | ret = platform_pci_choose_state(dev, state); | 522 | ret = platform_pci_choose_state(dev, state); |
| 523 | if (ret >= 0) | 523 | if (ret != PCI_POWER_ERROR) |
| 524 | state.event = ret; | 524 | return ret; |
| 525 | } | 525 | } |
| 526 | 526 | ||
| 527 | switch (state.event) { | 527 | switch (state.event) { |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7b696cd66dc5..c6e132d7c0f7 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -12,7 +12,7 @@ extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
| 12 | resource_size_t, resource_size_t), | 12 | resource_size_t, resource_size_t), |
| 13 | void *alignf_data); | 13 | void *alignf_data); |
| 14 | /* Firmware callbacks */ | 14 | /* Firmware callbacks */ |
| 15 | extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); | 15 | extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); |
| 16 | extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state); | 16 | extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state); |
| 17 | 17 | ||
| 18 | extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); | 18 | extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); |
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index e161423b4300..1432806451cd 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
| @@ -167,6 +167,8 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state) | |||
| 167 | return error; | 167 | return error; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | if (pnp_dev->protocol && pnp_dev->protocol->suspend) | ||
| 171 | pnp_dev->protocol->suspend(pnp_dev, state); | ||
| 170 | return 0; | 172 | return 0; |
| 171 | } | 173 | } |
| 172 | 174 | ||
| @@ -179,6 +181,9 @@ static int pnp_bus_resume(struct device *dev) | |||
| 179 | if (!pnp_drv) | 181 | if (!pnp_drv) |
| 180 | return 0; | 182 | return 0; |
| 181 | 183 | ||
| 184 | if (pnp_dev->protocol && pnp_dev->protocol->resume) | ||
| 185 | pnp_dev->protocol->resume(pnp_dev); | ||
| 186 | |||
| 182 | if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) { | 187 | if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) { |
| 183 | error = pnp_start_dev(pnp_dev); | 188 | error = pnp_start_dev(pnp_dev); |
| 184 | if (error) | 189 | if (error) |
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index a00548799e98..fcd32ac575c3 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
| @@ -21,7 +21,10 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/acpi.h> | 22 | #include <linux/acpi.h> |
| 23 | #include <linux/pnp.h> | 23 | #include <linux/pnp.h> |
| 24 | #include <linux/mod_devicetable.h> | ||
| 24 | #include <acpi/acpi_bus.h> | 25 | #include <acpi/acpi_bus.h> |
| 26 | #include <acpi/actypes.h> | ||
| 27 | |||
| 25 | #include "pnpacpi.h" | 28 | #include "pnpacpi.h" |
| 26 | 29 | ||
| 27 | static int num = 0; | 30 | static int num = 0; |
| @@ -33,15 +36,17 @@ static int num = 0; | |||
| 33 | * have irqs (PIC, Timer) because we call acpi_register_gsi. | 36 | * have irqs (PIC, Timer) because we call acpi_register_gsi. |
| 34 | * Finaly only devices that have a CRS method need to be in this list. | 37 | * Finaly only devices that have a CRS method need to be in this list. |
| 35 | */ | 38 | */ |
| 36 | static char __initdata excluded_id_list[] = | 39 | static __initdata struct acpi_device_id excluded_id_list[] ={ |
| 37 | "PNP0C09," /* EC */ | 40 | {"PNP0C09", 0}, /* EC */ |
| 38 | "PNP0C0F," /* Link device */ | 41 | {"PNP0C0F", 0}, /* Link device */ |
| 39 | "PNP0000," /* PIC */ | 42 | {"PNP0000", 0}, /* PIC */ |
| 40 | "PNP0100," /* Timer */ | 43 | {"PNP0100", 0}, /* Timer */ |
| 41 | ; | 44 | {"", 0}, |
| 45 | }; | ||
| 46 | |||
| 42 | static inline int is_exclusive_device(struct acpi_device *dev) | 47 | static inline int is_exclusive_device(struct acpi_device *dev) |
| 43 | { | 48 | { |
| 44 | return (!acpi_match_ids(dev, excluded_id_list)); | 49 | return (!acpi_match_device_ids(dev, excluded_id_list)); |
| 45 | } | 50 | } |
| 46 | 51 | ||
| 47 | /* | 52 | /* |
| @@ -119,11 +124,25 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) | |||
| 119 | return ACPI_FAILURE(status) ? -ENODEV : 0; | 124 | return ACPI_FAILURE(status) ? -ENODEV : 0; |
| 120 | } | 125 | } |
| 121 | 126 | ||
| 127 | static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) | ||
| 128 | { | ||
| 129 | return acpi_bus_set_power((acpi_handle)dev->data, | ||
| 130 | acpi_pm_device_sleep_state(&dev->dev, | ||
| 131 | device_may_wakeup(&dev->dev), NULL)); | ||
| 132 | } | ||
| 133 | |||
| 134 | static int pnpacpi_resume(struct pnp_dev *dev) | ||
| 135 | { | ||
| 136 | return acpi_bus_set_power((acpi_handle)dev->data, ACPI_STATE_D0); | ||
| 137 | } | ||
| 138 | |||
| 122 | static struct pnp_protocol pnpacpi_protocol = { | 139 | static struct pnp_protocol pnpacpi_protocol = { |
| 123 | .name = "Plug and Play ACPI", | 140 | .name = "Plug and Play ACPI", |
| 124 | .get = pnpacpi_get_resources, | 141 | .get = pnpacpi_get_resources, |
| 125 | .set = pnpacpi_set_resources, | 142 | .set = pnpacpi_set_resources, |
| 126 | .disable = pnpacpi_disable_resources, | 143 | .disable = pnpacpi_disable_resources, |
| 144 | .suspend = pnpacpi_suspend, | ||
| 145 | .resume = pnpacpi_resume, | ||
| 127 | }; | 146 | }; |
| 128 | 147 | ||
| 129 | static int __init pnpacpi_add_device(struct acpi_device *device) | 148 | static int __init pnpacpi_add_device(struct acpi_device *device) |
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 8b3cd31d6a61..10ab3b71ffc6 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
| @@ -46,6 +46,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
| 46 | { | 46 | { |
| 47 | struct rtc_device *rtc = to_rtc_device(dev); | 47 | struct rtc_device *rtc = to_rtc_device(dev); |
| 48 | struct rtc_time tm; | 48 | struct rtc_time tm; |
| 49 | struct timespec ts = current_kernel_time(); | ||
| 49 | 50 | ||
| 50 | if (strncmp(rtc->dev.bus_id, | 51 | if (strncmp(rtc->dev.bus_id, |
| 51 | CONFIG_RTC_HCTOSYS_DEVICE, | 52 | CONFIG_RTC_HCTOSYS_DEVICE, |
| @@ -57,8 +58,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
| 57 | 58 | ||
| 58 | /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ | 59 | /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ |
| 59 | set_normalized_timespec(&delta, | 60 | set_normalized_timespec(&delta, |
| 60 | xtime.tv_sec - oldtime, | 61 | ts.tv_sec - oldtime, |
| 61 | xtime.tv_nsec - (NSEC_PER_SEC >> 1)); | 62 | ts.tv_nsec - (NSEC_PER_SEC >> 1)); |
| 62 | 63 | ||
| 63 | return 0; | 64 | return 0; |
| 64 | } | 65 | } |
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index b20fd0681733..92e8a37b5022 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c | |||
| @@ -674,7 +674,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) | |||
| 674 | int first = 1; | 674 | int first = 1; |
| 675 | int i; | 675 | int i; |
| 676 | unsigned long duration; | 676 | unsigned long duration; |
| 677 | struct timespec done_stamp = xtime; | 677 | struct timespec done_stamp = current_kernel_time(); |
| 678 | 678 | ||
| 679 | DBF_TEXT(trace, 4, __FUNCTION__); | 679 | DBF_TEXT(trace, 4, __FUNCTION__); |
| 680 | 680 | ||
| @@ -730,7 +730,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) | |||
| 730 | spin_unlock(&ch->collect_lock); | 730 | spin_unlock(&ch->collect_lock); |
| 731 | ch->ccw[1].count = ch->trans_skb->len; | 731 | ch->ccw[1].count = ch->trans_skb->len; |
| 732 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); | 732 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); |
| 733 | ch->prof.send_stamp = xtime; | 733 | ch->prof.send_stamp = current_kernel_time(); |
| 734 | rc = ccw_device_start(ch->cdev, &ch->ccw[0], | 734 | rc = ccw_device_start(ch->cdev, &ch->ccw[0], |
| 735 | (unsigned long) ch, 0xff, 0); | 735 | (unsigned long) ch, 0xff, 0); |
| 736 | ch->prof.doios_multi++; | 736 | ch->prof.doios_multi++; |
| @@ -2281,7 +2281,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) | |||
| 2281 | fsm_newstate(ch->fsm, CH_STATE_TX); | 2281 | fsm_newstate(ch->fsm, CH_STATE_TX); |
| 2282 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); | 2282 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); |
| 2283 | spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); | 2283 | spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); |
| 2284 | ch->prof.send_stamp = xtime; | 2284 | ch->prof.send_stamp = current_kernel_time(); |
| 2285 | rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], | 2285 | rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], |
| 2286 | (unsigned long) ch, 0xff, 0); | 2286 | (unsigned long) ch, 0xff, 0); |
| 2287 | spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); | 2287 | spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 3d28e1a5bf79..268889474339 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
| @@ -753,7 +753,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg) | |||
| 753 | 753 | ||
| 754 | header.next = 0; | 754 | header.next = 0; |
| 755 | memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); | 755 | memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); |
| 756 | conn->prof.send_stamp = xtime; | 756 | conn->prof.send_stamp = current_kernel_time(); |
| 757 | txmsg.class = 0; | 757 | txmsg.class = 0; |
| 758 | txmsg.tag = 0; | 758 | txmsg.tag = 0; |
| 759 | rc = iucv_message_send(conn->path, &txmsg, 0, 0, | 759 | rc = iucv_message_send(conn->path, &txmsg, 0, 0, |
| @@ -1185,7 +1185,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn, | |||
| 1185 | memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); | 1185 | memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); |
| 1186 | 1186 | ||
| 1187 | fsm_newstate(conn->fsm, CONN_STATE_TX); | 1187 | fsm_newstate(conn->fsm, CONN_STATE_TX); |
| 1188 | conn->prof.send_stamp = xtime; | 1188 | conn->prof.send_stamp = current_kernel_time(); |
| 1189 | 1189 | ||
| 1190 | msg.tag = 1; | 1190 | msg.tag = 1; |
| 1191 | msg.class = 0; | 1191 | msg.class = 0; |
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index cad426c9711e..aad4012bbb30 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/keyboard.h> | 33 | #include <linux/keyboard.h> |
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/pm.h> | 35 | #include <linux/pm.h> |
| 36 | #include <linux/pm_legacy.h> | ||
| 37 | #include <linux/bitops.h> | 36 | #include <linux/bitops.h> |
| 38 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
| 39 | 38 | ||
| @@ -401,9 +400,9 @@ irqreturn_t rs_interrupt(int irq, void *dev_id) | |||
| 401 | return IRQ_HANDLED; | 400 | return IRQ_HANDLED; |
| 402 | } | 401 | } |
| 403 | 402 | ||
| 404 | static void do_softint(void *private) | 403 | static void do_softint(struct work_struct *work) |
| 405 | { | 404 | { |
| 406 | struct m68k_serial *info = (struct m68k_serial *) private; | 405 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); |
| 407 | struct tty_struct *tty; | 406 | struct tty_struct *tty; |
| 408 | 407 | ||
| 409 | tty = info->tty; | 408 | tty = info->tty; |
| @@ -425,9 +424,9 @@ static void do_softint(void *private) | |||
| 425 | * do_serial_hangup() -> tty->hangup() -> rs_hangup() | 424 | * do_serial_hangup() -> tty->hangup() -> rs_hangup() |
| 426 | * | 425 | * |
| 427 | */ | 426 | */ |
| 428 | static void do_serial_hangup(void *private) | 427 | static void do_serial_hangup(struct work_struct *work) |
| 429 | { | 428 | { |
| 430 | struct m68k_serial *info = (struct m68k_serial *) private; | 429 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); |
| 431 | struct tty_struct *tty; | 430 | struct tty_struct *tty; |
| 432 | 431 | ||
| 433 | tty = info->tty; | 432 | tty = info->tty; |
| @@ -1324,59 +1323,6 @@ static void show_serial_version(void) | |||
| 1324 | printk("MC68328 serial driver version 1.00\n"); | 1323 | printk("MC68328 serial driver version 1.00\n"); |
| 1325 | } | 1324 | } |
| 1326 | 1325 | ||
| 1327 | #ifdef CONFIG_PM_LEGACY | ||
| 1328 | /* Serial Power management | ||
| 1329 | * The console (currently fixed at line 0) is a special case for power | ||
| 1330 | * management because the kernel is so chatty. The console will be | ||
| 1331 | * explicitly disabled my our power manager as the last minute, so we won't | ||
| 1332 | * mess with it here. | ||
| 1333 | */ | ||
| 1334 | static struct pm_dev *serial_pm[NR_PORTS]; | ||
| 1335 | |||
| 1336 | static int serial_pm_callback(struct pm_dev *dev, pm_request_t request, void *data) | ||
| 1337 | { | ||
| 1338 | struct m68k_serial *info = (struct m68k_serial *)dev->data; | ||
| 1339 | |||
| 1340 | if(info == NULL) | ||
| 1341 | return -1; | ||
| 1342 | |||
| 1343 | /* special case for line 0 - pm restores it */ | ||
| 1344 | if(info->line == 0) | ||
| 1345 | return 0; | ||
| 1346 | |||
| 1347 | switch (request) { | ||
| 1348 | case PM_SUSPEND: | ||
| 1349 | shutdown(info); | ||
| 1350 | break; | ||
| 1351 | |||
| 1352 | case PM_RESUME: | ||
| 1353 | startup(info); | ||
| 1354 | break; | ||
| 1355 | } | ||
| 1356 | return 0; | ||
| 1357 | } | ||
| 1358 | |||
| 1359 | void shutdown_console(void) | ||
| 1360 | { | ||
| 1361 | struct m68k_serial *info = &m68k_soft[0]; | ||
| 1362 | |||
| 1363 | /* HACK: wait a bit for any pending printk's to be dumped */ | ||
| 1364 | { | ||
| 1365 | int i = 10000; | ||
| 1366 | while(i--); | ||
| 1367 | } | ||
| 1368 | |||
| 1369 | shutdown(info); | ||
| 1370 | } | ||
| 1371 | |||
| 1372 | void startup_console(void) | ||
| 1373 | { | ||
| 1374 | struct m68k_serial *info = &m68k_soft[0]; | ||
| 1375 | startup(info); | ||
| 1376 | } | ||
| 1377 | #endif /* CONFIG_PM_LEGACY */ | ||
| 1378 | |||
| 1379 | |||
| 1380 | static const struct tty_operations rs_ops = { | 1326 | static const struct tty_operations rs_ops = { |
| 1381 | .open = rs_open, | 1327 | .open = rs_open, |
| 1382 | .close = rs_close, | 1328 | .close = rs_close, |
| @@ -1444,8 +1390,8 @@ rs68328_init(void) | |||
| 1444 | info->event = 0; | 1390 | info->event = 0; |
| 1445 | info->count = 0; | 1391 | info->count = 0; |
| 1446 | info->blocked_open = 0; | 1392 | info->blocked_open = 0; |
| 1447 | INIT_WORK(&info->tqueue, do_softint, info); | 1393 | INIT_WORK(&info->tqueue, do_softint); |
| 1448 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); | 1394 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup); |
| 1449 | init_waitqueue_head(&info->open_wait); | 1395 | init_waitqueue_head(&info->open_wait); |
| 1450 | init_waitqueue_head(&info->close_wait); | 1396 | init_waitqueue_head(&info->close_wait); |
| 1451 | info->line = i; | 1397 | info->line = i; |
| @@ -1467,11 +1413,6 @@ rs68328_init(void) | |||
| 1467 | IRQ_FLG_STD, | 1413 | IRQ_FLG_STD, |
| 1468 | "M68328_UART", NULL)) | 1414 | "M68328_UART", NULL)) |
| 1469 | panic("Unable to attach 68328 serial interrupt\n"); | 1415 | panic("Unable to attach 68328 serial interrupt\n"); |
| 1470 | #ifdef CONFIG_PM_LEGACY | ||
| 1471 | serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); | ||
| 1472 | if (serial_pm[i]) | ||
| 1473 | serial_pm[i]->data = info; | ||
| 1474 | #endif | ||
| 1475 | } | 1416 | } |
| 1476 | local_irq_restore(flags); | 1417 | local_irq_restore(flags); |
| 1477 | return 0; | 1418 | return 0; |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 5e3dcf3299bf..533ef40f7ccf 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -131,7 +131,7 @@ struct acpi_device_ops { | |||
| 131 | struct acpi_driver { | 131 | struct acpi_driver { |
| 132 | char name[80]; | 132 | char name[80]; |
| 133 | char class[80]; | 133 | char class[80]; |
| 134 | char *ids; /* Supported Hardware IDs */ | 134 | const struct acpi_device_id *ids; /* Supported Hardware IDs */ |
| 135 | struct acpi_device_ops ops; | 135 | struct acpi_device_ops ops; |
| 136 | struct device_driver drv; | 136 | struct device_driver drv; |
| 137 | struct module *owner; | 137 | struct module *owner; |
| @@ -341,7 +341,8 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, | |||
| 341 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); | 341 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); |
| 342 | int acpi_bus_start(struct acpi_device *device); | 342 | int acpi_bus_start(struct acpi_device *device); |
| 343 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); | 343 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); |
| 344 | int acpi_match_ids(struct acpi_device *device, char *ids); | 344 | int acpi_match_device_ids(struct acpi_device *device, |
| 345 | const struct acpi_device_id *ids); | ||
| 345 | int acpi_create_dir(struct acpi_device *); | 346 | int acpi_create_dir(struct acpi_device *); |
| 346 | void acpi_remove_dir(struct acpi_device *); | 347 | void acpi_remove_dir(struct acpi_device *); |
| 347 | 348 | ||
| @@ -365,6 +366,8 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); | |||
| 365 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | 366 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); |
| 366 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) | 367 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) |
| 367 | 368 | ||
| 369 | int acpi_pm_device_sleep_state(struct device *, int, int *); | ||
| 370 | |||
| 368 | #endif /* CONFIG_ACPI */ | 371 | #endif /* CONFIG_ACPI */ |
| 369 | 372 | ||
| 370 | #endif /*__ACPI_BUS_H__*/ | 373 | #endif /*__ACPI_BUS_H__*/ |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 553515912c0b..f85f77a538aa 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
| @@ -34,16 +34,21 @@ | |||
| 34 | #define ACPI_BUS_COMPONENT 0x00010000 | 34 | #define ACPI_BUS_COMPONENT 0x00010000 |
| 35 | #define ACPI_SYSTEM_COMPONENT 0x02000000 | 35 | #define ACPI_SYSTEM_COMPONENT 0x02000000 |
| 36 | 36 | ||
| 37 | /* _HID definitions */ | 37 | /* |
| 38 | * _HID definitions | ||
| 39 | * HIDs must conform to ACPI spec(6.1.4) | ||
| 40 | * Linux specific HIDs do not apply to this and begin with LNX: | ||
| 41 | */ | ||
| 38 | 42 | ||
| 39 | #define ACPI_POWER_HID "power_resource" | 43 | #define ACPI_POWER_HID "LNXPOWER" |
| 40 | #define ACPI_PROCESSOR_HID "ACPI0007" | 44 | #define ACPI_PROCESSOR_HID "ACPI0007" |
| 41 | #define ACPI_SYSTEM_HID "acpi_system" | 45 | #define ACPI_SYSTEM_HID "LNXSYSTM" |
| 42 | #define ACPI_THERMAL_HID "thermal" | 46 | #define ACPI_THERMAL_HID "LNXTHERM" |
| 43 | #define ACPI_BUTTON_HID_POWERF "button_power" | 47 | #define ACPI_BUTTON_HID_POWERF "LNXPWRBN" |
| 44 | #define ACPI_BUTTON_HID_SLEEPF "button_sleep" | 48 | #define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN" |
| 45 | #define ACPI_VIDEO_HID "video" | 49 | #define ACPI_VIDEO_HID "LNXVIDEO" |
| 46 | #define ACPI_BAY_HID "bay" | 50 | #define ACPI_BAY_HID "LNXIOBAY" |
| 51 | |||
| 47 | /* -------------------------------------------------------------------------- | 52 | /* -------------------------------------------------------------------------- |
| 48 | PCI | 53 | PCI |
| 49 | -------------------------------------------------------------------------- */ | 54 | -------------------------------------------------------------------------- */ |
| @@ -142,10 +147,6 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle) | |||
| 142 | /*-------------------------------------------------------------------------- | 147 | /*-------------------------------------------------------------------------- |
| 143 | Suspend/Resume | 148 | Suspend/Resume |
| 144 | -------------------------------------------------------------------------- */ | 149 | -------------------------------------------------------------------------- */ |
| 145 | #ifdef CONFIG_ACPI_SLEEP | ||
| 146 | extern int acpi_sleep_init(void); | 150 | extern int acpi_sleep_init(void); |
| 147 | #else | ||
| 148 | #define acpi_sleep_init() do {} while (0) | ||
| 149 | #endif | ||
| 150 | 151 | ||
| 151 | #endif /*__ACPI_DRIVERS_H__*/ | 152 | #endif /*__ACPI_DRIVERS_H__*/ |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index fe8abc276437..e73a38939120 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, | |||
| 809 | 809 | ||
| 810 | /* Common string version of device HIDs and UIDs */ | 810 | /* Common string version of device HIDs and UIDs */ |
| 811 | 811 | ||
| 812 | struct acpi_device_id { | 812 | struct acpica_device_id { |
| 813 | char value[ACPI_DEVICE_ID_LENGTH]; | 813 | char value[ACPI_DEVICE_ID_LENGTH]; |
| 814 | }; | 814 | }; |
| 815 | 815 | ||
| @@ -859,8 +859,8 @@ struct acpi_device_info { | |||
| 859 | u32 valid; /* Indicates which fields below are valid */ | 859 | u32 valid; /* Indicates which fields below are valid */ |
| 860 | u32 current_status; /* _STA value */ | 860 | u32 current_status; /* _STA value */ |
| 861 | acpi_integer address; /* _ADR value if any */ | 861 | acpi_integer address; /* _ADR value if any */ |
| 862 | struct acpi_device_id hardware_id; /* _HID value if any */ | 862 | struct acpica_device_id hardware_id; /* _HID value if any */ |
| 863 | struct acpi_device_id unique_id; /* _UID value if any */ | 863 | struct acpica_device_id unique_id; /* _UID value if any */ |
| 864 | u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ | 864 | u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ |
| 865 | struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ | 865 | struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ |
| 866 | }; | 866 | }; |
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index a87ef1c8d46b..a2918547c73f 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
| @@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, | |||
| 354 | 354 | ||
| 355 | acpi_status | 355 | acpi_status |
| 356 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, | 356 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, |
| 357 | struct acpi_device_id *hid); | 357 | struct acpica_device_id *hid); |
| 358 | 358 | ||
| 359 | acpi_status | 359 | acpi_status |
| 360 | acpi_ut_execute_CID(struct acpi_namespace_node *device_node, | 360 | acpi_ut_execute_CID(struct acpi_namespace_node *device_node, |
| @@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, | |||
| 366 | 366 | ||
| 367 | acpi_status | 367 | acpi_status |
| 368 | acpi_ut_execute_UID(struct acpi_namespace_node *device_node, | 368 | acpi_ut_execute_UID(struct acpi_namespace_node *device_node, |
| 369 | struct acpi_device_id *uid); | 369 | struct acpica_device_id *uid); |
| 370 | 370 | ||
| 371 | acpi_status | 371 | acpi_status |
| 372 | acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); | 372 | acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); |
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 449f3f272e07..125179adf044 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h | |||
| @@ -121,19 +121,6 @@ static inline void acpi_disable_pci(void) | |||
| 121 | } | 121 | } |
| 122 | extern int acpi_irq_balance_set(char *str); | 122 | extern int acpi_irq_balance_set(char *str); |
| 123 | 123 | ||
| 124 | #else /* !CONFIG_ACPI */ | ||
| 125 | |||
| 126 | #define acpi_lapic 0 | ||
| 127 | #define acpi_ioapic 0 | ||
| 128 | static inline void acpi_noirq_set(void) { } | ||
| 129 | static inline void acpi_disable_pci(void) { } | ||
| 130 | static inline void disable_acpi(void) { } | ||
| 131 | |||
| 132 | #endif /* !CONFIG_ACPI */ | ||
| 133 | |||
| 134 | |||
| 135 | #ifdef CONFIG_ACPI_SLEEP | ||
| 136 | |||
| 137 | /* routines for saving/restoring kernel state */ | 124 | /* routines for saving/restoring kernel state */ |
| 138 | extern int acpi_save_state_mem(void); | 125 | extern int acpi_save_state_mem(void); |
| 139 | extern void acpi_restore_state_mem(void); | 126 | extern void acpi_restore_state_mem(void); |
| @@ -143,7 +130,15 @@ extern unsigned long acpi_wakeup_address; | |||
| 143 | /* early initialization routine */ | 130 | /* early initialization routine */ |
| 144 | extern void acpi_reserve_bootmem(void); | 131 | extern void acpi_reserve_bootmem(void); |
| 145 | 132 | ||
| 146 | #endif /*CONFIG_ACPI_SLEEP*/ | 133 | #else /* !CONFIG_ACPI */ |
| 134 | |||
| 135 | #define acpi_lapic 0 | ||
| 136 | #define acpi_ioapic 0 | ||
| 137 | static inline void acpi_noirq_set(void) { } | ||
| 138 | static inline void acpi_disable_pci(void) { } | ||
| 139 | static inline void disable_acpi(void) { } | ||
| 140 | |||
| 141 | #endif /* !CONFIG_ACPI */ | ||
| 147 | 142 | ||
| 148 | #define ARCH_HAS_POWER_INIT 1 | 143 | #define ARCH_HAS_POWER_INIT 1 |
| 149 | 144 | ||
diff --git a/include/asm-i386/bootparam.h b/include/asm-i386/bootparam.h index 427d8652bfde..b91b01783e4b 100644 --- a/include/asm-i386/bootparam.h +++ b/include/asm-i386/bootparam.h | |||
| @@ -4,8 +4,9 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/screen_info.h> | 5 | #include <linux/screen_info.h> |
| 6 | #include <linux/apm_bios.h> | 6 | #include <linux/apm_bios.h> |
| 7 | #include <asm/e820.h> | ||
| 8 | #include <linux/edd.h> | 7 | #include <linux/edd.h> |
| 8 | #include <asm/e820.h> | ||
| 9 | #include <asm/ist.h> | ||
| 9 | #include <video/edid.h> | 10 | #include <video/edid.h> |
| 10 | 11 | ||
| 11 | struct setup_header { | 12 | struct setup_header { |
| @@ -48,9 +49,9 @@ struct efi_info { | |||
| 48 | u32 _pad1; | 49 | u32 _pad1; |
| 49 | u32 efi_systab; | 50 | u32 efi_systab; |
| 50 | u32 efi_memdesc_size; | 51 | u32 efi_memdesc_size; |
| 51 | u32 efi_memdec_version; | 52 | u32 efi_memdesc_version; |
| 52 | u32 efi_memmap; | 53 | u32 efi_memmap; |
| 53 | u32 fi_memmap_size; | 54 | u32 efi_memmap_size; |
| 54 | u32 _pad2[2]; | 55 | u32 _pad2[2]; |
| 55 | }; | 56 | }; |
| 56 | 57 | ||
| @@ -59,7 +60,7 @@ struct boot_params { | |||
| 59 | struct screen_info screen_info; /* 0x000 */ | 60 | struct screen_info screen_info; /* 0x000 */ |
| 60 | struct apm_bios_info apm_bios_info; /* 0x040 */ | 61 | struct apm_bios_info apm_bios_info; /* 0x040 */ |
| 61 | u8 _pad2[12]; /* 0x054 */ | 62 | u8 _pad2[12]; /* 0x054 */ |
| 62 | u32 speedstep_info[4]; /* 0x060 */ | 63 | struct ist_info ist_info; /* 0x060 */ |
| 63 | u8 _pad3[16]; /* 0x070 */ | 64 | u8 _pad3[16]; /* 0x070 */ |
| 64 | u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ | 65 | u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ |
| 65 | u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ | 66 | u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ |
diff --git a/include/asm-i386/ist.h b/include/asm-i386/ist.h index d13d1e68afa9..ef2003ebc6f9 100644 --- a/include/asm-i386/ist.h +++ b/include/asm-i386/ist.h | |||
| @@ -19,11 +19,13 @@ | |||
| 19 | 19 | ||
| 20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
| 21 | 21 | ||
| 22 | #include <linux/types.h> | ||
| 23 | |||
| 22 | struct ist_info { | 24 | struct ist_info { |
| 23 | unsigned long signature; | 25 | u32 signature; |
| 24 | unsigned long command; | 26 | u32 command; |
| 25 | unsigned long event; | 27 | u32 event; |
| 26 | unsigned long perf_level; | 28 | u32 perf_level; |
| 27 | }; | 29 | }; |
| 28 | 30 | ||
| 29 | extern struct ist_info ist_info; | 31 | extern struct ist_info ist_info; |
diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h index 8dbaafe611ff..a2520732ffd6 100644 --- a/include/asm-i386/suspend.h +++ b/include/asm-i386/suspend.h | |||
| @@ -21,7 +21,7 @@ struct saved_context { | |||
| 21 | unsigned long return_address; | 21 | unsigned long return_address; |
| 22 | } __attribute__((packed)); | 22 | } __attribute__((packed)); |
| 23 | 23 | ||
| 24 | #ifdef CONFIG_ACPI_SLEEP | 24 | #ifdef CONFIG_ACPI |
| 25 | extern unsigned long saved_eip; | 25 | extern unsigned long saved_eip; |
| 26 | extern unsigned long saved_esp; | 26 | extern unsigned long saved_esp; |
| 27 | extern unsigned long saved_ebp; | 27 | extern unsigned long saved_ebp; |
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h index 5b526357d178..49730ffbbae4 100644 --- a/include/asm-ia64/acpi.h +++ b/include/asm-ia64/acpi.h | |||
| @@ -100,6 +100,11 @@ const char *acpi_get_sysname (void); | |||
| 100 | int acpi_request_vector (u32 int_type); | 100 | int acpi_request_vector (u32 int_type); |
| 101 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); | 101 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); |
| 102 | 102 | ||
| 103 | /* routines for saving/restoring kernel state */ | ||
| 104 | extern int acpi_save_state_mem(void); | ||
| 105 | extern void acpi_restore_state_mem(void); | ||
| 106 | extern unsigned long acpi_wakeup_address; | ||
| 107 | |||
| 103 | /* | 108 | /* |
| 104 | * Record the cpei override flag and current logical cpu. This is | 109 | * Record the cpei override flag and current logical cpu. This is |
| 105 | * useful for CPU removal. | 110 | * useful for CPU removal. |
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h index 5ff8d74c3e00..2390ee145aa1 100644 --- a/include/asm-ia64/ia32.h +++ b/include/asm-ia64/ia32.h | |||
| @@ -27,11 +27,12 @@ extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs) | |||
| 27 | extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info, | 27 | extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info, |
| 28 | sigset_t *set, struct pt_regs *regs); | 28 | sigset_t *set, struct pt_regs *regs); |
| 29 | #if PAGE_SHIFT > IA32_PAGE_SHIFT | 29 | #if PAGE_SHIFT > IA32_PAGE_SHIFT |
| 30 | extern int ia32_copy_partial_page_list (struct task_struct *, unsigned long); | 30 | extern int ia32_copy_ia64_partial_page_list(struct task_struct *, |
| 31 | extern void ia32_drop_partial_page_list (struct task_struct *); | 31 | unsigned long); |
| 32 | extern void ia32_drop_ia64_partial_page_list(struct task_struct *); | ||
| 32 | #else | 33 | #else |
| 33 | # define ia32_copy_partial_page_list(a1, a2) 0 | 34 | # define ia32_copy_ia64_partial_page_list(a1, a2) 0 |
| 34 | # define ia32_drop_partial_page_list(a1) do { ; } while (0) | 35 | # define ia32_drop_ia64_partial_page_list(a1) do { ; } while (0) |
| 35 | #endif | 36 | #endif |
| 36 | 37 | ||
| 37 | #endif /* !__ASSEMBLY__ */ | 38 | #endif /* !__ASSEMBLY__ */ |
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index ca33eb181ff2..5cf8bf1e805e 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
| @@ -275,6 +275,7 @@ struct ia64_machine_vector { | |||
| 275 | 275 | ||
| 276 | extern struct ia64_machine_vector ia64_mv; | 276 | extern struct ia64_machine_vector ia64_mv; |
| 277 | extern void machvec_init (const char *name); | 277 | extern void machvec_init (const char *name); |
| 278 | extern void machvec_init_from_cmdline(const char *cmdline); | ||
| 278 | 279 | ||
| 279 | # else | 280 | # else |
| 280 | # error Unknown configuration. Update asm-ia64/machvec.h. | 281 | # error Unknown configuration. Update asm-ia64/machvec.h. |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 6251c76437d2..be3b0ae43270 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
| @@ -220,7 +220,7 @@ struct desc_struct { | |||
| 220 | 220 | ||
| 221 | #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) | 221 | #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) |
| 222 | 222 | ||
| 223 | struct partial_page_list; | 223 | struct ia64_partial_page_list; |
| 224 | #endif | 224 | #endif |
| 225 | 225 | ||
| 226 | struct thread_struct { | 226 | struct thread_struct { |
| @@ -242,7 +242,7 @@ struct thread_struct { | |||
| 242 | __u64 fdr; /* IA32 fp except. data reg */ | 242 | __u64 fdr; /* IA32 fp except. data reg */ |
| 243 | __u64 old_k1; /* old value of ar.k1 */ | 243 | __u64 old_k1; /* old value of ar.k1 */ |
| 244 | __u64 old_iob; /* old IOBase value */ | 244 | __u64 old_iob; /* old IOBase value */ |
| 245 | struct partial_page_list *ppl; /* partial page list for 4K page size issue */ | 245 | struct ia64_partial_page_list *ppl; /* partial page list for 4K page size issue */ |
| 246 | /* cached TLS descriptors. */ | 246 | /* cached TLS descriptors. */ |
| 247 | struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; | 247 | struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; |
| 248 | 248 | ||
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index c60024989ebd..6314b29e8c4d 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h | |||
| @@ -116,7 +116,6 @@ max_xtp (void) | |||
| 116 | extern int __cpu_disable (void); | 116 | extern int __cpu_disable (void); |
| 117 | extern void __cpu_die (unsigned int cpu); | 117 | extern void __cpu_die (unsigned int cpu); |
| 118 | extern void cpu_die (void) __attribute__ ((noreturn)); | 118 | extern void cpu_die (void) __attribute__ ((noreturn)); |
| 119 | extern int __cpu_up (unsigned int cpu); | ||
| 120 | extern void __init smp_build_cpu_map(void); | 119 | extern void __init smp_build_cpu_map(void); |
| 121 | 120 | ||
| 122 | extern void __init init_smp_config (void); | 121 | 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 index 000000000000..f3ec9e5ae049 --- /dev/null +++ b/include/asm-m68knommu/hw_irq.h | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #ifndef __M68KNOMMU_HW_IRQ_H__ | ||
| 2 | #define __M68KNOMMU_HW_IRQ_H__ | ||
| 3 | |||
| 4 | #endif /* __M68KNOMMU_HW_IRQ_H__ */ | ||
diff --git a/include/asm-m68knommu/mcfdma.h b/include/asm-m68knommu/mcfdma.h index ea729e81a6be..705c52c79cd8 100644 --- a/include/asm-m68knommu/mcfdma.h +++ b/include/asm-m68knommu/mcfdma.h | |||
| @@ -133,7 +133,7 @@ | |||
| 133 | #define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */ | 133 | #define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */ |
| 134 | #define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */ | 134 | #define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */ |
| 135 | #define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */ | 135 | #define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */ |
| 136 | #define MCFDMA_DIR_INV 0x1000 /* Invalid Combination */ | 136 | #define MCFDMA_DIR_INV 0x0010 /* Invalid Combination */ |
| 137 | #define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */ | 137 | #define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */ |
| 138 | #define MCFDMA_DIR_TE 0x0002 /* Transfer Error */ | 138 | #define MCFDMA_DIR_TE 0x0002 /* Transfer Error */ |
| 139 | #define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */ | 139 | #define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */ |
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 5e5ed18bb78f..5da43a5d12a3 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h | |||
| @@ -296,7 +296,7 @@ cmpxchg(volatile int *p, int old, int new) | |||
| 296 | ({ \ | 296 | ({ \ |
| 297 | unsigned char volatile *reset; \ | 297 | unsigned char volatile *reset; \ |
| 298 | asm("move.w #0x2700, %sr"); \ | 298 | asm("move.w #0x2700, %sr"); \ |
| 299 | reset = ((volatile unsigned short *)(MCF_IPSBAR + 0x110000)); \ | 299 | reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \ |
| 300 | while(1) \ | 300 | while(1) \ |
| 301 | *reset |= (0x01 << 7);\ | 301 | *reset |= (0x01 << 7);\ |
| 302 | }) | 302 | }) |
| @@ -318,7 +318,7 @@ cmpxchg(volatile int *p, int old, int new) | |||
| 318 | ({ \ | 318 | ({ \ |
| 319 | unsigned char volatile *reset; \ | 319 | unsigned char volatile *reset; \ |
| 320 | asm("move.w #0x2700, %sr"); \ | 320 | asm("move.w #0x2700, %sr"); \ |
| 321 | reset = ((volatile unsigned short *)(MCF_IPSBAR + 0xA0000)); \ | 321 | reset = ((volatile unsigned char *)(MCF_IPSBAR + 0xA0000)); \ |
| 322 | while(1) \ | 322 | while(1) \ |
| 323 | *reset |= 0x80; \ | 323 | *reset |= 0x80; \ |
| 324 | }) | 324 | }) |
diff --git a/include/asm-m68knommu/timex.h b/include/asm-m68knommu/timex.h index 85069998db52..109050f3fe91 100644 --- a/include/asm-m68knommu/timex.h +++ b/include/asm-m68knommu/timex.h | |||
| @@ -1 +1,23 @@ | |||
| 1 | #include <asm-m68k/timex.h> | 1 | /* |
| 2 | * linux/include/asm-m68knommu/timex.h | ||
| 3 | * | ||
| 4 | * m68knommu architecture timex specifications | ||
| 5 | */ | ||
| 6 | #ifndef _ASM_M68KNOMMU_TIMEX_H | ||
| 7 | #define _ASM_M68KNOMMU_TIMEX_H | ||
| 8 | |||
| 9 | #ifdef CONFIG_COLDFIRE | ||
| 10 | #include <asm/coldfire.h> | ||
| 11 | #define CLOCK_TICK_RATE MCF_CLK | ||
| 12 | #else | ||
| 13 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
| 14 | #endif | ||
| 15 | |||
| 16 | typedef unsigned long cycles_t; | ||
| 17 | |||
| 18 | static inline cycles_t get_cycles(void) | ||
| 19 | { | ||
| 20 | return 0; | ||
| 21 | } | ||
| 22 | |||
| 23 | #endif | ||
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index d53e0eb1de16..e909769b6410 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
| @@ -71,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | |||
| 71 | return bus->sysdata; | 71 | return bus->sysdata; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | static inline int isa_vaddr_is_ioport(void __iomem *address) | ||
| 75 | { | ||
| 76 | /* No specific ISA handling on ppc32 at this stage, it | ||
| 77 | * all goes through PCI | ||
| 78 | */ | ||
| 79 | return 0; | ||
| 80 | } | ||
| 81 | |||
| 74 | /* These are used for config access before all the PCI probing | 82 | /* These are used for config access before all the PCI probing |
| 75 | has been done. */ | 83 | has been done. */ |
| 76 | int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, | 84 | 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); | |||
| 241 | 249 | ||
| 242 | extern void isa_bridge_find_early(struct pci_controller *hose); | 250 | extern void isa_bridge_find_early(struct pci_controller *hose); |
| 243 | 251 | ||
| 252 | static inline int isa_vaddr_is_ioport(void __iomem *address) | ||
| 253 | { | ||
| 254 | /* Check if address hits the reserved legacy IO range */ | ||
| 255 | unsigned long ea = (unsigned long)address; | ||
| 256 | return ea >= ISA_IO_BASE && ea < ISA_IO_END; | ||
| 257 | } | ||
| 258 | |||
| 244 | extern int pcibios_unmap_io_space(struct pci_bus *bus); | 259 | extern int pcibios_unmap_io_space(struct pci_bus *bus); |
| 245 | extern int pcibios_map_io_space(struct pci_bus *bus); | 260 | extern int pcibios_map_io_space(struct pci_bus *bus); |
| 246 | 261 | ||
| @@ -271,11 +286,16 @@ extern struct pci_controller * | |||
| 271 | pcibios_alloc_controller(struct device_node *dev); | 286 | pcibios_alloc_controller(struct device_node *dev); |
| 272 | #ifdef CONFIG_PCI | 287 | #ifdef CONFIG_PCI |
| 273 | extern unsigned long pci_address_to_pio(phys_addr_t address); | 288 | extern unsigned long pci_address_to_pio(phys_addr_t address); |
| 289 | extern int pcibios_vaddr_is_ioport(void __iomem *address); | ||
| 274 | #else | 290 | #else |
| 275 | static inline unsigned long pci_address_to_pio(phys_addr_t address) | 291 | static inline unsigned long pci_address_to_pio(phys_addr_t address) |
| 276 | { | 292 | { |
| 277 | return (unsigned long)-1; | 293 | return (unsigned long)-1; |
| 278 | } | 294 | } |
| 295 | static inline int pcibios_vaddr_is_ioport(void __iomem *address) | ||
| 296 | { | ||
| 297 | return 0; | ||
| 298 | } | ||
| 279 | #endif | 299 | #endif |
| 280 | 300 | ||
| 281 | 301 | ||
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h index fa083d8e4663..65325721446d 100644 --- a/include/asm-powerpc/ppc_asm.h +++ b/include/asm-powerpc/ppc_asm.h | |||
| @@ -181,6 +181,18 @@ name: \ | |||
| 181 | .type GLUE(.,name),@function; \ | 181 | .type GLUE(.,name),@function; \ |
| 182 | GLUE(.,name): | 182 | GLUE(.,name): |
| 183 | 183 | ||
| 184 | #define _INIT_STATIC(name) \ | ||
| 185 | .section ".text.init.refok"; \ | ||
| 186 | .align 2 ; \ | ||
| 187 | .section ".opd","aw"; \ | ||
| 188 | name: \ | ||
| 189 | .quad GLUE(.,name); \ | ||
| 190 | .quad .TOC.@tocbase; \ | ||
| 191 | .quad 0; \ | ||
| 192 | .previous; \ | ||
| 193 | .type GLUE(.,name),@function; \ | ||
| 194 | GLUE(.,name): | ||
| 195 | |||
| 184 | #else /* 32-bit */ | 196 | #else /* 32-bit */ |
| 185 | 197 | ||
| 186 | #define _GLOBAL(n) \ | 198 | #define _GLOBAL(n) \ |
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h index 0117b544ecbc..3a0975e2adad 100644 --- a/include/asm-powerpc/vio.h +++ b/include/asm-powerpc/vio.h | |||
| @@ -80,6 +80,11 @@ extern const void *vio_get_attribute(struct vio_dev *vdev, char *which, | |||
| 80 | extern struct vio_dev *vio_find_node(struct device_node *vnode); | 80 | extern struct vio_dev *vio_find_node(struct device_node *vnode); |
| 81 | extern int vio_enable_interrupts(struct vio_dev *dev); | 81 | extern int vio_enable_interrupts(struct vio_dev *dev); |
| 82 | extern int vio_disable_interrupts(struct vio_dev *dev); | 82 | extern int vio_disable_interrupts(struct vio_dev *dev); |
| 83 | #else | ||
| 84 | static inline int vio_enable_interrupts(struct vio_dev *dev) | ||
| 85 | { | ||
| 86 | return 0; | ||
| 87 | } | ||
| 83 | #endif | 88 | #endif |
| 84 | 89 | ||
| 85 | static inline struct vio_driver *to_vio_driver(struct device_driver *drv) | 90 | static inline struct vio_driver *to_vio_driver(struct device_driver *drv) |
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index 1da8f49c0fe2..98173357dd89 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h | |||
| @@ -108,6 +108,15 @@ static inline void acpi_disable_pci(void) | |||
| 108 | } | 108 | } |
| 109 | extern int acpi_irq_balance_set(char *str); | 109 | extern int acpi_irq_balance_set(char *str); |
| 110 | 110 | ||
| 111 | /* routines for saving/restoring kernel state */ | ||
| 112 | extern int acpi_save_state_mem(void); | ||
| 113 | extern void acpi_restore_state_mem(void); | ||
| 114 | |||
| 115 | extern unsigned long acpi_wakeup_address; | ||
| 116 | |||
| 117 | /* early initialization routine */ | ||
| 118 | extern void acpi_reserve_bootmem(void); | ||
| 119 | |||
| 111 | #else /* !CONFIG_ACPI */ | 120 | #else /* !CONFIG_ACPI */ |
| 112 | 121 | ||
| 113 | #define acpi_lapic 0 | 122 | #define acpi_lapic 0 |
| @@ -121,19 +130,6 @@ extern int acpi_numa; | |||
| 121 | extern int acpi_scan_nodes(unsigned long start, unsigned long end); | 130 | extern int acpi_scan_nodes(unsigned long start, unsigned long end); |
| 122 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) | 131 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) |
| 123 | 132 | ||
| 124 | #ifdef CONFIG_ACPI_SLEEP | ||
| 125 | |||
| 126 | /* routines for saving/restoring kernel state */ | ||
| 127 | extern int acpi_save_state_mem(void); | ||
| 128 | extern void acpi_restore_state_mem(void); | ||
| 129 | |||
| 130 | extern unsigned long acpi_wakeup_address; | ||
| 131 | |||
| 132 | /* early initialization routine */ | ||
| 133 | extern void acpi_reserve_bootmem(void); | ||
| 134 | |||
| 135 | #endif /*CONFIG_ACPI_SLEEP*/ | ||
| 136 | |||
| 137 | extern int acpi_disabled; | 133 | extern int acpi_disabled; |
| 138 | extern int acpi_pci_disabled; | 134 | extern int acpi_pci_disabled; |
| 139 | 135 | ||
diff --git a/include/asm-x86_64/ist.h b/include/asm-x86_64/ist.h new file mode 100644 index 000000000000..338857ecbc68 --- /dev/null +++ b/include/asm-x86_64/ist.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-i386/ist.h> | |||
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h index 9c3f8de90d2d..b897e8cb55fb 100644 --- a/include/asm-x86_64/suspend.h +++ b/include/asm-x86_64/suspend.h | |||
| @@ -44,7 +44,6 @@ extern unsigned long saved_context_eflags; | |||
| 44 | 44 | ||
| 45 | extern void fix_processor_context(void); | 45 | extern void fix_processor_context(void); |
| 46 | 46 | ||
| 47 | #ifdef CONFIG_ACPI_SLEEP | ||
| 48 | extern unsigned long saved_rip; | 47 | extern unsigned long saved_rip; |
| 49 | extern unsigned long saved_rsp; | 48 | extern unsigned long saved_rsp; |
| 50 | extern unsigned long saved_rbp; | 49 | extern unsigned long saved_rbp; |
| @@ -54,4 +53,3 @@ extern unsigned long saved_rdi; | |||
| 54 | 53 | ||
| 55 | /* routines for saving/restoring kernel state */ | 54 | /* routines for saving/restoring kernel state */ |
| 56 | extern int acpi_save_state_mem(void); | 55 | extern int acpi_save_state_mem(void); |
| 57 | #endif | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d5680cd7746a..bf5e0009de75 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | #include <linux/list.h> | 35 | #include <linux/list.h> |
| 36 | #include <linux/mod_devicetable.h> | ||
| 36 | 37 | ||
| 37 | #include <acpi/acpi.h> | 38 | #include <acpi/acpi.h> |
| 38 | #include <acpi/acpi_bus.h> | 39 | #include <acpi/acpi_bus.h> |
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 290aef326812..5f921c84827a 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h | |||
| @@ -21,20 +21,22 @@ typedef unsigned short apm_eventinfo_t; | |||
| 21 | 21 | ||
| 22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
| 23 | 23 | ||
| 24 | #include <linux/types.h> | ||
| 25 | |||
| 24 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) | 26 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) |
| 25 | #define APM_CS_16 (APM_CS + 8) | 27 | #define APM_CS_16 (APM_CS + 8) |
| 26 | #define APM_DS (APM_CS_16 + 8) | 28 | #define APM_DS (APM_CS_16 + 8) |
| 27 | 29 | ||
| 28 | struct apm_bios_info { | 30 | struct apm_bios_info { |
| 29 | unsigned short version; | 31 | u16 version; |
| 30 | unsigned short cseg; | 32 | u16 cseg; |
| 31 | unsigned long offset; | 33 | u32 offset; |
| 32 | unsigned short cseg_16; | 34 | u16 cseg_16; |
| 33 | unsigned short dseg; | 35 | u16 dseg; |
| 34 | unsigned short flags; | 36 | u16 flags; |
| 35 | unsigned short cseg_len; | 37 | u16 cseg_len; |
| 36 | unsigned short cseg_16_len; | 38 | u16 cseg_16_len; |
| 37 | unsigned short dseg_len; | 39 | u16 dseg_len; |
| 38 | }; | 40 | }; |
| 39 | 41 | ||
| 40 | /* Results of APM Installation Check */ | 42 | /* Results of APM Installation Check */ |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index af04a555b52c..2ada8ee316b3 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -159,6 +159,12 @@ struct ap_device_id { | |||
| 159 | 159 | ||
| 160 | #define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 | 160 | #define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 |
| 161 | 161 | ||
| 162 | #define ACPI_ID_LEN 9 | ||
| 163 | |||
| 164 | struct acpi_device_id { | ||
| 165 | __u8 id[ACPI_ID_LEN]; | ||
| 166 | kernel_ulong_t driver_data; | ||
| 167 | }; | ||
| 162 | 168 | ||
| 163 | #define PNP_ID_LEN 8 | 169 | #define PNP_ID_LEN 8 |
| 164 | #define PNP_MAX_DEVICES 8 | 170 | #define PNP_MAX_DEVICES 8 |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 2a1897e6f937..66edb2293184 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
| @@ -335,6 +335,10 @@ struct pnp_protocol { | |||
| 335 | int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res); | 335 | int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res); |
| 336 | int (*disable)(struct pnp_dev *dev); | 336 | int (*disable)(struct pnp_dev *dev); |
| 337 | 337 | ||
| 338 | /* protocol specific suspend/resume */ | ||
| 339 | int (*suspend)(struct pnp_dev *dev, pm_message_t state); | ||
| 340 | int (*resume)(struct pnp_dev *dev); | ||
| 341 | |||
| 338 | /* used by pnp layer only (look but don't touch) */ | 342 | /* used by pnp layer only (look but don't touch) */ |
| 339 | unsigned char number; /* protocol number*/ | 343 | unsigned char number; /* protocol number*/ |
| 340 | struct device dev; /* link to driver model */ | 344 | struct device dev; /* link to driver model */ |
diff --git a/include/linux/time.h b/include/linux/time.h index e6aea5146e5d..6a5f503b4f1d 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -99,15 +99,11 @@ extern int update_persistent_clock(struct timespec now); | |||
| 99 | extern int no_sync_cmos_clock __read_mostly; | 99 | extern int no_sync_cmos_clock __read_mostly; |
| 100 | void timekeeping_init(void); | 100 | void timekeeping_init(void); |
| 101 | 101 | ||
| 102 | static inline unsigned long get_seconds(void) | 102 | unsigned long get_seconds(void); |
| 103 | { | ||
| 104 | return xtime.tv_sec; | ||
| 105 | } | ||
| 106 | |||
| 107 | struct timespec current_kernel_time(void); | 103 | struct timespec current_kernel_time(void); |
| 108 | 104 | ||
| 109 | #define CURRENT_TIME (current_kernel_time()) | 105 | #define CURRENT_TIME (current_kernel_time()) |
| 110 | #define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) | 106 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
| 111 | 107 | ||
| 112 | extern void do_gettimeofday(struct timeval *tv); | 108 | extern void do_gettimeofday(struct timeval *tv); |
| 113 | extern int do_settimeofday(struct timespec *tv); | 109 | extern int do_settimeofday(struct timespec *tv); |
diff --git a/kernel/acct.c b/kernel/acct.c index 70d0d88e5554..24f0f8b2ba72 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
| @@ -468,7 +468,7 @@ static void do_acct_process(struct file *file) | |||
| 468 | } | 468 | } |
| 469 | #endif | 469 | #endif |
| 470 | do_div(elapsed, AHZ); | 470 | do_div(elapsed, AHZ); |
| 471 | ac.ac_btime = xtime.tv_sec - elapsed; | 471 | ac.ac_btime = get_seconds() - elapsed; |
| 472 | /* we really need to bite the bullet and change layout */ | 472 | /* we really need to bite the bullet and change layout */ |
| 473 | ac.ac_uid = current->uid; | 473 | ac.ac_uid = current->uid; |
| 474 | ac.ac_gid = current->gid; | 474 | ac.ac_gid = current->gid; |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index eb1ddebd2c04..c21ca6bfaa66 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
| @@ -141,11 +141,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) | |||
| 141 | 141 | ||
| 142 | do { | 142 | do { |
| 143 | seq = read_seqbegin(&xtime_lock); | 143 | seq = read_seqbegin(&xtime_lock); |
| 144 | #ifdef CONFIG_NO_HZ | 144 | xts = current_kernel_time(); |
| 145 | getnstimeofday(&xts); | ||
| 146 | #else | ||
| 147 | xts = xtime; | ||
| 148 | #endif | ||
| 149 | tom = wall_to_monotonic; | 145 | tom = wall_to_monotonic; |
| 150 | } while (read_seqretry(&xtime_lock, seq)); | 146 | } while (read_seqretry(&xtime_lock, seq)); |
| 151 | 147 | ||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index ddebf3f2affe..eb26f2ba51ed 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -689,7 +689,7 @@ static ctl_table kern_table[] = { | |||
| 689 | .proc_handler = &proc_dointvec, | 689 | .proc_handler = &proc_dointvec, |
| 690 | }, | 690 | }, |
| 691 | #endif | 691 | #endif |
| 692 | #ifdef CONFIG_ACPI_SLEEP | 692 | #if defined(CONFIG_ACPI) && defined(CONFIG_X86) |
| 693 | { | 693 | { |
| 694 | .ctl_name = KERN_ACPI_VIDEO_FLAGS, | 694 | .ctl_name = KERN_ACPI_VIDEO_FLAGS, |
| 695 | .procname = "acpi_video_flags", | 695 | .procname = "acpi_video_flags", |
diff --git a/kernel/time.c b/kernel/time.c index 5b81da08bbdb..2289a8d68314 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
| @@ -215,22 +215,6 @@ asmlinkage long sys_adjtimex(struct timex __user *txc_p) | |||
| 215 | return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret; | 215 | return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | inline struct timespec current_kernel_time(void) | ||
| 219 | { | ||
| 220 | struct timespec now; | ||
| 221 | unsigned long seq; | ||
| 222 | |||
| 223 | do { | ||
| 224 | seq = read_seqbegin(&xtime_lock); | ||
| 225 | |||
| 226 | now = xtime; | ||
| 227 | } while (read_seqretry(&xtime_lock, seq)); | ||
| 228 | |||
| 229 | return now; | ||
| 230 | } | ||
| 231 | |||
| 232 | EXPORT_SYMBOL(current_kernel_time); | ||
| 233 | |||
| 234 | /** | 218 | /** |
| 235 | * current_fs_time - Return FS time | 219 | * current_fs_time - Return FS time |
| 236 | * @sb: Superblock. | 220 | * @sb: Superblock. |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 88c81026e003..acc417b5a9b7 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
| @@ -47,10 +47,22 @@ EXPORT_SYMBOL(xtime_lock); | |||
| 47 | struct timespec xtime __attribute__ ((aligned (16))); | 47 | struct timespec xtime __attribute__ ((aligned (16))); |
| 48 | struct timespec wall_to_monotonic __attribute__ ((aligned (16))); | 48 | struct timespec wall_to_monotonic __attribute__ ((aligned (16))); |
| 49 | static unsigned long total_sleep_time; /* seconds */ | 49 | static unsigned long total_sleep_time; /* seconds */ |
| 50 | |||
| 51 | EXPORT_SYMBOL(xtime); | 50 | EXPORT_SYMBOL(xtime); |
| 52 | 51 | ||
| 53 | 52 | ||
| 53 | #ifdef CONFIG_NO_HZ | ||
| 54 | static struct timespec xtime_cache __attribute__ ((aligned (16))); | ||
| 55 | static inline void update_xtime_cache(u64 nsec) | ||
| 56 | { | ||
| 57 | xtime_cache = xtime; | ||
| 58 | timespec_add_ns(&xtime_cache, nsec); | ||
| 59 | } | ||
| 60 | #else | ||
| 61 | #define xtime_cache xtime | ||
| 62 | /* We do *not* want to evaluate the argument for this case */ | ||
| 63 | #define update_xtime_cache(n) do { } while (0) | ||
| 64 | #endif | ||
| 65 | |||
| 54 | static struct clocksource *clock; /* pointer to current clocksource */ | 66 | static struct clocksource *clock; /* pointer to current clocksource */ |
| 55 | 67 | ||
| 56 | 68 | ||
| @@ -478,6 +490,8 @@ void update_wall_time(void) | |||
| 478 | xtime.tv_nsec = (s64)clock->xtime_nsec >> clock->shift; | 490 | xtime.tv_nsec = (s64)clock->xtime_nsec >> clock->shift; |
| 479 | clock->xtime_nsec -= (s64)xtime.tv_nsec << clock->shift; | 491 | clock->xtime_nsec -= (s64)xtime.tv_nsec << clock->shift; |
| 480 | 492 | ||
| 493 | update_xtime_cache(cyc2ns(clock, offset)); | ||
| 494 | |||
| 481 | /* check to see if there is a new clocksource to use */ | 495 | /* check to see if there is a new clocksource to use */ |
| 482 | change_clocksource(); | 496 | change_clocksource(); |
| 483 | update_vsyscall(&xtime, clock); | 497 | update_vsyscall(&xtime, clock); |
| @@ -509,3 +523,25 @@ void monotonic_to_bootbased(struct timespec *ts) | |||
| 509 | { | 523 | { |
| 510 | ts->tv_sec += total_sleep_time; | 524 | ts->tv_sec += total_sleep_time; |
| 511 | } | 525 | } |
| 526 | |||
| 527 | unsigned long get_seconds(void) | ||
| 528 | { | ||
| 529 | return xtime_cache.tv_sec; | ||
| 530 | } | ||
| 531 | EXPORT_SYMBOL(get_seconds); | ||
| 532 | |||
| 533 | |||
| 534 | struct timespec current_kernel_time(void) | ||
| 535 | { | ||
| 536 | struct timespec now; | ||
| 537 | unsigned long seq; | ||
| 538 | |||
| 539 | do { | ||
| 540 | seq = read_seqbegin(&xtime_lock); | ||
| 541 | |||
| 542 | now = xtime_cache; | ||
| 543 | } while (read_seqretry(&xtime_lock, seq)); | ||
| 544 | |||
| 545 | return now; | ||
| 546 | } | ||
| 547 | EXPORT_SYMBOL(current_kernel_time); | ||
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 658f638c402c..c122131a122f 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
| @@ -39,7 +39,7 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | |||
| 39 | ac_etime = timespec_to_ns(&ts); | 39 | ac_etime = timespec_to_ns(&ts); |
| 40 | do_div(ac_etime, NSEC_PER_USEC); | 40 | do_div(ac_etime, NSEC_PER_USEC); |
| 41 | stats->ac_etime = ac_etime; | 41 | stats->ac_etime = ac_etime; |
| 42 | stats->ac_btime = xtime.tv_sec - ts.tv_sec; | 42 | stats->ac_btime = get_seconds() - ts.tv_sec; |
| 43 | if (thread_group_leader(tsk)) { | 43 | if (thread_group_leader(tsk)) { |
| 44 | stats->ac_exitcode = tsk->exit_code; | 44 | stats->ac_exitcode = tsk->exit_code; |
| 45 | if (tsk->flags & PF_FORKNOEXEC) | 45 | if (tsk->flags & PF_FORKNOEXEC) |
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 16a68df4e36b..c58fa0d1be26 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
| @@ -787,7 +787,7 @@ static int __init af_rxrpc_init(void) | |||
| 787 | 787 | ||
| 788 | BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb)); | 788 | BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb)); |
| 789 | 789 | ||
| 790 | rxrpc_epoch = htonl(xtime.tv_sec); | 790 | rxrpc_epoch = htonl(get_seconds()); |
| 791 | 791 | ||
| 792 | ret = -ENOMEM; | 792 | ret = -ENOMEM; |
| 793 | rxrpc_call_jar = kmem_cache_create( | 793 | rxrpc_call_jar = kmem_cache_create( |
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c index 482750efc235..372b24466dc7 100644 --- a/net/rxrpc/ar-connection.c +++ b/net/rxrpc/ar-connection.c | |||
| @@ -791,7 +791,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn) | |||
| 791 | 791 | ||
| 792 | ASSERTCMP(atomic_read(&conn->usage), >, 0); | 792 | ASSERTCMP(atomic_read(&conn->usage), >, 0); |
| 793 | 793 | ||
| 794 | conn->put_time = xtime.tv_sec; | 794 | conn->put_time = get_seconds(); |
| 795 | if (atomic_dec_and_test(&conn->usage)) { | 795 | if (atomic_dec_and_test(&conn->usage)) { |
| 796 | _debug("zombie"); | 796 | _debug("zombie"); |
| 797 | rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); | 797 | rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); |
| @@ -835,7 +835,7 @@ void rxrpc_connection_reaper(struct work_struct *work) | |||
| 835 | 835 | ||
| 836 | _enter(""); | 836 | _enter(""); |
| 837 | 837 | ||
| 838 | now = xtime.tv_sec; | 838 | now = get_seconds(); |
| 839 | earliest = ULONG_MAX; | 839 | earliest = ULONG_MAX; |
| 840 | 840 | ||
| 841 | write_lock_bh(&rxrpc_connection_lock); | 841 | write_lock_bh(&rxrpc_connection_lock); |
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c index d43d78f19302..bb282a6a19f0 100644 --- a/net/rxrpc/ar-transport.c +++ b/net/rxrpc/ar-transport.c | |||
| @@ -183,7 +183,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans) | |||
| 183 | 183 | ||
| 184 | ASSERTCMP(atomic_read(&trans->usage), >, 0); | 184 | ASSERTCMP(atomic_read(&trans->usage), >, 0); |
| 185 | 185 | ||
| 186 | trans->put_time = xtime.tv_sec; | 186 | trans->put_time = get_seconds(); |
| 187 | if (unlikely(atomic_dec_and_test(&trans->usage))) | 187 | if (unlikely(atomic_dec_and_test(&trans->usage))) |
| 188 | _debug("zombie"); | 188 | _debug("zombie"); |
| 189 | /* let the reaper determine the timeout to avoid a race with | 189 | /* let the reaper determine the timeout to avoid a race with |
| @@ -219,7 +219,7 @@ static void rxrpc_transport_reaper(struct work_struct *work) | |||
| 219 | 219 | ||
| 220 | _enter(""); | 220 | _enter(""); |
| 221 | 221 | ||
| 222 | now = xtime.tv_sec; | 222 | now = get_seconds(); |
| 223 | earliest = ULONG_MAX; | 223 | earliest = ULONG_MAX; |
| 224 | 224 | ||
| 225 | /* extract all the transports that have been dead too long */ | 225 | /* extract all the transports that have been dead too long */ |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 5ec705144e10..ac3cabdca78c 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
| @@ -916,7 +916,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, | |||
| 916 | issue = be32_to_cpu(stamp); | 916 | issue = be32_to_cpu(stamp); |
| 917 | } | 917 | } |
| 918 | p += 4; | 918 | p += 4; |
| 919 | now = xtime.tv_sec; | 919 | now = get_seconds(); |
| 920 | _debug("KIV ISSUE: %lx [%lx]", issue, now); | 920 | _debug("KIV ISSUE: %lx [%lx]", issue, now); |
| 921 | 921 | ||
| 922 | /* check the ticket is in date */ | 922 | /* check the ticket is in date */ |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 3f7b451f3955..7fd6055bedfd 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -315,7 +315,7 @@ quiet_cmd_link_multi-y = LD $@ | |||
| 315 | cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) | 315 | cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) |
| 316 | 316 | ||
| 317 | quiet_cmd_link_multi-m = LD [M] $@ | 317 | quiet_cmd_link_multi-m = LD [M] $@ |
| 318 | cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps) | 318 | cmd_link_multi-m = $(cmd_link_multi-y) |
| 319 | 319 | ||
| 320 | # We would rather have a list of rules like | 320 | # We would rather have a list of rules like |
| 321 | # foo.o: $(foo-objs) | 321 | # foo.o: $(foo-objs) |
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index c6fcc597b3be..d988f5d21e3d 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
| @@ -56,23 +56,24 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) | |||
| 56 | 56 | ||
| 57 | # Step 2), invoke modpost | 57 | # Step 2), invoke modpost |
| 58 | # Includes step 3,4 | 58 | # Includes step 3,4 |
| 59 | modpost = scripts/mod/modpost \ | ||
| 60 | $(if $(CONFIG_MODVERSIONS),-m) \ | ||
| 61 | $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ | ||
| 62 | $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ | ||
| 63 | $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ | ||
| 64 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ | ||
| 65 | $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) | ||
| 66 | |||
| 59 | quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules | 67 | quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules |
| 60 | cmd_modpost = scripts/mod/modpost \ | 68 | cmd_modpost = $(modpost) -s |
| 61 | $(if $(CONFIG_MODVERSIONS),-m) \ | ||
| 62 | $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ | ||
| 63 | $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ | ||
| 64 | $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ | ||
| 65 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ | ||
| 66 | $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) | ||
| 67 | 69 | ||
| 68 | PHONY += __modpost | 70 | PHONY += __modpost |
| 69 | __modpost: $(modules:.ko=.o) FORCE | 71 | __modpost: $(modules:.ko=.o) FORCE |
| 70 | $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^) | 72 | $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^) |
| 71 | 73 | ||
| 72 | quiet_cmd_kernel-mod = MODPOST $@ | 74 | quiet_cmd_kernel-mod = MODPOST $@ |
| 73 | cmd_kernel-mod = $(cmd_modpost) $@ | 75 | cmd_kernel-mod = $(modpost) $@ |
| 74 | 76 | ||
| 75 | PHONY += vmlinux | ||
| 76 | vmlinux.o: FORCE | 77 | vmlinux.o: FORCE |
| 77 | $(call cmd,kernel-mod) | 78 | $(call cmd,kernel-mod) |
| 78 | 79 | ||
| @@ -97,7 +98,7 @@ targets += $(modules:.ko=.mod.o) | |||
| 97 | 98 | ||
| 98 | # Step 6), final link of the modules | 99 | # Step 6), final link of the modules |
| 99 | quiet_cmd_ld_ko_o = LD [M] $@ | 100 | quiet_cmd_ld_ko_o = LD [M] $@ |
| 100 | cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \ | 101 | cmd_ld_ko_o = $(LD) -r $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \ |
| 101 | $(filter-out FORCE,$^) | 102 | $(filter-out FORCE,$^) |
| 102 | 103 | ||
| 103 | $(modules): %.ko :%.o %.mod.o FORCE | 104 | $(modules): %.ko :%.o %.mod.o FORCE |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 1199baf866ca..8be6a4269e63 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
| @@ -37,6 +37,14 @@ static struct menu *rootEntry; | |||
| 37 | 37 | ||
| 38 | static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); | 38 | static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); |
| 39 | 39 | ||
| 40 | static const char *get_help(struct menu *menu) | ||
| 41 | { | ||
| 42 | if (menu_has_help(menu)) | ||
| 43 | return menu_get_help(menu); | ||
| 44 | else | ||
| 45 | return nohelp_text; | ||
| 46 | } | ||
| 47 | |||
| 40 | static void strip(char *str) | 48 | static void strip(char *str) |
| 41 | { | 49 | { |
| 42 | char *p = str; | 50 | char *p = str; |
| @@ -171,7 +179,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) | |||
| 171 | int conf_string(struct menu *menu) | 179 | int conf_string(struct menu *menu) |
| 172 | { | 180 | { |
| 173 | struct symbol *sym = menu->sym; | 181 | struct symbol *sym = menu->sym; |
| 174 | const char *def, *help; | 182 | const char *def; |
| 175 | 183 | ||
| 176 | while (1) { | 184 | while (1) { |
| 177 | printf("%*s%s ", indent - 1, "", menu->prompt->text); | 185 | printf("%*s%s ", indent - 1, "", menu->prompt->text); |
| @@ -186,10 +194,7 @@ int conf_string(struct menu *menu) | |||
| 186 | case '?': | 194 | case '?': |
| 187 | /* print help */ | 195 | /* print help */ |
| 188 | if (line[1] == '\n') { | 196 | if (line[1] == '\n') { |
| 189 | help = nohelp_text; | 197 | printf("\n%s\n", get_help(menu)); |
| 190 | if (menu->sym->help) | ||
| 191 | help = menu->sym->help; | ||
| 192 | printf("\n%s\n", menu->sym->help); | ||
| 193 | def = NULL; | 198 | def = NULL; |
| 194 | break; | 199 | break; |
| 195 | } | 200 | } |
| @@ -207,7 +212,6 @@ static int conf_sym(struct menu *menu) | |||
| 207 | struct symbol *sym = menu->sym; | 212 | struct symbol *sym = menu->sym; |
| 208 | int type; | 213 | int type; |
| 209 | tristate oldval, newval; | 214 | tristate oldval, newval; |
| 210 | const char *help; | ||
| 211 | 215 | ||
| 212 | while (1) { | 216 | while (1) { |
| 213 | printf("%*s%s ", indent - 1, "", menu->prompt->text); | 217 | printf("%*s%s ", indent - 1, "", menu->prompt->text); |
| @@ -233,7 +237,7 @@ static int conf_sym(struct menu *menu) | |||
| 233 | printf("/m"); | 237 | printf("/m"); |
| 234 | if (oldval != yes && sym_tristate_within_range(sym, yes)) | 238 | if (oldval != yes && sym_tristate_within_range(sym, yes)) |
| 235 | printf("/y"); | 239 | printf("/y"); |
| 236 | if (sym->help) | 240 | if (menu_has_help(menu)) |
| 237 | printf("/?"); | 241 | printf("/?"); |
| 238 | printf("] "); | 242 | printf("] "); |
| 239 | conf_askvalue(sym, sym_get_string_value(sym)); | 243 | conf_askvalue(sym, sym_get_string_value(sym)); |
| @@ -269,10 +273,7 @@ static int conf_sym(struct menu *menu) | |||
| 269 | if (sym_set_tristate_value(sym, newval)) | 273 | if (sym_set_tristate_value(sym, newval)) |
| 270 | return 0; | 274 | return 0; |
| 271 | help: | 275 | help: |
| 272 | help = nohelp_text; | 276 | printf("\n%s\n", get_help(menu)); |
| 273 | if (sym->help) | ||
| 274 | help = sym->help; | ||
| 275 | printf("\n%s\n", help); | ||
| 276 | } | 277 | } |
| 277 | } | 278 | } |
| 278 | 279 | ||
| @@ -342,7 +343,7 @@ static int conf_choice(struct menu *menu) | |||
| 342 | goto conf_childs; | 343 | goto conf_childs; |
| 343 | } | 344 | } |
| 344 | printf("[1-%d", cnt); | 345 | printf("[1-%d", cnt); |
| 345 | if (sym->help) | 346 | if (menu_has_help(menu)) |
| 346 | printf("?"); | 347 | printf("?"); |
| 347 | printf("]: "); | 348 | printf("]: "); |
| 348 | switch (input_mode) { | 349 | switch (input_mode) { |
| @@ -359,8 +360,7 @@ static int conf_choice(struct menu *menu) | |||
| 359 | fgets(line, 128, stdin); | 360 | fgets(line, 128, stdin); |
| 360 | strip(line); | 361 | strip(line); |
| 361 | if (line[0] == '?') { | 362 | if (line[0] == '?') { |
| 362 | printf("\n%s\n", menu->sym->help ? | 363 | printf("\n%s\n", get_help(menu)); |
| 363 | menu->sym->help : nohelp_text); | ||
| 364 | continue; | 364 | continue; |
| 365 | } | 365 | } |
| 366 | if (!line[0]) | 366 | if (!line[0]) |
| @@ -391,8 +391,7 @@ static int conf_choice(struct menu *menu) | |||
| 391 | if (!child) | 391 | if (!child) |
| 392 | continue; | 392 | continue; |
| 393 | if (line[strlen(line) - 1] == '?') { | 393 | if (line[strlen(line) - 1] == '?') { |
| 394 | printf("\n%s\n", child->sym->help ? | 394 | printf("\n%s\n", get_help(child)); |
| 395 | child->sym->help : nohelp_text); | ||
| 396 | continue; | 395 | continue; |
| 397 | } | 396 | } |
| 398 | sym_set_choice_value(sym, child->sym); | 397 | sym_set_choice_value(sym, child->sym); |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 6084525f604b..a195986eec6f 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -71,14 +71,12 @@ enum { | |||
| 71 | struct symbol { | 71 | struct symbol { |
| 72 | struct symbol *next; | 72 | struct symbol *next; |
| 73 | char *name; | 73 | char *name; |
| 74 | char *help; | ||
| 75 | enum symbol_type type; | 74 | enum symbol_type type; |
| 76 | struct symbol_value curr; | 75 | struct symbol_value curr; |
| 77 | struct symbol_value def[4]; | 76 | struct symbol_value def[4]; |
| 78 | tristate visible; | 77 | tristate visible; |
| 79 | int flags; | 78 | int flags; |
| 80 | struct property *prop; | 79 | struct property *prop; |
| 81 | struct expr *dep, *dep2; | ||
| 82 | struct expr_value rev_dep; | 80 | struct expr_value rev_dep; |
| 83 | }; | 81 | }; |
| 84 | 82 | ||
| @@ -139,7 +137,7 @@ struct menu { | |||
| 139 | struct property *prompt; | 137 | struct property *prompt; |
| 140 | struct expr *dep; | 138 | struct expr *dep; |
| 141 | unsigned int flags; | 139 | unsigned int flags; |
| 142 | //char *help; | 140 | char *help; |
| 143 | struct file *file; | 141 | struct file *file; |
| 144 | int lineno; | 142 | int lineno; |
| 145 | void *data; | 143 | void *data; |
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 61d8166166ef..262908cfc2ac 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c | |||
| @@ -38,9 +38,6 @@ static gboolean show_all = FALSE; | |||
| 38 | static gboolean show_debug = FALSE; | 38 | static gboolean show_debug = FALSE; |
| 39 | static gboolean resizeable = FALSE; | 39 | static gboolean resizeable = FALSE; |
| 40 | 40 | ||
| 41 | static char nohelp_text[] = | ||
| 42 | N_("Sorry, no help available for this option yet.\n"); | ||
| 43 | |||
| 44 | GtkWidget *main_wnd = NULL; | 41 | GtkWidget *main_wnd = NULL; |
| 45 | GtkWidget *tree1_w = NULL; // left frame | 42 | GtkWidget *tree1_w = NULL; // left frame |
| 46 | GtkWidget *tree2_w = NULL; // right frame | 43 | GtkWidget *tree2_w = NULL; // right frame |
| @@ -462,12 +459,9 @@ static void text_insert_help(struct menu *menu) | |||
| 462 | GtkTextIter start, end; | 459 | GtkTextIter start, end; |
| 463 | const char *prompt = menu_get_prompt(menu); | 460 | const char *prompt = menu_get_prompt(menu); |
| 464 | gchar *name; | 461 | gchar *name; |
| 465 | const char *help = _(nohelp_text); | 462 | const char *help; |
| 466 | 463 | ||
| 467 | if (!menu->sym) | 464 | help = _(menu_get_help(menu)); |
| 468 | help = ""; | ||
| 469 | else if (menu->sym->help) | ||
| 470 | help = _(menu->sym->help); | ||
| 471 | 465 | ||
| 472 | if (menu->sym && menu->sym->name) | 466 | if (menu->sym && menu->sym->name) |
| 473 | name = g_strdup_printf(_(menu->sym->name)); | 467 | name = g_strdup_printf(_(menu->sym->name)); |
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c index 11f7dab94715..6eb72a7f2562 100644 --- a/scripts/kconfig/kxgettext.c +++ b/scripts/kconfig/kxgettext.c | |||
| @@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu) | |||
| 170 | menu->file == NULL ? "Root Menu" : menu->file->name, | 170 | menu->file == NULL ? "Root Menu" : menu->file->name, |
| 171 | menu->lineno); | 171 | menu->lineno); |
| 172 | 172 | ||
| 173 | if (menu->sym != NULL && menu->sym->help != NULL) | 173 | if (menu->sym != NULL && menu_has_help(menu)) |
| 174 | message__add(menu->sym->help, menu->sym->name, | 174 | message__add(menu_get_help(menu), menu->sym->name, |
| 175 | menu->file == NULL ? "Root Menu" : menu->file->name, | 175 | menu->file == NULL ? "Root Menu" : menu->file->name, |
| 176 | menu->lineno); | 176 | menu->lineno); |
| 177 | 177 | ||
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 15030770d1ad..4d09f6ddefe3 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
| @@ -15,6 +15,8 @@ P(menu_is_visible,bool,(struct menu *menu)); | |||
| 15 | P(menu_get_prompt,const char *,(struct menu *menu)); | 15 | P(menu_get_prompt,const char *,(struct menu *menu)); |
| 16 | P(menu_get_root_menu,struct menu *,(struct menu *menu)); | 16 | P(menu_get_root_menu,struct menu *,(struct menu *menu)); |
| 17 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); | 17 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); |
| 18 | P(menu_has_help,bool,(struct menu *menu)); | ||
| 19 | P(menu_get_help,const char *,(struct menu *menu)); | ||
| 18 | 20 | ||
| 19 | /* symbol.c */ | 21 | /* symbol.c */ |
| 20 | P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); | 22 | P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index d2c2a429887b..bc5854ed6055 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
| @@ -725,11 +725,11 @@ static void show_help(struct menu *menu) | |||
| 725 | struct gstr help = str_new(); | 725 | struct gstr help = str_new(); |
| 726 | struct symbol *sym = menu->sym; | 726 | struct symbol *sym = menu->sym; |
| 727 | 727 | ||
| 728 | if (sym->help) | 728 | if (menu_has_help(menu)) |
| 729 | { | 729 | { |
| 730 | if (sym->name) { | 730 | if (sym->name) { |
| 731 | str_printf(&help, "CONFIG_%s:\n\n", sym->name); | 731 | str_printf(&help, "CONFIG_%s:\n\n", sym->name); |
| 732 | str_append(&help, _(sym->help)); | 732 | str_append(&help, _(menu_get_help(menu))); |
| 733 | str_append(&help, "\n"); | 733 | str_append(&help, "\n"); |
| 734 | } | 734 | } |
| 735 | } else { | 735 | } else { |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index f14aeac67d4f..f9d0d91a3fe4 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
| @@ -417,3 +417,15 @@ struct menu *menu_get_parent_menu(struct menu *menu) | |||
| 417 | return menu; | 417 | return menu; |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | bool menu_has_help(struct menu *menu) | ||
| 421 | { | ||
| 422 | return menu->help != NULL; | ||
| 423 | } | ||
| 424 | |||
| 425 | const char *menu_get_help(struct menu *menu) | ||
| 426 | { | ||
| 427 | if (menu->help) | ||
| 428 | return menu->help; | ||
| 429 | else | ||
| 430 | return ""; | ||
| 431 | } | ||
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index f2a23a9c3938..e4eeb59a8c24 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
| @@ -1041,7 +1041,7 @@ void ConfigInfoView::menuInfo(void) | |||
| 1041 | if (showDebug()) | 1041 | if (showDebug()) |
| 1042 | debug = debug_info(sym); | 1042 | debug = debug_info(sym); |
| 1043 | 1043 | ||
| 1044 | help = print_filter(_(sym->help)); | 1044 | help = print_filter(_(menu_get_help(menu))); |
| 1045 | } else if (menu->prompt) { | 1045 | } else if (menu->prompt) { |
| 1046 | head += "<big><b>"; | 1046 | head += "<big><b>"; |
| 1047 | head += print_filter(_(menu->prompt->text)); | 1047 | head += print_filter(_(menu->prompt->text)); |
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index 9a06b6771eee..ec21db77f78b 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped | |||
| @@ -1722,7 +1722,7 @@ yyreduce: | |||
| 1722 | case 83: | 1722 | case 83: |
| 1723 | 1723 | ||
| 1724 | { | 1724 | { |
| 1725 | current_entry->sym->help = (yyvsp[0].string); | 1725 | current_entry->help = (yyvsp[0].string); |
| 1726 | ;} | 1726 | ;} |
| 1727 | break; | 1727 | break; |
| 1728 | 1728 | ||
| @@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu) | |||
| 2280 | break; | 2280 | break; |
| 2281 | } | 2281 | } |
| 2282 | } | 2282 | } |
| 2283 | if (sym->help) { | 2283 | if (menu->help) { |
| 2284 | int len = strlen(sym->help); | 2284 | int len = strlen(menu->help); |
| 2285 | while (sym->help[--len] == '\n') | 2285 | while (menu->help[--len] == '\n') |
| 2286 | sym->help[len] = 0; | 2286 | menu->help[len] = 0; |
| 2287 | fprintf(out, " help\n%s\n", sym->help); | 2287 | fprintf(out, " help\n%s\n", menu->help); |
| 2288 | } | 2288 | } |
| 2289 | fputc('\n', out); | 2289 | fputc('\n', out); |
| 2290 | } | 2290 | } |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 92eb02bdf9c5..79db4cf22a51 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
| @@ -402,7 +402,7 @@ help_start: T_HELP T_EOL | |||
| 402 | 402 | ||
| 403 | help: help_start T_HELPTEXT | 403 | help: help_start T_HELPTEXT |
| 404 | { | 404 | { |
| 405 | current_entry->sym->help = $2; | 405 | current_entry->help = $2; |
| 406 | }; | 406 | }; |
| 407 | 407 | ||
| 408 | /* depends option */ | 408 | /* depends option */ |
| @@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu) | |||
| 649 | break; | 649 | break; |
| 650 | } | 650 | } |
| 651 | } | 651 | } |
| 652 | if (sym->help) { | 652 | if (menu->help) { |
| 653 | int len = strlen(sym->help); | 653 | int len = strlen(menu->help); |
| 654 | while (sym->help[--len] == '\n') | 654 | while (menu->help[--len] == '\n') |
| 655 | sym->help[len] = 0; | 655 | menu->help[len] = 0; |
| 656 | fprintf(out, " help\n%s\n", sym->help); | 656 | fprintf(out, " help\n%s\n", menu->help); |
| 657 | } | 657 | } |
| 658 | fputc('\n', out); | 658 | fputc('\n', out); |
| 659 | } | 659 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index f646381dc015..8a09021d8c59 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -290,6 +290,14 @@ static int do_serio_entry(const char *filename, | |||
| 290 | return 1; | 290 | return 1; |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | /* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */ | ||
| 294 | static int do_acpi_entry(const char *filename, | ||
| 295 | struct acpi_device_id *id, char *alias) | ||
| 296 | { | ||
| 297 | sprintf(alias, "acpi*:%s:", id->id); | ||
| 298 | return 1; | ||
| 299 | } | ||
| 300 | |||
| 293 | /* looks like: "pnp:dD" */ | 301 | /* looks like: "pnp:dD" */ |
| 294 | static int do_pnp_entry(const char *filename, | 302 | static int do_pnp_entry(const char *filename, |
| 295 | struct pnp_device_id *id, char *alias) | 303 | struct pnp_device_id *id, char *alias) |
| @@ -551,6 +559,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 551 | do_table(symval, sym->st_size, | 559 | do_table(symval, sym->st_size, |
| 552 | sizeof(struct serio_device_id), "serio", | 560 | sizeof(struct serio_device_id), "serio", |
| 553 | do_serio_entry, mod); | 561 | do_serio_entry, mod); |
| 562 | else if (sym_is(symname, "__mod_acpi_device_table")) | ||
| 563 | do_table(symval, sym->st_size, | ||
| 564 | sizeof(struct acpi_device_id), "acpi", | ||
| 565 | do_acpi_entry, mod); | ||
| 554 | else if (sym_is(symname, "__mod_pnp_device_table")) | 566 | else if (sym_is(symname, "__mod_pnp_device_table")) |
| 555 | do_table(symval, sym->st_size, | 567 | do_table(symval, sym->st_size, |
| 556 | sizeof(struct pnp_device_id), "pnp", | 568 | sizeof(struct pnp_device_id), "pnp", |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 5ab7914d30ef..ee58ded021d7 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -23,6 +23,8 @@ int have_vmlinux = 0; | |||
| 23 | static int all_versions = 0; | 23 | static int all_versions = 0; |
| 24 | /* If we are modposting external module set to 1 */ | 24 | /* If we are modposting external module set to 1 */ |
| 25 | static int external_module = 0; | 25 | static int external_module = 0; |
| 26 | /* Warn about section mismatch in vmlinux if set to 1 */ | ||
| 27 | static int vmlinux_section_warnings = 1; | ||
| 26 | /* Only warn about unresolved symbols */ | 28 | /* Only warn about unresolved symbols */ |
| 27 | static int warn_unresolved = 0; | 29 | static int warn_unresolved = 0; |
| 28 | /* How a symbol is exported */ | 30 | /* How a symbol is exported */ |
| @@ -584,13 +586,61 @@ static int strrcmp(const char *s, const char *sub) | |||
| 584 | return memcmp(s + slen - sublen, sub, sublen); | 586 | return memcmp(s + slen - sublen, sub, sublen); |
| 585 | } | 587 | } |
| 586 | 588 | ||
| 589 | /* | ||
| 590 | * Functions used only during module init is marked __init and is stored in | ||
| 591 | * a .init.text section. Likewise data is marked __initdata and stored in | ||
| 592 | * a .init.data section. | ||
| 593 | * If this section is one of these sections return 1 | ||
| 594 | * See include/linux/init.h for the details | ||
| 595 | */ | ||
| 596 | static int init_section(const char *name) | ||
| 597 | { | ||
| 598 | if (strcmp(name, ".init") == 0) | ||
| 599 | return 1; | ||
| 600 | if (strncmp(name, ".init.", strlen(".init.")) == 0) | ||
| 601 | return 1; | ||
| 602 | return 0; | ||
| 603 | } | ||
| 604 | |||
| 605 | /* | ||
| 606 | * Functions used only during module exit is marked __exit and is stored in | ||
| 607 | * a .exit.text section. Likewise data is marked __exitdata and stored in | ||
| 608 | * a .exit.data section. | ||
| 609 | * If this section is one of these sections return 1 | ||
| 610 | * See include/linux/init.h for the details | ||
| 611 | **/ | ||
| 612 | static int exit_section(const char *name) | ||
| 613 | { | ||
| 614 | if (strcmp(name, ".exit.text") == 0) | ||
| 615 | return 1; | ||
| 616 | if (strcmp(name, ".exit.data") == 0) | ||
| 617 | return 1; | ||
| 618 | return 0; | ||
| 619 | |||
| 620 | } | ||
| 621 | |||
| 622 | /* | ||
| 623 | * Data sections are named like this: | ||
| 624 | * .data | .data.rel | .data.rel.* | ||
| 625 | * Return 1 if the specified section is a data section | ||
| 626 | */ | ||
| 627 | static int data_section(const char *name) | ||
| 628 | { | ||
| 629 | if ((strcmp(name, ".data") == 0) || | ||
| 630 | (strcmp(name, ".data.rel") == 0) || | ||
| 631 | (strncmp(name, ".data.rel.", strlen(".data.rel.")) == 0)) | ||
| 632 | return 1; | ||
| 633 | else | ||
| 634 | return 0; | ||
| 635 | } | ||
| 636 | |||
| 587 | /** | 637 | /** |
| 588 | * Whitelist to allow certain references to pass with no warning. | 638 | * Whitelist to allow certain references to pass with no warning. |
| 589 | * | 639 | * |
| 590 | * Pattern 0: | 640 | * Pattern 0: |
| 591 | * Do not warn if funtion/data are marked with __init_refok/__initdata_refok. | 641 | * Do not warn if funtion/data are marked with __init_refok/__initdata_refok. |
| 592 | * The pattern is identified by: | 642 | * The pattern is identified by: |
| 593 | * fromsec = .text.init.refok | .data.init.refok | 643 | * fromsec = .text.init.refok* | .data.init.refok* |
| 594 | * | 644 | * |
| 595 | * Pattern 1: | 645 | * Pattern 1: |
| 596 | * If a module parameter is declared __initdata and permissions=0 | 646 | * If a module parameter is declared __initdata and permissions=0 |
| @@ -608,8 +658,8 @@ static int strrcmp(const char *s, const char *sub) | |||
| 608 | * These functions may often be marked __init and we do not want to | 658 | * These functions may often be marked __init and we do not want to |
| 609 | * warn here. | 659 | * warn here. |
| 610 | * the pattern is identified by: | 660 | * the pattern is identified by: |
| 611 | * tosec = .init.text | .exit.text | .init.data | 661 | * tosec = init or exit section |
| 612 | * fromsec = .data | .data.rel | .data.rel.* | 662 | * fromsec = data section |
| 613 | * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer | 663 | * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer |
| 614 | * | 664 | * |
| 615 | * Pattern 3: | 665 | * Pattern 3: |
| @@ -625,12 +675,18 @@ static int strrcmp(const char *s, const char *sub) | |||
| 625 | * This pattern is identified by | 675 | * This pattern is identified by |
| 626 | * refsymname = __init_begin, _sinittext, _einittext | 676 | * refsymname = __init_begin, _sinittext, _einittext |
| 627 | * | 677 | * |
| 678 | * Pattern 5: | ||
| 679 | * Xtensa uses literal sections for constants that are accessed PC-relative. | ||
| 680 | * Literal sections may safely reference their text sections. | ||
| 681 | * (Note that the name for the literal section omits any trailing '.text') | ||
| 682 | * tosec = <section>[.text] | ||
| 683 | * fromsec = <section>.literal | ||
| 628 | **/ | 684 | **/ |
| 629 | static int secref_whitelist(const char *modname, const char *tosec, | 685 | static int secref_whitelist(const char *modname, const char *tosec, |
| 630 | const char *fromsec, const char *atsym, | 686 | const char *fromsec, const char *atsym, |
| 631 | const char *refsymname) | 687 | const char *refsymname) |
| 632 | { | 688 | { |
| 633 | int f1 = 1, f2 = 1; | 689 | int len; |
| 634 | const char **s; | 690 | const char **s; |
| 635 | const char *pat2sym[] = { | 691 | const char *pat2sym[] = { |
| 636 | "driver", | 692 | "driver", |
| @@ -652,36 +708,21 @@ static int secref_whitelist(const char *modname, const char *tosec, | |||
| 652 | }; | 708 | }; |
| 653 | 709 | ||
| 654 | /* Check for pattern 0 */ | 710 | /* Check for pattern 0 */ |
| 655 | if ((strcmp(fromsec, ".text.init.refok") == 0) || | 711 | if ((strncmp(fromsec, ".text.init.refok", strlen(".text.init.refok")) == 0) || |
| 656 | (strcmp(fromsec, ".data.init.refok") == 0)) | 712 | (strncmp(fromsec, ".data.init.refok", strlen(".data.init.refok")) == 0)) |
| 657 | return 1; | 713 | return 1; |
| 658 | 714 | ||
| 659 | /* Check for pattern 1 */ | 715 | /* Check for pattern 1 */ |
| 660 | if (strcmp(tosec, ".init.data") != 0) | 716 | if ((strcmp(tosec, ".init.data") == 0) && |
| 661 | f1 = 0; | 717 | (strncmp(fromsec, ".data", strlen(".data")) == 0) && |
| 662 | if (strncmp(fromsec, ".data", strlen(".data")) != 0) | 718 | (strncmp(atsym, "__param", strlen("__param")) == 0)) |
| 663 | f1 = 0; | 719 | return 1; |
| 664 | if (strncmp(atsym, "__param", strlen("__param")) != 0) | ||
| 665 | f1 = 0; | ||
| 666 | |||
| 667 | if (f1) | ||
| 668 | return f1; | ||
| 669 | 720 | ||
| 670 | /* Check for pattern 2 */ | 721 | /* Check for pattern 2 */ |
| 671 | if ((strcmp(tosec, ".init.text") != 0) && | 722 | if ((init_section(tosec) || exit_section(tosec)) && data_section(fromsec)) |
| 672 | (strcmp(tosec, ".exit.text") != 0) && | 723 | for (s = pat2sym; *s; s++) |
| 673 | (strcmp(tosec, ".init.data") != 0)) | 724 | if (strrcmp(atsym, *s) == 0) |
| 674 | f2 = 0; | 725 | return 1; |
| 675 | if ((strcmp(fromsec, ".data") != 0) && | ||
| 676 | (strcmp(fromsec, ".data.rel") != 0) && | ||
| 677 | (strncmp(fromsec, ".data.rel.", strlen(".data.rel.")) != 0)) | ||
| 678 | f2 = 0; | ||
| 679 | |||
| 680 | for (s = pat2sym; *s; s++) | ||
| 681 | if (strrcmp(atsym, *s) == 0) | ||
| 682 | f1 = 1; | ||
| 683 | if (f1 && f2) | ||
| 684 | return 1; | ||
| 685 | 726 | ||
| 686 | /* Check for pattern 3 */ | 727 | /* Check for pattern 3 */ |
| 687 | if ((strcmp(fromsec, ".text.head") == 0) && | 728 | if ((strcmp(fromsec, ".text.head") == 0) && |
| @@ -694,6 +735,15 @@ static int secref_whitelist(const char *modname, const char *tosec, | |||
| 694 | if (strcmp(refsymname, *s) == 0) | 735 | if (strcmp(refsymname, *s) == 0) |
| 695 | return 1; | 736 | return 1; |
| 696 | 737 | ||
| 738 | /* Check for pattern 5 */ | ||
| 739 | if (strrcmp(tosec, ".text") == 0) | ||
| 740 | len = strlen(tosec) - strlen(".text"); | ||
| 741 | else | ||
| 742 | len = strlen(tosec); | ||
| 743 | if ((strncmp(tosec, fromsec, len) == 0) && (strlen(fromsec) > len) && | ||
| 744 | (strcmp(fromsec + len, ".literal") == 0)) | ||
| 745 | return 1; | ||
| 746 | |||
| 697 | return 0; | 747 | return 0; |
| 698 | } | 748 | } |
| 699 | 749 | ||
| @@ -822,9 +872,9 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec, | |||
| 822 | refsymname = elf->strtab + refsym->st_name; | 872 | refsymname = elf->strtab + refsym->st_name; |
| 823 | 873 | ||
| 824 | /* check whitelist - we may ignore it */ | 874 | /* check whitelist - we may ignore it */ |
| 825 | if (before && | 875 | if (secref_whitelist(modname, secname, fromsec, |
| 826 | secref_whitelist(modname, secname, fromsec, | 876 | before ? elf->strtab + before->st_name : "", |
| 827 | elf->strtab + before->st_name, refsymname)) | 877 | refsymname)) |
| 828 | return; | 878 | return; |
| 829 | 879 | ||
| 830 | if (before && after) { | 880 | if (before && after) { |
| @@ -1077,6 +1127,8 @@ static int initexit_section_ref_ok(const char *name) | |||
| 1077 | ".smp_locks", | 1127 | ".smp_locks", |
| 1078 | ".stab", | 1128 | ".stab", |
| 1079 | ".m68k_fixup", | 1129 | ".m68k_fixup", |
| 1130 | ".xt.prop", /* xtensa informational section */ | ||
| 1131 | ".xt.lit", /* xtensa informational section */ | ||
| 1080 | NULL | 1132 | NULL |
| 1081 | }; | 1133 | }; |
| 1082 | /* Start of section names */ | 1134 | /* Start of section names */ |
| @@ -1106,21 +1158,6 @@ static int initexit_section_ref_ok(const char *name) | |||
| 1106 | return 0; | 1158 | return 0; |
| 1107 | } | 1159 | } |
| 1108 | 1160 | ||
| 1109 | /** | ||
| 1110 | * Functions used only during module init is marked __init and is stored in | ||
| 1111 | * a .init.text section. Likewise data is marked __initdata and stored in | ||
| 1112 | * a .init.data section. | ||
| 1113 | * If this section is one of these sections return 1 | ||
| 1114 | * See include/linux/init.h for the details | ||
| 1115 | **/ | ||
| 1116 | static int init_section(const char *name) | ||
| 1117 | { | ||
| 1118 | if (strcmp(name, ".init") == 0) | ||
| 1119 | return 1; | ||
| 1120 | if (strncmp(name, ".init.", strlen(".init.")) == 0) | ||
| 1121 | return 1; | ||
| 1122 | return 0; | ||
| 1123 | } | ||
| 1124 | 1161 | ||
| 1125 | /* | 1162 | /* |
| 1126 | * Identify sections from which references to a .init section is OK. | 1163 | * Identify sections from which references to a .init section is OK. |
| @@ -1178,23 +1215,6 @@ static int init_section_ref_ok(const char *name) | |||
| 1178 | } | 1215 | } |
| 1179 | 1216 | ||
| 1180 | /* | 1217 | /* |
| 1181 | * Functions used only during module exit is marked __exit and is stored in | ||
| 1182 | * a .exit.text section. Likewise data is marked __exitdata and stored in | ||
| 1183 | * a .exit.data section. | ||
| 1184 | * If this section is one of these sections return 1 | ||
| 1185 | * See include/linux/init.h for the details | ||
| 1186 | **/ | ||
| 1187 | static int exit_section(const char *name) | ||
| 1188 | { | ||
| 1189 | if (strcmp(name, ".exit.text") == 0) | ||
| 1190 | return 1; | ||
| 1191 | if (strcmp(name, ".exit.data") == 0) | ||
| 1192 | return 1; | ||
| 1193 | return 0; | ||
| 1194 | |||
| 1195 | } | ||
| 1196 | |||
| 1197 | /* | ||
| 1198 | * Identify sections from which references to a .exit section is OK. | 1218 | * Identify sections from which references to a .exit section is OK. |
| 1199 | */ | 1219 | */ |
| 1200 | static int exit_section_ref_ok(const char *name) | 1220 | static int exit_section_ref_ok(const char *name) |
| @@ -1257,8 +1277,10 @@ static void read_symbols(char *modname) | |||
| 1257 | handle_modversions(mod, &info, sym, symname); | 1277 | handle_modversions(mod, &info, sym, symname); |
| 1258 | handle_moddevtable(mod, &info, sym, symname); | 1278 | handle_moddevtable(mod, &info, sym, symname); |
| 1259 | } | 1279 | } |
| 1260 | check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok); | 1280 | if (is_vmlinux(modname) && vmlinux_section_warnings) { |
| 1261 | check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok); | 1281 | check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok); |
| 1282 | check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok); | ||
| 1283 | } | ||
| 1262 | 1284 | ||
| 1263 | version = get_modinfo(info.modinfo, info.modinfo_len, "version"); | 1285 | version = get_modinfo(info.modinfo, info.modinfo_len, "version"); |
| 1264 | if (version) | 1286 | if (version) |
| @@ -1626,7 +1648,7 @@ int main(int argc, char **argv) | |||
| 1626 | int opt; | 1648 | int opt; |
| 1627 | int err; | 1649 | int err; |
| 1628 | 1650 | ||
| 1629 | while ((opt = getopt(argc, argv, "i:I:mo:aw")) != -1) { | 1651 | while ((opt = getopt(argc, argv, "i:I:mso:aw")) != -1) { |
| 1630 | switch(opt) { | 1652 | switch(opt) { |
| 1631 | case 'i': | 1653 | case 'i': |
| 1632 | kernel_read = optarg; | 1654 | kernel_read = optarg; |
| @@ -1644,6 +1666,9 @@ int main(int argc, char **argv) | |||
| 1644 | case 'a': | 1666 | case 'a': |
| 1645 | all_versions = 1; | 1667 | all_versions = 1; |
| 1646 | break; | 1668 | break; |
| 1669 | case 's': | ||
| 1670 | vmlinux_section_warnings = 0; | ||
| 1671 | break; | ||
| 1647 | case 'w': | 1672 | case 'w': |
| 1648 | warn_unresolved = 1; | 1673 | warn_unresolved = 1; |
| 1649 | break; | 1674 | break; |
diff --git a/scripts/ver_linux b/scripts/ver_linux index 72876dfadc8a..8f8df93141a9 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux | |||
| @@ -66,8 +66,8 @@ showmount --version 2>&1 | grep nfs-utils | awk \ | |||
| 66 | 'NR==1{print "nfs-utils ", $NF}' | 66 | 'NR==1{print "nfs-utils ", $NF}' |
| 67 | 67 | ||
| 68 | ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ | 68 | ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ |
| 69 | -e 's/\.so$//' | awk -F'[.-]' '{print "Linux C Library " \ | 69 | -e 's/\.so$//' | sed -e 's/>//' | \ |
| 70 | $(NF-2)"."$(NF-1)"."$NF}' | 70 | awk -F'[.-]' '{print "Linux C Library "$(NF-1)"."$NF}' |
| 71 | 71 | ||
| 72 | ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ | 72 | ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ |
| 73 | 'NR==1{print "Dynamic linker (ldd) ", $NF}' | 73 | 'NR==1{print "Dynamic linker (ldd) ", $NF}' |
diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index bd8d1ef40a90..ba715f40b658 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c | |||
| @@ -216,7 +216,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, | |||
| 216 | return -ENOMEM; | 216 | return -ENOMEM; |
| 217 | 217 | ||
| 218 | *ctxp = ctx = kmalloc(sizeof(*ctx) + | 218 | *ctxp = ctx = kmalloc(sizeof(*ctx) + |
| 219 | uctx->ctx_len, | 219 | uctx->ctx_len + 1, |
| 220 | GFP_KERNEL); | 220 | GFP_KERNEL); |
| 221 | 221 | ||
| 222 | if (!ctx) | 222 | if (!ctx) |
| @@ -229,6 +229,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, | |||
| 229 | memcpy(ctx->ctx_str, | 229 | memcpy(ctx->ctx_str, |
| 230 | uctx+1, | 230 | uctx+1, |
| 231 | ctx->ctx_len); | 231 | ctx->ctx_len); |
| 232 | ctx->ctx_str[ctx->ctx_len] = 0; | ||
| 232 | rc = security_context_to_sid(ctx->ctx_str, | 233 | rc = security_context_to_sid(ctx->ctx_str, |
| 233 | ctx->ctx_len, | 234 | ctx->ctx_len, |
| 234 | &ctx->ctx_sid); | 235 | &ctx->ctx_sid); |
