Commit 5062d6c9 authored by Linus Torvalds's avatar Linus Torvalds

Automerge

parents 95519b26 86aeb1b8
......@@ -65,7 +65,7 @@ rename: no yes (all) (see below)
readlink: no no
follow_link: no no
truncate: no yes (see below)
setattr: yes if ATTR_SIZE
setattr: no yes
permission: yes no
getattr: (see below)
revalidate: no (see below)
......
......@@ -116,3 +116,10 @@ FS_LITTER is gone - just remove it from fs_flags.
FS_SINGLE is gone (actually, that had happened back when ->get_sb()
went in - and hadn't been documented ;-/). Just remove it from fs_flags
(and see ->get_sb() entry for other actions).
---
[mandatory]
->setattr() is called without BKL now. Caller _always_ holds ->i_sem, so
watch for ->i_sem-grabbing code that might be used by your ->setattr().
Callers of notify_change() need ->i_sem now.
......@@ -48,6 +48,10 @@
#define PREFIX "ACPI: "
extern struct acpi_boot_flags acpi_boot;
int acpi_mp_config = 0;
/* --------------------------------------------------------------------------
Boot-time Configuration
......@@ -104,13 +108,15 @@ static int total_cpus __initdata = 0;
/* From mpparse.c */
extern void __init MP_processor_info(struct mpc_config_processor *);
extern void __init MP_ioapic_info (struct mpc_config_ioapic *);
extern void __init MP_lintsrc_info(struct mpc_config_lintsrc *);
int __init
acpi_parse_lapic (
acpi_table_entry_header *header)
{
struct acpi_table_lapic *cpu = NULL;
struct mpc_config_processor proc_entry;
struct mpc_config_processor processor;
cpu = (struct acpi_table_lapic*) header;
if (!cpu)
......@@ -134,21 +140,21 @@ acpi_parse_lapic (
* the processor ID. Processor features aren't present in
* the table.
*/
proc_entry.mpc_type = MP_PROCESSOR;
proc_entry.mpc_apicid = cpu->id;
proc_entry.mpc_cpuflag = CPU_ENABLED;
processor.mpc_type = MP_PROCESSOR;
processor.mpc_apicid = cpu->id;
processor.mpc_cpuflag = CPU_ENABLED;
if (cpu->id == boot_cpu_physical_apicid) {
/* TBD: Circular reference trying to establish BSP */
proc_entry.mpc_cpuflag |= CPU_BOOTPROCESSOR;
processor.mpc_cpuflag |= CPU_BOOTPROCESSOR;
}
proc_entry.mpc_cpufeature = (boot_cpu_data.x86 << 8)
processor.mpc_cpufeature = (boot_cpu_data.x86 << 8)
| (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
proc_entry.mpc_featureflag = boot_cpu_data.x86_capability[0];
proc_entry.mpc_reserved[0] = 0;
proc_entry.mpc_reserved[1] = 0;
proc_entry.mpc_apicver = 0x10; /* integrated APIC */
processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
processor.mpc_reserved[0] = 0;
processor.mpc_reserved[1] = 0;
processor.mpc_apicver = 0x10; /* Integrated APIC */
MP_processor_info(&proc_entry);
MP_processor_info(&processor);
total_cpus++;
......@@ -184,7 +190,7 @@ acpi_parse_lapic_nmi (
acpi_table_print_madt_entry(header);
/* TBD: Support local APIC NMI entries */
/* TBD: Support lapic_nmi entries */
return 0;
}
......@@ -199,6 +205,10 @@ acpi_parse_ioapic (
acpi_table_entry_header *header)
{
struct acpi_table_ioapic *ioapic = NULL;
/*
struct mpc_config_ioapic mp_ioapic;
struct IO_APIC_reg_01 reg_01;
*/
ioapic = (struct acpi_table_ioapic*) header;
if (!ioapic)
......@@ -206,11 +216,91 @@ acpi_parse_ioapic (
acpi_table_print_madt_entry(header);
/* TBD: Support ioapic entries */
/*
* Cobble up an entry for the IOAPIC (just as we do for LAPIC entries).
* Note that we aren't doing anything with ioapic->vector, and
* mpc_apicver gets read directly from ioapic.
*/
/*
* TBD: Complete I/O APIC support.
*
mp_ioapic.mpc_type = MP_IOAPIC;
mp_ioapic.mpc_apicid = ioapic->id;
mp_ioapic.mpc_flags = MPC_APIC_USABLE;
mp_ioapic.mpc_apicaddr = ioapic->address;
set_fixmap_nocache(nr_ioapics + FIX_IO_APIC_BASE_0,
mp_ioapic.mpc_apicaddr);
printk("mapped IOAPIC to %08lx (%08lx)\n",
__fix_to_virt(nr_ioapics), mp_ioapic.mpc_apicaddr);
*(int *)&reg_01 = io_apic_read(nr_ioapics, 1);
mp_ioapic.mpc_apicver = reg_01.version;
MP_ioapic_info(&mp_ioapic);
*/
return 0;
}
int __init
acpi_parse_int_src_ovr (
acpi_table_entry_header *header)
{
struct acpi_table_int_src_ovr *int_src_ovr = NULL;
/*
struct mpc_config_intsrc my_intsrc;
int i = 0;
*/
int_src_ovr = (struct acpi_table_int_src_ovr*) header;
if (!int_src_ovr)
return -EINVAL;
acpi_table_print_madt_entry(header);
/*
* TBD: Complete I/O APIC support.
*
my_intsrc.mpc_type = MP_INTSRC;
my_intsrc.mpc_irqtype = mp_INT;
my_intsrc.mpc_irqflag = *(unsigned short*)(&(int_src_ovr->flags));
my_intsrc.mpc_srcbus = int_src_ovr->bus;
my_intsrc.mpc_srcbusirq = int_src_ovr->bus_irq;
my_intsrc.mpc_dstapic = 0;
my_intsrc.mpc_dstirq = int_src_ovr->global_irq;
for (i = 0; i < mp_irq_entries; i++) {
if (mp_irqs[i].mpc_srcbusirq == my_intsrc.mpc_srcbusirq) {
mp_irqs[i] = my_intsrc;
break;
}
}
*/
return 0;
}
int __init
acpi_parse_nmi_src (
acpi_table_entry_header *header)
{
struct acpi_table_nmi_src *nmi_src = NULL;
nmi_src = (struct acpi_table_nmi_src*) header;
if (!nmi_src)
return -EINVAL;
acpi_table_print_madt_entry(header);
/* TBD: Support nimsrc entries */
return 0;
}
#endif /*CONFIG_X86_IO_APIC*/
......@@ -288,14 +378,115 @@ acpi_find_rsdp (
}
#endif /*CONFIG_ACPI_BOOT*/
int __init
acpi_boot_init (
char *cmdline)
{
int result = 0;
/* Initialize the ACPI boot-time table parser */
result = acpi_table_init(cmdline);
if (0 != result)
return result;
#ifdef CONFIG_X86_LOCAL_APIC
#ifdef CONFIG_X86_IO_APIC
/*
* MADT
* ----
* Parse the Multiple APIC Description Table (MADT), if exists.
* Note that this table provides platform SMP configuration
* information -- the successor to MPS tables.
*/
if (!acpi_boot.madt) {
printk(KERN_INFO PREFIX "MADT parsing disabled via command-line\n");
return 0;
}
result = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
if (0 == result) {
printk(KERN_WARNING PREFIX "MADT not present\n");
return 0;
}
else if (0 > result) {
printk(KERN_ERR PREFIX "Error parsing MADT\n");
return result;
}
else if (1 < result)
printk(KERN_WARNING PREFIX "Multiple MADT tables exist\n");
/* Local APIC */
result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr);
if (0 > result) {
printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
return result;
}
result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic);
if (1 > result) {
printk(KERN_ERR PREFIX "Error parsing MADT - no LAPIC entries!\n");
return -ENODEV;
}
result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi);
if (0 > result) {
printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
return result;
}
/* I/O APIC */
result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic);
if (1 > result) {
printk(KERN_ERR PREFIX "Error parsing MADT - no IOAPIC entries!\n");
return -ENODEV;
}
acpi_mp_config = 1;
/*
* TBD: Complete I/O APIC support.
*
construct_default_ACPI_table();
*/
result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr);
if (0 > result) {
printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
return result;
}
result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
if (0 > result) {
printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
return result;
}
/* Make boot-up look pretty */
printk("%d CPUs total\n", total_cpus);
#endif /*CONFIG_X86_IO_APIC*/
#endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_SERIAL_ACPI
/*
* TBD: Need phased approach to table parsing (only do those absolutely
* required during boot-up). Recommend expanding concept of fix-
* feature devices (ACPI Bus driver) to include table-based devices
* such as serial ports, EC, SMBus, etc.
*/
/* acpi_table_parse(ACPI_SPCR, acpi_parse_spcr);*/
#endif /*CONFIG_SERIAL_ACPI*/
return 0;
}
#endif /*CONFIG_ACPI_BOOT*/
/* --------------------------------------------------------------------------
PCI Interrupt Routing Support
-------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PCI
int __init
acpi_get_interrupt_model (
int *type)
......@@ -304,15 +495,13 @@ acpi_get_interrupt_model (
return -EINVAL;
#ifdef CONFIG_X86_IO_APIC
if (io_apic_assign_pci_irqs)
*type = ACPI_PCI_ROUTING_IOAPIC;
else
*type = ACPI_INT_MODEL_IOAPIC;
#else
*type = ACPI_INT_MODEL_PIC;
#endif
*type = ACPI_PCI_ROUTING_PIC;
return 0;
}
#endif
/* --------------------------------------------------------------------------
......
......@@ -18,6 +18,8 @@ wakeup_code:
addw $(wakeup_data - wakeup_code) >> 4, %ax
movw %ax, %ds
movw %ax, %ss
mov $(wakeup_stack - wakeup_data), %sp # Private stack is needed for ASUS board
# set up page table
movl (real_save_cr3 - wakeup_data), %eax
......
......@@ -14,7 +14,6 @@
#include <linux/mm.h>
#include <linux/irq.h>
#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/config.h>
......@@ -24,6 +23,7 @@
#include <linux/mc146818rtc.h>
#include <asm/smp.h>
#include <asm/acpi.h>
#include <asm/mtrr.h>
#include <asm/mpspec.h>
#include <asm/pgalloc.h>
......@@ -31,9 +31,6 @@
/* Have we found an MP table */
int smp_found_config;
/* Have we found an ACPI MADT table */
int acpi_found_madt = 0;
/*
* Various Linux-internal data structures created from the
* MP-table.
......@@ -41,8 +38,6 @@ int acpi_found_madt = 0;
int apic_version [MAX_APICS];
int mp_bus_id_to_type [MAX_MP_BUSSES];
int mp_bus_id_to_node [MAX_MP_BUSSES];
int mp_bus_id_to_local [MAX_MP_BUSSES];
int quad_local_to_mp_bus_id [NR_CPUS/4][4];
int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 };
int mp_current_pci_id;
......@@ -69,19 +64,6 @@ static unsigned int num_processors;
/* Bitmask of physically existing CPUs */
unsigned long phys_cpu_present_map;
/* ACPI MADT entry parsing functions */
#ifdef CONFIG_ACPI_BOOT
extern struct acpi_boot_flags acpi_boot;
#ifdef CONFIG_X86_LOCAL_APIC
extern int acpi_parse_lapic (acpi_table_entry_header *header);
extern int acpi_parse_lapic_addr_ovr (acpi_table_entry_header *header);
extern int acpi_parse_lapic_nmi (acpi_table_entry_header *header);
#endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_X86_IO_APIC
extern int acpi_parse_ioapic (acpi_table_entry_header *header);
#endif /*CONFIG_X86_IO_APIC*/
#endif /*CONFIG_ACPI_BOOT*/
/*
* Intel MP BIOS table parsing routines:
*/
......@@ -255,17 +237,13 @@ void __init MP_processor_info (struct mpc_config_processor *m)
static void __init MP_bus_info (struct mpc_config_bus *m)
{
char str[7];
int quad;
memcpy(str, m->mpc_bustype, 6);
str[6] = 0;
if (clustered_apic_mode) {
quad = translation_table[mpc_record]->trans_quad;
mp_bus_id_to_node[m->mpc_busid] = quad;
mp_bus_id_to_local[m->mpc_busid] = translation_table[mpc_record]->trans_local;
quad_local_to_mp_bus_id[quad][translation_table[mpc_record]->trans_local] = m->mpc_busid;
printk("Bus #%d is %s (node %d)\n", m->mpc_busid, str, quad);
mp_bus_id_to_node[m->mpc_busid] = translation_table[mpc_record]->trans_quad;
printk("Bus #%d is %s (node %d)\n", m->mpc_busid, str, mp_bus_id_to_node[m->mpc_busid]);
} else {
Dprintk("Bus #%d is %s\n", m->mpc_busid, str);
}
......@@ -342,14 +320,13 @@ static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m)
static void __init MP_translation_info (struct mpc_config_translation *m)
{
printk("Translation: record %d, type %d, quad %d, global %d, local %d\n", mpc_record, m->trans_type, m->trans_quad, m->trans_global, m->trans_local);
printk("Translation: record %d, type %d, quad %d, global %d, local %d\n", mpc_record, m->trans_type,
m->trans_quad, m->trans_global, m->trans_local);
if (mpc_record >= MAX_MPC_ENTRY)
printk("MAX_MPC_ENTRY exceeded!\n");
else
translation_table[mpc_record] = m; /* stash this for later */
if (m->trans_quad+1 > numnodes)
numnodes = m->trans_quad+1;
}
/*
......@@ -440,10 +417,10 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
/*
* Save the local APIC address, it might be non-default,
* but only if we're not using the ACPI tables
* Save the local APIC address (it might be non-default), but only
* if we're not using the ACPI tables.
*/
if (!acpi_found_madt)
if (!acpi_mp_config)
mp_lapic_addr = mpc->mpc_lapic;
if (clustered_apic_mode && mpc->mpc_oemptr) {
......@@ -464,7 +441,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
(struct mpc_config_processor *)mpt;
/* ACPI may already have provided this one for us */
if (!acpi_found_madt)
if (!acpi_mp_config)
MP_processor_info(m);
mpt += sizeof(*m);
count += sizeof(*m);
......@@ -515,6 +492,10 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
}
++mpc_record;
}
if (clustered_apic_mode && nr_ioapics > 2) {
/* don't initialise IO apics on secondary quads */
nr_ioapics = 2;
}
if (!num_processors)
printk(KERN_ERR "SMP mptable: no processors registered!\n");
return num_processors;
......@@ -686,20 +667,6 @@ void __init get_smp_config (void)
{
struct intel_mp_floating *mpf = mpf_found;
#ifdef CONFIG_ACPI_BOOT
/*
* Check if the MADT exists, and if so, use it to get processor
* information (ACPI_MADT_LAPIC). The MADT supports the concept
* of both logical (e.g. HT) and physical processor(s); where the
* MPS only supports physical.
*/
if (acpi_boot.madt) {
acpi_found_madt = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
if (acpi_found_madt > 0)
acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic);
}
#endif /*CONFIG_ACPI_BOOT*/
printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
if (mpf->mpf_feature2 & (1<<7)) {
printk(" IMCR and PIC compatibility mode.\n");
......
......@@ -540,6 +540,18 @@ static void __init pirq_find_router(void)
pirq_router_dev->slot_name);
}
static struct irq_info *pirq_get_info(struct pci_dev *dev)
{
struct irq_routing_table *rt = pirq_table;
int entries = (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info);
struct irq_info *info;
for (info = rt->slots; entries--; info++)
if (info->bus == dev->bus->number && PCI_SLOT(info->devfn) == PCI_SLOT(dev->devfn))
return info;
return NULL;
}
static void pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{
}
......@@ -557,44 +569,67 @@ static int acpi_lookup_irq (
/* TBD: Select IRQ from possible to improve routing performance. */
result = acpi_prt_get_irq(dev, pin, &irq);
if ((0 != result) || !irq) {
printk(KERN_ERR "PCI: Unable to resolve IRQ for device %s\n",
dev->slot_name);
if (!irq)
result = -ENODEV;
if (0 != result) {
printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s\n",
'A'+pin, dev->slot_name);
return result;
}
dev->irq = irq;
if (!assign) {
/* only check for the IRQ */
printk(KERN_INFO "PCI: Found IRQ %d for device %s\n", irq,
dev->slot_name);
return 1;
}
dev->irq = irq;
/* also assign an IRQ */
if (irq && (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) {
result = acpi_prt_set_irq(dev, pin, irq);
if (0 != result) {
printk(KERN_WARNING "PCI: Could not assign IRQ %d to device %s\n", irq, dev->slot_name);
return result;
}
pirq_penalty[irq]++;
eisa_set_level_irq(irq);
printk(KERN_INFO "PCI: Assigned IRQ %d for device %s\n", irq, dev->slot_name);
}
return 1;
}
#endif /* CONFIG_ACPI_PCI */
static struct irq_info *pirq_get_info(struct pci_dev *dev)
static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
{
struct irq_routing_table *rt = pirq_table;
int entries = (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info);
u8 pin;
struct irq_info *info;
for (info = rt->slots; entries--; info++)
if (info->bus == dev->bus->number && PCI_SLOT(info->devfn) == PCI_SLOT(dev->devfn))
return info;
return NULL;
}
static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
{
int i, pirq, newirq;
int irq = 0;
u32 mask;
struct irq_router *r = pirq_router;
struct irq_info *info;
int newirq, pirq, i, irq = 0;
struct pci_dev *dev2;
char *msg = NULL;
u32 mask;
/* Find IRQ pin */
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (!pin) {
DBG(" -> no interrupt pin\n");
return 0;
}
pin = pin - 1;
#ifdef CONFIG_ACPI_PCI
/* Use ACPI to lookup IRQ */
if (pci_use_acpi_routing)
return acpi_lookup_irq(dev, pin, assign);
#endif
/* Find IRQ routing entry */
if (!pirq_table)
return 0;
......@@ -605,7 +640,6 @@ static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
DBG(" -> not found in routing table\n");
return 0;
}
pirq = info->irq[pin].link;
mask = info->irq[pin].bitmap;
if (!pirq) {
......@@ -629,10 +663,6 @@ static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
* reported by the device if possible.
*/
newirq = dev->irq;
if (!((1 << newirq) & mask)) {
if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0;
else printk(KERN_WARNING "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n", newirq, dev->slot_name);
}
if (!newirq && assign) {
for (i = 0; i < 16; i++) {
if (!(mask & (1 << i)))
......@@ -651,8 +681,7 @@ static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
irq = pirq & 0xf;
DBG(" -> hardcoded IRQ %d\n", irq);
msg = "Hardcoded";
} else if ( r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \
((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) {
} else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq))) {
DBG(" -> got IRQ %d\n", irq);
msg = "Found";
} else if (newirq && r->set && (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) {
......@@ -686,9 +715,7 @@ static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
continue;
if (info->irq[pin].link == pirq) {
/* We refuse to override the dev->irq information. Give a warning! */
if ( dev2->irq && dev2->irq != irq && \
(!(pci_probe & PCI_USE_PIRQ_MASK) || \
((1 << dev2->irq) & mask)) ) {
if (dev2->irq && dev2->irq != irq) {
printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n",
dev2->slot_name, dev2->irq, irq);
continue;
......@@ -702,38 +729,20 @@ static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
return 1;
}
static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
{
u8 pin;
/* Find IRQ routing entry */
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (!pin) {
DBG("PCI: %s: no interrupt pin\n", dev->slot_name);
return 0;
}
pin -= 1;
#ifdef CONFIG_ACPI_PCI
if (pci_use_acpi_routing)
return acpi_lookup_irq(dev, pin, assign);
else
#endif
return pirq_lookup_irq(dev, pin, assign);
}
void __init pcibios_irq_init(void)
{
DBG("PCI: IRQ init\n");
#ifdef CONFIG_ACPI_PCI
if (acpi_prts.count && !(pci_probe & PCI_NO_ACPI_ROUTING)) {
if (!(pci_probe & PCI_NO_ACPI_ROUTING)) {
if (acpi_prts.count) {
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
pci_use_acpi_routing = 1;
return;
}
if (!acpi_prts.count)
printk(KERN_INFO "PCI: Invalid acpi_prts [%d]\n", acpi_prts.count);
else
printk(KERN_WARNING "PCI: Invalid ACPI-PCI IRQ routing table\n");
}
#endif
pirq_table = pirq_find_routing_table();
......
......@@ -1033,6 +1033,16 @@ CONFIG_XMON
Include in-kernel hooks for the xmon kernel monitor/debugger
supported by the PPC port.
Include BDI2000 debugger support
CONFIG_BDI_SWITCH
Include in-kernel support for the Abatron BDI2000 debugger.
Add additional CFLAGS to the kernel build
CONFIG_MORE_COMPILE_OPTIONS
If you want to add additional CFLAGS to the kernel build, such as
-g for KGDB, XMON or the BDI2000, enable this option and then
enter what you would like to add in the next question.
CONFIG_ADVANCED_OPTIONS
This option will enable prompting for a variety of advanced kernel
configuration options. These options can cause the kernel to not
......
......@@ -125,15 +125,12 @@ if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ]; then
Zynx-ZX4500 CONFIG_ZX4500" CHRP/PowerMac/PReP
fi
if [ "$CONFIG_PCORE" = "y" \
-o "$CONFIG_POWERPMC250" = "y" ]; then
if [ "$CONFIG_PCORE" = "y" -o "$CONFIG_POWERPMC250" = "y" ]; then
define_bool CONFIG_FORCE y
fi
if [ "$CONFIG_FORCE" = "y" \
-o "$CONFIG_MENF1" = "y" \
-o "$CONFIG_SANDPOINT" = "y" \
-o "$CONFIG_ZX4500" = "y" ]; then
if [ "$CONFIG_FORCE" = "y" -o "$CONFIG_MENF1" = "y" \
-o "$CONFIG_SANDPOINT" = "y" -o "$CONFIG_ZX4500" = "y" ]; then
bool 'Enable MPC10x store gathering' CONFIG_MPC10X_STORE_GATHERING
fi
......@@ -287,7 +284,7 @@ if [ "$CONFIG_ADVANCED_OPTIONS" = "y" ]; then
if [ "$CONFIG_4xx" = "y" ]; then
bool "Pinned Kernel TLBs" CONFIG_PIN_TLB
fi
if [ "$CONFIG_ALL_PPC" = "n" ]; then
if [ "$CONFIG_ALL_PPC" != "y" ]; then
bool "Set the boot link/load address" CONFIG_BOOT_LOAD_BOOL
if [ "$CONFIG_BOOT_LOAD_BOOL" = "y" ]; then
hex " Link/load address for booting" CONFIG_BOOT_LOAD 0x00400000
......@@ -421,7 +418,6 @@ mainmenu_option next_comment
comment 'ATA/IDE/MFM/RLL support'
tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
if [ "$CONFIG_IDE" != "n" ]; then
source drivers/ide/Config.in
else
......@@ -472,7 +468,6 @@ endmenu
mainmenu_option next_comment
comment 'Old CD-ROM drivers (not SCSI, not IDE)'
bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
source drivers/cdrom/Config.in
......@@ -484,7 +479,7 @@ comment 'Console drivers'
if [ "$CONFIG_4xx" != "y" -a "$CONFIG_8xx" != "y" ]; then
bool 'Support for VGA Console' CONFIG_VGA_CONSOLE
fi
source drivers/video/Config.in
source drivers/video/Config.in
if [ "$CONFIG_FB" = "y" -a "$CONFIG_ALL_PPC" = "y" ]; then
bool 'Backward compatibility mode for Xpmac' CONFIG_FB_COMPAT_XPMAC
fi
......@@ -509,12 +504,11 @@ if [ "$CONFIG_PPC_ISERIES" = "y" ]; then
-o "$CONFIG_VIOTAPE" != "n" -o "$CONFIG_VIOCD" != "n" ]; then
define_bool CONFIG_VIOPATH y
fi
endmenu
fi
if [ "$CONFIG_VIOCD" = "y" ]; then
if [ "$CONFIG_VIOCD" = "y" ]; then
define_bool CONFIG_CD_NO_IDESCSI y
define_bool CONFIG_BLK_DEV_IDECD y
fi
endmenu
fi
source drivers/input/Config.in
......@@ -576,15 +570,14 @@ if [ "$CONFIG_SOUND" != "n" ]; then
source sound/oss/dmasound/Config.in
source sound/Config.in
fi
endmenu
if [ "$CONFIG_8xx" = "y" ]; then
source arch/ppc/8xx_io/Config.in
source arch/ppc/8xx_io/Config.in
fi
if [ "$CONFIG_8260" = "y" ]; then
source arch/ppc/8260_io/Config.in
source arch/ppc/8260_io/Config.in
fi
if [ "$CONFIG_4xx" = "y"]; then
......
......@@ -52,15 +52,13 @@ void power_save(void);
unsigned long zero_paged_on;
unsigned long powersave_nap;
int idled(void)
void default_idle(void)
{
int do_power_save = 0;
if (cur_cpu_spec[smp_processor_id()]->cpu_features & CPU_FTR_CAN_DOZE)
do_power_save = 1;
/* endless loop with no priority at all */
for (;;) {
#ifdef CONFIG_PPC_ISERIES
if (!current->need_resched) {
/* Turn off the run light */
......@@ -93,8 +91,6 @@ int idled(void)
HMT_low();
}
#endif /* CONFIG_PPC_ISERIES */
}
return 0;
}
/*
......@@ -103,7 +99,8 @@ int idled(void)
*/
int cpu_idle(void)
{
idled();
for (;;)
default_idle();
return 0;
}
......
......@@ -79,6 +79,10 @@ extern unsigned char __res[];
extern unsigned long ret_to_user_hook;
extern unsigned long mm_ptov (unsigned long paddr);
extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle);
extern void consistent_free(void *vaddr);
extern void consistent_sync(void *vaddr, size_t size, int direction);
EXPORT_SYMBOL(clear_page);
EXPORT_SYMBOL(do_signal);
EXPORT_SYMBOL(do_syscall_trace);
......
......@@ -20,6 +20,7 @@
#include <linux/sched.h>
#include <asm/atomic.h>
#include <asm/semaphore.h>
#include <asm/errno.h>
/*
* Atomically update sem->count.
......
......@@ -594,8 +594,8 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
info.si_pid = current->p_pptr->pid;
info.si_uid = current->p_pptr->uid;
info.si_pid = current->parent->pid;
info.si_uid = current->parent->uid;
}
/* If the (new) signal is now blocked, requeue it. */
......@@ -634,7 +634,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
case SIGSTOP:
current->state = TASK_STOPPED;
current->exit_code = signr;
if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
if (!(current->parent->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
schedule();
continue;
......
......@@ -22,6 +22,7 @@
* 2 of the License, or (at your option) any later version.
*
*/
#include <asm/tlbflush.h>
extern void mapin_ram(void);
extern void bat_mapin_ram(void);
......
......@@ -28,6 +28,7 @@
#include <linux/types.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/highmem.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
......@@ -56,6 +57,70 @@ void setbat(int index, unsigned long virt, unsigned long phys,
#define p_mapped_by_bats(x) (0UL)
#endif /* HAVE_BATS */
pgd_t *pgd_alloc(struct mm_struct *mm)
{
pgd_t *ret;
if ((ret = (pgd_t *)__get_free_page(GFP_KERNEL)) != NULL)
clear_page(ret);
return ret;
}
void pgd_free(pgd_t *pgd)
{
free_page((unsigned long)pgd);
}
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
{
pte_t *pte;
extern int mem_init_done;
extern void *early_get_page(void);
int timeout = 0;
if (mem_init_done) {
while ((pte = (pte_t *) __get_free_page(GFP_KERNEL)) == NULL
&& ++timeout < 10) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ);
}
} else
pte = (pte_t *) early_get_page();
if (pte != NULL)
clear_page(pte);
return pte;
}
struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
{
struct page *pte;
int timeout = 0;
#ifdef CONFIG_HIGHPTE
int flags = GFP_KERNEL | __GFP_HIGHMEM;
#else
int flags = GFP_KERNEL;
#endif
while ((pte = alloc_pages(flags, 0)) == NULL) {
if (++timeout >= 10)
return NULL;
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ);
}
clear_highpage(pte);
return pte;
}
void pte_free_kernel(pte_t *pte)
{
free_page((unsigned long)pte);
}
void pte_free(struct page *pte)
{
__free_page(pte);
}
#ifndef CONFIG_PPC_ISERIES
void *
ioremap(unsigned long addr, unsigned long size)
......
......@@ -9,7 +9,7 @@ export ACPI_CFLAGS
ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include
ifdef CONFIG_ACPI_DEBUG
ACPI_CFLAGS += -DACPI_DEBUG -Wno-unused
ACPI_CFLAGS += -DACPI_DEBUG
endif
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
/*
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 22 $)
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 23 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -296,6 +296,7 @@ acpi_ac_remove (
struct acpi_ac *ac = NULL;
ACPI_FUNCTION_TRACE("acpi_ac_remove");
if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL);
......
/*
* acpi_battery.c - ACPI Battery Driver ($Revision: 31 $)
* acpi_battery.c - ACPI Battery Driver ($Revision: 32 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -112,8 +112,9 @@ acpi_battery_get_info (
struct acpi_battery *battery,
struct acpi_battery_info **bif)
{
int result = 0;
acpi_status status = 0;
acpi_buffer buffer = {0, NULL};
acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
acpi_buffer format = {sizeof(ACPI_BATTERY_FORMAT_BIF),
ACPI_BATTERY_FORMAT_BIF};
acpi_buffer data = {0, NULL};
......@@ -126,9 +127,11 @@ acpi_battery_get_info (
/* Evalute _BIF */
status = acpi_evaluate(battery->handle, "_BIF", NULL, &buffer);
if (ACPI_FAILURE(status))
status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n"));
return_VALUE(-ENODEV);
}
package = (acpi_object *) buffer.pointer;
......@@ -136,29 +139,33 @@ acpi_battery_get_info (
status = acpi_extract_package(package, &format, &data);
if (status != AE_BUFFER_OVERFLOW) {
kfree(buffer.pointer);
return_VALUE(-ENODEV);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
result = -ENODEV;
goto end;
}
data.pointer = kmalloc(data.length, GFP_KERNEL);
if (!data.pointer) {
kfree(buffer.pointer);
return_VALUE(-ENOMEM);
result = -ENOMEM;
goto end;
}
memset(data.pointer, 0, data.length);
status = acpi_extract_package(package, &format, &data);
if (ACPI_FAILURE(status)) {
kfree(buffer.pointer);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
kfree(data.pointer);
return_VALUE(-ENODEV);
result = -ENODEV;
goto end;
}
end:
kfree(buffer.pointer);
(*bif) = data.pointer;
if (0 == result)
(*bif) = (struct acpi_battery_info *) data.pointer;
return_VALUE(0);
return_VALUE(result);
}
static int
......@@ -166,8 +173,9 @@ acpi_battery_get_status (
struct acpi_battery *battery,
struct acpi_battery_status **bst)
{
int result = 0;
acpi_status status = 0;
acpi_buffer buffer = {0, NULL};
acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
acpi_buffer format = {sizeof(ACPI_BATTERY_FORMAT_BST),
ACPI_BATTERY_FORMAT_BST};
acpi_buffer data = {0, NULL};
......@@ -180,9 +188,11 @@ acpi_battery_get_status (
/* Evalute _BST */
status = acpi_evaluate(battery->handle, "_BST", NULL, &buffer);
if (ACPI_FAILURE(status))
status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n"));
return_VALUE(-ENODEV);
}
package = (acpi_object *) buffer.pointer;
......@@ -190,29 +200,33 @@ acpi_battery_get_status (
status = acpi_extract_package(package, &format, &data);
if (status != AE_BUFFER_OVERFLOW) {
kfree(buffer.pointer);
return_VALUE(-ENODEV);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
result = -ENODEV;
goto end;
}
data.pointer = kmalloc(data.length, GFP_KERNEL);
if (!data.pointer) {
kfree(buffer.pointer);
return_VALUE(-ENOMEM);
result = -ENOMEM;
goto end;
}
memset(data.pointer, 0, data.length);
status = acpi_extract_package(package, &format, &data);
if (ACPI_FAILURE(status)) {
kfree(buffer.pointer);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
kfree(data.pointer);
return_VALUE(-ENODEV);
result = -ENODEV;
goto end;
}
end:
kfree(buffer.pointer);
(*bst) = data.pointer;
if (0 == result)
(*bst) = (struct acpi_battery_status *) data.pointer;
return_VALUE(0);
return_VALUE(result);
}
......@@ -328,7 +342,7 @@ acpi_battery_read_info (
{
int result = 0;
struct acpi_battery *battery = (struct acpi_battery *) data;
struct acpi_battery_info *bif = 0;
struct acpi_battery_info *bif = NULL;
char *units = "?";
char *p = page;
int len = 0;
......@@ -403,7 +417,6 @@ acpi_battery_read_info (
bif->oem_info);
end:
if (bif)
kfree(bif);
len = (p - page);
......@@ -490,7 +503,6 @@ acpi_battery_read_state (
(u32) bst->present_voltage);
end:
if (bst)
kfree(bst);
len = (p - page);
......
This diff is collapsed.
/*
* acpi_bus.h - ACPI Bus Driver ($Revision: 17 $)
* acpi_bus.h - ACPI Bus Driver ($Revision: 19 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -96,8 +96,9 @@ typedef int (*acpi_op_stop) (struct acpi_device *device, int type);
typedef int (*acpi_op_suspend) (struct acpi_device *device, int state);
typedef int (*acpi_op_resume) (struct acpi_device *device, int state);
typedef int (*acpi_op_scan) (struct acpi_device *device);
typedef int (*acpi_op_bind) (struct acpi_device *device);
struct acpi_driver_ops {
struct acpi_device_ops {
acpi_op_add add;
acpi_op_remove remove;
acpi_op_lock lock;
......@@ -106,6 +107,7 @@ struct acpi_driver_ops {
acpi_op_suspend suspend;
acpi_op_resume resume;
acpi_op_scan scan;
acpi_op_bind bind;
};
struct acpi_driver {
......@@ -114,7 +116,7 @@ struct acpi_driver {
char class[80];
int references;
char *ids; /* Supported Hardware IDs */
struct acpi_driver_ops ops;
struct acpi_device_ops ops;
};
enum acpi_blacklist_predicates
......@@ -157,14 +159,18 @@ struct acpi_device_status {
/* Flags */
struct acpi_device_flags {
u8 dynamic_status:1;
u8 compatible_ids:1;
u8 removable:1;
u8 ejectable:1;
u8 lockable:1;
u8 suprise_removal_ok:1;
u8 power_manageable:1;
u8 performance_manageable:1;
u32 dynamic_status:1;
u32 hardware_id:1;
u32 compatible_ids:1;
u32 bus_address:1;
u32 unique_id:1;
u32 removable:1;
u32 ejectable:1;
u32 lockable:1;
u32 suprise_removal_ok:1;
u32 power_manageable:1;
u32 performance_manageable:1;
u32 reserved:21;
};
......@@ -206,13 +212,13 @@ struct acpi_device_pnp {
/* Power Management */
struct acpi_device_power_flags {
u8 explicit_get:1; /* _PSC present? */
u8 power_resources:1; /* Power resources */
u8 inrush_current:1; /* Serialize Dx->D0 */
u8 wake_capable:1; /* Wakeup supported? */
u8 wake_enabled:1; /* Enabled for wakeup */
u8 power_removed:1; /* Optimize Dx->D0 */
u8 reserved:2;
u32 explicit_get:1; /* _PSC present? */
u32 power_resources:1; /* Power resources */
u32 inrush_current:1; /* Serialize Dx->D0 */
u32 wake_capable:1; /* Wakeup supported? */
u32 wake_enabled:1; /* Enabled for wakeup */
u32 power_removed:1; /* Optimize Dx->D0 */
u32 reserved:26;
};
struct acpi_device_power_state {
......@@ -270,6 +276,7 @@ struct acpi_device {
struct acpi_device_power power;
struct acpi_device_perf performance;
struct acpi_device_dir dir;
struct acpi_device_ops ops;
struct acpi_driver *driver;
void *driver_data;
#ifdef CONFIG_LDM
......
/*
* acpi_button.c - ACPI Button Driver ($Revision: 22 $)
* acpi_button.c - ACPI Button Driver ($Revision: 24 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -69,7 +69,7 @@ struct acpi_button {
#include <linux/compatmac.h>
#include <linux/proc_fs.h>
struct proc_dir_entry *acpi_button_dir = NULL;
static struct proc_dir_entry *acpi_button_dir = NULL;
static int
......@@ -81,7 +81,6 @@ acpi_button_read_info (
int *eof,
void *data)
{
int result = 0;
struct acpi_button *button = (struct acpi_button *) data;
char *p = page;
int len = 0;
......@@ -111,21 +110,41 @@ acpi_button_add_fs (
struct acpi_device *device)
{
struct proc_dir_entry *entry = NULL;
struct acpi_button *button = NULL;
ACPI_FUNCTION_TRACE("acpi_button_add_fs");
if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL);
button = acpi_driver_data(device);
if (!acpi_button_dir) {
acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
if (!acpi_button_dir)
return_VALUE(-ENODEV);
}
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
switch (button->type) {
case ACPI_BUTTON_TYPE_POWER:
case ACPI_BUTTON_TYPE_POWERF:
entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER,
acpi_button_dir);
break;
case ACPI_BUTTON_TYPE_SLEEP:
case ACPI_BUTTON_TYPE_SLEEPF:
entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP,
acpi_button_dir);
break;
case ACPI_BUTTON_TYPE_LID:
entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_LID,
acpi_button_dir);
break;
}
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
if (!acpi_device_dir(device))
return_VALUE(-ENODEV);
}
/* 'info' [R] */
entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
......@@ -227,37 +246,46 @@ acpi_button_add (
button->device = device;
button->handle = device->handle;
sprintf(acpi_device_class(device), "%s", ACPI_BUTTON_CLASS);
acpi_driver_data(device) = button;
/*
* Determine the button type (via hid), as fixed-feature buttons
* need to be handled a bit differently than generic-space.
*/
if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
button->type = ACPI_BUTTON_TYPE_POWERF;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_POWERF);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
button->type = ACPI_BUTTON_TYPE_SLEEPF;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_SLEEPF);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) {
if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) {
button->type = ACPI_BUTTON_TYPE_POWER;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_POWER);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
button->type = ACPI_BUTTON_TYPE_POWERF;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_POWERF);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
button->type = ACPI_BUTTON_TYPE_SLEEP;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_SLEEP);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
button->type = ACPI_BUTTON_TYPE_SLEEPF;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_SLEEPF);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
button->type = ACPI_BUTTON_TYPE_LID;
sprintf(acpi_device_name(device), "%s",
ACPI_BUTTON_DEVICE_NAME_LID);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
}
else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
......
/*
* acpi_drivers.h ($Revision: 17 $)
* acpi_drivers.h ($Revision: 23 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -30,7 +30,7 @@
#include "acpi_bus.h"
#define ACPI_DRIVER_VERSION 0x20020308
#define ACPI_DRIVER_VERSION 0x20020404
#define ACPI_MAX_STRING 80
......@@ -84,26 +84,32 @@
-------------------------------------------------------------------------- */
#define ACPI_BUTTON_COMPONENT 0x00080000
#define ACPI_BUTTON_CLASS "button"
#define ACPI_BUTTON_HID_LID "PNP0C0D"
#define ACPI_BUTTON_HID_POWER "PNP0C0C"
#define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
#define ACPI_BUTTON_HID_SLEEP "PNP0C0E"
#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB"
#define ACPI_BUTTON_DRIVER_NAME "ACPI Button Driver"
#define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button"
#define ACPI_BUTTON_DEVICE_NAME_POWERF "Power Button"
#define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button"
#define ACPI_BUTTON_DEVICE_NAME_SLEEPF "Sleep Button"
#define ACPI_BUTTON_DEVICE_NAME_LID "Lid Switch"
#define ACPI_BUTTON_CLASS "button"
#define ACPI_BUTTON_FILE_INFO "info"
#define ACPI_BUTTON_TYPE_UNKNOWN 0x00
#define ACPI_BUTTON_NOTIFY_STATUS 0x80
#define ACPI_BUTTON_SUBCLASS_POWER "power"
#define ACPI_BUTTON_HID_POWER "PNP0C0C"
#define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
#define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button (CM)"
#define ACPI_BUTTON_DEVICE_NAME_POWERF "Power Button (FF)"
#define ACPI_BUTTON_TYPE_POWER 0x01
#define ACPI_BUTTON_TYPE_POWERF 0x02
#define ACPI_BUTTON_SUBCLASS_SLEEP "sleep"
#define ACPI_BUTTON_HID_SLEEP "PNP0C0E"
#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB"
#define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button (CM)"
#define ACPI_BUTTON_DEVICE_NAME_SLEEPF "Sleep Button (FF)"
#define ACPI_BUTTON_TYPE_SLEEP 0x03
#define ACPI_BUTTON_TYPE_SLEEPF 0x04
#define ACPI_BUTTON_SUBCLASS_LID "lid"
#define ACPI_BUTTON_HID_LID "PNP0C0D"
#define ACPI_BUTTON_DEVICE_NAME_LID "Lid Switch"
#define ACPI_BUTTON_TYPE_LID 0x05
#define ACPI_BUTTON_NOTIFY_STATUS 0x80
/* --------------------------------------------------------------------------
......@@ -217,7 +223,7 @@ void acpi_power_exit (void);
#define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01
#define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02
int acpi_processor_set_limit(acpi_handle handle, int flags, int *state);
int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
/* --------------------------------------------------------------------------
......
/*
* acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 27 $)
* acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 28 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -345,7 +345,7 @@ acpi_ec_gpe_handler (
if (0 != acpi_ec_query(ec, &value))
return;
query_data = kmalloc(sizeof(struct acpi_ec_query_data), GFP_KERNEL);
query_data = kmalloc(sizeof(struct acpi_ec_query_data), GFP_ATOMIC);
if (!query_data)
return;
query_data->handle = ec->handle;
......
/*
* acpi_osl.c - OS-dependent functions ($Revision: 65 $)
* acpi_osl.c - OS-dependent functions ($Revision: 69 $)
*
* Copyright (C) 2000 Andrew Henroid
* Copyright (C) 2001 Andrew Grover
......@@ -125,13 +125,13 @@ acpi_os_vprintf(const NATIVE_CHAR *fmt, va_list args)
}
void *
acpi_os_allocate(u32 size)
acpi_os_allocate(ACPI_SIZE size)
{
return kmalloc(size, GFP_KERNEL);
}
void *
acpi_os_callocate(u32 size)
acpi_os_callocate(ACPI_SIZE size)
{
void *ptr = acpi_os_allocate(size);
if (ptr)
......@@ -148,21 +148,22 @@ acpi_os_free(void *ptr)
acpi_status
acpi_os_get_root_pointer(u32 flags, ACPI_PHYSICAL_ADDRESS *phys_addr)
acpi_os_get_root_pointer(u32 flags, ACPI_POINTER *addr)
{
#ifndef CONFIG_ACPI_EFI
if (ACPI_FAILURE(acpi_find_root_pointer(flags, phys_addr))) {
if (ACPI_FAILURE(acpi_find_root_pointer(flags, addr))) {
printk(KERN_ERR PREFIX "System description tables not found\n");
return AE_NOT_FOUND;
}
#else /*CONFIG_ACPI_EFI*/
addr->pointer_type = ACPI_PHYSICAL_POINTER;
if (efi.acpi20)
*phys_addr = (ACPI_PHYSICAL_ADDRESS) efi.acpi20;
addr->pointer.physical = (ACPI_PHYSICAL_ADDRESS) efi.acpi20;
else if (efi.acpi)
*phys_addr = (ACPI_PHYSICAL_ADDRESS) efi.acpi;
addr->pointer.physical = (ACPI_PHYSICAL_ADDRESS) efi.acpi;
else {
printk(KERN_ERR PREFIX "System description tables not found\n");
*phys_addr = 0;
addr->pointer.physical = 0;
return AE_NOT_FOUND;
}
#endif /*CONFIG_ACPI_EFI*/
......@@ -171,7 +172,7 @@ acpi_os_get_root_pointer(u32 flags, ACPI_PHYSICAL_ADDRESS *phys_addr)
}
acpi_status
acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, u32 size, void **virt)
acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, ACPI_SIZE size, void **virt)
{
if (phys > ULONG_MAX) {
printk(KERN_ERR PREFIX "Cannot map memory that high\n");
......@@ -189,7 +190,7 @@ acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, u32 size, void **virt)
}
void
acpi_os_unmap_memory(void *virt, u32 size)
acpi_os_unmap_memory(void *virt, ACPI_SIZE size)
{
iounmap(virt);
}
......@@ -441,14 +442,14 @@ acpi_os_load_module (
ACPI_FUNCTION_TRACE ("os_load_module");
if (!module_name)
return AE_BAD_PARAMETER;
return_ACPI_STATUS (AE_BAD_PARAMETER);
if (0 > request_module(module_name)) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to load module [%s].\n", module_name));
return AE_ERROR;
return_ACPI_STATUS (AE_ERROR);
}
return AE_OK;
return_ACPI_STATUS (AE_OK);
}
acpi_status
......@@ -481,7 +482,7 @@ acpi_os_queue_exec (
strcpy(current->comm, "kacpidpc");
if (!dpc || !dpc->function)
return AE_BAD_PARAMETER;
return_ACPI_STATUS (AE_BAD_PARAMETER);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Executing function [%p(%p)].\n", dpc->function, dpc->context));
......@@ -489,7 +490,7 @@ acpi_os_queue_exec (
kfree(dpc);
return 1;
return_ACPI_STATUS (AE_OK);
}
static void
......@@ -504,7 +505,7 @@ acpi_os_schedule_exec (
dpc = (ACPI_OS_DPC*)context;
if (!dpc) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
return;
return_VOID;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Creating new thread to run function [%p(%p)].\n", dpc->function, dpc->context));
......@@ -515,6 +516,7 @@ acpi_os_schedule_exec (
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to kernel_thread() failed.\n"));
acpi_os_free(dpc);
}
return_VOID;
}
acpi_status
......@@ -531,7 +533,7 @@ acpi_os_queue_for_execution(
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Scheduling function [%p(%p)] for deferred execution.\n", function, context));
if (!function)
return AE_BAD_PARAMETER;
return_ACPI_STATUS (AE_BAD_PARAMETER);
/*
* Queue via DPC:
......@@ -554,7 +556,7 @@ acpi_os_queue_for_execution(
*/
dpc = kmalloc(sizeof(ACPI_OS_DPC), GFP_ATOMIC);
if (!dpc)
return AE_NO_MEMORY;
return_ACPI_STATUS (AE_NO_MEMORY);
dpc->function = function;
dpc->context = context;
......@@ -578,7 +580,7 @@ acpi_os_queue_for_execution(
*/
dpc = kmalloc(sizeof(ACPI_OS_DPC), GFP_KERNEL);
if (!dpc)
return AE_NO_MEMORY;
return_ACPI_STATUS (AE_NO_MEMORY);
dpc->function = function;
dpc->context = context;
......@@ -587,7 +589,7 @@ acpi_os_queue_for_execution(
break;
}
return status;
return_ACPI_STATUS (status);
}
......@@ -603,7 +605,7 @@ acpi_os_create_semaphore(
sem = acpi_os_callocate(sizeof(struct semaphore));
if (!sem)
return AE_NO_MEMORY;
return_ACPI_STATUS (AE_NO_MEMORY);
sema_init(sem, initial_units);
......@@ -611,7 +613,7 @@ acpi_os_create_semaphore(
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Creating semaphore[%p|%d].\n", *handle, initial_units));
return AE_OK;
return_ACPI_STATUS (AE_OK);
}
......@@ -631,13 +633,13 @@ acpi_os_delete_semaphore(
ACPI_FUNCTION_TRACE ("os_delete_semaphore");
if (!sem)
return AE_BAD_PARAMETER;
return_ACPI_STATUS (AE_BAD_PARAMETER);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting semaphore[%p].\n", handle));
acpi_os_free(sem); sem = NULL;
return AE_OK;
return_ACPI_STATUS (AE_OK);
}
......@@ -663,10 +665,10 @@ acpi_os_wait_semaphore(
ACPI_FUNCTION_TRACE ("os_wait_semaphore");
if (!sem || (units < 1))
return AE_BAD_PARAMETER;
return_ACPI_STATUS (AE_BAD_PARAMETER);
if (units > 1)
return AE_SUPPORT;
return_ACPI_STATUS (AE_SUPPORT);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Waiting for semaphore[%p|%d|%d]\n", handle, units, timeout));
......@@ -724,7 +726,7 @@ acpi_os_wait_semaphore(
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired semaphore[%p|%d|%d]\n", handle, units, timeout));
}
return status;
return_ACPI_STATUS (status);
}
......@@ -741,16 +743,16 @@ acpi_os_signal_semaphore(
ACPI_FUNCTION_TRACE ("os_signal_semaphore");
if (!sem || (units < 1))
return AE_BAD_PARAMETER;
return_ACPI_STATUS (AE_BAD_PARAMETER);
if (units > 1)
return AE_SUPPORT;
return_ACPI_STATUS (AE_SUPPORT);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Signaling semaphore[%p|%d]\n", handle, units));
up(sem);
return AE_OK;
return_ACPI_STATUS (AE_OK);
}
u32
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
*
* Module Name: dbdisply - debug display commands
* $Revision: 66 $
* $Revision: 67 $
*
******************************************************************************/
......@@ -298,6 +298,7 @@ acpi_db_decode_internal_object (
if (!obj_desc) {
acpi_os_printf (" Uninitialized\n");
return;
}
......@@ -420,10 +421,10 @@ acpi_db_display_internal_object (
break;
case AML_LOCAL_OP:
acpi_os_printf ("[Local%d]", obj_desc->reference.offset);
acpi_os_printf ("[Local%d] ", obj_desc->reference.offset);
if (walk_state) {
obj_desc = walk_state->local_variables[obj_desc->reference.offset].object;
acpi_os_printf (" %p", obj_desc);
acpi_os_printf ("%p", obj_desc);
acpi_db_decode_internal_object (obj_desc);
}
break;
......@@ -432,7 +433,7 @@ acpi_db_display_internal_object (
acpi_os_printf ("[Arg%d] ", obj_desc->reference.offset);
if (walk_state) {
obj_desc = walk_state->arguments[obj_desc->reference.offset].object;
acpi_os_printf (" %p", obj_desc);
acpi_os_printf ("%p", obj_desc);
acpi_db_decode_internal_object (obj_desc);
}
break;
......@@ -467,7 +468,6 @@ acpi_db_display_internal_object (
break;
}
acpi_os_printf ("\n");
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment