Use runtime options instead of conditional compilation for MLFQS,
[pintos-anon] / src / threads / init.h
index 1d6c5c6fdd2d88bdaf765e672f8924687d42f32a..45e9545f0a190261d1687c99ab6f142285bc00d1 100644 (file)
@@ -1,11 +1,32 @@
-#ifndef HEADER_INIT_H
-#define HEADER_INIT_H 1
+#ifndef THREADS_INIT_H
+#define THREADS_INIT_H
 
+#include <debug.h>
+#include <stdbool.h>
 #include <stddef.h>
+#include <stdint.h>
 
 /* Physical memory size, in 4 kB pages. */
-size_t ram_pages;
+extern size_t ram_pages;
 
-struct tss *tss;
+/* Page directory with kernel mappings only. */
+extern uint32_t *base_page_dir;
 
-#endif /* init.h */
+/* -o mlfqs:
+   If false (default), use round-robin scheduler.
+   If true, use multi-level feedback queue scheduler. */
+extern bool enable_mlfqs;
+
+#ifdef VM
+/* -o random-paging:
+   If false (default), use LRU page replacement policy.
+   If true, use random page replacement policy. */
+extern bool enable_random_paging;
+#endif
+
+/* -q: Power off when kernel tasks complete? */
+extern bool power_off_when_done;
+
+void power_off (void) NO_RETURN;
+
+#endif /* threads/init.h */