aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-11-08 19:07:49 -0500
committerKevin O'Connor <kevin@koconnor.net>2008-11-08 19:07:49 -0500
commit1492708bbf9d44f2b0435b0ee5d9d037deeb9961 (patch)
tree6c3f903e04f07b6530d70510735fec47b6126be6
parent2ed2f58e6284319d4b84fe37d215afcfbbbac300 (diff)
downloadseabios-hppa-1492708bbf9d44f2b0435b0ee5d9d037deeb9961.zip
seabios-hppa-1492708bbf9d44f2b0435b0ee5d9d037deeb9961.tar.gz
seabios-hppa-1492708bbf9d44f2b0435b0ee5d9d037deeb9961.tar.bz2
Move 32bit segment defines from romlayout.S to config.h.
This moves the 32bit segment names next to the real-mode segment names. Also, renames them to be more consistent.
-rw-r--r--src/config.h8
-rw-r--r--src/romlayout.S23
2 files changed, 16 insertions, 15 deletions
diff --git a/src/config.h b/src/config.h
index 39a796d..354adcf 100644
--- a/src/config.h
+++ b/src/config.h
@@ -95,11 +95,17 @@
// Start of fixed addresses in 0xf0000 segment.
#define BUILD_START_FIXED 0xe050
-// Important 16-bit segments
+// Important real-mode segments
#define SEG_BIOS 0xf000
#define SEG_EBDA 0x9fc0
#define SEG_BDA 0x0000
+// Segment definitions in 32bit mode.
+#define SEG32_MODE32_CS (2 << 3) // 0x10
+#define SEG32_MODE32_DS (3 << 3) // 0x18
+#define SEG32_MODE16_CS (4 << 3) // 0x20
+#define SEG32_MODE16_DS (5 << 3) // 0x28
+
// Debugging levels. If non-zero and CONFIG_DEBUG_LEVEL is greater
// than the specified value, then the corresponding irq handler will
// report every enter event.
diff --git a/src/romlayout.S b/src/romlayout.S
index dabee9a..e9ea067 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -7,11 +7,6 @@
#include "config.h"
-#define PROTECTED_MODE_CS (2 << 3) // 0x10
-#define PROTECTED_MODE_DS (3 << 3) // 0x18
-#define REAL_MODE_CS (4 << 3) // 0x20
-#define REAL_MODE_DS (5 << 3) // 0x28
-
/****************************************************************
* Include of 16bit C code
@@ -164,12 +159,12 @@ transition32:
movl %eax, %cr0
// start protected mode code
- ljmpl $PROTECTED_MODE_CS, $(BUILD_BIOS_ADDR + 1f)
+ ljmpl $SEG32_MODE32_CS, $(BUILD_BIOS_ADDR + 1f)
.code32
1:
// init data segments
- movl $PROTECTED_MODE_DS, %eax
+ movl $SEG32_MODE32_DS, %eax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
@@ -187,12 +182,12 @@ __call16_from32:
pushl %eax
// Jump to 16bit mode
- ljmpw $REAL_MODE_CS, $1f
+ ljmpw $SEG32_MODE16_CS, $1f
.code16gcc
1:
// restore data segment limits to 0xffff
- movw $REAL_MODE_DS, %ax
+ movw $SEG32_MODE16_DS, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
@@ -319,7 +314,7 @@ post32:
lidtl (BUILD_BIOS_ADDR + pmode_IDT_info)
lgdtl (BUILD_BIOS_ADDR + rombios32_gdt_48)
movl $BUILD_STACK_ADDR, %esp
- ljmpl $PROTECTED_MODE_CS, $_code32__start
+ ljmpl $SEG32_MODE32_CS, $_code32__start
.code16gcc
@@ -369,13 +364,13 @@ rombios32_gdt_48:
rombios32_gdt:
.word 0, 0, 0, 0
.word 0, 0, 0, 0
- // 32 bit flat code segment (PROTECTED_MODE_CS)
+ // 32 bit flat code segment (SEG32_MODE32_CS)
.word 0xffff, 0, 0x9b00, 0x00cf
- // 32 bit flat data segment (PROTECTED_MODE_DS)
+ // 32 bit flat data segment (SEG32_MODE32_DS)
.word 0xffff, 0, 0x9300, 0x00cf
- // 16 bit code segment base=0xf0000 limit=0xffff (REAL_MODE_CS)
+ // 16 bit code segment base=0xf0000 limit=0xffff (SEG32_MODE16_CS)
.word 0xffff, 0, 0x9b0f, 0x0000
- // 16 bit data segment base=0x0 limit=0xffff (REAL_MODE_DS)
+ // 16 bit data segment base=0x0 limit=0xffff (SEG32_MODE16_DS)
.word 0xffff, 0, 0x9300, 0x0000
// We need a copy of this string in the 0xf000 segment, but we are not