diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/ap1000/util.c | 2 | ||||
-rw-r--r-- | arch/sparc/config.in | 3 | ||||
-rw-r--r-- | arch/sparc/defconfig | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/Makefile | 24 | ||||
-rw-r--r-- | arch/sparc/kernel/ptrace.c | 8 | ||||
-rw-r--r-- | arch/sparc/kernel/time.c | 30 | ||||
-rw-r--r-- | arch/sparc/lib/Makefile | 4 | ||||
-rw-r--r-- | arch/sparc/lib/checksum.S | 4 | ||||
-rw-r--r-- | arch/sparc/mm/Makefile | 2 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.c | 10 |
10 files changed, 61 insertions, 27 deletions
diff --git a/arch/sparc/ap1000/util.c b/arch/sparc/ap1000/util.c index abb51426e..079c9f4c0 100644 --- a/arch/sparc/ap1000/util.c +++ b/arch/sparc/ap1000/util.c @@ -393,7 +393,7 @@ void ap_nfs_hook(unsigned long server) unsigned end = jiffies + 20*HZ; /* we are booting from another cell */ printk("waiting for the master cell\n"); - while (jiffies < end) ; + while (time_before(jiffies, end)) ; printk("continuing\n"); } } diff --git a/arch/sparc/config.in b/arch/sparc/config.in index 97c970481..6220b2085 100644 --- a/arch/sparc/config.in +++ b/arch/sparc/config.in @@ -25,6 +25,7 @@ define_bool CONFIG_VT y define_bool CONFIG_VT_CONSOLE y bool 'Support for AP1000 multicomputer' CONFIG_AP1000 +bool 'Symmetric multi-processing support' CONFIG_SMP if [ "$CONFIG_AP1000" = "y" ]; then define_bool CONFIG_NO_KEYBOARD y @@ -175,8 +176,6 @@ fi source fs/Config.in -source fs/nls/Config.in - mainmenu_option next_comment comment 'Watchdog' diff --git a/arch/sparc/defconfig b/arch/sparc/defconfig index 7ea12a128..8e6d9e2f5 100644 --- a/arch/sparc/defconfig +++ b/arch/sparc/defconfig @@ -20,6 +20,7 @@ CONFIG_KMOD=y CONFIG_VT=y CONFIG_VT_CONSOLE=y # CONFIG_AP1000 is not set +# CONFIG_SMP is not set # CONFIG_SUN4 is not set # CONFIG_PCI is not set diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index 18e487d86..d5f65dda3 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -30,7 +30,7 @@ ifdef CONFIG_SUN4 O_OBJS += sun4setup.o endif -ifdef SMP +ifdef CONFIG_SMP O_OBJS += trampoline.o smp.o sun4m_smp.o sun4d_smp.o endif @@ -50,11 +50,17 @@ check_asm: dummy @echo "#ifndef __ASM_OFFSETS_H__" >> asm_offsets.h @echo "#define __ASM_OFFSETS_H__" >> asm_offsets.h @echo "" >> asm_offsets.h - @echo "#ifndef __SMP__" >> asm_offsets.h + @echo "#include <linux/config.h>" >> asm_offsets.h @echo "" >> asm_offsets.h - @echo "#include <linux/sched.h>" > tmp.c + @echo "#ifndef CONFIG_SMP" >> asm_offsets.h + @echo "" >> asm_offsets.h + @echo "#include <linux/config.h>" > tmp.c + @echo "#undef CONFIG_SMP" >> tmp.c + @echo "#include <linux/sched.h>" >> tmp.c $(CC) -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c + @echo "#include <linux/config.h>" >> check_asm.c + @echo "#undef CONFIG_SMP" >> check_asm.c @echo "#include <linux/sched.h>" >> check_asm.c @echo 'struct task_struct _task;' >> check_asm.c @echo 'struct mm_struct _mm;' >> check_asm.c @@ -69,11 +75,17 @@ check_asm: dummy ./check_asm >> asm_offsets.h @rm -f check_asm check_asm.c @echo "" >> asm_offsets.h - @echo "#else /* __SMP__ */" >> asm_offsets.h + @echo "#else /* CONFIG_SMP */" >> asm_offsets.h @echo "" >> asm_offsets.h - @echo "#include <linux/sched.h>" > tmp.c + @echo "#include <linux/config.h>" > tmp.c + @echo "#undef CONFIG_SMP" >> tmp.c + @echo "#define CONFIG_SMP 1" >> tmp.c + @echo "#include <linux/sched.h>" >> tmp.c $(CC) -D__SMP__ -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c + @echo "#include <linux/config.h>" >> check_asm.c + @echo "#undef CONFIG_SMP" >> check_asm.c + @echo "#define CONFIG_SMP 1" >> check_asm.c @echo "#include <linux/sched.h>" >> check_asm.c @echo 'struct task_struct _task;' >> check_asm.c @echo 'struct mm_struct _mm;' >> check_asm.c @@ -88,7 +100,7 @@ check_asm: dummy ./check_asm >> asm_offsets.h @rm -f check_asm check_asm.c @echo "" >> asm_offsets.h - @echo "#endif /* __SMP__ */" >> asm_offsets.h + @echo "#endif /* CONFIG_SMP */" >> asm_offsets.h @echo "" >> asm_offsets.h @echo "#endif /* __ASM_OFFSETS_H__ */" >> asm_offsets.h @if test -r $(HPATH)/asm/asm_offsets.h; then \ diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c index 40e23fa0e..ed8fe6a25 100644 --- a/arch/sparc/kernel/ptrace.c +++ b/arch/sparc/kernel/ptrace.c @@ -592,7 +592,9 @@ asmlinkage void do_ptrace(struct pt_regs *regs) pt_error_return(regs, EINVAL); goto out; } + down(&child->mm->mmap_sem); res = read_long(child, addr, &tmp); + up(&child->mm->mmap_sem); if (res < 0) { pt_error_return(regs, -res); goto out; @@ -619,8 +621,10 @@ asmlinkage void do_ptrace(struct pt_regs *regs) pt_error_return(regs, EINVAL); goto out; } + down(&child->mm->mmap_sem); vma = find_extend_vma(child, addr); res = write_long(child, addr, data); + up(&child->mm->mmap_sem); if(res < 0) pt_error_return(regs, -res); else @@ -761,7 +765,9 @@ asmlinkage void do_ptrace(struct pt_regs *regs) goto out; } while(len) { + down(&child->mm->mmap_sem); res = read_byte(child, src, &tmp); + up(&child->mm->mmap_sem); if(res < 0) { pt_error_return(regs, -res); goto out; @@ -788,7 +794,9 @@ asmlinkage void do_ptrace(struct pt_regs *regs) unsigned long tmp; __get_user(tmp, src); + down(&child->mm->mmap_sem); res = write_byte(child, dest, tmp); + up(&child->mm->mmap_sem); if(res < 0) { pt_error_return(regs, -res); goto out; diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index eac95ec98..9e5afcfcf 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c @@ -11,6 +11,9 @@ * Support for MicroSPARC-IIep, PCI CPU. * * This file handles the Sparc specific time handling details. + * + * 1997-09-10 Updated NTP code according to technical memorandum Jan '96 + * "A Kernel Model for Precision Timekeeping" by Dave Mills */ #include <linux/config.h> #include <linux/errno.h> @@ -89,9 +92,10 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) do_timer(regs); /* Determine when to update the Mostek clock. */ - if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec > 500000 - (tick >> 1) && - xtime.tv_usec < 500000 + (tick >> 1)) { + if ((time_status & STA_UNSYNC) == 0 && + xtime.tv_sec > last_rtc_update + 660 && + xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 && + xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) { if (set_rtc_mmss(xtime.tv_sec) == 0) last_rtc_update = xtime.tv_sec; else @@ -495,12 +499,18 @@ static void sbus_do_settimeofday(struct timeval *tv) } #endif xtime = *tv; - time_state = TIME_BAD; - time_maxerror = 0x70000000; - time_esterror = 0x70000000; + time_adjust = 0; /* stop active adjtime() */ + time_status |= STA_UNSYNC; + time_state = TIME_ERROR; /* p. 24, (a) */ + time_maxerror = NTP_PHASE_LIMIT; + time_esterror = NTP_PHASE_LIMIT; sti(); } +/* + * BUG: This routine does not handle hour overflow properly; it just + * sets the minutes. Usually you won't notice until after reboot! + */ static int set_rtc_mmss(unsigned long nowtime) { int real_seconds, real_minutes, mostek_minutes; @@ -531,9 +541,13 @@ static int set_rtc_mmss(unsigned long nowtime) iregs->clk.int_sec=real_seconds; iregs->clk.int_min=real_minutes; intersil_start(iregs); - } else + } else { + printk(KERN_WARNING + "set_rtc_mmss: can't update from %d to %d\n", + cmos_minutes, real_minutes); return -1; - + } + return 0; } #endif diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 9ce3a6630..0670ff273 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -7,7 +7,7 @@ OBJS = mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \ strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \ copy_user.o locks.o atomic.o bitops.o debuglocks.o -ifdef SMP +ifdef CONFIG_SMP OBJS += irqlock.o endif @@ -54,7 +54,7 @@ atomic.o: atomic.S bitops.o: bitops.S $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o bitops.o bitops.S -ifdef SMP +ifdef CONFIG_SMP irqlock.o: irqlock.S $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o irqlock.o irqlock.S endif diff --git a/arch/sparc/lib/checksum.S b/arch/sparc/lib/checksum.S index 2f0c78168..d02b6dfb2 100644 --- a/arch/sparc/lib/checksum.S +++ b/arch/sparc/lib/checksum.S @@ -535,7 +535,7 @@ C_LABEL(__csum_partial_copy_end): /* %o1 is dst * %o3 is # bytes to zero out * %o4 is faulting address - * %o5 is %pc where fault occured */ + * %o5 is %pc where fault occurred */ clr %o2 31: /* %o0 is src @@ -543,7 +543,7 @@ C_LABEL(__csum_partial_copy_end): * %o2 is # of bytes to copy from src to dst * %o3 is # bytes to zero out * %o4 is faulting address - * %o5 is %pc where fault occured */ + * %o5 is %pc where fault occurred */ save %sp, -104, %sp mov %i5, %o0 mov %i7, %o1 diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile index a9e51c67f..ecb1943c3 100644 --- a/arch/sparc/mm/Makefile +++ b/arch/sparc/mm/Makefile @@ -14,7 +14,7 @@ O_OBJS += nosrmmu.o else O_OBJS += srmmu.o iommu.o io-unit.o hypersparc.o viking.o tsunami.o endif -ifdef SMP +ifdef CONFIG_SMP O_OBJS += nosun4c.o else O_OBJS += sun4c.o diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 69d40fa09..d94fd4083 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -470,7 +470,7 @@ static inline pte_t *srmmu_get_pte_fast(void) (unsigned int)ret->pprev_hash = mask & ~tmp; if (!(mask & ~tmp)) pte_quicklist = (unsigned long *)ret->next_hash; - ret = (struct page *)(PAGE_OFFSET + (ret->map_nr << PAGE_SHIFT) + off); + ret = (struct page *)(page_address(ret) + off); pgtable_cache_size--; } spin_unlock(&pte_spinlock); @@ -508,7 +508,7 @@ static inline pgd_t *srmmu_get_pgd_fast(void) (unsigned int)ret->pprev_hash = mask & ~tmp; if (!(mask & ~tmp)) pgd_quicklist = (unsigned long *)ret->next_hash; - ret = (struct page *)(PAGE_OFFSET + (ret->map_nr << PAGE_SHIFT) + off); + ret = (struct page *)(page_address(ret) + off); pgd_cache_size--; } spin_unlock(&pgd_spinlock); @@ -682,7 +682,7 @@ static void srmmu_set_pgdir(unsigned long address, pgd_t entry) spin_lock(&pgd_spinlock); address >>= SRMMU_PGDIR_SHIFT; for (page = (struct page *)pgd_quicklist; page; page = page->next_hash) { - pgd_t *pgd = (pgd_t *)(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); + pgd_t *pgd = (pgd_t *)page_address(page); unsigned int mask = (unsigned int)page->pprev_hash; if (mask & 1) @@ -2817,7 +2817,7 @@ static int srmmu_check_pgt_cache(int low, int high) page->next_hash = NULL; page->pprev_hash = NULL; pgtable_cache_size -= 16; - free_page(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); + __free_page(page); freed++; if (page2) page = page2->next_hash; @@ -2843,7 +2843,7 @@ static int srmmu_check_pgt_cache(int low, int high) page->next_hash = NULL; page->pprev_hash = NULL; pgd_cache_size -= 4; - free_page(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); + __free_page(page); freed++; if (page2) page = page2->next_hash; |