Cleanup - it's no longer necessary to manually reset global variables.

Now that a soft-reboot forces a hard-reboot, it is no longer necessary
to manually reset global variables.
diff --git a/src/block.c b/src/block.c
index b6b1902..3f4b13f 100644
--- a/src/block.c
+++ b/src/block.c
@@ -329,14 +329,3 @@
 
     return stack_hop((u32)op, GET_SEG(SS), __send_disk_op);
 }
-
-
-/****************************************************************
- * Setup
- ****************************************************************/
-
-void
-drive_setup(void)
-{
-    memset(&Drives, 0, sizeof(Drives));
-}
diff --git a/src/cdrom.c b/src/cdrom.c
index 655ee00..349e401 100644
--- a/src/cdrom.c
+++ b/src/cdrom.c
@@ -109,8 +109,6 @@
 {
     if (!CONFIG_CDROM_EMU)
         return;
-    cdemu_drive_gf = NULL;
-    cdemu_buf_fl = NULL;
     if (!Drives.cdcount)
         return;
 
diff --git a/src/clock.c b/src/clock.c
index f6a43e9..fcdc698 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -211,7 +211,6 @@
     u32 ticks = (hours * 60 + minutes) * 60 + seconds;
     ticks = ((u64)ticks * PIT_TICK_RATE) / PIT_TICK_INTERVAL;
     SET_BDA(timer_counter, ticks);
-    SET_BDA(timer_rollover, 0);
 
     enable_hwirq(0, FUNC16(entry_08));
     enable_hwirq(8, FUNC16(entry_70));
diff --git a/src/coreboot.c b/src/coreboot.c
index db0063b..50d300c 100644
--- a/src/coreboot.c
+++ b/src/coreboot.c
@@ -126,8 +126,6 @@
 {
     dprintf(3, "Attempting to find coreboot table\n");
 
-    CBMemTable = NULL;
-
     // Find coreboot table.
     struct cb_header *cbh = find_cb_header(0, 0x1000);
     if (!cbh)
@@ -290,10 +288,6 @@
 
     dprintf(3, "Relocating coreboot bios tables\n");
 
-    // Init variables set in coreboot table memory scan.
-    PirOffset = 0;
-    RsdpAddr = 0;
-
     // Scan CB_MEM_TABLE areas for bios tables.
     int i, count = MEM_RANGE_COUNT(cbm);
     for (i=0; i<count; i++) {
diff --git a/src/disk.h b/src/disk.h
index 9e5b083..55a5da3 100644
--- a/src/disk.h
+++ b/src/disk.h
@@ -234,7 +234,6 @@
 void map_cd_drive(struct drive_s *drive_g);
 int process_op(struct disk_op_s *op);
 int send_disk_op(struct disk_op_s *op);
-void drive_setup(void);
 
 // floppy.c
 extern struct floppy_ext_dbt_s diskette_param_table2;
diff --git a/src/memmap.c b/src/memmap.c
index 84bc4fa..ea05953 100644
--- a/src/memmap.c
+++ b/src/memmap.c
@@ -119,13 +119,6 @@
     //dump_map();
 }
 
-// Prep for memmap stuff - init bios table locations.
-void
-memmap_setup(void)
-{
-    e820_count = 0;
-}
-
 // Report on final memory locations.
 void
 memmap_finalize(void)
diff --git a/src/memmap.h b/src/memmap.h
index d4154c1..01c7ddb 100644
--- a/src/memmap.h
+++ b/src/memmap.h
@@ -17,7 +17,6 @@
 };
 
 void add_e820(u64 start, u64 size, u32 type);
-void memmap_setup(void);
 void memmap_finalize(void);
 
 // A typical OS page size
diff --git a/src/optionroms.c b/src/optionroms.c
index ceb4060..854c33f 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -72,7 +72,7 @@
 #define PCIROM_CODETYPE_X86 0
 
 // The end of the last deployed rom.
-u32 RomEnd;
+u32 RomEnd = BUILD_ROM_START;
 
 
 /****************************************************************
@@ -423,9 +423,6 @@
 void
 vga_setup(void)
 {
-    VGAbdf = -1;
-    RomEnd = BUILD_ROM_START;
-
     if (! CONFIG_OPTIONROMS)
         return;
 
diff --git a/src/pmm.c b/src/pmm.c
index bb90ff0..e0770ac 100644
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -193,12 +193,6 @@
     ASSERT32FLAT();
     dprintf(3, "malloc setup\n");
 
-    ZoneLow.info = ZoneHigh.info = ZoneFSeg.info = NULL;
-    ZoneTmpLow.info = ZoneTmpHigh.info = NULL;
-
-    // Clear memory in 0xf0000 area.
-    memset(BiosTableSpace, 0, CONFIG_MAX_BIOSTABLE);
-
     // Populate temp high ram
     u32 highram = 0;
     int i;
diff --git a/src/post.c b/src/post.c
index a72b8cd..1e35142 100644
--- a/src/post.c
+++ b/src/post.c
@@ -205,13 +205,11 @@
     init_bda();
 
     // Init base pc hardware.
-    thread_setup();
     pic_setup();
     timer_setup();
     mathcp_setup();
 
     // Initialize mtrr
-    smp_probe_setup();
     mtrr_setup();
 
     // Initialize pci
@@ -220,7 +218,6 @@
 
     // Initialize internal tables
     boot_setup();
-    drive_setup();
 
     // Start hardware initialization (if optionrom threading)
     if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS)
@@ -327,7 +324,6 @@
 post(void)
 {
     // Detect ram and setup internal malloc.
-    memmap_setup();
     qemu_cfg_port_probe();
     ram_probe();
     malloc_setup();
diff --git a/src/smp.c b/src/smp.c
index 38e117e..40f5451 100644
--- a/src/smp.c
+++ b/src/smp.c
@@ -127,11 +127,3 @@
     dprintf(1, "Found %d cpu(s) max supported %d cpu(s)\n", readl(&CountCPUs),
         MaxCountCPUs);
 }
-
-// Reset variables to zero
-void
-smp_probe_setup(void)
-{
-    CountCPUs = 0;
-    smp_mtrr_count = 0;
-}
diff --git a/src/stacks.c b/src/stacks.c
index dade3af..14f6f8a 100644
--- a/src/stacks.c
+++ b/src/stacks.c
@@ -15,7 +15,9 @@
     void *stackpos;
     struct thread_info **pprev;
 };
-struct thread_info VAR16VISIBLE MainThread;
+struct thread_info VAR32FLATVISIBLE MainThread = {
+    &MainThread, NULL, &MainThread.next
+};
 
 
 /****************************************************************
@@ -190,15 +192,6 @@
 #define THREADSTACKSIZE 4096
 int VAR16VISIBLE CanPreempt;
 
-void
-thread_setup(void)
-{
-    MainThread.next = &MainThread;
-    MainThread.pprev = &MainThread.next;
-    MainThread.stackpos = NULL;
-    CanPreempt = 0;
-}
-
 // Return the 'struct thread_info' for the currently running thread.
 struct thread_info *
 getCurThread(void)
@@ -397,7 +390,7 @@
 {
     if (! CONFIG_THREADS || ! CONFIG_THREAD_OPTIONROMS
         || !GET_GLOBAL(CanPreempt)
-        || GET_GLOBAL(MainThread.next) == &MainThread)
+        || GET_FLATPTR(MainThread.next) == &MainThread)
         return;
 
     call32(yield_preempt);
diff --git a/src/usb-hid.c b/src/usb-hid.c
index b88d684..168b7fa 100644
--- a/src/usb-hid.c
+++ b/src/usb-hid.c
@@ -130,15 +130,6 @@
     return -1;
 }
 
-void
-usb_hid_setup(void)
-{
-    if (CONFIG_USB_KEYBOARD)
-        keyboard_pipe = NULL;
-    if (CONFIG_USB_MOUSE)
-        mouse_pipe = NULL;
-}
-
 
 /****************************************************************
  * Keyboard events
diff --git a/src/usb-hid.h b/src/usb-hid.h
index d8199b9..7fbcf4b 100644
--- a/src/usb-hid.h
+++ b/src/usb-hid.h
@@ -6,7 +6,6 @@
 struct usb_pipe;
 int usb_hid_init(struct usb_pipe *pipe
                  , struct usb_interface_descriptor *iface, int imax);
-void usb_hid_setup(void);
 inline int usb_kbd_active(void);
 inline int usb_kbd_command(int command, u8 *param);
 inline int usb_mouse_active(void);
diff --git a/src/usb.c b/src/usb.c
index cefc5f3..aa8d72c 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -423,8 +423,6 @@
 
     dprintf(3, "init usb\n");
 
-    usb_hid_setup();
-
     // Look for USB controllers
     int ehcibdf = -1;
     int count = 0;
diff --git a/src/util.h b/src/util.h
index c27037a..5cc9f17 100644
--- a/src/util.h
+++ b/src/util.h
@@ -213,7 +213,6 @@
 // stacks.c
 inline u32 stack_hop(u32 eax, u32 edx, void *func);
 extern struct thread_info MainThread;
-void thread_setup(void);
 struct thread_info *getCurThread(void);
 void yield(void);
 void wait_irq(void);
@@ -358,7 +357,6 @@
 extern u32 MaxCountCPUs;
 void wrmsr_smp(u32 index, u64 val);
 void smp_probe(void);
-void smp_probe_setup(void);
 
 // coreboot.c
 struct cbfs_file;
diff --git a/src/vgahooks.c b/src/vgahooks.c
index 14678be..eb4dfa8 100644
--- a/src/vgahooks.c
+++ b/src/vgahooks.c
@@ -13,7 +13,7 @@
 #include "config.h" // CONFIG_*
 
 // The Bus/Dev/Fn of the primary VGA device.
-int VGAbdf VAR16VISIBLE;
+int VGAbdf VAR16VISIBLE = -1;
 // Coreboot board detected.
 int CBmainboard VAR16VISIBLE;
 
@@ -305,11 +305,10 @@
     if (! CONFIG_VGAHOOKS)
         return;
 
-    CBmainboard = 0;
     for (i=0; i<(sizeof(mainboard_list) / sizeof(mainboard_list[0])); i++) {
         if (!strcmp(vendor, mainboard_list[i].vendor) &&
             !strcmp(part, mainboard_list[i].device)) {
-            printf("Found mainboard %s %s\n", vendor, part); 
+            printf("Found mainboard %s %s\n", vendor, part);
             CBmainboard = mainboard_list[i].type;
             break;
         }