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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47714
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph 2020-11-18 13:26:10 +01:00 committed by Patrick Georgi
parent c96ee7e263
commit 72c6071770
1 changed files with 2 additions and 3 deletions

View File

@ -84,10 +84,9 @@ _start:
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