Deleted Added
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2010, Intel Corporation.
24 * All rights reserved.
25 */
26
27#include <sys/types.h>
28#include <sys/atomic.h>
29#include <sys/bitmap.h>
30#include <sys/cmn_err.h>

--- 451 unchanged lines hidden (view full) ---

482 * Acpinex driver handles ACPI system events for its children,
483 * device specific events will be handled by device drivers.
484 * Return DDI_SUCCESS on success, and DDI_FAILURE on failure.
485 */
486static int
487acpinex_event_install_handler(ACPI_HANDLE hdl, void *arg,
488 ACPI_DEVICE_INFO *infop, acpidev_data_handle_t dhdl)
489{
490 int rc = DDI_SUCCESS;
491
492 ASSERT(hdl != NULL);
493 ASSERT(dhdl != NULL);
494 ASSERT(infop != NULL);
495
496 /*
497 * Check whether the event handler has already been installed on the
498 * device object. With the introduction of ACPI Alias objects, which are
499 * similar to symlinks in file systems, there may be multiple name
500 * objects in the ACPI namespace pointing to the same underlying device
501 * object. Those Alias objects need to be filtered out, otherwise
502 * it will attempt to install the event handler multiple times on the
503 * same device object which will fail.
504 */
505 if (acpidev_data_get_flag(dhdl, ACPIDEV_DATA_HANDLER_READY)) {
506 return (DDI_SUCCESS);
507 }
508 if (ACPI_SUCCESS(AcpiInstallNotifyHandler(hdl, ACPI_SYSTEM_NOTIFY,
509 acpinex_event_system_handler, arg))) {
510 acpidev_data_set_flag(dhdl, ACPIDEV_DATA_HANDLER_READY);
511 } else {
512 char *objname;
513
514 objname = acpidev_get_object_name(hdl);
515 cmn_err(CE_WARN,
516 "!acpinex: failed to install system event handler for %s.",
517 objname);

--- 195 unchanged lines hidden ---