Sharing timers
Create a new device driver for the timer unit
- allow other devices to ask for timer services
- manage timer independently so that it can service multiple requests
Parameters:
- time to wait, address to call when timer reaches that value
API:
- set_timer(time_to_wait, call_back_address)
- set call_back_address to correspond to time+time_to_wait
- compute next alarm to sound and set up timer for that
- update in interrupt service routine for next alarm
Internal state and functions:
- how many alarms can the driver keep track of?
- how are they organized? FIFO? priority queue?