User high resolution timer fix
Describe problem solved by this pull request
This fixes two crashes when using user hrt:
- Stack underflow, which occurs randomly due to exception stack overflow
- Crash due to illegal instruction when trying to disable global interrupts from user space.
Describe your solution
User land code does not need to disable system interrupts, especially here, as the atomic handling of hrt is handled by the kernel side code.
Test data / coverage
Unpublished RISC-V target for Microchip MPFS.
Additional context
RISC-V does not allow executing global interrupt disable/enable from user space. Doing so results in an illegal instruction trap.
@dagar I removed hrt_store_absolute_time entirely
Can you fix the CI failure (style check)? https://github.com/PX4/PX4-Autopilot/actions/runs/3035286435/jobs/4885259187
Otherwise this looks good, thanks.
Can you fix the CI failure (style check)? https://github.com/PX4/PX4-Autopilot/actions/runs/3035286435/jobs/4885259187
Otherwise this looks good, thanks.
Oh I'm sorry, did not notice there was a styling issue.
@dagar was there still something you wish for me to do? From my part this is ready to merge.
Hello again @dagar , this has been inactive for a while but the fix is valid and we have been running this patch for a while now so it is stable as well. If you wish I can also abandon this and we'll keep the change in our private repo only.
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:
https://discuss.px4.io/t/px4-maintainers-call-august-01-2023/33417/1