From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoBCV-0007J6-Bc for qemu-devel@nongnu.org; Tue, 02 Aug 2011 05:23:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoBCU-0000CI-Ct for qemu-devel@nongnu.org; Tue, 02 Aug 2011 05:23:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoBCU-0000CE-4k for qemu-devel@nongnu.org; Tue, 02 Aug 2011 05:23:46 -0400 Message-ID: <4E37C21D.4050504@redhat.com> Date: Tue, 02 Aug 2011 12:23:41 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1312135082-31985-1-git-send-email-avi@redhat.com> <4E37194C.4010802@twiddle.net> In-Reply-To: <4E37194C.4010802@twiddle.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Alpha system patchset updated for Memory API, batch 2: PCI devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On 08/02/2011 12:23 AM, Richard Henderson wrote: > + > +/* PCI IO reads/writes, to byte-word addressable memory. */ > +/* ??? Doesn't handle multiple PCI busses. */ > + > +static uint64_t bw_io_read(void *opaque, target_phys_addr_t addr, unsigned size) > +{ > + switch (size) { > + case 1: > + return cpu_inb(addr); > + case 2: > + return cpu_inw(addr); > + case 4: > + return cpu_inl(addr); > + } > + abort(); > +} > + > +static void bw_io_write(void *opaque, target_phys_addr_t addr, > + uint64_t val, unsigned size) > +{ > + switch (size) { > + case 1: > + cpu_outb(addr, val); > + break; > + case 2: > + cpu_outw(addr, val); > + break; > + case 4: > + cpu_outl(addr, val); > + break; > + default: > + abort(); > + } > +} > + > +const MemoryRegionOps alpha_pci_bw_io_ops = { > + .read = bw_io_read, > + .write = bw_io_write, > + .endianness = DEVICE_LITTLE_ENDIAN, > + .impl = { > + .min_access_size = 1, > + .max_access_size = 4, > + }, > +}; > + The plan for this (and all mmio-mapped PCI_ADDRESS_SPACE_IO regions) is to map the I/O address space as a subregion of the PCI host bridge, eliminating this thunk. -- error compiling committee.c: too many arguments to function