synth: add partially static shift right demo

This demos the use of "partially static" variables, they like
consts, however we modify them early in boot time and provide
functions that do the handy work for us. The handy work of
processing them is accomplished through kernel's alternatives.
To this end we add an example simple alternatives processing
mechanism, its architecture is rather simple given it simply relies
on the linker table with structural data, and updates it as needed.

We demo a partially static function which shifts a variable to
the right by certain amount of times, the amount of times we
shift is determined through a function passed early in boot,
and as such can be dynamic.

Without alternatives processed you'd get:

Synthetics: ps_shr(0XDEADBEEF) returns: 0xDEADBEEF

After alternatives is processed you get:

Synthetics: ps_shr(0XDEADBEEF) returns: 0x0000DEAD

Signed-off-by: Luis R. Rodriguez <>
4 files changed