static DWORD outputw(__CMD_PARA_OBJ* lpCmdObj) { WORD wr = 0; WORD wPort = 0; DWORD dwPort = 0; if(NULL == lpCmdObj) //Parameter check. return IOCTRL_TERMINAL; if(lpCmdObj->byParameterNum < 3) //Not enough parameters. { PrintLine("Please input the port and value."); return IOCTRL_NORMAL; } if(!Str2Hex(lpCmdObj->Parameter[1],&dwPort)) { PrintLine("Please input port number correctly."); return IOCTRL_NORMAL; } wPort = (WORD)(dwPort); //Now,wPort contains the port where to output. if(!Str2Hex(lpCmdObj->Parameter[2],&dwPort)) { PrintLine("Please input the value to output correctly."); return IOCTRL_NORMAL; } wr = (WORD)(dwPort); //WriteWordToPort(wr,wPort); //Write the byte to port. __outw(wr,wPort); return IOCTRL_NORMAL; }
static inline void compare_set( uint16_t when ) { __outw( when, OCR1BL ); }
void fn0C00_0100(byte ah, byte bh) { bios_video_set_mode(0x13); word16 ax_11 = DPB(ax, 0x00, 0, 8); __outw(0x03C8, ax_11); uint8 al_10 = 0x00; do { Eq_16 al_14 = al_10 >>u 0x02; __outb(0x03C9, al_14); __outb(0x03C9, al_14 << 0x01); __outb(0x03C9, al_14 << 0x01 >>u 0x01); byte al_19 = (byte) ax_11; al_10 = al_19 + 0x01; ax_11 = DPB(ax_11, al_19 + 0x01, 0, 8); } while (al_19 != 0x01); do { byte bl_38 = bh; Eq_43 Eq_42::*cx_39 = &Eq_42::tFFFFFA00; do { (0xA000->*cx_39).bFFFFFFFF = bl_38; bl_38 = bl_38 + 0x01; cx_39 = cx_39 - 0x0001; } while (cx_39 != &Eq_42::t0000); byte al_51; bios_kbd_check_keystroke(out al_51); bh = bh + 0x01; } while (bh == 0x00); msdos_terminate(0x00); }
void fn0C00_0100(word16 cx, Eq_13 Eq_14::*bx, byte Eq_21::*di, Eq_14 * ds) { bios_video_set_mode(0x13); __outw(0x03D4, DPB(ax, 0x20, 8, 8)); ptr32 es_ax_12 = Mem0[ds:bx + 0x0000:segptr32]; Eq_19 al_13 = (byte) es_ax_12; Eq_21 * es_15 = SLICE(es_ax_12, selector, 16); do { __outb(0x03C9, al_13); al_13 = al_13 + 0x95 + C; C = cond(al_13); if (al_13 != 0x00) continue; do { es_15->*di = (byte) cx_57 ^ SLICE(cx_57, byte, 8); C = false; di = di + 1; cx = cx_57 - 0x0001; word16 cx_57 = cx; } while (cx != 0x0000); word16 ax_50 = DPB(cx_57, __inb(0x60), 0, 8); al_13 = (byte) (ax_50 - 0x0001); } while (ax_50 != 0x0001); return; }
//Write configuration to PCI bus. static BOOL PciWriteConfig(__SYSTEM_BUS* bus, DWORD dwConfigReg, DWORD dwVal,int size) { DWORD dwTmp = 0; DWORD _cfg = 0x80000000; DWORD result; //Combine the bus number,dev number,function number and offset together. dwTmp = bus->dwBusNum; dwTmp &= 0x000000FF; _cfg += (dwTmp << 16); _cfg += (dwConfigReg & 0x0000FFFF); //Issue writting. __outd(CONFIG_REGISTER, _cfg); switch (size) { case 4: __outd(DATA_REGISTER, dwVal); result = __ind(DATA_REGISTER); break; case 2: __outw((WORD)dwVal, DATA_REGISTER); result = __inw(DATA_REGISTER); dwVal &= 0xFFFF; break; case 1: __outb((UCHAR)dwVal, DATA_REGISTER); result = __inb(DATA_REGISTER); dwVal &= 0xFF; break; default: return FALSE; } //Check if writting is successful. if (dwVal == result) { return TRUE; } //For debugging. _hx_printf("PCI_DRV: Write data to PCI space failed,val = %d,result = %d.\r\n",dwVal,result); return FALSE; }
void _outw(unsigned short b, unsigned long addr) { __outw(b, addr); }