make gd a function call instead of a hardcoded register

Don't hardcode the gd pointer in r8, to make it possible to provide
and alternative definition.
arm: add an option to store gd in the cp15