/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2012 NetApp, Inc.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#ifndef _ACPI_H_29#define _ACPI_H_3031#include "acpi_device.h"3233#define SCI_INT 93435#define SMI_CMD 0xb236#define BHYVE_ACPI_ENABLE 0xa037#define BHYVE_ACPI_DISABLE 0xa13839#define PM1A_EVT_ADDR 0x40040#define PM1A_CNT_ADDR 0x4044142#define IO_PMTMR 0x408 /* 4-byte i/o port for the timer */4344#define IO_GPE0_BLK 0x40c /* 2x 1-byte IO port for GPE0_STS/EN */45#define IO_GPE0_LEN 0x24647#define IO_GPE0_STS IO_GPE0_BLK48#define IO_GPE0_EN (IO_GPE0_BLK + (IO_GPE0_LEN / 2))4950/* Allocated GPE bits. */51#define GPE_VMGENC 05253struct vmctx;5455int acpi_build(struct vmctx *ctx, int ncpu);56void acpi_raise_gpe(struct vmctx *ctx, unsigned bit);57int acpi_tables_add_device(const struct acpi_device *const dev);58int acpi_add_vcpu_affinity(int vcpuid, int domain);59void dsdt_line(const char *fmt, ...) __printflike(1, 2);60void dsdt_fixed_ioport(uint16_t iobase, uint16_t length);61void dsdt_fixed_irq(uint8_t irq);62void dsdt_fixed_mem32(uint32_t base, uint32_t length);63void dsdt_indent(int levels);64void dsdt_unindent(int levels);65void sci_init(struct vmctx *ctx);6667#endif /* _ACPI_H_ */686970