aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig1
-rw-r--r--arch/sparc/configs/sparc32_defconfig290
-rw-r--r--arch/sparc/configs/sparc64_defconfig4
-rw-r--r--arch/sparc/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/byteorder.h1
-rw-r--r--arch/sparc/include/asm/compat.h5
-rw-r--r--arch/sparc/include/asm/cpudata_64.h2
-rw-r--r--arch/sparc/include/asm/irq_64.h4
-rw-r--r--arch/sparc/include/asm/kdebug_64.h2
-rw-r--r--arch/sparc/include/asm/nmi.h10
-rw-r--r--arch/sparc/include/asm/oplib_32.h11
-rw-r--r--arch/sparc/include/asm/oplib_64.h10
-rw-r--r--arch/sparc/include/asm/pcr.h46
-rw-r--r--arch/sparc/include/asm/pil.h1
-rw-r--r--arch/sparc/include/asm/seccomp.h6
-rw-r--r--arch/sparc/include/asm/signal.h4
-rw-r--r--arch/sparc/include/asm/topology_64.h4
-rw-r--r--arch/sparc/kernel/Makefile2
-rw-r--r--arch/sparc/kernel/auxio_32.c3
-rw-r--r--arch/sparc/kernel/auxio_64.c2
-rw-r--r--arch/sparc/kernel/central.c2
-rw-r--r--arch/sparc/kernel/chmc.c1
-rw-r--r--arch/sparc/kernel/cpu.c53
-rw-r--r--arch/sparc/kernel/entry.S4
-rw-r--r--arch/sparc/kernel/head_64.S31
-rw-r--r--arch/sparc/kernel/idprom.c3
-rw-r--r--arch/sparc/kernel/ioport.c15
-rw-r--r--arch/sparc/kernel/irq_32.c1
-rw-r--r--arch/sparc/kernel/irq_64.c73
-rw-r--r--arch/sparc/kernel/kernel.h1
-rw-r--r--arch/sparc/kernel/nmi.c225
-rw-r--r--arch/sparc/kernel/pci.c1
-rw-r--r--arch/sparc/kernel/pcic.c6
-rw-r--r--arch/sparc/kernel/pcr.c158
-rw-r--r--arch/sparc/kernel/process_32.c2
-rw-r--r--arch/sparc/kernel/process_64.c7
-rw-r--r--arch/sparc/kernel/psycho_common.c60
-rw-r--r--arch/sparc/kernel/sbus.c1
-rw-r--r--arch/sparc/kernel/setup_32.c3
-rw-r--r--arch/sparc/kernel/setup_64.c5
-rw-r--r--arch/sparc/kernel/sparc_ksyms_32.c225
-rw-r--r--arch/sparc/kernel/sparc_ksyms_64.c252
-rw-r--r--arch/sparc/kernel/sun4d_smp.c4
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c50
-rw-r--r--arch/sparc/kernel/syscalls.S4
-rw-r--r--arch/sparc/kernel/systbls.h3
-rw-r--r--arch/sparc/kernel/systbls_32.S4
-rw-r--r--arch/sparc/kernel/systbls_64.S20
-rw-r--r--arch/sparc/kernel/time_32.c2
-rw-r--r--arch/sparc/kernel/time_64.c4
-rw-r--r--arch/sparc/kernel/traps_32.c1
-rw-r--r--arch/sparc/kernel/traps_64.c19
-rw-r--r--arch/sparc/kernel/ttable.S3
-rw-r--r--arch/sparc/kernel/unaligned_64.c8
-rw-r--r--arch/sparc/lib/GENbzero.S6
-rw-r--r--arch/sparc/lib/GENcopy_from_user.S8
-rw-r--r--arch/sparc/lib/GENcopy_to_user.S8
-rw-r--r--arch/sparc/lib/Makefile4
-rw-r--r--arch/sparc/lib/NG2copy_from_user.S9
-rw-r--r--arch/sparc/lib/NG2copy_to_user.S9
-rw-r--r--arch/sparc/lib/NGbzero.S6
-rw-r--r--arch/sparc/lib/NGcopy_from_user.S9
-rw-r--r--arch/sparc/lib/NGcopy_to_user.S9
-rw-r--r--arch/sparc/lib/PeeCeeI.c8
-rw-r--r--arch/sparc/lib/U1copy_from_user.S8
-rw-r--r--arch/sparc/lib/U1copy_to_user.S8
-rw-r--r--arch/sparc/lib/U3copy_from_user.S6
-rw-r--r--arch/sparc/lib/U3copy_to_user.S8
-rw-r--r--arch/sparc/lib/bzero.S6
-rw-r--r--arch/sparc/lib/copy_in_user.S61
-rw-r--r--arch/sparc/lib/ksyms.c196
-rw-r--r--arch/sparc/lib/user_fixup.c5
-rw-r--r--arch/sparc/mm/fault_64.c44
-rw-r--r--arch/sparc/mm/generic_32.c1
-rw-r--r--arch/sparc/mm/generic_64.c1
-rw-r--r--arch/sparc/mm/highmem.c2
-rw-r--r--arch/sparc/mm/init_32.c6
-rw-r--r--arch/sparc/mm/init_64.c4
-rw-r--r--arch/sparc/oprofile/init.c232
-rw-r--r--arch/sparc/prom/init_32.c4
-rw-r--r--arch/sparc/prom/misc_32.c3
-rw-r--r--arch/sparc/prom/misc_64.c3
-rw-r--r--arch/sparc/prom/ranges.c3
-rw-r--r--arch/sparc/prom/tree_32.c17
-rw-r--r--arch/sparc/prom/tree_64.c18
85 files changed, 1306 insertions, 1066 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index de58c02633b4..c3ea215334f6 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -36,6 +36,7 @@ config SPARC64
36 select HAVE_KRETPROBES 36 select HAVE_KRETPROBES
37 select HAVE_KPROBES 37 select HAVE_KPROBES
38 select HAVE_LMB 38 select HAVE_LMB
39 select HAVE_SYSCALL_WRAPPERS
39 select USE_GENERIC_SMP_HELPERS if SMP 40 select USE_GENERIC_SMP_HELPERS if SMP
40 select RTC_DRV_CMOS 41 select RTC_DRV_CMOS
41 select RTC_DRV_BQ4802 42 select RTC_DRV_BQ4802
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig
index 2e3a149ea0e7..09ab46e4c59d 100644
--- a/arch/sparc/configs/sparc32_defconfig
+++ b/arch/sparc/configs/sparc32_defconfig
@@ -1,15 +1,21 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25 3# Linux kernel version: 2.6.28
4# Tue Apr 29 01:28:58 2008 4# Thu Jan 8 16:45:44 2009
5# 5#
6# CONFIG_64BIT is not set
7CONFIG_SPARC=y
8CONFIG_SPARC32=y
9# CONFIG_SPARC64 is not set
10CONFIG_ARCH_DEFCONFIG="arch/sparc/configs/sparc32_defconfig"
11CONFIG_BITS=32
12CONFIG_AUDIT_ARCH=y
6CONFIG_MMU=y 13CONFIG_MMU=y
7CONFIG_HIGHMEM=y 14CONFIG_HIGHMEM=y
8CONFIG_ZONE_DMA=y 15CONFIG_ZONE_DMA=y
9CONFIG_GENERIC_ISA_DMA=y 16CONFIG_GENERIC_ISA_DMA=y
10CONFIG_ARCH_NO_VIRT_TO_BUS=y 17CONFIG_ARCH_NO_VIRT_TO_BUS=y
11CONFIG_OF=y 18CONFIG_OF=y
12CONFIG_HZ=100
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
14 20
15# 21#
@@ -66,31 +72,30 @@ CONFIG_SIGNALFD=y
66CONFIG_TIMERFD=y 72CONFIG_TIMERFD=y
67CONFIG_EVENTFD=y 73CONFIG_EVENTFD=y
68CONFIG_SHMEM=y 74CONFIG_SHMEM=y
75CONFIG_AIO=y
69CONFIG_VM_EVENT_COUNTERS=y 76CONFIG_VM_EVENT_COUNTERS=y
77CONFIG_PCI_QUIRKS=y
70CONFIG_SLAB=y 78CONFIG_SLAB=y
71# CONFIG_SLUB is not set 79# CONFIG_SLUB is not set
72# CONFIG_SLOB is not set 80# CONFIG_SLOB is not set
73# CONFIG_PROFILING is not set 81# CONFIG_PROFILING is not set
74# CONFIG_MARKERS is not set
75CONFIG_HAVE_OPROFILE=y 82CONFIG_HAVE_OPROFILE=y
76# CONFIG_HAVE_KPROBES is not set 83CONFIG_HAVE_ARCH_TRACEHOOK=y
77# CONFIG_HAVE_KRETPROBES is not set 84# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
78CONFIG_PROC_PAGE_MONITOR=y
79CONFIG_SLABINFO=y 85CONFIG_SLABINFO=y
80CONFIG_RT_MUTEXES=y 86CONFIG_RT_MUTEXES=y
81# CONFIG_TINY_SHMEM is not set
82CONFIG_BASE_SMALL=0 87CONFIG_BASE_SMALL=0
83CONFIG_MODULES=y 88CONFIG_MODULES=y
89# CONFIG_MODULE_FORCE_LOAD is not set
84CONFIG_MODULE_UNLOAD=y 90CONFIG_MODULE_UNLOAD=y
85# CONFIG_MODULE_FORCE_UNLOAD is not set 91# CONFIG_MODULE_FORCE_UNLOAD is not set
86# CONFIG_MODVERSIONS is not set 92# CONFIG_MODVERSIONS is not set
87# CONFIG_MODULE_SRCVERSION_ALL is not set 93# CONFIG_MODULE_SRCVERSION_ALL is not set
88CONFIG_KMOD=y
89CONFIG_BLOCK=y 94CONFIG_BLOCK=y
90# CONFIG_LBD is not set 95# CONFIG_LBD is not set
91# CONFIG_BLK_DEV_IO_TRACE is not set 96# CONFIG_BLK_DEV_IO_TRACE is not set
92# CONFIG_LSF is not set
93# CONFIG_BLK_DEV_BSG is not set 97# CONFIG_BLK_DEV_BSG is not set
98# CONFIG_BLK_DEV_INTEGRITY is not set
94 99
95# 100#
96# IO Schedulers 101# IO Schedulers
@@ -105,59 +110,73 @@ CONFIG_DEFAULT_CFQ=y
105# CONFIG_DEFAULT_NOOP is not set 110# CONFIG_DEFAULT_NOOP is not set
106CONFIG_DEFAULT_IOSCHED="cfq" 111CONFIG_DEFAULT_IOSCHED="cfq"
107CONFIG_CLASSIC_RCU=y 112CONFIG_CLASSIC_RCU=y
113# CONFIG_TREE_RCU is not set
114# CONFIG_PREEMPT_RCU is not set
115# CONFIG_TREE_RCU_TRACE is not set
116# CONFIG_PREEMPT_RCU_TRACE is not set
117# CONFIG_FREEZER is not set
108 118
109# 119#
110# General machine setup 120# Processor type and features
111# 121#
112# CONFIG_SMP is not set 122# CONFIG_SMP is not set
113CONFIG_SPARC=y 123# CONFIG_HZ_100 is not set
114CONFIG_SPARC32=y 124CONFIG_HZ_250=y
115CONFIG_SBUS=y 125# CONFIG_HZ_300 is not set
116CONFIG_SBUSCHAR=y 126# CONFIG_HZ_1000 is not set
117CONFIG_SERIAL_CONSOLE=y 127CONFIG_HZ=250
118CONFIG_SUN_AUXIO=y 128# CONFIG_SCHED_HRTICK is not set
119CONFIG_SUN_IO=y
120CONFIG_RWSEM_GENERIC_SPINLOCK=y 129CONFIG_RWSEM_GENERIC_SPINLOCK=y
121CONFIG_GENERIC_FIND_NEXT_BIT=y 130CONFIG_GENERIC_FIND_NEXT_BIT=y
122CONFIG_GENERIC_HWEIGHT=y 131CONFIG_GENERIC_HWEIGHT=y
123CONFIG_GENERIC_CALIBRATE_DELAY=y 132CONFIG_GENERIC_CALIBRATE_DELAY=y
124CONFIG_ARCH_MAY_HAVE_PC_FDC=y 133CONFIG_ARCH_MAY_HAVE_PC_FDC=y
125# CONFIG_ARCH_HAS_ILOG2_U32 is not set
126# CONFIG_ARCH_HAS_ILOG2_U64 is not set
127CONFIG_EMULATED_CMPXCHG=y 134CONFIG_EMULATED_CMPXCHG=y
128CONFIG_SUN_PM=y
129# CONFIG_SUN4 is not set
130CONFIG_PCI=y
131CONFIG_PCI_SYSCALL=y
132# CONFIG_ARCH_SUPPORTS_MSI is not set
133CONFIG_PCI_LEGACY=y
134# CONFIG_PCI_DEBUG is not set
135# CONFIG_NO_DMA is not set
136CONFIG_SUN_OPENPROMFS=m
137# CONFIG_SPARC_LED is not set
138CONFIG_BINFMT_ELF=y
139CONFIG_BINFMT_MISC=m
140CONFIG_SELECT_MEMORY_MODEL=y 135CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y 136CONFIG_FLATMEM_MANUAL=y
142# CONFIG_DISCONTIGMEM_MANUAL is not set 137# CONFIG_DISCONTIGMEM_MANUAL is not set
143# CONFIG_SPARSEMEM_MANUAL is not set 138# CONFIG_SPARSEMEM_MANUAL is not set
144CONFIG_FLATMEM=y 139CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y 140CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set 141CONFIG_PAGEFLAGS_EXTENDED=y
147# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
148CONFIG_SPLIT_PTLOCK_CPUS=4 142CONFIG_SPLIT_PTLOCK_CPUS=4
149# CONFIG_RESOURCES_64BIT is not set 143# CONFIG_PHYS_ADDR_T_64BIT is not set
150CONFIG_ZONE_DMA_FLAG=1 144CONFIG_ZONE_DMA_FLAG=1
151CONFIG_BOUNCE=y 145CONFIG_BOUNCE=y
146CONFIG_UNEVICTABLE_LRU=y
147CONFIG_SUN_PM=y
148# CONFIG_SPARC_LED is not set
149CONFIG_SERIAL_CONSOLE=y
152 150
153# 151#
154# Networking 152# Bus options (PCI etc.)
155# 153#
154CONFIG_SBUS=y
155CONFIG_SBUSCHAR=y
156CONFIG_PCI=y
157CONFIG_PCI_SYSCALL=y
158# CONFIG_ARCH_SUPPORTS_MSI is not set
159CONFIG_PCI_LEGACY=y
160# CONFIG_PCI_DEBUG is not set
161# CONFIG_PCI_STUB is not set
162# CONFIG_PCCARD is not set
163CONFIG_SUN_OPENPROMFS=m
164CONFIG_SPARC32_PCI=y
165
166#
167# Executable file formats
168#
169CONFIG_BINFMT_ELF=y
170# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
171# CONFIG_HAVE_AOUT is not set
172CONFIG_BINFMT_MISC=m
156CONFIG_NET=y 173CONFIG_NET=y
157 174
158# 175#
159# Networking options 176# Networking options
160# 177#
178# CONFIG_NET_NS is not set
179CONFIG_COMPAT_NET_DEV_OPS=y
161CONFIG_PACKET=y 180CONFIG_PACKET=y
162# CONFIG_PACKET_MMAP is not set 181# CONFIG_PACKET_MMAP is not set
163CONFIG_UNIX=y 182CONFIG_UNIX=y
@@ -166,6 +185,7 @@ CONFIG_XFRM_USER=m
166# CONFIG_XFRM_SUB_POLICY is not set 185# CONFIG_XFRM_SUB_POLICY is not set
167# CONFIG_XFRM_MIGRATE is not set 186# CONFIG_XFRM_MIGRATE is not set
168# CONFIG_XFRM_STATISTICS is not set 187# CONFIG_XFRM_STATISTICS is not set
188CONFIG_XFRM_IPCOMP=y
169CONFIG_NET_KEY=m 189CONFIG_NET_KEY=m
170# CONFIG_NET_KEY_MIGRATE is not set 190# CONFIG_NET_KEY_MIGRATE is not set
171CONFIG_INET=y 191CONFIG_INET=y
@@ -221,6 +241,7 @@ CONFIG_IPV6_TUNNEL=m
221# CONFIG_TIPC is not set 241# CONFIG_TIPC is not set
222# CONFIG_ATM is not set 242# CONFIG_ATM is not set
223# CONFIG_BRIDGE is not set 243# CONFIG_BRIDGE is not set
244# CONFIG_NET_DSA is not set
224# CONFIG_VLAN_8021Q is not set 245# CONFIG_VLAN_8021Q is not set
225# CONFIG_DECNET is not set 246# CONFIG_DECNET is not set
226# CONFIG_LLC2 is not set 247# CONFIG_LLC2 is not set
@@ -231,6 +252,7 @@ CONFIG_IPV6_TUNNEL=m
231# CONFIG_ECONET is not set 252# CONFIG_ECONET is not set
232# CONFIG_WAN_ROUTER is not set 253# CONFIG_WAN_ROUTER is not set
233# CONFIG_NET_SCHED is not set 254# CONFIG_NET_SCHED is not set
255# CONFIG_DCB is not set
234 256
235# 257#
236# Network testing 258# Network testing
@@ -241,14 +263,14 @@ CONFIG_NET_PKTGEN=m
241# CONFIG_IRDA is not set 263# CONFIG_IRDA is not set
242# CONFIG_BT is not set 264# CONFIG_BT is not set
243# CONFIG_AF_RXRPC is not set 265# CONFIG_AF_RXRPC is not set
244 266# CONFIG_PHONET is not set
245# 267CONFIG_WIRELESS=y
246# Wireless
247#
248# CONFIG_CFG80211 is not set 268# CONFIG_CFG80211 is not set
269CONFIG_WIRELESS_OLD_REGULATORY=y
249# CONFIG_WIRELESS_EXT is not set 270# CONFIG_WIRELESS_EXT is not set
271# CONFIG_LIB80211 is not set
250# CONFIG_MAC80211 is not set 272# CONFIG_MAC80211 is not set
251# CONFIG_IEEE80211 is not set 273# CONFIG_WIMAX is not set
252# CONFIG_RFKILL is not set 274# CONFIG_RFKILL is not set
253# CONFIG_NET_9P is not set 275# CONFIG_NET_9P is not set
254 276
@@ -262,7 +284,9 @@ CONFIG_NET_PKTGEN=m
262CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 284CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
263CONFIG_STANDALONE=y 285CONFIG_STANDALONE=y
264CONFIG_PREVENT_FIRMWARE_BUILD=y 286CONFIG_PREVENT_FIRMWARE_BUILD=y
265# CONFIG_FW_LOADER is not set 287CONFIG_FW_LOADER=y
288CONFIG_FIRMWARE_IN_KERNEL=y
289CONFIG_EXTRA_FIRMWARE=""
266# CONFIG_DEBUG_DRIVER is not set 290# CONFIG_DEBUG_DRIVER is not set
267# CONFIG_DEBUG_DEVRES is not set 291# CONFIG_DEBUG_DEVRES is not set
268# CONFIG_SYS_HYPERVISOR is not set 292# CONFIG_SYS_HYPERVISOR is not set
@@ -286,12 +310,15 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
286# CONFIG_BLK_DEV_XIP is not set 310# CONFIG_BLK_DEV_XIP is not set
287# CONFIG_CDROM_PKTCDVD is not set 311# CONFIG_CDROM_PKTCDVD is not set
288# CONFIG_ATA_OVER_ETH is not set 312# CONFIG_ATA_OVER_ETH is not set
313# CONFIG_BLK_DEV_HD is not set
289CONFIG_MISC_DEVICES=y 314CONFIG_MISC_DEVICES=y
290# CONFIG_PHANTOM is not set 315# CONFIG_PHANTOM is not set
291# CONFIG_EEPROM_93CX6 is not set 316# CONFIG_EEPROM_93CX6 is not set
292# CONFIG_SGI_IOC4 is not set 317# CONFIG_SGI_IOC4 is not set
293# CONFIG_TIFM_CORE is not set 318# CONFIG_TIFM_CORE is not set
294# CONFIG_ENCLOSURE_SERVICES is not set 319# CONFIG_ENCLOSURE_SERVICES is not set
320# CONFIG_HP_ILO is not set
321# CONFIG_C2PORT is not set
295CONFIG_HAVE_IDE=y 322CONFIG_HAVE_IDE=y
296# CONFIG_IDE is not set 323# CONFIG_IDE is not set
297 324
@@ -335,6 +362,7 @@ CONFIG_SCSI_SPI_ATTRS=y
335# CONFIG_SCSI_SRP_ATTRS is not set 362# CONFIG_SCSI_SRP_ATTRS is not set
336CONFIG_SCSI_LOWLEVEL=y 363CONFIG_SCSI_LOWLEVEL=y
337# CONFIG_ISCSI_TCP is not set 364# CONFIG_ISCSI_TCP is not set
365# CONFIG_SCSI_CXGB3_ISCSI is not set
338# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 366# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
339# CONFIG_SCSI_3W_9XXX is not set 367# CONFIG_SCSI_3W_9XXX is not set
340# CONFIG_SCSI_ACARD is not set 368# CONFIG_SCSI_ACARD is not set
@@ -348,6 +376,8 @@ CONFIG_SCSI_LOWLEVEL=y
348# CONFIG_MEGARAID_LEGACY is not set 376# CONFIG_MEGARAID_LEGACY is not set
349# CONFIG_MEGARAID_SAS is not set 377# CONFIG_MEGARAID_SAS is not set
350# CONFIG_SCSI_HPTIOP is not set 378# CONFIG_SCSI_HPTIOP is not set
379# CONFIG_LIBFC is not set
380# CONFIG_FCOE is not set
351# CONFIG_SCSI_DMX3191D is not set 381# CONFIG_SCSI_DMX3191D is not set
352# CONFIG_SCSI_FUTURE_DOMAIN is not set 382# CONFIG_SCSI_FUTURE_DOMAIN is not set
353# CONFIG_SCSI_IPS is not set 383# CONFIG_SCSI_IPS is not set
@@ -367,6 +397,7 @@ CONFIG_SCSI_QLOGICPTI=m
367# CONFIG_SCSI_DEBUG is not set 397# CONFIG_SCSI_DEBUG is not set
368CONFIG_SCSI_SUNESP=y 398CONFIG_SCSI_SUNESP=y
369# CONFIG_SCSI_SRP is not set 399# CONFIG_SCSI_SRP is not set
400# CONFIG_SCSI_DH is not set
370# CONFIG_ATA is not set 401# CONFIG_ATA is not set
371# CONFIG_MD is not set 402# CONFIG_MD is not set
372# CONFIG_FUSION is not set 403# CONFIG_FUSION is not set
@@ -374,11 +405,14 @@ CONFIG_SCSI_SUNESP=y
374# 405#
375# IEEE 1394 (FireWire) support 406# IEEE 1394 (FireWire) support
376# 407#
408
409#
410# Enable only one of the two stacks, unless you know what you are doing
411#
377# CONFIG_FIREWIRE is not set 412# CONFIG_FIREWIRE is not set
378# CONFIG_IEEE1394 is not set 413# CONFIG_IEEE1394 is not set
379# CONFIG_I2O is not set 414# CONFIG_I2O is not set
380CONFIG_NETDEVICES=y 415CONFIG_NETDEVICES=y
381# CONFIG_NETDEVICES_MULTIQUEUE is not set
382CONFIG_DUMMY=m 416CONFIG_DUMMY=m
383# CONFIG_BONDING is not set 417# CONFIG_BONDING is not set
384# CONFIG_MACVLAN is not set 418# CONFIG_MACVLAN is not set
@@ -402,14 +436,16 @@ CONFIG_SUNQE=m
402# CONFIG_IBM_NEW_EMAC_RGMII is not set 436# CONFIG_IBM_NEW_EMAC_RGMII is not set
403# CONFIG_IBM_NEW_EMAC_TAH is not set 437# CONFIG_IBM_NEW_EMAC_TAH is not set
404# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 438# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
439# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
440# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
441# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
405# CONFIG_NET_PCI is not set 442# CONFIG_NET_PCI is not set
406# CONFIG_B44 is not set 443# CONFIG_B44 is not set
444# CONFIG_ATL2 is not set
407CONFIG_NETDEV_1000=y 445CONFIG_NETDEV_1000=y
408# CONFIG_ACENIC is not set 446# CONFIG_ACENIC is not set
409# CONFIG_DL2K is not set 447# CONFIG_DL2K is not set
410# CONFIG_E1000 is not set 448# CONFIG_E1000 is not set
411# CONFIG_E1000E is not set
412# CONFIG_E1000E_ENABLED is not set
413# CONFIG_IP1000 is not set 449# CONFIG_IP1000 is not set
414# CONFIG_IGB is not set 450# CONFIG_IGB is not set
415# CONFIG_MYRI_SBUS is not set 451# CONFIG_MYRI_SBUS is not set
@@ -425,18 +461,25 @@ CONFIG_NETDEV_1000=y
425# CONFIG_BNX2 is not set 461# CONFIG_BNX2 is not set
426# CONFIG_QLA3XXX is not set 462# CONFIG_QLA3XXX is not set
427# CONFIG_ATL1 is not set 463# CONFIG_ATL1 is not set
464# CONFIG_ATL1E is not set
465# CONFIG_JME is not set
428CONFIG_NETDEV_10000=y 466CONFIG_NETDEV_10000=y
429# CONFIG_CHELSIO_T1 is not set 467# CONFIG_CHELSIO_T1 is not set
468CONFIG_CHELSIO_T3_DEPENDS=y
430# CONFIG_CHELSIO_T3 is not set 469# CONFIG_CHELSIO_T3 is not set
470# CONFIG_ENIC is not set
431# CONFIG_IXGBE is not set 471# CONFIG_IXGBE is not set
432# CONFIG_IXGB is not set 472# CONFIG_IXGB is not set
433# CONFIG_S2IO is not set 473# CONFIG_S2IO is not set
434# CONFIG_MYRI10GE is not set 474# CONFIG_MYRI10GE is not set
435# CONFIG_NETXEN_NIC is not set 475# CONFIG_NETXEN_NIC is not set
436# CONFIG_NIU is not set 476# CONFIG_NIU is not set
477# CONFIG_MLX4_EN is not set
437# CONFIG_MLX4_CORE is not set 478# CONFIG_MLX4_CORE is not set
438# CONFIG_TEHUTI is not set 479# CONFIG_TEHUTI is not set
439# CONFIG_BNX2X is not set 480# CONFIG_BNX2X is not set
481# CONFIG_QLGE is not set
482# CONFIG_SFC is not set
440# CONFIG_TR is not set 483# CONFIG_TR is not set
441 484
442# 485#
@@ -445,6 +488,10 @@ CONFIG_NETDEV_10000=y
445# CONFIG_WLAN_PRE80211 is not set 488# CONFIG_WLAN_PRE80211 is not set
446# CONFIG_WLAN_80211 is not set 489# CONFIG_WLAN_80211 is not set
447# CONFIG_IWLWIFI_LEDS is not set 490# CONFIG_IWLWIFI_LEDS is not set
491
492#
493# Enable WiMAX (Networking options) to see the WiMAX drivers
494#
448# CONFIG_WAN is not set 495# CONFIG_WAN is not set
449# CONFIG_FDDI is not set 496# CONFIG_FDDI is not set
450# CONFIG_HIPPI is not set 497# CONFIG_HIPPI is not set
@@ -492,9 +539,11 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
492CONFIG_MOUSE_PS2_SYNAPTICS=y 539CONFIG_MOUSE_PS2_SYNAPTICS=y
493CONFIG_MOUSE_PS2_LIFEBOOK=y 540CONFIG_MOUSE_PS2_LIFEBOOK=y
494CONFIG_MOUSE_PS2_TRACKPOINT=y 541CONFIG_MOUSE_PS2_TRACKPOINT=y
542# CONFIG_MOUSE_PS2_ELANTECH is not set
495# CONFIG_MOUSE_PS2_TOUCHKIT is not set 543# CONFIG_MOUSE_PS2_TOUCHKIT is not set
496CONFIG_MOUSE_SERIAL=m 544CONFIG_MOUSE_SERIAL=m
497# CONFIG_MOUSE_APPLETOUCH is not set 545# CONFIG_MOUSE_APPLETOUCH is not set
546# CONFIG_MOUSE_BCM5974 is not set
498# CONFIG_MOUSE_VSXXXAA is not set 547# CONFIG_MOUSE_VSXXXAA is not set
499# CONFIG_INPUT_JOYSTICK is not set 548# CONFIG_INPUT_JOYSTICK is not set
500# CONFIG_INPUT_TABLET is not set 549# CONFIG_INPUT_TABLET is not set
@@ -516,15 +565,18 @@ CONFIG_SERIO_LIBPS2=m
516# Character devices 565# Character devices
517# 566#
518CONFIG_VT=y 567CONFIG_VT=y
568CONFIG_CONSOLE_TRANSLATIONS=y
519CONFIG_VT_CONSOLE=y 569CONFIG_VT_CONSOLE=y
520CONFIG_HW_CONSOLE=y 570CONFIG_HW_CONSOLE=y
521# CONFIG_VT_HW_CONSOLE_BINDING is not set 571# CONFIG_VT_HW_CONSOLE_BINDING is not set
572CONFIG_DEVKMEM=y
522# CONFIG_SERIAL_NONSTANDARD is not set 573# CONFIG_SERIAL_NONSTANDARD is not set
523# CONFIG_NOZOMI is not set 574# CONFIG_NOZOMI is not set
524 575
525# 576#
526# Serial drivers 577# Serial drivers
527# 578#
579# CONFIG_SERIAL_8250 is not set
528 580
529# 581#
530# Non-8250 serial port support 582# Non-8250 serial port support
@@ -540,23 +592,20 @@ CONFIG_SERIAL_CORE_CONSOLE=y
540CONFIG_CONSOLE_POLL=y 592CONFIG_CONSOLE_POLL=y
541# CONFIG_SERIAL_JSM is not set 593# CONFIG_SERIAL_JSM is not set
542CONFIG_UNIX98_PTYS=y 594CONFIG_UNIX98_PTYS=y
595# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
543CONFIG_LEGACY_PTYS=y 596CONFIG_LEGACY_PTYS=y
544CONFIG_LEGACY_PTY_COUNT=256 597CONFIG_LEGACY_PTY_COUNT=256
545# CONFIG_IPMI_HANDLER is not set 598# CONFIG_IPMI_HANDLER is not set
546CONFIG_HW_RANDOM=m 599CONFIG_HW_RANDOM=m
547CONFIG_JS_RTC=m
548# CONFIG_R3964 is not set 600# CONFIG_R3964 is not set
549# CONFIG_APPLICOM is not set 601# CONFIG_APPLICOM is not set
550# CONFIG_RAW_DRIVER is not set 602# CONFIG_RAW_DRIVER is not set
551# CONFIG_TCG_TPM is not set 603# CONFIG_TCG_TPM is not set
552CONFIG_DEVPORT=y 604CONFIG_DEVPORT=y
553# CONFIG_I2C is not set 605# CONFIG_I2C is not set
554
555#
556# SPI support
557#
558# CONFIG_SPI is not set 606# CONFIG_SPI is not set
559# CONFIG_SPI_MASTER is not set 607CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
608# CONFIG_GPIOLIB is not set
560# CONFIG_W1 is not set 609# CONFIG_W1 is not set
561# CONFIG_POWER_SUPPLY is not set 610# CONFIG_POWER_SUPPLY is not set
562CONFIG_HWMON=y 611CONFIG_HWMON=y
@@ -577,25 +626,38 @@ CONFIG_HWMON=y
577# CONFIG_SENSORS_W83627EHF is not set 626# CONFIG_SENSORS_W83627EHF is not set
578# CONFIG_HWMON_DEBUG_CHIP is not set 627# CONFIG_HWMON_DEBUG_CHIP is not set
579# CONFIG_THERMAL is not set 628# CONFIG_THERMAL is not set
629# CONFIG_THERMAL_HWMON is not set
580# CONFIG_WATCHDOG is not set 630# CONFIG_WATCHDOG is not set
631CONFIG_SSB_POSSIBLE=y
581 632
582# 633#
583# Sonics Silicon Backplane 634# Sonics Silicon Backplane
584# 635#
585CONFIG_SSB_POSSIBLE=y
586# CONFIG_SSB is not set 636# CONFIG_SSB is not set
587 637
588# 638#
589# Multifunction device drivers 639# Multifunction device drivers
590# 640#
641# CONFIG_MFD_CORE is not set
591# CONFIG_MFD_SM501 is not set 642# CONFIG_MFD_SM501 is not set
592# CONFIG_HTC_PASIC3 is not set 643# CONFIG_HTC_PASIC3 is not set
644# CONFIG_MFD_TMIO is not set
645# CONFIG_REGULATOR is not set
593 646
594# 647#
595# Multimedia devices 648# Multimedia devices
596# 649#
650
651#
652# Multimedia core support
653#
597# CONFIG_VIDEO_DEV is not set 654# CONFIG_VIDEO_DEV is not set
598# CONFIG_DVB_CORE is not set 655# CONFIG_DVB_CORE is not set
656# CONFIG_VIDEO_MEDIA is not set
657
658#
659# Multimedia drivers
660#
599# CONFIG_DAB is not set 661# CONFIG_DAB is not set
600 662
601# 663#
@@ -616,15 +678,17 @@ CONFIG_SSB_POSSIBLE=y
616# 678#
617# CONFIG_PROM_CONSOLE is not set 679# CONFIG_PROM_CONSOLE is not set
618CONFIG_DUMMY_CONSOLE=y 680CONFIG_DUMMY_CONSOLE=y
619
620#
621# Sound
622#
623# CONFIG_SOUND is not set 681# CONFIG_SOUND is not set
624CONFIG_HID_SUPPORT=y 682CONFIG_HID_SUPPORT=y
625CONFIG_HID=y 683CONFIG_HID=y
626# CONFIG_HID_DEBUG is not set 684# CONFIG_HID_DEBUG is not set
627# CONFIG_HIDRAW is not set 685# CONFIG_HIDRAW is not set
686# CONFIG_HID_PID is not set
687
688#
689# Special HID drivers
690#
691CONFIG_HID_COMPAT=y
628CONFIG_USB_SUPPORT=y 692CONFIG_USB_SUPPORT=y
629CONFIG_USB_ARCH_HAS_HCD=y 693CONFIG_USB_ARCH_HAS_HCD=y
630CONFIG_USB_ARCH_HAS_OHCI=y 694CONFIG_USB_ARCH_HAS_OHCI=y
@@ -632,32 +696,71 @@ CONFIG_USB_ARCH_HAS_EHCI=y
632# CONFIG_USB is not set 696# CONFIG_USB is not set
633 697
634# 698#
635# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 699# Enable Host or Gadget support to see Inventra options
700#
701
702#
703# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
636# 704#
637# CONFIG_USB_GADGET is not set 705# CONFIG_USB_GADGET is not set
706
707#
708# OTG and related infrastructure
709#
710# CONFIG_UWB is not set
638# CONFIG_MMC is not set 711# CONFIG_MMC is not set
639# CONFIG_MEMSTICK is not set 712# CONFIG_MEMSTICK is not set
640# CONFIG_NEW_LEDS is not set 713# CONFIG_NEW_LEDS is not set
714# CONFIG_ACCESSIBILITY is not set
641# CONFIG_INFINIBAND is not set 715# CONFIG_INFINIBAND is not set
642# CONFIG_RTC_CLASS is not set 716CONFIG_RTC_LIB=y
717CONFIG_RTC_CLASS=y
718CONFIG_RTC_HCTOSYS=y
719CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
720# CONFIG_RTC_DEBUG is not set
721
722#
723# RTC interfaces
724#
725CONFIG_RTC_INTF_SYSFS=y
726CONFIG_RTC_INTF_PROC=y
727CONFIG_RTC_INTF_DEV=y
728# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
729# CONFIG_RTC_DRV_TEST is not set
730
731#
732# SPI RTC drivers
733#
734
735#
736# Platform RTC drivers
737#
738# CONFIG_RTC_DRV_DS1286 is not set
739# CONFIG_RTC_DRV_DS1511 is not set
740# CONFIG_RTC_DRV_DS1553 is not set
741# CONFIG_RTC_DRV_DS1742 is not set
742# CONFIG_RTC_DRV_STK17TA8 is not set
743# CONFIG_RTC_DRV_M48T86 is not set
744# CONFIG_RTC_DRV_M48T35 is not set
745CONFIG_RTC_DRV_M48T59=y
746# CONFIG_RTC_DRV_BQ4802 is not set
747# CONFIG_RTC_DRV_V3020 is not set
748
749#
750# on-CPU RTC drivers
751#
752# CONFIG_DMADEVICES is not set
643# CONFIG_UIO is not set 753# CONFIG_UIO is not set
754# CONFIG_STAGING is not set
644 755
645# 756#
646# Misc Linux/SPARC drivers 757# Misc Linux/SPARC drivers
647# 758#
648CONFIG_SUN_OPENPROMIO=m 759CONFIG_SUN_OPENPROMIO=m
649CONFIG_SUN_MOSTEK_RTC=m
650# CONFIG_SUN_BPP is not set
651# CONFIG_SUN_VIDEOPIX is not set
652# CONFIG_TADPOLE_TS102_UCTRL is not set 760# CONFIG_TADPOLE_TS102_UCTRL is not set
653# CONFIG_SUN_JSFLASH is not set 761# CONFIG_SUN_JSFLASH is not set
654 762
655# 763#
656# Unix98 PTY support
657#
658CONFIG_UNIX98_PTY_COUNT=256
659
660#
661# File systems 764# File systems
662# 765#
663CONFIG_EXT2_FS=y 766CONFIG_EXT2_FS=y
@@ -666,11 +769,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
666CONFIG_EXT2_FS_SECURITY=y 769CONFIG_EXT2_FS_SECURITY=y
667# CONFIG_EXT2_FS_XIP is not set 770# CONFIG_EXT2_FS_XIP is not set
668# CONFIG_EXT3_FS is not set 771# CONFIG_EXT3_FS is not set
669# CONFIG_EXT4DEV_FS is not set 772# CONFIG_EXT4_FS is not set
670CONFIG_FS_MBCACHE=y 773CONFIG_FS_MBCACHE=y
671# CONFIG_REISERFS_FS is not set 774# CONFIG_REISERFS_FS is not set
672# CONFIG_JFS_FS is not set 775# CONFIG_JFS_FS is not set
673CONFIG_FS_POSIX_ACL=y 776CONFIG_FS_POSIX_ACL=y
777CONFIG_FILE_LOCKING=y
674# CONFIG_XFS_FS is not set 778# CONFIG_XFS_FS is not set
675# CONFIG_OCFS2_FS is not set 779# CONFIG_OCFS2_FS is not set
676CONFIG_DNOTIFY=y 780CONFIG_DNOTIFY=y
@@ -702,14 +806,12 @@ CONFIG_ISO9660_FS=m
702CONFIG_PROC_FS=y 806CONFIG_PROC_FS=y
703CONFIG_PROC_KCORE=y 807CONFIG_PROC_KCORE=y
704CONFIG_PROC_SYSCTL=y 808CONFIG_PROC_SYSCTL=y
809CONFIG_PROC_PAGE_MONITOR=y
705CONFIG_SYSFS=y 810CONFIG_SYSFS=y
706# CONFIG_TMPFS is not set 811# CONFIG_TMPFS is not set
707# CONFIG_HUGETLB_PAGE is not set 812# CONFIG_HUGETLB_PAGE is not set
708# CONFIG_CONFIGFS_FS is not set 813# CONFIG_CONFIGFS_FS is not set
709 814CONFIG_MISC_FILESYSTEMS=y
710#
711# Miscellaneous filesystems
712#
713# CONFIG_ADFS_FS is not set 815# CONFIG_ADFS_FS is not set
714# CONFIG_AFFS_FS is not set 816# CONFIG_AFFS_FS is not set
715# CONFIG_HFS_FS is not set 817# CONFIG_HFS_FS is not set
@@ -720,6 +822,7 @@ CONFIG_SYSFS=y
720# CONFIG_CRAMFS is not set 822# CONFIG_CRAMFS is not set
721# CONFIG_VXFS_FS is not set 823# CONFIG_VXFS_FS is not set
722# CONFIG_MINIX_FS is not set 824# CONFIG_MINIX_FS is not set
825# CONFIG_OMFS_FS is not set
723# CONFIG_HPFS_FS is not set 826# CONFIG_HPFS_FS is not set
724# CONFIG_QNX4FS_FS is not set 827# CONFIG_QNX4FS_FS is not set
725CONFIG_ROMFS_FS=m 828CONFIG_ROMFS_FS=m
@@ -729,13 +832,13 @@ CONFIG_NETWORK_FILESYSTEMS=y
729CONFIG_NFS_FS=y 832CONFIG_NFS_FS=y
730# CONFIG_NFS_V3 is not set 833# CONFIG_NFS_V3 is not set
731# CONFIG_NFS_V4 is not set 834# CONFIG_NFS_V4 is not set
732# CONFIG_NFSD is not set
733CONFIG_ROOT_NFS=y 835CONFIG_ROOT_NFS=y
836# CONFIG_NFSD is not set
734CONFIG_LOCKD=y 837CONFIG_LOCKD=y
735CONFIG_NFS_COMMON=y 838CONFIG_NFS_COMMON=y
736CONFIG_SUNRPC=y 839CONFIG_SUNRPC=y
737CONFIG_SUNRPC_GSS=m 840CONFIG_SUNRPC_GSS=m
738# CONFIG_SUNRPC_BIND34 is not set 841# CONFIG_SUNRPC_REGISTER_V4 is not set
739CONFIG_RPCSEC_GSS_KRB5=m 842CONFIG_RPCSEC_GSS_KRB5=m
740# CONFIG_RPCSEC_GSS_SPKM3 is not set 843# CONFIG_RPCSEC_GSS_SPKM3 is not set
741# CONFIG_SMB_FS is not set 844# CONFIG_SMB_FS is not set
@@ -806,9 +909,12 @@ CONFIG_MAGIC_SYSRQ=y
806# CONFIG_HEADERS_CHECK is not set 909# CONFIG_HEADERS_CHECK is not set
807CONFIG_DEBUG_KERNEL=y 910CONFIG_DEBUG_KERNEL=y
808CONFIG_DETECT_SOFTLOCKUP=y 911CONFIG_DETECT_SOFTLOCKUP=y
912# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
913CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
809# CONFIG_SCHED_DEBUG is not set 914# CONFIG_SCHED_DEBUG is not set
810# CONFIG_SCHEDSTATS is not set 915# CONFIG_SCHEDSTATS is not set
811# CONFIG_TIMER_STATS is not set 916# CONFIG_TIMER_STATS is not set
917# CONFIG_DEBUG_OBJECTS is not set
812# CONFIG_DEBUG_SLAB is not set 918# CONFIG_DEBUG_SLAB is not set
813# CONFIG_DEBUG_RT_MUTEXES is not set 919# CONFIG_DEBUG_RT_MUTEXES is not set
814# CONFIG_RT_MUTEX_TESTER is not set 920# CONFIG_RT_MUTEX_TESTER is not set
@@ -822,37 +928,59 @@ CONFIG_DEBUG_BUGVERBOSE=y
822# CONFIG_DEBUG_INFO is not set 928# CONFIG_DEBUG_INFO is not set
823# CONFIG_DEBUG_VM is not set 929# CONFIG_DEBUG_VM is not set
824# CONFIG_DEBUG_WRITECOUNT is not set 930# CONFIG_DEBUG_WRITECOUNT is not set
931CONFIG_DEBUG_MEMORY_INIT=y
825# CONFIG_DEBUG_LIST is not set 932# CONFIG_DEBUG_LIST is not set
826# CONFIG_DEBUG_SG is not set 933# CONFIG_DEBUG_SG is not set
827CONFIG_FRAME_POINTER=y 934# CONFIG_DEBUG_NOTIFIERS is not set
828# CONFIG_BOOT_PRINTK_DELAY is not set 935# CONFIG_BOOT_PRINTK_DELAY is not set
829# CONFIG_RCU_TORTURE_TEST is not set 936# CONFIG_RCU_TORTURE_TEST is not set
937# CONFIG_RCU_CPU_STALL_DETECTOR is not set
830# CONFIG_BACKTRACE_SELF_TEST is not set 938# CONFIG_BACKTRACE_SELF_TEST is not set
939# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
831# CONFIG_FAULT_INJECTION is not set 940# CONFIG_FAULT_INJECTION is not set
941# CONFIG_SYSCTL_SYSCALL_CHECK is not set
942
943#
944# Tracers
945#
946# CONFIG_SCHED_TRACER is not set
947# CONFIG_CONTEXT_SWITCH_TRACER is not set
948# CONFIG_BOOT_TRACER is not set
949# CONFIG_TRACE_BRANCH_PROFILING is not set
950# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
832# CONFIG_SAMPLES is not set 951# CONFIG_SAMPLES is not set
833CONFIG_KGDB=y
834CONFIG_HAVE_ARCH_KGDB=y 952CONFIG_HAVE_ARCH_KGDB=y
953CONFIG_KGDB=y
835CONFIG_KGDB_SERIAL_CONSOLE=y 954CONFIG_KGDB_SERIAL_CONSOLE=y
836CONFIG_KGDB_TESTS=y 955CONFIG_KGDB_TESTS=y
837# CONFIG_KGDB_TESTS_ON_BOOT is not set 956# CONFIG_KGDB_TESTS_ON_BOOT is not set
838# CONFIG_DEBUG_STACK_USAGE is not set 957# CONFIG_DEBUG_STACK_USAGE is not set
958# CONFIG_STACK_DEBUG is not set
839 959
840# 960#
841# Security options 961# Security options
842# 962#
843# CONFIG_KEYS is not set 963# CONFIG_KEYS is not set
844# CONFIG_SECURITY is not set 964# CONFIG_SECURITY is not set
965# CONFIG_SECURITYFS is not set
845# CONFIG_SECURITY_FILE_CAPABILITIES is not set 966# CONFIG_SECURITY_FILE_CAPABILITIES is not set
846CONFIG_CRYPTO=y 967CONFIG_CRYPTO=y
847 968
848# 969#
849# Crypto core or helper 970# Crypto core or helper
850# 971#
972# CONFIG_CRYPTO_FIPS is not set
851CONFIG_CRYPTO_ALGAPI=y 973CONFIG_CRYPTO_ALGAPI=y
974CONFIG_CRYPTO_ALGAPI2=y
852CONFIG_CRYPTO_AEAD=y 975CONFIG_CRYPTO_AEAD=y
976CONFIG_CRYPTO_AEAD2=y
853CONFIG_CRYPTO_BLKCIPHER=y 977CONFIG_CRYPTO_BLKCIPHER=y
978CONFIG_CRYPTO_BLKCIPHER2=y
854CONFIG_CRYPTO_HASH=y 979CONFIG_CRYPTO_HASH=y
980CONFIG_CRYPTO_HASH2=y
981CONFIG_CRYPTO_RNG2=y
855CONFIG_CRYPTO_MANAGER=y 982CONFIG_CRYPTO_MANAGER=y
983CONFIG_CRYPTO_MANAGER2=y
856# CONFIG_CRYPTO_GF128MUL is not set 984# CONFIG_CRYPTO_GF128MUL is not set
857CONFIG_CRYPTO_NULL=m 985CONFIG_CRYPTO_NULL=m
858# CONFIG_CRYPTO_CRYPTD is not set 986# CONFIG_CRYPTO_CRYPTD is not set
@@ -890,6 +1018,10 @@ CONFIG_CRYPTO_CRC32C=m
890CONFIG_CRYPTO_MD4=y 1018CONFIG_CRYPTO_MD4=y
891CONFIG_CRYPTO_MD5=y 1019CONFIG_CRYPTO_MD5=y
892CONFIG_CRYPTO_MICHAEL_MIC=m 1020CONFIG_CRYPTO_MICHAEL_MIC=m
1021# CONFIG_CRYPTO_RMD128 is not set
1022# CONFIG_CRYPTO_RMD160 is not set
1023# CONFIG_CRYPTO_RMD256 is not set
1024# CONFIG_CRYPTO_RMD320 is not set
893CONFIG_CRYPTO_SHA1=y 1025CONFIG_CRYPTO_SHA1=y
894CONFIG_CRYPTO_SHA256=m 1026CONFIG_CRYPTO_SHA256=m
895CONFIG_CRYPTO_SHA512=m 1027CONFIG_CRYPTO_SHA512=m
@@ -921,15 +1053,21 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
921# 1053#
922CONFIG_CRYPTO_DEFLATE=y 1054CONFIG_CRYPTO_DEFLATE=y
923# CONFIG_CRYPTO_LZO is not set 1055# CONFIG_CRYPTO_LZO is not set
1056
1057#
1058# Random Number Generation
1059#
1060# CONFIG_CRYPTO_ANSI_CPRNG is not set
924# CONFIG_CRYPTO_HW is not set 1061# CONFIG_CRYPTO_HW is not set
925 1062
926# 1063#
927# Library routines 1064# Library routines
928# 1065#
929CONFIG_BITREVERSE=y 1066CONFIG_BITREVERSE=y
930# CONFIG_GENERIC_FIND_FIRST_BIT is not set 1067CONFIG_GENERIC_FIND_LAST_BIT=y
931# CONFIG_CRC_CCITT is not set 1068# CONFIG_CRC_CCITT is not set
932# CONFIG_CRC16 is not set 1069# CONFIG_CRC16 is not set
1070# CONFIG_CRC_T10DIF is not set
933# CONFIG_CRC_ITU_T is not set 1071# CONFIG_CRC_ITU_T is not set
934CONFIG_CRC32=y 1072CONFIG_CRC32=y
935# CONFIG_CRC7 is not set 1073# CONFIG_CRC7 is not set
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index cde19ae78f5a..ade49941def2 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -867,8 +867,8 @@ CONFIG_I2C_ALGOBIT=y
867# Miscellaneous I2C Chip support 867# Miscellaneous I2C Chip support
868# 868#
869# CONFIG_DS1682 is not set 869# CONFIG_DS1682 is not set
870# CONFIG_AT24 is not set 870# CONFIG_EEPROM_AT24 is not set
871# CONFIG_SENSORS_EEPROM is not set 871# CONFIG_EEPROM_LEGACY is not set
872# CONFIG_SENSORS_PCF8574 is not set 872# CONFIG_SENSORS_PCF8574 is not set
873# CONFIG_PCF8575 is not set 873# CONFIG_PCF8575 is not set
874# CONFIG_SENSORS_PCA9539 is not set 874# CONFIG_SENSORS_PCA9539 is not set
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 95e38a43dff0..deeb0fba8029 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -17,4 +17,3 @@ header-y += traps.h
17header-y += uctx.h 17header-y += uctx.h
18header-y += utrap.h 18header-y += utrap.h
19header-y += watchdog.h 19header-y += watchdog.h
20header-y += swab.h
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h
index 48a047cd6fa9..ccc1b6b7de6c 100644
--- a/arch/sparc/include/asm/byteorder.h
+++ b/arch/sparc/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC_BYTEORDER_H 1#ifndef _SPARC_BYTEORDER_H
2#define _SPARC_BYTEORDER_H 2#define _SPARC_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/big_endian.h> 4#include <linux/byteorder/big_endian.h>
6 5
7#endif /* _SPARC_BYTEORDER_H */ 6#endif /* _SPARC_BYTEORDER_H */
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index f260b58f5ce9..0e706257918f 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -240,4 +240,9 @@ struct compat_shmid64_ds {
240 unsigned int __unused2; 240 unsigned int __unused2;
241}; 241};
242 242
243static inline int is_compat_task(void)
244{
245 return test_thread_flag(TIF_32BIT);
246}
247
243#endif /* _ASM_SPARC64_COMPAT_H */ 248#endif /* _ASM_SPARC64_COMPAT_H */
diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h
index 7da7c13d23c4..a11b89ee9ef8 100644
--- a/arch/sparc/include/asm/cpudata_64.h
+++ b/arch/sparc/include/asm/cpudata_64.h
@@ -17,7 +17,7 @@
17typedef struct { 17typedef struct {
18 /* Dcache line 1 */ 18 /* Dcache line 1 */
19 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ 19 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
20 unsigned int __pad0; 20 unsigned int __nmi_count;
21 unsigned long clock_tick; /* %tick's per second */ 21 unsigned long clock_tick; /* %tick's per second */
22 unsigned long __pad; 22 unsigned long __pad;
23 unsigned int __pad1; 23 unsigned int __pad1;
diff --git a/arch/sparc/include/asm/irq_64.h b/arch/sparc/include/asm/irq_64.h
index d47d4a1955a9..1934f2cbf513 100644
--- a/arch/sparc/include/asm/irq_64.h
+++ b/arch/sparc/include/asm/irq_64.h
@@ -66,9 +66,6 @@ extern void virt_irq_free(unsigned int virt_irq);
66extern void __init init_IRQ(void); 66extern void __init init_IRQ(void);
67extern void fixup_irqs(void); 67extern void fixup_irqs(void);
68 68
69extern int register_perfctr_intr(void (*handler)(struct pt_regs *));
70extern void release_perfctr_intr(void (*handler)(struct pt_regs *));
71
72static inline void set_softint(unsigned long bits) 69static inline void set_softint(unsigned long bits)
73{ 70{
74 __asm__ __volatile__("wr %0, 0x0, %%set_softint" 71 __asm__ __volatile__("wr %0, 0x0, %%set_softint"
@@ -98,5 +95,6 @@ void __trigger_all_cpu_backtrace(void);
98extern void *hardirq_stack[NR_CPUS]; 95extern void *hardirq_stack[NR_CPUS];
99extern void *softirq_stack[NR_CPUS]; 96extern void *softirq_stack[NR_CPUS];
100#define __ARCH_HAS_DO_SOFTIRQ 97#define __ARCH_HAS_DO_SOFTIRQ
98#define ARCH_HAS_NMI_WATCHDOG
101 99
102#endif 100#endif
diff --git a/arch/sparc/include/asm/kdebug_64.h b/arch/sparc/include/asm/kdebug_64.h
index f905b773235a..feb3578e12c4 100644
--- a/arch/sparc/include/asm/kdebug_64.h
+++ b/arch/sparc/include/asm/kdebug_64.h
@@ -14,6 +14,8 @@ enum die_val {
14 DIE_TRAP, 14 DIE_TRAP,
15 DIE_TRAP_TL1, 15 DIE_TRAP_TL1,
16 DIE_CALL, 16 DIE_CALL,
17 DIE_NMI,
18 DIE_NMIWATCHDOG,
17}; 19};
18 20
19#endif 21#endif
diff --git a/arch/sparc/include/asm/nmi.h b/arch/sparc/include/asm/nmi.h
new file mode 100644
index 000000000000..fbd546dd4feb
--- /dev/null
+++ b/arch/sparc/include/asm/nmi.h
@@ -0,0 +1,10 @@
1#ifndef __NMI_H
2#define __NMI_H
3
4extern int __init nmi_init(void);
5extern void perfctr_irq(int irq, struct pt_regs *regs);
6extern void nmi_adjust_hz(unsigned int new_hz);
7
8extern int nmi_usable;
9
10#endif /* __NMI_H */
diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h
index 73d45521db04..33e31ce6b31f 100644
--- a/arch/sparc/include/asm/oplib_32.h
+++ b/arch/sparc/include/asm/oplib_32.h
@@ -177,17 +177,6 @@ extern void prom_putsegment(int context, unsigned long virt_addr,
177 177
178/* PROM device tree traversal functions... */ 178/* PROM device tree traversal functions... */
179 179
180#ifdef PROMLIB_INTERNAL
181
182/* Internal version of prom_getchild. */
183extern int __prom_getchild(int parent_node);
184
185/* Internal version of prom_getsibling. */
186extern int __prom_getsibling(int node);
187
188#endif
189
190
191/* Get the child node of the given node, or zero if no child exists. */ 180/* Get the child node of the given node, or zero if no child exists. */
192extern int prom_getchild(int parent_node); 181extern int prom_getchild(int parent_node);
193 182
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h
index 6d2c2ca98039..a5db0317b5fb 100644
--- a/arch/sparc/include/asm/oplib_64.h
+++ b/arch/sparc/include/asm/oplib_64.h
@@ -218,16 +218,6 @@ extern void prom_unmap(unsigned long size, unsigned long vaddr);
218 218
219/* PROM device tree traversal functions... */ 219/* PROM device tree traversal functions... */
220 220
221#ifdef PROMLIB_INTERNAL
222
223/* Internal version of prom_getchild. */
224extern int __prom_getchild(int parent_node);
225
226/* Internal version of prom_getsibling. */
227extern int __prom_getsibling(int node);
228
229#endif
230
231/* Get the child node of the given node, or zero if no child exists. */ 221/* Get the child node of the given node, or zero if no child exists. */
232extern int prom_getchild(int parent_node); 222extern int prom_getchild(int parent_node);
233 223
diff --git a/arch/sparc/include/asm/pcr.h b/arch/sparc/include/asm/pcr.h
new file mode 100644
index 000000000000..a2f5c61f924e
--- /dev/null
+++ b/arch/sparc/include/asm/pcr.h
@@ -0,0 +1,46 @@
1#ifndef __PCR_H
2#define __PCR_H
3
4struct pcr_ops {
5 u64 (*read)(void);
6 void (*write)(u64);
7};
8extern const struct pcr_ops *pcr_ops;
9
10extern void deferred_pcr_work_irq(int irq, struct pt_regs *regs);
11extern void schedule_deferred_pcr_work(void);
12
13#define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */
14#define PCR_STRACE 0x00000002 /* Trace supervisor events */
15#define PCR_UTRACE 0x00000004 /* Trace user events */
16#define PCR_N2_HTRACE 0x00000008 /* Trace hypervisor events */
17#define PCR_N2_TOE_OV0 0x00000010 /* Trap if PIC 0 overflows */
18#define PCR_N2_TOE_OV1 0x00000020 /* Trap if PIC 1 overflows */
19#define PCR_N2_MASK0 0x00003fc0
20#define PCR_N2_MASK0_SHIFT 6
21#define PCR_N2_SL0 0x0003c000
22#define PCR_N2_SL0_SHIFT 14
23#define PCR_N2_OV0 0x00040000
24#define PCR_N2_MASK1 0x07f80000
25#define PCR_N2_MASK1_SHIFT 19
26#define PCR_N2_SL1 0x78000000
27#define PCR_N2_SL1_SHIFT 27
28#define PCR_N2_OV1 0x80000000
29
30extern unsigned int picl_shift;
31
32/* In order to commonize as much of the implementation as
33 * possible, we use PICH as our counter. Mostly this is
34 * to accomodate Niagara-1 which can only count insn cycles
35 * in PICH.
36 */
37static inline u64 picl_value(unsigned int nmi_hz)
38{
39 u32 delta = local_cpu_data().clock_tick / (nmi_hz << picl_shift);
40
41 return ((u64)((0 - delta) & 0xffffffff)) << 32;
42}
43
44extern u64 pcr_enable;
45
46#endif /* __PCR_H */
diff --git a/arch/sparc/include/asm/pil.h b/arch/sparc/include/asm/pil.h
index d573820c0ff4..32a7efe76d00 100644
--- a/arch/sparc/include/asm/pil.h
+++ b/arch/sparc/include/asm/pil.h
@@ -23,6 +23,7 @@
23#define PIL_SMP_CTX_NEW_VERSION 4 23#define PIL_SMP_CTX_NEW_VERSION 4
24#define PIL_DEVICE_IRQ 5 24#define PIL_DEVICE_IRQ 5
25#define PIL_SMP_CALL_FUNC_SNGL 6 25#define PIL_SMP_CALL_FUNC_SNGL 6
26#define PIL_DEFERRED_PCR_WORK 7
26#define PIL_NORMAL_MAX 14 27#define PIL_NORMAL_MAX 14
27#define PIL_NMI 15 28#define PIL_NMI 15
28 29
diff --git a/arch/sparc/include/asm/seccomp.h b/arch/sparc/include/asm/seccomp.h
index 7fcd9968192b..adca1bce41d4 100644
--- a/arch/sparc/include/asm/seccomp.h
+++ b/arch/sparc/include/asm/seccomp.h
@@ -1,11 +1,5 @@
1#ifndef _ASM_SECCOMP_H 1#ifndef _ASM_SECCOMP_H
2 2
3#include <linux/thread_info.h> /* already defines TIF_32BIT */
4
5#ifndef TIF_32BIT
6#error "unexpected TIF_32BIT on sparc64"
7#endif
8
9#include <linux/unistd.h> 3#include <linux/unistd.h>
10 4
11#define __NR_seccomp_read __NR_read 5#define __NR_seccomp_read __NR_read
diff --git a/arch/sparc/include/asm/signal.h b/arch/sparc/include/asm/signal.h
index 41535e77b255..cba45206b7f2 100644
--- a/arch/sparc/include/asm/signal.h
+++ b/arch/sparc/include/asm/signal.h
@@ -84,7 +84,11 @@
84 84
85#define __OLD_NSIG 32 85#define __OLD_NSIG 32
86#define __NEW_NSIG 64 86#define __NEW_NSIG 64
87#ifdef __arch64__
87#define _NSIG_BPW 64 88#define _NSIG_BPW 64
89#else
90#define _NSIG_BPW 32
91#endif
88#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW) 92#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
89 93
90#define SIGRTMIN 32 94#define SIGRTMIN 32
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h
index b8a65b64e1df..5bc0b8fd6374 100644
--- a/arch/sparc/include/asm/topology_64.h
+++ b/arch/sparc/include/asm/topology_64.h
@@ -47,6 +47,10 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
47 (pcibus_to_node(bus) == -1 ? \ 47 (pcibus_to_node(bus) == -1 ? \
48 CPU_MASK_ALL : \ 48 CPU_MASK_ALL : \
49 node_to_cpumask(pcibus_to_node(bus))) 49 node_to_cpumask(pcibus_to_node(bus)))
50#define cpumask_of_pcibus(bus) \
51 (pcibus_to_node(bus) == -1 ? \
52 CPU_MASK_ALL_PTR : \
53 cpumask_of_node(pcibus_to_node(bus)))
50 54
51#define SD_NODE_INIT (struct sched_domain) { \ 55#define SD_NODE_INIT (struct sched_domain) { \
52 .min_interval = 8, \ 56 .min_interval = 8, \
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 53adcaa0348b..54742e58831c 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -52,6 +52,8 @@ obj-$(CONFIG_SPARC64) += visemul.o
52obj-$(CONFIG_SPARC64) += hvapi.o 52obj-$(CONFIG_SPARC64) += hvapi.o
53obj-$(CONFIG_SPARC64) += sstate.o 53obj-$(CONFIG_SPARC64) += sstate.o
54obj-$(CONFIG_SPARC64) += mdesc.o 54obj-$(CONFIG_SPARC64) += mdesc.o
55obj-$(CONFIG_SPARC64) += pcr.o
56obj-$(CONFIG_SPARC64) += nmi.o
55 57
56# sparc32 do not use GENERIC_HARDIRQS but uses the generic devres implementation 58# sparc32 do not use GENERIC_HARDIRQS but uses the generic devres implementation
57obj-$(CONFIG_SPARC32) += devres.o 59obj-$(CONFIG_SPARC32) += devres.o
diff --git a/arch/sparc/kernel/auxio_32.c b/arch/sparc/kernel/auxio_32.c
index 09c857215a52..45c41232fc4c 100644
--- a/arch/sparc/kernel/auxio_32.c
+++ b/arch/sparc/kernel/auxio_32.c
@@ -76,6 +76,7 @@ unsigned char get_auxio(void)
76 return sbus_readb(auxio_register); 76 return sbus_readb(auxio_register);
77 return 0; 77 return 0;
78} 78}
79EXPORT_SYMBOL(get_auxio);
79 80
80void set_auxio(unsigned char bits_on, unsigned char bits_off) 81void set_auxio(unsigned char bits_on, unsigned char bits_off)
81{ 82{
@@ -102,7 +103,7 @@ void set_auxio(unsigned char bits_on, unsigned char bits_off)
102 }; 103 };
103 spin_unlock_irqrestore(&auxio_lock, flags); 104 spin_unlock_irqrestore(&auxio_lock, flags);
104} 105}
105 106EXPORT_SYMBOL(set_auxio);
106 107
107/* sun4m power control register (AUXIO2) */ 108/* sun4m power control register (AUXIO2) */
108 109
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 8b67347d4221..9f52db2d441c 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -72,6 +72,7 @@ void auxio_set_led(int on)
72 bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED); 72 bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED);
73 __auxio_set_bit(bit, on, ebus); 73 __auxio_set_bit(bit, on, ebus);
74} 74}
75EXPORT_SYMBOL(auxio_set_led);
75 76
76static void __auxio_sbus_set_lte(int on) 77static void __auxio_sbus_set_lte(int on)
77{ 78{
@@ -90,6 +91,7 @@ void auxio_set_lte(int on)
90 break; 91 break;
91 } 92 }
92} 93}
94EXPORT_SYMBOL(auxio_set_lte);
93 95
94static struct of_device_id __initdata auxio_match[] = { 96static struct of_device_id __initdata auxio_match[] = {
95 { 97 {
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
index 05f1c916db06..f3b5466c389c 100644
--- a/arch/sparc/kernel/central.c
+++ b/arch/sparc/kernel/central.c
@@ -103,6 +103,7 @@ static int __devinit clock_board_probe(struct of_device *op,
103 p->leds_resource.name = "leds"; 103 p->leds_resource.name = "leds";
104 104
105 p->leds_pdev.name = "sunfire-clockboard-leds"; 105 p->leds_pdev.name = "sunfire-clockboard-leds";
106 p->leds_pdev.id = -1;
106 p->leds_pdev.resource = &p->leds_resource; 107 p->leds_pdev.resource = &p->leds_resource;
107 p->leds_pdev.num_resources = 1; 108 p->leds_pdev.num_resources = 1;
108 p->leds_pdev.dev.parent = &op->dev; 109 p->leds_pdev.dev.parent = &op->dev;
@@ -197,6 +198,7 @@ static int __devinit fhc_probe(struct of_device *op,
197 p->leds_resource.name = "leds"; 198 p->leds_resource.name = "leds";
198 199
199 p->leds_pdev.name = "sunfire-fhc-leds"; 200 p->leds_pdev.name = "sunfire-fhc-leds";
201 p->leds_pdev.id = p->board_num;
200 p->leds_pdev.resource = &p->leds_resource; 202 p->leds_pdev.resource = &p->leds_resource;
201 p->leds_pdev.num_resources = 1; 203 p->leds_pdev.num_resources = 1;
202 p->leds_pdev.dev.parent = &op->dev; 204 p->leds_pdev.dev.parent = &op->dev;
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
index 3b9f4d6e14a9..e1a9598e2a4d 100644
--- a/arch/sparc/kernel/chmc.c
+++ b/arch/sparc/kernel/chmc.c
@@ -306,6 +306,7 @@ static int jbusmc_print_dimm(int syndrome_code,
306 buf[1] = '?'; 306 buf[1] = '?';
307 buf[2] = '?'; 307 buf[2] = '?';
308 buf[3] = '\0'; 308 buf[3] = '\0';
309 return 0;
309 } 310 }
310 p = dp->controller; 311 p = dp->controller;
311 prop = &p->layout; 312 prop = &p->layout;
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index 6c2da2420f76..d85c3dc4953a 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/module.h>
8#include <linux/init.h> 9#include <linux/init.h>
9#include <linux/smp.h> 10#include <linux/smp.h>
10#include <linux/threads.h> 11#include <linux/threads.h>
@@ -20,10 +21,12 @@
20#include "kernel.h" 21#include "kernel.h"
21 22
22DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; 23DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
24EXPORT_PER_CPU_SYMBOL(__cpu_data);
23 25
24struct cpu_info { 26struct cpu_info {
25 int psr_vers; 27 int psr_vers;
26 const char *name; 28 const char *name;
29 const char *pmu_name;
27}; 30};
28 31
29struct fpu_info { 32struct fpu_info {
@@ -43,6 +46,9 @@ struct manufacturer_info {
43#define CPU(ver, _name) \ 46#define CPU(ver, _name) \
44{ .psr_vers = ver, .name = _name } 47{ .psr_vers = ver, .name = _name }
45 48
49#define CPU_PMU(ver, _name, _pmu_name) \
50{ .psr_vers = ver, .name = _name, .pmu_name = _pmu_name }
51
46#define FPU(ver, _name) \ 52#define FPU(ver, _name) \
47{ .fp_vers = ver, .name = _name } 53{ .fp_vers = ver, .name = _name }
48 54
@@ -181,10 +187,10 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
181},{ 187},{
182 0x17, 188 0x17,
183 .cpu_info = { 189 .cpu_info = {
184 CPU(0x10, "TI UltraSparc I (SpitFire)"), 190 CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
185 CPU(0x11, "TI UltraSparc II (BlackBird)"), 191 CPU_PMU(0x11, "TI UltraSparc II (BlackBird)", "ultra12"),
186 CPU(0x12, "TI UltraSparc IIi (Sabre)"), 192 CPU_PMU(0x12, "TI UltraSparc IIi (Sabre)", "ultra12"),
187 CPU(0x13, "TI UltraSparc IIe (Hummingbird)"), 193 CPU_PMU(0x13, "TI UltraSparc IIe (Hummingbird)", "ultra12"),
188 CPU(-1, NULL) 194 CPU(-1, NULL)
189 }, 195 },
190 .fpu_info = { 196 .fpu_info = {
@@ -197,7 +203,7 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
197},{ 203},{
198 0x22, 204 0x22,
199 .cpu_info = { 205 .cpu_info = {
200 CPU(0x10, "TI UltraSparc I (SpitFire)"), 206 CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
201 CPU(-1, NULL) 207 CPU(-1, NULL)
202 }, 208 },
203 .fpu_info = { 209 .fpu_info = {
@@ -207,12 +213,12 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
207},{ 213},{
208 0x3e, 214 0x3e,
209 .cpu_info = { 215 .cpu_info = {
210 CPU(0x14, "TI UltraSparc III (Cheetah)"), 216 CPU_PMU(0x14, "TI UltraSparc III (Cheetah)", "ultra3"),
211 CPU(0x15, "TI UltraSparc III+ (Cheetah+)"), 217 CPU_PMU(0x15, "TI UltraSparc III+ (Cheetah+)", "ultra3+"),
212 CPU(0x16, "TI UltraSparc IIIi (Jalapeno)"), 218 CPU_PMU(0x16, "TI UltraSparc IIIi (Jalapeno)", "ultra3i"),
213 CPU(0x18, "TI UltraSparc IV (Jaguar)"), 219 CPU_PMU(0x18, "TI UltraSparc IV (Jaguar)", "ultra3+"),
214 CPU(0x19, "TI UltraSparc IV+ (Panther)"), 220 CPU_PMU(0x19, "TI UltraSparc IV+ (Panther)", "ultra4+"),
215 CPU(0x22, "TI UltraSparc IIIi+ (Serrano)"), 221 CPU_PMU(0x22, "TI UltraSparc IIIi+ (Serrano)", "ultra3i"),
216 CPU(-1, NULL) 222 CPU(-1, NULL)
217 }, 223 },
218 .fpu_info = { 224 .fpu_info = {
@@ -232,29 +238,44 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
232 238
233const char *sparc_cpu_type; 239const char *sparc_cpu_type;
234const char *sparc_fpu_type; 240const char *sparc_fpu_type;
241const char *sparc_pmu_type;
235 242
236unsigned int fsr_storage; 243unsigned int fsr_storage;
237 244
238static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers) 245static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers)
239{ 246{
247 const struct manufacturer_info *manuf;
248 int i;
249
240 sparc_cpu_type = NULL; 250 sparc_cpu_type = NULL;
241 sparc_fpu_type = NULL; 251 sparc_fpu_type = NULL;
242 if (psr_impl < ARRAY_SIZE(manufacturer_info)) 252 sparc_pmu_type = NULL;
253 manuf = NULL;
254
255 for (i = 0; i < ARRAY_SIZE(manufacturer_info); i++)
256 {
257 if (psr_impl == manufacturer_info[i].psr_impl) {
258 manuf = &manufacturer_info[i];
259 break;
260 }
261 }
262 if (manuf != NULL)
243 { 263 {
244 const struct cpu_info *cpu; 264 const struct cpu_info *cpu;
245 const struct fpu_info *fpu; 265 const struct fpu_info *fpu;
246 266
247 cpu = &manufacturer_info[psr_impl].cpu_info[0]; 267 cpu = &manuf->cpu_info[0];
248 while (cpu->psr_vers != -1) 268 while (cpu->psr_vers != -1)
249 { 269 {
250 if (cpu->psr_vers == psr_vers) { 270 if (cpu->psr_vers == psr_vers) {
251 sparc_cpu_type = cpu->name; 271 sparc_cpu_type = cpu->name;
272 sparc_pmu_type = cpu->pmu_name;
252 sparc_fpu_type = "No FPU"; 273 sparc_fpu_type = "No FPU";
253 break; 274 break;
254 } 275 }
255 cpu++; 276 cpu++;
256 } 277 }
257 fpu = &manufacturer_info[psr_impl].fpu_info[0]; 278 fpu = &manuf->fpu_info[0];
258 while (fpu->fp_vers != -1) 279 while (fpu->fp_vers != -1)
259 { 280 {
260 if (fpu->fp_vers == fpu_vers) { 281 if (fpu->fp_vers == fpu_vers) {
@@ -276,6 +297,8 @@ static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers)
276 psr_impl, fpu_vers); 297 psr_impl, fpu_vers);
277 sparc_fpu_type = "Unknown FPU"; 298 sparc_fpu_type = "Unknown FPU";
278 } 299 }
300 if (sparc_pmu_type == NULL)
301 sparc_pmu_type = "Unknown PMU";
279} 302}
280 303
281#ifdef CONFIG_SPARC32 304#ifdef CONFIG_SPARC32
@@ -301,11 +324,13 @@ static void __init sun4v_cpu_probe(void)
301 case SUN4V_CHIP_NIAGARA1: 324 case SUN4V_CHIP_NIAGARA1:
302 sparc_cpu_type = "UltraSparc T1 (Niagara)"; 325 sparc_cpu_type = "UltraSparc T1 (Niagara)";
303 sparc_fpu_type = "UltraSparc T1 integrated FPU"; 326 sparc_fpu_type = "UltraSparc T1 integrated FPU";
327 sparc_pmu_type = "niagara";
304 break; 328 break;
305 329
306 case SUN4V_CHIP_NIAGARA2: 330 case SUN4V_CHIP_NIAGARA2:
307 sparc_cpu_type = "UltraSparc T2 (Niagara2)"; 331 sparc_cpu_type = "UltraSparc T2 (Niagara2)";
308 sparc_fpu_type = "UltraSparc T2 integrated FPU"; 332 sparc_fpu_type = "UltraSparc T2 integrated FPU";
333 sparc_pmu_type = "niagara2";
309 break; 334 break;
310 335
311 default: 336 default:
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index faf9ccd9ef5d..f41ecc5ac0b4 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -1088,8 +1088,8 @@ sunos_execv:
1088 ld [%sp + STACKFRAME_SZ + PT_I0], %o0 1088 ld [%sp + STACKFRAME_SZ + PT_I0], %o0
1089 1089
1090 .align 4 1090 .align 4
1091 .globl sys_pipe 1091 .globl sys_sparc_pipe
1092sys_pipe: 1092sys_sparc_pipe:
1093 mov %o7, %l5 1093 mov %o7, %l5
1094 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg 1094 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg
1095 call sparc_pipe 1095 call sparc_pipe
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index 8ffee714f932..a46c3a21e26d 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -891,10 +891,35 @@ prom_tba: .xword 0
891tlb_type: .word 0 /* Must NOT end up in BSS */ 891tlb_type: .word 0 /* Must NOT end up in BSS */
892 .section ".fixup",#alloc,#execinstr 892 .section ".fixup",#alloc,#execinstr
893 893
894 .globl __ret_efault, __retl_efault 894 .globl __ret_efault, __retl_efault, __ret_one, __retl_one
895__ret_efault: 895ENTRY(__ret_efault)
896 ret 896 ret
897 restore %g0, -EFAULT, %o0 897 restore %g0, -EFAULT, %o0
898__retl_efault: 898ENDPROC(__ret_efault)
899
900ENTRY(__retl_efault)
899 retl 901 retl
900 mov -EFAULT, %o0 902 mov -EFAULT, %o0
903ENDPROC(__retl_efault)
904
905ENTRY(__retl_one)
906 retl
907 mov 1, %o0
908ENDPROC(__retl_one)
909
910ENTRY(__ret_one_asi)
911 wr %g0, ASI_AIUS, %asi
912 ret
913 restore %g0, 1, %o0
914ENDPROC(__ret_one_asi)
915
916ENTRY(__retl_one_asi)
917 wr %g0, ASI_AIUS, %asi
918 retl
919 mov 1, %o0
920ENDPROC(__retl_one_asi)
921
922ENTRY(__retl_o1)
923 retl
924 mov %o1, %o0
925ENDPROC(__retl_o1)
diff --git a/arch/sparc/kernel/idprom.c b/arch/sparc/kernel/idprom.c
index c16135e0c151..57922f69c3f7 100644
--- a/arch/sparc/kernel/idprom.c
+++ b/arch/sparc/kernel/idprom.c
@@ -8,11 +8,14 @@
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/module.h>
11 12
12#include <asm/oplib.h> 13#include <asm/oplib.h>
13#include <asm/idprom.h> 14#include <asm/idprom.h>
14 15
15struct idprom *idprom; 16struct idprom *idprom;
17EXPORT_SYMBOL(idprom);
18
16static struct idprom idprom_buffer; 19static struct idprom idprom_buffer;
17 20
18#ifdef CONFIG_SPARC32 21#ifdef CONFIG_SPARC32
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 7ce14f05eb48..87ea0d03d975 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -120,6 +120,7 @@ void __iomem *ioremap(unsigned long offset, unsigned long size)
120 sprintf(name, "phys_%08x", (u32)offset); 120 sprintf(name, "phys_%08x", (u32)offset);
121 return _sparc_alloc_io(0, offset, size, name); 121 return _sparc_alloc_io(0, offset, size, name);
122} 122}
123EXPORT_SYMBOL(ioremap);
123 124
124/* 125/*
125 * Comlimentary to ioremap(). 126 * Comlimentary to ioremap().
@@ -141,6 +142,7 @@ void iounmap(volatile void __iomem *virtual)
141 kfree(res); 142 kfree(res);
142 } 143 }
143} 144}
145EXPORT_SYMBOL(iounmap);
144 146
145void __iomem *of_ioremap(struct resource *res, unsigned long offset, 147void __iomem *of_ioremap(struct resource *res, unsigned long offset,
146 unsigned long size, char *name) 148 unsigned long size, char *name)
@@ -237,6 +239,7 @@ void sbus_set_sbus64(struct device *dev, int x)
237{ 239{
238 printk("sbus_set_sbus64: unsupported\n"); 240 printk("sbus_set_sbus64: unsupported\n");
239} 241}
242EXPORT_SYMBOL(sbus_set_sbus64);
240 243
241/* 244/*
242 * Allocate a chunk of memory suitable for DMA. 245 * Allocate a chunk of memory suitable for DMA.
@@ -436,6 +439,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t len, dma_addr_t *pba)
436 *pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */ 439 *pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */
437 return (void *) res->start; 440 return (void *) res->start;
438} 441}
442EXPORT_SYMBOL(pci_alloc_consistent);
439 443
440/* Free and unmap a consistent DMA buffer. 444/* Free and unmap a consistent DMA buffer.
441 * cpu_addr is what was returned from pci_alloc_consistent, 445 * cpu_addr is what was returned from pci_alloc_consistent,
@@ -477,6 +481,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba)
477 481
478 free_pages(pgp, get_order(n)); 482 free_pages(pgp, get_order(n));
479} 483}
484EXPORT_SYMBOL(pci_free_consistent);
480 485
481/* Map a single buffer of the indicated size for DMA in streaming mode. 486/* Map a single buffer of the indicated size for DMA in streaming mode.
482 * The 32-bit bus address to use is returned. 487 * The 32-bit bus address to use is returned.
@@ -491,6 +496,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
491 /* IIep is write-through, not flushing. */ 496 /* IIep is write-through, not flushing. */
492 return virt_to_phys(ptr); 497 return virt_to_phys(ptr);
493} 498}
499EXPORT_SYMBOL(pci_map_single);
494 500
495/* Unmap a single streaming mode DMA translation. The dma_addr and size 501/* Unmap a single streaming mode DMA translation. The dma_addr and size
496 * must match what was provided for in a previous pci_map_single call. All 502 * must match what was provided for in a previous pci_map_single call. All
@@ -508,6 +514,7 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
508 (size + PAGE_SIZE-1) & PAGE_MASK); 514 (size + PAGE_SIZE-1) & PAGE_MASK);
509 } 515 }
510} 516}
517EXPORT_SYMBOL(pci_unmap_single);
511 518
512/* 519/*
513 * Same as pci_map_single, but with pages. 520 * Same as pci_map_single, but with pages.
@@ -519,6 +526,7 @@ dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
519 /* IIep is write-through, not flushing. */ 526 /* IIep is write-through, not flushing. */
520 return page_to_phys(page) + offset; 527 return page_to_phys(page) + offset;
521} 528}
529EXPORT_SYMBOL(pci_map_page);
522 530
523void pci_unmap_page(struct pci_dev *hwdev, 531void pci_unmap_page(struct pci_dev *hwdev,
524 dma_addr_t dma_address, size_t size, int direction) 532 dma_addr_t dma_address, size_t size, int direction)
@@ -526,6 +534,7 @@ void pci_unmap_page(struct pci_dev *hwdev,
526 BUG_ON(direction == PCI_DMA_NONE); 534 BUG_ON(direction == PCI_DMA_NONE);
527 /* mmu_inval_dma_area XXX */ 535 /* mmu_inval_dma_area XXX */
528} 536}
537EXPORT_SYMBOL(pci_unmap_page);
529 538
530/* Map a set of buffers described by scatterlist in streaming 539/* Map a set of buffers described by scatterlist in streaming
531 * mode for DMA. This is the scather-gather version of the 540 * mode for DMA. This is the scather-gather version of the
@@ -557,6 +566,7 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
557 } 566 }
558 return nents; 567 return nents;
559} 568}
569EXPORT_SYMBOL(pci_map_sg);
560 570
561/* Unmap a set of streaming mode DMA translations. 571/* Unmap a set of streaming mode DMA translations.
562 * Again, cpu read rules concerning calls here are the same as for 572 * Again, cpu read rules concerning calls here are the same as for
@@ -578,6 +588,7 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
578 } 588 }
579 } 589 }
580} 590}
591EXPORT_SYMBOL(pci_unmap_sg);
581 592
582/* Make physical memory consistent for a single 593/* Make physical memory consistent for a single
583 * streaming mode DMA translation before or after a transfer. 594 * streaming mode DMA translation before or after a transfer.
@@ -597,6 +608,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t si
597 (size + PAGE_SIZE-1) & PAGE_MASK); 608 (size + PAGE_SIZE-1) & PAGE_MASK);
598 } 609 }
599} 610}
611EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
600 612
601void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction) 613void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
602{ 614{
@@ -606,6 +618,7 @@ void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t
606 (size + PAGE_SIZE-1) & PAGE_MASK); 618 (size + PAGE_SIZE-1) & PAGE_MASK);
607 } 619 }
608} 620}
621EXPORT_SYMBOL(pci_dma_sync_single_for_device);
609 622
610/* Make physical memory consistent for a set of streaming 623/* Make physical memory consistent for a set of streaming
611 * mode DMA translations after a transfer. 624 * mode DMA translations after a transfer.
@@ -628,6 +641,7 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sgl, int
628 } 641 }
629 } 642 }
630} 643}
644EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
631 645
632void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, int direction) 646void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, int direction)
633{ 647{
@@ -644,6 +658,7 @@ void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl,
644 } 658 }
645 } 659 }
646} 660}
661EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
647#endif /* CONFIG_PCI */ 662#endif /* CONFIG_PCI */
648 663
649#ifdef CONFIG_PROC_FS 664#ifdef CONFIG_PROC_FS
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c
index 1eff942fe22f..44dd5ee64339 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -294,6 +294,7 @@ void synchronize_irq(unsigned int irq)
294 while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS) 294 while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS)
295 cpu_relax(); 295 cpu_relax();
296} 296}
297EXPORT_SYMBOL(synchronize_irq);
297#endif /* SMP */ 298#endif /* SMP */
298 299
299void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs) 300void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index cab8e0286871..3d2c6baae96b 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -196,6 +196,11 @@ int show_interrupts(struct seq_file *p, void *v)
196 seq_putc(p, '\n'); 196 seq_putc(p, '\n');
197skip: 197skip:
198 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 198 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
199 } else if (i == NR_IRQS) {
200 seq_printf(p, "NMI: ");
201 for_each_online_cpu(j)
202 seq_printf(p, "%10u ", cpu_data(j).__nmi_count);
203 seq_printf(p, " Non-maskable interrupts\n");
199 } 204 }
200 return 0; 205 return 0;
201} 206}
@@ -247,9 +252,10 @@ struct irq_handler_data {
247#ifdef CONFIG_SMP 252#ifdef CONFIG_SMP
248static int irq_choose_cpu(unsigned int virt_irq) 253static int irq_choose_cpu(unsigned int virt_irq)
249{ 254{
250 cpumask_t mask = irq_desc[virt_irq].affinity; 255 cpumask_t mask;
251 int cpuid; 256 int cpuid;
252 257
258 cpumask_copy(&mask, irq_desc[virt_irq].affinity);
253 if (cpus_equal(mask, CPU_MASK_ALL)) { 259 if (cpus_equal(mask, CPU_MASK_ALL)) {
254 static int irq_rover; 260 static int irq_rover;
255 static DEFINE_SPINLOCK(irq_rover_lock); 261 static DEFINE_SPINLOCK(irq_rover_lock);
@@ -778,69 +784,6 @@ void do_softirq(void)
778 local_irq_restore(flags); 784 local_irq_restore(flags);
779} 785}
780 786
781static void unhandled_perf_irq(struct pt_regs *regs)
782{
783 unsigned long pcr, pic;
784
785 read_pcr(pcr);
786 read_pic(pic);
787
788 write_pcr(0);
789
790 printk(KERN_EMERG "CPU %d: Got unexpected perf counter IRQ.\n",
791 smp_processor_id());
792 printk(KERN_EMERG "CPU %d: PCR[%016lx] PIC[%016lx]\n",
793 smp_processor_id(), pcr, pic);
794}
795
796/* Almost a direct copy of the powerpc PMC code. */
797static DEFINE_SPINLOCK(perf_irq_lock);
798static void *perf_irq_owner_caller; /* mostly for debugging */
799static void (*perf_irq)(struct pt_regs *regs) = unhandled_perf_irq;
800
801/* Invoked from level 15 PIL handler in trap table. */
802void perfctr_irq(int irq, struct pt_regs *regs)
803{
804 clear_softint(1 << irq);
805 perf_irq(regs);
806}
807
808int register_perfctr_intr(void (*handler)(struct pt_regs *))
809{
810 int ret;
811
812 if (!handler)
813 return -EINVAL;
814
815 spin_lock(&perf_irq_lock);
816 if (perf_irq != unhandled_perf_irq) {
817 printk(KERN_WARNING "register_perfctr_intr: "
818 "perf IRQ busy (reserved by caller %p)\n",
819 perf_irq_owner_caller);
820 ret = -EBUSY;
821 goto out;
822 }
823
824 perf_irq_owner_caller = __builtin_return_address(0);
825 perf_irq = handler;
826
827 ret = 0;
828out:
829 spin_unlock(&perf_irq_lock);
830
831 return ret;
832}
833EXPORT_SYMBOL_GPL(register_perfctr_intr);
834
835void release_perfctr_intr(void (*handler)(struct pt_regs *))
836{
837 spin_lock(&perf_irq_lock);
838 perf_irq_owner_caller = NULL;
839 perf_irq = unhandled_perf_irq;
840 spin_unlock(&perf_irq_lock);
841}
842EXPORT_SYMBOL_GPL(release_perfctr_intr);
843
844#ifdef CONFIG_HOTPLUG_CPU 787#ifdef CONFIG_HOTPLUG_CPU
845void fixup_irqs(void) 788void fixup_irqs(void)
846{ 789{
@@ -854,7 +797,7 @@ void fixup_irqs(void)
854 !(irq_desc[irq].status & IRQ_PER_CPU)) { 797 !(irq_desc[irq].status & IRQ_PER_CPU)) {
855 if (irq_desc[irq].chip->set_affinity) 798 if (irq_desc[irq].chip->set_affinity)
856 irq_desc[irq].chip->set_affinity(irq, 799 irq_desc[irq].chip->set_affinity(irq,
857 &irq_desc[irq].affinity); 800 irq_desc[irq].affinity);
858 } 801 }
859 spin_unlock_irqrestore(&irq_desc[irq].lock, flags); 802 spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
860 } 803 }
diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h
index 81a972e8d8ea..15d8a3f645c9 100644
--- a/arch/sparc/kernel/kernel.h
+++ b/arch/sparc/kernel/kernel.h
@@ -5,6 +5,7 @@
5 5
6/* cpu.c */ 6/* cpu.c */
7extern const char *sparc_cpu_type; 7extern const char *sparc_cpu_type;
8extern const char *sparc_pmu_type;
8extern const char *sparc_fpu_type; 9extern const char *sparc_fpu_type;
9 10
10extern unsigned int fsr_storage; 11extern unsigned int fsr_storage;
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c
new file mode 100644
index 000000000000..f3577223c863
--- /dev/null
+++ b/arch/sparc/kernel/nmi.c
@@ -0,0 +1,225 @@
1/* Pseudo NMI support on sparc64 systems.
2 *
3 * Copyright (C) 2009 David S. Miller <davem@davemloft.net>
4 *
5 * The NMI watchdog support and infrastructure is based almost
6 * entirely upon the x86 NMI support code.
7 */
8#include <linux/kernel.h>
9#include <linux/param.h>
10#include <linux/init.h>
11#include <linux/percpu.h>
12#include <linux/nmi.h>
13#include <linux/module.h>
14#include <linux/kprobes.h>
15#include <linux/kernel_stat.h>
16#include <linux/slab.h>
17#include <linux/kdebug.h>
18#include <linux/delay.h>
19#include <linux/smp.h>
20
21#include <asm/ptrace.h>
22#include <asm/local.h>
23#include <asm/pcr.h>
24
25/* We don't have a real NMI on sparc64, but we can fake one
26 * up using profiling counter overflow interrupts and interrupt
27 * levels.
28 *
29 * The profile overflow interrupts at level 15, so we use
30 * level 14 as our IRQ off level.
31 */
32
33static int nmi_watchdog_active;
34static int panic_on_timeout;
35
36int nmi_usable;
37EXPORT_SYMBOL_GPL(nmi_usable);
38
39static unsigned int nmi_hz = HZ;
40
41static DEFINE_PER_CPU(unsigned int, last_irq_sum);
42static DEFINE_PER_CPU(local_t, alert_counter);
43static DEFINE_PER_CPU(int, nmi_touch);
44
45void touch_nmi_watchdog(void)
46{
47 if (nmi_watchdog_active) {
48 int cpu;
49
50 for_each_present_cpu(cpu) {
51 if (per_cpu(nmi_touch, cpu) != 1)
52 per_cpu(nmi_touch, cpu) = 1;
53 }
54 }
55
56 touch_softlockup_watchdog();
57}
58EXPORT_SYMBOL(touch_nmi_watchdog);
59
60static void die_nmi(const char *str, struct pt_regs *regs, int do_panic)
61{
62 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0,
63 pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
64 return;
65
66 console_verbose();
67 bust_spinlocks(1);
68
69 printk(KERN_EMERG "%s", str);
70 printk(" on CPU%d, ip %08lx, registers:\n",
71 smp_processor_id(), regs->tpc);
72 show_regs(regs);
73 dump_stack();
74
75 bust_spinlocks(0);
76
77 if (do_panic || panic_on_oops)
78 panic("Non maskable interrupt");
79
80 local_irq_enable();
81 do_exit(SIGBUS);
82}
83
84notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
85{
86 unsigned int sum, touched = 0;
87 int cpu = smp_processor_id();
88
89 clear_softint(1 << irq);
90 pcr_ops->write(PCR_PIC_PRIV);
91
92 local_cpu_data().__nmi_count++;
93
94 if (notify_die(DIE_NMI, "nmi", regs, 0,
95 pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
96 touched = 1;
97
98 sum = kstat_irqs_cpu(0, cpu);
99 if (__get_cpu_var(nmi_touch)) {
100 __get_cpu_var(nmi_touch) = 0;
101 touched = 1;
102 }
103 if (!touched && __get_cpu_var(last_irq_sum) == sum) {
104 local_inc(&__get_cpu_var(alert_counter));
105 if (local_read(&__get_cpu_var(alert_counter)) == 5 * nmi_hz)
106 die_nmi("BUG: NMI Watchdog detected LOCKUP",
107 regs, panic_on_timeout);
108 } else {
109 __get_cpu_var(last_irq_sum) = sum;
110 local_set(&__get_cpu_var(alert_counter), 0);
111 }
112 if (nmi_usable) {
113 write_pic(picl_value(nmi_hz));
114 pcr_ops->write(pcr_enable);
115 }
116}
117
118static inline unsigned int get_nmi_count(int cpu)
119{
120 return cpu_data(cpu).__nmi_count;
121}
122
123static int endflag __initdata;
124
125static __init void nmi_cpu_busy(void *data)
126{
127 local_irq_enable_in_hardirq();
128 while (endflag == 0)
129 mb();
130}
131
132static void report_broken_nmi(int cpu, int *prev_nmi_count)
133{
134 printk(KERN_CONT "\n");
135
136 printk(KERN_WARNING
137 "WARNING: CPU#%d: NMI appears to be stuck (%d->%d)!\n",
138 cpu, prev_nmi_count[cpu], get_nmi_count(cpu));
139
140 printk(KERN_WARNING
141 "Please report this to bugzilla.kernel.org,\n");
142 printk(KERN_WARNING
143 "and attach the output of the 'dmesg' command.\n");
144
145 nmi_usable = 0;
146}
147
148static void stop_watchdog(void *unused)
149{
150 pcr_ops->write(PCR_PIC_PRIV);
151}
152
153static int __init check_nmi_watchdog(void)
154{
155 unsigned int *prev_nmi_count;
156 int cpu, err;
157
158 prev_nmi_count = kmalloc(nr_cpu_ids * sizeof(unsigned int), GFP_KERNEL);
159 if (!prev_nmi_count) {
160 err = -ENOMEM;
161 goto error;
162 }
163
164 printk(KERN_INFO "Testing NMI watchdog ... ");
165
166 smp_call_function(nmi_cpu_busy, (void *)&endflag, 0);
167
168 for_each_possible_cpu(cpu)
169 prev_nmi_count[cpu] = get_nmi_count(cpu);
170 local_irq_enable();
171 mdelay((20 * 1000) / nmi_hz); /* wait 20 ticks */
172
173 for_each_online_cpu(cpu) {
174 if (get_nmi_count(cpu) - prev_nmi_count[cpu] <= 5)
175 report_broken_nmi(cpu, prev_nmi_count);
176 }
177 endflag = 1;
178 if (!nmi_usable) {
179 kfree(prev_nmi_count);
180 err = -ENODEV;
181 goto error;
182 }
183 printk("OK.\n");
184
185 nmi_hz = 1;
186
187 kfree(prev_nmi_count);
188 return 0;
189error:
190 on_each_cpu(stop_watchdog, NULL, 1);
191 return err;
192}
193
194static void start_watchdog(void *unused)
195{
196 pcr_ops->write(PCR_PIC_PRIV);
197 write_pic(picl_value(nmi_hz));
198
199 pcr_ops->write(pcr_enable);
200}
201
202void nmi_adjust_hz(unsigned int new_hz)
203{
204 nmi_hz = new_hz;
205 on_each_cpu(start_watchdog, NULL, 1);
206}
207EXPORT_SYMBOL_GPL(nmi_adjust_hz);
208
209int __init nmi_init(void)
210{
211 nmi_usable = 1;
212
213 on_each_cpu(start_watchdog, NULL, 1);
214
215 return check_nmi_watchdog();
216}
217
218static int __init setup_nmi_watchdog(char *str)
219{
220 if (!strncmp(str, "panic", 5))
221 panic_on_timeout = 1;
222
223 return 0;
224}
225__setup("nmi_watchdog=", setup_nmi_watchdog);
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 923e9bbb9fe2..4638fba799e4 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -1077,6 +1077,7 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
1077 1077
1078 return (device_mask & dma_addr_mask) == dma_addr_mask; 1078 return (device_mask & dma_addr_mask) == dma_addr_mask;
1079} 1079}
1080EXPORT_SYMBOL(pci_dma_supported);
1080 1081
1081void pci_resource_to_user(const struct pci_dev *pdev, int bar, 1082void pci_resource_to_user(const struct pci_dev *pdev, int bar,
1082 const struct resource *rp, resource_size_t *start, 1083 const struct resource *rp, resource_size_t *start,
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 75ed98be3edf..85e7037429b9 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -956,6 +956,7 @@ void outsb(unsigned long addr, const void *src, unsigned long count)
956 /* addr += 1; */ 956 /* addr += 1; */
957 } 957 }
958} 958}
959EXPORT_SYMBOL(outsb);
959 960
960void outsw(unsigned long addr, const void *src, unsigned long count) 961void outsw(unsigned long addr, const void *src, unsigned long count)
961{ 962{
@@ -966,6 +967,7 @@ void outsw(unsigned long addr, const void *src, unsigned long count)
966 /* addr += 2; */ 967 /* addr += 2; */
967 } 968 }
968} 969}
970EXPORT_SYMBOL(outsw);
969 971
970void outsl(unsigned long addr, const void *src, unsigned long count) 972void outsl(unsigned long addr, const void *src, unsigned long count)
971{ 973{
@@ -976,6 +978,7 @@ void outsl(unsigned long addr, const void *src, unsigned long count)
976 /* addr += 4; */ 978 /* addr += 4; */
977 } 979 }
978} 980}
981EXPORT_SYMBOL(outsl);
979 982
980void insb(unsigned long addr, void *dst, unsigned long count) 983void insb(unsigned long addr, void *dst, unsigned long count)
981{ 984{
@@ -986,6 +989,7 @@ void insb(unsigned long addr, void *dst, unsigned long count)
986 /* addr += 1; */ 989 /* addr += 1; */
987 } 990 }
988} 991}
992EXPORT_SYMBOL(insb);
989 993
990void insw(unsigned long addr, void *dst, unsigned long count) 994void insw(unsigned long addr, void *dst, unsigned long count)
991{ 995{
@@ -996,6 +1000,7 @@ void insw(unsigned long addr, void *dst, unsigned long count)
996 /* addr += 2; */ 1000 /* addr += 2; */
997 } 1001 }
998} 1002}
1003EXPORT_SYMBOL(insw);
999 1004
1000void insl(unsigned long addr, void *dst, unsigned long count) 1005void insl(unsigned long addr, void *dst, unsigned long count)
1001{ 1006{
@@ -1009,5 +1014,6 @@ void insl(unsigned long addr, void *dst, unsigned long count)
1009 /* addr += 4; */ 1014 /* addr += 4; */
1010 } 1015 }
1011} 1016}
1017EXPORT_SYMBOL(insl);
1012 1018
1013subsys_initcall(pcic_init); 1019subsys_initcall(pcic_init);
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c
new file mode 100644
index 000000000000..1ae8cdd7e703
--- /dev/null
+++ b/arch/sparc/kernel/pcr.c
@@ -0,0 +1,158 @@
1/* pcr.c: Generic sparc64 performance counter infrastructure.
2 *
3 * Copyright (C) 2009 David S. Miller (davem@davemloft.net)
4 */
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <linux/init.h>
8#include <linux/irq.h>
9
10#include <asm/pil.h>
11#include <asm/pcr.h>
12#include <asm/nmi.h>
13
14/* This code is shared between various users of the performance
15 * counters. Users will be oprofile, pseudo-NMI watchdog, and the
16 * perf_counter support layer.
17 */
18
19#define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE)
20#define PCR_N2_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE | \
21 PCR_N2_TOE_OV1 | \
22 (2 << PCR_N2_SL1_SHIFT) | \
23 (0xff << PCR_N2_MASK1_SHIFT))
24
25u64 pcr_enable;
26unsigned int picl_shift;
27
28/* Performance counter interrupts run unmasked at PIL level 15.
29 * Therefore we can't do things like wakeups and other work
30 * that expects IRQ disabling to be adhered to in locking etc.
31 *
32 * Therefore in such situations we defer the work by signalling
33 * a lower level cpu IRQ.
34 */
35void deferred_pcr_work_irq(int irq, struct pt_regs *regs)
36{
37 clear_softint(1 << PIL_DEFERRED_PCR_WORK);
38}
39
40void schedule_deferred_pcr_work(void)
41{
42 set_softint(1 << PIL_DEFERRED_PCR_WORK);
43}
44
45const struct pcr_ops *pcr_ops;
46EXPORT_SYMBOL_GPL(pcr_ops);
47
48static u64 direct_pcr_read(void)
49{
50 u64 val;
51
52 read_pcr(val);
53 return val;
54}
55
56static void direct_pcr_write(u64 val)
57{
58 write_pcr(val);
59}
60
61static const struct pcr_ops direct_pcr_ops = {
62 .read = direct_pcr_read,
63 .write = direct_pcr_write,
64};
65
66static void n2_pcr_write(u64 val)
67{
68 unsigned long ret;
69
70 ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
71 if (val != HV_EOK)
72 write_pcr(val);
73}
74
75static const struct pcr_ops n2_pcr_ops = {
76 .read = direct_pcr_read,
77 .write = n2_pcr_write,
78};
79
80static unsigned long perf_hsvc_group;
81static unsigned long perf_hsvc_major;
82static unsigned long perf_hsvc_minor;
83
84static int __init register_perf_hsvc(void)
85{
86 if (tlb_type == hypervisor) {
87 switch (sun4v_chip_type) {
88 case SUN4V_CHIP_NIAGARA1:
89 perf_hsvc_group = HV_GRP_NIAG_PERF;
90 break;
91
92 case SUN4V_CHIP_NIAGARA2:
93 perf_hsvc_group = HV_GRP_N2_CPU;
94 break;
95
96 default:
97 return -ENODEV;
98 }
99
100
101 perf_hsvc_major = 1;
102 perf_hsvc_minor = 0;
103 if (sun4v_hvapi_register(perf_hsvc_group,
104 perf_hsvc_major,
105 &perf_hsvc_minor)) {
106 printk("perfmon: Could not register hvapi.\n");
107 return -ENODEV;
108 }
109 }
110 return 0;
111}
112
113static void __init unregister_perf_hsvc(void)
114{
115 if (tlb_type != hypervisor)
116 return;
117 sun4v_hvapi_unregister(perf_hsvc_group);
118}
119
120int __init pcr_arch_init(void)
121{
122 int err = register_perf_hsvc();
123
124 if (err)
125 return err;
126
127 switch (tlb_type) {
128 case hypervisor:
129 pcr_ops = &n2_pcr_ops;
130 pcr_enable = PCR_N2_ENABLE;
131 picl_shift = 2;
132 break;
133
134 case cheetah:
135 case cheetah_plus:
136 pcr_ops = &direct_pcr_ops;
137 pcr_enable = PCR_SUN4U_ENABLE;
138 break;
139
140 case spitfire:
141 /* UltraSPARC-I/II and derivatives lack a profile
142 * counter overflow interrupt so we can't make use of
143 * their hardware currently.
144 */
145 /* fallthrough */
146 default:
147 err = -ENODEV;
148 goto out_unregister;
149 }
150
151 return nmi_init();
152
153out_unregister:
154 unregister_perf_hsvc();
155 return err;
156}
157
158arch_initcall(pcr_arch_init);
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index 5a8d8ced33da..f4bee35a1b46 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -44,6 +44,7 @@
44 * Set in pm platform drivers (apc.c and pmc.c) 44 * Set in pm platform drivers (apc.c and pmc.c)
45 */ 45 */
46void (*pm_idle)(void); 46void (*pm_idle)(void);
47EXPORT_SYMBOL(pm_idle);
47 48
48/* 49/*
49 * Power-off handler instantiation for pm.h compliance 50 * Power-off handler instantiation for pm.h compliance
@@ -673,6 +674,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
673 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 674 "g1", "g2", "g3", "o0", "o1", "memory", "cc");
674 return retval; 675 return retval;
675} 676}
677EXPORT_SYMBOL(kernel_thread);
676 678
677unsigned long get_wchan(struct task_struct *task) 679unsigned long get_wchan(struct task_struct *task)
678{ 680{
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index d5e2acef9877..a73954b87f0a 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -29,6 +29,7 @@
29#include <linux/cpu.h> 29#include <linux/cpu.h>
30#include <linux/elfcore.h> 30#include <linux/elfcore.h>
31#include <linux/sysrq.h> 31#include <linux/sysrq.h>
32#include <linux/nmi.h>
32 33
33#include <asm/uaccess.h> 34#include <asm/uaccess.h>
34#include <asm/system.h> 35#include <asm/system.h>
@@ -52,8 +53,10 @@
52 53
53static void sparc64_yield(int cpu) 54static void sparc64_yield(int cpu)
54{ 55{
55 if (tlb_type != hypervisor) 56 if (tlb_type != hypervisor) {
57 touch_nmi_watchdog();
56 return; 58 return;
59 }
57 60
58 clear_thread_flag(TIF_POLLING_NRFLAG); 61 clear_thread_flag(TIF_POLLING_NRFLAG);
59 smp_mb__after_clear_bit(); 62 smp_mb__after_clear_bit();
@@ -678,6 +681,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
678 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 681 "g1", "g2", "g3", "o0", "o1", "memory", "cc");
679 return retval; 682 return retval;
680} 683}
684EXPORT_SYMBOL(kernel_thread);
681 685
682typedef struct { 686typedef struct {
683 union { 687 union {
@@ -743,6 +747,7 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
743 } 747 }
744 return 1; 748 return 1;
745} 749}
750EXPORT_SYMBOL(dump_fpu);
746 751
747/* 752/*
748 * sparc_execve() executes a new program after the asm stub has set 753 * sparc_execve() executes a new program after the asm stub has set
diff --git a/arch/sparc/kernel/psycho_common.c b/arch/sparc/kernel/psycho_common.c
index 40689ae3c9b0..8f1478475421 100644
--- a/arch/sparc/kernel/psycho_common.c
+++ b/arch/sparc/kernel/psycho_common.c
@@ -11,19 +11,19 @@
11#include "iommu_common.h" 11#include "iommu_common.h"
12#include "psycho_common.h" 12#include "psycho_common.h"
13 13
14#define PSYCHO_STRBUF_CTRL_DENAB 0x0000000000000002UL 14#define PSYCHO_STRBUF_CTRL_DENAB 0x0000000000000002ULL
15#define PSYCHO_STCERR_WRITE 0x0000000000000002UL 15#define PSYCHO_STCERR_WRITE 0x0000000000000002ULL
16#define PSYCHO_STCERR_READ 0x0000000000000001UL 16#define PSYCHO_STCERR_READ 0x0000000000000001ULL
17#define PSYCHO_STCTAG_PPN 0x0fffffff00000000UL 17#define PSYCHO_STCTAG_PPN 0x0fffffff00000000ULL
18#define PSYCHO_STCTAG_VPN 0x00000000ffffe000UL 18#define PSYCHO_STCTAG_VPN 0x00000000ffffe000ULL
19#define PSYCHO_STCTAG_VALID 0x0000000000000002UL 19#define PSYCHO_STCTAG_VALID 0x0000000000000002ULL
20#define PSYCHO_STCTAG_WRITE 0x0000000000000001UL 20#define PSYCHO_STCTAG_WRITE 0x0000000000000001ULL
21#define PSYCHO_STCLINE_LINDX 0x0000000001e00000UL 21#define PSYCHO_STCLINE_LINDX 0x0000000001e00000ULL
22#define PSYCHO_STCLINE_SPTR 0x00000000001f8000UL 22#define PSYCHO_STCLINE_SPTR 0x00000000001f8000ULL
23#define PSYCHO_STCLINE_LADDR 0x0000000000007f00UL 23#define PSYCHO_STCLINE_LADDR 0x0000000000007f00ULL
24#define PSYCHO_STCLINE_EPTR 0x00000000000000fcUL 24#define PSYCHO_STCLINE_EPTR 0x00000000000000fcULL
25#define PSYCHO_STCLINE_VALID 0x0000000000000002UL 25#define PSYCHO_STCLINE_VALID 0x0000000000000002ULL
26#define PSYCHO_STCLINE_FOFN 0x0000000000000001UL 26#define PSYCHO_STCLINE_FOFN 0x0000000000000001ULL
27 27
28static DEFINE_SPINLOCK(stc_buf_lock); 28static DEFINE_SPINLOCK(stc_buf_lock);
29static unsigned long stc_error_buf[128]; 29static unsigned long stc_error_buf[128];
@@ -144,10 +144,10 @@ static void psycho_record_iommu_tags_and_data(struct pci_pbm_info *pbm,
144#define PSYCHO_IOMMU_TAG_WRITE (0x1UL << 21UL) 144#define PSYCHO_IOMMU_TAG_WRITE (0x1UL << 21UL)
145#define PSYCHO_IOMMU_TAG_STREAM (0x1UL << 20UL) 145#define PSYCHO_IOMMU_TAG_STREAM (0x1UL << 20UL)
146#define PSYCHO_IOMMU_TAG_SIZE (0x1UL << 19UL) 146#define PSYCHO_IOMMU_TAG_SIZE (0x1UL << 19UL)
147#define PSYCHO_IOMMU_TAG_VPAGE 0x7ffffUL 147#define PSYCHO_IOMMU_TAG_VPAGE 0x7ffffULL
148#define PSYCHO_IOMMU_DATA_VALID (1UL << 30UL) 148#define PSYCHO_IOMMU_DATA_VALID (1UL << 30UL)
149#define PSYCHO_IOMMU_DATA_CACHE (1UL << 28UL) 149#define PSYCHO_IOMMU_DATA_CACHE (1UL << 28UL)
150#define PSYCHO_IOMMU_DATA_PPAGE 0xfffffffUL 150#define PSYCHO_IOMMU_DATA_PPAGE 0xfffffffULL
151 151
152static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm, 152static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm,
153 u64 *tag, u64 *data) 153 u64 *tag, u64 *data)
@@ -190,7 +190,7 @@ static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm,
190 pbm->name, i, 190 pbm->name, i,
191 ((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0), 191 ((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0),
192 ((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0), 192 ((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0),
193 (data_val & PSYCHO_IOMMU_DATA_PPAGE)<<IOMMU_PAGE_SHIFT); 193 (data_val & PSYCHO_IOMMU_DATA_PPAGE) << IOMMU_PAGE_SHIFT);
194 } 194 }
195} 195}
196 196
@@ -285,20 +285,20 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm)
285 return ret; 285 return ret;
286} 286}
287 287
288#define PSYCHO_PCIAFSR_PMA 0x8000000000000000UL 288#define PSYCHO_PCIAFSR_PMA 0x8000000000000000ULL
289#define PSYCHO_PCIAFSR_PTA 0x4000000000000000UL 289#define PSYCHO_PCIAFSR_PTA 0x4000000000000000ULL
290#define PSYCHO_PCIAFSR_PRTRY 0x2000000000000000UL 290#define PSYCHO_PCIAFSR_PRTRY 0x2000000000000000ULL
291#define PSYCHO_PCIAFSR_PPERR 0x1000000000000000UL 291#define PSYCHO_PCIAFSR_PPERR 0x1000000000000000ULL
292#define PSYCHO_PCIAFSR_SMA 0x0800000000000000UL 292#define PSYCHO_PCIAFSR_SMA 0x0800000000000000ULL
293#define PSYCHO_PCIAFSR_STA 0x0400000000000000UL 293#define PSYCHO_PCIAFSR_STA 0x0400000000000000ULL
294#define PSYCHO_PCIAFSR_SRTRY 0x0200000000000000UL 294#define PSYCHO_PCIAFSR_SRTRY 0x0200000000000000ULL
295#define PSYCHO_PCIAFSR_SPERR 0x0100000000000000UL 295#define PSYCHO_PCIAFSR_SPERR 0x0100000000000000ULL
296#define PSYCHO_PCIAFSR_RESV1 0x00ff000000000000UL 296#define PSYCHO_PCIAFSR_RESV1 0x00ff000000000000ULL
297#define PSYCHO_PCIAFSR_BMSK 0x0000ffff00000000UL 297#define PSYCHO_PCIAFSR_BMSK 0x0000ffff00000000ULL
298#define PSYCHO_PCIAFSR_BLK 0x0000000080000000UL 298#define PSYCHO_PCIAFSR_BLK 0x0000000080000000ULL
299#define PSYCHO_PCIAFSR_RESV2 0x0000000040000000UL 299#define PSYCHO_PCIAFSR_RESV2 0x0000000040000000ULL
300#define PSYCHO_PCIAFSR_MID 0x000000003e000000UL 300#define PSYCHO_PCIAFSR_MID 0x000000003e000000ULL
301#define PSYCHO_PCIAFSR_RESV3 0x0000000001ffffffUL 301#define PSYCHO_PCIAFSR_RESV3 0x0000000001ffffffULL
302 302
303irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) 303irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
304{ 304{
diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c
index 2ead310066d1..406e0872504e 100644
--- a/arch/sparc/kernel/sbus.c
+++ b/arch/sparc/kernel/sbus.c
@@ -117,6 +117,7 @@ void sbus_set_sbus64(struct device *dev, int bursts)
117 val |= (1UL << 4UL); 117 val |= (1UL << 4UL);
118 upa_writeq(val, cfg_reg); 118 upa_writeq(val, cfg_reg);
119} 119}
120EXPORT_SYMBOL(sbus_set_sbus64);
120 121
121/* INO number to IMAP register offset for SYSIO external IRQ's. 122/* INO number to IMAP register offset for SYSIO external IRQ's.
122 * This should conform to both Sunfire/Wildfire server and Fusion 123 * This should conform to both Sunfire/Wildfire server and Fusion
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index c96c65d1b58b..998cadb4e7f2 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -199,7 +199,9 @@ extern unsigned short ram_flags;
199extern int root_mountflags; 199extern int root_mountflags;
200 200
201char reboot_command[COMMAND_LINE_SIZE]; 201char reboot_command[COMMAND_LINE_SIZE];
202
202enum sparc_cpu sparc_cpu_model; 203enum sparc_cpu sparc_cpu_model;
204EXPORT_SYMBOL(sparc_cpu_model);
203 205
204struct tt_entry *sparc_ttable; 206struct tt_entry *sparc_ttable;
205 207
@@ -391,6 +393,7 @@ void sun_do_break(void)
391 393
392 prom_cmdline(); 394 prom_cmdline();
393} 395}
396EXPORT_SYMBOL(sun_do_break);
394 397
395int stop_a_enabled = 1; 398int stop_a_enabled = 1;
396 399
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 555db7452ebe..f2bcfd2967d7 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -58,6 +58,7 @@
58 * operations in asm/ns87303.h 58 * operations in asm/ns87303.h
59 */ 59 */
60DEFINE_SPINLOCK(ns87303_lock); 60DEFINE_SPINLOCK(ns87303_lock);
61EXPORT_SYMBOL(ns87303_lock);
61 62
62struct screen_info screen_info = { 63struct screen_info screen_info = {
63 0, 0, /* orig-x, orig-y */ 64 0, 0, /* orig-x, orig-y */
@@ -353,6 +354,7 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
353 seq_printf(m, 354 seq_printf(m,
354 "cpu\t\t: %s\n" 355 "cpu\t\t: %s\n"
355 "fpu\t\t: %s\n" 356 "fpu\t\t: %s\n"
357 "pmu\t\t: %s\n"
356 "prom\t\t: %s\n" 358 "prom\t\t: %s\n"
357 "type\t\t: %s\n" 359 "type\t\t: %s\n"
358 "ncpus probed\t: %d\n" 360 "ncpus probed\t: %d\n"
@@ -365,6 +367,7 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
365 , 367 ,
366 sparc_cpu_type, 368 sparc_cpu_type,
367 sparc_fpu_type, 369 sparc_fpu_type,
370 sparc_pmu_type,
368 prom_version, 371 prom_version,
369 ((tlb_type == hypervisor) ? 372 ((tlb_type == hypervisor) ?
370 "sun4v" : 373 "sun4v" :
@@ -425,5 +428,7 @@ void sun_do_break(void)
425 428
426 prom_cmdline(); 429 prom_cmdline();
427} 430}
431EXPORT_SYMBOL(sun_do_break);
428 432
429int stop_a_enabled = 1; 433int stop_a_enabled = 1;
434EXPORT_SYMBOL(stop_a_enabled);
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
index e1e97639231b..baeab8720237 100644
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ b/arch/sparc/kernel/sparc_ksyms_32.c
@@ -5,49 +5,14 @@
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) 5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 */ 6 */
7 7
8/* Tell string.h we don't want memcpy etc. as cpp defines */
9#define EXPORT_SYMTAB_STROPS
10#define PROMLIB_INTERNAL
11
12#include <linux/module.h> 8#include <linux/module.h>
13#include <linux/init.h> 9#include <linux/init.h>
14#include <linux/smp.h>
15#include <linux/types.h>
16#include <linux/string.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/in6.h>
20#include <linux/spinlock.h>
21#include <linux/mm.h>
22#include <linux/syscalls.h>
23#ifdef CONFIG_PCI
24#include <linux/pci.h>
25#endif
26#include <linux/pm.h>
27#ifdef CONFIG_HIGHMEM
28#include <linux/highmem.h>
29#endif
30 10
31#include <asm/oplib.h>
32#include <asm/delay.h>
33#include <asm/system.h>
34#include <asm/auxio.h>
35#include <asm/pgtable.h> 11#include <asm/pgtable.h>
36#include <asm/io.h>
37#include <asm/irq.h>
38#include <asm/idprom.h>
39#include <asm/head.h>
40#include <asm/smp.h>
41#include <asm/ptrace.h>
42#include <asm/uaccess.h> 12#include <asm/uaccess.h>
43#include <asm/checksum.h> 13#include <asm/delay.h>
44#ifdef CONFIG_SBUS 14#include <asm/head.h>
45#include <asm/dma.h> 15#include <asm/dma.h>
46#endif
47#include <asm/io-unit.h>
48#include <asm/bug.h>
49
50extern spinlock_t rtc_lock;
51 16
52struct poll { 17struct poll {
53 int fd; 18 int fd;
@@ -55,72 +20,15 @@ struct poll {
55 short revents; 20 short revents;
56}; 21};
57 22
58extern void (*__copy_1page)(void *, const void *); 23/* from entry.S */
59extern void __memmove(void *, const void *, __kernel_size_t);
60extern void (*bzero_1page)(void *);
61extern void *__bzero(void *, size_t);
62extern void *__memscan_zero(void *, size_t);
63extern void *__memscan_generic(void *, int, size_t);
64extern int __strncmp(const char *, const char *, __kernel_size_t);
65
66extern int __ashrdi3(int, int);
67extern int __ashldi3(int, int);
68extern int __lshrdi3(int, int);
69extern int __muldi3(int, int);
70extern int __divdi3(int, int);
71
72/* Private functions with odd calling conventions. */
73extern void ___atomic24_add(void);
74extern void ___atomic24_sub(void);
75extern void ___rw_read_enter(void);
76extern void ___rw_read_try(void);
77extern void ___rw_read_exit(void);
78extern void ___rw_write_enter(void);
79
80/* Alias functions whose names begin with "." and export the aliases.
81 * The module references will be fixed up by module_frob_arch_sections.
82 */
83extern int _Div(int, int);
84extern int _Mul(int, int);
85extern int _Rem(int, int);
86extern unsigned _Udiv(unsigned, unsigned);
87extern unsigned _Umul(unsigned, unsigned);
88extern unsigned _Urem(unsigned, unsigned);
89
90/* used by various drivers */
91EXPORT_SYMBOL(sparc_cpu_model);
92EXPORT_SYMBOL(kernel_thread);
93#ifdef CONFIG_SMP
94// XXX find what uses (or used) these. AV: see asm/spinlock.h
95EXPORT_SYMBOL(___rw_read_enter);
96EXPORT_SYMBOL(___rw_read_try);
97EXPORT_SYMBOL(___rw_read_exit);
98EXPORT_SYMBOL(___rw_write_enter);
99#endif
100
101EXPORT_SYMBOL(sparc_valid_addr_bitmap);
102EXPORT_SYMBOL(phys_base);
103EXPORT_SYMBOL(pfn_base);
104
105/* Atomic operations. */
106EXPORT_SYMBOL(___atomic24_add);
107EXPORT_SYMBOL(___atomic24_sub);
108
109/* Per-CPU information table */
110EXPORT_PER_CPU_SYMBOL(__cpu_data);
111
112#ifdef CONFIG_SMP
113/* IRQ implementation. */
114EXPORT_SYMBOL(synchronize_irq);
115#endif
116
117EXPORT_SYMBOL(__udelay); 24EXPORT_SYMBOL(__udelay);
118EXPORT_SYMBOL(__ndelay); 25EXPORT_SYMBOL(__ndelay);
119EXPORT_SYMBOL(rtc_lock);
120EXPORT_SYMBOL(set_auxio);
121EXPORT_SYMBOL(get_auxio);
122EXPORT_SYMBOL(io_remap_pfn_range);
123 26
27/* from head_32.S */
28EXPORT_SYMBOL(__ret_efault);
29EXPORT_SYMBOL(empty_zero_page);
30
31/* Defined using magic */
124#ifndef CONFIG_SMP 32#ifndef CONFIG_SMP
125EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); 33EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
126#else 34#else
@@ -132,122 +40,7 @@ EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
132EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); 40EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
133EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); 41EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
134EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); 42EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
135
136EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached)); 43EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached));
137 44
138#ifdef CONFIG_SBUS 45/* Exporting a symbol from /init/main.c */
139EXPORT_SYMBOL(sbus_set_sbus64);
140#endif
141#ifdef CONFIG_PCI
142EXPORT_SYMBOL(insb);
143EXPORT_SYMBOL(outsb);
144EXPORT_SYMBOL(insw);
145EXPORT_SYMBOL(outsw);
146EXPORT_SYMBOL(insl);
147EXPORT_SYMBOL(outsl);
148EXPORT_SYMBOL(pci_alloc_consistent);
149EXPORT_SYMBOL(pci_free_consistent);
150EXPORT_SYMBOL(pci_map_single);
151EXPORT_SYMBOL(pci_unmap_single);
152EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
153EXPORT_SYMBOL(pci_dma_sync_single_for_device);
154EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
155EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
156EXPORT_SYMBOL(pci_map_sg);
157EXPORT_SYMBOL(pci_unmap_sg);
158EXPORT_SYMBOL(pci_map_page);
159EXPORT_SYMBOL(pci_unmap_page);
160/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
161EXPORT_SYMBOL(ioremap);
162EXPORT_SYMBOL(iounmap);
163#endif
164
165/* in arch/sparc/mm/highmem.c */
166#ifdef CONFIG_HIGHMEM
167EXPORT_SYMBOL(kmap_atomic);
168EXPORT_SYMBOL(kunmap_atomic);
169#endif
170
171/* prom symbols */
172EXPORT_SYMBOL(idprom);
173EXPORT_SYMBOL(prom_root_node);
174EXPORT_SYMBOL(prom_getchild);
175EXPORT_SYMBOL(prom_getsibling);
176EXPORT_SYMBOL(prom_searchsiblings);
177EXPORT_SYMBOL(prom_firstprop);
178EXPORT_SYMBOL(prom_nextprop);
179EXPORT_SYMBOL(prom_getproplen);
180EXPORT_SYMBOL(prom_getproperty);
181EXPORT_SYMBOL(prom_node_has_property);
182EXPORT_SYMBOL(prom_setprop);
183EXPORT_SYMBOL(saved_command_line); 46EXPORT_SYMBOL(saved_command_line);
184EXPORT_SYMBOL(prom_apply_obio_ranges);
185EXPORT_SYMBOL(prom_feval);
186EXPORT_SYMBOL(prom_getbool);
187EXPORT_SYMBOL(prom_getstring);
188EXPORT_SYMBOL(prom_getint);
189EXPORT_SYMBOL(prom_getintdefault);
190EXPORT_SYMBOL(prom_finddevice);
191EXPORT_SYMBOL(romvec);
192EXPORT_SYMBOL(__prom_getchild);
193EXPORT_SYMBOL(__prom_getsibling);
194
195/* sparc library symbols */
196EXPORT_SYMBOL(memscan);
197EXPORT_SYMBOL(strlen);
198EXPORT_SYMBOL(strncmp);
199EXPORT_SYMBOL(page_kernel);
200
201/* Special internal versions of library functions. */
202EXPORT_SYMBOL(__copy_1page);
203EXPORT_SYMBOL(__memcpy);
204EXPORT_SYMBOL(__memset);
205EXPORT_SYMBOL(bzero_1page);
206EXPORT_SYMBOL(__bzero);
207EXPORT_SYMBOL(__memscan_zero);
208EXPORT_SYMBOL(__memscan_generic);
209EXPORT_SYMBOL(__strncmp);
210EXPORT_SYMBOL(__memmove);
211
212/* Moving data to/from userspace. */
213EXPORT_SYMBOL(__copy_user);
214EXPORT_SYMBOL(__strncpy_from_user);
215EXPORT_SYMBOL(__strnlen_user);
216
217/* Networking helper routines. */
218EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
219EXPORT_SYMBOL(csum_partial);
220
221/* Cache flushing. */
222EXPORT_SYMBOL(sparc_flush_page_to_ram);
223
224/* For when serial stuff is built as modules. */
225EXPORT_SYMBOL(sun_do_break);
226
227EXPORT_SYMBOL(__ret_efault);
228
229EXPORT_SYMBOL(memcmp);
230EXPORT_SYMBOL(memcpy);
231EXPORT_SYMBOL(memset);
232EXPORT_SYMBOL(memmove);
233EXPORT_SYMBOL(__ashrdi3);
234EXPORT_SYMBOL(__ashldi3);
235EXPORT_SYMBOL(__lshrdi3);
236EXPORT_SYMBOL(__muldi3);
237EXPORT_SYMBOL(__divdi3);
238
239EXPORT_SYMBOL(_Rem);
240EXPORT_SYMBOL(_Urem);
241EXPORT_SYMBOL(_Mul);
242EXPORT_SYMBOL(_Umul);
243EXPORT_SYMBOL(_Div);
244EXPORT_SYMBOL(_Udiv);
245
246#ifdef CONFIG_DEBUG_BUGVERBOSE
247EXPORT_SYMBOL(do_BUG);
248#endif
249
250/* Sun Power Management Idle Handler */
251EXPORT_SYMBOL(pm_idle);
252
253EXPORT_SYMBOL(empty_zero_page);
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
index 0133211ab634..0f26066a08d9 100644
--- a/arch/sparc/kernel/sparc_ksyms_64.c
+++ b/arch/sparc/kernel/sparc_ksyms_64.c
@@ -5,50 +5,15 @@
5 * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) 5 * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
6 */ 6 */
7 7
8/* Tell string.h we don't want memcpy etc. as cpp defines */
9#define EXPORT_SYMTAB_STROPS
10#define PROMLIB_INTERNAL
11
12#include <linux/module.h> 8#include <linux/module.h>
13#include <linux/types.h>
14#include <linux/string.h>
15#include <linux/sched.h>
16#include <linux/in6.h>
17#include <linux/pci.h> 9#include <linux/pci.h>
18#include <linux/interrupt.h>
19#include <linux/fs_struct.h>
20#include <linux/fs.h>
21#include <linux/mm.h>
22#include <linux/socket.h>
23#include <linux/syscalls.h>
24#include <linux/percpu.h>
25#include <linux/init.h> 10#include <linux/init.h>
26#include <linux/rwsem.h>
27#include <net/compat.h>
28 11
29#include <asm/oplib.h>
30#include <asm/system.h> 12#include <asm/system.h>
31#include <asm/auxio.h>
32#include <asm/pgtable.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/idprom.h>
36#include <asm/elf.h>
37#include <asm/head.h>
38#include <asm/smp.h>
39#include <asm/ptrace.h>
40#include <asm/uaccess.h>
41#include <asm/checksum.h>
42#include <asm/fpumacro.h>
43#include <asm/pgalloc.h>
44#include <asm/cacheflush.h>
45#ifdef CONFIG_SBUS
46#include <asm/dma.h>
47#endif
48#include <asm/ns87303.h>
49#include <asm/timer.h>
50#include <asm/cpudata.h> 13#include <asm/cpudata.h>
51#include <asm/ftrace.h> 14#include <asm/uaccess.h>
15#include <asm/spitfire.h>
16#include <asm/oplib.h>
52#include <asm/hypervisor.h> 17#include <asm/hypervisor.h>
53 18
54struct poll { 19struct poll {
@@ -57,114 +22,24 @@ struct poll {
57 short revents; 22 short revents;
58}; 23};
59 24
60extern void die_if_kernel(char *str, struct pt_regs *regs); 25/* from helpers.S */
61extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
62extern void *__bzero(void *, size_t);
63extern void *__memscan_zero(void *, size_t);
64extern void *__memscan_generic(void *, int, size_t);
65extern __kernel_size_t strlen(const char *);
66extern void sys_sigsuspend(void);
67extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
68extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
69extern long sparc32_open(const char __user * filename, int flags, int mode);
70extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
71 unsigned long pfn, unsigned long size, pgprot_t prot);
72
73extern int __ashrdi3(int, int);
74
75extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs);
76
77extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
78extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
79 unsigned long *);
80extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
81 unsigned long *, unsigned long *);
82extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
83 unsigned long *, unsigned long *, unsigned long *);
84
85extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
86extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
87 unsigned long *);
88extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
89 unsigned long *, unsigned long *);
90extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
91 unsigned long *, unsigned long *, unsigned long *);
92
93/* Per-CPU information table */
94EXPORT_PER_CPU_SYMBOL(__cpu_data);
95
96/* used by various drivers */
97#ifdef CONFIG_SMP
98/* Out of line rw-locking implementation. */
99EXPORT_SYMBOL(__read_lock);
100EXPORT_SYMBOL(__read_unlock);
101EXPORT_SYMBOL(__write_lock);
102EXPORT_SYMBOL(__write_unlock);
103EXPORT_SYMBOL(__write_trylock);
104#endif /* CONFIG_SMP */
105
106#ifdef CONFIG_MCOUNT
107EXPORT_SYMBOL(_mcount);
108#endif
109
110EXPORT_SYMBOL(sparc64_get_clock_tick);
111
112/* RW semaphores */
113EXPORT_SYMBOL(__down_read);
114EXPORT_SYMBOL(__down_read_trylock);
115EXPORT_SYMBOL(__down_write);
116EXPORT_SYMBOL(__down_write_trylock);
117EXPORT_SYMBOL(__up_read);
118EXPORT_SYMBOL(__up_write);
119EXPORT_SYMBOL(__downgrade_write);
120
121/* Atomic counter implementation. */
122EXPORT_SYMBOL(atomic_add);
123EXPORT_SYMBOL(atomic_add_ret);
124EXPORT_SYMBOL(atomic_sub);
125EXPORT_SYMBOL(atomic_sub_ret);
126EXPORT_SYMBOL(atomic64_add);
127EXPORT_SYMBOL(atomic64_add_ret);
128EXPORT_SYMBOL(atomic64_sub);
129EXPORT_SYMBOL(atomic64_sub_ret);
130
131/* Atomic bit operations. */
132EXPORT_SYMBOL(test_and_set_bit);
133EXPORT_SYMBOL(test_and_clear_bit);
134EXPORT_SYMBOL(test_and_change_bit);
135EXPORT_SYMBOL(set_bit);
136EXPORT_SYMBOL(clear_bit);
137EXPORT_SYMBOL(change_bit);
138
139EXPORT_SYMBOL(__flushw_user); 26EXPORT_SYMBOL(__flushw_user);
27EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
140 28
29/* from head_64.S */
30EXPORT_SYMBOL(__ret_efault);
141EXPORT_SYMBOL(tlb_type); 31EXPORT_SYMBOL(tlb_type);
142EXPORT_SYMBOL(sun4v_chip_type); 32EXPORT_SYMBOL(sun4v_chip_type);
143EXPORT_SYMBOL(get_fb_unmapped_area); 33EXPORT_SYMBOL(prom_root_node);
144EXPORT_SYMBOL(flush_icache_range);
145
146EXPORT_SYMBOL(flush_dcache_page);
147#ifdef DCACHE_ALIASING_POSSIBLE
148EXPORT_SYMBOL(__flush_dcache_range);
149#endif
150 34
35/* from hvcalls.S */
151EXPORT_SYMBOL(sun4v_niagara_getperf); 36EXPORT_SYMBOL(sun4v_niagara_getperf);
152EXPORT_SYMBOL(sun4v_niagara_setperf); 37EXPORT_SYMBOL(sun4v_niagara_setperf);
153EXPORT_SYMBOL(sun4v_niagara2_getperf); 38EXPORT_SYMBOL(sun4v_niagara2_getperf);
154EXPORT_SYMBOL(sun4v_niagara2_setperf); 39EXPORT_SYMBOL(sun4v_niagara2_setperf);
155 40
156EXPORT_SYMBOL(auxio_set_led);
157EXPORT_SYMBOL(auxio_set_lte);
158#ifdef CONFIG_SBUS
159EXPORT_SYMBOL(sbus_set_sbus64);
160#endif
161EXPORT_SYMBOL(outsb);
162EXPORT_SYMBOL(outsw);
163EXPORT_SYMBOL(outsl);
164EXPORT_SYMBOL(insb);
165EXPORT_SYMBOL(insw);
166EXPORT_SYMBOL(insl);
167#ifdef CONFIG_PCI 41#ifdef CONFIG_PCI
42/* inline functions in asm/pci_64.h */
168EXPORT_SYMBOL(pci_alloc_consistent); 43EXPORT_SYMBOL(pci_alloc_consistent);
169EXPORT_SYMBOL(pci_free_consistent); 44EXPORT_SYMBOL(pci_free_consistent);
170EXPORT_SYMBOL(pci_map_single); 45EXPORT_SYMBOL(pci_map_single);
@@ -173,112 +48,7 @@ EXPORT_SYMBOL(pci_map_sg);
173EXPORT_SYMBOL(pci_unmap_sg); 48EXPORT_SYMBOL(pci_unmap_sg);
174EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); 49EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
175EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); 50EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
176EXPORT_SYMBOL(pci_dma_supported);
177#endif 51#endif
178 52
179/* I/O device mmaping on Sparc64. */ 53/* Exporting a symbol from /init/main.c */
180EXPORT_SYMBOL(io_remap_pfn_range);
181
182EXPORT_SYMBOL(dump_fpu);
183
184/* math-emu wants this */
185EXPORT_SYMBOL(die_if_kernel);
186
187/* Kernel thread creation. */
188EXPORT_SYMBOL(kernel_thread);
189
190/* prom symbols */
191EXPORT_SYMBOL(idprom);
192EXPORT_SYMBOL(prom_root_node);
193EXPORT_SYMBOL(prom_getchild);
194EXPORT_SYMBOL(prom_getsibling);
195EXPORT_SYMBOL(prom_searchsiblings);
196EXPORT_SYMBOL(prom_firstprop);
197EXPORT_SYMBOL(prom_nextprop);
198EXPORT_SYMBOL(prom_getproplen);
199EXPORT_SYMBOL(prom_getproperty);
200EXPORT_SYMBOL(prom_node_has_property);
201EXPORT_SYMBOL(prom_setprop);
202EXPORT_SYMBOL(saved_command_line); 54EXPORT_SYMBOL(saved_command_line);
203EXPORT_SYMBOL(prom_finddevice);
204EXPORT_SYMBOL(prom_feval);
205EXPORT_SYMBOL(prom_getbool);
206EXPORT_SYMBOL(prom_getstring);
207EXPORT_SYMBOL(prom_getint);
208EXPORT_SYMBOL(prom_getintdefault);
209EXPORT_SYMBOL(__prom_getchild);
210EXPORT_SYMBOL(__prom_getsibling);
211
212/* sparc library symbols */
213EXPORT_SYMBOL(strlen);
214EXPORT_SYMBOL(__strlen_user);
215EXPORT_SYMBOL(__strnlen_user);
216
217/* Special internal versions of library functions. */
218EXPORT_SYMBOL(_clear_page);
219EXPORT_SYMBOL(clear_user_page);
220EXPORT_SYMBOL(copy_user_page);
221EXPORT_SYMBOL(__bzero);
222EXPORT_SYMBOL(__memscan_zero);
223EXPORT_SYMBOL(__memscan_generic);
224EXPORT_SYMBOL(__memset);
225
226EXPORT_SYMBOL(csum_partial);
227EXPORT_SYMBOL(csum_partial_copy_nocheck);
228EXPORT_SYMBOL(__csum_partial_copy_from_user);
229EXPORT_SYMBOL(__csum_partial_copy_to_user);
230EXPORT_SYMBOL(ip_fast_csum);
231
232/* Moving data to/from/in userspace. */
233EXPORT_SYMBOL(___copy_to_user);
234EXPORT_SYMBOL(___copy_from_user);
235EXPORT_SYMBOL(___copy_in_user);
236EXPORT_SYMBOL(copy_to_user_fixup);
237EXPORT_SYMBOL(copy_from_user_fixup);
238EXPORT_SYMBOL(copy_in_user_fixup);
239EXPORT_SYMBOL(__strncpy_from_user);
240EXPORT_SYMBOL(__clear_user);
241
242/* Various address conversion macros use this. */
243EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
244
245/* No version information on this, heavily used in inline asm,
246 * and will always be 'void __ret_efault(void)'.
247 */
248EXPORT_SYMBOL(__ret_efault);
249
250/* No version information on these, as gcc produces such symbols. */
251EXPORT_SYMBOL(memcmp);
252EXPORT_SYMBOL(memcpy);
253EXPORT_SYMBOL(memset);
254EXPORT_SYMBOL(memmove);
255EXPORT_SYMBOL(strncmp);
256
257void VISenter(void);
258/* RAID code needs this */
259EXPORT_SYMBOL(VISenter);
260
261/* for input/keybdev */
262EXPORT_SYMBOL(sun_do_break);
263EXPORT_SYMBOL(stop_a_enabled);
264
265#ifdef CONFIG_DEBUG_BUGVERBOSE
266EXPORT_SYMBOL(do_BUG);
267#endif
268
269/* for ns8703 */
270EXPORT_SYMBOL(ns87303_lock);
271
272EXPORT_SYMBOL(tick_ops);
273
274EXPORT_SYMBOL(xor_vis_2);
275EXPORT_SYMBOL(xor_vis_3);
276EXPORT_SYMBOL(xor_vis_4);
277EXPORT_SYMBOL(xor_vis_5);
278
279EXPORT_SYMBOL(xor_niagara_2);
280EXPORT_SYMBOL(xor_niagara_3);
281EXPORT_SYMBOL(xor_niagara_4);
282EXPORT_SYMBOL(xor_niagara_5);
283
284EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 16ab0cb731c5..50afaed99c8a 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -60,7 +60,7 @@ extern int __smp4d_processor_id(void);
60#define SMP_PRINTK(x) 60#define SMP_PRINTK(x)
61#endif 61#endif
62 62
63static inline unsigned long swap(volatile unsigned long *ptr, unsigned long val) 63static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned long val)
64{ 64{
65 __asm__ __volatile__("swap [%1], %0\n\t" : 65 __asm__ __volatile__("swap [%1], %0\n\t" :
66 "=&r" (val), "=&r" (ptr) : 66 "=&r" (val), "=&r" (ptr) :
@@ -115,7 +115,7 @@ void __cpuinit smp4d_callin(void)
115 local_flush_tlb_all(); 115 local_flush_tlb_all();
116 116
117 /* Allow master to continue. */ 117 /* Allow master to continue. */
118 swap((unsigned long *)&cpu_callin_map[cpuid], 1); 118 sun4d_swap((unsigned long *)&cpu_callin_map[cpuid], 1);
119 local_flush_cache_all(); 119 local_flush_cache_all();
120 local_flush_tlb_all(); 120 local_flush_tlb_all();
121 121
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 39749e32dc7e..e2d102447a43 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -23,6 +23,7 @@
23#include <linux/ipc.h> 23#include <linux/ipc.h>
24#include <linux/personality.h> 24#include <linux/personality.h>
25#include <linux/random.h> 25#include <linux/random.h>
26#include <linux/module.h>
26 27
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/utrap.h> 29#include <asm/utrap.h>
@@ -354,6 +355,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u
354 355
355 return addr; 356 return addr;
356} 357}
358EXPORT_SYMBOL(get_fb_unmapped_area);
357 359
358/* Essentially the same as PowerPC... */ 360/* Essentially the same as PowerPC... */
359void arch_pick_mmap_layout(struct mm_struct *mm) 361void arch_pick_mmap_layout(struct mm_struct *mm)
@@ -397,7 +399,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
397 } 399 }
398} 400}
399 401
400asmlinkage unsigned long sparc_brk(unsigned long brk) 402SYSCALL_DEFINE1(sparc_brk, unsigned long, brk)
401{ 403{
402 /* People could try to be nasty and use ta 0x6d in 32bit programs */ 404 /* People could try to be nasty and use ta 0x6d in 32bit programs */
403 if (test_thread_flag(TIF_32BIT) && brk >= STACK_TOP32) 405 if (test_thread_flag(TIF_32BIT) && brk >= STACK_TOP32)
@@ -413,7 +415,7 @@ asmlinkage unsigned long sparc_brk(unsigned long brk)
413 * sys_pipe() is the normal C calling standard for creating 415 * sys_pipe() is the normal C calling standard for creating
414 * a pipe. It's not the way unix traditionally does this, though. 416 * a pipe. It's not the way unix traditionally does this, though.
415 */ 417 */
416asmlinkage long sparc_pipe(struct pt_regs *regs) 418SYSCALL_DEFINE1(sparc_pipe_real, struct pt_regs *, regs)
417{ 419{
418 int fd[2]; 420 int fd[2];
419 int error; 421 int error;
@@ -433,8 +435,8 @@ out:
433 * This is really horribly ugly. 435 * This is really horribly ugly.
434 */ 436 */
435 437
436asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, 438SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
437 unsigned long third, void __user *ptr, long fifth) 439 unsigned long, third, void __user *, ptr, long, fifth)
438{ 440{
439 long err; 441 long err;
440 442
@@ -517,7 +519,7 @@ out:
517 return err; 519 return err;
518} 520}
519 521
520asmlinkage long sparc64_newuname(struct new_utsname __user *name) 522SYSCALL_DEFINE1(sparc64_newuname, struct new_utsname __user *, name)
521{ 523{
522 int ret = sys_newuname(name); 524 int ret = sys_newuname(name);
523 525
@@ -528,7 +530,7 @@ asmlinkage long sparc64_newuname(struct new_utsname __user *name)
528 return ret; 530 return ret;
529} 531}
530 532
531asmlinkage long sparc64_personality(unsigned long personality) 533SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality)
532{ 534{
533 int ret; 535 int ret;
534 536
@@ -562,9 +564,9 @@ int sparc_mmap_check(unsigned long addr, unsigned long len)
562} 564}
563 565
564/* Linux version of mmap */ 566/* Linux version of mmap */
565asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, 567SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
566 unsigned long prot, unsigned long flags, unsigned long fd, 568 unsigned long, prot, unsigned long, flags, unsigned long, fd,
567 unsigned long off) 569 unsigned long, off)
568{ 570{
569 struct file * file = NULL; 571 struct file * file = NULL;
570 unsigned long retval = -EBADF; 572 unsigned long retval = -EBADF;
@@ -587,7 +589,7 @@ out:
587 return retval; 589 return retval;
588} 590}
589 591
590asmlinkage long sys64_munmap(unsigned long addr, size_t len) 592SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len)
591{ 593{
592 long ret; 594 long ret;
593 595
@@ -604,9 +606,9 @@ extern unsigned long do_mremap(unsigned long addr,
604 unsigned long old_len, unsigned long new_len, 606 unsigned long old_len, unsigned long new_len,
605 unsigned long flags, unsigned long new_addr); 607 unsigned long flags, unsigned long new_addr);
606 608
607asmlinkage unsigned long sys64_mremap(unsigned long addr, 609SYSCALL_DEFINE5(64_mremap, unsigned long, addr, unsigned long, old_len,
608 unsigned long old_len, unsigned long new_len, 610 unsigned long, new_len, unsigned long, flags,
609 unsigned long flags, unsigned long new_addr) 611 unsigned long, new_addr)
610{ 612{
611 unsigned long ret = -EINVAL; 613 unsigned long ret = -EINVAL;
612 614
@@ -669,7 +671,7 @@ asmlinkage void sparc_breakpoint(struct pt_regs *regs)
669 671
670extern void check_pending(int signum); 672extern void check_pending(int signum);
671 673
672asmlinkage long sys_getdomainname(char __user *name, int len) 674SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len)
673{ 675{
674 int nlen, err; 676 int nlen, err;
675 677
@@ -692,11 +694,10 @@ out:
692 return err; 694 return err;
693} 695}
694 696
695asmlinkage long sys_utrap_install(utrap_entry_t type, 697SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,
696 utrap_handler_t new_p, 698 utrap_handler_t, new_p, utrap_handler_t, new_d,
697 utrap_handler_t new_d, 699 utrap_handler_t __user *, old_p,
698 utrap_handler_t __user *old_p, 700 utrap_handler_t __user *, old_d)
699 utrap_handler_t __user *old_d)
700{ 701{
701 if (type < UT_INSTRUCTION_EXCEPTION || type > UT_TRAP_INSTRUCTION_31) 702 if (type < UT_INSTRUCTION_EXCEPTION || type > UT_TRAP_INSTRUCTION_31)
702 return -EINVAL; 703 return -EINVAL;
@@ -762,11 +763,9 @@ asmlinkage long sparc_memory_ordering(unsigned long model,
762 return 0; 763 return 0;
763} 764}
764 765
765asmlinkage long sys_rt_sigaction(int sig, 766SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
766 const struct sigaction __user *act, 767 struct sigaction __user *, oact, void __user *, restorer,
767 struct sigaction __user *oact, 768 size_t, sigsetsize)
768 void __user *restorer,
769 size_t sigsetsize)
770{ 769{
771 struct k_sigaction new_ka, old_ka; 770 struct k_sigaction new_ka, old_ka;
772 int ret; 771 int ret;
@@ -806,7 +805,8 @@ asmlinkage void update_perfctrs(void)
806 reset_pic(); 805 reset_pic();
807} 806}
808 807
809asmlinkage long sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long arg2) 808SYSCALL_DEFINE4(perfctr, int, opcode, unsigned long, arg0,
809 unsigned long, arg1, unsigned long, arg2)
810{ 810{
811 int err = 0; 811 int err = 0;
812 812
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index 7a6786a71363..d150c2aa98d2 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -20,8 +20,8 @@ execve_merge:
20 add %sp, PTREGS_OFF, %o0 20 add %sp, PTREGS_OFF, %o0
21 21
22 .align 32 22 .align 32
23sys_pipe: 23sys_sparc_pipe:
24 ba,pt %xcc, sparc_pipe 24 ba,pt %xcc, sys_sparc_pipe_real
25 add %sp, PTREGS_OFF, %o0 25 add %sp, PTREGS_OFF, %o0
26sys_nis_syscall: 26sys_nis_syscall:
27 ba,pt %xcc, c_sys_nis_syscall 27 ba,pt %xcc, c_sys_nis_syscall
diff --git a/arch/sparc/kernel/systbls.h b/arch/sparc/kernel/systbls.h
index bc9f5dac4069..15c2d752b2bc 100644
--- a/arch/sparc/kernel/systbls.h
+++ b/arch/sparc/kernel/systbls.h
@@ -16,9 +16,6 @@ extern asmlinkage long sys_ipc(unsigned int call, int first,
16 void __user *ptr, long fifth); 16 void __user *ptr, long fifth);
17extern asmlinkage long sparc64_newuname(struct new_utsname __user *name); 17extern asmlinkage long sparc64_newuname(struct new_utsname __user *name);
18extern asmlinkage long sparc64_personality(unsigned long personality); 18extern asmlinkage long sparc64_personality(unsigned long personality);
19extern asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
20 unsigned long prot, unsigned long flags,
21 unsigned long fd, unsigned long off);
22extern asmlinkage long sys64_munmap(unsigned long addr, size_t len); 19extern asmlinkage long sys64_munmap(unsigned long addr, size_t len);
23extern asmlinkage unsigned long sys64_mremap(unsigned long addr, 20extern asmlinkage unsigned long sys64_mremap(unsigned long addr,
24 unsigned long old_len, 21 unsigned long old_len,
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 7d0807586442..dccc95df0c7f 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -24,7 +24,7 @@ sys_call_table:
24/*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause 24/*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause
25/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice 25/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice
26/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile 26/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile
27/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid 27/*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid
28/*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 28/*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16
29/*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl 29/*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl
30/*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve 30/*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve
@@ -56,7 +56,7 @@ sys_call_table:
56/*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname 56/*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
57/*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl 57/*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl
58/*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask 58/*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask
59/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir 59/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir
60/*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 60/*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
61/*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo 61/*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo
62/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex 62/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 9fc78cf354bd..f93c42a2b522 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -21,12 +21,12 @@ sys_call_table32:
21/*0*/ .word sys_restart_syscall, sys32_exit, sys_fork, sys_read, sys_write 21/*0*/ .word sys_restart_syscall, sys32_exit, sys_fork, sys_read, sys_write
22/*5*/ .word sys32_open, sys_close, sys32_wait4, sys32_creat, sys_link 22/*5*/ .word sys32_open, sys_close, sys32_wait4, sys32_creat, sys_link
23/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys32_mknod 23/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys32_mknod
24/*15*/ .word sys_chmod, sys_lchown16, sparc_brk, sys32_perfctr, sys32_lseek 24/*15*/ .word sys_chmod, sys_lchown16, sys_sparc_brk, sys32_perfctr, sys32_lseek
25/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16 25/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16
26/*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause 26/*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause
27/*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice 27/*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
28 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile 28 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile
29/*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid 29/*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid
30 .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 30 .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16
31/*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl 31/*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
32 .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve 32 .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve
@@ -55,8 +55,8 @@ sys_call_table32:
55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents 55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr 56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall 57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
58 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname 58 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_sparc64_newuname
59/*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl 59/*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
60 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask 60 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask
61/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir 61/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
62 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64 62 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
@@ -95,18 +95,18 @@ sys_call_table:
95/*0*/ .word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write 95/*0*/ .word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write
96/*5*/ .word sys_open, sys_close, sys_wait4, sys_creat, sys_link 96/*5*/ .word sys_open, sys_close, sys_wait4, sys_creat, sys_link
97/*10*/ .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod 97/*10*/ .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod
98/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek 98/*15*/ .word sys_chmod, sys_lchown, sys_sparc_brk, sys_perfctr, sys_lseek
99/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid 99/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
100/*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall 100/*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
101/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice 101/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
102 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 102 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
103/*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall 103/*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall
104 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid 104 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
105/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl 105/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
106 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve 106 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
107/*60*/ .word sys_umask, sys_chroot, sys_newfstat, sys_fstat64, sys_getpagesize 107/*60*/ .word sys_umask, sys_chroot, sys_newfstat, sys_fstat64, sys_getpagesize
108 .word sys_msync, sys_vfork, sys_pread64, sys_pwrite64, sys_nis_syscall 108 .word sys_msync, sys_vfork, sys_pread64, sys_pwrite64, sys_nis_syscall
109/*70*/ .word sys_nis_syscall, sys_mmap, sys_nis_syscall, sys64_munmap, sys_mprotect 109/*70*/ .word sys_nis_syscall, sys_mmap, sys_nis_syscall, sys_64_munmap, sys_mprotect
110 .word sys_madvise, sys_vhangup, sys_nis_syscall, sys_mincore, sys_getgroups 110 .word sys_madvise, sys_vhangup, sys_nis_syscall, sys_mincore, sys_getgroups
111/*80*/ .word sys_setgroups, sys_getpgrp, sys_nis_syscall, sys_setitimer, sys_nis_syscall 111/*80*/ .word sys_setgroups, sys_getpgrp, sys_nis_syscall, sys_setitimer, sys_nis_syscall
112 .word sys_swapon, sys_getitimer, sys_nis_syscall, sys_sethostname, sys_nis_syscall 112 .word sys_swapon, sys_getitimer, sys_nis_syscall, sys_sethostname, sys_nis_syscall
@@ -129,8 +129,8 @@ sys_call_table:
129/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents 129/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
130 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr 130 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
131/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall 131/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
132 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname 132 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_sparc64_newuname
133/*190*/ .word sys_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl 133/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
134 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask 134 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
135/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall 135/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall
136 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 136 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
@@ -142,7 +142,7 @@ sys_call_table:
142 .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall 142 .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
143/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler 143/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler
144 .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep 144 .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep
145/*250*/ .word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl 145/*250*/ .word sys_64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
146 .word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep 146 .word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
147/*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun 147/*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
148 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy 148 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 00f7383c7657..614ac7b4a9dd 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -48,6 +48,8 @@
48#include "irq.h" 48#include "irq.h"
49 49
50DEFINE_SPINLOCK(rtc_lock); 50DEFINE_SPINLOCK(rtc_lock);
51EXPORT_SYMBOL(rtc_lock);
52
51static int set_rtc_mmss(unsigned long); 53static int set_rtc_mmss(unsigned long);
52static int sbus_do_settimeofday(struct timespec *tv); 54static int sbus_do_settimeofday(struct timespec *tv);
53 55
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 54405d362148..db310aa00183 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -176,6 +176,7 @@ static struct sparc64_tick_ops tick_operations __read_mostly = {
176}; 176};
177 177
178struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations; 178struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations;
179EXPORT_SYMBOL(tick_ops);
179 180
180static void stick_disable_irq(void) 181static void stick_disable_irq(void)
181{ 182{
@@ -639,6 +640,7 @@ unsigned long sparc64_get_clock_tick(unsigned int cpu)
639 return ft->clock_tick_ref; 640 return ft->clock_tick_ref;
640 return cpu_data(cpu).clock_tick; 641 return cpu_data(cpu).clock_tick;
641} 642}
643EXPORT_SYMBOL(sparc64_get_clock_tick);
642 644
643#ifdef CONFIG_CPU_FREQ 645#ifdef CONFIG_CPU_FREQ
644 646
@@ -727,7 +729,7 @@ void timer_interrupt(int irq, struct pt_regs *regs)
727 729
728 irq_enter(); 730 irq_enter();
729 731
730 kstat_this_cpu.irqs[0]++; 732 kstat_incr_irqs_this_cpu(0, irq_to_desc(0));
731 733
732 if (unlikely(!evt->event_handler)) { 734 if (unlikely(!evt->event_handler)) {
733 printk(KERN_WARNING 735 printk(KERN_WARNING
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 213645be6e92..358283341b47 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -424,6 +424,7 @@ void do_BUG(const char *file, int line)
424 // bust_spinlocks(1); XXX Not in our original BUG() 424 // bust_spinlocks(1); XXX Not in our original BUG()
425 printk("kernel BUG at %s:%d!\n", file, line); 425 printk("kernel BUG at %s:%d!\n", file, line);
426} 426}
427EXPORT_SYMBOL(do_BUG);
427#endif 428#endif
428 429
429/* Since we have our mappings set up, on multiprocessors we can spin them 430/* Since we have our mappings set up, on multiprocessors we can spin them
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index bca3b4e09c41..d809c4ebb48f 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -1,6 +1,6 @@
1/* arch/sparc64/kernel/traps.c 1/* arch/sparc64/kernel/traps.c
2 * 2 *
3 * Copyright (C) 1995,1997,2008 David S. Miller (davem@davemloft.net) 3 * Copyright (C) 1995,1997,2008,2009 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com) 4 * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com)
5 */ 5 */
6 6
@@ -128,6 +128,7 @@ void do_BUG(const char *file, int line)
128 bust_spinlocks(1); 128 bust_spinlocks(1);
129 printk("kernel BUG at %s:%d!\n", file, line); 129 printk("kernel BUG at %s:%d!\n", file, line);
130} 130}
131EXPORT_SYMBOL(do_BUG);
131#endif 132#endif
132 133
133static DEFINE_SPINLOCK(dimm_handler_lock); 134static DEFINE_SPINLOCK(dimm_handler_lock);
@@ -313,6 +314,21 @@ void sun4v_data_access_exception(struct pt_regs *regs, unsigned long addr, unsig
313 return; 314 return;
314 315
315 if (regs->tstate & TSTATE_PRIV) { 316 if (regs->tstate & TSTATE_PRIV) {
317 /* Test if this comes from uaccess places. */
318 const struct exception_table_entry *entry;
319
320 entry = search_exception_tables(regs->tpc);
321 if (entry) {
322 /* Ouch, somebody is trying VM hole tricks on us... */
323#ifdef DEBUG_EXCEPTIONS
324 printk("Exception: PC<%016lx> faddr<UNKNOWN>\n", regs->tpc);
325 printk("EX_TABLE: insn<%016lx> fixup<%016lx>\n",
326 regs->tpc, entry->fixup);
327#endif
328 regs->tpc = entry->fixup;
329 regs->tnpc = regs->tpc + 4;
330 return;
331 }
316 printk("sun4v_data_access_exception: ADDR[%016lx] " 332 printk("sun4v_data_access_exception: ADDR[%016lx] "
317 "CTX[%04x] TYPE[%04x], going.\n", 333 "CTX[%04x] TYPE[%04x], going.\n",
318 addr, ctx, type); 334 addr, ctx, type);
@@ -2261,6 +2277,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
2261 do_exit(SIGKILL); 2277 do_exit(SIGKILL);
2262 do_exit(SIGSEGV); 2278 do_exit(SIGSEGV);
2263} 2279}
2280EXPORT_SYMBOL(die_if_kernel);
2264 2281
2265#define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19)) 2282#define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19))
2266#define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19)) 2283#define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19))
diff --git a/arch/sparc/kernel/ttable.S b/arch/sparc/kernel/ttable.S
index ea925503b42e..d9bdfb9d5c18 100644
--- a/arch/sparc/kernel/ttable.S
+++ b/arch/sparc/kernel/ttable.S
@@ -63,7 +63,8 @@ tl0_irq6: TRAP_IRQ(smp_call_function_single_client, 6)
63#else 63#else
64tl0_irq6: BTRAP(0x46) 64tl0_irq6: BTRAP(0x46)
65#endif 65#endif
66tl0_irq7: BTRAP(0x47) BTRAP(0x48) BTRAP(0x49) 66tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7)
67tl0_irq8: BTRAP(0x48) BTRAP(0x49)
67tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d) 68tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d)
68tl0_irq14: TRAP_IRQ(timer_interrupt, 14) 69tl0_irq14: TRAP_IRQ(timer_interrupt, 14)
69tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15) 70tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15)
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
index f164d5a850f9..379209982a07 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -589,7 +589,6 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
589 unsigned long pc = regs->tpc; 589 unsigned long pc = regs->tpc;
590 unsigned long tstate = regs->tstate; 590 unsigned long tstate = regs->tstate;
591 u32 insn; 591 u32 insn;
592 u32 first, second;
593 u64 value; 592 u64 value;
594 u8 freg; 593 u8 freg;
595 int flag; 594 int flag;
@@ -601,19 +600,20 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
601 pc = (u32)pc; 600 pc = (u32)pc;
602 if (get_user(insn, (u32 __user *) pc) != -EFAULT) { 601 if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
603 int asi = decode_asi(insn, regs); 602 int asi = decode_asi(insn, regs);
603 u32 first, second;
604 int err; 604 int err;
605 605
606 if ((asi > ASI_SNFL) || 606 if ((asi > ASI_SNFL) ||
607 (asi < ASI_P)) 607 (asi < ASI_P))
608 goto daex; 608 goto daex;
609 first = second = 0;
609 err = get_user(first, (u32 __user *)sfar); 610 err = get_user(first, (u32 __user *)sfar);
610 if (!err) 611 if (!err)
611 err = get_user(second, (u32 __user *)(sfar + 4)); 612 err = get_user(second, (u32 __user *)(sfar + 4));
612 if (err) { 613 if (err) {
613 if (asi & 0x2) /* NF */ { 614 if (!(asi & 0x2))
614 first = 0; second = 0;
615 } else
616 goto daex; 615 goto daex;
616 first = second = 0;
617 } 617 }
618 save_and_clear_fpu(); 618 save_and_clear_fpu();
619 freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); 619 freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20);
diff --git a/arch/sparc/lib/GENbzero.S b/arch/sparc/lib/GENbzero.S
index 6a4f956a2f7a..8e7a843ddd88 100644
--- a/arch/sparc/lib/GENbzero.S
+++ b/arch/sparc/lib/GENbzero.S
@@ -6,13 +6,9 @@
6 6
7#define EX_ST(x,y) \ 7#define EX_ST(x,y) \
898: x,y; \ 898: x,y; \
9 .section .fixup; \
10 .align 4; \
1199: retl; \
12 mov %o1, %o0; \
13 .section __ex_table,"a";\ 9 .section __ex_table,"a";\
14 .align 4; \ 10 .align 4; \
15 .word 98b, 99b; \ 11 .word 98b, __retl_o1; \
16 .text; \ 12 .text; \
17 .align 4; 13 .align 4;
18 14
diff --git a/arch/sparc/lib/GENcopy_from_user.S b/arch/sparc/lib/GENcopy_from_user.S
index 2b9df99e87f9..b7d0bd6b1406 100644
--- a/arch/sparc/lib/GENcopy_from_user.S
+++ b/arch/sparc/lib/GENcopy_from_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
@@ -27,7 +23,7 @@
27#define PREAMBLE \ 23#define PREAMBLE \
28 rd %asi, %g1; \ 24 rd %asi, %g1; \
29 cmp %g1, ASI_AIUS; \ 25 cmp %g1, ASI_AIUS; \
30 bne,pn %icc, memcpy_user_stub; \ 26 bne,pn %icc, ___copy_in_user; \
31 nop 27 nop
32#endif 28#endif
33 29
diff --git a/arch/sparc/lib/GENcopy_to_user.S b/arch/sparc/lib/GENcopy_to_user.S
index bb3f7084daf9..780550e1afc7 100644
--- a/arch/sparc/lib/GENcopy_to_user.S
+++ b/arch/sparc/lib/GENcopy_to_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
@@ -31,7 +27,7 @@
31#define PREAMBLE \ 27#define PREAMBLE \
32 rd %asi, %g1; \ 28 rd %asi, %g1; \
33 cmp %g1, ASI_AIUS; \ 29 cmp %g1, ASI_AIUS; \
34 bne,pn %icc, memcpy_user_stub; \ 30 bne,pn %icc, ___copy_in_user; \
35 nop 31 nop
36#endif 32#endif
37 33
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 375016e19144..e75faf0e59ae 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -18,7 +18,7 @@ lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o
18lib-y += rwsem_$(BITS).o 18lib-y += rwsem_$(BITS).o
19lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o 19lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o
20 20
21lib-$(CONFIG_SPARC64) += PeeCeeI.o copy_page.o clear_page.o bzero.o 21lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o
22lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o 22lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o
23lib-$(CONFIG_SPARC64) += VISsave.o 23lib-$(CONFIG_SPARC64) += VISsave.o
24lib-$(CONFIG_SPARC64) += bitops.o 24lib-$(CONFIG_SPARC64) += bitops.o
@@ -42,3 +42,5 @@ lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o
42 42
43obj-y += iomap.o 43obj-y += iomap.o
44obj-$(CONFIG_SPARC32) += atomic32.o 44obj-$(CONFIG_SPARC32) += atomic32.o
45obj-y += ksyms.o
46obj-$(CONFIG_SPARC64) += PeeCeeI.o
diff --git a/arch/sparc/lib/NG2copy_from_user.S b/arch/sparc/lib/NG2copy_from_user.S
index c77ef5f22102..119ccb9a54f4 100644
--- a/arch/sparc/lib/NG2copy_from_user.S
+++ b/arch/sparc/lib/NG2copy_from_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 retl; \
12 mov 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __retl_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
@@ -33,7 +28,7 @@
33#define PREAMBLE \ 28#define PREAMBLE \
34 rd %asi, %g1; \ 29 rd %asi, %g1; \
35 cmp %g1, ASI_AIUS; \ 30 cmp %g1, ASI_AIUS; \
36 bne,pn %icc, memcpy_user_stub; \ 31 bne,pn %icc, ___copy_in_user; \
37 nop 32 nop
38#endif 33#endif
39 34
diff --git a/arch/sparc/lib/NG2copy_to_user.S b/arch/sparc/lib/NG2copy_to_user.S
index 4bd4093acbbd..7fe1ccefd9d0 100644
--- a/arch/sparc/lib/NG2copy_to_user.S
+++ b/arch/sparc/lib/NG2copy_to_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 retl; \
12 mov 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __retl_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
@@ -42,7 +37,7 @@
42#define PREAMBLE \ 37#define PREAMBLE \
43 rd %asi, %g1; \ 38 rd %asi, %g1; \
44 cmp %g1, ASI_AIUS; \ 39 cmp %g1, ASI_AIUS; \
45 bne,pn %icc, memcpy_user_stub; \ 40 bne,pn %icc, ___copy_in_user; \
46 nop 41 nop
47#endif 42#endif
48 43
diff --git a/arch/sparc/lib/NGbzero.S b/arch/sparc/lib/NGbzero.S
index 814d5f7a45e1..beab29bf419b 100644
--- a/arch/sparc/lib/NGbzero.S
+++ b/arch/sparc/lib/NGbzero.S
@@ -6,13 +6,9 @@
6 6
7#define EX_ST(x,y) \ 7#define EX_ST(x,y) \
898: x,y; \ 898: x,y; \
9 .section .fixup; \
10 .align 4; \
1199: retl; \
12 mov %o1, %o0; \
13 .section __ex_table,"a";\ 9 .section __ex_table,"a";\
14 .align 4; \ 10 .align 4; \
15 .word 98b, 99b; \ 11 .word 98b, __retl_o1; \
16 .text; \ 12 .text; \
17 .align 4; 13 .align 4;
18 14
diff --git a/arch/sparc/lib/NGcopy_from_user.S b/arch/sparc/lib/NGcopy_from_user.S
index e7f433f71b42..5d1e4d1ac21e 100644
--- a/arch/sparc/lib/NGcopy_from_user.S
+++ b/arch/sparc/lib/NGcopy_from_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 ret; \
12 restore %g0, 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __ret_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
@@ -30,7 +25,7 @@
30#define PREAMBLE \ 25#define PREAMBLE \
31 rd %asi, %g1; \ 26 rd %asi, %g1; \
32 cmp %g1, ASI_AIUS; \ 27 cmp %g1, ASI_AIUS; \
33 bne,pn %icc, memcpy_user_stub; \ 28 bne,pn %icc, ___copy_in_user; \
34 nop 29 nop
35#endif 30#endif
36 31
diff --git a/arch/sparc/lib/NGcopy_to_user.S b/arch/sparc/lib/NGcopy_to_user.S
index 6ea01c5532a0..ff630dcb273c 100644
--- a/arch/sparc/lib/NGcopy_to_user.S
+++ b/arch/sparc/lib/NGcopy_to_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 ret; \
12 restore %g0, 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __ret_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
@@ -33,7 +28,7 @@
33#define PREAMBLE \ 28#define PREAMBLE \
34 rd %asi, %g1; \ 29 rd %asi, %g1; \
35 cmp %g1, ASI_AIUS; \ 30 cmp %g1, ASI_AIUS; \
36 bne,pn %icc, memcpy_user_stub; \ 31 bne,pn %icc, ___copy_in_user; \
37 nop 32 nop
38#endif 33#endif
39 34
diff --git a/arch/sparc/lib/PeeCeeI.c b/arch/sparc/lib/PeeCeeI.c
index 46053e6ddd7b..6529f8657597 100644
--- a/arch/sparc/lib/PeeCeeI.c
+++ b/arch/sparc/lib/PeeCeeI.c
@@ -4,6 +4,8 @@
4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <linux/module.h>
8
7#include <asm/io.h> 9#include <asm/io.h>
8#include <asm/byteorder.h> 10#include <asm/byteorder.h>
9 11
@@ -15,6 +17,7 @@ void outsb(unsigned long __addr, const void *src, unsigned long count)
15 while (count--) 17 while (count--)
16 outb(*p++, addr); 18 outb(*p++, addr);
17} 19}
20EXPORT_SYMBOL(outsb);
18 21
19void outsw(unsigned long __addr, const void *src, unsigned long count) 22void outsw(unsigned long __addr, const void *src, unsigned long count)
20{ 23{
@@ -25,6 +28,7 @@ void outsw(unsigned long __addr, const void *src, unsigned long count)
25 src += sizeof(u16); 28 src += sizeof(u16);
26 } 29 }
27} 30}
31EXPORT_SYMBOL(outsw);
28 32
29void outsl(unsigned long __addr, const void *src, unsigned long count) 33void outsl(unsigned long __addr, const void *src, unsigned long count)
30{ 34{
@@ -78,6 +82,7 @@ void outsl(unsigned long __addr, const void *src, unsigned long count)
78 break; 82 break;
79 } 83 }
80} 84}
85EXPORT_SYMBOL(outsl);
81 86
82void insb(unsigned long __addr, void *dst, unsigned long count) 87void insb(unsigned long __addr, void *dst, unsigned long count)
83{ 88{
@@ -105,6 +110,7 @@ void insb(unsigned long __addr, void *dst, unsigned long count)
105 *pb++ = inb(addr); 110 *pb++ = inb(addr);
106 } 111 }
107} 112}
113EXPORT_SYMBOL(insb);
108 114
109void insw(unsigned long __addr, void *dst, unsigned long count) 115void insw(unsigned long __addr, void *dst, unsigned long count)
110{ 116{
@@ -132,6 +138,7 @@ void insw(unsigned long __addr, void *dst, unsigned long count)
132 *ps = le16_to_cpu(inw(addr)); 138 *ps = le16_to_cpu(inw(addr));
133 } 139 }
134} 140}
141EXPORT_SYMBOL(insw);
135 142
136void insl(unsigned long __addr, void *dst, unsigned long count) 143void insl(unsigned long __addr, void *dst, unsigned long count)
137{ 144{
@@ -200,4 +207,5 @@ void insl(unsigned long __addr, void *dst, unsigned long count)
200 } 207 }
201 } 208 }
202} 209}
210EXPORT_SYMBOL(insl);
203 211
diff --git a/arch/sparc/lib/U1copy_from_user.S b/arch/sparc/lib/U1copy_from_user.S
index 3192b0bf4fab..a6ae2ea04bf5 100644
--- a/arch/sparc/lib/U1copy_from_user.S
+++ b/arch/sparc/lib/U1copy_from_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
@@ -27,7 +23,7 @@
27#define PREAMBLE \ 23#define PREAMBLE \
28 rd %asi, %g1; \ 24 rd %asi, %g1; \
29 cmp %g1, ASI_AIUS; \ 25 cmp %g1, ASI_AIUS; \
30 bne,pn %icc, memcpy_user_stub; \ 26 bne,pn %icc, ___copy_in_user; \
31 nop; \ 27 nop; \
32 28
33#include "U1memcpy.S" 29#include "U1memcpy.S"
diff --git a/arch/sparc/lib/U1copy_to_user.S b/arch/sparc/lib/U1copy_to_user.S
index d1210ffb0b82..f4b970eeb485 100644
--- a/arch/sparc/lib/U1copy_to_user.S
+++ b/arch/sparc/lib/U1copy_to_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
@@ -27,7 +23,7 @@
27#define PREAMBLE \ 23#define PREAMBLE \
28 rd %asi, %g1; \ 24 rd %asi, %g1; \
29 cmp %g1, ASI_AIUS; \ 25 cmp %g1, ASI_AIUS; \
30 bne,pn %icc, memcpy_user_stub; \ 26 bne,pn %icc, ___copy_in_user; \
31 nop; \ 27 nop; \
32 28
33#include "U1memcpy.S" 29#include "U1memcpy.S"
diff --git a/arch/sparc/lib/U3copy_from_user.S b/arch/sparc/lib/U3copy_from_user.S
index f5bfc8d9d216..b1acd1331c33 100644
--- a/arch/sparc/lib/U3copy_from_user.S
+++ b/arch/sparc/lib/U3copy_from_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/U3copy_to_user.S b/arch/sparc/lib/U3copy_to_user.S
index 2334f111bb0c..ef1e493afdfa 100644
--- a/arch/sparc/lib/U3copy_to_user.S
+++ b/arch/sparc/lib/U3copy_to_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
@@ -27,7 +23,7 @@
27#define PREAMBLE \ 23#define PREAMBLE \
28 rd %asi, %g1; \ 24 rd %asi, %g1; \
29 cmp %g1, ASI_AIUS; \ 25 cmp %g1, ASI_AIUS; \
30 bne,pn %icc, memcpy_user_stub; \ 26 bne,pn %icc, ___copy_in_user; \
31 nop; \ 27 nop; \
32 28
33#include "U3memcpy.S" 29#include "U3memcpy.S"
diff --git a/arch/sparc/lib/bzero.S b/arch/sparc/lib/bzero.S
index c7bbae8c590f..b6557297440f 100644
--- a/arch/sparc/lib/bzero.S
+++ b/arch/sparc/lib/bzero.S
@@ -88,13 +88,9 @@ __bzero_done:
88 88
89#define EX_ST(x,y) \ 89#define EX_ST(x,y) \
9098: x,y; \ 9098: x,y; \
91 .section .fixup; \
92 .align 4; \
9399: retl; \
94 mov %o1, %o0; \
95 .section __ex_table,"a";\ 91 .section __ex_table,"a";\
96 .align 4; \ 92 .align 4; \
97 .word 98b, 99b; \ 93 .word 98b, __retl_o1; \
98 .text; \ 94 .text; \
99 .align 4; 95 .align 4;
100 96
diff --git a/arch/sparc/lib/copy_in_user.S b/arch/sparc/lib/copy_in_user.S
index 650af3f21f78..302c0e60dc2c 100644
--- a/arch/sparc/lib/copy_in_user.S
+++ b/arch/sparc/lib/copy_in_user.S
@@ -3,19 +3,16 @@
3 * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com) 3 * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
4 */ 4 */
5 5
6#include <linux/linkage.h>
6#include <asm/asi.h> 7#include <asm/asi.h>
7 8
8#define XCC xcc 9#define XCC xcc
9 10
10#define EX(x,y) \ 11#define EX(x,y) \
1198: x,y; \ 1298: x,y; \
12 .section .fixup; \
13 .align 4; \
1499: retl; \
15 mov 1, %o0; \
16 .section __ex_table,"a";\ 13 .section __ex_table,"a";\
17 .align 4; \ 14 .align 4; \
18 .word 98b, 99b; \ 15 .word 98b, __retl_one; \
19 .text; \ 16 .text; \
20 .align 4; 17 .align 4;
21 18
@@ -31,18 +28,7 @@
31 * to copy register windows around during thread cloning. 28 * to copy register windows around during thread cloning.
32 */ 29 */
33 30
34 .globl ___copy_in_user 31ENTRY(___copy_in_user) /* %o0=dst, %o1=src, %o2=len */
35 .type ___copy_in_user,#function
36___copy_in_user: /* %o0=dst, %o1=src, %o2=len */
37 /* Writing to %asi is _expensive_ so we hardcode it.
38 * Reading %asi to check for KERNEL_DS is comparatively
39 * cheap.
40 */
41 rd %asi, %g1
42 cmp %g1, ASI_AIUS
43 bne,pn %icc, memcpy_user_stub
44 nop
45
46 cmp %o2, 0 32 cmp %o2, 0
47 be,pn %XCC, 85f 33 be,pn %XCC, 85f
48 or %o0, %o1, %o3 34 or %o0, %o1, %o3
@@ -53,22 +39,24 @@ ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */
53 /* 16 < len <= 64 */ 39 /* 16 < len <= 64 */
54 andcc %o3, 0x7, %g0 40 andcc %o3, 0x7, %g0
55 bne,pn %XCC, 90f 41 bne,pn %XCC, 90f
56 sub %o0, %o1, %o3 42 nop
57 43
58 andn %o2, 0x7, %o4 44 andn %o2, 0x7, %o4
59 and %o2, 0x7, %o2 45 and %o2, 0x7, %o2
601: subcc %o4, 0x8, %o4 461: subcc %o4, 0x8, %o4
61 EX(ldxa [%o1] %asi, %o5) 47 EX(ldxa [%o1] %asi, %o5)
62 EX(stxa %o5, [%o1 + %o3] ASI_AIUS) 48 EX(stxa %o5, [%o0] %asi)
49 add %o1, 0x8, %o1
63 bgu,pt %XCC, 1b 50 bgu,pt %XCC, 1b
64 add %o1, 0x8, %o1 51 add %o0, 0x8, %o0
65 andcc %o2, 0x4, %g0 52 andcc %o2, 0x4, %g0
66 be,pt %XCC, 1f 53 be,pt %XCC, 1f
67 nop 54 nop
68 sub %o2, 0x4, %o2 55 sub %o2, 0x4, %o2
69 EX(lduwa [%o1] %asi, %o5) 56 EX(lduwa [%o1] %asi, %o5)
70 EX(stwa %o5, [%o1 + %o3] ASI_AIUS) 57 EX(stwa %o5, [%o0] %asi)
71 add %o1, 0x4, %o1 58 add %o1, 0x4, %o1
59 add %o0, 0x4, %o0
721: cmp %o2, 0 601: cmp %o2, 0
73 be,pt %XCC, 85f 61 be,pt %XCC, 85f
74 nop 62 nop
@@ -78,14 +66,15 @@ ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */
7880: /* 0 < len <= 16 */ 6680: /* 0 < len <= 16 */
79 andcc %o3, 0x3, %g0 67 andcc %o3, 0x3, %g0
80 bne,pn %XCC, 90f 68 bne,pn %XCC, 90f
81 sub %o0, %o1, %o3 69 nop
82 70
8382: 7182:
84 subcc %o2, 4, %o2 72 subcc %o2, 4, %o2
85 EX(lduwa [%o1] %asi, %g1) 73 EX(lduwa [%o1] %asi, %g1)
86 EX(stwa %g1, [%o1 + %o3] ASI_AIUS) 74 EX(stwa %g1, [%o0] %asi)
75 add %o1, 4, %o1
87 bgu,pt %XCC, 82b 76 bgu,pt %XCC, 82b
88 add %o1, 4, %o1 77 add %o0, 4, %o0
89 78
9085: retl 7985: retl
91 clr %o0 80 clr %o0
@@ -94,26 +83,10 @@ ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */
9490: 8390:
95 subcc %o2, 1, %o2 84 subcc %o2, 1, %o2
96 EX(lduba [%o1] %asi, %g1) 85 EX(lduba [%o1] %asi, %g1)
97 EX(stba %g1, [%o1 + %o3] ASI_AIUS) 86 EX(stba %g1, [%o0] %asi)
87 add %o1, 1, %o1
98 bgu,pt %XCC, 90b 88 bgu,pt %XCC, 90b
99 add %o1, 1, %o1 89 add %o0, 1, %o0
100 retl 90 retl
101 clr %o0 91 clr %o0
102 92ENDPROC(___copy_in_user)
103 .size ___copy_in_user, .-___copy_in_user
104
105 /* Act like copy_{to,in}_user(), ie. return zero instead
106 * of original destination pointer. This is invoked when
107 * copy_{to,in}_user() finds that %asi is kernel space.
108 */
109 .globl memcpy_user_stub
110 .type memcpy_user_stub,#function
111memcpy_user_stub:
112 save %sp, -192, %sp
113 mov %i0, %o0
114 mov %i1, %o1
115 call memcpy
116 mov %i2, %o2
117 ret
118 restore %g0, %g0, %o0
119 .size memcpy_user_stub, .-memcpy_user_stub
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
new file mode 100644
index 000000000000..704b12668388
--- /dev/null
+++ b/arch/sparc/lib/ksyms.c
@@ -0,0 +1,196 @@
1/*
2 * Export of symbols defined in assembler
3 */
4
5/* Tell string.h we don't want memcpy etc. as cpp defines */
6#define EXPORT_SYMTAB_STROPS
7
8#include <linux/module.h>
9#include <linux/string.h>
10#include <linux/types.h>
11
12#include <asm/checksum.h>
13#include <asm/uaccess.h>
14#include <asm/ftrace.h>
15
16/* string functions */
17EXPORT_SYMBOL(strlen);
18EXPORT_SYMBOL(__strlen_user);
19EXPORT_SYMBOL(__strnlen_user);
20EXPORT_SYMBOL(strncmp);
21
22/* mem* functions */
23extern void *__memscan_zero(void *, size_t);
24extern void *__memscan_generic(void *, int, size_t);
25extern void *__bzero(void *, size_t);
26
27EXPORT_SYMBOL(memscan);
28EXPORT_SYMBOL(__memscan_zero);
29EXPORT_SYMBOL(__memscan_generic);
30EXPORT_SYMBOL(memcmp);
31EXPORT_SYMBOL(memcpy);
32EXPORT_SYMBOL(memset);
33EXPORT_SYMBOL(__memset);
34EXPORT_SYMBOL(memmove);
35EXPORT_SYMBOL(__bzero);
36
37/* Moving data to/from/in userspace. */
38EXPORT_SYMBOL(__strncpy_from_user);
39
40/* Networking helper routines. */
41EXPORT_SYMBOL(csum_partial);
42
43#ifdef CONFIG_MCOUNT
44EXPORT_SYMBOL(_mcount);
45#endif
46
47/*
48 * sparc
49 */
50#ifdef CONFIG_SPARC32
51extern int __ashrdi3(int, int);
52extern int __ashldi3(int, int);
53extern int __lshrdi3(int, int);
54extern int __muldi3(int, int);
55extern int __divdi3(int, int);
56
57extern void (*__copy_1page)(void *, const void *);
58extern void (*bzero_1page)(void *);
59
60extern int __strncmp(const char *, const char *, __kernel_size_t);
61
62extern void ___rw_read_enter(void);
63extern void ___rw_read_try(void);
64extern void ___rw_read_exit(void);
65extern void ___rw_write_enter(void);
66extern void ___atomic24_add(void);
67extern void ___atomic24_sub(void);
68
69/* Alias functions whose names begin with "." and export the aliases.
70 * The module references will be fixed up by module_frob_arch_sections.
71 */
72extern int _Div(int, int);
73extern int _Mul(int, int);
74extern int _Rem(int, int);
75extern unsigned _Udiv(unsigned, unsigned);
76extern unsigned _Umul(unsigned, unsigned);
77extern unsigned _Urem(unsigned, unsigned);
78
79/* Networking helper routines. */
80EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
81
82/* Special internal versions of library functions. */
83EXPORT_SYMBOL(__copy_1page);
84EXPORT_SYMBOL(__memcpy);
85EXPORT_SYMBOL(__memmove);
86EXPORT_SYMBOL(bzero_1page);
87
88/* string functions */
89EXPORT_SYMBOL(__strncmp);
90
91/* Moving data to/from/in userspace. */
92EXPORT_SYMBOL(__copy_user);
93
94/* Used by asm/spinlock.h */
95#ifdef CONFIG_SMP
96EXPORT_SYMBOL(___rw_read_enter);
97EXPORT_SYMBOL(___rw_read_try);
98EXPORT_SYMBOL(___rw_read_exit);
99EXPORT_SYMBOL(___rw_write_enter);
100#endif
101
102/* Atomic operations. */
103EXPORT_SYMBOL(___atomic24_add);
104EXPORT_SYMBOL(___atomic24_sub);
105
106EXPORT_SYMBOL(__ashrdi3);
107EXPORT_SYMBOL(__ashldi3);
108EXPORT_SYMBOL(__lshrdi3);
109EXPORT_SYMBOL(__muldi3);
110EXPORT_SYMBOL(__divdi3);
111
112EXPORT_SYMBOL(_Rem);
113EXPORT_SYMBOL(_Urem);
114EXPORT_SYMBOL(_Mul);
115EXPORT_SYMBOL(_Umul);
116EXPORT_SYMBOL(_Div);
117EXPORT_SYMBOL(_Udiv);
118#endif
119
120/*
121 * sparc64
122 */
123#ifdef CONFIG_SPARC64
124/* Networking helper routines. */
125EXPORT_SYMBOL(csum_partial_copy_nocheck);
126EXPORT_SYMBOL(__csum_partial_copy_from_user);
127EXPORT_SYMBOL(__csum_partial_copy_to_user);
128EXPORT_SYMBOL(ip_fast_csum);
129
130/* Moving data to/from/in userspace. */
131EXPORT_SYMBOL(___copy_to_user);
132EXPORT_SYMBOL(___copy_from_user);
133EXPORT_SYMBOL(___copy_in_user);
134EXPORT_SYMBOL(__clear_user);
135
136/* RW semaphores */
137EXPORT_SYMBOL(__down_read);
138EXPORT_SYMBOL(__down_read_trylock);
139EXPORT_SYMBOL(__down_write);
140EXPORT_SYMBOL(__down_write_trylock);
141EXPORT_SYMBOL(__up_read);
142EXPORT_SYMBOL(__up_write);
143EXPORT_SYMBOL(__downgrade_write);
144
145/* Atomic counter implementation. */
146EXPORT_SYMBOL(atomic_add);
147EXPORT_SYMBOL(atomic_add_ret);
148EXPORT_SYMBOL(atomic_sub);
149EXPORT_SYMBOL(atomic_sub_ret);
150EXPORT_SYMBOL(atomic64_add);
151EXPORT_SYMBOL(atomic64_add_ret);
152EXPORT_SYMBOL(atomic64_sub);
153EXPORT_SYMBOL(atomic64_sub_ret);
154
155/* Atomic bit operations. */
156EXPORT_SYMBOL(test_and_set_bit);
157EXPORT_SYMBOL(test_and_clear_bit);
158EXPORT_SYMBOL(test_and_change_bit);
159EXPORT_SYMBOL(set_bit);
160EXPORT_SYMBOL(clear_bit);
161EXPORT_SYMBOL(change_bit);
162
163/* Special internal versions of library functions. */
164EXPORT_SYMBOL(_clear_page);
165EXPORT_SYMBOL(clear_user_page);
166EXPORT_SYMBOL(copy_user_page);
167
168/* RAID code needs this */
169void VISenter(void);
170EXPORT_SYMBOL(VISenter);
171
172extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
173extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
174 unsigned long *);
175extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
176 unsigned long *, unsigned long *);
177extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
178 unsigned long *, unsigned long *, unsigned long *);
179EXPORT_SYMBOL(xor_vis_2);
180EXPORT_SYMBOL(xor_vis_3);
181EXPORT_SYMBOL(xor_vis_4);
182EXPORT_SYMBOL(xor_vis_5);
183
184extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
185extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
186 unsigned long *);
187extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
188 unsigned long *, unsigned long *);
189extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
190 unsigned long *, unsigned long *, unsigned long *);
191
192EXPORT_SYMBOL(xor_niagara_2);
193EXPORT_SYMBOL(xor_niagara_3);
194EXPORT_SYMBOL(xor_niagara_4);
195EXPORT_SYMBOL(xor_niagara_5);
196#endif
diff --git a/arch/sparc/lib/user_fixup.c b/arch/sparc/lib/user_fixup.c
index 05a361b0a1a4..ac96ae236709 100644
--- a/arch/sparc/lib/user_fixup.c
+++ b/arch/sparc/lib/user_fixup.c
@@ -7,6 +7,8 @@
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/string.h> 8#include <linux/string.h>
9#include <linux/errno.h> 9#include <linux/errno.h>
10#include <linux/module.h>
11
10#include <asm/uaccess.h> 12#include <asm/uaccess.h>
11 13
12/* Calculating the exact fault address when using 14/* Calculating the exact fault address when using
@@ -40,6 +42,7 @@ unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned l
40 42
41 return size; 43 return size;
42} 44}
45EXPORT_SYMBOL(copy_from_user_fixup);
43 46
44unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) 47unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size)
45{ 48{
@@ -47,6 +50,7 @@ unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned lon
47 50
48 return compute_size((unsigned long) to, size, &offset); 51 return compute_size((unsigned long) to, size, &offset);
49} 52}
53EXPORT_SYMBOL(copy_to_user_fixup);
50 54
51unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) 55unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size)
52{ 56{
@@ -64,3 +68,4 @@ unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned lo
64 68
65 return size; 69 return size;
66} 70}
71EXPORT_SYMBOL(copy_in_user_fixup);
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c
index a9e474bf6385..4ab8993b0863 100644
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -19,6 +19,7 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/kprobes.h> 20#include <linux/kprobes.h>
21#include <linux/kdebug.h> 21#include <linux/kdebug.h>
22#include <linux/percpu.h>
22 23
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/pgtable.h> 25#include <asm/pgtable.h>
@@ -224,6 +225,30 @@ cannot_handle:
224 unhandled_fault (address, current, regs); 225 unhandled_fault (address, current, regs);
225} 226}
226 227
228static void noinline bogus_32bit_fault_tpc(struct pt_regs *regs)
229{
230 static int times;
231
232 if (times++ < 10)
233 printk(KERN_ERR "FAULT[%s:%d]: 32-bit process reports "
234 "64-bit TPC [%lx]\n",
235 current->comm, current->pid,
236 regs->tpc);
237 show_regs(regs);
238}
239
240static void noinline bogus_32bit_fault_address(struct pt_regs *regs,
241 unsigned long addr)
242{
243 static int times;
244
245 if (times++ < 10)
246 printk(KERN_ERR "FAULT[%s:%d]: 32-bit process "
247 "reports 64-bit fault address [%lx]\n",
248 current->comm, current->pid, addr);
249 show_regs(regs);
250}
251
227asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) 252asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
228{ 253{
229 struct mm_struct *mm = current->mm; 254 struct mm_struct *mm = current->mm;
@@ -244,6 +269,19 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
244 (fault_code & FAULT_CODE_DTLB)) 269 (fault_code & FAULT_CODE_DTLB))
245 BUG(); 270 BUG();
246 271
272 if (test_thread_flag(TIF_32BIT)) {
273 if (!(regs->tstate & TSTATE_PRIV)) {
274 if (unlikely((regs->tpc >> 32) != 0)) {
275 bogus_32bit_fault_tpc(regs);
276 goto intr_or_no_mm;
277 }
278 }
279 if (unlikely((address >> 32) != 0)) {
280 bogus_32bit_fault_address(regs, address);
281 goto intr_or_no_mm;
282 }
283 }
284
247 if (regs->tstate & TSTATE_PRIV) { 285 if (regs->tstate & TSTATE_PRIV) {
248 unsigned long tpc = regs->tpc; 286 unsigned long tpc = regs->tpc;
249 287
@@ -264,12 +302,6 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
264 if (in_atomic() || !mm) 302 if (in_atomic() || !mm)
265 goto intr_or_no_mm; 303 goto intr_or_no_mm;
266 304
267 if (test_thread_flag(TIF_32BIT)) {
268 if (!(regs->tstate & TSTATE_PRIV))
269 regs->tpc &= 0xffffffff;
270 address &= 0xffffffff;
271 }
272
273 if (!down_read_trylock(&mm->mmap_sem)) { 305 if (!down_read_trylock(&mm->mmap_sem)) {
274 if ((regs->tstate & TSTATE_PRIV) && 306 if ((regs->tstate & TSTATE_PRIV) &&
275 !search_exception_tables(regs->tpc)) { 307 !search_exception_tables(regs->tpc)) {
diff --git a/arch/sparc/mm/generic_32.c b/arch/sparc/mm/generic_32.c
index a289261da9fd..5edcac184eaf 100644
--- a/arch/sparc/mm/generic_32.c
+++ b/arch/sparc/mm/generic_32.c
@@ -95,3 +95,4 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
95 flush_tlb_range(vma, beg, end); 95 flush_tlb_range(vma, beg, end);
96 return error; 96 return error;
97} 97}
98EXPORT_SYMBOL(io_remap_pfn_range);
diff --git a/arch/sparc/mm/generic_64.c b/arch/sparc/mm/generic_64.c
index f362c2037013..04f2bf4cd571 100644
--- a/arch/sparc/mm/generic_64.c
+++ b/arch/sparc/mm/generic_64.c
@@ -161,3 +161,4 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
161 flush_tlb_range(vma, beg, end); 161 flush_tlb_range(vma, beg, end);
162 return error; 162 return error;
163} 163}
164EXPORT_SYMBOL(io_remap_pfn_range);
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c
index 01fc6c254292..752d0c9fb544 100644
--- a/arch/sparc/mm/highmem.c
+++ b/arch/sparc/mm/highmem.c
@@ -62,6 +62,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
62 62
63 return (void*) vaddr; 63 return (void*) vaddr;
64} 64}
65EXPORT_SYMBOL(kmap_atomic);
65 66
66void kunmap_atomic(void *kvaddr, enum km_type type) 67void kunmap_atomic(void *kvaddr, enum km_type type)
67{ 68{
@@ -98,6 +99,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
98 99
99 pagefault_enable(); 100 pagefault_enable();
100} 101}
102EXPORT_SYMBOL(kunmap_atomic);
101 103
102/* We may be fed a pagetable here by ptep_to_xxx and others. */ 104/* We may be fed a pagetable here by ptep_to_xxx and others. */
103struct page *kmap_atomic_to_page(void *ptr) 105struct page *kmap_atomic_to_page(void *ptr)
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index fec926021f49..cbb282dab5a7 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -38,11 +38,16 @@
38DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 38DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
39 39
40unsigned long *sparc_valid_addr_bitmap; 40unsigned long *sparc_valid_addr_bitmap;
41EXPORT_SYMBOL(sparc_valid_addr_bitmap);
41 42
42unsigned long phys_base; 43unsigned long phys_base;
44EXPORT_SYMBOL(phys_base);
45
43unsigned long pfn_base; 46unsigned long pfn_base;
47EXPORT_SYMBOL(pfn_base);
44 48
45unsigned long page_kernel; 49unsigned long page_kernel;
50EXPORT_SYMBOL(page_kernel);
46 51
47struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1]; 52struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
48unsigned long sparc_unmapped_base; 53unsigned long sparc_unmapped_base;
@@ -522,3 +527,4 @@ void sparc_flush_page_to_ram(struct page *page)
522 if (vaddr) 527 if (vaddr)
523 __flush_page_to_ram(vaddr); 528 __flush_page_to_ram(vaddr);
524} 529}
530EXPORT_SYMBOL(sparc_flush_page_to_ram);
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index c77c7ef5d5d4..00373ce2d8fb 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -146,6 +146,7 @@ static void __init read_obp_memory(const char *property,
146} 146}
147 147
148unsigned long *sparc64_valid_addr_bitmap __read_mostly; 148unsigned long *sparc64_valid_addr_bitmap __read_mostly;
149EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
149 150
150/* Kernel physical address base and size in bytes. */ 151/* Kernel physical address base and size in bytes. */
151unsigned long kern_base __read_mostly; 152unsigned long kern_base __read_mostly;
@@ -369,6 +370,7 @@ void flush_dcache_page(struct page *page)
369out: 370out:
370 put_cpu(); 371 put_cpu();
371} 372}
373EXPORT_SYMBOL(flush_dcache_page);
372 374
373void __kprobes flush_icache_range(unsigned long start, unsigned long end) 375void __kprobes flush_icache_range(unsigned long start, unsigned long end)
374{ 376{
@@ -396,6 +398,7 @@ void __kprobes flush_icache_range(unsigned long start, unsigned long end)
396 } 398 }
397 } 399 }
398} 400}
401EXPORT_SYMBOL(flush_icache_range);
399 402
400void mmu_info(struct seq_file *m) 403void mmu_info(struct seq_file *m)
401{ 404{
@@ -599,6 +602,7 @@ void __flush_dcache_range(unsigned long start, unsigned long end)
599 "i" (ASI_DCACHE_INVALIDATE)); 602 "i" (ASI_DCACHE_INVALIDATE));
600 } 603 }
601} 604}
605EXPORT_SYMBOL(__flush_dcache_range);
602 606
603/* get_new_mmu_context() uses "cache + 1". */ 607/* get_new_mmu_context() uses "cache + 1". */
604DEFINE_SPINLOCK(ctx_alloc_lock); 608DEFINE_SPINLOCK(ctx_alloc_lock);
diff --git a/arch/sparc/oprofile/init.c b/arch/sparc/oprofile/init.c
index d6e170c074fc..d172f86439b1 100644
--- a/arch/sparc/oprofile/init.c
+++ b/arch/sparc/oprofile/init.c
@@ -13,217 +13,57 @@
13#include <linux/init.h> 13#include <linux/init.h>
14 14
15#ifdef CONFIG_SPARC64 15#ifdef CONFIG_SPARC64
16#include <asm/hypervisor.h> 16#include <linux/notifier.h>
17#include <asm/spitfire.h> 17#include <linux/rcupdate.h>
18#include <asm/cpudata.h> 18#include <linux/kdebug.h>
19#include <asm/irq.h> 19#include <asm/nmi.h>
20 20
21static int nmi_enabled; 21static int profile_timer_exceptions_notify(struct notifier_block *self,
22 22 unsigned long val, void *data)
23struct pcr_ops {
24 u64 (*read)(void);
25 void (*write)(u64);
26};
27static const struct pcr_ops *pcr_ops;
28
29static u64 direct_pcr_read(void)
30{
31 u64 val;
32
33 read_pcr(val);
34 return val;
35}
36
37static void direct_pcr_write(u64 val)
38{
39 write_pcr(val);
40}
41
42static const struct pcr_ops direct_pcr_ops = {
43 .read = direct_pcr_read,
44 .write = direct_pcr_write,
45};
46
47static void n2_pcr_write(u64 val)
48{ 23{
49 unsigned long ret; 24 struct die_args *args = (struct die_args *)data;
50 25 int ret = NOTIFY_DONE;
51 ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
52 if (val != HV_EOK)
53 write_pcr(val);
54}
55
56static const struct pcr_ops n2_pcr_ops = {
57 .read = direct_pcr_read,
58 .write = n2_pcr_write,
59};
60
61/* In order to commonize as much of the implementation as
62 * possible, we use PICH as our counter. Mostly this is
63 * to accomodate Niagara-1 which can only count insn cycles
64 * in PICH.
65 */
66static u64 picl_value(void)
67{
68 u32 delta = local_cpu_data().clock_tick / HZ;
69
70 return ((u64)((0 - delta) & 0xffffffff)) << 32;
71}
72
73#define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */
74#define PCR_STRACE 0x00000002 /* Trace supervisor events */
75#define PCR_UTRACE 0x00000004 /* Trace user events */
76#define PCR_N2_HTRACE 0x00000008 /* Trace hypervisor events */
77#define PCR_N2_TOE_OV0 0x00000010 /* Trap if PIC 0 overflows */
78#define PCR_N2_TOE_OV1 0x00000020 /* Trap if PIC 1 overflows */
79#define PCR_N2_MASK0 0x00003fc0
80#define PCR_N2_MASK0_SHIFT 6
81#define PCR_N2_SL0 0x0003c000
82#define PCR_N2_SL0_SHIFT 14
83#define PCR_N2_OV0 0x00040000
84#define PCR_N2_MASK1 0x07f80000
85#define PCR_N2_MASK1_SHIFT 19
86#define PCR_N2_SL1 0x78000000
87#define PCR_N2_SL1_SHIFT 27
88#define PCR_N2_OV1 0x80000000
89
90#define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE)
91#define PCR_N2_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE | \
92 PCR_N2_TOE_OV1 | \
93 (2 << PCR_N2_SL1_SHIFT) | \
94 (0xff << PCR_N2_MASK1_SHIFT))
95
96static u64 pcr_enable = PCR_SUN4U_ENABLE;
97
98static void nmi_handler(struct pt_regs *regs)
99{
100 pcr_ops->write(PCR_PIC_PRIV);
101
102 if (nmi_enabled) {
103 oprofile_add_sample(regs, 0);
104
105 write_pic(picl_value());
106 pcr_ops->write(pcr_enable);
107 }
108}
109
110/* We count "clock cycle" events in the lower 32-bit PIC.
111 * Then configure it such that it overflows every HZ, and thus
112 * generates a level 15 interrupt at that frequency.
113 */
114static void cpu_nmi_start(void *_unused)
115{
116 pcr_ops->write(PCR_PIC_PRIV);
117 write_pic(picl_value());
118
119 pcr_ops->write(pcr_enable);
120}
121 26
122static void cpu_nmi_stop(void *_unused) 27 switch (val) {
123{ 28 case DIE_NMI:
124 pcr_ops->write(PCR_PIC_PRIV); 29 oprofile_add_sample(args->regs, 0);
125} 30 ret = NOTIFY_STOP;
126 31 break;
127static int nmi_start(void) 32 default:
128{ 33 break;
129 int err = register_perfctr_intr(nmi_handler);
130
131 if (!err) {
132 nmi_enabled = 1;
133 wmb();
134 err = on_each_cpu(cpu_nmi_start, NULL, 1);
135 if (err) {
136 nmi_enabled = 0;
137 wmb();
138 on_each_cpu(cpu_nmi_stop, NULL, 1);
139 release_perfctr_intr(nmi_handler);
140 }
141 } 34 }
142 35 return ret;
143 return err;
144}
145
146static void nmi_stop(void)
147{
148 nmi_enabled = 0;
149 wmb();
150
151 on_each_cpu(cpu_nmi_stop, NULL, 1);
152 release_perfctr_intr(nmi_handler);
153 synchronize_sched();
154} 36}
155 37
156static unsigned long perf_hsvc_group; 38static struct notifier_block profile_timer_exceptions_nb = {
157static unsigned long perf_hsvc_major; 39 .notifier_call = profile_timer_exceptions_notify,
158static unsigned long perf_hsvc_minor; 40};
159 41
160static int __init register_perf_hsvc(void) 42static int timer_start(void)
161{ 43{
162 if (tlb_type == hypervisor) { 44 if (register_die_notifier(&profile_timer_exceptions_nb))
163 switch (sun4v_chip_type) { 45 return 1;
164 case SUN4V_CHIP_NIAGARA1: 46 nmi_adjust_hz(HZ);
165 perf_hsvc_group = HV_GRP_NIAG_PERF;
166 break;
167
168 case SUN4V_CHIP_NIAGARA2:
169 perf_hsvc_group = HV_GRP_N2_CPU;
170 break;
171
172 default:
173 return -ENODEV;
174 }
175
176
177 perf_hsvc_major = 1;
178 perf_hsvc_minor = 0;
179 if (sun4v_hvapi_register(perf_hsvc_group,
180 perf_hsvc_major,
181 &perf_hsvc_minor)) {
182 printk("perfmon: Could not register N2 hvapi.\n");
183 return -ENODEV;
184 }
185 }
186 return 0; 47 return 0;
187} 48}
188 49
189static void unregister_perf_hsvc(void) 50
51static void timer_stop(void)
190{ 52{
191 if (tlb_type != hypervisor) 53 nmi_adjust_hz(1);
192 return; 54 unregister_die_notifier(&profile_timer_exceptions_nb);
193 sun4v_hvapi_unregister(perf_hsvc_group); 55 synchronize_sched(); /* Allow already-started NMIs to complete. */
194} 56}
195 57
196static int oprofile_nmi_init(struct oprofile_operations *ops) 58static int op_nmi_timer_init(struct oprofile_operations *ops)
197{ 59{
198 int err = register_perf_hsvc(); 60 if (!nmi_usable)
199
200 if (err)
201 return err;
202
203 switch (tlb_type) {
204 case hypervisor:
205 pcr_ops = &n2_pcr_ops;
206 pcr_enable = PCR_N2_ENABLE;
207 break;
208
209 case cheetah:
210 case cheetah_plus:
211 pcr_ops = &direct_pcr_ops;
212 break;
213
214 default:
215 return -ENODEV; 61 return -ENODEV;
216 }
217 62
218 ops->create_files = NULL; 63 ops->start = timer_start;
219 ops->setup = NULL; 64 ops->stop = timer_stop;
220 ops->shutdown = NULL;
221 ops->start = nmi_start;
222 ops->stop = nmi_stop;
223 ops->cpu_type = "timer"; 65 ops->cpu_type = "timer";
224 66 printk(KERN_INFO "oprofile: Using perfctr NMI timer interrupt.\n");
225 printk(KERN_INFO "oprofile: Using perfctr based NMI timer interrupt.\n");
226
227 return 0; 67 return 0;
228} 68}
229#endif 69#endif
@@ -233,7 +73,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
233 int ret = -ENODEV; 73 int ret = -ENODEV;
234 74
235#ifdef CONFIG_SPARC64 75#ifdef CONFIG_SPARC64
236 ret = oprofile_nmi_init(ops); 76 ret = op_nmi_timer_init(ops);
237 if (!ret) 77 if (!ret)
238 return ret; 78 return ret;
239#endif 79#endif
@@ -241,10 +81,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
241 return ret; 81 return ret;
242} 82}
243 83
244
245void oprofile_arch_exit(void) 84void oprofile_arch_exit(void)
246{ 85{
247#ifdef CONFIG_SPARC64
248 unregister_perf_hsvc();
249#endif
250} 86}
diff --git a/arch/sparc/prom/init_32.c b/arch/sparc/prom/init_32.c
index 873217c6d823..6193c33ed4d4 100644
--- a/arch/sparc/prom/init_32.c
+++ b/arch/sparc/prom/init_32.c
@@ -8,16 +8,20 @@
8 8
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/module.h>
11 12
12#include <asm/openprom.h> 13#include <asm/openprom.h>
13#include <asm/oplib.h> 14#include <asm/oplib.h>
14 15
15struct linux_romvec *romvec; 16struct linux_romvec *romvec;
17EXPORT_SYMBOL(romvec);
18
16enum prom_major_version prom_vers; 19enum prom_major_version prom_vers;
17unsigned int prom_rev, prom_prev; 20unsigned int prom_rev, prom_prev;
18 21
19/* The root node of the prom device tree. */ 22/* The root node of the prom device tree. */
20int prom_root_node; 23int prom_root_node;
24EXPORT_SYMBOL(prom_root_node);
21 25
22/* Pointer to the device tree operations structure. */ 26/* Pointer to the device tree operations structure. */
23struct linux_nodeops *prom_nodeops; 27struct linux_nodeops *prom_nodeops;
diff --git a/arch/sparc/prom/misc_32.c b/arch/sparc/prom/misc_32.c
index cf6c3f6d36c3..4d61c540bb3d 100644
--- a/arch/sparc/prom/misc_32.c
+++ b/arch/sparc/prom/misc_32.c
@@ -8,6 +8,8 @@
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <linux/module.h>
12
11#include <asm/openprom.h> 13#include <asm/openprom.h>
12#include <asm/oplib.h> 14#include <asm/oplib.h>
13#include <asm/auxio.h> 15#include <asm/auxio.h>
@@ -44,6 +46,7 @@ prom_feval(char *fstring)
44 restore_current(); 46 restore_current();
45 spin_unlock_irqrestore(&prom_lock, flags); 47 spin_unlock_irqrestore(&prom_lock, flags);
46} 48}
49EXPORT_SYMBOL(prom_feval);
47 50
48/* Drop into the prom, with the chance to continue with the 'go' 51/* Drop into the prom, with the chance to continue with the 'go'
49 * prom command. 52 * prom command.
diff --git a/arch/sparc/prom/misc_64.c b/arch/sparc/prom/misc_64.c
index 9b0c0760901e..eedffb4fec2d 100644
--- a/arch/sparc/prom/misc_64.c
+++ b/arch/sparc/prom/misc_64.c
@@ -11,6 +11,8 @@
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/module.h>
15
14#include <asm/openprom.h> 16#include <asm/openprom.h>
15#include <asm/oplib.h> 17#include <asm/oplib.h>
16#include <asm/system.h> 18#include <asm/system.h>
@@ -54,6 +56,7 @@ void prom_feval(const char *fstring)
54 p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) | 56 p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) |
55 P1275_INOUT(1, 1), fstring); 57 P1275_INOUT(1, 1), fstring);
56} 58}
59EXPORT_SYMBOL(prom_feval);
57 60
58#ifdef CONFIG_SMP 61#ifdef CONFIG_SMP
59extern void smp_capture(void); 62extern void smp_capture(void);
diff --git a/arch/sparc/prom/ranges.c b/arch/sparc/prom/ranges.c
index 64579a376419..cd5790853ff6 100644
--- a/arch/sparc/prom/ranges.c
+++ b/arch/sparc/prom/ranges.c
@@ -6,6 +6,8 @@
6 */ 6 */
7 7
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/module.h>
10
9#include <asm/openprom.h> 11#include <asm/openprom.h>
10#include <asm/oplib.h> 12#include <asm/oplib.h>
11#include <asm/types.h> 13#include <asm/types.h>
@@ -62,6 +64,7 @@ prom_apply_obio_ranges(struct linux_prom_registers *regs, int nregs)
62 if(num_obio_ranges) 64 if(num_obio_ranges)
63 prom_adjust_regs(regs, nregs, promlib_obio_ranges, num_obio_ranges); 65 prom_adjust_regs(regs, nregs, promlib_obio_ranges, num_obio_ranges);
64} 66}
67EXPORT_SYMBOL(prom_apply_obio_ranges);
65 68
66void __init prom_ranges_init(void) 69void __init prom_ranges_init(void)
67{ 70{
diff --git a/arch/sparc/prom/tree_32.c b/arch/sparc/prom/tree_32.c
index 6d8187357331..646d244b1fdb 100644
--- a/arch/sparc/prom/tree_32.c
+++ b/arch/sparc/prom/tree_32.c
@@ -5,13 +5,12 @@
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */ 6 */
7 7
8#define PROMLIB_INTERNAL
9
10#include <linux/string.h> 8#include <linux/string.h>
11#include <linux/types.h> 9#include <linux/types.h>
12#include <linux/kernel.h> 10#include <linux/kernel.h>
13#include <linux/sched.h> 11#include <linux/sched.h>
14#include <linux/ctype.h> 12#include <linux/ctype.h>
13#include <linux/module.h>
15 14
16#include <asm/openprom.h> 15#include <asm/openprom.h>
17#include <asm/oplib.h> 16#include <asm/oplib.h>
@@ -50,6 +49,7 @@ int prom_getchild(int node)
50 49
51 return cnode; 50 return cnode;
52} 51}
52EXPORT_SYMBOL(prom_getchild);
53 53
54/* Internal version of prom_getsibling that does not alter return values. */ 54/* Internal version of prom_getsibling that does not alter return values. */
55int __prom_getsibling(int node) 55int __prom_getsibling(int node)
@@ -81,6 +81,7 @@ int prom_getsibling(int node)
81 81
82 return sibnode; 82 return sibnode;
83} 83}
84EXPORT_SYMBOL(prom_getsibling);
84 85
85/* Return the length in bytes of property 'prop' at node 'node'. 86/* Return the length in bytes of property 'prop' at node 'node'.
86 * Return -1 on error. 87 * Return -1 on error.
@@ -99,6 +100,7 @@ int prom_getproplen(int node, const char *prop)
99 spin_unlock_irqrestore(&prom_lock, flags); 100 spin_unlock_irqrestore(&prom_lock, flags);
100 return ret; 101 return ret;
101} 102}
103EXPORT_SYMBOL(prom_getproplen);
102 104
103/* Acquire a property 'prop' at node 'node' and place it in 105/* Acquire a property 'prop' at node 'node' and place it in
104 * 'buffer' which has a size of 'bufsize'. If the acquisition 106 * 'buffer' which has a size of 'bufsize'. If the acquisition
@@ -119,6 +121,7 @@ int prom_getproperty(int node, const char *prop, char *buffer, int bufsize)
119 spin_unlock_irqrestore(&prom_lock, flags); 121 spin_unlock_irqrestore(&prom_lock, flags);
120 return ret; 122 return ret;
121} 123}
124EXPORT_SYMBOL(prom_getproperty);
122 125
123/* Acquire an integer property and return its value. Returns -1 126/* Acquire an integer property and return its value. Returns -1
124 * on failure. 127 * on failure.
@@ -132,6 +135,7 @@ int prom_getint(int node, char *prop)
132 135
133 return -1; 136 return -1;
134} 137}
138EXPORT_SYMBOL(prom_getint);
135 139
136/* Acquire an integer property, upon error return the passed default 140/* Acquire an integer property, upon error return the passed default
137 * integer. 141 * integer.
@@ -145,6 +149,7 @@ int prom_getintdefault(int node, char *property, int deflt)
145 149
146 return retval; 150 return retval;
147} 151}
152EXPORT_SYMBOL(prom_getintdefault);
148 153
149/* Acquire a boolean property, 1=TRUE 0=FALSE. */ 154/* Acquire a boolean property, 1=TRUE 0=FALSE. */
150int prom_getbool(int node, char *prop) 155int prom_getbool(int node, char *prop)
@@ -155,6 +160,7 @@ int prom_getbool(int node, char *prop)
155 if(retval == -1) return 0; 160 if(retval == -1) return 0;
156 return 1; 161 return 1;
157} 162}
163EXPORT_SYMBOL(prom_getbool);
158 164
159/* Acquire a property whose value is a string, returns a null 165/* Acquire a property whose value is a string, returns a null
160 * string on error. The char pointer is the user supplied string 166 * string on error. The char pointer is the user supplied string
@@ -169,6 +175,7 @@ void prom_getstring(int node, char *prop, char *user_buf, int ubuf_size)
169 user_buf[0] = 0; 175 user_buf[0] = 0;
170 return; 176 return;
171} 177}
178EXPORT_SYMBOL(prom_getstring);
172 179
173 180
174/* Does the device at node 'node' have name 'name'? 181/* Does the device at node 'node' have name 'name'?
@@ -204,6 +211,7 @@ int prom_searchsiblings(int node_start, char *nodename)
204 211
205 return 0; 212 return 0;
206} 213}
214EXPORT_SYMBOL(prom_searchsiblings);
207 215
208/* Interal version of nextprop that does not alter return values. */ 216/* Interal version of nextprop that does not alter return values. */
209char * __prom_nextprop(int node, char * oprop) 217char * __prom_nextprop(int node, char * oprop)
@@ -228,6 +236,7 @@ char * prom_firstprop(int node, char *bufer)
228 236
229 return __prom_nextprop(node, ""); 237 return __prom_nextprop(node, "");
230} 238}
239EXPORT_SYMBOL(prom_firstprop);
231 240
232/* Return the property type string after property type 'oprop' 241/* Return the property type string after property type 'oprop'
233 * at node 'node' . Returns empty string if no more 242 * at node 'node' . Returns empty string if no more
@@ -240,6 +249,7 @@ char * prom_nextprop(int node, char *oprop, char *buffer)
240 249
241 return __prom_nextprop(node, oprop); 250 return __prom_nextprop(node, oprop);
242} 251}
252EXPORT_SYMBOL(prom_nextprop);
243 253
244int prom_finddevice(char *name) 254int prom_finddevice(char *name)
245{ 255{
@@ -287,6 +297,7 @@ int prom_finddevice(char *name)
287 } 297 }
288 return node; 298 return node;
289} 299}
300EXPORT_SYMBOL(prom_finddevice);
290 301
291int prom_node_has_property(int node, char *prop) 302int prom_node_has_property(int node, char *prop)
292{ 303{
@@ -299,6 +310,7 @@ int prom_node_has_property(int node, char *prop)
299 } while (*current_property); 310 } while (*current_property);
300 return 0; 311 return 0;
301} 312}
313EXPORT_SYMBOL(prom_node_has_property);
302 314
303/* Set property 'pname' at node 'node' to value 'value' which has a length 315/* Set property 'pname' at node 'node' to value 'value' which has a length
304 * of 'size' bytes. Return the number of bytes the prom accepted. 316 * of 'size' bytes. Return the number of bytes the prom accepted.
@@ -316,6 +328,7 @@ int prom_setprop(int node, const char *pname, char *value, int size)
316 spin_unlock_irqrestore(&prom_lock, flags); 328 spin_unlock_irqrestore(&prom_lock, flags);
317 return ret; 329 return ret;
318} 330}
331EXPORT_SYMBOL(prom_setprop);
319 332
320int prom_inst2pkg(int inst) 333int prom_inst2pkg(int inst)
321{ 334{
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 281aea44790b..8ea73ddc61dc 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -10,6 +10,7 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/module.h>
13 14
14#include <asm/openprom.h> 15#include <asm/openprom.h>
15#include <asm/oplib.h> 16#include <asm/oplib.h>
@@ -32,6 +33,7 @@ inline int prom_getchild(int node)
32 if(cnode == -1) return 0; 33 if(cnode == -1) return 0;
33 return (int)cnode; 34 return (int)cnode;
34} 35}
36EXPORT_SYMBOL(prom_getchild);
35 37
36inline int prom_getparent(int node) 38inline int prom_getparent(int node)
37{ 39{
@@ -63,6 +65,7 @@ inline int prom_getsibling(int node)
63 65
64 return sibnode; 66 return sibnode;
65} 67}
68EXPORT_SYMBOL(prom_getsibling);
66 69
67/* Return the length in bytes of property 'prop' at node 'node'. 70/* Return the length in bytes of property 'prop' at node 'node'.
68 * Return -1 on error. 71 * Return -1 on error.
@@ -75,6 +78,7 @@ inline int prom_getproplen(int node, const char *prop)
75 P1275_INOUT(2, 1), 78 P1275_INOUT(2, 1),
76 node, prop); 79 node, prop);
77} 80}
81EXPORT_SYMBOL(prom_getproplen);
78 82
79/* Acquire a property 'prop' at node 'node' and place it in 83/* Acquire a property 'prop' at node 'node' and place it in
80 * 'buffer' which has a size of 'bufsize'. If the acquisition 84 * 'buffer' which has a size of 'bufsize'. If the acquisition
@@ -97,6 +101,7 @@ inline int prom_getproperty(int node, const char *prop,
97 node, prop, buffer, P1275_SIZE(plen)); 101 node, prop, buffer, P1275_SIZE(plen));
98 } 102 }
99} 103}
104EXPORT_SYMBOL(prom_getproperty);
100 105
101/* Acquire an integer property and return its value. Returns -1 106/* Acquire an integer property and return its value. Returns -1
102 * on failure. 107 * on failure.
@@ -110,6 +115,7 @@ inline int prom_getint(int node, const char *prop)
110 115
111 return -1; 116 return -1;
112} 117}
118EXPORT_SYMBOL(prom_getint);
113 119
114/* Acquire an integer property, upon error return the passed default 120/* Acquire an integer property, upon error return the passed default
115 * integer. 121 * integer.
@@ -124,6 +130,7 @@ int prom_getintdefault(int node, const char *property, int deflt)
124 130
125 return retval; 131 return retval;
126} 132}
133EXPORT_SYMBOL(prom_getintdefault);
127 134
128/* Acquire a boolean property, 1=TRUE 0=FALSE. */ 135/* Acquire a boolean property, 1=TRUE 0=FALSE. */
129int prom_getbool(int node, const char *prop) 136int prom_getbool(int node, const char *prop)
@@ -134,6 +141,7 @@ int prom_getbool(int node, const char *prop)
134 if(retval == -1) return 0; 141 if(retval == -1) return 0;
135 return 1; 142 return 1;
136} 143}
144EXPORT_SYMBOL(prom_getbool);
137 145
138/* Acquire a property whose value is a string, returns a null 146/* Acquire a property whose value is a string, returns a null
139 * string on error. The char pointer is the user supplied string 147 * string on error. The char pointer is the user supplied string
@@ -148,7 +156,7 @@ void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size)
148 user_buf[0] = 0; 156 user_buf[0] = 0;
149 return; 157 return;
150} 158}
151 159EXPORT_SYMBOL(prom_getstring);
152 160
153/* Does the device at node 'node' have name 'name'? 161/* Does the device at node 'node' have name 'name'?
154 * YES = 1 NO = 0 162 * YES = 1 NO = 0
@@ -181,6 +189,7 @@ int prom_searchsiblings(int node_start, const char *nodename)
181 189
182 return 0; 190 return 0;
183} 191}
192EXPORT_SYMBOL(prom_searchsiblings);
184 193
185/* Return the first property type for node 'node'. 194/* Return the first property type for node 'node'.
186 * buffer should be at least 32B in length 195 * buffer should be at least 32B in length
@@ -194,6 +203,7 @@ inline char *prom_firstprop(int node, char *buffer)
194 node, (char *) 0x0, buffer); 203 node, (char *) 0x0, buffer);
195 return buffer; 204 return buffer;
196} 205}
206EXPORT_SYMBOL(prom_firstprop);
197 207
198/* Return the property type string after property type 'oprop' 208/* Return the property type string after property type 'oprop'
199 * at node 'node' . Returns NULL string if no more 209 * at node 'node' . Returns NULL string if no more
@@ -217,6 +227,7 @@ inline char *prom_nextprop(int node, const char *oprop, char *buffer)
217 node, oprop, buffer); 227 node, oprop, buffer);
218 return buffer; 228 return buffer;
219} 229}
230EXPORT_SYMBOL(prom_nextprop);
220 231
221int 232int
222prom_finddevice(const char *name) 233prom_finddevice(const char *name)
@@ -228,6 +239,7 @@ prom_finddevice(const char *name)
228 P1275_INOUT(1, 1), 239 P1275_INOUT(1, 1),
229 name); 240 name);
230} 241}
242EXPORT_SYMBOL(prom_finddevice);
231 243
232int prom_node_has_property(int node, const char *prop) 244int prom_node_has_property(int node, const char *prop)
233{ 245{
@@ -241,7 +253,8 @@ int prom_node_has_property(int node, const char *prop)
241 } while (*buf); 253 } while (*buf);
242 return 0; 254 return 0;
243} 255}
244 256EXPORT_SYMBOL(prom_node_has_property);
257
245/* Set property 'pname' at node 'node' to value 'value' which has a length 258/* Set property 'pname' at node 'node' to value 'value' which has a length
246 * of 'size' bytes. Return the number of bytes the prom accepted. 259 * of 'size' bytes. Return the number of bytes the prom accepted.
247 */ 260 */
@@ -264,6 +277,7 @@ prom_setprop(int node, const char *pname, char *value, int size)
264 P1275_INOUT(4, 1), 277 P1275_INOUT(4, 1),
265 node, pname, value, P1275_SIZE(size)); 278 node, pname, value, P1275_SIZE(size));
266} 279}
280EXPORT_SYMBOL(prom_setprop);
267 281
268inline int prom_inst2pkg(int inst) 282inline int prom_inst2pkg(int inst)
269{ 283{