diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-01-21 12:14:29 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-02-07 21:48:35 -0500 |
commit | 9e4d41cd7c157a1d7037b06f9d830a7dfc6d1441 (patch) | |
tree | 4b1dcd270fd93bc664039e9c50fd500fadadfcd9 /src/post.c | |
parent | 6ca0460fbb8ecfa5d42c8928b7ee71f20d0cffdb (diff) | |
download | seabios-9e4d41cd7c157a1d7037b06f9d830a7dfc6d1441.tar.gz |
POST: Move cpu caching and dma setup to platform_hardware_setup().
The CPU cache is enabled and DMA is disabled on all real-world POST
entry situations, so no need to do this in the low-level "pre-init"
phase. Instead, move it to the platform hardware setup stage.
Also, move the setting of the reboot flags (which control reset-vector
entry point handling) to ivt_init().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/post.c')
-rw-r--r-- | src/post.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -37,6 +37,10 @@ ivt_init(void) { dprintf(3, "init ivt\n"); + // Setup reset-vector entry point (controls legacy reboots). + HaveRunPost = 1; + outb_cmos(0, CMOS_RESET_CODE); + // Initialize all vectors to the default handler. int i; for (i=0; i<256; i++) @@ -145,6 +149,12 @@ device_hardware_setup(void) static void platform_hardware_setup(void) { + // Enable CPU caching + setcr0(getcr0() & ~(CR0_CD|CR0_NW)); + + // Make sure legacy DMA isn't running. + dma_setup(); + // Init base pc hardware. pic_setup(); timer_setup(); @@ -305,16 +315,6 @@ reloc_preinit(void *f, void *arg) void VISIBLE32INIT dopost(void) { - // Set reboot flags. - HaveRunPost = 1; - outb_cmos(0, CMOS_RESET_CODE); - - // Enable CPU caching - setcr0(getcr0() & ~(CR0_CD|CR0_NW)); - - // Make sure legacy DMA isn't running. - dma_preinit(); - // Check if we are running under Xen. xen_preinit(); |