28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

79<br />

void rumpuser_mutex_init(struct rumpuser_mtx **);<br />

void rumpuser_mutex_init_kmutex(struct rumpuser_mtx **);<br />

void rumpuser_mutex_enter(struct rumpuser_mtx *);<br />

int rumpuser_mutex_tryenter(struct rumpuser_mtx *);<br />

void rumpuser_mutex_exit(struct rumpuser_mtx *);<br />

void rumpuser_mutex_destroy(struct rumpuser_mtx *);<br />

struct lwp *rumpuser_mutex_owner(struct rumpuser_mtx *);<br />

void rumpuser_rw_init(struct rumpuser_rw **);<br />

void rumpuser_rw_enter(struct rumpuser_rw *, int);<br />

int rumpuser_rw_tryenter(struct rumpuser_rw *, int);<br />

void rumpuser_rw_exit(struct rumpuser_rw *);<br />

void rumpuser_rw_destroy(struct rumpuser_rw *);<br />

int rumpuser_rw_held(struct rumpuser_rw *);<br />

int rumpuser_rw_rdheld(struct rumpuser_rw *);<br />

int rumpuser_rw_wrheld(struct rumpuser_rw *);<br />

void rumpuser_cv_init(struct rumpuser_cv **);<br />

void rumpuser_cv_destroy(struct rumpuser_cv *);<br />

void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *);<br />

int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *,<br />

int64_t, int64_t);<br />

void rumpuser_cv_signal(struct rumpuser_cv *);<br />

void rumpuser_cv_broadcast(struct rumpuser_cv *);<br />

int rumpuser_cv_has_waiters(struct rumpuser_cv *);<br />

Figure 3.3: Hypercall locking interfaces. <strong>The</strong>se interfaces use opaque lock data<br />

types to map NetBSD kernel locking operations to hypervisor operations.<br />

Strictly speaking, <strong>the</strong> necessity <strong>of</strong> thread support <strong>and</strong> locking depends on <strong>the</strong> drivers<br />

being executed. We <strong>of</strong>fer <strong>the</strong> following anecdote <strong>and</strong> discussion. At one point when<br />

working on rump kernel support, support for gdb in NetBSD was broken so that<br />

threaded programs could not be single-stepped (<strong>the</strong> problem has since been fixed).<br />

As a way to work around <strong>the</strong> problem, <strong>the</strong> variable RUMP_THREADS was created. If it<br />

is set to 0, <strong>the</strong> rump kernel silently ignores kernel thread creation requests. Despite<br />

<strong>the</strong> lack <strong>of</strong> threads, for example file system drivers still function, because <strong>the</strong>y do<br />

not directly depend on worker threads. <strong>The</strong> ability to run without threads allowed<br />

attaching <strong>the</strong> broken debugger to rump kernels <strong>and</strong> single-stepping <strong>the</strong>m.

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

Saved successfully!

Ooh no, something went wrong!