mirror of
https://github.com/apache/nuttx.git
synced 2025-12-12 05:34:38 +08:00
Compare commits
123 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db8aff6778 | ||
|
|
ddeb703501 | ||
|
|
44778c69bd | ||
|
|
77119d8359 | ||
|
|
c48d0935a1 | ||
|
|
5fe0d01775 | ||
|
|
643c8d6401 | ||
|
|
da7b0d1d90 | ||
|
|
03e6e759a6 | ||
|
|
f3209435ab | ||
|
|
6f8dae2964 | ||
|
|
d7d1145863 | ||
|
|
b91d6d3b2f | ||
|
|
5b9425f1b6 | ||
|
|
c869e421e9 | ||
|
|
105aa81d1f | ||
|
|
00093c0a08 | ||
|
|
f43ffa05aa | ||
|
|
69ec9510a0 | ||
|
|
b85008dc63 | ||
|
|
04eac6d18a | ||
|
|
24dc336781 | ||
|
|
7bc52e9ea1 | ||
|
|
30ad777538 | ||
|
|
b1bc346305 | ||
|
|
a0318797d7 | ||
|
|
aa8343178b | ||
|
|
d69acf31de | ||
|
|
87743cdc8e | ||
|
|
23dcda6743 | ||
|
|
d63a0352a5 | ||
|
|
ec8c6ffb23 | ||
|
|
a401a91d03 | ||
|
|
dcf7c7c365 | ||
|
|
01207cc66e | ||
|
|
4283c46855 | ||
|
|
952db3328f | ||
|
|
09d6450ab3 | ||
|
|
a3d199f7ac | ||
|
|
cdfb48dac6 | ||
|
|
535038c5cc | ||
|
|
d265632c82 | ||
|
|
8c0ce78863 | ||
|
|
4f3ecdd85a | ||
|
|
cae9bad97b | ||
|
|
f72d286d19 | ||
|
|
f47c8cb529 | ||
|
|
7015014104 | ||
|
|
d82d41387b | ||
|
|
800afcd04d | ||
|
|
287e032069 | ||
|
|
6119aa0943 | ||
|
|
29aeec7b8a | ||
|
|
c60f939f91 | ||
|
|
1344768825 | ||
|
|
f5afe99329 | ||
|
|
09e2a0cc1e | ||
|
|
f5f4000981 | ||
|
|
454fededc8 | ||
|
|
e8c4bbf98e | ||
|
|
f33928ef6a | ||
|
|
6f1e5c74ef | ||
|
|
e260ea2fa8 | ||
|
|
fff3a9d265 | ||
|
|
d8cdca20f5 | ||
|
|
4a0697786a | ||
|
|
f0c085abec | ||
|
|
7e5a954d79 | ||
|
|
fb5466800f | ||
|
|
96c7f2422e | ||
|
|
e155bf66df | ||
|
|
cdd8fe239a | ||
|
|
c418e219ac | ||
|
|
14c19aa3d1 | ||
|
|
3237757a86 | ||
|
|
475e731751 | ||
|
|
0466636a01 | ||
|
|
d4ccda1bae | ||
|
|
09a3864fd5 | ||
|
|
445da7f795 | ||
|
|
13bd9989b2 | ||
|
|
576c4f55c2 | ||
|
|
4e52b5e11c | ||
|
|
00d1800b76 | ||
|
|
eff35dc99f | ||
|
|
729fad8b7d | ||
|
|
d583be7062 | ||
|
|
9a4b84349d | ||
|
|
c013dc876f | ||
|
|
1479e0d35d | ||
|
|
7ac971d7ee | ||
|
|
bece513004 | ||
|
|
40513d77ab | ||
|
|
9ab11697a8 | ||
|
|
aca030153f | ||
|
|
da19e798e6 | ||
|
|
79457a04ab | ||
|
|
cfdfa7b3c9 | ||
|
|
a48fe435f8 | ||
|
|
c574123ca4 | ||
|
|
637618e8bb | ||
|
|
a54e55c432 | ||
|
|
5abe9f896c | ||
|
|
826ae7f951 | ||
|
|
c3ed839a4e | ||
|
|
4a18d1f253 | ||
|
|
f1170204c5 | ||
|
|
cf935803a0 | ||
|
|
9dd25d7965 | ||
|
|
5bdefbb8a0 | ||
|
|
3f5d4be4a9 | ||
|
|
a0153a1ed2 | ||
|
|
0c8bb6aac5 | ||
|
|
1d82a44d73 | ||
|
|
955bf72f06 | ||
|
|
49e73e6d62 | ||
|
|
84e1cf94cf | ||
|
|
48b2897974 | ||
|
|
0528705d81 | ||
|
|
2a7e55b1fc | ||
|
|
f0634f5588 | ||
|
|
d7b254d2e6 | ||
|
|
0cb1595215 |
81
ChangeLog
81
ChangeLog
@@ -138,7 +138,84 @@
|
||||
* Added fsync()
|
||||
* Added strspn() and strcspn()
|
||||
|
||||
0.2.6 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
0.2.6 2007-05-26 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Started m68322
|
||||
* Added unlink(), mkdir(), rmdir(), and rename()
|
||||
* Fixed several serious FAT errors with oflags handling (&& instead of &)
|
||||
* Added FAT support for unlink(), mkdir(), rmdir(), and rename
|
||||
* Added FAT support for opendir(), closedir(), readdir(), seekdir(),
|
||||
telldir(), rewindir().
|
||||
* Fixed ARM compilation errors introduced in 0.2.5 (that is what I get
|
||||
for only testing on the simulation).
|
||||
|
||||
0.2.7 2007-06-09 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added stat() to fs layer and to FAT
|
||||
* Fixed reference counting errors associated with mounted filesystems
|
||||
* Added fat_getattrib() and fat_setattrib()
|
||||
* Added statfs() to fs layer and to FAT
|
||||
* Correct file name extension in tools/zipme.sh
|
||||
* Fix error in dependencies in 8051/2 Makefile
|
||||
* sched/Makefile: Don't build sleep() or usleep() if signals are disabled
|
||||
* sched/sched_setparam.c: Remove redundant disabling of interrupts
|
||||
* sched/usleep.c: Fixed nsec calculation
|
||||
* lib/lib_strcspn.c: Function incorrectly named strspn().
|
||||
* examples/ostest/main.c: Errors in SDCC version of a memcpy() call
|
||||
* examples/ostest/sighand.c: Don't call fflush() if streams are disabled
|
||||
* include/limits.h, include/time.h, sched/clock_internal.h: A support for
|
||||
using selectable system timer frequency.
|
||||
* Fixed error in mountpoint related conditional compilation introduced
|
||||
in 0.2.5
|
||||
* Restructured some Makefiles to better handle enabling and disabling
|
||||
NuttX features without having so much conditional compilation in the
|
||||
source files.
|
||||
* tools/mkconfig.c: No longer depends on asprintf() and _GNU_SOURCE and
|
||||
so should now build in non-GNU, non-GLIBC environments.
|
||||
* include/nuttx/compiler.h: Fix for using SDCC with the Z80.
|
||||
* include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support
|
||||
__FILE__and __LINE__ (not tested)
|
||||
* examples/ostest/barrier.c: Don't call usleep() when signals are
|
||||
disabled.
|
||||
|
||||
0.2.8 2007-07-02 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* tools/Makefile.mkconfig: Under Cygwin, executable has a different name
|
||||
* tools/mkdeps.sh & arch/arm/src/Makefile: Corrected a problem makeing dependencies
|
||||
* tools/zipme.sh: Force directory name to be nuttx-xx.yy.zz
|
||||
* fs/fs_opendir.c: Correct errors in semaphore usage that can cause deadlock.
|
||||
* lib/lib_getopt.c: Added getopt() support
|
||||
* examples/nsh/: NSH now supports cat, mount, umount, and mkdir. ls supports
|
||||
-l -s, and -R
|
||||
* Added basic OS support to manage environment variables: environment
|
||||
storage, cloning on task creation, sharing on pthread creation, destruction
|
||||
on thread/task exit.
|
||||
* Add environment variables APIs: environ, getenv, putenv, clearenv, setenv,
|
||||
unsetenv
|
||||
* Correct an error in realloc() when the block is extended "down" in memory.
|
||||
In this case, the old memory contents need to be copied to the new location
|
||||
and an allocated bit was not being set.
|
||||
* examples/ostest/: Added an environment variable test.
|
||||
* examples/nsh/: Break into several files.
|
||||
* lib/: Added strrchr, basename, dirname
|
||||
* examples/nsh/: Add cp, rm, rmdir, set, unset commands. echo will now print
|
||||
environment variables.
|
||||
|
||||
0.3.0 2007-11-06 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Imported uIP into the tree (see
|
||||
http://www.sics.se/~adam/uip/index.php/Main_Page)
|
||||
* Adding socket(), bind(), connect()
|
||||
* Added snprintf()
|
||||
* Added send() and sendto(); integrate write() and close() with socket descriptors.
|
||||
* Added recv() and recvfrom().
|
||||
* Added getsockopt() and setsockopt()
|
||||
* Documentation updated to address socket interfaces.
|
||||
* Implemented receive timeouts via setsockopt(SO_RCVTIMEO).
|
||||
* Provide support for multiple network devices
|
||||
* Implement socket ioctl() calls to set addresses
|
||||
* Added listen() and accept()
|
||||
* Added DM90x0 ethernet driver
|
||||
* ARP timer is now built into the network layer
|
||||
* Basic client functionality verified: socket(), bind(), connect(), recv(), send().
|
||||
|
||||
0.3.1 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||
<p>Last Updated: May 19, 2007</p>
|
||||
<p>Last Updated: November 6, 2007</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -183,9 +183,27 @@
|
||||
</table>
|
||||
|
||||
<p>
|
||||
The 8th release of NuttX (nuttx-0.2.5) is available for download
|
||||
The 12th release of NuttX (nuttx-0.3.0) is available for download
|
||||
from the <a href="http://sourceforge.net/project/showfiles.php?group_id=189573">SourceForge</a>
|
||||
website.
|
||||
The change log associated with the release is available <a href="#currentrelease">here</a>.
|
||||
Unreleased changes after this release are avalable in CVS.
|
||||
These unreleased changes are listed <a href="#pendingchanges">here</a>.
|
||||
</p>
|
||||
<p>
|
||||
NuttX 30.3.0 includes the initial integration of a network subsystem and
|
||||
a TCP/IP stack based on <a href="http://www.sics.se/~adam/uip/index.php/Main_Page">uIP</a>.
|
||||
Also included is a device driver for the Davicom DM90x0 ethernet controller.
|
||||
</p>
|
||||
</p>
|
||||
This integration is very preliminary. Only a small portion of the
|
||||
network functionality has been integrated and there are a number of
|
||||
open issues. The network subsystem is pre-alpha this point in time.
|
||||
I expect that it will stabilize and mature over the next few releases.
|
||||
</p>
|
||||
<p>
|
||||
The baseline functionality of NuttX continues to mature and remains at
|
||||
post-beta (as long as the network is not used).
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
@@ -248,14 +266,14 @@
|
||||
</p>
|
||||
<p>
|
||||
<b>STATUS:</b>
|
||||
This port is in progress and should be available in the nuttx-0.2.6 release.
|
||||
Initial coding of this port code complete but has not yet been verified.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><img src="favicon.ico"></td>
|
||||
<td bgcolor="#5eaee1">
|
||||
<b>ARM9EJS</b>.
|
||||
<b>ARM926EJS</b>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -270,7 +288,7 @@
|
||||
</p>
|
||||
<p>
|
||||
<b>STATUS:</b>
|
||||
This port is code complete but totally untested due to hardware issues with my OSD.
|
||||
This port is complete and verified.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -293,6 +311,8 @@
|
||||
This port is complete but not stable with timer interrupts enabled.
|
||||
There seems to be some issue when the stack pointer enters into the indirect IRAM
|
||||
address space during interrupt handling.
|
||||
This architecture has not been built in some time will likely have some compilation
|
||||
problems because of SDCC compiler differences.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -324,7 +344,7 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<p><b>C5471 (Arm7)</b>
|
||||
<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 (3/9/07):
|
||||
@@ -333,6 +353,14 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq
|
||||
text data bss dec hex filename
|
||||
53272 428 3568 57268 dfb4 nuttx
|
||||
</pre>
|
||||
<p><b>DM320 (ARM9)</b>
|
||||
This build for the ARM9 target includes a signficant subset of OS
|
||||
features, ethernet driver and full TCP/IP stack (via uIP).
|
||||
</p>
|
||||
<pre>
|
||||
text data bss dec hex filename
|
||||
51368 296 6072 57736 e188 nuttx
|
||||
</pre>
|
||||
<p><b>87C52</b>
|
||||
A reduced functionality OS test for the 8052 target requires only
|
||||
about 18-19Kb:
|
||||
@@ -376,6 +404,35 @@ Other memory:
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<center><table width ="80%">
|
||||
<tr>
|
||||
<td><img src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#olderreleases">Change Logs for Older Releases</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#currentrelease">ChangeLog for Current Release</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#pendingchanges">Unreleased Changes</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="olderreleases">Change Logs for Older Releases</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<ul><pre>
|
||||
0.1.0 2007-03-09 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
@@ -517,9 +574,106 @@ Other memory:
|
||||
* Added fsync()
|
||||
* Added strspn() and strcspn()
|
||||
|
||||
0.2.6 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
0.2.6 2007-05-26 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Started m68322
|
||||
* Added unlink(), mkdir(), rmdir(), and rename()
|
||||
* Fixed several serious FAT errors with oflags handling (&& instead of &)
|
||||
* Added FAT support for unlink(), mkdir(), rmdir(), and rename
|
||||
* Added FAT support for opendir(), closedir(), readdir(), seekdir(),
|
||||
telldir(), rewindir().
|
||||
* Fixed ARM compilation errors introduced in 0.2.5 (that is what I get
|
||||
for only testing on the simulation).
|
||||
|
||||
0.2.7 2007-06-09 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added stat() to fs layer and to FAT
|
||||
* Fixed reference counting errors associated with mounted filesystems
|
||||
* Added fat_getattrib() and fat_setattrib()
|
||||
* Added statfs() to fs layer and to FAT
|
||||
* Correct file name extension in tools/zipme.sh
|
||||
* Fix error in dependencies in 8051/2 Makefile
|
||||
* sched/Makefile: Don't build sleep() or usleep() if signals are disabled
|
||||
* sched/sched_setparam.c: Remove redundant disabling of interrupts
|
||||
* sched/usleep.c: Fixed nsec calculation
|
||||
* lib/lib_strcspn.c: Function incorrectly named strspn().
|
||||
* examples/ostest/main.c: Errors in SDCC version of a memcpy() call
|
||||
* examples/ostest/sighand.c: Don't call fflush() if streams are disabled
|
||||
* include/limits.h, include/time.h, sched/clock_internal.h: A support for
|
||||
using selectable system timer frequency.
|
||||
* Fixed error in mountpoint related conditional compilation introduced
|
||||
in 0.2.5
|
||||
* Restructured some Makefiles to better handle enabling and disabling
|
||||
NuttX features without having so much conditional compilation in the
|
||||
source files.
|
||||
* tools/mkconfig.c: No longer depends on asprintf() and _GNU_SOURCE and
|
||||
so should now build in non-GNU, non-GLIBC environments.
|
||||
* include/nuttx/compiler.h: Fix for using SDCC with the Z80.
|
||||
* include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support
|
||||
__FILE__and __LINE__ (not tested)
|
||||
* examples/ostest/barrier.c: Don't call usleep() when signals are
|
||||
disabled.
|
||||
|
||||
0.2.8 2007-07-02 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* tools/Makefile.mkconfig: Under Cygwin, executable has a different name
|
||||
* tools/mkdeps.sh & arch/arm/src/Makefile: Corrected a problem makeing dependencies
|
||||
* tools/zipme.sh: Force directory name to be nuttx-xx.yy.zz
|
||||
* fs/fs_opendir.c: Correct errors in semaphore usage that can cause deadlock.
|
||||
* lib/lib_getopt.c: Added getopt() support
|
||||
* examples/nsh/: NSH now supports cat, mount, umount, and mkdir. ls supports
|
||||
-l -s, and -R
|
||||
* Added basic OS support to manage environment variables: environment
|
||||
storage, cloning on task creation, sharing on pthread creation, destruction
|
||||
on thread/task exit.
|
||||
* Add environment variables APIs: environ, getenv, putenv, clearenv, setenv,
|
||||
unsetenv
|
||||
* Correct an error in realloc() when the block is extended "down" in memory.
|
||||
In this case, the old memory contents need to be copied to the new location
|
||||
and an allocated bit was not being set.
|
||||
* examples/ostest/: Added an environment variable test.
|
||||
* examples/nsh/: Break into several files.
|
||||
* lib/: Added strrchr, basename, dirname
|
||||
* examples/nsh/: Add cp, rm, rmdir, set, unset commands. echo will now print
|
||||
environment variables.
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="currentrelease">ChangeLog for Current Release</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<pre><ul>
|
||||
0.3.0 2007-11-06 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Imported uIP into the tree (see
|
||||
http://www.sics.se/~adam/uip/index.php/Main_Page)
|
||||
* Adding socket(), bind(), connect()
|
||||
* Added snprintf()
|
||||
* Added send() and sendto(); integrate write() and close() with socket descriptors.
|
||||
* Added recv() and recvfrom().
|
||||
* Added getsockopt() and setsockopt()
|
||||
* Documentation updated to address socket interfaces.
|
||||
* Implemented receive timeouts via setsockopt(SO_RCVTIMEO).
|
||||
* Provide support for multiple network devices
|
||||
* Implement socket ioctl() calls to set addresses
|
||||
* Added listen() and accept()
|
||||
* Added DM90x0 ethernet driver
|
||||
* ARP timer is now built into the network layer
|
||||
* Basic client functionality verified: socket(), bind(), connect(), recv(), send().
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="pendingchanges">Unreleased Changes</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<pre><ul>
|
||||
0.3.1 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</b></big>
|
||||
<p><small>by</small></p>
|
||||
<p>Gregory Nutt</p>
|
||||
<p><small>Last Update: April 30, 2007</small></p>
|
||||
<p><small>Last Update: September 8, 2007</small></p>
|
||||
</center>
|
||||
|
||||
<center><h1>Table of Contents</h1></center>
|
||||
@@ -46,9 +46,11 @@
|
||||
<li><a href="#DirStructInclude">2.7 include/</a></li>
|
||||
<li><a href="#DirStructLib">2.8 lib/</a></li>
|
||||
<li><a href="#DirStructMm">2.9 mm/</a></li>
|
||||
<li><a href="#DirStructSched">2.10 sched/</a></li>
|
||||
<li><a href="#DirStructTools">2.11 tools/</a></li>
|
||||
<li><a href="#topmakefile">2.12 Makefile</a></li>
|
||||
<li><a href="#DirStructNet">2.10 net</a></li>
|
||||
<li><a href="#DirStructNetUtils">2.11 netutils</a></li>
|
||||
<li><a href="#DirStructSched">2.12 sched/</a></li>
|
||||
<li><a href="#DirStructTools">2.13 tools/</a></li>
|
||||
<li><a href="#topmakefile">2.14 Makefile</a></li>
|
||||
</ul>
|
||||
<li><a href="#configandbuild">3.0 Configuring and Building</a></li>
|
||||
<ul>
|
||||
@@ -139,8 +141,8 @@
|
||||
| | | `-- <i>(board-specific source files)</i>
|
||||
| | `-- <i>(board-specific configuration files)</i>
|
||||
| `-- <i><other-boards></i>/
|
||||
|-- <a href="#DirStructDrivers">drivers</a>
|
||||
| |-- Makefile/
|
||||
|-- <a href="#DirStructDrivers">drivers</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(common driver source files)</i>
|
||||
|-- <a href="#DirStructExamples">examples</a>/
|
||||
| `-- <i>(example)</i>/
|
||||
@@ -148,9 +150,16 @@
|
||||
| `-- <i>(example source files)</i>
|
||||
|-- <a href="#DirStructFs">fs</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(fs source files)</i>
|
||||
| `-- <i>(common file system source files)</i>
|
||||
|-- <a href="#DirStructInclude">include</a>/
|
||||
| |-- <i>(standard header files)</i>
|
||||
| |-- arpa/
|
||||
| | `-- <i>(standard header files)</i>
|
||||
| |-- net/
|
||||
| | `-- uip/
|
||||
| | `-- <i>(uIP specific header files)</i>
|
||||
| |-- netinet/
|
||||
| | `-- <i>(standard header files)</i>
|
||||
| |-- nuttx/
|
||||
| | `-- <i>(nuttx specific header files)</i>
|
||||
| `- sys/
|
||||
@@ -160,7 +169,29 @@
|
||||
| `-- <i>(lib source files)</i>
|
||||
|-- <a href="#DirStructMm">mm</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(mm source files)</i>
|
||||
| `-- <i>(memory management source files)</i>
|
||||
|-- <a href="#DirStructNet">net</a>/
|
||||
| |-- Makefile
|
||||
| |-- uip/
|
||||
| | `-- <i>(uip source files)</i>
|
||||
| `-- <i>(socket source files)</i>
|
||||
|-- <a href="#DirStructNetUtils">netutils</a>/
|
||||
| |-- dhcp/
|
||||
| | `-- <i>(dhcp source files)</i>
|
||||
| |-- resolv/
|
||||
| | `-- <i>(resolv source files)</i>
|
||||
| |-- smtp/
|
||||
| | `-- <i>(smtp source files)</i>
|
||||
| |-- telnetd/
|
||||
| | `-- <i>(telnetd source files)</i>
|
||||
| |-- uiplib/
|
||||
| | `-- <i>(uiplib source files)</i>
|
||||
| |-- weblclient/
|
||||
| | `-- <i>(webclient source files)</i>
|
||||
| |-- webserver/
|
||||
| | `-- <i>(webserver source files)</i>
|
||||
| |-- Makefile
|
||||
| `-- <i>(fs source files)</i>
|
||||
|-- <a href="#DirStructSched">sched</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(sched source files)</i>
|
||||
@@ -342,6 +373,9 @@
|
||||
This port does not support interrupts or a real timer (and hence no
|
||||
round robin scheduler) Otherwise, it is complete.
|
||||
</li>
|
||||
<p>NOTE: This target will not run on Cygwin probably for many reasons but
|
||||
first off because it uses some of the same symbols as does cygwind.dll.
|
||||
</p>
|
||||
|
||||
<li><code>arch/arm</code>:
|
||||
This directory holds common ARM architectures. At present, this includes
|
||||
@@ -604,18 +638,30 @@
|
||||
This is the NuttX memory manager.
|
||||
</p>
|
||||
|
||||
<h2>2.10 <a name="DirStructSched">sched</a></h2>
|
||||
<h2>2.10 <a name="DirStructNet">net</a></h2>
|
||||
<p>
|
||||
This directory contains the implementation of the socket APIs.
|
||||
The subdirectory, <code>uip</code> contians the uIP port.
|
||||
</P>
|
||||
|
||||
<h2>2.11 <a name="DirStructNetUtils">netutils</a></h2>
|
||||
<p>
|
||||
This directory contains most of the network applications contained under the uIP-1.0 apps directory.
|
||||
As the uIP apps/README says, these applications "are not all heavily tested."
|
||||
</p>
|
||||
|
||||
<h2>2.12 <a name="DirStructSched">sched</a></h2>
|
||||
<p>
|
||||
The files forming core of the NuttX RTOS reside here.
|
||||
</p>
|
||||
|
||||
<h2>2.11 <a name="DirStructTools">tools</a></h2>
|
||||
<h2>2.13 <a name="DirStructTools">tools</a></h2>
|
||||
<p>
|
||||
This directory holds a collection of tools and scripts to simplify
|
||||
configuring and building NuttX.
|
||||
</p>
|
||||
|
||||
<h2>2.12 <a name="topmakefile">Makefile</a></h2>
|
||||
<h2>2.14 <a name="topmakefile">Makefile</a></h2>
|
||||
<p>
|
||||
The top-level <code>Makefile</code> in the <code>${TOPDIR}</code> directory contains all of the top-level control
|
||||
logic to build NuttX.
|
||||
@@ -1163,6 +1209,12 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
number of memory regions that the memory manager must
|
||||
handle and enables the API mm_addregion(start, end);
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_TICKS_PER_MSEC</code>: The default system timer is 100Hz
|
||||
or <code>TICKS_PER_MSEC</code>=10. This setting may be defined to inform NuttX
|
||||
that the processor hardware is providing system timer interrupts at some interrupt
|
||||
interval other than 10 msec.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_RR_INTERVAL</code>: The round robin timeslice will be set
|
||||
this number of milliseconds; Round robin scheduling can
|
||||
@@ -1211,8 +1263,9 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<code>CONFIG_DISABLE_CLOCK</code>, <code>CONFI_DISABLE_POSIX_TIMERS</code>, <code>CONFIG_DISABLE_PTHREAD</code>,
|
||||
<code>CONFIG_DISABLE_SIGNALS</code>, <code>CONFIG_DISABLE_MQUEUE</code>,
|
||||
<code>CONFIG_DISABLE_CLOCK</code>, <code>CONFI_DISABLE_POSIX_TIMERS</code>,
|
||||
<code>CONFIG_DISABLE_PTHREAD</code>, <code>CONFIG_DISABLE_SIGNALS</code>,
|
||||
<code>CONFIG_DISABLE_MQUEUE</code>, <code>CONFIG_DISABLE_MOUNTPOUNT</code>
|
||||
</ul>
|
||||
|
||||
<h2>Miscellaneous libc settings</h2>
|
||||
@@ -1287,6 +1340,75 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Network Support</h2>
|
||||
<h3>TCP/IP and UDP support via uIP</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NET</code>: Enable or disable all network features
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_IPv6</code>: Build in support for IPv6
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NSOCKET_DESCRIPTORS</code>: Maximum number of socket descriptors per task/thread.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_MAX_CONNECTIONS</code>: Maximum number of TCP connections (all tasks).
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_MAX_LISTENPORTS</code>: Maximum number of listening TCP ports (all tasks).
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_SOCKOPTS</code>: Enable or disable support for socket options.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_BUFFER_SIZE</code>: uIP buffer size
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_LOGGING</code>: Logging on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP</code>: UDP support on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP_CHECKSUMS</code>: UDP checksums on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP_CONNS</code>: The maximum amount of concurrent UDP connections
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_STATISTICS</code>: uIP statistics on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_PINGADDRCONF</code>: Use "ping" packet for setting IP address
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_RECEIVE_WINDOW</code>: The size of the advertised receiver's window
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_ARPTAB_SIZE</code>: The size of the ARP table
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_BROADCAST</code>: Broadcast support
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_LLH_LEN</code>: The link level header length
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_FWCACHE_SIZE</code>: number of packets to remember when looking for duplicates
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>UIP Network Utilities</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NET_DHCP_LIGHT</code>: Reduces size of DHCP
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_RESOLV_ENTRIES</code>: Number of resolver entries
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Stack and heap information</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
54
Makefile
54
Makefile
@@ -37,17 +37,53 @@ TOPDIR = ${shell pwd}
|
||||
-include ${TOPDIR}/.config
|
||||
-include ${TOPDIR}/Make.defs
|
||||
|
||||
# Process architecture and board-specific directories
|
||||
|
||||
ARCH_DIR = arch/$(CONFIG_ARCH)
|
||||
ARCH_SRC = $(ARCH_DIR)/src
|
||||
ARCH_INC = $(ARCH_DIR)/include
|
||||
BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
|
||||
|
||||
SUBDIRS = sched lib $(ARCH_SRC) mm fs drivers examples/$(CONFIG_EXAMPLE)
|
||||
# FSDIRS depend on file descriptor support; NONFSDIRS do not
|
||||
# (except for parts of FSDIRS). We will exclude FSDIRS
|
||||
# from the build if file descriptor support is disabled
|
||||
|
||||
NONFSDIRS = sched lib $(ARCH_SRC) mm examples/$(CONFIG_EXAMPLE)
|
||||
FSDIRS = fs drivers
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
NONFSDIRS += net netutils
|
||||
endif
|
||||
|
||||
# CLEANDIRS are the directories that will clean in. These are
|
||||
# all directories that we know about.
|
||||
# MAKEDIRS are the directories in which we will build targets
|
||||
|
||||
CLEANDIRS = $(NONFSDIRS) $(FSDIRS)
|
||||
|
||||
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
||||
MAKEDIRS = $(NONFSDIRS)
|
||||
else
|
||||
MAKEDIRS = $(NONFSDIRS) $(FSDIRS)
|
||||
endif
|
||||
|
||||
# LINKLIBS is the list of NuttX libraries that is passed to the
|
||||
# processor-specific Makefile to build the final target.
|
||||
# Libraries in FSDIRS are excluded if file descriptor support
|
||||
# is disabled.
|
||||
|
||||
LINKLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT) mm/libmm$(LIBEXT) \
|
||||
fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) lib/liblib$(LIBEXT) \
|
||||
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||
lib/liblib$(LIBEXT) examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||
|
||||
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
||||
LINKLIBS += fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
LINKLIBS += net/libnet$(LIBEXT) netutils/libnetutils$(LIBEXT)
|
||||
endif
|
||||
|
||||
# This is the name of the final target
|
||||
BIN = nuttx$(EXEEXT)
|
||||
|
||||
all: $(BIN)
|
||||
@@ -156,6 +192,12 @@ $(ARCH_SRC)/libarch$(LIBEXT): context
|
||||
mm/libmm$(LIBEXT): context
|
||||
$(MAKE) -C mm TOPDIR=$(TOPDIR) libmm$(LIBEXT)
|
||||
|
||||
net/libnet$(LIBEXT): context
|
||||
$(MAKE) -C net TOPDIR=$(TOPDIR) libnet$(LIBEXT)
|
||||
|
||||
netutils/libnetutils$(LIBEXT): context
|
||||
$(MAKE) -C netutils TOPDIR=$(TOPDIR) libnetutils$(LIBEXT)
|
||||
|
||||
fs/libfs$(LIBEXT): context
|
||||
$(MAKE) -C fs TOPDIR=$(TOPDIR) libfs$(LIBEXT)
|
||||
|
||||
@@ -169,12 +211,12 @@ $(BIN): context depend $(LINKLIBS)
|
||||
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) LINKLIBS="$(LINKLIBS)" $(BIN)
|
||||
|
||||
depend:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
@for dir in $(MAKEDIRS) ; do \
|
||||
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) depend ; \
|
||||
done
|
||||
|
||||
subdir_clean:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
@for dir in $(CLEANDIRS) ; do \
|
||||
if [ -e $$dir/Makefile ]; then \
|
||||
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) clean ; \
|
||||
fi \
|
||||
@@ -186,7 +228,7 @@ clean: subdir_clean
|
||||
rm -f $(BIN) $(BIN).* mm_test *.map *~
|
||||
|
||||
subdir_distclean:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
@for dir in $(CLEANDIRS) ; do \
|
||||
if [ -e $$dir/Makefile ]; then \
|
||||
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) distclean ; \
|
||||
fi \
|
||||
|
||||
29
ReleaseNotes
29
ReleaseNotes
@@ -1,18 +1,23 @@
|
||||
nuttx-0.2.5
|
||||
^^^^^^^^^^^^
|
||||
nuttx-0.3.0
|
||||
^^^^^^^^^^^
|
||||
|
||||
This is the 8th release of NuttX. This release includes:
|
||||
This is the 12th release of NuttX. This release includes the initial
|
||||
integration of a network subsystem and the uIP TCP/IP stack into NuttX
|
||||
(see http://www.sics.se/~adam/uip/index.php/Main_Page). Also included
|
||||
is a device driver for the Davicom DM90x0 ethernet controller.
|
||||
|
||||
(1) Several bug fixes
|
||||
(2) Initial support for FAT filesystems. Testing has not been
|
||||
exhaustive and some functionality is missing (mkdir, stat, unlink
|
||||
chmod, and rename functionality is not yet implemented).
|
||||
(3) Support for the NXP lpc2148 processor is included but is
|
||||
untested as of this writing. The current implementation includes
|
||||
only support for serial console and timer interrupt.
|
||||
This integration is very preliminary. Only a small portion of the
|
||||
network functionality has been integrated and there are a number of
|
||||
open issues (see the TODO file). The network subsystem is pre-alpha
|
||||
at this point in time. I expect that it will stabilize and mature
|
||||
over the next few releases.
|
||||
|
||||
The baseline functionality of NuttX continues to mature and remains at
|
||||
post-beta (as long as the network is not used).
|
||||
|
||||
See the ChangeLog for a complete list of changes.
|
||||
|
||||
This release has been verified only on the Linux user-mode platform.
|
||||
This release has been verified only on the Neuros OSD (DM320 ARM9)
|
||||
platform using the DM90x0 driver.
|
||||
|
||||
This tarball contains a complete CVS snapshot from May 19, 2007.
|
||||
This tarball contains a complete CVS snapshot from November 6, 2007.
|
||||
|
||||
65
TODO
65
TODO
@@ -7,10 +7,6 @@ o Task/Scheduler
|
||||
- Implement sys/mman.h and functions
|
||||
- Implement sys/wait.h and functions
|
||||
- Implement priority inheritance
|
||||
- Make the system timer frequency configurable via defconfig. See:
|
||||
_POSIX_CLOCKRES_MIN in limits.h
|
||||
CLK_TCK in time.h
|
||||
MSEC_PER_TICK in sched/clock_internal.h
|
||||
- Consider implementing wait, waitpid, waitid. At present, a parent has
|
||||
no information about child tasks.
|
||||
- Several APIs do not set errno. Need to review all APIs.
|
||||
@@ -27,22 +23,58 @@ o Signals
|
||||
- 'Standard' signals and signal actions are not supported.
|
||||
|
||||
o pthreads
|
||||
- pthread_cancel(): Should implemenent cancellation points and pthread_testcancel()
|
||||
- pthread_cancel(): Should implement cancellation points and pthread_testcancel()
|
||||
|
||||
o C++ Support
|
||||
- Need to call static constructors
|
||||
|
||||
o Network
|
||||
- Port FreeBSD TCP/IP stack
|
||||
- Did not implement send() and sendto() timeouts. Option is setable via setsockopt,
|
||||
but is not implemented.
|
||||
- netutils/webserver netutils/telnetd (and maybe others) are seriously broken.
|
||||
Need to be re-written to use listen() and accept()
|
||||
- Should implement SOCK_RAW
|
||||
- listen() and accept() are untested.
|
||||
- accept() and recvfrom() need to return connection address
|
||||
- Performance Improvements (uIP is not very fast):
|
||||
- Improve performance by queing TX operations
|
||||
Add simple buffer management. CONFIG_NET_BUFFERS
|
||||
(1) On write, queue buffer for output get a new buffer for the socket (waiting if
|
||||
nececcesary
|
||||
(2) Copy buffer structure into uip_driver_structure when driver requests write
|
||||
data
|
||||
- Improve performance by stimulating the driver to accept new TX data before the
|
||||
next polling interval.
|
||||
|
||||
Add a txail callback into driver to eliminate send delays. Since we want to
|
||||
support multiple network devices, this means we will have to add some infrastructure
|
||||
to map to device.
|
||||
- Break uip_interrupt() (in uip.c) into several functions.
|
||||
- uIP polling issues:
|
||||
(1) uIP expects a single driver to poll at a 500ms interval (dm90x0 currently
|
||||
polls a 5sec).
|
||||
(2) Current logic will not support multiple ethernet drivers. Each driver should
|
||||
poll on TCP connections connect on the network supported by the driver; UDP
|
||||
polling should respond with TX data only if the UDP packet is intended for the
|
||||
the network supported by the driver.
|
||||
(3) If there were multiple drivers, polling would occur at double the rate.
|
||||
- TCP Bug:
|
||||
When TCP data is received with no read in place, it appears that uIP ACKs the data
|
||||
even though it was not taken accepted. We must either (1) buffer incoming data, or
|
||||
(2) not ACK it so that it will be re-sent.
|
||||
|
||||
o USB
|
||||
- Implement USB device support
|
||||
- Implement USB bulk device
|
||||
|
||||
o Libraries
|
||||
- sscanf() and lib_vsprintf() do not support floating point values.
|
||||
- The definition of environ in stdlib.h is bogus and will not work as it should. This
|
||||
is because the underlying representation of the environment is not an arry of pointers.
|
||||
|
||||
o File system
|
||||
- Add disk usage stats, stat(), unlink(), mkdir(), chmod(), rename(),
|
||||
etc.
|
||||
- FAT32: long file names
|
||||
|
||||
o Console Output
|
||||
- Add chmod(), truncate().
|
||||
- FAT32: long file names
|
||||
|
||||
o Documentation
|
||||
- Document fs/ & driver/ logic
|
||||
@@ -52,18 +84,20 @@ o Build system
|
||||
- Some names under arch are still incorrect. These should be processor architecture
|
||||
names: pjrc-8051 should be 805x
|
||||
- configs/pjrc-8051 should be configs/pjrc-87c52
|
||||
- Last change to create the arch/arm directory breaks dependencies in arch/arm/src.
|
||||
Probably need to add the path to the chip or common subdirectorys when
|
||||
running tools/mkdeps.sh
|
||||
- Dependencies do not work correctly under configs/<board>/src (same as arch/<arch>/src/board).
|
||||
|
||||
o Applications & Tests
|
||||
|
||||
o C5471
|
||||
|
||||
o DM320
|
||||
- It seems that when a lot of debug statements are added, the system no
|
||||
longer boots. There could be some issue with the bootloader or with
|
||||
the programming of the SDRAM MMU regions.
|
||||
|
||||
o LPC214x
|
||||
- Finish
|
||||
- Finish bringup
|
||||
- Add MMC and USB support
|
||||
|
||||
o pjrc-8052 / MCS51
|
||||
- Current status:
|
||||
@@ -82,3 +116,4 @@ o pjrc-8052 / MCS51
|
||||
clock_initialize.c at line 107
|
||||
pthread_create.c at 330
|
||||
sighand.c at 225 and 244
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
* Included Files
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <arch/chip/irq.h>
|
||||
|
||||
/************************************************************
|
||||
|
||||
@@ -103,7 +103,7 @@ endif
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
|
||||
fi
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(MKDEP) --dep-path chip --dep-path common $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
@@ -37,7 +37,7 @@ HEAD_ASRC = up_nommuhead.S
|
||||
|
||||
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S
|
||||
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
|
||||
up_createstack.c up_dataabort.c up_delay.c up_doirq.c \
|
||||
up_createstack.c up_dataabort.c up_mdelay.c up_udealy.c up_doirq.c \
|
||||
up_exit.c up_idle.c up_initialize.c up_initialstate.c \
|
||||
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \
|
||||
up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/************************************************************
|
||||
* c5471/c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471_serial.c
|
||||
* c5471/c5471_serial.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
@@ -38,16 +38,19 @@
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <semaphore.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/serial.h>
|
||||
#include <arch/serial.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
@@ -381,9 +384,9 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
/* Both the IrDA and MODEM UARTs support RESET and UART mode. */
|
||||
|
||||
up_serialout(priv, UART_MDR_OFFS, MDR_RESET_MODE);
|
||||
up_delay(5);
|
||||
up_mdelay(5);
|
||||
up_serialout(priv, UART_MDR_OFFS, MDR_UART_MODE);
|
||||
up_delay(5);
|
||||
up_mdelay(5);
|
||||
|
||||
priv->regs.ier = up_inserial(priv, UART_IER_OFFS);
|
||||
priv->regs.lcr = up_inserial(priv, UART_LCR_OFFS);
|
||||
|
||||
@@ -38,11 +38,15 @@
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
@@ -163,9 +167,9 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
||||
{
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
up_ledon(LED_PANIC);
|
||||
up_delay(250);
|
||||
up_mdelay(250);
|
||||
up_ledoff(LED_PANIC);
|
||||
up_delay(250);
|
||||
up_mdelay(250);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* common/up_initialize.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
@@ -31,11 +31,11 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
@@ -45,37 +45,67 @@
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Define to enable timing loop calibration */
|
||||
|
||||
#undef CONFIG_ARM_CALIBRATION
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Function Prototypes
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Global Functions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: up_calibratedelay
|
||||
*
|
||||
* Description:
|
||||
* Delay loops are provided for short timing loops. This function, if
|
||||
* enabled, will just wait for 100 seconds. Using a stopwatch, you can
|
||||
* can then determine if the timing loops are properly calibrated.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
#if defined(CONFIG_ARM_CALIBRATION) & defined(CONFIG_DEBUG)
|
||||
static void up_calibratedelay(void)
|
||||
{
|
||||
int i;
|
||||
lldbg("Beginning 100s delay\n");
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
up_mdelay(1000);
|
||||
}
|
||||
lldbg("End 100s delay\n");
|
||||
}
|
||||
#else
|
||||
# define up_calibratedelay()
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_initialize
|
||||
*
|
||||
* Description:
|
||||
* up_initialize will be called once during OS
|
||||
* initialization after the basic OS services have been
|
||||
* initialized. The architecture specific details of
|
||||
* initializing the OS will be handled here. Such things as
|
||||
* setting up interrupt service routines, starting the
|
||||
* clock, and registering device drivers are some of the
|
||||
* things that are different for each processor and hardware
|
||||
* platform.
|
||||
* up_initialize will be called once during OS initialization after the
|
||||
* basic OS services have been initialized. The architecture specific
|
||||
* details of initializing the OS will be handled here. Such things as
|
||||
* setting up interrupt service routines, starting the clock, and
|
||||
* registering device drivers are some of the things that are different
|
||||
* for each processor and hardware platform.
|
||||
*
|
||||
* up_initialize is called after the OS initialized but
|
||||
* before the init process has been started and before the
|
||||
* libraries have been initialized. OS services and driver
|
||||
* services are available.
|
||||
* up_initialize is called after the OS initialized but before the user
|
||||
* initialization logic has been started and before the libraries have
|
||||
* been initialized. OS services and driver services are available.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void up_initialize(void)
|
||||
{
|
||||
@@ -83,6 +113,10 @@ void up_initialize(void)
|
||||
|
||||
current_regs = NULL;
|
||||
|
||||
/* Calibrate the timing loop */
|
||||
|
||||
up_calibratedelay();
|
||||
|
||||
/* Initialize the interrupt subsystem */
|
||||
|
||||
up_irqinitialize();
|
||||
@@ -100,5 +134,9 @@ void up_initialize(void)
|
||||
/* Initialize the serial device driver */
|
||||
|
||||
up_serialinit();
|
||||
|
||||
/* Initialize the netwok */
|
||||
|
||||
up_netinitialize();
|
||||
up_ledon(LED_IRQSENABLED);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@ extern uint32 g_heapbase;
|
||||
extern void up_boot(void);
|
||||
extern void up_copystate(uint32 *dest, uint32 *src);
|
||||
extern void up_dataabort(uint32 *regs);
|
||||
extern void up_delay(int milliseconds);
|
||||
extern void up_decodeirq(uint32 *regs);
|
||||
extern void up_doirq(int irq, uint32 *regs);
|
||||
extern void up_fullcontextrestore(uint32 *regs) __attribute__ ((noreturn));
|
||||
@@ -157,6 +156,13 @@ extern void up_ledoff(int led);
|
||||
# define up_ledoff(led)
|
||||
#endif
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
extern void up_netinitialize(void);
|
||||
#else
|
||||
# define up_netinitialize()
|
||||
#endif
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __UP_INTERNAL_H */
|
||||
|
||||
90
arch/arm/src/common/up_mdelay.c
Normal file
90
arch/arm/src/common/up_mdelay.c
Normal file
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* common/up_mdelay.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* 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 Gregory Nutt 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_mdelay
|
||||
*
|
||||
* Description:
|
||||
* Delay inline for the requested number of milliseconds.
|
||||
* *** NOT multi-tasking friendly ***
|
||||
*
|
||||
* ASSUMPTIONS:
|
||||
* The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_mdelay(unsigned int milliseconds)
|
||||
{
|
||||
volatile int i;
|
||||
volatile int j;
|
||||
|
||||
for (i = 0; i < milliseconds; i++)
|
||||
{
|
||||
for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
128
arch/arm/src/common/up_udelay.c
Normal file
128
arch/arm/src/common/up_udelay.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/****************************************************************************
|
||||
* common/up_udelay.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* 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 Gregory Nutt 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
||||
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
||||
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_udelay
|
||||
*
|
||||
* Description:
|
||||
* Delay inline for the requested number of microseconds. NOTE: Because
|
||||
* of all of the setup, several microseconds will be lost before the actual
|
||||
* timing looop begins. Thus, the delay will always be a few microseconds
|
||||
* longer than requested.
|
||||
*
|
||||
* *** NOT multi-tasking friendly ***
|
||||
*
|
||||
* ASSUMPTIONS:
|
||||
* The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_udelay(unsigned int microseconds)
|
||||
{
|
||||
volatile int i;
|
||||
|
||||
/* We'll do this a little at a time because we expect that the
|
||||
* CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in
|
||||
* the divisions of its calculation. We'll use the largest values that
|
||||
* we can in order to prevent significant error buildup in the loops.
|
||||
*/
|
||||
|
||||
while (microseconds > 1000)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds -= 1000;
|
||||
}
|
||||
|
||||
while (microseconds > 100)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds -= 100;
|
||||
}
|
||||
|
||||
while (microseconds > 10)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds -= 10;
|
||||
}
|
||||
|
||||
while (microseconds > 0)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds--;
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "os_internal.h"
|
||||
#include "clock_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/************************************************************
|
||||
@@ -101,7 +102,7 @@ void up_unblock_task(_TCB *tcb)
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ HEAD_ASRC = up_head.S
|
||||
CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S \
|
||||
up_vectors.S up_vectortab.S
|
||||
CMN_CSRCS = up_assert.c up_blocktask.c up_copystate.c up_createstack.c \
|
||||
up_dataabort.c up_delay.c up_exit.c up_idle.c \
|
||||
up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c \
|
||||
up_initialize.c up_initialstate.c up_interruptcontext.c \
|
||||
up_prefetchabort.c up_releasepending.c up_releasestack.c \
|
||||
up_reprioritizertr.c up_schedulesigaction.c \
|
||||
|
||||
112
arch/arm/src/dm320/dm320_emif.h
Normal file
112
arch/arm/src/dm320/dm320_emif.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/************************************************************************************
|
||||
* dm320/dm320_emif.h
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* 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 Gregory Nutt 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __DM320_DM320_EMIF_H
|
||||
#define __DM320_DM320_EMIF_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* External Memory Interface (EMIF) Registers */
|
||||
|
||||
#define DM320_EMIF_CS0CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A00) /* CS0 Control Register #1 */
|
||||
#define DM320_EMIF_CS0CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A02) /* CS0 Control Register #2 */
|
||||
#define DM320_EMIF_CS0CTRL3 (DM320_PERIPHERALS_VADDR + 0x0A04) /* CS0 Control Register #3 */
|
||||
#define DM320_EMIF_CS1CTRL1A (DM320_PERIPHERALS_VADDR + 0x0A06) /* CS1 Control Register #1A */
|
||||
#define DM320_EMIF_CS1CTRL1B (DM320_PERIPHERALS_VADDR + 0x0A08) /* CS1 Control Register #1B */
|
||||
#define DM320_EMIF_CS2CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A0A) /* CS1 Control Register #2 */
|
||||
#define DM320_EMIF_CS2CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A0C) /* CS2 Control Register #1 */
|
||||
#define DM320_EMIF_CS1CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A0E) /* CS2 Control Register #2 */
|
||||
#define DM320_EMIF_CS3CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A10) /* CS3 Control Register #1 */
|
||||
#define DM320_EMIF_CS3CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A12) /* CS3 Control Register #2 */
|
||||
#define DM320_EMIF_CS4CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A14) /* CS4 Control Register #1 */
|
||||
#define DM320_EMIF_CS4CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A16) /* CS4 Control Register #2 */
|
||||
#define DM320_EMIF_BUSCTRL (DM320_PERIPHERALS_VADDR + 0x0A18) /* Bus Control Register */
|
||||
#define DM320_EMIF_BUSRLS (DM320_PERIPHERALS_VADDR + 0x0A1A) /* Bus Release Control Register */
|
||||
#define DM320_EMIF_CFCTRL1 (DM320_PERIPHERALS_VADDR + 0x0A1C) /* CFC ControlRegister #1 */
|
||||
#define DM320_EMIF_CFCTRL2 (DM320_PERIPHERALS_VADDR + 0x0A1E) /* CFC ControlRegister#2 */
|
||||
#define DM320_EMIF_SMCTRL (DM320_PERIPHERALS_VADDR + 0x0A20) /* SmartMedia Control Register */
|
||||
#define DM320_EMIF_BUSINTEN (DM320_PERIPHERALS_VADDR + 0x0A22) /* Bus Interrupt Enable Register */
|
||||
#define DM320_EMIF_BUSSTS (DM320_PERIPHERALS_VADDR + 0x0A24) /* Bus Status Register */
|
||||
#define DM320_EMIF_BUSWAITMD (DM320_PERIPHERALS_VADDR + 0x0A26) /* Bus Wait Mode Register */
|
||||
#define DM320_EMIF_ECC1CP (DM320_PERIPHERALS_VADDR + 0x0A28) /* ECC Area 1 CP Register */
|
||||
#define DM320_EMIF_ECC1LP (DM320_PERIPHERALS_VADDR + 0x0A2A) /* ECC Area 1 LP Register */
|
||||
#define DM320_EMIF_ECC2CP (DM320_PERIPHERALS_VADDR + 0x0A2C) /* ECC Area 2 CP Register */
|
||||
#define DM320_EMIF_ECC2LP (DM320_PERIPHERALS_VADDR + 0x0A2E) /* ECC Area 2 LP Register */
|
||||
#define DM320_EMIF_ECC3CP (DM320_PERIPHERALS_VADDR + 0x0A30) /* ECC Area 3 CP Register */
|
||||
#define DM320_EMIF_ECC3LP (DM320_PERIPHERALS_VADDR + 0x0A32) /* ECC Area 3 LP Register */
|
||||
#define DM320_EMIF_ECC4CP (DM320_PERIPHERALS_VADDR + 0x0A34) /* ECC Area 4 CP Register */
|
||||
#define DM320_EMIF_ECC4LP (DM320_PERIPHERALS_VADDR + 0x0A36) /* ECC Area 4 LP Register */
|
||||
#define DM320_EMIF_ECC5CP (DM320_PERIPHERALS_VADDR + 0x0A38) /* ECC Area 5 CP Register */
|
||||
#define DM320_EMIF_ECC5LP (DM320_PERIPHERALS_VADDR + 0x0A3A) /* ECC Area 5 LP Register */
|
||||
#define DM320_EMIF_ECC6CP (DM320_PERIPHERALS_VADDR + 0x0A3C) /* ECC Area 6 CP Register */
|
||||
#define DM320_EMIF_ECC6LP (DM320_PERIPHERALS_VADDR + 0x0A3E) /* ECC Area 6 LP Register */
|
||||
#define DM320_EMIF_ECC7CP (DM320_PERIPHERALS_VADDR + 0x0A40) /* ECC Area 7 CP Register */
|
||||
#define DM320_EMIF_ECC7LP (DM320_PERIPHERALS_VADDR + 0x0A42) /* ECC Area 7 LP Register */
|
||||
#define DM320_EMIF_ECC8CP (DM320_PERIPHERALS_VADDR + 0x0A44) /* ECC Area 8 CP Register */
|
||||
#define DM320_EMIF_ECC8LP (DM320_PERIPHERALS_VADDR + 0x0A46) /* ECC Area 8 LP Register */
|
||||
#define DM320_EMIF_ECCCLR (DM320_PERIPHERALS_VADDR + 0x0A48) /* ECC Clear Register */
|
||||
#define DM320_EMIF_PAGESZ (DM320_PERIPHERALS_VADDR + 0x0A4A) /* SmartMedia Page Size Register */
|
||||
#define DM320_EMIF_PRIORCTL (DM320_PERIPHERALS_VADDR + 0x0A4C) /* Priority control for DMA */
|
||||
#define DM320_EMIF_IMGDSPDEST (DM320_PERIPHERALS_VADDR + 0x0A4E) /* DSP/IMGBUF DMA destination */
|
||||
#define DM320_EMIF_IMGDSPADDH (DM320_PERIPHERALS_VADDR + 0x0A50) /* DSP/IMGBUF high address */
|
||||
#define DM320_EMIF_IMGDSPADDL (DM320_PERIPHERALS_VADDR + 0x0A52) /* DSP/IMGBUG low address */
|
||||
#define DM320_EMIF_AHBADDH (DM320_PERIPHERALS_VADDR + 0x0A54) /* AHB high address */
|
||||
#define DM320_EMIF_AHBADDL (DM320_PERIPHERALS_VADDR + 0x0A56) /* AHB low address */
|
||||
#define DM320_EMIF_MTCADDH (DM320_PERIPHERALS_VADDR + 0x0A58) /* MTC high address */
|
||||
#define DM320_EMIF_MTCADDL (DM320_PERIPHERALS_VADDR + 0x0A5A) /* MTC low address */
|
||||
#define DM320_EMIF_DMASIZE (DM320_PERIPHERALS_VADDR + 0x0A5C) /* DMA Transfer Size Register */
|
||||
#define DM320_EMIF_DMAMTCSEL (DM320_PERIPHERALS_VADDR + 0x0A5E) /* DMA Device Select Register */
|
||||
#define DM320_EMIF_DMACTL (DM320_PERIPHERALS_VADDR + 0x0A60) /* DMA Control Register */
|
||||
#define DM320_EMIF_TEST (DM320_PERIPHERALS_VADDR + 0x0A62) /* Test Register.Do not use */
|
||||
|
||||
/************************************************************************************
|
||||
* Inline Functions
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __DM320_DM320_EMIF_H */
|
||||
@@ -90,7 +90,7 @@
|
||||
if ((pin) < 16) { _reg = (reg0); _pin = (pin); } \
|
||||
else if ((pin) < 32) { _reg = (reg1); _pin = ((pin) - 16); } \
|
||||
else { _reg = (reg2); _pin = ((pin) - 32); } \
|
||||
putreg16((getreg16(_reg) | (1 << _pin)), _reg)); \
|
||||
putreg16((getreg16(_reg) | (1 << _pin)), _reg); \
|
||||
} while (0)
|
||||
|
||||
#define _GIO_CLEAR_REG(pin, reg0, reg1, reg2) \
|
||||
@@ -99,7 +99,7 @@
|
||||
if ((pin) < 16) { _reg = (reg0); _pin = (pin); } \
|
||||
else if ((pin) < 32) { _reg = (reg1); _pin = ((pin) - 16); } \
|
||||
else { _reg = (reg2); _pin = ((pin) - 32); } \
|
||||
putreg16((getreg16(_reg) & ~(1 << _pin)), _reg)); \
|
||||
putreg16((getreg16(_reg) & ~(1 << _pin)), _reg); \
|
||||
} while (0)
|
||||
|
||||
/* Select GIO input or output */
|
||||
|
||||
@@ -37,8 +37,8 @@ HEAD_ASRC = lpc214x_head.S
|
||||
|
||||
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S
|
||||
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
|
||||
up_createstack.c up_dataabort.c up_delay.c up_exit.c \
|
||||
up_idle.c up_initialize.c up_initialstate.c \
|
||||
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c \
|
||||
up_exit.c up_idle.c up_initialize.c up_initialstate.c \
|
||||
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \
|
||||
up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \
|
||||
up_sigdeliver.c up_syscall.c up_unblocktask.c \
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -97,11 +98,11 @@ void up_unblock_task(_TCB *tcb)
|
||||
sched_removeblocked(tcb);
|
||||
|
||||
/* Reset its timeslice. This is only meaningful for round
|
||||
* robin tasks but it doesn't here to do it for everything
|
||||
* robin tasks but it doesn't hurt to do it for all tasks
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -96,11 +97,11 @@ void up_unblock_task(_TCB *tcb)
|
||||
sched_removeblocked(tcb);
|
||||
|
||||
/* Reset its timeslice. This is only meaningful for round
|
||||
* robin tasks but it doesn't here to do it for everything
|
||||
* robin tasks but it doesn't hurt to do it for all tasks.
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -201,7 +201,7 @@ irqtest:
|
||||
.depend: Makefile up_mem.h $(DEPSRCS)
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
|
||||
if
|
||||
fi
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
touch $@
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
#include "up_mem.h"
|
||||
|
||||
@@ -95,7 +95,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
||||
* Name: up_assert
|
||||
************************************************************/
|
||||
|
||||
void up_assert(void)
|
||||
void up_assert(const ubyte *filename, int lineno)
|
||||
{
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
@@ -104,9 +104,11 @@ void up_assert(void)
|
||||
up_ledon(LED_ASSERTION);
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
lldbg("%s: Assertion failed\n", rtcb->name);
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed\n");
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
|
||||
up_dumpstack();
|
||||
@@ -117,7 +119,7 @@ void up_assert(void)
|
||||
* Name: up_assert_code
|
||||
************************************************************/
|
||||
|
||||
void up_assert_code(int errorcode)
|
||||
void up_assert_code(const ubyte *filename, int lineno, int errorcode)
|
||||
{
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
@@ -126,9 +128,11 @@ void up_assert_code(int errorcode)
|
||||
up_ledon(LED_ASSERTION);
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
lldbg("%s: Assertion failed, error=%d\n", rtcb->name, errorcode);
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n",
|
||||
filename, lineno, rtcb->name, errorcode);
|
||||
#else
|
||||
lldbg("Assertion failed , error=%d\n", errorcode);
|
||||
lldbg("Assertion failed at file:%s line: %d error code: %d\n",
|
||||
filename, lineno, errorcode);
|
||||
#endif
|
||||
|
||||
up_dumpstack();
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -101,7 +102,7 @@ void up_unblock_task(FAR _TCB *tcb)
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -49,11 +49,16 @@ CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
|
||||
ifeq ($(CONFIG_FS_FAT),y)
|
||||
CSRCS += up_blockdevice.c up_deviceimage.c
|
||||
endif
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
CSRCS += up_uipdriver.c
|
||||
SPECSRCS += up_tapdev.c
|
||||
endif
|
||||
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
SPECOBJS = $(SPECSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
SRCS = $(ASRCS) $(CSRCS) $(SPECSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS) $(SPECOBJS)
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS = -lc
|
||||
@@ -74,31 +79,33 @@ $(AOBJS): %$(OBJEXT): %.S
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(SPECOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(HOSTCFLAGS) $< -o $@
|
||||
|
||||
libarch$(LIBEXT): $(OBJS)
|
||||
( for obj in $(OBJS) ; do \
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||
done ; )
|
||||
|
||||
nuttx: $(LINKOBJS)
|
||||
nuttx$(EXEEXT): $(LINKOBJS)
|
||||
$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
||||
-Wl,--start-group $(LDLIBS) -Wl,--end-group $(EXTRA_LIBS)
|
||||
@$(NM) $(TOPDIR)/$@ | \
|
||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
sort > $(TOPDIR)/System.map
|
||||
|
||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
sort > $(TOPDIR)/System.map
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
touch $@
|
||||
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
rm -f libarch$(LIBEXT) *~
|
||||
if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
@rm -f libarch$(LIBEXT) *~
|
||||
@if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
|
||||
distclean: clean
|
||||
rm -f Make.dep .depend
|
||||
@rm -f Make.dep .depend
|
||||
|
||||
-include Make.dep
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
*
|
||||
************************************************************/
|
||||
|
||||
#if !defined(linux) && !defined(__CYGWIN__)
|
||||
# error "Sorry, this will only work with Linux"
|
||||
#else
|
||||
|
||||
/************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
@@ -134,3 +138,6 @@ int up_putc(int ch)
|
||||
(void)up_write(1, &b, 1);
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
|
||||
@@ -82,7 +82,11 @@
|
||||
* xxd -g 1 nuttx-test.vfat.gz >some-file
|
||||
*
|
||||
* Then manually massaged from the gzip xxd output to zlib format. See
|
||||
* http://www.faqs.org/rfcs/rfc1952.html
|
||||
* http://www.faqs.org/rfcs/rfc1952.html. This amounts to:
|
||||
*
|
||||
* Remove all of the leading bytes through the null terminator of the file name
|
||||
* Remove the last 8 bytes
|
||||
* Add 0x08, 0x1d to the beginning.
|
||||
*/
|
||||
|
||||
static const unsigned char g_vfatdata[] =
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
void _exit(int status)
|
||||
{
|
||||
_TCB* tcb = (_TCB*)g_readytorun.head;
|
||||
irqstate_t flags;
|
||||
|
||||
dbg("TCB=%p exitting\n", tcb);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
#include <assert.h>
|
||||
#include <nuttx/os_external.h>
|
||||
#include <nuttx/init.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/************************************************************
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* 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.
|
||||
*
|
||||
@@ -80,5 +80,11 @@ void up_idle(void)
|
||||
*/
|
||||
|
||||
sched_process_timer();
|
||||
|
||||
/* Run the network if enabled */
|
||||
|
||||
#if defined(CONFIG_NET) && defined(linux)
|
||||
uipdriver_loop();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -86,4 +86,7 @@ void up_initialize(void)
|
||||
devnull_register(); /* Standard /dev/null */
|
||||
up_devconsole(); /* Our private /dev/console */
|
||||
up_registerblockdevice(); /* Our simulated block device /dev/blkdev */
|
||||
#if defined(CONFIG_NET) && defined(linux)
|
||||
uipdriver_init(); /* Our "real" netwok driver */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -107,5 +107,22 @@ extern void up_registerblockdevice(void);
|
||||
|
||||
extern char *up_deviceimage(void);
|
||||
|
||||
/* up_tapdev.c ************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
extern unsigned long up_getwalltime( void );
|
||||
extern void tapdev_init(void);
|
||||
extern int tapdev_getmacaddr(unsigned char *macaddr);
|
||||
extern unsigned int tapdev_read(unsigned char *buf, unsigned int buflen);
|
||||
extern void tapdev_send(unsigned char *buf, unsigned int buflen);
|
||||
#endif
|
||||
|
||||
/* up_uipdriver.c *********************************************************/
|
||||
|
||||
#if defined(CONFIG_NET) && defined(linux)
|
||||
extern int uipdriver_init(void);
|
||||
extern void uipdriver_loop(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_UP_INTERNAL_H */
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
/**************************************************************************
|
||||
* Private Definitions
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# define SYMBOL(s) _##s
|
||||
#else
|
||||
# define SYMBOL(s) s
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
* Private Types
|
||||
@@ -72,58 +78,65 @@
|
||||
**************************************************************************/
|
||||
|
||||
.text
|
||||
.globl up_setjmp
|
||||
.type up_setjmp, @function
|
||||
up_setjmp:
|
||||
.globl SYMBOL(up_setjmp)
|
||||
#ifndef __CYGWIN__
|
||||
.type SYMBOL(up_setjmp), @function
|
||||
#endif
|
||||
SYMBOL(up_setjmp):
|
||||
|
||||
/* %ebx, %esi, %edi, and %ebp must be preserved.
|
||||
* save %ebx, $esi, and %edi now... */
|
||||
|
||||
movl 4(%esp), %eax
|
||||
movl %ebx, (JB_EBX)(%eax)
|
||||
movl %esi, (JB_ESI)(%eax)
|
||||
movl %edi, (JB_EDI)(%eax)
|
||||
movl 4(%esp), %eax
|
||||
movl %ebx, (JB_EBX)(%eax)
|
||||
movl %esi, (JB_ESI)(%eax)
|
||||
movl %edi, (JB_EDI)(%eax)
|
||||
|
||||
/* Save the value of SP as will be after we return */
|
||||
/* Save the value of SP as will be after we return */
|
||||
|
||||
leal 4(%esp), %ecx
|
||||
movl %ecx, (JB_SP)(%eax)
|
||||
leal 4(%esp), %ecx
|
||||
movl %ecx, (JB_SP)(%eax)
|
||||
|
||||
/* Save the return PC */
|
||||
/* Save the return PC */
|
||||
|
||||
movl 0(%esp), %ecx
|
||||
movl %ecx, (JB_PC)(%eax)
|
||||
movl 0(%esp), %ecx
|
||||
movl %ecx, (JB_PC)(%eax)
|
||||
|
||||
/* Save the framepointer */
|
||||
/* Save the framepointer */
|
||||
|
||||
movl %ebp, (JB_EBP)(%eax)
|
||||
movl %ebp, (JB_EBP)(%eax)
|
||||
|
||||
/* And return 0 */
|
||||
|
||||
xorl %eax, %eax
|
||||
ret
|
||||
.size up_setjmp, . - up_setjmp
|
||||
ret
|
||||
#ifndef __CYGWIN__
|
||||
.size SYMBOL(up_setjmp), . - SYMBOL(up_setjmp)
|
||||
#endif
|
||||
.globl SYMBOL(up_longjmp)
|
||||
#ifndef __CYGWIN__
|
||||
.type SYMBOL(up_longjmp), @function
|
||||
#endif
|
||||
SYMBOL(up_longjmp):
|
||||
movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */
|
||||
movl 8(%esp), %eax /* Second argument is return value. */
|
||||
|
||||
.globl up_longjmp
|
||||
.type up_longjmp, @function
|
||||
up_longjmp:
|
||||
movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */
|
||||
movl 8(%esp), %eax /* Second argument is return value. */
|
||||
/* Save the return address now. */
|
||||
|
||||
/* Save the return address now. */
|
||||
movl (JB_PC)(%ecx), %edx
|
||||
|
||||
movl (JB_PC)(%ecx), %edx
|
||||
/* Restore registers. */
|
||||
|
||||
/* Restore registers. */
|
||||
movl (JB_EBX)(%ecx), %ebx
|
||||
movl (JB_ESI)(%ecx), %esi
|
||||
movl (JB_EDI)(%ecx), %edi
|
||||
movl (JB_EBP)(%ecx), %ebp
|
||||
movl (JB_SP)(%ecx), %esp
|
||||
|
||||
movl (JB_EBX)(%ecx), %ebx
|
||||
movl (JB_ESI)(%ecx), %esi
|
||||
movl (JB_EDI)(%ecx), %edi
|
||||
movl (JB_EBP)(%ecx), %ebp
|
||||
movl (JB_SP)(%ecx), %esp
|
||||
/* Jump to saved PC. */
|
||||
|
||||
/* Jump to saved PC. */
|
||||
|
||||
jmp *%edx
|
||||
.size up_longjmp, . - up_longjmp
|
||||
jmp *%edx
|
||||
#ifndef __CYGWIN__
|
||||
.size SYMBOL(up_longjmp), . - SYMBOL(up_longjmp)
|
||||
#endif
|
||||
|
||||
|
||||
375
arch/sim/src/up_tapdev.c
Normal file
375
arch/sim/src/up_tapdev.c
Normal file
@@ -0,0 +1,375 @@
|
||||
|
||||
/****************************************************************************
|
||||
* up_tapdev.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Based on code from uIP which also has a BSD-like license:
|
||||
*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef linux
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
#include <linux/net.h>
|
||||
|
||||
extern int lib_rawprintf(const char *format, ...);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define TAPDEV_DEBUG 1
|
||||
|
||||
#define DEVTAP "/dev/net/tun"
|
||||
|
||||
#ifndef CONFIG_EXAMPLE_UIP_DHCPC
|
||||
# define UIP_IPADDR0 192
|
||||
# define UIP_IPADDR1 168
|
||||
# define UIP_IPADDR2 0
|
||||
# define UIP_IPADDR3 128
|
||||
#else
|
||||
# define UIP_IPADDR0 0
|
||||
# define UIP_IPADDR1 0
|
||||
# define UIP_IPADDR2 0
|
||||
# define UIP_IPADDR3 0
|
||||
#endif
|
||||
|
||||
#define READ 3
|
||||
#define WRITE 4
|
||||
#define OPEN 5
|
||||
#define IOCTL 54
|
||||
#define SELECT 82
|
||||
#define SOCKETCALL 102
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/* Warning: This is very much Linux version specific! */
|
||||
|
||||
struct sel_arg_struct
|
||||
{
|
||||
unsigned long n;
|
||||
fd_set *inp;
|
||||
fd_set *outp;
|
||||
fd_set *exp;
|
||||
struct timeval *tvp;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef TAPDEV_DEBUG
|
||||
static int gdrop = 0;
|
||||
#endif
|
||||
static int gtapdevfd;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* This is REALLY awkward.. we need to compile using the system header files,
|
||||
* but we can't use any of the libc calls because all of the symbols are
|
||||
* defined for NuttX (read, write, etc)! So we do hand rolled syscalls
|
||||
* to get to the Linux functions.
|
||||
*/
|
||||
|
||||
static inline int up_open(const char *filename, int flags, int mode)
|
||||
{
|
||||
int result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (OPEN), "b" ((int)(filename)), "c" ((int)(flags)), "d" ((int)(mode)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_socketcall(int call, unsigned long *args)
|
||||
{
|
||||
int result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (SOCKETCALL), "b" (call), "c" ((int)args) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_socket(int domain, int type, int protocol)
|
||||
{
|
||||
unsigned long args[3];
|
||||
args[0] = domain;
|
||||
args[1] = type;
|
||||
args[2] = protocol;
|
||||
return up_socketcall(SYS_SOCKET, args);
|
||||
}
|
||||
|
||||
static inline int up_read(int fd, void* buf, size_t count)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (READ), "b" ((int)(fd)), "c" ((int)(buf)), "d" ((int)(count)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_write(int fd, const void* buf, size_t count)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (WRITE), "b" ((int)(fd)), "c" ((int)(buf)), "d" ((int)(count)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_ioctl(int fd, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (IOCTL), "b" ((int)(fd)), "c" ((int)(cmd)), "d" ((long)(arg)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_select(struct sel_arg_struct *arg)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (SELECT),"b" ((struct sel_arg_struct *)(arg))
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
#ifdef TAPDEV_DEBUG
|
||||
static inline void dump_ethhdr(const char *msg, unsigned char *buf, int buflen)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: %s %d bytes\n", msg, buflen);
|
||||
lib_rawprintf(" %02x:%02x:%02x:%02x:%02x:%02x %02x:%02x:%02x:%02x:%02x:%02x %02x%02x\n",
|
||||
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
|
||||
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
|
||||
#if UIP_BYTE_ORDER == UIP_LITTLE_ENDIAN
|
||||
buf[12], buf[13]);
|
||||
#else
|
||||
buf[13], buf[12]);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
# define dump_ethhdr(m,b,l)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
unsigned long up_getwalltime( void )
|
||||
{
|
||||
struct timeval tm;
|
||||
(void)gettimeofday(&tm, NULL);
|
||||
return tm.tv_sec*1000 + tm.tv_usec/1000;
|
||||
}
|
||||
|
||||
void tapdev_init(void)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
char buf[1024];
|
||||
int ret;
|
||||
|
||||
/* Open the tap device */
|
||||
|
||||
gtapdevfd = up_open(DEVTAP, O_RDWR, 0644);
|
||||
if (gtapdevfd < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: open failed: %d\n", -gtapdevfd );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Configure the tap device */
|
||||
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
|
||||
ret = up_ioctl(gtapdevfd, TUNSETIFF, (unsigned long) &ifr);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: ioctl failed: %d\n", -ret );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Assign an IPv4 address to the tap device */
|
||||
|
||||
snprintf(buf, sizeof(buf), "/sbin/ifconfig tap0 inet %d.%d.%d.%d\n",
|
||||
UIP_IPADDR0, UIP_IPADDR1, UIP_IPADDR2, UIP_IPADDR3);
|
||||
system(buf);
|
||||
}
|
||||
|
||||
int tapdev_getmacaddr(unsigned char *macaddr)
|
||||
{
|
||||
int ret = -1;
|
||||
if (macaddr)
|
||||
{
|
||||
/* Get a socket (only so that we get access to the INET subsystem) */
|
||||
|
||||
int sockfd = up_socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd >= 0)
|
||||
{
|
||||
struct ifreq req;
|
||||
memset (&req, 0, sizeof(struct ifreq));
|
||||
|
||||
/* Put the driver name into the request */
|
||||
|
||||
strncpy(req.ifr_name, "tap0", IFNAMSIZ);
|
||||
|
||||
/* Perform the ioctl to get the MAC address */
|
||||
|
||||
ret = up_ioctl(sockfd, SIOCGIFHWADDR, (unsigned long)&req);
|
||||
if (!ret)
|
||||
{
|
||||
/* Return the MAC address */
|
||||
|
||||
memcpy(macaddr, &req.ifr_hwaddr.sa_data, IFHWADDRLEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int tapdev_read(unsigned char *buf, unsigned int buflen)
|
||||
{
|
||||
struct sel_arg_struct arg;
|
||||
fd_set fdset;
|
||||
struct timeval tv;
|
||||
int ret;
|
||||
|
||||
/* We can't do anything if we failed to open the tap device */
|
||||
|
||||
if (gtapdevfd < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Wait for data on the tap device (or a timeout) */
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 1000;
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(gtapdevfd, &fdset);
|
||||
|
||||
arg.n = gtapdevfd + 1;
|
||||
arg.inp = &fdset;
|
||||
arg.outp = NULL;
|
||||
arg.exp = NULL;
|
||||
arg.tvp = &tv;
|
||||
|
||||
ret = up_select(&arg);
|
||||
if(ret == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = up_read(gtapdevfd, buf, buflen);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: read failed: %d\n", -ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dump_ethhdr("read", buf, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void tapdev_send(unsigned char *buf, unsigned int buflen)
|
||||
{
|
||||
int ret;
|
||||
#ifdef TAPDEV_DEBUG
|
||||
lib_rawprintf("tapdev_send: sending %d bytes\n", buflen);
|
||||
|
||||
gdrop++;
|
||||
if(gdrop % 8 == 7)
|
||||
{
|
||||
lib_rawprintf("Dropped a packet!\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = up_write(gtapdevfd, buf, buflen);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: write failed: %d", -ret);
|
||||
exit(1);
|
||||
}
|
||||
dump_ethhdr("write", buf, buflen);
|
||||
}
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
|
||||
224
arch/sim/src/up_uipdriver.c
Normal file
224
arch/sim/src/up_uipdriver.c
Normal file
@@ -0,0 +1,224 @@
|
||||
/****************************************************************************
|
||||
* up_uipdriver.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Based on code from uIP which also has a BSD-like license:
|
||||
*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef linux
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <sched.h>
|
||||
#include <nuttx/net.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BUF ((struct uip_eth_hdr *)g_sim_dev.d_buf)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct timer
|
||||
{
|
||||
uint32 interval;
|
||||
uint32 start;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static struct timer g_periodic_timer;
|
||||
static struct uip_driver_s g_sim_dev;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static void timer_set( struct timer *t, unsigned int interval )
|
||||
{
|
||||
t->interval = interval;
|
||||
t->start = up_getwalltime();
|
||||
}
|
||||
|
||||
static boolean timer_expired( struct timer *t )
|
||||
{
|
||||
return (up_getwalltime() - t->start) >= t->interval;
|
||||
}
|
||||
|
||||
void timer_reset(struct timer *t)
|
||||
{
|
||||
t->start += t->interval;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_PROMISCUOUS
|
||||
# define uipdriver_comparemac(a,b) (0)
|
||||
#else
|
||||
static inline int uip_comparemac(struct uip_eth_addr *paddr1, struct uip_eth_addr *paddr2)
|
||||
{
|
||||
return memcmp(paddr1, paddr2, sizeof(struct uip_eth_addr));
|
||||
}
|
||||
#endif
|
||||
|
||||
static int sim_uiptxpoll(struct uip_driver_s *dev)
|
||||
{
|
||||
/* If the polling resulted in data that should be sent out on the network,
|
||||
* the field d_len is set to a value > 0.
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
uip_arp_out(&g_sim_dev);
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
|
||||
/* If zero is returned, the polling will continue until all connections have
|
||||
* been examined.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void uipdriver_loop(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* tapdev_read will return 0 on a timeout event and >0 on a data received event */
|
||||
|
||||
g_sim_dev.d_len = tapdev_read((unsigned char*)g_sim_dev.d_buf, UIP_BUFSIZE);
|
||||
|
||||
/* Disable preemption through to the following so that it behaves a little more
|
||||
* like an interrupt (otherwise, the following logic gets pre-empted an behaves
|
||||
* oddly.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
/* Data received event. Check for valid Ethernet header with destination == our
|
||||
* MAC address
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > UIP_LLH_LEN && uip_comparemac( &BUF->dest, &g_sim_dev.d_mac) == 0)
|
||||
{
|
||||
/* We only accept IP packets of the configured type and ARP packets */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (BUF->type == htons(UIP_ETHTYPE_IP6))
|
||||
#else
|
||||
if (BUF->type == htons(UIP_ETHTYPE_IP))
|
||||
#endif
|
||||
{
|
||||
uip_arp_ipin();
|
||||
uip_input(&g_sim_dev);
|
||||
|
||||
/* If the above function invocation resulted in data that
|
||||
* should be sent out on the network, the global variable
|
||||
* d_len is set to a value > 0.
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
uip_arp_out(&g_sim_dev);
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(UIP_ETHTYPE_ARP))
|
||||
{
|
||||
uip_arp_arpin(&g_sim_dev);
|
||||
|
||||
/* If the above function invocation resulted in data that
|
||||
* should be sent out on the network, the global variable
|
||||
* d_len is set to a value > 0.
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Otherwise, it must be a timeout event */
|
||||
|
||||
else if (timer_expired(&g_periodic_timer))
|
||||
{
|
||||
timer_reset(&g_periodic_timer);
|
||||
uip_poll(&g_sim_dev, sim_uiptxpoll, UIP_DRV_TIMER);
|
||||
}
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
int uipdriver_init(void)
|
||||
{
|
||||
/* Internal initalization */
|
||||
|
||||
timer_set(&g_periodic_timer, 500);
|
||||
tapdev_init();
|
||||
(void)tapdev_getmacaddr(g_sim_dev.d_mac.addr);
|
||||
|
||||
/* Register the device with the OS so that socket IOCTLs can be performed */
|
||||
|
||||
(void)netdev_register(&g_sim_dev);
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -100,7 +101,7 @@ void up_unblock_task(_TCB *tcb)
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -132,6 +132,11 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
regions of memory to allocate from, this specifies the
|
||||
number of memory regions that the memory manager must
|
||||
handle and enables the API mm_addregion(start, end);
|
||||
CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
|
||||
or TICKS_PER_MSEC=10. This setting may be defined to
|
||||
inform NuttX that the processor hardware is providing
|
||||
system timer interrupts at some interrupt interval other
|
||||
than 10 msec.
|
||||
CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||
this number of milliseconds; Round robin scheduling can
|
||||
be disabled by setting this value to zero.
|
||||
@@ -159,7 +164,8 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
up waiting tasks.
|
||||
|
||||
CONFIG_DISABLE_CLOCK, CONFIG_DISABLE_POSIX_TIMERS, CONFIG_DISABLE_PTHREAD.
|
||||
CONFIG_DISABLE_SIGNALS, CONFIG_DISABLE_MQUEUE
|
||||
CONFIG_DISABLE_SIGNALS, CONFIG_DISABLE_MQUEUE, CONFIG_DISABLE_MOUNTPOUNT,
|
||||
CONFIG_DISABLE_ENVIRON
|
||||
|
||||
|
||||
Misc libc settings
|
||||
@@ -202,6 +208,35 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
structures. The system manages a pool of preallocated
|
||||
watchdog structures to minimize dynamic allocations
|
||||
|
||||
TCP/IP and UDP support via uIP
|
||||
CONFIG_NET - Enable or disable all network features
|
||||
CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors
|
||||
per task/thread.
|
||||
CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
|
||||
CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
CONFIG_NET_LOGGING - Logging on or off
|
||||
CONFIG_NET_UDP - UDP support on or off
|
||||
CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP
|
||||
connections
|
||||
CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's
|
||||
window
|
||||
CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
CONFIG_NET_BROADCAST - Broadcast support
|
||||
CONFIG_NET_LLH_LEN - The link level header length
|
||||
CONFIG_NET_FWCACHE_SIZE - number of packets to remember when
|
||||
looking for duplicates
|
||||
|
||||
UIP Network Utilities
|
||||
CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
|
||||
Stack and heap information
|
||||
|
||||
CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
|
||||
@@ -226,6 +261,9 @@ configs/sim
|
||||
This port does not support interrupts or a real timer (and hence no
|
||||
round robin scheduler) Otherwise, it is complete.
|
||||
|
||||
NOTE: This target will not run on Cygwin probably for many reasons but
|
||||
first off because it uses some of the same symbols as does cygwind.dll.
|
||||
|
||||
configs/c5471evm
|
||||
This is a port to the Spectrum Digital C5471 evaluation board. The
|
||||
C5471 is a dual core processor from TI with an ARM7TDMI general purpose
|
||||
|
||||
@@ -68,4 +68,9 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
|
||||
@@ -109,6 +109,11 @@ CONFIG_UART_MODEM_2STOP=0
|
||||
# handle and enables the API mm_addregion(start, end);
|
||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||
# time console output
|
||||
# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
|
||||
# or TICKS_PER_MSEC=10. This setting may be defined to
|
||||
# inform NuttX that the processor hardware is providing
|
||||
# system timer interrupts at some interrupt interval other
|
||||
# than 10 msec.
|
||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||
# this number of milliseconds; Round robin scheduling can
|
||||
# be disabled by setting this value to zero.
|
||||
@@ -157,6 +162,8 @@ CONFIG_DISABLE_POSIX_TIMERS=n
|
||||
CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -242,6 +249,52 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -68,4 +68,7 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
@@ -98,6 +98,11 @@ CONFIG_UART1_2STOP=0
|
||||
# handle and enables the API mm_addregion(start, end);
|
||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||
# time console output
|
||||
# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
|
||||
# or TICKS_PER_MSEC=10. This setting may be defined to
|
||||
# inform NuttX that the processor hardware is providing
|
||||
# system timer interrupts at some interrupt interval other
|
||||
# than 10 msec.
|
||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||
# this number of milliseconds; Round robin scheduling can
|
||||
# be disabled by setting this value to zero.
|
||||
@@ -146,6 +151,8 @@ CONFIG_DISABLE_POSIX_TIMERS=n
|
||||
CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -231,6 +238,52 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -68,4 +68,8 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
@@ -122,6 +122,11 @@ CONFIG_UART1_2STOP=0
|
||||
# handle and enables the API mm_addregion(start, end);
|
||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||
# time console output
|
||||
# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
|
||||
# or TICKS_PER_MSEC=10. This setting may be defined to
|
||||
# inform NuttX that the processor hardware is providing
|
||||
# system timer interrupts at some interrupt interval other
|
||||
# than 10 msec.
|
||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||
# this number of milliseconds; Round robin scheduling can
|
||||
# be disabled by setting this value to zero.
|
||||
@@ -170,6 +175,8 @@ CONFIG_DISABLE_POSIX_TIMERS=n
|
||||
CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -255,6 +262,52 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -68,4 +68,8 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
11
configs/ntosd-dm320/README.txt
Normal file
11
configs/ntosd-dm320/README.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
README
|
||||
^^^^^^
|
||||
|
||||
The configuration netconfig may be used instead of the
|
||||
default configuration (defconfig). This configuration
|
||||
enables networking using the OSDs DM9000A ethernet
|
||||
interface.
|
||||
|
||||
Disclaimer: The NuttX network subsystem is a "work in
|
||||
progress" at this time and minimal network functionality
|
||||
should be expected.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user