3 #include <video_defines.h>
9 #include "vga-overlay.h"
11 unsigned int counter = 0;
12 unsigned long pcisave;
13 unsigned char vgasave;
18 static int curdev = 0; /* 0 if kbd, 1 if mouse */
29 b = inb(cts & 0xFFFF);
30 dologf("READ: %08x (%02x)", cts, b);
31 if ((cts & 0xFFFF) == 0x64)
32 curdev = (b & 0x20) ? 1 : 0;
33 if ((curdev == 0) && ((cts & 0xFFFF) == 0x60) && (b == 0x01))
35 *(unsigned char*)0xAFFD0 /* EAX */ = b;
42 strcpy(s, "WRITxxxxxxxxxxxxxxxx");
43 b = *(unsigned char*)0xAFFD0 /* EAX */;
47 outb(cts & 0xFFFF, b);
51 dolog("Unhandled PCI cycle");
64 outb(0x80, (counter & 0xFF));
66 sprintf(thestr, "15-412! %08x %08x", smi_status(), counter);
67 strblit(thestr, 0, 0);
69 if (inl(0x834) & 0x20)
70 dolog("Warning: unhandled APM access");
71 if (inl(0x834) & 0x1000)
73 if (inl(0x844) & 0x1000) /* devact_sts */
76 outl(0x844, 0x1000); /* ack it */
79 if (inl(0x834) & 0x4000)
80 dolog("Long periodic timer");
81 if (inl(0x840) & 0x1000)
87 if (inl(0x834) & ~(0x4160))
88 dologf("Unknown: %08x", inl(0x834) & ~(0x140));
96 outl(0x834, /*0x40*/0xFFFF); // ack the periodic IRQ
97 outb(0x830, (inb(0x830) | 0x2) & ~0x40);
98 outb(0x830, inb(0x830) | 0x40);