2 Copyright © 2012, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
8 #include <exec/nodes.h>
9 #include <exec/lists.h>
10 #include <clib/macros.h>
12 #include "exec_intern.h"
13 #include "taskstorage.h"
15 /*****************************************************************************
18 #include <proto/exec.h>
20 AROS_LH1(IPTR
, GetTaskStorageSlot
,
23 AROS_LHA(LONG
, id
, D0
),
24 struct ExecBase
*, SysBase
, 185, Exec
)
27 Get a value for a task storage slot.
30 id - slot ID returned from AllocTaskStorageSlot().
33 Value stored by SetTaskStorageSlot(), or (IPTR)NULL if the slot was
43 AllocTaskStorageSlot(), FreeTaskStorageSlot(), SetTaskStorageSlot()
47 ******************************************************************************/
51 struct ETask
*et
= GetETask(FindTask(NULL
));
54 D(bug("GetTaskStorage: %p: Get TaskStorageSlot %d\n", et
, id
));
57 /* Only ETasks can do this */
58 D(bug("GetTaskStorage: Not an ETask!\n"));
62 ts
= et
->et_TaskStorage
;
63 if (ts
== NULL
|| ts
[__TS_FIRSTSLOT
] <= id
) {
64 D(bug("GetTaskStorage: ID %d was not set!\n", id
));