Clean up threads.c.
[pintos-anon] / src / threads / init.c
index caacaee20e894b6c0afbedb960540e030a946772..03e0bb8bec1c1bfb7405f4ebef11c8af7a2ac369 100644 (file)
@@ -28,7 +28,6 @@ size_t ram_pages;
 static void ram_init (void);
 static void gdt_init (void);
 static void argv_init (void);
-void power_off (void);
 
 static void
 main_thread (void *aux UNUSED) 
@@ -66,8 +65,7 @@ main (void)
   kbd_init ();
 
   /* Do everything else in a system thread. */
-  thread_init ();
-  thread_start (thread_create ("main", main_thread, NULL));
+  thread_init ("main", main_thread, NULL);
 }
 
 static uint64_t
@@ -113,7 +111,7 @@ make_tss_desc (void *vaddr)
                         0x67, SYS_SYSTEM, TYPE_TSS_32_A, 0, GRAN_BYTE);
 }
 
-uint64_t gdt[SEL_CNT];
+static uint64_t gdt[SEL_CNT];
 
 struct tss *tss;
 
@@ -183,15 +181,3 @@ argv_init (void)
     }
   argv[argc] = NULL;
 }
-\f
-void
-power_off (void) 
-{
-  const char s[] = "Shutdown";
-  const char *p;
-
-  printk ("Powering off...\n");
-  for (p = s; *p != '\0'; p++)
-    outb (0x8900, *p);
-  for (;;);
-}