ATA Work volume in now formatted again.
[AROS.git] / rom / exec / dispatch.c
blob8886d7d0f9f9847676a65263db73e8b7feff577c
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Dispatch() - Exec-side task dispatch handling
6 Lang: english
7 */
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"
17 #include "etask.h"
18 #include "taskstorage.h"
20 /*****************************************************************************
22 NAME */
23 #include <proto/exec.h>
25 AROS_LH1(BOOL, Dispatch,
27 /* SYNOPSIS */
28 AROS_LHA(struct Task *, task, A0),
30 /* LOCATION */
31 struct ExecBase *, SysBase, 10, Exec)
33 /* FUNCTION
34 Perform dispatch-time task maintenance.
36 INPUTS
37 task - a task to be dispatched.
39 RESULT
40 TRUE if dispatching permitted, FALSE if dispatching needs to be
41 cancelled
43 NOTES
44 This is a very private function.
46 EXAMPLE
48 BUGS
50 SEE ALSO
52 INTERNALS
54 ******************************************************************************/
56 AROS_LIBFUNC_INIT
58 int oldstorage;
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.
66 return TRUE;
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);
81 return FALSE;
84 return TRUE;
86 AROS_LIBFUNC_EXIT
87 } /* Dispatch() */