summaryrefslogtreecommitdiff
path: root/rules-ng.xsd
blob: 8dd68721ab2b72b6046eda74c9a1aa8ecf18ef1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://nouveau.freedesktop.org/"
	xmlns:rng="http://nouveau.freedesktop.org/"
	elementFormDefault="qualified">

	<annotation>
		<documentation>
			An updated version of the old rules.xml file from the
			RivaTV project. Specifications by Pekka Paalanen,
			preliminary attempt by KoalaBR,
			first working version by Jakob Bornecrantz.
			For specifications, see the file rules-ng-format.txt
			in Nouveau CVS module 'rules-ng'.
		</documentation>
		<documentation>Version 0.1</documentation>
	</annotation>


	<!-- Elements -->

	<element name="value"       type="rng:valueType" />
	<element name="bitfield"    type="rng:bitfieldType" />
	<element name="bitset"      type="rng:bitsetType" />
	<element name="reg32"       type="rng:registerType" />
	<element name="reg8"        type="rng:registerType" />
	<element name="array"       type="rng:arrayType" />
	<element name="stripe"      type="rng:stripeType" />
	<element name="enum"        type="rng:enumType" />
	<element name="database"    type="rng:databaseType" />
	<element name="group"       type="rng:groupType" />
	<element name="variant"     type="rng:variantType" />
	<element name="domain"      type="rng:domainType" />
	<element name="translation" type="rng:translationType" />
	<element name="use-bitset"  type="rng:refType" />
	<element name="use-group"   type="rng:refType" />
	<element name="use-enum"    type="rng:refType" />
	
	<!-- Documentation elements -->
	
	<!-- FIXME: allowed only one  per parent element -->
	<element name="brief" type="rng:briefType" />
	
	<element name="doc"  type="rng:docType" />
	<element name="b"    type="rng:textformatType" />
	<element name="i"    type="rng:textformatType" />
	<element name="u"    type="rng:textformatType" />
	<element name="code" type="rng:textcodeType" />
	<element name="ul"   type="rng:listType" />
	<element name="ol"   type="rng:listType" />
	<element name="li"   type="rng:listitemType" />



	<!-- Database element types -->

	<complexType name="databaseType">
		<annotation>
			<documentation>databaseType</documentation>
		</annotation>
		<sequence>
			<element ref="rng:domain" />
			<choice minOccurs="0" maxOccurs="unbounded">
				<group ref="rng:regarrayGroup" />
				<group ref="rng:docGroup" />
				<element ref="rng:variant" />
				<element ref="rng:enum" />
				<element ref="rng:group" />
				<element ref="rng:bitset" />
			</choice>
		</sequence>
	</complexType>

	<complexType name="variantType">
		<annotation>
			<documentation>variantType</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:regarrayGroup" />
			<group ref="rng:docGroup" />
			<element ref="rng:variant" />
			<element ref="rng:use-group" />
		</choice>
		<attribute name="id" type="NMTOKENS" use="required" />
	</complexType>

	<complexType name="enumType">
		<annotation>
			<documentation>enumType</documentation>
		</annotation>
		<choice maxOccurs="unbounded">
			<element ref="rng:value" />
			<group ref="rng:docGroup" />
		</choice>
		<attribute name="name" type="rng:Cname" use="required" />
	</complexType>

	<complexType name="valueType">
		<annotation>
			<documentation>valueType</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:docGroup" />
		</choice>
		<attribute name="name" type="rng:objName" use="required" />
		<attribute name="value" type="string" use="required" />
	</complexType>

	<complexType name="arrayType">
		<annotation>
			<documentation>arrayType</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:regarrayGroup" minOccurs="0" />
			<group ref="rng:docGroup" />
			<element ref="rng:use-group" />
		</choice>
		<attribute name="name" type="rng:objName" use="required" />
		<attributeGroup ref="rng:basicArrayAttributes" />
		<attribute name="type" type="rng:Type" default="hex" />
	</complexType>

	<complexType name="stripeType">
		<annotation>
			<documentation>stripeType</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:regarrayGroup" minOccurs="0" />
			<group ref="rng:docGroup" />
			<element ref="rng:use-group" />
		</choice>
		<attribute name="name" type="rng:objName" use="optional" />
		<attributeGroup ref="rng:basicArrayAttributes" />
	</complexType>

	<complexType name="bitfieldType">
		<annotation>
			<documentation>bitfieldType</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:docGroup" />
			<element ref="rng:use-enum" />
			<element ref="rng:value" maxOccurs="unbounded" />
		</choice>
		<attribute name="name" type="rng:objName" use="required" />
		<attribute name="high" type="nonNegativeInteger"
			use="required" />
		<attribute name="low" type="nonNegativeInteger"
			use="required" />
		<attribute name="type" type="rng:Type" default="hex" />
	</complexType>

	<complexType name="bitsetType">
		<annotation>
			<documentation>bitsetType</documentation>
		</annotation>
		<choice maxOccurs="unbounded">
			<element ref="rng:bitfield" />
			<group ref="rng:docGroup" />
		</choice>
		<attribute name="name" type="rng:Cname" use="required" />
	</complexType>

	<complexType name="groupType">
		<annotation>
			<documentation>groupType</documentation>
		</annotation>
		<choice maxOccurs="unbounded">
			<group ref="rng:regarrayGroup" />
			<group ref="rng:docGroup" />
			<element ref="rng:use-group" />
		</choice>
		<attribute name="name" type="rng:Cname" use="required" />
	</complexType>

	<complexType name="refType">
		<annotation>
			<documentation>refType</documentation>
		</annotation>
		<attribute name="ref" type="rng:Cname" use="required" />
	</complexType>

	<complexType name="domainType">
		<annotation>
			<documentation>domainType</documentation>
		</annotation>
		<attribute name="name" type="rng:Cname" use="required" />
	</complexType>

	<complexType name="registerType">
		<annotation>
			<documentation>
				registerType used by both reg8 and reg32
			</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="1">
			<choice minOccurs="0" maxOccurs="unbounded">
				<element ref="rng:value" />
				<element ref="rng:use-enum" />
				<group ref="rng:docGroup" />
			</choice>
			<choice minOccurs="0" maxOccurs="unbounded">
				<element ref="rng:bitfield" />
				<element ref="rng:use-bitset" />
				<group ref="rng:docGroup" />
			</choice>
		</choice>
		<attribute name="name" type="rng:objName" use="required" />
		<attribute name="offset" type="rng:Hexadecimal"
			use="required" />
		<attribute name="access" type="rng:Access" default="rw" />
		<attribute name="type" type="rng:Type" default="hex" />
	</complexType>

	<complexType name="translationType">
		<annotation>
			<documentation>translationType</documentation>
		</annotation>
		<choice maxOccurs="unbounded">
			<element ref="rng:reg8" />
			<element ref="rng:reg32" />
			<group ref="rng:docGroup" />
		</choice>
		<attribute name="domain" type="rng:Cname" use="required" />
		<attribute name="variant" type="NMTOKEN" />
	</complexType>
	


	<!-- Documentation element types -->

	<complexType name="briefType">
		<annotation>
			<documentation>
				brief documentation, no markup
			</documentation>
		</annotation>
		<simpleContent>
			<extension base="string" />
		</simpleContent>
	</complexType>
	
	<complexType name="docType" mixed="true">
		<annotation>
			<documentation>
				root element of documentation sub-tree
			</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:textformatGroup" />
			<group ref="rng:listGroup" />
			<element ref="rng:code" />
		</choice>
	</complexType>
	
	<complexType name="textformatType" mixed="true">
		<annotation>
			<documentation>
				for bold, underline, italics
			</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:textformatGroup" />
		</choice>
	</complexType>
	
	<complexType name="textcodeType">
		<simpleContent>
			<extension base="string">
				<attribute name="title" type="string" />
			</extension>
		</simpleContent>
	</complexType>
	
	<complexType name="listType">
		<annotation>
			<documentation>
				definition of a list, ordered or unordered
			</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<element ref="rng:li" />
		</choice>
	</complexType>
	
	<complexType name="listitemType" mixed="true">
		<annotation>
			<documentation>
				items of a list
			</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<group ref="rng:textformatGroup" />
			<group ref="rng:listGroup" />
			<element ref="rng:code" />
		</choice>
	</complexType>



	<!-- Attribute value types -->

	<simpleType name="Cname">
		<annotation>
			<documentation>
				C language identifier or macro name.
				The C99 standard seems to allow non-ASCII-7
				letters in names, but we do not. Or do we?
			</documentation>
		</annotation>
		<restriction base="token">
			<pattern value="[a-zA-Z_][0-9a-zA-Z_]*" />
		</restriction>
	</simpleType>

	<simpleType name="objName">
		<annotation>
			<documentation>
				This is either a (normal) prefixed name,
				or an absolute name with a leading slash.
				The absolute name is the same as slash and
				Cname concatenated.
			</documentation>
		</annotation>
		<restriction base="token">
			<pattern value="/[a-zA-Z_][0-9a-zA-Z_]*" />
			<pattern value="[0-9a-zA-Z_]+" />
		</restriction>
	</simpleType>

	<simpleType name="Hexadecimal">
		<restriction base="string">
			<pattern value="0x[0-9a-f]+" />
			<pattern value="0x[0-9A-F]+" />
		</restriction>
	</simpleType>

	<simpleType name="HexOrNumber">
		<annotation>
			<documentation>HexOrNumber</documentation>
		</annotation>
		<union memberTypes="rng:Hexadecimal nonNegativeInteger" />
	</simpleType>

	<simpleType name="Type">
		<annotation>
			<documentation>Type</documentation>
		</annotation>
		<restriction base="NMTOKENS" />
	</simpleType>

	<simpleType name="Access">
		<annotation>
			<documentation>Access</documentation>
		</annotation>
		<restriction base="string">
			<enumeration value="r" />
			<enumeration value="w" />
			<enumeration value="rw" />
		</restriction>
	</simpleType>



	<!-- Attribute groups -->

	<attributeGroup name="basicArrayAttributes">
		<attribute name="offset" type="rng:Hexadecimal"
			use="required" />
		<attribute name="stride" type="rng:HexOrNumber"
			use="required" />
		<attribute name="length" type="rng:HexOrNumber"
			use="required" />
	</attributeGroup>


	<!-- Element groups -->

	<group name="regarrayGroup">
		<choice>
			<element ref="rng:reg32" />
			<element ref="rng:reg8" />
			<element ref="rng:array" />
			<element ref="rng:stripe" />
			<element ref="rng:translation" />
		</choice>
	</group>
	
	<group name="docGroup">
		<choice>
			<element ref="rng:brief" />
			<element ref="rng:doc" />
		</choice>
	</group>
	
	<group name="textformatGroup">
		<choice>
			<element ref="rng:b" />
			<element ref="rng:i" />
			<element ref="rng:u" />
		</choice>
	</group>
	
	<group name="listGroup">
		<choice>
			<element ref="rng:ul" />
			<element ref="rng:ol" />
		</choice>
	</group>

</schema>