aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel')
-rw-r--r--arch/parisc/kernel/cache.c10
-rw-r--r--arch/parisc/kernel/drivers.c273
-rw-r--r--arch/parisc/kernel/entry.S188
-rw-r--r--arch/parisc/kernel/firmware.c16
-rw-r--r--arch/parisc/kernel/head.S73
-rw-r--r--arch/parisc/kernel/ioctl32.c32
-rw-r--r--arch/parisc/kernel/pacache.S186
-rw-r--r--arch/parisc/kernel/pci-dma.c48
-rw-r--r--arch/parisc/kernel/pci.c3
-rw-r--r--arch/parisc/kernel/pdc_cons.c46
-rw-r--r--arch/parisc/kernel/perf.c12
-rw-r--r--arch/parisc/kernel/process.c34
-rw-r--r--arch/parisc/kernel/processor.c8
-rw-r--r--arch/parisc/kernel/real2.S36
-rw-r--r--arch/parisc/kernel/signal.c22
-rw-r--r--arch/parisc/kernel/smp.c2
-rw-r--r--arch/parisc/kernel/syscall.S37
-rw-r--r--arch/parisc/kernel/syscall_table.S10
-rw-r--r--arch/parisc/kernel/time.c26
-rw-r--r--arch/parisc/kernel/traps.c37
-rw-r--r--arch/parisc/kernel/unaligned.c16
21 files changed, 607 insertions, 508 deletions
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index f46a07a79218..e15f09eaed12 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -27,6 +27,7 @@
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/pgalloc.h> 28#include <asm/pgalloc.h>
29#include <asm/processor.h> 29#include <asm/processor.h>
30#include <asm/sections.h>
30 31
31int split_tlb; 32int split_tlb;
32int dcache_stride; 33int dcache_stride;
@@ -207,6 +208,9 @@ parisc_cache_init(void)
207 208
208 /* "New and Improved" version from Jim Hull 209 /* "New and Improved" version from Jim Hull
209 * (1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift)) 210 * (1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift))
211 * The following CAFL_STRIDE is an optimized version, see
212 * http://lists.parisc-linux.org/pipermail/parisc-linux/2004-June/023625.html
213 * http://lists.parisc-linux.org/pipermail/parisc-linux/2004-June/023671.html
210 */ 214 */
211#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift)) 215#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift))
212 dcache_stride = CAFL_STRIDE(cache_info.dc_conf); 216 dcache_stride = CAFL_STRIDE(cache_info.dc_conf);
@@ -339,17 +343,15 @@ int parisc_cache_flush_threshold = FLUSH_THRESHOLD;
339void parisc_setup_cache_timing(void) 343void parisc_setup_cache_timing(void)
340{ 344{
341 unsigned long rangetime, alltime; 345 unsigned long rangetime, alltime;
342 extern char _text; /* start of kernel code, defined by linker */
343 extern char _end; /* end of BSS, defined by linker */
344 unsigned long size; 346 unsigned long size;
345 347
346 alltime = mfctl(16); 348 alltime = mfctl(16);
347 flush_data_cache(); 349 flush_data_cache();
348 alltime = mfctl(16) - alltime; 350 alltime = mfctl(16) - alltime;
349 351
350 size = (unsigned long)(&_end - _text); 352 size = (unsigned long)(_end - _text);
351 rangetime = mfctl(16); 353 rangetime = mfctl(16);
352 flush_kernel_dcache_range((unsigned long)&_text, size); 354 flush_kernel_dcache_range((unsigned long)_text, size);
353 rangetime = mfctl(16) - rangetime; 355 rangetime = mfctl(16) - rangetime;
354 356
355 printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n", 357 printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n",
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index d34bbe7ae0e3..988844a169e6 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -46,36 +46,51 @@ static struct device root = {
46 .bus_id = "parisc", 46 .bus_id = "parisc",
47}; 47};
48 48
49#define for_each_padev(padev) \ 49static inline int check_dev(struct device *dev)
50 for (padev = next_dev(&root); padev != NULL; \ 50{
51 padev = next_dev(&padev->dev)) 51 if (dev->bus == &parisc_bus_type) {
52 struct parisc_device *pdev;
53 pdev = to_parisc_device(dev);
54 return pdev->id.hw_type != HPHW_FAULTY;
55 }
56 return 1;
57}
58
59static struct device *
60parse_tree_node(struct device *parent, int index, struct hardware_path *modpath);
52 61
53#define check_dev(padev) \ 62struct recurse_struct {
54 (padev->id.hw_type != HPHW_FAULTY) ? padev : next_dev(&padev->dev) 63 void * obj;
64 int (*fn)(struct device *, void *);
65};
66
67static int descend_children(struct device * dev, void * data)
68{
69 struct recurse_struct * recurse_data = (struct recurse_struct *)data;
70
71 if (recurse_data->fn(dev, recurse_data->obj))
72 return 1;
73 else
74 return device_for_each_child(dev, recurse_data, descend_children);
75}
55 76
56/** 77/**
57 * next_dev - enumerates registered devices 78 * for_each_padev - Iterate over all devices in the tree
58 * @dev: the previous device returned from next_dev 79 * @fn: Function to call for each device.
80 * @data: Data to pass to the called function.
59 * 81 *
60 * next_dev does a depth-first search of the tree, returning parents 82 * This performs a depth-first traversal of the tree, calling the
61 * before children. Returns NULL when there are no more devices. 83 * function passed for each node. It calls the function for parents
84 * before children.
62 */ 85 */
63static struct parisc_device *next_dev(struct device *dev)
64{
65 if (!list_empty(&dev->children)) {
66 dev = list_to_dev(dev->children.next);
67 return check_dev(to_parisc_device(dev));
68 }
69 86
70 while (dev != &root) { 87static int for_each_padev(int (*fn)(struct device *, void *), void * data)
71 if (dev->node.next != &dev->parent->children) { 88{
72 dev = list_to_dev(dev->node.next); 89 struct recurse_struct recurse_data = {
73 return to_parisc_device(dev); 90 .obj = data,
74 } 91 .fn = fn,
75 dev = dev->parent; 92 };
76 } 93 return device_for_each_child(&root, &recurse_data, descend_children);
77
78 return NULL;
79} 94}
80 95
81/** 96/**
@@ -105,12 +120,6 @@ static int match_device(struct parisc_driver *driver, struct parisc_device *dev)
105 return 0; 120 return 0;
106} 121}
107 122
108static void claim_device(struct parisc_driver *driver, struct parisc_device *dev)
109{
110 dev->driver = driver;
111 request_mem_region(dev->hpa, 0x1000, driver->name);
112}
113
114static int parisc_driver_probe(struct device *dev) 123static int parisc_driver_probe(struct device *dev)
115{ 124{
116 int rc; 125 int rc;
@@ -119,8 +128,8 @@ static int parisc_driver_probe(struct device *dev)
119 128
120 rc = pa_drv->probe(pa_dev); 129 rc = pa_drv->probe(pa_dev);
121 130
122 if(!rc) 131 if (!rc)
123 claim_device(pa_drv, pa_dev); 132 pa_dev->driver = pa_drv;
124 133
125 return rc; 134 return rc;
126} 135}
@@ -131,7 +140,6 @@ static int parisc_driver_remove(struct device *dev)
131 struct parisc_driver *pa_drv = to_parisc_driver(dev->driver); 140 struct parisc_driver *pa_drv = to_parisc_driver(dev->driver);
132 if (pa_drv->remove) 141 if (pa_drv->remove)
133 pa_drv->remove(pa_dev); 142 pa_drv->remove(pa_dev);
134 release_mem_region(pa_dev->hpa, 0x1000);
135 143
136 return 0; 144 return 0;
137} 145}
@@ -173,6 +181,24 @@ int register_parisc_driver(struct parisc_driver *driver)
173} 181}
174EXPORT_SYMBOL(register_parisc_driver); 182EXPORT_SYMBOL(register_parisc_driver);
175 183
184
185struct match_count {
186 struct parisc_driver * driver;
187 int count;
188};
189
190static int match_and_count(struct device * dev, void * data)
191{
192 struct match_count * m = data;
193 struct parisc_device * pdev = to_parisc_device(dev);
194
195 if (check_dev(dev)) {
196 if (match_device(m->driver, pdev))
197 m->count++;
198 }
199 return 0;
200}
201
176/** 202/**
177 * count_parisc_driver - count # of devices this driver would match 203 * count_parisc_driver - count # of devices this driver would match
178 * @driver: the PA-RISC driver to try 204 * @driver: the PA-RISC driver to try
@@ -182,15 +208,14 @@ EXPORT_SYMBOL(register_parisc_driver);
182 */ 208 */
183int count_parisc_driver(struct parisc_driver *driver) 209int count_parisc_driver(struct parisc_driver *driver)
184{ 210{
185 struct parisc_device *device; 211 struct match_count m = {
186 int cnt = 0; 212 .driver = driver,
213 .count = 0,
214 };
187 215
188 for_each_padev(device) { 216 for_each_padev(match_and_count, &m);
189 if (match_device(driver, device))
190 cnt++;
191 }
192 217
193 return cnt; 218 return m.count;
194} 219}
195 220
196 221
@@ -206,14 +231,34 @@ int unregister_parisc_driver(struct parisc_driver *driver)
206} 231}
207EXPORT_SYMBOL(unregister_parisc_driver); 232EXPORT_SYMBOL(unregister_parisc_driver);
208 233
209static struct parisc_device *find_device_by_addr(unsigned long hpa) 234struct find_data {
235 unsigned long hpa;
236 struct parisc_device * dev;
237};
238
239static int find_device(struct device * dev, void * data)
210{ 240{
211 struct parisc_device *dev; 241 struct parisc_device * pdev = to_parisc_device(dev);
212 for_each_padev(dev) { 242 struct find_data * d = (struct find_data*)data;
213 if (dev->hpa == hpa) 243
214 return dev; 244 if (check_dev(dev)) {
245 if (pdev->hpa.start == d->hpa) {
246 d->dev = pdev;
247 return 1;
248 }
215 } 249 }
216 return NULL; 250 return 0;
251}
252
253static struct parisc_device *find_device_by_addr(unsigned long hpa)
254{
255 struct find_data d = {
256 .hpa = hpa,
257 };
258 int ret;
259
260 ret = for_each_padev(find_device, &d);
261 return ret ? d.dev : NULL;
217} 262}
218 263
219/** 264/**
@@ -387,6 +432,23 @@ struct parisc_device * create_tree_node(char id, struct device *parent)
387 return dev; 432 return dev;
388} 433}
389 434
435struct match_id_data {
436 char id;
437 struct parisc_device * dev;
438};
439
440static int match_by_id(struct device * dev, void * data)
441{
442 struct parisc_device * pdev = to_parisc_device(dev);
443 struct match_id_data * d = data;
444
445 if (pdev->hw_path == d->id) {
446 d->dev = pdev;
447 return 1;
448 }
449 return 0;
450}
451
390/** 452/**
391 * alloc_tree_node - returns a device entry in the iotree 453 * alloc_tree_node - returns a device entry in the iotree
392 * @parent: the parent node in the tree 454 * @parent: the parent node in the tree
@@ -397,15 +459,13 @@ struct parisc_device * create_tree_node(char id, struct device *parent)
397 */ 459 */
398static struct parisc_device * alloc_tree_node(struct device *parent, char id) 460static struct parisc_device * alloc_tree_node(struct device *parent, char id)
399{ 461{
400 struct device *dev; 462 struct match_id_data d = {
401 463 .id = id,
402 list_for_each_entry(dev, &parent->children, node) { 464 };
403 struct parisc_device *padev = to_parisc_device(dev); 465 if (device_for_each_child(parent, &d, match_by_id))
404 if (padev->hw_path == id) 466 return d.dev;
405 return padev; 467 else
406 } 468 return create_tree_node(id, parent);
407
408 return create_tree_node(id, parent);
409} 469}
410 470
411static struct parisc_device *create_parisc_device(struct hardware_path *modpath) 471static struct parisc_device *create_parisc_device(struct hardware_path *modpath)
@@ -439,10 +499,8 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path)
439 499
440 dev = create_parisc_device(mod_path); 500 dev = create_parisc_device(mod_path);
441 if (dev->id.hw_type != HPHW_FAULTY) { 501 if (dev->id.hw_type != HPHW_FAULTY) {
442 char p[64];
443 print_pa_hwpath(dev, p);
444 printk("Two devices have hardware path %s. Please file a bug with HP.\n" 502 printk("Two devices have hardware path %s. Please file a bug with HP.\n"
445 "In the meantime, you could try rearranging your cards.\n", p); 503 "In the meantime, you could try rearranging your cards.\n", parisc_pathname(dev));
446 return NULL; 504 return NULL;
447 } 505 }
448 506
@@ -451,12 +509,27 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path)
451 dev->id.hversion_rev = iodc_data[1] & 0x0f; 509 dev->id.hversion_rev = iodc_data[1] & 0x0f;
452 dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) | 510 dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) |
453 (iodc_data[5] << 8) | iodc_data[6]; 511 (iodc_data[5] << 8) | iodc_data[6];
454 dev->hpa = hpa; 512 dev->hpa.name = parisc_pathname(dev);
513 dev->hpa.start = hpa;
514 if (hpa == 0xf4000000 || hpa == 0xf6000000 ||
515 hpa == 0xf8000000 || hpa == 0xfa000000) {
516 dev->hpa.end = hpa + 0x01ffffff;
517 } else {
518 dev->hpa.end = hpa + 0xfff;
519 }
520 dev->hpa.flags = IORESOURCE_MEM;
455 name = parisc_hardware_description(&dev->id); 521 name = parisc_hardware_description(&dev->id);
456 if (name) { 522 if (name) {
457 strlcpy(dev->name, name, sizeof(dev->name)); 523 strlcpy(dev->name, name, sizeof(dev->name));
458 } 524 }
459 525
526 /* Silently fail things like mouse ports which are subsumed within
527 * the keyboard controller
528 */
529 if ((hpa & 0xfff) == 0 && insert_resource(&iomem_resource, &dev->hpa))
530 printk("Unable to claim HPA %lx for device %s\n",
531 hpa, name);
532
460 return dev; 533 return dev;
461} 534}
462 535
@@ -555,6 +628,33 @@ static int match_parisc_device(struct device *dev, int index,
555 return (curr->hw_path == id); 628 return (curr->hw_path == id);
556} 629}
557 630
631struct parse_tree_data {
632 int index;
633 struct hardware_path * modpath;
634 struct device * dev;
635};
636
637static int check_parent(struct device * dev, void * data)
638{
639 struct parse_tree_data * d = data;
640
641 if (check_dev(dev)) {
642 if (dev->bus == &parisc_bus_type) {
643 if (match_parisc_device(dev, d->index, d->modpath))
644 d->dev = dev;
645 } else if (is_pci_dev(dev)) {
646 if (match_pci_device(dev, d->index, d->modpath))
647 d->dev = dev;
648 } else if (dev->bus == NULL) {
649 /* we are on a bus bridge */
650 struct device *new = parse_tree_node(dev, d->index, d->modpath);
651 if (new)
652 d->dev = new;
653 }
654 }
655 return d->dev != NULL;
656}
657
558/** 658/**
559 * parse_tree_node - returns a device entry in the iotree 659 * parse_tree_node - returns a device entry in the iotree
560 * @parent: the parent node in the tree 660 * @parent: the parent node in the tree
@@ -568,24 +668,18 @@ static int match_parisc_device(struct device *dev, int index,
568static struct device * 668static struct device *
569parse_tree_node(struct device *parent, int index, struct hardware_path *modpath) 669parse_tree_node(struct device *parent, int index, struct hardware_path *modpath)
570{ 670{
571 struct device *device; 671 struct parse_tree_data d = {
572 672 .index = index,
573 list_for_each_entry(device, &parent->children, node) { 673 .modpath = modpath,
574 if (device->bus == &parisc_bus_type) { 674 };
575 if (match_parisc_device(device, index, modpath))
576 return device;
577 } else if (is_pci_dev(device)) {
578 if (match_pci_device(device, index, modpath))
579 return device;
580 } else if (device->bus == NULL) {
581 /* we are on a bus bridge */
582 struct device *new = parse_tree_node(device, index, modpath);
583 if (new)
584 return new;
585 }
586 }
587 675
588 return NULL; 676 struct recurse_struct recurse_data = {
677 .obj = &d,
678 .fn = check_parent,
679 };
680
681 device_for_each_child(parent, &recurse_data, descend_children);
682 return d.dev;
589} 683}
590 684
591/** 685/**
@@ -636,7 +730,7 @@ EXPORT_SYMBOL(device_to_hwpath);
636 ((dev->id.hw_type == HPHW_IOA) || (dev->id.hw_type == HPHW_BCPORT)) 730 ((dev->id.hw_type == HPHW_IOA) || (dev->id.hw_type == HPHW_BCPORT))
637 731
638#define IS_LOWER_PORT(dev) \ 732#define IS_LOWER_PORT(dev) \
639 ((gsc_readl(dev->hpa + offsetof(struct bc_module, io_status)) \ 733 ((gsc_readl(dev->hpa.start + offsetof(struct bc_module, io_status)) \
640 & BC_PORT_MASK) == BC_LOWER_PORT) 734 & BC_PORT_MASK) == BC_LOWER_PORT)
641 735
642#define MAX_NATIVE_DEVICES 64 736#define MAX_NATIVE_DEVICES 64
@@ -645,8 +739,8 @@ EXPORT_SYMBOL(device_to_hwpath);
645#define FLEX_MASK F_EXTEND(0xfffc0000) 739#define FLEX_MASK F_EXTEND(0xfffc0000)
646#define IO_IO_LOW offsetof(struct bc_module, io_io_low) 740#define IO_IO_LOW offsetof(struct bc_module, io_io_low)
647#define IO_IO_HIGH offsetof(struct bc_module, io_io_high) 741#define IO_IO_HIGH offsetof(struct bc_module, io_io_high)
648#define READ_IO_IO_LOW(dev) (unsigned long)(signed int)gsc_readl(dev->hpa + IO_IO_LOW) 742#define READ_IO_IO_LOW(dev) (unsigned long)(signed int)gsc_readl(dev->hpa.start + IO_IO_LOW)
649#define READ_IO_IO_HIGH(dev) (unsigned long)(signed int)gsc_readl(dev->hpa + IO_IO_HIGH) 743#define READ_IO_IO_HIGH(dev) (unsigned long)(signed int)gsc_readl(dev->hpa.start + IO_IO_HIGH)
650 744
651static void walk_native_bus(unsigned long io_io_low, unsigned long io_io_high, 745static void walk_native_bus(unsigned long io_io_low, unsigned long io_io_high,
652 struct device *parent); 746 struct device *parent);
@@ -655,10 +749,10 @@ void walk_lower_bus(struct parisc_device *dev)
655{ 749{
656 unsigned long io_io_low, io_io_high; 750 unsigned long io_io_low, io_io_high;
657 751
658 if(!BUS_CONVERTER(dev) || IS_LOWER_PORT(dev)) 752 if (!BUS_CONVERTER(dev) || IS_LOWER_PORT(dev))
659 return; 753 return;
660 754
661 if(dev->id.hw_type == HPHW_IOA) { 755 if (dev->id.hw_type == HPHW_IOA) {
662 io_io_low = (unsigned long)(signed int)(READ_IO_IO_LOW(dev) << 16); 756 io_io_low = (unsigned long)(signed int)(READ_IO_IO_LOW(dev) << 16);
663 io_io_high = io_io_low + MAX_NATIVE_DEVICES * NATIVE_DEVICE_OFFSET; 757 io_io_high = io_io_low + MAX_NATIVE_DEVICES * NATIVE_DEVICE_OFFSET;
664 } else { 758 } else {
@@ -731,7 +825,7 @@ static void print_parisc_device(struct parisc_device *dev)
731 825
732 print_pa_hwpath(dev, hw_path); 826 print_pa_hwpath(dev, hw_path);
733 printk(KERN_INFO "%d. %s at 0x%lx [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", 827 printk(KERN_INFO "%d. %s at 0x%lx [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
734 ++count, dev->name, dev->hpa, hw_path, dev->id.hw_type, 828 ++count, dev->name, dev->hpa.start, hw_path, dev->id.hw_type,
735 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); 829 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
736 830
737 if (dev->num_addrs) { 831 if (dev->num_addrs) {
@@ -753,13 +847,20 @@ void init_parisc_bus(void)
753 get_device(&root); 847 get_device(&root);
754} 848}
755 849
850
851static int print_one_device(struct device * dev, void * data)
852{
853 struct parisc_device * pdev = to_parisc_device(dev);
854
855 if (check_dev(dev))
856 print_parisc_device(pdev);
857 return 0;
858}
859
756/** 860/**
757 * print_parisc_devices - Print out a list of devices found in this system 861 * print_parisc_devices - Print out a list of devices found in this system
758 */ 862 */
759void print_parisc_devices(void) 863void print_parisc_devices(void)
760{ 864{
761 struct parisc_device *dev; 865 for_each_padev(print_one_device, NULL);
762 for_each_padev(dev) {
763 print_parisc_device(dev);
764 }
765} 866}
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index be0f07f2fa58..c7e66ee5b083 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -30,14 +30,14 @@
30 * - save registers to kernel stack and handle in assembly or C */ 30 * - save registers to kernel stack and handle in assembly or C */
31 31
32 32
33#include <asm/psw.h>
33#include <asm/assembly.h> /* for LDREG/STREG defines */ 34#include <asm/assembly.h> /* for LDREG/STREG defines */
34#include <asm/pgtable.h> 35#include <asm/pgtable.h>
35#include <asm/psw.h>
36#include <asm/signal.h> 36#include <asm/signal.h>
37#include <asm/unistd.h> 37#include <asm/unistd.h>
38#include <asm/thread_info.h> 38#include <asm/thread_info.h>
39 39
40#ifdef __LP64__ 40#ifdef CONFIG_64BIT
41#define CMPIB cmpib,* 41#define CMPIB cmpib,*
42#define CMPB cmpb,* 42#define CMPB cmpb,*
43#define COND(x) *x 43#define COND(x) *x
@@ -67,19 +67,22 @@
67 67
68 /* Switch to virtual mapping, trashing only %r1 */ 68 /* Switch to virtual mapping, trashing only %r1 */
69 .macro virt_map 69 .macro virt_map
70 rsm PSW_SM_Q,%r0 70 /* pcxt_ssm_bug */
71 tovirt_r1 %r29 71 rsm PSW_SM_I, %r0 /* barrier for "Relied upon Translation */
72 mfsp %sr7, %r1
73 or,= %r0,%r1,%r0 /* Only save sr7 in sr3 if sr7 != 0 */
74 mtsp %r1, %sr3
75 mtsp %r0, %sr4 72 mtsp %r0, %sr4
76 mtsp %r0, %sr5 73 mtsp %r0, %sr5
74 mfsp %sr7, %r1
75 or,= %r0,%r1,%r0 /* Only save sr7 in sr3 if sr7 != 0 */
76 mtsp %r1, %sr3
77 tovirt_r1 %r29
78 load32 KERNEL_PSW, %r1
79
80 rsm PSW_SM_QUIET,%r0 /* second "heavy weight" ctl op */
77 mtsp %r0, %sr6 81 mtsp %r0, %sr6
78 mtsp %r0, %sr7 82 mtsp %r0, %sr7
79 load32 KERNEL_PSW, %r1
80 mtctl %r1, %cr22
81 mtctl %r0, %cr17 /* Clear IIASQ tail */ 83 mtctl %r0, %cr17 /* Clear IIASQ tail */
82 mtctl %r0, %cr17 /* Clear IIASQ head */ 84 mtctl %r0, %cr17 /* Clear IIASQ head */
85 mtctl %r1, %ipsw
83 load32 4f, %r1 86 load32 4f, %r1
84 mtctl %r1, %cr18 /* Set IIAOQ tail */ 87 mtctl %r1, %cr18 /* Set IIAOQ tail */
85 ldo 4(%r1), %r1 88 ldo 4(%r1), %r1
@@ -214,7 +217,7 @@
214 va = r8 /* virtual address for which the trap occured */ 217 va = r8 /* virtual address for which the trap occured */
215 spc = r24 /* space for which the trap occured */ 218 spc = r24 /* space for which the trap occured */
216 219
217#ifndef __LP64__ 220#ifndef CONFIG_64BIT
218 221
219 /* 222 /*
220 * itlb miss interruption handler (parisc 1.1 - 32 bit) 223 * itlb miss interruption handler (parisc 1.1 - 32 bit)
@@ -236,7 +239,7 @@
236 239
237 .macro itlb_20 code 240 .macro itlb_20 code
238 mfctl %pcsq, spc 241 mfctl %pcsq, spc
239#ifdef __LP64__ 242#ifdef CONFIG_64BIT
240 b itlb_miss_20w 243 b itlb_miss_20w
241#else 244#else
242 b itlb_miss_20 245 b itlb_miss_20
@@ -246,7 +249,7 @@
246 .align 32 249 .align 32
247 .endm 250 .endm
248 251
249#ifndef __LP64__ 252#ifndef CONFIG_64BIT
250 /* 253 /*
251 * naitlb miss interruption handler (parisc 1.1 - 32 bit) 254 * naitlb miss interruption handler (parisc 1.1 - 32 bit)
252 * 255 *
@@ -283,7 +286,7 @@
283 .macro naitlb_20 code 286 .macro naitlb_20 code
284 287
285 mfctl %isr,spc 288 mfctl %isr,spc
286#ifdef __LP64__ 289#ifdef CONFIG_64BIT
287 b itlb_miss_20w 290 b itlb_miss_20w
288#else 291#else
289 b itlb_miss_20 292 b itlb_miss_20
@@ -296,7 +299,7 @@
296 .align 32 299 .align 32
297 .endm 300 .endm
298 301
299#ifndef __LP64__ 302#ifndef CONFIG_64BIT
300 /* 303 /*
301 * dtlb miss interruption handler (parisc 1.1 - 32 bit) 304 * dtlb miss interruption handler (parisc 1.1 - 32 bit)
302 */ 305 */
@@ -318,7 +321,7 @@
318 .macro dtlb_20 code 321 .macro dtlb_20 code
319 322
320 mfctl %isr, spc 323 mfctl %isr, spc
321#ifdef __LP64__ 324#ifdef CONFIG_64BIT
322 b dtlb_miss_20w 325 b dtlb_miss_20w
323#else 326#else
324 b dtlb_miss_20 327 b dtlb_miss_20
@@ -328,7 +331,7 @@
328 .align 32 331 .align 32
329 .endm 332 .endm
330 333
331#ifndef __LP64__ 334#ifndef CONFIG_64BIT
332 /* nadtlb miss interruption handler (parisc 1.1 - 32 bit) */ 335 /* nadtlb miss interruption handler (parisc 1.1 - 32 bit) */
333 336
334 .macro nadtlb_11 code 337 .macro nadtlb_11 code
@@ -346,7 +349,7 @@
346 .macro nadtlb_20 code 349 .macro nadtlb_20 code
347 350
348 mfctl %isr,spc 351 mfctl %isr,spc
349#ifdef __LP64__ 352#ifdef CONFIG_64BIT
350 b nadtlb_miss_20w 353 b nadtlb_miss_20w
351#else 354#else
352 b nadtlb_miss_20 355 b nadtlb_miss_20
@@ -356,7 +359,7 @@
356 .align 32 359 .align 32
357 .endm 360 .endm
358 361
359#ifndef __LP64__ 362#ifndef CONFIG_64BIT
360 /* 363 /*
361 * dirty bit trap interruption handler (parisc 1.1 - 32 bit) 364 * dirty bit trap interruption handler (parisc 1.1 - 32 bit)
362 */ 365 */
@@ -378,7 +381,7 @@
378 .macro dbit_20 code 381 .macro dbit_20 code
379 382
380 mfctl %isr,spc 383 mfctl %isr,spc
381#ifdef __LP64__ 384#ifdef CONFIG_64BIT
382 b dbit_trap_20w 385 b dbit_trap_20w
383#else 386#else
384 b dbit_trap_20 387 b dbit_trap_20
@@ -391,7 +394,7 @@
391 /* The following are simple 32 vs 64 bit instruction 394 /* The following are simple 32 vs 64 bit instruction
392 * abstractions for the macros */ 395 * abstractions for the macros */
393 .macro EXTR reg1,start,length,reg2 396 .macro EXTR reg1,start,length,reg2
394#ifdef __LP64__ 397#ifdef CONFIG_64BIT
395 extrd,u \reg1,32+\start,\length,\reg2 398 extrd,u \reg1,32+\start,\length,\reg2
396#else 399#else
397 extrw,u \reg1,\start,\length,\reg2 400 extrw,u \reg1,\start,\length,\reg2
@@ -399,7 +402,7 @@
399 .endm 402 .endm
400 403
401 .macro DEP reg1,start,length,reg2 404 .macro DEP reg1,start,length,reg2
402#ifdef __LP64__ 405#ifdef CONFIG_64BIT
403 depd \reg1,32+\start,\length,\reg2 406 depd \reg1,32+\start,\length,\reg2
404#else 407#else
405 depw \reg1,\start,\length,\reg2 408 depw \reg1,\start,\length,\reg2
@@ -407,7 +410,7 @@
407 .endm 410 .endm
408 411
409 .macro DEPI val,start,length,reg 412 .macro DEPI val,start,length,reg
410#ifdef __LP64__ 413#ifdef CONFIG_64BIT
411 depdi \val,32+\start,\length,\reg 414 depdi \val,32+\start,\length,\reg
412#else 415#else
413 depwi \val,\start,\length,\reg 416 depwi \val,\start,\length,\reg
@@ -418,7 +421,7 @@
418 * fault. We have to extract this and place it in the va, 421 * fault. We have to extract this and place it in the va,
419 * zeroing the corresponding bits in the space register */ 422 * zeroing the corresponding bits in the space register */
420 .macro space_adjust spc,va,tmp 423 .macro space_adjust spc,va,tmp
421#ifdef __LP64__ 424#ifdef CONFIG_64BIT
422 extrd,u \spc,63,SPACEID_SHIFT,\tmp 425 extrd,u \spc,63,SPACEID_SHIFT,\tmp
423 depd %r0,63,SPACEID_SHIFT,\spc 426 depd %r0,63,SPACEID_SHIFT,\spc
424 depd \tmp,31,SPACEID_SHIFT,\va 427 depd \tmp,31,SPACEID_SHIFT,\va
@@ -476,7 +479,7 @@
476 bb,>=,n \pmd,_PxD_PRESENT_BIT,\fault 479 bb,>=,n \pmd,_PxD_PRESENT_BIT,\fault
477 DEP %r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */ 480 DEP %r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */
478 copy \pmd,%r9 481 copy \pmd,%r9
479#ifdef __LP64__ 482#ifdef CONFIG_64BIT
480 shld %r9,PxD_VALUE_SHIFT,\pmd 483 shld %r9,PxD_VALUE_SHIFT,\pmd
481#else 484#else
482 shlw %r9,PxD_VALUE_SHIFT,\pmd 485 shlw %r9,PxD_VALUE_SHIFT,\pmd
@@ -607,7 +610,7 @@
607 .macro do_alias spc,tmp,tmp1,va,pte,prot,fault 610 .macro do_alias spc,tmp,tmp1,va,pte,prot,fault
608 cmpib,COND(<>),n 0,\spc,\fault 611 cmpib,COND(<>),n 0,\spc,\fault
609 ldil L%(TMPALIAS_MAP_START),\tmp 612 ldil L%(TMPALIAS_MAP_START),\tmp
610#if defined(__LP64__) && (TMPALIAS_MAP_START >= 0x80000000) 613#if defined(CONFIG_64BIT) && (TMPALIAS_MAP_START >= 0x80000000)
611 /* on LP64, ldi will sign extend into the upper 32 bits, 614 /* on LP64, ldi will sign extend into the upper 32 bits,
612 * which is behaviour we don't want */ 615 * which is behaviour we don't want */
613 depdi 0,31,32,\tmp 616 depdi 0,31,32,\tmp
@@ -621,7 +624,7 @@
621 * OK, it is in the temp alias region, check whether "from" or "to". 624 * OK, it is in the temp alias region, check whether "from" or "to".
622 * Check "subtle" note in pacache.S re: r23/r26. 625 * Check "subtle" note in pacache.S re: r23/r26.
623 */ 626 */
624#ifdef __LP64__ 627#ifdef CONFIG_64BIT
625 extrd,u,*= \va,41,1,%r0 628 extrd,u,*= \va,41,1,%r0
626#else 629#else
627 extrw,u,= \va,9,1,%r0 630 extrw,u,= \va,9,1,%r0
@@ -688,7 +691,7 @@ fault_vector_20:
688 def 30 691 def 30
689 def 31 692 def 31
690 693
691#ifndef __LP64__ 694#ifndef CONFIG_64BIT
692 695
693 .export fault_vector_11 696 .export fault_vector_11
694 697
@@ -761,7 +764,7 @@ __kernel_thread:
761 764
762 copy %r30, %r1 765 copy %r30, %r1
763 ldo PT_SZ_ALGN(%r30),%r30 766 ldo PT_SZ_ALGN(%r30),%r30
764#ifdef __LP64__ 767#ifdef CONFIG_64BIT
765 /* Yo, function pointers in wide mode are little structs... -PB */ 768 /* Yo, function pointers in wide mode are little structs... -PB */
766 ldd 24(%r26), %r2 769 ldd 24(%r26), %r2
767 STREG %r2, PT_GR27(%r1) /* Store childs %dp */ 770 STREG %r2, PT_GR27(%r1) /* Store childs %dp */
@@ -777,7 +780,7 @@ __kernel_thread:
777 or %r26, %r24, %r26 /* will have kernel mappings. */ 780 or %r26, %r24, %r26 /* will have kernel mappings. */
778 ldi 1, %r25 /* stack_start, signals kernel thread */ 781 ldi 1, %r25 /* stack_start, signals kernel thread */
779 stw %r0, -52(%r30) /* user_tid */ 782 stw %r0, -52(%r30) /* user_tid */
780#ifdef __LP64__ 783#ifdef CONFIG_64BIT
781 ldo -16(%r30),%r29 /* Reference param save area */ 784 ldo -16(%r30),%r29 /* Reference param save area */
782#endif 785#endif
783 BL do_fork, %r2 786 BL do_fork, %r2
@@ -806,7 +809,7 @@ ret_from_kernel_thread:
806 809
807 LDREG TI_TASK-THREAD_SZ_ALGN(%r30), %r1 810 LDREG TI_TASK-THREAD_SZ_ALGN(%r30), %r1
808 LDREG TASK_PT_GR25(%r1), %r26 811 LDREG TASK_PT_GR25(%r1), %r26
809#ifdef __LP64__ 812#ifdef CONFIG_64BIT
810 LDREG TASK_PT_GR27(%r1), %r27 813 LDREG TASK_PT_GR27(%r1), %r27
811 LDREG TASK_PT_GR22(%r1), %r22 814 LDREG TASK_PT_GR22(%r1), %r22
812#endif 815#endif
@@ -814,11 +817,16 @@ ret_from_kernel_thread:
814 ble 0(%sr7, %r1) 817 ble 0(%sr7, %r1)
815 copy %r31, %r2 818 copy %r31, %r2
816 819
817#ifdef __LP64__ 820#ifdef CONFIG_64BIT
818 ldo -16(%r30),%r29 /* Reference param save area */ 821 ldo -16(%r30),%r29 /* Reference param save area */
819 loadgp /* Thread could have been in a module */ 822 loadgp /* Thread could have been in a module */
820#endif 823#endif
824#ifndef CONFIG_64BIT
821 b sys_exit 825 b sys_exit
826#else
827 load32 sys_exit, %r1
828 bv %r0(%r1)
829#endif
822 ldi 0, %r26 830 ldi 0, %r26
823 831
824 .import sys_execve, code 832 .import sys_execve, code
@@ -830,7 +838,7 @@ __execve:
830 STREG %r26, PT_GR26(%r16) 838 STREG %r26, PT_GR26(%r16)
831 STREG %r25, PT_GR25(%r16) 839 STREG %r25, PT_GR25(%r16)
832 STREG %r24, PT_GR24(%r16) 840 STREG %r24, PT_GR24(%r16)
833#ifdef __LP64__ 841#ifdef CONFIG_64BIT
834 ldo -16(%r30),%r29 /* Reference param save area */ 842 ldo -16(%r30),%r29 /* Reference param save area */
835#endif 843#endif
836 BL sys_execve, %r2 844 BL sys_execve, %r2
@@ -855,6 +863,7 @@ __execve:
855_switch_to: 863_switch_to:
856 STREG %r2, -RP_OFFSET(%r30) 864 STREG %r2, -RP_OFFSET(%r30)
857 865
866 callee_save_float
858 callee_save 867 callee_save
859 868
860 load32 _switch_to_ret, %r2 869 load32 _switch_to_ret, %r2
@@ -871,6 +880,7 @@ _switch_to:
871_switch_to_ret: 880_switch_to_ret:
872 mtctl %r0, %cr0 /* Needed for single stepping */ 881 mtctl %r0, %cr0 /* Needed for single stepping */
873 callee_rest 882 callee_rest
883 callee_rest_float
874 884
875 LDREG -RP_OFFSET(%r30), %r2 885 LDREG -RP_OFFSET(%r30), %r2
876 bv %r0(%r2) 886 bv %r0(%r2)
@@ -888,9 +898,6 @@ _switch_to_ret:
888 * this way, then we will need to copy %sr3 in to PT_SR[3..7], and 898 * this way, then we will need to copy %sr3 in to PT_SR[3..7], and
889 * adjust IASQ[0..1]. 899 * adjust IASQ[0..1].
890 * 900 *
891 * Note that the following code uses a "relied upon translation".
892 * See the parisc ACD for details. The ssm is necessary due to a
893 * PCXT bug.
894 */ 901 */
895 902
896 .align 4096 903 .align 4096
@@ -911,7 +918,7 @@ syscall_exit_rfi:
911 STREG %r19,PT_IAOQ1(%r16) 918 STREG %r19,PT_IAOQ1(%r16)
912 LDREG PT_PSW(%r16),%r19 919 LDREG PT_PSW(%r16),%r19
913 load32 USER_PSW_MASK,%r1 920 load32 USER_PSW_MASK,%r1
914#ifdef __LP64__ 921#ifdef CONFIG_64BIT
915 load32 USER_PSW_HI_MASK,%r20 922 load32 USER_PSW_HI_MASK,%r20
916 depd %r20,31,32,%r1 923 depd %r20,31,32,%r1
917#endif 924#endif
@@ -955,7 +962,7 @@ intr_return:
955 /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) amount 962 /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) amount
956 ** irq_stat[] is defined using ____cacheline_aligned. 963 ** irq_stat[] is defined using ____cacheline_aligned.
957 */ 964 */
958#ifdef __LP64__ 965#ifdef CONFIG_64BIT
959 shld %r1, 6, %r20 966 shld %r1, 6, %r20
960#else 967#else
961 shlw %r1, 5, %r20 968 shlw %r1, 5, %r20
@@ -963,9 +970,6 @@ intr_return:
963 add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */ 970 add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */
964#endif /* CONFIG_SMP */ 971#endif /* CONFIG_SMP */
965 972
966 LDREG IRQSTAT_SIRQ_PEND(%r19),%r20 /* hardirq.h: unsigned long */
967 cmpib,<>,n 0,%r20,intr_do_softirq /* forward */
968
969intr_check_resched: 973intr_check_resched:
970 974
971 /* check for reschedule */ 975 /* check for reschedule */
@@ -985,24 +989,19 @@ intr_restore:
985 rest_fp %r1 989 rest_fp %r1
986 rest_general %r29 990 rest_general %r29
987 991
988 /* Create a "relied upon translation" PA 2.0 Arch. F-5 */ 992 /* inverse of virt_map */
989 ssm 0,%r0 993 pcxt_ssm_bug
990 nop 994 rsm PSW_SM_QUIET,%r0 /* prepare for rfi */
991 nop
992 nop
993 nop
994 nop
995 nop
996 nop
997 tophys_r1 %r29 995 tophys_r1 %r29
998 rsm (PSW_SM_Q|PSW_SM_P|PSW_SM_D|PSW_SM_I),%r0
999 996
1000 /* Restore space id's and special cr's from PT_REGS 997 /* Restore space id's and special cr's from PT_REGS
1001 * structure pointed to by r29 */ 998 * structure pointed to by r29
999 */
1002 rest_specials %r29 1000 rest_specials %r29
1003 1001
1004 /* Important: Note that rest_stack restores r29 1002 /* IMPORTANT: rest_stack restores r29 last (we are using it)!
1005 * last (we are using it)! It also restores r1 and r30. */ 1003 * It also restores r1 and r30.
1004 */
1006 rest_stack 1005 rest_stack
1007 1006
1008 rfi 1007 rfi
@@ -1015,17 +1014,6 @@ intr_restore:
1015 nop 1014 nop
1016 nop 1015 nop
1017 1016
1018 .import do_softirq,code
1019intr_do_softirq:
1020 bl do_softirq,%r2
1021#ifdef __LP64__
1022 ldo -16(%r30),%r29 /* Reference param save area */
1023#else
1024 nop
1025#endif
1026 b intr_check_resched
1027 nop
1028
1029 .import schedule,code 1017 .import schedule,code
1030intr_do_resched: 1018intr_do_resched:
1031 /* Only do reschedule if we are returning to user space */ 1019 /* Only do reschedule if we are returning to user space */
@@ -1036,12 +1024,17 @@ intr_do_resched:
1036 CMPIB= 0,%r20,intr_restore /* backward */ 1024 CMPIB= 0,%r20,intr_restore /* backward */
1037 nop 1025 nop
1038 1026
1039#ifdef __LP64__ 1027#ifdef CONFIG_64BIT
1040 ldo -16(%r30),%r29 /* Reference param save area */ 1028 ldo -16(%r30),%r29 /* Reference param save area */
1041#endif 1029#endif
1042 1030
1043 ldil L%intr_check_sig, %r2 1031 ldil L%intr_check_sig, %r2
1032#ifndef CONFIG_64BIT
1044 b schedule 1033 b schedule
1034#else
1035 load32 schedule, %r20
1036 bv %r0(%r20)
1037#endif
1045 ldo R%intr_check_sig(%r2), %r2 1038 ldo R%intr_check_sig(%r2), %r2
1046 1039
1047 1040
@@ -1064,7 +1057,7 @@ intr_do_signal:
1064 1057
1065 copy %r0, %r24 /* unsigned long in_syscall */ 1058 copy %r0, %r24 /* unsigned long in_syscall */
1066 copy %r16, %r25 /* struct pt_regs *regs */ 1059 copy %r16, %r25 /* struct pt_regs *regs */
1067#ifdef __LP64__ 1060#ifdef CONFIG_64BIT
1068 ldo -16(%r30),%r29 /* Reference param save area */ 1061 ldo -16(%r30),%r29 /* Reference param save area */
1069#endif 1062#endif
1070 1063
@@ -1088,7 +1081,7 @@ intr_extint:
1088 mfctl %cr31,%r1 1081 mfctl %cr31,%r1
1089 copy %r30,%r17 1082 copy %r30,%r17
1090 /* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/ 1083 /* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/
1091#ifdef __LP64__ 1084#ifdef CONFIG_64BIT
1092 depdi 0,63,15,%r17 1085 depdi 0,63,15,%r17
1093#else 1086#else
1094 depi 0,31,15,%r17 1087 depi 0,31,15,%r17
@@ -1115,7 +1108,7 @@ intr_extint:
1115 1108
1116 ldil L%intr_return, %r2 1109 ldil L%intr_return, %r2
1117 1110
1118#ifdef __LP64__ 1111#ifdef CONFIG_64BIT
1119 ldo -16(%r30),%r29 /* Reference param save area */ 1112 ldo -16(%r30),%r29 /* Reference param save area */
1120#endif 1113#endif
1121 1114
@@ -1153,15 +1146,17 @@ intr_save:
1153 1146
1154 CMPIB=,n 6,%r26,skip_save_ior 1147 CMPIB=,n 6,%r26,skip_save_ior
1155 1148
1156 /* save_specials left ipsw value in r8 for us to test */
1157 1149
1158 mfctl %cr20, %r16 /* isr */ 1150 mfctl %cr20, %r16 /* isr */
1151 nop /* serialize mfctl on PA 2.0 to avoid 4 cycle penalty */
1159 mfctl %cr21, %r17 /* ior */ 1152 mfctl %cr21, %r17 /* ior */
1160 1153
1161#ifdef __LP64__ 1154
1155#ifdef CONFIG_64BIT
1162 /* 1156 /*
1163 * If the interrupted code was running with W bit off (32 bit), 1157 * If the interrupted code was running with W bit off (32 bit),
1164 * clear the b bits (bits 0 & 1) in the ior. 1158 * clear the b bits (bits 0 & 1) in the ior.
1159 * save_specials left ipsw value in r8 for us to test.
1165 */ 1160 */
1166 extrd,u,*<> %r8,PSW_W_BIT,1,%r0 1161 extrd,u,*<> %r8,PSW_W_BIT,1,%r0
1167 depdi 0,1,2,%r17 1162 depdi 0,1,2,%r17
@@ -1192,7 +1187,7 @@ skip_save_ior:
1192 loadgp 1187 loadgp
1193 1188
1194 copy %r29, %r25 /* arg1 is pt_regs */ 1189 copy %r29, %r25 /* arg1 is pt_regs */
1195#ifdef __LP64__ 1190#ifdef CONFIG_64BIT
1196 ldo -16(%r30),%r29 /* Reference param save area */ 1191 ldo -16(%r30),%r29 /* Reference param save area */
1197#endif 1192#endif
1198 1193
@@ -1230,7 +1225,7 @@ skip_save_ior:
1230 spc = r24 /* space for which the trap occured */ 1225 spc = r24 /* space for which the trap occured */
1231 ptp = r25 /* page directory/page table pointer */ 1226 ptp = r25 /* page directory/page table pointer */
1232 1227
1233#ifdef __LP64__ 1228#ifdef CONFIG_64BIT
1234 1229
1235dtlb_miss_20w: 1230dtlb_miss_20w:
1236 space_adjust spc,va,t0 1231 space_adjust spc,va,t0
@@ -1487,10 +1482,10 @@ nadtlb_emulate:
1487 add,l %r1,%r24,%r1 /* doesn't affect c/b bits */ 1482 add,l %r1,%r24,%r1 /* doesn't affect c/b bits */
1488 1483
1489nadtlb_nullify: 1484nadtlb_nullify:
1490 mfctl %cr22,%r8 /* Get ipsw */ 1485 mfctl %ipsw,%r8
1491 ldil L%PSW_N,%r9 1486 ldil L%PSW_N,%r9
1492 or %r8,%r9,%r8 /* Set PSW_N */ 1487 or %r8,%r9,%r8 /* Set PSW_N */
1493 mtctl %r8,%cr22 1488 mtctl %r8,%ipsw
1494 1489
1495 rfir 1490 rfir
1496 nop 1491 nop
@@ -1521,7 +1516,7 @@ nadtlb_probe_check:
1521 nop 1516 nop
1522 1517
1523 1518
1524#ifdef __LP64__ 1519#ifdef CONFIG_64BIT
1525itlb_miss_20w: 1520itlb_miss_20w:
1526 1521
1527 /* 1522 /*
@@ -1588,7 +1583,7 @@ itlb_miss_20:
1588 1583
1589#endif 1584#endif
1590 1585
1591#ifdef __LP64__ 1586#ifdef CONFIG_64BIT
1592 1587
1593dbit_trap_20w: 1588dbit_trap_20w:
1594 space_adjust spc,va,t0 1589 space_adjust spc,va,t0
@@ -1797,7 +1792,7 @@ sys_fork_wrapper:
1797 1792
1798 STREG %r2,-RP_OFFSET(%r30) 1793 STREG %r2,-RP_OFFSET(%r30)
1799 ldo FRAME_SIZE(%r30),%r30 1794 ldo FRAME_SIZE(%r30),%r30
1800#ifdef __LP64__ 1795#ifdef CONFIG_64BIT
1801 ldo -16(%r30),%r29 /* Reference param save area */ 1796 ldo -16(%r30),%r29 /* Reference param save area */
1802#endif 1797#endif
1803 1798
@@ -1847,7 +1842,7 @@ sys_clone_wrapper:
1847 1842
1848 STREG %r2,-RP_OFFSET(%r30) 1843 STREG %r2,-RP_OFFSET(%r30)
1849 ldo FRAME_SIZE(%r30),%r30 1844 ldo FRAME_SIZE(%r30),%r30
1850#ifdef __LP64__ 1845#ifdef CONFIG_64BIT
1851 ldo -16(%r30),%r29 /* Reference param save area */ 1846 ldo -16(%r30),%r29 /* Reference param save area */
1852#endif 1847#endif
1853 1848
@@ -1869,7 +1864,7 @@ sys_vfork_wrapper:
1869 1864
1870 STREG %r2,-RP_OFFSET(%r30) 1865 STREG %r2,-RP_OFFSET(%r30)
1871 ldo FRAME_SIZE(%r30),%r30 1866 ldo FRAME_SIZE(%r30),%r30
1872#ifdef __LP64__ 1867#ifdef CONFIG_64BIT
1873 ldo -16(%r30),%r29 /* Reference param save area */ 1868 ldo -16(%r30),%r29 /* Reference param save area */
1874#endif 1869#endif
1875 1870
@@ -1897,10 +1892,10 @@ sys_vfork_wrapper:
1897 1892
1898 STREG %r2,-RP_OFFSET(%r30) 1893 STREG %r2,-RP_OFFSET(%r30)
1899 ldo FRAME_SIZE(%r30),%r30 1894 ldo FRAME_SIZE(%r30),%r30
1900#ifdef __LP64__ 1895#ifdef CONFIG_64BIT
1901 ldo -16(%r30),%r29 /* Reference param save area */ 1896 ldo -16(%r30),%r29 /* Reference param save area */
1902#endif 1897#endif
1903 bl \execve,%r2 1898 BL \execve,%r2
1904 copy %r1,%arg0 1899 copy %r1,%arg0
1905 1900
1906 ldo -FRAME_SIZE(%r30),%r30 1901 ldo -FRAME_SIZE(%r30),%r30
@@ -1923,7 +1918,7 @@ error_\execve:
1923sys_execve_wrapper: 1918sys_execve_wrapper:
1924 execve_wrapper sys_execve 1919 execve_wrapper sys_execve
1925 1920
1926#ifdef __LP64__ 1921#ifdef CONFIG_64BIT
1927 .export sys32_execve_wrapper 1922 .export sys32_execve_wrapper
1928 .import sys32_execve 1923 .import sys32_execve
1929 1924
@@ -1937,7 +1932,7 @@ sys_rt_sigreturn_wrapper:
1937 ldo TASK_REGS(%r26),%r26 /* get pt regs */ 1932 ldo TASK_REGS(%r26),%r26 /* get pt regs */
1938 /* Don't save regs, we are going to restore them from sigcontext. */ 1933 /* Don't save regs, we are going to restore them from sigcontext. */
1939 STREG %r2, -RP_OFFSET(%r30) 1934 STREG %r2, -RP_OFFSET(%r30)
1940#ifdef __LP64__ 1935#ifdef CONFIG_64BIT
1941 ldo FRAME_SIZE(%r30), %r30 1936 ldo FRAME_SIZE(%r30), %r30
1942 BL sys_rt_sigreturn,%r2 1937 BL sys_rt_sigreturn,%r2
1943 ldo -16(%r30),%r29 /* Reference param save area */ 1938 ldo -16(%r30),%r29 /* Reference param save area */
@@ -1968,7 +1963,7 @@ sys_sigaltstack_wrapper:
1968 ldo TASK_REGS(%r1),%r24 /* get pt regs */ 1963 ldo TASK_REGS(%r1),%r24 /* get pt regs */
1969 LDREG TASK_PT_GR30(%r24),%r24 1964 LDREG TASK_PT_GR30(%r24),%r24
1970 STREG %r2, -RP_OFFSET(%r30) 1965 STREG %r2, -RP_OFFSET(%r30)
1971#ifdef __LP64__ 1966#ifdef CONFIG_64BIT
1972 ldo FRAME_SIZE(%r30), %r30 1967 ldo FRAME_SIZE(%r30), %r30
1973 b,l do_sigaltstack,%r2 1968 b,l do_sigaltstack,%r2
1974 ldo -16(%r30),%r29 /* Reference param save area */ 1969 ldo -16(%r30),%r29 /* Reference param save area */
@@ -1982,7 +1977,7 @@ sys_sigaltstack_wrapper:
1982 bv %r0(%r2) 1977 bv %r0(%r2)
1983 nop 1978 nop
1984 1979
1985#ifdef __LP64__ 1980#ifdef CONFIG_64BIT
1986 .export sys32_sigaltstack_wrapper 1981 .export sys32_sigaltstack_wrapper
1987sys32_sigaltstack_wrapper: 1982sys32_sigaltstack_wrapper:
1988 /* Get the user stack pointer */ 1983 /* Get the user stack pointer */
@@ -2006,7 +2001,7 @@ sys_rt_sigsuspend_wrapper:
2006 reg_save %r24 2001 reg_save %r24
2007 2002
2008 STREG %r2, -RP_OFFSET(%r30) 2003 STREG %r2, -RP_OFFSET(%r30)
2009#ifdef __LP64__ 2004#ifdef CONFIG_64BIT
2010 ldo FRAME_SIZE(%r30), %r30 2005 ldo FRAME_SIZE(%r30), %r30
2011 b,l sys_rt_sigsuspend,%r2 2006 b,l sys_rt_sigsuspend,%r2
2012 ldo -16(%r30),%r29 /* Reference param save area */ 2007 ldo -16(%r30),%r29 /* Reference param save area */
@@ -2079,7 +2074,7 @@ syscall_check_bh:
2079 ldw TI_CPU-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 /* cpu # */ 2074 ldw TI_CPU-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 /* cpu # */
2080 2075
2081 /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) bits */ 2076 /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) bits */
2082#ifdef __LP64__ 2077#ifdef CONFIG_64BIT
2083 shld %r26, 6, %r20 2078 shld %r26, 6, %r20
2084#else 2079#else
2085 shlw %r26, 5, %r20 2080 shlw %r26, 5, %r20
@@ -2087,9 +2082,6 @@ syscall_check_bh:
2087 add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */ 2082 add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */
2088#endif /* CONFIG_SMP */ 2083#endif /* CONFIG_SMP */
2089 2084
2090 LDREG IRQSTAT_SIRQ_PEND(%r19),%r20 /* hardirq.h: unsigned long */
2091 cmpib,<>,n 0,%r20,syscall_do_softirq /* forward */
2092
2093syscall_check_resched: 2085syscall_check_resched:
2094 2086
2095 /* check for reschedule */ 2087 /* check for reschedule */
@@ -2144,7 +2136,7 @@ syscall_restore:
2144 2136
2145 depi 3,31,2,%r31 /* ensure return to user mode. */ 2137 depi 3,31,2,%r31 /* ensure return to user mode. */
2146 2138
2147#ifdef __LP64__ 2139#ifdef CONFIG_64BIT
2148 /* decide whether to reset the wide mode bit 2140 /* decide whether to reset the wide mode bit
2149 * 2141 *
2150 * For a syscall, the W bit is stored in the lowest bit 2142 * For a syscall, the W bit is stored in the lowest bit
@@ -2227,20 +2219,10 @@ pt_regs_ok:
2227 b intr_restore 2219 b intr_restore
2228 nop 2220 nop
2229 2221
2230 .import do_softirq,code
2231syscall_do_softirq:
2232 bl do_softirq,%r2
2233 nop
2234 /* NOTE: We enable I-bit incase we schedule later,
2235 * and we might be going back to userspace if we were
2236 * traced. */
2237 b syscall_check_resched
2238 ssm PSW_SM_I, %r0 /* do_softirq returns with I bit off */
2239
2240 .import schedule,code 2222 .import schedule,code
2241syscall_do_resched: 2223syscall_do_resched:
2242 BL schedule,%r2 2224 BL schedule,%r2
2243#ifdef __LP64__ 2225#ifdef CONFIG_64BIT
2244 ldo -16(%r30),%r29 /* Reference param save area */ 2226 ldo -16(%r30),%r29 /* Reference param save area */
2245#else 2227#else
2246 nop 2228 nop
@@ -2260,7 +2242,7 @@ syscall_do_signal:
2260 2242
2261 ldi 1, %r24 /* unsigned long in_syscall */ 2243 ldi 1, %r24 /* unsigned long in_syscall */
2262 2244
2263#ifdef __LP64__ 2245#ifdef CONFIG_64BIT
2264 ldo -16(%r30),%r29 /* Reference param save area */ 2246 ldo -16(%r30),%r29 /* Reference param save area */
2265#endif 2247#endif
2266 BL do_signal,%r2 2248 BL do_signal,%r2
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index f244fb200db1..553f8fe03224 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -83,15 +83,15 @@ static unsigned long pdc_result2[32] __attribute__ ((aligned (8)));
83int parisc_narrow_firmware = 1; 83int parisc_narrow_firmware = 1;
84#endif 84#endif
85 85
86/* on all currently-supported platforms, IODC I/O calls are always 86/* On most currently-supported platforms, IODC I/O calls are 32-bit calls
87 * 32-bit calls, and MEM_PDC calls are always the same width as the OS. 87 * and MEM_PDC calls are always the same width as the OS.
88 * This means Cxxx boxes can't run wide kernels right now. -PB 88 * Some PAT boxes may have 64-bit IODC I/O.
89 * 89 *
90 * CONFIG_PDC_NARROW has been added to allow 64-bit kernels to run on 90 * Ryan Bradetich added the now obsolete CONFIG_PDC_NARROW to allow
91 * systems with 32-bit MEM_PDC calls. This will allow wide kernels to 91 * 64-bit kernels to run on systems with 32-bit MEM_PDC calls.
92 * run on Cxxx boxes now. -RB 92 * This allowed wide kernels to run on Cxxx boxes.
93 * 93 * We now detect 32-bit-only PDC and dynamically switch to 32-bit mode
94 * Note that some PAT boxes may have 64-bit IODC I/O... 94 * when running a 64-bit kernel on such boxes (e.g. C200 or C360).
95 */ 95 */
96 96
97#ifdef __LP64__ 97#ifdef __LP64__
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 28405edf8448..0b47afc20690 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -12,7 +12,7 @@
12 * Initial Version 04-23-1999 by Helge Deller <deller@gmx.de> 12 * Initial Version 04-23-1999 by Helge Deller <deller@gmx.de>
13 */ 13 */
14 14
15#include <linux/autoconf.h> /* for CONFIG_SMP */ 15#include <linux/config.h> /* for CONFIG_SMP */
16 16
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/psw.h> 18#include <asm/psw.h>
@@ -36,10 +36,10 @@ boot_args:
36 .align 4 36 .align 4
37 .import init_thread_union,data 37 .import init_thread_union,data
38 .import fault_vector_20,code /* IVA parisc 2.0 32 bit */ 38 .import fault_vector_20,code /* IVA parisc 2.0 32 bit */
39#ifndef __LP64__ 39#ifndef CONFIG_64BIT
40 .import fault_vector_11,code /* IVA parisc 1.1 32 bit */ 40 .import fault_vector_11,code /* IVA parisc 1.1 32 bit */
41 .import $global$ /* forward declaration */ 41 .import $global$ /* forward declaration */
42#endif /*!LP64*/ 42#endif /*!CONFIG_64BIT*/
43 .export stext 43 .export stext
44 .export _stext,data /* Kernel want it this way! */ 44 .export _stext,data /* Kernel want it this way! */
45_stext: 45_stext:
@@ -76,7 +76,7 @@ $bss_loop:
76 mtctl %r4,%cr24 /* Initialize kernel root pointer */ 76 mtctl %r4,%cr24 /* Initialize kernel root pointer */
77 mtctl %r4,%cr25 /* Initialize user root pointer */ 77 mtctl %r4,%cr25 /* Initialize user root pointer */
78 78
79#ifdef __LP64__ 79#ifdef CONFIG_64BIT
80 /* Set pmd in pgd */ 80 /* Set pmd in pgd */
81 load32 PA(pmd0),%r5 81 load32 PA(pmd0),%r5
82 shrd %r5,PxD_VALUE_SHIFT,%r3 82 shrd %r5,PxD_VALUE_SHIFT,%r3
@@ -99,7 +99,7 @@ $bss_loop:
99 stw %r3,0(%r4) 99 stw %r3,0(%r4)
100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
101 addib,> -1,%r1,1b 101 addib,> -1,%r1,1b
102#ifdef __LP64__ 102#ifdef CONFIG_64BIT
103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4 103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4
104#else 104#else
105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4 105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4
@@ -170,7 +170,7 @@ common_stext:
170 stw %r0,0x28(%r0) /* MEM_RENDEZ_HI */ 170 stw %r0,0x28(%r0) /* MEM_RENDEZ_HI */
171#endif /*CONFIG_SMP*/ 171#endif /*CONFIG_SMP*/
172 172
173#ifdef __LP64__ 173#ifdef CONFIG_64BIT
174 tophys_r1 %sp 174 tophys_r1 %sp
175 175
176 /* Save the rfi target address */ 176 /* Save the rfi target address */
@@ -224,8 +224,6 @@ stext_pdc_ret:
224 mtctl %r0,%cr12 224 mtctl %r0,%cr12
225 mtctl %r0,%cr13 225 mtctl %r0,%cr13
226 226
227 /* Prepare to RFI! Man all the cannons! */
228
229 /* Initialize the global data pointer */ 227 /* Initialize the global data pointer */
230 loadgp 228 loadgp
231 229
@@ -235,7 +233,7 @@ stext_pdc_ret:
235 * following short sequence of instructions can determine this 233 * following short sequence of instructions can determine this
236 * (without being illegal on a PA1.1 machine). 234 * (without being illegal on a PA1.1 machine).
237 */ 235 */
238#ifndef __LP64__ 236#ifndef CONFIG_64BIT
239 ldi 32,%r10 237 ldi 32,%r10
240 mtctl %r10,%cr11 238 mtctl %r10,%cr11
241 .level 2.0 239 .level 2.0
@@ -248,52 +246,22 @@ stext_pdc_ret:
248 246
249$is_pa20: 247$is_pa20:
250 .level LEVEL /* restore 1.1 || 2.0w */ 248 .level LEVEL /* restore 1.1 || 2.0w */
251#endif /*!LP64*/ 249#endif /*!CONFIG_64BIT*/
252 load32 PA(fault_vector_20),%r10 250 load32 PA(fault_vector_20),%r10
253 251
254$install_iva: 252$install_iva:
255 mtctl %r10,%cr14 253 mtctl %r10,%cr14
256 254
257#ifdef __LP64__ 255 b aligned_rfi /* Prepare to RFI! Man all the cannons! */
258 b aligned_rfi
259 nop 256 nop
260 257
261 .align 256 258 .align 128
262aligned_rfi: 259aligned_rfi:
263 ssm 0,0 260 pcxt_ssm_bug
264 nop /* 1 */
265 nop /* 2 */
266 nop /* 3 */
267 nop /* 4 */
268 nop /* 5 */
269 nop /* 6 */
270 nop /* 7 */
271 nop /* 8 */
272#endif
273 261
274#ifdef __LP64__ /* move to psw.h? */ 262 rsm PSW_SM_QUIET,%r0 /* off troublesome PSW bits */
275#define PSW_BITS PSW_Q+PSW_I+PSW_D+PSW_P+PSW_R 263 /* Don't need NOPs, have 8 compliant insn before rfi */
276#else
277#define PSW_BITS PSW_SM_Q
278#endif
279 264
280$rfi:
281 /* turn off troublesome PSW bits */
282 rsm PSW_BITS,%r0
283
284 /* kernel PSW:
285 * - no interruptions except HPMC and TOC (which are handled by PDC)
286 * - Q bit set (IODC / PDC interruptions)
287 * - big-endian
288 * - virtually mapped
289 */
290 load32 KERNEL_PSW,%r10
291 mtctl %r10,%ipsw
292
293 /* Set the space pointers for the post-RFI world
294 ** Clear the two-level IIA Space Queue, effectively setting
295 ** Kernel space.
296 */
297 mtctl %r0,%cr17 /* Clear IIASQ tail */ 265 mtctl %r0,%cr17 /* Clear IIASQ tail */
298 mtctl %r0,%cr17 /* Clear IIASQ head */ 266 mtctl %r0,%cr17 /* Clear IIASQ head */
299 267
@@ -301,8 +269,11 @@ $rfi:
301 mtctl %r11,%cr18 /* IIAOQ head */ 269 mtctl %r11,%cr18 /* IIAOQ head */
302 ldo 4(%r11),%r11 270 ldo 4(%r11),%r11
303 mtctl %r11,%cr18 /* IIAOQ tail */ 271 mtctl %r11,%cr18 /* IIAOQ tail */
272
273 load32 KERNEL_PSW,%r10
274 mtctl %r10,%ipsw
304 275
305 /* Jump to hyperspace */ 276 /* Jump through hyperspace to Virt Mode */
306 rfi 277 rfi
307 nop 278 nop
308 279
@@ -313,7 +284,7 @@ $rfi:
313 .import smp_init_current_idle_task,data 284 .import smp_init_current_idle_task,data
314 .import smp_callin,code 285 .import smp_callin,code
315 286
316#ifndef __LP64__ 287#ifndef CONFIG_64BIT
317smp_callin_rtn: 288smp_callin_rtn:
318 .proc 289 .proc
319 .callinfo 290 .callinfo
@@ -321,7 +292,7 @@ smp_callin_rtn:
321 nop 292 nop
322 nop 293 nop
323 .procend 294 .procend
324#endif /*!LP64*/ 295#endif /*!CONFIG_64BIT*/
325 296
326/*************************************************************************** 297/***************************************************************************
327* smp_slave_stext is executed by all non-monarch Processors when the Monarch 298* smp_slave_stext is executed by all non-monarch Processors when the Monarch
@@ -356,7 +327,7 @@ smp_slave_stext:
356 mtctl %r4,%cr24 /* Initialize kernel root pointer */ 327 mtctl %r4,%cr24 /* Initialize kernel root pointer */
357 mtctl %r4,%cr25 /* Initialize user root pointer */ 328 mtctl %r4,%cr25 /* Initialize user root pointer */
358 329
359#ifdef __LP64__ 330#ifdef CONFIG_64BIT
360 /* Setup PDCE_PROC entry */ 331 /* Setup PDCE_PROC entry */
361 copy %arg0,%r3 332 copy %arg0,%r3
362#else 333#else
@@ -373,7 +344,7 @@ smp_slave_stext:
373 344
374 .procend 345 .procend
375#endif /* CONFIG_SMP */ 346#endif /* CONFIG_SMP */
376#ifndef __LP64__ 347#ifndef CONFIG_64BIT
377 .data 348 .data
378 349
379 .align 4 350 .align 4
@@ -383,4 +354,4 @@ smp_slave_stext:
383 .size $global$,4 354 .size $global$,4
384$global$: 355$global$:
385 .word 0 356 .word 0
386#endif /*!LP64*/ 357#endif /*!CONFIG_64BIT*/
diff --git a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c
index 1d3824b670d1..8cad8f004f00 100644
--- a/arch/parisc/kernel/ioctl32.c
+++ b/arch/parisc/kernel/ioctl32.c
@@ -104,12 +104,9 @@ static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
104 } 104 }
105 105
106out: 106out:
107 if (kversion.name) 107 kfree(kversion.name);
108 kfree(kversion.name); 108 kfree(kversion.date);
109 if (kversion.date) 109 kfree(kversion.desc);
110 kfree(kversion.date);
111 if (kversion.desc)
112 kfree(kversion.desc);
113 return ret; 110 return ret;
114} 111}
115 112
@@ -166,9 +163,7 @@ static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long a
166 ret = -EFAULT; 163 ret = -EFAULT;
167 } 164 }
168 165
169 if (karg.unique != NULL) 166 kfree(karg.unique);
170 kfree(karg.unique);
171
172 return ret; 167 return ret;
173} 168}
174 169
@@ -265,7 +260,6 @@ static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
265 } 260 }
266 261
267 kfree(karg.list); 262 kfree(karg.list);
268
269 return ret; 263 return ret;
270} 264}
271 265
@@ -305,7 +299,6 @@ static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
305 299
306out: 300out:
307 kfree(karg.list); 301 kfree(karg.list);
308
309 return ret; 302 return ret;
310} 303}
311 304
@@ -494,15 +487,10 @@ static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
494 } 487 }
495 488
496out: 489out:
497 if (karg.send_indices) 490 kfree(karg.send_indices);
498 kfree(karg.send_indices); 491 kfree(karg.send_sizes);
499 if (karg.send_sizes) 492 kfree(karg.request_indices);
500 kfree(karg.send_sizes); 493 kfree(karg.request_sizes);
501 if (karg.request_indices)
502 kfree(karg.request_indices);
503 if (karg.request_sizes)
504 kfree(karg.request_sizes);
505
506 return ret; 494 return ret;
507} 495}
508 496
@@ -555,9 +543,7 @@ static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
555 ret = -EFAULT; 543 ret = -EFAULT;
556 } 544 }
557 545
558 if (karg.contexts) 546 kfree(karg.contexts);
559 kfree(karg.contexts);
560
561 return ret; 547 return ret;
562} 548}
563 549
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 77e03bc0f935..9534ee17b9be 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -26,7 +26,7 @@
26 * can be used. 26 * can be used.
27 */ 27 */
28 28
29#ifdef __LP64__ 29#ifdef CONFIG_64BIT
30#define ADDIB addib,* 30#define ADDIB addib,*
31#define CMPB cmpb,* 31#define CMPB cmpb,*
32#define ANDCM andcm,* 32#define ANDCM andcm,*
@@ -40,8 +40,10 @@
40 .level 2.0 40 .level 2.0
41#endif 41#endif
42 42
43#include <asm/assembly.h> 43#include <linux/config.h>
44
44#include <asm/psw.h> 45#include <asm/psw.h>
46#include <asm/assembly.h>
45#include <asm/pgtable.h> 47#include <asm/pgtable.h>
46#include <asm/cache.h> 48#include <asm/cache.h>
47 49
@@ -62,32 +64,23 @@ flush_tlb_all_local:
62 * to happen in real mode with all interruptions disabled. 64 * to happen in real mode with all interruptions disabled.
63 */ 65 */
64 66
65 /* 67 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */
66 * Once again, we do the rfi dance ... some day we need examine 68 rsm PSW_SM_I, %r19 /* save I-bit state */
67 * all of our uses of this type of code and see what can be 69 load32 PA(1f), %r1
68 * consolidated.
69 */
70
71 rsm PSW_SM_I, %r19 /* relied upon translation! PA 2.0 Arch. F-5 */
72 nop 70 nop
73 nop 71 nop
74 nop 72 nop
75 nop 73 nop
76 nop 74 nop
77 nop 75
78 nop 76 rsm PSW_SM_Q, %r0 /* prep to load iia queue */
79
80 rsm PSW_SM_Q, %r0 /* Turn off Q bit to load iia queue */
81 ldil L%REAL_MODE_PSW, %r1
82 ldo R%REAL_MODE_PSW(%r1), %r1
83 mtctl %r1, %cr22
84 mtctl %r0, %cr17 /* Clear IIASQ tail */ 77 mtctl %r0, %cr17 /* Clear IIASQ tail */
85 mtctl %r0, %cr17 /* Clear IIASQ head */ 78 mtctl %r0, %cr17 /* Clear IIASQ head */
86 ldil L%PA(1f), %r1
87 ldo R%PA(1f)(%r1), %r1
88 mtctl %r1, %cr18 /* IIAOQ head */ 79 mtctl %r1, %cr18 /* IIAOQ head */
89 ldo 4(%r1), %r1 80 ldo 4(%r1), %r1
90 mtctl %r1, %cr18 /* IIAOQ tail */ 81 mtctl %r1, %cr18 /* IIAOQ tail */
82 load32 REAL_MODE_PSW, %r1
83 mtctl %r1, %ipsw
91 rfi 84 rfi
92 nop 85 nop
93 86
@@ -178,29 +171,36 @@ fdtonemiddle: /* Loop if LOOP = 1 */
178 ADDIB> -1, %r22, fdtoneloop /* Outer loop count decr */ 171 ADDIB> -1, %r22, fdtoneloop /* Outer loop count decr */
179 add %r21, %r20, %r20 /* increment space */ 172 add %r21, %r20, %r20 /* increment space */
180 173
181fdtdone:
182 174
183 /* Switch back to virtual mode */ 175fdtdone:
176 /*
177 * Switch back to virtual mode
178 */
179 /* pcxt_ssm_bug */
180 rsm PSW_SM_I, %r0
181 load32 2f, %r1
182 nop
183 nop
184 nop
185 nop
186 nop
184 187
185 rsm PSW_SM_Q, %r0 /* clear Q bit to load iia queue */ 188 rsm PSW_SM_Q, %r0 /* prep to load iia queue */
186 ldil L%KERNEL_PSW, %r1
187 ldo R%KERNEL_PSW(%r1), %r1
188 or %r1, %r19, %r1 /* Set I bit if set on entry */
189 mtctl %r1, %cr22
190 mtctl %r0, %cr17 /* Clear IIASQ tail */ 189 mtctl %r0, %cr17 /* Clear IIASQ tail */
191 mtctl %r0, %cr17 /* Clear IIASQ head */ 190 mtctl %r0, %cr17 /* Clear IIASQ head */
192 ldil L%(2f), %r1
193 ldo R%(2f)(%r1), %r1
194 mtctl %r1, %cr18 /* IIAOQ head */ 191 mtctl %r1, %cr18 /* IIAOQ head */
195 ldo 4(%r1), %r1 192 ldo 4(%r1), %r1
196 mtctl %r1, %cr18 /* IIAOQ tail */ 193 mtctl %r1, %cr18 /* IIAOQ tail */
194 load32 KERNEL_PSW, %r1
195 or %r1, %r19, %r1 /* I-bit to state on entry */
196 mtctl %r1, %ipsw /* restore I-bit (entire PSW) */
197 rfi 197 rfi
198 nop 198 nop
199 199
2002: bv %r0(%r2) 2002: bv %r0(%r2)
201 nop 201 nop
202 .exit
203 202
203 .exit
204 .procend 204 .procend
205 205
206 .export flush_instruction_cache_local,code 206 .export flush_instruction_cache_local,code
@@ -227,7 +227,7 @@ flush_instruction_cache_local:
227 227
228fimanyloop: /* Loop if LOOP >= 2 */ 228fimanyloop: /* Loop if LOOP >= 2 */
229 ADDIB> -1, %r31, fimanyloop /* Adjusted inner loop decr */ 229 ADDIB> -1, %r31, fimanyloop /* Adjusted inner loop decr */
230 fice 0(%sr1, %arg0) 230 fice %r0(%sr1, %arg0)
231 fice,m %arg1(%sr1, %arg0) /* Last fice and addr adjust */ 231 fice,m %arg1(%sr1, %arg0) /* Last fice and addr adjust */
232 movb,tr %arg3, %r31, fimanyloop /* Re-init inner loop count */ 232 movb,tr %arg3, %r31, fimanyloop /* Re-init inner loop count */
233 ADDIB<=,n -1, %arg2, fisync /* Outer loop decr */ 233 ADDIB<=,n -1, %arg2, fisync /* Outer loop decr */
@@ -238,7 +238,7 @@ fioneloop: /* Loop if LOOP = 1 */
238 238
239fisync: 239fisync:
240 sync 240 sync
241 mtsm %r22 241 mtsm %r22 /* restore I-bit */
242 bv %r0(%r2) 242 bv %r0(%r2)
243 nop 243 nop
244 .exit 244 .exit
@@ -269,7 +269,7 @@ flush_data_cache_local:
269 269
270fdmanyloop: /* Loop if LOOP >= 2 */ 270fdmanyloop: /* Loop if LOOP >= 2 */
271 ADDIB> -1, %r31, fdmanyloop /* Adjusted inner loop decr */ 271 ADDIB> -1, %r31, fdmanyloop /* Adjusted inner loop decr */
272 fdce 0(%sr1, %arg0) 272 fdce %r0(%sr1, %arg0)
273 fdce,m %arg1(%sr1, %arg0) /* Last fdce and addr adjust */ 273 fdce,m %arg1(%sr1, %arg0) /* Last fdce and addr adjust */
274 movb,tr %arg3, %r31, fdmanyloop /* Re-init inner loop count */ 274 movb,tr %arg3, %r31, fdmanyloop /* Re-init inner loop count */
275 ADDIB<=,n -1, %arg2, fdsync /* Outer loop decr */ 275 ADDIB<=,n -1, %arg2, fdsync /* Outer loop decr */
@@ -281,7 +281,7 @@ fdoneloop: /* Loop if LOOP = 1 */
281fdsync: 281fdsync:
282 syncdma 282 syncdma
283 sync 283 sync
284 mtsm %r22 284 mtsm %r22 /* restore I-bit */
285 bv %r0(%r2) 285 bv %r0(%r2)
286 nop 286 nop
287 .exit 287 .exit
@@ -296,7 +296,7 @@ copy_user_page_asm:
296 .callinfo NO_CALLS 296 .callinfo NO_CALLS
297 .entry 297 .entry
298 298
299#ifdef __LP64__ 299#ifdef CONFIG_64BIT
300 /* PA8x00 CPUs can consume 2 loads or 1 store per cycle. 300 /* PA8x00 CPUs can consume 2 loads or 1 store per cycle.
301 * Unroll the loop by hand and arrange insn appropriately. 301 * Unroll the loop by hand and arrange insn appropriately.
302 * GCC probably can do this just as well. 302 * GCC probably can do this just as well.
@@ -351,7 +351,11 @@ copy_user_page_asm:
351 std %r22, 120(%r26) 351 std %r22, 120(%r26)
352 ldo 128(%r26), %r26 352 ldo 128(%r26), %r26
353 353
354 ADDIB> -1, %r1, 1b /* bundle 10 */ 354 /* conditional branches nullify on forward taken branch, and on
355 * non-taken backward branch. Note that .+4 is a backwards branch.
356 * The ldd should only get executed if the branch is taken.
357 */
358 ADDIB>,n -1, %r1, 1b /* bundle 10 */
355 ldd 0(%r25), %r19 /* start next loads */ 359 ldd 0(%r25), %r19 /* start next loads */
356 360
357#else 361#else
@@ -363,10 +367,10 @@ copy_user_page_asm:
363 * the full 64 bit register values on interrupt, we can't 367 * the full 64 bit register values on interrupt, we can't
364 * use ldd/std on a 32 bit kernel. 368 * use ldd/std on a 32 bit kernel.
365 */ 369 */
370 ldw 0(%r25), %r19
366 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */ 371 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */
367 372
3681: 3731:
369 ldw 0(%r25), %r19
370 ldw 4(%r25), %r20 374 ldw 4(%r25), %r20
371 ldw 8(%r25), %r21 375 ldw 8(%r25), %r21
372 ldw 12(%r25), %r22 376 ldw 12(%r25), %r22
@@ -396,11 +400,12 @@ copy_user_page_asm:
396 ldw 60(%r25), %r22 400 ldw 60(%r25), %r22
397 stw %r19, 48(%r26) 401 stw %r19, 48(%r26)
398 stw %r20, 52(%r26) 402 stw %r20, 52(%r26)
403 ldo 64(%r25), %r25
399 stw %r21, 56(%r26) 404 stw %r21, 56(%r26)
400 stw %r22, 60(%r26) 405 stw %r22, 60(%r26)
401 ldo 64(%r26), %r26 406 ldo 64(%r26), %r26
402 ADDIB> -1, %r1, 1b 407 ADDIB>,n -1, %r1, 1b
403 ldo 64(%r25), %r25 408 ldw 0(%r25), %r19
404#endif 409#endif
405 bv %r0(%r2) 410 bv %r0(%r2)
406 nop 411 nop
@@ -456,7 +461,7 @@ copy_user_page_asm:
456 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */ 461 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */
457 462
458 ldil L%(TMPALIAS_MAP_START), %r28 463 ldil L%(TMPALIAS_MAP_START), %r28
459#ifdef __LP64__ 464#ifdef CONFIG_64BIT
460 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */ 465 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */
461 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */ 466 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */
462 depd %r24,63,22, %r28 /* Form aliased virtual address 'to' */ 467 depd %r24,63,22, %r28 /* Form aliased virtual address 'to' */
@@ -543,7 +548,7 @@ __clear_user_page_asm:
543 tophys_r1 %r26 548 tophys_r1 %r26
544 549
545 ldil L%(TMPALIAS_MAP_START), %r28 550 ldil L%(TMPALIAS_MAP_START), %r28
546#ifdef __LP64__ 551#ifdef CONFIG_64BIT
547#if (TMPALIAS_MAP_START >= 0x80000000) 552#if (TMPALIAS_MAP_START >= 0x80000000)
548 depdi 0, 31,32, %r28 /* clear any sign extension */ 553 depdi 0, 31,32, %r28 /* clear any sign extension */
549#endif 554#endif
@@ -560,7 +565,7 @@ __clear_user_page_asm:
560 565
561 pdtlb 0(%r28) 566 pdtlb 0(%r28)
562 567
563#ifdef __LP64__ 568#ifdef CONFIG_64BIT
564 ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 569 ldi 32, %r1 /* PAGE_SIZE/128 == 32 */
565 570
566 /* PREFETCH (Write) has not (yet) been proven to help here */ 571 /* PREFETCH (Write) has not (yet) been proven to help here */
@@ -585,7 +590,7 @@ __clear_user_page_asm:
585 ADDIB> -1, %r1, 1b 590 ADDIB> -1, %r1, 1b
586 ldo 128(%r28), %r28 591 ldo 128(%r28), %r28
587 592
588#else /* ! __LP64 */ 593#else /* ! CONFIG_64BIT */
589 594
590 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */ 595 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */
591 596
@@ -608,7 +613,7 @@ __clear_user_page_asm:
608 stw %r0, 60(%r28) 613 stw %r0, 60(%r28)
609 ADDIB> -1, %r1, 1b 614 ADDIB> -1, %r1, 1b
610 ldo 64(%r28), %r28 615 ldo 64(%r28), %r28
611#endif /* __LP64 */ 616#endif /* CONFIG_64BIT */
612 617
613 bv %r0(%r2) 618 bv %r0(%r2)
614 nop 619 nop
@@ -626,7 +631,7 @@ flush_kernel_dcache_page:
626 ldil L%dcache_stride, %r1 631 ldil L%dcache_stride, %r1
627 ldw R%dcache_stride(%r1), %r23 632 ldw R%dcache_stride(%r1), %r23
628 633
629#ifdef __LP64__ 634#ifdef CONFIG_64BIT
630 depdi,z 1, 63-PAGE_SHIFT,1, %r25 635 depdi,z 1, 63-PAGE_SHIFT,1, %r25
631#else 636#else
632 depwi,z 1, 31-PAGE_SHIFT,1, %r25 637 depwi,z 1, 31-PAGE_SHIFT,1, %r25
@@ -670,7 +675,7 @@ flush_user_dcache_page:
670 ldil L%dcache_stride, %r1 675 ldil L%dcache_stride, %r1
671 ldw R%dcache_stride(%r1), %r23 676 ldw R%dcache_stride(%r1), %r23
672 677
673#ifdef __LP64__ 678#ifdef CONFIG_64BIT
674 depdi,z 1,63-PAGE_SHIFT,1, %r25 679 depdi,z 1,63-PAGE_SHIFT,1, %r25
675#else 680#else
676 depwi,z 1,31-PAGE_SHIFT,1, %r25 681 depwi,z 1,31-PAGE_SHIFT,1, %r25
@@ -714,7 +719,7 @@ flush_user_icache_page:
714 ldil L%dcache_stride, %r1 719 ldil L%dcache_stride, %r1
715 ldw R%dcache_stride(%r1), %r23 720 ldw R%dcache_stride(%r1), %r23
716 721
717#ifdef __LP64__ 722#ifdef CONFIG_64BIT
718 depdi,z 1, 63-PAGE_SHIFT,1, %r25 723 depdi,z 1, 63-PAGE_SHIFT,1, %r25
719#else 724#else
720 depwi,z 1, 31-PAGE_SHIFT,1, %r25 725 depwi,z 1, 31-PAGE_SHIFT,1, %r25
@@ -759,7 +764,7 @@ purge_kernel_dcache_page:
759 ldil L%dcache_stride, %r1 764 ldil L%dcache_stride, %r1
760 ldw R%dcache_stride(%r1), %r23 765 ldw R%dcache_stride(%r1), %r23
761 766
762#ifdef __LP64__ 767#ifdef CONFIG_64BIT
763 depdi,z 1, 63-PAGE_SHIFT,1, %r25 768 depdi,z 1, 63-PAGE_SHIFT,1, %r25
764#else 769#else
765 depwi,z 1, 31-PAGE_SHIFT,1, %r25 770 depwi,z 1, 31-PAGE_SHIFT,1, %r25
@@ -807,7 +812,7 @@ flush_alias_page:
807 tophys_r1 %r26 812 tophys_r1 %r26
808 813
809 ldil L%(TMPALIAS_MAP_START), %r28 814 ldil L%(TMPALIAS_MAP_START), %r28
810#ifdef __LP64__ 815#ifdef CONFIG_64BIT
811 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */ 816 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */
812 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */ 817 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */
813 depdi 0, 63,12, %r28 /* Clear any offset bits */ 818 depdi 0, 63,12, %r28 /* Clear any offset bits */
@@ -824,7 +829,7 @@ flush_alias_page:
824 ldil L%dcache_stride, %r1 829 ldil L%dcache_stride, %r1
825 ldw R%dcache_stride(%r1), %r23 830 ldw R%dcache_stride(%r1), %r23
826 831
827#ifdef __LP64__ 832#ifdef CONFIG_64BIT
828 depdi,z 1, 63-PAGE_SHIFT,1, %r29 833 depdi,z 1, 63-PAGE_SHIFT,1, %r29
829#else 834#else
830 depwi,z 1, 31-PAGE_SHIFT,1, %r29 835 depwi,z 1, 31-PAGE_SHIFT,1, %r29
@@ -935,7 +940,7 @@ flush_kernel_icache_page:
935 ldil L%icache_stride, %r1 940 ldil L%icache_stride, %r1
936 ldw R%icache_stride(%r1), %r23 941 ldw R%icache_stride(%r1), %r23
937 942
938#ifdef __LP64__ 943#ifdef CONFIG_64BIT
939 depdi,z 1, 63-PAGE_SHIFT,1, %r25 944 depdi,z 1, 63-PAGE_SHIFT,1, %r25
940#else 945#else
941 depwi,z 1, 31-PAGE_SHIFT,1, %r25 946 depwi,z 1, 31-PAGE_SHIFT,1, %r25
@@ -944,23 +949,23 @@ flush_kernel_icache_page:
944 sub %r25, %r23, %r25 949 sub %r25, %r23, %r25
945 950
946 951
9471: fic,m %r23(%r26) 9521: fic,m %r23(%sr4, %r26)
948 fic,m %r23(%r26) 953 fic,m %r23(%sr4, %r26)
949 fic,m %r23(%r26) 954 fic,m %r23(%sr4, %r26)
950 fic,m %r23(%r26) 955 fic,m %r23(%sr4, %r26)
951 fic,m %r23(%r26) 956 fic,m %r23(%sr4, %r26)
952 fic,m %r23(%r26) 957 fic,m %r23(%sr4, %r26)
953 fic,m %r23(%r26) 958 fic,m %r23(%sr4, %r26)
954 fic,m %r23(%r26) 959 fic,m %r23(%sr4, %r26)
955 fic,m %r23(%r26) 960 fic,m %r23(%sr4, %r26)
956 fic,m %r23(%r26) 961 fic,m %r23(%sr4, %r26)
957 fic,m %r23(%r26) 962 fic,m %r23(%sr4, %r26)
958 fic,m %r23(%r26) 963 fic,m %r23(%sr4, %r26)
959 fic,m %r23(%r26) 964 fic,m %r23(%sr4, %r26)
960 fic,m %r23(%r26) 965 fic,m %r23(%sr4, %r26)
961 fic,m %r23(%r26) 966 fic,m %r23(%sr4, %r26)
962 CMPB<< %r26, %r25, 1b 967 CMPB<< %r26, %r25, 1b
963 fic,m %r23(%r26) 968 fic,m %r23(%sr4, %r26)
964 969
965 sync 970 sync
966 bv %r0(%r2) 971 bv %r0(%r2)
@@ -982,17 +987,18 @@ flush_kernel_icache_range_asm:
982 ANDCM %r26, %r21, %r26 987 ANDCM %r26, %r21, %r26
983 988
9841: CMPB<<,n %r26, %r25, 1b 9891: CMPB<<,n %r26, %r25, 1b
985 fic,m %r23(%r26) 990 fic,m %r23(%sr4, %r26)
986 991
987 sync 992 sync
988 bv %r0(%r2) 993 bv %r0(%r2)
989 nop 994 nop
990 .exit 995 .exit
991
992 .procend 996 .procend
993 997
994 .align 128 998 /* align should cover use of rfi in disable_sr_hashing_asm and
995 999 * srdis_done.
1000 */
1001 .align 256
996 .export disable_sr_hashing_asm,code 1002 .export disable_sr_hashing_asm,code
997 1003
998disable_sr_hashing_asm: 1004disable_sr_hashing_asm:
@@ -1000,28 +1006,26 @@ disable_sr_hashing_asm:
1000 .callinfo NO_CALLS 1006 .callinfo NO_CALLS
1001 .entry 1007 .entry
1002 1008
1003 /* Switch to real mode */ 1009 /*
1004 1010 * Switch to real mode
1005 ssm 0, %r0 /* relied upon translation! */ 1011 */
1006 nop 1012 /* pcxt_ssm_bug */
1007 nop 1013 rsm PSW_SM_I, %r0
1014 load32 PA(1f), %r1
1008 nop 1015 nop
1009 nop 1016 nop
1010 nop 1017 nop
1011 nop 1018 nop
1012 nop 1019 nop
1013 1020
1014 rsm (PSW_SM_Q|PSW_SM_I), %r0 /* disable Q&I to load the iia queue */ 1021 rsm PSW_SM_Q, %r0 /* prep to load iia queue */
1015 ldil L%REAL_MODE_PSW, %r1
1016 ldo R%REAL_MODE_PSW(%r1), %r1
1017 mtctl %r1, %cr22
1018 mtctl %r0, %cr17 /* Clear IIASQ tail */ 1022 mtctl %r0, %cr17 /* Clear IIASQ tail */
1019 mtctl %r0, %cr17 /* Clear IIASQ head */ 1023 mtctl %r0, %cr17 /* Clear IIASQ head */
1020 ldil L%PA(1f), %r1
1021 ldo R%PA(1f)(%r1), %r1
1022 mtctl %r1, %cr18 /* IIAOQ head */ 1024 mtctl %r1, %cr18 /* IIAOQ head */
1023 ldo 4(%r1), %r1 1025 ldo 4(%r1), %r1
1024 mtctl %r1, %cr18 /* IIAOQ tail */ 1026 mtctl %r1, %cr18 /* IIAOQ tail */
1027 load32 REAL_MODE_PSW, %r1
1028 mtctl %r1, %ipsw
1025 rfi 1029 rfi
1026 nop 1030 nop
1027 1031
@@ -1053,27 +1057,31 @@ srdis_pcxl:
1053 1057
1054srdis_pa20: 1058srdis_pa20:
1055 1059
1056 /* Disable Space Register Hashing for PCXU,PCXU+,PCXW,PCXW+ */ 1060 /* Disable Space Register Hashing for PCXU,PCXU+,PCXW,PCXW+,PCXW2 */
1057 1061
1058 .word 0x144008bc /* mfdiag %dr2, %r28 */ 1062 .word 0x144008bc /* mfdiag %dr2, %r28 */
1059 depdi 0, 54,1, %r28 /* clear DIAG_SPHASH_ENAB (bit 54) */ 1063 depdi 0, 54,1, %r28 /* clear DIAG_SPHASH_ENAB (bit 54) */
1060 .word 0x145c1840 /* mtdiag %r28, %dr2 */ 1064 .word 0x145c1840 /* mtdiag %r28, %dr2 */
1061 1065
1062srdis_done:
1063 1066
1067srdis_done:
1064 /* Switch back to virtual mode */ 1068 /* Switch back to virtual mode */
1069 rsm PSW_SM_I, %r0 /* prep to load iia queue */
1070 load32 2f, %r1
1071 nop
1072 nop
1073 nop
1074 nop
1075 nop
1065 1076
1066 rsm PSW_SM_Q, %r0 /* clear Q bit to load iia queue */ 1077 rsm PSW_SM_Q, %r0 /* prep to load iia queue */
1067 ldil L%KERNEL_PSW, %r1
1068 ldo R%KERNEL_PSW(%r1), %r1
1069 mtctl %r1, %cr22
1070 mtctl %r0, %cr17 /* Clear IIASQ tail */ 1078 mtctl %r0, %cr17 /* Clear IIASQ tail */
1071 mtctl %r0, %cr17 /* Clear IIASQ head */ 1079 mtctl %r0, %cr17 /* Clear IIASQ head */
1072 ldil L%(2f), %r1
1073 ldo R%(2f)(%r1), %r1
1074 mtctl %r1, %cr18 /* IIAOQ head */ 1080 mtctl %r1, %cr18 /* IIAOQ head */
1075 ldo 4(%r1), %r1 1081 ldo 4(%r1), %r1
1076 mtctl %r1, %cr18 /* IIAOQ tail */ 1082 mtctl %r1, %cr18 /* IIAOQ tail */
1083 load32 KERNEL_PSW, %r1
1084 mtctl %r1, %ipsw
1077 rfi 1085 rfi
1078 nop 1086 nop
1079 1087
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 844c2877a2e3..ae6213d71670 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -31,7 +31,7 @@
31#include <asm/page.h> /* get_order */ 31#include <asm/page.h> /* get_order */
32#include <asm/pgalloc.h> 32#include <asm/pgalloc.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34 34#include <asm/tlbflush.h> /* for purge_tlb_*() macros */
35 35
36static struct proc_dir_entry * proc_gsc_root = NULL; 36static struct proc_dir_entry * proc_gsc_root = NULL;
37static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length); 37static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);
@@ -333,18 +333,28 @@ pcxl_free_range(unsigned long vaddr, size_t size)
333static int __init 333static int __init
334pcxl_dma_init(void) 334pcxl_dma_init(void)
335{ 335{
336 if (pcxl_dma_start == 0) 336 if (pcxl_dma_start == 0)
337 return 0; 337 return 0;
338 338
339 spin_lock_init(&pcxl_res_lock); 339 spin_lock_init(&pcxl_res_lock);
340 pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3); 340 pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3);
341 pcxl_res_hint = 0; 341 pcxl_res_hint = 0;
342 pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL, 342 pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL,
343 get_order(pcxl_res_size)); 343 get_order(pcxl_res_size));
344 memset(pcxl_res_map, 0, pcxl_res_size); 344 memset(pcxl_res_map, 0, pcxl_res_size);
345 proc_gsc_root = proc_mkdir("gsc", 0); 345 proc_gsc_root = proc_mkdir("gsc", 0);
346 create_proc_info_entry("dino", 0, proc_gsc_root, pcxl_proc_info); 346 if (!proc_gsc_root)
347 return 0; 347 printk(KERN_WARNING
348 "pcxl_dma_init: Unable to create gsc /proc dir entry\n");
349 else {
350 struct proc_dir_entry* ent;
351 ent = create_proc_info_entry("pcxl_dma", 0,
352 proc_gsc_root, pcxl_proc_info);
353 if (!ent)
354 printk(KERN_WARNING
355 "pci-dma.c: Unable to create pcxl_dma /proc entry.\n");
356 }
357 return 0;
348} 358}
349 359
350__initcall(pcxl_dma_init); 360__initcall(pcxl_dma_init);
@@ -545,16 +555,16 @@ struct hppa_dma_ops pcx_dma_ops = {
545 555
546static int pcxl_proc_info(char *buf, char **start, off_t offset, int len) 556static int pcxl_proc_info(char *buf, char **start, off_t offset, int len)
547{ 557{
558#if 0
548 u_long i = 0; 559 u_long i = 0;
549 unsigned long *res_ptr = (u_long *)pcxl_res_map; 560 unsigned long *res_ptr = (u_long *)pcxl_res_map;
550 unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ 561#endif
562 unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */
551 563
552 sprintf(buf, "\nDMA Mapping Area size : %d bytes (%d pages)\n", 564 sprintf(buf, "\nDMA Mapping Area size : %d bytes (%ld pages)\n",
553 PCXL_DMA_MAP_SIZE, 565 PCXL_DMA_MAP_SIZE, total_pages);
554 (pcxl_res_size << 3) ); /* 1 bit per page */
555 566
556 sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", 567 sprintf(buf, "%sResource bitmap : %d bytes\n", buf, pcxl_res_size);
557 buf, pcxl_res_size, pcxl_res_size << 3); /* 8 bits per byte */
558 568
559 strcat(buf, " total: free: used: % used:\n"); 569 strcat(buf, " total: free: used: % used:\n");
560 sprintf(buf, "%sblocks %8d %8ld %8ld %8ld%%\n", buf, pcxl_res_size, 570 sprintf(buf, "%sblocks %8d %8ld %8ld %8ld%%\n", buf, pcxl_res_size,
@@ -564,7 +574,8 @@ static int pcxl_proc_info(char *buf, char **start, off_t offset, int len)
564 sprintf(buf, "%spages %8ld %8ld %8ld %8ld%%\n", buf, total_pages, 574 sprintf(buf, "%spages %8ld %8ld %8ld %8ld%%\n", buf, total_pages,
565 total_pages - pcxl_used_pages, pcxl_used_pages, 575 total_pages - pcxl_used_pages, pcxl_used_pages,
566 (pcxl_used_pages * 100 / total_pages)); 576 (pcxl_used_pages * 100 / total_pages));
567 577
578#if 0
568 strcat(buf, "\nResource bitmap:"); 579 strcat(buf, "\nResource bitmap:");
569 580
570 for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { 581 for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) {
@@ -572,6 +583,7 @@ static int pcxl_proc_info(char *buf, char **start, off_t offset, int len)
572 strcat(buf,"\n "); 583 strcat(buf,"\n ");
573 sprintf(buf, "%s %08lx", buf, *res_ptr); 584 sprintf(buf, "%s %08lx", buf, *res_ptr);
574 } 585 }
586#endif
575 strcat(buf, "\n"); 587 strcat(buf, "\n");
576 return strlen(buf); 588 return strlen(buf);
577} 589}
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index e6a891a0cad0..88cba49c5301 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -202,7 +202,8 @@ static void
202pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) 202pcibios_link_hba_resources( struct resource *hba_res, struct resource *r)
203{ 203{
204 if (!r->parent) { 204 if (!r->parent) {
205 printk(KERN_EMERG "PCI: Tell willy he's wrong\n"); 205 printk(KERN_EMERG "PCI: resource not parented! [%lx-%lx]\n",
206 r->start, r->end);
206 r->parent = hba_res; 207 r->parent = hba_res;
207 208
208 /* reverse link is harder *sigh* */ 209 /* reverse link is harder *sigh* */
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 01f676d1673b..215d78c87bc5 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -41,7 +41,7 @@
41 41
42/* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems. 42/* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems.
43 * On production kernels EARLY_BOOTUP_DEBUG should be undefined. */ 43 * On production kernels EARLY_BOOTUP_DEBUG should be undefined. */
44#undef EARLY_BOOTUP_DEBUG 44#define EARLY_BOOTUP_DEBUG
45 45
46 46
47#include <linux/config.h> 47#include <linux/config.h>
@@ -49,14 +49,8 @@
49#include <linux/console.h> 49#include <linux/console.h>
50#include <linux/string.h> 50#include <linux/string.h>
51#include <linux/init.h> 51#include <linux/init.h>
52#include <linux/delay.h>
53#include <linux/sched.h>
54#include <linux/interrupt.h>
55#include <linux/major.h> 52#include <linux/major.h>
56#include <linux/tty.h> 53#include <linux/tty.h>
57#include <asm/page.h>
58#include <asm/types.h>
59#include <asm/system.h>
60#include <asm/pdc.h> /* for iodc_call() proto and friends */ 54#include <asm/pdc.h> /* for iodc_call() proto and friends */
61 55
62 56
@@ -96,7 +90,6 @@ static int pdc_console_setup(struct console *co, char *options)
96} 90}
97 91
98#if defined(CONFIG_PDC_CONSOLE) 92#if defined(CONFIG_PDC_CONSOLE)
99#define PDC_CONSOLE_DEVICE pdc_console_device
100static struct tty_driver * pdc_console_device (struct console *c, int *index) 93static struct tty_driver * pdc_console_device (struct console *c, int *index)
101{ 94{
102 extern struct tty_driver console_driver; 95 extern struct tty_driver console_driver;
@@ -104,22 +97,19 @@ static struct tty_driver * pdc_console_device (struct console *c, int *index)
104 return &console_driver; 97 return &console_driver;
105} 98}
106#else 99#else
107#define PDC_CONSOLE_DEVICE NULL 100#define pdc_console_device NULL
108#endif 101#endif
109 102
110static struct console pdc_cons = { 103static struct console pdc_cons = {
111 .name = "ttyB", 104 .name = "ttyB",
112 .write = pdc_console_write, 105 .write = pdc_console_write,
113 .device = PDC_CONSOLE_DEVICE, 106 .device = pdc_console_device,
114 .setup = pdc_console_setup, 107 .setup = pdc_console_setup,
115 .flags = CON_BOOT|CON_PRINTBUFFER|CON_ENABLED, 108 .flags = CON_BOOT | CON_PRINTBUFFER | CON_ENABLED,
116 .index = -1, 109 .index = -1,
117}; 110};
118 111
119static int pdc_console_initialized; 112static int pdc_console_initialized;
120extern unsigned long con_start; /* kernel/printk.c */
121extern unsigned long log_end; /* kernel/printk.c */
122
123 113
124static void pdc_console_init_force(void) 114static void pdc_console_init_force(void)
125{ 115{
@@ -146,27 +136,11 @@ void __init pdc_console_init(void)
146} 136}
147 137
148 138
149/* Unregister the pdc console with the printk console layer */
150void pdc_console_die(void)
151{
152 if (!pdc_console_initialized)
153 return;
154 --pdc_console_initialized;
155
156 printk(KERN_INFO "Switching from PDC console\n");
157
158 /* Don't repeat what we've already printed */
159 con_start = log_end;
160
161 unregister_console(&pdc_cons);
162}
163
164
165/* 139/*
166 * Used for emergencies. Currently only used if an HPMC occurs. If an 140 * Used for emergencies. Currently only used if an HPMC occurs. If an
167 * HPMC occurs, it is possible that the current console may not be 141 * HPMC occurs, it is possible that the current console may not be
168 * properly initialed after the PDC IO reset. This routine unregisters all 142 * properly initialised after the PDC IO reset. This routine unregisters
169 * of the current consoles, reinitializes the pdc console and 143 * all of the current consoles, reinitializes the pdc console and
170 * registers it. 144 * registers it.
171 */ 145 */
172 146
@@ -177,13 +151,13 @@ void pdc_console_restart(void)
177 if (pdc_console_initialized) 151 if (pdc_console_initialized)
178 return; 152 return;
179 153
154 /* If we've already seen the output, don't bother to print it again */
155 if (console_drivers != NULL)
156 pdc_cons.flags &= ~CON_PRINTBUFFER;
157
180 while ((console = console_drivers) != NULL) 158 while ((console = console_drivers) != NULL)
181 unregister_console(console_drivers); 159 unregister_console(console_drivers);
182 160
183 /* Don't repeat what we've already printed */
184 con_start = log_end;
185
186 /* force registering the pdc console */ 161 /* force registering the pdc console */
187 pdc_console_init_force(); 162 pdc_console_init_force();
188} 163}
189
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index b3ad0a505b87..44670d6e06f4 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -746,7 +746,8 @@ static int perf_write_image(uint64_t *memaddr)
746 uint64_t *bptr; 746 uint64_t *bptr;
747 uint32_t dwords; 747 uint32_t dwords;
748 uint32_t *intrigue_rdr; 748 uint32_t *intrigue_rdr;
749 uint64_t *intrigue_bitmask, tmp64, proc_hpa; 749 uint64_t *intrigue_bitmask, tmp64;
750 void __iomem *runway;
750 struct rdr_tbl_ent *tentry; 751 struct rdr_tbl_ent *tentry;
751 int i; 752 int i;
752 753
@@ -798,15 +799,16 @@ static int perf_write_image(uint64_t *memaddr)
798 return -1; 799 return -1;
799 } 800 }
800 801
801 proc_hpa = cpu_device->hpa; 802 runway = ioremap(cpu_device->hpa.start, 4096);
802 803
803 /* Merge intrigue bits into Runway STATUS 0 */ 804 /* Merge intrigue bits into Runway STATUS 0 */
804 tmp64 = __raw_readq(proc_hpa + RUNWAY_STATUS) & 0xffecfffffffffffful; 805 tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;
805 __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul), proc_hpa + RUNWAY_STATUS); 806 __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul),
807 runway + RUNWAY_STATUS);
806 808
807 /* Write RUNWAY DEBUG registers */ 809 /* Write RUNWAY DEBUG registers */
808 for (i = 0; i < 8; i++) { 810 for (i = 0; i < 8; i++) {
809 __raw_writeq(*memaddr++, proc_hpa + RUNWAY_DEBUG + i); 811 __raw_writeq(*memaddr++, runway + RUNWAY_DEBUG);
810 } 812 }
811 813
812 return 0; 814 return 0;
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 46b759385115..7fdca87ef647 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -9,7 +9,7 @@
9 * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org> 9 * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
10 * Copyright (C) 2000 Philipp Rumpf <prumpf with tux.org> 10 * Copyright (C) 2000 Philipp Rumpf <prumpf with tux.org>
11 * Copyright (C) 2000 David Kennedy <dkennedy with linuxcare.com> 11 * Copyright (C) 2000 David Kennedy <dkennedy with linuxcare.com>
12 * Copyright (C) 2000 Richard Hirst <rhirst with parisc-lixux.org> 12 * Copyright (C) 2000 Richard Hirst <rhirst with parisc-linux.org>
13 * Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org> 13 * Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org>
14 * Copyright (C) 2001 Alan Modra <amodra at parisc-linux.org> 14 * Copyright (C) 2001 Alan Modra <amodra at parisc-linux.org>
15 * Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org> 15 * Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org>
@@ -245,7 +245,17 @@ int
245sys_clone(unsigned long clone_flags, unsigned long usp, 245sys_clone(unsigned long clone_flags, unsigned long usp,
246 struct pt_regs *regs) 246 struct pt_regs *regs)
247{ 247{
248 int __user *user_tid = (int __user *)regs->gr[26]; 248 /* Arugments from userspace are:
249 r26 = Clone flags.
250 r25 = Child stack.
251 r24 = parent_tidptr.
252 r23 = Is the TLS storage descriptor
253 r22 = child_tidptr
254
255 However, these last 3 args are only examined
256 if the proper flags are set. */
257 int __user *child_tidptr;
258 int __user *parent_tidptr;
249 259
250 /* usp must be word aligned. This also prevents users from 260 /* usp must be word aligned. This also prevents users from
251 * passing in the value 1 (which is the signal for a special 261 * passing in the value 1 (which is the signal for a special
@@ -253,10 +263,20 @@ sys_clone(unsigned long clone_flags, unsigned long usp,
253 usp = ALIGN(usp, 4); 263 usp = ALIGN(usp, 4);
254 264
255 /* A zero value for usp means use the current stack */ 265 /* A zero value for usp means use the current stack */
256 if(usp == 0) 266 if (usp == 0)
257 usp = regs->gr[30]; 267 usp = regs->gr[30];
258 268
259 return do_fork(clone_flags, usp, regs, 0, user_tid, NULL); 269 if (clone_flags & CLONE_PARENT_SETTID)
270 parent_tidptr = (int __user *)regs->gr[24];
271 else
272 parent_tidptr = NULL;
273
274 if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID))
275 child_tidptr = (int __user *)regs->gr[22];
276 else
277 child_tidptr = NULL;
278
279 return do_fork(clone_flags, usp, regs, 0, parent_tidptr, child_tidptr);
260} 280}
261 281
262int 282int
@@ -332,6 +352,10 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
332 } else { 352 } else {
333 cregs->kpc = (unsigned long) &child_return; 353 cregs->kpc = (unsigned long) &child_return;
334 } 354 }
355 /* Setup thread TLS area from the 4th parameter in clone */
356 if (clone_flags & CLONE_SETTLS)
357 cregs->cr27 = pregs->gr[23];
358
335 } 359 }
336 360
337 return 0; 361 return 0;
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index 13b721cb9f55..4f5bbcf1f5a4 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -92,7 +92,7 @@ static int __init processor_probe(struct parisc_device *dev)
92 * May get overwritten by PAT code. 92 * May get overwritten by PAT code.
93 */ 93 */
94 cpuid = boot_cpu_data.cpu_count; 94 cpuid = boot_cpu_data.cpu_count;
95 txn_addr = dev->hpa; /* for legacy PDC */ 95 txn_addr = dev->hpa.start; /* for legacy PDC */
96 96
97#ifdef __LP64__ 97#ifdef __LP64__
98 if (is_pdc_pat()) { 98 if (is_pdc_pat()) {
@@ -122,7 +122,7 @@ static int __init processor_probe(struct parisc_device *dev)
122 * boot time (ie shutdown a CPU from an OS perspective). 122 * boot time (ie shutdown a CPU from an OS perspective).
123 */ 123 */
124 /* get the cpu number */ 124 /* get the cpu number */
125 status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa); 125 status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa.start);
126 126
127 BUG_ON(PDC_OK != status); 127 BUG_ON(PDC_OK != status);
128 128
@@ -130,7 +130,7 @@ static int __init processor_probe(struct parisc_device *dev)
130 printk(KERN_WARNING "IGNORING CPU at 0x%x," 130 printk(KERN_WARNING "IGNORING CPU at 0x%x,"
131 " cpu_slot_id > NR_CPUS" 131 " cpu_slot_id > NR_CPUS"
132 " (%ld > %d)\n", 132 " (%ld > %d)\n",
133 dev->hpa, cpu_info.cpu_num, NR_CPUS); 133 dev->hpa.start, cpu_info.cpu_num, NR_CPUS);
134 /* Ignore CPU since it will only crash */ 134 /* Ignore CPU since it will only crash */
135 boot_cpu_data.cpu_count--; 135 boot_cpu_data.cpu_count--;
136 return 1; 136 return 1;
@@ -149,7 +149,7 @@ static int __init processor_probe(struct parisc_device *dev)
149 149
150 p->loops_per_jiffy = loops_per_jiffy; 150 p->loops_per_jiffy = loops_per_jiffy;
151 p->dev = dev; /* Save IODC data in case we need it */ 151 p->dev = dev; /* Save IODC data in case we need it */
152 p->hpa = dev->hpa; /* save CPU hpa */ 152 p->hpa = dev->hpa.start; /* save CPU hpa */
153 p->cpuid = cpuid; /* save CPU id */ 153 p->cpuid = cpuid; /* save CPU id */
154 p->txn_addr = txn_addr; /* save CPU IRQ address */ 154 p->txn_addr = txn_addr; /* save CPU IRQ address */
155#ifdef CONFIG_SMP 155#ifdef CONFIG_SMP
diff --git a/arch/parisc/kernel/real2.S b/arch/parisc/kernel/real2.S
index 8dd5defb7316..8c2859cca77e 100644
--- a/arch/parisc/kernel/real2.S
+++ b/arch/parisc/kernel/real2.S
@@ -7,8 +7,10 @@
7 * Copyright (C) 2000 Hewlett Packard (Paul Bame bame@puffin.external.hp.com) 7 * Copyright (C) 2000 Hewlett Packard (Paul Bame bame@puffin.external.hp.com)
8 * 8 *
9 */ 9 */
10#include <asm/assembly.h> 10#include <linux/config.h>
11
11#include <asm/psw.h> 12#include <asm/psw.h>
13#include <asm/assembly.h>
12 14
13 .section .bss 15 .section .bss
14 .export real_stack 16 .export real_stack
@@ -20,7 +22,7 @@ real32_stack:
20real64_stack: 22real64_stack:
21 .block 8192 23 .block 8192
22 24
23#ifdef __LP64__ 25#ifdef CONFIG_64BIT
24# define REG_SZ 8 26# define REG_SZ 8
25#else 27#else
26# define REG_SZ 4 28# define REG_SZ 4
@@ -50,7 +52,7 @@ save_cr_end:
50 52
51real32_call_asm: 53real32_call_asm:
52 STREG %rp, -RP_OFFSET(%sp) /* save RP */ 54 STREG %rp, -RP_OFFSET(%sp) /* save RP */
53#ifdef __LP64__ 55#ifdef CONFIG_64BIT
54 callee_save 56 callee_save
55 ldo 2*REG_SZ(%sp), %sp /* room for a couple more saves */ 57 ldo 2*REG_SZ(%sp), %sp /* room for a couple more saves */
56 STREG %r27, -1*REG_SZ(%sp) 58 STREG %r27, -1*REG_SZ(%sp)
@@ -77,7 +79,7 @@ real32_call_asm:
77 b,l save_control_regs,%r2 /* modifies r1, r2, r28 */ 79 b,l save_control_regs,%r2 /* modifies r1, r2, r28 */
78 nop 80 nop
79 81
80#ifdef __LP64__ 82#ifdef CONFIG_64BIT
81 rsm PSW_SM_W, %r0 /* go narrow */ 83 rsm PSW_SM_W, %r0 /* go narrow */
82#endif 84#endif
83 85
@@ -85,7 +87,7 @@ real32_call_asm:
85 bv 0(%r31) 87 bv 0(%r31)
86 nop 88 nop
87ric_ret: 89ric_ret:
88#ifdef __LP64__ 90#ifdef CONFIG_64BIT
89 ssm PSW_SM_W, %r0 /* go wide */ 91 ssm PSW_SM_W, %r0 /* go wide */
90#endif 92#endif
91 /* restore CRs before going virtual in case we page fault */ 93 /* restore CRs before going virtual in case we page fault */
@@ -97,7 +99,7 @@ ric_ret:
97 99
98 tovirt_r1 %sp 100 tovirt_r1 %sp
99 LDREG -REG_SZ(%sp), %sp /* restore SP */ 101 LDREG -REG_SZ(%sp), %sp /* restore SP */
100#ifdef __LP64__ 102#ifdef CONFIG_64BIT
101 LDREG -1*REG_SZ(%sp), %r27 103 LDREG -1*REG_SZ(%sp), %r27
102 LDREG -2*REG_SZ(%sp), %r29 104 LDREG -2*REG_SZ(%sp), %r29
103 ldo -2*REG_SZ(%sp), %sp 105 ldo -2*REG_SZ(%sp), %sp
@@ -143,24 +145,21 @@ restore_control_regs:
143/* rfi_virt2real() and rfi_real2virt() could perhaps be adapted for 145/* rfi_virt2real() and rfi_real2virt() could perhaps be adapted for
144 * more general-purpose use by the several places which need RFIs 146 * more general-purpose use by the several places which need RFIs
145 */ 147 */
146 .align 128
147 .text 148 .text
149 .align 128
148rfi_virt2real: 150rfi_virt2real:
149 /* switch to real mode... */ 151 /* switch to real mode... */
150 ssm 0,0 /* See "relied upon translation" */ 152 rsm PSW_SM_I,%r0
151 nop /* PA 2.0 Arch. F-5 */ 153 load32 PA(rfi_v2r_1), %r1
152 nop
153 nop
154 nop 154 nop
155 nop 155 nop
156 nop 156 nop
157 nop 157 nop
158 nop 158 nop
159 159
160 rsm (PSW_SM_Q|PSW_SM_I),%r0 /* disable Q & I bits to load iia queue */ 160 rsm PSW_SM_Q,%r0 /* disable Q & I bits to load iia queue */
161 mtctl %r0, %cr17 /* Clear IIASQ tail */ 161 mtctl %r0, %cr17 /* Clear IIASQ tail */
162 mtctl %r0, %cr17 /* Clear IIASQ head */ 162 mtctl %r0, %cr17 /* Clear IIASQ head */
163 load32 PA(rfi_v2r_1), %r1
164 mtctl %r1, %cr18 /* IIAOQ head */ 163 mtctl %r1, %cr18 /* IIAOQ head */
165 ldo 4(%r1), %r1 164 ldo 4(%r1), %r1
166 mtctl %r1, %cr18 /* IIAOQ tail */ 165 mtctl %r1, %cr18 /* IIAOQ tail */
@@ -184,10 +183,8 @@ rfi_v2r_1:
184 .text 183 .text
185 .align 128 184 .align 128
186rfi_real2virt: 185rfi_real2virt:
187 ssm 0,0 /* See "relied upon translation" */ 186 rsm PSW_SM_I,%r0
188 nop /* PA 2.0 Arch. F-5 */ 187 load32 (rfi_r2v_1), %r1
189 nop
190 nop
191 nop 188 nop
192 nop 189 nop
193 nop 190 nop
@@ -197,7 +194,6 @@ rfi_real2virt:
197 rsm PSW_SM_Q,%r0 /* disable Q bit to load iia queue */ 194 rsm PSW_SM_Q,%r0 /* disable Q bit to load iia queue */
198 mtctl %r0, %cr17 /* Clear IIASQ tail */ 195 mtctl %r0, %cr17 /* Clear IIASQ tail */
199 mtctl %r0, %cr17 /* Clear IIASQ head */ 196 mtctl %r0, %cr17 /* Clear IIASQ head */
200 load32 (rfi_r2v_1), %r1
201 mtctl %r1, %cr18 /* IIAOQ head */ 197 mtctl %r1, %cr18 /* IIAOQ head */
202 ldo 4(%r1), %r1 198 ldo 4(%r1), %r1
203 mtctl %r1, %cr18 /* IIAOQ tail */ 199 mtctl %r1, %cr18 /* IIAOQ tail */
@@ -218,7 +214,7 @@ rfi_r2v_1:
218 bv 0(%r2) 214 bv 0(%r2)
219 nop 215 nop
220 216
221#ifdef __LP64__ 217#ifdef CONFIG_64BIT
222 218
223/************************ 64-bit real-mode calls ***********************/ 219/************************ 64-bit real-mode calls ***********************/
224/* This is only usable in wide kernels right now and will probably stay so */ 220/* This is only usable in wide kernels right now and will probably stay so */
@@ -296,7 +292,7 @@ pc_in_user_space:
296 ** comparing function pointers. 292 ** comparing function pointers.
297 */ 293 */
298__canonicalize_funcptr_for_compare: 294__canonicalize_funcptr_for_compare:
299#ifdef __LP64__ 295#ifdef CONFIG_64BIT
300 bve (%r2) 296 bve (%r2)
301#else 297#else
302 bv %r0(%r2) 298 bv %r0(%r2)
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 0224651fd8f1..82c24e62ab63 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -490,15 +490,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
490 490
491give_sigsegv: 491give_sigsegv:
492 DBG(1,"setup_rt_frame: sending SIGSEGV\n"); 492 DBG(1,"setup_rt_frame: sending SIGSEGV\n");
493 if (sig == SIGSEGV) 493 force_sigsegv(sig, current);
494 ka->sa.sa_handler = SIG_DFL;
495 si.si_signo = SIGSEGV;
496 si.si_errno = 0;
497 si.si_code = SI_KERNEL;
498 si.si_pid = current->pid;
499 si.si_uid = current->uid;
500 si.si_addr = frame;
501 force_sig_info(SIGSEGV, &si, current);
502 return 0; 494 return 0;
503} 495}
504 496
@@ -633,10 +625,14 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
633 put_user(0xe0008200, &usp[3]); 625 put_user(0xe0008200, &usp[3]);
634 put_user(0x34140000, &usp[4]); 626 put_user(0x34140000, &usp[4]);
635 627
636 /* Stack is 64-byte aligned, and we only 628 /* Stack is 64-byte aligned, and we only need
637 * need to flush 1 cache line */ 629 * to flush 1 cache line.
638 asm("fdc 0(%%sr3, %0)\n" 630 * Flushing one cacheline is cheap.
639 "fic 0(%%sr3, %0)\n" 631 * "sync" on bigger (> 4 way) boxes is not.
632 */
633 asm("fdc %%r0(%%sr3, %0)\n"
634 "sync\n"
635 "fic %%r0(%%sr3, %0)\n"
640 "sync\n" 636 "sync\n"
641 : : "r"(regs->gr[30])); 637 : : "r"(regs->gr[30]));
642 638
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index bcc7e83f5142..5db3be4e2704 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -18,7 +18,7 @@
18*/ 18*/
19#undef ENTRY_SYS_CPUS /* syscall support for iCOD-like functionality */ 19#undef ENTRY_SYS_CPUS /* syscall support for iCOD-like functionality */
20 20
21#include <linux/autoconf.h> 21#include <linux/config.h>
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 8c7a7185cd3b..b29b76b42bb7 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -6,6 +6,7 @@
6 * thanks to Philipp Rumpf, Mike Shaver and various others 6 * thanks to Philipp Rumpf, Mike Shaver and various others
7 * sorry about the wall, puffin.. 7 * sorry about the wall, puffin..
8 */ 8 */
9#include <linux/config.h> /* for CONFIG_SMP */
9 10
10#include <asm/asm-offsets.h> 11#include <asm/asm-offsets.h>
11#include <asm/unistd.h> 12#include <asm/unistd.h>
@@ -22,15 +23,13 @@
22 */ 23 */
23#define KILL_INSN break 0,0 24#define KILL_INSN break 0,0
24 25
25#include <linux/config.h> /* for CONFIG_SMP */ 26#ifdef CONFIG_64BIT
26
27#ifdef __LP64__
28 .level 2.0w 27 .level 2.0w
29#else 28#else
30 .level 1.1 29 .level 1.1
31#endif 30#endif
32 31
33#ifndef __LP64__ 32#ifndef CONFIG_64BIT
34 .macro fixup_branch,lbl 33 .macro fixup_branch,lbl
35 b \lbl 34 b \lbl
36 .endm 35 .endm
@@ -103,7 +102,7 @@ linux_gateway_entry:
103 mfsp %sr7,%r1 /* save user sr7 */ 102 mfsp %sr7,%r1 /* save user sr7 */
104 mtsp %r1,%sr3 /* and store it in sr3 */ 103 mtsp %r1,%sr3 /* and store it in sr3 */
105 104
106#ifdef __LP64__ 105#ifdef CONFIG_64BIT
107 /* for now we can *always* set the W bit on entry to the syscall 106 /* for now we can *always* set the W bit on entry to the syscall
108 * since we don't support wide userland processes. We could 107 * since we don't support wide userland processes. We could
109 * also save the current SM other than in r0 and restore it on 108 * also save the current SM other than in r0 and restore it on
@@ -155,7 +154,7 @@ linux_gateway_entry:
155 STREG %r19, TASK_PT_GR19(%r1) 154 STREG %r19, TASK_PT_GR19(%r1)
156 155
157 LDREGM -FRAME_SIZE(%r30), %r2 /* get users sp back */ 156 LDREGM -FRAME_SIZE(%r30), %r2 /* get users sp back */
158#ifdef __LP64__ 157#ifdef CONFIG_64BIT
159 extrd,u %r2,63,1,%r19 /* W hidden in bottom bit */ 158 extrd,u %r2,63,1,%r19 /* W hidden in bottom bit */
160#if 0 159#if 0
161 xor %r19,%r2,%r2 /* clear bottom bit */ 160 xor %r19,%r2,%r2 /* clear bottom bit */
@@ -186,7 +185,7 @@ linux_gateway_entry:
186 185
187 loadgp 186 loadgp
188 187
189#ifdef __LP64__ 188#ifdef CONFIG_64BIT
190 ldo -16(%r30),%r29 /* Reference param save area */ 189 ldo -16(%r30),%r29 /* Reference param save area */
191 copy %r19,%r2 /* W bit back to r2 */ 190 copy %r19,%r2 /* W bit back to r2 */
192#else 191#else
@@ -205,7 +204,7 @@ linux_gateway_entry:
205 /* Note! We cannot use the syscall table that is mapped 204 /* Note! We cannot use the syscall table that is mapped
206 nearby since the gateway page is mapped execute-only. */ 205 nearby since the gateway page is mapped execute-only. */
207 206
208#ifdef __LP64__ 207#ifdef CONFIG_64BIT
209 ldil L%sys_call_table, %r1 208 ldil L%sys_call_table, %r1
210 or,= %r2,%r2,%r2 209 or,= %r2,%r2,%r2
211 addil L%(sys_call_table64-sys_call_table), %r1 210 addil L%(sys_call_table64-sys_call_table), %r1
@@ -321,7 +320,7 @@ tracesys_next:
321 LDREG TASK_PT_GR25(%r1), %r25 320 LDREG TASK_PT_GR25(%r1), %r25
322 LDREG TASK_PT_GR24(%r1), %r24 321 LDREG TASK_PT_GR24(%r1), %r24
323 LDREG TASK_PT_GR23(%r1), %r23 322 LDREG TASK_PT_GR23(%r1), %r23
324#ifdef __LP64__ 323#ifdef CONFIG_64BIT
325 LDREG TASK_PT_GR22(%r1), %r22 324 LDREG TASK_PT_GR22(%r1), %r22
326 LDREG TASK_PT_GR21(%r1), %r21 325 LDREG TASK_PT_GR21(%r1), %r21
327 ldo -16(%r30),%r29 /* Reference param save area */ 326 ldo -16(%r30),%r29 /* Reference param save area */
@@ -350,7 +349,7 @@ tracesys_next:
350tracesys_exit: 349tracesys_exit:
351 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ 350 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
352 LDREG TI_TASK(%r1), %r1 351 LDREG TI_TASK(%r1), %r1
353#ifdef __LP64__ 352#ifdef CONFIG_64BIT
354 ldo -16(%r30),%r29 /* Reference param save area */ 353 ldo -16(%r30),%r29 /* Reference param save area */
355#endif 354#endif
356 bl syscall_trace, %r2 355 bl syscall_trace, %r2
@@ -371,7 +370,7 @@ tracesys_exit:
371tracesys_sigexit: 370tracesys_sigexit:
372 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ 371 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
373 LDREG 0(%r1), %r1 372 LDREG 0(%r1), %r1
374#ifdef __LP64__ 373#ifdef CONFIG_64BIT
375 ldo -16(%r30),%r29 /* Reference param save area */ 374 ldo -16(%r30),%r29 /* Reference param save area */
376#endif 375#endif
377 bl syscall_trace, %r2 376 bl syscall_trace, %r2
@@ -404,7 +403,7 @@ lws_start:
404 gate .+8, %r0 403 gate .+8, %r0
405 depi 3, 31, 2, %r31 /* Ensure we return to userspace */ 404 depi 3, 31, 2, %r31 /* Ensure we return to userspace */
406 405
407#ifdef __LP64__ 406#ifdef CONFIG_64BIT
408 /* FIXME: If we are a 64-bit kernel just 407 /* FIXME: If we are a 64-bit kernel just
409 * turn this on unconditionally. 408 * turn this on unconditionally.
410 */ 409 */
@@ -440,7 +439,7 @@ lws_exit_nosys:
440 /* Fall through: Return to userspace */ 439 /* Fall through: Return to userspace */
441 440
442lws_exit: 441lws_exit:
443#ifdef __LP64__ 442#ifdef CONFIG_64BIT
444 /* decide whether to reset the wide mode bit 443 /* decide whether to reset the wide mode bit
445 * 444 *
446 * For a syscall, the W bit is stored in the lowest bit 445 * For a syscall, the W bit is stored in the lowest bit
@@ -486,7 +485,7 @@ lws_exit:
486 485
487 /* ELF64 Process entry path */ 486 /* ELF64 Process entry path */
488lws_compare_and_swap64: 487lws_compare_and_swap64:
489#ifdef __LP64__ 488#ifdef CONFIG_64BIT
490 b,n lws_compare_and_swap 489 b,n lws_compare_and_swap
491#else 490#else
492 /* If we are not a 64-bit kernel, then we don't 491 /* If we are not a 64-bit kernel, then we don't
@@ -497,7 +496,7 @@ lws_compare_and_swap64:
497 496
498 /* ELF32 Process entry path */ 497 /* ELF32 Process entry path */
499lws_compare_and_swap32: 498lws_compare_and_swap32:
500#ifdef __LP64__ 499#ifdef CONFIG_64BIT
501 /* Clip all the input registers */ 500 /* Clip all the input registers */
502 depdi 0, 31, 32, %r26 501 depdi 0, 31, 32, %r26
503 depdi 0, 31, 32, %r25 502 depdi 0, 31, 32, %r25
@@ -608,7 +607,7 @@ cas_action:
608 the other for the store. Either return -EFAULT. 607 the other for the store. Either return -EFAULT.
609 Each of the entries must be relocated. */ 608 Each of the entries must be relocated. */
610 .section __ex_table,"aw" 609 .section __ex_table,"aw"
611#ifdef __LP64__ 610#ifdef CONFIG_64BIT
612 /* Pad the address calculation */ 611 /* Pad the address calculation */
613 .word 0,(2b - linux_gateway_page) 612 .word 0,(2b - linux_gateway_page)
614 .word 0,(3b - linux_gateway_page) 613 .word 0,(3b - linux_gateway_page)
@@ -619,7 +618,7 @@ cas_action:
619 .previous 618 .previous
620 619
621 .section __ex_table,"aw" 620 .section __ex_table,"aw"
622#ifdef __LP64__ 621#ifdef CONFIG_64BIT
623 /* Pad the address calculation */ 622 /* Pad the address calculation */
624 .word 0,(1b - linux_gateway_page) 623 .word 0,(1b - linux_gateway_page)
625 .word 0,(3b - linux_gateway_page) 624 .word 0,(3b - linux_gateway_page)
@@ -638,7 +637,7 @@ end_linux_gateway_page:
638 637
639 /* Relocate symbols assuming linux_gateway_page is mapped 638 /* Relocate symbols assuming linux_gateway_page is mapped
640 to virtual address 0x0 */ 639 to virtual address 0x0 */
641#ifdef __LP64__ 640#ifdef CONFIG_64BIT
642 /* FIXME: The code will always be on the gateay page 641 /* FIXME: The code will always be on the gateay page
643 and thus it will be on the first 4k, the 642 and thus it will be on the first 4k, the
644 assembler seems to think that the final 643 assembler seems to think that the final
@@ -666,7 +665,7 @@ lws_table:
666sys_call_table: 665sys_call_table:
667#include "syscall_table.S" 666#include "syscall_table.S"
668 667
669#ifdef __LP64__ 668#ifdef CONFIG_64BIT
670 .align 4096 669 .align 4096
671 .export sys_call_table64 670 .export sys_call_table64
672.Lsys_call_table64: 671.Lsys_call_table64:
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index dcfa4d3d0e7d..32cbc0489324 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -35,7 +35,7 @@
35#undef ENTRY_UHOH 35#undef ENTRY_UHOH
36#undef ENTRY_COMP 36#undef ENTRY_COMP
37#undef ENTRY_OURS 37#undef ENTRY_OURS
38#if defined(__LP64__) && !defined(SYSCALL_TABLE_64BIT) 38#if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT)
39/* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and 39/* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and
40 * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific 40 * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific
41 * implementation is required on wide palinux. Use ENTRY_COMP where 41 * implementation is required on wide palinux. Use ENTRY_COMP where
@@ -46,7 +46,7 @@
46#define ENTRY_UHOH(_name_) .dword sys32_##unimplemented 46#define ENTRY_UHOH(_name_) .dword sys32_##unimplemented
47#define ENTRY_OURS(_name_) .dword parisc_##_name_ 47#define ENTRY_OURS(_name_) .dword parisc_##_name_
48#define ENTRY_COMP(_name_) .dword compat_sys_##_name_ 48#define ENTRY_COMP(_name_) .dword compat_sys_##_name_
49#elif defined(__LP64__) && defined(SYSCALL_TABLE_64BIT) 49#elif defined(CONFIG_64BIT) && defined(SYSCALL_TABLE_64BIT)
50#define ENTRY_SAME(_name_) .dword sys_##_name_ 50#define ENTRY_SAME(_name_) .dword sys_##_name_
51#define ENTRY_DIFF(_name_) .dword sys_##_name_ 51#define ENTRY_DIFF(_name_) .dword sys_##_name_
52#define ENTRY_UHOH(_name_) .dword sys_##_name_ 52#define ENTRY_UHOH(_name_) .dword sys_##_name_
@@ -368,5 +368,11 @@
368 ENTRY_COMP(mbind) /* 260 */ 368 ENTRY_COMP(mbind) /* 260 */
369 ENTRY_COMP(get_mempolicy) 369 ENTRY_COMP(get_mempolicy)
370 ENTRY_COMP(set_mempolicy) 370 ENTRY_COMP(set_mempolicy)
371 ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */
372 ENTRY_SAME(add_key)
373 ENTRY_SAME(request_key) /* 265 */
374 ENTRY_SAME(keyctl)
375 ENTRY_SAME(ioprio_set)
376 ENTRY_SAME(ioprio_get)
371 /* Nothing yet */ 377 /* Nothing yet */
372 378
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 7ff67f8e9f8c..bc979e1abdec 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -89,14 +89,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
89 } 89 }
90 } 90 }
91 91
92#ifdef CONFIG_CHASSIS_LCD_LED
93 /* Only schedule the led tasklet on cpu 0, and only if it
94 * is enabled.
95 */
96 if (cpu == 0 && !atomic_read(&led_tasklet.count))
97 tasklet_schedule(&led_tasklet);
98#endif
99
100 /* check soft power switch status */ 92 /* check soft power switch status */
101 if (cpu == 0 && !atomic_read(&power_tasklet.count)) 93 if (cpu == 0 && !atomic_read(&power_tasklet.count))
102 tasklet_schedule(&power_tasklet); 94 tasklet_schedule(&power_tasklet);
@@ -104,6 +96,24 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
104 return IRQ_HANDLED; 96 return IRQ_HANDLED;
105} 97}
106 98
99
100unsigned long profile_pc(struct pt_regs *regs)
101{
102 unsigned long pc = instruction_pointer(regs);
103
104 if (regs->gr[0] & PSW_N)
105 pc -= 4;
106
107#ifdef CONFIG_SMP
108 if (in_lock_functions(pc))
109 pc = regs->gr[2];
110#endif
111
112 return pc;
113}
114EXPORT_SYMBOL(profile_pc);
115
116
107/*** converted from ia64 ***/ 117/*** converted from ia64 ***/
108/* 118/*
109 * Return the number of micro-seconds that elapsed since the last 119 * Return the number of micro-seconds that elapsed since the last
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index d2e5b229a2f4..15914f0235a0 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -74,7 +74,10 @@ void show_regs(struct pt_regs *regs)
74 char *level; 74 char *level;
75 unsigned long cr30; 75 unsigned long cr30;
76 unsigned long cr31; 76 unsigned long cr31;
77 77 /* carlos says that gcc understands better memory in a struct,
78 * and it makes our life easier with fpregs -- T-Bone */
79 struct { u32 sw[2]; } s;
80
78 level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT; 81 level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT;
79 82
80 printk("%s\n", level); /* don't want to have that pretty register dump messed up */ 83 printk("%s\n", level); /* don't want to have that pretty register dump messed up */
@@ -103,11 +106,33 @@ void show_regs(struct pt_regs *regs)
103 printk("%s\n", buf); 106 printk("%s\n", buf);
104 } 107 }
105 108
106#if RIDICULOUSLY_VERBOSE 109 /* FR are 64bit everywhere. Need to use asm to get the content
107 for (i = 0; i < 32; i += 2) 110 * of fpsr/fper1, and we assume that we won't have a FP Identify
108 printk("%sFR%02d : %016lx FR%2d : %016lx", level, i, 111 * in our way, otherwise we're screwed.
109 regs->fr[i], i+1, regs->fr[i+1]); 112 * The fldd is used to restore the T-bit if there was one, as the
110#endif 113 * store clears it anyway.
114 * BTW, PA2.0 book says "thou shall not use fstw on FPSR/FPERs". */
115 __asm__ (
116 "fstd %%fr0,0(%1) \n\t"
117 "fldd 0(%1),%%fr0 \n\t"
118 : "=m" (s) : "r" (&s) : "%r0"
119 );
120
121 printk("%s\n", level);
122 printk("%s VZOUICununcqcqcqcqcqcrmunTDVZOUI\n", level);
123 printbinary(buf, s.sw[0], 32);
124 printk("%sFPSR: %s\n", level, buf);
125 printk("%sFPER1: %08x\n", level, s.sw[1]);
126
127 /* here we'll print fr0 again, tho it'll be meaningless */
128 for (i = 0; i < 32; i += 4) {
129 int j;
130 p = buf;
131 p += sprintf(p, "%sfr%02d-%02d ", level, i, i + 3);
132 for (j = 0; j < 4; j++)
133 p += sprintf(p, " %016llx", (i+j) == 0 ? 0 : regs->fr[i+j]);
134 printk("%s\n", buf);
135 }
111 136
112 cr30 = mfctl(30); 137 cr30 = mfctl(30);
113 cr31 = mfctl(31); 138 cr31 = mfctl(31);
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
index 62eea35bcd69..eaae8a021f9f 100644
--- a/arch/parisc/kernel/unaligned.c
+++ b/arch/parisc/kernel/unaligned.c
@@ -513,15 +513,18 @@ void handle_unaligned(struct pt_regs *regs)
513 register int flop=0; /* true if this is a flop */ 513 register int flop=0; /* true if this is a flop */
514 514
515 /* log a message with pacing */ 515 /* log a message with pacing */
516 if (user_mode(regs)) 516 if (user_mode(regs)) {
517 { 517 if (current->thread.flags & PARISC_UAC_SIGBUS) {
518 if (unaligned_count > 5 && jiffies - last_time > 5*HZ) 518 goto force_sigbus;
519 { 519 }
520
521 if (unaligned_count > 5 && jiffies - last_time > 5*HZ) {
520 unaligned_count = 0; 522 unaligned_count = 0;
521 last_time = jiffies; 523 last_time = jiffies;
522 } 524 }
523 if (++unaligned_count < 5) 525
524 { 526 if (!(current->thread.flags & PARISC_UAC_NOPRINT)
527 && ++unaligned_count < 5) {
525 char buf[256]; 528 char buf[256];
526 sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n", 529 sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n",
527 current->comm, current->pid, regs->ior, regs->iaoq[0]); 530 current->comm, current->pid, regs->ior, regs->iaoq[0]);
@@ -530,6 +533,7 @@ void handle_unaligned(struct pt_regs *regs)
530 show_regs(regs); 533 show_regs(regs);
531#endif 534#endif
532 } 535 }
536
533 if (!unaligned_enabled) 537 if (!unaligned_enabled)
534 goto force_sigbus; 538 goto force_sigbus;
535 } 539 }