qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [PATCH 10/16] hw/dma/pl080: Allow use as embedded-struct


From: Peter Maydell
Subject: Re: [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



reply via email to

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