| Kernel v2.4.3-ac8 /acpi-20010413.diff |
|---|
| Filename: | /acpi-20010413.diff |
| Lines Added: | 72741 |
| Lines Deleted: | 0 |
| Also changed in: |
(Previous) (Following)
2.4.3-ac9
|
 2.4.3-ac8
 acpi-20010413.diff
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/acpi-20010413.diff linux.ac/acpi-20010413.diff
--- linux.vanilla/acpi-20010413.diff Thu Jan 1 01:00:00 1970
+++ linux.ac/acpi-20010413.diff Tue Apr 17 16:37:12 2001
@@ -0,0 +1,72741 @@
+diff -Naur -X bin/dontdiff /usr/src/linux/Documentation/Configure.help linux/Documentation/Configure.help
+--- /usr/src/linux/Documentation/Configure.help Sun Mar 25 18:24:31 2001
++++ linux/Documentation/Configure.help Wed Apr 11 14:33:51 2001
+@@ -13456,7 +13456,7 @@
+ will issue the hlt instruction if nothing is to be done, thereby
+ sending the processor to sleep and saving power.
+
+-ACPI Support
++ACPI support
+ CONFIG_ACPI
+ ACPI/OSPM support for Linux is currently under development. As such,
+ this support is preliminary and EXPERIMENTAL. Configuring ACPI support
+@@ -13485,6 +13485,56 @@
+
+ The ACPI mailing list may also be of interest:
+ http://phobos.fs.tum.de/acpi/index.html
++
++ACPI Debug Statements
++CONFIG_ACPI_DEBUG
++ The ACPI driver can optionally report errors with a great deal
++ of verbosity. Saying Y enables these statements. This will increase
++ your kernel size by around 50K.
++
++ACPI Bus Manager
++CONFIG_ACPI_BUSMGR
++ The ACPI Bus Manager enumerates devices in the ACPI namespace, and
++ handles PnP messages. All ACPI devices use its services, so using them
++ requires saying Y here.
++
++ACPI System Driver
++CONFIG_ACPI_SYS
++ This driver will enable your system to shut down using ACPI.
++
++ACPI Processor Driver
++CONFIG_ACPI_CPU
++ This driver installs ACPI as the idle handler for Linux, and uses ACPI
++ C2 and C3 processor states to save power, on systems that support it.
++
++ACPI Button
++CONFIG_ACPI_BUTTON
++ This driver registers for events based on buttons, such as the power,
++ sleep, and lid switch. In the future, a daemon will read
++ /proc/acpi/event and perform user-defined actions such as shutting
++ down the system, but until then, you can cat it, and see output when
++ a button is pressed.
++
++ACPI AC Adapter
++CONFIG_ACPI_AC
++ This driver adds support for the AC Adapter object, which indicates
++ whether a system is on AC, or not. Typically, only laptops have this
++ object, since desktops are always on AC.
++
++ACPI Embedded Controller
++CONFIG_ACPI_EC
++ This driver is required on some systems for the proper operation of the
++ battery and thermal drivers. If you are compiling for a laptop, say Y.
++
++ACPI Control Method
++CONFIG_ACPI_CMBATT
++ This driver adds support for battery information through
++ /proc/acpi/battery. If you have a laptop with a battery, say Y.
++
++ACPI Thermal
++CONFIG_ACPI_THERMAL
++ This driver handles overheating conditions on laptops. It is HIGHLY
++ recommended, as your laptop CPU may be damaged without it.
+
+ Advanced Power Management BIOS support
+ CONFIG_APM
+diff -Naur -X bin/dontdiff /usr/src/linux/arch/i386/config.in linux/arch/i386/config.in
+--- /usr/src/linux/arch/i386/config.in Mon Jan 8 13:27:56 2001
++++ linux/arch/i386/config.in Mon Apr 2 15:39:51 2001
+@@ -231,6 +231,10 @@
+
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ dep_bool ' ACPI support' CONFIG_ACPI $CONFIG_PM
++
++ if [ "$CONFIG_ACPI" != "n" ]; then
++ source drivers/acpi/Config.in
++ fi
+ fi
+
+ dep_tristate ' Advanced Power Management BIOS support' CONFIG_APM $CONFIG_PM
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/Config.in linux/drivers/acpi/Config.in
+--- /usr/src/linux/drivers/acpi/Config.in Wed Dec 31 16:00:00 1969
++++ linux/drivers/acpi/Config.in Fri Apr 13 11:57:11 2001
+@@ -0,0 +1,17 @@
++#
++# ACPI configuration
++#
++#mainmenu_option next_comment
++#comment 'ACPI Configuration'
++
++dep_bool ' ACPI Debug Statements' CONFIG_ACPI_DEBUG $CONFIG_ACPI
++dep_tristate ' ACPI Bus Manager' CONFIG_ACPI_BUSMGR $CONFIG_ACPI
++
++dep_tristate ' System' CONFIG_ACPI_SYS $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
++dep_tristate ' Processor' CONFIG_ACPI_CPU $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
++dep_tristate ' Button' CONFIG_ACPI_BUTTON $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
++dep_tristate ' AC Adapter' CONFIG_ACPI_AC $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
++dep_tristate ' Embedded Controller' CONFIG_ACPI_EC $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
++dep_tristate ' Control Method Battery' CONFIG_ACPI_CMBATT $CONFIG_ACPI_BUSMGR $CONFIG_ACPI $CONFIG_ACPI_EC
++dep_tristate ' Thermal' CONFIG_ACPI_THERMAL $CONFIG_ACPI_BUSMGR $CONFIG_ACPI $CONFIG_ACPI_EC
++#endmenu
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/Makefile linux/drivers/acpi/Makefile
+--- /usr/src/linux/drivers/acpi/Makefile Sat Mar 3 17:46:47 2001
++++ linux/drivers/acpi/Makefile Fri Apr 13 11:57:11 2001
+@@ -1,12 +1,14 @@
+ #
+ # Makefile for the Linux ACPI interpreter
+-#
++# (It's a mess, but it's all here for a reason.)
++#
+
+ O_TARGET := acpi.o
+
+ export-objs := acpi_ksyms.o
+
+ export ACPI_CFLAGS
++
+ ACPI_CFLAGS := -D_LINUX
+
+ #
+@@ -16,25 +18,47 @@
+ ACPI_CFLAGS += -DCONFIG_ACPI_KERNEL_CONFIG_ONLY
+ endif
+
++acpi-subdirs := utils dispatcher events hardware \
++ executer namespace parser resource tables
++
+ EXTRA_CFLAGS += -I./include
+
+-EXTRA_CFLAGS += $(ACPI_CFLAGS)
++ifdef CONFIG_ACPI_DEBUG
++ ACPI_CFLAGS += -DACPI_DEBUG -Wno-unused #-DENABLE_DEBUGGER
+
+-acpi-subdirs := common dispatcher events hardware \
+- interpreter namespace parser resources tables
++ #acpi-subdirs += debugger
++endif
++
++EXTRA_CFLAGS += $(ACPI_CFLAGS)
+
+-subdir-$(CONFIG_ACPI) += $(acpi-subdirs)
++mod-subdirs := ospm
+
+-obj-$(CONFIG_ACPI) := $(patsubst %,%.o,$(acpi-subdirs))
+-obj-$(CONFIG_ACPI) += os.o acpi_ksyms.o
++subdir-$(CONFIG_ACPI) += $(acpi-subdirs)
++subdir-$(CONFIG_ACPI_BUSMGR) += ospm
+
++list-multi := acpicore.o
++acpicore-objs := os.o acpi_ksyms.o
++acpicore-objs += $(patsubst %,%.o,$(acpi-subdirs))
+ ifdef CONFIG_ACPI_KERNEL_CONFIG
+- obj-$(CONFIG_ACPI) += acpiconf.o osconf.o
++ acpicore-objs += acpiconf.o osconf.o
+ else
+- obj-$(CONFIG_ACPI) += driver.o cmbatt.o cpu.o ec.o acpi_ksyms.o sys.o table.o power.o
++ acpicore-objs += driver.o
++endif
++
++obj-$(CONFIG_ACPI) += acpicore.o
++
++ifeq ($(CONFIG_ACPI_BUSMGR),y)
++ obj-y += ospm/ospm.o
++endif
++
++ifeq ($(CONFIG_KDB),y)
++ obj-m += kdb/kdbm_acpi.o
+ endif
+
+ include $(TOPDIR)/Rules.make
+
+ clean:
+ $(RM) *.o */*.o
++
++acpicore.o: $(acpicore-objs)
++ $(LD) -r -o $@ $(acpicore-objs)
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/acpi_ksyms.c linux/drivers/acpi/acpi_ksyms.c
+--- /usr/src/linux/drivers/acpi/acpi_ksyms.c Fri Feb 16 16:06:17 2001
++++ linux/drivers/acpi/acpi_ksyms.c Fri Apr 13 11:57:11 2001
+@@ -18,6 +18,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <linux/config.h>
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+@@ -27,6 +28,7 @@
+ #include "acdebug.h"
+
+ extern int acpi_in_debugger;
++extern FADT_DESCRIPTOR acpi_fadt;
+
+ #define _COMPONENT OS_DEPENDENT
+ MODULE_NAME ("symbols")
+@@ -58,6 +60,7 @@
+ EXPORT_SYMBOL(acpi_cm_strncmp);
+ EXPORT_SYMBOL(acpi_cm_memcpy);
+ EXPORT_SYMBOL(acpi_cm_memset);
++EXPORT_SYMBOL(acpi_cm_format_exception);
+
+ EXPORT_SYMBOL(acpi_get_handle);
+ EXPORT_SYMBOL(acpi_get_parent);
+@@ -73,6 +76,11 @@
+ EXPORT_SYMBOL(acpi_remove_gpe_handler);
+ EXPORT_SYMBOL(acpi_install_address_space_handler);
+ EXPORT_SYMBOL(acpi_remove_address_space_handler);
++EXPORT_SYMBOL(acpi_install_fixed_event_handler);
++EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
++
++EXPORT_SYMBOL(acpi_acquire_global_lock);
++EXPORT_SYMBOL(acpi_release_global_lock);
+
+ EXPORT_SYMBOL(acpi_get_current_resources);
+ EXPORT_SYMBOL(acpi_get_possible_resources);
+@@ -81,3 +89,20 @@
+ EXPORT_SYMBOL(acpi_enable_event);
+ EXPORT_SYMBOL(acpi_disable_event);
+ EXPORT_SYMBOL(acpi_clear_event);
++
++EXPORT_SYMBOL(acpi_get_timer_duration);
++EXPORT_SYMBOL(acpi_get_timer);
++
++EXPORT_SYMBOL(acpi_os_signal_semaphore);
++EXPORT_SYMBOL(acpi_os_create_semaphore);
++EXPORT_SYMBOL(acpi_os_delete_semaphore);
++EXPORT_SYMBOL(acpi_os_wait_semaphore);
++
++EXPORT_SYMBOL(acpi_os_in32);
++EXPORT_SYMBOL(acpi_os_out32);
++EXPORT_SYMBOL(acpi_fadt);
++EXPORT_SYMBOL(acpi_hw_register_bit_access);
++EXPORT_SYMBOL(acpi_hw_obtain_sleep_type_register_data);
++EXPORT_SYMBOL(acpi_enter_sleep_state);
++EXPORT_SYMBOL(acpi_get_system_info);
++
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/cmbatt.c linux/drivers/acpi/cmbatt.c
+--- /usr/src/linux/drivers/acpi/cmbatt.c Fri Feb 9 11:45:58 2001
++++ linux/drivers/acpi/cmbatt.c Wed Dec 31 16:00:00 1969
+@@ -1,390 +0,0 @@
+-/*
+- * cmbatt.c - Control Method Battery driver
+- *
+- * Copyright (C) 2000 Andrew Grover
+- *
+- * 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
+- */
+-/*
+- * Changes:
+- * Brendan Burns <bburns@wso.williams.edu> 2000-11-15
+- * - added proc battery interface
+- * - parse returned data from _BST and _BIF
+- * Andy Grover <andrew.grover@intel.com> 2000-12-8
+- * - improved proc interface
+- * Pavel Machek <pavel@suse.cz> 2001-1-31
+- * - fixed oops on NULLs in return from _BIF
+- */
+-
+-#include <linux/kernel.h>
+-#include <linux/types.h>
+-#include <linux/proc_fs.h>
+-#include "acpi.h"
+-#include "driver.h"
+-
+-#define _COMPONENT OS_DEPENDENT
+- MODULE_NAME ("cmbatt")
+-
+-/* ACPI-specific defines */
+-#define ACPI_CMBATT_HID "PNP0C0A"
+-#define ACPI_BATT_PRESENT 0x10
+-#define ACPI_BATT_UNKNOWN 0xFFFFFFFF
+-
+-/* driver-specific defines */
+-#define MAX_CM_BATTERIES 0x8
+-#define MAX_BATT_STRLEN 0x20
+-
+-#define Xstrncpy(a, b, c) if (b) strncpy(a,b,c); else strncpy(a, "unknown", c)
+-
+-struct cmbatt_info
+-{
+- u32 power_unit;
+- u32 design_capacity;
+- u32 last_full_capacity;
+- u32 battery_technology;
+- u32 design_voltage;
+- u32 design_capacity_warning;
+- u32 design_capacity_low;
+- u32 battery_capacity_granularity_1;
+- u32 battery_capacity_granularity_2;
+-
+- char model_number[MAX_BATT_STRLEN];
+- char serial_number[MAX_BATT_STRLEN];
+- char battery_type[MAX_BATT_STRLEN];
+- char oem_info[MAX_BATT_STRLEN];
+-};
+-
+-struct cmbatt_context
+-{
+- u32 is_present;
+- ACPI_HANDLE handle;
+- char UID[9];
+- char *power_unit;
+- struct cmbatt_info info;
+-};
+-
+-struct cmbatt_status
+-{
+- u32 state;
+- u32 present_rate;
+- u32 remaining_capacity;
+- u32 present_voltage;
+-};
+-
+-static u32 batt_count = 0;
+-
+-static struct cmbatt_context batt_list[MAX_CM_BATTERIES];
+-
+-static ACPI_STATUS
+-acpi_get_battery_status(ACPI_HANDLE handle, struct cmbatt_status *result)
+-{
+- ACPI_OBJECT *obj;
+- ACPI_OBJECT *objs;
+- ACPI_BUFFER buf;
+-
+- buf.length = 0;
+- buf.pointer = NULL;
+-
+- /* determine buffer length needed */
+- if (acpi_evaluate_object(handle, "_BST", NULL, &buf) != AE_BUFFER_OVERFLOW) {
+- printk(KERN_ERR "Cmbatt: Could not get battery status struct length\n");
+- return AE_NOT_FOUND;
+- }
+-
+- buf.pointer = kmalloc(buf.length, GFP_KERNEL);
+- if (!buf.pointer)
+- return AE_NO_MEMORY;
+-
+- /* get the data */
+- if (!ACPI_SUCCESS(acpi_evaluate_object(handle, "_BST", NULL, &buf))) {
+- printk(KERN_ERR "Cmbatt: Could not get battery status\n");
+- kfree (buf.pointer);
+- return AE_NOT_FOUND;
+- }
+-
+- obj = (ACPI_OBJECT *) buf.pointer;
+- objs = obj->package.elements;
+-
+- result->state = objs[0].integer.value;
+- result->present_rate = objs[1].integer.value;
+- result->remaining_capacity = objs[2].integer.value;
+- result->present_voltage = objs[3].integer.value;
+-
+- kfree(buf.pointer);
+-
+- return AE_OK;
+-}
+-
+-static ACPI_STATUS
+-acpi_get_battery_info(ACPI_HANDLE handle, struct cmbatt_info *result)
+-{
+- ACPI_OBJECT *obj;
+- ACPI_OBJECT *objs;
+- ACPI_BUFFER buf;
+-
+- buf.length = 0;
+- buf.pointer = NULL;
+-
+- /* determine the length of the data */
+- if (acpi_evaluate_object(handle, "_BIF", NULL, &buf) != AE_BUFFER_OVERFLOW) {
+- printk(KERN_ERR "Cmbatt: Could not get battery info struct length\n");
+- return AE_NOT_FOUND;
+- }
+-
+- buf.pointer = kmalloc(buf.length, GFP_KERNEL);
+- if (!buf.pointer)
+- return AE_NO_MEMORY;
+-
+- /* get the data */
+- if (!ACPI_SUCCESS(acpi_evaluate_object(handle, "_BIF", NULL, &buf))) {
+- printk(KERN_ERR "Cmbatt: Could not get battery info\n");
+- kfree (buf.pointer);
+- return AE_NOT_FOUND;
+- }
+-
+- obj = (ACPI_OBJECT *) buf.pointer;
+- objs = obj->package.elements;
+-
+- result->power_unit=objs[0].integer.value;
+- result->design_capacity=objs[1].integer.value;
+- result->last_full_capacity=objs[2].integer.value;
+- result->battery_technology=objs[3].integer.value;
+- result->design_voltage=objs[4].integer.value;
+- result->design_capacity_warning=objs[5].integer.value;
+- result->design_capacity_low=objs[6].integer.value;
+- result->battery_capacity_granularity_1=objs[7].integer.value;
+- result->battery_capacity_granularity_2=objs[8].integer.value;
+-
+- /* BUG: trailing NULL issue */
+- Xstrncpy(result->model_number, objs[9].string.pointer, MAX_BATT_STRLEN-1);
+- Xstrncpy(result->serial_number, objs[10].string.pointer, MAX_BATT_STRLEN-1);
+- Xstrncpy(result->battery_type, objs[11].string.pointer, MAX_BATT_STRLEN-1);
+- Xstrncpy(result->oem_info, objs[12].string.pointer, MAX_BATT_STRLEN-1);
+-
+- kfree(buf.pointer);
+-
+- return AE_OK;
+-}
+-
+-/*
+- * We found a device with the correct HID
+- */
+-static ACPI_STATUS
+-acpi_found_cmbatt(ACPI_HANDLE handle, u32 level, void *ctx, void **value)
+-{
+- ACPI_DEVICE_INFO info;
+-
+- if (batt_count >= MAX_CM_BATTERIES) {
+- printk(KERN_ERR "Cmbatt: MAX_CM_BATTERIES exceeded\n");
+- return AE_OK;
+- }
+-
+- if (!ACPI_SUCCESS(acpi_get_object_info(handle, &info))) {
+- printk(KERN_ERR "Cmbatt: Could not get battery object info\n");
+- return (AE_OK);
+- }
+-
+- if (info.valid & ACPI_VALID_UID) {
+- strncpy(batt_list[batt_count].UID, info.unique_id, 9);
+- }
+- else if (batt_count > 1) {
+- printk(KERN_WARNING "Cmbatt: No UID but more than 1 battery\n");
+- }
+-
+- if (!(info.valid & ACPI_VALID_STA)) {
+- printk(KERN_ERR "Cmbatt: Battery _STA invalid\n");
+- return AE_OK;
+- }
+-
+- if (!(info.current_status & ACPI_BATT_PRESENT)) {
+- printk(KERN_INFO "Cmbatt: Battery socket %d empty\n", batt_count);
+- batt_list[batt_count].is_present = FALSE;
+- }
+- else {
+- printk(KERN_INFO "Cmbatt: Battery socket %d occupied\n", batt_count);
+- batt_list[batt_count].is_present = TRUE;
+- if (acpi_get_battery_info(handle, &batt_list[batt_count].info) != AE_OK) {
+- printk(KERN_ERR "acpi_get_battery_info failed\n");
+- return AE_OK;
+- }
+-
+- batt_list[batt_count].power_unit = (batt_list[batt_count].info.power_unit) ? "mA" : "mW";
+- }
+-
+- batt_list[batt_count].handle = handle;
+-
+- batt_count++;
+-
+- return AE_OK;
+-}
+-
+-static int
+-proc_read_batt_info(char *page, char **start, off_t off,
+- int count, int *eof, void *data)
+-{
+- struct cmbatt_info *info;
+- u32 batt_num = (u32) data;
+- char *p = page;
+- int len;
+-
+- info = &batt_list[batt_num].info;
+-
+- /* don't get info more than once for a single proc read */
+- if (off != 0)
+- goto end;
+-
+- if (!batt_list[batt_num].is_present) {
+- p += sprintf(p, "battery %d not present\n", batt_num);
+- goto end;
+- }
+-
+- if (info->last_full_capacity != ACPI_BATT_UNKNOWN)
+- p += sprintf(p, "Last Full Capacity: %d %sh\n",
+- info->last_full_capacity, batt_list[batt_num].power_unit);
+-
+- if (info->design_capacity != ACPI_BATT_UNKNOWN)
+- p += sprintf(p, "Design Capacity: %d %sh\n",
+- info->design_capacity, batt_list[batt_num].power_unit);
+-
+- if (info->battery_technology)
+- p += sprintf(p, "Battery Technology: Secondary\n");
+- else
+- p += sprintf(p, "Battery Technology: Primary\n");
+-
+- if (info->design_voltage != ACPI_BATT_UNKNOWN)
+- p += sprintf(p, "Design Voltage: %d mV\n",
+- info->design_voltage);
+-
+- p += sprintf(p, "Design Capacity Warning: %d %sh\n",
+- info->design_capacity_warning, batt_list[batt_num].power_unit);
+- p += sprintf(p, "Design Capacity Low: %d %sh\n",
+- info->design_capacity_low, batt_list[batt_num].power_unit);
+- p += sprintf(p, "Battery Capacity Granularity 1: %d\n",
+- info->battery_capacity_granularity_1);
+- p += sprintf(p, "Battery Capacity Granularity 2: %d\n",
+- info->battery_capacity_granularity_2);
+- p += sprintf(p, "Model number; %s\nSerial number: %s\nBattery type: %s\nOEM info: %s\n",
+- info->model_number,info->serial_number,
+- info->battery_type,info->oem_info);
+-end:
+- len = (p - page);
+- if (len <= off+count) *eof = 1;
+- *start = page + off;
+- len -= off;
+- if (len>count) len = count;
+- if (len<0) len = 0;
+- return len;
+-}
+-
+-static int
+-proc_read_batt_status(char *page, char **start, off_t off,
+- int count, int *eof, void *data)
+-{
+- struct cmbatt_status status;
+- u32 batt_num = (u32) data;
+- char *p = page;
+- int len;
+-
+- /* don't get status more than once for a single proc read */
+- if (off != 0)
+- goto end;
+-
+- if (!batt_list[batt_num].is_present) {
+- p += sprintf(p, "battery %d not present\n", batt_num);
+- goto end;
+- }
+-
+- if (acpi_get_battery_status(batt_list[batt_num].handle, &status) != AE_OK) {
+- printk(KERN_ERR "Cmbatt: acpi_get_battery_status failed\n");
+- goto end;
+- }
+-
+- p += sprintf(p, "Battery discharging: %s\n",
+- (status.state & 0x1)?"yes":"no");
+- p += sprintf(p, "Battery charging: %s\n",
+- (status.state & 0x2)?"yes":"no");
+- p += sprintf(p, "Battery critically low: %s\n",
+- (status.state & 0x4)?"yes":"no");
+-
+- if (status.present_rate != ACPI_BATT_UNKNOWN)
+- p += sprintf(p, "Battery rate: %d %s\n",
+- status.present_rate, batt_list[batt_num].power_unit);
+-
+- if (status.remaining_capacity != ACPI_BATT_UNKNOWN)
+- p += sprintf(p, "Battery capacity: %d %sh\n",
+- status.remaining_capacity, batt_list[batt_num].power_unit);
+-
+- if (status.present_voltage != ACPI_BATT_UNKNOWN)
+- p += sprintf(p, "Battery voltage: %d mV\n",
+- status.present_voltage);
+-
+-end:
+-
+- len = (p - page);
+- if (len <= off+count) *eof = 1;
+- *start = page + off;
+- len -= off;
+- if (len>count) len = count;
+- if (len<0) len = 0;
+- return len;
+-}
+-
+-
+-
+-int
+-acpi_cmbatt_init(void)
+-{
+- int i;
+-
+- acpi_get_devices(ACPI_CMBATT_HID,
+- acpi_found_cmbatt,
+- NULL,
+- NULL);
+-
+- for (i = 0; i < batt_count; i++) {
+-
+- char batt_name[20];
+-
+- sprintf(batt_name, "power/batt%d_info", i);
+- create_proc_read_entry(batt_name, 0, NULL,
+- proc_read_batt_info, (void *) i);
+-
+- sprintf(batt_name, "power/batt%d_status", i);
+- create_proc_read_entry(batt_name, 0, NULL,
+- proc_read_batt_status, (void *) i);
+-
+- }
+-
+- return 0;
+-}
+-
+-int
+-acpi_cmbatt_terminate(void)
+-{
+- int i;
+-
+- for (i = 0; i < batt_count; i++) {
+-
+- char batt_name[20];
+-
+- sprintf(batt_name, "power/batt%d_info", i);
+- remove_proc_entry(batt_name, NULL);
+-
+- sprintf(batt_name, "power/batt%d_status", i);
+- remove_proc_entry(batt_name, NULL);
+- }
+-
+- return 0;
+-}
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/Makefile linux/drivers/acpi/common/Makefile
+--- /usr/src/linux/drivers/acpi/common/Makefile Fri Dec 29 14:07:21 2000
++++ linux/drivers/acpi/common/Makefile Wed Dec 31 16:00:00 1969
+@@ -1,16 +0,0 @@
+-#
+-# Makefile for all Linux ACPI interpreter subdirectories
+-#
+-
+-O_TARGET := ../$(shell basename `pwd`).o
+-
+-obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c))
+-
+-EXTRA_CFLAGS += -I../include
+-
+-EXTRA_CFLAGS += $(ACPI_CFLAGS)
+-
+-include $(TOPDIR)/Rules.make
+-
+-clean:
+- $(RM) *.o
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmalloc.c linux/drivers/acpi/common/cmalloc.c
+--- /usr/src/linux/drivers/acpi/common/cmalloc.c Mon Jan 29 10:15:58 2001
++++ linux/drivers/acpi/common/cmalloc.c Wed Dec 31 16:00:00 1969
+@@ -1,170 +0,0 @@
+-/******************************************************************************
+- *
+- * Module Name: cmalloc - local memory allocation routines
+- * $Revision: 84 $
+- *
+- *****************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-
+-#include "acpi.h"
+-#include "acparser.h"
+-#include "acinterp.h"
+-#include "acnamesp.h"
+-#include "acglobal.h"
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmalloc")
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: _Cm_allocate
+- *
+- * PARAMETERS: Size - Size of the allocation
+- * Component - Component type of caller
+- * Module - Source file name of caller
+- * Line - Line number of caller
+- *
+- * RETURN: Address of the allocated memory on success, NULL on failure.
+- *
+- * DESCRIPTION: The subsystem's equivalent of malloc.
+- *
+- ****************************************************************************/
+-
+-void *
+-_cm_allocate (
+- u32 size,
+- u32 component,
+- NATIVE_CHAR *module,
+- u32 line)
+-{
+- void *address = NULL;
+-
+-
+- /* Check for an inadvertent size of zero bytes */
+-
+- if (!size) {
+- _REPORT_ERROR (module, line, component,
+- ("Cm_allocate: Attempt to allocate zero bytes\n"));
+- size = 1;
+- }
+-
+- address = acpi_os_allocate (size);
+- if (!address) {
+- /* Report allocation error */
+-
+- _REPORT_ERROR (module, line, component,
+- ("Cm_allocate: Could not allocate size %X\n", size));
+-
+- return (NULL);
+- }
+-
+-
+- return (address);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: _Cm_callocate
+- *
+- * PARAMETERS: Size - Size of the allocation
+- * Component - Component type of caller
+- * Module - Source file name of caller
+- * Line - Line number of caller
+- *
+- * RETURN: Address of the allocated memory on success, NULL on failure.
+- *
+- * DESCRIPTION: Subsystem equivalent of calloc.
+- *
+- ****************************************************************************/
+-
+-void *
+-_cm_callocate (
+- u32 size,
+- u32 component,
+- NATIVE_CHAR *module,
+- u32 line)
+-{
+- void *address = NULL;
+-
+-
+- /* Check for an inadvertent size of zero bytes */
+-
+- if (!size) {
+- _REPORT_ERROR (module, line, component,
+- ("Cm_callocate: Attempt to allocate zero bytes\n"));
+- return (NULL);
+- }
+-
+-
+- address = acpi_os_callocate (size);
+-
+- if (!address) {
+- /* Report allocation error */
+-
+- _REPORT_ERROR (module, line, component,
+- ("Cm_callocate: Could not allocate size %X\n", size));
+- return (NULL);
+- }
+-
+-
+- return (address);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: _Cm_free
+- *
+- * PARAMETERS: Address - Address of the memory to deallocate
+- * Component - Component type of caller
+- * Module - Source file name of caller
+- * Line - Line number of caller
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Frees the memory at Address
+- *
+- ****************************************************************************/
+-
+-void
+-_cm_free (
+- void *address,
+- u32 component,
+- NATIVE_CHAR *module,
+- u32 line)
+-{
+-
+- if (NULL == address) {
+- _REPORT_ERROR (module, line, component,
+- ("_Cm_free: Trying to delete a NULL address\n"));
+-
+- return;
+- }
+-
+-
+- acpi_os_free (address);
+-
+- return;
+-}
+-
+-
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmclib.c linux/drivers/acpi/common/cmclib.c
+--- /usr/src/linux/drivers/acpi/common/cmclib.c Mon Jan 22 13:23:42 2001
++++ linux/drivers/acpi/common/cmclib.c Wed Dec 31 16:00:00 1969
+@@ -1,818 +0,0 @@
+-/******************************************************************************
+- *
+- * Module Name: cmclib - Local implementation of C library functions
+- * $Revision: 32 $
+- *
+- *****************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-
+-#include "acpi.h"
+-#include "acevents.h"
+-#include "achware.h"
+-#include "acnamesp.h"
+-#include "acinterp.h"
+-#include "amlcode.h"
+-
+-/*
+- * These implementations of standard C Library routines can optionally be
+- * used if a C library is not available. In general, they are less efficient
+- * than an inline or assembly implementation
+- */
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmclib")
+-
+-
+-#ifndef ACPI_USE_SYSTEM_CLIBRARY
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strlen
+- *
+- * PARAMETERS: String - Null terminated string
+- *
+- * RETURN: Length
+- *
+- * DESCRIPTION: Returns the length of the input string
+- *
+- ******************************************************************************/
+-
+-
+-NATIVE_UINT
+-acpi_cm_strlen (
+- const NATIVE_CHAR *string)
+-{
+- NATIVE_UINT length = 0;
+-
+-
+- /* Count the string until a null is encountered */
+-
+- while (*string) {
+- length++;
+- string++;
+- }
+-
+- return (length);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strcpy
+- *
+- * PARAMETERS: Dst_string - Target of the copy
+- * Src_string - The source string to copy
+- *
+- * RETURN: Dst_string
+- *
+- * DESCRIPTION: Copy a null terminated string
+- *
+- ******************************************************************************/
+-
+-NATIVE_CHAR *
+-acpi_cm_strcpy (
+- NATIVE_CHAR *dst_string,
+- const NATIVE_CHAR *src_string)
+-{
+- NATIVE_CHAR *string = dst_string;
+-
+-
+- /* Move bytes brute force */
+-
+- while (*src_string) {
+- *string = *src_string;
+-
+- string++;
+- src_string++;
+- }
+-
+- /* Null terminate */
+-
+- *string = 0;
+-
+- return (dst_string);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strncpy
+- *
+- * PARAMETERS: Dst_string - Target of the copy
+- * Src_string - The source string to copy
+- * Count - Maximum # of bytes to copy
+- *
+- * RETURN: Dst_string
+- *
+- * DESCRIPTION: Copy a null terminated string, with a maximum length
+- *
+- ******************************************************************************/
+-
+-NATIVE_CHAR *
+-acpi_cm_strncpy (
+- NATIVE_CHAR *dst_string,
+- const NATIVE_CHAR *src_string,
+- NATIVE_UINT count)
+-{
+- NATIVE_CHAR *string = dst_string;
+-
+-
+- /* Copy the string */
+-
+- for (string = dst_string;
+- count && (count--, (*string++ = *src_string++)); )
+- {;}
+-
+- /* Pad with nulls if necessary */
+-
+- while (count--) {
+- *string = 0;
+- string++;
+- }
+-
+- /* Return original pointer */
+-
+- return (dst_string);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strcmp
+- *
+- * PARAMETERS: String1 - First string
+- * String2 - Second string
+- *
+- * RETURN: Index where strings mismatched, or 0 if strings matched
+- *
+- * DESCRIPTION: Compare two null terminated strings
+- *
+- ******************************************************************************/
+-
+-u32
+-acpi_cm_strcmp (
+- const NATIVE_CHAR *string1,
+- const NATIVE_CHAR *string2)
+-{
+-
+-
+- for ( ; (*string1 == *string2); string2++) {
+- if (!*string1++) {
+- return (0);
+- }
+- }
+-
+-
+- return ((unsigned char) *string1 - (unsigned char) *string2);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strncmp
+- *
+- * PARAMETERS: String1 - First string
+- * String2 - Second string
+- * Count - Maximum # of bytes to compare
+- *
+- * RETURN: Index where strings mismatched, or 0 if strings matched
+- *
+- * DESCRIPTION: Compare two null terminated strings, with a maximum length
+- *
+- ******************************************************************************/
+-
+-u32
+-acpi_cm_strncmp (
+- const NATIVE_CHAR *string1,
+- const NATIVE_CHAR *string2,
+- NATIVE_UINT count)
+-{
+-
+-
+- for ( ; count-- && (*string1 == *string2); string2++) {
+- if (!*string1++) {
+- return (0);
+- }
+- }
+-
+- return ((count == -1) ? 0 : ((unsigned char) *string1 -
+- (unsigned char) *string2));
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Strcat
+- *
+- * PARAMETERS: Dst_string - Target of the copy
+- * Src_string - The source string to copy
+- *
+- * RETURN: Dst_string
+- *
+- * DESCRIPTION: Append a null terminated string to a null terminated string
+- *
+- ******************************************************************************/
+-
+-NATIVE_CHAR *
+-acpi_cm_strcat (
+- NATIVE_CHAR *dst_string,
+- const NATIVE_CHAR *src_string)
+-{
+- NATIVE_CHAR *string;
+-
+-
+- /* Find end of the destination string */
+-
+- for (string = dst_string; *string++; ) { ; }
+-
+- /* Concatinate the string */
+-
+- for (--string; (*string++ = *src_string++); ) { ; }
+-
+- return (dst_string);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strncat
+- *
+- * PARAMETERS: Dst_string - Target of the copy
+- * Src_string - The source string to copy
+- * Count - Maximum # of bytes to copy
+- *
+- * RETURN: Dst_string
+- *
+- * DESCRIPTION: Append a null terminated string to a null terminated string,
+- * with a maximum count.
+- *
+- ******************************************************************************/
+-
+-NATIVE_CHAR *
+-acpi_cm_strncat (
+- NATIVE_CHAR *dst_string,
+- const NATIVE_CHAR *src_string,
+- NATIVE_UINT count)
+-{
+- NATIVE_CHAR *string;
+-
+-
+- if (count) {
+- /* Find end of the destination string */
+-
+- for (string = dst_string; *string++; ) { ; }
+-
+- /* Concatinate the string */
+-
+- for (--string; (*string++ = *src_string++) && --count; ) { ; }
+-
+- /* Null terminate if necessary */
+-
+- if (!count) {
+- *string = 0;
+- }
+- }
+-
+- return (dst_string);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: memcpy
+- *
+- * PARAMETERS: Dest - Target of the copy
+- * Src - Source buffer to copy
+- * Count - Number of bytes to copy
+- *
+- * RETURN: Dest
+- *
+- * DESCRIPTION: Copy arbitrary bytes of memory
+- *
+- ******************************************************************************/
+-
+-void *
+-acpi_cm_memcpy (
+- void *dest,
+- const void *src,
+- NATIVE_UINT count)
+-{
+- NATIVE_CHAR *new = (NATIVE_CHAR *) dest;
+- NATIVE_CHAR *old = (NATIVE_CHAR *) src;
+-
+-
+- while (count) {
+- *new = *old;
+- new++;
+- old++;
+- count--;
+- }
+-
+- return (dest);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: memset
+- *
+- * PARAMETERS: Dest - Buffer to set
+- * Value - Value to set each byte of memory
+- * Count - Number of bytes to set
+- *
+- * RETURN: Dest
+- *
+- * DESCRIPTION: Initialize a buffer to a known value.
+- *
+- ******************************************************************************/
+-
+-void *
+-acpi_cm_memset (
+- void *dest,
+- NATIVE_UINT value,
+- NATIVE_UINT count)
+-{
+- NATIVE_CHAR *new = (NATIVE_CHAR *) dest;
+-
+-
+- while (count) {
+- *new = (char) value;
+- new++;
+- count--;
+- }
+-
+- return (dest);
+-}
+-
+-
+-#define NEGATIVE 1
+-#define POSITIVE 0
+-
+-
+-#define _ACPI_XA 0x00 /* extra alphabetic - not supported */
+-#define _ACPI_XS 0x40 /* extra space */
+-#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */
+-#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */
+-#define _ACPI_DI 0x04 /* '0'-'9' */
+-#define _ACPI_LO 0x02 /* 'a'-'z' */
+-#define _ACPI_PU 0x10 /* punctuation */
+-#define _ACPI_SP 0x08 /* space */
+-#define _ACPI_UP 0x01 /* 'A'-'Z' */
+-#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */
+-
+-static const u8 _acpi_ctype[257] = {
+- _ACPI_CN, /* 0x0 0. */
+- _ACPI_CN, /* 0x1 1. */
+- _ACPI_CN, /* 0x2 2. */
+- _ACPI_CN, /* 0x3 3. */
+- _ACPI_CN, /* 0x4 4. */
+- _ACPI_CN, /* 0x5 5. */
+- _ACPI_CN, /* 0x6 6. */
+- _ACPI_CN, /* 0x7 7. */
+- _ACPI_CN, /* 0x8 8. */
+- _ACPI_CN|_ACPI_SP, /* 0x9 9. */
+- _ACPI_CN|_ACPI_SP, /* 0xA 10. */
+- _ACPI_CN|_ACPI_SP, /* 0xB 11. */
+- _ACPI_CN|_ACPI_SP, /* 0xC 12. */
+- _ACPI_CN|_ACPI_SP, /* 0xD 13. */
+- _ACPI_CN, /* 0xE 14. */
+- _ACPI_CN, /* 0xF 15. */
+- _ACPI_CN, /* 0x10 16. */
+- _ACPI_CN, /* 0x11 17. */
+- _ACPI_CN, /* 0x12 18. */
+- _ACPI_CN, /* 0x13 19. */
+- _ACPI_CN, /* 0x14 20. */
+- _ACPI_CN, /* 0x15 21. */
+- _ACPI_CN, /* 0x16 22. */
+- _ACPI_CN, /* 0x17 23. */
+- _ACPI_CN, /* 0x18 24. */
+- _ACPI_CN, /* 0x19 25. */
+- _ACPI_CN, /* 0x1A 26. */
+- _ACPI_CN, /* 0x1B 27. */
+- _ACPI_CN, /* 0x1C 28. */
+- _ACPI_CN, /* 0x1D 29. */
+- _ACPI_CN, /* 0x1E 30. */
+- _ACPI_CN, /* 0x1F 31. */
+- _ACPI_XS|_ACPI_SP, /* 0x20 32. ' ' */
+- _ACPI_PU, /* 0x21 33. '!' */
+- _ACPI_PU, /* 0x22 34. '"' */
+- _ACPI_PU, /* 0x23 35. '#' */
+- _ACPI_PU, /* 0x24 36. '$' */
+- _ACPI_PU, /* 0x25 37. '%' */
+- _ACPI_PU, /* 0x26 38. '&' */
+- _ACPI_PU, /* 0x27 39. ''' */
+- _ACPI_PU, /* 0x28 40. '(' */
+- _ACPI_PU, /* 0x29 41. ')' */
+- _ACPI_PU, /* 0x2A 42. '*' */
+- _ACPI_PU, /* 0x2B 43. '+' */
+- _ACPI_PU, /* 0x2C 44. ',' */
+- _ACPI_PU, /* 0x2D 45. '-' */
+- _ACPI_PU, /* 0x2E 46. '.' */
+- _ACPI_PU, /* 0x2F 47. '/' */
+- _ACPI_XD|_ACPI_DI, /* 0x30 48. '0' */
+- _ACPI_XD|_ACPI_DI, /* 0x31 49. '1' */
+- _ACPI_XD|_ACPI_DI, /* 0x32 50. '2' */
+- _ACPI_XD|_ACPI_DI, /* 0x33 51. '3' */
+- _ACPI_XD|_ACPI_DI, /* 0x34 52. '4' */
+- _ACPI_XD|_ACPI_DI, /* 0x35 53. '5' */
+- _ACPI_XD|_ACPI_DI, /* 0x36 54. '6' */
+- _ACPI_XD|_ACPI_DI, /* 0x37 55. '7' */
+- _ACPI_XD|_ACPI_DI, /* 0x38 56. '8' */
+- _ACPI_XD|_ACPI_DI, /* 0x39 57. '9' */
+- _ACPI_PU, /* 0x3A 58. ':' */
+- _ACPI_PU, /* 0x3B 59. ';' */
+- _ACPI_PU, /* 0x3C 60. '<' */
+- _ACPI_PU, /* 0x3D 61. '=' */
+- _ACPI_PU, /* 0x3E 62. '>' */
+- _ACPI_PU, /* 0x3F 63. '?' */
+- _ACPI_PU, /* 0x40 64. '@' */
+- _ACPI_XD|_ACPI_UP, /* 0x41 65. 'A' */
+- _ACPI_XD|_ACPI_UP, /* 0x42 66. 'B' */
+- _ACPI_XD|_ACPI_UP, /* 0x43 67. 'C' */
+- _ACPI_XD|_ACPI_UP, /* 0x44 68. 'D' */
+- _ACPI_XD|_ACPI_UP, /* 0x45 69. 'E' */
+- _ACPI_XD|_ACPI_UP, /* 0x46 70. 'F' */
+- _ACPI_UP, /* 0x47 71. 'G' */
+- _ACPI_UP, /* 0x48 72. 'H' */
+- _ACPI_UP, /* 0x49 73. 'I' */
+- _ACPI_UP, /* 0x4A 74. 'J' */
+- _ACPI_UP, /* 0x4B 75. 'K' */
+- _ACPI_UP, /* 0x4C 76. 'L' */
+- _ACPI_UP, /* 0x4D 77. 'M' */
+- _ACPI_UP, /* 0x4E 78. 'N' */
+- _ACPI_UP, /* 0x4F 79. 'O' */
+- _ACPI_UP, /* 0x50 80. 'P' */
+- _ACPI_UP, /* 0x51 81. 'Q' */
+- _ACPI_UP, /* 0x52 82. 'R' */
+- _ACPI_UP, /* 0x53 83. 'S' */
+- _ACPI_UP, /* 0x54 84. 'T' */
+- _ACPI_UP, /* 0x55 85. 'U' */
+- _ACPI_UP, /* 0x56 86. 'V' */
+- _ACPI_UP, /* 0x57 87. 'W' */
+- _ACPI_UP, /* 0x58 88. 'X' */
+- _ACPI_UP, /* 0x59 89. 'Y' */
+- _ACPI_UP, /* 0x5A 90. 'Z' */
+- _ACPI_PU, /* 0x5B 91. '[' */
+- _ACPI_PU, /* 0x5C 92. '\' */
+- _ACPI_PU, /* 0x5D 93. ']' */
+- _ACPI_PU, /* 0x5E 94. '^' */
+- _ACPI_PU, /* 0x5F 95. '_' */
+- _ACPI_PU, /* 0x60 96. '`' */
+- _ACPI_XD|_ACPI_LO, /* 0x61 97. 'a' */
+- _ACPI_XD|_ACPI_LO, /* 0x62 98. 'b' */
+- _ACPI_XD|_ACPI_LO, /* 0x63 99. 'c' */
+- _ACPI_XD|_ACPI_LO, /* 0x64 100. 'd' */
+- _ACPI_XD|_ACPI_LO, /* 0x65 101. 'e' */
+- _ACPI_XD|_ACPI_LO, /* 0x66 102. 'f' */
+- _ACPI_LO, /* 0x67 103. 'g' */
+- _ACPI_LO, /* 0x68 104. 'h' */
+- _ACPI_LO, /* 0x69 105. 'i' */
+- _ACPI_LO, /* 0x6A 106. 'j' */
+- _ACPI_LO, /* 0x6B 107. 'k' */
+- _ACPI_LO, /* 0x6C 108. 'l' */
+- _ACPI_LO, /* 0x6D 109. 'm' */
+- _ACPI_LO, /* 0x6E 110. 'n' */
+- _ACPI_LO, /* 0x6F 111. 'o' */
+- _ACPI_LO, /* 0x70 112. 'p' */
+- _ACPI_LO, /* 0x71 113. 'q' */
+- _ACPI_LO, /* 0x72 114. 'r' */
+- _ACPI_LO, /* 0x73 115. 's' */
+- _ACPI_LO, /* 0x74 116. 't' */
+- _ACPI_LO, /* 0x75 117. 'u' */
+- _ACPI_LO, /* 0x76 118. 'v' */
+- _ACPI_LO, /* 0x77 119. 'w' */
+- _ACPI_LO, /* 0x78 120. 'x' */
+- _ACPI_LO, /* 0x79 121. 'y' */
+- _ACPI_LO, /* 0x7A 122. 'z' */
+- _ACPI_PU, /* 0x7B 123. '{' */
+- _ACPI_PU, /* 0x7C 124. '|' */
+- _ACPI_PU, /* 0x7D 125. '}' */
+- _ACPI_PU, /* 0x7E 126. '~' */
+- _ACPI_CN, /* 0x7F 127. */
+-
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80 to 0x8F */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90 to 0x9F */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xA0 to 0xAF */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xB0 to 0xBF */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xC0 to 0xCF */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xD0 to 0xDF */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xE0 to 0xEF */
+- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* 0xF0 to 0x100 */
+-};
+-
+-#define IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
+-#define IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
+-#define IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
+-#define IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
+-#define IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_to_upper
+- *
+- * PARAMETERS:
+- *
+- * RETURN:
+- *
+- * DESCRIPTION: Convert character to uppercase
+- *
+- ******************************************************************************/
+-
+-u32
+-acpi_cm_to_upper (
+- u32 c)
+-{
+-
+- return (IS_LOWER(c) ? ((c)-0x20) : (c));
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_to_lower
+- *
+- * PARAMETERS:
+- *
+- * RETURN:
+- *
+- * DESCRIPTION: Convert character to lowercase
+- *
+- ******************************************************************************/
+-
+-u32
+-acpi_cm_to_lower (
+- u32 c)
+-{
+-
+- return (IS_UPPER(c) ? ((c)+0x20) : (c));
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strupr
+- *
+- * PARAMETERS: Src_string - The source string to convert to
+- *
+- * RETURN: Src_string
+- *
+- * DESCRIPTION: Convert string to uppercase
+- *
+- ******************************************************************************/
+-
+-NATIVE_CHAR *
+-acpi_cm_strupr (
+- NATIVE_CHAR *src_string)
+-{
+- NATIVE_CHAR *string;
+-
+-
+- /* Walk entire string, uppercasing the letters */
+-
+- for (string = src_string; *string; ) {
+- *string = (char) acpi_cm_to_upper (*string);
+- string++;
+- }
+-
+-
+- return (src_string);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strstr
+- *
+- * PARAMETERS: String1 -
+- * String2
+- *
+- * RETURN:
+- *
+- * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
+- * full implementation of strstr, only sufficient for command
+- * matching
+- *
+- ******************************************************************************/
+-
+-NATIVE_CHAR *
+-acpi_cm_strstr (
+- NATIVE_CHAR *string1,
+- NATIVE_CHAR *string2)
+-{
+- NATIVE_CHAR *string;
+-
+-
+- if (acpi_cm_strlen (string2) > acpi_cm_strlen (string1)) {
+- return (NULL);
+- }
+-
+- /* Walk entire string, comparing the letters */
+-
+- for (string = string1; *string2; ) {
+- if (*string2 != *string) {
+- return (NULL);
+- }
+-
+- string2++;
+- string++;
+- }
+-
+-
+- return (string1);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: strtoul
+- *
+- * PARAMETERS: String - Null terminated string
+- * Terminater - Where a pointer to the terminating byte is returned
+- * Base - Radix of the string
+- *
+- * RETURN: Converted value
+- *
+- * DESCRIPTION: Convert a string into an unsigned value.
+- *
+- ******************************************************************************/
+-
+-u32
+-acpi_cm_strtoul (
+- const NATIVE_CHAR *string,
+- NATIVE_CHAR **terminator,
+- NATIVE_UINT base)
+-{
+- u32 converted = 0;
+- u32 index;
+- u32 sign;
+- const NATIVE_CHAR *string_start;
+- u32 return_value = 0;
+- ACPI_STATUS status = AE_OK;
+-
+-
+- /*
+- * Save the value of the pointer to the buffer's first
+- * character, save the current errno value, and then
+- * skip over any white space in the buffer:
+- */
+- string_start = string;
+- while (IS_SPACE (*string) || *string == '\t') {
+- ++string;
+- }
+-
+- /*
+- * The buffer may contain an optional plus or minus sign.
+- * If it does, then skip over it but remember what is was:
+- */
+- if (*string == '-') {
+- sign = NEGATIVE;
+- ++string;
+- }
+-
+- else if (*string == '+') {
+- ++string;
+- sign = POSITIVE;
+- }
+-
+- else {
+- sign = POSITIVE;
+- }
+-
+- /*
+- * If the input parameter Base is zero, then we need to
+- * determine if it is octal, decimal, or hexadecimal:
+- */
+- if (base == 0) {
+- if (*string == '0') {
+- if (acpi_cm_to_lower (*(++string)) == 'x') {
+- base = 16;
+- ++string;
+- }
+-
+- else {
+- base = 8;
+- }
+- }
+-
+- else {
+- base = 10;
+- }
+- }
+-
+- else if (base < 2 || base > 36) {
+- /*
+- * The specified Base parameter is not in the domain of
+- * this function:
+- */
+- goto done;
+- }
+-
+- /*
+- * For octal and hexadecimal bases, skip over the leading
+- * 0 or 0x, if they are present.
+- */
+- if (base == 8 && *string == '0') {
+- string++;
+- }
+-
+- if (base == 16 &&
+- *string == '0' &&
+- acpi_cm_to_lower (*(++string)) == 'x')
+- {
+- string++;
+- }
+-
+-
+- /*
+- * Main loop: convert the string to an unsigned long:
+- */
+- while (*string) {
+- if (IS_DIGIT (*string)) {
+- index = *string - '0';
+- }
+-
+- else {
+- index = acpi_cm_to_upper (*string);
+- if (IS_UPPER (index)) {
+- index = index - 'A' + 10;
+- }
+-
+- else {
+- goto done;
+- }
+- }
+-
+- if (index >= base) {
+- goto done;
+- }
+-
+- /*
+- * Check to see if value is out of range:
+- */
+-
+- if (return_value > ((ACPI_UINT32_MAX - (u32) index) /
+- (u32) base))
+- {
+- status = AE_ERROR;
+- return_value = 0L; /* reset */
+- }
+-
+- else {
+- return_value *= base;
+- return_value += index;
+- converted = 1;
+- }
+-
+- ++string;
+- }
+-
+-done:
+- /*
+- * If appropriate, update the caller's pointer to the next
+- * unconverted character in the buffer.
+- */
+- if (terminator) {
+- if (converted == 0 && return_value == 0L && string != NULL) {
+- *terminator = (NATIVE_CHAR *) string_start;
+- }
+-
+- else {
+- *terminator = (NATIVE_CHAR *) string;
+- }
+- }
+-
+- if (status == AE_ERROR) {
+- return_value = ACPI_UINT32_MAX;
+- }
+-
+- /*
+- * If a minus sign was present, then "the conversion is negated":
+- */
+- if (sign == NEGATIVE) {
+- return_value = (ACPI_UINT32_MAX - return_value) + 1;
+- }
+-
+- return (return_value);
+-}
+-
+-#endif /* ACPI_USE_SYSTEM_CLIBRARY */
+-
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmcopy.c linux/drivers/acpi/common/cmcopy.c
+--- /usr/src/linux/drivers/acpi/common/cmcopy.c Fri Feb 9 11:45:58 2001
++++ linux/drivers/acpi/common/cmcopy.c Wed Dec 31 16:00:00 1969
+@@ -1,708 +0,0 @@
+-/******************************************************************************
+- *
+- * Module Name: cmcopy - Internal to external object translation utilities
+- * $Revision: 66 $
+- *
+- *****************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-
+-#include "acpi.h"
+-#include "acinterp.h"
+-#include "acnamesp.h"
+-#include "amlcode.h"
+-
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmcopy")
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_isimple_to_esimple
+- *
+- * PARAMETERS: *Internal_object - Pointer to the object we are examining
+- * *Buffer - Where the object is returned
+- * *Space_used - Where the data length is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: This function is called to place a simple object in a user
+- * buffer.
+- *
+- * The buffer is assumed to have sufficient space for the object.
+- *
+- ******************************************************************************/
+-
+-static ACPI_STATUS
+-acpi_cm_copy_isimple_to_esimple (
+- ACPI_OPERAND_OBJECT *internal_object,
+- ACPI_OBJECT *external_object,
+- u8 *data_space,
+- u32 *buffer_space_used)
+-{
+- u32 length = 0;
+- ACPI_STATUS status = AE_OK;
+-
+-
+- /*
+- * Check for NULL object case (could be an uninitialized
+- * package element
+- */
+-
+- if (!internal_object) {
+- *buffer_space_used = 0;
+- return (AE_OK);
+- }
+-
+- /* Always clear the external object */
+-
+- MEMSET (external_object, 0, sizeof (ACPI_OBJECT));
+-
+- /*
+- * In general, the external object will be the same type as
+- * the internal object
+- */
+-
+- external_object->type = internal_object->common.type;
+-
+- /* However, only a limited number of external types are supported */
+-
+- switch (internal_object->common.type)
+- {
+-
+- case ACPI_TYPE_STRING:
+-
+- length = internal_object->string.length + 1;
+- external_object->string.length = internal_object->string.length;
+- external_object->string.pointer = (NATIVE_CHAR *) data_space;
+- MEMCPY ((void *) data_space, (void *) internal_object->string.pointer, length);
+- break;
+-
+-
+- case ACPI_TYPE_BUFFER:
+-
+- length = internal_object->buffer.length;
+- external_object->buffer.length = internal_object->buffer.length;
+- external_object->buffer.pointer = data_space;
+- MEMCPY ((void *) data_space, (void *) internal_object->buffer.pointer, length);
+- break;
+-
+-
+- case ACPI_TYPE_INTEGER:
+-
+- external_object->integer.value= internal_object->integer.value;
+- break;
+-
+-
+- case INTERNAL_TYPE_REFERENCE:
+-
+- /*
+- * This is an object reference. Attempt to dereference it.
+- */
+-
+- switch (internal_object->reference.op_code)
+- {
+- case AML_ZERO_OP:
+- external_object->type = ACPI_TYPE_INTEGER;
+- external_object->integer.value = 0;
+- break;
+-
+- case AML_ONE_OP:
+- external_object->type = ACPI_TYPE_INTEGER;
+- external_object->integer.value = 1;
+- break;
+-
+- case AML_ONES_OP:
+- external_object->type = ACPI_TYPE_INTEGER;
+- external_object->integer.value = ACPI_INTEGER_MAX;
+- break;
+-
+- case AML_NAMEPATH_OP:
+- /*
+- * This is a named reference, get the string. We already know that
+- * we have room for it, use max length
+- */
+- length = MAX_STRING_LENGTH;
+- external_object->type = ACPI_TYPE_STRING;
+- external_object->string.pointer = (NATIVE_CHAR *) data_space;
+- status = acpi_ns_handle_to_pathname ((ACPI_HANDLE *) internal_object->reference.node,
+- &length, (char *) data_space);
+- break;
+-
+- default:
+- /*
+- * Use the object type of "Any" to indicate a reference
+- * to object containing a handle to an ACPI named object.
+- */
+- external_object->type = ACPI_TYPE_ANY;
+- external_object->reference.handle = internal_object->reference.node;
+- break;
+- }
+- break;
+-
+-
+- case ACPI_TYPE_PROCESSOR:
+-
+- external_object->processor.proc_id = internal_object->processor.proc_id;
+- external_object->processor.pblk_address = internal_object->processor.address;
+- external_object->processor.pblk_length = internal_object->processor.length;
+- break;
+-
+-
+- case ACPI_TYPE_POWER:
+-
+- external_object->power_resource.system_level =
+- internal_object->power_resource.system_level;
+-
+- external_object->power_resource.resource_order =
+- internal_object->power_resource.resource_order;
+- break;
+-
+-
+- default:
+- /*
+- * There is no corresponding external object type
+- */
+- return (AE_SUPPORT);
+- break;
+- }
+-
+-
+- *buffer_space_used = (u32) ROUND_UP_TO_NATIVE_WORD (length);
+-
+- return (status);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_ielement_to_eelement
+- *
+- * PARAMETERS: ACPI_PKG_CALLBACK
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: Copy one package element to another package element
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_copy_ielement_to_eelement (
+- u8 object_type,
+- ACPI_OPERAND_OBJECT *source_object,
+- ACPI_GENERIC_STATE *state,
+- void *context)
+-{
+- ACPI_STATUS status = AE_OK;
+- ACPI_PKG_INFO *info = (ACPI_PKG_INFO *) context;
+- u32 object_space;
+- u32 this_index;
+- ACPI_OBJECT *target_object;
+-
+-
+- this_index = state->pkg.index;
+- target_object = (ACPI_OBJECT *)
+- &((ACPI_OBJECT *)(state->pkg.dest_object))->package.elements[this_index];
+-
+-
+- switch (object_type)
+- {
+- case 0:
+-
+- /*
+- * This is a simple or null object -- get the size
+- */
+-
+- status = acpi_cm_copy_isimple_to_esimple (source_object,
+- target_object, info->free_space, &object_space);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+-
+- break;
+-
+- case 1:
+-
+- /*
+- * Build the package object
+- */
+- target_object->type = ACPI_TYPE_PACKAGE;
+- target_object->package.count = source_object->package.count;
+- target_object->package.elements = (ACPI_OBJECT *) info->free_space;
+-
+- /*
+- * Pass the new package object back to the package walk routine
+- */
+- state->pkg.this_target_obj = target_object;
+-
+- /*
+- * Save space for the array of objects (Package elements)
+- * update the buffer length counter
+- */
+- object_space = (u32) ROUND_UP_TO_NATIVE_WORD (
+- target_object->package.count * sizeof (ACPI_OBJECT));
+- break;
+-
+- default:
+- return (AE_BAD_PARAMETER);
+- }
+-
+-
+- info->free_space += object_space;
+- info->length += object_space;
+-
+- return (status);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_ipackage_to_epackage
+- *
+- * PARAMETERS: *Internal_object - Pointer to the object we are returning
+- * *Buffer - Where the object is returned
+- * *Space_used - Where the object length is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: This function is called to place a package object in a user
+- * buffer. A package object by definition contains other objects.
+- *
+- * The buffer is assumed to have sufficient space for the object.
+- * The caller must have verified the buffer length needed using the
+- * Acpi_cm_get_object_size function before calling this function.
+- *
+- ******************************************************************************/
+-
+-static ACPI_STATUS
+-acpi_cm_copy_ipackage_to_epackage (
+- ACPI_OPERAND_OBJECT *internal_object,
+- u8 *buffer,
+- u32 *space_used)
+-{
+- ACPI_OBJECT *external_object;
+- ACPI_STATUS status;
+- ACPI_PKG_INFO info;
+-
+-
+- /*
+- * First package at head of the buffer
+- */
+- external_object = (ACPI_OBJECT *) buffer;
+-
+- /*
+- * Free space begins right after the first package
+- */
+- info.length = 0;
+- info.object_space = 0;
+- info.num_packages = 1;
+- info.free_space = buffer + ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+-
+-
+- external_object->type = internal_object->common.type;
+- external_object->package.count = internal_object->package.count;
+- external_object->package.elements = (ACPI_OBJECT *) info.free_space;
+-
+-
+- /*
+- * Build an array of ACPI_OBJECTS in the buffer
+- * and move the free space past it
+- */
+-
+- info.free_space += external_object->package.count *
+- ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+-
+-
+- status = acpi_cm_walk_package_tree (internal_object, external_object,
+- acpi_cm_copy_ielement_to_eelement, &info);
+-
+- *space_used = info.length;
+-
+- return (status);
+-
+-}
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_iobject_to_eobject
+- *
+- * PARAMETERS: *Internal_object - The internal object to be converted
+- * *Buffer_ptr - Where the object is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: This function is called to build an API object to be returned to
+- * the caller.
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_copy_iobject_to_eobject (
+- ACPI_OPERAND_OBJECT *internal_object,
+- ACPI_BUFFER *ret_buffer)
+-{
+- ACPI_STATUS status;
+-
+-
+- if (IS_THIS_OBJECT_TYPE (internal_object, ACPI_TYPE_PACKAGE)) {
+- /*
+- * Package object: Copy all subobjects (including
+- * nested packages)
+- */
+- status = acpi_cm_copy_ipackage_to_epackage (internal_object,
+- ret_buffer->pointer, &ret_buffer->length);
+- }
+-
+- else {
+- /*
+- * Build a simple object (no nested objects)
+- */
+- status = acpi_cm_copy_isimple_to_esimple (internal_object,
+- (ACPI_OBJECT *) ret_buffer->pointer,
+- ((u8 *) ret_buffer->pointer +
+- ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT))),
+- &ret_buffer->length);
+- /*
+- * build simple does not include the object size in the length
+- * so we add it in here
+- */
+- ret_buffer->length += sizeof (ACPI_OBJECT);
+- }
+-
+- return (status);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_esimple_to_isimple
+- *
+- * PARAMETERS: *External_object - The external object to be converted
+- * *Internal_object - Where the internal object is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: This function copies an external object to an internal one.
+- * NOTE: Pointers can be copied, we don't need to copy data.
+- * (The pointers have to be valid in our address space no matter
+- * what we do with them!)
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_copy_esimple_to_isimple (
+- ACPI_OBJECT *external_object,
+- ACPI_OPERAND_OBJECT *internal_object)
+-{
+-
+-
+- internal_object->common.type = (u8) external_object->type;
+-
+- switch (external_object->type)
+- {
+-
+- case ACPI_TYPE_STRING:
+-
+- internal_object->string.length = external_object->string.length;
+- internal_object->string.pointer = external_object->string.pointer;
+- break;
+-
+-
+- case ACPI_TYPE_BUFFER:
+-
+- internal_object->buffer.length = external_object->buffer.length;
+- internal_object->buffer.pointer = external_object->buffer.pointer;
+- break;
+-
+-
+- case ACPI_TYPE_INTEGER:
+- /*
+- * Number is included in the object itself
+- */
+- internal_object->integer.value = external_object->integer.value;
+- break;
+-
+-
+- default:
+- return (AE_CTRL_RETURN_VALUE);
+- break;
+- }
+-
+-
+- return (AE_OK);
+-}
+-
+-
+-#ifdef ACPI_FUTURE_IMPLEMENTATION
+-
+-/* Code to convert packages that are parameters to control methods */
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_epackage_to_ipackage
+- *
+- * PARAMETERS: *Internal_object - Pointer to the object we are returning
+- * *Buffer - Where the object is returned
+- * *Space_used - Where the length of the object is returned
+- *
+- * RETURN: Status - the status of the call
+- *
+- * DESCRIPTION: This function is called to place a package object in a user
+- * buffer. A package object by definition contains other objects.
+- *
+- * The buffer is assumed to have sufficient space for the object.
+- * The caller must have verified the buffer length needed using the
+- * Acpi_cm_get_object_size function before calling this function.
+- *
+- ******************************************************************************/
+-
+-static ACPI_STATUS
+-acpi_cm_copy_epackage_to_ipackage (
+- ACPI_OPERAND_OBJECT *internal_object,
+- u8 *buffer,
+- u32 *space_used)
+-{
+- u8 *free_space;
+- ACPI_OBJECT *external_object;
+- u32 length = 0;
+- u32 this_index;
+- u32 object_space = 0;
+- ACPI_OPERAND_OBJECT *this_internal_obj;
+- ACPI_OBJECT *this_external_obj;
+-
+-
+- /*
+- * First package at head of the buffer
+- */
+- external_object = (ACPI_OBJECT *)buffer;
+-
+- /*
+- * Free space begins right after the first package
+- */
+- free_space = buffer + sizeof(ACPI_OBJECT);
+-
+-
+- external_object->type = internal_object->common.type;
+- external_object->package.count = internal_object->package.count;
+- external_object->package.elements = (ACPI_OBJECT *)free_space;
+-
+-
+- /*
+- * Build an array of ACPI_OBJECTS in the buffer
+- * and move the free space past it
+- */
+-
+- free_space += external_object->package.count * sizeof(ACPI_OBJECT);
+-
+-
+- /* Call Walk_package */
+-
+-}
+-
+-#endif /* Future implementation */
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_eobject_to_iobject
+- *
+- * PARAMETERS: *Internal_object - The external object to be converted
+- * *Buffer_ptr - Where the internal object is returned
+- *
+- * RETURN: Status - the status of the call
+- *
+- * DESCRIPTION: Converts an external object to an internal object.
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_copy_eobject_to_iobject (
+- ACPI_OBJECT *external_object,
+- ACPI_OPERAND_OBJECT *internal_object)
+-{
+- ACPI_STATUS status;
+-
+-
+- if (external_object->type == ACPI_TYPE_PACKAGE) {
+- /*
+- * Package objects contain other objects (which can be objects)
+- * buildpackage does it all
+- *
+- * TBD: Package conversion must be completed and tested
+- * NOTE: this code converts packages as input parameters to
+- * control methods only. This is a very, very rare case.
+- */
+-/*
+- Status = Acpi_cm_copy_epackage_to_ipackage(Internal_object,
+- Ret_buffer->Pointer,
+- &Ret_buffer->Length);
+-*/
+- return (AE_NOT_IMPLEMENTED);
+- }
+-
+- else {
+- /*
+- * Build a simple object (no nested objects)
+- */
+- status = acpi_cm_copy_esimple_to_isimple (external_object, internal_object);
+- /*
+- * build simple does not include the object size in the length
+- * so we add it in here
+- */
+- }
+-
+- return (status);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_ielement_to_ielement
+- *
+- * PARAMETERS: ACPI_PKG_CALLBACK
+- *
+- * RETURN: Status - the status of the call
+- *
+- * DESCRIPTION: Copy one package element to another package element
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_copy_ielement_to_ielement (
+- u8 object_type,
+- ACPI_OPERAND_OBJECT *source_object,
+- ACPI_GENERIC_STATE *state,
+- void *context)
+-{
+- ACPI_STATUS status = AE_OK;
+- u32 this_index;
+- ACPI_OPERAND_OBJECT **this_target_ptr;
+- ACPI_OPERAND_OBJECT *target_object;
+-
+-
+- this_index = state->pkg.index;
+- this_target_ptr = (ACPI_OPERAND_OBJECT **)
+- &state->pkg.dest_object->package.elements[this_index];
+-
+- switch (object_type)
+- {
+- case 0:
+-
+- /*
+- * This is a simple object, just copy it
+- */
+- target_object = acpi_cm_create_internal_object (source_object->common.type);
+- if (!target_object) {
+- return (AE_NO_MEMORY);
+- }
+-
+- status = acpi_aml_store_object_to_object (source_object, target_object,
+- (ACPI_WALK_STATE *) context);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+-
+- *this_target_ptr = target_object;
+- break;
+-
+-
+- case 1:
+- /*
+- * This object is a package - go down another nesting level
+- * Create and build the package object
+- */
+- target_object = acpi_cm_create_internal_object (ACPI_TYPE_PACKAGE);
+- if (!target_object) {
+- /* TBD: must delete package created up to this point */
+-
+- return (AE_NO_MEMORY);
+- }
+-
+- target_object->package.count = source_object->package.count;
+-
+- /*
+- * Pass the new package object back to the package walk routine
+- */
+- state->pkg.this_target_obj = target_object;
+-
+- /*
+- * Store the object pointer in the parent package object
+- */
+- *this_target_ptr = target_object;
+- break;
+-
+- default:
+- return (AE_BAD_PARAMETER);
+- }
+-
+-
+- return (status);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_copy_ipackage_to_ipackage
+- *
+- * PARAMETERS: *Source_obj - Pointer to the source package object
+- * *Dest_obj - Where the internal object is returned
+- *
+- * RETURN: Status - the status of the call
+- *
+- * DESCRIPTION: This function is called to copy an internal package object
+- * into another internal package object.
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_copy_ipackage_to_ipackage (
+- ACPI_OPERAND_OBJECT *source_obj,
+- ACPI_OPERAND_OBJECT *dest_obj,
+- ACPI_WALK_STATE *walk_state)
+-{
+- ACPI_STATUS status = AE_OK;
+-
+-
+- dest_obj->common.type = source_obj->common.type;
+- dest_obj->package.count = source_obj->package.count;
+-
+-
+- /*
+- * Create the object array and walk the source package tree
+- */
+-
+- dest_obj->package.elements = acpi_cm_callocate ((source_obj->package.count + 1) *
+- sizeof (void *));
+- dest_obj->package.next_element = dest_obj->package.elements;
+-
+- if (!dest_obj->package.elements) {
+- REPORT_ERROR (
+- ("Aml_build_copy_internal_package_object: Package allocation failure\n"));
+- return (AE_NO_MEMORY);
+- }
+-
+-
+- status = acpi_cm_walk_package_tree (source_obj, dest_obj,
+- acpi_cm_copy_ielement_to_ielement, walk_state);
+-
+- return (status);
+-}
+-
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmdebug.c linux/drivers/acpi/common/cmdebug.c
+--- /usr/src/linux/drivers/acpi/common/cmdebug.c Mon Jan 22 13:23:42 2001
++++ linux/drivers/acpi/common/cmdebug.c Wed Dec 31 16:00:00 1969
+@@ -1,559 +0,0 @@
+-/******************************************************************************
+- *
+- * Module Name: cmdebug - Debug print routines
+- * $Revision: 64 $
+- *
+- *****************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-
+-#include "acpi.h"
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmdebug")
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Get/Set debug level
+- *
+- * DESCRIPTION: Get or set value of the debug flag
+- *
+- * These are used to allow user's to get/set the debug level
+- *
+- ****************************************************************************/
+-
+-
+-u32
+-get_debug_level (void)
+-{
+-
+- return (acpi_dbg_level);
+-}
+-
+-void
+-set_debug_level (
+- u32 new_debug_level)
+-{
+-
+- acpi_dbg_level = new_debug_level;
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_trace
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level
+- *
+- ****************************************************************************/
+-
+-void
+-function_trace (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name)
+-{
+-
+- acpi_gbl_nesting_level++;
+-
+- debug_print (module_name, line_number, component_id,
+- TRACE_FUNCTIONS,
+- " %2.2ld Entered Function: %s\n",
+- acpi_gbl_nesting_level, function_name);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_trace_ptr
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- * Pointer - Pointer to display
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level
+- *
+- ****************************************************************************/
+-
+-void
+-function_trace_ptr (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name,
+- void *pointer)
+-{
+-
+- acpi_gbl_nesting_level++;
+- debug_print (module_name, line_number, component_id, TRACE_FUNCTIONS,
+- " %2.2ld Entered Function: %s, %p\n",
+- acpi_gbl_nesting_level, function_name, pointer);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_trace_str
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- * String - Additional string to display
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level
+- *
+- ****************************************************************************/
+-
+-void
+-function_trace_str (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name,
+- NATIVE_CHAR *string)
+-{
+-
+- acpi_gbl_nesting_level++;
+- debug_print (module_name, line_number, component_id, TRACE_FUNCTIONS,
+- " %2.2ld Entered Function: %s, %s\n",
+- acpi_gbl_nesting_level, function_name, string);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_trace_u32
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- * Integer - Integer to display
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level
+- *
+- ****************************************************************************/
+-
+-void
+-function_trace_u32 (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name,
+- u32 integer)
+-{
+-
+- acpi_gbl_nesting_level++;
+- debug_print (module_name, line_number, component_id, TRACE_FUNCTIONS,
+- " %2.2ld Entered Function: %s, %lX\n",
+- acpi_gbl_nesting_level, function_name, integer);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_exit
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level
+- *
+- ****************************************************************************/
+-
+-void
+-function_exit (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name)
+-{
+-
+- debug_print (module_name, line_number, component_id, TRACE_FUNCTIONS,
+- " %2.2ld Exiting Function: %s\n",
+- acpi_gbl_nesting_level, function_name);
+-
+- acpi_gbl_nesting_level--;
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_status_exit
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- * Status - Exit status code
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level. Prints exit status also.
+- *
+- ****************************************************************************/
+-
+-void
+-function_status_exit (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name,
+- ACPI_STATUS status)
+-{
+-
+- debug_print (module_name, line_number, component_id,
+- TRACE_FUNCTIONS,
+- " %2.2ld Exiting Function: %s, %s\n",
+- acpi_gbl_nesting_level,
+- function_name,
+- acpi_cm_format_exception (status));
+-
+- acpi_gbl_nesting_level--;
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_value_exit
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- * Value - Value to be printed with exit msg
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level. Prints exit value also.
+- *
+- ****************************************************************************/
+-
+-void
+-function_value_exit (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name,
+- ACPI_INTEGER value)
+-{
+-
+- debug_print (module_name, line_number, component_id, TRACE_FUNCTIONS,
+- " %2.2ld Exiting Function: %s, %X\n",
+- acpi_gbl_nesting_level, function_name, value);
+-
+- acpi_gbl_nesting_level--;
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Function_ptr_exit
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Function_name - Name of Caller's function
+- * Value - Value to be printed with exit msg
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+- * set in Debug_level. Prints exit value also.
+- *
+- ****************************************************************************/
+-
+-void
+-function_ptr_exit (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- NATIVE_CHAR *function_name,
+- u8 *ptr)
+-{
+-
+- debug_print (module_name, line_number, component_id, TRACE_FUNCTIONS,
+- " %2.2ld Exiting Function: %s, %p\n",
+- acpi_gbl_nesting_level, function_name, ptr);
+-
+- acpi_gbl_nesting_level--;
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Debug_print
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- * Print_level - Requested debug print level
+- * Format - Printf format field
+- * ... - Optional printf arguments
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Print error message with prefix consisting of the module name,
+- * line number, and component ID.
+- *
+- ****************************************************************************/
+-
+-void
+-debug_print (
+- NATIVE_CHAR *module_name,
+- u32 line_number,
+- u32 component_id,
+- u32 print_level,
+- NATIVE_CHAR *format,
+- ...)
+-{
+- va_list args;
+-
+-
+- /* Both the level and the component must be enabled */
+-
+- if ((print_level & acpi_dbg_level) &&
+- (component_id & acpi_dbg_layer))
+- {
+- va_start (args, format);
+-
+- acpi_os_printf ("%8s-%04d: ", module_name, line_number);
+- acpi_os_vprintf (format, args);
+- }
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Debug_print_prefix
+- *
+- * PARAMETERS: Module_name - Caller's module name (for error output)
+- * Line_number - Caller's line number (for error output)
+- * Component_id - Caller's component ID (for error output)
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Print the prefix part of an error message, consisting of the
+- * module name, and line number
+- *
+- ****************************************************************************/
+-
+-void
+-debug_print_prefix (
+- NATIVE_CHAR *module_name,
+- u32 line_number)
+-{
+-
+-
+- acpi_os_printf ("%8s-%04d: ", module_name, line_number);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Debug_print_raw
+- *
+- * PARAMETERS: Format - Printf format field
+- * ... - Optional printf arguments
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Print error message -- without module/line indentifiers
+- *
+- ****************************************************************************/
+-
+-void
+-debug_print_raw (
+- NATIVE_CHAR *format,
+- ...)
+-{
+- va_list args;
+-
+-
+- va_start (args, format);
+-
+- acpi_os_vprintf (format, args);
+-
+- va_end (args);
+-}
+-
+-
+-/*****************************************************************************
+- *
+- * FUNCTION: Acpi_cm_dump_buffer
+- *
+- * PARAMETERS: Buffer - Buffer to dump
+- * Count - Amount to dump, in bytes
+- * Component_iD - Caller's component ID
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Generic dump buffer in both hex and ascii.
+- *
+- ****************************************************************************/
+-
+-void
+-acpi_cm_dump_buffer (
+- u8 *buffer,
+- u32 count,
+- u32 display,
+- u32 component_id)
+-{
+- u32 i = 0;
+- u32 j;
+- u32 temp32;
+- u8 buf_char;
+-
+-
+- /* Only dump the buffer if tracing is enabled */
+-
+- if (!((TRACE_TABLES & acpi_dbg_level) &&
+- (component_id & acpi_dbg_layer)))
+- {
+- return;
+- }
+-
+-
+- /*
+- * Nasty little dump buffer routine!
+- */
+- while (i < count) {
+- /* Print current offset */
+-
+- acpi_os_printf ("%05X ", i);
+-
+-
+- /* Print 16 hex chars */
+-
+- for (j = 0; j < 16;) {
+- if (i + j >= count) {
+- acpi_os_printf ("\n");
+- return;
+- }
+-
+- /* Make sure that the s8 doesn't get sign-extended! */
+-
+- switch (display)
+- {
+- /* Default is BYTE display */
+-
+- default:
+-
+- acpi_os_printf ("%02X ",
+- *((u8 *) &buffer[i + j]));
+- j += 1;
+- break;
+-
+-
+- case DB_WORD_DISPLAY:
+-
+- MOVE_UNALIGNED16_TO_32 (&temp32,
+- &buffer[i + j]);
+- acpi_os_printf ("%04X ", temp32);
+- j += 2;
+- break;
+-
+-
+- case DB_DWORD_DISPLAY:
+-
+- MOVE_UNALIGNED32_TO_32 (&temp32,
+- &buffer[i + j]);
+- acpi_os_printf ("%08X ", temp32);
+- j += 4;
+- break;
+-
+-
+- case DB_QWORD_DISPLAY:
+-
+- MOVE_UNALIGNED32_TO_32 (&temp32,
+- &buffer[i + j]);
+- acpi_os_printf ("%08X", temp32);
+-
+- MOVE_UNALIGNED32_TO_32 (&temp32,
+- &buffer[i + j + 4]);
+- acpi_os_printf ("%08X ", temp32);
+- j += 8;
+- break;
+- }
+- }
+-
+-
+- /*
+- * Print the ASCII equivalent characters
+- * But watch out for the bad unprintable ones...
+- */
+-
+- for (j = 0; j < 16; j++) {
+- if (i + j >= count) {
+- acpi_os_printf ("\n");
+- return;
+- }
+-
+- buf_char = buffer[i + j];
+- if ((buf_char > 0x1F && buf_char < 0x2E) ||
+- (buf_char > 0x2F && buf_char < 0x61) ||
+- (buf_char > 0x60 && buf_char < 0x7F))
+- {
+- acpi_os_printf ("%c", buf_char);
+- }
+- else {
+- acpi_os_printf (".");
+- }
+- }
+-
+- /* Done with that line. */
+-
+- acpi_os_printf ("\n");
+- i += 16;
+- }
+-
+- return;
+-}
+-
+-
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmdelete.c linux/drivers/acpi/common/cmdelete.c
+--- /usr/src/linux/drivers/acpi/common/cmdelete.c Mon Jan 22 13:23:42 2001
++++ linux/drivers/acpi/common/cmdelete.c Wed Dec 31 16:00:00 1969
+@@ -1,591 +0,0 @@
+-/*******************************************************************************
+- *
+- * Module Name: cmdelete - object deletion and reference count utilities
+- * $Revision: 62 $
+- *
+- ******************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-
+-#include "acpi.h"
+-#include "acinterp.h"
+-#include "acnamesp.h"
+-#include "actables.h"
+-#include "acparser.h"
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmdelete")
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_delete_internal_obj
+- *
+- * PARAMETERS: *Object - Pointer to the list to be deleted
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Low level object deletion, after reference counts have been
+- * updated (All reference counts, including sub-objects!)
+- *
+- ******************************************************************************/
+-
+-void
+-acpi_cm_delete_internal_obj (
+- ACPI_OPERAND_OBJECT *object)
+-{
+- void *obj_pointer = NULL;
+- ACPI_OPERAND_OBJECT *handler_desc;
+-
+-
+- if (!object) {
+- return;
+- }
+-
+- /*
+- * Must delete or free any pointers within the object that are not
+- * actual ACPI objects (for example, a raw buffer pointer).
+- */
+-
+- switch (object->common.type)
+- {
+-
+- case ACPI_TYPE_STRING:
+-
+- /* Free the actual string buffer */
+-
+- obj_pointer = object->string.pointer;
+- break;
+-
+-
+- case ACPI_TYPE_BUFFER:
+-
+- /* Free the actual buffer */
+-
+- obj_pointer = object->buffer.pointer;
+- break;
+-
+-
+- case ACPI_TYPE_PACKAGE:
+-
+- /*
+- * Elements of the package are not handled here, they are deleted
+- * separately
+- */
+-
+- /* Free the (variable length) element pointer array */
+-
+- obj_pointer = object->package.elements;
+- break;
+-
+-
+- case ACPI_TYPE_MUTEX:
+-
+- acpi_os_delete_semaphore (object->mutex.semaphore);
+- break;
+-
+-
+- case ACPI_TYPE_EVENT:
+-
+- acpi_os_delete_semaphore (object->event.semaphore);
+- object->event.semaphore = NULL;
+- break;
+-
+-
+- case ACPI_TYPE_METHOD:
+-
+- /* Delete the method semaphore if it exists */
+-
+- if (object->method.semaphore) {
+- acpi_os_delete_semaphore (object->method.semaphore);
+- object->method.semaphore = NULL;
+- }
+-
+- break;
+-
+-
+- case ACPI_TYPE_REGION:
+-
+-
+- if (object->region.extra) {
+- /*
+- * Free the Region_context if and only if the handler is one of the
+- * default handlers -- and therefore, we created the context object
+- * locally, it was not created by an external caller.
+- */
+- handler_desc = object->region.addr_handler;
+- if ((handler_desc) &&
+- (handler_desc->addr_handler.hflags == ADDR_HANDLER_DEFAULT_INSTALLED))
+- {
+- obj_pointer = object->region.extra->extra.region_context;
+- }
+-
+- /* Now we can free the Extra object */
+-
+- acpi_cm_delete_object_desc (object->region.extra);
+- }
+- break;
+-
+-
+- case ACPI_TYPE_FIELD_UNIT:
+-
+- if (object->field_unit.extra) {
+- acpi_cm_delete_object_desc (object->field_unit.extra);
+- }
+- break;
+-
+- default:
+- break;
+- }
+-
+-
+- /*
+- * Delete any allocated memory found above
+- */
+-
+- if (obj_pointer) {
+- if (!acpi_tb_system_table_pointer (obj_pointer)) {
+- acpi_cm_free (obj_pointer);
+- }
+- }
+-
+-
+- /* Only delete the object if it was dynamically allocated */
+-
+-
+- if (!(object->common.flags & AOPOBJ_STATIC_ALLOCATION)) {
+- acpi_cm_delete_object_desc (object);
+-
+- }
+-
+- return;
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_delete_internal_object_list
+- *
+- * PARAMETERS: *Obj_list - Pointer to the list to be deleted
+- *
+- * RETURN: Status - the status of the call
+- *
+- * DESCRIPTION: This function deletes an internal object list, including both
+- * simple objects and package objects
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_delete_internal_object_list (
+- ACPI_OPERAND_OBJECT **obj_list)
+-{
+- ACPI_OPERAND_OBJECT **internal_obj;
+-
+-
+- /* Walk the null-terminated internal list */
+-
+- for (internal_obj = obj_list; *internal_obj; internal_obj++) {
+- /*
+- * Check for a package
+- * Simple objects are simply stored in the array and do not
+- * need to be deleted separately.
+- */
+-
+- if (IS_THIS_OBJECT_TYPE ((*internal_obj), ACPI_TYPE_PACKAGE)) {
+- /* Delete the package */
+-
+- /*
+- * TBD: [Investigate] This might not be the right thing to do,
+- * depending on how the internal package object was allocated!!!
+- */
+- acpi_cm_delete_internal_obj (*internal_obj);
+- }
+-
+- }
+-
+- /* Free the combined parameter pointer list and object array */
+-
+- acpi_cm_free (obj_list);
+-
+- return (AE_OK);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_update_ref_count
+- *
+- * PARAMETERS: *Object - Object whose ref count is to be updated
+- * Action - What to do
+- *
+- * RETURN: New ref count
+- *
+- * DESCRIPTION: Modify the ref count and return it.
+- *
+- ******************************************************************************/
+-
+-static void
+-acpi_cm_update_ref_count (
+- ACPI_OPERAND_OBJECT *object,
+- u32 action)
+-{
+- u16 count;
+- u16 new_count;
+-
+-
+- if (!object) {
+- return;
+- }
+-
+-
+- count = object->common.reference_count;
+- new_count = count;
+-
+- /*
+- * Reference count action (increment, decrement, or force delete)
+- */
+-
+- switch (action)
+- {
+-
+- case REF_INCREMENT:
+-
+- new_count++;
+- object->common.reference_count = new_count;
+-
+- break;
+-
+-
+- case REF_DECREMENT:
+-
+- if (count < 1) {
+- new_count = 0;
+- }
+-
+- else {
+- new_count--;
+-
+- }
+-
+-
+- object->common.reference_count = new_count;
+- if (new_count == 0) {
+- acpi_cm_delete_internal_obj (object);
+- }
+-
+- break;
+-
+-
+- case REF_FORCE_DELETE:
+-
+- new_count = 0;
+- object->common.reference_count = new_count;
+- acpi_cm_delete_internal_obj (object);
+- break;
+-
+-
+- default:
+-
+- break;
+- }
+-
+-
+- /*
+- * Sanity check the reference count, for debug purposes only.
+- * (A deleted object will have a huge reference count)
+- */
+-
+-
+- return;
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_update_object_reference
+- *
+- * PARAMETERS: *Object - Increment ref count for this object
+- * and all sub-objects
+- * Action - Either REF_INCREMENT or REF_DECREMENT or
+- * REF_FORCE_DELETE
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: Increment the object reference count
+- *
+- * Object references are incremented when:
+- * 1) An object is attached to a Node (namespace object)
+- * 2) An object is copied (all subobjects must be incremented)
+- *
+- * Object references are decremented when:
+- * 1) An object is detached from an Node
+- *
+- ******************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_update_object_reference (
+- ACPI_OPERAND_OBJECT *object,
+- u16 action)
+-{
+- ACPI_STATUS status;
+- u32 i;
+- ACPI_OPERAND_OBJECT *next;
+- ACPI_OPERAND_OBJECT *new;
+- ACPI_GENERIC_STATE *state_list = NULL;
+- ACPI_GENERIC_STATE *state;
+-
+-
+- /* Ignore a null object ptr */
+-
+- if (!object) {
+- return (AE_OK);
+- }
+-
+-
+- /*
+- * Make sure that this isn't a namespace handle or an AML pointer
+- */
+-
+- if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED)) {
+- return (AE_OK);
+- }
+-
+- if (acpi_tb_system_table_pointer (object)) {
+- return (AE_OK);
+- }
+-
+-
+- state = acpi_cm_create_update_state (object, action);
+-
+- while (state) {
+-
+- object = state->update.object;
+- action = state->update.value;
+- acpi_cm_delete_generic_state (state);
+-
+- /*
+- * All sub-objects must have their reference count incremented also.
+- * Different object types have different subobjects.
+- */
+- switch (object->common.type)
+- {
+-
+- case ACPI_TYPE_DEVICE:
+-
+- status = acpi_cm_create_update_state_and_push (object->device.addr_handler,
+- action, &state_list);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+-
+- acpi_cm_update_ref_count (object->device.sys_handler, action);
+- acpi_cm_update_ref_count (object->device.drv_handler, action);
+- break;
+-
+-
+- case INTERNAL_TYPE_ADDRESS_HANDLER:
+-
+- /* Must walk list of address handlers */
+-
+- next = object->addr_handler.next;
+- while (next) {
+- new = next->addr_handler.next;
+- acpi_cm_update_ref_count (next, action);
+-
+- next = new;
+- }
+- break;
+-
+-
+- case ACPI_TYPE_PACKAGE:
+-
+- /*
+- * We must update all the sub-objects of the package
+- * (Each of whom may have their own sub-objects, etc.
+- */
+- for (i = 0; i < object->package.count; i++) {
+- /*
+- * Push each element onto the stack for later processing.
+- * Note: There can be null elements within the package,
+- * these are simply ignored
+- */
+-
+- status = acpi_cm_create_update_state_and_push (
+- object->package.elements[i], action, &state_list);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+- }
+- break;
+-
+-
+- case ACPI_TYPE_FIELD_UNIT:
+-
+- status = acpi_cm_create_update_state_and_push (
+- object->field_unit.container, action, &state_list);
+-
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+- break;
+-
+-
+- case INTERNAL_TYPE_DEF_FIELD:
+-
+- status = acpi_cm_create_update_state_and_push (
+- object->field.container, action, &state_list);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+- break;
+-
+-
+- case INTERNAL_TYPE_BANK_FIELD:
+-
+- status = acpi_cm_create_update_state_and_push (
+- object->bank_field.bank_select, action, &state_list);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+-
+- status = acpi_cm_create_update_state_and_push (
+- object->bank_field.container, action, &state_list);
+- if (ACPI_FAILURE (status)) {
+- return (status);
+- }
+- break;
+-
+-
+- case ACPI_TYPE_REGION:
+-
+- /* TBD: [Investigate]
+- Acpi_cm_update_ref_count (Object->Region.Addr_handler, Action);
+- */
+-/*
+- Status =
+- Acpi_cm_create_update_state_and_push (Object->Region.Addr_handler,
+- Action, &State_list);
+- if (ACPI_FAILURE (Status)) {
+- return (Status);
+- }
+-*/
+- break;
+-
+-
+- case INTERNAL_TYPE_REFERENCE:
+-
+- break;
+- }
+-
+-
+- /*
+- * Now we can update the count in the main object. This can only
+- * happen after we update the sub-objects in case this causes the
+- * main object to be deleted.
+- */
+-
+- acpi_cm_update_ref_count (object, action);
+-
+-
+- /* Move on to the next object to be updated */
+-
+- state = acpi_cm_pop_generic_state (&state_list);
+- }
+-
+-
+- return (AE_OK);
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_add_reference
+- *
+- * PARAMETERS: *Object - Object whose reference count is to be
+- * incremented
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Add one reference to an ACPI object
+- *
+- ******************************************************************************/
+-
+-void
+-acpi_cm_add_reference (
+- ACPI_OPERAND_OBJECT *object)
+-{
+-
+-
+- /*
+- * Ensure that we have a valid object
+- */
+-
+- if (!acpi_cm_valid_internal_object (object)) {
+- return;
+- }
+-
+- /*
+- * We have a valid ACPI internal object, now increment the reference count
+- */
+-
+- acpi_cm_update_object_reference (object, REF_INCREMENT);
+-
+- return;
+-}
+-
+-
+-/*******************************************************************************
+- *
+- * FUNCTION: Acpi_cm_remove_reference
+- *
+- * PARAMETERS: *Object - Object whose ref count will be decremented
+- *
+- * RETURN: None
+- *
+- * DESCRIPTION: Decrement the reference count of an ACPI internal object
+- *
+- ******************************************************************************/
+-
+-void
+-acpi_cm_remove_reference (
+- ACPI_OPERAND_OBJECT *object)
+-{
+-
+-
+- /*
+- * Ensure that we have a valid object
+- */
+-
+- if (!acpi_cm_valid_internal_object (object)) {
+- return;
+- }
+-
+- /*
+- * Decrement the reference count, and only actually delete the object
+- * if the reference count becomes 0. (Must also decrement the ref count
+- * of all subobjects!)
+- */
+-
+- acpi_cm_update_object_reference (object, REF_DECREMENT);
+-
+- return;
+-}
+-
+-
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmeval.c linux/drivers/acpi/common/cmeval.c
+--- /usr/src/linux/drivers/acpi/common/cmeval.c Mon Jan 22 13:23:42 2001
++++ linux/drivers/acpi/common/cmeval.c Wed Dec 31 16:00:00 1969
+@@ -1,308 +0,0 @@
+-/******************************************************************************
+- *
+- * Module Name: cmeval - Object evaluation
+- * $Revision: 21 $
+- *
+- *****************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-
+-#include "acpi.h"
+-#include "acnamesp.h"
+-#include "acinterp.h"
+-
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmeval")
+-
+-
+-/****************************************************************************
+- *
+- * FUNCTION: Acpi_cm_evaluate_numeric_object
+- *
+- * PARAMETERS: *Object_name - Object name to be evaluated
+- * Device_node - Node for the device
+- * *Address - Where the value is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: evaluates a numeric namespace object for a selected device
+- * and stores results in *Address.
+- *
+- * NOTE: Internal function, no parameter validation
+- *
+- ***************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_evaluate_numeric_object (
+- NATIVE_CHAR *object_name,
+- ACPI_NAMESPACE_NODE *device_node,
+- ACPI_INTEGER *address)
+-{
+- ACPI_OPERAND_OBJECT *obj_desc;
+- ACPI_STATUS status;
+-
+-
+- /* Execute the method */
+-
+- status = acpi_ns_evaluate_relative (device_node, object_name, NULL, &obj_desc);
+- if (ACPI_FAILURE (status)) {
+-
+- return (status);
+- }
+-
+-
+- /* Did we get a return object? */
+-
+- if (!obj_desc) {
+- return (AE_TYPE);
+- }
+-
+- /* Is the return object of the correct type? */
+-
+- if (obj_desc->common.type != ACPI_TYPE_INTEGER) {
+- status = AE_TYPE;
+- }
+- else {
+- /*
+- * Since the structure is a union, setting any field will set all
+- * of the variables in the union
+- */
+- *address = obj_desc->integer.value;
+- }
+-
+- /* On exit, we must delete the return object */
+-
+- acpi_cm_remove_reference (obj_desc);
+-
+- return (status);
+-}
+-
+-
+-/****************************************************************************
+- *
+- * FUNCTION: Acpi_cm_execute_HID
+- *
+- * PARAMETERS: Device_node - Node for the device
+- * *Hid - Where the HID is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: Executes the _HID control method that returns the hardware
+- * ID of the device.
+- *
+- * NOTE: Internal function, no parameter validation
+- *
+- ***************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_execute_HID (
+- ACPI_NAMESPACE_NODE *device_node,
+- DEVICE_ID *hid)
+-{
+- ACPI_OPERAND_OBJECT *obj_desc;
+- ACPI_STATUS status;
+-
+-
+- /* Execute the method */
+-
+- status = acpi_ns_evaluate_relative (device_node,
+- METHOD_NAME__HID, NULL, &obj_desc);
+- if (ACPI_FAILURE (status)) {
+-
+-
+- return (status);
+- }
+-
+- /* Did we get a return object? */
+-
+- if (!obj_desc) {
+- return (AE_TYPE);
+- }
+-
+- /*
+- * A _HID can return either a Number (32 bit compressed EISA ID) or
+- * a string
+- */
+-
+- if ((obj_desc->common.type != ACPI_TYPE_INTEGER) &&
+- (obj_desc->common.type != ACPI_TYPE_STRING))
+- {
+- status = AE_TYPE;
+- }
+-
+- else {
+- if (obj_desc->common.type == ACPI_TYPE_INTEGER) {
+- /* Convert the Numeric HID to string */
+-
+- acpi_aml_eisa_id_to_string ((u32) obj_desc->integer.value, hid->buffer);
+- }
+-
+- else {
+- /* Copy the String HID from the returned object */
+-
+- STRNCPY(hid->buffer, obj_desc->string.pointer, sizeof(hid->buffer));
+- }
+- }
+-
+-
+- /* On exit, we must delete the return object */
+-
+- acpi_cm_remove_reference (obj_desc);
+-
+- return (status);
+-}
+-
+-
+-/****************************************************************************
+- *
+- * FUNCTION: Acpi_cm_execute_UID
+- *
+- * PARAMETERS: Device_node - Node for the device
+- * *Uid - Where the UID is returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: Executes the _UID control method that returns the hardware
+- * ID of the device.
+- *
+- * NOTE: Internal function, no parameter validation
+- *
+- ***************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_execute_UID (
+- ACPI_NAMESPACE_NODE *device_node,
+- DEVICE_ID *uid)
+-{
+- ACPI_OPERAND_OBJECT *obj_desc;
+- ACPI_STATUS status;
+-
+-
+- /* Execute the method */
+-
+- status = acpi_ns_evaluate_relative (device_node,
+- METHOD_NAME__UID, NULL, &obj_desc);
+- if (ACPI_FAILURE (status)) {
+-
+-
+- return (status);
+- }
+-
+- /* Did we get a return object? */
+-
+- if (!obj_desc) {
+- return (AE_TYPE);
+- }
+-
+- /*
+- * A _UID can return either a Number (32 bit compressed EISA ID) or
+- * a string
+- */
+-
+- if ((obj_desc->common.type != ACPI_TYPE_INTEGER) &&
+- (obj_desc->common.type != ACPI_TYPE_STRING))
+- {
+- status = AE_TYPE;
+- }
+-
+- else {
+- if (obj_desc->common.type == ACPI_TYPE_INTEGER) {
+- /* Convert the Numeric UID to string */
+-
+- acpi_aml_unsigned_integer_to_string (obj_desc->integer.value, uid->buffer);
+- }
+-
+- else {
+- /* Copy the String UID from the returned object */
+-
+- STRNCPY(uid->buffer, obj_desc->string.pointer, sizeof(uid->buffer));
+- }
+- }
+-
+-
+- /* On exit, we must delete the return object */
+-
+- acpi_cm_remove_reference (obj_desc);
+-
+- return (status);
+-}
+-
+-/****************************************************************************
+- *
+- * FUNCTION: Acpi_cm_execute_STA
+- *
+- * PARAMETERS: Device_node - Node for the device
+- * *Flags - Where the status flags are returned
+- *
+- * RETURN: Status
+- *
+- * DESCRIPTION: Executes _STA for selected device and stores results in
+- * *Flags.
+- *
+- * NOTE: Internal function, no parameter validation
+- *
+- ***************************************************************************/
+-
+-ACPI_STATUS
+-acpi_cm_execute_STA (
+- ACPI_NAMESPACE_NODE *device_node,
+- u32 *flags)
+-{
+- ACPI_OPERAND_OBJECT *obj_desc;
+- ACPI_STATUS status;
+-
+-
+- /* Execute the method */
+-
+- status = acpi_ns_evaluate_relative (device_node,
+- METHOD_NAME__STA, NULL, &obj_desc);
+- if (AE_NOT_FOUND == status) {
+- *flags = 0x0F;
+- status = AE_OK;
+- }
+-
+-
+- else /* success */ {
+- /* Did we get a return object? */
+-
+- if (!obj_desc) {
+- return (AE_TYPE);
+- }
+-
+- /* Is the return object of the correct type? */
+-
+- if (obj_desc->common.type != ACPI_TYPE_INTEGER) {
+- status = AE_TYPE;
+- }
+-
+- else {
+- /* Extract the status flags */
+-
+- *flags = (u32) obj_desc->integer.value;
+- }
+-
+- /* On exit, we must delete the return object */
+-
+- acpi_cm_remove_reference (obj_desc);
+- }
+-
+- return (status);
+-}
+diff -Naur -X bin/dontdiff /usr/src/linux/drivers/acpi/common/cmglobal.c linux/drivers/acpi/common/cmglobal.c
+--- /usr/src/linux/drivers/acpi/common/cmglobal.c Mon Jan 22 13:23:42 2001
++++ linux/drivers/acpi/common/cmglobal.c Wed Dec 31 16:00:00 1969
+@@ -1,472 +0,0 @@
+-/******************************************************************************
+- *
+- * Module Name: cmglobal - Global variables for the ACPI subsystem
+- * $Revision: 116 $
+- *
+- *****************************************************************************/
+-
+-/*
+- * Copyright (C) 2000, 2001 R. Byron Moore
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#define DEFINE_ACPI_GLOBALS
+-
+-#include "acpi.h"
+-#include "acevents.h"
+-#include "acnamesp.h"
+-#include "acinterp.h"
+-#include "amlcode.h"
+-
+-
+-#define _COMPONENT MISCELLANEOUS
+- MODULE_NAME ("cmglobal")
+-
+-
+-/******************************************************************************
+- *
+- * Static global variable initialization.
+- *
+- ******************************************************************************/
+-
+-/*
+- * We want the debug switches statically initialized so they
+- * are already set when the debugger is entered.
+- */
+-
+-/* Debug switch - level and trace mask */
+-
+-u32 acpi_dbg_level = NORMAL_DEFAULT;
+-
+-/* Debug switch - layer (component) mask */
+-
+-u32 acpi_dbg_layer = COMPONENT_DEFAULT;
+-u32 acpi_gbl_nesting_level = 0;
+-
+-
+-/* Debugger globals */
+-
+-u8 acpi_gbl_db_terminate_threads = FALSE;
+-u8 acpi_gbl_method_executing = FALSE;
+-
+-/* System flags */
+-
+-u32 acpi_gbl_system_flags = 0;
+-u32 acpi_gbl_startup_flags = 0;
+-
+-/* System starts unitialized! */
+-u8 acpi_gbl_shutdown = TRUE;
+-
+-
+-u8 acpi_gbl_decode_to8bit [8] = {1,2,4,8,16,32,64,128};
+-
+-
+-/******************************************************************************
+- *
+- * Namespace globals
+- *
+- ******************************************************************************/
+-
+-
+-/*
+- * Names built-in to the interpreter
+- *
+- * Initial values are currently supported only for types String and Number.
+- * To avoid type punning, both are specified as strings in this table.
+- */
+-
+-PREDEFINED_NAMES acpi_gbl_pre_defined_names[] =
+-{
+- {"_GPE", INTERNAL_TYPE_DEF_ANY},
+- {"_PR_", INTERNAL_TYPE_DEF_ANY},
+- {"_SB_", INTERNAL_TYPE_DEF_ANY},
+- {"_SI_", INTERNAL_TYPE_DEF_ANY},
+- {"_TZ_", INTERNAL_TYPE_DEF_ANY},
+- {"_REV", ACPI_TYPE_INTEGER, "2"},
+- {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
+- {"_GL_", ACPI_TYPE_MUTEX, "0"},
+-
+- /* Table terminator */
+-
+- {NULL, ACPI_TYPE_ANY}
+-};
+-
+-
+-/*
+- * Properties of the ACPI Object Types, both internal and external.
+- *
+- * Elements of Acpi_ns_properties are bit significant
+- * and the table is indexed by values of ACPI_OBJECT_TYPE
+- */
+-
+-u8 acpi_gbl_ns_properties[] =
+-{
+- NSP_NORMAL, /* 00 Any */
+- NSP_NORMAL, /* 01 Number */
+- NSP_NORMAL, /* 02 String */
+- NSP_NORMAL, /* 03 Buffer */
+- NSP_LOCAL, /* 04 Package */
+- NSP_NORMAL, /* 05 Field_unit */
+- NSP_NEWSCOPE | NSP_LOCAL, /* 06 Device */
+- NSP_LOCAL, /* 07 Acpi_event */
+- NSP_NEWSCOPE | NSP_LOCAL, /* 08 Method */
+- NSP_LOCAL, /* 09 Mutex */
+- NSP_LOCAL, /* 10 Region */
+- NSP_NEWSCOPE | NSP_LOCAL, /* 11 Power */
+- NSP_NEWSCOPE | NSP_LOCAL, /* 12 Processor */
+- NSP_NEWSCOPE | NSP_LOCAL, /* 13 Thermal */
+- NSP_NORMAL, /* 14 Buffer_field */
+- NSP_NORMAL, /* 15 Ddb_handle */
+- NSP_NORMAL, /* 16 Debug Object */
+- NSP_NORMAL, /* 17 Def_field */
+- NSP_NORMAL, /* 18 Bank_field */
+- NSP_NORMAL, /* 19 Index_field */
+- NSP_NORMAL, /* 20 Reference */
+- NSP_NORMAL, /* 21 Alias */
+- NSP_NORMAL, /* 22 Notify */
+- NSP_NORMAL, /* 23 Address Handler */
+- NSP_NEWSCOPE | NSP_LOCAL, /* 24 Resource */
+- NSP_NORMAL, /* 25 Def_field_defn */
+- NSP_NORMAL, /* 26 Bank_field_defn */
+- NSP_NORMAL, /* 27 Index_field_defn */
+- NSP_NORMAL, /* 28 If */
+- NSP_NORMAL, /* 29 Else */
+- NSP_NORMAL, /* 30 While */
+- NSP_NEWSCOPE, /* 31 Scope */
+- NSP_LOCAL, /* 32 Def_any */
+- NSP_NORMAL, /* 33 Extra */
+- NSP_NORMAL /* 34 Invalid */
+-};
+-
+-
+-/* Hex to ASCII conversion table */
+-
+-NATIVE_CHAR acpi_gbl_hex_to_ascii[] =
+- {'0','1','2','3','4','5','6','7',
|