aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 21:17:47 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 21:17:47 -0500
commit89a2fa5f2139be35e214bcf86a8291d6a1da75f2 (patch)
tree850ea412b013360bcace751db91cac6fb0067535
parent27266a18dc56611e2f2ec4e8aced0fe221e9b4b8 (diff)
parent68ee3eb8295c9c164071fcbd367c419121bd55f8 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
-rw-r--r--arch/parisc/Kconfig20
-rw-r--r--arch/parisc/Kconfig.debug10
-rw-r--r--arch/parisc/configs/b180_defconfig182
-rw-r--r--arch/parisc/hpux/entry_hpux.S3
-rw-r--r--arch/parisc/kernel/drivers.c3
-rw-r--r--arch/parisc/kernel/parisc_ksyms.c3
-rw-r--r--arch/parisc/kernel/pci.c13
-rw-r--r--arch/parisc/kernel/perf.c38
-rw-r--r--arch/parisc/kernel/perf_images.h4
-rw-r--r--arch/parisc/kernel/process.c35
-rw-r--r--arch/parisc/kernel/ptrace.c8
-rw-r--r--arch/parisc/kernel/signal.c2
-rw-r--r--arch/parisc/kernel/signal32.c102
-rw-r--r--arch/parisc/kernel/signal32.h127
-rw-r--r--arch/parisc/kernel/syscall.S2
-rw-r--r--arch/parisc/kernel/syscall_table.S19
-rw-r--r--arch/parisc/kernel/traps.c3
-rw-r--r--arch/parisc/math-emu/decode_exc.c1
-rw-r--r--arch/parisc/mm/init.c35
-rw-r--r--drivers/parisc/ccio-dma.c7
-rw-r--r--drivers/parisc/dino.c4
-rw-r--r--drivers/parisc/hppb.c3
-rw-r--r--drivers/parisc/iosapic.c8
-rw-r--r--drivers/parisc/lasi.c5
-rw-r--r--drivers/parisc/lba_pci.c6
-rw-r--r--drivers/parisc/pdc_stable.c356
-rw-r--r--drivers/parisc/sba_iommu.c3
-rw-r--r--drivers/parisc/superio.c41
-rw-r--r--drivers/parisc/wax.c2
-rw-r--r--drivers/parport/parport_gsc.c2
-rw-r--r--drivers/video/console/sticore.c45
-rw-r--r--include/asm-parisc/atomic.h84
-rw-r--r--include/asm-parisc/cacheflush.h6
-rw-r--r--include/asm-parisc/compat_ucontext.h3
-rw-r--r--include/asm-parisc/grfioctl.h2
-rw-r--r--include/asm-parisc/pci.h17
-rw-r--r--include/asm-parisc/pgalloc.h1
-rw-r--r--include/asm-parisc/pgtable.h2
-rw-r--r--include/asm-parisc/rt_sigframe.h4
-rw-r--r--include/asm-parisc/unistd.h21
40 files changed, 904 insertions, 328 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index e77a06e9621e..7c914a4c67c3 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -149,14 +149,20 @@ config HOTPLUG_CPU
149 default y if SMP 149 default y if SMP
150 select HOTPLUG 150 select HOTPLUG
151 151
152config ARCH_SELECT_MEMORY_MODEL
153 def_bool y
154 depends on 64BIT
155
152config ARCH_DISCONTIGMEM_ENABLE 156config ARCH_DISCONTIGMEM_ENABLE
153 bool "Discontiguous memory support (EXPERIMENTAL)" 157 def_bool y
154 depends on 64BIT && EXPERIMENTAL 158 depends on 64BIT
155 help 159
156 Say Y to support efficient handling of discontiguous physical memory, 160config ARCH_FLATMEM_ENABLE
157 for architectures which are either NUMA (Non-Uniform Memory Access) 161 def_bool y
158 or have huge holes in the physical address space for other reasons. 162
159 See <file:Documentation/vm/numa> for more. 163config ARCH_DISCONTIGMEM_DEFAULT
164 def_bool y
165 depends on ARCH_DISCONTIGMEM_ENABLE
160 166
161source "kernel/Kconfig.hz" 167source "kernel/Kconfig.hz"
162source "mm/Kconfig" 168source "mm/Kconfig"
diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug
index 8caaed187a1f..9166bd117267 100644
--- a/arch/parisc/Kconfig.debug
+++ b/arch/parisc/Kconfig.debug
@@ -11,4 +11,14 @@ config DEBUG_RWLOCK
11 too many attempts. If you suspect a rwlock problem or a kernel 11 too many attempts. If you suspect a rwlock problem or a kernel
12 hacker asks for this option then say Y. Otherwise say N. 12 hacker asks for this option then say Y. Otherwise say N.
13 13
14config DEBUG_RODATA
15 bool "Write protect kernel read-only data structures"
16 depends on DEBUG_KERNEL
17 help
18 Mark the kernel read-only data as write-protected in the pagetables,
19 in order to catch accidental (and incorrect) writes to such const
20 data. This option may have a slight performance impact because a
21 portion of the kernel code won't be covered by a TLB anymore.
22 If in doubt, say "N".
23
14endmenu 24endmenu
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index 8819e7e6ae3f..37e98241ce4b 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc5-pa1 3# Linux kernel version: 2.6.16-rc1-pa0
4# Fri Oct 21 23:06:10 2005 4# Tue Jan 17 08:21:01 2006
5# 5#
6CONFIG_PARISC=y 6CONFIG_PARISC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -29,8 +29,6 @@ CONFIG_SYSVIPC=y
29# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 32CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y 33CONFIG_IKCONFIG_PROC=y
36CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
@@ -38,8 +36,10 @@ CONFIG_INITRAMFS_SOURCE=""
38CONFIG_KALLSYMS=y 36CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_ALL is not set 37# CONFIG_KALLSYMS_ALL is not set
40# CONFIG_KALLSYMS_EXTRA_PASS is not set 38# CONFIG_KALLSYMS_EXTRA_PASS is not set
39CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y 40CONFIG_PRINTK=y
42CONFIG_BUG=y 41CONFIG_BUG=y
42CONFIG_ELF_CORE=y
43CONFIG_BASE_FULL=y 43CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y 44CONFIG_FUTEX=y
45CONFIG_EPOLL=y 45CONFIG_EPOLL=y
@@ -48,8 +48,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0 48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0 49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0 50CONFIG_CC_ALIGN_JUMPS=0
51CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 53CONFIG_BASE_SMALL=0
54# CONFIG_SLOB is not set
53 55
54# 56#
55# Loadable module support 57# Loadable module support
@@ -57,10 +59,28 @@ CONFIG_BASE_SMALL=0
57CONFIG_MODULES=y 59CONFIG_MODULES=y
58# CONFIG_MODULE_UNLOAD is not set 60# CONFIG_MODULE_UNLOAD is not set
59CONFIG_OBSOLETE_MODPARM=y 61CONFIG_OBSOLETE_MODPARM=y
62CONFIG_MODVERSIONS=y
60# CONFIG_MODULE_SRCVERSION_ALL is not set 63# CONFIG_MODULE_SRCVERSION_ALL is not set
61# CONFIG_KMOD is not set 64# CONFIG_KMOD is not set
62 65
63# 66#
67# Block layer
68#
69
70#
71# IO Schedulers
72#
73CONFIG_IOSCHED_NOOP=y
74CONFIG_IOSCHED_AS=y
75CONFIG_IOSCHED_DEADLINE=y
76CONFIG_IOSCHED_CFQ=y
77# CONFIG_DEFAULT_AS is not set
78# CONFIG_DEFAULT_DEADLINE is not set
79CONFIG_DEFAULT_CFQ=y
80# CONFIG_DEFAULT_NOOP is not set
81CONFIG_DEFAULT_IOSCHED="cfq"
82
83#
64# Processor type and features 84# Processor type and features
65# 85#
66# CONFIG_PA7000 is not set 86# CONFIG_PA7000 is not set
@@ -77,6 +97,7 @@ CONFIG_HZ=250
77CONFIG_FLATMEM=y 97CONFIG_FLATMEM=y
78CONFIG_FLAT_NODE_MEM_MAP=y 98CONFIG_FLAT_NODE_MEM_MAP=y
79# CONFIG_SPARSEMEM_STATIC is not set 99# CONFIG_SPARSEMEM_STATIC is not set
100CONFIG_SPLIT_PTLOCK_CPUS=4096
80# CONFIG_PREEMPT is not set 101# CONFIG_PREEMPT is not set
81# CONFIG_HPUX is not set 102# CONFIG_HPUX is not set
82 103
@@ -84,8 +105,8 @@ CONFIG_FLAT_NODE_MEM_MAP=y
84# Bus options (PCI, PCMCIA, EISA, GSC, ISA) 105# Bus options (PCI, PCMCIA, EISA, GSC, ISA)
85# 106#
86CONFIG_GSC=y 107CONFIG_GSC=y
87# CONFIG_HPPB is not set 108CONFIG_HPPB=y
88# CONFIG_IOMMU_CCIO is not set 109CONFIG_IOMMU_CCIO=y
89CONFIG_GSC_LASI=y 110CONFIG_GSC_LASI=y
90CONFIG_GSC_WAX=y 111CONFIG_GSC_WAX=y
91CONFIG_EISA=y 112CONFIG_EISA=y
@@ -165,8 +186,11 @@ CONFIG_IPV6=y
165# CONFIG_LLC2 is not set 186# CONFIG_LLC2 is not set
166# CONFIG_IPX is not set 187# CONFIG_IPX is not set
167# CONFIG_ATALK is not set 188# CONFIG_ATALK is not set
189
190#
191# QoS and/or fair queueing
192#
168# CONFIG_NET_SCHED is not set 193# CONFIG_NET_SCHED is not set
169# CONFIG_NET_CLS_ROUTE is not set
170 194
171# 195#
172# Network testing 196# Network testing
@@ -205,6 +229,7 @@ CONFIG_STANDALONE=y
205CONFIG_PARPORT=y 229CONFIG_PARPORT=y
206CONFIG_PARPORT_PC=y 230CONFIG_PARPORT_PC=y
207# CONFIG_PARPORT_SERIAL is not set 231# CONFIG_PARPORT_SERIAL is not set
232CONFIG_PARPORT_NOT_PC=y
208CONFIG_PARPORT_GSC=y 233CONFIG_PARPORT_GSC=y
209# CONFIG_PARPORT_1284 is not set 234# CONFIG_PARPORT_1284 is not set
210 235
@@ -230,14 +255,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16
230CONFIG_CDROM_PKTCDVD=m 255CONFIG_CDROM_PKTCDVD=m
231CONFIG_CDROM_PKTCDVD_BUFFERS=8 256CONFIG_CDROM_PKTCDVD_BUFFERS=8
232# CONFIG_CDROM_PKTCDVD_WCACHE is not set 257# CONFIG_CDROM_PKTCDVD_WCACHE is not set
233
234#
235# IO Schedulers
236#
237CONFIG_IOSCHED_NOOP=y
238CONFIG_IOSCHED_AS=y
239CONFIG_IOSCHED_DEADLINE=y
240CONFIG_IOSCHED_CFQ=y
241CONFIG_ATA_OVER_ETH=y 258CONFIG_ATA_OVER_ETH=y
242 259
243# 260#
@@ -281,6 +298,7 @@ CONFIG_SCSI_SPI_ATTRS=y
281# 298#
282# SCSI low-level drivers 299# SCSI low-level drivers
283# 300#
301# CONFIG_ISCSI_TCP is not set
284# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 302# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
285# CONFIG_SCSI_3W_9XXX is not set 303# CONFIG_SCSI_3W_9XXX is not set
286# CONFIG_SCSI_ACARD is not set 304# CONFIG_SCSI_ACARD is not set
@@ -313,21 +331,19 @@ CONFIG_SCSI_SYM53C8XX_2=y
313CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 331CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
314CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 332CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
315CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 333CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
316# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 334CONFIG_SCSI_SYM53C8XX_MMIO=y
317# CONFIG_SCSI_IPR is not set 335# CONFIG_SCSI_IPR is not set
318# CONFIG_SCSI_ZALON is not set 336CONFIG_SCSI_ZALON=y
337CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
338CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
339CONFIG_SCSI_NCR53C8XX_SYNC=40
340# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
319# CONFIG_SCSI_PAS16 is not set 341# CONFIG_SCSI_PAS16 is not set
320# CONFIG_SCSI_PSI240I is not set 342# CONFIG_SCSI_PSI240I is not set
321# CONFIG_SCSI_QLOGIC_FAS is not set 343# CONFIG_SCSI_QLOGIC_FAS is not set
322# CONFIG_SCSI_QLOGIC_FC is not set 344# CONFIG_SCSI_QLOGIC_FC is not set
323# CONFIG_SCSI_QLOGIC_1280 is not set 345# CONFIG_SCSI_QLOGIC_1280 is not set
324CONFIG_SCSI_QLA2XXX=y 346# CONFIG_SCSI_QLA_FC is not set
325# CONFIG_SCSI_QLA21XX is not set
326# CONFIG_SCSI_QLA22XX is not set
327# CONFIG_SCSI_QLA2300 is not set
328# CONFIG_SCSI_QLA2322 is not set
329# CONFIG_SCSI_QLA6312 is not set
330# CONFIG_SCSI_QLA24XX is not set
331# CONFIG_SCSI_LPFC is not set 347# CONFIG_SCSI_LPFC is not set
332# CONFIG_SCSI_SIM710 is not set 348# CONFIG_SCSI_SIM710 is not set
333# CONFIG_SCSI_SYM53C416 is not set 349# CONFIG_SCSI_SYM53C416 is not set
@@ -397,7 +413,7 @@ CONFIG_NETDEVICES=y
397# 413#
398CONFIG_NET_ETHERNET=y 414CONFIG_NET_ETHERNET=y
399# CONFIG_MII is not set 415# CONFIG_MII is not set
400# CONFIG_LASI_82596 is not set 416CONFIG_LASI_82596=y
401# CONFIG_HAPPYMEAL is not set 417# CONFIG_HAPPYMEAL is not set
402# CONFIG_SUNGEM is not set 418# CONFIG_SUNGEM is not set
403# CONFIG_CASSINI is not set 419# CONFIG_CASSINI is not set
@@ -464,6 +480,7 @@ CONFIG_NET_RADIO=y
464# Wireless 802.11b ISA/PCI cards support 480# Wireless 802.11b ISA/PCI cards support
465# 481#
466# CONFIG_HERMES is not set 482# CONFIG_HERMES is not set
483# CONFIG_ATMEL is not set
467 484
468# 485#
469# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support 486# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
@@ -527,7 +544,7 @@ CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y
527# CONFIG_KEYBOARD_XTKBD is not set 544# CONFIG_KEYBOARD_XTKBD is not set
528# CONFIG_KEYBOARD_NEWTON is not set 545# CONFIG_KEYBOARD_NEWTON is not set
529# CONFIG_KEYBOARD_HIL_OLD is not set 546# CONFIG_KEYBOARD_HIL_OLD is not set
530# CONFIG_KEYBOARD_HIL is not set 547CONFIG_KEYBOARD_HIL=y
531CONFIG_INPUT_MOUSE=y 548CONFIG_INPUT_MOUSE=y
532CONFIG_MOUSE_PS2=y 549CONFIG_MOUSE_PS2=y
533# CONFIG_MOUSE_SERIAL is not set 550# CONFIG_MOUSE_SERIAL is not set
@@ -535,7 +552,7 @@ CONFIG_MOUSE_PS2=y
535# CONFIG_MOUSE_LOGIBM is not set 552# CONFIG_MOUSE_LOGIBM is not set
536# CONFIG_MOUSE_PC110PAD is not set 553# CONFIG_MOUSE_PC110PAD is not set
537# CONFIG_MOUSE_VSXXXAA is not set 554# CONFIG_MOUSE_VSXXXAA is not set
538# CONFIG_MOUSE_HIL is not set 555CONFIG_MOUSE_HIL=y
539# CONFIG_INPUT_JOYSTICK is not set 556# CONFIG_INPUT_JOYSTICK is not set
540# CONFIG_INPUT_TOUCHSCREEN is not set 557# CONFIG_INPUT_TOUCHSCREEN is not set
541CONFIG_INPUT_MISC=y 558CONFIG_INPUT_MISC=y
@@ -549,7 +566,8 @@ CONFIG_SERIO=y
549# CONFIG_SERIO_SERPORT is not set 566# CONFIG_SERIO_SERPORT is not set
550# CONFIG_SERIO_PARKBD is not set 567# CONFIG_SERIO_PARKBD is not set
551CONFIG_SERIO_GSCPS2=y 568CONFIG_SERIO_GSCPS2=y
552# CONFIG_HP_SDC is not set 569CONFIG_HP_SDC=y
570CONFIG_HIL_MLC=y
553# CONFIG_SERIO_PCIPS2 is not set 571# CONFIG_SERIO_PCIPS2 is not set
554CONFIG_SERIO_LIBPS2=y 572CONFIG_SERIO_LIBPS2=y
555# CONFIG_SERIO_RAW is not set 573# CONFIG_SERIO_RAW is not set
@@ -569,6 +587,7 @@ CONFIG_HW_CONSOLE=y
569CONFIG_SERIAL_8250=y 587CONFIG_SERIAL_8250=y
570CONFIG_SERIAL_8250_CONSOLE=y 588CONFIG_SERIAL_8250_CONSOLE=y
571CONFIG_SERIAL_8250_NR_UARTS=13 589CONFIG_SERIAL_8250_NR_UARTS=13
590CONFIG_SERIAL_8250_RUNTIME_UARTS=4
572CONFIG_SERIAL_8250_EXTENDED=y 591CONFIG_SERIAL_8250_EXTENDED=y
573CONFIG_SERIAL_8250_MANY_PORTS=y 592CONFIG_SERIAL_8250_MANY_PORTS=y
574CONFIG_SERIAL_8250_SHARE_IRQ=y 593CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -582,11 +601,10 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
582# 601#
583# Non-8250 serial port support 602# Non-8250 serial port support
584# 603#
585# CONFIG_SERIAL_MUX is not set 604CONFIG_SERIAL_MUX=y
586# CONFIG_PDC_CONSOLE is not set 605CONFIG_SERIAL_MUX_CONSOLE=y
587CONFIG_SERIAL_CORE=y 606CONFIG_SERIAL_CORE=y
588CONFIG_SERIAL_CORE_CONSOLE=y 607CONFIG_SERIAL_CORE_CONSOLE=y
589# CONFIG_SERIAL_JSM is not set
590CONFIG_UNIX98_PTYS=y 608CONFIG_UNIX98_PTYS=y
591CONFIG_LEGACY_PTYS=y 609CONFIG_LEGACY_PTYS=y
592CONFIG_LEGACY_PTY_COUNT=256 610CONFIG_LEGACY_PTY_COUNT=256
@@ -626,6 +644,12 @@ CONFIG_GEN_RTC=y
626# CONFIG_I2C is not set 644# CONFIG_I2C is not set
627 645
628# 646#
647# SPI support
648#
649# CONFIG_SPI is not set
650# CONFIG_SPI_MASTER is not set
651
652#
629# Dallas's 1-wire bus 653# Dallas's 1-wire bus
630# 654#
631# CONFIG_W1 is not set 655# CONFIG_W1 is not set
@@ -661,7 +685,6 @@ CONFIG_FB=y
661CONFIG_FB_CFB_FILLRECT=y 685CONFIG_FB_CFB_FILLRECT=y
662CONFIG_FB_CFB_COPYAREA=y 686CONFIG_FB_CFB_COPYAREA=y
663CONFIG_FB_CFB_IMAGEBLIT=y 687CONFIG_FB_CFB_IMAGEBLIT=y
664CONFIG_FB_SOFT_CURSOR=y
665# CONFIG_FB_MACMODES is not set 688# CONFIG_FB_MACMODES is not set
666# CONFIG_FB_MODE_HELPERS is not set 689# CONFIG_FB_MODE_HELPERS is not set
667# CONFIG_FB_TILEBLITTING is not set 690# CONFIG_FB_TILEBLITTING is not set
@@ -671,6 +694,7 @@ CONFIG_FB_SOFT_CURSOR=y
671# CONFIG_FB_ASILIANT is not set 694# CONFIG_FB_ASILIANT is not set
672# CONFIG_FB_IMSTT is not set 695# CONFIG_FB_IMSTT is not set
673CONFIG_FB_STI=y 696CONFIG_FB_STI=y
697# CONFIG_FB_S1D13XXX is not set
674# CONFIG_FB_NVIDIA is not set 698# CONFIG_FB_NVIDIA is not set
675# CONFIG_FB_RIVA is not set 699# CONFIG_FB_RIVA is not set
676# CONFIG_FB_MATROX is not set 700# CONFIG_FB_MATROX is not set
@@ -683,9 +707,7 @@ CONFIG_FB_STI=y
683# CONFIG_FB_KYRO is not set 707# CONFIG_FB_KYRO is not set
684# CONFIG_FB_3DFX is not set 708# CONFIG_FB_3DFX is not set
685# CONFIG_FB_VOODOO1 is not set 709# CONFIG_FB_VOODOO1 is not set
686# CONFIG_FB_CYBLA is not set
687# CONFIG_FB_TRIDENT is not set 710# CONFIG_FB_TRIDENT is not set
688# CONFIG_FB_S1D13XXX is not set
689# CONFIG_FB_VIRTUAL is not set 711# CONFIG_FB_VIRTUAL is not set
690 712
691# 713#
@@ -695,6 +717,7 @@ CONFIG_DUMMY_CONSOLE=y
695CONFIG_DUMMY_CONSOLE_COLUMNS=160 717CONFIG_DUMMY_CONSOLE_COLUMNS=160
696CONFIG_DUMMY_CONSOLE_ROWS=64 718CONFIG_DUMMY_CONSOLE_ROWS=64
697CONFIG_FRAMEBUFFER_CONSOLE=y 719CONFIG_FRAMEBUFFER_CONSOLE=y
720# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
698CONFIG_STI_CONSOLE=y 721CONFIG_STI_CONSOLE=y
699# CONFIG_FONTS is not set 722# CONFIG_FONTS is not set
700CONFIG_FONT_8x8=y 723CONFIG_FONT_8x8=y
@@ -713,7 +736,85 @@ CONFIG_LOGO_PARISC_CLUT224=y
713# 736#
714# Sound 737# Sound
715# 738#
716# CONFIG_SOUND is not set 739CONFIG_SOUND=y
740
741#
742# Advanced Linux Sound Architecture
743#
744CONFIG_SND=y
745CONFIG_SND_TIMER=y
746CONFIG_SND_PCM=y
747CONFIG_SND_SEQUENCER=y
748# CONFIG_SND_SEQ_DUMMY is not set
749CONFIG_SND_OSSEMUL=y
750CONFIG_SND_MIXER_OSS=y
751CONFIG_SND_PCM_OSS=y
752CONFIG_SND_SEQUENCER_OSS=y
753CONFIG_SND_SUPPORT_OLD_API=y
754# CONFIG_SND_VERBOSE_PRINTK is not set
755# CONFIG_SND_DEBUG is not set
756
757#
758# Generic devices
759#
760# CONFIG_SND_DUMMY is not set
761# CONFIG_SND_VIRMIDI is not set
762# CONFIG_SND_MTPAV is not set
763# CONFIG_SND_SERIAL_U16550 is not set
764# CONFIG_SND_MPU401 is not set
765
766#
767# PCI devices
768#
769# CONFIG_SND_AD1889 is not set
770# CONFIG_SND_ALI5451 is not set
771# CONFIG_SND_ATIIXP is not set
772# CONFIG_SND_ATIIXP_MODEM is not set
773# CONFIG_SND_AU8810 is not set
774# CONFIG_SND_AU8820 is not set
775# CONFIG_SND_AU8830 is not set
776# CONFIG_SND_BT87X is not set
777# CONFIG_SND_CA0106 is not set
778# CONFIG_SND_CMIPCI is not set
779# CONFIG_SND_CS4281 is not set
780# CONFIG_SND_CS46XX is not set
781# CONFIG_SND_EMU10K1 is not set
782# CONFIG_SND_EMU10K1X is not set
783# CONFIG_SND_ENS1370 is not set
784# CONFIG_SND_ENS1371 is not set
785# CONFIG_SND_ES1938 is not set
786# CONFIG_SND_ES1968 is not set
787# CONFIG_SND_FM801 is not set
788# CONFIG_SND_HDA_INTEL is not set
789# CONFIG_SND_HDSP is not set
790# CONFIG_SND_HDSPM is not set
791# CONFIG_SND_ICE1712 is not set
792# CONFIG_SND_ICE1724 is not set
793# CONFIG_SND_INTEL8X0 is not set
794# CONFIG_SND_KORG1212 is not set
795# CONFIG_SND_MAESTRO3 is not set
796# CONFIG_SND_MIXART is not set
797# CONFIG_SND_NM256 is not set
798# CONFIG_SND_PCXHR is not set
799# CONFIG_SND_RME32 is not set
800# CONFIG_SND_RME96 is not set
801# CONFIG_SND_RME9652 is not set
802# CONFIG_SND_SONICVIBES is not set
803# CONFIG_SND_TRIDENT is not set
804# CONFIG_SND_VIA82XX is not set
805# CONFIG_SND_VIA82XX_MODEM is not set
806# CONFIG_SND_VX222 is not set
807# CONFIG_SND_YMFPCI is not set
808
809#
810# GSC devices
811#
812CONFIG_SND_HARMONY=y
813
814#
815# Open Sound System
816#
817# CONFIG_SOUND_PRIME is not set
717 818
718# 819#
719# USB support 820# USB support
@@ -723,6 +824,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
723# CONFIG_USB is not set 824# CONFIG_USB is not set
724 825
725# 826#
827# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
828#
829
830#
726# USB Gadget Support 831# USB Gadget Support
727# 832#
728# CONFIG_USB_GADGET is not set 833# CONFIG_USB_GADGET is not set
@@ -877,18 +982,23 @@ CONFIG_NLS_DEFAULT="iso8859-1"
877# Kernel hacking 982# Kernel hacking
878# 983#
879# CONFIG_PRINTK_TIME is not set 984# CONFIG_PRINTK_TIME is not set
880CONFIG_DEBUG_KERNEL=y
881CONFIG_MAGIC_SYSRQ=y 985CONFIG_MAGIC_SYSRQ=y
986CONFIG_DEBUG_KERNEL=y
882CONFIG_LOG_BUF_SHIFT=16 987CONFIG_LOG_BUF_SHIFT=16
883CONFIG_DETECT_SOFTLOCKUP=y 988CONFIG_DETECT_SOFTLOCKUP=y
884# CONFIG_SCHEDSTATS is not set 989# CONFIG_SCHEDSTATS is not set
885# CONFIG_DEBUG_SLAB is not set 990# CONFIG_DEBUG_SLAB is not set
991# CONFIG_DEBUG_MUTEXES is not set
886# CONFIG_DEBUG_SPINLOCK is not set 992# CONFIG_DEBUG_SPINLOCK is not set
887# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 993# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
888# CONFIG_DEBUG_KOBJECT is not set 994# CONFIG_DEBUG_KOBJECT is not set
889# CONFIG_DEBUG_INFO is not set 995# CONFIG_DEBUG_INFO is not set
890# CONFIG_DEBUG_IOREMAP is not set 996# CONFIG_DEBUG_IOREMAP is not set
891# CONFIG_DEBUG_FS is not set 997# CONFIG_DEBUG_FS is not set
998# CONFIG_DEBUG_VM is not set
999CONFIG_FORCED_INLINING=y
1000# CONFIG_RCU_TORTURE_TEST is not set
1001# CONFIG_DEBUG_RODATA is not set
892 1002
893# 1003#
894# Security options 1004# Security options
diff --git a/arch/parisc/hpux/entry_hpux.S b/arch/parisc/hpux/entry_hpux.S
index fa9bf38787e7..31c8cccfba31 100644
--- a/arch/parisc/hpux/entry_hpux.S
+++ b/arch/parisc/hpux/entry_hpux.S
@@ -22,10 +22,9 @@
22#include <linux/linkage.h> 22#include <linux/linkage.h>
23#include <asm/unistd.h> 23#include <asm/unistd.h>
24 24
25 .text
26
27#define ENTRY_NAME(_name_) .word _name_ 25#define ENTRY_NAME(_name_) .word _name_
28 26
27 .section .rodata,"a"
29 .align 4 28 .align 4
30 .export hpux_call_table 29 .export hpux_call_table
31 .import hpux_unimplemented_wrapper 30 .import hpux_unimplemented_wrapper
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 2d804e2d16d1..3d569a485a1a 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -408,11 +408,10 @@ static void setup_bus_id(struct parisc_device *padev)
408 408
409struct parisc_device * create_tree_node(char id, struct device *parent) 409struct parisc_device * create_tree_node(char id, struct device *parent)
410{ 410{
411 struct parisc_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL); 411 struct parisc_device *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
412 if (!dev) 412 if (!dev)
413 return NULL; 413 return NULL;
414 414
415 memset(dev, 0, sizeof(*dev));
416 dev->hw_path = id; 415 dev->hw_path = id;
417 dev->id.hw_type = HPHW_FAULTY; 416 dev->id.hw_type = HPHW_FAULTY;
418 417
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index f40a777dd388..1d00c365f2b1 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -48,9 +48,6 @@ EXPORT_SYMBOL(strrchr);
48EXPORT_SYMBOL(strstr); 48EXPORT_SYMBOL(strstr);
49EXPORT_SYMBOL(strpbrk); 49EXPORT_SYMBOL(strpbrk);
50 50
51#include <linux/pm.h>
52EXPORT_SYMBOL(pm_power_off);
53
54#include <asm/atomic.h> 51#include <asm/atomic.h>
55EXPORT_SYMBOL(__xchg8); 52EXPORT_SYMBOL(__xchg8);
56EXPORT_SYMBOL(__xchg32); 53EXPORT_SYMBOL(__xchg32);
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 88cba49c5301..79c7db2705fd 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -47,18 +47,17 @@
47 * this makes the boot time much longer than necessary. 47 * this makes the boot time much longer than necessary.
48 * 20ms seems to work for all the HP PCI implementations to date. 48 * 20ms seems to work for all the HP PCI implementations to date.
49 * 49 *
50 * XXX: turn into a #defined constant in <asm/pci.h> ? 50 * #define pci_post_reset_delay 50
51 */ 51 */
52int pci_post_reset_delay = 50;
53 52
54struct pci_port_ops *pci_port; 53struct pci_port_ops *pci_port __read_mostly;
55struct pci_bios_ops *pci_bios; 54struct pci_bios_ops *pci_bios __read_mostly;
56 55
57int pci_hba_count = 0; 56static int pci_hba_count __read_mostly;
58 57
59/* parisc_pci_hba used by pci_port->in/out() ops to lookup bus data. */ 58/* parisc_pci_hba used by pci_port->in/out() ops to lookup bus data. */
60#define PCI_HBA_MAX 32 59#define PCI_HBA_MAX 32
61struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX]; 60static struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX] __read_mostly;
62 61
63 62
64/******************************************************************** 63/********************************************************************
@@ -259,8 +258,10 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
259void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 258void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
260 struct pci_bus_region *region) 259 struct pci_bus_region *region)
261{ 260{
261#ifdef CONFIG_64BIT
262 struct pci_bus *bus = dev->bus; 262 struct pci_bus *bus = dev->bus;
263 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); 263 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data);
264#endif
264 265
265 if (res->flags & IORESOURCE_MEM) { 266 if (res->flags & IORESOURCE_MEM) {
266 res->start = PCI_HOST_ADDR(hba, region->start); 267 res->start = PCI_HOST_ADDR(hba, region->start);
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index 11d406cd0b3e..53f861c82f93 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -68,20 +68,20 @@ struct rdr_tbl_ent {
68}; 68};
69 69
70static int perf_processor_interface __read_mostly = UNKNOWN_INTF; 70static int perf_processor_interface __read_mostly = UNKNOWN_INTF;
71static int perf_enabled __read_mostly = 0; 71static int perf_enabled __read_mostly;
72static spinlock_t perf_lock; 72static spinlock_t perf_lock;
73struct parisc_device *cpu_device __read_mostly = NULL; 73struct parisc_device *cpu_device __read_mostly;
74 74
75/* RDRs to write for PCX-W */ 75/* RDRs to write for PCX-W */
76static int perf_rdrs_W[] = 76static const int perf_rdrs_W[] =
77 { 0, 1, 4, 5, 6, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 }; 77 { 0, 1, 4, 5, 6, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 };
78 78
79/* RDRs to write for PCX-U */ 79/* RDRs to write for PCX-U */
80static int perf_rdrs_U[] = 80static const int perf_rdrs_U[] =
81 { 0, 1, 4, 5, 6, 7, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 }; 81 { 0, 1, 4, 5, 6, 7, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 };
82 82
83/* RDR register descriptions for PCX-W */ 83/* RDR register descriptions for PCX-W */
84static struct rdr_tbl_ent perf_rdr_tbl_W[] = { 84static const struct rdr_tbl_ent perf_rdr_tbl_W[] = {
85 { 19, 1, 8 }, /* RDR 0 */ 85 { 19, 1, 8 }, /* RDR 0 */
86 { 16, 1, 16 }, /* RDR 1 */ 86 { 16, 1, 16 }, /* RDR 1 */
87 { 72, 2, 0 }, /* RDR 2 */ 87 { 72, 2, 0 }, /* RDR 2 */
@@ -117,7 +117,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_W[] = {
117}; 117};
118 118
119/* RDR register descriptions for PCX-U */ 119/* RDR register descriptions for PCX-U */
120static struct rdr_tbl_ent perf_rdr_tbl_U[] = { 120static const struct rdr_tbl_ent perf_rdr_tbl_U[] = {
121 { 19, 1, 8 }, /* RDR 0 */ 121 { 19, 1, 8 }, /* RDR 0 */
122 { 32, 1, 16 }, /* RDR 1 */ 122 { 32, 1, 16 }, /* RDR 1 */
123 { 20, 1, 0 }, /* RDR 2 */ 123 { 20, 1, 0 }, /* RDR 2 */
@@ -156,7 +156,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_U[] = {
156 * A non-zero write_control in the above tables is a byte offset into 156 * A non-zero write_control in the above tables is a byte offset into
157 * this array. 157 * this array.
158 */ 158 */
159static uint64_t perf_bitmasks[] = { 159static const uint64_t perf_bitmasks[] = {
160 0x0000000000000000ul, /* first dbl word must be zero */ 160 0x0000000000000000ul, /* first dbl word must be zero */
161 0xfdffe00000000000ul, /* RDR0 bitmask */ 161 0xfdffe00000000000ul, /* RDR0 bitmask */
162 0x003f000000000000ul, /* RDR1 bitmask */ 162 0x003f000000000000ul, /* RDR1 bitmask */
@@ -173,7 +173,7 @@ static uint64_t perf_bitmasks[] = {
173 * Write control bitmasks for Pa-8700 processor given 173 * Write control bitmasks for Pa-8700 processor given
174 * somethings have changed slightly. 174 * somethings have changed slightly.
175 */ 175 */
176static uint64_t perf_bitmasks_piranha[] = { 176static const uint64_t perf_bitmasks_piranha[] = {
177 0x0000000000000000ul, /* first dbl word must be zero */ 177 0x0000000000000000ul, /* first dbl word must be zero */
178 0xfdffe00000000000ul, /* RDR0 bitmask */ 178 0xfdffe00000000000ul, /* RDR0 bitmask */
179 0x003f000000000000ul, /* RDR1 bitmask */ 179 0x003f000000000000ul, /* RDR1 bitmask */
@@ -186,7 +186,7 @@ static uint64_t perf_bitmasks_piranha[] = {
186 0xfffc000000000000ul 186 0xfffc000000000000ul
187}; 187};
188 188
189static uint64_t *bitmask_array; /* array of bitmasks to use */ 189static const uint64_t *bitmask_array; /* array of bitmasks to use */
190 190
191/****************************************************************************** 191/******************************************************************************
192 * Function Prototypes 192 * Function Prototypes
@@ -200,7 +200,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun
200static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 200static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
201static void perf_start_counters(void); 201static void perf_start_counters(void);
202static int perf_stop_counters(uint32_t *raddr); 202static int perf_stop_counters(uint32_t *raddr);
203static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num); 203static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num);
204static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer); 204static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer);
205static int perf_rdr_clear(uint32_t rdr_num); 205static int perf_rdr_clear(uint32_t rdr_num);
206static int perf_write_image(uint64_t *memaddr); 206static int perf_write_image(uint64_t *memaddr);
@@ -444,7 +444,6 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
444 uint32_t raddr[4]; 444 uint32_t raddr[4];
445 int error = 0; 445 int error = 0;
446 446
447 lock_kernel();
448 switch (cmd) { 447 switch (cmd) {
449 448
450 case PA_PERF_ON: 449 case PA_PERF_ON:
@@ -477,8 +476,6 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
477 error = -ENOTTY; 476 error = -ENOTTY;
478 } 477 }
479 478
480 unlock_kernel();
481
482 return error; 479 return error;
483} 480}
484 481
@@ -655,7 +652,7 @@ static int perf_stop_counters(uint32_t *raddr)
655 * Retrieve a pointer to the description of what this 652 * Retrieve a pointer to the description of what this
656 * RDR contains. 653 * RDR contains.
657 */ 654 */
658static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num) 655static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num)
659{ 656{
660 if (perf_processor_interface == ONYX_INTF) { 657 if (perf_processor_interface == ONYX_INTF) {
661 return &perf_rdr_tbl_U[rdr_num]; 658 return &perf_rdr_tbl_U[rdr_num];
@@ -673,7 +670,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer)
673{ 670{
674 uint64_t data, data_mask = 0; 671 uint64_t data, data_mask = 0;
675 uint32_t width, xbits, i; 672 uint32_t width, xbits, i;
676 struct rdr_tbl_ent *tentry; 673 const struct rdr_tbl_ent *tentry;
677 674
678 tentry = perf_rdr_get_entry(rdr_num); 675 tentry = perf_rdr_get_entry(rdr_num);
679 if ((width = tentry->width) == 0) 676 if ((width = tentry->width) == 0)
@@ -721,7 +718,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer)
721 */ 718 */
722static int perf_rdr_clear(uint32_t rdr_num) 719static int perf_rdr_clear(uint32_t rdr_num)
723{ 720{
724 struct rdr_tbl_ent *tentry; 721 const struct rdr_tbl_ent *tentry;
725 int32_t i; 722 int32_t i;
726 723
727 tentry = perf_rdr_get_entry(rdr_num); 724 tentry = perf_rdr_get_entry(rdr_num);
@@ -753,10 +750,11 @@ static int perf_write_image(uint64_t *memaddr)
753 uint64_t buffer[MAX_RDR_WORDS]; 750 uint64_t buffer[MAX_RDR_WORDS];
754 uint64_t *bptr; 751 uint64_t *bptr;
755 uint32_t dwords; 752 uint32_t dwords;
756 uint32_t *intrigue_rdr; 753 const uint32_t *intrigue_rdr;
757 uint64_t *intrigue_bitmask, tmp64; 754 const uint64_t *intrigue_bitmask;
755 uint64_t tmp64;
758 void __iomem *runway; 756 void __iomem *runway;
759 struct rdr_tbl_ent *tentry; 757 const struct rdr_tbl_ent *tentry;
760 int i; 758 int i;
761 759
762 /* Clear out counters */ 760 /* Clear out counters */
@@ -830,7 +828,7 @@ static int perf_write_image(uint64_t *memaddr)
830 */ 828 */
831static void perf_rdr_write(uint32_t rdr_num, uint64_t *buffer) 829static void perf_rdr_write(uint32_t rdr_num, uint64_t *buffer)
832{ 830{
833 struct rdr_tbl_ent *tentry; 831 const struct rdr_tbl_ent *tentry;
834 int32_t i; 832 int32_t i;
835 833
836printk("perf_rdr_write\n"); 834printk("perf_rdr_write\n");
diff --git a/arch/parisc/kernel/perf_images.h b/arch/parisc/kernel/perf_images.h
index d9562fe3f75c..7fef9644df47 100644
--- a/arch/parisc/kernel/perf_images.h
+++ b/arch/parisc/kernel/perf_images.h
@@ -25,7 +25,7 @@
25 25
26#define PCXU_IMAGE_SIZE 584 26#define PCXU_IMAGE_SIZE 584
27 27
28static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] = { 28static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] __read_mostly = {
29/* 29/*
30 * CPI: 30 * CPI:
31 * 31 *
@@ -2093,7 +2093,7 @@ static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] = {
2093}; 2093};
2094#define PCXW_IMAGE_SIZE 576 2094#define PCXW_IMAGE_SIZE 576
2095 2095
2096static uint32_t cuda_images[][PCXW_IMAGE_SIZE/sizeof(uint32_t)] = { 2096static uint32_t cuda_images[][PCXW_IMAGE_SIZE/sizeof(uint32_t)] __read_mostly = {
2097/* 2097/*
2098 * CPI: FROM CPI.IDF (Image 0) 2098 * CPI: FROM CPI.IDF (Image 0)
2099 * 2099 *
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 5da41677e70b..e8dea4177113 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -54,27 +54,6 @@
54#include <asm/uaccess.h> 54#include <asm/uaccess.h>
55#include <asm/unwind.h> 55#include <asm/unwind.h>
56 56
57static int hlt_counter __read_mostly;
58
59/*
60 * Power off function, if any
61 */
62void (*pm_power_off)(void);
63
64void disable_hlt(void)
65{
66 hlt_counter++;
67}
68
69EXPORT_SYMBOL(disable_hlt);
70
71void enable_hlt(void)
72{
73 hlt_counter--;
74}
75
76EXPORT_SYMBOL(enable_hlt);
77
78void default_idle(void) 57void default_idle(void)
79{ 58{
80 barrier(); 59 barrier();
@@ -102,12 +81,7 @@ void cpu_idle(void)
102} 81}
103 82
104 83
105#ifdef __LP64__ 84#define COMMAND_GLOBAL F_EXTEND(0xfffe0030)
106#define COMMAND_GLOBAL 0xfffffffffffe0030UL
107#else
108#define COMMAND_GLOBAL 0xfffe0030
109#endif
110
111#define CMD_RESET 5 /* reset any module */ 85#define CMD_RESET 5 /* reset any module */
112 86
113/* 87/*
@@ -162,6 +136,7 @@ void machine_halt(void)
162 */ 136 */
163} 137}
164 138
139void (*chassis_power_off)(void);
165 140
166/* 141/*
167 * This routine is called from sys_reboot to actually turn off the 142 * This routine is called from sys_reboot to actually turn off the
@@ -170,8 +145,8 @@ void machine_halt(void)
170void machine_power_off(void) 145void machine_power_off(void)
171{ 146{
172 /* If there is a registered power off handler, call it. */ 147 /* If there is a registered power off handler, call it. */
173 if(pm_power_off) 148 if (chassis_power_off)
174 pm_power_off(); 149 chassis_power_off();
175 150
176 /* Put the soft power button back under hardware control. 151 /* Put the soft power button back under hardware control.
177 * If the user had already pressed the power button, the 152 * If the user had already pressed the power button, the
@@ -187,6 +162,8 @@ void machine_power_off(void)
187 KERN_EMERG "Please power this system off now."); 162 KERN_EMERG "Please power this system off now.");
188} 163}
189 164
165void (*pm_power_off)(void) = machine_power_off;
166EXPORT_SYMBOL(pm_power_off);
190 167
191/* 168/*
192 * Create a kernel thread 169 * Create a kernel thread
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 27160e8bf15b..413292f1a4a3 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -91,7 +91,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
91 int copied; 91 int copied;
92 92
93#ifdef __LP64__ 93#ifdef __LP64__
94 if (is_compat_task(child)) { 94 if (personality(child->personality) == PER_LINUX32) {
95 unsigned int tmp; 95 unsigned int tmp;
96 96
97 addr &= 0xffffffffL; 97 addr &= 0xffffffffL;
@@ -123,7 +123,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
123 case PTRACE_POKEDATA: 123 case PTRACE_POKEDATA:
124 ret = 0; 124 ret = 0;
125#ifdef __LP64__ 125#ifdef __LP64__
126 if (is_compat_task(child)) { 126 if (personality(child->personality) == PER_LINUX32) {
127 unsigned int tmp = (unsigned int)data; 127 unsigned int tmp = (unsigned int)data;
128 DBG("sys_ptrace(POKE%s, %d, %lx, %lx)\n", 128 DBG("sys_ptrace(POKE%s, %d, %lx, %lx)\n",
129 request == PTRACE_POKETEXT ? "TEXT" : "DATA", 129 request == PTRACE_POKETEXT ? "TEXT" : "DATA",
@@ -146,7 +146,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
146 case PTRACE_PEEKUSR: { 146 case PTRACE_PEEKUSR: {
147 ret = -EIO; 147 ret = -EIO;
148#ifdef __LP64__ 148#ifdef __LP64__
149 if (is_compat_task(child)) { 149 if (personality(child->personality) == PER_LINUX32) {
150 unsigned int tmp; 150 unsigned int tmp;
151 151
152 if (addr & (sizeof(int)-1)) 152 if (addr & (sizeof(int)-1))
@@ -205,7 +205,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
205 goto out_tsk; 205 goto out_tsk;
206 } 206 }
207#ifdef __LP64__ 207#ifdef __LP64__
208 if (is_compat_task(child)) { 208 if (personality(child->personality) == PER_LINUX32) {
209 if (addr & (sizeof(int)-1)) 209 if (addr & (sizeof(int)-1))
210 goto out_tsk; 210 goto out_tsk;
211 if ((addr = translate_usr_offset(addr)) < 0) 211 if ((addr = translate_usr_offset(addr)) < 0)
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 3a25a7bd673e..05767e83cf2d 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -317,7 +317,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
317 317
318 if(personality(current->personality) == PER_LINUX32) { 318 if(personality(current->personality) == PER_LINUX32) {
319 DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info); 319 DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info);
320 err |= compat_copy_siginfo_to_user(&compat_frame->info, info); 320 err |= copy_siginfo_to_user32(&compat_frame->info, info);
321 DBG(1,"SETUP_RT_FRAME: 1\n"); 321 DBG(1,"SETUP_RT_FRAME: 1\n");
322 compat_val = (compat_int_t)current->sas_ss_sp; 322 compat_val = (compat_int_t)current->sas_ss_sp;
323 err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_sp); 323 err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_sp);
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c
index 0792e20efef3..a6b4231cafa1 100644
--- a/arch/parisc/kernel/signal32.c
+++ b/arch/parisc/kernel/signal32.c
@@ -31,7 +31,6 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/errno.h> 32#include <linux/errno.h>
33 33
34#include <asm/compat_signal.h>
35#include <asm/uaccess.h> 34#include <asm/uaccess.h>
36 35
37#include "signal32.h" 36#include "signal32.h"
@@ -398,3 +397,104 @@ setup_sigcontext32(struct compat_sigcontext __user *sc, struct compat_regfile __
398 397
399 return err; 398 return err;
400} 399}
400
401int
402copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from)
403{
404 unsigned long tmp;
405 int err;
406
407 if (!access_ok(VERIFY_READ, from, sizeof(compat_siginfo_t)))
408 return -EFAULT;
409
410 err = __get_user(to->si_signo, &from->si_signo);
411 err |= __get_user(to->si_errno, &from->si_errno);
412 err |= __get_user(to->si_code, &from->si_code);
413
414 if (to->si_code < 0)
415 err |= __copy_from_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
416 else {
417 switch (to->si_code >> 16) {
418 case __SI_CHLD >> 16:
419 err |= __get_user(to->si_utime, &from->si_utime);
420 err |= __get_user(to->si_stime, &from->si_stime);
421 err |= __get_user(to->si_status, &from->si_status);
422 default:
423 err |= __get_user(to->si_pid, &from->si_pid);
424 err |= __get_user(to->si_uid, &from->si_uid);
425 break;
426 case __SI_FAULT >> 16:
427 err |= __get_user(tmp, &from->si_addr);
428 to->si_addr = (void __user *) tmp;
429 break;
430 case __SI_POLL >> 16:
431 err |= __get_user(to->si_band, &from->si_band);
432 err |= __get_user(to->si_fd, &from->si_fd);
433 break;
434 case __SI_RT >> 16: /* This is not generated by the kernel as of now. */
435 case __SI_MESGQ >> 16:
436 err |= __get_user(to->si_pid, &from->si_pid);
437 err |= __get_user(to->si_uid, &from->si_uid);
438 err |= __get_user(to->si_int, &from->si_int);
439 break;
440 }
441 }
442 return err;
443}
444
445int
446copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from)
447{
448 unsigned int addr;
449 int err;
450
451 if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
452 return -EFAULT;
453
454 /* If you change siginfo_t structure, please be sure
455 this code is fixed accordingly.
456 It should never copy any pad contained in the structure
457 to avoid security leaks, but must copy the generic
458 3 ints plus the relevant union member.
459 This routine must convert siginfo from 64bit to 32bit as well
460 at the same time. */
461 err = __put_user(from->si_signo, &to->si_signo);
462 err |= __put_user(from->si_errno, &to->si_errno);
463 err |= __put_user((short)from->si_code, &to->si_code);
464 if (from->si_code < 0)
465 err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
466 else {
467 switch (from->si_code >> 16) {
468 case __SI_CHLD >> 16:
469 err |= __put_user(from->si_utime, &to->si_utime);
470 err |= __put_user(from->si_stime, &to->si_stime);
471 err |= __put_user(from->si_status, &to->si_status);
472 default:
473 err |= __put_user(from->si_pid, &to->si_pid);
474 err |= __put_user(from->si_uid, &to->si_uid);
475 break;
476 case __SI_FAULT >> 16:
477 /* avoid type-checking warnings by copying _pad[0] in lieu of si_addr... */
478 err |= __put_user(from->_sifields._pad[0], &to->si_addr);
479 break;
480 case __SI_POLL >> 16:
481 err |= __put_user(from->si_band, &to->si_band);
482 err |= __put_user(from->si_fd, &to->si_fd);
483 break;
484 case __SI_TIMER >> 16:
485 err |= __put_user(from->si_tid, &to->si_tid);
486 err |= __put_user(from->si_overrun, &to->si_overrun);
487 addr = (unsigned long) from->si_ptr;
488 err |= __put_user(addr, &to->si_ptr);
489 break;
490 case __SI_RT >> 16: /* Not generated by the kernel as of now. */
491 case __SI_MESGQ >> 16:
492 err |= __put_user(from->si_uid, &to->si_uid);
493 err |= __put_user(from->si_pid, &to->si_pid);
494 addr = (unsigned long) from->si_ptr;
495 err |= __put_user(addr, &to->si_ptr);
496 break;
497 }
498 }
499 return err;
500}
diff --git a/arch/parisc/kernel/signal32.h b/arch/parisc/kernel/signal32.h
index 4d1569e717cc..e39b38a67a87 100644
--- a/arch/parisc/kernel/signal32.h
+++ b/arch/parisc/kernel/signal32.h
@@ -20,8 +20,34 @@
20#define _PARISC64_KERNEL_SIGNAL32_H 20#define _PARISC64_KERNEL_SIGNAL32_H
21 21
22#include <linux/compat.h> 22#include <linux/compat.h>
23#include <asm/compat_signal.h> 23
24#include <asm/compat_rt_sigframe.h> 24typedef compat_uptr_t compat_sighandler_t;
25
26typedef struct compat_sigaltstack {
27 compat_uptr_t ss_sp;
28 compat_int_t ss_flags;
29 compat_size_t ss_size;
30} compat_stack_t;
31
32/* Most things should be clean enough to redefine this at will, if care
33 is taken to make libc match. */
34
35struct compat_sigaction {
36 compat_sighandler_t sa_handler;
37 compat_uint_t sa_flags;
38 compat_sigset_t sa_mask; /* mask last for extensibility */
39};
40
41/* 32-bit ucontext as seen from an 64-bit kernel */
42struct compat_ucontext {
43 compat_uint_t uc_flags;
44 compat_uptr_t uc_link;
45 compat_stack_t uc_stack; /* struct compat_sigaltstack (12 bytes)*/
46 /* FIXME: Pad out to get uc_mcontext to start at an 8-byte aligned boundary */
47 compat_uint_t pad[1];
48 struct compat_sigcontext uc_mcontext;
49 compat_sigset_t uc_sigmask; /* mask last for extensibility */
50};
25 51
26/* ELF32 signal handling */ 52/* ELF32 signal handling */
27 53
@@ -29,6 +55,103 @@ struct k_sigaction32 {
29 struct compat_sigaction sa; 55 struct compat_sigaction sa;
30}; 56};
31 57
58typedef struct compat_siginfo {
59 int si_signo;
60 int si_errno;
61 int si_code;
62
63 union {
64 int _pad[((128/sizeof(int)) - 3)];
65
66 /* kill() */
67 struct {
68 unsigned int _pid; /* sender's pid */
69 unsigned int _uid; /* sender's uid */
70 } _kill;
71
72 /* POSIX.1b timers */
73 struct {
74 compat_timer_t _tid; /* timer id */
75 int _overrun; /* overrun count */
76 char _pad[sizeof(unsigned int) - sizeof(int)];
77 compat_sigval_t _sigval; /* same as below */
78 int _sys_private; /* not to be passed to user */
79 } _timer;
80
81 /* POSIX.1b signals */
82 struct {
83 unsigned int _pid; /* sender's pid */
84 unsigned int _uid; /* sender's uid */
85 compat_sigval_t _sigval;
86 } _rt;
87
88 /* SIGCHLD */
89 struct {
90 unsigned int _pid; /* which child */
91 unsigned int _uid; /* sender's uid */
92 int _status; /* exit code */
93 compat_clock_t _utime;
94 compat_clock_t _stime;
95 } _sigchld;
96
97 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
98 struct {
99 unsigned int _addr; /* faulting insn/memory ref. */
100 } _sigfault;
101
102 /* SIGPOLL */
103 struct {
104 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
105 int _fd;
106 } _sigpoll;
107 } _sifields;
108} compat_siginfo_t;
109
110int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from);
111int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from);
112
113/* In a deft move of uber-hackery, we decide to carry the top half of all
114 * 64-bit registers in a non-portable, non-ABI, hidden structure.
115 * Userspace can read the hidden structure if it *wants* but is never
116 * guaranteed to be in the same place. Infact the uc_sigmask from the
117 * ucontext_t structure may push the hidden register file downards
118 */
119struct compat_regfile {
120 /* Upper half of all the 64-bit registers that were truncated
121 on a copy to a 32-bit userspace */
122 compat_int_t rf_gr[32];
123 compat_int_t rf_iasq[2];
124 compat_int_t rf_iaoq[2];
125 compat_int_t rf_sar;
126};
127
128#define COMPAT_SIGRETURN_TRAMP 4
129#define COMPAT_SIGRESTARTBLOCK_TRAMP 5
130#define COMPAT_TRAMP_SIZE (COMPAT_SIGRETURN_TRAMP + \
131 COMPAT_SIGRESTARTBLOCK_TRAMP)
132
133struct compat_rt_sigframe {
134 /* XXX: Must match trampoline size in arch/parisc/kernel/signal.c
135 Secondary to that it must protect the ERESTART_RESTARTBLOCK
136 trampoline we left on the stack (we were bad and didn't
137 change sp so we could run really fast.) */
138 compat_uint_t tramp[COMPAT_TRAMP_SIZE];
139 compat_siginfo_t info;
140 struct compat_ucontext uc;
141 /* Hidden location of truncated registers, *must* be last. */
142 struct compat_regfile regs;
143};
144
145/*
146 * The 32-bit ABI wants at least 48 bytes for a function call frame:
147 * 16 bytes for arg0-arg3, and 32 bytes for magic (the only part of
148 * which Linux/parisc uses is sp-20 for the saved return pointer...)
149 * Then, the stack pointer must be rounded to a cache line (64 bytes).
150 */
151#define SIGFRAME32 64
152#define FUNCTIONCALLFRAME32 48
153#define PARISC_RT_SIGFRAME_SIZE32 (((sizeof(struct compat_rt_sigframe) + FUNCTIONCALLFRAME32) + SIGFRAME32) & -SIGFRAME32)
154
32void sigset_32to64(sigset_t *s64, compat_sigset_t *s32); 155void sigset_32to64(sigset_t *s64, compat_sigset_t *s32);
33void sigset_64to32(compat_sigset_t *s32, sigset_t *s64); 156void sigset_64to32(compat_sigset_t *s32, sigset_t *s64);
34int do_sigaltstack32 (const compat_stack_t __user *uss32, 157int do_sigaltstack32 (const compat_stack_t __user *uss32,
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index d66163492890..af88afef41bd 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -650,6 +650,8 @@ end_linux_gateway_page:
650#define LWS_ENTRY(_name_) .word (lws_##_name_ - linux_gateway_page) 650#define LWS_ENTRY(_name_) .word (lws_##_name_ - linux_gateway_page)
651#endif 651#endif
652 652
653 .section .rodata,"a"
654
653 .align 4096 655 .align 4096
654 /* Light-weight-syscall table */ 656 /* Light-weight-syscall table */
655 /* Start of lws table. */ 657 /* Start of lws table. */
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 32cbc0489324..51d2480627d1 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -374,5 +374,24 @@
374 ENTRY_SAME(keyctl) 374 ENTRY_SAME(keyctl)
375 ENTRY_SAME(ioprio_set) 375 ENTRY_SAME(ioprio_set)
376 ENTRY_SAME(ioprio_get) 376 ENTRY_SAME(ioprio_get)
377 ENTRY_SAME(inotify_init)
378 ENTRY_SAME(inotify_add_watch) /* 270 */
379 ENTRY_SAME(inotify_rm_watch)
380 ENTRY_COMP(pselect6)
381 ENTRY_COMP(ppoll)
382 ENTRY_SAME(migrate_pages)
383 ENTRY_COMP(openat) /* 275 */
384 ENTRY_SAME(mkdirat)
385 ENTRY_SAME(mknodat)
386 ENTRY_SAME(fchownat)
387 ENTRY_COMP(futimesat)
388 ENTRY_COMP(newfstatat) /* 280 */
389 ENTRY_SAME(unlinkat)
390 ENTRY_SAME(renameat)
391 ENTRY_SAME(linkat)
392 ENTRY_SAME(symlinkat)
393 ENTRY_SAME(readlinkat) /* 285 */
394 ENTRY_SAME(fchmodat)
395 ENTRY_SAME(faccessat)
377 /* Nothing yet */ 396 /* Nothing yet */
378 397
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 15914f0235a0..ff200608c851 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -193,10 +193,9 @@ void show_stack(struct task_struct *task, unsigned long *s)
193 193
194HERE: 194HERE:
195 asm volatile ("copy %%r30, %0" : "=r"(sp)); 195 asm volatile ("copy %%r30, %0" : "=r"(sp));
196 r = (struct pt_regs *)kmalloc(sizeof(struct pt_regs), GFP_KERNEL); 196 r = kzalloc(sizeof(struct pt_regs), GFP_KERNEL);
197 if (!r) 197 if (!r)
198 return; 198 return;
199 memset(r, 0, sizeof(struct pt_regs));
200 r->iaoq[0] = (unsigned long)&&HERE; 199 r->iaoq[0] = (unsigned long)&&HERE;
201 r->gr[2] = (unsigned long)__builtin_return_address(0); 200 r->gr[2] = (unsigned long)__builtin_return_address(0);
202 r->gr[30] = sp; 201 r->gr[30] = sp;
diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c
index f84f2586672b..66c8a9f6a27e 100644
--- a/arch/parisc/math-emu/decode_exc.c
+++ b/arch/parisc/math-emu/decode_exc.c
@@ -337,6 +337,7 @@ decode_fpu(unsigned int Fpu_register[], unsigned int trap_counts[])
337 } 337 }
338 break; 338 break;
339 case INVALIDEXCEPTION: 339 case INVALIDEXCEPTION:
340 case OPC_2E_INVALIDEXCEPTION:
340 update_trap_counts(Fpu_register, aflags, bflags, trap_counts); 341 update_trap_counts(Fpu_register, aflags, bflags, trap_counts);
341 return SIGNALCODE(SIGFPE, FPE_FLTINV); 342 return SIGNALCODE(SIGFPE, FPE_FLTINV);
342 case DIVISIONBYZEROEXCEPTION: 343 case DIVISIONBYZEROEXCEPTION:
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 720287d46e55..7847ca13d6c2 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -371,17 +371,11 @@ static void __init setup_bootmem(void)
371 371
372void free_initmem(void) 372void free_initmem(void)
373{ 373{
374 /* FIXME: */
375#if 0
376 printk(KERN_INFO "NOT FREEING INITMEM (%dk)\n",
377 (&__init_end - &__init_begin) >> 10);
378 return;
379#else
380 unsigned long addr; 374 unsigned long addr;
381 375
382 printk(KERN_INFO "Freeing unused kernel memory: "); 376 printk(KERN_INFO "Freeing unused kernel memory: ");
383 377
384#if 1 378#ifdef CONFIG_DEBUG_KERNEL
385 /* Attempt to catch anyone trying to execute code here 379 /* Attempt to catch anyone trying to execute code here
386 * by filling the page with BRK insns. 380 * by filling the page with BRK insns.
387 * 381 *
@@ -414,9 +408,21 @@ void free_initmem(void)
414 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 408 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
415 409
416 printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10); 410 printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10);
417#endif
418} 411}
419 412
413
414#ifdef CONFIG_DEBUG_RODATA
415void mark_rodata_ro(void)
416{
417 extern char __start_rodata, __end_rodata;
418 /* rodata memory was already mapped with KERNEL_RO access rights by
419 pagetable_init() and map_pages(). No need to do additional stuff here */
420 printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n",
421 (unsigned long)(&__end_rodata - &__start_rodata) >> 10);
422}
423#endif
424
425
420/* 426/*
421 * Just an arbitrary offset to serve as a "hole" between mapping areas 427 * Just an arbitrary offset to serve as a "hole" between mapping areas
422 * (between top of physical memory and a potential pcxl dma mapping 428 * (between top of physical memory and a potential pcxl dma mapping
@@ -477,11 +483,6 @@ void __init mem_init(void)
477 483
478} 484}
479 485
480int do_check_pgt_cache(int low, int high)
481{
482 return 0;
483}
484
485unsigned long *empty_zero_page __read_mostly; 486unsigned long *empty_zero_page __read_mostly;
486 487
487void show_mem(void) 488void show_mem(void)
@@ -690,7 +691,7 @@ static void __init pagetable_init(void)
690 691
691#ifdef CONFIG_BLK_DEV_INITRD 692#ifdef CONFIG_BLK_DEV_INITRD
692 if (initrd_end && initrd_end > mem_limit) { 693 if (initrd_end && initrd_end > mem_limit) {
693 printk("initrd: mapping %08lx-%08lx\n", initrd_start, initrd_end); 694 printk(KERN_INFO "initrd: mapping %08lx-%08lx\n", initrd_start, initrd_end);
694 map_pages(initrd_start, __pa(initrd_start), 695 map_pages(initrd_start, __pa(initrd_start),
695 initrd_end - initrd_start, PAGE_KERNEL); 696 initrd_end - initrd_start, PAGE_KERNEL);
696 } 697 }
@@ -792,8 +793,6 @@ map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm)
792EXPORT_SYMBOL(map_hpux_gateway_page); 793EXPORT_SYMBOL(map_hpux_gateway_page);
793#endif 794#endif
794 795
795extern void flush_tlb_all_local(void);
796
797void __init paging_init(void) 796void __init paging_init(void)
798{ 797{
799 int i; 798 int i;
@@ -802,7 +801,7 @@ void __init paging_init(void)
802 pagetable_init(); 801 pagetable_init();
803 gateway_init(); 802 gateway_init();
804 flush_cache_all_local(); /* start with known state */ 803 flush_cache_all_local(); /* start with known state */
805 flush_tlb_all_local(); 804 flush_tlb_all_local(NULL);
806 805
807 for (i = 0; i < npmem_ranges; i++) { 806 for (i = 0; i < npmem_ranges; i++) {
808 unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0 }; 807 unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0 };
@@ -993,7 +992,7 @@ void flush_tlb_all(void)
993 do_recycle++; 992 do_recycle++;
994 } 993 }
995 spin_unlock(&sid_lock); 994 spin_unlock(&sid_lock);
996 on_each_cpu((void (*)(void *))flush_tlb_all_local, NULL, 1, 1); 995 on_each_cpu(flush_tlb_all_local, NULL, 1, 1);
997 if (do_recycle) { 996 if (do_recycle) {
998 spin_lock(&sid_lock); 997 spin_lock(&sid_lock);
999 recycle_sids(recycle_ndirty,recycle_dirty_array); 998 recycle_sids(recycle_ndirty,recycle_dirty_array);
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 9e0229f7e25f..f46e8438e0d2 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -1423,7 +1423,7 @@ static void __init ccio_init_resources(struct ioc *ioc)
1423 struct resource *res = ioc->mmio_region; 1423 struct resource *res = ioc->mmio_region;
1424 char *name = kmalloc(14, GFP_KERNEL); 1424 char *name = kmalloc(14, GFP_KERNEL);
1425 1425
1426 sprintf(name, "GSC Bus [%d/]", ioc->hw_path); 1426 snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path);
1427 1427
1428 ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low); 1428 ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
1429 ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv); 1429 ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
@@ -1557,12 +1557,11 @@ static int ccio_probe(struct parisc_device *dev)
1557 int i; 1557 int i;
1558 struct ioc *ioc, **ioc_p = &ioc_list; 1558 struct ioc *ioc, **ioc_p = &ioc_list;
1559 1559
1560 ioc = kmalloc(sizeof(struct ioc), GFP_KERNEL); 1560 ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
1561 if (ioc == NULL) { 1561 if (ioc == NULL) {
1562 printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); 1562 printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
1563 return 1; 1563 return 1;
1564 } 1564 }
1565 memset(ioc, 0, sizeof(struct ioc));
1566 1565
1567 ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn"; 1566 ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
1568 1567
@@ -1578,7 +1577,7 @@ static int ccio_probe(struct parisc_device *dev)
1578 ccio_ioc_init(ioc); 1577 ccio_ioc_init(ioc);
1579 ccio_init_resources(ioc); 1578 ccio_init_resources(ioc);
1580 hppa_dma_ops = &ccio_ops; 1579 hppa_dma_ops = &ccio_ops;
1581 dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL); 1580 dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
1582 1581
1583 /* if this fails, no I/O cards will work, so may as well bug */ 1582 /* if this fails, no I/O cards will work, so may as well bug */
1584 BUG_ON(dev->dev.platform_data == NULL); 1583 BUG_ON(dev->dev.platform_data == NULL);
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 216d1d859326..3d1a7f98c676 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -989,14 +989,12 @@ static int __init dino_probe(struct parisc_device *dev)
989*/ 989*/
990 } 990 }
991 991
992 dino_dev = kmalloc(sizeof(struct dino_device), GFP_KERNEL); 992 dino_dev = kzalloc(sizeof(struct dino_device), GFP_KERNEL);
993 if (!dino_dev) { 993 if (!dino_dev) {
994 printk("dino_init_chip - couldn't alloc dino_device\n"); 994 printk("dino_init_chip - couldn't alloc dino_device\n");
995 return 1; 995 return 1;
996 } 996 }
997 997
998 memset(dino_dev, 0, sizeof(struct dino_device));
999
1000 dino_dev->hba.dev = dev; 998 dino_dev->hba.dev = dev;
1001 dino_dev->hba.base_addr = ioremap(hpa, 4096); 999 dino_dev->hba.base_addr = ioremap(hpa, 4096);
1002 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ 1000 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c
index 5edf93f80757..07dc2b6d4e93 100644
--- a/drivers/parisc/hppb.c
+++ b/drivers/parisc/hppb.c
@@ -60,12 +60,11 @@ static int hppb_probe(struct parisc_device *dev)
60 } 60 }
61 61
62 if(card->hpa) { 62 if(card->hpa) {
63 card->next = kmalloc(sizeof(struct hppb_card), GFP_KERNEL); 63 card->next = kzalloc(sizeof(struct hppb_card), GFP_KERNEL);
64 if(!card->next) { 64 if(!card->next) {
65 printk(KERN_ERR "HP-PB: Unable to allocate memory.\n"); 65 printk(KERN_ERR "HP-PB: Unable to allocate memory.\n");
66 return 1; 66 return 1;
67 } 67 }
68 memset(card->next, '\0', sizeof(struct hppb_card));
69 card = card->next; 68 card = card->next;
70 } 69 }
71 printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa.start); 70 printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa.start);
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 19657efa8dc3..8d7a36392eb8 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -873,28 +873,24 @@ void *iosapic_register(unsigned long hpa)
873 return NULL; 873 return NULL;
874 } 874 }
875 875
876 isi = (struct iosapic_info *)kmalloc(sizeof(struct iosapic_info), GFP_KERNEL); 876 isi = (struct iosapic_info *)kzalloc(sizeof(struct iosapic_info), GFP_KERNEL);
877 if (!isi) { 877 if (!isi) {
878 BUG(); 878 BUG();
879 return NULL; 879 return NULL;
880 } 880 }
881 881
882 memset(isi, 0, sizeof(struct iosapic_info));
883
884 isi->addr = ioremap(hpa, 4096); 882 isi->addr = ioremap(hpa, 4096);
885 isi->isi_hpa = hpa; 883 isi->isi_hpa = hpa;
886 isi->isi_version = iosapic_rd_version(isi); 884 isi->isi_version = iosapic_rd_version(isi);
887 isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; 885 isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;
888 886
889 vip = isi->isi_vector = (struct vector_info *) 887 vip = isi->isi_vector = (struct vector_info *)
890 kmalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL); 888 kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL);
891 if (vip == NULL) { 889 if (vip == NULL) {
892 kfree(isi); 890 kfree(isi);
893 return NULL; 891 return NULL;
894 } 892 }
895 893
896 memset(vip, 0, sizeof(struct vector_info) * isi->isi_num_vectors);
897
898 for (cnt=0; cnt < isi->isi_num_vectors; cnt++, vip++) { 894 for (cnt=0; cnt < isi->isi_num_vectors; cnt++, vip++) {
899 vip->irqline = (unsigned char) cnt; 895 vip->irqline = (unsigned char) cnt;
900 vip->iosapic = isi; 896 vip->iosapic = isi;
diff --git a/drivers/parisc/lasi.c b/drivers/parisc/lasi.c
index 2b3ba1dcf332..cb3d28176129 100644
--- a/drivers/parisc/lasi.c
+++ b/drivers/parisc/lasi.c
@@ -166,11 +166,12 @@ static void lasi_power_off(void)
166int __init 166int __init
167lasi_init_chip(struct parisc_device *dev) 167lasi_init_chip(struct parisc_device *dev)
168{ 168{
169 extern void (*chassis_power_off)(void);
169 struct gsc_asic *lasi; 170 struct gsc_asic *lasi;
170 struct gsc_irq gsc_irq; 171 struct gsc_irq gsc_irq;
171 int ret; 172 int ret;
172 173
173 lasi = kmalloc(sizeof(*lasi), GFP_KERNEL); 174 lasi = kzalloc(sizeof(*lasi), GFP_KERNEL);
174 if (!lasi) 175 if (!lasi)
175 return -ENOMEM; 176 return -ENOMEM;
176 177
@@ -222,7 +223,7 @@ lasi_init_chip(struct parisc_device *dev)
222 * ensure that only the first LASI (the one controlling the power off) 223 * ensure that only the first LASI (the one controlling the power off)
223 * should set the HPA here */ 224 * should set the HPA here */
224 lasi_power_off_hpa = lasi->hpa; 225 lasi_power_off_hpa = lasi->hpa;
225 pm_power_off = lasi_power_off; 226 chassis_power_off = lasi_power_off;
226 227
227 return ret; 228 return ret;
228} 229}
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index cbae8c8963fa..e8a2a4a852f5 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1565,7 +1565,7 @@ lba_driver_probe(struct parisc_device *dev)
1565 } else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) { 1565 } else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) {
1566 func_class &= 0xff; 1566 func_class &= 0xff;
1567 version = kmalloc(6, GFP_KERNEL); 1567 version = kmalloc(6, GFP_KERNEL);
1568 sprintf(version,"TR%d.%d",(func_class >> 4),(func_class & 0xf)); 1568 snprintf(version, 6, "TR%d.%d",(func_class >> 4),(func_class & 0xf));
1569 /* We could use one printk for both Elroy and Mercury, 1569 /* We could use one printk for both Elroy and Mercury,
1570 * but for the mask for func_class. 1570 * but for the mask for func_class.
1571 */ 1571 */
@@ -1586,14 +1586,12 @@ lba_driver_probe(struct parisc_device *dev)
1586 ** have an IRT entry will get NULL back from iosapic code. 1586 ** have an IRT entry will get NULL back from iosapic code.
1587 */ 1587 */
1588 1588
1589 lba_dev = kmalloc(sizeof(struct lba_device), GFP_KERNEL); 1589 lba_dev = kzalloc(sizeof(struct lba_device), GFP_KERNEL);
1590 if (!lba_dev) { 1590 if (!lba_dev) {
1591 printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n"); 1591 printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n");
1592 return(1); 1592 return(1);
1593 } 1593 }
1594 1594
1595 memset(lba_dev, 0, sizeof(struct lba_device));
1596
1597 1595
1598 /* ---------- First : initialize data we already have --------- */ 1596 /* ---------- First : initialize data we already have --------- */
1599 1597
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 42a3c54e8e6c..a28e17898fbd 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Interfaces to retrieve and set PDC Stable options (firmware) 2 * Interfaces to retrieve and set PDC Stable options (firmware)
3 * 3 *
4 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org> 4 * Copyright (C) 2005-2006 Thibaut VARENE <varenet@parisc-linux.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -26,11 +26,19 @@
26 * 26 *
27 * Since locations between 96 and 192 are the various paths, most (if not 27 * Since locations between 96 and 192 are the various paths, most (if not
28 * all) PA-RISC machines should have them. Anyway, for safety reasons, the 28 * all) PA-RISC machines should have them. Anyway, for safety reasons, the
29 * following code can deal with only 96 bytes of Stable Storage, and all 29 * following code can deal with just 96 bytes of Stable Storage, and all
30 * sizes between 96 and 192 bytes (provided they are multiple of struct 30 * sizes between 96 and 192 bytes (provided they are multiple of struct
31 * device_path size, eg: 128, 160 and 192) to provide full information. 31 * device_path size, eg: 128, 160 and 192) to provide full information.
32 * The code makes no use of data above 192 bytes. One last word: there's one 32 * The code makes no use of data above 192 bytes. One last word: there's one
33 * path we can always count on: the primary path. 33 * path we can always count on: the primary path.
34 *
35 * The current policy wrt file permissions is:
36 * - write: root only
37 * - read: (reading triggers PDC calls) ? root only : everyone
38 * The rationale is that PDC calls could hog (DoS) the machine.
39 *
40 * TODO:
41 * - timer/fastsize write calls
34 */ 42 */
35 43
36#undef PDCS_DEBUG 44#undef PDCS_DEBUG
@@ -50,13 +58,15 @@
50#include <linux/kobject.h> 58#include <linux/kobject.h>
51#include <linux/device.h> 59#include <linux/device.h>
52#include <linux/errno.h> 60#include <linux/errno.h>
61#include <linux/spinlock.h>
53 62
54#include <asm/pdc.h> 63#include <asm/pdc.h>
55#include <asm/page.h> 64#include <asm/page.h>
56#include <asm/uaccess.h> 65#include <asm/uaccess.h>
57#include <asm/hardware.h> 66#include <asm/hardware.h>
58 67
59#define PDCS_VERSION "0.10" 68#define PDCS_VERSION "0.22"
69#define PDCS_PREFIX "PDC Stable Storage"
60 70
61#define PDCS_ADDR_PPRI 0x00 71#define PDCS_ADDR_PPRI 0x00
62#define PDCS_ADDR_OSID 0x40 72#define PDCS_ADDR_OSID 0x40
@@ -70,10 +80,12 @@ MODULE_DESCRIPTION("sysfs interface to HP PDC Stable Storage data");
70MODULE_LICENSE("GPL"); 80MODULE_LICENSE("GPL");
71MODULE_VERSION(PDCS_VERSION); 81MODULE_VERSION(PDCS_VERSION);
72 82
83/* holds Stable Storage size. Initialized once and for all, no lock needed */
73static unsigned long pdcs_size __read_mostly; 84static unsigned long pdcs_size __read_mostly;
74 85
75/* This struct defines what we need to deal with a parisc pdc path entry */ 86/* This struct defines what we need to deal with a parisc pdc path entry */
76struct pdcspath_entry { 87struct pdcspath_entry {
88 rwlock_t rw_lock; /* to protect path entry access */
77 short ready; /* entry record is valid if != 0 */ 89 short ready; /* entry record is valid if != 0 */
78 unsigned long addr; /* entry address in stable storage */ 90 unsigned long addr; /* entry address in stable storage */
79 char *name; /* entry name */ 91 char *name; /* entry name */
@@ -121,6 +133,8 @@ struct pdcspath_attribute paths_attr_##_name = { \
121 * content of the stable storage WRT various paths in these structs. We read 133 * content of the stable storage WRT various paths in these structs. We read
122 * these structs when reading the files, and we will write to these structs when 134 * these structs when reading the files, and we will write to these structs when
123 * writing to the files, and only then write them back to the Stable Storage. 135 * writing to the files, and only then write them back to the Stable Storage.
136 *
137 * This function expects to be called with @entry->rw_lock write-hold.
124 */ 138 */
125static int 139static int
126pdcspath_fetch(struct pdcspath_entry *entry) 140pdcspath_fetch(struct pdcspath_entry *entry)
@@ -160,14 +174,15 @@ pdcspath_fetch(struct pdcspath_entry *entry)
160 * pointer, from which it'll find out the corresponding hardware path. 174 * pointer, from which it'll find out the corresponding hardware path.
161 * For now we do not handle the case where there's an error in writing to the 175 * For now we do not handle the case where there's an error in writing to the
162 * Stable Storage area, so you'd better not mess up the data :P 176 * Stable Storage area, so you'd better not mess up the data :P
177 *
178 * This function expects to be called with @entry->rw_lock write-hold.
163 */ 179 */
164static int 180static void
165pdcspath_store(struct pdcspath_entry *entry) 181pdcspath_store(struct pdcspath_entry *entry)
166{ 182{
167 struct device_path *devpath; 183 struct device_path *devpath;
168 184
169 if (!entry) 185 BUG_ON(!entry);
170 return -EINVAL;
171 186
172 devpath = &entry->devpath; 187 devpath = &entry->devpath;
173 188
@@ -176,10 +191,8 @@ pdcspath_store(struct pdcspath_entry *entry)
176 First case, we don't have a preset hwpath... */ 191 First case, we don't have a preset hwpath... */
177 if (!entry->ready) { 192 if (!entry->ready) {
178 /* ...but we have a device, map it */ 193 /* ...but we have a device, map it */
179 if (entry->dev) 194 BUG_ON(!entry->dev);
180 device_to_hwpath(entry->dev, (struct hardware_path *)devpath); 195 device_to_hwpath(entry->dev, (struct hardware_path *)devpath);
181 else
182 return -EINVAL;
183 } 196 }
184 /* else, we expect the provided hwpath to be valid. */ 197 /* else, we expect the provided hwpath to be valid. */
185 198
@@ -191,15 +204,13 @@ pdcspath_store(struct pdcspath_entry *entry)
191 printk(KERN_ERR "%s: an error occured when writing to PDC.\n" 204 printk(KERN_ERR "%s: an error occured when writing to PDC.\n"
192 "It is likely that the Stable Storage data has been corrupted.\n" 205 "It is likely that the Stable Storage data has been corrupted.\n"
193 "Please check it carefully upon next reboot.\n", __func__); 206 "Please check it carefully upon next reboot.\n", __func__);
194 return -EIO; 207 WARN_ON(1);
195 } 208 }
196 209
197 /* kobject is already registered */ 210 /* kobject is already registered */
198 entry->ready = 2; 211 entry->ready = 2;
199 212
200 DPRINTK("%s: device: 0x%p\n", __func__, entry->dev); 213 DPRINTK("%s: device: 0x%p\n", __func__, entry->dev);
201
202 return 0;
203} 214}
204 215
205/** 216/**
@@ -214,14 +225,17 @@ pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
214{ 225{
215 char *out = buf; 226 char *out = buf;
216 struct device_path *devpath; 227 struct device_path *devpath;
217 unsigned short i; 228 short i;
218 229
219 if (!entry || !buf) 230 if (!entry || !buf)
220 return -EINVAL; 231 return -EINVAL;
221 232
233 read_lock(&entry->rw_lock);
222 devpath = &entry->devpath; 234 devpath = &entry->devpath;
235 i = entry->ready;
236 read_unlock(&entry->rw_lock);
223 237
224 if (!entry->ready) 238 if (!i) /* entry is not ready */
225 return -ENODATA; 239 return -ENODATA;
226 240
227 for (i = 0; i < 6; i++) { 241 for (i = 0; i < 6; i++) {
@@ -242,7 +256,7 @@ pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
242 * 256 *
243 * We will call this function to change the current hardware path. 257 * We will call this function to change the current hardware path.
244 * Hardware paths are to be given '/'-delimited, without brackets. 258 * Hardware paths are to be given '/'-delimited, without brackets.
245 * We take care to make sure that the provided path actually maps to an existing 259 * We make sure that the provided path actually maps to an existing
246 * device, BUT nothing would prevent some foolish user to set the path to some 260 * device, BUT nothing would prevent some foolish user to set the path to some
247 * PCI bridge or even a CPU... 261 * PCI bridge or even a CPU...
248 * A better work around would be to make sure we are at the end of a device tree 262 * A better work around would be to make sure we are at the end of a device tree
@@ -298,17 +312,19 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
298 } 312 }
299 313
300 /* So far so good, let's get in deep */ 314 /* So far so good, let's get in deep */
315 write_lock(&entry->rw_lock);
301 entry->ready = 0; 316 entry->ready = 0;
302 entry->dev = dev; 317 entry->dev = dev;
303 318
304 /* Now, dive in. Write back to the hardware */ 319 /* Now, dive in. Write back to the hardware */
305 WARN_ON(pdcspath_store(entry)); /* this warn should *NEVER* happen */ 320 pdcspath_store(entry);
306 321
307 /* Update the symlink to the real device */ 322 /* Update the symlink to the real device */
308 sysfs_remove_link(&entry->kobj, "device"); 323 sysfs_remove_link(&entry->kobj, "device");
309 sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); 324 sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device");
325 write_unlock(&entry->rw_lock);
310 326
311 printk(KERN_INFO "PDC Stable Storage: changed \"%s\" path to \"%s\"\n", 327 printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" path to \"%s\"\n",
312 entry->name, buf); 328 entry->name, buf);
313 329
314 return count; 330 return count;
@@ -326,14 +342,17 @@ pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
326{ 342{
327 char *out = buf; 343 char *out = buf;
328 struct device_path *devpath; 344 struct device_path *devpath;
329 unsigned short i; 345 short i;
330 346
331 if (!entry || !buf) 347 if (!entry || !buf)
332 return -EINVAL; 348 return -EINVAL;
333 349
350 read_lock(&entry->rw_lock);
334 devpath = &entry->devpath; 351 devpath = &entry->devpath;
352 i = entry->ready;
353 read_unlock(&entry->rw_lock);
335 354
336 if (!entry->ready) 355 if (!i) /* entry is not ready */
337 return -ENODATA; 356 return -ENODATA;
338 357
339 for (i = 0; devpath->layers[i] && (likely(i < 6)); i++) 358 for (i = 0; devpath->layers[i] && (likely(i < 6)); i++)
@@ -388,15 +407,17 @@ pdcspath_layer_write(struct pdcspath_entry *entry, const char *buf, size_t count
388 } 407 }
389 408
390 /* So far so good, let's get in deep */ 409 /* So far so good, let's get in deep */
410 write_lock(&entry->rw_lock);
391 411
392 /* First, overwrite the current layers with the new ones, not touching 412 /* First, overwrite the current layers with the new ones, not touching
393 the hardware path. */ 413 the hardware path. */
394 memcpy(&entry->devpath.layers, &layers, sizeof(layers)); 414 memcpy(&entry->devpath.layers, &layers, sizeof(layers));
395 415
396 /* Now, dive in. Write back to the hardware */ 416 /* Now, dive in. Write back to the hardware */
397 WARN_ON(pdcspath_store(entry)); /* this warn should *NEVER* happen */ 417 pdcspath_store(entry);
418 write_unlock(&entry->rw_lock);
398 419
399 printk(KERN_INFO "PDC Stable Storage: changed \"%s\" layers to \"%s\"\n", 420 printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" layers to \"%s\"\n",
400 entry->name, buf); 421 entry->name, buf);
401 422
402 return count; 423 return count;
@@ -415,9 +436,6 @@ pdcspath_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
415 struct pdcspath_attribute *pdcs_attr = to_pdcspath_attribute(attr); 436 struct pdcspath_attribute *pdcs_attr = to_pdcspath_attribute(attr);
416 ssize_t ret = 0; 437 ssize_t ret = 0;
417 438
418 if (!capable(CAP_SYS_ADMIN))
419 return -EACCES;
420
421 if (pdcs_attr->show) 439 if (pdcs_attr->show)
422 ret = pdcs_attr->show(entry, buf); 440 ret = pdcs_attr->show(entry, buf);
423 441
@@ -454,8 +472,8 @@ static struct sysfs_ops pdcspath_attr_ops = {
454}; 472};
455 473
456/* These are the two attributes of any PDC path. */ 474/* These are the two attributes of any PDC path. */
457static PATHS_ATTR(hwpath, 0600, pdcspath_hwpath_read, pdcspath_hwpath_write); 475static PATHS_ATTR(hwpath, 0644, pdcspath_hwpath_read, pdcspath_hwpath_write);
458static PATHS_ATTR(layer, 0600, pdcspath_layer_read, pdcspath_layer_write); 476static PATHS_ATTR(layer, 0644, pdcspath_layer_read, pdcspath_layer_write);
459 477
460static struct attribute *paths_subsys_attrs[] = { 478static struct attribute *paths_subsys_attrs[] = {
461 &paths_attr_hwpath.attr, 479 &paths_attr_hwpath.attr,
@@ -484,36 +502,119 @@ static struct pdcspath_entry *pdcspath_entries[] = {
484 NULL, 502 NULL,
485}; 503};
486 504
505
506/* For more insight of what's going on here, refer to PDC Procedures doc,
507 * Section PDC_STABLE */
508
487/** 509/**
488 * pdcs_info_read - Pretty printing of the remaining useful data. 510 * pdcs_size_read - Stable Storage size output.
489 * @entry: An allocated and populated subsytem struct. We don't use it tho. 511 * @entry: An allocated and populated subsytem struct. We don't use it tho.
490 * @buf: The output buffer to write to. 512 * @buf: The output buffer to write to.
491 *
492 * We will call this function to format the output of the 'info' attribute file.
493 * Please refer to PDC Procedures documentation, section PDC_STABLE to get a
494 * better insight of what we're doing here.
495 */ 513 */
496static ssize_t 514static ssize_t
497pdcs_info_read(struct subsystem *entry, char *buf) 515pdcs_size_read(struct subsystem *entry, char *buf)
498{ 516{
499 char *out = buf; 517 char *out = buf;
500 __u32 result;
501 struct device_path devpath;
502 char *tmpstr = NULL;
503 518
504 if (!entry || !buf) 519 if (!entry || !buf)
505 return -EINVAL; 520 return -EINVAL;
506 521
507 /* show the size of the stable storage */ 522 /* show the size of the stable storage */
508 out += sprintf(out, "Stable Storage size: %ld bytes\n", pdcs_size); 523 out += sprintf(out, "%ld\n", pdcs_size);
509 524
510 /* deal with flags */ 525 return out - buf;
511 if (pdc_stable_read(PDCS_ADDR_PPRI, &devpath, sizeof(devpath)) != PDC_OK) 526}
512 return -EIO; 527
528/**
529 * pdcs_auto_read - Stable Storage autoboot/search flag output.
530 * @entry: An allocated and populated subsytem struct. We don't use it tho.
531 * @buf: The output buffer to write to.
532 * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag
533 */
534static ssize_t
535pdcs_auto_read(struct subsystem *entry, char *buf, int knob)
536{
537 char *out = buf;
538 struct pdcspath_entry *pathentry;
513 539
514 out += sprintf(out, "Autoboot: %s\n", (devpath.flags & PF_AUTOBOOT) ? "On" : "Off"); 540 if (!entry || !buf)
515 out += sprintf(out, "Autosearch: %s\n", (devpath.flags & PF_AUTOSEARCH) ? "On" : "Off"); 541 return -EINVAL;
516 out += sprintf(out, "Timer: %u s\n", (devpath.flags & PF_TIMER) ? (1 << (devpath.flags & PF_TIMER)) : 0); 542
543 /* Current flags are stored in primary boot path entry */
544 pathentry = &pdcspath_entry_primary;
545
546 read_lock(&pathentry->rw_lock);
547 out += sprintf(out, "%s\n", (pathentry->devpath.flags & knob) ?
548 "On" : "Off");
549 read_unlock(&pathentry->rw_lock);
550
551 return out - buf;
552}
553
554/**
555 * pdcs_autoboot_read - Stable Storage autoboot flag output.
556 * @entry: An allocated and populated subsytem struct. We don't use it tho.
557 * @buf: The output buffer to write to.
558 */
559static inline ssize_t
560pdcs_autoboot_read(struct subsystem *entry, char *buf)
561{
562 return pdcs_auto_read(entry, buf, PF_AUTOBOOT);
563}
564
565/**
566 * pdcs_autosearch_read - Stable Storage autoboot flag output.
567 * @entry: An allocated and populated subsytem struct. We don't use it tho.
568 * @buf: The output buffer to write to.
569 */
570static inline ssize_t
571pdcs_autosearch_read(struct subsystem *entry, char *buf)
572{
573 return pdcs_auto_read(entry, buf, PF_AUTOSEARCH);
574}
575
576/**
577 * pdcs_timer_read - Stable Storage timer count output (in seconds).
578 * @entry: An allocated and populated subsytem struct. We don't use it tho.
579 * @buf: The output buffer to write to.
580 *
581 * The value of the timer field correponds to a number of seconds in powers of 2.
582 */
583static ssize_t
584pdcs_timer_read(struct subsystem *entry, char *buf)
585{
586 char *out = buf;
587 struct pdcspath_entry *pathentry;
588
589 if (!entry || !buf)
590 return -EINVAL;
591
592 /* Current flags are stored in primary boot path entry */
593 pathentry = &pdcspath_entry_primary;
594
595 /* print the timer value in seconds */
596 read_lock(&pathentry->rw_lock);
597 out += sprintf(out, "%u\n", (pathentry->devpath.flags & PF_TIMER) ?
598 (1 << (pathentry->devpath.flags & PF_TIMER)) : 0);
599 read_unlock(&pathentry->rw_lock);
600
601 return out - buf;
602}
603
604/**
605 * pdcs_osid_read - Stable Storage OS ID register output.
606 * @entry: An allocated and populated subsytem struct. We don't use it tho.
607 * @buf: The output buffer to write to.
608 */
609static ssize_t
610pdcs_osid_read(struct subsystem *entry, char *buf)
611{
612 char *out = buf;
613 __u32 result;
614 char *tmpstr = NULL;
615
616 if (!entry || !buf)
617 return -EINVAL;
517 618
518 /* get OSID */ 619 /* get OSID */
519 if (pdc_stable_read(PDCS_ADDR_OSID, &result, sizeof(result)) != PDC_OK) 620 if (pdc_stable_read(PDCS_ADDR_OSID, &result, sizeof(result)) != PDC_OK)
@@ -529,13 +630,31 @@ pdcs_info_read(struct subsystem *entry, char *buf)
529 case 0x0005: tmpstr = "Novell Netware dependent data"; break; 630 case 0x0005: tmpstr = "Novell Netware dependent data"; break;
530 default: tmpstr = "Unknown"; break; 631 default: tmpstr = "Unknown"; break;
531 } 632 }
532 out += sprintf(out, "OS ID: %s (0x%.4x)\n", tmpstr, (result >> 16)); 633 out += sprintf(out, "%s (0x%.4x)\n", tmpstr, (result >> 16));
634
635 return out - buf;
636}
637
638/**
639 * pdcs_fastsize_read - Stable Storage FastSize register output.
640 * @entry: An allocated and populated subsytem struct. We don't use it tho.
641 * @buf: The output buffer to write to.
642 *
643 * This register holds the amount of system RAM to be tested during boot sequence.
644 */
645static ssize_t
646pdcs_fastsize_read(struct subsystem *entry, char *buf)
647{
648 char *out = buf;
649 __u32 result;
650
651 if (!entry || !buf)
652 return -EINVAL;
533 653
534 /* get fast-size */ 654 /* get fast-size */
535 if (pdc_stable_read(PDCS_ADDR_FSIZ, &result, sizeof(result)) != PDC_OK) 655 if (pdc_stable_read(PDCS_ADDR_FSIZ, &result, sizeof(result)) != PDC_OK)
536 return -EIO; 656 return -EIO;
537 657
538 out += sprintf(out, "Memory tested: ");
539 if ((result & 0x0F) < 0x0E) 658 if ((result & 0x0F) < 0x0E)
540 out += sprintf(out, "%d kB", (1<<(result & 0x0F))*256); 659 out += sprintf(out, "%d kB", (1<<(result & 0x0F))*256);
541 else 660 else
@@ -546,22 +665,18 @@ pdcs_info_read(struct subsystem *entry, char *buf)
546} 665}
547 666
548/** 667/**
549 * pdcs_info_write - This function handles boot flag modifying. 668 * pdcs_auto_write - This function handles autoboot/search flag modifying.
550 * @entry: An allocated and populated subsytem struct. We don't use it tho. 669 * @entry: An allocated and populated subsytem struct. We don't use it tho.
551 * @buf: The input buffer to read from. 670 * @buf: The input buffer to read from.
552 * @count: The number of bytes to be read. 671 * @count: The number of bytes to be read.
672 * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag
553 * 673 *
554 * We will call this function to change the current boot flags. 674 * We will call this function to change the current autoboot flag.
555 * We expect a precise syntax: 675 * We expect a precise syntax:
556 * \"n n\" (n == 0 or 1) to toggle respectively AutoBoot and AutoSearch 676 * \"n\" (n == 0 or 1) to toggle AutoBoot Off or On
557 *
558 * As of now there is no incentive on my side to provide more "knobs" to that
559 * interface, since modifying the rest of the data is pretty meaningless when
560 * the machine is running and for the expected use of that facility, such as
561 * PALO setting up the boot disk when installing a Linux distribution...
562 */ 677 */
563static ssize_t 678static ssize_t
564pdcs_info_write(struct subsystem *entry, const char *buf, size_t count) 679pdcs_auto_write(struct subsystem *entry, const char *buf, size_t count, int knob)
565{ 680{
566 struct pdcspath_entry *pathentry; 681 struct pdcspath_entry *pathentry;
567 unsigned char flags; 682 unsigned char flags;
@@ -582,7 +697,9 @@ pdcs_info_write(struct subsystem *entry, const char *buf, size_t count)
582 pathentry = &pdcspath_entry_primary; 697 pathentry = &pdcspath_entry_primary;
583 698
584 /* Be nice to the existing flag record */ 699 /* Be nice to the existing flag record */
700 read_lock(&pathentry->rw_lock);
585 flags = pathentry->devpath.flags; 701 flags = pathentry->devpath.flags;
702 read_unlock(&pathentry->rw_lock);
586 703
587 DPRINTK("%s: flags before: 0x%X\n", __func__, flags); 704 DPRINTK("%s: flags before: 0x%X\n", __func__, flags);
588 705
@@ -595,50 +712,85 @@ pdcs_info_write(struct subsystem *entry, const char *buf, size_t count)
595 if ((c != 0) && (c != 1)) 712 if ((c != 0) && (c != 1))
596 goto parse_error; 713 goto parse_error;
597 if (c == 0) 714 if (c == 0)
598 flags &= ~PF_AUTOBOOT; 715 flags &= ~knob;
599 else 716 else
600 flags |= PF_AUTOBOOT; 717 flags |= knob;
601
602 if (*temp++ != ' ')
603 goto parse_error;
604
605 c = *temp++ - '0';
606 if ((c != 0) && (c != 1))
607 goto parse_error;
608 if (c == 0)
609 flags &= ~PF_AUTOSEARCH;
610 else
611 flags |= PF_AUTOSEARCH;
612 718
613 DPRINTK("%s: flags after: 0x%X\n", __func__, flags); 719 DPRINTK("%s: flags after: 0x%X\n", __func__, flags);
614 720
615 /* So far so good, let's get in deep */ 721 /* So far so good, let's get in deep */
722 write_lock(&pathentry->rw_lock);
616 723
617 /* Change the path entry flags first */ 724 /* Change the path entry flags first */
618 pathentry->devpath.flags = flags; 725 pathentry->devpath.flags = flags;
619 726
620 /* Now, dive in. Write back to the hardware */ 727 /* Now, dive in. Write back to the hardware */
621 WARN_ON(pdcspath_store(pathentry)); /* this warn should *NEVER* happen */ 728 pdcspath_store(pathentry);
729 write_unlock(&pathentry->rw_lock);
622 730
623 printk(KERN_INFO "PDC Stable Storage: changed flags to \"%s\"\n", buf); 731 printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" to \"%s\"\n",
732 (knob & PF_AUTOBOOT) ? "autoboot" : "autosearch",
733 (flags & knob) ? "On" : "Off");
624 734
625 return count; 735 return count;
626 736
627parse_error: 737parse_error:
628 printk(KERN_WARNING "%s: Parse error: expect \"n n\" (n == 0 or 1) for AB and AS\n", __func__); 738 printk(KERN_WARNING "%s: Parse error: expect \"n\" (n == 0 or 1)\n", __func__);
629 return -EINVAL; 739 return -EINVAL;
630} 740}
631 741
632/* The last attribute (the 'root' one actually) with all remaining data. */ 742/**
633static PDCS_ATTR(info, 0600, pdcs_info_read, pdcs_info_write); 743 * pdcs_autoboot_write - This function handles autoboot flag modifying.
744 * @entry: An allocated and populated subsytem struct. We don't use it tho.
745 * @buf: The input buffer to read from.
746 * @count: The number of bytes to be read.
747 *
748 * We will call this function to change the current boot flags.
749 * We expect a precise syntax:
750 * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On
751 */
752static inline ssize_t
753pdcs_autoboot_write(struct subsystem *entry, const char *buf, size_t count)
754{
755 return pdcs_auto_write(entry, buf, count, PF_AUTOBOOT);
756}
757
758/**
759 * pdcs_autosearch_write - This function handles autosearch flag modifying.
760 * @entry: An allocated and populated subsytem struct. We don't use it tho.
761 * @buf: The input buffer to read from.
762 * @count: The number of bytes to be read.
763 *
764 * We will call this function to change the current boot flags.
765 * We expect a precise syntax:
766 * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On
767 */
768static inline ssize_t
769pdcs_autosearch_write(struct subsystem *entry, const char *buf, size_t count)
770{
771 return pdcs_auto_write(entry, buf, count, PF_AUTOSEARCH);
772}
773
774/* The remaining attributes. */
775static PDCS_ATTR(size, 0444, pdcs_size_read, NULL);
776static PDCS_ATTR(autoboot, 0644, pdcs_autoboot_read, pdcs_autoboot_write);
777static PDCS_ATTR(autosearch, 0644, pdcs_autosearch_read, pdcs_autosearch_write);
778static PDCS_ATTR(timer, 0444, pdcs_timer_read, NULL);
779static PDCS_ATTR(osid, 0400, pdcs_osid_read, NULL);
780static PDCS_ATTR(fastsize, 0400, pdcs_fastsize_read, NULL);
634 781
635static struct subsys_attribute *pdcs_subsys_attrs[] = { 782static struct subsys_attribute *pdcs_subsys_attrs[] = {
636 &pdcs_attr_info, 783 &pdcs_attr_size,
637 NULL, /* maybe more in the future? */ 784 &pdcs_attr_autoboot,
785 &pdcs_attr_autosearch,
786 &pdcs_attr_timer,
787 &pdcs_attr_osid,
788 &pdcs_attr_fastsize,
789 NULL,
638}; 790};
639 791
640static decl_subsys(paths, &ktype_pdcspath, NULL); 792static decl_subsys(paths, &ktype_pdcspath, NULL);
641static decl_subsys(pdc, NULL, NULL); 793static decl_subsys(stable, NULL, NULL);
642 794
643/** 795/**
644 * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage. 796 * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage.
@@ -656,8 +808,16 @@ pdcs_register_pathentries(void)
656 struct pdcspath_entry *entry; 808 struct pdcspath_entry *entry;
657 int err; 809 int err;
658 810
811 /* Initialize the entries rw_lock before anything else */
812 for (i = 0; (entry = pdcspath_entries[i]); i++)
813 rwlock_init(&entry->rw_lock);
814
659 for (i = 0; (entry = pdcspath_entries[i]); i++) { 815 for (i = 0; (entry = pdcspath_entries[i]); i++) {
660 if (pdcspath_fetch(entry) < 0) 816 write_lock(&entry->rw_lock);
817 err = pdcspath_fetch(entry);
818 write_unlock(&entry->rw_lock);
819
820 if (err < 0)
661 continue; 821 continue;
662 822
663 if ((err = kobject_set_name(&entry->kobj, "%s", entry->name))) 823 if ((err = kobject_set_name(&entry->kobj, "%s", entry->name)))
@@ -667,13 +827,14 @@ pdcs_register_pathentries(void)
667 return err; 827 return err;
668 828
669 /* kobject is now registered */ 829 /* kobject is now registered */
830 write_lock(&entry->rw_lock);
670 entry->ready = 2; 831 entry->ready = 2;
671 832
672 if (!entry->dev)
673 continue;
674
675 /* Add a nice symlink to the real device */ 833 /* Add a nice symlink to the real device */
676 sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); 834 if (entry->dev)
835 sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device");
836
837 write_unlock(&entry->rw_lock);
677 } 838 }
678 839
679 return 0; 840 return 0;
@@ -688,14 +849,17 @@ pdcs_unregister_pathentries(void)
688 unsigned short i; 849 unsigned short i;
689 struct pdcspath_entry *entry; 850 struct pdcspath_entry *entry;
690 851
691 for (i = 0; (entry = pdcspath_entries[i]); i++) 852 for (i = 0; (entry = pdcspath_entries[i]); i++) {
853 read_lock(&entry->rw_lock);
692 if (entry->ready >= 2) 854 if (entry->ready >= 2)
693 kobject_unregister(&entry->kobj); 855 kobject_unregister(&entry->kobj);
856 read_unlock(&entry->rw_lock);
857 }
694} 858}
695 859
696/* 860/*
697 * For now we register the pdc subsystem with the firmware subsystem 861 * For now we register the stable subsystem with the firmware subsystem
698 * and the paths subsystem with the pdc subsystem 862 * and the paths subsystem with the stable subsystem
699 */ 863 */
700static int __init 864static int __init
701pdc_stable_init(void) 865pdc_stable_init(void)
@@ -707,19 +871,23 @@ pdc_stable_init(void)
707 if (pdc_stable_get_size(&pdcs_size) != PDC_OK) 871 if (pdc_stable_get_size(&pdcs_size) != PDC_OK)
708 return -ENODEV; 872 return -ENODEV;
709 873
710 printk(KERN_INFO "PDC Stable Storage facility v%s\n", PDCS_VERSION); 874 /* make sure we have enough data */
875 if (pdcs_size < 96)
876 return -ENODATA;
877
878 printk(KERN_INFO PDCS_PREFIX " facility v%s\n", PDCS_VERSION);
711 879
712 /* For now we'll register the pdc subsys within this driver */ 880 /* For now we'll register the stable subsys within this driver */
713 if ((rc = firmware_register(&pdc_subsys))) 881 if ((rc = firmware_register(&stable_subsys)))
714 goto fail_firmreg; 882 goto fail_firmreg;
715 883
716 /* Don't forget the info entry */ 884 /* Don't forget the root entries */
717 for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++) 885 for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++)
718 if (attr->show) 886 if (attr->show)
719 error = subsys_create_file(&pdc_subsys, attr); 887 error = subsys_create_file(&stable_subsys, attr);
720 888
721 /* register the paths subsys as a subsystem of pdc subsys */ 889 /* register the paths subsys as a subsystem of stable subsys */
722 kset_set_kset_s(&paths_subsys, pdc_subsys); 890 kset_set_kset_s(&paths_subsys, stable_subsys);
723 if ((rc= subsystem_register(&paths_subsys))) 891 if ((rc= subsystem_register(&paths_subsys)))
724 goto fail_subsysreg; 892 goto fail_subsysreg;
725 893
@@ -734,10 +902,10 @@ fail_pdcsreg:
734 subsystem_unregister(&paths_subsys); 902 subsystem_unregister(&paths_subsys);
735 903
736fail_subsysreg: 904fail_subsysreg:
737 firmware_unregister(&pdc_subsys); 905 firmware_unregister(&stable_subsys);
738 906
739fail_firmreg: 907fail_firmreg:
740 printk(KERN_INFO "PDC Stable Storage bailing out\n"); 908 printk(KERN_INFO PDCS_PREFIX " bailing out\n");
741 return rc; 909 return rc;
742} 910}
743 911
@@ -747,7 +915,7 @@ pdc_stable_exit(void)
747 pdcs_unregister_pathentries(); 915 pdcs_unregister_pathentries();
748 subsystem_unregister(&paths_subsys); 916 subsystem_unregister(&paths_subsys);
749 917
750 firmware_unregister(&pdc_subsys); 918 firmware_unregister(&stable_subsys);
751} 919}
752 920
753 921
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index c85653f315aa..52f265e97729 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -2064,14 +2064,13 @@ sba_driver_callback(struct parisc_device *dev)
2064 printk(KERN_INFO "%s found %s at 0x%lx\n", 2064 printk(KERN_INFO "%s found %s at 0x%lx\n",
2065 MODULE_NAME, version, dev->hpa.start); 2065 MODULE_NAME, version, dev->hpa.start);
2066 2066
2067 sba_dev = kmalloc(sizeof(struct sba_device), GFP_KERNEL); 2067 sba_dev = kzalloc(sizeof(struct sba_device), GFP_KERNEL);
2068 if (!sba_dev) { 2068 if (!sba_dev) {
2069 printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n"); 2069 printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n");
2070 return -ENOMEM; 2070 return -ENOMEM;
2071 } 2071 }
2072 2072
2073 parisc_set_drvdata(dev, sba_dev); 2073 parisc_set_drvdata(dev, sba_dev);
2074 memset(sba_dev, 0, sizeof(struct sba_device));
2075 2074
2076 for(i=0; i<MAX_IOC; i++) 2075 for(i=0; i<MAX_IOC; i++)
2077 spin_lock_init(&(sba_dev->ioc[i].res_lock)); 2076 spin_lock_init(&(sba_dev->ioc[i].res_lock));
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index d14888e149bb..ba971fecd0d8 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -89,6 +89,9 @@ static struct superio_device sio_dev;
89#define DBG_INIT(x...) 89#define DBG_INIT(x...)
90#endif 90#endif
91 91
92#define SUPERIO "SuperIO"
93#define PFX SUPERIO ": "
94
92static irqreturn_t 95static irqreturn_t
93superio_interrupt(int parent_irq, void *devp, struct pt_regs *regs) 96superio_interrupt(int parent_irq, void *devp, struct pt_regs *regs)
94{ 97{
@@ -117,7 +120,7 @@ superio_interrupt(int parent_irq, void *devp, struct pt_regs *regs)
117 local_irq = results & 0x0f; 120 local_irq = results & 0x0f;
118 121
119 if (local_irq == 2 || local_irq > 7) { 122 if (local_irq == 2 || local_irq > 7) {
120 printk(KERN_ERR "SuperIO: slave interrupted!\n"); 123 printk(KERN_ERR PFX "slave interrupted!\n");
121 return IRQ_HANDLED; 124 return IRQ_HANDLED;
122 } 125 }
123 126
@@ -128,7 +131,7 @@ superio_interrupt(int parent_irq, void *devp, struct pt_regs *regs)
128 outb(OCW3_ISR,IC_PIC1+0); 131 outb(OCW3_ISR,IC_PIC1+0);
129 results = inb(IC_PIC1+0); 132 results = inb(IC_PIC1+0);
130 if ((results & 0x80) == 0) { /* if ISR7 not set: spurious */ 133 if ((results & 0x80) == 0) { /* if ISR7 not set: spurious */
131 printk(KERN_WARNING "SuperIO: spurious interrupt!\n"); 134 printk(KERN_WARNING PFX "spurious interrupt!\n");
132 return IRQ_HANDLED; 135 return IRQ_HANDLED;
133 } 136 }
134 } 137 }
@@ -163,27 +166,27 @@ superio_init(struct pci_dev *pcidev)
163 /* ...then properly fixup the USB to point at suckyio PIC */ 166 /* ...then properly fixup the USB to point at suckyio PIC */
164 sio->usb_pdev->irq = superio_fixup_irq(sio->usb_pdev); 167 sio->usb_pdev->irq = superio_fixup_irq(sio->usb_pdev);
165 168
166 printk(KERN_INFO "SuperIO: Found NS87560 Legacy I/O device at %s (IRQ %i) \n", 169 printk(KERN_INFO PFX "Found NS87560 Legacy I/O device at %s (IRQ %i) \n",
167 pci_name(pdev), pdev->irq); 170 pci_name(pdev), pdev->irq);
168 171
169 pci_read_config_dword (pdev, SIO_SP1BAR, &sio->sp1_base); 172 pci_read_config_dword (pdev, SIO_SP1BAR, &sio->sp1_base);
170 sio->sp1_base &= ~1; 173 sio->sp1_base &= ~1;
171 printk (KERN_INFO "SuperIO: Serial port 1 at 0x%x\n", sio->sp1_base); 174 printk(KERN_INFO PFX "Serial port 1 at 0x%x\n", sio->sp1_base);
172 175
173 pci_read_config_dword (pdev, SIO_SP2BAR, &sio->sp2_base); 176 pci_read_config_dword (pdev, SIO_SP2BAR, &sio->sp2_base);
174 sio->sp2_base &= ~1; 177 sio->sp2_base &= ~1;
175 printk (KERN_INFO "SuperIO: Serial port 2 at 0x%x\n", sio->sp2_base); 178 printk(KERN_INFO PFX "Serial port 2 at 0x%x\n", sio->sp2_base);
176 179
177 pci_read_config_dword (pdev, SIO_PPBAR, &sio->pp_base); 180 pci_read_config_dword (pdev, SIO_PPBAR, &sio->pp_base);
178 sio->pp_base &= ~1; 181 sio->pp_base &= ~1;
179 printk (KERN_INFO "SuperIO: Parallel port at 0x%x\n", sio->pp_base); 182 printk(KERN_INFO PFX "Parallel port at 0x%x\n", sio->pp_base);
180 183
181 pci_read_config_dword (pdev, SIO_FDCBAR, &sio->fdc_base); 184 pci_read_config_dword (pdev, SIO_FDCBAR, &sio->fdc_base);
182 sio->fdc_base &= ~1; 185 sio->fdc_base &= ~1;
183 printk (KERN_INFO "SuperIO: Floppy controller at 0x%x\n", sio->fdc_base); 186 printk(KERN_INFO PFX "Floppy controller at 0x%x\n", sio->fdc_base);
184 pci_read_config_dword (pdev, SIO_ACPIBAR, &sio->acpi_base); 187 pci_read_config_dword (pdev, SIO_ACPIBAR, &sio->acpi_base);
185 sio->acpi_base &= ~1; 188 sio->acpi_base &= ~1;
186 printk (KERN_INFO "SuperIO: ACPI at 0x%x\n", sio->acpi_base); 189 printk(KERN_INFO PFX "ACPI at 0x%x\n", sio->acpi_base);
187 190
188 request_region (IC_PIC1, 0x1f, "pic1"); 191 request_region (IC_PIC1, 0x1f, "pic1");
189 request_region (IC_PIC2, 0x1f, "pic2"); 192 request_region (IC_PIC2, 0x1f, "pic2");
@@ -263,14 +266,14 @@ superio_init(struct pci_dev *pcidev)
263 /* Setup USB power regulation */ 266 /* Setup USB power regulation */
264 outb(1, sio->acpi_base + USB_REG_CR); 267 outb(1, sio->acpi_base + USB_REG_CR);
265 if (inb(sio->acpi_base + USB_REG_CR) & 1) 268 if (inb(sio->acpi_base + USB_REG_CR) & 1)
266 printk(KERN_INFO "SuperIO: USB regulator enabled\n"); 269 printk(KERN_INFO PFX "USB regulator enabled\n");
267 else 270 else
268 printk(KERN_ERR "USB regulator not initialized!\n"); 271 printk(KERN_ERR PFX "USB regulator not initialized!\n");
269 272
270 if (request_irq(pdev->irq, superio_interrupt, SA_INTERRUPT, 273 if (request_irq(pdev->irq, superio_interrupt, SA_INTERRUPT,
271 "SuperIO", (void *)sio)) { 274 SUPERIO, (void *)sio)) {
272 275
273 printk(KERN_ERR "SuperIO: could not get irq\n"); 276 printk(KERN_ERR PFX "could not get irq\n");
274 BUG(); 277 BUG();
275 return; 278 return;
276 } 279 }
@@ -284,7 +287,7 @@ static void superio_disable_irq(unsigned int irq)
284 u8 r8; 287 u8 r8;
285 288
286 if ((irq < 1) || (irq == 2) || (irq > 7)) { 289 if ((irq < 1) || (irq == 2) || (irq > 7)) {
287 printk(KERN_ERR "SuperIO: Illegal irq number.\n"); 290 printk(KERN_ERR PFX "Illegal irq number.\n");
288 BUG(); 291 BUG();
289 return; 292 return;
290 } 293 }
@@ -301,7 +304,7 @@ static void superio_enable_irq(unsigned int irq)
301 u8 r8; 304 u8 r8;
302 305
303 if ((irq < 1) || (irq == 2) || (irq > 7)) { 306 if ((irq < 1) || (irq == 2) || (irq > 7)) {
304 printk(KERN_ERR "SuperIO: Illegal irq number (%d).\n", irq); 307 printk(KERN_ERR PFX "Illegal irq number (%d).\n", irq);
305 BUG(); 308 BUG();
306 return; 309 return;
307 } 310 }
@@ -319,7 +322,7 @@ static unsigned int superio_startup_irq(unsigned int irq)
319} 322}
320 323
321static struct hw_interrupt_type superio_interrupt_type = { 324static struct hw_interrupt_type superio_interrupt_type = {
322 .typename = "SuperIO", 325 .typename = SUPERIO,
323 .startup = superio_startup_irq, 326 .startup = superio_startup_irq,
324 .shutdown = superio_disable_irq, 327 .shutdown = superio_disable_irq,
325 .enable = superio_enable_irq, 328 .enable = superio_enable_irq,
@@ -413,7 +416,7 @@ static void __devinit superio_serial_init(void)
413 416
414 retval = early_serial_setup(&serial[0]); 417 retval = early_serial_setup(&serial[0]);
415 if (retval < 0) { 418 if (retval < 0) {
416 printk(KERN_WARNING "SuperIO: Register Serial #0 failed.\n"); 419 printk(KERN_WARNING PFX "Register Serial #0 failed.\n");
417 return; 420 return;
418 } 421 }
419 422
@@ -423,7 +426,7 @@ static void __devinit superio_serial_init(void)
423 retval = early_serial_setup(&serial[1]); 426 retval = early_serial_setup(&serial[1]);
424 427
425 if (retval < 0) 428 if (retval < 0)
426 printk(KERN_WARNING "SuperIO: Register Serial #1 failed.\n"); 429 printk(KERN_WARNING PFX "Register Serial #1 failed.\n");
427#endif /* CONFIG_SERIAL_8250 */ 430#endif /* CONFIG_SERIAL_8250 */
428} 431}
429 432
@@ -437,7 +440,7 @@ static void __devinit superio_parport_init(void)
437 PARPORT_DMA_NONE /* dma */, 440 PARPORT_DMA_NONE /* dma */,
438 NULL /*struct pci_dev* */) ) 441 NULL /*struct pci_dev* */) )
439 442
440 printk(KERN_WARNING "SuperIO: Probing parallel port failed.\n"); 443 printk(KERN_WARNING PFX "Probing parallel port failed.\n");
441#endif /* CONFIG_PARPORT_PC */ 444#endif /* CONFIG_PARPORT_PC */
442} 445}
443 446
@@ -499,7 +502,7 @@ static struct pci_device_id superio_tbl[] = {
499}; 502};
500 503
501static struct pci_driver superio_driver = { 504static struct pci_driver superio_driver = {
502 .name = "SuperIO", 505 .name = SUPERIO,
503 .id_table = superio_tbl, 506 .id_table = superio_tbl,
504 .probe = superio_probe, 507 .probe = superio_probe,
505}; 508};
diff --git a/drivers/parisc/wax.c b/drivers/parisc/wax.c
index 17dce2adf7fe..813c2c24ab1e 100644
--- a/drivers/parisc/wax.c
+++ b/drivers/parisc/wax.c
@@ -76,7 +76,7 @@ wax_init_chip(struct parisc_device *dev)
76 struct gsc_irq gsc_irq; 76 struct gsc_irq gsc_irq;
77 int ret; 77 int ret;
78 78
79 wax = kmalloc(sizeof(*wax), GFP_KERNEL); 79 wax = kzalloc(sizeof(*wax), GFP_KERNEL);
80 if (!wax) 80 if (!wax)
81 return -ENOMEM; 81 return -ENOMEM;
82 82
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
index fde29a75f888..1de52d9febf9 100644
--- a/drivers/parport/parport_gsc.c
+++ b/drivers/parport/parport_gsc.c
@@ -249,7 +249,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
249 struct parport tmp; 249 struct parport tmp;
250 struct parport *p = &tmp; 250 struct parport *p = &tmp;
251 251
252 priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); 252 priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL);
253 if (!priv) { 253 if (!priv) {
254 printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); 254 printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base);
255 return NULL; 255 return NULL;
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index a7bcd17112c0..0339f5640a78 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -30,10 +30,11 @@
30 30
31#define STI_DRIVERVERSION "Version 0.9a" 31#define STI_DRIVERVERSION "Version 0.9a"
32 32
33struct sti_struct *default_sti; 33struct sti_struct *default_sti __read_mostly;
34 34
35static int num_sti_roms; /* # of STI ROMS found */ 35/* number of STI ROMS found and their ptrs to each struct */
36static struct sti_struct *sti_roms[MAX_STI_ROMS]; /* ptr to each sti_struct */ 36static int num_sti_roms __read_mostly;
37static struct sti_struct *sti_roms[MAX_STI_ROMS] __read_mostly;
37 38
38 39
39/* The colour indices used by STI are 40/* The colour indices used by STI are
@@ -266,7 +267,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest)
266 267
267 268
268 269
269static char default_sti_path[21]; 270static char default_sti_path[21] __read_mostly;
270 271
271#ifndef MODULE 272#ifndef MODULE
272static int __init sti_setup(char *str) 273static int __init sti_setup(char *str)
@@ -414,10 +415,10 @@ sti_init_glob_cfg(struct sti_struct *sti,
414 if (!sti->sti_mem_request) 415 if (!sti->sti_mem_request)
415 sti->sti_mem_request = 256; /* STI default */ 416 sti->sti_mem_request = 256; /* STI default */
416 417
417 glob_cfg = kmalloc(sizeof(*sti->glob_cfg), GFP_KERNEL); 418 glob_cfg = kzalloc(sizeof(*sti->glob_cfg), GFP_KERNEL);
418 glob_cfg_ext = kmalloc(sizeof(*glob_cfg_ext), GFP_KERNEL); 419 glob_cfg_ext = kzalloc(sizeof(*glob_cfg_ext), GFP_KERNEL);
419 save_addr = kmalloc(save_addr_size, GFP_KERNEL); 420 save_addr = kzalloc(save_addr_size, GFP_KERNEL);
420 sti_mem_addr = kmalloc(sti->sti_mem_request, GFP_KERNEL); 421 sti_mem_addr = kzalloc(sti->sti_mem_request, GFP_KERNEL);
421 422
422 if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) { 423 if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) {
423 kfree(glob_cfg); 424 kfree(glob_cfg);
@@ -427,11 +428,6 @@ sti_init_glob_cfg(struct sti_struct *sti,
427 return -ENOMEM; 428 return -ENOMEM;
428 } 429 }
429 430
430 memset(glob_cfg, 0, sizeof(*glob_cfg));
431 memset(glob_cfg_ext, 0, sizeof(*glob_cfg_ext));
432 memset(save_addr, 0, save_addr_size);
433 memset(sti_mem_addr, 0, sti->sti_mem_request);
434
435 glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext); 431 glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext);
436 glob_cfg->save_addr = STI_PTR(save_addr); 432 glob_cfg->save_addr = STI_PTR(save_addr);
437 for (i=0; i<8; i++) { 433 for (i=0; i<8; i++) {
@@ -502,9 +498,9 @@ sti_init_glob_cfg(struct sti_struct *sti,
502 498
503#ifdef CONFIG_FB 499#ifdef CONFIG_FB
504struct sti_cooked_font * __init 500struct sti_cooked_font * __init
505sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) 501sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
506{ 502{
507 struct font_desc *fbfont; 503 const struct font_desc *fbfont;
508 unsigned int size, bpc; 504 unsigned int size, bpc;
509 void *dest; 505 void *dest;
510 struct sti_rom_font *nf; 506 struct sti_rom_font *nf;
@@ -525,10 +521,9 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
525 size = bpc * 256; 521 size = bpc * 256;
526 size += sizeof(struct sti_rom_font); 522 size += sizeof(struct sti_rom_font);
527 523
528 nf = kmalloc(size, GFP_KERNEL); 524 nf = kzalloc(size, GFP_KERNEL);
529 if (!nf) 525 if (!nf)
530 return NULL; 526 return NULL;
531 memset(nf, 0, size);
532 527
533 nf->first_char = 0; 528 nf->first_char = 0;
534 nf->last_char = 255; 529 nf->last_char = 255;
@@ -544,7 +539,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
544 dest += sizeof(struct sti_rom_font); 539 dest += sizeof(struct sti_rom_font);
545 memcpy(dest, fbfont->data, bpc*256); 540 memcpy(dest, fbfont->data, bpc*256);
546 541
547 cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); 542 cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
548 if (!cooked_font) { 543 if (!cooked_font) {
549 kfree(nf); 544 kfree(nf);
550 return NULL; 545 return NULL;
@@ -559,7 +554,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
559} 554}
560#else 555#else
561struct sti_cooked_font * __init 556struct sti_cooked_font * __init
562sti_select_fbfont(struct sti_cooked_rom *cooked_rom, char *fbfont_name) 557sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
563{ 558{
564 return NULL; 559 return NULL;
565} 560}
@@ -617,7 +612,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
617 struct sti_rom_font *raw_font, *font_start; 612 struct sti_rom_font *raw_font, *font_start;
618 struct sti_cooked_font *cooked_font; 613 struct sti_cooked_font *cooked_font;
619 614
620 cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); 615 cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
621 if (!cooked_font) 616 if (!cooked_font)
622 return 0; 617 return 0;
623 618
@@ -631,7 +626,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
631 while (raw_font->next_font) { 626 while (raw_font->next_font) {
632 raw_font = ((void *)font_start) + (raw_font->next_font); 627 raw_font = ((void *)font_start) + (raw_font->next_font);
633 628
634 cooked_font->next_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); 629 cooked_font->next_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
635 if (!cooked_font->next_font) 630 if (!cooked_font->next_font)
636 return 1; 631 return 1;
637 632
@@ -668,10 +663,9 @@ sti_bmode_font_raw(struct sti_cooked_font *f)
668 unsigned char *n, *p, *q; 663 unsigned char *n, *p, *q;
669 int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font); 664 int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font);
670 665
671 n = kmalloc (4*size, GFP_KERNEL); 666 n = kzalloc (4*size, GFP_KERNEL);
672 if (!n) 667 if (!n)
673 return NULL; 668 return NULL;
674 memset (n, 0, 4*size);
675 p = n + 3; 669 p = n + 3;
676 q = (unsigned char *)f->raw; 670 q = (unsigned char *)f->raw;
677 while (size--) { 671 while (size--) {
@@ -816,13 +810,12 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd
816 return NULL; 810 return NULL;
817 } 811 }
818 812
819 sti = kmalloc(sizeof(*sti), GFP_KERNEL); 813 sti = kzalloc(sizeof(*sti), GFP_KERNEL);
820 if (!sti) { 814 if (!sti) {
821 printk(KERN_ERR "Not enough memory !\n"); 815 printk(KERN_ERR "Not enough memory !\n");
822 return NULL; 816 return NULL;
823 } 817 }
824 818
825 memset(sti, 0, sizeof(*sti));
826 spin_lock_init(&sti->lock); 819 spin_lock_init(&sti->lock);
827 820
828test_rom: 821test_rom:
@@ -1035,7 +1028,7 @@ static struct parisc_driver pa_sti_driver = {
1035 * sti_init_roms() - detects all STI ROMs and stores them in sti_roms[] 1028 * sti_init_roms() - detects all STI ROMs and stores them in sti_roms[]
1036 */ 1029 */
1037 1030
1038static int sticore_initialized; 1031static int sticore_initialized __read_mostly;
1039 1032
1040static void __init sti_init_roms(void) 1033static void __init sti_init_roms(void)
1041{ 1034{
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h
index 2ca56d34aaad..4dc7253ff5d0 100644
--- a/include/asm-parisc/atomic.h
+++ b/include/asm-parisc/atomic.h
@@ -1,9 +1,13 @@
1/* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
2 * Copyright (C) 2006 Kyle McMartin <kyle@parisc-linux.org>
3 */
4
1#ifndef _ASM_PARISC_ATOMIC_H_ 5#ifndef _ASM_PARISC_ATOMIC_H_
2#define _ASM_PARISC_ATOMIC_H_ 6#define _ASM_PARISC_ATOMIC_H_
3 7
4#include <linux/config.h> 8#include <linux/config.h>
9#include <linux/types.h>
5#include <asm/system.h> 10#include <asm/system.h>
6/* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>. */
7 11
8/* 12/*
9 * Atomic operations that C can't guarantee us. Useful for 13 * Atomic operations that C can't guarantee us. Useful for
@@ -46,15 +50,6 @@ extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
46# define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0) 50# define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
47#endif 51#endif
48 52
49/* Note that we need not lock read accesses - aligned word writes/reads
50 * are atomic, so a reader never sees unconsistent values.
51 *
52 * Cache-line alignment would conflict with, for example, linux/module.h
53 */
54
55typedef struct { volatile int counter; } atomic_t;
56
57
58/* This should get optimized out since it's never called. 53/* This should get optimized out since it's never called.
59** Or get a link error if xchg is used "wrong". 54** Or get a link error if xchg is used "wrong".
60*/ 55*/
@@ -69,10 +64,9 @@ extern unsigned long __xchg64(unsigned long, unsigned long *);
69#endif 64#endif
70 65
71/* optimizer better get rid of switch since size is a constant */ 66/* optimizer better get rid of switch since size is a constant */
72static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, 67static __inline__ unsigned long
73 int size) 68__xchg(unsigned long x, __volatile__ void * ptr, int size)
74{ 69{
75
76 switch(size) { 70 switch(size) {
77#ifdef __LP64__ 71#ifdef __LP64__
78 case 8: return __xchg64(x,(unsigned long *) ptr); 72 case 8: return __xchg64(x,(unsigned long *) ptr);
@@ -129,7 +123,13 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
129 (unsigned long)_n_, sizeof(*(ptr))); \ 123 (unsigned long)_n_, sizeof(*(ptr))); \
130 }) 124 })
131 125
126/* Note that we need not lock read accesses - aligned word writes/reads
127 * are atomic, so a reader never sees unconsistent values.
128 *
129 * Cache-line alignment would conflict with, for example, linux/module.h
130 */
132 131
132typedef struct { volatile int counter; } atomic_t;
133 133
134/* It's possible to reduce all atomic operations to either 134/* It's possible to reduce all atomic operations to either
135 * __atomic_add_return, atomic_set and atomic_read (the latter 135 * __atomic_add_return, atomic_set and atomic_read (the latter
@@ -210,12 +210,66 @@ static __inline__ int atomic_read(const atomic_t *v)
210 210
211#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) 211#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
212 212
213#define ATOMIC_INIT(i) { (i) } 213#define ATOMIC_INIT(i) ((atomic_t) { (i) })
214 214
215#define smp_mb__before_atomic_dec() smp_mb() 215#define smp_mb__before_atomic_dec() smp_mb()
216#define smp_mb__after_atomic_dec() smp_mb() 216#define smp_mb__after_atomic_dec() smp_mb()
217#define smp_mb__before_atomic_inc() smp_mb() 217#define smp_mb__before_atomic_inc() smp_mb()
218#define smp_mb__after_atomic_inc() smp_mb() 218#define smp_mb__after_atomic_inc() smp_mb()
219 219
220#ifdef __LP64__
221
222typedef struct { volatile s64 counter; } atomic64_t;
223
224#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
225
226static __inline__ int
227__atomic64_add_return(s64 i, atomic64_t *v)
228{
229 int ret;
230 unsigned long flags;
231 _atomic_spin_lock_irqsave(v, flags);
232
233 ret = (v->counter += i);
234
235 _atomic_spin_unlock_irqrestore(v, flags);
236 return ret;
237}
238
239static __inline__ void
240atomic64_set(atomic64_t *v, s64 i)
241{
242 unsigned long flags;
243 _atomic_spin_lock_irqsave(v, flags);
244
245 v->counter = i;
246
247 _atomic_spin_unlock_irqrestore(v, flags);
248}
249
250static __inline__ s64
251atomic64_read(const atomic64_t *v)
252{
253 return v->counter;
254}
255
256#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v))))
257#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v))))
258#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v))))
259#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v))))
260
261#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v)))
262#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v)))
263#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v)))
264#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v)))
265
266#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
267
268#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
269#define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0)
270
271#endif /* __LP64__ */
272
220#include <asm-generic/atomic.h> 273#include <asm-generic/atomic.h>
221#endif 274
275#endif /* _ASM_PARISC_ATOMIC_H_ */
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index 1bc3c83ee74b..c53af9ff41b5 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -183,4 +183,10 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
183 __flush_cache_page(vma, vmaddr); 183 __flush_cache_page(vma, vmaddr);
184 184
185} 185}
186
187#ifdef CONFIG_DEBUG_RODATA
188void mark_rodata_ro(void);
186#endif 189#endif
190
191#endif /* _PARISC_CACHEFLUSH_H */
192
diff --git a/include/asm-parisc/compat_ucontext.h b/include/asm-parisc/compat_ucontext.h
index a1228a3d2071..2f7292afde3c 100644
--- a/include/asm-parisc/compat_ucontext.h
+++ b/include/asm-parisc/compat_ucontext.h
@@ -1,8 +1,7 @@
1#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H 1#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H
2#define _ASM_PARISC_COMPAT_UCONTEXT_H 2#define _ASM_PARISC_COMPAT_UCONTEXT_H
3 3
4#include<linux/compat.h> 4#include <linux/compat.h>
5#include<asm/compat_signal.h>
6 5
7/* 32-bit ucontext as seen from an 64-bit kernel */ 6/* 32-bit ucontext as seen from an 64-bit kernel */
8struct compat_ucontext { 7struct compat_ucontext {
diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h
index 6a910311b56b..671e06042b40 100644
--- a/include/asm-parisc/grfioctl.h
+++ b/include/asm-parisc/grfioctl.h
@@ -58,7 +58,7 @@
58#define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */ 58#define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */
59#define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */ 59#define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */
60#define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */ 60#define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */
61#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti (built-in B132+/B160L) */ 61#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti, A4450A (built-in B132+/B160L) */
62#define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/ 62#define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/
63#define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/ 63#define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/
64#define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */ 64#define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index f277254159b7..fe7f6a2f5aa7 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -18,6 +18,18 @@
18*/ 18*/
19#define PCI_MAX_BUSSES 256 19#define PCI_MAX_BUSSES 256
20 20
21
22/* To be used as: mdelay(pci_post_reset_delay);
23 *
24 * post_reset is the time the kernel should stall to prevent anyone from
25 * accessing the PCI bus once #RESET is de-asserted.
26 * PCI spec somewhere says 1 second but with multi-PCI bus systems,
27 * this makes the boot time much longer than necessary.
28 * 20ms seems to work for all the HP PCI implementations to date.
29 */
30#define pci_post_reset_delay 50
31
32
21/* 33/*
22** pci_hba_data (aka H2P_OBJECT in HP/UX) 34** pci_hba_data (aka H2P_OBJECT in HP/UX)
23** 35**
@@ -83,7 +95,7 @@ static __inline__ int pci_is_lmmio(struct pci_hba_data *hba, unsigned long a)
83 95
84/* 96/*
85** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses. 97** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses.
86** See pcibios.c for more conversions used by Generic PCI code. 98** See pci.c for more conversions used by Generic PCI code.
87** 99**
88** Platform characteristics/firmware guarantee that 100** Platform characteristics/firmware guarantee that
89** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO 101** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO
@@ -191,9 +203,6 @@ struct pci_bios_ops {
191*/ 203*/
192extern struct pci_port_ops *pci_port; 204extern struct pci_port_ops *pci_port;
193extern struct pci_bios_ops *pci_bios; 205extern struct pci_bios_ops *pci_bios;
194extern int pci_post_reset_delay; /* delay after de-asserting #RESET */
195extern int pci_hba_count;
196extern struct pci_hba_data *parisc_pci_hba[];
197 206
198#ifdef CONFIG_PCI 207#ifdef CONFIG_PCI
199extern void pcibios_register_hba(struct pci_hba_data *); 208extern void pcibios_register_hba(struct pci_hba_data *);
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index 6291d6692e5d..3122fad38a1b 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -137,7 +137,6 @@ static inline void pte_free_kernel(pte_t *pte)
137 137
138#define pte_free(page) pte_free_kernel(page_address(page)) 138#define pte_free(page) pte_free_kernel(page_address(page))
139 139
140extern int do_check_pgt_cache(int, int);
141#define check_pgt_cache() do { } while (0) 140#define check_pgt_cache() do { } while (0)
142 141
143#endif 142#endif
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index b4554711c3e7..4e34c6b44059 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -213,7 +213,7 @@ extern void *vmalloc_start;
213#define PAGE_COPY PAGE_EXECREAD 213#define PAGE_COPY PAGE_EXECREAD
214#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED) 214#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED)
215#define PAGE_KERNEL __pgprot(_PAGE_KERNEL) 215#define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
216#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_DIRTY | _PAGE_ACCESSED) 216#define PAGE_KERNEL_RO __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE)
217#define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE) 217#define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE)
218#define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ) 218#define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ)
219#define PAGE_FLUSH __pgprot(_PAGE_FLUSH) 219#define PAGE_FLUSH __pgprot(_PAGE_FLUSH)
diff --git a/include/asm-parisc/rt_sigframe.h b/include/asm-parisc/rt_sigframe.h
index 5623c032b64c..f0dd3b30f6c4 100644
--- a/include/asm-parisc/rt_sigframe.h
+++ b/include/asm-parisc/rt_sigframe.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_PARISC_RT_SIGFRAME_H 1#ifndef _ASM_PARISC_RT_SIGFRAME_H
2#define _ASM_PARISC_RT_SIGFRAME_H 2#define _ASM_PARISC_RT_SIGFRAME_H
3 3
4#ifdef CONFIG_COMPAT
5#include <asm/compat_rt_sigframe.h>
6#endif
7
8#define SIGRETURN_TRAMP 4 4#define SIGRETURN_TRAMP 4
9#define SIGRESTARTBLOCK_TRAMP 5 5#define SIGRESTARTBLOCK_TRAMP 5
10#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP) 6#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 80b7b98c70a1..c56fccbf34ad 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -761,8 +761,27 @@
761#define __NR_keyctl (__NR_Linux + 266) 761#define __NR_keyctl (__NR_Linux + 266)
762#define __NR_ioprio_set (__NR_Linux + 267) 762#define __NR_ioprio_set (__NR_Linux + 267)
763#define __NR_ioprio_get (__NR_Linux + 268) 763#define __NR_ioprio_get (__NR_Linux + 268)
764#define __NR_inotify_init (__NR_Linux + 269)
765#define __NR_inotify_add_watch (__NR_Linux + 270)
766#define __NR_inotify_rm_watch (__NR_Linux + 271)
767#define __NR_migrate_pages (__NR_Linux + 272)
768#define __NR_pselect6 (__NR_Linux + 273)
769#define __NR_ppoll (__NR_Linux + 274)
770#define __NR_openat (__NR_Linux + 275)
771#define __NR_mkdirat (__NR_Linux + 276)
772#define __NR_mknodat (__NR_Linux + 277)
773#define __NR_fchownat (__NR_Linux + 278)
774#define __NR_futimesat (__NR_Linux + 279)
775#define __NR_newfstatat (__NR_Linux + 280)
776#define __NR_unlinkat (__NR_Linux + 281)
777#define __NR_renameat (__NR_Linux + 282)
778#define __NR_linkat (__NR_Linux + 283)
779#define __NR_symlinkat (__NR_Linux + 284)
780#define __NR_readlinkat (__NR_Linux + 285)
781#define __NR_fchmodat (__NR_Linux + 286)
782#define __NR_faccessat (__NR_Linux + 287)
764 783
765#define __NR_Linux_syscalls 269 784#define __NR_Linux_syscalls 288
766 785
767#define HPUX_GATEWAY_ADDR 0xC0000004 786#define HPUX_GATEWAY_ADDR 0xC0000004
768#define LINUX_GATEWAY_ADDR 0x100 787#define LINUX_GATEWAY_ADDR 0x100