From 5c4bfd277b4b83e9313d4b82f3acd733a130290f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 16 Nov 2021 11:34:14 +0100 Subject: spec: Improve acfg specification Rework BSP provided configuration settings. --- config.yml | 3 +- spec/acfg/if/appl-prerequisite-drivers.yml | 2 +- spec/acfg/if/bsp-idle-task-body.yml | 31 -------- spec/acfg/if/bsp-idle-task-stack-size.yml | 32 -------- spec/acfg/if/bsp-initial-extension.yml | 30 -------- spec/acfg/if/bsp-interrupt-stack-size.yml | 34 --------- spec/acfg/if/bsp-prerequisite-drivers.yml | 33 --------- spec/acfg/if/disable-bsp-settings.yml | 25 ++++--- spec/acfg/if/domain.yml | 13 ++++ spec/acfg/if/group-bsp.yml | 19 ----- spec/acfg/if/group.yml | 16 ++++ spec/acfg/if/header.yml | 16 ++++ spec/acfg/if/idle-task-body.yml | 13 +++- spec/acfg/if/idle-task-stack-size.yml | 8 +- spec/acfg/if/init.yml | 12 +++ spec/acfg/if/initial-extensions.yml | 4 +- spec/acfg/if/interrupt-stack-size.yml | 7 +- spec/acfg/if/malloc-bsp-supports-sbrk.yml | 30 -------- spec/acfg/if/max-drivers.yml | 5 +- spec/acfg/req/bsp-idle-task-body.yml | 15 ---- spec/acfg/req/bsp-idle-task-stack-size.yml | 15 ---- spec/acfg/req/bsp-initial-extension.yml | 12 ++- spec/acfg/req/bsp-interrupt-stack-size.yml | 15 ---- spec/acfg/req/bsp-prerequisite-drivers.yml | 14 ++-- spec/acfg/req/init.yml | 17 +++++ spec/acfg/req/malloc-bsp-supports-sbrk.yml | 13 ++-- spec/acfg/val/acfg.yml | 89 +++++++++++++++++++---- spec/acfg/val/bsp-prerequisite-drivers.yml | 17 +++++ spec/acfg/val/default.yml | 69 +++++++++++++++++- spec/acfg/val/disabled-bsp-settings.yml | 82 +++++++++++++++++++++ spec/acfg/val/malloc-bsp-supports-sbrk.yml | 17 +++++ spec/acfg/val/one-cpu.yml | 55 ++++++++++++++ spec/bsp/if/acfg-idle-task-body.yml | 14 ++++ spec/bsp/if/acfg-idle-task-stack-size.yml | 14 ++++ spec/bsp/if/acfg-initial-extension.yml | 14 ++++ spec/bsp/if/acfg-interrupt-stack-size.yml | 14 ++++ spec/bsp/if/acfg-malloc-supports-sbrk.yml | 14 ++++ spec/bsp/if/acfg-prerequisite-drivers.yml | 14 ++++ spec/bsp/if/bsp-header.yml | 16 ++++ spec/rtems/fatal/req/fatal.yml | 18 +++++ spec/rtems/scheduler/req/get-maximum-priority.yml | 2 +- spec/rtems/task/req/ident.yml | 3 +- spec/score/val/fatal.yml | 33 +++++++-- spec/testsuites/terminate.yml | 2 + spec/testsuites/validation-0.yml | 2 + spec/testsuites/validation-acfg-0.yml | 64 +++------------- spec/testsuites/validation-acfg-1.yml | 60 +++++++++++++++ spec/testsuites/validation-one-cpu-0.yml | 4 + spec/testsuites/validation-smp-only-0.yml | 2 + 49 files changed, 687 insertions(+), 366 deletions(-) delete mode 100644 spec/acfg/if/bsp-idle-task-body.yml delete mode 100644 spec/acfg/if/bsp-idle-task-stack-size.yml delete mode 100644 spec/acfg/if/bsp-initial-extension.yml delete mode 100644 spec/acfg/if/bsp-interrupt-stack-size.yml delete mode 100644 spec/acfg/if/bsp-prerequisite-drivers.yml create mode 100644 spec/acfg/if/domain.yml delete mode 100644 spec/acfg/if/group-bsp.yml create mode 100644 spec/acfg/if/group.yml create mode 100644 spec/acfg/if/header.yml create mode 100644 spec/acfg/if/init.yml delete mode 100644 spec/acfg/if/malloc-bsp-supports-sbrk.yml delete mode 100644 spec/acfg/req/bsp-idle-task-body.yml delete mode 100644 spec/acfg/req/bsp-idle-task-stack-size.yml delete mode 100644 spec/acfg/req/bsp-interrupt-stack-size.yml create mode 100644 spec/acfg/req/init.yml create mode 100644 spec/acfg/val/bsp-prerequisite-drivers.yml create mode 100644 spec/acfg/val/disabled-bsp-settings.yml create mode 100644 spec/acfg/val/malloc-bsp-supports-sbrk.yml create mode 100644 spec/acfg/val/one-cpu.yml create mode 100644 spec/bsp/if/acfg-idle-task-body.yml create mode 100644 spec/bsp/if/acfg-idle-task-stack-size.yml create mode 100644 spec/bsp/if/acfg-initial-extension.yml create mode 100644 spec/bsp/if/acfg-interrupt-stack-size.yml create mode 100644 spec/bsp/if/acfg-malloc-supports-sbrk.yml create mode 100644 spec/bsp/if/acfg-prerequisite-drivers.yml create mode 100644 spec/bsp/if/bsp-header.yml create mode 100644 spec/rtems/fatal/req/fatal.yml create mode 100644 spec/testsuites/validation-acfg-1.yml diff --git a/config.yml b/config.yml index cd8d59db..b29cbb6d 100644 --- a/config.yml +++ b/config.yml @@ -42,6 +42,7 @@ build: - testsuites/validation/tc-userext.h - testsuites/validation/tr-chains-api-model.h - testsuites/validation/tr-event-mgr-model.h + - testsuites/validation/ts-acfg.h - testsuites/validation/ts-config.h - testsuites/validation/ts-default.h - testsuites/validation/ts-fatal-sysinit.h @@ -81,8 +82,6 @@ appl-config: groups: - uid: /acfg/if/group-bdbuf target: modules/rtems-docs/c-user/config/bdbuf.rst - - uid: /acfg/if/group-bsp - target: modules/rtems-docs/c-user/config/bsp-related.rst - uid: /acfg/if/group-classic target: modules/rtems-docs/c-user/config/classic-api.rst - uid: /acfg/if/group-classicinit diff --git a/spec/acfg/if/appl-prerequisite-drivers.yml b/spec/acfg/if/appl-prerequisite-drivers.yml index 4e5265bf..4d3d34e8 100644 --- a/spec/acfg/if/appl-prerequisite-drivers.yml +++ b/spec/acfg/if/appl-prerequisite-drivers.yml @@ -22,7 +22,7 @@ links: name: CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS notes: | The value of this configuration option is placed after the entries defined by - ${bsp-prerequisite-drivers:/name} and before all other device driver + ${/bsp/if/acfg-prerequisite-drivers:/name} and before all other device driver configuration options. See ${appl-extra-drivers:/name} for an alternative placement diff --git a/spec/acfg/if/bsp-idle-task-body.yml b/spec/acfg/if/bsp-idle-task-body.yml deleted file mode 100644 index 0bf1a244..00000000 --- a/spec/acfg/if/bsp-idle-task-body.yml +++ /dev/null @@ -1,31 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -appl-config-option-type: initializer -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -default-value: | - The default value is BSP-specific. -description: | - If - - * this configuration option is defined by the BSP - - * and ${disable-bsp-settings:/name} is undefined, - - then the value of this configuration option defines the default value of - ${idle-task-body:/name}. -enabled-by: true -index-entries: [] -interface-type: appl-config-option -links: -- role: requirement-refinement - uid: ../req/bsp-idle-task-body -- role: appl-config-group-member - uid: group-bsp -- role: constraint - uid: ../constraint/init-idle-task-body -name: BSP_IDLE_TASK_BODY -notes: | - As it has knowledge of the specific CPU model, system controller logic, and - peripheral buses, a BSP-specific IDLE task may be capable of turning - components off to save power during extended periods of no task activity. -type: interface diff --git a/spec/acfg/if/bsp-idle-task-stack-size.yml b/spec/acfg/if/bsp-idle-task-stack-size.yml deleted file mode 100644 index 3565f5ac..00000000 --- a/spec/acfg/if/bsp-idle-task-stack-size.yml +++ /dev/null @@ -1,32 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -appl-config-option-type: integer -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -default-value: | - The default value is BSP-specific. -description: | - If - - * this configuration option is defined by the BSP - - * and ${disable-bsp-settings:/name} is undefined, - - then the value of this configuration option defines the default value of - ${idle-task-stack-size:/name}. -enabled-by: true -index-entries: [] -interface-type: appl-config-option -links: -- role: requirement-refinement - uid: ../req/bsp-idle-task-stack-size -- role: appl-config-group-member - uid: group-bsp -- role: constraint - uid: ../constraint/option-not-pre-qualified -- role: constraint - uid: ../constraint/min-bsp-app -- role: constraint - uid: ../constraint/valid-idle-stack-area -name: BSP_IDLE_TASK_STACK_SIZE -notes: null -type: interface diff --git a/spec/acfg/if/bsp-initial-extension.yml b/spec/acfg/if/bsp-initial-extension.yml deleted file mode 100644 index 8204c2da..00000000 --- a/spec/acfg/if/bsp-initial-extension.yml +++ /dev/null @@ -1,30 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -appl-config-option-type: initializer -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -default-value: | - The default value is BSP-specific. -description: | - If - - * this configuration option is defined by the BSP - - * and ${disable-bsp-settings:/name} is undefined, - - then the value of this configuration option is used to initialize the table - of initial user extensions. -enabled-by: true -index-entries: [] -interface-type: appl-config-option -links: -- role: requirement-refinement - uid: ../req/bsp-initial-extension -- role: appl-config-group-member - uid: group-bsp -- role: constraint - uid: ../constraint/init-userext-table -name: BSP_INITIAL_EXTENSION -notes: | - The value of this configuration option is placed after the entries of all - other initial user extensions. -type: interface diff --git a/spec/acfg/if/bsp-interrupt-stack-size.yml b/spec/acfg/if/bsp-interrupt-stack-size.yml deleted file mode 100644 index 53c8e812..00000000 --- a/spec/acfg/if/bsp-interrupt-stack-size.yml +++ /dev/null @@ -1,34 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -appl-config-option-type: integer -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -default-value: | - The default value is BSP-specific. -description: | - If - - * this configuration option is defined by the BSP - - * and ${disable-bsp-settings:/name} is undefined, - - then the value of this configuration option defines the default value of - ${interrupt-stack-size:/name}. -enabled-by: true -index-entries: [] -interface-type: appl-config-option -links: -- role: requirement-refinement - uid: ../req/bsp-interrupt-stack-size -- role: appl-config-group-member - uid: group-bsp -- role: constraint - uid: ../constraint/option-not-pre-qualified -- role: constraint - uid: ../constraint/min-bsp-app -- role: constraint - uid: ../constraint/valid-isr-stack-area -- role: constraint - uid: ../constraint/valid-isr-stack-alignment -name: BSP_INTERRUPT_STACK_SIZE -notes: null -type: interface diff --git a/spec/acfg/if/bsp-prerequisite-drivers.yml b/spec/acfg/if/bsp-prerequisite-drivers.yml deleted file mode 100644 index 3b38e63e..00000000 --- a/spec/acfg/if/bsp-prerequisite-drivers.yml +++ /dev/null @@ -1,33 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -appl-config-option-type: initializer -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -default-value: | - The default value is BSP-specific. -description: | - If - - * this configuration option is defined by the BSP - - * and ${disable-bsp-settings:/name} is undefined, - - then the value of this configuration option is used to add BSP-provided - prerequisite drivers to the Device Driver Table. -enabled-by: true -index-entries: [] -interface-type: appl-config-option -links: -- role: requirement-refinement - uid: ../req/bsp-prerequisite-drivers -- role: appl-config-group-member - uid: group-bsp -- role: constraint - uid: ../constraint/option-not-pre-qualified -- role: constraint - uid: ../constraint/init-userext-table -name: CONFIGURE_BSP_PREREQUISITE_DRIVERS -notes: | - The value of this configuration option is placed before the entries of all - other initial user extensions (including - ${appl-prerequisite-drivers:/name}). -type: interface diff --git a/spec/acfg/if/disable-bsp-settings.yml b/spec/acfg/if/disable-bsp-settings.yml index fcfd262d..8e048ee5 100644 --- a/spec/acfg/if/disable-bsp-settings.yml +++ b/spec/acfg/if/disable-bsp-settings.yml @@ -1,22 +1,29 @@ SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause appl-config-option-type: feature-enable copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) - Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) description: | - In case this configuration option is defined, then the following BSP related - configuration options are undefined: + In case this configuration option is defined, then the optional BSP provided + settings listed below are disabled. - * ${bsp-idle-task-body:/name} + The optional BSP provided default values for the following application + configuration options are disabled: - * ${bsp-idle-task-stack-size:/name} + * ${idle-task-body:/name} - * ${bsp-initial-extension:/name} + * ${idle-task-stack-size:/name} - * ${bsp-interrupt-stack-size:/name} + * ${interrupt-stack-size:/name} - * ${bsp-prerequisite-drivers:/name} + The optional BSP provided initial extension set is disabled (see + ${/glossary/initial-extension-sets:/term}). The optional BSP provided + prerequisite IO device drivers are disabled (see + ${/acfg/if/group-devdrv:/name}). The optional BSP provided support for + ${/c/if/sbrk:/name} is disabled. - * ${malloc-bsp-supports-sbrk:/name} + This configuration option provides an all or nothing choice with respect to + the optional BSP provided settings. enabled-by: true index-entries: [] interface-type: appl-config-option @@ -24,7 +31,7 @@ links: - role: requirement-refinement uid: ../req/disable-bsp-settings - role: appl-config-group-member - uid: group-bsp + uid: group-general name: CONFIGURE_DISABLE_BSP_SETTINGS notes: null type: interface diff --git a/spec/acfg/if/domain.yml b/spec/acfg/if/domain.yml new file mode 100644 index 00000000..b2d82ec3 --- /dev/null +++ b/spec/acfg/if/domain.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +description: | + This interface domain contains the application configuration. +enabled-by: true +index-entries: [] +interface-type: domain +links: +- role: requirement-refinement + uid: /req/domains +name: Application Configuration +type: interface diff --git a/spec/acfg/if/group-bsp.yml b/spec/acfg/if/group-bsp.yml deleted file mode 100644 index 8a896045..00000000 --- a/spec/acfg/if/group-bsp.yml +++ /dev/null @@ -1,19 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -description: | - This section describes configuration options related to the BSP. Some - configuration options may have a BSP-specific setting which is defined by - ````. The BSP-specific settings can be disabled by the - ${disable-bsp-settings:/name} configuration option. -enabled-by: true -index-entries: [] -interface-type: appl-config-group -links: -- role: interface-placement - uid: ../../if/domain -- role: requirement-refinement - uid: ../../req/applconfig -name: BSP Related Configuration Options -text: '' -type: interface diff --git a/spec/acfg/if/group.yml b/spec/acfg/if/group.yml new file mode 100644 index 00000000..bd559e4f --- /dev/null +++ b/spec/acfg/if/group.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +identifier: RTEMSApplConfig +links: +- role: interface-ingroup + uid: /if/group +non-functional-type: design-group +rationale: null +references: [] +requirement-type: non-functional +text: | + The ${/glossary/api:/term} shall contain the application configuration + interface. +type: requirement diff --git a/spec/acfg/if/header.yml b/spec/acfg/if/header.yml new file mode 100644 index 00000000..ba1932df --- /dev/null +++ b/spec/acfg/if/header.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This header file initializes the application configuration. +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: header-file +links: +- role: interface-placement + uid: domain +- role: interface-ingroup + uid: group +path: rtems/confdefs.h +prefix: cpukit/include +type: interface diff --git a/spec/acfg/if/idle-task-body.yml b/spec/acfg/if/idle-task-body.yml index ccc901ff..9a92a1be 100644 --- a/spec/acfg/if/idle-task-body.yml +++ b/spec/acfg/if/idle-task-body.yml @@ -1,10 +1,14 @@ SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause appl-config-option-type: initializer copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) - Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) default-value: | - If ${bsp-idle-task-body:/name} is defined, then this will be the default value, - otherwise the default value is ``_CPU_Thread_Idle_body``. + If the ${disable-bsp-settings:/name} configuration option is not defined and + ${/bsp/if/acfg-idle-task-body:/name} is provided by the + ${/glossary/bsp:/term}, then the default value is defined by + ${/bsp/if/acfg-idle-task-body:/name}, otherwise the default value is + ``_CPU_Thread_Idle_body``. description: | The value of this configuration option initializes the IDLE thread body. enabled-by: true @@ -25,4 +29,9 @@ notes: | IDLE threads can be used to initialize the application, see configuration option ${idle-task-init-appl:/name}. + + The BSP may have knowledge of the specific CPU model, system controller + logic, and peripheral buses, so a BSP-specific IDLE task may be capable of + turning components off to save power during extended periods of no task + activity. type: interface diff --git a/spec/acfg/if/idle-task-stack-size.yml b/spec/acfg/if/idle-task-stack-size.yml index d0ea2391..372501fe 100644 --- a/spec/acfg/if/idle-task-stack-size.yml +++ b/spec/acfg/if/idle-task-stack-size.yml @@ -1,8 +1,14 @@ SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause appl-config-option-type: integer copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) - Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -default-value: ${min-task-stack-size:/name} +default-value: | + If the ${disable-bsp-settings:/name} configuration option is not defined and + ${/bsp/if/acfg-idle-task-stack-size:/name} is provided by the + ${/glossary/bsp:/term}, then the default value is defined by + ${/bsp/if/acfg-idle-task-stack-size:/name}, otherwise the default value is + defined by the ${min-task-stack-size:/name} configuration option. description: | The value of this configuration option defines the task stack size for an IDLE task. diff --git a/spec/acfg/if/init.yml b/spec/acfg/if/init.yml new file mode 100644 index 00000000..d21b28ad --- /dev/null +++ b/spec/acfg/if/init.yml @@ -0,0 +1,12 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-ingroup + uid: group +name: CONFIGURE_INIT +references: [] +type: interface diff --git a/spec/acfg/if/initial-extensions.yml b/spec/acfg/if/initial-extensions.yml index 7567b491..35c642d9 100644 --- a/spec/acfg/if/initial-extensions.yml +++ b/spec/acfg/if/initial-extensions.yml @@ -20,6 +20,6 @@ links: name: CONFIGURE_INITIAL_EXTENSIONS notes: | The value of this configuration option is placed before the entries of - ${bsp-initial-extension:/name} and after the entries of all other initial - user extensions. + ${/bsp/if/acfg-initial-extension:/name} and after the entries of all other + initial user extensions. type: interface diff --git a/spec/acfg/if/interrupt-stack-size.yml b/spec/acfg/if/interrupt-stack-size.yml index 9c91256b..accf9c0a 100644 --- a/spec/acfg/if/interrupt-stack-size.yml +++ b/spec/acfg/if/interrupt-stack-size.yml @@ -3,8 +3,11 @@ appl-config-option-type: integer copyrights: - Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) default-value: | - The default value is ${bsp-interrupt-stack-size:/name} in case it is defined, - otherwise the default value is ${/score/cpu/if/stack-minimum-size:/name}. + If the ${disable-bsp-settings:/name} configuration option is not defined and + ${/bsp/if/acfg-interrupt-stack-size:/name} is provided by the + ${/glossary/bsp:/term}, then the default value is defined by + ${/bsp/if/acfg-interrupt-stack-size:/name}, otherwise the default value is + ${/score/cpu/if/stack-minimum-size:/name}. description: | The value of this configuration option defines the size of an interrupt stack in bytes. diff --git a/spec/acfg/if/malloc-bsp-supports-sbrk.yml b/spec/acfg/if/malloc-bsp-supports-sbrk.yml deleted file mode 100644 index 8fe884b1..00000000 --- a/spec/acfg/if/malloc-bsp-supports-sbrk.yml +++ /dev/null @@ -1,30 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -appl-config-option-type: feature-enable -copyrights: -- Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) -description: | - If - - * this configuration option is defined by the BSP - - * and ${disable-bsp-settings:/name} is undefined, - - then not all memory is made available to the C Program Heap immediately at - system initialization time. When ${/c/if/malloc:/name} or other standard - memory allocation functions are unable to allocate memory, they will call the - BSP supplied ${/c/if/sbrk:/name} function to obtain more memory. -enabled-by: true -index-entries: [] -interface-type: appl-config-option -links: -- role: requirement-refinement - uid: ../req/malloc-bsp-supports-sbrk -- role: appl-config-group-member - uid: group-bsp -- role: constraint - uid: ../constraint/option-not-pre-qualified -name: CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK -notes: | - This option should not be defined by the application. Only the BSP knows how - it allocates memory to the C Program Heap. -type: interface diff --git a/spec/acfg/if/max-drivers.yml b/spec/acfg/if/max-drivers.yml index a5695521..7f0e6362 100644 --- a/spec/acfg/if/max-drivers.yml +++ b/spec/acfg/if/max-drivers.yml @@ -39,7 +39,10 @@ default-value: | * ${appl-prerequisite-drivers:/name} - * ${bsp-prerequisite-drivers:/name} + If the ${disable-bsp-settings:/name} configuration option is not defined and + the ${/glossary/bsp:/term:/name} provides + ${/bsp/if/acfg-prerequisite-drivers:/name}, then the BSP-provided + prerequisite device drivers are also taken into account. description: | The value of this configuration option defines the number of device drivers. enabled-by: true diff --git a/spec/acfg/req/bsp-idle-task-body.yml b/spec/acfg/req/bsp-idle-task-body.yml deleted file mode 100644 index a85438f9..00000000 --- a/spec/acfg/req/bsp-idle-task-body.yml +++ /dev/null @@ -1,15 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -copyrights: -- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) -enabled-by: true -links: -- role: requirement-refinement - uid: /req/applconfig -non-functional-type: interface-requirement -rationale: null -references: [] -requirement-type: non-functional -text: | - The ${/glossary/bsp:/term} may define the default value for - ${../if/idle-task-body:/name}. -type: requirement diff --git a/spec/acfg/req/bsp-idle-task-stack-size.yml b/spec/acfg/req/bsp-idle-task-stack-size.yml deleted file mode 100644 index ae08091e..00000000 --- a/spec/acfg/req/bsp-idle-task-stack-size.yml +++ /dev/null @@ -1,15 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -copyrights: -- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) -enabled-by: true -links: -- role: requirement-refinement - uid: /req/applconfig -non-functional-type: interface-requirement -rationale: null -references: [] -requirement-type: non-functional -text: | - The ${/glossary/bsp:/term} may define the default value for - ${../if/idle-task-stack-size:/name}. -type: requirement diff --git a/spec/acfg/req/bsp-initial-extension.yml b/spec/acfg/req/bsp-initial-extension.yml index 1456590c..973410db 100644 --- a/spec/acfg/req/bsp-initial-extension.yml +++ b/spec/acfg/req/bsp-initial-extension.yml @@ -4,11 +4,15 @@ copyrights: enabled-by: true links: - role: requirement-refinement - uid: /req/applconfig -non-functional-type: interface-requirement + uid: init +functional-type: function rationale: null references: [] -requirement-type: non-functional +requirement-type: functional text: | - The ${/glossary/bsp:/term} may define initial user extensions. + Where ${../if/disable-bsp-settings:/name} is not defined by the application, + where ${/bsp/if/acfg-initial-extension:/name} is defined by the + ${/glossary/bsp:/term}, when the application configuration is initialized, + the extension set defined by ${/bsp/if/acfg-initial-extension:/name} shall be + registered in the ${/glossary/initial-extension-sets:/term}. type: requirement diff --git a/spec/acfg/req/bsp-interrupt-stack-size.yml b/spec/acfg/req/bsp-interrupt-stack-size.yml deleted file mode 100644 index 9cfda369..00000000 --- a/spec/acfg/req/bsp-interrupt-stack-size.yml +++ /dev/null @@ -1,15 +0,0 @@ -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause -copyrights: -- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) -enabled-by: true -links: -- role: requirement-refinement - uid: /req/applconfig -non-functional-type: interface-requirement -rationale: null -references: [] -requirement-type: non-functional -text: | - The ${/glossary/bsp:/term} may define the default value for - ${../if/interrupt-stack-size:/name}. -type: requirement diff --git a/spec/acfg/req/bsp-prerequisite-drivers.yml b/spec/acfg/req/bsp-prerequisite-drivers.yml index 5a89951e..7b418593 100644 --- a/spec/acfg/req/bsp-prerequisite-drivers.yml +++ b/spec/acfg/req/bsp-prerequisite-drivers.yml @@ -4,12 +4,16 @@ copyrights: enabled-by: true links: - role: requirement-refinement - uid: /req/applconfig -non-functional-type: interface-requirement + uid: init +functional-type: function rationale: null references: [] -requirement-type: non-functional +requirement-type: functional text: | - The ${/glossary/bsp:/term} may define prerequisite drivers for the Device - Driver Table. + Where ${../if/disable-bsp-settings:/name} is not defined by the application, + where ${/bsp/if/acfg-prerequisite-drivers:/name} is defined by the + ${/glossary/bsp:/term}, when the application configuration is initialized, + the device driver entry points defined by + ${/bsp/if/acfg-prerequisite-drivers:/name} shall be registered in the + ${/glossary/devicedrivertable:/term}. type: requirement diff --git a/spec/acfg/req/init.yml b/spec/acfg/req/init.yml new file mode 100644 index 00000000..cb168571 --- /dev/null +++ b/spec/acfg/req/init.yml @@ -0,0 +1,17 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: /req/applconfig +functional-type: function +rationale: null +references: [] +requirement-type: functional +text: | + Where ${../if/init:/name} is defined, where ${../if/header:/path} is included + in a translation unit after the definition of ${../if/init:/name}, when the + translation unit is preprocessed and compiled, the application configuration + shall be initialized. +type: requirement diff --git a/spec/acfg/req/malloc-bsp-supports-sbrk.yml b/spec/acfg/req/malloc-bsp-supports-sbrk.yml index 832d2473..a2b8ffdc 100644 --- a/spec/acfg/req/malloc-bsp-supports-sbrk.yml +++ b/spec/acfg/req/malloc-bsp-supports-sbrk.yml @@ -4,12 +4,15 @@ copyrights: enabled-by: true links: - role: requirement-refinement - uid: /req/applconfig -non-functional-type: interface-requirement + uid: init +functional-type: function rationale: null references: [] -requirement-type: non-functional +requirement-type: functional text: | - The ${/glossary/bsp:/term} may define that not all memory is made available - to the C Program Heap immediately at system initialization time. + Where ${../if/disable-bsp-settings:/name} is not defined by the application, + where ${/bsp/if/acfg-malloc-supports-sbrk:/name} is defined by the + ${/glossary/bsp:/term}, when the application configuration is initialized, + not all memory shall made available to the C Program Heap immediately at + system initialization time. type: requirement diff --git a/spec/acfg/val/acfg.yml b/spec/acfg/val/acfg.yml index be11a7af..e669a922 100644 --- a/spec/acfg/val/acfg.yml +++ b/spec/acfg/val/acfg.yml @@ -7,8 +7,66 @@ test-actions: - action-brief: | Check the effect of application configuration options. action-code: | - /* Nothing to do */ + rtems_status_code sc; + rtems_id id; checks: + - brief: | + Check the default value ${/acfg/if/idle-task-body:/name} where the + optional BSP-provided default value is enabled. + code: | + T_eq_ptr( + rtems_configuration_get_idle_task(), + #if defined(BSP_IDLE_TASK_BODY) + BSP_IDLE_TASK_BODY + #else + _CPU_Thread_Idle_body + #endif + ); + links: + - role: validation + uid: ../if/idle-task-body + - role: validation + uid: ../if/disable-bsp-settings + - brief: | + Check the configured ${/acfg/if/init-task-arguments:/name}. This + validates also the effect of ${/acfg/if/init-task-entrypoint:/name} and + ${/acfg/if/rtems-init-tasks-table:/name}. + code: | + T_eq_ulong( test_runner_argument, TEST_RUNNER_ARGUMENT ); + links: + - role: validation + uid: ../if/init-task-arguments + - role: validation + uid: ../if/init-task-entrypoint + - role: validation + uid: ../if/rtems-init-tasks-table + - brief: | + Check the configured ${/acfg/if/init-task-initial-modes:/name}. + code: | + T_eq_u32( test_runner_initial_modes, TEST_RUNNER_INITIAL_MODES ); + links: + - role: validation + uid: ../if/init-task-initial-modes + - brief: | + Check the configured ${/acfg/if/init-task-name:/name}. + code: | + sc = rtems_task_ident( TEST_RUNNER_NAME, RTEMS_SEARCH_LOCAL_NODE, &id ); + T_rsc_success( sc ); + T_eq_u32( id, rtems_task_self() ); + links: + - role: validation + uid: ../if/init-task-name + - brief: | + Check the configured ${/acfg/if/init-task-priority:/name}. A priority of + zero can only be set for system tasks. This validates also + ${/acfg/if/init-task-attributes:/name}. + code: | + T_eq_u32( test_runner_initial_priority, 0 ); + links: + - role: validation + uid: ../if/init-task-priority + - role: validation + uid: ../if/init-task-attributes - brief: | Check that the configured ${/acfg/if/min-tasks-with-user-provided-storage:/name} value reduced the @@ -173,7 +231,16 @@ test-actions: - role: validation uid: /rtems/config/if/get-nanoseconds-per-tick - brief: | - Check the configured ${/acfg/if/task-stack-allocator:/name} hook. + Check the configured ${/acfg/if/task-stack-allocator:/name} hook. Using + the test stack allocator validates also + ${/acfg/if/init-task-construct-storage-size}, since the + test_task_stack_allocate() allocate handler only supports + ${/acfg/if/max-tasks:/name} minus one stacks and the validation test for + ${/rtems/task/req/create-errors} creates for some pre-condition variants + all tasks until ${/rtems/status/if/too-many:/name} is returned. In + addition, test_task_stack_allocate() checks that the allocation size is + greater than or equal to TEST_MINIMUM_STACK_SIZE which validates + ${/acfg/if/min-task-stack-size:/name}. code: | T_eq_ptr( rtems_configuration_get_stack_allocate_hook(), @@ -182,6 +249,10 @@ test-actions: links: - role: validation uid: ../if/task-stack-allocator + - role: validation + uid: ../if/init-task-construct-storage-size + - role: validation + uid: ../if/min-task-stack-size - role: validation uid: /rtems/config/if/get-stack-allocate-hook - brief: | @@ -229,18 +300,6 @@ test-actions: uid: ../if/idle-task-stack-size - role: validation uid: /rtems/config/if/get-idle-task-stack-size - - brief: | - Check the configured ${/acfg/if/idle-task-body:/name}. - code: | - T_eq_ptr( - rtems_configuration_get_idle_task(), - test_idle_task_body - ); - links: - - role: validation - uid: ../if/idle-task-body - - role: validation - uid: /rtems/config/if/get-idle-task - brief: | Check the configured ${/acfg/if/interrupt-stack-size:/name} value. code: | @@ -273,7 +332,7 @@ test-context-support: null test-description: null test-header: null test-includes: -- rtems.h +- bsp.h - rtems/score/heap.h test-local-includes: - ts-config.h diff --git a/spec/acfg/val/bsp-prerequisite-drivers.yml b/spec/acfg/val/bsp-prerequisite-drivers.yml new file mode 100644 index 00000000..9a3376f6 --- /dev/null +++ b/spec/acfg/val/bsp-prerequisite-drivers.yml @@ -0,0 +1,17 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: validation + uid: ../req/bsp-prerequisite-drivers +method: by-inspection +references: +- identifier: cpukit/include/rtems/confdefs/iodrivers.h + hash: yz8gesoF_me3cP7VhsO_BITvVnexGuPGTh1dEs87eKs= + type: file +text: | + Inspection of the referenced ${/glossary/sourcecode:/term} file showed that + the ${../req/bsp-prerequisite-drivers} requirement is implemented as + specified. +type: validation diff --git a/spec/acfg/val/default.yml b/spec/acfg/val/default.yml index d60f99cf..64148b05 100644 --- a/spec/acfg/val/default.yml +++ b/spec/acfg/val/default.yml @@ -4,6 +4,72 @@ copyrights: enabled-by: true links: [] test-actions: +- action-brief: | + Check the effect of application configuration options with optional + BSP-provided settings. + action-code: | + rtems_extensions_table bsp = BSP_INITIAL_EXTENSION; + checks: + - brief: | + Check the configured ${/acfg/if/idle-task-body:/name}. + code: | + T_step_eq_ptr( ${step}, rtems_configuration_get_idle_task(), IdleBody ); + links: + - role: validation + uid: ../if/idle-task-body + - role: validation + uid: /rtems/config/if/get-idle-task + - brief: | + Check the default value ${/acfg/if/idle-task-stack-size:/name} where the + optional BSP-provided default value is enabled. + code: | + T_step_eq_sz( + ${step}, + rtems_configuration_get_idle_task_stack_size(), + #if defined(BSP_IDLE_TASK_STACK_SIZE) + BSP_IDLE_TASK_STACK_SIZE + #else + CPU_STACK_MINIMUM_SIZE + #endif + ); + links: + - role: validation + uid: ../if/idle-task-stack-size + - role: validation + uid: ../if/disable-bsp-settings + - brief: | + Check the default value ${/acfg/if/interrupt-stack-size:/name} where the + optional BSP-provided default value is enabled. + code: | + T_step_eq_sz( + ${step}, + rtems_configuration_get_interrupt_stack_size(), + #if defined(BSP_INTERRUPT_STACK_SIZE) + BSP_INTERRUPT_STACK_SIZE + #else + CPU_STACK_MINIMUM_SIZE + #endif + ); + links: + - role: validation + uid: ../if/interrupt-stack-size + - role: validation + uid: ../if/disable-bsp-settings + - brief: | + Check the BSP-provided initial extension is registered. + code: | + T_step_eq_sz( ${step}, _User_extensions_Initial_count, 1 ); + T_step_eq_ptr( + ${step}, + _User_extensions_Initial_extensions[ 0 ].fatal, + bsp.fatal + ); + links: + - role: validation + uid: ../req/bsp-initial-extension + - role: validation + uid: ../if/disable-bsp-settings + links: [] - action-brief: | Try to create a barrier. action-code: | @@ -186,8 +252,9 @@ test-context-support: null test-description: null test-header: null test-includes: -- rtems.h +- bsp.h - string.h +- rtems/score/userextdata.h test-local-includes: - tx-support.h test-setup: null diff --git a/spec/acfg/val/disabled-bsp-settings.yml b/spec/acfg/val/disabled-bsp-settings.yml new file mode 100644 index 00000000..783b5169 --- /dev/null +++ b/spec/acfg/val/disabled-bsp-settings.yml @@ -0,0 +1,82 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: [] +test-actions: +- action-brief: | + Check the effect of application configuration options with optional + BSP-provided settings. + action-code: | + rtems_extensions_table bsp = BSP_INITIAL_EXTENSION; + checks: + - brief: | + Check the default value ${/acfg/if/idle-task-body:/name} where the + optional BSP-provided default value is disabled. + code: | + T_eq_ptr( + rtems_configuration_get_idle_task(), + _CPU_Thread_Idle_body + ); + links: + - role: validation + uid: ../if/idle-task-body + - role: validation + uid: ../if/disable-bsp-settings + - brief: | + Check the default value ${/acfg/if/idle-task-stack-size:/name} where the + optional BSP-provided default value is disabled. + code: | + T_eq_sz( + rtems_configuration_get_idle_task_stack_size(), + CPU_STACK_MINIMUM_SIZE + ); + links: + - role: validation + uid: ../if/idle-task-stack-size + - role: validation + uid: ../if/disable-bsp-settings + - brief: | + Check the default value ${/acfg/if/interrupt-stack-size:/name} where the + optional BSP-provided default value is disabled. + code: | + T_eq_sz( + rtems_configuration_get_interrupt_stack_size(), + CPU_STACK_MINIMUM_SIZE + ); + links: + - role: validation + uid: ../if/interrupt-stack-size + - role: validation + uid: ../if/disable-bsp-settings + - brief: | + Check the BSP-provided initial extension is not registered. + code: | + T_eq_sz( _User_extensions_Initial_count, 1 ); + T_ne_ptr( + _User_extensions_Initial_extensions[ 0 ].fatal, + bsp.fatal + ); + links: + - role: validation + uid: ../req/bsp-initial-extension + - role: validation + uid: ../if/disable-bsp-settings + links: [] +test-brief: | + Tests the default values of application configuration options where all + optional BSP provided settings are disabled. +test-context: [] +test-context-support: null +test-description: null +test-header: null +test-includes: +- bsp.h +- rtems/score/userextdata.h +test-local-includes: [] +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/tc-acfg-disabled-bsp-settings.c +test-teardown: null +type: test-case diff --git a/spec/acfg/val/malloc-bsp-supports-sbrk.yml b/spec/acfg/val/malloc-bsp-supports-sbrk.yml new file mode 100644 index 00000000..fe4d6626 --- /dev/null +++ b/spec/acfg/val/malloc-bsp-supports-sbrk.yml @@ -0,0 +1,17 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: validation + uid: ../req/malloc-bsp-supports-sbrk +method: by-inspection +references: +- identifier: cpukit/include/rtems/confdefs/malloc.h + hash: tz06hfc6SfN7RsMWx7iMUDXnHav1AZUFS-2JdD0CfUY= + type: file +text: | + Inspection of the referenced ${/glossary/sourcecode:/term} file showed that + the ${../req/malloc-bsp-supports-sbrk} requirement is implemented as + specified. +type: validation diff --git a/spec/acfg/val/one-cpu.yml b/spec/acfg/val/one-cpu.yml new file mode 100644 index 00000000..5533244e --- /dev/null +++ b/spec/acfg/val/one-cpu.yml @@ -0,0 +1,55 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: [] +test-actions: +- action-brief: | + Check the effect of application configuration options. + action-code: | + rtems_status_code sc; + rtems_id id; + checks: + - brief: | + Check the configured ${/acfg/if/max-priority:/name} value using + ${/rtems/task/if/maximum-priority}. This configuration option affects + only the Deterministic Priority Scheduler which was explicitly configured + by ${/acfg/if/scheduler-priority:/name} in the test suite. + code: | + T_eq_u32( RTEMS_MAXIMUM_PRIORITY, 127 ); + links: + - role: validation + uid: ../if/max-priority + - role: validation + uid: ../if/scheduler-priority + - role: validation + uid: /rtems/task/if/maximum-priority + - brief: | + Check the configured ${/acfg/if/max-priority:/name} value using + ${/rtems/task/if/maximum-priority}. This configuration option affects + only the Deterministic Priority Scheduler which was explicitly configured + by ${/acfg/if/scheduler-priority:/name} in the test suite. + code: | + sc = rtems_scheduler_ident( TEST_SCHEDULER_A_NAME, &id ); + T_rsc_success( sc ); + links: + - role: validation + uid: ../if/scheduler-name + links: [] +test-brief: | + Tests the effect of application configuration options. +test-context: [] +test-context-support: null +test-description: null +test-header: null +test-includes: +- rtems.h +test-local-includes: +- ts-config.h +- tx-support.h +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/tc-acfg-one-cpu.c +test-teardown: null +type: test-case diff --git a/spec/bsp/if/acfg-idle-task-body.yml b/spec/bsp/if/acfg-idle-task-body.yml new file mode 100644 index 00000000..46a66b5d --- /dev/null +++ b/spec/bsp/if/acfg-idle-task-body.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: bsp-header +- role: interface-ingroup + uid: group +name: BSP_IDLE_TASK_BODY +references: [] +type: interface diff --git a/spec/bsp/if/acfg-idle-task-stack-size.yml b/spec/bsp/if/acfg-idle-task-stack-size.yml new file mode 100644 index 00000000..e41cacfe --- /dev/null +++ b/spec/bsp/if/acfg-idle-task-stack-size.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: bsp-header +- role: interface-ingroup + uid: group +name: BSP_IDLE_TASK_STACK_SIZE +references: [] +type: interface diff --git a/spec/bsp/if/acfg-initial-extension.yml b/spec/bsp/if/acfg-initial-extension.yml new file mode 100644 index 00000000..dbcb3f49 --- /dev/null +++ b/spec/bsp/if/acfg-initial-extension.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: bsp-header +- role: interface-ingroup + uid: group +name: BSP_INITIAL_EXTENSION +references: [] +type: interface diff --git a/spec/bsp/if/acfg-interrupt-stack-size.yml b/spec/bsp/if/acfg-interrupt-stack-size.yml new file mode 100644 index 00000000..d90d8918 --- /dev/null +++ b/spec/bsp/if/acfg-interrupt-stack-size.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: bsp-header +- role: interface-ingroup + uid: group +name: BSP_INTERRUPT_STACK_SIZE +references: [] +type: interface diff --git a/spec/bsp/if/acfg-malloc-supports-sbrk.yml b/spec/bsp/if/acfg-malloc-supports-sbrk.yml new file mode 100644 index 00000000..5be9c73d --- /dev/null +++ b/spec/bsp/if/acfg-malloc-supports-sbrk.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: bsp-header +- role: interface-ingroup + uid: group +name: CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK +references: [] +type: interface diff --git a/spec/bsp/if/acfg-prerequisite-drivers.yml b/spec/bsp/if/acfg-prerequisite-drivers.yml new file mode 100644 index 00000000..6ee02a55 --- /dev/null +++ b/spec/bsp/if/acfg-prerequisite-drivers.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: bsp-header +- role: interface-ingroup + uid: group +name: CONFIGURE_BSP_PREREQUISITE_DRIVERS +references: [] +type: interface diff --git a/spec/bsp/if/bsp-header.yml b/spec/bsp/if/bsp-header.yml new file mode 100644 index 00000000..d4413b35 --- /dev/null +++ b/spec/bsp/if/bsp-header.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This header file provides ${/glossary/bsp:/term}-specific interfaces. +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: header-file +links: +- role: interface-placement + uid: domain +- role: interface-ingroup + uid: group +path: bsp.h +prefix: bsps/include +type: interface diff --git a/spec/rtems/fatal/req/fatal.yml b/spec/rtems/fatal/req/fatal.yml new file mode 100644 index 00000000..0c771f97 --- /dev/null +++ b/spec/rtems/fatal/req/fatal.yml @@ -0,0 +1,18 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: interface-function + uid: ../if/fatal +- role: function-implementation + uid: /score/interr/req/terminate +functional-type: function +rationale: null +references: [] +requirement-type: functional +text: | + When ${../if/fatal:/name} is called, the system shall terminate with a fatal + source specified by the ${../if/fatal:/params[0]/name} parameter and a fatal + code specified by the ${../if/fatal:/params[1]/name} parameter. +type: requirement diff --git a/spec/rtems/scheduler/req/get-maximum-priority.yml b/spec/rtems/scheduler/req/get-maximum-priority.yml index f475060b..51b6f151 100644 --- a/spec/rtems/scheduler/req/get-maximum-priority.yml +++ b/spec/rtems/scheduler/req/get-maximum-priority.yml @@ -36,7 +36,7 @@ post-conditions: #if defined(RTEMS_SMP) T_eq_u32( ctx->priority_obj, INT_MAX ); #else - T_eq_u32( ctx->priority_obj, 255 ); + T_eq_u32( ctx->priority_obj, 127 ); #endif text: | The value of the object referenced by the diff --git a/spec/rtems/task/req/ident.yml b/spec/rtems/task/req/ident.yml index b505199b..964c6532 100644 --- a/spec/rtems/task/req/ident.yml +++ b/spec/rtems/task/req/ident.yml @@ -81,6 +81,7 @@ test-header: null test-includes: [] test-local-includes: - tr-object-ident.h +- ts-config.h test-prepare: null test-setup: brief: null @@ -111,7 +112,7 @@ test-support: | RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT ) static char ClassicTaskIdentStorage[ RTEMS_TASK_STORAGE_SIZE( - MAX_TLS_SIZE + RTEMS_MINIMUM_STACK_SIZE, + MAX_TLS_SIZE + TEST_MINIMUM_STACK_SIZE, TASK_ATTRIBUTES ) ]; diff --git a/spec/score/val/fatal.yml b/spec/score/val/fatal.yml index 13d6a3f7..8521c619 100644 --- a/spec/score/val/fatal.yml +++ b/spec/score/val/fatal.yml @@ -104,7 +104,7 @@ test-actions: deadlock_mutex = CreateMutex(); - SetFatalHandler( FatalThreadQueueDeadlock, ctx ); + SetFatalHandler( FatalJumpBack, ctx ); SetSelfPriority( PRIO_NORMAL ); counter = ResetFatalInfo( ctx ); @@ -113,7 +113,7 @@ test-actions: task_id = CreateTask( "WORK", PRIO_HIGH ); StartTask( task_id, ThreadQueueDeadlockTask, NULL ); - if ( setjmp( before_deadlock ) == 0 ) { + if ( setjmp( before_fatal ) == 0 ) { (void) CreateTask( "DLCK", PRIO_NORMAL ); } @@ -134,6 +134,29 @@ test-actions: links: - role: validation uid: ../object/req/fatal-allocator-mutex-deadlock +- action-brief: | + Check that ${/rtems/fatal/if/fatal:/name} terminates the system. Since + SetFatalHandler() requires an initial extension this validates + ${/acfg/if/initial-extensions:/name}. + action-code: | + unsigned int counter; + + SetFatalHandler( FatalJumpBack, ctx ); + counter = ResetFatalInfo( ctx ); + + if ( setjmp( before_fatal ) == 0 ) { + rtems_fatal( 123, 4567890 ); + } + + T_eq_uint( GetFatalCounter( ctx ), counter + 1 ); + T_eq_int( ctx->source, 123 ); + T_eq_ulong( ctx->code, 4567890 ); + checks: [] + links: + - role: validation + uid: /rtems/fatal/req/fatal + - role: validation + uid: /acfg/if/initial-extensions test-brief: | Tests some fatal errors. test-context: @@ -250,7 +273,7 @@ test-support: | rtems_task_exit(); } - static jmp_buf before_deadlock; + static jmp_buf before_fatal; static rtems_id deadlock_mutex; @@ -265,14 +288,14 @@ test-support: | return true; } - static void FatalThreadQueueDeadlock( + static void FatalJumpBack( rtems_fatal_source source, rtems_fatal_code code, void *arg ) { Fatal( source, code, arg ); - longjmp( before_deadlock, 1 ); + longjmp( before_fatal, 1 ); } static void ThreadQueueDeadlockTask( rtems_task_argument arg ) diff --git a/spec/testsuites/terminate.yml b/spec/testsuites/terminate.yml index fdf36357..c779fcf7 100644 --- a/spec/testsuites/terminate.yml +++ b/spec/testsuites/terminate.yml @@ -5,6 +5,8 @@ enabled-by: true links: - role: requirement-refinement uid: /req/test-suites +- role: validation + uid: /acfg/req/init test-brief: | This validation test suite contains a test case for the system termination procedure. diff --git a/spec/testsuites/validation-0.yml b/spec/testsuites/validation-0.yml index 85447c65..2ecd0487 100644 --- a/spec/testsuites/validation-0.yml +++ b/spec/testsuites/validation-0.yml @@ -7,6 +7,8 @@ links: uid: /req/test-suites - role: validation uid: /acfg/if/appl-needs-clock-driver +- role: validation + uid: /acfg/req/init test-brief: | This general purpose validation test suite provides enough resources to run basic tests for all specified managers and functions. diff --git a/spec/testsuites/validation-acfg-0.yml b/spec/testsuites/validation-acfg-0.yml index d0d0e5a7..c33ac5c7 100644 --- a/spec/testsuites/validation-acfg-0.yml +++ b/spec/testsuites/validation-acfg-0.yml @@ -18,68 +18,20 @@ links: - role: validation uid: /acfg/if/idle-task-body - role: validation - uid: /acfg/if/idle-task-stack-size + uid: /acfg/req/init test-brief: | - This validation test suite is used to validate the default value of application configuration options. + This validation test suite is used to validate the default value of + application configuration options taking the optional BSP provided settings + into account. test-code: | - #include - #include - #include - #include - - #include - - #include "tx-support.h" - #include "ts-config.h" - const char rtems_test_name[] = "${.:/test-suite-name}"; - static char buffer[ 512 ]; - - static const T_action actions[] = { - T_report_hash_sha256 - }; - - static const T_config test_config = { - .name = rtems_test_name, - .buf = buffer, - .buf_size = sizeof( buffer ), - .putchar = rtems_put_char, - .verbosity = RTEMS_TEST_VERBOSITY, - .now = T_now_tick, - .allocate = T_memory_allocate, - .deallocate = T_memory_deallocate, - .action_count = T_ARRAY_SIZE( actions ), - .actions = actions - }; - - #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER - - #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0 - - #define CONFIGURE_DISABLE_NEWLIB_REENTRANCY - - #define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM - #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION - #define CONFIGURE_IDLE_TASK_STACK_SIZE TEST_MINIMUM_STACK_SIZE - - static void *IdleBody( uintptr_t ignored ) + void *IdleBody( uintptr_t ignored ) { - int exit_code; - (void) ignored; - - rtems_test_begin( rtems_test_name, TEST_STATE ); - T_register(); - exit_code = T_main( &test_config ); - - if ( exit_code == 0 ) { - rtems_test_end( rtems_test_name ); - } - - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, (uint32_t) exit_code ); + RunTestSuite(); } #define CONFIGURE_IDLE_TASK_BODY IdleBody @@ -89,7 +41,9 @@ test-code: | #include test-description: null test-includes: [] -test-local-includes: [] +test-local-includes: +- ts-acfg.h +- tx-support.h test-suite-name: ValidationAcfg0 test-target: testsuites/validation/ts-validation-acfg-0.c type: test-suite diff --git a/spec/testsuites/validation-acfg-1.yml b/spec/testsuites/validation-acfg-1.yml new file mode 100644 index 00000000..ee3fd890 --- /dev/null +++ b/spec/testsuites/validation-acfg-1.yml @@ -0,0 +1,60 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: /req/test-suites +- role: validation + uid: /acfg/if/disable-bsp-settings +- role: validation + uid: /acfg/req/init +test-brief: | + This validation test suite is used to validate the default value of + application configuration options where all optional BSP provided settings + are disabled. +test-code: | + const char rtems_test_name[] = "${.:/test-suite-name}"; + + static void FatalExtension( + rtems_fatal_source source, + bool always_set_to_false, + rtems_fatal_code code + ) + { + rtems_extensions_table bsp = BSP_INITIAL_EXTENSION; + + ( *bsp.fatal )( source, always_set_to_false, code ); + } + + static void Init( rtems_task_argument arg ) + { + (void) arg; + RunTestSuite(); + } + + #define CONFIGURE_INITIAL_EXTENSIONS { .fatal = FatalExtension } + + #define CONFIGURE_DISABLE_BSP_SETTINGS + + #define CONFIGURE_MAXIMUM_TASKS 1 + + #define CONFIGURE_RTEMS_INIT_TASKS_TABLE + + #define CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE \ + RTEMS_TASK_STORAGE_SIZE( \ + RTEMS_MINIMUM_STACK_SIZE, \ + RTEMS_DEFAULT_ATTRIBUTES \ + ) + + #define CONFIGURE_INIT + + #include +test-description: null +test-includes: +- bsp.h +test-local-includes: +- ts-acfg.h +test-suite-name: ValidationAcfg1 +test-target: testsuites/validation/ts-validation-acfg-1.c +type: test-suite diff --git a/spec/testsuites/validation-one-cpu-0.yml b/spec/testsuites/validation-one-cpu-0.yml index a28544f7..2893c582 100644 --- a/spec/testsuites/validation-one-cpu-0.yml +++ b/spec/testsuites/validation-one-cpu-0.yml @@ -5,6 +5,10 @@ enabled-by: true links: - role: requirement-refinement uid: /req/test-suites +- role: validation + uid: /acfg/if/scheduler-priority +- role: validation + uid: /acfg/req/init test-brief: | This general purpose validation test suite provides enough resources to run basic tests with exactly one processor and without a diff --git a/spec/testsuites/validation-smp-only-0.yml b/spec/testsuites/validation-smp-only-0.yml index 6d744901..ed838c67 100644 --- a/spec/testsuites/validation-smp-only-0.yml +++ b/spec/testsuites/validation-smp-only-0.yml @@ -5,6 +5,8 @@ enabled-by: RTEMS_SMP links: - role: requirement-refinement uid: /req/test-suites +- role: validation + uid: /acfg/if/scheduler-edf-smp test-brief: | This test suite for SMP-only test cases provides enough resources to run basic tests for all specified managers and functions. -- cgit v1.2.3