Move the target dependent code from the shared code to the HAL implementation