1 /*****************************************************************************\
2 * Tseng Labs ET6000, ET6100 and ET6300 graphics driver for BeOS 5.
3 * Copyright (c) 2003-2004, Evgeniy Vladimirovich Bobkov.
4 \*****************************************************************************/
9 /*****************************************************************************/
11 * Set bits in a byte pointed by addr; mask must contain 0s at the bits
12 * positions to be set and must contain 1s at all other bits; val must
13 * contain the values of bits to be set.
15 __inline
void set8(volatile char *addr
, char mask
, char val
)
20 *addr
= (*addr
& mask
) | (val
& ~mask
);
22 /*****************************************************************************/
23 __inline
void set16(volatile short *addr
, short mask
, short val
)
28 *addr
= (*addr
& mask
) | (val
& ~mask
);
30 /*****************************************************************************/
31 __inline
void set32(volatile int *addr
, int mask
, int val
)
36 *addr
= (*addr
& mask
) | (val
& ~mask
);
38 /*****************************************************************************/
39 __inline
void ioSet8(short port
, char mask
, char val
)
43 __asm__
__volatile__ (
53 __asm__
__volatile__ (
61 current
= (current
& mask
) | (val
& ~mask
);
62 __asm__
__volatile__ (
67 : "r"(current
), "r"(port
)
72 /*****************************************************************************/
73 __inline
char ioGet8(short port
)
76 __asm__
__volatile__ (
86 /*****************************************************************************/