Patrick Rudolph has uploaded this change for review.

View Change

cpu/x86/sipi_vector: Simplify loop getting unique CPU number

Get rid of using eax and reload counter on race condition.

Change-Id: Ie4b9957d8aa1f272ff1db5caf2c69d1e1f086a03
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
M src/cpu/x86/sipi_vector.S
1 file changed, 2 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/47714/1
diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S
index 394c03a..199a12b 100644
--- a/src/cpu/x86/sipi_vector.S
+++ b/src/cpu/x86/sipi_vector.S
@@ -89,10 +89,9 @@
mov idt_ptr, %ebx
lidt (%ebx)

- /* Obtain CPU number. */
- movl ap_count, %eax
1:
- movl %eax, %ecx
+ /* Obtain CPU number. */
+ movl ap_count, %ecx
inc %ecx
lock cmpxchg %ecx, ap_count
jnz 1b

To view, visit change 47714. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie4b9957d8aa1f272ff1db5caf2c69d1e1f086a03
Gerrit-Change-Number: 47714
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-MessageType: newchange