History log of /seL4-test-master/projects/util_libs/libutils/include/utils/force.h
Revision Date Author Comments
# a7130f9f 04-Jun-2017 Anna Lyons <Anna.Lyons@data61.csiro.au>

fix licenses


# 7334efa6 20-Jun-2016 Matthew Fernandez <matthew.fernandez@nicta.com.au>

libutils: Rephrase FORCE_READ into something safer.

This commit rephrases the `FORCE_READ` macro to avoid an unorthodox use of
`volatile`. The change makes the read less malleable from the compiler's point
of view.

It also has the unintended side effect of slightly optimising this operation. On
x86, an optimising compiler now generates a single load, rather than a load
followed by a store to the (unused) local variable. On ARM, there is a similar
improvement, but we also save two instructions for stack pointer manipulation
depending on the context in which the macro is expanded.


# ced378f5 06-Jun-2016 Matthew Fernandez <matthew.fernandez@nicta.com.au>

Remove an unnecessary #include.


# a7b8939c 25-May-2016 Matthew Fernandez <matthew.fernandez@nicta.com.au>

libutils: trivial: Replace ifdef guards with pragma once.


# a465e0cf 18-Feb-2016 Stephen Sherratt <Stephen.Sherratt@nicta.com.au>

libutils: Added force.h

This file contains macros for forcing behaviour often optimized away by
compilers. For example, the FORCE_READ macro forces a read from a given
address, even if the read value is never used.