diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-09-25 14:53:15 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-09-25 14:53:15 -0400 |
commit | 4d96edc76ba1e7556700908c10cb0e257cce5573 (patch) | |
tree | a617f3410df24b01c0bf10d12c0d076fcc85e45c | |
parent | a899945754d20f084bb73a1cd2453f8cabfeb0e8 (diff) | |
download | seabios-4d96edc76ba1e7556700908c10cb0e257cce5573.tar.gz |
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.
-rw-r--r-- | src/block.c | 11 | ||||
-rw-r--r-- | src/cdrom.c | 2 | ||||
-rw-r--r-- | src/clock.c | 1 | ||||
-rw-r--r-- | src/coreboot.c | 6 | ||||
-rw-r--r-- | src/disk.h | 1 | ||||
-rw-r--r-- | src/memmap.c | 7 | ||||
-rw-r--r-- | src/memmap.h | 1 | ||||
-rw-r--r-- | src/optionroms.c | 5 | ||||
-rw-r--r-- | src/pmm.c | 6 | ||||
-rw-r--r-- | src/post.c | 4 | ||||
-rw-r--r-- | src/smp.c | 8 | ||||
-rw-r--r-- | src/stacks.c | 15 | ||||
-rw-r--r-- | src/usb-hid.c | 9 | ||||
-rw-r--r-- | src/usb-hid.h | 1 | ||||
-rw-r--r-- | src/usb.c | 2 | ||||
-rw-r--r-- | src/util.h | 2 | ||||
-rw-r--r-- | src/vgahooks.c | 5 |
17 files changed, 7 insertions, 79 deletions
diff --git a/src/block.c b/src/block.c index b6b19026..3f4b13fa 100644 --- a/src/block.c +++ b/src/block.c @@ -329,14 +329,3 @@ send_disk_op(struct disk_op_s *op) 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 655ee00a..349e401b 100644 --- a/src/cdrom.c +++ b/src/cdrom.c @@ -109,8 +109,6 @@ cdemu_setup(void) { 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 f6a43e9e..fcdc698b 100644 --- a/src/clock.c +++ b/src/clock.c @@ -211,7 +211,6 @@ timer_setup(void) 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 db0063be..50d300c8 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -126,8 +126,6 @@ coreboot_fill_map(void) { 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 @@ coreboot_copy_biostable(void) 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++) { @@ -234,7 +234,6 @@ void map_hd_drive(struct drive_s *drive_g); 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 84bc4faa..ea05953d 100644 --- a/src/memmap.c +++ b/src/memmap.c @@ -119,13 +119,6 @@ add_e820(u64 start, u64 size, u32 type) //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 d4154c1a..01c7ddb1 100644 --- a/src/memmap.h +++ b/src/memmap.h @@ -17,7 +17,6 @@ struct e820entry { }; 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 ceb40603..854c33fd 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -72,7 +72,7 @@ struct pnp_data { #define PCIROM_CODETYPE_X86 0 // The end of the last deployed rom. -u32 RomEnd; +u32 RomEnd = BUILD_ROM_START; /**************************************************************** @@ -423,9 +423,6 @@ optionrom_setup(void) void vga_setup(void) { - VGAbdf = -1; - RomEnd = BUILD_ROM_START; - if (! CONFIG_OPTIONROMS) return; @@ -193,12 +193,6 @@ malloc_setup(void) 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; @@ -205,13 +205,11 @@ maininit(void) 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 @@ maininit(void) // Initialize internal tables boot_setup(); - drive_setup(); // Start hardware initialization (if optionrom threading) if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS) @@ -327,7 +324,6 @@ void VISIBLE32INIT post(void) { // Detect ram and setup internal malloc. - memmap_setup(); qemu_cfg_port_probe(); ram_probe(); malloc_setup(); @@ -127,11 +127,3 @@ smp_probe(void) 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 dade3af7..14f6f8ad 100644 --- a/src/stacks.c +++ b/src/stacks.c @@ -15,7 +15,9 @@ struct thread_info { void *stackpos; struct thread_info **pprev; }; -struct thread_info VAR16VISIBLE MainThread; +struct thread_info VAR32FLATVISIBLE MainThread = { + &MainThread, NULL, &MainThread.next +}; /**************************************************************** @@ -190,15 +192,6 @@ stack_hop(u32 eax, u32 edx, void *func) #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 @@ check_preempt(void) { 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 b88d684f..168b7fab 100644 --- a/src/usb-hid.c +++ b/src/usb-hid.c @@ -130,15 +130,6 @@ usb_hid_init(struct usb_pipe *pipe 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 d8199b9b..7fbcf4b0 100644 --- a/src/usb-hid.h +++ b/src/usb-hid.h @@ -6,7 +6,6 @@ struct usb_interface_descriptor; 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); @@ -423,8 +423,6 @@ usb_setup(void) dprintf(3, "init usb\n"); - usb_hid_setup(); - // Look for USB controllers int ehcibdf = -1; int count = 0; @@ -213,7 +213,6 @@ int get_keystroke(int msec); // 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 CountCPUs; 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 14678be7..eb4dfa89 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 @@ vgahook_setup(const char *vendor, const char *part) 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; } |