From 8c34ca53327f2eccafdb2a069625ae881d03ca95 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 23 Jul 2012 21:01:02 +0200 Subject: [PATCH] --- yaml --- r: 321380 b: refs/heads/master c: a5ca7345c1e67cd12cf75a9ec034c7d34786ae79 h: refs/heads/master v: v3 --- [refs] | 2 +- .../bindings/thermal/spear-thermal.txt | 14 - trunk/Documentation/thermal/sysfs-api.txt | 30 +- trunk/MAINTAINERS | 7 + trunk/arch/x86/kernel/acpi/sleep.c | 4 + trunk/arch/x86/kernel/acpi/sleep.h | 2 + trunk/arch/x86/kernel/acpi/wakeup_32.S | 4 +- trunk/arch/x86/kernel/acpi/wakeup_64.S | 4 +- trunk/drivers/acpi/ac.c | 4 +- trunk/drivers/acpi/acpi_memhotplug.c | 43 +- trunk/drivers/acpi/acpi_pad.c | 4 +- trunk/drivers/acpi/acpica/Makefile | 2 - trunk/drivers/acpi/acpica/acevents.h | 2 +- trunk/drivers/acpi/acpica/acglobal.h | 19 +- trunk/drivers/acpi/acpica/achware.h | 12 +- trunk/drivers/acpi/acpica/aclocal.h | 43 +- trunk/drivers/acpi/acpica/acmacros.h | 6 +- trunk/drivers/acpi/acpica/acobject.h | 15 +- trunk/drivers/acpi/acpica/acpredef.h | 8 +- trunk/drivers/acpi/acpica/acstruct.h | 2 +- trunk/drivers/acpi/acpica/acutils.h | 2 - trunk/drivers/acpi/acpica/amlcode.h | 4 +- trunk/drivers/acpi/acpica/amlresrc.h | 4 +- trunk/drivers/acpi/acpica/dsargs.c | 2 +- trunk/drivers/acpi/acpica/dscontrol.c | 4 +- trunk/drivers/acpi/acpica/dsfield.c | 103 +- trunk/drivers/acpi/acpica/dsinit.c | 4 +- trunk/drivers/acpi/acpica/dsmethod.c | 6 +- trunk/drivers/acpi/acpica/dsmthdat.c | 32 +- trunk/drivers/acpi/acpica/dsobject.c | 14 +- trunk/drivers/acpi/acpica/dsopcode.c | 12 +- trunk/drivers/acpi/acpica/dsutils.c | 6 +- trunk/drivers/acpi/acpica/dswscope.c | 4 +- trunk/drivers/acpi/acpica/dswstate.c | 20 +- trunk/drivers/acpi/acpica/evevent.c | 2 +- trunk/drivers/acpi/acpica/evglock.c | 4 +- trunk/drivers/acpi/acpica/evgpe.c | 22 +- trunk/drivers/acpi/acpica/evgpeblk.c | 2 +- trunk/drivers/acpi/acpica/evgpeutil.c | 22 +- trunk/drivers/acpi/acpica/evmisc.c | 191 ++- trunk/drivers/acpi/acpica/evregion.c | 24 +- trunk/drivers/acpi/acpica/evrgnini.c | 28 +- trunk/drivers/acpi/acpica/evsci.c | 4 +- trunk/drivers/acpi/acpica/evxface.c | 474 ++++-- trunk/drivers/acpi/acpica/evxfevnt.c | 8 +- trunk/drivers/acpi/acpica/evxfgpe.c | 112 +- trunk/drivers/acpi/acpica/evxfregn.c | 18 +- trunk/drivers/acpi/acpica/exconfig.c | 8 +- trunk/drivers/acpi/acpica/exconvrt.c | 10 +- trunk/drivers/acpi/acpica/excreate.c | 2 +- trunk/drivers/acpi/acpica/exdebug.c | 4 +- trunk/drivers/acpi/acpica/exdump.c | 51 +- trunk/drivers/acpi/acpica/exfldio.c | 14 +- trunk/drivers/acpi/acpica/exmisc.c | 26 +- trunk/drivers/acpi/acpica/exmutex.c | 6 +- trunk/drivers/acpi/acpica/exprep.c | 6 +- trunk/drivers/acpi/acpica/exregion.c | 38 +- trunk/drivers/acpi/acpica/exresolv.c | 4 +- trunk/drivers/acpi/acpica/exresop.c | 10 +- trunk/drivers/acpi/acpica/exstore.c | 6 +- trunk/drivers/acpi/acpica/exstorob.c | 2 +- trunk/drivers/acpi/acpica/exsystem.c | 8 +- trunk/drivers/acpi/acpica/exutils.c | 10 +- trunk/drivers/acpi/acpica/hwacpi.c | 2 +- trunk/drivers/acpi/acpica/hwesleep.c | 30 +- trunk/drivers/acpi/acpica/hwregs.c | 22 +- trunk/drivers/acpi/acpica/hwsleep.c | 20 +- trunk/drivers/acpi/acpica/hwtimer.c | 4 +- trunk/drivers/acpi/acpica/hwvalid.c | 4 +- trunk/drivers/acpi/acpica/hwxface.c | 12 +- trunk/drivers/acpi/acpica/hwxfsleep.c | 26 +- trunk/drivers/acpi/acpica/nsaccess.c | 8 +- trunk/drivers/acpi/acpica/nsalloc.c | 10 +- trunk/drivers/acpi/acpica/nsdump.c | 18 +- trunk/drivers/acpi/acpica/nsdumpdv.c | 6 +- trunk/drivers/acpi/acpica/nseval.c | 10 +- trunk/drivers/acpi/acpica/nsinit.c | 6 +- trunk/drivers/acpi/acpica/nsload.c | 4 +- trunk/drivers/acpi/acpica/nsnames.c | 10 +- trunk/drivers/acpi/acpica/nsobject.c | 28 +- trunk/drivers/acpi/acpica/nspredef.c | 38 +- trunk/drivers/acpi/acpica/nsrepair.c | 14 +- trunk/drivers/acpi/acpica/nsrepair2.c | 26 +- trunk/drivers/acpi/acpica/nssearch.c | 12 +- trunk/drivers/acpi/acpica/nsutils.c | 26 +- trunk/drivers/acpi/acpica/nswalk.c | 8 +- trunk/drivers/acpi/acpica/nsxfeval.c | 26 +- trunk/drivers/acpi/acpica/nsxfname.c | 16 +- trunk/drivers/acpi/acpica/nsxfobj.c | 8 +- trunk/drivers/acpi/acpica/psargs.c | 6 +- trunk/drivers/acpi/acpica/psloop.c | 16 +- trunk/drivers/acpi/acpica/psopcode.c | 4 +- trunk/drivers/acpi/acpica/psparse.c | 6 +- trunk/drivers/acpi/acpica/psscope.c | 6 +- trunk/drivers/acpi/acpica/pstree.c | 14 +- trunk/drivers/acpi/acpica/psutils.c | 8 +- trunk/drivers/acpi/acpica/psxface.c | 16 +- trunk/drivers/acpi/acpica/rsaddr.c | 14 +- trunk/drivers/acpi/acpica/rscalc.c | 2 +- trunk/drivers/acpi/acpica/rscreate.c | 6 +- trunk/drivers/acpi/acpica/rsdump.c | 10 +- trunk/drivers/acpi/acpica/rslist.c | 2 +- trunk/drivers/acpi/acpica/rsmisc.c | 22 +- trunk/drivers/acpi/acpica/rsutils.c | 44 +- trunk/drivers/acpi/acpica/rsxface.c | 14 +- trunk/drivers/acpi/acpica/tbfadt.c | 144 +- trunk/drivers/acpi/acpica/tbfind.c | 2 +- trunk/drivers/acpi/acpica/tbinstal.c | 23 +- trunk/drivers/acpi/acpica/tbutils.c | 58 +- trunk/drivers/acpi/acpica/tbxface.c | 225 ++- trunk/drivers/acpi/acpica/tbxfload.c | 389 ----- trunk/drivers/acpi/acpica/tbxfroot.c | 12 +- trunk/drivers/acpi/acpica/utaddress.c | 10 +- trunk/drivers/acpi/acpica/utalloc.c | 20 +- trunk/drivers/acpi/acpica/utcopy.c | 2 +- trunk/drivers/acpi/acpica/utdebug.c | 32 +- trunk/drivers/acpi/acpica/utdecode.c | 70 +- trunk/drivers/acpi/acpica/utdelete.c | 38 +- trunk/drivers/acpi/acpica/uteval.c | 6 +- trunk/drivers/acpi/acpica/utexcep.c | 153 -- trunk/drivers/acpi/acpica/utglobal.c | 11 +- trunk/drivers/acpi/acpica/utids.c | 2 +- trunk/drivers/acpi/acpica/utlock.c | 6 +- trunk/drivers/acpi/acpica/utmath.c | 4 +- trunk/drivers/acpi/acpica/utmisc.c | 104 +- trunk/drivers/acpi/acpica/utmutex.c | 8 +- trunk/drivers/acpi/acpica/utobject.c | 14 +- trunk/drivers/acpi/acpica/utosi.c | 2 +- trunk/drivers/acpi/acpica/utresrc.c | 34 +- trunk/drivers/acpi/acpica/utstate.c | 16 +- trunk/drivers/acpi/acpica/utxface.c | 18 +- trunk/drivers/acpi/acpica/utxferror.c | 90 +- trunk/drivers/acpi/acpica/utxfmutex.c | 14 +- trunk/drivers/acpi/apei/apei-base.c | 5 - trunk/drivers/acpi/battery.c | 9 - trunk/drivers/acpi/bus.c | 4 - trunk/drivers/acpi/container.c | 43 +- trunk/drivers/acpi/osl.c | 4 +- trunk/drivers/acpi/processor_driver.c | 28 +- trunk/drivers/acpi/processor_idle.c | 12 +- trunk/drivers/acpi/scan.c | 58 +- trunk/drivers/acpi/sleep.c | 77 +- trunk/drivers/acpi/thermal.c | 10 +- trunk/drivers/acpi/utils.c | 42 - trunk/drivers/cpuidle/Kconfig | 3 - trunk/drivers/cpuidle/Makefile | 1 - trunk/drivers/cpuidle/coupled.c | 715 --------- trunk/drivers/cpuidle/cpuidle.c | 85 +- trunk/drivers/cpuidle/cpuidle.h | 32 - trunk/drivers/idle/intel_idle.c | 37 - trunk/drivers/platform/x86/acerhdf.c | 2 +- .../drivers/platform/x86/intel_mid_thermal.c | 2 +- trunk/drivers/thermal/Kconfig | 1 - trunk/drivers/thermal/spear_thermal.c | 28 +- trunk/drivers/thermal/thermal_sys.c | 223 +-- trunk/include/acpi/acexcep.h | 7 +- trunk/include/acpi/acnames.h | 2 +- trunk/include/acpi/acoutput.h | 6 +- trunk/include/acpi/acpi.h | 2 +- trunk/include/acpi/acpi_bus.h | 12 +- trunk/include/acpi/acpiosxf.h | 4 +- trunk/include/acpi/acpixf.h | 29 +- trunk/include/acpi/acrestyp.h | 6 +- trunk/include/acpi/actbl.h | 10 +- trunk/include/acpi/actbl1.h | 10 +- trunk/include/acpi/actbl2.h | 10 +- trunk/include/acpi/actbl3.h | 2 +- trunk/include/acpi/actypes.h | 15 +- trunk/include/acpi/platform/acenv.h | 2 +- trunk/include/acpi/platform/acgcc.h | 2 +- trunk/include/acpi/platform/aclinux.h | 2 +- trunk/include/linux/acpi.h | 40 +- trunk/include/linux/cpuidle.h | 11 - .../linux/platform_data/spear_thermal.h | 26 + trunk/include/linux/thermal.h | 20 +- trunk/tools/power/x86/turbostat/Makefile | 1 - trunk/tools/power/x86/turbostat/turbostat.8 | 77 +- trunk/tools/power/x86/turbostat/turbostat.c | 1333 +++++++---------- 178 files changed, 2462 insertions(+), 4239 deletions(-) delete mode 100644 trunk/Documentation/devicetree/bindings/thermal/spear-thermal.txt delete mode 100644 trunk/drivers/acpi/acpica/tbxfload.c delete mode 100644 trunk/drivers/acpi/acpica/utexcep.c delete mode 100644 trunk/drivers/cpuidle/coupled.c create mode 100644 trunk/include/linux/platform_data/spear_thermal.h diff --git a/[refs] b/[refs] index cf27148d65f2..92c709e62ac1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3f6f49c7854c9294119437a82c5b35be78f9cea6 +refs/heads/master: a5ca7345c1e67cd12cf75a9ec034c7d34786ae79 diff --git a/trunk/Documentation/devicetree/bindings/thermal/spear-thermal.txt b/trunk/Documentation/devicetree/bindings/thermal/spear-thermal.txt deleted file mode 100644 index 93e3b67c102d..000000000000 --- a/trunk/Documentation/devicetree/bindings/thermal/spear-thermal.txt +++ /dev/null @@ -1,14 +0,0 @@ -* SPEAr Thermal - -Required properties: -- compatible : "st,thermal-spear1340" -- reg : Address range of the thermal registers -- st,thermal-flags: flags used to enable thermal sensor - -Example: - - thermal@fc000000 { - compatible = "st,thermal-spear1340"; - reg = <0xfc000000 0x1000>; - st,thermal-flags = <0x7000>; - }; diff --git a/trunk/Documentation/thermal/sysfs-api.txt b/trunk/Documentation/thermal/sysfs-api.txt index c087dbcf3535..1733ab947a95 100644 --- a/trunk/Documentation/thermal/sysfs-api.txt +++ b/trunk/Documentation/thermal/sysfs-api.txt @@ -32,8 +32,7 @@ temperature) and throttle appropriate devices. 1.1 thermal zone device interface 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, - int trips, int mask, void *devdata, - struct thermal_zone_device_ops *ops) + int trips, void *devdata, struct thermal_zone_device_ops *ops) This interface function adds a new thermal zone device (sensor) to /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the @@ -41,17 +40,16 @@ temperature) and throttle appropriate devices. name: the thermal zone name. trips: the total number of trip points this thermal zone supports. - mask: Bit string: If 'n'th bit is set, then trip point 'n' is writeable. devdata: device private data ops: thermal zone device call-backs. .bind: bind the thermal zone device with a thermal cooling device. .unbind: unbind the thermal zone device with a thermal cooling device. .get_temp: get the current temperature of the thermal zone. - .get_mode: get the current mode (enabled/disabled) of the thermal zone. - - "enabled" means the kernel thermal management is enabled. - - "disabled" will prevent kernel thermal driver action upon trip points + .get_mode: get the current mode (user/kernel) of the thermal zone. + - "kernel" means thermal management is done in kernel. + - "user" will prevent kernel thermal driver actions upon trip points so that user applications can take charge of thermal management. - .set_mode: set the mode (enabled/disabled) of the thermal zone. + .set_mode: set the mode (user/kernel) of the thermal zone. .get_trip_type: get the type of certain trip point. .get_trip_temp: get the temperature above which the certain trip point will be fired. @@ -121,7 +119,6 @@ Thermal zone device sys I/F, created once it's registered: |---mode: Working mode of the thermal zone |---trip_point_[0-*]_temp: Trip point temperature |---trip_point_[0-*]_type: Trip point type - |---trip_point_[0-*]_hyst: Hysteresis value for this trip point Thermal cooling device sys I/F, created once it's registered: /sys/class/thermal/cooling_device[0-*]: @@ -170,14 +167,14 @@ temp RO, Required mode - One of the predefined values in [enabled, disabled]. + One of the predefined values in [kernel, user]. This file gives information about the algorithm that is currently managing the thermal zone. It can be either default kernel based algorithm or user space application. - enabled = enable Kernel Thermal management. - disabled = Preventing kernel thermal zone driver actions upon - trip points so that user application can take full - charge of the thermal management. + kernel = Thermal management in kernel thermal zone driver. + user = Preventing kernel thermal zone driver actions upon + trip points so that user application can take full + charge of the thermal management. RW, Optional trip_point_[0-*]_temp @@ -191,11 +188,6 @@ trip_point_[0-*]_type thermal zone. RO, Optional -trip_point_[0-*]_hyst - The hysteresis value for a trip point, represented as an integer - Unit: Celsius - RW, Optional - cdev[0-*] Sysfs link to the thermal cooling device node where the sys I/F for cooling device throttling control represents. @@ -256,7 +248,7 @@ method, the sys I/F structure will be built like this: |thermal_zone1: |---type: acpitz |---temp: 37000 - |---mode: enabled + |---mode: kernel |---trip_point_0_temp: 100000 |---trip_point_0_type: critical |---trip_point_1_temp: 80000 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 41c06470a59c..fe643e7b9df6 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -242,6 +242,13 @@ W: http://www.lesswatts.org/projects/acpi/ S: Supported F: drivers/acpi/fan.c +ACPI PROCESSOR AGGREGATOR DRIVER +M: Shaohua Li +L: linux-acpi@vger.kernel.org +W: http://www.lesswatts.org/projects/acpi/ +S: Supported +F: drivers/acpi/acpi_pad.c + ACPI THERMAL DRIVER M: Zhang Rui L: linux-acpi@vger.kernel.org diff --git a/trunk/arch/x86/kernel/acpi/sleep.c b/trunk/arch/x86/kernel/acpi/sleep.c index 1b8e5a03d942..95bf99de9058 100644 --- a/trunk/arch/x86/kernel/acpi/sleep.c +++ b/trunk/arch/x86/kernel/acpi/sleep.c @@ -25,6 +25,10 @@ unsigned long acpi_realmode_flags; static char temp_stack[4096]; #endif +asmlinkage void acpi_enter_s3(void) +{ + acpi_enter_sleep_state(3, wake_sleep_flags); +} /** * acpi_suspend_lowlevel - save kernel state * diff --git a/trunk/arch/x86/kernel/acpi/sleep.h b/trunk/arch/x86/kernel/acpi/sleep.h index 67f59f8c6956..5653a5791ec9 100644 --- a/trunk/arch/x86/kernel/acpi/sleep.h +++ b/trunk/arch/x86/kernel/acpi/sleep.h @@ -2,6 +2,7 @@ * Variables and functions used by the code in sleep.c */ +#include #include extern unsigned long saved_video_mode; @@ -10,6 +11,7 @@ extern long saved_magic; extern int wakeup_pmode_return; extern u8 wake_sleep_flags; +extern asmlinkage void acpi_enter_s3(void); extern unsigned long acpi_copy_wakeup_routine(unsigned long); extern void wakeup_long64(void); diff --git a/trunk/arch/x86/kernel/acpi/wakeup_32.S b/trunk/arch/x86/kernel/acpi/wakeup_32.S index 13ab720573e3..72610839f03b 100644 --- a/trunk/arch/x86/kernel/acpi/wakeup_32.S +++ b/trunk/arch/x86/kernel/acpi/wakeup_32.S @@ -74,9 +74,7 @@ restore_registers: ENTRY(do_suspend_lowlevel) call save_processor_state call save_registers - pushl $3 - call acpi_enter_sleep_state - addl $4, %esp + call acpi_enter_s3 # In case of S3 failure, we'll emerge here. Jump # to ret_point to recover diff --git a/trunk/arch/x86/kernel/acpi/wakeup_64.S b/trunk/arch/x86/kernel/acpi/wakeup_64.S index 8ea5164cbd04..014d1d28c397 100644 --- a/trunk/arch/x86/kernel/acpi/wakeup_64.S +++ b/trunk/arch/x86/kernel/acpi/wakeup_64.S @@ -71,9 +71,7 @@ ENTRY(do_suspend_lowlevel) movq %rsi, saved_rsi addq $8, %rsp - movl $3, %edi - xorl %eax, %eax - call acpi_enter_sleep_state + call acpi_enter_s3 /* in case something went wrong, restore the machine status and go on */ jmp resume_point diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c index d1fcbc0f6cbc..6512b20aeccd 100644 --- a/trunk/drivers/acpi/ac.c +++ b/trunk/drivers/acpi/ac.c @@ -292,9 +292,7 @@ static int acpi_ac_add(struct acpi_device *device) ac->charger.properties = ac_props; ac->charger.num_properties = ARRAY_SIZE(ac_props); ac->charger.get_property = get_ac_property; - result = power_supply_register(&ac->device->dev, &ac->charger); - if (result) - goto end; + power_supply_register(&ac->device->dev, &ac->charger); printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), acpi_device_bid(device), diff --git a/trunk/drivers/acpi/acpi_memhotplug.c b/trunk/drivers/acpi/acpi_memhotplug.c index 24c807f96636..d98571385656 100644 --- a/trunk/drivers/acpi/acpi_memhotplug.c +++ b/trunk/drivers/acpi/acpi_memhotplug.c @@ -341,7 +341,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) { struct acpi_memory_device *mem_device; struct acpi_device *device; - u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ + switch (event) { case ACPI_NOTIFY_BUS_CHECK: @@ -354,20 +354,15 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) "\nReceived DEVICE CHECK notification for device\n")); if (acpi_memory_get_device(handle, &mem_device)) { printk(KERN_ERR PREFIX "Cannot find driver data\n"); - break; + return; } - if (acpi_memory_check_device(mem_device)) - break; - - if (acpi_memory_enable_device(mem_device)) { - printk(KERN_ERR PREFIX "Cannot enable memory device\n"); - break; + if (!acpi_memory_check_device(mem_device)) { + if (acpi_memory_enable_device(mem_device)) + printk(KERN_ERR PREFIX + "Cannot enable memory device\n"); } - - ost_code = ACPI_OST_SC_SUCCESS; break; - case ACPI_NOTIFY_EJECT_REQUEST: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "\nReceived EJECT REQUEST notification for device\n")); @@ -388,35 +383,19 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) * TBD: Can also be disabled by Callback registration * with generic sysfs driver */ - if (acpi_memory_disable_device(mem_device)) { - printk(KERN_ERR PREFIX "Disable memory device\n"); - /* - * If _EJ0 was called but failed, _OST is not - * necessary. - */ - if (mem_device->state == MEMORY_INVALID_STATE) - return; - - break; - } - + if (acpi_memory_disable_device(mem_device)) + printk(KERN_ERR PREFIX + "Disable memory device\n"); /* * TBD: Invoke acpi_bus_remove to cleanup data structures */ - - /* _EJ0 succeeded; _OST is not necessary */ - return; - + break; default: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unsupported event [0x%x]\n", event)); - - /* non-hotplug event; possibly handled by other handler */ - return; + break; } - /* Inform firmware that the hotplug operation has completed */ - (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); return; } diff --git a/trunk/drivers/acpi/acpi_pad.c b/trunk/drivers/acpi/acpi_pad.c index af4aad6ee2eb..1502c50273b5 100644 --- a/trunk/drivers/acpi/acpi_pad.c +++ b/trunk/drivers/acpi/acpi_pad.c @@ -145,7 +145,7 @@ static void exit_round_robin(unsigned int tsk_index) } static unsigned int idle_pct = 5; /* percentage */ -static unsigned int round_robin_time = 1; /* second */ +static unsigned int round_robin_time = 10; /* second */ static int power_saving_thread(void *data) { struct sched_param param = {.sched_priority = 1}; @@ -235,7 +235,7 @@ static int create_power_saving_task(void) ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, (void *)(unsigned long)ps_tsk_num, - "acpi_pad/%d", ps_tsk_num); + "power_saving/%d", ps_tsk_num); rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0; if (!rc) ps_tsk_num++; diff --git a/trunk/drivers/acpi/acpica/Makefile b/trunk/drivers/acpi/acpica/Makefile index 0a1b3435f920..793b8cc8e256 100644 --- a/trunk/drivers/acpi/acpica/Makefile +++ b/trunk/drivers/acpi/acpica/Makefile @@ -134,14 +134,12 @@ acpi-y += \ tbinstal.o \ tbutils.o \ tbxface.o \ - tbxfload.o \ tbxfroot.o acpi-y += \ utaddress.o \ utalloc.o \ utcopy.o \ - utexcep.o \ utdebug.o \ utdecode.o \ utdelete.o \ diff --git a/trunk/drivers/acpi/acpica/acevents.h b/trunk/drivers/acpi/acpica/acevents.h index c0a43b38c6a3..d700f63e4701 100644 --- a/trunk/drivers/acpi/acpica/acevents.h +++ b/trunk/drivers/acpi/acpica/acevents.h @@ -237,7 +237,7 @@ u32 acpi_ev_install_sci_handler(void); acpi_status acpi_ev_remove_sci_handler(void); -u32 acpi_ev_initialize_SCI(u32 program_SCI); +u32 acpi_ev_initialize_sCI(u32 program_sCI); ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) #endif /* __ACEVENTS_H__ */ diff --git a/trunk/drivers/acpi/acpica/acglobal.h b/trunk/drivers/acpi/acpica/acglobal.h index ce79100fb5eb..4f7d3f57d05c 100644 --- a/trunk/drivers/acpi/acpica/acglobal.h +++ b/trunk/drivers/acpi/acpica/acglobal.h @@ -278,7 +278,8 @@ ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; /* Global handlers */ -ACPI_EXTERN struct acpi_global_notify_handler acpi_gbl_global_notify[2]; +ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; +ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler; @@ -326,6 +327,14 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; #endif +/* Exception codes */ + +extern char const *acpi_gbl_exception_names_env[]; +extern char const *acpi_gbl_exception_names_pgm[]; +extern char const *acpi_gbl_exception_names_tbl[]; +extern char const *acpi_gbl_exception_names_aml[]; +extern char const *acpi_gbl_exception_names_ctrl[]; + /***************************************************************************** * * Namespace globals @@ -454,12 +463,4 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; #endif /* ACPI_DEBUGGER */ -/***************************************************************************** - * - * Info/help support - * - ****************************************************************************/ - -extern const struct ah_predefined_name asl_predefined_info[]; - #endif /* __ACGLOBAL_H__ */ diff --git a/trunk/drivers/acpi/acpica/achware.h b/trunk/drivers/acpi/acpica/achware.h index 5de4ec72766d..5ccb99ae3a6f 100644 --- a/trunk/drivers/acpi/acpica/achware.h +++ b/trunk/drivers/acpi/acpica/achware.h @@ -83,22 +83,22 @@ acpi_status acpi_hw_clear_acpi_status(void); /* * hwsleep - sleep/wake support (Legacy sleep registers) */ -acpi_status acpi_hw_legacy_sleep(u8 sleep_state); +acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags); -acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state); +acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags); -acpi_status acpi_hw_legacy_wake(u8 sleep_state); +acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags); /* * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) */ void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument); -acpi_status acpi_hw_extended_sleep(u8 sleep_state); +acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags); -acpi_status acpi_hw_extended_wake_prep(u8 sleep_state); +acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags); -acpi_status acpi_hw_extended_wake(u8 sleep_state); +acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags); /* * hwvalid - Port I/O with validation diff --git a/trunk/drivers/acpi/acpica/aclocal.h b/trunk/drivers/acpi/acpica/aclocal.h index cc80fe10e8ea..e3922ca20e7f 100644 --- a/trunk/drivers/acpi/acpica/aclocal.h +++ b/trunk/drivers/acpi/acpica/aclocal.h @@ -299,7 +299,7 @@ acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); * Information structure for ACPI predefined names. * Each entry in the table contains the following items: * - * name - The ACPI reserved name + * Name - The ACPI reserved name * param_count - Number of arguments to the method * expected_return_btypes - Allowed type(s) for the return value */ @@ -404,13 +404,6 @@ struct acpi_gpe_handler_info { u8 originally_enabled; /* True if GPE was originally enabled */ }; -/* Notify info for implicit notify, multiple device objects */ - -struct acpi_gpe_notify_info { - struct acpi_namespace_node *device_node; /* Device to be notified */ - struct acpi_gpe_notify_info *next; -}; - struct acpi_gpe_notify_object { struct acpi_namespace_node *node; struct acpi_gpe_notify_object *next; @@ -419,7 +412,7 @@ struct acpi_gpe_notify_object { union acpi_gpe_dispatch_info { struct acpi_namespace_node *method_node; /* Method node for this GPE level */ struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ - struct acpi_gpe_notify_info *notify_list; /* List of _PRW devices for implicit notifies */ + struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */ }; /* @@ -427,7 +420,7 @@ union acpi_gpe_dispatch_info { * NOTE: Important to keep this struct as small as possible. */ struct acpi_gpe_event_info { - union acpi_gpe_dispatch_info dispatch; /* Either Method, Handler, or notify_list */ + union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ u8 flags; /* Misc info about this GPE */ u8 gpe_number; /* This GPE */ @@ -607,22 +600,13 @@ acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); -/* Global handlers for AML Notifies */ - -struct acpi_global_notify_handler { - acpi_notify_handler handler; - void *context; -}; - /* * Notify info - used to pass info to the deferred notify * handler/dispatcher. */ struct acpi_notify_info { - ACPI_STATE_COMMON u8 handler_list_id; - struct acpi_namespace_node *node; - union acpi_operand_object *handler_list_head; - struct acpi_global_notify_handler *global; + ACPI_STATE_COMMON struct acpi_namespace_node *node; + union acpi_operand_object *handler_obj; }; /* Generic state is union of structs above */ @@ -734,7 +718,7 @@ struct acpi_parse_obj_named { u32 name; /* 4-byte name or zero if no name */ }; -/* This version is used by the iASL compiler only */ +/* This version is used by the i_aSL compiler only */ #define ACPI_MAX_PARSEOP_NAME 20 @@ -803,7 +787,6 @@ struct acpi_parse_state { #define ACPI_PARSEOP_IGNORE 0x01 #define ACPI_PARSEOP_PARAMLIST 0x02 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 -#define ACPI_PARSEOP_PREDEF_CHECKED 0x08 #define ACPI_PARSEOP_SPECIAL 0x10 /***************************************************************************** @@ -1092,18 +1075,4 @@ struct acpi_debug_mem_block { #define ACPI_MEM_LIST_MAX 1 #define ACPI_NUM_MEM_LISTS 2 -/***************************************************************************** - * - * Info/help support - * - ****************************************************************************/ - -struct ah_predefined_name { - char *name; - char *description; -#ifndef ACPI_ASL_COMPILER - char *action; -#endif -}; - #endif /* __ACLOCAL_H__ */ diff --git a/trunk/drivers/acpi/acpica/acmacros.h b/trunk/drivers/acpi/acpica/acmacros.h index 832b6198652e..f119f473f71a 100644 --- a/trunk/drivers/acpi/acpica/acmacros.h +++ b/trunk/drivers/acpi/acpica/acmacros.h @@ -62,7 +62,7 @@ * printf() format helpers */ -/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ +/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) @@ -283,8 +283,8 @@ #define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask)) /* - * An object of type struct acpi_namespace_node can appear in some contexts - * where a pointer to an object of type union acpi_operand_object can also + * A struct acpi_namespace_node can appear in some contexts + * where a pointer to a union acpi_operand_object can also * appear. This macro is used to distinguish them. * * The "Descriptor" field is the first field in both structures. diff --git a/trunk/drivers/acpi/acpica/acobject.h b/trunk/drivers/acpi/acpica/acobject.h index 364a1303fb8f..c065078ca83b 100644 --- a/trunk/drivers/acpi/acpica/acobject.h +++ b/trunk/drivers/acpi/acpica/acobject.h @@ -113,8 +113,8 @@ struct acpi_object_integer { }; /* - * Note: The String and Buffer object must be identical through the - * pointer and length elements. There is code that depends on this. + * Note: The String and Buffer object must be identical through the Pointer + * and length elements. There is code that depends on this. * * Fields common to both Strings and Buffers */ @@ -206,7 +206,8 @@ struct acpi_object_method { * Common fields for objects that support ASL notifications */ #define ACPI_COMMON_NOTIFY_INFO \ - union acpi_operand_object *notify_list[2]; /* Handlers for system/device notifies */\ + union acpi_operand_object *system_notify; /* Handler for system notifies */\ + union acpi_operand_object *device_notify; /* Handler for driver notifies */\ union acpi_operand_object *handler; /* Handler for Address space */ struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ @@ -295,10 +296,10 @@ struct acpi_object_buffer_field { struct acpi_object_notify_handler { ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ - u32 handler_type; /* Type: Device/System/Both */ - acpi_notify_handler handler; /* Handler address */ + u32 handler_type; + acpi_notify_handler handler; void *context; - union acpi_operand_object *next[2]; /* Device and System handler lists */ + struct acpi_object_notify_handler *next; }; struct acpi_object_addr_handler { @@ -381,7 +382,7 @@ struct acpi_object_cache_list { /****************************************************************************** * - * union acpi_operand_object descriptor - a giant union of all of the above + * union acpi_operand_object Descriptor - a giant union of all of the above * *****************************************************************************/ diff --git a/trunk/drivers/acpi/acpica/acpredef.h b/trunk/drivers/acpi/acpica/acpredef.h index 3080c017f5ba..bbb34c9be4e8 100644 --- a/trunk/drivers/acpi/acpica/acpredef.h +++ b/trunk/drivers/acpi/acpica/acpredef.h @@ -140,7 +140,7 @@ enum acpi_return_package_types { * * The main entries in the table each contain the following items: * - * name - The ACPI reserved name + * Name - The ACPI reserved name * param_count - Number of arguments to the method * expected_btypes - Allowed type(s) for the return value. * 0 means that no return value is expected. @@ -511,14 +511,14 @@ static const union acpi_predefined_info predefined_names[] = {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, {{"_TPT", 1, 0}}, - {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2 Ref/6 Int */ + {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2_ref/6_int */ {{{ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 6, 0}}, - {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5 Int with count */ + {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5_int with count */ {{{ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, {{"_TSP", 0, ACPI_RTYPE_INTEGER}}, - {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5 Int */ + {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5_int */ {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, {{"_TST", 0, ACPI_RTYPE_INTEGER}}, diff --git a/trunk/drivers/acpi/acpica/acstruct.h b/trunk/drivers/acpi/acpica/acstruct.h index f196e2c9a71f..0404df605bc1 100644 --- a/trunk/drivers/acpi/acpica/acstruct.h +++ b/trunk/drivers/acpi/acpica/acstruct.h @@ -68,7 +68,7 @@ #define ACPI_WALK_METHOD 0x01 #define ACPI_WALK_METHOD_RESTART 0x02 -/* Flags for iASL compiler only */ +/* Flags for i_aSL compiler only */ #define ACPI_WALK_CONST_REQUIRED 0x10 #define ACPI_WALK_CONST_OPTIONAL 0x20 diff --git a/trunk/drivers/acpi/acpica/acutils.h b/trunk/drivers/acpi/acpica/acutils.h index 5035327ebccc..925ccf22101b 100644 --- a/trunk/drivers/acpi/acpica/acutils.h +++ b/trunk/drivers/acpi/acpica/acutils.h @@ -460,8 +460,6 @@ acpi_ut_short_divide(u64 in_dividend, /* * utmisc */ -void ut_convert_backslashes(char *pathname); - const char *acpi_ut_validate_exception(acpi_status status); u8 acpi_ut_is_pci_root_bridge(char *id); diff --git a/trunk/drivers/acpi/acpica/amlcode.h b/trunk/drivers/acpi/acpica/amlcode.h index c26f8ff6c3b9..905280fec0fa 100644 --- a/trunk/drivers/acpi/acpica/amlcode.h +++ b/trunk/drivers/acpi/acpica/amlcode.h @@ -182,7 +182,7 @@ /* * Combination opcodes (actually two one-byte opcodes) - * Used by the disassembler and iASL compiler + * Used by the disassembler and i_aSL compiler */ #define AML_LGREATEREQUAL_OP (u16) 0x9295 #define AML_LLESSEQUAL_OP (u16) 0x9294 @@ -280,7 +280,7 @@ /* Multiple/complex types */ -#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a node - Used only by size_of operator */ +#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ #define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ diff --git a/trunk/drivers/acpi/acpica/amlresrc.h b/trunk/drivers/acpi/acpica/amlresrc.h index af4947956ec2..7b2128f274e7 100644 --- a/trunk/drivers/acpi/acpica/amlresrc.h +++ b/trunk/drivers/acpi/acpica/amlresrc.h @@ -98,7 +98,7 @@ #define ACPI_RESTAG_TRANSLATION "_TRA" #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ -#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ +#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ #define ACPI_RESTAG_VENDORDATA "_VEN" /* Default sizes for "small" resource descriptors */ @@ -235,7 +235,7 @@ AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; struct aml_resource_extended_address64 { AML_RESOURCE_LARGE_HEADER_COMMON - AML_RESOURCE_ADDRESS_COMMON u8 revision_ID; + AML_RESOURCE_ADDRESS_COMMON u8 revision_iD; u8 reserved; u64 granularity; u64 minimum; diff --git a/trunk/drivers/acpi/acpica/dsargs.c b/trunk/drivers/acpi/acpica/dsargs.c index c8b5e2565b98..80eb1900297f 100644 --- a/trunk/drivers/acpi/acpica/dsargs.c +++ b/trunk/drivers/acpi/acpica/dsargs.c @@ -62,7 +62,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node, * * FUNCTION: acpi_ds_execute_arguments * - * PARAMETERS: node - Object NS node + * PARAMETERS: Node - Object NS node * scope_node - Parent NS node * aml_length - Length of executable AML * aml_start - Pointer to the AML diff --git a/trunk/drivers/acpi/acpica/dscontrol.c b/trunk/drivers/acpi/acpica/dscontrol.c index 465f02134b89..effe4ca1133f 100644 --- a/trunk/drivers/acpi/acpica/dscontrol.c +++ b/trunk/drivers/acpi/acpica/dscontrol.c @@ -56,7 +56,7 @@ ACPI_MODULE_NAME("dscontrol") * FUNCTION: acpi_ds_exec_begin_control_op * * PARAMETERS: walk_list - The list that owns the walk stack - * op - The control Op + * Op - The control Op * * RETURN: Status * @@ -153,7 +153,7 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_exec_end_control_op * * PARAMETERS: walk_list - The list that owns the walk stack - * op - The control Op + * Op - The control Op * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/dsfield.c b/trunk/drivers/acpi/acpica/dsfield.c index 3da6fd8530c5..cd243cf2cab2 100644 --- a/trunk/drivers/acpi/acpica/dsfield.c +++ b/trunk/drivers/acpi/acpica/dsfield.c @@ -53,84 +53,16 @@ ACPI_MODULE_NAME("dsfield") /* Local prototypes */ -#ifdef ACPI_ASL_COMPILER -#include "acdisasm.h" -static acpi_status -acpi_ds_create_external_region(acpi_status lookup_status, - union acpi_parse_object *op, - char *path, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **node); -#endif - static acpi_status acpi_ds_get_field_names(struct acpi_create_field_info *info, struct acpi_walk_state *walk_state, union acpi_parse_object *arg); -#ifdef ACPI_ASL_COMPILER -/******************************************************************************* - * - * FUNCTION: acpi_ds_create_external_region (iASL Disassembler only) - * - * PARAMETERS: lookup_status - Status from ns_lookup operation - * op - Op containing the Field definition and args - * path - Pathname of the region - * ` walk_state - Current method state - * node - Where the new region node is returned - * - * RETURN: Status - * - * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new - * region node/object. - * - ******************************************************************************/ - -static acpi_status -acpi_ds_create_external_region(acpi_status lookup_status, - union acpi_parse_object *op, - char *path, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **node) -{ - acpi_status status; - union acpi_operand_object *obj_desc; - - if (lookup_status != AE_NOT_FOUND) { - return (lookup_status); - } - - /* - * Table disassembly: - * operation_region not found. Generate an External for it, and - * insert the name into the namespace. - */ - acpi_dm_add_to_external_list(op, path, ACPI_TYPE_REGION, 0); - status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, - walk_state, node); - if (ACPI_FAILURE(status)) { - return (status); - } - - /* Must create and install a region object for the new node */ - - obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_REGION); - if (!obj_desc) { - return (AE_NO_MEMORY); - } - - obj_desc->region.node = *node; - status = acpi_ns_attach_object(*node, obj_desc, ACPI_TYPE_REGION); - return (status); -} -#endif - /******************************************************************************* * * FUNCTION: acpi_ds_create_buffer_field * - * PARAMETERS: op - Current parse op (create_XXField) + * PARAMETERS: Op - Current parse op (create_xXField) * walk_state - Current state * * RETURN: Status @@ -167,7 +99,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, arg = acpi_ps_get_arg(op, 3); } else { - /* For all other create_XXXField operators, name is the 3rd argument */ + /* For all other create_xXXField operators, name is the 3rd argument */ arg = acpi_ps_get_arg(op, 2); } @@ -271,9 +203,9 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, * * FUNCTION: acpi_ds_get_field_names * - * PARAMETERS: info - create_field info structure + * PARAMETERS: Info - create_field info structure * ` walk_state - Current method state - * arg - First parser arg for the field name list + * Arg - First parser arg for the field name list * * RETURN: Status * @@ -302,10 +234,10 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, while (arg) { /* * Four types of field elements are handled: - * 1) name - Enters a new named field into the namespace - * 2) offset - specifies a bit offset + * 1) Name - Enters a new named field into the namespace + * 2) Offset - specifies a bit offset * 3) access_as - changes the access mode/attributes - * 4) connection - Associate a resource template with the field + * 4) Connection - Associate a resource template with the field */ switch (arg->common.aml_opcode) { case AML_INT_RESERVEDFIELD_OP: @@ -457,7 +389,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, * * FUNCTION: acpi_ds_create_field * - * PARAMETERS: op - Op containing the Field definition and args + * PARAMETERS: Op - Op containing the Field definition and args * region_node - Object for the containing Operation Region * ` walk_state - Current method state * @@ -481,19 +413,12 @@ acpi_ds_create_field(union acpi_parse_object *op, /* First arg is the name of the parent op_region (must already exist) */ arg = op->common.value.arg; - if (!region_node) { status = acpi_ns_lookup(walk_state->scope_info, arg->common.value.name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, ®ion_node); -#ifdef ACPI_ASL_COMPILER - status = acpi_ds_create_external_region(status, arg, - arg->common.value.name, - walk_state, - ®ion_node); -#endif if (ACPI_FAILURE(status)) { ACPI_ERROR_NAMESPACE(arg->common.value.name, status); return_ACPI_STATUS(status); @@ -521,7 +446,7 @@ acpi_ds_create_field(union acpi_parse_object *op, * * FUNCTION: acpi_ds_init_field_objects * - * PARAMETERS: op - Op containing the Field definition and args + * PARAMETERS: Op - Op containing the Field definition and args * ` walk_state - Current method state * * RETURN: Status @@ -636,7 +561,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op, * * FUNCTION: acpi_ds_create_bank_field * - * PARAMETERS: op - Op containing the Field definition and args + * PARAMETERS: Op - Op containing the Field definition and args * region_node - Object for the containing Operation Region * walk_state - Current method state * @@ -666,12 +591,6 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, arg->common.value.name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, ®ion_node); -#ifdef ACPI_ASL_COMPILER - status = acpi_ds_create_external_region(status, arg, - arg->common.value.name, - walk_state, - ®ion_node); -#endif if (ACPI_FAILURE(status)) { ACPI_ERROR_NAMESPACE(arg->common.value.name, status); return_ACPI_STATUS(status); @@ -726,7 +645,7 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, * * FUNCTION: acpi_ds_create_index_field * - * PARAMETERS: op - Op containing the Field definition and args + * PARAMETERS: Op - Op containing the Field definition and args * region_node - Object for the containing Operation Region * ` walk_state - Current method state * diff --git a/trunk/drivers/acpi/acpica/dsinit.c b/trunk/drivers/acpi/acpica/dsinit.c index 87eff701ecfa..9e5ac7f780a7 100644 --- a/trunk/drivers/acpi/acpica/dsinit.c +++ b/trunk/drivers/acpi/acpica/dsinit.c @@ -60,8 +60,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle, * FUNCTION: acpi_ds_init_one_object * * PARAMETERS: obj_handle - Node for the object - * level - Current nesting level - * context - Points to a init info struct + * Level - Current nesting level + * Context - Points to a init info struct * return_value - Not used * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/dsmethod.c b/trunk/drivers/acpi/acpica/dsmethod.c index aa9a5d4e4052..00f5dab5bcc0 100644 --- a/trunk/drivers/acpi/acpica/dsmethod.c +++ b/trunk/drivers/acpi/acpica/dsmethod.c @@ -61,7 +61,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); * * FUNCTION: acpi_ds_method_error * - * PARAMETERS: status - Execution status + * PARAMETERS: Status - Execution status * walk_state - Current state * * RETURN: Status @@ -306,9 +306,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, * * FUNCTION: acpi_ds_call_control_method * - * PARAMETERS: thread - Info for this thread + * PARAMETERS: Thread - Info for this thread * this_walk_state - Current walk state - * op - Current Op to be walked + * Op - Current Op to be walked * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/dsmthdat.c b/trunk/drivers/acpi/acpica/dsmthdat.c index 8d55cebaa656..b40bd507be5d 100644 --- a/trunk/drivers/acpi/acpica/dsmthdat.c +++ b/trunk/drivers/acpi/acpica/dsmthdat.c @@ -177,7 +177,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state) * * FUNCTION: acpi_ds_method_data_init_args * - * PARAMETERS: *params - Pointer to a parameter list for the method + * PARAMETERS: *Params - Pointer to a parameter list for the method * max_param_count - The arg count for this method * walk_state - Current walk state object * @@ -232,11 +232,11 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, * * FUNCTION: acpi_ds_method_data_get_node * - * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or + * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or * ACPI_REFCLASS_ARG - * index - Which Local or Arg whose type to get + * Index - Which Local or Arg whose type to get * walk_state - Current walk state object - * node - Where the node is returned. + * Node - Where the node is returned. * * RETURN: Status and node * @@ -296,10 +296,10 @@ acpi_ds_method_data_get_node(u8 type, * * FUNCTION: acpi_ds_method_data_set_value * - * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or + * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or * ACPI_REFCLASS_ARG - * index - Which Local or Arg to get - * object - Object to be inserted into the stack entry + * Index - Which Local or Arg to get + * Object - Object to be inserted into the stack entry * walk_state - Current walk state object * * RETURN: Status @@ -336,7 +336,7 @@ acpi_ds_method_data_set_value(u8 type, * Increment ref count so object can't be deleted while installed. * NOTE: We do not copy the object in order to preserve the call by * reference semantics of ACPI Control Method invocation. - * (See ACPI Specification 2.0C) + * (See ACPI Specification 2.0_c) */ acpi_ut_add_reference(object); @@ -350,9 +350,9 @@ acpi_ds_method_data_set_value(u8 type, * * FUNCTION: acpi_ds_method_data_get_value * - * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or + * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or * ACPI_REFCLASS_ARG - * index - Which localVar or argument to get + * Index - Which local_var or argument to get * walk_state - Current walk state object * dest_desc - Where Arg or Local value is returned * @@ -458,9 +458,9 @@ acpi_ds_method_data_get_value(u8 type, * * FUNCTION: acpi_ds_method_data_delete_value * - * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or + * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or * ACPI_REFCLASS_ARG - * index - Which localVar or argument to delete + * Index - Which local_var or argument to delete * walk_state - Current walk state object * * RETURN: None @@ -515,9 +515,9 @@ acpi_ds_method_data_delete_value(u8 type, * * FUNCTION: acpi_ds_store_object_to_local * - * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or + * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or * ACPI_REFCLASS_ARG - * index - Which Local or Arg to set + * Index - Which Local or Arg to set * obj_desc - Value to be stored * walk_state - Current walk state * @@ -670,8 +670,8 @@ acpi_ds_store_object_to_local(u8 type, * * FUNCTION: acpi_ds_method_data_get_type * - * PARAMETERS: opcode - Either AML_LOCAL_OP or AML_ARG_OP - * index - Which Local or Arg whose type to get + * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP + * Index - Which Local or Arg whose type to get * walk_state - Current walk state object * * RETURN: Data type of current value of the selected Arg or Local diff --git a/trunk/drivers/acpi/acpica/dsobject.c b/trunk/drivers/acpi/acpica/dsobject.c index 68592dd34960..d7045ca3e32a 100644 --- a/trunk/drivers/acpi/acpica/dsobject.c +++ b/trunk/drivers/acpi/acpica/dsobject.c @@ -64,7 +64,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_build_internal_object * * PARAMETERS: walk_state - Current walk state - * op - Parser object to be translated + * Op - Parser object to be translated * obj_desc_ptr - Where the ACPI internal object is returned * * RETURN: Status @@ -250,7 +250,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_build_internal_buffer_obj * * PARAMETERS: walk_state - Current walk state - * op - Parser object to be translated + * Op - Parser object to be translated * buffer_length - Length of the buffer * obj_desc_ptr - Where the ACPI internal object is returned * @@ -354,7 +354,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_build_internal_package_obj * * PARAMETERS: walk_state - Current walk state - * op - Parser object to be translated + * Op - Parser object to be translated * element_count - Number of elements in the package - this is * the num_elements argument to Package() * obj_desc_ptr - Where the ACPI internal object is returned @@ -547,8 +547,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_create_node * * PARAMETERS: walk_state - Current walk state - * node - NS Node to be initialized - * op - Parser object to be translated + * Node - NS Node to be initialized + * Op - Parser object to be translated * * RETURN: Status * @@ -611,8 +611,8 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_init_object_from_op * * PARAMETERS: walk_state - Current walk state - * op - Parser op used to init the internal object - * opcode - AML opcode associated with the object + * Op - Parser op used to init the internal object + * Opcode - AML opcode associated with the object * ret_obj_desc - Namespace object to be initialized * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/dsopcode.c b/trunk/drivers/acpi/acpica/dsopcode.c index aa34d8984d34..e5eff7585102 100644 --- a/trunk/drivers/acpi/acpica/dsopcode.c +++ b/trunk/drivers/acpi/acpica/dsopcode.c @@ -286,7 +286,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode, * FUNCTION: acpi_ds_eval_buffer_field_operands * * PARAMETERS: walk_state - Current walk - * op - A valid buffer_field Op object + * Op - A valid buffer_field Op object * * RETURN: Status * @@ -370,7 +370,7 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_eval_region_operands * * PARAMETERS: walk_state - Current walk - * op - A valid region Op object + * Op - A valid region Op object * * RETURN: Status * @@ -397,7 +397,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, */ node = op->common.node; - /* next_op points to the op that holds the space_ID */ + /* next_op points to the op that holds the space_iD */ next_op = op->common.value.arg; @@ -461,7 +461,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_eval_table_region_operands * * PARAMETERS: walk_state - Current walk - * op - A valid region Op object + * Op - A valid region Op object * * RETURN: Status * @@ -560,7 +560,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_eval_data_object_operands * * PARAMETERS: walk_state - Current walk - * op - A valid data_object Op object + * Op - A valid data_object Op object * obj_desc - data_object * * RETURN: Status @@ -662,7 +662,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ds_eval_bank_field_operands * * PARAMETERS: walk_state - Current walk - * op - A valid bank_field Op object + * Op - A valid bank_field Op object * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/dsutils.c b/trunk/drivers/acpi/acpica/dsutils.c index 73a5447475f5..1abcda31037f 100644 --- a/trunk/drivers/acpi/acpica/dsutils.c +++ b/trunk/drivers/acpi/acpica/dsutils.c @@ -157,7 +157,7 @@ acpi_ds_do_implicit_return(union acpi_operand_object *return_desc, * * FUNCTION: acpi_ds_is_result_used * - * PARAMETERS: op - Current Op + * PARAMETERS: Op - Current Op * walk_state - Current State * * RETURN: TRUE if result is used, FALSE otherwise @@ -323,7 +323,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, * * FUNCTION: acpi_ds_delete_result_if_not_used * - * PARAMETERS: op - Current parse Op + * PARAMETERS: Op - Current parse Op * result_obj - Result of the operation * walk_state - Current state * @@ -445,7 +445,7 @@ void acpi_ds_clear_operands(struct acpi_walk_state *walk_state) * FUNCTION: acpi_ds_create_operand * * PARAMETERS: walk_state - Current walk state - * arg - Parse object for the argument + * Arg - Parse object for the argument * arg_index - Which argument (zero based) * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/dswscope.c b/trunk/drivers/acpi/acpica/dswscope.c index f6c4295470ae..9e9490a9cbf0 100644 --- a/trunk/drivers/acpi/acpica/dswscope.c +++ b/trunk/drivers/acpi/acpica/dswscope.c @@ -85,8 +85,8 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state) * * FUNCTION: acpi_ds_scope_stack_push * - * PARAMETERS: node - Name to be made current - * type - Type of frame being pushed + * PARAMETERS: Node - Name to be made current + * Type - Type of frame being pushed * walk_state - Current state * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/dswstate.c b/trunk/drivers/acpi/acpica/dswstate.c index d0e6555061e4..c9c2ac13e7cc 100644 --- a/trunk/drivers/acpi/acpica/dswstate.c +++ b/trunk/drivers/acpi/acpica/dswstate.c @@ -58,7 +58,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *ws); * * FUNCTION: acpi_ds_result_pop * - * PARAMETERS: object - Where to return the popped object + * PARAMETERS: Object - Where to return the popped object * walk_state - Current Walk state * * RETURN: Status @@ -132,7 +132,7 @@ acpi_ds_result_pop(union acpi_operand_object **object, * * FUNCTION: acpi_ds_result_push * - * PARAMETERS: object - Where to return the popped object + * PARAMETERS: Object - Where to return the popped object * walk_state - Current Walk state * * RETURN: Status @@ -296,7 +296,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state) * * FUNCTION: acpi_ds_obj_stack_push * - * PARAMETERS: object - Object to push + * PARAMETERS: Object - Object to push * walk_state - Current Walk state * * RETURN: Status @@ -433,7 +433,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count, * * FUNCTION: acpi_ds_get_current_walk_state * - * PARAMETERS: thread - Get current active state for this Thread + * PARAMETERS: Thread - Get current active state for this Thread * * RETURN: Pointer to the current walk state * @@ -462,7 +462,7 @@ struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state * FUNCTION: acpi_ds_push_walk_state * * PARAMETERS: walk_state - State to push - * thread - Thread state object + * Thread - Thread state object * * RETURN: None * @@ -486,7 +486,7 @@ acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, * * FUNCTION: acpi_ds_pop_walk_state * - * PARAMETERS: thread - Current thread state + * PARAMETERS: Thread - Current thread state * * RETURN: A walk_state object popped from the thread's stack * @@ -525,9 +525,9 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread) * FUNCTION: acpi_ds_create_walk_state * * PARAMETERS: owner_id - ID for object creation - * origin - Starting point for this walk + * Origin - Starting point for this walk * method_desc - Method object - * thread - Current thread state + * Thread - Current thread state * * RETURN: Pointer to the new walk state. * @@ -578,11 +578,11 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union * FUNCTION: acpi_ds_init_aml_walk * * PARAMETERS: walk_state - New state to be initialized - * op - Current parse op + * Op - Current parse op * method_node - Control method NS node, if any * aml_start - Start of AML * aml_length - Length of AML - * info - Method info block (params, etc.) + * Info - Method info block (params, etc.) * pass_number - 1, 2, or 3 * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/evevent.c b/trunk/drivers/acpi/acpica/evevent.c index d4acfbbe5b29..07e4dc44f81c 100644 --- a/trunk/drivers/acpi/acpica/evevent.c +++ b/trunk/drivers/acpi/acpica/evevent.c @@ -251,7 +251,7 @@ u32 acpi_ev_fixed_event_detect(void) * * FUNCTION: acpi_ev_fixed_event_dispatch * - * PARAMETERS: event - Event type + * PARAMETERS: Event - Event type * * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * diff --git a/trunk/drivers/acpi/acpica/evglock.c b/trunk/drivers/acpi/acpica/evglock.c index af14a7137632..cfeab38795d8 100644 --- a/trunk/drivers/acpi/acpica/evglock.c +++ b/trunk/drivers/acpi/acpica/evglock.c @@ -135,7 +135,7 @@ acpi_status acpi_ev_remove_global_lock_handler(void) * * FUNCTION: acpi_ev_global_lock_handler * - * PARAMETERS: context - From thread interface, not used + * PARAMETERS: Context - From thread interface, not used * * RETURN: ACPI_INTERRUPT_HANDLED * @@ -182,7 +182,7 @@ static u32 acpi_ev_global_lock_handler(void *context) * * FUNCTION: acpi_ev_acquire_global_lock * - * PARAMETERS: timeout - Max time to wait for the lock, in millisec. + * PARAMETERS: Timeout - Max time to wait for the lock, in millisec. * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/evgpe.c b/trunk/drivers/acpi/acpica/evgpe.c index afbd5cb391f6..8ba0e5f17091 100644 --- a/trunk/drivers/acpi/acpica/evgpe.c +++ b/trunk/drivers/acpi/acpica/evgpe.c @@ -466,7 +466,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) acpi_status status; struct acpi_gpe_event_info *local_gpe_event_info; struct acpi_evaluate_info *info; - struct acpi_gpe_notify_info *notify; + struct acpi_gpe_notify_object *notify_object; ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); @@ -517,17 +517,17 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) * completes. The notify handlers are NOT invoked synchronously * from this thread -- because handlers may in turn run other * control methods. - * - * June 2012: Expand implicit notify mechanism to support - * notifies on multiple device objects. */ - notify = local_gpe_event_info->dispatch.notify_list; - while (ACPI_SUCCESS(status) && notify) { - status = - acpi_ev_queue_notify_request(notify->device_node, - ACPI_NOTIFY_DEVICE_WAKE); - - notify = notify->next; + status = acpi_ev_queue_notify_request( + local_gpe_event_info->dispatch.device.node, + ACPI_NOTIFY_DEVICE_WAKE); + + notify_object = local_gpe_event_info->dispatch.device.next; + while (ACPI_SUCCESS(status) && notify_object) { + status = acpi_ev_queue_notify_request( + notify_object->node, + ACPI_NOTIFY_DEVICE_WAKE); + notify_object = notify_object->next; } break; diff --git a/trunk/drivers/acpi/acpica/evgpeblk.c b/trunk/drivers/acpi/acpica/evgpeblk.c index 8cf4c104c7b7..23a3ca86b2eb 100644 --- a/trunk/drivers/acpi/acpica/evgpeblk.c +++ b/trunk/drivers/acpi/acpica/evgpeblk.c @@ -318,7 +318,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) * FUNCTION: acpi_ev_create_gpe_block * * PARAMETERS: gpe_device - Handle to the parent GPE block - * gpe_block_address - Address and space_ID + * gpe_block_address - Address and space_iD * register_count - Number of GPE register pairs in the block * gpe_block_base_number - Starting GPE number for the block * interrupt_number - H/W interrupt for the block diff --git a/trunk/drivers/acpi/acpica/evgpeutil.c b/trunk/drivers/acpi/acpica/evgpeutil.c index cb50dd91bc18..3c43796b8361 100644 --- a/trunk/drivers/acpi/acpica/evgpeutil.c +++ b/trunk/drivers/acpi/acpica/evgpeutil.c @@ -54,7 +54,7 @@ ACPI_MODULE_NAME("evgpeutil") * FUNCTION: acpi_ev_walk_gpe_list * * PARAMETERS: gpe_walk_callback - Routine called for each GPE block - * context - Value passed to callback + * Context - Value passed to callback * * RETURN: Status * @@ -347,8 +347,6 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, void *context) { struct acpi_gpe_event_info *gpe_event_info; - struct acpi_gpe_notify_info *notify; - struct acpi_gpe_notify_info *next; u32 i; u32 j; @@ -367,28 +365,10 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { - - /* Delete an installed handler block */ - ACPI_FREE(gpe_event_info->dispatch.handler); gpe_event_info->dispatch.handler = NULL; gpe_event_info->flags &= ~ACPI_GPE_DISPATCH_MASK; - } else if ((gpe_event_info-> - flags & ACPI_GPE_DISPATCH_MASK) == - ACPI_GPE_DISPATCH_NOTIFY) { - - /* Delete the implicit notification device list */ - - notify = gpe_event_info->dispatch.notify_list; - while (notify) { - next = notify->next; - ACPI_FREE(notify); - notify = next; - } - gpe_event_info->dispatch.notify_list = NULL; - gpe_event_info->flags &= - ~ACPI_GPE_DISPATCH_MASK; } } } diff --git a/trunk/drivers/acpi/acpica/evmisc.c b/trunk/drivers/acpi/acpica/evmisc.c index 51f537937c1f..51ef9f5e002d 100644 --- a/trunk/drivers/acpi/acpica/evmisc.c +++ b/trunk/drivers/acpi/acpica/evmisc.c @@ -56,7 +56,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context); * * FUNCTION: acpi_ev_is_notify_object * - * PARAMETERS: node - Node to check + * PARAMETERS: Node - Node to check * * RETURN: TRUE if notifies allowed on this object * @@ -86,7 +86,7 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) * * FUNCTION: acpi_ev_queue_notify_request * - * PARAMETERS: node - NS node for the notified object + * PARAMETERS: Node - NS node for the notified object * notify_value - Value from the Notify() request * * RETURN: Status @@ -101,77 +101,102 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, u32 notify_value) { union acpi_operand_object *obj_desc; - union acpi_operand_object *handler_list_head = NULL; - union acpi_generic_state *info; - u8 handler_list_id = 0; + union acpi_operand_object *handler_obj = NULL; + union acpi_generic_state *notify_info; acpi_status status = AE_OK; ACPI_FUNCTION_NAME(ev_queue_notify_request); - /* Are Notifies allowed on this object? */ - - if (!acpi_ev_is_notify_object(node)) { - return (AE_TYPE); - } - - /* Get the correct notify list type (System or Device) */ - - if (notify_value <= ACPI_MAX_SYS_NOTIFY) { - handler_list_id = ACPI_SYSTEM_HANDLER_LIST; - } else { - handler_list_id = ACPI_DEVICE_HANDLER_LIST; - } + /* + * For value 0x03 (Ejection Request), may need to run a device method. + * For value 0x02 (Device Wake), if _PRW exists, may need to run + * the _PS0 method. + * For value 0x80 (Status Change) on the power button or sleep button, + * initiate soft-off or sleep operation. + * + * For all cases, simply dispatch the notify to the handler. + */ + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", + acpi_ut_get_node_name(node), + acpi_ut_get_type_name(node->type), notify_value, + acpi_ut_get_notify_name(notify_value), node)); - /* Get the notify object attached to the namespace Node */ + /* Get the notify object attached to the NS Node */ obj_desc = acpi_ns_get_attached_object(node); if (obj_desc) { - /* We have an attached object, Get the correct handler list */ + /* We have the notify object, Get the correct handler */ - handler_list_head = - obj_desc->common_notify.notify_list[handler_list_id]; - } + switch (node->type) { - /* - * If there is no notify handler (Global or Local) - * for this object, just ignore the notify - */ - if (!acpi_gbl_global_notify[handler_list_id].handler - && !handler_list_head) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n", - acpi_ut_get_node_name(node), notify_value, - node)); + /* Notify is allowed only on these types */ - return (AE_OK); - } + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_THERMAL: + case ACPI_TYPE_PROCESSOR: - /* Setup notify info and schedule the notify dispatcher */ + if (notify_value <= ACPI_MAX_SYS_NOTIFY) { + handler_obj = + obj_desc->common_notify.system_notify; + } else { + handler_obj = + obj_desc->common_notify.device_notify; + } + break; + + default: + + /* All other types are not supported */ - info = acpi_ut_create_generic_state(); - if (!info) { - return (AE_NO_MEMORY); + return (AE_TYPE); + } } - info->common.descriptor_type = ACPI_DESC_TYPE_STATE_NOTIFY; + /* + * If there is a handler to run, schedule the dispatcher. + * Check for: + * 1) Global system notify handler + * 2) Global device notify handler + * 3) Per-device notify handler + */ + if ((acpi_gbl_system_notify.handler && + (notify_value <= ACPI_MAX_SYS_NOTIFY)) || + (acpi_gbl_device_notify.handler && + (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) { + notify_info = acpi_ut_create_generic_state(); + if (!notify_info) { + return (AE_NO_MEMORY); + } - info->notify.node = node; - info->notify.value = (u16)notify_value; - info->notify.handler_list_id = handler_list_id; - info->notify.handler_list_head = handler_list_head; - info->notify.global = &acpi_gbl_global_notify[handler_list_id]; + if (!handler_obj) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Executing system notify handler for Notify (%4.4s, %X) " + "node %p\n", + acpi_ut_get_node_name(node), + notify_value, node)); + } - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", - acpi_ut_get_node_name(node), - acpi_ut_get_type_name(node->type), notify_value, - acpi_ut_get_notify_name(notify_value), node)); + notify_info->common.descriptor_type = + ACPI_DESC_TYPE_STATE_NOTIFY; + notify_info->notify.node = node; + notify_info->notify.value = (u16) notify_value; + notify_info->notify.handler_obj = handler_obj; - status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, - info); - if (ACPI_FAILURE(status)) { - acpi_ut_delete_generic_state(info); + status = + acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, + notify_info); + if (ACPI_FAILURE(status)) { + acpi_ut_delete_generic_state(notify_info); + } + } else { + /* There is no notify handler (per-device or system) for this device */ + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "No notify handler for Notify (%4.4s, %X) node %p\n", + acpi_ut_get_node_name(node), notify_value, + node)); } return (status); @@ -181,7 +206,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, * * FUNCTION: acpi_ev_notify_dispatch * - * PARAMETERS: context - To be passed to the notify handler + * PARAMETERS: Context - To be passed to the notify handler * * RETURN: None. * @@ -192,34 +217,60 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) { - union acpi_generic_state *info = (union acpi_generic_state *)context; + union acpi_generic_state *notify_info = + (union acpi_generic_state *)context; + acpi_notify_handler global_handler = NULL; + void *global_context = NULL; union acpi_operand_object *handler_obj; ACPI_FUNCTION_ENTRY(); - /* Invoke a global notify handler if installed */ + /* + * We will invoke a global notify handler if installed. This is done + * _before_ we invoke the per-device handler attached to the device. + */ + if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { + + /* Global system notification handler */ + + if (acpi_gbl_system_notify.handler) { + global_handler = acpi_gbl_system_notify.handler; + global_context = acpi_gbl_system_notify.context; + } + } else { + /* Global driver notification handler */ + + if (acpi_gbl_device_notify.handler) { + global_handler = acpi_gbl_device_notify.handler; + global_context = acpi_gbl_device_notify.context; + } + } + + /* Invoke the system handler first, if present */ - if (info->notify.global->handler) { - info->notify.global->handler(info->notify.node, - info->notify.value, - info->notify.global->context); + if (global_handler) { + global_handler(notify_info->notify.node, + notify_info->notify.value, global_context); } - /* Now invoke the local notify handler(s) if any are installed */ + /* Now invoke the per-device handler, if present */ - handler_obj = info->notify.handler_list_head; - while (handler_obj) { - handler_obj->notify.handler(info->notify.node, - info->notify.value, - handler_obj->notify.context); + handler_obj = notify_info->notify.handler_obj; + if (handler_obj) { + struct acpi_object_notify_handler *notifier; - handler_obj = - handler_obj->notify.next[info->notify.handler_list_id]; + notifier = &handler_obj->notify; + while (notifier) { + notifier->handler(notify_info->notify.node, + notify_info->notify.value, + notifier->context); + notifier = notifier->next; + } } /* All done with the info object */ - acpi_ut_delete_generic_state(info); + acpi_ut_delete_generic_state(notify_info); } #if (!ACPI_REDUCED_HARDWARE) diff --git a/trunk/drivers/acpi/acpica/evregion.c b/trunk/drivers/acpi/acpica/evregion.c index 0cc6a16fedc7..1b0180a1b798 100644 --- a/trunk/drivers/acpi/acpica/evregion.c +++ b/trunk/drivers/acpi/acpica/evregion.c @@ -150,7 +150,7 @@ acpi_status acpi_ev_install_region_handlers(void) * * FUNCTION: acpi_ev_has_default_handler * - * PARAMETERS: node - Namespace node for the device + * PARAMETERS: Node - Namespace node for the device * space_id - The address space ID * * RETURN: TRUE if default handler is installed, FALSE otherwise @@ -244,7 +244,7 @@ acpi_status acpi_ev_initialize_op_regions(void) * FUNCTION: acpi_ev_execute_reg_method * * PARAMETERS: region_obj - Region object - * function - Passed to _REG: On (1) or Off (0) + * Function - Passed to _REG: On (1) or Off (0) * * RETURN: Status * @@ -286,10 +286,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) /* * The _REG method has two arguments: * - * arg0 - Integer: + * Arg0 - Integer: * Operation region space ID Same value as region_obj->Region.space_id * - * arg1 - Integer: + * Arg1 - Integer: * connection status 1 for connecting the handler, 0 for disconnecting * the handler (Passed as a parameter) */ @@ -330,10 +330,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) * * PARAMETERS: region_obj - Internal region object * field_obj - Corresponding field. Can be NULL. - * function - Read or Write operation + * Function - Read or Write operation * region_offset - Where in the region to read or write * bit_width - Field width in bits (8, 16, 32, or 64) - * value - Pointer to in or out value, must be + * Value - Pointer to in or out value, must be * a full 64-bit integer * * RETURN: Status @@ -840,11 +840,11 @@ acpi_ev_install_handler(acpi_handle obj_handle, * * FUNCTION: acpi_ev_install_space_handler * - * PARAMETERS: node - Namespace node for the device + * PARAMETERS: Node - Namespace node for the device * space_id - The address space ID - * handler - Address of the handler - * setup - Address of the setup function - * context - Value passed to the handler on each access + * Handler - Address of the handler + * Setup - Address of the setup function + * Context - Value passed to the handler on each access * * RETURN: Status * @@ -1061,7 +1061,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, * * FUNCTION: acpi_ev_execute_reg_methods * - * PARAMETERS: node - Namespace node for the device + * PARAMETERS: Node - Namespace node for the device * space_id - The address space ID * * RETURN: Status @@ -1104,7 +1104,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, * * PARAMETERS: walk_namespace callback * - * DESCRIPTION: Run _REG method for region objects of the requested spaceID + * DESCRIPTION: Run _REG method for region objects of the requested space_iD * ******************************************************************************/ diff --git a/trunk/drivers/acpi/acpica/evrgnini.c b/trunk/drivers/acpi/acpica/evrgnini.c index 4c1c8261166f..819c17f5897a 100644 --- a/trunk/drivers/acpi/acpica/evrgnini.c +++ b/trunk/drivers/acpi/acpica/evrgnini.c @@ -56,8 +56,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node); * * FUNCTION: acpi_ev_system_memory_region_setup * - * PARAMETERS: handle - Region we are interested in - * function - Start or stop + * PARAMETERS: Handle - Region we are interested in + * Function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * @@ -118,8 +118,8 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, * * FUNCTION: acpi_ev_io_space_region_setup * - * PARAMETERS: handle - Region we are interested in - * function - Start or stop + * PARAMETERS: Handle - Region we are interested in + * Function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * @@ -149,8 +149,8 @@ acpi_ev_io_space_region_setup(acpi_handle handle, * * FUNCTION: acpi_ev_pci_config_region_setup * - * PARAMETERS: handle - Region we are interested in - * function - Start or stop + * PARAMETERS: Handle - Region we are interested in + * Function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * @@ -338,7 +338,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, * * FUNCTION: acpi_ev_is_pci_root_bridge * - * PARAMETERS: node - Device node being examined + * PARAMETERS: Node - Device node being examined * * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge * @@ -393,14 +393,14 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) * * FUNCTION: acpi_ev_pci_bar_region_setup * - * PARAMETERS: handle - Region we are interested in - * function - Start or stop + * PARAMETERS: Handle - Region we are interested in + * Function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * - * DESCRIPTION: Setup a pci_BAR operation region + * DESCRIPTION: Setup a pci_bAR operation region * * MUTEX: Assumes namespace is not locked * @@ -420,8 +420,8 @@ acpi_ev_pci_bar_region_setup(acpi_handle handle, * * FUNCTION: acpi_ev_cmos_region_setup * - * PARAMETERS: handle - Region we are interested in - * function - Start or stop + * PARAMETERS: Handle - Region we are interested in + * Function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * @@ -447,8 +447,8 @@ acpi_ev_cmos_region_setup(acpi_handle handle, * * FUNCTION: acpi_ev_default_region_setup * - * PARAMETERS: handle - Region we are interested in - * function - Start or stop + * PARAMETERS: Handle - Region we are interested in + * Function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * diff --git a/trunk/drivers/acpi/acpica/evsci.c b/trunk/drivers/acpi/acpica/evsci.c index f9661e2b46a9..6a57aa2d70d1 100644 --- a/trunk/drivers/acpi/acpica/evsci.c +++ b/trunk/drivers/acpi/acpica/evsci.c @@ -56,7 +56,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context); * * FUNCTION: acpi_ev_sci_xrupt_handler * - * PARAMETERS: context - Calling Context + * PARAMETERS: Context - Calling Context * * RETURN: Status code indicates whether interrupt was handled. * @@ -96,7 +96,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context) * * FUNCTION: acpi_ev_gpe_xrupt_handler * - * PARAMETERS: context - Calling Context + * PARAMETERS: Context - Calling Context * * RETURN: Status code indicates whether interrupt was handled. * diff --git a/trunk/drivers/acpi/acpica/evxface.c b/trunk/drivers/acpi/acpica/evxface.c index 7587eb6c9584..44bef5744ebb 100644 --- a/trunk/drivers/acpi/acpica/evxface.c +++ b/trunk/drivers/acpi/acpica/evxface.c @@ -52,27 +52,88 @@ ACPI_MODULE_NAME("evxface") +/******************************************************************************* + * + * FUNCTION: acpi_populate_handler_object + * + * PARAMETERS: handler_obj - Handler object to populate + * handler_type - The type of handler: + * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) + * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) + * ACPI_ALL_NOTIFY: both system and device + * handler - Address of the handler + * context - Value passed to the handler on each GPE + * next - Address of a handler object to link to + * + * RETURN: None + * + * DESCRIPTION: Populate a handler object. + * + ******************************************************************************/ +static void +acpi_populate_handler_object(struct acpi_object_notify_handler *handler_obj, + u32 handler_type, + acpi_notify_handler handler, void *context, + struct acpi_object_notify_handler *next) +{ + handler_obj->handler_type = handler_type; + handler_obj->handler = handler; + handler_obj->context = context; + handler_obj->next = next; +} + +/******************************************************************************* + * + * FUNCTION: acpi_add_handler_object + * + * PARAMETERS: parent_obj - Parent of the new object + * handler - Address of the handler + * context - Value passed to the handler on each GPE + * + * RETURN: Status + * + * DESCRIPTION: Create a new handler object and populate it. + * + ******************************************************************************/ +static acpi_status +acpi_add_handler_object(struct acpi_object_notify_handler *parent_obj, + acpi_notify_handler handler, void *context) +{ + struct acpi_object_notify_handler *handler_obj; + + /* The parent must not be a defice notify handler object. */ + if (parent_obj->handler_type & ACPI_DEVICE_NOTIFY) + return AE_BAD_PARAMETER; + + handler_obj = ACPI_ALLOCATE_ZEROED(sizeof(*handler_obj)); + if (!handler_obj) + return AE_NO_MEMORY; + + acpi_populate_handler_object(handler_obj, + ACPI_SYSTEM_NOTIFY, + handler, context, + parent_obj->next); + parent_obj->next = handler_obj; + + return AE_OK; +} + + /******************************************************************************* * * FUNCTION: acpi_install_notify_handler * * PARAMETERS: Device - The device for which notifies will be handled * handler_type - The type of handler: - * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) - * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) - * ACPI_ALL_NOTIFY: Both System and Device + * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) + * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) + * ACPI_ALL_NOTIFY: both system and device * Handler - Address of the handler * Context - Value passed to the handler on each GPE * * RETURN: Status * - * DESCRIPTION: Install a handler for notifications on an ACPI Device, - * thermal_zone, or Processor object. - * - * NOTES: The Root namespace object may have only one handler for each - * type of notify (System/Device). Device/Thermal/Processor objects - * may have one device notify handler, and multiple system notify - * handlers. + * DESCRIPTION: Install a handler for notifies on an ACPI device * ******************************************************************************/ acpi_status @@ -80,19 +141,17 @@ acpi_install_notify_handler(acpi_handle device, u32 handler_type, acpi_notify_handler handler, void *context) { - struct acpi_namespace_node *node = - ACPI_CAST_PTR(struct acpi_namespace_node, device); union acpi_operand_object *obj_desc; - union acpi_operand_object *handler_obj; + union acpi_operand_object *notify_obj; + struct acpi_namespace_node *node; acpi_status status; - u32 i; ACPI_FUNCTION_TRACE(acpi_install_notify_handler); /* Parameter validation */ - if ((!device) || (!handler) || (!handler_type) || - (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { + if ((!device) || + (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { return_ACPI_STATUS(AE_BAD_PARAMETER); } @@ -101,112 +160,144 @@ acpi_install_notify_handler(acpi_handle device, return_ACPI_STATUS(status); } + /* Convert and validate the device handle */ + + node = acpi_ns_validate_handle(device); + if (!node) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + /* * Root Object: * Registering a notify handler on the root object indicates that the * caller wishes to receive notifications for all objects. Note that - * only one global handler can be registered per notify type. - * Ensure that a handler is not already installed. + * only one global handler can be regsitered (per notify type). */ if (device == ACPI_ROOT_OBJECT) { - for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { - if (handler_type & (i + 1)) { - if (acpi_gbl_global_notify[i].handler) { - status = AE_ALREADY_EXISTS; - goto unlock_and_exit; - } - acpi_gbl_global_notify[i].handler = handler; - acpi_gbl_global_notify[i].context = context; - } + /* Make sure the handler is not already installed */ + + if (((handler_type & ACPI_SYSTEM_NOTIFY) && + acpi_gbl_system_notify.handler) || + ((handler_type & ACPI_DEVICE_NOTIFY) && + acpi_gbl_device_notify.handler)) { + status = AE_ALREADY_EXISTS; + goto unlock_and_exit; + } + + if (handler_type & ACPI_SYSTEM_NOTIFY) { + acpi_gbl_system_notify.node = node; + acpi_gbl_system_notify.handler = handler; + acpi_gbl_system_notify.context = context; } - goto unlock_and_exit; /* Global notify handler installed, all done */ + if (handler_type & ACPI_DEVICE_NOTIFY) { + acpi_gbl_device_notify.node = node; + acpi_gbl_device_notify.handler = handler; + acpi_gbl_device_notify.context = context; + } + + /* Global notify handler installed */ } /* * All Other Objects: - * Caller will only receive notifications specific to the target - * object. Note that only certain object types are allowed to - * receive notifications. + * Caller will only receive notifications specific to the target object. + * Note that only certain object types can receive notifications. */ + else { + /* Notifies allowed on this object? */ - /* Are Notifies allowed on this object? */ - - if (!acpi_ev_is_notify_object(node)) { - status = AE_TYPE; - goto unlock_and_exit; - } + if (!acpi_ev_is_notify_object(node)) { + status = AE_TYPE; + goto unlock_and_exit; + } - /* Check for an existing internal object, might not exist */ + /* Check for an existing internal object */ - obj_desc = acpi_ns_get_attached_object(node); - if (!obj_desc) { + obj_desc = acpi_ns_get_attached_object(node); + if (obj_desc) { - /* Create a new object */ + /* Object exists. */ - obj_desc = acpi_ut_create_internal_object(node->type); - if (!obj_desc) { - status = AE_NO_MEMORY; - goto unlock_and_exit; - } + /* For a device notify, make sure there's no handler. */ + if ((handler_type & ACPI_DEVICE_NOTIFY) && + obj_desc->common_notify.device_notify) { + status = AE_ALREADY_EXISTS; + goto unlock_and_exit; + } - /* Attach new object to the Node, remove local reference */ + /* System notifies may have more handlers installed. */ + notify_obj = obj_desc->common_notify.system_notify; - status = acpi_ns_attach_object(device, obj_desc, node->type); - acpi_ut_remove_reference(obj_desc); - if (ACPI_FAILURE(status)) { - goto unlock_and_exit; - } - } + if ((handler_type & ACPI_SYSTEM_NOTIFY) && notify_obj) { + struct acpi_object_notify_handler *parent_obj; - /* Ensure that the handler is not already installed in the lists */ - - for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { - if (handler_type & (i + 1)) { - handler_obj = obj_desc->common_notify.notify_list[i]; - while (handler_obj) { - if (handler_obj->notify.handler == handler) { + if (handler_type & ACPI_DEVICE_NOTIFY) { status = AE_ALREADY_EXISTS; goto unlock_and_exit; } - handler_obj = handler_obj->notify.next[i]; + parent_obj = ¬ify_obj->notify; + status = acpi_add_handler_object(parent_obj, + handler, + context); + goto unlock_and_exit; } - } - } + } else { + /* Create a new object */ - /* Create and populate a new notify handler object */ + obj_desc = acpi_ut_create_internal_object(node->type); + if (!obj_desc) { + status = AE_NO_MEMORY; + goto unlock_and_exit; + } - handler_obj = acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); - if (!handler_obj) { - status = AE_NO_MEMORY; - goto unlock_and_exit; - } + /* Attach new object to the Node */ + + status = + acpi_ns_attach_object(device, obj_desc, node->type); + + /* Remove local reference to the object */ + + acpi_ut_remove_reference(obj_desc); + if (ACPI_FAILURE(status)) { + goto unlock_and_exit; + } + } - handler_obj->notify.node = node; - handler_obj->notify.handler_type = handler_type; - handler_obj->notify.handler = handler; - handler_obj->notify.context = context; + /* Install the handler */ - /* Install the handler at the list head(s) */ + notify_obj = + acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); + if (!notify_obj) { + status = AE_NO_MEMORY; + goto unlock_and_exit; + } - for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { - if (handler_type & (i + 1)) { - handler_obj->notify.next[i] = - obj_desc->common_notify.notify_list[i]; + acpi_populate_handler_object(¬ify_obj->notify, + handler_type, + handler, context, + NULL); - obj_desc->common_notify.notify_list[i] = handler_obj; + if (handler_type & ACPI_SYSTEM_NOTIFY) { + obj_desc->common_notify.system_notify = notify_obj; } - } - /* Add an extra reference if handler was installed in both lists */ + if (handler_type & ACPI_DEVICE_NOTIFY) { + obj_desc->common_notify.device_notify = notify_obj; + } + + if (handler_type == ACPI_ALL_NOTIFY) { - if (handler_type == ACPI_ALL_NOTIFY) { - acpi_ut_add_reference(handler_obj); + /* Extra ref if installed in both */ + + acpi_ut_add_reference(notify_obj); + } } -unlock_and_exit: + unlock_and_exit: (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); return_ACPI_STATUS(status); } @@ -217,11 +308,11 @@ ACPI_EXPORT_SYMBOL(acpi_install_notify_handler) * * FUNCTION: acpi_remove_notify_handler * - * PARAMETERS: Device - The device for which the handler is installed + * PARAMETERS: Device - The device for which notifies will be handled * handler_type - The type of handler: - * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) - * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) - * ACPI_ALL_NOTIFY: Both System and Device + * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) + * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) + * ACPI_ALL_NOTIFY: both system and device * Handler - Address of the handler * * RETURN: Status @@ -233,106 +324,165 @@ acpi_status acpi_remove_notify_handler(acpi_handle device, u32 handler_type, acpi_notify_handler handler) { - struct acpi_namespace_node *node = - ACPI_CAST_PTR(struct acpi_namespace_node, device); + union acpi_operand_object *notify_obj; union acpi_operand_object *obj_desc; - union acpi_operand_object *handler_obj; - union acpi_operand_object *previous_handler_obj; + struct acpi_namespace_node *node; acpi_status status; - u32 i; ACPI_FUNCTION_TRACE(acpi_remove_notify_handler); /* Parameter validation */ - if ((!device) || (!handler) || (!handler_type) || - (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { - return_ACPI_STATUS(AE_BAD_PARAMETER); + if ((!device) || + (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { + status = AE_BAD_PARAMETER; + goto exit; } - /* Make sure all deferred tasks are completed */ - acpi_os_wait_events_complete(); + + /* Make sure all deferred tasks are completed */ + acpi_os_wait_events_complete(NULL); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); + goto exit; } - /* Root Object. Global handlers are removed here */ + /* Convert and validate the device handle */ + + node = acpi_ns_validate_handle(device); + if (!node) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + + /* Root Object */ if (device == ACPI_ROOT_OBJECT) { - for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { - if (handler_type & (i + 1)) { - if (!acpi_gbl_global_notify[i].handler || - (acpi_gbl_global_notify[i].handler != - handler)) { - status = AE_NOT_EXIST; - goto unlock_and_exit; - } + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Removing notify handler for namespace root object\n")); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Removing global notify handler\n")); + if (((handler_type & ACPI_SYSTEM_NOTIFY) && + !acpi_gbl_system_notify.handler) || + ((handler_type & ACPI_DEVICE_NOTIFY) && + !acpi_gbl_device_notify.handler)) { + status = AE_NOT_EXIST; + goto unlock_and_exit; + } - acpi_gbl_global_notify[i].handler = NULL; - acpi_gbl_global_notify[i].context = NULL; - } + if (handler_type & ACPI_SYSTEM_NOTIFY) { + acpi_gbl_system_notify.node = NULL; + acpi_gbl_system_notify.handler = NULL; + acpi_gbl_system_notify.context = NULL; } - goto unlock_and_exit; + if (handler_type & ACPI_DEVICE_NOTIFY) { + acpi_gbl_device_notify.node = NULL; + acpi_gbl_device_notify.handler = NULL; + acpi_gbl_device_notify.context = NULL; + } } - /* All other objects: Are Notifies allowed on this object? */ + /* All Other Objects */ - if (!acpi_ev_is_notify_object(node)) { - status = AE_TYPE; - goto unlock_and_exit; - } + else { + /* Notifies allowed on this object? */ - /* Must have an existing internal object */ + if (!acpi_ev_is_notify_object(node)) { + status = AE_TYPE; + goto unlock_and_exit; + } - obj_desc = acpi_ns_get_attached_object(node); - if (!obj_desc) { - status = AE_NOT_EXIST; - goto unlock_and_exit; - } + /* Check for an existing internal object */ - /* Internal object exists. Find the handler and remove it */ + obj_desc = acpi_ns_get_attached_object(node); + if (!obj_desc) { + status = AE_NOT_EXIST; + goto unlock_and_exit; + } - for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { - if (handler_type & (i + 1)) { - handler_obj = obj_desc->common_notify.notify_list[i]; - previous_handler_obj = NULL; + /* Object exists - make sure there's an existing handler */ - /* Attempt to find the handler in the handler list */ + if (handler_type & ACPI_SYSTEM_NOTIFY) { + struct acpi_object_notify_handler *handler_obj; + struct acpi_object_notify_handler *parent_obj; - while (handler_obj && - (handler_obj->notify.handler != handler)) { - previous_handler_obj = handler_obj; - handler_obj = handler_obj->notify.next[i]; + notify_obj = obj_desc->common_notify.system_notify; + if (!notify_obj) { + status = AE_NOT_EXIST; + goto unlock_and_exit; } - if (!handler_obj) { - status = AE_NOT_EXIST; + handler_obj = ¬ify_obj->notify; + parent_obj = NULL; + while (handler_obj->handler != handler) { + if (handler_obj->next) { + parent_obj = handler_obj; + handler_obj = handler_obj->next; + } else { + break; + } + } + + if (handler_obj->handler != handler) { + status = AE_BAD_PARAMETER; goto unlock_and_exit; } - /* Remove the handler object from the list */ + /* + * Remove the handler. There are three possible cases. + * First, we may need to remove a non-embedded object. + * Second, we may need to remove the embedded object's + * handler data, while non-embedded objects exist. + * Finally, we may need to remove the embedded object + * entirely along with its container. + */ + if (parent_obj) { + /* Non-embedded object is being removed. */ + parent_obj->next = handler_obj->next; + ACPI_FREE(handler_obj); + } else if (notify_obj->notify.next) { + /* + * The handler matches the embedded object, but + * there are more handler objects in the list. + * Replace the embedded object's data with the + * first next object's data and remove that + * object. + */ + parent_obj = ¬ify_obj->notify; + handler_obj = notify_obj->notify.next; + *parent_obj = *handler_obj; + ACPI_FREE(handler_obj); + } else { + /* No more handler objects in the list. */ + obj_desc->common_notify.system_notify = NULL; + acpi_ut_remove_reference(notify_obj); + } + } - if (previous_handler_obj) { /* Handler is not at the list head */ - previous_handler_obj->notify.next[i] = - handler_obj->notify.next[i]; - } else { /* Handler is at the list head */ + if (handler_type & ACPI_DEVICE_NOTIFY) { + notify_obj = obj_desc->common_notify.device_notify; + if (!notify_obj) { + status = AE_NOT_EXIST; + goto unlock_and_exit; + } - obj_desc->common_notify.notify_list[i] = - handler_obj->notify.next[i]; + if (notify_obj->notify.handler != handler) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; } - acpi_ut_remove_reference(handler_obj); + /* Remove the handler */ + obj_desc->common_notify.device_notify = NULL; + acpi_ut_remove_reference(notify_obj); } } -unlock_and_exit: + unlock_and_exit: (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); + exit: + if (ACPI_FAILURE(status)) + ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler")); return_ACPI_STATUS(status); } @@ -342,7 +492,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler) * * FUNCTION: acpi_install_exception_handler * - * PARAMETERS: handler - Pointer to the handler function for the + * PARAMETERS: Handler - Pointer to the handler function for the * event * * RETURN: Status @@ -386,8 +536,8 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) * * FUNCTION: acpi_install_global_event_handler * - * PARAMETERS: handler - Pointer to the global event handler function - * context - Value passed to the handler on each event + * PARAMETERS: Handler - Pointer to the global event handler function + * Context - Value passed to the handler on each event * * RETURN: Status * @@ -436,10 +586,10 @@ ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler) * * FUNCTION: acpi_install_fixed_event_handler * - * PARAMETERS: event - Event type to enable. - * handler - Pointer to the handler function for the + * PARAMETERS: Event - Event type to enable. + * Handler - Pointer to the handler function for the * event - * context - Value passed to the handler on each GPE + * Context - Value passed to the handler on each GPE * * RETURN: Status * @@ -506,8 +656,8 @@ ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler) * * FUNCTION: acpi_remove_fixed_event_handler * - * PARAMETERS: event - Event type to disable. - * handler - Address of the handler + * PARAMETERS: Event - Event type to disable. + * Handler - Address of the handler * * RETURN: Status * @@ -563,10 +713,10 @@ ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler) * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT * defined GPEs) * gpe_number - The GPE number within the GPE block - * type - Whether this GPE should be treated as an + * Type - Whether this GPE should be treated as an * edge- or level-triggered interrupt. - * address - Address of the handler - * context - Value passed to the handler on each GPE + * Address - Address of the handler + * Context - Value passed to the handler on each GPE * * RETURN: Status * @@ -673,7 +823,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler) * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT * defined GPEs) * gpe_number - The event to remove a handler - * address - Address of the handler + * Address - Address of the handler * * RETURN: Status * @@ -699,7 +849,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, /* Make sure all deferred tasks are completed */ - acpi_os_wait_events_complete(); + acpi_os_wait_events_complete(NULL); status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); if (ACPI_FAILURE(status)) { @@ -769,8 +919,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler) * * FUNCTION: acpi_acquire_global_lock * - * PARAMETERS: timeout - How long the caller is willing to wait - * handle - Where the handle to the lock is returned + * PARAMETERS: Timeout - How long the caller is willing to wait + * Handle - Where the handle to the lock is returned * (if acquired) * * RETURN: Status @@ -817,7 +967,7 @@ ACPI_EXPORT_SYMBOL(acpi_acquire_global_lock) * * FUNCTION: acpi_release_global_lock * - * PARAMETERS: handle - Returned from acpi_acquire_global_lock + * PARAMETERS: Handle - Returned from acpi_acquire_global_lock * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/evxfevnt.c b/trunk/drivers/acpi/acpica/evxfevnt.c index 35520c6eeefb..77cee5a5e891 100644 --- a/trunk/drivers/acpi/acpica/evxfevnt.c +++ b/trunk/drivers/acpi/acpica/evxfevnt.c @@ -153,8 +153,8 @@ ACPI_EXPORT_SYMBOL(acpi_disable) * * FUNCTION: acpi_enable_event * - * PARAMETERS: event - The fixed eventto be enabled - * flags - Reserved + * PARAMETERS: Event - The fixed eventto be enabled + * Flags - Reserved * * RETURN: Status * @@ -265,7 +265,7 @@ ACPI_EXPORT_SYMBOL(acpi_disable_event) * * FUNCTION: acpi_clear_event * - * PARAMETERS: event - The fixed event to be cleared + * PARAMETERS: Event - The fixed event to be cleared * * RETURN: Status * @@ -301,7 +301,7 @@ ACPI_EXPORT_SYMBOL(acpi_clear_event) * * FUNCTION: acpi_get_event_status * - * PARAMETERS: event - The fixed event + * PARAMETERS: Event - The fixed event * event_status - Where the current status of the event will * be returned * diff --git a/trunk/drivers/acpi/acpica/evxfgpe.c b/trunk/drivers/acpi/acpica/evxfgpe.c index 6affbdb4b88c..86f9b343ebd4 100644 --- a/trunk/drivers/acpi/acpica/evxfgpe.c +++ b/trunk/drivers/acpi/acpica/evxfgpe.c @@ -197,12 +197,12 @@ acpi_status acpi_setup_gpe_for_wake(acpi_handle wake_device, acpi_handle gpe_device, u32 gpe_number) { - acpi_status status; + acpi_status status = AE_BAD_PARAMETER; struct acpi_gpe_event_info *gpe_event_info; struct acpi_namespace_node *device_node; - struct acpi_gpe_notify_info *notify; - struct acpi_gpe_notify_info *new_notify; + struct acpi_gpe_notify_object *notify_object; acpi_cpu_flags flags; + u8 gpe_dispatch_mask; ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); @@ -216,95 +216,63 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device, return_ACPI_STATUS(AE_BAD_PARAMETER); } - /* Handle root object case */ - - if (wake_device == ACPI_ROOT_OBJECT) { - device_node = acpi_gbl_root_node; - } else { - device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); - } - - /* Validate WakeDevice is of type Device */ - - if (device_node->type != ACPI_TYPE_DEVICE) { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - /* - * Allocate a new notify object up front, in case it is needed. - * Memory allocation while holding a spinlock is a big no-no - * on some hosts. - */ - new_notify = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_notify_info)); - if (!new_notify) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); /* Ensure that we have a valid GPE number */ gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); if (!gpe_event_info) { - status = AE_BAD_PARAMETER; goto unlock_and_exit; } + if (wake_device == ACPI_ROOT_OBJECT) { + goto out; + } + /* * If there is no method or handler for this GPE, then the - * wake_device will be notified whenever this GPE fires. This is - * known as an "implicit notify". Note: The GPE is assumed to be + * wake_device will be notified whenever this GPE fires (aka + * "implicit notify") Note: The GPE is assumed to be * level-triggered (for windows compatibility). */ - if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == - ACPI_GPE_DISPATCH_NONE) { - /* - * This is the first device for implicit notify on this GPE. - * Just set the flags here, and enter the NOTIFY block below. - */ - gpe_event_info->flags = - (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); + gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK; + if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE + && gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) { + goto out; } - /* - * If we already have an implicit notify on this GPE, add - * this device to the notify list. - */ - if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == - ACPI_GPE_DISPATCH_NOTIFY) { - - /* Ensure that the device is not already in the list */ - - notify = gpe_event_info->dispatch.notify_list; - while (notify) { - if (notify->device_node == device_node) { - status = AE_ALREADY_EXISTS; - goto unlock_and_exit; - } - notify = notify->next; - } - - /* Add this device to the notify list for this GPE */ + /* Validate wake_device is of type Device */ - new_notify->device_node = device_node; - new_notify->next = gpe_event_info->dispatch.notify_list; - gpe_event_info->dispatch.notify_list = new_notify; - new_notify = NULL; + device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); + if (device_node->type != ACPI_TYPE_DEVICE) { + goto unlock_and_exit; } - /* Mark the GPE as a possible wake event */ + if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) { + gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | + ACPI_GPE_LEVEL_TRIGGERED); + gpe_event_info->dispatch.device.node = device_node; + gpe_event_info->dispatch.device.next = NULL; + } else { + /* There are multiple devices to notify implicitly. */ + notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object)); + if (!notify_object) { + status = AE_NO_MEMORY; + goto unlock_and_exit; + } + + notify_object->node = device_node; + notify_object->next = gpe_event_info->dispatch.device.next; + gpe_event_info->dispatch.device.next = notify_object; + } + + out: gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; status = AE_OK; -unlock_and_exit: + unlock_and_exit: acpi_os_release_lock(acpi_gbl_gpe_lock, flags); - - /* Delete the notify object if it was not used above */ - - if (new_notify) { - ACPI_FREE(new_notify); - } return_ACPI_STATUS(status); } ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) @@ -315,7 +283,7 @@ ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) * * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 * gpe_number - GPE level within the GPE block - * action - Enable or Disable + * Action - Enable or Disable * * RETURN: Status * @@ -540,7 +508,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes) * FUNCTION: acpi_install_gpe_block * * PARAMETERS: gpe_device - Handle to the parent GPE Block Device - * gpe_block_address - Address and space_ID + * gpe_block_address - Address and space_iD * register_count - Number of GPE register pairs in the block * interrupt_number - H/W interrupt for the block * @@ -685,7 +653,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block) * * FUNCTION: acpi_get_gpe_device * - * PARAMETERS: index - System GPE index (0-current_gpe_count) + * PARAMETERS: Index - System GPE index (0-current_gpe_count) * gpe_device - Where the parent GPE Device is returned * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/evxfregn.c b/trunk/drivers/acpi/acpica/evxfregn.c index 96b412d03950..6019208cd4b6 100644 --- a/trunk/drivers/acpi/acpica/evxfregn.c +++ b/trunk/drivers/acpi/acpica/evxfregn.c @@ -55,11 +55,11 @@ ACPI_MODULE_NAME("evxfregn") * * FUNCTION: acpi_install_address_space_handler * - * PARAMETERS: device - Handle for the device + * PARAMETERS: Device - Handle for the device * space_id - The address space ID - * handler - Address of the handler - * setup - Address of the setup function - * context - Value passed to the handler on each access + * Handler - Address of the handler + * Setup - Address of the setup function + * Context - Value passed to the handler on each access * * RETURN: Status * @@ -112,16 +112,16 @@ acpi_install_address_space_handler(acpi_handle device, } /* - * For the default space_IDs, (the IDs for which there are default region handlers + * For the default space_iDs, (the IDs for which there are default region handlers * installed) Only execute the _REG methods if the global initialization _REG * methods have already been run (via acpi_initialize_objects). In other words, - * we will defer the execution of the _REG methods for these space_IDs until + * we will defer the execution of the _REG methods for these space_iDs until * execution of acpi_initialize_objects. This is done because we need the handlers * for the default spaces (mem/io/pci/table) to be installed before we can run * any control methods (or _REG methods). There is known BIOS code that depends * on this. * - * For all other space_IDs, we can safely execute the _REG methods immediately. + * For all other space_iDs, we can safely execute the _REG methods immediately. * This means that for IDs like embedded_controller, this function should be called * only after acpi_enable_subsystem has been called. */ @@ -157,9 +157,9 @@ ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler) * * FUNCTION: acpi_remove_address_space_handler * - * PARAMETERS: device - Handle for the device + * PARAMETERS: Device - Handle for the device * space_id - The address space ID - * handler - Address of the handler + * Handler - Address of the handler * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/exconfig.c b/trunk/drivers/acpi/acpica/exconfig.c index 16219bde48da..c86d44e41bc8 100644 --- a/trunk/drivers/acpi/acpica/exconfig.c +++ b/trunk/drivers/acpi/acpica/exconfig.c @@ -66,7 +66,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, * * FUNCTION: acpi_ex_add_table * - * PARAMETERS: table - Pointer to raw table + * PARAMETERS: Table - Pointer to raw table * parent_node - Where to load the table (scope) * ddb_handle - Where to return the table handle. * @@ -276,8 +276,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ex_region_read * * PARAMETERS: obj_desc - Region descriptor - * length - Number of bytes to read - * buffer - Pointer to where to put the data + * Length - Number of bytes to read + * Buffer - Pointer to where to put the data * * RETURN: Status * @@ -318,7 +318,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer) * * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be * obtained - * target - Where a handle to the table will be stored + * Target - Where a handle to the table will be stored * walk_state - Current state * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/exconvrt.c b/trunk/drivers/acpi/acpica/exconvrt.c index bfb062e4c4b4..e385436bd424 100644 --- a/trunk/drivers/acpi/acpica/exconvrt.c +++ b/trunk/drivers/acpi/acpica/exconvrt.c @@ -60,7 +60,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length); * PARAMETERS: obj_desc - Object to be converted. Must be an * Integer, Buffer, or String * result_desc - Where the new Integer object is returned - * flags - Used for string conversion + * Flags - Used for string conversion * * RETURN: Status * @@ -272,9 +272,9 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, * * FUNCTION: acpi_ex_convert_to_ascii * - * PARAMETERS: integer - Value to be converted - * base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX - * string - Where the string is returned + * PARAMETERS: Integer - Value to be converted + * Base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX + * String - Where the string is returned * data_width - Size of data item to be converted, in bytes * * RETURN: Actual string length @@ -385,7 +385,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width) * PARAMETERS: obj_desc - Object to be converted. Must be an * Integer, Buffer, or String * result_desc - Where the string object is returned - * type - String flags (base and conversion type) + * Type - String flags (base and conversion type) * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/excreate.c b/trunk/drivers/acpi/acpica/excreate.c index 691d4763102c..3f5bc998c1cb 100644 --- a/trunk/drivers/acpi/acpica/excreate.c +++ b/trunk/drivers/acpi/acpica/excreate.c @@ -369,7 +369,7 @@ acpi_ex_create_region(u8 * aml_start, * * DESCRIPTION: Create a new processor object and populate the fields * - * Processor (Name[0], cpu_ID[1], pblock_addr[2], pblock_length[3]) + * Processor (Name[0], cpu_iD[1], pblock_addr[2], pblock_length[3]) * ******************************************************************************/ diff --git a/trunk/drivers/acpi/acpica/exdebug.c b/trunk/drivers/acpi/acpica/exdebug.c index bc5b9a6a1316..e211e9c19215 100644 --- a/trunk/drivers/acpi/acpica/exdebug.c +++ b/trunk/drivers/acpi/acpica/exdebug.c @@ -54,8 +54,8 @@ ACPI_MODULE_NAME("exdebug") * FUNCTION: acpi_ex_do_debug_object * * PARAMETERS: source_desc - Object to be output to "Debug Object" - * level - Indentation level (used for packages) - * index - Current package element, zero if not pkg + * Level - Indentation level (used for packages) + * Index - Current package element, zero if not pkg * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/exdump.c b/trunk/drivers/acpi/acpica/exdump.c index 213c081776fc..2a6ac0a3bc1e 100644 --- a/trunk/drivers/acpi/acpica/exdump.c +++ b/trunk/drivers/acpi/acpica/exdump.c @@ -109,9 +109,9 @@ static struct acpi_exdump_info acpi_ex_dump_package[5] = { static struct acpi_exdump_info acpi_ex_dump_device[4] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[0]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.system_notify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[1]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.device_notify), "Device Notify"} }; @@ -158,9 +158,9 @@ static struct acpi_exdump_info acpi_ex_dump_power[5] = { "System Level"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order), "Resource Order"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[0]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.system_notify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[1]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.device_notify), "Device Notify"} }; @@ -169,18 +169,18 @@ static struct acpi_exdump_info acpi_ex_dump_processor[7] = { {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"}, {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[0]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[1]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.device_notify), "Device Notify"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"} }; static struct acpi_exdump_info acpi_ex_dump_thermal[4] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[0]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.system_notify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[1]), + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.device_notify), "Device Notify"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"} }; @@ -241,15 +241,10 @@ static struct acpi_exdump_info acpi_ex_dump_address_handler[6] = { {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"} }; -static struct acpi_exdump_info acpi_ex_dump_notify[7] = { +static struct acpi_exdump_info acpi_ex_dump_notify[3] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"}, - {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(notify.handler_type), "Handler Type"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.handler), "Handler"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[0]), - "Next System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[1]), "Next Device Notify"} + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"} }; /* Miscellaneous tables */ @@ -323,7 +318,7 @@ static struct acpi_exdump_info *acpi_ex_dump_info[] = { * FUNCTION: acpi_ex_dump_object * * PARAMETERS: obj_desc - Descriptor to dump - * info - Info table corresponding to this object + * Info - Info table corresponding to this object * type * * RETURN: None @@ -449,7 +444,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, * FUNCTION: acpi_ex_dump_operand * * PARAMETERS: *obj_desc - Pointer to entry to be dumped - * depth - Current nesting depth + * Depth - Current nesting depth * * RETURN: None * @@ -731,7 +726,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) * * FUNCTION: acpi_ex_dump_operands * - * PARAMETERS: operands - A list of Operand objects + * PARAMETERS: Operands - A list of Operand objects * opcode_name - AML opcode name * num_operands - Operand count for this opcode * @@ -774,8 +769,8 @@ acpi_ex_dump_operands(union acpi_operand_object **operands, * * FUNCTION: acpi_ex_out* functions * - * PARAMETERS: title - Descriptive text - * value - Value to be displayed + * PARAMETERS: Title - Descriptive text + * Value - Value to be displayed * * DESCRIPTION: Object dump output formatting functions. These functions * reduce the number of format strings required and keeps them @@ -797,8 +792,8 @@ static void acpi_ex_out_pointer(char *title, void *value) * * FUNCTION: acpi_ex_dump_namespace_node * - * PARAMETERS: node - Descriptor to dump - * flags - Force display if TRUE + * PARAMETERS: Node - Descriptor to dump + * Flags - Force display if TRUE * * DESCRIPTION: Dumps the members of the given.Node * @@ -830,7 +825,7 @@ void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags) * * FUNCTION: acpi_ex_dump_reference_obj * - * PARAMETERS: object - Descriptor to dump + * PARAMETERS: Object - Descriptor to dump * * DESCRIPTION: Dumps a reference object * @@ -887,8 +882,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc) * FUNCTION: acpi_ex_dump_package_obj * * PARAMETERS: obj_desc - Descriptor to dump - * level - Indentation Level - * index - Package index for this object + * Level - Indentation Level + * Index - Package index for this object * * DESCRIPTION: Dumps the elements of the package * @@ -931,7 +926,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, case ACPI_TYPE_STRING: acpi_os_printf("[String] Value: "); - acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX); + for (i = 0; i < obj_desc->string.length; i++) { + acpi_os_printf("%c", obj_desc->string.pointer[i]); + } acpi_os_printf("\n"); break; @@ -980,7 +977,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, * FUNCTION: acpi_ex_dump_object_descriptor * * PARAMETERS: obj_desc - Descriptor to dump - * flags - Force display if TRUE + * Flags - Force display if TRUE * * DESCRIPTION: Dumps the members of the object descriptor given. * diff --git a/trunk/drivers/acpi/acpica/exfldio.c b/trunk/drivers/acpi/acpica/exfldio.c index a7784152ed30..149de45fdadd 100644 --- a/trunk/drivers/acpi/acpica/exfldio.c +++ b/trunk/drivers/acpi/acpica/exfldio.c @@ -222,9 +222,9 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, * PARAMETERS: obj_desc - Field to be read * field_datum_byte_offset - Byte offset of this datum within the * parent field - * value - Where to store value (must at least + * Value - Where to store value (must at least * 64 bits) - * function - Read or Write flag plus other region- + * Function - Read or Write flag plus other region- * dependent flags * * RETURN: Status @@ -315,7 +315,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, * FUNCTION: acpi_ex_register_overflow * * PARAMETERS: obj_desc - Register(Field) to be written - * value - Value to be stored + * Value - Value to be stored * * RETURN: TRUE if value overflows the field, FALSE otherwise * @@ -365,7 +365,7 @@ acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value) * PARAMETERS: obj_desc - Field to be read * field_datum_byte_offset - Byte offset of this datum within the * parent field - * value - Where to store value (must be 64 bits) + * Value - Where to store value (must be 64 bits) * read_write - Read or Write flag * * RETURN: Status @@ -574,7 +574,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, * FUNCTION: acpi_ex_write_with_update_rule * * PARAMETERS: obj_desc - Field to be written - * mask - bitmask within field datum + * Mask - bitmask within field datum * field_value - Value to write * field_datum_byte_offset - Offset of datum within field * @@ -678,7 +678,7 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, * FUNCTION: acpi_ex_extract_from_field * * PARAMETERS: obj_desc - Field to be read - * buffer - Where to store the field data + * Buffer - Where to store the field data * buffer_length - Length of Buffer * * RETURN: Status @@ -823,7 +823,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, * FUNCTION: acpi_ex_insert_into_field * * PARAMETERS: obj_desc - Field to be written - * buffer - Data to be written + * Buffer - Data to be written * buffer_length - Length of Buffer * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/exmisc.c b/trunk/drivers/acpi/acpica/exmisc.c index 271c0c57ea10..0a0893310348 100644 --- a/trunk/drivers/acpi/acpica/exmisc.c +++ b/trunk/drivers/acpi/acpica/exmisc.c @@ -144,8 +144,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, * * FUNCTION: acpi_ex_concat_template * - * PARAMETERS: operand0 - First source object - * operand1 - Second source object + * PARAMETERS: Operand0 - First source object + * Operand1 - Second source object * actual_return_desc - Where to place the return object * walk_state - Current walk state * @@ -229,8 +229,8 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, * * FUNCTION: acpi_ex_do_concatenate * - * PARAMETERS: operand0 - First source object - * operand1 - Second source object + * PARAMETERS: Operand0 - First source object + * Operand1 - Second source object * actual_return_desc - Where to place the return object * walk_state - Current walk state * @@ -397,9 +397,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, * * FUNCTION: acpi_ex_do_math_op * - * PARAMETERS: opcode - AML opcode - * integer0 - Integer operand #0 - * integer1 - Integer operand #1 + * PARAMETERS: Opcode - AML opcode + * Integer0 - Integer operand #0 + * Integer1 - Integer operand #1 * * RETURN: Integer result of the operation * @@ -479,9 +479,9 @@ u64 acpi_ex_do_math_op(u16 opcode, u64 integer0, u64 integer1) * * FUNCTION: acpi_ex_do_logical_numeric_op * - * PARAMETERS: opcode - AML opcode - * integer0 - Integer operand #0 - * integer1 - Integer operand #1 + * PARAMETERS: Opcode - AML opcode + * Integer0 - Integer operand #0 + * Integer1 - Integer operand #1 * logical_result - TRUE/FALSE result of the operation * * RETURN: Status @@ -534,9 +534,9 @@ acpi_ex_do_logical_numeric_op(u16 opcode, * * FUNCTION: acpi_ex_do_logical_op * - * PARAMETERS: opcode - AML opcode - * operand0 - operand #0 - * operand1 - operand #1 + * PARAMETERS: Opcode - AML opcode + * Operand0 - operand #0 + * Operand1 - operand #1 * logical_result - TRUE/FALSE result of the operation * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/exmutex.c b/trunk/drivers/acpi/acpica/exmutex.c index bcceda5be9e3..60933e9dc3c0 100644 --- a/trunk/drivers/acpi/acpica/exmutex.c +++ b/trunk/drivers/acpi/acpica/exmutex.c @@ -102,7 +102,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc) * FUNCTION: acpi_ex_link_mutex * * PARAMETERS: obj_desc - The mutex to be linked - * thread - Current executing thread object + * Thread - Current executing thread object * * RETURN: None * @@ -138,7 +138,7 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc, * * FUNCTION: acpi_ex_acquire_mutex_object * - * PARAMETERS: timeout - Timeout in milliseconds + * PARAMETERS: Timeout - Timeout in milliseconds * obj_desc - Mutex object * thread_id - Current thread state * @@ -443,7 +443,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, * * FUNCTION: acpi_ex_release_all_mutexes * - * PARAMETERS: thread - Current executing thread object + * PARAMETERS: Thread - Current executing thread object * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/exprep.c b/trunk/drivers/acpi/acpica/exprep.c index 81eca60d2748..30157f5a12d7 100644 --- a/trunk/drivers/acpi/acpica/exprep.c +++ b/trunk/drivers/acpi/acpica/exprep.c @@ -391,12 +391,12 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc, * * FUNCTION: acpi_ex_prep_field_value * - * PARAMETERS: info - Contains all field creation info + * PARAMETERS: Info - Contains all field creation info * * RETURN: Status * - * DESCRIPTION: Construct an object of type union acpi_operand_object with a - * subtype of def_field and connect it to the parent Node. + * DESCRIPTION: Construct a union acpi_operand_object of type def_field and + * connect it to the parent Node. * ******************************************************************************/ diff --git a/trunk/drivers/acpi/acpica/exregion.c b/trunk/drivers/acpi/acpica/exregion.c index 1f1ce0c3d2f8..12d51df6d3bf 100644 --- a/trunk/drivers/acpi/acpica/exregion.c +++ b/trunk/drivers/acpi/acpica/exregion.c @@ -53,10 +53,10 @@ ACPI_MODULE_NAME("exregion") * * FUNCTION: acpi_ex_system_memory_space_handler * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write * bit_width - Field width in bits (8, 16, or 32) - * value - Pointer to in or out value + * Value - Pointer to in or out value * handler_context - Pointer to Handler's context * region_context - Pointer to context specific to the * accessed region @@ -270,10 +270,10 @@ acpi_ex_system_memory_space_handler(u32 function, * * FUNCTION: acpi_ex_system_io_space_handler * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write * bit_width - Field width in bits (8, 16, or 32) - * value - Pointer to in or out value + * Value - Pointer to in or out value * handler_context - Pointer to Handler's context * region_context - Pointer to context specific to the * accessed region @@ -329,10 +329,10 @@ acpi_ex_system_io_space_handler(u32 function, * * FUNCTION: acpi_ex_pci_config_space_handler * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write * bit_width - Field width in bits (8, 16, or 32) - * value - Pointer to in or out value + * Value - Pointer to in or out value * handler_context - Pointer to Handler's context * region_context - Pointer to context specific to the * accessed region @@ -365,7 +365,7 @@ acpi_ex_pci_config_space_handler(u32 function, * pci_function is the PCI device function number * pci_register is the Config space register range 0-255 bytes * - * value - input value for write, output address for read + * Value - input value for write, output address for read * */ pci_id = (struct acpi_pci_id *)region_context; @@ -402,10 +402,10 @@ acpi_ex_pci_config_space_handler(u32 function, * * FUNCTION: acpi_ex_cmos_space_handler * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write * bit_width - Field width in bits (8, 16, or 32) - * value - Pointer to in or out value + * Value - Pointer to in or out value * handler_context - Pointer to Handler's context * region_context - Pointer to context specific to the * accessed region @@ -434,10 +434,10 @@ acpi_ex_cmos_space_handler(u32 function, * * FUNCTION: acpi_ex_pci_bar_space_handler * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write * bit_width - Field width in bits (8, 16, or 32) - * value - Pointer to in or out value + * Value - Pointer to in or out value * handler_context - Pointer to Handler's context * region_context - Pointer to context specific to the * accessed region @@ -466,10 +466,10 @@ acpi_ex_pci_bar_space_handler(u32 function, * * FUNCTION: acpi_ex_data_table_space_handler * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write * bit_width - Field width in bits (8, 16, or 32) - * value - Pointer to in or out value + * Value - Pointer to in or out value * handler_context - Pointer to Handler's context * region_context - Pointer to context specific to the * accessed region diff --git a/trunk/drivers/acpi/acpica/exresolv.c b/trunk/drivers/acpi/acpica/exresolv.c index bbf40ac27585..6e335dc34528 100644 --- a/trunk/drivers/acpi/acpica/exresolv.c +++ b/trunk/drivers/acpi/acpica/exresolv.c @@ -147,7 +147,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, stack_desc = *stack_ptr; - /* This is an object of type union acpi_operand_object */ + /* This is a union acpi_operand_object */ switch (stack_desc->common.type) { case ACPI_TYPE_LOCAL_REFERENCE: @@ -321,7 +321,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, * FUNCTION: acpi_ex_resolve_multiple * * PARAMETERS: walk_state - Current state (contains AML opcode) - * operand - Starting point for resolution + * Operand - Starting point for resolution * return_type - Where the object type is returned * return_desc - Where the resolved object is returned * diff --git a/trunk/drivers/acpi/acpica/exresop.c b/trunk/drivers/acpi/acpica/exresop.c index f232fbabdea8..a67b1d925ddd 100644 --- a/trunk/drivers/acpi/acpica/exresop.c +++ b/trunk/drivers/acpi/acpica/exresop.c @@ -113,7 +113,7 @@ acpi_ex_check_object_type(acpi_object_type type_needed, * * FUNCTION: acpi_ex_resolve_operands * - * PARAMETERS: opcode - Opcode being interpreted + * PARAMETERS: Opcode - Opcode being interpreted * stack_ptr - Pointer to the operand stack to be * resolved * walk_state - Current state @@ -307,7 +307,7 @@ acpi_ex_resolve_operands(u16 opcode, case ARGI_DEVICE_REF: case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ - case ARGI_SIMPLE_TARGET: /* Name, Local, or arg - no implicit conversion */ + case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ /* * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE @@ -410,7 +410,7 @@ acpi_ex_resolve_operands(u16 opcode, /* * Need an operand of type ACPI_TYPE_INTEGER, * But we can implicitly convert from a STRING or BUFFER - * aka - "Implicit Source Operand Conversion" + * Aka - "Implicit Source Operand Conversion" */ status = acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); @@ -437,7 +437,7 @@ acpi_ex_resolve_operands(u16 opcode, /* * Need an operand of type ACPI_TYPE_BUFFER, * But we can implicitly convert from a STRING or INTEGER - * aka - "Implicit Source Operand Conversion" + * Aka - "Implicit Source Operand Conversion" */ status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); if (ACPI_FAILURE(status)) { @@ -463,7 +463,7 @@ acpi_ex_resolve_operands(u16 opcode, /* * Need an operand of type ACPI_TYPE_STRING, * But we can implicitly convert from a BUFFER or INTEGER - * aka - "Implicit Source Operand Conversion" + * Aka - "Implicit Source Operand Conversion" */ status = acpi_ex_convert_to_string(obj_desc, stack_ptr, ACPI_IMPLICIT_CONVERT_HEX); diff --git a/trunk/drivers/acpi/acpica/exstore.c b/trunk/drivers/acpi/acpica/exstore.c index 5fffe7ab5ece..c6cf843cc4c9 100644 --- a/trunk/drivers/acpi/acpica/exstore.c +++ b/trunk/drivers/acpi/acpica/exstore.c @@ -62,8 +62,8 @@ acpi_ex_store_object_to_index(union acpi_operand_object *val_desc, * FUNCTION: acpi_ex_store * * PARAMETERS: *source_desc - Value to be stored - * *dest_desc - Where to store it. Must be an NS node - * or union acpi_operand_object of type + * *dest_desc - Where to store it. Must be an NS node + * or a union acpi_operand_object of type * Reference; * walk_state - Current walk state * @@ -361,7 +361,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, * FUNCTION: acpi_ex_store_object_to_node * * PARAMETERS: source_desc - Value to be stored - * node - Named object to receive the value + * Node - Named object to receive the value * walk_state - Current walk state * implicit_conversion - Perform implicit conversion (yes/no) * diff --git a/trunk/drivers/acpi/acpica/exstorob.c b/trunk/drivers/acpi/acpica/exstorob.c index 53c248473547..65a45d8335c8 100644 --- a/trunk/drivers/acpi/acpica/exstorob.c +++ b/trunk/drivers/acpi/acpica/exstorob.c @@ -110,7 +110,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, * NOTE: ACPI versions up to 3.0 specified that the buffer must be * truncated if the string is smaller than the buffer. However, "other" * implementations of ACPI never did this and thus became the defacto - * standard. ACPI 3.0A changes this behavior such that the buffer + * standard. ACPI 3.0_a changes this behavior such that the buffer * is no longer truncated. */ diff --git a/trunk/drivers/acpi/acpica/exsystem.c b/trunk/drivers/acpi/acpica/exsystem.c index b760641e2fc6..191a12945226 100644 --- a/trunk/drivers/acpi/acpica/exsystem.c +++ b/trunk/drivers/acpi/acpica/exsystem.c @@ -53,8 +53,8 @@ ACPI_MODULE_NAME("exsystem") * * FUNCTION: acpi_ex_system_wait_semaphore * - * PARAMETERS: semaphore - Semaphore to wait on - * timeout - Max time to wait + * PARAMETERS: Semaphore - Semaphore to wait on + * Timeout - Max time to wait * * RETURN: Status * @@ -98,8 +98,8 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) * * FUNCTION: acpi_ex_system_wait_mutex * - * PARAMETERS: mutex - Mutex to wait on - * timeout - Max time to wait + * PARAMETERS: Mutex - Mutex to wait on + * Timeout - Max time to wait * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/exutils.c b/trunk/drivers/acpi/acpica/exutils.c index d1ab7917eed7..eb6798ba8b59 100644 --- a/trunk/drivers/acpi/acpica/exutils.c +++ b/trunk/drivers/acpi/acpica/exutils.c @@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void) * * DESCRIPTION: Reacquire the interpreter execution region from within the * interpreter code. Failure to enter the interpreter region is a - * fatal system error. Used in conjunction with + * fatal system error. Used in conjunction with * relinquish_interpreter * ******************************************************************************/ @@ -317,8 +317,8 @@ void acpi_ex_release_global_lock(u32 field_flags) * * FUNCTION: acpi_ex_digits_needed * - * PARAMETERS: value - Value to be represented - * base - Base of representation + * PARAMETERS: Value - Value to be represented + * Base - Base of representation * * RETURN: The number of digits. * @@ -408,7 +408,7 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id) * PARAMETERS: out_string - Where to put the converted string. At least * 21 bytes are needed to hold the largest * possible 64-bit integer. - * value - Value to be converted + * Value - Value to be converted * * RETURN: None, string * @@ -443,7 +443,7 @@ void acpi_ex_integer_to_string(char *out_string, u64 value) * * RETURN: TRUE if valid/supported ID. * - * DESCRIPTION: Validate an operation region space_ID. + * DESCRIPTION: Validate an operation region space_iD. * ******************************************************************************/ diff --git a/trunk/drivers/acpi/acpica/hwacpi.c b/trunk/drivers/acpi/acpica/hwacpi.c index a1e71d0ef57b..d0b9ed5df97e 100644 --- a/trunk/drivers/acpi/acpica/hwacpi.c +++ b/trunk/drivers/acpi/acpica/hwacpi.c @@ -53,7 +53,7 @@ ACPI_MODULE_NAME("hwacpi") * * FUNCTION: acpi_hw_set_mode * - * PARAMETERS: mode - SYS_MODE_ACPI or SYS_MODE_LEGACY + * PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/hwesleep.c b/trunk/drivers/acpi/acpica/hwesleep.c index 94996f9ae3ad..29e859293edd 100644 --- a/trunk/drivers/acpi/acpica/hwesleep.c +++ b/trunk/drivers/acpi/acpica/hwesleep.c @@ -90,6 +90,7 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument) * FUNCTION: acpi_hw_extended_sleep * * PARAMETERS: sleep_state - Which sleep state to enter + * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * @@ -99,7 +100,7 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument) * ******************************************************************************/ -acpi_status acpi_hw_extended_sleep(u8 sleep_state) +acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) { acpi_status status; u8 sleep_type_value; @@ -116,14 +117,19 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state) /* Clear wake status (WAK_STS) */ - status = - acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); + status = acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } acpi_gbl_system_awake_and_running = FALSE; + /* Optionally execute _GTS (Going To Sleep) */ + + if (flags & ACPI_EXECUTE_GTS) { + acpi_hw_execute_sleep_method(METHOD_PATHNAME__GTS, sleep_state); + } + /* Flush caches, as per ACPI specification */ ACPI_FLUSH_CPU_CACHE(); @@ -141,7 +147,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state) ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & ACPI_X_SLEEP_TYPE_MASK); - status = acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE), + status = acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), &acpi_gbl_FADT.sleep_control); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); @@ -165,6 +171,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state) * FUNCTION: acpi_hw_extended_wake_prep * * PARAMETERS: sleep_state - Which sleep state we just exited + * Flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status * @@ -173,7 +180,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state) * ******************************************************************************/ -acpi_status acpi_hw_extended_wake_prep(u8 sleep_state) +acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) { acpi_status status; u8 sleep_type_value; @@ -188,10 +195,15 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state) ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & ACPI_X_SLEEP_TYPE_MASK); - (void)acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE), + (void)acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), &acpi_gbl_FADT.sleep_control); } + /* Optionally execute _BFS (Back From Sleep) */ + + if (flags & ACPI_EXECUTE_BFS) { + acpi_hw_execute_sleep_method(METHOD_PATHNAME__BFS, sleep_state); + } return_ACPI_STATUS(AE_OK); } @@ -200,7 +212,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state) * FUNCTION: acpi_hw_extended_wake * * PARAMETERS: sleep_state - Which sleep state we just exited - * flags - Reserved, set to zero + * Flags - Reserved, set to zero * * RETURN: Status * @@ -209,7 +221,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state) * ******************************************************************************/ -acpi_status acpi_hw_extended_wake(u8 sleep_state) +acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags) { ACPI_FUNCTION_TRACE(hw_extended_wake); @@ -227,7 +239,7 @@ acpi_status acpi_hw_extended_wake(u8 sleep_state) * and use it to determine whether the system is rebooting or * resuming. Clear WAK_STS for compatibility. */ - (void)acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); + (void)acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); acpi_gbl_system_awake_and_running = TRUE; acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); diff --git a/trunk/drivers/acpi/acpica/hwregs.c b/trunk/drivers/acpi/acpica/hwregs.c index 4af6d20ef077..6b6c83b87b52 100644 --- a/trunk/drivers/acpi/acpica/hwregs.c +++ b/trunk/drivers/acpi/acpica/hwregs.c @@ -69,9 +69,9 @@ acpi_hw_write_multiple(u32 value, * * FUNCTION: acpi_hw_validate_register * - * PARAMETERS: reg - GAS register structure + * PARAMETERS: Reg - GAS register structure * max_bit_width - Max bit_width supported (32 or 64) - * address - Pointer to where the gas->address + * Address - Pointer to where the gas->address * is returned * * RETURN: Status @@ -102,7 +102,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, return (AE_BAD_ADDRESS); } - /* Validate the space_ID */ + /* Validate the space_iD */ if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { @@ -137,8 +137,8 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, * * FUNCTION: acpi_hw_read * - * PARAMETERS: value - Where the value is returned - * reg - GAS register structure + * PARAMETERS: Value - Where the value is returned + * Reg - GAS register structure * * RETURN: Status * @@ -148,7 +148,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, * * LIMITATIONS: * bit_width must be exactly 8, 16, or 32. - * space_ID must be system_memory or system_IO. + * space_iD must be system_memory or system_iO. * bit_offset and access_width are currently ignored, as there has * not been a need to implement these. * @@ -200,8 +200,8 @@ acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) * * FUNCTION: acpi_hw_write * - * PARAMETERS: value - Value to be written - * reg - GAS register structure + * PARAMETERS: Value - Value to be written + * Reg - GAS register structure * * RETURN: Status * @@ -439,7 +439,7 @@ acpi_hw_register_read(u32 register_id, u32 * return_value) * FUNCTION: acpi_hw_register_write * * PARAMETERS: register_id - ACPI Register ID - * value - The value to write + * Value - The value to write * * RETURN: Status * @@ -571,7 +571,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) * * FUNCTION: acpi_hw_read_multiple * - * PARAMETERS: value - Where the register value is returned + * PARAMETERS: Value - Where the register value is returned * register_a - First ACPI register (required) * register_b - Second ACPI register (optional) * @@ -624,7 +624,7 @@ acpi_hw_read_multiple(u32 *value, * * FUNCTION: acpi_hw_write_multiple * - * PARAMETERS: value - The value to write + * PARAMETERS: Value - The value to write * register_a - First ACPI register (required) * register_b - Second ACPI register (optional) * diff --git a/trunk/drivers/acpi/acpica/hwsleep.c b/trunk/drivers/acpi/acpica/hwsleep.c index 3fddde056a5e..615996a36bed 100644 --- a/trunk/drivers/acpi/acpica/hwsleep.c +++ b/trunk/drivers/acpi/acpica/hwsleep.c @@ -56,6 +56,7 @@ ACPI_MODULE_NAME("hwsleep") * FUNCTION: acpi_hw_legacy_sleep * * PARAMETERS: sleep_state - Which sleep state to enter + * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * @@ -63,7 +64,7 @@ ACPI_MODULE_NAME("hwsleep") * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status acpi_hw_legacy_sleep(u8 sleep_state) +acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) { struct acpi_bit_register_info *sleep_type_reg_info; struct acpi_bit_register_info *sleep_enable_reg_info; @@ -109,6 +110,12 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state) return_ACPI_STATUS(status); } + /* Optionally execute _GTS (Going To Sleep) */ + + if (flags & ACPI_EXECUTE_GTS) { + acpi_hw_execute_sleep_method(METHOD_PATHNAME__GTS, sleep_state); + } + /* Get current value of PM1A control */ status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, @@ -207,6 +214,7 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state) * FUNCTION: acpi_hw_legacy_wake_prep * * PARAMETERS: sleep_state - Which sleep state we just exited + * Flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status * @@ -216,7 +224,7 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state) * ******************************************************************************/ -acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state) +acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) { acpi_status status; struct acpi_bit_register_info *sleep_type_reg_info; @@ -267,6 +275,11 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state) } } + /* Optionally execute _BFS (Back From Sleep) */ + + if (flags & ACPI_EXECUTE_BFS) { + acpi_hw_execute_sleep_method(METHOD_PATHNAME__BFS, sleep_state); + } return_ACPI_STATUS(status); } @@ -275,6 +288,7 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state) * FUNCTION: acpi_hw_legacy_wake * * PARAMETERS: sleep_state - Which sleep state we just exited + * Flags - Reserved, set to zero * * RETURN: Status * @@ -283,7 +297,7 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state) * ******************************************************************************/ -acpi_status acpi_hw_legacy_wake(u8 sleep_state) +acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags) { acpi_status status; diff --git a/trunk/drivers/acpi/acpica/hwtimer.c b/trunk/drivers/acpi/acpica/hwtimer.c index b6411f16832f..f1b2c3b94cac 100644 --- a/trunk/drivers/acpi/acpica/hwtimer.c +++ b/trunk/drivers/acpi/acpica/hwtimer.c @@ -54,7 +54,7 @@ ACPI_MODULE_NAME("hwtimer") * * FUNCTION: acpi_get_timer_resolution * - * PARAMETERS: resolution - Where the resolution is returned + * PARAMETERS: Resolution - Where the resolution is returned * * RETURN: Status and timer resolution * @@ -84,7 +84,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_timer_resolution) * * FUNCTION: acpi_get_timer * - * PARAMETERS: ticks - Where the timer value is returned + * PARAMETERS: Ticks - Where the timer value is returned * * RETURN: Status and current timer value (ticks) * diff --git a/trunk/drivers/acpi/acpica/hwvalid.c b/trunk/drivers/acpi/acpica/hwvalid.c index c99d546b217f..6e5c43a60bb7 100644 --- a/trunk/drivers/acpi/acpica/hwvalid.c +++ b/trunk/drivers/acpi/acpica/hwvalid.c @@ -58,7 +58,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width); * * The table is used to implement the Microsoft port access rules that * first appeared in Windows XP. Some ports are always illegal, and some - * ports are only illegal if the BIOS calls _OSI with a win_XP string or + * ports are only illegal if the BIOS calls _OSI with a win_xP string or * later (meaning that the BIOS itelf is post-XP.) * * This provides ACPICA with the desired port protections and @@ -66,7 +66,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width); * * Description of port entries: * DMA: DMA controller - * PIC0: Programmable Interrupt Controller (8259A) + * PIC0: Programmable Interrupt Controller (8259_a) * PIT1: System Timer 1 * PIT2: System Timer 2 failsafe * RTC: Real-time clock diff --git a/trunk/drivers/acpi/acpica/hwxface.c b/trunk/drivers/acpi/acpica/hwxface.c index 7bfd649d1996..a716fede4f25 100644 --- a/trunk/drivers/acpi/acpica/hwxface.c +++ b/trunk/drivers/acpi/acpica/hwxface.c @@ -104,8 +104,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset) * * FUNCTION: acpi_read * - * PARAMETERS: value - Where the value is returned - * reg - GAS register structure + * PARAMETERS: Value - Where the value is returned + * Reg - GAS register structure * * RETURN: Status * @@ -113,7 +113,7 @@ ACPI_EXPORT_SYMBOL(acpi_reset) * * LIMITATIONS: * bit_width must be exactly 8, 16, 32, or 64. - * space_ID must be system_memory or system_IO. + * space_iD must be system_memory or system_iO. * bit_offset and access_width are currently ignored, as there has * not been a need to implement these. * @@ -196,8 +196,8 @@ ACPI_EXPORT_SYMBOL(acpi_read) * * FUNCTION: acpi_write * - * PARAMETERS: value - Value to be written - * reg - GAS register structure + * PARAMETERS: Value - Value to be written + * Reg - GAS register structure * * RETURN: Status * @@ -441,7 +441,7 @@ ACPI_EXPORT_SYMBOL(acpi_write_bit_register) * *sleep_type_a - Where SLP_TYPa is returned * *sleep_type_b - Where SLP_TYPb is returned * - * RETURN: status - ACPI status + * RETURN: Status - ACPI status * * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep * state. diff --git a/trunk/drivers/acpi/acpica/hwxfsleep.c b/trunk/drivers/acpi/acpica/hwxfsleep.c index 1f165a750ae2..762d059bb508 100644 --- a/trunk/drivers/acpi/acpica/hwxfsleep.c +++ b/trunk/drivers/acpi/acpica/hwxfsleep.c @@ -50,7 +50,7 @@ ACPI_MODULE_NAME("hwxfsleep") /* Local prototypes */ static acpi_status -acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id); +acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id); /* * Dispatch table used to efficiently branch to the various sleep @@ -205,7 +205,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) ACPI_FLUSH_CPU_CACHE(); status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, - (u32)acpi_gbl_FADT.s4_bios_request, 8); + (u32)acpi_gbl_FADT.S4bios_request, 8); do { acpi_os_stall(1000); @@ -235,7 +235,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) * ******************************************************************************/ static acpi_status -acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id) +acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id) { acpi_status status; struct acpi_sleep_functions *sleep_functions = @@ -248,11 +248,11 @@ acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id) * use the extended sleep registers */ if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { - status = sleep_functions->extended_function(sleep_state); + status = sleep_functions->extended_function(sleep_state, flags); } else { /* Legacy sleep */ - status = sleep_functions->legacy_function(sleep_state); + status = sleep_functions->legacy_function(sleep_state, flags); } return (status); @@ -262,7 +262,7 @@ acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id) * For the case where reduced-hardware-only code is being generated, * we know that only the extended sleep registers are available */ - status = sleep_functions->extended_function(sleep_state); + status = sleep_functions->extended_function(sleep_state, flags); return (status); #endif /* !ACPI_REDUCED_HARDWARE */ @@ -349,6 +349,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) * FUNCTION: acpi_enter_sleep_state * * PARAMETERS: sleep_state - Which sleep state to enter + * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * @@ -356,7 +357,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags) { acpi_status status; @@ -370,7 +371,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) } status = - acpi_hw_sleep_dispatch(sleep_state, ACPI_SLEEP_FUNCTION_ID); + acpi_hw_sleep_dispatch(sleep_state, flags, ACPI_SLEEP_FUNCTION_ID); return_ACPI_STATUS(status); } @@ -381,7 +382,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) * FUNCTION: acpi_leave_sleep_state_prep * * PARAMETERS: sleep_state - Which sleep state we are exiting - * flags - ACPI_EXECUTE_BFS to run optional method + * Flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status * @@ -390,14 +391,14 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) * Called with interrupts DISABLED. * ******************************************************************************/ -acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags) { acpi_status status; ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); status = - acpi_hw_sleep_dispatch(sleep_state, + acpi_hw_sleep_dispatch(sleep_state, flags, ACPI_WAKE_PREP_FUNCTION_ID); return_ACPI_STATUS(status); } @@ -422,7 +423,8 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); - status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_FUNCTION_ID); + + status = acpi_hw_sleep_dispatch(sleep_state, 0, ACPI_WAKE_FUNCTION_ID); return_ACPI_STATUS(status); } diff --git a/trunk/drivers/acpi/acpica/nsaccess.c b/trunk/drivers/acpi/acpica/nsaccess.c index 23db53ce2293..61623f3f6826 100644 --- a/trunk/drivers/acpi/acpica/nsaccess.c +++ b/trunk/drivers/acpi/acpica/nsaccess.c @@ -157,7 +157,7 @@ acpi_status acpi_ns_root_initialize(void) #if defined (ACPI_ASL_COMPILER) - /* Save the parameter count for the iASL compiler */ + /* Save the parameter count for the i_aSL compiler */ new_node->value = obj_desc->method.param_count; #else @@ -258,11 +258,11 @@ acpi_status acpi_ns_root_initialize(void) * FUNCTION: acpi_ns_lookup * * PARAMETERS: scope_info - Current scope info block - * pathname - Search pathname, in internal format + * Pathname - Search pathname, in internal format * (as represented in the AML stream) - * type - Type associated with name + * Type - Type associated with name * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found - * flags - Flags describing the search restrictions + * Flags - Flags describing the search restrictions * walk_state - Current state of the walk * return_node - Where the Node is placed (if found * or created successfully) diff --git a/trunk/drivers/acpi/acpica/nsalloc.c b/trunk/drivers/acpi/acpica/nsalloc.c index ac389e5bb594..7c3d3ceb98b3 100644 --- a/trunk/drivers/acpi/acpica/nsalloc.c +++ b/trunk/drivers/acpi/acpica/nsalloc.c @@ -52,7 +52,7 @@ ACPI_MODULE_NAME("nsalloc") * * FUNCTION: acpi_ns_create_node * - * PARAMETERS: name - Name of the new node (4 char ACPI name) + * PARAMETERS: Name - Name of the new node (4 char ACPI name) * * RETURN: New namespace node (Null on failure) * @@ -92,7 +92,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name) * * FUNCTION: acpi_ns_delete_node * - * PARAMETERS: node - Node to be deleted + * PARAMETERS: Node - Node to be deleted * * RETURN: None * @@ -143,7 +143,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) * * FUNCTION: acpi_ns_remove_node * - * PARAMETERS: node - Node to be removed/deleted + * PARAMETERS: Node - Node to be removed/deleted * * RETURN: None * @@ -196,8 +196,8 @@ void acpi_ns_remove_node(struct acpi_namespace_node *node) * * PARAMETERS: walk_state - Current state of the walk * parent_node - The parent of the new Node - * node - The new Node to install - * type - ACPI object type of the new Node + * Node - The new Node to install + * Type - ACPI object type of the new Node * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/nsdump.c b/trunk/drivers/acpi/acpica/nsdump.c index 7ee4e6aeb0a2..3f7f3f6e7dd5 100644 --- a/trunk/drivers/acpi/acpica/nsdump.c +++ b/trunk/drivers/acpi/acpica/nsdump.c @@ -63,7 +63,7 @@ acpi_ns_dump_one_device(acpi_handle obj_handle, * FUNCTION: acpi_ns_print_pathname * * PARAMETERS: num_segments - Number of ACPI name segments - * pathname - The compressed (internal) path + * Pathname - The compressed (internal) path * * RETURN: None * @@ -107,10 +107,10 @@ void acpi_ns_print_pathname(u32 num_segments, char *pathname) * * FUNCTION: acpi_ns_dump_pathname * - * PARAMETERS: handle - Object - * msg - Prefix message - * level - Desired debug level - * component - Caller's component ID + * PARAMETERS: Handle - Object + * Msg - Prefix message + * Level - Desired debug level + * Component - Caller's component ID * * RETURN: None * @@ -143,8 +143,8 @@ acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component) * FUNCTION: acpi_ns_dump_one_object * * PARAMETERS: obj_handle - Node to be dumped - * level - Nesting level of the handle - * context - Passed into walk_namespace + * Level - Nesting level of the handle + * Context - Passed into walk_namespace * return_value - Not used * * RETURN: Status @@ -615,7 +615,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, * * FUNCTION: acpi_ns_dump_objects * - * PARAMETERS: type - Object type to be dumped + * PARAMETERS: Type - Object type to be dumped * display_type - 0 or ACPI_DISPLAY_SUMMARY * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX * for an effectively unlimited depth. @@ -671,7 +671,7 @@ acpi_ns_dump_objects(acpi_object_type type, * * FUNCTION: acpi_ns_dump_entry * - * PARAMETERS: handle - Node to be dumped + * PARAMETERS: Handle - Node to be dumped * debug_level - Output level * * RETURN: None diff --git a/trunk/drivers/acpi/acpica/nsdumpdv.c b/trunk/drivers/acpi/acpica/nsdumpdv.c index 944d4c8d9438..3b5acb0eb406 100644 --- a/trunk/drivers/acpi/acpica/nsdumpdv.c +++ b/trunk/drivers/acpi/acpica/nsdumpdv.c @@ -55,9 +55,9 @@ ACPI_MODULE_NAME("nsdumpdv") * * FUNCTION: acpi_ns_dump_one_device * - * PARAMETERS: handle - Node to be dumped - * level - Nesting level of the handle - * context - Passed into walk_namespace + * PARAMETERS: Handle - Node to be dumped + * Level - Nesting level of the handle + * Context - Passed into walk_namespace * return_value - Not used * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/nseval.c b/trunk/drivers/acpi/acpica/nseval.c index 69074be498e8..f375cb82e321 100644 --- a/trunk/drivers/acpi/acpica/nseval.c +++ b/trunk/drivers/acpi/acpica/nseval.c @@ -59,11 +59,11 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, * * FUNCTION: acpi_ns_evaluate * - * PARAMETERS: info - Evaluation info block, contains: + * PARAMETERS: Info - Evaluation info block, contains: * prefix_node - Prefix or Method/Object Node to execute - * pathname - Name of method to execute, If NULL, the + * Pathname - Name of method to execute, If NULL, the * Node is the object to execute - * parameters - List of parameters to pass to the method, + * Parameters - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. * return_object - Where to put method's return value (if @@ -71,7 +71,7 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, * parameter_type - Type of Parameter list * return_object - Where to put method's return value (if * any). If NULL, no value is returned. - * flags - ACPI_IGNORE_RETURN_VALUE to delete return + * Flags - ACPI_IGNORE_RETURN_VALUE to delete return * * RETURN: Status * @@ -351,7 +351,7 @@ void acpi_ns_exec_module_code_list(void) * FUNCTION: acpi_ns_exec_module_code * * PARAMETERS: method_obj - Object container for the module-level code - * info - Info block for method evaluation + * Info - Info block for method evaluation * * RETURN: None. Exceptions during method execution are ignored, since * we cannot abort a table load. diff --git a/trunk/drivers/acpi/acpica/nsinit.c b/trunk/drivers/acpi/acpica/nsinit.c index 95ffe8dfa1f1..9d84ec2f0211 100644 --- a/trunk/drivers/acpi/acpica/nsinit.c +++ b/trunk/drivers/acpi/acpica/nsinit.c @@ -224,8 +224,8 @@ acpi_status acpi_ns_initialize_devices(void) * FUNCTION: acpi_ns_init_one_object * * PARAMETERS: obj_handle - Node - * level - Current nesting level - * context - Points to a init info struct + * Level - Current nesting level + * Context - Points to a init info struct * return_value - Not used * * RETURN: Status @@ -530,7 +530,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, * we will not run _INI, but we continue to examine the children * of this device. * - * From the ACPI spec, description of _STA: (note - no mention + * From the ACPI spec, description of _STA: (Note - no mention * of whether to run _INI or not on the device in question) * * "_STA may return bit 0 clear (not present) with bit 3 set diff --git a/trunk/drivers/acpi/acpica/nsload.c b/trunk/drivers/acpi/acpica/nsload.c index 76935ff29289..5cbf15ffe7d8 100644 --- a/trunk/drivers/acpi/acpica/nsload.c +++ b/trunk/drivers/acpi/acpica/nsload.c @@ -63,7 +63,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle); * FUNCTION: acpi_ns_load_table * * PARAMETERS: table_index - Index for table to be loaded - * node - Owning NS node + * Node - Owning NS node * * RETURN: Status * @@ -278,7 +278,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle) * * FUNCTION: acpi_ns_unload_name_space * - * PARAMETERS: handle - Root of namespace subtree to be deleted + * PARAMETERS: Handle - Root of namespace subtree to be deleted * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/nsnames.c b/trunk/drivers/acpi/acpica/nsnames.c index 96e0eb609bb4..b20e7c8c3ffb 100644 --- a/trunk/drivers/acpi/acpica/nsnames.c +++ b/trunk/drivers/acpi/acpica/nsnames.c @@ -53,8 +53,8 @@ ACPI_MODULE_NAME("nsnames") * * FUNCTION: acpi_ns_build_external_path * - * PARAMETERS: node - NS node whose pathname is needed - * size - Size of the pathname + * PARAMETERS: Node - NS node whose pathname is needed + * Size - Size of the pathname * *name_buffer - Where to return the pathname * * RETURN: Status @@ -120,7 +120,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node, * * FUNCTION: acpi_ns_get_external_pathname * - * PARAMETERS: node - Namespace node whose pathname is needed + * PARAMETERS: Node - Namespace node whose pathname is needed * * RETURN: Pointer to storage containing the fully qualified name of * the node, In external format (name segments separated by path @@ -168,7 +168,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) * * FUNCTION: acpi_ns_get_pathname_length * - * PARAMETERS: node - Namespace node + * PARAMETERS: Node - Namespace node * * RETURN: Length of path, including prefix * @@ -214,7 +214,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node) * * PARAMETERS: target_handle - Handle of named object whose name is * to be found - * buffer - Where the pathname is returned + * Buffer - Where the pathname is returned * * RETURN: Status, Buffer is filled with pathname if status is AE_OK * diff --git a/trunk/drivers/acpi/acpica/nsobject.c b/trunk/drivers/acpi/acpica/nsobject.c index d6c9a3cc6716..dd77a3ce6e50 100644 --- a/trunk/drivers/acpi/acpica/nsobject.c +++ b/trunk/drivers/acpi/acpica/nsobject.c @@ -53,9 +53,9 @@ ACPI_MODULE_NAME("nsobject") * * FUNCTION: acpi_ns_attach_object * - * PARAMETERS: node - Parent Node - * object - Object to be attached - * type - Type of object, or ACPI_TYPE_ANY if not + * PARAMETERS: Node - Parent Node + * Object - Object to be attached + * Type - Type of object, or ACPI_TYPE_ANY if not * known * * RETURN: Status @@ -191,7 +191,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node, * * FUNCTION: acpi_ns_detach_object * - * PARAMETERS: node - A Namespace node whose object will be detached + * PARAMETERS: Node - A Namespace node whose object will be detached * * RETURN: None. * @@ -250,7 +250,7 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) * * FUNCTION: acpi_ns_get_attached_object * - * PARAMETERS: node - Namespace node + * PARAMETERS: Node - Namespace node * * RETURN: Current value of the object field from the Node whose * handle is passed @@ -285,7 +285,7 @@ union acpi_operand_object *acpi_ns_get_attached_object(struct * * FUNCTION: acpi_ns_get_secondary_object * - * PARAMETERS: node - Namespace node + * PARAMETERS: Node - Namespace node * * RETURN: Current value of the object field from the Node whose * handle is passed. @@ -315,9 +315,9 @@ union acpi_operand_object *acpi_ns_get_secondary_object(union * * FUNCTION: acpi_ns_attach_data * - * PARAMETERS: node - Namespace node - * handler - Handler to be associated with the data - * data - Data to be attached + * PARAMETERS: Node - Namespace node + * Handler - Handler to be associated with the data + * Data - Data to be attached * * RETURN: Status * @@ -372,8 +372,8 @@ acpi_ns_attach_data(struct acpi_namespace_node *node, * * FUNCTION: acpi_ns_detach_data * - * PARAMETERS: node - Namespace node - * handler - Handler associated with the data + * PARAMETERS: Node - Namespace node + * Handler - Handler associated with the data * * RETURN: Status * @@ -416,9 +416,9 @@ acpi_ns_detach_data(struct acpi_namespace_node * node, * * FUNCTION: acpi_ns_get_attached_data * - * PARAMETERS: node - Namespace node - * handler - Handler associated with the data - * data - Where the data is returned + * PARAMETERS: Node - Namespace node + * Handler - Handler associated with the data + * Data - Where the data is returned * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/nspredef.c b/trunk/drivers/acpi/acpica/nspredef.c index 2419f417ea33..fe6626035495 100644 --- a/trunk/drivers/acpi/acpica/nspredef.c +++ b/trunk/drivers/acpi/acpica/nspredef.c @@ -116,7 +116,7 @@ static const char *acpi_rtype_names[] = { * * FUNCTION: acpi_ns_check_predefined_names * - * PARAMETERS: node - Namespace node for the method/object + * PARAMETERS: Node - Namespace node for the method/object * user_param_count - Number of parameters actually passed * return_status - Status from the object evaluation * return_object_ptr - Pointer to the object returned from the @@ -275,10 +275,10 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, * * FUNCTION: acpi_ns_check_parameter_count * - * PARAMETERS: pathname - Full pathname to the node (for error msgs) - * node - Namespace node for the method/object + * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * Node - Namespace node for the method/object * user_param_count - Number of args passed in by the caller - * predefined - Pointer to entry in predefined name table + * Predefined - Pointer to entry in predefined name table * * RETURN: None * @@ -364,7 +364,7 @@ acpi_ns_check_parameter_count(char *pathname, * * FUNCTION: acpi_ns_check_for_predefined_name * - * PARAMETERS: node - Namespace node for the method/object + * PARAMETERS: Node - Namespace node for the method/object * * RETURN: Pointer to entry in predefined table. NULL indicates not found. * @@ -410,7 +410,7 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct * * FUNCTION: acpi_ns_check_package * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -685,11 +685,11 @@ acpi_ns_check_package(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_check_package_list * - * PARAMETERS: data - Pointer to validation data structure - * package - Pointer to package-specific info for method - * elements - Element list of parent package. All elements + * PARAMETERS: Data - Pointer to validation data structure + * Package - Pointer to package-specific info for method + * Elements - Element list of parent package. All elements * of this list should be of type Package. - * count - Count of subpackages + * Count - Count of subpackages * * RETURN: Status * @@ -911,12 +911,12 @@ acpi_ns_check_package_list(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_check_package_elements * - * PARAMETERS: data - Pointer to validation data structure - * elements - Pointer to the package elements array - * type1 - Object type for first group - * count1 - Count for first group - * type2 - Object type for second group - * count2 - Count for second group + * PARAMETERS: Data - Pointer to validation data structure + * Elements - Pointer to the package elements array + * Type1 - Object type for first group + * Count1 - Count for first group + * Type2 - Object type for second group + * Count2 - Count for second group * start_index - Start of the first group of elements * * RETURN: Status @@ -968,7 +968,7 @@ acpi_ns_check_package_elements(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_check_object_type * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * expected_btypes - Bitmap of expected return type(s) @@ -1102,7 +1102,7 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_check_reference * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object - Object returned from the evaluation of a * method or object * @@ -1140,7 +1140,7 @@ acpi_ns_check_reference(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_get_expected_types * - * PARAMETERS: buffer - Pointer to where the string is returned + * PARAMETERS: Buffer - Pointer to where the string is returned * expected_btypes - Bitmap of expected return type(s) * * RETURN: Buffer is populated with type names. diff --git a/trunk/drivers/acpi/acpica/nsrepair.c b/trunk/drivers/acpi/acpica/nsrepair.c index 8c5f292860fc..5519a64a353f 100644 --- a/trunk/drivers/acpi/acpica/nsrepair.c +++ b/trunk/drivers/acpi/acpica/nsrepair.c @@ -94,7 +94,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, * * FUNCTION: acpi_ns_repair_object * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * expected_btypes - Object types expected * package_index - Index of object within parent package (if * applicable - ACPI_NOT_PACKAGE_ELEMENT @@ -470,7 +470,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, * * FUNCTION: acpi_ns_repair_null_element * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * expected_btypes - Object types expected * package_index - Index of object within parent package (if * applicable - ACPI_NOT_PACKAGE_ELEMENT @@ -509,17 +509,17 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data, */ if (expected_btypes & ACPI_RTYPE_INTEGER) { - /* Need an integer - create a zero-value integer */ + /* Need an Integer - create a zero-value integer */ new_object = acpi_ut_create_integer_object((u64)0); } else if (expected_btypes & ACPI_RTYPE_STRING) { - /* Need a string - create a NULL string */ + /* Need a String - create a NULL string */ new_object = acpi_ut_create_string_object(0); } else if (expected_btypes & ACPI_RTYPE_BUFFER) { - /* Need a buffer - create a zero-length buffer */ + /* Need a Buffer - create a zero-length buffer */ new_object = acpi_ut_create_buffer_object(0); } else { @@ -552,7 +552,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_remove_null_elements * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * package_type - An acpi_return_package_types value * obj_desc - A Package object * @@ -635,7 +635,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_wrap_with_package * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * original_object - Pointer to the object to repair. * obj_desc_ptr - The new package object is returned here * diff --git a/trunk/drivers/acpi/acpica/nsrepair2.c b/trunk/drivers/acpi/acpica/nsrepair2.c index 90189251cdf0..726bc8e687f7 100644 --- a/trunk/drivers/acpi/acpica/nsrepair2.c +++ b/trunk/drivers/acpi/acpica/nsrepair2.c @@ -149,8 +149,8 @@ static const struct acpi_repair_info acpi_ns_repairable_names[] = { * * FUNCTION: acpi_ns_complex_repairs * - * PARAMETERS: data - Pointer to validation data structure - * node - Namespace node for the method/object + * PARAMETERS: Data - Pointer to validation data structure + * Node - Namespace node for the method/object * validate_status - Original status of earlier validation * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object @@ -187,7 +187,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_match_repairable_name * - * PARAMETERS: node - Namespace node for the method/object + * PARAMETERS: Node - Namespace node for the method/object * * RETURN: Pointer to entry in repair table. NULL indicates not found. * @@ -218,7 +218,7 @@ static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct * * FUNCTION: acpi_ns_repair_ALR * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -247,7 +247,7 @@ acpi_ns_repair_ALR(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_repair_FDE * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -335,7 +335,7 @@ acpi_ns_repair_FDE(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_repair_CID * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -405,7 +405,7 @@ acpi_ns_repair_CID(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_repair_HID * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -487,7 +487,7 @@ acpi_ns_repair_HID(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_repair_TSS * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -531,7 +531,7 @@ acpi_ns_repair_TSS(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_repair_PSS * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * @@ -600,7 +600,7 @@ acpi_ns_repair_PSS(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_check_sorted_list * - * PARAMETERS: data - Pointer to validation data structure + * PARAMETERS: Data - Pointer to validation data structure * return_object - Pointer to the top-level returned object * expected_count - Minimum length of each sub-package * sort_index - Sub-package entry to sort on @@ -707,9 +707,9 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data, * * FUNCTION: acpi_ns_sort_list * - * PARAMETERS: elements - Package object element list - * count - Element count for above - * index - Sort by which package element + * PARAMETERS: Elements - Package object element list + * Count - Element count for above + * Index - Sort by which package element * sort_direction - Ascending or Descending sort * * RETURN: None diff --git a/trunk/drivers/acpi/acpica/nssearch.c b/trunk/drivers/acpi/acpica/nssearch.c index 456cc859f869..507043d66114 100644 --- a/trunk/drivers/acpi/acpica/nssearch.c +++ b/trunk/drivers/acpi/acpica/nssearch.c @@ -65,7 +65,7 @@ acpi_ns_search_parent_tree(u32 target_name, * * PARAMETERS: target_name - Ascii ACPI name to search for * parent_node - Starting node where search will begin - * type - Object type to match + * Type - Object type to match * return_node - Where the matched Named obj is returned * * RETURN: Status @@ -175,8 +175,8 @@ acpi_ns_search_one_scope(u32 target_name, * FUNCTION: acpi_ns_search_parent_tree * * PARAMETERS: target_name - Ascii ACPI name to search for - * node - Starting node where search will begin - * type - Object type to match + * Node - Starting node where search will begin + * Type - Object type to match * return_node - Where the matched Node is returned * * RETURN: Status @@ -264,11 +264,11 @@ acpi_ns_search_parent_tree(u32 target_name, * * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars) * walk_state - Current state of the walk - * node - Starting node where search will begin + * Node - Starting node where search will begin * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x. * Otherwise,search only. - * type - Object type to match - * flags - Flags describing the search restrictions + * Type - Object type to match + * Flags - Flags describing the search restrictions * return_node - Where the Node is returned * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/nsutils.c b/trunk/drivers/acpi/acpica/nsutils.c index ef753a41e087..75113759f69d 100644 --- a/trunk/drivers/acpi/acpica/nsutils.c +++ b/trunk/drivers/acpi/acpica/nsutils.c @@ -62,8 +62,8 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search); * * FUNCTION: acpi_ns_print_node_pathname * - * PARAMETERS: node - Object - * message - Prefix message + * PARAMETERS: Node - Object + * Message - Prefix message * * DESCRIPTION: Print an object's full namespace pathname * Manages allocation/freeing of a pathname buffer @@ -101,7 +101,7 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node, * * FUNCTION: acpi_ns_valid_root_prefix * - * PARAMETERS: prefix - Character to be checked + * PARAMETERS: Prefix - Character to be checked * * RETURN: TRUE if a valid prefix * @@ -119,7 +119,7 @@ u8 acpi_ns_valid_root_prefix(char prefix) * * FUNCTION: acpi_ns_valid_path_separator * - * PARAMETERS: sep - Character to be checked + * PARAMETERS: Sep - Character to be checked * * RETURN: TRUE if a valid path separator * @@ -137,7 +137,7 @@ static u8 acpi_ns_valid_path_separator(char sep) * * FUNCTION: acpi_ns_get_type * - * PARAMETERS: node - Parent Node to be examined + * PARAMETERS: Node - Parent Node to be examined * * RETURN: Type field from Node whose handle is passed * @@ -161,7 +161,7 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node) * * FUNCTION: acpi_ns_local * - * PARAMETERS: type - A namespace object type + * PARAMETERS: Type - A namespace object type * * RETURN: LOCAL if names must be found locally in objects of the * passed type, 0 if enclosing scopes should be searched @@ -189,7 +189,7 @@ u32 acpi_ns_local(acpi_object_type type) * * FUNCTION: acpi_ns_get_internal_name_length * - * PARAMETERS: info - Info struct initialized with the + * PARAMETERS: Info - Info struct initialized with the * external name pointer. * * RETURN: None @@ -260,7 +260,7 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) * * FUNCTION: acpi_ns_build_internal_name * - * PARAMETERS: info - Info struct fully initialized + * PARAMETERS: Info - Info struct fully initialized * * RETURN: Status * @@ -371,7 +371,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) * FUNCTION: acpi_ns_internalize_name * * PARAMETERS: *external_name - External representation of name - * **Converted name - Where to return the resulting + * **Converted Name - Where to return the resulting * internal represention of the name * * RETURN: Status @@ -575,7 +575,7 @@ acpi_ns_externalize_name(u32 internal_name_length, * * FUNCTION: acpi_ns_validate_handle * - * PARAMETERS: handle - Handle to be validated and typecast to a + * PARAMETERS: Handle - Handle to be validated and typecast to a * namespace node. * * RETURN: A pointer to a namespace node @@ -651,7 +651,7 @@ void acpi_ns_terminate(void) * * FUNCTION: acpi_ns_opens_scope * - * PARAMETERS: type - A valid namespace type + * PARAMETERS: Type - A valid namespace type * * RETURN: NEWSCOPE if the passed type "opens a name scope" according * to the ACPI specification, else 0 @@ -677,14 +677,14 @@ u32 acpi_ns_opens_scope(acpi_object_type type) * * FUNCTION: acpi_ns_get_node * - * PARAMETERS: *pathname - Name to be found, in external (ASL) format. The + * PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The * \ (backslash) and ^ (carat) prefixes, and the * . (period) to separate segments are supported. * prefix_node - Root of subtree to be searched, or NS_ALL for the * root of the name space. If Name is fully * qualified (first s8 is '\'), the passed value * of Scope will not be accessed. - * flags - Used to indicate whether to perform upsearch or + * Flags - Used to indicate whether to perform upsearch or * not. * return_node - Where the Node is returned * diff --git a/trunk/drivers/acpi/acpica/nswalk.c b/trunk/drivers/acpi/acpica/nswalk.c index 730bccc5e7f7..f69895a54895 100644 --- a/trunk/drivers/acpi/acpica/nswalk.c +++ b/trunk/drivers/acpi/acpica/nswalk.c @@ -88,7 +88,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node * * FUNCTION: acpi_ns_get_next_node_typed * - * PARAMETERS: type - Type of node to be searched for + * PARAMETERS: Type - Type of node to be searched for * parent_node - Parent node whose children we are * getting * child_node - Previous child that was found. @@ -151,16 +151,16 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, * * FUNCTION: acpi_ns_walk_namespace * - * PARAMETERS: type - acpi_object_type to search for + * PARAMETERS: Type - acpi_object_type to search for * start_node - Handle in namespace where search begins * max_depth - Depth to which search is to reach - * flags - Whether to unlock the NS before invoking + * Flags - Whether to unlock the NS before invoking * the callback routine * pre_order_visit - Called during tree pre-order visit * when an object of "Type" is found * post_order_visit - Called during tree post-order visit * when an object of "Type" is found - * context - Passed to user function(s) above + * Context - Passed to user function(s) above * return_value - from the user_function if terminated * early. Otherwise, returns NULL. * RETURNS: Status diff --git a/trunk/drivers/acpi/acpica/nsxfeval.c b/trunk/drivers/acpi/acpica/nsxfeval.c index 9692e6702333..71d15f61807b 100644 --- a/trunk/drivers/acpi/acpica/nsxfeval.c +++ b/trunk/drivers/acpi/acpica/nsxfeval.c @@ -58,8 +58,8 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info); * * FUNCTION: acpi_evaluate_object_typed * - * PARAMETERS: handle - Object handle (optional) - * pathname - Object pathname (optional) + * PARAMETERS: Handle - Object handle (optional) + * Pathname - Object pathname (optional) * external_params - List of parameters to pass to method, * terminated by NULL. May be NULL * if no parameters are being passed. @@ -152,8 +152,8 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed) * * FUNCTION: acpi_evaluate_object * - * PARAMETERS: handle - Object handle (optional) - * pathname - Object pathname (optional) + * PARAMETERS: Handle - Object handle (optional) + * Pathname - Object pathname (optional) * external_params - List of parameters to pass to method, * terminated by NULL. May be NULL * if no parameters are being passed. @@ -364,7 +364,7 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object) * * FUNCTION: acpi_ns_resolve_references * - * PARAMETERS: info - Evaluation info block + * PARAMETERS: Info - Evaluation info block * * RETURN: Info->return_object is replaced with the dereferenced object * @@ -431,14 +431,14 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info) * * FUNCTION: acpi_walk_namespace * - * PARAMETERS: type - acpi_object_type to search for + * PARAMETERS: Type - acpi_object_type to search for * start_object - Handle in namespace where search begins * max_depth - Depth to which search is to reach * pre_order_visit - Called during tree pre-order visit * when an object of "Type" is found * post_order_visit - Called during tree post-order visit * when an object of "Type" is found - * context - Passed to user function(s) above + * Context - Passed to user function(s) above * return_value - Location where return value of * user_function is put if terminated early * @@ -646,7 +646,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, * * PARAMETERS: HID - HID to search for. Can be NULL. * user_function - Called when a matching object is found - * context - Passed to user function + * Context - Passed to user function * return_value - Location where return value of * user_function is put if terminated early * @@ -716,8 +716,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_devices) * FUNCTION: acpi_attach_data * * PARAMETERS: obj_handle - Namespace node - * handler - Handler for this attachment - * data - Pointer to data to be attached + * Handler - Handler for this attachment + * Data - Pointer to data to be attached * * RETURN: Status * @@ -764,7 +764,7 @@ ACPI_EXPORT_SYMBOL(acpi_attach_data) * FUNCTION: acpi_detach_data * * PARAMETERS: obj_handle - Namespace node handle - * handler - Handler used in call to acpi_attach_data + * Handler - Handler used in call to acpi_attach_data * * RETURN: Status * @@ -810,8 +810,8 @@ ACPI_EXPORT_SYMBOL(acpi_detach_data) * FUNCTION: acpi_get_data * * PARAMETERS: obj_handle - Namespace node - * handler - Handler used in call to attach_data - * data - Where the data is returned + * Handler - Handler used in call to attach_data + * Data - Where the data is returned * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/nsxfname.c b/trunk/drivers/acpi/acpica/nsxfname.c index 08e9610b34ca..af401c9c4dfc 100644 --- a/trunk/drivers/acpi/acpica/nsxfname.c +++ b/trunk/drivers/acpi/acpica/nsxfname.c @@ -61,8 +61,8 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, * * FUNCTION: acpi_get_handle * - * PARAMETERS: parent - Object to search under (search scope). - * pathname - Pointer to an asciiz string containing the + * PARAMETERS: Parent - Object to search under (search scope). + * Pathname - Pointer to an asciiz string containing the * name * ret_handle - Where the return handle is returned * @@ -142,9 +142,9 @@ ACPI_EXPORT_SYMBOL(acpi_get_handle) * * FUNCTION: acpi_get_name * - * PARAMETERS: handle - Handle to be converted to a pathname + * PARAMETERS: Handle - Handle to be converted to a pathname * name_type - Full pathname or single segment - * buffer - Buffer for returned path + * Buffer - Buffer for returned path * * RETURN: Pointer to a string containing the fully qualified Name. * @@ -219,8 +219,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_name) * * FUNCTION: acpi_ns_copy_device_id * - * PARAMETERS: dest - Pointer to the destination DEVICE_ID - * source - Pointer to the source DEVICE_ID + * PARAMETERS: Dest - Pointer to the destination DEVICE_ID + * Source - Pointer to the source DEVICE_ID * string_area - Pointer to where to copy the dest string * * RETURN: Pointer to the next string area @@ -247,7 +247,7 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, * * FUNCTION: acpi_get_object_info * - * PARAMETERS: handle - Object Handle + * PARAMETERS: Handle - Object Handle * return_buffer - Where the info is returned * * RETURN: Status @@ -493,7 +493,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_object_info) * * FUNCTION: acpi_install_method * - * PARAMETERS: buffer - An ACPI table containing one control method + * PARAMETERS: Buffer - An ACPI table containing one control method * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/nsxfobj.c b/trunk/drivers/acpi/acpica/nsxfobj.c index 6766fc4f088f..880a605cee20 100644 --- a/trunk/drivers/acpi/acpica/nsxfobj.c +++ b/trunk/drivers/acpi/acpica/nsxfobj.c @@ -98,7 +98,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_id) * * FUNCTION: acpi_get_type * - * PARAMETERS: handle - Handle of object whose type is desired + * PARAMETERS: Handle - Handle of object whose type is desired * ret_type - Where the type will be placed * * RETURN: Status @@ -151,7 +151,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_type) * * FUNCTION: acpi_get_parent * - * PARAMETERS: handle - Handle of object whose parent is desired + * PARAMETERS: Handle - Handle of object whose parent is desired * ret_handle - Where the parent handle will be placed * * RETURN: Status @@ -212,8 +212,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_parent) * * FUNCTION: acpi_get_next_object * - * PARAMETERS: type - Type of object to be searched for - * parent - Parent object whose children we are getting + * PARAMETERS: Type - Type of object to be searched for + * Parent - Parent object whose children we are getting * last_child - Previous child that was found. * The NEXT child will be returned * ret_handle - Where handle to the next object is placed diff --git a/trunk/drivers/acpi/acpica/psargs.c b/trunk/drivers/acpi/acpica/psargs.c index 844464c4f901..5ac36aba507c 100644 --- a/trunk/drivers/acpi/acpica/psargs.c +++ b/trunk/drivers/acpi/acpica/psargs.c @@ -210,7 +210,7 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state) * FUNCTION: acpi_ps_get_next_namepath * * PARAMETERS: parser_state - Current parser state object - * arg - Where the namepath will be stored + * Arg - Where the namepath will be stored * arg_count - If the namepath points to a control method * the method's argument is returned here. * possible_method_call - Whether the namepath can possibly be the @@ -379,7 +379,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, * * PARAMETERS: parser_state - Current parser state object * arg_type - The argument type (AML_*_ARG) - * arg - Where the argument is returned + * Arg - Where the argument is returned * * RETURN: None * @@ -618,7 +618,6 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); if (!arg) { - acpi_ps_free_op(field); return_PTR(NULL); } @@ -663,7 +662,6 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state } else { arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); if (!arg) { - acpi_ps_free_op(field); return_PTR(NULL); } diff --git a/trunk/drivers/acpi/acpica/psloop.c b/trunk/drivers/acpi/acpica/psloop.c index 799162c1b6df..9547ad8a620b 100644 --- a/trunk/drivers/acpi/acpica/psloop.c +++ b/trunk/drivers/acpi/acpica/psloop.c @@ -167,7 +167,7 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state) * PARAMETERS: walk_state - Current state * aml_op_start - Begin of named Op in AML * unnamed_op - Early Op (not a named Op) - * op - Returned Op + * Op - Returned Op * * RETURN: Status * @@ -323,7 +323,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, if (walk_state->op_info->flags & AML_CREATE) { /* - * Backup to beginning of create_XXXfield declaration + * Backup to beginning of create_xXXfield declaration * body_length is unknown until we parse the body */ op->named.data = aml_op_start; @@ -380,7 +380,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, * * PARAMETERS: walk_state - Current state * aml_op_start - Op start in AML - * op - Current Op + * Op - Current Op * * RETURN: Status * @@ -679,8 +679,8 @@ acpi_ps_link_module_code(union acpi_parse_object *parent_op, * FUNCTION: acpi_ps_complete_op * * PARAMETERS: walk_state - Current state - * op - Returned Op - * status - Parse status before complete Op + * Op - Returned Op + * Status - Parse status before complete Op * * RETURN: Status * @@ -853,8 +853,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, * FUNCTION: acpi_ps_complete_final_op * * PARAMETERS: walk_state - Current state - * op - Current Op - * status - Current parse status before complete last + * Op - Current Op + * Status - Current parse status before complete last * Op * * RETURN: Status @@ -1165,7 +1165,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) if (walk_state->op_info->flags & AML_CREATE) { /* - * Backup to beginning of create_XXXfield declaration (1 for + * Backup to beginning of create_xXXfield declaration (1 for * Opcode) * * body_length is unknown until we parse the body diff --git a/trunk/drivers/acpi/acpica/psopcode.c b/trunk/drivers/acpi/acpica/psopcode.c index ed1d457bd5ca..a0226fdcf75c 100644 --- a/trunk/drivers/acpi/acpica/psopcode.c +++ b/trunk/drivers/acpi/acpica/psopcode.c @@ -724,7 +724,7 @@ static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = { * * FUNCTION: acpi_ps_get_opcode_info * - * PARAMETERS: opcode - The AML opcode + * PARAMETERS: Opcode - The AML opcode * * RETURN: A pointer to the info about the opcode. * @@ -769,7 +769,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode) * * FUNCTION: acpi_ps_get_opcode_name * - * PARAMETERS: opcode - The AML opcode + * PARAMETERS: Opcode - The AML opcode * * RETURN: A pointer to the name of the opcode (ASCII String) * Note: Never returns NULL. diff --git a/trunk/drivers/acpi/acpica/psparse.c b/trunk/drivers/acpi/acpica/psparse.c index 01985703bb98..2ff9c35a1968 100644 --- a/trunk/drivers/acpi/acpica/psparse.c +++ b/trunk/drivers/acpi/acpica/psparse.c @@ -64,7 +64,7 @@ ACPI_MODULE_NAME("psparse") * * FUNCTION: acpi_ps_get_opcode_size * - * PARAMETERS: opcode - An AML opcode + * PARAMETERS: Opcode - An AML opcode * * RETURN: Size of the opcode, in bytes (1 or 2) * @@ -121,7 +121,7 @@ u16 acpi_ps_peek_opcode(struct acpi_parse_state * parser_state) * FUNCTION: acpi_ps_complete_this_op * * PARAMETERS: walk_state - Current State - * op - Op to complete + * Op - Op to complete * * RETURN: Status * @@ -311,7 +311,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, * FUNCTION: acpi_ps_next_parse_state * * PARAMETERS: walk_state - Current state - * op - Current parse op + * Op - Current parse op * callback_status - Status from previous operation * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/psscope.c b/trunk/drivers/acpi/acpica/psscope.c index 608dc20dc173..c872aa4b926e 100644 --- a/trunk/drivers/acpi/acpica/psscope.c +++ b/trunk/drivers/acpi/acpica/psscope.c @@ -93,7 +93,7 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state * parser_state) * FUNCTION: acpi_ps_init_scope * * PARAMETERS: parser_state - Current parser state object - * root - the Root Node of this new scope + * Root - the Root Node of this new scope * * RETURN: Status * @@ -131,7 +131,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state, * FUNCTION: acpi_ps_push_scope * * PARAMETERS: parser_state - Current parser state object - * op - Current op to be pushed + * Op - Current op to be pushed * remaining_args - List of args remaining * arg_count - Fixed or variable number of args * @@ -184,7 +184,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state, * FUNCTION: acpi_ps_pop_scope * * PARAMETERS: parser_state - Current parser state object - * op - Where the popped op is returned + * Op - Where the popped op is returned * arg_list - Where the popped "next argument" is * returned * arg_count - Count of objects in arg_list diff --git a/trunk/drivers/acpi/acpica/pstree.c b/trunk/drivers/acpi/acpica/pstree.c index fdb2e71f3046..2b03cdbbe1c0 100644 --- a/trunk/drivers/acpi/acpica/pstree.c +++ b/trunk/drivers/acpi/acpica/pstree.c @@ -58,8 +58,8 @@ union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op); * * FUNCTION: acpi_ps_get_arg * - * PARAMETERS: op - Get an argument for this op - * argn - Nth argument to get + * PARAMETERS: Op - Get an argument for this op + * Argn - Nth argument to get * * RETURN: The argument (as an Op object). NULL if argument does not exist * @@ -114,8 +114,8 @@ union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn) * * FUNCTION: acpi_ps_append_arg * - * PARAMETERS: op - Append an argument to this Op. - * arg - Argument Op to append + * PARAMETERS: Op - Append an argument to this Op. + * Arg - Argument Op to append * * RETURN: None. * @@ -188,8 +188,8 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg) * * FUNCTION: acpi_ps_get_depth_next * - * PARAMETERS: origin - Root of subtree to search - * op - Last (previous) Op that was found + * PARAMETERS: Origin - Root of subtree to search + * Op - Last (previous) Op that was found * * RETURN: Next Op found in the search. * @@ -261,7 +261,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, * * FUNCTION: acpi_ps_get_child * - * PARAMETERS: op - Get the child of this Op + * PARAMETERS: Op - Get the child of this Op * * RETURN: Child Op, Null if none is found. * diff --git a/trunk/drivers/acpi/acpica/psutils.c b/trunk/drivers/acpi/acpica/psutils.c index 8736ad5f04d3..13bb131ae125 100644 --- a/trunk/drivers/acpi/acpica/psutils.c +++ b/trunk/drivers/acpi/acpica/psutils.c @@ -77,8 +77,8 @@ union acpi_parse_object *acpi_ps_create_scope_op(void) * * FUNCTION: acpi_ps_init_op * - * PARAMETERS: op - A newly allocated Op object - * opcode - Opcode to store in the Op + * PARAMETERS: Op - A newly allocated Op object + * Opcode - Opcode to store in the Op * * RETURN: None * @@ -103,7 +103,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode) * * FUNCTION: acpi_ps_alloc_op * - * PARAMETERS: opcode - Opcode that will be stored in the new Op + * PARAMETERS: Opcode - Opcode that will be stored in the new Op * * RETURN: Pointer to the new Op, null on failure * @@ -160,7 +160,7 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode) * * FUNCTION: acpi_ps_free_op * - * PARAMETERS: op - Op to be freed + * PARAMETERS: Op - Op to be freed * * RETURN: None. * diff --git a/trunk/drivers/acpi/acpica/psxface.c b/trunk/drivers/acpi/acpica/psxface.c index 963e16225797..9d98c5ff66a5 100644 --- a/trunk/drivers/acpi/acpica/psxface.c +++ b/trunk/drivers/acpi/acpica/psxface.c @@ -66,7 +66,7 @@ acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action); * PARAMETERS: method_name - Valid ACPI name string * debug_level - Optional level mask. 0 to use default * debug_layer - Optional layer mask. 0 to use default - * flags - bit 1: one shot(1) or persistent(0) + * Flags - bit 1: one shot(1) or persistent(0) * * RETURN: Status * @@ -105,7 +105,7 @@ acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags) * * FUNCTION: acpi_ps_start_trace * - * PARAMETERS: info - Method info struct + * PARAMETERS: Info - Method info struct * * RETURN: None * @@ -150,7 +150,7 @@ static void acpi_ps_start_trace(struct acpi_evaluate_info *info) * * FUNCTION: acpi_ps_stop_trace * - * PARAMETERS: info - Method info struct + * PARAMETERS: Info - Method info struct * * RETURN: None * @@ -193,10 +193,10 @@ static void acpi_ps_stop_trace(struct acpi_evaluate_info *info) * * FUNCTION: acpi_ps_execute_method * - * PARAMETERS: info - Method info block, contains: - * node - Method Node to execute + * PARAMETERS: Info - Method info block, contains: + * Node - Method Node to execute * obj_desc - Method object - * parameters - List of parameters to pass to the method, + * Parameters - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. * return_object - Where to put method's return value (if @@ -361,9 +361,9 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) * * FUNCTION: acpi_ps_update_parameter_list * - * PARAMETERS: info - See struct acpi_evaluate_info + * PARAMETERS: Info - See struct acpi_evaluate_info * (Used: parameter_type and Parameters) - * action - Add or Remove reference + * Action - Add or Remove reference * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/rsaddr.c b/trunk/drivers/acpi/acpica/rsaddr.c index 856ff075b6ab..a0305652394f 100644 --- a/trunk/drivers/acpi/acpica/rsaddr.c +++ b/trunk/drivers/acpi/acpica/rsaddr.c @@ -182,8 +182,8 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = { /* Revision ID */ - {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_ID), - AML_OFFSET(ext_address64.revision_ID), + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_iD), + AML_OFFSET(ext_address64.revision_iD), 1}, /* * These fields are contiguous in both the source and destination: @@ -215,7 +215,7 @@ static struct acpi_rsconvert_info acpi_rs_convert_general_flags[6] = { AML_OFFSET(address.resource_type), 1}, - /* General flags - Consume, Decode, min_fixed, max_fixed */ + /* General Flags - Consume, Decode, min_fixed, max_fixed */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer), AML_OFFSET(address.flags), @@ -293,8 +293,8 @@ static struct acpi_rsconvert_info acpi_rs_convert_io_flags[4] = { * * FUNCTION: acpi_rs_get_address_common * - * PARAMETERS: resource - Pointer to the internal resource struct - * aml - Pointer to the AML resource descriptor + * PARAMETERS: Resource - Pointer to the internal resource struct + * Aml - Pointer to the AML resource descriptor * * RETURN: TRUE if the resource_type field is OK, FALSE otherwise * @@ -343,8 +343,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource, * * FUNCTION: acpi_rs_set_address_common * - * PARAMETERS: aml - Pointer to the AML resource descriptor - * resource - Pointer to the internal resource struct + * PARAMETERS: Aml - Pointer to the AML resource descriptor + * Resource - Pointer to the internal resource struct * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/rscalc.c b/trunk/drivers/acpi/acpica/rscalc.c index de12469d1c9c..3c6df4b7eb2d 100644 --- a/trunk/drivers/acpi/acpica/rscalc.c +++ b/trunk/drivers/acpi/acpica/rscalc.c @@ -173,7 +173,7 @@ acpi_rs_stream_option_length(u32 resource_length, * * FUNCTION: acpi_rs_get_aml_length * - * PARAMETERS: resource - Pointer to the resource linked list + * PARAMETERS: Resource - Pointer to the resource linked list * size_needed - Where the required size is returned * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/rscreate.c b/trunk/drivers/acpi/acpica/rscreate.c index 311cbc4f05fa..46d6eb38ae66 100644 --- a/trunk/drivers/acpi/acpica/rscreate.c +++ b/trunk/drivers/acpi/acpica/rscreate.c @@ -190,8 +190,8 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, * * FUNCTION: acpi_rs_create_pci_routing_table * - * PARAMETERS: package_object - Pointer to a package containing one - * of more ACPI_OPERAND_OBJECTs + * PARAMETERS: package_object - Pointer to a union acpi_operand_object + * package * output_buffer - Pointer to the user's buffer * * RETURN: Status AE_OK if okay, else a valid acpi_status code. @@ -199,7 +199,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, * AE_BUFFER_OVERFLOW and output_buffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the union acpi_operand_object package and creates a + * DESCRIPTION: Takes the union acpi_operand_object package and creates a * linked list of PCI interrupt descriptions * * NOTE: It is the caller's responsibility to ensure that the start of the diff --git a/trunk/drivers/acpi/acpica/rsdump.c b/trunk/drivers/acpi/acpica/rsdump.c index 4d11b072388c..b4c581132393 100644 --- a/trunk/drivers/acpi/acpica/rsdump.c +++ b/trunk/drivers/acpi/acpica/rsdump.c @@ -703,7 +703,7 @@ acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source) * * FUNCTION: acpi_rs_dump_address_common * - * PARAMETERS: resource - Pointer to an internal resource descriptor + * PARAMETERS: Resource - Pointer to an internal resource descriptor * * RETURN: None * @@ -850,8 +850,8 @@ void acpi_rs_dump_irq_list(u8 * route_table) * * FUNCTION: acpi_rs_out* * - * PARAMETERS: title - Name of the resource field - * value - Value of the resource field + * PARAMETERS: Title - Name of the resource field + * Value - Value of the resource field * * RETURN: None * @@ -898,8 +898,8 @@ static void acpi_rs_out_title(char *title) * * FUNCTION: acpi_rs_dump*List * - * PARAMETERS: length - Number of elements in the list - * data - Start of the list + * PARAMETERS: Length - Number of elements in the list + * Data - Start of the list * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/rslist.c b/trunk/drivers/acpi/acpica/rslist.c index 46b5324b22d6..9be129f5d6f4 100644 --- a/trunk/drivers/acpi/acpica/rslist.c +++ b/trunk/drivers/acpi/acpica/rslist.c @@ -139,7 +139,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml, * * FUNCTION: acpi_rs_convert_resources_to_aml * - * PARAMETERS: resource - Pointer to the resource linked list + * PARAMETERS: Resource - Pointer to the resource linked list * aml_size_needed - Calculated size of the byte stream * needed from calling acpi_rs_get_aml_length() * The size of the output_buffer is diff --git a/trunk/drivers/acpi/acpica/rsmisc.c b/trunk/drivers/acpi/acpica/rsmisc.c index c6f291c2bc83..8073b371cc7c 100644 --- a/trunk/drivers/acpi/acpica/rsmisc.c +++ b/trunk/drivers/acpi/acpica/rsmisc.c @@ -57,9 +57,9 @@ ACPI_MODULE_NAME("rsmisc") * * FUNCTION: acpi_rs_convert_aml_to_resource * - * PARAMETERS: resource - Pointer to the resource descriptor - * aml - Where the AML descriptor is returned - * info - Pointer to appropriate conversion table + * PARAMETERS: Resource - Pointer to the resource descriptor + * Aml - Where the AML descriptor is returned + * Info - Pointer to appropriate conversion table * * RETURN: Status * @@ -406,7 +406,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, case ACPI_RSC_EXIT_NE: /* - * control - Exit conversion if not equal + * Control - Exit conversion if not equal */ switch (info->resource_offset) { case ACPI_RSC_COMPARE_AML_LENGTH: @@ -454,9 +454,9 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, * * FUNCTION: acpi_rs_convert_resource_to_aml * - * PARAMETERS: resource - Pointer to the resource descriptor - * aml - Where the AML descriptor is returned - * info - Pointer to appropriate conversion table + * PARAMETERS: Resource - Pointer to the resource descriptor + * Aml - Where the AML descriptor is returned + * Info - Pointer to appropriate conversion table * * RETURN: Status * @@ -726,7 +726,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, case ACPI_RSC_EXIT_LE: /* - * control - Exit conversion if less than or equal + * Control - Exit conversion if less than or equal */ if (item_count <= info->value) { goto exit; @@ -735,7 +735,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, case ACPI_RSC_EXIT_NE: /* - * control - Exit conversion if not equal + * Control - Exit conversion if not equal */ switch (COMPARE_OPCODE(info)) { case ACPI_RSC_COMPARE_VALUE: @@ -757,7 +757,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, case ACPI_RSC_EXIT_EQ: /* - * control - Exit conversion if equal + * Control - Exit conversion if equal */ if (*ACPI_ADD_PTR(u8, resource, COMPARE_TARGET(info)) == @@ -783,7 +783,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, #if 0 /* Previous resource validations */ -if (aml->ext_address64.revision_ID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { +if (aml->ext_address64.revision_iD != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { return_ACPI_STATUS(AE_SUPPORT); } diff --git a/trunk/drivers/acpi/acpica/rsutils.c b/trunk/drivers/acpi/acpica/rsutils.c index 37d5241c0acf..433a375deb93 100644 --- a/trunk/drivers/acpi/acpica/rsutils.c +++ b/trunk/drivers/acpi/acpica/rsutils.c @@ -53,8 +53,8 @@ ACPI_MODULE_NAME("rsutils") * * FUNCTION: acpi_rs_decode_bitmask * - * PARAMETERS: mask - Bitmask to decode - * list - Where the converted list is returned + * PARAMETERS: Mask - Bitmask to decode + * List - Where the converted list is returned * * RETURN: Count of bits set (length of list) * @@ -86,8 +86,8 @@ u8 acpi_rs_decode_bitmask(u16 mask, u8 * list) * * FUNCTION: acpi_rs_encode_bitmask * - * PARAMETERS: list - List of values to encode - * count - Length of list + * PARAMETERS: List - List of values to encode + * Count - Length of list * * RETURN: Encoded bitmask * @@ -115,8 +115,8 @@ u16 acpi_rs_encode_bitmask(u8 * list, u8 count) * * FUNCTION: acpi_rs_move_data * - * PARAMETERS: destination - Pointer to the destination descriptor - * source - Pointer to the source descriptor + * PARAMETERS: Destination - Pointer to the destination descriptor + * Source - Pointer to the source descriptor * item_count - How many items to move * move_type - Byte width * @@ -183,7 +183,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type) * * PARAMETERS: total_length - Length of the AML descriptor, including * the header and length fields. - * aml - Pointer to the raw AML descriptor + * Aml - Pointer to the raw AML descriptor * * RETURN: None * @@ -235,7 +235,7 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length, * PARAMETERS: descriptor_type - Byte to be inserted as the type * total_length - Length of the AML descriptor, including * the header and length fields. - * aml - Pointer to the raw AML descriptor + * Aml - Pointer to the raw AML descriptor * * RETURN: None * @@ -265,8 +265,8 @@ acpi_rs_set_resource_header(u8 descriptor_type, * * FUNCTION: acpi_rs_strcpy * - * PARAMETERS: destination - Pointer to the destination string - * source - Pointer to the source string + * PARAMETERS: Destination - Pointer to the destination string + * Source - Pointer to the source string * * RETURN: String length, including NULL terminator * @@ -300,7 +300,7 @@ static u16 acpi_rs_strcpy(char *destination, char *source) * minimum_length - Minimum length of the descriptor (minus * any optional fields) * resource_source - Where the resource_source is returned - * aml - Pointer to the raw AML descriptor + * Aml - Pointer to the raw AML descriptor * string_ptr - (optional) where to store the actual * resource_source string * @@ -386,7 +386,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, * * FUNCTION: acpi_rs_set_resource_source * - * PARAMETERS: aml - Pointer to the raw AML descriptor + * PARAMETERS: Aml - Pointer to the raw AML descriptor * minimum_length - Minimum length of the descriptor (minus * any optional fields) * resource_source - Internal resource_source @@ -445,7 +445,7 @@ acpi_rs_set_resource_source(union aml_resource * aml, * * FUNCTION: acpi_rs_get_prt_method_data * - * PARAMETERS: node - Device node + * PARAMETERS: Node - Device node * ret_buffer - Pointer to a buffer structure for the * results * @@ -494,7 +494,7 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, * * FUNCTION: acpi_rs_get_crs_method_data * - * PARAMETERS: node - Device node + * PARAMETERS: Node - Device node * ret_buffer - Pointer to a buffer structure for the * results * @@ -534,7 +534,7 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, */ status = acpi_rs_create_resource_list(obj_desc, ret_buffer); - /* On exit, we must delete the object returned by evaluateObject */ + /* On exit, we must delete the object returned by evaluate_object */ acpi_ut_remove_reference(obj_desc); return_ACPI_STATUS(status); @@ -544,7 +544,7 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, * * FUNCTION: acpi_rs_get_prs_method_data * - * PARAMETERS: node - Device node + * PARAMETERS: Node - Device node * ret_buffer - Pointer to a buffer structure for the * results * @@ -585,7 +585,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, */ status = acpi_rs_create_resource_list(obj_desc, ret_buffer); - /* On exit, we must delete the object returned by evaluateObject */ + /* On exit, we must delete the object returned by evaluate_object */ acpi_ut_remove_reference(obj_desc); return_ACPI_STATUS(status); @@ -596,7 +596,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, * * FUNCTION: acpi_rs_get_aei_method_data * - * PARAMETERS: node - Device node + * PARAMETERS: Node - Device node * ret_buffer - Pointer to a buffer structure for the * results * @@ -636,7 +636,7 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, */ status = acpi_rs_create_resource_list(obj_desc, ret_buffer); - /* On exit, we must delete the object returned by evaluateObject */ + /* On exit, we must delete the object returned by evaluate_object */ acpi_ut_remove_reference(obj_desc); return_ACPI_STATUS(status); @@ -646,8 +646,8 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, * * FUNCTION: acpi_rs_get_method_data * - * PARAMETERS: handle - Handle to the containing object - * path - Path to method, relative to Handle + * PARAMETERS: Handle - Handle to the containing object + * Path - Path to method, relative to Handle * ret_buffer - Pointer to a buffer structure for the * results * @@ -697,7 +697,7 @@ acpi_rs_get_method_data(acpi_handle handle, * * FUNCTION: acpi_rs_set_srs_method_data * - * PARAMETERS: node - Device node + * PARAMETERS: Node - Device node * in_buffer - Pointer to a buffer structure of the * parameter * diff --git a/trunk/drivers/acpi/acpica/rsxface.c b/trunk/drivers/acpi/acpica/rsxface.c index 5aad744b5b83..f58c098c7aeb 100644 --- a/trunk/drivers/acpi/acpica/rsxface.c +++ b/trunk/drivers/acpi/acpica/rsxface.c @@ -79,7 +79,7 @@ acpi_rs_validate_parameters(acpi_handle device_handle, * FUNCTION: acpi_rs_validate_parameters * * PARAMETERS: device_handle - Handle to a device - * buffer - Pointer to a data buffer + * Buffer - Pointer to a data buffer * return_node - Pointer to where the device node is returned * * RETURN: Status @@ -351,8 +351,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_event_resources) * * FUNCTION: acpi_resource_to_address64 * - * PARAMETERS: resource - Pointer to a resource - * out - Pointer to the users's return buffer + * PARAMETERS: Resource - Pointer to a resource + * Out - Pointer to the users's return buffer * (a struct acpi_resource_address64) * * RETURN: Status @@ -415,9 +415,9 @@ ACPI_EXPORT_SYMBOL(acpi_resource_to_address64) * FUNCTION: acpi_get_vendor_resource * * PARAMETERS: device_handle - Handle for the parent device object - * name - Method name for the parent resource + * Name - Method name for the parent resource * (METHOD_NAME__CRS or METHOD_NAME__PRS) - * uuid - Pointer to the UUID to be matched. + * Uuid - Pointer to the UUID to be matched. * includes both subtype and 16-byte UUID * ret_buffer - Where the vendor resource is returned * @@ -526,11 +526,11 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context) * * PARAMETERS: device_handle - Handle to the device object for the * device we are querying - * name - Method name of the resources we want. + * Name - Method name of the resources we want. * (METHOD_NAME__CRS, METHOD_NAME__PRS, or * METHOD_NAME__AEI) * user_function - Called for each resource - * context - Passed to user_function + * Context - Passed to user_function * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/tbfadt.c b/trunk/drivers/acpi/acpica/tbfadt.c index 390651860bf0..4c9c760db4a4 100644 --- a/trunk/drivers/acpi/acpica/tbfadt.c +++ b/trunk/drivers/acpi/acpica/tbfadt.c @@ -49,10 +49,9 @@ ACPI_MODULE_NAME("tbfadt") /* Local prototypes */ -static void +static ACPI_INLINE void acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, - u8 space_id, - u8 byte_width, u64 address, char *register_name); + u8 space_id, u8 byte_width, u64 address); static void acpi_tb_convert_fadt(void); @@ -173,7 +172,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { * * PARAMETERS: generic_address - GAS struct to be initialized * byte_width - Width of this register - * address - Address of the register + * Address - Address of the register * * RETURN: None * @@ -183,25 +182,10 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { * ******************************************************************************/ -static void +static ACPI_INLINE void acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, - u8 space_id, - u8 byte_width, u64 address, char *register_name) + u8 space_id, u8 byte_width, u64 address) { - u8 bit_width; - - /* Bit width field in the GAS is only one byte long, 255 max */ - - bit_width = (u8)(byte_width * 8); - - if (byte_width > 31) { /* (31*8)=248 */ - ACPI_ERROR((AE_INFO, - "%s - 32-bit FADT register is too long (%u bytes, %u bits) " - "to convert to GAS struct - 255 bits max, truncating", - register_name, byte_width, (byte_width * 8))); - - bit_width = 255; - } /* * The 64-bit Address field is non-aligned in the byte packed @@ -212,7 +196,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, /* All other fields are byte-wide */ generic_address->space_id = space_id; - generic_address->bit_width = bit_width; + generic_address->bit_width = (u8)ACPI_MUL_8(byte_width); generic_address->bit_offset = 0; generic_address->access_width = 0; /* Access width ANY */ } @@ -283,8 +267,8 @@ void acpi_tb_parse_fadt(u32 table_index) * * FUNCTION: acpi_tb_create_local_fadt * - * PARAMETERS: table - Pointer to BIOS FADT - * length - Length of the table + * PARAMETERS: Table - Pointer to BIOS FADT + * Length - Length of the table * * RETURN: None * @@ -303,11 +287,11 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) * a warning. */ if (length > sizeof(struct acpi_table_fadt)) { - ACPI_BIOS_WARNING((AE_INFO, - "FADT (revision %u) is longer than ACPI 5.0 version, " - "truncating length %u to %u", - table->revision, length, - (u32)sizeof(struct acpi_table_fadt))); + ACPI_WARNING((AE_INFO, + "FADT (revision %u) is longer than ACPI 5.0 version, " + "truncating length %u to %u", + table->revision, length, + (u32)sizeof(struct acpi_table_fadt))); } /* Clear the entire local FADT */ @@ -452,13 +436,11 @@ static void acpi_tb_convert_fadt(void) * they must match. */ if (address64->address && address32 && - (address64->address != (u64)address32)) { - ACPI_BIOS_ERROR((AE_INFO, - "32/64X address mismatch in FADT/%s: " - "0x%8.8X/0x%8.8X%8.8X, using 32", - fadt_info_table[i].name, address32, - ACPI_FORMAT_UINT64(address64-> - address))); + (address64->address != (u64) address32)) { + ACPI_ERROR((AE_INFO, + "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", + fadt_info_table[i].name, address32, + ACPI_FORMAT_UINT64(address64->address))); } /* Always use 32-bit address if it is valid (non-null) */ @@ -474,8 +456,7 @@ static void acpi_tb_convert_fadt(void) &acpi_gbl_FADT, fadt_info_table [i].length), - (u64) address32, - fadt_info_table[i].name); + (u64) address32); } } } @@ -484,7 +465,7 @@ static void acpi_tb_convert_fadt(void) * * FUNCTION: acpi_tb_validate_fadt * - * PARAMETERS: table - Pointer to the FADT to be validated + * PARAMETERS: Table - Pointer to the FADT to be validated * * RETURN: None * @@ -513,25 +494,25 @@ static void acpi_tb_validate_fadt(void) * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. */ if (acpi_gbl_FADT.facs && - (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) { - ACPI_BIOS_WARNING((AE_INFO, - "32/64X FACS address mismatch in FADT - " - "0x%8.8X/0x%8.8X%8.8X, using 32", - acpi_gbl_FADT.facs, - ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); - - acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs; + (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) { + ACPI_WARNING((AE_INFO, + "32/64X FACS address mismatch in FADT - " + "0x%8.8X/0x%8.8X%8.8X, using 32", + acpi_gbl_FADT.facs, + ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); + + acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs; } if (acpi_gbl_FADT.dsdt && - (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) { - ACPI_BIOS_WARNING((AE_INFO, - "32/64X DSDT address mismatch in FADT - " - "0x%8.8X/0x%8.8X%8.8X, using 32", - acpi_gbl_FADT.dsdt, - ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); - - acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt; + (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) { + ACPI_WARNING((AE_INFO, + "32/64X DSDT address mismatch in FADT - " + "0x%8.8X/0x%8.8X%8.8X, using 32", + acpi_gbl_FADT.dsdt, + ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); + + acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; } /* If Hardware Reduced flag is set, we are all done */ @@ -561,10 +542,10 @@ static void acpi_tb_validate_fadt(void) */ if (address64->address && (address64->bit_width != ACPI_MUL_8(length))) { - ACPI_BIOS_WARNING((AE_INFO, - "32/64X length mismatch in FADT/%s: %u/%u", - name, ACPI_MUL_8(length), - address64->bit_width)); + ACPI_WARNING((AE_INFO, + "32/64X length mismatch in %s: %u/%u", + name, ACPI_MUL_8(length), + address64->bit_width)); } if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { @@ -573,29 +554,29 @@ static void acpi_tb_validate_fadt(void) * Both the address and length must be non-zero. */ if (!address64->address || !length) { - ACPI_BIOS_ERROR((AE_INFO, - "Required FADT field %s has zero address and/or length: " - "0x%8.8X%8.8X/0x%X", - name, - ACPI_FORMAT_UINT64(address64-> - address), - length)); + ACPI_ERROR((AE_INFO, + "Required field %s has zero address and/or length:" + " 0x%8.8X%8.8X/0x%X", + name, + ACPI_FORMAT_UINT64(address64-> + address), + length)); } } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { /* - * Field is optional (Pm2_control, GPE0, GPE1) AND has its own + * Field is optional (PM2Control, GPE0, GPE1) AND has its own * length field. If present, both the address and length must * be valid. */ if ((address64->address && !length) || (!address64->address && length)) { - ACPI_BIOS_WARNING((AE_INFO, - "Optional FADT field %s has zero address or length: " - "0x%8.8X%8.8X/0x%X", - name, - ACPI_FORMAT_UINT64 - (address64->address), - length)); + ACPI_WARNING((AE_INFO, + "Optional field %s has zero address or length: " + "0x%8.8X%8.8X/0x%X", + name, + ACPI_FORMAT_UINT64(address64-> + address), + length)); } } } @@ -640,12 +621,12 @@ static void acpi_tb_setup_fadt_registers(void) (fadt_info_table[i].default_length > 0) && (fadt_info_table[i].default_length != target64->bit_width)) { - ACPI_BIOS_WARNING((AE_INFO, - "Invalid length for FADT/%s: %u, using default %u", - fadt_info_table[i].name, - target64->bit_width, - fadt_info_table[i]. - default_length)); + ACPI_WARNING((AE_INFO, + "Invalid length for %s: %u, using default %u", + fadt_info_table[i].name, + target64->bit_width, + fadt_info_table[i]. + default_length)); /* Incorrect size, set width to the default */ @@ -689,8 +670,7 @@ static void acpi_tb_setup_fadt_registers(void) source64->address + (fadt_pm_info_table[i]. register_num * - pm1_register_byte_width), - "PmRegisters"); + pm1_register_byte_width)); } } } diff --git a/trunk/drivers/acpi/acpica/tbfind.c b/trunk/drivers/acpi/acpica/tbfind.c index 57deae166577..4903e36ea75a 100644 --- a/trunk/drivers/acpi/acpica/tbfind.c +++ b/trunk/drivers/acpi/acpica/tbfind.c @@ -52,7 +52,7 @@ ACPI_MODULE_NAME("tbfind") * * FUNCTION: acpi_tb_find_table * - * PARAMETERS: signature - String with ACPI table signature + * PARAMETERS: Signature - String with ACPI table signature * oem_id - String with the table OEM ID * oem_table_id - String with the OEM Table ID * table_index - Where the table index is returned diff --git a/trunk/drivers/acpi/acpica/tbinstal.c b/trunk/drivers/acpi/acpica/tbinstal.c index 74f97d74db1c..c03500b4cc7a 100644 --- a/trunk/drivers/acpi/acpica/tbinstal.c +++ b/trunk/drivers/acpi/acpica/tbinstal.c @@ -138,14 +138,13 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) if ((table_desc->pointer->signature[0] != 0x00) && (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { - ACPI_BIOS_ERROR((AE_INFO, - "Table has invalid signature [%4.4s] (0x%8.8X), " - "must be SSDT or OEMx", - acpi_ut_valid_acpi_name(*(u32 *)table_desc-> - pointer-> - signature) ? - table_desc->pointer->signature : "????", - *(u32 *)table_desc->pointer->signature)); + ACPI_ERROR((AE_INFO, + "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", + acpi_ut_valid_acpi_name(*(u32 *)table_desc-> + pointer-> + signature) ? table_desc-> + pointer->signature : "????", + *(u32 *)table_desc->pointer->signature)); return_ACPI_STATUS(AE_BAD_SIGNATURE); } @@ -397,10 +396,10 @@ acpi_status acpi_tb_resize_root_table_list(void) * * FUNCTION: acpi_tb_store_table * - * PARAMETERS: address - Table address - * table - Table header - * length - Table length - * flags - flags + * PARAMETERS: Address - Table address + * Table - Table header + * Length - Table length + * Flags - flags * * RETURN: Status and table index. * diff --git a/trunk/drivers/acpi/acpica/tbutils.c b/trunk/drivers/acpi/acpica/tbutils.c index b6cea30da638..0a706cac37de 100644 --- a/trunk/drivers/acpi/acpica/tbutils.c +++ b/trunk/drivers/acpi/acpica/tbutils.c @@ -178,8 +178,8 @@ u8 acpi_tb_tables_loaded(void) * * FUNCTION: acpi_tb_fix_string * - * PARAMETERS: string - String to be repaired - * length - Maximum length + * PARAMETERS: String - String to be repaired + * Length - Maximum length * * RETURN: None * @@ -205,7 +205,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length) * FUNCTION: acpi_tb_cleanup_table_header * * PARAMETERS: out_header - Where the cleaned header is returned - * header - Input ACPI table header + * Header - Input ACPI table header * * RETURN: Returns the cleaned header in out_header * @@ -231,8 +231,8 @@ acpi_tb_cleanup_table_header(struct acpi_table_header *out_header, * * FUNCTION: acpi_tb_print_table_header * - * PARAMETERS: address - Table physical address - * header - Table header + * PARAMETERS: Address - Table physical address + * Header - Table header * * RETURN: None * @@ -296,8 +296,8 @@ acpi_tb_print_table_header(acpi_physical_address address, * * FUNCTION: acpi_tb_validate_checksum * - * PARAMETERS: table - ACPI table to verify - * length - Length of entire table + * PARAMETERS: Table - ACPI table to verify + * Length - Length of entire table * * RETURN: Status * @@ -317,11 +317,10 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) /* Checksum ok? (should be zero) */ if (checksum) { - ACPI_BIOS_WARNING((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, " - "should be 0x%2.2X", - table->signature, table->checksum, - (u8)(table->checksum - checksum))); + ACPI_WARNING((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", + table->signature, table->checksum, + (u8) (table->checksum - checksum))); #if (ACPI_CHECKSUM_ABORT) @@ -336,8 +335,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) * * FUNCTION: acpi_tb_checksum * - * PARAMETERS: buffer - Pointer to memory region to be checked - * length - Length of this memory region + * PARAMETERS: Buffer - Pointer to memory region to be checked + * Length - Length of this memory region * * RETURN: Checksum (u8) * @@ -378,9 +377,8 @@ void acpi_tb_check_dsdt_header(void) if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { - ACPI_BIOS_ERROR((AE_INFO, - "The DSDT has been corrupted or replaced - " - "old, new headers below")); + ACPI_ERROR((AE_INFO, + "The DSDT has been corrupted or replaced - old, new headers below")); acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); acpi_tb_print_table_header(0, acpi_gbl_DSDT); @@ -440,8 +438,8 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) * * FUNCTION: acpi_tb_install_table * - * PARAMETERS: address - Physical address of DSDT or FACS - * signature - Table signature, NULL if no need to + * PARAMETERS: Address - Physical address of DSDT or FACS + * Signature - Table signature, NULL if no need to * match * table_index - Index into root table array * @@ -482,10 +480,9 @@ acpi_tb_install_table(acpi_physical_address address, /* If a particular signature is expected (DSDT/FACS), it must match */ if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { - ACPI_BIOS_ERROR((AE_INFO, - "Invalid signature 0x%X for ACPI table, expected [%s]", - *ACPI_CAST_PTR(u32, table->signature), - signature)); + ACPI_ERROR((AE_INFO, + "Invalid signature 0x%X for ACPI table, expected [%s]", + *ACPI_CAST_PTR(u32, table->signature), signature)); goto unmap_and_exit; } @@ -592,10 +589,10 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) /* Will truncate 64-bit address to 32 bits, issue warning */ - ACPI_BIOS_WARNING((AE_INFO, - "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," - " truncating", - ACPI_FORMAT_UINT64(address64))); + ACPI_WARNING((AE_INFO, + "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," + " truncating", + ACPI_FORMAT_UINT64(address64))); } #endif return ((acpi_physical_address) (address64)); @@ -606,7 +603,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) * * FUNCTION: acpi_tb_parse_root_table * - * PARAMETERS: rsdp - Pointer to the RSDP + * PARAMETERS: Rsdp - Pointer to the RSDP * * RETURN: Status * @@ -697,9 +694,8 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); if (length < sizeof(struct acpi_table_header)) { - ACPI_BIOS_ERROR((AE_INFO, - "Invalid table length 0x%X in RSDT/XSDT", - length)); + ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", + length)); return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); } diff --git a/trunk/drivers/acpi/acpica/tbxface.c b/trunk/drivers/acpi/acpica/tbxface.c index ea4c6d52605a..abcc6412c244 100644 --- a/trunk/drivers/acpi/acpica/tbxface.c +++ b/trunk/drivers/acpi/acpica/tbxface.c @@ -1,6 +1,7 @@ /****************************************************************************** * - * Module Name: tbxface - ACPI table oriented external interfaces + * Module Name: tbxface - Public interfaces to the ACPI subsystem + * ACPI table oriented interfaces * *****************************************************************************/ @@ -50,6 +51,11 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME("tbxface") +/* Local prototypes */ +static acpi_status acpi_tb_load_namespace(void); + +static int no_auto_ssdt; + /******************************************************************************* * * FUNCTION: acpi_allocate_root_table @@ -59,10 +65,11 @@ ACPI_MODULE_NAME("tbxface") * * RETURN: Status * - * DESCRIPTION: Allocate a root table array. Used by iASL compiler and + * DESCRIPTION: Allocate a root table array. Used by i_aSL compiler and * acpi_initialize_tables. * ******************************************************************************/ + acpi_status acpi_allocate_root_table(u32 initial_table_count) { @@ -213,12 +220,54 @@ acpi_status acpi_reallocate_root_table(void) return_ACPI_STATUS(AE_OK); } +/******************************************************************************* + * + * FUNCTION: acpi_load_table + * + * PARAMETERS: table_ptr - pointer to a buffer containing the entire + * table to be loaded + * + * RETURN: Status + * + * DESCRIPTION: This function is called to load a table from the caller's + * buffer. The buffer must contain an entire ACPI Table including + * a valid header. The header fields will be verified, and if it + * is determined that the table is invalid, the call will fail. + * + ******************************************************************************/ +acpi_status acpi_load_table(struct acpi_table_header *table_ptr) +{ + acpi_status status; + u32 table_index; + struct acpi_table_desc table_desc; + + if (!table_ptr) + return AE_BAD_PARAMETER; + + ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); + table_desc.pointer = table_ptr; + table_desc.length = table_ptr->length; + table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; + + /* + * Install the new table into the local data structures + */ + status = acpi_tb_add_table(&table_desc, &table_index); + if (ACPI_FAILURE(status)) { + return status; + } + status = acpi_ns_load_table(table_index, acpi_gbl_root_node); + return status; +} + +ACPI_EXPORT_SYMBOL(acpi_load_table) + /******************************************************************************* * * FUNCTION: acpi_get_table_header * - * PARAMETERS: signature - ACPI signature of needed table - * instance - Which instance (for SSDTs) + * PARAMETERS: Signature - ACPI signature of needed table + * Instance - Which instance (for SSDTs) * out_table_header - The pointer to the table header to fill * * RETURN: Status and pointer to mapped table header @@ -333,8 +382,8 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id) * * FUNCTION: acpi_get_table_with_size * - * PARAMETERS: signature - ACPI signature of needed table - * instance - Which instance (for SSDTs) + * PARAMETERS: Signature - ACPI signature of needed table + * Instance - Which instance (for SSDTs) * out_table - Where the pointer to the table is returned * * RETURN: Status and pointer to table @@ -404,7 +453,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_table) * FUNCTION: acpi_get_table_by_index * * PARAMETERS: table_index - Table index - * table - Where the pointer to the table is returned + * Table - Where the pointer to the table is returned * * RETURN: Status and pointer to the table * @@ -453,13 +502,157 @@ acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) +/******************************************************************************* + * + * FUNCTION: acpi_tb_load_namespace + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in + * the RSDT/XSDT. + * + ******************************************************************************/ +static acpi_status acpi_tb_load_namespace(void) +{ + acpi_status status; + u32 i; + struct acpi_table_header *new_dsdt; + + ACPI_FUNCTION_TRACE(tb_load_namespace); + + (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); + + /* + * Load the namespace. The DSDT is required, but any SSDT and + * PSDT tables are optional. Verify the DSDT. + */ + if (!acpi_gbl_root_table_list.current_table_count || + !ACPI_COMPARE_NAME(& + (acpi_gbl_root_table_list. + tables[ACPI_TABLE_INDEX_DSDT].signature), + ACPI_SIG_DSDT) + || + ACPI_FAILURE(acpi_tb_verify_table + (&acpi_gbl_root_table_list. + tables[ACPI_TABLE_INDEX_DSDT]))) { + status = AE_NO_ACPI_TABLES; + goto unlock_and_exit; + } + + /* + * Save the DSDT pointer for simple access. This is the mapped memory + * address. We must take care here because the address of the .Tables + * array can change dynamically as tables are loaded at run-time. Note: + * .Pointer field is not validated until after call to acpi_tb_verify_table. + */ + acpi_gbl_DSDT = + acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer; + + /* + * Optionally copy the entire DSDT to local memory (instead of simply + * mapping it.) There are some BIOSs that corrupt or replace the original + * DSDT, creating the need for this option. Default is FALSE, do not copy + * the DSDT. + */ + if (acpi_gbl_copy_dsdt_locally) { + new_dsdt = acpi_tb_copy_dsdt(ACPI_TABLE_INDEX_DSDT); + if (new_dsdt) { + acpi_gbl_DSDT = new_dsdt; + } + } + + /* + * Save the original DSDT header for detection of table corruption + * and/or replacement of the DSDT from outside the OS. + */ + ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, + sizeof(struct acpi_table_header)); + + (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); + + /* Load and parse tables */ + + status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ + + (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); + for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { + if ((!ACPI_COMPARE_NAME + (&(acpi_gbl_root_table_list.tables[i].signature), + ACPI_SIG_SSDT) + && + !ACPI_COMPARE_NAME(& + (acpi_gbl_root_table_list.tables[i]. + signature), ACPI_SIG_PSDT)) + || + ACPI_FAILURE(acpi_tb_verify_table + (&acpi_gbl_root_table_list.tables[i]))) { + continue; + } + + if (no_auto_ssdt) { + printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); + continue; + } + + /* Ignore errors while loading tables, get as many as possible */ + + (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); + (void)acpi_ns_load_table(i, acpi_gbl_root_node); + (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); + + unlock_and_exit: + (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); + return_ACPI_STATUS(status); +} + +/******************************************************************************* + * + * FUNCTION: acpi_load_tables + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT + * + ******************************************************************************/ + +acpi_status acpi_load_tables(void) +{ + acpi_status status; + + ACPI_FUNCTION_TRACE(acpi_load_tables); + + /* Load the namespace from the tables */ + + status = acpi_tb_load_namespace(); + if (ACPI_FAILURE(status)) { + ACPI_EXCEPTION((AE_INFO, status, + "While loading namespace from ACPI tables")); + } + + return_ACPI_STATUS(status); +} + +ACPI_EXPORT_SYMBOL(acpi_load_tables) + /******************************************************************************* * * FUNCTION: acpi_install_table_handler * - * PARAMETERS: handler - Table event handler - * context - Value passed to the handler on each event + * PARAMETERS: Handler - Table event handler + * Context - Value passed to the handler on each event * * RETURN: Status * @@ -505,7 +698,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_table_handler) * * FUNCTION: acpi_remove_table_handler * - * PARAMETERS: handler - Table event handler that was installed + * PARAMETERS: Handler - Table event handler that was installed * previously. * * RETURN: Status @@ -541,3 +734,15 @@ acpi_status acpi_remove_table_handler(acpi_tbl_handler handler) } ACPI_EXPORT_SYMBOL(acpi_remove_table_handler) + + +static int __init acpi_no_auto_ssdt_setup(char *s) { + + printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); + + no_auto_ssdt = 1; + + return 1; +} + +__setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); diff --git a/trunk/drivers/acpi/acpica/tbxfload.c b/trunk/drivers/acpi/acpica/tbxfload.c deleted file mode 100644 index f87cc63e69a1..000000000000 --- a/trunk/drivers/acpi/acpica/tbxfload.c +++ /dev/null @@ -1,389 +0,0 @@ -/****************************************************************************** - * - * Module Name: tbxfload - Table load/unload external interfaces - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2012, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#include -#include -#include "accommon.h" -#include "acnamesp.h" -#include "actables.h" - -#define _COMPONENT ACPI_TABLES -ACPI_MODULE_NAME("tbxfload") - -/* Local prototypes */ -static acpi_status acpi_tb_load_namespace(void); - -static int no_auto_ssdt; - -/******************************************************************************* - * - * FUNCTION: acpi_load_tables - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT - * - ******************************************************************************/ - -acpi_status acpi_load_tables(void) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_load_tables); - - /* Load the namespace from the tables */ - - status = acpi_tb_load_namespace(); - if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "While loading namespace from ACPI tables")); - } - - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_load_tables) - -/******************************************************************************* - * - * FUNCTION: acpi_tb_load_namespace - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in - * the RSDT/XSDT. - * - ******************************************************************************/ -static acpi_status acpi_tb_load_namespace(void) -{ - acpi_status status; - u32 i; - struct acpi_table_header *new_dsdt; - - ACPI_FUNCTION_TRACE(tb_load_namespace); - - (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); - - /* - * Load the namespace. The DSDT is required, but any SSDT and - * PSDT tables are optional. Verify the DSDT. - */ - if (!acpi_gbl_root_table_list.current_table_count || - !ACPI_COMPARE_NAME(& - (acpi_gbl_root_table_list. - tables[ACPI_TABLE_INDEX_DSDT].signature), - ACPI_SIG_DSDT) - || - ACPI_FAILURE(acpi_tb_verify_table - (&acpi_gbl_root_table_list. - tables[ACPI_TABLE_INDEX_DSDT]))) { - status = AE_NO_ACPI_TABLES; - goto unlock_and_exit; - } - - /* - * Save the DSDT pointer for simple access. This is the mapped memory - * address. We must take care here because the address of the .Tables - * array can change dynamically as tables are loaded at run-time. Note: - * .Pointer field is not validated until after call to acpi_tb_verify_table. - */ - acpi_gbl_DSDT = - acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer; - - /* - * Optionally copy the entire DSDT to local memory (instead of simply - * mapping it.) There are some BIOSs that corrupt or replace the original - * DSDT, creating the need for this option. Default is FALSE, do not copy - * the DSDT. - */ - if (acpi_gbl_copy_dsdt_locally) { - new_dsdt = acpi_tb_copy_dsdt(ACPI_TABLE_INDEX_DSDT); - if (new_dsdt) { - acpi_gbl_DSDT = new_dsdt; - } - } - - /* - * Save the original DSDT header for detection of table corruption - * and/or replacement of the DSDT from outside the OS. - */ - ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, - sizeof(struct acpi_table_header)); - - (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); - - /* Load and parse tables */ - - status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ - - (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); - for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { - if ((!ACPI_COMPARE_NAME - (&(acpi_gbl_root_table_list.tables[i].signature), - ACPI_SIG_SSDT) - && - !ACPI_COMPARE_NAME(& - (acpi_gbl_root_table_list.tables[i]. - signature), ACPI_SIG_PSDT)) - || - ACPI_FAILURE(acpi_tb_verify_table - (&acpi_gbl_root_table_list.tables[i]))) { - continue; - } - - if (no_auto_ssdt) { - printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); - continue; - } - - /* Ignore errors while loading tables, get as many as possible */ - - (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); - (void)acpi_ns_load_table(i, acpi_gbl_root_node); - (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); - } - - ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); - - unlock_and_exit: - (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); - return_ACPI_STATUS(status); -} - -/******************************************************************************* - * - * FUNCTION: acpi_load_table - * - * PARAMETERS: table - Pointer to a buffer containing the ACPI - * table to be loaded. - * - * RETURN: Status - * - * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must - * be a valid ACPI table with a valid ACPI table header. - * Note1: Mainly intended to support hotplug addition of SSDTs. - * Note2: Does not copy the incoming table. User is reponsible - * to ensure that the table is not deleted or unmapped. - * - ******************************************************************************/ - -acpi_status acpi_load_table(struct acpi_table_header *table) -{ - acpi_status status; - struct acpi_table_desc table_desc; - u32 table_index; - - ACPI_FUNCTION_TRACE(acpi_load_table); - - /* Parameter validation */ - - if (!table) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* Init local table descriptor */ - - ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); - table_desc.address = ACPI_PTR_TO_PHYSADDR(table); - table_desc.pointer = table; - table_desc.length = table->length; - table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; - - /* Must acquire the interpreter lock during this operation */ - - status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Install the table and load it into the namespace */ - - ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:")); - status = acpi_tb_add_table(&table_desc, &table_index); - if (ACPI_FAILURE(status)) { - goto unlock_and_exit; - } - - status = acpi_ns_load_table(table_index, acpi_gbl_root_node); - - /* Invoke table handler if present */ - - if (acpi_gbl_table_handler) { - (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, - acpi_gbl_table_handler_context); - } - - unlock_and_exit: - (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_load_table) - -/******************************************************************************* - * - * FUNCTION: acpi_unload_parent_table - * - * PARAMETERS: object - Handle to any namespace object owned by - * the table to be unloaded - * - * RETURN: Status - * - * DESCRIPTION: Via any namespace object within an SSDT or OEMx table, unloads - * the table and deletes all namespace objects associated with - * that table. Unloading of the DSDT is not allowed. - * Note: Mainly intended to support hotplug removal of SSDTs. - * - ******************************************************************************/ -acpi_status acpi_unload_parent_table(acpi_handle object) -{ - struct acpi_namespace_node *node = - ACPI_CAST_PTR(struct acpi_namespace_node, object); - acpi_status status = AE_NOT_EXIST; - acpi_owner_id owner_id; - u32 i; - - ACPI_FUNCTION_TRACE(acpi_unload_parent_table); - - /* Parameter validation */ - - if (!object) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * The node owner_id is currently the same as the parent table ID. - * However, this could change in the future. - */ - owner_id = node->owner_id; - if (!owner_id) { - - /* owner_id==0 means DSDT is the owner. DSDT cannot be unloaded */ - - return_ACPI_STATUS(AE_TYPE); - } - - /* Must acquire the interpreter lock during this operation */ - - status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Find the table in the global table list */ - - for (i = 0; i < acpi_gbl_root_table_list.current_table_count; i++) { - if (owner_id != acpi_gbl_root_table_list.tables[i].owner_id) { - continue; - } - - /* - * Allow unload of SSDT and OEMx tables only. Do not allow unload - * of the DSDT. No other types of tables should get here, since - * only these types can contain AML and thus are the only types - * that can create namespace objects. - */ - if (ACPI_COMPARE_NAME - (acpi_gbl_root_table_list.tables[i].signature.ascii, - ACPI_SIG_DSDT)) { - status = AE_TYPE; - break; - } - - /* Ensure the table is actually loaded */ - - if (!acpi_tb_is_table_loaded(i)) { - status = AE_NOT_EXIST; - break; - } - - /* Invoke table handler if present */ - - if (acpi_gbl_table_handler) { - (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, - acpi_gbl_root_table_list. - tables[i].pointer, - acpi_gbl_table_handler_context); - } - - /* - * Delete all namespace objects owned by this table. Note that - * these objects can appear anywhere in the namespace by virtue - * of the AML "Scope" operator. Thus, we need to track ownership - * by an ID, not simply a position within the hierarchy. - */ - status = acpi_tb_delete_namespace_by_owner(i); - if (ACPI_FAILURE(status)) { - break; - } - - status = acpi_tb_release_owner_id(i); - acpi_tb_set_table_loaded_flag(i, FALSE); - break; - } - - (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_unload_parent_table) - -static int __init acpi_no_auto_ssdt_setup(char *s) { - - printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); - - no_auto_ssdt = 1; - - return 1; -} - -__setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); diff --git a/trunk/drivers/acpi/acpica/tbxfroot.c b/trunk/drivers/acpi/acpica/tbxfroot.c index 74e720800037..4258f647ca3d 100644 --- a/trunk/drivers/acpi/acpica/tbxfroot.c +++ b/trunk/drivers/acpi/acpica/tbxfroot.c @@ -57,7 +57,7 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp); * * FUNCTION: acpi_tb_validate_rsdp * - * PARAMETERS: rsdp - Pointer to unvalidated RSDP + * PARAMETERS: Rsdp - Pointer to unvalidated RSDP * * RETURN: Status * @@ -107,10 +107,10 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) * * RETURN: Status, RSDP physical address * - * DESCRIPTION: Search lower 1Mbyte of memory for the root system descriptor + * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor * pointer structure. If it is found, set *RSDP to point to it. * - * NOTE1: The RSDP must be either in the first 1K of the Extended + * NOTE1: The RSDP must be either in the first 1_k of the Extended * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) * Only a 32-bit physical address is necessary. * @@ -152,7 +152,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) if (physical_address > 0x400) { /* * 1b) Search EBDA paragraphs (EBDA is required to be a - * minimum of 1K length) + * minimum of 1_k length) */ table_ptr = acpi_os_map_memory((acpi_physical_address) physical_address, @@ -216,7 +216,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) /* A valid RSDP was not found */ - ACPI_BIOS_ERROR((AE_INFO, "A valid RSDP was not found")); + ACPI_ERROR((AE_INFO, "A valid RSDP was not found")); return_ACPI_STATUS(AE_NOT_FOUND); } @@ -225,7 +225,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) * FUNCTION: acpi_tb_scan_memory_for_rsdp * * PARAMETERS: start_address - Starting pointer for search - * length - Maximum length to search + * Length - Maximum length to search * * RETURN: Pointer to the RSDP if found, otherwise NULL. * diff --git a/trunk/drivers/acpi/acpica/utaddress.c b/trunk/drivers/acpi/acpica/utaddress.c index 64880306133d..67932aebe6dd 100644 --- a/trunk/drivers/acpi/acpica/utaddress.c +++ b/trunk/drivers/acpi/acpica/utaddress.c @@ -53,8 +53,8 @@ ACPI_MODULE_NAME("utaddress") * FUNCTION: acpi_ut_add_address_range * * PARAMETERS: space_id - Address space ID - * address - op_region start address - * length - op_region length + * Address - op_region start address + * Length - op_region length * region_node - op_region namespace node * * RETURN: Status @@ -186,9 +186,9 @@ acpi_ut_remove_address_range(acpi_adr_space_type space_id, * FUNCTION: acpi_ut_check_address_range * * PARAMETERS: space_id - Address space ID - * address - Start address - * length - Length of address range - * warn - TRUE if warning on overlap desired + * Address - Start address + * Length - Length of address range + * Warn - TRUE if warning on overlap desired * * RETURN: Count of the number of conflicts detected. Zero is always * returned for Space IDs other than Memory or I/O. diff --git a/trunk/drivers/acpi/acpica/utalloc.c b/trunk/drivers/acpi/acpica/utalloc.c index ed29d474095e..9982d2ea66fb 100644 --- a/trunk/drivers/acpi/acpica/utalloc.c +++ b/trunk/drivers/acpi/acpica/utalloc.c @@ -189,7 +189,7 @@ acpi_status acpi_ut_delete_caches(void) * * FUNCTION: acpi_ut_validate_buffer * - * PARAMETERS: buffer - Buffer descriptor to be validated + * PARAMETERS: Buffer - Buffer descriptor to be validated * * RETURN: Status * @@ -227,7 +227,7 @@ acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) * * FUNCTION: acpi_ut_initialize_buffer * - * PARAMETERS: buffer - Buffer to be validated + * PARAMETERS: Buffer - Buffer to be validated * required_length - Length needed * * RETURN: Status @@ -308,10 +308,10 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, * * FUNCTION: acpi_ut_allocate * - * PARAMETERS: size - Size of the allocation - * component - Component type of caller - * module - Source file name of caller - * line - Line number of caller + * 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. * @@ -352,10 +352,10 @@ void *acpi_ut_allocate(acpi_size size, * * FUNCTION: acpi_ut_allocate_zeroed * - * PARAMETERS: size - Size of the allocation - * component - Component type of caller - * module - Source file name of caller - * line - Line number of caller + * 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. * diff --git a/trunk/drivers/acpi/acpica/utcopy.c b/trunk/drivers/acpi/acpica/utcopy.c index 294692ae76e9..3317c0a406ee 100644 --- a/trunk/drivers/acpi/acpica/utcopy.c +++ b/trunk/drivers/acpi/acpica/utcopy.c @@ -317,7 +317,7 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type, * FUNCTION: acpi_ut_copy_ipackage_to_epackage * * PARAMETERS: internal_object - Pointer to the object we are returning - * buffer - Where the object is returned + * Buffer - Where the object is returned * space_used - Where the object length is returned * * RETURN: Status diff --git a/trunk/drivers/acpi/acpica/utdebug.c b/trunk/drivers/acpi/acpica/utdebug.c index e810894149ae..a0998a886318 100644 --- a/trunk/drivers/acpi/acpica/utdebug.c +++ b/trunk/drivers/acpi/acpica/utdebug.c @@ -145,7 +145,7 @@ static const char *acpi_ut_trim_function_name(const char *function_name) * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * format - Printf format field + * Format - Printf format field * ... - Optional printf arguments * * RETURN: None @@ -217,7 +217,7 @@ ACPI_EXPORT_SYMBOL(acpi_debug_print) * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * format - Printf format field + * Format - Printf format field * ... - Optional printf arguments * * RETURN: None @@ -286,7 +286,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace) * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * pointer - Pointer to display + * Pointer - Pointer to display * * RETURN: None * @@ -315,7 +315,7 @@ acpi_ut_trace_ptr(u32 line_number, * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * string - Additional string to display + * String - Additional string to display * * RETURN: None * @@ -346,7 +346,7 @@ acpi_ut_trace_str(u32 line_number, * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * integer - Integer to display + * Integer - Integer to display * * RETURN: None * @@ -408,7 +408,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_exit) * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * status - Exit status code + * Status - Exit status code * * RETURN: None * @@ -449,7 +449,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * value - Value to be printed with exit msg + * Value - Value to be printed with exit msg * * RETURN: None * @@ -481,7 +481,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID - * ptr - Pointer to display + * Ptr - Pointer to display * * RETURN: None * @@ -508,10 +508,10 @@ acpi_ut_ptr_exit(u32 line_number, * * FUNCTION: acpi_ut_dump_buffer * - * PARAMETERS: buffer - Buffer to dump - * count - Amount to dump, in bytes - * display - BYTE, WORD, DWORD, or QWORD display - * component_ID - Caller's component ID + * PARAMETERS: Buffer - Buffer to dump + * Count - Amount to dump, in bytes + * Display - BYTE, WORD, DWORD, or QWORD display + * component_iD - Caller's component ID * * RETURN: None * @@ -625,10 +625,10 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display) * * FUNCTION: acpi_ut_dump_buffer * - * PARAMETERS: buffer - Buffer to dump - * count - Amount to dump, in bytes - * display - BYTE, WORD, DWORD, or QWORD display - * component_ID - Caller's component ID + * PARAMETERS: Buffer - Buffer to dump + * Count - Amount to dump, in bytes + * Display - BYTE, WORD, DWORD, or QWORD display + * component_iD - Caller's component ID * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/utdecode.c b/trunk/drivers/acpi/acpica/utdecode.c index 60a158472d82..684849949bf3 100644 --- a/trunk/drivers/acpi/acpica/utdecode.c +++ b/trunk/drivers/acpi/acpica/utdecode.c @@ -49,6 +49,41 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME("utdecode") +/******************************************************************************* + * + * FUNCTION: acpi_format_exception + * + * PARAMETERS: Status - The acpi_status code to be formatted + * + * RETURN: A string containing the exception text. A valid pointer is + * always returned. + * + * DESCRIPTION: This function translates an ACPI exception into an ASCII string + * It is here instead of utxface.c so it is always present. + * + ******************************************************************************/ +const char *acpi_format_exception(acpi_status status) +{ + const char *exception = NULL; + + ACPI_FUNCTION_ENTRY(); + + exception = acpi_ut_validate_exception(status); + if (!exception) { + + /* Exception code was not recognized */ + + ACPI_ERROR((AE_INFO, + "Unknown exception code: 0x%8.8X", status)); + + exception = "UNKNOWN_STATUS_CODE"; + } + + return (ACPI_CAST_PTR(const char, exception)); +} + +ACPI_EXPORT_SYMBOL(acpi_format_exception) + /* * Properties of the ACPI Object Types, both internal and external. * The table is indexed by values of acpi_object_type @@ -91,8 +126,8 @@ const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES] = { * * FUNCTION: acpi_ut_hex_to_ascii_char * - * PARAMETERS: integer - Contains the hex digit - * position - bit position of the digit within the + * PARAMETERS: Integer - Contains the hex digit + * Position - bit position of the digit within the * integer (multiple of 4) * * RETURN: The converted Ascii character @@ -129,17 +164,16 @@ char acpi_ut_hex_to_ascii_char(u64 integer, u32 position) /* Region type decoding */ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { - "SystemMemory", /* 0x00 */ - "SystemIO", /* 0x01 */ - "PCI_Config", /* 0x02 */ - "EmbeddedControl", /* 0x03 */ - "SMBus", /* 0x04 */ - "SystemCMOS", /* 0x05 */ - "PCIBARTarget", /* 0x06 */ - "IPMI", /* 0x07 */ - "GeneralPurposeIo", /* 0x08 */ - "GenericSerialBus", /* 0x09 */ - "PCC" /* 0x0A */ + "SystemMemory", + "SystemIO", + "PCI_Config", + "EmbeddedControl", + "SMBus", + "SystemCMOS", + "PCIBARTarget", + "IPMI", + "GeneralPurposeIo", + "GenericSerialBus" }; char *acpi_ut_get_region_name(u8 space_id) @@ -194,7 +228,7 @@ char *acpi_ut_get_event_name(u32 event_id) * * FUNCTION: acpi_ut_get_type_name * - * PARAMETERS: type - An ACPI object type + * PARAMETERS: Type - An ACPI object type * * RETURN: Decoded ACPI object type name * @@ -272,7 +306,7 @@ char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) * * FUNCTION: acpi_ut_get_node_name * - * PARAMETERS: object - A namespace node + * PARAMETERS: Object - A namespace node * * RETURN: ASCII name of the node * @@ -317,7 +351,7 @@ char *acpi_ut_get_node_name(void *object) * * FUNCTION: acpi_ut_get_descriptor_name * - * PARAMETERS: object - An ACPI object + * PARAMETERS: Object - An ACPI object * * RETURN: Decoded name of the descriptor type * @@ -367,7 +401,7 @@ char *acpi_ut_get_descriptor_name(void *object) * * FUNCTION: acpi_ut_get_reference_name * - * PARAMETERS: object - An ACPI reference object + * PARAMETERS: Object - An ACPI reference object * * RETURN: Decoded name of the type of reference * @@ -498,7 +532,7 @@ const char *acpi_ut_get_notify_name(u32 notify_value) * * FUNCTION: acpi_ut_valid_object_type * - * PARAMETERS: type - Object type to be validated + * PARAMETERS: Type - Object type to be validated * * RETURN: TRUE if valid object type, FALSE otherwise * diff --git a/trunk/drivers/acpi/acpica/utdelete.c b/trunk/drivers/acpi/acpica/utdelete.c index 798105443d0f..2a6c3e183697 100644 --- a/trunk/drivers/acpi/acpica/utdelete.c +++ b/trunk/drivers/acpi/acpica/utdelete.c @@ -60,7 +60,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action); * * FUNCTION: acpi_ut_delete_internal_obj * - * PARAMETERS: object - Object to be deleted + * PARAMETERS: Object - Object to be deleted * * RETURN: None * @@ -152,7 +152,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: - /* Walk the address handler list for this object */ + /* Walk the notify handler list for this object */ handler_desc = object->common_notify.handler; while (handler_desc) { @@ -358,8 +358,8 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) * * FUNCTION: acpi_ut_update_ref_count * - * PARAMETERS: object - Object whose ref count is to be updated - * action - What to do + * PARAMETERS: Object - Object whose ref count is to be updated + * Action - What to do * * RETURN: New ref count * @@ -456,9 +456,9 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) * * FUNCTION: acpi_ut_update_object_reference * - * PARAMETERS: object - Increment ref count for this object + * PARAMETERS: Object - Increment ref count for this object * and all sub-objects - * action - Either REF_INCREMENT or REF_DECREMENT or + * Action - Either REF_INCREMENT or REF_DECREMENT or * REF_FORCE_DELETE * * RETURN: Status @@ -480,7 +480,6 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) acpi_status status = AE_OK; union acpi_generic_state *state_list = NULL; union acpi_operand_object *next_object = NULL; - union acpi_operand_object *prev_object; union acpi_generic_state *state; u32 i; @@ -506,21 +505,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) case ACPI_TYPE_POWER: case ACPI_TYPE_THERMAL: - /* - * Update the notify objects for these types (if present) - * Two lists, system and device notify handlers. - */ - for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { - prev_object = - object->common_notify.notify_list[i]; - while (prev_object) { - next_object = - prev_object->notify.next[i]; - acpi_ut_update_ref_count(prev_object, - action); - prev_object = next_object; - } - } + /* Update the notify objects for these types (if present) */ + + acpi_ut_update_ref_count(object->common_notify. + system_notify, action); + acpi_ut_update_ref_count(object->common_notify. + device_notify, action); break; case ACPI_TYPE_PACKAGE: @@ -640,7 +630,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) * * FUNCTION: acpi_ut_add_reference * - * PARAMETERS: object - Object whose reference count is to be + * PARAMETERS: Object - Object whose reference count is to be * incremented * * RETURN: None @@ -674,7 +664,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) * * FUNCTION: acpi_ut_remove_reference * - * PARAMETERS: object - Object whose ref count will be decremented + * PARAMETERS: Object - Object whose ref count will be decremented * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/uteval.c b/trunk/drivers/acpi/acpica/uteval.c index a9c65fbea5f4..479f32b33415 100644 --- a/trunk/drivers/acpi/acpica/uteval.c +++ b/trunk/drivers/acpi/acpica/uteval.c @@ -53,7 +53,7 @@ ACPI_MODULE_NAME("uteval") * FUNCTION: acpi_ut_evaluate_object * * PARAMETERS: prefix_node - Starting node - * path - Path to object from starting node + * Path - Path to object from starting node * expected_return_types - Bitmap of allowed return types * return_desc - Where a return value is stored * @@ -187,7 +187,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, * * PARAMETERS: object_name - Object name to be evaluated * device_node - Node for the device - * value - Where the value is returned + * Value - Where the value is returned * * RETURN: Status * @@ -229,7 +229,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, * FUNCTION: acpi_ut_execute_STA * * PARAMETERS: device_node - Node for the device - * flags - Where the status flags are returned + * Flags - Where the status flags are returned * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/utexcep.c b/trunk/drivers/acpi/acpica/utexcep.c deleted file mode 100644 index 23b98945f6b7..000000000000 --- a/trunk/drivers/acpi/acpica/utexcep.c +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * - * Module Name: utexcep - Exception code support - * - ******************************************************************************/ - -/* - * Copyright (C) 2000 - 2012, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#define ACPI_DEFINE_EXCEPTION_TABLE -#include -#include -#include "accommon.h" - -#define _COMPONENT ACPI_UTILITIES -ACPI_MODULE_NAME("utexcep") - -/******************************************************************************* - * - * FUNCTION: acpi_format_exception - * - * PARAMETERS: status - The acpi_status code to be formatted - * - * RETURN: A string containing the exception text. A valid pointer is - * always returned. - * - * DESCRIPTION: This function translates an ACPI exception into an ASCII - * string. Returns "unknown status" string for invalid codes. - * - ******************************************************************************/ -const char *acpi_format_exception(acpi_status status) -{ - const char *exception = NULL; - - ACPI_FUNCTION_ENTRY(); - - exception = acpi_ut_validate_exception(status); - if (!exception) { - - /* Exception code was not recognized */ - - ACPI_ERROR((AE_INFO, - "Unknown exception code: 0x%8.8X", status)); - - exception = "UNKNOWN_STATUS_CODE"; - } - - return (ACPI_CAST_PTR(const char, exception)); -} - -ACPI_EXPORT_SYMBOL(acpi_format_exception) - -/******************************************************************************* - * - * FUNCTION: acpi_ut_validate_exception - * - * PARAMETERS: status - The acpi_status code to be formatted - * - * RETURN: A string containing the exception text. NULL if exception is - * not valid. - * - * DESCRIPTION: This function validates and translates an ACPI exception into - * an ASCII string. - * - ******************************************************************************/ -const char *acpi_ut_validate_exception(acpi_status status) -{ - u32 sub_status; - const char *exception = NULL; - - ACPI_FUNCTION_ENTRY(); - - /* - * Status is composed of two parts, a "type" and an actual code - */ - sub_status = (status & ~AE_CODE_MASK); - - switch (status & AE_CODE_MASK) { - case AE_CODE_ENVIRONMENTAL: - - if (sub_status <= AE_CODE_ENV_MAX) { - exception = acpi_gbl_exception_names_env[sub_status]; - } - break; - - case AE_CODE_PROGRAMMER: - - if (sub_status <= AE_CODE_PGM_MAX) { - exception = acpi_gbl_exception_names_pgm[sub_status]; - } - break; - - case AE_CODE_ACPI_TABLES: - - if (sub_status <= AE_CODE_TBL_MAX) { - exception = acpi_gbl_exception_names_tbl[sub_status]; - } - break; - - case AE_CODE_AML: - - if (sub_status <= AE_CODE_AML_MAX) { - exception = acpi_gbl_exception_names_aml[sub_status]; - } - break; - - case AE_CODE_CONTROL: - - if (sub_status <= AE_CODE_CTRL_MAX) { - exception = acpi_gbl_exception_names_ctrl[sub_status]; - } - break; - - default: - break; - } - - return (ACPI_CAST_PTR(const char, exception)); -} diff --git a/trunk/drivers/acpi/acpica/utglobal.c b/trunk/drivers/acpi/acpica/utglobal.c index ed1893155f8b..90f53b42eca9 100644 --- a/trunk/drivers/acpi/acpica/utglobal.c +++ b/trunk/drivers/acpi/acpica/utglobal.c @@ -247,9 +247,8 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = * * RETURN: Status * - * DESCRIPTION: Initialize ACPICA globals. All globals that require specific - * initialization should be initialized here. This allows for - * a warm restart. + * DESCRIPTION: Init library globals. All globals that require specific + * initialization should be initialized here! * ******************************************************************************/ @@ -285,7 +284,7 @@ acpi_status acpi_ut_init_globals(void) acpi_gbl_owner_id_mask[i] = 0; } - /* Last owner_ID is never valid */ + /* Last owner_iD is never valid */ acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; @@ -305,8 +304,8 @@ acpi_status acpi_ut_init_globals(void) /* Global handlers */ - acpi_gbl_global_notify[0].handler = NULL; - acpi_gbl_global_notify[1].handler = NULL; + acpi_gbl_system_notify.handler = NULL; + acpi_gbl_device_notify.handler = NULL; acpi_gbl_exception_handler = NULL; acpi_gbl_init_handler = NULL; acpi_gbl_table_handler = NULL; diff --git a/trunk/drivers/acpi/acpica/utids.c b/trunk/drivers/acpi/acpica/utids.c index 5d84e1954575..c92eb1d93785 100644 --- a/trunk/drivers/acpi/acpica/utids.c +++ b/trunk/drivers/acpi/acpica/utids.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: utids - support for device Ids - HID, UID, CID + * Module Name: utids - support for device IDs - HID, UID, CID * *****************************************************************************/ diff --git a/trunk/drivers/acpi/acpica/utlock.c b/trunk/drivers/acpi/acpica/utlock.c index b1eb7f17e110..155fd786d0f2 100644 --- a/trunk/drivers/acpi/acpica/utlock.c +++ b/trunk/drivers/acpi/acpica/utlock.c @@ -52,7 +52,7 @@ ACPI_MODULE_NAME("utlock") * FUNCTION: acpi_ut_create_rw_lock * acpi_ut_delete_rw_lock * - * PARAMETERS: lock - Pointer to a valid RW lock + * PARAMETERS: Lock - Pointer to a valid RW lock * * RETURN: Status * @@ -89,7 +89,7 @@ void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock) * FUNCTION: acpi_ut_acquire_read_lock * acpi_ut_release_read_lock * - * PARAMETERS: lock - Pointer to a valid RW lock + * PARAMETERS: Lock - Pointer to a valid RW lock * * RETURN: Status * @@ -149,7 +149,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock) * FUNCTION: acpi_ut_acquire_write_lock * acpi_ut_release_write_lock * - * PARAMETERS: lock - Pointer to a valid RW lock + * PARAMETERS: Lock - Pointer to a valid RW lock * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/utmath.c b/trunk/drivers/acpi/acpica/utmath.c index d88a8aaab2a6..2491a552b0e6 100644 --- a/trunk/drivers/acpi/acpica/utmath.c +++ b/trunk/drivers/acpi/acpica/utmath.c @@ -73,8 +73,8 @@ typedef union uint64_overlay { * * FUNCTION: acpi_ut_short_divide * - * PARAMETERS: dividend - 64-bit dividend - * divisor - 32-bit divisor + * PARAMETERS: Dividend - 64-bit dividend + * Divisor - 32-bit divisor * out_quotient - Pointer to where the quotient is returned * out_remainder - Pointer to where the remainder is returned * diff --git a/trunk/drivers/acpi/acpica/utmisc.c b/trunk/drivers/acpi/acpica/utmisc.c index 33c6cf7ff467..86f19db74e05 100644 --- a/trunk/drivers/acpi/acpica/utmisc.c +++ b/trunk/drivers/acpi/acpica/utmisc.c @@ -50,41 +50,79 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME("utmisc") -#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP /******************************************************************************* * - * FUNCTION: ut_convert_backslashes + * FUNCTION: acpi_ut_validate_exception * - * PARAMETERS: pathname - File pathname string to be converted + * PARAMETERS: Status - The acpi_status code to be formatted * - * RETURN: Modifies the input Pathname + * RETURN: A string containing the exception text. NULL if exception is + * not valid. * - * DESCRIPTION: Convert all backslashes (0x5C) to forward slashes (0x2F) within - * the entire input file pathname string. + * DESCRIPTION: This function validates and translates an ACPI exception into + * an ASCII string. * ******************************************************************************/ -void ut_convert_backslashes(char *pathname) +const char *acpi_ut_validate_exception(acpi_status status) { + u32 sub_status; + const char *exception = NULL; - if (!pathname) { - return; - } + ACPI_FUNCTION_ENTRY(); + + /* + * Status is composed of two parts, a "type" and an actual code + */ + sub_status = (status & ~AE_CODE_MASK); + + switch (status & AE_CODE_MASK) { + case AE_CODE_ENVIRONMENTAL: + + if (sub_status <= AE_CODE_ENV_MAX) { + exception = acpi_gbl_exception_names_env[sub_status]; + } + break; + + case AE_CODE_PROGRAMMER: + + if (sub_status <= AE_CODE_PGM_MAX) { + exception = acpi_gbl_exception_names_pgm[sub_status]; + } + break; - while (*pathname) { - if (*pathname == '\\') { - *pathname = '/'; + case AE_CODE_ACPI_TABLES: + + if (sub_status <= AE_CODE_TBL_MAX) { + exception = acpi_gbl_exception_names_tbl[sub_status]; + } + break; + + case AE_CODE_AML: + + if (sub_status <= AE_CODE_AML_MAX) { + exception = acpi_gbl_exception_names_aml[sub_status]; + } + break; + + case AE_CODE_CONTROL: + + if (sub_status <= AE_CODE_CTRL_MAX) { + exception = acpi_gbl_exception_names_ctrl[sub_status]; } + break; - pathname++; + default: + break; } + + return (ACPI_CAST_PTR(const char, exception)); } -#endif /******************************************************************************* * * FUNCTION: acpi_ut_is_pci_root_bridge * - * PARAMETERS: id - The HID/CID in string format + * PARAMETERS: Id - The HID/CID in string format * * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge * @@ -112,7 +150,7 @@ u8 acpi_ut_is_pci_root_bridge(char *id) * * FUNCTION: acpi_ut_is_aml_table * - * PARAMETERS: table - An ACPI table + * PARAMETERS: Table - An ACPI table * * RETURN: TRUE if table contains executable AML; FALSE otherwise * @@ -246,7 +284,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) * * FUNCTION: acpi_ut_release_owner_id * - * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_ID + * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_iD * * RETURN: None. No error is returned because we are either exiting a * control method or unloading a table. Either way, we would @@ -269,7 +307,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) *owner_id_ptr = 0; - /* Zero is not a valid owner_ID */ + /* Zero is not a valid owner_iD */ if (owner_id == 0) { ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id)); @@ -343,7 +381,7 @@ void acpi_ut_strupr(char *src_string) * * FUNCTION: acpi_ut_print_string * - * PARAMETERS: string - Null terminated ASCII string + * PARAMETERS: String - Null terminated ASCII string * max_length - Maximum output length * * RETURN: None @@ -429,7 +467,7 @@ void acpi_ut_print_string(char *string, u8 max_length) * * FUNCTION: acpi_ut_dword_byte_swap * - * PARAMETERS: value - Value to be converted + * PARAMETERS: Value - Value to be converted * * RETURN: u32 integer with bytes swapped * @@ -499,9 +537,9 @@ void acpi_ut_set_integer_width(u8 revision) * * FUNCTION: acpi_ut_display_init_pathname * - * PARAMETERS: type - Object type of the node + * PARAMETERS: Type - Object type of the node * obj_handle - Handle whose pathname will be displayed - * path - Additional path string to be appended. + * Path - Additional path string to be appended. * (NULL if no extra path) * * RETURN: acpi_status @@ -566,8 +604,8 @@ acpi_ut_display_init_pathname(u8 type, * * FUNCTION: acpi_ut_valid_acpi_char * - * PARAMETERS: char - The character to be examined - * position - Byte position (0-3) + * PARAMETERS: Char - The character to be examined + * Position - Byte position (0-3) * * RETURN: TRUE if the character is valid, FALSE otherwise * @@ -602,7 +640,7 @@ u8 acpi_ut_valid_acpi_char(char character, u32 position) * * FUNCTION: acpi_ut_valid_acpi_name * - * PARAMETERS: name - The name to be examined + * PARAMETERS: Name - The name to be examined * * RETURN: TRUE if the name is valid, FALSE otherwise * @@ -633,7 +671,7 @@ u8 acpi_ut_valid_acpi_name(u32 name) * * FUNCTION: acpi_ut_repair_name * - * PARAMETERS: name - The ACPI name to be repaired + * PARAMETERS: Name - The ACPI name to be repaired * * RETURN: Repaired version of the name * @@ -667,8 +705,8 @@ acpi_name acpi_ut_repair_name(char *name) * * FUNCTION: acpi_ut_strtoul64 * - * PARAMETERS: string - Null terminated string - * base - Radix of the string: 16 or ACPI_ANY_BASE; + * PARAMETERS: String - Null terminated string + * Base - Radix of the string: 16 or ACPI_ANY_BASE; * ACPI_ANY_BASE means 'in behalf of to_integer' * ret_integer - Where the converted integer is returned * @@ -717,7 +755,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 * ret_integer) if (to_integer_op) { /* - * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. + * Base equal to ACPI_ANY_BASE means 'to_integer operation case'. * We need to determine if it is decimal or hexadecimal. */ if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { @@ -840,8 +878,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 * ret_integer) * * FUNCTION: acpi_ut_create_update_state_and_push * - * PARAMETERS: object - Object to be added to the new state - * action - Increment/Decrement + * PARAMETERS: Object - Object to be added to the new state + * Action - Increment/Decrement * state_list - List the state will be added to * * RETURN: Status @@ -881,7 +919,7 @@ acpi_ut_create_update_state_and_push(union acpi_operand_object *object, * PARAMETERS: source_object - The package to walk * target_object - Target object (if package is being copied) * walk_callback - Called once for each package element - * context - Passed to the callback function + * Context - Passed to the callback function * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/utmutex.c b/trunk/drivers/acpi/acpica/utmutex.c index 296baa676bc5..43174df33121 100644 --- a/trunk/drivers/acpi/acpica/utmutex.c +++ b/trunk/drivers/acpi/acpica/utmutex.c @@ -147,7 +147,7 @@ void acpi_ut_mutex_terminate(void) * * FUNCTION: acpi_ut_create_mutex * - * PARAMETERS: mutex_ID - ID of the mutex to be created + * PARAMETERS: mutex_iD - ID of the mutex to be created * * RETURN: Status * @@ -176,7 +176,7 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id) * * FUNCTION: acpi_ut_delete_mutex * - * PARAMETERS: mutex_ID - ID of the mutex to be deleted + * PARAMETERS: mutex_iD - ID of the mutex to be deleted * * RETURN: Status * @@ -199,7 +199,7 @@ static void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id) * * FUNCTION: acpi_ut_acquire_mutex * - * PARAMETERS: mutex_ID - ID of the mutex to be acquired + * PARAMETERS: mutex_iD - ID of the mutex to be acquired * * RETURN: Status * @@ -283,7 +283,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) * * FUNCTION: acpi_ut_release_mutex * - * PARAMETERS: mutex_ID - ID of the mutex to be released + * PARAMETERS: mutex_iD - ID of the mutex to be released * * RETURN: Status * diff --git a/trunk/drivers/acpi/acpica/utobject.c b/trunk/drivers/acpi/acpica/utobject.c index 655f0799a391..b112744fc9ae 100644 --- a/trunk/drivers/acpi/acpica/utobject.c +++ b/trunk/drivers/acpi/acpica/utobject.c @@ -69,7 +69,7 @@ acpi_ut_get_element_length(u8 object_type, * PARAMETERS: module_name - Source file name of caller * line_number - Line number of caller * component_id - Component type of caller - * type - ACPI Type of the new object + * Type - ACPI Type of the new object * * RETURN: A new internal object, null on failure * @@ -150,7 +150,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char * * FUNCTION: acpi_ut_create_package_object * - * PARAMETERS: count - Number of package elements + * PARAMETERS: Count - Number of package elements * * RETURN: Pointer to a new Package object, null on failure * @@ -323,11 +323,11 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size) * * FUNCTION: acpi_ut_valid_internal_object * - * PARAMETERS: object - Object to be validated + * PARAMETERS: Object - Object to be validated * * RETURN: TRUE if object is valid, FALSE otherwise * - * DESCRIPTION: Validate a pointer to be of type union acpi_operand_object + * DESCRIPTION: Validate a pointer to be a union acpi_operand_object * ******************************************************************************/ @@ -348,7 +348,7 @@ u8 acpi_ut_valid_internal_object(void *object) switch (ACPI_GET_DESCRIPTOR_TYPE(object)) { case ACPI_DESC_TYPE_OPERAND: - /* The object appears to be a valid union acpi_operand_object */ + /* The object appears to be a valid union acpi_operand_object */ return (TRUE); @@ -407,7 +407,7 @@ void *acpi_ut_allocate_object_desc_dbg(const char *module_name, * * FUNCTION: acpi_ut_delete_object_desc * - * PARAMETERS: object - An Acpi internal object to be deleted + * PARAMETERS: Object - An Acpi internal object to be deleted * * RETURN: None. * @@ -419,7 +419,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object) { ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object); - /* Object must be a union acpi_operand_object */ + /* Object must be a union acpi_operand_object */ if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) { ACPI_ERROR((AE_INFO, diff --git a/trunk/drivers/acpi/acpica/utosi.c b/trunk/drivers/acpi/acpica/utosi.c index 34ef0bd7e4b4..2360cf70c18c 100644 --- a/trunk/drivers/acpi/acpica/utosi.c +++ b/trunk/drivers/acpi/acpica/utosi.c @@ -68,7 +68,7 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = { {"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ {"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ {"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ - {"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows vista - Added 03/2006 */ + {"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */ {"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ {"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ {"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ diff --git a/trunk/drivers/acpi/acpica/utresrc.c b/trunk/drivers/acpi/acpica/utresrc.c index e38bef4980bc..9d441ea70305 100644 --- a/trunk/drivers/acpi/acpica/utresrc.c +++ b/trunk/drivers/acpi/acpica/utresrc.c @@ -356,13 +356,13 @@ static const u8 acpi_gbl_resource_types[] = { ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */ ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */ ACPI_FIXED_LENGTH, /* 08 IO */ - ACPI_FIXED_LENGTH, /* 09 fixed_IO */ - ACPI_FIXED_LENGTH, /* 0A fixed_DMA */ + ACPI_FIXED_LENGTH, /* 09 fixed_iO */ + ACPI_FIXED_LENGTH, /* 0_a fixed_dMA */ 0, 0, 0, - ACPI_VARIABLE_LENGTH, /* 0E vendor_short */ - ACPI_FIXED_LENGTH, /* 0F end_tag */ + ACPI_VARIABLE_LENGTH, /* 0_e vendor_short */ + ACPI_FIXED_LENGTH, /* 0_f end_tag */ /* Large descriptors */ @@ -375,16 +375,16 @@ static const u8 acpi_gbl_resource_types[] = { ACPI_FIXED_LENGTH, /* 06 memory32_fixed */ ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ ACPI_VARIABLE_LENGTH, /* 08 Word* address */ - ACPI_VARIABLE_LENGTH, /* 09 extended_IRQ */ - ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ - ACPI_FIXED_LENGTH, /* 0B Extended* address */ - ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ + ACPI_VARIABLE_LENGTH, /* 09 extended_iRQ */ + ACPI_VARIABLE_LENGTH, /* 0_a Qword* address */ + ACPI_FIXED_LENGTH, /* 0_b Extended* address */ + ACPI_VARIABLE_LENGTH, /* 0_c Gpio* */ 0, - ACPI_VARIABLE_LENGTH /* 0E *serial_bus */ + ACPI_VARIABLE_LENGTH /* 0_e *serial_bus */ }; /* - * For the iASL compiler/disassembler, we don't want any error messages + * For the i_aSL compiler/disassembler, we don't want any error messages * because the disassembler uses the resource validation code to determine * if Buffer objects are actually Resource Templates. */ @@ -398,11 +398,11 @@ static const u8 acpi_gbl_resource_types[] = { * * FUNCTION: acpi_ut_walk_aml_resources * - * PARAMETERS: aml - Pointer to the raw AML resource template + * PARAMETERS: Aml - Pointer to the raw AML resource template * aml_length - Length of the entire template * user_function - Called once for each descriptor found. If * NULL, a pointer to the end_tag is returned - * context - Passed to user_function + * Context - Passed to user_function * * RETURN: Status * @@ -513,7 +513,7 @@ acpi_ut_walk_aml_resources(u8 * aml, * * FUNCTION: acpi_ut_validate_resource * - * PARAMETERS: aml - Pointer to the raw AML resource descriptor + * PARAMETERS: Aml - Pointer to the raw AML resource descriptor * return_index - Where the resource index is returned. NULL * if the index is not required. * @@ -664,7 +664,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index) * * FUNCTION: acpi_ut_get_resource_type * - * PARAMETERS: aml - Pointer to the raw AML resource descriptor + * PARAMETERS: Aml - Pointer to the raw AML resource descriptor * * RETURN: The Resource Type with no extraneous bits (except the * Large/Small descriptor bit -- this is left alone) @@ -698,7 +698,7 @@ u8 acpi_ut_get_resource_type(void *aml) * * FUNCTION: acpi_ut_get_resource_length * - * PARAMETERS: aml - Pointer to the raw AML resource descriptor + * PARAMETERS: Aml - Pointer to the raw AML resource descriptor * * RETURN: Byte Length * @@ -738,7 +738,7 @@ u16 acpi_ut_get_resource_length(void *aml) * * FUNCTION: acpi_ut_get_resource_header_length * - * PARAMETERS: aml - Pointer to the raw AML resource descriptor + * PARAMETERS: Aml - Pointer to the raw AML resource descriptor * * RETURN: Length of the AML header (depends on large/small descriptor) * @@ -763,7 +763,7 @@ u8 acpi_ut_get_resource_header_length(void *aml) * * FUNCTION: acpi_ut_get_descriptor_length * - * PARAMETERS: aml - Pointer to the raw AML resource descriptor + * PARAMETERS: Aml - Pointer to the raw AML resource descriptor * * RETURN: Byte length * diff --git a/trunk/drivers/acpi/acpica/utstate.c b/trunk/drivers/acpi/acpica/utstate.c index a1c988260073..4267477c2797 100644 --- a/trunk/drivers/acpi/acpica/utstate.c +++ b/trunk/drivers/acpi/acpica/utstate.c @@ -51,8 +51,8 @@ ACPI_MODULE_NAME("utstate") * * FUNCTION: acpi_ut_create_pkg_state_and_push * - * PARAMETERS: object - Object to be added to the new state - * action - Increment/Decrement + * PARAMETERS: Object - Object to be added to the new state + * Action - Increment/Decrement * state_list - List the state will be added to * * RETURN: Status @@ -85,7 +85,7 @@ acpi_ut_create_pkg_state_and_push(void *internal_object, * FUNCTION: acpi_ut_push_generic_state * * PARAMETERS: list_head - Head of the state stack - * state - State object to push + * State - State object to push * * RETURN: None * @@ -214,8 +214,8 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) * * FUNCTION: acpi_ut_create_update_state * - * PARAMETERS: object - Initial Object to be installed in the state - * action - Update action to be performed + * PARAMETERS: Object - Initial Object to be installed in the state + * Action - Update action to be performed * * RETURN: New state object, null on failure * @@ -252,8 +252,8 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object * * FUNCTION: acpi_ut_create_pkg_state * - * PARAMETERS: object - Initial Object to be installed in the state - * action - Update action to be performed + * PARAMETERS: Object - Initial Object to be installed in the state + * Action - Update action to be performed * * RETURN: New state object, null on failure * @@ -325,7 +325,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) * * FUNCTION: acpi_ut_delete_generic_state * - * PARAMETERS: state - The state object to be deleted + * PARAMETERS: State - The state object to be deleted * * RETURN: None * diff --git a/trunk/drivers/acpi/acpica/utxface.c b/trunk/drivers/acpi/acpica/utxface.c index 534179f1177b..afa94f51ff0b 100644 --- a/trunk/drivers/acpi/acpica/utxface.c +++ b/trunk/drivers/acpi/acpica/utxface.c @@ -131,7 +131,7 @@ acpi_status __init acpi_initialize_subsystem(void) * * FUNCTION: acpi_enable_subsystem * - * PARAMETERS: flags - Init/enable Options + * PARAMETERS: Flags - Init/enable Options * * RETURN: Status * @@ -234,7 +234,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_subsystem) * * FUNCTION: acpi_initialize_objects * - * PARAMETERS: flags - Init/enable Options + * PARAMETERS: Flags - Init/enable Options * * RETURN: Status * @@ -409,7 +409,7 @@ ACPI_EXPORT_SYMBOL(acpi_subsystem_status) * PARAMETERS: out_buffer - A buffer to receive the resources for the * device * - * RETURN: status - the status of the call + * RETURN: Status - the status of the call * * DESCRIPTION: This function is called to get information about the current * state of the ACPI subsystem. It will return system information @@ -480,8 +480,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_system_info) * * FUNCTION: acpi_install_initialization_handler * - * PARAMETERS: handler - Callback procedure - * function - Not (currently) used, see below + * PARAMETERS: Handler - Callback procedure + * Function - Not (currently) used, see below * * RETURN: Status * @@ -618,7 +618,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_interface) * * FUNCTION: acpi_install_interface_handler * - * PARAMETERS: handler - The _OSI interface handler to install + * PARAMETERS: Handler - The _OSI interface handler to install * NULL means "remove existing handler" * * RETURN: Status @@ -651,9 +651,9 @@ ACPI_EXPORT_SYMBOL(acpi_install_interface_handler) * FUNCTION: acpi_check_address_range * * PARAMETERS: space_id - Address space ID - * address - Start address - * length - Length - * warn - TRUE if warning on overlap desired + * Address - Start address + * Length - Length + * Warn - TRUE if warning on overlap desired * * RETURN: Count of the number of conflicts detected. * diff --git a/trunk/drivers/acpi/acpica/utxferror.c b/trunk/drivers/acpi/acpica/utxferror.c index 6d63cc39b9ae..52b568af1819 100644 --- a/trunk/drivers/acpi/acpica/utxferror.c +++ b/trunk/drivers/acpi/acpica/utxferror.c @@ -53,7 +53,7 @@ ACPI_MODULE_NAME("utxferror") * This module is used for the in-kernel ACPICA as well as the ACPICA * tools/applications. * - * For the iASL compiler case, the output is redirected to stderr so that + * For the i_aSL compiler case, the output is redirected to stderr so that * any of the various ACPI errors and warnings do not appear in the output * files, for either the compiler or disassembler portions of the tool. */ @@ -70,7 +70,7 @@ extern FILE *acpi_gbl_output_file; #else /* - * non-iASL case - no redirection, nothing to do + * non-i_aSL case - no redirection, nothing to do */ #define ACPI_MSG_REDIRECT_BEGIN #define ACPI_MSG_REDIRECT_END @@ -82,8 +82,6 @@ extern FILE *acpi_gbl_output_file; #define ACPI_MSG_EXCEPTION "ACPI Exception: " #define ACPI_MSG_WARNING "ACPI Warning: " #define ACPI_MSG_INFO "ACPI: " -#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Bug: Error: " -#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Bug: Warning: " /* * Common message suffix */ @@ -95,7 +93,7 @@ extern FILE *acpi_gbl_output_file; * * PARAMETERS: module_name - Caller's module name (for error output) * line_number - Caller's line number (for error output) - * format - Printf format string + additional args + * Format - Printf format string + additional args * * RETURN: None * @@ -126,8 +124,8 @@ ACPI_EXPORT_SYMBOL(acpi_error) * * PARAMETERS: module_name - Caller's module name (for error output) * line_number - Caller's line number (for error output) - * status - Status to be formatted - * format - Printf format string + additional args + * Status - Status to be formatted + * Format - Printf format string + additional args * * RETURN: None * @@ -161,7 +159,7 @@ ACPI_EXPORT_SYMBOL(acpi_exception) * * PARAMETERS: module_name - Caller's module name (for error output) * line_number - Caller's line number (for error output) - * format - Printf format string + additional args + * Format - Printf format string + additional args * * RETURN: None * @@ -192,7 +190,7 @@ ACPI_EXPORT_SYMBOL(acpi_warning) * * PARAMETERS: module_name - Caller's module name (for error output) * line_number - Caller's line number (for error output) - * format - Printf format string + additional args + * Format - Printf format string + additional args * * RETURN: None * @@ -220,72 +218,6 @@ acpi_info(const char *module_name, u32 line_number, const char *format, ...) ACPI_EXPORT_SYMBOL(acpi_info) -/******************************************************************************* - * - * FUNCTION: acpi_bios_error - * - * PARAMETERS: module_name - Caller's module name (for error output) - * line_number - Caller's line number (for error output) - * format - Printf format string + additional args - * - * RETURN: None - * - * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version - * info - * - ******************************************************************************/ -void ACPI_INTERNAL_VAR_XFACE -acpi_bios_error(const char *module_name, - u32 line_number, const char *format, ...) -{ - va_list arg_list; - - ACPI_MSG_REDIRECT_BEGIN; - acpi_os_printf(ACPI_MSG_BIOS_ERROR); - - va_start(arg_list, format); - acpi_os_vprintf(format, arg_list); - ACPI_MSG_SUFFIX; - va_end(arg_list); - - ACPI_MSG_REDIRECT_END; -} - -ACPI_EXPORT_SYMBOL(acpi_bios_error) - -/******************************************************************************* - * - * FUNCTION: acpi_bios_warning - * - * PARAMETERS: module_name - Caller's module name (for error output) - * line_number - Caller's line number (for error output) - * format - Printf format string + additional args - * - * RETURN: None - * - * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version - * info - * - ******************************************************************************/ -void ACPI_INTERNAL_VAR_XFACE -acpi_bios_warning(const char *module_name, - u32 line_number, const char *format, ...) -{ - va_list arg_list; - - ACPI_MSG_REDIRECT_BEGIN; - acpi_os_printf(ACPI_MSG_BIOS_WARNING); - - va_start(arg_list, format); - acpi_os_vprintf(format, arg_list); - ACPI_MSG_SUFFIX; - va_end(arg_list); - - ACPI_MSG_REDIRECT_END; -} - -ACPI_EXPORT_SYMBOL(acpi_bios_warning) - /* * The remainder of this module contains internal error functions that may * be configured out. @@ -339,9 +271,9 @@ acpi_ut_predefined_warning(const char *module_name, * * PARAMETERS: module_name - Caller's module name (for error output) * line_number - Caller's line number (for error output) - * pathname - Full pathname to the node + * Pathname - Full pathname to the node * node_flags - From Namespace node for the method/object - * format - Printf format string + additional args + * Format - Printf format string + additional args * * RETURN: None * @@ -441,9 +373,9 @@ acpi_ut_namespace_error(const char *module_name, * * PARAMETERS: module_name - Caller's module name (for error output) * line_number - Caller's line number (for error output) - * message - Error message to use on failure + * Message - Error message to use on failure * prefix_node - Prefix relative to the path - * path - Path to the node (optional) + * Path - Path to the node (optional) * method_status - Execution status * * RETURN: None diff --git a/trunk/drivers/acpi/acpica/utxfmutex.c b/trunk/drivers/acpi/acpica/utxfmutex.c index 0a40a851b354..1427d191d15a 100644 --- a/trunk/drivers/acpi/acpica/utxfmutex.c +++ b/trunk/drivers/acpi/acpica/utxfmutex.c @@ -58,8 +58,8 @@ acpi_ut_get_mutex_object(acpi_handle handle, * * FUNCTION: acpi_ut_get_mutex_object * - * PARAMETERS: handle - Mutex or prefix handle (optional) - * pathname - Mutex pathname (optional) + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) * ret_obj - Where the mutex object is returned * * RETURN: Status @@ -118,9 +118,9 @@ acpi_ut_get_mutex_object(acpi_handle handle, * * FUNCTION: acpi_acquire_mutex * - * PARAMETERS: handle - Mutex or prefix handle (optional) - * pathname - Mutex pathname (optional) - * timeout - Max time to wait for the lock (millisec) + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * Timeout - Max time to wait for the lock (millisec) * * RETURN: Status * @@ -155,8 +155,8 @@ acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout) * * FUNCTION: acpi_release_mutex * - * PARAMETERS: handle - Mutex or prefix handle (optional) - * pathname - Mutex pathname (optional) + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) * * RETURN: Status * diff --git a/trunk/drivers/acpi/apei/apei-base.c b/trunk/drivers/acpi/apei/apei-base.c index 00a783661d0b..6686b1eaf13e 100644 --- a/trunk/drivers/acpi/apei/apei-base.c +++ b/trunk/drivers/acpi/apei/apei-base.c @@ -586,11 +586,6 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr, } *access_bit_width = 1UL << (access_size_code + 2); - /* Fixup common BIOS bug */ - if (bit_width == 32 && bit_offset == 0 && (*paddr & 0x03) == 0 && - *access_bit_width < 32) - *access_bit_width = 32; - if ((bit_width + bit_offset) > *access_bit_width) { pr_warning(FW_BUG APEI_PFX "Invalid bit width + offset in GAR [0x%llx/%u/%u/%u/%u]\n", diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index 5662d64e6733..7dd3f9fb9f3f 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -250,13 +250,6 @@ static int acpi_battery_get_property(struct power_supply *psy, else val->intval = battery->capacity_now * 1000; break; - case POWER_SUPPLY_PROP_CAPACITY: - if (battery->capacity_now && battery->full_charge_capacity) - val->intval = battery->capacity_now * 100/ - battery->full_charge_capacity; - else - val->intval = 0; - break; case POWER_SUPPLY_PROP_MODEL_NAME: val->strval = battery->model_number; break; @@ -283,7 +276,6 @@ static enum power_supply_property charge_battery_props[] = { POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, POWER_SUPPLY_PROP_CHARGE_FULL, POWER_SUPPLY_PROP_CHARGE_NOW, - POWER_SUPPLY_PROP_CAPACITY, POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_SERIAL_NUMBER, @@ -300,7 +292,6 @@ static enum power_supply_property energy_battery_props[] = { POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, POWER_SUPPLY_PROP_ENERGY_FULL, POWER_SUPPLY_PROP_ENERGY_NOW, - POWER_SUPPLY_PROP_CAPACITY, POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_SERIAL_NUMBER, diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c index 9628652e080c..adceafda9c17 100644 --- a/trunk/drivers/acpi/bus.c +++ b/trunk/drivers/acpi/bus.c @@ -574,10 +574,6 @@ static void acpi_bus_osc_support(void) capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PPC_OST_SUPPORT; #endif -#ifdef ACPI_HOTPLUG_OST - capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_HOTPLUG_OST_SUPPORT; -#endif - if (!ghes_disable) capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_APEI_SUPPORT; if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) diff --git a/trunk/drivers/acpi/container.c b/trunk/drivers/acpi/container.c index 1f9f7d7d7bc5..45cd03b4630e 100644 --- a/trunk/drivers/acpi/container.c +++ b/trunk/drivers/acpi/container.c @@ -158,7 +158,9 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) int result; int present; acpi_status status; - u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ + + + present = is_device_present(handle); switch (type) { case ACPI_NOTIFY_BUS_CHECK: @@ -167,47 +169,32 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) printk(KERN_WARNING "Container driver received %s event\n", (type == ACPI_NOTIFY_BUS_CHECK) ? "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); - - present = is_device_present(handle); status = acpi_bus_get_device(handle, &device); - if (!present) { + if (present) { + if (ACPI_FAILURE(status) || !device) { + result = container_device_add(&device, handle); + if (!result) + kobject_uevent(&device->dev.kobj, + KOBJ_ONLINE); + else + printk(KERN_WARNING + "Failed to add container\n"); + } + } else { if (ACPI_SUCCESS(status)) { /* device exist and this is a remove request */ - device->flags.eject_pending = 1; kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); - return; } - break; - } - - if (!ACPI_FAILURE(status) || device) - break; - - result = container_device_add(&device, handle); - if (result) { - printk(KERN_WARNING "Failed to add container\n"); - break; } - - kobject_uevent(&device->dev.kobj, KOBJ_ONLINE); - ost_code = ACPI_OST_SC_SUCCESS; break; - case ACPI_NOTIFY_EJECT_REQUEST: if (!acpi_bus_get_device(handle, &device) && device) { - device->flags.eject_pending = 1; kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); - return; } break; - default: - /* non-hotplug event; possibly handled by other handler */ - return; + break; } - - /* Inform firmware that the hotplug operation has completed */ - (void) acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL); return; } diff --git a/trunk/drivers/acpi/osl.c b/trunk/drivers/acpi/osl.c index 9eaf708f5885..c3881b2eb8b2 100644 --- a/trunk/drivers/acpi/osl.c +++ b/trunk/drivers/acpi/osl.c @@ -891,7 +891,7 @@ static void acpi_os_execute_deferred(struct work_struct *work) struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); if (dpc->wait) - acpi_os_wait_events_complete(); + acpi_os_wait_events_complete(NULL); dpc->function(dpc->context); kfree(dpc); @@ -987,7 +987,7 @@ acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function, return __acpi_os_execute(0, function, context, 1); } -void acpi_os_wait_events_complete(void) +void acpi_os_wait_events_complete(void *context) { flush_workqueue(kacpid_wq); flush_workqueue(kacpi_notify_wq); diff --git a/trunk/drivers/acpi/processor_driver.c b/trunk/drivers/acpi/processor_driver.c index 971c45474703..0734086537b8 100644 --- a/trunk/drivers/acpi/processor_driver.c +++ b/trunk/drivers/acpi/processor_driver.c @@ -701,9 +701,9 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, { struct acpi_processor *pr; struct acpi_device *device = NULL; - u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ int result; + switch (event) { case ACPI_NOTIFY_BUS_CHECK: case ACPI_NOTIFY_DEVICE_CHECK: @@ -715,18 +715,14 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, if (!is_processor_present(handle)) break; - if (!acpi_bus_get_device(handle, &device)) - break; - - result = acpi_processor_device_add(handle, &device); - if (result) { - printk(KERN_ERR PREFIX "Unable to add the device\n"); + if (acpi_bus_get_device(handle, &device)) { + result = acpi_processor_device_add(handle, &device); + if (result) + printk(KERN_ERR PREFIX + "Unable to add the device\n"); break; } - - ost_code = ACPI_OST_SC_SUCCESS; break; - case ACPI_NOTIFY_EJECT_REQUEST: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "received ACPI_NOTIFY_EJECT_REQUEST\n")); @@ -740,23 +736,15 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, if (!pr) { printk(KERN_ERR PREFIX "Driver data is NULL, dropping EJECT\n"); - break; + return; } - - /* REVISIT: update when eject is supported */ - ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; break; - default: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unsupported event [0x%x]\n", event)); - - /* non-hotplug event; possibly handled by other handler */ - return; + break; } - /* Inform firmware that the hotplug operation has completed */ - (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); return; } diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 9837c9c4f009..47a8caa89dbe 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -313,16 +313,16 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; /* determine latencies from FADT */ - pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.c2_latency; - pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.c3_latency; + pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.C2latency; + pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.C3latency; /* * FADT specified C2 latency must be less than or equal to * 100 microseconds. */ - if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { + if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency)); + "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency)); /* invalidate C2 */ pr->power.states[ACPI_STATE_C2].address = 0; } @@ -331,9 +331,9 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) * FADT supplied C3 latency must be less than or equal to * 1000 microseconds. */ - if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { + if (acpi_gbl_FADT.C3latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency)); + "C3 latency too large [%d]\n", acpi_gbl_FADT.C3latency)); /* invalidate C3 */ pr->power.states[ACPI_STATE_C3].address = 0; } diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index 148556a8f0f2..c8a1f3b68110 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -83,29 +83,19 @@ acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, cha } static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); -/** - * acpi_bus_hot_remove_device: hot-remove a device and its children - * @context: struct acpi_eject_event pointer (freed in this func) - * - * Hot-remove a device and its children. This function frees up the - * memory space passed by arg context, so that the caller may call - * this function asynchronously through acpi_os_hotplug_execute(). - */ -void acpi_bus_hot_remove_device(void *context) +static void acpi_bus_hot_remove_device(void *context) { - struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context; struct acpi_device *device; - acpi_handle handle = ej_event->handle; + acpi_handle handle = context; struct acpi_object_list arg_list; union acpi_object arg; acpi_status status = AE_OK; - u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ if (acpi_bus_get_device(handle, &device)) - goto err_out; + return; if (!device) - goto err_out; + return; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Hot-removing device %s...\n", dev_name(&device->dev))); @@ -113,7 +103,7 @@ void acpi_bus_hot_remove_device(void *context) if (acpi_bus_trim(device, 1)) { printk(KERN_ERR PREFIX "Removing device failed\n"); - goto err_out; + return; } /* power off device */ @@ -139,21 +129,10 @@ void acpi_bus_hot_remove_device(void *context) * TBD: _EJD support. */ status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); - if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) - printk(KERN_WARNING PREFIX - "Eject device failed\n"); - goto err_out; - } - - kfree(context); - return; + if (ACPI_FAILURE(status)) + printk(KERN_WARNING PREFIX + "Eject device failed\n"); -err_out: - /* Inform firmware the hot-remove operation has completed w/ error */ - (void) acpi_evaluate_hotplug_ost(handle, - ej_event->event, ost_code, NULL); - kfree(context); return; } @@ -165,7 +144,6 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, acpi_status status; acpi_object_type type = 0; struct acpi_device *acpi_device = to_acpi_device(d); - struct acpi_eject_event *ej_event; if ((!count) || (buf[0] != '1')) { return -EINVAL; @@ -182,25 +160,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, goto err; } - ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); - if (!ej_event) { - ret = -ENOMEM; - goto err; - } - - ej_event->handle = acpi_device->handle; - if (acpi_device->flags.eject_pending) { - /* event originated from ACPI eject notification */ - ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; - acpi_device->flags.eject_pending = 0; - } else { - /* event originated from user */ - ej_event->event = ACPI_OST_EC_OSPM_EJECT; - (void) acpi_evaluate_hotplug_ost(ej_event->handle, - ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); - } - - acpi_os_hotplug_execute(acpi_bus_hot_remove_device, (void *)ej_event); + acpi_os_hotplug_execute(acpi_bus_hot_remove_device, acpi_device->handle); err: return ret; } diff --git a/trunk/drivers/acpi/sleep.c b/trunk/drivers/acpi/sleep.c index bd35e3c5e530..dca8074b6704 100644 --- a/trunk/drivers/acpi/sleep.c +++ b/trunk/drivers/acpi/sleep.c @@ -28,8 +28,35 @@ #include "internal.h" #include "sleep.h" +u8 wake_sleep_flags = ACPI_NO_OPTIONAL_METHODS; +static unsigned int gts, bfs; +static int set_param_wake_flag(const char *val, struct kernel_param *kp) +{ + int ret = param_set_int(val, kp); + + if (ret) + return ret; + + if (kp->arg == (const char *)>s) { + if (gts) + wake_sleep_flags |= ACPI_EXECUTE_GTS; + else + wake_sleep_flags &= ~ACPI_EXECUTE_GTS; + } + if (kp->arg == (const char *)&bfs) { + if (bfs) + wake_sleep_flags |= ACPI_EXECUTE_BFS; + else + wake_sleep_flags &= ~ACPI_EXECUTE_BFS; + } + return ret; +} +module_param_call(gts, set_param_wake_flag, param_get_int, >s, 0644); +module_param_call(bfs, set_param_wake_flag, param_get_int, &bfs, 0644); +MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); +MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); + static u8 sleep_states[ACPI_S_STATE_COUNT]; -static bool pwr_btn_event_pending; static void acpi_sleep_tts_switch(u32 acpi_state) { @@ -82,6 +109,7 @@ static int acpi_sleep_prepare(u32 acpi_state) #ifdef CONFIG_ACPI_SLEEP static u32 acpi_target_sleep_state = ACPI_STATE_S0; +static bool pwr_btn_event_pending; /* * The ACPI specification wants us to save NVS memory regions during hibernation @@ -115,7 +143,7 @@ void __init acpi_old_suspend_ordering(void) static int acpi_pm_freeze(void) { acpi_disable_all_gpes(); - acpi_os_wait_events_complete(); + acpi_os_wait_events_complete(NULL); acpi_ec_block_transactions(); return 0; } @@ -277,7 +305,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) switch (acpi_state) { case ACPI_STATE_S1: barrier(); - status = acpi_enter_sleep_state(acpi_state); + status = acpi_enter_sleep_state(acpi_state, wake_sleep_flags); break; case ACPI_STATE_S3: @@ -291,8 +319,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state) /* This violates the spec but is required for bug compatibility. */ acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); - /* Reprogram control registers */ - acpi_leave_sleep_state_prep(acpi_state); + /* Reprogram control registers and execute _BFS */ + acpi_leave_sleep_state_prep(acpi_state, wake_sleep_flags); /* ACPI 3.0 specs (P62) says that it's the responsibility * of the OSPM to clear the status bit [ implying that the @@ -575,9 +603,9 @@ static int acpi_hibernation_enter(void) ACPI_FLUSH_CPU_CACHE(); /* This shouldn't return. If it returns, we have a problem */ - status = acpi_enter_sleep_state(ACPI_STATE_S4); - /* Reprogram control registers */ - acpi_leave_sleep_state_prep(ACPI_STATE_S4); + status = acpi_enter_sleep_state(ACPI_STATE_S4, wake_sleep_flags); + /* Reprogram control registers and execute _BFS */ + acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags); return ACPI_SUCCESS(status) ? 0 : -EFAULT; } @@ -589,8 +617,8 @@ static void acpi_hibernation_leave(void) * enable it here. */ acpi_enable(); - /* Reprogram control registers */ - acpi_leave_sleep_state_prep(ACPI_STATE_S4); + /* Reprogram control registers and execute _BFS */ + acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags); /* Check the hardware signature */ if (facs && s4_hardware_signature != facs->hardware_signature) { printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " @@ -848,7 +876,33 @@ static void acpi_power_off(void) /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ printk(KERN_DEBUG "%s called\n", __func__); local_irq_disable(); - acpi_enter_sleep_state(ACPI_STATE_S5); + acpi_enter_sleep_state(ACPI_STATE_S5, wake_sleep_flags); +} + +/* + * ACPI 2.0 created the optional _GTS and _BFS, + * but industry adoption has been neither rapid nor broad. + * + * Linux gets into trouble when it executes poorly validated + * paths through the BIOS, so disable _GTS and _BFS by default, + * but do speak up and offer the option to enable them. + */ +static void __init acpi_gts_bfs_check(void) +{ + acpi_handle dummy; + + if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_PATHNAME__GTS, &dummy))) + { + printk(KERN_NOTICE PREFIX "BIOS offers _GTS\n"); + printk(KERN_NOTICE PREFIX "If \"acpi.gts=1\" improves suspend, " + "please notify linux-acpi@vger.kernel.org\n"); + } + if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_PATHNAME__BFS, &dummy))) + { + printk(KERN_NOTICE PREFIX "BIOS offers _BFS\n"); + printk(KERN_NOTICE PREFIX "If \"acpi.bfs=1\" improves resume, " + "please notify linux-acpi@vger.kernel.org\n"); + } } int __init acpi_sleep_init(void) @@ -909,5 +963,6 @@ int __init acpi_sleep_init(void) * object can also be evaluated when the system enters S5. */ register_reboot_notifier(&tts_notifier); + acpi_gts_bfs_check(); return 0; } diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 8275e7b06962..7dbebea1ec31 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -550,6 +550,8 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, return 0; } +static const char enabled[] = "kernel"; +static const char disabled[] = "user"; static int thermal_get_mode(struct thermal_zone_device *thermal, enum thermal_device_mode *mode) { @@ -586,8 +588,8 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, if (enable != tz->tz_enabled) { tz->tz_enabled = enable; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "%s kernel ACPI thermal control\n", - tz->tz_enabled ? "Enable" : "Disable")); + "%s ACPI thermal control\n", + tz->tz_enabled ? enabled : disabled)); acpi_thermal_check(tz); } return 0; @@ -843,7 +845,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) if (tz->trips.passive.flags.valid) tz->thermal_zone = - thermal_zone_device_register("acpitz", trips, 0, tz, + thermal_zone_device_register("acpitz", trips, tz, &acpi_thermal_zone_ops, tz->trips.passive.tc1, tz->trips.passive.tc2, @@ -851,7 +853,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) tz->polling_frequency*100); else tz->thermal_zone = - thermal_zone_device_register("acpitz", trips, 0, tz, + thermal_zone_device_register("acpitz", trips, tz, &acpi_thermal_zone_ops, 0, 0, 0, tz->polling_frequency*100); diff --git a/trunk/drivers/acpi/utils.c b/trunk/drivers/acpi/utils.c index 3e87c9c538aa..adbbc1c80a26 100644 --- a/trunk/drivers/acpi/utils.c +++ b/trunk/drivers/acpi/utils.c @@ -412,45 +412,3 @@ acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld) return status; } EXPORT_SYMBOL(acpi_get_physical_device_location); - -/** - * acpi_evaluate_hotplug_ost: Evaluate _OST for hotplug operations - * @handle: ACPI device handle - * @source_event: source event code - * @status_code: status code - * @status_buf: optional detailed information (NULL if none) - * - * Evaluate _OST for hotplug operations. All ACPI hotplug handlers - * must call this function when evaluating _OST for hotplug operations. - * When the platform does not support _OST, this function has no effect. - */ -acpi_status -acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event, - u32 status_code, struct acpi_buffer *status_buf) -{ -#ifdef ACPI_HOTPLUG_OST - union acpi_object params[3] = { - {.type = ACPI_TYPE_INTEGER,}, - {.type = ACPI_TYPE_INTEGER,}, - {.type = ACPI_TYPE_BUFFER,} - }; - struct acpi_object_list arg_list = {3, params}; - acpi_status status; - - params[0].integer.value = source_event; - params[1].integer.value = status_code; - if (status_buf != NULL) { - params[2].buffer.pointer = status_buf->pointer; - params[2].buffer.length = status_buf->length; - } else { - params[2].buffer.pointer = NULL; - params[2].buffer.length = 0; - } - - status = acpi_evaluate_object(handle, "_OST", &arg_list, NULL); - return status; -#else - return AE_OK; -#endif -} -EXPORT_SYMBOL(acpi_evaluate_hotplug_ost); diff --git a/trunk/drivers/cpuidle/Kconfig b/trunk/drivers/cpuidle/Kconfig index a76b689e553b..78a666d1e5f5 100644 --- a/trunk/drivers/cpuidle/Kconfig +++ b/trunk/drivers/cpuidle/Kconfig @@ -18,6 +18,3 @@ config CPU_IDLE_GOV_MENU bool depends on CPU_IDLE && NO_HZ default y - -config ARCH_NEEDS_CPU_IDLE_COUPLED - def_bool n diff --git a/trunk/drivers/cpuidle/Makefile b/trunk/drivers/cpuidle/Makefile index 38c8f69f30cf..5634f88379df 100644 --- a/trunk/drivers/cpuidle/Makefile +++ b/trunk/drivers/cpuidle/Makefile @@ -3,4 +3,3 @@ # obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ -obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o diff --git a/trunk/drivers/cpuidle/coupled.c b/trunk/drivers/cpuidle/coupled.c deleted file mode 100644 index 2c9bf2692232..000000000000 --- a/trunk/drivers/cpuidle/coupled.c +++ /dev/null @@ -1,715 +0,0 @@ -/* - * coupled.c - helper functions to enter the same idle state on multiple cpus - * - * Copyright (c) 2011 Google, Inc. - * - * Author: Colin Cross - * - * 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. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "cpuidle.h" - -/** - * DOC: Coupled cpuidle states - * - * On some ARM SMP SoCs (OMAP4460, Tegra 2, and probably more), the - * cpus cannot be independently powered down, either due to - * sequencing restrictions (on Tegra 2, cpu 0 must be the last to - * power down), or due to HW bugs (on OMAP4460, a cpu powering up - * will corrupt the gic state unless the other cpu runs a work - * around). Each cpu has a power state that it can enter without - * coordinating with the other cpu (usually Wait For Interrupt, or - * WFI), and one or more "coupled" power states that affect blocks - * shared between the cpus (L2 cache, interrupt controller, and - * sometimes the whole SoC). Entering a coupled power state must - * be tightly controlled on both cpus. - * - * This file implements a solution, where each cpu will wait in the - * WFI state until all cpus are ready to enter a coupled state, at - * which point the coupled state function will be called on all - * cpus at approximately the same time. - * - * Once all cpus are ready to enter idle, they are woken by an smp - * cross call. At this point, there is a chance that one of the - * cpus will find work to do, and choose not to enter idle. A - * final pass is needed to guarantee that all cpus will call the - * power state enter function at the same time. During this pass, - * each cpu will increment the ready counter, and continue once the - * ready counter matches the number of online coupled cpus. If any - * cpu exits idle, the other cpus will decrement their counter and - * retry. - * - * requested_state stores the deepest coupled idle state each cpu - * is ready for. It is assumed that the states are indexed from - * shallowest (highest power, lowest exit latency) to deepest - * (lowest power, highest exit latency). The requested_state - * variable is not locked. It is only written from the cpu that - * it stores (or by the on/offlining cpu if that cpu is offline), - * and only read after all the cpus are ready for the coupled idle - * state are are no longer updating it. - * - * Three atomic counters are used. alive_count tracks the number - * of cpus in the coupled set that are currently or soon will be - * online. waiting_count tracks the number of cpus that are in - * the waiting loop, in the ready loop, or in the coupled idle state. - * ready_count tracks the number of cpus that are in the ready loop - * or in the coupled idle state. - * - * To use coupled cpuidle states, a cpuidle driver must: - * - * Set struct cpuidle_device.coupled_cpus to the mask of all - * coupled cpus, usually the same as cpu_possible_mask if all cpus - * are part of the same cluster. The coupled_cpus mask must be - * set in the struct cpuidle_device for each cpu. - * - * Set struct cpuidle_device.safe_state to a state that is not a - * coupled state. This is usually WFI. - * - * Set CPUIDLE_FLAG_COUPLED in struct cpuidle_state.flags for each - * state that affects multiple cpus. - * - * Provide a struct cpuidle_state.enter function for each state - * that affects multiple cpus. This function is guaranteed to be - * called on all cpus at approximately the same time. The driver - * should ensure that the cpus all abort together if any cpu tries - * to abort once the function is called. The function should return - * with interrupts still disabled. - */ - -/** - * struct cpuidle_coupled - data for set of cpus that share a coupled idle state - * @coupled_cpus: mask of cpus that are part of the coupled set - * @requested_state: array of requested states for cpus in the coupled set - * @ready_waiting_counts: combined count of cpus in ready or waiting loops - * @online_count: count of cpus that are online - * @refcnt: reference count of cpuidle devices that are using this struct - * @prevent: flag to prevent coupled idle while a cpu is hotplugging - */ -struct cpuidle_coupled { - cpumask_t coupled_cpus; - int requested_state[NR_CPUS]; - atomic_t ready_waiting_counts; - int online_count; - int refcnt; - int prevent; -}; - -#define WAITING_BITS 16 -#define MAX_WAITING_CPUS (1 << WAITING_BITS) -#define WAITING_MASK (MAX_WAITING_CPUS - 1) -#define READY_MASK (~WAITING_MASK) - -#define CPUIDLE_COUPLED_NOT_IDLE (-1) - -static DEFINE_MUTEX(cpuidle_coupled_lock); -static DEFINE_PER_CPU(struct call_single_data, cpuidle_coupled_poke_cb); - -/* - * The cpuidle_coupled_poked_mask mask is used to avoid calling - * __smp_call_function_single with the per cpu call_single_data struct already - * in use. This prevents a deadlock where two cpus are waiting for each others - * call_single_data struct to be available - */ -static cpumask_t cpuidle_coupled_poked_mask; - -/** - * cpuidle_coupled_parallel_barrier - synchronize all online coupled cpus - * @dev: cpuidle_device of the calling cpu - * @a: atomic variable to hold the barrier - * - * No caller to this function will return from this function until all online - * cpus in the same coupled group have called this function. Once any caller - * has returned from this function, the barrier is immediately available for - * reuse. - * - * The atomic variable a must be initialized to 0 before any cpu calls - * this function, will be reset to 0 before any cpu returns from this function. - * - * Must only be called from within a coupled idle state handler - * (state.enter when state.flags has CPUIDLE_FLAG_COUPLED set). - * - * Provides full smp barrier semantics before and after calling. - */ -void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a) -{ - int n = dev->coupled->online_count; - - smp_mb__before_atomic_inc(); - atomic_inc(a); - - while (atomic_read(a) < n) - cpu_relax(); - - if (atomic_inc_return(a) == n * 2) { - atomic_set(a, 0); - return; - } - - while (atomic_read(a) > n) - cpu_relax(); -} - -/** - * cpuidle_state_is_coupled - check if a state is part of a coupled set - * @dev: struct cpuidle_device for the current cpu - * @drv: struct cpuidle_driver for the platform - * @state: index of the target state in drv->states - * - * Returns true if the target state is coupled with cpus besides this one - */ -bool cpuidle_state_is_coupled(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int state) -{ - return drv->states[state].flags & CPUIDLE_FLAG_COUPLED; -} - -/** - * cpuidle_coupled_set_ready - mark a cpu as ready - * @coupled: the struct coupled that contains the current cpu - */ -static inline void cpuidle_coupled_set_ready(struct cpuidle_coupled *coupled) -{ - atomic_add(MAX_WAITING_CPUS, &coupled->ready_waiting_counts); -} - -/** - * cpuidle_coupled_set_not_ready - mark a cpu as not ready - * @coupled: the struct coupled that contains the current cpu - * - * Decrements the ready counter, unless the ready (and thus the waiting) counter - * is equal to the number of online cpus. Prevents a race where one cpu - * decrements the waiting counter and then re-increments it just before another - * cpu has decremented its ready counter, leading to the ready counter going - * down from the number of online cpus without going through the coupled idle - * state. - * - * Returns 0 if the counter was decremented successfully, -EINVAL if the ready - * counter was equal to the number of online cpus. - */ -static -inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled) -{ - int all; - int ret; - - all = coupled->online_count || (coupled->online_count << WAITING_BITS); - ret = atomic_add_unless(&coupled->ready_waiting_counts, - -MAX_WAITING_CPUS, all); - - return ret ? 0 : -EINVAL; -} - -/** - * cpuidle_coupled_no_cpus_ready - check if no cpus in a coupled set are ready - * @coupled: the struct coupled that contains the current cpu - * - * Returns true if all of the cpus in a coupled set are out of the ready loop. - */ -static inline int cpuidle_coupled_no_cpus_ready(struct cpuidle_coupled *coupled) -{ - int r = atomic_read(&coupled->ready_waiting_counts) >> WAITING_BITS; - return r == 0; -} - -/** - * cpuidle_coupled_cpus_ready - check if all cpus in a coupled set are ready - * @coupled: the struct coupled that contains the current cpu - * - * Returns true if all cpus coupled to this target state are in the ready loop - */ -static inline bool cpuidle_coupled_cpus_ready(struct cpuidle_coupled *coupled) -{ - int r = atomic_read(&coupled->ready_waiting_counts) >> WAITING_BITS; - return r == coupled->online_count; -} - -/** - * cpuidle_coupled_cpus_waiting - check if all cpus in a coupled set are waiting - * @coupled: the struct coupled that contains the current cpu - * - * Returns true if all cpus coupled to this target state are in the wait loop - */ -static inline bool cpuidle_coupled_cpus_waiting(struct cpuidle_coupled *coupled) -{ - int w = atomic_read(&coupled->ready_waiting_counts) & WAITING_MASK; - return w == coupled->online_count; -} - -/** - * cpuidle_coupled_no_cpus_waiting - check if no cpus in coupled set are waiting - * @coupled: the struct coupled that contains the current cpu - * - * Returns true if all of the cpus in a coupled set are out of the waiting loop. - */ -static inline int cpuidle_coupled_no_cpus_waiting(struct cpuidle_coupled *coupled) -{ - int w = atomic_read(&coupled->ready_waiting_counts) & WAITING_MASK; - return w == 0; -} - -/** - * cpuidle_coupled_get_state - determine the deepest idle state - * @dev: struct cpuidle_device for this cpu - * @coupled: the struct coupled that contains the current cpu - * - * Returns the deepest idle state that all coupled cpus can enter - */ -static inline int cpuidle_coupled_get_state(struct cpuidle_device *dev, - struct cpuidle_coupled *coupled) -{ - int i; - int state = INT_MAX; - - /* - * Read barrier ensures that read of requested_state is ordered after - * reads of ready_count. Matches the write barriers - * cpuidle_set_state_waiting. - */ - smp_rmb(); - - for_each_cpu_mask(i, coupled->coupled_cpus) - if (cpu_online(i) && coupled->requested_state[i] < state) - state = coupled->requested_state[i]; - - return state; -} - -static void cpuidle_coupled_poked(void *info) -{ - int cpu = (unsigned long)info; - cpumask_clear_cpu(cpu, &cpuidle_coupled_poked_mask); -} - -/** - * cpuidle_coupled_poke - wake up a cpu that may be waiting - * @cpu: target cpu - * - * Ensures that the target cpu exits it's waiting idle state (if it is in it) - * and will see updates to waiting_count before it re-enters it's waiting idle - * state. - * - * If cpuidle_coupled_poked_mask is already set for the target cpu, that cpu - * either has or will soon have a pending IPI that will wake it out of idle, - * or it is currently processing the IPI and is not in idle. - */ -static void cpuidle_coupled_poke(int cpu) -{ - struct call_single_data *csd = &per_cpu(cpuidle_coupled_poke_cb, cpu); - - if (!cpumask_test_and_set_cpu(cpu, &cpuidle_coupled_poked_mask)) - __smp_call_function_single(cpu, csd, 0); -} - -/** - * cpuidle_coupled_poke_others - wake up all other cpus that may be waiting - * @dev: struct cpuidle_device for this cpu - * @coupled: the struct coupled that contains the current cpu - * - * Calls cpuidle_coupled_poke on all other online cpus. - */ -static void cpuidle_coupled_poke_others(int this_cpu, - struct cpuidle_coupled *coupled) -{ - int cpu; - - for_each_cpu_mask(cpu, coupled->coupled_cpus) - if (cpu != this_cpu && cpu_online(cpu)) - cpuidle_coupled_poke(cpu); -} - -/** - * cpuidle_coupled_set_waiting - mark this cpu as in the wait loop - * @dev: struct cpuidle_device for this cpu - * @coupled: the struct coupled that contains the current cpu - * @next_state: the index in drv->states of the requested state for this cpu - * - * Updates the requested idle state for the specified cpuidle device, - * poking all coupled cpus out of idle if necessary to let them see the new - * state. - */ -static void cpuidle_coupled_set_waiting(int cpu, - struct cpuidle_coupled *coupled, int next_state) -{ - int w; - - coupled->requested_state[cpu] = next_state; - - /* - * If this is the last cpu to enter the waiting state, poke - * all the other cpus out of their waiting state so they can - * enter a deeper state. This can race with one of the cpus - * exiting the waiting state due to an interrupt and - * decrementing waiting_count, see comment below. - * - * The atomic_inc_return provides a write barrier to order the write - * to requested_state with the later write that increments ready_count. - */ - w = atomic_inc_return(&coupled->ready_waiting_counts) & WAITING_MASK; - if (w == coupled->online_count) - cpuidle_coupled_poke_others(cpu, coupled); -} - -/** - * cpuidle_coupled_set_not_waiting - mark this cpu as leaving the wait loop - * @dev: struct cpuidle_device for this cpu - * @coupled: the struct coupled that contains the current cpu - * - * Removes the requested idle state for the specified cpuidle device. - */ -static void cpuidle_coupled_set_not_waiting(int cpu, - struct cpuidle_coupled *coupled) -{ - /* - * Decrementing waiting count can race with incrementing it in - * cpuidle_coupled_set_waiting, but that's OK. Worst case, some - * cpus will increment ready_count and then spin until they - * notice that this cpu has cleared it's requested_state. - */ - atomic_dec(&coupled->ready_waiting_counts); - - coupled->requested_state[cpu] = CPUIDLE_COUPLED_NOT_IDLE; -} - -/** - * cpuidle_coupled_set_done - mark this cpu as leaving the ready loop - * @cpu: the current cpu - * @coupled: the struct coupled that contains the current cpu - * - * Marks this cpu as no longer in the ready and waiting loops. Decrements - * the waiting count first to prevent another cpu looping back in and seeing - * this cpu as waiting just before it exits idle. - */ -static void cpuidle_coupled_set_done(int cpu, struct cpuidle_coupled *coupled) -{ - cpuidle_coupled_set_not_waiting(cpu, coupled); - atomic_sub(MAX_WAITING_CPUS, &coupled->ready_waiting_counts); -} - -/** - * cpuidle_coupled_clear_pokes - spin until the poke interrupt is processed - * @cpu - this cpu - * - * Turns on interrupts and spins until any outstanding poke interrupts have - * been processed and the poke bit has been cleared. - * - * Other interrupts may also be processed while interrupts are enabled, so - * need_resched() must be tested after turning interrupts off again to make sure - * the interrupt didn't schedule work that should take the cpu out of idle. - * - * Returns 0 if need_resched was false, -EINTR if need_resched was true. - */ -static int cpuidle_coupled_clear_pokes(int cpu) -{ - local_irq_enable(); - while (cpumask_test_cpu(cpu, &cpuidle_coupled_poked_mask)) - cpu_relax(); - local_irq_disable(); - - return need_resched() ? -EINTR : 0; -} - -/** - * cpuidle_enter_state_coupled - attempt to enter a state with coupled cpus - * @dev: struct cpuidle_device for the current cpu - * @drv: struct cpuidle_driver for the platform - * @next_state: index of the requested state in drv->states - * - * Coordinate with coupled cpus to enter the target state. This is a two - * stage process. In the first stage, the cpus are operating independently, - * and may call into cpuidle_enter_state_coupled at completely different times. - * To save as much power as possible, the first cpus to call this function will - * go to an intermediate state (the cpuidle_device's safe state), and wait for - * all the other cpus to call this function. Once all coupled cpus are idle, - * the second stage will start. Each coupled cpu will spin until all cpus have - * guaranteed that they will call the target_state. - * - * This function must be called with interrupts disabled. It may enable - * interrupts while preparing for idle, and it will always return with - * interrupts enabled. - */ -int cpuidle_enter_state_coupled(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int next_state) -{ - int entered_state = -1; - struct cpuidle_coupled *coupled = dev->coupled; - - if (!coupled) - return -EINVAL; - - while (coupled->prevent) { - if (cpuidle_coupled_clear_pokes(dev->cpu)) { - local_irq_enable(); - return entered_state; - } - entered_state = cpuidle_enter_state(dev, drv, - dev->safe_state_index); - } - - /* Read barrier ensures online_count is read after prevent is cleared */ - smp_rmb(); - - cpuidle_coupled_set_waiting(dev->cpu, coupled, next_state); - -retry: - /* - * Wait for all coupled cpus to be idle, using the deepest state - * allowed for a single cpu. - */ - while (!cpuidle_coupled_cpus_waiting(coupled)) { - if (cpuidle_coupled_clear_pokes(dev->cpu)) { - cpuidle_coupled_set_not_waiting(dev->cpu, coupled); - goto out; - } - - if (coupled->prevent) { - cpuidle_coupled_set_not_waiting(dev->cpu, coupled); - goto out; - } - - entered_state = cpuidle_enter_state(dev, drv, - dev->safe_state_index); - } - - if (cpuidle_coupled_clear_pokes(dev->cpu)) { - cpuidle_coupled_set_not_waiting(dev->cpu, coupled); - goto out; - } - - /* - * All coupled cpus are probably idle. There is a small chance that - * one of the other cpus just became active. Increment the ready count, - * and spin until all coupled cpus have incremented the counter. Once a - * cpu has incremented the ready counter, it cannot abort idle and must - * spin until either all cpus have incremented the ready counter, or - * another cpu leaves idle and decrements the waiting counter. - */ - - cpuidle_coupled_set_ready(coupled); - while (!cpuidle_coupled_cpus_ready(coupled)) { - /* Check if any other cpus bailed out of idle. */ - if (!cpuidle_coupled_cpus_waiting(coupled)) - if (!cpuidle_coupled_set_not_ready(coupled)) - goto retry; - - cpu_relax(); - } - - /* all cpus have acked the coupled state */ - next_state = cpuidle_coupled_get_state(dev, coupled); - - entered_state = cpuidle_enter_state(dev, drv, next_state); - - cpuidle_coupled_set_done(dev->cpu, coupled); - -out: - /* - * Normal cpuidle states are expected to return with irqs enabled. - * That leads to an inefficiency where a cpu receiving an interrupt - * that brings it out of idle will process that interrupt before - * exiting the idle enter function and decrementing ready_count. All - * other cpus will need to spin waiting for the cpu that is processing - * the interrupt. If the driver returns with interrupts disabled, - * all other cpus will loop back into the safe idle state instead of - * spinning, saving power. - * - * Calling local_irq_enable here allows coupled states to return with - * interrupts disabled, but won't cause problems for drivers that - * exit with interrupts enabled. - */ - local_irq_enable(); - - /* - * Wait until all coupled cpus have exited idle. There is no risk that - * a cpu exits and re-enters the ready state because this cpu has - * already decremented its waiting_count. - */ - while (!cpuidle_coupled_no_cpus_ready(coupled)) - cpu_relax(); - - return entered_state; -} - -static void cpuidle_coupled_update_online_cpus(struct cpuidle_coupled *coupled) -{ - cpumask_t cpus; - cpumask_and(&cpus, cpu_online_mask, &coupled->coupled_cpus); - coupled->online_count = cpumask_weight(&cpus); -} - -/** - * cpuidle_coupled_register_device - register a coupled cpuidle device - * @dev: struct cpuidle_device for the current cpu - * - * Called from cpuidle_register_device to handle coupled idle init. Finds the - * cpuidle_coupled struct for this set of coupled cpus, or creates one if none - * exists yet. - */ -int cpuidle_coupled_register_device(struct cpuidle_device *dev) -{ - int cpu; - struct cpuidle_device *other_dev; - struct call_single_data *csd; - struct cpuidle_coupled *coupled; - - if (cpumask_empty(&dev->coupled_cpus)) - return 0; - - for_each_cpu_mask(cpu, dev->coupled_cpus) { - other_dev = per_cpu(cpuidle_devices, cpu); - if (other_dev && other_dev->coupled) { - coupled = other_dev->coupled; - goto have_coupled; - } - } - - /* No existing coupled info found, create a new one */ - coupled = kzalloc(sizeof(struct cpuidle_coupled), GFP_KERNEL); - if (!coupled) - return -ENOMEM; - - coupled->coupled_cpus = dev->coupled_cpus; - -have_coupled: - dev->coupled = coupled; - if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &coupled->coupled_cpus))) - coupled->prevent++; - - cpuidle_coupled_update_online_cpus(coupled); - - coupled->refcnt++; - - csd = &per_cpu(cpuidle_coupled_poke_cb, dev->cpu); - csd->func = cpuidle_coupled_poked; - csd->info = (void *)(unsigned long)dev->cpu; - - return 0; -} - -/** - * cpuidle_coupled_unregister_device - unregister a coupled cpuidle device - * @dev: struct cpuidle_device for the current cpu - * - * Called from cpuidle_unregister_device to tear down coupled idle. Removes the - * cpu from the coupled idle set, and frees the cpuidle_coupled_info struct if - * this was the last cpu in the set. - */ -void cpuidle_coupled_unregister_device(struct cpuidle_device *dev) -{ - struct cpuidle_coupled *coupled = dev->coupled; - - if (cpumask_empty(&dev->coupled_cpus)) - return; - - if (--coupled->refcnt) - kfree(coupled); - dev->coupled = NULL; -} - -/** - * cpuidle_coupled_prevent_idle - prevent cpus from entering a coupled state - * @coupled: the struct coupled that contains the cpu that is changing state - * - * Disables coupled cpuidle on a coupled set of cpus. Used to ensure that - * cpu_online_mask doesn't change while cpus are coordinating coupled idle. - */ -static void cpuidle_coupled_prevent_idle(struct cpuidle_coupled *coupled) -{ - int cpu = get_cpu(); - - /* Force all cpus out of the waiting loop. */ - coupled->prevent++; - cpuidle_coupled_poke_others(cpu, coupled); - put_cpu(); - while (!cpuidle_coupled_no_cpus_waiting(coupled)) - cpu_relax(); -} - -/** - * cpuidle_coupled_allow_idle - allows cpus to enter a coupled state - * @coupled: the struct coupled that contains the cpu that is changing state - * - * Enables coupled cpuidle on a coupled set of cpus. Used to ensure that - * cpu_online_mask doesn't change while cpus are coordinating coupled idle. - */ -static void cpuidle_coupled_allow_idle(struct cpuidle_coupled *coupled) -{ - int cpu = get_cpu(); - - /* - * Write barrier ensures readers see the new online_count when they - * see prevent == 0. - */ - smp_wmb(); - coupled->prevent--; - /* Force cpus out of the prevent loop. */ - cpuidle_coupled_poke_others(cpu, coupled); - put_cpu(); -} - -/** - * cpuidle_coupled_cpu_notify - notifier called during hotplug transitions - * @nb: notifier block - * @action: hotplug transition - * @hcpu: target cpu number - * - * Called when a cpu is brought on or offline using hotplug. Updates the - * coupled cpu set appropriately - */ -static int cpuidle_coupled_cpu_notify(struct notifier_block *nb, - unsigned long action, void *hcpu) -{ - int cpu = (unsigned long)hcpu; - struct cpuidle_device *dev; - - mutex_lock(&cpuidle_lock); - - dev = per_cpu(cpuidle_devices, cpu); - if (!dev->coupled) - goto out; - - switch (action & ~CPU_TASKS_FROZEN) { - case CPU_UP_PREPARE: - case CPU_DOWN_PREPARE: - cpuidle_coupled_prevent_idle(dev->coupled); - break; - case CPU_ONLINE: - case CPU_DEAD: - cpuidle_coupled_update_online_cpus(dev->coupled); - /* Fall through */ - case CPU_UP_CANCELED: - case CPU_DOWN_FAILED: - cpuidle_coupled_allow_idle(dev->coupled); - break; - } - -out: - mutex_unlock(&cpuidle_lock); - return NOTIFY_OK; -} - -static struct notifier_block cpuidle_coupled_cpu_notifier = { - .notifier_call = cpuidle_coupled_cpu_notify, -}; - -static int __init cpuidle_coupled_init(void) -{ - return register_cpu_notifier(&cpuidle_coupled_cpu_notifier); -} -core_initcall(cpuidle_coupled_init); diff --git a/trunk/drivers/cpuidle/cpuidle.c b/trunk/drivers/cpuidle/cpuidle.c index bb4e827434ce..d90519cec880 100644 --- a/trunk/drivers/cpuidle/cpuidle.c +++ b/trunk/drivers/cpuidle/cpuidle.c @@ -91,34 +91,6 @@ int cpuidle_play_dead(void) return -ENODEV; } -/** - * cpuidle_enter_state - enter the state and update stats - * @dev: cpuidle device for this cpu - * @drv: cpuidle driver for this cpu - * @next_state: index into drv->states of the state to enter - */ -int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, - int next_state) -{ - int entered_state; - - entered_state = cpuidle_enter_ops(dev, drv, next_state); - - if (entered_state >= 0) { - /* Update cpuidle counters */ - /* This can be moved to within driver enter routine - * but that results in multiple copies of same code. - */ - dev->states_usage[entered_state].time += - (unsigned long long)dev->last_residency; - dev->states_usage[entered_state].usage++; - } else { - dev->last_residency = 0; - } - - return entered_state; -} - /** * cpuidle_idle_call - the main idle loop * @@ -141,6 +113,15 @@ int cpuidle_idle_call(void) if (!dev || !dev->enabled) return -EBUSY; +#if 0 + /* shows regressions, re-enable for 2.6.29 */ + /* + * run any timers that can be run now, at this point + * before calculating the idle duration etc. + */ + hrtimer_peek_ahead_timers(); +#endif + /* ask the governor for the next state */ next_state = cpuidle_curr_governor->select(drv, dev); if (need_resched()) { @@ -151,15 +132,23 @@ int cpuidle_idle_call(void) trace_power_start_rcuidle(POWER_CSTATE, next_state, dev->cpu); trace_cpu_idle_rcuidle(next_state, dev->cpu); - if (cpuidle_state_is_coupled(dev, drv, next_state)) - entered_state = cpuidle_enter_state_coupled(dev, drv, - next_state); - else - entered_state = cpuidle_enter_state(dev, drv, next_state); + entered_state = cpuidle_enter_ops(dev, drv, next_state); trace_power_end_rcuidle(dev->cpu); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); + if (entered_state >= 0) { + /* Update cpuidle counters */ + /* This can be moved to within driver enter routine + * but that results in multiple copies of same code. + */ + dev->states_usage[entered_state].time += + (unsigned long long)dev->last_residency; + dev->states_usage[entered_state].usage++; + } else { + dev->last_residency = 0; + } + /* give the governor an opportunity to reflect on the outcome */ if (cpuidle_curr_governor->reflect) cpuidle_curr_governor->reflect(dev, entered_state); @@ -294,9 +283,6 @@ int cpuidle_enable_device(struct cpuidle_device *dev) int ret, i; struct cpuidle_driver *drv = cpuidle_get_driver(); - if (!dev) - return -EINVAL; - if (dev->enabled) return 0; if (!drv || !cpuidle_curr_governor) @@ -381,6 +367,8 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); + if (!dev) + return -EINVAL; if (!try_module_get(cpuidle_driver->owner)) return -EINVAL; @@ -388,25 +376,13 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) per_cpu(cpuidle_devices, dev->cpu) = dev; list_add(&dev->device_list, &cpuidle_detected_devices); - ret = cpuidle_add_sysfs(cpu_dev); - if (ret) - goto err_sysfs; - - ret = cpuidle_coupled_register_device(dev); - if (ret) - goto err_coupled; + if ((ret = cpuidle_add_sysfs(cpu_dev))) { + module_put(cpuidle_driver->owner); + return ret; + } dev->registered = 1; return 0; - -err_coupled: - cpuidle_remove_sysfs(cpu_dev); - wait_for_completion(&dev->kobj_unregister); -err_sysfs: - list_del(&dev->device_list); - per_cpu(cpuidle_devices, dev->cpu) = NULL; - module_put(cpuidle_driver->owner); - return ret; } /** @@ -417,9 +393,6 @@ int cpuidle_register_device(struct cpuidle_device *dev) { int ret; - if (!dev) - return -EINVAL; - mutex_lock(&cpuidle_lock); if ((ret = __cpuidle_register_device(dev))) { @@ -459,8 +432,6 @@ void cpuidle_unregister_device(struct cpuidle_device *dev) wait_for_completion(&dev->kobj_unregister); per_cpu(cpuidle_devices, dev->cpu) = NULL; - cpuidle_coupled_unregister_device(dev); - cpuidle_resume_and_unlock(); module_put(cpuidle_driver->owner); diff --git a/trunk/drivers/cpuidle/cpuidle.h b/trunk/drivers/cpuidle/cpuidle.h index 76e7f696ad8c..7db186685c27 100644 --- a/trunk/drivers/cpuidle/cpuidle.h +++ b/trunk/drivers/cpuidle/cpuidle.h @@ -14,8 +14,6 @@ extern struct list_head cpuidle_detected_devices; extern struct mutex cpuidle_lock; extern spinlock_t cpuidle_driver_lock; extern int cpuidle_disabled(void); -extern int cpuidle_enter_state(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int next_state); /* idle loop */ extern void cpuidle_install_idle_handler(void); @@ -32,34 +30,4 @@ extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device); extern int cpuidle_add_sysfs(struct device *dev); extern void cpuidle_remove_sysfs(struct device *dev); -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED -bool cpuidle_state_is_coupled(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int state); -int cpuidle_enter_state_coupled(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int next_state); -int cpuidle_coupled_register_device(struct cpuidle_device *dev); -void cpuidle_coupled_unregister_device(struct cpuidle_device *dev); -#else -static inline bool cpuidle_state_is_coupled(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int state) -{ - return false; -} - -static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int next_state) -{ - return -1; -} - -static inline int cpuidle_coupled_register_device(struct cpuidle_device *dev) -{ - return 0; -} - -static inline void cpuidle_coupled_unregister_device(struct cpuidle_device *dev) -{ -} -#endif - #endif /* __DRIVER_CPUIDLE_H */ diff --git a/trunk/drivers/idle/intel_idle.c b/trunk/drivers/idle/intel_idle.c index a759a4c4bb0a..d0f59c3f87ef 100644 --- a/trunk/drivers/idle/intel_idle.c +++ b/trunk/drivers/idle/intel_idle.c @@ -169,38 +169,6 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = { .enter = &intel_idle }, }; -static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = { - { /* MWAIT C0 */ }, - { /* MWAIT C1 */ - .name = "C1-IVB", - .desc = "MWAIT 0x00", - .flags = CPUIDLE_FLAG_TIME_VALID, - .exit_latency = 1, - .target_residency = 1, - .enter = &intel_idle }, - { /* MWAIT C2 */ - .name = "C3-IVB", - .desc = "MWAIT 0x10", - .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, - .exit_latency = 59, - .target_residency = 156, - .enter = &intel_idle }, - { /* MWAIT C3 */ - .name = "C6-IVB", - .desc = "MWAIT 0x20", - .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, - .exit_latency = 80, - .target_residency = 300, - .enter = &intel_idle }, - { /* MWAIT C4 */ - .name = "C7-IVB", - .desc = "MWAIT 0x30", - .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, - .exit_latency = 87, - .target_residency = 300, - .enter = &intel_idle }, -}; - static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { { /* MWAIT C0 */ }, { /* MWAIT C1 */ @@ -379,10 +347,6 @@ static const struct idle_cpu idle_cpu_snb = { .state_table = snb_cstates, }; -static const struct idle_cpu idle_cpu_ivb = { - .state_table = ivb_cstates, -}; - #define ICPU(model, cpu) \ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu } @@ -398,7 +362,6 @@ static const struct x86_cpu_id intel_idle_ids[] = { ICPU(0x2f, idle_cpu_nehalem), ICPU(0x2a, idle_cpu_snb), ICPU(0x2d, idle_cpu_snb), - ICPU(0x3a, idle_cpu_ivb), {} }; MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); diff --git a/trunk/drivers/platform/x86/acerhdf.c b/trunk/drivers/platform/x86/acerhdf.c index 39abb150bdd4..2fd9d36acd15 100644 --- a/trunk/drivers/platform/x86/acerhdf.c +++ b/trunk/drivers/platform/x86/acerhdf.c @@ -660,7 +660,7 @@ static int acerhdf_register_thermal(void) if (IS_ERR(cl_dev)) return -EINVAL; - thz_dev = thermal_zone_device_register("acerhdf", 1, 0, NULL, + thz_dev = thermal_zone_device_register("acerhdf", 1, NULL, &acerhdf_dev_ops, 0, 0, 0, (kernelmode) ? interval*1000 : 0); if (IS_ERR(thz_dev)) diff --git a/trunk/drivers/platform/x86/intel_mid_thermal.c b/trunk/drivers/platform/x86/intel_mid_thermal.c index 2b2c212ad37d..5ae9cd9c7e6e 100644 --- a/trunk/drivers/platform/x86/intel_mid_thermal.c +++ b/trunk/drivers/platform/x86/intel_mid_thermal.c @@ -499,7 +499,7 @@ static int mid_thermal_probe(struct platform_device *pdev) goto err; } pinfo->tzd[i] = thermal_zone_device_register(name[i], - 0, 0, td_info, &tzd_ops, 0, 0, 0, 0); + 0, td_info, &tzd_ops, 0, 0, 0, 0); if (IS_ERR(pinfo->tzd[i])) { kfree(td_info); ret = PTR_ERR(pinfo->tzd[i]); diff --git a/trunk/drivers/thermal/Kconfig b/trunk/drivers/thermal/Kconfig index 3ab2bd540b54..514a691abea0 100644 --- a/trunk/drivers/thermal/Kconfig +++ b/trunk/drivers/thermal/Kconfig @@ -23,7 +23,6 @@ config SPEAR_THERMAL bool "SPEAr thermal sensor driver" depends on THERMAL depends on PLAT_SPEAR - depends on OF help Enable this to plug the SPEAr thermal sensor driver into the Linux thermal framework diff --git a/trunk/drivers/thermal/spear_thermal.c b/trunk/drivers/thermal/spear_thermal.c index 5f8ee39f2000..c2e32df3b164 100644 --- a/trunk/drivers/thermal/spear_thermal.c +++ b/trunk/drivers/thermal/spear_thermal.c @@ -20,9 +20,9 @@ #include #include #include -#include #include #include +#include #include #define MD_FACTOR 1000 @@ -103,20 +103,21 @@ static int spear_thermal_probe(struct platform_device *pdev) { struct thermal_zone_device *spear_thermal = NULL; struct spear_thermal_dev *stdev; - struct device_node *np = pdev->dev.of_node; + struct spear_thermal_pdata *pdata; + int ret = 0; struct resource *stres = platform_get_resource(pdev, IORESOURCE_MEM, 0); - int ret = 0, val; - - if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { - dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); - return -EINVAL; - } if (!stres) { dev_err(&pdev->dev, "memory resource missing\n"); return -ENODEV; } + pdata = dev_get_platdata(&pdev->dev); + if (!pdata) { + dev_err(&pdev->dev, "platform data is NULL\n"); + return -EINVAL; + } + stdev = devm_kzalloc(&pdev->dev, sizeof(*stdev), GFP_KERNEL); if (!stdev) { dev_err(&pdev->dev, "kzalloc fail\n"); @@ -143,10 +144,10 @@ static int spear_thermal_probe(struct platform_device *pdev) goto put_clk; } - stdev->flags = val; + stdev->flags = pdata->thermal_flags; writel_relaxed(stdev->flags, stdev->thermal_base); - spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0, + spear_thermal = thermal_zone_device_register("spear_thermal", 0, stdev, &ops, 0, 0, 0, 0); if (IS_ERR(spear_thermal)) { dev_err(&pdev->dev, "thermal zone device is NULL\n"); @@ -188,12 +189,6 @@ static int spear_thermal_exit(struct platform_device *pdev) return 0; } -static const struct of_device_id spear_thermal_id_table[] = { - { .compatible = "st,thermal-spear1340" }, - {} -}; -MODULE_DEVICE_TABLE(of, spear_thermal_id_table); - static struct platform_driver spear_thermal_driver = { .probe = spear_thermal_probe, .remove = spear_thermal_exit, @@ -201,7 +196,6 @@ static struct platform_driver spear_thermal_driver = { .name = "spear_thermal", .owner = THIS_MODULE, .pm = &spear_thermal_pm_ops, - .of_match_table = of_match_ptr(spear_thermal_id_table), }, }; diff --git a/trunk/drivers/thermal/thermal_sys.c b/trunk/drivers/thermal/thermal_sys.c index 2d7a9fe8f365..022bacb71a7e 100644 --- a/trunk/drivers/thermal/thermal_sys.c +++ b/trunk/drivers/thermal/thermal_sys.c @@ -195,28 +195,6 @@ trip_point_type_show(struct device *dev, struct device_attribute *attr, } } -static ssize_t -trip_point_temp_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct thermal_zone_device *tz = to_thermal_zone(dev); - int trip, ret; - unsigned long temperature; - - if (!tz->ops->set_trip_temp) - return -EPERM; - - if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip)) - return -EINVAL; - - if (kstrtoul(buf, 10, &temperature)) - return -EINVAL; - - ret = tz->ops->set_trip_temp(tz, trip, temperature); - - return ret ? ret : count; -} - static ssize_t trip_point_temp_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -239,52 +217,6 @@ trip_point_temp_show(struct device *dev, struct device_attribute *attr, return sprintf(buf, "%ld\n", temperature); } -static ssize_t -trip_point_hyst_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct thermal_zone_device *tz = to_thermal_zone(dev); - int trip, ret; - unsigned long temperature; - - if (!tz->ops->set_trip_hyst) - return -EPERM; - - if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip)) - return -EINVAL; - - if (kstrtoul(buf, 10, &temperature)) - return -EINVAL; - - /* - * We are not doing any check on the 'temperature' value - * here. The driver implementing 'set_trip_hyst' has to - * take care of this. - */ - ret = tz->ops->set_trip_hyst(tz, trip, temperature); - - return ret ? ret : count; -} - -static ssize_t -trip_point_hyst_show(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct thermal_zone_device *tz = to_thermal_zone(dev); - int trip, ret; - unsigned long temperature; - - if (!tz->ops->get_trip_hyst) - return -EPERM; - - if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip)) - return -EINVAL; - - ret = tz->ops->get_trip_hyst(tz, trip, &temperature); - - return ret ? ret : sprintf(buf, "%ld\n", temperature); -} - static ssize_t passive_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) @@ -351,6 +283,33 @@ static DEVICE_ATTR(temp, 0444, temp_show, NULL); static DEVICE_ATTR(mode, 0644, mode_show, mode_store); static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); +static struct device_attribute trip_point_attrs[] = { + __ATTR(trip_point_0_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_0_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_1_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_1_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_2_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_2_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_3_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_3_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_4_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_4_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_5_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_5_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_6_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_6_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_7_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_7_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_8_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_8_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_9_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_9_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_10_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_10_temp, 0444, trip_point_temp_show, NULL), + __ATTR(trip_point_11_type, 0444, trip_point_type_show, NULL), + __ATTR(trip_point_11_temp, 0444, trip_point_temp_show, NULL), +}; + /* sys I/F for cooling device */ #define to_cooling_device(_dev) \ container_of(_dev, struct thermal_cooling_device, device) @@ -1129,114 +1088,10 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) } EXPORT_SYMBOL(thermal_zone_device_update); -/** - * create_trip_attrs - create attributes for trip points - * @tz: the thermal zone device - * @mask: Writeable trip point bitmap. - */ -static int create_trip_attrs(struct thermal_zone_device *tz, int mask) -{ - int indx; - int size = sizeof(struct thermal_attr) * tz->trips; - - tz->trip_type_attrs = kzalloc(size, GFP_KERNEL); - if (!tz->trip_type_attrs) - return -ENOMEM; - - tz->trip_temp_attrs = kzalloc(size, GFP_KERNEL); - if (!tz->trip_temp_attrs) { - kfree(tz->trip_type_attrs); - return -ENOMEM; - } - - if (tz->ops->get_trip_hyst) { - tz->trip_hyst_attrs = kzalloc(size, GFP_KERNEL); - if (!tz->trip_hyst_attrs) { - kfree(tz->trip_type_attrs); - kfree(tz->trip_temp_attrs); - return -ENOMEM; - } - } - - - for (indx = 0; indx < tz->trips; indx++) { - /* create trip type attribute */ - snprintf(tz->trip_type_attrs[indx].name, THERMAL_NAME_LENGTH, - "trip_point_%d_type", indx); - - sysfs_attr_init(&tz->trip_type_attrs[indx].attr.attr); - tz->trip_type_attrs[indx].attr.attr.name = - tz->trip_type_attrs[indx].name; - tz->trip_type_attrs[indx].attr.attr.mode = S_IRUGO; - tz->trip_type_attrs[indx].attr.show = trip_point_type_show; - - device_create_file(&tz->device, - &tz->trip_type_attrs[indx].attr); - - /* create trip temp attribute */ - snprintf(tz->trip_temp_attrs[indx].name, THERMAL_NAME_LENGTH, - "trip_point_%d_temp", indx); - - sysfs_attr_init(&tz->trip_temp_attrs[indx].attr.attr); - tz->trip_temp_attrs[indx].attr.attr.name = - tz->trip_temp_attrs[indx].name; - tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO; - tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show; - if (mask & (1 << indx)) { - tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR; - tz->trip_temp_attrs[indx].attr.store = - trip_point_temp_store; - } - - device_create_file(&tz->device, - &tz->trip_temp_attrs[indx].attr); - - /* create Optional trip hyst attribute */ - if (!tz->ops->get_trip_hyst) - continue; - snprintf(tz->trip_hyst_attrs[indx].name, THERMAL_NAME_LENGTH, - "trip_point_%d_hyst", indx); - - sysfs_attr_init(&tz->trip_hyst_attrs[indx].attr.attr); - tz->trip_hyst_attrs[indx].attr.attr.name = - tz->trip_hyst_attrs[indx].name; - tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; - tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; - if (tz->ops->set_trip_hyst) { - tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; - tz->trip_hyst_attrs[indx].attr.store = - trip_point_hyst_store; - } - - device_create_file(&tz->device, - &tz->trip_hyst_attrs[indx].attr); - } - return 0; -} - -static void remove_trip_attrs(struct thermal_zone_device *tz) -{ - int indx; - - for (indx = 0; indx < tz->trips; indx++) { - device_remove_file(&tz->device, - &tz->trip_type_attrs[indx].attr); - device_remove_file(&tz->device, - &tz->trip_temp_attrs[indx].attr); - if (tz->ops->get_trip_hyst) - device_remove_file(&tz->device, - &tz->trip_hyst_attrs[indx].attr); - } - kfree(tz->trip_type_attrs); - kfree(tz->trip_temp_attrs); - kfree(tz->trip_hyst_attrs); -} - /** * thermal_zone_device_register - register a new thermal zone device * @type: the thermal zone device type * @trips: the number of trip points the thermal zone support - * @mask: a bit string indicating the writeablility of trip points * @devdata: private device data * @ops: standard thermal zone device callbacks * @tc1: thermal coefficient 1 for passive calculations @@ -1252,7 +1107,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz) * section 11.1.5.1 of the ACPI specification 3.0. */ struct thermal_zone_device *thermal_zone_device_register(char *type, - int trips, int mask, void *devdata, + int trips, void *devdata, const struct thermal_zone_device_ops *ops, int tc1, int tc2, int passive_delay, int polling_delay) { @@ -1266,7 +1121,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, if (strlen(type) >= THERMAL_NAME_LENGTH) return ERR_PTR(-EINVAL); - if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips) + if (trips > THERMAL_MAX_TRIPS || trips < 0) return ERR_PTR(-EINVAL); if (!ops || !ops->get_temp) @@ -1320,11 +1175,15 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, goto unregister; } - result = create_trip_attrs(tz, mask); - if (result) - goto unregister; - for (count = 0; count < trips; count++) { + result = device_create_file(&tz->device, + &trip_point_attrs[count * 2]); + if (result) + break; + result = device_create_file(&tz->device, + &trip_point_attrs[count * 2 + 1]); + if (result) + goto unregister; tz->ops->get_trip_type(tz, count, &trip_type); if (trip_type == THERMAL_TRIP_PASSIVE) passive = 1; @@ -1373,6 +1232,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) { struct thermal_cooling_device *cdev; struct thermal_zone_device *pos = NULL; + int count; if (!tz) return; @@ -1399,8 +1259,13 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) device_remove_file(&tz->device, &dev_attr_temp); if (tz->ops->get_mode) device_remove_file(&tz->device, &dev_attr_mode); - remove_trip_attrs(tz); + for (count = 0; count < tz->trips; count++) { + device_remove_file(&tz->device, + &trip_point_attrs[count * 2]); + device_remove_file(&tz->device, + &trip_point_attrs[count * 2 + 1]); + } thermal_remove_hwmon_sysfs(tz); release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); idr_destroy(&tz->idr); diff --git a/trunk/include/acpi/acexcep.h b/trunk/include/acpi/acexcep.h index 19503449814f..92d6e1d701ff 100644 --- a/trunk/include/acpi/acexcep.h +++ b/trunk/include/acpi/acexcep.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,6 @@ #define AE_CODE_ACPI_TABLES 0x2000 #define AE_CODE_AML 0x3000 #define AE_CODE_CONTROL 0x4000 -#define AE_CODE_MAX 0x4000 #define AE_CODE_MASK 0xF000 #define ACPI_SUCCESS(a) (!(a)) @@ -182,7 +181,7 @@ /* Exception strings for acpi_format_exception */ -#ifdef ACPI_DEFINE_EXCEPTION_TABLE +#ifdef DEFINE_ACPI_GLOBALS /* * String versions of the exception codes above @@ -296,6 +295,6 @@ char const *acpi_gbl_exception_names_ctrl[] = { "AE_CTRL_PARSE_PENDING" }; -#endif /* EXCEPTION_TABLE */ +#endif /* ACPI GLOBALS */ #endif /* __ACEXCEP_H__ */ diff --git a/trunk/include/acpi/acnames.h b/trunk/include/acpi/acnames.h index ef24d82c4a41..38f508816e4a 100644 --- a/trunk/include/acpi/acnames.h +++ b/trunk/include/acpi/acnames.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/trunk/include/acpi/acoutput.h b/trunk/include/acpi/acoutput.h index 2457ac849655..d7bd661bfae7 100644 --- a/trunk/include/acpi/acoutput.h +++ b/trunk/include/acpi/acoutput.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -213,8 +213,6 @@ #define ACPI_WARNING(plist) acpi_warning plist #define ACPI_EXCEPTION(plist) acpi_exception plist #define ACPI_ERROR(plist) acpi_error plist -#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist -#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist #define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i) #else @@ -225,8 +223,6 @@ #define ACPI_WARNING(plist) #define ACPI_EXCEPTION(plist) #define ACPI_ERROR(plist) -#define ACPI_BIOS_WARNING(plist) -#define ACPI_BIOS_ERROR(plist) #define ACPI_DEBUG_OBJECT(obj,l,i) #endif /* ACPI_NO_ERROR_MESSAGES */ diff --git a/trunk/include/acpi/acpi.h b/trunk/include/acpi/acpi.h index c433d5e27679..de39915f6b7f 100644 --- a/trunk/include/acpi/acpi.h +++ b/trunk/include/acpi/acpi.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/trunk/include/acpi/acpi_bus.h b/trunk/include/acpi/acpi_bus.h index b22b77444b5c..9e6e1c6eb60a 100644 --- a/trunk/include/acpi/acpi_bus.h +++ b/trunk/include/acpi/acpi_bus.h @@ -50,9 +50,6 @@ acpi_evaluate_reference(acpi_handle handle, acpi_string pathname, struct acpi_object_list *arguments, struct acpi_handle_list *list); -acpi_status -acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event, - u32 status_code, struct acpi_buffer *status_buf); struct acpi_pld { unsigned int revision:7; /* 0 */ @@ -182,8 +179,7 @@ struct acpi_device_flags { u32 suprise_removal_ok:1; u32 power_manageable:1; u32 performance_manageable:1; - u32 eject_pending:1; - u32 reserved:23; + u32 reserved:24; }; /* File System */ @@ -335,11 +331,6 @@ struct acpi_bus_event { u32 data; }; -struct acpi_eject_event { - acpi_handle handle; - u32 event; -}; - extern struct kobject *acpi_kobj; extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); void acpi_bus_private_data_handler(acpi_handle, void *); @@ -377,7 +368,6 @@ int acpi_bus_register_driver(struct acpi_driver *driver); void acpi_bus_unregister_driver(struct acpi_driver *driver); int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, acpi_handle handle, int type); -void acpi_bus_hot_remove_device(void *context); int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); diff --git a/trunk/include/acpi/acpiosxf.h b/trunk/include/acpi/acpiosxf.h index 0650f5fa7ce9..21a5548c6686 100644 --- a/trunk/include/acpi/acpiosxf.h +++ b/trunk/include/acpi/acpiosxf.h @@ -8,7 +8,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -205,7 +205,7 @@ acpi_os_execute(acpi_execute_type type, acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context); -void acpi_os_wait_events_complete(void); +void acpi_os_wait_events_complete(void *context); void acpi_os_sleep(u64 milliseconds); diff --git a/trunk/include/acpi/acpixf.h b/trunk/include/acpi/acpixf.h index 26a92fc28a59..982110134672 100644 --- a/trunk/include/acpi/acpixf.h +++ b/trunk/include/acpi/acpixf.h @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20120711 +#define ACPI_CA_VERSION 0x20120320 #include "acconfig.h" #include "actypes.h" @@ -153,15 +153,6 @@ void *acpi_callocate(u32 size); void acpi_free(void *address); -/* - * ACPI table load/unload interfaces - */ -acpi_status acpi_load_table(struct acpi_table_header *table); - -acpi_status acpi_unload_parent_table(acpi_handle object); - -acpi_status acpi_load_tables(void); - /* * ACPI table manipulation interfaces */ @@ -169,6 +160,10 @@ acpi_status acpi_reallocate_root_table(void); acpi_status acpi_find_root_pointer(acpi_size *rsdp_address); +acpi_status acpi_load_tables(void); + +acpi_status acpi_load_table(struct acpi_table_header *table_ptr); + acpi_status acpi_unload_table_id(acpi_owner_id id); acpi_status @@ -491,11 +486,11 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags); ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) -acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags); acpi_status acpi_leave_sleep_state(u8 sleep_state); @@ -534,14 +529,6 @@ void ACPI_INTERNAL_VAR_XFACE acpi_info(const char *module_name, u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3); -void ACPI_INTERNAL_VAR_XFACE -acpi_bios_error(const char *module_name, - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3); - -void ACPI_INTERNAL_VAR_XFACE -acpi_bios_warning(const char *module_name, - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3); - /* * Debug output */ diff --git a/trunk/include/acpi/acrestyp.h b/trunk/include/acpi/acrestyp.h index 40349ae65464..3506e39a66b1 100644 --- a/trunk/include/acpi/acrestyp.h +++ b/trunk/include/acpi/acrestyp.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ * Definitions for Resource Attributes */ typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ -typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */ +typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */ /* * Memory Attributes @@ -332,7 +332,7 @@ struct acpi_resource_address64 { }; struct acpi_resource_extended_address64 { - ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID; + ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD; u64 granularity; u64 minimum; u64 maximum; diff --git a/trunk/include/acpi/actbl.h b/trunk/include/acpi/actbl.h index 59a73e1b2845..8dea54665dcf 100644 --- a/trunk/include/acpi/actbl.h +++ b/trunk/include/acpi/actbl.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -212,7 +212,7 @@ struct acpi_table_fadt { u32 smi_command; /* 32-bit Port address of SMI command port */ u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ - u8 s4_bios_request; /* Value to write to SMI CMD to enter S4BIOS state */ + u8 S4bios_request; /* Value to write to SMI CMD to enter S4BIOS state */ u8 pstate_control; /* Processor performance state control */ u32 pm1a_event_block; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */ u32 pm1b_event_block; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */ @@ -230,8 +230,8 @@ struct acpi_table_fadt { u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */ u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */ u8 cst_control; /* Support for the _CST object and C States change notification */ - u16 c2_latency; /* Worst case HW latency to enter/exit C2 state */ - u16 c3_latency; /* Worst case HW latency to enter/exit C3 state */ + u16 C2latency; /* Worst case HW latency to enter/exit C2 state */ + u16 C3latency; /* Worst case HW latency to enter/exit C3 state */ u16 flush_size; /* Processor's memory cache line width, in bytes */ u16 flush_stride; /* Number of flush strides that need to be read */ u8 duty_offset; /* Processor duty cycle index in processor's P_CNT reg */ @@ -291,7 +291,7 @@ struct acpi_table_fadt { #define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: [V4] Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ #define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ -#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */ +#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */ #define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */ #define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */ diff --git a/trunk/include/acpi/actbl1.h b/trunk/include/acpi/actbl1.h index 300d14e7c5d5..71e747beac8f 100644 --- a/trunk/include/acpi/actbl1.h +++ b/trunk/include/acpi/actbl1.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -676,7 +676,7 @@ struct acpi_madt_local_apic { struct acpi_madt_io_apic { struct acpi_subtable_header header; u8 id; /* I/O APIC ID */ - u8 reserved; /* reserved - must be zero */ + u8 reserved; /* Reserved - must be zero */ u32 address; /* APIC physical address */ u32 global_irq_base; /* Global system interrupt where INTI lines start */ }; @@ -794,11 +794,11 @@ struct acpi_madt_generic_interrupt { struct acpi_madt_generic_distributor { struct acpi_subtable_header header; - u16 reserved; /* reserved - must be zero */ + u16 reserved; /* Reserved - must be zero */ u32 gic_id; u64 base_address; u32 global_irq_base; - u32 reserved2; /* reserved - must be zero */ + u32 reserved2; /* Reserved - must be zero */ }; /* @@ -841,7 +841,7 @@ struct acpi_table_msct { u64 max_address; /* Max physical address in system */ }; -/* subtable - Maximum Proximity Domain Information. Version 1 */ +/* Subtable - Maximum Proximity Domain Information. Version 1 */ struct acpi_msct_proximity { u8 revision; diff --git a/trunk/include/acpi/actbl2.h b/trunk/include/acpi/actbl2.h index d9ceb3d31629..58bdd0545c5a 100644 --- a/trunk/include/acpi/actbl2.h +++ b/trunk/include/acpi/actbl2.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ -#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */ +#define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */ #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ @@ -334,8 +334,8 @@ struct acpi_dmar_reserved_memory { struct acpi_dmar_header header; u16 reserved; u16 segment; - u64 base_address; /* 4K aligned base address */ - u64 end_address; /* 4K aligned limit address */ + u64 base_address; /* 4_k aligned base address */ + u64 end_address; /* 4_k aligned limit address */ }; /* Masks for Flags field above */ @@ -565,7 +565,7 @@ struct acpi_ivrs_hardware { /* Masks for Info field above */ #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */ -#define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_ID */ +#define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_iD */ /* * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure. diff --git a/trunk/include/acpi/actbl3.h b/trunk/include/acpi/actbl3.h index f65a0ed869eb..c22ce80e9535 100644 --- a/trunk/include/acpi/actbl3.h +++ b/trunk/include/acpi/actbl3.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/trunk/include/acpi/actypes.h b/trunk/include/acpi/actypes.h index 3d00bd5bd7e3..e8bcc4742e0e 100644 --- a/trunk/include/acpi/actypes.h +++ b/trunk/include/acpi/actypes.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -173,7 +173,7 @@ typedef u64 acpi_physical_address; * to indicate that special precautions must be taken to avoid alignment faults. * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) * - * Note: EM64T and other X86-64 processors support misaligned transfers, + * Note: Em64_t and other X86-64 processors support misaligned transfers, * so there is no need to define this flag. */ #if defined (__IA64__) || defined (__ia64__) @@ -636,7 +636,7 @@ typedef u32 acpi_event_type; #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 /* - * Event status - Per event + * Event Status - Per event * ------------- * The encoding of acpi_event_status is illustrated below. * Note that a set bit (1) indicates the property is TRUE @@ -706,14 +706,10 @@ typedef u32 acpi_event_status; #define ACPI_DEVICE_NOTIFY 0x2 #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 -#define ACPI_NUM_NOTIFY_TYPES 2 #define ACPI_MAX_SYS_NOTIFY 0x7F #define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF -#define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */ -#define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */ - /* Address Space (Operation Region) Types */ typedef u8 acpi_adr_space_type; @@ -728,9 +724,8 @@ typedef u8 acpi_adr_space_type; #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 #define ACPI_ADR_SPACE_GPIO (acpi_adr_space_type) 8 #define ACPI_ADR_SPACE_GSBUS (acpi_adr_space_type) 9 -#define ACPI_ADR_SPACE_PLATFORM_COMM (acpi_adr_space_type) 10 -#define ACPI_NUM_PREDEFINED_REGIONS 11 +#define ACPI_NUM_PREDEFINED_REGIONS 10 /* * Special Address Spaces @@ -803,7 +798,7 @@ typedef u8 acpi_adr_space_type; /* Sleep function dispatch */ -typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state); +typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state, u8 flags); struct acpi_sleep_functions { ACPI_SLEEP_FUNCTION legacy_function; diff --git a/trunk/include/acpi/platform/acenv.h b/trunk/include/acpi/platform/acenv.h index 560a9f272f34..5af3ed52ef98 100644 --- a/trunk/include/acpi/platform/acenv.h +++ b/trunk/include/acpi/platform/acenv.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/trunk/include/acpi/platform/acgcc.h b/trunk/include/acpi/platform/acgcc.h index 72553b0c9f33..e228893591a9 100644 --- a/trunk/include/acpi/platform/acgcc.h +++ b/trunk/include/acpi/platform/acgcc.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/trunk/include/acpi/platform/aclinux.h b/trunk/include/acpi/platform/aclinux.h index 7509be30ca01..6fbc4cab5834 100644 --- a/trunk/include/acpi/platform/aclinux.h +++ b/trunk/include/acpi/platform/aclinux.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/trunk/include/linux/acpi.h b/trunk/include/linux/acpi.h index b2b4d2ad7103..f421dd84f29d 100644 --- a/trunk/include/linux/acpi.h +++ b/trunk/include/linux/acpi.h @@ -277,7 +277,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); #define OSC_SB_PAD_SUPPORT 1 #define OSC_SB_PPC_OST_SUPPORT 2 #define OSC_SB_PR3_SUPPORT 4 -#define OSC_SB_HOTPLUG_OST_SUPPORT 8 +#define OSC_SB_CPUHP_OST_SUPPORT 8 #define OSC_SB_APEI_SUPPORT 16 extern bool osc_sb_apei_support_acked; @@ -309,44 +309,6 @@ extern bool osc_sb_apei_support_acked; extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req); - -/* Enable _OST when all relevant hotplug operations are enabled */ -#if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ - (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ - defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \ - (defined(CONFIG_ACPI_CONTAINER) || \ - defined(CONFIG_ACPI_CONTAINER_MODULE)) -#define ACPI_HOTPLUG_OST -#endif - -/* _OST Source Event Code (OSPM Action) */ -#define ACPI_OST_EC_OSPM_SHUTDOWN 0x100 -#define ACPI_OST_EC_OSPM_EJECT 0x103 -#define ACPI_OST_EC_OSPM_INSERTION 0x200 - -/* _OST General Processing Status Code */ -#define ACPI_OST_SC_SUCCESS 0x0 -#define ACPI_OST_SC_NON_SPECIFIC_FAILURE 0x1 -#define ACPI_OST_SC_UNRECOGNIZED_NOTIFY 0x2 - -/* _OST OS Shutdown Processing (0x100) Status Code */ -#define ACPI_OST_SC_OS_SHUTDOWN_DENIED 0x80 -#define ACPI_OST_SC_OS_SHUTDOWN_IN_PROGRESS 0x81 -#define ACPI_OST_SC_OS_SHUTDOWN_COMPLETED 0x82 -#define ACPI_OST_SC_OS_SHUTDOWN_NOT_SUPPORTED 0x83 - -/* _OST Ejection Request (0x3, 0x103) Status Code */ -#define ACPI_OST_SC_EJECT_NOT_SUPPORTED 0x80 -#define ACPI_OST_SC_DEVICE_IN_USE 0x81 -#define ACPI_OST_SC_DEVICE_BUSY 0x82 -#define ACPI_OST_SC_EJECT_DEPENDENCY_BUSY 0x83 -#define ACPI_OST_SC_EJECT_IN_PROGRESS 0x84 - -/* _OST Insertion Request (0x200) Status Code */ -#define ACPI_OST_SC_INSERT_IN_PROGRESS 0x80 -#define ACPI_OST_SC_DRIVER_LOAD_FAILURE 0x81 -#define ACPI_OST_SC_INSERT_NOT_SUPPORTED 0x82 - extern void acpi_early_init(void); extern int acpi_nvs_register(__u64 start, __u64 size); diff --git a/trunk/include/linux/cpuidle.h b/trunk/include/linux/cpuidle.h index 5ab7183313ce..6c26a3da0e03 100644 --- a/trunk/include/linux/cpuidle.h +++ b/trunk/include/linux/cpuidle.h @@ -57,7 +57,6 @@ struct cpuidle_state { /* Idle State Flags */ #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ -#define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */ #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) @@ -101,12 +100,6 @@ struct cpuidle_device { struct list_head device_list; struct kobject kobj; struct completion kobj_unregister; - -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED - int safe_state_index; - cpumask_t coupled_cpus; - struct cpuidle_coupled *coupled; -#endif }; DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); @@ -183,10 +176,6 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; } #endif -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED -void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a); -#endif - /****************************** * CPUIDLE GOVERNOR INTERFACE * ******************************/ diff --git a/trunk/include/linux/platform_data/spear_thermal.h b/trunk/include/linux/platform_data/spear_thermal.h new file mode 100644 index 000000000000..724f2e1cbbcb --- /dev/null +++ b/trunk/include/linux/platform_data/spear_thermal.h @@ -0,0 +1,26 @@ +/* + * SPEAr thermal driver platform data. + * + * Copyright (C) 2011-2012 ST Microelectronics + * Author: Vincenzo Frascino + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * 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. + * + */ +#ifndef SPEAR_THERMAL_H +#define SPEAR_THERMAL_H + +/* SPEAr Thermal Sensor Platform Data */ +struct spear_thermal_pdata { + /* flags used to enable thermal sensor */ + unsigned int thermal_flags; +}; + +#endif /* SPEAR_THERMAL_H */ diff --git a/trunk/include/linux/thermal.h b/trunk/include/linux/thermal.h index cfc8d908892e..796f1ff0388c 100644 --- a/trunk/include/linux/thermal.h +++ b/trunk/include/linux/thermal.h @@ -58,12 +58,6 @@ struct thermal_zone_device_ops { enum thermal_trip_type *); int (*get_trip_temp) (struct thermal_zone_device *, int, unsigned long *); - int (*set_trip_temp) (struct thermal_zone_device *, int, - unsigned long); - int (*get_trip_hyst) (struct thermal_zone_device *, int, - unsigned long *); - int (*set_trip_hyst) (struct thermal_zone_device *, int, - unsigned long); int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); int (*notify) (struct thermal_zone_device *, int, enum thermal_trip_type); @@ -91,18 +85,10 @@ struct thermal_cooling_device { ((long)t-2732+5)/10 : ((long)t-2732-5)/10) #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) -struct thermal_attr { - struct device_attribute attr; - char name[THERMAL_NAME_LENGTH]; -}; - struct thermal_zone_device { int id; char type[THERMAL_NAME_LENGTH]; struct device device; - struct thermal_attr *trip_temp_attrs; - struct thermal_attr *trip_type_attrs; - struct thermal_attr *trip_hyst_attrs; void *devdata; int trips; int tc1; @@ -151,9 +137,9 @@ enum { }; #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) -struct thermal_zone_device *thermal_zone_device_register(char *, int, int, - void *, const struct thermal_zone_device_ops *, int tc1, - int tc2, int passive_freq, int polling_freq); +struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, + const struct thermal_zone_device_ops *, int tc1, int tc2, + int passive_freq, int polling_freq); void thermal_zone_device_unregister(struct thermal_zone_device *); int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, diff --git a/trunk/tools/power/x86/turbostat/Makefile b/trunk/tools/power/x86/turbostat/Makefile index f85649554191..fd8e1f1297aa 100644 --- a/trunk/tools/power/x86/turbostat/Makefile +++ b/trunk/tools/power/x86/turbostat/Makefile @@ -1,5 +1,4 @@ turbostat : turbostat.c -CFLAGS += -Wall clean : rm -f turbostat diff --git a/trunk/tools/power/x86/turbostat/turbostat.8 b/trunk/tools/power/x86/turbostat/turbostat.8 index 74e44507dfe9..adf175f61496 100644 --- a/trunk/tools/power/x86/turbostat/turbostat.8 +++ b/trunk/tools/power/x86/turbostat/turbostat.8 @@ -27,11 +27,7 @@ supports an "invariant" TSC, plus the APERF and MPERF MSRs. on processors that additionally support C-state residency counters. .SS Options -The \fB-s\fP option limits output to a 1-line system summary for each interval. -.PP -The \fB-c\fP option limits output to the 1st thread in each core. -.PP -The \fB-p\fP option limits output to the 1st thread in each package. +The \fB-s\fP option prints only a 1-line summary for each sample interval. .PP The \fB-v\fP option increases verbosity. .PP @@ -69,19 +65,19 @@ Subsequent rows show per-CPU statistics. .nf [root@x980]# ./turbostat cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6 - 0.09 1.62 3.38 1.83 0.32 97.76 1.26 83.61 - 0 0 0.15 1.62 3.38 10.23 0.05 89.56 1.26 83.61 - 0 6 0.05 1.62 3.38 10.34 - 1 2 0.03 1.62 3.38 0.07 0.05 99.86 - 1 8 0.03 1.62 3.38 0.06 - 2 4 0.21 1.62 3.38 0.10 1.49 98.21 - 2 10 0.02 1.62 3.38 0.29 - 8 1 0.04 1.62 3.38 0.04 0.08 99.84 - 8 7 0.01 1.62 3.38 0.06 - 9 3 0.53 1.62 3.38 0.10 0.20 99.17 - 9 9 0.02 1.62 3.38 0.60 - 10 5 0.01 1.62 3.38 0.02 0.04 99.92 - 10 11 0.02 1.62 3.38 0.02 + 0.60 1.63 3.38 2.91 0.00 96.49 0.00 76.64 + 0 0 0.59 1.62 3.38 4.51 0.00 94.90 0.00 76.64 + 0 6 1.13 1.64 3.38 3.97 0.00 94.90 0.00 76.64 + 1 2 0.08 1.62 3.38 0.07 0.00 99.85 0.00 76.64 + 1 8 0.03 1.62 3.38 0.12 0.00 99.85 0.00 76.64 + 2 4 0.01 1.62 3.38 0.06 0.00 99.93 0.00 76.64 + 2 10 0.04 1.62 3.38 0.02 0.00 99.93 0.00 76.64 + 8 1 2.85 1.62 3.38 11.71 0.00 85.44 0.00 76.64 + 8 7 1.98 1.62 3.38 12.58 0.00 85.44 0.00 76.64 + 9 3 0.36 1.62 3.38 0.71 0.00 98.93 0.00 76.64 + 9 9 0.09 1.62 3.38 0.98 0.00 98.93 0.00 76.64 + 10 5 0.03 1.62 3.38 0.09 0.00 99.87 0.00 76.64 + 10 11 0.07 1.62 3.38 0.06 0.00 99.87 0.00 76.64 .fi .SH SUMMARY EXAMPLE The "-s" option prints the column headers just once, @@ -90,10 +86,9 @@ and then the one line system summary for each sample interval. .nf [root@x980]# ./turbostat -s %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6 - 0.23 1.67 3.38 2.00 0.30 97.47 1.07 82.12 - 0.10 1.62 3.38 1.87 2.25 95.77 12.02 72.60 - 0.20 1.64 3.38 1.98 0.11 97.72 0.30 83.36 - 0.11 1.70 3.38 1.86 1.81 96.22 9.71 74.90 + 0.61 1.89 3.38 5.95 0.00 93.44 0.00 66.33 + 0.52 1.62 3.38 6.83 0.00 92.65 0.00 61.11 + 0.62 1.92 3.38 5.47 0.00 93.91 0.00 67.31 .fi .SH VERBOSE EXAMPLE The "-v" option adds verbosity to the output: @@ -125,28 +120,30 @@ until ^C while the other CPUs are mostly idle: [root@x980 lenb]# ./turbostat cat /dev/zero > /dev/null ^C cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6 - 8.86 3.61 3.38 15.06 31.19 44.89 0.00 0.00 - 0 0 1.46 3.22 3.38 16.84 29.48 52.22 0.00 0.00 - 0 6 0.21 3.06 3.38 18.09 - 1 2 0.53 3.33 3.38 2.80 46.40 50.27 - 1 8 0.89 3.47 3.38 2.44 - 2 4 1.36 3.43 3.38 9.04 23.71 65.89 - 2 10 0.18 2.86 3.38 10.22 - 8 1 0.04 2.87 3.38 99.96 0.01 0.00 - 8 7 99.72 3.63 3.38 0.27 - 9 3 0.31 3.21 3.38 7.64 56.55 35.50 - 9 9 0.08 2.95 3.38 7.88 - 10 5 1.42 3.43 3.38 2.14 30.99 65.44 - 10 11 0.16 2.88 3.38 3.40 + 8.63 3.64 3.38 14.46 0.49 76.42 0.00 0.00 + 0 0 0.34 3.36 3.38 99.66 0.00 0.00 0.00 0.00 + 0 6 99.96 3.64 3.38 0.04 0.00 0.00 0.00 0.00 + 1 2 0.14 3.50 3.38 1.75 2.04 96.07 0.00 0.00 + 1 8 0.38 3.57 3.38 1.51 2.04 96.07 0.00 0.00 + 2 4 0.01 2.65 3.38 0.06 0.00 99.93 0.00 0.00 + 2 10 0.03 2.12 3.38 0.04 0.00 99.93 0.00 0.00 + 8 1 0.91 3.59 3.38 35.27 0.92 62.90 0.00 0.00 + 8 7 1.61 3.63 3.38 34.57 0.92 62.90 0.00 0.00 + 9 3 0.04 3.38 3.38 0.20 0.00 99.76 0.00 0.00 + 9 9 0.04 3.29 3.38 0.20 0.00 99.76 0.00 0.00 + 10 5 0.03 3.08 3.38 0.12 0.00 99.85 0.00 0.00 + 10 11 0.05 3.07 3.38 0.10 0.00 99.85 0.00 0.00 +4.907015 sec + .fi -Above the cycle soaker drives cpu7 up its 3.6 Ghz turbo limit +Above the cycle soaker drives cpu6 up 3.6 Ghz turbo limit while the other processors are generally in various states of idle. -Note that cpu1 and cpu7 are HT siblings within core8. -As cpu7 is very busy, it prevents its sibling, cpu1, -from entering a c-state deeper than c1. +Note that cpu0 is an HT sibling sharing core0 +with cpu6, and thus it is unable to get to an idle state +deeper than c1 while cpu6 is busy. -Note that turbostat reports average GHz of 3.63, while +Note that turbostat reports average GHz of 3.64, while the arithmetic average of the GHz column above is lower. This is a weighted average, where the weight is %c0. ie. it is the total number of un-halted cycles elapsed per time divided by the number of CPUs. diff --git a/trunk/tools/power/x86/turbostat/turbostat.c b/trunk/tools/power/x86/turbostat/turbostat.c index 861d77190206..16de7ad4850f 100644 --- a/trunk/tools/power/x86/turbostat/turbostat.c +++ b/trunk/tools/power/x86/turbostat/turbostat.c @@ -67,119 +67,92 @@ double bclk; unsigned int show_pkg; unsigned int show_core; unsigned int show_cpu; -unsigned int show_pkg_only; -unsigned int show_core_only; -char *output_buffer, *outp; int aperf_mperf_unstable; int backwards_count; char *progname; -cpu_set_t *cpu_present_set, *cpu_affinity_set; -size_t cpu_present_setsize, cpu_affinity_setsize; - -struct thread_data { - unsigned long long tsc; - unsigned long long aperf; - unsigned long long mperf; - unsigned long long c1; /* derived */ - unsigned long long extra_msr; - unsigned int cpu_id; - unsigned int flags; -#define CPU_IS_FIRST_THREAD_IN_CORE 0x2 -#define CPU_IS_FIRST_CORE_IN_PACKAGE 0x4 -} *thread_even, *thread_odd; - -struct core_data { - unsigned long long c3; - unsigned long long c6; - unsigned long long c7; - unsigned int core_id; -} *core_even, *core_odd; - -struct pkg_data { - unsigned long long pc2; - unsigned long long pc3; - unsigned long long pc6; - unsigned long long pc7; - unsigned int package_id; -} *package_even, *package_odd; - -#define ODD_COUNTERS thread_odd, core_odd, package_odd -#define EVEN_COUNTERS thread_even, core_even, package_even - -#define GET_THREAD(thread_base, thread_no, core_no, pkg_no) \ - (thread_base + (pkg_no) * topo.num_cores_per_pkg * \ - topo.num_threads_per_core + \ - (core_no) * topo.num_threads_per_core + (thread_no)) -#define GET_CORE(core_base, core_no, pkg_no) \ - (core_base + (pkg_no) * topo.num_cores_per_pkg + (core_no)) -#define GET_PKG(pkg_base, pkg_no) (pkg_base + pkg_no) - -struct system_summary { - struct thread_data threads; - struct core_data cores; - struct pkg_data packages; -} sum, average; - - -struct topo_params { - int num_packages; - int num_cpus; - int num_cores; - int max_cpu_num; - int num_cores_per_pkg; - int num_threads_per_core; -} topo; - -struct timeval tv_even, tv_odd, tv_delta; - -void setup_all_buffers(void); - -int cpu_is_not_present(int cpu) +int num_cpus; +cpu_set_t *cpu_present_set, *cpu_mask; +size_t cpu_present_setsize, cpu_mask_size; + +struct counters { + unsigned long long tsc; /* per thread */ + unsigned long long aperf; /* per thread */ + unsigned long long mperf; /* per thread */ + unsigned long long c1; /* per thread (calculated) */ + unsigned long long c3; /* per core */ + unsigned long long c6; /* per core */ + unsigned long long c7; /* per core */ + unsigned long long pc2; /* per package */ + unsigned long long pc3; /* per package */ + unsigned long long pc6; /* per package */ + unsigned long long pc7; /* per package */ + unsigned long long extra_msr; /* per thread */ + int pkg; + int core; + int cpu; + struct counters *next; +}; + +struct counters *cnt_even; +struct counters *cnt_odd; +struct counters *cnt_delta; +struct counters *cnt_average; +struct timeval tv_even; +struct timeval tv_odd; +struct timeval tv_delta; + +int mark_cpu_present(int pkg, int core, int cpu) { - return !CPU_ISSET_S(cpu, cpu_present_setsize, cpu_present_set); + CPU_SET_S(cpu, cpu_present_setsize, cpu_present_set); + return 0; } + /* - * run func(thread, core, package) in topology order - * skip non-present cpus + * cpu_mask_init(ncpus) + * + * allocate and clear cpu_mask + * set cpu_mask_size */ - -int for_all_cpus(int (func)(struct thread_data *, struct core_data *, struct pkg_data *), - struct thread_data *thread_base, struct core_data *core_base, struct pkg_data *pkg_base) +void cpu_mask_init(int ncpus) { - int retval, pkg_no, core_no, thread_no; - - for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) { - for (core_no = 0; core_no < topo.num_cores_per_pkg; ++core_no) { - for (thread_no = 0; thread_no < - topo.num_threads_per_core; ++thread_no) { - struct thread_data *t; - struct core_data *c; - struct pkg_data *p; - - t = GET_THREAD(thread_base, thread_no, core_no, pkg_no); - - if (cpu_is_not_present(t->cpu_id)) - continue; - - c = GET_CORE(core_base, core_no, pkg_no); - p = GET_PKG(pkg_base, pkg_no); + cpu_mask = CPU_ALLOC(ncpus); + if (cpu_mask == NULL) { + perror("CPU_ALLOC"); + exit(3); + } + cpu_mask_size = CPU_ALLOC_SIZE(ncpus); + CPU_ZERO_S(cpu_mask_size, cpu_mask); - retval = func(t, c, p); - if (retval) - return retval; - } - } + /* + * Allocate and initialize cpu_present_set + */ + cpu_present_set = CPU_ALLOC(ncpus); + if (cpu_present_set == NULL) { + perror("CPU_ALLOC"); + exit(3); } - return 0; + cpu_present_setsize = CPU_ALLOC_SIZE(ncpus); + CPU_ZERO_S(cpu_present_setsize, cpu_present_set); + for_all_cpus(mark_cpu_present); +} + +void cpu_mask_uninit() +{ + CPU_FREE(cpu_mask); + cpu_mask = NULL; + cpu_mask_size = 0; + CPU_FREE(cpu_present_set); + cpu_present_set = NULL; + cpu_present_setsize = 0; } int cpu_migrate(int cpu) { - CPU_ZERO_S(cpu_affinity_setsize, cpu_affinity_set); - CPU_SET_S(cpu, cpu_affinity_setsize, cpu_affinity_set); - if (sched_setaffinity(0, cpu_affinity_setsize, cpu_affinity_set) == -1) + CPU_ZERO_S(cpu_mask_size, cpu_mask); + CPU_SET_S(cpu, cpu_mask_size, cpu_mask); + if (sched_setaffinity(0, cpu_mask_size, cpu_mask) == -1) return -1; else return 0; @@ -208,72 +181,67 @@ int get_msr(int cpu, off_t offset, unsigned long long *msr) void print_header(void) { if (show_pkg) - outp += sprintf(outp, "pk"); + fprintf(stderr, "pk"); if (show_pkg) - outp += sprintf(outp, " "); + fprintf(stderr, " "); if (show_core) - outp += sprintf(outp, "cor"); + fprintf(stderr, "cor"); if (show_cpu) - outp += sprintf(outp, " CPU"); + fprintf(stderr, " CPU"); if (show_pkg || show_core || show_cpu) - outp += sprintf(outp, " "); + fprintf(stderr, " "); if (do_nhm_cstates) - outp += sprintf(outp, " %%c0"); + fprintf(stderr, " %%c0"); if (has_aperf) - outp += sprintf(outp, " GHz"); - outp += sprintf(outp, " TSC"); + fprintf(stderr, " GHz"); + fprintf(stderr, " TSC"); if (do_nhm_cstates) - outp += sprintf(outp, " %%c1"); + fprintf(stderr, " %%c1"); if (do_nhm_cstates) - outp += sprintf(outp, " %%c3"); + fprintf(stderr, " %%c3"); if (do_nhm_cstates) - outp += sprintf(outp, " %%c6"); + fprintf(stderr, " %%c6"); if (do_snb_cstates) - outp += sprintf(outp, " %%c7"); + fprintf(stderr, " %%c7"); if (do_snb_cstates) - outp += sprintf(outp, " %%pc2"); + fprintf(stderr, " %%pc2"); if (do_nhm_cstates) - outp += sprintf(outp, " %%pc3"); + fprintf(stderr, " %%pc3"); if (do_nhm_cstates) - outp += sprintf(outp, " %%pc6"); + fprintf(stderr, " %%pc6"); if (do_snb_cstates) - outp += sprintf(outp, " %%pc7"); + fprintf(stderr, " %%pc7"); if (extra_msr_offset) - outp += sprintf(outp, " MSR 0x%x ", extra_msr_offset); + fprintf(stderr, " MSR 0x%x ", extra_msr_offset); - outp += sprintf(outp, "\n"); + putc('\n', stderr); } -int dump_counters(struct thread_data *t, struct core_data *c, - struct pkg_data *p) +void dump_cnt(struct counters *cnt) { - fprintf(stderr, "t %p, c %p, p %p\n", t, c, p); - - if (t) { - fprintf(stderr, "CPU: %d flags 0x%x\n", t->cpu_id, t->flags); - fprintf(stderr, "TSC: %016llX\n", t->tsc); - fprintf(stderr, "aperf: %016llX\n", t->aperf); - fprintf(stderr, "mperf: %016llX\n", t->mperf); - fprintf(stderr, "c1: %016llX\n", t->c1); - fprintf(stderr, "msr0x%x: %016llX\n", - extra_msr_offset, t->extra_msr); - } + if (!cnt) + return; + if (cnt->pkg) fprintf(stderr, "package: %d ", cnt->pkg); + if (cnt->core) fprintf(stderr, "core:: %d ", cnt->core); + if (cnt->cpu) fprintf(stderr, "CPU: %d ", cnt->cpu); + if (cnt->tsc) fprintf(stderr, "TSC: %016llX\n", cnt->tsc); + if (cnt->c3) fprintf(stderr, "c3: %016llX\n", cnt->c3); + if (cnt->c6) fprintf(stderr, "c6: %016llX\n", cnt->c6); + if (cnt->c7) fprintf(stderr, "c7: %016llX\n", cnt->c7); + if (cnt->aperf) fprintf(stderr, "aperf: %016llX\n", cnt->aperf); + if (cnt->pc2) fprintf(stderr, "pc2: %016llX\n", cnt->pc2); + if (cnt->pc3) fprintf(stderr, "pc3: %016llX\n", cnt->pc3); + if (cnt->pc6) fprintf(stderr, "pc6: %016llX\n", cnt->pc6); + if (cnt->pc7) fprintf(stderr, "pc7: %016llX\n", cnt->pc7); + if (cnt->extra_msr) fprintf(stderr, "msr0x%x: %016llX\n", extra_msr_offset, cnt->extra_msr); +} - if (c) { - fprintf(stderr, "core: %d\n", c->core_id); - fprintf(stderr, "c3: %016llX\n", c->c3); - fprintf(stderr, "c6: %016llX\n", c->c6); - fprintf(stderr, "c7: %016llX\n", c->c7); - } +void dump_list(struct counters *cnt) +{ + printf("dump_list 0x%p\n", cnt); - if (p) { - fprintf(stderr, "package: %d\n", p->package_id); - fprintf(stderr, "pc2: %016llX\n", p->pc2); - fprintf(stderr, "pc3: %016llX\n", p->pc3); - fprintf(stderr, "pc6: %016llX\n", p->pc6); - fprintf(stderr, "pc7: %016llX\n", p->pc7); - } - return 0; + for (; cnt; cnt = cnt->next) + dump_cnt(cnt); } /* @@ -285,389 +253,321 @@ int dump_counters(struct thread_data *t, struct core_data *c, * TSC: "TSC" 3 columns %3.2 * percentage " %pc3" %6.2 */ -int format_counters(struct thread_data *t, struct core_data *c, - struct pkg_data *p) +void print_cnt(struct counters *p) { double interval_float; - /* if showing only 1st thread in core and this isn't one, bail out */ - if (show_core_only && !(t->flags & CPU_IS_FIRST_THREAD_IN_CORE)) - return 0; - - /* if showing only 1st thread in pkg and this isn't one, bail out */ - if (show_pkg_only && !(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) - return 0; - interval_float = tv_delta.tv_sec + tv_delta.tv_usec/1000000.0; - /* topo columns, print blanks on 1st (average) line */ - if (t == &average.threads) { + /* topology columns, print blanks on 1st (average) line */ + if (p == cnt_average) { if (show_pkg) - outp += sprintf(outp, " "); + fprintf(stderr, " "); if (show_pkg && show_core) - outp += sprintf(outp, " "); + fprintf(stderr, " "); if (show_core) - outp += sprintf(outp, " "); + fprintf(stderr, " "); if (show_cpu) - outp += sprintf(outp, " " " "); + fprintf(stderr, " " " "); } else { - if (show_pkg) { - if (p) - outp += sprintf(outp, "%2d", p->package_id); - else - outp += sprintf(outp, " "); - } + if (show_pkg) + fprintf(stderr, "%2d", p->pkg); if (show_pkg && show_core) - outp += sprintf(outp, " "); - if (show_core) { - if (c) - outp += sprintf(outp, "%3d", c->core_id); - else - outp += sprintf(outp, " "); - } + fprintf(stderr, " "); + if (show_core) + fprintf(stderr, "%3d", p->core); if (show_cpu) - outp += sprintf(outp, " %3d", t->cpu_id); + fprintf(stderr, " %3d", p->cpu); } /* %c0 */ if (do_nhm_cstates) { if (show_pkg || show_core || show_cpu) - outp += sprintf(outp, " "); + fprintf(stderr, " "); if (!skip_c0) - outp += sprintf(outp, "%6.2f", 100.0 * t->mperf/t->tsc); + fprintf(stderr, "%6.2f", 100.0 * p->mperf/p->tsc); else - outp += sprintf(outp, " ****"); + fprintf(stderr, " ****"); } /* GHz */ if (has_aperf) { if (!aperf_mperf_unstable) { - outp += sprintf(outp, " %3.2f", - 1.0 * t->tsc / units * t->aperf / - t->mperf / interval_float); + fprintf(stderr, " %3.2f", + 1.0 * p->tsc / units * p->aperf / + p->mperf / interval_float); } else { - if (t->aperf > t->tsc || t->mperf > t->tsc) { - outp += sprintf(outp, " ***"); + if (p->aperf > p->tsc || p->mperf > p->tsc) { + fprintf(stderr, " ***"); } else { - outp += sprintf(outp, "%3.1f*", - 1.0 * t->tsc / - units * t->aperf / - t->mperf / interval_float); + fprintf(stderr, "%3.1f*", + 1.0 * p->tsc / + units * p->aperf / + p->mperf / interval_float); } } } /* TSC */ - outp += sprintf(outp, "%5.2f", 1.0 * t->tsc/units/interval_float); + fprintf(stderr, "%5.2f", 1.0 * p->tsc/units/interval_float); if (do_nhm_cstates) { if (!skip_c1) - outp += sprintf(outp, " %6.2f", 100.0 * t->c1/t->tsc); + fprintf(stderr, " %6.2f", 100.0 * p->c1/p->tsc); else - outp += sprintf(outp, " ****"); + fprintf(stderr, " ****"); } - - /* print per-core data only for 1st thread in core */ - if (!(t->flags & CPU_IS_FIRST_THREAD_IN_CORE)) - goto done; - if (do_nhm_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * c->c3/t->tsc); + fprintf(stderr, " %6.2f", 100.0 * p->c3/p->tsc); if (do_nhm_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * c->c6/t->tsc); + fprintf(stderr, " %6.2f", 100.0 * p->c6/p->tsc); if (do_snb_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * c->c7/t->tsc); - - /* print per-package data only for 1st core in package */ - if (!(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) - goto done; - + fprintf(stderr, " %6.2f", 100.0 * p->c7/p->tsc); if (do_snb_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * p->pc2/t->tsc); + fprintf(stderr, " %6.2f", 100.0 * p->pc2/p->tsc); if (do_nhm_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * p->pc3/t->tsc); + fprintf(stderr, " %6.2f", 100.0 * p->pc3/p->tsc); if (do_nhm_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * p->pc6/t->tsc); + fprintf(stderr, " %6.2f", 100.0 * p->pc6/p->tsc); if (do_snb_cstates) - outp += sprintf(outp, " %6.2f", 100.0 * p->pc7/t->tsc); -done: + fprintf(stderr, " %6.2f", 100.0 * p->pc7/p->tsc); if (extra_msr_offset) - outp += sprintf(outp, " 0x%016llx", t->extra_msr); - outp += sprintf(outp, "\n"); - - return 0; + fprintf(stderr, " 0x%016llx", p->extra_msr); + putc('\n', stderr); } -void flush_stdout() -{ - fputs(output_buffer, stdout); - outp = output_buffer; -} -void flush_stderr() -{ - fputs(output_buffer, stderr); - outp = output_buffer; -} -void format_all_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) +void print_counters(struct counters *counters) { + struct counters *cnt; static int printed; + if (!printed || !summary_only) print_header(); - if (topo.num_cpus > 1) - format_counters(&average.threads, &average.cores, - &average.packages); + if (num_cpus > 1) + print_cnt(cnt_average); printed = 1; if (summary_only) return; - for_all_cpus(format_counters, t, c, p); -} + for (cnt = counters; cnt != NULL; cnt = cnt->next) + print_cnt(cnt); -void -delta_package(struct pkg_data *new, struct pkg_data *old) -{ - old->pc2 = new->pc2 - old->pc2; - old->pc3 = new->pc3 - old->pc3; - old->pc6 = new->pc6 - old->pc6; - old->pc7 = new->pc7 - old->pc7; } -void -delta_core(struct core_data *new, struct core_data *old) -{ - old->c3 = new->c3 - old->c3; - old->c6 = new->c6 - old->c6; - old->c7 = new->c7 - old->c7; -} +#define SUBTRACT_COUNTER(after, before, delta) (delta = (after - before), (before > after)) -/* - * old = new - old - */ -void -delta_thread(struct thread_data *new, struct thread_data *old, - struct core_data *core_delta) +int compute_delta(struct counters *after, + struct counters *before, struct counters *delta) { - old->tsc = new->tsc - old->tsc; - - /* check for TSC < 1 Mcycles over interval */ - if (old->tsc < (1000 * 1000)) { - fprintf(stderr, "Insanely slow TSC rate, TSC stops in idle?\n"); - fprintf(stderr, "You can disable all c-states by booting with \"idle=poll\"\n"); - fprintf(stderr, "or just the deep ones with \"processor.max_cstate=1\"\n"); - exit(-3); - } + int errors = 0; + int perf_err = 0; - old->c1 = new->c1 - old->c1; + skip_c0 = skip_c1 = 0; - if ((new->aperf > old->aperf) && (new->mperf > old->mperf)) { - old->aperf = new->aperf - old->aperf; - old->mperf = new->mperf - old->mperf; - } else { + for ( ; after && before && delta; + after = after->next, before = before->next, delta = delta->next) { + if (before->cpu != after->cpu) { + printf("cpu configuration changed: %d != %d\n", + before->cpu, after->cpu); + return -1; + } - if (!aperf_mperf_unstable) { - fprintf(stderr, "%s: APERF or MPERF went backwards *\n", progname); - fprintf(stderr, "* Frequency results do not cover entire interval *\n"); - fprintf(stderr, "* fix this by running Linux-2.6.30 or later *\n"); + if (SUBTRACT_COUNTER(after->tsc, before->tsc, delta->tsc)) { + fprintf(stderr, "cpu%d TSC went backwards %llX to %llX\n", + before->cpu, before->tsc, after->tsc); + errors++; + } + /* check for TSC < 1 Mcycles over interval */ + if (delta->tsc < (1000 * 1000)) { + fprintf(stderr, "Insanely slow TSC rate," + " TSC stops in idle?\n"); + fprintf(stderr, "You can disable all c-states" + " by booting with \"idle=poll\"\n"); + fprintf(stderr, "or just the deep ones with" + " \"processor.max_cstate=1\"\n"); + exit(-3); + } + if (SUBTRACT_COUNTER(after->c3, before->c3, delta->c3)) { + fprintf(stderr, "cpu%d c3 counter went backwards %llX to %llX\n", + before->cpu, before->c3, after->c3); + errors++; + } + if (SUBTRACT_COUNTER(after->c6, before->c6, delta->c6)) { + fprintf(stderr, "cpu%d c6 counter went backwards %llX to %llX\n", + before->cpu, before->c6, after->c6); + errors++; + } + if (SUBTRACT_COUNTER(after->c7, before->c7, delta->c7)) { + fprintf(stderr, "cpu%d c7 counter went backwards %llX to %llX\n", + before->cpu, before->c7, after->c7); + errors++; + } + if (SUBTRACT_COUNTER(after->pc2, before->pc2, delta->pc2)) { + fprintf(stderr, "cpu%d pc2 counter went backwards %llX to %llX\n", + before->cpu, before->pc2, after->pc2); + errors++; + } + if (SUBTRACT_COUNTER(after->pc3, before->pc3, delta->pc3)) { + fprintf(stderr, "cpu%d pc3 counter went backwards %llX to %llX\n", + before->cpu, before->pc3, after->pc3); + errors++; + } + if (SUBTRACT_COUNTER(after->pc6, before->pc6, delta->pc6)) { + fprintf(stderr, "cpu%d pc6 counter went backwards %llX to %llX\n", + before->cpu, before->pc6, after->pc6); + errors++; + } + if (SUBTRACT_COUNTER(after->pc7, before->pc7, delta->pc7)) { + fprintf(stderr, "cpu%d pc7 counter went backwards %llX to %llX\n", + before->cpu, before->pc7, after->pc7); + errors++; + } + + perf_err = SUBTRACT_COUNTER(after->aperf, before->aperf, delta->aperf); + if (perf_err) { + fprintf(stderr, "cpu%d aperf counter went backwards %llX to %llX\n", + before->cpu, before->aperf, after->aperf); + } + perf_err |= SUBTRACT_COUNTER(after->mperf, before->mperf, delta->mperf); + if (perf_err) { + fprintf(stderr, "cpu%d mperf counter went backwards %llX to %llX\n", + before->cpu, before->mperf, after->mperf); + } + if (perf_err) { + if (!aperf_mperf_unstable) { + fprintf(stderr, "%s: APERF or MPERF went backwards *\n", progname); + fprintf(stderr, "* Frequency results do not cover entire interval *\n"); + fprintf(stderr, "* fix this by running Linux-2.6.30 or later *\n"); - aperf_mperf_unstable = 1; + aperf_mperf_unstable = 1; + } + /* + * mperf delta is likely a huge "positive" number + * can not use it for calculating c0 time + */ + skip_c0 = 1; + skip_c1 = 1; } + /* - * mperf delta is likely a huge "positive" number - * can not use it for calculating c0 time + * As mperf and tsc collection are not atomic, + * it is possible for mperf's non-halted cycles + * to exceed TSC's all cycles: show c1 = 0% in that case. */ - skip_c0 = 1; - skip_c1 = 1; - } + if (delta->mperf > delta->tsc) + delta->c1 = 0; + else /* normal case, derive c1 */ + delta->c1 = delta->tsc - delta->mperf + - delta->c3 - delta->c6 - delta->c7; + if (delta->mperf == 0) + delta->mperf = 1; /* divide by 0 protection */ - /* - * As counter collection is not atomic, - * it is possible for mperf's non-halted cycles + idle states - * to exceed TSC's all cycles: show c1 = 0% in that case. - */ - if ((old->mperf + core_delta->c3 + core_delta->c6 + core_delta->c7) > old->tsc) - old->c1 = 0; - else { - /* normal case, derive c1 */ - old->c1 = old->tsc - old->mperf - core_delta->c3 - - core_delta->c6 - core_delta->c7; - } - - if (old->mperf == 0) { - if (verbose > 1) fprintf(stderr, "cpu%d MPERF 0!\n", old->cpu_id); - old->mperf = 1; /* divide by 0 protection */ + /* + * for "extra msr", just copy the latest w/o subtracting + */ + delta->extra_msr = after->extra_msr; + if (errors) { + fprintf(stderr, "ERROR cpu%d before:\n", before->cpu); + dump_cnt(before); + fprintf(stderr, "ERROR cpu%d after:\n", before->cpu); + dump_cnt(after); + errors = 0; + } } - - /* - * for "extra msr", just copy the latest w/o subtracting - */ - old->extra_msr = new->extra_msr; -} - -int delta_cpu(struct thread_data *t, struct core_data *c, - struct pkg_data *p, struct thread_data *t2, - struct core_data *c2, struct pkg_data *p2) -{ - /* calculate core delta only for 1st thread in core */ - if (t->flags & CPU_IS_FIRST_THREAD_IN_CORE) - delta_core(c, c2); - - /* always calculate thread delta */ - delta_thread(t, t2, c2); /* c2 is core delta */ - - /* calculate package delta only for 1st core in package */ - if (t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE) - delta_package(p, p2); - return 0; } -void clear_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) -{ - t->tsc = 0; - t->aperf = 0; - t->mperf = 0; - t->c1 = 0; - - /* tells format_counters to dump all fields from this set */ - t->flags = CPU_IS_FIRST_THREAD_IN_CORE | CPU_IS_FIRST_CORE_IN_PACKAGE; - - c->c3 = 0; - c->c6 = 0; - c->c7 = 0; - - p->pc2 = 0; - p->pc3 = 0; - p->pc6 = 0; - p->pc7 = 0; -} -int sum_counters(struct thread_data *t, struct core_data *c, - struct pkg_data *p) +void compute_average(struct counters *delta, struct counters *avg) { - average.threads.tsc += t->tsc; - average.threads.aperf += t->aperf; - average.threads.mperf += t->mperf; - average.threads.c1 += t->c1; - - /* sum per-core values only for 1st thread in core */ - if (!(t->flags & CPU_IS_FIRST_THREAD_IN_CORE)) - return 0; - - average.cores.c3 += c->c3; - average.cores.c6 += c->c6; - average.cores.c7 += c->c7; - - /* sum per-pkg values only for 1st core in pkg */ - if (!(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) - return 0; + struct counters *sum; - average.packages.pc2 += p->pc2; - average.packages.pc3 += p->pc3; - average.packages.pc6 += p->pc6; - average.packages.pc7 += p->pc7; - - return 0; -} -/* - * sum the counters for all cpus in the system - * compute the weighted average - */ -void compute_average(struct thread_data *t, struct core_data *c, - struct pkg_data *p) -{ - clear_counters(&average.threads, &average.cores, &average.packages); - - for_all_cpus(sum_counters, t, c, p); - - average.threads.tsc /= topo.num_cpus; - average.threads.aperf /= topo.num_cpus; - average.threads.mperf /= topo.num_cpus; - average.threads.c1 /= topo.num_cpus; - - average.cores.c3 /= topo.num_cores; - average.cores.c6 /= topo.num_cores; - average.cores.c7 /= topo.num_cores; + sum = calloc(1, sizeof(struct counters)); + if (sum == NULL) { + perror("calloc sum"); + exit(1); + } - average.packages.pc2 /= topo.num_packages; - average.packages.pc3 /= topo.num_packages; - average.packages.pc6 /= topo.num_packages; - average.packages.pc7 /= topo.num_packages; + for (; delta; delta = delta->next) { + sum->tsc += delta->tsc; + sum->c1 += delta->c1; + sum->c3 += delta->c3; + sum->c6 += delta->c6; + sum->c7 += delta->c7; + sum->aperf += delta->aperf; + sum->mperf += delta->mperf; + sum->pc2 += delta->pc2; + sum->pc3 += delta->pc3; + sum->pc6 += delta->pc6; + sum->pc7 += delta->pc7; + } + avg->tsc = sum->tsc/num_cpus; + avg->c1 = sum->c1/num_cpus; + avg->c3 = sum->c3/num_cpus; + avg->c6 = sum->c6/num_cpus; + avg->c7 = sum->c7/num_cpus; + avg->aperf = sum->aperf/num_cpus; + avg->mperf = sum->mperf/num_cpus; + avg->pc2 = sum->pc2/num_cpus; + avg->pc3 = sum->pc3/num_cpus; + avg->pc6 = sum->pc6/num_cpus; + avg->pc7 = sum->pc7/num_cpus; + + free(sum); } -static unsigned long long rdtsc(void) +int get_counters(struct counters *cnt) { - unsigned int low, high; - - asm volatile("rdtsc" : "=a" (low), "=d" (high)); - - return low | ((unsigned long long)high) << 32; -} + for ( ; cnt; cnt = cnt->next) { + if (cpu_migrate(cnt->cpu)) + return -1; -/* - * get_counters(...) - * migrate to cpu - * acquire and record local counters for that cpu - */ -int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) -{ - int cpu = t->cpu_id; - - if (cpu_migrate(cpu)) - return -1; + if (get_msr(cnt->cpu, MSR_TSC, &cnt->tsc)) + return -1; - t->tsc = rdtsc(); /* we are running on local CPU of interest */ - - if (has_aperf) { - if (get_msr(cpu, MSR_APERF, &t->aperf)) - return -3; - if (get_msr(cpu, MSR_MPERF, &t->mperf)) - return -4; - } - - if (extra_msr_offset) - if (get_msr(cpu, extra_msr_offset, &t->extra_msr)) - return -5; - - /* collect core counters only for 1st thread in core */ - if (!(t->flags & CPU_IS_FIRST_THREAD_IN_CORE)) - return 0; - - if (do_nhm_cstates) { - if (get_msr(cpu, MSR_CORE_C3_RESIDENCY, &c->c3)) - return -6; - if (get_msr(cpu, MSR_CORE_C6_RESIDENCY, &c->c6)) - return -7; - } + if (has_aperf) { + if (get_msr(cnt->cpu, MSR_APERF, &cnt->aperf)) + return -1; + if (get_msr(cnt->cpu, MSR_MPERF, &cnt->mperf)) + return -1; + } - if (do_snb_cstates) - if (get_msr(cpu, MSR_CORE_C7_RESIDENCY, &c->c7)) - return -8; + if (do_nhm_cstates) { + if (get_msr(cnt->cpu, MSR_CORE_C3_RESIDENCY, &cnt->c3)) + return -1; + if (get_msr(cnt->cpu, MSR_CORE_C6_RESIDENCY, &cnt->c6)) + return -1; + } - /* collect package counters only for 1st core in package */ - if (!(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) - return 0; + if (do_snb_cstates) + if (get_msr(cnt->cpu, MSR_CORE_C7_RESIDENCY, &cnt->c7)) + return -1; - if (do_nhm_cstates) { - if (get_msr(cpu, MSR_PKG_C3_RESIDENCY, &p->pc3)) - return -9; - if (get_msr(cpu, MSR_PKG_C6_RESIDENCY, &p->pc6)) - return -10; - } - if (do_snb_cstates) { - if (get_msr(cpu, MSR_PKG_C2_RESIDENCY, &p->pc2)) - return -11; - if (get_msr(cpu, MSR_PKG_C7_RESIDENCY, &p->pc7)) - return -12; + if (do_nhm_cstates) { + if (get_msr(cnt->cpu, MSR_PKG_C3_RESIDENCY, &cnt->pc3)) + return -1; + if (get_msr(cnt->cpu, MSR_PKG_C6_RESIDENCY, &cnt->pc6)) + return -1; + } + if (do_snb_cstates) { + if (get_msr(cnt->cpu, MSR_PKG_C2_RESIDENCY, &cnt->pc2)) + return -1; + if (get_msr(cnt->cpu, MSR_PKG_C7_RESIDENCY, &cnt->pc7)) + return -1; + } + if (extra_msr_offset) + if (get_msr(cnt->cpu, extra_msr_offset, &cnt->extra_msr)) + return -1; } return 0; } -void print_verbose_header(void) +void print_nehalem_info(void) { unsigned long long msr; unsigned int ratio; @@ -715,82 +615,143 @@ void print_verbose_header(void) } -void free_all_buffers(void) +void free_counter_list(struct counters *list) { - CPU_FREE(cpu_present_set); - cpu_present_set = NULL; - cpu_present_set = 0; + struct counters *p; - CPU_FREE(cpu_affinity_set); - cpu_affinity_set = NULL; - cpu_affinity_setsize = 0; + for (p = list; p; ) { + struct counters *free_me; - free(thread_even); - free(core_even); - free(package_even); + free_me = p; + p = p->next; + free(free_me); + } +} - thread_even = NULL; - core_even = NULL; - package_even = NULL; +void free_all_counters(void) +{ + free_counter_list(cnt_even); + cnt_even = NULL; - free(thread_odd); - free(core_odd); - free(package_odd); + free_counter_list(cnt_odd); + cnt_odd = NULL; - thread_odd = NULL; - core_odd = NULL; - package_odd = NULL; + free_counter_list(cnt_delta); + cnt_delta = NULL; - free(output_buffer); - output_buffer = NULL; - outp = NULL; + free_counter_list(cnt_average); + cnt_average = NULL; } -/* - * cpu_is_first_sibling_in_core(cpu) - * return 1 if given CPU is 1st HT sibling in the core - */ -int cpu_is_first_sibling_in_core(int cpu) +void insert_counters(struct counters **list, + struct counters *new) { - char path[64]; - FILE *filep; - int first_cpu; + struct counters *prev; - sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu); - filep = fopen(path, "r"); - if (filep == NULL) { - perror(path); - exit(1); + /* + * list was empty + */ + if (*list == NULL) { + new->next = *list; + *list = new; + return; } - fscanf(filep, "%d", &first_cpu); - fclose(filep); - return (cpu == first_cpu); + + if (!summary_only) + show_cpu = 1; /* there is more than one CPU */ + + /* + * insert on front of list. + * It is sorted by ascending package#, core#, cpu# + */ + if (((*list)->pkg > new->pkg) || + (((*list)->pkg == new->pkg) && ((*list)->core > new->core)) || + (((*list)->pkg == new->pkg) && ((*list)->core == new->core) && ((*list)->cpu > new->cpu))) { + new->next = *list; + *list = new; + return; + } + + prev = *list; + + while (prev->next && (prev->next->pkg < new->pkg)) { + prev = prev->next; + if (!summary_only) + show_pkg = 1; /* there is more than 1 package */ + } + + while (prev->next && (prev->next->pkg == new->pkg) + && (prev->next->core < new->core)) { + prev = prev->next; + if (!summary_only) + show_core = 1; /* there is more than 1 core */ + } + + while (prev->next && (prev->next->pkg == new->pkg) + && (prev->next->core == new->core) + && (prev->next->cpu < new->cpu)) { + prev = prev->next; + } + + /* + * insert after "prev" + */ + new->next = prev->next; + prev->next = new; } -/* - * cpu_is_first_core_in_package(cpu) - * return 1 if given CPU is 1st core in package - */ -int cpu_is_first_core_in_package(int cpu) +void alloc_new_counters(int pkg, int core, int cpu) { - char path[64]; - FILE *filep; - int first_cpu; + struct counters *new; - sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/core_siblings_list", cpu); - filep = fopen(path, "r"); - if (filep == NULL) { - perror(path); + if (verbose > 1) + printf("pkg%d core%d, cpu%d\n", pkg, core, cpu); + + new = (struct counters *)calloc(1, sizeof(struct counters)); + if (new == NULL) { + perror("calloc"); exit(1); } - fscanf(filep, "%d", &first_cpu); - fclose(filep); - return (cpu == first_cpu); + new->pkg = pkg; + new->core = core; + new->cpu = cpu; + insert_counters(&cnt_odd, new); + + new = (struct counters *)calloc(1, + sizeof(struct counters)); + if (new == NULL) { + perror("calloc"); + exit(1); + } + new->pkg = pkg; + new->core = core; + new->cpu = cpu; + insert_counters(&cnt_even, new); + + new = (struct counters *)calloc(1, sizeof(struct counters)); + if (new == NULL) { + perror("calloc"); + exit(1); + } + new->pkg = pkg; + new->core = core; + new->cpu = cpu; + insert_counters(&cnt_delta, new); + + new = (struct counters *)calloc(1, sizeof(struct counters)); + if (new == NULL) { + perror("calloc"); + exit(1); + } + new->pkg = pkg; + new->core = core; + new->cpu = cpu; + cnt_average = new; } int get_physical_package_id(int cpu) { - char path[80]; + char path[64]; FILE *filep; int pkg; @@ -807,7 +768,7 @@ int get_physical_package_id(int cpu) int get_core_id(int cpu) { - char path[80]; + char path[64]; FILE *filep; int core; @@ -822,87 +783,14 @@ int get_core_id(int cpu) return core; } -int get_num_ht_siblings(int cpu) -{ - char path[80]; - FILE *filep; - int sib1, sib2; - int matches; - char character; - - sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu); - filep = fopen(path, "r"); - if (filep == NULL) { - perror(path); - exit(1); - } - /* - * file format: - * if a pair of number with a character between: 2 siblings (eg. 1-2, or 1,4) - * otherwinse 1 sibling (self). - */ - matches = fscanf(filep, "%d%c%d\n", &sib1, &character, &sib2); - - fclose(filep); - - if (matches == 3) - return 2; - else - return 1; -} - /* - * run func(thread, core, package) in topology order - * skip non-present cpus + * run func(pkg, core, cpu) on every cpu in /proc/stat */ -int for_all_cpus_2(int (func)(struct thread_data *, struct core_data *, - struct pkg_data *, struct thread_data *, struct core_data *, - struct pkg_data *), struct thread_data *thread_base, - struct core_data *core_base, struct pkg_data *pkg_base, - struct thread_data *thread_base2, struct core_data *core_base2, - struct pkg_data *pkg_base2) -{ - int retval, pkg_no, core_no, thread_no; - - for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) { - for (core_no = 0; core_no < topo.num_cores_per_pkg; ++core_no) { - for (thread_no = 0; thread_no < - topo.num_threads_per_core; ++thread_no) { - struct thread_data *t, *t2; - struct core_data *c, *c2; - struct pkg_data *p, *p2; - - t = GET_THREAD(thread_base, thread_no, core_no, pkg_no); - - if (cpu_is_not_present(t->cpu_id)) - continue; - - t2 = GET_THREAD(thread_base2, thread_no, core_no, pkg_no); - - c = GET_CORE(core_base, core_no, pkg_no); - c2 = GET_CORE(core_base2, core_no, pkg_no); - - p = GET_PKG(pkg_base, pkg_no); - p2 = GET_PKG(pkg_base2, pkg_no); - - retval = func(t, c, p, t2, c2, p2); - if (retval) - return retval; - } - } - } - return 0; -} - -/* - * run func(cpu) on every cpu in /proc/stat - * return max_cpu number - */ -int for_all_proc_cpus(int (func)(int)) +int for_all_cpus(void (func)(int, int, int)) { FILE *fp; - int cpu_num; + int cpu_count; int retval; fp = fopen(proc_stat, "r"); @@ -917,88 +805,78 @@ int for_all_proc_cpus(int (func)(int)) exit(1); } - while (1) { - retval = fscanf(fp, "cpu%u %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d\n", &cpu_num); + for (cpu_count = 0; ; cpu_count++) { + int cpu; + + retval = fscanf(fp, "cpu%u %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d\n", &cpu); if (retval != 1) break; - retval = func(cpu_num); - if (retval) { - fclose(fp); - return(retval); - } + func(get_physical_package_id(cpu), get_core_id(cpu), cpu); } fclose(fp); - return 0; + return cpu_count; } void re_initialize(void) { - free_all_buffers(); - setup_all_buffers(); - printf("turbostat: re-initialized with num_cpus %d\n", topo.num_cpus); + free_all_counters(); + num_cpus = for_all_cpus(alloc_new_counters); + cpu_mask_uninit(); + cpu_mask_init(num_cpus); + printf("turbostat: re-initialized with num_cpus %d\n", num_cpus); } - +void dummy(int pkg, int core, int cpu) { return; } /* - * count_cpus() - * remember the last one seen, it will be the max + * check to see if a cpu came on-line */ -int count_cpus(int cpu) +int verify_num_cpus(void) { - if (topo.max_cpu_num < cpu) - topo.max_cpu_num = cpu; + int new_num_cpus; - topo.num_cpus += 1; - return 0; -} -int mark_cpu_present(int cpu) -{ - CPU_SET_S(cpu, cpu_present_setsize, cpu_present_set); + new_num_cpus = for_all_cpus(dummy); + + if (new_num_cpus != num_cpus) { + if (verbose) + printf("num_cpus was %d, is now %d\n", + num_cpus, new_num_cpus); + return -1; + } return 0; } void turbostat_loop() { - int retval; - restart: - retval = for_all_cpus(get_counters, EVEN_COUNTERS); - if (retval) { - re_initialize(); - goto restart; - } + get_counters(cnt_even); gettimeofday(&tv_even, (struct timezone *)NULL); while (1) { - if (for_all_proc_cpus(cpu_is_not_present)) { + if (verify_num_cpus()) { re_initialize(); goto restart; } sleep(interval_sec); - retval = for_all_cpus(get_counters, ODD_COUNTERS); - if (retval) { + if (get_counters(cnt_odd)) { re_initialize(); goto restart; } gettimeofday(&tv_odd, (struct timezone *)NULL); + compute_delta(cnt_odd, cnt_even, cnt_delta); timersub(&tv_odd, &tv_even, &tv_delta); - for_all_cpus_2(delta_cpu, ODD_COUNTERS, EVEN_COUNTERS); - compute_average(EVEN_COUNTERS); - format_all_counters(EVEN_COUNTERS); - flush_stdout(); + compute_average(cnt_delta, cnt_average); + print_counters(cnt_delta); sleep(interval_sec); - retval = for_all_cpus(get_counters, EVEN_COUNTERS); - if (retval) { + if (get_counters(cnt_even)) { re_initialize(); goto restart; } gettimeofday(&tv_even, (struct timezone *)NULL); + compute_delta(cnt_even, cnt_odd, cnt_delta); timersub(&tv_even, &tv_odd, &tv_delta); - for_all_cpus_2(delta_cpu, EVEN_COUNTERS, ODD_COUNTERS); - compute_average(ODD_COUNTERS); - format_all_counters(ODD_COUNTERS); - flush_stdout(); + compute_average(cnt_delta, cnt_average); + print_counters(cnt_delta); } } @@ -1173,208 +1051,6 @@ int open_dev_cpu_msr(int dummy1) return 0; } -void topology_probe() -{ - int i; - int max_core_id = 0; - int max_package_id = 0; - int max_siblings = 0; - struct cpu_topology { - int core_id; - int physical_package_id; - } *cpus; - - /* Initialize num_cpus, max_cpu_num */ - topo.num_cpus = 0; - topo.max_cpu_num = 0; - for_all_proc_cpus(count_cpus); - if (!summary_only && topo.num_cpus > 1) - show_cpu = 1; - - if (verbose > 1) - fprintf(stderr, "num_cpus %d max_cpu_num %d\n", topo.num_cpus, topo.max_cpu_num); - - cpus = calloc(1, (topo.max_cpu_num + 1) * sizeof(struct cpu_topology)); - if (cpus == NULL) { - perror("calloc cpus"); - exit(1); - } - - /* - * Allocate and initialize cpu_present_set - */ - cpu_present_set = CPU_ALLOC((topo.max_cpu_num + 1)); - if (cpu_present_set == NULL) { - perror("CPU_ALLOC"); - exit(3); - } - cpu_present_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1)); - CPU_ZERO_S(cpu_present_setsize, cpu_present_set); - for_all_proc_cpus(mark_cpu_present); - - /* - * Allocate and initialize cpu_affinity_set - */ - cpu_affinity_set = CPU_ALLOC((topo.max_cpu_num + 1)); - if (cpu_affinity_set == NULL) { - perror("CPU_ALLOC"); - exit(3); - } - cpu_affinity_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1)); - CPU_ZERO_S(cpu_affinity_setsize, cpu_affinity_set); - - - /* - * For online cpus - * find max_core_id, max_package_id - */ - for (i = 0; i <= topo.max_cpu_num; ++i) { - int siblings; - - if (cpu_is_not_present(i)) { - if (verbose > 1) - fprintf(stderr, "cpu%d NOT PRESENT\n", i); - continue; - } - cpus[i].core_id = get_core_id(i); - if (cpus[i].core_id > max_core_id) - max_core_id = cpus[i].core_id; - - cpus[i].physical_package_id = get_physical_package_id(i); - if (cpus[i].physical_package_id > max_package_id) - max_package_id = cpus[i].physical_package_id; - - siblings = get_num_ht_siblings(i); - if (siblings > max_siblings) - max_siblings = siblings; - if (verbose > 1) - fprintf(stderr, "cpu %d pkg %d core %d\n", - i, cpus[i].physical_package_id, cpus[i].core_id); - } - topo.num_cores_per_pkg = max_core_id + 1; - if (verbose > 1) - fprintf(stderr, "max_core_id %d, sizing for %d cores per package\n", - max_core_id, topo.num_cores_per_pkg); - if (!summary_only && topo.num_cores_per_pkg > 1) - show_core = 1; - - topo.num_packages = max_package_id + 1; - if (verbose > 1) - fprintf(stderr, "max_package_id %d, sizing for %d packages\n", - max_package_id, topo.num_packages); - if (!summary_only && topo.num_packages > 1) - show_pkg = 1; - - topo.num_threads_per_core = max_siblings; - if (verbose > 1) - fprintf(stderr, "max_siblings %d\n", max_siblings); - - free(cpus); -} - -void -allocate_counters(struct thread_data **t, struct core_data **c, struct pkg_data **p) -{ - int i; - - *t = calloc(topo.num_threads_per_core * topo.num_cores_per_pkg * - topo.num_packages, sizeof(struct thread_data)); - if (*t == NULL) - goto error; - - for (i = 0; i < topo.num_threads_per_core * - topo.num_cores_per_pkg * topo.num_packages; i++) - (*t)[i].cpu_id = -1; - - *c = calloc(topo.num_cores_per_pkg * topo.num_packages, - sizeof(struct core_data)); - if (*c == NULL) - goto error; - - for (i = 0; i < topo.num_cores_per_pkg * topo.num_packages; i++) - (*c)[i].core_id = -1; - - *p = calloc(topo.num_packages, sizeof(struct pkg_data)); - if (*p == NULL) - goto error; - - for (i = 0; i < topo.num_packages; i++) - (*p)[i].package_id = i; - - return; -error: - perror("calloc counters"); - exit(1); -} -/* - * init_counter() - * - * set cpu_id, core_num, pkg_num - * set FIRST_THREAD_IN_CORE and FIRST_CORE_IN_PACKAGE - * - * increment topo.num_cores when 1st core in pkg seen - */ -void init_counter(struct thread_data *thread_base, struct core_data *core_base, - struct pkg_data *pkg_base, int thread_num, int core_num, - int pkg_num, int cpu_id) -{ - struct thread_data *t; - struct core_data *c; - struct pkg_data *p; - - t = GET_THREAD(thread_base, thread_num, core_num, pkg_num); - c = GET_CORE(core_base, core_num, pkg_num); - p = GET_PKG(pkg_base, pkg_num); - - t->cpu_id = cpu_id; - if (thread_num == 0) { - t->flags |= CPU_IS_FIRST_THREAD_IN_CORE; - if (cpu_is_first_core_in_package(cpu_id)) - t->flags |= CPU_IS_FIRST_CORE_IN_PACKAGE; - } - - c->core_id = core_num; - p->package_id = pkg_num; -} - - -int initialize_counters(int cpu_id) -{ - int my_thread_id, my_core_id, my_package_id; - - my_package_id = get_physical_package_id(cpu_id); - my_core_id = get_core_id(cpu_id); - - if (cpu_is_first_sibling_in_core(cpu_id)) { - my_thread_id = 0; - topo.num_cores++; - } else { - my_thread_id = 1; - } - - init_counter(EVEN_COUNTERS, my_thread_id, my_core_id, my_package_id, cpu_id); - init_counter(ODD_COUNTERS, my_thread_id, my_core_id, my_package_id, cpu_id); - return 0; -} - -void allocate_output_buffer() -{ - output_buffer = calloc(1, (1 + topo.num_cpus) * 128); - outp = output_buffer; - if (outp == NULL) { - perror("calloc"); - exit(-1); - } -} - -void setup_all_buffers(void) -{ - topology_probe(); - allocate_counters(&thread_even, &core_even, &package_even); - allocate_counters(&thread_odd, &core_odd, &package_odd); - allocate_output_buffer(); - for_all_proc_cpus(initialize_counters); -} void turbostat_init() { check_cpuid(); @@ -1382,19 +1058,21 @@ void turbostat_init() check_dev_msr(); check_super_user(); - setup_all_buffers(); + num_cpus = for_all_cpus(alloc_new_counters); + cpu_mask_init(num_cpus); if (verbose) - print_verbose_header(); + print_nehalem_info(); } int fork_it(char **argv) { + int retval; pid_t child_pid; + get_counters(cnt_even); - for_all_cpus(get_counters, EVEN_COUNTERS); - /* clear affinity side-effect of get_counters() */ - sched_setaffinity(0, cpu_present_setsize, cpu_present_set); + /* clear affinity side-effect of get_counters() */ + sched_setaffinity(0, cpu_present_setsize, cpu_present_set); gettimeofday(&tv_even, (struct timezone *)NULL); child_pid = fork(); @@ -1417,17 +1095,14 @@ int fork_it(char **argv) exit(1); } } - /* - * n.b. fork_it() does not check for errors from for_all_cpus() - * because re-starting is problematic when forking - */ - for_all_cpus(get_counters, ODD_COUNTERS); + get_counters(cnt_odd); gettimeofday(&tv_odd, (struct timezone *)NULL); + retval = compute_delta(cnt_odd, cnt_even, cnt_delta); + timersub(&tv_odd, &tv_even, &tv_delta); - for_all_cpus_2(delta_cpu, ODD_COUNTERS, EVEN_COUNTERS); - compute_average(EVEN_COUNTERS); - format_all_counters(EVEN_COUNTERS); - flush_stderr(); + compute_average(cnt_delta, cnt_average); + if (!retval) + print_counters(cnt_delta); fprintf(stderr, "%.6f sec\n", tv_delta.tv_sec + tv_delta.tv_usec/1000000.0); @@ -1440,14 +1115,8 @@ void cmdline(int argc, char **argv) progname = argv[0]; - while ((opt = getopt(argc, argv, "+cpsvi:M:")) != -1) { + while ((opt = getopt(argc, argv, "+svi:M:")) != -1) { switch (opt) { - case 'c': - show_core_only++; - break; - case 'p': - show_pkg_only++; - break; case 's': summary_only++; break; @@ -1473,8 +1142,10 @@ int main(int argc, char **argv) cmdline(argc, argv); if (verbose > 1) - fprintf(stderr, "turbostat v2.0 May 16, 2012" + fprintf(stderr, "turbostat Dec 6, 2010" " - Len Brown \n"); + if (verbose > 1) + fprintf(stderr, "http://userweb.kernel.org/~lenb/acpi/utils/pmtools/turbostat/\n"); turbostat_init();