3 #include <video_defines.h>
6 #include <pci-bother.h>
11 #include "../net/net.h"
12 #include "vga-overlay.h"
14 unsigned int counter = 0;
15 unsigned long pcisave = 0;
16 unsigned char vgasave = 0;
22 /* Reenable caching on SMRAM. */
23 WRMSR(0x202, (RDMSR(0x202) & ~(0xFFULL)) | 0x06ULL);
32 fb->getvmode(fb->priv);
35 if (!fb || fb->curmode.text)
37 sprintf(statstr, "NetWatch! %08x %08x", smi_status(), counter);
38 strblit(statstr, 0, 0, 0);
43 if (inl(0x840) & 0x1000)
59 /* Disable caching on SMRAM again, to prevent the user from whacking us. */
60 WRMSR(0x202, RDMSR(0x202) & ~(0xFFULL));
63 extern void timer_handler(smi_event_t ev);
64 extern void kbc_handler(smi_event_t ev);
65 extern void gbl_rls_handler(smi_event_t ev);
67 void __firstrun_stub() {
69 /* Try really hard to shut up USB_LEGKEY. */
70 pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
71 pci_write16(0, 31, 2, 0xC0, 0);
72 pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
73 pci_write16(0, 31, 4, 0xC0, 0);
75 /* Turn on the SMIs we want */
78 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
79 smi_enable_event(SMI_EVENT_FAST_TIMER);
81 smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
82 smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
84 smi_register_handler(SMI_EVENT_GBL_RLS, gbl_rls_handler);
85 smi_enable_event(SMI_EVENT_GBL_RLS);