[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-arm] [PATCH 10/16] hw/dma/pl080: Allow use as emb
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [Qemu-arm] [PATCH 10/16] hw/dma/pl080: Allow use as embedded-struct device |
Date: |
Fri, 10 Aug 2018 10:03:52 +0100 |
On 10 August 2018 at 06:27, Philippe Mathieu-Daudé <address@hidden> wrote:
> On 08/10/2018 02:18 AM, Philippe Mathieu-Daudé wrote:
>> On 08/09/2018 10:01 AM, Peter Maydell wrote:
>>> Create a new include file for the pl081's device struct,
>>> type macros, etc, so that it can be instantiated using
>>> the "embedded struct" coding style.
> [...]
>>> +#ifndef HW_DMA_PL080_H
>>> +#define HW_DMA_PL080_H
>>> +
>>> +#include "hw/sysbus.h"
>>> +
>>> +#define PL080_MAX_CHANNELS 8
>>> +
>>> +typedef struct {
>>> + uint32_t src;
>>> + uint32_t dest;
>>> + uint32_t lli;
>>> + uint32_t ctrl;
>>> + uint32_t conf;
>>> +} pl080_channel;
>>> +
>>> +#define TYPE_PL080 "pl080"
>>> +#define TYPE_PL081 "pl081"
>>> +#define PL080(obj) OBJECT_CHECK(PL080State, (obj), TYPE_PL080)
>>
>> The PL080() macro can stay in the source.
>
> Oh this respect the "coding style" indeed.
Yes.
> Can you add the PL081() companion? Thanks.
No, because the PL081 has no separate data structure
and there is no PL081State* for a PL081() macro to
be casting to.
thanks
-- PMM
- [Qemu-devel] [PATCH 00/16] arm: Implement MPS2 watchdogs and DMA, Peter Maydell, 2018/08/09
- [Qemu-devel] [PATCH 15/16] hw/dma/pl080: Remove hw_error() if DMA is enabled, Peter Maydell, 2018/08/09
- [Qemu-devel] [PATCH 13/16] hw/dma/pl080: Provide device reset function, Peter Maydell, 2018/08/09
- [Qemu-devel] [PATCH 04/16] hw/arm/iotkit: Wire up the S32KTIMER, Peter Maydell, 2018/08/09
- [Qemu-devel] [PATCH 03/16] hw/arm/iotkit: Wire up the watchdogs, Peter Maydell, 2018/08/09
- [Qemu-devel] [PATCH 02/16] nvic: Expose NMI line, Peter Maydell, 2018/08/09