mirror of
https://github.com/apache/nuttx.git
synced 2025-12-11 21:20:26 +08:00
Compare commits
219 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efb733dfc4 | ||
|
|
dda4565ed9 | ||
|
|
432da54d46 | ||
|
|
0fca25b777 | ||
|
|
ee5f02dae5 | ||
|
|
9a7c5c29c5 | ||
|
|
54242efbcd | ||
|
|
f90fb7cdbe | ||
|
|
53a99eb382 | ||
|
|
b252be9bb9 | ||
|
|
3c494bbc9a | ||
|
|
669118c68e | ||
|
|
14570ca238 | ||
|
|
2d8db3fabc | ||
|
|
325e4e3833 | ||
|
|
bf2225c26c | ||
|
|
4dd560c5f0 | ||
|
|
b114621101 | ||
|
|
e3bd6172aa | ||
|
|
75253df209 | ||
|
|
d0a0accc99 | ||
|
|
5622797411 | ||
|
|
507914b3b4 | ||
|
|
2ab10a107f | ||
|
|
97a52f1b17 | ||
|
|
039efd6e2b | ||
|
|
7dffca15a1 | ||
|
|
978b0f79ad | ||
|
|
0bd70f78e4 | ||
|
|
28b1b8fdac | ||
|
|
757eff86e8 | ||
|
|
f116c153b9 | ||
|
|
174a9f77c6 | ||
|
|
3fd8bd65f4 | ||
|
|
2f1acf6786 | ||
|
|
09af7cf6ce | ||
|
|
00ad2ca2c4 | ||
|
|
ce1c48f5b6 | ||
|
|
ee8c1a2d58 | ||
|
|
4c564b97dc | ||
|
|
ac37ac75e0 | ||
|
|
1e52a8f36a | ||
|
|
7b3c17b1c1 | ||
|
|
ad8140f162 | ||
|
|
fac0d203bc | ||
|
|
e3035d2dff | ||
|
|
2134001f0f | ||
|
|
aa7ecab89c | ||
|
|
ce50defd4c | ||
|
|
3dc0fee9ba | ||
|
|
94ef1222d8 | ||
|
|
40f92a9da4 | ||
|
|
cb79ddc9a0 | ||
|
|
0a07af9fc7 | ||
|
|
1358cc1911 | ||
|
|
9654e2d4b4 | ||
|
|
c773c4e139 | ||
|
|
59451ae6c0 | ||
|
|
715cc89148 | ||
|
|
4a7a565ef3 | ||
|
|
c55f4a3783 | ||
|
|
89c63fc635 | ||
|
|
675205a5de | ||
|
|
3ae27c3c9e | ||
|
|
8aa92af787 | ||
|
|
46f139066c | ||
|
|
b4557a830a | ||
|
|
37d20db817 | ||
|
|
5db8af3015 | ||
|
|
16aff5292e | ||
|
|
4b07e6ffa4 | ||
|
|
d15ab7811c | ||
|
|
6e5c4b2316 | ||
|
|
4ad0370f60 | ||
|
|
b65bbad338 | ||
|
|
3616465288 | ||
|
|
c4ddb4980f | ||
|
|
948c8bd2d4 | ||
|
|
76d4673969 | ||
|
|
299dc971dd | ||
|
|
62f7d251ae | ||
|
|
e1f5aeaf51 | ||
|
|
fb4253bfb2 | ||
|
|
30984a7eed | ||
|
|
6bf63d8d35 | ||
|
|
ee1d841569 | ||
|
|
bf27d79c0d | ||
|
|
ad12689460 | ||
|
|
dfca90057b | ||
|
|
9291ec957f | ||
|
|
1f115108e6 | ||
|
|
9108a01f1d | ||
|
|
b07eb44e4e | ||
|
|
0d102fa42e | ||
|
|
1b853a92bb | ||
|
|
0dd2134fa8 | ||
|
|
9dbc6e1c2f | ||
|
|
517d951c67 | ||
|
|
8f3ef9954e | ||
|
|
0a32f4d20b | ||
|
|
544a21b80c | ||
|
|
291270beb5 | ||
|
|
af73c158f2 | ||
|
|
d387191f04 | ||
|
|
0e4924079a | ||
|
|
435528e7a0 | ||
|
|
e881da738c | ||
|
|
83f36eac7d | ||
|
|
748bcdbe11 | ||
|
|
e59f302e50 | ||
|
|
817b284a13 | ||
|
|
3dffab3aca | ||
|
|
0156bc785f | ||
|
|
32c3e79ece | ||
|
|
03d8c867cf | ||
|
|
3f1c7dc771 | ||
|
|
c691f1db9d | ||
|
|
d8b91b19e5 | ||
|
|
8216d763a6 | ||
|
|
131931c877 | ||
|
|
71f2d3d25d | ||
|
|
11e06742c2 | ||
|
|
eda24c6c3a | ||
|
|
c5a589f25b | ||
|
|
7a9bfd3ccb | ||
|
|
93dd5f44cb | ||
|
|
f14e8056ce | ||
|
|
1fd8bd11af | ||
|
|
dc5142224c | ||
|
|
662d64f8e0 | ||
|
|
731e425116 | ||
|
|
d586fa633b | ||
|
|
eda17b05f7 | ||
|
|
7202b1b19d | ||
|
|
d54f596884 | ||
|
|
424eae4cfb | ||
|
|
db57264e1f | ||
|
|
d9080fb256 | ||
|
|
c2c6b55515 | ||
|
|
b6f43e7144 | ||
|
|
ab44069b4b | ||
|
|
c690cf8df5 | ||
|
|
8403a62cdf | ||
|
|
f038ce79e9 | ||
|
|
821975f7bd | ||
|
|
c61ade4480 | ||
|
|
772ad744e0 | ||
|
|
c2f88659b5 | ||
|
|
b516dfa9b6 | ||
|
|
62062f5873 | ||
|
|
36c2c9800f | ||
|
|
0a98dad76d | ||
|
|
e5cb54d8d5 | ||
|
|
b1ac023250 | ||
|
|
98c638416d | ||
|
|
932463210f | ||
|
|
26a0534734 | ||
|
|
48a5b245df | ||
|
|
28b8f4a2e6 | ||
|
|
cd2decaedb | ||
|
|
bacff222e1 | ||
|
|
e0bee0e36b | ||
|
|
8027ff2a0e | ||
|
|
0800757e00 | ||
|
|
a9a9fb489e | ||
|
|
23e67efbbd | ||
|
|
ea50c50b47 | ||
|
|
8ff7a809b4 | ||
|
|
84ff909d06 | ||
|
|
15c9ab962a | ||
|
|
4bd249117a | ||
|
|
69303fea5f | ||
|
|
a13244eeaf | ||
|
|
32b30abf8f | ||
|
|
1a98fe8a63 | ||
|
|
f09cdabc0d | ||
|
|
977d4d8779 | ||
|
|
47b3a226af | ||
|
|
a932e62067 | ||
|
|
cba8fa9596 | ||
|
|
98f35925e5 | ||
|
|
3988e65c46 | ||
|
|
1557e9befc | ||
|
|
13505c52fc | ||
|
|
c3b6c26c1b | ||
|
|
5efd8589a7 | ||
|
|
55358e04c8 | ||
|
|
3e64d53637 | ||
|
|
4c54d7d07e | ||
|
|
929a52b3e0 | ||
|
|
fedadd3064 | ||
|
|
c3669a3104 | ||
|
|
4ca632d1e6 | ||
|
|
3dc55ecc72 | ||
|
|
6f89e7df29 | ||
|
|
5fe8b2974d | ||
|
|
14dd3e6265 | ||
|
|
77aca3e58f | ||
|
|
a89062967e | ||
|
|
34e4d846a6 | ||
|
|
c3a7c92677 | ||
|
|
a019c26daa | ||
|
|
18e3cfd272 | ||
|
|
9a0b25efcd | ||
|
|
b72a7ab50b | ||
|
|
2d9b57758b | ||
|
|
2ce5085cc8 | ||
|
|
ef651cc6bc | ||
|
|
961336e574 | ||
|
|
276e2880bd | ||
|
|
5a508351e4 | ||
|
|
99c94d9cbe | ||
|
|
5c0768fb0d | ||
|
|
21c9f463a2 | ||
|
|
7d1031cc71 | ||
|
|
b54499d254 | ||
|
|
295bf51f3f | ||
|
|
ea2ca7bfc3 | ||
|
|
26c91f4733 |
112
ChangeLog
112
ChangeLog
@@ -215,7 +215,7 @@
|
||||
* 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().
|
||||
* Basic client functionality verified: TCP socket(), bind(), connect(), recv(), send().
|
||||
|
||||
0.3.1 2007-11-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
@@ -223,10 +223,116 @@
|
||||
* Corrected a TCP problem where packets were dropped because there was no
|
||||
recv() in place but the packet was being ACKed. There are still TCP
|
||||
recv buffering issues, but this is part of a larger buffering issue.
|
||||
* Basic server functionality verified: listen(), accept()
|
||||
* Basic server functionality verified: TCP listen(), accept()
|
||||
* Fix DM90x0 driver problem that caused TX overruns
|
||||
* Add strncmp()
|
||||
* Added TCP/IP read-ahead buffer to minimize failed ACKs and packet loss.
|
||||
|
||||
0.3.2 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
0.3.2 2007-11-23 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Add strcat() and strncat()
|
||||
* Integrated uIP micro webserver
|
||||
* Corrected a serious bug in TCP queue management
|
||||
* Fix leak in socket close logic
|
||||
* Add TX notification to driver so that it can respond faster to
|
||||
the availability of TX data.
|
||||
* Moved urgent data info into device structure.
|
||||
* TCP and ICMP protocols can now be disabled.
|
||||
* Added UDP test in examples/udp
|
||||
* Verified/debugged UDP socket(), bind(), sendto() and recvfrom() logic
|
||||
using examples/udp
|
||||
* recvfrom() and accept() now correctly return the remote address.
|
||||
* Fixed computation error in ntohl().
|
||||
|
||||
0.3.3 2007-11-28 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Removed unused uIP files
|
||||
* sched/, mm/, and net/ subystem debug can not be selectively enabled/disabled
|
||||
* Correct socket close logic -- needs to disconnect TCP socket on close
|
||||
* uIP webserver now seems to be fully functional
|
||||
* fs/ and lib/ subystem debug can not be selectively enabled/disabled
|
||||
* Added vsnprintf
|
||||
* Integrated uIP telnetd
|
||||
* Add missing logic to readahead buffer logic
|
||||
* examples/nettest uses larger buffers
|
||||
* Improved ACK handling in send() to better hander deferred acknowledgements
|
||||
and polling intervals. Greatly improves send performance.
|
||||
|
||||
0.3.4 2007-12-10 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added and partially verified DHCP server logic (netutils/dhcpd)
|
||||
* Fix BROADCAST=y compilation problems
|
||||
* Fix UDP recvfrom timeout bug
|
||||
* Correct processing of input UDP broadcast packets.
|
||||
* Verfied basic DHCP client functionality (netutils/dhcpc)
|
||||
* Implemented send() timeout logic
|
||||
* Added and verifed a TELNETD front end to NSH (examples/nsh)
|
||||
* Add a skeleton Ethernet device driver (drivers/net/skeleton.c)
|
||||
* Added C5471 Ethernet device driver (arch/arm/src/c5471/c5471_ethernet.c)
|
||||
* Found and fixed several problems in uIP when compiled for ARM with optimization.
|
||||
|
||||
0.3.5 2007-12-18 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added inet_ntoa() and ether_ntoa()
|
||||
* Added netdev_foreach() to support traversal of registered network devices
|
||||
* Added support for 'ifconfig' command to NSH (examples/nsh)
|
||||
* Moved MAC and ethernet definitions to net/ethernet.h
|
||||
* Fix sim and DM90x0 compilation errors introduced in 0.3.4
|
||||
* Fixed errors in C5471 configuration files for examples/uip
|
||||
* Modified DHCPC (netutils/dhcpc) so that it should work in environments where
|
||||
there are more than one DHCPD server.
|
||||
* NSH ifconfig command now shows uIP status was well (examples/nsh)
|
||||
|
||||
0.3.6 2008-01-06 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Changes for use with SDCC compiler
|
||||
* Added a simulated z80 target
|
||||
* Fix deadlock errors when using stdio but with no buffering
|
||||
* Add support for Pascal P-Code interpreter
|
||||
|
||||
0.3.6.1 2008-01-07 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* The initial 0.3.6 release including an error that prevented
|
||||
building successfully if the Pascal add-on was
|
||||
was not present.
|
||||
|
||||
0.3.7 2008-01-31 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added support for the Zilog Z16F using the Zilog Z16F2800100ZCOG
|
||||
Development Kit.
|
||||
* Add support toolchains that do not support making of dependencies
|
||||
* Fix Cygwin build with spaces in directory names
|
||||
* Name make system changes to deal with non-GNU toolchains (i.e., Zilog)
|
||||
* Add support for Windows native toolchains that cannot follow Cygwin soft links
|
||||
* Modified serial driver interface to handle hardware with non-16550A-like
|
||||
interrupt architecture (like the Z16F)
|
||||
* Added a "dumb" serial console driver to simplify OS bringup
|
||||
* Corrected a bug that caused the errno value of one task to be clobbered
|
||||
when a different task exits. Effects all architectures.
|
||||
|
||||
0.3.8 2008-02-10 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added a test case to verify the Pascal P-Code interpreter
|
||||
* Added /dev/zero
|
||||
* 'errno' is now defined to be *get_errno_ptr() with no name conflicts
|
||||
* Added lseek() and fseek()
|
||||
* Integrated Pascal interpreter test case on the simulation platform. Needs
|
||||
pascal-0.1.1.
|
||||
* Add Pascal test case on the z16f platform. Needs pascal-0.1.2 (does not
|
||||
yet work due to some tool issues).
|
||||
* C buffered I/O fixes:
|
||||
- Fix fflush() return value,
|
||||
- Add correct fflush behavior when the FILE argument is null.
|
||||
- Add logic to a correctly handle read/write access on the same FILE
|
||||
- fseek() flushes read/write data when before moving the file pointer
|
||||
- When read data is flushed, reposition the file pointer to account for
|
||||
buffered, but unreand data
|
||||
* Pascal P-Code files are now standardized to big-endian for portability
|
||||
* Fix a build problem with z80 and SDCC 2.7.0 (format of a map file changed)
|
||||
(see bug 1887170)
|
||||
* Pascal P-Code runtime now compiles with the SDCC toolchain.
|
||||
* Added a generic CAN driver. This driver is untested as of this writing.
|
||||
* Corrected DM320 UART configuration problem
|
||||
|
||||
0.3.9 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,11 @@
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="210">
|
||||
<a href="freeports.html" target="_blank">
|
||||
<img src="freeports.gif" width="210" height="62" border="0"/>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</b></big>
|
||||
<p><small>by</small></p>
|
||||
<p>Gregory Nutt</p>
|
||||
<p><small>Last Update: September 8, 2007</small></p>
|
||||
<p><small>Last Update: February 7, 2008</small></p>
|
||||
</center>
|
||||
|
||||
<center><h1>Table of Contents</h1></center>
|
||||
@@ -36,7 +36,7 @@
|
||||
<li><a href="#summaryofconfigfiles">2.3.2 Summary of Files</a></li>
|
||||
<ul>
|
||||
<li><a href="#boardlogic">2.3.2.1 Board Specific Logic</a></li>
|
||||
<li><a href="#boardconfigfiles">2.3.2.2 Board Specific Configuration Files</a></li>
|
||||
<li><a href="#boardconfigsubdirs">2.3.2.2 Board Specific Configuration Sub-Directories</a></li>
|
||||
</ul>
|
||||
<li><a href="#supportedboards">2.3.3 Supported Boards</a></li>
|
||||
</ul>
|
||||
@@ -88,14 +88,15 @@
|
||||
<li><a href="#irqdispatch">4.2.4 <code>irq_dispatch()</code></a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
<li><a href="#NxFileSystem">5.0 NuttX File System</a></li>
|
||||
<li><a href="#apndxconfigs">Appendix A: NuttX Configuration Settings</a></li>
|
||||
|
||||
<li><a href="#apndxtrademarks">Appendix B: Trademarks</a></li>
|
||||
<hr>
|
||||
<h1>1.0 <a name="Introduction">Introduction</a></h1>
|
||||
|
||||
<p><b>Overview</b>
|
||||
This document provides and overview of the NuttX build and configuration
|
||||
logic and provides hints for the incorporation of new processor/board archectures
|
||||
logic and provides hints for the incorporation of new processor/board architectures
|
||||
into the build.
|
||||
</p>
|
||||
<p>
|
||||
@@ -131,7 +132,7 @@
|
||||
| | | `-- <i>(chip-specific source files)</i>
|
||||
| | |--<i><other-chips></i>/
|
||||
| | `-- <i>(architecture-specific source files)</i>
|
||||
| `-- <i><other-architectures></i>/
|
||||
| `-- <i><other-architecture directories></i>/
|
||||
|-- <a href="#DirStructConfigs">configs</a>/
|
||||
| |-- <i><board-name></i>/
|
||||
| | |-- include/
|
||||
@@ -139,8 +140,10 @@
|
||||
| | |-- src/
|
||||
| | | |-- Makefile
|
||||
| | | `-- <i>(board-specific source files)</i>
|
||||
| | `-- <i>(board-specific configuration files)</i>
|
||||
| `-- <i><other-boards></i>/
|
||||
| | |---<i><config1-dir></i>/
|
||||
| | | `-- <i>(board-specific/configuration-specific files)</i>
|
||||
| | `---<i>(other board-specific configuration sub-directories)</i>/
|
||||
| `-- <i><(other board directories)></i>/
|
||||
|-- <a href="#DirStructDrivers">drivers</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(common driver source files)</i>
|
||||
@@ -225,14 +228,14 @@
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<i>Board specific files</i>.
|
||||
<i>Board specific configurations</i>.
|
||||
In order to be usable, the chip must be contained in a board environment.
|
||||
The board configuration defines additional properties of the board including such things as
|
||||
peripheral LEDs, external peripherals (such as network, USB, etc.).
|
||||
<p>
|
||||
These board-specific configuration files can be found in the
|
||||
<code>configs/</code><i><board-name></i><code>/</code> sub-directories and are discussed
|
||||
in a a paragraph <a href="#configsdirectorystructure">below</a>.
|
||||
in a paragraph <a href="#configsdirectorystructure">below</a>.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -250,8 +253,8 @@
|
||||
This directory contains several sub-directories, each containing
|
||||
architecture-specific logic.
|
||||
The task of porting NuttX to a new processor consists of
|
||||
add a new sudirectory under <code>arch/</code> containing logic specific
|
||||
to the new architecuture.
|
||||
add a new subdirectory under <code>arch/</code> containing logic specific
|
||||
to the new architecture.
|
||||
The complete board port in is defined by the architecture-specific code in this
|
||||
directory (plus the board-specific configurations in the <code>config/</code>
|
||||
subdirectory).
|
||||
@@ -413,11 +416,22 @@
|
||||
</li>
|
||||
|
||||
<li><code>arch/m68322</code>
|
||||
A work in progress.</li>
|
||||
A work in progress.
|
||||
</li>
|
||||
|
||||
<li><code>arch/pjrc-8051</code>:
|
||||
8051 Microcontroller. This port is not quite ready for prime time.</li>
|
||||
8051 Microcontroller. This port is not quite ready for prime time.
|
||||
</li>
|
||||
|
||||
<li><code>arch/z16f</code>:
|
||||
Zilog z16f Microcontroller.
|
||||
This port uses the Zilog z16f2800100zcog Development Kit.
|
||||
This is a work in progress.
|
||||
</li>
|
||||
|
||||
<li><code>arch/z80</code>:
|
||||
Zilog z80 Microcontroller.
|
||||
This port has been verified using only a z80 instruction simulator.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -456,15 +470,24 @@
|
||||
provide a subdirectory <board-name> under <code>configs/</code> with the following characteristics:
|
||||
</p>
|
||||
<ul><pre>
|
||||
|-- Make.defs
|
||||
|-- defconfig
|
||||
`-- setenv.sh
|
||||
<i><board-name></i>
|
||||
|-- include/
|
||||
| `-- <i>(board-specific header files)</i>
|
||||
|-- src/
|
||||
| |-- Makefile
|
||||
| `-- <i>(board-specific source files)</i>
|
||||
|-- Make.defs
|
||||
|-- defconfig
|
||||
`-- setenv.sh
|
||||
|-- <i><config1-dir></i>
|
||||
| |-- Make.defs
|
||||
| |-- defconfig
|
||||
| `-- setenv.sh
|
||||
|-- <i><config2-dir></i>
|
||||
| |-- Make.defs
|
||||
| |-- defconfig
|
||||
| `-- setenv.sh
|
||||
`-- <i>(other board-specific configuration sub-directories)</i>/
|
||||
</pre></ul>
|
||||
|
||||
<h3><a name="summaryofconfigfiles">2.3.2 Summary of Files</a></h3>
|
||||
@@ -490,10 +513,15 @@
|
||||
It must support the following targets: <code>libext$(LIBEXT)</code>, <code>clean</code>, and <code>distclean</code>.
|
||||
</li>
|
||||
</ul>
|
||||
<h4><a name="boardconfigfiles">2.3.2.2 Board Specific Configuration Files</a></h4>
|
||||
<h4><a name="boardconfigsubdirs">2.3.2.2 Board Specific Configuration Sub-Directories</a></h4>
|
||||
<p>
|
||||
The <code>configs/</code><i><board-name></i><code>/</code> sub-directory holds all of the
|
||||
files that are necessary to configure Nuttx for the particular board.
|
||||
A board may have various different configurations using the common source files.
|
||||
Each board configuration is described by three files: <code>Make.defs</code>, <code>defconfig</code>, and <code>setenv.sh</code>.
|
||||
Typically, each set of configuration files is retained in a separate configuration sub-directory
|
||||
(<i><config1-dir></i>, <i><config2-dir></i>, .. in the above diagram).
|
||||
|
||||
The procedure for configuring NuttX is described <a href="#configuringnuttx">below</a>,
|
||||
This paragraph will describe the contents of these configuration files.
|
||||
</p>
|
||||
@@ -506,6 +534,7 @@
|
||||
<ul>
|
||||
<li>Tools: CC, LD, AR, NM, OBJCOPY, OBJDUMP</li>
|
||||
<li>Tool options: CFLAGS, LDFLAGS</li>
|
||||
<li>COMPILE, ASSEMBLE, ARCHIVE, CLEAN, and MKDEP macros</li>
|
||||
</ul>
|
||||
<p>
|
||||
When this makefile fragment runs, it will be passed TOPDIR which
|
||||
@@ -517,7 +546,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<code>defconfig</code>: This is a configuration file similar to the Linux
|
||||
configuration file. In contains varialble/value pairs like:
|
||||
configuration file. In contains variable/value pairs like:
|
||||
<ul>
|
||||
<li><code>CONFIG_VARIABLE</code>=value</li>
|
||||
</ul>
|
||||
@@ -555,20 +584,20 @@
|
||||
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
|
||||
processor and a c54 SDP. NuttX runs on the ARM core and is built with
|
||||
with a GNU arm-elf toolchain*. This port is complete, verified, and
|
||||
included in the NuttX release.
|
||||
with a GNU arm-elf toolchain* under Linux or Cygwin.
|
||||
This port is complete, verified, and included in the NuttX release.
|
||||
</li>
|
||||
|
||||
<li><code>configs/mcu123-lpc214x</code>:
|
||||
This port is for the NXP LPC2148 as provided on the mcu123.com
|
||||
lpc214x development board.
|
||||
This OS is also built with the arm-elf toolchain*.
|
||||
This OS is also built with the arm-elf toolchain* under Linux or Cygwin.
|
||||
STATUS: This port is in progress and should be available in the
|
||||
nuttx-0.2.5 release.
|
||||
</li>
|
||||
|
||||
<li><code>configs/ntosd-dm320</code>:
|
||||
This port uses the Neuros OSD with a GNU arm-elf toolchain*.
|
||||
This port uses the Neuros OSD with a GNU arm-elf toolchain* under Linux or Cygwin.
|
||||
See <a href="http://wiki.neurostechnology.com/index.php/Developer_Welcome">Neuros Wiki</a>
|
||||
for futher information.
|
||||
NuttX operates on the ARM9EJS of this dual core processor.
|
||||
@@ -583,13 +612,28 @@
|
||||
|
||||
<li><code>configs/pjrc-8051</code>:
|
||||
8051 Microcontroller. This port uses the PJRC 87C52 development system
|
||||
and the SDCC toolchain. This port is not quite ready for prime time.
|
||||
and the <a href="http://sdcc.sourceforge.net/">SDCC</a> toolchain under Linux or Cygwin.
|
||||
This port is not quite ready for prime time.
|
||||
</li>
|
||||
|
||||
<li><code>configs/z16f2800100zcog</code>
|
||||
z16f Microncontroller.
|
||||
This port use the Zilog z16f2800100zcog development kit and the
|
||||
Zilog ZDS-II Windows command line tools.
|
||||
The development environment is Cygwin under WinXP.
|
||||
|
||||
<li><code>configs/z80sim</code>:
|
||||
z80 Microcontroller. This port uses a Z80 instruction set simulator.
|
||||
That simulator can be found in the NuttX CVS
|
||||
<a href="http://nuttx.cvs.sourceforge.net/nuttx/misc/sims/z80sim/">here</a>.
|
||||
This port also the <a href="http://sdcc.sourceforge.net/">SDCC</a> toolchain
|
||||
under Linux or Cygwin(verfied with version 2.6.0).
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p><small><blockquote>
|
||||
* A customized version of the <a href="http://www.buildroot.org">buildroot</a>
|
||||
is available to build these toolchains.
|
||||
is available to build these toolchains under Linux or Cygwin.
|
||||
</blockquote></small></p>
|
||||
|
||||
<h2>2.4 <a name="DirStructDrivers">drivers</a></h2>
|
||||
@@ -607,13 +651,8 @@
|
||||
<h2>2.6 <a name="DirStructFs">fs</a></h2>
|
||||
|
||||
<p>
|
||||
This directory contains the NuttX filesystem.
|
||||
The NuttX filesystem is very simple; it does not involve any block drivers or
|
||||
particular filesystem (like FAT or EXT2 etc.).
|
||||
The NuttX filesystem simply supports a set a filesystem APIs
|
||||
(<code>open()</code>, <code>close()</code>, <code>read()</code>, <code>write</code>, etc.)
|
||||
and a registration mechanism that allows devices drivers to a associated with <i>nodes</i>
|
||||
in a file-system-like name space.
|
||||
This directory contains the NuttX file system.
|
||||
This file system is described <a href="#NxFileSystem">below</a>.
|
||||
</p>
|
||||
|
||||
<h2>2.7 <a name="DirStructInclude">include</a></h2>
|
||||
@@ -674,19 +713,20 @@
|
||||
<p>
|
||||
<b>Manual Configuration</b>.
|
||||
Configuring NuttX requires only copying the
|
||||
<a href="#boardconfigfiles">board-specific configuration files</a> into the top level directory which appears in the make files as the make variable, <code>${TOPDIR}</code>.
|
||||
<a href="#boardconfigsubdirs">board-specific configuration files</a> into the top level directory which appears in the make files as the make variable, <code>${TOPDIR}</code>.
|
||||
This could be done manually as follows:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Copy <code>configs/</code><i><board-name></i></code>/Make.def</code> to <code>${TOPDIR}/Make.defs</code>,<li>
|
||||
<li>Copy <code>configs/</code><i><board-name></i></code>/setenv.sh</code> to <code>${TOPDIR}/setenv.sh</code>, and</li>
|
||||
<li>Copy <code>configs/</code><i><board-name></i></code>/defconfig</code> to <code>${TOPDIR}/.config</code></li>
|
||||
<li>Copy <code>configs/</code><i><board-name></i><code>/[</code><i><config-dir></i><code>/]Make.def</code> to <code>${TOPDIR}/Make.defs</code>,<li>
|
||||
<li>Copy <code>configs/</code><i><board-name></i><code>/[</code><i><config-dir></i><code>/]setenv.sh</code> to <code>${TOPDIR}/setenv.sh</code>, and</li>
|
||||
<li>Copy <code>configs/</code><i><board-name></i><code>/[</code><i><config-dir></i><code>/]defconfig</code> to <code>${TOPDIR}/.config</code></li>
|
||||
</ul>
|
||||
<p>
|
||||
Where <i><board-name></i> is the name of one of the sub-directories of the
|
||||
NuttX <a href="#DirStructConfigs"><code>configs/</code></a> directory.
|
||||
This sub-directory name corresponds to one of the supported boards
|
||||
identified <a href="#supportedboards">above</a>.
|
||||
And <config-dir> is the optional, specific configuration directory for the board.
|
||||
</p>
|
||||
<p>
|
||||
<b>Automated Configuration</b>.
|
||||
@@ -695,7 +735,7 @@
|
||||
</p>
|
||||
<ul><pre>
|
||||
cd tools
|
||||
./configure.sh <i><board-name></i>
|
||||
./configure.sh <i><board-name></i></i><code>[/</code><i><config-dir></i><code>]</code>
|
||||
</pre></ul>
|
||||
|
||||
<p>
|
||||
@@ -724,14 +764,14 @@ make
|
||||
That directory also holds:
|
||||
</p>
|
||||
<ul>
|
||||
<li>The makefile fragment <a href="#boardconfigfiles"><code>.config</code></a> that describes the current configuration.</li>
|
||||
<li>The makefile fragment <a href="#boardconfigfiles"><code>Make.defs</code></a> that provides customized build targers, and</li>
|
||||
<li>The shell script <a href="#boardconfigfiles"><code>setenv.sh</code></a> that sets up the configuration environment for the build.</li>
|
||||
<li>The makefile fragment <a href="#boardconfigsubdirs"><code>.config</code></a> that describes the current configuration.</li>
|
||||
<li>The makefile fragment <a href="#boardconfigsubdirs"><code>Make.defs</code></a> that provides customized build targers, and</li>
|
||||
<li>The shell script <a href="#boardconfigsubdirs"><code>setenv.sh</code></a> that sets up the configuration environment for the build.</li>
|
||||
</ul>
|
||||
<p>
|
||||
The <a href="#boardconfigfiles"><code>setenv.sh</code></a> contains Linux environmental settings that are needed for the build.
|
||||
The specific environmental definitions are unique for each board but should include, as a minimum, updates to the <code>PATH</code> variable to include the full path to the architecture-specific toolchain identified in <a href="#boardconfigfiles"><code>Make.defs</code></a>.
|
||||
The <a href="#boardconfigfiles"><code>setenv.sh</code></a> only needs to be source'ed at the beginning of a session.
|
||||
The <a href="#boardconfigsubdirs"><code>setenv.sh</code></a> contains Linux/Cygwin environmental settings that are needed for the build.
|
||||
The specific environmental definitions are unique for each board but should include, as a minimum, updates to the <code>PATH</code> variable to include the full path to the architecture-specific toolchain identified in <a href="#boardconfigsubdirs"><code>Make.defs</code></a>.
|
||||
The <a href="#boardconfigsubdirs"><code>setenv.sh</code></a> only needs to be source'ed at the beginning of a session.
|
||||
The system can be re-made subsequently by just typing <code>make</code>.
|
||||
</p>
|
||||
<p>
|
||||
@@ -1144,6 +1184,56 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
the appropriate, registered handling logic.
|
||||
</p>
|
||||
|
||||
<h1><a name="NxFileSystem">5.0 NuttX File System</a></h1>
|
||||
|
||||
<p><b>Overview</b>.
|
||||
NuttX includes an optional, scalable file system.
|
||||
This file-system may be omitted altogther; NuttX does not depend on the presence
|
||||
of any file system.
|
||||
</p>
|
||||
|
||||
<p><b>Pseudo Root File System</b>.
|
||||
Or, a simple <i>in-memory</i>, <i>psuedo</i> file system can be enabled.
|
||||
This simple file system can be enabled setting the CONFIG_NFILE_DESCRIPTORS
|
||||
option to a non-zero value (see <a href="#apndxconfigs">Appendix A</a>).
|
||||
This is an <i>in-memory</i> file system because it does not require any
|
||||
storage medium or block driver support.
|
||||
Rather, file system contents are generated on-the-fly as referenced via
|
||||
standard file system operations (open, close, read, write, etc.).
|
||||
In this sense, the file system is <i>psuedo</i> file system (in the
|
||||
same sense that the Linux <code>/proc</code> file system is also
|
||||
referred to as a psuedo file system).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Any user supplied data or logic can be accessed via the psuedo-file system.
|
||||
Built in support is provided for character and block drivers in the
|
||||
<code>/dev</code> psuedo file system directory.
|
||||
</p>
|
||||
|
||||
<p><b>Mounted File Systems</b>
|
||||
The simple in-memory file system can be extended my mounting block
|
||||
devices that provide access to true file systems backed up via some
|
||||
mass storage device.
|
||||
NuttX supports the standard <code>mount()</code> command that allows
|
||||
a block driver to be bound to a mountpoint within the psuedo file system
|
||||
and to a a file system.
|
||||
At present, NuttX supports only the VFAT file system.
|
||||
</p>
|
||||
|
||||
<p><b>Comparison to Linux</b>
|
||||
From a programming perspective, the NuttX file system appears very similar
|
||||
to a Linux file system.
|
||||
However, there is a fundamental difference:
|
||||
The NuttX root file system is a psuedo file system and true file systems may be
|
||||
mounted in the psuedo file system.
|
||||
In the typical Linux installation by comparison, the Linux root file system
|
||||
is a true file system and psuedo file systems may be mounted in the true,
|
||||
root file system.
|
||||
The approach selected by NuttX is intended to support greater scalability
|
||||
from the very tiny platform to the moderate platform.
|
||||
</p>
|
||||
|
||||
<h1><a name="apndxconfigs">Appendix A: NuttX Configuration Settings</a></h1>
|
||||
|
||||
<p>
|
||||
@@ -1186,6 +1276,16 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
The startaddress of DRAM (virtual)</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
General build options:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_RRLOAD_BINARY</code>:
|
||||
Make the rrload binary format used with BSPs from <a href="www.ridgerun.com">ridgerun.com</a>.</li>
|
||||
<li><code>CONFIG_HAVE_LIBM</code>:
|
||||
Toolchain supports libm.a</li>
|
||||
</ul>
|
||||
|
||||
<h2>General OS setup</h2>
|
||||
|
||||
<ul>
|
||||
@@ -1199,6 +1299,21 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
<li>
|
||||
<code>CONFIG_DEBUG_VERBOSE</code>: enables verbose debug output
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_DEBUG_SCHED</code>: enable OS debug output (disabled by default)
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_DEBUG_MM</code>: enable memory management debug output (disabld by default)
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_DEBUG_NET</code>: enable network debug output (disabled by default)
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_DEBUG_FS</code>: enable file system debug output (disabled by default)
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_DEBUG_LIB</code>: enable C library debug output (disabled by default)
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_HAVE_LOWPUTC</code>: architecture supports low-level, boot
|
||||
time console output
|
||||
@@ -1352,24 +1467,32 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
<li>
|
||||
<code>CONFIG_NSOCKET_DESCRIPTORS</code>: Maximum number of socket descriptors per task/thread.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_TCP_CONNS</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_BUFSIZE</code>: uIP buffer size
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_TCP</code>: TCP support on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_TCP_CONNS</code>: Maximum number of TCP connections (all tasks).
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_TCP_READAHEAD_BUFSIZE</code>: Size of TCP read-ahead buffers
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_NTCP_READAHEAD_BUFFERS</code>: Number of TCP read-ahead buffers (may be zero)
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_MAX_LISTENPORTS</code>: Maximum number of listening TCP ports (all tasks).
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_TCPURGDATA</code>: Determines if support for TCP urgent data
|
||||
notification should be compiled in. Urgent data (out-of-band data)
|
||||
is a rarely used TCP feature that is very seldom would be required.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP</code>: UDP support on or off
|
||||
</li>
|
||||
@@ -1380,11 +1503,14 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
<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
|
||||
<code>CONFIG_NET_ICMP</code>: ICMP ping support on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_PINGADDRCONF</code>: Use "ping" packet for setting IP address
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_STATISTICS</code>: uIP statistics on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_RECEIVE_WINDOW</code>: The size of the advertised receiver's window
|
||||
</li>
|
||||
@@ -1439,6 +1565,22 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h1><a name="apndxtrademarks">Appendix B: Trademarks</a></h1>
|
||||
|
||||
<li>ARM, ARM7 ARM7TDMI, ARM9, ARM926EJS are trademarks of Advanced RISC Machines, Limited.</li>
|
||||
<li>Cygwin is a trademark of Red Hat, Incorporated.</li>
|
||||
<li>Linux is a registered trademark of Linus Torvalds.</li>
|
||||
<li>LPC2148 is a trademark of NXP Semiconductors.</li>
|
||||
<li>TI is a tradename of Texas Instruments Incorporated.</li>
|
||||
<li>UNIX is a registered trademark of The Open Group.</li>
|
||||
<li>VxWorks is a registered trademark of Wind River Systems, Incorporated.</li>
|
||||
<li>ZDS, ZNEO, Z16F, Z80, and Zilog are a registered trademark of Zilog, Inc.</li>
|
||||
|
||||
<p>
|
||||
NOTE: NuttX is <i>not</i> licensed to use the POSIX trademark. NuttX uses the POSIX
|
||||
standard as a development guideline only.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ User's Manual
|
||||
<p>
|
||||
Gregory Nutt
|
||||
<p>
|
||||
<small>Last Update: September 23, 2007</small>
|
||||
<small>Last Update: Februrary 2, 2008</small>
|
||||
</center>
|
||||
|
||||
<h1>1.0 <A NAME="Introduction">Introduction</a></h1>
|
||||
@@ -54,7 +54,7 @@ Gregory Nutt
|
||||
<li>Paragraph 2.8 <a href="#Signals">Signal Interfaces</a></li>
|
||||
<li>Paragraph 2.9 <a href="#Pthread">Pthread Interfaces</a></li>
|
||||
<li>Paragraph 2.10 <a href="#Environ">Environment Variables</a></li>
|
||||
<li>Paragraph 2.11 <a href="#FileSystem">Filesystem Interfaces</a></li>
|
||||
<li>Paragraph 2.11 <a href="#FileSystem">File System Interfaces</a></li>
|
||||
<li>Paragraph 2.12 <a href="#Network">Network Interfaces</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -62,9 +62,15 @@ Gregory Nutt
|
||||
<b>Section 3.0, <a href="#Data_Structures">OS Data Structures</a></b>:
|
||||
This section documents the data structures that are used at the NuttX
|
||||
interface.
|
||||
<ul>
|
||||
<li>Paragraph 3.1 <a href="#ScalarType">Scalar Types</a></li>
|
||||
<li>Paragraph 3.2 <a href="#HiddenStructures">Hidden Interface Structures</a></li>
|
||||
<li>Paragraph 3.3 <a href="#ErrnoAccess">Access to the <code>errno</code> Variable</a></li>
|
||||
<li>Paragraph 3.4 <a href="#UserStructures">User Interface Structures</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#index">Index</a>
|
||||
<a href="#index"><b>Index</b></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -227,7 +233,7 @@ paragraphs.
|
||||
<li>
|
||||
Returns the non-zero task ID of the new task or
|
||||
ERROR if memory is insufficient or the task cannot be
|
||||
created (errno is not set).
|
||||
created (<a href="#ErrnoAccess"><code>errno</code></a> is not set).
|
||||
</LI>
|
||||
</ul>
|
||||
|
||||
@@ -296,7 +302,7 @@ VxWorks provides the following similar interface:
|
||||
<ul>
|
||||
<li><p>OK, or ERROR if the task cannot be initialized.</P>
|
||||
<p>This function can only failure is it is unable to assign
|
||||
a new, unique task ID to the TCB (errno is not set).</P>
|
||||
a new, unique task ID to the TCB (<a href="#ErrnoAccess"><code>errno</code></a> is not set).</P>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Assumptions/Limitations:</b>
|
||||
@@ -348,7 +354,7 @@ task_init argument).
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
<ul>
|
||||
<li>OK, or ERROR if the task cannot be activated (errno is not set).
|
||||
<li>OK, or ERROR if the task cannot be activated (<a href="#ErrnoAccess"><code>errno</code></a> is not set).
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -399,7 +405,7 @@ zero signifies the calling task.
|
||||
<b>Returned Values:</b>
|
||||
<ul>
|
||||
<li>OK, or ERROR if the task cannot be deleted.
|
||||
This function can fail if the provided pid does not correspond to a task (errno is not set)
|
||||
This function can fail if the provided pid does not correspond to a task (<a href="#ErrnoAccess"><code>errno</code></a> is not set)
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -613,7 +619,7 @@ Compatible with the POSIX interface of the same name.
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, sched_setparam() returns 0 (OK).
|
||||
On error, -1 (ERROR) is returned, and<code>errno</code>is set appropriately.
|
||||
On error, -1 (ERROR) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately.
|
||||
</p>
|
||||
<ul>
|
||||
|
||||
@@ -714,7 +720,7 @@ interface of the same name.
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, <i>sched_setscheduler()</i> returns OK (zero). On
|
||||
error, ERROR (-1) is returned, and<code>errno</code>is set appropriately:
|
||||
error, ERROR (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li>EINVAL The scheduling policy is not one of the
|
||||
@@ -762,7 +768,7 @@ policy.
|
||||
<li>
|
||||
On success, <i>sched_getscheduler()</i> returns the policy for
|
||||
the task (either SCHED_FIFO or SCHED_RR).
|
||||
On error, ERROR (-1) is returned, and<code>errno</code>is set appropriately:
|
||||
On error, ERROR (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
<ul>
|
||||
<li>ESRCH The task whose ID is pid could not be found.</li>
|
||||
</ul>
|
||||
@@ -775,7 +781,7 @@ policy.
|
||||
interface of the same name.
|
||||
Differences from the full POSIX implementation include:
|
||||
<ul>
|
||||
<li>Does not report errors via <I>errno</I>.
|
||||
<li>Does not report errors via <a href="#ErrnoAccess"><code>errno</code></a>.
|
||||
</ul>
|
||||
|
||||
<H3><a name="sched_yield">2.2.5 sched_yield</a></H3>
|
||||
@@ -894,7 +900,7 @@ priority of the calling task is returned.
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, sched_rr_get_interval() returns OK (0). On
|
||||
error, ERROR (-1) is returned, and<code>errno</code>is set to:
|
||||
error, ERROR (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set to:
|
||||
</p>
|
||||
<ul>
|
||||
<li>EFAULT Cannot copy to interval</LI>
|
||||
@@ -1216,7 +1222,7 @@ interface of the same name.
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, <code>mq_send()</code> returns 0 (<code>OK</code>);
|
||||
on error, -1 (<code>ERROR</code>) is returned, with <code>errno</code> set
|
||||
on error, -1 (<code>ERROR</code>) is returned, with <a href="#ErrnoAccess"><code>errno</code></a> set
|
||||
to indicate the error:
|
||||
</p>
|
||||
<ul>
|
||||
@@ -1299,7 +1305,7 @@ interface of the same name.
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, <code>mq_send()</code> returns 0 (<code>OK</code>);
|
||||
on error, -1 (<code>ERROR</code>) is returned, with <code>errno</code> set
|
||||
on error, -1 (<code>ERROR</code>) is returned, with <a href="#ErrnoAccess"><code>errno</code></a> set
|
||||
to indicate the error:
|
||||
</p>
|
||||
<ul>
|
||||
@@ -1370,7 +1376,7 @@ interface of the same name.
|
||||
<p>
|
||||
<b>Returned Values:</b>.
|
||||
One success, the length of the selected message in bytes is returned.
|
||||
On failure, -1 (<code>ERROR</code>) is returned and the <code>errno</code> is set appropriately:
|
||||
On failure, -1 (<code>ERROR</code>) is returned and the <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
@@ -1451,7 +1457,7 @@ interface of the same name.
|
||||
<p>
|
||||
<b>Returned Values:</b>.
|
||||
One success, the length of the selected message in bytes is returned.
|
||||
On failure, -1 (<code>ERROR</code>) is returned and the <code>errno</code> is set appropriately:
|
||||
On failure, -1 (<code>ERROR</code>) is returned and the <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
@@ -1516,7 +1522,7 @@ registration.
|
||||
<li><I>mqdes</I>. Message queue descriptor
|
||||
<li><I>notification</I>. Real-time signal structure containing:
|
||||
<ul>
|
||||
<li><I>sigev_notify</I>. Should be osSIGEV_SIGNAL (but actually
|
||||
<li><I>sigev_notify</I>. Should be SIGEV_SIGNAL (but actually
|
||||
ignored)
|
||||
<li><I>sigev_signo</I>. The signo to use for the notification
|
||||
<li><I>sigev_value</I>. Value associated with the signal
|
||||
@@ -1951,9 +1957,8 @@ the lock or the call is interrupted by a signal.
|
||||
</ul>
|
||||
<p>
|
||||
If <I>sem_wait</I> returns -1 (ERROR) then the cause of the failure
|
||||
will be indicated by the thread-specific <I>errno</I> value (a pointer
|
||||
to this value can be obtained using <I>get_errno_ptr()</I>). The following
|
||||
lists the possible values for <I>errno</I>:
|
||||
will be indicated by the thread-specific <a href="#ErrnoAccess"><code>errno</code></a>.
|
||||
The following lists the possible values for <a href="#ErrnoAccess"><code>errno</code></a>:
|
||||
<p>
|
||||
<ul>
|
||||
<li><I>EINVAL</I>: Indicates that the <I>sem</I> input parameter is
|
||||
@@ -1992,9 +1997,8 @@ returns without blocking.
|
||||
<li>0 (OK) or -1 (ERROR) if unsuccessful
|
||||
</ul>
|
||||
If <I>sem_wait</I> returns -1 (ERROR) then the cause of the failure
|
||||
will be indicated by the thread-specific <I>errno</I> value (a pointer
|
||||
to this value can be obtained using <I>get_errno_ptr()</I>). The following
|
||||
lists the possible values for <I>errno</I>:
|
||||
will be indicated by the thread-specific <a href="#ErrnoAccess"><code>errno</code></a>.
|
||||
The following lists the possible values for <a href="#ErrnoAccess"><code>errno</code></a>:
|
||||
<p>
|
||||
<ul>
|
||||
<li><I>EINVAL</I>: Indicates that the <I>sem</I> input parameter is
|
||||
@@ -2522,7 +2526,7 @@ VxWorks provides the following comparable interface:
|
||||
If the call succeeds, <code>timer_create()</code> will return 0 (<code>OK</code>) and update the
|
||||
location referenced by <code>timerid</code> to a <code>timer_t</code>, which can be passed to the
|
||||
other per-thread timer calls. If an error occurs, the function will return
|
||||
a value of -1 (<code>ERROR</code>) and set<code>errno</code>to indicate the error.
|
||||
a value of -1 (<code>ERROR</code>) and set <a href="#ErrnoAccess"><code>errno</code></a> to indicate the error.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EAGAIN</code>. The system lacks sufficient signal queuing resources to honor the
|
||||
@@ -2570,7 +2574,8 @@ VxWorks provides the following comparable interface:
|
||||
</p>
|
||||
<p>
|
||||
If successful, the <I>timer_delete()</I> function will return zero (<I>OK</I>).
|
||||
Otherwise, the function will return a value of -1 (ERROR) and set<code>errno</code>to indicate the error:
|
||||
Otherwise, the function will return a value of -1 (ERROR) and set
|
||||
<a href="#ErrnoAccess"><code>errno</code></a> to indicate the error:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EINVAL</code>. The timer specified timerid is not valid.</li>
|
||||
@@ -2647,7 +2652,8 @@ VxWorks provides the following comparable interface:
|
||||
</p>
|
||||
<p>
|
||||
If the timer_gettime() succeeds, a value of 0 (OK) will be returned.
|
||||
If an error occurs, the value -1 (ERROR) will be returned, and<code>errno</code>set to indicate the error.
|
||||
If an error occurs, the value -1 (ERROR) will be returned, and
|
||||
<a href="#ErrnoAccess"><code>errno</code></a> set to indicate the error.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EINVAL</code>. The timerid argument does not correspond to an ID returned by timer_create() but not yet deleted by timer_delete().</li>
|
||||
@@ -3065,12 +3071,12 @@ If sigprocmask() fails, the signal mask of the task is not changed.
|
||||
<ul>
|
||||
<li><I>how</I>. How the signal mast will be changed:
|
||||
<ul>
|
||||
<li><I>osSIG_BLOCK</I>. The resulting set is the union of the
|
||||
<li><I>SIG_BLOCK</I>. The resulting set is the union of the
|
||||
current set and the signal set pointed to by the <I>set</I> input parameter.
|
||||
<li><I>osSIG_UNBLOCK</I>. The resulting set is the intersection
|
||||
<li><I>SIG_UNBLOCK</I>. The resulting set is the intersection
|
||||
of the current set and the complement of the signal set pointed
|
||||
to by the <I>set</I> input parameter.
|
||||
<li><I>osSIG_SETMASK</I>. The resulting set is the signal set
|
||||
<li><I>SIG_SETMASK</I>. The resulting set is the signal set
|
||||
pointed to by the <I>set</I> input parameter.
|
||||
</ul>
|
||||
|
||||
@@ -3280,7 +3286,7 @@ the unblocked signal is ignored.
|
||||
<b>Function Prototype:</b>
|
||||
<pre>
|
||||
#include <signal.h>
|
||||
int sigqueue (int tid, int signo, const union sigval value);
|
||||
int sigqueue (int tid, int signo, union sigval value);
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -3307,7 +3313,7 @@ is delivered more than once."
|
||||
<ul>
|
||||
<li>
|
||||
On success (at least one signal was sent), zero (OK) is returned.
|
||||
On error, -1 (ERROR) is returned, and<code>errno</code>is set appropriately.
|
||||
On error, -1 (ERROR) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately.
|
||||
<ul>
|
||||
<li><code>EGAIN</code>. The limit of signals which may be queued has been reached.</li>
|
||||
<li><code>EINVAL</code>. signo was invalid.</li>
|
||||
@@ -5687,11 +5693,58 @@ interface of the same name.
|
||||
Zero on success.
|
||||
</p>
|
||||
|
||||
<h1><a name="FileSystem">2.11 Filesystem Interfaces</a></h1>
|
||||
<h1><a name="FileSystem">2.11 File System Interfaces</a></h1>
|
||||
|
||||
<p><b>Overview</b>.
|
||||
NuttX includes an optional, scalable file system.
|
||||
This file-system may be omitted altogther; NuttX does not depend on the presence
|
||||
of any file system.
|
||||
</p>
|
||||
|
||||
<p><b>Pseudo Root File System</b>.
|
||||
Or, a simple <i>in-memory</i>, <i>psuedo</i> file system can be enabled.
|
||||
This simple file system can be enabled setting the CONFIG_NFILE_DESCRIPTORS
|
||||
option to a non-zero value.
|
||||
This is an <i>in-memory</i> file system because it does not require any
|
||||
storage medium or block driver support.
|
||||
Rather, file system contents are generated on-the-fly as referenced via
|
||||
standard file system operations (open, close, read, write, etc.).
|
||||
In this sense, the file system is <i>psuedo</i> file system (in the
|
||||
same sense that the Linux <code>/proc</code> file system is also
|
||||
referred to as a psuedo file system).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The NuttX filesystem is very simple; it does not involve any block drivers or
|
||||
particular filesystem (like FAT or EXT2 etc.).
|
||||
The NuttX filesystem simply supports a set a filesystem APIs
|
||||
Any user supplied data or logic can be accessed via the psuedo-file system.
|
||||
Built in support is provided for character and block drivers in the
|
||||
<code>/dev</code> psuedo file system directory.
|
||||
</p>
|
||||
|
||||
<p><b>Mounted File Systems</b>
|
||||
The simple in-memory file system can be extended my mounting block
|
||||
devices that provide access to true file systems backed up via some
|
||||
mass storage device.
|
||||
NuttX supports the standard <code>mount()</code> command that allows
|
||||
a block driver to be bound to a mountpoint within the psuedo file system
|
||||
and to a a file system.
|
||||
At present, NuttX supports only the VFAT file system.
|
||||
</p>
|
||||
|
||||
<p><b>Comparison to Linux</b>
|
||||
From a programming perspective, the NuttX file system appears very similar
|
||||
to a Linux file system.
|
||||
However, there is a fundamental difference:
|
||||
The NuttX root file system is a psuedo file system and true file systems may be
|
||||
mounted in the psuedo file system.
|
||||
In the typical Linux installation by comparison, the Linux root file system
|
||||
is a true file system and psuedo file systems may be mounted in the true,
|
||||
root file system.
|
||||
The approach selected by NuttX is intended to support greater scalability
|
||||
from the very tiny platform to the moderate platform.
|
||||
</p>
|
||||
|
||||
<p><b>File System Interfaces</b>.
|
||||
The NuttX file system simply supports a set of standard, file system APIs
|
||||
(<code>open()</code>, <code>close()</code>, <code>read()</code>, <code>write</code>, etc.)
|
||||
and a registration mechanism that allows devices drivers to a associated with <i>nodes</i>
|
||||
in a file-system-like name space.
|
||||
@@ -5813,7 +5866,7 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
0 on success; -1 on error with<code>errno</code>set appropriately:
|
||||
0 on success; -1 on error with <a href="#ErrnoAccess"><code>errno</code></a> set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EACCES</code>.
|
||||
@@ -5859,7 +5912,7 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
0 on success; -1 on error with<code>errno</code>set appropriately:
|
||||
0 on success; -1 on error with <a href="#ErrnoAccess"><code>errno</code></a> set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EACCES</code>
|
||||
@@ -5914,7 +5967,7 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
0 on success; -1 on error with<code>errno</code>set appropriately:
|
||||
0 on success; -1 on error with <a href="#ErrnoAccess"><code>errno</code></a> set appropriately:
|
||||
</p>
|
||||
<li><code>EACCES</code> or </code>EPERM</code>:
|
||||
The user tried to connect to a broadcast address without having the
|
||||
@@ -5981,7 +6034,8 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
|
||||
On success, zero is returned. On error, -1 is returned, and
|
||||
<a href="#ErrnoAccess"><code>errno</code></a> is set appropriately.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EADDRINUSE</code>: Another socket is already listening on the same port.</li>
|
||||
@@ -6130,7 +6184,8 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, returns the number of characters sent. On error, -1 is returned, and<code>errno</code>is set appropriately:
|
||||
On success, returns the number of characters sent. On error, -1 is returned,
|
||||
and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EAGAIN</code> or <code>EWOULDBLOCK</code>.
|
||||
@@ -6237,7 +6292,7 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, returns the number of characters sent.
|
||||
On error, -1 is returned, and errno is set appropriately:
|
||||
On error, -1 is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>EAGAIN</code>.
|
||||
@@ -6301,7 +6356,7 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, returns the number of characters sent.
|
||||
On error, -1 is returned, and errno is set appropriately:
|
||||
On error, -1 is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>BADF</code>.
|
||||
@@ -6364,7 +6419,7 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
<p>
|
||||
<b>Returned Values:</b>
|
||||
On success, returns the number of characters sent.
|
||||
On error, -1 is returned, and errno is set appropriately:
|
||||
On error, -1 is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>BADF</code>.
|
||||
@@ -6381,8 +6436,8 @@ Those socket APIs are discussed in the following paragraphs.</p>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>3.0 <A NAME="Data_Structures">OS Data Structures</a></h1>
|
||||
<H2>3.1 Scalar types</H2>
|
||||
<h1>3.0 <A NAME="Data_Structures">OS Data Structures</A></h1>
|
||||
<H2>3.1 <A NAME="ScalarType">Scalar Types</A></H2>
|
||||
<p>
|
||||
Many of the types used to communicate with NuttX are simple
|
||||
scalar types. These types are used to provide architecture independence
|
||||
@@ -6396,7 +6451,7 @@ interface include:
|
||||
<li>time_t
|
||||
</ul>
|
||||
|
||||
<H2>3.2 Hidden Interface Structures</H2>
|
||||
<H2>3.2 <A NAME="HiddenStructures">Hidden Interface Structures</A></H2>
|
||||
<p>
|
||||
Several of the types used to interface with NuttX are
|
||||
structures that are intended to be hidden from the application.
|
||||
@@ -6411,37 +6466,47 @@ OS resources. These hidden structures include:
|
||||
<li>pthread_key_t
|
||||
</ul>
|
||||
<p>
|
||||
In order to maintain portability, applications should not reference
|
||||
specific elements within these hidden structures. These hidden
|
||||
structures will not be described further in this user's manual.
|
||||
In order to maintain portability, applications should not reference
|
||||
specific elements within these hidden structures. These hidden
|
||||
structures will not be described further in this user's manual.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
<H2>3.3. Access to the <I>errno</I> Variable</H2>
|
||||
<H2>3.3 <A NAME="ErrnoAccess">Access to the <code>errno</code> Variable</A></H2>
|
||||
<p>
|
||||
A pointer to the thread-specific <I>errno</I>. value is available through a
|
||||
function call:
|
||||
A pointer to the thread-specific <code>errno</code> value is available through a
|
||||
function call:
|
||||
</p>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
<b>Function Prototype:</b>
|
||||
<p>
|
||||
<pre> int *get_errno_ptr( void )</pre>
|
||||
<pre> #include <errno.h>
|
||||
#define errno *get_errno_ptr()
|
||||
int *get_errno_ptr( void )</pre>
|
||||
<p>
|
||||
<b>Description</b>: <I>osGetErrnorPtr()</I> returns a pointer to
|
||||
the thread-specific <I>errno</I> value.
|
||||
<b>Description</b>:
|
||||
<code>get_errno_ptr()</code> returns a pointer to the thread-specific <code>errno</code> value.
|
||||
Note that the symbol <code>errno</code> is defined to be <code>get_errno_ptr()</code> so that the usual
|
||||
access by referencing the symbol <code>errno</code> will work as expected.
|
||||
</p>
|
||||
<p>
|
||||
This differs somewhat from the use for<code>errno</code>in a multi-threaded process environment:
|
||||
Each pthread will have its own private copy of<code>errno</code>and the<code>errno</code>will not be shared
|
||||
between pthreads.
|
||||
There is a unique, private <code>errno</code> value for each NuttX task.
|
||||
However, the implementation of <code>errno</code> differs somewhat from the use of
|
||||
<code>errno</code> in most multi-threaded process environments:
|
||||
In NuttX, each pthread will also have its own private copy of <code>errno</code> and the
|
||||
<code>errno</code> will not be shared between pthreads.
|
||||
This is, perhaps, non-standard but promotes better thread independence.
|
||||
<p>
|
||||
<b>Input Parameters</b>: None
|
||||
<p>
|
||||
<b>Returned Values</b>:
|
||||
<p>
|
||||
<ul>
|
||||
<li>A pointer to the thread-specific <I>errno</I> value.
|
||||
<li>A pointer to the thread-specific <code>errno</code> value.
|
||||
</ul>
|
||||
<p>
|
||||
|
||||
<H2>3.4 User Interface Structures</H2>
|
||||
<H2>3.4 <A NAME="UserStructures">User Interface Structures</A></H2>
|
||||
<p>
|
||||
<H3>3.4.1 main_t</H3>
|
||||
<p>
|
||||
@@ -6597,7 +6662,7 @@ notify a task when a message is available on a queue.
|
||||
<li><a href="#directoryoperations">Directory operations</a></li>
|
||||
<li><a href="#driveroperations">Driver operations</a></li>
|
||||
<li><a href="#exit">exit</a></li>
|
||||
<li><a href="#FileSystem">Filesystem interfaces</a></li>
|
||||
<li><a href="#FileSystem">File system interfaces</a></li>
|
||||
<li><a href="#getpid">getpid</a></li>
|
||||
<li><a href="#getsockopt">getsockopt</a></li>
|
||||
<li><a href="#gmtimer">gmtime_r</a></li>
|
||||
|
||||
BIN
Documentation/freeports.gif
Normal file
BIN
Documentation/freeports.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
20
Documentation/freeports.html
Normal file
20
Documentation/freeports.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Free NuttX Ports</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<center>
|
||||
<table border="1" width="80%" bgcolor="#eeeeee">
|
||||
<tr><td>
|
||||
<big><b><i>Free</i> Ports</b></big>.
|
||||
If you have a hardware platform that you would like to see NuttX ported to then have I got a deal for you:
|
||||
I am willing to port NuttX to run on your hardware <b><i>FREE</i></b>.
|
||||
You would, of course, have to provide all hardware, development tools, and documentation.
|
||||
The functionality would be limited to basic boot-up, serial console, networking, ...
|
||||
I would need to retain the hardware throught the support cycle.
|
||||
Of course, this offer depends the availability of free time to do the port.
|
||||
If you are interested, contact <a href="http://sourceforge.net/users/patacongo/">patacongo</a> at SourceForge.
|
||||
</td></tr></table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
160
Makefile
160
Makefile
@@ -1,7 +1,7 @@
|
||||
############################################################
|
||||
############################################################################
|
||||
# Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
#
|
||||
@@ -31,12 +31,19 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
############################################################################
|
||||
|
||||
TOPDIR = ${shell pwd}
|
||||
TOPDIR := ${shell pwd | sed -e 's/ /\\ /g'}
|
||||
-include ${TOPDIR}/.config
|
||||
-include ${TOPDIR}/Make.defs
|
||||
|
||||
# Default tools
|
||||
|
||||
ifeq ($(DIRLINK),)
|
||||
DIRLINK = $(TOPDIR)/tools/link.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
endif
|
||||
|
||||
# Process architecture and board-specific directories
|
||||
|
||||
ARCH_DIR = arch/$(CONFIG_ARCH)
|
||||
@@ -44,11 +51,16 @@ ARCH_SRC = $(ARCH_DIR)/src
|
||||
ARCH_INC = $(ARCH_DIR)/include
|
||||
BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
|
||||
|
||||
# Add-on directories. These may or may not be in place in the
|
||||
# NuttX source tree (they must be specifically installed)
|
||||
|
||||
PCODE_DIR := ${shell if [ -r pcode/Makefile ]; then echo "pcode"; fi}
|
||||
|
||||
# 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)
|
||||
NONFSDIRS = sched lib $(ARCH_SRC) mm examples/$(CONFIG_EXAMPLE) $(PCODE_DIR)
|
||||
FSDIRS = fs drivers
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
@@ -60,11 +72,17 @@ endif
|
||||
# MAKEDIRS are the directories in which we will build targets
|
||||
|
||||
CLEANDIRS = $(NONFSDIRS) $(FSDIRS)
|
||||
MAKEDIRS = $(NONFSDIRS)
|
||||
|
||||
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
||||
MAKEDIRS = $(NONFSDIRS)
|
||||
ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
|
||||
MAKEDIRS += fs
|
||||
endif
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
MAKEDIRS += drivers
|
||||
endif
|
||||
else
|
||||
MAKEDIRS = $(NONFSDIRS) $(FSDIRS)
|
||||
MAKEDIRS += $(FSDIRS)
|
||||
endif
|
||||
|
||||
# LINKLIBS is the list of NuttX libraries that is passed to the
|
||||
@@ -75,14 +93,25 @@ endif
|
||||
LINKLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT) mm/libmm$(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
|
||||
|
||||
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
||||
ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
|
||||
LINKLIBS += fs/libfs$(LIBEXT)
|
||||
endif
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
LINKLIBS += drivers/libdrivers$(LIBEXT)
|
||||
endif
|
||||
else
|
||||
LINKLIBS += fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT)
|
||||
endif
|
||||
|
||||
ifneq ($(PCODE_DIR),)
|
||||
LINKLIBS += pcode/libpcode$(LIBEXT)
|
||||
endif
|
||||
|
||||
# This is the name of the final target
|
||||
BIN = nuttx$(EXEEXT)
|
||||
|
||||
@@ -91,7 +120,7 @@ all: $(BIN)
|
||||
|
||||
# Build the mkconfig tool used to create include/nuttx/config.h
|
||||
tools/mkconfig:
|
||||
$(MAKE) -C tools -f Makefile.mkconfig TOPDIR=$(TOPDIR) mkconfig
|
||||
@$(MAKE) -C tools -f Makefile.mkconfig TOPDIR="$(TOPDIR)" mkconfig
|
||||
|
||||
# Create the include/nuttx/config.h file
|
||||
include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig
|
||||
@@ -99,79 +128,39 @@ include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig
|
||||
|
||||
# link the arch/<arch-name>/include dir to include/arch
|
||||
include/arch: Make.defs
|
||||
@if [ -h include/arch ]; then \
|
||||
rm -f include/arch ; \
|
||||
else \
|
||||
if [ -e include/arch ]; then \
|
||||
echo "include/arch exists but is not a symbolic link" ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
fi
|
||||
@ln -s $(TOPDIR)/$(ARCH_DIR)/include include/arch
|
||||
@$(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include include/arch
|
||||
|
||||
# Link the configs/<board-name>/include dir to include/arch/board
|
||||
include/arch/board: Make.defs include/arch
|
||||
@if [ -h include/arch/board ]; then \
|
||||
rm -f include/arch/board ; \
|
||||
else \
|
||||
if [ -e include/arch/board ]; then \
|
||||
echo "include/arch/board exists but is not a symbolic link" ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
fi
|
||||
@ln -s $(TOPDIR)/$(BOARD_DIR)/include include/arch/board
|
||||
include/arch/board: include/arch Make.defs include/arch
|
||||
@$(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/include include/arch/board
|
||||
|
||||
# Link the configs/<board-name>/src dir to arch/<arch-name>/src/board
|
||||
$(ARCH_SRC)/board: Make.defs
|
||||
@if [ -h $(ARCH_SRC)/board ]; then \
|
||||
rm -f $(ARCH_SRC)/board ; \
|
||||
else \
|
||||
if [ -e $(ARCH_SRC)/board ]; then \
|
||||
echo "$(ARCH_SRC)/board exists but is not a symbolic link" ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
fi
|
||||
@ln -s $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board
|
||||
@$(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board
|
||||
|
||||
# Link arch/<arch-name>/include/<chip-name> to arch/<arch-name>/include/chip
|
||||
$(ARCH_SRC)/chip: Make.defs
|
||||
ifneq ($(CONFIG_ARCH_CHIP),)
|
||||
@if [ -h $(ARCH_SRC)/chip ]; then \
|
||||
rm -f $(ARCH_SRC)/chip ; \
|
||||
else \
|
||||
if [ -e $(ARCH_SRC)/chip ]; then \
|
||||
echo "$(ARCH_SRC)/chip exists but is not a symbolic link" ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
fi
|
||||
@ln -s $(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip
|
||||
@$(DIRLINK) $(TOPDIR)/$(ARCH_SRC)/$(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip
|
||||
endif
|
||||
|
||||
# Link arch/<arch-name>/src/<chip-name> to arch/<arch-name>/src/chip
|
||||
$(ARCH_INC)/chip: Make.defs
|
||||
include/arch/chip: include/arch Make.defs
|
||||
ifneq ($(CONFIG_ARCH_CHIP),)
|
||||
@if [ -e $(ARCH_INC)/chip ]; then \
|
||||
if [ -h $(ARCH_INC)/chip ]; then \
|
||||
rm -f $(ARCH_INC)/chip ; \
|
||||
else \
|
||||
echo "$(ARCH_INC)/chip exists but is not a symbolic link" ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
fi
|
||||
@ln -s $(CONFIG_ARCH_CHIP) $(ARCH_INC)/chip
|
||||
@$(DIRLINK) $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP) include/arch/chip
|
||||
endif
|
||||
|
||||
dirlinks: include/arch include/arch/board $(ARCH_SRC)/board $(ARCH_SRC)/chip $(ARCH_INC)/chip
|
||||
dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(ARCH_SRC)/chip
|
||||
|
||||
context: check_context include/nuttx/config.h dirlinks
|
||||
|
||||
clean_context:
|
||||
@rm -f include/nuttx/config.h include/arch
|
||||
@if [ -h include/arch ]; then rm -f include/arch ; fi
|
||||
@if [ -h $(ARCH_INC)/board ]; then rm -f $(ARCH_INC)/board ; fi
|
||||
@if [ -h $(ARCH_SRC)/board ]; then rm -f $(ARCH_SRC)/board ; fi
|
||||
@if [ -h $(ARCH_INC)/chip ]; then rm -f $(ARCH_INC)/chip ; fi
|
||||
@if [ -h $(ARCH_SRC)/chip ]; then rm -f $(ARCH_SRC)/chip ; fi
|
||||
@rm -f include/nuttx/config.h
|
||||
@$(DIRUNLINK) include/arch/board
|
||||
@$(DIRUNLINK) include/arch/chip
|
||||
@$(DIRUNLINK) include/arch
|
||||
@$(DIRUNLINK) $(ARCH_SRC)/board
|
||||
@$(DIRUNLINK) $(ARCH_SRC)/chip
|
||||
|
||||
check_context:
|
||||
@if [ ! -e ${TOPDIR}/.config -o ! -e ${TOPDIR}/Make.defs ]; then \
|
||||
@@ -181,60 +170,63 @@ check_context:
|
||||
fi
|
||||
|
||||
sched/libsched$(LIBEXT): context
|
||||
$(MAKE) -C sched TOPDIR=$(TOPDIR) libsched$(LIBEXT)
|
||||
@$(MAKE) -C sched TOPDIR="$(TOPDIR)" libsched$(LIBEXT)
|
||||
|
||||
lib/liblib$(LIBEXT): context
|
||||
$(MAKE) -C lib TOPDIR=$(TOPDIR) liblib$(LIBEXT)
|
||||
@$(MAKE) -C lib TOPDIR="$(TOPDIR)" liblib$(LIBEXT)
|
||||
|
||||
$(ARCH_SRC)/libarch$(LIBEXT): context
|
||||
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) libarch$(LIBEXT)
|
||||
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT)
|
||||
|
||||
mm/libmm$(LIBEXT): context
|
||||
$(MAKE) -C mm TOPDIR=$(TOPDIR) libmm$(LIBEXT)
|
||||
@$(MAKE) -C mm TOPDIR="$(TOPDIR)" libmm$(LIBEXT)
|
||||
|
||||
net/libnet$(LIBEXT): context
|
||||
$(MAKE) -C net TOPDIR=$(TOPDIR) libnet$(LIBEXT)
|
||||
@$(MAKE) -C net TOPDIR="$(TOPDIR)" libnet$(LIBEXT)
|
||||
|
||||
netutils/libnetutils$(LIBEXT): context
|
||||
$(MAKE) -C netutils TOPDIR=$(TOPDIR) libnetutils$(LIBEXT)
|
||||
@$(MAKE) -C netutils TOPDIR="$(TOPDIR)" libnetutils$(LIBEXT)
|
||||
|
||||
fs/libfs$(LIBEXT): context
|
||||
$(MAKE) -C fs TOPDIR=$(TOPDIR) libfs$(LIBEXT)
|
||||
@$(MAKE) -C fs TOPDIR="$(TOPDIR)" libfs$(LIBEXT)
|
||||
|
||||
drivers/libdrivers$(LIBEXT): context
|
||||
$(MAKE) -C drivers TOPDIR=$(TOPDIR) libdrivers$(LIBEXT)
|
||||
@$(MAKE) -C drivers TOPDIR="$(TOPDIR)" libdrivers$(LIBEXT)
|
||||
|
||||
pcode/libpcode$(LIBEXT): context
|
||||
@$(MAKE) -C pcode TOPDIR="$(TOPDIR)" libpcode$(LIBEXT)
|
||||
|
||||
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT): context
|
||||
$(MAKE) -C examples/$(CONFIG_EXAMPLE) TOPDIR=$(TOPDIR) lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||
@$(MAKE) -C examples/$(CONFIG_EXAMPLE) TOPDIR="$(TOPDIR)" lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||
|
||||
$(BIN): context depend $(LINKLIBS)
|
||||
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) LINKLIBS="$(LINKLIBS)" $(BIN)
|
||||
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" LINKLIBS="$(LINKLIBS)" $(BIN)
|
||||
|
||||
depend:
|
||||
@for dir in $(MAKEDIRS) ; do \
|
||||
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) depend ; \
|
||||
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
|
||||
done
|
||||
|
||||
subdir_clean:
|
||||
@for dir in $(CLEANDIRS) ; do \
|
||||
if [ -e $$dir/Makefile ]; then \
|
||||
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) clean ; \
|
||||
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" clean ; \
|
||||
fi \
|
||||
done
|
||||
$(MAKE) -C tools -f Makefile.mkconfig TOPDIR=$(TOPDIR) clean
|
||||
$(MAKE) -C mm -f Makefile.test TOPDIR=$(TOPDIR) clean
|
||||
@$(MAKE) -C tools -f Makefile.mkconfig TOPDIR="$(TOPDIR)" clean
|
||||
@$(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean
|
||||
|
||||
clean: subdir_clean
|
||||
rm -f $(BIN) $(BIN).* mm_test *.map *~
|
||||
@rm -f $(BIN) $(BIN).* mm_test *.map *~
|
||||
|
||||
subdir_distclean:
|
||||
@for dir in $(CLEANDIRS) ; do \
|
||||
if [ -e $$dir/Makefile ]; then \
|
||||
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) distclean ; \
|
||||
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" distclean ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
distclean: clean subdir_distclean clean_context
|
||||
rm -f Make.defs setenv.sh .config
|
||||
@rm -f Make.defs setenv.sh .config
|
||||
|
||||
|
||||
|
||||
26
ReleaseNotes
26
ReleaseNotes
@@ -1,23 +1,9 @@
|
||||
nuttx-0.3.1
|
||||
nuttx-0.3.8
|
||||
^^^^^^^^^^^
|
||||
|
||||
This is the 13th release of NuttX and the second release containing
|
||||
the integration of a network subsystem and the uIP TCP/IP, UDP, and
|
||||
ICMP stacks into NuttX (see http://www.sics.se/~adam/uip/index.php/Main_Page).
|
||||
This is the 20th release of NuttX. This is a minor bugfix release.
|
||||
It corrects a few minor problems, adds a few minor features, and
|
||||
continues the integration of the ZiLOG Z18F and of the Pascal P-Code
|
||||
add-on. This release is synchronized with the release of Pascal-0.1.2.
|
||||
|
||||
Many network-related problems have been fixed and the implementation
|
||||
has matured significantly. However, the level of network reliability
|
||||
is probably still at the pre-alpha or early level. It is sufficiently
|
||||
complete that you may begin to perform some network integration and
|
||||
is exepcted to achieve beta level of reliability 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 Neuros OSD (DM320 ARM9)
|
||||
platform using the DM90x0 driver.
|
||||
|
||||
This tarball contains a complete CVS snapshot from November 19, 2007.
|
||||
This tarball contains a complete CVS snapshot from February 10, 2008.
|
||||
|
||||
@@ -125,7 +125,7 @@ Supported Architectures
|
||||
|
||||
arch/sim
|
||||
A user-mode port of NuttX to the x86 Linux platform is available.
|
||||
The purpose of this port is primarily to support OS feature developement.
|
||||
The purpose of this port is primarily to support OS feature development.
|
||||
This port does not support interrupts or a real timer (and hence no
|
||||
round robin scheduler) Otherwise, it is complete.
|
||||
|
||||
@@ -159,9 +159,19 @@ arch/m68322
|
||||
arch/pjrc-8051
|
||||
8051 Microcontroller. This port is not quite ready for prime time.
|
||||
|
||||
arch/z16
|
||||
ZiLOG z16f Microcontroller.
|
||||
STATUS: Released in nuttx-0.3.7. Fully functional other than issues
|
||||
addressed in ${TOPDIR}/TODO.
|
||||
|
||||
arch/z80
|
||||
ZiLOG z80 Microcontroller.
|
||||
STATUS: Functional with no known defects. There are still several
|
||||
OS features that have not yet been tested (e.g., networking).
|
||||
|
||||
The following architecture directories are deprecated. They have been
|
||||
replaced by the logic in arm/arm and will deleted when arch/arm is fully
|
||||
verified.
|
||||
replaced by the logic in arm/arm and will deleted at some point in the
|
||||
future.
|
||||
|
||||
arch/c5471
|
||||
Replaced with arch/arm/include/c5471 and arch/arm/src/c5471
|
||||
|
||||
@@ -134,7 +134,9 @@ struct xcptcontext
|
||||
* are pending signals to be processed.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
void *sigdeliver; /* Actual type is sig_deliver_t */
|
||||
#endif
|
||||
|
||||
/* These are saved copies of LR and CPSR used during
|
||||
* signal processing.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
############################################################################
|
||||
# Makefile
|
||||
# arch/arm/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
#
|
||||
@@ -36,7 +36,6 @@
|
||||
-include $(TOPDIR)/Make.defs
|
||||
-include chip/Make.defs
|
||||
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
|
||||
|
||||
@@ -67,22 +66,22 @@ VPATH = chip:common
|
||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||
|
||||
$(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %.S
|
||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libarch$(LIBEXT): $(OBJS)
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||
$(call ARCHIVE, $@, $${obj}); \
|
||||
done ; )
|
||||
|
||||
board/libboard$(LIBEXT):
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) libboard$(LIBEXT)
|
||||
$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT)
|
||||
|
||||
nuttx: $(HEAD_AOBJ) board/libboard$(LIBEXT)
|
||||
$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
|
||||
@echo "LD: nuttx"
|
||||
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
|
||||
--start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
|
||||
@$(NM) $(TOPDIR)/$@ | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
@@ -101,23 +100,23 @@ endif
|
||||
|
||||
.depend: Makefile chip/Make.defs $(SRCS)
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
|
||||
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
|
||||
fi
|
||||
$(MKDEP) --dep-path chip --dep-path common $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@$(MKDEP) --dep-path chip --dep-path common $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \
|
||||
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
|
||||
fi
|
||||
@rm -f libarch$(LIBEXT) *~
|
||||
@if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
@rm -f libarch$(LIBEXT) *~ .*.swp
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \
|
||||
$(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \
|
||||
fi
|
||||
@rm -f Make.dep .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_mdelay.c up_udealy.c up_doirq.c \
|
||||
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.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 \
|
||||
@@ -45,4 +45,5 @@ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
|
||||
up_undefinedinsn.c up_usestack.c
|
||||
|
||||
CHIP_ASRCS = c5471_lowputc.S c5471_vectors.S
|
||||
CHIP_CSRCS = c5471_irq.c c5471_serial.c c5471_timerisr.c c5471_watchdog.c
|
||||
CHIP_CSRCS = c5471_irq.c c5471_serial.c c5471_timerisr.c c5471_watchdog.c \
|
||||
c5471_ethernet.c
|
||||
|
||||
2147
arch/arm/src/c5471/c5471_ethernet.c
Normal file
2147
arch/arm/src/c5471/c5471_ethernet.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* c5471/chip.h
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
@@ -31,20 +31,61 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __C5471_CHIP_H
|
||||
#define __C5471_CHIP_H
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* UARTs ****************************************************/
|
||||
#define EIM_RAM_START 0xffd00000
|
||||
|
||||
/* Ethernet Interface Module (EIM) ******************************************/
|
||||
|
||||
#define EIM_CTRL 0xffff0000 /* ESM control register */
|
||||
#define EIM_STATUS 0xffff0004 /* ESM status register */
|
||||
#define EIM_CPU_TXBA 0xffff0008 /* CPU TX descriptors base address */
|
||||
#define EIM_CPU_RXBA 0xffff000c /* CPU RX descriptors base address */
|
||||
#define EIM_BUFSIZE 0xffff0010 /* Packet buffer size register */
|
||||
#define EIM_CPU_FILTER 0xffff0014 /* CPU filtering contol registers */
|
||||
#define EIM_CPU_DAHI 0xffff0018 /* CPU destination address (HI) */
|
||||
#define EIM_CPU_DALO 0xffff001c /* CPU destination address (LO) */
|
||||
#define EIM_MFVHI 0xffff0020 /* Multicast filter valid (HI) */
|
||||
#define EIM_MFVLO 0xffff0024 /* Multicast filter valid (LO) */
|
||||
#define EIM_MFMHI 0xffff0028 /* Multicast filter mask (HI) */
|
||||
#define EIM_MFMLO 0xffff002c /* Multicast filter mask (LO) */
|
||||
#define EIM_RXTH 0xffff0030 /* RX threshold register */
|
||||
#define EIM_CPU_RXREADY 0xffff0034 /* CPU RX ready register */
|
||||
#define EIM_INTEN 0xffff0038 /* ESM interrupt enable register */
|
||||
#define EIM_ENET0_TXDESC 0xffff0040 /* ENET0 TX Queue pointer */
|
||||
#define EIM_ENET0_RXDESC 0xffff0044 /* ENET0 RX Queue pointer */
|
||||
#define EIM_CPU_TXDESC 0xffff0050 /* CPU TX Queue pointer */
|
||||
#define EIM_CPU_RXDESC 0xffff0054 /* CPU RX Queue pointer */
|
||||
|
||||
#define ENET0_MODE 0xffff0100 /* Mode register */
|
||||
#define ENET0_BOFFSEED 0xffff0104 /* Backoff seed register */
|
||||
#define ENET0_BCOUNT 0xffff0108 /* Backoff count register */
|
||||
#define ENET0_FLWPAUSE 0xffff010c /* TX flow pause count register */
|
||||
#define ENET0_FLWCONTROL 0xffff0110 /* Flow control register */
|
||||
#define ENET0_VTYPE 0xffff0114 /* VTYPE tag register */
|
||||
#define ENET0_SEISR 0xffff0118 /* System error int status register */
|
||||
#define ENET0_TXBUFRDY 0xffff011c /* TX descripter buffer ready */
|
||||
#define ENET0_TDBA 0xffff0120 /* TX descriptor base address */
|
||||
#define ENET0_RDBA 0xffff0124 /* RX descriptor base address */
|
||||
#define ENET0_PARHI 0xffff0128 /* Dest phys address match (HI) */
|
||||
#define ENET0_PARLO 0xffff012c /* Dest phys address match (LO) */
|
||||
#define ENET0_LARHI 0xffff0130 /* Log address hash filter (HI) */
|
||||
#define ENET0_LARLO 0xffff0134 /* Log address hash filter (LO) */
|
||||
#define ENET0_ADRMODE_EN 0xffff0138 /* Address mode enable register */
|
||||
#define ENET0_DRP 0xffff013c /* Desc ring poll interval count */
|
||||
|
||||
/* UARTs ********************************************************************/
|
||||
|
||||
#define UART_IRDA_BASE 0xffff0800
|
||||
#define UART_MODEM_BASE 0xffff1000
|
||||
@@ -110,7 +151,7 @@
|
||||
#define UART_MODEM_RDPTR_UTX 0xffff1064 /* TX FIFO Read Pointer Register */
|
||||
#define UART_MODEM_WRPTR_UTX 0xffff1068 /* TX FIFO Write Pointer Register */
|
||||
|
||||
/* UART Settings ********************************************/
|
||||
/* UART Settings ************************************************************/
|
||||
|
||||
/* Miscellaneous UART settings. */
|
||||
|
||||
@@ -164,13 +205,13 @@
|
||||
#define MDR_AUTOBAUDING_MODE 0x00000002 /* Modem UART only */
|
||||
#define MDR_RESET_MODE 0x00000007 /* Both IrDA and Modem UARTs */
|
||||
|
||||
/* SPI ******************************************************/
|
||||
/* SPI **********************************************************************/
|
||||
|
||||
#define MAX_SPI 3
|
||||
|
||||
#define SPI_REGISTER_BASE 0xffff2000
|
||||
|
||||
/* GIO ******************************************************/
|
||||
/* GIO **********************************************************************/
|
||||
|
||||
#define MAX_GIO (35)
|
||||
|
||||
@@ -211,7 +252,7 @@
|
||||
#define KBGPIO_EN 0xffff2914 /* Selects register for muxed
|
||||
* KBGPIOs */
|
||||
|
||||
/* Timers ***************************************************/
|
||||
/* Timers *******************************************************************/
|
||||
|
||||
#define C5471_TIMER0_CTRL 0xffff2a00
|
||||
#define C5471_TIMER0_CNT 0xffff2a04
|
||||
@@ -241,8 +282,8 @@
|
||||
#define ILR_IRQ3_REG 0xffff2d28 /* 3-GPIO0 */
|
||||
#define ILR_IRQ4_REG 0xffff2d2c /* 4-Ethernet */
|
||||
#define ILR_IRQ5_REG 0xffff2d30 /* 5-KBGPIO[7:0] */
|
||||
#define ILR_IRQ6_REG 0xffff2d34 /* 6-Uart serial */
|
||||
#define ILR_IRQ7_REG 0xffff2d38 /* 7-Uart IRDA */
|
||||
#define ILR_IRQ6_REG 0xffff2d34 /* 6-Uart serial */
|
||||
#define ILR_IRQ7_REG 0xffff2d38 /* 7-Uart IRDA */
|
||||
#define ILR_IRQ8_REG 0xffff2d3c /* 8-KBGPIO[15:8] */
|
||||
#define ILR_IRQ9_REG 0xffff2d40 /* 9-GPIO3 */
|
||||
#define ILR_IRQ10_REG 0xffff2d44 /* 10-GPIO2 */
|
||||
@@ -252,11 +293,22 @@
|
||||
#define ILR_IRQ14_REG 0xffff2d54 /* 14-GPIO[19:4] */
|
||||
#define ILR_IRQ15_REG 0xffff2d58 /* 15-API */
|
||||
|
||||
/* I2C ******************************************************/
|
||||
/* CLKM *********************************************************************/
|
||||
|
||||
#define CLKM 0xffff2f00
|
||||
#define CLKM_CTL_RST 0xffff2f10
|
||||
#define CLKM_RESET 0xffff2f18
|
||||
|
||||
#define CLKM_RESET_EIM 0x00000008
|
||||
#define CLKM_EIM_CLK_STOP 0x00000010
|
||||
#define CLKM_CTL_RST_LEAD_RESET 0x00000000
|
||||
#define CLKM_CTL_RST_EXT_RESET 0x00000002
|
||||
|
||||
/* I2C **********************************************************************/
|
||||
|
||||
#define MAX_I2C 1
|
||||
|
||||
/* API ******************************************************/
|
||||
/* API **********************************************************************/
|
||||
|
||||
#define DSPRAM_BASE 0xffe00000 /* DSPRAM base address */
|
||||
#define DSPRAM_END 0xffe03fff
|
||||
@@ -308,12 +360,12 @@
|
||||
#define DSPMEM_ARM_TO_DSP(addr) \
|
||||
((((__u32)(addr) - DSPMEM_ARM_START) >> 1) + DSPMEM_DSP_START)
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __C5471_CHIP_H */
|
||||
|
||||
@@ -84,7 +84,7 @@ static inline void putreg16(uint16 val, unsigned int addr)
|
||||
|
||||
/* Most DM320 registers are 16-bits wide */
|
||||
|
||||
#define getreg(a) getreg16(1)
|
||||
#define getreg(a) getreg16(a)
|
||||
#define putreg(v,a) putreg16(v,a)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* common/up_assert.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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>
|
||||
|
||||
@@ -51,9 +51,9 @@
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if
|
||||
* debug is not selected.
|
||||
@@ -64,17 +64,17 @@
|
||||
# define lldbg lib_lowprintf
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: up_getsp
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* I don't know if the builtin to get SP is enabled */
|
||||
|
||||
@@ -89,9 +89,9 @@ static inline uint32 up_getsp(void)
|
||||
return sp;
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: up_stackdump
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
static void up_stackdump(void)
|
||||
@@ -152,9 +152,9 @@ static void up_stackdump(void)
|
||||
# define up_stackdump()
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _up_assert
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
||||
{
|
||||
@@ -179,13 +179,13 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: up_assert
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void up_assert(const ubyte *filename, int lineno)
|
||||
{
|
||||
@@ -205,9 +205,9 @@ void up_assert(const ubyte *filename, int lineno)
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: up_assert_code
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void up_assert_code(const ubyte *filename, int lineno, int errorcode)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* common/up_exit.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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>
|
||||
@@ -49,34 +49,38 @@
|
||||
#include <nuttx/fs.h>
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _up_dumponexit
|
||||
*
|
||||
* Description:
|
||||
* Dump the state of all tasks whenever on task exits. This
|
||||
* is debug instrumentation that was added to check file-
|
||||
* related reference counting but could be useful again
|
||||
* sometime in the future.
|
||||
* Dump the state of all tasks whenever on task exits. This is debug
|
||||
* instrumentation that was added to check file-related reference counting
|
||||
* but could be useful again sometime in the future.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
{
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
||||
int i;
|
||||
#endif
|
||||
|
||||
dbg(" TCB=%p name=%s\n", tcb, tcb->argv[0]);
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
if (tcb->filelist)
|
||||
{
|
||||
dbg(" filelist refcount=%d\n",
|
||||
@@ -92,7 +96,9 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_NFILE_STREAMS > 0
|
||||
if (tcb->streams)
|
||||
{
|
||||
dbg(" streamlist refcount=%d\n",
|
||||
@@ -103,31 +109,38 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
||||
if (filep->fs_filedes >= 0)
|
||||
{
|
||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||
dbg(" fd=%d nbytes=%d\n",
|
||||
filep->fs_filedes,
|
||||
filep->fs_bufpos - filep->fs_bufstart);
|
||||
#else
|
||||
dbg(" fd=%d\n", filep->fs_filedes);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _exit
|
||||
*
|
||||
* Description:
|
||||
* This function causes the currently executing task to cease
|
||||
* to exist. This is a special case of task_delete().
|
||||
* to exist. This is a special case of task_delete() where the task to
|
||||
* be deleted is the currently executing task. It is more complex because
|
||||
* a context switch must be perform to the the next ready to run task.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
_TCB* tcb = (_TCB*)g_readytorun.head;
|
||||
_TCB* tcb;
|
||||
|
||||
/* Disable interrupts. They will be restored when the next
|
||||
* task is started.
|
||||
@@ -138,41 +151,13 @@ void _exit(int status)
|
||||
lldbg("TCB=%p exitting\n", tcb);
|
||||
|
||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||
dbg("Other tasks:\n");
|
||||
lldbg("Other tasks:\n");
|
||||
sched_foreach(_up_dumponexit, NULL);
|
||||
#endif
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list. We can
|
||||
* ignore the return value because we know that a context
|
||||
* switch is needed.
|
||||
*/
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
(void)sched_removereadytorun(tcb);
|
||||
|
||||
/* We are not in a bad stack-- the head of the ready to run task list
|
||||
* does not correspond to the thread that is running. Disabling pre-
|
||||
* emption on this TCB should be enough to keep things stable.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Move the TCB to the specified blocked task list and delete it */
|
||||
|
||||
sched_addblocked(tcb, TSTATE_TASK_INACTIVE);
|
||||
task_delete(tcb->pid);
|
||||
|
||||
/* If there are any pending tasks, then add them to the g_readytorun
|
||||
* task list now
|
||||
*/
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
(void)sched_mergepending();
|
||||
}
|
||||
|
||||
/* Now calling sched_unlock() should have no effect */
|
||||
|
||||
sched_unlock();
|
||||
(void)task_deletecurrent();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
|
||||
@@ -284,7 +284,7 @@ __start:
|
||||
#endif
|
||||
/* Perform early serial initialization */
|
||||
|
||||
#ifdef CONFIG_DEV_CONSOLE
|
||||
#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
|
||||
bl up_earlyserialinit
|
||||
#endif
|
||||
|
||||
|
||||
@@ -129,7 +129,9 @@ void up_initialize(void)
|
||||
|
||||
/* Register devices */
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
devnull_register(); /* Standard /dev/null */
|
||||
#endif
|
||||
|
||||
/* Initialize the serial device driver */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* common/up_internal.h
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -31,41 +31,41 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __UP_INTERNAL_H
|
||||
#define __UP_INTERNAL_H
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Bring-up debug configurations. These are here (vs defconfig)
|
||||
* because these should only be controlled during low level
|
||||
* board bring-up and not part of normal platform configuration.
|
||||
*/
|
||||
|
||||
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
|
||||
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
|
||||
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
|
||||
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
|
||||
#define CONFIG_DUMP_ON_EXIT 1 /* Dump task state on exit */
|
||||
#undef CONFIG_SUPPRESS_INTERRUPTS /* DEFINED: Do not enable interrupts */
|
||||
#undef CONFIG_SUPPRESS_TIMER_INTS /* DEFINED: No timer */
|
||||
#undef CONFIG_SUPPRESS_SERIAL_INTS /* DEFINED: Console will poll */
|
||||
#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfig UART */
|
||||
#undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef void (*up_vector_t)(void);
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Public Variables
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/* This holds a references to the current interrupt level
|
||||
@@ -84,14 +84,14 @@ extern uint32 *current_regs;
|
||||
extern uint32 g_heapbase;
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -129,8 +129,13 @@ extern void up_vectorfiq(void);
|
||||
|
||||
/* Defined in up_serial.c */
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
extern void up_earlyserialinit(void);
|
||||
extern void up_serialinit(void);
|
||||
#else
|
||||
# define up_earlyserialinit()
|
||||
# define up_serialinit()
|
||||
#endif
|
||||
|
||||
/* Defined in up_watchdog.c */
|
||||
|
||||
|
||||
@@ -104,10 +104,13 @@ __start:
|
||||
blt 1b
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS >0
|
||||
/* Perform early serial initialization */
|
||||
|
||||
mov fp, #0
|
||||
bl up_earlyserialinit
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
mov r0, #'C'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* common/up_sigdeliver.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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>
|
||||
@@ -47,23 +47,23 @@
|
||||
#include "up_internal.h"
|
||||
#include "up_arch.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: up_sigdeliver
|
||||
*
|
||||
* Description:
|
||||
@@ -72,7 +72,7 @@
|
||||
* with and forced to branch to this location with interrupts
|
||||
* disabled.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void up_sigdeliver(void)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ void up_sigdeliver(void)
|
||||
* the correct errno value (probably EINTR).
|
||||
*/
|
||||
|
||||
int saved_errno = rtcb->errno;
|
||||
int saved_errno = rtcb->pterrno;
|
||||
|
||||
up_ledon(LED_SIGNAL);
|
||||
|
||||
@@ -125,7 +125,7 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
dbg("Resuming\n");
|
||||
rtcb->errno = saved_errno;
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
/* Then restore the correct state for this thread of
|
||||
* execution.
|
||||
|
||||
@@ -84,10 +84,10 @@
|
||||
up_lowputc:
|
||||
/* On entry, r0 holds the character to be printed */
|
||||
|
||||
#ifdef CONFIG_UART0_SERIAL_CONSOLE
|
||||
ldr r2, =DM320_UART0_REGISTER_BASE /* r2=UART0 base */
|
||||
#else
|
||||
#ifdef CONFIG_UART1_SERIAL_CONSOLE
|
||||
ldr r2, =DM320_UART1_REGISTER_BASE /* r2=UART1 base */
|
||||
#else
|
||||
ldr r2, =DM320_UART0_REGISTER_BASE /* r2=UART0 base */
|
||||
#endif
|
||||
|
||||
/* Poll the TX fifo trigger level bit of the UART_SSR
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -70,24 +70,28 @@
|
||||
#define UART_DTRR_DTR_MASK 0x00ff /* Data transmit/receive */
|
||||
|
||||
/* UART BRSR register bit definitions */
|
||||
/* The UART clock is half of the ARM clock */
|
||||
/* The UART module is clocked by either the AHB clock or PLLIN / 16 */
|
||||
|
||||
#define UART_CLK (DM320_ARM_CLOCK / 2)
|
||||
#ifdef CONFIG_DM320_UARTPPLIN
|
||||
# define UART_REFCLK (27000000 / 16)
|
||||
#else
|
||||
# define UART_REFCLK (DM320_AHB_CLOCK / 16)
|
||||
#endif
|
||||
|
||||
/* And baud rate = UART_CLK / 16 / (VALUE+1) */
|
||||
/* And baud = UART_REFCLK / (brsr+1) */
|
||||
|
||||
#define UART_BAUD_2400 ((uint16)(((UART_CLK / 16) / 2400 ) - 1))
|
||||
#define UART_BAUD_4800 ((uint16)(((UART_CLK / 16) / 4800 ) - 1))
|
||||
#define UART_BAUD_9600 ((uint16)(((UART_CLK / 16) / 9600 ) - 1))
|
||||
#define UART_BAUD_14400 ((uint16)(((UART_CLK / 16) / 14400 ) - 1))
|
||||
#define UART_BAUD_19200 ((uint16)(((UART_CLK / 16) / 19200 ) - 1))
|
||||
#define UART_BAUD_28800 ((uint16)(((UART_CLK / 16) / 28800 ) - 1))
|
||||
#define UART_BAUD_38400 ((uint16)(((UART_CLK / 16) / 38400 ) - 1))
|
||||
#define UART_BAUD_57600 ((uint16)(((UART_CLK / 16) / 57600 ) - 1))
|
||||
#define UART_BAUD_115200 ((uint16)(((UART_CLK / 16) / 115200) - 1))
|
||||
#define UART_BAUD_230400 ((uint16)(((UART_CLK / 16) / 230400) - 1))
|
||||
#define UART_BAUD_460800 ((uint16)(((UART_CLK / 16) / 460800) - 1))
|
||||
#define UART_BAUD_921600 ((uint16)(((UART_CLK / 16) / 921600) - 1))
|
||||
#define UART_BAUD_2400 ((uint16)((UART_REFCLK / 2400 ) - 1))
|
||||
#define UART_BAUD_4800 ((uint16)((UART_REFCLK / 4800 ) - 1))
|
||||
#define UART_BAUD_9600 ((uint16)((UART_REFCLK / 9600 ) - 1))
|
||||
#define UART_BAUD_14400 ((uint16)((UART_REFCLK / 14400 ) - 1))
|
||||
#define UART_BAUD_19200 ((uint16)((UART_REFCLK / 19200 ) - 1))
|
||||
#define UART_BAUD_28800 ((uint16)((UART_REFCLK / 28800 ) - 1))
|
||||
#define UART_BAUD_38400 ((uint16)((UART_REFCLK / 38400 ) - 1))
|
||||
#define UART_BAUD_57600 ((uint16)((UART_REFCLK / 57600 ) - 1))
|
||||
#define UART_BAUD_115200 ((uint16)((UART_REFCLK / 115200) - 1))
|
||||
#define UART_BAUD_230400 ((uint16)((UART_REFCLK / 230400) - 1))
|
||||
#define UART_BAUD_460800 ((uint16)((UART_REFCLK / 460800) - 1))
|
||||
#define UART_BAUD_921600 ((uint16)((UART_REFCLK / 921600) - 1))
|
||||
|
||||
/* UART MSR register bit definitions */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* lpc214x/lpc214X_lowputc.S
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -92,7 +92,7 @@
|
||||
# error "No CONFIG_UARTn_PARITY Setting"
|
||||
#endif
|
||||
|
||||
#ifdef LPC214X_UART_2STOP != 0
|
||||
#if LPC214X_UART_2STOP != 0
|
||||
# define LPC214X_LCR_STOP LPC214X_LCR_STOP_2
|
||||
#else
|
||||
# define LPC214X_LCR_STOP LPC214X_LCR_STOP_1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* lpc214x/lpc214x_serial.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -82,15 +82,17 @@ struct up_dev_s
|
||||
|
||||
static int up_setup(struct uart_dev_s *dev);
|
||||
static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static int up_interrupt(int irq, void *context);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, uint32 *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, boolean enable);
|
||||
static boolean up_rxfifonotempty(struct uart_dev_s *dev);
|
||||
static boolean up_rxavailable(struct uart_dev_s *dev);
|
||||
static void up_send(struct uart_dev_s *dev, int ch);
|
||||
static void up_txint(struct uart_dev_s *dev, boolean enable);
|
||||
static boolean up_txfifonotfull(struct uart_dev_s *dev);
|
||||
static boolean up_txfifoempty(struct uart_dev_s *dev);
|
||||
static boolean up_txready(struct uart_dev_s *dev);
|
||||
static boolean up_txempty(struct uart_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
@@ -100,15 +102,16 @@ struct uart_ops_s g_uart_ops =
|
||||
{
|
||||
.setup = up_setup,
|
||||
.shutdown = up_shutdown,
|
||||
.handler = up_interrupt,
|
||||
.attach = up_attach,
|
||||
.detach = up_detach,
|
||||
.ioctl = up_ioctl,
|
||||
.receive = up_receive,
|
||||
.rxint = up_rxint,
|
||||
.rxfifonotempty = up_rxfifonotempty,
|
||||
.rxavailable = up_rxavailable,
|
||||
.send = up_send,
|
||||
.txint = up_txint,
|
||||
.txfifonotfull = up_txfifonotfull,
|
||||
.txfifoempty = up_txfifoempty,
|
||||
.txready = up_txready,
|
||||
.txempty = up_txempty,
|
||||
};
|
||||
|
||||
/* I/O buffers */
|
||||
@@ -124,6 +127,7 @@ static struct up_dev_s g_uart0priv =
|
||||
{
|
||||
.uartbase = LPC214X_UART0_BASE,
|
||||
.baud = CONFIG_UART0_BAUD,
|
||||
.irq = LPC214X_UART0_IRQ,
|
||||
.parity = CONFIG_UART0_PARITY,
|
||||
.bits = CONFIG_UART0_BITS,
|
||||
.stopbits2 = CONFIG_UART0_2STOP,
|
||||
@@ -131,7 +135,6 @@ static struct up_dev_s g_uart0priv =
|
||||
|
||||
static uart_dev_t g_uart0port =
|
||||
{
|
||||
.irq = LPC214X_UART0_IRQ,
|
||||
.recv =
|
||||
{
|
||||
.size = CONFIG_UART0_RXBUFSIZE,
|
||||
@@ -152,6 +155,7 @@ static struct up_dev_s g_uart1priv =
|
||||
{
|
||||
.uartbase = LPC214X_UART1_BASE,
|
||||
.baud = CONFIG_UART1_BAUD,
|
||||
.irq = LPC214X_UART1_IRQ,
|
||||
.parity = CONFIG_UART1_PARITY,
|
||||
.bits = CONFIG_UART1_BITS,
|
||||
.stopbits2 = CONFIG_UART1_2STOP,
|
||||
@@ -159,7 +163,6 @@ static struct up_dev_s g_uart1priv =
|
||||
|
||||
static uart_dev_t g_uart1port =
|
||||
{
|
||||
.irq = LPC214X_UART1_IRQ,
|
||||
.recv =
|
||||
{
|
||||
.size = CONFIG_UART1_RXBUFSIZE,
|
||||
@@ -234,10 +237,10 @@ static inline void up_restoreuartint(struct up_dev_s *priv, ubyte ier)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_waittxfifonotfull
|
||||
* Name: up_waittxready
|
||||
****************************************************************************/
|
||||
|
||||
static inline void up_waittxfifonotfull(struct up_dev_s *priv)
|
||||
static inline void up_waittxready(struct up_dev_s *priv)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
@@ -283,7 +286,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, boolean enable)
|
||||
|
||||
static int up_setup(struct uart_dev_s *dev)
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_LPC214X_UART_CONFIG
|
||||
#ifndef CONFIG_SUPPRESS_LPC214X_UART_CONFIG
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
uint16 baud;
|
||||
ubyte lcr;
|
||||
@@ -299,11 +302,11 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
/* Set up the IER */
|
||||
|
||||
priv->ier = up_serialin(priv, LPC214X_UART_IER_OFFSET);
|
||||
|
||||
|
||||
/* Set up the LCR */
|
||||
|
||||
|
||||
lcr = 0;
|
||||
|
||||
|
||||
if (priv->bits == 7)
|
||||
{
|
||||
lcr |= LPC214X_LCR_CHAR_7;
|
||||
@@ -317,7 +320,7 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
{
|
||||
lcr |= LPC214X_LCR_STOP_2;
|
||||
}
|
||||
|
||||
|
||||
if (priv->parity == 1)
|
||||
{
|
||||
lcr |= LPC214X_LCR_PAR_ODD;
|
||||
@@ -328,15 +331,15 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
}
|
||||
|
||||
/* Enter DLAB=1 */
|
||||
|
||||
|
||||
up_serialout(priv, LPC214X_UART_LCR_OFFSET, (lcr | LPC214X_LCR_DLAB_ENABLE));
|
||||
|
||||
|
||||
/* Set the BAUD divisor */
|
||||
|
||||
baud = UART_BAUD(priv->baud);
|
||||
up_serialout(priv, LPC214X_UART_DLM_OFFSET, baud >> 8);
|
||||
up_serialout(priv, LPC214X_UART_DLL_OFFSET, baud & 0xff);
|
||||
|
||||
|
||||
/* Clear DLAB */
|
||||
|
||||
up_serialout(priv, LPC214X_UART_LCR_OFFSET, lcr);
|
||||
@@ -359,6 +362,57 @@ static void up_shutdown(struct uart_dev_s *dev)
|
||||
up_disableuartint(priv, NULL);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_attach
|
||||
*
|
||||
* Description:
|
||||
* Configure the UART to operation in interrupt driven mode. This method is
|
||||
* called when the serial port is opened. Normally, this is just after the
|
||||
* the setup() method is called, however, the serial console may operate in
|
||||
* a non-interrupt driven mode during the boot phase.
|
||||
*
|
||||
* RX and TX interrupts are not enabled when by the attach method (unless the
|
||||
* hardware supports multiple levels of interrupt enabling). The RX and TX
|
||||
* interrupts are not enabled until the txint() and rxint() methods are called.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(struct uart_dev_s *dev)
|
||||
{
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
int ret;
|
||||
|
||||
/* Attach and enable the IRQ */
|
||||
|
||||
ret = irq_attach(priv->irq, up_interrupt);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable the interrupt (RX and TX interrupts are still disabled
|
||||
* in the UART
|
||||
*/
|
||||
|
||||
up_enable_irq(priv->irq);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_detach
|
||||
*
|
||||
* Description:
|
||||
* Detach UART interrupts. This method is called when the serial port is
|
||||
* closed normally just before the shutdown method is called. The exception is
|
||||
* the serial console which is never shutdown.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_detach(struct uart_dev_s *dev)
|
||||
{
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
up_disable_irq(priv->irq);
|
||||
irq_detach(priv->irq);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_interrupt
|
||||
*
|
||||
@@ -379,11 +433,11 @@ static int up_interrupt(int irq, void *context)
|
||||
ubyte status;
|
||||
int passes;
|
||||
|
||||
if (g_uart1port.irq == irq)
|
||||
if (g_uart1priv.irq == irq)
|
||||
{
|
||||
dev = &g_uart1port;
|
||||
}
|
||||
else if (g_uart0port.irq == irq)
|
||||
else if (g_uart0priv.irq == irq)
|
||||
{
|
||||
dev = &g_uart0port;
|
||||
}
|
||||
@@ -548,14 +602,14 @@ static void up_rxint(struct uart_dev_s *dev, boolean enable)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_rxfifonotempty
|
||||
* Name: up_rxavailable
|
||||
*
|
||||
* Description:
|
||||
* Return TRUE if the receive fifo is not empty
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static boolean up_rxfifonotempty(struct uart_dev_s *dev)
|
||||
static boolean up_rxavailable(struct uart_dev_s *dev)
|
||||
{
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
return ((up_serialin(priv, LPC214X_UART_LSR_OFFSET) & LPC214X_LSR_RDR) != 0);
|
||||
@@ -600,28 +654,28 @@ static void up_txint(struct uart_dev_s *dev, boolean enable)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_txfifonotfull
|
||||
* Name: up_txready
|
||||
*
|
||||
* Description:
|
||||
* Return TRUE if the tranmsit fifo is not full
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static boolean up_txfifonotfull(struct uart_dev_s *dev)
|
||||
static boolean up_txready(struct uart_dev_s *dev)
|
||||
{
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
return ((up_serialin(priv, LPC214X_UART_LSR_OFFSET) & LPC214X_LSR_THRE) != 0);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_txfifoempty
|
||||
* Name: up_txempty
|
||||
*
|
||||
* Description:
|
||||
* Return TRUE if the transmit fifo is empty
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static boolean up_txfifoempty(struct uart_dev_s *dev)
|
||||
static boolean up_txempty(struct uart_dev_s *dev)
|
||||
{
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
return ((up_serialin(priv, LPC214X_UART_LSR_OFFSET) & LPC214X_LSR_THRE) != 0);
|
||||
@@ -692,7 +746,7 @@ int up_putc(int ch)
|
||||
ubyte ier;
|
||||
|
||||
up_disableuartint(priv, &ier);
|
||||
up_waittxfifonotfull(priv);
|
||||
up_waittxready(priv);
|
||||
up_serialout(priv, LPC214X_UART_THR_OFFSET, (ubyte)ch);
|
||||
|
||||
/* Check for LF */
|
||||
@@ -701,11 +755,11 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_waittxfifonotfull(priv);
|
||||
up_waittxready(priv);
|
||||
up_serialout(priv, LPC214X_UART_THR_OFFSET, '\r');
|
||||
}
|
||||
|
||||
up_waittxfifonotfull(priv);
|
||||
up_waittxready(priv);
|
||||
up_restoreuartint(priv, ier);
|
||||
return ch;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
############################################################
|
||||
# Makefile
|
||||
############################################################################
|
||||
# arch/c5471/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
#
|
||||
@@ -31,11 +31,10 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS = up_vectors.S up_saveusercontext.S up_fullcontextrestore.S
|
||||
@@ -72,15 +71,14 @@ LIBGCC = ${shell $(CC) -print-libgcc-file-name}
|
||||
all: up_head.o libarch$(LIBEXT)
|
||||
|
||||
$(AOBJS) $(LINKOBJS): %.o: %.S
|
||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS): %.o: %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libarch$(LIBEXT): $(OBJS)
|
||||
( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(call ARCHIVE, $@, $${obj}); \
|
||||
done ; )
|
||||
|
||||
board/libboard$(LIBEXT):
|
||||
@@ -105,9 +103,9 @@ ifeq ($(CONFIG_RRLOAD_BINARY),y)
|
||||
endif
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend
|
||||
touch $@
|
||||
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@$(MAKE) -C board TOPDIR=$(TOPDIR) depend
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
@@ -115,7 +113,8 @@ clean:
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \
|
||||
fi
|
||||
rm -f libarch$(LIBEXT) *.o *~
|
||||
@rm -f libarch$(LIBEXT) *~ .*.swp
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
@if [ -e board/Makefile ]; then \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* up_exit.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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>
|
||||
@@ -49,28 +49,27 @@
|
||||
#include <nuttx/fs.h>
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _up_dumponexit
|
||||
*
|
||||
* Description:
|
||||
* Dump the state of all tasks whenever on task exits. This
|
||||
* is debug instrumentation that was added to check file-
|
||||
* related reference counting but could be useful again
|
||||
* sometime in the future.
|
||||
* Dump the state of all tasks whenever on task exits. This is debug
|
||||
* instrumentation that was added to check file-related reference counting
|
||||
* but could be useful again sometime in the future.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
@@ -113,23 +112,30 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _exit
|
||||
*
|
||||
* Description:
|
||||
* This function causes the currently executing task to cease
|
||||
* to exist. This is a special case of task_delete().
|
||||
* to exist. This is a special case of task_delete() where the task to
|
||||
* be deleted is the currently executing task. It is more complex because
|
||||
* a context switch must be perform to the the next ready to run task.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
_TCB* tcb = (_TCB*)g_readytorun.head;
|
||||
irqstate_t flags = irqsave();
|
||||
_TCB* tcb;
|
||||
|
||||
/* Disable interrupts. They will be restored when the next
|
||||
* task is started.
|
||||
*/
|
||||
|
||||
(void)irqsave();
|
||||
|
||||
lldbg("TCB=%p exitting\n", tcb);
|
||||
|
||||
@@ -138,37 +144,9 @@ void _exit(int status)
|
||||
sched_foreach(_up_dumponexit, NULL);
|
||||
#endif
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list. We can
|
||||
* ignore the return value because we know that a context
|
||||
* switch is needed.
|
||||
*/
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
(void)sched_removereadytorun(tcb);
|
||||
|
||||
/* We are not in a bad stack-- the head of the ready to run task list
|
||||
* does not correspond to the thread that is running. Disabling pre-
|
||||
* emption on this TCB should be enough to keep things stable.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Move the TCB to the specified blocked task list and delete it */
|
||||
|
||||
sched_addblocked(tcb, TSTATE_TASK_INACTIVE);
|
||||
task_delete(tcb->pid);
|
||||
|
||||
/* If there are any pending tasks, then add them to the g_readytorun
|
||||
* task list now
|
||||
*/
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
(void)sched_mergepending();
|
||||
}
|
||||
|
||||
/* Now calling sched_unlock() should have no effect */
|
||||
|
||||
sched_unlock();
|
||||
(void)task_deletecurrent();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
|
||||
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
|
||||
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
|
||||
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
|
||||
#define CONFIG_SUPPRESS_UART_CONFIG 1 /* Do not reconfig UART */
|
||||
#undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */
|
||||
|
||||
/************************************************************
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
############################################################
|
||||
# Makefile
|
||||
############################################################################
|
||||
# arch/dm320/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
#
|
||||
@@ -31,11 +31,10 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS = up_vectors.S up_saveusercontext.S up_fullcontextrestore.S \
|
||||
@@ -70,15 +69,14 @@ LIBGCC = ${shell $(CC) -print-libgcc-file-name}
|
||||
all: up_head.o libarch$(LIBEXT)
|
||||
|
||||
$(AOBJS) $(LINKOBJS): %.o: %.S
|
||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS): %.o: %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libarch$(LIBEXT): $(OBJS)
|
||||
( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(call ARCHIVE, $@, $${obj}); \
|
||||
done ; )
|
||||
|
||||
board/libboard$(LIBEXT):
|
||||
@@ -106,8 +104,8 @@ endif
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
|
||||
if
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
touch $@
|
||||
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
@@ -115,12 +113,13 @@ clean:
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \
|
||||
fi
|
||||
rm -f libarch$(LIBEXT) *.o *~
|
||||
@rm -f libarch$(LIBEXT) *~ .*.swp
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \
|
||||
fi
|
||||
rm -f Make.dep .depend
|
||||
@rm -f Make.dep .depend
|
||||
|
||||
-include Make.dep
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* up_exit.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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>
|
||||
@@ -49,28 +49,27 @@
|
||||
#include <nuttx/fs.h>
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _up_dumponexit
|
||||
*
|
||||
* Description:
|
||||
* Dump the state of all tasks whenever on task exits. This
|
||||
* is debug instrumentation that was added to check file-
|
||||
* related reference counting but could be useful again
|
||||
* sometime in the future.
|
||||
* Dump the state of all tasks whenever on task exits. This is debug
|
||||
* instrumentation that was added to check file-related reference counting
|
||||
* but could be useful again sometime in the future.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
@@ -112,22 +111,24 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _exit
|
||||
*
|
||||
* Description:
|
||||
* This function causes the currently executing task to cease
|
||||
* to exist. This is a special case of task_delete().
|
||||
* to exist. This is a special case of task_delete() where the task to
|
||||
* be deleted is the currently executing task. It is more complex because
|
||||
* a context switch must be perform to the the next ready to run task.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
_TCB* tcb = (_TCB*)g_readytorun.head;
|
||||
_TCB* tcb;
|
||||
|
||||
/* Disable interrupts. They will be restored when the next
|
||||
* task is started.
|
||||
@@ -138,41 +139,13 @@ void _exit(int status)
|
||||
lldbg("TCB=%p exitting\n", tcb);
|
||||
|
||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||
dbg("Other tasks:\n");
|
||||
lldbg("Other tasks:\n");
|
||||
sched_foreach(_up_dumponexit, NULL);
|
||||
#endif
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list. We can
|
||||
* ignore the return value because we know that a context
|
||||
* switch is needed.
|
||||
*/
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
(void)sched_removereadytorun(tcb);
|
||||
|
||||
/* We are not in a bad stack-- the head of the ready to run task list
|
||||
* does not correspond to the thread that is running. Disabling pre-
|
||||
* emption on this TCB should be enough to keep things stable.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Move the TCB to the specified blocked task list and delete it */
|
||||
|
||||
sched_addblocked(tcb, TSTATE_TASK_INACTIVE);
|
||||
task_delete(tcb->pid);
|
||||
|
||||
/* If there are any pending tasks, then add them to the g_readytorun
|
||||
* task list now
|
||||
*/
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
(void)sched_mergepending();
|
||||
}
|
||||
|
||||
/* Now calling sched_unlock() should have no effect */
|
||||
|
||||
sched_unlock();
|
||||
(void)task_deletecurrent();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
|
||||
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
|
||||
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
|
||||
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
|
||||
#define CONFIG_SUPPRESS_UART_CONFIG 1 /* Do not reconfig UART */
|
||||
#define CONFIG_DUMP_ON_EXIT 1 /* Dump task state on exit */
|
||||
|
||||
/************************************************************
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
############################################################
|
||||
# Makefile
|
||||
############################################################################
|
||||
# arch/pjrc-8051/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
#
|
||||
@@ -31,11 +31,10 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
ASFLAGS = -x -j -g -l -s -p
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -D__ASSEMBLY__
|
||||
@@ -109,13 +108,13 @@ STACK_BASE = ${shell \
|
||||
all: up_head$(OBJEXT) libarch$(LIBEXT)
|
||||
|
||||
$(ASRCS) $(LINKASRCS): %$(ASMEXT): %.S
|
||||
$(CPP) -P $(CPPFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
$(CPP) -P $(CPPFLAGS) $< -o $@
|
||||
|
||||
$(AOBJS) $(LINKOBJS): $(ASRCS) $(LINKASRCS)
|
||||
$(AS) $(ASFLAGS) $<
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS) $(TESTOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
# Create a header file that contains addressing information needed by the code
|
||||
|
||||
@@ -148,8 +147,7 @@ up_mem.h: pass1.mem
|
||||
|
||||
libarch$(LIBEXT): up_mem.h $(OBJS)
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $${obj} FAILED!" ; exit 1 ; } ; \
|
||||
$(call ARCHIVE, $@, $${obj}); \
|
||||
done ; )
|
||||
|
||||
# This is a kludge to work around some conflicting symbols in libsdcc.liXqueb
|
||||
@@ -172,19 +170,21 @@ board/libboard$(LIBEXT):
|
||||
# This target builds the final executable
|
||||
|
||||
pass1.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT)
|
||||
$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
||||
@echo "LD: $@"
|
||||
@$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
||||
$(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
|
||||
@rm -f up_mem.h
|
||||
@rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT)
|
||||
@$(MAKE) TOPDIR=$(TOPDIR) libarch$(LIBEXT)
|
||||
|
||||
nuttx.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS)
|
||||
$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
||||
@echo "LD: $@"
|
||||
@$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
||||
$(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
|
||||
|
||||
nuttx$(EXEEXT): pass1.ihx nuttx.ihx
|
||||
@rm -f pass1.*
|
||||
packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT)
|
||||
@packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT)
|
||||
@cp -f nuttx.map $(TOPDIR)/.
|
||||
|
||||
# This target builds a test program to verify interrupt context switching. irqtest is
|
||||
@@ -202,8 +202,8 @@ irqtest:
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
|
||||
fi
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
touch $@
|
||||
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
@@ -211,9 +211,8 @@ clean:
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \
|
||||
fi
|
||||
rm -f libarch$(LIBEXT) up_mem.h
|
||||
rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex *~
|
||||
if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
@rm -f libarch$(LIBEXT) up_mem.h *~ .*.swp
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
@if [ -e board/Makefile ]; then \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* up_exit.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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>
|
||||
@@ -46,34 +46,36 @@
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _exit
|
||||
*
|
||||
* Description:
|
||||
* This function causes the currently executing task to cease
|
||||
* to exist. This is a special case of task_delete().
|
||||
* to exist. This is a special case of task_delete() where the task to
|
||||
* be deleted is the currently executing task. It is more complex because
|
||||
* a context switch must be perform to the the next ready to run task.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
FAR _TCB* tcb = (FAR _TCB*)g_readytorun.head;
|
||||
FAR _TCB* tcb;
|
||||
|
||||
dbg("TCB=%p exitting\n", tcb);
|
||||
|
||||
@@ -83,37 +85,9 @@ void _exit(int status)
|
||||
|
||||
EA = 0;
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list. We can
|
||||
* ignore the return value because we know that a context
|
||||
* switch is needed.
|
||||
*/
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
(void)sched_removereadytorun(tcb);
|
||||
|
||||
/* We are not in a bad stack-- the head of the ready to run task list
|
||||
* does not correspond to the thread that is running. Disabling pre-
|
||||
* emption on this TCB should be enough to keep things stable.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Move the TCB to the specified blocked task list and delete it */
|
||||
|
||||
sched_addblocked(tcb, TSTATE_TASK_INACTIVE);
|
||||
task_delete(tcb->pid);
|
||||
|
||||
/* If there are any pending tasks, then add them to the g_readytorun
|
||||
* task list now
|
||||
*/
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
(void)sched_mergepending();
|
||||
}
|
||||
|
||||
/* Now calling sched_unlock() should have no effect */
|
||||
|
||||
sched_unlock();
|
||||
(void)task_deletecurrent();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
|
||||
@@ -38,10 +38,13 @@
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
############################################################
|
||||
# Makefile
|
||||
############################################################################
|
||||
# arch/sim/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
#
|
||||
@@ -31,11 +31,10 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS = up_setjmp.S
|
||||
@@ -61,9 +60,9 @@ SRCS = $(ASRCS) $(CSRCS) $(SPECSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS) $(SPECOBJS)
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS = -lc
|
||||
STDLIBS = -lc
|
||||
ifeq ($(CONFIG_FS_FAT),y)
|
||||
EXTRA_LIBS += -lz
|
||||
STDLIBS += -lz
|
||||
endif
|
||||
|
||||
LINKOBJS = up_head$(OBJEXT)
|
||||
@@ -74,23 +73,23 @@ LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
||||
all: up_head$(OBJEXT) libarch$(LIBEXT)
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
$(SPECOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(HOSTCFLAGS) $< -o $@
|
||||
|
||||
libarch$(LIBEXT): $(OBJS)
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||
$(call ARCHIVE, $@, $${obj}); \
|
||||
done ; )
|
||||
|
||||
nuttx$(EXEEXT): $(LINKOBJS)
|
||||
$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
||||
-Wl,--start-group $(LDLIBS) -Wl,--end-group $(EXTRA_LIBS)
|
||||
@echo "LD: nuttx$(EXEEXT)"
|
||||
@$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
||||
-Wl,--start-group $(LDLIBS) -Wl,--end-group $(STDLIBS) $(EXTRA_LIBS)
|
||||
@$(NM) $(TOPDIR)/$@ | \
|
||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
sort > $(TOPDIR)/System.map
|
||||
@@ -102,8 +101,8 @@ nuttx$(EXEEXT): $(LINKOBJS)
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
@rm -f libarch$(LIBEXT) *~
|
||||
@if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
@rm -f libarch$(LIBEXT) *~ .*.swp
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
@rm -f Make.dep .depend
|
||||
|
||||
@@ -94,7 +94,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
boolean switch_needed;
|
||||
|
||||
dbg("Blocking TCB=%p\n", tcb);
|
||||
sdbg("Blocking TCB=%p\n", tcb);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list. If we
|
||||
* are blocking the task at the head of the task list (the
|
||||
@@ -134,7 +134,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
||||
*/
|
||||
|
||||
rtcb = (_TCB*)g_readytorun.head;
|
||||
dbg("New Active Task TCB=%p\n", rtcb);
|
||||
sdbg("New Active Task TCB=%p\n", rtcb);
|
||||
|
||||
/* The way that we handle signals in the simulation is kind of
|
||||
* a kludge. This would be unsafe in a truly multi-threaded, interrupt
|
||||
@@ -143,7 +143,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
||||
|
||||
if (rtcb->xcp.sigdeliver)
|
||||
{
|
||||
dbg("Delivering signals TCB=%p\n", rtcb);
|
||||
sdbg("Delivering signals TCB=%p\n", rtcb);
|
||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
||||
rtcb->xcp.sigdeliver = NULL;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef VFAT_STANDALONE
|
||||
# define dbg(format, arg...) printf(format, ##arg)
|
||||
# define sdbg(format, arg...) printf(format, ##arg)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -218,7 +218,7 @@ char *up_deviceimage(void)
|
||||
ret = inflateInit(&strm);
|
||||
if (ret != Z_OK)
|
||||
{
|
||||
dbg("inflateInit FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message" );
|
||||
sdbg("inflateInit FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ char *up_deviceimage(void)
|
||||
case Z_DATA_ERROR:
|
||||
case Z_MEM_ERROR:
|
||||
case Z_STREAM_ERROR:
|
||||
dbg("inflate FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message" );
|
||||
sdbg("inflate FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message" );
|
||||
(void)inflateEnd(&strm);
|
||||
free(pbuffer);
|
||||
return NULL;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* up_exit.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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,75 +45,49 @@
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Public Funtions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _exit
|
||||
*
|
||||
* Description:
|
||||
* This function causes the currently executing task to cease
|
||||
* to exist. This is a special case of task_delete().
|
||||
* to exist. This is a special case of task_delete() where the task to
|
||||
* be deleted is the currently executing task. It is more complex because
|
||||
* a context switch must be perform to the the next ready to run task.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
_TCB* tcb = (_TCB*)g_readytorun.head;
|
||||
_TCB* tcb;
|
||||
|
||||
dbg("TCB=%p exitting\n", tcb);
|
||||
sdbg("TCB=%p exitting\n", tcb);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list. We can
|
||||
* ignore the return value because we know that a context
|
||||
* switch is needed.
|
||||
*/
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
(void)sched_removereadytorun(tcb);
|
||||
|
||||
/* We are not in a bad stack-- the head of the ready to run task list
|
||||
* does not correspond to the thread that is running. Disabling pre-
|
||||
* emption on this TCB should be enough to keep things stable.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Move the TCB to the specified blocked task list and delete it */
|
||||
|
||||
sched_addblocked(tcb, TSTATE_TASK_INACTIVE);
|
||||
task_delete(tcb->pid);
|
||||
|
||||
/* If there are any pending tasks, then add them to the g_readytorun
|
||||
* task list now.
|
||||
*/
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
(void)sched_mergepending();
|
||||
}
|
||||
|
||||
/* Now calling sched_unlock() should have no effect */
|
||||
|
||||
sched_unlock();
|
||||
(void)task_deletecurrent();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
*/
|
||||
|
||||
tcb = (_TCB*)g_readytorun.head;
|
||||
dbg("New Active Task TCB=%p\n", tcb);
|
||||
sdbg("New Active Task TCB=%p\n", tcb);
|
||||
|
||||
/* The way that we handle signals in the simulation is kind of
|
||||
* a kludge. This would be unsafe in a truly multi-threaded, interrupt
|
||||
@@ -122,7 +96,7 @@ void _exit(int status)
|
||||
|
||||
if (tcb->xcp.sigdeliver)
|
||||
{
|
||||
dbg("Delivering signals TCB=%p\n", tcb);
|
||||
sdbg("Delivering signals TCB=%p\n", tcb);
|
||||
((sig_deliver_t)tcb->xcp.sigdeliver)(tcb);
|
||||
tcb->xcp.sigdeliver = NULL;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ void up_release_pending(void)
|
||||
{
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
|
||||
dbg("From TCB=%p\n", rtcb);
|
||||
sdbg("From TCB=%p\n", rtcb);
|
||||
|
||||
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
||||
|
||||
@@ -96,7 +96,7 @@ void up_release_pending(void)
|
||||
*/
|
||||
|
||||
rtcb = (_TCB*)g_readytorun.head;
|
||||
dbg("New Active Task TCB=%p\n", rtcb);
|
||||
sdbg("New Active Task TCB=%p\n", rtcb);
|
||||
|
||||
/* The way that we handle signals in the simulation is kind of
|
||||
* a kludge. This would be unsafe in a truly multi-threaded, interrupt
|
||||
@@ -105,7 +105,7 @@ void up_release_pending(void)
|
||||
|
||||
if (rtcb->xcp.sigdeliver)
|
||||
{
|
||||
dbg("Delivering signals TCB=%p\n", rtcb);
|
||||
sdbg("Delivering signals TCB=%p\n", rtcb);
|
||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
||||
rtcb->xcp.sigdeliver = NULL;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
boolean switch_needed;
|
||||
|
||||
dbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
sdbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return TRUE if we just
|
||||
@@ -146,7 +146,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
||||
*/
|
||||
|
||||
rtcb = (_TCB*)g_readytorun.head;
|
||||
dbg("New Active Task TCB=%p\n", rtcb);
|
||||
sdbg("New Active Task TCB=%p\n", rtcb);
|
||||
|
||||
/* The way that we handle signals in the simulation is kind of
|
||||
* a kludge. This would be unsafe in a truly multi-threaded, interrupt
|
||||
@@ -155,7 +155,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
||||
|
||||
if (rtcb->xcp.sigdeliver)
|
||||
{
|
||||
dbg("Delivering signals TCB=%p\n", rtcb);
|
||||
sdbg("Delivering signals TCB=%p\n", rtcb);
|
||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
||||
rtcb->xcp.sigdeliver = NULL;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <sched.h>
|
||||
#include <nuttx/net.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
@@ -60,7 +61,7 @@
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BUF ((struct uip_eth_hdr *)g_sim_dev.d_buf)
|
||||
#define BUF ((struct ether_header*)g_sim_dev.d_buf)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@@ -106,9 +107,9 @@ void timer_reset(struct timer *t)
|
||||
#ifdef CONFIG_NET_PROMISCUOUS
|
||||
# define up_comparemac(a,b) (0)
|
||||
#else
|
||||
static inline int up_comparemac(struct uip_eth_addr *paddr1, struct uip_eth_addr *paddr2)
|
||||
static inline int up_comparemac(uint8 *paddr1, struct ether_addr *paddr2)
|
||||
{
|
||||
return memcmp(paddr1, paddr2, sizeof(struct uip_eth_addr));
|
||||
return memcmp(paddr1, paddr2->ether_addr_octet, ETHER_ADDR_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -155,14 +156,14 @@ void uipdriver_loop(void)
|
||||
* MAC address
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > UIP_LLH_LEN && up_comparemac( &BUF->dest, &g_sim_dev.d_mac) == 0)
|
||||
if (g_sim_dev.d_len > UIP_LLH_LEN && up_comparemac(BUF->ether_dhost, &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))
|
||||
if (BUF->ether_type == htons(UIP_ETHTYPE_IP6))
|
||||
#else
|
||||
if (BUF->type == htons(UIP_ETHTYPE_IP))
|
||||
if (BUF->ether_type == htons(UIP_ETHTYPE_IP))
|
||||
#endif
|
||||
{
|
||||
uip_arp_ipin();
|
||||
@@ -179,7 +180,7 @@ void uipdriver_loop(void)
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(UIP_ETHTYPE_ARP))
|
||||
else if (BUF->ether_type == htons(UIP_ETHTYPE_ARP))
|
||||
{
|
||||
uip_arp_arpin(&g_sim_dev);
|
||||
|
||||
@@ -201,7 +202,7 @@ void uipdriver_loop(void)
|
||||
else if (timer_expired(&g_periodic_timer))
|
||||
{
|
||||
timer_reset(&g_periodic_timer);
|
||||
uip_poll(&g_sim_dev, sim_uiptxpoll, 1);
|
||||
uip_timer(&g_sim_dev, sim_uiptxpoll, 1);
|
||||
}
|
||||
sched_unlock();
|
||||
}
|
||||
@@ -212,7 +213,7 @@ int uipdriver_init(void)
|
||||
|
||||
timer_set(&g_periodic_timer, 500);
|
||||
tapdev_init();
|
||||
(void)tapdev_getmacaddr(g_sim_dev.d_mac.addr);
|
||||
(void)tapdev_getmacaddr(g_sim_dev.d_mac.ether_addr_octet);
|
||||
|
||||
/* Register the device with the OS so that socket IOCTLs can be performed */
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
|
||||
{
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
|
||||
dbg("Unblocking TCB=%p\n", tcb);
|
||||
sdbg("Unblocking TCB=%p\n", tcb);
|
||||
|
||||
/* Remove the task from the blocked task list */
|
||||
|
||||
@@ -124,7 +124,7 @@ void up_unblock_task(_TCB *tcb)
|
||||
*/
|
||||
|
||||
rtcb = (_TCB*)g_readytorun.head;
|
||||
dbg("New Active Task TCB=%p\n", rtcb);
|
||||
sdbg("New Active Task TCB=%p\n", rtcb);
|
||||
|
||||
/* The way that we handle signals in the simulation is kind of
|
||||
* a kludge. This would be unsafe in a truly multi-threaded, interrupt
|
||||
@@ -133,7 +133,7 @@ void up_unblock_task(_TCB *tcb)
|
||||
|
||||
if (rtcb->xcp.sigdeliver)
|
||||
{
|
||||
dbg("Delivering signals TCB=%p\n", rtcb);
|
||||
sdbg("Delivering signals TCB=%p\n", rtcb);
|
||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
||||
rtcb->xcp.sigdeliver = NULL;
|
||||
}
|
||||
|
||||
80
arch/z16/include/arch.h
Normal file
80
arch/z16/include/arch.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* arch/arch.h
|
||||
*
|
||||
* Copyright (C) 2008 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 nameNuttX 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* This file should never be included directed but, rather,
|
||||
* only indirectly through nuttx/arch.h
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_ARCH_H
|
||||
#define __ARCH_ARCH_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Inline functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARCH_H */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user