summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/x86/smm/smm_tseg.ld45
-rw-r--r--src/cpu/x86/smm/smmhandler_tseg.S9
2 files changed, 36 insertions, 18 deletions
diff --git a/src/cpu/x86/smm/smm_tseg.ld b/src/cpu/x86/smm/smm_tseg.ld
index 016b5a0fcf..6def972949 100644
--- a/src/cpu/x86/smm/smm_tseg.ld
+++ b/src/cpu/x86/smm/smm_tseg.ld
@@ -10,6 +10,34 @@ SECTIONS
.handler (.): {
/* Assembler stub */
*(.handler)
+ }
+
+ /* We are using the TSEG interleaved to stuff the SMM handlers
+ * for all CPU cores in there. The jump table redirects the execution
+ * to the actual SMM handler
+ */
+ . = 0x8000 - (( CPUS - 1) * 0x400);
+ .jumptable : {
+ *(.jumptable)
+ }
+
+ /* Data used in early SMM TSEG handler. */
+ . = 0x8400;
+ .earlydata : {
+ *(.earlydata)
+ }
+
+ /* 16KB for the heap at 64KB */
+ . = 0x10000;
+ .heap : {
+ _heap = .;
+ . = 0x4000;
+ _eheap = .;
+ }
+
+ . = ALIGN(0x4000);
+ .smm_c_handler : {
+ _smm_c_handler_start = .;
/* C code of the SMM handler */
*(.text);
@@ -29,25 +57,10 @@ SECTIONS
. = ALIGN(4);
*(.bss)
*(.sbss)
-
- /* What is this? */
*(COMMON)
. = ALIGN(4);
- }
- /* We are using the TSEG interleaved to stuff the SMM handlers
- * for all CPU cores in there. The jump table redirects the execution
- * to the actual SMM handler
- */
- . = 0x8000 - (( CPUS - 1) * 0x400);
- .jumptable : {
- *(.jumptable)
- }
-
- /* Data used in early SMM TSEG handler. */
- . = 0x8400;
- .earlydata : {
- *(.earlydata)
+ _smm_c_handler_end = .;
}
/DISCARD/ : {
diff --git a/src/cpu/x86/smm/smmhandler_tseg.S b/src/cpu/x86/smm/smmhandler_tseg.S
index 8fdd75fb17..c61a611757 100644
--- a/src/cpu/x86/smm/smmhandler_tseg.S
+++ b/src/cpu/x86/smm/smmhandler_tseg.S
@@ -20,7 +20,11 @@
*/
/*
- * +--------------------------------+ 0xffff
+ * +--------------------------------+
+ * | SMM Handler C Code |
+ * +--------------------------------+ 0x14000
+ * | SMM Handler Heap |
+ * +--------------------------------+ 0x10000
* | Save State Map Node 0 |
* | Save State Map Node 1 |
* | Save State Map Node 2 |
@@ -39,7 +43,7 @@
* | ... |
* +--------------------------------+ 0x7400
* | |
- * | SMM Handler |
+ * | SMM Handler Assembly Stub |
* | |
* +--------------------------------+ TSEG
*
@@ -91,6 +95,7 @@ smm_handler_start:
/* If we did not get the lock, wait for release */
wait_for_unlock:
+ pause
addr32 movw (%ebx), %ax
cmpw $SMI_LOCKED, %ax
je wait_for_unlock