1 /* $NetBSD: io.c,v 1.4 2006/06/27 23:26:13 garbled Exp $ */
4 #include <lib/libsa/stand.h>
8 #define POW_IOCC_SEG 0x820C00E0
9 #define IOCC_SEG 0x82000080
12 volatile u_char
*MCA_io
= (u_char
*)0xe0000000;
14 /* hardcode for now */
18 register_t savemsr
, msr
;
20 __asm
volatile ("mfmsr %0" : "=r"(savemsr
));
21 msr
= savemsr
& ~PSL_DR
;
22 __asm
volatile ("mtmsr %0" : : "r"(msr
));
24 __asm
volatile ("mtsr 14,%0" : : "r"(IOCC_SEG
));
25 __asm
volatile ("mtmsr %0" : : "r"(msr
|PSL_DR
));
26 __asm
volatile ("isync");
27 __asm
volatile ("mtmsr %0;isync" : : "r"(savemsr
));
32 outb(int port
, char val
)
39 outw(int port
, u_int16_t val
)
49 return (MCA_io
[port
]);