aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-20 23:19:15 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-20 23:19:15 -0400
commitcfa76f024f7c9e65169425804e5b32e71f66d0ee (patch)
treeee64e98cbfb1b654842c9256446a9584857f6730 /arch/parisc/kernel
parent093faa1dd26fc6766f8f04c429030757a8a0def4 (diff)
parent7210c678202bb3107085bffeb63f66a9b8ba1c85 (diff)
Merge branch 'master' of hera.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'master' of hera.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (29 commits) [PARISC] fix uninitialized variable warning in asm/rtc.h [PARISC] Port checkstack.pl to parisc [PARISC] Make palo target work when $obj != $src [PARISC] Zap unused variable warnings in pci.c [PARISC] Fix tests in palo target [PARISC] Fix palo target [PARISC] Restore palo target [PARISC] Attempt to clean up parisc/Makefile [PARISC] Fix infinite loop in /proc/iomem [PARISC] Quiet sysfs_create_link __must_check warnings in pdc_stable [PARISC] Squelch pci_enable_device __must_check warning in superio [PARISC] Kill off broken irqstack code [PARISC] Remove hardcoded uses of PAGE_SIZE [PARISC] Clean up pointless ASM_PAGE_SIZE_DIV use [PARISC] Kill off the last vestiges of ASM_PAGE_SIZE [PARISC] Kill off ASM_PAGE_SIZE use [PARISC] Beautify parisc vmlinux.lds.S [PARISC] Clean up a resource_size_t warning in sba_iommu [PARISC] Kill incorrect cast warning in unwinder [PARISC] Kill zone_to_nid printk warning ... Fixed trivial conflict in include/asm-parisc/tlbflush.h manually
Diffstat (limited to 'arch/parisc/kernel')
-rw-r--r--arch/parisc/kernel/asm-offsets.c3
-rw-r--r--arch/parisc/kernel/entry.S41
-rw-r--r--arch/parisc/kernel/head.S6
-rw-r--r--arch/parisc/kernel/hpmc.S4
-rw-r--r--arch/parisc/kernel/init_task.c1
-rw-r--r--arch/parisc/kernel/pacache.S8
-rw-r--r--arch/parisc/kernel/parisc_ksyms.c22
-rw-r--r--arch/parisc/kernel/pci-dma.c9
-rw-r--r--arch/parisc/kernel/pci.c42
-rw-r--r--arch/parisc/kernel/processor.c7
-rw-r--r--arch/parisc/kernel/smp.c12
-rw-r--r--arch/parisc/kernel/sys_parisc32.c7
-rw-r--r--arch/parisc/kernel/syscall.S13
-rw-r--r--arch/parisc/kernel/syscall_table.S1
-rw-r--r--arch/parisc/kernel/time.c6
-rw-r--r--arch/parisc/kernel/unwind.c4
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S313
17 files changed, 224 insertions, 275 deletions
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index d3b7917a87cb..eaa79bc14d94 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -290,9 +290,6 @@ int main(void)
290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); 290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE);
291 DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT); 291 DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT);
292 DEFINE(ASM_PT_INITIAL, PT_INITIAL); 292 DEFINE(ASM_PT_INITIAL, PT_INITIAL);
293 DEFINE(ASM_PAGE_SIZE, PAGE_SIZE);
294 DEFINE(ASM_PAGE_SIZE_DIV64, PAGE_SIZE/64);
295 DEFINE(ASM_PAGE_SIZE_DIV128, PAGE_SIZE/128);
296 BLANK(); 293 BLANK();
297 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); 294 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip));
298 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); 295 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space));
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 42598abf4576..111d47284eac 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -98,7 +98,6 @@
98 * The "get_stack" macros are responsible for determining the 98 * The "get_stack" macros are responsible for determining the
99 * kernel stack value. 99 * kernel stack value.
100 * 100 *
101 * For Faults:
102 * If sr7 == 0 101 * If sr7 == 0
103 * Already using a kernel stack, so call the 102 * Already using a kernel stack, so call the
104 * get_stack_use_r30 macro to push a pt_regs structure 103 * get_stack_use_r30 macro to push a pt_regs structure
@@ -110,26 +109,6 @@
110 * task pointer pointed to by cr30. Set the stack 109 * task pointer pointed to by cr30. Set the stack
111 * pointer to point to the end of the task structure. 110 * pointer to point to the end of the task structure.
112 * 111 *
113 * For Interrupts:
114 * If sr7 == 0
115 * Already using a kernel stack, check to see if r30
116 * is already pointing to the per processor interrupt
117 * stack. If it is, call the get_stack_use_r30 macro
118 * to push a pt_regs structure on the stack, and store
119 * registers there. Otherwise, call get_stack_use_cr31
120 * to get a pointer to the base of the interrupt stack
121 * and push a pt_regs structure on that stack.
122 * else
123 * Need to set up a kernel stack, so call the
124 * get_stack_use_cr30 macro to set up a pointer
125 * to the pt_regs structure contained within the
126 * task pointer pointed to by cr30. Set the stack
127 * pointer to point to the end of the task structure.
128 * N.B: We don't use the interrupt stack for the
129 * first interrupt from userland, because signals/
130 * resched's are processed when returning to userland,
131 * and we can sleep in those cases.
132 *
133 * Note that we use shadowed registers for temps until 112 * Note that we use shadowed registers for temps until
134 * we can save %r26 and %r29. %r26 is used to preserve 113 * we can save %r26 and %r29. %r26 is used to preserve
135 * %r8 (a shadowed register) which temporarily contained 114 * %r8 (a shadowed register) which temporarily contained
@@ -652,7 +631,7 @@
652 631
653 .text 632 .text
654 633
655 .align 4096 634 .align PAGE_SIZE
656 635
657ENTRY(fault_vector_20) 636ENTRY(fault_vector_20)
658 /* First vector is invalid (0) */ 637 /* First vector is invalid (0) */
@@ -904,7 +883,7 @@ ENDPROC(_switch_to)
904 * 883 *
905 */ 884 */
906 885
907 .align 4096 886 .align PAGE_SIZE
908 887
909ENTRY(syscall_exit_rfi) 888ENTRY(syscall_exit_rfi)
910 mfctl %cr30,%r16 889 mfctl %cr30,%r16
@@ -1086,23 +1065,13 @@ intr_do_preempt:
1086 1065
1087intr_extint: 1066intr_extint:
1088 CMPIB=,n 0,%r16,1f 1067 CMPIB=,n 0,%r16,1f
1068
1089 get_stack_use_cr30 1069 get_stack_use_cr30
1090 b,n 3f 1070 b,n 2f
1091 1071
10921: 10721:
1093#if 0 /* Interrupt Stack support not working yet! */
1094 mfctl %cr31,%r1
1095 copy %r30,%r17
1096 /* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/
1097 DEPI 0,31,15,%r17
1098 CMPB=,n %r1,%r17,2f
1099 get_stack_use_cr31
1100 b,n 3f
1101#endif
11022:
1103 get_stack_use_r30 1073 get_stack_use_r30
1104 10742:
11053:
1106 save_specials %r29 1075 save_specials %r29
1107 virt_map 1076 virt_map
1108 save_general %r29 1077 save_general %r29
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 9676c486bb63..a7b8859488bb 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -95,7 +95,7 @@ $bss_loop:
95 95
961: 961:
97 stw %r3,0(%r4) 97 stw %r3,0(%r4)
98 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 98 ldo (PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
99 addib,> -1,%r1,1b 99 addib,> -1,%r1,1b
100#if PT_NLEVELS == 3 100#if PT_NLEVELS == 3
101 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4 101 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4
@@ -128,10 +128,6 @@ $pgt_fill_loop:
128 /* And the stack pointer too */ 128 /* And the stack pointer too */
129 ldo THREAD_SZ_ALGN(%r6),%sp 129 ldo THREAD_SZ_ALGN(%r6),%sp
130 130
131 /* And the interrupt stack */
132 load32 interrupt_stack,%r6
133 mtctl %r6,%cr31
134
135#ifdef CONFIG_SMP 131#ifdef CONFIG_SMP
136 /* Set the smp rendevous address into page zero. 132 /* Set the smp rendevous address into page zero.
137 ** It would be safer to do this in init_smp_config() but 133 ** It would be safer to do this in init_smp_config() but
diff --git a/arch/parisc/kernel/hpmc.S b/arch/parisc/kernel/hpmc.S
index 43b41df0b541..2cbf13b3ef11 100644
--- a/arch/parisc/kernel/hpmc.S
+++ b/arch/parisc/kernel/hpmc.S
@@ -55,13 +55,13 @@
55 * IODC requires 7K byte stack. That leaves 1K byte for os_hpmc. 55 * IODC requires 7K byte stack. That leaves 1K byte for os_hpmc.
56 */ 56 */
57 57
58 .align 4096 58 .align PAGE_SIZE
59hpmc_stack: 59hpmc_stack:
60 .block 16384 60 .block 16384
61 61
62#define HPMC_IODC_BUF_SIZE 0x8000 62#define HPMC_IODC_BUF_SIZE 0x8000
63 63
64 .align 4096 64 .align PAGE_SIZE
65hpmc_iodc_buf: 65hpmc_iodc_buf:
66 .block HPMC_IODC_BUF_SIZE 66 .block HPMC_IODC_BUF_SIZE
67 67
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 446f98d3fd7b..26198a074d67 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -49,7 +49,6 @@ EXPORT_SYMBOL(init_mm);
49 * way process stacks are handled. This is done by having a special 49 * way process stacks are handled. This is done by having a special
50 * "init_task" linker map entry.. 50 * "init_task" linker map entry..
51 */ 51 */
52unsigned char interrupt_stack[ISTACK_SIZE] __attribute__ ((section("init_istack"), aligned(4096)));
53union thread_union init_thread_union 52union thread_union init_thread_union
54 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = 53 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
55 { INIT_THREAD_INFO(init_task) }; 54 { INIT_THREAD_INFO(init_task) };
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 90b240878520..5901092e0196 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -289,7 +289,7 @@ ENTRY(copy_user_page_asm)
289 */ 289 */
290 290
291 ldd 0(%r25), %r19 291 ldd 0(%r25), %r19
292 ldi ASM_PAGE_SIZE_DIV128, %r1 292 ldi (PAGE_SIZE / 128), %r1
293 293
294 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */ 294 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */
295 ldw 128(%r25), %r0 /* prefetch 2 */ 295 ldw 128(%r25), %r0 /* prefetch 2 */
@@ -355,7 +355,7 @@ ENTRY(copy_user_page_asm)
355 * use ldd/std on a 32 bit kernel. 355 * use ldd/std on a 32 bit kernel.
356 */ 356 */
357 ldw 0(%r25), %r19 357 ldw 0(%r25), %r19
358 ldi ASM_PAGE_SIZE_DIV64, %r1 358 ldi (PAGE_SIZE / 64), %r1
359 359
3601: 3601:
361 ldw 4(%r25), %r20 361 ldw 4(%r25), %r20
@@ -553,7 +553,7 @@ ENTRY(__clear_user_page_asm)
553 pdtlb 0(%r28) 553 pdtlb 0(%r28)
554 554
555#ifdef CONFIG_64BIT 555#ifdef CONFIG_64BIT
556 ldi ASM_PAGE_SIZE_DIV128, %r1 556 ldi (PAGE_SIZE / 128), %r1
557 557
558 /* PREFETCH (Write) has not (yet) been proven to help here */ 558 /* PREFETCH (Write) has not (yet) been proven to help here */
559 /* #define PREFETCHW_OP ldd 256(%0), %r0 */ 559 /* #define PREFETCHW_OP ldd 256(%0), %r0 */
@@ -578,7 +578,7 @@ ENTRY(__clear_user_page_asm)
578 ldo 128(%r28), %r28 578 ldo 128(%r28), %r28
579 579
580#else /* ! CONFIG_64BIT */ 580#else /* ! CONFIG_64BIT */
581 ldi ASM_PAGE_SIZE_DIV64, %r1 581 ldi (PAGE_SIZE / 64), %r1
582 582
5831: 5831:
584 stw %r0, 0(%r28) 584 stw %r0, 0(%r28)
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index 7aca704e96f0..671ee5b9950c 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -122,31 +122,9 @@ EXPORT_SYMBOL($$divI_12);
122EXPORT_SYMBOL($$divI_14); 122EXPORT_SYMBOL($$divI_14);
123EXPORT_SYMBOL($$divI_15); 123EXPORT_SYMBOL($$divI_15);
124 124
125extern void __ashrdi3(void);
126extern void __ashldi3(void);
127extern void __lshrdi3(void);
128extern void __muldi3(void);
129
130EXPORT_SYMBOL(__ashrdi3);
131EXPORT_SYMBOL(__ashldi3);
132EXPORT_SYMBOL(__lshrdi3);
133EXPORT_SYMBOL(__muldi3);
134
135asmlinkage void * __canonicalize_funcptr_for_compare(void *); 125asmlinkage void * __canonicalize_funcptr_for_compare(void *);
136EXPORT_SYMBOL(__canonicalize_funcptr_for_compare); 126EXPORT_SYMBOL(__canonicalize_funcptr_for_compare);
137 127
138#ifdef CONFIG_64BIT
139extern void __divdi3(void);
140extern void __udivdi3(void);
141extern void __umoddi3(void);
142extern void __moddi3(void);
143
144EXPORT_SYMBOL(__divdi3);
145EXPORT_SYMBOL(__udivdi3);
146EXPORT_SYMBOL(__umoddi3);
147EXPORT_SYMBOL(__moddi3);
148#endif
149
150#ifndef CONFIG_64BIT 128#ifndef CONFIG_64BIT
151extern void $$dyncall(void); 129extern void $$dyncall(void);
152EXPORT_SYMBOL($$dyncall); 130EXPORT_SYMBOL($$dyncall);
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 23c1388df1f5..41f8e321e34c 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -569,11 +569,10 @@ static void *fail_alloc_consistent(struct device *dev, size_t size,
569static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size, 569static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
570 dma_addr_t *dma_handle, gfp_t flag) 570 dma_addr_t *dma_handle, gfp_t flag)
571{ 571{
572 void *addr = NULL; 572 void *addr;
573 573
574 /* rely on kmalloc to be cacheline aligned */ 574 addr = (void *)__get_free_pages(flag, get_order(size));
575 addr = kmalloc(size, flag); 575 if (addr)
576 if(addr)
577 *dma_handle = (dma_addr_t)virt_to_phys(addr); 576 *dma_handle = (dma_addr_t)virt_to_phys(addr);
578 577
579 return addr; 578 return addr;
@@ -582,7 +581,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
582static void pa11_dma_free_noncoherent(struct device *dev, size_t size, 581static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
583 void *vaddr, dma_addr_t iova) 582 void *vaddr, dma_addr_t iova)
584{ 583{
585 kfree(vaddr); 584 free_pages((unsigned long)vaddr, get_order(size));
586 return; 585 return;
587} 586}
588 587
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 563df0072dee..507d0ac99f66 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -194,37 +194,13 @@ void __init pcibios_init_bus(struct pci_bus *bus)
194 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl); 194 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl);
195} 195}
196 196
197
198/* KLUGE: Link the child and parent resources - generic PCI didn't */
199static void
200pcibios_link_hba_resources( struct resource *hba_res, struct resource *r)
201{
202 if (!r->parent) {
203 printk(KERN_EMERG "PCI: resource not parented! [%p-%p]\n",
204 (void*) r->start, (void*) r->end);
205 r->parent = hba_res;
206
207 /* reverse link is harder *sigh* */
208 if (r->parent->child) {
209 if (r->parent->sibling) {
210 struct resource *next = r->parent->sibling;
211 while (next->sibling)
212 next = next->sibling;
213 next->sibling = r;
214 } else {
215 r->parent->sibling = r;
216 }
217 } else
218 r->parent->child = r;
219 }
220}
221
222/* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */ 197/* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */
223void __devinit pcibios_resource_to_bus(struct pci_dev *dev, 198void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
224 struct pci_bus_region *region, struct resource *res) 199 struct pci_bus_region *region, struct resource *res)
225{ 200{
226 struct pci_bus *bus = dev->bus; 201#ifdef CONFIG_64BIT
227 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); 202 struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data);
203#endif
228 204
229 if (res->flags & IORESOURCE_IO) { 205 if (res->flags & IORESOURCE_IO) {
230 /* 206 /*
@@ -243,23 +219,15 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
243 } 219 }
244 220
245 DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", 221 DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n",
246 bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", 222 dev->bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM",
247 region->start, region->end); 223 region->start, region->end);
248
249 /* KLUGE ALERT
250 ** if this resource isn't linked to a "parent", then it seems
251 ** to be a child of the HBA - lets link it in.
252 */
253 pcibios_link_hba_resources(&hba->io_space, bus->resource[0]);
254 pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]);
255} 224}
256 225
257void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 226void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
258 struct pci_bus_region *region) 227 struct pci_bus_region *region)
259{ 228{
260#ifdef CONFIG_64BIT 229#ifdef CONFIG_64BIT
261 struct pci_bus *bus = dev->bus; 230 struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data);
262 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data);
263#endif 231#endif
264 232
265 if (res->flags & IORESOURCE_MEM) { 233 if (res->flags & IORESOURCE_MEM) {
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index 549f5484342c..370086fb8333 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -82,7 +82,12 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
82 unsigned long cpuid; 82 unsigned long cpuid;
83 struct cpuinfo_parisc *p; 83 struct cpuinfo_parisc *p;
84 84
85#ifndef CONFIG_SMP 85#ifdef CONFIG_SMP
86 if (num_online_cpus() >= NR_CPUS) {
87 printk(KERN_INFO "num_online_cpus() >= NR_CPUS\n");
88 return 1;
89 }
90#else
86 if (boot_cpu_data.cpu_count > 0) { 91 if (boot_cpu_data.cpu_count > 0) {
87 printk(KERN_INFO "CONFIG_SMP=n ignoring additional CPUs\n"); 92 printk(KERN_INFO "CONFIG_SMP=n ignoring additional CPUs\n");
88 return 1; 93 return 1;
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index d7bc7bb42c94..85fc7754ec25 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -432,22 +432,10 @@ smp_cpu_init(int cpunum)
432void __init smp_callin(void) 432void __init smp_callin(void)
433{ 433{
434 int slave_id = cpu_now_booting; 434 int slave_id = cpu_now_booting;
435#if 0
436 void *istack;
437#endif
438 435
439 smp_cpu_init(slave_id); 436 smp_cpu_init(slave_id);
440 preempt_disable(); 437 preempt_disable();
441 438
442#if 0 /* NOT WORKING YET - see entry.S */
443 istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER);
444 if (istack == NULL) {
445 printk(KERN_CRIT "Failed to allocate interrupt stack for cpu %d\n",slave_id);
446 BUG();
447 }
448 mtctl(istack,31);
449#endif
450
451 flush_cache_all_local(); /* start with known state */ 439 flush_cache_all_local(); /* start with known state */
452 flush_tlb_all_local(NULL); 440 flush_tlb_all_local(NULL);
453 441
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 2989c6682bf6..50bbf33ee00c 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -473,3 +473,10 @@ long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char __user *buf,
473 return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low, 473 return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
474 buf, len); 474 buf, len);
475} 475}
476
477asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
478 u32 lenhi, u32 lenlo)
479{
480 return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
481 ((loff_t)lenhi << 32) | lenlo);
482}
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 56f6231cb863..69b6eebc466e 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -10,6 +10,7 @@
10#include <asm/asm-offsets.h> 10#include <asm/asm-offsets.h>
11#include <asm/unistd.h> 11#include <asm/unistd.h>
12#include <asm/errno.h> 12#include <asm/errno.h>
13#include <asm/page.h>
13#include <asm/psw.h> 14#include <asm/psw.h>
14#include <asm/thread_info.h> 15#include <asm/thread_info.h>
15#include <asm/assembly.h> 16#include <asm/assembly.h>
@@ -38,7 +39,7 @@
38 * pointers. 39 * pointers.
39 */ 40 */
40 41
41 .align ASM_PAGE_SIZE 42 .align PAGE_SIZE
42ENTRY(linux_gateway_page) 43ENTRY(linux_gateway_page)
43 44
44 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ 45 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */
@@ -597,7 +598,7 @@ cas_action:
597 598
598 599
599 /* Make sure nothing else is placed on this page */ 600 /* Make sure nothing else is placed on this page */
600 .align ASM_PAGE_SIZE 601 .align PAGE_SIZE
601END(linux_gateway_page) 602END(linux_gateway_page)
602ENTRY(end_linux_gateway_page) 603ENTRY(end_linux_gateway_page)
603 604
@@ -608,7 +609,7 @@ ENTRY(end_linux_gateway_page)
608 609
609 .section .rodata,"a" 610 .section .rodata,"a"
610 611
611 .align ASM_PAGE_SIZE 612 .align PAGE_SIZE
612 /* Light-weight-syscall table */ 613 /* Light-weight-syscall table */
613 /* Start of lws table. */ 614 /* Start of lws table. */
614ENTRY(lws_table) 615ENTRY(lws_table)
@@ -617,13 +618,13 @@ ENTRY(lws_table)
617END(lws_table) 618END(lws_table)
618 /* End of lws table */ 619 /* End of lws table */
619 620
620 .align ASM_PAGE_SIZE 621 .align PAGE_SIZE
621ENTRY(sys_call_table) 622ENTRY(sys_call_table)
622#include "syscall_table.S" 623#include "syscall_table.S"
623END(sys_call_table) 624END(sys_call_table)
624 625
625#ifdef CONFIG_64BIT 626#ifdef CONFIG_64BIT
626 .align ASM_PAGE_SIZE 627 .align PAGE_SIZE
627ENTRY(sys_call_table64) 628ENTRY(sys_call_table64)
628#define SYSCALL_TABLE_64BIT 629#define SYSCALL_TABLE_64BIT
629#include "syscall_table.S" 630#include "syscall_table.S"
@@ -636,7 +637,7 @@ END(sys_call_table64)
636 will use this set of locks 637 will use this set of locks
637 */ 638 */
638 .section .data 639 .section .data
639 .align 4096 640 .align PAGE_SIZE
640ENTRY(lws_lock_start) 641ENTRY(lws_lock_start)
641 /* lws locks */ 642 /* lws locks */
642 .align 16 643 .align 16
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 2540786a970f..117438e9eb2a 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -403,6 +403,7 @@
403 ENTRY_COMP(signalfd) 403 ENTRY_COMP(signalfd)
404 ENTRY_COMP(timerfd) 404 ENTRY_COMP(timerfd)
405 ENTRY_SAME(eventfd) 405 ENTRY_SAME(eventfd)
406 ENTRY_COMP(fallocate) /* 305 */
406 407
407 /* Nothing yet */ 408 /* Nothing yet */
408 409
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 8b3062a5c812..24be86bba94d 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -189,16 +189,14 @@ static struct clocksource clocksource_cr16 = {
189#ifdef CONFIG_SMP 189#ifdef CONFIG_SMP
190int update_cr16_clocksource(void) 190int update_cr16_clocksource(void)
191{ 191{
192 int change = 0;
193
194 /* since the cr16 cycle counters are not synchronized across CPUs, 192 /* since the cr16 cycle counters are not synchronized across CPUs,
195 we'll check if we should switch to a safe clocksource: */ 193 we'll check if we should switch to a safe clocksource: */
196 if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { 194 if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) {
197 clocksource_change_rating(&clocksource_cr16, 0); 195 clocksource_change_rating(&clocksource_cr16, 0);
198 change = 1; 196 return 1;
199 } 197 }
200 198
201 return change; 199 return 0;
202} 200}
203#else 201#else
204int update_cr16_clocksource(void) 202int update_cr16_clocksource(void)
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index cf780cb3b916..701b2d2d8882 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -209,8 +209,8 @@ static int unwind_init(void)
209 209
210static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size) 210static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size)
211{ 211{
212 void handle_interruption(int, struct pt_regs *); 212 extern void handle_interruption(int, struct pt_regs *);
213 static unsigned long *hi = (unsigned long)&handle_interruption; 213 static unsigned long *hi = (unsigned long *)&handle_interruption;
214 214
215 if (pc == get_func_addr(hi)) { 215 if (pc == get_func_addr(hi)) {
216 struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN); 216 struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN);
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index ee7a16eb6fdd..40d0ff9b81ab 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -46,168 +46,211 @@ jiffies = jiffies_64;
46#endif 46#endif
47SECTIONS 47SECTIONS
48{ 48{
49 . = KERNEL_BINARY_TEXT_START;
49 50
50 . = KERNEL_BINARY_TEXT_START; 51 _text = .; /* Text and read-only data */
51 52 .text ALIGN(16) : {
52 _text = .; /* Text and read-only data */ 53 TEXT_TEXT
53 .text ALIGN(16) : { 54 SCHED_TEXT
54 TEXT_TEXT 55 LOCK_TEXT
55 SCHED_TEXT 56 *(.text.do_softirq)
56 LOCK_TEXT 57 *(.text.sys_exit)
57 *(.text.do_softirq) 58 *(.text.do_sigaltstack)
58 *(.text.sys_exit) 59 *(.text.do_fork)
59 *(.text.do_sigaltstack) 60 *(.text.*)
60 *(.text.do_fork) 61 *(.fixup)
61 *(.text.*) 62 *(.lock.text) /* out-of-line lock text */
62 *(.fixup) 63 *(.gnu.warning)
63 *(.lock.text) /* out-of-line lock text */
64 *(.gnu.warning)
65 } = 0 64 } = 0
65 /* End of text section */
66 _etext = .;
66 67
67 _etext = .; /* End of text section */ 68 RODATA
69 BUG_TABLE
68 70
69 RODATA 71 /* writeable */
70 72 /* Make sure this is page aligned so
71 BUG_TABLE 73 * that we can properly leave these
72 74 * as writable
73 /* writeable */ 75 */
74 . = ALIGN(ASM_PAGE_SIZE); /* Make sure this is page aligned so 76 . = ALIGN(PAGE_SIZE);
75 that we can properly leave these 77 data_start = .;
76 as writable */ 78 . = ALIGN(16);
77 data_start = .; 79 /* Exception table */
78 80 __ex_table : {
79 . = ALIGN(16); /* Exception table */ 81 __start___ex_table = .;
80 __start___ex_table = .; 82 *(__ex_table)
81 __ex_table : { *(__ex_table) } 83 __stop___ex_table = .;
82 __stop___ex_table = .; 84 }
83 85
84 NOTES 86 NOTES
85 87
86 __start___unwind = .; /* unwind info */ 88 /* unwind info */
87 .PARISC.unwind : { *(.PARISC.unwind) } 89 .PARISC.unwind : {
88 __stop___unwind = .; 90 __start___unwind = .;
91 *(.PARISC.unwind)
92 __stop___unwind = .;
93 }
89 94
90 /* rarely changed data like cpu maps */ 95 /* rarely changed data like cpu maps */
91 . = ALIGN(16); 96 . = ALIGN(16);
92 .data.read_mostly : { *(.data.read_mostly) } 97 .data.read_mostly : {
98 *(.data.read_mostly)
99 }
93 100
94 . = ALIGN(L1_CACHE_BYTES); 101 . = ALIGN(L1_CACHE_BYTES);
95 .data : { /* Data */ 102 /* Data */
96 DATA_DATA 103 .data : {
97 CONSTRUCTORS 104 DATA_DATA
105 CONSTRUCTORS
98 } 106 }
99 107
100 . = ALIGN(L1_CACHE_BYTES); 108 . = ALIGN(L1_CACHE_BYTES);
101 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 109 .data.cacheline_aligned : {
110 *(.data.cacheline_aligned)
111 }
102 112
103 /* PA-RISC locks requires 16-byte alignment */ 113 /* PA-RISC locks requires 16-byte alignment */
104 . = ALIGN(16); 114 . = ALIGN(16);
105 .data.lock_aligned : { *(.data.lock_aligned) } 115 .data.lock_aligned : {
116 *(.data.lock_aligned)
117 }
106 118
107 . = ALIGN(ASM_PAGE_SIZE); 119 /* nosave data is really only used for software suspend...it's here
108 /* nosave data is really only used for software suspend...it's here 120 * just in case we ever implement it
109 * just in case we ever implement it */ 121 */
110 __nosave_begin = .; 122 . = ALIGN(PAGE_SIZE);
111 .data_nosave : { *(.data.nosave) } 123 __nosave_begin = .;
112 . = ALIGN(ASM_PAGE_SIZE); 124 .data_nosave : {
113 __nosave_end = .; 125 *(.data.nosave)
126 }
127 . = ALIGN(PAGE_SIZE);
128 __nosave_end = .;
114 129
115 _edata = .; /* End of data section */ 130 /* End of data section */
131 _edata = .;
116 132
117 __bss_start = .; /* BSS */ 133 /* BSS */
118 /* page table entries need to be PAGE_SIZE aligned */ 134 __bss_start = .;
119 . = ALIGN(ASM_PAGE_SIZE); 135 /* page table entries need to be PAGE_SIZE aligned */
120 .data.vmpages : { 136 . = ALIGN(PAGE_SIZE);
121 *(.data.vm0.pmd) 137 .data.vmpages : {
122 *(.data.vm0.pgd) 138 *(.data.vm0.pmd)
123 *(.data.vm0.pte) 139 *(.data.vm0.pgd)
140 *(.data.vm0.pte)
124 } 141 }
125 .bss : { *(.bss) *(COMMON) } 142 .bss : {
126 __bss_stop = .; 143 *(.bss)
127 144 *(COMMON)
145 }
146 __bss_stop = .;
128 147
129 /* assembler code expects init_task to be 16k aligned */
130 . = ALIGN(16384); /* init_task */
131 .data.init_task : { *(.data.init_task) }
132 148
133 /* The interrupt stack is currently partially coded, but not yet 149 /* assembler code expects init_task to be 16k aligned */
134 * implemented */ 150 . = ALIGN(16384);
135 . = ALIGN(16384); 151 /* init_task */
136 init_istack : { *(init_istack) } 152 .data.init_task : {
153 *(.data.init_task)
154 }
137 155
138#ifdef CONFIG_64BIT 156#ifdef CONFIG_64BIT
139 . = ALIGN(16); /* Linkage tables */ 157 . = ALIGN(16);
140 .opd : { *(.opd) } PROVIDE (__gp = .); 158 /* Linkage tables */
141 .plt : { *(.plt) } 159 .opd : {
142 .dlt : { *(.dlt) } 160 *(.opd)
161 } PROVIDE (__gp = .);
162 .plt : {
163 *(.plt)
164 }
165 .dlt : {
166 *(.dlt)
167 }
143#endif 168#endif
144 169
145 /* reserve space for interrupt stack by aligning __init* to 16k */ 170 /* reserve space for interrupt stack by aligning __init* to 16k */
146 . = ALIGN(16384); 171 . = ALIGN(16384);
147 __init_begin = .; 172 __init_begin = .;
148 .init.text : { 173 .init.text : {
149 _sinittext = .; 174 _sinittext = .;
150 *(.init.text) 175 *(.init.text)
151 _einittext = .; 176 _einittext = .;
152 } 177 }
153 .init.data : { *(.init.data) } 178 .init.data : {
154 . = ALIGN(16); 179 *(.init.data)
155 __setup_start = .; 180 }
156 .init.setup : { *(.init.setup) } 181 . = ALIGN(16);
157 __setup_end = .; 182 .init.setup : {
158 __initcall_start = .; 183 __setup_start = .;
159 .initcall.init : { 184 *(.init.setup)
160 INITCALLS 185 __setup_end = .;
161 } 186 }
162 __initcall_end = .; 187 .initcall.init : {
163 __con_initcall_start = .; 188 __initcall_start = .;
164 .con_initcall.init : { *(.con_initcall.init) } 189 INITCALLS
165 __con_initcall_end = .; 190 __initcall_end = .;
166 SECURITY_INIT 191 }
167 /* alternate instruction replacement. This is a mechanism x86 uses 192 .con_initcall.init : {
168 * to detect the CPU type and replace generic instruction sequences 193 __con_initcall_start = .;
169 * with CPU specific ones. We don't currently do this in PA, but 194 *(.con_initcall.init)
170 * it seems like a good idea... */ 195 __con_initcall_end = .;
171 . = ALIGN(4); 196 }
172 __alt_instructions = .; 197 SECURITY_INIT
173 .altinstructions : { *(.altinstructions) } 198
174 __alt_instructions_end = .; 199 /* alternate instruction replacement. This is a mechanism x86 uses
175 .altinstr_replacement : { *(.altinstr_replacement) } 200 * to detect the CPU type and replace generic instruction sequences
176 /* .exit.text is discard at runtime, not link time, to deal with references 201 * with CPU specific ones. We don't currently do this in PA, but
177 from .altinstructions and .eh_frame */ 202 * it seems like a good idea...
178 .exit.text : { *(.exit.text) } 203 */
179 .exit.data : { *(.exit.data) } 204 . = ALIGN(4);
205 .altinstructions : {
206 __alt_instructions = .;
207 *(.altinstructions)
208 __alt_instructions_end = .;
209 }
210 .altinstr_replacement : {
211 *(.altinstr_replacement)
212 }
213
214 /* .exit.text is discard at runtime, not link time, to deal with references
215 * from .altinstructions and .eh_frame
216 */
217 .exit.text : {
218 *(.exit.text)
219 }
220 .exit.data : {
221 *(.exit.data)
222 }
180#ifdef CONFIG_BLK_DEV_INITRD 223#ifdef CONFIG_BLK_DEV_INITRD
181 . = ALIGN(ASM_PAGE_SIZE); 224 . = ALIGN(PAGE_SIZE);
182 __initramfs_start = .; 225 .init.ramfs : {
183 .init.ramfs : { *(.init.ramfs) } 226 __initramfs_start = .;
184 __initramfs_end = .; 227 *(.init.ramfs)
228 __initramfs_end = .;
229 }
185#endif 230#endif
186 231
187 PERCPU(ASM_PAGE_SIZE) 232 PERCPU(PAGE_SIZE)
233 . = ALIGN(PAGE_SIZE);
234 __init_end = .;
235 /* freed after init ends here */
236 _end = . ;
188 237
189 . = ALIGN(ASM_PAGE_SIZE); 238 /* Sections to be discarded */
190 __init_end = .; 239 /DISCARD/ : {
191 /* freed after init ends here */ 240 *(.exitcall.exit)
192
193 _end = . ;
194
195 /* Sections to be discarded */
196 /DISCARD/ : {
197 *(.exitcall.exit)
198#ifdef CONFIG_64BIT 241#ifdef CONFIG_64BIT
199 /* temporary hack until binutils is fixed to not emit these 242 /* temporary hack until binutils is fixed to not emit these
200 for static binaries */ 243 * for static binaries
201 *(.interp) 244 */
202 *(.dynsym) 245 *(.interp)
203 *(.dynstr) 246 *(.dynsym)
204 *(.dynamic) 247 *(.dynstr)
205 *(.hash) 248 *(.dynamic)
206 *(.gnu.hash) 249 *(.hash)
250 *(.gnu.hash)
207#endif 251#endif
208 } 252 }
209 253
210 STABS_DEBUG 254 STABS_DEBUG
211 .note 0 : { *(.note) } 255 .note 0 : { *(.note) }
212
213} 256}