Commit f00ea1e1 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linuxusb.bkbits.net/linus-2.5

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 6e2868e5 bea92fd5
......@@ -1924,35 +1924,38 @@ static int __init apm_init(void)
* that extends up to the end of page zero (that we have reserved).
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*
* NOTE: on SMP we call into the APM BIOS only on CPU#0, so it's
* enough to modify CPU#0's GDT.
*/
set_base(gdt[APM_40 >> 3],
set_base(cpu_gdt_table[0][APM_40 >> 3],
__va((unsigned long)0x40 << 4));
_set_limit((char *)&gdt[APM_40 >> 3], 4095 - (0x40 << 4));
_set_limit((char *)&cpu_gdt_table[0][APM_40 >> 3], 4095 - (0x40 << 4));
apm_bios_entry.offset = apm_info.bios.offset;
apm_bios_entry.segment = APM_CS;
set_base(gdt[APM_CS >> 3],
set_base(cpu_gdt_table[0][APM_CS >> 3],
__va((unsigned long)apm_info.bios.cseg << 4));
set_base(gdt[APM_CS_16 >> 3],
set_base(cpu_gdt_table[0][APM_CS_16 >> 3],
__va((unsigned long)apm_info.bios.cseg_16 << 4));
set_base(gdt[APM_DS >> 3],
set_base(cpu_gdt_table[0][APM_DS >> 3],
__va((unsigned long)apm_info.bios.dseg << 4));
#ifndef APM_RELAX_SEGMENTS
if (apm_info.bios.version == 0x100) {
#endif
/* For ASUS motherboard, Award BIOS rev 110 (and others?) */
_set_limit((char *)&gdt[APM_CS >> 3], 64 * 1024 - 1);
_set_limit((char *)&cpu_gdt_table[0][APM_CS >> 3], 64 * 1024 - 1);
/* For some unknown machine. */
_set_limit((char *)&gdt[APM_CS_16 >> 3], 64 * 1024 - 1);
_set_limit((char *)&cpu_gdt_table[0][APM_CS_16 >> 3], 64 * 1024 - 1);
/* For the DEC Hinote Ultra CT475 (and others?) */
_set_limit((char *)&gdt[APM_DS >> 3], 64 * 1024 - 1);
_set_limit((char *)&cpu_gdt_table[0][APM_DS >> 3], 64 * 1024 - 1);
#ifndef APM_RELAX_SEGMENTS
} else {
_set_limit((char *)&gdt[APM_CS >> 3],
_set_limit((char *)&cpu_gdt_table[0][APM_CS >> 3],
(apm_info.bios.cseg_len - 1) & 0xffff);
_set_limit((char *)&gdt[APM_CS_16 >> 3],
_set_limit((char *)&cpu_gdt_table[0][APM_CS_16 >> 3],
(apm_info.bios.cseg_16_len - 1) & 0xffff);
_set_limit((char *)&gdt[APM_DS >> 3],
_set_limit((char *)&cpu_gdt_table[0][APM_DS >> 3],
(apm_info.bios.dseg_len - 1) & 0xffff);
}
#endif
......
......@@ -421,14 +421,14 @@ void __init early_cpu_init(void)
*/
void __init cpu_init (void)
{
int nr = smp_processor_id();
struct tss_struct * t = &init_tss[nr];
int cpu = smp_processor_id();
struct tss_struct * t = init_tss + cpu;
if (test_and_set_bit(nr, &cpu_initialized)) {
printk(KERN_WARNING "CPU#%d already initialized!\n", nr);
if (test_and_set_bit(cpu, &cpu_initialized)) {
printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
for (;;) local_irq_enable();
}
printk(KERN_INFO "Initializing CPU#%d\n", nr);
printk(KERN_INFO "Initializing CPU#%d\n", cpu);
if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
......@@ -441,7 +441,17 @@ void __init cpu_init (void)
}
#endif
__asm__ __volatile__("lgdt %0": "=m" (gdt_descr));
/*
* Initialize the per-CPU GDT with the boot GDT,
* and set up the GDT descriptor:
*/
if (cpu) {
memcpy(cpu_gdt_table[cpu], cpu_gdt_table[0], GDT_SIZE);
cpu_gdt_descr[cpu].size = GDT_SIZE;
cpu_gdt_descr[cpu].address = (unsigned long)cpu_gdt_table[cpu];
}
__asm__ __volatile__("lgdt %0": "=m" (cpu_gdt_descr[cpu]));
__asm__ __volatile__("lidt %0": "=m" (idt_descr));
/*
......@@ -450,18 +460,18 @@ void __init cpu_init (void)
__asm__("pushfl ; andl $0xffffbfff,(%esp) ; popfl");
/*
* set up and load the per-CPU TSS and LDT
* Set up and load the per-CPU TSS and LDT
*/
atomic_inc(&init_mm.mm_count);
current->active_mm = &init_mm;
if(current->mm)
BUG();
enter_lazy_tlb(&init_mm, current, nr);
enter_lazy_tlb(&init_mm, current, cpu);
t->esp0 = current->thread.esp0;
set_tss_desc(nr,t);
gdt_table[__TSS(nr)].b &= 0xfffffdff;
load_TR(nr);
set_tss_desc(cpu,t);
cpu_gdt_table[cpu][TSS_ENTRY].b &= 0xfffffdff;
load_TR_desc();
load_LDT(&init_mm.context);
/* Clear %fs and %gs. */
......
......@@ -417,7 +417,6 @@ ENTRY(simd_coprocessor_error)
ENTRY(device_not_available)
pushl $-1 # mark this as an int
SAVE_ALL
GET_THREAD_INFO(%ebx)
movl %cr0, %eax
testl $0x4, %eax # EM (math emulation bit)
jne device_not_available_emulate
......@@ -753,6 +752,7 @@ ENTRY(sys_call_table)
.long sys_futex /* 240 */
.long sys_sched_setaffinity
.long sys_sched_getaffinity
.long sys_set_thread_area
.rept NR_syscalls-(.-sys_call_table)/4
.long sys_ni_syscall
......
......@@ -231,7 +231,7 @@ is386: movl $2,%ecx # set MP
call check_x87
incb ready
lgdt gdt_descr
lgdt cpu_gdt_descr
lidt idt_descr
ljmp $(__KERNEL_CS),$1f
1: movl $(__KERNEL_DS),%eax # reload all the segment registers
......@@ -338,29 +338,28 @@ ignore_int:
iret
/*
* The interrupt descriptor table has room for 256 idt's,
* the global descriptor table is dependent on the number
* of tasks we can have..
* The IDT and GDT 'descriptors' are a strange 48-bit object
* only used by the lidt and lgdt instructions. They are not
* like usual segment descriptors - they consist of a 16-bit
* segment size, and 32-bit linear address value:
*/
#define IDT_ENTRIES 256
#define GDT_ENTRIES (__TSS(NR_CPUS))
.globl idt
.globl gdt
.globl idt_descr
.globl cpu_gdt_descr
ALIGN
.word 0
.word 0 # 32-bit align idt_desc.address
idt_descr:
.word IDT_ENTRIES*8-1 # idt contains 256 entries
idt:
.long idt_table
.word 0
gdt_descr:
# boot GDT descriptor (later on used by CPU#0):
cpu_gdt_descr:
.word GDT_ENTRIES*8-1
gdt:
.long gdt_table
.long cpu_gdt_table
.fill NR_CPUS-1,6,0 # space for the other GDT descriptors
/*
* This is initialized to create an identity-mapping at 0-8M (for bootup
......@@ -418,15 +417,15 @@ ALIGN
* NOTE! Make sure the gdt descriptor in head.S matches this if you
* change anything.
*/
ENTRY(gdt_table)
ENTRY(cpu_gdt_table)
.quad 0x0000000000000000 /* NULL descriptor */
.quad 0x0000000000000000 /* not used */
.quad 0x0000000000000000 /* TLS descriptor */
.quad 0x00cf9a000000ffff /* 0x10 kernel 4GB code at 0x00000000 */
.quad 0x00cf92000000ffff /* 0x18 kernel 4GB data at 0x00000000 */
.quad 0x00cffa000000ffff /* 0x23 user 4GB code at 0x00000000 */
.quad 0x00cff2000000ffff /* 0x2b user 4GB data at 0x00000000 */
.quad 0x0000000000000000 /* not used */
.quad 0x0000000000000000 /* not used */
.quad 0x0000000000000000 /* TSS descriptor */
.quad 0x0000000000000000 /* LDT descriptor */
/*
* The APM segments have byte granularity and their bases
* and limits are set at run time.
......@@ -444,5 +443,8 @@ ENTRY(gdt_table)
.quad 0x0000000000000000 /* 0x88 not used */
.quad 0x0000000000000000 /* 0x90 not used */
.quad 0x0000000000000000 /* 0x98 not used */
/* Per CPU segments */
.fill NR_CPUS*4,8,0 /* space for TSS's and LDT's */
#if CONFIG_SMP
.fill (NR_CPUS-1)*GDT_ENTRIES,8,0 /* other CPU's GDT */
#endif
......@@ -74,7 +74,6 @@ EXPORT_SYMBOL(pm_idle);
EXPORT_SYMBOL(pm_power_off);
EXPORT_SYMBOL(get_cmos_time);
EXPORT_SYMBOL(apm_info);
EXPORT_SYMBOL(gdt);
#ifdef CONFIG_DEBUG_IOVIRT
EXPORT_SYMBOL(__io_virt_debug);
......
......@@ -662,7 +662,8 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
{
struct thread_struct *prev = &prev_p->thread,
*next = &next_p->thread;
struct tss_struct *tss = init_tss + smp_processor_id();
int cpu = smp_processor_id();
struct tss_struct *tss = init_tss + cpu;
/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
......@@ -688,6 +689,14 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
loadsegment(gs, next->gs);
}
/*
* Load the per-thread Thread-Local Storage descriptor.
*
* NOTE: it's faster to do the two stores unconditionally
* than to branch away.
*/
load_TLS_desc(next, cpu);
/*
* Now maybe reload the debug registers
*/
......@@ -818,3 +827,58 @@ unsigned long get_wchan(struct task_struct *p)
}
#undef last_sched
#undef first_sched
/*
* Set the Thread-Local Storage area:
*/
asmlinkage int sys_set_thread_area(unsigned int base, unsigned int limit, unsigned int flags)
{
struct thread_struct *t = &current->thread;
int limit_in_pages = 0, writable = 0;
int cpu;
/* do not allow unused flags */
if (flags & ~TLS_FLAGS_MASK)
return -EINVAL;
/* check limit */
if (limit & 0xfff00000)
return -EINVAL;
/*
* Clear the TLS?
*/
if (flags & TLS_FLAG_CLEAR) {
cpu = get_cpu();
t->tls_base = t->tls_limit = t->tls_flags = 0;
t->tls_desc.a = t->tls_desc.b = 0;
load_TLS_desc(t, cpu);
put_cpu();
return 0;
}
if (flags & TLS_FLAG_LIMIT_IN_PAGES)
limit_in_pages = 1;
if (flags & TLS_FLAG_WRITABLE)
writable = 1;
/*
* We must not get preempted while modifying the TLS.
*/
cpu = get_cpu();
t->tls_base = base;
t->tls_limit = limit;
t->tls_flags = flags;
t->tls_desc.a = ((base & 0x0000ffff) << 16) | (limit & 0x0ffff);
t->tls_desc.b = (base & 0xff000000) | ((base & 0x00ff0000) >> 16) |
(limit & 0xf0000) | (writable << 9) | (1 << 15) |
(1 << 22) | (limit_in_pages << 23) | 0x7000;
load_TLS_desc(t, cpu);
put_cpu();
return TLS_ENTRY*8 + 3;
}
......@@ -646,7 +646,10 @@ asmlinkage void smp_call_function_interrupt(void)
/*
* At this point the info structure may be out of scope unless wait==1
*/
irq_enter();
(*func)(info);
irq_exit();
if (wait) {
mb();
atomic_inc(&call_data->finished);
......
......@@ -203,14 +203,13 @@ void do_suspend_lowlevel(int resume)
void fix_processor_context(void)
{
int nr = smp_processor_id();
struct tss_struct * t = &init_tss[nr];
int cpu = smp_processor_id();
struct tss_struct * t = init_tss + cpu;
set_tss_desc(nr,t); /* This just modifies memory; should not be neccessary. But... This is neccessary, because 386 hardware has concept of busy tsc or some similar stupidity. */
gdt_table[__TSS(nr)].b &= 0xfffffdff;
load_TR(nr); /* This does ltr */
set_tss_desc(cpu,t); /* This just modifies memory; should not be neccessary. But... This is neccessary, because 386 hardware has concept of busy tsc or some similar stupidity. */
cpu_gdt_table[cpu][TSS_ENTRY].b &= 0xfffffdff;
load_TR_desc(); /* This does ltr */
load_LDT(&current->mm->context); /* This does lldt */
/*
......
......@@ -63,9 +63,14 @@ idt_48:
.word 0 # idt limit = 0
.word 0, 0 # idt base = 0L
#
# NOTE: here we actually use CPU#0's GDT - but that is OK, we reload
# the proper GDT shortly after booting up the secondary CPUs.
#
gdt_48:
.word 0x0800 # gdt limit = 2048, 256 GDT entries
.long gdt_table-__PAGE_OFFSET # gdt base = gdt (first SMP CPU)
.long cpu_gdt_table-__PAGE_OFFSET # gdt base = gdt (first SMP CPU)
.globl trampoline_end
trampoline_end:
......@@ -784,11 +784,10 @@ void __init trap_init_f00f_bug(void)
__set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO);
/*
* "idt" is magic - it overlaps the idt_descr
* variable so that updating idt will automatically
* update the idt descriptor..
* Update the IDT descriptor and reload the IDT so that
* it uses the read-only mapped virtual address.
*/
idt = (struct desc_struct *) fix_to_virt(FIX_F00F_IDT);
idt_descr.address = fix_to_virt(FIX_F00F_IDT);
__asm__ __volatile__("lidt %0": "=m" (idt_descr));
}
#endif
......@@ -833,37 +832,6 @@ static void __init set_call_gate(void *a, void *addr)
_set_gate(a,12,3,addr);
}
#define _set_seg_desc(gate_addr,type,dpl,base,limit) {\
*((gate_addr)+1) = ((base) & 0xff000000) | \
(((base) & 0x00ff0000)>>16) | \
((limit) & 0xf0000) | \
((dpl)<<13) | \
(0x00408000) | \
((type)<<8); \
*(gate_addr) = (((base) & 0x0000ffff)<<16) | \
((limit) & 0x0ffff); }
#define _set_tssldt_desc(n,addr,limit,type) \
__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
"movw %%ax,2(%2)\n\t" \
"rorl $16,%%eax\n\t" \
"movb %%al,4(%2)\n\t" \
"movb %4,5(%2)\n\t" \
"movb $0,6(%2)\n\t" \
"movb %%ah,7(%2)\n\t" \
"rorl $16,%%eax" \
: "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type))
void set_tss_desc(unsigned int n, void *addr)
{
_set_tssldt_desc(gdt_table+__TSS(n), (int)addr, 235, 0x89);
}
void set_ldt_desc(unsigned int n, void *addr, unsigned int size)
{
_set_tssldt_desc(gdt_table+__LDT(n), (int)addr, ((size << 3)-1), 0x82);
}
#ifdef CONFIG_X86_VISWS_APIC
/*
......
......@@ -9,7 +9,7 @@
O_TARGET := mm.o
obj-y := init.o fault.o ioremap.o extable.o pageattr.o
obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o
export-objs := pageattr.o
include $(TOPDIR)/Rules.make
......@@ -24,6 +24,7 @@
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/hardirq.h>
#include <asm/desc.h>
extern void die(const char *,struct pt_regs *,long);
......@@ -129,7 +130,6 @@ void bust_spinlocks(int yes)
}
asmlinkage void do_invalid_op(struct pt_regs *, unsigned long);
extern unsigned long idt;
/*
* This routine handles page faults. It determines the address,
......@@ -293,7 +293,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (boot_cpu_data.f00f_bug) {
unsigned long nr;
nr = (address - idt) >> 3;
nr = (address - idt_descr.address) >> 3;
if (nr == 6) {
do_invalid_op(regs, 0);
......
This diff is collapsed.
/*
* linux/arch/i386/mm/pgtable.c
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/smp.h>
#include <linux/highmem.h>
#include <linux/slab.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/fixmap.h>
#include <asm/e820.h>
#include <asm/tlb.h>
#include <asm/tlbflush.h>
void show_mem(void)
{
int i, total = 0, reserved = 0;
int shared = 0, cached = 0;
int highmem = 0;
printk("Mem-info:\n");
show_free_areas();
printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
i = max_mapnr;
while (i-- > 0) {
total++;
if (PageHighMem(mem_map+i))
highmem++;
if (PageReserved(mem_map+i))
reserved++;
else if (PageSwapCache(mem_map+i))
cached++;
else if (page_count(mem_map+i))
shared += page_count(mem_map+i) - 1;
}
printk("%d pages of RAM\n", total);
printk("%d pages of HIGHMEM\n",highmem);
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
}
/*
* Associate a virtual page frame with a given physical page frame
* and protection flags for that frame.
*/
static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
{
pgd_t *pgd;
pmd_t *pmd;
pte_t *pte;
pgd = swapper_pg_dir + __pgd_offset(vaddr);
if (pgd_none(*pgd)) {
BUG();
return;
}
pmd = pmd_offset(pgd, vaddr);
if (pmd_none(*pmd)) {
BUG();
return;
}
pte = pte_offset_kernel(pmd, vaddr);
/* <pfn,flags> stored as-is, to permit clearing entries */
set_pte(pte, pfn_pte(pfn, flags));
/*
* It's enough to flush this one mapping.
* (PGE mappings get flushed as well)
*/
__flush_tlb_one(vaddr);
}
void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
{
unsigned long address = __fix_to_virt(idx);
if (idx >= __end_of_fixed_addresses) {
BUG();
return;
}
set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
}
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
{
int count = 0;
pte_t *pte;
do {
pte = (pte_t *) __get_free_page(GFP_KERNEL);
if (pte)
clear_page(pte);
else {
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
}
} while (!pte && (count++ < 10));
return pte;
}
struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
{
int count = 0;
struct page *pte;
do {
#if CONFIG_HIGHPTE
pte = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, 0);
#else
pte = alloc_pages(GFP_KERNEL, 0);
#endif
if (pte)
clear_highpage(pte);
else {
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
}
} while (!pte && (count++ < 10));
return pte;
}
#if CONFIG_X86_PAE
pgd_t *pgd_alloc(struct mm_struct *mm)
{
int i;
pgd_t *pgd = kmem_cache_alloc(pae_pgd_cachep, GFP_KERNEL);
if (pgd) {
for (i = 0; i < USER_PTRS_PER_PGD; i++) {
unsigned long pmd = __get_free_page(GFP_KERNEL);
if (!pmd)
goto out_oom;
clear_page(pmd);
set_pgd(pgd + i, __pgd(1 + __pa(pmd)));
}
memcpy(pgd + USER_PTRS_PER_PGD,
swapper_pg_dir + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
}
return pgd;
out_oom:
for (i--; i >= 0; i--)
free_page((unsigned long)__va(pgd_val(pgd[i])-1));
kmem_cache_free(pae_pgd_cachep, pgd);
return NULL;
}
void pgd_free(pgd_t *pgd)
{
int i;
for (i = 0; i < USER_PTRS_PER_PGD; i++)
free_page((unsigned long)__va(pgd_val(pgd[i])-1));
kmem_cache_free(pae_pgd_cachep, pgd);
}
#else
pgd_t *pgd_alloc(struct mm_struct *mm)
{
pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL);
if (pgd) {
memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
memcpy(pgd + USER_PTRS_PER_PGD,
swapper_pg_dir + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
}
return pgd;
}
void pgd_free(pgd_t *pgd)
{
free_page((unsigned long)pgd);
}
#endif /* CONFIG_X86_PAE */
/*
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 26 $)
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -47,12 +47,12 @@ int acpi_ac_add (struct acpi_device *device);
int acpi_ac_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_ac_driver = {
name: ACPI_AC_DRIVER_NAME,
class: ACPI_AC_CLASS,
ids: ACPI_AC_HID,
ops: {
add: acpi_ac_add,
remove: acpi_ac_remove,
.name = ACPI_AC_DRIVER_NAME,
.class = ACPI_AC_CLASS,
.ids = ACPI_AC_HID,
.ops = {
.add = acpi_ac_add,
.remove = acpi_ac_remove,
},
};
......
/*
* acpi_battery.c - ACPI Battery Driver ($Revision: 36 $)
* acpi_battery.c - ACPI Battery Driver ($Revision: 37 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -52,12 +52,12 @@ static int acpi_battery_add (struct acpi_device *device);
static int acpi_battery_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_battery_driver = {
name: ACPI_BATTERY_DRIVER_NAME,
class: ACPI_BATTERY_CLASS,
ids: ACPI_BATTERY_HID,
ops: {
add: acpi_battery_add,
remove: acpi_battery_remove,
.name = ACPI_BATTERY_DRIVER_NAME,
.class = ACPI_BATTERY_CLASS,
.ids = ACPI_BATTERY_HID,
.ops = {
.add = acpi_battery_add,
.remove = acpi_battery_remove,
},
};
......
/*
* acpi_bus.c - ACPI Bus Driver ($Revision: 79 $)
* acpi_bus.c - ACPI Bus Driver ($Revision: 80 $)
*
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*
......@@ -97,10 +97,10 @@ static int acpi_device_suspend(struct device *dev, u32 state, u32 stage);
static int acpi_device_resume(struct device *dev, u32 stage);
static struct device_driver acpi_bus_driver = {
probe: acpi_device_probe,
remove: acpi_device_remove,
suspend: acpi_device_suspend,
resume: acpi_device_resume,
.probe = acpi_device_probe,
.remove = acpi_device_remove,
.suspend = acpi_device_suspend,
.resume = acpi_device_resume,
};
......
/*
* acpi_button.c - ACPI Button Driver ($Revision: 29 $)
* acpi_button.c - ACPI Button Driver ($Revision: 30 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -47,12 +47,12 @@ int acpi_button_add (struct acpi_device *device);
int acpi_button_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_button_driver = {
name: ACPI_BUTTON_DRIVER_NAME,
class: ACPI_BUTTON_CLASS,
ids: "ACPI_FPB,ACPI_FSB,PNP0C0D,PNP0C0C,PNP0C0E",
ops: {
add: acpi_button_add,
remove: acpi_button_remove,
.name = ACPI_BUTTON_DRIVER_NAME,
.class = ACPI_BUTTON_CLASS,
.ids = "ACPI_FPB,ACPI_FSB,PNP0C0D,PNP0C0C,PNP0C0E",
.ops = {
.add = acpi_button_add,
.remove = acpi_button_remove,
},
};
......
/*******************************************************************************
*
* Module Name: dbcmds - debug commands and output routines
* $Revision: 84 $
* $Revision: 85 $
*
******************************************************************************/
......@@ -31,6 +31,7 @@
#include "acevents.h"
#include "acdebug.h"
#include "acresrc.h"
#include "acdisasm.h"
#ifdef ENABLE_DEBUGGER
......@@ -342,7 +343,7 @@ acpi_db_disassemble_aml (
num_statements = ACPI_STRTOUL (statements, NULL, 0);
}
acpi_db_display_op (NULL, op, num_statements);
acpi_dm_disassemble (NULL, op, num_statements);
}
......
......@@ -2,7 +2,7 @@
*
* Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode)
* $Revision: 64 $
* $Revision: 67 $
*
******************************************************************************/
......@@ -30,7 +30,7 @@
#include "acnamesp.h"
#include "actables.h"
#ifdef ENABLE_DEBUGGER
#if (defined ENABLE_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
......@@ -86,6 +86,7 @@ acpi_db_match_argument (
}
#ifdef ENABLE_DEBUGGER
/*******************************************************************************
*
* FUNCTION: Acpi_db_close_debug_file
......@@ -148,6 +149,7 @@ acpi_db_open_debug_file (
#endif
}
#endif
#ifdef ACPI_APPLICATION
......@@ -190,7 +192,7 @@ acpi_db_load_table(
status = acpi_tb_validate_table_header (&table_header);
if ((ACPI_FAILURE (status)) ||
(table_header.length > 524288)) /* 1/2 Mbyte should be enough */ {
(table_header.length > 0x800000)) /* 8 Mbyte should be enough */ {
acpi_os_printf ("Table header is invalid!\n");
return (AE_ERROR);
}
......@@ -296,7 +298,7 @@ ae_local_load_table (
}
#ifndef PARSER_ONLY
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
status = acpi_ns_load_table (table_info.installed_desc, acpi_gbl_root_node);
if (ACPI_FAILURE (status)) {
/* Uninstall table and free the buffer */
......@@ -330,7 +332,7 @@ acpi_db_get_acpi_table (
/* Get the entire file */
acpi_os_printf ("Loading Acpi table from file %s\n", filename);
fprintf (stderr, "Loading Acpi table from file %s\n", filename);
status = acpi_db_load_table (fp, &acpi_gbl_db_table_ptr, &table_length);
fclose(fp);
......@@ -383,8 +385,8 @@ acpi_db_load_acpi_table (
return (status);
}
acpi_os_printf ("%4.4s at %p successfully installed and loaded\n",
acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr);
fprintf (stderr, "Acpi table [%4.4s] successfully installed and loaded\n",
acpi_gbl_db_table_ptr->signature);
acpi_gbl_acpi_hardware_present = FALSE;
......
/*******************************************************************************
*
* Module Name: dbxface - AML Debugger external interfaces
* $Revision: 59 $
* $Revision: 61 $
*
******************************************************************************/
......@@ -27,6 +27,7 @@
#include "acpi.h"
#include "amlcode.h"
#include "acdebug.h"
#include "acdisasm.h"
#ifdef ENABLE_DEBUGGER
......@@ -164,7 +165,7 @@ acpi_db_single_step (
/* Now we can display it */
acpi_db_display_op (walk_state, display_op, ACPI_UINT32_MAX);
acpi_dm_disassemble (walk_state, display_op, ACPI_UINT32_MAX);
if ((op->common.aml_opcode == AML_IF_OP) ||
(op->common.aml_opcode == AML_WHILE_OP)) {
......@@ -351,7 +352,6 @@ acpi_db_initialize (void)
}
if (!acpi_gbl_db_opt_verbose) {
acpi_gbl_db_disasm_indent = " ";
acpi_gbl_db_opt_disasm = TRUE;
acpi_gbl_db_opt_stats = FALSE;
}
......
This diff is collapsed.
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
* $Revision: 93 $
* $Revision: 94 $
*
******************************************************************************/
......@@ -35,6 +35,7 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsutils")
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
......@@ -235,6 +236,47 @@ acpi_ds_delete_result_if_not_used (
}
/*******************************************************************************
*
* FUNCTION: Acpi_ds_resolve_operands
*
* PARAMETERS: Walk_state - Current walk state with operands on stack
*
* RETURN: Status
*
* DESCRIPTION: Resolve all operands to their values. Used to prepare
* arguments to a control method invocation (a call from one
* method to another.)
*
******************************************************************************/
acpi_status
acpi_ds_resolve_operands (
acpi_walk_state *walk_state)
{
u32 i;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state);
/*
* Attempt to resolve each of the valid operands
* Method arguments are passed by value, not by reference
*/
for (i = 0; i < walk_state->num_operands; i++) {
status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state);
if (ACPI_FAILURE (status)) {
break;
}
}
return_ACPI_STATUS (status);
}
#endif
/*******************************************************************************
*
* FUNCTION: Acpi_ds_create_operand
......@@ -515,42 +557,3 @@ acpi_ds_create_operands (
}
/*******************************************************************************
*
* FUNCTION: Acpi_ds_resolve_operands
*
* PARAMETERS: Walk_state - Current walk state with operands on stack
*
* RETURN: Status
*
* DESCRIPTION: Resolve all operands to their values. Used to prepare
* arguments to a control method invocation (a call from one
* method to another.)
*
******************************************************************************/
acpi_status
acpi_ds_resolve_operands (
acpi_walk_state *walk_state)
{
u32 i;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state);
/*
* Attempt to resolve each of the valid operands
* Method arguments are passed by value, not by reference
*/
for (i = 0; i < walk_state->num_operands; i++) {
status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state);
if (ACPI_FAILURE (status)) {
break;
}
}
return_ACPI_STATUS (status);
}
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 67 $
* $Revision: 69 $
*
*****************************************************************************/
......@@ -70,9 +70,11 @@ acpi_ds_init_callbacks (
break;
case 3:
#ifndef ACPI_NO_METHOD_EXECUTION
walk_state->parse_flags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE;
walk_state->descending_callback = acpi_ds_exec_begin_op;
walk_state->ascending_callback = acpi_ds_exec_end_op;
#endif
break;
default:
......@@ -169,6 +171,11 @@ acpi_ds_load1_begin_op (
op->named.name = node->name.integer;
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
op->named.path = (u8 *) path;
#endif
/*
* Put the Node in the "op" object that the parser uses, so we
* can get it again quickly when this scope is closed
......@@ -221,6 +228,7 @@ acpi_ds_load1_end_op (
object_type = walk_state->op_info->object_type;
#ifndef ACPI_NO_METHOD_EXECUTION
if (walk_state->op_info->flags & AML_FIELD) {
if (walk_state->opcode == AML_FIELD_OP ||
walk_state->opcode == AML_BANK_FIELD_OP ||
......@@ -238,6 +246,7 @@ acpi_ds_load1_end_op (
return (status);
}
}
#endif
if (op->common.aml_opcode == AML_NAME_OP) {
/* For Name opcode, get the object type from the argument */
......@@ -430,7 +439,9 @@ acpi_ds_load2_end_op (
acpi_namespace_node *node;
acpi_parse_object *arg;
acpi_namespace_node *new_node;
#ifndef ACPI_NO_METHOD_EXECUTION
u32 i;
#endif
ACPI_FUNCTION_NAME ("Ds_load2_end_op");
......@@ -478,6 +489,7 @@ acpi_ds_load2_end_op (
}
}
/*
* Named operations are as follows:
*
......@@ -515,6 +527,8 @@ acpi_ds_load2_end_op (
arg = op->common.value.arg;
switch (walk_state->op_info->type) {
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_TYPE_CREATE_FIELD:
/*
......@@ -604,7 +618,7 @@ acpi_ds_load2_end_op (
}
break;
#endif /* ACPI_NO_METHOD_EXECUTION */
case AML_TYPE_NAMED_COMPLEX:
......@@ -629,6 +643,7 @@ acpi_ds_load2_end_op (
break;
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_REGION_OP:
/*
* The Op_region is not fully parsed at this time. Only valid argument is the Space_id.
......@@ -656,6 +671,7 @@ acpi_ds_load2_end_op (
status = acpi_ds_create_node (walk_state, node, op);
break;
#endif /* ACPI_NO_METHOD_EXECUTION */
default:
......
/******************************************************************************
*
* Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 65 $
* $Revision: 67 $
*
*****************************************************************************/
......@@ -837,7 +837,7 @@ acpi_ds_create_walk_state (
/* Init the method args/local */
#ifndef _ACPI_ASL_COMPILER
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
acpi_ds_method_data_init (walk_state);
#endif
......@@ -858,7 +858,6 @@ acpi_ds_create_walk_state (
}
#ifndef _ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: Acpi_ds_init_aml_walk
......@@ -943,7 +942,6 @@ acpi_ds_init_aml_walk (
status = acpi_ds_init_callbacks (walk_state, pass_number);
return_ACPI_STATUS (status);
}
#endif
/*******************************************************************************
......
/*
* acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 35 $)
* acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 38 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -62,14 +62,14 @@ static int acpi_ec_start (struct acpi_device *device);
static int acpi_ec_stop (struct acpi_device *device, int type);
static struct acpi_driver acpi_ec_driver = {
name: ACPI_EC_DRIVER_NAME,
class: ACPI_EC_CLASS,
ids: ACPI_EC_HID,
ops: {
add: acpi_ec_add,
remove: acpi_ec_remove,
start: acpi_ec_start,
stop: acpi_ec_stop,
.name = ACPI_EC_DRIVER_NAME,
.class = ACPI_EC_CLASS,
.ids = ACPI_EC_HID,
.ops = {
.add = acpi_ec_add,
.remove = acpi_ec_remove,
.start = acpi_ec_start,
.stop = acpi_ec_stop,
},
};
......@@ -134,7 +134,7 @@ static int
acpi_ec_read (
struct acpi_ec *ec,
u8 address,
u8 *data)
u32 *data)
{
acpi_status status = AE_OK;
int result = 0;
......@@ -167,7 +167,7 @@ acpi_ec_read (
goto end;
acpi_hw_low_level_read(8, (u32*) data, &ec->data_addr, 0);
acpi_hw_low_level_read(8, data, &ec->data_addr, 0);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n",
*data, address));
......@@ -237,7 +237,7 @@ acpi_ec_write (
static int
acpi_ec_query (
struct acpi_ec *ec,
u8 *data)
u32 *data)
{
int result = 0;
acpi_status status = AE_OK;
......@@ -269,7 +269,7 @@ acpi_ec_query (
if (result)
goto end;
acpi_hw_low_level_read(8, (u32*) data, &ec->data_addr, 0);
acpi_hw_low_level_read(8, data, &ec->data_addr, 0);
if (!*data)
result = -ENODATA;
......@@ -328,7 +328,7 @@ acpi_ec_gpe_handler (
{
acpi_status status = AE_OK;
struct acpi_ec *ec = (struct acpi_ec *) data;
u8 value = 0;
u32 value = 0;
unsigned long flags = 0;
struct acpi_ec_query_data *query_data = NULL;
......@@ -336,7 +336,7 @@ acpi_ec_gpe_handler (
return;
spin_lock_irqsave(&ec->lock, flags);
acpi_hw_low_level_read(8, (u32*) &value, &ec->command_addr, 0);
acpi_hw_low_level_read(8, &value, &ec->command_addr, 0);
spin_unlock_irqrestore(&ec->lock, flags);
/* TBD: Implement asynch events!
......@@ -398,6 +398,7 @@ acpi_ec_space_handler (
{
int result = 0;
struct acpi_ec *ec = NULL;
u32 temp = 0;
ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
......@@ -408,7 +409,8 @@ acpi_ec_space_handler (
switch (function) {
case ACPI_READ:
result = acpi_ec_read(ec, (u8) address, (u8*) value);
result = acpi_ec_read(ec, (u8) address, &temp);
*value = (acpi_integer) temp;
break;
case ACPI_WRITE:
result = acpi_ec_write(ec, (u8) address, (u8) *value);
......
/******************************************************************************
*
* Module Name: excreate - Named object creation
* $Revision: 92 $
* $Revision: 93 $
*
*****************************************************************************/
......@@ -36,6 +36,7 @@
ACPI_MODULE_NAME ("excreate")
#ifndef ACPI_NO_METHOD_EXECUTION
/*****************************************************************************
*
* FUNCTION: Acpi_ex_create_alias
......@@ -490,6 +491,7 @@ acpi_ex_create_power_resource (
return_ACPI_STATUS (status);
}
#endif
/*****************************************************************************
*
......
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
* $Revision: 156 $
* $Revision: 157 $
*
*****************************************************************************/
......@@ -575,14 +575,14 @@ acpi_ex_dump_object_descriptor (
{
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
{
return;
return_VOID;
}
}
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND)
{
acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
return;
return_VOID;
}
/* Common Fields */
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
* $Revision: 140 $
* $Revision: 141 $
*
*****************************************************************************/
......@@ -804,16 +804,7 @@ acpi_ex_opcode_1A_0T_1R (
switch (operand[0]->reference.target_type) {
case ACPI_TYPE_BUFFER_FIELD:
/* Ensure that the Buffer arguments are evaluated */
temp_desc = operand[0]->reference.object;
#if 0
status = acpi_ds_get_buffer_arguments (temp_desc);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
#endif
/*
* Create a new object that contains one element of the
......@@ -841,14 +832,6 @@ acpi_ex_opcode_1A_0T_1R (
case ACPI_TYPE_PACKAGE:
#if 0
/* Ensure that the Package arguments are evaluated */
status = acpi_ds_get_package_arguments (operand[0]->reference.object);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
#endif
/*
* Return the referenced element of the package. We must add
* another reference to the referenced object, however.
......@@ -884,6 +867,11 @@ acpi_ex_opcode_1A_0T_1R (
return_desc = operand[0]->reference.object;
if (ACPI_GET_DESCRIPTOR_TYPE (return_desc) == ACPI_DESC_TYPE_NAMED) {
return_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) return_desc);
}
/* Add another reference to the object! */
acpi_ut_add_reference (return_desc);
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
* $Revision: 100 $
* $Revision: 102 $
*
*****************************************************************************/
......@@ -50,6 +50,34 @@
ACPI_MODULE_NAME ("exutils")
/*******************************************************************************
*
* FUNCTION: Acpi_ex_validate_object_type
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
u8
acpi_ex_validate_object_type (
acpi_object_type type)
{
ACPI_FUNCTION_ENTRY ();
if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX)) {
return (FALSE);
}
return (TRUE);
}
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: Acpi_ex_enter_interpreter
......@@ -116,33 +144,6 @@ acpi_ex_exit_interpreter (void)
}
/*******************************************************************************
*
* FUNCTION: Acpi_ex_validate_object_type
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
u8
acpi_ex_validate_object_type (
acpi_object_type type)
{
ACPI_FUNCTION_ENTRY ();
if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX)) {
return (FALSE);
}
return (TRUE);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ex_truncate_for32bit_table
......@@ -263,6 +264,8 @@ acpi_ex_release_global_lock (
ACPI_REPORT_ERROR (("Could not release ACPI Global Lock\n"));
}
}
return_VOID;
}
......@@ -378,4 +381,4 @@ acpi_ex_unsigned_integer_to_string (
}
}
#endif
/*
* acpi_fan.c - ACPI Fan Driver ($Revision: 28 $)
* acpi_fan.c - ACPI Fan Driver ($Revision: 29 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -47,12 +47,12 @@ int acpi_fan_add (struct acpi_device *device);
int acpi_fan_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_fan_driver = {
name: ACPI_FAN_DRIVER_NAME,
class: ACPI_FAN_CLASS,
ids: ACPI_FAN_HID,
ops: {
add: acpi_fan_add,
remove: acpi_fan_remove,
.name = ACPI_FAN_DRIVER_NAME,
.class = ACPI_FAN_CLASS,
.ids = ACPI_FAN_HID,
.ops = {
.add = acpi_fan_add,
.remove = acpi_fan_remove,
},
};
......
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
* $Revision: 105 $
* $Revision: 107 $
*
*****************************************************************************/
......@@ -54,7 +54,7 @@
/* Version string */
#define ACPI_CA_VERSION 0x20020702
#define ACPI_CA_VERSION 0x20020725
/* Version of ACPI supported */
......@@ -152,6 +152,15 @@
#define ACPI_MAX_ADDRESS_SPACE 255
/* Array sizes. Used for range checking also */
#define NUM_ACCESS_TYPES 6
#define NUM_UPDATE_RULES 3
#define NUM_LOCK_RULES 2
#define NUM_MATCH_OPS 6
#define NUM_OPCODES 256
#define NUM_FIELD_NAMES 2
/* RSDP checksums */
#define ACPI_RSDP_CHECKSUM_LENGTH 20
......
/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
* $Revision: 62 $
* $Revision: 63 $
*
*****************************************************************************/
......@@ -29,7 +29,6 @@
#define ACPI_DEBUG_BUFFER_SIZE 4196
typedef struct command_info
{
NATIVE_CHAR *name; /* Command Name */
......@@ -185,47 +184,6 @@ acpi_db_walk_for_specific_objects (
void **return_value);
/*
* dbdisasm - AML disassembler
*/
void
acpi_db_display_op (
acpi_walk_state *walk_state,
acpi_parse_object *origin,
u32 num_opcodes);
void
acpi_db_display_namestring (
NATIVE_CHAR *name);
void
acpi_db_display_path (
acpi_parse_object *op);
void
acpi_db_display_opcode (
acpi_walk_state *walk_state,
acpi_parse_object *op);
void
acpi_db_decode_internal_object (
acpi_operand_object *obj_desc);
void
acpi_db_decode_node (
acpi_namespace_node *node);
u32
acpi_db_block_type (
acpi_parse_object *op);
acpi_status
acpi_ps_display_object_pathname (
acpi_walk_state *walk_state,
acpi_parse_object *op);
/*
* dbdisply - debug display commands
*/
......@@ -282,6 +240,10 @@ void *
acpi_db_get_pointer (
void *target);
void
acpi_db_decode_internal_object (
acpi_operand_object *obj_desc);
/*
* dbexec - debugger control method execution
......
/******************************************************************************
*
* Name: acdisasm.h - AML disassembler
* $Revision: 2 $
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2002, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ACDISASM_H__
#define __ACDISASM_H__
#include "amlresrc.h"
#define BLOCK_NONE 0
#define BLOCK_PAREN 1
#define BLOCK_BRACE 2
#define BLOCK_COMMA_LIST 4
extern const char *acpi_gbl_io_decode[2];
extern const char *acpi_gbl_word_decode[4];
extern const char *acpi_gbl_consume_decode[2];
extern const char *acpi_gbl_min_decode[2];
extern const char *acpi_gbl_max_decode[2];
extern const char *acpi_gbl_DECdecode[2];
extern const char *acpi_gbl_RNGdecode[4];
extern const char *acpi_gbl_MEMdecode[4];
extern const char *acpi_gbl_RWdecode[2];
extern const char *acpi_gbl_irq_decode[2];
extern const char *acpi_gbl_HEdecode[2];
extern const char *acpi_gbl_LLdecode[2];
extern const char *acpi_gbl_SHRdecode[2];
extern const char *acpi_gbl_TYPdecode[4];
extern const char *acpi_gbl_BMdecode[2];
extern const char *acpi_gbl_SIZdecode[4];
extern const NATIVE_CHAR *acpi_gbl_lock_rule[NUM_LOCK_RULES];
extern const NATIVE_CHAR *acpi_gbl_access_types[NUM_ACCESS_TYPES];
extern const NATIVE_CHAR *acpi_gbl_update_rules[NUM_UPDATE_RULES];
extern const NATIVE_CHAR *acpi_gbl_match_ops[NUM_MATCH_OPS];
typedef struct acpi_op_walk_info
{
u32 level;
u32 bit_offset;
} ACPI_OP_WALK_INFO;
typedef
acpi_status (*ASL_WALK_CALLBACK) (
acpi_parse_object *op,
u32 level,
void *context);
/*
* dmwalk
*/
void
acpi_dm_walk_parse_tree (
acpi_parse_object *op,
ASL_WALK_CALLBACK descending_callback,
ASL_WALK_CALLBACK ascending_callback,
void *context);
acpi_status
acpi_dm_descending_op (
acpi_parse_object *op,
u32 level,
void *context);
acpi_status
acpi_dm_ascending_op (
acpi_parse_object *op,
u32 level,
void *context);
/*
* dmopcode
*/
void
acpi_dm_validate_name (
char *name,
acpi_parse_object *op);
u32
acpi_dm_dump_name (
char *name);
void
acpi_dm_string (
char *string);
void
acpi_dm_unicode (
acpi_parse_object *op);
void
acpi_dm_disassemble (
acpi_walk_state *walk_state,
acpi_parse_object *origin,
u32 num_opcodes);
void
acpi_dm_namestring (
NATIVE_CHAR *name);
void
acpi_dm_display_path (
acpi_parse_object *op);
void
acpi_dm_disassemble_one_op (
acpi_walk_state *walk_state,
ACPI_OP_WALK_INFO *info,
acpi_parse_object *op);
void
acpi_dm_decode_internal_object (
acpi_operand_object *obj_desc);
void
acpi_dm_decode_node (
acpi_namespace_node *node);
u32
acpi_dm_block_type (
acpi_parse_object *op);
u32
acpi_dm_list_type (
acpi_parse_object *op);
acpi_status
acpi_ps_display_object_pathname (
acpi_walk_state *walk_state,
acpi_parse_object *op);
void
acpi_dm_method_flags (
acpi_parse_object *op);
void
acpi_dm_field_flags (
acpi_parse_object *op);
void
acpi_dm_address_space (
u8 space_id);
void
acpi_dm_region_flags (
acpi_parse_object *op);
void
acpi_dm_match_op (
acpi_parse_object *op);
void
acpi_dm_match_keyword (
acpi_parse_object *op);
u8
acpi_dm_comma_if_list_member (
acpi_parse_object *op);
void
acpi_dm_comma_if_field_member (
acpi_parse_object *op);
/*
* dmbuffer
*/
void
acpi_is_eisa_id (
acpi_parse_object *op);
void
acpi_dm_eisa_id (
u32 encoded_id);
u8
acpi_dm_is_unicode_buffer (
acpi_parse_object *op);
u8
acpi_dm_is_string_buffer (
acpi_parse_object *op);
/*
* dmresrc
*/
void
acpi_dm_disasm_byte_list (
u32 level,
u8 *byte_data,
u32 byte_count);
void
acpi_dm_byte_list (
ACPI_OP_WALK_INFO *info,
acpi_parse_object *op);
void
acpi_dm_resource_descriptor (
ACPI_OP_WALK_INFO *info,
u8 *byte_data,
u32 byte_count);
u8
acpi_dm_is_resource_descriptor (
acpi_parse_object *op);
void
acpi_dm_indent (
u32 level);
void
acpi_dm_bit_list (
u16 mask);
/*
* dmresrcl
*/
void
acpi_dm_io_flags (
u8 flags);
void
acpi_dm_memory_flags (
u8 flags,
u8 specific_flags);
void
acpi_dm_word_descriptor (
ASL_WORD_ADDRESS_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_dword_descriptor (
ASL_DWORD_ADDRESS_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_qword_descriptor (
ASL_QWORD_ADDRESS_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_memory24_descriptor (
ASL_MEMORY_24_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_memory32_descriptor (
ASL_MEMORY_32_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_fixed_mem32_descriptor (
ASL_FIXED_MEMORY_32_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_generic_register_descriptor (
ASL_GENERAL_REGISTER_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_interrupt_descriptor (
ASL_EXTENDED_XRUPT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_vendor_large_descriptor (
ASL_LARGE_VENDOR_DESC *resource,
u32 length,
u32 level);
/*
* dmresrcs
*/
void
acpi_dm_irq_descriptor (
ASL_IRQ_FORMAT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_dma_descriptor (
ASL_DMA_FORMAT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_io_descriptor (
ASL_IO_PORT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_fixed_io_descriptor (
ASL_FIXED_IO_PORT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_start_dependent_descriptor (
ASL_START_DEPENDENT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_end_dependent_descriptor (
ASL_START_DEPENDENT_DESC *resource,
u32 length,
u32 level);
void
acpi_dm_vendor_small_descriptor (
ASL_SMALL_VENDOR_DESC *resource,
u32 length,
u32 level);
#endif /* __ACDISASM_H__ */
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
* $Revision: 126 $
* $Revision: 128 $
*
*****************************************************************************/
......@@ -142,6 +142,7 @@ extern u32 acpi_gbl_startup_flags;
extern const u8 acpi_gbl_decode_to8bit[8];
extern const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES];
extern const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
/*****************************************************************************
......@@ -237,6 +238,12 @@ ACPI_EXTERN ACPI_GPE_INDEX_INFO *acpi_gbl_gpe_number_to_index;
ACPI_EXTERN u8 acpi_gbl_db_output_flags;
#ifdef ACPI_DISASSEMBLER
ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
#endif
#ifdef ENABLE_DEBUGGER
......@@ -247,9 +254,7 @@ ACPI_EXTERN int optind;
ACPI_EXTERN NATIVE_CHAR *optarg;
ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
......@@ -261,7 +266,6 @@ ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_debug_filename[40];
ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_buffer;
ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_filename;
ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_disasm_indent;
ACPI_EXTERN u32 acpi_gbl_db_debug_level;
ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
ACPI_EXTERN acpi_table_header *acpi_gbl_db_table_ptr;
......
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 168 $
* $Revision: 173 $
*
*****************************************************************************/
......@@ -567,8 +567,8 @@ acpi_status (*ACPI_EXECUTE_OP) (
*/
typedef struct acpi_opcode_info
{
#ifdef _OPCODE_NAMES
NATIVE_CHAR *name; /* Opcode name (debug only) */
#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG)
NATIVE_CHAR *name; /* Opcode name (disassembler/debug only) */
#endif
u32 parse_args; /* Grammar/Parse time arguments */
u32 runtime_args; /* Interpret time arguments */
......@@ -603,15 +603,23 @@ typedef union acpi_parse_val
u32 aml_offset; /* offset of declaration in AML */\
union acpi_parse_obj *parent; /* parent op */\
union acpi_parse_obj *next; /* next op */\
ACPI_DEBUG_ONLY_MEMBERS (\
ACPI_DISASM_ONLY_MEMBERS (\
u8 disasm_flags; /* Used during AML disassembly */\
u8 disasm_opcode; /* Subtype used for disassembly */\
NATIVE_CHAR aml_op_name[16]) /* op name (debug only) */\
/* NON-DEBUG members below: */\
acpi_namespace_node *node; /* for use by interpreter */\
acpi_parse_value value; /* Value or args associated with the opcode */\
#define ACPI_DASM_BUFFER 0x00
#define ACPI_DASM_RESOURCE 0x01
#define ACPI_DASM_STRING 0x02
#define ACPI_DASM_UNICODE 0x03
#define ACPI_DASM_EISAID 0x04
#define ACPI_DASM_MATCHOP 0x05
/*
* generic operation (eg. If, While, Store)
* generic operation (for example: If, While, Store)
*/
typedef struct acpi_parseobj_common
{
......@@ -626,6 +634,7 @@ typedef struct acpi_parseobj_common
typedef struct acpi_parseobj_named
{
ACPI_PARSE_COMMON
u8 *path;
u8 *data; /* AML body or bytelist data */
u32 length; /* AML length */
u32 name; /* 4-byte name or zero if no name */
......@@ -653,15 +662,15 @@ typedef struct acpi_parseobj_asl
u32 logical_byte_offset;
u32 end_line;
u32 end_logical_line;
u16 parse_opcode;
u32 acpi_btype;
u32 aml_length;
u32 aml_subtree_length;
u32 final_aml_length;
u32 final_aml_offset;
u16 parse_opcode;
u16 compile_flags;
u8 aml_opcode_length;
u8 aml_pkg_len_bytes;
u16 compile_flags;
u8 extra;
char parse_op_name[12];
......@@ -705,6 +714,13 @@ typedef struct acpi_parse_state
#define ACPI_PARSEOP_BYTELIST 0x08
#define ACPI_PARSEOP_IN_CACHE 0x80
/* Parse object Disasm_flags */
#define ACPI_PARSEOP_IGNORE 0x01
#define ACPI_PARSEOP_PARAMLIST 0x02
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_SPECIAL 0x10
/*****************************************************************************
*
......
/******************************************************************************
*
* Name: acmacros.h - C macros for the entire subsystem.
* $Revision: 124 $
* $Revision: 126 $
*
*****************************************************************************/
......@@ -287,12 +287,18 @@
/*
* Macros for the master AML opcode table
*/
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG)
#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,Pargs,Iargs,flags,obj_type,class,type}
#else
#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {Pargs,Iargs,flags,obj_type,class,type}
#endif
#ifdef ACPI_DISASSEMBLER
#define ACPI_DISASM_ONLY_MEMBERS(a) a;
#else
#define ACPI_DISASM_ONLY_MEMBERS(a)
#endif
#define ARG_TYPE_WIDTH 5
#define ARG_1(x) ((u32)(x))
#define ARG_2(x) ((u32)(x) << (1 * ARG_TYPE_WIDTH))
......@@ -435,7 +441,6 @@
#define ACPI_DEBUG_DEFINE(a) a;
#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
#define _OPCODE_NAMES
#define _VERBOSE_STRUCTURES
......@@ -515,10 +520,6 @@
#define return_VALUE(s) return(s)
#define return_PTR(s) return(s)
#ifdef ENABLE_DEBUGGER
#define _OPCODE_NAMES
#endif
#endif
/*
......
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
* $Revision: 125 $
* $Revision: 126 $
*
*****************************************************************************/
......@@ -43,7 +43,7 @@
/* Definitions of the predefined namespace names */
#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
#define ACPI_ROOT_NAME (u32) 0x2F202020 /* Root name is "/ " */
#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
#define ACPI_NS_ROOT_PATH "\\"
......
......@@ -204,7 +204,6 @@ acpi_os_read_port (
void *value,
u32 width);
acpi_status
acpi_os_write_port (
ACPI_IO_ADDRESS address,
......@@ -222,7 +221,6 @@ acpi_os_read_memory (
void *value,
u32 width);
acpi_status
acpi_os_write_memory (
ACPI_PHYSICAL_ADDRESS address,
......@@ -241,7 +239,6 @@ acpi_os_read_pci_configuration (
void *value,
u32 width);
acpi_status
acpi_os_write_pci_configuration (
acpi_pci_id *pci_id,
......@@ -259,7 +256,6 @@ acpi_os_readable (
void *pointer,
u32 length);
u8
acpi_os_writable (
void *pointer,
......@@ -288,6 +284,10 @@ acpi_os_vprintf (
const NATIVE_CHAR *format,
va_list args);
void
acpi_os_redirect_output (
void *destination);
/*
* Debug input
......
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 140 $
* $Revision: 142 $
*
*****************************************************************************/
......@@ -224,6 +224,9 @@ extern const u8 _acpi_ctype[];
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
#define ACPI_IS_ASCII(c) ((c) < 0x80)
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
......
......@@ -3,7 +3,7 @@
* Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived
* directly from the ACPI specification.
* $Revision: 68 $
* $Revision: 69 $
*
*****************************************************************************/
......@@ -474,13 +474,4 @@ typedef enum
#define METHOD_FLAGS_SYNCH_LEVEL 0xF0
/* Array sizes. Used for range checking also */
#define NUM_ACCESS_TYPES 6
#define NUM_UPDATE_RULES 3
#define NUM_MATCH_OPS 7
#define NUM_OPCODES 256
#define NUM_FIELD_NAMES 2
#endif /* __AMLCODE_H__ */
/******************************************************************************
*
* Module Name: aslresource.h - ASL resource descriptors
* $Revision: 19 $
* Module Name: amlresrc.h - AML resource descriptors
* $Revision: 20 $
*
*****************************************************************************/
......@@ -25,8 +25,8 @@
*/
#ifndef __ASLRESOURCE_H
#define __ASLRESOURCE_H
#ifndef __AMLRESRC_H
#define __AMLRESRC_H
#define ASL_RESNAME_ADDRESS "_ADR"
......@@ -80,11 +80,13 @@ typedef struct asl_resource_node
/*
* Resource descriptors defined in the ACPI specification
* Resource descriptors defined in the ACPI specification.
*
* Alignment must be BYTE because these descriptors
* are used to overlay the AML byte stream.
*/
#pragma pack(1)
typedef struct asl_irq_format_desc
{
u8 descriptor_type;
......@@ -94,7 +96,6 @@ typedef struct asl_irq_format_desc
} ASL_IRQ_FORMAT_DESC;
#pragma pack(1)
typedef struct asl_irq_noflags_desc
{
u8 descriptor_type;
......@@ -103,7 +104,6 @@ typedef struct asl_irq_noflags_desc
} ASL_IRQ_NOFLAGS_DESC;
#pragma pack(1)
typedef struct asl_dma_format_desc
{
u8 descriptor_type;
......@@ -113,7 +113,6 @@ typedef struct asl_dma_format_desc
} ASL_DMA_FORMAT_DESC;
#pragma pack(1)
typedef struct asl_start_dependent_desc
{
u8 descriptor_type;
......@@ -122,7 +121,6 @@ typedef struct asl_start_dependent_desc
} ASL_START_DEPENDENT_DESC;
#pragma pack(1)
typedef struct asl_start_dependent_noprio_desc
{
u8 descriptor_type;
......@@ -130,7 +128,6 @@ typedef struct asl_start_dependent_noprio_desc
} ASL_START_DEPENDENT_NOPRIO_DESC;
#pragma pack(1)
typedef struct asl_end_dependent_desc
{
u8 descriptor_type;
......@@ -138,7 +135,6 @@ typedef struct asl_end_dependent_desc
} ASL_END_DEPENDENT_DESC;
#pragma pack(1)
typedef struct asl_io_port_desc
{
u8 descriptor_type;
......@@ -151,7 +147,6 @@ typedef struct asl_io_port_desc
} ASL_IO_PORT_DESC;
#pragma pack(1)
typedef struct asl_fixed_io_port_desc
{
u8 descriptor_type;
......@@ -161,7 +156,6 @@ typedef struct asl_fixed_io_port_desc
} ASL_FIXED_IO_PORT_DESC;
#pragma pack(1)
typedef struct asl_small_vendor_desc
{
u8 descriptor_type;
......@@ -170,7 +164,6 @@ typedef struct asl_small_vendor_desc
} ASL_SMALL_VENDOR_DESC;
#pragma pack(1)
typedef struct asl_end_tag_desc
{
u8 descriptor_type;
......@@ -181,7 +174,6 @@ typedef struct asl_end_tag_desc
/* LARGE descriptors */
#pragma pack(1)
typedef struct asl_memory_24_desc
{
u8 descriptor_type;
......@@ -195,7 +187,6 @@ typedef struct asl_memory_24_desc
} ASL_MEMORY_24_DESC;
#pragma pack(1)
typedef struct asl_large_vendor_desc
{
u8 descriptor_type;
......@@ -205,7 +196,6 @@ typedef struct asl_large_vendor_desc
} ASL_LARGE_VENDOR_DESC;
#pragma pack(1)
typedef struct asl_memory_32_desc
{
u8 descriptor_type;
......@@ -219,7 +209,6 @@ typedef struct asl_memory_32_desc
} ASL_MEMORY_32_DESC;
#pragma pack(1)
typedef struct asl_fixed_memory_32_desc
{
u8 descriptor_type;
......@@ -231,7 +220,6 @@ typedef struct asl_fixed_memory_32_desc
} ASL_FIXED_MEMORY_32_DESC;
#pragma pack(1)
typedef struct asl_qword_address_desc
{
u8 descriptor_type;
......@@ -249,7 +237,6 @@ typedef struct asl_qword_address_desc
} ASL_QWORD_ADDRESS_DESC;
#pragma pack(1)
typedef struct asl_dword_address_desc
{
u8 descriptor_type;
......@@ -267,7 +254,6 @@ typedef struct asl_dword_address_desc
} ASL_DWORD_ADDRESS_DESC;
#pragma pack(1)
typedef struct asl_word_address_desc
{
u8 descriptor_type;
......@@ -285,7 +271,6 @@ typedef struct asl_word_address_desc
} ASL_WORD_ADDRESS_DESC;
#pragma pack(1)
typedef struct asl_extended_xrupt_desc
{
u8 descriptor_type;
......@@ -298,7 +283,6 @@ typedef struct asl_extended_xrupt_desc
} ASL_EXTENDED_XRUPT_DESC;
#pragma pack(1)
typedef struct asl_general_register_desc
{
u8 descriptor_type;
......@@ -311,6 +295,9 @@ typedef struct asl_general_register_desc
} ASL_GENERAL_REGISTER_DESC;
/* restore default alignment */
#pragma pack()
/* Union of all resource descriptors, sow we can allocate the worst case */
......
/******************************************************************************
*
* Name: acenv.h - Generation environment specific items
* $Revision: 95 $
* $Revision: 99 $
*
*****************************************************************************/
......@@ -32,11 +32,13 @@
*/
#ifdef _ACPI_DUMP_APP
#ifndef MSDOS
#define ACPI_DEBUG
#endif
#define ACPI_APPLICATION
#define ENABLE_DEBUGGER
#define ACPI_DISASSEMBLER
#define ACPI_NO_METHOD_EXECUTION
#define ACPI_USE_SYSTEM_CLIBRARY
#define PARSER_ONLY
#endif
#ifdef _ACPI_EXEC_APP
......@@ -45,13 +47,15 @@
#define ACPI_DEBUG
#define ACPI_APPLICATION
#define ENABLE_DEBUGGER
#define ACPI_DISASSEMBLER
#define ACPI_USE_SYSTEM_CLIBRARY
#endif
#ifdef _ACPI_ASL_COMPILER
#define ACPI_DEBUG
#define ACPI_APPLICATION
/* #define ENABLE_DEBUGGER */
#define ACPI_DISASSEMBLER
#define ACPI_CONSTANT_EVAL_ONLY
#define ACPI_USE_SYSTEM_CLIBRARY
#endif
......@@ -183,7 +187,6 @@
/*
* Use the standard C library headers.
* We want to keep these to a minimum.
*
*/
#ifdef ACPI_USE_STANDARD_HEADERS
......@@ -213,12 +216,16 @@
#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
#define ACPI_TOUPPER toupper
#define ACPI_TOLOWER tolower
#define ACPI_IS_XDIGIT isxdigit
#define ACPI_IS_DIGIT isdigit
#define ACPI_IS_SPACE isspace
#define ACPI_IS_UPPER isupper
#define ACPI_IS_PRINT isprint
#define ACPI_IS_ALPHA isalpha
#define ACPI_IS_ASCII isascii
/******************************************************************************
*
......
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
* $Revision: 136 $
* $Revision: 137 $
*
*****************************************************************************/
......@@ -619,93 +619,6 @@ acpi_ns_dump_objects (
}
#ifndef _ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_one_device
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
* Context - Passed into Walk_namespace
*
* DESCRIPTION: Dump a single Node that represents a device
* This procedure is a User_function called by Acpi_ns_walk_namespace.
*
******************************************************************************/
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
acpi_device_info info;
acpi_status status;
u32 i;
ACPI_FUNCTION_NAME ("Ns_dump_one_device");
status = acpi_ns_dump_one_object (obj_handle, level, context, return_value);
status = acpi_get_object_info (obj_handle, &info);
if (ACPI_SUCCESS (status)) {
for (i = 0; i < level; i++) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info.hardware_id,
ACPI_HIDWORD (info.address), ACPI_LODWORD (info.address),
info.current_status));
}
return (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_root_devices
*
* PARAMETERS: None
*
* DESCRIPTION: Dump all objects of type "device"
*
******************************************************************************/
void
acpi_ns_dump_root_devices (void)
{
acpi_handle sys_bus_handle;
acpi_status status;
ACPI_FUNCTION_NAME ("Ns_dump_root_devices");
/* Only dump the table if tracing is enabled */
if (!(ACPI_LV_TABLES & acpi_dbg_level)) {
return;
}
status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
if (ACPI_FAILURE (status)) {
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n"));
status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
acpi_ns_dump_one_device, NULL, NULL);
}
#endif
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_tables
......
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
* $Revision: 1 $
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2002, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "acpi.h"
#include "acnamesp.h"
#include "acparser.h"
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsdumpdv")
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_one_device
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
* Context - Passed into Walk_namespace
*
* DESCRIPTION: Dump a single Node that represents a device
* This procedure is a User_function called by Acpi_ns_walk_namespace.
*
******************************************************************************/
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
acpi_device_info info;
acpi_status status;
u32 i;
ACPI_FUNCTION_NAME ("Ns_dump_one_device");
status = acpi_ns_dump_one_object (obj_handle, level, context, return_value);
status = acpi_get_object_info (obj_handle, &info);
if (ACPI_SUCCESS (status)) {
for (i = 0; i < level; i++) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info.hardware_id,
ACPI_HIDWORD (info.address), ACPI_LODWORD (info.address),
info.current_status));
}
return (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_dump_root_devices
*
* PARAMETERS: None
*
* DESCRIPTION: Dump all objects of type "device"
*
******************************************************************************/
void
acpi_ns_dump_root_devices (void)
{
acpi_handle sys_bus_handle;
acpi_status status;
ACPI_FUNCTION_NAME ("Ns_dump_root_devices");
/* Only dump the table if tracing is enabled */
if (!(ACPI_LV_TABLES & acpi_dbg_level)) {
return;
}
status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
if (ACPI_FAILURE (status)) {
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n"));
status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
acpi_ns_dump_one_device, NULL, NULL);
}
#endif
/******************************************************************************
*
* Module Name: nsload - namespace loading/expanding/contracting procedures
* $Revision: 56 $
* $Revision: 57 $
*
*****************************************************************************/
......@@ -37,59 +37,7 @@
/*******************************************************************************
*
* FUNCTION: Acpi_load_namespace
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Load the name space from what ever is pointed to by DSDT.
* (DSDT points to either the BIOS or a buffer.)
*
******************************************************************************/
acpi_status
acpi_ns_load_namespace (
void)
{
acpi_status status;
ACPI_FUNCTION_TRACE ("Acpi_load_name_space");
/* There must be at least a DSDT installed */
if (acpi_gbl_DSDT == NULL) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "DSDT is not in memory\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
/*
* Load the namespace. The DSDT is required,
* but the SSDT and PSDT tables are optional.
*/
status = acpi_ns_load_table_by_type (ACPI_TABLE_DSDT);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Ignore exceptions from these */
(void) acpi_ns_load_table_by_type (ACPI_TABLE_SSDT);
(void) acpi_ns_load_table_by_type (ACPI_TABLE_PSDT);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
"ACPI Namespace successfully loaded at root %p\n",
acpi_gbl_root_node));
return_ACPI_STATUS (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_one_parse_pass
* FUNCTION: Ns_one_complete_parse
*
* PARAMETERS: Pass_number - 1 or 2
* Table_desc - The table to be parsed.
......@@ -203,6 +151,7 @@ acpi_ns_parse_table (
return_ACPI_STATUS (status);
}
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
......@@ -419,6 +368,58 @@ acpi_ns_load_table_by_type (
}
/*******************************************************************************
*
* FUNCTION: Acpi_load_namespace
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Load the name space from what ever is pointed to by DSDT.
* (DSDT points to either the BIOS or a buffer.)
*
******************************************************************************/
acpi_status
acpi_ns_load_namespace (
void)
{
acpi_status status;
ACPI_FUNCTION_TRACE ("Acpi_load_name_space");
/* There must be at least a DSDT installed */
if (acpi_gbl_DSDT == NULL) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "DSDT is not in memory\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
/*
* Load the namespace. The DSDT is required,
* but the SSDT and PSDT tables are optional.
*/
status = acpi_ns_load_table_by_type (ACPI_TABLE_DSDT);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Ignore exceptions from these */
(void) acpi_ns_load_table_by_type (ACPI_TABLE_SSDT);
(void) acpi_ns_load_table_by_type (ACPI_TABLE_PSDT);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
"ACPI Namespace successfully loaded at root %p\n",
acpi_gbl_root_node));
return_ACPI_STATUS (status);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_delete_subtree
......@@ -550,4 +551,5 @@ acpi_ns_unload_namespace (
return_ACPI_STATUS (status);
}
#endif
This diff is collapsed.
This diff is collapsed.
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
* $Revision: 61 $
* $Revision: 62 $
*
*****************************************************************************/
......@@ -332,7 +332,7 @@ acpi_ps_get_next_namepath (
NATIVE_CHAR *path;
acpi_parse_object *name_op;
acpi_status status;
acpi_namespace_node *method_node = NULL;
acpi_operand_object *method_desc;
acpi_namespace_node *node;
acpi_generic_state scope_info;
......@@ -369,12 +369,15 @@ acpi_ps_get_next_namepath (
&node);
if (ACPI_SUCCESS (status)) {
if (node->type == ACPI_TYPE_METHOD) {
method_node = node;
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "method - %p Path=%p\n",
method_node, path));
method_desc = acpi_ns_get_attached_object (node);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p Desc %p Path=%p\n",
node, method_desc, path));
name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
if (name_op) {
if (!name_op) {
return_VOID;
}
/* Change arg into a METHOD CALL and attach name to it */
acpi_ps_init_op (arg, AML_INT_METHODCALL_OP);
......@@ -383,16 +386,19 @@ acpi_ps_get_next_namepath (
/* Point METHODCALL/NAME to the METHOD Node */
name_op->common.node = method_node;
name_op->common.node = node;
acpi_ps_append_arg (arg, name_op);
if (!acpi_ns_get_attached_object (method_node)) {
if (!method_desc) {
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p has no attached object\n",
node));
return_VOID;
}
*arg_count = (acpi_ns_get_attached_object (method_node))->method.param_count;
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p Args %X\n",
node, method_desc->method.param_count));
*arg_count = method_desc->method.param_count;
return_VOID;
}
......
/******************************************************************************
*
* Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 70 $
* $Revision: 71 $
*
*****************************************************************************/
......@@ -734,7 +734,7 @@ NATIVE_CHAR *
acpi_ps_get_opcode_name (
u16 opcode)
{
#ifdef ACPI_DEBUG
#ifdef ACPI_DISASSEMBLER
const acpi_opcode_info *op;
......
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
* $Revision: 128 $
* $Revision: 129 $
*
*****************************************************************************/
......@@ -473,7 +473,7 @@ acpi_ps_parse_loop (
parser_state = &walk_state->parser_state;
walk_state->arg_types = 0;
#ifndef PARSER_ONLY
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) {
/* We are restarting a preempted control method */
......
/******************************************************************************
*
* Module Name: psutils - Parser miscellaneous utilities (Parser only)
* $Revision: 52 $
* $Revision: 54 $
*
*****************************************************************************/
......@@ -88,7 +88,7 @@ acpi_ps_init_op (
op->common.data_type = ACPI_DESC_TYPE_PARSER;
op->common.aml_opcode = opcode;
ACPI_DEBUG_ONLY_MEMBERS (ACPI_STRNCPY (op->common.aml_op_name,
ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (op->common.aml_op_name,
(acpi_ps_get_opcode_info (opcode))->name, sizeof (op->common.aml_op_name)));
}
......@@ -186,7 +186,7 @@ acpi_ps_free_op (
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", op));
}
if (op->common.flags == ACPI_PARSEOP_GENERIC) {
if (op->common.flags & ACPI_PARSEOP_GENERIC) {
acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE, op);
}
else {
......
/*
* pci_irq.c - ACPI PCI Interrupt Routing ($Revision: 10 $)
* pci_irq.c - ACPI PCI Interrupt Routing ($Revision: 11 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......
/*
* pci_link.c - ACPI PCI Interrupt Link Device Driver ($Revision: 33 $)
* pci_link.c - ACPI PCI Interrupt Link Device Driver ($Revision: 34 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -54,12 +54,12 @@ static int acpi_pci_link_add (struct acpi_device *device);
static int acpi_pci_link_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_pci_link_driver = {
name: ACPI_PCI_LINK_DRIVER_NAME,
class: ACPI_PCI_LINK_CLASS,
ids: ACPI_PCI_LINK_HID,
ops: {
add: acpi_pci_link_add,
remove: acpi_pci_link_remove,
.name = ACPI_PCI_LINK_DRIVER_NAME,
.class = ACPI_PCI_LINK_CLASS,
.ids = ACPI_PCI_LINK_HID,
.ops = {
.add = acpi_pci_link_add,
.remove = acpi_pci_link_remove,
},
};
......
/*
* pci_root.c - ACPI PCI Root Bridge Driver ($Revision: 39 $)
* pci_root.c - ACPI PCI Root Bridge Driver ($Revision: 40 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -47,12 +47,12 @@ static int acpi_pci_root_add (struct acpi_device *device);
static int acpi_pci_root_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_pci_root_driver = {
name: ACPI_PCI_ROOT_DRIVER_NAME,
class: ACPI_PCI_ROOT_CLASS,
ids: ACPI_PCI_ROOT_HID,
ops: {
add: acpi_pci_root_add,
remove: acpi_pci_root_remove,
.name = ACPI_PCI_ROOT_DRIVER_NAME,
.class = ACPI_PCI_ROOT_CLASS,
.ids = ACPI_PCI_ROOT_HID,
.ops = {
.add = acpi_pci_root_add,
.remove = acpi_pci_root_remove,
},
};
......
/*
* acpi_power.c - ACPI Bus Power Management ($Revision: 38 $)
* acpi_power.c - ACPI Bus Power Management ($Revision: 39 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -43,12 +43,12 @@ int acpi_power_add (struct acpi_device *device);
int acpi_power_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_power_driver = {
name: ACPI_POWER_DRIVER_NAME,
class: ACPI_POWER_CLASS,
ids: ACPI_POWER_HID,
ops: {
add: acpi_power_add,
remove: acpi_power_remove,
.name = ACPI_POWER_DRIVER_NAME,
.class = ACPI_POWER_CLASS,
.ids = ACPI_POWER_HID,
.ops = {
.add = acpi_power_add,
.remove = acpi_power_remove,
},
};
......
/*
* acpi_processor.c - ACPI Processor Driver ($Revision: 69 $)
* acpi_processor.c - ACPI Processor Driver ($Revision: 71 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -78,12 +78,12 @@ static int acpi_processor_add (struct acpi_device *device);
static int acpi_processor_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_processor_driver = {
name: ACPI_PROCESSOR_DRIVER_NAME,
class: ACPI_PROCESSOR_CLASS,
ids: ACPI_PROCESSOR_HID,
ops: {
add: acpi_processor_add,
remove: acpi_processor_remove,
.name = ACPI_PROCESSOR_DRIVER_NAME,
.class = ACPI_PROCESSOR_CLASS,
.ids = ACPI_PROCESSOR_HID,
.ops = {
.add = acpi_processor_add,
.remove = acpi_processor_remove,
},
};
......
/*******************************************************************************
*
* Module Name: rsio - IO and DMA resource descriptors
* $Revision: 21 $
* $Revision: 22 $
*
******************************************************************************/
......@@ -399,7 +399,7 @@ acpi_rs_dma_resource (
buffer += 1;
temp8 = *buffer;
/* Decode the IRQ bits */
/* Decode the DMA channel bits */
for (i = 0, index = 0; index < 8; index++) {
if ((temp8 >> index) & 0x01) {
......@@ -407,19 +407,16 @@ acpi_rs_dma_resource (
i++;
}
}
if (i == 0) {
/* Zero channels is invalid! */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found Zero DMA channels in resource list\n"));
return_ACPI_STATUS (AE_BAD_DATA);
}
output_struct->data.dma.number_of_channels = i;
/* Zero DMA channels is valid */
output_struct->data.dma.number_of_channels = i;
if (i > 0) {
/*
* Calculate the structure size based upon the number of interrupts
*/
struct_size += ((ACPI_SIZE) output_struct->data.dma.number_of_channels - 1) * 4;
struct_size += ((ACPI_SIZE) i - 1) * 4;
}
/*
* Point to Byte 2
......
/*******************************************************************************
*
* Module Name: rsirq - IRQ resource descriptors
* $Revision: 29 $
* $Revision: 30 $
*
******************************************************************************/
......@@ -96,18 +96,15 @@ acpi_rs_irq_resource (
}
}
if (i == 0) {
/* Zero interrupts is invalid! */
/* Zero interrupts is valid */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found Zero interrupt levels in resource list\n"));
return_ACPI_STATUS (AE_BAD_DATA);
}
output_struct->data.irq.number_of_interrupts = i;
if (i > 0) {
/*
* Calculate the structure size based upon the number of interrupts
*/
struct_size += ((ACPI_SIZE) output_struct->data.irq.number_of_interrupts - 1) * 4;
struct_size += ((ACPI_SIZE) i - 1) * 4;
}
/*
* Point to Byte 3 if it is used
......
/*
* acpi_system.c - ACPI System Driver ($Revision: 60 $)
* acpi_system.c - ACPI System Driver ($Revision: 63 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -63,12 +63,12 @@ static int acpi_system_add (struct acpi_device *device);
static int acpi_system_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_system_driver = {
name: ACPI_SYSTEM_DRIVER_NAME,
class: ACPI_SYSTEM_CLASS,
ids: ACPI_SYSTEM_HID,
ops: {
add: acpi_system_add,
remove: acpi_system_remove
.name = ACPI_SYSTEM_DRIVER_NAME,
.class = ACPI_SYSTEM_CLASS,
.ids = ACPI_SYSTEM_HID,
.ops = {
.add = acpi_system_add,
.remove = acpi_system_remove
},
};
......@@ -383,10 +383,10 @@ static unsigned int acpi_system_poll_event(struct file *file, poll_table *wait);
static struct file_operations acpi_system_event_ops = {
open: acpi_system_open_event,
read: acpi_system_read_event,
release: acpi_system_close_event,
poll: acpi_system_poll_event,
.open = acpi_system_open_event,
.read = acpi_system_read_event,
.release = acpi_system_close_event,
.poll = acpi_system_poll_event,
};
static int
......@@ -479,7 +479,7 @@ acpi_system_poll_event(
static ssize_t acpi_system_read_dsdt (struct file*, char*, size_t, loff_t*);
static struct file_operations acpi_system_dsdt_ops = {
read: acpi_system_read_dsdt,
.read = acpi_system_read_dsdt,
};
static ssize_t
......@@ -522,7 +522,7 @@ acpi_system_read_dsdt (
static ssize_t acpi_system_read_fadt (struct file*, char*, size_t, loff_t*);
static struct file_operations acpi_system_fadt_ops = {
read: acpi_system_read_fadt,
.read = acpi_system_read_fadt,
};
static ssize_t
......@@ -1171,9 +1171,9 @@ static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs,
}
struct sysrq_key_op sysrq_acpi_poweroff_op = {
handler: &acpi_sysrq_power_off,
help_msg: "Off",
action_msg: "Power Off\n"
.handler = &acpi_sysrq_power_off,
.help_msg = "Off",
.action_msg = "Power Off\n"
};
#endif /* CONFIG_MAGIC_SYSRQ */
......
......@@ -330,6 +330,11 @@ acpi_table_get_sdt (
return -ENODEV;
}
if (acpi_table_compute_checksum(header, header->length)) {
printk(KERN_WARNING PREFIX "Invalid XSDT checksum\n");
return -ENODEV;
}
sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3;
if (sdt.count > ACPI_MAX_TABLES) {
printk(KERN_WARNING PREFIX "Truncated %lu XSDT entries\n",
......@@ -370,6 +375,11 @@ acpi_table_get_sdt (
return -ENODEV;
}
if (acpi_table_compute_checksum(header, header->length)) {
printk(KERN_WARNING PREFIX "Invalid RSDT checksum\n");
return -ENODEV;
}
sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 2;
if (sdt.count > ACPI_MAX_TABLES) {
printk(KERN_WARNING PREFIX "Truncated %lu RSDT entries\n",
......
/******************************************************************************
*
* Module Name: tbrsdt - ACPI RSDT table utilities
* $Revision: 1 $
* $Revision: 2 $
*
*****************************************************************************/
......@@ -271,12 +271,6 @@ acpi_tb_get_table_rsdt (
return_ACPI_STATUS (status);
}
/*
* Valid RSDT signature, verify the checksum. If it fails, just
* print a warning and ignore it.
*/
status = acpi_tb_verify_table_checksum (table_info.pointer);
/* Get the number of tables defined in the RSDT or XSDT */
acpi_gbl_rsdt_table_count = acpi_tb_get_table_count (acpi_gbl_RSDP, table_info.pointer);
......
/*
* acpi_thermal.c - ACPI Thermal Zone Driver ($Revision: 40 $)
* acpi_thermal.c - ACPI Thermal Zone Driver ($Revision: 41 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -65,12 +65,12 @@ static int acpi_thermal_add (struct acpi_device *device);
static int acpi_thermal_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_thermal_driver = {
name: ACPI_THERMAL_DRIVER_NAME,
class: ACPI_THERMAL_CLASS,
ids: ACPI_THERMAL_HID,
ops: {
add: acpi_thermal_add,
remove: acpi_thermal_remove,
.name = ACPI_THERMAL_DRIVER_NAME,
.class = ACPI_THERMAL_CLASS,
.ids = ACPI_THERMAL_HID,
.ops = {
.add = acpi_thermal_add,
.remove = acpi_thermal_remove,
},
};
......
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 164 $
* $Revision: 165 $
*
*****************************************************************************/
......@@ -27,6 +27,7 @@
#include "acpi.h"
#include "acnamesp.h"
#include "amlcode.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utglobal")
......@@ -357,15 +358,15 @@ acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
/* Region type decoding */
static const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] =
const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] =
{
"System_memory",
"System_iO",
"PCIConfig",
"PCI_Config",
"Embedded_control",
"SMBus",
"CMOS",
"PCIBar_target",
"PCIBARTarget",
"Data_table",
};
......@@ -555,55 +556,6 @@ acpi_ut_get_mutex_name (
}
/* Various strings for future use */
#if 0
#include "amlcode.h"
/* Data used in keeping track of fields */
static const NATIVE_CHAR *acpi_gbl_FEnames[NUM_FIELD_NAMES] =
{
"skip",
"?access?"
}; /* FE = Field Element */
static const NATIVE_CHAR *acpi_gbl_match_ops[NUM_MATCH_OPS] =
{
"Error",
"MTR",
"MEQ",
"MLE",
"MLT",
"MGE",
"MGT"
};
/* Access type decoding */
static const NATIVE_CHAR *acpi_gbl_access_types[NUM_ACCESS_TYPES] =
{
"Any_acc",
"Byte_acc",
"Word_acc",
"DWord_acc",
"QWord_acc",
"Buffer_acc",
};
/* Update rule decoding */
static const NATIVE_CHAR *acpi_gbl_update_rules[NUM_UPDATE_RULES] =
{
"Preserve",
"Write_as_ones",
"Write_as_zeros"
};
#endif /* Future use */
#endif
......
......@@ -106,13 +106,17 @@ static void fill_devpath(struct device * dev, char * path, int length)
static int create_symlink(struct driver_dir_entry * parent, char * name, char * path)
{
struct driver_file_entry * entry;
int error;
entry = kmalloc(sizeof(struct driver_file_entry),GFP_KERNEL);
if (!entry)
return -ENOMEM;
entry->name = name;
entry->mode = S_IRUGO;
return driverfs_create_symlink(parent,entry,path);
error = driverfs_create_symlink(parent,entry,path);
if (error)
kfree(entry);
return error;
}
int device_bus_link(struct device * dev)
......
This diff is collapsed.
......@@ -2058,7 +2058,6 @@ static int __devinit irq_probe_ECP(struct parport *pb)
int i;
unsigned long irqs;
sti();
irqs = probe_irq_on();
ECR_WRITE (pb, ECR_SPP << 5); /* Reset FIFO */
......@@ -2093,7 +2092,6 @@ static int __devinit irq_probe_EPP(struct parport *pb)
if (pb->modes & PARPORT_MODE_PCECR)
oecr = inb (ECONTROL (pb));
sti();
irqs = probe_irq_on();
if (pb->modes & PARPORT_MODE_PCECR)
......
......@@ -1006,14 +1006,20 @@ int parport_claim_or_block(struct pardevice *dev)
#ifdef PARPORT_DEBUG_SHARING
printk(KERN_DEBUG "%s: parport_claim() returned -EAGAIN\n", dev->name);
#endif
save_flags (flags);
cli();
/*
* FIXME!!! Use the proper locking for dev->waiting,
* and make this use the "wait_event_interruptible()"
* interfaces. The cli/sti that used to be here
* did nothing.
*
* See also parport_release()
*/
/* If dev->waiting is clear now, an interrupt
gave us the port and we would deadlock if we slept. */
if (dev->waiting) {
interruptible_sleep_on (&dev->wait_q);
if (signal_pending (current)) {
restore_flags (flags);
return -EINTR;
}
r = 1;
......@@ -1024,7 +1030,7 @@ int parport_claim_or_block(struct pardevice *dev)
dev->name);
#endif
}
restore_flags(flags);
#ifdef PARPORT_DEBUG_SHARING
if (dev->port->physport->cad != dev)
printk(KERN_DEBUG "%s: exiting parport_claim_or_block "
......
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