diff options
| author | Steve French <sfrench@us.ibm.com> | 2006-03-03 06:27:25 -0500 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2006-03-03 06:27:25 -0500 |
| commit | c6ee60b7c8bbc78e3b1776b2820a7e7f95f8996a (patch) | |
| tree | 99b48ef0f5217fddc0aa897d9e60d95ace7da6ff /arch/mips/kernel | |
| parent | 13298defe5323c7fdcac268f588d8d1090758fb8 (diff) | |
| parent | c499ec24c31edf270e777a868ffd0daddcfe7ebd (diff) | |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/linux32.c | 54 | ||||
| -rw-r--r-- | arch/mips/kernel/scall32-o32.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-o32.S | 4 | ||||
| -rw-r--r-- | arch/mips/kernel/setup.c | 3 | ||||
| -rw-r--r-- | arch/mips/kernel/smp.c | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/smp_mt.c | 13 | ||||
| -rw-r--r-- | arch/mips/kernel/time.c | 5 |
8 files changed, 18 insertions, 67 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 5f68b220c26d..e00e5f6e7fdd 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
| @@ -161,60 +161,6 @@ out: | |||
| 161 | return error; | 161 | return error; |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | struct dirent32 { | ||
| 165 | unsigned int d_ino; | ||
| 166 | unsigned int d_off; | ||
| 167 | unsigned short d_reclen; | ||
| 168 | char d_name[NAME_MAX + 1]; | ||
| 169 | }; | ||
| 170 | |||
| 171 | static void | ||
| 172 | xlate_dirent(void *dirent64, void *dirent32, long n) | ||
| 173 | { | ||
| 174 | long off; | ||
| 175 | struct dirent *dirp; | ||
| 176 | struct dirent32 *dirp32; | ||
| 177 | |||
| 178 | off = 0; | ||
| 179 | while (off < n) { | ||
| 180 | dirp = (struct dirent *)(dirent64 + off); | ||
| 181 | dirp32 = (struct dirent32 *)(dirent32 + off); | ||
| 182 | off += dirp->d_reclen; | ||
| 183 | dirp32->d_ino = dirp->d_ino; | ||
| 184 | dirp32->d_off = (unsigned int)dirp->d_off; | ||
| 185 | dirp32->d_reclen = dirp->d_reclen; | ||
| 186 | strncpy(dirp32->d_name, dirp->d_name, dirp->d_reclen - ((3 * 4) + 2)); | ||
| 187 | } | ||
| 188 | return; | ||
| 189 | } | ||
| 190 | |||
| 191 | asmlinkage long | ||
| 192 | sys32_getdents(unsigned int fd, void * dirent32, unsigned int count) | ||
| 193 | { | ||
| 194 | long n; | ||
| 195 | void *dirent64; | ||
| 196 | |||
| 197 | dirent64 = (void *)((unsigned long)(dirent32 + (sizeof(long) - 1)) & ~(sizeof(long) - 1)); | ||
| 198 | if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0) | ||
| 199 | return(n); | ||
| 200 | xlate_dirent(dirent64, dirent32, n); | ||
| 201 | return(n); | ||
| 202 | } | ||
| 203 | |||
| 204 | asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count); | ||
| 205 | |||
| 206 | asmlinkage int | ||
| 207 | sys32_readdir(unsigned int fd, void * dirent32, unsigned int count) | ||
| 208 | { | ||
| 209 | int n; | ||
| 210 | struct dirent dirent64; | ||
| 211 | |||
| 212 | if ((n = old_readdir(fd, &dirent64, count)) < 0) | ||
| 213 | return(n); | ||
| 214 | xlate_dirent(&dirent64, dirent32, dirent64.d_reclen); | ||
| 215 | return(n); | ||
| 216 | } | ||
| 217 | |||
| 218 | asmlinkage int | 164 | asmlinkage int |
| 219 | sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options) | 165 | sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options) |
| 220 | { | 166 | { |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index d83e033dbc87..2f2dc54b2e26 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
| @@ -626,7 +626,7 @@ einval: li v0, -EINVAL | |||
| 626 | sys sys_fstatat64 4 | 626 | sys sys_fstatat64 4 |
| 627 | sys sys_unlinkat 3 | 627 | sys sys_unlinkat 3 |
| 628 | sys sys_renameat 4 /* 4295 */ | 628 | sys sys_renameat 4 /* 4295 */ |
| 629 | sys sys_linkat 4 | 629 | sys sys_linkat 5 |
| 630 | sys sys_symlinkat 3 | 630 | sys sys_symlinkat 3 |
| 631 | sys sys_readlinkat 4 | 631 | sys sys_readlinkat 4 |
| 632 | sys sys_fchmodat 3 | 632 | sys sys_fchmodat 3 |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index d87b5446fa13..02c8267e45e7 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
| @@ -195,7 +195,7 @@ EXPORT(sysn32_call_table) | |||
| 195 | PTR sys_fdatasync | 195 | PTR sys_fdatasync |
| 196 | PTR sys_truncate | 196 | PTR sys_truncate |
| 197 | PTR sys_ftruncate /* 6075 */ | 197 | PTR sys_ftruncate /* 6075 */ |
| 198 | PTR sys32_getdents | 198 | PTR compat_sys_getdents |
| 199 | PTR sys_getcwd | 199 | PTR sys_getcwd |
| 200 | PTR sys_chdir | 200 | PTR sys_chdir |
| 201 | PTR sys_fchdir | 201 | PTR sys_fchdir |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 5b0414018c9a..797e0d874889 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
| @@ -293,7 +293,7 @@ sys_call_table: | |||
| 293 | PTR sys_uselib | 293 | PTR sys_uselib |
| 294 | PTR sys_swapon | 294 | PTR sys_swapon |
| 295 | PTR sys_reboot | 295 | PTR sys_reboot |
| 296 | PTR sys32_readdir | 296 | PTR compat_sys_old_readdir |
| 297 | PTR old_mmap /* 4090 */ | 297 | PTR old_mmap /* 4090 */ |
| 298 | PTR sys_munmap | 298 | PTR sys_munmap |
| 299 | PTR sys_truncate | 299 | PTR sys_truncate |
| @@ -345,7 +345,7 @@ sys_call_table: | |||
| 345 | PTR sys_setfsuid | 345 | PTR sys_setfsuid |
| 346 | PTR sys_setfsgid | 346 | PTR sys_setfsgid |
| 347 | PTR sys32_llseek /* 4140 */ | 347 | PTR sys32_llseek /* 4140 */ |
| 348 | PTR sys32_getdents | 348 | PTR compat_sys_getdents |
| 349 | PTR compat_sys_select | 349 | PTR compat_sys_select |
| 350 | PTR sys_flock | 350 | PTR sys_flock |
| 351 | PTR sys_msync | 351 | PTR sys_msync |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index d86affa21278..d9293c558e41 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
| @@ -540,6 +540,9 @@ void __init setup_arch(char **cmdline_p) | |||
| 540 | sparse_init(); | 540 | sparse_init(); |
| 541 | paging_init(); | 541 | paging_init(); |
| 542 | resource_init(); | 542 | resource_init(); |
| 543 | #ifdef CONFIG_SMP | ||
| 544 | plat_smp_setup(); | ||
| 545 | #endif | ||
| 543 | } | 546 | } |
| 544 | 547 | ||
| 545 | int __init fpu_disable(char *s) | 548 | int __init fpu_disable(char *s) |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 5e189862e523..06ed90752424 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
| @@ -236,7 +236,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 236 | init_new_context(current, &init_mm); | 236 | init_new_context(current, &init_mm); |
| 237 | current_thread_info()->cpu = 0; | 237 | current_thread_info()->cpu = 0; |
| 238 | smp_tune_scheduling(); | 238 | smp_tune_scheduling(); |
| 239 | prom_prepare_cpus(max_cpus); | 239 | plat_prepare_cpus(max_cpus); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | /* preload SMP state for boot cpu */ | 242 | /* preload SMP state for boot cpu */ |
diff --git a/arch/mips/kernel/smp_mt.c b/arch/mips/kernel/smp_mt.c index c930364830d0..993b8bf56aaf 100644 --- a/arch/mips/kernel/smp_mt.c +++ b/arch/mips/kernel/smp_mt.c | |||
| @@ -143,7 +143,7 @@ static struct irqaction irq_call = { | |||
| 143 | * Make sure all CPU's are in a sensible state before we boot any of the | 143 | * Make sure all CPU's are in a sensible state before we boot any of the |
| 144 | * secondarys | 144 | * secondarys |
| 145 | */ | 145 | */ |
| 146 | void prom_prepare_cpus(unsigned int max_cpus) | 146 | void plat_smp_setup(void) |
| 147 | { | 147 | { |
| 148 | unsigned long val; | 148 | unsigned long val; |
| 149 | int i, num; | 149 | int i, num; |
| @@ -179,11 +179,9 @@ void prom_prepare_cpus(unsigned int max_cpus) | |||
| 179 | write_vpe_c0_vpeconf0(tmp); | 179 | write_vpe_c0_vpeconf0(tmp); |
| 180 | 180 | ||
| 181 | /* Record this as available CPU */ | 181 | /* Record this as available CPU */ |
| 182 | if (i < max_cpus) { | 182 | cpu_set(i, phys_cpu_present_map); |
| 183 | cpu_set(i, phys_cpu_present_map); | 183 | __cpu_number_map[i] = ++num; |
| 184 | __cpu_number_map[i] = ++num; | 184 | __cpu_logical_map[num] = i; |
| 185 | __cpu_logical_map[num] = i; | ||
| 186 | } | ||
| 187 | } | 185 | } |
| 188 | 186 | ||
| 189 | /* disable multi-threading with TC's */ | 187 | /* disable multi-threading with TC's */ |
| @@ -241,7 +239,10 @@ void prom_prepare_cpus(unsigned int max_cpus) | |||
| 241 | set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); | 239 | set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); |
| 242 | set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); | 240 | set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); |
| 243 | } | 241 | } |
| 242 | } | ||
| 244 | 243 | ||
| 244 | void __init plat_prepare_cpus(unsigned int max_cpus) | ||
| 245 | { | ||
| 245 | cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ; | 246 | cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ; |
| 246 | cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ; | 247 | cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ; |
| 247 | 248 | ||
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 7050b4ffffcd..42c94c771afb 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
| @@ -163,7 +163,7 @@ void do_gettimeofday(struct timeval *tv) | |||
| 163 | unsigned long seq; | 163 | unsigned long seq; |
| 164 | unsigned long lost; | 164 | unsigned long lost; |
| 165 | unsigned long usec, sec; | 165 | unsigned long usec, sec; |
| 166 | unsigned long max_ntp_tick = tick_usec - tickadj; | 166 | unsigned long max_ntp_tick; |
| 167 | 167 | ||
| 168 | do { | 168 | do { |
| 169 | seq = read_seqbegin(&xtime_lock); | 169 | seq = read_seqbegin(&xtime_lock); |
| @@ -178,12 +178,13 @@ void do_gettimeofday(struct timeval *tv) | |||
| 178 | * Better to lose some accuracy than have time go backwards.. | 178 | * Better to lose some accuracy than have time go backwards.. |
| 179 | */ | 179 | */ |
| 180 | if (unlikely(time_adjust < 0)) { | 180 | if (unlikely(time_adjust < 0)) { |
| 181 | max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; | ||
| 181 | usec = min(usec, max_ntp_tick); | 182 | usec = min(usec, max_ntp_tick); |
| 182 | 183 | ||
| 183 | if (lost) | 184 | if (lost) |
| 184 | usec += lost * max_ntp_tick; | 185 | usec += lost * max_ntp_tick; |
| 185 | } else if (unlikely(lost)) | 186 | } else if (unlikely(lost)) |
| 186 | usec += lost * tick_usec; | 187 | usec += lost * (USEC_PER_SEC / HZ); |
| 187 | 188 | ||
| 188 | sec = xtime.tv_sec; | 189 | sec = xtime.tv_sec; |
| 189 | usec += (xtime.tv_nsec / 1000); | 190 | usec += (xtime.tv_nsec / 1000); |
