Ticket #2460: 0001-Fixes-GIC_ID_TO_TWO_BITS_REG_OFFSET-macro-in-arm-gic.patch

File 0001-Fixes-GIC_ID_TO_TWO_BITS_REG_OFFSET-macro-in-arm-gic.patch, 1.0 KB (added by Adit, on Nov 11, 2015 at 4:42:44 AM)
  • c/src/lib/libbsp/arm/shared/include/arm-gic.h

    From a017c9219c6888d575d9861821570a5d7d27a381 Mon Sep 17 00:00:00 2001
    From: Adit Sahasrabudhe <asahasra@fb.com>
    Date: Tue, 10 Nov 2015 16:46:23 -0800
    Subject: [PATCH] Fixes GIC_ID_TO_TWO_BITS_REG_OFFSET macro in arm-gic.h
    
    This commit fixes an error in bit arithmetic for a macro
    that is used for configuring the ARM Generic Interrupt Controller.
    Close #2460.
    ---
     c/src/lib/libbsp/arm/shared/include/arm-gic.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/c/src/lib/libbsp/arm/shared/include/arm-gic.h b/c/src/lib/libbsp/arm/shared/include/arm-gic.h
    index 942db85..ab58409 100644
    a b extern "C" { 
    4343#define GIC_ID_TO_ONE_BIT_REG_BIT(id) (1U << ((id) & 0x1fU))
    4444
    4545#define GIC_ID_TO_TWO_BITS_REG_INDEX(id) ((id) >> 4)
    46 #define GIC_ID_TO_TWO_BITS_REG_OFFSET(id) ((id) & 0xfU)
     46#define GIC_ID_TO_TWO_BITS_REG_OFFSET(id) (((id) & 0xfU) << 1)
    4747
    4848static inline bool gic_id_is_enabled(volatile gic_dist *dist, uint32_t id)
    4949{