patch-1.3.71 linux/include/asm-sparc/auxio.h
Next file: linux/include/asm-sparc/bitops.h
Previous file: linux/include/asm-sparc/asi.h
Back to the patch index
Back to the overall index
- Lines: 62
- Date:
Mon Mar 4 08:49:59 1996
- Orig file:
v1.3.70/linux/include/asm-sparc/auxio.h
- Orig date:
Sat Nov 25 19:04:48 1995
diff -u --recursive --new-file v1.3.70/linux/include/asm-sparc/auxio.h linux/include/asm-sparc/auxio.h
@@ -1,4 +1,4 @@
-/* $Id: auxio.h,v 1.8 1995/11/25 02:31:13 davem Exp $
+/* $Id: auxio.h,v 1.10 1996/01/03 03:52:58 davem Exp $
* auxio.h: Definitons and code for the Auxiliary I/O register.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -9,12 +9,13 @@
#include <asm/system.h>
#include <asm/vaddrs.h>
+extern unsigned char *auxio_register;
+
/* This register is an unsigned char in IO space. It does two things.
* First, it is used to control the front panel LED light on machines
* that have it (good for testing entry points to trap handlers and irq's)
* Secondly, it controls various floppy drive parameters.
*/
-
#define AUXIO_ORMEIN 0xf0 /* All writes must set these bits. */
#define AUXIO_ORMEIN4M 0xc0 /* sun4m - All writes must set these bits. */
#define AUXIO_FLPY_DENS 0x20 /* Floppy density, high if set. Read only. */
@@ -29,8 +30,7 @@
#define AUXIO_FLPY_EJCT 0x02 /* Eject floppy disk. Write only. */
#define AUXIO_LED 0x01 /* On if set, off if unset. Read/Write */
-#define AUXREG ((volatile unsigned char *)(AUXIO_VADDR + 3))
-#define AUXREG4M ((volatile unsigned char *)(AUXIO_VADDR))
+#define AUXREG ((volatile unsigned char *)(auxio_register))
#define TURN_ON_LED *AUXREG = (*AUXREG | AUXIO_ORMEIN | AUXIO_LED)
#define TURN_OFF_LED *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_LED))
@@ -44,8 +44,9 @@
extern inline void set_auxio(unsigned char bits_on, unsigned char bits_off)
{
unsigned char regval;
+ unsigned long flags;
- cli();
+ save_flags(flags); cli();
switch(sparc_cpu_model) {
case sun4c:
@@ -53,16 +54,14 @@
*AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN;
break;
case sun4m:
- regval = *AUXREG4M;
- *AUXREG4M = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M;
+ regval = *AUXREG;
+ *AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M;
break;
default:
panic("Can't set AUXIO register on this machine.");
};
- sti();
-
- return;
+ restore_flags(flags);
}
#endif /* !(__ASSEMBLY__) */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this