[rtems commit] leon3/shmsupp: Fix warnings & comment clean up

Joel Sherrill joel at rtems.org
Tue Jan 8 18:32:31 UTC 2013


Module:    rtems
Branch:    master
Commit:    4967f6b81894b364f345997e894be380d9a3bd4e
Changeset: http://git.rtems.org/rtems/commit/?id=4967f6b81894b364f345997e894be380d9a3bd4e

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Tue Jan  8 12:37:05 2013 -0600

leon3/shmsupp: Fix warnings & comment clean up

---

 c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c |   48 ++++++-------------------
 c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c   |   25 +++++--------
 c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c  |   28 ++++++++-------
 3 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c
index 60b47ca..d70f495 100644
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c
+++ b/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c
@@ -1,27 +1,11 @@
-/*  void Shm_Get_configuration( localnode, &shmcfg )
+/**
+ *  @file
  *
- *  This routine initializes, if necessary, and returns a pointer
- *  to the Shared Memory Configuration Table for the XXX target.
- *
- *  INPUT PARAMETERS:
- *    localnode - local node number
- *    shmcfg    - address of pointer to SHM Config Table
- *
- *  OUTPUT PARAMETERS:
- *    *shmcfg   - pointer to SHM Config Table
- *
-XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
- *  NOTES:  The XYZ does not have an interprocessor interrupt.
- *
- *          The following table illustrates the configuration limitations:
- *
- *                                   BUS     MAX
- *                          MODE    ENDIAN  NODES
- *                        ========= ====== =======
- *                         POLLED    BIG    2+
- *                        INTERRUPT **** NOT SUPPORTED ****
- *
- *  COPYRIGHT (c) 1989-1999.
+ *  LEON3 Shared Memory Driver Support - Configuration
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2012.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -35,7 +19,6 @@ XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
 
 /* multiprocessor communications interface (MPCI) table */
 
-
 extern rtems_mpci_entry Shm_Get_packet(
   rtems_packet_prefix **
 );
@@ -56,19 +39,11 @@ extern rtems_mpci_entry Shm_Send_packet(
 );
 
 
-/* rtems_mpci_table MPCI_table  = { */
-/*   100000,                     /\* default timeout value in ticks *\/ */
-/*   MAX_PACKET_SIZE,            /\* maximum packet size *\/ */
-/*   Shm_Initialization,         /\* initialization procedure   *\/ */
-/*   Shm_Get_packet,             /\* get packet procedure       *\/ */
-/*   Shm_Return_packet,          /\* return packet procedure    *\/ */
-/*   Shm_Send_packet,            /\* packet send procedure      *\/ */
-/*   Shm_Receive_packet          /\* packet receive procedure   *\/ */
-/* }; */
-
-
 /*
- *  configured if currently polling of interrupt driven
+ *  configured if currently polling or interrupt driven
+ *
+ *  NOTE: Code in mpisr.c is commented out. Fix when interrupt mode
+ *        is added.
  */
 
 #define INTERRUPT 0        /* XXX: */
@@ -95,7 +70,6 @@ void Shm_Get_configuration(
   shm_config_table **shmcfg
 )
 {
-  extern rtems_configuration_table Configuration;
   int i;
   unsigned int tmp;
 
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c
index be3f64d..91e0b6d 100644
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c
+++ b/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c
@@ -1,12 +1,17 @@
-/*  Shared Memory Lock Routines
+/**
+ *  @file
+ *
+ *  LEON3 Shared Memory Lock Routines
  *
  *  This shared memory locked queue support routine need to be
  *  able to lock the specified locked queue.  Interrupts are
  *  disabled while the queue is locked to prevent preemption
  *  and deadlock when two tasks poll for the same lock.
  *  previous level.
- *
- *  COPYRIGHT (c) 1989-1999.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2012.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -20,11 +25,8 @@
 
 
 /*
- *  Shm_Initialize_lock
- *
  *  Initialize the lock for the specified locked queue.
  */
-
 void Shm_Initialize_lock(
   Shm_Locked_queue_Control *lq_cb
 )
@@ -32,12 +34,12 @@ void Shm_Initialize_lock(
   lq_cb->lock = LQ_UNLOCKED;
 }
 
-/*  void _Shm_Lock( &lq_cb )
- *
+/*
  *  This shared memory locked queue support routine locks the
  *  specified locked queue.  It disables interrupts to prevent
  *  a deadlock condition.
  */
+extern unsigned int LEON3_Atomic_Swap(uint32_t value, uint32_t *address);
 
 __asm__ (
     ".text\n"
@@ -63,16 +65,9 @@ void Shm_Lock(
     Shm_isrstat = isr_level;
     while ( lock_value ) {
       lock_value = LEON3_Atomic_Swap(lock_value, lockptr);
-/*       __asm__ volatile( "" */
-/*                          : "=r" (lockptr), "=r" (lock_value) */
-/*                          : "0" (lockptr),  "1" (lock_value) */
-/*                   ); */
       /*
        *  If not available, then may want to delay to reduce load on lock.
        */
-
-/*       if ( lock_value ) */
-/*         rtems_bsp_delay( 10 );   /\* approximately 10 microseconds *\/ */
    }
 }
 
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c
index 6a05dd6..6499634 100644
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c
+++ b/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c
@@ -1,6 +1,11 @@
-/*  Shm_isr_nobsp()
+/**
+ *  @file
  *
- *  COPYRIGHT (c) 1989-1999.
+ *  LEON3 Shared Memory Driver Interrupt Support
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2012.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -12,7 +17,7 @@
 #include <bsp.h>
 #include <shm_driver.h>
 
-rtems_isr Shm_isr_nobsp( void )
+void Shm_isr(void)
 {
   /*
    *  If this routine has to do anything other than the mpisr.c
@@ -22,25 +27,22 @@ rtems_isr Shm_isr_nobsp( void )
    *  must be cleared.
    *
    *  If the generic mpisr.c satisifies your requirements, then
-   *  remove this routine from your target's shmsupp/mpisb.c file.
+   *  remove this routine from your target's shmsupp/mpisr.c file.
    *  Then simply install the generic Shm_isr in the Shm_setvec
    *  routine below.
    */
 }
 
-/*  Shm_setvec
- *
+/*
  *  This driver routine sets the SHM interrupt vector to point to the
  *  driver's SHM interrupt service routine.
- *
- *  Input parameters:  NONE
- *
- *  Output parameters: NONE
  */
-
-
 void Shm_setvec( void )
 {
+  /*
+   * Interrupt driven mode is not currently supported.
+   * This is thought to be the interrupt to use.
+   */
   LEON_Unmask_interrupt(LEON3_MP_IRQ);
-  set_vector(Shm_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
+  set_vector((rtems_isr_entry) Shm_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
 }




More information about the vc mailing list