linux/drivers/acpi/sysfs.c
<<
>>
Prefs
   1/*
   2 * sysfs.c - ACPI sysfs interface to userspace.
   3 */
   4
   5#include <linux/init.h>
   6#include <linux/kernel.h>
   7#include <linux/moduleparam.h>
   8#include <acpi/acpi_drivers.h>
   9
  10#define _COMPONENT              ACPI_SYSTEM_COMPONENT
  11ACPI_MODULE_NAME("sysfs");
  12
  13#define PREFIX "ACPI: "
  14
  15#ifdef CONFIG_ACPI_DEBUG
  16/*
  17 * ACPI debug sysfs I/F, including:
  18 * /sys/modules/acpi/parameters/debug_layer
  19 * /sys/modules/acpi/parameters/debug_level
  20 * /sys/modules/acpi/parameters/trace_method_name
  21 * /sys/modules/acpi/parameters/trace_state
  22 * /sys/modules/acpi/parameters/trace_debug_layer
  23 * /sys/modules/acpi/parameters/trace_debug_level
  24 */
  25
  26struct acpi_dlayer {
  27        const char *name;
  28        unsigned long value;
  29};
  30struct acpi_dlevel {
  31        const char *name;
  32        unsigned long value;
  33};
  34#define ACPI_DEBUG_INIT(v)      { .name = #v, .value = v }
  35
  36static const struct acpi_dlayer acpi_debug_layers[] = {
  37        ACPI_DEBUG_INIT(ACPI_UTILITIES),
  38        ACPI_DEBUG_INIT(ACPI_HARDWARE),
  39        ACPI_DEBUG_INIT(ACPI_EVENTS),
  40        ACPI_DEBUG_INIT(ACPI_TABLES),
  41        ACPI_DEBUG_INIT(ACPI_NAMESPACE),
  42        ACPI_DEBUG_INIT(ACPI_PARSER),
  43        ACPI_DEBUG_INIT(ACPI_DISPATCHER),
  44        ACPI_DEBUG_INIT(ACPI_EXECUTER),
  45        ACPI_DEBUG_INIT(ACPI_RESOURCES),
  46        ACPI_DEBUG_INIT(ACPI_CA_DEBUGGER),
  47        ACPI_DEBUG_INIT(ACPI_OS_SERVICES),
  48        ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER),
  49        ACPI_DEBUG_INIT(ACPI_COMPILER),
  50        ACPI_DEBUG_INIT(ACPI_TOOLS),
  51
  52        ACPI_DEBUG_INIT(ACPI_BUS_COMPONENT),
  53        ACPI_DEBUG_INIT(ACPI_AC_COMPONENT),
  54        ACPI_DEBUG_INIT(ACPI_BATTERY_COMPONENT),
  55        ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT),
  56        ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT),
  57        ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT),
  58        ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT),
  59        ACPI_DEBUG_INIT(ACPI_POWER_COMPONENT),
  60        ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT),
  61        ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT),
  62        ACPI_DEBUG_INIT(ACPI_THERMAL_COMPONENT),
  63        ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT),
  64        ACPI_DEBUG_INIT(ACPI_VIDEO_COMPONENT),
  65        ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT),
  66};
  67
  68static const struct acpi_dlevel acpi_debug_levels[] = {
  69        ACPI_DEBUG_INIT(ACPI_LV_INIT),
  70        ACPI_DEBUG_INIT(ACPI_LV_DEBUG_OBJECT),
  71        ACPI_DEBUG_INIT(ACPI_LV_INFO),
  72
  73        ACPI_DEBUG_INIT(ACPI_LV_INIT_NAMES),
  74        ACPI_DEBUG_INIT(ACPI_LV_PARSE),
  75        ACPI_DEBUG_INIT(ACPI_LV_LOAD),
  76        ACPI_DEBUG_INIT(ACPI_LV_DISPATCH),
  77        ACPI_DEBUG_INIT(ACPI_LV_EXEC),
  78        ACPI_DEBUG_INIT(ACPI_LV_NAMES),
  79        ACPI_DEBUG_INIT(ACPI_LV_OPREGION),
  80        ACPI_DEBUG_INIT(ACPI_LV_BFIELD),
  81        ACPI_DEBUG_INIT(ACPI_LV_TABLES),
  82        ACPI_DEBUG_INIT(ACPI_LV_VALUES),
  83        ACPI_DEBUG_INIT(ACPI_LV_OBJECTS),
  84        ACPI_DEBUG_INIT(ACPI_LV_RESOURCES),
  85        ACPI_DEBUG_INIT(ACPI_LV_USER_REQUESTS),
  86        ACPI_DEBUG_INIT(ACPI_LV_PACKAGE),
  87
  88        ACPI_DEBUG_INIT(ACPI_LV_ALLOCATIONS),
  89        ACPI_DEBUG_INIT(ACPI_LV_FUNCTIONS),
  90        ACPI_DEBUG_INIT(ACPI_LV_OPTIMIZATIONS),
  91
  92        ACPI_DEBUG_INIT(ACPI_LV_MUTEX),
  93        ACPI_DEBUG_INIT(ACPI_LV_THREADS),
  94        ACPI_DEBUG_INIT(ACPI_LV_IO),
  95        ACPI_DEBUG_INIT(ACPI_LV_INTERRUPTS),
  96
  97        ACPI_DEBUG_INIT(ACPI_LV_AML_DISASSEMBLE),
  98        ACPI_DEBUG_INIT(ACPI_LV_VERBOSE_INFO),
  99        ACPI_DEBUG_INIT(ACPI_LV_FULL_TABLES),
 100        ACPI_DEBUG_INIT(ACPI_LV_EVENTS),
 101};
 102
 103static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)
 104{
 105        int result = 0;
 106        int i;
 107
 108        result = sprintf(buffer, "%-25s\tHex        SET\n", "Description");
 109
 110        for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) {
 111                result += sprintf(buffer + result, "%-25s\t0x%08lX [%c]\n",
 112                                  acpi_debug_layers[i].name,
 113                                  acpi_debug_layers[i].value,
 114                                  (acpi_dbg_layer & acpi_debug_layers[i].value)
 115                                  ? '*' : ' ');
 116        }
 117        result +=
 118            sprintf(buffer + result, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS",
 119                    ACPI_ALL_DRIVERS,
 120                    (acpi_dbg_layer & ACPI_ALL_DRIVERS) ==
 121                    ACPI_ALL_DRIVERS ? '*' : (acpi_dbg_layer & ACPI_ALL_DRIVERS)
 122                    == 0 ? ' ' : '-');
 123        result +=
 124            sprintf(buffer + result,
 125                    "--\ndebug_layer = 0x%08X ( * = enabled)\n",
 126                    acpi_dbg_layer);
 127
 128        return result;
 129}
 130
 131static int param_get_debug_level(char *buffer, const struct kernel_param *kp)
 132{
 133        int result = 0;
 134        int i;
 135
 136        result = sprintf(buffer, "%-25s\tHex        SET\n", "Description");
 137
 138        for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) {
 139                result += sprintf(buffer + result, "%-25s\t0x%08lX [%c]\n",
 140                                  acpi_debug_levels[i].name,
 141                                  acpi_debug_levels[i].value,
 142                                  (acpi_dbg_level & acpi_debug_levels[i].value)
 143                                  ? '*' : ' ');
 144        }
 145        result +=
 146            sprintf(buffer + result, "--\ndebug_level = 0x%08X (* = enabled)\n",
 147                    acpi_dbg_level);
 148
 149        return result;
 150}
 151
 152static const struct kernel_param_ops param_ops_debug_layer = {
 153        .set = param_set_uint,
 154        .get = param_get_debug_layer,
 155};
 156
 157static const struct kernel_param_ops param_ops_debug_level = {
 158        .set = param_set_uint,
 159        .get = param_get_debug_level,
 160};
 161
 162module_param_cb(debug_layer, &param_ops_debug_layer, &acpi_dbg_layer, 0644);
 163module_param_cb(debug_level, &param_ops_debug_level, &acpi_dbg_level, 0644);
 164
 165static char trace_method_name[6];
 166module_param_string(trace_method_name, trace_method_name, 6, 0644);
 167static unsigned int trace_debug_layer;
 168module_param(trace_debug_layer, uint, 0644);
 169static unsigned int trace_debug_level;
 170module_param(trace_debug_level, uint, 0644);
 171
 172static int param_set_trace_state(const char *val, struct kernel_param *kp)
 173{
 174        int result = 0;
 175
 176        if (!strncmp(val, "enable", sizeof("enable") - 1)) {
 177                result = acpi_debug_trace(trace_method_name, trace_debug_level,
 178                                          trace_debug_layer, 0);
 179                if (result)
 180                        result = -EBUSY;
 181                goto exit;
 182        }
 183
 184        if (!strncmp(val, "disable", sizeof("disable") - 1)) {
 185                int name = 0;
 186                result = acpi_debug_trace((char *)&name, trace_debug_level,
 187                                          trace_debug_layer, 0);
 188                if (result)
 189                        result = -EBUSY;
 190                goto exit;
 191        }
 192
 193        if (!strncmp(val, "1", 1)) {
 194                result = acpi_debug_trace(trace_method_name, trace_debug_level,
 195                                          trace_debug_layer, 1);
 196                if (result)
 197                        result = -EBUSY;
 198                goto exit;
 199        }
 200
 201        result = -EINVAL;
 202exit:
 203        return result;
 204}
 205
 206static int param_get_trace_state(char *buffer, struct kernel_param *kp)
 207{
 208        if (!acpi_gbl_trace_method_name)
 209                return sprintf(buffer, "disable");
 210        else {
 211                if (acpi_gbl_trace_flags & 1)
 212                        return sprintf(buffer, "1");
 213                else
 214                        return sprintf(buffer, "enable");
 215        }
 216        return 0;
 217}
 218
 219module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
 220                  NULL, 0644);
 221#endif /* CONFIG_ACPI_DEBUG */
 222
 223
 224/* /sys/modules/acpi/parameters/aml_debug_output */
 225
 226module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
 227                   bool, 0644);
 228MODULE_PARM_DESC(aml_debug_output,
 229                 "To enable/disable the ACPI Debug Object output.");
 230
 231/* /sys/module/acpi/parameters/acpica_version */
 232static int param_get_acpica_version(char *buffer, struct kernel_param *kp)
 233{
 234        int result;
 235
 236        result = sprintf(buffer, "%x", ACPI_CA_VERSION);
 237
 238        return result;
 239}
 240
 241module_param_call(acpica_version, NULL, param_get_acpica_version, NULL, 0444);
 242
 243/*
 244 * ACPI table sysfs I/F:
 245 * /sys/firmware/acpi/tables/
 246 * /sys/firmware/acpi/tables/dynamic/
 247 */
 248
 249static LIST_HEAD(acpi_table_attr_list);
 250static struct kobject *tables_kobj;
 251static struct kobject *dynamic_tables_kobj;
 252
 253struct acpi_table_attr {
 254        struct bin_attribute attr;
 255        char name[8];
 256        int instance;
 257        struct list_head node;
 258};
 259
 260static ssize_t acpi_table_show(struct file *filp, struct kobject *kobj,
 261                               struct bin_attribute *bin_attr, char *buf,
 262                               loff_t offset, size_t count)
 263{
 264        struct acpi_table_attr *table_attr =
 265            container_of(bin_attr, struct acpi_table_attr, attr);
 266        struct acpi_table_header *table_header = NULL;
 267        acpi_status status;
 268        char name[ACPI_NAME_SIZE];
 269
 270        if (strncmp(table_attr->name, "NULL", 4))
 271                memcpy(name, table_attr->name, ACPI_NAME_SIZE);
 272        else
 273                memcpy(name, "\0\0\0\0", 4);
 274
 275        status = acpi_get_table(name, table_attr->instance, &table_header);
 276        if (ACPI_FAILURE(status))
 277                return -ENODEV;
 278
 279        return memory_read_from_buffer(buf, count, &offset,
 280                                       table_header, table_header->length);
 281}
 282
 283static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
 284                                 struct acpi_table_header *table_header)
 285{
 286        struct acpi_table_header *header = NULL;
 287        struct acpi_table_attr *attr = NULL;
 288
 289        sysfs_attr_init(&table_attr->attr.attr);
 290        if (table_header->signature[0] != '\0')
 291                memcpy(table_attr->name, table_header->signature,
 292                       ACPI_NAME_SIZE);
 293        else
 294                memcpy(table_attr->name, "NULL", 4);
 295
 296        list_for_each_entry(attr, &acpi_table_attr_list, node) {
 297                if (!memcmp(table_attr->name, attr->name, ACPI_NAME_SIZE))
 298                        if (table_attr->instance < attr->instance)
 299                                table_attr->instance = attr->instance;
 300        }
 301        table_attr->instance++;
 302
 303        if (table_attr->instance > 1 || (table_attr->instance == 1 &&
 304                                         !acpi_get_table
 305                                         (table_header->signature, 2, &header)))
 306                sprintf(table_attr->name + ACPI_NAME_SIZE, "%d",
 307                        table_attr->instance);
 308
 309        table_attr->attr.size = 0;
 310        table_attr->attr.read = acpi_table_show;
 311        table_attr->attr.attr.name = table_attr->name;
 312        table_attr->attr.attr.mode = 0400;
 313
 314        return;
 315}
 316
 317static acpi_status
 318acpi_sysfs_table_handler(u32 event, void *table, void *context)
 319{
 320        struct acpi_table_attr *table_attr;
 321
 322        switch (event) {
 323        case ACPI_TABLE_EVENT_LOAD:
 324                table_attr =
 325                    kzalloc(sizeof(struct acpi_table_attr), GFP_KERNEL);
 326                if (!table_attr)
 327                        return AE_NO_MEMORY;
 328
 329                acpi_table_attr_init(table_attr, table);
 330                if (sysfs_create_bin_file(dynamic_tables_kobj,
 331                                          &table_attr->attr)) {
 332                        kfree(table_attr);
 333                        return AE_ERROR;
 334                } else
 335                        list_add_tail(&table_attr->node, &acpi_table_attr_list);
 336                break;
 337        case ACPI_TABLE_EVENT_UNLOAD:
 338                /*
 339                 * we do not need to do anything right now
 340                 * because the table is not deleted from the
 341                 * global table list when unloading it.
 342                 */
 343                break;
 344        default:
 345                return AE_BAD_PARAMETER;
 346        }
 347        return AE_OK;
 348}
 349
 350static int acpi_tables_sysfs_init(void)
 351{
 352        struct acpi_table_attr *table_attr;
 353        struct acpi_table_header *table_header = NULL;
 354        int table_index = 0;
 355        int result;
 356
 357        tables_kobj = kobject_create_and_add("tables", acpi_kobj);
 358        if (!tables_kobj)
 359                goto err;
 360
 361        dynamic_tables_kobj = kobject_create_and_add("dynamic", tables_kobj);
 362        if (!dynamic_tables_kobj)
 363                goto err_dynamic_tables;
 364
 365        do {
 366                result = acpi_get_table_by_index(table_index, &table_header);
 367                if (!result) {
 368                        table_index++;
 369                        table_attr = NULL;
 370                        table_attr =
 371                            kzalloc(sizeof(struct acpi_table_attr), GFP_KERNEL);
 372                        if (!table_attr)
 373                                return -ENOMEM;
 374
 375                        acpi_table_attr_init(table_attr, table_header);
 376                        result =
 377                            sysfs_create_bin_file(tables_kobj,
 378                                                  &table_attr->attr);
 379                        if (result) {
 380                                kfree(table_attr);
 381                                return result;
 382                        } else
 383                                list_add_tail(&table_attr->node,
 384                                              &acpi_table_attr_list);
 385                }
 386        } while (!result);
 387        kobject_uevent(tables_kobj, KOBJ_ADD);
 388        kobject_uevent(dynamic_tables_kobj, KOBJ_ADD);
 389        result = acpi_install_table_handler(acpi_sysfs_table_handler, NULL);
 390
 391        return result == AE_OK ? 0 : -EINVAL;
 392err_dynamic_tables:
 393        kobject_put(tables_kobj);
 394err:
 395        return -ENOMEM;
 396}
 397
 398/*
 399 * Detailed ACPI IRQ counters:
 400 * /sys/firmware/acpi/interrupts/
 401 */
 402
 403u32 acpi_irq_handled;
 404u32 acpi_irq_not_handled;
 405
 406#define COUNT_GPE 0
 407#define COUNT_SCI 1             /* acpi_irq_handled */
 408#define COUNT_SCI_NOT 2         /* acpi_irq_not_handled */
 409#define COUNT_ERROR 3           /* other */
 410#define NUM_COUNTERS_EXTRA 4
 411
 412struct event_counter {
 413        u32 count;
 414        u32 flags;
 415};
 416
 417static struct event_counter *all_counters;
 418static u32 num_gpes;
 419static u32 num_counters;
 420static struct attribute **all_attrs;
 421static u32 acpi_gpe_count;
 422
 423static struct attribute_group interrupt_stats_attr_group = {
 424        .name = "interrupts",
 425};
 426
 427static struct kobj_attribute *counter_attrs;
 428
 429static void delete_gpe_attr_array(void)
 430{
 431        struct event_counter *tmp = all_counters;
 432
 433        all_counters = NULL;
 434        kfree(tmp);
 435
 436        if (counter_attrs) {
 437                int i;
 438
 439                for (i = 0; i < num_gpes; i++)
 440                        kfree(counter_attrs[i].attr.name);
 441
 442                kfree(counter_attrs);
 443        }
 444        kfree(all_attrs);
 445
 446        return;
 447}
 448
 449static void gpe_count(u32 gpe_number)
 450{
 451        acpi_gpe_count++;
 452
 453        if (!all_counters)
 454                return;
 455
 456        if (gpe_number < num_gpes)
 457                all_counters[gpe_number].count++;
 458        else
 459                all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS +
 460                             COUNT_ERROR].count++;
 461
 462        return;
 463}
 464
 465static void fixed_event_count(u32 event_number)
 466{
 467        if (!all_counters)
 468                return;
 469
 470        if (event_number < ACPI_NUM_FIXED_EVENTS)
 471                all_counters[num_gpes + event_number].count++;
 472        else
 473                all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS +
 474                             COUNT_ERROR].count++;
 475
 476        return;
 477}
 478
 479static void acpi_gbl_event_handler(u32 event_type, acpi_handle device,
 480        u32 event_number, void *context)
 481{
 482        if (event_type == ACPI_EVENT_TYPE_GPE)
 483                gpe_count(event_number);
 484
 485        if (event_type == ACPI_EVENT_TYPE_FIXED)
 486                fixed_event_count(event_number);
 487}
 488
 489static int get_status(u32 index, acpi_event_status *status,
 490                      acpi_handle *handle)
 491{
 492        int result = 0;
 493
 494        if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
 495                goto end;
 496
 497        if (index < num_gpes) {
 498                result = acpi_get_gpe_device(index, handle);
 499                if (result) {
 500                        ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
 501                                        "Invalid GPE 0x%x\n", index));
 502                        goto end;
 503                }
 504                result = acpi_get_gpe_status(*handle, index, status);
 505        } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
 506                result = acpi_get_event_status(index - num_gpes, status);
 507
 508end:
 509        return result;
 510}
 511
 512static ssize_t counter_show(struct kobject *kobj,
 513                            struct kobj_attribute *attr, char *buf)
 514{
 515        int index = attr - counter_attrs;
 516        int size;
 517        acpi_handle handle;
 518        acpi_event_status status;
 519        int result = 0;
 520
 521        all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI].count =
 522            acpi_irq_handled;
 523        all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI_NOT].count =
 524            acpi_irq_not_handled;
 525        all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
 526            acpi_gpe_count;
 527        size = sprintf(buf, "%8d", all_counters[index].count);
 528
 529        /* "gpe_all" or "sci" */
 530        if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
 531                goto end;
 532
 533        result = get_status(index, &status, &handle);
 534        if (result)
 535                goto end;
 536
 537        if (!(status & ACPI_EVENT_FLAG_HANDLE))
 538                size += sprintf(buf + size, "   invalid");
 539        else if (status & ACPI_EVENT_FLAG_ENABLED)
 540                size += sprintf(buf + size, "   enabled");
 541        else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED)
 542                size += sprintf(buf + size, "   wake_enabled");
 543        else
 544                size += sprintf(buf + size, "   disabled");
 545
 546end:
 547        size += sprintf(buf + size, "\n");
 548        return result ? result : size;
 549}
 55520"> 520
 520
 452
 * /sys/firmware/acpi/inct  453        5f (!<5 href=> * /sys/firmware/acpi/ineettspa the totalspan>
 454        5     5 retur> * /sys/firmware/acpi/in;
 455
 */
 456        5f (ssize_t coue);
kobject *kobj,
 457        5     5 kobj_attribute *attr, char *buf)
 458        5lse
<55                                class="sref">size  459        5     5  460        5     5              dex" class="sref">index = attr - counter_attrs;
 461
acpi_event_status status;
 462        5eturn5
handle;
 463}
iresult = 0;
 464
 465static v5id num_gpes + ACPI_NUM_FIXED_EVENTS)
COUNT_SCI]. 466{
i;
 467        5f (!<56i = 0; i < nu">num_counters;
i <  468        5     5 return;
all_counters[in< count =
 469
acpi_gpe_count;
 470        5f (siss="sref">acpi_irq_handled;
 471        5     5 acpi_irq_not_handled;
 472        5lse
<57end;
 473        5     5  474        5     57s/acpi/sysfs.c#L465" id="L465" class=5line" nam5="L475"> 475
 476        5eturn5
result = get_status(index, &status, &handle);
 477}
iresult)
 478
end;
 479static v5id  480        5a hre58ref="+code=index"us" class="sref">status & ACPI_EVENT_FLAG_HANDLE))
 481{
iKERN_WARNINGVENT_FLAG_HANDLKERN_WARNINGandle" class="sref">PREhreVENT_FLAG_HANDLPREhre/acpi/sysfs.c#L470" id="L470" class=5line" nam5="L482"> 482        5f ( 483        5     5 EINVA/a>;
 484
 485        5f ( 486        5     58ref="+code=gpe_number" class="srndex < num_gpes) {
 487}
buf + "\n");
 488
status & ACPI_EVENT_FLAG_ENABLED)
 489static i5t ;
);
bufhandle, index,  490        5     5       buf + "\n");
 491{
status & >ACPI_EVENT_FLAG_ENABLED)
 492        5nt ;
;
bufhandle, index,  493
buf + "\n");
 494        5f (status & ]. 495        5     5 goto ;
ysear"driuf" class="sref">bufhandle, index,  496
 497        5f (all_counters[index].count);
trtoul>);
buf + &ass="sref">bufLL;
 498        5     5 index < (num_gpes + ACPI_NUM_FIXED_EVENTS)
 499        5     5 if (iref=">;
 - num_gpes,  500        6     6         buf + "\n");
 501        6     6                         status & >ACPI_EVENT_FLAG_ENABLED)
 502        6     6         goto bufref=">;
 503        6     6 }
buf + "\n");
 504        6     6 status & >ACPI_EVENT_FLAG_ENABLED)
 505        6 else60goto bufref=">;
 496
buf + "\n");
 507
status & ]. 508 = bufref=">;
 499        6eturn60if ( 510}
all_counters[index].count);
trtoul>);
buf + &ass="sref">bufLL;
 511
 512static <6 href61si=ref">all_counters[index].count);
trtoul>);
buf + &ass="sref">bufLL;
 513        6     61s/acpi/sysfs.c#L494" id="L494" class=6line" nam6="L514"> 514{
ED" cFAILUREVENT_FLAG_HANDLEFAILUREuf" class="sref">bufresult)
 515        6nt  = EINVA/a>;
 516        6nt end:
 517        6a hre6="+code=acpi_h=result" class="sref">result ? result : size;
 518        6a hre6="+codpi/sysfs.c#L550" id="L550" class=6line" nam6="L519"> 519        6nt  520
;
 521        6a hre62rs/acpi/sysfs.c#L492" id="L492" class=6line" nam6="L522"> 522        6   status;
 523        6a hre623            dex" class="sref">i;
 524        6    525        6a hre62ref="+code=event_type" class="srsref">all_counters)
 526        6    527        6a hre62s/acpi/sysfs.c#L508" id="L508" class=6line" nam6="L528"> 528
num_gpes + acpi_gpe_count;
acpi_gs/acpi/sysfs.c#L438" id="L438" class=6line" nam6="L529"> 529        6span 6lass="comment">ent_status" cl">nu">num_counters;
num_gpes + ACPI_NUM_FIXED_EVENTS)
;
 530        6f ( 531        6     63"+code=all_counters" class="srefounter_attrs;
;
kobj_attribute *nu">num_counters;
 532
 533        6a hre6="+code=resultent_type" class="srsrefounter_attrs;
;
 534        6f ( 535        6     63s/acpi/sysfs.c#L546" id="L546" class=6line" nam6="L536"> 536
sref">all_counters)
nu">num_counters;
 537        6f (!(63 538        6     6 all_counters)
 539        6lse i63if (endfail>);
 540        6     64="drivers/acpi/sy51" id="L5        541        6lse i64"+code=all_counters" class="status & acpi_gbl_event_handlerinrefrefglobas="sref">acpi_guf" class="sref">bufa hrefss="sref">acpi_gbl_event_handler(&ass="sref">bufLL;
 542        6     64ref="+code=event_type" class="srED" cFAILUREVENT_FLAG_HANDLEFAILUREuf" class="sref">bufstatus);
 543        6lse
<64}
endfail>);
 544        6     64s/acpi/sysfs.c#L465" id="L465" class=6line" nam6="L545"> 545
counter_attrs;
kobj_attribute *nu">num_counters;
 546 547        6a hre64ref="+code=index" class="sref">i"sref">counter_attrs;
 548        6eturn64return;
endfail>);
 549}
 55520"> 5206i = 0; i < nu">num_counters;
i < buf 452
buf;
 453        6f (!<65s/acpi/sysfs.c#L494" id="L494" class=6Line" nam6="L454"> 454        6     65in< num_gpes) {
 455
buf"\n");
in<  456        6f (i = 0; num_gpes +  457        6     6 buf"\n");
 458        6lse
<65                     de=statusss="sref">i = 0; num_gpes +  459        6     65buf"\n");
 460        6     66      i = 0; num_gpes +  461
buf"\n");
 462        6eturn66        goto i = 0; num_gpes +  463}
buf"\n");
 464
i = 0; num_gpes +  465static v6id buf"\n");
 466{
i = 0; num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE]. 467        6f (!<66buf"\n");
 468        6     6 return;
i = 0; num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI]. 469
buf"\n");
 470        6f (i = 0; num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_UNT_SCI_NOT]. 471        6     6 buf"\n");
 472        6lse
<67i = 0; num_gpes + ACPI_NUM_FIXED_EVENTS + COUERRO_ERROR].COUERRO_counai/sysfs.c#L548" id="L548" class=6line" nam6="L473"> 473        6     67}
buf"\n");
 474        6     67 475
buf"\n");
in<  476        6eturn67s/acpi/sysfs.c#L537" id="L537" class=6line" nam6="L477"> 477}
buf;
;
bufstrlen);
bufiGFP_KERNE/a>;
 478
i;
;
 479static v6id endfail>);
 480        6a hre68siztrncpy);
buf;
i&ass="sref">bufstrlen);
buf 481{
 482        6f (bufs" cldrive_ini">;
"sref">counter_attrs;
in< ctr -  483        6     6 "sref">counter_attrs;
in< ctr - c;
;
 484
"sref">counter_attrs;
in< ctr - cmf">a> - ode=i" c644pi/sysfs.c#L438" id="L438" class=6line" nam6="L485"> 485        6f (counter_attrs;
in< cef=">;
couf=">;
 486        6     68counter_attrs;
in< cetor/a>;
coue<+codpi/sysfs.c#L438" id="L438" class=6line" nam6="L487"> 487}
 488
ctrefounter_attrs;
in< "sref">counter_attrs;
in< ctr -  489static i6t  490        6     69="drivers/acpi/sy51" id="L5        491{
);
counter_attrs;
;
 492        6nt );
bufrbj,
andle" class="sref">ief="rupthref=s_rive_groua>);
 493
 494        6f ( 495        6     6 goto lass="sref">endfail>);
 496
deleth"dri_rive_array);
 497        6f ( 498        6     69"+codpi/sysfs.c#L550" id="L550" class=6line" nam6="L499"> 499        6     69s/acpi/sysfs.c#L470" id="L470" class=7line" nam7="L500"> 500        7     7      =ssize_cpi_gbl_event_handle__exi">;
ief="rupthref=s_exi">;
 501        7     70rs/acpi/sysfs.c#L492" id="L492" class=7line" nam7="L502"> 502        7     70);
bufrbj,
andle" class="sref">ief="rupthref=s_rive_groua>);
 503        7     70s/acpi/sysfs.c#L494" id="L494" class=7line" nam7="L504"> 504        7     7 deleth"dri_rive_array);
 505        7 else70s/acpi/sysfs.c#L546" id="L546" class=7l6ne" nam7="L496"> 496
 507
 508 499        7eturn70if (<=ssize_t" class="sref">ssize_t  510}
bufruf="_prode=ta>,
,
bufdeva>,
=kobject" class="sref"devictef">kobj_attribute *kobj_aa hreclass="sref">buftr, char * 511
buf)
 512static <7 href71 513        7     713a href="+cod=resuleunters" class=">sprintf(buf)
"\n");
&ass="sref">bufr(].(cpss=="red_prode=ta>,
 514{
 515        7nt  516        7nt kobj_attribute *kobj_aa hre class="sref">cpm_prode=t_tr, char * 517        7a hre7="+code=acpi_hbl_event_handle__ATT_ERROR].bufpm_prode=ta>, char *&ass="sref">bufS_IRUGOa>, char *&ass="sref">bufruf="_prode=ta>,
&ass="sref">bufLL;
 518        7a hre71returi/sysfs.c#L550" id="L550" class=7line" nam7="L519"> 519        7nt i__ini">;
&ass="sref">bufru" cldini">;
 520
 521        7a hre72iresult = 0;
 522        7    523        7a hre723             class="sref">iresult = 0;
u" cldini">;
u" cldini"uf" ccpi/sysfs.c#L548" id="L548" class=7line" nam7="L524"> 524        7   result)
 525        7a hre72goto result ?  526        7   result = 0;
,
bufrbj,
andle" class="sref">pm_prode=t_tr, char *ctr -  527        7a hre72"+code=acpi_h=result" class="sref">result ?  528
 529        7span 7lass="


52fooet_n> The original LXR software by the /sysfs.c#http://sourceforge.net/psojects/lx_n>LXR _alluni"yndex">this experil&qual 0" iion by /sysfs.c#mailto:lx_@9lx_@9 52subfooet_n> lx_.9Redpill Lpsovider of L