diff options
author | 2020-07-04 08:06:07 +0000 | |
---|---|---|
committer | 2020-07-04 08:06:07 +0000 | |
commit | b609c6162eecdc2b88363239960056f85f454ba3 (patch) | |
tree | e9cadb2ce03bf1dccbd154dc63458e3279f667d5 | |
parent | Permit the stack to check transport and network checksums. Although the link (diff) | |
download | wireguard-openbsd-b609c6162eecdc2b88363239960056f85f454ba3.tar.xz wireguard-openbsd-b609c6162eecdc2b88363239960056f85f454ba3.zip |
It's been agreed upon that global locks should be expressed using
capital letters in locking annotations. Therefore harmonize the existing
annotations.
Also, if multiple locks are required they should be delimited using
commas.
ok mpi@
-rw-r--r-- | sys/dev/dt/dt_dev.c | 18 | ||||
-rw-r--r-- | sys/dev/dt/dtvar.h | 24 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 32 | ||||
-rw-r--r-- | sys/kern/kern_timeout.c | 12 | ||||
-rw-r--r-- | sys/net/if_var.h | 10 | ||||
-rw-r--r-- | sys/sys/filedesc.h | 10 | ||||
-rw-r--r-- | sys/sys/proc.h | 30 | ||||
-rw-r--r-- | sys/sys/timetc.h | 8 |
8 files changed, 72 insertions, 72 deletions
diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c index 0c6a34cdfb8..19b37f83063 100644 --- a/sys/dev/dt/dt_dev.c +++ b/sys/dev/dt/dt_dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dt_dev.c,v 1.7 2020/06/27 07:22:09 bket Exp $ */ +/* $OpenBSD: dt_dev.c,v 1.8 2020/07/04 08:06:07 anton Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org> @@ -74,19 +74,19 @@ * * Locks used to protect struct members in this file: * m per-softc mutex - * k kernel lock + * K kernel lock */ struct dt_softc { - SLIST_ENTRY(dt_softc) ds_next; /* [k] descriptor list */ + SLIST_ENTRY(dt_softc) ds_next; /* [K] descriptor list */ int ds_unit; /* [I] D_CLONE unique unit */ pid_t ds_pid; /* [I] PID of tracing program */ struct mutex ds_mtx; - struct dt_pcb_list ds_pcbs; /* [k] list of enabled PCBs */ - struct dt_evt *ds_bufqueue; /* [k] copy evts to userland */ - size_t ds_bufqlen; /* [k] length of the queue */ - int ds_recording; /* [k] currently recording? */ + struct dt_pcb_list ds_pcbs; /* [K] list of enabled PCBs */ + struct dt_evt *ds_bufqueue; /* [K] copy evts to userland */ + size_t ds_bufqlen; /* [K] length of the queue */ + int ds_recording; /* [K] currently recording? */ int ds_evtcnt; /* [m] # of readable evts */ /* Counters */ @@ -94,7 +94,7 @@ struct dt_softc { uint64_t ds_dropevt; /* [m] # of events dropped */ }; -SLIST_HEAD(, dt_softc) dtdev_list; /* [k] list of open /dev/dt nodes */ +SLIST_HEAD(, dt_softc) dtdev_list; /* [K] list of open /dev/dt nodes */ /* * Probes are created during dt_attach() and never modified/freed during @@ -104,7 +104,7 @@ unsigned int dt_nprobes; /* [I] # of probes available */ SIMPLEQ_HEAD(, dt_probe) dt_probe_list; /* [I] list of probes */ struct rwlock dt_lock = RWLOCK_INITIALIZER("dtlk"); -volatile uint32_t dt_tracing = 0; /* [k] # of processes tracing */ +volatile uint32_t dt_tracing = 0; /* [K] # of processes tracing */ void dtattach(struct device *, struct device *, void *); int dtopen(dev_t, int, int, struct proc *); diff --git a/sys/dev/dt/dtvar.h b/sys/dev/dt/dtvar.h index 9db1276a3fe..65a89122a14 100644 --- a/sys/dev/dt/dtvar.h +++ b/sys/dev/dt/dtvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dtvar.h,v 1.3 2020/03/28 15:42:25 mpi Exp $ */ +/* $OpenBSD: dtvar.h,v 1.4 2020/07/04 08:06:07 anton Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org> @@ -159,14 +159,14 @@ int dtioc_req_isvalid(struct dtioc_req *); * * Locks used to protect struct members in this file: * I immutable after creation - * k kernel lock - * k,s kernel lock for writting and SMR for reading + * K kernel lock + * K,S kernel lock for writting and SMR for reading * m per-pcb mutex * c owned (read & modified) by a single CPU */ struct dt_pcb { - SMR_SLIST_ENTRY(dt_pcb) dp_pnext; /* [k,s] next PCB per probe */ - TAILQ_ENTRY(dt_pcb) dp_snext; /* [k] next PCB per softc */ + SMR_SLIST_ENTRY(dt_pcb) dp_pnext; /* [K,S] next PCB per probe */ + TAILQ_ENTRY(dt_pcb) dp_snext; /* [K] next PCB per softc */ /* Event states ring */ unsigned int dp_prod; /* [m] read index */ @@ -203,18 +203,18 @@ void dt_pcb_ring_consume(struct dt_pcb *, struct dt_evt *); * * Locks used to protect struct members in this file: * I immutable after creation - * k kernel lock - * d dt_lock - * d,s dt_lock for writting and SMR for reading + * K kernel lock + * D dt_lock + * D,S dt_lock for writting and SMR for reading */ struct dt_probe { - SIMPLEQ_ENTRY(dt_probe) dtp_next; /* [k] global list of probes */ - SMR_SLIST_HEAD(, dt_pcb) dtp_pcbs; /* [d,s] list of enabled PCBs */ + SIMPLEQ_ENTRY(dt_probe) dtp_next; /* [K] global list of probes */ + SMR_SLIST_HEAD(, dt_pcb) dtp_pcbs; /* [D,S] list of enabled PCBs */ struct dt_provider *dtp_prov; /* [I] its to provider */ const char *dtp_func; /* [I] probe function */ const char *dtp_name; /* [I] probe name */ uint32_t dtp_pbn; /* [I] unique ID */ - volatile uint32_t dtp_recording; /* [d] is it recording? */ + volatile uint32_t dtp_recording; /* [D] is it recording? */ uint8_t dtp_nargs; /* [I] # of arguments */ /* Provider specific fields. */ @@ -228,7 +228,7 @@ struct dt_probe { */ struct dt_provider { const char *dtpv_name; /* [I] provider name */ - volatile uint32_t dtpv_recording;/* [d] # of recording PCBs */ + volatile uint32_t dtpv_recording;/* [D] # of recording PCBs */ int (*dtpv_alloc)(struct dt_probe *, struct dt_softc *, struct dt_pcb_list *, struct dtioc_req *); diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index fa9591c2683..c3c0ee07fbb 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tc.c,v 1.60 2020/07/02 23:30:38 cheloha Exp $ */ +/* $OpenBSD: kern_tc.c,v 1.61 2020/07/04 08:06:07 anton Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org> @@ -69,24 +69,24 @@ static struct timecounter dummy_timecounter = { /* * Locks used to protect struct members, global variables in this file: * I immutable after initialization - * t tc_lock - * w windup_mtx + * T tc_lock + * W windup_mtx */ struct timehands { /* These fields must be initialized by the driver. */ - struct timecounter *th_counter; /* [w] */ - int64_t th_adjtimedelta; /* [tw] */ - int64_t th_adjustment; /* [w] */ - u_int64_t th_scale; /* [w] */ - u_int th_offset_count; /* [w] */ - struct bintime th_boottime; /* [tw] */ - struct bintime th_offset; /* [w] */ - struct bintime th_naptime; /* [w] */ - struct timeval th_microtime; /* [w] */ - struct timespec th_nanotime; /* [w] */ + struct timecounter *th_counter; /* [W] */ + int64_t th_adjtimedelta; /* [T,W] */ + int64_t th_adjustment; /* [W] */ + u_int64_t th_scale; /* [W] */ + u_int th_offset_count; /* [W] */ + struct bintime th_boottime; /* [T,W] */ + struct bintime th_offset; /* [W] */ + struct bintime th_naptime; /* [W] */ + struct timeval th_microtime; /* [W] */ + struct timespec th_nanotime; /* [W] */ /* Fields not to be copied in tc_windup start with th_generation. */ - volatile u_int th_generation; /* [w] */ + volatile u_int th_generation; /* [W] */ struct timehands *th_next; /* [I] */ }; @@ -109,8 +109,8 @@ struct rwlock tc_lock = RWLOCK_INITIALIZER("tc_lock"); */ struct mutex windup_mtx = MUTEX_INITIALIZER(IPL_CLOCK); -static struct timehands *volatile timehands = &th0; /* [w] */ -struct timecounter *timecounter = &dummy_timecounter; /* [t] */ +static struct timehands *volatile timehands = &th0; /* [W] */ +struct timecounter *timecounter = &dummy_timecounter; /* [T] */ static SLIST_HEAD(, timecounter) tc_list = SLIST_HEAD_INITIALIZER(tc_list); /* diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index eab14f2da7b..b67c5a2163e 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.72 2020/02/18 12:13:40 mpi Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.73 2020/07/04 08:06:08 anton Exp $ */ /* * Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org> * Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org> @@ -47,12 +47,12 @@ * Locks used to protect global variables in this file: * * I immutable after initialization - * t timeout_mutex + * T timeout_mutex */ struct mutex timeout_mutex = MUTEX_INITIALIZER(IPL_HIGH); void *softclock_si; /* [I] softclock() interrupt handle */ -struct timeoutstat tostat; /* [t] statistics and totals */ +struct timeoutstat tostat; /* [T] statistics and totals */ /* * Timeouts are kept in a hierarchical timing wheel. The to_time is the value @@ -64,9 +64,9 @@ struct timeoutstat tostat; /* [t] statistics and totals */ #define WHEELMASK 255 #define WHEELBITS 8 -struct circq timeout_wheel[BUCKETS]; /* [t] Queues of timeouts */ -struct circq timeout_todo; /* [t] Due or needs scheduling */ -struct circq timeout_proc; /* [t] Due + needs process context */ +struct circq timeout_wheel[BUCKETS]; /* [T] Queues of timeouts */ +struct circq timeout_todo; /* [T] Due or needs scheduling */ +struct circq timeout_proc; /* [T] Due + needs process context */ #define MASKWHEEL(wheel, time) (((time) >> ((wheel)*WHEELBITS)) & WHEELMASK) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 9577164d9be..7b928ad7bba 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.105 2020/05/12 08:49:54 jan Exp $ */ +/* $OpenBSD: if_var.h,v 1.106 2020/07/04 08:06:08 anton Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -104,7 +104,7 @@ struct if_clone { * I immutable after creation * d protection left do the driver * c only used in ioctl or routing socket contexts (kernel lock) - * k kernel lock + * K kernel lock * N net lock * * For SRP related structures that allow lock-free reads, the write lock @@ -120,7 +120,7 @@ TAILQ_HEAD(ifnet_head, ifnet); /* the actual queue head */ struct ifnet { /* and the entries */ void *if_softc; /* [I] lower-level data for this if */ struct refcnt if_refcnt; - TAILQ_ENTRY(ifnet) if_list; /* [k] all struct ifnets are chained */ + TAILQ_ENTRY(ifnet) if_list; /* [K] all struct ifnets are chained */ TAILQ_HEAD(, ifaddr) if_addrlist; /* [N] list of addresses per if */ TAILQ_HEAD(, ifmaddr) if_maddrlist; /* [N] list of multicast records */ TAILQ_HEAD(, ifg_list) if_groups; /* [N] list of groups per if */ @@ -131,7 +131,7 @@ struct ifnet { /* and the entries */ void (*if_rtrequest)(struct ifnet *, int, struct rtentry *); char if_xname[IFNAMSIZ]; /* [I] external name (name + unit) */ int if_pcount; /* [N] # of promiscuous listeners */ - unsigned int if_bridgeidx; /* [k] used by bridge ports */ + unsigned int if_bridgeidx; /* [K] used by bridge ports */ caddr_t if_bpf; /* packet filter structure */ caddr_t if_switchport; /* used by switch ports */ caddr_t if_mcast; /* used by multicast code */ @@ -159,7 +159,7 @@ struct ifnet { /* and the entries */ struct task if_linkstatetask; /* [I] task to do route updates */ /* procedure handles */ - SRPL_HEAD(, ifih) if_inputs; /* [k] input routines (dequeue) */ + SRPL_HEAD(, ifih) if_inputs; /* [K] input routines (dequeue) */ int (*if_output)(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); /* output routine (enqueue) */ /* link level output function */ diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index ef784f7ebaa..f332fb6619a 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: filedesc.h,v 1.44 2020/01/30 15:33:04 visa Exp $ */ +/* $OpenBSD: filedesc.h,v 1.45 2020/07/04 08:06:08 anton Exp $ */ /* $NetBSD: filedesc.h,v 1.14 1996/04/09 20:55:28 cgd Exp $ */ /* @@ -64,15 +64,15 @@ struct kqueue; * a atomic operations * f fd_lock * f/w fd_lock when writing - * k kernel lock + * K kernel lock * m fd_fplock */ struct filedesc { struct file **fd_ofiles; /* [f/w,m] file structures for * open files */ char *fd_ofileflags; /* [f] per-process open file flags */ - struct vnode *fd_cdir; /* [k] current directory */ - struct vnode *fd_rdir; /* [k] root directory */ + struct vnode *fd_cdir; /* [K] current directory */ + struct vnode *fd_rdir; /* [K] root directory */ int fd_nfiles; /* [f] number of open files allocated */ int fd_openfd; /* [f] number of files currently open */ u_int *fd_himap; /* [f] each bit points to 32 fds */ @@ -80,7 +80,7 @@ struct filedesc { int fd_lastfile; /* [f] high-water mark of fd_ofiles */ int fd_freefile; /* [f] approx. next free file */ u_short fd_cmask; /* [f/w] mask for file creation */ - u_short fd_refcnt; /* [k] reference count */ + u_short fd_refcnt; /* [K] reference count */ struct rwlock fd_lock; /* lock for the file descs */ struct mutex fd_fplock; /* lock for reading fd_ofiles without * fd_lock */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 357c0c0d52c..c146332a6e0 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.295 2020/04/28 08:29:40 mpi Exp $ */ +/* $OpenBSD: proc.h,v 1.296 2020/07/04 08:06:08 anton Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -152,7 +152,7 @@ struct unveil; * a atomic operations * m this process' `ps_mtx' * p this process' `ps_lock' - * r rlimit_lock + * R rlimit_lock */ struct process { /* @@ -235,7 +235,7 @@ struct process { /* The following fields are all copied upon creation in process_new. */ #define ps_startcopy ps_limit - struct plimit *ps_limit; /* [m,r] Process limits. */ + struct plimit *ps_limit; /* [m,R] Process limits. */ struct pgrp *ps_pgrp; /* Pointer to process group. */ struct emul *ps_emul; /* Emulation information */ @@ -325,12 +325,12 @@ struct p_inentry { /* * Locks used to protect struct members in this file: * I immutable after creation - * s scheduler lock + * S scheduler lock * l read only reference, see lim_read_enter() * o owned (read/modified only) by this thread */ struct proc { - TAILQ_ENTRY(proc) p_runq; /* [s] current run/sleep queue */ + TAILQ_ENTRY(proc) p_runq; /* [S] current run/sleep queue */ LIST_ENTRY(proc) p_list; /* List of all threads. */ struct process *p_p; /* [I] The process of this thread. */ @@ -347,8 +347,8 @@ struct proc { int p_flag; /* P_* flags. */ u_char p_spare; /* unused */ - char p_stat; /* [s] S* process status. */ - u_char p_runpri; /* [s] Runqueue priority */ + char p_stat; /* [S] S* process status. */ + u_char p_runpri; /* [S] Runqueue priority */ u_char p_descfd; /* if not 255, fdesc permits this fd */ pid_t p_tid; /* Thread identifier. */ @@ -360,15 +360,15 @@ struct proc { /* scheduling */ int p_cpticks; /* Ticks of cpu time. */ - const volatile void *p_wchan; /* [s] Sleep address. */ + const volatile void *p_wchan; /* [S] Sleep address. */ struct timeout p_sleep_to;/* timeout for tsleep() */ - const char *p_wmesg; /* [s] Reason for sleep. */ - fixpt_t p_pctcpu; /* [s] %cpu for this thread */ - u_int p_slptime; /* [s] Time since last blocked. */ + const char *p_wmesg; /* [S] Reason for sleep. */ + fixpt_t p_pctcpu; /* [S] %cpu for this thread */ + u_int p_slptime; /* [S] Time since last blocked. */ u_int p_uticks; /* Statclock hits in user mode. */ u_int p_sticks; /* Statclock hits in system mode. */ u_int p_iticks; /* Statclock hits processing intr. */ - struct cpu_info * volatile p_cpu; /* [s] CPU we're running on. */ + struct cpu_info * volatile p_cpu; /* [S] CPU we're running on. */ struct rusage p_ru; /* Statistics */ struct tusage p_tu; /* accumulated times. */ @@ -387,9 +387,9 @@ struct proc { #define p_startcopy p_sigmask sigset_t p_sigmask; /* Current signal mask. */ - u_char p_slppri; /* [s] Sleeping priority */ - u_char p_usrpri; /* [s] Priority based on p_estcpu & ps_nice */ - u_int p_estcpu; /* [s] Time averaged val of p_cpticks */ + u_char p_slppri; /* [S] Sleeping priority */ + u_char p_usrpri; /* [S] Priority based on p_estcpu & ps_nice */ + u_int p_estcpu; /* [S] Time averaged val of p_cpticks */ int p_pledge_syscall; /* Cache of current syscall */ struct ucred *p_ucred; /* [o] cached credentials */ diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h index ce81c3475a0..82796616c65 100644 --- a/sys/sys/timetc.h +++ b/sys/sys/timetc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timetc.h,v 1.10 2019/10/26 21:16:38 cheloha Exp $ */ +/* $OpenBSD: timetc.h,v 1.11 2020/07/04 08:06:08 anton Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org> @@ -48,8 +48,8 @@ typedef void timecounter_pps_t(struct timecounter *); /* * Locks used to protect struct members in this file: * I immutable after initialization - * t tc_lock - * w windup_mtx + * T tc_lock + * W windup_mtx */ struct timecounter { @@ -82,7 +82,7 @@ struct timecounter { /* Pointer to the timecounter's private parts. */ SLIST_ENTRY(timecounter) tc_next; /* [I] */ /* Pointer to the next timecounter. */ - int64_t tc_freq_adj; /* [tw] */ + int64_t tc_freq_adj; /* [T,W] */ /* Current frequency adjustment. */ u_int64_t tc_precision; /* [I] */ /* Precision of the counter. Computed in tc_init(). */ |