static void vm_dev_init() { info->vm.dev.mem.a20 = 1; dev_kbd_init(&info->vm.dev.kbd); dev_uart_init(&info->vm.dev.uart, SERIAL_COM1); dev_ata_init(&info->vm.dev.ata[0], ATA1_START_PORT); /* proxify to detect rebase for uart irq injection */ info->vm.dev.pic1_icw2 = DFLT_PIC1_ICW2; __deny_io_range(PIC1_START_PORT, PIC1_END_PORT); /* lazzy emulation */ __deny_io_range(COM1_START_PORT, COM1_END_PORT); /* monitor reboot and A20 */ __deny_io_range(KBD_START_PORT, KBD_END_PORT); __deny_io(PS2_SYS_CTRL_PORT_A); /* ata filtering */ /* __deny_io(ATA1_CTRL_PORT); */ /* __deny_io_range(ATA1_START_PORT, ATA1_END_PORT); */ /* prevent PCI device detection */ #if defined(CONFIG_HAS_NET) || \ (defined(CONFIG_HAS_EHCI) && defined(CONFIG_EHCI_2ND)) __deny_io(PCI_CONFIG_ADDR); #endif #if defined(CONFIG_HAS_NET) && defined(CONFIG_HAS_E1000) { e1k_info_t *e1k = &info->hrd.dev.net.arch; npg_unmap(e1k->base.linear, e1k->base.linear + (128<<10)); debug(E1000, "protect e1000 mmio space [0x%X - 0x%X]\n" ,e1k->base.linear, e1k->base.linear + (128<<10)); } #endif /* super io */ __deny_io(SIO_INDEX); /* acpi PM1_CTL register */ __deny_io(info->hrd.acpi.pm1_ctl_port); }
int vm_enter_rmode() { info->vm.cpu.dflt_excp = VM_RMODE_EXCP_BITMAP; __update_exception_mask(); __deny_soft_int(); __deny_io_range(KBD_START_PORT, KBD_END_PORT); return 1; }