12.07.2015 Views

1lfCtJ9

1lfCtJ9

1lfCtJ9

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

79void rumpuser_mutex_init(struct rumpuser_mtx **);void rumpuser_mutex_init_kmutex(struct rumpuser_mtx **);void rumpuser_mutex_enter(struct rumpuser_mtx *);int rumpuser_mutex_tryenter(struct rumpuser_mtx *);void rumpuser_mutex_exit(struct rumpuser_mtx *);void rumpuser_mutex_destroy(struct rumpuser_mtx *);struct lwp *rumpuser_mutex_owner(struct rumpuser_mtx *);void rumpuser_rw_init(struct rumpuser_rw **);void rumpuser_rw_enter(struct rumpuser_rw *, int);int rumpuser_rw_tryenter(struct rumpuser_rw *, int);void rumpuser_rw_exit(struct rumpuser_rw *);void rumpuser_rw_destroy(struct rumpuser_rw *);int rumpuser_rw_held(struct rumpuser_rw *);int rumpuser_rw_rdheld(struct rumpuser_rw *);int rumpuser_rw_wrheld(struct rumpuser_rw *);void rumpuser_cv_init(struct rumpuser_cv **);void rumpuser_cv_destroy(struct rumpuser_cv *);void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *);int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *,int64_t, int64_t);void rumpuser_cv_signal(struct rumpuser_cv *);void rumpuser_cv_broadcast(struct rumpuser_cv *);int rumpuser_cv_has_waiters(struct rumpuser_cv *);Figure 3.3: Hypercall locking interfaces. These interfaces use opaque lock datatypes to map NetBSD kernel locking operations to hypervisor operations.Strictly speaking, the necessity of thread support and locking depends on the driversbeing executed. We offer the following anecdote and discussion. At one point whenworking on rump kernel support, support for gdb in NetBSD was broken so thatthreaded programs could not be single-stepped (the problem has since been fixed).As a way to work around the problem, the variable RUMP_THREADS was created. If itis set to 0, the rump kernel silently ignores kernel thread creation requests. Despitethe lack of threads, for example file system drivers still function, because they donot directly depend on worker threads. The ability to run without threads allowedattaching the broken debugger to rump kernels and single-stepping them.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!