Date: Sun, 20 Sep 2020 23:20:18 +0000 (UTC) From: Jessica Clarke <jrtc27@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365932 - head/sys/sys Message-ID: <202009202320.08KNKIDE091734@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jrtc27 Date: Sun Sep 20 23:20:18 2020 New Revision: 365932 URL: https://svnweb.freebsd.org/changeset/base/365932 Log: atomic_common.h: Fix the volatile qualifier placement in atomic_load_ptr This was broken in r357940 which introduced the __typeof use. We need the volatile qualifier to be on the pointee not the pointer otherwise it does nothing. This was found by mhorne in D26498, noticing there was a problem (a spin loop condition was hoisted for RISC-V boot code) but not the root cause of it. Reported by: mhorne Reviewed by: mhorne, mjg Approved by: mhorne, mjg Differential Revision: https://reviews.freebsd.org/D26500 Modified: head/sys/sys/atomic_common.h Modified: head/sys/sys/atomic_common.h ============================================================================== --- head/sys/sys/atomic_common.h Sun Sep 20 22:16:24 2020 (r365931) +++ head/sys/sys/atomic_common.h Sun Sep 20 23:20:18 2020 (r365932) @@ -41,7 +41,7 @@ #define atomic_load_short(p) (*(volatile u_short *)(p)) #define atomic_load_int(p) (*(volatile u_int *)(p)) #define atomic_load_long(p) (*(volatile u_long *)(p)) -#define atomic_load_ptr(p) (*(volatile __typeof(p))(p)) +#define atomic_load_ptr(p) (*(volatile __typeof(*p) *)(p)) #define atomic_load_8(p) (*(volatile uint8_t *)(p)) #define atomic_load_16(p) (*(volatile uint16_t *)(p)) #define atomic_load_32(p) (*(volatile uint32_t *)(p))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009202320.08KNKIDE091734>