qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: pci_default_config_write() clean up


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: pci_default_config_write() clean up
Date: Fri, 8 May 2009 17:21:00 +0300
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, May 08, 2009 at 12:43:01PM +0900, Isaku Yamahata wrote:
> 
> Here is the ver2 pci_default_config_write() clean up
> following to comments.
> 
> I didn't use per-dword callback. Although special cycles
> specifies dword address, qemu emulation is not bus level,
> but instruction level.
> 
> Maybe callback function signature might be arguable.
> But at this moment there is no real user, so I'd like
> to postpone its argument until real user appears.
> 
> thanks,
> 
> >From 491830066972faf3f87ba170273c97b7f90a1ea3 Mon Sep 17 00:00:00 2001
> From: Isaku Yamahata <address@hidden>
> Date: Thu, 7 May 2009 16:14:04 +0900
> Subject: [PATCH] pci: pci_default_config_write() clean up.
> 
> clean up of pci_default_config_write() by table driven code.
> 
> Changes v2
> - converted static table into dynamic initialization.
> - changed callback signature.
> 
> Cc: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Isaku Yamahata <address@hidden>
> @@ -236,11 +239,122 @@ int pci_assign_devaddr(const char *addr, int *domp, 
> int *busp, unsigned *slotp)
>      return pci_parse_devaddr(devaddr, domp, busp, slotp);
>  }
>  
> +static void pci_conf_init(struct PCIConfigReg *config_regs,
> +                          uint32_t addr, pci_config_written_t callback,
> +                          uint32_t wmask, int len)
> +{
> +    int i;
> +
> +    for (i = 0; i < len; i++) {
> +        config_regs[addr].wmask = wmask & 0xff;
> +        config_regs[addr].shift = 8 * i;
> +        config_regs[addr].callback = callback;
> +
> +        wmask >>= 8;
> +    }
> +}

Could you please post an incremental patch,
that adds callbacks, on top of mine adding masks?

-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]