aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig9
-rw-r--r--arch/powerpc/configs/ps3_defconfig29
-rw-r--r--arch/powerpc/kernel/legacy_serial.c2
-rw-r--r--arch/powerpc/kernel/lparcfg.c2
-rw-r--r--arch/powerpc/kernel/nvram_64.c2
-rw-r--r--arch/powerpc/kernel/pci_64.c2
-rw-r--r--arch/powerpc/kernel/proc_ppc64.c3
-rw-r--r--arch/powerpc/kernel/prom.c2
-rw-r--r--arch/powerpc/kernel/rtas-proc.c14
-rw-r--r--arch/powerpc/kernel/rtas_flash.c9
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c67
-rw-r--r--arch/powerpc/kernel/udbg.c2
-rw-r--r--arch/powerpc/kernel/vdso.c104
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c5
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c40
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h2
-rw-r--r--arch/powerpc/platforms/celleb/pci.c12
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c56
-rw-r--r--arch/powerpc/platforms/chrp/setup.c4
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c2
-rw-r--r--arch/powerpc/platforms/iseries/mf.c6
-rw-r--r--arch/powerpc/platforms/iseries/proc.c2
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c4
-rw-r--r--arch/powerpc/platforms/ps3/Kconfig11
-rw-r--r--arch/powerpc/platforms/ps3/htab.c6
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c2
-rw-r--r--arch/powerpc/platforms/ps3/setup.c42
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c2
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c2
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c2
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c3
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c2
-rw-r--r--arch/powerpc/platforms/pseries/scanlog.c2
-rw-r--r--arch/powerpc/xmon/spu-dis.c2
37 files changed, 220 insertions, 248 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index abc6bd2f858e..0088c5ebca78 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -552,6 +552,11 @@ config PPC_PS3
552 bool "Sony PS3 (incomplete)" 552 bool "Sony PS3 (incomplete)"
553 depends on PPC_MULTIPLATFORM && PPC64 553 depends on PPC_MULTIPLATFORM && PPC64
554 select PPC_CELL 554 select PPC_CELL
555 select USB_ARCH_HAS_OHCI
556 select USB_OHCI_LITTLE_ENDIAN
557 select USB_OHCI_BIG_ENDIAN_MMIO
558 select USB_ARCH_HAS_EHCI
559 select USB_EHCI_BIG_ENDIAN_MMIO
555 help 560 help
556 This option enables support for the Sony PS3 game console 561 This option enables support for the Sony PS3 game console
557 and other platforms using the PS3 hypervisor. 562 and other platforms using the PS3 hypervisor.
@@ -972,6 +977,10 @@ config ISA
972 have an IBM RS/6000 or pSeries machine or a PReP machine, say Y. If 977 have an IBM RS/6000 or pSeries machine or a PReP machine, say Y. If
973 you have an embedded board, consult your board documentation. 978 you have an embedded board, consult your board documentation.
974 979
980config ZONE_DMA
981 bool
982 default y
983
975config GENERIC_ISA_DMA 984config GENERIC_ISA_DMA
976 bool 985 bool
977 depends on PPC64 || POWER4 || 6xx && !CPM2 986 depends on PPC64 || POWER4 || 6xx && !CPM2
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index ec644b34a082..0345a2ceec59 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -163,6 +163,7 @@ CONFIG_PS3_HTAB_SIZE=20
163# CONFIG_PS3_DYNAMIC_DMA is not set 163# CONFIG_PS3_DYNAMIC_DMA is not set
164CONFIG_PS3_USE_LPAR_ADDR=y 164CONFIG_PS3_USE_LPAR_ADDR=y
165CONFIG_PS3_VUART=y 165CONFIG_PS3_VUART=y
166CONFIG_PS3_PS3AV=y
166 167
167# 168#
168# Kernel options 169# Kernel options
@@ -611,14 +612,40 @@ CONFIG_GEN_RTC=y
611# Graphics support 612# Graphics support
612# 613#
613# CONFIG_FIRMWARE_EDID is not set 614# CONFIG_FIRMWARE_EDID is not set
614# CONFIG_FB is not set 615CONFIG_FB=y
616CONFIG_FB_CFB_FILLRECT=y
617CONFIG_FB_CFB_COPYAREA=y
618CONFIG_FB_CFB_IMAGEBLIT=y
619# CONFIG_FB_MACMODES is not set
620# CONFIG_FB_BACKLIGHT is not set
621# CONFIG_FB_MODE_HELPERS is not set
622# CONFIG_FB_TILEBLITTING is not set
623# CONFIG_FB_OF is not set
624# CONFIG_FB_VGA16 is not set
625# CONFIG_FB_S1D13XXX is not set
615# CONFIG_FB_IBM_GXT4500 is not set 626# CONFIG_FB_IBM_GXT4500 is not set
627CONFIG_FB_PS3=y
628CONFIG_FB_PS3_DEFAULT_SIZE_M=18
629# CONFIG_FB_VIRTUAL is not set
616 630
617# 631#
618# Console display driver support 632# Console display driver support
619# 633#
620# CONFIG_VGA_CONSOLE is not set 634# CONFIG_VGA_CONSOLE is not set
621CONFIG_DUMMY_CONSOLE=y 635CONFIG_DUMMY_CONSOLE=y
636CONFIG_FRAMEBUFFER_CONSOLE=y
637# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
638# CONFIG_FONTS is not set
639CONFIG_FONT_8x8=y
640CONFIG_FONT_8x16=y
641
642#
643# Logo configuration
644#
645CONFIG_LOGO=y
646# CONFIG_LOGO_LINUX_MONO is not set
647# CONFIG_LOGO_LINUX_VGA16 is not set
648CONFIG_LOGO_LINUX_CLUT224=y
622# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 649# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
623 650
624# 651#
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 5e6ddfa474c0..89f46f377922 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -498,7 +498,7 @@ static int __init check_legacy_serial_console(void)
498 DBG(" -> check_legacy_serial_console()\n"); 498 DBG(" -> check_legacy_serial_console()\n");
499 499
500 /* The user has requested a console so this is already set up. */ 500 /* The user has requested a console so this is already set up. */
501 if (strstr(saved_command_line, "console=")) { 501 if (strstr(boot_command_line, "console=")) {
502 DBG(" console was specified !\n"); 502 DBG(" console was specified !\n");
503 return -EBUSY; 503 return -EBUSY;
504 } 504 }
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 0de5a08cf9b0..89486b631284 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -571,7 +571,7 @@ static int lparcfg_open(struct inode *inode, struct file *file)
571 return single_open(file, lparcfg_data, NULL); 571 return single_open(file, lparcfg_data, NULL);
572} 572}
573 573
574struct file_operations lparcfg_fops = { 574const struct file_operations lparcfg_fops = {
575 .owner = THIS_MODULE, 575 .owner = THIS_MODULE,
576 .read = seq_read, 576 .read = seq_read,
577 .write = lparcfg_write, 577 .write = lparcfg_write,
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 869cebbba967..f9676f52c6d8 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -179,7 +179,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file,
179 } 179 }
180} 180}
181 181
182struct file_operations nvram_fops = { 182const struct file_operations nvram_fops = {
183 .owner = THIS_MODULE, 183 .owner = THIS_MODULE,
184 .llseek = dev_nvram_llseek, 184 .llseek = dev_nvram_llseek,
185 .read = dev_nvram_read, 185 .read = dev_nvram_read,
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 6828df4afd99..7e97d71a5f8f 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -381,8 +381,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
381 381
382 pci_device_add(dev, bus); 382 pci_device_add(dev, bus);
383 383
384 /* XXX pci_scan_msi_device(dev); */
385
386 return dev; 384 return dev;
387} 385}
388EXPORT_SYMBOL(of_create_pci_dev); 386EXPORT_SYMBOL(of_create_pci_dev);
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c
index dd7001cacf75..f78dfce1b771 100644
--- a/arch/powerpc/kernel/proc_ppc64.c
+++ b/arch/powerpc/kernel/proc_ppc64.c
@@ -33,7 +33,7 @@ static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes
33 loff_t *ppos); 33 loff_t *ppos);
34static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); 34static int page_map_mmap( struct file *file, struct vm_area_struct *vma );
35 35
36static struct file_operations page_map_fops = { 36static const struct file_operations page_map_fops = {
37 .llseek = page_map_seek, 37 .llseek = page_map_seek,
38 .read = page_map_read, 38 .read = page_map_read,
39 .mmap = page_map_mmap 39 .mmap = page_map_mmap
@@ -71,7 +71,6 @@ static int __init proc_ppc64_init(void)
71 pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL); 71 pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
72 if (!pde) 72 if (!pde)
73 return 1; 73 return 1;
74 pde->nlink = 1;
75 pde->data = vdso_data; 74 pde->data = vdso_data;
76 pde->size = PAGE_SIZE; 75 pde->size = PAGE_SIZE;
77 pde->proc_fops = &page_map_fops; 76 pde->proc_fops = &page_map_fops;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 3be52d693eca..3e86e6e0f778 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -991,7 +991,7 @@ void __init early_init_devtree(void *params)
991 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 991 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
992 992
993 /* Save command line for /proc/cmdline and then parse parameters */ 993 /* Save command line for /proc/cmdline and then parse parameters */
994 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); 994 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
995 parse_early_param(); 995 parse_early_param();
996 996
997 /* Reserve LMB regions used by kernel, initrd, dt, etc... */ 997 /* Reserve LMB regions used by kernel, initrd, dt, etc... */
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 2fe82abf1c52..6cbf2ae5d7aa 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -160,7 +160,7 @@ static int sensors_open(struct inode *inode, struct file *file)
160 return single_open(file, ppc_rtas_sensors_show, NULL); 160 return single_open(file, ppc_rtas_sensors_show, NULL);
161} 161}
162 162
163struct file_operations ppc_rtas_sensors_operations = { 163const struct file_operations ppc_rtas_sensors_operations = {
164 .open = sensors_open, 164 .open = sensors_open,
165 .read = seq_read, 165 .read = seq_read,
166 .llseek = seq_lseek, 166 .llseek = seq_lseek,
@@ -172,7 +172,7 @@ static int poweron_open(struct inode *inode, struct file *file)
172 return single_open(file, ppc_rtas_poweron_show, NULL); 172 return single_open(file, ppc_rtas_poweron_show, NULL);
173} 173}
174 174
175struct file_operations ppc_rtas_poweron_operations = { 175const struct file_operations ppc_rtas_poweron_operations = {
176 .open = poweron_open, 176 .open = poweron_open,
177 .read = seq_read, 177 .read = seq_read,
178 .llseek = seq_lseek, 178 .llseek = seq_lseek,
@@ -185,7 +185,7 @@ static int progress_open(struct inode *inode, struct file *file)
185 return single_open(file, ppc_rtas_progress_show, NULL); 185 return single_open(file, ppc_rtas_progress_show, NULL);
186} 186}
187 187
188struct file_operations ppc_rtas_progress_operations = { 188const struct file_operations ppc_rtas_progress_operations = {
189 .open = progress_open, 189 .open = progress_open,
190 .read = seq_read, 190 .read = seq_read,
191 .llseek = seq_lseek, 191 .llseek = seq_lseek,
@@ -198,7 +198,7 @@ static int clock_open(struct inode *inode, struct file *file)
198 return single_open(file, ppc_rtas_clock_show, NULL); 198 return single_open(file, ppc_rtas_clock_show, NULL);
199} 199}
200 200
201struct file_operations ppc_rtas_clock_operations = { 201const struct file_operations ppc_rtas_clock_operations = {
202 .open = clock_open, 202 .open = clock_open,
203 .read = seq_read, 203 .read = seq_read,
204 .llseek = seq_lseek, 204 .llseek = seq_lseek,
@@ -211,7 +211,7 @@ static int tone_freq_open(struct inode *inode, struct file *file)
211 return single_open(file, ppc_rtas_tone_freq_show, NULL); 211 return single_open(file, ppc_rtas_tone_freq_show, NULL);
212} 212}
213 213
214struct file_operations ppc_rtas_tone_freq_operations = { 214const struct file_operations ppc_rtas_tone_freq_operations = {
215 .open = tone_freq_open, 215 .open = tone_freq_open,
216 .read = seq_read, 216 .read = seq_read,
217 .llseek = seq_lseek, 217 .llseek = seq_lseek,
@@ -224,7 +224,7 @@ static int tone_volume_open(struct inode *inode, struct file *file)
224 return single_open(file, ppc_rtas_tone_volume_show, NULL); 224 return single_open(file, ppc_rtas_tone_volume_show, NULL);
225} 225}
226 226
227struct file_operations ppc_rtas_tone_volume_operations = { 227const struct file_operations ppc_rtas_tone_volume_operations = {
228 .open = tone_volume_open, 228 .open = tone_volume_open,
229 .read = seq_read, 229 .read = seq_read,
230 .llseek = seq_lseek, 230 .llseek = seq_lseek,
@@ -237,7 +237,7 @@ static int rmo_buf_open(struct inode *inode, struct file *file)
237 return single_open(file, ppc_rtas_rmo_buf_show, NULL); 237 return single_open(file, ppc_rtas_rmo_buf_show, NULL);
238} 238}
239 239
240struct file_operations ppc_rtas_rmo_buf_ops = { 240const struct file_operations ppc_rtas_rmo_buf_ops = {
241 .open = rmo_buf_open, 241 .open = rmo_buf_open,
242 .read = seq_read, 242 .read = seq_read,
243 .llseek = seq_lseek, 243 .llseek = seq_lseek,
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 0c4fcd34bfe5..f72118c0844f 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -702,13 +702,12 @@ static int initialize_flash_pde_data(const char *rtas_call_name,
702} 702}
703 703
704static struct proc_dir_entry *create_flash_pde(const char *filename, 704static struct proc_dir_entry *create_flash_pde(const char *filename,
705 struct file_operations *fops) 705 const struct file_operations *fops)
706{ 706{
707 struct proc_dir_entry *ent = NULL; 707 struct proc_dir_entry *ent = NULL;
708 708
709 ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL); 709 ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL);
710 if (ent != NULL) { 710 if (ent != NULL) {
711 ent->nlink = 1;
712 ent->proc_fops = fops; 711 ent->proc_fops = fops;
713 ent->owner = THIS_MODULE; 712 ent->owner = THIS_MODULE;
714 } 713 }
@@ -716,21 +715,21 @@ static struct proc_dir_entry *create_flash_pde(const char *filename,
716 return ent; 715 return ent;
717} 716}
718 717
719static struct file_operations rtas_flash_operations = { 718static const struct file_operations rtas_flash_operations = {
720 .read = rtas_flash_read, 719 .read = rtas_flash_read,
721 .write = rtas_flash_write, 720 .write = rtas_flash_write,
722 .open = rtas_excl_open, 721 .open = rtas_excl_open,
723 .release = rtas_flash_release, 722 .release = rtas_flash_release,
724}; 723};
725 724
726static struct file_operations manage_flash_operations = { 725static const struct file_operations manage_flash_operations = {
727 .read = manage_flash_read, 726 .read = manage_flash_read,
728 .write = manage_flash_write, 727 .write = manage_flash_write,
729 .open = rtas_excl_open, 728 .open = rtas_excl_open,
730 .release = rtas_excl_release, 729 .release = rtas_excl_release,
731}; 730};
732 731
733static struct file_operations validate_flash_operations = { 732static const struct file_operations validate_flash_operations = {
734 .read = validate_flash_read, 733 .read = validate_flash_read,
735 .write = validate_flash_write, 734 .write = validate_flash_write,
736 .open = rtas_excl_open, 735 .open = rtas_excl_open,
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 03a2a2f30d66..673e8d9df7f5 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -198,73 +198,6 @@ static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
198 __put_user(i->tv_usec, &o->tv_usec))); 198 __put_user(i->tv_usec, &o->tv_usec)));
199} 199}
200 200
201struct sysinfo32 {
202 s32 uptime;
203 u32 loads[3];
204 u32 totalram;
205 u32 freeram;
206 u32 sharedram;
207 u32 bufferram;
208 u32 totalswap;
209 u32 freeswap;
210 unsigned short procs;
211 unsigned short pad;
212 u32 totalhigh;
213 u32 freehigh;
214 u32 mem_unit;
215 char _f[20-2*sizeof(int)-sizeof(int)];
216};
217
218asmlinkage long compat_sys_sysinfo(struct sysinfo32 __user *info)
219{
220 struct sysinfo s;
221 int ret, err;
222 int bitcount=0;
223 mm_segment_t old_fs = get_fs ();
224
225 /* The __user cast is valid due to set_fs() */
226 set_fs (KERNEL_DS);
227 ret = sys_sysinfo((struct sysinfo __user *)&s);
228 set_fs (old_fs);
229
230 /* Check to see if any memory value is too large for 32-bit and
231 * scale down if needed.
232 */
233 if ((s.totalram >> 32) || (s.totalswap >> 32)) {
234 while (s.mem_unit < PAGE_SIZE) {
235 s.mem_unit <<= 1;
236 bitcount++;
237 }
238 s.totalram >>=bitcount;
239 s.freeram >>= bitcount;
240 s.sharedram >>= bitcount;
241 s.bufferram >>= bitcount;
242 s.totalswap >>= bitcount;
243 s.freeswap >>= bitcount;
244 s.totalhigh >>= bitcount;
245 s.freehigh >>= bitcount;
246 }
247
248 err = put_user (s.uptime, &info->uptime);
249 err |= __put_user (s.loads[0], &info->loads[0]);
250 err |= __put_user (s.loads[1], &info->loads[1]);
251 err |= __put_user (s.loads[2], &info->loads[2]);
252 err |= __put_user (s.totalram, &info->totalram);
253 err |= __put_user (s.freeram, &info->freeram);
254 err |= __put_user (s.sharedram, &info->sharedram);
255 err |= __put_user (s.bufferram, &info->bufferram);
256 err |= __put_user (s.totalswap, &info->totalswap);
257 err |= __put_user (s.freeswap, &info->freeswap);
258 err |= __put_user (s.procs, &info->procs);
259 err |= __put_user (s.totalhigh, &info->totalhigh);
260 err |= __put_user (s.freehigh, &info->freehigh);
261 err |= __put_user (s.mem_unit, &info->mem_unit);
262 if (err)
263 return -EFAULT;
264
265 return ret;
266}
267
268 201
269 202
270 203
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 8f5afdbad0d5..194a93eeb3e7 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -150,7 +150,7 @@ void __init disable_early_printk(void)
150{ 150{
151 if (!early_console_initialized) 151 if (!early_console_initialized)
152 return; 152 return;
153 if (strstr(saved_command_line, "udbg-immortal")) { 153 if (strstr(boot_command_line, "udbg-immortal")) {
154 printk(KERN_INFO "early console immortal !\n"); 154 printk(KERN_INFO "early console immortal !\n");
155 return; 155 return;
156 } 156 }
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ae0ede19879d..50149ec6efa4 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -49,9 +49,13 @@
49/* Max supported size for symbol names */ 49/* Max supported size for symbol names */
50#define MAX_SYMNAME 64 50#define MAX_SYMNAME 64
51 51
52#define VDSO32_MAXPAGES (((0x3000 + PAGE_MASK) >> PAGE_SHIFT) + 2)
53#define VDSO64_MAXPAGES (((0x3000 + PAGE_MASK) >> PAGE_SHIFT) + 2)
54
52extern char vdso32_start, vdso32_end; 55extern char vdso32_start, vdso32_end;
53static void *vdso32_kbase = &vdso32_start; 56static void *vdso32_kbase = &vdso32_start;
54unsigned int vdso32_pages; 57unsigned int vdso32_pages;
58static struct page *vdso32_pagelist[VDSO32_MAXPAGES];
55unsigned long vdso32_sigtramp; 59unsigned long vdso32_sigtramp;
56unsigned long vdso32_rt_sigtramp; 60unsigned long vdso32_rt_sigtramp;
57 61
@@ -59,6 +63,7 @@ unsigned long vdso32_rt_sigtramp;
59extern char vdso64_start, vdso64_end; 63extern char vdso64_start, vdso64_end;
60static void *vdso64_kbase = &vdso64_start; 64static void *vdso64_kbase = &vdso64_start;
61unsigned int vdso64_pages; 65unsigned int vdso64_pages;
66static struct page *vdso64_pagelist[VDSO64_MAXPAGES];
62unsigned long vdso64_rt_sigtramp; 67unsigned long vdso64_rt_sigtramp;
63#endif /* CONFIG_PPC64 */ 68#endif /* CONFIG_PPC64 */
64 69
@@ -165,55 +170,6 @@ static void dump_vdso_pages(struct vm_area_struct * vma)
165#endif /* DEBUG */ 170#endif /* DEBUG */
166 171
167/* 172/*
168 * Keep a dummy vma_close for now, it will prevent VMA merging.
169 */
170static void vdso_vma_close(struct vm_area_struct * vma)
171{
172}
173
174/*
175 * Our nopage() function, maps in the actual vDSO kernel pages, they will
176 * be mapped read-only by do_no_page(), and eventually COW'ed, either
177 * right away for an initial write access, or by do_wp_page().
178 */
179static struct page * vdso_vma_nopage(struct vm_area_struct * vma,
180 unsigned long address, int *type)
181{
182 unsigned long offset = address - vma->vm_start;
183 struct page *pg;
184#ifdef CONFIG_PPC64
185 void *vbase = (vma->vm_mm->task_size > TASK_SIZE_USER32) ?
186 vdso64_kbase : vdso32_kbase;
187#else
188 void *vbase = vdso32_kbase;
189#endif
190
191 DBG("vdso_vma_nopage(current: %s, address: %016lx, off: %lx)\n",
192 current->comm, address, offset);
193
194 if (address < vma->vm_start || address > vma->vm_end)
195 return NOPAGE_SIGBUS;
196
197 /*
198 * Last page is systemcfg.
199 */
200 if ((vma->vm_end - address) <= PAGE_SIZE)
201 pg = virt_to_page(vdso_data);
202 else
203 pg = virt_to_page(vbase + offset);
204
205 get_page(pg);
206 DBG(" ->page count: %d\n", page_count(pg));
207
208 return pg;
209}
210
211static struct vm_operations_struct vdso_vmops = {
212 .close = vdso_vma_close,
213 .nopage = vdso_vma_nopage,
214};
215
216/*
217 * This is called from binfmt_elf, we create the special vma for the 173 * This is called from binfmt_elf, we create the special vma for the
218 * vDSO and insert it into the mm struct tree 174 * vDSO and insert it into the mm struct tree
219 */ 175 */
@@ -221,20 +177,23 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
221 int executable_stack) 177 int executable_stack)
222{ 178{
223 struct mm_struct *mm = current->mm; 179 struct mm_struct *mm = current->mm;
224 struct vm_area_struct *vma; 180 struct page **vdso_pagelist;
225 unsigned long vdso_pages; 181 unsigned long vdso_pages;
226 unsigned long vdso_base; 182 unsigned long vdso_base;
227 int rc; 183 int rc;
228 184
229#ifdef CONFIG_PPC64 185#ifdef CONFIG_PPC64
230 if (test_thread_flag(TIF_32BIT)) { 186 if (test_thread_flag(TIF_32BIT)) {
187 vdso_pagelist = vdso32_pagelist;
231 vdso_pages = vdso32_pages; 188 vdso_pages = vdso32_pages;
232 vdso_base = VDSO32_MBASE; 189 vdso_base = VDSO32_MBASE;
233 } else { 190 } else {
191 vdso_pagelist = vdso64_pagelist;
234 vdso_pages = vdso64_pages; 192 vdso_pages = vdso64_pages;
235 vdso_base = VDSO64_MBASE; 193 vdso_base = VDSO64_MBASE;
236 } 194 }
237#else 195#else
196 vdso_pagelist = vdso32_pagelist;
238 vdso_pages = vdso32_pages; 197 vdso_pages = vdso32_pages;
239 vdso_base = VDSO32_MBASE; 198 vdso_base = VDSO32_MBASE;
240#endif 199#endif
@@ -262,17 +221,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
262 goto fail_mmapsem; 221 goto fail_mmapsem;
263 } 222 }
264 223
265
266 /* Allocate a VMA structure and fill it up */
267 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
268 if (vma == NULL) {
269 rc = -ENOMEM;
270 goto fail_mmapsem;
271 }
272 vma->vm_mm = mm;
273 vma->vm_start = vdso_base;
274 vma->vm_end = vma->vm_start + (vdso_pages << PAGE_SHIFT);
275
276 /* 224 /*
277 * our vma flags don't have VM_WRITE so by default, the process isn't 225 * our vma flags don't have VM_WRITE so by default, the process isn't
278 * allowed to write those pages. 226 * allowed to write those pages.
@@ -282,32 +230,26 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
282 * and your nice userland gettimeofday will be totally dead. 230 * and your nice userland gettimeofday will be totally dead.
283 * It's fine to use that for setting breakpoints in the vDSO code 231 * It's fine to use that for setting breakpoints in the vDSO code
284 * pages though 232 * pages though
285 */ 233 *
286 vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC;
287 /*
288 * Make sure the vDSO gets into every core dump. 234 * Make sure the vDSO gets into every core dump.
289 * Dumping its contents makes post-mortem fully interpretable later 235 * Dumping its contents makes post-mortem fully interpretable later
290 * without matching up the same kernel and hardware config to see 236 * without matching up the same kernel and hardware config to see
291 * what PC values meant. 237 * what PC values meant.
292 */ 238 */
293 vma->vm_flags |= VM_ALWAYSDUMP; 239 rc = install_special_mapping(mm, vdso_base, vdso_pages << PAGE_SHIFT,
294 vma->vm_flags |= mm->def_flags; 240 VM_READ|VM_EXEC|
295 vma->vm_page_prot = protection_map[vma->vm_flags & 0x7]; 241 VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
296 vma->vm_ops = &vdso_vmops; 242 VM_ALWAYSDUMP,
297 243 vdso_pagelist);
298 /* Insert new VMA */
299 rc = insert_vm_struct(mm, vma);
300 if (rc) 244 if (rc)
301 goto fail_vma; 245 goto fail_mmapsem;
302 246
303 /* Put vDSO base into mm struct and account for memory usage */ 247 /* Put vDSO base into mm struct */
304 current->mm->context.vdso_base = vdso_base; 248 current->mm->context.vdso_base = vdso_base;
305 mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 249
306 up_write(&mm->mmap_sem); 250 up_write(&mm->mmap_sem);
307 return 0; 251 return 0;
308 252
309 fail_vma:
310 kmem_cache_free(vm_area_cachep, vma);
311 fail_mmapsem: 253 fail_mmapsem:
312 up_write(&mm->mmap_sem); 254 up_write(&mm->mmap_sem);
313 return rc; 255 return rc;
@@ -778,18 +720,26 @@ void __init vdso_init(void)
778 } 720 }
779 721
780 /* Make sure pages are in the correct state */ 722 /* Make sure pages are in the correct state */
723 BUG_ON(vdso32_pages + 2 > VDSO32_MAXPAGES);
781 for (i = 0; i < vdso32_pages; i++) { 724 for (i = 0; i < vdso32_pages; i++) {
782 struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); 725 struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE);
783 ClearPageReserved(pg); 726 ClearPageReserved(pg);
784 get_page(pg); 727 get_page(pg);
785 728 vdso32_pagelist[i] = pg;
786 } 729 }
730 vdso32_pagelist[i++] = virt_to_page(vdso_data);
731 vdso32_pagelist[i] = NULL;
732
787#ifdef CONFIG_PPC64 733#ifdef CONFIG_PPC64
734 BUG_ON(vdso64_pages + 2 > VDSO64_MAXPAGES);
788 for (i = 0; i < vdso64_pages; i++) { 735 for (i = 0; i < vdso64_pages; i++) {
789 struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); 736 struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE);
790 ClearPageReserved(pg); 737 ClearPageReserved(pg);
791 get_page(pg); 738 get_page(pg);
739 vdso64_pagelist[i] = pg;
792 } 740 }
741 vdso64_pagelist[i++] = virt_to_page(vdso_data);
742 vdso64_pagelist[i] = NULL;
793#endif /* CONFIG_PPC64 */ 743#endif /* CONFIG_PPC64 */
794 744
795 get_page(virt_to_page(vdso_data)); 745 get_page(virt_to_page(vdso_data));
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 04b8e71bf5b0..7eefeb4a30e7 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -131,14 +131,14 @@ SECTIONS
131 __stop___fw_ftr_fixup = .; 131 __stop___fw_ftr_fixup = .;
132 } 132 }
133#endif 133#endif
134 134#ifdef CONFIG_BLK_DEV_INITRD
135 . = ALIGN(PAGE_SIZE); 135 . = ALIGN(PAGE_SIZE);
136 .init.ramfs : { 136 .init.ramfs : {
137 __initramfs_start = .; 137 __initramfs_start = .;
138 *(.init.ramfs) 138 *(.init.ramfs)
139 __initramfs_end = .; 139 __initramfs_end = .;
140 } 140 }
141 141#endif
142#ifdef CONFIG_PPC32 142#ifdef CONFIG_PPC32
143 . = ALIGN(32); 143 . = ALIGN(32);
144#else 144#else
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index b43466ba8096..67d617b60a23 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -149,7 +149,8 @@ static int cbe_nr_iommus;
149static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte, 149static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte,
150 long n_ptes) 150 long n_ptes)
151{ 151{
152 unsigned long *reg, val; 152 unsigned long __iomem *reg;
153 unsigned long val;
153 long n; 154 long n;
154 155
155 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd; 156 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd;
@@ -592,7 +593,7 @@ static void __init cell_iommu_init_one(struct device_node *np, unsigned long off
592 /* Init base fields */ 593 /* Init base fields */
593 i = cbe_nr_iommus++; 594 i = cbe_nr_iommus++;
594 iommu = &iommus[i]; 595 iommu = &iommus[i];
595 iommu->stab = 0; 596 iommu->stab = NULL;
596 iommu->nid = nid; 597 iommu->nid = nid;
597 snprintf(iommu->name, sizeof(iommu->name), "iommu%d", i); 598 snprintf(iommu->name, sizeof(iommu->name), "iommu%d", i);
598 INIT_LIST_HEAD(&iommu->windows); 599 INIT_LIST_HEAD(&iommu->windows);
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 347eff56fcbd..af9e9455a706 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -144,7 +144,7 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
144 return 0; 144 return 0;
145} 145}
146 146
147static struct file_operations spufs_mem_fops = { 147static const struct file_operations spufs_mem_fops = {
148 .open = spufs_mem_open, 148 .open = spufs_mem_open,
149 .read = spufs_mem_read, 149 .read = spufs_mem_read,
150 .write = spufs_mem_write, 150 .write = spufs_mem_write,
@@ -249,7 +249,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file)
249 spufs_cntl_set, "0x%08lx"); 249 spufs_cntl_set, "0x%08lx");
250} 250}
251 251
252static struct file_operations spufs_cntl_fops = { 252static const struct file_operations spufs_cntl_fops = {
253 .open = spufs_cntl_open, 253 .open = spufs_cntl_open,
254 .release = simple_attr_close, 254 .release = simple_attr_close,
255 .read = simple_attr_read, 255 .read = simple_attr_read,
@@ -309,7 +309,7 @@ spufs_regs_write(struct file *file, const char __user *buffer,
309 return ret; 309 return ret;
310} 310}
311 311
312static struct file_operations spufs_regs_fops = { 312static const struct file_operations spufs_regs_fops = {
313 .open = spufs_regs_open, 313 .open = spufs_regs_open,
314 .read = spufs_regs_read, 314 .read = spufs_regs_read,
315 .write = spufs_regs_write, 315 .write = spufs_regs_write,
@@ -360,7 +360,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
360 return ret; 360 return ret;
361} 361}
362 362
363static struct file_operations spufs_fpcr_fops = { 363static const struct file_operations spufs_fpcr_fops = {
364 .open = spufs_regs_open, 364 .open = spufs_regs_open,
365 .read = spufs_fpcr_read, 365 .read = spufs_fpcr_read,
366 .write = spufs_fpcr_write, 366 .write = spufs_fpcr_write,
@@ -426,7 +426,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
426 return count; 426 return count;
427} 427}
428 428
429static struct file_operations spufs_mbox_fops = { 429static const struct file_operations spufs_mbox_fops = {
430 .open = spufs_pipe_open, 430 .open = spufs_pipe_open,
431 .read = spufs_mbox_read, 431 .read = spufs_mbox_read,
432}; 432};
@@ -452,7 +452,7 @@ static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf,
452 return 4; 452 return 4;
453} 453}
454 454
455static struct file_operations spufs_mbox_stat_fops = { 455static const struct file_operations spufs_mbox_stat_fops = {
456 .open = spufs_pipe_open, 456 .open = spufs_pipe_open,
457 .read = spufs_mbox_stat_read, 457 .read = spufs_mbox_stat_read,
458}; 458};
@@ -559,7 +559,7 @@ static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait)
559 return mask; 559 return mask;
560} 560}
561 561
562static struct file_operations spufs_ibox_fops = { 562static const struct file_operations spufs_ibox_fops = {
563 .open = spufs_pipe_open, 563 .open = spufs_pipe_open,
564 .read = spufs_ibox_read, 564 .read = spufs_ibox_read,
565 .poll = spufs_ibox_poll, 565 .poll = spufs_ibox_poll,
@@ -585,7 +585,7 @@ static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf,
585 return 4; 585 return 4;
586} 586}
587 587
588static struct file_operations spufs_ibox_stat_fops = { 588static const struct file_operations spufs_ibox_stat_fops = {
589 .open = spufs_pipe_open, 589 .open = spufs_pipe_open,
590 .read = spufs_ibox_stat_read, 590 .read = spufs_ibox_stat_read,
591}; 591};
@@ -692,7 +692,7 @@ static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait)
692 return mask; 692 return mask;
693} 693}
694 694
695static struct file_operations spufs_wbox_fops = { 695static const struct file_operations spufs_wbox_fops = {
696 .open = spufs_pipe_open, 696 .open = spufs_pipe_open,
697 .write = spufs_wbox_write, 697 .write = spufs_wbox_write,
698 .poll = spufs_wbox_poll, 698 .poll = spufs_wbox_poll,
@@ -718,7 +718,7 @@ static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf,
718 return 4; 718 return 4;
719} 719}
720 720
721static struct file_operations spufs_wbox_stat_fops = { 721static const struct file_operations spufs_wbox_stat_fops = {
722 .open = spufs_pipe_open, 722 .open = spufs_pipe_open,
723 .read = spufs_wbox_stat_read, 723 .read = spufs_wbox_stat_read,
724}; 724};
@@ -823,7 +823,7 @@ static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma)
823 return 0; 823 return 0;
824} 824}
825 825
826static struct file_operations spufs_signal1_fops = { 826static const struct file_operations spufs_signal1_fops = {
827 .open = spufs_signal1_open, 827 .open = spufs_signal1_open,
828 .read = spufs_signal1_read, 828 .read = spufs_signal1_read,
829 .write = spufs_signal1_write, 829 .write = spufs_signal1_write,
@@ -934,7 +934,7 @@ static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma)
934#define spufs_signal2_mmap NULL 934#define spufs_signal2_mmap NULL
935#endif /* !SPUFS_MMAP_4K */ 935#endif /* !SPUFS_MMAP_4K */
936 936
937static struct file_operations spufs_signal2_fops = { 937static const struct file_operations spufs_signal2_fops = {
938 .open = spufs_signal2_open, 938 .open = spufs_signal2_open,
939 .read = spufs_signal2_read, 939 .read = spufs_signal2_read,
940 .write = spufs_signal2_write, 940 .write = spufs_signal2_write,
@@ -1037,7 +1037,7 @@ static int spufs_mss_open(struct inode *inode, struct file *file)
1037 return nonseekable_open(inode, file); 1037 return nonseekable_open(inode, file);
1038} 1038}
1039 1039
1040static struct file_operations spufs_mss_fops = { 1040static const struct file_operations spufs_mss_fops = {
1041 .open = spufs_mss_open, 1041 .open = spufs_mss_open,
1042 .mmap = spufs_mss_mmap, 1042 .mmap = spufs_mss_mmap,
1043}; 1043};
@@ -1076,7 +1076,7 @@ static int spufs_psmap_open(struct inode *inode, struct file *file)
1076 return nonseekable_open(inode, file); 1076 return nonseekable_open(inode, file);
1077} 1077}
1078 1078
1079static struct file_operations spufs_psmap_fops = { 1079static const struct file_operations spufs_psmap_fops = {
1080 .open = spufs_psmap_open, 1080 .open = spufs_psmap_open,
1081 .mmap = spufs_psmap_mmap, 1081 .mmap = spufs_psmap_mmap,
1082}; 1082};
@@ -1393,7 +1393,7 @@ static int spufs_mfc_fasync(int fd, struct file *file, int on)
1393 return fasync_helper(fd, file, on, &ctx->mfc_fasync); 1393 return fasync_helper(fd, file, on, &ctx->mfc_fasync);
1394} 1394}
1395 1395
1396static struct file_operations spufs_mfc_fops = { 1396static const struct file_operations spufs_mfc_fops = {
1397 .open = spufs_mfc_open, 1397 .open = spufs_mfc_open,
1398 .read = spufs_mfc_read, 1398 .read = spufs_mfc_read,
1399 .write = spufs_mfc_write, 1399 .write = spufs_mfc_write,
@@ -1650,7 +1650,7 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf,
1650 return ret; 1650 return ret;
1651} 1651}
1652 1652
1653static struct file_operations spufs_mbox_info_fops = { 1653static const struct file_operations spufs_mbox_info_fops = {
1654 .open = spufs_info_open, 1654 .open = spufs_info_open,
1655 .read = spufs_mbox_info_read, 1655 .read = spufs_mbox_info_read,
1656 .llseek = generic_file_llseek, 1656 .llseek = generic_file_llseek,
@@ -1688,7 +1688,7 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf,
1688 return ret; 1688 return ret;
1689} 1689}
1690 1690
1691static struct file_operations spufs_ibox_info_fops = { 1691static const struct file_operations spufs_ibox_info_fops = {
1692 .open = spufs_info_open, 1692 .open = spufs_info_open,
1693 .read = spufs_ibox_info_read, 1693 .read = spufs_ibox_info_read,
1694 .llseek = generic_file_llseek, 1694 .llseek = generic_file_llseek,
@@ -1729,7 +1729,7 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf,
1729 return ret; 1729 return ret;
1730} 1730}
1731 1731
1732static struct file_operations spufs_wbox_info_fops = { 1732static const struct file_operations spufs_wbox_info_fops = {
1733 .open = spufs_info_open, 1733 .open = spufs_info_open,
1734 .read = spufs_wbox_info_read, 1734 .read = spufs_wbox_info_read,
1735 .llseek = generic_file_llseek, 1735 .llseek = generic_file_llseek,
@@ -1779,7 +1779,7 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf,
1779 return ret; 1779 return ret;
1780} 1780}
1781 1781
1782static struct file_operations spufs_dma_info_fops = { 1782static const struct file_operations spufs_dma_info_fops = {
1783 .open = spufs_info_open, 1783 .open = spufs_info_open,
1784 .read = spufs_dma_info_read, 1784 .read = spufs_dma_info_read,
1785}; 1785};
@@ -1830,7 +1830,7 @@ static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf,
1830 return ret; 1830 return ret;
1831} 1831}
1832 1832
1833static struct file_operations spufs_proxydma_info_fops = { 1833static const struct file_operations spufs_proxydma_info_fops = {
1834 .open = spufs_info_open, 1834 .open = spufs_info_open,
1835 .read = spufs_proxydma_info_read, 1835 .read = spufs_proxydma_info_read,
1836}; 1836};
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 738b9244382f..8079983ef94f 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -220,11 +220,11 @@ static int spufs_dir_close(struct inode *inode, struct file *file)
220 return dcache_dir_close(inode, file); 220 return dcache_dir_close(inode, file);
221} 221}
222 222
223struct inode_operations spufs_dir_inode_operations = { 223const struct inode_operations spufs_dir_inode_operations = {
224 .lookup = simple_lookup, 224 .lookup = simple_lookup,
225}; 225};
226 226
227struct file_operations spufs_context_fops = { 227const struct file_operations spufs_context_fops = {
228 .open = dcache_dir_open, 228 .open = dcache_dir_open,
229 .release = spufs_dir_close, 229 .release = spufs_dir_close,
230 .llseek = dcache_dir_lseek, 230 .llseek = dcache_dir_lseek,
@@ -372,7 +372,7 @@ static int spufs_gang_close(struct inode *inode, struct file *file)
372 return dcache_dir_close(inode, file); 372 return dcache_dir_close(inode, file);
373} 373}
374 374
375struct file_operations spufs_gang_fops = { 375const struct file_operations spufs_gang_fops = {
376 .open = dcache_dir_open, 376 .open = dcache_dir_open,
377 .release = spufs_gang_close, 377 .release = spufs_gang_close,
378 .llseek = dcache_dir_lseek, 378 .llseek = dcache_dir_lseek,
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 70fb13395c04..56864469215e 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -149,7 +149,7 @@ long spufs_run_spu(struct file *file,
149 struct spu_context *ctx, u32 *npc, u32 *status); 149 struct spu_context *ctx, u32 *npc, u32 *status);
150long spufs_create(struct nameidata *nd, 150long spufs_create(struct nameidata *nd,
151 unsigned int flags, mode_t mode); 151 unsigned int flags, mode_t mode);
152extern struct file_operations spufs_context_fops; 152extern const struct file_operations spufs_context_fops;
153 153
154/* gang management */ 154/* gang management */
155struct spu_gang *alloc_spu_gang(void); 155struct spu_gang *alloc_spu_gang(void);
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index 867f83a7d0c9..98de836dfed3 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -65,13 +65,13 @@ static inline u8 celleb_fake_config_readb(void *addr)
65 65
66static inline u16 celleb_fake_config_readw(void *addr) 66static inline u16 celleb_fake_config_readw(void *addr)
67{ 67{
68 u16 *p = addr; 68 __le16 *p = addr;
69 return le16_to_cpu(*p); 69 return le16_to_cpu(*p);
70} 70}
71 71
72static inline u32 celleb_fake_config_readl(void *addr) 72static inline u32 celleb_fake_config_readl(void *addr)
73{ 73{
74 u32 *p = addr; 74 __le32 *p = addr;
75 return le32_to_cpu(*p); 75 return le32_to_cpu(*p);
76} 76}
77 77
@@ -83,16 +83,16 @@ static inline void celleb_fake_config_writeb(u32 val, void *addr)
83 83
84static inline void celleb_fake_config_writew(u32 val, void *addr) 84static inline void celleb_fake_config_writew(u32 val, void *addr)
85{ 85{
86 u16 val16; 86 __le16 val16;
87 u16 *p = addr; 87 __le16 *p = addr;
88 val16 = cpu_to_le16(val); 88 val16 = cpu_to_le16(val);
89 *p = val16; 89 *p = val16;
90} 90}
91 91
92static inline void celleb_fake_config_writel(u32 val, void *addr) 92static inline void celleb_fake_config_writel(u32 val, void *addr)
93{ 93{
94 u32 val32; 94 __le32 val32;
95 u32 *p = addr; 95 __le32 *p = addr;
96 val32 = cpu_to_le32(val); 96 val32 = cpu_to_le32(val);
97 *p = val32; 97 *p = val32;
98} 98}
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index 0edbc0c4f338..c11b39c3776a 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -47,7 +47,7 @@
47#if 0 /* test code for epci dummy read */ 47#if 0 /* test code for epci dummy read */
48static void celleb_epci_dummy_read(struct pci_dev *dev) 48static void celleb_epci_dummy_read(struct pci_dev *dev)
49{ 49{
50 void *epci_base; 50 void __iomem *epci_base;
51 struct device_node *node; 51 struct device_node *node;
52 struct pci_controller *hose; 52 struct pci_controller *hose;
53 u32 val; 53 u32 val;
@@ -58,7 +58,7 @@ static void celleb_epci_dummy_read(struct pci_dev *dev)
58 if (!hose) 58 if (!hose)
59 return; 59 return;
60 60
61 epci_base = (void *)hose->cfg_addr; 61 epci_base = hose->cfg_addr;
62 62
63 val = in_be32(epci_base + SCC_EPCI_WATRP); 63 val = in_be32(epci_base + SCC_EPCI_WATRP);
64 iosync(); 64 iosync();
@@ -71,18 +71,18 @@ static inline void clear_and_disable_master_abort_interrupt(
71 struct pci_controller *hose) 71 struct pci_controller *hose)
72{ 72{
73 void __iomem *addr; 73 void __iomem *addr;
74 addr = (void *)hose->cfg_addr + PCI_COMMAND; 74 addr = hose->cfg_addr + PCI_COMMAND;
75 out_be32(addr, in_be32(addr) | (PCI_STATUS_REC_MASTER_ABORT << 16)); 75 out_be32(addr, in_be32(addr) | (PCI_STATUS_REC_MASTER_ABORT << 16));
76} 76}
77 77
78static int celleb_epci_check_abort(struct pci_controller *hose, 78static int celleb_epci_check_abort(struct pci_controller *hose,
79 unsigned long addr) 79 void __iomem *addr)
80{ 80{
81 void __iomem *reg, *epci_base; 81 void __iomem *reg, *epci_base;
82 u32 val; 82 u32 val;
83 83
84 iob(); 84 iob();
85 epci_base = (void *)hose->cfg_addr; 85 epci_base = hose->cfg_addr;
86 86
87 reg = epci_base + PCI_COMMAND; 87 reg = epci_base + PCI_COMMAND;
88 val = in_be32(reg); 88 val = in_be32(reg);
@@ -108,23 +108,23 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
108 return PCIBIOS_SUCCESSFUL; 108 return PCIBIOS_SUCCESSFUL;
109} 109}
110 110
111static unsigned long celleb_epci_make_config_addr(struct pci_controller *hose, 111static void __iomem *celleb_epci_make_config_addr(struct pci_controller *hose,
112 unsigned int devfn, int where) 112 unsigned int devfn, int where)
113{ 113{
114 unsigned long addr; 114 void __iomem *addr;
115 struct pci_bus *bus = hose->bus; 115 struct pci_bus *bus = hose->bus;
116 116
117 if (bus->self) 117 if (bus->self)
118 addr = (unsigned long)hose->cfg_data + 118 addr = hose->cfg_data +
119 (((bus->number & 0xff) << 16) 119 (((bus->number & 0xff) << 16)
120 | ((devfn & 0xff) << 8) 120 | ((devfn & 0xff) << 8)
121 | (where & 0xff) 121 | (where & 0xff)
122 | 0x01000000); 122 | 0x01000000);
123 else 123 else
124 addr = (unsigned long)hose->cfg_data + 124 addr = hose->cfg_data +
125 (((devfn & 0xff) << 8) | (where & 0xff)); 125 (((devfn & 0xff) << 8) | (where & 0xff));
126 126
127 pr_debug("EPCI: config_addr = 0x%016lx\n", addr); 127 pr_debug("EPCI: config_addr = 0x%p\n", addr);
128 128
129 return addr; 129 return addr;
130} 130}
@@ -132,7 +132,7 @@ static unsigned long celleb_epci_make_config_addr(struct pci_controller *hose,
132static int celleb_epci_read_config(struct pci_bus *bus, 132static int celleb_epci_read_config(struct pci_bus *bus,
133 unsigned int devfn, int where, int size, u32 * val) 133 unsigned int devfn, int where, int size, u32 * val)
134{ 134{
135 unsigned long addr; 135 void __iomem *addr;
136 struct device_node *node; 136 struct device_node *node;
137 struct pci_controller *hose; 137 struct pci_controller *hose;
138 138
@@ -148,17 +148,17 @@ static int celleb_epci_read_config(struct pci_bus *bus,
148 if (bus->number == hose->first_busno && devfn == 0) { 148 if (bus->number == hose->first_busno && devfn == 0) {
149 /* EPCI controller self */ 149 /* EPCI controller self */
150 150
151 addr = (unsigned long)hose->cfg_addr + where; 151 addr = hose->cfg_addr + where;
152 152
153 switch (size) { 153 switch (size) {
154 case 1: 154 case 1:
155 *val = in_8((u8 *)addr); 155 *val = in_8(addr);
156 break; 156 break;
157 case 2: 157 case 2:
158 *val = in_be16((u16 *)addr); 158 *val = in_be16(addr);
159 break; 159 break;
160 case 4: 160 case 4:
161 *val = in_be32((u32 *)addr); 161 *val = in_be32(addr);
162 break; 162 break;
163 default: 163 default:
164 return PCIBIOS_DEVICE_NOT_FOUND; 164 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -171,13 +171,13 @@ static int celleb_epci_read_config(struct pci_bus *bus,
171 171
172 switch (size) { 172 switch (size) {
173 case 1: 173 case 1:
174 *val = in_8((u8 *)addr); 174 *val = in_8(addr);
175 break; 175 break;
176 case 2: 176 case 2:
177 *val = in_le16((u16 *)addr); 177 *val = in_le16(addr);
178 break; 178 break;
179 case 4: 179 case 4:
180 *val = in_le32((u32 *)addr); 180 *val = in_le32(addr);
181 break; 181 break;
182 default: 182 default:
183 return PCIBIOS_DEVICE_NOT_FOUND; 183 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -188,13 +188,13 @@ static int celleb_epci_read_config(struct pci_bus *bus,
188 "addr=0x%lx, devfn=0x%x, where=0x%x, size=0x%x, val=0x%x\n", 188 "addr=0x%lx, devfn=0x%x, where=0x%x, size=0x%x, val=0x%x\n",
189 addr, devfn, where, size, *val); 189 addr, devfn, where, size, *val);
190 190
191 return celleb_epci_check_abort(hose, 0); 191 return celleb_epci_check_abort(hose, NULL);
192} 192}
193 193
194static int celleb_epci_write_config(struct pci_bus *bus, 194static int celleb_epci_write_config(struct pci_bus *bus,
195 unsigned int devfn, int where, int size, u32 val) 195 unsigned int devfn, int where, int size, u32 val)
196{ 196{
197 unsigned long addr; 197 void __iomem *addr;
198 struct device_node *node; 198 struct device_node *node;
199 struct pci_controller *hose; 199 struct pci_controller *hose;
200 200
@@ -210,17 +210,17 @@ static int celleb_epci_write_config(struct pci_bus *bus,
210 if (bus->number == hose->first_busno && devfn == 0) { 210 if (bus->number == hose->first_busno && devfn == 0) {
211 /* EPCI controller self */ 211 /* EPCI controller self */
212 212
213 addr = (unsigned long)hose->cfg_addr + where; 213 addr = hose->cfg_addr + where;
214 214
215 switch (size) { 215 switch (size) {
216 case 1: 216 case 1:
217 out_8((u8 *)addr, val); 217 out_8(addr, val);
218 break; 218 break;
219 case 2: 219 case 2:
220 out_be16((u16 *)addr, val); 220 out_be16(addr, val);
221 break; 221 break;
222 case 4: 222 case 4:
223 out_be32((u32 *)addr, val); 223 out_be32(addr, val);
224 break; 224 break;
225 default: 225 default:
226 return PCIBIOS_DEVICE_NOT_FOUND; 226 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -233,13 +233,13 @@ static int celleb_epci_write_config(struct pci_bus *bus,
233 233
234 switch (size) { 234 switch (size) {
235 case 1: 235 case 1:
236 out_8((u8 *)addr, val); 236 out_8(addr, val);
237 break; 237 break;
238 case 2: 238 case 2:
239 out_le16((u16 *)addr, val); 239 out_le16(addr, val);
240 break; 240 break;
241 case 4: 241 case 4:
242 out_le32((u32 *)addr, val); 242 out_le32(addr, val);
243 break; 243 break;
244 default: 244 default:
245 return PCIBIOS_DEVICE_NOT_FOUND; 245 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -261,7 +261,7 @@ static int __devinit celleb_epci_init(struct pci_controller *hose)
261 void __iomem *reg, *epci_base; 261 void __iomem *reg, *epci_base;
262 int hwres = 0; 262 int hwres = 0;
263 263
264 epci_base = (void *)hose->cfg_addr; 264 epci_base = hose->cfg_addr;
265 265
266 /* PCI core reset(Internal bus and PCI clock) */ 266 /* PCI core reset(Internal bus and PCI clock) */
267 reg = epci_base + SCC_EPCI_CKCTRL; 267 reg = epci_base + SCC_EPCI_CKCTRL;
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index e1f51d455984..117c9a0055bd 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -75,7 +75,7 @@ extern irqreturn_t xmon_irq(int, void *);
75extern unsigned long loops_per_jiffy; 75extern unsigned long loops_per_jiffy;
76 76
77/* To be replaced by RTAS when available */ 77/* To be replaced by RTAS when available */
78static unsigned int *briq_SPOR; 78static unsigned int __iomem *briq_SPOR;
79 79
80#ifdef CONFIG_SMP 80#ifdef CONFIG_SMP
81extern struct smp_ops_t chrp_smp_ops; 81extern struct smp_ops_t chrp_smp_ops;
@@ -267,7 +267,7 @@ void __init chrp_setup_arch(void)
267 } else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) { 267 } else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) {
268 _chrp_type = _CHRP_briq; 268 _chrp_type = _CHRP_briq;
269 /* Map the SPOR register on briq and change the restart hook */ 269 /* Map the SPOR register on briq and change the restart hook */
270 briq_SPOR = (unsigned int *)ioremap(0xff0000e8, 4); 270 briq_SPOR = ioremap(0xff0000e8, 4);
271 ppc_md.restart = briq_restart; 271 ppc_md.restart = briq_restart;
272 } else { 272 } else {
273 /* Let's assume it is an IBM chrp if all else fails */ 273 /* Let's assume it is an IBM chrp if all else fails */
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index c1f4502a3c6a..91df52a1899a 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -308,7 +308,7 @@ static int proc_lpevents_open(struct inode *inode, struct file *file)
308 return single_open(file, proc_lpevents_show, NULL); 308 return single_open(file, proc_lpevents_show, NULL);
309} 309}
310 310
311static struct file_operations proc_lpevents_operations = { 311static const struct file_operations proc_lpevents_operations = {
312 .open = proc_lpevents_open, 312 .open = proc_lpevents_open,
313 .read = seq_read, 313 .read = seq_read,
314 .llseek = seq_lseek, 314 .llseek = seq_lseek,
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 1ad0e4aaad1a..b1187d95e3b2 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1224,7 +1224,7 @@ out:
1224 return rc; 1224 return rc;
1225} 1225}
1226 1226
1227static struct file_operations proc_vmlinux_operations = { 1227static const struct file_operations proc_vmlinux_operations = {
1228 .write = proc_mf_change_vmlinux, 1228 .write = proc_mf_change_vmlinux,
1229}; 1229};
1230 1230
@@ -1253,7 +1253,6 @@ static int __init mf_proc_init(void)
1253 ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf); 1253 ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf);
1254 if (!ent) 1254 if (!ent)
1255 return 1; 1255 return 1;
1256 ent->nlink = 1;
1257 ent->data = (void *)(long)i; 1256 ent->data = (void *)(long)i;
1258 ent->read_proc = proc_mf_dump_cmdline; 1257 ent->read_proc = proc_mf_dump_cmdline;
1259 ent->write_proc = proc_mf_change_cmdline; 1258 ent->write_proc = proc_mf_change_cmdline;
@@ -1264,7 +1263,6 @@ static int __init mf_proc_init(void)
1264 ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf); 1263 ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf);
1265 if (!ent) 1264 if (!ent)
1266 return 1; 1265 return 1;
1267 ent->nlink = 1;
1268 ent->data = (void *)(long)i; 1266 ent->data = (void *)(long)i;
1269 ent->proc_fops = &proc_vmlinux_operations; 1267 ent->proc_fops = &proc_vmlinux_operations;
1270 } 1268 }
@@ -1272,7 +1270,6 @@ static int __init mf_proc_init(void)
1272 ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); 1270 ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
1273 if (!ent) 1271 if (!ent)
1274 return 1; 1272 return 1;
1275 ent->nlink = 1;
1276 ent->data = (void *)0; 1273 ent->data = (void *)0;
1277 ent->read_proc = proc_mf_dump_side; 1274 ent->read_proc = proc_mf_dump_side;
1278 ent->write_proc = proc_mf_change_side; 1275 ent->write_proc = proc_mf_change_side;
@@ -1280,7 +1277,6 @@ static int __init mf_proc_init(void)
1280 ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); 1277 ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
1281 if (!ent) 1278 if (!ent)
1282 return 1; 1279 return 1;
1283 ent->nlink = 1;
1284 ent->data = (void *)0; 1280 ent->data = (void *)0;
1285 ent->read_proc = proc_mf_dump_src; 1281 ent->read_proc = proc_mf_dump_src;
1286 ent->write_proc = proc_mf_change_src; 1282 ent->write_proc = proc_mf_change_src;
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index b54e37101e69..f2cde4180204 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -101,7 +101,7 @@ static int proc_titantod_open(struct inode *inode, struct file *file)
101 return single_open(file, proc_titantod_show, NULL); 101 return single_open(file, proc_titantod_show, NULL);
102} 102}
103 103
104static struct file_operations proc_titantod_operations = { 104static const struct file_operations proc_titantod_operations = {
105 .open = proc_titantod_open, 105 .open = proc_titantod_open,
106 .read = seq_read, 106 .read = seq_read,
107 .llseek = seq_lseek, 107 .llseek = seq_lseek,
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index a6799ed34a66..e2100ece9c65 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -173,7 +173,7 @@ static int proc_viopath_open(struct inode *inode, struct file *file)
173 return single_open(file, proc_viopath_show, NULL); 173 return single_open(file, proc_viopath_show, NULL);
174} 174}
175 175
176static struct file_operations proc_viopath_operations = { 176static const struct file_operations proc_viopath_operations = {
177 .open = proc_viopath_open, 177 .open = proc_viopath_open,
178 .read = seq_read, 178 .read = seq_read,
179 .llseek = seq_lseek, 179 .llseek = seq_lseek,
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index d949e9df41ef..651fa424ea06 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -506,8 +506,8 @@ void note_bootable_part(dev_t dev, int part, int goodness)
506 if ((goodness <= current_root_goodness) && 506 if ((goodness <= current_root_goodness) &&
507 ROOT_DEV != DEFAULT_ROOT_DEVICE) 507 ROOT_DEV != DEFAULT_ROOT_DEVICE)
508 return; 508 return;
509 p = strstr(saved_command_line, "root="); 509 p = strstr(boot_command_line, "root=");
510 if (p != NULL && (p == saved_command_line || p[-1] == ' ')) 510 if (p != NULL && (p == boot_command_line || p[-1] == ' '))
511 return; 511 return;
512 512
513 if (!found_boot) { 513 if (!found_boot) {
diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig
index de52ec4e9e58..4be3943d1c0d 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -51,4 +51,15 @@ config PS3_VUART
51 including the System Manager and AV Settings. In 51 including the System Manager and AV Settings. In
52 general, all users will say Y. 52 general, all users will say Y.
53 53
54config PS3_PS3AV
55 tristate "PS3 AV settings driver"
56 depends on PPC_PS3
57 select PS3_VUART
58 default y
59 help
60 Include support for the PS3 AV Settings driver.
61
62 This support is required for graphics and sound. In
63 general, all users will say Y or M.
64
54endmenu 65endmenu
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c
index a4b5a1bc60f4..e12e59fea13a 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -2,7 +2,7 @@
2 * PS3 pagetable management routines. 2 * PS3 pagetable management routines.
3 * 3 *
4 * Copyright (C) 2006 Sony Computer Entertainment Inc. 4 * Copyright (C) 2006 Sony Computer Entertainment Inc.
5 * Copyright 2006 Sony Corp. 5 * Copyright 2006, 2007 Sony Corporation
6 * 6 *
7 * 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
8 * 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
@@ -24,6 +24,7 @@
24#include <asm/lmb.h> 24#include <asm/lmb.h>
25#include <asm/udbg.h> 25#include <asm/udbg.h>
26#include <asm/lv1call.h> 26#include <asm/lv1call.h>
27#include <asm/ps3fb.h>
27 28
28#include "platform.h" 29#include "platform.h"
29 30
@@ -233,6 +234,9 @@ static void ps3_hpte_invalidate(unsigned long slot, unsigned long va,
233 234
234static void ps3_hpte_clear(void) 235static void ps3_hpte_clear(void)
235{ 236{
237 /* Make sure to clean up the frame buffer device first */
238 ps3fb_cleanup();
239
236 lv1_unmap_htab(htab_addr); 240 lv1_unmap_htab(htab_addr);
237} 241}
238 242
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index bb17283275aa..631c30095617 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -194,6 +194,7 @@ int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
194 194
195 return result; 195 return result;
196} 196}
197EXPORT_SYMBOL_GPL(ps3_alloc_io_irq);
197 198
198int ps3_free_io_irq(unsigned int virq) 199int ps3_free_io_irq(unsigned int virq)
199{ 200{
@@ -209,6 +210,7 @@ int ps3_free_io_irq(unsigned int virq)
209 210
210 return result; 211 return result;
211} 212}
213EXPORT_SYMBOL_GPL(ps3_free_io_irq);
212 214
213/** 215/**
214 * ps3_alloc_event_irq - Allocate a virq for use with a system event. 216 * ps3_alloc_event_irq - Allocate a virq for use with a system event.
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index e62505e18813..13d669a8ecae 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -24,6 +24,7 @@
24#include <linux/root_dev.h> 24#include <linux/root_dev.h>
25#include <linux/console.h> 25#include <linux/console.h>
26#include <linux/kexec.h> 26#include <linux/kexec.h>
27#include <linux/bootmem.h>
27 28
28#include <asm/machdep.h> 29#include <asm/machdep.h>
29#include <asm/firmware.h> 30#include <asm/firmware.h>
@@ -80,6 +81,46 @@ static void ps3_panic(char *str)
80 for (;;) ; 81 for (;;) ;
81} 82}
82 83
84
85static void prealloc(struct ps3_prealloc *p)
86{
87 if (!p->size)
88 return;
89
90 p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
91 if (!p->address) {
92 printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,
93 p->name);
94 return;
95 }
96
97 printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
98 p->address);
99}
100
101#ifdef CONFIG_FB_PS3
102struct ps3_prealloc ps3fb_videomemory = {
103 .name = "ps3fb videomemory",
104 .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024,
105 .align = 1024*1024 /* the GPU requires 1 MiB alignment */
106};
107#define prealloc_ps3fb_videomemory() prealloc(&ps3fb_videomemory)
108
109static int __init early_parse_ps3fb(char *p)
110{
111 if (!p)
112 return 1;
113
114 ps3fb_videomemory.size = _ALIGN_UP(memparse(p, &p),
115 ps3fb_videomemory.align);
116 return 0;
117}
118early_param("ps3fb", early_parse_ps3fb);
119#else
120#define prealloc_ps3fb_videomemory() do { } while (0)
121#endif
122
123
83static void __init ps3_setup_arch(void) 124static void __init ps3_setup_arch(void)
84{ 125{
85 union ps3_firmware_version v; 126 union ps3_firmware_version v;
@@ -101,6 +142,7 @@ static void __init ps3_setup_arch(void)
101 conswitchp = &dummy_con; 142 conswitchp = &dummy_con;
102#endif 143#endif
103 144
145 prealloc_ps3fb_videomemory();
104 ppc_md.power_save = ps3_power_save; 146 ppc_md.power_save = ps3_power_save;
105 147
106 DBG(" <- %s:%d\n", __func__, __LINE__); 148 DBG(" <- %s:%d\n", __func__, __LINE__);
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index bce6136cbce7..a9f7e4a39a2a 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -57,6 +57,7 @@ int ps3_mmio_region_create(struct ps3_mmio_region *r)
57 dump_mmio_region(r); 57 dump_mmio_region(r);
58 return result; 58 return result;
59} 59}
60EXPORT_SYMBOL_GPL(ps3_mmio_region_create);
60 61
61int ps3_free_mmio_region(struct ps3_mmio_region *r) 62int ps3_free_mmio_region(struct ps3_mmio_region *r)
62{ 63{
@@ -72,6 +73,7 @@ int ps3_free_mmio_region(struct ps3_mmio_region *r)
72 r->lpar_addr = 0; 73 r->lpar_addr = 0;
73 return result; 74 return result;
74} 75}
76EXPORT_SYMBOL_GPL(ps3_free_mmio_region);
75 77
76static int ps3_system_bus_match(struct device *_dev, 78static int ps3_system_bus_match(struct device *_dev,
77 struct device_driver *_drv) 79 struct device_driver *_drv)
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 9437f48cc9e7..6cedbc002e0f 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1078,7 +1078,7 @@ static int proc_eeh_open(struct inode *inode, struct file *file)
1078 return single_open(file, proc_eeh_show, NULL); 1078 return single_open(file, proc_eeh_show, NULL);
1079} 1079}
1080 1080
1081static struct file_operations proc_eeh_operations = { 1081static const struct file_operations proc_eeh_operations = {
1082 .open = proc_eeh_open, 1082 .open = proc_eeh_open,
1083 .read = seq_read, 1083 .read = seq_read,
1084 .llseek = seq_lseek, 1084 .llseek = seq_lseek,
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 3ddc04925d50..eae51ef9af24 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -90,7 +90,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file)
90 return rc; 90 return rc;
91} 91}
92 92
93static struct file_operations hcall_inst_seq_fops = { 93static const struct file_operations hcall_inst_seq_fops = {
94 .open = hcall_inst_seq_open, 94 .open = hcall_inst_seq_open,
95 .read = seq_read, 95 .read = seq_read,
96 .llseek = seq_lseek, 96 .llseek = seq_lseek,
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 4ad33e41b008..5aa97aff3391 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -499,7 +499,7 @@ out:
499 return rv ? rv : count; 499 return rv ? rv : count;
500} 500}
501 501
502static struct file_operations ofdt_fops = { 502static const struct file_operations ofdt_fops = {
503 .write = ofdt_write 503 .write = ofdt_write
504}; 504};
505 505
@@ -513,7 +513,6 @@ static int proc_ppc64_create_ofdt(void)
513 513
514 ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); 514 ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
515 if (ent) { 515 if (ent) {
516 ent->nlink = 1;
517 ent->data = NULL; 516 ent->data = NULL;
518 ent->size = 0; 517 ent->size = 0;
519 ent->proc_fops = &ofdt_fops; 518 ent->proc_fops = &ofdt_fops;
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index 8ca2612221d6..77d0937d5c07 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -331,7 +331,7 @@ static unsigned int rtas_log_poll(struct file *file, poll_table * wait)
331 return 0; 331 return 0;
332} 332}
333 333
334struct file_operations proc_rtas_log_operations = { 334const struct file_operations proc_rtas_log_operations = {
335 .read = rtas_log_read, 335 .read = rtas_log_read,
336 .poll = rtas_log_poll, 336 .poll = rtas_log_poll,
337 .open = rtas_log_open, 337 .open = rtas_log_open,
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c
index 45368a57d7dd..8e1ef168e2dd 100644
--- a/arch/powerpc/platforms/pseries/scanlog.c
+++ b/arch/powerpc/platforms/pseries/scanlog.c
@@ -184,7 +184,7 @@ static int scanlog_release(struct inode * inode, struct file * file)
184 return 0; 184 return 0;
185} 185}
186 186
187struct file_operations scanlog_fops = { 187const struct file_operations scanlog_fops = {
188 .owner = THIS_MODULE, 188 .owner = THIS_MODULE,
189 .read = scanlog_read, 189 .read = scanlog_read,
190 .write = scanlog_write, 190 .write = scanlog_write,
diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c
index ee929c641bf3..e5f89837c82e 100644
--- a/arch/powerpc/xmon/spu-dis.c
+++ b/arch/powerpc/xmon/spu-dis.c
@@ -85,7 +85,7 @@ get_index_for_opcode (unsigned int insn)
85 if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0) 85 if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0)
86 return index; 86 return index;
87 87
88 return 0; 88 return NULL;
89} 89}
90 90
91/* Print a Spu instruction. */ 91/* Print a Spu instruction. */