338 |
|
|
339 |
void pci_write(uint32 addr, uint32 data, int size) |
void pci_write(uint32 addr, uint32 data, int size) |
340 |
{ |
{ |
341 |
if (addr != IO_PCI_PA_START) IO_PCI_TRACE("write (%d) @%08x: %08x (from %08x, %08x)\n", size, addr, data, gCPU.pc, gCPU.lr); |
if (addr != IO_PCI_PA_START) IO_PCI_TRACE("write (%d) @%08x: %08x (from %08x, %08x)\n", size, addr, data, ppc_cpu_get_pc(0), ppc_cpu_get_lr(0)); |
342 |
addr -= IO_PCI_PA_START; |
addr -= IO_PCI_PA_START; |
343 |
switch (addr) { |
switch (addr) { |
344 |
case 0: |
case 0: |
412 |
void pci_read(uint32 addr, uint32 &data, int size) |
void pci_read(uint32 addr, uint32 &data, int size) |
413 |
{ |
{ |
414 |
// SINGLESTEP("usdf\n"); |
// SINGLESTEP("usdf\n"); |
415 |
if (addr != IO_PCI_PA_START) IO_PCI_TRACE("read (%d) @%08x (from %08x, lr: %08x) -> \n", size, addr, gCPU.pc, gCPU.lr); |
if (addr != IO_PCI_PA_START) IO_PCI_TRACE("read (%d) @%08x (from %08x, lr: %08x) -> \n", size, addr, ppc_cpu_get_pc(0), ppc_cpu_get_lr(0)); |
416 |
addr -= IO_PCI_PA_START; |
addr -= IO_PCI_PA_START; |
417 |
switch (addr) { |
switch (addr) { |
418 |
case 0: |
case 0: |
516 |
|
|
517 |
bool pci_write_device(uint32 addr, uint32 data, int size) |
bool pci_write_device(uint32 addr, uint32 data, int size) |
518 |
{ |
{ |
519 |
IO_PCI_TRACE("write DEVICE (%d) @%08x %08x (from %08x, lr: %08x)\n", size, addr, data, gCPU.pc, gCPU.lr); |
IO_PCI_TRACE("write DEVICE (%d) @%08x %08x (from %08x, lr: %08x)\n", size, addr, data, ppc_cpu_get_pc(0), ppc_cpu_get_lr(0)); |
520 |
ObjHandle oh = gPCI_Devices->findFirst(); |
ObjHandle oh = gPCI_Devices->findFirst(); |
521 |
while (oh != InvObjHandle) { |
while (oh != InvObjHandle) { |
522 |
PCI_Device *pd = (PCI_Device*)gPCI_Devices->get(oh); |
PCI_Device *pd = (PCI_Device*)gPCI_Devices->get(oh); |
530 |
|
|
531 |
bool pci_read_device(uint32 addr, uint32 &data, int size) |
bool pci_read_device(uint32 addr, uint32 &data, int size) |
532 |
{ |
{ |
533 |
IO_PCI_TRACE("read DEVICE (%d) @%08x (from %08x, lr: %08x)\n", size, addr, gCPU.pc, gCPU.lr); |
IO_PCI_TRACE("read DEVICE (%d) @%08x (from %08x, lr: %08x)\n", size, addr, ppc_cpu_get_pc(0), ppc_cpu_get_lr(0)); |
534 |
ObjHandle oh = gPCI_Devices->findFirst(); |
ObjHandle oh = gPCI_Devices->findFirst(); |
535 |
while (oh != InvObjHandle) { |
while (oh != InvObjHandle) { |
536 |
PCI_Device *pd = (PCI_Device*)gPCI_Devices->get(oh); |
PCI_Device *pd = (PCI_Device*)gPCI_Devices->get(oh); |