![]() |
|
|||
File indexing completed on 2025-05-11 08:24:12
0001 /* SPDX-License-Identifier: BSD-2-Clause */ 0002 0003 /** 0004 * @file 0005 * 0006 * @ingroup RTEMSImplClassicRegion 0007 * 0008 * @brief This header file defines the Region Manager API. 0009 */ 0010 0011 /* 0012 * Copyright (C) 2020, 2021 embedded brains GmbH & Co. KG 0013 * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) 0014 * 0015 * Redistribution and use in source and binary forms, with or without 0016 * modification, are permitted provided that the following conditions 0017 * are met: 0018 * 1. Redistributions of source code must retain the above copyright 0019 * notice, this list of conditions and the following disclaimer. 0020 * 2. Redistributions in binary form must reproduce the above copyright 0021 * notice, this list of conditions and the following disclaimer in the 0022 * documentation and/or other materials provided with the distribution. 0023 * 0024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 0025 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 0026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 0027 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 0028 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 0029 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 0030 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 0031 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 0032 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 0033 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 0034 * POSSIBILITY OF SUCH DAMAGE. 0035 */ 0036 0037 /* 0038 * This file is part of the RTEMS quality process and was automatically 0039 * generated. If you find something that needs to be fixed or 0040 * worded better please post a report or patch to an RTEMS mailing list 0041 * or raise a bug report: 0042 * 0043 * https://www.rtems.org/bugs.html 0044 * 0045 * For information on updating and regenerating please refer to the How-To 0046 * section in the Software Requirements Engineering chapter of the 0047 * RTEMS Software Engineering manual. The manual is provided as a part of 0048 * a release. For development sources please refer to the online 0049 * documentation at: 0050 * 0051 * https://docs.rtems.org 0052 */ 0053 0054 /* Generated from spec:/rtems/region/if/header */ 0055 0056 #ifndef _RTEMS_RTEMS_REGION_H 0057 #define _RTEMS_RTEMS_REGION_H 0058 0059 #include <stdint.h> 0060 #include <rtems/rtems/attr.h> 0061 #include <rtems/rtems/options.h> 0062 #include <rtems/rtems/status.h> 0063 #include <rtems/rtems/types.h> 0064 #include <rtems/score/heapinfo.h> 0065 0066 #ifdef __cplusplus 0067 extern "C" { 0068 #endif 0069 0070 /* Generated from spec:/rtems/region/if/group */ 0071 0072 /** 0073 * @defgroup RTEMSAPIClassicRegion Region Manager 0074 * 0075 * @ingroup RTEMSAPIClassic 0076 * 0077 * @brief The Region Manager provides facilities to dynamically allocate memory 0078 * in variable sized units. 0079 */ 0080 0081 /* Generated from spec:/rtems/region/if/get-segment-size */ 0082 0083 /** 0084 * @ingroup RTEMSAPIClassicRegion 0085 * 0086 * @brief Gets the size of the region segment. 0087 * 0088 * @param id is the region identifier. 0089 * 0090 * @param segment is the begin address of the segment. 0091 * 0092 * @param[out] size is the pointer to a uintptr_t object. When the directive 0093 * call is successful, the size of the segment in bytes will be stored in 0094 * this object. 0095 * 0096 * This directive obtains the size in bytes of the segment specified by 0097 * ``segment`` of the region specified by ``id`` in ``size``. 0098 * 0099 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0100 * 0101 * @retval ::RTEMS_INVALID_ADDRESS The ``segment`` parameter was NULL. 0102 * 0103 * @retval ::RTEMS_INVALID_ADDRESS The ``size`` parameter was NULL. 0104 * 0105 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0106 * identifier specified by ``id``. 0107 * 0108 * @retval ::RTEMS_INVALID_ADDRESS The segment was not within the region. 0109 * 0110 * @par Notes 0111 * The actual length of the allocated segment may be larger than the requested 0112 * size because a segment size is always a multiple of the region's page size. 0113 * 0114 * @par Constraints 0115 * @parblock 0116 * The following constraints apply to this directive: 0117 * 0118 * * The directive may be called from within device driver initialization 0119 * context. 0120 * 0121 * * The directive may be called from within task context. 0122 * 0123 * * The directive may obtain and release the object allocator mutex. This may 0124 * cause the calling task to be preempted. 0125 * @endparblock 0126 */ 0127 rtems_status_code rtems_region_get_segment_size( 0128 rtems_id id, 0129 void *segment, 0130 uintptr_t *size 0131 ); 0132 0133 /* Generated from spec:/rtems/region/if/create */ 0134 0135 /** 0136 * @ingroup RTEMSAPIClassicRegion 0137 * 0138 * @brief Creates a region. 0139 * 0140 * @param name is the object name of the region. 0141 * 0142 * @param starting_address is the starting address of the memory area managed 0143 * by the region. 0144 * 0145 * @param length is the length in bytes of the memory area managed by the 0146 * region. 0147 * 0148 * @param page_size is the alignment of the starting address and length of each 0149 * allocated segment of the region. 0150 * 0151 * @param attribute_set is the attribute set of the region. 0152 * 0153 * @param[out] id is the pointer to an ::rtems_id object. When the directive 0154 * call is successful, the identifier of the created region will be stored in 0155 * this object. 0156 * 0157 * This directive creates a region which resides on the local node. The region 0158 * has the user-defined object name specified in ``name``. The assigned object 0159 * identifier is returned in ``id``. This identifier is used to access the 0160 * region with other region related directives. 0161 * 0162 * The region manages the **contiguous memory area** which starts at 0163 * ``starting_address`` and is ``length`` bytes long. The memory area shall be 0164 * large enough to contain some internal region administration data. 0165 * 0166 * The **starting address** and **length of segments** allocated from the 0167 * region will be an integral multiple of ``page_size``. The specified page 0168 * size will be aligned to an implementation-dependent minimum alignment if 0169 * necessary. 0170 * 0171 * The **attribute set** specified in ``attribute_set`` is built through a 0172 * *bitwise or* of the attribute constants described below. Not all 0173 * combinations of attributes are allowed. Some attributes are mutually 0174 * exclusive. If mutually exclusive attributes are combined, the behaviour is 0175 * undefined. Attributes not mentioned below are not evaluated by this 0176 * directive and have no effect. Default attributes can be selected by using 0177 * the #RTEMS_DEFAULT_ATTRIBUTES constant. 0178 * 0179 * The **task wait queue discipline** is selected by the mutually exclusive 0180 * #RTEMS_FIFO and #RTEMS_PRIORITY attributes. The discipline defines the order 0181 * in which tasks wait for allocatable segments on a currently empty region. 0182 * 0183 * * The **FIFO discipline** is the default and can be emphasized through use 0184 * of the #RTEMS_FIFO attribute. 0185 * 0186 * * The **priority discipline** is selected by the #RTEMS_PRIORITY attribute. 0187 * 0188 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0189 * 0190 * @retval ::RTEMS_INVALID_NAME The ``name`` parameter was invalid. 0191 * 0192 * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL. 0193 * 0194 * @retval ::RTEMS_INVALID_ADDRESS The ``starting_address`` parameter was NULL. 0195 * 0196 * @retval ::RTEMS_TOO_MANY There was no inactive object available to create a 0197 * region. The number of regions available to the application is configured 0198 * through the @ref CONFIGURE_MAXIMUM_REGIONS application configuration 0199 * option. 0200 * 0201 * @retval ::RTEMS_INVALID_SIZE The ``page_size`` parameter was invalid. 0202 * 0203 * @retval ::RTEMS_INVALID_SIZE The memory area specified in 0204 * ``starting_address`` and ``length`` was too small. 0205 * 0206 * @par Notes 0207 * For control and maintenance of the region, RTEMS allocates a RNCB from the 0208 * local RNCB free pool and initializes it. 0209 * 0210 * @par Constraints 0211 * @parblock 0212 * The following constraints apply to this directive: 0213 * 0214 * * The directive may be called from within device driver initialization 0215 * context. 0216 * 0217 * * The directive may be called from within task context. 0218 * 0219 * * The directive may obtain and release the object allocator mutex. This may 0220 * cause the calling task to be preempted. 0221 * 0222 * * The number of regions available to the application is configured through 0223 * the @ref CONFIGURE_MAXIMUM_REGIONS application configuration option. 0224 * 0225 * * Where the object class corresponding to the directive is configured to use 0226 * unlimited objects, the directive may allocate memory from the RTEMS 0227 * Workspace. 0228 * @endparblock 0229 */ 0230 rtems_status_code rtems_region_create( 0231 rtems_name name, 0232 void *starting_address, 0233 uintptr_t length, 0234 uintptr_t page_size, 0235 rtems_attribute attribute_set, 0236 rtems_id *id 0237 ); 0238 0239 /* Generated from spec:/rtems/region/if/ident */ 0240 0241 /** 0242 * @ingroup RTEMSAPIClassicRegion 0243 * 0244 * @brief Identifies a region by the object name. 0245 * 0246 * @param name is the object name to look up. 0247 * 0248 * @param[out] id is the pointer to an ::rtems_id object. When the directive 0249 * call is successful, the object identifier of an object with the specified 0250 * name will be stored in this object. 0251 * 0252 * This directive obtains a region identifier associated with the region name 0253 * specified in ``name``. 0254 * 0255 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0256 * 0257 * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL. 0258 * 0259 * @retval ::RTEMS_INVALID_NAME The ``name`` parameter was 0. 0260 * 0261 * @retval ::RTEMS_INVALID_NAME There was no object with the specified name on 0262 * the local node. 0263 * 0264 * @par Notes 0265 * @parblock 0266 * If the region name is not unique, then the region identifier will match the 0267 * first region with that name in the search order. However, this region 0268 * identifier is not guaranteed to correspond to the desired region. 0269 * 0270 * The objects are searched from lowest to the highest index. Only the local 0271 * node is searched. 0272 * 0273 * The region identifier is used with other region related directives to access 0274 * the region. 0275 * @endparblock 0276 * 0277 * @par Constraints 0278 * @parblock 0279 * The following constraints apply to this directive: 0280 * 0281 * * The directive may be called from within any runtime context. 0282 * 0283 * * The directive will not cause the calling task to be preempted. 0284 * @endparblock 0285 */ 0286 rtems_status_code rtems_region_ident( rtems_name name, rtems_id *id ); 0287 0288 /* Generated from spec:/rtems/region/if/delete */ 0289 0290 /** 0291 * @ingroup RTEMSAPIClassicRegion 0292 * 0293 * @brief Deletes the region. 0294 * 0295 * @param id is the region identifier. 0296 * 0297 * This directive deletes the region specified by ``id``. 0298 * 0299 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0300 * 0301 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0302 * identifier specified by ``id``. 0303 * 0304 * @retval ::RTEMS_RESOURCE_IN_USE There were segments of the region still in 0305 * use. 0306 * 0307 * @par Notes 0308 * @parblock 0309 * The region cannot be deleted if any of its segments are still allocated. 0310 * 0311 * The RNCB for the deleted region is reclaimed by RTEMS. 0312 * @endparblock 0313 * 0314 * @par Constraints 0315 * @parblock 0316 * The following constraints apply to this directive: 0317 * 0318 * * The directive may be called from within device driver initialization 0319 * context. 0320 * 0321 * * The directive may be called from within task context. 0322 * 0323 * * The directive may obtain and release the object allocator mutex. This may 0324 * cause the calling task to be preempted. 0325 * 0326 * * The calling task does not have to be the task that created the object. 0327 * Any local task that knows the object identifier can delete the object. 0328 * 0329 * * Where the object class corresponding to the directive is configured to use 0330 * unlimited objects, the directive may free memory to the RTEMS Workspace. 0331 * @endparblock 0332 */ 0333 rtems_status_code rtems_region_delete( rtems_id id ); 0334 0335 /* Generated from spec:/rtems/region/if/extend */ 0336 0337 /** 0338 * @ingroup RTEMSAPIClassicRegion 0339 * 0340 * @brief Extends the region. 0341 * 0342 * @param id is the region identifier. 0343 * 0344 * @param starting_address is the starting address of the memory area to extend 0345 * the region. 0346 * 0347 * @param length is the length in bytes of the memory area to extend the 0348 * region. 0349 * 0350 * This directive adds the memory area which starts at ``starting_address`` for 0351 * ``length`` bytes to the region specified by ``id``. 0352 * 0353 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0354 * 0355 * @retval ::RTEMS_INVALID_ADDRESS The ``starting_address`` parameter was NULL. 0356 * 0357 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0358 * identifier specified by ``id``. 0359 * 0360 * @retval ::RTEMS_INVALID_ADDRESS The memory area specified by 0361 * ``starting_address`` and ``length`` was insufficient to extend the heap. 0362 * 0363 * @par Notes 0364 * There are no alignment requirements for the memory area. The memory area 0365 * must be big enough to contain some maintenance blocks. It must not overlap 0366 * parts of the current heap memory areas. Disconnected memory areas added to 0367 * the heap will lead to used blocks which cover the gaps. Extending with an 0368 * inappropriate memory area will corrupt the heap resulting in undefined 0369 * behaviour. 0370 * 0371 * @par Constraints 0372 * @parblock 0373 * The following constraints apply to this directive: 0374 * 0375 * * The directive may be called from within device driver initialization 0376 * context. 0377 * 0378 * * The directive may be called from within task context. 0379 * 0380 * * The directive may obtain and release the object allocator mutex. This may 0381 * cause the calling task to be preempted. 0382 * @endparblock 0383 */ 0384 rtems_status_code rtems_region_extend( 0385 rtems_id id, 0386 void *starting_address, 0387 uintptr_t length 0388 ); 0389 0390 /* Generated from spec:/rtems/region/if/get-segment */ 0391 0392 /** 0393 * @ingroup RTEMSAPIClassicRegion 0394 * 0395 * @brief Gets a segment from the region. 0396 * 0397 * @param id is the region identifier. 0398 * 0399 * @param size is the size in bytes of the segment to allocate. 0400 * 0401 * @param option_set is the option set. 0402 * 0403 * @param timeout is the timeout in clock ticks if the #RTEMS_WAIT option is 0404 * set. Use #RTEMS_NO_TIMEOUT to wait potentially forever. 0405 * 0406 * @param[out] segment is the pointer to a ``void`` pointer object. When the 0407 * directive call is successful, the begin address of the allocated segment 0408 * will be stored in this object. 0409 * 0410 * This directive gets a segment from the region specified by ``id``. 0411 * 0412 * The **option set** specified in ``option_set`` is built through a *bitwise 0413 * or* of the option constants described below. Not all combinations of 0414 * options are allowed. Some options are mutually exclusive. If mutually 0415 * exclusive options are combined, the behaviour is undefined. Options not 0416 * mentioned below are not evaluated by this directive and have no effect. 0417 * Default options can be selected by using the #RTEMS_DEFAULT_OPTIONS 0418 * constant. 0419 * 0420 * The calling task can **wait** or **try to get** a segment from the region 0421 * according to the mutually exclusive #RTEMS_WAIT and #RTEMS_NO_WAIT options. 0422 * 0423 * * **Waiting to get** a segment from the region is the default and can be 0424 * emphasized through the use of the #RTEMS_WAIT option. The ``timeout`` 0425 * parameter defines how long the calling task is willing to wait. Use 0426 * #RTEMS_NO_TIMEOUT to wait potentially forever, otherwise set a timeout 0427 * interval in clock ticks. 0428 * 0429 * * **Trying to get** a segment from the region is selected by the 0430 * #RTEMS_NO_WAIT option. If this option is defined, then the ``timeout`` 0431 * parameter is ignored. When a segment from the region cannot be 0432 * immediately allocated, then the ::RTEMS_UNSATISFIED status is returned. 0433 * 0434 * With either #RTEMS_WAIT or #RTEMS_NO_WAIT if there is a segment of the 0435 * requested size is available, then it is returned in ``segment`` and this 0436 * directive returns immediately with the ::RTEMS_SUCCESSFUL status code. 0437 * 0438 * If the calling task chooses to return immediately and the region has no 0439 * segment of the requested size available, then the directive returns 0440 * immediately with the ::RTEMS_UNSATISFIED status code. If the calling task 0441 * chooses to wait for a segment, then the calling task is placed on the region 0442 * wait queue and blocked. If the region was created with the #RTEMS_PRIORITY 0443 * option specified, then the calling task is inserted into the wait queue 0444 * according to its priority. But, if the region was created with the 0445 * #RTEMS_FIFO option specified, then the calling task is placed at the rear of 0446 * the wait queue. 0447 * 0448 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0449 * 0450 * @retval ::RTEMS_INVALID_ADDRESS The ``segment`` parameter was NULL. 0451 * 0452 * @retval ::RTEMS_INVALID_SIZE The ``size`` parameter was zero. 0453 * 0454 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0455 * identifier specified by ``id``. 0456 * 0457 * @retval ::RTEMS_INVALID_SIZE The ``size`` parameter exceeded the maximum 0458 * segment size which is possible for the region. 0459 * 0460 * @retval ::RTEMS_UNSATISFIED The region had no segment of the requested size 0461 * immediately available. 0462 * 0463 * @retval ::RTEMS_TIMEOUT The timeout happened while the calling task was 0464 * waiting to get a segment from the region. 0465 * 0466 * @par Notes 0467 * The actual length of the allocated segment may be larger than the requested 0468 * size because a segment size is always a multiple of the region's page size. 0469 * 0470 * @par Constraints 0471 * @parblock 0472 * The following constraints apply to this directive: 0473 * 0474 * * The directive may be called from within device driver initialization 0475 * context. 0476 * 0477 * * The directive may be called from within task context. 0478 * 0479 * * The directive may obtain and release the object allocator mutex. This may 0480 * cause the calling task to be preempted. 0481 * 0482 * * When the request cannot be immediately satisfied and the #RTEMS_WAIT 0483 * option is set, the calling task blocks at some point during the directive 0484 * call. 0485 * 0486 * * The timeout functionality of the directive requires a clock tick. 0487 * @endparblock 0488 */ 0489 rtems_status_code rtems_region_get_segment( 0490 rtems_id id, 0491 uintptr_t size, 0492 rtems_option option_set, 0493 rtems_interval timeout, 0494 void **segment 0495 ); 0496 0497 /* Generated from spec:/rtems/region/if/return-segment */ 0498 0499 /** 0500 * @ingroup RTEMSAPIClassicRegion 0501 * 0502 * @brief Returns the segment to the region. 0503 * 0504 * @param id is the region identifier. 0505 * 0506 * @param segment is the begin address of the segment to return. 0507 * 0508 * This directive returns the segment specified by ``segment`` to the region 0509 * specified by ``id``. The returned segment is merged with its neighbors to 0510 * form the largest possible segment. The first task on the wait queue is 0511 * examined to determine if its segment request can now be satisfied. If so, 0512 * it is given a segment and unblocked. This process is repeated until the 0513 * first task's segment request cannot be satisfied. 0514 * 0515 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0516 * 0517 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0518 * identifier specified by ``id``. 0519 * 0520 * @retval ::RTEMS_INVALID_ADDRESS The segment was not within the region. 0521 * 0522 * @par Notes 0523 * @parblock 0524 * This directive will cause the calling task to be preempted if one or more 0525 * local tasks are waiting for a segment and the following conditions exist: 0526 * 0527 * * A waiting task has a higher priority than the calling task. 0528 * 0529 * * The size of the segment required by the waiting task is less than or equal 0530 * to the size of the segment returned. 0531 * @endparblock 0532 * 0533 * @par Constraints 0534 * @parblock 0535 * The following constraints apply to this directive: 0536 * 0537 * * The directive may be called from within device driver initialization 0538 * context. 0539 * 0540 * * The directive may be called from within task context. 0541 * 0542 * * The directive may unblock a task. This may cause the calling task to be 0543 * preempted. 0544 * 0545 * * The directive may obtain and release the object allocator mutex. This may 0546 * cause the calling task to be preempted. 0547 * @endparblock 0548 */ 0549 rtems_status_code rtems_region_return_segment( rtems_id id, void *segment ); 0550 0551 /* Generated from spec:/rtems/region/if/resize-segment */ 0552 0553 /** 0554 * @ingroup RTEMSAPIClassicRegion 0555 * 0556 * @brief Changes the size of the segment. 0557 * 0558 * @param id is the region identifier. 0559 * 0560 * @param segment is the begin address of the segment to resize. 0561 * 0562 * @param size is the requested new size of the segment. 0563 * 0564 * @param[out] old_size is the pointer to an uintptr_t object. When the 0565 * directive call is successful, the old size of the segment will be stored 0566 * in this object. 0567 * 0568 * This directive is used to increase or decrease the size of the ``segment`` 0569 * of the region specified by ``id``. When increasing the size of a segment, 0570 * it is possible that there is no memory available contiguous to the segment. 0571 * In this case, the request is unsatisfied. 0572 * 0573 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0574 * 0575 * @retval ::RTEMS_INVALID_ADDRESS The ``old_size`` parameter was NULL. 0576 * 0577 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0578 * identifier specified by ``id``. 0579 * 0580 * @retval ::RTEMS_INVALID_ADDRESS The segment was not within the region. 0581 * 0582 * @retval ::RTEMS_UNSATISFIED The region was unable to resize the segment. 0583 * 0584 * @par Notes 0585 * If an attempt to increase the size of a segment fails, then the application 0586 * may want to allocate a new segment of the desired size, copy the contents of 0587 * the original segment to the new, larger segment and then return the original 0588 * segment. 0589 * 0590 * @par Constraints 0591 * @parblock 0592 * The following constraints apply to this directive: 0593 * 0594 * * The directive may be called from within device driver initialization 0595 * context. 0596 * 0597 * * The directive may be called from within task context. 0598 * 0599 * * The directive may obtain and release the object allocator mutex. This may 0600 * cause the calling task to be preempted. 0601 * @endparblock 0602 */ 0603 rtems_status_code rtems_region_resize_segment( 0604 rtems_id id, 0605 void *segment, 0606 uintptr_t size, 0607 uintptr_t *old_size 0608 ); 0609 0610 /* Generated from spec:/rtems/region/if/get-information */ 0611 0612 /** 0613 * @ingroup RTEMSAPIClassicRegion 0614 * 0615 * @brief Gets the region information. 0616 * 0617 * @param id is the region identifier. 0618 * 0619 * @param[out] the_info is the pointer to a Heap_Information_block object. 0620 * When the directive call is successful, the information of the region will 0621 * be stored in this object. 0622 * 0623 * This directive is used to obtain information about the used and free memory 0624 * in the region specified by ``id``. This is a snapshot at the time of the 0625 * call. The information will be returned in the structure pointed to by 0626 * ``the_info``. 0627 * 0628 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0629 * 0630 * @retval ::RTEMS_INVALID_ADDRESS The ``the_info`` parameter was NULL. 0631 * 0632 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0633 * identifier specified by ``id``. 0634 * 0635 * @par Notes 0636 * @parblock 0637 * This is primarily intended as a mechanism to obtain a diagnostic 0638 * information. This method forms am O(n) scan of the free and an O(n) scan of 0639 * the used blocks in the region to calculate the information provided. Given 0640 * that the execution time is driven by the number of used and free blocks, it 0641 * can take a non-deterministic time to execute. 0642 * 0643 * To get only the free information of the region use 0644 * rtems_region_get_free_information(). 0645 * @endparblock 0646 * 0647 * @par Constraints 0648 * @parblock 0649 * The following constraints apply to this directive: 0650 * 0651 * * The directive may be called from within device driver initialization 0652 * context. 0653 * 0654 * * The directive may be called from within task context. 0655 * 0656 * * The directive may obtain and release the object allocator mutex. This may 0657 * cause the calling task to be preempted. 0658 * @endparblock 0659 */ 0660 rtems_status_code rtems_region_get_information( 0661 rtems_id id, 0662 Heap_Information_block *the_info 0663 ); 0664 0665 /* Generated from spec:/rtems/region/if/get-free-information */ 0666 0667 /** 0668 * @ingroup RTEMSAPIClassicRegion 0669 * 0670 * @brief Gets the region free information. 0671 * 0672 * @param id is the region identifier. 0673 * 0674 * @param[out] the_info is the pointer to a Heap_Information_block object. 0675 * When the directive call is successful, the free information of the region 0676 * will be stored in this object. 0677 * 0678 * This directive is used to obtain information about the free memory in the 0679 * region specified by ``id``. This is a snapshot at the time of the call. The 0680 * information will be returned in the structure pointed to by ``the_info``. 0681 * 0682 * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. 0683 * 0684 * @retval ::RTEMS_INVALID_ADDRESS The ``the_info`` parameter was NULL. 0685 * 0686 * @retval ::RTEMS_INVALID_ID There was no region associated with the 0687 * identifier specified by ``id``. 0688 * 0689 * @par Notes 0690 * @parblock 0691 * This directive uses the same structure to return information as the 0692 * rtems_region_get_information() directive but does not fill in the used 0693 * information. 0694 * 0695 * This is primarily intended as a mechanism to obtain a diagnostic 0696 * information. This method forms am O(n) scan of the free in the region to 0697 * calculate the information provided. Given that the execution time is driven 0698 * by the number of used and free blocks, it can take a non-deterministic time 0699 * to execute. Typically, there are many used blocks and a much smaller number 0700 * of used blocks making a call to this directive less expensive than a call to 0701 * rtems_region_get_information(). 0702 * @endparblock 0703 * 0704 * @par Constraints 0705 * @parblock 0706 * The following constraints apply to this directive: 0707 * 0708 * * The directive may be called from within device driver initialization 0709 * context. 0710 * 0711 * * The directive may be called from within task context. 0712 * 0713 * * The directive may obtain and release the object allocator mutex. This may 0714 * cause the calling task to be preempted. 0715 * @endparblock 0716 */ 0717 rtems_status_code rtems_region_get_free_information( 0718 rtems_id id, 0719 Heap_Information_block *the_info 0720 ); 0721 0722 #ifdef __cplusplus 0723 } 0724 #endif 0725 0726 #endif /* _RTEMS_RTEMS_REGION_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |