mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-11 05:29:43 +00:00
atirage: increase registers array and add boundary checks.
This commit is contained in:
parent
a5ef814ec4
commit
508ef2eaa9
@ -153,6 +153,11 @@ uint32_t ATIRage::read_reg(uint32_t offset, uint32_t size) {
|
|||||||
read_mem(&this->block_io_regs[offset], size));
|
read_mem(&this->block_io_regs[offset], size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (offset > sizeof(this->block_io_regs)) {
|
||||||
|
LOG_F(WARNING, "ATI Rage: register offset 0x%04X out of bounds!", offset);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
res = read_mem(&this->block_io_regs[offset], size);
|
res = read_mem(&this->block_io_regs[offset], size);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -162,6 +167,11 @@ void ATIRage::write_reg(uint32_t offset, uint32_t value, uint32_t size) {
|
|||||||
uint32_t gpio_val;
|
uint32_t gpio_val;
|
||||||
uint16_t gpio_dir;
|
uint16_t gpio_dir;
|
||||||
|
|
||||||
|
if (offset > sizeof(this->block_io_regs)) {
|
||||||
|
LOG_F(WARNING, "ATI Rage: register offset 0x%04X out of bounds!", offset);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* size-dependent endian conversion */
|
/* size-dependent endian conversion */
|
||||||
write_mem(&this->block_io_regs[offset], value, size);
|
write_mem(&this->block_io_regs[offset], value, size);
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ private:
|
|||||||
// uint32_t atirage_cmdfifo_regs[3]; /* ATI Rage Command FIFO Registers */
|
// uint32_t atirage_cmdfifo_regs[3]; /* ATI Rage Command FIFO Registers */
|
||||||
// uint32_t atirage_datapath_regs[12]; /* ATI Rage Data Path Registers*/
|
// uint32_t atirage_datapath_regs[12]; /* ATI Rage Data Path Registers*/
|
||||||
|
|
||||||
uint8_t block_io_regs[256] = {0};
|
uint8_t block_io_regs[512] = {0};
|
||||||
|
|
||||||
uint8_t pci_cfg[256] = {0}; /* PCI configuration space */
|
uint8_t pci_cfg[256] = {0}; /* PCI configuration space */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user