Add some comments about timer.device.

This commit is contained in:
Chris Young 2014-11-29 19:56:54 +00:00
parent 6b2676d33f
commit 70e777c30d
2 changed files with 14 additions and 3 deletions

View File

@ -105,10 +105,21 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
/* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
* The library base and interface are obtained there, rather than here, due to
* the additional complexities of opening devices, which aren't important here
* (as we only need the library interface), but are important for the scheduler
* (as it also uses the device interface). We trust that the scheduler has
* initialised before any other code requires the timer's library interface
* (this is ensured by waiting for the scheduler to start up) and that it is
* OK to use a child process' timer interface, to avoid opening it twice.
*/
/* BOOPSI classes.
* \todo These should be opened using OpenClass(), however as
* the macros all use the deprecated _GetClass() functions,
* we may as well just open them normally for now. */
* we may as well just open them normally for now.
*/
AMINS_LIB_OPEN("classes/arexx.class", 50, ARexx, "main", 1, true)
AMINS_LIB_OPEN("images/bevel.image", 50, Bevel, "main", 1, true)

View File

@ -282,7 +282,7 @@ static void ami_scheduler_run(struct MsgPort *nsmsgport)
static struct MsgPort *ami_schedule_open_timer(void)
{
struct MsgPort *msgport = AllocSysObjectTags(ASOT_PORT,
ASO_NoTrack,FALSE,
ASO_NoTrack, FALSE,
TAG_DONE);
tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
@ -294,7 +294,7 @@ static struct MsgPort *ami_schedule_open_timer(void)
OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
TimerBase = (struct Device *)tioreq->Request.io_Device;
ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL);
ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, NULL);
return msgport;
}