diff options
author | 2016-08-23 21:30:18 +0000 | |
---|---|---|
committer | 2016-08-23 21:30:18 +0000 | |
commit | 51fc57a50c19674b86510ceffd4c2d18a8cc0817 (patch) | |
tree | 88358af0beb58013a7c5be620e3eb6bae48b4401 | |
parent | Some syslogd tests failed to report errors. Make these tests more (diff) | |
download | wireguard-openbsd-51fc57a50c19674b86510ceffd4c2d18a8cc0817.tar.xz wireguard-openbsd-51fc57a50c19674b86510ceffd4c2d18a8cc0817.zip |
Add functions to assert/deassert all reset signals for a device.
-rw-r--r-- | sys/dev/ofw/ofw_clock.c | 14 | ||||
-rw-r--r-- | sys/dev/ofw/ofw_clock.h | 16 |
2 files changed, 28 insertions, 2 deletions
diff --git a/sys/dev/ofw/ofw_clock.c b/sys/dev/ofw/ofw_clock.c index 34ed1342609..ad81356e115 100644 --- a/sys/dev/ofw/ofw_clock.c +++ b/sys/dev/ofw/ofw_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_clock.c,v 1.5 2016/08/22 22:06:59 kettenis Exp $ */ +/* $OpenBSD: ofw_clock.c,v 1.6 2016/08/23 21:30:18 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -416,12 +416,24 @@ reset_do_assert(int node, const char *name, int assert) } void +reset_assert_idx(int node, int idx) +{ + reset_do_assert_idx(node, idx, 1); +} + +void reset_assert(int node, const char *name) { reset_do_assert(node, name, 1); } void +reset_deassert_idx(int node, int idx) +{ + reset_do_assert_idx(node, idx, 0); +} + +void reset_deassert(int node, const char *name) { reset_do_assert(node, name, 0); diff --git a/sys/dev/ofw/ofw_clock.h b/sys/dev/ofw/ofw_clock.h index 3e56a8ceefb..10848422096 100644 --- a/sys/dev/ofw/ofw_clock.h +++ b/sys/dev/ofw/ofw_clock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_clock.h,v 1.4 2016/08/22 19:28:27 kettenis Exp $ */ +/* $OpenBSD: ofw_clock.h,v 1.5 2016/08/23 21:30:18 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -65,6 +65,20 @@ struct reset_device { void reset_register(struct reset_device *); void reset_assert(int, const char *); +void reset_assert_idx(int, int); void reset_deassert(int, const char *); +void reset_deassert_idx(int, int); + +static inline void +reset_assert_all(int node) +{ + reset_assert_idx(node, -1); +} + +static inline void +reset_deassert_all(int node) +{ + reset_deassert_idx(node, -1); +} #endif /* _DEV_OFW_CLOCK_H_ */ |