diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-12 00:35:07 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-12 00:35:07 +0000 |
commit | ca2b53c30a3c2dea1d2610319ea0f4913ecae2e4 (patch) | |
tree | 517264cd64f493b4abe59243171390dc9f665161 | |
parent | 2bab1036f931dad0ae1633669c92fb201b229789 (diff) |
Make HZ_TO_STD macro name lowercase.
-rw-r--r-- | arch/mips/kernel/irixelf.c | 6 | ||||
-rw-r--r-- | fs/binfmt_elf.c | 21 | ||||
-rw-r--r-- | fs/proc/array.c | 16 | ||||
-rw-r--r-- | include/asm-alpha/param.h | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-shark/param.h | 4 | ||||
-rw-r--r-- | include/asm-arm/param.h | 2 | ||||
-rw-r--r-- | include/asm-i386/param.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/param.h | 2 | ||||
-rw-r--r-- | include/asm-m68k/param.h | 2 | ||||
-rw-r--r-- | include/asm-mips/param.h | 47 | ||||
-rw-r--r-- | include/asm-mips64/param.h | 8 | ||||
-rw-r--r-- | include/asm-ppc/param.h | 2 | ||||
-rw-r--r-- | include/asm-s390/param.h | 2 | ||||
-rw-r--r-- | include/asm-sh/param.h | 2 | ||||
-rw-r--r-- | include/asm-sparc/param.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/param.h | 2 | ||||
-rw-r--r-- | kernel/signal.c | 4 | ||||
-rw-r--r-- | kernel/sys.c | 10 |
18 files changed, 70 insertions, 66 deletions
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index db8bb8698..3329e5e84 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c @@ -255,7 +255,7 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex, /* First of all, some simple consistency checks */ if ((interp_elf_ex->e_type != ET_EXEC && interp_elf_ex->e_type != ET_DYN) || - !elf_check_arch(interp_elf_ex->e_machine) || + !irix_elf_check_arch(interp_elf_ex) || !interpreter->f_op->mmap) { printk("IRIX interp has bad e_type %d\n", interp_elf_ex->e_type); return 0xffffffff; @@ -395,7 +395,7 @@ static int verify_binary(struct elfhdr *ehp, struct linux_binprm *bprm) /* First of all, some simple consistency checks */ if((ehp->e_type != ET_EXEC && ehp->e_type != ET_DYN) || - !elf_check_arch(ehp->e_machine) || !bprm->file->f_op->mmap) { + !irix_elf_check_arch(ehp) || !bprm->file->f_op->mmap) { return -ENOEXEC; } @@ -810,7 +810,7 @@ static int load_irix_library(struct file *file) /* First of all, some simple consistency checks. */ if(elf_ex.e_type != ET_EXEC || elf_ex.e_phnum > 2 || - !elf_check_arch(elf_ex.e_machine) || !file->f_op->mmap) + !irix_elf_check_arch(&elf_ex) || !file->f_op->mmap) return -ENOEXEC; /* Now read in all of the header information. */ diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index d24db3010..100c3d195 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -220,7 +220,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex, if (interp_elf_ex->e_type != ET_EXEC && interp_elf_ex->e_type != ET_DYN) goto out; - if (!elf_check_arch(interp_elf_ex->e_machine)) + if (!elf_check_arch(interp_elf_ex)) goto out; if (!interpreter->f_op->mmap) goto out; @@ -405,23 +405,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) if (elf_ex.e_type != ET_EXEC && elf_ex.e_type != ET_DYN) goto out; - if (!elf_check_arch(elf_ex.e_machine)) + if (!elf_check_arch(&elf_ex)) goto out; -#if defined(__mips__) && !defined(__mips64) - /* IRIX5 binaries handled elsewhere. */ - if (elf_ex.e_flags & EF_MIPS_ARCH) { - retval = -ENOEXEC; - goto out; - } -#endif -#if defined(__mips__) && defined(__mips64) - /* Linux/MIPS 32-bit binaries handled elsewhere. */ - if (sizeof(elf_caddr_t) == 8 && - elf_ex.e_ident[EI_CLASS] == ELFCLASS32) { - retval = -ENOEXEC; - goto out; - } -#endif if (!bprm->file->f_op||!bprm->file->f_op->mmap) goto out; @@ -794,7 +779,7 @@ static int load_elf_library(struct file *file) /* First of all, some simple consistency checks */ if (elf_ex.e_type != ET_EXEC || elf_ex.e_phnum > 2 || - !elf_check_arch(elf_ex.e_machine) || !file->f_op->mmap) + !elf_check_arch(&elf_ex) || !file->f_op->mmap) goto out; /* Now read in all of the header information */ diff --git a/fs/proc/array.c b/fs/proc/array.c index 535c8c527..22c9af395 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -366,10 +366,10 @@ int proc_pid_stat(struct task_struct *task, char * buffer) task->cmin_flt, task->maj_flt, task->cmaj_flt, - HZ_TO_STD(task->times.tms_utime), - HZ_TO_STD(task->times.tms_stime), - HZ_TO_STD(task->times.tms_cutime), - HZ_TO_STD(task->times.tms_cstime), + hz_to_std(task->times.tms_utime), + hz_to_std(task->times.tms_stime), + hz_to_std(task->times.tms_cutime), + hz_to_std(task->times.tms_cstime), priority, nice, 0UL /* removed */, @@ -688,14 +688,14 @@ int proc_pid_cpu(struct task_struct *task, char * buffer) len = sprintf(buffer, "cpu %lu %lu\n", - HZ_TO_STD(task->times.tms_utime), - HZ_TO_STD(task->times.tms_stime)); + hz_to_std(task->times.tms_utime), + hz_to_std(task->times.tms_stime)); for (i = 0 ; i < smp_num_cpus; i++) len += sprintf(buffer + len, "cpu%d %lu %lu\n", i, - HZ_TO_STD(task->per_cpu_utime[cpu_logical_map(i)]), - HZ_TO_STD(task->per_cpu_stime[cpu_logical_map(i)])); + hz_to_std(task->per_cpu_utime[cpu_logical_map(i)]), + hz_to_std(task->per_cpu_stime[cpu_logical_map(i)])); return len; } diff --git a/include/asm-alpha/param.h b/include/asm-alpha/param.h index 749ff7ba8..768c92e02 100644 --- a/include/asm-alpha/param.h +++ b/include/asm-alpha/param.h @@ -14,7 +14,7 @@ # define HZ 1200 # endif #ifdef __KERNEL__ -# define HZ_TO_STD(a) (a) +# define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-arm/arch-shark/param.h b/include/asm-arm/arch-shark/param.h index fe1c437b8..3463cc5c9 100644 --- a/include/asm-arm/arch-shark/param.h +++ b/include/asm-arm/arch-shark/param.h @@ -11,12 +11,12 @@ #ifdef __KERNEL__ /* Conceptually - #define HZ_TO_STD(a) ((a) * 100 / HZ) + #define hz_to_std(a) ((a) * 100 / HZ) is what has to be done, it just has overflow problems with the intermediate result of the multiply after a bit more than 7 days. See include/asm-mips/param.h for a optized sample implementation used on DECstations. */ -#error Provide a definiton for HZ_TO_STD +#error Provide a definiton for hz_to_std #endif diff --git a/include/asm-arm/param.h b/include/asm-arm/param.h index 9840d4b4a..0e944f375 100644 --- a/include/asm-arm/param.h +++ b/include/asm-arm/param.h @@ -13,7 +13,7 @@ #define HZ 100 #endif #if defined(__KERNEL__) && (HZ == 100) -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #ifndef NGROUPS diff --git a/include/asm-i386/param.h b/include/asm-i386/param.h index ae7824921..ae818a9ab 100644 --- a/include/asm-i386/param.h +++ b/include/asm-i386/param.h @@ -4,7 +4,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-ia64/param.h b/include/asm-ia64/param.h index 2ab10770a..bc4c19ae6 100644 --- a/include/asm-ia64/param.h +++ b/include/asm-ia64/param.h @@ -31,7 +31,7 @@ #endif #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #define EXEC_PAGESIZE 65536 diff --git a/include/asm-m68k/param.h b/include/asm-m68k/param.h index 6ce91970d..ffd640baa 100644 --- a/include/asm-m68k/param.h +++ b/include/asm-m68k/param.h @@ -6,7 +6,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-mips/param.h b/include/asm-mips/param.h index 82110a4e0..5487778ca 100644 --- a/include/asm-mips/param.h +++ b/include/asm-mips/param.h @@ -1,37 +1,56 @@ -#ifndef __ASM_MIPS_PARAM_H -#define __ASM_MIPS_PARAM_H +#ifndef _ASM_PARAM_H +#define _ASM_PARAM_H #ifndef HZ +#ifdef __KERNEL__ + +/* Safeguard against user stupidity */ +#ifdef _SYS_PARAM_H +#error Do not include <asm/param.h> with __KERNEL__ defined! +#endif + #include <linux/config.h> #ifdef CONFIG_DECSTATION /* - * log2(HZ), change this here if you want another - * HZ value. This is also used in dec_time_init. - * Minimum is 1, Maximum is 15. + * log2(HZ), change this here if you want another HZ value. This is also + * used in dec_time_init. Minimum is 1, Maximum is 15. */ # define LOG_2_HZ 7 # define HZ (1 << LOG_2_HZ) /* * Ye olde division-by-multiplication trick. - * * This works only if 100 / HZ <= 1 */ # define QUOTIENT ((1UL << (32 - LOG_2_HZ)) * 100) -# define HZ_TO_STD(a) \ +# define hz_to_std(a) \ ({ unsigned int __res; \ - unsigned long lo; \ + unsigned long __lo; \ __asm__("multu\t%2,%3\n\t" \ - :"=h" (__res), "=l" (lo) \ + :"=h" (__res), "=l" (__lo) \ :"r" (a),"r" (QUOTIENT)); \ (__typeof__(a)) __res;}) -#else + +#else /* Not a DECstation */ + +/* This is the internal value of HZ, that is the rate at which the jiffies + counter is increasing. This value is independent from the external value + and can be changed in order to suit the hardware and application + requirements. */ # define HZ 100 -# define HZ_TO_STD(a) (a) -#endif +# define hz_to_std(a) (a) -#endif +#endif /* Not a DECstation */ + +#else /* defined(__KERNEL__) */ + +/* This is the external value of HZ as seen by user programs. Don't change + unless you know what you're doing - changing breaks binary compatibility. */ +#define HZ 100 + +#endif /* defined(__KERNEL__) */ +#endif /* defined(HZ) */ #define EXEC_PAGESIZE 4096 @@ -45,4 +64,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#endif /* __ASM_MIPS_PARAM_H */ +#endif /* _ASM_PARAM_H */ diff --git a/include/asm-mips64/param.h b/include/asm-mips64/param.h index f958c4d8a..5354eeb7d 100644 --- a/include/asm-mips64/param.h +++ b/include/asm-mips64/param.h @@ -1,10 +1,10 @@ -/* $Id: param.h,v 1.1 1999/08/18 23:37:51 ralf Exp $ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright 1994 - 1999 Ralf Baechle (ralf@gnu.org) + * Copyright 1994 - 2000 Ralf Baechle (ralf@gnu.org) + * Copyright 2000 Silicon Graphics, Inc. */ #ifndef _ASM_PARAM_H #define _ASM_PARAM_H @@ -13,7 +13,7 @@ #define HZ 100 # define HZ 100 #ifdef __KERNEL__ -# define HZ_TO_STD(a) (a) +# define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h index fef4beb74..93d6fc52c 100644 --- a/include/asm-ppc/param.h +++ b/include/asm-ppc/param.h @@ -4,7 +4,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-s390/param.h b/include/asm-s390/param.h index 1ee5d2518..bd04cebde 100644 --- a/include/asm-s390/param.h +++ b/include/asm-s390/param.h @@ -12,7 +12,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-sh/param.h b/include/asm-sh/param.h index f347bacd9..bc1879c96 100644 --- a/include/asm-sh/param.h +++ b/include/asm-sh/param.h @@ -4,7 +4,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-sparc/param.h b/include/asm-sparc/param.h index 7e346d366..3fef0c05e 100644 --- a/include/asm-sparc/param.h +++ b/include/asm-sparc/param.h @@ -5,7 +5,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/include/asm-sparc64/param.h b/include/asm-sparc64/param.h index bfaec7ba3..51affe3e5 100644 --- a/include/asm-sparc64/param.h +++ b/include/asm-sparc64/param.h @@ -5,7 +5,7 @@ #ifndef HZ #define HZ 100 #ifdef __KERNEL__ -#define HZ_TO_STD(a) (a) +#define hz_to_std(a) (a) #endif #endif diff --git a/kernel/signal.c b/kernel/signal.c index ad1b942ac..4e73949da 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -608,8 +608,8 @@ notify_parent(struct task_struct *tsk, int sig) info.si_uid = tsk->uid; /* FIXME: find out whether or not this is supposed to be c*time. */ - info.si_utime = HZ_TO_STD(tsk->times.tms_utime); - info.si_stime = HZ_TO_STD(tsk->times.tms_stime); + info.si_utime = hz_to_std(tsk->times.tms_utime); + info.si_stime = hz_to_std(tsk->times.tms_stime); status = tsk->exit_code & 0x7f; why = SI_KERNEL; /* shouldn't happen */ diff --git a/kernel/sys.c b/kernel/sys.c index a3879169e..eea48d548 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -738,14 +738,14 @@ asmlinkage long sys_times(struct tms * tbuf) * as if the syscall took an instant longer to occur. */ if (tbuf) { - temp.tms_utime = HZ_TO_STD(current->times.tms_utime); - temp.tms_stime = HZ_TO_STD(current->times.tms_stime); - temp.tms_cutime = HZ_TO_STD(current->times.tms_cutime); - temp.tms_cstime = HZ_TO_STD(current->times.tms_cstime); + temp.tms_utime = hz_to_std(current->times.tms_utime); + temp.tms_stime = hz_to_std(current->times.tms_stime); + temp.tms_cutime = hz_to_std(current->times.tms_cutime); + temp.tms_cstime = hz_to_std(current->times.tms_cstime); if (copy_to_user(tbuf, &temp, sizeof(struct tms))) return -EFAULT; } - return HZ_TO_STD(jiffies); + return hz_to_std(jiffies); } /* |