[PATCH -tip] x86: apic_32.c - add lapic resource

From: Cyrill Gorcunov
Date: Tue Jul 01 2008 - 13:44:50 EST


Add lapic resource into kernel resource map and mark it as busy

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
CC: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
---

I've started to unify apic code but it will require a huge
amount of time and will not be done soon but this patch is usefull
even now I think.

Any comments are _quite__welcome_.

The patch is on top of
commit ccbb46cbe2993e6b23244b53a5d2791c71d134f5
Author: Ingo Molnar <mingo@xxxxxxx>
Date: Fri Jun 27 19:55:22 2008 +0200

stacktrace: export print_stack_trace and save_stack_trace

Index: linux-2.6.git/arch/x86/kernel/apic_32.c
====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_32.c 2008-07-01 20:30:10.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_32.c 2008-07-01 21:27:35.000000000 +0400
@@ -81,6 +81,11 @@ int pic_mode;
/* Have we found an MP table */
int smp_found_config;

+static struct resource lapic_resource = {
+ .name = "Local APIC",
+ .flags = IORESOURCE_MEM | IORESOURCE_BUSY,
+};
+
static unsigned int calibration_result;

static int lapic_next_event(unsigned long delta,
@@ -1754,3 +1759,21 @@ static int __init apic_set_verbosity(cha
}
__setup("apic=", apic_set_verbosity);

+static int __init lapic_insert_resource(void)
+{
+ if (!apic_phys)
+ return -1;
+
+ /* Put local APIC into the resource map. */
+ lapic_resource.start = apic_phys;
+ lapic_resource.end = lapic_resource.start + PAGE_SIZE - 1;
+ insert_resource(&iomem_resource, &lapic_resource);
+
+ return 0;
+}
+
+/*
+ * need call insert after e820_reserve_resources()
+ * that is using request_resource
+ */
+late_initcall(lapic_insert_resource);
--
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/