Commit graph

90 commits

Author SHA1 Message Date
Adrian Danis
ccac858da8 cmake: Remove GenCPPCommand
This helper was ugly when written and simply should not be used over the CPPFile helper.
2018-02-22 14:51:48 +11:00
Adrian Danis
a19a2b3b8d cmake: CPPFile New helper for just pre-processing files
This is a new version of GenCPPCommand that uses an OBJECT library intermediate to get
cmake to do 'arbitrary' compilation (by adding the -E flag) where the result does not
need to be linkable. The advantage of this over the GenCPPCommand version is there is
no need for trying to manually invoke GCC with all the correct arguments lists.
2018-02-22 14:51:48 +11:00
Adrian Danis
118a7869f4 cmake: get_absolute_source_or_binary is a function
As a macro this helper would not operate as expected if output and input were defined
as the same variable. Making a function and explicitly writing into the PARENT_SCOPE
fixes this and also makes the code simpler
2018-02-22 14:51:48 +11:00
Adrian Danis
4b8a3e24d2 config: Reset options to default when enabled
This change makes values take on more intuitive and expected defaults when gradually
configuring the kernel, either programatically or through the graphic interfaces
2018-02-07 11:49:28 +11:00
Kent McLeod
33192cd8ae cmake config_choice: save options in cache var
This is to make it possible to enumerate all config options instead of
just the 'valid' ones that are saved as the STRINGS property.
2018-02-01 15:11:43 +11:00
Matthew Brecknell
fe955b5ba3 Improve generated bitfield proofs
For bitfields requiring sign extension, the generated specs are nicer to
work with in proofs. The proofs also support an updated `sign_extend`
specification (in the l4v repository) which has nicer properties.

This change also speeds up some bitfield proofs.
2017-12-21 18:01:55 +11:00
Adrian Danis
9a89cbe4c6 cmake: TOPLEVELTYPES declared as target property
TOPLEVELTYPES is not intended to be configurable by the user, rather is a reflection
on the types defined by the source. This changes the TOPLEVELTYPES argument to be
a property, allowing it to be constructed as a generator expression when generating
BF files. By being a property, and not something like a global property, it removes
the need to ensure that additions to TOPLEVELTYPES are done prior to any bitfield
target definitions.
2017-11-15 17:33:13 +11:00
Adrian Danis
a2c8462efb cmake: Expand lists in BF generation
Uses the COMMAND_EXPAND_LISTS flag to allow for generator expressions in parameters
to GenBFCommand. As lists are now being expanded the 'args' variable must also be
quoted.
2017-11-15 17:33:13 +11:00
Adrian Danis
aa3fc06c79 cmake: Make variables show up if previously hidden
Previously if a variable had unmet dependencies and had been hidden, by being made
an internal variable, it would not have been unhidden by the use of `option`. This
emulates the behaviour of `option` that we were wanting, but additionally using `FORCE`
to override the `INTERNAL` setting
2017-11-03 16:39:45 +11:00
Adrian Danis
24a69963e7 cmake: Directly generate configuration files
Uses file(GENERATE) to directly create the contents of generated configuration files instead of
awkwardly using custom commands to echo the contents of multi line strings into files.
2017-11-03 13:49:37 +11:00
Adrian Danis
89fb678db8 cmake: Invoke compilations without echo and xargs
Newer versions of cmake provide a COMMAND_EXPAND_LISTS option that allows a quoted string,
such as "a;b" to be given to a COMMAND parameter and have it expand into multiple arguments.
Using this we can much more nicely generate some of our COMMAND invocations, at the cost of
requiring a more recent cmake version
2017-11-03 13:49:37 +11:00
Gerwin Klein
38cc67e821 slightly more Mac friendly cmake commands
Mac has BSD sed, not GNU sed; tr seems to be more portable.
2017-11-02 13:39:13 +11:00
Adrian Danis
3a48b9fa33 cmake: Unset CACHE variables from the CACHE
These variables were meant to be removed from the cache
2017-10-27 14:13:31 +11:00
Adrian Danis
777f19645b cmake: Correctly set options to their DEFAULT_DISABLED values
The config_option helper was previously using cmake_dependent_option, which supposedly took
a value to set the option to in the case where it was disabled. However, this only sets
the value in the current function context, and not the cache. I do not understand why this
is the case and it seems to make that functionality completely useless. This commit simply
does the dependency checking itself and correctly sets the disabled value.
2017-10-27 14:13:05 +11:00
Gerwin Klein
960881d07e tools bitfield_gen: proof updates for new base + sign-extension mechanism 2017-09-20 22:01:13 +10:00
Gerwin Klein
3b330f9a6a tools bitfield_gen: use hex literals in proofs and specs 2017-09-20 22:01:13 +10:00
Gerwin Klein
38ba9e405b tools bitfield_gen: simplify theory imports; conform to style 2017-09-20 22:01:13 +10:00
Gerwin Klein
0a99d7d4d8 tools bitfield_gen: remove obsolete mask comments
(These masks existed in earlier versions of the bitfield proofs, removed
because the statements were stronger without them.)
2017-09-20 22:01:13 +10:00
Gerwin Klein
c57ea38874 tools bitfield_gen: use generic base instead of word32 in proofs 2017-09-20 22:01:13 +10:00
Adrian Danis
eac4f6bfa2 proof: Defer theory dependencies to isabelle
Instead of explicitly depending on Kernel_C.thy prior to generating proofs, this removes
the dependency check and leaves isabelle to check the dependency upon import.
2017-09-20 14:22:14 +10:00
Anna Lyons
982ad7b2a7 Add missing license to tools/python-deps/README.rst 2017-08-28 17:10:51 +10:00
Adrian Danis
0b73072016 Add a CMake based build system
This commit adds an alternate build system using CMake that operates indepenently of
the existing Kconfig+Kbuild+make based build system
2017-08-22 13:56:26 +10:00
Anna Lyons
64cf2308ac tools: fix licenses 2017-06-22 15:27:30 +10:00
Anna Lyons
07f948331f libsel4: fix licenses
- some were incorrectly marked GPL (libsel4 is BSD)
- update NICTA --> DATA61 etc
- fix tags D61 --> DATA61
- update year to 2017
2017-06-22 15:27:29 +10:00
Matthew Brecknell
943f1ab0ba bitfield_gen: generate more efficient *_new and *_ptr_new functions
For blocks and unions, generate only one write for each word, rather
than an update for each bitfield.

For verification, this speeds up some automatically generated proofs.
2017-06-21 17:47:04 +10:00
Anna Lyons
e98bf73f0b python-deps: add bs4 2017-06-19 13:59:08 +10:00
Stephen Sherratt
7333e97c65 Add pip metapackage for downloading dependencies
Dependencies can now be downloaded with:
pip install sel4-deps

Dependencies can be changed by modifying the setup.py script.

Information on how to update the package is in the setup.py script.

JIRA: SELFOUR-909
2017-06-05 15:52:25 +10:00
Stephen Sherratt
dd352a1ae9 Python3 compatibility in scripts 2017-06-05 14:07:20 +10:00
Stephen Sherratt
2b5e1328c8 style: Add pylintrc with whitelisted lxml module
The lxml module relies on native libraries. When linting, pylint will
not load native libraries for security reasons. Thus, it can't find some
symbols exported by lxml, causing linting to fail. Whitelisting lxml
prevents this.
2017-06-05 13:43:14 +10:00
Adrian Danis
3679b88309 tools: Make circular_includes check more robust
Allows for an arbitrary path to be applied to kernel_all.c in case the build is not
happening in the current working directory
2017-06-01 14:22:56 +10:00
Luke Mondy
85a0e441e7 By not writing a parse.py table, we avoid the parallel build issue of corrupted parse.py files 2017-05-08 10:30:07 +10:00
Stephen Sherratt
8c93b71c1c Import reduce from functools in python scripts 2017-02-22 12:19:58 +11:00
Adrian Danis
4bfa5bb979 tools: Correct case where label numbers will be 0
If `seL4_arch_invocations` is an empty list, this will cause `nSeL4ArchInvocationLabels`
to be declared as 0, rather than `nInvocationLabels` as intented. This change correctly
respects the behaviour of the 'first' variable, and does an explicit assignment to
`nSeL4ArchInvocationLabels` should it be the first (and only) member of the enum.

Closes #53
2017-01-04 10:40:25 +11:00
Jeff Waugh
803dd5c2ae libsel4: Optional public symbols for external interfaces
CONFIG_LIB_SEL4_PUBLIC_SYMBOLS=y will disable inlining for external
interfaces (except deprecated functions), thereby providing public
symbols for easy linkage with other languages.
2016-12-06 18:08:39 +11:00
Stephen Sherratt
79610f4c2b Bitfields generated with ply rather than yacc 2016-11-30 16:09:06 +11:00
Thomas Sewell
13ad834ace Generated bitfield proofs: use hrs_mem_update.
This is a technical change to the proof mode of the bitfield
generator included in the seL4 source.

The postconditions of the generated specifications of the
*_ptr_set and *_ptr_new functions now describe the entire new
heap via (new_heap = hrs_mem_update (...) old_heap).
Previously they described the contents of various projections
of the heap, which is less precise.
2016-11-01 16:18:02 +11:00
Stephen Sherratt
71d02cbf4c Replace circular includes perl script with python 2016-10-24 10:53:36 +11:00
Adrian Danis
2bdc2941be Check for circular includes
Adds a tool that checks for pre-process kernel_all.c_pp for any
circular include chains, and runs this as part of the kernel
compilation process
2016-10-21 12:05:03 +11:00
Hesham Almatary
2ab27839a1 Debug: avoid syscall_names unsued Werror when debug mode is enabled 2016-10-20 09:06:57 +11:00
Anna Lyons
3a185a5c32 debug: generate list of syscall names 2016-10-18 14:05:41 +11:00
amrzar
ee75f086f3 update #ifdef to #if in auto generated files 2016-10-17 12:18:58 +11:00
Japheth Lim
c517dba449 bitfield_gen: write output files atomically 2016-06-19 21:32:49 +10:00
Adrian Danis
cf8be6639f tools: Remove arithmetic in invocation generation
If invocations are hidden behind config guards the count of how
many invocations there are will be wrong. The C compiler will
correctly assign the value with enum auto numbering, so there's
no need to override that here
2016-06-16 15:36:00 +10:00
Anna Lyons
9fca296f8a tools: emit error if first invocation conditional
Placing a config condition on the first define
in sel4arch.xml will fail as currently the first define
must start at the last define + 1 of the previous
invocation enum.

If this is ever required, autoconf.h will need to be passed
to the script so it can check config variables itself.
2016-06-16 10:43:56 +10:00
Anna Lyons
73837c8ace tools: add conditional invocation label defines 2016-06-16 10:38:29 +10:00
Matthew Fernandez
7a9b81d237 Revert "bf gen: Add a backend for AutoCorres."
This reverts commit 5ee3971563. This backend was
previously used in an experiment towards libsel4 verification. That project has
since adopted a different strategy and this backend is now unused. Meanwhile
the backend has lagged behind breaking changes to AutoCorres. This commit
removes the backend to avoid confusion from users who believe it to be
functional.
2016-06-06 16:55:41 +10:00
Thomas Sewell
bea92de3b9 Verification: adjust use of new bf proof features.
Apologies, some final adjustments got lost in the previous pull
request round. This version actually works.
2016-03-21 18:14:40 +11:00
Thomas Sewell
13715658aa Verification: bf: use new proof features.
The plan here is to move some of the proof script complexity embedded
in the text of the bitfield_gen utility into generic proof helpers in the
l4v repository that bitfield_gen can use more modularly. This is a simple
first step.
2016-03-21 10:45:41 +11:00
Corey Richardson
4b043d767f
tools: syscall_header_gen: print an error to stderr that wasn't 2016-01-25 15:56:34 +11:00
Corey Richardson
41d98e45c0
tools: bitfield_gen: use six to access range (py3) or xrange (py2) 2016-01-25 15:56:33 +11:00