1 | @c |
---|
2 | @c COPYRIGHT (c) 2014. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | |
---|
7 | @chapter Symmetric Multiprocessing Services |
---|
8 | |
---|
9 | @section Introduction |
---|
10 | |
---|
11 | This chapter describes the services related to Symmetric Multiprocessing |
---|
12 | provided by RTEMS. |
---|
13 | |
---|
14 | The application level services currently provided are: |
---|
15 | |
---|
16 | @itemize @bullet |
---|
17 | @item @code{rtems_smp_get_processor_count} - Obtain Number of CPUs |
---|
18 | @item @code{rtems_task_get_affinity} - Obtain Task Affinity |
---|
19 | @item @code{rtems_task_set_affinity} - Set Task Affinity |
---|
20 | @end itemize |
---|
21 | |
---|
22 | @section Background |
---|
23 | |
---|
24 | @section Operations |
---|
25 | |
---|
26 | @section Directives |
---|
27 | |
---|
28 | This section details the symmetric multiprocessing services. A subsection |
---|
29 | is dedicated to each of these services and describes the calling sequence, |
---|
30 | related constants, usage, and status codes. |
---|
31 | |
---|
32 | @c |
---|
33 | @c rtems_smp_get_processor_count |
---|
34 | @c |
---|
35 | @page |
---|
36 | @subsection rtems_smp_get_processor_count - Obtain Number of CPUs |
---|
37 | |
---|
38 | @subheading CALLING SEQUENCE: |
---|
39 | |
---|
40 | @ifset is-C |
---|
41 | @example |
---|
42 | #include <rtems.h> |
---|
43 | |
---|
44 | int rtems_smp_get_processor_count(void); |
---|
45 | @end example |
---|
46 | @end ifset |
---|
47 | |
---|
48 | @ifset is-Ada |
---|
49 | @end ifset |
---|
50 | |
---|
51 | @subheading STATUS CODES: |
---|
52 | |
---|
53 | Returns the number of processors being utilized. |
---|
54 | |
---|
55 | @subheading DESCRIPTION: |
---|
56 | |
---|
57 | The @code{rtems_smp_get_processor_count} routine is used to obtain the |
---|
58 | number of processor cores being utilized. |
---|
59 | |
---|
60 | @subheading NOTES: |
---|
61 | |
---|
62 | NONE |
---|
63 | |
---|
64 | @c |
---|
65 | @c rtems_task_get_affinity |
---|
66 | @c |
---|
67 | @page |
---|
68 | @subsection rtems_task_get_affinity - Obtain Task Affinity |
---|
69 | |
---|
70 | @subheading CALLING SEQUENCE: |
---|
71 | |
---|
72 | @ifset is-C |
---|
73 | @example |
---|
74 | #include <rtems.h> |
---|
75 | |
---|
76 | rtems_status_code rtems_task_get_affinity( |
---|
77 | rtems_id id, |
---|
78 | size_t cpusetsize, |
---|
79 | cpu_set_t *cpuset |
---|
80 | ); |
---|
81 | @end example |
---|
82 | @end ifset |
---|
83 | |
---|
84 | @ifset is-Ada |
---|
85 | @end ifset |
---|
86 | |
---|
87 | @subheading STATUS CODES: |
---|
88 | |
---|
89 | @table @b |
---|
90 | @item RTEMS_UNSATISFIED |
---|
91 | The cpuset pointer argument is invalid. |
---|
92 | |
---|
93 | @item RTEMS_UNSATISFIED |
---|
94 | The @code{cpusetsize} does not match the value of @code{affinitysetsize} |
---|
95 | field in the thread attribute object. |
---|
96 | |
---|
97 | @item RTEMS_INVALID_ID |
---|
98 | The @code{id} is invalid. |
---|
99 | |
---|
100 | @end table |
---|
101 | |
---|
102 | @subheading DESCRIPTION: |
---|
103 | |
---|
104 | The @code{rtems_task_get_affinity} routine is used to obtain the |
---|
105 | @code{affinityset} field from the thread object @code{id}. |
---|
106 | The value of this field is returned in @code{cpuset} |
---|
107 | |
---|
108 | @subheading NOTES: |
---|
109 | |
---|
110 | NONE |
---|
111 | |
---|
112 | @c |
---|
113 | @c rtems_task_set_affinity |
---|
114 | @c |
---|
115 | @page |
---|
116 | @subsection rtems_task_set_affinity - Set Task Affinity |
---|
117 | |
---|
118 | @subheading CALLING SEQUENCE: |
---|
119 | |
---|
120 | @ifset is-C |
---|
121 | @example |
---|
122 | #include <rtems.h> |
---|
123 | |
---|
124 | rtems_status_code rtems_task_set_affinity( |
---|
125 | rtems_id id, |
---|
126 | size_t cpusetsize, |
---|
127 | cpu_set_t *cpuset |
---|
128 | ); |
---|
129 | @end example |
---|
130 | @end ifset |
---|
131 | |
---|
132 | @ifset is-Ada |
---|
133 | @end ifset |
---|
134 | |
---|
135 | @subheading STATUS CODES: |
---|
136 | |
---|
137 | @table @b |
---|
138 | @item RTEMS_UNSATISFIED |
---|
139 | The cpuset pointer argument is invalid. |
---|
140 | |
---|
141 | @item RTEMS_UNSATISFIED |
---|
142 | The @code{cpusetsize} does not match the value of @code{affinitysetsize} |
---|
143 | field in the thread attribute object. |
---|
144 | |
---|
145 | @item RTEMS_UNSATISFIED |
---|
146 | The @code{cpuset} did not select a valid cpu. |
---|
147 | |
---|
148 | @item RTEMS_UNSATISFIED |
---|
149 | The @code{cpuset} selected a cpu that was invalid. |
---|
150 | |
---|
151 | @item RTEMS_INVALID_ID |
---|
152 | The @code{id} is invalid. |
---|
153 | |
---|
154 | @end table |
---|
155 | |
---|
156 | @subheading DESCRIPTION: |
---|
157 | |
---|
158 | The @code{rtems_task_set_affinity} routine is used to set the |
---|
159 | @code{affinity.set} field of the thread control object associated |
---|
160 | with @code{id}. This value controls the cpuset that the task can |
---|
161 | execute on. |
---|
162 | |
---|
163 | @subheading NOTES: |
---|
164 | |
---|
165 | NONE |
---|