xref: /freebsd/sys/dev/hyperv/vmbus/hyperv_var.h (revision 2b887687edc25bb4553f0d8a1183f454a85d413d)
15cb904dcSSepherosa Ziehau /*-
25cb904dcSSepherosa Ziehau  * Copyright (c) 2016 Microsoft Corp.
35cb904dcSSepherosa Ziehau  * All rights reserved.
45cb904dcSSepherosa Ziehau  *
55cb904dcSSepherosa Ziehau  * Redistribution and use in source and binary forms, with or without
65cb904dcSSepherosa Ziehau  * modification, are permitted provided that the following conditions
75cb904dcSSepherosa Ziehau  * are met:
85cb904dcSSepherosa Ziehau  * 1. Redistributions of source code must retain the above copyright
95cb904dcSSepherosa Ziehau  *    notice unmodified, this list of conditions, and the following
105cb904dcSSepherosa Ziehau  *    disclaimer.
115cb904dcSSepherosa Ziehau  * 2. Redistributions in binary form must reproduce the above copyright
125cb904dcSSepherosa Ziehau  *    notice, this list of conditions and the following disclaimer in the
135cb904dcSSepherosa Ziehau  *    documentation and/or other materials provided with the distribution.
145cb904dcSSepherosa Ziehau  *
155cb904dcSSepherosa Ziehau  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
165cb904dcSSepherosa Ziehau  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
175cb904dcSSepherosa Ziehau  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
185cb904dcSSepherosa Ziehau  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
195cb904dcSSepherosa Ziehau  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
205cb904dcSSepherosa Ziehau  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
215cb904dcSSepherosa Ziehau  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
225cb904dcSSepherosa Ziehau  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
235cb904dcSSepherosa Ziehau  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
245cb904dcSSepherosa Ziehau  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
255cb904dcSSepherosa Ziehau  */
265cb904dcSSepherosa Ziehau 
275cb904dcSSepherosa Ziehau #ifndef _HYPERV_VAR_H_
285cb904dcSSepherosa Ziehau #define _HYPERV_VAR_H_
295cb904dcSSepherosa Ziehau 
305cb904dcSSepherosa Ziehau extern u_int	hyperv_recommends;
315cb904dcSSepherosa Ziehau 
329729f076SSouradeep Chakrabarti struct hypercall_ctx {
339729f076SSouradeep Chakrabarti     void            *hc_addr;
349729f076SSouradeep Chakrabarti     vm_paddr_t      hc_paddr;
359729f076SSouradeep Chakrabarti };
36*2b887687SSouradeep Chakrabarti 
37236764b1SSepherosa Ziehau uint64_t	hypercall_post_message(bus_addr_t msg_paddr);
38562d480bSSepherosa Ziehau uint64_t	hypercall_signal_event(bus_addr_t monprm_paddr);
39*2b887687SSouradeep Chakrabarti uint64_t	hypercall_do_md(uint64_t input, uint64_t in_addr,
40*2b887687SSouradeep Chakrabarti 		    uint64_t out_addr);
41*2b887687SSouradeep Chakrabarti struct hv_vpset;
42*2b887687SSouradeep Chakrabarti struct vmbus_softc;
43236764b1SSepherosa Ziehau 
44*2b887687SSouradeep Chakrabarti uint64_t
45*2b887687SSouradeep Chakrabarti hv_do_rep_hypercall(uint16_t code, uint16_t rep_count, uint16_t varhead_size,
46*2b887687SSouradeep Chakrabarti     uint64_t input, uint64_t output);
47*2b887687SSouradeep Chakrabarti int
48*2b887687SSouradeep Chakrabarti hv_cpumask_to_vpset(struct hv_vpset *vpset, const cpuset_t *cpus,
49*2b887687SSouradeep Chakrabarti     struct vmbus_softc *sc);
505cb904dcSSepherosa Ziehau #endif	/* !_HYPERV_VAR_H_ */
51