aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2024-06-23 23:23:14 +0000
committerRyan Libby <rlibby@FreeBSD.org>2024-06-23 23:23:14 +0000
commit6095f4b04cf9714a3b66fc5906fcfc5ec2a8ddd6 (patch)
tree7cdc4542d6acc5f0b87520f1edcced8dfed48876 /sys/amd64/include
parent5bcc33d1e0e61beba4890018e646fc945ada0047 (diff)
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
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h
index facf6da844d3..75a88e03290e 100644
--- a/sys/amd64/include/atomic.h
+++ b/sys/amd64/include/atomic.h
@@ -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*/