Lines Matching refs:port
249 #define IS_TIMER_PORT(port) (0x40 <= port && port <= 0x43) argument
250 #define IS_CMOS_PORT(port) (0x70 <= port && port <= 0x71) argument
252 #define IS_VGA_PORT(port) (0x3C0 <= port && port <= 0x3DA) argument
253 #define IS_PCI_PORT(port) (0xCF8 <= port && port <= 0xCFF) argument
254 #define IS_SPKR_PORT(port) (port == 0x61) argument
267 static u8 VGA_inpb (const int port) in VGA_inpb() argument
271 debug_io("vga_inb.%04X -> ", (u16) port); in VGA_inpb()
272 switch (port) { in VGA_inpb()
343 static void VGA_outpb (int port, u8 val) in VGA_outpb() argument
345 switch (port) { in VGA_outpb()
501 static u32 PCI_inp(int port, int type) in PCI_inp() argument
505 if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port in PCI_inp()
506 && port <= 0xCFF) in PCI_inp()
507 return BE_accessReg(port - 0xCFC, 0, REG_READ_BYTE); in PCI_inp()
510 if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port in PCI_inp()
511 && port <= 0xCFF) in PCI_inp()
512 return BE_accessReg(port - 0xCFC, 0, REG_READ_WORD); in PCI_inp()
515 if (port == 0xCF8) in PCI_inp()
517 else if ((_BE_env.configAddress & 0x80000000) && port == 0xCFC) in PCI_inp()
532 static void PCI_outp(int port, u32 val, int type) in PCI_outp() argument
536 if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port in PCI_outp()
537 && port <= 0xCFF) in PCI_outp()
538 BE_accessReg(port - 0xCFC, val, REG_WRITE_BYTE); in PCI_outp()
541 if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port in PCI_outp()
542 && port <= 0xCFF) in PCI_outp()
543 BE_accessReg(port - 0xCFC, val, REG_WRITE_WORD); in PCI_outp()
546 if (port == 0xCF8) in PCI_outp()
550 else if ((_BE_env.configAddress & 0x80000000) && port == 0xCFC) in PCI_outp()
570 u8 X86API BE_inb(X86EMU_pioAddr port) in BE_inb() argument
575 if (IS_VGA_PORT(port)){ in BE_inb()
577 if(port == 0x3c3) in BE_inb()
578 val = LOG_inpb(port); in BE_inb()
580 val = VGA_inpb(port); in BE_inb()
582 else if (IS_TIMER_PORT(port)) in BE_inb()
584 else if (IS_SPKR_PORT(port)) in BE_inb()
586 else if (IS_CMOS_PORT(port)) in BE_inb()
588 else if (IS_PCI_PORT(port)) in BE_inb()
589 val = PCI_inp(port, REG_READ_BYTE); in BE_inb()
590 else if (port < 0x100) { in BE_inb()
591 DB(printf("WARN: INVALID inb.%04X -> %02X\n", (u16) port, val);) in BE_inb()
592 val = LOG_inpb(port); in BE_inb()
596 debug_io("inb.%04X -> ", (u16) port); in BE_inb()
597 val = LOG_inpb(port); in BE_inb()
616 u16 X86API BE_inw(X86EMU_pioAddr port) in BE_inw() argument
621 if (IS_PCI_PORT(port)) in BE_inw()
622 val = PCI_inp(port, REG_READ_WORD); in BE_inw()
623 else if (port < 0x100) { in BE_inw()
624 DB(printf("WARN: Maybe INVALID inw.%04X -> %04X\n", (u16) port, val);) in BE_inw()
625 val = LOG_inpw(port); in BE_inw()
629 debug_io("inw.%04X -> ", (u16) port); in BE_inw()
630 val = LOG_inpw(port); in BE_inw()
649 u32 X86API BE_inl(X86EMU_pioAddr port) in BE_inl() argument
654 if (IS_PCI_PORT(port)) in BE_inl()
655 val = PCI_inp(port, REG_READ_DWORD); in BE_inl()
656 else if (port < 0x100) { in BE_inl()
657 val = LOG_inpd(port); in BE_inl()
661 debug_io("inl.%04X -> ", (u16) port); in BE_inl()
662 val = LOG_inpd(port); in BE_inl()
679 void X86API BE_outb(X86EMU_pioAddr port, u8 val) in BE_outb() argument
682 if (IS_VGA_PORT(port)) in BE_outb()
683 VGA_outpb(port, val); in BE_outb()
684 else if (IS_TIMER_PORT(port)) in BE_outb()
686 else if (IS_SPKR_PORT(port)) in BE_outb()
688 else if (IS_CMOS_PORT(port)) in BE_outb()
690 else if (IS_PCI_PORT(port)) in BE_outb()
691 PCI_outp(port, val, REG_WRITE_BYTE); in BE_outb()
692 else if (port < 0x100) { in BE_outb()
693 DB(printf("WARN:Maybe INVALID outb.%04X <- %02X\n", (u16) port, val);) in BE_outb()
694 LOG_outpb(port, val); in BE_outb()
698 debug_io("outb.%04X <- %02X", (u16) port, val); in BE_outb()
699 LOG_outpb(port, val); in BE_outb()
714 void X86API BE_outw(X86EMU_pioAddr port, u16 val) in BE_outw() argument
717 if (IS_VGA_PORT(port)) { in BE_outw()
718 VGA_outpb(port, val); in BE_outw()
719 VGA_outpb(port + 1, val >> 8); in BE_outw()
720 } else if (IS_PCI_PORT(port)) { in BE_outw()
721 PCI_outp(port, val, REG_WRITE_WORD); in BE_outw()
722 } else if (port < 0x100) { in BE_outw()
723 DB(printf("WARN: MAybe INVALID outw.%04X <- %04X\n", (u16)port, in BE_outw()
725 LOG_outpw(port, val); in BE_outw()
729 debug_io("outw.%04X <- %04X", (u16) port, val); in BE_outw()
730 LOG_outpw(port, val); in BE_outw()
745 void X86API BE_outl(X86EMU_pioAddr port, u32 val) in BE_outl() argument
748 if (IS_PCI_PORT(port)) { in BE_outl()
749 PCI_outp(port, val, REG_WRITE_DWORD); in BE_outl()
750 } else if (port < 0x100) { in BE_outl()
751 DB(printf("WARN: INVALID outl.%04X <- %08X\n", (u16) port,val);) in BE_outl()
752 LOG_outpd(port, val); in BE_outl()
756 debug_io("outl.%04X <- %08X", (u16) port, val); in BE_outl()
757 LOG_outpd(port, val); in BE_outl()