source: rtems/cpukit/include/rtems/rtems/partdata.h

Last change on this file was c15132aa, checked in by Sebastian Huber <sebastian.huber@…>, on 10/20/23 at 09:09:42

mpci: Hide implementation details

This improves the standard compatibility of API headers. It fixes
errors like this if RTEMS_MULTIPROCESSING is enabled:

cpukit/include/rtems/score/processormask.h: In function 'uint32_t _Processor_mask_Find_last_set(const Processor_mask*)':
cpukit/include/rtems/score/processormask.h:339:21: error: 'flsl' was not declared in this scope

339 | return (uint32_t) BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );

|

  • Property mode set to 100644
File size: 4.5 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSImplClassicPartition
7 *
8 * @brief This header file provides data structures used by the implementation
9 *   and the @ref RTEMSImplApplConfig to define ::_Partition_Information.
10 */
11
12/* COPYRIGHT (c) 1989-2008.
13 * On-Line Applications Research Corporation (OAR).
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 *    notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 *    notice, this list of conditions and the following disclaimer in the
22 *    documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_RTEMS_PARTDATA_H
38#define _RTEMS_RTEMS_PARTDATA_H
39
40#include <rtems/rtems/part.h>
41#include <rtems/score/isrlock.h>
42#include <rtems/score/objectdata.h>
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48/**
49 * @addtogroup RTEMSImplClassicPartition
50 *
51 * @{
52 */
53
54/**
55 * @brief The Partition Control Block (PTCB) represents a partition.
56 */
57typedef struct {
58  /**
59   * @brief This member turns the PTCB into an object.
60   */
61  Objects_Control Object;
62
63#if defined(RTEMS_SMP)
64  /**
65   * @brief This lock protects the chain of unallocated buffers and the number
66   *   of allocated buffers.
67   */
68  ISR_lock_Control Lock;
69#endif
70
71  /**
72   * @brief This member contains the base address of the buffer area.
73   *
74   * The base address is the address of the first byte contained in the buffer
75   * area.
76   */
77  const void *base_address;
78
79  /**
80   * @brief This member contains the limit address of the buffer area.
81   *
82   * The limit address is the address of the last byte contained in the buffer
83   * area.
84   */
85  const void *limit_address;
86
87  /**
88   * @brief This member contains the size of each buffer in bytes.
89  */
90  size_t buffer_size;
91
92  /**
93   * @brief This member contains the attribute set provided at creation time.
94   */
95  rtems_attribute attribute_set;
96
97  /**
98   * @brief This member contains the count of allocated buffers.
99   */
100  uintptr_t number_of_used_blocks;
101
102  /**
103   * @brief This chain is used to manage unallocated buffers.
104   */
105  Chain_Control Memory;
106} Partition_Control;
107
108/**
109 * @brief The Partition Manager objects information is used to manage the
110 *   objects of this class.
111 *
112 * If #CONFIGURE_MAXIMUM_PARTITIONS is greater than zero, then the object
113 * information is defined by PARTITION_INFORMATION_DEFINE(), otherwise it is
114 * defined by OBJECTS_INFORMATION_DEFINE_ZERO().
115 */
116extern Objects_Information _Partition_Information;
117
118#if defined(RTEMS_MULTIPROCESSING)
119struct _Thread_Control;
120
121/**
122 * @brief Sends the extract proxy request.
123 *
124 * This routine is invoked when a task is deleted and it has a proxy which must
125 * be removed from a thread queue and the remote node must be informed of this.
126 *
127 * @param[in, out] the_thread is the thread proxy.
128 * @param id is the partition identifier.
129 */
130void _Partition_MP_Send_extract_proxy (
131  struct _Thread_Control *the_thread,
132  Objects_Id              id
133);
134#endif
135
136/**
137 * @brief Defines the Partition Manager objects information.
138 *
139 * This macro should only be used by <rtems/confdefs/objectsclassic.h>.
140 *
141 * @param _max is the configured object maximum (the #OBJECTS_UNLIMITED_OBJECTS
142 *   flag may be set).
143 */
144#define PARTITION_INFORMATION_DEFINE( _max ) \
145  OBJECTS_INFORMATION_DEFINE( \
146    _Partition, \
147    OBJECTS_CLASSIC_API, \
148    OBJECTS_RTEMS_PARTITIONS, \
149    Partition_Control, \
150    _max, \
151    OBJECTS_NO_STRING_NAME, \
152    _Partition_MP_Send_extract_proxy \
153  )
154
155/** @} */
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif
162/* end of include file */
Note: See TracBrowser for help on using the repository browser.