History log of /seL4-camkes-master/projects/capdl/python-capdl-tool/capdl/util.py
Revision Date Author Comments
# 9f1ba467 17-Jun-2020 Gerwin Klein <gerwin.klein@data61.csiro.au>

Convert to SPDX license tags

This includes marking all documentation files CC-BY-SA-4.0.


# 303d2321 05-Aug-2019 Anna Lyons <anna@gh.st>

python-capdl-tool: fix quirk in get_object_size

Don't return 1 when the value returned is 0.


# fc2cbe61 29-Mar-2019 Chris Guikema <chris.guikema@dornerworks.com>

capdl: support 40-bit PA size on aarch64-hyp

Update vspace structure when starting at level 1

Co-authored-by: Anna Lyons <anna@gh.st>


# ef2fe742 13-Feb-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: add untyped allocator

This change adds an offline allocator for calculating untyped
derivations, which will be used in future to specify exact derivations
from boot info untyped objects. This allows the allocation logic to be
removed from the loader, this simplifying the loader model for
verificaion while allowing for policy freedom in terms of allocation.

The initial allocator implementation is a best-fit allocator.


# c6af5c2f 25-Jun-2019 Japheth Lim <Japheth.Lim@data61.csiro.au>

untyped_gen: remove code for dealing with rootserver

We now expect the elfloader and kernel boot to place the rootserver at
the end of available memory. This means that we can ignore them when
allocating from the start of memory (as long as they do not conflict
somewhere in the middle).


# f57c5270 04-Jun-2019 Japheth Lim <Japheth.Lim@data61.csiro.au>

cdl_utils: get untyped_gen to run


# 3a2be869 15-May-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

python-capdl: Allow page_sizes to take Arch type

If page_sizes is called with an actual Arch object type (or an object
that implements the get_pages method, then don't lookup the architecture
again. This is to support cases where an Arch object instance is
available, but the string that was used to obtain it is not in scope.


# 6f89b312 15-May-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: add clz implementation

Add clz for doing bit magic


# 8ff71ff3 15-May-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: expose levels

Expose the levels function so that it can be used by other tools.
Make Arch be an abstract class with default methods.


# e7ac7566 15-May-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: expose list of valid archs

Expose the keys of the dictionary representing valid architectures. This
can then be used as part of the arguments to scripts.


# fc884ff8 15-Apr-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

trivial: python-capdl-tool: style util.py


# 58192a3c 10-Apr-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

python-capdl-tool: Add RISCV architecture layouts

The kernel currently assumes SV32 memory layout for rv32 and SV39 layout
for rv64 which is reflected here.


# eb166191 10-Apr-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

python-capdl-tool: Split normalise_architecture

Normalising architecture would normalise aarch32 and arm_hyp
architectures to aarch32 as it went through the CapDL spec arch which
may not have per architecture names


# 554a692e 13-Feb-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: add helpers to utils

- ctz
- round_up
- is_aligned


# f4702f99 06-Feb-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: merge Aarch32Arch and ArmHypArch

The only difference now is the level size, so add a flag for this rather
than duplicate the code.


# c325b91f 06-Feb-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: use get_object_size for frame sizes

This change removes the hardcoded frame sizes from util.c and uses
get_object_size to query the sizes of frames.


# 198ac825 05-Feb-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

python-capdl-tool: reduce duplicated object constants

This change removes duplicated object types for types that are shared
across architecutes. For example, rather than have both
seL4_IA32_PageTableObject and seL4_ARM_PageTableObject, just use
seL4_PageTableObject.

This reduces code complexity.


# 0d2ce4a5 04-Nov-2018 Kent McLeod <Kent.Mcleod@data61.csiro.au>

python-capdl-tool: Add aarch64 support


# 10e2666c 03-Oct-2018 Anna Lyons <Anna.Lyons@data61.csiro.au>

python: create and use ObjectType enum

Move the object type (seL4_.*Object) constants into a new enum, ObjectType.
This allows the types to be iterable and reduces the number of imports,
resulting in less boilerplate.


# 142df05b 13-Jul-2017 Anna Lyons <Anna.Lyons@data61.csiro.au>

Fix whitespace

- Remove trialing whitespace
- Remove duplicate blank lines
- Remove blank lines at end of file


# d5ae4e67 04-Jun-2017 Anna Lyons <Anna.Lyons@data61.csiro.au>

Fix licenses


# 64a5cd80 21-Feb-2017 Stephen Sherratt <Stephen.Sherratt@data61.csiro.au>

Replace xrange with six.moves.range


# e44f9234 17-Apr-2016 Adrian Danis <Adrian.Danis@nicta.com.au>

python-capdl: Define x86_64 types


# 9b7120df 21-Apr-2016 Adrian Danis <Adrian.Danis@nicta.com.au>

python-capdl-tool: Add IPC buffer size definition


# 51780688 12-Apr-2016 Adrian Danis <Adrian.Danis@nicta.com.au>

python-capdl-tool: Define a real architecture definition

This replaces and expands upon the architecture abstractions in util.py.
Previously the architecture just abstracted some sizes of pages and
layouts of a two level paging hierarchy. Now this is generalized both
for arbitrary vspace hierarchies, as well as other architecture
information.

The original interface is left and emulated.


# 3445c6d6 24-Jan-2016 Adrian Danis <Adrian.Danis@nicta.com.au>

Support aarch32 as a way of specifying the internal arm11 architecture

This change supports the new naming scheme for the 'arm' architecture,
which has been disambiguated into aarch32 (arms official name), in
prepartion for supporting aarch64


# 1b387349 16-Dec-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

python-capdl: Remove hyp parameters from paging functions.

This commit marks the final removal of special casing of ARM's Hyp mode. From
this point on, Hyp mode should be considered an entirely separate architecture.


# 89a09b6b 16-Dec-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

python-capdl: Stop using the hyp parameter as a way to detect Hyp mode.

Now indicated via the "arm_hyp" architecture string alone.


# 20668c11 13-Dec-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

python-capdl: Use normalise_architecture for increased ARM Hyp mode compat.

This commit allows the util function to recognise the architecture string
"arm_hyp" as a way of indicating ARM's Hyp mode. That is, you can now specify
Hyp mode in two ways:

1. architecture "arm" and hyp=True (legacy); or
2. architecture "arm_hyp".

The purpose of this commit is movement towards removing the `hyp` argument
entirely and having a single, consolidated way of indicating the target
architecture. Note that none of this new functionality is currently used yet.


# 7f90d8f3 13-Dec-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

python-capdl: Add a function for normalising architecture strings.

This is currently unused but supports a future commit.


# 39a78477 26-Nov-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

python-capdl: Enable Python 3 compatibility settings from `__future__`.

This change enables a variety of Python 3 compatibility settings from
`__future__` when running Python 2. Essentially this forces all existing code
under Python 2 to conform to the Python 3 semantics. This makes bilingual
compatibility easier.


# e7a43739 26-Nov-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

python-capdl: Use `//` whenever performing a division that assumes floor.

The `//` and `/` operators are equivalent in standard Python 2, but Python 3
changes the `/` operator to return a float, rather than flooring the result.
These changes are part of movement towards switching on division compatibility
from `__future__` within Python 2.


# 7d6dade6 18-Nov-2015 Stephen Sherratt <Stephen.Sherratt@nicta.com.au>

Moved python-capdl-tool into subdirectory