| 1 |
/* |
| 2 |
This file is based on: |
| 3 |
$XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $ |
| 4 |
Modified for readability by Nick Kurshev |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef __ASM_MACROS_POWERPC_H |
| 8 |
#define __ASM_MACROS_POWERPC_H |
| 9 |
|
| 10 |
#if defined(Lynx) || defined(__OpenBSD__) |
| 11 |
|
| 12 |
extern unsigned char *ioBase; |
| 13 |
|
| 14 |
static __inline__ volatile void eieio() |
| 15 |
{ |
| 16 |
__asm__ __volatile__ ("eieio"); |
| 17 |
} |
| 18 |
|
| 19 |
static __inline__ void outb(short port, unsigned char value) |
| 20 |
{ |
| 21 |
*(unsigned char *)(ioBase + port) = value; eieio(); |
| 22 |
} |
| 23 |
|
| 24 |
static __inline__ void outw(short port, unsigned short value) |
| 25 |
{ |
| 26 |
*(unsigned short *)(ioBase + port) = value; eieio(); |
| 27 |
} |
| 28 |
|
| 29 |
static __inline__ void outl(short port, unsigned short value) |
| 30 |
{ |
| 31 |
*(unsigned long *)(ioBase + port) = value; eieio(); |
| 32 |
} |
| 33 |
|
| 34 |
static __inline__ unsigned char inb(short port) |
| 35 |
{ |
| 36 |
unsigned char val; |
| 37 |
val = *((unsigned char *)(ioBase + port)); eieio(); |
| 38 |
return(val); |
| 39 |
} |
| 40 |
|
| 41 |
static __inline__ unsigned short inw(short port) |
| 42 |
{ |
| 43 |
unsigned short val; |
| 44 |
val = *((unsigned short *)(ioBase + port)); eieio(); |
| 45 |
return(val); |
| 46 |
} |
| 47 |
|
| 48 |
static __inline__ unsigned long inl(short port) |
| 49 |
{ |
| 50 |
unsigned long val; |
| 51 |
val = *((unsigned long *)(ioBase + port)); eieio(); |
| 52 |
return(val); |
| 53 |
} |
| 54 |
|
| 55 |
#define intr_disable() |
| 56 |
#define intr_enable() |
| 57 |
|
| 58 |
#else |
| 59 |
#ifdef linux |
| 60 |
/*nothing*/ |
| 61 |
#else |
| 62 |
#include "sysdep/AsmMacros_generic.h" |
| 63 |
#endif |
| 64 |
#endif |
| 65 |
|
| 66 |
#endif |