From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [PATCH 05/18] arm/arm64: processor.[ch] cleanups Date: Sun, 1 Feb 2015 19:34:33 +0100 Message-ID: <1422815686-24591-6-git-send-email-drjones@redhat.com> References: <1422815686-24591-1-git-send-email-drjones@redhat.com> Cc: christoffer.dall@linaro.org, pbonzini@redhat.com To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37057 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753681AbbBASfC (ORCPT ); Sun, 1 Feb 2015 13:35:02 -0500 In-Reply-To: <1422815686-24591-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Add 'const' to a few global arrays that are constant. Also, no need for default_vector_handler to be static. unittests may want to reset vector handlers to it. Signed-off-by: Andrew Jones --- lib/arm/processor.c | 2 +- lib/arm64/asm/processor.h | 2 ++ lib/arm64/processor.c | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/arm/processor.c b/lib/arm/processor.c index f8bd94cbb8bc6..5ad999c6b378b 100644 --- a/lib/arm/processor.c +++ b/lib/arm/processor.c @@ -20,7 +20,7 @@ static const char *processor_modes[] = { "UK12_32", "UK13_32", "UK14_32", "SYS_32" }; -static char *vector_names[] = { +static const char *vector_names[] = { "rst", "und", "svc", "pabt", "dabt", "addrexcptn", "irq", "fiq" }; diff --git a/lib/arm64/asm/processor.h b/lib/arm64/asm/processor.h index f73ffb5e4bc95..a33f70afb3a3e 100644 --- a/lib/arm64/asm/processor.h +++ b/lib/arm64/asm/processor.h @@ -47,6 +47,8 @@ typedef void (*exception_fn)(struct pt_regs *regs, unsigned int esr); extern void install_vector_handler(enum vector v, vector_fn fn); extern void install_exception_handler(enum vector v, unsigned int ec, exception_fn fn); +extern void default_vector_handler(enum vector v, struct pt_regs *regs, + unsigned int esr); extern void show_regs(struct pt_regs *regs); extern void *get_sp(void); diff --git a/lib/arm64/processor.c b/lib/arm64/processor.c index 7dc0b2e026134..efc78353d7ec0 100644 --- a/lib/arm64/processor.c +++ b/lib/arm64/processor.c @@ -10,7 +10,7 @@ #include #include -static char *vector_names[] = { +static const char *vector_names[] = { "el1t_sync", "el1t_irq", "el1t_fiq", @@ -29,7 +29,7 @@ static char *vector_names[] = { "el0_error_32", }; -static char *ec_names[EC_MAX] = { +static const char *ec_names[EC_MAX] = { [ESR_EL1_EC_UNKNOWN] = "UNKNOWN", [ESR_EL1_EC_WFI] = "WFI", [ESR_EL1_EC_CP15_32] = "CP15_32", @@ -142,8 +142,8 @@ void install_exception_handler(enum vector v, unsigned int ec, exception_fn fn) exception_handlers[v][ec] = fn; } -static void default_vector_handler(enum vector v, struct pt_regs *regs, - unsigned int esr) +void default_vector_handler(enum vector v, struct pt_regs *regs, + unsigned int esr) { unsigned int ec = esr >> ESR_EL1_EC_SHIFT; -- 1.9.3