diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-10-21 02:23:02 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-10-27 10:56:54 -0400 |
commit | 46000f5608a0ed1156463218f49d33044c4df843 (patch) | |
tree | 886d7bfe45bb2bccad9580c4b1e4f081f78f36a5 /vgasrc | |
parent | 283ae1f07949c463cbba0b8cd20f703a8c1389b6 (diff) | |
download | seabios-hppa-46000f5608a0ed1156463218f49d33044c4df843.zip seabios-hppa-46000f5608a0ed1156463218f49d33044c4df843.tar.gz seabios-hppa-46000f5608a0ed1156463218f49d33044c4df843.tar.bz2 |
Create assembler macros for saving and restoring 'struct bregs'
Create macros SAVEBREGS_POP_DSEAX and RESTOREBREGS_DSEAX for saving
and restoring the cpu state. These are similar to the existing
PUSHBREGS and POPBREGS macros.
This also fixes a bug in __farcall16 which inadvertently restored %ds
in %es and vice-versa.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc')
-rw-r--r-- | vgasrc/vgaentry.S | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/vgasrc/vgaentry.S b/vgasrc/vgaentry.S index 3c2c885..5d45380 100644 --- a/vgasrc/vgaentry.S +++ b/vgasrc/vgaentry.S @@ -113,15 +113,7 @@ entry_10_extrastack: pushl %eax movw %cs:ExtraStackSeg, %ds movl $(CONFIG_VGA_EXTRA_STACK_SIZE-BREGS_size-8), %eax - popl BREGS_eax(%eax) // Backup registers - popw BREGS_ds(%eax) - movl %edi, BREGS_edi(%eax) - movl %esi, BREGS_esi(%eax) - movl %ebp, BREGS_ebp(%eax) - movl %ebx, BREGS_ebx(%eax) - movl %edx, BREGS_edx(%eax) - movl %ecx, BREGS_ecx(%eax) - movw %es, BREGS_es(%eax) + SAVEBREGS_POP_DSEAX // Save registers on extra stack movl %esp, BREGS_size+0(%eax) movw %ss, BREGS_size+4(%eax) popl BREGS_code(%eax) @@ -139,15 +131,5 @@ entry_10_extrastack: popw %dx pushw BREGS_flags(%eax) pushl BREGS_code(%eax) - movl BREGS_edi(%eax), %edi - movl BREGS_esi(%eax), %esi - movl BREGS_ebp(%eax), %ebp - movl BREGS_ebx(%eax), %ebx - movl BREGS_edx(%eax), %edx - movl BREGS_ecx(%eax), %ecx - movw BREGS_es(%eax), %es - pushw BREGS_ds(%eax) - pushl BREGS_eax(%eax) - popl %eax - popw %ds + RESTOREBREGS_DSEAX iretw |