From 3a12db07c6592a7ab675fc50357e4be3d9ab6bfd Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 5 May 1997 21:15:41 +0000 Subject: [PATCH] Update for USELEDS changes (including: garbage-collect LED frobbing code; it has moved to leds.c) --- sys/arch/hp300/hp300/machdep.c | 56 +++------------------------------- 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c index 7101f39b8e25..740fad527d21 100644 --- a/sys/arch/hp300/hp300/machdep.c +++ b/sys/arch/hp300/hp300/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.90 1997/04/27 20:53:30 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.91 1997/05/05 21:15:41 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -97,12 +97,14 @@ #include #include +#include "opt_useleds.h" + #include #include #include #ifdef USELEDS -#include -#endif /* USELEDS */ +#include +#endif /* the following is used externally (sysctl_hw) */ char machine[] = "hp300"; /* cpu "architecture" */ @@ -147,7 +149,6 @@ int parityerror __P((struct frame *)); int parityerrorfind __P((void)); void identifycpu __P((void)); void initcpu __P((void)); -void ledinit __P((void)); int cpu_dumpsize __P((void)); int cpu_dump __P((int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *)); @@ -676,53 +677,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) /* NOTREACHED */ } -#ifdef USELEDS -int inledcontrol = 0; /* 1 if we are in ledcontrol already, cheap mutex */ -char *ledaddr; - -/* - * Map the LED page and setup the KVA to access it. - */ -void -ledinit() -{ - extern caddr_t ledbase; - - pmap_enter(pmap_kernel(), (vm_offset_t)ledbase, (vm_offset_t)LED_ADDR, - VM_PROT_READ|VM_PROT_WRITE, TRUE); - ledaddr = (char *) ((int)ledbase | (LED_ADDR & PGOFSET)); -} - -/* - * Do lights: - * `ons' is a mask of LEDs to turn on, - * `offs' is a mask of LEDs to turn off, - * `togs' is a mask of LEDs to toggle. - * Note we don't use splclock/splx for mutual exclusion. - * They are expensive and we really don't need to be that precise. - * Besides we would like to be able to profile this routine. - */ -void -ledcontrol(ons, offs, togs) - int ons, offs, togs; -{ - static char currentleds; - char leds; - - inledcontrol = 1; - leds = currentleds; - if (ons) - leds |= ons; - if (offs) - leds &= ~offs; - if (togs) - leds ^= togs; - currentleds = leds; - *ledaddr = ~leds; - inledcontrol = 0; -} -#endif - int waittime = -1; void