From e0ae018002bdead50ed50e3f7df00cd54f1028a9 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 9 Mar 2007 02:25:06 +0000 Subject: [PATCH] Added some TODOs and fixed coding style issues and other cosmetic issues (trivial). Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@226 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- lib/stage2.c | 66 +++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/lib/stage2.c b/lib/stage2.c index c3635d0b58..cf5ea4df97 100644 --- a/lib/stage2.c +++ b/lib/stage2.c @@ -20,11 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA */ -/* stage2 - LinuxBIOS ram based setup */ - -/* - * C Bootstrap code for the LinuxBIOS - */ +/* stage2 - LinuxBIOS RAM-based setup. */ #include #include @@ -35,67 +31,69 @@ #include /** - * @brief Main function of the DRAM part of LinuxBIOS. + * Main function of the DRAM part of LinuxBIOS. * - * LinuxBIOS is divided into Pre-DRAM part and DRAM part. - * The phases before this part are phase 0 and phase 1. - * This part contains phases x through y. - * - * Device Enumeration: - * In the dev_enumerate() phase, + * LinuxBIOS is divided into pre-DRAM part and DRAM part. The phases before + * this part are phase 0 and phase 1. This part contains phases x through y. + * + * Device Enumeration: in the dev_enumerate() phase. + * + * TODO: Check whether this documentation is still correct. Improve it. */ int stage2(void) { + /* TODO: Add comment. */ void show_all_devs(void); post_code(0x20); dev_init(); - /* console init, also ANYTHING that has to be done - * before printk can be used + /* Console init, also ANYTHING that has to be done + * before printk can be used. */ post_code(0x30); - dev_phase1(); -show_all_devs(); - -// printk_notice("LinuxBIOS-%s%s %s booting...\n", -// linuxbios_version, linuxbios_extra_version, linuxbios_build); + dev_phase1(); + show_all_devs(); // printk_notice("LinuxBIOS-%s%s %s booting...\n", // linuxbios_version, linuxbios_extra_version, linuxbios_build); - /* here is where weird stuff like init_timer handling should be - * done. This is for ANYTHING that might have to happen before - * device enumeration but that needs a printk +// printk_notice("LinuxBIOS-%s%s %s booting...\n", +// linuxbios_version, linuxbios_extra_version, linuxbios_build); + + /* Here is where weird stuff like init_timer handling should be + * done. This is for ANYTHING that might have to happen before + * device enumeration but that needs a printk. */ post_code(0x40); dev_phase2(); -show_all_devs(); + show_all_devs(); - /* walk physical devices and add any dynamic devices to the - * device tree + /* Walk physical devices and add any dynamic devices to the + * device tree. */ post_code(0x30); dev_root_phase3(); -show_all_devs(); + show_all_devs(); /* Compute and assign the bus resources. */ post_code(0x40); dev_phase4(); -show_all_devs(); + show_all_devs(); - /* Now actually enable devices on the bus */ + /* Now actually enable devices on the bus. */ post_code(0x50); dev_root_phase5(); -show_all_devs(); + show_all_devs(); - /*initialize devices on the bus */ + /* Initialize devices on the bus. */ post_code(0x60); - dev_phase6(); -show_all_devs(); - + dev_phase6(); + show_all_devs(); + + /* TODO: Add comment. */ post_code(0x70); write_tables(); -show_all_devs(); + show_all_devs(); return 0; }