Changeset 154fb0f9 in rtems-docs
- Timestamp:
- 03/08/18 07:04:25 (5 years ago)
- Branches:
- 5, am, master
- Children:
- 36d7463
- Parents:
- 0472ead
- git-author:
- Sebastian Huber <sebastian.huber@…> (03/08/18 07:04:25)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (03/12/18 06:14:36)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c-user/configuring_a_system.rst
r0472ead r154fb0f9 3615 3615 following additional macros must be defined: 3616 3616 3617 - ``CONFIGURE_SCHEDULER _CONTEXT`` must be defined to a static definition of3618 the scheduler contextof the user scheduler.3619 3620 - ``CONFIGURE_SCHEDULER_ CONTROLS`` must be defined to a scheduler control3621 initializer for the user scheduler.3617 - ``CONFIGURE_SCHEDULER`` must be defined to a static definition of 3618 the scheduler data structures of the user scheduler. 3619 3620 - ``CONFIGURE_SCHEDULER_TABLE_ENTRIES`` must be defined to a scheduler 3621 table entry initializer for the user scheduler. 3622 3622 3623 3623 - ``CONFIGURE_SCHEDULER_USER_PER_THREAD`` must be defined to the type of … … 3638 3638 3639 3639 Clustered scheduling helps to control the worst-case latencies in a 3640 multi -processor system (SMP). The goal is to reduce the amount of shared state3641 in the system and thus prevention of lock contention. Modern multi -processor3640 multiprocessor system (SMP). The goal is to reduce the amount of shared state 3641 in the system and thus prevention of lock contention. Modern multiprocessor 3642 3642 systems tend to have several layers of data and instruction caches. With 3643 3643 clustered scheduling it is possible to honour the cache topology of a system … … 3647 3647 partitioned into non-empty pairwise-disjoint subsets. These subsets are called 3648 3648 clusters. Clusters with a cardinality of one are partitions. Each cluster is 3649 owned by exactly one scheduler instance.3649 owned by exactly one scheduler. 3650 3650 3651 3651 A clustered scheduler configuration is optional. By default, up to 32 … … 3675 3675 3676 3676 This is necessary to calculate the per-thread overhead introduced by the 3677 schedulers. After these definitions the configuration file must ``#include 3678 <rtems/scheduler.h>`` to have access to scheduler-specific configuration 3679 macros. 3677 scheduler algorithms. After these definitions the configuration file must 3678 ``#include <rtems/scheduler.h>`` to have access to scheduler-specific 3679 configuration macros. 3680 3681 It is possible to make more than one scheduler algorithm available to the 3682 application. For example a :ref:`Simple Priority SMP Scheduler 3683 <SchedulerSMPPrioritySimple>` could be used in a partition for low latency 3684 tasks in addition to the :ref:`EDF SMP Scheduler <SchedulerSMPEDF>` for a 3685 general-purpose cluster. Since the per-thread overhead depends on the 3686 scheduler algorithm only the scheduler algorithms used by the application 3687 should be configured. 3680 3688 3681 3689 Configuration Step 2 - Schedulers 3682 3690 --------------------------------- 3683 3691 3684 Each scheduler needs a context to store state information at run-time. Use the 3685 following macros to create scheduler contexts 3686 3687 - ``RTEMS_SCHEDULER_CONTEXT_EDF_SMP(name, max_cpu_count)``, 3688 3689 - ``RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP(name, prio_count)``, 3690 3691 - ``RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(name, prio_count)``, and 3692 3693 - ``RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(name)``. 3694 3695 The ``name`` parameter is used as part of a designator for a global variable, 3696 so the usual C/C++ designator rules apply. This ``name`` is not the scheduler 3697 object name. Additional parameters are scheduler-specific. 3692 Each scheduler needs some data structures. Use the following macros to create 3693 the scheduler data structures for a particular scheduler identified in the 3694 configuration by ``name``. 3695 3696 - ``RTEMS_SCHEDULER_EDF_SMP(name, max_cpu_count)``, 3697 3698 - ``RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP(name, prio_count)``, 3699 3700 - ``RTEMS_SCHEDULER_PRIORITY_SMP(name, prio_count)``, and 3701 3702 - ``RTEMS_SCHEDULER_SIMPLE_SMP(name)``. 3703 3704 The ``name`` parameter is used as part of a designator for scheduler-specific 3705 data structures, so the usual C/C++ designator rules apply. This ``name`` is 3706 not the scheduler object name. Additional parameters are scheduler-specific. 3698 3707 3699 3708 .. _ConfigurationSchedulerTable: … … 3702 3711 -------------------------------------- 3703 3712 3704 The schedulers are registered in the system via the scheduler table. 3705 To create the scheduler table define ``CONFIGURE_SCHEDULER_CONTROLS`` to a list 3706 of the following scheduler controlinitializers3707 3708 - ``RTEMS_SCHEDULER_ CONTROL_EDF_SMP(name, obj_name)``,3709 3710 - ``RTEMS_SCHEDULER_ CONTROL_PRIORITY_AFFINITY_SMP(name, obj_name)``,3711 3712 - ``RTEMS_SCHEDULER_ CONTROL_PRIORITY_SMP(name, obj_name)``, and3713 3714 - ``RTEMS_SCHEDULER_ CONTROL_SIMPLE_SMP(name, obj_name)``.3713 The schedulers are registered in the system via the scheduler table. To 3714 populate the scheduler table define ``CONFIGURE_SCHEDULER_TABLE_ENTRIES`` to a 3715 list of the following scheduler table entry initializers 3716 3717 - ``RTEMS_SCHEDULER_TABLE_EDF_SMP(name, obj_name)``, 3718 3719 - ``RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP(name, obj_name)``, 3720 3721 - ``RTEMS_SCHEDULER_TABLE_PRIORITY_SMP(name, obj_name)``, and 3722 3723 - ``RTEMS_SCHEDULER_TABLE_SIMPLE_SMP(name, obj_name)``. 3715 3724 3716 3725 The ``name`` parameter must correspond to the parameter defining the scheduler 3717 context. The ``obj_name`` determines the scheduler object name and can be used 3718 in :ref:`rtems_scheduler_ident() <rtems_scheduler_ident>` to get the scheduler 3719 object identifier. The scheduler index is defined by the index of the 3720 scheduler table. It is a configuration error to add a scheduler multiple times 3721 to the scheduler table.3726 data structures of configuration step 2. The ``obj_name`` determines the 3727 scheduler object name and can be used in :ref:`rtems_scheduler_ident() 3728 <rtems_scheduler_ident>` to get the scheduler object identifier. The scheduler 3729 index is defined by the index of the scheduler table. It is a configuration 3730 error to add a scheduler multiple times to the scheduler table. 3722 3731 3723 3732 Configuration Step 4 - Processor to Scheduler Assignment … … 3732 3741 mandatory processors than available then a fatal run-time error will occur. To 3733 3742 specify the scheduler assignments define 3734 ``CONFIGURE_S MP_SCHEDULER_ASSIGNMENTS`` to a list of3743 ``CONFIGURE_SCHEDULER_ASSIGNMENTS`` to a list of 3735 3744 3736 3745 - ``RTEMS_SCHEDULER_ASSIGN(scheduler_index, attr)`` and … … 3738 3747 - ``RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER`` 3739 3748 3740 macros. The ``scheduler_index`` parameter must 3741 be a valid index into the scheduler table. The ``attr`` parameter defines the 3742 scheduler assignment attributes. By default, a scheduler assignment to a 3743 processor is optional. For the scheduler assignment attribute use one of the3744 mutually exclusive variants3749 macros. The ``scheduler_index`` parameter must be a valid index into the 3750 scheduler table defined by configuration step 3. The ``attr`` parameter 3751 defines the scheduler assignment attributes. By default, a scheduler 3752 assignment to a processor is optional. For the scheduler assignment attribute 3753 use one of the mutually exclusive variants 3745 3754 3746 3755 - ``RTEMS_SCHEDULER_ASSIGN_DEFAULT``, … … 3787 3796 3788 3797 /* Configuration Step 2 - Schedulers */ 3789 RTEMS_SCHEDULER_ CONTEXT_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1);3790 RTEMS_SCHEDULER_ CONTEXT_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1);3798 RTEMS_SCHEDULER_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1); 3799 RTEMS_SCHEDULER_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1); 3791 3800 3792 3801 /* Configuration Step 3 - Scheduler Table */ 3793 #define CONFIGURE_SCHEDULER_ CONTROLS \\3794 RTEMS_SCHEDULER_ CONTROL_PRIORITY_SMP( \3802 #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \\ 3803 RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( \ 3795 3804 io, \ 3796 3805 rtems_build_name('I', 'O', ' ', ' ') \ 3797 3806 ), \ 3798 RTEMS_SCHEDULER_ CONTROL_PRIORITY_SMP( \3807 RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( \ 3799 3808 work, \ 3800 3809 rtems_build_name('W', 'O', 'R', 'K') \ … … 3802 3811 3803 3812 /* Configuration Step 4 - Processor to Scheduler Assignment */ 3804 #define CONFIGURE_S MP_SCHEDULER_ASSIGNMENTS \3813 #define CONFIGURE_SCHEDULER_ASSIGNMENTS \ 3805 3814 RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \ 3806 3815 RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \ … … 3815 3824 -------------------- 3816 3825 3817 In case one of the scheduler indices in ``CONFIGURE_S MP_SCHEDULER_ASSIGNMENTS``3826 In case one of the scheduler indices in ``CONFIGURE_SCHEDULER_ASSIGNMENTS`` 3818 3827 is invalid a link-time error will occur with an undefined reference to 3819 3828 ``RTEMS_SCHEDULER_INVALID_INDEX``. … … 3833 3842 processor failed during system initialization. The system may not have this 3834 3843 processor at all or it could be a problem with a boot loader for example. 3835 Check the ``CONFIGURE_S MP_SCHEDULER_ASSIGNMENTS`` definition.3844 Check the ``CONFIGURE_SCHEDULER_ASSIGNMENTS`` definition. 3836 3845 3837 3846 - ``SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR`` - it is not allowed
Note: See TracChangeset
for help on using the changeset viewer.