From 293ce4460ffe2669c4d5b04d6b7d877b1bff6d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 24 Dec 2013 06:21:13 +0100 Subject: [PATCH] Add accessor function to the uclock of an IOMux --- include/ucore/iomux.h | 6 +++++- src/iomux_impl.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/ucore/iomux.h b/include/ucore/iomux.h index 2cef14c..1d60fe0 100644 --- a/include/ucore/iomux.h +++ b/include/ucore/iomux.h @@ -110,7 +110,11 @@ int iomux_unregister_fd(struct IOMux *mux, struct IOMuxFD *fd); */ int iomux_update_events(struct IOMux *mux, struct IOMuxFD *fd); - +/** Retreive the UCoreClock associated with the IOMux. + * Either a suitable internal clock is provided, or the + * same clock as created by iomux_create_ex. + */ +struct UCoreClock *iomux_get_clock(struct IOMux *mux); /** * Convenience macro for setting the new event */ diff --git a/src/iomux_impl.c b/src/iomux_impl.c index 653a839..421fd91 100644 --- a/src/iomux_impl.c +++ b/src/iomux_impl.c @@ -139,6 +139,11 @@ int iomux_update_events(struct IOMux *mux, struct IOMuxFD *fd) return mux->update_events_impl(mux, fd); } +struct UCoreClock *iomux_get_clock(struct IOMux *mux) +{ + return mux->uclock; +} + struct UCTimers *iomux_get_timers(struct IOMux *mux) { return &mux->timers;