From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfPtv-0002HZ-3X for qemu-devel@nongnu.org; Thu, 01 Sep 2016 07:11:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfPtq-0007Pu-Rt for qemu-devel@nongnu.org; Thu, 01 Sep 2016 07:11:17 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:38843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfPtq-0007Pq-Kq for qemu-devel@nongnu.org; Thu, 01 Sep 2016 07:11:14 -0400 Received: by mail-wm0-x236.google.com with SMTP id 1so88489191wmz.1 for ; Thu, 01 Sep 2016 04:11:14 -0700 (PDT) Sender: Paolo Bonzini References: From: Paolo Bonzini Message-ID: <6961327b-897d-0c01-102f-22f299e0362c@redhat.com> Date: Thu, 1 Sep 2016 13:11:06 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] Implementation of BusLogic SCSI host adapter (BT-958) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?0JTQtdC90LjRgSDQlNC80LjRgtGA0LjQtdCy?= , qemu-devel@nongnu.org Cc: Pavel Dovgaluk 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