2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Dispatch() - Exec-side task dispatch handling
9 #include <aros/debug.h>
10 #include <exec/lists.h>
11 #include <exec/tasks.h>
12 #include <exec/execbase.h>
13 #include <proto/exec.h>
15 #include "exec_intern.h"
16 #include "exec_util.h"
18 #include "taskstorage.h"
20 /*****************************************************************************
23 #include <proto/exec.h>
25 AROS_LH1(BOOL
, Dispatch
,
28 AROS_LHA(struct Task
*, task
, A0
),
31 struct ExecBase
*, SysBase
, 10, Exec
)
34 Perform dispatch-time task maintenance.
37 task - a task to be dispatched.
40 TRUE if dispatching permitted, FALSE if dispatching needs to be
44 This is a very private function.
54 ******************************************************************************/
60 if (task
== PrivExecBase(SysBase
)->ServicePort
->mp_SigTask
)
63 * We can't ask housekeeper to service itself.
64 * It's its own responsibility to take care about itself.
69 oldstorage
= task
->tc_UnionETask
.tc_TaskStorage
[__TS_FIRSTSLOT
];
70 if (oldstorage
< PrivExecBase(SysBase
)->TaskStorageSize
)
72 D(bug("[Dispatch] Task 0x%p <%s> needs TSS increase (%d -> %d)\n", task
, task
->tc_Node
.ln_Name
, oldstorage
, PrivExecBase(SysBase
)->TaskStorageSize
));
75 * The task has been removed from TaskReady list by kernel.
76 * Send it to housekeeper for servicing.
77 * We use InternalPutMsg() because it won't clobber ln_Type.
79 InternalPutMsg(((struct IntExecBase
*)SysBase
)->ServicePort
, (struct Message
*)task
, SysBase
);