Commit Graph

71 Commits

Author SHA1 Message Date
Indan Zupancic
43607edb68 Manual: Xinclude support
This way common error codes can be in their own file.

To use, add the xmlns:xi="http://www.w3.org/2001/XInclude
attribute to the top level node and use:

<xi:include href="file-to-include.xml"/>

The content of the file will be included verbatim.

Include files must be complete XML documents, but without
<?xml version="1.0" ?> at the top. Practically this means
all nodes within the file need to be contained in one root
element.

Caveat: There is no proper dependency for Xincludes files in
the Makefile, so you need to do make clean after changing an
included XML file!

Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-03-18 10:03:07 +00:00
Gerwin Klein
d8f4a95b72 manual: group invocations by MCS/non-MCS
Put MCS-only invocations into their own groups and files. This solves
the problem that doxygen gets confused by duplicate function names with
the same parameters.

MCS/non-MCS is distinguished by evaluating the <condition> field in the
API XML definition. If the condition evaluates to true when
CONFIG_KERNEL_MCS is set, it is an MCS-only method, otherwise it is
assumed to be non-MCS or present in both configs.

Fixes #558

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-11-07 16:13:28 +11:00
Gerwin Klein
9956101ba6 manual: handle name duplication between groups
Different API groups may contain the same function name, for instance
IRQ_Control GetTrigger for RISC-V vs the same for ARM. Duplicate
function names with identical parameter lists confuse doxygen, leading
it to generate a single merged xml entry for both, which means one of
the entires will be missing and the other will be potentially wrong.

When the functions are placed in different files and different groups
at the same time, doxygen no longer is confused in all cases.

Therefore:

- generate a separate file for each API group
- generate a separate file group_defs.h that contains group definitions
  and declares group nesting

Unfortunately, this does not seem to always work (e.g. the toplevel
MCS/non-MCS syscalls), so manual inspection is still necessary when
adding new calls and separate doxygen runs for duplicate function names
may be necessary. Generating separate files as above enables this
option, should it become necessary in the future.

Fixes #530

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-11-07 16:01:50 +11:00
Gerwin Klein
1de89ba1f2 trivial: spelling (sel4 -> seL4)
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-11-07 16:01:50 +11:00
Gerwin Klein
b67c7310af parse_doxygen_xml: avoid XMLParsedAsHTMLWarning
Explicitly select xml parser (instead of html) via "lxml-xml" in
BeatifulSoup to avoid warning.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-11-07 16:01:49 +11:00
Kent McLeod
7fec9bc9e9 Add CONFIG_X86_64_VTX_64BIT_GUESTS guards
Guard the new implementation of 64-bit x86 guests behind a config
option. This is done so that existing projects that use x86_64 hosts
with ia32-bit guests can continue to be supported until either the old
feature is preferred to be deprecated, or support can be added to
support both simmultaneously.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-06-06 13:29:34 +10:00
matt rice
b0d70f1ebc add libsel4/tools/sel4_idl.xsd to replace dtd
No intended changes to the schema, just change
the schema from dtd to xsd, and update ci to use it.

Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
Jimmy Brush
9b5b0e9c8a manual: Swap API description and error code table
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
9890b78c2b manual: Remove some extra spaces after texttt
Extra spaces are inserted after texttt tags when generating doxygen
comments in order to ensure that xmlonly tags are readable by doxygen.

The extra spaces cause a description like this:

```
Testing <texttt text="1"/>, 2, 3
```

To be rendered like this:

```
Testing 1 , 2, 3
```

This change identifies text runs that start with extra spaces and either
a period or a comma and removes the extra spaces, allowing at least
common punctuation to be rendered correctly.

Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
02a5f761f7 manual: Add returned error codes table to API
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
ae197ad146 libsel4: Generate doxygen tag for error element
Translate "error" elements into "retval" doxygen comment tags when
generating object invocation stubs.

Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Gerwin Klein
79da079239 Convert license tags to SPDX identifiers
This commit also converts our own copyright headers to directly use
SPDX, but leaves all other copyright header intact, only adding the
SPDX ident. As far as possible this commit also merges multiple
Data61 copyright statements/headers into one for consistency.
2020-03-09 13:21:49 +08:00
Anna Lyons
7b25653de7 manual: parse all doxygen xml for refdict
Previously the manual would only parse the doxygen for a single xml
file, which meant references to symbols on other files would break.
Parse all doxygen files when constructing the ref dict to fix this.
2019-08-22 11:22:36 +10:00
Anna Lyons
bc61a7f3bd python2 --> python3
Update all scripts and build system to call python3, given python2's
upcoming doom. Use sys.maxsize instead of sys.maxint in one script
(maxint does not exist in python3).
2019-08-08 10:19:24 +10:00
Anna Lyons
cf57914c7f style: run autopep8 on python files 2019-03-27 10:43:58 +11:00
Adam Felizzi
bc4580c64e parse_doxygen: Removed tab in Markdown doc format
Removed a trailing tab character in the Markdown API doc format
string.
2018-09-04 12:05:06 +10:00
Anna Lyons
f3dc34f427 manual: add missing newline
fixes a missing new line in generated markdown
2018-05-14 15:34:37 +10:00
Anna Lyons
28648bc843 manual: fix stray brace in output
Invocation headers had a stray brace which broke the markdown output
2018-05-14 15:34:35 +10:00
Anna Lyons
d0f69f8ff5 manual: remove gen_invocations.py unused functions 2018-05-11 16:13:05 +10:00
Anna Lyons
d9780ec73e manual: label object groups in parse_doxygen_xml.py
This change adds a label to the latex generated object groups.
2018-05-10 11:36:05 +10:00
Anna Lyons
b5ee12f00c manual: group generated API methods by object type
This change generates doxygen groups for each object type, which allows us to create sections in
output documents for each object. This has the advantage that we can later label those sections and
link to them from the main document. Additionally, it improves nagivation of the API docs.
2018-05-10 11:36:01 +10:00
Anna Lyons
da1e73fe96 manual: use int level in parse_doxygen_xml.py
The level argument to parse_doxygen_xml.py was previously a latex section header (either subsection
or subsubsection). This change converts the argument to numerical which is more robust and is not
limited to 2 specific levels.

This change
- alters the level argument to be an int, where 0 = highest level header,
- removes the translation of latex header to markdown,
- adds a new 'level_to_header' function to the generator class, which translates the level number
  to a header for that specific output type.
2018-05-10 11:35:59 +10:00
Adam Felizzi
e9b43006a3 manual: Added command line option for Markdown
Added a command line option for the user to specify the output
format i.e markdown or latex. The command option is used to either
create a Latex or Markdown class.
2018-05-01 13:50:39 +10:00
Adam Felizzi
8afce61b43 manual: Updated comments
Minor comment changes to the parse_doxygen_xml.py script.
2018-05-01 13:50:39 +10:00
Adam Felizzi
8ab5b3b7d1 manual: Markdown Generator Implementation
Added Markdown Generator implementation. This is a child class
to the Generator class. The Markdown generator class overrides
specific parsing table elements and methods to achieve Markdown
specific output, similar to the Latex Generator.
2018-05-01 13:50:26 +10:00
Adam Felizzi
336b73735f manual: Updated escape character regex
Updated the text_escape function to regex escape characters in the
generators escape set. This is for the case when a generators
special character set collides with regex's special character
set.
2018-05-01 12:28:03 +10:00
Adam Felizzi
8fd604eb13 manual: Added <docref> XML Tag to Doxygen
Introduced a new Doxygen XML tag '<docref>'. The intention of
this tag is to indicate a section of text in the Doxygen XML that
will contain a reference to another section in the Manual e.g.
"See \autoref<sec:x>". As other generation formats aren't aware of
other chapters/sections in the manual, the <docref> encapsulation
allows it to omit the text from the output. The Latex generator
has been modified to continue parsing the 'docref' contents.
2018-05-01 12:28:03 +10:00
Adam Felizzi
33f2fe7d92 manual: Added "heading" field to ref_dict
Updated the reference dictionary with a heading field. This is
the heading title given to the api doc section.
2018-05-01 12:28:03 +10:00
Adam Felizzi
0e6c45f69e manual: Added "original_name" field to ref_dict
Updated the reference dictionary with a non text escaped name
field. This is in case the generator doesn't need the name field
text escaped.
2018-05-01 10:42:09 +10:00
Adam Felizzi
50bffce06e manual: Parameterised escape in 'parse_prototype'
The option to escape the text when parsing the prototype can be
specified to the parse_prototype function. Markdown does not
require special C code characters to be escaped.
2018-05-01 10:42:09 +10:00
Adam Felizzi
a0ce040af8 manual: Generalised param_string generation
Moved Latex specific param string generation out of the Generator
class. Added functions to generate the desired param string
format that the Latex class can then override.
2018-04-24 10:03:52 +10:00
Adam Felizzi
886e5f59e0 manual: Generalised Generator Class
Generalised the Generator class, removing Latex specific format
code. Generator class returns empty or plain text when used
by itself.
2018-04-24 10:03:52 +10:00
Adam Felizzi
f636155acf manual: Added LatexGenerator Child class
Implemented LatexGenerator child class which extends the
Generator class. The Latex class overrides methods of the
Generator with Latex specific format. Currently a lot of
duplication between Generator and Latex class, need to
generalise the Generator class.
2018-04-24 10:03:52 +10:00
Adam Felizzi
b51ca046a4 manual: Renamed methods in Generator class
Renamed select methods to more generic names that don't suggest
they create Latex output.
2018-04-24 10:03:52 +10:00
Adam Felizzi
561e005774 manual: Moved location of get_parse_table function
Code tidying. Moved get_parse_table to the top of the class
implementation to make it more clear/distinct from the other
methods.
2018-04-24 10:03:52 +10:00
Adam Felizzi
a8ffb6e54d manual: Moved escape regex into latex_escape func
New generator classes are expected to override the ESCAPE_PATTERNS
variable. Moving the regex into an object method allows it to use
the overriden escape patterns.
2018-04-24 10:03:52 +10:00
Adam Felizzi
334514a7c8 manual: Parameterised the generator class
Parameterised the generator class for the
'generate_general_syscall_doc' method. This will allow the caller
to pass the desired generator to the function.
2018-04-24 10:03:52 +10:00
Adam Felizzi
d64ebe473f manual: Created generate_api_doc methods
Moved api doc string format into a seperate function within the
Generator class. This will allow new generators to override the
function with their own api doc format.
2018-04-24 10:03:52 +10:00
Adam Felizzi
326c6fbf26 manual: Moved functionality into Generator class
Moved the parsing functionality into a object. The goal is to
refactor the script into an object model such that we can extend
and override parsing functions to output the doxygen to different
formats. Additionally updated the various methods and variable
accesses to use 'self' inorder to work in the new object oriented
paradigm.
2018-04-24 10:03:52 +10:00
Adam Felizzi
e9611eaa9d manual: Moved parse table to function
The parse table has been moved to a function. Updated use
of the PARSE_TABLE to call the function instead.
2018-04-24 10:03:52 +10:00
Kent McLeod
76dd101fe1 manual: fix python script to be python3 compatible 2017-09-18 11:28:33 +10:00
Anna Lyons
192a4162ee manual: allow non sec autorefs
Previously anything in an autoref block was assumed to reference
a section, which isn't true. Change 'sec' to 'label' and move the
'sec' prefix into the label itself.
2017-06-27 16:22:34 +10:00
Anna Lyons
adb7916041 manual: fix double escaping bug 2017-06-20 10:22:59 +10:00
Anna Lyons
cd9e1c9a39 manual: support for itemized lists 2017-06-19 14:43:54 +10:00
Anna Lyons
93d2ed6a77 manual: fix script licenses 2017-06-19 13:59:08 +10:00
Anna Lyons
4d7c272ba7 manual: appease pylint 2017-06-19 13:59:08 +10:00
Anna Lyons
b1ef79e32f manual: refactor + cleanup parse_doxygen_xml.py
- use 'recursive=False' rather than 'content' to only search children
- use a parse table instead of if a long if/else
- fix nested lists
- use get_text from beautiful_soup rather than home brewed
- don't call latex_escape explicitly
2017-06-19 13:59:08 +10:00
Anna Lyons
10801bd891 SELFOUR-962: allow API level description in manual 2017-06-19 13:59:08 +10:00
Anna Lyons
c6056ecbe9 SELFOUR-961: allow lists in API docs
this change

- converts ordered doxygen lists to enumerate
- also wraps the benchmark config names in texttt
2017-06-19 13:59:08 +10:00
Anna Lyons
6b69024674 manual: use BeautifulSoup in parse_doxygen_xml
Use BeautifulSoup instead of minidom, for more powerful features
2017-06-19 13:59:08 +10:00