3 #include <video_defines.h>
6 #include <pci-bother.h>
10 #include "../net/net.h"
11 #include "vga-overlay.h"
13 unsigned int counter = 0;
14 unsigned long pcisave = 0;
15 unsigned char vgasave = 0;
28 fb->getvmode(fb->priv);
31 sprintf(statstr, "NetWatch! %08x %08x", smi_status(), counter);
32 strblit(statstr, 0, 0, 0);
35 if (fb && !fb->curmode.text)
38 {1,0}, {4,0},{5,0},{6,0}, {8,0},{9,0},{10,0},
39 {0,1}, {2,1}, {4,1}, {8,1},
40 {0,2},{1,2},{2,2}, {4,2},{5,2},{6,2}, {8,2},{9,2},{10,2},
41 {0,3}, {2,3}, {6,3}, {10,3},
42 {0,4}, {2,4}, {4,4},{5,4},{6,4}, {8,4},{9,4},{10,4},
46 for (p = 0; ass[p][0] != -1; p++)
49 unsigned long lasta = 0;
50 unsigned long *lastmap;
51 for (y = 0; y < 8; y++)
52 for (x = 0; x < 8; x++)
55 (unsigned long) fb->fbaddr +
56 ((y+ass[p][1]*8) * fb->curmode.xres + ass[p][0]*8 + x) * 4;
57 if ((a & ~4095) != (lasta & ~4095))
59 lastmap = (unsigned long *)((unsigned long)p2v(a) & ~4095);
62 lastmap[(a & 4095) / 4] = 0xFF0000FF;
69 if (inl(0x840) & 0x1000)
86 extern void timer_handler(smi_event_t ev);
87 extern void kbc_handler(smi_event_t ev);
88 extern void gbl_rls_handler(smi_event_t ev);
90 void __firstrun_stub() {
92 /* Try really hard to shut up USB_LEGKEY. */
93 pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
94 pci_write16(0, 31, 2, 0xC0, 0);
95 pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
96 pci_write16(0, 31, 4, 0xC0, 0);
98 /* Turn on the SMIs we want */
101 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
102 smi_enable_event(SMI_EVENT_FAST_TIMER);
104 smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
105 smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
107 smi_register_handler(SMI_EVENT_GBL_RLS, gbl_rls_handler);
108 smi_enable_event(SMI_EVENT_GBL_RLS);