diff options
Diffstat (limited to 'arch')
107 files changed, 322 insertions, 188 deletions
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 1aea7c7c683..d352c2b05f1 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -122,7 +122,7 @@ static void get_sysnames(unsigned long, unsigned long, unsigned long, char **, char **); static void determine_cpu_caches (unsigned int); -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; /* * The format of "screen_info" is strange, and due to early @@ -547,7 +547,7 @@ setup_arch(char **cmdline_p) } else { strlcpy(command_line, COMMAND_LINE, sizeof command_line); } - strcpy(saved_command_line, command_line); + strcpy(boot_command_line, command_line); *cmdline_p = command_line; /* @@ -589,7 +589,7 @@ setup_arch(char **cmdline_p) } /* Replace the command line, now that we've killed it with strsep. */ - strcpy(command_line, saved_command_line); + strcpy(command_line, boot_command_line); /* If we want SRM console printk echoing early, do it now. */ if (alpha_using_srm && srmcons_output) { diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c index 4e5445cfb0e..bf1075e1f57 100644 --- a/arch/arm/common/rtctime.c +++ b/arch/arm/common/rtctime.c @@ -329,7 +329,7 @@ static int rtc_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &rtc_async_queue); } -static struct file_operations rtc_fops = { +static const struct file_operations rtc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rtc_read, diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index bbab134cd82..ed522151878 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -106,7 +106,7 @@ unsigned long phys_initrd_size __initdata = 0; static struct meminfo meminfo __initdata = { 0, }; static const char *cpu_name; static const char *machine_name; -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; @@ -803,8 +803,8 @@ void __init setup_arch(char **cmdline_p) init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - memcpy(saved_command_line, from, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(boot_command_line, from, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; parse_cmdline(cmdline_p, from); paging_init(&meminfo, mdesc); request_standard_resources(&meminfo, mdesc); diff --git a/arch/arm/mach-at91rm9200/clock.c b/arch/arm/mach-at91rm9200/clock.c index 4dee21fefe5..36a8e4d1cc6 100644 --- a/arch/arm/mach-at91rm9200/clock.c +++ b/arch/arm/mach-at91rm9200/clock.c @@ -407,7 +407,7 @@ static int at91_clk_open(struct inode *inode, struct file *file) return single_open(file, at91_clk_show, NULL); } -static struct file_operations at91_clk_operations = { +static const struct file_operations at91_clk_operations = { .open = at91_clk_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c index af22659c8a2..15eb5b6b29f 100644 --- a/arch/arm/mach-at91rm9200/gpio.c +++ b/arch/arm/mach-at91rm9200/gpio.c @@ -65,6 +65,24 @@ static inline unsigned pin_to_mask(unsigned pin) /* + * mux the pin to the "GPIO" peripheral role. + */ +int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup) +{ + void __iomem *pio = pin_to_controller(pin); + unsigned mask = pin_to_mask(pin); + + if (!pio) + return -EINVAL; + __raw_writel(mask, pio + PIO_IDR); + __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR)); + __raw_writel(mask, pio + PIO_PER); + return 0; +} +EXPORT_SYMBOL(at91_set_GPIO_periph); + + +/* * mux the pin to the "A" internal peripheral role. */ int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup) @@ -181,6 +199,36 @@ EXPORT_SYMBOL(at91_set_multi_drive); /*--------------------------------------------------------------------------*/ +/* new-style GPIO calls; these expect at91_set_GPIO_periph to have been + * called, and maybe at91_set_multi_drive() for putout pins. + */ + +int gpio_direction_input(unsigned pin) +{ + void __iomem *pio = pin_to_controller(pin); + unsigned mask = pin_to_mask(pin); + + if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) + return -EINVAL; + __raw_writel(mask, pio + PIO_OER); + return 0; +} +EXPORT_SYMBOL(gpio_direction_input); + +int gpio_direction_output(unsigned pin) +{ + void __iomem *pio = pin_to_controller(pin); + unsigned mask = pin_to_mask(pin); + + if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) + return -EINVAL; + __raw_writel(mask, pio + PIO_OER); + return 0; +} +EXPORT_SYMBOL(gpio_direction_output); + +/*--------------------------------------------------------------------------*/ + /* * assuming the pin is muxed as a gpio output, set its value. */ diff --git a/arch/arm26/kernel/setup.c b/arch/arm26/kernel/setup.c index 466ddb54b44..0e006c6cd5a 100644 --- a/arch/arm26/kernel/setup.c +++ b/arch/arm26/kernel/setup.c @@ -80,7 +80,7 @@ unsigned long phys_initrd_size __initdata = 0; static struct meminfo meminfo __initdata = { 0, }; static struct proc_info_item proc_info; static const char *machine_name; -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; @@ -492,8 +492,8 @@ void __init setup_arch(char **cmdline_p) init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - memcpy(saved_command_line, from, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(boot_command_line, from, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; parse_cmdline(&meminfo, cmdline_p, from); bootmem_init(&meminfo); paging_init(&meminfo); diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c index c6734aefb55..a1a7c3c3f52 100644 --- a/arch/avr32/kernel/setup.c +++ b/arch/avr32/kernel/setup.c @@ -45,7 +45,7 @@ struct avr32_cpuinfo boot_cpu_data = { }; EXPORT_SYMBOL(boot_cpu_data); -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; /* * Should be more than enough, but if you have a _really_ complex @@ -202,7 +202,7 @@ __tagtable(ATAG_MEM, parse_tag_mem); static int __init parse_tag_cmdline(struct tag *tag) { - strlcpy(saved_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); return 0; } __tagtable(ATAG_CMDLINE, parse_tag_cmdline); @@ -294,7 +294,7 @@ void __init setup_arch (char **cmdline_p) init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; parse_early_param(); diff --git a/arch/avr32/mm/tlb.c b/arch/avr32/mm/tlb.c index 7b073052203..56672018e42 100644 --- a/arch/avr32/mm/tlb.c +++ b/arch/avr32/mm/tlb.c @@ -360,7 +360,7 @@ static int tlb_open(struct inode *inode, struct file *file) return seq_open(file, &tlb_ops); } -static struct file_operations proc_tlb_operations = { +static const struct file_operations proc_tlb_operations = { .open = tlb_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 3cf4f23de1d..88eff7f54ea 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c @@ -499,7 +499,7 @@ print_rtc_status(void) /* The various file operations we support. */ -static struct file_operations rtc_fops = { +static const struct file_operations rtc_fops = { .owner = THIS_MODULE, .ioctl = rtc_ioctl, }; diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c index 284ebfda03f..be35a70798a 100644 --- a/arch/cris/arch-v10/drivers/eeprom.c +++ b/arch/cris/arch-v10/drivers/eeprom.c @@ -172,7 +172,7 @@ static const char eeprom_name[] = "eeprom"; static struct eeprom_type eeprom; /* This is the exported file-operations structure for this device. */ -struct file_operations eeprom_fops = +const struct file_operations eeprom_fops = { .llseek = eeprom_lseek, .read = eeprom_read, diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index 9aba18b931d..f389ed6998f 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c @@ -838,7 +838,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) return 0; } -struct file_operations gpio_fops = { +const struct file_operations gpio_fops = { .owner = THIS_MODULE, .poll = gpio_poll, .ioctl = gpio_ioctl, diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c index 092c724a645..aca81ddaf60 100644 --- a/arch/cris/arch-v10/drivers/i2c.c +++ b/arch/cris/arch-v10/drivers/i2c.c @@ -692,7 +692,7 @@ i2c_ioctl(struct inode *inode, struct file *file, return 0; } -static struct file_operations i2c_fops = { +static const struct file_operations i2c_fops = { .owner = THIS_MODULE, .ioctl = i2c_ioctl, .open = i2c_open, diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 8c830eefc89..107796e5014 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c @@ -56,7 +56,7 @@ static const unsigned char days_in_month[] = int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); -static struct file_operations pcf8563_fops = { +static const struct file_operations pcf8563_fops = { .owner = THIS_MODULE, .ioctl = pcf8563_ioctl, }; diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index 2449637e6fc..1a071f17446 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c @@ -266,7 +266,7 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op); -struct file_operations cryptocop_fops = { +const struct file_operations cryptocop_fops = { owner: THIS_MODULE, open: cryptocop_open, release: cryptocop_release, diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c index 08d36f0955c..d82c5c56113 100644 --- a/arch/cris/arch-v32/drivers/gpio.c +++ b/arch/cris/arch-v32/drivers/gpio.c @@ -705,7 +705,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) return 0; } -struct file_operations gpio_fops = { +const struct file_operations gpio_fops = { .owner = THIS_MODULE, .poll = gpio_poll, .ioctl = gpio_ioctl, diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 95f00188c62..5d6c52737df 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c @@ -573,7 +573,7 @@ i2c_ioctl(struct inode *inode, struct file *file, return 0; } -static struct file_operations i2c_fops = { +static const struct file_operations i2c_fops = { owner: THIS_MODULE, ioctl: i2c_ioctl, open: i2c_open, diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index 2fc7d75a35d..544ab017941 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c @@ -50,7 +50,7 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); int pcf8563_open(struct inode *, struct file *); int pcf8563_release(struct inode *, struct file *); -static struct file_operations pcf8563_fops = { +static const struct file_operations pcf8563_fops = { owner: THIS_MODULE, ioctl: pcf8563_ioctl, open: pcf8563_open, diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 424eb0eb1cd..df89298aafc 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c @@ -187,7 +187,7 @@ static struct sync_port ports[]= #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) -static struct file_operations sync_serial_fops = { +static const struct file_operations sync_serial_fops = { .owner = THIS_MODULE, .write = sync_serial_write, .read = sync_serial_read, diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c index f60ab785f23..4cfcae62050 100644 --- a/arch/cris/kernel/profile.c +++ b/arch/cris/kernel/profile.c @@ -50,7 +50,7 @@ write_cris_profile(struct file *file, const char __user *buf, memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); } -static struct file_operations cris_proc_profile_operations = { +static const struct file_operations cris_proc_profile_operations = { .read = read_cris_profile, .write = write_cris_profile, }; diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c index ca8b45a0fe2..65466c49d7a 100644 --- a/arch/cris/kernel/setup.c +++ b/arch/cris/kernel/setup.c @@ -29,7 +29,7 @@ struct screen_info screen_info; extern int root_mountflags; extern char _etext, _edata, _end; -char cris_command_line[COMMAND_LINE_SIZE] = { 0, }; +char __initdata cris_command_line[COMMAND_LINE_SIZE] = { 0, }; extern const unsigned long text_start, edata; /* set by the linker script */ extern unsigned long dram_start, dram_end; @@ -153,8 +153,8 @@ setup_arch(char **cmdline_p) #endif /* Save command line for future references. */ - memcpy(saved_command_line, cris_command_line, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE - 1] = '\0'; + memcpy(boot_command_line, cris_command_line, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; /* give credit for the CRIS port */ show_etrax_copyright(); diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c index 1a5eb6c301c..8ea3ca2aba6 100644 --- a/arch/frv/kernel/setup.c +++ b/arch/frv/kernel/setup.c @@ -110,7 +110,7 @@ unsigned long __initdata num_mappedpages; struct cpuinfo_frv __nongprelbss boot_cpu_data; -char command_line[COMMAND_LINE_SIZE]; +char __initdata command_line[COMMAND_LINE_SIZE]; char __initdata redboot_command_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_PM @@ -762,7 +762,7 @@ void __init setup_arch(char **cmdline_p) printk("uClinux FR-V port done by Red Hat Inc <dhowells@redhat.com>\n"); #endif - memcpy(saved_command_line, redboot_command_line, COMMAND_LINE_SIZE); + memcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE); determine_cpu(); determine_clocks(1); @@ -803,7 +803,7 @@ void __init setup_arch(char **cmdline_p) #endif /* deal with the command line - RedBoot may have passed one to the kernel */ - memcpy(command_line, saved_command_line, sizeof(command_line)); + memcpy(command_line, boot_command_line, sizeof(command_line)); *cmdline_p = &command_line[0]; parse_cmdline_early(command_line); diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c index 6adf8f41d2a..313cd808104 100644 --- a/arch/h8300/kernel/setup.c +++ b/arch/h8300/kernel/setup.c @@ -54,7 +54,7 @@ unsigned long rom_length; unsigned long memory_start; unsigned long memory_end; -char command_line[COMMAND_LINE_SIZE]; +char __initdata command_line[COMMAND_LINE_SIZE]; extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; extern int _ramstart, _ramend; @@ -154,8 +154,8 @@ void __init setup_arch(char **cmdline_p) #endif /* Keep a copy of command line */ *cmdline_p = &command_line[0]; - memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = 0; + memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = 0; #ifdef DEBUG if (strlen(*cmdline_p)) diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 19901692754..db99a8948da 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -1894,7 +1894,7 @@ static int __init apm_setup(char *str) __setup("apm=", apm_setup); #endif -static struct file_operations apm_bios_fops = { +static const struct file_operations apm_bios_fops = { .owner = THIS_MODULE, .read = do_read, .poll = do_poll, diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c index 5ae1705eafa..ee771f305f9 100644 --- a/arch/i386/kernel/cpu/mtrr/if.c +++ b/arch/i386/kernel/cpu/mtrr/if.c @@ -339,7 +339,7 @@ static int mtrr_open(struct inode *inode, struct file *file) return single_open(file, mtrr_seq_show, NULL); } -static struct file_operations mtrr_fops = { +static const struct file_operations mtrr_fops = { .owner = THIS_MODULE, .open = mtrr_open, .read = seq_read, diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c index 51130b39cd2..4da75fa3208 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/i386/kernel/cpuid.c @@ -148,7 +148,7 @@ static int cpuid_open(struct inode *inode, struct file *file) /* * File operations we support */ -static struct file_operations cpuid_fops = { +static const struct file_operations cpuid_fops = { .owner = THIS_MODULE, .llseek = cpuid_seek, .read = cpuid_read, diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index edef5084ce1..cb9abdfced9 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S @@ -103,7 +103,7 @@ ENTRY(startup_32) movzwl OLD_CL_OFFSET,%esi addl $(OLD_CL_BASE_ADDR),%esi 2: - movl $(saved_command_line - __PAGE_OFFSET),%edi + movl $(boot_command_line - __PAGE_OFFSET),%edi movl $(COMMAND_LINE_SIZE/4),%ecx rep movsl diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index c8fa13721bc..381252bae3d 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -451,7 +451,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_ return ret; } -static struct file_operations microcode_fops = { +static const struct file_operations microcode_fops = { .owner = THIS_MODULE, .write = microcode_write, .open = microcode_open, diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index 4a472a17d1c..4e14264f392 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c @@ -230,7 +230,7 @@ static int msr_open(struct inode *inode, struct file *file) /* * File operations we support */ -static struct file_operations msr_fops = { +static const struct file_operations msr_fops = { .owner = THIS_MODULE, .llseek = msr_seek, .read = msr_read, diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 4b31ad70c1a..4694ac980cd 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -132,7 +132,7 @@ unsigned long saved_videomode; #define RAMDISK_PROMPT_FLAG 0x8000 #define RAMDISK_LOAD_FLAG 0x4000 -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; unsigned char __initdata boot_params[PARAM_SIZE]; @@ -576,7 +576,7 @@ void __init setup_arch(char **cmdline_p) print_memory_map("user"); } - strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; max_low_pfn = setup_memory(); diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index ce49fe3a3b5..c1dca226b47 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -1881,7 +1881,7 @@ ioc_open(struct inode *inode, struct file *file) return seq_open(file, &ioc_seq_ops); } -static struct file_operations ioc_fops = { +static const struct file_operations ioc_fops = { .open = ioc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 6c03928544c..772ba6fe110 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -413,11 +413,10 @@ efi_init (void) efi_char16_t *c16; u64 efi_desc_size; char *cp, vendor[100] = "unknown"; - extern char saved_command_line[]; int i; /* it's too early to be able to use the standard kernel command line support... */ - for (cp = saved_command_line; *cp; ) { + for (cp = boot_command_line; *cp; ) { if (memcmp(cp, "mem=", 4) == 0) { mem_limit = memparse(cp + 4, &cp); } else if (memcmp(cp, "max_addr=", 9) == 0) { diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 86e144f321f..9860794a68f 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -621,7 +621,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info); /* forward declaration */ -static struct file_operations pfm_file_ops; +static const struct file_operations pfm_file_ops; /* * forward declarations @@ -2126,7 +2126,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare) -static struct file_operations pfm_file_ops = { +static const struct file_operations pfm_file_ops = { .llseek = no_llseek, .read = pfm_read, .write = pfm_write, @@ -6596,7 +6596,7 @@ found: return 0; } -static struct file_operations pfm_proc_fops = { +static const struct file_operations pfm_proc_fops = { .open = pfm_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c index 20bad78b507..37c876f95db 100644 --- a/arch/ia64/kernel/sal.c +++ b/arch/ia64/kernel/sal.c @@ -194,9 +194,8 @@ static void __init chk_nointroute_opt(void) { char *cp; - extern char saved_command_line[]; - for (cp = saved_command_line; *cp; ) { + for (cp = boot_command_line; *cp; ) { if (memcmp(cp, "nointroute", 10) == 0) { no_int_routing = 1; printk ("no_int_routing on\n"); diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index e375a2f0f2c..af9f8754d84 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c @@ -352,7 +352,7 @@ retry: return size; } -static struct file_operations salinfo_event_fops = { +static const struct file_operations salinfo_event_fops = { .open = salinfo_event_open, .read = salinfo_event_read, }; @@ -568,7 +568,7 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, lo return count; } -static struct file_operations salinfo_data_fops = { +static const struct file_operations salinfo_data_fops = { .open = salinfo_log_open, .release = salinfo_log_release, .read = salinfo_log_read, diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 83c2629e1c4..5fa09d141ab 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -262,7 +262,7 @@ reserve_memory (void) * appropriate after a kernel panic. */ { - char *from = strstr(saved_command_line, "crashkernel="); + char *from = strstr(boot_command_line, "crashkernel="); unsigned long base, size; if (from) { size = memparse(from + 12, &from); @@ -463,7 +463,7 @@ setup_arch (char **cmdline_p) ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist); *cmdline_p = __va(ia64_boot_param->command_line); - strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE); efi_init(); io_port_init(); diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index d9d306c79f2..601747b1e22 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -455,7 +455,7 @@ static int sn2_ptc_proc_open(struct inode *inode, struct file *file) return seq_open(file, &sn2_ptc_seq_ops); } -static struct file_operations proc_sn2_ptc_operations = { +static const struct file_operations proc_sn2_ptc_operations = { .open = sn2_ptc_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 33367996d72..6da9854751c 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c @@ -865,7 +865,7 @@ error: return r; } -static struct file_operations sn_hwperf_fops = { +static const struct file_operations sn_hwperf_fops = { .ioctl = sn_hwperf_ioctl, }; diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c index 936205f7aba..d64814385d7 100644 --- a/arch/m32r/kernel/setup.c +++ b/arch/m32r/kernel/setup.c @@ -64,7 +64,7 @@ struct screen_info screen_info = { extern int root_mountflags; -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; static struct resource data_resource = { .name = "Kernel data", @@ -95,8 +95,8 @@ static __inline__ void parse_mem_cmdline(char ** cmdline_p) int usermem = 0; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; memory_start = (unsigned long)CONFIG_MEMORY_START+PAGE_OFFSET; memory_end = memory_start+(unsigned long)CONFIG_MEMORY_SIZE; diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index 15c16b62dff..a812d03879f 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c @@ -159,7 +159,7 @@ static int rtc_release(struct inode *inode, struct file *file) * The various file operations we support. */ -static struct file_operations rtc_fops = { +static const struct file_operations rtc_fops = { .ioctl = rtc_ioctl, .open = rtc_open, .release = rtc_release, diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 9af3ee0e555..42b8fd09ea8 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -256,7 +256,7 @@ void __init setup_arch(char **cmdline_p) init_mm.brk = (unsigned long) &_end; *cmdline_p = m68k_command_line; - memcpy(saved_command_line, *cmdline_p, CL_SIZE); + memcpy(boot_command_line, *cmdline_p, CL_SIZE); /* Parse the command line for arch-specific options. * For the m68k, this is currently only "debug=xxx" to enable printing diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index b0e4c084df8..272d47eac58 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c @@ -147,7 +147,7 @@ static int rtc_release(struct inode *inode, struct file *file) * The various file operations we support. */ -static struct file_operations rtc_fops = { +static const struct file_operations rtc_fops = { .ioctl = rtc_ioctl, .open = rtc_open, .release = rtc_release, diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c index 9cf2e4d1fc7..d5c25d27b64 100644 --- a/arch/m68knommu/kernel/setup.c +++ b/arch/m68knommu/kernel/setup.c @@ -44,7 +44,7 @@ unsigned long memory_end; EXPORT_SYMBOL(memory_start); EXPORT_SYMBOL(memory_end); -char command_line[COMMAND_LINE_SIZE]; +char __initdata command_line[COMMAND_LINE_SIZE]; /* setup some dummy routines */ static void dummy_waitbut(void) @@ -231,8 +231,8 @@ void setup_arch(char **cmdline_p) /* Keep a copy of command line */ *cmdline_p = &command_line[0]; - memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = 0; + memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = 0; #ifdef DEBUG if (strlen(*cmdline_p)) diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index f29e93c6ccf..d92c48e0d7a 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c @@ -478,7 +478,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer, return rtlx_write(minor, (void *)buffer, count, 1); } -static struct file_operations rtlx_fops = { +static const struct file_operations rtlx_fops = { .owner = THIS_MODULE, .open = file_open, .release = file_release, diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index d2e01e7167b..394540fad76 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -452,7 +452,7 @@ static void __init arch_mem_init(char **cmdline_p) print_memory_map(); strlcpy(command_line, arcs_cmdline, sizeof(command_line)); - strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 4e832da48c6..9aca871a307 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -1208,7 +1208,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer, return ret; } -static struct file_operations vpe_fops = { +static const struct file_operations vpe_fops = { .owner = THIS_MODULE, .open = vpe_open, .release = vpe_release, diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c index d1a906e683b..212547c5731 100644 --- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c +++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c @@ -374,7 +374,7 @@ static long sbprof_tb_ioctl(struct file *filp, return error; } -static struct file_operations sbprof_tb_fops = { +static const struct file_operations sbprof_tb_fops = { .owner = THIS_MODULE, .open = sbprof_tb_open, .release = sbprof_tb_release, diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index ac8ee205c35..a46bc62b643 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -479,7 +479,7 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return error; } -static struct file_operations perf_fops = { +static const struct file_operations perf_fops = { .llseek = no_llseek, .read = perf_read, .write = perf_write, diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 3c7a3faf78e..74b3686dd1e 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -45,7 +45,7 @@ #include <asm/io.h> #include <asm/setup.h> -char command_line[COMMAND_LINE_SIZE] __read_mostly; +char __initdata command_line[COMMAND_LINE_SIZE] __read_mostly; /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */ struct proc_dir_entry * proc_runway_root __read_mostly = NULL; @@ -71,9 +71,9 @@ void __init setup_cmdline(char **cmdline_p) /* boot_args[0] is free-mem start, boot_args[1] is ptr to command line */ if (boot_args[0] < 64) { /* called from hpux boot loader */ - saved_command_line[0] = '\0'; + boot_command_line[0] = '\0'; } else { - strcpy(saved_command_line, (char *)__va(boot_args[1])); + strcpy(boot_command_line, (char *)__va(boot_args[1])); #ifdef CONFIG_BLK_DEV_INITRD if (boot_args[2] != 0) /* did palo pass us a ramdisk? */ @@ -84,7 +84,7 @@ void __init setup_cmdline(char **cmdline_p) #endif } - strcpy(command_line, saved_command_line); + strcpy(command_line, boot_command_line); *cmdline_p = command_line; } diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 0c118e584e7..12117db0043 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -77,12 +77,11 @@ static void __init mem_limit_func(void) { char *cp, *end; unsigned long limit; - extern char saved_command_line[]; /* We need this before __setup() functions are called */ limit = MAX_MEM; - for (cp = saved_command_line; *cp; ) { + for (cp = boot_command_line; *cp; ) { if (memcmp(cp, "mem=", 4) == 0) { cp += 4; limit = memparse(cp, &end); diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig index ec644b34a08..0345a2ceec5 100644 --- a/arch/powerpc/configs/ps3_defconfig +++ b/arch/powerpc/configs/ps3_defconfig @@ -163,6 +163,7 @@ CONFIG_PS3_HTAB_SIZE=20 # CONFIG_PS3_DYNAMIC_DMA is not set CONFIG_PS3_USE_LPAR_ADDR=y CONFIG_PS3_VUART=y +CONFIG_PS3_PS3AV=y # # Kernel options @@ -611,14 +612,40 @@ CONFIG_GEN_RTC=y # Graphics support # # CONFIG_FIRMWARE_EDID is not set -# CONFIG_FB is not set +CONFIG_FB=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_OF is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_IBM_GXT4500 is not set +CONFIG_FB_PS3=y +CONFIG_FB_PS3_DEFAULT_SIZE_M=18 +# CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Logo configuration +# +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 5e6ddfa474c..89f46f37792 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) DBG(" -> check_legacy_serial_console()\n"); /* The user has requested a console so this is already set up. */ - if (strstr(saved_command_line, "console=")) { + if (strstr(boot_command_line, "console=")) { DBG(" console was specified !\n"); return -EBUSY; } diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 0de5a08cf9b..89486b63128 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) return single_open(file, lparcfg_data, NULL); } -struct file_operations lparcfg_fops = { +const struct file_operations lparcfg_fops = { .owner = THIS_MODULE, .read = seq_read, .write = lparcfg_write, diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 869cebbba96..f9676f52c6d 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, } } -struct file_operations nvram_fops = { +const struct file_operations nvram_fops = { .owner = THIS_MODULE, .llseek = dev_nvram_llseek, .read = dev_nvram_read, diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index 3d437c32546..f78dfce1b77 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 loff_t *ppos); static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); -static struct file_operations page_map_fops = { +static const struct file_operations page_map_fops = { .llseek = page_map_seek, .read = page_map_read, .mmap = page_map_mmap diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 3be52d693ec..3e86e6e0f77 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -991,7 +991,7 @@ void __init early_init_devtree(void *params) of_scan_flat_dt(early_init_dt_scan_memory, NULL); /* Save command line for /proc/cmdline and then parse parameters */ - strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); parse_early_param(); /* 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 2fe82abf1c5..6cbf2ae5d7a 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) return single_open(file, ppc_rtas_sensors_show, NULL); } -struct file_operations ppc_rtas_sensors_operations = { +const struct file_operations ppc_rtas_sensors_operations = { .open = sensors_open, .read = seq_read, .llseek = seq_lseek, @@ -172,7 +172,7 @@ static int poweron_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_poweron_show, NULL); } -struct file_operations ppc_rtas_poweron_operations = { +const struct file_operations ppc_rtas_poweron_operations = { .open = poweron_open, .read = seq_read, .llseek = seq_lseek, @@ -185,7 +185,7 @@ static int progress_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_progress_show, NULL); } -struct file_operations ppc_rtas_progress_operations = { +const struct file_operations ppc_rtas_progress_operations = { .open = progress_open, .read = seq_read, .llseek = seq_lseek, @@ -198,7 +198,7 @@ static int clock_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_clock_show, NULL); } -struct file_operations ppc_rtas_clock_operations = { +const struct file_operations ppc_rtas_clock_operations = { .open = clock_open, .read = seq_read, .llseek = seq_lseek, @@ -211,7 +211,7 @@ static int tone_freq_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_tone_freq_show, NULL); } -struct file_operations ppc_rtas_tone_freq_operations = { +const struct file_operations ppc_rtas_tone_freq_operations = { .open = tone_freq_open, .read = seq_read, .llseek = seq_lseek, @@ -224,7 +224,7 @@ static int tone_volume_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_tone_volume_show, NULL); } -struct file_operations ppc_rtas_tone_volume_operations = { +const struct file_operations ppc_rtas_tone_volume_operations = { .open = tone_volume_open, .read = seq_read, .llseek = seq_lseek, @@ -237,7 +237,7 @@ static int rmo_buf_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_rmo_buf_show, NULL); } -struct file_operations ppc_rtas_rmo_buf_ops = { +const struct file_operations ppc_rtas_rmo_buf_ops = { .open = rmo_buf_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 65e4ebe8db3..f72118c0844 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c @@ -702,7 +702,7 @@ static int initialize_flash_pde_data(const char *rtas_call_name, } static struct proc_dir_entry *create_flash_pde(const char *filename, - struct file_operations *fops) + const struct file_operations *fops) { struct proc_dir_entry *ent = NULL; @@ -715,21 +715,21 @@ static struct proc_dir_entry *create_flash_pde(const char *filename, return ent; } -static struct file_operations rtas_flash_operations = { +static const struct file_operations rtas_flash_operations = { .read = rtas_flash_read, .write = rtas_flash_write, .open = rtas_excl_open, .release = rtas_flash_release, }; -static struct file_operations manage_flash_operations = { +static const struct file_operations manage_flash_operations = { .read = manage_flash_read, .write = manage_flash_write, .open = rtas_excl_open, .release = rtas_excl_release, }; -static struct file_operations validate_flash_operations = { +static const struct file_operations validate_flash_operations = { .read = validate_flash_read, .write = validate_flash_write, .open = rtas_excl_open, diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c index 8f5afdbad0d..194a93eeb3e 100644 --- a/arch/powerpc/kernel/udbg.c +++ b/arch/powerpc/kernel/udbg.c @@ -150,7 +150,7 @@ void __init disable_early_printk(void) { if (!early_console_initialized) return; - if (strstr(saved_command_line, "udbg-immortal")) { + if (strstr(boot_command_line, "udbg-immortal")) { printk(KERN_INFO "early console immortal !\n"); return; } diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 347eff56fcb..af9e9455a70 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) return 0; } -static struct file_operations spufs_mem_fops = { +static const struct file_operations spufs_mem_fops = { .open = spufs_mem_open, .read = spufs_mem_read, .write = spufs_mem_write, @@ -249,7 +249,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file) spufs_cntl_set, "0x%08lx"); } -static struct file_operations spufs_cntl_fops = { +static const struct file_operations spufs_cntl_fops = { .open = spufs_cntl_open, .release = simple_attr_close, .read = simple_attr_read, @@ -309,7 +309,7 @@ spufs_regs_write(struct file *file, const char __user *buffer, return ret; } -static struct file_operations spufs_regs_fops = { +static const struct file_operations spufs_regs_fops = { .open = spufs_regs_open, .read = spufs_regs_read, .write = spufs_regs_write, @@ -360,7 +360,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer, return ret; } -static struct file_operations spufs_fpcr_fops = { +static const struct file_operations spufs_fpcr_fops = { .open = spufs_regs_open, .read = spufs_fpcr_read, .write = spufs_fpcr_write, @@ -426,7 +426,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf, return count; } -static struct file_operations spufs_mbox_fops = { +static const struct file_operations spufs_mbox_fops = { .open = spufs_pipe_open, .read = spufs_mbox_read, }; @@ -452,7 +452,7 @@ static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, return 4; } -static struct file_operations spufs_mbox_stat_fops = { +static const struct file_operations spufs_mbox_stat_fops = { .open = spufs_pipe_open, .read = spufs_mbox_stat_read, }; @@ -559,7 +559,7 @@ static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait) return mask; } -static struct file_operations spufs_ibox_fops = { +static const struct file_operations spufs_ibox_fops = { .open = spufs_pipe_open, .read = spufs_ibox_read, .poll = spufs_ibox_poll, @@ -585,7 +585,7 @@ static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, return 4; } -static struct file_operations spufs_ibox_stat_fops = { +static const struct file_operations spufs_ibox_stat_fops = { .open = spufs_pipe_open, .read = spufs_ibox_stat_read, }; @@ -692,7 +692,7 @@ static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait) return mask; } -static struct file_operations spufs_wbox_fops = { +static const struct file_operations spufs_wbox_fops = { .open = spufs_pipe_open, .write = spufs_wbox_write, .poll = spufs_wbox_poll, @@ -718,7 +718,7 @@ static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, return 4; } -static struct file_operations spufs_wbox_stat_fops = { +static const struct file_operations spufs_wbox_stat_fops = { .open = spufs_pipe_open, .read = spufs_wbox_stat_read, }; @@ -823,7 +823,7 @@ static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static struct file_operations spufs_signal1_fops = { +static const struct file_operations spufs_signal1_fops = { .open = spufs_signal1_open, .read = spufs_signal1_read, .write = spufs_signal1_write, @@ -934,7 +934,7 @@ static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) #define spufs_signal2_mmap NULL #endif /* !SPUFS_MMAP_4K */ -static struct file_operations spufs_signal2_fops = { +static const struct file_operations spufs_signal2_fops = { .open = spufs_signal2_open, .read = spufs_signal2_read, .write = spufs_signal2_write, @@ -1037,7 +1037,7 @@ static int spufs_mss_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static struct file_operations spufs_mss_fops = { +static const struct file_operations spufs_mss_fops = { .open = spufs_mss_open, .mmap = spufs_mss_mmap, }; @@ -1076,7 +1076,7 @@ static int spufs_psmap_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static struct file_operations spufs_psmap_fops = { +static const struct file_operations spufs_psmap_fops = { .open = spufs_psmap_open, .mmap = spufs_psmap_mmap, }; @@ -1393,7 +1393,7 @@ static int spufs_mfc_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &ctx->mfc_fasync); } -static struct file_operations spufs_mfc_fops = { +static const struct file_operations spufs_mfc_fops = { .open = spufs_mfc_open, .read = spufs_mfc_read, .write = spufs_mfc_write, @@ -1650,7 +1650,7 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf, return ret; } -static struct file_operations spufs_mbox_info_fops = { +static const struct file_operations spufs_mbox_info_fops = { .open = spufs_info_open, .read = spufs_mbox_info_read, .llseek = generic_file_llseek, @@ -1688,7 +1688,7 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, return ret; } -static struct file_operations spufs_ibox_info_fops = { +static const struct file_operations spufs_ibox_info_fops = { .open = spufs_info_open, .read = spufs_ibox_info_read, .llseek = generic_file_llseek, @@ -1729,7 +1729,7 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf, return ret; } -static struct file_operations spufs_wbox_info_fops = { +static const struct file_operations spufs_wbox_info_fops = { .open = spufs_info_open, .read = spufs_wbox_info_read, .llseek = generic_file_llseek, @@ -1779,7 +1779,7 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf, return ret; } -static struct file_operations spufs_dma_info_fops = { +static const struct file_operations spufs_dma_info_fops = { .open = spufs_info_open, .read = spufs_dma_info_read, }; @@ -1830,7 +1830,7 @@ static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf, return ret; } -static struct file_operations spufs_proxydma_info_fops = { +static const struct file_operations spufs_proxydma_info_fops = { .open = spufs_info_open, .read = spufs_proxydma_info_read, }; diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 738b9244382..8079983ef94 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) return dcache_dir_close(inode, file); } -struct inode_operations spufs_dir_inode_operations = { +const struct inode_operations spufs_dir_inode_operations = { .lookup = simple_lookup, }; -struct file_operations spufs_context_fops = { +const struct file_operations spufs_context_fops = { .open = dcache_dir_open, .release = spufs_dir_close, .llseek = dcache_dir_lseek, @@ -372,7 +372,7 @@ static int spufs_gang_close(struct inode *inode, struct file *file) return dcache_dir_close(inode, file); } -struct file_operations spufs_gang_fops = { +const struct file_operations spufs_gang_fops = { .open = dcache_dir_open, .release = spufs_gang_close, .llseek = dcache_dir_lseek, diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 70fb13395c0..56864469215 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, struct spu_context *ctx, u32 *npc, u32 *status); long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode); -extern struct file_operations spufs_context_fops; +extern const struct file_operations spufs_context_fops; /* gang management */ struct spu_gang *alloc_spu_gang(void); diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index c1f4502a3c6..91df52a1899 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) return single_open(file, proc_lpevents_show, NULL); } -static struct file_operations proc_lpevents_operations = { +static const struct file_operations proc_lpevents_operations = { .open = proc_lpevents_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 90d3d49f713..b1187d95e3b 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c @@ -1224,7 +1224,7 @@ out: return rc; } -static struct file_operations proc_vmlinux_operations = { +static const struct file_operations proc_vmlinux_operations = { .write = proc_mf_change_vmlinux, }; diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c index b54e37101e6..f2cde418020 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) return single_open(file, proc_titantod_show, NULL); } -static struct file_operations proc_titantod_operations = { +static const struct file_operations proc_titantod_operations = { .open = proc_titantod_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index a6799ed34a6..e2100ece9c6 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) return single_open(file, proc_viopath_show, NULL); } -static struct file_operations proc_viopath_operations = { +static const struct file_operations proc_viopath_operations = { .open = proc_viopath_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index d949e9df41e..651fa424ea0 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) if ((goodness <= current_root_goodness) && ROOT_DEV != DEFAULT_ROOT_DEVICE) return; - p = strstr(saved_command_line, "root="); - if (p != NULL && (p == saved_command_line || p[-1] == ' ')) + p = strstr(boot_command_line, "root="); + if (p != NULL && (p == boot_command_line || p[-1] == ' ')) return; if (!found_boot) { diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig index de52ec4e9e5..4be3943d1c0 100644 --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig @@ -51,4 +51,15 @@ config PS3_VUART including the System Manager and AV Settings. In general, all users will say Y. +config PS3_PS3AV + tristate "PS3 AV settings driver" + depends on PPC_PS3 + select PS3_VUART + default y + help + Include support for the PS3 AV Settings driver. + + This support is required for graphics and sound. In + general, all users will say Y or M. + endmenu diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c index a4b5a1bc60f..e12e59fea13 100644 --- a/arch/powerpc/platforms/ps3/htab.c +++ b/arch/powerpc/platforms/ps3/htab.c @@ -2,7 +2,7 @@ * PS3 pagetable management routines. * * Copyright (C) 2006 Sony Computer Entertainment Inc. - * Copyright 2006 Sony Corp. + * Copyright 2006, 2007 Sony Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #include <asm/lmb.h> #include <asm/udbg.h> #include <asm/lv1call.h> +#include <asm/ps3fb.h> #include "platform.h" @@ -233,6 +234,9 @@ static void ps3_hpte_invalidate(unsigned long slot, unsigned long va, static void ps3_hpte_clear(void) { + /* Make sure to clean up the frame buffer device first */ + ps3fb_cleanup(); + lv1_unmap_htab(htab_addr); } diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index e62505e1881..13d669a8eca 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c @@ -24,6 +24,7 @@ #include <linux/root_dev.h> #include <linux/console.h> #include <linux/kexec.h> +#include <linux/bootmem.h> #include <asm/machdep.h> #include <asm/firmware.h> @@ -80,6 +81,46 @@ static void ps3_panic(char *str) for (;;) ; } + +static void prealloc(struct ps3_prealloc *p) +{ + if (!p->size) + return; + + p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS)); + if (!p->address) { + printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__, + p->name); + return; + } + + printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size, + p->address); +} + +#ifdef CONFIG_FB_PS3 +struct ps3_prealloc ps3fb_videomemory = { + .name = "ps3fb videomemory", + .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024, + .align = 1024*1024 /* the GPU requires 1 MiB alignment */ +}; +#define prealloc_ps3fb_videomemory() prealloc(&ps3fb_videomemory) + +static int __init early_parse_ps3fb(char *p) +{ + if (!p) + return 1; + + ps3fb_videomemory.size = _ALIGN_UP(memparse(p, &p), + ps3fb_videomemory.align); + return 0; +} +early_param("ps3fb", early_parse_ps3fb); +#else +#define prealloc_ps3fb_videomemory() do { } while (0) +#endif + + static void __init ps3_setup_arch(void) { union ps3_firmware_version v; @@ -101,6 +142,7 @@ static void __init ps3_setup_arch(void) conswitchp = &dummy_con; #endif + prealloc_ps3fb_videomemory(); ppc_md.power_save = ps3_power_save; DBG(" <- %s:%d\n", __func__, __LINE__); diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 9437f48cc9e..6cedbc002e0 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) return single_open(file, proc_eeh_show, NULL); } -static struct file_operations proc_eeh_operations = { +static const struct file_operations proc_eeh_operations = { .open = proc_eeh_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index 3ddc04925d5..eae51ef9af2 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) return rc; } -static struct file_operations hcall_inst_seq_fops = { +static const struct file_operations hcall_inst_seq_fops = { .open = hcall_inst_seq_open, .read = seq_read, .llseek = seq_lseek, diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 789a5e99aef..5aa97aff339 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c @@ -499,7 +499,7 @@ out: return rv ? rv : count; } -static struct file_operations ofdt_fops = { +static const struct file_operations ofdt_fops = { .write = ofdt_write }; diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index 8ca2612221d..77d0937d5c0 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) return 0; } -struct file_operations proc_rtas_log_operations = { +const struct file_operations proc_rtas_log_operations = { .read = rtas_log_read, .poll = rtas_log_poll, .open = rtas_log_open, diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c index 45368a57d7d..8e1ef168e2d 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) return 0; } -struct file_operations scanlog_fops = { +const struct file_operations scanlog_fops = { .owner = THIS_MODULE, .read = scanlog_read, .write = scanlog_write, diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index 684ed04eb8b..a956f28ab16 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c @@ -1711,7 +1711,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd, } -static struct file_operations mixer_fops = +static const struct file_operations mixer_fops = { .owner = THIS_MODULE, .llseek = sound_lseek, @@ -2298,7 +2298,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, -static struct file_operations sq_fops = +static const struct file_operations sq_fops = { .owner = THIS_MODULE, .llseek = sound_lseek, @@ -2433,7 +2433,7 @@ static ssize_t state_read(struct file *file, char *buf, size_t count, } -static struct file_operations state_fops = +static const struct file_operations state_fops = { .owner = THIS_MODULE, .llseek = sound_lseek, diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index 3c506af1988..c79704f5409 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -543,7 +543,7 @@ void __init setup_arch(char **cmdline_p) init_mm.brk = (unsigned long) klimit; /* Save unparsed command line copy for /proc/cmdline */ - strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); *cmdline_p = cmd_line; parse_early_param(); diff --git a/arch/ppc/platforms/lopec.c b/arch/ppc/platforms/lopec.c index 18dc6e8dd4f..b947c774f52 100644 --- a/arch/ppc/platforms/lopec.c +++ b/arch/ppc/platforms/lopec.c @@ -344,7 +344,7 @@ lopec_setup_arch(void) if (bootargs != NULL) { strcpy(cmd_line, bootargs); /* again.. */ - strcpy(saved_command_line, cmd_line); + strcpy(boot_command_line, cmd_line); } } #endif diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c index 9778105d4df..8a1788c4815 100644 --- a/arch/ppc/platforms/pplus.c +++ b/arch/ppc/platforms/pplus.c @@ -592,7 +592,7 @@ static void __init pplus_setup_arch(void) if (bootargs != NULL) { strcpy(cmd_line, bootargs); /* again.. */ - strcpy(saved_command_line, cmd_line); + strcpy(boot_command_line, cmd_line); } } #endif diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c index 1cb75a1f825..f166299571d 100644 --- a/arch/ppc/platforms/prep_setup.c +++ b/arch/ppc/platforms/prep_setup.c @@ -634,7 +634,7 @@ static void __init prep_init_sound(void) /* * Find a way to push these informations to the cs4232 driver * Give it out with printk, when not in cmd_line? - * Append it to cmd_line and saved_command_line? + * Append it to cmd_line and boot_command_line? * Format is cs4232=io,irq,dma,dma2 */ } @@ -897,7 +897,7 @@ prep_setup_arch(void) if (bootargs != NULL) { strcpy(cmd_line, bootargs); /* again.. */ - strcpy(saved_command_line, cmd_line); + strcpy(boot_command_line, cmd_line); } } diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index a4fda7b5364..ba5d3167df0 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -34,7 +34,7 @@ struct hypfs_sb_info { struct mutex lock; /* lock to protect update process */ }; -static struct file_operations hypfs_file_ops; +static const struct file_operations hypfs_file_ops; static struct file_system_type hypfs_type; static struct super_operations hypfs_s_ops; @@ -440,7 +440,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir, return dentry; } -static struct file_operations hypfs_file_ops = { +static const struct file_operations hypfs_file_ops = { .open = hypfs_open, .release = hypfs_release, .read = do_sync_read, diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index f4b62df02aa..51653d82d7d 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -167,7 +167,7 @@ static DECLARE_MUTEX(debug_lock); static int initialized; -static struct file_operations debug_file_ops = { +static const struct file_operations debug_file_ops = { .owner = THIS_MODULE, .read = debug_output, .write = debug_input, diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 03739813d3b..50c5210fbc6 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -740,7 +740,7 @@ setup_arch(char **cmdline_p) #endif /* CONFIG_64BIT */ /* Save unparsed command line copy for /proc/cmdline */ - strlcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); *cmdline_p = COMMAND_LINE; *(*cmdline_p + COMMAND_LINE_SIZE - 1) = '\0'; diff --git a/arch/sh/boards/landisk/landisk_pwb.c b/arch/sh/boards/landisk/landisk_pwb.c index e6252497816..47a63c6617e 100644 --- a/arch/sh/boards/landisk/landisk_pwb.c +++ b/arch/sh/boards/landisk/landisk_pwb.c @@ -150,7 +150,7 @@ static irqreturn_t sw_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct file_operations swdrv_fops = { +static const struct file_operations swdrv_fops = { .read = swdrv_read, /* read */ .write = swdrv_write, /* write */ .open = swdrv_open, /* open */ diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 225f9ea5cdd..d6b817aa568 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -75,7 +75,7 @@ static struct sh_machine_vector* __init get_mv_byname(const char* name); #define RAMDISK_PROMPT_FLAG 0x8000 #define RAMDISK_LOAD_FLAG 0x4000 -static char command_line[COMMAND_LINE_SIZE] = { 0, }; +static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, }; static struct resource code_resource = { .name = "Kernel code", }; static struct resource data_resource = { .name = "Kernel data", }; @@ -90,8 +90,8 @@ static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE], int len = 0; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; memory_end = memory_start + __MEMORY_SIZE; diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c index e0122bd33dd..909dcfa8c8c 100644 --- a/arch/sh/mm/cache-debugfs.c +++ b/arch/sh/mm/cache-debugfs.c @@ -114,7 +114,7 @@ static int cache_debugfs_open(struct inode *inode, struct file *file) return single_open(file, cache_seq_show, inode->i_private); } -static struct file_operations cache_debugfs_fops = { +static const struct file_operations cache_debugfs_fops = { .owner = THIS_MODULE, .open = cache_debugfs_open, .read = seq_read, diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index b60ad83a763..d0d45e2e0ab 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c @@ -378,7 +378,7 @@ static int pmb_debugfs_open(struct inode *inode, struct file *file) return single_open(file, pmb_seq_show, NULL); } -static struct file_operations pmb_debugfs_fops = { +static const struct file_operations pmb_debugfs_fops = { .owner = THIS_MODULE, .open = pmb_debugfs_open, .read = seq_read, diff --git a/arch/sh/oprofile/op_model_sh7750.c b/arch/sh/oprofile/op_model_sh7750.c index 60402eec4b4..0104e44bc76 100644 --- a/arch/sh/oprofile/op_model_sh7750.c +++ b/arch/sh/oprofile/op_model_sh7750.c @@ -187,7 +187,7 @@ static ssize_t sh7750_write_count(struct file *file, const char __user *buf, return count; } -static struct file_operations count_fops = { +static const struct file_operations count_fops = { .read = sh7750_read_count, .write = sh7750_write_count, }; diff --git a/arch/sh64/kernel/setup.c b/arch/sh64/kernel/setup.c index b9e7d54d7b8..53e9d20a874 100644 --- a/arch/sh64/kernel/setup.c +++ b/arch/sh64/kernel/setup.c @@ -83,7 +83,7 @@ extern int sh64_tlb_init(void); #define RAMDISK_PROMPT_FLAG 0x8000 #define RAMDISK_LOAD_FLAG 0x4000 -static char command_line[COMMAND_LINE_SIZE] = { 0, }; +static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, }; unsigned long long memory_start = CONFIG_MEMORY_START; unsigned long long memory_end = CONFIG_MEMORY_START + (CONFIG_MEMORY_SIZE_IN_MB * 1024 * 1024); @@ -95,8 +95,8 @@ static inline void parse_mem_cmdline (char ** cmdline_p) int len = 0; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { /* diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index 406dd94afb4..d06a405ca71 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c @@ -127,7 +127,7 @@ static int apc_ioctl(struct inode *inode, struct file *f, return 0; } -static struct file_operations apc_fops = { +static const struct file_operations apc_fops = { .ioctl = apc_ioctl, .open = apc_open, .release = apc_release, diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c index 383526ad94f..eccd8e87f52 100644 --- a/arch/sparc/kernel/setup.c +++ b/arch/sparc/kernel/setup.c @@ -246,7 +246,7 @@ void __init setup_arch(char **cmdline_p) /* Initialize PROM console and command line. */ *cmdline_p = prom_getbootargs(); - strcpy(saved_command_line, *cmdline_p); + strcpy(boot_command_line, *cmdline_p); /* Set sparc_cpu_model */ sparc_cpu_model = sun_unknown; diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index d8e008a04e2..bba1b0e02f9 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c @@ -229,7 +229,7 @@ EXPORT_SYMBOL(prom_getproplen); EXPORT_SYMBOL(prom_getproperty); EXPORT_SYMBOL(prom_node_has_property); EXPORT_SYMBOL(prom_setprop); -EXPORT_SYMBOL(saved_command_line); +EXPORT_SYMBOL(boot_command_line); EXPORT_SYMBOL(prom_apply_obio_ranges); EXPORT_SYMBOL(prom_feval); EXPORT_SYMBOL(prom_getbool); diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 0bf8c165fc9..da6606f0cff 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -859,14 +859,16 @@ asmlinkage int sunos_wait4(pid_t pid, unsigned int __user *stat_addr, return ret; } -extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { int ret; - lock_kernel(); - ret = kill_pg(pgrp, sig, 0); - unlock_kernel(); + rcu_read_lock(); + ret = -EINVAL; + if (pgrp > 0) + ret = kill_pgrp(find_pid(pgrp), sig, 0); + rcu_read_unlock(); + return ret; } diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index bf033b31d43..451028341c7 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c @@ -315,7 +315,7 @@ void __init setup_arch(char **cmdline_p) { /* Initialize PROM console and command line. */ *cmdline_p = prom_getbootargs(); - strcpy(saved_command_line, *cmdline_p); + strcpy(boot_command_line, *cmdline_p); if (tlb_type == hypervisor) printk("ARCH: SUN4V\n"); diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index beffc82a1e8..f7d78e05e7f 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c @@ -253,7 +253,7 @@ EXPORT_SYMBOL(prom_getproplen); EXPORT_SYMBOL(prom_getproperty); EXPORT_SYMBOL(prom_node_has_property); EXPORT_SYMBOL(prom_setprop); -EXPORT_SYMBOL(saved_command_line); +EXPORT_SYMBOL(boot_command_line); EXPORT_SYMBOL(prom_finddevice); EXPORT_SYMBOL(prom_feval); EXPORT_SYMBOL(prom_getbool); diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 2ebc2c05138..4cff95b7b3a 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -824,10 +824,17 @@ asmlinkage int sunos_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, in return ret; } -extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { - return kill_pg(pgrp, sig, 0); + int ret; + + rcu_read_lock(); + ret = -EINVAL; + if (pgrp > 0) + ret = kill_pgrp(find_pid(pgrp), sig, 0); + rcu_read_unlock(); + + return ret; } asmlinkage int sunos_audit(void) diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 061e1b1fa58..f84da4f1b70 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -1327,7 +1327,7 @@ static int mini_rtc_release(struct inode *inode, struct file *file) } -static struct file_operations mini_rtc_fops = { +static const struct file_operations mini_rtc_fops = { .owner = THIS_MODULE, .ioctl = mini_rtc_ioctl, .open = mini_rtc_open, diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index 89a4757f192..c2864447de8 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c @@ -163,7 +163,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait) return mask; } -static struct file_operations socksys_fops = { +static const struct file_operations socksys_fops = { .open = socksys_open, .release = socksys_release, }; diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index 73c5caa7a15..55601687b3b 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c @@ -145,7 +145,7 @@ static int harddog_ioctl(struct inode *inode, struct file *file, } } -static struct file_operations harddog_fops = { +static const struct file_operations harddog_fops = { .owner = THIS_MODULE, .write = harddog_write, .ioctl = harddog_ioctl, diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 0e1e9a20a4d..01d4ab6b0ef 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -774,7 +774,7 @@ static irqreturn_t winch_interrupt(int irq, void *data) line = tty->driver_data; chan_window_size(&line->chan_list, &tty->winsize.ws_row, &tty->winsize.ws_col); - kill_pg(tty->pgrp, SIGWINCH, 1); + kill_pgrp(tty->pgrp, SIGWINCH, 1); } out: if(winch->fd != -1) diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h index 06625fefef3..023575f6734 100644 --- a/arch/um/include/user_util.h +++ b/arch/um/include/user_util.h @@ -38,8 +38,6 @@ extern unsigned long long highmem; extern char host_info[]; -extern char saved_command_line[]; - extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; extern unsigned long _unprotected_end; extern unsigned long brk_start; diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 84e57f6da1d..89c6dba731f 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -43,9 +43,9 @@ #define DEFAULT_COMMAND_LINE "root=98:0" /* Changed in linux_main and setup_arch, which run before SMP is started */ -static char command_line[COMMAND_LINE_SIZE] = { 0 }; +static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 }; -static void add_arg(char *arg) +static void __init add_arg(char *arg) { if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) { printf("add_arg: Too many command line arguments!\n"); @@ -330,7 +330,7 @@ EXPORT_SYMBOL(end_iomem); extern char __binary_start; -int linux_main(int argc, char **argv) +int __init linux_main(int argc, char **argv) { unsigned long avail, diff; unsigned long virtmem_size, max_physmem; @@ -481,7 +481,7 @@ void __init setup_arch(char **cmdline_p) atomic_notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); paging_init(); - strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; setup_hostinfo(); } diff --git a/arch/v850/kernel/rte_cb_leds.c b/arch/v850/kernel/rte_cb_leds.c index 996bd4f33ec..aa47ab1dcd8 100644 --- a/arch/v850/kernel/rte_cb_leds.c +++ b/arch/v850/kernel/rte_cb_leds.c @@ -117,7 +117,7 @@ static loff_t leds_dev_lseek (struct file *file, loff_t offs, int whence) return 0; } -static struct file_operations leds_fops = { +static const struct file_operations leds_fops = { .read = leds_dev_read, .write = leds_dev_write, .llseek = leds_dev_lseek diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c index 1bf672a2569..a914f244f49 100644 --- a/arch/v850/kernel/setup.c +++ b/arch/v850/kernel/setup.c @@ -42,7 +42,7 @@ extern char _root_fs_image_start __attribute__ ((__weak__)); extern char _root_fs_image_end __attribute__ ((__weak__)); -char command_line[COMMAND_LINE_SIZE]; +char __initdata command_line[COMMAND_LINE_SIZE]; /* Memory not used by the kernel. */ static unsigned long total_ram_pages; @@ -64,8 +64,8 @@ void __init setup_arch (char **cmdline) { /* Keep a copy of command line */ *cmdline = command_line; - memcpy (saved_command_line, command_line, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE - 1] = '\0'; + memcpy (boot_command_line, command_line, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; console_verbose (); diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c index cc230b93cd1..5f197b0a330 100644 --- a/arch/x86_64/kernel/head64.c +++ b/arch/x86_64/kernel/head64.c @@ -34,8 +34,6 @@ static void __init clear_bss(void) #define OLD_CL_BASE_ADDR 0x90000 #define OLD_CL_OFFSET 0x90022 -extern char saved_command_line[]; - static void __init copy_bootdata(char *real_mode_data) { int new_data; @@ -50,7 +48,7 @@ static void __init copy_bootdata(char *real_mode_data) new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET; } command_line = (char *) ((u64)(new_data)); - memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); } void __init x86_64_start_kernel(char * real_mode_data) diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index ac085038af2..bdb54a2c9f1 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c @@ -516,7 +516,7 @@ static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd, unsigned } } -static struct file_operations mce_chrdev_ops = { +static const struct file_operations mce_chrdev_ops = { .read = mce_read, .ioctl = mce_ioctl, }; diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index af425a8049f..60477244d1a 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c @@ -100,7 +100,7 @@ EXPORT_SYMBOL_GPL(edid_info); extern int root_mountflags; -char command_line[COMMAND_LINE_SIZE]; +char __initdata command_line[COMMAND_LINE_SIZE]; struct resource standard_io_resources[] = { { .name = "dma1", .start = 0x00, .end = 0x1f, @@ -343,7 +343,7 @@ static void discover_ebda(void) void __init setup_arch(char **cmdline_p) { - printk(KERN_INFO "Command line: %s\n", saved_command_line); + printk(KERN_INFO "Command line: %s\n", boot_command_line); ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); screen_info = SCREEN_INFO; @@ -373,7 +373,7 @@ void __init setup_arch(char **cmdline_p) early_identify_cpu(&boot_cpu_data); - strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; parse_early_param(); diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index b6374c09de2..1ecf6716c32 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -78,7 +78,7 @@ extern unsigned long loops_per_jiffy; /* Command line specified as configuration option. */ -static char command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_CMDLINE_BOOL static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; @@ -253,8 +253,8 @@ void __init setup_arch(char **cmdline_p) extern int mem_reserve(unsigned long, unsigned long, int); extern void bootmem_init(void); - memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; *cmdline_p = command_line; /* Reserve some memory regions */ |