From 58554927f85616c374795fbddcf0607a3faa7c46 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 13 Oct 2006 12:32:50 -0600 Subject: [PARISC] Delete arch/parisc/mm/kmap.c again I deleted this file from 2.4 5 years ago. Unfortunately, that change never got merged to Linus and so when we switched to 2.5 it came back and nobody noticed. It's never been built in 2.5/2.6 as it was never in the Makefile. Signed-off-by: Matthew Wilcox Signed-off-by: Kyle McMartin --- arch/parisc/mm/kmap.c | 166 -------------------------------------------------- 1 file changed, 166 deletions(-) delete mode 100644 arch/parisc/mm/kmap.c (limited to 'arch/parisc/mm') diff --git a/arch/parisc/mm/kmap.c b/arch/parisc/mm/kmap.c deleted file mode 100644 index 1b1acd5e2f6e..000000000000 --- a/arch/parisc/mm/kmap.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * kmap/page table map and unmap support routines - * - * Copyright 1999,2000 Hewlett-Packard Company - * Copyright 2000 John Marvin - * Copyright 2000 Grant Grundler - * Copyright 2000 Philipp Rumpf - * - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/* -** Stolen mostly from arch/parisc/kernel/pci-dma.c -*/ - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include /* get_order */ - -#undef flush_cache_all -#define flush_cache_all flush_all_caches - -typedef void (*pte_iterator_t) (pte_t * pte, unsigned long arg); - -#if 0 -/* XXX This routine could be used with iterate_page() to replace - * unmap_uncached_page() and save a little code space but I didn't - * do that since I'm not certain whether this is the right path. -PB - */ -static void unmap_cached_pte(pte_t * pte, unsigned long addr, unsigned long arg) -{ - pte_t page = *pte; - pte_clear(&init_mm, addr, pte); - if (!pte_none(page)) { - if (pte_present(page)) { - unsigned long map_nr = pte_pagenr(page); - if (map_nr < max_mapnr) - __free_page(mem_map + map_nr); - } else { - printk(KERN_CRIT - "Whee.. Swapped out page in kernel page table\n"); - } - } -} -#endif - -/* These two routines should probably check a few things... */ -static void set_uncached(pte_t * pte, unsigned long arg) -{ - pte_val(*pte) |= _PAGE_NO_CACHE; -} - -static void set_cached(pte_t * pte, unsigned long arg) -{ - pte_val(*pte) &= ~_PAGE_NO_CACHE; -} - -static inline void iterate_pte(pmd_t * pmd, unsigned long address, - unsigned long size, pte_iterator_t op, - unsigned long arg) -{ - pte_t *pte; - unsigned long end; - - if (pmd_none(*pmd)) - return; - if (pmd_bad(*pmd)) { - pmd_ERROR(*pmd); - pmd_clear(pmd); - return; - } - pte = pte_offset(pmd, address); - address &= ~PMD_MASK; - end = address + size; - if (end > PMD_SIZE) - end = PMD_SIZE; - do { - op(pte, arg); - address += PAGE_SIZE; - pte++; - } while (address < end); -} - -static inline void iterate_pmd(pgd_t * dir, unsigned long address, - unsigned long size, pte_iterator_t op, - unsigned long arg) -{ - pmd_t *pmd; - unsigned long end; - - if (pgd_none(*dir)) - return; - if (pgd_bad(*dir)) { - pgd_ERROR(*dir); - pgd_clear(dir); - return; - } - pmd = pmd_offset(dir, address); - address &= ~PGDIR_MASK; - end = address + size; - if (end > PGDIR_SIZE) - end = PGDIR_SIZE; - do { - iterate_pte(pmd, address, end - address, op, arg); - address = (address + PMD_SIZE) & PMD_MASK; - pmd++; - } while (address < end); -} - -static void iterate_pages(unsigned long address, unsigned long size, - pte_iterator_t op, unsigned long arg) -{ - pgd_t *dir; - unsigned long end = address + size; - - dir = pgd_offset_k(address); - flush_cache_all(); - do { - iterate_pmd(dir, address, end - address, op, arg); - address = (address + PGDIR_SIZE) & PGDIR_MASK; - dir++; - } while (address && (address < end)); - flush_tlb_all(); -} - -void -kernel_set_cachemode(unsigned long vaddr, unsigned long size, int what) -{ - switch (what) { - case IOMAP_FULL_CACHING: - iterate_pages(vaddr, size, set_cached, 0); - flush_tlb_range(NULL, vaddr, size); - break; - case IOMAP_NOCACHE_SER: - iterate_pages(vaddr, size, set_uncached, 0); - flush_tlb_range(NULL, vaddr, size); - break; - default: - printk(KERN_CRIT - "kernel_set_cachemode mode %d not understood\n", - what); - break; - } -} -- cgit v1.2.3-59-g8ed1b From ce8420bb65d25335c3b48ddfb1b5a244f53bfb75 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sat, 14 Oct 2006 22:10:44 +0200 Subject: [PARISC] Show more memory information and memory layout at bootup Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'arch/parisc/mm') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 0667f2b4f977..d9e4ab545b38 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -24,6 +24,7 @@ #include /* for release_pages and page_cache_release */ #include +#include #include #include #include @@ -453,6 +454,9 @@ unsigned long pcxl_dma_start __read_mostly; void __init mem_init(void) { + int codesize, reservedpages, datasize, initsize; + int tmp; + high_memory = __va((max_pfn << PAGE_SHIFT)); #ifndef CONFIG_DISCONTIGMEM @@ -466,8 +470,17 @@ void __init mem_init(void) totalram_pages += free_all_bootmem_node(NODE_DATA(i)); } #endif + codesize = (unsigned long) &_etext - (unsigned long) &_text; + datasize = (unsigned long) &_edata - (unsigned long) &_etext; + initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; - printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10)); + reservedpages = 0; + for (tmp = 0; tmp < max_low_pfn; tmp++) + /* + * Only count reserved RAM pages + */ + if (PageReserved(pfn_to_page(tmp))) + reservedpages++; #ifdef CONFIG_PA11 if (hppa_dma_ops == &pcxl_dma_ops) { @@ -481,6 +494,39 @@ void __init mem_init(void) vmalloc_start = SET_MAP_OFFSET(MAP_START); #endif + printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n", + (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), + num_physpages << (PAGE_SHIFT-10), + codesize >> 10, + reservedpages << (PAGE_SHIFT-10), + datasize >> 10, + initsize >> 10, + (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)) + ); + +#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ + printk("virtual kernel memory layout:\n" + " vmalloc : 0x%p - 0x%p (%4ld MB)\n" + " lowmem : 0x%p - 0x%p (%4ld MB)\n" + " .init : 0x%p - 0x%p (%4ld kB)\n" + " .data : 0x%p - 0x%p (%4ld kB)\n" + " .text : 0x%p - 0x%p (%4ld kB)\n", + + (void*)VMALLOC_START, (void*)VMALLOC_END, + (VMALLOC_END - VMALLOC_START) >> 20, + + __va(0), high_memory, + ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20, + + &__init_begin, &__init_end, + ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10, + + &_etext, &_edata, + ((unsigned long)&_edata - (unsigned long)&_etext) >> 10, + + &_text, &_etext, + ((unsigned long)&_etext - (unsigned long)&_text) >> 10); +#endif } unsigned long *empty_zero_page __read_mostly; -- cgit v1.2.3-59-g8ed1b From 53faf2910d3539a963d171674ad6364ff2854eea Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 16 Oct 2006 20:34:00 -0400 Subject: [PARISC] Unbreak discontigmem mem_init() The `simple' way of walking and checking PageReserved is broken on discontigmem, instead we need to check each range explicitly. (Also rename a few things so they make more sense.) Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 50 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'arch/parisc/mm') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index d9e4ab545b38..1c5fe8f5037b 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -455,7 +455,6 @@ unsigned long pcxl_dma_start __read_mostly; void __init mem_init(void) { int codesize, reservedpages, datasize, initsize; - int tmp; high_memory = __va((max_pfn << PAGE_SHIFT)); @@ -470,17 +469,33 @@ void __init mem_init(void) totalram_pages += free_all_bootmem_node(NODE_DATA(i)); } #endif - codesize = (unsigned long) &_etext - (unsigned long) &_text; - datasize = (unsigned long) &_edata - (unsigned long) &_etext; - initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; + + codesize = (unsigned long)_etext - (unsigned long)_text; + datasize = (unsigned long)_edata - (unsigned long)_etext; + initsize = (unsigned long)__init_end - (unsigned long)__init_begin; reservedpages = 0; - for (tmp = 0; tmp < max_low_pfn; tmp++) +{ + unsigned long pfn; +#ifdef CONFIG_DISCONTIGMEM + int i; + + for (i = 0; i < npmem_ranges; i++) { + for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) { + if (PageReserved(pfn_to_page(pfn))) + reservedpages++; + } + } +#else /* !CONFIG_DISCONTIGMEM */ + for (pfn = 0; pfn < max_pfn; pfn++) { /* * Only count reserved RAM pages */ - if (PageReserved(pfn_to_page(tmp))) + if (PageReserved(pfn_to_page(pfn))) reservedpages++; + } +#endif +} #ifdef CONFIG_PA11 if (hppa_dma_ops == &pcxl_dma_ops) { @@ -494,20 +509,19 @@ void __init mem_init(void) vmalloc_start = SET_MAP_OFFSET(MAP_START); #endif - printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n", - (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), + printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", + (unsigned long)nr_free_pages() << (PAGE_SHIFT-10), num_physpages << (PAGE_SHIFT-10), codesize >> 10, reservedpages << (PAGE_SHIFT-10), datasize >> 10, - initsize >> 10, - (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)) - ); + initsize >> 10 + ); #ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ printk("virtual kernel memory layout:\n" " vmalloc : 0x%p - 0x%p (%4ld MB)\n" - " lowmem : 0x%p - 0x%p (%4ld MB)\n" + " memory : 0x%p - 0x%p (%4ld MB)\n" " .init : 0x%p - 0x%p (%4ld kB)\n" " .data : 0x%p - 0x%p (%4ld kB)\n" " .text : 0x%p - 0x%p (%4ld kB)\n", @@ -518,14 +532,14 @@ void __init mem_init(void) __va(0), high_memory, ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20, - &__init_begin, &__init_end, - ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10, + __init_begin, __init_end, + ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10, - &_etext, &_edata, - ((unsigned long)&_edata - (unsigned long)&_etext) >> 10, + _etext, _edata, + ((unsigned long)_edata - (unsigned long)_etext) >> 10, - &_text, &_etext, - ((unsigned long)&_etext - (unsigned long)&_text) >> 10); + _text, _etext, + ((unsigned long)_etext - (unsigned long)_text) >> 10); #endif } -- cgit v1.2.3-59-g8ed1b From e51ec241784f516ad3a916a24ac936364cd10d63 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Sun, 5 Nov 2006 15:24:48 -0700 Subject: [PARISC] more sparse fixes 0/NULL changes, __user annotations, __iomem annotations Signed-off-by: Matthew Wilcox Signed-off-by: Kyle McMartin --- arch/parisc/hpux/fs.c | 26 +++++++++++++------------- arch/parisc/hpux/sys_hpux.c | 32 +++++++++++++++++--------------- arch/parisc/kernel/pci-dma.c | 2 +- arch/parisc/mm/ioremap.c | 6 +++--- 4 files changed, 34 insertions(+), 32 deletions(-) (limited to 'arch/parisc/mm') diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 4204cd1f3cf9..c7a81a2c014c 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c @@ -35,13 +35,13 @@ int hpux_execve(struct pt_regs *regs) int error; char *filename; - filename = getname((char *) regs->gr[26]); + filename = getname((char __user *) regs->gr[26]); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; - error = do_execve(filename, (char **) regs->gr[25], - (char **)regs->gr[24], regs); + error = do_execve(filename, (char __user * __user *) regs->gr[25], + (char __user * __user *) regs->gr[24], regs); if (error == 0) { task_lock(current); @@ -63,19 +63,19 @@ struct hpux_dirent { }; struct getdents_callback { - struct hpux_dirent *current_dir; - struct hpux_dirent *previous; + struct hpux_dirent __user *current_dir; + struct hpux_dirent __user *previous; int count; int error; }; -#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de))) +#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) static int filldir(void * __buf, const char * name, int namlen, loff_t offset, u64 ino, unsigned d_type) { - struct hpux_dirent * dirent; + struct hpux_dirent __user * dirent; struct getdents_callback * buf = (struct getdents_callback *) __buf; ino_t d_ino; int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); @@ -105,10 +105,10 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, #undef NAME_OFFSET #undef ROUND_UP -int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count) +int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned int count) { struct file * file; - struct hpux_dirent * lastdirent; + struct hpux_dirent __user * lastdirent; struct getdents_callback buf; int error = -EBADF; @@ -143,7 +143,7 @@ int hpux_mount(const char *fs, const char *path, int mflag, return -ENOSYS; } -static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 *statbuf) +static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 __user *statbuf) { struct hpux_stat64 tmp; @@ -169,7 +169,7 @@ static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 *statbuf) return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; } -long hpux_stat64(char *filename, struct hpux_stat64 *statbuf) +long hpux_stat64(char __user *filename, struct hpux_stat64 __user *statbuf) { struct kstat stat; int error = vfs_stat(filename, &stat); @@ -180,7 +180,7 @@ long hpux_stat64(char *filename, struct hpux_stat64 *statbuf) return error; } -long hpux_fstat64(unsigned int fd, struct hpux_stat64 *statbuf) +long hpux_fstat64(unsigned int fd, struct hpux_stat64 __user *statbuf) { struct kstat stat; int error = vfs_fstat(fd, &stat); @@ -191,7 +191,7 @@ long hpux_fstat64(unsigned int fd, struct hpux_stat64 *statbuf) return error; } -long hpux_lstat64(char *filename, struct hpux_stat64 *statbuf) +long hpux_lstat64(char __user *filename, struct hpux_stat64 __user *statbuf) { struct kstat stat; int error = vfs_lstat(filename, &stat); diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index 2e2dc4f2c853..372edb0348d3 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c @@ -61,7 +61,7 @@ int hpux_ptrace(void) return -ENOSYS; } -int hpux_wait(int *stat_loc) +int hpux_wait(int __user *stat_loc) { return sys_waitpid(-1, stat_loc, 0); } @@ -255,7 +255,7 @@ asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf) /* TODO: Are these put_user calls OK? Should they pass an int? * (I copied it from sys_i386.c like this.) */ -static int hpux_uname(struct hpux_utsname *name) +static int hpux_uname(struct hpux_utsname __user *name) { int error; @@ -300,14 +300,14 @@ static int hpux_uname(struct hpux_utsname *name) /* Note: HP-UX just uses the old suser() function to check perms * in this system call. We'll use capable(CAP_SYS_ADMIN). */ -int hpux_utssys(char *ubuf, int n, int type) +int hpux_utssys(char __user *ubuf, int n, int type) { int len; int error; switch( type ) { case 0: /* uname(): */ - return( hpux_uname( (struct hpux_utsname *)ubuf ) ); + return hpux_uname((struct hpux_utsname __user *)ubuf); break ; case 1: /* Obsolete (used to be umask().) */ @@ -315,8 +315,9 @@ int hpux_utssys(char *ubuf, int n, int type) break ; case 2: /* ustat(): */ - return( hpux_ustat(new_decode_dev(n), (struct hpux_ustat *)ubuf) ); - break ; + return hpux_ustat(new_decode_dev(n), + (struct hpux_ustat __user *)ubuf); + break; case 3: /* setuname(): * @@ -332,7 +333,7 @@ int hpux_utssys(char *ubuf, int n, int type) return -EINVAL ; /* Unlike Linux, HP-UX truncates it if n is too big: */ len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ; - return( sys_sethostname(ubuf, len) ); + return sys_sethostname(ubuf, len); break ; case 4: /* sethostname(): @@ -346,7 +347,7 @@ int hpux_utssys(char *ubuf, int n, int type) return -EINVAL ; /* Unlike Linux, HP-UX truncates it if n is too big: */ len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ; - return( sys_sethostname(ubuf, len) ); + return sys_sethostname(ubuf, len); break ; case 5: /* gethostname(): @@ -356,7 +357,7 @@ int hpux_utssys(char *ubuf, int n, int type) /* Unlike Linux, HP-UX returns an error if n==0: */ if ( n <= 0 ) return -EINVAL ; - return( sys_gethostname(ubuf, n) ); + return sys_gethostname(ubuf, n); break ; case 6: /* Supposedly called from setuname() in libc. @@ -420,7 +421,7 @@ int hpux_utssys(char *ubuf, int n, int type) } } -int hpux_getdomainname(char *name, int len) +int hpux_getdomainname(char __user *name, int len) { int nlen; int err = -EFAULT; @@ -471,17 +472,18 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2) printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1); if ( opcode == 1 ) { /* GETFSIND */ - len = strlen_user((char *)arg1); + char __user *user_fsname = (char __user *)arg1; + len = strlen_user(user_fsname); printk(KERN_DEBUG "len of arg1 = %d\n", len); if (len == 0) return 0; - fsname = (char *) kmalloc(len, GFP_KERNEL); - if ( !fsname ) { + fsname = kmalloc(len, GFP_KERNEL); + if (!fsname) { printk(KERN_DEBUG "failed to kmalloc fsname\n"); return 0; } - if ( copy_from_user(fsname, (char *)arg1, len) ) { + if (copy_from_user(fsname, user_fsname, len)) { printk(KERN_DEBUG "failed to copy_from_user fsname\n"); kfree(fsname); return 0; @@ -495,7 +497,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2) fstype = 0; } else { fstype = 0; - }; + } kfree(fsname); diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index a6caf1073085..0c3aecb85a5c 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c @@ -342,7 +342,7 @@ pcxl_dma_init(void) pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL, get_order(pcxl_res_size)); memset(pcxl_res_map, 0, pcxl_res_size); - proc_gsc_root = proc_mkdir("gsc", 0); + proc_gsc_root = proc_mkdir("gsc", NULL); if (!proc_gsc_root) printk(KERN_WARNING "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c index 47a1d2ac9419..6c6102307c06 100644 --- a/arch/parisc/mm/ioremap.c +++ b/arch/parisc/mm/ioremap.c @@ -128,7 +128,7 @@ remap_area_pages(unsigned long address, unsigned long phys_addr, */ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { - void *addr; + void __iomem *addr; struct vm_struct *area; unsigned long offset, last_addr; @@ -178,13 +178,13 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l if (!area) return NULL; - addr = area->addr; + addr = (void __iomem *) area->addr; if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vfree(addr); return NULL; } - return (void __iomem *) (offset + (char *)addr); + return (void __iomem *) (offset + (char __iomem *)addr); } EXPORT_SYMBOL(__ioremap); -- cgit v1.2.3-59-g8ed1b From be10815f0eeb9578f103b79f696da4548f39e8ad Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sun, 15 Oct 2006 22:40:27 -0400 Subject: [PARISC] bloody printf fmt string warnings Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/parisc/mm') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 1c5fe8f5037b..fc49a5ed78cc 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -608,7 +608,7 @@ void show_mem(void) printk("Zone list for zone %d on node %d: ", j, i); for (k = 0; zl->zones[k] != NULL; k++) - printk("[%d/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); + printk("[%ld/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); printk("\n"); } } -- cgit v1.2.3-59-g8ed1b From 94a1981df056e349b926164915894436acdb8dd5 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 19 Dec 2006 22:33:58 +0100 Subject: [PARISC] whitespace cleanups and unify 32/64bit user-access assembler inlines Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/mm/fault.c | 4 --- include/asm-parisc/uaccess.h | 86 ++++++++++++++------------------------------ 2 files changed, 27 insertions(+), 63 deletions(-) (limited to 'arch/parisc/mm') diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 641f9c920eee..f6f67554c623 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -24,10 +24,6 @@ /* dumped to the console via printk) */ -/* Defines for parisc_acctyp() */ -#define READ 0 -#define WRITE 1 - /* Various important other fields */ #define bit22set(x) (x & 0x00000200) #define bits23_25set(x) (x & 0x000001c0) diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h index 2e87e823600a..98c36dcadf80 100644 --- a/include/asm-parisc/uaccess.h +++ b/include/asm-parisc/uaccess.h @@ -42,16 +42,18 @@ static inline long access_ok(int type, const void __user * addr, #define put_user __put_user #define get_user __get_user -#if BITS_PER_LONG == 32 +#if !defined(__LP64__) #define LDD_KERNEL(ptr) __get_kernel_bad(); #define LDD_USER(ptr) __get_user_bad(); #define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr) #define STD_USER(x, ptr) __put_user_asm64(x,ptr) +#define ASM_WORD_INSN ".word\t" #else -#define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr) -#define LDD_USER(ptr) __get_user_asm("ldd",ptr) -#define STD_KERNEL(x, ptr) __put_kernel_asm("std",x,ptr) -#define STD_USER(x, ptr) __put_user_asm("std",x,ptr) +#define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr) +#define LDD_USER(ptr) __get_user_asm("ldd",ptr) +#define STD_KERNEL(x, ptr) __put_kernel_asm("std",x,ptr) +#define STD_USER(x, ptr) __put_user_asm("std",x,ptr) +#define ASM_WORD_INSN ".dword\t" #endif /* @@ -103,11 +105,11 @@ struct exception_data { __gu_err; \ }) -#ifdef __LP64__ #define __get_kernel_asm(ldx,ptr) \ __asm__("\n1:\t" ldx "\t0(%2),%0\n" \ "\t.section __ex_table,\"aw\"\n" \ - "\t.dword\t1b,fixup_get_user_skip_1\n" \ + "\t" ASM_WORD_INSN \ + "1b,fixup_get_user_skip_1\n" \ "\t.previous" \ : "=r"(__gu_val), "=r"(__gu_err) \ : "r"(ptr), "1"(__gu_err) \ @@ -116,30 +118,12 @@ struct exception_data { #define __get_user_asm(ldx,ptr) \ __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n" \ "\t.section __ex_table,\"aw\"\n" \ - "\t.dword\t1b,fixup_get_user_skip_1\n" \ + "\t" ASM_WORD_INSN \ + "1b,fixup_get_user_skip_1\n" \ "\t.previous" \ : "=r"(__gu_val), "=r"(__gu_err) \ : "r"(ptr), "1"(__gu_err) \ : "r1"); -#else -#define __get_kernel_asm(ldx,ptr) \ - __asm__("\n1:\t" ldx "\t0(%2),%0\n" \ - "\t.section __ex_table,\"aw\"\n" \ - "\t.word\t1b,fixup_get_user_skip_1\n" \ - "\t.previous" \ - : "=r"(__gu_val), "=r"(__gu_err) \ - : "r"(ptr), "1"(__gu_err) \ - : "r1"); - -#define __get_user_asm(ldx,ptr) \ - __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n" \ - "\t.section __ex_table,\"aw\"\n" \ - "\t.word\t1b,fixup_get_user_skip_1\n" \ - "\t.previous" \ - : "=r"(__gu_val), "=r"(__gu_err) \ - : "r"(ptr), "1"(__gu_err) \ - : "r1"); -#endif /* !__LP64__ */ #define __put_user(x,ptr) \ ({ \ @@ -178,12 +162,12 @@ struct exception_data { * r8/r9 are already listed as err/val. */ -#ifdef __LP64__ #define __put_kernel_asm(stx,x,ptr) \ __asm__ __volatile__ ( \ "\n1:\t" stx "\t%2,0(%1)\n" \ "\t.section __ex_table,\"aw\"\n" \ - "\t.dword\t1b,fixup_put_user_skip_1\n" \ + "\t" ASM_WORD_INSN \ + "1b,fixup_put_user_skip_1\n" \ "\t.previous" \ : "=r"(__pu_err) \ : "r"(ptr), "r"(x), "0"(__pu_err) \ @@ -193,36 +177,20 @@ struct exception_data { __asm__ __volatile__ ( \ "\n1:\t" stx "\t%2,0(%%sr3,%1)\n" \ "\t.section __ex_table,\"aw\"\n" \ - "\t.dword\t1b,fixup_put_user_skip_1\n" \ - "\t.previous" \ - : "=r"(__pu_err) \ - : "r"(ptr), "r"(x), "0"(__pu_err) \ - : "r1") -#else -#define __put_kernel_asm(stx,x,ptr) \ - __asm__ __volatile__ ( \ - "\n1:\t" stx "\t%2,0(%1)\n" \ - "\t.section __ex_table,\"aw\"\n" \ - "\t.word\t1b,fixup_put_user_skip_1\n" \ - "\t.previous" \ + "\t" ASM_WORD_INSN \ + "1b,fixup_put_user_skip_1\n" \ + "\t.previous" \ : "=r"(__pu_err) \ : "r"(ptr), "r"(x), "0"(__pu_err) \ : "r1") -#define __put_user_asm(stx,x,ptr) \ - __asm__ __volatile__ ( \ - "\n1:\t" stx "\t%2,0(%%sr3,%1)\n" \ - "\t.section __ex_table,\"aw\"\n" \ - "\t.word\t1b,fixup_put_user_skip_1\n" \ - "\t.previous" \ - : "=r"(__pu_err) \ - : "r"(ptr), "r"(x), "0"(__pu_err) \ - : "r1") -#define __put_kernel_asm64(__val,ptr) do { \ - u64 __val64 = (u64)(__val); \ - u32 hi = (__val64) >> 32; \ - u32 lo = (__val64) & 0xffffffff; \ +#if !defined(__LP64__) + +#define __put_kernel_asm64(__val,ptr) do { \ + u64 __val64 = (u64)(__val); \ + u32 hi = (__val64) >> 32; \ + u32 lo = (__val64) & 0xffffffff; \ __asm__ __volatile__ ( \ "\n1:\tstw %2,0(%1)\n" \ "\n2:\tstw %3,4(%1)\n" \ @@ -235,10 +203,10 @@ struct exception_data { : "r1"); \ } while (0) -#define __put_user_asm64(__val,ptr) do { \ - u64 __val64 = (u64)__val; \ - u32 hi = (__val64) >> 32; \ - u32 lo = (__val64) & 0xffffffff; \ +#define __put_user_asm64(__val,ptr) do { \ + u64 __val64 = (u64)(__val); \ + u32 hi = (__val64) >> 32; \ + u32 lo = (__val64) & 0xffffffff; \ __asm__ __volatile__ ( \ "\n1:\tstw %2,0(%%sr3,%1)\n" \ "\n2:\tstw %3,4(%%sr3,%1)\n" \ @@ -251,7 +219,7 @@ struct exception_data { : "r1"); \ } while (0) -#endif /* !__LP64__ */ +#endif /* !defined(__LP64__) */ /* -- cgit v1.2.3-59-g8ed1b From a8f44e3889b686813926b288bd4e51a0cf17d2c7 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 28 Jan 2007 14:58:52 +0100 Subject: [PARISC] use CONFIG_64BIT instead of __LP64__ - additionally update my copyright timestamps Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/kernel/asm-offsets.c | 2 +- arch/parisc/kernel/firmware.c | 26 +++++++++++++------------- arch/parisc/kernel/inventory.c | 10 +++++----- arch/parisc/kernel/module.c | 16 ++++++++-------- arch/parisc/kernel/parisc_ksyms.c | 10 +++++----- arch/parisc/kernel/process.c | 4 ++-- arch/parisc/kernel/processor.c | 6 +++--- arch/parisc/kernel/ptrace.c | 10 +++++----- arch/parisc/kernel/setup.c | 6 +++--- arch/parisc/kernel/signal.c | 24 ++++++++++++------------ arch/parisc/kernel/syscall_table.S | 2 +- arch/parisc/kernel/traps.c | 6 +++--- arch/parisc/lib/bitops.c | 4 ++-- arch/parisc/mm/init.c | 8 ++++---- 14 files changed, 67 insertions(+), 67 deletions(-) (limited to 'arch/parisc/mm') diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c index c11a5bc7c067..54fdb959149c 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -44,7 +44,7 @@ #define BLANK() asm volatile("\n->" : : ) -#ifdef __LP64__ +#ifdef CONFIG_64BIT #define FRAME_SIZE 128 #else #define FRAME_SIZE 64 diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index 9158b707c0dd..39dc835bf89e 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(pdc_lock); static unsigned long pdc_result[32] __attribute__ ((aligned (8))); static unsigned long pdc_result2[32] __attribute__ ((aligned (8))); -#ifdef __LP64__ +#ifdef CONFIG_64BIT #define WIDE_FIRMWARE 0x1 #define NARROW_FIRMWARE 0x2 @@ -94,12 +94,12 @@ int parisc_narrow_firmware __read_mostly = 1; * when running a 64-bit kernel on such boxes (e.g. C200 or C360). */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT long real64_call(unsigned long function, ...); #endif long real32_call(unsigned long function, ...); -#ifdef __LP64__ +#ifdef CONFIG_64BIT # define MEM_PDC (unsigned long)(PAGE0->mem_pdc_hi) << 32 | PAGE0->mem_pdc # define mem_pdc_call(args...) unlikely(parisc_narrow_firmware) ? real32_call(MEM_PDC, args) : real64_call(MEM_PDC, args) #else @@ -117,7 +117,7 @@ long real32_call(unsigned long function, ...); */ static unsigned long f_extend(unsigned long address) { -#ifdef __LP64__ +#ifdef CONFIG_64BIT if(unlikely(parisc_narrow_firmware)) { if((address & 0xff000000) == 0xf0000000) return 0xf0f0f0f000000000UL | (u32)address; @@ -139,7 +139,7 @@ static unsigned long f_extend(unsigned long address) */ static void convert_to_wide(unsigned long *addr) { -#ifdef __LP64__ +#ifdef CONFIG_64BIT int i; unsigned int *p = (unsigned int *)addr; @@ -158,7 +158,7 @@ static void convert_to_wide(unsigned long *addr) */ void __init set_firmware_width(void) { -#ifdef __LP64__ +#ifdef CONFIG_64BIT int retval; unsigned long flags; @@ -238,7 +238,7 @@ int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_inf * * Must be correctly formatted or expect system crash */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT int pdc_pat_chassis_send_log(unsigned long state, unsigned long data) { int retval = 0; @@ -949,7 +949,7 @@ int pdc_tod_set(unsigned long sec, unsigned long usec) } EXPORT_SYMBOL(pdc_tod_set); -#ifdef __LP64__ +#ifdef CONFIG_64BIT int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, struct pdc_memory_table *tbl, unsigned long entries) { @@ -965,7 +965,7 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, return retval; } -#endif /* __LP64__ */ +#endif /* CONFIG_64BIT */ /* FIXME: Is this pdc used? I could not find type reference to ftc_bitmap * so I guessed at unsigned long. Someone who knows what this does, can fix @@ -1204,7 +1204,7 @@ int pdc_sti_call(unsigned long func, unsigned long flags, } EXPORT_SYMBOL(pdc_sti_call); -#ifdef __LP64__ +#ifdef CONFIG_64BIT /** * pdc_pat_cell_get_number - Returns the cell number. * @cell_info: The return buffer. @@ -1387,7 +1387,7 @@ int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val) return retval; } -#endif /* __LP64__ */ +#endif /* CONFIG_64BIT */ /***************** 32-bit real-mode calls ***********/ @@ -1445,7 +1445,7 @@ long real32_call(unsigned long fn, ...) return real32_call_asm(&real_stack.sp, &real_stack.arg0, fn); } -#ifdef __LP64__ +#ifdef CONFIG_64BIT /***************** 64-bit real-mode calls ***********/ struct wide_stack { @@ -1496,5 +1496,5 @@ long real64_call(unsigned long fn, ...) return real64_call_asm(&real64_stack.sp, &real64_stack.arg0, fn); } -#endif /* __LP64__ */ +#endif /* CONFIG_64BIT */ diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index 4e847ba53180..4845a6444633 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c @@ -47,7 +47,7 @@ void __init setup_pdc(void) struct pdc_system_map_mod_info module_result; struct pdc_module_path module_path; struct pdc_model model; -#ifdef __LP64__ +#ifdef CONFIG_64BIT struct pdc_pat_cell_num cell_info; #endif @@ -73,7 +73,7 @@ void __init setup_pdc(void) * clearer message. */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT status = pdc_pat_cell_get_number(&cell_info); if (status == PDC_OK) { pdc_type = PDC_TYPE_PAT; @@ -152,7 +152,7 @@ static void __init pagezero_memconfig(void) npmem_ranges = 1; } -#ifdef __LP64__ +#ifdef CONFIG_64BIT /* All of the PDC PAT specific code is 64-bit only */ @@ -408,13 +408,13 @@ static void __init sprockets_memconfig(void) } } -#else /* !__LP64__ */ +#else /* !CONFIG_64BIT */ #define pat_inventory() do { } while (0) #define pat_memconfig() do { } while (0) #define sprockets_memconfig() pagezero_memconfig() -#endif /* !__LP64__ */ +#endif /* !CONFIG_64BIT */ #ifndef CONFIG_PA20 diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 1808f857a73a..fdacdd4341c9 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c @@ -97,7 +97,7 @@ static inline int in_local_section(struct module *me, void *loc, void *dot) } -#ifndef __LP64__ +#ifndef CONFIG_64BIT struct got_entry { Elf32_Addr addr; }; @@ -177,7 +177,7 @@ void *module_alloc(unsigned long size) return vmalloc(size); } -#ifndef __LP64__ +#ifndef CONFIG_64BIT static inline unsigned long count_gots(const Elf_Rela *rela, unsigned long n) { return 0; @@ -320,7 +320,7 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr, return 0; } -#ifdef __LP64__ +#ifdef CONFIG_64BIT static Elf64_Word get_got(struct module *me, unsigned long value, long addend) { unsigned int i; @@ -343,9 +343,9 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend) value); return i * sizeof(struct got_entry); } -#endif /* __LP64__ */ +#endif /* CONFIG_64BIT */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT static Elf_Addr get_fdesc(struct module *me, unsigned long value) { Elf_Fdesc *fdesc = me->module_core + me->arch.fdesc_offset; @@ -369,7 +369,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value) fdesc->gp = (Elf_Addr)me->module_core + me->arch.got_offset; return (Elf_Addr)fdesc; } -#endif /* __LP64__ */ +#endif /* CONFIG_64BIT */ enum elf_stub_type { ELF_STUB_GOT, @@ -395,7 +395,7 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend, i * sizeof(struct stub_entry); } -#ifndef __LP64__ +#ifndef CONFIG_64BIT /* for 32-bit the stub looks like this: * ldil L'XXX,%r1 * be,n R'XXX(%sr4,%r1) @@ -473,7 +473,7 @@ int apply_relocate(Elf_Shdr *sechdrs, return -ENOEXEC; } -#ifndef __LP64__ +#ifndef CONFIG_64BIT int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, unsigned int symindex, diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c index 8f6a0b312f7a..7aca704e96f0 100644 --- a/arch/parisc/kernel/parisc_ksyms.c +++ b/arch/parisc/kernel/parisc_ksyms.c @@ -7,7 +7,7 @@ * Copyright (C) 2001-2003 Grant Grundler * Copyright (C) 2002-2003 Matthew Wilcox * Copyright (C) 2002 Randolph Chung - * Copyright (C) 2002-2003 Helge Deller + * Copyright (C) 2002-2007 Helge Deller * * 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 @@ -38,7 +38,7 @@ EXPORT_SYMBOL(__cmpxchg_u32); #ifdef CONFIG_SMP EXPORT_SYMBOL(__atomic_hash); #endif -#ifdef __LP64__ +#ifdef CONFIG_64BIT EXPORT_SYMBOL(__xchg64); EXPORT_SYMBOL(__cmpxchg_u64); #endif @@ -58,7 +58,7 @@ EXPORT_SYMBOL(fixup_get_user_skip_2); EXPORT_SYMBOL(fixup_put_user_skip_1); EXPORT_SYMBOL(fixup_put_user_skip_2); -#ifndef __LP64__ +#ifndef CONFIG_64BIT /* Needed so insmod can set dp value */ extern int $global$; EXPORT_SYMBOL($global$); @@ -135,7 +135,7 @@ EXPORT_SYMBOL(__muldi3); asmlinkage void * __canonicalize_funcptr_for_compare(void *); EXPORT_SYMBOL(__canonicalize_funcptr_for_compare); -#ifdef __LP64__ +#ifdef CONFIG_64BIT extern void __divdi3(void); extern void __udivdi3(void); extern void __umoddi3(void); @@ -147,7 +147,7 @@ EXPORT_SYMBOL(__umoddi3); EXPORT_SYMBOL(__moddi3); #endif -#ifndef __LP64__ +#ifndef CONFIG_64BIT extern void $$dyncall(void); EXPORT_SYMBOL($$dyncall); #endif diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index dfca014b49ba..0dd3847f494c 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -13,7 +13,7 @@ * Copyright (C) 2000 Grant Grundler * Copyright (C) 2001 Alan Modra * Copyright (C) 2001-2002 Ryan Bradetich - * Copyright (C) 2001-2002 Helge Deller + * Copyright (C) 2001-2007 Helge Deller * Copyright (C) 2002 Randolph Chung * * @@ -303,7 +303,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp, * Copy function and argument to be called from * ret_from_kernel_thread. */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT cregs->gr[27] = pregs->gr[27]; #endif cregs->gr[26] = pregs->gr[26]; diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index b20894a01d56..7c056dcebf55 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -93,7 +93,7 @@ static int __init processor_probe(struct parisc_device *dev) cpuid = boot_cpu_data.cpu_count; txn_addr = dev->hpa.start; /* for legacy PDC */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (is_pdc_pat()) { ulong status; unsigned long bytecnt; @@ -309,11 +309,11 @@ int __init init_per_cpu(int cpunum) } else { printk(KERN_WARNING "WARNING: No FP CoProcessor?!" " (coproc_cfg.ccr_functional == 0x%lx, expected 0xc0)\n" -#ifdef __LP64__ +#ifdef CONFIG_64BIT "Halting Machine - FP required\n" #endif , coproc_cfg.ccr_functional); -#ifdef __LP64__ +#ifdef CONFIG_64BIT mdelay(100); /* previous chars get pushed to console */ panic("FP CoProc not reported"); #endif diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 3f28de974556..0d0d617b6f21 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c @@ -36,7 +36,7 @@ #define DBG(x...) #endif -#ifdef __LP64__ +#ifdef CONFIG_64BIT /* This function is needed to translate 32 bit pt_regs offsets in to * 64 bit pt_regs offsets. For example, a 32 bit gdb under a 64 bit kernel @@ -90,7 +90,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) case PTRACE_PEEKDATA: { int copied; -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (__is_compat_task(child)) { unsigned int tmp; @@ -122,7 +122,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) case PTRACE_POKETEXT: /* write the word at location addr. */ case PTRACE_POKEDATA: ret = 0; -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (__is_compat_task(child)) { unsigned int tmp = (unsigned int)data; DBG("sys_ptrace(POKE%s, %d, %lx, %lx)\n", @@ -145,7 +145,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) processes, the kernel saves all regs on a syscall. */ case PTRACE_PEEKUSR: { ret = -EIO; -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (__is_compat_task(child)) { unsigned int tmp; @@ -204,7 +204,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ret = 0; goto out_tsk; } -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (__is_compat_task(child)) { if (addr & (sizeof(int)-1)) goto out_tsk; diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 3c7a3faf78ed..21b9fb17b409 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -120,13 +120,13 @@ extern void collect_boot_cpu_data(void); void __init setup_arch(char **cmdline_p) { -#ifdef __LP64__ +#ifdef CONFIG_64BIT extern int parisc_narrow_firmware; #endif init_per_cpu(smp_processor_id()); /* Set Modes & Enable FP */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT printk(KERN_INFO "The 64-bit Kernel has started...\n"); #else printk(KERN_INFO "The 32-bit Kernel has started...\n"); @@ -134,7 +134,7 @@ void __init setup_arch(char **cmdline_p) pdc_console_init(); -#ifdef __LP64__ +#ifdef CONFIG_64BIT if(parisc_narrow_firmware) { printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n"); } diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 64169ab82de2..9784e405f849 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c @@ -62,7 +62,7 @@ /* * Atomically swap in the new signal mask, and wait for a signal. */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT #include "sys32.h" #endif @@ -103,7 +103,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) sigset_t set; unsigned long usp = (regs->gr[30] & ~(0x01UL)); unsigned long sigframe_size = PARISC_RT_SIGFRAME_SIZE; -#ifdef __LP64__ +#ifdef CONFIG_64BIT compat_sigset_t compat_set; struct compat_rt_sigframe __user * compat_frame; @@ -117,7 +117,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) (usp - sigframe_size); DBG(2,"sys_rt_sigreturn: frame is %p\n", frame); -#ifdef __LP64__ +#ifdef CONFIG_64BIT compat_frame = (struct compat_rt_sigframe __user *)frame; if (is_compat_task()) { @@ -139,7 +139,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) spin_unlock_irq(¤t->sighand->siglock); /* Good thing we saved the old gr[30], eh? */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (is_compat_task()) { DBG(1,"sys_rt_sigreturn: compat_frame->uc.uc_mcontext 0x%p\n", &compat_frame->uc.uc_mcontext); @@ -251,7 +251,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, unsigned long rp, usp; unsigned long haddr, sigframe_size; int err = 0; -#ifdef __LP64__ +#ifdef CONFIG_64BIT compat_int_t compat_val; struct compat_rt_sigframe __user * compat_frame; compat_sigset_t compat_set; @@ -265,7 +265,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, DBG(1,"setup_rt_frame: frame %p info %p\n", frame, info); -#ifdef __LP64__ +#ifdef CONFIG_64BIT compat_frame = (struct compat_rt_sigframe __user *)frame; @@ -345,7 +345,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, haddr = A(ka->sa.sa_handler); /* The sa_handler may be a pointer to a function descriptor */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (is_compat_task()) { #endif if (haddr & PA_PLABEL_FDESC) { @@ -360,7 +360,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, haddr = fdesc.addr; regs->gr[19] = fdesc.gp; } -#ifdef __LP64__ +#ifdef CONFIG_64BIT } else { Elf64_Fdesc fdesc; Elf64_Fdesc __user *ufdesc = (Elf64_Fdesc __user *)A(haddr & ~3); @@ -380,19 +380,19 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, /* The syscall return path will create IAOQ values from r31. */ sigframe_size = PARISC_RT_SIGFRAME_SIZE; -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (is_compat_task()) sigframe_size = PARISC_RT_SIGFRAME_SIZE32; #endif if (in_syscall) { regs->gr[31] = haddr; -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (!test_thread_flag(TIF_32BIT)) sigframe_size |= 1; #endif } else { unsigned long psw = USER_PSW; -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (!test_thread_flag(TIF_32BIT)) psw |= PSW_W; #endif @@ -417,7 +417,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, regs->gr[2] = rp; /* userland return pointer */ regs->gr[26] = sig; /* signal number */ -#ifdef __LP64__ +#ifdef CONFIG_64BIT if (is_compat_task()) { regs->gr[25] = A(&compat_frame->info); /* siginfo pointer */ regs->gr[24] = A(&compat_frame->uc); /* ucontext pointer */ diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 7f037b72ad03..7651e54ddbbb 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -10,7 +10,7 @@ * Copyright (C) 2000 Grant Grundler * Copyright (C) 2001 Richard Hirst * Copyright (C) 2001-2002 Ryan Bradetich - * Copyright (C) 2001 Helge Deller + * Copyright (C) 2001-2007 Helge Deller * Copyright (C) 2000-2001 Thomas Bogendoerfer * Copyright (C) 2002 Randolph Chung * Copyright (C) 2005-2006 Kyle McMartin diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 1f62853e4c02..55bc1471967d 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -64,7 +64,7 @@ static int printbinary(char *buf, unsigned long x, int nbits) return nbits; } -#ifdef __LP64__ +#ifdef CONFIG_64BIT #define RFMT "%016lx" #else #define RFMT "%08lx" @@ -837,7 +837,7 @@ int __init check_ivt(void *iva) return 0; } -#ifndef __LP64__ +#ifndef CONFIG_64BIT extern const void fault_vector_11; #endif extern const void fault_vector_20; @@ -849,7 +849,7 @@ void __init trap_init(void) if (boot_cpu_data.cpu_type >= pcxu) iva = (void *) &fault_vector_20; else -#ifdef __LP64__ +#ifdef CONFIG_64BIT panic("Can't boot 64-bit OS on PA1.1 processor!"); #else iva = (void *) &fault_vector_11; diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c index f352666b5b2f..e3eb739fab19 100644 --- a/arch/parisc/lib/bitops.c +++ b/arch/parisc/lib/bitops.c @@ -17,7 +17,7 @@ raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { }; #endif -#ifdef __LP64__ +#ifdef CONFIG_64BIT unsigned long __xchg64(unsigned long x, unsigned long *ptr) { unsigned long temp, flags; @@ -56,7 +56,7 @@ unsigned long __xchg8(char x, char *ptr) } -#ifdef __LP64__ +#ifdef CONFIG_64BIT unsigned long __cmpxchg_u64(volatile unsigned long *ptr, unsigned long old, unsigned long new) { unsigned long flags; diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index fc49a5ed78cc..8a3b71a26fde 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -6,7 +6,7 @@ * changed by Philipp Rumpf * Copyright 1999 Philipp Rumpf (prumpf@tux.org) * Copyright 2004 Randolph Chung (tausq@debian.org) - * Copyright 2006 Helge Deller (deller@gmx.de) + * Copyright 2006-2007 Helge Deller (deller@gmx.de) * */ @@ -66,11 +66,11 @@ static struct resource sysram_resources[MAX_PHYSMEM_RANGES] __read_mostly; physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES] __read_mostly; int npmem_ranges __read_mostly; -#ifdef __LP64__ +#ifdef CONFIG_64BIT #define MAX_MEM (~0UL) -#else /* !__LP64__ */ +#else /* !CONFIG_64BIT */ #define MAX_MEM (3584U*1024U*1024U) -#endif /* !__LP64__ */ +#endif /* !CONFIG_64BIT */ static unsigned long mem_limit __read_mostly = MAX_MEM; -- cgit v1.2.3-59-g8ed1b