summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungwoo Yang <hyungwoo.yang@intel.com>2019-05-14 08:23:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-16 09:04:39 -0700
commit0ef828836e412f5acdccbbe6346e6b95841fce3c (patch)
tree997c429c0e768c01084cbbcc8e514f67859e9b16
parent45434aed20e695e08fcbb3f74c43e03f6fa19bf2 (diff)
downloadchrome-ec-0ef828836e412f5acdccbbe6346e6b95841fce3c.tar.gz
ish: fix reading current interrupt vector
When we switched to using REG32 macros for registers, we made a mistake in using address of LAPIC's ISR. The original CL that changed this was CL:1586458 BRANCH=none BUG=none TEST=Tested on Arcada platform Change-Id: Ia64806a4cb0fa5d150b41407b0f6c9f34f0168e8 Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1611746 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--chip/ish/registers.h3
-rw-r--r--core/minute-ia/interrupts.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/chip/ish/registers.h b/chip/ish/registers.h
index eb028b403d..1ffd5fad75 100644
--- a/chip/ish/registers.h
+++ b/chip/ish/registers.h
@@ -321,7 +321,8 @@ enum ish_i2c_port {
/* Bare address needed for assembler (ISH_LAPIC_BASE + 0xB0) */
#define LAPIC_EOI_REG_ADDR 0xFEE000B0
#define LAPIC_EOI_REG REG32(LAPIC_EOI_REG_ADDR)
-#define LAPIC_ISR_REG REG32(ISH_LAPIC_BASE + 0x170)
+#define LAPIC_ISR_REG REG32(ISH_LAPIC_BASE + 0x100)
+#define LAPIC_ISR_LAST_REG REG32(ISH_LAPIC_BASE + 0x170)
#define LAPIC_IRR_REG REG32(ISH_LAPIC_BASE + 0x200)
#define LAPIC_ESR_REG REG32(ISH_LAPIC_BASE + 0x280)
#define LAPIC_ERR_RECV_ILLEGAL BIT(6)
diff --git a/core/minute-ia/interrupts.c b/core/minute-ia/interrupts.c
index 8fc5b2f9e9..a4a3569c22 100644
--- a/core/minute-ia/interrupts.c
+++ b/core/minute-ia/interrupts.c
@@ -233,11 +233,11 @@ uint32_t get_current_interrupt_vector(void)
uint32_t vec;
/* In service register */
- uint32_t *ioapic_icr_last = (uint32_t *)LAPIC_ISR_REG;
+ volatile uint32_t *ioapic_isr_last = &LAPIC_ISR_LAST_REG;
/* Scan ISRs from highest priority */
- for (i = 7; i >= 0; i--, ioapic_icr_last -= 4) {
- vec = *ioapic_icr_last;
+ for (i = 7; i >= 0; i--, ioapic_isr_last -= 4) {
+ vec = *ioapic_isr_last;
if (vec) {
return (32 * i) + __fls(vec);
}