aboutsummaryrefslogtreecommitdiff
path: root/src/ata.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-05-13 12:10:30 -0400
committerKevin O'Connor <kevin@koconnor.net>2012-05-20 18:10:38 -0400
commit46b82624c95b951e8825fab117d9352faeae0ec8 (patch)
tree02e6dfd8ab8dcacd86ef7b6b08bd2a67d45d6410 /src/ata.c
parent9c98517c938d20c38f537d516c71b30bb60c3ea0 (diff)
downloadseabios-hppa-46b82624c95b951e8825fab117d9352faeae0ec8.zip
seabios-hppa-46b82624c95b951e8825fab117d9352faeae0ec8.tar.gz
seabios-hppa-46b82624c95b951e8825fab117d9352faeae0ec8.tar.bz2
Add mechanism to declare variables as "low mem" and use for extra stack.
Add a mechanism (VARLOW declaration) to make a variable reside in the low memory (e-segment) area. This is useful for runtime variables that need to be accessed from 16bit code and need to be modifiable during runtime. Move the 16bit "extra stack" from the EBDA to the low memory area using this declaration mechanism. Also increase the size of this stack from 512 bytes to 2048 bytes. This also reworks tools/layoutrom.py a bit. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/ata.c')
-rw-r--r--src/ata.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ata.c b/src/ata.c
index c37691a..b261bfe 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -10,7 +10,7 @@
#include "util.h" // dprintf
#include "cmos.h" // inb_cmos
#include "pic.h" // enable_hwirq
-#include "biosvar.h" // GET_EBDA
+#include "biosvar.h" // GET_GLOBAL
#include "pci.h" // foreachpci
#include "pci_ids.h" // PCI_CLASS_STORAGE_OTHER
#include "pci_regs.h" // PCI_INTERRUPT_LINE
@@ -379,6 +379,7 @@ struct sff_dma_prd {
static int
ata_try_dma(struct disk_op_s *op, int iswrite, int blocksize)
{
+ ASSERT16();
if (! CONFIG_ATA_DMA)
return -1;
u32 dest = (u32)op->buf_fl;
@@ -396,9 +397,7 @@ ata_try_dma(struct disk_op_s *op, int iswrite, int blocksize)
return -1;
// Build PRD dma structure.
- struct sff_dma_prd *dma = MAKE_FLATPTR(
- get_ebda_seg()
- , (void*)offsetof(struct extended_bios_data_area_s, extra_stack));
+ struct sff_dma_prd *dma = MAKE_FLATPTR(SEG_LOW, ExtraStack);
struct sff_dma_prd *origdma = dma;
while (bytes) {
if (dma >= &origdma[16])