Index: kernel/generic/include/proc/thread.h
===================================================================
--- kernel/generic/include/proc/thread.h	(revision 4e5dabf872f498631fc35dbcf67ea7d2141df88f)
+++ kernel/generic/include/proc/thread.h	(revision f22dc820d451196741e3abde84f77dc25fc53fc1)
@@ -54,21 +54,13 @@
 
 /* Thread flags */
-
-/** Thread cannot be migrated to another CPU.
- *
- * When using this flag, the caller must set cpu in the thread_t
- * structure manually before calling thread_ready (even on uniprocessor).
- *
- */
-#define THREAD_FLAG_WIRED  (1 << 0)
-
-/** Thread was migrated to another CPU and has not run yet. */
-#define THREAD_FLAG_STOLEN  (1 << 1)
-
-/** Thread executes in userspace. */
-#define THREAD_FLAG_USPACE  (1 << 2)
-
-/** Thread will be attached by the caller. */
-#define THREAD_FLAG_NOATTACH  (1 << 3)
+typedef enum {
+	THREAD_FLAG_NONE = 0,
+	/** Thread executes in user space. */
+	THREAD_FLAG_USPACE = (1 << 0),
+	/** Thread will be attached by the caller. */
+	THREAD_FLAG_NOATTACH = (1 << 1),
+	/** Thread accounting doesn't affect accumulated task accounting. */
+	THREAD_FLAG_UNCOUNTED = (1 << 2)
+} thread_flags_t;
 
 /** Thread structure. There is one per thread. */
@@ -147,5 +139,5 @@
 	
 	fpu_context_t *saved_fpu_context;
-	int fpu_context_exists;
+	bool fpu_context_exists;
 	
 	/*
@@ -154,18 +146,22 @@
 	 * thread. This disables migration.
 	 */
-	int fpu_context_engaged;
+	bool fpu_context_engaged;
 	
 	/* The thread will not be migrated if nomigrate is non-zero. */
-	int nomigrate;
-	
-	/** Thread's state. */
+	unsigned int nomigrate;
+	
+	/** Thread state. */
 	state_t state;
-	/** Thread's flags. */
-	unsigned int flags;
-	
-	/** Thread's CPU. */
+	
+	/** Thread CPU. */
 	cpu_t *cpu;
 	/** Containing task. */
 	task_t *task;
+	/** Thread is wired to CPU. */
+	bool wired;
+	/** Thread was migrated to another CPU and has not run yet. */
+	bool stolen;
+	/** Thread is executed in user space. */
+	bool uspace;
 	
 	/** Ticks before preemption. */
@@ -216,5 +212,6 @@
 extern void thread_init(void);
 extern thread_t *thread_create(void (*)(void *), void *, task_t *,
-    unsigned int, const char *, bool);
+    thread_flags_t, const char *);
+extern void thread_wire(thread_t *, cpu_t *);
 extern void thread_attach(thread_t *, task_t *);
 extern void thread_ready(thread_t *);
