History log of /seL4-refos-master/kernel/include/util.h
Revision Date Author Comments
# 301f3635 13-May-2020 Curtis Millar <curtis.millar@data61.csiro.au>

trivial: Use UL_CONST in assembler macros

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>


# 512a0200 19-Mar-2020 Qian Ge <qian.ge@data61.csiro.au>

replacing all ifndef with pargma once

All the kernel header files now use pargma once rather than the ifndef,
as the pre-processed C files do not change while header files
are protected with pargma once. This will also solve any naming issues
caused by ifndef.


# 79da0792 01-Mar-2020 Gerwin Klein <gerwin.klein@data61.csiro.au>

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.


# e04dbb95 22-Mar-2017 Rafal Kolanski <rafal.kolanski@nicta.com.au>

mcs: verification spec for clzll

This is required for the proofs.


# acfc3c52 31-Oct-2016 Anna Lyons <Anna.Lyons@data61.csiro.au>

mcs: tickless driver for x86

Add a tickless timer driver for x86. The driver defaults to using
TSC_DEADLINE mode, but falls back to the apic if that feature is not
available.


# 71244499 31-Oct-2016 Anna Lyons <Anna.Lyons@data61.csiro.au>

mcs: tickless scheduler implementation

This changes the budget/remaining fields in scheduling contexts
to contain timer ticks, not number of abstract sel4ticks.

seL4_SchedControl_Configure now takes microseconds, not ticks.

This commit is plat-independant - the platform and arch specific
timer code follows in later commits.


# 761006e0 18-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

style: consistently align pointer with name

Run astyle with align-pointer=name


# 3d10ef0c 18-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

style: correct parenthesis padding

Use astyle's unpad-paren to unpad all parentheses that are not included
by pad-header, pad-oper, and pad-comma.


# 7262cb87 11-Mar-2019 Jasper Lowell <jasper.lowell@data61.csiro.au>

Treat optimize attribute as gcc specific

Clang doesn't provide support for __attribute__((optimize ...)). There
are alternatives to provide the same functionality but due to how rarely
the kernel is compiled without optimisations, this can be added on
demand.


# ffbb2783 17-Sep-2018 Anna Lyons <Anna.Lyons@data61.csiro.au>

trivial: move MS_IN_S to utils.h


# 679c0b09 11-Apr-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

Remove strlen

This is not suitable for verification and strnlen must be used instead.


# 43e17052 11-Apr-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

Remove strcmp

This function causes difficulties for verification and strncmp should be used instead.


# 5ac36bce 09-Apr-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

riscv: Move strcmp to util


# c0839197 08-Apr-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

riscv: Move strlen to util


# 00cae0ba 04-Apr-2018 Anna Lyons <Anna.Lyons@data61.csiro.au>

riscv: move STRINGIFY et al to util.h


# 80303364 03-Apr-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

riscv: Move implementations into c file

Function implementations belong in source files, not header files.


# 83ba0847 20-Feb-2018 Hesham Almatary <hesham.almatary@unsw.edu.au>

[SELFOUR-1156] RISC-V Port

Experimental release that supports both RV32 and RV64


# b942a504 26-Mar-2018 Bruce Mitchener <bruce.mitchener@gmail.com>

Fix trivial comment typos.


# 60aac65c 05-Mar-2018 Sebastian Holzapfel <seb.holzapfel@data61.csiro.au>

ARM/v7-a: Force -O2 compilation of idle thread

This fixes a problem with -O0 SMP builds on ARM visible as kernel
data aborts whenever the idle thread executes.

The idle thread receives no stack pointer. At -O2, this is fine
as the wfi() call is inlined and stack operations in idle_thread
are optimized out. At -O0, the stack operations remain and wfi()
is not inlined, resulting in stack accesses in the idle thread
that cause data aborts.

Forcing -O2 behaviour was deemed the simplest solution for now.
Giving the idle thread a stack would have had larger verification
ramifications for what is now a fairly uncommon use case.


# 5247240a 07-Jan-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

Implement UL_CONST macro for assembly and C

The UL_CONST macro provides a way to declare a constant that may or may not have a UL
suffix. In the case of assembly the UL suffix will be an error to many assemblers and
is not needed.


# 8d0b13c6 07-Jan-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

Token pasting helper

Adds utility macro for creating new tokens by token pasting


# d43b717e 05-Jan-2018 Adrian Danis <Adrian.Danis@data61.csiro.au>

Move PAD_TO_NEXT_CACHE_LN to util.h

This utility macro is useful beyond just SMP code


# 3aa244cc 28-Jun-2017 Hesham Almatary <hesham.almatary@data61.csiro.au>

Verification: popcount- Avoid conflict variable names/types


# 13e32a29 28-Jun-2017 Hesham Almatary <hesham.almatary@data61.csiro.au>

trivial: fixes to popcountl implementation


# 0645a9dd 28-Jun-2017 Hesham Almatary <hesham.almatary@data61.csiro.au>

util.h: implement popcount for architectures that don't have HW inst for it


# 5552c6c6 15-Jun-2017 Adrian Danis <Adrian.Danis@data61.csiro.au>

mark memset and memcpy as VISIBLE

When compiling the kernel as a whole program it is possible that these functions may
be inlined and not emitted in the resulting binary. However at the same time the
compiler may itself emit calls to these functions. Marking these functions as
externally visible tells the compiler that there may be more usages of them than
it sees immediately in the source code, in this cases usages that the compiler
itself is going to generate


# f1ef8b3a 01-Jun-2017 Hesham Almatary <hesham.almatary@data61.csiro.au>

ARM: Fix assembler error with BIT definition


# 1930cf2e 28-May-2017 Hesham Almatary <hesham.almatary@data61.csiro.au>

Fix: Allow util.h to be included in assembly files


# f8606c86 20-Feb-2017 Adrian Danis <Adrian.Danis@data61.csiro.au>

Provide spec for CTZL

Provides a spec for the __builtin_ctzl function and changes existing
code to use this wrapper


# 11778548 08-Dec-2016 Thomas Sewell <Thomas.Sewell@nicta.com.au>

Mark halt as no-inline and no-return.

This actually leads to better code. Copies of the halt loop inlined
in various places will instead be single instructions 'bl halt'. It's
also important for the translation validation to avoid having
pointless loops everywhere, especially inside the bodies of other
loops.


# 9b743571 05-Dec-2016 Thomas Sewell <Thomas.Sewell@nicta.com.au>

Prototype compiler builtins.

Add compatible prototypes for compiler builtins
__builtin_unreachable, __builtin_ctzl, __builtin_clzl,
and __builtin_popcountl.

The compiler ignores these, but they are necessary for the Isabelle
C parser to handle them. This is needed to drop DONT_TRANSLATE markers
from various functions which call these builtins.


# e7d0a886 24-Nov-2016 Adrian Danis <Adrian.Danis@data61.csiro.au>

x86: Rewrite config_default as config_ternary for FPU

config_default was intended to either evaluated to the passed configuration
value, or the a default value if the config didn't exist. For integer values
this does not actually work, and the default value always gets returned.
This commit reimplements the desired functionality as config_ternary, which
takes 3 arguments, a config to switch on and a desired true and false expansion


# 08bc937f 24-Nov-2016 amrzar <azarrabi@nicta.com.au>

add DONT_TRANSLATE for popcount builtin


# ed95f84a 22-Sep-2016 Anna Lyons <Anna.Lyons@data61.csiro.au>

SELFOUR-413: changes for verification

Avoid using ptrs to arrays at all

Another macrofull change brought to your by verification. This should
avoid nasty proofs about const pointers.


# 33a771d3 12-Jul-2016 Anna Lyons <Anna.Lyons@nicta.com.au>

Split fault types into arch/generic

Prior to this commit faults were separate
per architecture. This commit extracts the common
fault types and introduces arch specific faults,
reducing code duplication across architectures.


# b3b7e3cb 22-Nov-2016 amrzar <azarrabi@nicta.com.au>

x86: use popcount for IPIs


# 56030fc3 06-Jul-2016 Kofi Doku Atuah <kofi.dokuatuah@nicta.com.au>

x86: Fix cpuid family/model composition

Fixes a bug where previously MODEL_ID() was defined as:
`#define MODEL_ID(x) ( ((x & 0xf0000) >> 16) + (x & 0xf0) )`

This was incorrect because (1) it didn't take into account the conditional
nature of the extended_model_ID, and (2) it's actually shifting the
extended_model_ID into the low bits and keeping the model_ID in the high bits,
when it should be the other way around.

This patch also introduces a foundation for more sane testing of CPU vendor,
family, model and brand_ID.


# 39c692cc 05-Jul-2016 Hesham Almatary <hesham.almatary@data61.csiro.au>

SELFOUR-526: ARM - Unify C entry point for system calls


# d36447b3 29-Jun-2016 Matthew Fernandez <matthew.fernandez@nicta.com.au>

Mark strncmp as a pure function.

Simply a performance optimisation. This has no effect on functional behaviour.


# fee3af3d 29-Jun-2016 Matthew Fernandez <matthew.fernandez@nicta.com.au>

Fix: Make VISIBLE expand to nothing for Clang.

The `VISIBLE` macro is designed to selectively inhibit the effects of GCC's
whole program and link-time optimisations. This is necessary when a C function
is only referenced from a context outside the compiler's visibility, e.g. an
assembly file. As far as I can determine, Clang's link-time optimisations
already account for this possibility and do not need to have this information
manually indicated to them (see, for example, Linux's compiler support headers).

In any event, `__attribute__((visibility("default")))` is not equivalent to
`__attribute__((externally_visible))`, but is instead for controlling symbol
visibility in a library-like setting. This commit removes this incorrect
expansion.


# 1cb58c1f 01-Jun-2016 Adrian Danis <Adrian.Danis@data61.csiro.au>

Add config_default macro

This macro allows for using the value of a CONFIG_ variable in situations
where it may not be defined. This could be due to it being a dependency
on another CONFIG_ variable that is not currently defined. This arrises
from code blocks like

if (config_set(CONFIG_FOO)) {
return CONFIG_VAR_DEPENDS_ON_FOO;
}

This will not compile when CONFIG_FOO is not set. Using

return config_default(CONFIG_VAR_DEPENDS_ON_FOO, 42);

Provides a way for this to be built


# 21d9f7ae 26-Jan-2016 Adrian Danis <Adrian.Danis@nicta.com.au>

Add 'used' attribute to memcpy to prevent optimizing out

Some versions of GCC replace a struct copy with a call to 'memcpy',
which it is fully in its rights to do. Unfortunately on ARM platforms,
that have no direct calls to memcpy, the optimizer (in the presence
of -fwhole-program) drops the implementation of memcpy, even as it
is outputting calls to it.

Add the USED attribute prevents the optimizer from dropping the
function eagerly.


# 77588998 16-Dec-2015 Anna Lyons <Anna.Lyons@nicta.com.au>

SELFOUR-244: symlink duplicated files from libsel4 into kernel rather than duplicating them, remove sanity target as a result


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

Remove now-unused CLZL macro.


# 84fb0dcd 08-Dec-2015 Joel Beeren <joel.beeren@nicta.com.au>

conversion: fixed hardcoded spec rule for clzl


# 94b02162 07-Dec-2015 Joel Beeren <joel.beeren@nicta.com.au>

conversion: fixed bitfield generator, clz spec


# e3e9780a 28-Jun-2015 Adrian Danis <Adrian.Danis@nicta.com.au>

Rename CTZ and CLZ functions to long variants, change parameters from uint32_t to word_t to make compatible between 32 and 64-bit


# 3ef26761 03-Jun-2015 Adrian Danis <Adrian.Danis@nicta.com.au>

Make utility functions 64bit friendly


# affb802b 18-Nov-2015 Matthew Fernandez <matthew.fernandez@nicta.com.au>

Add 'fastcall' abstraction to util.h.

This change has no effect on verification or generated code.


# 991d7afb 29-Sep-2015 Rafal Kolanski <rafal.kolanski@nicta.com.au>

Wrap __builtin_clz for C Parser (verification)

Create new function "clz" which invokes __builtin_clz
Tell the C parser to not try translate it (DONT_TRANSLATE), but instead
to trust the spec we provide (FNSPEC+MODIFIES).

Squashed the fix by Anna Lyons:

rearrange CLZ in util.h and s/__builtin__clz/__builtin_clz/


# 26371086 18-May-2015 Adrian Danis <Adrian.Danis@nicta.com.au>

ia32: Ensure multiboot structs are packed

This is a paranoia commit as most compilers will not
pad members of a struct if they are all the same size,
but this commit ensures it.


# 8abdf6c5 14-Apr-2015 Sean Peters <sean.peters@nicta.com.au>

ia32: added the option to disable prefetchers


# 91b7da86 17-Jul-2014 TrusthworthySystems <gatekeeper@sel4.systems>

Release snapshot