From: Greg Ungerer <gerg@snapgear.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
Miles Bader <miles@gnu.org>,
linux-kernel@vger.kernel.org,
David McCullough <davidm@snapgear.com>
Subject: Re: exception tables in 2.5.55
Date: Mon, 13 Jan 2003 13:49:42 +1000 [thread overview]
Message-ID: <3E223756.3010200@snapgear.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0301121921570.24605-100000@home.transmeta.com>
Hi Linus,
Linus Torvalds wrote:
> On Mon, 13 Jan 2003, Greg Ungerer wrote:
>
>>Tested and working on m68knommu architecture.
>
>
> Why does exceptions have anything to do with no-mmu?
>
> There are exceptions that have nothing to do with MMU's, and a no-mmu
> architecture should still support them. On x86, we have a number of such
> exceptions, for example general protection stuff for wrong values for
> special registers etc.
>
> In other words, not applied.
Good thing I was only after comments then :-)
> Page table exceptions are just the most
> _common_ exception type, but there's absolutely nothing in the mechanism
> that has anything at all to do with MMU-less.
>
> If some archtiecture happens to have an empty exception table, that's
> fine.
OK, heres an alternative patch that fully supports exception tables
for m68knommu (Miles you'll need to do the same for v850).
This is tested on my ColdFire targets...
Regards
Greg
diff -Naur linux-2.5.56/arch/m68knommu/mm/Makefile
linux-2.5.56-uc0/arch/m68knommu/mm/Makefile
--- linux-2.5.56/arch/m68knommu/mm/Makefile Sat Jan 11 06:12:25 2003
+++ linux-2.5.56-uc0/arch/m68knommu/mm/Makefile Mon Jan 13 13:43:22 2003
@@ -2,4 +2,4 @@
# Makefile for the linux m68knommu specific parts of the memory manager.
#
-obj-y += init.o fault.o memory.o kmap.o
+obj-y += init.o fault.o memory.o kmap.o extable.o
diff -Naur linux-2.5.56/arch/m68knommu/mm/extable.c
linux-2.5.56-uc0/arch/m68knommu/mm/extable.c
--- linux-2.5.56/arch/m68knommu/mm/extable.c Thu Jan 1 10:00:00 1970
+++ linux-2.5.56-uc0/arch/m68knommu/mm/extable.c Mon Jan 13 13:43:08
2003@@ -0,0 +1,30 @@
+/*
+ * linux/arch/m68knommu/mm/extable.c
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/spinlock.h>
+#include <asm/uaccess.h>
+
+/* Simple binary search */
+const struct exception_table_entry *
+search_extable(const struct exception_table_entry *first,
+ const struct exception_table_entry *last,
+ unsigned long value)
+{
+ while (first <= last) {
+ const struct exception_table_entry *mid;
+ long diff;
+
+ mid = (last - first) / 2 + first;
+ diff = mid->insn - value;
+ if (diff == 0)
+ return mid;
+ else if (diff < 0)
+ first = mid+1;
+ else
+ last = mid-1;
+ }
+ return NULL;
+}
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: gerg@snapgear.com
SnapGear Pty Ltd PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com
next prev parent reply other threads:[~2003-01-13 3:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-09 6:20 exception tables in 2.5.55 Miles Bader
2003-01-10 8:30 ` Rusty Russell
2003-01-13 3:12 ` Greg Ungerer
2003-01-13 3:24 ` Linus Torvalds
2003-01-13 3:49 ` Greg Ungerer [this message]
2003-01-13 5:21 ` Miles Bader
2003-01-13 5:26 ` Rusty Russell
2003-01-13 21:03 ` Horst von Brand
2003-01-14 8:28 ` Rusty Russell
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=3E223756.3010200@snapgear.com \
--to=gerg@snapgear.com \
--cc=davidm@snapgear.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miles@gnu.org \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@transmeta.com \
/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