Re: [PATCH] Centralize i386 Constants

From: Roland Dreier
Date: Mon Aug 16 2004 - 12:28:09 EST


Rusty> __FIXADDR_TOP and PAGE_OFFSET are hardcoded in various
Rusty> places. I had to change it to run the kernel under
Rusty> qemu-fast, so I wanted to centralize them.

I like this patch -- I recently built a kernel with PAGE_OFFSET
0xb0000000 to avoid highmem on my box with 1G of RAM, based on recent
discussion, and I made the same change to vmlinux.lds.S (although
since <asm-i386/thread_info.h> includes <asm-i386/page.h>, I didn't
bother adding the "#include <asm/page.h>" line).

In any case it seems there is at least one more place where 0xc0000000
is hardcoded in arch/i386. The patch below uses PAGE_OFFSET instead
of 0xc0000000 in doublefault.c's ptr_ok() macro.

- Roland

Signed-off-by: Roland Dreier <roland@xxxxxxxxxxx>

--- linux-2.6.8.1.orig/arch/i386/kernel/doublefault.c 2004-08-14 03:54:50.000000000 -0700
+++ linux-2.6.8.1/arch/i386/kernel/doublefault.c 2004-08-14 10:44:55.000000000 -0700
@@ -13,7 +13,7 @@
static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE];
#define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE)

-#define ptr_ok(x) ((x) > 0xc0000000 && (x) < 0xc1000000)
+#define ptr_ok(x) ((x) > PAGE_OFFSET && (x) < PAGE_OFFSET + 0x1000000)

static void doublefault_fn(void)
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/