Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / include / hypervisor.h
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: hypervisor.h
5* Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
6* 4150 Network Circle, Santa Clara, California 95054, U.S.A.
7*
8* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9*
10* This program is free software; you can redistribute it and/or modify
11* it under the terms of the GNU General Public License as published by
12* the Free Software Foundation; version 2 of the License.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
19* You should have received a copy of the GNU General Public License
20* along with this program; if not, write to the Free Software
21* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*
23* For the avoidance of doubt, and except that if any non-GPL license
24* choice is available it will apply instead, Sun elects to use only
25* the General Public License version 2 (GPLv2) at this time for any
26* software where a choice of GPL license versions is made
27* available with the language indicating that GPLv2 or any later version
28* may be used, or where a choice of which version of the GPL is applied is
29* otherwise unspecified.
30*
31* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
32* CA 95054 USA or visit www.sun.com if you need additional information or
33* have any questions.
34*
35*
36* ========== Copyright Header End ============================================
37*/
38#ifndef _HYPERVISOR_H
39#define _HYPERVISOR_H
40
41#pragma ident "@(#)hypervisor.h 1.13 04/05/12 SMI"
42
43/*
44 * Common HyperVisor definitions
45 */
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51/*
52 * Hypervisor software trap numbers
53 */
54#define FAST_TRAP 0x80
55#define CPU_TICK_NPT 0x81
56#define CPU_STICK_NPT 0x82
57#define MMU_MAP_ADDR 0x83
58#define MMU_UNMAP_ADDR 0x84
59
60/*
61 * Hypervisor function numbers for FAST_TRAP
62 */
63#define PART_EXIT 0x00
64#define CPU_START 0x10
65#define CPU_STOP 0x11
66#define CPU_YIELD 0x12
67#define CPU_UPDATE_SIGNATURE 0x13
68#define CPU_QCONF 0x14
69#define CPU_QINFO 0x15
70#define CPU_MYID 0x16
71#define MMU_TSB_CTX0 0x20
72#define MMU_TSB_CTXNON0 0x21
73#define MMU_DEMAP_PAGE 0x22
74#define MMU_DEMAP_CTX 0x23
75#define MMU_DEMAP_ALL 0x24
76#define MMU_MAP_PERM_ADDR 0x25
77#define MMU_FAULT_AREA 0x26
78#define MMU_ENABLE 0x27
79#define CACHE_FLUSH_VPAGE 0x30
80#define MEM_SCRUB 0x31
81#define INTR_MAP 0x40
82#define INTR_UNMAP 0x41
83#define INTR_SEND 0x42
84#define TOD_GET 0x50
85#define TOD_SET 0x51
86#define CONS_GETCHAR 0x60
87#define CONS_PUTCHAR 0x61
88#define NVRAM_READ 0x70
89#define NVRAM_WRITE 0x71
90
91#define VPCI_IO_PEEK 0xb6
92#define VPCI_IO_POKE 0xb7
93#define VPCI_DMA_SYNC 0xb8
94#define IO_PEEK 0xb9
95#define IO_POKE 0xba
96
97#ifdef CONFIG_DISK /* Simulation hack */
98#define DISK_READ 0xf0
99#define DISK_WRITE 0xf1
100#endif
101
102#ifdef CONFIG_FREEZETHAW
103#define GUEST_FREEZE 0xf2
104#define GUEST_THAW 0xf3
105#endif
106
107#define OLD_CPU_MYID 0xf4 /* replaced by CPU_MYID */
108#define CPU_MONDO 0xf6 /* XXX temporary hack */
109#define FAKE_INTR 0xf7 /* XXX temporary hack */
110#define CONS_STATUS 0xf8
111#define CONS_SETINTR 0xf9
112
113#define RA_TO_PA 0x200
114#define HPRIVCALL 0x201
115
116/*
117 * flags
118 */
119#define MAP_DTLB 0x1
120#define MAP_ITLB 0x2
121
122/*
123 * Limits
124 */
125#define NPERMMAPPINGS 8 /* XXX i&d, should be {n} of each */
126
127#define MMU_FAULT_AREA_SIZE 0x80
128
129/*
130 * Error codes
131 */
132#define EOK 0 /* No error */
133#define ENOCPU 1 /* Invalid CPU id */
134#define ENORADDR 2 /* Invalid real address */
135#define ENOINTR 3 /* Invalid interrupt id */
136#define EBADPGSZ 4 /* Invalid page size encoding */
137#define EBADTSB 5 /* Invalid TSB description */
138#define EINVAL 6 /* Invalid argument */
139#define EBADTRAP 7 /* Invalid function number */
140#define EBADALIGN 8 /* Invalid address alignment */
141#define EWOULDBLOCK 9 /* Call would block */
142#define ENOACCESS 10 /* No access to resource */
143
144
145/*
146 * Return values
147 */
148
149/* cons_getchar special character values (64-bit) */
150#define CONS_BREAK -1
151#define CONS_HUP -2
152
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif /* _HYPERVISOR_H */