source: rtems/cpukit/rtems/include/rtems/rtems/smp.h @ 4bc8d2e

4.115
Last change on this file since 4bc8d2e was 4bc8d2e, checked in by Sebastian Huber <sebastian.huber@…>, on 04/10/14 at 08:58:27

rtems: Rename rtems_smp_get_processor_count()

Rename rtems_smp_get_processor_count() in rtems_get_processor_count().
Make rtems_get_processor_count() a function in uni-processor
configurations to enable ABI compatibility with SMP configurations.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicSMP
5 *
6 * @brief SMP Services API
7 */
8
9/*
10 * COPYRIGHT (c) 1989-2011.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * The license and distribution terms for this file may be
14 * found in the file LICENSE in this distribution or at
15 * http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef _RTEMS_RTEMS_SMP_H
19#define _RTEMS_RTEMS_SMP_H
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#include <rtems/score/smp.h>
26
27/**
28 * @defgroup ClassicSMP SMP Services
29 *
30 * @ingroup ClassicRTEMS
31 *
32 * This encapsulates functionality which is useful for SMP applications.
33 *
34 * This API is also available on uni-processor configurations.  Here compile
35 * time constants are used whenever possible.
36 *
37 * @{
38 */
39
40/**
41 * @brief Returns the count of processors in the system.
42 *
43 * On uni-processor configurations a value of one will be returned.
44 *
45 * On SMP configurations this returns the value of a global variable set during
46 * system initialization to indicate the count of processors.  The processor
47 * count depends on the hardware and application configuration.  The value will
48 * always be less than or equal to the maximum count of application configured
49 * processors.
50 *
51 * @return The count of processors in the system.
52 */
53uint32_t rtems_get_processor_count(void);
54
55/**
56 * @brief Returns the index of the current processor.
57 *
58 * On uni-processor configurations this is a compile time constant and defined
59 * to be zero.
60 *
61 * On SMP configurations an architecture specific method is used to obtain the
62 * index of the current processor in the system.  The set of processor indices
63 * is the range of integers starting with zero up to the processor count minus
64 * one.
65 *
66 * Outside of sections with disabled thread dispatching the current processor
67 * index may change after every instruction since the thread may migrate from
68 * one processor to another.  Sections with disabled interrupts are sections
69 * with thread dispatching disabled.
70 *
71 * @return The index of the current processor.
72 */
73#define rtems_smp_get_current_processor() \
74  _SMP_Get_current_processor()
75
76/** @} */
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
83/* end of include file */
Note: See TracBrowser for help on using the repository browser.