Enable SELF_PAGING_WORKS

This commit is contained in:
Jan Schär 2022-04-06 11:31:31 +02:00
parent 8e56ac9244
commit 51ccc7e3a0

View File

@ -35,8 +35,8 @@
# include "arch/ldt.h" # include "arch/ldt.h"
#endif #endif
// TODO (M4): define this once your self-paging implementation works... // (M4): define this once your self-paging implementation works...
// #define SELF_PAGING_WORKS #define SELF_PAGING_WORKS
/// Maximum number of threads in a domain, used to size VM region for thread structures /// 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) // 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 #ifdef SELF_PAGING_WORKS
static errval_t refill_thread_slabs(struct slab_allocator *slabs) static errval_t refill_thread_slabs(struct slab_allocator *slabs)
{ {
// TODO(M4): // (M4):
// - implement me! // - implement me!
return LIB_ERR_NOT_IMPLEMENTED; return slab_default_refill(slabs);
} }
#endif #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 // Until we have self-paging, we cannot use the paging-region based thread
// control block slab allocator, so just run main thread directly // control block slab allocator, so just run main thread directly
#ifndef SELF_PAGING_WORKS #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 // we aren't prepared to run real threads yet
main_thread(params); main_thread(params);
#else #else