Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46452
b: refs/heads/master
c: 219c3c8
h: refs/heads/master
v: v3
  • Loading branch information
Zhang Rui authored and Len Brown committed Jan 29, 2007
1 parent 838d237 commit 731b47f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b981c591891dc8885de36498d38fa8d8a5481069
refs/heads/master: 219c3c8e268b9307eae9fae4c765a0c589b98338
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ config ACPI_PROCFS
As the same functions are duplicated in sysfs interface
and this proc interface will be removed some time later,
it's marked as deprecated.
( /proc/acpi/debug_layer && debug_level are deprecated by
/sys/module/acpi/parameters/debug_layer && debug_level. )

config ACPI_AC
tristate "AC Adapter"
Expand Down
62 changes: 57 additions & 5 deletions trunk/drivers/acpi/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@

#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);
#define MODULE_PARAM_PREFIX "acpi."

struct acpi_dlayer {
const char *name;
Expand Down Expand Up @@ -86,6 +83,60 @@ 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 <ARRAY_SIZE(acpi_debug_layers); i++) {
result += sprintf(buffer+result, "%-25s\t0x%08lX [%c]\n",
acpi_debug_layers[i].name,
acpi_debug_layers[i].value,
(acpi_dbg_layer & acpi_debug_layers[i].value) ? '*' : ' ');
}
result += sprintf(buffer+result, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS",
ACPI_ALL_DRIVERS,
(acpi_dbg_layer & ACPI_ALL_DRIVERS) ==
ACPI_ALL_DRIVERS ? '*' : (acpi_dbg_layer &
ACPI_ALL_DRIVERS) == 0 ? ' ' : '-');
result += sprintf(buffer+result, "--\ndebug_layer = 0x%08X ( * = enabled)\n", acpi_dbg_layer);

return result;
}

static int param_get_debug_level(char *buffer, struct kernel_param *kp) {
int result = 0;
int i;

result = sprintf(buffer, "%-25s\tHex SET\n", "Description");

for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) {
result += sprintf(buffer+result, "%-25s\t0x%08lX [%c]\n",
acpi_debug_levels[i].name,
acpi_debug_levels[i].value,
(acpi_dbg_level & acpi_debug_levels[i].
value) ? '*' : ' ');
}
result += sprintf(buffer+result, "--\ndebug_level = 0x%08X (* = enabled)\n",
acpi_dbg_level);

return result;
}

module_param_call(debug_layer, param_set_uint, param_get_debug_layer, &acpi_dbg_layer, 0644);
module_param_call(debug_level, param_set_uint, param_get_debug_level, &acpi_dbg_level, 0644);

/* --------------------------------------------------------------------------
FS Interface (/proc)
-------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCFS
#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer"
#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level"

static int
acpi_system_read_debug(char *page,
char **start, off_t off, int count, int *eof, void *data)
Expand Down Expand Up @@ -221,3 +272,4 @@ static int __init acpi_debug_init(void)
}

subsys_initcall(acpi_debug_init);
#endif

0 comments on commit 731b47f

Please sign in to comment.