mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 15:15:01 +00:00
amd64: assert that EARLY_COUNTER does not corrupt memory.
Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D22514
This commit is contained in:
parent
515a40d5d9
commit
13189065cb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355060
|
@ -82,6 +82,7 @@ static inline void
|
|||
counter_u64_add(counter_u64_t c, int64_t inc)
|
||||
{
|
||||
|
||||
KASSERT(IS_BSP() || c != EARLY_COUNTER, ("EARLY_COUNTER used on AP"));
|
||||
__asm __volatile("addq\t%1,%%gs:(%0)"
|
||||
:
|
||||
: "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc)
|
||||
|
|
Loading…
Reference in a new issue