From f44b80c3f0004418c4953f0a2f32f7bec2e26e36 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 8 Sep 2021 19:45:50 +0200 Subject: process struct: replace the generic saved_addr with an union --- src/kernel/proc.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 0efccde..5d9e7eb 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -24,11 +24,13 @@ struct process { uint32_t id; // only for debugging, don't expose to userland - // meaning changes depending on the state - // PS_DEAD - death message - // PS_WAITS4CHILDDEATH - buffer for said message - user_ptr saved_addr; - size_t saved_len; + // saved value, meaning depends on .state + union { + struct { // PS_DEAD, PS_WAITS4CHILDDEATH + user_ptr buf; + size_t len; + } death_msg; + }; struct vfs_mount *mount; -- cgit v1.2.3