#define GENBUF_SZ 128 /* plan9 uses this as a scratch space, per syscall */
#define KTH_IS_KTASK (1 << 0)
+#define KTH_SAVE_ADDR_SPACE (1 << 1)
+#define KTH_KTASK_FLAGS (KTH_IS_KTASK)
+#define KTH_DEFAULT_FLAGS (KTH_SAVE_ADDR_SPACE)
/* This captures the essence of a kernel context that we want to suspend. When
* a kthread is running, we make sure its stacktop is the default kernel stack,
char *name;
char generic_buf[GENBUF_SZ];
struct systrace_record *trace;
+ struct systrace_record *strace;
};
/* Semaphore for kthreads to sleep on. 0 or less means you need to sleep */
void dereg_abortable_cv(struct cv_lookup_elm *cle);
bool should_abort(struct cv_lookup_elm *cle);
+uintptr_t switch_to_ktask(void);
+void switch_back_from_ktask(uintptr_t old_ret);
+
/* qlocks are plan9's binary sempahore, which are wrappers around our sems.
* Not sure if they'll need irqsave or normal sems. */
typedef struct semaphore qlock_t;