xref: /haiku/src/add-ons/kernel/drivers/graphics/et6x00/acl.c (revision 232b476c29e8427ccd5e330f51032bb7e73a470c)
1 /*****************************************************************************\
2  * Tseng Labs ET6000, ET6100 and ET6300 graphics driver for BeOS 5.
3  * Copyright (c) 2003-2004, Evgeniy Vladimirovich Bobkov.
4 \*****************************************************************************/
5 
6 #include "acl.h"
7 #include "bits.h"
8 
9 
10 /*****************************************************************************/
et6000aclMasterInterruptEnable(void * base)11 __inline void et6000aclMasterInterruptEnable(void *base) {
12     set8(&((volatile char *)base)[0x34], 0x7f, 0x80);
13 }
14 /*****************************************************************************/
et6000aclMasterInterruptDisable(void * base)15 __inline void et6000aclMasterInterruptDisable(void *base) {
16     set8(&((volatile char *)base)[0x34], 0x7f, 0x00);
17 }
18 /*****************************************************************************/
et6000aclReadInterruptEnable(void * base)19 __inline void et6000aclReadInterruptEnable(void *base) {
20     set8(&((volatile char *)base)[0x34], 0xfd, 0x02);
21 }
22 /*****************************************************************************/
et6000aclReadInterruptDisable(void * base)23 __inline void et6000aclReadInterruptDisable(void *base) {
24     set8(&((volatile char *)base)[0x34], 0xfd, 0x00);
25 }
26 /*****************************************************************************/
et6000aclWriteInterruptEnable(void * base)27 __inline void et6000aclWriteInterruptEnable(void *base) {
28     set8(&((volatile char *)base)[0x34], 0xfe, 0x01);
29 }
30 /*****************************************************************************/
et6000aclWriteInterruptDisable(void * base)31 __inline void et6000aclWriteInterruptDisable(void *base) {
32     set8(&((volatile char *)base)[0x34], 0xfe, 0x00);
33 }
34 /*****************************************************************************/
et6000aclReadInterruptClear(void * base)35 __inline void et6000aclReadInterruptClear(void *base) {
36     set8(&((volatile char *)base)[0x35], 0xfd, 0x02);
37 }
38 /*****************************************************************************/
et6000aclWriteInterruptClear(void * base)39 __inline void et6000aclWriteInterruptClear(void *base) {
40     set8(&((volatile char *)base)[0x34], 0xfe, 0x00);
41 }
42 /*****************************************************************************/
et6000aclInterruptCause(void * base)43 __inline char et6000aclInterruptCause(void *base) {
44     return ((volatile char *)base)[0x35] & 0x03;
45 }
46 /*****************************************************************************/
47