From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Re: [patch] 2.4.18-ia64-020226 generalize exception recovery
Date: Thu, 14 Mar 2002 06:46:31 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590701905273@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590701905271@msgid-missing>
>>>>> On Thu, 14 Mar 2002 16:51:04 +1100, Keith Owens <kaos@sgi.com> said:
Keith> On Wed, 13 Mar 2002 19:13:44 -0800,
Keith> David Mosberger <davidm@napali.hpl.hp.com> wrote:
>> I'm OK with the first macro (rename it to SEARCH_EXCEPTION_TABLE,
>> though), but the HANDLE_EXCEPTION() macro is ugly: it looks like a
>> statement, when in fact it's a conditional return.
Keith> Take 2.
I applied the attached patch, which is the same as yours except for
renaming HANDLE_EXCEPTION() to done_with_exception(). I hope this
works for you.
--david
=== arch/ia64/kernel/unaligned.c 1.5 vs edited ==--- 1.5/arch/ia64/kernel/unaligned.c Fri Mar 8 18:11:40 2002
+++ edited/arch/ia64/kernel/unaligned.c Wed Mar 13 22:37:11 2002
@@ -1305,11 +1305,7 @@
* handler into reading an arbitrary kernel addresses...
*/
if (!user_mode(regs)) {
-#ifdef GAS_HAS_LOCAL_TAGS
- fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri);
-#else
- fix = search_exception_table(regs->cr_iip);
-#endif
+ fix = SEARCH_EXCEPTION_TABLE(regs);
}
if (user_mode(regs) || fix.cont) {
if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0)
=== arch/ia64/mm/fault.c 1.5 vs edited ==--- 1.5/arch/ia64/mm/fault.c Fri Mar 8 18:11:40 2002
+++ edited/arch/ia64/mm/fault.c Wed Mar 13 22:43:00 2002
@@ -49,7 +49,6 @@
int signal = SIGSEGV, code = SEGV_MAPERR;
struct vm_area_struct *vma, *prev_vma;
struct mm_struct *mm = current->mm;
- struct exception_fixup fix;
struct siginfo si;
unsigned long mask;
@@ -167,15 +166,8 @@
return;
}
-#ifdef GAS_HAS_LOCAL_TAGS
- fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri);
-#else
- fix = search_exception_table(regs->cr_iip);
-#endif
- if (fix.cont) {
- handle_exception(regs, fix);
+ if (done_with_exception(regs))
return;
- }
/*
* Oops. The kernel tried to access some bad page. We'll have to terminate things
=== include/asm-ia64/uaccess.h 1.3 vs edited ==--- 1.3/include/asm-ia64/uaccess.h Fri Mar 8 18:11:40 2002
+++ edited/include/asm-ia64/uaccess.h Wed Mar 13 22:43:05 2002
@@ -320,4 +320,22 @@
extern struct exception_fixup search_exception_table (unsigned long addr);
extern void handle_exception (struct pt_regs *regs, struct exception_fixup fixup);
+#ifdef GAS_HAS_LOCAL_TAGS
+#define SEARCH_EXCEPTION_TABLE(regs) search_exception_table(regs->cr_iip + ia64_psr(regs)->ri);
+#else
+#define SEARCH_EXCEPTION_TABLE(regs) search_exception_table(regs->cr_iip);
+#endif
+
+static inline int
+done_with_exception (struct pt_regs *regs)
+{
+ struct exception_fixup fix;
+ fix = SEARCH_EXCEPTION_TABLE(regs);
+ if (fix.cont) {
+ handle_exception(regs, fix);
+ return 1;
+ }
+ return 0;
+}
+
#endif /* _ASM_IA64_UACCESS_H */
prev parent reply other threads:[~2002-03-14 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-14 3:13 [Linux-ia64] Re: [patch] 2.4.18-ia64-020226 generalize exception recovery David Mosberger
2002-03-14 5:51 ` Keith Owens
2002-03-14 6:46 ` David Mosberger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590701905273@msgid-missing \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.