summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/include
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-02-09 05:04:23 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-02-09 05:04:23 +0000
commitd7448577ecabbda67295e79100a5e3f6d0d5e0c0 (patch)
treee457d18046108e8ca16226ac4c4e7d011f30b11b /sys/arch/hppa/include
parentb8ec7e061c73cb42af7266973dfcbe8fee1c7f9e (diff)
heartbeat -- yeah we have a patch for that
Diffstat (limited to 'sys/arch/hppa/include')
-rw-r--r--sys/arch/hppa/include/cpufunc.h45
1 files changed, 44 insertions, 1 deletions
diff --git a/sys/arch/hppa/include/cpufunc.h b/sys/arch/hppa/include/cpufunc.h
index cb1171706ad..53555a5c2a9 100644
--- a/sys/arch/hppa/include/cpufunc.h
+++ b/sys/arch/hppa/include/cpufunc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.h,v 1.12 1999/12/18 08:52:05 mickey Exp $ */
+/* $OpenBSD: cpufunc.h,v 1.13 2000/02/09 05:04:22 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -210,6 +210,49 @@ pdtlbe(pa_space_t sp, vaddr_t va)
__asm volatile("pdtlbe %%r0(%%sr1, %0)":: "r" (va));
}
+#ifdef USELEDS
+#define PALED_NETOUT 0x01
+#define PALED_NETIN 0x02
+#define PALED_DISK 0x04
+#define PALED_HEARTBEAT 0x08
+#define PALED_LOADMASK 0xf0
+
+#define PALED_DATA 0x01
+#define PALED_STROBE 0x02
+
+extern volatile u_int8_t *machine_ledaddr;
+extern int machine_ledword, machine_leds;
+
+static __inline void
+ledctl(int on, int off, int toggle)
+{
+ if (machine_ledaddr) {
+ int r;
+
+ if (on)
+ machine_leds |= on;
+ if (off)
+ machine_leds &= ~off;
+ if (toggle)
+ machine_leds ^= toggle;
+
+ r = ~machine_leds; /* it seems they should be reversed */
+
+ if (machine_ledword)
+ *machine_ledaddr = r;
+ else {
+ register int b;
+ for (b = 0x80; b; b >>= 1) {
+ *machine_ledaddr = (r & b)? PALED_DATA : 0;
+ DELAY(1);
+ *machine_ledaddr = ((r & b)? PALED_DATA : 0) |
+ PALED_STROBE;
+ }
+ }
+ }
+}
+#endif
+
#ifdef _KERNEL
void fcacheall __P((void));
void ptlball __P((void));