mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-26 07:55:01 +00:00
amd64 kernel __storeload_barrier: quiet gcc -Warray-bounds
Use a constant input operand instead of an output operand to tell the compiler about OFFSETOF_MONITORBUF. If we tell it we are writing to *(u_int *)OFFSETOF_MONITORBUF, it rightly complains, but we aren't. The memory clobber already covers the necessary semantics for the compiler. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D45694
This commit is contained in:
parent
5bcc33d1e0
commit
6095f4b04c
@ -295,8 +295,8 @@ static __inline void
|
||||
__storeload_barrier(void)
|
||||
{
|
||||
#if defined(_KERNEL)
|
||||
__asm __volatile("lock; addl $0,%%gs:%0"
|
||||
: "+m" (*(u_int *)OFFSETOF_MONITORBUF) : : "memory", "cc");
|
||||
__asm __volatile("lock; addl $0,%%gs:%c0"
|
||||
: : "i" (OFFSETOF_MONITORBUF) : "memory", "cc");
|
||||
#else /* !_KERNEL */
|
||||
__asm __volatile("lock; addl $0,-8(%%rsp)" : : : "memory", "cc");
|
||||
#endif /* _KERNEL*/
|
||||
|
Loading…
Reference in New Issue
Block a user