qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/9] softmmu: provide softmmu access type enu


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 2/9] softmmu: provide softmmu access type enum
Date: Tue, 8 Jul 2014 14:00:19 +0100

On 8 July 2014 08:57, Leon Alrae <address@hidden> wrote:
> New MIPS features depend on the access type and enum is more convenient than
> using the numbers directly.
>
Mmm, I've thought for a while it would be better to have this
be an enum, but never got round to it.

> Signed-off-by: Leon Alrae <address@hidden>
> ---
>  include/exec/cpu-common.h |    6 ++++++
>  softmmu_template.h        |   26 ++++++++++++++++----------
>  2 files changed, 22 insertions(+), 10 deletions(-)
>
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index e3ec4c8..1c3171a 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -26,6 +26,12 @@ typedef struct CPUListState {
>      FILE *file;
>  } CPUListState;
>
> +enum mmu_access_type {

CODING_STYLE says enum names should be CamelCase.
I think you also want this to be a typedef.

> +    MMU_DATA_LOAD  = 0,
> +    MMU_DATA_STORE = 1,
> +    MMU_INST_FETCH = 2
> +};
> +

We should probably also chase through and update the
prototypes of functions like tlb_fill() and cpu_unaligned_access()
and so on to take this enum type rather than int. (I
suspect there's a lot of those running into different
targets so it might need doing over multiple patches.)

thanks
-- PMM



reply via email to

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