[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/20] acpi: switch smbus to memory api
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 15/20] acpi: switch smbus to memory api |
Date: |
Tue, 27 Nov 2012 09:47:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121116 Thunderbird/10.0.11 |
On 11/26/12 16:18, Andreas Färber wrote:
> Am 23.11.2012 16:48, schrieb Gerd Hoffmann:
>> diff --git a/hw/pm_smbus.c b/hw/pm_smbus.c
>> index 5d6046d..ea1380c 100644
>> --- a/hw/pm_smbus.c
>> +++ b/hw/pm_smbus.c
> [...]
>> @@ -170,7 +170,16 @@ uint32_t smb_ioport_readb(void *opaque, uint32_t addr)
>> return val;
>> }
>>
>> +static const MemoryRegionOps pm_smbus_ops = {
>> + .read = smb_ioport_readb,
>> + .write = smb_ioport_writeb,
>> + .valid.min_access_size = 1,
>> + .valid.max_access_size = 1,
>> + .endianness = DEVICE_LITTLE_ENDIAN,
>> +};
>
> I notice that in comparison to Julien's patch, you are setting .valid
> here where he used .impl.
Setting .valid matches previous behavior (only byte handlers registered).
I'm not fully sure what the defaults for .valid are in case only .impl
is specified. I usually either set .valid only or explicitly specify
both if I want the memory api split dword writes into bytes for me.
> Also a generic C question: When using C99-style struct initializers as
> for the MemoryRegionOps, I understand that the fields not explicitly
> assigned are zero-initialized. Does that also apply to .foo.bar = baz
> notation or would it be advisable to use nested .foo = { .bar = baz }?
As far I know the whole (outer) struct is zero-initialized.
cheers,
Gerd
- [Qemu-devel] [PATCH 06/20] apci: switch cnt to memory api, (continued)
- [Qemu-devel] [PATCH 06/20] apci: switch cnt to memory api, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 18/20] acpi: remove acpi_gpe_blk, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 20/20] q35: update lpc pci config space according to configured devices, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 11/20] acpi: cleanup vt82c686 memory region, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 09/20] apci: switch evt to memory api [ich9], Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 14/20] acpi: cleanup ich9 memory region, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 10/20] acpi: cleanup piix4 memory region, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 04/20] apci: switch timer to memory api, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 15/20] acpi: switch smbus to memory api, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 19/20] apci: switch piix4 pci hotplug to memory api, Gerd Hoffmann, 2012/11/23
- [Qemu-devel] [PATCH 13/20] apci: switch ich9 smi to memory api, Gerd Hoffmann, 2012/11/23