From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Subject: Re: [kvm-ppc-devel] [PATCH 1 of 3] Move x86 kvmcallback structure to kvmctl-x86.h header Date: Sun, 28 Oct 2007 22:14:20 -0500 Message-ID: <1193627660.17368.55.camel@basalt> References: <3bf072e498768885ab96.1193618567@thinkpad> <4725415B.4020601@codemonkey.ws> Reply-To: Hollis Blanchard Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Jerone Young To: Anthony Liguori Return-path: In-Reply-To: <4725415B.4020601-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Sun, 2007-10-28 at 21:11 -0500, Anthony Liguori wrote: > > int (*io_write)(void *opaque, int as, uint64_t addr, uint64_t data, > int size); > > Where as is a #define representing the address space (on x86, there is > the PIO and MMIO address spaces, on PPC, there is just MMIO). So the implementation would look something like this: int io_write(void *opaque, int as, uint64_t addr, uint64_t data, int size) { io_handler_t cb; switch (as) { case MMIO: cb = io_table_lookup(&mmio_table, ...) break; #ifdef HAS_PIO case PIO: cb = io_table_lookup(&pio_table, ...) break; #endif #ifdef HAS_DCR case DCR: cb = io_table_lookup(&dcr_table, ...) break; #endif default: cb = NULL; } if (cb) return cb(...); printk("error"); return -EINVAL; } Sounds fine to me. -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/