fix: extract supplemental and shared_files initialisation
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#else
|
||||
#include "tests/threads/tests.h"
|
||||
#endif
|
||||
#include "vm/page.h"
|
||||
#ifdef VM
|
||||
#include "vm/frame.h"
|
||||
#include "devices/swap.h"
|
||||
@@ -121,6 +122,7 @@ main (void)
|
||||
exception_init ();
|
||||
syscall_init ();
|
||||
#endif
|
||||
shared_files_init ();
|
||||
|
||||
/* Start thread scheduler and enable interrupts. */
|
||||
thread_start ();
|
||||
|
||||
@@ -134,10 +134,6 @@ thread_start (void)
|
||||
t))
|
||||
PANIC ("Failed to initialise child results table for main thread.");
|
||||
|
||||
/* Initialise the shared files table and lock. */
|
||||
if (!hash_init (&shared_files, shared_file_hash, shared_file_less, NULL))
|
||||
PANIC ("Failed to initialise shared pages table.");
|
||||
|
||||
lock_init (&shared_files_lock);
|
||||
|
||||
/* Create the idle thread. */
|
||||
@@ -272,7 +268,7 @@ thread_create (const char *name, int priority,
|
||||
if (!hash_init (&t->open_files, fd_hash, fd_less, NULL)
|
||||
|| !hash_init (&t->child_results, process_result_hash,
|
||||
process_result_less, t)
|
||||
|| !hash_init (&t->pages, page_hash, page_less, NULL))
|
||||
|| !init_pages (t))
|
||||
{
|
||||
palloc_free_page (t);
|
||||
free (t->result);
|
||||
|
||||
Reference in New Issue
Block a user