diff options
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 25 | ||||
-rw-r--r-- | nuttx/Documentation/NuttxUserGuide.html | 27 | ||||
-rw-r--r-- | nuttx/ReleaseNotes | 12 | ||||
-rw-r--r-- | nuttx/arch/c5471/src/up_internal.h | 2 | ||||
-rw-r--r-- | nuttx/arch/c5471/src/up_serial.c | 55 | ||||
-rw-r--r-- | nuttx/examples/ostest/sighand.c | 9 | ||||
-rw-r--r-- | nuttx/examples/ostest/timedwait.c | 1 |
8 files changed, 75 insertions, 61 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog new file mode 100644 index 000000000..823a1c832 --- /dev/null +++ b/nuttx/ChangeLog @@ -0,0 +1,5 @@ +0.1.0 2007-03-09 Gregory Nutt <spudmonkey@racsa.co.cr> + + * Initial Release + * Support for Linux user mode simulation and TI + TMS320C5471 (Arm7) provided diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 4eb565842..f19360a88 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -28,8 +28,8 @@ NuttX operates on the ARM7 of this dual core processor. This port uses the <a href="http://www.spectrumdigital.com/">Spectrum Digital</a> evaluation board with a GNU arm-elf toolchain*. - This port is in progress and partially functional (However, - my board is dead at the moment so it will be awhile before I fix it)</li> + This port is complete, verified, and included in the initial NuttX + release.</li> <li><b>8051 Microcontroller</b>. This port uses the <a href="http://www.pjrc.com/">PJRC</a> 87C52 development system and the <a href="http://sdcc.sourceforge.net/">SDCC</a> toolchain. @@ -43,17 +43,18 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq <h1>Memory Footprint</h1> -<p>Details to be provided</p> - -<p> - I have a complete build for an ARM7 target that includes most of the OS - features and a broad range of OS tests. - That builds to an executable that requires about 85Kb for .text, .data., and .bss. +<p><b>C5471 (Arm7)</b> + The build for this ARM7 target that includes most of the OS features and + a broad range of OS tests. The size of this executable as given by the + Linux <tt>size</tt> command is: </p> -<p> - I have a stripped down OS test for the 8051 target that requires only - 18Kb. A substantial effort was required to get to this size - (see <a href="codesize-070301.xls">spreadsheet</a> for details). +<pre> + text data bss dec hex filename + 53272 428 3568 57268 dfb4 nuttx +</pre> +<p><b>87C52</b> + A reduced functionality OS test for the 8051 target requires only + about 18Kb (see <a href="codesize-070301.xls">spreadsheet</a> for details). </p> <h1>Licensing</h1> diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html index 6894d8460..b7055adbc 100644 --- a/nuttx/Documentation/NuttxUserGuide.html +++ b/nuttx/Documentation/NuttxUserGuide.html @@ -27,7 +27,7 @@ Gregory Nutt <H1>1.0 <A NAME="Introduction">Introduction</A></H1> <P> -This user's manual is divided into five sections: +This user's manual is divided into three sections: <UL> <LI><B>Section 1.0, <A HREF="#Introduction">Introduction</A></B>: This section provides an overview of the Nuttx user's manual. @@ -48,8 +48,6 @@ into several paragraphs that describe different groups of OS interfaces: <LI><B>Section 3.0, <A HREF="#Data_Structures">OS Data Structures</A></B>: This section documents the data structures that are used at the Nuttx interface. -<LI><B>Section 4.0, <A HREF="#Problems">Known Problems</A></B>. This section -lists known problems in the latest release of Nuttx. </UL> <HR> @@ -4113,28 +4111,5 @@ notify a task when a message is available on a queue. have to do some redesign. </p> -<HR> - -<H1>4.0 <A NAME="Problems">Known Problems</A></H1> - -<P> -This section documents know problems with Nuttx at the time -of this writing. -<P> -<HR> -<B>Problem</B>: -There is a problem with the unblock logic in os_signal.c when message queue -becomes not-empty -- sig_mqnotempty() calls sig_received(). -sig_received() relies on task_state == TSTATE_WAIT_SIG and will ignore -tasks that are waiting on a message queue to become non-empty. -<P> -<B>Priority</B>: <B>LOW</B>. If a task is blocked a waiting for a message -queue to become non-empty, it will be re-started anyway. -<HR> - -<B>Problem</B>: task_restart won't restart a running task -<P> -<B>Priority</B>: <B>LOW</B>. - </BODY> </HTML> diff --git a/nuttx/ReleaseNotes b/nuttx/ReleaseNotes new file mode 100644 index 000000000..9dec8b03e --- /dev/null +++ b/nuttx/ReleaseNotes @@ -0,0 +1,12 @@ +Nuttx-0.1.0 +^^^^^^^^^^^ + +This is the initial. This initial includes the complete NuttX RTOS +with support for the Linux user mode simulation and the TI TMS320C5471 +(Arm7) processor. Partial support for the 87C52 is included. + +This release has been verified on both the Linux user-mode and C5471 +platforms using the test program under examples/ostest. Test results +for the C5471 can be found in arch/c5471/doc/test-results.txt. + +This tarball contains a complete CVS snapshot from March 9,2007. diff --git a/nuttx/arch/c5471/src/up_internal.h b/nuttx/arch/c5471/src/up_internal.h index 6f6f82c83..390a91454 100644 --- a/nuttx/arch/c5471/src/up_internal.h +++ b/nuttx/arch/c5471/src/up_internal.h @@ -51,7 +51,7 @@ #undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */ #undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */ -#define CONFIG_SUPPRESS_SERIAL_INTS 1 /* Console will poll */ +#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */ #undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */ #undef CONFIG_DUMP_ON_EXIT /* Dumpt task state on exit */ diff --git a/nuttx/arch/c5471/src/up_serial.c b/nuttx/arch/c5471/src/up_serial.c index 8ab1d6954..c6d6dc58e 100644 --- a/nuttx/arch/c5471/src/up_serial.c +++ b/nuttx/arch/c5471/src/up_serial.c @@ -79,10 +79,11 @@ struct uart_regs_s struct uart_buffer_s { - int head; - int tail; - int size; - char *buffer; + sem_t sem; /* Used to control exclusive access to the buffer */ + sint16 head; /* Index to the head [IN] index in the buffer */ + sint16 tail; /* Index to the tail [OUT] index in the buffer */ + sint16 size; /* The allocated size of the buffer */ + char *buffer; /* Pointer to the allocated buffer memory */ }; struct up_dev_s @@ -608,6 +609,7 @@ static void up_putxmitchar(up_dev_t *dev, int ch) } else { +#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS) /* Transfer some characters with interrupts disabled */ up_xmitchars(dev); @@ -621,20 +623,23 @@ static void up_putxmitchar(up_dev_t *dev, int ch) { /* Still no space */ -#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS) up_waittxfifonotfull(dev); + } #else - dev->xmitwaiting = TRUE; + /* Inform the interrupt level logic that we are waiting */ - /* Wait for some characters to be sent from the buffer - * with the TX interrupt disabled. - */ + dev->xmitwaiting = TRUE; + + /* Wait for some characters to be sent from the buffer + * with the TX interrupt enabled. When the TX interrupt + * is enabled, up_xmitchars should execute and remove + * some of the data from the TX buffer. + */ - up_enabletxint(dev); - up_takesem(&dev->xmitsem); - up_disabletxint(dev); + up_enabletxint(dev); + up_takesem(&dev->xmitsem); + up_disabletxint(dev); #endif - } } } } @@ -805,6 +810,10 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen) up_dev_t *dev = inode->i_private; ssize_t ret = buflen; + /* Only one user can be accessing dev->xmit.head at once */ + + up_takesem(&dev->xmit.sem); + /* Loop while we still have data to copy to the transmit buffer. * we add data to the head of the buffer; up_xmitchars takes the * data from the end of the buffer. @@ -829,13 +838,14 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen) if (dev->xmit.head != dev->xmit.tail) { +#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS) up_xmitchars(dev); - if (dev->xmit.head != dev->xmit.tail) - { - up_enabletxint(dev); - } +#else + up_enabletxint(dev); +#endif } + up_givesem(&dev->xmit.sem); return ret; } @@ -849,6 +859,10 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen) up_dev_t *dev = inode->i_private; ssize_t ret = buflen; + /* Only one user can be accessing dev->recv.tail at once */ + + up_takesem(&dev->recv.sem); + /* Loop while we still have data to copy to the receive buffer. * we add data to the head of the buffer; up_xmitchars takes the * data from the end of the buffer. @@ -862,7 +876,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen) *buffer++ = dev->recv.buffer[dev->recv.tail]; buflen--; - if (++dev->recv.tail >= dev->recv.size) + if (++(dev->recv.tail) >= dev->recv.size) { dev->recv.tail = 0; } @@ -881,7 +895,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen) } up_enablerxint(dev); - + up_takesem(&dev->recv.sem); return ret; } @@ -1068,8 +1082,11 @@ static void up_devinit(up_dev_t *dev, * statically initialized. */ + sem_init(&dev->xmit.sem, 0, 1); dev->xmit.size = txbufsize; dev->xmit.buffer = txbuffer; + + sem_init(&dev->recv.sem, 0, 1); dev->recv.size = rxbufsize; dev->recv.buffer = rxbuffer; diff --git a/nuttx/examples/ostest/sighand.c b/nuttx/examples/ostest/sighand.c index f6970deb0..b5b1ad806 100644 --- a/nuttx/examples/ostest/sighand.c +++ b/nuttx/examples/ostest/sighand.c @@ -216,16 +216,19 @@ void sighand_test(void) } else { - printf("sighand_test: Started waiter_main pid=%d\n" , waiterpid); + printf("sighand_test: Started waiter_main pid=%d\n", waiterpid); } /* Wait a bit */ fflush(stdout); - usleep(500*1000); + sleep(2); /* Then signal the waiter thread. */ + printf("sighand_test: Signaling pid=%d with signo=%d sigvalue=%d\n", + waiterpid, WAKEUP_SIGNAL, SIGVALUE_INT); + sigvalue.sival_int = SIGVALUE_INT; #ifdef CONFIG_CAN_PASS_STRUCTS status = sigqueue(waiterpid, WAKEUP_SIGNAL, sigvalue); @@ -241,7 +244,7 @@ void sighand_test(void) /* Wait a bit */ fflush(stdout); - usleep(500*1000); + sleep(2); /* Then check the result */ diff --git a/nuttx/examples/ostest/timedwait.c b/nuttx/examples/ostest/timedwait.c index 81e7c4a61..0bc47c693 100644 --- a/nuttx/examples/ostest/timedwait.c +++ b/nuttx/examples/ostest/timedwait.c @@ -161,6 +161,7 @@ void timedwait_test(void) } printf("timedwait_test: Joining\n"); + fflush(stdout); status = pthread_join(waiter, &result); if (status != 0) { |