[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 13/21] target-arm: Use dedicated CPU state fi
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v4 13/21] target-arm: Use dedicated CPU state fields for ARM946 access bit registers |
Date: |
Mon, 17 Mar 2014 13:03:14 +0000 |
On 17 March 2014 05:20, Peter Crosthwaite <address@hidden> wrote:
> On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell <address@hidden> wrote:
>> static const ARMCPRegInfo pmsav5_cp_reginfo[] = {
>> { .name = "DATA_AP", .cp = 15, .crn = 5, .crm = 0, .opc1 = 0, .opc2 = 0,
>> .access = PL1_RW, .type = ARM_CP_NO_MIGRATE,
>> - .fieldoffset = offsetof(CPUARMState, cp15.c5_data), .resetvalue = 0,
>> + .fieldoffset = offsetof(CPUARMState, cp15.pmsav5_data_ap),
>> + .resetvalue = 0,
>
> I know its just motion of existing code, but what's the policy on zero
> resets? Can we leave them out for brevity? Checkpatch complains when a
> global is explictly 0 initialized, so it seems sane that the same rule
> applies to individual fields (just checkpatch probably has hard time
> figuring this one out).
The semantics allow you to leave out .resetvalue if it is 0; I think
generally when I've written reginfo definitions I've tended to put
in the .resetvalue as an indication of "I know this reginfo needs
a reset value and it is zero" as opposed to "I didn't think about
reset when I wrote this".
We definitely don't want checkpatch to warn about explicit zero
initializers in structs like this, otherwise we wouldn't be
able to say ".crm = 0, .opc1 = 0, .opc2 = 0", which would be
less comprehensible than writing them out explicitly I think.
thanks
-- PMM
- [Qemu-devel] [PATCH v4 15/21] target-arm: Add AArch64 ELR_EL1 register., (continued)
- [Qemu-devel] [PATCH v4 15/21] target-arm: Add AArch64 ELR_EL1 register., Peter Maydell, 2014/03/06
- [Qemu-devel] [PATCH v4 02/21] target-arm: Implement AArch64 DAIF system register, Peter Maydell, 2014/03/06
- [Qemu-devel] [PATCH v4 05/21] target-arm: Add support for generating exceptions with syndrome information, Peter Maydell, 2014/03/06
- [Qemu-devel] [PATCH v4 07/21] target-arm: A64: Correctly fault FP/Neon if CPACR.FPEN set, Peter Maydell, 2014/03/06
- [Qemu-devel] [PATCH v4 13/21] target-arm: Use dedicated CPU state fields for ARM946 access bit registers, Peter Maydell, 2014/03/06
- [Qemu-devel] [PATCH v4 08/21] target-arm: A64: Add assertion that FP access was checked, Peter Maydell, 2014/03/06
- Re: [Qemu-devel] [PATCH v4 00/21] AArch64 system emulation (boots a kernel!), Xuebing Wang, 2014/03/06