summaryrefslogtreecommitdiff
path: root/src/devices/oprom/yabel/mem.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-01-13 11:38:46 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2011-01-13 11:38:46 +0000
commit9144304771be6cc89fcd010a0c8bc123bb750cfc (patch)
tree1ad3642b709324c910e6fffbb677698c6937b189 /src/devices/oprom/yabel/mem.c
parentfe7d6b9a4a784f0b92b3c9dc5b6c6070b4c2e10c (diff)
Improve compatibility of YABEL with real-world VGABIOSes
Some of them do weird things to the option rom region (mapping registers there or so) which failed as we handled these memory region in emulation. As they were copied back to real memory after the emulation was done, we can just as well use real memory directly for these regions. This affects IVT, BDA, and option ROM space. Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Acked-by: Joseph Smith <joe@settoplinux.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6251 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/oprom/yabel/mem.c')
-rw-r--r--src/devices/oprom/yabel/mem.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/devices/oprom/yabel/mem.c b/src/devices/oprom/yabel/mem.c
index d55ae05445..8ca42b0e90 100644
--- a/src/devices/oprom/yabel/mem.c
+++ b/src/devices/oprom/yabel/mem.c
@@ -21,6 +21,10 @@
#if !defined(CONFIG_YABEL_DIRECTHW) || (!CONFIG_YABEL_DIRECTHW)
+#ifdef CONFIG_PCI_OPTION_ROM_RUN_YABEL
+#include <device/resource.h>
+#endif
+
// define a check for access to certain (virtual) memory regions (interrupt handlers, BIOS Data Area, ...)
#if CONFIG_X86EMU_DEBUG
static u8 in_check = 0; // to avoid recursion...
@@ -195,7 +199,7 @@ u8
my_rdb(u32 addr)
{
unsigned long translated_addr = addr;
- u8 translated = biosemu_dev_translate_address(&translated_addr);
+ u8 translated = biosemu_dev_translate_address(IORESOURCE_MEM, &translated_addr);
u8 rval;
if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...)
@@ -227,7 +231,7 @@ u16
my_rdw(u32 addr)
{
unsigned long translated_addr = addr;
- u8 translated = biosemu_dev_translate_address(&translated_addr);
+ u8 translated = biosemu_dev_translate_address(IORESOURCE_MEM, &translated_addr);
u16 rval;
if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...)
@@ -278,7 +282,7 @@ u32
my_rdl(u32 addr)
{
unsigned long translated_addr = addr;
- u8 translated = biosemu_dev_translate_address(&translated_addr);
+ u8 translated = biosemu_dev_translate_address(IORESOURCE_MEM, &translated_addr);
u32 rval;
if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...)
@@ -341,7 +345,7 @@ void
my_wrb(u32 addr, u8 val)
{
unsigned long translated_addr = addr;
- u8 translated = biosemu_dev_translate_address(&translated_addr);
+ u8 translated = biosemu_dev_translate_address(IORESOURCE_MEM, &translated_addr);
if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n",
@@ -366,7 +370,7 @@ void
my_wrw(u32 addr, u16 val)
{
unsigned long translated_addr = addr;
- u8 translated = biosemu_dev_translate_address(&translated_addr);
+ u8 translated = biosemu_dev_translate_address(IORESOURCE_MEM, &translated_addr);
if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n",
@@ -411,7 +415,7 @@ void
my_wrl(u32 addr, u32 val)
{
unsigned long translated_addr = addr;
- u8 translated = biosemu_dev_translate_address(&translated_addr);
+ u8 translated = biosemu_dev_translate_address(IORESOURCE_MEM, &translated_addr);
if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n",