Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | \ ========== Copyright Header Begin ========================================== |
2 | \ | |
3 | \ Hypervisor Software File: ldc-struct.fth | |
4 | \ | |
5 | \ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | \ | |
7 | \ - Do no alter or remove copyright notices | |
8 | \ | |
9 | \ - Redistribution and use of this software in source and binary forms, with | |
10 | \ or without modification, are permitted provided that the following | |
11 | \ conditions are met: | |
12 | \ | |
13 | \ - Redistribution of source code must retain the above copyright notice, | |
14 | \ this list of conditions and the following disclaimer. | |
15 | \ | |
16 | \ - Redistribution in binary form must reproduce the above copyright notice, | |
17 | \ this list of conditions and the following disclaimer in the | |
18 | \ documentation and/or other materials provided with the distribution. | |
19 | \ | |
20 | \ Neither the name of Sun Microsystems, Inc. or the names of contributors | |
21 | \ may be used to endorse or promote products derived from this software | |
22 | \ without specific prior written permission. | |
23 | \ | |
24 | \ This software is provided "AS IS," without a warranty of any kind. | |
25 | \ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
26 | \ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
27 | \ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
28 | \ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
29 | \ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
30 | \ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
31 | \ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
32 | \ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
33 | \ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
34 | \ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
35 | \ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
36 | \ | |
37 | \ You acknowledge that this software is not designed, licensed or | |
38 | \ intended for use in the design, construction, operation or maintenance of | |
39 | \ any nuclear facility. | |
40 | \ | |
41 | \ ========== Copyright Header End ============================================ | |
42 | id: @(#)ldc-struct.fth 1.4 07/04/10 | |
43 | purpose: Implements logical Domain Communication | |
44 | copyright: Copyright 2007 Sun Microsystems, Inc. All Rights Reserved | |
45 | copyright: Use is subject to license terms. | |
46 | ||
47 | \ Hypervisor APIs | |
48 | h# e0 constant tt-ldc-tx-qconf | |
49 | h# e1 constant tt-ldc-tx-qinfo | |
50 | h# e2 constant tt-ldc-tx-get-state | |
51 | h# e3 constant tt-ldc-tx-set-qtail | |
52 | h# e4 constant tt-ldc-rx-qconf | |
53 | h# e5 constant tt-ldc-rx-qinfo | |
54 | h# e6 constant tt-ldc-rx-get-state | |
55 | h# e7 constant tt-ldc-rx-set-qhead | |
56 | h# ea constant tt-ldc-set-map-table | |
57 | h# eb constant tt-ldc-get-map-table | |
58 | h# ec constant tt-ldc-copy | |
59 | h# ed constant tt-ldc-mapin | |
60 | h# ee constant tt-ldc-unmap | |
61 | h# ef constant tt-ldc-revoke | |
62 | ||
63 | d# 48 constant max-ldc-payload-reli | |
64 | d# 56 constant max-ldc-payload-unreli | |
65 | d# 64 constant /ldc-msg-pkt | |
66 | ||
67 | defer max-ldc-payload ' max-ldc-payload-unreli is max-ldc-payload | |
68 | ||
69 | d# 2000 constant max-ldc-chan-ids | |
70 | ||
71 | \ Reliable Datagram Packet: | |
72 | \ 6 3 3 2 2 1 1 | |
73 | \ 3 2 1 4 3 6 5 8 7 0 | |
74 | \ +------------------------+-----+-----+------+------+ | |
75 | \ word 0: | msgid | env | ctrl| stype| type | | |
76 | \ +------------------------+-----+-----+------+------+ | |
77 | \ word 1: | ackid | version/reserved | | |
78 | \ +--------------------------------------------------+ | |
79 | \ word 2-7 | data payload | | |
80 | \ +--------------------------------------------------+ | |
81 | ||
82 | struct | |
83 | /c field >ldc-type | |
84 | /c field >ldc-stype | |
85 | /c field >ldc-ctrl | |
86 | /c field >ldc-env | |
87 | /l field >ldc-msgid | |
88 | constant /ldc-header-common | |
89 | ||
90 | struct | |
91 | /ldc-header-common field >ldc-hd-common | |
92 | dup constant /ldc-data-unreli | |
93 | \ By default assume unreliable transport, the offset will be set appropriately | |
94 | \ later on | |
95 | value ldc-data-off | |
96 | ||
97 | struct | |
98 | /ldc-header-common field >ldc-hd-common1 | |
99 | /l field >ldc-reserved | |
100 | /l field >ldc-ackid | |
101 | constant /ldc-data-reli | |
102 | ||
103 | \ The reserved field actually holds version information in the first couple | |
104 | \ packets exchanged.... For data transfers the field is reserved. | |
105 | alias >ldc-version >ldc-reserved | |
106 | ||
107 | ||
108 | 6 constant ldc-msg-pkt-shift | |
109 | ||
110 | \ LDC Base_raddr must be aligned exactly to match the queue size, | |
111 | \ 4k entries X 64 bytes/pkt = 256K queue size | |
112 | h# 1000 constant ldc-queue-entries | |
113 | /ldc-msg-pkt ldc-queue-entries * constant ldc-queue-size | |
114 | ||
115 | \ Define LDC Message Types, for the >ldc-type field | |
116 | 1 constant ldc-ctrl-type | |
117 | 2 constant ldc-data-type | |
118 | h# 10 constant ldc-err-type | |
119 | ||
120 | \ LDC Message Subtypes | |
121 | 1 constant ldc-info | |
122 | 2 constant ldc-ack | |
123 | 4 constant ldc-nack | |
124 | ||
125 | \ Define LDC Ctrl messages, for the >ldc-ctrl field | |
126 | 1 constant ldc-ver \ Version message | |
127 | 2 constant ldc-rts \ request to send | |
128 | 3 constant ldc-rtr \ ready to receive | |
129 | 4 constant ldc-rdx \ Ready for Data eXchange | |
130 | ||
131 | \ LDC error messages | |
132 | h# 10 constant ldc-inv-session | |
133 | h# 20 constant ldc-inv-ver | |
134 | h# 30 constant ldc-inv-pkt | |
135 | ||
136 | \ LDC States | |
137 | 0 constant ldc-down | |
138 | 1 constant ldc-up | |
139 | 2 constant ldc-reset | |
140 | ||
141 | \ LDC Error code | |
142 | h# ffff constant LDC-NOTUP | |
143 | ||
144 | \ Protocol type | |
145 | 0 constant ldc-mode-raw | |
146 | 1 constant ldc-mode-unreliable | |
147 | \ 2 (reserved) | |
148 | 3 constant ldc-mode-reliable | |
149 | ||
150 | \ Packet Envelope: For data bearing LDC packets, indicate the number of | |
151 | \ bytes of data in the current packet. | |
152 | \ 'start/stop' field indicates whether the data is a fragment | |
153 | \ in a multi-packet transfer. | |
154 | \ The last packet in a multi-packet transfer is indicated using 'stop' bit. | |
155 | ||
156 | \ 3 3 2 2 | |
157 | \ 1 0 9 4 | |
158 | \ +-------+-------+-------+-------+-------+ | |
159 | \ | stop | start | pkt_size | | |
160 | \ +-------+-------+-------+-------+-------+ | |
161 | ||
162 | \ Packets between start & stop does not have any bit set, single packet | |
163 | \ has both bits set. | |
164 | h# 40 constant start-pkt-bit | |
165 | h# 80 constant stop-pkt-bit | |
166 | h# 3f constant pkt-size-mask | |
167 | h# c0 constant multi-bit-mask | |
168 | ||
169 | \ Internal LDC Msg ctrl Codes | |
170 | 1 constant ldc-bulk-xfer | |
171 | ||
172 | struct | |
173 | /l field >ldc-chan-id | |
174 | /l field >ldc-chan-used | |
175 | /l field >ldc-chan-pad1 | |
176 | /l field >ldc-chan-pad2 | |
177 | constant /ldc-chan-state | |
178 | ||
179 | h# 2000 constant pagesize | |
180 | d# 13 constant pagesizeshift | |
181 | 0 constant pagesize8K | |
182 | ||
183 | \ LDC Map Table Entry | |
184 | \ | |
185 | \ 63 57 56 55 13 12 11 10 9 8 7 6 5 4 3 0 | |
186 | \ +------+--------+---------+-----+----+---+---+---+---+--+--+--+-------+ | |
187 | \ | rsvd | in-use | raddr | sw1 |sw2 |cpw|cpr|iow|ior|x |w |r | pgsz | | |
188 | \ +------+--------+---------+-----+----+---+---+---+---+--+--+--+-------+ | |
189 | \ | revocation cookie | | |
190 | \ +---------------------------------------------------------------------+ | |
191 | ||
192 | struct | |
193 | /x field >ldc-mt-ent1 | |
194 | /x field >ldc-mt-rcookie | |
195 | constant /ldc-mt-ent | |
196 | ||
197 | d# 9 constant ldc-cprw-shift | |
198 | d# 13 constant ldcmtbl-ra-shift | |
199 | 6 constant num-cookies \ max # of cookies in map table | |
200 | ||
201 | 3 ldc-cprw-shift << pagesize8K or constant mt-entry-misc | |
202 | ||
203 | h# ffff.e000 h# 0fff.ffff lxjoin constant mt-ra-mask | |
204 | ||
205 | \ LDC Cookie address format | |
206 | \ 6 6 5 | |
207 | \ |3 0|9 size|size-1 0| | |
208 | \ +------+------------------------------+-------------------+ | |
209 | \ | pgsz | table_idx | page_offset | | |
210 | \ +------+------------------------------+-------------------+ | |
211 | ||
212 | d# 60 constant cookie-pgsz-shift | |
213 | ||
214 | \ LDC Memory xfer related | |
215 | ||
216 | \ LDC Memory Copy Direction | |
217 | 0 constant ldc-mcopy-in \ Copy data to VA from cookie-memory | |
218 | 1 constant ldc-mcopy-out \ Copy data from VA to cookie-memory | |
219 | ||
220 | headerless | |
221 |