Commit 980adcb2 authored by Linus Torvalds's avatar Linus Torvalds

v2.4.13 -> v2.4.13.1

  - Michael Warfield: computone serial driver update
  - Alexander Viro: cdrom module race fixes
  - David Miller: Acenic driver fix
  - Andrew Grover: ACPI update
  - Kai Germaschewski: ISDN update
  - Tim Waugh: parport update
  - David Woodhouse: JFFS garbage collect sleep
parent 9ff086a3
...@@ -1412,6 +1412,12 @@ CONFIG_PARIDE_EPAT ...@@ -1412,6 +1412,12 @@ CONFIG_PARIDE_EPAT
have a high-level driver for the type of device that you want to have a high-level driver for the type of device that you want to
support. support.
Shuttle EPAT c7/c8 extension
CONFIG_PARIDE_EPATC8
This option enables support for the newer Shuttle EP1284 (aka c7 and
c8) chip. You need this if you are using any recent Imation SuperDisk
(LS-120) drive.
Shuttle EPIA protocol Shuttle EPIA protocol
CONFIG_PARIDE_EPIA CONFIG_PARIDE_EPIA
This option enables support for the (obsolete) EPIA parallel port This option enables support for the (obsolete) EPIA parallel port
......
...@@ -8,7 +8,7 @@ PDF := $(patsubst %.sgml, %.pdf, $(BOOKS)) ...@@ -8,7 +8,7 @@ PDF := $(patsubst %.sgml, %.pdf, $(BOOKS))
HTML := $(patsubst %.sgml, %, $(BOOKS)) HTML := $(patsubst %.sgml, %, $(BOOKS))
IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig
EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook)) EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook))
JPG-parportbook := $(patsubst %.fig, %.jpeg, $(IMG-parportbook)) PNG-parportbook := $(patsubst %.fig, %.png, $(IMG-parportbook))
C-procfs-example = procfs_example.sgml C-procfs-example = procfs_example.sgml
books: $(BOOKS) books: $(BOOKS)
...@@ -26,8 +26,8 @@ html: $(HTML) ...@@ -26,8 +26,8 @@ html: $(HTML)
%.eps: %.fig %.eps: %.fig
fig2dev -Leps $< $@ fig2dev -Leps $< $@
%.jpeg: %.fig %.png: %.fig
fig2dev -Ljpeg $< $@ fig2dev -Lpng $< $@
%.sgml: %.c %.sgml: %.c
echo "<programlisting>" > $@ echo "<programlisting>" > $@
...@@ -129,8 +129,8 @@ kernel-api-man: $(APISOURCES) ...@@ -129,8 +129,8 @@ kernel-api-man: $(APISOURCES)
$(TOPDIR)/scripts/kernel-doc -man $^ | \ $(TOPDIR)/scripts/kernel-doc -man $^ | \
$(PERL) $(TOPDIR)/scripts/split-man $(TOPDIR)/Documentation/man $(PERL) $(TOPDIR)/scripts/split-man $(TOPDIR)/Documentation/man
parportbook: $(JPG-parportbook) parportbook parportbook.pdf: $(PNG-parportbook)
parportbook.ps parportbook.pdf: $(EPS-parportbook) parportbook.ps: $(EPS-parportbook)
parportbook.sgml: parportbook.tmpl $(TOPDIR)/drivers/parport/init.c parportbook.sgml: parportbook.tmpl $(TOPDIR)/drivers/parport/init.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/parport/init.c <$< >$@ $(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/parport/init.c <$< >$@
......
<!-- -*- sgml -*- --> <!-- -*- sgml -*- -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[]>
<book id="ParportGuide"> <book id="ParportGuide">
<bookinfo> <bookinfo>
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
<mediaobject> <mediaobject>
<imageobject> <imageobject>
<imagedata fileref="parport-share.eps" format=ps> <imagedata fileref="parport-share" format="eps">
</imageobject> </imageobject>
<imageobject> <imageobject>
<imagedata fileref="parport-share.jpeg" format=jpeg> <imagedata fileref="parport-share.png" format="png">
</imageobject> </imageobject>
</mediaobject> </mediaobject>
...@@ -270,10 +270,10 @@ ...@@ -270,10 +270,10 @@
<mediaobject> <mediaobject>
<imageobject> <imageobject>
<imagedata format=eps fileref="parport-structure.eps"> <imagedata fileref="parport-structure" format="eps">
</imageobject> </imageobject>
<imageobject> <imageobject>
<imagedata format=jpeg fileref="parport-structure.jpeg"> <imagedata fileref="parport-structure.png" format="png">
</imageobject> </imageobject>
</mediaobject> </mediaobject>
...@@ -461,10 +461,10 @@ ...@@ -461,10 +461,10 @@
<mediaobject> <mediaobject>
<imageobject> <imageobject>
<imagedata format=eps fileref="parport-multi.eps"> <imagedata fileref="parport-multi" format="eps">
</imageobject> </imageobject>
<imageobject> <imageobject>
<imagedata format=jpeg fileref="parport-multi.jpeg"> <imagedata fileref="parport-multi.png" format="png">
</imageobject> </imageobject>
</mediaobject> </mediaobject>
......
...@@ -4,16 +4,15 @@ Computone Intelliport II/Plus Multiport Serial Driver ...@@ -4,16 +4,15 @@ Computone Intelliport II/Plus Multiport Serial Driver
Release Notes For Linux Kernel 2.2 and higher. Release Notes For Linux Kernel 2.2 and higher.
These notes are for the drivers which have already been integrated into the These notes are for the drivers which have already been integrated into the
kernel and have been tested on Linux kernels 2.0, 2.2, and 2.3. kernel and have been tested on Linux kernels 2.0, 2.2, 2.3, and 2.4.
Version: 1.2.9 Version: 1.2.12
Date: 04/12/2000 Date: 10/24/2001
Author: Andrew Manison <amanison@america.net> Historical Author: Andrew Manison <amanison@america.net>
Primary Author: Doug McNash <dougm@computone.com>
Testing: larryg@computone.com Testing: larryg@computone.com
Support: support@computone.com Support: support@computone.com
Fixes and Updates: Doug McNash <dougm@computone.com> Fixes and Updates: Mike Warfield <mhw@wittsend.com>
Proc Filesystem and Kernel Integration: Mike Warfield <mhw@wittsend.com>
This file assumes that you are using the Computone drivers which are This file assumes that you are using the Computone drivers which are
integrated into the kernel sources. For updating the drivers or installing integrated into the kernel sources. For updating the drivers or installing
...@@ -42,7 +41,7 @@ Hardware - If you have an ISA card, find a free interrupt and io port. ...@@ -42,7 +41,7 @@ Hardware - If you have an ISA card, find a free interrupt and io port.
before or after drivers installation. before or after drivers installation.
Note the hardware address from the Computone ISA cards installed into Note the hardware address from the Computone ISA cards installed into
the system. These are required for editing ip2.h or editing the system. These are required for editing ip2.c or editing
/etc/modules.conf, or for specification on the modprobe /etc/modules.conf, or for specification on the modprobe
command line. command line.
...@@ -58,7 +57,7 @@ b) Run "make config" or "make menuconfig" or "make xconfig" ...@@ -58,7 +57,7 @@ b) Run "make config" or "make menuconfig" or "make xconfig"
Select (m) module for CONFIG_COMPUTONE under character Select (m) module for CONFIG_COMPUTONE under character
devices. CONFIG_PCI and CONFIG_MODULES also may need to be set. devices. CONFIG_PCI and CONFIG_MODULES also may need to be set.
c) Set address on ISA cards then: c) Set address on ISA cards then:
edit /usr/src/linux/drivers/char/ip2/ip2.h if needed edit /usr/src/linux/drivers/char/ip2.c if needed
or or
edit /etc/modules.conf if needed (module). edit /etc/modules.conf if needed (module).
or both to match this setting. or both to match this setting.
...@@ -77,7 +76,8 @@ b) Run "make config" or "make menuconfig" or "make xconfig" ...@@ -77,7 +76,8 @@ b) Run "make config" or "make menuconfig" or "make xconfig"
Select (y) kernel for CONFIG_COMPUTONE under character Select (y) kernel for CONFIG_COMPUTONE under character
devices. CONFIG_PCI may need to be set if you have PCI bus. devices. CONFIG_PCI may need to be set if you have PCI bus.
c) Set address on ISA cards then: c) Set address on ISA cards then:
edit /usr/src/linux/drivers/char/ip2/ip2.h edit /usr/src/linux/drivers/char/ip2.c
(Optional - may be specified on kernel command line now)
d) Run "make dep" d) Run "make dep"
e) Run "make zImage" or whatever target you prefer. e) Run "make zImage" or whatever target you prefer.
f) mv /usr/src/linux/arch/i386/boot/zImage to /boot. f) mv /usr/src/linux/arch/i386/boot/zImage to /boot.
...@@ -86,6 +86,41 @@ g) Add new config for this kernel into /etc/lilo.conf, run "lilo" ...@@ -86,6 +86,41 @@ g) Add new config for this kernel into /etc/lilo.conf, run "lilo"
h) Reboot using this kernel h) Reboot using this kernel
i) run ip2mkdev (either the script below or the binary version) i) run ip2mkdev (either the script below or the binary version)
Kernel command line options:
When compiling the driver into the kernel, io and irq may be
compiled into the driver by editing ip2.c and setting the values for
io and irq in the appropriate array. An alternative is to specify
a command line parameter to the kernel at boot up.
ip2=io0,irq0,io1,irq1,io2,irq2,io3,irq3
Note that this order is very different from the specifications for the
modload parameters which have separate IRQ and IO specifiers.
The io port also selects PCI (1) and EISA (2) boards.
io=0 No board
io=1 PCI board
io=2 EISA board
else ISA board io address
You only need to specify the boards which are present.
Examples:
2 PCI boards:
ip2=1,0,1,0
1 ISA board at 0x310 irq 5:
ip2=0x310,5
This can be added to and "append" option in lilo.conf similar to this:
append="ip2=1,0,1,0"
3. INSTALLATION 3. INSTALLATION
...@@ -100,7 +135,7 @@ running patch -p1 < ThePatchFile. Otherwise run ip2build. ...@@ -100,7 +135,7 @@ running patch -p1 < ThePatchFile. Otherwise run ip2build.
The driver can be installed as a module (recommended) or built into the The driver can be installed as a module (recommended) or built into the
kernel. This is selected as for other drivers through the `make config` kernel. This is selected as for other drivers through the `make config`
command from the root of the Linux source tree. If the driver is built command from the root of the Linux source tree. If the driver is built
into the kernel you will need to edit the file ip2.h to match the boards into the kernel you will need to edit the file ip2.c to match the boards
you are installing. See that file for instructions. If the driver is you are installing. See that file for instructions. If the driver is
installed as a module the configuration can also be specified on the installed as a module the configuration can also be specified on the
modprobe command line as follows: modprobe command line as follows:
...@@ -109,13 +144,13 @@ modprobe command line as follows: ...@@ -109,13 +144,13 @@ modprobe command line as follows:
where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11, where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11,
12,15) and addr1-4 are the base addresses for up to four controllers. If 12,15) and addr1-4 are the base addresses for up to four controllers. If
the irqs are not specified the driver uses the default in ip2/ip2.h (which the irqs are not specified the driver uses the default in ip2.c (which
selects polled mode). If no base addresses are specified the defaults in selects polled mode). If no base addresses are specified the defaults in
ip2.h are used. If you are autoloading the driver module with kerneld or ip2.c are used. If you are autoloading the driver module with kerneld or
kmod the base addresses and interrupt number must also be set in ip2/ip2.h kmod the base addresses and interrupt number must also be set in ip2.c
and recompile or just insert and options line in /etc/modules.conf or both. and recompile or just insert and options line in /etc/modules.conf or both.
The options line is equivalent to the command line and takes precidence over The options line is equivalent to the command line and takes precidence over
what is in ip2.h. what is in ip2.c.
/etc/modules.conf sample: /etc/modules.conf sample:
options ip2 io=1,0x328 irq=1,10 options ip2 io=1,0x328 irq=1,10
...@@ -123,22 +158,18 @@ what is in ip2.h. ...@@ -123,22 +158,18 @@ what is in ip2.h.
alias char-major-72 ip2 alias char-major-72 ip2
alias char-major-73 ip2 alias char-major-73 ip2
equivelant ip2.h: The equivalent in ip2.c:
static ip2config_t ip2config =
{ static int io[IP2_MAX_BOARDS]= { 1, 0x328, 0, 0 };
{1,10,0,0}, static int irq[IP2_MAX_BOARDS] = { 1, 10, -1, -1 };
{
0x0001, // Board 0, ttyF0 - ttyF63 /* PCI card */ The equivalent for the kernel command line (in lilo.conf):
0x0328, // Board 1, ttyF64 - ttyF127 /* ISA card */
0x0000, // Board 2, ttyF128 - ttyF191 /* empty */ append="ip2=1,1,0x328,10"
0x0000 // Board 3, ttyF192 - ttyF255 /* empty */
}
};
Note: Both io and irq should be updated to reflect YOUR system. An "io" Note: Both io and irq should be updated to reflect YOUR system. An "io"
address of "1/2" indicates a PCI/EISA card in the board table. The address of 1 or 2 indicates a PCI or EISA card in the board table. The PCI or EISA irq will be assigned automatically.
PCI or EISA irq will be assigned automatically.
Specifying an invalid or in-use irq will default the driver into Specifying an invalid or in-use irq will default the driver into
running in polled mode for that card. If all irq entries are 0 then running in polled mode for that card. If all irq entries are 0 then
......
...@@ -296,9 +296,7 @@ W: ftp.compaq.com/pub/products/drivers/linux ...@@ -296,9 +296,7 @@ W: ftp.compaq.com/pub/products/drivers/linux
S: Supported S: Supported
COMPUTONE INTELLIPORT MULTIPORT CARD COMPUTONE INTELLIPORT MULTIPORT CARD
P: Doug McNash
P: Michael H. Warfield P: Michael H. Warfield
M: Doug McNash <dougm@computone.com>
M: Michael H. Warfield <mhw@wittsend.com> M: Michael H. Warfield <mhw@wittsend.com>
W: http://www.computone.com/ W: http://www.computone.com/
W: http://www.wittsend.com/computone.html W: http://www.wittsend.com/computone.html
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 13 SUBLEVEL = 14
EXTRAVERSION = EXTRAVERSION =-pre1
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
...@@ -36,12 +36,11 @@ mod-subdirs := ospm ...@@ -36,12 +36,11 @@ mod-subdirs := ospm
subdir-$(CONFIG_ACPI) += $(acpi-subdirs) subdir-$(CONFIG_ACPI) += $(acpi-subdirs)
subdir-$(CONFIG_ACPI_BUSMGR) += ospm subdir-$(CONFIG_ACPI_BUSMGR) += ospm
obj-$(CONFIG_ACPI) += os.o acpi_ksyms.o obj-$(CONFIG_ACPI) += driver.o os.o acpi_ksyms.o
obj-$(CONFIG_ACPI) += $(foreach dir,$(acpi-subdirs),$(dir)/$(dir).o) obj-$(CONFIG_ACPI) += $(foreach dir,$(acpi-subdirs),$(dir)/$(dir).o)
ifdef CONFIG_ACPI_KERNEL_CONFIG ifdef CONFIG_ACPI_KERNEL_CONFIG
obj-$(CONFIG_ACPI) += acpiconf.o osconf.o obj-$(CONFIG_ACPI) += acpiconf.o osconf.o
endif endif
obj-$(CONFIG_ACPI) += driver.o
ifeq ($(CONFIG_ACPI_BUSMGR),y) ifeq ($(CONFIG_ACPI_BUSMGR),y)
obj-y += ospm/ospm.o obj-y += ospm/ospm.o
......
...@@ -38,6 +38,14 @@ EXPORT_SYMBOL(acpi_in_debugger); ...@@ -38,6 +38,14 @@ EXPORT_SYMBOL(acpi_in_debugger);
EXPORT_SYMBOL(acpi_db_user_commands); EXPORT_SYMBOL(acpi_db_user_commands);
#endif #endif
#ifdef ACPI_DEBUG
EXPORT_SYMBOL(acpi_ut_debug_print_raw);
EXPORT_SYMBOL(acpi_ut_debug_print);
EXPORT_SYMBOL(acpi_ut_status_exit);
EXPORT_SYMBOL(acpi_ut_exit);
EXPORT_SYMBOL(acpi_ut_trace);
#endif
EXPORT_SYMBOL(acpi_gbl_FADT); EXPORT_SYMBOL(acpi_gbl_FADT);
EXPORT_SYMBOL(acpi_os_free); EXPORT_SYMBOL(acpi_os_free);
...@@ -104,5 +112,4 @@ EXPORT_SYMBOL(acpi_hw_register_read); ...@@ -104,5 +112,4 @@ EXPORT_SYMBOL(acpi_hw_register_read);
EXPORT_SYMBOL(acpi_set_firmware_waking_vector); EXPORT_SYMBOL(acpi_set_firmware_waking_vector);
EXPORT_SYMBOL(acpi_subsystem_status); EXPORT_SYMBOL(acpi_subsystem_status);
EXPORT_SYMBOL(acpi_os_signal); EXPORT_SYMBOL(acpi_os_signal);
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbcmds - debug commands and output routines * Module Name: dbcmds - debug commands and output routines
* $Revision: 65 $ * $Revision: 66 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -422,7 +422,7 @@ acpi_db_dump_namespace ( ...@@ -422,7 +422,7 @@ acpi_db_dump_namespace (
/* Display the subtree */ /* Display the subtree */
acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
acpi_ns_dump_objects (ACPI_TYPE_ANY, max_depth, ACPI_UINT32_MAX, subtree_entry); acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, ACPI_UINT32_MAX, subtree_entry);
acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
} }
...@@ -466,7 +466,7 @@ acpi_db_dump_namespace_by_owner ( ...@@ -466,7 +466,7 @@ acpi_db_dump_namespace_by_owner (
/* Display the subtree */ /* Display the subtree */
acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
acpi_ns_dump_objects (ACPI_TYPE_ANY, max_depth, owner_id, subtree_entry); acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, owner_id, subtree_entry);
acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
} }
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbdisasm - parser op tree display routines * Module Name: dbdisasm - parser op tree display routines
* $Revision: 48 $ * $Revision: 50 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -97,6 +97,7 @@ acpi_db_block_type ( ...@@ -97,6 +97,7 @@ acpi_db_block_type (
acpi_status acpi_status
acpi_ps_display_object_pathname ( acpi_ps_display_object_pathname (
acpi_walk_state *walk_state,
acpi_parse_object *op) acpi_parse_object *op)
{ {
acpi_parse_object *target_op; acpi_parse_object *target_op;
...@@ -130,26 +131,43 @@ acpi_ps_display_object_pathname ( ...@@ -130,26 +131,43 @@ acpi_ps_display_object_pathname (
acpi_status acpi_status
acpi_ps_display_object_pathname ( acpi_ps_display_object_pathname (
acpi_walk_state *walk_state,
acpi_parse_object *op) acpi_parse_object *op)
{ {
acpi_status status; acpi_status status;
acpi_namespace_node *node; acpi_namespace_node *node;
NATIVE_CHAR buffer[MAX_SHOW_ENTRY]; NATIVE_CHAR buffer[MAX_SHOW_ENTRY];
u32 buffer_size = MAX_SHOW_ENTRY; u32 buffer_size = MAX_SHOW_ENTRY;
u32 debug_level;
acpi_os_printf (" (Path "); /* Save current debug level so we don't get extraneous debug output */
debug_level = acpi_dbg_level;
acpi_dbg_level = 0;
/* Just get the Node out of the Op object */ /* Just get the Node out of the Op object */
node = op->node; node = op->node;
if (!node) { if (!node) {
/* Node not defined in this scope, look it up */
status = acpi_ns_lookup (walk_state->scope_info, op->value.string, ACPI_TYPE_ANY,
IMODE_EXECUTE, NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
/* /*
* No Named obj, so we can't get the pathname since the object * We can't get the pathname since the object
* is not in the namespace. This can happen during single * is not in the namespace. This can happen during single
* stepping where a dynamic named object is *about* to be created. * stepping where a dynamic named object is *about* to be created.
*/ */
return (AE_OK); acpi_os_printf (" [Path not found]");
goto exit;
}
/* Save it for next time. */
op->node = node;
} }
/* Convert Named_desc/handle to a full pathname */ /* Convert Named_desc/handle to a full pathname */
...@@ -157,11 +175,17 @@ acpi_ps_display_object_pathname ( ...@@ -157,11 +175,17 @@ acpi_ps_display_object_pathname (
status = acpi_ns_handle_to_pathname (node, &buffer_size, buffer); status = acpi_ns_handle_to_pathname (node, &buffer_size, buffer);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
acpi_os_printf ("****Could not get pathname****)"); acpi_os_printf ("****Could not get pathname****)");
return (status); goto exit;
} }
acpi_os_printf ("%s)", buffer); acpi_os_printf (" (Path %s)", buffer);
return (AE_OK);
exit:
/* Restore the debug level */
acpi_dbg_level = debug_level;
return (status);
} }
#endif #endif
...@@ -275,7 +299,7 @@ acpi_db_display_op ( ...@@ -275,7 +299,7 @@ acpi_db_display_op (
if ((op->opcode == AML_INT_NAMEPATH_OP && op->value.name) && if ((op->opcode == AML_INT_NAMEPATH_OP && op->value.name) &&
(op->parent) && (op->parent) &&
(acpi_gbl_db_opt_verbose)) { (acpi_gbl_db_opt_verbose)) {
acpi_ps_display_object_pathname (op); acpi_ps_display_object_pathname (walk_state, op);
} }
acpi_os_printf ("\n"); acpi_os_printf ("\n");
...@@ -561,7 +585,7 @@ acpi_db_display_opcode ( ...@@ -561,7 +585,7 @@ acpi_db_display_opcode (
case AML_QWORD_OP: case AML_QWORD_OP:
if (acpi_gbl_db_opt_verbose) { if (acpi_gbl_db_opt_verbose) {
acpi_os_printf ("(UINT64) 0x%8.8X%8.8X", op->value.integer64.hi, acpi_os_printf ("(u64) 0x%8.8X%8.8X", op->value.integer64.hi,
op->value.integer64.lo); op->value.integer64.lo);
} }
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbdisply - debug display commands * Module Name: dbdisply - debug display commands
* $Revision: 52 $ * $Revision: 57 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -246,7 +246,7 @@ acpi_db_decode_and_display_object ( ...@@ -246,7 +246,7 @@ acpi_db_decode_and_display_object (
} }
else { else {
acpi_os_printf ("Object Pathname: %s\n", ret_buf.pointer); acpi_os_printf ("Object (%p) Pathname: %s\n", node, ret_buf.pointer);
} }
if (!acpi_os_readable (node, sizeof (acpi_namespace_node))) { if (!acpi_os_readable (node, sizeof (acpi_namespace_node))) {
...@@ -264,7 +264,7 @@ acpi_db_decode_and_display_object ( ...@@ -264,7 +264,7 @@ acpi_db_decode_and_display_object (
return; return;
} }
acpi_ut_dump_buffer (node->object, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX); acpi_ut_dump_buffer ((void *) node->object, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX);
acpi_ex_dump_object_descriptor (node->object, 1); acpi_ex_dump_object_descriptor (node->object, 1);
} }
} }
...@@ -402,7 +402,7 @@ acpi_db_display_internal_object ( ...@@ -402,7 +402,7 @@ acpi_db_display_internal_object (
break; break;
case AML_REVISION_OP: case AML_REVISION_OP:
acpi_os_printf ("[Const] Revision (%X)", ACPI_CA_VERSION); acpi_os_printf ("[Const] Revision (%X)", ACPI_CA_SUPPORT_LEVEL);
break; break;
case AML_LOCAL_OP: case AML_LOCAL_OP:
...@@ -520,22 +520,11 @@ acpi_db_display_method_info ( ...@@ -520,22 +520,11 @@ acpi_db_display_method_info (
num_remaining_ops++; num_remaining_ops++;
} }
op_info = acpi_ps_get_opcode_info (op->opcode);
if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {
/* Bad opcode or ASCII character */
continue;
}
/* Decode the opcode */ /* Decode the opcode */
switch (ACPI_GET_OP_CLASS (op_info)) { op_info = acpi_ps_get_opcode_info (op->opcode);
case OPTYPE_CONSTANT: /* argument type only */ switch (op_info->class) {
case OPTYPE_LITERAL: /* argument type only */ case AML_CLASS_ARGUMENT:
case OPTYPE_DATA_TERM: /* argument type only */
case OPTYPE_LOCAL_VARIABLE: /* argument type only */
case OPTYPE_METHOD_ARGUMENT: /* argument type only */
if (count_remaining) { if (count_remaining) {
num_remaining_operands++; num_remaining_operands++;
} }
...@@ -543,6 +532,11 @@ acpi_db_display_method_info ( ...@@ -543,6 +532,11 @@ acpi_db_display_method_info (
num_operands++; num_operands++;
break; break;
case AML_CLASS_UNKNOWN:
/* Bad opcode or ASCII character */
continue;
default: default:
if (count_remaining) { if (count_remaining) {
num_remaining_operators++; num_remaining_operators++;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: dbfileio - Debugger file I/O commands. These can't usually * Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode) * be used when running the debugger in Ring 0 (Kernel mode)
* $Revision: 48 $ * $Revision: 53 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -38,16 +38,18 @@ ...@@ -38,16 +38,18 @@
MODULE_NAME ("dbfileio") MODULE_NAME ("dbfileio")
/*
* NOTE: this is here for lack of a better place. It is used in all
* flavors of the debugger, need LCD file
*/
#ifdef ACPI_APPLICATION #ifdef ACPI_APPLICATION
#include <stdio.h> #include <stdio.h>
FILE *acpi_gbl_debug_file = NULL; FILE *acpi_gbl_debug_file = NULL;
#endif #endif
/* acpi_table_header *acpi_gbl_db_table_ptr = NULL;
* NOTE: this is here for lack of a better place. It is used in all
* flavors of the debugger, need LCD file
*/
/******************************************************************************* /*******************************************************************************
* *
...@@ -172,7 +174,7 @@ acpi_db_load_table( ...@@ -172,7 +174,7 @@ acpi_db_load_table(
u32 *table_length) u32 *table_length)
{ {
acpi_table_header table_header; acpi_table_header table_header;
u8 *aml_ptr; u8 *aml_start;
u32 aml_length; u32 aml_length;
u32 actual; u32 actual;
acpi_status status; acpi_status status;
...@@ -209,7 +211,7 @@ acpi_db_load_table( ...@@ -209,7 +211,7 @@ acpi_db_load_table(
/* Allocate a buffer for the table */ /* Allocate a buffer for the table */
*table_length = table_header.length; *table_length = table_header.length;
*table_ptr = ACPI_MEM_ALLOCATE ((size_t) *table_length); *table_ptr = acpi_os_allocate ((size_t) *table_length);
if (!*table_ptr) { if (!*table_ptr) {
acpi_os_printf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n", acpi_os_printf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n",
table_header.signature, table_header.length); table_header.signature, table_header.length);
...@@ -217,7 +219,7 @@ acpi_db_load_table( ...@@ -217,7 +219,7 @@ acpi_db_load_table(
} }
aml_ptr = (u8 *) *table_ptr + sizeof (table_header); aml_start = (u8 *) *table_ptr + sizeof (table_header);
aml_length = *table_length - sizeof (table_header); aml_length = *table_length - sizeof (table_header);
/* Copy the header to the buffer */ /* Copy the header to the buffer */
...@@ -226,7 +228,7 @@ acpi_db_load_table( ...@@ -226,7 +228,7 @@ acpi_db_load_table(
/* Get the rest of the table */ /* Get the rest of the table */
actual = fread (aml_ptr, 1, (size_t) aml_length, fp); actual = fread (aml_start, 1, (size_t) aml_length, fp);
if (actual == aml_length) { if (actual == aml_length) {
return (AE_OK); return (AE_OK);
} }
...@@ -238,7 +240,7 @@ acpi_db_load_table( ...@@ -238,7 +240,7 @@ acpi_db_load_table(
acpi_os_printf ("Error - could not read the table file\n"); acpi_os_printf ("Error - could not read the table file\n");
ACPI_MEM_FREE (*table_ptr); acpi_os_free (*table_ptr);
*table_ptr = NULL; *table_ptr = NULL;
*table_length = 0; *table_length = 0;
...@@ -325,7 +327,6 @@ acpi_db_load_acpi_table ( ...@@ -325,7 +327,6 @@ acpi_db_load_acpi_table (
#ifdef ACPI_APPLICATION #ifdef ACPI_APPLICATION
FILE *fp; FILE *fp;
acpi_status status; acpi_status status;
acpi_table_header *table_ptr;
u32 table_length; u32 table_length;
...@@ -341,7 +342,7 @@ acpi_db_load_acpi_table ( ...@@ -341,7 +342,7 @@ acpi_db_load_acpi_table (
/* Get the entire file */ /* Get the entire file */
acpi_os_printf ("Loading Acpi table from file %s\n", filename); acpi_os_printf ("Loading Acpi table from file %s\n", filename);
status = acpi_db_load_table (fp, &table_ptr, &table_length); status = acpi_db_load_table (fp, &acpi_gbl_db_table_ptr, &table_length);
fclose(fp); fclose(fp);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
...@@ -349,27 +350,25 @@ acpi_db_load_acpi_table ( ...@@ -349,27 +350,25 @@ acpi_db_load_acpi_table (
return (status); return (status);
} }
/* Attempt to recognize and install the table */ /* Attempt to recognize and install the table */
status = ae_local_load_table (table_ptr);
status = ae_local_load_table (acpi_gbl_db_table_ptr);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
if (status == AE_EXIST) { if (status == AE_EXIST) {
acpi_os_printf ("Table %4.4s is already installed\n", acpi_os_printf ("Table %4.4s is already installed\n",
&table_ptr->signature); &acpi_gbl_db_table_ptr->signature);
} }
else { else {
acpi_os_printf ("Could not install table, %s\n", acpi_os_printf ("Could not install table, %s\n",
acpi_format_exception (status)); acpi_format_exception (status));
} }
ACPI_MEM_FREE (table_ptr); acpi_os_free (acpi_gbl_db_table_ptr);
return (status); return (status);
} }
acpi_os_printf ("%4.4s at %p successfully installed and loaded\n", acpi_os_printf ("%4.4s at %p successfully installed and loaded\n",
&table_ptr->signature, table_ptr); &acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr);
acpi_gbl_acpi_hardware_present = FALSE; acpi_gbl_acpi_hardware_present = FALSE;
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbinput - user front-end to the AML debugger * Module Name: dbinput - user front-end to the AML debugger
* $Revision: 68 $ * $Revision: 72 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -47,11 +47,10 @@ NATIVE_CHAR acpi_gbl_db_parsed_buf[80]; ...@@ -47,11 +47,10 @@ NATIVE_CHAR acpi_gbl_db_parsed_buf[80];
NATIVE_CHAR acpi_gbl_db_scope_buf[40]; NATIVE_CHAR acpi_gbl_db_scope_buf[40];
NATIVE_CHAR acpi_gbl_db_debug_filename[40]; NATIVE_CHAR acpi_gbl_db_debug_filename[40];
NATIVE_CHAR *acpi_gbl_db_args[DB_MAX_ARGS]; NATIVE_CHAR *acpi_gbl_db_args[DB_MAX_ARGS];
NATIVE_CHAR *acpi_gbl_db_buffer; NATIVE_CHAR *acpi_gbl_db_buffer = NULL;
NATIVE_CHAR *acpi_gbl_db_filename = NULL; NATIVE_CHAR *acpi_gbl_db_filename = NULL;
u8 acpi_gbl_db_output_to_file = FALSE; u8 acpi_gbl_db_output_to_file = FALSE;
u32 acpi_gbl_db_debug_level = ACPI_LV_VERBOSITY2; u32 acpi_gbl_db_debug_level = ACPI_LV_VERBOSITY2;
u32 acpi_gbl_db_console_debug_level = NORMAL_DEFAULT | ACPI_LV_TABLES; u32 acpi_gbl_db_console_debug_level = NORMAL_DEFAULT | ACPI_LV_TABLES;
u8 acpi_gbl_db_output_flags = DB_CONSOLE_OUTPUT; u8 acpi_gbl_db_output_flags = DB_CONSOLE_OUTPUT;
...@@ -525,7 +524,7 @@ acpi_db_command_dispatch ( ...@@ -525,7 +524,7 @@ acpi_db_command_dispatch (
case CMD_ALLOCATIONS: case CMD_ALLOCATIONS:
#ifdef ACPI_DBG_TRACK_ALLOCATIONS #ifdef ACPI_DBG_TRACK_ALLOCATIONS
acpi_ut_dump_current_allocations ((u32) -1, NULL); acpi_ut_dump_allocations ((u32) -1, NULL);
#endif #endif
break; break;
...@@ -917,7 +916,6 @@ acpi_db_user_commands ( ...@@ -917,7 +916,6 @@ acpi_db_user_commands (
* because all the semaphores are deleted during termination * because all the semaphores are deleted during termination
*/ */
acpi_terminate (); acpi_terminate ();
return (status); return (status);
} }
......
...@@ -368,11 +368,11 @@ acpi_db_display_statistics ( ...@@ -368,11 +368,11 @@ acpi_db_display_statistics (
if (acpi_gbl_memory_lists[i].object_size) if (acpi_gbl_memory_lists[i].object_size)
{ {
size = ROUND_UP_TO_1_k (outstanding * acpi_gbl_memory_lists[i].object_size); size = ROUND_UP_TO_1K (outstanding * acpi_gbl_memory_lists[i].object_size);
} }
else else
{ {
size = ROUND_UP_TO_1_k (acpi_gbl_memory_lists[i].current_total_size); size = ROUND_UP_TO_1K (acpi_gbl_memory_lists[i].current_total_size);
} }
acpi_os_printf (" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n", acpi_os_printf (" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n",
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbutils - AML debugger utilities * Module Name: dbutils - AML debugger utilities
* $Revision: 43 $ * $Revision: 45 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -135,7 +135,7 @@ acpi_db_dump_object ( ...@@ -135,7 +135,7 @@ acpi_db_dump_object (
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
acpi_os_printf ("[Integer] = %X%8.8X\n", HIDWORD (obj_desc->integer.value), acpi_os_printf ("[Integer] = %8.8X%8.8X\n", HIDWORD (obj_desc->integer.value),
LODWORD (obj_desc->integer.value)); LODWORD (obj_desc->integer.value));
break; break;
...@@ -265,15 +265,37 @@ acpi_db_second_pass_parse ( ...@@ -265,15 +265,37 @@ acpi_db_second_pass_parse (
acpi_parse_object *start_op; acpi_parse_object *start_op;
acpi_status status = AE_OK; acpi_status status = AE_OK;
u32 base_aml_offset; u32 base_aml_offset;
acpi_walk_state *walk_state;
FUNCTION_ENTRY ();
acpi_os_printf ("Pass two parse ....\n"); acpi_os_printf ("Pass two parse ....\n");
while (op) { while (op) {
if (op->opcode == AML_METHOD_OP) { if (op->opcode == AML_METHOD_OP) {
method = (acpi_parse2_object *) op; method = (acpi_parse2_object *) op;
status = acpi_ps_parse_aml (op, method->data, method->length, 0,
NULL, NULL, NULL, acpi_ds_load1_begin_op, acpi_ds_load1_end_op); walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
NULL, NULL, NULL);
if (!walk_state) {
return (AE_NO_MEMORY);
}
walk_state->parser_state.aml =
walk_state->parser_state.aml_start = method->data;
walk_state->parser_state.aml_end =
walk_state->parser_state.pkg_end = method->data + method->length;
walk_state->parser_state.start_scope = op;
walk_state->descending_callback = acpi_ds_load1_begin_op;
walk_state->ascending_callback = acpi_ds_load1_end_op;
status = acpi_ps_parse_aml (walk_state);
base_aml_offset = (method->value.arg)->aml_offset + 1; base_aml_offset = (method->value.arg)->aml_offset + 1;
...@@ -297,7 +319,7 @@ acpi_db_second_pass_parse ( ...@@ -297,7 +319,7 @@ acpi_db_second_pass_parse (
} }
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return (status); break;
} }
op = acpi_ps_get_depth_next (root, op); op = acpi_ps_get_depth_next (root, op);
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dbxface - AML Debugger external interfaces * Module Name: dbxface - AML Debugger external interfaces
* $Revision: 41 $ * $Revision: 45 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* *
* PARAMETERS: Walk_state - Current walk * PARAMETERS: Walk_state - Current walk
* Op - Current executing op * Op - Current executing op
* Op_type - Type of the current AML Opcode * Opcode_class - Class of the current AML Opcode
* *
* RETURN: Status * RETURN: Status
* *
...@@ -58,7 +58,7 @@ acpi_status ...@@ -58,7 +58,7 @@ acpi_status
acpi_db_single_step ( acpi_db_single_step (
acpi_walk_state *walk_state, acpi_walk_state *walk_state,
acpi_parse_object *op, acpi_parse_object *op,
u8 op_type) u32 opcode_class)
{ {
acpi_parse_object *next; acpi_parse_object *next;
acpi_status status = AE_OK; acpi_status status = AE_OK;
...@@ -91,23 +91,12 @@ acpi_db_single_step ( ...@@ -91,23 +91,12 @@ acpi_db_single_step (
return (AE_OK); return (AE_OK);
} }
switch (op_type) { switch (opcode_class) {
case OPTYPE_UNDEFINED: case AML_CLASS_UNKNOWN:
case OPTYPE_CONSTANT: /* argument type only */ case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */
case OPTYPE_LITERAL: /* argument type only */
case OPTYPE_DATA_TERM: /* argument type only */
case OPTYPE_LOCAL_VARIABLE: /* argument type only */
case OPTYPE_METHOD_ARGUMENT: /* argument type only */
return (AE_OK);
break;
case OPTYPE_NAMED_OBJECT:
switch (op->opcode) {
case AML_INT_NAMEPATH_OP:
return (AE_OK); return (AE_OK);
break; break;
} }
}
/* /*
* Under certain debug conditions, display this opcode and its operands * Under certain debug conditions, display this opcode and its operands
...@@ -270,7 +259,7 @@ acpi_db_initialize (void) ...@@ -270,7 +259,7 @@ acpi_db_initialize (void)
/* Init globals */ /* Init globals */
acpi_gbl_db_buffer = acpi_os_allocate (ACPI_DEBUG_BUFFER_SIZE); acpi_gbl_db_buffer = acpi_os_callocate (ACPI_DEBUG_BUFFER_SIZE);
/* Initial scope is the root */ /* Initial scope is the root */
...@@ -304,4 +293,29 @@ acpi_db_initialize (void) ...@@ -304,4 +293,29 @@ acpi_db_initialize (void)
} }
/*******************************************************************************
*
* FUNCTION: Acpi_db_terminate
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Stop debugger
*
******************************************************************************/
void
acpi_db_terminate (void)
{
if (acpi_gbl_db_table_ptr) {
acpi_os_free (acpi_gbl_db_table_ptr);
}
if (acpi_gbl_db_buffer) {
acpi_os_free (acpi_gbl_db_buffer);
}
}
#endif /* ENABLE_DEBUGGER */ #endif /* ENABLE_DEBUGGER */
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
* $Revision: 65 $ * $Revision: 69 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -65,6 +65,7 @@ acpi_ds_parse_method ( ...@@ -65,6 +65,7 @@ acpi_ds_parse_method (
acpi_parse_object *op; acpi_parse_object *op;
acpi_namespace_node *node; acpi_namespace_node *node;
acpi_owner_id owner_id; acpi_owner_id owner_id;
acpi_walk_state *walk_state;
FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle); FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle);
...@@ -77,7 +78,7 @@ acpi_ds_parse_method ( ...@@ -77,7 +78,7 @@ acpi_ds_parse_method (
} }
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** Named_obj=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** Named_obj=%p\n",
&((acpi_namespace_node *)obj_handle)->name, obj_handle)); (char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle));
/* Extract the method object from the method Node */ /* Extract the method object from the method Node */
...@@ -114,6 +115,20 @@ acpi_ds_parse_method ( ...@@ -114,6 +115,20 @@ acpi_ds_parse_method (
acpi_ps_set_name (op, node->name); acpi_ps_set_name (op, node->name);
op->node = node; op->node = node;
/* Create and initialize a new walk state */
walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
NULL, NULL, NULL);
if (!walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ds_init_aml_walk (walk_state, op, node, obj_desc->method.aml_start,
obj_desc->method.aml_length, NULL, NULL, 1);
if (ACPI_FAILURE (status)) {
/* TBD: delete walk state */
return_ACPI_STATUS (status);
}
/* /*
* Parse the method, first pass * Parse the method, first pass
...@@ -125,12 +140,7 @@ acpi_ds_parse_method ( ...@@ -125,12 +140,7 @@ acpi_ds_parse_method (
* method so that operands to the named objects can * method so that operands to the named objects can
* take on dynamic run-time values. * take on dynamic run-time values.
*/ */
status = acpi_ps_parse_aml (op, obj_desc->method.pcode, status = acpi_ps_parse_aml (walk_state);
obj_desc->method.pcode_length,
ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE,
node, NULL, NULL,
acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -141,10 +151,7 @@ acpi_ds_parse_method ( ...@@ -141,10 +151,7 @@ acpi_ds_parse_method (
obj_desc->method.owning_id = owner_id; obj_desc->method.owning_id = owner_id;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n",
&((acpi_namespace_node *)obj_handle)->name, obj_handle, op)); (char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle, op));
/* Install the parsed tree in the method object */
/* TBD: [Restructure] Obsolete field? */
acpi_ps_delete_parse_tree (op); acpi_ps_delete_parse_tree (op);
...@@ -242,13 +249,12 @@ acpi_status ...@@ -242,13 +249,12 @@ acpi_status
acpi_ds_call_control_method ( acpi_ds_call_control_method (
acpi_walk_list *walk_list, acpi_walk_list *walk_list,
acpi_walk_state *this_walk_state, acpi_walk_state *this_walk_state,
acpi_parse_object *op) acpi_parse_object *op) /* TBD: This operand is obsolete */
{ {
acpi_status status; acpi_status status;
acpi_namespace_node *method_node; acpi_namespace_node *method_node;
acpi_operand_object *obj_desc; acpi_operand_object *obj_desc;
acpi_walk_state *next_walk_state; acpi_walk_state *next_walk_state;
acpi_parse_state *parser_state;
u32 i; u32 i;
...@@ -270,7 +276,6 @@ acpi_ds_call_control_method ( ...@@ -270,7 +276,6 @@ acpi_ds_call_control_method (
return_ACPI_STATUS (AE_NULL_OBJECT); return_ACPI_STATUS (AE_NULL_OBJECT);
} }
/* Init for new method, wait on concurrency semaphore */ /* Init for new method, wait on concurrency semaphore */
status = acpi_ds_begin_method_execution (method_node, obj_desc, status = acpi_ds_begin_method_execution (method_node, obj_desc,
...@@ -279,78 +284,62 @@ acpi_ds_call_control_method ( ...@@ -279,78 +284,62 @@ acpi_ds_call_control_method (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* Create and initialize a new parser state */
parser_state = acpi_ps_create_state (obj_desc->method.pcode, /* 1) Parse: Create a new walk state for the preempting walk */
obj_desc->method.pcode_length);
if (!parser_state) { next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
op, obj_desc, NULL);
if (!next_walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
goto cleanup;
} }
acpi_ps_init_scope (parser_state, NULL); /* Create and init a Root Node */
parser_state->start_node = method_node;
/* Create a new state for the preempting walk */
next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, op = acpi_ps_alloc_op (AML_SCOPE_OP);
NULL, obj_desc, walk_list); if (!op) {
if (!next_walk_state) { status = AE_NO_MEMORY;
/* TBD: delete parser state */ goto cleanup;
}
return_ACPI_STATUS (AE_NO_MEMORY); status = acpi_ds_init_aml_walk (next_walk_state, op, method_node,
obj_desc->method.aml_start, obj_desc->method.aml_length,
NULL, NULL, 1);
if (ACPI_FAILURE (status)) {
/* TBD: delete walk state */
goto cleanup;
} }
next_walk_state->walk_type = WALK_METHOD; /* Begin AML parse */
next_walk_state->method_node = method_node;
next_walk_state->parser_state = parser_state;
next_walk_state->parse_flags = this_walk_state->parse_flags;
next_walk_state->descending_callback = this_walk_state->descending_callback;
next_walk_state->ascending_callback = this_walk_state->ascending_callback;
/* The Next_op of the Next_walk will be the beginning of the method */ status = acpi_ps_parse_aml (next_walk_state);
/* TBD: [Restructure] -- obsolete? */ acpi_ps_delete_parse_tree (op);
next_walk_state->next_op = NULL;
/* Open a new scope */ /* 2) Execute: Create a new state for the preempting walk */
status = acpi_ds_scope_stack_push (method_node, next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
ACPI_TYPE_METHOD, next_walk_state); NULL, obj_desc, walk_list);
if (ACPI_FAILURE (status)) { if (!next_walk_state) {
status = AE_NO_MEMORY;
goto cleanup; goto cleanup;
} }
/* /*
* Initialize the arguments for the method. The resolved * The resolved arguments were put on the previous walk state's operand
* arguments were put on the previous walk state's operand
* stack. Operands on the previous walk state stack always * stack. Operands on the previous walk state stack always
* start at index 0. * start at index 0.
* Null terminate the list of arguments
*/ */
status = acpi_ds_method_data_init_args (&this_walk_state->operands[0], this_walk_state->operands [this_walk_state->num_operands] = NULL;
this_walk_state->num_operands,
next_walk_state); status = acpi_ds_init_aml_walk (next_walk_state, NULL, method_node,
obj_desc->method.aml_start, obj_desc->method.aml_length,
&this_walk_state->operands[0], NULL, 3);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
goto cleanup; goto cleanup;
} }
/* Create and init a Root Node */
op = acpi_ps_alloc_op (AML_SCOPE_OP);
if (!op) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ps_parse_aml (op, obj_desc->method.pcode,
obj_desc->method.pcode_length,
ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE,
method_node, NULL, NULL,
acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
acpi_ps_delete_parse_tree (op);
/* /*
* Delete the operands on the previous walkstate operand stack * Delete the operands on the previous walkstate operand stack
* (they were copied to new objects) * (they were copied to new objects)
...@@ -364,7 +353,6 @@ acpi_ds_call_control_method ( ...@@ -364,7 +353,6 @@ acpi_ds_call_control_method (
this_walk_state->num_operands = 0; this_walk_state->num_operands = 0;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n",
next_walk_state)); next_walk_state));
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsobject - Dispatcher object management routines * Module Name: dsobject - Dispatcher object management routines
* $Revision: 75 $ * $Revision: 81 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -64,7 +64,7 @@ acpi_ds_init_one_object ( ...@@ -64,7 +64,7 @@ acpi_ds_init_one_object (
{ {
acpi_object_type8 type; acpi_object_type8 type;
acpi_status status; acpi_status status;
ACPI_INIT_WALK_INFO *info = (ACPI_INIT_WALK_INFO *) context; acpi_init_walk_info *info = (acpi_init_walk_info *) context;
u8 table_revision; u8 table_revision;
...@@ -118,15 +118,14 @@ acpi_ds_init_one_object ( ...@@ -118,15 +118,14 @@ acpi_ds_init_one_object (
* Always parse methods to detect errors, we may delete * Always parse methods to detect errors, we may delete
* the parse tree below * the parse tree below
*/ */
status = acpi_ds_parse_method (obj_handle); status = acpi_ds_parse_method (obj_handle);
/* TBD: [Errors] what do we do with an error? */
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] parse failed! %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
obj_handle, &((acpi_namespace_node *)obj_handle)->name, obj_handle, (char*)&((acpi_namespace_node *)obj_handle)->name,
acpi_format_exception (status))); acpi_format_exception (status)));
/* This parse failed, but we will continue parsing more methods */
break; break;
} }
...@@ -168,7 +167,7 @@ acpi_ds_initialize_objects ( ...@@ -168,7 +167,7 @@ acpi_ds_initialize_objects (
acpi_namespace_node *start_node) acpi_namespace_node *start_node)
{ {
acpi_status status; acpi_status status;
ACPI_INIT_WALK_INFO info; acpi_init_walk_info info;
FUNCTION_TRACE ("Ds_initialize_objects"); FUNCTION_TRACE ("Ds_initialize_objects");
...@@ -241,7 +240,7 @@ acpi_ds_init_object_from_op ( ...@@ -241,7 +240,7 @@ acpi_ds_init_object_from_op (
obj_desc = *ret_obj_desc; obj_desc = *ret_obj_desc;
op_info = acpi_ps_get_opcode_info (opcode); op_info = acpi_ps_get_opcode_info (opcode);
if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) { if (op_info->class == AML_CLASS_UNKNOWN) {
/* Unknown opcode */ /* Unknown opcode */
return (AE_TYPE); return (AE_TYPE);
...@@ -308,7 +307,7 @@ acpi_ds_init_object_from_op ( ...@@ -308,7 +307,7 @@ acpi_ds_init_object_from_op (
byte_list = (acpi_parse2_object *) arg->next; byte_list = (acpi_parse2_object *) arg->next;
if (byte_list) { if (byte_list) {
if (byte_list->opcode != AML_INT_BYTELIST_OP) { if (byte_list->opcode != AML_INT_BYTELIST_OP) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %x\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %p\n",
byte_list)); byte_list));
return (AE_TYPE); return (AE_TYPE);
} }
...@@ -356,8 +355,8 @@ acpi_ds_init_object_from_op ( ...@@ -356,8 +355,8 @@ acpi_ds_init_object_from_op (
case INTERNAL_TYPE_REFERENCE: case INTERNAL_TYPE_REFERENCE:
switch (ACPI_GET_OP_CLASS (op_info)) { switch (op_info->type) {
case OPTYPE_LOCAL_VARIABLE: case AML_TYPE_LOCAL_VARIABLE:
/* Split the opcode into a base opcode + offset */ /* Split the opcode into a base opcode + offset */
...@@ -366,7 +365,7 @@ acpi_ds_init_object_from_op ( ...@@ -366,7 +365,7 @@ acpi_ds_init_object_from_op (
break; break;
case OPTYPE_METHOD_ARGUMENT: case AML_TYPE_METHOD_ARGUMENT:
/* Split the opcode into a base opcode + offset */ /* Split the opcode into a base opcode + offset */
...@@ -655,6 +654,15 @@ acpi_ds_create_node ( ...@@ -655,6 +654,15 @@ acpi_ds_create_node (
FUNCTION_TRACE_PTR ("Ds_create_node", op); FUNCTION_TRACE_PTR ("Ds_create_node", op);
/*
* Because of the execution pass through the non-control-method
* parts of the table, we can arrive here twice. Only init
* the named object node the first time through
*/
if (node->object) {
return_ACPI_STATUS (AE_OK);
}
if (!op->value.arg) { if (!op->value.arg) {
/* No arguments, there is nothing to do */ /* No arguments, there is nothing to do */
...@@ -675,14 +683,8 @@ acpi_ds_create_node ( ...@@ -675,14 +683,8 @@ acpi_ds_create_node (
/* Init obj */ /* Init obj */
status = acpi_ns_attach_object (node, obj_desc, (u8) node->type); status = acpi_ns_attach_object (node, obj_desc, (u8) node->type);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
return_ACPI_STATUS (status);
cleanup: /* Remove local reference to the object */
acpi_ut_remove_reference (obj_desc); acpi_ut_remove_reference (obj_desc);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: dsopcode - Dispatcher Op Region support and handling of * Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes * "control" opcodes
* $Revision: 52 $ * $Revision: 56 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -61,6 +61,7 @@ acpi_ds_get_buffer_field_arguments ( ...@@ -61,6 +61,7 @@ acpi_ds_get_buffer_field_arguments (
acpi_parse_object *field_op; acpi_parse_object *field_op;
acpi_status status; acpi_status status;
acpi_table_desc *table_desc; acpi_table_desc *table_desc;
acpi_walk_state *walk_state;
FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc); FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc);
...@@ -78,7 +79,7 @@ acpi_ds_get_buffer_field_arguments ( ...@@ -78,7 +79,7 @@ acpi_ds_get_buffer_field_arguments (
DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]")); DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n",
&node->name)); (char*)&node->name));
/* /*
...@@ -101,17 +102,34 @@ acpi_ds_get_buffer_field_arguments ( ...@@ -101,17 +102,34 @@ acpi_ds_get_buffer_field_arguments (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* Create and initialize a new parser state */
walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
NULL, NULL, NULL);
if (!walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
extra_desc->extra.aml_length, NULL, NULL, 1);
if (ACPI_FAILURE (status)) {
/* TBD: delete walk state */
return_ACPI_STATUS (status);
}
/* TBD: No Walk flags?? */
walk_state->parse_flags = 0;
/* Pass1: Parse the entire Buffer_field declaration */ /* Pass1: Parse the entire Buffer_field declaration */
status = acpi_ps_parse_aml (op, extra_desc->extra.pcode, status = acpi_ps_parse_aml (walk_state);
extra_desc->extra.pcode_length, 0,
NULL, NULL, NULL, acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
acpi_ps_delete_parse_tree (op); acpi_ps_delete_parse_tree (op);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* Get and init the actual Fiel_unit_op created above */ /* Get and init the actual Field_unit Op created above */
field_op = op->value.arg; field_op = op->value.arg;
op->node = node; op->node = node;
...@@ -121,7 +139,7 @@ acpi_ds_get_buffer_field_arguments ( ...@@ -121,7 +139,7 @@ acpi_ds_get_buffer_field_arguments (
field_op->node = node; field_op->node = node;
acpi_ps_delete_parse_tree (op); acpi_ps_delete_parse_tree (op);
/* Acpi_evaluate the address and length arguments for the Op_region */ /* Evaluate the address and length arguments for the Op_region */
op = acpi_ps_alloc_op (AML_SCOPE_OP); op = acpi_ps_alloc_op (AML_SCOPE_OP);
if (!op) { if (!op) {
...@@ -130,15 +148,23 @@ acpi_ds_get_buffer_field_arguments ( ...@@ -130,15 +148,23 @@ acpi_ds_get_buffer_field_arguments (
op->node = acpi_ns_get_parent_object (node); op->node = acpi_ns_get_parent_object (node);
status = acpi_ps_parse_aml (op, extra_desc->extra.pcode, /* Create and initialize a new parser state */
extra_desc->extra.pcode_length,
ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE,
NULL /*Method_desc*/, NULL, NULL,
acpi_ds_exec_begin_op, acpi_ds_exec_end_op);
/* All done with the parse tree, delete it */
acpi_ps_delete_parse_tree (op); walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
NULL, NULL, NULL);
if (!walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
extra_desc->extra.aml_length, NULL, NULL, 3);
if (ACPI_FAILURE (status)) {
/* TBD: delete walk state */
return_ACPI_STATUS (status);
}
status = acpi_ps_parse_aml (walk_state);
acpi_ps_delete_parse_tree (op);
/* /*
* The pseudo-method object is no longer needed since the region is * The pseudo-method object is no longer needed since the region is
...@@ -174,6 +200,7 @@ acpi_ds_get_region_arguments ( ...@@ -174,6 +200,7 @@ acpi_ds_get_region_arguments (
acpi_parse_object *region_op; acpi_parse_object *region_op;
acpi_status status; acpi_status status;
acpi_table_desc *table_desc; acpi_table_desc *table_desc;
acpi_walk_state *walk_state;
FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc); FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc);
...@@ -191,9 +218,8 @@ acpi_ds_get_region_arguments ( ...@@ -191,9 +218,8 @@ acpi_ds_get_region_arguments (
DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]")); DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p[%x]\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
&node->name, extra_desc->extra.pcode, (char*)&node->name, extra_desc->extra.aml_start));
*(u32*) extra_desc->extra.pcode));
/* /*
* Allocate a new parser op to be the root of the parsed * Allocate a new parser op to be the root of the parsed
...@@ -215,11 +241,28 @@ acpi_ds_get_region_arguments ( ...@@ -215,11 +241,28 @@ acpi_ds_get_region_arguments (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* Create and initialize a new parser state */
walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
op, NULL, NULL);
if (!walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
extra_desc->extra.aml_length, NULL, NULL, 1);
if (ACPI_FAILURE (status)) {
/* TBD: delete walk state */
return_ACPI_STATUS (status);
}
/* TBD: No Walk flags?? */
walk_state->parse_flags = 0;
/* Parse the entire Op_region declaration, creating a parse tree */ /* Parse the entire Op_region declaration, creating a parse tree */
status = acpi_ps_parse_aml (op, extra_desc->extra.pcode, status = acpi_ps_parse_aml (walk_state);
extra_desc->extra.pcode_length, 0,
NULL, NULL, NULL, acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
acpi_ps_delete_parse_tree (op); acpi_ps_delete_parse_tree (op);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -244,14 +287,22 @@ acpi_ds_get_region_arguments ( ...@@ -244,14 +287,22 @@ acpi_ds_get_region_arguments (
op->node = acpi_ns_get_parent_object (node); op->node = acpi_ns_get_parent_object (node);
status = acpi_ps_parse_aml (op, extra_desc->extra.pcode, /* Create and initialize a new parser state */
extra_desc->extra.pcode_length,
ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE, walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
NULL /*Method_desc*/, NULL, NULL, op, NULL, NULL);
acpi_ds_exec_begin_op, acpi_ds_exec_end_op); if (!walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* All done with the parse tree, delete it */ status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
extra_desc->extra.aml_length, NULL, NULL, 3);
if (ACPI_FAILURE (status)) {
/* TBD: delete walk state */
return_ACPI_STATUS (status);
}
status = acpi_ps_parse_aml (walk_state);
acpi_ps_delete_parse_tree (op); acpi_ps_delete_parse_tree (op);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -668,7 +719,7 @@ acpi_ds_eval_region_operands ( ...@@ -668,7 +719,7 @@ acpi_ds_eval_region_operands (
acpi_ut_remove_reference (operand_desc); acpi_ut_remove_reference (operand_desc);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8lX%8.8lX Len %X\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8X%8.8X Len %X\n",
obj_desc, HIDWORD(obj_desc->region.address), LODWORD(obj_desc->region.address), obj_desc, HIDWORD(obj_desc->region.address), LODWORD(obj_desc->region.address),
obj_desc->region.length)); obj_desc->region.length));
...@@ -731,7 +782,7 @@ acpi_ds_exec_begin_control_op ( ...@@ -731,7 +782,7 @@ acpi_ds_exec_begin_control_op (
* of a loop * of a loop
*/ */
walk_state->control_state->control.aml_predicate_start = walk_state->control_state->control.aml_predicate_start =
walk_state->parser_state->aml - 1; walk_state->parser_state.aml - 1;
/* TBD: can this be removed? */ /* TBD: can this be removed? */
/*Acpi_ps_pkg_length_encoding_size (GET8 (Walk_state->Parser_state->Aml));*/ /*Acpi_ps_pkg_length_encoding_size (GET8 (Walk_state->Parser_state->Aml));*/
break; break;
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dsutils - Dispatcher utilities * Module Name: dsutils - Dispatcher utilities
* $Revision: 72 $ * $Revision: 80 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -85,8 +85,8 @@ acpi_ds_is_result_used ( ...@@ -85,8 +85,8 @@ acpi_ds_is_result_used (
*/ */
parent_info = acpi_ps_get_opcode_info (op->parent->opcode); parent_info = acpi_ps_get_opcode_info (op->parent->opcode);
if (ACPI_GET_OP_TYPE (parent_info) != ACPI_OP_TYPE_OPCODE) { if (parent_info->class == AML_CLASS_UNKNOWN) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%X\n", op)); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%p\n", op));
return_VALUE (FALSE); return_VALUE (FALSE);
} }
...@@ -97,11 +97,11 @@ acpi_ds_is_result_used ( ...@@ -97,11 +97,11 @@ acpi_ds_is_result_used (
* Otherwise leave it as is, it will be deleted when it is used * Otherwise leave it as is, it will be deleted when it is used
* as an operand later. * as an operand later.
*/ */
switch (ACPI_GET_OP_CLASS (parent_info)) { switch (parent_info->class) {
/* /*
* In these cases, the parent will never use the return object * In these cases, the parent will never use the return object
*/ */
case OPTYPE_CONTROL: /* IF, ELSE, WHILE only */ case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */
switch (op->parent->opcode) { switch (op->parent->opcode) {
case AML_RETURN_OP: case AML_RETURN_OP:
...@@ -109,7 +109,7 @@ acpi_ds_is_result_used ( ...@@ -109,7 +109,7 @@ acpi_ds_is_result_used (
/* Never delete the return value associated with a return opcode */ /* Never delete the return value associated with a return opcode */
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Result used, [RETURN] opcode=%X Op=%X\n", op->opcode, op)); "Result used, [RETURN] opcode=%X Op=%p\n", op->opcode, op));
return_VALUE (TRUE); return_VALUE (TRUE);
break; break;
...@@ -123,7 +123,7 @@ acpi_ds_is_result_used ( ...@@ -123,7 +123,7 @@ acpi_ds_is_result_used (
if ((walk_state->control_state->common.state == CONTROL_PREDICATE_EXECUTING) && if ((walk_state->control_state->common.state == CONTROL_PREDICATE_EXECUTING) &&
(walk_state->control_state->control.predicate_op == op)) { (walk_state->control_state->control.predicate_op == op)) {
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n", "Result used as a predicate, [IF/WHILE] opcode=%X Op=%p\n",
op->opcode, op)); op->opcode, op));
return_VALUE (TRUE); return_VALUE (TRUE);
} }
...@@ -135,7 +135,8 @@ acpi_ds_is_result_used ( ...@@ -135,7 +135,8 @@ acpi_ds_is_result_used (
/* Fall through to not used case below */ /* Fall through to not used case below */
case OPTYPE_NAMED_OBJECT: /* Scope, method, etc. */ case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */
case AML_CLASS_CREATE:
/* /*
* These opcodes allow Term_arg(s) as operands and therefore * These opcodes allow Term_arg(s) as operands and therefore
...@@ -149,13 +150,13 @@ acpi_ds_is_result_used ( ...@@ -149,13 +150,13 @@ acpi_ds_is_result_used (
(op->parent->opcode == AML_CREATE_DWORD_FIELD_OP) || (op->parent->opcode == AML_CREATE_DWORD_FIELD_OP) ||
(op->parent->opcode == AML_CREATE_QWORD_FIELD_OP)) { (op->parent->opcode == AML_CREATE_QWORD_FIELD_OP)) {
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Result used, [Region or Create_field] opcode=%X Op=%X\n", "Result used, [Region or Create_field] opcode=%X Op=%p\n",
op->opcode, op)); op->opcode, op));
return_VALUE (TRUE); return_VALUE (TRUE);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Result not used, Parent opcode=%X Op=%X\n", op->opcode, op)); "Result not used, Parent opcode=%X Op=%p\n", op->opcode, op));
return_VALUE (FALSE); return_VALUE (FALSE);
break; break;
...@@ -338,6 +339,11 @@ acpi_ds_create_operand ( ...@@ -338,6 +339,11 @@ acpi_ds_create_operand (
* very serious error at this point * very serious error at this point
*/ */
status = AE_AML_NAME_NOT_FOUND; status = AE_AML_NAME_NOT_FOUND;
/* TBD: Externalize Name_string and print */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Object name was not found in namespace\n"));
} }
} }
...@@ -580,16 +586,21 @@ acpi_ds_map_opcode_to_data_type ( ...@@ -580,16 +586,21 @@ acpi_ds_map_opcode_to_data_type (
op_info = acpi_ps_get_opcode_info (opcode); op_info = acpi_ps_get_opcode_info (opcode);
if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) { if (op_info->class == AML_CLASS_UNKNOWN) {
/* Unknown opcode */ /* Unknown opcode */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", opcode)); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", opcode));
return (data_type); return (data_type);
} }
switch (ACPI_GET_OP_CLASS (op_info)) {
case OPTYPE_LITERAL: /*
* TBD: Use op class
*/
switch (op_info->type) {
case AML_TYPE_LITERAL:
switch (opcode) { switch (opcode) {
case AML_BYTE_OP: case AML_BYTE_OP:
...@@ -618,7 +629,7 @@ acpi_ds_map_opcode_to_data_type ( ...@@ -618,7 +629,7 @@ acpi_ds_map_opcode_to_data_type (
break; break;
case OPTYPE_DATA_TERM: case AML_TYPE_DATA_TERM:
switch (opcode) { switch (opcode) {
case AML_BUFFER_OP: case AML_BUFFER_OP:
...@@ -640,44 +651,49 @@ acpi_ds_map_opcode_to_data_type ( ...@@ -640,44 +651,49 @@ acpi_ds_map_opcode_to_data_type (
break; break;
case OPTYPE_CONSTANT: case AML_TYPE_CONSTANT:
case OPTYPE_METHOD_ARGUMENT: case AML_TYPE_METHOD_ARGUMENT:
case OPTYPE_LOCAL_VARIABLE: case AML_TYPE_LOCAL_VARIABLE:
data_type = INTERNAL_TYPE_REFERENCE; data_type = INTERNAL_TYPE_REFERENCE;
break; break;
case OPTYPE_MONADIC2: case AML_TYPE_EXEC_1A_0T_1R:
case OPTYPE_MONADIC2_r: case AML_TYPE_EXEC_1A_1T_1R:
case OPTYPE_DYADIC2: case AML_TYPE_EXEC_2A_0T_1R:
case OPTYPE_DYADIC2_r: case AML_TYPE_EXEC_2A_1T_1R:
case OPTYPE_DYADIC2_s: case AML_TYPE_EXEC_2A_2T_1R:
case OPTYPE_TRIADIC: case AML_TYPE_EXEC_3A_1T_1R:
case OPTYPE_QUADRADIC: case AML_TYPE_EXEC_6A_0T_1R:
case OPTYPE_HEXADIC: case AML_TYPE_RETURN:
case OPTYPE_RETURN:
flags = OP_HAS_RETURN_VALUE; flags = OP_HAS_RETURN_VALUE;
data_type = ACPI_TYPE_ANY; data_type = ACPI_TYPE_ANY;
break; break;
case OPTYPE_METHOD_CALL: case AML_TYPE_METHOD_CALL:
flags = OP_HAS_RETURN_VALUE; flags = OP_HAS_RETURN_VALUE;
data_type = ACPI_TYPE_METHOD; data_type = ACPI_TYPE_METHOD;
break; break;
case OPTYPE_NAMED_OBJECT: case AML_TYPE_NAMED_FIELD:
case AML_TYPE_NAMED_SIMPLE:
case AML_TYPE_NAMED_COMPLEX:
case AML_TYPE_NAMED_NO_OBJ:
data_type = acpi_ds_map_named_opcode_to_data_type (opcode); data_type = acpi_ds_map_named_opcode_to_data_type (opcode);
break; break;
case OPTYPE_DYADIC1: case AML_TYPE_EXEC_1A_0T_0R:
case OPTYPE_CONTROL: case AML_TYPE_EXEC_2A_0T_0R:
case AML_TYPE_EXEC_3A_0T_0R:
case AML_TYPE_EXEC_1A_1T_0R:
case AML_TYPE_CONTROL:
/* No mapping needed at this time */ /* No mapping needed at this time */
...@@ -784,6 +800,7 @@ acpi_ds_map_named_opcode_to_data_type ( ...@@ -784,6 +800,7 @@ acpi_ds_map_named_opcode_to_data_type (
data_type = ACPI_TYPE_EVENT; data_type = ACPI_TYPE_EVENT;
break; break;
case AML_DATA_REGION_OP:
case AML_REGION_OP: case AML_REGION_OP:
data_type = ACPI_TYPE_REGION; data_type = ACPI_TYPE_REGION;
break; break;
......
This diff is collapsed.
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswscope - Scope stack manipulation * Module Name: dswscope - Scope stack manipulation
* $Revision: 48 $ * $Revision: 49 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -116,6 +116,7 @@ acpi_ds_scope_stack_push ( ...@@ -116,6 +116,7 @@ acpi_ds_scope_stack_push (
/* Init new scope object */ /* Init new scope object */
scope_info->common.data_type = ACPI_DESC_TYPE_STATE_WSCOPE;
scope_info->scope.node = node; scope_info->scope.node = node;
scope_info->common.value = (u16) type; scope_info->common.value = (u16) type;
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswstate - Dispatcher parse tree walk management routines * Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 51 $ * $Revision: 54 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -368,6 +368,7 @@ acpi_ds_result_stack_push ( ...@@ -368,6 +368,7 @@ acpi_ds_result_stack_push (
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
state->common.data_type = ACPI_DESC_TYPE_STATE_RESULT;
acpi_ut_push_generic_state (&walk_state->results, state); acpi_ut_push_generic_state (&walk_state->results, state);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Results=%p State=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Results=%p State=%p\n",
...@@ -744,7 +745,7 @@ acpi_ds_get_current_walk_state ( ...@@ -744,7 +745,7 @@ acpi_ds_get_current_walk_state (
* *
******************************************************************************/ ******************************************************************************/
static void void
acpi_ds_push_walk_state ( acpi_ds_push_walk_state (
acpi_walk_state *walk_state, acpi_walk_state *walk_state,
acpi_walk_list *walk_list) acpi_walk_list *walk_list)
...@@ -855,12 +856,103 @@ acpi_ds_create_walk_state ( ...@@ -855,12 +856,103 @@ acpi_ds_create_walk_state (
/* Put the new state at the head of the walk list */ /* Put the new state at the head of the walk list */
if (walk_list) {
acpi_ds_push_walk_state (walk_state, walk_list); acpi_ds_push_walk_state (walk_state, walk_list);
}
return_PTR (walk_state); return_PTR (walk_state);
} }
#ifndef _ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: Acpi_ds_init_aml_walk
*
* PARAMETERS: Walk_state - New state to be initialized
*
* RETURN: None
*
* DESCRIPTION: Initialize a walk state for a pass 1 or 2 parse tree walk
*
******************************************************************************/
acpi_status
acpi_ds_init_aml_walk (
acpi_walk_state *walk_state,
acpi_parse_object *op,
acpi_namespace_node *method_node,
u8 *aml_start,
u32 aml_length,
acpi_operand_object **params,
acpi_operand_object **return_obj_desc,
u32 pass_number)
{
acpi_status status;
acpi_parse_state *parser_state = &walk_state->parser_state;
FUNCTION_TRACE ("Ds_init_aml_walk");
walk_state->parser_state.aml =
walk_state->parser_state.aml_start = aml_start;
walk_state->parser_state.aml_end =
walk_state->parser_state.pkg_end = aml_start + aml_length;
/* The Next_op of the Next_walk will be the beginning of the method */
/* TBD: [Restructure] -- obsolete? */
walk_state->next_op = NULL;
walk_state->params = params;
walk_state->caller_return_desc = return_obj_desc;
status = acpi_ps_init_scope (&walk_state->parser_state, op);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
if (method_node) {
walk_state->parser_state.start_node = method_node;
walk_state->walk_type = WALK_METHOD;
walk_state->method_node = method_node;
walk_state->method_desc = acpi_ns_get_attached_object (method_node);
/* Push start scope on scope stack and make it current */
status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Init the method arguments */
acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state);
}
else {
/* Setup the current scope */
parser_state->start_node = parser_state->start_op->node;
if (parser_state->start_node) {
/* Push start scope on scope stack and make it current */
status = acpi_ds_scope_stack_push (parser_state->start_node,
parser_state->start_node->type, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
}
}
acpi_ds_init_callbacks (walk_state, pass_number);
return_ACPI_STATUS (AE_OK);
}
#endif
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ds_delete_walk_state * FUNCTION: Acpi_ds_delete_walk_state
...@@ -893,6 +985,10 @@ acpi_ds_delete_walk_state ( ...@@ -893,6 +985,10 @@ acpi_ds_delete_walk_state (
} }
if (walk_state->parser_state.scope) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p walk still has a scope list\n", walk_state));
}
/* Always must free any linked control states */ /* Always must free any linked control states */
while (walk_state->control_state) { while (walk_state->control_state) {
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "acpi.h" #include "acpi.h"
#include "driver.h"
#define _COMPONENT OS_DEPENDENT #define _COMPONENT OS_DEPENDENT
...@@ -50,6 +49,70 @@ FADT_DESCRIPTOR acpi_fadt; ...@@ -50,6 +49,70 @@ FADT_DESCRIPTOR acpi_fadt;
static int acpi_disabled = 0; static int acpi_disabled = 0;
enum acpi_blacklist_predicates
{
all_versions,
less_than_or_equal,
equal,
greater_than_or_equal,
};
struct acpi_blacklist_item
{
char oem_id[7];
char oem_table_id[9];
u32 oem_revision;
enum acpi_blacklist_predicates oem_revision_predicate;
};
/*
* Currently, this blacklists based on items in the FADT. We may want to
* expand this to using other ACPI tables in the future, too.
*/
static struct acpi_blacklist_item acpi_blacklist[] __initdata =
{
{"TOSHIB", "750 ", 0x970814, less_than_or_equal}, /* Portege 7020, BIOS 8.10 */
{""}
};
int
acpi_blacklisted(FADT_DESCRIPTOR *fadt)
{
int i = 0;
while (acpi_blacklist[i].oem_id[0] != '\0')
{
if (strncmp(acpi_blacklist[i].oem_id, fadt->header.oem_id, 6)) {
i++;
continue;
}
if (strncmp(acpi_blacklist[i].oem_table_id, fadt->header.oem_table_id, 8)) {
i++;
continue;
}
if (acpi_blacklist[i].oem_revision_predicate == all_versions)
return TRUE;
if (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal
&& fadt->header.oem_revision <= acpi_blacklist[i].oem_revision)
return TRUE;
if (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal
&& fadt->header.oem_revision >= acpi_blacklist[i].oem_revision)
return TRUE;
if (acpi_blacklist[i].oem_revision_predicate == equal
&& fadt->header.oem_revision == acpi_blacklist[i].oem_revision)
return TRUE;
i++;
}
return FALSE;
}
/* /*
* Start the interpreter * Start the interpreter
*/ */
...@@ -64,7 +127,6 @@ acpi_init(void) ...@@ -64,7 +127,6 @@ acpi_init(void)
return -ENODEV; return -ENODEV;
} }
if (acpi_disabled) { if (acpi_disabled) {
printk(KERN_NOTICE "ACPI: disabled by cmdline, exiting\n"); printk(KERN_NOTICE "ACPI: disabled by cmdline, exiting\n");
return -ENODEV; return -ENODEV;
...@@ -93,6 +155,12 @@ acpi_init(void) ...@@ -93,6 +155,12 @@ acpi_init(void)
return -ENODEV; return -ENODEV;
} }
if (acpi_blacklisted(&acpi_fadt)) {
printk(KERN_ERR "ACPI: On blacklist -- BIOS not fully ACPI compliant\n");
acpi_terminate();
return -ENODEV;
}
buffer.length = sizeof(sys_info); buffer.length = sizeof(sys_info);
buffer.pointer = &sys_info; buffer.pointer = &sys_info;
......
/*
* driver.h - ACPI driver
*
* Copyright (C) 2000 Andrew Henroid
*
* 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 __DRIVER_H
#define __DRIVER_H
#include <linux/tqueue.h>
#include <linux/wait.h>
#include <linux/pm.h>
#include <linux/acpi.h>
#include <asm/io.h>
#define ACPI_MAX_THROTTLE 10
#define ACPI_INVALID ~0UL
#define ACPI_INFINITE ~0UL
/*
* cpu.c
*/
int acpi_cpu_init(void);
u32 acpi_read_pm_timer(void);
extern u32 acpi_c2_exit_latency;
extern u32 acpi_c3_exit_latency;
extern u32 acpi_c2_enter_latency;
extern u32 acpi_c3_enter_latency;
extern u32 acpi_use_idle;
extern u32 acpi_c1_count;
extern u32 acpi_c2_count;
extern u32 acpi_c3_count;
/*
* driver.c
*/
int acpi_run(void (*callback)(void*), void *context);
/*
* ec.c
*/
int acpi_ec_init(void);
/*
* power.c
*/
int acpi_power_init(void);
/*
* sys.c
*/
int acpi_sys_init(void);
int acpi_enter_sx(acpi_sstate_t state);
extern volatile acpi_sstate_t acpi_sleep_state;
#endif /* __DRIVER_H */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: evevent - Fixed and General Purpose Acpi_event * Module Name: evevent - Fixed and General Purpose Acpi_event
* handling and dispatch * handling and dispatch
* $Revision: 50 $ * $Revision: 51 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -354,7 +354,7 @@ acpi_ev_gpe_initialize (void) ...@@ -354,7 +354,7 @@ acpi_ev_gpe_initialize (void)
* Allocate the Gpe information block * Allocate the Gpe information block
*/ */
acpi_gbl_gpe_registers = ACPI_MEM_CALLOCATE (acpi_gbl_gpe_register_count * acpi_gbl_gpe_registers = ACPI_MEM_CALLOCATE (acpi_gbl_gpe_register_count *
sizeof (ACPI_GPE_REGISTERS)); sizeof (acpi_gpe_registers));
if (!acpi_gbl_gpe_registers) { if (!acpi_gbl_gpe_registers) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not allocate the Gpe_registers block\n")); "Could not allocate the Gpe_registers block\n"));
...@@ -442,9 +442,9 @@ acpi_ev_gpe_initialize (void) ...@@ -442,9 +442,9 @@ acpi_ev_gpe_initialize (void)
register_index++; register_index++;
} }
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%p (Blk0) %X@%p (Blk1)\n", ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%8.8X%8.8X (Blk0) %X@%8.8X%8.8X (Blk1)\n",
gpe0register_count, acpi_gbl_FADT->Xgpe0blk.address, gpe1_register_count, gpe0register_count, HIDWORD(acpi_gbl_FADT->Xgpe0blk.address), LODWORD(acpi_gbl_FADT->Xgpe0blk.address),
acpi_gbl_FADT->Xgpe1_blk.address)); gpe1_register_count, HIDWORD(acpi_gbl_FADT->Xgpe1_blk.address), LODWORD(acpi_gbl_FADT->Xgpe1_blk.address)));
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: evmisc - ACPI device notification handler dispatch * Module Name: evmisc - ACPI device notification handler dispatch
* and ACPI Global Lock support * and ACPI Global Lock support
* $Revision: 33 $ * $Revision: 35 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -88,7 +88,7 @@ acpi_ev_queue_notify_request ( ...@@ -88,7 +88,7 @@ acpi_ev_queue_notify_request (
break; break;
default: default:
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %lx \n", notify_value)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %X \n", notify_value));
break; break;
} }
...@@ -134,6 +134,7 @@ acpi_ev_queue_notify_request ( ...@@ -134,6 +134,7 @@ acpi_ev_queue_notify_request (
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
notify_info->common.data_type = ACPI_DESC_TYPE_STATE_NOTIFY;
notify_info->notify.node = node; notify_info->notify.node = node;
notify_info->notify.value = (u16) notify_value; notify_info->notify.value = (u16) notify_value;
notify_info->notify.handler_obj = handler_obj; notify_info->notify.handler_obj = handler_obj;
...@@ -173,7 +174,7 @@ acpi_ev_notify_dispatch ( ...@@ -173,7 +174,7 @@ acpi_ev_notify_dispatch (
void *context) void *context)
{ {
acpi_generic_state *notify_info = (acpi_generic_state *) context; acpi_generic_state *notify_info = (acpi_generic_state *) context;
ACPI_NOTIFY_HANDLER global_handler = NULL; acpi_notify_handler global_handler = NULL;
void *global_context = NULL; void *global_context = NULL;
acpi_operand_object *handler_obj; acpi_operand_object *handler_obj;
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evregion - ACPI Address_space (Op_region) handler dispatch * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
* $Revision: 110 $ * $Revision: 113 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -147,17 +147,16 @@ acpi_ev_execute_reg_method ( ...@@ -147,17 +147,16 @@ acpi_ev_execute_reg_method (
params[1] = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); params[1] = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
if (!params[1]) { if (!params[1]) {
acpi_ut_remove_reference (params[0]); status = AE_NO_MEMORY;
return_ACPI_STATUS (AE_NO_MEMORY); goto cleanup;
} }
params[2] = NULL;
/* /*
* Set up the parameter objects * Set up the parameter objects
*/ */
params[0]->integer.value = region_obj->region.space_id; params[0]->integer.value = region_obj->region.space_id;
params[1]->integer.value = function; params[1]->integer.value = function;
params[2] = NULL;
/* /*
* Execute the method, no return value * Execute the method, no return value
...@@ -165,9 +164,10 @@ acpi_ev_execute_reg_method ( ...@@ -165,9 +164,10 @@ acpi_ev_execute_reg_method (
DEBUG_EXEC(acpi_ut_display_init_pathname (region_obj->region.extra->extra.method_REG, " [Method]")); DEBUG_EXEC(acpi_ut_display_init_pathname (region_obj->region.extra->extra.method_REG, " [Method]"));
status = acpi_ns_evaluate_by_handle (region_obj->region.extra->extra.method_REG, params, NULL); status = acpi_ns_evaluate_by_handle (region_obj->region.extra->extra.method_REG, params, NULL);
acpi_ut_remove_reference (params[1]);
cleanup:
acpi_ut_remove_reference (params[0]); acpi_ut_remove_reference (params[0]);
acpi_ut_remove_reference (params[1]);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -200,8 +200,8 @@ acpi_ev_address_space_dispatch ( ...@@ -200,8 +200,8 @@ acpi_ev_address_space_dispatch (
u32 *value) u32 *value)
{ {
acpi_status status; acpi_status status;
ACPI_ADR_SPACE_HANDLER handler; acpi_adr_space_handler handler;
ACPI_ADR_SPACE_SETUP region_setup; acpi_adr_space_setup region_setup;
acpi_operand_object *handler_desc; acpi_operand_object *handler_desc;
void *region_context = NULL; void *region_context = NULL;
...@@ -276,7 +276,7 @@ acpi_ev_address_space_dispatch ( ...@@ -276,7 +276,7 @@ acpi_ev_address_space_dispatch (
handler = handler_desc->addr_handler.handler; handler = handler_desc->addr_handler.handler;
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Addrhandler %p (%p), Address %8.8lX%8.8lX\n", "Addrhandler %p (%p), Address %8.8X%8.8X\n",
&region_obj->region.addr_handler->addr_handler, handler, HIDWORD(address), &region_obj->region.addr_handler->addr_handler, handler, HIDWORD(address),
LODWORD(address))); LODWORD(address)));
...@@ -335,7 +335,7 @@ acpi_ev_disassociate_region_from_handler( ...@@ -335,7 +335,7 @@ acpi_ev_disassociate_region_from_handler(
acpi_operand_object *handler_obj; acpi_operand_object *handler_obj;
acpi_operand_object *obj_desc; acpi_operand_object *obj_desc;
acpi_operand_object **last_obj_ptr; acpi_operand_object **last_obj_ptr;
ACPI_ADR_SPACE_SETUP region_setup; acpi_adr_space_setup region_setup;
void *region_context; void *region_context;
acpi_status status; acpi_status status;
...@@ -548,7 +548,7 @@ acpi_ev_addr_handler_helper ( ...@@ -548,7 +548,7 @@ acpi_ev_addr_handler_helper (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
node = acpi_ns_convert_handle_to_entry (obj_handle); node = acpi_ns_map_handle_to_node (obj_handle);
if (!node) { if (!node) {
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evrgnini- ACPI Address_space (Op_region) init * Module Name: evrgnini- ACPI Address_space (Op_region) init
* $Revision: 46 $ * $Revision: 48 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -145,7 +145,7 @@ acpi_ev_pci_config_region_setup ( ...@@ -145,7 +145,7 @@ acpi_ev_pci_config_region_setup (
acpi_operand_object *handler_obj; acpi_operand_object *handler_obj;
acpi_namespace_node *node; acpi_namespace_node *node;
acpi_operand_object *region_obj = (acpi_operand_object *) handle; acpi_operand_object *region_obj = (acpi_operand_object *) handle;
ACPI_DEVICE_ID object_hID; acpi_device_id object_hID;
FUNCTION_TRACE ("Ev_pci_config_region_setup"); FUNCTION_TRACE ("Ev_pci_config_region_setup");
...@@ -158,7 +158,7 @@ acpi_ev_pci_config_region_setup ( ...@@ -158,7 +158,7 @@ acpi_ev_pci_config_region_setup (
* routine checks before we get here, but we check again just in case. * routine checks before we get here, but we check again just in case.
*/ */
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Attempting to init a region %X, with no handler\n", region_obj)); "Attempting to init a region %p, with no handler\n", region_obj));
return_ACPI_STATUS (AE_NOT_EXIST); return_ACPI_STATUS (AE_NOT_EXIST);
} }
...@@ -261,6 +261,70 @@ acpi_ev_pci_config_region_setup ( ...@@ -261,6 +261,70 @@ acpi_ev_pci_config_region_setup (
} }
/*******************************************************************************
*
* FUNCTION: Acpi_ev_pci_bar_region_setup
*
* PARAMETERS: Region_obj - region we are interested in
* Function - start or stop
* Handler_context - Address space handler context
* Region_context - Region specific context
*
* RETURN: Status
*
* DESCRIPTION: Do any prep work for region handling
*
* MUTEX: Assumes namespace is not locked
*
******************************************************************************/
acpi_status
acpi_ev_pci_bar_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context)
{
FUNCTION_TRACE ("Ev_pci_bar_region_setup");
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ev_cmos_region_setup
*
* PARAMETERS: Region_obj - region we are interested in
* Function - start or stop
* Handler_context - Address space handler context
* Region_context - Region specific context
*
* RETURN: Status
*
* DESCRIPTION: Do any prep work for region handling
*
* MUTEX: Assumes namespace is not locked
*
******************************************************************************/
acpi_status
acpi_ev_cmos_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context)
{
FUNCTION_TRACE ("Ev_cmos_region_setup");
return_ACPI_STATUS (AE_OK);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: Acpi_ev_default_region_setup * FUNCTION: Acpi_ev_default_region_setup
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evxface - External interfaces for ACPI events * Module Name: evxface - External interfaces for ACPI events
* $Revision: 112 $ * $Revision: 116 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
acpi_status acpi_status
acpi_install_fixed_event_handler ( acpi_install_fixed_event_handler (
u32 event, u32 event,
ACPI_EVENT_HANDLER handler, acpi_event_handler handler,
void *context) void *context)
{ {
acpi_status status; acpi_status status;
...@@ -63,13 +63,6 @@ acpi_install_fixed_event_handler ( ...@@ -63,13 +63,6 @@ acpi_install_fixed_event_handler (
FUNCTION_TRACE ("Acpi_install_fixed_event_handler"); FUNCTION_TRACE ("Acpi_install_fixed_event_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if (event > ACPI_EVENT_MAX) { if (event > ACPI_EVENT_MAX) {
...@@ -86,12 +79,12 @@ acpi_install_fixed_event_handler ( ...@@ -86,12 +79,12 @@ acpi_install_fixed_event_handler (
} }
/* Install the handler before enabling the event - just in case... */ /* Install the handler before enabling the event */
acpi_gbl_fixed_event_handlers[event].handler = handler; acpi_gbl_fixed_event_handlers[event].handler = handler;
acpi_gbl_fixed_event_handlers[event].context = context; acpi_gbl_fixed_event_handlers[event].context = context;
status = acpi_enable_event (event, ACPI_EVENT_FIXED); status = acpi_enable_event (event, ACPI_EVENT_FIXED, 0);
if (!ACPI_SUCCESS (status)) { if (!ACPI_SUCCESS (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not enable fixed event.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not enable fixed event.\n"));
...@@ -129,7 +122,7 @@ acpi_install_fixed_event_handler ( ...@@ -129,7 +122,7 @@ acpi_install_fixed_event_handler (
acpi_status acpi_status
acpi_remove_fixed_event_handler ( acpi_remove_fixed_event_handler (
u32 event, u32 event,
ACPI_EVENT_HANDLER handler) acpi_event_handler handler)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
...@@ -137,13 +130,6 @@ acpi_remove_fixed_event_handler ( ...@@ -137,13 +130,6 @@ acpi_remove_fixed_event_handler (
FUNCTION_TRACE ("Acpi_remove_fixed_event_handler"); FUNCTION_TRACE ("Acpi_remove_fixed_event_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if (event > ACPI_EVENT_MAX) { if (event > ACPI_EVENT_MAX) {
...@@ -152,21 +138,19 @@ acpi_remove_fixed_event_handler ( ...@@ -152,21 +138,19 @@ acpi_remove_fixed_event_handler (
acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
/* Disable the event before removing the handler - just in case... */ /* Disable the event before removing the handler */
status = acpi_disable_event(event, ACPI_EVENT_FIXED); status = acpi_disable_event(event, ACPI_EVENT_FIXED, 0);
/* Always Remove the handler */ /* Always Remove the handler */
acpi_gbl_fixed_event_handlers[event].handler = NULL; acpi_gbl_fixed_event_handlers[event].handler = NULL;
acpi_gbl_fixed_event_handlers[event].context = NULL; acpi_gbl_fixed_event_handlers[event].context = NULL;
if (!ACPI_SUCCESS (status)) {
if (!ACPI_SUCCESS(status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, ACPI_DEBUG_PRINT ((ACPI_DB_WARN,
"Could not write to fixed event enable register.\n")); "Could not write to fixed event enable register.\n"));
} }
else { else {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X.\n", event)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X.\n", event));
} }
...@@ -197,7 +181,7 @@ acpi_status ...@@ -197,7 +181,7 @@ acpi_status
acpi_install_notify_handler ( acpi_install_notify_handler (
acpi_handle device, acpi_handle device,
u32 handler_type, u32 handler_type,
ACPI_NOTIFY_HANDLER handler, acpi_notify_handler handler,
void *context) void *context)
{ {
acpi_operand_object *obj_desc; acpi_operand_object *obj_desc;
...@@ -209,13 +193,6 @@ acpi_install_notify_handler ( ...@@ -209,13 +193,6 @@ acpi_install_notify_handler (
FUNCTION_TRACE ("Acpi_install_notify_handler"); FUNCTION_TRACE ("Acpi_install_notify_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if ((!handler) || if ((!handler) ||
...@@ -227,7 +204,7 @@ acpi_install_notify_handler ( ...@@ -227,7 +204,7 @@ acpi_install_notify_handler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
device_node = acpi_ns_convert_handle_to_entry (device); device_node = acpi_ns_map_handle_to_node (device);
if (!device_node) { if (!device_node) {
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -235,7 +212,6 @@ acpi_install_notify_handler ( ...@@ -235,7 +212,6 @@ acpi_install_notify_handler (
/* /*
* Root Object: * Root Object:
* ------------
* Registering a notify handler on the root object indicates that the * Registering a notify handler on the root object indicates that the
* caller wishes to receive notifications for all objects. Note that * caller wishes to receive notifications for all objects. Note that
* only one <external> global handler can be regsitered (per notify type). * only one <external> global handler can be regsitered (per notify type).
...@@ -266,8 +242,7 @@ acpi_install_notify_handler ( ...@@ -266,8 +242,7 @@ acpi_install_notify_handler (
} }
/* /*
* Other Objects: * All Other Objects:
* --------------
* Caller will only receive notifications specific to the target object. * Caller will only receive notifications specific to the target object.
* Note that only certain object types can receive notifications. * Note that only certain object types can receive notifications.
*/ */
...@@ -338,6 +313,7 @@ acpi_install_notify_handler ( ...@@ -338,6 +313,7 @@ acpi_install_notify_handler (
} }
} }
unlock_and_exit: unlock_and_exit:
acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -363,7 +339,7 @@ acpi_status ...@@ -363,7 +339,7 @@ acpi_status
acpi_remove_notify_handler ( acpi_remove_notify_handler (
acpi_handle device, acpi_handle device,
u32 handler_type, u32 handler_type,
ACPI_NOTIFY_HANDLER handler) acpi_notify_handler handler)
{ {
acpi_operand_object *notify_obj; acpi_operand_object *notify_obj;
acpi_operand_object *obj_desc; acpi_operand_object *obj_desc;
...@@ -374,13 +350,6 @@ acpi_remove_notify_handler ( ...@@ -374,13 +350,6 @@ acpi_remove_notify_handler (
FUNCTION_TRACE ("Acpi_remove_notify_handler"); FUNCTION_TRACE ("Acpi_remove_notify_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if ((!handler) || if ((!handler) ||
...@@ -392,18 +361,16 @@ acpi_remove_notify_handler ( ...@@ -392,18 +361,16 @@ acpi_remove_notify_handler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
device_node = acpi_ns_convert_handle_to_entry (device); device_node = acpi_ns_map_handle_to_node (device);
if (!device_node) { if (!device_node) {
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
goto unlock_and_exit; goto unlock_and_exit;
} }
/* /*
* Root Object: * Root Object
* ------------
*/ */
if (device == ACPI_ROOT_OBJECT) { if (device == ACPI_ROOT_OBJECT) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n"));
if (((handler_type == ACPI_SYSTEM_NOTIFY) && if (((handler_type == ACPI_SYSTEM_NOTIFY) &&
...@@ -427,8 +394,7 @@ acpi_remove_notify_handler ( ...@@ -427,8 +394,7 @@ acpi_remove_notify_handler (
} }
/* /*
* Other Objects: * All Other Objects
* --------------
*/ */
else { else {
/* /*
...@@ -505,7 +471,7 @@ acpi_status ...@@ -505,7 +471,7 @@ acpi_status
acpi_install_gpe_handler ( acpi_install_gpe_handler (
u32 gpe_number, u32 gpe_number,
u32 type, u32 type,
ACPI_GPE_HANDLER handler, acpi_gpe_handler handler,
void *context) void *context)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
...@@ -514,13 +480,6 @@ acpi_install_gpe_handler ( ...@@ -514,13 +480,6 @@ acpi_install_gpe_handler (
FUNCTION_TRACE ("Acpi_install_gpe_handler"); FUNCTION_TRACE ("Acpi_install_gpe_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if (!handler || (gpe_number > ACPI_GPE_MAX)) { if (!handler || (gpe_number > ACPI_GPE_MAX)) {
...@@ -553,6 +512,7 @@ acpi_install_gpe_handler ( ...@@ -553,6 +512,7 @@ acpi_install_gpe_handler (
acpi_hw_clear_gpe (gpe_number); acpi_hw_clear_gpe (gpe_number);
acpi_hw_enable_gpe (gpe_number); acpi_hw_enable_gpe (gpe_number);
cleanup: cleanup:
acpi_ut_release_mutex (ACPI_MTX_EVENTS); acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -575,7 +535,7 @@ acpi_install_gpe_handler ( ...@@ -575,7 +535,7 @@ acpi_install_gpe_handler (
acpi_status acpi_status
acpi_remove_gpe_handler ( acpi_remove_gpe_handler (
u32 gpe_number, u32 gpe_number,
ACPI_GPE_HANDLER handler) acpi_gpe_handler handler)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
...@@ -583,13 +543,6 @@ acpi_remove_gpe_handler ( ...@@ -583,13 +543,6 @@ acpi_remove_gpe_handler (
FUNCTION_TRACE ("Acpi_remove_gpe_handler"); FUNCTION_TRACE ("Acpi_remove_gpe_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if (!handler || (gpe_number > ACPI_GPE_MAX)) { if (!handler || (gpe_number > ACPI_GPE_MAX)) {
...@@ -621,6 +574,7 @@ acpi_remove_gpe_handler ( ...@@ -621,6 +574,7 @@ acpi_remove_gpe_handler (
acpi_gbl_gpe_info[gpe_number].handler = NULL; acpi_gbl_gpe_info[gpe_number].handler = NULL;
acpi_gbl_gpe_info[gpe_number].context = NULL; acpi_gbl_gpe_info[gpe_number].context = NULL;
cleanup: cleanup:
acpi_ut_release_mutex (ACPI_MTX_EVENTS); acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -639,6 +593,7 @@ acpi_remove_gpe_handler ( ...@@ -639,6 +593,7 @@ acpi_remove_gpe_handler (
* DESCRIPTION: Acquire the ACPI Global Lock * DESCRIPTION: Acquire the ACPI Global Lock
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_acquire_global_lock ( acpi_acquire_global_lock (
void) void)
...@@ -646,13 +601,6 @@ acpi_acquire_global_lock ( ...@@ -646,13 +601,6 @@ acpi_acquire_global_lock (
acpi_status status; acpi_status status;
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return (status);
}
status = acpi_ex_enter_interpreter (); status = acpi_ex_enter_interpreter ();
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return (status); return (status);
...@@ -685,15 +633,6 @@ acpi_status ...@@ -685,15 +633,6 @@ acpi_status
acpi_release_global_lock ( acpi_release_global_lock (
void) void)
{ {
acpi_status status;
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return (status);
}
acpi_ev_release_global_lock (); acpi_ev_release_global_lock ();
return (AE_OK); return (AE_OK);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
* $Revision: 36 $ * $Revision: 38 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -106,13 +106,6 @@ acpi_disable (void) ...@@ -106,13 +106,6 @@ acpi_disable (void)
FUNCTION_TRACE ("Acpi_disable"); FUNCTION_TRACE ("Acpi_disable");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Restore original mode */ /* Restore original mode */
status = acpi_hw_set_mode (acpi_gbl_original_mode); status = acpi_hw_set_mode (acpi_gbl_original_mode);
...@@ -136,6 +129,7 @@ acpi_disable (void) ...@@ -136,6 +129,7 @@ acpi_disable (void)
* *
* PARAMETERS: Event - The fixed event or GPE to be enabled * PARAMETERS: Event - The fixed event or GPE to be enabled
* Type - The type of event * Type - The type of event
* Flags - Just enable, or also wake enable?
* *
* RETURN: Status * RETURN: Status
* *
...@@ -146,7 +140,8 @@ acpi_disable (void) ...@@ -146,7 +140,8 @@ acpi_disable (void)
acpi_status acpi_status
acpi_enable_event ( acpi_enable_event (
u32 event, u32 event,
u32 type) u32 type,
u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
u32 register_id; u32 register_id;
...@@ -155,13 +150,6 @@ acpi_enable_event ( ...@@ -155,13 +150,6 @@ acpi_enable_event (
FUNCTION_TRACE ("Acpi_enable_event"); FUNCTION_TRACE ("Acpi_enable_event");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* The Type must be either Fixed Acpi_event or GPE */ /* The Type must be either Fixed Acpi_event or GPE */
switch (type) { switch (type) {
...@@ -223,7 +211,13 @@ acpi_enable_event ( ...@@ -223,7 +211,13 @@ acpi_enable_event (
/* Enable the requested GPE number */ /* Enable the requested GPE number */
if (flags & ACPI_EVENT_ENABLE) {
acpi_hw_enable_gpe (event); acpi_hw_enable_gpe (event);
}
if (flags & ACPI_EVENT_WAKE_ENABLE) {
acpi_hw_enable_gpe_for_wakeup (event);
}
break; break;
...@@ -242,7 +236,8 @@ acpi_enable_event ( ...@@ -242,7 +236,8 @@ acpi_enable_event (
* FUNCTION: Acpi_disable_event * FUNCTION: Acpi_disable_event
* *
* PARAMETERS: Event - The fixed event or GPE to be enabled * PARAMETERS: Event - The fixed event or GPE to be enabled
* Type - The type of event * Type - The type of event, fixed or general purpose
* Flags - Wake disable vs. non-wake disable
* *
* RETURN: Status * RETURN: Status
* *
...@@ -253,7 +248,8 @@ acpi_enable_event ( ...@@ -253,7 +248,8 @@ acpi_enable_event (
acpi_status acpi_status
acpi_disable_event ( acpi_disable_event (
u32 event, u32 event,
u32 type) u32 type,
u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
u32 register_id; u32 register_id;
...@@ -262,13 +258,6 @@ acpi_disable_event ( ...@@ -262,13 +258,6 @@ acpi_disable_event (
FUNCTION_TRACE ("Acpi_disable_event"); FUNCTION_TRACE ("Acpi_disable_event");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* The Type must be either Fixed Acpi_event or GPE */ /* The Type must be either Fixed Acpi_event or GPE */
switch (type) { switch (type) {
...@@ -329,7 +318,13 @@ acpi_disable_event ( ...@@ -329,7 +318,13 @@ acpi_disable_event (
/* Disable the requested GPE number */ /* Disable the requested GPE number */
if (flags & ACPI_EVENT_DISABLE) {
acpi_hw_disable_gpe (event); acpi_hw_disable_gpe (event);
}
if (flags & ACPI_EVENT_WAKE_DISABLE) {
acpi_hw_disable_gpe_for_wakeup (event);
}
break; break;
...@@ -366,13 +361,6 @@ acpi_clear_event ( ...@@ -366,13 +361,6 @@ acpi_clear_event (
FUNCTION_TRACE ("Acpi_clear_event"); FUNCTION_TRACE ("Acpi_clear_event");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* The Type must be either Fixed Acpi_event or GPE */ /* The Type must be either Fixed Acpi_event or GPE */
switch (type) { switch (type) {
...@@ -467,13 +455,6 @@ acpi_get_event_status ( ...@@ -467,13 +455,6 @@ acpi_get_event_status (
FUNCTION_TRACE ("Acpi_get_event_status"); FUNCTION_TRACE ("Acpi_get_event_status");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
if (!event_status) { if (!event_status) {
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces. * Address Spaces.
* $Revision: 36 $ * $Revision: 40 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -56,8 +56,8 @@ acpi_status ...@@ -56,8 +56,8 @@ acpi_status
acpi_install_address_space_handler ( acpi_install_address_space_handler (
acpi_handle device, acpi_handle device,
ACPI_ADR_SPACE_TYPE space_id, ACPI_ADR_SPACE_TYPE space_id,
ACPI_ADR_SPACE_HANDLER handler, acpi_adr_space_handler handler,
ACPI_ADR_SPACE_SETUP setup, acpi_adr_space_setup setup,
void *context) void *context)
{ {
acpi_operand_object *obj_desc; acpi_operand_object *obj_desc;
...@@ -71,13 +71,6 @@ acpi_install_address_space_handler ( ...@@ -71,13 +71,6 @@ acpi_install_address_space_handler (
FUNCTION_TRACE ("Acpi_install_address_space_handler"); FUNCTION_TRACE ("Acpi_install_address_space_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if ((!device) || if ((!device) ||
...@@ -90,7 +83,7 @@ acpi_install_address_space_handler ( ...@@ -90,7 +83,7 @@ acpi_install_address_space_handler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
node = acpi_ns_convert_handle_to_entry (device); node = acpi_ns_map_handle_to_node (device);
if (!node) { if (!node) {
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -128,6 +121,16 @@ acpi_install_address_space_handler ( ...@@ -128,6 +121,16 @@ acpi_install_address_space_handler (
setup = acpi_ev_pci_config_region_setup; setup = acpi_ev_pci_config_region_setup;
break; break;
case ACPI_ADR_SPACE_CMOS:
handler = acpi_ex_cmos_space_handler;
setup = acpi_ev_cmos_region_setup;
break;
case ACPI_ADR_SPACE_PCI_BAR_TARGET:
handler = acpi_ex_pci_bar_space_handler;
setup = acpi_ev_pci_bar_region_setup;
break;
default: default:
status = AE_NOT_EXIST; status = AE_NOT_EXIST;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -181,7 +184,6 @@ acpi_install_address_space_handler ( ...@@ -181,7 +184,6 @@ acpi_install_address_space_handler (
if (node->type == ACPI_TYPE_ANY) { if (node->type == ACPI_TYPE_ANY) {
type = ACPI_TYPE_DEVICE; type = ACPI_TYPE_DEVICE;
} }
else { else {
type = node->type; type = node->type;
} }
...@@ -280,7 +282,7 @@ acpi_status ...@@ -280,7 +282,7 @@ acpi_status
acpi_remove_address_space_handler ( acpi_remove_address_space_handler (
acpi_handle device, acpi_handle device,
ACPI_ADR_SPACE_TYPE space_id, ACPI_ADR_SPACE_TYPE space_id,
ACPI_ADR_SPACE_HANDLER handler) acpi_adr_space_handler handler)
{ {
acpi_operand_object *obj_desc; acpi_operand_object *obj_desc;
acpi_operand_object *handler_obj; acpi_operand_object *handler_obj;
...@@ -293,13 +295,6 @@ acpi_remove_address_space_handler ( ...@@ -293,13 +295,6 @@ acpi_remove_address_space_handler (
FUNCTION_TRACE ("Acpi_remove_address_space_handler"); FUNCTION_TRACE ("Acpi_remove_address_space_handler");
/* Ensure that ACPI has been initialized */
ACPI_IS_INITIALIZATION_COMPLETE (status);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Parameter validation */ /* Parameter validation */
if ((!device) || if ((!device) ||
...@@ -312,7 +307,7 @@ acpi_remove_address_space_handler ( ...@@ -312,7 +307,7 @@ acpi_remove_address_space_handler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
node = acpi_ns_convert_handle_to_entry (device); node = acpi_ns_map_handle_to_node (device);
if (!node) { if (!node) {
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -323,9 +318,6 @@ acpi_remove_address_space_handler ( ...@@ -323,9 +318,6 @@ acpi_remove_address_space_handler (
obj_desc = acpi_ns_get_attached_object (node); obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) { if (!obj_desc) {
/*
* The object DNE.
*/
status = AE_NOT_EXIST; status = AE_NOT_EXIST;
goto unlock_and_exit; goto unlock_and_exit;
} }
...@@ -339,7 +331,7 @@ acpi_remove_address_space_handler ( ...@@ -339,7 +331,7 @@ acpi_remove_address_space_handler (
/* /*
* We have a handler, see if user requested this one * We have a handler, see if user requested this one
*/ */
if(handler_obj->addr_handler.space_id == space_id) { if (handler_obj->addr_handler.space_id == space_id) {
/* /*
* Got it, first dereference this in the Regions * Got it, first dereference this in the Regions
*/ */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
* $Revision: 41 $ * $Revision: 44 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
* *
****************************************************************************/ ****************************************************************************/
static acpi_status acpi_status
acpi_ex_load_table_op ( acpi_ex_load_op (
acpi_operand_object *rgn_desc, acpi_operand_object *rgn_desc,
acpi_operand_object **ddb_handle) acpi_operand_object *ddb_handle)
{ {
acpi_status status; acpi_status status;
acpi_operand_object *table_desc = NULL; acpi_operand_object *table_desc = NULL;
...@@ -65,7 +65,7 @@ acpi_ex_load_table_op ( ...@@ -65,7 +65,7 @@ acpi_ex_load_table_op (
u32 i; u32 i;
FUNCTION_TRACE ("Ex_load_table"); FUNCTION_TRACE ("Ex_load_op");
/* TBD: [Unhandled] Object can be either a field or an opregion */ /* TBD: [Unhandled] Object can be either a field or an opregion */
...@@ -117,7 +117,7 @@ acpi_ex_load_table_op ( ...@@ -117,7 +117,7 @@ acpi_ex_load_table_op (
acpi_gbl_acpi_table_data[ACPI_TABLE_SSDT].sig_length))) { acpi_gbl_acpi_table_data[ACPI_TABLE_SSDT].sig_length))) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Table has invalid signature [%4.4s], must be SSDT or PSDT\n", "Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
table_header.signature)); (char*)table_header.signature));
status = AE_BAD_SIGNATURE; status = AE_BAD_SIGNATURE;
goto cleanup; goto cleanup;
} }
...@@ -165,7 +165,8 @@ acpi_ex_load_table_op ( ...@@ -165,7 +165,8 @@ acpi_ex_load_table_op (
table_desc->reference.opcode = AML_LOAD_OP; table_desc->reference.opcode = AML_LOAD_OP;
table_desc->reference.object = table_info.installed_desc; table_desc->reference.object = table_info.installed_desc;
*ddb_handle = table_desc; /* TBD: store the tabledesc into the Ddb_handle target */
/* Ddb_handle = Table_desc; */
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -175,7 +176,6 @@ acpi_ex_load_table_op ( ...@@ -175,7 +176,6 @@ acpi_ex_load_table_op (
ACPI_MEM_FREE (table_desc); ACPI_MEM_FREE (table_desc);
ACPI_MEM_FREE (table_ptr); ACPI_MEM_FREE (table_ptr);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -191,7 +191,7 @@ acpi_ex_load_table_op ( ...@@ -191,7 +191,7 @@ acpi_ex_load_table_op (
* *
****************************************************************************/ ****************************************************************************/
static acpi_status acpi_status
acpi_ex_unload_table ( acpi_ex_unload_table (
acpi_operand_object *ddb_handle) acpi_operand_object *ddb_handle)
{ {
...@@ -240,57 +240,3 @@ acpi_ex_unload_table ( ...@@ -240,57 +240,3 @@ acpi_ex_unload_table (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/*****************************************************************************
*
* FUNCTION: Acpi_ex_reconfiguration
*
* PARAMETERS: Opcode - The opcode to be executed
* Walk_state - Current state of the parse tree walk
*
* RETURN: Status
*
* DESCRIPTION: Reconfiguration opcodes such as LOAD and UNLOAD
*
****************************************************************************/
acpi_status
acpi_ex_reconfiguration (
u16 opcode,
acpi_walk_state *walk_state)
{
acpi_operand_object **operand = &walk_state->operands[0];
acpi_status status;
FUNCTION_TRACE ("Ex_reconfiguration");
#define ddb_handle operand[0]
#define region_desc operand[1]
switch (opcode) {
case AML_LOAD_OP:
status = acpi_ex_load_table_op (region_desc, &ddb_handle);
break;
case AML_UNLOAD_OP:
status = acpi_ex_unload_table (ddb_handle);
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad opcode=%X\n", opcode));
status = AE_AML_BAD_OPCODE;
break;
}
return_ACPI_STATUS (status);
}
/****************************************************************************** /******************************************************************************
* *
* Module Name: exconvrt - Object conversion routines * Module Name: exconvrt - Object conversion routines
* $Revision: 22 $ * $Revision: 24 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -230,7 +230,7 @@ acpi_ex_convert_to_buffer ( ...@@ -230,7 +230,7 @@ acpi_ex_convert_to_buffer (
new_buf = ACPI_MEM_CALLOCATE (integer_size); new_buf = ACPI_MEM_CALLOCATE (integer_size);
if (!new_buf) { if (!new_buf) {
REPORT_ERROR REPORT_ERROR
(("Ex_dyadic2_r/Concat_op: Buffer allocation failure\n")); (("Ex_convert_to_buffer: Buffer allocation failure\n"));
acpi_ut_remove_reference (ret_desc); acpi_ut_remove_reference (ret_desc);
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
...@@ -296,8 +296,9 @@ acpi_ex_convert_to_ascii ( ...@@ -296,8 +296,9 @@ acpi_ex_convert_to_ascii (
u32 k = 0; u32 k = 0;
u8 hex_digit; u8 hex_digit;
acpi_integer digit; acpi_integer digit;
u8 leading_zero = TRUE; u32 remainder;
u32 length = sizeof (acpi_integer); u32 length = sizeof (acpi_integer);
u8 leading_zero = TRUE;
FUNCTION_ENTRY (); FUNCTION_ENTRY ();
...@@ -306,12 +307,13 @@ acpi_ex_convert_to_ascii ( ...@@ -306,12 +307,13 @@ acpi_ex_convert_to_ascii (
switch (base) { switch (base) {
case 10: case 10:
remainder = 0;
for (i = ACPI_MAX_DECIMAL_DIGITS; i > 0 ; i--) { for (i = ACPI_MAX_DECIMAL_DIGITS; i > 0 ; i--) {
/* Divide by nth factor of 10 */ /* Divide by nth factor of 10 */
digit = integer; digit = integer;
for (j = 1; j < i; j++) { for (j = 1; j < i; j++) {
digit = ACPI_DIVIDE (digit, 10); acpi_ut_short_divide (&digit, 10, &digit, &remainder);
} }
/* Create the decimal digit */ /* Create the decimal digit */
...@@ -321,7 +323,7 @@ acpi_ex_convert_to_ascii ( ...@@ -321,7 +323,7 @@ acpi_ex_convert_to_ascii (
} }
if (!leading_zero) { if (!leading_zero) {
string[k] = (u8) (ASCII_ZERO + ACPI_MODULO (digit, 10)); string[k] = (u8) (ASCII_ZERO + remainder);
k++; k++;
} }
} }
......
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: exdump - Interpreter debug output routines * Module Name: exdump - Interpreter debug output routines
* $Revision: 123 $ * $Revision: 126 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -46,12 +46,12 @@ ...@@ -46,12 +46,12 @@
* FUNCTION: Acpi_ex_show_hex_value * FUNCTION: Acpi_ex_show_hex_value
* *
* PARAMETERS: Byte_count - Number of bytes to print (1, 2, or 4) * PARAMETERS: Byte_count - Number of bytes to print (1, 2, or 4)
* *Aml_ptr - Address in AML stream of bytes to print * *Aml_start - Address in AML stream of bytes to print
* Interpreter_mode - Current running mode (load1/Load2/Exec) * Interpreter_mode - Current running mode (load1/Load2/Exec)
* Lead_space - # of spaces to print ahead of value * Lead_space - # of spaces to print ahead of value
* 0 => none ahead but one behind * 0 => none ahead but one behind
* *
* DESCRIPTION: Print Byte_count byte(s) starting at Aml_ptr as a single * DESCRIPTION: Print Byte_count byte(s) starting at Aml_start as a single
* value, in hex. If Byte_count > 1 or the value printed is > 9, also * value, in hex. If Byte_count > 1 or the value printed is > 9, also
* print in decimal. * print in decimal.
* *
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
void void
acpi_ex_show_hex_value ( acpi_ex_show_hex_value (
u32 byte_count, u32 byte_count,
u8 *aml_ptr, u8 *aml_start,
u32 lead_space) u32 lead_space)
{ {
u32 value; /* Value retrieved from AML stream */ u32 value; /* Value retrieved from AML stream */
...@@ -72,7 +72,7 @@ acpi_ex_show_hex_value ( ...@@ -72,7 +72,7 @@ acpi_ex_show_hex_value (
FUNCTION_TRACE ("Ex_show_hex_value"); FUNCTION_TRACE ("Ex_show_hex_value");
if (!aml_ptr) { if (!aml_start) {
REPORT_ERROR (("Ex_show_hex_value: null pointer\n")); REPORT_ERROR (("Ex_show_hex_value: null pointer\n"));
} }
...@@ -80,9 +80,9 @@ acpi_ex_show_hex_value ( ...@@ -80,9 +80,9 @@ acpi_ex_show_hex_value (
* AML numbers are always stored little-endian, * AML numbers are always stored little-endian,
* even if the processor is big-endian. * even if the processor is big-endian.
*/ */
for (current_aml_ptr = aml_ptr + byte_count, for (current_aml_ptr = aml_start + byte_count,
value = 0; value = 0;
current_aml_ptr > aml_ptr; ) { current_aml_ptr > aml_start; ) {
value = (value << 8) + (u32)* --current_aml_ptr; value = (value << 8) + (u32)* --current_aml_ptr;
} }
...@@ -96,14 +96,12 @@ acpi_ex_show_hex_value ( ...@@ -96,14 +96,12 @@ acpi_ex_show_hex_value (
length += 3 + acpi_ex_digits_needed (value, 10); length += 3 + acpi_ex_digits_needed (value, 10);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, ""));
for (length = lead_space; length; --length ) { for (length = lead_space; length; --length ) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
} }
while (byte_count--) { while (byte_count--) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *aml_ptr++)); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *aml_start++));
if (byte_count) { if (byte_count) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
...@@ -111,7 +109,7 @@ acpi_ex_show_hex_value ( ...@@ -111,7 +109,7 @@ acpi_ex_show_hex_value (
} }
if (show_decimal_value) { if (show_decimal_value) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%ld]", value)); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%d]", value));
} }
if (0 == lead_space) { if (0 == lead_space) {
...@@ -163,12 +161,6 @@ acpi_ex_dump_operand ( ...@@ -163,12 +161,6 @@ acpi_ex_dump_operand (
return (AE_OK); return (AE_OK);
} }
if (acpi_tb_system_table_pointer (entry_desc)) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p is an AML pointer\n",
entry_desc));
return (AE_OK);
}
if (!VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_INTERNAL)) { if (!VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_INTERNAL)) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Is not a local object \n", entry_desc)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Is not a local object \n", entry_desc));
DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object)); DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object));
...@@ -236,8 +228,9 @@ acpi_ex_dump_operand ( ...@@ -236,8 +228,9 @@ acpi_ex_dump_operand (
if (ACPI_TYPE_INTEGER == entry_desc->common.type) { if (ACPI_TYPE_INTEGER == entry_desc->common.type) {
/* Value is a Number */ /* Value is a Number */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]",
entry_desc->integer.value)); HIDWORD(entry_desc->integer.value),
LODWORD(entry_desc->integer.value)));
} }
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
...@@ -253,8 +246,9 @@ acpi_ex_dump_operand ( ...@@ -253,8 +246,9 @@ acpi_ex_dump_operand (
/* Value is a Number */ /* Value is a Number */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]",
entry_desc->integer.value)); HIDWORD(entry_desc->integer.value),
LODWORD(entry_desc->integer.value)));
} }
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
...@@ -262,7 +256,7 @@ acpi_ex_dump_operand ( ...@@ -262,7 +256,7 @@ acpi_ex_dump_operand (
case AML_INT_NAMEPATH_OP: case AML_INT_NAMEPATH_OP:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %x\n", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %X\n",
entry_desc->reference.node->name)); entry_desc->reference.node->name));
break; break;
...@@ -297,8 +291,7 @@ acpi_ex_dump_operand ( ...@@ -297,8 +291,7 @@ acpi_ex_dump_operand (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: ")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: "));
for (buf = entry_desc->buffer.pointer; length--; ++buf) { for (buf = entry_desc->buffer.pointer; length--; ++buf) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " %02x", *buf));
length ? " %02x" : " %02x", *buf));
} }
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n"));
} }
...@@ -371,8 +364,10 @@ acpi_ex_dump_operand ( ...@@ -371,8 +364,10 @@ acpi_ex_dump_operand (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
} }
else { else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %p Length %X\n", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %8.8X%8.8X Length %X\n",
entry_desc->region.address, entry_desc->region.length)); HIDWORD(entry_desc->region.address),
LODWORD(entry_desc->region.address),
entry_desc->region.length));
} }
break; break;
...@@ -400,7 +395,7 @@ acpi_ex_dump_operand ( ...@@ -400,7 +395,7 @@ acpi_ex_dump_operand (
case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_REGION_FIELD:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"Region_field: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%lX bit=%X of below:\n", "Region_field: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%X bit=%X of below:\n",
entry_desc->field.bit_length, entry_desc->field.access_bit_width, entry_desc->field.bit_length, entry_desc->field.access_bit_width,
entry_desc->field.lock_rule, entry_desc->field.update_rule, entry_desc->field.lock_rule, entry_desc->field.update_rule,
entry_desc->field.base_byte_offset, entry_desc->field.start_field_bit_offset)); entry_desc->field.base_byte_offset, entry_desc->field.start_field_bit_offset));
...@@ -417,7 +412,7 @@ acpi_ex_dump_operand ( ...@@ -417,7 +412,7 @@ acpi_ex_dump_operand (
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"Buffer_field: %X bits at byte %lX bit %X of \n", "Buffer_field: %X bits at byte %X bit %X of \n",
entry_desc->buffer_field.bit_length, entry_desc->buffer_field.base_byte_offset, entry_desc->buffer_field.bit_length, entry_desc->buffer_field.base_byte_offset,
entry_desc->buffer_field.start_field_bit_offset)); entry_desc->buffer_field.start_field_bit_offset));
...@@ -449,9 +444,9 @@ acpi_ex_dump_operand ( ...@@ -449,9 +444,9 @@ acpi_ex_dump_operand (
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"Method(%X) @ %p:%lX\n", "Method(%X) @ %p:%X\n",
entry_desc->method.param_count, entry_desc->method.param_count,
entry_desc->method.pcode, entry_desc->method.pcode_length)); entry_desc->method.aml_start, entry_desc->method.aml_length));
break; break;
...@@ -608,7 +603,7 @@ acpi_ex_dump_node ( ...@@ -608,7 +603,7 @@ acpi_ex_dump_node (
} }
acpi_os_printf ("%20s : %4.4s\n", "Name", &node->name); acpi_os_printf ("%20s : %4.4s\n", "Name", (char*)&node->name);
acpi_os_printf ("%20s : %s\n", "Type", acpi_ut_get_type_name (node->type)); acpi_os_printf ("%20s : %s\n", "Type", acpi_ut_get_type_name (node->type));
acpi_os_printf ("%20s : %X\n", "Flags", node->flags); acpi_os_printf ("%20s : %X\n", "Flags", node->flags);
acpi_os_printf ("%20s : %X\n", "Owner Id", node->owner_id); acpi_os_printf ("%20s : %X\n", "Owner Id", node->owner_id);
...@@ -730,8 +725,8 @@ acpi_ex_dump_object_descriptor ( ...@@ -730,8 +725,8 @@ acpi_ex_dump_object_descriptor (
acpi_os_printf ("%20s : %X\n", "Param_count", obj_desc->method.param_count); acpi_os_printf ("%20s : %X\n", "Param_count", obj_desc->method.param_count);
acpi_os_printf ("%20s : %X\n", "Concurrency", obj_desc->method.concurrency); acpi_os_printf ("%20s : %X\n", "Concurrency", obj_desc->method.concurrency);
acpi_os_printf ("%20s : %p\n", "Semaphore", obj_desc->method.semaphore); acpi_os_printf ("%20s : %p\n", "Semaphore", obj_desc->method.semaphore);
acpi_os_printf ("%20s : %X\n", "Pcode_length", obj_desc->method.pcode_length); acpi_os_printf ("%20s : %X\n", "Aml_length", obj_desc->method.aml_length);
acpi_os_printf ("%20s : %X\n", "Pcode", obj_desc->method.pcode); acpi_os_printf ("%20s : %X\n", "Aml_start", obj_desc->method.aml_start);
break; break;
......
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: exfldio - Aml Field I/O * Module Name: exfldio - Aml Field I/O
* $Revision: 64 $ * $Revision: 66 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -71,7 +71,6 @@ acpi_ex_setup_field ( ...@@ -71,7 +71,6 @@ acpi_ex_setup_field (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
} }
/* /*
* If the Region Address and Length have not been previously evaluated, * If the Region Address and Length have not been previously evaluated,
* evaluate them now and save the results. * evaluate them now and save the results.
...@@ -84,7 +83,6 @@ acpi_ex_setup_field ( ...@@ -84,7 +83,6 @@ acpi_ex_setup_field (
} }
} }
/* /*
* Validate the request. The entire request from the byte offset for a * Validate the request. The entire request from the byte offset for a
* length of one field datum (access width) must fit within the region. * length of one field datum (access width) must fit within the region.
...@@ -158,7 +156,6 @@ acpi_ex_read_field_datum ( ...@@ -158,7 +156,6 @@ acpi_ex_read_field_datum (
*value = 0; *value = 0;
/* /*
* Buffer_fields - Read from a Buffer * Buffer_fields - Read from a Buffer
* Other Fields - Read from a Operation Region. * Other Fields - Read from a Operation Region.
...@@ -189,7 +186,6 @@ acpi_ex_read_field_datum ( ...@@ -189,7 +186,6 @@ acpi_ex_read_field_datum (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* /*
* The physical address of this field datum is: * The physical address of this field datum is:
* *
...@@ -201,13 +197,12 @@ acpi_ex_read_field_datum ( ...@@ -201,13 +197,12 @@ acpi_ex_read_field_datum (
address = rgn_desc->region.address + obj_desc->common_field.base_byte_offset + address = rgn_desc->region.address + obj_desc->common_field.base_byte_offset +
field_datum_byte_offset; field_datum_byte_offset;
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8lX%8.8lX\n", ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8X%8.8X\n",
acpi_ut_get_region_name (rgn_desc->region.space_id), acpi_ut_get_region_name (rgn_desc->region.space_id),
rgn_desc->region.space_id, obj_desc->common_field.access_bit_width, rgn_desc->region.space_id, obj_desc->common_field.access_bit_width,
obj_desc->common_field.base_byte_offset, field_datum_byte_offset, obj_desc->common_field.base_byte_offset, field_datum_byte_offset,
HIDWORD(address), LODWORD(address))); HIDWORD(address), LODWORD(address)));
/* Invoke the appropriate Address_space/Op_region handler */ /* Invoke the appropriate Address_space/Op_region handler */
status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_READ_ADR_SPACE, status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_READ_ADR_SPACE,
...@@ -235,7 +230,7 @@ acpi_ex_read_field_datum ( ...@@ -235,7 +230,7 @@ acpi_ex_read_field_datum (
} }
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08lX \n", *value)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08X \n", *value));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -381,7 +376,6 @@ acpi_ex_extract_from_field ( ...@@ -381,7 +376,6 @@ acpi_ex_extract_from_field (
byte_field_length, datum_count, obj_desc->common_field.access_bit_width, byte_field_length, datum_count, obj_desc->common_field.access_bit_width,
obj_desc->common_field.access_byte_width)); obj_desc->common_field.access_byte_width));
/* /*
* Clear the caller's buffer (the whole buffer length as given) * Clear the caller's buffer (the whole buffer length as given)
* This is very important, especially in the cases where a byte is read, * This is very important, especially in the cases where a byte is read,
...@@ -485,7 +479,6 @@ acpi_ex_extract_from_field ( ...@@ -485,7 +479,6 @@ acpi_ex_extract_from_field (
} }
} }
/* /*
* Store the merged field datum in the caller's buffer, according to * Store the merged field datum in the caller's buffer, according to
* the granularity of the field (size of each datum). * the granularity of the field (size of each datum).
...@@ -501,7 +494,6 @@ acpi_ex_extract_from_field ( ...@@ -501,7 +494,6 @@ acpi_ex_extract_from_field (
datum_offset++; datum_offset++;
} }
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
...@@ -576,7 +568,7 @@ acpi_ex_write_field_datum ( ...@@ -576,7 +568,7 @@ acpi_ex_write_field_datum (
field_datum_byte_offset; field_datum_byte_offset;
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Store %X in Region %s(%X) at %8.8lX%8.8lX width %X\n", "Store %X in Region %s(%X) at %8.8X%8.8X width %X\n",
value, acpi_ut_get_region_name (rgn_desc->region.space_id), value, acpi_ut_get_region_name (rgn_desc->region.space_id),
rgn_desc->region.space_id, HIDWORD(address), LODWORD(address), rgn_desc->region.space_id, HIDWORD(address), LODWORD(address),
obj_desc->common_field.access_bit_width)); obj_desc->common_field.access_bit_width));
...@@ -612,7 +604,7 @@ acpi_ex_write_field_datum ( ...@@ -612,7 +604,7 @@ acpi_ex_write_field_datum (
} }
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08lX \n", value)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08X \n", value));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -649,16 +641,13 @@ acpi_ex_write_field_datum_with_update_rule ( ...@@ -649,16 +641,13 @@ acpi_ex_write_field_datum_with_update_rule (
merged_value = field_value; merged_value = field_value;
/* If the mask is all ones, we don't need to worry about the update rule */ /* If the mask is all ones, we don't need to worry about the update rule */
if (mask != ACPI_UINT32_MAX) { if (mask != ACPI_UINT32_MAX) {
/* Decode the update rule */ /* Decode the update rule */
switch (obj_desc->common_field.update_rule) { switch (obj_desc->common_field.update_rule) {
case UPDATE_PRESERVE: case UPDATE_PRESERVE:
/* /*
* Check if update rule needs to be applied (not if mask is all * Check if update rule needs to be applied (not if mask is all
* ones) The left shift drops the bits we want to ignore. * ones) The left shift drops the bits we want to ignore.
...@@ -772,7 +761,6 @@ acpi_ex_insert_into_field ( ...@@ -772,7 +761,6 @@ acpi_ex_insert_into_field (
byte_field_length, datum_count, obj_desc->common_field.access_bit_width, byte_field_length, datum_count, obj_desc->common_field.access_bit_width,
obj_desc->common_field.access_byte_width)); obj_desc->common_field.access_byte_width));
/* /*
* Break the request into up to three parts (similar to an I/O request): * Break the request into up to three parts (similar to an I/O request):
* 1) non-aligned part at start * 1) non-aligned part at start
...@@ -868,22 +856,24 @@ acpi_ex_insert_into_field ( ...@@ -868,22 +856,24 @@ acpi_ex_insert_into_field (
merged_datum = this_raw_datum; merged_datum = this_raw_datum;
} }
/* /*
* Special handling for the last datum if the field does NOT end on * Special handling for the last datum if the field does NOT end on
* a datum boundary. Update Rule must be applied to the bits outside * a datum boundary. Update Rule must be applied to the bits outside
* the field. * the field.
*/ */
if ((datum_offset == datum_count) && if (datum_offset == datum_count) {
obj_desc->common_field.end_field_valid_bits) { /*
* If there are dangling non-aligned bits, perform one more merged write
* Else - field is aligned at the end, no need for any more writes
*/
if (obj_desc->common_field.end_field_valid_bits) {
/* /*
* Part3: * Part3:
* This is the last datum and the field does not end on a datum boundary. * This is the last datum and the field does not end on a datum boundary.
* Build the partial datum and write with the update rule. * Build the partial datum and write with the update rule.
*
* Mask off the unused bits above (after) the end-of-field
*/ */
/* Mask off the unused bits above (after) the end-of-field */
mask = MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); mask = MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
merged_datum &= mask; merged_datum &= mask;
...@@ -895,6 +885,7 @@ acpi_ex_insert_into_field ( ...@@ -895,6 +885,7 @@ acpi_ex_insert_into_field (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
} }
}
else { else {
/* Normal case -- write the completed datum */ /* Normal case -- write the completed datum */
...@@ -913,7 +904,6 @@ acpi_ex_insert_into_field ( ...@@ -913,7 +904,6 @@ acpi_ex_insert_into_field (
previous_raw_datum = this_raw_datum; previous_raw_datum = this_raw_datum;
} }
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
......
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.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresolv - AML Interpreter object resolution * Module Name: exresolv - AML Interpreter object resolution
* $Revision: 99 $ * $Revision: 101 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -131,12 +131,14 @@ acpi_ex_get_buffer_field_value ( ...@@ -131,12 +131,14 @@ acpi_ex_get_buffer_field_value (
(result_desc->integer.value >> obj_desc->buffer_field.start_field_bit_offset) & mask; (result_desc->integer.value >> obj_desc->buffer_field.start_field_bit_offset) & mask;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"** Read from buffer %p byte %ld bit %d width %d addr %p mask %08lx val %08lx\n", "** Read from buffer %p byte %d bit %d width %d addr %p mask %08X val %8.8X%8.8X\n",
obj_desc->buffer_field.buffer_obj->buffer.pointer, obj_desc->buffer_field.buffer_obj->buffer.pointer,
obj_desc->buffer_field.base_byte_offset, obj_desc->buffer_field.base_byte_offset,
obj_desc->buffer_field.start_field_bit_offset, obj_desc->buffer_field.start_field_bit_offset,
obj_desc->buffer_field.bit_length, obj_desc->buffer_field.bit_length,
location, mask, result_desc->integer.value)); location, mask,
HIDWORD(result_desc->integer.value),
LODWORD(result_desc->integer.value)));
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
...@@ -323,7 +325,7 @@ acpi_ex_resolve_object_to_value ( ...@@ -323,7 +325,7 @@ acpi_ex_resolve_object_to_value (
break; break;
case AML_REVISION_OP: case AML_REVISION_OP:
obj_desc->integer.value = ACPI_CA_VERSION; obj_desc->integer.value = ACPI_CA_SUPPORT_LEVEL;
break; break;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresop - AML Interpreter operand/object resolution * Module Name: exresop - AML Interpreter operand/object resolution
* $Revision: 38 $ * $Revision: 41 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -120,7 +120,7 @@ acpi_ex_resolve_operands ( ...@@ -120,7 +120,7 @@ acpi_ex_resolve_operands (
op_info = acpi_ps_get_opcode_info (opcode); op_info = acpi_ps_get_opcode_info (opcode);
if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) { if (op_info->class == AML_CLASS_UNKNOWN) {
return_ACPI_STATUS (AE_AML_BAD_OPCODE); return_ACPI_STATUS (AE_AML_BAD_OPCODE);
} }
...@@ -146,7 +146,7 @@ acpi_ex_resolve_operands ( ...@@ -146,7 +146,7 @@ acpi_ex_resolve_operands (
*/ */
while (GET_CURRENT_ARG_TYPE (arg_types)) { while (GET_CURRENT_ARG_TYPE (arg_types)) {
if (!stack_ptr || !*stack_ptr) { if (!stack_ptr || !*stack_ptr) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %X\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %p\n",
stack_ptr)); stack_ptr));
return_ACPI_STATUS (AE_AML_INTERNAL); return_ACPI_STATUS (AE_AML_INTERNAL);
...@@ -183,7 +183,7 @@ acpi_ex_resolve_operands ( ...@@ -183,7 +183,7 @@ acpi_ex_resolve_operands (
* Decode the Reference * Decode the Reference
*/ */
op_info = acpi_ps_get_opcode_info (opcode); op_info = acpi_ps_get_opcode_info (opcode);
if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) { if (op_info->class == AML_CLASS_UNKNOWN) {
return_ACPI_STATUS (AE_AML_BAD_OPCODE); return_ACPI_STATUS (AE_AML_BAD_OPCODE);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
* $Revision: 45 $ * $Revision: 46 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -220,7 +220,7 @@ acpi_hw_set_mode ( ...@@ -220,7 +220,7 @@ acpi_hw_set_mode (
/* Give the platform some time to react */ /* Give the platform some time to react */
acpi_os_stall (5000); acpi_os_stall (20000);
if (acpi_hw_get_mode () == mode) { if (acpi_hw_get_mode () == mode) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode));
......
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.
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