diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-02 01:06:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-02 01:06:15 -0500 |
commit | 59ed2f59e4ea6a32f9591e378da7935f713a7000 (patch) | |
tree | a1276a611dbb1bc44685ef8af363e99603e60047 /arch/x86_64 | |
parent | 9ad11ab48b1ad618bf47076e9e579f267f5306c2 (diff) | |
parent | b8e4d89357fc434618a59c1047cac72641191805 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/acpi/Makefile | 5 | ||||
-rw-r--r-- | arch/x86_64/kernel/acpi/processor.c | 72 | ||||
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 10 | ||||
-rw-r--r-- | arch/x86_64/kernel/mpparse.c | 8 |
4 files changed, 86 insertions, 9 deletions
diff --git a/arch/x86_64/kernel/acpi/Makefile b/arch/x86_64/kernel/acpi/Makefile index 7da9ace890bd..4fe97071f297 100644 --- a/arch/x86_64/kernel/acpi/Makefile +++ b/arch/x86_64/kernel/acpi/Makefile | |||
@@ -1,3 +1,8 @@ | |||
1 | obj-y := boot.o | 1 | obj-y := boot.o |
2 | boot-y := ../../../i386/kernel/acpi/boot.o | 2 | boot-y := ../../../i386/kernel/acpi/boot.o |
3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o | 3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o |
4 | |||
5 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | ||
6 | obj-y += processor.o | ||
7 | endif | ||
8 | |||
diff --git a/arch/x86_64/kernel/acpi/processor.c b/arch/x86_64/kernel/acpi/processor.c new file mode 100644 index 000000000000..3bdc2baa5bb1 --- /dev/null +++ b/arch/x86_64/kernel/acpi/processor.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * arch/x86_64/kernel/acpi/processor.c | ||
3 | * | ||
4 | * Copyright (C) 2005 Intel Corporation | ||
5 | * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
6 | * - Added _PDC for platforms with Intel CPUs | ||
7 | */ | ||
8 | |||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/acpi.h> | ||
13 | |||
14 | #include <acpi/processor.h> | ||
15 | #include <asm/acpi.h> | ||
16 | |||
17 | static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) | ||
18 | { | ||
19 | struct acpi_object_list *obj_list; | ||
20 | union acpi_object *obj; | ||
21 | u32 *buf; | ||
22 | |||
23 | /* allocate and initialize pdc. It will be used later. */ | ||
24 | obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); | ||
25 | if (!obj_list) { | ||
26 | printk(KERN_ERR "Memory allocation error\n"); | ||
27 | return; | ||
28 | } | ||
29 | |||
30 | obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); | ||
31 | if (!obj) { | ||
32 | printk(KERN_ERR "Memory allocation error\n"); | ||
33 | kfree(obj_list); | ||
34 | return; | ||
35 | } | ||
36 | |||
37 | buf = kmalloc(12, GFP_KERNEL); | ||
38 | if (!buf) { | ||
39 | printk(KERN_ERR "Memory allocation error\n"); | ||
40 | kfree(obj); | ||
41 | kfree(obj_list); | ||
42 | return; | ||
43 | } | ||
44 | |||
45 | buf[0] = ACPI_PDC_REVISION_ID; | ||
46 | buf[1] = 1; | ||
47 | buf[2] = ACPI_PDC_EST_CAPABILITY_SMP; | ||
48 | |||
49 | obj->type = ACPI_TYPE_BUFFER; | ||
50 | obj->buffer.length = 12; | ||
51 | obj->buffer.pointer = (u8 *) buf; | ||
52 | obj_list->count = 1; | ||
53 | obj_list->pointer = obj; | ||
54 | pr->pdc = obj_list; | ||
55 | |||
56 | return; | ||
57 | } | ||
58 | |||
59 | /* Initialize _PDC data based on the CPU vendor */ | ||
60 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr) | ||
61 | { | ||
62 | unsigned int cpu = pr->id; | ||
63 | struct cpuinfo_x86 *c = cpu_data + cpu; | ||
64 | |||
65 | pr->pdc = NULL; | ||
66 | if (c->x86_vendor == X86_VENDOR_INTEL && cpu_has(c, X86_FEATURE_EST)) | ||
67 | init_intel_pdc(pr, c); | ||
68 | |||
69 | return; | ||
70 | } | ||
71 | |||
72 | EXPORT_SYMBOL(arch_acpi_processor_init_pdc); | ||
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index e8cf44ef8778..1a5060b434b8 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -2027,7 +2027,7 @@ int __init io_apic_get_redir_entries (int ioapic) | |||
2027 | } | 2027 | } |
2028 | 2028 | ||
2029 | 2029 | ||
2030 | int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low) | 2030 | int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity) |
2031 | { | 2031 | { |
2032 | struct IO_APIC_route_entry entry; | 2032 | struct IO_APIC_route_entry entry; |
2033 | unsigned long flags; | 2033 | unsigned long flags; |
@@ -2049,8 +2049,8 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a | |||
2049 | entry.delivery_mode = INT_DELIVERY_MODE; | 2049 | entry.delivery_mode = INT_DELIVERY_MODE; |
2050 | entry.dest_mode = INT_DEST_MODE; | 2050 | entry.dest_mode = INT_DEST_MODE; |
2051 | entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); | 2051 | entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); |
2052 | entry.trigger = edge_level; | 2052 | entry.trigger = triggering; |
2053 | entry.polarity = active_high_low; | 2053 | entry.polarity = polarity; |
2054 | entry.mask = 1; /* Disabled (masked) */ | 2054 | entry.mask = 1; /* Disabled (masked) */ |
2055 | 2055 | ||
2056 | irq = gsi_irq_sharing(irq); | 2056 | irq = gsi_irq_sharing(irq); |
@@ -2065,9 +2065,9 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a | |||
2065 | apic_printk(APIC_VERBOSE,KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " | 2065 | apic_printk(APIC_VERBOSE,KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " |
2066 | "IRQ %d Mode:%i Active:%i)\n", ioapic, | 2066 | "IRQ %d Mode:%i Active:%i)\n", ioapic, |
2067 | mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, | 2067 | mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, |
2068 | edge_level, active_high_low); | 2068 | triggering, polarity); |
2069 | 2069 | ||
2070 | ioapic_register_intr(irq, entry.vector, edge_level); | 2070 | ioapic_register_intr(irq, entry.vector, triggering); |
2071 | 2071 | ||
2072 | if (!ioapic && (irq < 16)) | 2072 | if (!ioapic && (irq < 16)) |
2073 | disable_8259A_irq(irq); | 2073 | disable_8259A_irq(irq); |
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index 1105250bf02c..dc49bfb6db0a 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -915,7 +915,7 @@ void __init mp_config_acpi_legacy_irqs (void) | |||
915 | 915 | ||
916 | #define MAX_GSI_NUM 4096 | 916 | #define MAX_GSI_NUM 4096 |
917 | 917 | ||
918 | int mp_register_gsi(u32 gsi, int edge_level, int active_high_low) | 918 | int mp_register_gsi(u32 gsi, int triggering, int polarity) |
919 | { | 919 | { |
920 | int ioapic = -1; | 920 | int ioapic = -1; |
921 | int ioapic_pin = 0; | 921 | int ioapic_pin = 0; |
@@ -964,7 +964,7 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low) | |||
964 | 964 | ||
965 | mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); | 965 | mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); |
966 | 966 | ||
967 | if (edge_level) { | 967 | if (triggering == ACPI_LEVEL_SENSITIVE) { |
968 | /* | 968 | /* |
969 | * For PCI devices assign IRQs in order, avoiding gaps | 969 | * For PCI devices assign IRQs in order, avoiding gaps |
970 | * due to unused I/O APIC pins. | 970 | * due to unused I/O APIC pins. |
@@ -986,8 +986,8 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low) | |||
986 | } | 986 | } |
987 | 987 | ||
988 | io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, | 988 | io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, |
989 | edge_level == ACPI_EDGE_SENSITIVE ? 0 : 1, | 989 | triggering == ACPI_EDGE_SENSITIVE ? 0 : 1, |
990 | active_high_low == ACPI_ACTIVE_HIGH ? 0 : 1); | 990 | polarity == ACPI_ACTIVE_HIGH ? 0 : 1); |
991 | return gsi; | 991 | return gsi; |
992 | } | 992 | } |
993 | 993 | ||