source: rtems/cpukit/include/rtems/rtems/dpmemimpl.h @ 21275b58

Last change on this file since 21275b58 was 21275b58, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 22, 2018 at 6:14:51 PM

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[d964f79]1/**
[562815c]2 * @file
[067a96a]3 *
[562815c]4 * @ingroup ClassicDPMEMImpl
5 *
6 * @brief Dual Ported Memory Manager Implementation
[067a96a]7 */
8
[f9293df]9/*  COPYRIGHT (c) 1989-2008.
[ac7d5ef0]10 *  On-Line Applications Research Corporation (OAR).
11 *
[98e4ebf]12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
[c499856]14 *  http://www.rtems.org/license/LICENSE.
[ac7d5ef0]15 */
16
[27b299d9]17#ifndef _RTEMS_RTEMS_DPMEM_INL
18#define _RTEMS_RTEMS_DPMEM_INL
[ac7d5ef0]19
[72a4a42]20#include <rtems/rtems/dpmemdata.h>
[a2e3f33]21#include <rtems/score/objectimpl.h>
[562815c]22
[7def219]23#ifdef __cplusplus
24extern "C" {
25#endif
26
[562815c]27/**
28 * @defgroup ClassicDPMEMImpl Dual Ported Memory Manager Implementation
29 *
30 * @ingroup ClassicDPMEM
31 *
32 * @{
33 */
34
[067a96a]35/**
[7ee5bc4c]36 *  @brief Allocates a port control block from the inactive chain
37 *  of free port control blocks.
[1a8fde6c]38 *
39 *  This routine allocates a port control block from the inactive chain
40 *  of free port control blocks.
[ac7d5ef0]41 */
[503dc058]42RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
[ac7d5ef0]43   *_Dual_ported_memory_Allocate ( void )
44{
45  return (Dual_ported_memory_Control *)
46     _Objects_Allocate( &_Dual_ported_memory_Information );
47}
48
[067a96a]49/**
[7ee5bc4c]50 *  @brief Frees a port control block to the inactive chain
51 *  of free port control blocks.
[1a8fde6c]52 *
53 *  This routine frees a port control block to the inactive chain
54 *  of free port control blocks.
[ac7d5ef0]55 */
[503dc058]56RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
[ac7d5ef0]57   Dual_ported_memory_Control *the_port
58)
59{
60  _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
61}
62
[9c3bae11]63RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get(
64  Objects_Id        id,
65  ISR_lock_Context *lock_context
[ac7d5ef0]66)
67{
68  return (Dual_ported_memory_Control *)
[582bb23c]69    _Objects_Get( id, lock_context, &_Dual_ported_memory_Information );
[ac7d5ef0]70}
71
[067a96a]72/**@}*/
73
[562815c]74#ifdef __cplusplus
75}
76#endif
77
[7def219]78#endif /* _RTEMS_RTEMS_DPMEM_INL */
[ac7d5ef0]79/* end of include file */
Note: See TracBrowser for help on using the repository browser.