summaryrefslogtreecommitdiffstats
path: root/doc/user/smp.t
blob: 240613ddeaef5203cae70e919385ccfab7fd128a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
@c
@c  COPYRIGHT (c) 2014.
@c  On-Line Applications Research Corporation (OAR).
@c  All rights reserved. 
@c

@chapter Symmetric Multiprocessing Services

@section Introduction

This chapter describes the services related to Symmetric Multiprocessing
provided by RTEMS. 

The application level services currently provided are:

@itemize @bullet
@item @code{rtems_smp_get_processor_count} - Obtain Number of CPUs
@item @code{rtems_task_get_affinity} - Obtain Task Affinity
@item @code{rtems_task_set_affinity} - Set Task Affinity
@end itemize

@section Background

@section Operations

@section Directives

This section details the symmetric multiprocessing services.  A subsection
is dedicated to each of these services and describes the calling sequence,
related constants, usage, and status codes.

@c
@c rtems_smp_get_processor_count
@c
@page
@subsection rtems_smp_get_processor_count - Obtain Number of CPUs

@subheading CALLING SEQUENCE:

@ifset is-C
@example
#include <rtems.h>

int rtems_smp_get_processor_count(void);
@end example
@end ifset

@ifset is-Ada
@end ifset

@subheading STATUS CODES:

Returns the number of processors being utilized.

@subheading DESCRIPTION:

The @code{rtems_smp_get_processor_count} routine is used to obtain the
number of processor cores being utilized.

@subheading NOTES:

NONE

@c
@c rtems_task_get_affinity
@c
@page
@subsection rtems_task_get_affinity - Obtain Task Affinity

@subheading CALLING SEQUENCE:

@ifset is-C
@example
#include <rtems.h>

rtems_status_code rtems_task_get_affinity(
  rtems_id             id,
  size_t               cpusetsize,
  cpu_set_t           *cpuset 
);
@end example
@end ifset

@ifset is-Ada
@end ifset

@subheading STATUS CODES:

@table @b
@item RTEMS_UNSATISFIED
The cpuset pointer argument is invalid.

@item RTEMS_UNSATISFIED
The @code{cpusetsize} does not match the value of @code{affinitysetsize}
field in the thread attribute object.

@item RTEMS_INVALID_ID
The @code{id} is invalid.

@end table

@subheading DESCRIPTION:

The @code{rtems_task_get_affinity} routine is used to obtain the
@code{affinityset} field from the thread object @code{id}.
The value of this field is returned in @code{cpuset}

@subheading NOTES:

NONE

@c
@c rtems_task_set_affinity
@c
@page
@subsection rtems_task_set_affinity - Set Task Affinity

@subheading CALLING SEQUENCE:

@ifset is-C
@example
#include <rtems.h>

rtems_status_code rtems_task_set_affinity(
  rtems_id             id,
  size_t               cpusetsize,
  cpu_set_t           *cpuset 
);
@end example
@end ifset

@ifset is-Ada
@end ifset

@subheading STATUS CODES:

@table @b
@item RTEMS_UNSATISFIED
The cpuset pointer argument is invalid.

@item RTEMS_UNSATISFIED
The @code{cpusetsize} does not match the value of @code{affinitysetsize}
field in the thread attribute object.

@item RTEMS_UNSATISFIED
The @code{cpuset} did not select a valid cpu.

@item RTEMS_UNSATISFIED
The @code{cpuset} selected a cpu that was invalid.

@item RTEMS_INVALID_ID
The @code{id} is invalid.

@end table

@subheading DESCRIPTION:

The @code{rtems_task_set_affinity} routine is used to set the
@code{affinity.set} field of the thread control object associated
with @code{id}.  This value controls the cpuset that the task can
execute on.

@subheading NOTES:

NONE