18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
|
*/ |
20 |
|
|
21 |
– |
/* |
22 |
– |
* TODO: Prime(0) |
23 |
– |
*/ |
24 |
– |
|
21 |
|
#include "sysdeps.h" |
22 |
|
#include "timer.h" |
23 |
|
#include "macos_util.h" |
426 |
|
|
427 |
|
// PrimeTime(0) can either mean (a) "the task runs as soon as interrupts are enabled" |
428 |
|
// or (b) "continue previous delay" if an expired task was stopped via RmvTime() and |
429 |
< |
// then re-installed using InsXTime(). This currently only handles (a). |
430 |
< |
// |
431 |
< |
// API reference: http://developer.apple.com/documentation/mac/Processes/Processes-68.html |
436 |
< |
|
437 |
< |
#if 0 |
438 |
< |
//!! PrimeTime(0) means continue previous delay |
439 |
< |
// (save wakeup time in RmvTime?) |
440 |
< |
if (time == 0) { |
441 |
< |
printf("FATAL: Unsupported PrimeTime(0)\n"); |
442 |
< |
return 0; |
443 |
< |
} |
444 |
< |
#endif |
429 |
> |
// then re-installed using InsXTime(). Since tmWakeUp was set, this is case (b). |
430 |
> |
// The remaining time was saved in tmCount by RmvTime(). |
431 |
> |
timer_mac2host_time(delay, ReadMacInt16(tm + tmCount)); |
432 |
|
|
433 |
|
// Yes, calculate wakeup time relative to last scheduled time |
434 |
|
tm_time_t wakeup; |