| plan 9 kernel history: overview | file list | diff list |
2000/1221/pc/apm.c (diff list | history)
| 2000/1018/sys/src/9/pc/apm.c:1,5 – 2000/1019/sys/src/9/pc/apm.c:1,12 (short | long) | ||
|
Bug fix: work around NEC Versa SX hardware issue. Comment edits.
rsc Fri Mar 4 12:44:25 2005 | ||
| 2000/1018 | /* | |
| 2000/1019 | * Interface to Advanced Power Management 1.2 BIOS * * This is, in many ways, a giant hack, and when things settle down * a bit and standardize, hopefully we can write a driver that deals * more directly with the hardware and thus might be a bit cleaner. * * ACPI might be the answer, but at the moment this is simpler * and more widespread. | |
| 2000/1018 | */ #include "u.h" | |
| 2000/1018/sys/src/9/pc/apm.c:39,44 – 2000/1019/sys/src/9/pc/apm.c:46,54 | ||
| 2000/1018 | * type is 0 for system segment, 1 for code/data. * * clearly we know way too much about the memory unit. | |
| 2000/1019 | * however, knowing this much about the memory unit * means that the memory unit need not know anything * about us. | |
| 2000/1018 | * * what a crock. */ | |
| 2000/1018/sys/src/9/pc/apm.c:67,79 – 2000/1019/sys/src/9/pc/apm.c:77,82 | ||
| 2000/1018 | lgdt(ptr); } | |
| 2000/1018/sys/src/9/pc/apm.c:139,144 – 2000/1019/sys/src/9/pc/apm.c:142,154 | ||
| 2000/1018 | print("apm: missing register %s\n", s); return; } | |
| 2000/1019 | /* * The NEC Versa SX bios does not report the correct 16-bit code * segment length when loaded directly from mbr -> 9load (as compared * with going through ld.com). We'll make both code segments 64k-1 bytes. */ esi = 0xFFFFFFFF; | |
| 2000/1018 | /* * We are required by the BIOS to set up three consecutive segments, | |
| 2000/1019/sys/src/9/pc/apm.c:162,167 – 2000/1221/sys/src/9/pc/apm.c:162,168 (short | long) | ||
|
Set new doze function pointer.
rsc Fri Mar 4 12:44:25 2005 | ||
| 2000/1018 | loadgdt(); addarchfile("apm", 0660, apmread, apmwrite); | |
| 2000/1221 | doze = halt; | |
| 2000/1018 | print("apm0: configured cbase %.8lux off %.8lux\n", ax<<4, ebx); | |
| 2000/1221/sys/src/9/pc/apm.c:97,109 – 2000/1229/sys/src/9/pc/apm.c:97,104 (short | long) | ||
|
Remove experimental attempt to resume 3C589.
rsc Fri Mar 4 12:44:25 2005 | ||
| 2000/1018 | apmwrite(Chan*, void *a, long n, vlong off) { int s; | |
| 2000/1229 | if(off || n != sizeof apmu) | |
| 2000/1018 | error("write a Ureg"); | |
| 2000/1229/sys/src/9/pc/apm.c:157,163 – 2001/0123/sys/src/9/pc/apm.c:157,162 (short | long) | ||
|
Remove doze function pointer.
rsc Fri Mar 4 12:44:25 2005 | ||
| 2000/1018 | loadgdt(); addarchfile("apm", 0660, apmread, apmwrite); | |
| 2000/1221 |
| |
| 2000/1018 | print("apm0: configured cbase %.8lux off %.8lux\n", ax<<4, ebx); | |
| 2001/0123/sys/src/9/pc/apm.c:64,82 – 2002/0109/sys/src/9/pc/apm.c:64,69 (short | long) | ||
|
Remove loadgdt after changing GDT. XXX Why?
rsc Fri Mar 4 12:44:25 2005 | ||
| 2000/1018 | ((base>>16)&0xFF) | SEGP | SEGPL(0) | flag; } | |
| 2001/0123/sys/src/9/pc/apm.c:154,160 – 2002/0109/sys/src/9/pc/apm.c:141,146 | ||
| 2000/1018 | setgdt(APMCSEG, ax<<4, ((esi&0xFFFF)-1)&0xFFFF, SEGEXEC|SEGR|SEGD); setgdt(APMCSEG16, cx<<4, ((esi>>16)-1)&0xFFFF, SEGEXEC|SEGR); setgdt(APMDSEG, dx<<4, (di-1)&0xFFFF, SEGDATA|SEGW|SEGD); | |