fixed memory handler params - use bx_phy_address data type
This commit is contained in:
parent
affbdbefb4
commit
297087fea9
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: ioapic.cc,v 1.36 2008-01-26 22:24:02 sshwarts Exp $
|
||||
// $Id: ioapic.cc,v 1.37 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -33,13 +33,13 @@
|
||||
class bx_ioapic_c bx_ioapic;
|
||||
#define LOG_THIS bx_ioapic.
|
||||
|
||||
static bx_bool ioapic_read(unsigned long a20addr, unsigned long len, void *data, void *param)
|
||||
static bx_bool ioapic_read(bx_phy_address a20addr, unsigned len, void *data, void *param)
|
||||
{
|
||||
bx_ioapic.read(a20addr, data, len);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bx_bool ioapic_write(unsigned long a20addr, unsigned long len, void *data, void *param)
|
||||
static bx_bool ioapic_write(bx_phy_address a20addr, unsigned len, void *data, void *param)
|
||||
{
|
||||
if (len != 4) {
|
||||
BX_PANIC (("I/O apic write with len=%ld (should be 4)", len));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pcidev.cc,v 1.14 2008-01-26 22:24:02 sshwarts Exp $
|
||||
// $Id: pcidev.cc,v 1.15 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
@ -79,77 +79,77 @@ static void pcidev_sighandler(int param)
|
||||
DEV_pci_set_irq(pcidev->devfunc, pcidev->intpin, 1);
|
||||
}
|
||||
|
||||
static bx_bool pcidev_mem_read_handler(unsigned long addr, unsigned long len, void *data, void *param)
|
||||
static bx_bool pcidev_mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param)
|
||||
{
|
||||
struct region_struct *region = (struct region_struct *)param;
|
||||
bx_pcidev_c *pcidev = region->pcidev;
|
||||
int fd = pcidev->pcidev_fd;
|
||||
int ret = -1;
|
||||
struct region_struct *region = (struct region_struct *)param;
|
||||
bx_pcidev_c *pcidev = region->pcidev;
|
||||
int fd = pcidev->pcidev_fd;
|
||||
int ret = -1;
|
||||
|
||||
if (fd == -1)
|
||||
return false; /* we failed to handle the request, so let a default handler do it for us */
|
||||
if (fd == -1)
|
||||
return false; /* we failed to handle the request, so let a default handler do it for us */
|
||||
|
||||
BX_INFO(("Reading I/O memory at 0x%08x", (unsigned)addr));
|
||||
struct pcidev_io_struct io;
|
||||
io.address = addr + region->host_start - region->start;
|
||||
switch(len) {
|
||||
case 1:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_MEM_BYTE, &io);
|
||||
*(Bit8u *)data = io.value;
|
||||
break;
|
||||
case 2:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_MEM_WORD, &io);
|
||||
*(Bit16u *)data = io.value;
|
||||
break;
|
||||
case 4:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_MEM_DWORD, &io);
|
||||
*(Bit32u *)data = io.value;
|
||||
break;
|
||||
default:
|
||||
BX_ERROR(("Unsupported pcidev read mem operation"));
|
||||
break;
|
||||
}
|
||||
if (ret == -1) {
|
||||
BX_ERROR(("pcidev read mem error"));
|
||||
}
|
||||
return true; // ok, we handled the request
|
||||
BX_INFO(("Reading I/O memory at 0x%08x", (unsigned)addr));
|
||||
struct pcidev_io_struct io;
|
||||
io.address = addr + region->host_start - region->start;
|
||||
switch(len) {
|
||||
case 1:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_MEM_BYTE, &io);
|
||||
*(Bit8u *)data = io.value;
|
||||
break;
|
||||
case 2:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_MEM_WORD, &io);
|
||||
*(Bit16u *)data = io.value;
|
||||
break;
|
||||
case 4:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_MEM_DWORD, &io);
|
||||
*(Bit32u *)data = io.value;
|
||||
break;
|
||||
default:
|
||||
BX_ERROR(("Unsupported pcidev read mem operation"));
|
||||
break;
|
||||
}
|
||||
if (ret == -1) {
|
||||
BX_ERROR(("pcidev read mem error"));
|
||||
}
|
||||
return true; // ok, we handled the request
|
||||
}
|
||||
|
||||
|
||||
static bx_bool pcidev_mem_write_handler(unsigned long addr, unsigned long len, void *data, void *param)
|
||||
static bx_bool pcidev_mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param)
|
||||
{
|
||||
struct region_struct *region = (struct region_struct *)param;
|
||||
bx_pcidev_c *pcidev = region->pcidev;
|
||||
int fd = pcidev->pcidev_fd;
|
||||
int ret = -1;
|
||||
struct region_struct *region = (struct region_struct *)param;
|
||||
bx_pcidev_c *pcidev = region->pcidev;
|
||||
int fd = pcidev->pcidev_fd;
|
||||
int ret = -1;
|
||||
|
||||
if (fd == -1)
|
||||
return false; /* we failed to handle the request, so let a default handler do it for us */
|
||||
if (fd == -1)
|
||||
return false; /* we failed to handle the request, so let a default handler do it for us */
|
||||
|
||||
BX_INFO(("Writing I/O memory at 0x%08x", (unsigned)addr));
|
||||
struct pcidev_io_struct io;
|
||||
io.address = addr + region->host_start - region->start;
|
||||
switch(len) {
|
||||
case 1:
|
||||
io.value = *(Bit8u *)data;
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_WRITE_MEM_BYTE, &io);
|
||||
break;
|
||||
case 2:
|
||||
io.value = *(Bit16u *)data;
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_WRITE_MEM_WORD, &io);
|
||||
break;
|
||||
case 4:
|
||||
io.value = *(Bit32u *)data;
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_WRITE_MEM_DWORD, &io);
|
||||
break;
|
||||
default:
|
||||
BX_ERROR(("Unsupported pcidev write mem operation"));
|
||||
break;
|
||||
}
|
||||
if (ret == -1) {
|
||||
BX_ERROR(("pcidev write mem error"));
|
||||
}
|
||||
return true;
|
||||
BX_INFO(("Writing I/O memory at 0x%08x", (unsigned)addr));
|
||||
struct pcidev_io_struct io;
|
||||
io.address = addr + region->host_start - region->start;
|
||||
switch(len) {
|
||||
case 1:
|
||||
io.value = *(Bit8u *)data;
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_WRITE_MEM_BYTE, &io);
|
||||
break;
|
||||
case 2:
|
||||
io.value = *(Bit16u *)data;
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_WRITE_MEM_WORD, &io);
|
||||
break;
|
||||
case 4:
|
||||
io.value = *(Bit32u *)data;
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_WRITE_MEM_DWORD, &io);
|
||||
break;
|
||||
default:
|
||||
BX_ERROR(("Unsupported pcidev write mem operation"));
|
||||
break;
|
||||
}
|
||||
if (ret == -1) {
|
||||
BX_ERROR(("pcidev write mem error"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ void bx_pcidev_c::init(void)
|
||||
return;
|
||||
}
|
||||
BX_INFO(("vendor: %04x; device: %04x @ host %04x:%04x.%d", vendor, device,
|
||||
(unsigned)find.bus, (unsigned)find.device, (unsigned)find.func));
|
||||
(unsigned)find.bus, (unsigned)find.device, (unsigned)find.func));
|
||||
|
||||
BX_PCIDEV_THIS devfunc = 0x00;
|
||||
DEV_register_pci_handlers(this, &BX_PCIDEV_THIS devfunc, BX_PLUGIN_PCIDEV,
|
||||
@ -294,7 +294,6 @@ Bit32u bx_pcidev_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
return io.value;
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_pcidev_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
@ -408,7 +407,7 @@ Bit32u bx_pcidev_c::read_handler(void *param, Bit32u address, unsigned io_len)
|
||||
|
||||
Bit32u bx_pcidev_c::read(void *param, Bit32u address, unsigned io_len)
|
||||
{
|
||||
#endif // !BX_USE_PCIDEV_SMF
|
||||
#endif
|
||||
struct region_struct *region = (struct region_struct *)param;
|
||||
int ret = -1;
|
||||
|
||||
@ -420,19 +419,19 @@ Bit32u bx_pcidev_c::read(void *param, Bit32u address, unsigned io_len)
|
||||
// here we map the io address
|
||||
io.address = address + region->host_start - region->start;
|
||||
switch(io_len) {
|
||||
case 1:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_IO_BYTE, &io);
|
||||
break;
|
||||
case 2:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_IO_WORD, &io);
|
||||
break;
|
||||
case 4:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_IO_DWORD, &io);
|
||||
break;
|
||||
case 1:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_IO_BYTE, &io);
|
||||
break;
|
||||
case 2:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_IO_WORD, &io);
|
||||
break;
|
||||
case 4:
|
||||
ret = ioctl(fd, PCIDEV_IOCTL_READ_IO_DWORD, &io);
|
||||
break;
|
||||
}
|
||||
if (ret == -1) {
|
||||
BX_ERROR(("pcidev read I/O error"));
|
||||
io.value = 0xffffffff;
|
||||
BX_ERROR(("pcidev read I/O error"));
|
||||
io.value = 0xffffffff;
|
||||
}
|
||||
|
||||
return io.value;
|
||||
@ -447,9 +446,7 @@ void bx_pcidev_c::write_handler(void *param, Bit32u address, Bit32u value, unsig
|
||||
|
||||
void bx_pcidev_c::write(void *param, Bit32u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
#else
|
||||
//UNUSED(this_ptr);
|
||||
#endif // !BX_USE_PCIDEV_SMF
|
||||
#endif
|
||||
struct region_struct *region = (struct region_struct *)param;
|
||||
int ret = -1;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: svga_cirrus.cc,v 1.43 2008-03-22 22:26:03 sshwarts Exp $
|
||||
// $Id: svga_cirrus.cc,v 1.44 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2004 Makoto Suzuki (suzu)
|
||||
@ -536,11 +536,10 @@ void bx_svga_cirrus_c::mem_write_mode4and5_16bpp(Bit8u mode, Bit32u offset, Bit8
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
bx_bool bx_svga_cirrus_c::cirrus_mem_read_handler(unsigned long addr, unsigned long len,
|
||||
bx_bool bx_svga_cirrus_c::cirrus_mem_read_handler(bx_phy_address addr, unsigned len,
|
||||
void *data, void *param)
|
||||
{
|
||||
Bit8u *data_ptr;
|
||||
|
||||
#ifdef BX_LITTLE_ENDIAN
|
||||
data_ptr = (Bit8u *) data;
|
||||
#else // BX_BIG_ENDIAN
|
||||
@ -559,7 +558,7 @@ bx_bool bx_svga_cirrus_c::cirrus_mem_read_handler(unsigned long addr, unsigned l
|
||||
}
|
||||
#endif
|
||||
|
||||
Bit8u bx_svga_cirrus_c::mem_read(Bit32u addr)
|
||||
Bit8u bx_svga_cirrus_c::mem_read(bx_phy_address addr)
|
||||
{
|
||||
if ((BX_CIRRUS_THIS sequencer.reg[0x07] & 0x01) == CIRRUS_SR7_BPP_VGA) {
|
||||
return BX_CIRRUS_THIS bx_vga_c::mem_read(addr);
|
||||
@ -665,11 +664,10 @@ Bit8u bx_svga_cirrus_c::mem_read(Bit32u addr)
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
bx_bool bx_svga_cirrus_c::cirrus_mem_write_handler(unsigned long addr, unsigned long len,
|
||||
bx_bool bx_svga_cirrus_c::cirrus_mem_write_handler(bx_phy_address addr, unsigned len,
|
||||
void *data, void *param)
|
||||
{
|
||||
Bit8u *data_ptr;
|
||||
|
||||
#ifdef BX_LITTLE_ENDIAN
|
||||
data_ptr = (Bit8u *) data;
|
||||
#else // BX_BIG_ENDIAN
|
||||
@ -688,7 +686,7 @@ bx_bool bx_svga_cirrus_c::cirrus_mem_write_handler(unsigned long addr, unsigned
|
||||
}
|
||||
#endif
|
||||
|
||||
void bx_svga_cirrus_c::mem_write(Bit32u addr, Bit8u value)
|
||||
void bx_svga_cirrus_c::mem_write(bx_phy_address addr, Bit8u value)
|
||||
{
|
||||
if ((BX_CIRRUS_THIS sequencer.reg[0x07] & 0x01) == CIRRUS_SR7_BPP_VGA) {
|
||||
BX_CIRRUS_THIS bx_vga_c::mem_write(addr,value);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: svga_cirrus.h,v 1.14 2008-03-22 22:26:03 sshwarts Exp $
|
||||
// $Id: svga_cirrus.h,v 1.15 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2004 Makoto Suzuki (suzu)
|
||||
@ -74,8 +74,8 @@ public:
|
||||
virtual void reset(unsigned type);
|
||||
virtual void redraw_area(unsigned x0, unsigned y0,
|
||||
unsigned width, unsigned height);
|
||||
virtual Bit8u mem_read(Bit32u addr);
|
||||
virtual void mem_write(Bit32u addr, Bit8u value);
|
||||
virtual Bit8u mem_read(bx_phy_address addr);
|
||||
virtual void mem_write(bx_phy_address addr, Bit8u value);
|
||||
virtual void get_text_snapshot(Bit8u **text_snapshot,
|
||||
unsigned *txHeight, unsigned *txWidth);
|
||||
virtual void trigger_timer(void *this_ptr);
|
||||
@ -94,7 +94,7 @@ private:
|
||||
#if !BX_USE_CIRRUS_SMF
|
||||
Bit32u svga_read(Bit32u address, unsigned io_len);
|
||||
void svga_write(Bit32u address, Bit32u value, unsigned io_len);
|
||||
#endif // !BX_USE_CIRRUS_SMF
|
||||
#endif
|
||||
BX_CIRRUS_SMF void mem_write_mode4and5_8bpp(Bit8u mode, Bit32u offset, Bit8u value);
|
||||
BX_CIRRUS_SMF void mem_write_mode4and5_16bpp(Bit8u mode, Bit32u offset, Bit8u value);
|
||||
|
||||
@ -261,8 +261,8 @@ private:
|
||||
#if BX_SUPPORT_PCI
|
||||
BX_CIRRUS_SMF void svga_init_pcihandlers(void);
|
||||
|
||||
BX_CIRRUS_SMF bx_bool cirrus_mem_read_handler(unsigned long addr, unsigned long len, void *data, void *param);
|
||||
BX_CIRRUS_SMF bx_bool cirrus_mem_write_handler(unsigned long addr, unsigned long len, void *data, void *param);
|
||||
BX_CIRRUS_SMF bx_bool cirrus_mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
BX_CIRRUS_SMF bx_bool cirrus_mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
|
||||
Bit8u pci_conf[256];
|
||||
Bit32u pci_memaddr;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vga.cc,v 1.151 2008-02-15 22:05:43 sshwarts Exp $
|
||||
// $Id: vga.cc,v 1.152 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -140,7 +140,7 @@ void bx_vga_c::init(void)
|
||||
BX_VGA_THIS extension_checked = 0;
|
||||
#if !BX_SUPPORT_CLGD54XX
|
||||
BX_VGA_THIS init_iohandlers(read_handler,write_handler);
|
||||
#endif // !BX_SUPPORT_CLGD54XX
|
||||
#endif
|
||||
|
||||
DEV_register_memory_handlers(theVga, mem_read_handler, mem_write_handler,
|
||||
0xa0000, 0xbffff);
|
||||
@ -2199,11 +2199,9 @@ void bx_vga_c::update(void)
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool bx_vga_c::mem_read_handler(unsigned long addr, unsigned long len,
|
||||
void *data, void *param)
|
||||
bx_bool bx_vga_c::mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param)
|
||||
{
|
||||
Bit8u *data_ptr;
|
||||
|
||||
#ifdef BX_LITTLE_ENDIAN
|
||||
data_ptr = (Bit8u *) data;
|
||||
#else // BX_BIG_ENDIAN
|
||||
@ -2221,7 +2219,7 @@ bx_bool bx_vga_c::mem_read_handler(unsigned long addr, unsigned long len,
|
||||
return 1;
|
||||
}
|
||||
|
||||
Bit8u bx_vga_c::mem_read(Bit32u addr)
|
||||
Bit8u bx_vga_c::mem_read(bx_phy_address addr)
|
||||
{
|
||||
Bit32u offset;
|
||||
Bit8u *plane0, *plane1, *plane2, *plane3;
|
||||
@ -2230,11 +2228,11 @@ Bit8u bx_vga_c::mem_read(Bit32u addr)
|
||||
// if in a vbe enabled mode, read from the vbe_memory
|
||||
if ((BX_VGA_THIS s.vbe_enabled) && (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4))
|
||||
{
|
||||
return vbe_mem_read(addr);
|
||||
return vbe_mem_read(addr);
|
||||
}
|
||||
else if (addr >= VBE_DISPI_LFB_PHYSICAL_ADDRESS)
|
||||
{
|
||||
return 0xff;
|
||||
return 0xff;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2337,11 +2335,9 @@ Bit8u bx_vga_c::mem_read(Bit32u addr)
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool bx_vga_c::mem_write_handler(unsigned long addr, unsigned long len,
|
||||
void *data, void *param)
|
||||
bx_bool bx_vga_c::mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param)
|
||||
{
|
||||
Bit8u *data_ptr;
|
||||
|
||||
#ifdef BX_LITTLE_ENDIAN
|
||||
data_ptr = (Bit8u *) data;
|
||||
#else // BX_BIG_ENDIAN
|
||||
@ -2359,7 +2355,7 @@ bx_bool bx_vga_c::mem_write_handler(unsigned long addr, unsigned long len,
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bx_vga_c::mem_write(Bit32u addr, Bit8u value)
|
||||
void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value)
|
||||
{
|
||||
Bit32u offset;
|
||||
Bit8u new_val[4];
|
||||
@ -2951,7 +2947,7 @@ void bx_vga_c::redraw_area(unsigned x0, unsigned y0, unsigned width,
|
||||
|
||||
#if BX_SUPPORT_VBE
|
||||
Bit8u BX_CPP_AttrRegparmN(1)
|
||||
bx_vga_c::vbe_mem_read(Bit32u addr)
|
||||
bx_vga_c::vbe_mem_read(bx_phy_address addr)
|
||||
{
|
||||
Bit32u offset;
|
||||
|
||||
@ -2974,7 +2970,7 @@ bx_vga_c::vbe_mem_read(Bit32u addr)
|
||||
}
|
||||
|
||||
void BX_CPP_AttrRegparmN(2)
|
||||
bx_vga_c::vbe_mem_write(Bit32u addr, Bit8u value)
|
||||
bx_vga_c::vbe_mem_write(bx_phy_address addr, Bit8u value)
|
||||
{
|
||||
Bit32u offset;
|
||||
unsigned x_tileno, y_tileno;
|
||||
@ -3067,78 +3063,55 @@ Bit32u bx_vga_c::vbe_read(Bit32u address, unsigned io_len)
|
||||
switch (BX_VGA_THIS s.vbe_curindex)
|
||||
{
|
||||
case VBE_DISPI_INDEX_ID: // Display Interface ID check
|
||||
{
|
||||
return BX_VGA_THIS s.vbe_cur_dispi;
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_XRES: // x resolution
|
||||
{
|
||||
if (BX_VGA_THIS s.vbe_get_capabilities) {
|
||||
return BX_VGA_THIS s.vbe_max_xres;
|
||||
} else {
|
||||
return BX_VGA_THIS s.vbe_xres;
|
||||
}
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_YRES: // y resolution
|
||||
{
|
||||
if (BX_VGA_THIS s.vbe_get_capabilities) {
|
||||
return BX_VGA_THIS s.vbe_max_yres;
|
||||
} else {
|
||||
return BX_VGA_THIS s.vbe_yres;
|
||||
}
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_BPP: // bpp
|
||||
{
|
||||
if (BX_VGA_THIS s.vbe_get_capabilities) {
|
||||
return BX_VGA_THIS s.vbe_max_bpp;
|
||||
} else {
|
||||
return BX_VGA_THIS s.vbe_bpp;
|
||||
}
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_ENABLE: // vbe enabled
|
||||
{
|
||||
retval = BX_VGA_THIS s.vbe_enabled;
|
||||
if (BX_VGA_THIS s.vbe_get_capabilities)
|
||||
retval |= VBE_DISPI_GETCAPS;
|
||||
if (BX_VGA_THIS s.vbe_8bit_dac)
|
||||
retval |= VBE_DISPI_8BIT_DAC;
|
||||
return retval;
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_BANK: // current bank
|
||||
{
|
||||
return BX_VGA_THIS s.vbe_bank;
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_X_OFFSET:
|
||||
{
|
||||
return BX_VGA_THIS s.vbe_offset_x;
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_Y_OFFSET:
|
||||
{
|
||||
return BX_VGA_THIS s.vbe_offset_y;
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_VIRT_WIDTH:
|
||||
{
|
||||
return BX_VGA_THIS s.vbe_virtual_xres;
|
||||
|
||||
} break;
|
||||
|
||||
case VBE_DISPI_INDEX_VIRT_HEIGHT:
|
||||
{
|
||||
return BX_VGA_THIS s.vbe_virtual_yres;
|
||||
} break;
|
||||
|
||||
|
||||
default:
|
||||
{
|
||||
BX_PANIC(("VBE unknown data read index 0x%x",BX_VGA_THIS s.vbe_curindex));
|
||||
} break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
BX_PANIC(("VBE_read shouldn't reach this"));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vga.h,v 1.60 2008-01-26 22:24:03 sshwarts Exp $
|
||||
// $Id: vga.h,v 1.61 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -138,18 +138,18 @@ public:
|
||||
virtual ~bx_vga_c();
|
||||
virtual void init(void);
|
||||
virtual void reset(unsigned type);
|
||||
BX_VGA_SMF bx_bool mem_read_handler(unsigned long addr, unsigned long len, void *data, void *param);
|
||||
BX_VGA_SMF bx_bool mem_write_handler(unsigned long addr, unsigned long len, void *data, void *param);
|
||||
virtual Bit8u mem_read(Bit32u addr);
|
||||
virtual void mem_write(Bit32u addr, Bit8u value);
|
||||
BX_VGA_SMF bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
BX_VGA_SMF bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
virtual Bit8u mem_read(bx_phy_address addr);
|
||||
virtual void mem_write(bx_phy_address addr, Bit8u value);
|
||||
virtual void trigger_timer(void *this_ptr);
|
||||
virtual void dump_status(void);
|
||||
virtual void register_state(void);
|
||||
virtual void after_restore_state(void);
|
||||
|
||||
#if BX_SUPPORT_VBE
|
||||
BX_VGA_SMF Bit8u vbe_mem_read(Bit32u addr) BX_CPP_AttrRegparmN(1);
|
||||
BX_VGA_SMF void vbe_mem_write(Bit32u addr, Bit8u value) BX_CPP_AttrRegparmN(2);
|
||||
BX_VGA_SMF Bit8u vbe_mem_read(bx_phy_address addr) BX_CPP_AttrRegparmN(1);
|
||||
BX_VGA_SMF void vbe_mem_write(bx_phy_address addr, Bit8u value) BX_CPP_AttrRegparmN(2);
|
||||
#endif
|
||||
|
||||
virtual void redraw_area(unsigned x0, unsigned y0,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: load32bitOShack.cc,v 1.28 2008-04-17 20:45:00 sshwarts Exp $
|
||||
// $Id: load32bitOShack.cc,v 1.29 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -134,9 +134,8 @@ struct linux_setup_params
|
||||
|
||||
static void bx_load_linux_setup_params(Bit32u initrd_start, Bit32u initrd_size)
|
||||
{
|
||||
BX_MEM_C *mem = BX_MEM(0);
|
||||
struct linux_setup_params *params =
|
||||
(struct linux_setup_params *) mem->get_vector(0x00090000);
|
||||
(struct linux_setup_params *) BX_MEM(0)->get_vector(0x00090000);
|
||||
|
||||
memset(params, '\0', sizeof(*params));
|
||||
|
||||
@ -152,7 +151,7 @@ static void bx_load_linux_setup_params(Bit32u initrd_start, Bit32u initrd_size)
|
||||
params->orig_video_ega_bx = 3;
|
||||
|
||||
/* Memory size (total mem - 1MB, in KB) */
|
||||
params->memory_size_ext = (mem->len/(1024*1024) - 1) * 1024;
|
||||
params->memory_size_ext = (BX_MEM(0)->len/(1024*1024) - 1) * 1024;
|
||||
|
||||
/* Boot parameters */
|
||||
params->loader_type = 1;
|
||||
@ -286,15 +285,14 @@ bx_load_kernel_image(char *path, Bit32u paddr)
|
||||
size = (unsigned long) stat_buf.st_size;
|
||||
page_size = ((Bit32u)size + 0xfff) & ~0xfff;
|
||||
|
||||
BX_MEM_C *mem = BX_MEM(0);
|
||||
if ((paddr + size) > mem->len) {
|
||||
if ((paddr + size) > BX_MEM(0)->len) {
|
||||
BX_INFO(("load_kernel_image: address range > physical memsize!"));
|
||||
BX_EXIT(1);
|
||||
}
|
||||
|
||||
offset = 0;
|
||||
while (size > 0) {
|
||||
ret = read(fd, (bx_ptr_t) mem->get_vector(paddr + offset), size);
|
||||
ret = read(fd, (bx_ptr_t) BX_MEM(0)->get_vector(paddr + offset), size);
|
||||
if (ret <= 0) {
|
||||
BX_INFO(("load_kernel_image: read failed on image"));
|
||||
BX_EXIT(1);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: memory.h,v 1.48 2008-04-17 20:20:43 sshwarts Exp $
|
||||
// $Id: memory.h,v 1.49 2008-04-29 22:14:23 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -48,7 +48,7 @@ class BX_CPU_C;
|
||||
#define BIOS_MASK (BIOSROMSZ-1)
|
||||
#define EXROM_MASK (EXROMSIZE-1)
|
||||
|
||||
typedef bx_bool (*memory_handler_t)(unsigned long addr, unsigned long len, void *data, void *param);
|
||||
typedef bx_bool (*memory_handler_t)(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
|
||||
struct memory_handler_struct {
|
||||
struct memory_handler_struct *next;
|
||||
|
Loading…
Reference in New Issue
Block a user