[rtems-docs commit] c-user: Add types to macros

Sebastian Huber sebh at rtems.org
Tue Oct 4 05:54:17 UTC 2022


Module:    rtems-docs
Branch:    master
Commit:    c98307c4f1ede7d7825326e4832f1040569463f0
Changeset: http://git.rtems.org/rtems-docs/commit/?id=c98307c4f1ede7d7825326e4832f1040569463f0

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Sep 30 14:52:01 2022 +0200

c-user: Add types to macros

---

 c-user/interrupt/directives.rst       | 56 +++++++++++++++++++++++------------
 c-user/message/directives.rst         |  2 +-
 c-user/object-services/directives.rst |  6 +++-
 c-user/task/directives.rst            |  2 +-
 4 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/c-user/interrupt/directives.rst b/c-user/interrupt/directives.rst
index d4855b6..ee3e121 100644
--- a/c-user/interrupt/directives.rst
+++ b/c-user/interrupt/directives.rst
@@ -128,7 +128,7 @@ Disables the maskable interrupts on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_disable( isr_cookie )
+    void rtems_interrupt_disable( rtems_interrupt_level isr_cookie );
 
 .. rubric:: PARAMETERS:
 
@@ -218,7 +218,7 @@ Restores the previous interrupt level on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_enable( isr_cookie )
+    void rtems_interrupt_enable( rtems_interrupt_level isr_cookie );
 
 .. rubric:: PARAMETERS:
 
@@ -280,7 +280,7 @@ Flashes interrupts on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_flash( isr_cookie )
+    void rtems_interrupt_flash( rtems_interrupt_level isr_cookie );
 
 .. rubric:: PARAMETERS:
 
@@ -338,7 +338,7 @@ Disables the maskable interrupts on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_local_disable( isr_cookie )
+    void rtems_interrupt_local_disable( rtems_interrupt_level isr_cookie );
 
 .. rubric:: PARAMETERS:
 
@@ -428,7 +428,7 @@ Restores the previous interrupt level on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_local_enable( isr_cookie )
+    void rtems_interrupt_local_enable( rtems_interrupt_level isr_cookie );
 
 .. rubric:: PARAMETERS:
 
@@ -484,7 +484,7 @@ Checks if an ISR is in progress on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_is_in_progress()
+    bool rtems_interrupt_is_in_progress( void );
 
 .. rubric:: DESCRIPTION:
 
@@ -525,7 +525,10 @@ Initializes the ISR lock.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_initialize( lock, name )
+    void rtems_interrupt_lock_initialize(
+      rtems_interrupt_lock *lock,
+      const char           *name
+    );
 
 .. rubric:: PARAMETERS:
 
@@ -561,7 +564,7 @@ Destroys the ISR lock.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_destroy( lock )
+    void rtems_interrupt_lock_destroy( rtems_interrupt_lock *lock );
 
 .. rubric:: PARAMETERS:
 
@@ -605,7 +608,10 @@ Acquires the ISR lock.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_acquire( lock, lock_context )
+    void rtems_interrupt_lock_acquire(
+      rtems_interrupt_lock         *lock,
+      rtems_interrupt_lock_context *lock_context
+    );
 
 .. rubric:: PARAMETERS:
 
@@ -679,7 +685,7 @@ Releases the ISR lock.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_release( lock, lock_context )
+    void rtems_interrupt_lock_release( rtems_interrupt_lock_context *lock );
 
 .. rubric:: PARAMETERS:
 
@@ -737,7 +743,10 @@ Acquires the ISR lock from within an ISR.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_acquire_isr( lock, lock_context )
+    void rtems_interrupt_lock_acquire_isr(
+      rtems_interrupt_lock         *lock,
+      rtems_interrupt_lock_context *lock_context
+    );
 
 .. rubric:: PARAMETERS:
 
@@ -800,7 +809,10 @@ Releases the ISR lock from within an ISR.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_release_isr( lock, lock_context )
+    void rtems_interrupt_lock_release_isr(
+      rtems_interrupt_lock         *lock,
+      rtems_interrupt_lock_context *lock_context
+    );
 
 .. rubric:: PARAMETERS:
 
@@ -853,7 +865,9 @@ Disables maskable interrupts on the current processor.
 
 .. code-block:: c
 
-    #define rtems_interrupt_lock_interrupt_disable( lock_context )
+    void rtems_interrupt_lock_interrupt_disable(
+      rtems_interrupt_lock_context *lock_context
+    );
 
 .. rubric:: PARAMETERS:
 
@@ -892,7 +906,7 @@ Declares an ISR lock object.
 
 .. code-block:: c
 
-    #define RTEMS_INTERRUPT_LOCK_DECLARE( specifier, designator )
+    RTEMS_INTERRUPT_LOCK_DECLARE( specifier, designator );
 
 .. rubric:: PARAMETERS:
 
@@ -926,7 +940,7 @@ Defines an ISR lock object.
 
 .. code-block:: c
 
-    #define RTEMS_INTERRUPT_LOCK_DEFINE( specifier, designator, name )
+    RTEMS_INTERRUPT_LOCK_DEFINE( specifier, designator, const char *name );
 
 .. rubric:: PARAMETERS:
 
@@ -968,7 +982,7 @@ Statically initializes an ISR lock object.
 
 .. code-block:: c
 
-    #define RTEMS_INTERRUPT_LOCK_INITIALIZER( name )
+    RTEMS_INTERRUPT_LOCK_INITIALIZER( const char *name );
 
 .. rubric:: PARAMETERS:
 
@@ -1001,7 +1015,7 @@ Defines an ISR lock member.
 
 .. code-block:: c
 
-    #define RTEMS_INTERRUPT_LOCK_MEMBER( designator )
+    RTEMS_INTERRUPT_LOCK_MEMBER( designator );
 
 .. rubric:: PARAMETERS:
 
@@ -1031,7 +1045,7 @@ Defines an ISR lock object reference.
 
 .. code-block:: c
 
-    #define RTEMS_INTERRUPT_LOCK_REFERENCE( designator, target )
+    RTEMS_INTERRUPT_LOCK_REFERENCE( designator, rtems_interrupt_lock *target );
 
 .. rubric:: PARAMETERS:
 
@@ -1064,7 +1078,11 @@ Statically initializes an interrupt entry object.
 
 .. code-block:: c
 
-    #define RTEMS_INTERRUPT_ENTRY_INITIALIZER( routine, arg, info )
+    RTEMS_INTERRUPT_ENTRY_INITIALIZER(
+      rtems_interrupt_handler routine,
+      void                   *arg,
+      const char             *info
+    );
 
 .. rubric:: PARAMETERS:
 
diff --git a/c-user/message/directives.rst b/c-user/message/directives.rst
index 70a22d3..9cb88e2 100644
--- a/c-user/message/directives.rst
+++ b/c-user/message/directives.rst
@@ -1072,7 +1072,7 @@ the specified maximum size.
 
 .. code-block:: c
 
-    #define RTEMS_MESSAGE_QUEUE_BUFFER( maximum_message_size )
+    RTEMS_MESSAGE_QUEUE_BUFFER( size_t maximum_message_size );
 
 .. rubric:: PARAMETERS:
 
diff --git a/c-user/object-services/directives.rst b/c-user/object-services/directives.rst
index c975c75..ba23add 100644
--- a/c-user/object-services/directives.rst
+++ b/c-user/object-services/directives.rst
@@ -879,7 +879,11 @@ MPCI node components.
 
 .. code-block:: c
 
-    #define RTEMS_OBJECT_ID_INITIAL( api, class, node )
+    rtems_id RTEMS_OBJECT_ID_INITIAL(
+      uint32_t api,
+      uint32_t class,
+      uint32_t node
+    );
 
 .. rubric:: PARAMETERS:
 
diff --git a/c-user/task/directives.rst b/c-user/task/directives.rst
index b78aaa9..05b035c 100644
--- a/c-user/task/directives.rst
+++ b/c-user/task/directives.rst
@@ -1991,7 +1991,7 @@ Gets the recommended task storage area size for the size and task attributes.
 
 .. code-block:: c
 
-    #define RTEMS_TASK_STORAGE_SIZE( size, attributes )
+    size_t RTEMS_TASK_STORAGE_SIZE( size_t size, rtems_attribute attributes );
 
 .. rubric:: PARAMETERS:
 



More information about the vc mailing list