From b0025dc0cda5acf6a4b061a3b31f32798c664e5f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 9 Jun 2025 16:03:57 -0400 Subject: kernel: proc: Make per-process flags volatile The per process flags field is a frequently modified/read field and MUST NOT give stale data. Be very sure that the compiler does not optimize away accesses. Signed-off-by: Ian Moffett --- sys/include/sys/proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h index 25f5fd3..2f1470a 100644 --- a/sys/include/sys/proc.h +++ b/sys/include/sys/proc.h @@ -68,7 +68,7 @@ struct proc { size_t priority; int exit_status; bool rested; - uint32_t flags; + volatile uint32_t flags; uint32_t nleaves; uintptr_t stack_base; struct spinlock ksigq_lock; -- cgit v1.2.3