hal: Add more code to CPU abstraction

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>