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 2011 Nexenta Systems, Inc. All rights reserved. |
24 * Copyright (c) 2010, Intel Corporation. 25 * All rights reserved. 26 */ 27 28#include <sys/types.h> 29#include <sys/atomic.h> 30#include <sys/bitmap.h> 31#include <sys/cmn_err.h> --- 451 unchanged lines hidden (view full) --- 483 * Acpinex driver handles ACPI system events for its children, 484 * device specific events will be handled by device drivers. 485 * Return DDI_SUCCESS on success, and DDI_FAILURE on failure. 486 */ 487static int 488acpinex_event_install_handler(ACPI_HANDLE hdl, void *arg, 489 ACPI_DEVICE_INFO *infop, acpidev_data_handle_t dhdl) 490{ |
491 ACPI_STATUS status; |
492 int rc = DDI_SUCCESS; 493 494 ASSERT(hdl != NULL); 495 ASSERT(dhdl != NULL); 496 ASSERT(infop != NULL); 497 498 /* 499 * Check whether the event handler has already been installed on the 500 * device object. With the introduction of ACPI Alias objects, which are 501 * similar to symlinks in file systems, there may be multiple name 502 * objects in the ACPI namespace pointing to the same underlying device 503 * object. Those Alias objects need to be filtered out, otherwise 504 * it will attempt to install the event handler multiple times on the 505 * same device object which will fail. 506 */ 507 if (acpidev_data_get_flag(dhdl, ACPIDEV_DATA_HANDLER_READY)) { 508 return (DDI_SUCCESS); 509 } |
510 status = AcpiInstallNotifyHandler(hdl, ACPI_SYSTEM_NOTIFY, 511 acpinex_event_system_handler, arg); 512 if (status == AE_OK || status == AE_ALREADY_EXISTS) { |
513 acpidev_data_set_flag(dhdl, ACPIDEV_DATA_HANDLER_READY); 514 } else { 515 char *objname; 516 517 objname = acpidev_get_object_name(hdl); 518 cmn_err(CE_WARN, 519 "!acpinex: failed to install system event handler for %s.", 520 objname); --- 195 unchanged lines hidden --- |