xref: /titanic_44/usr/src/uts/sun4v/io/n2rng/n2rng_hcall.s (revision fdd1ecae0dfe07e6aa8ee90687e2e91c876dc189)
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 2007 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#pragma ident	"%Z%%M%	%I%	%E% SMI"
27
28/*
29 * Hypervisor calls called by ncp driver.
30 */
31
32#include <sys/asm_linkage.h>
33#include <sys/hypervisor_api.h>
34#include <sys/n2rng.h>
35
36#if defined(lint) || defined(__lint)
37
38/*ARGSUSED*/
39uint64_t
40hv_rng_get_diag_control()
41{ return (0); }
42
43/*ARGSUSED*/
44uint64_t
45hv_rng_ctl_read(uint64_t ctlregsptr_ra, uint64_t *rstate, uint64_t *tdelta)
46{ return (0); }
47
48/*ARGSUSED*/
49uint64_t
50hv_rng_ctl_write(uint64_t ctlregsptr_ra, uint64_t nstate, uint64_t wtimeout,
51		uint64_t *tdelta)
52{ return (0); }
53
54/*ARGSUSED*/
55uint64_t
56hv_rng_data_read_diag(uint64_t buffer_ra, uint64_t sz, uint64_t *tdelta)
57{ return (0); }
58
59/*ARGSUSED*/
60uint64_t
61hv_rng_data_read(uint64_t buffer_ra, uint64_t *tdelta)
62{ return (0); }
63
64#else	/* lint || __lint */
65
66	/*
67	 * hv_rng_get_diag_control()
68	 */
69	ENTRY(hv_rng_get_diag_control)
70	mov	HV_RNG_GET_DIAG_CONTROL, %o5
71	ta	FAST_TRAP
72	retl
73	nop
74	SET_SIZE(hv_rng_get_diag_control)
75
76	/*
77	 * hv_rng_ctl_read(uint64_t ctlregsptr_ra, uint64_t *rstate,
78	 *		uint64_t *tdelta)
79	 */
80	ENTRY(hv_rng_ctl_read)
81	mov	%o1, %o3
82	mov	%o2, %o4
83	mov	HV_RNG_CTL_READ, %o5
84	ta	FAST_TRAP
85	stx	%o1, [%o3]
86	retl
87	stx	%o2, [%o4]
88	SET_SIZE(hv_rng_ctl_read)
89
90	/*
91	 * hv_rng_ctl_write(uint64_t ctlregsptr_ra, uint64_t nstate,
92	 *		uint64_t wtimeout, uint64_t *tdelta)
93	 */
94	ENTRY(hv_rng_ctl_write)
95	mov	%o3, %o4
96	mov	HV_RNG_CTL_WRITE, %o5
97	ta	FAST_TRAP
98	retl
99	stx	%o1, [%o4]
100	SET_SIZE(hv_rng_ctl_write)
101
102	/*
103	 * hv_rng_data_read_diag(uint64_t buffer_ra, uint64_t sz,
104	 *			uint64_t *tdelta)
105	 */
106	ENTRY(hv_rng_data_read_diag)
107	mov	%o2, %o4
108	mov	HV_RNG_DATA_READ_DIAG, %o5
109	ta	FAST_TRAP
110	retl
111	stx	%o1, [%o4]
112	SET_SIZE(hv_rng_data_read_diag)
113
114	/*
115	 * hv_rng_data_read(uint64_t buffer_ra, uint64_t *tdelta)
116	 */
117	ENTRY(hv_rng_data_read)
118	mov	%o1, %o4
119	mov	HV_RNG_DATA_READ, %o5
120	ta	FAST_TRAP
121	retl
122	stx	%o1, [%o4]
123	SET_SIZE(hv_rng_data_read)
124
125#endif	/* lint || __lint */
126