public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Jes Sorensen <jes@trained-monkey.org>,
	linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
	paulus@samba.org
Subject: Re: [patch] 2.6.1-mm5 compile do not use shared extable code for
Date: Sat, 24 Jan 2004 03:00:34 +0000	[thread overview]
Message-ID: <16401.57298.175645.749468@napali.hpl.hp.com> (raw)
In-Reply-To: <20040120090004.48995f2a.akpm@osdl.org>

>>>>> On Tue, 20 Jan 2004 09:00:04 -0800, Andrew Morton <akpm@osdl.org> said:

  Andrew> Jes Sorensen <jes@trained-monkey.org> wrote:
  >>  The new sort_extable and shares search_extable code doesn't work
  >> on ia64.

  Andrew> hm, OK.  It would be nice if ia64 could use the generic code
  Andrew> at some stage, of course.

How about something along these lines?  If you want to standardize on
a single instruction-address format, I'd strongly favor using the
location-relative addresses used on Alpha and ia64 (it makes no sense
to uses a full 64-bit address for those members).

	--david

=== lib/extable.c 1.3 vs edited ==--- 1.3/lib/extable.c	Tue Jan 20 17:58:55 2004
+++ edited/lib/extable.c	Fri Jan 23 18:10:10 2004
@@ -19,6 +19,12 @@
 extern struct exception_table_entry __stop___ex_table[];
 
 #ifndef ARCH_HAS_SORT_EXTABLE
+
+# ifndef exception_table_entry_insn
+   /* Return the instruction address to which exception tabl entry E applies.  */
+#  define exception_table_entry_insn(e)	((e)->insn)
+# endif
+
 /*
  * The exception table needs to be sorted so that the binary
  * search that we use to find entries in it works properly.
@@ -33,7 +39,7 @@
 	/* insertion sort */
 	for (p = start + 1; p < finish; ++p) {
 		/* start .. p-1 is sorted */
-		if (p[0].insn < p[-1].insn) {
+		if (exception_table_entry_insn(&p[0]) < exception_table_entry_insn(&p[-1])) {
 			/* move element p down to its right place */
 			el = *p;
 			q = p;
@@ -41,7 +47,8 @@
 				/* el comes before q[-1], move q[-1] up one */
 				q[0] = q[-1];
 				--q;
-			} while (q > start && el.insn < q[-1].insn);
+			} while (q > start && (exception_table_entry_insn(&el)
+					       < exception_table_entry_insn(&q[-1])));
 			*q = el;
 		}
 	}
=== include/asm-ia64/uaccess.h 1.16 vs edited ==--- 1.16/include/asm-ia64/uaccess.h	Fri Jan 23 16:43:32 2004
+++ edited/include/asm-ia64/uaccess.h	Fri Jan 23 18:06:38 2004
@@ -283,13 +283,18 @@
 	__su_ret;						\
 })
 
-#define ARCH_HAS_SORT_EXTABLE
 #define ARCH_HAS_SEARCH_EXTABLE
 
 struct exception_table_entry {
-	int addr;	/* gp-relative address of insn this fixup is for */
-	int cont;	/* gp-relative continuation address; if bit 2 is set, r9 is set to 0 */
+	int addr;	/* loc-relative address of insn this fixup is for */
+	int cont;	/* loc-relative continuation address; if bit 2 is set, r9 is set to 0 */
 };
+
+#define exception_table_entry_insn(e)				\
+({								\
+	const struct exception_table_entry *_etei_e = (e);	\
+	(u64) &(_etei_e)->addr + (_etei_e)->addr;		\
+})
 
 extern void handle_exception (struct pt_regs *regs, const struct exception_table_entry *e);
 extern const struct exception_table_entry *search_exception_tables (unsigned long addr);

  reply	other threads:[~2004-01-24  3:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-20 12:23 [patch] 2.6.1-mm5 compile do not use shared extable code for ia64 Jes Sorensen
2004-01-20 17:00 ` [patch] 2.6.1-mm5 compile do not use shared extable code for Andrew Morton
2004-01-24  3:00   ` David Mosberger [this message]
2004-01-24 10:49     ` Paul Mackerras
2004-01-26 23:33       ` David Mosberger
2004-01-27  8:11         ` [patch] 2.6.1-mm5 compile do not use shared extable code for ia64 Jes Sorensen
2004-01-27 17:39           ` David Mosberger
2004-01-27  8:56         ` [patch] 2.6.1-mm5 compile do not use shared extable code for Paul Mackerras
2004-01-27 16:19           ` David Mosberger
2004-01-27 23:49             ` Paul Mackerras
2004-01-28  6:06               ` David Mosberger
2004-01-27 17:54           ` David Mosberger
2004-01-21 18:43 ` [patch] 2.6.1-mm5 compile do not use shared extable code for ia64 David Mosberger

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=16401.57298.175645.749468@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=akpm@osdl.org \
    --cc=jes@trained-monkey.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox