Code cleanup and fix to do initial setup steps in the right order
Code cleanup and fix to do initial setup steps in the right order

Clean up our handling of ARM/Thumb switching by distinguishing between
"what mode are we in right now?" and "what mode does test code want to
be in?". Shuffle things around so write_test_code() is responsible for
doing all the prologue stuff, and write_random_register_data() is only
called explicitly, not implicitly by other things.

This makes it easy to make the actual bug fix, which is to call
write_random_register_data() after write_memblock_setup() so that
the latter doesn't have to clean its registers to not include any
address-location-dependent values.

stsquad/risu,stsquad/risu,vivier/risu,stsquad/risu,hw-claudio/risu-aarch64,hw-claudio/risu-aarch64,vivier/risu