1#include "vgatypes.h"
2#include "vb_util.h"
3
4void xgifb_reg_set(unsigned long port, u8 index, u8 data)
5{
6	outb(index, port);
7	outb(data, port + 1);
8}
9
10u8 xgifb_reg_get(unsigned long port, u8 index)
11{
12	outb(index, port);
13	return inb(port + 1);
14}
15
16void xgifb_reg_and_or(unsigned long port, u8 index,
17		unsigned data_and, unsigned data_or)
18{
19	u8 temp;
20
21	temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
22	temp = (temp & data_and) | data_or;
23	xgifb_reg_set(port, index, temp);
24}
25
26void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
27{
28	u8 temp;
29
30	temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
31	temp &= data_and;
32	xgifb_reg_set(port, index, temp);
33}
34
35void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
36{
37	u8 temp;
38
39	temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
40	temp |= data_or;
41	xgifb_reg_set(port, index, temp);
42}
43