Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / hypervisor / src / greatlakes / common / include / mau_api.h
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* Hypervisor Software File: mau_api.h
5*
6* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
7*
8* - Do no alter or remove copyright notices
9*
10* - Redistribution and use of this software in source and binary forms, with
11* or without modification, are permitted provided that the following
12* conditions are met:
13*
14* - Redistribution of source code must retain the above copyright notice,
15* this list of conditions and the following disclaimer.
16*
17* - Redistribution in binary form must reproduce the above copyright notice,
18* this list of conditions and the following disclaimer in the
19* documentation and/or other materials provided with the distribution.
20*
21* Neither the name of Sun Microsystems, Inc. or the names of contributors
22* may be used to endorse or promote products derived from this software
23* without specific prior written permission.
24*
25* This software is provided "AS IS," without a warranty of any kind.
26* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
27* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
28* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
29* MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
30* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
31* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
32* OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
33* FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
34* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
35* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
36* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
37*
38* You acknowledge that this software is not designed, licensed or
39* intended for use in the design, construction, operation or maintenance of
40* any nuclear facility.
41*
42* ========== Copyright Header End ============================================
43*/
44/*
45 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
46 * Use is subject to license terms.
47 */
48
49#ifndef _MAU_API_H
50#define _MAU_API_H
51
52#pragma ident "@(#)mau_api.h 1.1 07/05/03 SMI"
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58#ifndef _ASM
59/* Forward typedefs */
60typedef union ma_ctl ma_ctl_t;
61typedef union ma_mpa ma_mpa_t;
62typedef union ma_ma ma_ma_t;
63typedef uint64_t ma_np_t;
64
65/*
66 * Modulare Arithmetic Unit (MA) control register definition.
67 */
68union ma_ctl {
69 uint64_t value;
70 struct {
71 uint64_t reserved1:50;
72 uint64_t invert_parity:1;
73 uint64_t thread:2;
74 uint64_t busy:1;
75 uint64_t interrupt:1;
76 uint64_t operation:3;
77 uint64_t length:6;
78 } bits;
79};
80#endif /* _ASM */
81
82/* Values for ma_ctl operation field */
83#define MA_OP_LOAD 0x0
84#define MA_OP_STORE 0x1
85#define MA_OP_MULTIPLY 0x2
86#define MA_OP_REDUCE 0x3
87#define MA_OP_EXPONENTIATE 0x4
88
89#define MA_WORDS2BYTES_SHIFT 3 /* log2(sizeof(uint64_t)) */
90
91/* The MA memory is 1280 bytes (160 8 byte words) */
92#define MA_SIZE 1280
93
94/* We can only load 64 8 byte words at a time */
95#define MA_LOAD_MAX 64
96
97#ifndef _ASM
98union ma_mpa {
99 uint64_t value;
100 struct {
101 uint64_t reserved0:24;
102 uint64_t address:37;
103 uint64_t reserved1:3;
104 } bits;
105};
106
107union ma_ma {
108 uint64_t value;
109 struct {
110 uint64_t reserved0:16;
111 uint64_t address5:8;
112 uint64_t address4:8;
113 uint64_t address3:8;
114 uint64_t address2:8;
115 uint64_t address1:8;
116 uint64_t address0:8;
117 } bits;
118};
119
120#endif /* _ASM */
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* _MAU_API_H */