[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Implementation of BusLogic SCSI host adapter (BT-958)
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Implementation of BusLogic SCSI host adapter (BT-958) |
Date: |
Thu, 1 Sep 2016 13:11:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
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
- Re: [Qemu-devel] Implementation of BusLogic SCSI host adapter (BT-958),
Paolo Bonzini <=