mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-21 20:08:12 +00:00
ca37f26a01
When releasing a lock we must take care that all state is written back to memory and is not cached in registers. The volatile flag of the lock variable only means to the compiler that this value must be written immediately. Other values changed before may be kept by the compiler in registers, which we don't want here. Additionally the compiler is free to reorder the code in order to optimize. That means the code we intend to be executed inside the critical section can get be reordered and can be executed after we reset the lock variable in the unlock implementation. The volatile statement of the lock variable doesn't prevent reordering of instructions which are independent. By adding a explicit memory barrier, we force the compiler to generate code that writes back all the register content to memory/cache (and avoid a bunch of hard to find bugs ...) |
||
---|---|---|
.. | ||
etc | ||
include | ||
lib | ||
mk | ||
run | ||
src | ||
README |
This is generic part of the Genode implementation. It consists of two parts: :_Core_: is the ultimate root of the Genode application tree and provides abstractions for the lowest-level hardware resources such as RAM, ROM, CPU, and generic device access. All generic parts of Core can be found here - for system-specific implementations refer to the appropriate 'base-<system>' directory. :_Base libraries and protocols_: that are used by each Genode component to interact with other components. This is the glue that holds everything together.