1#ifndef _VBUTIL_ 2#define _VBUTIL_ 3static inline void xgifb_reg_set(unsigned long port, u8 index, u8 data) 4{ 5 outb(index, port); 6 outb(data, port + 1); 7} 8 9static inline u8 xgifb_reg_get(unsigned long port, u8 index) 10{ 11 outb(index, port); 12 return inb(port + 1); 13} 14 15static inline void xgifb_reg_and_or(unsigned long port, u8 index, 16 unsigned data_and, unsigned 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 25static inline void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and) 26{ 27 u8 temp; 28 29 temp = xgifb_reg_get(port, index); 30 temp = (u8) (temp & data_and); 31 xgifb_reg_set(port, index, temp); 32} 33 34static inline void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or) 35{ 36 u8 temp; 37 38 temp = xgifb_reg_get(port, index); 39 temp |= data_or; 40 xgifb_reg_set(port, index, temp); 41} 42#endif 43 44