diff --git a/subject/main.c b/subject/main.c index b5081c9..42263f5 100644 --- a/subject/main.c +++ b/subject/main.c @@ -13,7 +13,7 @@ struct task_struct global = { .pid = 42, .comm = "main_global", .arrfun = { { .a = 9, .b = 10, .c = 11, .d = 12.0 }, { .a = 13, .b = 14, .c = 15, .d = 16.0 }, { .a = 17, .b = 18, .c = 19, .d = 20.0 } -} }; +}, .tasks = LIST_HEAD_SELF(global.tasks) }; static void print_layout() { // TODO -> Make builtin __spslr_initial_offsetof(type, field) that is not patched diff --git a/subject/task_struct.h b/subject/task_struct.h index 0af3bc6..98b84c3 100644 --- a/subject/task_struct.h +++ b/subject/task_struct.h @@ -43,6 +43,8 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head) #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) +#define LIST_HEAD_SELF(name) { .next = &(name), .prev = &(name)} + struct ArrayFun { int a, b, c; double d;