xref: /onnv-gate/usr/src/uts/common/io/tpm/tpm_hcall.s (revision 10346:9f0b25e42dc5)
1*10334Swyllys.ingersoll@sun.com/*
2*10334Swyllys.ingersoll@sun.com * CDDL HEADER START
3*10334Swyllys.ingersoll@sun.com *
4*10334Swyllys.ingersoll@sun.com * The contents of this file are subject to the terms of the
5*10334Swyllys.ingersoll@sun.com * Common Development and Distribution License (the "License").
6*10334Swyllys.ingersoll@sun.com * You may not use this file except in compliance with the License.
7*10334Swyllys.ingersoll@sun.com *
8*10334Swyllys.ingersoll@sun.com * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*10334Swyllys.ingersoll@sun.com * or http://www.opensolaris.org/os/licensing.
10*10334Swyllys.ingersoll@sun.com * See the License for the specific language governing permissions
11*10334Swyllys.ingersoll@sun.com * and limitations under the License.
12*10334Swyllys.ingersoll@sun.com *
13*10334Swyllys.ingersoll@sun.com * When distributing Covered Code, include this CDDL HEADER in each
14*10334Swyllys.ingersoll@sun.com * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*10334Swyllys.ingersoll@sun.com * If applicable, add the following below this CDDL HEADER, with the
16*10334Swyllys.ingersoll@sun.com * fields enclosed by brackets "[]" replaced with your own identifying
17*10334Swyllys.ingersoll@sun.com * information: Portions Copyright [yyyy] [name of copyright owner]
18*10334Swyllys.ingersoll@sun.com *
19*10334Swyllys.ingersoll@sun.com * CDDL HEADER END
20*10334Swyllys.ingersoll@sun.com */
21*10334Swyllys.ingersoll@sun.com
22*10334Swyllys.ingersoll@sun.com/*
23*10334Swyllys.ingersoll@sun.com * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*10334Swyllys.ingersoll@sun.com * Use is subject to license terms.
25*10334Swyllys.ingersoll@sun.com */
26*10334Swyllys.ingersoll@sun.com
27*10334Swyllys.ingersoll@sun.com/*
28*10334Swyllys.ingersoll@sun.com * Hypervisor calls used by tpm driver
29*10334Swyllys.ingersoll@sun.com */
30*10334Swyllys.ingersoll@sun.com
31*10334Swyllys.ingersoll@sun.com#include <sys/asm_linkage.h>
32*10334Swyllys.ingersoll@sun.com
33*10334Swyllys.ingersoll@sun.com#if defined(sun4v)
34*10334Swyllys.ingersoll@sun.com#include <sys/hypervisor_api.h>
35*10334Swyllys.ingersoll@sun.com
36*10334Swyllys.ingersoll@sun.com#if defined(lint) || defined(__lint)
37*10334Swyllys.ingersoll@sun.com
38*10334Swyllys.ingersoll@sun.com/*ARGSUSED*/
39*10334Swyllys.ingersoll@sun.comuint64_t
40*10334Swyllys.ingersoll@sun.comhcall_tpm_get(uint64_t locality, uint64_t offset, uint64_t size,
41*10334Swyllys.ingersoll@sun.com    uint64_t *value)
42*10334Swyllys.ingersoll@sun.com{
43*10334Swyllys.ingersoll@sun.com	return (0);
44*10334Swyllys.ingersoll@sun.com}
45*10334Swyllys.ingersoll@sun.com
46*10334Swyllys.ingersoll@sun.com/*ARGSUSED*/
47*10334Swyllys.ingersoll@sun.comuint64_t
48*10334Swyllys.ingersoll@sun.comhcall_tpm_put(uint64_t locality, uint64_t offset, uint64_t size,
49*10334Swyllys.ingersoll@sun.com    uint64_t value)
50*10334Swyllys.ingersoll@sun.com{
51*10334Swyllys.ingersoll@sun.com	return (0);
52*10334Swyllys.ingersoll@sun.com}
53*10334Swyllys.ingersoll@sun.com
54*10334Swyllys.ingersoll@sun.com#else  /* lint || __lint */
55*10334Swyllys.ingersoll@sun.com
56*10334Swyllys.ingersoll@sun.com/*
57*10334Swyllys.ingersoll@sun.com * hcall_tpm_get(uint64_t locality, uint64_t offset, uint64_t size,
58*10334Swyllys.ingersoll@sun.com *     uint64_t *value)
59*10334Swyllys.ingersoll@sun.com */
60*10334Swyllys.ingersoll@sun.com	ENTRY(hcall_tpm_get)
61*10334Swyllys.ingersoll@sun.com	mov	%o3, %g1
62*10334Swyllys.ingersoll@sun.com	mov	HV_TPM_GET, %o5
63*10334Swyllys.ingersoll@sun.com	ta	FAST_TRAP
64*10334Swyllys.ingersoll@sun.com	stx	%o1, [%g1]
65*10334Swyllys.ingersoll@sun.com	retl
66*10334Swyllys.ingersoll@sun.com	nop
67*10334Swyllys.ingersoll@sun.com	SET_SIZE(hcall_tpm_get)
68*10334Swyllys.ingersoll@sun.com
69*10334Swyllys.ingersoll@sun.com/*
70*10334Swyllys.ingersoll@sun.com * uint64_t
71*10334Swyllys.ingersoll@sun.com * hcall_tpm_put(uint64_t locality, uint64_t offset, uint64_t size,
72*10334Swyllys.ingersoll@sun.com *     uint64_t value)
73*10334Swyllys.ingersoll@sun.com */
74*10334Swyllys.ingersoll@sun.com	ENTRY(hcall_tpm_put)
75*10334Swyllys.ingersoll@sun.com	mov	HV_TPM_PUT, %o5
76*10334Swyllys.ingersoll@sun.com	ta	FAST_TRAP
77*10334Swyllys.ingersoll@sun.com	retl
78*10334Swyllys.ingersoll@sun.com	nop
79*10334Swyllys.ingersoll@sun.com	SET_SIZE(hcall_tpm_put)
80*10334Swyllys.ingersoll@sun.com
81*10334Swyllys.ingersoll@sun.com#endif /* lint || __lint */
82*10334Swyllys.ingersoll@sun.com
83*10334Swyllys.ingersoll@sun.com#endif /* defined(sun4v) */
84