Commit 4c16f8fe authored by Aaron Durbin's avatar Aaron Durbin
Browse files

cpu/x86/mp: remove unused functions and limit API exposure



barrier_wait_timeout() was not used anywhere in the code. The
remaining two functions, barrier_wait() and release_barrier(), are
not used anywhere but the mp code.

Change-Id: If09991f95306becc68b6008ae6448695fb4a2dca
Signed-off-by: default avatarAaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/26021

Reviewed-by: default avatarJustin TerAvest <teravest@chromium.org>
Reviewed-by: default avatarFurquan Shaikh <furquan@google.com>
Reviewed-by: default avatarPaul Menzel <paulepanter@users.sourceforge.net>
Tested-by: default avatarbuild bot (Jenkins) <no-reply@coreboot.org>
parent b6616ea6
......@@ -143,37 +143,14 @@ static inline void add_cpu_map_entry(const struct cpu_info *info)
cpus[info->index].default_apic_id = cpuid_ebx(1) >> 24;
}
inline void barrier_wait(atomic_t *b)
static inline void barrier_wait(atomic_t *b)
{
while (atomic_read(b) == 0)
asm ("pause");
mfence();
}
/* Returns 1 if timeout occurs before barier is released.
* returns 0 if barrier is released before timeout. */
int barrier_wait_timeout(atomic_t *b, uint32_t timeout_ms)
{
int timeout = 0;
struct mono_time current, end;
timer_monotonic_get(&current);
end = current;
mono_time_add_msecs(&end, timeout_ms);
while ((atomic_read(b) == 0) && (!mono_time_after(&current, &end))) {
timer_monotonic_get(&current);
asm ("pause");
}
mfence();
if (mono_time_after(&current, &end))
timeout = 1;
return timeout;
}
inline void release_barrier(atomic_t *b)
static inline void release_barrier(atomic_t *b)
{
mfence();
atomic_set(b, 1);
......
......@@ -145,15 +145,5 @@ int mp_park_aps(void);
void smm_initiate_relocation_parallel(void);
/* Send SMI to self with single execution. */
void smm_initiate_relocation(void);
/* Make a CPU wait until the barrier is released */
void barrier_wait(atomic_t *b);
/*
* Make a CPU wait until the barrier is released, or timeout occurs
* returns 1 if timeout occurs before barier is released.
* returns 0 if barrier is released before timeout.
*/
int barrier_wait_timeout(atomic_t *b, uint32_t timeout_ms);
/* Release a barrier so that other CPUs waiting for that barrier can continue */
void release_barrier(atomic_t *b);
#endif /* _X86_MP_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment