aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2011-07-10 22:35:07 -0400
committerKevin O'Connor <kevin@koconnor.net>2011-07-10 22:35:07 -0400
commit87b533bf71bb41e32319db0ed8f167f50171afc5 (patch)
tree5fc0cbb83ab7419a734393e4baaf09e05409970a /src/util.h
parentffdcd3a8d72310efc55255fc93edf78c024bbafe (diff)
downloadseabios-hppa-87b533bf71bb41e32319db0ed8f167f50171afc5.zip
seabios-hppa-87b533bf71bb41e32319db0ed8f167f50171afc5.tar.gz
seabios-hppa-87b533bf71bb41e32319db0ed8f167f50171afc5.tar.bz2
Simplify POST entry code by moving reboot logic from post.c to resume.c.
Detect a resume/reboot by inspecting HaveRunPost instead of inspecting the cmos reset code. Inspecting a global variable is both simpler and safer. Move the reboot logic from post.c to resume.c - this makes the code in post.c simpler as it is now only called once on machine startup. This also makes it easier to ensure all POST initialization code resides in the relocatable "init" sections. Also, rename _start() to handle_post() so that it is more in keeping with the entry_xxx() and handle_xxx() function naming. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 303c524..4319f63 100644
--- a/src/util.h
+++ b/src/util.h
@@ -61,6 +61,15 @@ static inline void cpuid(u32 index, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
: "0" (index));
}
+static inline u32 getcr0(void) {
+ u32 cr0;
+ asm("movl %%cr0, %0" : "=r"(cr0));
+ return cr0;
+}
+static inline void setcr0(u32 cr0) {
+ asm("movl %0, %%cr0" : : "r"(cr0));
+}
+
static inline u64 rdmsr(u32 index)
{
u64 ret;
@@ -424,6 +433,7 @@ void enable_bootsplash(void);
void disable_bootsplash(void);
// resume.c
+extern int HaveRunPost;
void init_dma(void);
// pnpbios.c