• Paul Burton's avatar
    MIPS: CM: Specify register size when generating accessors · b025d518
    Paul Burton authored
    Some CM registers are always 32 bits, or at least only use bits in the
    lower 32 bits of the register. For these registers it is wasteful for us
    to generate accessors which bother to check mips_cm_is64 & perform 64
    bit accesses.
    
    This patch modifies the accessor generation to take into account the
    size of the register, and for 32 bit registers we generate accessors
    which only ever perform 32 bit accesses. For 64 bit registers we either
    perform a 64 bit access or two 32 bit accesses, depending upon the value
    of mips_cm_is64. Doing this saves us ~1.5KiB of code in a generic 64r6el
    kernel, and perhaps more importantly simplifies various code paths.
    
    This removes the read64_gcr_* accessors, so mips_cm_error_report() is
    modified to stop using them & instead use the regular read_gcr_*
    accessors which will return 64 bit values from the 64 bit registers.
    
    The new accessor macros are placed in asm/mips-cps.h such that they can
    be shared by CPC & GIC code in later patches.
    Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/17000/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    b025d518
mips-cm.h 15.4 KB