aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-12-08 17:14:04 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2010-12-14 10:48:42 -0800
commit31883443bcb4ee9320564d7b28610aba286196d9 (patch)
tree00bb423304b76918fccf0872d533cd4a27c256d6
parent6e8e44079b629ab7dd32c37b6c6b3f79a8b6e5cc (diff)
downloadmrst-s0i3-test-31883443bcb4ee9320564d7b28610aba286196d9.tar.gz
mrst-s0i3-test-31883443bcb4ee9320564d7b28610aba286196d9.tar.xz
mrst-s0i3-test-31883443bcb4ee9320564d7b28610aba286196d9.zip
s0i3: allow break events, but do not STI the processor
We want interrupts to be break events, but we do not want them to wake us up just yet; remove sti/cli but enable them to be interrupt break events via ECX=1.
-rw-r--r--drivers/idle/mrst_s0i3_asm.S21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/idle/mrst_s0i3_asm.S b/drivers/idle/mrst_s0i3_asm.S
index 2464fb3c975..df438ebd98f 100644
--- a/drivers/idle/mrst_s0i3_asm.S
+++ b/drivers/idle/mrst_s0i3_asm.S
@@ -82,6 +82,8 @@ ENTRY(mrst_s0i3_entry)
leal (-__PAGE_OFFSET)(%esp), %eax
movl %eax, mrst_s0i3_resume_stack
+ lock
+ incl mrst_s0i3_entry_ctr
wbinvd
@@ -92,14 +94,15 @@ ENTRY(mrst_s0i3_entry)
movl $MRST_C6_HINTS_EAX, %eax
movl $MRST_C6_HINTS_ECX, %ecx
- movl %esi, (%edi)
- sti
+ movl %esi, (%edi) /* Set the PM_CMD register for S0i3 */
mwait
/* If MWAIT wakes us up, assume something happened... */
- cli
movl %ebp, %esp
+ lock
+ incl mrst_s0i3_fail_ctr
+
xorl %eax, %eax /* Not really S0i3 */
popl %ebx
popl %ebp
@@ -114,6 +117,9 @@ ENDPROC(mrst_s0i3_entry)
ENTRY(mrst_s0i3_resume)
cli
+ lock
+ incl pa(mrst_s0i3_exit_ctr)
+
movl pa(mrst_s0i3_resume_stack), %esp
popfl
lgdtl 2(%esp) /* Physical GDT pointer */
@@ -214,3 +220,12 @@ ENTRY(s0i3_trampoline_data_end)
mrst_s0i3_resume_stack:
.space 4
END(mrst_s0i3_resume_stack)
+mrst_s0i3_entry_ctr:
+ .space 4
+END(mrst_s0i3_entry_ctr)
+mrst_s0i3_exit_ctr:
+ .space 4
+END(mrst_s0i3_exit_ctr)
+mrst_s0i3_fail_ctr:
+ .space 4
+END(mrst_s0i3_fail_ctr)