1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

Fix the DOS port

Now the DS selector limit is set to 4GB and all mmio accesses goes
through DS, the 1:1 mapping is fixed so the _DS base is taken onto
account. Plus is that the hwaccess.c needs no change and memcpy etc can
be used on mmaped space.

Corresponding to flashrom svn r995.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz> 
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
Rudolf Marek
2010-04-25 22:47:50 +00:00
parent ce1c798c1c
commit 837d810796
3 changed files with 34 additions and 76 deletions

View File

@ -54,44 +54,6 @@ void release_io_perms(void)
#endif
}
#ifdef __DJGPP__
extern unsigned short segFS;
#include <sys/farptr.h>
void mmio_writeb(uint8_t val, void *addr)
{
_farpokeb(segFS, (unsigned long) addr, val);
}
void mmio_writew(uint16_t val, void *addr)
{
_farpokew(segFS, (unsigned long) addr, val);
}
void mmio_writel(uint32_t val, void *addr)
{
_farpokel(segFS, (unsigned long) addr, val);
}
uint8_t mmio_readb(void *addr)
{
return _farpeekb(segFS, (unsigned long) addr);
}
uint16_t mmio_readw(void *addr)
{
return _farpeekw(segFS, (unsigned long) addr);
}
uint32_t mmio_readl(void *addr)
{
return _farpeekl(segFS, (unsigned long) addr);
}
#else
void mmio_writeb(uint8_t val, void *addr)
{
*(volatile uint8_t *) addr = val;
@ -121,4 +83,3 @@ uint32_t mmio_readl(void *addr)
{
return *(volatile uint32_t *) addr;
}
#endif