graphics.library: MakeVPort() RastInfo based double-buffering fixes
[AROS.git] / rom / exec / gettaskstorageslot.c
blob5aef24dfbc77dca68c554fa33804ea942fa18da8
1 /*
2 Copyright © 2012, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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 /*****************************************************************************
17 NAME */
18 #include <proto/exec.h>
20 AROS_LH1(IPTR, GetTaskStorageSlot,
22 /* LOCATION */
23 AROS_LHA(LONG, id, D0),
24 struct ExecBase *, SysBase, 185, Exec)
26 /* FUNCTION
27 Get a value for a task storage slot.
29 INPUTS
30 id - slot ID returned from AllocTaskStorageSlot().
32 RESULT
33 Value stored by SetTaskStorageSlot(), or (IPTR)NULL if the slot was
34 never used.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 AllocTaskStorageSlot(), FreeTaskStorageSlot(), SetTaskStorageSlot()
45 INTERNALS
47 ******************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct ETask *et = GetETask(FindTask(NULL));
52 IPTR *ts;
54 D(bug("GetTaskStorage: %p: Get TaskStorageSlot %d\n", et, id));
56 if (!et) {
57 /* Only ETasks can do this */
58 D(bug("GetTaskStorage: Not an ETask!\n"));
59 return (IPTR)NULL;
62 ts = et->et_TaskStorage;
63 if (ts == NULL || ts[__TS_FIRSTSLOT] <= id) {
64 D(bug("GetTaskStorage: ID %d was not set!\n", id));
65 return (IPTR)NULL;
68 return ts[id];
70 AROS_LIBFUNC_EXIT