There used to be two ways to pass parameters to new tasks, depending upon the configuration: Either (1) argv[] as created as an array with each string strdup'ed. Or (1) argv[] array and strings were created on the stack before the new task was started. Now, there is only one way, way (1). Way (2) might be slightly more compact, but this is not worth carry the complexity of two different ways of doing the same thing.

This commit is contained in:
Gregory Nutt
2014-09-01 15:39:34 -06:00
parent f25ea29aaa
commit 64ab35b399
48 changed files with 251 additions and 357 deletions
+6 -6
View File
@@ -3634,13 +3634,13 @@ Mem: 29232 5920 23312 23312
problems because of SDCC compiler differences. problems because of SDCC compiler differences.
Refer to the NuttX board <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/misc/Obsoleted/configs/pjrc-8051/README.txt">README</a> file for further information. Refer to the NuttX board <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/misc/Obsoleted/configs/pjrc-8051/README.txt">README</a> file for further information.
</p> </p>
<p>
<b>Obsoleted</b>.
This architecture has been obsoleted.
The code has been moved out of the source tree an can now be found in <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/misc/Obsoleted/">Obsoleted</a> directory.
This support was obsoleted because (1) the architecture limitations of the 8051 family make ongoing support too difficult, and (2) although the basic port was marginally functional, it has never really been demonstrated convincingly in any application.
</p>
</ul> </ul>
<p>
<b><i>Obsoleted</i></b>.
This architecture has been <i>obsoleted</i>.
The code has been moved out of the NuttX source tree but can still be found be found in <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/misc/Obsoleted/">Obsoleted</a> directory.
This support was obsoleted because (1) the architecture limitations of the 8051 family make ongoing development of more advanced NuttX features too difficult, and (2) although the basic port was marginally functional, it has never really been demonstrated convincingly in any application.
</p>
</td> </td>
</tr> </tr>
<tr> <tr>
+1 -4
View File
@@ -1870,7 +1870,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
<p> <p>
<b>Description</b>. <b>Description</b>.
Allocate a stack frame in the TCB's stack to hold thread-specific data. Allocate a stack frame in the TCB's stack to hold thread-specific data.
This function may be called anytime after <code>up_create_stack()</code> or <code>up_use_stack()</code> have been called but before the task has been started. This function may be called any time after <code>up_create_stack()</code> or <code>up_use_stack()</code> have been called but before the task has been started.
</p> </p>
<p> <p>
Thread data may be kept in the stack (instead of in the TCB) if it is accessed by the user code directly. Thread data may be kept in the stack (instead of in the TCB) if it is accessed by the user code directly.
@@ -1889,9 +1889,6 @@ The system can be re-made subsequently by just typing <code>make</code>.
This will still be the initial value of the stack pointer when the task is started. This will still be the initial value of the stack pointer when the task is started.
</li> </li>
</ul> </ul>
<p>
This API is <i>NOT</i> required if <code>CONFIG_BUILD_PROTECTED</code> and <code>CONFIG_BUILD_KERNEL</code> are undefined.
</p>
<p><b>Input Parameters:</b></p> <p><b>Input Parameters:</b></p>
<ul> <ul>
<li> <li>
+2 -2
View File
@@ -62,7 +62,7 @@ endif
CMN_CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_exit.c CMN_CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_exit.c
CMN_CSRCS += up_createstack.c up_releasestack.c up_usestack.c up_vfork.c CMN_CSRCS += up_createstack.c up_releasestack.c up_usestack.c up_vfork.c
CMN_CSRCS += up_puts.c up_mdelay.c up_udelay.c CMN_CSRCS += up_puts.c up_mdelay.c up_stackframe.c up_udelay.c
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_dataabort.c CMN_CSRCS += arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_dataabort.c
@@ -83,7 +83,7 @@ CMN_CSRCS += arm_va2pte.c
endif endif
ifeq ($(CONFIG_BUILD_KERNEL),y) ifeq ($(CONFIG_BUILD_KERNEL),y)
CMN_CSRCS += up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_task_start.c up_pthread_start.c
endif endif
ifeq ($(CONFIG_ARCH_ADDRENV),y) ifeq ($(CONFIG_ARCH_ADDRENV),y)
+8 -7
View File
@@ -36,13 +36,14 @@
HEAD_ASRC = up_nommuhead.S HEAD_ASRC = up_nommuhead.S
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S vfork.S CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S vfork.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c \
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c up_doirq.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c
up_exit.c up_idle.c up_initialize.c up_initialstate.c \ CMN_CSRCS += up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c up_doirq.c
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \ CMN_CSRCS += up_exit.c up_idle.c up_initialize.c up_initialstate.c
up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \ CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c
up_sigdeliver.c up_syscall.c up_unblocktask.c \ CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c
up_undefinedinsn.c up_usestack.c up_vfork.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_syscall.c up_unblocktask.c
CMN_CSRCS += up_undefinedinsn.c up_usestack.c up_vfork.c
ifeq ($(CONFIG_ELF),y) ifeq ($(CONFIG_ELF),y)
CMN_CSRCS += up_elf.c CMN_CSRCS += up_elf.c
+1 -1
View File
@@ -45,7 +45,7 @@ CMN_CSRCS += up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c
CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialstate.c up_initialize.c CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialstate.c up_initialize.c
CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c
CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c
CMN_CSRCS += up_sigdeliver.c up_syscall.c up_unblocktask.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_syscall.c up_unblocktask.c
CMN_CSRCS += up_undefinedinsn.c up_usestack.c calypso_power.c up_vfork.c CMN_CSRCS += up_undefinedinsn.c up_usestack.c calypso_power.c up_vfork.c
ifeq ($(CONFIG_ELF),y) ifeq ($(CONFIG_ELF),y)
+13 -11
View File
@@ -35,15 +35,16 @@
HEAD_ASRC = up_head.S HEAD_ASRC = up_head.S
CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S \ CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S
up_vectors.S up_vectoraddrexcptn.S up_vectortab.S vfork.S CMN_ASRCS += up_vectors.S up_vectoraddrexcptn.S up_vectortab.S vfork.S
CMN_CSRCS = up_assert.c up_blocktask.c up_copyfullstate.c up_createstack.c \
up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c \ CMN_CSRCS = up_assert.c up_blocktask.c up_copyfullstate.c up_createstack.c
up_initialize.c up_initialstate.c up_interruptcontext.c \ CMN_CSRCS += up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c
up_prefetchabort.c up_releasepending.c up_releasestack.c \ CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
up_reprioritizertr.c up_schedulesigaction.c \ CMN_CSRCS += up_prefetchabort.c up_releasepending.c up_releasestack.c
up_sigdeliver.c up_syscall.c up_unblocktask.c \ CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c
up_undefinedinsn.c up_usestack.c up_vfork.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_syscall.c up_unblocktask.c
CMN_CSRCS += up_undefinedinsn.c up_usestack.c up_vfork.c
ifeq ($(CONFIG_ELF),y) ifeq ($(CONFIG_ELF),y)
CMN_CSRCS += up_elf.c CMN_CSRCS += up_elf.c
@@ -54,8 +55,9 @@ CMN_CSRCS += up_checkstack.c
endif endif
CHIP_ASRCS = dm320_lowputc.S dm320_restart.S CHIP_ASRCS = dm320_lowputc.S dm320_restart.S
CHIP_CSRCS = dm320_allocateheap.c dm320_boot.c dm320_decodeirq.c \
dm320_irq.c dm320_serial.c dm320_framebuffer.c CHIP_CSRCS = dm320_allocateheap.c dm320_boot.c dm320_decodeirq.c
CHIP_CSRCS += dm320_irq.c dm320_serial.c dm320_framebuffer.c
ifneq ($(CONFIG_SCHED_TICKLESS),y) ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += dm320_timerisr.c CHIP_CSRCS += dm320_timerisr.c
+11 -11
View File
@@ -35,15 +35,15 @@
HEAD_ASRC = up_head.S HEAD_ASRC = up_head.S
CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S \ CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S
up_vectors.S up_vectoraddrexcptn.S up_vectortab.S vfork.S CMN_ASRCS += up_vectors.S up_vectoraddrexcptn.S up_vectortab.S vfork.S
CMN_CSRCS = up_assert.c up_blocktask.c up_copyfullstate.c up_createstack.c \ CMN_CSRCS = up_assert.c up_blocktask.c up_copyfullstate.c up_createstack.c
up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c \ CMN_CSRCS += up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c
up_initialize.c up_initialstate.c up_interruptcontext.c \ CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
up_prefetchabort.c up_releasepending.c up_releasestack.c \ CMN_CSRCS += up_prefetchabort.c up_releasepending.c up_releasestack.c
up_reprioritizertr.c up_schedulesigaction.c \ CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c
up_sigdeliver.c up_syscall.c up_unblocktask.c \ CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_syscall.c up_unblocktask.c
up_undefinedinsn.c up_usestack.c up_vfork.c CMN_CSRCS += up_undefinedinsn.c up_usestack.c up_vfork.c
ifeq ($(CONFIG_ELF),y) ifeq ($(CONFIG_ELF),y)
CMN_CSRCS += up_elf.c CMN_CSRCS += up_elf.c
@@ -54,8 +54,8 @@ CMN_CSRCS += up_checkstack.c
endif endif
CHIP_ASRCS = imx_lowputc.S CHIP_ASRCS = imx_lowputc.S
CHIP_CSRCS = imx_boot.c imx_gpio.c imx_allocateheap.c imx_irq.c \ CHIP_CSRCS = imx_boot.c imx_gpio.c imx_allocateheap.c imx_irq.c
imx_serial.c imx_decodeirq.c imx_spi.c CHIP_CSRCS += imx_serial.c imx_decodeirq.c imx_spi.c
ifneq ($(CONFIG_SCHED_TICKLESS),y) ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += imx_timerisr.c CHIP_CSRCS += imx_timerisr.c
+3 -3
View File
@@ -47,8 +47,8 @@ CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_initialize.c up_memfault.c
CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_modifyreg8.c CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_modifyreg8.c
CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasestack.c CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasestack.c
CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c up_releasepending.c CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c up_releasepending.c
CMN_CSRCS += up_sigdeliver.c up_unblocktask.c up_usestack.c up_doirq.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_unblocktask.c up_usestack.c
CMN_CSRCS += up_hardfault.c up_svcall.c up_checkstack.c up_vfork.c CMN_CSRCS += up_doirq.c up_hardfault.c up_svcall.c up_checkstack.c up_vfork.c
ifeq ($(CONFIG_ARCH_RAMVECTORS),y) ifeq ($(CONFIG_ARCH_RAMVECTORS),y)
CMN_CSRCS += up_ramvec_initialize.c up_ramvec_attach.c CMN_CSRCS += up_ramvec_initialize.c up_ramvec_attach.c
@@ -59,7 +59,7 @@ CMN_ASRCS += up_memcpy.S
endif endif
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+4 -4
View File
@@ -43,12 +43,12 @@ CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c
CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_puts.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_puts.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_systemreset.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_hardfault.c CMN_CSRCS += up_systemreset.c up_unblocktask.c up_usestack.c up_doirq.c
CMN_CSRCS += up_svcall.c up_vectors.c up_vfork.c CMN_CSRCS += up_hardfault.c up_svcall.c up_vectors.c up_vfork.c
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+3 -3
View File
@@ -54,8 +54,8 @@ CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_initialize.c up_memfault.c
CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_modifyreg8.c CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_modifyreg8.c
CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasepending.c CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasepending.c
CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c
CMN_CSRCS += up_sigdeliver.c up_unblocktask.c up_usestack.c up_doirq.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_unblocktask.c up_usestack.c
CMN_CSRCS += up_hardfault.c up_svcall.c up_checkstack.c up_vfork.c CMN_CSRCS += up_doirq.c up_hardfault.c up_svcall.c up_checkstack.c up_vfork.c
ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y) ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y)
CMN_ASRCS += up_exception.S CMN_ASRCS += up_exception.S
@@ -71,7 +71,7 @@ CMN_ASRCS += up_memcpy.S
endif endif
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+10 -9
View File
@@ -35,14 +35,16 @@
HEAD_ASRC = lpc214x_head.S HEAD_ASRC = lpc214x_head.S
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S \ CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S
vfork.S CMN_ASRCS += vfork.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c \
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c
up_exit.c up_idle.c up_initialize.c up_initialstate.c \ CMN_CSRCS += up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \ CMN_CSRCS += up_exit.c up_idle.c up_initialize.c up_initialstate.c
up_releasestack.c up_reprioritizertr.c up_syscall.c up_unblocktask.c \ CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c
up_undefinedinsn.c up_usestack.c up_lowputs.c up_vfork.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_stackframe.c
CMN_CSRCS += up_syscall.c up_unblocktask.c up_undefinedinsn.c up_usestack.c
CMN_CSRCS += up_lowputs.c up_vfork.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c
@@ -66,4 +68,3 @@ endif
ifeq ($(CONFIG_USBDEV),y) ifeq ($(CONFIG_USBDEV),y)
CHIP_CSRCS += lpc214x_usbdev.c CHIP_CSRCS += lpc214x_usbdev.c
endif endif
+11 -11
View File
@@ -40,14 +40,15 @@
HEAD_ASRC = lpc23xx_head.S HEAD_ASRC = lpc23xx_head.S
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S \ CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S
vfork.S CMN_ASRCS += vfork.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c \ CMN_CSRCS += up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c
up_exit.c up_idle.c up_initialize.c up_initialstate.c \ CMN_CSRCS += up_exit.c up_idle.c up_initialize.c up_initialstate.c
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \ CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c
up_releasestack.c up_reprioritizertr.c up_syscall.c up_unblocktask.c \ CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_stackframe.c
up_undefinedinsn.c up_usestack.c up_lowputs.c up_vfork.c CMN_CSRCS += up_syscall.c up_unblocktask.c up_undefinedinsn.c
CMN_CSRCS += up_usestack.c up_lowputs.c up_vfork.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c
@@ -62,8 +63,8 @@ CMN_CSRCS += up_checkstack.c
endif endif
CHIP_ASRCS = lpc23xx_lowputc.S CHIP_ASRCS = lpc23xx_lowputc.S
CHIP_CSRCS = lpc23xx_pllsetup.c lpc23xx_decodeirq.c lpc23xx_irq.c \ CHIP_CSRCS += lpc23xx_pllsetup.c lpc23xx_decodeirq.c lpc23xx_irq.c
lpc23xx_serial.c lpc23xx_io.c CHIP_CSRCS += lpc23xx_serial.c lpc23xx_io.c
ifneq ($(CONFIG_SCHED_TICKLESS),y) ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += lpc23xx_timerisr.c CHIP_CSRCS += lpc23xx_timerisr.c
@@ -80,4 +81,3 @@ endif
ifeq ($(CONFIG_USBDEV),y) ifeq ($(CONFIG_USBDEV),y)
#CHIP_CSRCS += lpc23xx_usbdev.c #CHIP_CSRCS += lpc23xx_usbdev.c
endif endif
+1 -1
View File
@@ -44,7 +44,7 @@ CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_prefetchabort.c up_releasepending.c up_releasestack.c CMN_CSRCS += up_prefetchabort.c up_releasepending.c up_releasestack.c
CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c
CMN_CSRCS += up_sigdeliver.c up_syscall.c up_unblocktask.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_syscall.c up_unblocktask.c
CMN_CSRCS += up_undefinedinsn.c up_usestack.c up_vfork.c CMN_CSRCS += up_undefinedinsn.c up_usestack.c up_vfork.c
ifeq ($(CONFIG_PAGING),y) ifeq ($(CONFIG_PAGING),y)
+4 -3
View File
@@ -43,8 +43,9 @@ CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c
CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_memfault.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_memfault.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_unblocktask.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
CMN_CSRCS += up_usestack.c up_doirq.c up_hardfault.c up_svcall.c up_vfork.c CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_hardfault.c
CMN_CSRCS += up_svcall.c up_vfork.c
ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y) ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y)
CMN_ASRCS += up_exception.S CMN_ASRCS += up_exception.S
@@ -60,7 +61,7 @@ CMN_ASRCS += up_memcpy.S
endif endif
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+4 -4
View File
@@ -43,12 +43,12 @@ CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c
CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_systemreset.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_hardfault.c CMN_CSRCS += up_systemreset.c up_unblocktask.c up_usestack.c up_doirq.c
CMN_CSRCS += up_svcall.c up_vectors.c up_vfork.c CMN_CSRCS += up_hardfault.c up_svcall.c up_vectors.c up_vfork.c
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+3 -3
View File
@@ -49,8 +49,8 @@ CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_idle.c up_initialize.c
CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_memfault.c up_modifyreg8.c CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_memfault.c up_modifyreg8.c
CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasepending.c CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasepending.c
CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c
CMN_CSRCS += up_sigdeliver.c up_unblocktask.c up_usestack.c up_doirq.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_unblocktask.c up_usestack.c
CMN_CSRCS += up_hardfault.c up_svcall.c up_vfork.c CMN_CSRCS += up_doirq.c up_hardfault.c up_svcall.c up_vfork.c
# Configuration-dependent common files # Configuration-dependent common files
@@ -63,7 +63,7 @@ CMN_ASRCS += up_memcpy.S
endif endif
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+2 -2
View File
@@ -64,7 +64,7 @@ endif
CMN_CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_exit.c CMN_CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_exit.c
CMN_CSRCS += up_createstack.c up_releasestack.c up_usestack.c up_vfork.c CMN_CSRCS += up_createstack.c up_releasestack.c up_usestack.c up_vfork.c
CMN_CSRCS += up_puts.c up_mdelay.c up_udelay.c CMN_CSRCS += up_puts.c up_mdelay.c up_stackframe.c up_udelay.c
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_dataabort.c CMN_CSRCS += arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_dataabort.c
@@ -85,7 +85,7 @@ CMN_CSRCS += arm_va2pte.c
endif endif
ifeq ($(CONFIG_BUILD_KERNEL),y) ifeq ($(CONFIG_BUILD_KERNEL),y)
CMN_CSRCS += up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_task_start.c up_pthread_start.c
endif endif
ifeq ($(CONFIG_ARCH_ADDRENV),y) ifeq ($(CONFIG_ARCH_ADDRENV),y)
+4 -4
View File
@@ -43,12 +43,12 @@ CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c
CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_systemreset.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_hardfault.c CMN_CSRCS += up_systemreset.c up_unblocktask.c up_usestack.c up_doirq.c
CMN_CSRCS += up_svcall.c up_vectors.c up_vfork.c CMN_CSRCS += up_hardfault.c up_svcall.c up_vectors.c up_vfork.c
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+4 -4
View File
@@ -50,9 +50,9 @@ CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c
CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_memfault.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_memfault.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_systemreset.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_hardfault.c CMN_CSRCS += up_systemreset.c up_unblocktask.c up_usestack.c up_doirq.c
CMN_CSRCS += up_svcall.c up_vfork.c CMN_CSRCS += up_hardfault.c up_svcall.c up_vfork.c
ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y) ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y)
CMN_ASRCS += up_exception.S CMN_ASRCS += up_exception.S
@@ -68,7 +68,7 @@ CMN_ASRCS += up_memcpy.S
endif endif
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+14 -12
View File
@@ -35,14 +35,16 @@
HEAD_ASRC = str71x_head.S HEAD_ASRC = str71x_head.S
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S \ CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S
vfork.S CMN_ASRCS += vfork.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c \
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c
up_exit.c up_idle.c up_initialize.c up_initialstate.c \ CMN_CSRCS += up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \ CMN_CSRCS += up_exit.c up_idle.c up_initialize.c up_initialstate.c
up_releasestack.c up_reprioritizertr.c up_syscall.c up_unblocktask.c \ CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c
up_undefinedinsn.c up_usestack.c up_lowputs.c up_vfork.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_stackframe.c
CMN_CSRCS += up_syscall.c up_unblocktask.c up_undefinedinsn.c up_usestack.c
CMN_CSRCS += up_lowputs.c up_vfork.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c
@@ -57,18 +59,18 @@ CMN_CSRCS += up_checkstack.c
endif endif
CHIP_ASRCS = CHIP_ASRCS =
CHIP_CSRCS = str71x_prccu.c str71x_lowputc.c str71x_decodeirq.c str71x_irq.c \ CHIP_CSRCS = str71x_prccu.c str71x_lowputc.c str71x_decodeirq.c str71x_irq.c
str71x_serial.c CHIP_CSRCS += str71x_serial.c
ifneq ($(CONFIG_SCHED_TICKLESS),y) ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += str71x_timerisr.c CHIP_CSRCS += str71x_timerisr.c
endif endif
ifeq ($(CONFIG_USBDEV),y) ifeq ($(CONFIG_USBDEV),y)
CHIP_CSRCS += str71x_usbdev.c CHIP_CSRCS+= str71x_usbdev.c
endif endif
ifeq ($(CONFIG_STR71X_XTI),y) ifeq ($(CONFIG_STR71X_XTI),y)
CHIP_CSRCS += str71x_xti.c CHIP_CSRCS+= str71x_xti.c
endif endif
+4 -3
View File
@@ -43,8 +43,9 @@ CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_idle.c up_initialize.c
CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_memfault.c CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_memfault.c
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_unblocktask.c CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
CMN_CSRCS += up_usestack.c up_doirq.c up_hardfault.c up_svcall.c up_vfork.c CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_hardfault.c
CMN_CSRCS += up_svcall.c up_vfork.c
ifeq ($(CONFIG_ARCH_RAMVECTORS),y) ifeq ($(CONFIG_ARCH_RAMVECTORS),y)
CMN_CSRCS += up_ramvec_initialize.c up_ramvec_attach.c CMN_CSRCS += up_ramvec_initialize.c up_ramvec_attach.c
@@ -59,7 +60,7 @@ CMN_CSRCS += up_checkstack.c
endif endif
ifeq ($(CONFIG_BUILD_PROTECTED),y) ifeq ($(CONFIG_BUILD_PROTECTED),y)
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c up_stackframe.c CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += up_signal_dispatch.c CMN_CSRCS += up_signal_dispatch.c
CMN_UASRCS += up_signal_handler.S CMN_UASRCS += up_signal_handler.S
+9 -9
View File
@@ -40,13 +40,13 @@ HEAD_ASRC = up_nommuhead.S
# Common AVR/AVR32 files # Common AVR/AVR32 files
CMN_ASRCS = up_exceptions.S up_fullcontextrestore.S up_switchcontext.S CMN_ASRCS = up_exceptions.S up_fullcontextrestore.S up_switchcontext.S
CMN_CSRCS = up_assert.c up_allocateheap.c up_blocktask.c up_copystate.c \ CMN_CSRCS = up_assert.c up_allocateheap.c up_blocktask.c up_copystate.c
up_createstack.c up_mdelay.c up_udelay.c up_exit.c up_idle.c \ CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c up_idle.c
up_initialize.c up_initialstate.c up_interruptcontext.c \ CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c \ CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
up_releasepending.c up_releasestack.c up_reprioritizertr.c \ CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
up_schedulesigaction.c up_sigdeliver.c up_unblocktask.c \ CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
up_usestack.c up_doirq.c CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c
# Configuration-dependent common files # Configuration-dependent common files
@@ -57,8 +57,8 @@ endif
# Required AT32UC3 files # Required AT32UC3 files
CHIP_ASRCS = CHIP_ASRCS =
CHIP_CSRCS = at32uc3_clkinit.c at32uc3_gpio.c at32uc3_irq.c \ CHIP_CSRCS = at32uc3_clkinit.c at32uc3_gpio.c at32uc3_irq.c
at32uc3_lowconsole.c at32uc3_lowinit.c at32uc3_serial.c CHIP_CSRCS += at32uc3_lowconsole.c at32uc3_lowinit.c at32uc3_serial.c
# Configuration-dependent AT32UC3 files # Configuration-dependent AT32UC3 files
+7 -8
View File
@@ -40,13 +40,13 @@ HEAD_ASRC = at90usb_head.S
# Common AVR files # Common AVR files
CMN_ASRCS = up_switchcontext.S CMN_ASRCS = up_switchcontext.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c
up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c \ CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
up_initialstate.c up_interruptcontext.c up_irq.c up_lowputs.c \ CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_irq.c up_lowputs.c
up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c \ CMN_CSRCS += up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
up_puts.c up_releasepending.c up_releasestack.c \ CMN_CSRCS += up_puts.c up_releasepending.c up_releasestack.c
up_reprioritizertr.c up_schedulesigaction.c up_sigdeliver.c \ CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c up_sigdeliver.c
up_udelay.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_stackframe.c up_udelay.c up_unblocktask.c up_usestack.c
# Configuration-dependent common files # Configuration-dependent common files
@@ -80,4 +80,3 @@ endif
ifeq ($(CONFIG_AVR_USBDEV),y) ifeq ($(CONFIG_AVR_USBDEV),y)
CHIP_CSRCS += at90usb_usbdev.c CHIP_CSRCS += at90usb_usbdev.c
endif endif
+7 -7
View File
@@ -40,13 +40,13 @@ HEAD_ASRC = atmega_head.S
# Common AVR files # Common AVR files
CMN_ASRCS = up_switchcontext.S CMN_ASRCS = up_switchcontext.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c
up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c \ CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
up_initialstate.c up_interruptcontext.c up_irq.c up_lowputs.c \ CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_irq.c up_lowputs.c
up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c \ CMN_CSRCS += up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
up_puts.c up_releasepending.c up_releasestack.c \ CMN_CSRCS += up_puts.c up_releasepending.c up_releasestack.c
up_reprioritizertr.c up_schedulesigaction.c up_sigdeliver.c \ CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c up_sigdeliver.c
up_udelay.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_stackframe.c up_udelay.c up_unblocktask.c up_usestack.c
# Configuration-dependent common files # Configuration-dependent common files
+1
View File
@@ -123,3 +123,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint8_t)); return (FAR void *)(topaddr + sizeof(uint8_t));
} }
+1
View File
@@ -138,3 +138,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+1
View File
@@ -139,3 +139,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint16_t)); return (FAR void *)(topaddr + sizeof(uint16_t));
} }
+8 -8
View File
@@ -36,20 +36,20 @@
HEAD_ASRC = m9s12_vectors.S HEAD_ASRC = m9s12_vectors.S
CMN_ASRCS = CMN_ASRCS =
CMN_CSRCS = up_allocateheap.c up_blocktask.c up_copystate.c up_createstack.c \ CMN_CSRCS = up_allocateheap.c up_blocktask.c up_copystate.c up_createstack.c
up_doirq.c up_exit.c up_idle.c up_initialize.c up_interruptcontext.c \ CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialize.c up_interruptcontext.c
up_mdelay.c up_modifyreg16.c up_modifyreg32.c up_modifyreg8.c \ CMN_CSRCS += up_mdelay.c up_modifyreg16.c up_modifyreg32.c up_modifyreg8.c
up_puts.c up_releasepending.c up_releasestack.c up_reprioritizertr.c \ CMN_CSRCS += up_puts.c up_releasepending.c up_releasestack.c up_reprioritizertr.c
up_udelay.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_stackframe.c up_udelay.c up_unblocktask.c up_usestack.c
CHIP_ASRCS = m9s12_start.S m9s12_lowputc.S m9s12_saveusercontext.S CHIP_ASRCS = m9s12_start.S m9s12_lowputc.S m9s12_saveusercontext.S
CHIP_CSRCS = m9s12_assert.c m9s12_gpio.c m9s12_gpioirq.c m9s12_initialstate.c \ CHIP_CSRCS = m9s12_assert.c m9s12_gpio.c m9s12_gpioirq.c m9s12_initialstate.c
m9s12_irq.c m9s12_serial.c CHIP_CSRCS += m9s12_irq.c m9s12_serial.c
ifneq ($(CONFIG_SCHED_TICKLESS),y) ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += m9s12_timerisr.c CHIP_CSRCS += m9s12_timerisr.c
endif endif
ifeq ($(CONFIG_DEBUG_GPIO),y) ifeq ($(CONFIG_DEBUG_GPIO),y)
CHIP_CSRCS += m9s12_dumpgpio.c CHIP_CSRCS+= m9s12_dumpgpio.c
endif endif
+1
View File
@@ -140,3 +140,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+11 -10
View File
@@ -40,13 +40,14 @@ HEAD_ASRC = pic32mx-head.S
# Common MIPS files # Common MIPS files
CMN_ASRCS = up_syscall0.S vfork.S CMN_ASRCS = up_syscall0.S vfork.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c
up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c \ CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
up_initialstate.c up_interruptcontext.c up_irq.c up_lowputs.c \ CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_irq.c up_lowputs.c
up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c \ CMN_CSRCS += up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
up_puts.c up_releasepending.c up_releasestack.c up_reprioritizertr.c \ CMN_CSRCS += up_puts.c up_releasepending.c up_releasestack.c
up_schedulesigaction.c up_sigdeliver.c up_swint0.c up_udelay.c \ CMN_CSRCS += up_reprioritizertr.c up_schedulesigaction.c up_sigdeliver.c
up_unblocktask.c up_usestack.c up_vfork.c CMN_CSRCS += up_stackframe.c up_swint0.c up_udelay.c up_unblocktask.c
CMN_CSRCS += up_usestack.c up_vfork.c
# Configuration dependent common files # Configuration dependent common files
@@ -63,8 +64,9 @@ endif
# Required PIC32MX files # Required PIC32MX files
CHIP_ASRCS = CHIP_ASRCS =
CHIP_CSRCS = pic32mx-irq.c pic32mx-decodeirq.c pic32mx-exception.c pic32mx-gpio.c \ CHIP_CSRCS = pic32mx-irq.c pic32mx-decodeirq.c pic32mx-exception.c
pic32mx-lowconsole.c pic32mx-lowinit.c pic32mx-serial.c pic32mx-spi.c CHIP_CSRCS += pic32mx-gpio.c pic32mx-lowconsole.c pic32mx-lowinit.c
CHIP_CSRCS += pic32mx-serial.c pic32mx-spi.cO
# Configuration-dependent PIC32MX files # Configuration-dependent PIC32MX files
@@ -83,4 +85,3 @@ endif
ifeq ($(CONFIG_PIC32MX_ETHERNET),y) ifeq ($(CONFIG_PIC32MX_ETHERNET),y)
CHIP_CSRCS += pic32mx-ethernet.c CHIP_CSRCS += pic32mx-ethernet.c
endif endif
-2
View File
@@ -170,7 +170,6 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
return OK; return OK;
} }
#ifdef CONFIG_BUILD_KERNEL
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size) FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
{ {
uintptr_t topaddr; uintptr_t topaddr;
@@ -199,7 +198,6 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
#endif
void up_release_stack(struct tcb_s *dtcb, uint8_t ttype) void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
{ {
+1
View File
@@ -136,3 +136,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+7 -9
View File
@@ -36,15 +36,15 @@
HEAD_ASRC = m16c_head.S HEAD_ASRC = m16c_head.S
CMN_ASRCS = CMN_ASRCS =
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c \ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c
up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c \ CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
up_interruptcontext.c up_lowputs.c up_mdelay.c up_puts.c \ CMN_CSRCS += up_interruptcontext.c up_lowputs.c up_mdelay.c up_puts.c
up_releasepending.c up_releasestack.c up_reprioritizertr.c \ CMN_CSRCS += up_releasepending.c up_releasestack.c up_reprioritizertr.c
up_udelay.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_stackframe.c up_udelay.c up_unblocktask.c up_usestack.c
CHIP_ASRCS = m16c_vectors.S CHIP_ASRCS = m16c_vectors.S
CHIP_CSRCS = m16c_initialstate.c m16c_copystate.c m16c_lowputc.c m16c_irq.c \ CHIP_CSRCS = m16c_initialstate.c m16c_copystate.c m16c_lowputc.c m16c_irq.c
m16c_serial.c m16c_dumpstate.c CHIP_CSRCS += m16c_serial.c m16c_dumpstate.c
ifneq ($(CONFIG_SCHED_TICKLESS),y) ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += m16c_timerisr.c CHIP_CSRCS += m16c_timerisr.c
@@ -53,5 +53,3 @@ endif
ifneq ($(CONFIG_DISABLE_SIGNALS),y) ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CHIP_CSRCS += m16c_schedulesigaction.c m16c_sigdeliver.c CHIP_CSRCS += m16c_schedulesigaction.c m16c_sigdeliver.c
endif endif
+2 -1
View File
@@ -40,7 +40,8 @@ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c
CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_lowputs.c CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_lowputs.c
CMN_CSRCS += up_mdelay.c up_puts.c up_releasepending.c up_releasestack.c CMN_CSRCS += up_mdelay.c up_puts.c up_releasepending.c up_releasestack.c
CMN_CSRCS += up_reprioritizertr.c up_udelay.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_reprioritizertr.c up_stackframe.c up_udelay.c
CMN_CSRCS += up_unblocktask.c up_usestack.c
CHIP_ASRCS = sh1_vector.S sh1_saveusercontext.S CHIP_ASRCS = sh1_vector.S sh1_saveusercontext.S
CHIP_CSRCS = sh1_lowputc.c sh1_irq.c sh1_serial.c sh1_initialstate.c CHIP_CSRCS = sh1_lowputc.c sh1_irq.c sh1_serial.c sh1_initialstate.c
+1
View File
@@ -138,3 +138,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+1
View File
@@ -139,3 +139,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+2 -1
View File
@@ -46,7 +46,8 @@ CMN_CSRCS += up_initialize.c up_initialstate.c up_interruptcontext.c
CMN_CSRCS += up_irq.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c CMN_CSRCS += up_irq.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
CMN_CSRCS += up_regdump.c up_releasepending.c up_releasestack.c CMN_CSRCS += up_regdump.c up_releasepending.c up_releasestack.c
CMN_CSRCS += up_reprioritizertr.c up_savestate.c up_sigdeliver.c CMN_CSRCS += up_reprioritizertr.c up_savestate.c up_sigdeliver.c
CMN_CSRCS += up_schedulesigaction.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_schedulesigaction.c up_stackframe.c up_unblocktask.c
CMN_CSRCS += up_usestack.c
# Required QEMU files # Required QEMU files
+1
View File
@@ -137,3 +137,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+2 -1
View File
@@ -41,7 +41,8 @@ CMN_CSRCS += up_assert.c up_initialstate.c up_sigdeliver.c up_blocktask.c
CMN_CSRCS += up_interruptcontext.c up_stackdump.c up_copystate.c CMN_CSRCS += up_interruptcontext.c up_stackdump.c up_copystate.c
CMN_CSRCS += up_mdelay.c up_udelay.c up_createstack.c up_registerdump.c CMN_CSRCS += up_mdelay.c up_udelay.c up_createstack.c up_registerdump.c
CMN_CSRCS += up_unblocktask.c up_doirq.c up_releasepending.c up_usestack.c CMN_CSRCS += up_unblocktask.c up_doirq.c up_releasepending.c up_usestack.c
CMN_CSRCS += up_exit.c up_releasestack.c up_idle.c up_reprioritizertr.c CMN_CSRCS += up_exit.c up_releasestack.c up_stackframe.c up_idle.c
CMN_CSRCS += up_reprioritizertr.c
CHIP_SSRCS = z16f_lowuart.S z16f_saveusercontext.S z16f_restoreusercontext.S CHIP_SSRCS = z16f_lowuart.S z16f_saveusercontext.S z16f_restoreusercontext.S
CHIP_CSRCS = z16f_clkinit.c z16f_sysexec.c z16f_irq.c z16f_serial.c CHIP_CSRCS = z16f_clkinit.c z16f_sysexec.c z16f_irq.c z16f_serial.c
+1
View File
@@ -136,3 +136,4 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
return (FAR void *)(topaddr + sizeof(uint32_t)); return (FAR void *)(topaddr + sizeof(uint32_t));
} }
+7 -6
View File
@@ -37,13 +37,14 @@ HEAD_ASRC = ez80_vectors.asm
HEAD_SSRC = HEAD_SSRC =
CMN_SSRCS = CMN_SSRCS =
CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \ CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c
up_releasestack.c up_interruptcontext.c up_blocktask.c \ CMN_CSRCS += up_releasestack.c up_interruptcontext.c up_blocktask.c
up_unblocktask.c up_exit.c up_releasepending.c \ CMN_CSRCS += up_unblocktask.c up_exit.c up_releasepending.c
up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c \ CMN_CSRCS += up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c
up_mdelay.c up_udelay.c up_usestack.c up_puts.c CMN_CSRCS += up_mdelay.c up_stackframe.c up_udelay.c up_usestack.c
CMN_CSRCS += up_puts.c
CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_irqsave.asm \ CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_irqsave.asm
ez80_saveusercontext.asm ez80_restorecontext.asm ez80_saveusercontext.asm ez80_restorecontext.asm
ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y)
CHIP_ASRCS += ez80f91_init.asm CHIP_ASRCS += ez80f91_init.asm
+2 -2
View File
@@ -45,8 +45,8 @@ CMN_ASRCS =
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_createstack.c CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_createstack.c
CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialize.c CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialize.c
CMN_CSRCS += up_interruptcontext.c up_mdelay.c up_releasepending.c CMN_CSRCS += up_interruptcontext.c up_mdelay.c up_releasepending.c
CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_unblocktask.c CMN_CSRCS += up_releasestack.c up_stackframe.c up_reprioritizertr.c
CMN_CSRCS += up_udelay.c up_usestack.c CMN_CSRCS += up_unblocktask.c up_udelay.c up_usestack.c
CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm
CHIP_ASRCS += z180_vectcommon.asm CHIP_ASRCS += z180_vectcommon.asm
+5 -5
View File
@@ -36,11 +36,11 @@
HEAD_SSRC = z8_head.S HEAD_SSRC = z8_head.S
CMN_SSRCS = CMN_SSRCS =
CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \ CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c
up_releasestack.c up_interruptcontext.c up_blocktask.c \ CMN_CSRCS += up_releasestack.c up_interruptcontext.c up_blocktask.c
up_unblocktask.c up_exit.c up_releasepending.c \ CMN_CSRCS += up_unblocktask.c up_exit.c up_releasepending.c
up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c \ CMN_CSRCS += up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c
up_mdelay.c up_udelay.c up_usestack.c CMN_CSRCS += up_mdelay.c up_stackframe.c up_udelay.c up_usestack.c
CHIP_SSRCS = z8_vector.S z8_saveusercontext.S z8_restorecontext.S CHIP_SSRCS = z8_vector.S z8_saveusercontext.S z8_restorecontext.S
CHIP_CSRCS = z8_initialstate.c z8_irq.c z8_saveirqcontext.c CHIP_CSRCS = z8_initialstate.c z8_irq.c z8_saveirqcontext.c
+9 -8
View File
@@ -42,14 +42,15 @@ endif
endif endif
CMN_ASRCS = CMN_ASRCS =
CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \
up_releasestack.c up_interruptcontext.c up_blocktask.c \ CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c
up_unblocktask.c up_exit.c up_releasepending.c \ CMN_CSRCS += up_releasestack.c up_interruptcontext.c up_blocktask.c
up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c \ CMN_CSRCS += up_unblocktask.c up_exit.c up_releasepending.c
up_mdelay.c up_udelay.c up_usestack.c CMN_CSRCS += up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c
CMN_CSRCS += up_mdelay.c up_stackframe.c up_udelay.c up_usestack.c
CHIP_ASRCS = z80_saveusercontext.asm z80_restoreusercontext.asm CHIP_ASRCS = z80_saveusercontext.asm z80_restoreusercontext.asm
CHIP_CSRCS = z80_initialstate.c z80_io.c z80_irq.c z80_copystate.c \
z80_schedulesigaction.c z80_sigdeliver.c \
z80_registerdump.c
CHIP_CSRCS = z80_initialstate.c z80_io.c z80_irq.c z80_copystate.c
CHIP_CSRCS += z80_schedulesigaction.c z80_sigdeliver.c
CHIP_CSRCS += z80_registerdump.c
+1 -3
View File
@@ -277,7 +277,7 @@ int up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size);
* *
* Description: * Description:
* Allocate a stack frame in the TCB's stack to hold thread-specific data. * Allocate a stack frame in the TCB's stack to hold thread-specific data.
* This function may be called anytime after up_create_stack() or * This function may be called any time after up_create_stack() or
* up_use_stack() have been called but before the task has been started. * up_use_stack() have been called but before the task has been started.
* *
* Thread data may be kept in the stack (instead of in the TCB) if it is * Thread data may be kept in the stack (instead of in the TCB) if it is
@@ -304,9 +304,7 @@ int up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size);
* *
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size); FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size);
#endif
/**************************************************************************** /****************************************************************************
* Name: up_release_stack * Name: up_release_stack
-10
View File
@@ -557,17 +557,7 @@ struct task_tcb_s
/* Values needed to restart a task ********************************************/ /* Values needed to restart a task ********************************************/
uint8_t init_priority; /* Initial priority of the task */ uint8_t init_priority; /* Initial priority of the task */
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
/* In the kernel mode build, the arguments are saved on the task's stack */
FAR char **argv; /* Name+start-up parameters */ FAR char **argv; /* Name+start-up parameters */
#else
/* Otherwise, the arguments are strdup'ed and the argv[] is statically */
/* defined here: */
char *argv[CONFIG_MAX_TASK_ARGS+1]; /* Name+start-up parameters */
#endif
}; };
/* struct pthread_tcb_s **********************************************************/ /* struct pthread_tcb_s **********************************************************/
+1 -26
View File
@@ -111,9 +111,6 @@ static void sched_releasepid(pid_t pid)
int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype) int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype)
{ {
int ret = OK; int ret = OK;
#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
int i;
#endif
if (tcb) if (tcb)
{ {
@@ -150,7 +147,7 @@ int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype)
up_release_stack(tcb, ttype); up_release_stack(tcb, ttype);
} }
/* Delete the tasks's allocated DSpace region (external modules only) */ /* Delete the task's allocated DSpace region (external modules only) */
#ifdef CONFIG_PIC #ifdef CONFIG_PIC
if (tcb->dspace) if (tcb->dspace)
@@ -166,28 +163,6 @@ int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype)
} }
#endif #endif
#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
/* Release command line arguments that were allocated for task
* start/re-start.
*
* NOTE: In the kernel mode build, the arguments were saved on
* the task's stack and will be cleaned up when the stack memory
* is released. Nothing need be done here in that case.
*/
#ifndef CONFIG_DISABLE_PTHREAD
if (ttype != TCB_FLAG_TTYPE_PTHREAD)
#endif
{
FAR struct task_tcb_s *ttcb = (FAR struct task_tcb_s *)tcb;
for (i = 1; i < CONFIG_MAX_TASK_ARGS+1 && ttcb->argv[i]; i++)
{
sched_kfree((FAR void*)ttcb->argv[i]);
}
}
#endif /* !CONFIG_BUILD_PROTECTED && !CONFIG_BUILD_KERNEL */
/* Release this thread's reference to the address environment */ /* Release this thread's reference to the address environment */
#ifdef CONFIG_ARCH_ADDRENV #ifdef CONFIG_ARCH_ADDRENV
+17 -101
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/task/task_setup.c * sched/task/task_setup.c
* *
* Copyright (C) 2007-2013 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -426,97 +426,30 @@ static void task_namesetup(FAR struct task_tcb_s *tcb, FAR const char *name)
# define task_namesetup(t,n) # define task_namesetup(t,n)
#endif /* CONFIG_TASK_NAME_SIZE */ #endif /* CONFIG_TASK_NAME_SIZE */
/****************************************************************************
* Name: task_tcbargsetup
*
* Description:
* This functions is called only from task_argsetup() in the "normal"
* case, where the argv[] array is a structure in the TCB. This function
* will clone all of the arguments using strdup.
*
* Input Parameters:
* tcb - Address of the new task's TCB
* argv - A pointer to an array of input parameters.
* Up to CONFIG_MAX_TASK_ARG parameters may be
* provided. If fewer than CONFIG_MAX_TASK_ARG
* parameters are passed, the list should be
* terminated with a NULL argv[] value.
* If no parameters are required, argv may be NULL.
*
* Return Value:
* OK. This function always succeeds.
*
****************************************************************************/
#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
static int task_tcbargsetup(FAR struct task_tcb_s *tcb,
FAR char * const argv[])
{
int i;
/* Save the name as the first argument */
#if CONFIG_TASK_NAME_SIZE > 0
tcb->argv[0] = tcb->cmn.name;
#else
tcb->argv[0] = (FAR char *)g_noname;
#endif /* CONFIG_TASK_NAME_SIZE */
/* For tasks, the life of the argument must be as long as the life of the
* task and the arguments must be strings. So for tasks, we have to dup
* the strings.
*
* The first NULL argument terminates the list of arguments. The argv
* pointer may be NULL if no parameters are passed.
*/
i = 1;
if (argv)
{
for (; i < CONFIG_MAX_TASK_ARGS+1 && argv[i-1]; i++)
{
tcb->argv[i] = strdup(argv[i-1]);
}
}
/* Nullify any unused argument storage */
for (; i < CONFIG_MAX_TASK_ARGS+1; i++)
{
tcb->argv[i] = NULL;
}
return OK;
}
#endif /* !CONFIG_BUILD_PROTECTED && !CONFIG_BUILD_KERNEL */
/**************************************************************************** /****************************************************************************
* Name: task_stackargsetup * Name: task_stackargsetup
* *
* Description: * Description:
* This functions is called only from task_argsetup() for the case of the * This functions is called only from task_argsetup() It will allocate
* kernel build where the argv[] array and all strings are copied to the * space on the new task's stack and will copy the argv[] array and all
* task's stack. This is done because the TCB (and kernel allocated * strings to the task's stack where it is readily accessible to the
* strings) are only accessible in kernel-mode. Data on the stack, on the * task. Data on the stack, on the other hand, is guaranteed to be
* other hand, is guaranteed to be accessible no matter what mode the * accessible no matter what privilege mode the task runs in.
* task runs in.
* *
* Input Parameters: * Input Parameters:
* tcb - Address of the new task's TCB * tcb - Address of the new task's TCB
* argv - A pointer to an array of input parameters. * argv - A pointer to an array of input parameters. Up to
* Up to CONFIG_MAX_TASK_ARG parameters may be * CONFIG_MAX_TASK_ARG parameters may be provided. If fewer than
* provided. If fewer than CONFIG_MAX_TASK_ARG * CONFIG_MAX_TASK_ARG parameters are passed, the list should be
* parameters are passed, the list should be * terminated with a NULL argv[] value. If no parameters are
* terminated with a NULL argv[] value. * required, argv may be NULL.
* If no parameters are required, argv may be NULL.
* *
* Return Value: * Return Value:
* zero on success; a negated errno on failure. * Zero (OK) on success; a negated errno on failure.
* *
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL) static inline int task_stackargsetup(FAR struct task_tcb_s *tcb,
static int task_stackargsetup(FAR struct task_tcb_s *tcb,
FAR char * const argv[]) FAR char * const argv[])
{ {
FAR char **stackargv; FAR char **stackargv;
@@ -617,7 +550,6 @@ static int task_stackargsetup(FAR struct task_tcb_s *tcb,
return OK; return OK;
} }
#endif /* CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL */
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -736,30 +668,14 @@ int pthread_schedsetup(FAR struct pthread_tcb_s *tcb, int priority, start_t star
int task_argsetup(FAR struct task_tcb_s *tcb, FAR const char *name, int task_argsetup(FAR struct task_tcb_s *tcb, FAR const char *name,
FAR char * const argv[]) FAR char * const argv[])
{ {
int ret;
/* Setup the task name */ /* Setup the task name */
task_namesetup(tcb, name); task_namesetup(tcb, name);
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL) /* Copy the argv[] array and all strings are to the task's stack. Data on
/* In the kernel build case, the argv[] array and all strings are copied * the stack is guaranteed to be accessible by the ask no matter what
* to the task's stack. This is done because the TCB (and kernel allocated * privilege mode the task runs in.
* strings) are only accessible in kernel-mode. Data on the stack, on the
* other hand, is guaranteed to be accessible no matter what mode the
* task runs in.
*/ */
ret = task_stackargsetup(tcb, argv); return task_stackargsetup(tcb, argv);
#else
/* In the "normal" case, the argv[] array is a structure in the TCB, the
* arguments are cloned via strdup.
*/
ret = task_tcbargsetup(tcb, argv);
#endif /* CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL */
return ret;
} }