GIT db6cffac28280af3ae5f611357f0ed70ddba936b git+ssh://master.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git#master commit Author: Kyle McMartin Date: Tue Mar 27 16:47:49 2007 -0400 [PARISC] Let PA-8900 processors boot Signed-off-by: Kyle McMartin commit 9091dea557420ec71fa23d8059024607e2e5ecd3 Author: Alexey Dobriyan Date: Sat Mar 17 19:28:27 2007 +0300 parisc: convert /proc/gsc/pcxl_dma to seq_file As side effect, remove one more ->get_info user and a novel approach of content generation: sprintf(buf, "%sfoo", buf, ...); sprintf(buf, "%sbar", buf, ...); ... Compile-tested. Signed-off-by: Alexey Dobriyan Signed-off-by: Kyle McMartin commit 75d9fb99c9428c7a485b2ff7fd1c08606a700a84 Author: Kyle McMartin Date: Sat Mar 17 11:17:31 2007 -0400 [PARISC] Wire up kexec_load syscall Definitely unimplemented at this point and will just trap to sys_ni_syscall... Signed-off-by: Kyle McMartin commit 47489e6820be06eb56ff316fedffc200d4c1e0b3 Author: Kyle McMartin Date: Sat Mar 17 11:15:01 2007 -0400 [PARISC] Move #undef to end of syscall table Signed-off-by: Kyle McMartin commit 7a0db34470039284350bbc4a1d5f7002d01fc382 Author: Alexandr Andreev Date: Tue Mar 6 02:44:13 2007 -0800 parisc: sync compat getdents Add VERIFY_WRITE check in the beginning like compat_sys_getdents() EFAULT on parisc if put_user() fails. Signed-off-by: Alexandr Andreev Signed-off-by: Alexey Dobriyan Cc: Kyle McMartin Cc: Matthew Wilcox Cc: Grant Grundler Signed-off-by: Andrew Morton Signed-off-by: Kyle McMartin commit a1adb1fdd50e4fd2b1b089de90ef031e28b560cc Author: Alexey Dobriyan Date: Sat Mar 3 01:13:35 2007 +0000 parisc: make command_line[] static Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Kyle McMartin arch/parisc/kernel/hardware.c | 4 +- arch/parisc/kernel/pci-dma.c | 94 ++++++++++++++++++++---------------- arch/parisc/kernel/perf.c | 6 ++ arch/parisc/kernel/setup.c | 3 + arch/parisc/kernel/sys_parisc32.c | 10 +++- arch/parisc/kernel/syscall_table.S | 11 ++-- include/asm-parisc/hardware.h | 3 + include/asm-parisc/processor.h | 4 +- include/asm-parisc/unistd.h | 3 + 9 files changed, 82 insertions(+), 56 deletions(-) diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index 18ba4cb..eb607e2 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c @@ -1296,6 +1296,7 @@ static struct hp_cpu_type_mask { { 0x05f0, 0x0ff0, pcxw2 }, /* 0x05f0 - 0x05ff */ { 0x0600, 0x0fe0, pcxl }, /* 0x0600 - 0x061f */ { 0x0880, 0x0ff0, mako }, /* 0x0880 - 0x088f */ + { 0x0890, 0x0ff0, mako2 }, /* 0x0890 - 0x089f */ { 0x0000, 0x0000, pcx } /* terminate table */ }; @@ -1311,7 +1312,8 @@ char *cpu_name_version[][2] = { [pcxw] = { "PA8500 (PCX-W)", "2.0" }, [pcxw_] = { "PA8600 (PCX-W+)", "2.0" }, [pcxw2] = { "PA8700 (PCX-W2)", "2.0" }, - [mako] = { "PA8800 (Mako)", "2.0" } + [mako] = { "PA8800 (Mako)", "2.0" }, + [mako2] = { "PA8900 (Shortfin)", "2.0" } }; const char * __init diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index 0c3aecb..23c1388 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c @@ -21,6 +21,7 @@ #include #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include /* for purge_tlb_*() macros */ static struct proc_dir_entry * proc_gsc_root __read_mostly = NULL; -static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length); static unsigned long pcxl_used_bytes __read_mostly = 0; static unsigned long pcxl_used_pages __read_mostly = 0; @@ -330,6 +330,54 @@ pcxl_free_range(unsigned long vaddr, siz dump_resmap(); } +static int proc_pcxl_dma_show(struct seq_file *m, void *v) +{ +#if 0 + u_long i = 0; + unsigned long *res_ptr = (u_long *)pcxl_res_map; +#endif + unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ + + seq_printf(m, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", + PCXL_DMA_MAP_SIZE, total_pages); + + seq_printf(m, "Resource bitmap : %d bytes\n", pcxl_res_size); + + seq_puts(m, " total: free: used: % used:\n"); + seq_printf(m, "blocks %8d %8ld %8ld %8ld%%\n", pcxl_res_size, + pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes, + (pcxl_used_bytes * 100) / pcxl_res_size); + + seq_printf(m, "pages %8ld %8ld %8ld %8ld%%\n", total_pages, + total_pages - pcxl_used_pages, pcxl_used_pages, + (pcxl_used_pages * 100 / total_pages)); + +#if 0 + seq_puts(m, "\nResource bitmap:"); + + for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { + if ((i & 7) == 0) + seq_puts(m,"\n "); + seq_printf(m, "%s %08lx", buf, *res_ptr); + } +#endif + seq_putc(m, '\n'); + return 0; +} + +static int proc_pcxl_dma_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_pcxl_dma_show, NULL); +} + +static const struct file_operations proc_pcxl_dma_ops = { + .owner = THIS_MODULE, + .open = proc_pcxl_dma_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static int __init pcxl_dma_init(void) { @@ -348,9 +396,10 @@ pcxl_dma_init(void) "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); else { struct proc_dir_entry* ent; - ent = create_proc_info_entry("pcxl_dma", 0, - proc_gsc_root, pcxl_proc_info); - if (!ent) + ent = create_proc_entry("pcxl_dma", 0, proc_gsc_root); + if (ent) + ent->proc_fops = &proc_pcxl_dma_ops; + else printk(KERN_WARNING "pci-dma.c: Unable to create pcxl_dma /proc entry.\n"); } @@ -551,40 +600,3 @@ struct hppa_dma_ops pcx_dma_ops = { .dma_sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu, .dma_sync_sg_for_device = pa11_dma_sync_sg_for_device, }; - - -static int pcxl_proc_info(char *buf, char **start, off_t offset, int len) -{ -#if 0 - u_long i = 0; - unsigned long *res_ptr = (u_long *)pcxl_res_map; -#endif - unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ - - sprintf(buf, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", - PCXL_DMA_MAP_SIZE, total_pages); - - sprintf(buf, "%sResource bitmap : %d bytes\n", buf, pcxl_res_size); - - strcat(buf, " total: free: used: % used:\n"); - sprintf(buf, "%sblocks %8d %8ld %8ld %8ld%%\n", buf, pcxl_res_size, - pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes, - (pcxl_used_bytes * 100) / pcxl_res_size); - - sprintf(buf, "%spages %8ld %8ld %8ld %8ld%%\n", buf, total_pages, - total_pages - pcxl_used_pages, pcxl_used_pages, - (pcxl_used_pages * 100 / total_pages)); - -#if 0 - strcat(buf, "\nResource bitmap:"); - - for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { - if ((i & 7) == 0) - strcat(buf,"\n "); - sprintf(buf, "%s %08lx", buf, *res_ptr); - } -#endif - strcat(buf, "\n"); - return strlen(buf); -} - diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index a46bc62..d4d6be1 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -511,10 +511,12 @@ static int __init perf_init(void) } else if (boot_cpu_data.cpu_type == pcxw || boot_cpu_data.cpu_type == pcxw_ || boot_cpu_data.cpu_type == pcxw2 || - boot_cpu_data.cpu_type == mako) { + boot_cpu_data.cpu_type == mako || + boot_cpu_data.cpu_type == mako2) { perf_processor_interface = CUDA_INTF; if (boot_cpu_data.cpu_type == pcxw2 || - boot_cpu_data.cpu_type == mako) + boot_cpu_data.cpu_type == mako || + boot_cpu_data.cpu_type == mako2) bitmask_array = perf_bitmasks_piranha; } else { perf_processor_interface = UNKNOWN_INTF; diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 9818919..b34882c 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -45,7 +45,7 @@ #include #include #include -char __initdata command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */ struct proc_dir_entry * proc_runway_root __read_mostly = NULL; @@ -225,6 +225,7 @@ static void __init parisc_proc_mkdir(voi } break; case mako: + case mako2: if (NULL == proc_mckinley_root) { proc_mckinley_root = proc_mkdir("bus/mckinley", NULL); diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index ce3245f..a8ebac4 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c @@ -350,6 +350,10 @@ sys32_getdents (unsigned int fd, void __ struct getdents32_callback buf; int error; + error = -EFAULT; + if (!access_ok(VERIFY_WRITE, dirent, count)) + goto out; + error = -EBADF; file = fget(fd); if (!file) @@ -366,8 +370,10 @@ sys32_getdents (unsigned int fd, void __ error = buf.error; lastdirent = buf.previous; if (lastdirent) { - put_user(file->f_pos, &lastdirent->d_off); - error = count - buf.count; + if (put_user(file->f_pos, &lastdirent->d_off)) + error = -EFAULT; + else + error = count - buf.count; } out_putf: diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 8bf87e5..7e04db6 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -30,11 +30,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#undef ENTRY_SAME -#undef ENTRY_DIFF -#undef ENTRY_UHOH -#undef ENTRY_COMP -#undef ENTRY_OURS #if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT) /* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific @@ -405,5 +400,11 @@ #endif ENTRY_SAME(epoll_pwait) ENTRY_COMP(statfs64) ENTRY_COMP(fstatfs64) + ENTRY_COMP(kexec_load) /* 300 */ /* Nothing yet */ +#undef ENTRY_SAME +#undef ENTRY_DIFF +#undef ENTRY_UHOH +#undef ENTRY_COMP +#undef ENTRY_OURS diff --git a/include/asm-parisc/hardware.h b/include/asm-parisc/hardware.h index 76d880d..daf58dd 100644 --- a/include/asm-parisc/hardware.h +++ b/include/asm-parisc/hardware.h @@ -31,7 +31,8 @@ enum cpu_type { pcxw = 8, /* pa8500 pa 2.0 */ pcxw_ = 9, /* pa8600 (w+) pa 2.0 */ pcxw2 = 10, /* pa8700 pa 2.0 */ - mako = 11 /* pa8800 pa 2.0 */ + mako = 11, /* pa8800 pa 2.0 */ + mako2 = 12 /* pa8900 pa 2.0 */ }; extern char *cpu_name_version[][2]; /* mapping from enum cpu_type to strings */ diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index d2f3967..0052dc9 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h @@ -334,8 +334,8 @@ #define cpu_relax() barrier() static inline int parisc_requires_coherency(void) { #ifdef CONFIG_PA8X00 - /* FIXME: also pa8900 - when we see one */ - return boot_cpu_data.cpu_type == mako; + return (boot_cpu_data.cpu_type == mako) || + (boot_cpu_data.cpu_type == mako2); #else return 0; #endif diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 2f7c408..693743f 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h @@ -792,8 +792,9 @@ #define __NR_getcpu (__NR_Linux + 296) #define __NR_epoll_pwait (__NR_Linux + 297) #define __NR_statfs64 (__NR_Linux + 298) #define __NR_fstatfs64 (__NR_Linux + 299) +#define __NR_kexec_load (__NR_Linux + 300) -#define __NR_Linux_syscalls (__NR_fstatfs64 + 1) +#define __NR_Linux_syscalls (__NR_kexec_load + 1) #define HPUX_GATEWAY_ADDR 0xC0000004 #define LINUX_GATEWAY_ADDR 0x100