Implement generalied IOMux implementation operations
Fix serious bug in iomix_timers_run
This commit is contained in:
+21
-15
@@ -4,21 +4,7 @@
|
||||
#include "ucore/iomux.h"
|
||||
#include "ucore/timers.h"
|
||||
/** struct for IOMux implementations */
|
||||
struct IOMux {
|
||||
|
||||
/* TImer instance */
|
||||
struct UCTimers timers;
|
||||
|
||||
/**
|
||||
* Clock used for driving timers, and
|
||||
* providing timeouts for the mux
|
||||
*/
|
||||
struct UCoreClock *uclock;
|
||||
|
||||
|
||||
/* Used by mux implementations to hold their own data/instance */
|
||||
void *instance;
|
||||
|
||||
struct IOMuxOps {
|
||||
/** Run one iteration of the mux.
|
||||
* The mux implementation must honor the timeout, if given.
|
||||
* The mux implementation must call iomux_timers_run after the
|
||||
@@ -39,6 +25,26 @@ struct IOMux {
|
||||
int (*unregister_fd_impl)(struct IOMux *mux, struct IOMuxFD *fd);
|
||||
/** Update an IOMuxFD (due to its events ('what') has changed*/
|
||||
int (*update_events_impl)(struct IOMux *mux, struct IOMuxFD *fd);
|
||||
|
||||
};
|
||||
struct IOMux {
|
||||
|
||||
/* TImer instance */
|
||||
struct UCTimers timers;
|
||||
|
||||
/**
|
||||
* Clock used for driving timers, and
|
||||
* providing timeouts for the mux
|
||||
*/
|
||||
struct UCoreClock *uclock;
|
||||
|
||||
struct IOMuxOps ops;
|
||||
|
||||
|
||||
/* Used by mux implementations to hold their own data/instance */
|
||||
void *instance;
|
||||
|
||||
|
||||
};
|
||||
|
||||
int iomux_select_init(struct IOMux *mux);
|
||||
|
||||
Reference in New Issue
Block a user