1243327Sgrehan/*-
2243327Sgrehan * Copyright (c) 2012 NetApp, Inc.
3243327Sgrehan * All rights reserved.
4243327Sgrehan *
5243327Sgrehan * Redistribution and use in source and binary forms, with or without
6243327Sgrehan * modification, are permitted provided that the following conditions
7243327Sgrehan * are met:
8243327Sgrehan * 1. Redistributions of source code must retain the above copyright
9243327Sgrehan *    notice, this list of conditions and the following disclaimer.
10243327Sgrehan * 2. Redistributions in binary form must reproduce the above copyright
11243327Sgrehan *    notice, this list of conditions and the following disclaimer in the
12243327Sgrehan *    documentation and/or other materials provided with the distribution.
13243327Sgrehan *
14243327Sgrehan * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
15243327Sgrehan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16243327Sgrehan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17243327Sgrehan * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
18243327Sgrehan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19243327Sgrehan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20243327Sgrehan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21243327Sgrehan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22243327Sgrehan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23243327Sgrehan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24243327Sgrehan * SUCH DAMAGE.
25243327Sgrehan *
26243327Sgrehan * $FreeBSD$
27243327Sgrehan */
28243327Sgrehan
29243327Sgrehan#ifndef _ACPI_H_
30243327Sgrehan#define _ACPI_H_
31243327Sgrehan
32261090Sjhb#define	SCI_INT			9
33261090Sjhb
34261090Sjhb#define	SMI_CMD			0xb2
35261090Sjhb#define	BHYVE_ACPI_ENABLE	0xa0
36261090Sjhb#define	BHYVE_ACPI_DISABLE	0xa1
37261090Sjhb
38261090Sjhb#define	PM1A_EVT_ADDR		0x400
39261090Sjhb#define	PM1A_CNT_ADDR		0x404
40261090Sjhb
41261090Sjhb#define	IO_PMTMR		0x408	/* 4-byte i/o port for the timer */
42261090Sjhb
43261090Sjhbstruct vmctx;
44261090Sjhb
45259301Sgrehanint	acpi_build(struct vmctx *ctx, int ncpu);
46261265Sjhbvoid	dsdt_line(const char *fmt, ...);
47261265Sjhbvoid	dsdt_fixed_ioport(uint16_t iobase, uint16_t length);
48261265Sjhbvoid	dsdt_fixed_irq(uint8_t irq);
49261265Sjhbvoid	dsdt_fixed_mem32(uint32_t base, uint32_t length);
50261265Sjhbvoid	dsdt_indent(int levels);
51261265Sjhbvoid	dsdt_unindent(int levels);
52268972Sjhbvoid	sci_init(struct vmctx *ctx);
53243327Sgrehan
54243327Sgrehan#endif /* _ACPI_H_ */
55