diff options
Diffstat (limited to 'arch/powerpc')
24 files changed, 384 insertions, 356 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 037664d496d7..5e001ad588a7 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -295,6 +295,7 @@ config ARCH_FLATMEM_ENABLE | |||
295 | config ARCH_SPARSEMEM_ENABLE | 295 | config ARCH_SPARSEMEM_ENABLE |
296 | def_bool y | 296 | def_bool y |
297 | depends on PPC64 | 297 | depends on PPC64 |
298 | select SPARSEMEM_VMEMMAP_ENABLE | ||
298 | 299 | ||
299 | config ARCH_SPARSEMEM_DEFAULT | 300 | config ARCH_SPARSEMEM_DEFAULT |
300 | def_bool y | 301 | def_bool y |
diff --git a/arch/powerpc/kernel/dma_64.c b/arch/powerpc/kernel/dma_64.c index 7b0e754383cf..9001104b56b0 100644 --- a/arch/powerpc/kernel/dma_64.c +++ b/arch/powerpc/kernel/dma_64.c | |||
@@ -154,12 +154,13 @@ static void dma_direct_unmap_single(struct device *dev, dma_addr_t dma_addr, | |||
154 | { | 154 | { |
155 | } | 155 | } |
156 | 156 | ||
157 | static int dma_direct_map_sg(struct device *dev, struct scatterlist *sg, | 157 | static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, |
158 | int nents, enum dma_data_direction direction) | 158 | int nents, enum dma_data_direction direction) |
159 | { | 159 | { |
160 | struct scatterlist *sg; | ||
160 | int i; | 161 | int i; |
161 | 162 | ||
162 | for (i = 0; i < nents; i++, sg++) { | 163 | for_each_sg(sgl, sg, nents, i) { |
163 | sg->dma_address = (page_to_phys(sg->page) + sg->offset) | | 164 | sg->dma_address = (page_to_phys(sg->page) + sg->offset) | |
164 | dma_direct_offset; | 165 | dma_direct_offset; |
165 | sg->dma_length = sg->length; | 166 | sg->dma_length = sg->length; |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 53bf64623bd8..2e16ca5778a3 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -87,15 +87,16 @@ static void ibmebus_unmap_single(struct device *dev, | |||
87 | } | 87 | } |
88 | 88 | ||
89 | static int ibmebus_map_sg(struct device *dev, | 89 | static int ibmebus_map_sg(struct device *dev, |
90 | struct scatterlist *sg, | 90 | struct scatterlist *sgl, |
91 | int nents, enum dma_data_direction direction) | 91 | int nents, enum dma_data_direction direction) |
92 | { | 92 | { |
93 | struct scatterlist *sg; | ||
93 | int i; | 94 | int i; |
94 | 95 | ||
95 | for (i = 0; i < nents; i++) { | 96 | for_each_sg(sgl, sg, nents, i) { |
96 | sg[i].dma_address = (dma_addr_t)page_address(sg[i].page) | 97 | sg->dma_address = (dma_addr_t)page_address(sg->page) |
97 | + sg[i].offset; | 98 | + sg->offset; |
98 | sg[i].dma_length = sg[i].length; | 99 | sg->dma_length = sg->length; |
99 | } | 100 | } |
100 | 101 | ||
101 | return nents; | 102 | return nents; |
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index e4ec6eee81a8..306a6f75b6c5 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -277,7 +277,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
277 | dma_addr_t dma_next = 0, dma_addr; | 277 | dma_addr_t dma_next = 0, dma_addr; |
278 | unsigned long flags; | 278 | unsigned long flags; |
279 | struct scatterlist *s, *outs, *segstart; | 279 | struct scatterlist *s, *outs, *segstart; |
280 | int outcount, incount; | 280 | int outcount, incount, i; |
281 | unsigned long handle; | 281 | unsigned long handle; |
282 | 282 | ||
283 | BUG_ON(direction == DMA_NONE); | 283 | BUG_ON(direction == DMA_NONE); |
@@ -297,7 +297,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
297 | 297 | ||
298 | spin_lock_irqsave(&(tbl->it_lock), flags); | 298 | spin_lock_irqsave(&(tbl->it_lock), flags); |
299 | 299 | ||
300 | for (s = outs; nelems; nelems--, s++) { | 300 | for_each_sg(sglist, s, nelems, i) { |
301 | unsigned long vaddr, npages, entry, slen; | 301 | unsigned long vaddr, npages, entry, slen; |
302 | 302 | ||
303 | slen = s->length; | 303 | slen = s->length; |
@@ -341,7 +341,8 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
341 | if (novmerge || (dma_addr != dma_next)) { | 341 | if (novmerge || (dma_addr != dma_next)) { |
342 | /* Can't merge: create a new segment */ | 342 | /* Can't merge: create a new segment */ |
343 | segstart = s; | 343 | segstart = s; |
344 | outcount++; outs++; | 344 | outcount++; |
345 | outs = sg_next(outs); | ||
345 | DBG(" can't merge, new segment.\n"); | 346 | DBG(" can't merge, new segment.\n"); |
346 | } else { | 347 | } else { |
347 | outs->dma_length += s->length; | 348 | outs->dma_length += s->length; |
@@ -374,7 +375,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
374 | * next entry of the sglist if we didn't fill the list completely | 375 | * next entry of the sglist if we didn't fill the list completely |
375 | */ | 376 | */ |
376 | if (outcount < incount) { | 377 | if (outcount < incount) { |
377 | outs++; | 378 | outs = sg_next(outs); |
378 | outs->dma_address = DMA_ERROR_CODE; | 379 | outs->dma_address = DMA_ERROR_CODE; |
379 | outs->dma_length = 0; | 380 | outs->dma_length = 0; |
380 | } | 381 | } |
@@ -385,7 +386,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
385 | return outcount; | 386 | return outcount; |
386 | 387 | ||
387 | failure: | 388 | failure: |
388 | for (s = &sglist[0]; s <= outs; s++) { | 389 | for_each_sg(sglist, s, nelems, i) { |
389 | if (s->dma_length != 0) { | 390 | if (s->dma_length != 0) { |
390 | unsigned long vaddr, npages; | 391 | unsigned long vaddr, npages; |
391 | 392 | ||
@@ -395,6 +396,8 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
395 | s->dma_address = DMA_ERROR_CODE; | 396 | s->dma_address = DMA_ERROR_CODE; |
396 | s->dma_length = 0; | 397 | s->dma_length = 0; |
397 | } | 398 | } |
399 | if (s == outs) | ||
400 | break; | ||
398 | } | 401 | } |
399 | spin_unlock_irqrestore(&(tbl->it_lock), flags); | 402 | spin_unlock_irqrestore(&(tbl->it_lock), flags); |
400 | return 0; | 403 | return 0; |
@@ -404,6 +407,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
404 | void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | 407 | void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, |
405 | int nelems, enum dma_data_direction direction) | 408 | int nelems, enum dma_data_direction direction) |
406 | { | 409 | { |
410 | struct scatterlist *sg; | ||
407 | unsigned long flags; | 411 | unsigned long flags; |
408 | 412 | ||
409 | BUG_ON(direction == DMA_NONE); | 413 | BUG_ON(direction == DMA_NONE); |
@@ -413,15 +417,16 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
413 | 417 | ||
414 | spin_lock_irqsave(&(tbl->it_lock), flags); | 418 | spin_lock_irqsave(&(tbl->it_lock), flags); |
415 | 419 | ||
420 | sg = sglist; | ||
416 | while (nelems--) { | 421 | while (nelems--) { |
417 | unsigned int npages; | 422 | unsigned int npages; |
418 | dma_addr_t dma_handle = sglist->dma_address; | 423 | dma_addr_t dma_handle = sg->dma_address; |
419 | 424 | ||
420 | if (sglist->dma_length == 0) | 425 | if (sg->dma_length == 0) |
421 | break; | 426 | break; |
422 | npages = iommu_num_pages(dma_handle,sglist->dma_length); | 427 | npages = iommu_num_pages(dma_handle, sg->dma_length); |
423 | __iommu_free(tbl, dma_handle, npages); | 428 | __iommu_free(tbl, dma_handle, npages); |
424 | sglist++; | 429 | sg = sg_next(sg); |
425 | } | 430 | } |
426 | 431 | ||
427 | /* Flush/invalidate TLBs if necessary. As for iommu_free(), we | 432 | /* Flush/invalidate TLBs if necessary. As for iommu_free(), we |
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 440f5a87271f..5338e4855712 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c | |||
@@ -38,6 +38,8 @@ | |||
38 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 38 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
39 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 39 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
40 | 40 | ||
41 | struct kretprobe_blackpoint kretprobe_blacklist[] = {{NULL, NULL}}; | ||
42 | |||
41 | int __kprobes arch_prepare_kprobe(struct kprobe *p) | 43 | int __kprobes arch_prepare_kprobe(struct kprobe *p) |
42 | { | 44 | { |
43 | int ret = 0; | 45 | int ret = 0; |
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c index 89b911e83c04..8f3db32fac8b 100644 --- a/arch/powerpc/kernel/of_device.c +++ b/arch/powerpc/kernel/of_device.c | |||
@@ -57,26 +57,21 @@ ssize_t of_device_get_modalias(struct of_device *ofdev, | |||
57 | return tsize; | 57 | return tsize; |
58 | } | 58 | } |
59 | 59 | ||
60 | int of_device_uevent(struct device *dev, | 60 | int of_device_uevent(struct device *dev, struct kobj_uevent_env *env) |
61 | char **envp, int num_envp, char *buffer, int buffer_size) | ||
62 | { | 61 | { |
63 | struct of_device *ofdev; | 62 | struct of_device *ofdev; |
64 | const char *compat; | 63 | const char *compat; |
65 | int i = 0, length = 0, seen = 0, cplen, sl; | 64 | int seen = 0, cplen, sl; |
66 | 65 | ||
67 | if (!dev) | 66 | if (!dev) |
68 | return -ENODEV; | 67 | return -ENODEV; |
69 | 68 | ||
70 | ofdev = to_of_device(dev); | 69 | ofdev = to_of_device(dev); |
71 | 70 | ||
72 | if (add_uevent_var(envp, num_envp, &i, | 71 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name)) |
73 | buffer, buffer_size, &length, | ||
74 | "OF_NAME=%s", ofdev->node->name)) | ||
75 | return -ENOMEM; | 72 | return -ENOMEM; |
76 | 73 | ||
77 | if (add_uevent_var(envp, num_envp, &i, | 74 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type)) |
78 | buffer, buffer_size, &length, | ||
79 | "OF_TYPE=%s", ofdev->node->type)) | ||
80 | return -ENOMEM; | 75 | return -ENOMEM; |
81 | 76 | ||
82 | /* Since the compatible field can contain pretty much anything | 77 | /* Since the compatible field can contain pretty much anything |
@@ -85,9 +80,7 @@ int of_device_uevent(struct device *dev, | |||
85 | 80 | ||
86 | compat = of_get_property(ofdev->node, "compatible", &cplen); | 81 | compat = of_get_property(ofdev->node, "compatible", &cplen); |
87 | while (compat && *compat && cplen > 0) { | 82 | while (compat && *compat && cplen > 0) { |
88 | if (add_uevent_var(envp, num_envp, &i, | 83 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) |
89 | buffer, buffer_size, &length, | ||
90 | "OF_COMPATIBLE_%d=%s", seen, compat)) | ||
91 | return -ENOMEM; | 84 | return -ENOMEM; |
92 | 85 | ||
93 | sl = strlen (compat) + 1; | 86 | sl = strlen (compat) + 1; |
@@ -96,25 +89,17 @@ int of_device_uevent(struct device *dev, | |||
96 | seen++; | 89 | seen++; |
97 | } | 90 | } |
98 | 91 | ||
99 | if (add_uevent_var(envp, num_envp, &i, | 92 | if (add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen)) |
100 | buffer, buffer_size, &length, | ||
101 | "OF_COMPATIBLE_N=%d", seen)) | ||
102 | return -ENOMEM; | 93 | return -ENOMEM; |
103 | 94 | ||
104 | /* modalias is trickier, we add it in 2 steps */ | 95 | /* modalias is trickier, we add it in 2 steps */ |
105 | if (add_uevent_var(envp, num_envp, &i, | 96 | if (add_uevent_var(env, "MODALIAS=")) |
106 | buffer, buffer_size, &length, | ||
107 | "MODALIAS=")) | ||
108 | return -ENOMEM; | 97 | return -ENOMEM; |
109 | 98 | sl = of_device_get_modalias(ofdev, &env->buf[env->buflen-1], | |
110 | sl = of_device_get_modalias(ofdev, &buffer[length-1], | 99 | sizeof(env->buf) - env->buflen); |
111 | buffer_size-length); | 100 | if (sl >= (sizeof(env->buf) - env->buflen)) |
112 | if (sl >= (buffer_size-length)) | ||
113 | return -ENOMEM; | 101 | return -ENOMEM; |
114 | 102 | env->buflen += sl; | |
115 | length += sl; | ||
116 | |||
117 | envp[i] = NULL; | ||
118 | 103 | ||
119 | return 0; | 104 | return 0; |
120 | } | 105 | } |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index cf7732cdd6c7..3e17d154d0d4 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -505,10 +505,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
505 | ret = ptrace_set_debugreg(child, addr, data); | 505 | ret = ptrace_set_debugreg(child, addr, data); |
506 | break; | 506 | break; |
507 | 507 | ||
508 | case PTRACE_DETACH: | ||
509 | ret = ptrace_detach(child, data); | ||
510 | break; | ||
511 | |||
512 | #ifdef CONFIG_PPC64 | 508 | #ifdef CONFIG_PPC64 |
513 | case PTRACE_GETREGS64: | 509 | case PTRACE_GETREGS64: |
514 | #endif | 510 | #endif |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 36c90ba2d312..2de00f870edc 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -413,16 +413,28 @@ void __init smp_setup_cpu_maps(void) | |||
413 | of_node_put(dn); | 413 | of_node_put(dn); |
414 | } | 414 | } |
415 | 415 | ||
416 | vdso_data->processorCount = num_present_cpus(); | ||
417 | #endif /* CONFIG_PPC64 */ | ||
418 | } | ||
419 | |||
420 | /* | ||
421 | * Being that cpu_sibling_map is now a per_cpu array, then it cannot | ||
422 | * be initialized until the per_cpu areas have been created. This | ||
423 | * function is now called from setup_per_cpu_areas(). | ||
424 | */ | ||
425 | void __init smp_setup_cpu_sibling_map(void) | ||
426 | { | ||
427 | #if defined(CONFIG_PPC64) | ||
428 | int cpu; | ||
429 | |||
416 | /* | 430 | /* |
417 | * Do the sibling map; assume only two threads per processor. | 431 | * Do the sibling map; assume only two threads per processor. |
418 | */ | 432 | */ |
419 | for_each_possible_cpu(cpu) { | 433 | for_each_possible_cpu(cpu) { |
420 | cpu_set(cpu, cpu_sibling_map[cpu]); | 434 | cpu_set(cpu, per_cpu(cpu_sibling_map, cpu)); |
421 | if (cpu_has_feature(CPU_FTR_SMT)) | 435 | if (cpu_has_feature(CPU_FTR_SMT)) |
422 | cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]); | 436 | cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu)); |
423 | } | 437 | } |
424 | |||
425 | vdso_data->processorCount = num_present_cpus(); | ||
426 | #endif /* CONFIG_PPC64 */ | 438 | #endif /* CONFIG_PPC64 */ |
427 | } | 439 | } |
428 | #endif /* CONFIG_SMP */ | 440 | #endif /* CONFIG_SMP */ |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 008ab6823b02..0e014550b83f 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -597,6 +597,9 @@ void __init setup_per_cpu_areas(void) | |||
597 | paca[i].data_offset = ptr - __per_cpu_start; | 597 | paca[i].data_offset = ptr - __per_cpu_start; |
598 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); | 598 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); |
599 | } | 599 | } |
600 | |||
601 | /* Now that per_cpu is setup, initialize cpu_sibling_map */ | ||
602 | smp_setup_cpu_sibling_map(); | ||
600 | } | 603 | } |
601 | #endif | 604 | #endif |
602 | 605 | ||
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index d30f08fa0297..338950aeb6f6 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -61,11 +61,11 @@ struct thread_info *secondary_ti; | |||
61 | 61 | ||
62 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | 62 | cpumask_t cpu_possible_map = CPU_MASK_NONE; |
63 | cpumask_t cpu_online_map = CPU_MASK_NONE; | 63 | cpumask_t cpu_online_map = CPU_MASK_NONE; |
64 | cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; | 64 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; |
65 | 65 | ||
66 | EXPORT_SYMBOL(cpu_online_map); | 66 | EXPORT_SYMBOL(cpu_online_map); |
67 | EXPORT_SYMBOL(cpu_possible_map); | 67 | EXPORT_SYMBOL(cpu_possible_map); |
68 | EXPORT_SYMBOL(cpu_sibling_map); | 68 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); |
69 | 69 | ||
70 | /* SMP operations for this machine */ | 70 | /* SMP operations for this machine */ |
71 | struct smp_ops_t *smp_ops; | 71 | struct smp_ops_t *smp_ops; |
diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S index 26e138c4ce17..9352ab5200e5 100644 --- a/arch/powerpc/kernel/vdso32/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S | |||
@@ -1,130 +1,147 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | * This is the infamous ld script for the 32 bits vdso | 2 | * This is the infamous ld script for the 32 bits vdso |
4 | * library | 3 | * library |
5 | */ | 4 | */ |
6 | #include <asm/vdso.h> | 5 | #include <asm/vdso.h> |
7 | 6 | ||
8 | /* Default link addresses for the vDSOs */ | ||
9 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") | 7 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
10 | OUTPUT_ARCH(powerpc:common) | 8 | OUTPUT_ARCH(powerpc:common) |
11 | ENTRY(_start) | 9 | ENTRY(_start) |
12 | 10 | ||
13 | SECTIONS | 11 | SECTIONS |
14 | { | 12 | { |
15 | . = VDSO32_LBASE + SIZEOF_HEADERS; | 13 | . = VDSO32_LBASE + SIZEOF_HEADERS; |
16 | .hash : { *(.hash) } :text | 14 | |
17 | .gnu.hash : { *(.gnu.hash) } | 15 | .hash : { *(.hash) } :text |
18 | .dynsym : { *(.dynsym) } | 16 | .gnu.hash : { *(.gnu.hash) } |
19 | .dynstr : { *(.dynstr) } | 17 | .dynsym : { *(.dynsym) } |
20 | .gnu.version : { *(.gnu.version) } | 18 | .dynstr : { *(.dynstr) } |
21 | .gnu.version_d : { *(.gnu.version_d) } | 19 | .gnu.version : { *(.gnu.version) } |
22 | .gnu.version_r : { *(.gnu.version_r) } | 20 | .gnu.version_d : { *(.gnu.version_d) } |
23 | 21 | .gnu.version_r : { *(.gnu.version_r) } | |
24 | .note : { *(.note.*) } :text :note | 22 | |
25 | 23 | .note : { *(.note.*) } :text :note | |
26 | . = ALIGN (16); | 24 | |
27 | .text : | 25 | . = ALIGN(16); |
28 | { | 26 | .text : { |
29 | *(.text .stub .text.* .gnu.linkonce.t.*) | 27 | *(.text .stub .text.* .gnu.linkonce.t.*) |
30 | } | 28 | } |
31 | PROVIDE (__etext = .); | 29 | PROVIDE(__etext = .); |
32 | PROVIDE (_etext = .); | 30 | PROVIDE(_etext = .); |
33 | PROVIDE (etext = .); | 31 | PROVIDE(etext = .); |
34 | 32 | ||
35 | . = ALIGN(8); | 33 | . = ALIGN(8); |
36 | __ftr_fixup : { | 34 | __ftr_fixup : { *(__ftr_fixup) } |
37 | *(__ftr_fixup) | ||
38 | } | ||
39 | 35 | ||
40 | #ifdef CONFIG_PPC64 | 36 | #ifdef CONFIG_PPC64 |
41 | . = ALIGN(8); | 37 | . = ALIGN(8); |
42 | __fw_ftr_fixup : { | 38 | __fw_ftr_fixup : { *(__fw_ftr_fixup) } |
43 | *(__fw_ftr_fixup) | ||
44 | } | ||
45 | #endif | 39 | #endif |
46 | 40 | ||
47 | /* Other stuff is appended to the text segment: */ | 41 | /* |
48 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | 42 | * Other stuff is appended to the text segment: |
49 | .rodata1 : { *(.rodata1) } | 43 | */ |
50 | 44 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | |
51 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | 45 | .rodata1 : { *(.rodata1) } |
52 | .eh_frame : { KEEP (*(.eh_frame)) } :text | 46 | |
53 | .gcc_except_table : { *(.gcc_except_table) } | 47 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
54 | .fixup : { *(.fixup) } | 48 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
55 | 49 | .gcc_except_table : { *(.gcc_except_table) } | |
56 | .dynamic : { *(.dynamic) } :text :dynamic | 50 | .fixup : { *(.fixup) } |
57 | .got : { *(.got) } | 51 | |
58 | .plt : { *(.plt) } | 52 | .dynamic : { *(.dynamic) } :text :dynamic |
59 | 53 | .got : { *(.got) } | |
60 | _end = .; | 54 | .plt : { *(.plt) } |
61 | __end = .; | 55 | |
62 | PROVIDE (end = .); | 56 | _end = .; |
63 | 57 | __end = .; | |
64 | 58 | PROVIDE(end = .); | |
65 | /* Stabs debugging sections are here too | 59 | |
66 | */ | 60 | /* |
67 | .stab 0 : { *(.stab) } | 61 | * Stabs debugging sections are here too. |
68 | .stabstr 0 : { *(.stabstr) } | 62 | */ |
69 | .stab.excl 0 : { *(.stab.excl) } | 63 | .stab 0 : { *(.stab) } |
70 | .stab.exclstr 0 : { *(.stab.exclstr) } | 64 | .stabstr 0 : { *(.stabstr) } |
71 | .stab.index 0 : { *(.stab.index) } | 65 | .stab.excl 0 : { *(.stab.excl) } |
72 | .stab.indexstr 0 : { *(.stab.indexstr) } | 66 | .stab.exclstr 0 : { *(.stab.exclstr) } |
73 | .comment 0 : { *(.comment) } | 67 | .stab.index 0 : { *(.stab.index) } |
74 | .debug 0 : { *(.debug) } | 68 | .stab.indexstr 0 : { *(.stab.indexstr) } |
75 | .line 0 : { *(.line) } | 69 | .comment 0 : { *(.comment) } |
76 | 70 | ||
77 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | 71 | /* |
78 | .debug_sfnames 0 : { *(.debug_sfnames) } | 72 | * DWARF debug sections. |
79 | 73 | * Symbols in the DWARF debugging sections are relative to the beginning | |
80 | .debug_aranges 0 : { *(.debug_aranges) } | 74 | * of the section so we begin them at 0. |
81 | .debug_pubnames 0 : { *(.debug_pubnames) } | 75 | */ |
82 | 76 | /* DWARF 1 */ | |
83 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | 77 | .debug 0 : { *(.debug) } |
84 | .debug_abbrev 0 : { *(.debug_abbrev) } | 78 | .line 0 : { *(.line) } |
85 | .debug_line 0 : { *(.debug_line) } | 79 | /* GNU DWARF 1 extensions */ |
86 | .debug_frame 0 : { *(.debug_frame) } | 80 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
87 | .debug_str 0 : { *(.debug_str) } | 81 | .debug_sfnames 0 : { *(.debug_sfnames) } |
88 | .debug_loc 0 : { *(.debug_loc) } | 82 | /* DWARF 1.1 and DWARF 2 */ |
89 | .debug_macinfo 0 : { *(.debug_macinfo) } | 83 | .debug_aranges 0 : { *(.debug_aranges) } |
90 | 84 | .debug_pubnames 0 : { *(.debug_pubnames) } | |
91 | .debug_weaknames 0 : { *(.debug_weaknames) } | 85 | /* DWARF 2 */ |
92 | .debug_funcnames 0 : { *(.debug_funcnames) } | 86 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
93 | .debug_typenames 0 : { *(.debug_typenames) } | 87 | .debug_abbrev 0 : { *(.debug_abbrev) } |
94 | .debug_varnames 0 : { *(.debug_varnames) } | 88 | .debug_line 0 : { *(.debug_line) } |
95 | 89 | .debug_frame 0 : { *(.debug_frame) } | |
96 | /DISCARD/ : { *(.note.GNU-stack) } | 90 | .debug_str 0 : { *(.debug_str) } |
97 | /DISCARD/ : { *(.data .data.* .gnu.linkonce.d.* .sdata*) } | 91 | .debug_loc 0 : { *(.debug_loc) } |
98 | /DISCARD/ : { *(.bss .sbss .dynbss .dynsbss) } | 92 | .debug_macinfo 0 : { *(.debug_macinfo) } |
93 | /* SGI/MIPS DWARF 2 extensions */ | ||
94 | .debug_weaknames 0 : { *(.debug_weaknames) } | ||
95 | .debug_funcnames 0 : { *(.debug_funcnames) } | ||
96 | .debug_typenames 0 : { *(.debug_typenames) } | ||
97 | .debug_varnames 0 : { *(.debug_varnames) } | ||
98 | |||
99 | /DISCARD/ : { | ||
100 | *(.note.GNU-stack) | ||
101 | *(.data .data.* .gnu.linkonce.d.* .sdata*) | ||
102 | *(.bss .sbss .dynbss .dynsbss) | ||
103 | } | ||
99 | } | 104 | } |
100 | 105 | ||
106 | /* | ||
107 | * Very old versions of ld do not recognize this name token; use the constant. | ||
108 | */ | ||
109 | #define PT_GNU_EH_FRAME 0x6474e550 | ||
101 | 110 | ||
111 | /* | ||
112 | * We must supply the ELF program headers explicitly to get just one | ||
113 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. | ||
114 | */ | ||
102 | PHDRS | 115 | PHDRS |
103 | { | 116 | { |
104 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 117 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
105 | note PT_NOTE FLAGS(4); /* PF_R */ | 118 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
106 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 119 | note PT_NOTE FLAGS(4); /* PF_R */ |
107 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 120 | eh_frame_hdr PT_GNU_EH_FRAME; |
108 | } | 121 | } |
109 | 122 | ||
110 | |||
111 | /* | 123 | /* |
112 | * This controls what symbols we export from the DSO. | 124 | * This controls what symbols we export from the DSO. |
113 | */ | 125 | */ |
114 | VERSION | 126 | VERSION |
115 | { | 127 | { |
116 | VDSO_VERSION_STRING { | 128 | VDSO_VERSION_STRING { |
117 | global: | 129 | global: |
118 | __kernel_datapage_offset; /* Has to be there for the kernel to find */ | 130 | /* |
119 | __kernel_get_syscall_map; | 131 | * Has to be there for the kernel to find |
120 | __kernel_gettimeofday; | 132 | */ |
121 | __kernel_clock_gettime; | 133 | __kernel_datapage_offset; |
122 | __kernel_clock_getres; | 134 | |
123 | __kernel_get_tbfreq; | 135 | __kernel_get_syscall_map; |
124 | __kernel_sync_dicache; | 136 | __kernel_gettimeofday; |
125 | __kernel_sync_dicache_p5; | 137 | __kernel_clock_gettime; |
126 | __kernel_sigtramp32; | 138 | __kernel_clock_getres; |
127 | __kernel_sigtramp_rt32; | 139 | __kernel_get_tbfreq; |
128 | local: *; | 140 | __kernel_sync_dicache; |
129 | }; | 141 | __kernel_sync_dicache_p5; |
142 | __kernel_sigtramp32; | ||
143 | __kernel_sigtramp_rt32; | ||
144 | |||
145 | local: *; | ||
146 | }; | ||
130 | } | 147 | } |
diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S index 2d70f35d50b5..932b3fdb34b9 100644 --- a/arch/powerpc/kernel/vdso64/vdso64.lds.S +++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S | |||
@@ -10,100 +10,114 @@ ENTRY(_start) | |||
10 | 10 | ||
11 | SECTIONS | 11 | SECTIONS |
12 | { | 12 | { |
13 | . = VDSO64_LBASE + SIZEOF_HEADERS; | 13 | . = VDSO64_LBASE + SIZEOF_HEADERS; |
14 | .hash : { *(.hash) } :text | 14 | |
15 | .gnu.hash : { *(.gnu.hash) } | 15 | .hash : { *(.hash) } :text |
16 | .dynsym : { *(.dynsym) } | 16 | .gnu.hash : { *(.gnu.hash) } |
17 | .dynstr : { *(.dynstr) } | 17 | .dynsym : { *(.dynsym) } |
18 | .gnu.version : { *(.gnu.version) } | 18 | .dynstr : { *(.dynstr) } |
19 | .gnu.version_d : { *(.gnu.version_d) } | 19 | .gnu.version : { *(.gnu.version) } |
20 | .gnu.version_r : { *(.gnu.version_r) } | 20 | .gnu.version_d : { *(.gnu.version_d) } |
21 | 21 | .gnu.version_r : { *(.gnu.version_r) } | |
22 | .note : { *(.note.*) } :text :note | 22 | |
23 | 23 | .note : { *(.note.*) } :text :note | |
24 | . = ALIGN (16); | 24 | |
25 | .text : | 25 | . = ALIGN(16); |
26 | { | 26 | .text : { |
27 | *(.text .stub .text.* .gnu.linkonce.t.*) | 27 | *(.text .stub .text.* .gnu.linkonce.t.*) |
28 | *(.sfpr .glink) | 28 | *(.sfpr .glink) |
29 | } :text | 29 | } :text |
30 | PROVIDE (__etext = .); | 30 | PROVIDE(__etext = .); |
31 | PROVIDE (_etext = .); | 31 | PROVIDE(_etext = .); |
32 | PROVIDE (etext = .); | 32 | PROVIDE(etext = .); |
33 | 33 | ||
34 | . = ALIGN(8); | 34 | . = ALIGN(8); |
35 | __ftr_fixup : { | 35 | __ftr_fixup : { *(__ftr_fixup) } |
36 | *(__ftr_fixup) | 36 | |
37 | } | 37 | . = ALIGN(8); |
38 | 38 | __fw_ftr_fixup : { *(__fw_ftr_fixup) } | |
39 | . = ALIGN(8); | 39 | |
40 | __fw_ftr_fixup : { | 40 | /* |
41 | *(__fw_ftr_fixup) | 41 | * Other stuff is appended to the text segment: |
42 | } | 42 | */ |
43 | 43 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | |
44 | /* Other stuff is appended to the text segment: */ | 44 | .rodata1 : { *(.rodata1) } |
45 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | 45 | |
46 | .rodata1 : { *(.rodata1) } | 46 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
47 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | 47 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
48 | .eh_frame : { KEEP (*(.eh_frame)) } :text | 48 | .gcc_except_table : { *(.gcc_except_table) } |
49 | .gcc_except_table : { *(.gcc_except_table) } | 49 | |
50 | 50 | .opd ALIGN(8) : { KEEP (*(.opd)) } | |
51 | .opd ALIGN(8) : { KEEP (*(.opd)) } | 51 | .got ALIGN(8) : { *(.got .toc) } |
52 | .got ALIGN(8) : { *(.got .toc) } | 52 | .rela.dyn ALIGN(8) : { *(.rela.dyn) } |
53 | .rela.dyn ALIGN(8) : { *(.rela.dyn) } | 53 | |
54 | 54 | .dynamic : { *(.dynamic) } :text :dynamic | |
55 | .dynamic : { *(.dynamic) } :text :dynamic | 55 | |
56 | 56 | _end = .; | |
57 | _end = .; | 57 | PROVIDE(end = .); |
58 | PROVIDE (end = .); | 58 | |
59 | 59 | /* | |
60 | /* Stabs debugging sections are here too | 60 | * Stabs debugging sections are here too. |
61 | */ | 61 | */ |
62 | .stab 0 : { *(.stab) } | 62 | .stab 0 : { *(.stab) } |
63 | .stabstr 0 : { *(.stabstr) } | 63 | .stabstr 0 : { *(.stabstr) } |
64 | .stab.excl 0 : { *(.stab.excl) } | 64 | .stab.excl 0 : { *(.stab.excl) } |
65 | .stab.exclstr 0 : { *(.stab.exclstr) } | 65 | .stab.exclstr 0 : { *(.stab.exclstr) } |
66 | .stab.index 0 : { *(.stab.index) } | 66 | .stab.index 0 : { *(.stab.index) } |
67 | .stab.indexstr 0 : { *(.stab.indexstr) } | 67 | .stab.indexstr 0 : { *(.stab.indexstr) } |
68 | .comment 0 : { *(.comment) } | 68 | .comment 0 : { *(.comment) } |
69 | /* DWARF debug sectio/ns. | 69 | |
70 | Symbols in the DWARF debugging sections are relative to the beginning | 70 | /* |
71 | of the section so we begin them at 0. */ | 71 | * DWARF debug sections. |
72 | /* DWARF 1 */ | 72 | * Symbols in the DWARF debugging sections are relative to the beginning |
73 | .debug 0 : { *(.debug) } | 73 | * of the section so we begin them at 0. |
74 | .line 0 : { *(.line) } | 74 | */ |
75 | /* GNU DWARF 1 extensions */ | 75 | /* DWARF 1 */ |
76 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | 76 | .debug 0 : { *(.debug) } |
77 | .debug_sfnames 0 : { *(.debug_sfnames) } | 77 | .line 0 : { *(.line) } |
78 | /* DWARF 1.1 and DWARF 2 */ | 78 | /* GNU DWARF 1 extensions */ |
79 | .debug_aranges 0 : { *(.debug_aranges) } | 79 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
80 | .debug_pubnames 0 : { *(.debug_pubnames) } | 80 | .debug_sfnames 0 : { *(.debug_sfnames) } |
81 | /* DWARF 2 */ | 81 | /* DWARF 1.1 and DWARF 2 */ |
82 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | 82 | .debug_aranges 0 : { *(.debug_aranges) } |
83 | .debug_abbrev 0 : { *(.debug_abbrev) } | 83 | .debug_pubnames 0 : { *(.debug_pubnames) } |
84 | .debug_line 0 : { *(.debug_line) } | 84 | /* DWARF 2 */ |
85 | .debug_frame 0 : { *(.debug_frame) } | 85 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
86 | .debug_str 0 : { *(.debug_str) } | 86 | .debug_abbrev 0 : { *(.debug_abbrev) } |
87 | .debug_loc 0 : { *(.debug_loc) } | 87 | .debug_line 0 : { *(.debug_line) } |
88 | .debug_macinfo 0 : { *(.debug_macinfo) } | 88 | .debug_frame 0 : { *(.debug_frame) } |
89 | /* SGI/MIPS DWARF 2 extensions */ | 89 | .debug_str 0 : { *(.debug_str) } |
90 | .debug_weaknames 0 : { *(.debug_weaknames) } | 90 | .debug_loc 0 : { *(.debug_loc) } |
91 | .debug_funcnames 0 : { *(.debug_funcnames) } | 91 | .debug_macinfo 0 : { *(.debug_macinfo) } |
92 | .debug_typenames 0 : { *(.debug_typenames) } | 92 | /* SGI/MIPS DWARF 2 extensions */ |
93 | .debug_varnames 0 : { *(.debug_varnames) } | 93 | .debug_weaknames 0 : { *(.debug_weaknames) } |
94 | 94 | .debug_funcnames 0 : { *(.debug_funcnames) } | |
95 | /DISCARD/ : { *(.note.GNU-stack) } | 95 | .debug_typenames 0 : { *(.debug_typenames) } |
96 | /DISCARD/ : { *(.branch_lt) } | 96 | .debug_varnames 0 : { *(.debug_varnames) } |
97 | /DISCARD/ : { *(.data .data.* .gnu.linkonce.d.*) } | 97 | |
98 | /DISCARD/ : { *(.bss .sbss .dynbss .dynsbss) } | 98 | /DISCARD/ : { |
99 | *(.note.GNU-stack) | ||
100 | *(.branch_lt) | ||
101 | *(.data .data.* .gnu.linkonce.d.* .sdata*) | ||
102 | *(.bss .sbss .dynbss .dynsbss) | ||
103 | } | ||
99 | } | 104 | } |
100 | 105 | ||
106 | /* | ||
107 | * Very old versions of ld do not recognize this name token; use the constant. | ||
108 | */ | ||
109 | #define PT_GNU_EH_FRAME 0x6474e550 | ||
110 | |||
111 | /* | ||
112 | * We must supply the ELF program headers explicitly to get just one | ||
113 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. | ||
114 | */ | ||
101 | PHDRS | 115 | PHDRS |
102 | { | 116 | { |
103 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 117 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
104 | note PT_NOTE FLAGS(4); /* PF_R */ | 118 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
105 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 119 | note PT_NOTE FLAGS(4); /* PF_R */ |
106 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 120 | eh_frame_hdr PT_GNU_EH_FRAME; |
107 | } | 121 | } |
108 | 122 | ||
109 | /* | 123 | /* |
@@ -111,17 +125,22 @@ PHDRS | |||
111 | */ | 125 | */ |
112 | VERSION | 126 | VERSION |
113 | { | 127 | { |
114 | VDSO_VERSION_STRING { | 128 | VDSO_VERSION_STRING { |
115 | global: | 129 | global: |
116 | __kernel_datapage_offset; /* Has to be there for the kernel to find */ | 130 | /* |
117 | __kernel_get_syscall_map; | 131 | * Has to be there for the kernel to find |
118 | __kernel_gettimeofday; | 132 | */ |
119 | __kernel_clock_gettime; | 133 | __kernel_datapage_offset; |
120 | __kernel_clock_getres; | 134 | |
121 | __kernel_get_tbfreq; | 135 | __kernel_get_syscall_map; |
122 | __kernel_sync_dicache; | 136 | __kernel_gettimeofday; |
123 | __kernel_sync_dicache_p5; | 137 | __kernel_clock_gettime; |
124 | __kernel_sigtramp_rt64; | 138 | __kernel_clock_getres; |
125 | local: *; | 139 | __kernel_get_tbfreq; |
126 | }; | 140 | __kernel_sync_dicache; |
141 | __kernel_sync_dicache_p5; | ||
142 | __kernel_sigtramp_rt64; | ||
143 | |||
144 | local: *; | ||
145 | }; | ||
127 | } | 146 | } |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index cb22a3557c4e..19a5656001c0 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -317,30 +317,20 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv) | |||
317 | return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); | 317 | return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); |
318 | } | 318 | } |
319 | 319 | ||
320 | static int vio_hotplug(struct device *dev, char **envp, int num_envp, | 320 | static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env) |
321 | char *buffer, int buffer_size) | ||
322 | { | 321 | { |
323 | const struct vio_dev *vio_dev = to_vio_dev(dev); | 322 | const struct vio_dev *vio_dev = to_vio_dev(dev); |
324 | struct device_node *dn; | 323 | struct device_node *dn; |
325 | const char *cp; | 324 | const char *cp; |
326 | int length; | ||
327 | |||
328 | if (!num_envp) | ||
329 | return -ENOMEM; | ||
330 | 325 | ||
331 | dn = dev->archdata.of_node; | 326 | dn = dev->archdata.of_node; |
332 | if (!dn) | 327 | if (!dn) |
333 | return -ENODEV; | 328 | return -ENODEV; |
334 | cp = of_get_property(dn, "compatible", &length); | 329 | cp = of_get_property(dn, "compatible", NULL); |
335 | if (!cp) | 330 | if (!cp) |
336 | return -ENODEV; | 331 | return -ENODEV; |
337 | 332 | ||
338 | envp[0] = buffer; | 333 | add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp); |
339 | length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s", | ||
340 | vio_dev->type, cp); | ||
341 | if ((buffer_size - length) <= 0) | ||
342 | return -ENOMEM; | ||
343 | envp[1] = NULL; | ||
344 | return 0; | 334 | return 0; |
345 | } | 335 | } |
346 | 336 | ||
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index fa90f6561b9f..29ed495444f5 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -183,3 +183,70 @@ void pgtable_cache_init(void) | |||
183 | zero_ctor); | 183 | zero_ctor); |
184 | } | 184 | } |
185 | } | 185 | } |
186 | |||
187 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
188 | /* | ||
189 | * Given an address within the vmemmap, determine the pfn of the page that | ||
190 | * represents the start of the section it is within. Note that we have to | ||
191 | * do this by hand as the proffered address may not be correctly aligned. | ||
192 | * Subtraction of non-aligned pointers produces undefined results. | ||
193 | */ | ||
194 | unsigned long __meminit vmemmap_section_start(unsigned long page) | ||
195 | { | ||
196 | unsigned long offset = page - ((unsigned long)(vmemmap)); | ||
197 | |||
198 | /* Return the pfn of the start of the section. */ | ||
199 | return (offset / sizeof(struct page)) & PAGE_SECTION_MASK; | ||
200 | } | ||
201 | |||
202 | /* | ||
203 | * Check if this vmemmap page is already initialised. If any section | ||
204 | * which overlaps this vmemmap page is initialised then this page is | ||
205 | * initialised already. | ||
206 | */ | ||
207 | int __meminit vmemmap_populated(unsigned long start, int page_size) | ||
208 | { | ||
209 | unsigned long end = start + page_size; | ||
210 | |||
211 | for (; start < end; start += (PAGES_PER_SECTION * sizeof(struct page))) | ||
212 | if (pfn_valid(vmemmap_section_start(start))) | ||
213 | return 1; | ||
214 | |||
215 | return 0; | ||
216 | } | ||
217 | |||
218 | int __meminit vmemmap_populate(struct page *start_page, | ||
219 | unsigned long nr_pages, int node) | ||
220 | { | ||
221 | unsigned long mode_rw; | ||
222 | unsigned long start = (unsigned long)start_page; | ||
223 | unsigned long end = (unsigned long)(start_page + nr_pages); | ||
224 | unsigned long page_size = 1 << mmu_psize_defs[mmu_linear_psize].shift; | ||
225 | |||
226 | mode_rw = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX; | ||
227 | |||
228 | /* Align to the page size of the linear mapping. */ | ||
229 | start = _ALIGN_DOWN(start, page_size); | ||
230 | |||
231 | for (; start < end; start += page_size) { | ||
232 | int mapped; | ||
233 | void *p; | ||
234 | |||
235 | if (vmemmap_populated(start, page_size)) | ||
236 | continue; | ||
237 | |||
238 | p = vmemmap_alloc_block(page_size, node); | ||
239 | if (!p) | ||
240 | return -ENOMEM; | ||
241 | |||
242 | printk(KERN_WARNING "vmemmap %08lx allocated at %p, " | ||
243 | "physical %p.\n", start, p, __pa(p)); | ||
244 | |||
245 | mapped = htab_bolt_mapping(start, start + page_size, | ||
246 | __pa(p), mode_rw, mmu_linear_psize); | ||
247 | BUG_ON(mapped < 0); | ||
248 | } | ||
249 | |||
250 | return 0; | ||
251 | } | ||
252 | #endif | ||
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 32dcfc9b0082..81eb96ec13b2 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -129,51 +129,6 @@ int __devinit arch_add_memory(int nid, u64 start, u64 size) | |||
129 | return __add_pages(zone, start_pfn, nr_pages); | 129 | return __add_pages(zone, start_pfn, nr_pages); |
130 | } | 130 | } |
131 | 131 | ||
132 | /* | ||
133 | * First pass at this code will check to determine if the remove | ||
134 | * request is within the RMO. Do not allow removal within the RMO. | ||
135 | */ | ||
136 | int __devinit remove_memory(u64 start, u64 size) | ||
137 | { | ||
138 | struct zone *zone; | ||
139 | unsigned long start_pfn, end_pfn, nr_pages; | ||
140 | |||
141 | start_pfn = start >> PAGE_SHIFT; | ||
142 | nr_pages = size >> PAGE_SHIFT; | ||
143 | end_pfn = start_pfn + nr_pages; | ||
144 | |||
145 | printk("%s(): Attempting to remove memoy in range " | ||
146 | "%lx to %lx\n", __func__, start, start+size); | ||
147 | /* | ||
148 | * check for range within RMO | ||
149 | */ | ||
150 | zone = page_zone(pfn_to_page(start_pfn)); | ||
151 | |||
152 | printk("%s(): memory will be removed from " | ||
153 | "the %s zone\n", __func__, zone->name); | ||
154 | |||
155 | /* | ||
156 | * not handling removing memory ranges that | ||
157 | * overlap multiple zones yet | ||
158 | */ | ||
159 | if (end_pfn > (zone->zone_start_pfn + zone->spanned_pages)) | ||
160 | goto overlap; | ||
161 | |||
162 | /* make sure it is NOT in RMO */ | ||
163 | if ((start < lmb.rmo_size) || ((start+size) < lmb.rmo_size)) { | ||
164 | printk("%s(): range to be removed must NOT be in RMO!\n", | ||
165 | __func__); | ||
166 | goto in_rmo; | ||
167 | } | ||
168 | |||
169 | return __remove_pages(zone, start_pfn, nr_pages); | ||
170 | |||
171 | overlap: | ||
172 | printk("%s(): memory range to be removed overlaps " | ||
173 | "multiple zones!!!\n", __func__); | ||
174 | in_rmo: | ||
175 | return -1; | ||
176 | } | ||
177 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 132 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
178 | 133 | ||
179 | void show_mem(void) | 134 | void show_mem(void) |
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c index 0caa3d955c3b..65b7ae426238 100644 --- a/arch/powerpc/platforms/52xx/lite5200.c +++ b/arch/powerpc/platforms/52xx/lite5200.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/of.h> | 20 | #include <linux/of.h> |
21 | #include <linux/root_dev.h> | ||
22 | #include <linux/initrd.h> | ||
21 | #include <asm/time.h> | 23 | #include <asm/time.h> |
22 | #include <asm/io.h> | 24 | #include <asm/io.h> |
23 | #include <asm/machdep.h> | 25 | #include <asm/machdep.h> |
@@ -156,18 +158,6 @@ static void __init lite5200_setup_arch(void) | |||
156 | of_node_put(np); | 158 | of_node_put(np); |
157 | } | 159 | } |
158 | #endif | 160 | #endif |
159 | |||
160 | #ifdef CONFIG_BLK_DEV_INITRD | ||
161 | if (initrd_start) | ||
162 | ROOT_DEV = Root_RAM0; | ||
163 | else | ||
164 | #endif | ||
165 | #ifdef CONFIG_ROOT_NFS | ||
166 | ROOT_DEV = Root_NFS; | ||
167 | #else | ||
168 | ROOT_DEV = Root_HDA1; | ||
169 | #endif | ||
170 | |||
171 | } | 161 | } |
172 | 162 | ||
173 | /* | 163 | /* |
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 1245b2f517bb..095988f13bf4 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -77,12 +77,7 @@ static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val) | |||
77 | { | 77 | { |
78 | pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n); | 78 | pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n); |
79 | 79 | ||
80 | dcr_write(msic->dcr_host, msic->dcr_host.base + dcr_n, val); | 80 | dcr_write(msic->dcr_host, dcr_n, val); |
81 | } | ||
82 | |||
83 | static u32 msic_dcr_read(struct axon_msic *msic, unsigned int dcr_n) | ||
84 | { | ||
85 | return dcr_read(msic->dcr_host, msic->dcr_host.base + dcr_n); | ||
86 | } | 81 | } |
87 | 82 | ||
88 | static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) | 83 | static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) |
@@ -91,7 +86,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) | |||
91 | u32 write_offset, msi; | 86 | u32 write_offset, msi; |
92 | int idx; | 87 | int idx; |
93 | 88 | ||
94 | write_offset = msic_dcr_read(msic, MSIC_WRITE_OFFSET_REG); | 89 | write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG); |
95 | pr_debug("axon_msi: original write_offset 0x%x\n", write_offset); | 90 | pr_debug("axon_msi: original write_offset 0x%x\n", write_offset); |
96 | 91 | ||
97 | /* write_offset doesn't wrap properly, so we have to mask it */ | 92 | /* write_offset doesn't wrap properly, so we have to mask it */ |
@@ -306,7 +301,7 @@ static int axon_msi_notify_reboot(struct notifier_block *nb, | |||
306 | list_for_each_entry(msic, &axon_msic_list, list) { | 301 | list_for_each_entry(msic, &axon_msic_list, list) { |
307 | pr_debug("axon_msi: disabling %s\n", | 302 | pr_debug("axon_msi: disabling %s\n", |
308 | msic->irq_host->of_node->full_name); | 303 | msic->irq_host->of_node->full_name); |
309 | tmp = msic_dcr_read(msic, MSIC_CTRL_REG); | 304 | tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG); |
310 | tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; | 305 | tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; |
311 | msic_dcr_write(msic, MSIC_CTRL_REG, tmp); | 306 | msic_dcr_write(msic, MSIC_CTRL_REG, tmp); |
312 | } | 307 | } |
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index 901236fa0f07..13d5a87f13b1 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c | |||
@@ -107,8 +107,6 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
107 | pr_debug("%d: %d\n", i, cbe_freqs[i].frequency); | 107 | pr_debug("%d: %d\n", i, cbe_freqs[i].frequency); |
108 | } | 108 | } |
109 | 109 | ||
110 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
111 | |||
112 | /* if DEBUG is enabled set_pmode() measures the latency | 110 | /* if DEBUG is enabled set_pmode() measures the latency |
113 | * of a transition */ | 111 | * of a transition */ |
114 | policy->cpuinfo.transition_latency = 25000; | 112 | policy->cpuinfo.transition_latency = 25000; |
@@ -119,7 +117,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
119 | policy->cur = cbe_freqs[cur_pmode].frequency; | 117 | policy->cur = cbe_freqs[cur_pmode].frequency; |
120 | 118 | ||
121 | #ifdef CONFIG_SMP | 119 | #ifdef CONFIG_SMP |
122 | policy->cpus = cpu_sibling_map[policy->cpu]; | 120 | policy->cpus = per_cpu(cpu_sibling_map, policy->cpu); |
123 | #endif | 121 | #endif |
124 | 122 | ||
125 | cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); | 123 | cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); |
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 3ae083851b01..1cfb8b0c8fec 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c | |||
@@ -195,8 +195,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
195 | pr_debug("%d: %d\n", i, pas_freqs[i].frequency); | 195 | pr_debug("%d: %d\n", i, pas_freqs[i].frequency); |
196 | } | 196 | } |
197 | 197 | ||
198 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
199 | |||
200 | policy->cpuinfo.transition_latency = get_gizmo_latency(); | 198 | policy->cpuinfo.transition_latency = get_gizmo_latency(); |
201 | 199 | ||
202 | cur_astate = get_cur_astate(policy->cpu); | 200 | cur_astate = get_cur_astate(policy->cpu); |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index 1fe35dab0e9e..c04abcc28a7a 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -410,7 +410,6 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
410 | if (policy->cpu != 0) | 410 | if (policy->cpu != 0) |
411 | return -ENODEV; | 411 | return -ENODEV; |
412 | 412 | ||
413 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
414 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 413 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; |
415 | policy->cur = cur_freq; | 414 | policy->cur = cur_freq; |
416 | 415 | ||
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c index 00f50298c342..4dfb4bc242b5 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/arch/powerpc/platforms/powermac/cpufreq_64.c | |||
@@ -357,7 +357,6 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu) | |||
357 | 357 | ||
358 | static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) | 358 | static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) |
359 | { | 359 | { |
360 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
361 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 360 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; |
362 | policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; | 361 | policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; |
363 | /* secondary CPUs are tied to the primary one by the | 362 | /* secondary CPUs are tied to the primary one by the |
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 4bb634a17e43..07e64b48e7fc 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -437,18 +437,12 @@ static void ps3_system_bus_shutdown(struct device *_dev) | |||
437 | dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__); | 437 | dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__); |
438 | } | 438 | } |
439 | 439 | ||
440 | static int ps3_system_bus_uevent(struct device *_dev, char **envp, | 440 | static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env) |
441 | int num_envp, char *buffer, int buffer_size) | ||
442 | { | 441 | { |
443 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); | 442 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); |
444 | int i = 0, length = 0; | ||
445 | 443 | ||
446 | if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, | 444 | if (add_uevent_var(env, "MODALIAS=ps3:%d", dev->match_id)) |
447 | &length, "MODALIAS=ps3:%d", | ||
448 | dev->match_id)) | ||
449 | return -ENOMEM; | 445 | return -ENOMEM; |
450 | |||
451 | envp[i] = NULL; | ||
452 | return 0; | 446 | return 0; |
453 | } | 447 | } |
454 | 448 | ||
@@ -622,17 +616,18 @@ static void ps3_unmap_single(struct device *_dev, dma_addr_t dma_addr, | |||
622 | } | 616 | } |
623 | } | 617 | } |
624 | 618 | ||
625 | static int ps3_sb_map_sg(struct device *_dev, struct scatterlist *sg, int nents, | 619 | static int ps3_sb_map_sg(struct device *_dev, struct scatterlist *sgl, |
626 | enum dma_data_direction direction) | 620 | int nents, enum dma_data_direction direction) |
627 | { | 621 | { |
628 | #if defined(CONFIG_PS3_DYNAMIC_DMA) | 622 | #if defined(CONFIG_PS3_DYNAMIC_DMA) |
629 | BUG_ON("do"); | 623 | BUG_ON("do"); |
630 | return -EPERM; | 624 | return -EPERM; |
631 | #else | 625 | #else |
632 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); | 626 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); |
627 | struct scatterlist *sg; | ||
633 | int i; | 628 | int i; |
634 | 629 | ||
635 | for (i = 0; i < nents; i++, sg++) { | 630 | for_each_sg(sgl, sg, nents, i) { |
636 | int result = ps3_dma_map(dev->d_region, | 631 | int result = ps3_dma_map(dev->d_region, |
637 | page_to_phys(sg->page) + sg->offset, sg->length, | 632 | page_to_phys(sg->page) + sg->offset, sg->length, |
638 | &sg->dma_address, 0); | 633 | &sg->dma_address, 0); |
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c index ab11c0b29024..427027c7ea0f 100644 --- a/arch/powerpc/sysdev/dcr.c +++ b/arch/powerpc/sysdev/dcr.c | |||
@@ -126,13 +126,13 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n, | |||
126 | } | 126 | } |
127 | EXPORT_SYMBOL_GPL(dcr_map); | 127 | EXPORT_SYMBOL_GPL(dcr_map); |
128 | 128 | ||
129 | void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c) | 129 | void dcr_unmap(dcr_host_t host, unsigned int dcr_c) |
130 | { | 130 | { |
131 | dcr_host_t h = host; | 131 | dcr_host_t h = host; |
132 | 132 | ||
133 | if (h.token == NULL) | 133 | if (h.token == NULL) |
134 | return; | 134 | return; |
135 | h.token += dcr_n * h.stride; | 135 | h.token += host.base * h.stride; |
136 | iounmap(h.token); | 136 | iounmap(h.token); |
137 | h.token = NULL; | 137 | h.token = NULL; |
138 | } | 138 | } |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 893e65439e85..e47938899a92 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -156,7 +156,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type, | |||
156 | switch(type) { | 156 | switch(type) { |
157 | #ifdef CONFIG_PPC_DCR | 157 | #ifdef CONFIG_PPC_DCR |
158 | case mpic_access_dcr: | 158 | case mpic_access_dcr: |
159 | return dcr_read(rb->dhost, rb->dhost.base + reg); | 159 | return dcr_read(rb->dhost, reg); |
160 | #endif | 160 | #endif |
161 | case mpic_access_mmio_be: | 161 | case mpic_access_mmio_be: |
162 | return in_be32(rb->base + (reg >> 2)); | 162 | return in_be32(rb->base + (reg >> 2)); |
@@ -173,7 +173,7 @@ static inline void _mpic_write(enum mpic_reg_type type, | |||
173 | switch(type) { | 173 | switch(type) { |
174 | #ifdef CONFIG_PPC_DCR | 174 | #ifdef CONFIG_PPC_DCR |
175 | case mpic_access_dcr: | 175 | case mpic_access_dcr: |
176 | return dcr_write(rb->dhost, rb->dhost.base + reg, value); | 176 | return dcr_write(rb->dhost, reg, value); |
177 | #endif | 177 | #endif |
178 | case mpic_access_mmio_be: | 178 | case mpic_access_mmio_be: |
179 | return out_be32(rb->base + (reg >> 2), value); | 179 | return out_be32(rb->base + (reg >> 2), value); |