2 Copyright © 2012-2015, 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 return TaskGetStorageSlot(GET_THIS_TASK
, id
);
56 IPTR
TaskGetStorageSlot(struct Task
* t
, LONG id
)
58 struct ETask
*et
= t
? GetETask(t
) : NULL
;
61 D(bug("TaskGetStorageSlot: %p: Get TaskGetStorageSlot %d\n", et
, id
);)
64 /* Only ETasks can do this */
65 D(bug("TaskGetStorageSlot: Not an ETask!\n");)
69 ts
= et
->et_TaskStorage
;
70 if (ts
== NULL
|| ts
[__TS_FIRSTSLOT
] <= id
) {
71 D(bug("TaskGetStorageSlot: ID %d was not set!\n", id
);)