X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Facpi%2Fdebug.c;h=a8287be0870e7bc06d7dc21963c32e0996a6e623;hb=e899a3f232125c393cdf7f7bf6533501ef8808fb;hp=ec7bcee7708501135a97a7468947e2df535e560b;hpb=a6fc67202e0224e6c9d1d285cc0b444bce887ed5;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index ec7bcee..a8287be 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c @@ -9,18 +9,9 @@ #include #include #include -#include #define _COMPONENT ACPI_SYSTEM_COMPONENT -ACPI_MODULE_NAME("debug") -#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer" -#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level" -#ifdef MODULE_PARAM_PREFIX -#undef MODULE_PARAM_PREFIX -#endif -#define MODULE_PARAM_PREFIX - module_param(acpi_dbg_layer, uint, 0400); -module_param(acpi_dbg_level, uint, 0400); +ACPI_MODULE_NAME("debug"); struct acpi_dlayer { const char *name; @@ -47,11 +38,24 @@ static const struct acpi_dlayer acpi_debug_layers[] = { ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER), ACPI_DEBUG_INIT(ACPI_COMPILER), ACPI_DEBUG_INIT(ACPI_TOOLS), + + ACPI_DEBUG_INIT(ACPI_BUS_COMPONENT), + ACPI_DEBUG_INIT(ACPI_AC_COMPONENT), + ACPI_DEBUG_INIT(ACPI_BATTERY_COMPONENT), + ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT), + ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), + ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), + ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT), + ACPI_DEBUG_INIT(ACPI_POWER_COMPONENT), + ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), + ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), + ACPI_DEBUG_INIT(ACPI_THERMAL_COMPONENT), + ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), + ACPI_DEBUG_INIT(ACPI_VIDEO_COMPONENT), + ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT), }; static const struct acpi_dlevel acpi_debug_levels[] = { - ACPI_DEBUG_INIT(ACPI_LV_ERROR), - ACPI_DEBUG_INIT(ACPI_LV_WARN), ACPI_DEBUG_INIT(ACPI_LV_INIT), ACPI_DEBUG_INIT(ACPI_LV_DEBUG_OBJECT), ACPI_DEBUG_INIT(ACPI_LV_INFO), @@ -86,6 +90,117 @@ static const struct acpi_dlevel acpi_debug_levels[] = { ACPI_DEBUG_INIT(ACPI_LV_EVENTS), }; +/* -------------------------------------------------------------------------- + FS Interface (/sys) + -------------------------------------------------------------------------- */ +static int param_get_debug_layer(char *buffer, struct kernel_param *kp) { + int result = 0; + int i; + + result = sprintf(buffer, "%-25s\tHex SET\n", "Description"); + + for(i = 0; i sizeof(debug_string) - 1) - return_VALUE(-EINVAL); + return -EINVAL; if (copy_from_user(debug_string, buffer, count)) - return_VALUE(-EFAULT); + return -EFAULT; debug_string[count] = '\0'; @@ -173,23 +287,20 @@ acpi_system_write_debug(struct file *file, acpi_dbg_level = simple_strtoul(debug_string, NULL, 0); break; default: - return_VALUE(-EINVAL); + return -EINVAL; } - return_VALUE(count); + return count; } +#endif -static int __init acpi_debug_init(void) +int __init acpi_debug_init(void) { +#ifdef CONFIG_ACPI_PROCFS struct proc_dir_entry *entry; int error = 0; char *name; - ACPI_FUNCTION_TRACE("acpi_debug_init"); - - if (acpi_disabled) - return_VALUE(0); - /* 'debug_layer' [R/W] */ name = ACPI_SYSTEM_FILE_DEBUG_LAYER; entry = @@ -213,13 +324,14 @@ static int __init acpi_debug_init(void) goto Error; Done: - return_VALUE(error); + return error; Error: remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir); error = -ENODEV; goto Done; +#else + return 0; +#endif } - -subsys_initcall(acpi_debug_init);