2010-05-19 08:44:14 +00:00
|
|
|
#include "vgatypes.h"
|
2012-06-18 11:12:05 +00:00
|
|
|
#include "vb_util.h"
|
2010-05-19 08:44:14 +00:00
|
|
|
|
2011-03-13 10:26:27 +00:00
|
|
|
void xgifb_reg_set(unsigned long port, u8 index, u8 data)
|
2010-05-19 08:44:14 +00:00
|
|
|
{
|
2010-06-17 17:10:41 +00:00
|
|
|
outb(index, port);
|
|
|
|
outb(data, port + 1);
|
2010-05-19 08:44:14 +00:00
|
|
|
}
|
|
|
|
|
2011-03-13 10:26:27 +00:00
|
|
|
u8 xgifb_reg_get(unsigned long port, u8 index)
|
2010-05-19 08:44:14 +00:00
|
|
|
{
|
2011-03-13 10:26:27 +00:00
|
|
|
u8 data;
|
2010-05-19 08:44:14 +00:00
|
|
|
|
2010-09-04 06:39:32 +00:00
|
|
|
outb(index, port);
|
|
|
|
data = inb(port + 1);
|
|
|
|
return data;
|
2010-05-19 08:44:14 +00:00
|
|
|
}
|
|
|
|
|
2011-03-13 10:26:28 +00:00
|
|
|
void xgifb_reg_and_or(unsigned long port, u8 index,
|
|
|
|
unsigned data_and, unsigned data_or)
|
2010-05-19 08:44:14 +00:00
|
|
|
{
|
2011-03-13 10:26:27 +00:00
|
|
|
u8 temp;
|
2010-05-19 08:44:14 +00:00
|
|
|
|
2011-03-13 10:26:28 +00:00
|
|
|
temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp = (temp & data_and) | data_or;
|
|
|
|
xgifb_reg_set(port, index, temp);
|
2010-05-19 08:44:14 +00:00
|
|
|
}
|
|
|
|
|
2011-03-13 10:26:28 +00:00
|
|
|
void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
|
2010-05-19 08:44:14 +00:00
|
|
|
{
|
2011-03-13 10:26:27 +00:00
|
|
|
u8 temp;
|
2010-05-19 08:44:14 +00:00
|
|
|
|
2011-03-13 10:26:28 +00:00
|
|
|
temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp &= data_and;
|
|
|
|
xgifb_reg_set(port, index, temp);
|
2010-05-19 08:44:14 +00:00
|
|
|
}
|
|
|
|
|
2011-03-13 10:26:28 +00:00
|
|
|
void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
|
2010-05-19 08:44:14 +00:00
|
|
|
{
|
2011-03-13 10:26:27 +00:00
|
|
|
u8 temp;
|
2010-05-19 08:44:14 +00:00
|
|
|
|
2011-03-13 10:26:28 +00:00
|
|
|
temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp |= data_or;
|
|
|
|
xgifb_reg_set(port, index, temp);
|
2010-05-19 08:44:14 +00:00
|
|
|
}
|