You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/05/09 17:19:20 UTC
[incubator-nuttx] 02/02: Run nxstyle against all .c and .h files
modified by this PR.
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 4b44b628ea40fcc69c358959b1a4fff632d7d141
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Sat May 9 09:05:29 2020 -0600
Run nxstyle against all .c and .h files modified by this PR.
All complaints fixed except for those that were not possible to fix:
- Used of Mixed case identifier in ESP32 files. These are references to Expressif ROM functions which are outside of the scope of NuttX.
---
arch/arm/src/armv7-a/arm_addrenv_shm.c | 43 +-
arch/arm/src/armv7-a/arm_pgalloc.c | 55 +-
arch/avr/src/avr/up_releasepending.c | 40 +-
arch/avr/src/avr/up_reprioritizertr.c | 44 +-
arch/avr/src/avr32/up_releasepending.c | 40 +-
arch/avr/src/avr32/up_reprioritizertr.c | 44 +-
arch/hc/src/common/up_blocktask.c | 51 +-
arch/hc/src/common/up_exit.c | 42 +-
arch/hc/src/common/up_releasepending.c | 40 +-
arch/hc/src/common/up_reprioritizertr.c | 42 +-
arch/hc/src/common/up_unblocktask.c | 51 +-
arch/mips/src/mips32/mips_swint0.c | 36 +-
arch/misoc/src/lm32/lm32_releasepending.c | 1 -
arch/misoc/src/lm32/lm32_reprioritizertr.c | 46 +-
arch/misoc/src/lm32/lm32_swint.c | 63 +-
arch/misoc/src/minerva/minerva_blocktask.c | 12 +-
arch/misoc/src/minerva/minerva_exit.c | 4 +-
arch/misoc/src/minerva/minerva_releasepending.c | 8 +-
arch/misoc/src/minerva/minerva_reprioritizertr.c | 63 +-
arch/misoc/src/minerva/minerva_swint.c | 39 +-
arch/misoc/src/minerva/minerva_unblocktask.c | 16 +-
arch/or1k/src/common/up_releasepending.c | 40 +-
arch/or1k/src/common/up_reprioritizertr.c | 42 +-
arch/or1k/src/common/up_unblocktask.c | 44 +-
arch/renesas/src/common/up_blocktask.c | 54 +-
arch/renesas/src/common/up_exit.c | 44 +-
arch/renesas/src/common/up_releasepending.c | 40 +-
arch/renesas/src/common/up_reprioritizertr.c | 48 +-
arch/renesas/src/common/up_unblocktask.c | 51 +-
arch/x86/src/common/up_blocktask.c | 58 +-
arch/x86/src/common/up_exit.c | 42 +-
arch/x86/src/common/up_releasepending.c | 42 +-
arch/x86/src/common/up_reprioritizertr.c | 44 +-
arch/x86/src/common/up_unblocktask.c | 51 +-
arch/x86_64/src/common/up_reprioritizertr.c | 3 +-
arch/xtensa/src/common/xtensa_reprioritizertr.c | 43 +-
arch/xtensa/src/esp32/esp32_cpustart.c | 41 +-
arch/z80/src/ez80/ez80_serial.c.SAVE | 850 +++++++++++++++++++++++
boards/sim/sim/sim/src/sim_touchscreen.c | 40 +-
fs/aio/aioc_contain.c | 4 +-
fs/procfs/fs_procfs.c | 50 +-
fs/procfs/fs_procfsproc.c | 146 ++--
mm/shm/shmdt.c | 42 +-
net/socket/net_sockets.c | 42 +-
sched/group/group_continue.c | 41 +-
sched/pthread/pthread_cancel.c | 56 +-
sched/pthread/pthread_condtimedwait.c | 4 +-
sched/pthread/pthread_join.c | 39 +-
sched/pthread/pthread_mutexconsistent.c | 43 +-
sched/pthread/pthread_mutexdestroy.c | 51 +-
sched/pthread/pthread_mutextrylock.c | 58 +-
sched/pthread/pthread_setaffinity.c | 43 +-
sched/pthread/pthread_setschedparam.c | 51 +-
sched/pthread/pthread_setschedprio.c | 47 +-
sched/sched/sched_foreach.c | 41 +-
sched/sched/sched_get_stackinfo.c | 2 +-
sched/sched/sched_getfiles.c | 45 +-
sched/sched/sched_getsockets.c | 47 +-
sched/sched/sched_getstreams.c | 45 +-
sched/sched/sched_gettcb.c | 33 +-
sched/sched/sched_releasetcb.c | 42 +-
sched/sched/sched_self.c | 41 +-
sched/sched/sched_setaffinity.c | 49 +-
sched/sched/sched_setscheduler.c | 42 +-
sched/sched/sched_timerexpiration.c | 43 +-
sched/task/task_init.c | 3 +-
sched/task/task_reparent.c | 43 +-
sched/task/task_restart.c | 44 +-
68 files changed, 1858 insertions(+), 1736 deletions(-)
diff --git a/arch/arm/src/armv7-a/arm_addrenv_shm.c b/arch/arm/src/armv7-a/arm_addrenv_shm.c
index 2792cc9..a9a3494 100644
--- a/arch/arm/src/armv7-a/arm_addrenv_shm.c
+++ b/arch/arm/src/armv7-a/arm_addrenv_shm.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/arm/src/armv7/arm_addrenv_shm.c
*
- * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -110,7 +95,9 @@ int up_shmat(FAR uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
shmndx = (vaddr - CONFIG_ARCH_SHM_VBASE) >> SECTION_SHIFT;
- /* Has a level 1 page table entry been created for this virtual address */
+ /* Has a level 1 page table entry been created for this virtual
+ * address.
+ */
l1entry = group->tg_addrenv.shm[shmndx];
if (l1entry == NULL)
diff --git a/arch/arm/src/armv7-a/arm_pgalloc.c b/arch/arm/src/armv7-a/arm_pgalloc.c
index 2109e4f..c6babf5 100644
--- a/arch/arm/src/armv7-a/arm_pgalloc.c
+++ b/arch/arm/src/armv7-a/arm_pgalloc.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/arm/src/armv7/arm_pgalloc.c
*
- * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -91,8 +76,10 @@ static uintptr_t alloc_pgtable(void)
/* Temporarily map the page into the virtual address space */
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
- mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS);
- l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
+ mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
+ MMU_MEMFLAGS);
+ l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
+ (paddr & SECTION_MASK));
#endif
/* Initialize the page table */
@@ -156,7 +143,9 @@ static int get_pgtable(FAR group_addrenv_t *addrenv, uintptr_t vaddr)
paddr = alloc_pgtable();
if (paddr != 0)
{
- /* Set the new level 1 page table entry in the address environment. */
+ /* Set the new level 1 page table entry in the address
+ * environment.
+ */
l1entry = paddr | MMU_L1_PGTABFLAGS;
addrenv->heap[hpndx] = (FAR uintptr_t *)l1entry;
@@ -262,8 +251,10 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages)
*/
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
- mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS);
- l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
+ mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
+ MMU_MEMFLAGS);
+ l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
+ (paddr & SECTION_MASK));
#endif
/* Back up L2 entry with physical memory */
diff --git a/arch/avr/src/avr/up_releasepending.c b/arch/avr/src/avr/up_releasepending.c
index 47eff4b..9f7ee47 100644
--- a/arch/avr/src/avr/up_releasepending.c
+++ b/arch/avr/src/avr/up_releasepending.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/avr/src/avr/up_releasepending.c
*
- * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -70,7 +55,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
diff --git a/arch/avr/src/avr/up_reprioritizertr.c b/arch/avr/src/avr/up_reprioritizertr.c
index 10dc23b..a883bab 100644
--- a/arch/avr/src/avr/up_reprioritizertr.c
+++ b/arch/avr/src/avr/up_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/avr/src/avr/up_reprioritizertr.c
*
- * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -178,8 +163,9 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* up_switchcontext forces a context switch to the task at the
* head of the ready-to-run list. It does not 'return' in the
- * normal sense. When it does return, it is because the blocked
- * task is again ready to run and has execution priority.
+ * normal sense. When it does return, it is because the
+ * blocked task is again ready to run and has execution
+ * priority.
*/
}
}
diff --git a/arch/avr/src/avr32/up_releasepending.c b/arch/avr/src/avr32/up_releasepending.c
index d67efc0..f25b628 100644
--- a/arch/avr/src/avr32/up_releasepending.c
+++ b/arch/avr/src/avr32/up_releasepending.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/avr/src/avr32/up_releasepending.c
*
- * Copyright (C) 2010, 2014-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -71,7 +56,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
diff --git a/arch/avr/src/avr32/up_reprioritizertr.c b/arch/avr/src/avr32/up_reprioritizertr.c
index 907e990..c8293de 100644
--- a/arch/avr/src/avr32/up_reprioritizertr.c
+++ b/arch/avr/src/avr32/up_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/avr/src/avr32/up_reprioritizertr.c
*
- * Copyright (C) 2010, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -192,8 +177,9 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* up_switchcontext forces a context switch to the task at the
* head of the ready-to-run list. It does not 'return' in the
- * normal sense. When it does return, it is because the blocked
- * task is again ready to run and has execution priority.
+ * normal sense. When it does return, it is because the
+ * blocked task is again ready to run and has execution
+ * priority.
*/
}
}
diff --git a/arch/hc/src/common/up_blocktask.c b/arch/hc/src/common/up_blocktask.c
index c78a816..dc94aaa 100644
--- a/arch/hc/src/common/up_blocktask.c
+++ b/arch/hc/src/common/up_blocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/hc/src/common/up_blocktask.c
*
- * Copyright (C) 2010, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -153,13 +138,13 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
rtcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
- */
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the new
+ * thread at the head of the ready-to-run list.
+ */
- group_addrenv(rtcb);
+ group_addrenv(rtcb);
#endif
/* Reset scheduler parameters */
diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c
index 85eddee..6795b5b 100644
--- a/arch/hc/src/common/up_exit.c
+++ b/arch/hc/src/common/up_exit.c
@@ -1,36 +1,20 @@
/****************************************************************************
* arch/hc/src/common/up_exit.c
*
- * Copyright (C) 2011, 2013-2014, 2017-2018 Gregory Nutt. All rights
- * reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -141,7 +125,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
void _exit(int status)
{
- struct tcb_s* tcb = this_task();
+ struct tcb_s *tcb = this_task();
/* Make sure that we are in a critical section with local interrupts.
* The IRQ state will be restored when the next task is started.
diff --git a/arch/hc/src/common/up_releasepending.c b/arch/hc/src/common/up_releasepending.c
index cd61185..8e82797 100644
--- a/arch/hc/src/common/up_releasepending.c
+++ b/arch/hc/src/common/up_releasepending.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/hc/src/common/up_releasepending.c
*
- * Copyright (C) 2010, 2014-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -70,7 +55,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
diff --git a/arch/hc/src/common/up_reprioritizertr.c b/arch/hc/src/common/up_reprioritizertr.c
index 891d867..74177a3 100644
--- a/arch/hc/src/common/up_reprioritizertr.c
+++ b/arch/hc/src/common/up_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/hc/src/common/up_reprioritizertr.c
*
- * Copyright (C) 2010, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -165,7 +150,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* Copy the exception context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
diff --git a/arch/hc/src/common/up_unblocktask.c b/arch/hc/src/common/up_unblocktask.c
index 06f7d9a..7fe7b15 100644
--- a/arch/hc/src/common/up_unblocktask.c
+++ b/arch/hc/src/common/up_unblocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/hc/src/common/up_unblocktask.c
*
- * Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -139,13 +124,13 @@ void up_unblock_task(struct tcb_s *tcb)
rtcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
- */
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the new
+ * thread at the head of the ready-to-run list.
+ */
- group_addrenv(rtcb);
+ group_addrenv(rtcb);
#endif
/* Update scheduler parameters */
diff --git a/arch/mips/src/mips32/mips_swint0.c b/arch/mips/src/mips32/mips_swint0.c
index 6202537..172481a 100644
--- a/arch/mips/src/mips32/mips_swint0.c
+++ b/arch/mips/src/mips32/mips_swint0.c
@@ -69,10 +69,12 @@ static void up_registerdump(const uint32_t *regs)
svcinfo("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n",
regs[REG_AT], regs[REG_V0], regs[REG_V1], regs[REG_A0],
regs[REG_A1], regs[REG_A2], regs[REG_A3]);
- svcinfo("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n",
+ svcinfo("T0:%08x T1:%08x T2:%08x T3:%08x "
+ "T4:%08x T5:%08x T6:%08x T7:%08x\n",
regs[REG_T0], regs[REG_T1], regs[REG_T2], regs[REG_T3],
regs[REG_T4], regs[REG_T5], regs[REG_T6], regs[REG_T7]);
- svcinfo("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n",
+ svcinfo("S0:%08x S1:%08x S2:%08x S3:%08x "
+ "S4:%08x S5:%08x S6:%08x S7:%08x\n",
regs[REG_S0], regs[REG_S1], regs[REG_S2], regs[REG_S3],
regs[REG_S4], regs[REG_S5], regs[REG_S6], regs[REG_S7]);
#ifdef MIPS32_SAVE_GP
@@ -101,22 +103,30 @@ static void up_registerdump(const uint32_t *regs)
static void dispatch_syscall(void) naked_function;
static void dispatch_syscall(void)
{
-# error "Missing logic"
+#error "Missing logic"
/* Refer to arch/arm/src/armv7-m/up_svcall.h for how this is done for ARM */
-# if 0
+#if 0 /* REVISIT */
__asm__ __volatile__
(
- Save registers
- Get the base of the stub lookup table
- Get the offset of the stub for this syscall
- Load the entry of the stub for this syscall
- Call the stub
- Restore registers
- Return from the syscall
+
+ /* Save registers */
+
+ /* Get the base of the stub lookup table */
+
+ /* Get the offset of the stub for this syscall */
+
+ /* Load the entry of the stub for this syscall */
+
+ /* Call the stub */
+
+ /* Restore registers */
+
+ /* Return from the syscall */
+
);
-# endif
+#endif
}
#endif
@@ -286,7 +296,7 @@ int up_swint0(int irq, FAR void *context, FAR void *arg)
}
/* Report what happened. That might difficult in the case of a context
- * switch
+ * switch.
*/
#ifdef CONFIG_DEBUG_SYSCALL_INFO
diff --git a/arch/misoc/src/lm32/lm32_releasepending.c b/arch/misoc/src/lm32/lm32_releasepending.c
index b488092..be20f9a 100644
--- a/arch/misoc/src/lm32/lm32_releasepending.c
+++ b/arch/misoc/src/lm32/lm32_releasepending.c
@@ -74,7 +74,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
diff --git a/arch/misoc/src/lm32/lm32_reprioritizertr.c b/arch/misoc/src/lm32/lm32_reprioritizertr.c
index 2a7bfc0..aebdee3 100644
--- a/arch/misoc/src/lm32/lm32_reprioritizertr.c
+++ b/arch/misoc/src/lm32/lm32_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/misoc/src/lm32/lm32_reprioritizertr.c
*
- * Copyright (C) 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -138,7 +123,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
nxsched_suspend_scheduler(rtcb);
- /* Are we in an interrupt handler? */
+ /* Are we in an interrupt handler? */
if (g_current_regs)
{
@@ -194,8 +179,9 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* up_switchcontext forces a context switch to the task at the
* head of the ready-to-run list. It does not 'return' in the
- * normal sense. When it does return, it is because the blocked
- * task is again ready to run and has execution priority.
+ * normal sense. When it does return, it is because the
+ * blocked task is again ready to run and has execution
+ * priority.
*/
}
}
diff --git a/arch/misoc/src/lm32/lm32_swint.c b/arch/misoc/src/lm32/lm32_swint.c
index d909ca7..c88007a 100644
--- a/arch/misoc/src/lm32/lm32_swint.c
+++ b/arch/misoc/src/lm32/lm32_swint.c
@@ -66,20 +66,23 @@ static void up_registerdump(const uint32_t *regs)
#if 0
svcinfo("EPC:%08x\n",
regs[REG_EPC]);
- svcinfo("A0:%08x A1:%08x A2:%08x A3:%08x A4:%08x A5:%08x A6:%08x A7:%08x\n",
+ svcinfo("A0:%08x A1:%08x A2:%08x A3:%08x "
+ "A4:%08x A5:%08x A6:%08x A7:%08x\n",
regs[REG_A0], regs[REG_A1], regs[REG_A2], regs[REG_A3],
regs[REG_A4], regs[REG_A5], regs[REG_A6], regs[REG_A7]);
svcinfo("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x\n",
regs[REG_T0], regs[REG_T1], regs[REG_T2], regs[REG_T3],
regs[REG_T4], regs[REG_T5], regs[REG_T6]);
- svcinfo("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n",
+ svcinfo("S0:%08x S1:%08x S2:%08x S3:%08x "
+ "S4:%08x S5:%08x S6:%08x S7:%08x\n",
regs[REG_S0], regs[REG_S1], regs[REG_S2], regs[REG_S3],
regs[REG_S4], regs[REG_S5], regs[REG_S6], regs[REG_S7]);
svcinfo("S8:%08x S9:%08x S10:%08x S11:%08x\n",
regs[REG_S8], regs[REG_S9], regs[REG_S10], regs[REG_S11]);
#ifdef LM3232_SAVE_GP
svcinfo("GP:%08x SP:%08x FP:%08x TP:%08x RA:%08x\n",
- regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
+ regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP],
+ regs[REG_RA]);
#else
svcinfo("SP:%08x FP:%08x TP:%08x RA:%08x\n",
regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
@@ -102,19 +105,30 @@ static void up_registerdump(const uint32_t *regs)
static void dispatch_syscall(void) naked_function;
static void dispatch_syscall(void)
{
-# error "Missing logic"
-
-/* Refer to arch/arm/src/armv7-m/up_svcall.h for how this is done for ARM */
-/* __asm__ __volatile__ */
-/* ( */
-/* Save registers */
-/* Get the base of the stub lookup table */
-/* Get the offset of the stub for this syscall */
-/* Load the entry of the stub for this syscall */
-/* Call the stub */
-/* Restore registers */
-/* Return from the syscall */
-/* ); */
+#error "Missing logic"
+
+ /* Refer to arch/arm/src/armv7-m/up_svcall.h for how this is done for ARM */
+
+#if 0 /* REVISIT */
+ __asm__ __volatile__
+ (
+
+ /* Save registers */
+
+ /* Get the base of the stub lookup table */
+
+ /* Get the offset of the stub for this syscall */
+
+ /* Load the entry of the stub for this syscall */
+
+ /* Call the stub */
+
+ /* Restore registers */
+
+ /* Return from the syscall */
+
+ );
+#endif
}
#endif
@@ -154,17 +168,19 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
{
/* A0=SYS_restore_context: This a restore context command:
*
- * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
+ * void up_fullcontextrestore(uint32_t *restoreregs)
+ * noreturn_function;
*
* At this point, the following values are saved in context:
*
* A0 = SYS_restore_context
* A1 = restoreregs
*
- * In this case, we simply need to set g_current_regs to restore register
- * area referenced in the saved R1. context == g_current_regs is the normal
- * exception return. By setting g_current_regs = context[R1], we force
- * the return to the saved context referenced in $a1.
+ * In this case, we simply need to set g_current_regs to restore
+ * register area referenced in the saved R1. context == g_current_regs
+ * is the normal exception return. By setting g_current_regs =
+ * context[R1], we force the return to the saved context referenced in
+ * $a1.
*/
case SYS_restore_context:
@@ -282,7 +298,9 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
break;
}
- /* Report what happened. That might difficult in the case of a context switch */
+ /* Report what happened. That might difficult in the case of a context
+ * switch.
+ */
#ifdef CONFIG_DEBUG_SYSCALL_INFO
if (regs != g_current_regs)
@@ -296,7 +314,6 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
}
#endif
-
#if defined(CONFIG_ARCH_FPU) || defined(CONFIG_ARCH_ADDRENV)
/* Check for a context switch. If a context switch occurred, then
* g_current_regs will have a different value than it did on entry. If an
diff --git a/arch/misoc/src/minerva/minerva_blocktask.c b/arch/misoc/src/minerva/minerva_blocktask.c
index 174bc75..9233f70 100644
--- a/arch/misoc/src/minerva/minerva_blocktask.c
+++ b/arch/misoc/src/minerva/minerva_blocktask.c
@@ -145,15 +145,17 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
else
{
- /* Get the context of the task at the head of the ready to run list. */
+ /* Get the context of the task at the head of the ready to run
+ * list.
+ */
struct tcb_s *nexttcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously running
- * task is closed down gracefully (data caches dump, MMU flushed)
- * and set up the address environment for the new thread at the head
- * of the ready-to-run list.
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump, MMU
+ * flushed) and set up the address environment for the new thread
+ * at the head of the ready-to-run list.
*/
group_addrenv(nexttcb);
diff --git a/arch/misoc/src/minerva/minerva_exit.c b/arch/misoc/src/minerva/minerva_exit.c
index 930c9f6..9ab3840 100644
--- a/arch/misoc/src/minerva/minerva_exit.c
+++ b/arch/misoc/src/minerva/minerva_exit.c
@@ -164,8 +164,8 @@ void _exit(int status)
tcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously running task is
- * closed down gracefully (data caches dump, MMU flushed) and set up the
+ /* Make sure that the address environment for the previously running task
+ * is closed down gracefully (data caches dump, MMU flushed) and set up the
* address environment for the new thread at the head of the ready-to-run
* list.
*/
diff --git a/arch/misoc/src/minerva/minerva_releasepending.c b/arch/misoc/src/minerva/minerva_releasepending.c
index 9f0947a..e036d10 100644
--- a/arch/misoc/src/minerva/minerva_releasepending.c
+++ b/arch/misoc/src/minerva/minerva_releasepending.c
@@ -122,10 +122,10 @@ void up_release_pending(void)
struct tcb_s *nexttcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously running
- * task is closed down gracefully (data caches dump, MMU flushed)
- * and set up the address environment for the new thread at the head
- * of the ready-to-run list.
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump, MMU
+ * flushed) and set up the address environment for the new thread
+ * at the head of the ready-to-run list.
*/
group_addrenv(nexttcb);
diff --git a/arch/misoc/src/minerva/minerva_reprioritizertr.c b/arch/misoc/src/minerva/minerva_reprioritizertr.c
index c661e55..a6f4daf 100644
--- a/arch/misoc/src/minerva/minerva_reprioritizertr.c
+++ b/arch/misoc/src/minerva/minerva_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/misoc/src/minerva/minerva_reprioritizertr.c
*
- * Copyright (C) 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -99,8 +84,9 @@ 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. sched_removereadytorun
- * will return true if we just remove the head of the ready to run list.
+ /* Remove the tcb task from the ready-to-run list.
+ * sched_removereadytorun() will return true if we just remove the
+ * head of the ready to run list.
*/
switch_needed = sched_removereadytorun(tcb);
@@ -110,10 +96,10 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
tcb->sched_priority = (uint8_t) priority;
/* Return the task to the specified blocked task list.
- * sched_addreadytorun will return true if the task was added to the new
- * 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).
+ * sched_addreadytorun will return true if the task was added to the
+ * new 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 ^= sched_addreadytorun(tcb);
@@ -175,9 +161,9 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
#ifdef CONFIG_ARCH_ADDRENV
/* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump, MMU
- * flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the
+ * new thread at the head of the ready-to-run list.
*/
group_addrenv(nexttcb);
@@ -192,8 +178,9 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* up_switchcontext forces a context switch to the task at the
* head of the ready-to-run list. It does not 'return' in the
- * normal sense. When it does return, it is because the blocked
- * task is again ready to run and has execution priority.
+ * normal sense. When it does return, it is because the
+ * blocked task is again ready to run and has execution
+ * priority.
*/
}
}
diff --git a/arch/misoc/src/minerva/minerva_swint.c b/arch/misoc/src/minerva/minerva_swint.c
index f8f8902..b934d8e 100644
--- a/arch/misoc/src/minerva/minerva_swint.c
+++ b/arch/misoc/src/minerva/minerva_swint.c
@@ -65,13 +65,16 @@ static void up_registerdump(const uint32_t * regs)
{
#if 0
svcinfo("EPC:%08x\n", regs[REG_CSR_MEPC]);
- svcinfo("A0:%08x A1:%08x A2:%08x A3:%08x A4:%08x A5:%08x A6:%08x A7:%08x\n",
+ svcinfo("A0:%08x A1:%08x A2:%08x A3:%08x "
+ "A4:%08x A5:%08x A6:%08x A7:%08x\n",
regs[REG_A0], regs[REG_A1], regs[REG_A2], regs[REG_A3],
regs[REG_A4], regs[REG_A5], regs[REG_A6], regs[REG_A7]);
- svcinfo("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x\n",
+ svcinfo("T0:%08x T1:%08x T2:%08x T3:%08x "
+ "T4:%08x T5:%08x T6:%08x\n",
regs[REG_T0], regs[REG_T1], regs[REG_T2], regs[REG_T3],
regs[REG_T4], regs[REG_T5], regs[REG_T6]);
- svcinfo("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n",
+ svcinfo("S0:%08x S1:%08x S2:%08x S3:%08x "
+ "S4:%08x S5:%08x S6:%08x S7:%08x\n",
regs[REG_S0], regs[REG_S1], regs[REG_S2], regs[REG_S3],
regs[REG_S4], regs[REG_S5], regs[REG_S6], regs[REG_S7]);
svcinfo("S8:%08x S9:%08x S10:%08x S11:%08x\n",
@@ -104,23 +107,25 @@ static void dispatch_syscall(void) naked_function;
{
#error "Missing logic"
-/* Refer to arch/arm/src/armv7-m/up_svcall.h for how this is done for ARM */
+ /* Refer to arch/arm/src/armv7-m/up_svcall.h for how this is done for
+ * ARM
+ */
-/* __asm__ __volatile__ */
+ /* __asm__ __volatile__ */
-/* Save registers */
+ /* Save registers */
-/* Get the base of the stub lookup table */
+ /* Get the base of the stub lookup table */
-/* Get the offset of the stub for this syscall */
+ /* Get the offset of the stub for this syscall */
-/* Load the entry of the stub for this syscall */
+ /* Load the entry of the stub for this syscall */
-/* Call the stub */
+ /* Call the stub */
-/* Restore registers */
+ /* Restore registers */
-/* Return from the syscall */
+ /* Return from the syscall */
}
#endif
@@ -192,9 +197,9 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
break;
/* A0=SYS_syscall_return: This a switch context command: void
- * up_sycall_return(void); At this point, the following values are saved
- * in context: A0 = SYS_syscall_return We need to restore the saved
- * return address and return in unprivileged thread mode.
+ * up_sycall_return(void); At this point, the following values are
+ * saved in context: A0 = SYS_syscall_return We need to restore the
+ * saved return address and return in unprivileged thread mode.
*/
#ifdef CONFIG_BUILD_KERNEL
@@ -207,8 +212,8 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
DEBUGASSERT(index >= 0);
- /* Setup to return to the saved syscall return address in the original
- * mode.
+ /* Setup to return to the saved syscall return address in the
+ * original mode.
*/
g_current_regs[REG_CSR_MEPC] = rtcb->xcp.syscall[index].sysreturn;
diff --git a/arch/misoc/src/minerva/minerva_unblocktask.c b/arch/misoc/src/minerva/minerva_unblocktask.c
index 20eab94..65704f3 100644
--- a/arch/misoc/src/minerva/minerva_unblocktask.c
+++ b/arch/misoc/src/minerva/minerva_unblocktask.c
@@ -85,14 +85,14 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
- /* Add the task in the correct location in the prioritized ready-to-run task
- * list
+ /* Add the task in the correct location in the prioritized ready-to-run
+ * task list
*/
if (sched_addreadytorun(tcb))
{
- /* The currently active task has changed! We need to do a context switch
- * to the new task.
+ /* The currently active task has changed! We need to do a context
+ * switch to the new task.
*/
/* Update scheduler parameters */
@@ -138,10 +138,10 @@ void up_unblock_task(struct tcb_s *tcb)
struct tcb_s *nexttcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously running
- * task is closed down gracefully (data caches dump, MMU flushed)
- * and set up the address environment for the new thread at the
- * head of the ready-to-run list.
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump, MMU
+ * flushed) and set up the address environment for the new thread
+ * at the head of the ready-to-run list.
*/
group_addrenv(nexttcb);
diff --git a/arch/or1k/src/common/up_releasepending.c b/arch/or1k/src/common/up_releasepending.c
index e7072d8..1fe4ac6 100644
--- a/arch/or1k/src/common/up_releasepending.c
+++ b/arch/or1k/src/common/up_releasepending.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/or1k/src/common/up_releasepending.c
*
- * Copyright (C) 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -71,7 +56,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
diff --git a/arch/or1k/src/common/up_reprioritizertr.c b/arch/or1k/src/common/up_reprioritizertr.c
index 5b76459..1cea87c 100644
--- a/arch/or1k/src/common/up_reprioritizertr.c
+++ b/arch/or1k/src/common/up_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/or1k/src/common/up_reprioritizertr.c
*
- * Copyright (C) 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -165,7 +150,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* Copy the exception context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
diff --git a/arch/or1k/src/common/up_unblocktask.c b/arch/or1k/src/common/up_unblocktask.c
index c9ba803..95da315 100644
--- a/arch/or1k/src/common/up_unblocktask.c
+++ b/arch/or1k/src/common/up_unblocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/or1k/src/common/up_unblocktask.c
*
- * Copyright (C) 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -98,8 +83,11 @@ void up_unblock_task(struct tcb_s *tcb)
/* Are we in an interrupt handler? */
- //if (CURRENT_REGS)
+#if 0 /* REVISIT */
+ if (CURRENT_REGS)
+#else
if (0)
+#endif
{
/* Yes, then we have to do things differently.
* Just copy the CURRENT_REGS into the OLD rtcb.
diff --git a/arch/renesas/src/common/up_blocktask.c b/arch/renesas/src/common/up_blocktask.c
index ecc3f8d..3a643fc 100644
--- a/arch/renesas/src/common/up_blocktask.c
+++ b/arch/renesas/src/common/up_blocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/common/up_blocktask.c
*
- * Copyright (C) 2008-2009, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -140,7 +125,8 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
/* Copy the user C context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
@@ -152,13 +138,13 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
rtcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
- */
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the new
+ * thread at the head of the ready-to-run list.
+ */
- group_addrenv(rtcb);
+ group_addrenv(rtcb);
#endif
/* Reset scheduler parameters */
diff --git a/arch/renesas/src/common/up_exit.c b/arch/renesas/src/common/up_exit.c
index a752961..7e98ec5 100644
--- a/arch/renesas/src/common/up_exit.c
+++ b/arch/renesas/src/common/up_exit.c
@@ -1,36 +1,20 @@
/****************************************************************************
* arch/renesas/src/=common/up_exit.c
*
- * Copyright (C) 2008-2009, 2013-2014, 2017-2018 Gregory Nutt. All rights
- * reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -141,7 +125,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
void _exit(int status)
{
- struct tcb_s* tcb = this_task();
+ struct tcb_s *tcb = this_task();
/* Make sure that we are in a critical section with local interrupts.
* The IRQ state will be restored when the next task is started.
@@ -184,7 +168,7 @@ void _exit(int status)
nxsched_resume_scheduler(tcb);
- /* Then switch contexts */
+ /* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
}
diff --git a/arch/renesas/src/common/up_releasepending.c b/arch/renesas/src/common/up_releasepending.c
index 49cc32f..29caeb1 100644
--- a/arch/renesas/src/common/up_releasepending.c
+++ b/arch/renesas/src/common/up_releasepending.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/common/up_releasepending.c
*
- * Copyright (C) 2008-2009, 2014-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -71,7 +56,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
diff --git a/arch/renesas/src/common/up_reprioritizertr.c b/arch/renesas/src/common/up_reprioritizertr.c
index 44b9f6f..2092be8 100644
--- a/arch/renesas/src/common/up_reprioritizertr.c
+++ b/arch/renesas/src/common/up_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/common/up_reprioritizertr.c
*
- * Copyright (C) 2008-2009, 2011, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -136,7 +121,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
nxsched_suspend_scheduler(rtcb);
- /* Are we in an interrupt handler? */
+ /* Are we in an interrupt handler? */
if (g_current_regs)
{
@@ -165,7 +150,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* Copy the exception context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
@@ -179,8 +165,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
#ifdef CONFIG_ARCH_ADDRENV
/* Make sure that the address environment for the previously
* running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
+ * MMU flushed) and set up the address environment for the
+ * new thread at the head of the ready-to-run list.
*/
group_addrenv(rtcb);
diff --git a/arch/renesas/src/common/up_unblocktask.c b/arch/renesas/src/common/up_unblocktask.c
index 386c61a..f54844e 100644
--- a/arch/renesas/src/common/up_unblocktask.c
+++ b/arch/renesas/src/common/up_unblocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/common/up_unblocktask.c
*
- * Copyright (C) 2008-2009, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -139,13 +124,13 @@ void up_unblock_task(struct tcb_s *tcb)
rtcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
- */
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the new
+ * thread at the head of the ready-to-run list.
+ */
- group_addrenv(rtcb);
+ group_addrenv(rtcb);
#endif
/* Update scheduler parameters */
diff --git a/arch/x86/src/common/up_blocktask.c b/arch/x86/src/common/up_blocktask.c
index eabf4ca..318ce82 100644
--- a/arch/x86/src/common/up_blocktask.c
+++ b/arch/x86/src/common/up_blocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/x86/src/common/up_blocktask.c
*
- * Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -141,25 +126,26 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
/* Copy the user C context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
{
- /* Restore the exception context of the rtcb at the (new) head
- * of the ready-to-run task list.
+ /* Restore the exception context of the rtcb at the (new)
+ * head of the ready-to-run task list.
*/
rtcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
- */
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the new
+ * thread at the head of the ready-to-run list.
+ */
- group_addrenv(rtcb);
+ group_addrenv(rtcb);
#endif
/* Reset scheduler parameters */
diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c
index 498c49b..2a3ef19 100644
--- a/arch/x86/src/common/up_exit.c
+++ b/arch/x86/src/common/up_exit.c
@@ -1,36 +1,20 @@
/****************************************************************************
* common/up_exit.c
*
- * Copyright (C) 2011, 2013-2014, 2016-2018 Gregory Nutt. All rights
- * reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -141,7 +125,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
void _exit(int status)
{
- struct tcb_s* tcb = this_task();
+ struct tcb_s *tcb = this_task();
/* Make sure that we are in a critical section with local interrupts.
* The IRQ state will be restored when the next task is started.
diff --git a/arch/x86/src/common/up_releasepending.c b/arch/x86/src/common/up_releasepending.c
index 7cf060a..4e379e6 100644
--- a/arch/x86/src/common/up_releasepending.c
+++ b/arch/x86/src/common/up_releasepending.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/arm/src/arm/up_releasepending.c
*
- * Copyright (C) 2011, 2014-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -71,7 +56,6 @@ void up_release_pending(void)
/* Merge the g_pendingtasks list into the ready-to-run task list */
- /* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to switch
@@ -90,7 +74,7 @@ void up_release_pending(void)
* Just copy the g_current_regs into the OLD rtcb.
*/
- up_savestate(rtcb->xcp.regs);
+ up_savestate(rtcb->xcp.regs);
/* Restore the exception context of the rtcb at the (new) head
* of the ready-to-run task list.
diff --git a/arch/x86/src/common/up_reprioritizertr.c b/arch/x86/src/common/up_reprioritizertr.c
index 83149c1..f5638f5 100644
--- a/arch/x86/src/common/up_reprioritizertr.c
+++ b/arch/x86/src/common/up_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/arm/src/arm/up_reprioritizertr.c
*
- * Copyright (C) 2011, 2013-2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -136,7 +121,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
nxsched_suspend_scheduler(rtcb);
- /* Are we in an interrupt handler? */
+ /* Are we in an interrupt handler? */
if (g_current_regs)
{
@@ -165,7 +150,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* Copy the exception context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
diff --git a/arch/x86/src/common/up_unblocktask.c b/arch/x86/src/common/up_unblocktask.c
index 475972b..aedc3ec 100644
--- a/arch/x86/src/common/up_unblocktask.c
+++ b/arch/x86/src/common/up_unblocktask.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/x86/src/common/up_unblocktask.c
*
- * Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -138,13 +123,13 @@ void up_unblock_task(struct tcb_s *tcb)
rtcb = this_task();
#ifdef CONFIG_ARCH_ADDRENV
- /* Make sure that the address environment for the previously
- * running task is closed down gracefully (data caches dump,
- * MMU flushed) and set up the address environment for the new
- * thread at the head of the ready-to-run list.
- */
+ /* Make sure that the address environment for the previously
+ * running task is closed down gracefully (data caches dump,
+ * MMU flushed) and set up the address environment for the new
+ * thread at the head of the ready-to-run list.
+ */
- group_addrenv(rtcb);
+ group_addrenv(rtcb);
#endif
/* Update scheduler parameters */
diff --git a/arch/x86_64/src/common/up_reprioritizertr.c b/arch/x86_64/src/common/up_reprioritizertr.c
index 9c68034..f95a595 100644
--- a/arch/x86_64/src/common/up_reprioritizertr.c
+++ b/arch/x86_64/src/common/up_reprioritizertr.c
@@ -151,7 +151,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
/* Copy the exception context into the TCB at the (old) head of the
* ready-to-run Task list. if up_saveusercontext returns a non-zero
- * value, then this is really the previously running task restarting!
+ * value, then this is really the previously running task
+ * restarting!
*/
else if (!up_saveusercontext(rtcb->xcp.regs))
diff --git a/arch/xtensa/src/common/xtensa_reprioritizertr.c b/arch/xtensa/src/common/xtensa_reprioritizertr.c
index 5f7ea68..27a9a9e 100644
--- a/arch/xtensa/src/common/xtensa_reprioritizertr.c
+++ b/arch/xtensa/src/common/xtensa_reprioritizertr.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/xtensa/src/common/xtensa_reprioritizertr.c
*
- * Copyright (C) 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -187,7 +172,9 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
rtcb = this_task();
#if XCHAL_CP_NUM > 0
- /* Set up the co-processor state for the newly started thread. */
+ /* Set up the co-processor state for the newly started
+ * thread.
+ */
xtensa_coproc_restorestate(&rtcb->xcp.cpstate);
#endif
diff --git a/arch/xtensa/src/esp32/esp32_cpustart.c b/arch/xtensa/src/esp32/esp32_cpustart.c
index fb48110..d0f287c 100644
--- a/arch/xtensa/src/esp32/esp32_cpustart.c
+++ b/arch/xtensa/src/esp32/esp32_cpustart.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/xtensa/src/esp32/esp32_cpustart.c
*
- * Copyright (C) 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -184,7 +169,7 @@ void xtensa_appcpu_start(void)
sched_note_cpu_started(tcb);
#endif
- /* Handle interlock*/
+ /* Handle interlock */
g_appcpu_started = true;
spin_unlock(&g_appcpu_interlock);
diff --git a/arch/z80/src/ez80/ez80_serial.c.SAVE b/arch/z80/src/ez80/ez80_serial.c.SAVE
new file mode 100644
index 0000000..a6376bb
--- /dev/null
+++ b/arch/z80/src/ez80/ez80_serial.c.SAVE
@@ -0,0 +1,850 @@
+/****************************************************************************
+ * arch/z80/src/ez08/ez80_serial.c
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/irq.h>
+#include <nuttx/arch.h>
+#include <nuttx/serial/serial.h>
+#include <arch/io.h>
+
+#include "chip.h"
+#include "z80_internal.h"
+
+#ifdef USE_SERIALDRIVER
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct ez80_dev_s
+{
+ uint16_t uartbase; /* Base address of UART registers */
+ unsigned int baud; /* Configured baud */
+ uint8_t irq; /* IRQ associated with this UART */
+ uint8_t parity; /* 0=none, 1=odd, 2=even */
+ uint8_t bits; /* Number of bits (7 or 8) */
+ bool stopbits2; /* true: Configure with 2 (vs 1) */
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int ez80_setup(struct uart_dev_s *dev);
+static void ez80_shutdown(struct uart_dev_s *dev);
+static int ez80_attach(struct uart_dev_s *dev);
+static void ez80_detach(struct uart_dev_s *dev);
+static int ez80_interrupt(int irq, void *context, void *arg);
+static int ez80_ioctl(struct file *filep, int cmd, unsigned long arg);
+static int ez80_receive(struct uart_dev_s *dev, unsigned int *status);
+static void ez80_rxint(struct uart_dev_s *dev, bool enable);
+static bool ez80_rxavailable(struct uart_dev_s *dev);
+static void ez80_send(struct uart_dev_s *dev, int ch);
+static void ez80_txint(struct uart_dev_s *dev, bool enable);
+static bool ez80_txready(struct uart_dev_s *dev);
+static bool ez80_txempty(struct uart_dev_s *dev);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct uart_ops_s g_uart_ops =
+{
+ ez80_setup, /* setup */
+ ez80_shutdown, /* shutdown */
+ ez80_attach, /* attach */
+ ez80_detach, /* detach */
+ ez80_ioctl, /* ioctl */
+ ez80_receive, /* receive */
+ ez80_rxint, /* rxint */
+ ez80_rxavailable, /* rxavailable */
+#ifdef CONFIG_SERIAL_IFLOWCONTROL
+ NULL, /* rxflowcontrol */
+#endif
+ ez80_send, /* send */
+ ez80_txint, /* txint */
+ ez80_txready, /* txready */
+ ez80_txempty /* txempty */
+};
+
+/* I/O buffers */
+
+#ifdef CONFIG_EZ80_UART0
+static char g_uart0rxbuffer[CONFIG_UART0_RXBUFSIZE];
+static char g_uart0txbuffer[CONFIG_UART0_TXBUFSIZE];
+#endif
+#ifdef CONFIG_EZ80_UART1
+static char g_uart1rxbuffer[CONFIG_UART1_RXBUFSIZE];
+static char g_uart1txbuffer[CONFIG_UART1_TXBUFSIZE];
+#endif
+
+/* This describes the state of the UART0 port. */
+
+#ifdef CONFIG_EZ80_UART0
+static struct ez80_dev_s g_uart0priv =
+{
+ EZ80_UART0_BASE, /* uartbase */
+ CONFIG_UART0_BAUD, /* baud */
+ EZ80_UART0_IRQ, /* irq */
+ CONFIG_UART0_PARITY, /* parity */
+ CONFIG_UART0_BITS, /* bits */
+ CONFIG_UART0_2STOP /* stopbits2 */
+};
+
+static uart_dev_t g_uart0port =
+{
+ 0, /* open_count */
+ false, /* xmitwaiting */
+ false, /* recvwaiting */
+#ifdef CONFIG_UART0_SERIAL_CONSOLE
+ true, /* isconsole */
+#else
+ false, /* isconsole */
+#endif
+ { 0 }, /* closesem */
+ { 0 }, /* xmitsem */
+ { 0 }, /* recvsem */
+ { 0 }, /* pollsem */
+ {
+ { 0 }, /* xmit.sem */
+ 0, /* xmit.head */
+ 0, /* xmit.tail */
+ CONFIG_UART0_TXBUFSIZE, /* xmit.size */
+ g_uart0txbuffer, /* xmit.buffer */
+ },
+ {
+ { 0 }, /* recv.sem */
+ 0, /* recv.head */
+ 0, /* recv.tail */
+ CONFIG_UART0_RXBUFSIZE, /* recv.size */
+ g_uart0rxbuffer, /* recv.buffer */
+ },
+ &g_uart_ops, /* ops */
+ &g_uart0priv, /* priv */
+ NULL, /* pollfds */
+};
+#endif
+
+/* This describes the state of the UART1 port. */
+
+#ifdef CONFIG_EZ80_UART1
+static struct ez80_dev_s g_uart1priv =
+{
+ EZ80_UART1_BASE, /* uartbase */
+ CONFIG_UART1_BAUD, /* baud */
+ EZ80_UART1_IRQ, /* irq */
+ CONFIG_UART1_PARITY, /* parity */
+ CONFIG_UART1_BITS, /* bits */
+ CONFIG_UART1_2STOP /* stopbits2 */
+};
+
+static uart_dev_t g_uart1port =
+{
+ 0, /* open_count */
+ false, /* xmitwaiting */
+ false, /* recvwaiting */
+#ifdef CONFIG_UART1_SERIAL_CONSOLE
+ true, /* isconsole */
+#else
+ false, /* isconsole */
+#endif
+ { 0 }, /* closesem */
+ { 0 }, /* xmitsem */
+ { 0 }, /* recvsem */
+ { 0 }, /* pollsem */
+ {
+ { 0 }, /* xmit.sem */
+ 0, /* xmit.head */
+ 0, /* xmit.tail */
+ CONFIG_UART1_TXBUFSIZE, /* xmit.size */
+ g_uart1txbuffer, /* xmit.buffer */
+ },
+ {
+ { 0 }, /* recv.sem */
+ 0, /* recv.head */
+ 0, /* recv.tail */
+ CONFIG_UART1_RXBUFSIZE, /* recv.size */
+ g_uart1rxbuffer, /* recv.buffer */
+ },
+ &g_uart_ops, /* ops */
+ &g_uart1priv, /* priv */
+ NULL, /* pollfds */
+};
+#endif
+
+/* Now, which one with be tty0/console and which tty1? */
+
+#if defined(CONFIG_UART0_SERIAL_CONSOLE) && defined(CONFIG_EZ80_UART0)
+# define CONSOLE_DEV g_uart0port
+# define TTYS0_DEV g_uart0port
+# if defined(CONFIG_EZ80_UART1)
+# define TTYS1_DEV g_uart1port
+# endif
+#elif defined(CONFIG_UART1_SERIAL_CONSOLE) && defined(CONFIG_EZ80_UART1)
+# define CONSOLE_DEV g_uart1port
+# define TTYS0_DEV g_uart1port
+# if defined(CONFIG_EZ80_UART0)
+# define TTYS1_DEV g_uart0port
+# endif
+#elif defined(CONFIG_EZ80_UART0)
+# define TTYS0_DEV g_uart0port
+# if defined(CONFIG_EZ80_UART1)
+# define TTYS1_DEV g_uart1port
+# endif
+#elif defined(CONFIG_EZ80_UART0)
+# define TTYS0_DEV g_uart1port
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: ez80_serialin
+ ****************************************************************************/
+
+static uint8_t ez80_serialin(FAR struct ez80_dev_s *priv, uint8_t offset)
+{
+ return inp(priv->uartbase + offset);
+}
+
+/****************************************************************************
+ * Name: ez80_serialout
+ ****************************************************************************/
+
+static void ez80_serialout(FAR struct ez80_dev_s *priv, uint8_t offset,
+ uint8_t value)
+{
+ outp(priv->uartbase + offset, value);
+}
+
+/****************************************************************************
+ * Name: ez80_disableuartint
+ ****************************************************************************/
+
+static void ez80_disableuartint(FAR struct ez80_dev_s *priv)
+{
+ uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
+ ier &= ~EZ80_UARTEIR_INTMASK;
+ ez80_serialout(priv, EZ80_UART_IER, ier);
+}
+
+/****************************************************************************
+ * Name: ez80_restoreuartint
+ ****************************************************************************/
+
+static void ez80_restoreuartint(FAR struct ez80_dev_s *priv, uint8_t bits)
+{
+ uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
+ ier |= bits & (EZ80_UARTEIR_TIE | EZ80_UARTEIR_RIE);
+ ez80_serialout(priv, EZ80_UART_IER, ier);
+}
+
+/****************************************************************************
+ * Name: ez80_waittxready
+ ****************************************************************************/
+
+static void ez80_waittxready(FAR struct ez80_dev_s *priv)
+{
+ int tmp;
+
+ for (tmp = 1000 ; tmp > 0 ; tmp--)
+ {
+ if ((ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0)
+ {
+ break;
+ }
+ }
+}
+
+/****************************************************************************
+ * Name: ez80_setbaud
+ ****************************************************************************/
+
+static void ez80_setbaud(FAR struct ez80_dev_s *priv, uint24_t baud)
+{
+ uint32_t brg_divisor;
+ uint8_t lctl;
+
+ /* The resulting BAUD and depends on the system clock frequency and the
+ * BRG divisor as follows:
+ *
+ * BAUD = SYSTEM_CLOCK_FREQUENCY / (16 * BRG_Divisor)
+ *
+ * Or
+ *
+ * BRG_Divisor = SYSTEM_CLOCK_FREQUENCY / 16 / BAUD
+ */
+
+ brg_divisor = (ez80_systemclock + (baud << 3)) / (baud << 4);
+
+ /* Set the DLAB bit to enable access to the BRG registers */
+
+ lctl = ez80_serialin(priv, EZ80_UART_LCTL);
+ lctl |= EZ80_UARTLCTL_DLAB;
+ ez80_serialout(priv, EZ80_UART_LCTL, lctl);
+
+ ez80_serialout(priv, EZ80_UART_BRGL, (uint8_t)(brg_divisor & 0xff));
+ ez80_serialout(priv, EZ80_UART_BRGH, (uint8_t)(brg_divisor >> 8));
+
+ lctl &= ~EZ80_UARTLCTL_DLAB;
+ ez80_serialout(priv, EZ80_UART_LCTL, lctl);
+}
+
+/****************************************************************************
+ * Name: ez80_setup
+ *
+ * Description:
+ * Configure the UART baud, bits, parity, fifos, etc. This method is called
+ * the first time that the serial port is opened.
+ *
+ ****************************************************************************/
+
+static int ez80_setup(FAR struct uart_dev_s *dev)
+{
+#ifndef CONFIG_SUPPRESS_UART_CONFIG
+ FAR struct ez80_dev_s *priv = dev->priv;
+ uint8_t reg;
+ uint8_t cval;
+
+ /* Put the UART in a known state */
+
+ ez80_shutdown(dev);
+
+ /* Configure serial properties */
+
+ if (priv->bits == 7)
+ {
+ cval = EZ80_UARTCHAR_7BITS;
+ }
+ else
+ {
+ cval = EZ80_UARTCHAR_8BITS;
+ }
+
+ if (priv->stopbits2)
+ {
+ cval |= EZ80_UARTLCTL_2STOP;
+ }
+
+ if (priv->parity == 1) /* Odd parity */
+ {
+ cval |= (EZ80_UARTLCTL_PEN);
+ }
+ else if (priv->parity == 2) /* Even parity */
+ {
+ cval |= (EZ80_UARTLCTL_PEN | EZ80_UARTLCTL_EPS);
+ }
+
+ /* Set the baud rate */
+
+ ez80_setbaud(priv, priv->baud);
+ ez80_serialout(priv, EZ80_UART_MCTL, 0);
+
+ /* Set the character properties */
+
+ reg = (ez80_serialin(priv, EZ80_UART_LCTL) & ~EZ80_UARTLCTL_MASK) | cval;
+ ez80_serialout(priv, EZ80_UART_LCTL, reg);
+
+ /* Enable and flush the Rx and Tx FIFOs */
+
+ reg = EZ80_UARTFCTL_FIFOEN;
+ ez80_serialout(priv, EZ80_UART_FCTL, reg);
+ reg |= (EZ80_UARTFCTL_CLRTXF | EZ80_UARTFCTL_CLRRXF);
+ ez80_serialout(priv, EZ80_UART_FCTL, reg);
+
+ /* Set the Rx FIFO trigger level. Small values assure the quickest
+ * response to get data from the Rx FIFO. This minimizes the
+ * likelihood of Rx overruns with a penalty of more time spent
+ * handling Rx interrupts.
+ */
+
+#if defined(CONFIG_EZ80_UART_RXFIFO_1)
+ reg |= EZ80_UARTTRIG_1;
+#elif defined(CONFIG_EZ80_UART_RXFIFO_4)
+ reg |= EZ80_UARTTRIG_4;
+#elif defined(CONFIG_EZ80_UART_RXFIFO_8)
+ reg |= EZ80_UARTTRIG_8;
+#elif defined(CONFIG_EZ80_UART_RXFIFO_14)
+ reg |= EZ80_UARTTRIG_14;
+#else
+# error No Rx FIFO trigger level
+#endif
+
+ ez80_serialout(priv, EZ80_UART_FCTL, reg);
+#endif
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: ez80_shutdown
+ *
+ * Description:
+ * Disable and reset the UART to its initial. This method is called when
+ * the serial port is closed and also before reconfiguring the UART.
+ *
+ ****************************************************************************/
+
+static void ez80_shutdown(FAR struct uart_dev_s *dev)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ uint8_t reg;
+
+ /* Make sure that DLAB == 0 */
+
+ reg = ez80_serialin(priv, EZ80_UART_LCTL);
+ reg &= ~EZ80_UARTLCTL_DLAB;
+ ez80_serialout(priv, EZ80_UART_LCTL, reg);
+
+ /* Disable UART interrupts */
+
+ ez80_disableuartint(priv);
+
+ /* Flush and disable the Tx and Rx FIFOs */
+
+ reg = ez80_serialin(priv, EZ80_UART_FCTL);
+ reg |= (EZ80_UARTFCTL_CLRTXF | EZ80_UARTFCTL_CLRRXF);
+ ez80_serialout(priv, EZ80_UART_FCTL, reg);
+ ez80_serialout(priv, EZ80_UART_FCTL, 0);
+
+ /* Restore other writable registers to their default state */
+
+ ez80_serialout(priv, EZ80_UART_MCTL, 0);
+ ez80_serialout(priv, EZ80_UART_LCTL, 0);
+}
+
+/****************************************************************************
+ * Name: ez80_attach
+ *
+ * Description:
+ * Configure the UART to operation in interrupt driven mode. This method
+ * is called when the serial port is opened. Normally, this is just after
+ * the the setup() method is called, however, the serial console may
+ * operate in a non-interrupt driven mode during the boot phase.
+ *
+ * RX and TX interrupts are not enabled when by the attach method (unless
+ * the hardware supports multiple levels of interrupt enabling). The RX
+ * and TX interrupts are not enabled until the txint() and rxint() methods
+ * are called.
+ *
+ ****************************************************************************/
+
+static int ez80_attach(FAR struct uart_dev_s *dev)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+
+ /* Attach the IRQ */
+
+ return irq_attach(priv->irq, ez80_interrupt, dev);
+}
+
+/****************************************************************************
+ * Name: ez80_detach
+ *
+ * Description:
+ * Detach UART interrupts. This method is called when the serial port is
+ * closed normally just before the shutdown method is called. The
+ * exception is the serial console which is never shutdown.
+ *
+ ****************************************************************************/
+
+static void ez80_detach(FAR struct uart_dev_s *dev)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ ez80_disableuartint(priv);
+ irq_detach(priv->irq);
+}
+
+/****************************************************************************
+ * Name: ez80_interrupt
+ *
+ * Description:
+ * This is the UART interrupt handler. It will be invoked
+ * when an interrupt received on the 'irq' It should call
+ * uart_transmitchars or uart_receivechar to perform the
+ * appropriate data transfers. The interrupt handling logic\
+ * must be able to map the 'irq' number into the appropriate
+ * uart_dev_s structure in order to call these functions.
+ *
+ ****************************************************************************/
+
+static int ez80_interrupt(int irq, FAR void *context, FAR void *arg)
+{
+ FAR struct uart_dev_s *dev = (FAR struct uart_dev_s *)arg;
+ struct ez80_dev_s *priv;
+ volatile uint32_t cause;
+
+ DEBUGASSERT(dev != NULL && dev->priv != NULL);
+ priv = (struct ez80_dev_s *)dev->priv;
+
+ cause = ez80_serialin(priv, EZ80_UART_IIR) & EZ80_UARTIIR_CAUSEMASK;
+
+ /* Check for character timeout (CTO) or Receiver Data Ready (RDR) */
+
+ if (cause == EZ80_UARTINSTS_CTO || cause == EZ80_UARTINSTS_RDR)
+ {
+ /* Receive characters from the RX fifo */
+
+ uart_recvchars(dev);
+ }
+
+ /* Check for transmission buffer empty */
+
+ else if (cause == EZ80_UARTINSTS_TBE)
+ {
+ uart_xmitchars(dev);
+ }
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: ez80_ioctl
+ *
+ * Description:
+ * All ioctl calls will be routed through this method
+ *
+ ****************************************************************************/
+
+static int ez80_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
+{
+ return -ENOTTY;
+}
+
+/****************************************************************************
+ * Name: ez80_receive
+ *
+ * Description:
+ * Called (usually) from the interrupt level to receive one character from
+ * the UART. Error bits associated with the receipt are provided in the
+ * the return 'status'.
+ *
+ ****************************************************************************/
+
+static int ez80_receive(FAR struct uart_dev_s *dev, FAR unsigned int *status)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ uint8_t rbr = ez80_serialin(priv, EZ80_UART_RBR);
+ uint8_t lsr = ez80_serialin(priv, EZ80_UART_LSR);
+
+ *status = (unsigned int)lsr;
+ return rbr;
+}
+
+/****************************************************************************
+ * Name: ez80_rxint
+ *
+ * Description:
+ * Call to enable or disable RX interrupts
+ *
+ ****************************************************************************/
+
+static void ez80_rxint(FAR struct uart_dev_s *dev, bool enable)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
+
+ if (enable)
+ {
+#ifndef CONFIG_SUPPRESS_SERIAL_INTS
+ ier |= EZ80_UARTEIR_RIE;
+ ez80_serialout(priv, EZ80_UART_IER, ier);
+#endif
+ }
+ else
+ {
+ ier &= ~EZ80_UARTEIR_RIE;
+ ez80_serialout(priv, EZ80_UART_IER, ier);
+ }
+}
+
+/****************************************************************************
+ * Name: ez80_rxavailable
+ *
+ * Description:
+ * Return true if the receive fifo is not empty
+ *
+ ****************************************************************************/
+
+static bool ez80_rxavailable(FAR struct uart_dev_s *dev)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_DR) != 0;
+}
+
+/****************************************************************************
+ * Name: ez80_send
+ *
+ * Description:
+ * This method will send one byte on the UART
+ *
+ ****************************************************************************/
+
+static void ez80_send(FAR struct uart_dev_s *dev, int ch)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ ez80_serialout(priv, EZ80_UART_THR, (uint8_t)ch);
+}
+
+/****************************************************************************
+ * Name: ez80_txint
+ *
+ * Description:
+ * Call to enable or disable TX interrupts
+ *
+ ****************************************************************************/
+
+static void ez80_txint(FAR struct uart_dev_s *dev, bool enable)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
+
+ if (enable)
+ {
+#ifndef CONFIG_SUPPRESS_SERIAL_INTS
+ ier |= EZ80_UARTEIR_TIE;
+ ez80_serialout(priv, EZ80_UART_IER, ier);
+#endif
+ }
+ else
+ {
+ ier &= ~EZ80_UARTEIR_TIE;
+ ez80_serialout(priv, EZ80_UART_IER, ier);
+ }
+}
+
+/****************************************************************************
+ * Name: ez80_txready
+ *
+ * Description:
+ * Return true if the transmit fifo is not full
+ *
+ ****************************************************************************/
+
+static bool ez80_txready(FAR struct uart_dev_s *dev)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0;
+}
+
+/****************************************************************************
+ * Name: ez80_txempty
+ *
+ * Description:
+ * Return true if the transmit fifo is empty
+ *
+ ****************************************************************************/
+
+static bool ez80_txempty(FAR struct uart_dev_s *dev)
+{
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)dev->priv;
+ return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_TEMT) != 0;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: z80_serial_initialize
+ *
+ * Description:
+ * Register serial console and serial ports.
+ *
+ ****************************************************************************/
+
+void z80_serial_initialize(void)
+{
+ uint8_t regval;
+
+ /* Make sure that all UART interrupts are disabled */
+
+ ez80_disableuartint(TTYS0_DEV.priv);
+#ifdef TTYS1_DEV
+ ez80_disableuartint(TTYS1_DEV.priv);
+#endif
+
+ /* Configure pins for usage of UARTs */
+
+#ifdef CONFIG_EZ80_UART0
+ /* Set Port D, pins 0 and 1 for their alternate function (Mode 7) to enable UART0 */
+
+ regval = inp(EZ80_PD_DDR);
+ regval |= 3;
+ outp(EZ80_PD_DDR, regval);
+
+ regval = inp(EZ80_PD_ALT1);
+ regval &= ~3;
+ outp(EZ80_PD_ALT1, regval);
+
+ regval = inp(EZ80_PD_ALT2);
+ regval |= 3;
+ outp(EZ80_PD_ALT2, regval);
+#endif
+
+#ifdef CONFIG_EZ80_UART1
+ /* Set Port C, pins 0 and 1 for their alternate function (Mode 7) to enable UART1 */
+
+ regval = inp(EZ80_PC_DDR);
+ regval |= 3;
+ outp(EZ80_PC_DDR, regval);
+
+ regval = inp(EZ80_PC_ALT1);
+ regval &= ~3;
+ outp(EZ80_PC_ALT1, regval);
+
+ regval = inp(EZ80_PC_ALT2);
+ regval |= 3;
+ outp(EZ80_PC_ALT2, regval);
+#endif
+
+ /* If there is a console, then configure the console now */
+
+#ifdef CONSOLE_DEV
+ CONSOLE_DEV.isconsole = true;
+ ez80_setup(&CONSOLE_DEV);
+#endif
+
+ /* Register console and tty devices */
+
+#ifdef CONSOLE_DEV
+ uart_register("/dev/console", &CONSOLE_DEV);
+#endif
+ uart_register("/dev/ttyS0", &TTYS0_DEV);
+#ifdef TTYS1_DEV
+ uart_register("/dev/ttyS1", &TTYS1_DEV);
+#endif
+}
+
+/****************************************************************************
+ * Name: up_putc
+ *
+ * Description:
+ * Provide priority, low-level access to support OS debug
+ * writes
+ *
+ ****************************************************************************/
+
+int up_putc(int ch)
+{
+#ifdef CONSOLE_DEV
+ FAR struct ez80_dev_s *priv = (FAR struct ez80_dev_s *)CONSOLE_DEV.priv;
+ uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
+
+ ez80_disableuartint(priv);
+
+ /* Check for LF */
+
+ if (ch == '\n')
+ {
+ /* Output CR before LF*/
+
+ ez80_waittxready(priv);
+ ez80_serialout(priv, EZ80_UART_THR, '\r');
+ }
+
+ /* Output the character */
+
+ ez80_waittxready(priv);
+ ez80_serialout(priv, EZ80_UART_THR, (uint8_t)ch);
+
+ /* Wait for the character to be sent before re-enabling interrupts */
+
+ ez80_waittxready(priv);
+ ez80_restoreuartint(priv, ier);
+ return ch;
+#endif
+}
+
+#else /* USE_SERIALDRIVER */
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_UART1_SERIAL_CONSOLE
+# define ez80_inp(offs) inp((EZ80_UART1_BASE+(offs)))
+# define ez80_outp(offs,val) outp((EZ80_UART1_BASE+(offs)), (val))
+#else
+# define ez80_inp(offs) inp((EZ80_UART0_BASE+(offs)))
+# define ez80_outp(offs,val) outp((EZ80_UART0_BASE+(offs)), (val))
+#endif
+
+#define ez80_txready() ((ez80_inp(EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0)
+#define ez80_send(ch) ez80_outp(EZ80_UART_THR, ch)
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: ez80_putc
+ ****************************************************************************/
+
+static void ez80_putc(int ch)
+{
+ int tmp;
+ for (tmp = 1000 ; tmp > 0 && !ez80_txready(); tmp--);
+ ez80_send(ch);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_putc
+ ****************************************************************************/
+
+int up_putc(int ch)
+{
+ /* Check for LF */
+
+ if (ch == '\n')
+ {
+ /* Output CR before LF */
+
+ ez80_putc('\r');
+ }
+
+ /* Output character */
+
+ ez80_putc(ch);
+ return ch;
+}
+
+#endif /* USE_SERIALDRIVER */
diff --git a/boards/sim/sim/sim/src/sim_touchscreen.c b/boards/sim/sim/sim/src/sim_touchscreen.c
index 9575f5c..5b183f0 100644
--- a/boards/sim/sim/sim/src/sim_touchscreen.c
+++ b/boards/sim/sim/sim/src/sim_touchscreen.c
@@ -1,35 +1,20 @@
/****************************************************************************
* boards/sim/sim/sim/src/sim_touchscreen.c
*
- * Copyright (C) 2011, 2016-2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -208,6 +193,7 @@ int sim_tsc_setup(int minor)
return ret;
}
#endif
+
/* Start a separate thread to listen for server events.
* This is probably the least efficient way to do this,
* but it makes this example flow more smoothly.
diff --git a/fs/aio/aioc_contain.c b/fs/aio/aioc_contain.c
index 083343c..49992c4 100644
--- a/fs/aio/aioc_contain.c
+++ b/fs/aio/aioc_contain.c
@@ -174,7 +174,9 @@ FAR struct aiocb *aioc_decant(FAR struct aio_container_s *aioc)
{
dq_rem(&aioc->aioc_link, &g_aio_pending);
- /* De-cant the AIO control block and return the container to the free list */
+ /* De-cant the AIO control block and return the container to the
+ * free list.
+ */
aiocbp = aioc->aioc_aiocbp;
aioc_free(aioc);
diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c
index 450f929..da63312 100644
--- a/fs/procfs/fs_procfs.c
+++ b/fs/procfs/fs_procfs.c
@@ -1,35 +1,20 @@
/****************************************************************************
* fs/procfs/fs_procfs.c
*
- * Copyright (C) 2013-2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -765,16 +750,19 @@ static int procfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
if (name != NULL)
{
- /* This entry is okay to report. Test if it has a duplicate
- * first level name as the one we just reported. This could
- * happen in the event of procfs_entry_s such as:
+ /* This entry is okay to report. Test if it has a
+ * duplicate first level name as the one we just reported.
+ * This could happen in the event of procfs_entry_s such
+ * as:
*
* fs/smartfs
* fs/nfs
* fs/nxffs
*/
- name = g_procfs_entries[index - priv->nentries].pathpattern;
+ name =
+ g_procfs_entries[index - priv->nentries].pathpattern;
+
if (!level0->lastlen || (strncmp(name, level0->lastread,
level0->lastlen) != 0))
{
diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c
index 09d5d0d..567f808 100644
--- a/fs/procfs/fs_procfsproc.c
+++ b/fs/procfs/fs_procfsproc.c
@@ -1,35 +1,20 @@
/****************************************************************************
* fs/procfs/fs_procfsproc.c
*
- * Copyright (C) 2013-2019 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -226,7 +211,8 @@ static ssize_t proc_read(FAR struct file *filep, FAR char *buffer,
static int proc_dup(FAR const struct file *oldp,
FAR struct file *newp);
-static int proc_opendir(const char *relpath, FAR struct fs_dirent_s *dir);
+static int proc_opendir(const char *relpath,
+ FAR struct fs_dirent_s *dir);
static int proc_closedir(FAR struct fs_dirent_s *dir);
static int proc_readdir(FAR struct fs_dirent_s *dir);
static int proc_rewinddir(FAR struct fs_dirent_s *dir);
@@ -484,7 +470,8 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
#endif
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n",
"Name:", name);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -500,7 +487,8 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n", "Type:",
g_ttypenames[(tcb->flags & TCB_FLAG_TTYPE_MASK) >>
TCB_FLAG_TTYPE_SHIFT]);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -516,14 +504,15 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
DEBUGASSERT(group != NULL);
#ifdef HAVE_GROUPID
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n", "Group:",
- group->tg_pgrpid);
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n",
+ "Group:", group->tg_pgrpid);
#else
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n", "PPID:",
group->tg_ppid);
#endif
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -539,15 +528,17 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
if (tcb->task_state >= FIRST_ASSIGNED_STATE &&
tcb->task_state <= LAST_ASSIGNED_STATE)
{
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n", "CPU:",
- tcb->cpu);
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n",
+ "CPU:", tcb->cpu);
}
else
{
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s---\n", "CPU:");
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s---\n",
+ "CPU:");
}
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -561,9 +552,10 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
/* Show the thread state */
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n", "State:",
- g_statenames[tcb->task_state]);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n",
+ "State:", g_statenames[tcb->task_state]);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -576,12 +568,14 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
/* Show task flags */
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%c%c%c\n", "Flags:",
+ linesize = snprintf(procfile->line, STATUS_LINELEN,
+ "%-12s%c%c%c\n", "Flags:",
tcb->flags & TCB_FLAG_NONCANCELABLE ? 'N' : '-',
tcb->flags & TCB_FLAG_CANCEL_PENDING ? 'P' : '-',
tcb->flags & TCB_FLAG_EXIT_PROCESSING ? 'P' : '-');
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -595,13 +589,15 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
/* Show the thread priority */
#ifdef CONFIG_PRIORITY_INHERITANCE
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d (%d)\n", "Priority:",
+ linesize = snprintf(procfile->line, STATUS_LINELEN,
+ "%-12s%d (%d)\n", "Priority:",
tcb->sched_priority, tcb->base_priority);
#else
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n", "Priority:",
- tcb->sched_priority);
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n",
+ "Priority:", tcb->sched_priority);
#endif
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -614,10 +610,12 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
/* Show the scheduler policy */
- policy = g_policy[(tcb->flags & TCB_FLAG_POLICY_MASK) >> TCB_FLAG_POLICY_SHIFT];
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n", "Scheduler:",
- policy);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ policy = g_policy[(tcb->flags & TCB_FLAG_POLICY_MASK) >>
+ TCB_FLAG_POLICY_SHIFT];
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n",
+ "Scheduler:", policy);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -630,9 +628,10 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
/* Show the signal mask */
- linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%08x\n", "SigMask:",
- tcb->sigprocmask);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%08x\n",
+ "SigMask:", tcb->sigprocmask);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
return totalsize;
@@ -666,7 +665,8 @@ static ssize_t proc_cmdline(FAR struct proc_file_s *procfile,
#endif
linesize = strlen(name);
memcpy(procfile->line, name, linesize);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -767,7 +767,8 @@ static ssize_t proc_loadavg(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%3d.%01d%%",
intpart, fracpart);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen,
+ &offset);
return copysize;
}
@@ -812,7 +813,8 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%lu.%09lu,",
(unsigned long)maxtime.tv_sec,
(unsigned long)maxtime.tv_nsec);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -844,7 +846,8 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%lu.%09lu\n",
(unsigned long)maxtime.tv_sec,
(unsigned long)maxtime.tv_nsec);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen,
+ &offset);
totalsize += copysize;
return totalsize;
@@ -871,7 +874,8 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s0x%p\n",
"StackBase:", tcb->adj_stack_ptr);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -886,7 +890,8 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%ld\n",
"StackSize:", (long)tcb->adj_stack_size);
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -902,7 +907,8 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%ld\n",
"StackUsed:", (long)up_check_tcbstack(tcb));
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -1042,7 +1048,8 @@ static ssize_t proc_groupstatus(FAR struct proc_file_s *procfile,
}
linesize = snprintf(procfile->line, STATUS_LINELEN, "\n");
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -1078,7 +1085,8 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-8s %s\n",
"FD", "POS", "OFLAGS");
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -1117,9 +1125,11 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
}
#ifdef CONFIG_NET
- linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-2s %-3s %s\n",
+ linesize = snprintf(procfile->line, STATUS_LINELEN,
+ "\n%-3s %-2s %-3s %s\n",
"SD", "RF", "TYP", "FLAGS");
- copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
+ copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
+ &offset);
totalsize += copysize;
buffer += copysize;
@@ -1214,8 +1224,9 @@ static int proc_groupenv_callback(FAR void *arg, FAR const char *pair)
linesize = snprintf(info->procfile->line, STATUS_LINELEN, "%s=%s\n",
name, value);
- copysize = procfs_memcpy(info->procfile->line, linesize, info->buffer,
- info->remaining, &info->offset);
+ copysize = procfs_memcpy(info->procfile->line, linesize,
+ info->buffer, info->remaining,
+ &info->offset);
info->totalsize += copysize;
info->buffer += copysize;
@@ -1356,7 +1367,8 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath,
/* Allocate a container to hold the task and node selection */
- procfile = (FAR struct proc_file_s *)kmm_zalloc(sizeof(struct proc_file_s));
+ procfile = (FAR struct proc_file_s *)
+ kmm_zalloc(sizeof(struct proc_file_s));
if (procfile == NULL)
{
ferr("ERROR: Failed to allocate file container\n");
diff --git a/mm/shm/shmdt.c b/mm/shm/shmdt.c
index 5a6b745..aae2772 100644
--- a/mm/shm/shmdt.c
+++ b/mm/shm/shmdt.c
@@ -1,35 +1,20 @@
/****************************************************************************
* mm/shm/shmdt.c
*
- * Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -106,7 +91,8 @@ int shmdt(FAR const void *shmaddr)
if (shmid >= CONFIG_ARCH_SHM_MAXREGIONS)
{
- shmerr("ERROR: No region matching this virtual address: %p\n", shmaddr);
+ shmerr("ERROR: No region matching this virtual address: %p\n",
+ shmaddr);
ret = -EINVAL;
goto errout_with_errno;
}
diff --git a/net/socket/net_sockets.c b/net/socket/net_sockets.c
index 0f78f29..547e283 100644
--- a/net/socket/net_sockets.c
+++ b/net/socket/net_sockets.c
@@ -1,35 +1,20 @@
/****************************************************************************
* net/socket/net_sockets.c
*
- * Copyright (C) 2007-2009, 2011-2014, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -94,7 +79,8 @@ void net_initlist(FAR struct socketlist *list)
* Release resources held by the socket list
*
* Input Parameters:
- * list -- A reference to the pre-allocated socket list to be un-initialized.
+ * list - A reference to the pre-allocated socket list to be un-
+ * initialized.
*
* Returned Value:
* None
diff --git a/sched/group/group_continue.c b/sched/group/group_continue.c
index fdbcb47..9b06ec4 100644
--- a/sched/group/group_continue.c
+++ b/sched/group/group_continue.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/group/group_continue.c
*
- * Copyright (C) 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -82,7 +67,7 @@ static int group_continue_handler(pid_t pid, FAR void *arg)
sched_continue(rtcb);
}
- /* Always return zero. We need to visit each member of the group*/
+ /* Always return zero. We need to visit each member of the group */
return OK;
}
diff --git a/sched/pthread/pthread_cancel.c b/sched/pthread/pthread_cancel.c
index 4798cda..b2e947d 100644
--- a/sched/pthread/pthread_cancel.c
+++ b/sched/pthread/pthread_cancel.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_cancel.c
*
- * Copyright (C) 2007, 2009, 2013, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -79,7 +64,8 @@ int pthread_cancel(pthread_t thread)
/* Only pthreads should use this interface */
- DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD);
+ DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) ==
+ TCB_FLAG_TTYPE_PTHREAD);
/* Check to see if this thread has the non-cancelable bit set in its
* flags. Suppress context changes for a bit so that the flags are stable.
@@ -95,11 +81,11 @@ int pthread_cancel(pthread_t thread)
* "When cancellability is disabled, all cancels are held pending
* in the target thread until the thread changes the cancellability.
* When cancellability is deferred, all cancels are held pending in
- * the target thread until the thread changes the cancellability, calls
- * a function which is a cancellation point or calls pthread_testcancel(),
- * thus creating a cancellation point. When cancellability is asynchronous,
- * all cancels are acted upon immediately, interrupting the thread with its
- * processing."
+ * the target thread until the thread changes the cancellability,
+ * calls a function which is a cancellation point or calls
+ * pthread_testcancel(), thus creating a cancellation point. When
+ * cancellability is asynchronous, all cancels are acted upon
+ * immediately, interrupting the thread with its processing."
*/
tcb->cmn.flags |= TCB_FLAG_CANCEL_PENDING;
@@ -112,8 +98,8 @@ int pthread_cancel(pthread_t thread)
if ((tcb->cmn.flags & TCB_FLAG_CANCEL_DEFERRED) != 0)
{
- /* Then we cannot cancel the thread asynchronously. Mark the cancellation
- * as pending.
+ /* Then we cannot cancel the thread asynchronously. Mark the
+ * cancellation as pending.
*/
tcb->cmn.flags |= TCB_FLAG_CANCEL_PENDING;
diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c
index 2613606..cb1a42e 100644
--- a/sched/pthread/pthread_condtimedwait.c
+++ b/sched/pthread/pthread_condtimedwait.c
@@ -92,8 +92,8 @@ static void pthread_condtimedout(int argc, wdparm_t arg1, ...)
* the signal.
*/
- /* Get the waiting TCB. nxsched_get_tcb() might return NULL if the task
- * has exited for some reason.
+ /* Get the waiting TCB. nxsched_get_tcb() might return NULL if the
+ * task has exited for some reason.
*/
tcb = nxsched_get_tcb(pid);
diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c
index 39c8182..994bc7d 100644
--- a/sched/pthread/pthread_join.c
+++ b/sched/pthread/pthread_join.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_join.c
*
- * Copyright (C) 2007, 2008, 2011, 2013, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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/sched/pthread/pthread_mutexconsistent.c b/sched/pthread/pthread_mutexconsistent.c
index e48f19c..2020cba 100644
--- a/sched/pthread/pthread_mutexconsistent.c
+++ b/sched/pthread/pthread_mutexconsistent.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_mutexconsistent.c
*
- * Copyright (C) 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -111,8 +96,8 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex)
* (see pthread_mutex_consistent()).
*
* If the holding thread is still valid, then we should be able to
- * map its PID to the underlying TCB. That is what nxsched_get_tcb()
- * does.
+ * map its PID to the underlying TCB. That is what
+ * nxsched_get_tcb() does.
*/
if (nxsched_get_tcb(mutex->pid) == NULL)
diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c
index 578cc79..8f9de58 100644
--- a/sched/pthread/pthread_mutexdestroy.c
+++ b/sched/pthread/pthread_mutexdestroy.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_mutexdestroy.c
*
- * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -79,7 +64,9 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
if (mutex != NULL)
{
- /* Make sure the semaphore is stable while we make the following checks */
+ /* Make sure the semaphore is stable while we make the following
+ * checks.
+ */
sched_lock();
@@ -87,7 +74,9 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
if (mutex->pid >= 0)
{
- DEBUGASSERT(mutex->pid != 0); /* < 0: available, >0 owned, ==0 error */
+ /* < 0: available, >0 owned, ==0 error */
+
+ DEBUGASSERT(mutex->pid != 0);
/* No.. Verify that the PID still exists. We may be destroying
* the mutex after cancelling a pthread and the mutex may have
@@ -96,8 +85,8 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
* (see pthread_mutex_consistent()).
*
* If the holding thread is still valid, then we should be able to
- * map its PID to the underlying TCB. That is what nxsched_get_tcb()
- * does.
+ * map its PID to the underlying TCB. That is what
+ * nxsched_get_tcb() does.
*/
if (nxsched_get_tcb(mutex->pid) == NULL)
diff --git a/sched/pthread/pthread_mutextrylock.c b/sched/pthread/pthread_mutextrylock.c
index bda07dd..902dffd 100644
--- a/sched/pthread/pthread_mutextrylock.c
+++ b/sched/pthread/pthread_mutextrylock.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_mutextrylock.c
*
- * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -56,10 +41,10 @@
* Name: pthread_mutex_trylock
*
* Description:
- * The function pthread_mutex_trylock() is identical to pthread_mutex_lock()
- * except that if the mutex object referenced by mutex is currently locked
- * (by any thread, including the current thread), the call returns
- * immediately with the errno EBUSY.
+ * The function pthread_mutex_trylock() is identical to
+ * pthread_mutex_lock() except that if the mutex object referenced by the
+ * mutex is currently locked (by any thread, including the current
+ * thread), the call returns immediately with the errno EBUSY.
*
* If a signal is delivered to a thread waiting for a mutex, upon return
* from the signal handler the thread resumes waiting for the mutex as if
@@ -131,7 +116,9 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex)
if (mutex->type == PTHREAD_MUTEX_RECURSIVE && mutex->pid == mypid)
{
- /* Increment the number of locks held and return successfully. */
+ /* Increment the number of locks held and return
+ * successfully.
+ */
if (mutex->nlocks < INT16_MAX)
{
@@ -176,8 +163,11 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex)
if (mutex->pid > 0 && nxsched_get_tcb(mutex->pid) == NULL)
#endif
{
- DEBUGASSERT(mutex->pid != 0); /* < 0: available, >0 owned, ==0 error */
- DEBUGASSERT((mutex->flags & _PTHREAD_MFLAGS_INCONSISTENT) != 0);
+ /* < 0: available, >0 owned, ==0 error */
+
+ DEBUGASSERT(mutex->pid != 0);
+ DEBUGASSERT((mutex->flags & _PTHREAD_MFLAGS_INCONSISTENT)
+ != 0);
/* A thread holds the mutex, but there is no such thread.
* POSIX requires that the 'robust' mutex return EOWNERDEAD
diff --git a/sched/pthread/pthread_setaffinity.c b/sched/pthread/pthread_setaffinity.c
index b13aa94..8c6d4fd 100644
--- a/sched/pthread/pthread_setaffinity.c
+++ b/sched/pthread/pthread_setaffinity.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_setaffinity.c
*
- * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -90,7 +75,9 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
DEBUGASSERT(thread > 0 && cpusetsize == sizeof(cpu_set_t) &&
cpuset != NULL);
- /* Let nxsched_set_affinity do all of the work, adjusting the return value */
+ /* Let nxsched_set_affinity do all of the work, adjusting the return
+ * value.
+ */
ret = nxsched_set_affinity((pid_t)thread, cpusetsize, cpuset);
return ret < 0 ? -ret : OK;
diff --git a/sched/pthread/pthread_setschedparam.c b/sched/pthread/pthread_setschedparam.c
index 502b3aa..fc44c11 100644
--- a/sched/pthread/pthread_setschedparam.c
+++ b/sched/pthread/pthread_setschedparam.c
@@ -1,36 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_setschedparam.c
*
- * Copyright (C) 2007, 2008, 2012, 2015, 2018 Gregory Nutt. All rights
- * reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -92,12 +76,13 @@
* ENOTSUP An attempt was made to set the policy or scheduling parameters
* to an unsupported value (SCHED_OTHER and SCHED_SPORADIC in
* particular are not supported)
- * EPERM The caller does not have the appropriate permission to set either
- * the scheduling parameters or the scheduling policy of the
- * specified thread. Or, the implementation does not allow the
- * application to modify one of the parameters to the value
+ * EPERM The caller does not have the appropriate permission to set
+ * either the scheduling parameters or the scheduling policy of
+ * the specified thread. Or, the implementation does not allow
+ * the application to modify one of the parameters to the value
* specified.
- * ESRCH The value specified by thread does not refer to a existing thread.
+ * ESRCH The value specified by thread does not refer to a existing
+ * thread.
*
****************************************************************************/
diff --git a/sched/pthread/pthread_setschedprio.c b/sched/pthread/pthread_setschedprio.c
index 494e6fb..1e52681 100644
--- a/sched/pthread/pthread_setschedprio.c
+++ b/sched/pthread/pthread_setschedprio.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/pthread/pthread_setschedprio.c
*
- * Copyright (C) 2007, 2009, 2015, 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -56,10 +41,10 @@
* Name: pthread_setsetprio
*
* Description:
- * The pthread_setschedprio() function sets the scheduling priority for the
- * thread whose thread ID is given by 'thread' to the value given by 'prio'.
- * If the thread_setschedprio() function fails, the scheduling priority
- * of the target thread will not be changed.
+ * The pthread_setschedprio() function sets the scheduling priority for
+ * the thread whose thread ID is given by 'thread' to the value given by
+ * 'prio'. If the thread_setschedprio() function fails, the scheduling
+ * priority of the target thread will not be changed.
*
* Input Parameters:
* thread - the thread ID of the task to reprioritize.
diff --git a/sched/sched/sched_foreach.c b/sched/sched/sched_foreach.c
index 2f02043..dc7a8ee 100644
--- a/sched/sched/sched_foreach.c
+++ b/sched/sched/sched_foreach.c
@@ -1,35 +1,20 @@
/****************************************************************************
- * sched/sched/nxsched_foreach.c
+ * sched/sched/sched_foreach.c
*
- * Copyright (C) 2007, 2009, 2016, 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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/sched/sched/sched_get_stackinfo.c b/sched/sched/sched_get_stackinfo.c
index 8b7af5f..1220964 100644
--- a/sched/sched/sched_get_stackinfo.c
+++ b/sched/sched/sched_get_stackinfo.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/sched/nxsched_get_stackinfo.c
+ * sched/sched/sched_get_stackinfo.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
diff --git a/sched/sched/sched_getfiles.c b/sched/sched/sched_getfiles.c
index 5d8e47e..cdbb49a 100644
--- a/sched/sched/sched_getfiles.c
+++ b/sched/sched/sched_getfiles.c
@@ -1,35 +1,20 @@
/****************************************************************************
- * sched/sched/nxsched_get_files.c
+ * sched/sched/sched_getfiles.c
*
- * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -42,10 +27,6 @@
#include "sched/sched.h"
/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
* Public Functions
****************************************************************************/
diff --git a/sched/sched/sched_getsockets.c b/sched/sched/sched_getsockets.c
index f40e45d..b29421d 100644
--- a/sched/sched/sched_getsockets.c
+++ b/sched/sched/sched_getsockets.c
@@ -1,35 +1,20 @@
/****************************************************************************
- * sched/sched/nxsched_get_sockets.c
- *
- * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 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.
+ * sched/sched/sched_getsockets.c
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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/sched/sched/sched_getstreams.c b/sched/sched/sched_getstreams.c
index 98e2678..6970ca2 100644
--- a/sched/sched/sched_getstreams.c
+++ b/sched/sched/sched_getstreams.c
@@ -1,35 +1,20 @@
/****************************************************************************
- * sched/sched/nxsched_get_streams.c
+ * sched/sched/sched_getstreams.c
*
- * Copyright (C) 2007, 2008, 2013 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -41,6 +26,8 @@
#include <sched.h>
#include "sched/sched.h"
+#if CONFIG_NFILE_STREAMS > 0
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -61,8 +48,6 @@
*
****************************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
FAR struct streamlist *nxsched_get_streams(void)
{
FAR struct tcb_s *rtcb = this_task();
diff --git a/sched/sched/sched_gettcb.c b/sched/sched/sched_gettcb.c
index c7a5729..f5c3c37 100644
--- a/sched/sched/sched_gettcb.c
+++ b/sched/sched/sched_gettcb.c
@@ -1,35 +1,8 @@
/****************************************************************************
- * sched/sched/nxsched_get_tcb.c
+ * sched/sched/sched_gettcb.c
*
- * Copyright (C) 2007, 2009, 2011, 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 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.
+#if CONFIG_NFILE_STREAMS > 0
+
*
****************************************************************************/
diff --git a/sched/sched/sched_releasetcb.c b/sched/sched/sched_releasetcb.c
index 0764e85..5cf57b6 100644
--- a/sched/sched/sched_releasetcb.c
+++ b/sched/sched/sched_releasetcb.c
@@ -1,36 +1,20 @@
/****************************************************************************
- * sched/sched/nxsched_release_tcb.c
+ * sched/sched/sched_releasetcb.c
*
- * Copyright (C) 2007, 2009, 2012-2014, 2019 Gregory Nutt. All rights
- * reserved.
- * Author: Gregory Nutt <gn...@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/sched/sched/sched_self.c b/sched/sched/sched_self.c
index 06c52ab..abded79 100644
--- a/sched/sched/sched_self.c
+++ b/sched/sched/sched_self.c
@@ -1,35 +1,20 @@
/****************************************************************************
- * sched/sched/nxsched_self.c
+ * sched/sched/sched_self.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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/sched/sched/sched_setaffinity.c b/sched/sched/sched_setaffinity.c
index 69ec42e..4919d9e 100644
--- a/sched/sched/sched_setaffinity.c
+++ b/sched/sched/sched_setaffinity.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/sched/sched_setaffinity.c
*
- * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 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.
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
*
****************************************************************************/
@@ -85,7 +70,7 @@
****************************************************************************/
int nxsched_set_affinity(pid_t pid, size_t cpusetsize,
- FAR const cpu_set_t *mask)
+ FAR const cpu_set_t *mask)
{
FAR struct tcb_s *tcb;
irqstate_t flags;
@@ -177,8 +162,8 @@ errout_with_lock:
* CPUs specified in mask, then that thread is migrated to one of the
* CPUs specified in mask.
*
- * This function is a simply wrapper around nxsched_set_affinity() that sets
- * the errno value in the event of an error.
+ * This function is a simply wrapper around nxsched_set_affinity() that
+ * sets the errno value in the event of an error.
*
* Input Parameters:
* pid - The ID of thread whose affinity set will be modified.
diff --git a/sched/sched/sched_setscheduler.c b/sched/sched/sched_setscheduler.c
index 14400d5..f9cd7a5 100644
--- a/sched/sched/sched_setscheduler.c
+++ b/sched/sched/sched_setscheduler.c
@@ -1,36 +1,20 @@
/****************************************************************************
* sched/sched/sched_setscheduler.c
*
- * Copyright (C) 2007, 2009, 2012, 2015-2016, 2018 Gregory Nutt. All
- * rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -92,7 +76,7 @@
****************************************************************************/
int nxsched_set_scheduler(pid_t pid, int policy,
- FAR const struct sched_param *param)
+ FAR const struct sched_param *param)
{
FAR struct tcb_s *tcb;
irqstate_t flags;
diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c
index c94f7ae..2d091f9 100644
--- a/sched/sched/sched_timerexpiration.c
+++ b/sched/sched/sched_timerexpiration.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/sched/sched_timerexpiration.c
*
- * Copyright (C) 2014-2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 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.
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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/sched/task/task_init.c b/sched/task/task_init.c
index e9faaa9..a52a18c 100644
--- a/sched/task/task_init.c
+++ b/sched/task/task_init.c
@@ -68,7 +68,8 @@
* OK on success; negative error value on failure appropriately. (See
* nxtask_schedsetup() for possible failure conditions). On failure, the
* caller is responsible for freeing the stack memory and for calling
- * nxsched_release_tcb() to free the TCB (which could be in most any state).
+ * nxsched_release_tcb() to free the TCB (which could be in most any
+ * state).
*
****************************************************************************/
diff --git a/sched/task/task_reparent.c b/sched/task/task_reparent.c
index db6d153..5032194 100644
--- a/sched/task/task_reparent.c
+++ b/sched/task/task_reparent.c
@@ -1,35 +1,20 @@
/****************************************************************************
* sched/task/task_reparent.c
*
- * Copyright (C) 2013, 2016, 2019 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -265,7 +250,9 @@ int task_reparent(pid_t ppid, pid_t chpid)
goto errout_with_ints;
}
- /* Then reparent the child. The task specified by ppid is the new parent. */
+ /* Then reparent the child. The task specified by ppid is the new
+ * parent.
+ */
chtcb->group->tg_ppid = ppid;
diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c
index 0526340..b4a6929 100644
--- a/sched/task/task_restart.c
+++ b/sched/task/task_restart.c
@@ -1,36 +1,20 @@
/****************************************************************************
* sched/task/task_restart.c
*
- * Copyright (C) 2007, 2009, 2012-2013, 2016, 2018 Gregory Nutt. All
- * rights reserved.
- * Author: Gregory Nutt <gn...@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.
*
****************************************************************************/
@@ -177,7 +161,9 @@ int task_restart(pid_t pid)
tcb->cmn.irqcount = 0;
#endif
- /* Reset the base task priority and the number of pending reprioritizations */
+ /* Reset the base task priority and the number of pending
+ * reprioritizations.
+ */
#ifdef CONFIG_PRIORITY_INHERITANCE
tcb->cmn.base_priority = tcb->cmn.init_priority;