Root/drivers/staging/xgifb/vb_util.c

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    u8 data;
13
14    outb(index, port);
15    data = inb(port + 1);
16    return data;
17}
18
19void xgifb_reg_and_or(unsigned long port, u8 index,
20        unsigned data_and, unsigned data_or)
21{
22    u8 temp;
23
24    temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
25    temp = (temp & data_and) | data_or;
26    xgifb_reg_set(port, index, temp);
27}
28
29void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
30{
31    u8 temp;
32
33    temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
34    temp &= data_and;
35    xgifb_reg_set(port, index, temp);
36}
37
38void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
39{
40    u8 temp;
41
42    temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
43    temp |= data_or;
44    xgifb_reg_set(port, index, temp);
45}
46

Archive Download this file



interactive