diff options
author | Anton Kling <anton@kling.gg> | 2024-03-14 13:09:59 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-03-14 13:09:59 +0100 |
commit | 2e8b474d4219e7faaac3823e73c8d528c2698a37 (patch) | |
tree | 7d93b5fd220e8b703ba69f9b55122d15c9d619fb /kernel/lib/list.c | |
parent | 051ac9f1941e8bc6ad87beccb61a2d53111ba8ea (diff) |
random changes made
Diffstat (limited to 'kernel/lib/list.c')
-rw-r--r-- | kernel/lib/list.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/lib/list.c b/kernel/lib/list.c index 12104d8..9cdcd01 100644 --- a/kernel/lib/list.c +++ b/kernel/lib/list.c @@ -16,13 +16,16 @@ void list_reset(struct list *list) { list->tail_index = -1; } -int list_add(struct list *list, void *entry) { +int list_add(struct list *list, void *entry, int *index) { if (list->tail_index > 100 - 1) { kprintf("Error: list has run out of space\n"); assert(0); } list->tail_index++; list->entries[list->tail_index] = entry; + if(index) { + *index = list->tail_index; + } return 1; } |