2 Copyright © 2015, The AROS Development Team. All rights reserved.
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>
16 #include "taskres_intern.h"
18 /*****************************************************************************
21 #include <proto/task.h>
23 AROS_LH2(void, QueryTaskTagList
,
26 AROS_LHA(struct Task
*, task
, A0
),
27 AROS_LHA(struct TagItem
*, tagList
, A1
),
30 struct TaskResBase
*, TaskResBase
, 6, Task
)
34 Provides information about selected system Task
38 Function takes an array of tags. Data is returned for each tag. See
39 specific tag description.
43 TaskTag_CPUNumber - (IPTR *) Returns the CPU Number the task is currently running on
44 TaskTag_CPUAffinity - (IPTR *) Returns the CPU Affinity mask
45 TaskTag_CPUTime - (struct timeval *) Returns the amount of cpu time a task has used .
46 TaskTag_StartTime - (struct timeval *) Returns the time the task was launched .
62 ******************************************************************************/
66 struct TagItem
* Tag
= NULL
;
69 /* This is the default implementation */
71 while ((Tag
= NextTagItem(&tagList
)) != NULL
)
75 case(TaskTag_CPUNumber
):
76 #if defined(__AROSEXEC_SMP__)
77 *((IPTR
*)Tag
->ti_Data
) = GetIntETask(task
)->iet_CpuNumber
;
79 *((IPTR
*)Tag
->ti_Data
) = 0;
82 case(TaskTag_CPUAffinity
):
83 #if defined(__AROSEXEC_SMP__)
84 *((IPTR
*)Tag
->ti_Data
) = GetIntETask(task
)->iet_CpuAffinity
;
86 *((IPTR
*)Tag
->ti_Data
) = (1 << 0);
89 case(TaskTag_CPUTime
):
90 ((struct timeval
*)Tag
->ti_Data
)->tv_micro
= GetIntETask(task
)->iet_CpuTime
.tv_micro
;
91 ((struct timeval
*)Tag
->ti_Data
)->tv_secs
= GetIntETask(task
)->iet_CpuTime
.tv_secs
;
93 case(TaskTag_StartTime
):
94 ((struct timeval
*)Tag
->ti_Data
)->tv_micro
= GetIntETask(task
)->iet_StartTime
.tv_micro
;
95 ((struct timeval
*)Tag
->ti_Data
)->tv_secs
= GetIntETask(task
)->iet_StartTime
.tv_secs
;
101 } /* QueryTaskTagList() */