[rtems-central commit] spec: Specify some Interrupt Manager interfaces

Sebastian Huber sebh at rtems.org
Fri Nov 19 07:51:57 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    1984239f780549021152554e419930d6de85a7b1
Changeset: http://git.rtems.org/rtems-central/commit/?id=1984239f780549021152554e419930d6de85a7b1

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 18 10:40:52 2021 +0100

spec: Specify some Interrupt Manager interfaces

---

 spec/rtems/intr/req/disable-interrupts.yml         |  19 ++
 spec/rtems/intr/req/entry-initialize-arg.yml       |  17 ++
 spec/rtems/intr/req/entry-initialize-handler.yml   |  17 ++
 spec/rtems/intr/req/entry-initialize-info.yml      |  17 ++
 spec/rtems/intr/req/entry-initialize-next.yml      |  17 ++
 spec/rtems/intr/req/entry-initializer-arg.yml      |  17 ++
 spec/rtems/intr/req/entry-initializer-handler.yml  |  17 ++
 spec/rtems/intr/req/entry-initializer-info.yml     |  17 ++
 spec/rtems/intr/req/entry-initializer-next.yml     |  16 ++
 spec/rtems/intr/req/local-disable-assign.yml       |  17 ++
 spec/rtems/intr/req/local-enable.yml               |  16 ++
 spec/rtems/intr/req/lock-acquire.yml               |  17 ++
 spec/rtems/intr/req/lock-declare-identifier.yml    |  16 ++
 spec/rtems/intr/req/lock-declare-specifier.yml     |  16 ++
 spec/rtems/intr/req/lock-define-identifier.yml     |  16 ++
 spec/rtems/intr/req/lock-define-specifier.yml      |  16 ++
 spec/rtems/intr/req/lock-destroy.yml               |  16 ++
 spec/rtems/intr/req/lock-empty-initializer.yml     |  16 ++
 spec/rtems/intr/req/lock-initialize.yml            |  17 ++
 spec/rtems/intr/req/lock-initializer.yml           |  16 ++
 spec/rtems/intr/req/lock-member-identifier.yml     |  16 ++
 spec/rtems/intr/req/lock-member-type.yml           |  15 ++
 spec/rtems/intr/req/lock-reference-identifier.yml  |  16 ++
 spec/rtems/intr/req/lock-reference-target.yml      |  16 ++
 spec/rtems/intr/req/lock-reference-type.yml        |  15 ++
 spec/rtems/intr/req/lock-release.yml               |  17 ++
 spec/rtems/intr/req/lock-restore-interrupts.yml    |  16 ++
 .../rtems/intr/req/lock-store-interrupt-status.yml |  18 ++
 spec/rtems/intr/req/lock-use-context.yml           |  18 ++
 spec/rtems/intr/req/lock-white-space.yml           |  25 +++
 spec/rtems/intr/val/intr-non-smp.yml               | 122 +++++++++++
 spec/rtems/intr/val/intr-smp-only.yml              | 170 +++++++++++++++
 spec/rtems/intr/val/intr.yml                       | 227 +++++++++++++++++++++
 33 files changed, 1024 insertions(+)

diff --git a/spec/rtems/intr/req/disable-interrupts.yml b/spec/rtems/intr/req/disable-interrupts.yml
new file mode 100644
index 0000000..69fb17c
--- /dev/null
+++ b/spec/rtems/intr/req/disable-interrupts.yml
@@ -0,0 +1,19 @@
+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/local-disable
+- role: interface-function
+  uid: ../if/lock-acquire
+- role: interface-function
+  uid: ../if/lock-isr-disable
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the directive is called, maskable interrupts shall be disabled on a
+  processor which executed at least one instruction of the directive.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initialize-arg.yml b/spec/rtems/intr/req/entry-initialize-arg.yml
new file mode 100644
index 0000000..1ed410c
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initialize-arg.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: interface-function
+  uid: ../if/entry-initialize
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initialize:/name} directive is called, the ``arg``
+  member of the object referenced by the
+  ${../if/entry-initialize:/params[0]/name} parameter shall be set to the value
+  of the ${../if/entry-initialize:/params[2]/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initialize-handler.yml b/spec/rtems/intr/req/entry-initialize-handler.yml
new file mode 100644
index 0000000..e106d0d
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initialize-handler.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: interface-function
+  uid: ../if/entry-initialize
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initialize:/name} directive is called, the ``handler``
+  member of the object referenced by the
+  ${../if/entry-initialize:/params[0]/name} parameter shall be set to the value
+  of the ${../if/entry-initialize:/params[1]/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initialize-info.yml b/spec/rtems/intr/req/entry-initialize-info.yml
new file mode 100644
index 0000000..1d03f22
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initialize-info.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: interface-function
+  uid: ../if/entry-initialize
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initialize:/name} directive is called, the ``info``
+  member of the object referenced by the
+  ${../if/entry-initialize:/params[0]/name} parameter shall be set to the value
+  of the ${../if/entry-initialize:/params[2]/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initialize-next.yml b/spec/rtems/intr/req/entry-initialize-next.yml
new file mode 100644
index 0000000..3ada315
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initialize-next.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: interface-function
+  uid: ../if/entry-initialize
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initialize:/name} directive is called, the ``next``
+  member of the object referenced by the
+  ${../if/entry-initialize:/params[0]/name} parameter shall be set to the value
+  equal to ${/c/if/null:/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initializer-arg.yml b/spec/rtems/intr/req/entry-initializer-arg.yml
new file mode 100644
index 0000000..727f28e
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initializer-arg.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: interface-function
+  uid: ../if/entry-initializer
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initializer:/name} is used to statically initialize an
+  object of type ${../if/entry:/name}, the ``arg`` member of the object
+  shall be initialized to the value of the
+  ${../if/entry-initializer:/params[1]/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initializer-handler.yml b/spec/rtems/intr/req/entry-initializer-handler.yml
new file mode 100644
index 0000000..c9f7232
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initializer-handler.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: interface-function
+  uid: ../if/entry-initializer
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initializer:/name} is used to statically initialize an
+  object of type ${../if/entry:/name}, the ``handler`` member of the object
+  shall be initialized to the value of the
+  ${../if/entry-initializer:/params[0]/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initializer-info.yml b/spec/rtems/intr/req/entry-initializer-info.yml
new file mode 100644
index 0000000..29f664d
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initializer-info.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: interface-function
+  uid: ../if/entry-initializer
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initializer:/name} is used to statically initialize an
+  object of type ${../if/entry:/name}, the ``info`` member of the object
+  shall be initialized to the value of the
+  ${../if/entry-initializer:/params[2]/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/entry-initializer-next.yml b/spec/rtems/intr/req/entry-initializer-next.yml
new file mode 100644
index 0000000..a1d5355
--- /dev/null
+++ b/spec/rtems/intr/req/entry-initializer-next.yml
@@ -0,0 +1,16 @@
+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/entry-initializer
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/entry-initializer:/name} is used to statically initialize an
+  object of type ${../if/entry:/name}, the ``next`` member of the object shall
+  be initialized to a value equal to ${/c/if/null:/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/local-disable-assign.yml b/spec/rtems/intr/req/local-disable-assign.yml
new file mode 100644
index 0000000..6faeaf2
--- /dev/null
+++ b/spec/rtems/intr/req/local-disable-assign.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: interface-function
+  uid: ../if/local-disable
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/local-disable:/name} directive is called, the status of the
+  maskable interrupts before maskable interrupts are disabled by the directive
+  shall be assigned to the variable specified by the
+  ${../if/local-disable:/params[0]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/local-enable.yml b/spec/rtems/intr/req/local-enable.yml
new file mode 100644
index 0000000..90035ee
--- /dev/null
+++ b/spec/rtems/intr/req/local-enable.yml
@@ -0,0 +1,16 @@
+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/local-enable
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/local-enable:/name} directive is called, the status of
+  maskable interrupts shall be restored according to the
+  ${../if/local-enable:/params[0]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-acquire.yml b/spec/rtems/intr/req/lock-acquire.yml
new file mode 100644
index 0000000..e543fd4
--- /dev/null
+++ b/spec/rtems/intr/req/lock-acquire.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: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-acquire
+- role: interface-function
+  uid: ../if/lock-acquire-isr
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the directive is called, the lock contained in the object referenced by
+  the ${../if/lock-initialize:/params[0]/name} parameter shall be acquired.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-declare-identifier.yml b/spec/rtems/intr/req/lock-declare-identifier.yml
new file mode 100644
index 0000000..554012f
--- /dev/null
+++ b/spec/rtems/intr/req/lock-declare-identifier.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-declare
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-declare:/name} is used, it shall expand to an object
+  declaration with an identifier specified by the
+  ${../if/lock-declare:/params[1]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-declare-specifier.yml b/spec/rtems/intr/req/lock-declare-specifier.yml
new file mode 100644
index 0000000..5f16c98
--- /dev/null
+++ b/spec/rtems/intr/req/lock-declare-specifier.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-declare
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-declare:/name} is used, it shall expand to an object
+  declaration with a specifier specified by the
+  ${../if/lock-declare:/params[0]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-define-identifier.yml b/spec/rtems/intr/req/lock-define-identifier.yml
new file mode 100644
index 0000000..44a0ed0
--- /dev/null
+++ b/spec/rtems/intr/req/lock-define-identifier.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-define
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-define:/name} is used, it shall expand to an object
+  definition with an identifier specified by the
+  ${../if/lock-define:/params[1]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-define-specifier.yml b/spec/rtems/intr/req/lock-define-specifier.yml
new file mode 100644
index 0000000..ed17336
--- /dev/null
+++ b/spec/rtems/intr/req/lock-define-specifier.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-define
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-define:/name} is used, it shall expand to an object
+  definition with a specifier specified by the
+  ${../if/lock-define:/params[0]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-destroy.yml b/spec/rtems/intr/req/lock-destroy.yml
new file mode 100644
index 0000000..d26e92f
--- /dev/null
+++ b/spec/rtems/intr/req/lock-destroy.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-destroy
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-destroy:/name} directive is called, the lock contained
+  in the object referenced by the ${../if/lock-destroy:/params[0]/name}
+  parameter shall be destroyed.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-empty-initializer.yml b/spec/rtems/intr/req/lock-empty-initializer.yml
new file mode 100644
index 0000000..6d09522
--- /dev/null
+++ b/spec/rtems/intr/req/lock-empty-initializer.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by:
+  not: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-initializer
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the macro is used, the macro shall expand to an empty structure
+  initializer.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-initialize.yml b/spec/rtems/intr/req/lock-initialize.yml
new file mode 100644
index 0000000..3592ff6
--- /dev/null
+++ b/spec/rtems/intr/req/lock-initialize.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: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-initialize
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-initialize:/name} directive is called, the lock
+  contained in the object referenced by the
+  ${../if/lock-initialize:/params[0]/name} parameter shall be initialized so
+  that it is available.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-initializer.yml b/spec/rtems/intr/req/lock-initializer.yml
new file mode 100644
index 0000000..c29665c
--- /dev/null
+++ b/spec/rtems/intr/req/lock-initializer.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-initializer
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-initializer:/name} is used to statically initialize an
+  object of type ${../if/lock:/name}, the lock contained in the object shall be
+  initialized so that it is available.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-member-identifier.yml b/spec/rtems/intr/req/lock-member-identifier.yml
new file mode 100644
index 0000000..8a143b3
--- /dev/null
+++ b/spec/rtems/intr/req/lock-member-identifier.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-member
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-member:/name} is used, it shall expand to structure or
+  union member declaration with an identifier specified by the
+  ${../if/lock-define:/params[0]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-member-type.yml b/spec/rtems/intr/req/lock-member-type.yml
new file mode 100644
index 0000000..1bde15c
--- /dev/null
+++ b/spec/rtems/intr/req/lock-member-type.yml
@@ -0,0 +1,15 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-member
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-member:/name} is used, it shall expand to structure or
+  union member declaration with a type of ${../if/lock:/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-reference-identifier.yml b/spec/rtems/intr/req/lock-reference-identifier.yml
new file mode 100644
index 0000000..135df28
--- /dev/null
+++ b/spec/rtems/intr/req/lock-reference-identifier.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-reference
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-reference:/name} is used, it shall expand to an object
+  reference definition with an identifier specified by the
+  ${../if/lock-reference:/params[0]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-reference-target.yml b/spec/rtems/intr/req/lock-reference-target.yml
new file mode 100644
index 0000000..f46b684
--- /dev/null
+++ b/spec/rtems/intr/req/lock-reference-target.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-reference
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-reference:/name} is used, it shall expand to an object
+  reference definition which is initialized to the object reference specified
+  by the ${../if/lock-reference:/params[1]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-reference-type.yml b/spec/rtems/intr/req/lock-reference-type.yml
new file mode 100644
index 0000000..0eba897
--- /dev/null
+++ b/spec/rtems/intr/req/lock-reference-type.yml
@@ -0,0 +1,15 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-reference
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-reference:/name} is used, it shall expand to an object
+  reference definition with a type of a pointer to ${../if/lock:/name}.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-release.yml b/spec/rtems/intr/req/lock-release.yml
new file mode 100644
index 0000000..b3d43eb
--- /dev/null
+++ b/spec/rtems/intr/req/lock-release.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: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-release
+- role: interface-function
+  uid: ../if/lock-release-isr
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the directive is called, the lock contained in the object referenced by
+  the ${../if/lock-initialize:/params[0]/name} parameter shall be released.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-restore-interrupts.yml b/spec/rtems/intr/req/lock-restore-interrupts.yml
new file mode 100644
index 0000000..f7f1a54
--- /dev/null
+++ b/spec/rtems/intr/req/lock-restore-interrupts.yml
@@ -0,0 +1,16 @@
+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/lock-release
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/lock-release:/name} directive is called, the status of
+  maskable interrupts shall be restored according to the
+  ${../if/lock-release:/params[1]/name} parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-store-interrupt-status.yml b/spec/rtems/intr/req/lock-store-interrupt-status.yml
new file mode 100644
index 0000000..fa6ded0
--- /dev/null
+++ b/spec/rtems/intr/req/lock-store-interrupt-status.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/lock-acquire
+- role: interface-function
+  uid: ../if/lock-isr-disable
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the directive is called, the status of the maskable interrupts before
+  maskable interrupts are disabled by the directive shall be stored to the lock
+  context parameter.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-use-context.yml b/spec/rtems/intr/req/lock-use-context.yml
new file mode 100644
index 0000000..c59c86d
--- /dev/null
+++ b/spec/rtems/intr/req/lock-use-context.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:
+  not: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-acquire-isr
+- role: interface-function
+  uid: ../if/lock-release-isr
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the macro is used, the macro shall expand to code block which marks the
+  second parameter as used.
+type: requirement
diff --git a/spec/rtems/intr/req/lock-white-space.yml b/spec/rtems/intr/req/lock-white-space.yml
new file mode 100644
index 0000000..80fbeb2
--- /dev/null
+++ b/spec/rtems/intr/req/lock-white-space.yml
@@ -0,0 +1,25 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by:
+  not: RTEMS_SMP
+links:
+- role: interface-function
+  uid: ../if/lock-declare
+- role: interface-function
+  uid: ../if/lock-define
+- role: interface-function
+  uid: ../if/lock-initialize
+- role: interface-function
+  uid: ../if/lock-member
+- role: interface-function
+  uid: ../if/lock-reference
+- role: interface-function
+  uid: ../if/lock-destroy
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the macro is used, the macro shall expand to white space only.
+type: requirement
diff --git a/spec/rtems/intr/val/intr-non-smp.yml b/spec/rtems/intr/val/intr-non-smp.yml
new file mode 100644
index 0000000..5598582
--- /dev/null
+++ b/spec/rtems/intr/val/intr-non-smp.yml
@@ -0,0 +1,122 @@
+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:
+  not: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    Validate some interrupt lock macros.
+  action-code: |
+    const char *s;
+  checks:
+  - brief: |
+      Check that ${../if/lock-declare:/name} expands to white space only.
+    code: |
+      s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_DECLARE( x, y ) );
+      T_true( IsWhiteSpaceOnly( s ) );
+    links:
+    - role: validation
+      uid: ../if/lock-declare
+    - role: validation
+      uid: ../req/lock-white-space
+  - brief: |
+      Check that ${../if/lock-define:/name} expands to white space only.
+    code: |
+      s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_DEFINE( x, y, z ) );
+      T_true( IsWhiteSpaceOnly( s ) );
+    links:
+    - role: validation
+      uid: ../if/lock-define
+    - role: validation
+      uid: ../req/lock-white-space
+  - brief: |
+      Check that ${../if/lock-member:/name} expands to white space only.
+    code: |
+      s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_MEMBER( x ) );
+      T_true( IsWhiteSpaceOnly( s ) );
+    links:
+    - role: validation
+      uid: ../if/lock-member
+    - role: validation
+      uid: ../req/lock-white-space
+  - brief: |
+      Check that ${../if/lock-reference:/name} expands to white space only.
+    code: |
+      s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_REFERENCE( x, y ) );
+      T_true( IsWhiteSpaceOnly( s ) );
+    links:
+    - role: validation
+      uid: ../if/lock-reference
+    - role: validation
+      uid: ../req/lock-white-space
+  - brief: |
+      Check that ${../if/lock-destroy:/name} expands to white space only.
+    code: |
+      s = RTEMS_XSTRING( rtems_interrupt_lock_destroy( x ) );
+      T_true( IsWhiteSpaceOnly( s ) );
+    links:
+    - role: validation
+      uid: ../if/lock-destroy
+    - role: validation
+      uid: ../req/lock-white-space
+  - brief: |
+      Check that ${../if/lock-initializer:/name} expands to an empty structure
+      initializer.
+    code: |
+      s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_INITIALIZER( x ) );
+      T_true( IsEqualIgnoreWhiteSpace( s, "{}" ) );
+    links:
+    - role: validation
+      uid: ../if/lock-initializer
+    - role: validation
+      uid: ../req/lock-empty-initializer
+  - brief: |
+      Check that ${../if/lock-initialize:/name} expands to white space only.
+    code: |
+      s = RTEMS_XSTRING( rtems_interrupt_lock_initialize( x, y ) );
+      T_true( IsWhiteSpaceOnly( s ) );
+    links:
+    - role: validation
+      uid: ../if/lock-initialize
+    - role: validation
+      uid: ../req/lock-white-space
+  - brief: |
+      Check that ${../if/lock-acquire-isr:/name} expands to a code block which
+      marks the second parameter as used.
+    code: |
+      s = RTEMS_XSTRING( rtems_interrupt_lock_acquire_isr( x, y ) );
+      T_true( IsEqualIgnoreWhiteSpace( s, "do{(void)y;}while(0)" ) );
+    links:
+    - role: validation
+      uid: ../if/lock-acquire-isr
+    - role: validation
+      uid: ../req/lock-use-context
+  - brief: |
+      Check that ${../if/lock-release-isr:/name} expands to a code block which
+      marks the second parameter as used.
+    code: |
+      s = RTEMS_XSTRING( rtems_interrupt_lock_release_isr( x, y ) );
+      T_true( IsEqualIgnoreWhiteSpace( s, "do{(void)y;}while(0)" ) );
+    links:
+    - role: validation
+      uid: ../if/lock-release-isr
+    - role: validation
+      uid: ../req/lock-use-context
+  links: []
+test-brief: |
+  Tests some ${../if/group:/name} interfaces.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes:
+- tx-support.h
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-intr-non-smp.c
+test-teardown: null
+type: test-case
diff --git a/spec/rtems/intr/val/intr-smp-only.yml b/spec/rtems/intr/val/intr-smp-only.yml
new file mode 100644
index 0000000..c32b927
--- /dev/null
+++ b/spec/rtems/intr/val/intr-smp-only.yml
@@ -0,0 +1,170 @@
+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: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    Validate the interrupt lock directives.
+  action-code: |
+    struct {
+      int a;
+      RTEMS_INTERRUPT_LOCK_MEMBER( member )
+      int b;
+    } lock = {
+      .member = RTEMS_INTERRUPT_LOCK_INITIALIZER( "name" )
+    };
+
+    RTEMS_INTERRUPT_LOCK_REFERENCE( ref, &the_lock )
+    rtems_interrupt_lock_context lock_context;
+  checks:
+  - brief: |
+      Check that ${../if/lock-reference:/name} expanded to a lock reference
+      definition.  Check that the lock is available after static
+      initialization.
+    code: |
+      T_true( ISRLockIsAvailable( ref ) );
+    links:
+    - role: validation
+      uid: ../req/lock-reference-identifier
+    - role: validation
+      uid: ../req/lock-reference-target
+    - role: validation
+      uid: ../req/lock-reference-type
+    - role: validation
+      uid: ../if/lock-declare
+    - role: validation
+      uid: ../if/lock-define
+  - brief: |
+      Check that the lock is available after initialization.
+    code: |
+      T_true( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../if/lock-initializer
+  - brief: |
+      Check that maskable interrupts are disabled before the call to
+      ${../if/lock-isr-disable:/name} and disabled afterwards.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+      rtems_interrupt_lock_interrupt_disable( &lock_context );
+      T_false( AreInterruptsEnabled() );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../if/lock-isr-disable
+    - role: validation
+      uid: ../req/disable-interrupts
+    - role: validation
+      uid: ../req/lock-store-interrupt-status
+  - brief: |
+      Check that the maskable interrupt status is not changed by the
+      ${../if/lock-acquire-isr:/name} call.  Check that the lock is no longer
+      available.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+      rtems_interrupt_lock_acquire_isr( &lock.member, &lock_context );
+      T_false( AreInterruptsEnabled() );
+      T_false( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../req/lock-acquire
+  - brief: |
+      Check that the maskable interrupt status is restored by the call to
+      ${../if/lock-release:/name} according to the
+      ${../if/lock-release:/params[1]/name} parameter.  Check that the lock is
+      available afterwards.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      T_false( ISRLockIsAvailable( &lock.member ) );
+      rtems_interrupt_lock_release( &lock.member, &lock_context );
+      T_true( AreInterruptsEnabled() );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../req/lock-release
+    - role: validation
+      uid: ../req/lock-restore-interrupts
+  - brief: |
+      Check that the maskable interrupt status is not changed by the
+      ${../if/lock-destroy:/name} call.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      rtems_interrupt_lock_destroy( &lock.member );
+      T_true( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../req/lock-destroy
+  - brief: |
+      Initialize the lock using ${../if/lock-initialize:/name}.  Check that the
+      lock is available after initialization.
+    code: |
+      rtems_interrupt_lock_initialize( &lock.member, "name" );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../if/lock-initialize
+  - brief: |
+      Check that maskable interrupts are disabled before the call to
+      ${../if/lock-acquire:/name} and disabled afterwards.  Check that the lock
+      is no longer available.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+      rtems_interrupt_lock_acquire( &lock.member, &lock_context );
+      T_false( AreInterruptsEnabled() );
+      T_false( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../if/lock-acquire
+    - role: validation
+      uid: ../req/disable-interrupts
+    - role: validation
+      uid: ../req/lock-store-interrupt-status
+  - brief: |
+      Check that the maskable interrupt status is restored by the call to
+      ${../if/lock-release:/name} according to the
+      ${../if/lock-release:/params[1]/name} parameter.  Check that the lock is
+      available afterwards.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      T_false( ISRLockIsAvailable( &lock.member ) );
+      rtems_interrupt_lock_release( &lock.member, &lock_context );
+      T_true( AreInterruptsEnabled() );
+      T_true( ISRLockIsAvailable( &lock.member ) );
+    links:
+    - role: validation
+      uid: ../req/lock-release
+    - role: validation
+      uid: ../req/lock-restore-interrupts
+  - brief: |
+      Check that the maskable interrupt status is not changed by the
+      ${../if/lock-destroy:/name} call.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      rtems_interrupt_lock_destroy( &lock.member );
+      T_true( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../req/lock-destroy
+  links: []
+test-brief: |
+  Tests some ${../if/group:/name} directives.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes:
+- tx-support.h
+test-setup: null
+test-stop: null
+test-support: |
+  RTEMS_INTERRUPT_LOCK_DECLARE( static, the_lock )
+  RTEMS_INTERRUPT_LOCK_DEFINE( static, the_lock, "name " )
+test-target: testsuites/validation/tc-intr-smp-only.c
+test-teardown: null
+type: test-case
diff --git a/spec/rtems/intr/val/intr.yml b/spec/rtems/intr/val/intr.yml
new file mode 100644
index 0000000..df34ffb
--- /dev/null
+++ b/spec/rtems/intr/val/intr.yml
@@ -0,0 +1,227 @@
+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: |
+    Validate ${../if/local-disable:/name} and ${../if/local-enable:/name}.
+  action-code: |
+    rtems_interrupt_level level;
+    rtems_interrupt_level level_2;
+  checks:
+  - brief: |
+      Check that maskable interrupts are enabled before the call to
+      ${../if/local-disable:/name} and disabled afterwards.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      rtems_interrupt_local_disable( level );
+      T_false( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../if/local-disable
+    - role: validation
+      uid: ../req/disable-interrupts
+    - role: validation
+      uid: ../req/local-disable-assign
+  - brief: |
+      Check that maskable interrupts are disabled before the call to
+      ${../if/local-disable:/name} and disabled afterwards.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      rtems_interrupt_local_disable( level_2 );
+      T_false( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../if/local-disable
+    - role: validation
+      uid: ../req/disable-interrupts
+    - role: validation
+      uid: ../req/local-disable-assign
+  - brief: |
+      Check that the maskable interrupt status is restored by the call to
+      ${../if/local-enable:/name} according to the
+      ${../if/local-enable:/params[0]/name} parameter.  In this case maskable
+      interrupts are still disabled afterwards.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      rtems_interrupt_local_enable( level_2 );
+      T_false( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../if/local-enable
+    - role: validation
+      uid: ../req/local-disable-assign
+    - role: validation
+      uid: ../req/local-enable
+  - brief: |
+      Check that the maskable interrupt status is restored by the call to
+      ${../if/local-enable:/name} according to the
+      ${../if/local-enable:/params[0]/name} parameter.  In this case maskable
+      interrupts are enabled afterwards.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      rtems_interrupt_local_enable( level );
+      T_true( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../if/local-enable
+    - role: validation
+      uid: ../req/local-disable-assign
+    - role: validation
+      uid: ../req/local-enable
+  links: []
+- action-brief: |
+    Validate the interrupt lock directives.
+  action-code: |
+    RTEMS_INTERRUPT_LOCK_DEFINE( , lock, "name" );
+    rtems_interrupt_lock_context lock_context;
+  checks:
+  - brief: |
+      Check that maskable interrupts are disabled before the call to
+      ${../if/lock-isr-disable:/name} and disabled afterwards.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      rtems_interrupt_lock_interrupt_disable( &lock_context );
+      T_false( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../if/lock-isr-disable
+    - role: validation
+      uid: ../req/disable-interrupts
+    - role: validation
+      uid: ../req/lock-store-interrupt-status
+  - brief: |
+      Check that the maskable interrupt status is not changed by the
+      ${../if/lock-acquire-isr:/name} call.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      rtems_interrupt_lock_acquire_isr( &lock, &lock_context );
+      T_false( AreInterruptsEnabled() );
+    links: []
+  - brief: |
+      Check that the maskable interrupt status is restored by the call to
+      ${../if/lock-release:/name} according to the
+      ${../if/lock-release:/params[1]/name} parameter.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      rtems_interrupt_lock_release( &lock, &lock_context );
+      T_true( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../req/lock-restore-interrupts
+  - brief: |
+      Check that maskable interrupts are disabled before the call to
+      ${../if/lock-acquire:/name} and disabled afterwards.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      rtems_interrupt_lock_acquire( &lock, &lock_context );
+      T_false( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../if/lock-acquire
+    - role: validation
+      uid: ../req/disable-interrupts
+    - role: validation
+      uid: ../req/lock-store-interrupt-status
+  - brief: |
+      Check that the maskable interrupt status is restored by the call to
+      ${../if/lock-release:/name} according to the
+      ${../if/lock-release:/params[1]/name} parameter.
+    code: |
+      T_false( AreInterruptsEnabled() );
+      rtems_interrupt_lock_release( &lock, &lock_context );
+      T_true( AreInterruptsEnabled() );
+    links:
+    - role: validation
+      uid: ../req/lock-restore-interrupts
+  - brief: |
+      Check that the maskable interrupt status is not changed by the
+      ${../if/lock-destroy:/name} call.
+    code: |
+      T_true( AreInterruptsEnabled() );
+      rtems_interrupt_lock_destroy( &lock );
+      T_true( AreInterruptsEnabled() );
+    links: []
+  links: []
+- action-brief: |
+    Validate the interrupt entry initialization.
+  action-code: |
+    int entry_arg;
+    int entry_arg_2;
+    const char entry_info[] = "1";
+    const char entry_info_2[] = "1";
+    rtems_interrupt_entry entry = RTEMS_INTERRUPT_ENTRY_INITIALIZER(
+      EntryRoutine,
+      &entry_arg,
+      entry_info
+    );
+  checks:
+  - brief: |
+      Check that the entry is properly initialized by
+      ${../if/entry-initializer:/name}.
+    code: |
+      T_eq_ptr( entry.handler, EntryRoutine );
+      T_eq_ptr( entry.arg, &entry_arg );
+      T_eq_ptr( entry.next, NULL );
+      T_eq_ptr( entry.info, entry_info );
+    links:
+    - role: validation
+      uid: ../req/entry-initializer-handler
+    - role: validation
+      uid: ../req/entry-initializer-arg
+    - role: validation
+      uid: ../req/entry-initializer-next
+    - role: validation
+      uid: ../req/entry-initializer-info
+  - brief: |
+      Call ${../if/entry-initialize:/name}.  Check that the entry is properly
+      initialized by ${../if/entry-initialize:/name}.
+    code: |
+      entry.next = &entry;
+      rtems_interrupt_entry_initialize(
+        &entry,
+        EntryRoutine2,
+        &entry_arg_2,
+        entry_info_2
+      );
+      T_eq_ptr( entry.handler, EntryRoutine2 );
+      T_eq_ptr( entry.arg, &entry_arg_2 );
+      T_eq_ptr( entry.next, NULL );
+      T_eq_ptr( entry.info, entry_info_2 );
+    links:
+    - role: validation
+      uid: ../req/entry-initialize-handler
+    - role: validation
+      uid: ../req/entry-initialize-arg
+    - role: validation
+      uid: ../req/entry-initialize-next
+    - role: validation
+      uid: ../req/entry-initialize-info
+  links: []
+test-brief: |
+  Tests some ${../if/group:/name} directives.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+- rtems/irq-extension.h
+test-local-includes:
+- tx-support.h
+test-setup: null
+test-stop: null
+test-support: |
+  static void EntryRoutine( void *arg )
+  {
+    (void) arg;
+  }
+
+  static void EntryRoutine2( void *arg )
+  {
+    (void) arg;
+  }
+test-target: testsuites/validation/tc-intr.c
+test-teardown: null
+type: test-case



More information about the vc mailing list