-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michal Podhradsky <[email protected]>
- Loading branch information
Showing
2 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
|
||
<xs:element name="system"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="memory_region" minOccurs="0" maxOccurs="unbounded"> | ||
<xs:complexType> | ||
<xs:attribute name="name" type="xs:string" use="required" /> | ||
<xs:attribute name="size" type="xs:string" use="required" /> | ||
<xs:attribute name="page_size" type="xs:string" use="optional" /> | ||
<xs:attribute name="phys_addr" type="xs:string" use="optional" /> | ||
</xs:complexType> | ||
</xs:element> | ||
|
||
<xs:element name="protection_domain" minOccurs="1" maxOccurs="unbounded"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="program_image" minOccurs="1" maxOccurs="1"> | ||
<xs:complexType> | ||
<xs:attribute name="path" type="xs:string" use="required" /> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
<xs:element name="map"> | ||
<xs:complexType> | ||
<xs:attribute name="mr" type="xs:string" use="required" /> | ||
<xs:attribute name="vaddr" type="xs:string" use="required" /> | ||
<xs:attribute name="perms" type="xs:string" use="required" /> | ||
<xs:attribute name="cached" type="xs:boolean" use="optional" default="false" /> | ||
<xs:attribute name="setvar_vaddr" type="xs:string" use="optional" /> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="setvar"> | ||
<xs:complexType> | ||
<xs:attribute name="symbol" type="xs:string" use="required" /> | ||
<xs:attribute name="region_paddr" type="xs:string" use="optional" /> | ||
<xs:attribute name="vaddr" type="xs:string" use="optional" /> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="irq" minOccurs="0" maxOccurs="63"> | ||
<xs:complexType> | ||
<xs:attribute name="irq" type="xs:integer" use="required" /> | ||
<xs:attribute name="id" type="xs:integer" use="required" /> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:choice> | ||
</xs:sequence> | ||
<xs:attribute name="name" type="xs:string" use="required" /> | ||
<xs:attribute name="priority" use="required"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:integer"> | ||
<xs:minInclusive value="0" /> | ||
<xs:maxInclusive value="254" /> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:attribute> | ||
<xs:attribute name="pp" type="xs:boolean" use="optional" default="false" /> | ||
<xs:attribute name="budget" use="optional"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:pattern value="(\d_?)+"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:attribute> | ||
<xs:attribute name="period" use="optional"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:pattern value="(\d_?)+"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:attribute> | ||
<xs:attribute name="passive" type="xs:boolean" use="optional" default="false" /> | ||
</xs:complexType> | ||
</xs:element> | ||
|
||
<xs:element name="channel" minOccurs="0" maxOccurs="unbounded"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="end" minOccurs="2" maxOccurs="2"> | ||
<xs:complexType> | ||
<xs:attribute name="pd" type="xs:string" use="required" /> | ||
<xs:attribute name="id" type="xs:integer" use="required" /> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
|
||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env bash | ||
err=0 | ||
|
||
for f in `find . -wholename "./example/*.system"` | ||
do | ||
xmllint --noout --schema system.xsd $f | ||
if (($? != 0)); then | ||
err=$((err + 1)) | ||
fi | ||
done | ||
|
||
if ((${err} > 0)); then | ||
echo "There were errors while parsing" | ||
exit 1 | ||
fi |