This may or may not be a problem, but what happens if we have 2 processes who call rtc_read at the same time (one process is pre-empted while waiting for the next tick, and the other also calls read)? If the flag is set to 0 between stopping process 1 and starting process 2, the first process will miss a tick.
This probably isn't a huge issue, but it would be nice to virtualize the RTC for multple processes which should fix this problem. Each process has its own interrupt_occurred flag, and on tick all of them will be reset to 0. Also each file descriptor should have its own virtual RTC frequency.
This may or may not be a problem, but what happens if we have 2 processes who call rtc_read at the same time (one process is pre-empted while waiting for the next tick, and the other also calls read)? If the flag is set to 0 between stopping process 1 and starting process 2, the first process will miss a tick.
This probably isn't a huge issue, but it would be nice to virtualize the RTC for multple processes which should fix this problem. Each process has its own interrupt_occurred flag, and on tick all of them will be reset to 0. Also each file descriptor should have its own virtual RTC frequency.