Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys kern: Move various pmf declarations to device_impl.h.
details: https://anonhg.NetBSD.org/src/rev/bd287167d908
branches: trunk
changeset: 369620:bd287167d908
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Aug 24 11:19:10 2022 +0000
description:
kern: Move various pmf declarations to device_impl.h.
These are used only inside subr_autoconf.c and subr_pmf.c. Let's
stop having changes to these trigger rebuilds of all device drivers.
diffstat:
sys/sys/device.h | 44 +-------------------------------------------
sys/sys/device_impl.h | 44 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 44 insertions(+), 44 deletions(-)
diffs (147 lines):
diff -r 734c821e5316 -r bd287167d908 sys/sys/device.h
--- a/sys/sys/device.h Wed Aug 24 11:18:56 2022 +0000
+++ b/sys/sys/device.h Wed Aug 24 11:19:10 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.183 2022/08/24 11:18:56 riastradh Exp $ */
+/* $NetBSD: device.h,v 1.184 2022/08/24 11:19:10 riastradh Exp $ */
/*
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -188,21 +188,11 @@
#define DEVICE_COMPAT_EOL { .compat = NULL }
-struct device_lock {
- int dvl_nwait;
- int dvl_nlock;
- lwp_t *dvl_holder;
- kmutex_t dvl_mtx;
- kcondvar_t dvl_cv;
-};
-
struct device_suspensor {
const device_suspensor_t *ds_delegator;
char ds_name[32];
};
-#define DEVICE_SUSPENSORS_MAX 16
-
struct device_garbage {
device_t *dg_devs;
int dg_ndevs;
@@ -679,19 +669,6 @@
device_compatible_lookup_id(uintptr_t const, uintptr_t const,
const struct device_compatible_entry *);
-bool device_pmf_is_registered(device_t);
-bool device_pmf_is_registered(device_t);
-
-bool device_pmf_driver_suspend(device_t, const pmf_qual_t *);
-bool device_pmf_driver_resume(device_t, const pmf_qual_t *);
-bool device_pmf_driver_shutdown(device_t, int);
-
-void device_pmf_driver_register(device_t,
- bool (*)(device_t, const pmf_qual_t *),
- bool (*)(device_t, const pmf_qual_t *),
- bool (*)(device_t, int));
-void device_pmf_driver_deregister(device_t);
-
bool device_pmf_driver_child_register(device_t);
void device_pmf_driver_set_child_register(device_t,
bool (*)(device_t));
@@ -701,15 +678,6 @@
bool device_pmf_bus_resume(device_t, const pmf_qual_t *);
bool device_pmf_bus_shutdown(device_t, int);
-device_lock_t device_getlock(device_t);
-void device_pmf_unlock(device_t);
-bool device_pmf_lock(device_t);
-
-bool device_is_self_suspended(device_t);
-void device_pmf_self_suspend(device_t, const pmf_qual_t *);
-void device_pmf_self_resume(device_t, const pmf_qual_t *);
-bool device_pmf_self_wait(device_t, const pmf_qual_t *);
-
void device_pmf_bus_register(device_t, void *,
bool (*)(device_t, const pmf_qual_t *),
bool (*)(device_t, const pmf_qual_t *),
@@ -717,16 +685,6 @@
void (*)(device_t));
void device_pmf_bus_deregister(device_t);
-void *device_pmf_class_private(device_t);
-bool device_pmf_class_suspend(device_t, const pmf_qual_t *);
-bool device_pmf_class_resume(device_t, const pmf_qual_t *);
-
-void device_pmf_class_register(device_t, void *,
- bool (*)(device_t, const pmf_qual_t *),
- bool (*)(device_t, const pmf_qual_t *),
- void (*)(device_t));
-void device_pmf_class_deregister(device_t);
-
device_t shutdown_first(struct shutdown_state *);
device_t shutdown_next(struct shutdown_state *);
diff -r 734c821e5316 -r bd287167d908 sys/sys/device_impl.h
--- a/sys/sys/device_impl.h Wed Aug 24 11:18:56 2022 +0000
+++ b/sys/sys/device_impl.h Wed Aug 24 11:19:10 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device_impl.h,v 1.1 2022/03/28 12:38:59 riastradh Exp $ */
+/* $NetBSD: device_impl.h,v 1.2 2022/08/24 11:19:10 riastradh Exp $ */
/*
* Copyright (c) 2022 The NetBSD Foundation, Inc.
@@ -111,6 +111,16 @@
#include <sys/device.h>
+struct device_lock {
+ int dvl_nwait;
+ int dvl_nlock;
+ lwp_t *dvl_holder;
+ kmutex_t dvl_mtx;
+ kcondvar_t dvl_cv;
+};
+
+#define DEVICE_SUSPENSORS_MAX 16
+
struct device {
devhandle_t dv_handle; /* this device's handle;
new device_t's get INVALID */
@@ -180,4 +190,36 @@
#define DVF_BUS_SUSPENDED 0x0020 /* device bus suspend was called */
#define DVF_ATTACH_INPROGRESS 0x0040 /* device attach is in progress */
+bool device_pmf_is_registered(device_t);
+bool device_pmf_is_registered(device_t);
+
+bool device_pmf_driver_suspend(device_t, const pmf_qual_t *);
+bool device_pmf_driver_resume(device_t, const pmf_qual_t *);
+bool device_pmf_driver_shutdown(device_t, int);
+
+void device_pmf_driver_register(device_t,
+ bool (*)(device_t, const pmf_qual_t *),
+ bool (*)(device_t, const pmf_qual_t *),
+ bool (*)(device_t, int));
+void device_pmf_driver_deregister(device_t);
+
+device_lock_t device_getlock(device_t);
+void device_pmf_unlock(device_t);
+bool device_pmf_lock(device_t);
+
+bool device_is_self_suspended(device_t);
+void device_pmf_self_suspend(device_t, const pmf_qual_t *);
+void device_pmf_self_resume(device_t, const pmf_qual_t *);
+bool device_pmf_self_wait(device_t, const pmf_qual_t *);
+
+void *device_pmf_class_private(device_t);
+bool device_pmf_class_suspend(device_t, const pmf_qual_t *);
+bool device_pmf_class_resume(device_t, const pmf_qual_t *);
+
+void device_pmf_class_register(device_t, void *,
+ bool (*)(device_t, const pmf_qual_t *),
+ bool (*)(device_t, const pmf_qual_t *),
+ void (*)(device_t));
+void device_pmf_class_deregister(device_t);
+
#endif /* _SYS_DEVICE_IMPL_H_ */
Home |
Main Index |
Thread Index |
Old Index