Changeset bcdca5d in rtems-docs


Ignore:
Timestamp:
Nov 10, 2016, 10:34:32 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, am, master
Children:
6345b2d
Parents:
6297ad3
Message:

c-user: Document scheduler add/remove processor

Location:
c-user
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c-user/configuring_a_system.rst

    r6297ad3 rbcdca5d  
    40414041    - ``RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL``.
    40424042
     4043    It is possible to add/remove processors to/from scheduler instances at
     4044    run-time, see :ref:`rtems_scheduler_add_processor` and
     4045    :ref:`rtems_scheduler_remove_processor`.
     4046
    40434047ERRORS:
    40444048    In case one of the scheduler indices
     
    40924096        #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 8
    40934097        #define CONFIGURE_MAXIMUM_PRIORITY 255
     4098
    40944099        /* Make the scheduler algorithm available */
    40954100        #define CONFIGURE_SCHEDULER_PRIORITY_SMP
    40964101        #include <rtems/scheduler.h>
     4102
    40974103        /* Create contexts for the two scheduler instances */
    40984104        RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1);
    40994105        RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1);
     4106
    41004107        /* Define the scheduler table */
    41014108        #define CONFIGURE_SCHEDULER_CONTROLS \\
    4102                     RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
    4103                         io, \
    4104                         rtems_build_name('I', 'O', ' ', ' ') \
    4105                     ), \
    4106                     RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
    4107                         work, \
    4108                         rtems_build_name('W', 'O', 'R', 'K') \
    4109                     )
    4110          /* Define the processor to scheduler assignments */
     4109            RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
     4110                io, \
     4111                rtems_build_name('I', 'O', ' ', ' ') \
     4112            ), \
     4113            RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
     4114                work, \
     4115                rtems_build_name('W', 'O', 'R', 'K') \
     4116            )
     4117
     4118        /* Define the initial processor to scheduler assignments */
    41114119        #define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \
    4112                     RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
    4113                     RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \
    4114                     RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
    4115                     RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
    4116                     RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
    4117                     RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
    4118                     RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
    4119                     RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL)
     4120            RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
     4121            RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \
     4122            RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
     4123            RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
     4124            RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
     4125            RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
     4126            RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
     4127            RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL)
    41204128
    41214129.. COMMENT: === SMP Specific Configuration Parameters ===
  • c-user/symmetric_multiprocessing_services.rst

    r6297ad3 rbcdca5d  
    4444
    4545- rtems_scheduler_get_processor_set_ - Get processor set of a scheduler
     46
     47- rtems_scheduler_add_processor_ - Add processor to a scheduler
     48
     49- rtems_scheduler_remove_processor_ - Remove processor from a scheduler
    4650
    4751- rtems_task_get_scheduler_ - Get scheduler of a task
     
    741745
    742746     * - ``RTEMS_SUCCESSFUL``
    743        - successful operation
     747       - Successful operation.
    744748     * - ``RTEMS_INVALID_ADDRESS``
    745        - ``id`` is NULL
     749       - The ``id`` parameter is ``NULL``.
    746750     * - ``RTEMS_INVALID_NAME``
    747        - invalid scheduler name
    748      * - ``RTEMS_UNSATISFIED``
    749        - a scheduler with this name exists, but the processor set of this scheduler
    750          is empty
     751       - Invalid scheduler name.
    751752
    752753DESCRIPTION:
    753754    Identifies a scheduler by its name.  The scheduler name is determined by
    754     the scheduler configuration.  See :ref:`Configuring a System`.
     755    the scheduler configuration.  See :ref:`Configuring Clustered Schedulers`
     756    and :ref:`Configuring a Scheduler Name`.
    755757
    756758NOTES:
     
    780782
    781783     * - ``RTEMS_SUCCESSFUL``
    782        - successful operation
     784       - Successful operation.
     785     * - ``RTEMS_INVALID_ID``
     786       - Invalid scheduler instance identifier.
    783787     * - ``RTEMS_INVALID_ADDRESS``
    784        - ``cpuset`` is NULL
    785      * - ``RTEMS_INVALID_ID``
    786        - invalid scheduler id
     788       - The ``cpuset`` parameter is ``NULL``.
    787789     * - ``RTEMS_INVALID_NUMBER``
    788        - the affinity set buffer is too small for set of processors owned by
    789          the scheduler
     790       - The processor set buffer is too small for the set of processors owned
     791         by the scheduler instance.
    790792
    791793DESCRIPTION:
    792     Returns the processor set owned by the scheduler in ``cpuset``.  A set bit
    793     in the processor set means that this processor is owned by the scheduler
    794     and a cleared bit means the opposite.
     794    Returns the processor set owned by the scheduler instance in ``cpuset``.  A
     795    set bit in the processor set means that this processor is owned by the
     796    scheduler instance and a cleared bit means the opposite.
    795797
    796798NOTES:
    797799    None.
     800
     801.. raw:: latex
     802
     803   \clearpage
     804
     805.. _rtems_scheduler_add_processor:
     806
     807SCHEDULER_ADD_PROCESSOR - Add processor to a scheduler
     808------------------------------------------------------
     809
     810CALLING SEQUENCE:
     811    .. code-block:: c
     812
     813        rtems_status_code rtems_scheduler_add_processor(
     814            rtems_id scheduler_id,
     815            uint32_t cpu_index
     816        );
     817
     818DIRECTIVE STATUS CODES:
     819    .. list-table::
     820     :class: rtems-table
     821
     822     * - ``RTEMS_SUCCESSFUL``
     823       - Successful operation.
     824     * - ``RTEMS_INVALID_ID``
     825       - Invalid scheduler instance identifier.
     826     * - ``RTEMS_NOT_CONFIGURED``
     827       - The processor is not configured to be used by the application.
     828     * - ``RTEMS_INCORRECT_STATE``
     829       - The processor is configured to be used by the application, however, it
     830         is not online.
     831     * - ``RTEMS_RESOURCE_IN_USE``
     832       - The processor is already assigned to a scheduler instance.
     833
     834DESCRIPTION:
     835    Adds a processor to the set of processors owned by the specified scheduler
     836    instance.
     837
     838NOTES:
     839    Must be called from task context.  This operation obtains and releases the
     840    objects allocator lock.
     841
     842.. raw:: latex
     843
     844   \clearpage
     845
     846.. _rtems_scheduler_remove_processor:
     847
     848SCHEDULER_REMOVE_PROCESSOR - Remove processor from a scheduler
     849--------------------------------------------------------------
     850
     851CALLING SEQUENCE:
     852    .. code-block:: c
     853
     854        rtems_status_code rtems_scheduler_remove_processor(
     855            rtems_id scheduler_id,
     856            uint32_t cpu_index
     857        );
     858
     859DIRECTIVE STATUS CODES:
     860    .. list-table::
     861     :class: rtems-table
     862
     863     * - ``RTEMS_SUCCESSFUL``
     864       - Successful operation.
     865     * - ``RTEMS_INVALID_ID``
     866       - Invalid scheduler instance identifier.
     867     * - ``RTEMS_INVALID_NUMBER``
     868       - The processor is not owned by the specified scheduler instance.
     869     * - ``RTEMS_RESOURCE_IN_USE``
     870       - The set of processors owned by the specified scheduler instance would
     871         be empty after the processor removal and there exists a non-idle task
     872         that uses this scheduler instance as its home scheduler instance.
     873
     874DESCRIPTION:
     875    Removes a processor from set of processors owned by the specified scheduler
     876    instance.
     877
     878NOTES:
     879    Must be called from task context.  This operation obtains and releases the
     880    objects allocator lock.  Removing a processor from a scheduler is a complex
     881    operation that involves all tasks of the system.
    798882
    799883.. raw:: latex
Note: See TracChangeset for help on using the changeset viewer.