|
| 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 |
| 9 | + * or http://www.opensolaris.org/os/licensing. |
| 10 | + * See the License for the specific language governing permissions |
| 11 | + * and limitations under the License. |
| 12 | + * |
| 13 | + * When distributing Covered Code, include this CDDL HEADER in each |
| 14 | + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
| 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 | + * Copyright 2017 OmniOS Community Edition (OmniOSce) Association. |
| 23 | + * Copyright 2016 Joyent, Inc. |
| 24 | + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. |
| 25 | + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
| 26 | + * Use is subject to license terms. |
| 27 | + */ |
| 28 | + |
| 29 | +#ifndef _ACSOLARIS_H_ |
| 30 | +#define _ACSOLARIS_H_ |
| 31 | + |
| 32 | +#ifdef __cplusplus |
| 33 | +extern "C" { |
| 34 | +#endif |
| 35 | + |
| 36 | +#define __EXTENSIONS__ |
| 37 | + |
| 38 | +#include <sys/types.h> |
| 39 | +#include <sys/sunddi.h> |
| 40 | +#include <sys/varargs.h> |
| 41 | +#include <sys/cpu.h> |
| 42 | +#include <sys/thread.h> |
| 43 | + |
| 44 | +//#include <sys/ctype.h> |
| 45 | +#include <ctype.h> |
| 46 | +#include <strings.h> |
| 47 | +#include <stdlib.h> |
| 48 | +#include <sys/signal.h> |
| 49 | +#include <sys/ucontext.h> |
| 50 | + |
| 51 | +/* Function name used for debug output. */ |
| 52 | +#define ACPI_GET_FUNCTION_NAME __func__ |
| 53 | + |
| 54 | +uint32_t __acpi_acquire_global_lock(void *); |
| 55 | +uint32_t __acpi_release_global_lock(void *); |
| 56 | +void __acpi_wbinvd(void); |
| 57 | +uint32_t acpi_strtoul(const char *, char **, int); |
| 58 | + |
| 59 | +#ifdef _ILP32 |
| 60 | +#define ACPI_MACHINE_WIDTH 32 |
| 61 | +#elif defined(_LP64) |
| 62 | +#define ACPI_MACHINE_WIDTH 64 |
| 63 | +#endif |
| 64 | + |
| 65 | +#define COMPILER_DEPENDENT_INT64 int64_t |
| 66 | +#define COMPILER_DEPENDENT_UINT64 uint64_t |
| 67 | + |
| 68 | +#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) |
| 69 | + |
| 70 | +#define ACPI_PRINTF_LIKE_FUNC |
| 71 | +//#define ACPI_UNUSED_VAR |
| 72 | +#define ACPI_USE_NATIVE_DIVIDE |
| 73 | +#define ACPI_FLUSH_CPU_CACHE() (__acpi_wbinvd()) |
| 74 | + |
| 75 | +//#define ACPI_DISASSEMBLER |
| 76 | +#define ACPI_PACKED_POINTERS_NOT_SUPPORTED |
| 77 | + |
| 78 | +/* |
| 79 | + * Calling conventions: |
| 80 | + * |
| 81 | + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) |
| 82 | + * ACPI_EXTERNAL_XFACE - External ACPI interfaces |
| 83 | + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces |
| 84 | + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces |
| 85 | + */ |
| 86 | +#define ACPI_SYSTEM_XFACE |
| 87 | +#define ACPI_EXTERNAL_XFACE |
| 88 | +#define ACPI_INTERNAL_XFACE |
| 89 | +#define ACPI_INTERNAL_VAR_XFACE |
| 90 | + |
| 91 | +/* |
| 92 | + * The ACPI headers shipped from Intel define a bunch of functions which are |
| 93 | + * already provided by the kernel. The variables below prevent those from |
| 94 | + * being loaded as part of accommon.h. |
| 95 | + */ |
| 96 | +#define ACPI_USE_SYSTEM_CLIBRARY |
| 97 | +#define ACPI_USE_STANDARD_HEADERS |
| 98 | + |
| 99 | +#define ACPI_ASM_MACROS |
| 100 | +#define BREAKPOINT3 |
| 101 | +#define ACPI_DISABLE_IRQS() cli() |
| 102 | +#define ACPI_ENABLE_IRQS() sti() |
| 103 | +#define ACPI_ACQUIRE_GLOBAL_LOCK(Facs, Acq) \ |
| 104 | + ((Acq) = __acpi_acquire_global_lock(Facs)) |
| 105 | + |
| 106 | +#define ACPI_RELEASE_GLOBAL_LOCK(Facs, Acq) \ |
| 107 | + ((Acq) = __acpi_release_global_lock(Facs)) |
| 108 | + |
| 109 | +#ifdef __cplusplus |
| 110 | +} |
| 111 | +#endif |
| 112 | + |
| 113 | +#endif /* _ACSOLARIS_H_ */ |
0 commit comments