1263744Stychon/*-
2336190Saraujo * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3336190Saraujo *
4263744Stychon * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
5263744Stychon * Copyright (c) 2011 NetApp, Inc.
6263744Stychon * All rights reserved.
7263744Stychon *
8263744Stychon * Redistribution and use in source and binary forms, with or without
9263744Stychon * modification, are permitted provided that the following conditions
10263744Stychon * are met:
11263744Stychon * 1. Redistributions of source code must retain the above copyright
12263744Stychon *    notice, this list of conditions and the following disclaimer.
13263744Stychon * 2. Redistributions in binary form must reproduce the above copyright
14263744Stychon *    notice, this list of conditions and the following disclaimer in the
15263744Stychon *    documentation and/or other materials provided with the distribution.
16263744Stychon *
17263744Stychon * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
18263744Stychon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19263744Stychon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20263744Stychon * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
21263744Stychon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22263744Stychon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23263744Stychon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24263744Stychon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25263744Stychon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26263744Stychon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27263744Stychon * SUCH DAMAGE.
28263744Stychon *
29263744Stychon * $FreeBSD: stable/11/sys/amd64/vmm/io/vatpit.h 336190 2018-07-11 07:19:42Z araujo $
30263744Stychon */
31263744Stychon
32263744Stychon#ifndef _VATPIT_H_
33263744Stychon#define	_VATPIT_H_
34263744Stychon
35263744Stychon#include <machine/timerreg.h>
36263744Stychon
37264631Stychon#define	NMISC_PORT	0x61
38264631Stychon
39263744Stychonstruct vatpit *vatpit_init(struct vm *vm);
40263744Stychonvoid vatpit_cleanup(struct vatpit *vatpit);
41263744Stychon
42273706Sneelint vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
43264648Stychon    uint32_t *eax);
44273706Sneelint vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port,
45273706Sneel    int bytes, uint32_t *eax);
46263744Stychon
47263744Stychon#endif	/* _VATPIT_H_ */
48