From 82ed1ac9c2628d72c6699fae4448b72599df2f51 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Mon, 19 Sep 2016 18:28:25 -0400 Subject: ia64: move ia64_done_with_exception out of asm/uaccess.h Move ia64_done_with_exception out of asm/uaccess.h (which is widely used) and into asm/exception.h (like ARM has) and then ensure the few callers of it include this new header. Most of the other C content in asm files is implemented in macro form. So we do that conversion at the same time as the move. There are two C exception prototypes that move along with the macro. One of them will become redundant when we switch over to using the instead of header in a subsequent commit. Also relocate a couple of the automated asm --> linux uaccess conversions to preserve the linux and asm independent grouping, since we are in the file at that location anyway. Cc: Tony Luck Cc: Fenghua Yu Cc: linux-ia64@vger.kernel.org Signed-off-by: Paul Gortmaker --- arch/ia64/include/asm/exception.h | 36 ++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/uaccess.h | 15 --------------- 2 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 arch/ia64/include/asm/exception.h (limited to 'arch/ia64/include') diff --git a/arch/ia64/include/asm/exception.h b/arch/ia64/include/asm/exception.h new file mode 100644 index 000000000000..d90236090e8c --- /dev/null +++ b/arch/ia64/include/asm/exception.h @@ -0,0 +1,36 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef __ASM_EXCEPTION_H +#define __ASM_EXCEPTION_H + +struct pt_regs; +struct exception_table_entry; + +extern void ia64_handle_exception(struct pt_regs *regs, + const struct exception_table_entry *e); +extern const struct exception_table_entry *search_exception_tables(unsigned long addr); + +#define ia64_done_with_exception(regs) \ +({ \ + int __ex_ret = 0; \ + const struct exception_table_entry *e; \ + e = search_exception_tables((regs)->cr_iip + ia64_psr(regs)->ri); \ + if (e) { \ + ia64_handle_exception(regs, e); \ + __ex_ret = 1; \ + } \ + __ex_ret; \ +}) + +#endif /* __ASM_EXCEPTION_H */ diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h index bfe13196f770..471044be2a3b 100644 --- a/arch/ia64/include/asm/uaccess.h +++ b/arch/ia64/include/asm/uaccess.h @@ -353,21 +353,6 @@ struct exception_table_entry { int fixup; /* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */ }; -extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e); -extern const struct exception_table_entry *search_exception_tables (unsigned long addr); - -static inline int -ia64_done_with_exception (struct pt_regs *regs) -{ - const struct exception_table_entry *e; - e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri); - if (e) { - ia64_handle_exception(regs, e); - return 1; - } - return 0; -} - #define ARCH_HAS_TRANSLATE_MEM_PTR 1 static __inline__ void * xlate_dev_mem_ptr(phys_addr_t p) -- cgit From e7088170e3a788bca50287821a5a8417c016c231 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sat, 23 Jul 2016 14:01:45 -0400 Subject: ia64: ensure exception table search users include extable.h We start with a delete of a duplicate prototype in asm/exception.h that no longer needs to exist, as it duplicates content in extable.h and since that header is so small, there is no point trying to avoid using it. Then we make sure anyone using search_exception_tables directly or via the ia64_done_with_exception macro has included extable.h In the process, we remove an include of moduleloader.h that was apparently not really required; it would have been fetching in module.h and hence the previous location of the exception search function prototypes, but we need not rely on that anymore. Cc: Tony Luck Cc: Fenghua Yu Cc: linux-ia64@vger.kernel.org Signed-off-by: Paul Gortmaker --- arch/ia64/include/asm/exception.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/ia64/include') diff --git a/arch/ia64/include/asm/exception.h b/arch/ia64/include/asm/exception.h index d90236090e8c..6bb246dcdaeb 100644 --- a/arch/ia64/include/asm/exception.h +++ b/arch/ia64/include/asm/exception.h @@ -19,7 +19,6 @@ struct exception_table_entry; extern void ia64_handle_exception(struct pt_regs *regs, const struct exception_table_entry *e); -extern const struct exception_table_entry *search_exception_tables(unsigned long addr); #define ia64_done_with_exception(regs) \ ({ \ -- cgit