• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _VBUTIL_
2 #define _VBUTIL_
xgifb_reg_set(unsigned long port,u8 index,u8 data)3 static inline void xgifb_reg_set(unsigned long port, u8 index, u8 data)
4 {
5 	outb(index, port);
6 	outb(data, port + 1);
7 }
8 
xgifb_reg_get(unsigned long port,u8 index)9 static inline u8 xgifb_reg_get(unsigned long port, u8 index)
10 {
11 	outb(index, port);
12 	return inb(port + 1);
13 }
14 
xgifb_reg_and_or(unsigned long port,u8 index,unsigned int data_and,unsigned int data_or)15 static inline void xgifb_reg_and_or(unsigned long port, u8 index,
16 				    unsigned int data_and, unsigned int data_or)
17 {
18 	u8 temp;
19 
20 	temp = xgifb_reg_get(port, index);
21 	temp = (u8) ((temp & data_and) | data_or);
22 	xgifb_reg_set(port, index, temp);
23 }
24 
xgifb_reg_and(unsigned long port,u8 index,unsigned int data_and)25 static inline void xgifb_reg_and(unsigned long port, u8 index,
26 				 unsigned int data_and)
27 {
28 	u8 temp;
29 
30 	temp = xgifb_reg_get(port, index);
31 	temp = (u8) (temp & data_and);
32 	xgifb_reg_set(port, index, temp);
33 }
34 
xgifb_reg_or(unsigned long port,u8 index,unsigned int data_or)35 static inline void xgifb_reg_or(unsigned long port, u8 index,
36 				unsigned int data_or)
37 {
38 	u8 temp;
39 
40 	temp = xgifb_reg_get(port, index);
41 	temp |= data_or;
42 	xgifb_reg_set(port, index, temp);
43 }
44 #endif
45 
46