add new stubs for dealing with the "task list(s)"
[AROS.git] / rom / task / QueryTaskTagList.c
blobefa4407ebede793c2f13fceca106348d4bdc9cc5
1 /*
2 Copyright © 2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
8 #include <aros/debug.h>
9 #include <exec/types.h>
10 #include <aros/libcall.h>
11 #include <proto/utility.h>
12 #include <resources/task.h>
14 #include "etask.h"
16 #include "taskres_intern.h"
18 /*****************************************************************************
20 NAME */
21 #include <proto/task.h>
23 AROS_LH2(void, QueryTaskTagList,
25 /* SYNOPSIS */
26 AROS_LHA(struct Task *, task, A0),
27 AROS_LHA(struct TagItem *, tagList, A1),
29 /* LOCATION */
30 struct TaskResBase *, TaskResBase, 6, Task)
32 /* FUNCTION
34 Provides information about selected system Task
36 INPUTS
38 Function takes an array of tags. Data is returned for each tag. See
39 specific tag description.
41 TAGS
43 TaskTag_CPUNumber - (ULONG) Returns the CPU Number the task is currently running on
44 TaskTag_CPUAffinity - (ULONG) Returns the CPU Affinity mask
45 TaskTag_CPUTime - (ULONG) Returns the amount of cpu time a task has used .
46 TaskTag_StartTime - (ULONG) Returns the time the task was launched .
48 RESULT
50 None
52 NOTES
54 EXAMPLE
56 BUGS
58 SEE ALSO
60 INTERNALS
62 ******************************************************************************/
64 AROS_LIBFUNC_INIT
66 struct TagItem * Tag = NULL;
69 /* This is the default implementation */
71 while ((Tag = NextTagItem(&tagList)) != NULL)
73 switch(Tag->ti_Tag)
75 case(TaskTag_CPUNumber):
76 #if defined(__AROSEXEC_SMP__)
77 Tag->ti_Data = GetIntETask(task)->iet_CpuNumber;
78 #else
79 Tag->ti_Data = 0;
80 #endif
81 break;
82 case(TaskTag_CPUAffinity):
83 #if defined(__AROSEXEC_SMP__)
84 Tag->ti_Data = GetIntETask(task)->iet_CpuAffinity;
85 #else
86 Tag->ti_Data = (1 << 0);
87 #endif
88 break;
89 case(TaskTag_CPUTime):
90 Tag->ti_Data = GetIntETask(task)->iet_CpuTime;
91 break;
92 case(TaskTag_StartTime):
93 Tag->ti_Data = GetIntETask(task)->iet_StartTime;
94 break;
98 AROS_LIBFUNC_EXIT
99 } /* QueryTaskTagList() */