Module Name: src Committed By: ad Date: Wed Oct 4 20:52:07 UTC 2023
Modified Files: src/sys/sys: proc.h Log Message: p->p_stat is actually locked by proc_lock so document it that way and shuffle some fields around so it's not next to p->p_trace_enabled (that needs some attention too, in a later change). To generate a diff of this commit: cvs rdiff -u -r1.372 -r1.373 src/sys/sys/proc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/proc.h diff -u src/sys/sys/proc.h:1.372 src/sys/sys/proc.h:1.373 --- src/sys/sys/proc.h:1.372 Tue Jul 11 09:48:56 2023 +++ src/sys/sys/proc.h Wed Oct 4 20:52:07 2023 @@ -1,7 +1,7 @@ -/* $NetBSD: proc.h,v 1.372 2023/07/11 09:48:56 riastradh Exp $ */ +/* $NetBSD: proc.h,v 1.373 2023/10/04 20:52:07 ad Exp $ */ /*- - * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. + * Copyright (c) 2006, 2007, 2008, 2020, 2023 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -252,12 +252,12 @@ struct proc { int p_exitsig; /* l: signal to send to parent on exit */ int p_flag; /* p: PK_* flags */ int p_sflag; /* p: PS_* flags */ - int p_slflag; /* p, l: PSL_* flags */ - int p_lflag; /* l: PL_* flags */ int p_stflag; /* t: PST_* flags */ - char p_stat; /* p: S* process status. */ + short p_slflag; /* l, p: PSL_* flags */ + char p_stat; /* l: S* process status. */ + char p_lflag; /* l: PL_* flags */ char p_trace_enabled;/* p: cached by syscall_intern() */ - char p_pad1[2]; /* unused */ + char p_pad1[3]; /* unused */ pid_t p_pid; /* :: Process identifier. */ LIST_ENTRY(proc) p_pglist; /* l: List of processes in pgrp. */ @@ -414,11 +414,11 @@ struct proc { #define PSL_TRACEPOSIX_SPAWN \ 0x00000020 /* traced process wants posix_spawn events */ -#define PSL_TRACED 0x00000800 /* Debugged process being traced */ -#define PSL_TRACEDCHILD 0x00001000 /* Report process birth */ -#define PSL_CHTRACED 0x00400000 /* Child has been traced & reparented */ -#define PSL_SYSCALL 0x04000000 /* process has PT_SYSCALL enabled */ -#define PSL_SYSCALLEMU 0x08000000 /* cancel in-progress syscall */ +#define PSL_TRACED 0x00000040 /* Debugged process being traced */ +#define PSL_TRACEDCHILD 0x00000080 /* Report process birth */ +#define PSL_CHTRACED 0x00000100 /* Child has been traced & reparented */ +#define PSL_SYSCALL 0x00000200 /* process has PT_SYSCALL enabled */ +#define PSL_SYSCALLEMU 0x00000400 /* cancel in-progress syscall */ /* * Kept in p_stflag and protected by p_stmutex. @@ -429,10 +429,10 @@ struct proc { * Kept in p_lflag and protected by the proc_lock. Access * from process context only. */ -#define PL_CONTROLT 0x00000002 /* Has a controlling terminal */ -#define PL_PPWAIT 0x00000010 /* Parent is waiting for child exec/exit */ -#define PL_SIGCOMPAT 0x00000200 /* Has used compat signal trampoline */ -#define PL_ORPHANPG 0x20000000 /* Member of an orphaned pgrp */ +#define PL_CONTROLT 0x00000001 /* Has a controlling terminal */ +#define PL_PPWAIT 0x00000002 /* Parent is waiting for child exec/exit */ +#define PL_SIGCOMPAT 0x00000004 /* Has used compat signal trampoline */ +#define PL_ORPHANPG 0x00000008 /* Member of an orphaned pgrp */ #if defined(_KMEMUSER) || defined(_KERNEL)