Skip to content

Commit

Permalink
x86: apic_32.c - add lapic resource
Browse files Browse the repository at this point in the history
Add lapic resource into kernel resource map and mark it as busy

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
CC: Maciej W. Rozycki <macro@linux-mips.org>
  • Loading branch information
Cyrill Gorcunov authored and Ingo Molnar committed Jul 9, 2008
1 parent 5d061e3 commit 746f2eb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions arch/x86/kernel/apic_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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,
Expand Down Expand Up @@ -1720,3 +1725,21 @@ static int __init apic_set_verbosity(char *str)
}
__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);

0 comments on commit 746f2eb

Please sign in to comment.