18e56767dSsmall /* 28e56767dSsmall * CDDL HEADER START 38e56767dSsmall * 48e56767dSsmall * The contents of this file are subject to the terms of the 530082d0cSmyers * Common Development and Distribution License (the "License"). 630082d0cSmyers * You may not use this file except in compliance with the License. 78e56767dSsmall * 88e56767dSsmall * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 98e56767dSsmall * or http://www.opensolaris.org/os/licensing. 108e56767dSsmall * See the License for the specific language governing permissions 118e56767dSsmall * and limitations under the License. 128e56767dSsmall * 138e56767dSsmall * When distributing Covered Code, include this CDDL HEADER in each 148e56767dSsmall * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 158e56767dSsmall * If applicable, add the following below this CDDL HEADER, with the 168e56767dSsmall * fields enclosed by brackets "[]" replaced with your own identifying 178e56767dSsmall * information: Portions Copyright [yyyy] [name of copyright owner] 188e56767dSsmall * 198e56767dSsmall * CDDL HEADER END 208e56767dSsmall */ 217c478bd9Sstevel@tonic-gate /* 22*26f3cdf0SGordon Ross * Copyright 2011 Nexenta Systems, Inc. All rights reserved. 23aa2aa9a6SDana Myers * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 278e56767dSsmall #ifndef _ACSOLARIS_H_ 288e56767dSsmall #define _ACSOLARIS_H_ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifdef __cplusplus 317c478bd9Sstevel@tonic-gate extern "C" { 327c478bd9Sstevel@tonic-gate #endif 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #include <sys/types.h> 357c478bd9Sstevel@tonic-gate #include <sys/sunddi.h> 367c478bd9Sstevel@tonic-gate #include <sys/varargs.h> 377c478bd9Sstevel@tonic-gate #include <sys/cpu.h> 38aa2aa9a6SDana Myers #include <sys/thread.h> 397c478bd9Sstevel@tonic-gate 40*26f3cdf0SGordon Ross /* Function name used for debug output. */ 41*26f3cdf0SGordon Ross #define ACPI_GET_FUNCTION_NAME __func__ 427c478bd9Sstevel@tonic-gate 43db2bae30SDana Myers uint32_t __acpi_acquire_global_lock(void *); 44db2bae30SDana Myers uint32_t __acpi_release_global_lock(void *); 457c478bd9Sstevel@tonic-gate void __acpi_wbinvd(void); 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate #ifdef _ILP32 487c478bd9Sstevel@tonic-gate #define ACPI_MACHINE_WIDTH 32 497c478bd9Sstevel@tonic-gate #elif defined(_LP64) 507c478bd9Sstevel@tonic-gate #define ACPI_MACHINE_WIDTH 64 517c478bd9Sstevel@tonic-gate #endif 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate #define COMPILER_DEPENDENT_INT64 int64_t 547c478bd9Sstevel@tonic-gate #define COMPILER_DEPENDENT_UINT64 uint64_t 557c478bd9Sstevel@tonic-gate 56*26f3cdf0SGordon Ross #define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) 5727f7c583Smyers 587c478bd9Sstevel@tonic-gate #define ACPI_PRINTF_LIKE_FUNC 597c478bd9Sstevel@tonic-gate #define ACPI_UNUSED_VAR 607c478bd9Sstevel@tonic-gate #define ACPI_USE_NATIVE_DIVIDE 617c478bd9Sstevel@tonic-gate #define ACPI_FLUSH_CPU_CACHE() (__acpi_wbinvd()) 627c478bd9Sstevel@tonic-gate 6330082d0cSmyers #define ACPI_DISASSEMBLER 6427f7c583Smyers #define ACPI_PACKED_POINTERS_NOT_SUPPORTED 6530082d0cSmyers 667c478bd9Sstevel@tonic-gate /* 677c478bd9Sstevel@tonic-gate * Calling conventions: 687c478bd9Sstevel@tonic-gate * 697c478bd9Sstevel@tonic-gate * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 707c478bd9Sstevel@tonic-gate * ACPI_EXTERNAL_XFACE - External ACPI interfaces 717c478bd9Sstevel@tonic-gate * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 727c478bd9Sstevel@tonic-gate * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate #define ACPI_SYSTEM_XFACE 757c478bd9Sstevel@tonic-gate #define ACPI_EXTERNAL_XFACE 767c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_XFACE 777c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_VAR_XFACE 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate #define ACPI_ASM_MACROS 807c478bd9Sstevel@tonic-gate #define BREAKPOINT3 817c478bd9Sstevel@tonic-gate #define ACPI_DISABLE_IRQS() cli() 827c478bd9Sstevel@tonic-gate #define ACPI_ENABLE_IRQS() sti() 83db2bae30SDana Myers #define ACPI_ACQUIRE_GLOBAL_LOCK(Facs, Acq) \ 84db2bae30SDana Myers ((Acq) = __acpi_acquire_global_lock(Facs)) 857c478bd9Sstevel@tonic-gate 86db2bae30SDana Myers #define ACPI_RELEASE_GLOBAL_LOCK(Facs, Acq) \ 87db2bae30SDana Myers ((Acq) = __acpi_release_global_lock(Facs)) 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate #ifdef __cplusplus 907c478bd9Sstevel@tonic-gate } 917c478bd9Sstevel@tonic-gate #endif 927c478bd9Sstevel@tonic-gate 938e56767dSsmall #endif /* _ACSOLARIS_H_ */ 94