On 31/08/2016 15:48, Денис Дмитриев wrote: > uint64_t buslogicReadOutgoingMailbox(BuslogicState *s, BUSLOGICTASKSTATE > *TaskState) > { > uint64_t GCMailbox; > Mailbox24 Mbx24; > Mbx24.uCmdState = 0; > PCIDevice *pci_dev = PCI_DEVICE(s); > if (s->fMbxIs24Bit) > { > //try to calculate mailbox address > GCMailbox = s->GCPhysAddrMailboxOutgoingBase + > (s->uMailboxOutgoingPositionCurrent * sizeof(Mailbox24)); > //try to read mailbox > pci_dma_read(pci_dev, GCMailbox, &Mbx24, sizeof(Mailbox24)); > //after that i have empty buffer > TaskState->MailboxGuest.u32PhysAddrCCB = > ADDR_TO_U32(Mbx24.aPhysAddrCCB); > TaskState->MailboxGuest.u.out.uActionCode = Mbx24.uCmdState; > } > else > { > GCMailbox = s->GCPhysAddrMailboxOutgoingBase + > (s->uMailboxOutgoingPositionCurrent * sizeof(Mailbox32)); > pci_dma_read(pci_dev, GCMailbox, &TaskState->MailboxGuest, > sizeof(Mailbox32)); > } > return GCMailbox; > }
This seems okay, so I am afraid you'll have to debug it. :( That said, this looks very much like VirtualBox code. Do not use it if you want to contribute code to QEMU, because QEMU does not accept GPLv2-only code. We already had to rewrite the lsisas1068 device model instead of using the one that was contributed a few years ago. Paolo