diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-12 01:56:28 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-12 01:56:28 +0000 |
commit | 5a171ddbe0a502527368f00e663df035d1d36019 (patch) | |
tree | bf8712712f7fb0ed15d2ec33af84d7a04c3a6d7c /arch/sparc64 | |
parent | f4ae78d536e6dfaeb24c01b331fc38d950ed062b (diff) |
Merge with Linux 2.4.0-test4-pre3.
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/entry.S | 57 | ||||
-rw-r--r-- | arch/sparc64/kernel/power.c | 10 | ||||
-rw-r--r-- | arch/sparc64/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/time.c | 58 |
4 files changed, 66 insertions, 61 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index 01363d42f..3195d3e75 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.116 2000/06/19 06:24:37 davem Exp $ +/* $Id: entry.S,v 1.117 2000/07/11 02:21:12 davem Exp $ * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -1094,3 +1094,58 @@ __flushw_user: restore %g0, %g0, %g0 2: retl nop + +/* This need not obtain the xtime_lock as it is coded in + * an implicitly SMP safe way already. + */ + .align 64 + .globl do_gettimeofday +do_gettimeofday: /* %o0 = timevalp */ + /* Load doubles must be used on xtime so that what we get + * is guarenteed to be atomic, this is why we can run this + * with interrupts on full blast. Don't touch this... -DaveM + * + * Note with time_t changes to the timeval type, I must now use + * nucleus atomic quad 128-bit loads. + */ + sethi %hi(timer_tick_offset), %g3 + sethi %hi(xtime), %g2 + sethi %hi(timer_tick_compare), %g1 + ldx [%g3 + %lo(timer_tick_offset)], %g3 + or %g2, %lo(xtime), %g2 + or %g1, %lo(timer_tick_compare), %g1 +1: ldda [%g2] ASI_NUCLEUS_QUAD_LDD, %o4 + rd %tick, %o1 + ldx [%g1], %g7 + ldda [%g2] ASI_NUCLEUS_QUAD_LDD, %o2 + xor %o4, %o2, %o2 + xor %o5, %o3, %o3 + orcc %o2, %o3, %g0 + bne,pn %xcc, 1b + sethi %hi(wall_jiffies), %o2 + sethi %hi(jiffies), %o3 + ldx [%o2 + %lo(wall_jiffies)], %o2 + ldx [%o3 + %lo(jiffies)], %o3 + sub %o3, %o2, %o2 + sethi %hi(timer_ticks_per_usec_quotient), %o3 + add %g3, %o1, %o1 + ldx [%o3 + %lo(timer_ticks_per_usec_quotient)], %o3 + sub %o1, %g7, %o1 + mulx %o3, %o1, %o1 + brz,pt %o2, 1f + srlx %o1, 32, %o1 + sethi %hi(10000), %g2 + or %g2, %lo(10000), %g2 + add %o1, %g2, %o1 +1: sethi %hi(1000000), %o2 + srlx %o5, 32, %o5 + or %o2, %lo(1000000), %o2 + add %o5, %o1, %o5 + cmp %o5, %o2 + bl,a,pn %xcc, 1f + stx %o4, [%o0 + 0x0] + add %o4, 0x1, %o4 + sub %o5, %o2, %o5 + stx %o4, [%o0 + 0x0] +1: retl + st %o5, [%o0 + 0x8] diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c index ccf0c03bf..ff111278f 100644 --- a/arch/sparc64/kernel/power.c +++ b/arch/sparc64/kernel/power.c @@ -1,4 +1,4 @@ -/* $Id: power.c,v 1.6 2000/04/13 00:59:59 davem Exp $ +/* $Id: power.c,v 1.8 2000/07/11 22:41:33 davem Exp $ * power.c: Power management driver. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) @@ -35,10 +35,12 @@ static void power_handler(int irq, void *dev_id, struct pt_regs *regs) extern void machine_halt(void); +extern int serial_console; + void machine_power_off(void) { #ifdef CONFIG_PCI - if (power_reg != 0UL) { + if (power_reg != 0UL && !serial_console) { /* Both register bits seem to have the * same effect, so until I figure out * what the difference is... @@ -53,7 +55,7 @@ void machine_power_off(void) static int powerd(void *__unused) { static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; - char *argv[] = { "/usr/bin/shutdown", "-h", "now", NULL }; + char *argv[] = { "/sbin/shutdown", "-h", "now", NULL }; daemonize(); sprintf(current->comm, "powerd"); @@ -67,7 +69,7 @@ again: } /* Ok, down we go... */ - if (execve("/usr/bin/shutdown", argv, envp) < 0) { + if (execve("/sbin/shutdown", argv, envp) < 0) { printk("powerd: shutdown execution failed\n"); button_pressed = 0; goto again; diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index a09288215..2d5d81452 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.108 2000/06/30 10:18:38 davem Exp $ +/* $Id: process.c,v 1.109 2000/07/11 01:38:57 davem Exp $ * arch/sparc64/kernel/process.c * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 6a84d4c29..f229ea988 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.26 2000/05/09 17:40:14 davem Exp $ +/* $Id: time.c,v 1.28 2000/07/11 02:21:12 davem Exp $ * time.c: UltraSparc timer and TOD clock support. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -46,8 +46,8 @@ static int set_rtc_mmss(unsigned long); * interrupts, one at level14 and one with softint bit 0. */ unsigned long timer_tick_offset; -static unsigned long timer_tick_compare; -static unsigned long timer_ticks_per_usec_quotient; +unsigned long timer_tick_compare; +unsigned long timer_ticks_per_usec_quotient; static __inline__ void timer_check_rtc(void) { @@ -502,58 +502,6 @@ static __inline__ unsigned long do_gettimeoffset(void) return (ticks * timer_ticks_per_usec_quotient) >> 32UL; } -/* This need not obtain the xtime_lock as it is coded in - * an implicitly SMP safe way already. - */ -void do_gettimeofday(struct timeval *tv) -{ - /* Load doubles must be used on xtime so that what we get - * is guarenteed to be atomic, this is why we can run this - * with interrupts on full blast. Don't touch this... -DaveM - * - * Note with time_t changes to the timeval type, I must now use - * nucleus atomic quad 128-bit loads. - */ - __asm__ __volatile__(" - sethi %hi(timer_tick_offset), %g3 - sethi %hi(xtime), %g2 - sethi %hi(timer_tick_compare), %g1 - ldx [%g3 + %lo(timer_tick_offset)], %g3 - or %g2, %lo(xtime), %g2 - or %g1, %lo(timer_tick_compare), %g1 -1: ldda [%g2] 0x24, %o4 - rd %tick, %o1 - ldx [%g1], %g7 - ldda [%g2] 0x24, %o2 - xor %o4, %o2, %o2 - xor %o5, %o3, %o3 - orcc %o2, %o3, %g0 - bne,pn %xcc, 1b - sethi %hi(lost_ticks), %o2 - sethi %hi(timer_ticks_per_usec_quotient), %o3 - ldx [%o2 + %lo(lost_ticks)], %o2 - add %g3, %o1, %o1 - ldx [%o3 + %lo(timer_ticks_per_usec_quotient)], %o3 - sub %o1, %g7, %o1 - mulx %o3, %o1, %o1 - brz,pt %o2, 1f - srlx %o1, 32, %o1 - sethi %hi(10000), %g2 - or %g2, %lo(10000), %g2 - add %o1, %g2, %o1 -1: sethi %hi(1000000), %o2 - srlx %o5, 32, %o5 - or %o2, %lo(1000000), %o2 - add %o5, %o1, %o5 - cmp %o5, %o2 - bl,a,pn %xcc, 1f - stx %o4, [%o0 + 0x0] - add %o4, 0x1, %o4 - sub %o5, %o2, %o5 - stx %o4, [%o0 + 0x0] -1: st %o5, [%o0 + 0x8]"); -} - void do_settimeofday(struct timeval *tv) { write_lock_irq(&xtime_lock); |