source: rtems/doc/user/smp.t @ d46ab11b

4.115
Last change on this file since d46ab11b was d46ab11b, checked in by Joel Sherrill <joel.sherrill@…>, on 03/07/14 at 19:20:04

Classic API Users Guide: Add SMP and affinity services.

This patch adds the initial version of the SMP chapter to the Users Guide.

  • Property mode set to 100644
File size: 3.2 KB
Line 
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
11This chapter describes the services related to Symmetric Multiprocessing
12provided by RTEMS.
13
14The 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
28This section details the symmetric multiprocessing services.  A subsection
29is dedicated to each of these services and describes the calling sequence,
30related 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
44int 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
53Returns the number of processors being utilized.
54
55@subheading DESCRIPTION:
56
57The @code{rtems_smp_get_processor_count} routine is used to obtain the
58number of processor cores being utilized.
59
60@subheading NOTES:
61
62NONE
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
76rtems_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
91The cpuset pointer argument is invalid.
92
93@item RTEMS_UNSATISFIED
94The @code{cpusetsize} does not match the value of @code{affinitysetsize}
95field in the thread attribute object.
96
97@item RTEMS_INVALID_ID
98The @code{id} is invalid.
99
100@end table
101
102@subheading DESCRIPTION:
103
104The @code{rtems_task_get_affinity} routine is used to obtain the
105@code{affinityset} field from the thread object @code{id}.
106The value of this field is returned in @code{cpuset}
107
108@subheading NOTES:
109
110NONE
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
124rtems_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
139The cpuset pointer argument is invalid.
140
141@item RTEMS_UNSATISFIED
142The @code{cpusetsize} does not match the value of @code{affinitysetsize}
143field in the thread attribute object.
144
145@item RTEMS_UNSATISFIED
146The @code{cpuset} did not select a valid cpu.
147
148@item RTEMS_UNSATISFIED
149The @code{cpuset} selected a cpu that was invalid.
150
151@item RTEMS_INVALID_ID
152The @code{id} is invalid.
153
154@end table
155
156@subheading DESCRIPTION:
157
158The @code{rtems_task_set_affinity} routine is used to set the
159@code{affinity.set} field of the thread control object associated
160with @code{id}.  This value controls the cpuset that the task can
161execute on.
162
163@subheading NOTES:
164
165NONE
Note: See TracBrowser for help on using the repository browser.