nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acas...@apache.org
Subject [incubator-nuttx] 02/02: Run all .c and .h files modifed by the PR though nxstyle.
Date Sat, 09 May 2020 19:58:52 GMT
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 3ac629bdfb76f7850ad56959ace787a7775e2a50
Author: Gregory Nutt <gnutt@nuttx.org>
AuthorDate: Sat May 9 13:25:30 2020 -0600

    Run all .c and .h files modifed by the PR though nxstyle.
---
 arch/arm/src/armv6-m/arm_reprioritizertr.c | 15 +++----
 arch/arm/src/armv6-m/arm_saveusercontext.S | 39 ++++++------------
 arch/arm/src/armv7-m/arm_reprioritizertr.c | 15 +++----
 arch/arm/src/armv8-m/arm_reprioritizertr.c | 15 +++----
 sched/irq/irq_csection.c                   | 63 ++++++++++++------------------
 sched/sched/sched_reprioritize.c           | 45 +++++++--------------
 sched/sched/sched_timerexpiration.c        | 14 +++----
 sched/sched/sched_unlock.c                 | 45 +++++++--------------
 8 files changed, 99 insertions(+), 152 deletions(-)

diff --git a/arch/arm/src/armv6-m/arm_reprioritizertr.c b/arch/arm/src/armv6-m/arm_reprioritizertr.c
index 993dd02..712b5dd 100644
--- a/arch/arm/src/armv6-m/arm_reprioritizertr.c
+++ b/arch/arm/src/armv6-m/arm_reprioritizertr.c
@@ -82,8 +82,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
       sinfo("TCB=%p PRI=%d\n", tcb, priority);
 
       /* Remove the tcb task from the ready-to-run list.
-       * nxsched_remove_readytorun will return true if we just removed the head
-       * of the ready to run list.
+       * nxsched_remove_readytorun will return true if we just removed the
+       * head of the ready to run list.
        */
 
       switch_needed = nxsched_remove_readytorun(tcb);
@@ -92,11 +92,12 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
 
       tcb->sched_priority = (uint8_t)priority;
 
-      /* Return the task to the ready-to-run task list. nxsched_add_readytorun
-       * will return true if the task was added to the head of ready-to-run
-       * list.  We will need to perform a context switch only if the
-       * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one
-       * the calls changes the head of the ready-to-run list).
+      /* Return the task to the ready-to-run task list.
+       * nxsched_add_readytorun() will return true if the task was added to
+       * the head of ready-to-run list.  We will need to perform a context
+       * switch only if the EXCLUSIVE or of the two calls is non-zero (i.e.,
+       * one and only one the calls changes the head of the ready-to-run
+       * list).
        */
 
       switch_needed ^= nxsched_add_readytorun(tcb);
diff --git a/arch/arm/src/armv6-m/arm_saveusercontext.S b/arch/arm/src/armv6-m/arm_saveusercontext.S
index de10d80..842788a 100644
--- a/arch/arm/src/armv6-m/arm_saveusercontext.S
+++ b/arch/arm/src/armv6-m/arm_saveusercontext.S
@@ -1,35 +1,20 @@
 /************************************************************************************
  * arch/arm/src/armv6-m/arm_saveusercontext.S
  *
- *   Copyright (C) 2013 Gregory Nutt. All rights reserved.
- *   Author: Gregory Nutt <gnutt@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
  *
  ************************************************************************************/
 
diff --git a/arch/arm/src/armv7-m/arm_reprioritizertr.c b/arch/arm/src/armv7-m/arm_reprioritizertr.c
index 3695be7..a9fcc57 100644
--- a/arch/arm/src/armv7-m/arm_reprioritizertr.c
+++ b/arch/arm/src/armv7-m/arm_reprioritizertr.c
@@ -82,8 +82,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
       sinfo("TCB=%p PRI=%d\n", tcb, priority);
 
       /* Remove the tcb task from the ready-to-run list.
-       * nxsched_remove_readytorun will return true if we just removed the head
-       * of the ready to run list.
+       * nxsched_remove_readytorun will return true if we just removed the
+       * head of the ready to run list.
        */
 
       switch_needed = nxsched_remove_readytorun(tcb);
@@ -92,11 +92,12 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
 
       tcb->sched_priority = (uint8_t)priority;
 
-      /* Return the task to the ready-to-run task list. nxsched_add_readytorun
-       * will return true if the task was added to the head of ready-to-run
-       * list.  We will need to perform a context switch only if the
-       * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one
-       * the calls changes the head of the ready-to-run list).
+      /* Return the task to the ready-to-run task list.
+       * nxsched_add_readytorun() will return true if the task was added to
+       * the head of ready-to-run list.  We will need to perform a context
+       * switch only if the EXCLUSIVE or of the two calls is non-zero (i.e.,
+       * one and only one the calls changes the head of the ready-to-run
+       * list).
        */
 
       switch_needed ^= nxsched_add_readytorun(tcb);
diff --git a/arch/arm/src/armv8-m/arm_reprioritizertr.c b/arch/arm/src/armv8-m/arm_reprioritizertr.c
index 2c1203a..0fcdf7b 100755
--- a/arch/arm/src/armv8-m/arm_reprioritizertr.c
+++ b/arch/arm/src/armv8-m/arm_reprioritizertr.c
@@ -82,8 +82,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
       sinfo("TCB=%p PRI=%d\n", tcb, priority);
 
       /* Remove the tcb task from the ready-to-run list.
-       * nxsched_remove_readytorun will return true if we just removed the head
-       * of the ready to run list.
+       * nxsched_remove_readytorun() will return true if we just removed the
+       * head of the ready to run list.
        */
 
       switch_needed = nxsched_remove_readytorun(tcb);
@@ -92,11 +92,12 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
 
       tcb->sched_priority = (uint8_t)priority;
 
-      /* Return the task to the ready-to-run task list. nxsched_add_readytorun
-       * will return true if the task was added to the head of ready-to-run
-       * list.  We will need to perform a context switch only if the
-       * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one
-       * the calls changes the head of the ready-to-run list).
+      /* Return the task to the ready-to-run task list.
+       * nxsched_add_readytorun() will return true if the task was added to
+       * the head of ready-to-run list.  We will need to perform a context
+       * switch only if the EXCLUSIVE or of the two calls is non-zero (i.e.,
+       * one and only one the calls changes the head of the ready-to-run
+       * list).
        */
 
       switch_needed ^= nxsched_add_readytorun(tcb);
diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c
index dea9427..2658d5e 100644
--- a/sched/irq/irq_csection.c
+++ b/sched/irq/irq_csection.c
@@ -1,35 +1,20 @@
 /****************************************************************************
  * sched/irq/irq_csection.c
  *
- *   Copyright (C) 2016-2018 Gregory Nutt. All rights reserved.
- *   Author: Gregory Nutt <gnutt@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
  *
  ****************************************************************************/
 
@@ -295,8 +280,8 @@ try_again:
 
               g_cpu_nestcount[cpu] = 1;
 
-              /* Also set the CPU bit so that other CPUs will be aware that this
-               * CPU holds the critical section.
+              /* Also set the CPU bit so that other CPUs will be aware that
+               * this CPU holds the critical section.
                */
 
               spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock,
@@ -322,8 +307,8 @@ try_again:
               /* Yes... make sure that the spinlock is set and increment the
                * IRQ lock count.
                *
-               * NOTE: If irqcount > 0 then (1) we are in a critical section, and
-               * (2) this CPU should hold the lock.
+               * NOTE: If irqcount > 0 then (1) we are in a critical section,
+               * and (2) this CPU should hold the lock.
                */
 
               DEBUGASSERT(spin_islocked(&g_cpu_irqlock) &&
@@ -544,13 +529,15 @@ void leave_critical_section(irqstate_t flags)
 
               if ((g_cpu_irqset & ~(1 << cpu)) == 0)
                 {
-                  /* Yes.. Check if there are pending tasks and that pre-emption
-                   * is also enabled.  This is necessary because we may have
-                   * deferred the up_release_pending() call in sched_unlock()
-                   * because we were within a critical section then.
+                  /* Yes.. Check if there are pending tasks and that pre-
+                   * emption is also enabled.  This is necessary because we
+                   * may have deferred the up_release_pending() call in
+                   * sched_unlock() because we were within a critical
+                   * section then.
                    */
 
-                  if (g_pendingtasks.head != NULL && !nxsched_islocked_global())
+                  if (g_pendingtasks.head != NULL &&
+                      !nxsched_islocked_global())
                     {
                       /* Release any ready-to-run tasks that have collected
                        * in g_pendingtasks.  NOTE: This operation has a very
@@ -596,7 +583,9 @@ void leave_critical_section(irqstate_t flags)
       FAR struct tcb_s *rtcb = this_task();
       DEBUGASSERT(rtcb != NULL);
 
-      /* Have we left entered the critical section?  Or are we still nested. */
+      /* Have we left entered the critical section?  Or are we still
+       * nested.
+       */
 
       DEBUGASSERT(rtcb->irqcount > 0);
       if (--rtcb->irqcount <= 0)
diff --git a/sched/sched/sched_reprioritize.c b/sched/sched/sched_reprioritize.c
index 6312df3..b0d8fd2 100644
--- a/sched/sched/sched_reprioritize.c
+++ b/sched/sched/sched_reprioritize.c
@@ -1,35 +1,20 @@
 /****************************************************************************
  * sched/sched/sched_reprioritize.c
  *
- *   Copyright (C) 2009, 2012, 2018 Gregory Nutt. All rights reserved.
- *   Author: Gregory Nutt <gnutt@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
  *
  ****************************************************************************/
 
@@ -80,9 +65,9 @@
 
 int nxsched_reprioritize(FAR struct tcb_s *tcb, int sched_priority)
 {
-  /* This function is equivalent to nxsched_set_priority() BUT it also has the
-   * side effect of discarding all priority inheritance history.  This is
-   * done only on explicit, user-initiated reprioritization.
+  /* This function is equivalent to nxsched_set_priority() BUT it also has
+   * the side effect of discarding all priority inheritance history.  This
+   * is done only on explicit, user-initiated reprioritization.
    */
 
   int ret = nxsched_set_priority(tcb, sched_priority);
diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c
index d3899d9..8677271 100644
--- a/sched/sched/sched_timerexpiration.c
+++ b/sched/sched/sched_timerexpiration.c
@@ -725,13 +725,13 @@ void nxsched_resume_timer(void)
  *   - When pre-emption is re-enabled.  A previous time slice may have
  *     expired while pre-emption was enabled and now needs to be executed.
  *
- *   In the original design, it was also planned that nxsched_reassess_timer()
- *   be called whenever there was a change at the head of the ready-to-run
- *   list.  That call was intended to establish a new time-slice for the
- *   newly activated task or to stop the timer if time-slicing is no longer
- *   needed.  However, it turns out that that solution is too fragile:  The
- *   system is too vulnerable at the time that the ready-to-run list is
- *   modified in order to muck with timers.
+ *   In the original design, it was also planned that
+ *   nxsched_reassess_timer() be called whenever there was a change at the
+ *   head of the ready-to-run list.  That call was intended to establish a
+ *   new time-slice for the newly activated task or to stop the timer if
+ *   time-slicing is no longer needed.  However, it turns out that that
+ *   solution is too fragile:  The system is too vulnerable at the time
+ *   that the ready-to-run list is modified in order to muck with timers.
  *
  *   The kludge/work-around is simple to keep the timer running all of the
  *   time with an interval of no more than the timeslice interval.  If we
diff --git a/sched/sched/sched_unlock.c b/sched/sched/sched_unlock.c
index ea32ff8..857c682 100644
--- a/sched/sched/sched_unlock.c
+++ b/sched/sched/sched_unlock.c
@@ -1,36 +1,20 @@
 /****************************************************************************
  * sched/sched/sched_unlock.c
  *
- *   Copyright (C) 2007, 2009, 2014, 2016, 2018 Gregory Nutt. All rights
- *     reserved.
- *   Author: Gregory Nutt <gnutt@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
  *
  ****************************************************************************/
 
@@ -142,8 +126,9 @@ int sched_unlock(void)
            * There are certain conditions that we must avoid by preventing
            * releasing the pending tasks while within the critical section
            * of other CPUs.  This logic does that and there is matching
-           * logic in nxsched_add_readytorun to avoid starting new tasks within
-           * the critical section (unless the CPU is the holder of the lock).
+           * logic in nxsched_add_readytorun to avoid starting new tasks
+           * within the critical section (unless the CPU is the holder of
+           * the lock).
            *
            * REVISIT: If this CPU is only one that holds the IRQ lock, then
            * we should go ahead and release the pending tasks.  See the logic


Mime
View raw message