summaryrefslogtreecommitdiff
path: root/kern/task.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-01 02:15:05 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-01 16:38:08 +0100
commitdf47f83ed98e4ce356af8d34de05b549f4f9c912 (patch)
tree45165e5a32c145c24cef230da20cf54c4997344f /kern/task.h
parentfe7cd805567e1f4d1ed92d87b216e2dc78249892 (diff)
kern: add a name field to struct task
* kern/task.c (task_create): Initialize name with the address of the task. * kern/task.h (TASK_NAME_SIZE): New definition. (struct task): Add field name.
Diffstat (limited to 'kern/task.h')
-rw-r--r--kern/task.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/task.h b/kern/task.h
index e8520331..7ae10cde 100644
--- a/kern/task.h
+++ b/kern/task.h
@@ -48,6 +48,13 @@
#include <vm/vm_types.h>
#include <machine/task.h>
+/*
+ * Task name buffer size. The size is chosen so that struct task fits
+ * into three cache lines. The size of a cache line on a typical CPU
+ * is 64 bytes.
+ */
+#define TASK_NAME_SIZE 32
+
struct task {
/* Synchronization/destruction information */
decl_simple_lock_data(,lock) /* Task's lock */
@@ -113,6 +120,8 @@ struct task {
natural_t cow_faults; /* copy-on-write faults counter */
natural_t messages_sent; /* messages sent counter */
natural_t messages_received; /* messages received counter */
+
+ char name[TASK_NAME_SIZE];
};
#define task_lock(task) simple_lock(&(task)->lock)