From 51ccc7e3a0c692e93cfe78a74ce9d7b6bdc08623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4r?= Date: Wed, 6 Apr 2022 11:31:31 +0200 Subject: [PATCH] Enable SELF_PAGING_WORKS --- lib/aos/threads.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/aos/threads.c b/lib/aos/threads.c index 59f5a93..75199b9 100644 --- a/lib/aos/threads.c +++ b/lib/aos/threads.c @@ -35,8 +35,8 @@ # include "arch/ldt.h" #endif -// TODO (M4): define this once your self-paging implementation works... -// #define SELF_PAGING_WORKS +// (M4): define this once your self-paging implementation works... +#define SELF_PAGING_WORKS /// Maximum number of threads in a domain, used to size VM region for thread structures // there is no point having MAX_THREADS > LDT_NENTRIES on x86 (see ldt.c) @@ -204,9 +204,9 @@ void thread_remove_from_queue(struct thread **queue, struct thread *thread) #ifdef SELF_PAGING_WORKS static errval_t refill_thread_slabs(struct slab_allocator *slabs) { - // TODO(M4): + // (M4): // - implement me! - return LIB_ERR_NOT_IMPLEMENTED; + return slab_default_refill(slabs); } #endif @@ -1110,10 +1110,6 @@ static int bootstrap_thread(struct spawn_domain_params *params) // Until we have self-paging, we cannot use the paging-region based thread // control block slab allocator, so just run main thread directly #ifndef SELF_PAGING_WORKS - // TODO rueegges: remove this when SELF_PAGING_WORKS. - // this is required to create threads for testing before we have self paging - size_t blocksize = sizeof(struct thread) + tls_block_total_len + THREAD_ALIGNMENT; - slab_init(&thread_slabs, blocksize, slab_default_refill); // we aren't prepared to run real threads yet main_thread(params); #else