Mon Sep 25 18:55:53 2023 UTC ()
sys/sleepq.h: Fix more syncobj_t creep.


(riastradh)
diff -r1.37 -r1.38 src/sys/sys/sleepq.h

cvs diff -r1.37 -r1.38 src/sys/sys/sleepq.h (expand / switch to unified diff)

--- src/sys/sys/sleepq.h 2023/09/23 18:48:05 1.37
+++ src/sys/sys/sleepq.h 2023/09/25 18:55:53 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sleepq.h,v 1.37 2023/09/23 18:48:05 ad Exp $ */ 1/* $NetBSD: sleepq.h,v 1.38 2023/09/25 18:55:53 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019, 2020, 2023 4 * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019, 2020, 2023
5 * The NetBSD Foundation, Inc. 5 * The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Jason R. Thorpe and Andrew Doran. 9 * by Jason R. Thorpe and Andrew Doran.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -28,50 +28,52 @@ @@ -28,50 +28,52 @@
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#ifndef _SYS_SLEEPQ_H_ 33#ifndef _SYS_SLEEPQ_H_
34#define _SYS_SLEEPQ_H_ 34#define _SYS_SLEEPQ_H_
35 35
36#include <sys/lwp.h> 36#include <sys/lwp.h>
37#include <sys/mutex.h> 37#include <sys/mutex.h>
38#include <sys/pool.h> 38#include <sys/pool.h>
39#include <sys/queue.h> 39#include <sys/queue.h>
40#include <sys/sched.h> 40#include <sys/sched.h>
41#include <sys/syncobj.h> 41#include <sys/syncobj.h> /* XXX remove me */
42#include <sys/param.h> 42#include <sys/param.h>
43 43
 44struct syncobj;
 45
44/* 46/*
45 * Generic sleep queues. 47 * Generic sleep queues.
46 */ 48 */
47 49
48typedef struct sleepq sleepq_t; 50typedef struct sleepq sleepq_t;
49typedef struct syncobj const syncobj_t; 
50 51
51void sleepq_init(sleepq_t *); 52void sleepq_init(sleepq_t *);
52void sleepq_remove(sleepq_t *, lwp_t *); 53void sleepq_remove(sleepq_t *, lwp_t *);
53void sleepq_enter(sleepq_t *, lwp_t *, kmutex_t *); 54void sleepq_enter(sleepq_t *, lwp_t *, kmutex_t *);
54void sleepq_enqueue(sleepq_t *, wchan_t, const char *, syncobj_t *, bool); 55void sleepq_enqueue(sleepq_t *, wchan_t, const char *,
 56 const struct syncobj *, bool);
55void sleepq_transfer(lwp_t *, sleepq_t *, sleepq_t *, wchan_t, const char *, 57void sleepq_transfer(lwp_t *, sleepq_t *, sleepq_t *, wchan_t, const char *,
56 syncobj_t *, kmutex_t *, bool); 58 const struct syncobj *, kmutex_t *, bool);
57void sleepq_uncatch(lwp_t *); 59void sleepq_uncatch(lwp_t *);
58void sleepq_unsleep(lwp_t *, bool); 60void sleepq_unsleep(lwp_t *, bool);
59void sleepq_timeout(void *); 61void sleepq_timeout(void *);
60void sleepq_wake(sleepq_t *, wchan_t, u_int, kmutex_t *); 62void sleepq_wake(sleepq_t *, wchan_t, u_int, kmutex_t *);
61int sleepq_abort(kmutex_t *, int); 63int sleepq_abort(kmutex_t *, int);
62void sleepq_changepri(lwp_t *, pri_t); 64void sleepq_changepri(lwp_t *, pri_t);
63void sleepq_lendpri(lwp_t *, pri_t); 65void sleepq_lendpri(lwp_t *, pri_t);
64int sleepq_block(int, bool, syncobj_t *); 66int sleepq_block(int, bool, const struct syncobj *);
65 67
66#ifdef _KERNEL 68#ifdef _KERNEL
67 69
68#include <sys/kernel.h> 70#include <sys/kernel.h>
69 71
70typedef union { 72typedef union {
71 kmutex_t lock; 73 kmutex_t lock;
72 uint8_t pad[COHERENCY_UNIT]; 74 uint8_t pad[COHERENCY_UNIT];
73} sleepqlock_t; 75} sleepqlock_t;
74 76
75/* 77/*
76 * Return non-zero if it is unsafe to sleep. 78 * Return non-zero if it is unsafe to sleep.
77 * 79 *