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