Back to home page

LXR

 
 

    


Warning, /cpukit/include/adainclude/rtems-rate_monotonic.ads is written in an unsupported language. File is not indexed.

0001 -- SPDX-License-Identifier: BSD-2-Clause
0002 
0003 --
0004 --  RTEMS / Specification
0005 --
0006 --  DESCRIPTION:
0007 --
0008 --  This package provides the interface to the RTEMS API.
0009 --
0010 --  DEPENDENCIES:
0011 --
0012 --  NOTES:
0013 --    RTEMS initialization and configuration are called from
0014 --    the BSP side, therefore should never be called from ADA.
0015 --
0016 --  COPYRIGHT (c) 1997-2011.
0017 --  On-Line Applications Research Corporation (OAR).
0018 --
0019 --  Redistribution and use in source and binary forms, with or without
0020 --  modification, are permitted provided that the following conditions
0021 --  are met:
0022 --  1. Redistributions of source code must retain the above copyright
0023 --     notice, this list of conditions and the following disclaimer.
0024 --  2. Redistributions in binary form must reproduce the above copyright
0025 --     notice, this list of conditions and the following disclaimer in the
0026 --     documentation and/or other materials provided with the distribution.
0027 --
0028 --  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0029 --  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0030 --  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0031 --  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0032 --  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0033 --  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0034 --  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0035 --  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0036 --  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0037 --  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0038 --  POSSIBILITY OF SUCH DAMAGE.
0039 --
0040 
0041 package RTEMS.Rate_Monotonic is
0042 
0043    --
0044    --  The following type defines the status information returned
0045    --  about a period.
0046    --
0047 
0048    type Period_States is (
0049      Inactive,               -- off chain, never initialized
0050      Owner_Is_Blocking,      -- on chain, owner is blocking on it
0051      Active,                 -- on chain, running continuously
0052      Expired_While_Blocking, -- on chain, expired while owner was was blocking
0053      Expired                 -- off chain, will be reset by next
0054                              --   rtems_rate_monotonic_period
0055    );
0056 
0057    for Period_States'Size use 32;
0058 
0059    for Period_States use (
0060      Inactive                => 0,
0061      Owner_Is_Blocking       => 1,
0062      Active                  => 2,
0063      Expired_While_Blocking  => 3,
0064      Expired                 => 4
0065    );
0066 
0067    type Period_Status is
0068       record
0069          Owner                            : RTEMS.ID;
0070          State                            : RTEMS.Rate_Monotonic.Period_States;
0071          Ticks_Since_Last_Period          : RTEMS.Unsigned32;
0072          Ticks_Executed_Since_Last_Period : RTEMS.Unsigned32;
0073       end record;
0074 
0075    --
0076    --  Rate Monotonic Manager
0077    --
0078 
0079    procedure Create (
0080       Name   : in     RTEMS.Name;
0081       ID     :    out RTEMS.ID;
0082       Result :    out RTEMS.Status_Codes
0083    );
0084 
0085    procedure Ident (
0086       Name   : in     RTEMS.Name;
0087       ID     :    out RTEMS.ID;
0088       Result :    out RTEMS.Status_Codes
0089    );
0090 
0091    procedure Delete (
0092       ID     : in     RTEMS.ID;
0093       Result :    out RTEMS.Status_Codes
0094    );
0095 
0096    procedure Cancel (
0097       ID     : in     RTEMS.ID;
0098       Result :    out RTEMS.Status_Codes
0099    );
0100 
0101    procedure Period (
0102       ID      : in     RTEMS.ID;
0103       Length  : in     RTEMS.Interval;
0104       Result  :    out RTEMS.Status_Codes
0105    );
0106 
0107    procedure Get_Status (
0108       ID      : in     RTEMS.ID;
0109       Status  :    out RTEMS.Rate_Monotonic.Period_Status;
0110       Result  :    out RTEMS.Status_Codes
0111    );
0112 
0113    procedure Reset_Statistics (
0114       ID     : in     RTEMS.ID;
0115       Result :    out RTEMS.Status_Codes
0116    );
0117 
0118    procedure Reset_All_Statistics;
0119    pragma Import (
0120       C,
0121       Reset_All_Statistics,
0122       "rtems_rate_monotonic_reset_all_statistics"
0123    );
0124 
0125    procedure Report_Statistics;
0126    pragma Import (
0127       C,
0128       Report_Statistics,
0129       "rtems_rate_monotonic_report_statistics"
0130    );
0131 
0132 end RTEMS.Rate_Monotonic;
0133