aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-08-15 14:11:45 -0400
committerSage Weil <sage@inktank.com>2013-08-15 14:11:45 -0400
commitee3e542fec6e69bc9fb668698889a37d93950ddf (patch)
treee74ee766a4764769ef1d3d45d266b4dea64101d3 /arch/parisc
parentfe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff)
parentf1d6e17f540af37bb1891480143669ba7636c4cf (diff)
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/Kconfig2
-rw-r--r--arch/parisc/Kconfig.debug11
-rw-r--r--arch/parisc/Makefile15
-rw-r--r--arch/parisc/configs/c8000_defconfig279
-rw-r--r--arch/parisc/defpalo.conf8
-rw-r--r--arch/parisc/hpux/fs.c16
-rw-r--r--arch/parisc/include/asm/parisc-device.h3
-rw-r--r--arch/parisc/include/asm/pgtable.h3
-rw-r--r--arch/parisc/include/asm/special_insns.h9
-rw-r--r--arch/parisc/include/asm/tlbflush.h5
-rw-r--r--arch/parisc/include/uapi/asm/fcntl.h1
-rw-r--r--arch/parisc/include/uapi/asm/socket.h2
-rw-r--r--arch/parisc/install.sh6
-rw-r--r--arch/parisc/kernel/cache.c137
-rw-r--r--arch/parisc/kernel/firmware.c14
-rw-r--r--arch/parisc/kernel/hardware.c2
-rw-r--r--arch/parisc/kernel/inventory.c1
-rw-r--r--arch/parisc/kernel/processor.c25
-rw-r--r--arch/parisc/kernel/setup.c2
-rw-r--r--arch/parisc/kernel/signal.c7
-rw-r--r--arch/parisc/kernel/signal32.c1
-rw-r--r--arch/parisc/kernel/smp.c8
-rw-r--r--arch/parisc/kernel/sys32.h36
-rw-r--r--arch/parisc/kernel/sys_parisc32.c2
-rw-r--r--arch/parisc/lib/memcpy.c79
-rw-r--r--arch/parisc/mm/init.c60
26 files changed, 482 insertions, 252 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 6507dabdd5dd..aa399a5259b6 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -27,6 +27,7 @@ config PARISC
27 select MODULES_USE_ELF_RELA 27 select MODULES_USE_ELF_RELA
28 select CLONE_BACKWARDS 28 select CLONE_BACKWARDS
29 select TTY # Needed for pdc_cons.c 29 select TTY # Needed for pdc_cons.c
30 select HAVE_DEBUG_STACKOVERFLOW
30 31
31 help 32 help
32 The PA-RISC microprocessor is designed by Hewlett-Packard and used 33 The PA-RISC microprocessor is designed by Hewlett-Packard and used
@@ -254,7 +255,6 @@ config IRQSTACKS
254config HOTPLUG_CPU 255config HOTPLUG_CPU
255 bool 256 bool
256 default y if SMP 257 default y if SMP
257 select HOTPLUG
258 258
259config ARCH_SELECT_MEMORY_MODEL 259config ARCH_SELECT_MEMORY_MODEL
260 def_bool y 260 def_bool y
diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug
index 08a332f6ee87..bc989e522a04 100644
--- a/arch/parisc/Kconfig.debug
+++ b/arch/parisc/Kconfig.debug
@@ -13,14 +13,3 @@ config DEBUG_RODATA
13 If in doubt, say "N". 13 If in doubt, say "N".
14 14
15endmenu 15endmenu
16
17config DEBUG_STACKOVERFLOW
18 bool "Check for stack overflows"
19 default y
20 depends on DEBUG_KERNEL
21 ---help---
22 Say Y here if you want to check the overflows of kernel, IRQ
23 and exception stacks. This option will cause messages of the
24 stacks in detail when free stack space drops below a certain
25 limit.
26 If in doubt, say "N".
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 96ec3982be8d..e02f665f804a 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -17,6 +17,8 @@
17# Mike Shaver, Helge Deller and Martin K. Petersen 17# Mike Shaver, Helge Deller and Martin K. Petersen
18# 18#
19 19
20KBUILD_IMAGE := vmlinuz
21
20KBUILD_DEFCONFIG := default_defconfig 22KBUILD_DEFCONFIG := default_defconfig
21 23
22NM = sh $(srctree)/arch/parisc/nm 24NM = sh $(srctree)/arch/parisc/nm
@@ -92,7 +94,7 @@ PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
92 else echo $(obj)/palo.conf; \ 94 else echo $(obj)/palo.conf; \
93 fi) 95 fi)
94 96
95palo: vmlinux 97palo: vmlinuz
96 @if test ! -x "$(PALO)"; then \ 98 @if test ! -x "$(PALO)"; then \
97 echo 'ERROR: Please install palo first (apt-get install palo)';\ 99 echo 'ERROR: Please install palo first (apt-get install palo)';\
98 echo 'or build it from source and install it somewhere in your $$PATH';\ 100 echo 'or build it from source and install it somewhere in your $$PATH';\
@@ -107,10 +109,14 @@ palo: vmlinux
107 fi 109 fi
108 $(PALO) -f $(PALOCONF) 110 $(PALO) -f $(PALOCONF)
109 111
110# Shorthands for known targets not supported by parisc, use vmlinux as default 112# Shorthands for known targets not supported by parisc, use vmlinux/vmlinuz as default
111Image zImage bzImage: vmlinux 113Image: vmlinux
114zImage bzImage: vmlinuz
115
116vmlinuz: vmlinux
117 @gzip -cf -9 $< > $@
112 118
113install: vmlinux 119install: vmlinuz
114 sh $(src)/arch/parisc/install.sh \ 120 sh $(src)/arch/parisc/install.sh \
115 $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" 121 $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
116 122
@@ -119,6 +125,7 @@ MRPROPER_FILES += palo.conf
119 125
120define archhelp 126define archhelp
121 @echo '* vmlinux - Uncompressed kernel image (./vmlinux)' 127 @echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
128 @echo ' vmlinuz - Compressed kernel image (./vmlinuz)'
122 @echo ' palo - Bootable image (./lifimage)' 129 @echo ' palo - Bootable image (./lifimage)'
123 @echo ' install - Install kernel using' 130 @echo ' install - Install kernel using'
124 @echo ' (your) ~/bin/$(INSTALLKERNEL) or' 131 @echo ' (your) ~/bin/$(INSTALLKERNEL) or'
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig
new file mode 100644
index 000000000000..f11006361297
--- /dev/null
+++ b/arch/parisc/configs/c8000_defconfig
@@ -0,0 +1,279 @@
1# CONFIG_LOCALVERSION_AUTO is not set
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_FHANDLE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_IKCONFIG=y
8CONFIG_IKCONFIG_PROC=y
9CONFIG_RELAY=y
10CONFIG_BLK_DEV_INITRD=y
11CONFIG_RD_BZIP2=y
12CONFIG_RD_LZMA=y
13CONFIG_RD_LZO=y
14CONFIG_EXPERT=y
15CONFIG_SYSCTL_SYSCALL=y
16CONFIG_SLAB=y
17CONFIG_MODULES=y
18CONFIG_MODULE_UNLOAD=y
19CONFIG_MODULE_FORCE_UNLOAD=y
20CONFIG_MODVERSIONS=y
21CONFIG_BLK_DEV_INTEGRITY=y
22CONFIG_PA8X00=y
23CONFIG_MLONGCALLS=y
24CONFIG_64BIT=y
25CONFIG_SMP=y
26CONFIG_PREEMPT=y
27# CONFIG_CROSS_MEMORY_ATTACH is not set
28CONFIG_IOMMU_CCIO=y
29CONFIG_PCI=y
30CONFIG_PCI_LBA=y
31# CONFIG_SUPERIO is not set
32# CONFIG_CHASSIS_LCD_LED is not set
33# CONFIG_PDC_CHASSIS is not set
34# CONFIG_PDC_CHASSIS_WARN is not set
35# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
36CONFIG_BINFMT_MISC=m
37CONFIG_PACKET=y
38CONFIG_UNIX=y
39CONFIG_XFRM_USER=m
40CONFIG_XFRM_SUB_POLICY=y
41CONFIG_NET_KEY=m
42CONFIG_INET=y
43CONFIG_IP_MULTICAST=y
44CONFIG_IP_PNP=y
45CONFIG_IP_PNP_DHCP=y
46CONFIG_IP_PNP_BOOTP=y
47CONFIG_IP_PNP_RARP=y
48CONFIG_NET_IPIP=m
49CONFIG_IP_MROUTE=y
50CONFIG_IP_PIMSM_V1=y
51CONFIG_IP_PIMSM_V2=y
52CONFIG_SYN_COOKIES=y
53CONFIG_INET_AH=m
54CONFIG_INET_ESP=m
55CONFIG_INET_IPCOMP=m
56CONFIG_INET_XFRM_MODE_BEET=m
57CONFIG_INET_DIAG=m
58# CONFIG_IPV6 is not set
59CONFIG_IP_DCCP=m
60# CONFIG_IP_DCCP_CCID3 is not set
61CONFIG_TIPC=m
62CONFIG_LLC2=m
63CONFIG_DNS_RESOLVER=y
64CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
65# CONFIG_STANDALONE is not set
66CONFIG_PARPORT=y
67CONFIG_PARPORT_PC=y
68CONFIG_PARPORT_PC_FIFO=y
69CONFIG_BLK_DEV_UMEM=m
70CONFIG_BLK_DEV_LOOP=m
71CONFIG_BLK_DEV_CRYPTOLOOP=m
72CONFIG_BLK_DEV_SX8=m
73CONFIG_BLK_DEV_RAM=y
74CONFIG_BLK_DEV_RAM_SIZE=6144
75CONFIG_CDROM_PKTCDVD=m
76CONFIG_CDROM_PKTCDVD_WCACHE=y
77CONFIG_ATA_OVER_ETH=m
78CONFIG_IDE=y
79CONFIG_BLK_DEV_IDECD=y
80CONFIG_BLK_DEV_PLATFORM=y
81CONFIG_BLK_DEV_GENERIC=y
82CONFIG_BLK_DEV_SIIMAGE=y
83CONFIG_SCSI=y
84CONFIG_BLK_DEV_SD=y
85CONFIG_CHR_DEV_ST=m
86CONFIG_BLK_DEV_SR=m
87CONFIG_CHR_DEV_SG=y
88CONFIG_CHR_DEV_SCH=m
89CONFIG_SCSI_CONSTANTS=y
90CONFIG_SCSI_LOGGING=y
91CONFIG_SCSI_FC_ATTRS=y
92CONFIG_SCSI_SAS_LIBSAS=m
93CONFIG_ISCSI_TCP=m
94CONFIG_ISCSI_BOOT_SYSFS=m
95CONFIG_FUSION=y
96CONFIG_FUSION_SPI=y
97CONFIG_FUSION_SAS=y
98CONFIG_NETDEVICES=y
99CONFIG_DUMMY=m
100CONFIG_NETCONSOLE=m
101CONFIG_TUN=y
102CONFIG_E1000=y
103CONFIG_PPP=m
104CONFIG_PPP_BSDCOMP=m
105CONFIG_PPP_DEFLATE=m
106CONFIG_PPP_MPPE=m
107CONFIG_PPPOE=m
108CONFIG_PPP_ASYNC=m
109CONFIG_PPP_SYNC_TTY=m
110# CONFIG_WLAN is not set
111CONFIG_INPUT_FF_MEMLESS=m
112# CONFIG_KEYBOARD_ATKBD is not set
113# CONFIG_KEYBOARD_HIL_OLD is not set
114# CONFIG_KEYBOARD_HIL is not set
115CONFIG_MOUSE_PS2=m
116CONFIG_INPUT_MISC=y
117CONFIG_INPUT_CM109=m
118CONFIG_SERIO_SERPORT=m
119CONFIG_SERIO_PARKBD=m
120CONFIG_SERIO_GSCPS2=m
121# CONFIG_HP_SDC is not set
122CONFIG_SERIO_PCIPS2=m
123CONFIG_SERIO_LIBPS2=y
124CONFIG_SERIO_RAW=m
125CONFIG_SERIAL_8250=y
126# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
127CONFIG_SERIAL_8250_CONSOLE=y
128CONFIG_SERIAL_8250_NR_UARTS=8
129CONFIG_SERIAL_8250_RUNTIME_UARTS=8
130CONFIG_SERIAL_8250_EXTENDED=y
131# CONFIG_SERIAL_MUX is not set
132CONFIG_SERIAL_JSM=m
133CONFIG_PRINTER=y
134CONFIG_HW_RANDOM=y
135CONFIG_RAW_DRIVER=m
136CONFIG_PTP_1588_CLOCK=y
137CONFIG_SSB=m
138CONFIG_SSB_DRIVER_PCICORE=y
139CONFIG_AGP=y
140CONFIG_AGP_PARISC=y
141CONFIG_DRM=y
142CONFIG_DRM_RADEON=y
143CONFIG_FIRMWARE_EDID=y
144CONFIG_FB_FOREIGN_ENDIAN=y
145CONFIG_FB_MODE_HELPERS=y
146CONFIG_FB_TILEBLITTING=y
147# CONFIG_FB_STI is not set
148CONFIG_BACKLIGHT_LCD_SUPPORT=y
149# CONFIG_LCD_CLASS_DEVICE is not set
150# CONFIG_BACKLIGHT_GENERIC is not set
151CONFIG_FRAMEBUFFER_CONSOLE=y
152# CONFIG_STI_CONSOLE is not set
153CONFIG_LOGO=y
154# CONFIG_LOGO_LINUX_MONO is not set
155# CONFIG_LOGO_LINUX_VGA16 is not set
156# CONFIG_LOGO_LINUX_CLUT224 is not set
157CONFIG_SOUND=m
158CONFIG_SND=m
159CONFIG_SND_SEQUENCER=m
160CONFIG_SND_SEQ_DUMMY=m
161CONFIG_SND_MIXER_OSS=m
162CONFIG_SND_PCM_OSS=m
163CONFIG_SND_SEQUENCER_OSS=y
164CONFIG_SND_VERBOSE_PRINTK=y
165CONFIG_SND_AD1889=m
166# CONFIG_SND_USB is not set
167# CONFIG_SND_GSC is not set
168CONFIG_HID_A4TECH=m
169CONFIG_HID_APPLE=m
170CONFIG_HID_BELKIN=m
171CONFIG_HID_CHERRY=m
172CONFIG_HID_CHICONY=m
173CONFIG_HID_CYPRESS=m
174CONFIG_HID_DRAGONRISE=m
175CONFIG_HID_EZKEY=m
176CONFIG_HID_KYE=m
177CONFIG_HID_GYRATION=m
178CONFIG_HID_TWINHAN=m
179CONFIG_HID_KENSINGTON=m
180CONFIG_HID_LOGITECH=m
181CONFIG_HID_LOGITECH_DJ=m
182CONFIG_HID_MICROSOFT=m
183CONFIG_HID_MONTEREY=m
184CONFIG_HID_NTRIG=m
185CONFIG_HID_ORTEK=m
186CONFIG_HID_PANTHERLORD=m
187CONFIG_HID_PETALYNX=m
188CONFIG_HID_SAMSUNG=m
189CONFIG_HID_SUNPLUS=m
190CONFIG_HID_GREENASIA=m
191CONFIG_HID_SMARTJOYPLUS=m
192CONFIG_HID_TOPSEED=m
193CONFIG_HID_THRUSTMASTER=m
194CONFIG_HID_ZEROPLUS=m
195CONFIG_USB_HID=m
196CONFIG_USB=y
197CONFIG_USB_OHCI_HCD=y
198CONFIG_USB_STORAGE=y
199CONFIG_EXT2_FS=y
200CONFIG_EXT2_FS_XATTR=y
201CONFIG_EXT2_FS_POSIX_ACL=y
202CONFIG_EXT2_FS_SECURITY=y
203CONFIG_EXT3_FS=y
204# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
205CONFIG_EXT4_FS=m
206CONFIG_REISERFS_FS=m
207CONFIG_REISERFS_PROC_INFO=y
208CONFIG_XFS_FS=m
209CONFIG_XFS_POSIX_ACL=y
210CONFIG_QUOTA=y
211CONFIG_QFMT_V1=m
212CONFIG_QFMT_V2=m
213CONFIG_AUTOFS4_FS=m
214CONFIG_FUSE_FS=m
215CONFIG_ISO9660_FS=y
216CONFIG_JOLIET=y
217CONFIG_MSDOS_FS=m
218CONFIG_VFAT_FS=m
219CONFIG_PROC_KCORE=y
220CONFIG_TMPFS=y
221CONFIG_TMPFS_XATTR=y
222CONFIG_NFS_FS=m
223CONFIG_NLS_CODEPAGE_437=m
224CONFIG_NLS_CODEPAGE_737=m
225CONFIG_NLS_CODEPAGE_775=m
226CONFIG_NLS_CODEPAGE_850=m
227CONFIG_NLS_CODEPAGE_852=m
228CONFIG_NLS_CODEPAGE_855=m
229CONFIG_NLS_CODEPAGE_857=m
230CONFIG_NLS_CODEPAGE_860=m
231CONFIG_NLS_CODEPAGE_861=m
232CONFIG_NLS_CODEPAGE_862=m
233CONFIG_NLS_CODEPAGE_863=m
234CONFIG_NLS_CODEPAGE_864=m
235CONFIG_NLS_CODEPAGE_865=m
236CONFIG_NLS_CODEPAGE_866=m
237CONFIG_NLS_CODEPAGE_869=m
238CONFIG_NLS_CODEPAGE_936=m
239CONFIG_NLS_CODEPAGE_950=m
240CONFIG_NLS_CODEPAGE_932=m
241CONFIG_NLS_CODEPAGE_949=m
242CONFIG_NLS_CODEPAGE_874=m
243CONFIG_NLS_ISO8859_8=m
244CONFIG_NLS_CODEPAGE_1250=m
245CONFIG_NLS_CODEPAGE_1251=m
246CONFIG_NLS_ASCII=m
247CONFIG_NLS_ISO8859_1=m
248CONFIG_NLS_ISO8859_2=m
249CONFIG_NLS_ISO8859_3=m
250CONFIG_NLS_ISO8859_4=m
251CONFIG_NLS_ISO8859_5=m
252CONFIG_NLS_ISO8859_6=m
253CONFIG_NLS_ISO8859_7=m
254CONFIG_NLS_ISO8859_9=m
255CONFIG_NLS_ISO8859_13=m
256CONFIG_NLS_ISO8859_14=m
257CONFIG_NLS_ISO8859_15=m
258CONFIG_NLS_KOI8_R=m
259CONFIG_NLS_KOI8_U=m
260CONFIG_NLS_UTF8=m
261CONFIG_UNUSED_SYMBOLS=y
262CONFIG_DEBUG_FS=y
263CONFIG_MAGIC_SYSRQ=y
264CONFIG_DEBUG_SLAB=y
265CONFIG_DEBUG_SLAB_LEAK=y
266CONFIG_DEBUG_MEMORY_INIT=y
267CONFIG_DEBUG_STACKOVERFLOW=y
268CONFIG_LOCKUP_DETECTOR=y
269CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
270CONFIG_PANIC_ON_OOPS=y
271CONFIG_DEBUG_RT_MUTEXES=y
272CONFIG_RT_MUTEX_TESTER=y
273CONFIG_PROVE_RCU_DELAY=y
274CONFIG_DEBUG_BLOCK_EXT_DEVT=y
275CONFIG_LATENCYTOP=y
276CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
277CONFIG_KEYS=y
278# CONFIG_CRYPTO_HW is not set
279CONFIG_FONTS=y
diff --git a/arch/parisc/defpalo.conf b/arch/parisc/defpalo.conf
index 4e1ae25b08d1..208ff3b41487 100644
--- a/arch/parisc/defpalo.conf
+++ b/arch/parisc/defpalo.conf
@@ -4,7 +4,7 @@
4# Most people using 'make palo' want a bootable file, usable for 4# Most people using 'make palo' want a bootable file, usable for
5# network or tape booting for example. 5# network or tape booting for example.
6--init-tape=lifimage 6--init-tape=lifimage
7--recoverykernel=vmlinux 7--recoverykernel=vmlinuz
8 8
9########## Pick your ROOT here! ########## 9########## Pick your ROOT here! ##########
10# You need at least one 'root='! 10# You need at least one 'root='!
@@ -12,10 +12,10 @@
12# If you want a root ramdisk, use the next 2 lines 12# If you want a root ramdisk, use the next 2 lines
13# (Edit the ramdisk image name!!!!) 13# (Edit the ramdisk image name!!!!)
14--ramdisk=ram-disk-image-file 14--ramdisk=ram-disk-image-file
15--commandline=0/vmlinux HOME=/ root=/dev/ram initrd=0/ramdisk 15--commandline=0/vmlinuz HOME=/ root=/dev/ram initrd=0/ramdisk panic_timeout=60 panic=-1
16 16
17# If you want NFS root, use the following command line (Edit the HOSTNAME!!!) 17# If you want NFS root, use the following command line (Edit the HOSTNAME!!!)
18#--commandline=0/vmlinux HOME=/ root=/dev/nfs nfsroot=HOSTNAME ip=bootp 18#--commandline=0/vmlinuz HOME=/ root=/dev/nfs nfsroot=HOSTNAME ip=bootp
19 19
20# If you have root on a disk partition, use this (Edit the partition name!!!) 20# If you have root on a disk partition, use this (Edit the partition name!!!)
21#--commandline=0/vmlinux HOME=/ root=/dev/sda1 21#--commandline=0/vmlinuz HOME=/ root=/dev/sda1
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c
index 838b479a42c4..88d0962de65a 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -60,6 +60,7 @@ struct hpux_dirent {
60}; 60};
61 61
62struct getdents_callback { 62struct getdents_callback {
63 struct dir_context ctx;
63 struct hpux_dirent __user *current_dir; 64 struct hpux_dirent __user *current_dir;
64 struct hpux_dirent __user *previous; 65 struct hpux_dirent __user *previous;
65 int count; 66 int count;
@@ -110,24 +111,23 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned i
110{ 111{
111 struct fd arg; 112 struct fd arg;
112 struct hpux_dirent __user * lastdirent; 113 struct hpux_dirent __user * lastdirent;
113 struct getdents_callback buf; 114 struct getdents_callback buf = {
115 .ctx.actor = filldir,
116 .current_dir = dirent,
117 .count = count
118 };
114 int error; 119 int error;
115 120
116 arg = fdget(fd); 121 arg = fdget(fd);
117 if (!arg.file) 122 if (!arg.file)
118 return -EBADF; 123 return -EBADF;
119 124
120 buf.current_dir = dirent; 125 error = iterate_dir(arg.file, &buf.ctx);
121 buf.previous = NULL;
122 buf.count = count;
123 buf.error = 0;
124
125 error = vfs_readdir(arg.file, filldir, &buf);
126 if (error >= 0) 126 if (error >= 0)
127 error = buf.error; 127 error = buf.error;
128 lastdirent = buf.previous; 128 lastdirent = buf.previous;
129 if (lastdirent) { 129 if (lastdirent) {
130 if (put_user(arg.file->f_pos, &lastdirent->d_off)) 130 if (put_user(buf.ctx.pos, &lastdirent->d_off))
131 error = -EFAULT; 131 error = -EFAULT;
132 else 132 else
133 error = count - buf.count; 133 error = count - buf.count;
diff --git a/arch/parisc/include/asm/parisc-device.h b/arch/parisc/include/asm/parisc-device.h
index 9afdad6c2ffb..eaf4dc1c7294 100644
--- a/arch/parisc/include/asm/parisc-device.h
+++ b/arch/parisc/include/asm/parisc-device.h
@@ -23,6 +23,7 @@ struct parisc_device {
23 /* generic info returned from pdc_pat_cell_module() */ 23 /* generic info returned from pdc_pat_cell_module() */
24 unsigned long mod_info; /* PAT specific - Misc Module info */ 24 unsigned long mod_info; /* PAT specific - Misc Module info */
25 unsigned long pmod_loc; /* physical Module location */ 25 unsigned long pmod_loc; /* physical Module location */
26 unsigned long mod0;
26#endif 27#endif
27 u64 dma_mask; /* DMA mask for I/O */ 28 u64 dma_mask; /* DMA mask for I/O */
28 struct device dev; 29 struct device dev;
@@ -61,4 +62,6 @@ parisc_get_drvdata(struct parisc_device *d)
61 62
62extern struct bus_type parisc_bus_type; 63extern struct bus_type parisc_bus_type;
63 64
65int iosapic_serial_irq(struct parisc_device *dev);
66
64#endif /*_ASM_PARISC_PARISC_DEVICE_H_*/ 67#endif /*_ASM_PARISC_PARISC_DEVICE_H_*/
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 1e40d7f86be3..34899b5d959a 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -506,9 +506,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
506#endif 506#endif
507 507
508 508
509#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
510 remap_pfn_range(vma, vaddr, pfn, size, prot)
511
512#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE) 509#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE)
513 510
514/* We provide our own get_unmapped_area to provide cache coherency */ 511/* We provide our own get_unmapped_area to provide cache coherency */
diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h
index d306b75bc77f..e1509308899f 100644
--- a/arch/parisc/include/asm/special_insns.h
+++ b/arch/parisc/include/asm/special_insns.h
@@ -32,9 +32,12 @@ static inline void set_eiem(unsigned long val)
32 cr; \ 32 cr; \
33}) 33})
34 34
35#define mtsp(gr, cr) \ 35#define mtsp(val, cr) \
36 __asm__ __volatile__("mtsp %0,%1" \ 36 { if (__builtin_constant_p(val) && ((val) == 0)) \
37 __asm__ __volatile__("mtsp %%r0,%0" : : "i" (cr) : "memory"); \
38 else \
39 __asm__ __volatile__("mtsp %0,%1" \
37 : /* no outputs */ \ 40 : /* no outputs */ \
38 : "r" (gr), "i" (cr) : "memory") 41 : "r" (val), "i" (cr) : "memory"); }
39 42
40#endif /* __PARISC_SPECIAL_INSNS_H */ 43#endif /* __PARISC_SPECIAL_INSNS_H */
diff --git a/arch/parisc/include/asm/tlbflush.h b/arch/parisc/include/asm/tlbflush.h
index 5273da991e06..9d086a599fa0 100644
--- a/arch/parisc/include/asm/tlbflush.h
+++ b/arch/parisc/include/asm/tlbflush.h
@@ -63,13 +63,14 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
63static inline void flush_tlb_page(struct vm_area_struct *vma, 63static inline void flush_tlb_page(struct vm_area_struct *vma,
64 unsigned long addr) 64 unsigned long addr)
65{ 65{
66 unsigned long flags; 66 unsigned long flags, sid;
67 67
68 /* For one page, it's not worth testing the split_tlb variable */ 68 /* For one page, it's not worth testing the split_tlb variable */
69 69
70 mb(); 70 mb();
71 mtsp(vma->vm_mm->context,1); 71 sid = vma->vm_mm->context;
72 purge_tlb_start(flags); 72 purge_tlb_start(flags);
73 mtsp(sid, 1);
73 pdtlb(addr); 74 pdtlb(addr);
74 pitlb(addr); 75 pitlb(addr);
75 purge_tlb_end(flags); 76 purge_tlb_end(flags);
diff --git a/arch/parisc/include/uapi/asm/fcntl.h b/arch/parisc/include/uapi/asm/fcntl.h
index 0304b92ccfea..34a46cbc76ed 100644
--- a/arch/parisc/include/uapi/asm/fcntl.h
+++ b/arch/parisc/include/uapi/asm/fcntl.h
@@ -20,6 +20,7 @@
20#define O_INVISIBLE 004000000 /* invisible I/O, for DMAPI/XDSM */ 20#define O_INVISIBLE 004000000 /* invisible I/O, for DMAPI/XDSM */
21 21
22#define O_PATH 020000000 22#define O_PATH 020000000
23#define __O_TMPFILE 040000000
23 24
24#define F_GETLK64 8 25#define F_GETLK64 8
25#define F_SETLK64 9 26#define F_SETLK64 9
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index 70c512a386f7..71700e636a8e 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -73,6 +73,8 @@
73 73
74#define SO_SELECT_ERR_QUEUE 0x4026 74#define SO_SELECT_ERR_QUEUE 0x4026
75 75
76#define SO_BUSY_POLL 0x4027
77
76/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 78/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
77 * have to define SOCK_NONBLOCK to a different value here. 79 * have to define SOCK_NONBLOCK to a different value here.
78 */ 80 */
diff --git a/arch/parisc/install.sh b/arch/parisc/install.sh
index e593fc8d58bc..4da682b466d0 100644
--- a/arch/parisc/install.sh
+++ b/arch/parisc/install.sh
@@ -26,13 +26,13 @@ if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
26 26
27# Default install 27# Default install
28 28
29if [ -f $4/vmlinux ]; then 29if [ -f $4/vmlinuz ]; then
30 mv $4/vmlinux $4/vmlinux.old 30 mv $4/vmlinuz $4/vmlinuz.old
31fi 31fi
32 32
33if [ -f $4/System.map ]; then 33if [ -f $4/System.map ]; then
34 mv $4/System.map $4/System.old 34 mv $4/System.map $4/System.old
35fi 35fi
36 36
37cat $2 > $4/vmlinux 37cat $2 > $4/vmlinuz
38cp $3 $4/System.map 38cp $3 $4/System.map
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 65fb4cbc3a0f..c035673209f7 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -71,18 +71,27 @@ flush_cache_all_local(void)
71} 71}
72EXPORT_SYMBOL(flush_cache_all_local); 72EXPORT_SYMBOL(flush_cache_all_local);
73 73
74/* Virtual address of pfn. */
75#define pfn_va(pfn) __va(PFN_PHYS(pfn))
76
74void 77void
75update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) 78update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
76{ 79{
77 struct page *page = pte_page(*ptep); 80 unsigned long pfn = pte_pfn(*ptep);
81 struct page *page;
78 82
79 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) && 83 /* We don't have pte special. As a result, we can be called with
80 test_bit(PG_dcache_dirty, &page->flags)) { 84 an invalid pfn and we don't need to flush the kernel dcache page.
85 This occurs with FireGL card in C8000. */
86 if (!pfn_valid(pfn))
87 return;
81 88
82 flush_kernel_dcache_page(page); 89 page = pfn_to_page(pfn);
90 if (page_mapping(page) && test_bit(PG_dcache_dirty, &page->flags)) {
91 flush_kernel_dcache_page_addr(pfn_va(pfn));
83 clear_bit(PG_dcache_dirty, &page->flags); 92 clear_bit(PG_dcache_dirty, &page->flags);
84 } else if (parisc_requires_coherency()) 93 } else if (parisc_requires_coherency())
85 flush_kernel_dcache_page(page); 94 flush_kernel_dcache_page_addr(pfn_va(pfn));
86} 95}
87 96
88void 97void
@@ -440,8 +449,8 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
440 else { 449 else {
441 unsigned long flags; 450 unsigned long flags;
442 451
443 mtsp(sid, 1);
444 purge_tlb_start(flags); 452 purge_tlb_start(flags);
453 mtsp(sid, 1);
445 if (split_tlb) { 454 if (split_tlb) {
446 while (npages--) { 455 while (npages--) {
447 pdtlb(start); 456 pdtlb(start);
@@ -495,44 +504,42 @@ static inline pte_t *get_ptep(pgd_t *pgd, unsigned long addr)
495 504
496void flush_cache_mm(struct mm_struct *mm) 505void flush_cache_mm(struct mm_struct *mm)
497{ 506{
507 struct vm_area_struct *vma;
508 pgd_t *pgd;
509
498 /* Flushing the whole cache on each cpu takes forever on 510 /* Flushing the whole cache on each cpu takes forever on
499 rp3440, etc. So, avoid it if the mm isn't too big. */ 511 rp3440, etc. So, avoid it if the mm isn't too big. */
500 if (mm_total_size(mm) < parisc_cache_flush_threshold) { 512 if (mm_total_size(mm) >= parisc_cache_flush_threshold) {
501 struct vm_area_struct *vma; 513 flush_cache_all();
502 514 return;
503 if (mm->context == mfsp(3)) { 515 }
504 for (vma = mm->mmap; vma; vma = vma->vm_next) { 516
505 flush_user_dcache_range_asm(vma->vm_start, 517 if (mm->context == mfsp(3)) {
506 vma->vm_end); 518 for (vma = mm->mmap; vma; vma = vma->vm_next) {
507 if (vma->vm_flags & VM_EXEC) 519 flush_user_dcache_range_asm(vma->vm_start, vma->vm_end);
508 flush_user_icache_range_asm( 520 if ((vma->vm_flags & VM_EXEC) == 0)
509 vma->vm_start, vma->vm_end); 521 continue;
510 } 522 flush_user_icache_range_asm(vma->vm_start, vma->vm_end);
511 } else {
512 pgd_t *pgd = mm->pgd;
513
514 for (vma = mm->mmap; vma; vma = vma->vm_next) {
515 unsigned long addr;
516
517 for (addr = vma->vm_start; addr < vma->vm_end;
518 addr += PAGE_SIZE) {
519 pte_t *ptep = get_ptep(pgd, addr);
520 if (ptep != NULL) {
521 pte_t pte = *ptep;
522 __flush_cache_page(vma, addr,
523 page_to_phys(pte_page(pte)));
524 }
525 }
526 }
527 } 523 }
528 return; 524 return;
529 } 525 }
530 526
531#ifdef CONFIG_SMP 527 pgd = mm->pgd;
532 flush_cache_all(); 528 for (vma = mm->mmap; vma; vma = vma->vm_next) {
533#else 529 unsigned long addr;
534 flush_cache_all_local(); 530
535#endif 531 for (addr = vma->vm_start; addr < vma->vm_end;
532 addr += PAGE_SIZE) {
533 unsigned long pfn;
534 pte_t *ptep = get_ptep(pgd, addr);
535 if (!ptep)
536 continue;
537 pfn = pte_pfn(*ptep);
538 if (!pfn_valid(pfn))
539 continue;
540 __flush_cache_page(vma, addr, PFN_PHYS(pfn));
541 }
542 }
536} 543}
537 544
538void 545void
@@ -556,33 +563,32 @@ flush_user_icache_range(unsigned long start, unsigned long end)
556void flush_cache_range(struct vm_area_struct *vma, 563void flush_cache_range(struct vm_area_struct *vma,
557 unsigned long start, unsigned long end) 564 unsigned long start, unsigned long end)
558{ 565{
566 unsigned long addr;
567 pgd_t *pgd;
568
559 BUG_ON(!vma->vm_mm->context); 569 BUG_ON(!vma->vm_mm->context);
560 570
561 if ((end - start) < parisc_cache_flush_threshold) { 571 if ((end - start) >= parisc_cache_flush_threshold) {
562 if (vma->vm_mm->context == mfsp(3)) {
563 flush_user_dcache_range_asm(start, end);
564 if (vma->vm_flags & VM_EXEC)
565 flush_user_icache_range_asm(start, end);
566 } else {
567 unsigned long addr;
568 pgd_t *pgd = vma->vm_mm->pgd;
569
570 for (addr = start & PAGE_MASK; addr < end;
571 addr += PAGE_SIZE) {
572 pte_t *ptep = get_ptep(pgd, addr);
573 if (ptep != NULL) {
574 pte_t pte = *ptep;
575 flush_cache_page(vma,
576 addr, pte_pfn(pte));
577 }
578 }
579 }
580 } else {
581#ifdef CONFIG_SMP
582 flush_cache_all(); 572 flush_cache_all();
583#else 573 return;
584 flush_cache_all_local(); 574 }
585#endif 575
576 if (vma->vm_mm->context == mfsp(3)) {
577 flush_user_dcache_range_asm(start, end);
578 if (vma->vm_flags & VM_EXEC)
579 flush_user_icache_range_asm(start, end);
580 return;
581 }
582
583 pgd = vma->vm_mm->pgd;
584 for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
585 unsigned long pfn;
586 pte_t *ptep = get_ptep(pgd, addr);
587 if (!ptep)
588 continue;
589 pfn = pte_pfn(*ptep);
590 if (pfn_valid(pfn))
591 __flush_cache_page(vma, addr, PFN_PHYS(pfn));
586 } 592 }
587} 593}
588 594
@@ -591,9 +597,10 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
591{ 597{
592 BUG_ON(!vma->vm_mm->context); 598 BUG_ON(!vma->vm_mm->context);
593 599
594 flush_tlb_page(vma, vmaddr); 600 if (pfn_valid(pfn)) {
595 __flush_cache_page(vma, vmaddr, page_to_phys(pfn_to_page(pfn))); 601 flush_tlb_page(vma, vmaddr);
596 602 __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
603 }
597} 604}
598 605
599#ifdef CONFIG_PARISC_TMPALIAS 606#ifdef CONFIG_PARISC_TMPALIAS
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index f65fa480c905..22395901d47b 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -150,7 +150,7 @@ static void convert_to_wide(unsigned long *addr)
150} 150}
151 151
152#ifdef CONFIG_64BIT 152#ifdef CONFIG_64BIT
153void __cpuinit set_firmware_width_unlocked(void) 153void set_firmware_width_unlocked(void)
154{ 154{
155 int ret; 155 int ret;
156 156
@@ -167,7 +167,7 @@ void __cpuinit set_firmware_width_unlocked(void)
167 * This function must be called before any pdc_* function that uses the 167 * This function must be called before any pdc_* function that uses the
168 * convert_to_wide function. 168 * convert_to_wide function.
169 */ 169 */
170void __cpuinit set_firmware_width(void) 170void set_firmware_width(void)
171{ 171{
172 unsigned long flags; 172 unsigned long flags;
173 spin_lock_irqsave(&pdc_lock, flags); 173 spin_lock_irqsave(&pdc_lock, flags);
@@ -175,11 +175,13 @@ void __cpuinit set_firmware_width(void)
175 spin_unlock_irqrestore(&pdc_lock, flags); 175 spin_unlock_irqrestore(&pdc_lock, flags);
176} 176}
177#else 177#else
178void __cpuinit set_firmware_width_unlocked(void) { 178void set_firmware_width_unlocked(void)
179{
179 return; 180 return;
180} 181}
181 182
182void __cpuinit set_firmware_width(void) { 183void set_firmware_width(void)
184{
183 return; 185 return;
184} 186}
185#endif /*CONFIG_64BIT*/ 187#endif /*CONFIG_64BIT*/
@@ -301,7 +303,7 @@ int pdc_chassis_warn(unsigned long *warn)
301 return retval; 303 return retval;
302} 304}
303 305
304int __cpuinit pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info) 306int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
305{ 307{
306 int ret; 308 int ret;
307 309
@@ -322,7 +324,7 @@ int __cpuinit pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
322 * This PDC call returns the presence and status of all the coprocessors 324 * This PDC call returns the presence and status of all the coprocessors
323 * attached to the processor. 325 * attached to the processor.
324 */ 326 */
325int __cpuinit pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info) 327int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
326{ 328{
327 int ret; 329 int ret;
328 unsigned long flags; 330 unsigned long flags;
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c
index 872275659d98..06cb3992907e 100644
--- a/arch/parisc/kernel/hardware.c
+++ b/arch/parisc/kernel/hardware.c
@@ -1367,7 +1367,7 @@ const char *parisc_hardware_description(struct parisc_device_id *id)
1367 1367
1368 1368
1369/* Interpret hversion (ret[0]) from PDC_MODEL(4)/PDC_MODEL_INFO(0) */ 1369/* Interpret hversion (ret[0]) from PDC_MODEL(4)/PDC_MODEL_INFO(0) */
1370enum cpu_type __cpuinit 1370enum cpu_type
1371parisc_get_cpu_type(unsigned long hversion) 1371parisc_get_cpu_type(unsigned long hversion)
1372{ 1372{
1373 struct hp_cpu_type_mask *ptr; 1373 struct hp_cpu_type_mask *ptr;
diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c
index 3295ef4a185d..f0b6722fc706 100644
--- a/arch/parisc/kernel/inventory.c
+++ b/arch/parisc/kernel/inventory.c
@@ -211,6 +211,7 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
211 /* REVISIT: who is the consumer of this? not sure yet... */ 211 /* REVISIT: who is the consumer of this? not sure yet... */
212 dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */ 212 dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */
213 dev->pmod_loc = pa_pdc_cell->mod_location; 213 dev->pmod_loc = pa_pdc_cell->mod_location;
214 dev->mod0 = pa_pdc_cell->mod[0];
214 215
215 register_parisc_device(dev); /* advertise device */ 216 register_parisc_device(dev); /* advertise device */
216 217
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index c8fb61ed32f4..b68d977ce30f 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -73,7 +73,7 @@ extern int update_cr16_clocksource(void); /* from time.c */
73 * 73 *
74 * FIXME: doesn't do much yet... 74 * FIXME: doesn't do much yet...
75 */ 75 */
76static void __cpuinit 76static void
77init_percpu_prof(unsigned long cpunum) 77init_percpu_prof(unsigned long cpunum)
78{ 78{
79 struct cpuinfo_parisc *p; 79 struct cpuinfo_parisc *p;
@@ -92,7 +92,7 @@ init_percpu_prof(unsigned long cpunum)
92 * (return 1). If so, initialize the chip and tell other partners in crime 92 * (return 1). If so, initialize the chip and tell other partners in crime
93 * they have work to do. 93 * they have work to do.
94 */ 94 */
95static int __cpuinit processor_probe(struct parisc_device *dev) 95static int processor_probe(struct parisc_device *dev)
96{ 96{
97 unsigned long txn_addr; 97 unsigned long txn_addr;
98 unsigned long cpuid; 98 unsigned long cpuid;
@@ -299,7 +299,7 @@ void __init collect_boot_cpu_data(void)
299 * 299 *
300 * o Enable CPU profiling hooks. 300 * o Enable CPU profiling hooks.
301 */ 301 */
302int __cpuinit init_per_cpu(int cpunum) 302int init_per_cpu(int cpunum)
303{ 303{
304 int ret; 304 int ret;
305 struct pdc_coproc_cfg coproc_cfg; 305 struct pdc_coproc_cfg coproc_cfg;
@@ -371,10 +371,23 @@ show_cpuinfo (struct seq_file *m, void *v)
371 371
372 seq_printf(m, "capabilities\t:"); 372 seq_printf(m, "capabilities\t:");
373 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS32) 373 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS32)
374 seq_printf(m, " os32"); 374 seq_puts(m, " os32");
375 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS64) 375 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS64)
376 seq_printf(m, " os64"); 376 seq_puts(m, " os64");
377 seq_printf(m, "\n"); 377 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC)
378 seq_puts(m, " iopdir_fdc");
379 switch (boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) {
380 case PDC_MODEL_NVA_SUPPORTED:
381 seq_puts(m, " nva_supported");
382 break;
383 case PDC_MODEL_NVA_SLOW:
384 seq_puts(m, " nva_slow");
385 break;
386 case PDC_MODEL_NVA_UNSUPPORTED:
387 seq_puts(m, " needs_equivalent_aliasing");
388 break;
389 }
390 seq_printf(m, " (0x%02lx)\n", boot_cpu_data.pdc.capabilities);
378 391
379 seq_printf(m, "model\t\t: %s\n" 392 seq_printf(m, "model\t\t: %s\n"
380 "model name\t: %s\n", 393 "model name\t: %s\n",
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 1e95b2000ce8..7349a3fedfc7 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -156,7 +156,7 @@ void __init setup_arch(char **cmdline_p)
156#endif 156#endif
157 157
158#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE) 158#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
159 conswitchp = &dummy_con; /* we use take_over_console() later ! */ 159 conswitchp = &dummy_con; /* we use do_take_over_console() later ! */
160#endif 160#endif
161 161
162} 162}
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 940188d1942c..07349b002687 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -56,13 +56,6 @@
56#define A(__x) ((unsigned long)(__x)) 56#define A(__x) ((unsigned long)(__x))
57 57
58/* 58/*
59 * Atomically swap in the new signal mask, and wait for a signal.
60 */
61#ifdef CONFIG_64BIT
62#include "sys32.h"
63#endif
64
65/*
66 * Do a signal return - restore sigcontext. 59 * Do a signal return - restore sigcontext.
67 */ 60 */
68 61
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c
index 33eca1b04926..6c6a271a6140 100644
--- a/arch/parisc/kernel/signal32.c
+++ b/arch/parisc/kernel/signal32.c
@@ -34,7 +34,6 @@
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35 35
36#include "signal32.h" 36#include "signal32.h"
37#include "sys32.h"
38 37
39#define DEBUG_COMPAT_SIG 0 38#define DEBUG_COMPAT_SIG 0
40#define DEBUG_COMPAT_SIG_LEVEL 2 39#define DEBUG_COMPAT_SIG_LEVEL 2
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index e3614fb343e5..8a252f2d6c08 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -62,9 +62,9 @@ static int smp_debug_lvl = 0;
62volatile struct task_struct *smp_init_current_idle_task; 62volatile struct task_struct *smp_init_current_idle_task;
63 63
64/* track which CPU is booting */ 64/* track which CPU is booting */
65static volatile int cpu_now_booting __cpuinitdata; 65static volatile int cpu_now_booting;
66 66
67static int parisc_max_cpus __cpuinitdata = 1; 67static int parisc_max_cpus = 1;
68 68
69static DEFINE_PER_CPU(spinlock_t, ipi_lock); 69static DEFINE_PER_CPU(spinlock_t, ipi_lock);
70 70
@@ -328,7 +328,7 @@ void __init smp_callin(void)
328/* 328/*
329 * Bring one cpu online. 329 * Bring one cpu online.
330 */ 330 */
331int __cpuinit smp_boot_one_cpu(int cpuid, struct task_struct *idle) 331int smp_boot_one_cpu(int cpuid, struct task_struct *idle)
332{ 332{
333 const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid); 333 const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid);
334 long timeout; 334 long timeout;
@@ -424,7 +424,7 @@ void smp_cpus_done(unsigned int cpu_max)
424} 424}
425 425
426 426
427int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) 427int __cpu_up(unsigned int cpu, struct task_struct *tidle)
428{ 428{
429 if (cpu != 0 && cpu < parisc_max_cpus) 429 if (cpu != 0 && cpu < parisc_max_cpus)
430 smp_boot_one_cpu(cpu, tidle); 430 smp_boot_one_cpu(cpu, tidle);
diff --git a/arch/parisc/kernel/sys32.h b/arch/parisc/kernel/sys32.h
deleted file mode 100644
index 60dd470f39f8..000000000000
--- a/arch/parisc/kernel/sys32.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Copyright (C) 2002 Richard Hirst <rhirst at parisc-linux.org>
3 * Copyright (C) 2003 James Bottomley <jejb at parisc-linux.org>
4 * Copyright (C) 2003 Randolph Chung <tausq with parisc-linux.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef _PARISC64_KERNEL_SYS32_H
21#define _PARISC64_KERNEL_SYS32_H
22
23#include <linux/compat.h>
24
25/* Call a kernel syscall which will use kernel space instead of user
26 * space for its copy_to/from_user.
27 */
28#define KERNEL_SYSCALL(ret, syscall, args...) \
29{ \
30 mm_segment_t old_fs = get_fs(); \
31 set_fs(KERNEL_DS); \
32 ret = syscall(args); \
33 set_fs (old_fs); \
34}
35
36#endif
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index a134ff4da12e..bb9f3b64de55 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -42,8 +42,6 @@
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <asm/mmu_context.h> 43#include <asm/mmu_context.h>
44 44
45#include "sys32.h"
46
47#undef DEBUG 45#undef DEBUG
48 46
49#ifdef DEBUG 47#ifdef DEBUG
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index a49cc812df8a..ac4370b1ca40 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -2,6 +2,7 @@
2 * Optimized memory copy routines. 2 * Optimized memory copy routines.
3 * 3 *
4 * Copyright (C) 2004 Randolph Chung <tausq@debian.org> 4 * Copyright (C) 2004 Randolph Chung <tausq@debian.org>
5 * Copyright (C) 2013 Helge Deller <deller@gmx.de>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -153,17 +154,21 @@ static inline void prefetch_dst(const void *addr)
153#define prefetch_dst(addr) do { } while(0) 154#define prefetch_dst(addr) do { } while(0)
154#endif 155#endif
155 156
157#define PA_MEMCPY_OK 0
158#define PA_MEMCPY_LOAD_ERROR 1
159#define PA_MEMCPY_STORE_ERROR 2
160
156/* Copy from a not-aligned src to an aligned dst, using shifts. Handles 4 words 161/* Copy from a not-aligned src to an aligned dst, using shifts. Handles 4 words
157 * per loop. This code is derived from glibc. 162 * per loop. This code is derived from glibc.
158 */ 163 */
159static inline unsigned long copy_dstaligned(unsigned long dst, unsigned long src, unsigned long len, unsigned long o_dst, unsigned long o_src, unsigned long o_len) 164static inline unsigned long copy_dstaligned(unsigned long dst,
165 unsigned long src, unsigned long len)
160{ 166{
161 /* gcc complains that a2 and a3 may be uninitialized, but actually 167 /* gcc complains that a2 and a3 may be uninitialized, but actually
162 * they cannot be. Initialize a2/a3 to shut gcc up. 168 * they cannot be. Initialize a2/a3 to shut gcc up.
163 */ 169 */
164 register unsigned int a0, a1, a2 = 0, a3 = 0; 170 register unsigned int a0, a1, a2 = 0, a3 = 0;
165 int sh_1, sh_2; 171 int sh_1, sh_2;
166 struct exception_data *d;
167 172
168 /* prefetch_src((const void *)src); */ 173 /* prefetch_src((const void *)src); */
169 174
@@ -197,7 +202,7 @@ static inline unsigned long copy_dstaligned(unsigned long dst, unsigned long src
197 goto do2; 202 goto do2;
198 case 0: 203 case 0:
199 if (len == 0) 204 if (len == 0)
200 return 0; 205 return PA_MEMCPY_OK;
201 /* a3 = ((unsigned int *) src)[0]; 206 /* a3 = ((unsigned int *) src)[0];
202 a0 = ((unsigned int *) src)[1]; */ 207 a0 = ((unsigned int *) src)[1]; */
203 ldw(s_space, 0, src, a3, cda_ldw_exc); 208 ldw(s_space, 0, src, a3, cda_ldw_exc);
@@ -256,42 +261,35 @@ do0:
256 preserve_branch(handle_load_error); 261 preserve_branch(handle_load_error);
257 preserve_branch(handle_store_error); 262 preserve_branch(handle_store_error);
258 263
259 return 0; 264 return PA_MEMCPY_OK;
260 265
261handle_load_error: 266handle_load_error:
262 __asm__ __volatile__ ("cda_ldw_exc:\n"); 267 __asm__ __volatile__ ("cda_ldw_exc:\n");
263 d = &__get_cpu_var(exception_data); 268 return PA_MEMCPY_LOAD_ERROR;
264 DPRINTF("cda_ldw_exc: o_len=%lu fault_addr=%lu o_src=%lu ret=%lu\n",
265 o_len, d->fault_addr, o_src, o_len - d->fault_addr + o_src);
266 return o_len * 4 - d->fault_addr + o_src;
267 269
268handle_store_error: 270handle_store_error:
269 __asm__ __volatile__ ("cda_stw_exc:\n"); 271 __asm__ __volatile__ ("cda_stw_exc:\n");
270 d = &__get_cpu_var(exception_data); 272 return PA_MEMCPY_STORE_ERROR;
271 DPRINTF("cda_stw_exc: o_len=%lu fault_addr=%lu o_dst=%lu ret=%lu\n",
272 o_len, d->fault_addr, o_dst, o_len - d->fault_addr + o_dst);
273 return o_len * 4 - d->fault_addr + o_dst;
274} 273}
275 274
276 275
277/* Returns 0 for success, otherwise, returns number of bytes not transferred. */ 276/* Returns PA_MEMCPY_OK, PA_MEMCPY_LOAD_ERROR or PA_MEMCPY_STORE_ERROR.
278static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len) 277 * In case of an access fault the faulty address can be read from the per_cpu
278 * exception data struct. */
279static unsigned long pa_memcpy_internal(void *dstp, const void *srcp,
280 unsigned long len)
279{ 281{
280 register unsigned long src, dst, t1, t2, t3; 282 register unsigned long src, dst, t1, t2, t3;
281 register unsigned char *pcs, *pcd; 283 register unsigned char *pcs, *pcd;
282 register unsigned int *pws, *pwd; 284 register unsigned int *pws, *pwd;
283 register double *pds, *pdd; 285 register double *pds, *pdd;
284 unsigned long ret = 0; 286 unsigned long ret;
285 unsigned long o_dst, o_src, o_len;
286 struct exception_data *d;
287 287
288 src = (unsigned long)srcp; 288 src = (unsigned long)srcp;
289 dst = (unsigned long)dstp; 289 dst = (unsigned long)dstp;
290 pcs = (unsigned char *)srcp; 290 pcs = (unsigned char *)srcp;
291 pcd = (unsigned char *)dstp; 291 pcd = (unsigned char *)dstp;
292 292
293 o_dst = dst; o_src = src; o_len = len;
294
295 /* prefetch_src((const void *)srcp); */ 293 /* prefetch_src((const void *)srcp); */
296 294
297 if (len < THRESHOLD) 295 if (len < THRESHOLD)
@@ -401,7 +399,7 @@ byte_copy:
401 len--; 399 len--;
402 } 400 }
403 401
404 return 0; 402 return PA_MEMCPY_OK;
405 403
406unaligned_copy: 404unaligned_copy:
407 /* possibly we are aligned on a word, but not on a double... */ 405 /* possibly we are aligned on a word, but not on a double... */
@@ -438,8 +436,7 @@ unaligned_copy:
438 src = (unsigned long)pcs; 436 src = (unsigned long)pcs;
439 } 437 }
440 438
441 ret = copy_dstaligned(dst, src, len / sizeof(unsigned int), 439 ret = copy_dstaligned(dst, src, len / sizeof(unsigned int));
442 o_dst, o_src, o_len);
443 if (ret) 440 if (ret)
444 return ret; 441 return ret;
445 442
@@ -454,17 +451,41 @@ unaligned_copy:
454 451
455handle_load_error: 452handle_load_error:
456 __asm__ __volatile__ ("pmc_load_exc:\n"); 453 __asm__ __volatile__ ("pmc_load_exc:\n");
457 d = &__get_cpu_var(exception_data); 454 return PA_MEMCPY_LOAD_ERROR;
458 DPRINTF("pmc_load_exc: o_len=%lu fault_addr=%lu o_src=%lu ret=%lu\n",
459 o_len, d->fault_addr, o_src, o_len - d->fault_addr + o_src);
460 return o_len - d->fault_addr + o_src;
461 455
462handle_store_error: 456handle_store_error:
463 __asm__ __volatile__ ("pmc_store_exc:\n"); 457 __asm__ __volatile__ ("pmc_store_exc:\n");
458 return PA_MEMCPY_STORE_ERROR;
459}
460
461
462/* Returns 0 for success, otherwise, returns number of bytes not transferred. */
463static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len)
464{
465 unsigned long ret, fault_addr, reference;
466 struct exception_data *d;
467
468 ret = pa_memcpy_internal(dstp, srcp, len);
469 if (likely(ret == PA_MEMCPY_OK))
470 return 0;
471
472 /* if a load or store fault occured we can get the faulty addr */
464 d = &__get_cpu_var(exception_data); 473 d = &__get_cpu_var(exception_data);
465 DPRINTF("pmc_store_exc: o_len=%lu fault_addr=%lu o_dst=%lu ret=%lu\n", 474 fault_addr = d->fault_addr;
466 o_len, d->fault_addr, o_dst, o_len - d->fault_addr + o_dst); 475
467 return o_len - d->fault_addr + o_dst; 476 /* error in load or store? */
477 if (ret == PA_MEMCPY_LOAD_ERROR)
478 reference = (unsigned long) srcp;
479 else
480 reference = (unsigned long) dstp;
481
482 DPRINTF("pa_memcpy: fault type = %lu, len=%lu fault_addr=%lu ref=%lu\n",
483 ret, len, fault_addr, reference);
484
485 if (fault_addr >= reference)
486 return len - (fault_addr - reference);
487 else
488 return len;
468} 489}
469 490
470#ifdef __KERNEL__ 491#ifdef __KERNEL__
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 505b56c6b9b9..b0f96c0e6316 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -214,7 +214,6 @@ static void __init setup_bootmem(void)
214 mem_limit_func(); /* check for "mem=" argument */ 214 mem_limit_func(); /* check for "mem=" argument */
215 215
216 mem_max = 0; 216 mem_max = 0;
217 num_physpages = 0;
218 for (i = 0; i < npmem_ranges; i++) { 217 for (i = 0; i < npmem_ranges; i++) {
219 unsigned long rsize; 218 unsigned long rsize;
220 219
@@ -229,10 +228,8 @@ static void __init setup_bootmem(void)
229 npmem_ranges = i + 1; 228 npmem_ranges = i + 1;
230 mem_max = mem_limit; 229 mem_max = mem_limit;
231 } 230 }
232 num_physpages += pmem_ranges[i].pages;
233 break; 231 break;
234 } 232 }
235 num_physpages += pmem_ranges[i].pages;
236 mem_max += rsize; 233 mem_max += rsize;
237 } 234 }
238 235
@@ -532,7 +529,7 @@ void free_initmem(void)
532 * pages are no-longer executable */ 529 * pages are no-longer executable */
533 flush_icache_range(init_begin, init_end); 530 flush_icache_range(init_begin, init_end);
534 531
535 num_physpages += free_initmem_default(0); 532 free_initmem_default(-1);
536 533
537 /* set up a new led state on systems shipped LED State panel */ 534 /* set up a new led state on systems shipped LED State panel */
538 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 535 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
@@ -580,8 +577,6 @@ unsigned long pcxl_dma_start __read_mostly;
580 577
581void __init mem_init(void) 578void __init mem_init(void)
582{ 579{
583 int codesize, reservedpages, datasize, initsize;
584
585 /* Do sanity checks on page table constants */ 580 /* Do sanity checks on page table constants */
586 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t)); 581 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
587 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t)); 582 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
@@ -590,45 +585,8 @@ void __init mem_init(void)
590 > BITS_PER_LONG); 585 > BITS_PER_LONG);
591 586
592 high_memory = __va((max_pfn << PAGE_SHIFT)); 587 high_memory = __va((max_pfn << PAGE_SHIFT));
593 588 set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
594#ifndef CONFIG_DISCONTIGMEM 589 free_all_bootmem();
595 max_mapnr = page_to_pfn(virt_to_page(high_memory - 1)) + 1;
596 totalram_pages += free_all_bootmem();
597#else
598 {
599 int i;
600
601 for (i = 0; i < npmem_ranges; i++)
602 totalram_pages += free_all_bootmem_node(NODE_DATA(i));
603 }
604#endif
605
606 codesize = (unsigned long)_etext - (unsigned long)_text;
607 datasize = (unsigned long)_edata - (unsigned long)_etext;
608 initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
609
610 reservedpages = 0;
611{
612 unsigned long pfn;
613#ifdef CONFIG_DISCONTIGMEM
614 int i;
615
616 for (i = 0; i < npmem_ranges; i++) {
617 for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
618 if (PageReserved(pfn_to_page(pfn)))
619 reservedpages++;
620 }
621 }
622#else /* !CONFIG_DISCONTIGMEM */
623 for (pfn = 0; pfn < max_pfn; pfn++) {
624 /*
625 * Only count reserved RAM pages
626 */
627 if (PageReserved(pfn_to_page(pfn)))
628 reservedpages++;
629 }
630#endif
631}
632 590
633#ifdef CONFIG_PA11 591#ifdef CONFIG_PA11
634 if (hppa_dma_ops == &pcxl_dma_ops) { 592 if (hppa_dma_ops == &pcxl_dma_ops) {
@@ -643,15 +601,7 @@ void __init mem_init(void)
643 parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START); 601 parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
644#endif 602#endif
645 603
646 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", 604 mem_init_print_info(NULL);
647 nr_free_pages() << (PAGE_SHIFT-10),
648 num_physpages << (PAGE_SHIFT-10),
649 codesize >> 10,
650 reservedpages << (PAGE_SHIFT-10),
651 datasize >> 10,
652 initsize >> 10
653 );
654
655#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ 605#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
656 printk("virtual kernel memory layout:\n" 606 printk("virtual kernel memory layout:\n"
657 " vmalloc : 0x%p - 0x%p (%4ld MB)\n" 607 " vmalloc : 0x%p - 0x%p (%4ld MB)\n"
@@ -1101,6 +1051,6 @@ void flush_tlb_all(void)
1101#ifdef CONFIG_BLK_DEV_INITRD 1051#ifdef CONFIG_BLK_DEV_INITRD
1102void free_initrd_mem(unsigned long start, unsigned long end) 1052void free_initrd_mem(unsigned long start, unsigned long end)
1103{ 1053{
1104 num_physpages += free_reserved_area(start, end, 0, "initrd"); 1054 free_reserved_area((void *)start, (void *)end, -1, "initrd");
1105} 1055}
1106#endif 1056#endif