Author: wmb Date: 2009-07-03 06:07:29 +0200 (Fri, 03 Jul 2009) New Revision: 1233
Modified: cpu/x86/pc/olpc/via/acpi.fth cpu/x86/pc/olpc/via/romreset.bth Log: Via - another try at ACPI wakeup.
Modified: cpu/x86/pc/olpc/via/acpi.fth =================================================================== --- cpu/x86/pc/olpc/via/acpi.fth 2009-07-03 04:06:23 UTC (rev 1232) +++ cpu/x86/pc/olpc/via/acpi.fth 2009-07-03 04:07:29 UTC (rev 1233) @@ -232,7 +232,9 @@ dup >acpi-table-len 9 fix-checksum ;
-h# 28 constant rm-ds \ Must agree with GDT in rmstart.fth +h# 18 constant ds32 \ Must agree with GDT in rmstart.fth +h# 20 constant cs16 \ Must agree with GDT in rmstart.fth +h# 28 constant ds16 \ Must agree with GDT in rmstart.fth
label do-acpi-wake \ This code must be copied to low memory @@ -251,22 +253,16 @@ h# 0f # ax and ax cx mov op: 4 # bx shr
- \ The following might be unnecessary - ax ax xor rm-ds # al mov \ 16-bit data segment - ax ds mov ax es mov ax ss mov + \ Set data segment for storing offset and segment below + ax ax xor ds16 # al mov ax ds mov \ 16-bit data segment + cx wake-adr wa1+ #) mov \ Offset + bx wake-adr la1+ #) mov \ Segment
- cx wake-adr la1+ #) mov \ Offset - bx wake-adr wa1+ #) mov \ Segment + cr0 ax mov h# fe # al and ax cr0 mov \ Enter real mode
- op: cr0 ax mov h# fe # al and op: ax cr0 mov \ Enter real mode + here 5 + do-acpi-wake - wake-adr + lwsplit d# 12 lshift #) far jmp \ Jump to set cs
- here 5 + do-acpi-wake - wake-adr + lwsplit #) far jmp \ Jump to set cs - - \ The following might be unnecessary - \ Now we are running in real mode; fix segments again - cs ax mov ax ds mov ax es mov - - wake-adr wa1+ s#) far jmp + cs: wake-adr wa1+ lwsplit drop s#) far jmp end-code here do-acpi-wake - constant /do-acpi-wake
Modified: cpu/x86/pc/olpc/via/romreset.bth =================================================================== --- cpu/x86/pc/olpc/via/romreset.bth 2009-07-03 04:06:23 UTC (rev 1232) +++ cpu/x86/pc/olpc/via/romreset.bth 2009-07-03 04:07:29 UTC (rev 1233) @@ -13,7 +13,7 @@ \needs write-dropin fload ${BP}/forth/lib/mkdropin.fth \needs >seg:off fload ${BP}/cpu/x86/pc/rmtools.fth
-h# 20 constant rm-cs \ Must agree with GDT in rmstart.fth +h# 20 constant cs16 \ Must agree with GDT in rmstart.fth
fload ${BP}/cpu/x86/mmuparam.fth
@@ -178,8 +178,7 @@ facs-adr h# c + #) ax mov ax ax or 0<> if \ Resume in real mode for ACPI operating systems \ Linear wakeup address is in EAX - sp sp xor \ Possibly unnecessary - wake-adr lwsplit drop rm-cs #) far jmp + wake-adr lwsplit drop cs16 #) far jmp else \ Resume in 32-bit protected mode for OFW resume-data # sp mov