Compare commits

...

23 Commits

Author SHA1 Message Date
patacongo
07475ddcaf Prepare for 0.9.10 release
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@751 42af7a65-404d-4744-a932-0658087f49c3
2008-05-15 10:51:14 +00:00
patacongo
4daf380c0c Fix important task shutdown bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@750 42af7a65-404d-4744-a932-0658087f49c3
2008-05-15 10:50:29 +00:00
patacongo
52ca776537 Document compiler error
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@749 42af7a65-404d-4744-a932-0658087f49c3
2008-03-24 23:54:58 +00:00
patacongo
c93316bf89 Fix access to ez80 I/O address space
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@748 42af7a65-404d-4744-a932-0658087f49c3
2008-03-23 21:22:19 +00:00
patacongo
ab876969dd Implement irqsave/restore
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@747 42af7a65-404d-4744-a932-0658087f49c3
2008-03-23 17:58:08 +00:00
patacongo
536a458525 First clean ez80 compile & link
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@746 42af7a65-404d-4744-a932-0658087f49c3
2008-03-23 16:05:22 +00:00
patacongo
7caf0ae3b6 Add low UART init logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@745 42af7a65-404d-4744-a932-0658087f49c3
2008-03-23 14:50:18 +00:00
patacongo
0125c5989f Add timer logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@744 42af7a65-404d-4744-a932-0658087f49c3
2008-03-23 14:11:49 +00:00
patacongo
ec531944df Add timer definitions
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@743 42af7a65-404d-4744-a932-0658087f49c3
2008-03-23 13:16:11 +00:00
patacongo
5b5b6af723 Do not call open/close_peripheraldevice. That ties in too closely to ZiLOG's psuedo-OS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@742 42af7a65-404d-4744-a932-0658087f49c3
2008-03-22 22:37:46 +00:00
patacongo
cc67653244 Need more flexibility in defining the heap region
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@741 42af7a65-404d-4744-a932-0658087f49c3
2008-03-22 22:37:04 +00:00
patacongo
8b84d88550 First cat at ez80 serial logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@740 42af7a65-404d-4744-a932-0658087f49c3
2008-03-22 21:19:29 +00:00
patacongo
7984beaa4b More ez80 files compile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@739 42af7a65-404d-4744-a932-0658087f49c3
2008-03-18 01:40:12 +00:00
patacongo
976ff7a822 Added EZ80 files
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@738 42af7a65-404d-4744-a932-0658087f49c3
2008-03-16 23:36:25 +00:00
patacongo
6cf70e0e2a Fix compile error
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@737 42af7a65-404d-4744-a932-0658087f49c3
2008-03-16 21:08:24 +00:00
patacongo
71105edc9f First cut at ez80 boot logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@736 42af7a65-404d-4744-a932-0658087f49c3
2008-03-16 00:06:05 +00:00
patacongo
7b5c4e515b Add ez80f0910200kitg configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@735 42af7a65-404d-4744-a932-0658087f49c3
2008-03-15 20:04:06 +00:00
patacongo
8d31154e34 Add ez80f910200kitg configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@734 42af7a65-404d-4744-a932-0658087f49c3
2008-03-15 20:00:23 +00:00
patacongo
bb2a525bac Fix z8f6423 link error
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@733 42af7a65-404d-4744-a932-0658087f49c3
2008-03-11 00:36:08 +00:00
patacongo
990820d579 Fixed of Z8F6423 -- still doesn't like correctly
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@732 42af7a65-404d-4744-a932-0658087f49c3
2008-03-10 23:37:56 +00:00
patacongo
12dea795b3 Add configuration for z8f64200100kit boar
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@731 42af7a65-404d-4744-a932-0658087f49c3
2008-03-10 23:15:47 +00:00
patacongo
460aa35bb4 Adding ez80 support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@730 42af7a65-404d-4744-a932-0658087f49c3
2008-03-09 19:59:46 +00:00
patacongo
b1234a6bda EZ80 support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@729 42af7a65-404d-4744-a932-0658087f49c3
2008-03-09 19:56:37 +00:00
66 changed files with 8185 additions and 83 deletions

View File

@@ -347,6 +347,12 @@
Ubuntu where /bin/sh is a link to dash.
* Z8Encore! port verified on ZDS-II instruction set/chip simulator.
0.3.10 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
0.3.10 2008-05-15 Gregory Nutt <spudmonkey@racsa.co.cr>
* Add support for the ZiLOG EZ80Acclaim microcontrooler (EZ80F91 chip).
* Add configuration for the ZiLOG z8f64200100kit development kit, Z8F6423 part.
* Add configuration for the ZiLOG ez80f0910200kitg development kit, EZ80F091 part.
* Correct critical list handling errors in task shutdown logic: One in timer
deletion logic (timer_delete.c) and one in stream logic (lib_init.c).
0.3.11 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>

View File

@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
<p>Last Updated: March 9, 2008</p>
<p>Last Updated: May 15, 2008</p>
</td>
</tr>
</table>
@@ -456,7 +456,7 @@
</table>
<p>
The 21st release of NuttX (nuttx-0.3.9) is available for download
The 22nd release of NuttX (nuttx-0.3.11) is available for download
from the <a href="http://sourceforge.net/project/showfiles.php?group_id=189573">SourceForge</a>
website.
The change log associated with the release is available <a href="#currentrelease">here</a>.
@@ -464,13 +464,17 @@
These unreleased changes are listed <a href="#pendingchanges">here</a>.
</p>
<p>
nuttx-0.3.8 is a minor feature enhancement release.
This release includes support for the ZiLOG Z8Encore! microcontroller.
Also included is the initial framework for support for the Z80,
<a href="http://www.tim-mann.org/xtrs.html">XTRS</a> platform.
nuttx-0.3.10 is an important bug fix release.
This release incorporates fixes to correct critical list handling errors
in task shutdown logic: One in timer deletion logic (timer_delete.c) and one
in stream logic (lib_init.c).
</p>
<p>
Additional, minor enhancements includes support to ZiLOG EZ80Acclaim
microcontrooler (EZ80F91 chip) and configurations fot the ZiLOG z8f64200100kit (Z8F6423)
and ez80f0910200kitg (EZ80F091) development kit.
</p>
<p>
This released has been verified only on the ZiLOG ZDS-II Z8Encore! chip simulation.
As usual, any feedback about bugs or suggestions for improvement would be greatly appreciated.
</p>
@@ -605,6 +609,27 @@
</p>
</td>
</tr>
<tr>
<td valign="top"><img src="favicon.ico"></td>
<td bgcolor="#5eaee1">
<b>Zilog eZ80Acclaim!</b>
</td>
</tr>
<tr>
<td><br></td>
<td>
<p>
<b>Zilog eZ80Acclaim! Microncontroller</b>.
This port uses the ZiLOG ez80f0910200kitg development kit, eZ80F091 part
and the Zilog ZDS-II Windows command line tools.
The development environment is Cygwin under WinXP.
</p>
<p>
<b>STATUS:</b>
This is a work in progress. Verified ez80 support will be announced in a future NuttX release.
</p>
</td>
</tr>
<tr>
<td valign="top"><img src="favicon.ico"></td>
<td bgcolor="#5eaee1">
@@ -616,13 +641,20 @@
<td>
<p>
<b>Zilog Z8Encore! Microncontroller</b>.
This port use the Zilog z8encore000zco development kit, Z8F6403 part, and the Zilog
ZDS-II Windows command line tools.
This port uses the either:
</p>
<ul>
<li>Zilog z8encore000zco development kit, Z8F6403 part, or</li>
<li>Zilog z8f64200100kit development kit, Z8F6423 part</li>
</ul>
<p>
and the Zilog ZDS-II Windows command line tools.
The development environment is Cygwin under WinXP.
</p>
<p>
<b>STATUS:</b>
This released has been verified only on the ZiLOG ZDS-II Z8Encore! chip simulation.
This release has been verified only on the ZiLOG ZDS-II Z8Encore! chip simulation
as of nuttx-0.3.9.
</p>
</td>
</tr>
@@ -941,18 +973,13 @@ Other memory:
</table>
<pre><ul>
nuttx-0.3.9 2008-03-09 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
nuttx-0.3.10 2008-05-15 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Began adding support for the ZiLOG Z8Encore! microcontroller for the Z8Encore000ZCO
development board and the Z8F6403 part.
* Fix broken 'clean' target on z80sim configurations
* Re-structure arch/z80 to provide support for all ZiLOG 8-bit microcontrollers (ez8
in particular for now).
* Add support for TRS80-Model 3 based on the xtrs emulation (http://www.tim-mann.org/xtrs.html)
Per patch from Jacques Pelletier.
* In all shell scripts, change #!/bin/sh to #!/bin/bash to resolve problems in
Ubuntu where /bin/sh is a link to dash.
* Z8Encore! port verified on ZDS-II instruction set/chip simulator.
* Add support for the ZiLOG EZ80Acclaim microcontrooler (EZ80F91 chip).
* Add configuration for the ZiLOG z8f64200100kit development kit, Z8F6423 part.
* Add configuration for the ZiLOG ez80f0910200kitg development kit, EZ80F091 part.
* Correct critical list handling errors in task shutdown logic: One in timer
deletion logic (timer_delete.c) and one in stream logic (lib_init.c).
pascal-0.1.2 2008-02-10 Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -978,7 +1005,7 @@ buildroot-0.1.0 2007-03-09 &lt;spudmonkey@racsa.co.cr&gt
</table>
<pre><ul>
nuttx-0.3.10 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
nuttx-0.3.11 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
pascal-0.1.3 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;

View File

@@ -16,7 +16,7 @@
</b></big></h1>
<p><small>by</small></p>
<p>Gregory Nutt</p>
<p><small>Last Update: February 15, 2008</small></p>
<p><small>Last Update: March 15, 2008</small></p>
</center>
<center><h1>Table of Contents</h1></center>
@@ -431,7 +431,7 @@
<li><code>arch/z80</code>:
This directory holds 8-bit ZiLOG architectures. At present, this includes the
Zilog z80 and z8Encore! Microcontrollers.
Zilog z80, ez80Acclaim! and z8Encore! Microcontrollers.
<ul>
<li><code>arch/z80/include</code> and <code>arch/z80/src/common</code>:
Common logic.
@@ -446,11 +446,18 @@
(verified with version 2.6.0 and 2.7.0).
</li>
<li><code>arch/z80/include/ez80</code> and <code>arch/z80/src/ez80</code>:
The ez80Acclaim! port uses the ZiLOG ez80f0910200kitg development kit, eZ80F091 part,
with the Zilog ZDS-II Windows command line tools.
The development environment is Cygwin under WinXP.
This is a work in progress. Verified ez80 support will be announced in a future NuttX release.
</li>
<li><code>arch/z80/include/z8</code> and <code>arch/z80/src/z8</code>:
The Z8Encore! port use the Zilog z8encore000zco
development kit, Z8F6403 part, and the Zilog ZDS-II Windows command line
The Z8Encore! port uses either the ZiLOG z8encore000zco development kit, Z8F6403 part,
or the z8f64200100kit development kit, Z8F6423 part with the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
This port is in progress and will be released in a future NuttX release.
The initial release, verified only on the ZDS-II ez8 simulator, was released in nuttx-0.3.9.
</li>
</ul>
</li>
@@ -650,12 +657,24 @@
The development environment is Cygwin under WinXP.
</li>
<li><code>configs/ez80f0910200kitg</code>
ez80Acclaim! Microcontroller. This port use the Zilog ez80f0910200kitg
development kit, eZ80F091 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
</li>
<li><code>configs/z8encore000zco</code>
z8Encore! Microcontroller. This port use the Zilog z8encore000zco
development kit, Z8F6403 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
</li>
<li><code>configs/z8encore000zco</code>
z8Encore! Microcontroller. This port use the Zilog z8f64200100kit
development kit, Z8F6423 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
</li>
<li><code>configs/z80sim</code>:
z80 Microcontroller. This port uses a Z80 instruction set simulator.
That simulator can be found in the NuttX CVS

View File

@@ -441,3 +441,15 @@ This released has been verified only on the ZiLOG ZDS-II Z8Encore!
chip simulation.
This tarball contains a complete CVS snapshot from March 9, 2008.
nuttx-0.3.10
^^^^^^^^^^^^
This is the 22nd release of NuttX. This is an important bug fix release.
This release incorporates fixes to correct critical list handling errors
in task shutdown logic: One in timer deletion logic (timer_delete.c) and one
in stream logic (lib_init.c). This release also includes support to ZiLOG EZ80Acclaim
microcontrooler (EZ80F91 chip) and configurations fot the ZiLOG z8f64200100kit (Z8F6423)
and ez80f0910200kitg (EZ80F091) development kit.

View File

@@ -0,0 +1,77 @@
/****************************************************************************
* arch/ez80/arch.h
* arch/chip/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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* This file should never be included directed but, rather,
* only indirectly through nuttx/arch.h (via arch/arch.h)
*/
#ifndef __ARCH_EZ80_ARCH_H
#define __ARCH_EZ80_ARCH_H
/****************************************************************************
* Included Files
****************************************************************************/
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* 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_EZ80_ARCH_H */

View File

@@ -0,0 +1,87 @@
/****************************************************************************
* arch/z80/include/ez80/io.h
* arch/chip/io.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* This file should never be included directed but, rather, only indirectly
* through arch/io.h
*/
#ifndef __ARCH_EZ80_IO_H
#define __ARCH_EZ80_IO_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <sys/types.h>
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Inline functions
****************************************************************************/
/****************************************************************************
* Public Variables
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
EXTERN void outp(uint16 p, ubyte c);
EXTERN ubyte inp(uint16 p);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __ARCH_EZ80_IO_H */

258
arch/z80/include/ez80/irq.h Normal file
View File

@@ -0,0 +1,258 @@
/****************************************************************************
* arch/ez80/include/ez80/irq.h
* arch/chip/irq.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* This file should never be included directed but, rather,
* only indirectly through nuttx/irq.h (via arch/irq.h)
*/
#ifndef __ARCH_EZ80_IRQ_H
#define __ARCH_EZ80_IRQ_H
#ifndef _EZ80F91
# error "Only the EZ80F91 is currently supported"
#endif
/****************************************************************************
* Included Files
****************************************************************************/
/****************************************************************************
* Definitions
****************************************************************************/
/* ez80 Interrupt Numbers ***************************************************/
#define EZ80_EMACRX_IRQ (0) /* Vector 0x40 */
#define EZ80_EMACTX_IRQ (1) /* Vector 0x44 */
#define EZ80_EMACSYS_IRQ (2) /* Vector 0x48 */
#define EZ80_PLL_IRQ (3) /* Vector 0x4c */
#define EZ80_FLASH_IRQ (4) /* Vector 0x50 */
#define EZ80_TIMER0_IRQ (5) /* Vector Ox54 */
#define EZ80_TIMER1_IRQ (6) /* Vector Ox58 */
#define EZ80_TIMER2_IRQ (7) /* Vector Ox5c */
#define EZ80_TIMER3_IRQ (8) /* Vector Ox60 */
#define EZ80_RTC_IRQ (9) /* Vector Ox6C */
#define EZ80_UART0_IRQ (10) /* Vector Ox70 */
#define EZ80_UART1_IRQ (11) /* Vector Ox74 */
#define EZ80_I2C_IRQ (12) /* Vector Ox78 */
#define EZ80_SPI_IRQ (13) /* Vector Ox7c */
#define EZ80_PORTA0_IRQ (14) /* Vector Ox80 */
#define EZ80_PORTA1_IRQ (15) /* Vector Ox84 */
#define EZ80_PORTA2_IRQ (16) /* Vector Ox88 */
#define EZ80_PORTA3_IRQ (17) /* Vector Ox8c */
#define EZ80_PORTA4_IRQ (18) /* Vector Ox90 */
#define EZ80_PORTA5_IRQ (19) /* Vector Ox94 */
#define EZ80_PORTA6_IRQ (20) /* Vector Ox98 */
#define EZ80_PORTA7_IRQ (21) /* Vector Ox9c */
#define EZ80_PORTB0_IRQ (22) /* Vector Oxa0 */
#define EZ80_PORTB1_IRQ (23) /* Vector Oxa4 */
#define EZ80_PORTB2_IRQ (24) /* Vector Oxa8 */
#define EZ80_PORTB3_IRQ (25) /* Vector Oxac */
#define EZ80_PORTB4_IRQ (26) /* Vector Oxb0 */
#define EZ80_PORTB5_IRQ (27) /* Vector Oxb4 */
#define EZ80_PORTB6_IRQ (28) /* Vector Oxb8 */
#define EZ80_PORTB7_IRQ (29) /* Vector Oxbc */
#define EZ80_PORTC0_IRQ (30) /* Vector Oxc0 */
#define EZ80_PORTC1_IRQ (31) /* Vector Oxc4 */
#define EZ80_PORTC2_IRQ (32) /* Vector Oxc8 */
#define EZ80_PORTC3_IRQ (33) /* Vector Oxcc */
#define EZ80_PORTC4_IRQ (34) /* Vector Oxd0 */
#define EZ80_PORTC5_IRQ (35) /* Vector Oxd4 */
#define EZ80_PORTC6_IRQ (36) /* Vector Oxd8 */
#define EZ80_PORTC7_IRQ (37) /* Vector Oxdc */
#define EZ80_PORTD0_IRQ (38) /* Vector Oxe0 */
#define EZ80_PORTD1_IRQ (39) /* Vector Oxe4 */
#define EZ80_PORTD2_IRQ (40) /* Vector Oxe8 */
#define EZ80_PORTD3_IRQ (41) /* Vector Oxec */
#define EZ80_PORTD4_IRQ (42) /* Vector Oxf0 */
#define EZ80_PORTD5_IRQ (43) /* Vector Oxf4 */
#define EZ80_PORTD6_IRQ (44) /* Vector Oxf8 */
#define EZ80_PORTD7_IRQ (45) /* Vector Oxfc */
#define NR_IRQS (46)
#define EZ80_IRQ_SYSTIMER EZ80_TIMER0_IRQ
/* IRQ Management Macros ****************************************************/
/* IRQ State Save Format ****************************************************
*
* These indices describe how the ez8 context is save in the state save array
*
* Byte offsets:
*/
/* IRQ Stack Frame Format
*
* This stack frame is created on each interrupt. These registers are stored
* in the TCB to many context switches.
*/
/* chipreg_t indices */
#define XCPT_I (0) /* Index 0: 16-bit interrupt vector register */
#define XCPT_BC (1) /* Index 1: Saved 16-bit BC register */
#define XCPT_DE (2) /* Index 2: Saved 16-bit DE register */
#define XCPT_IX (3) /* Index 3: Saved 16-bit IX register */
#define XCPT_IY (4) /* Index 4: Saved 16-bit IY register */
#define XCPT_SP (5) /* Index 5: Saved 16-bit SP at time of interrupt */
#define XCPT_HL (6) /* Index 6: Saved 16-bit HL register */
#define XCPT_AF (7) /* Index 7: Saved 16-bit AF register */
#define XCPT_PC (8) /* Index 8: Offset to 16-bit PC at time of interrupt */
#define XCPTCONTEXT_REGS (9)
#ifdef CONFIG_EZ80_Z80MODE
/* Byte offsets */
# define XCPT_I_OFFSET (2*XCPT_I) /* Offset 0: 16-bit interrupt vector register */
# define XCPT_IF_OFFSET (2*XCPT_I+0) /* Offset 1: Saved flags. P set if interrupts enabled */
# define XCPT_IA_OFFSET (2*XCPT_I+1) /* Offset 2: Saved lower 8-bits of interrupt vector register */
# define XCPT_BC_OFFSET (2*XCPT_BC) /* Offset 2: Saved 16-bit BC register */
# define XCPT_C_OFFSET (2*XCPT_BC+0) /* Offset 2: Saved 8-bit C register */
# define XCPT_B_OFFSET (2*XCPT_BC+1) /* Offset 3: Saved 8-bit D register */
# define XCPT_DE_OFFSET (2*XCPT_DE) /* Offset 4: Saved 16-bit DE register */
# define XCPT_E_OFFSET (2*XCPT_DE+0) /* Offset 4: Saved 8-bit E register */
# define XCPT_D_OFFSET (2*XCPT_DE+1) /* Offset 5: Saved 8-bit D register */
# define XCPT_IX_OFFSET (2*XCPT_IX) /* Offset 6: Saved 16-bit IX register */
# define XCPT_IY_OFFSET (2*XCPT_IY) /* Offset 8: Saved 16-bit IY register */
# define XCPT_SP_OFFSET (2*XCPT_SP) /* Offset 10: Saved 16-bit SP at time of interrupt */
# define XCPT_HL_OFFSET (2*XCPT_HL) /* Offset 12: Saved 16-bit HL register */
# define XCPT_L_OFFSET (2*XCPT_HL+0) /* Offset 12: Saved 8-bit L register */
# define XCPT_H_OFFSET (2*XCPT_HL+1) /* Offset 13: Saved 8-bit H register */
# define XCPT_AF_OFFSET (2*XCPT_AF) /* Offset 14: Saved 16-bit AF register */
# define XCPT_F_OFFSET (2*XCPT_AF+0) /* Offset 14: Saved flags */
# define XCPT_A_OFFSET (2*XCPT_AF+1) /* Offset 15: Saved 8-bit A register */
# define XCPT_PC_OFFSET (2*XCPT_PC) /* Offset 16: Offset to 16-bit PC at time of interrupt */
# define XCPTCONTEXT_SIZE (2*XCPTCONTEXT_REGS)
#else
/* Byte offsets */
# define XCPT_I_OFFSET (3*XCPT_I) /* Offset 0: Saved 24-bit interrupt vector register */
# define XCPT_IF_OFFSET (2*XCPT_I+1) /* Offset 1: Saved flags. P set if interrupts enabled */
# define XCPT_IA_OFFSET (2*XCPT_I+2) /* Offset 2: Saved lower 8-bits of interrupt vector register */
# define XCPT_BC_OFFSET (3*XCPT_BC) /* Offset 3: Saved 24-bit BC register */
# define XCPT_C_OFFSET (3*XCPT_BC+1) /* Offset 4: Saved 8-bit C register */
# define XCPT_B_OFFSET (3*XCPT_BC+2) /* Offset 5: Saved 8-bit D register */
# define XCPT_DE_OFFSET (3*XCPT_DE) /* Offset 6: Saved 24-bit DE register */
# define XCPT_E_OFFSET (3*XCPT_DE+1) /* Offset 7: Saved 8-bit E register */
# define XCPT_D_OFFSET (3*XCPT_DE+2) /* Offset 8: Saved 8-bit D register */
# define XCPT_IX_OFFSET (3*XCPT_IX) /* Offset 9: Saved 24-bit IX register */
# define XCPT_IY_OFFSET (3*XCPT_IY) /* Offset 12: Saved 24-bit IY register */
# define XCPT_SP_OFFSET (3*XCPT_SP) /* Offset 15: Saved 24-bit SP at time of interrupt */
# define XCPT_HL_OFFSET (3*XCPT_HL) /* Offset 18: Saved 24-bit HL register */
# define XCPT_L_OFFSET (3*XCPT_HL+1) /* Offset 19: Saved 8-bit L register */
# define XCPT_H_OFFSET (3*XCPT_HL+2) /* Offset 20: Saved 8-bit H register */
# define XCPT_AF_OFFSET (3*XCPT_AF) /* Offset 21: Saved AF register */
# define XCPT_F_OFFSET (3*XCPT_AF+1) /* Offset 22: Saved AF register */
# define XCPT_A_OFFSET (3*XCPT_AF+2) /* Offset 23: Saved 8-bit A register */
# define XCPT_PC_OFFSET (3*XCPT_PC) /* Offset 24: Offset to 24-bit PC at time of interrupt */
# define XCPTCONTEXT_SIZE (3*XCPTCONTEXT_REGS)
#endif
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/* This is the type of the register save array */
#ifdef CONFIG_EZ80_Z80MODE
typedef uint16 chipreg_t;
#else
typedef uint24 chipreg_t;
#endif
/* This struct defines the way the registers are stored. */
struct xcptcontext
{
/* Register save area */
chipreg_t regs[XCPTCONTEXT_REGS];
/* The following function pointer is non-zero if there
* are pending signals to be processed.
*/
#ifndef CONFIG_DISABLE_SIGNALS
CODE void *sigdeliver; /* Actual type is sig_deliver_t */
/* The following retains that state during signal execution */
chipreg_t saved_pc; /* Saved return address */
chipreg_t saved_irqctl; /* Saved interrupt state */
#endif
};
#endif
/****************************************************************************
* Inline functions
****************************************************************************/
/****************************************************************************
* Public Variables
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
EXTERN irqstate_t irqsave(void);
EXTERN void irqrestore(irqstate_t flags);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __ARCH_EZ80_IRQ_H */

View File

@@ -0,0 +1,95 @@
/****************************************************************************
* arch/z80/include/ez80/types.h
* include/arch/chip/types.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 name Gregory Nutt nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* This file should never be included directed but, rather, only indirectly
* through sys/types.h
*/
#ifndef __ARCH_CHIP_TYPES_H
#define __ARCH_CHIP_TYPES_H
/****************************************************************************
* Included Files
****************************************************************************/
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Type Declarations
****************************************************************************/
#ifndef __ASSEMBLY__
/* These are the sizes of the types supported by the ZiLOG Z8Encore! compiler:
*
* int - 24-bits
* short - 16-bits
* long - 32-bits
* char - 8-bits
* float - 32-bits
*
* Pointers:
*
* Z80 mode - 16 bits
* ADL mode - 24 bits
*/
typedef char sbyte;
typedef unsigned char ubyte;
typedef unsigned char uint8;
typedef unsigned char boolean;
typedef short sint16;
typedef unsigned short uint16;
typedef int sint24;
typedef unsigned int uint24;
typedef long sint32;
typedef unsigned long uint32;
/* This is the size of the interrupt state save returned by irqsave().
* It holds the AF regiser pair + a zero pad byte
*/
typedef uint24 irqstate_t;
#endif /* __ASSEMBLY__ */
/****************************************************************************
* Global Function Prototypes
****************************************************************************/
#endif /* __ARCH_CHIP_TYPES_H */

View File

@@ -45,12 +45,17 @@ LDFLAGS = @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}"
############################################################################
# Files and directories
HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT))
ifneq ($(HEAD_SSRC),)
HEAD_GENSRC = $(HEAD_SSRC:.S=$(ASMEXT))
HEAD_AOBJ = $(HEAD_SSRC:.S=$(OBJEXT))
else
HEAD_AOBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
endif
SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS)
ASRCS = $(SSRCS:.S=$(ASMEXT))
AOBJS = $(SSRCS:.S=$(OBJEXT))
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
GENSRCS = $(SSRCS:.S=$(ASMEXT))
AOBJS = $(SSRCS:.S=$(OBJEXT)) $(ASRCS:$(ASMEXT)=$(OBJEXT))
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
COBJS = $(CSRCS:.c=$(OBJEXT))
@@ -66,13 +71,13 @@ VPATH = chip:common
# Targets
all: $(HEAD_OBJ) libarch$(LIBEXT)
$(ASRCS) $(HEAD_ASRC): %$(ASMEXT): %.S
$(HEAD_GENSRC) $(GENSRCS) : %$(ASMEXT): %.S
@$(CPP) $(CPPFLAGS) $< -o $@.tmp
@cat $@.tmp | sed -e "s/^#/;/g" > $@
@rm $@.tmp
$(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %$(ASMEXT)
$(call ASSEMBLE, $<, $@)
$(call ASSEMBLE, `cygpath -w $<`, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, `cygpath -w $<`, $@)
@@ -101,10 +106,18 @@ ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y)
@echo " \"${shell cygpath -w $(ZDSZILOGLIBDIR)/zsldevinitdummy$(LIBEXT)}\"" >>nuttx.linkcmd
endif
ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y)
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/fpdumyLD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/chelpD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/csioLDD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/zsldevinitdummy.lib$(LIBEXT)}\" \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/crtLDD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/fpdumyLD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSZILOGLIBDIR)/csioLDD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSZILOGLIBDIR)/zsldevinitdummy$(LIBEXT)}\"" >>nuttx.linkcmd
endif
ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y)
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/chelp$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/crt$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/fplib$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSZILOGLIBDIR)/gpio$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSZILOGLIBDIR)/uartf91$(LIBEXT)}\"" >>nuttx.linkcmd
endif
nuttx$(EXEEXT): $(HEAD_AOBJ) board/libboard$(LIBEXT) nuttx.linkcmd

View File

@@ -47,40 +47,27 @@
#include "up_arch.h"
#include "up_internal.h"
#ifdef SDCC
/* For the SDCC toolchain, the arch/z80/src/Makefile will parse the map file
* to determin how much memory is available for the heap. This parsed data
* to determine how much memory is available for the heap. This parsed data
* is provided via the auto-generated file up_mem.h
*/
#ifdef SDCC
# include "up_mem.h"
#else
/* For other toolchains, the architecture must provide a header file in the
* chip subdirectory to provide the heap parameters (if they are not defined
* in the configuration file )
*/
# include "chip/up_mem.h"
#endif
/****************************************************************************
* Definitions
****************************************************************************/
/* For the ZiLOG ZDS-II toolchain(s), the heap will be set using linker-
* defined values:
*
* far_heapbot : set to the offset to the first unused value in EDATA
* far_stacktop : set to the highest address in EDATA
*
* The top of the heap is then determined by the amount of stack setaside
* in the NuttX configuration file
*/
#ifdef __ZILOG__
# ifndef CONFIG_HEAP1_BASE
extern far unsigned long far_heapbot;
# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot)
# endif
# ifndef CONFIG_HEAP1_END
extern far unsigned long far_stacktop;
# define CONFIG_HEAP1_END (((uint16)&far_stacktop) - CONFIG_PROC_STACK_SIZE + 1)
# endif
#endif
/****************************************************************************
* Private Data
****************************************************************************/

View File

@@ -0,0 +1,54 @@
############################################################################
# arch/z80/src/ez80/Make.defs
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
HEAD_ASRC = ez80_vectors.asm
HEAD_SSRC =
CMN_SSRCS =
CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \
up_releasestack.c up_interruptcontext.c up_blocktask.c \
up_unblocktask.c up_exit.c up_releasepending.c \
up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c \
up_mdelay.c up_udelay.c up_usestack.c
CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_irqsave.asm \
ez80_saveusercontext.asm ez80_restorecontext.asm
ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y)
CHIP_ASRCS += ez80f91_init.asm
endif
CHIP_SSRCS =
CHIP_CSRCS = ez80_initialstate.c ez80_irq.c ez80_copystate.c \
ez80_schedulesigaction.c ez80_sigdeliver.c ez80_timerisr.c \
ez80_lowuart.c ez80_serial.c ez80_registerdump.c

272
arch/z80/src/ez80/chip.h Normal file
View File

@@ -0,0 +1,272 @@
/************************************************************************************
* arch/z80/src/ez80/chip.h
* arch/z80/src/chip/chip.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __EZ80_CHIP_H
#define __EZ80_CHIP_H
/************************************************************************************
* Included Files
************************************************************************************/
/************************************************************************************
* Definitions
************************************************************************************/
/* Bits in the Z80 FLAGS register ***************************************************/
#define EZ80_C_FLAG 0x01 /* Bit 0: Carry flag */
#define EZ80_N_FLAG 0x02 /* Bit 1: Add/Subtract flag */
#define EZ80_PV_FLAG 0x04 /* Bit 2: Parity/Overflow flag */
#define EZ80_H_FLAG 0x10 /* Bit 4: Half carry flag */
#define EZ80_Z_FLAG 0x40 /* Bit 5: Zero flag */
#define EZ80_S_FLAG 0x80 /* Bit 7: Sign flag */
/* Timer Registers *****************************************************************/
#define EZ80_TMR0_CTL 0x60 /* RW: Timer 0 control register */
#define EZ80_TMR0_IER 0x61 /* RW: Timer 0 interrupt enable register */
#define EZ80_TMR0_IIR 0x62 /* R : Timer 0 interrupt ID register */
#define EZ80_TMR0_DRL 0x63 /* R : Timer 0 data register (low) */
#define EZ80_TMR0_DRH 0x64 /* R : Timer 0 data register (high) */
#define EZ80_TMR0_RRL 0x63 /* W: Timer 0 reload register (low) */
#define EZ80_TMR0_RRH 0x64 /* W: Timer 0 reload register (high) */
#define EZ80_TMR1_CTL 0x65 /* RW: Timer 1 control register */
#define EZ80_TMR1_IER 0x66 /* RW: Timer 1 interrupt enable register */
#define EZ80_TMR1_IIR 0x67 /* R : Timer 1 interrupt ID register */
#define EZ80_TMR1_DRL 0x68 /* R : Timer 1 data register (low) */
#define EZ80_TMR1_DRH 0x69 /* R : Timer 1 data register (high) */
#define EZ80_TMR1_RRL 0x68 /* W: Timer 1 reload register (low) */
#define EZ80_TMR1_RRH 0x69 /* W: Timer 1 reload register (high) */
#define EZ80_TMR1_CAPCTL 0x6a /* RW: Timer 1 input capture control register */
#define EZ80_TMR1_CAPAL 0x6b /* R : Timer 1 capture input value A (low) */
#define EZ80_TMR1_CAPAH 0x6c /* R : Timer 1 capture input value A (high) */
#define EZ80_TMR1_CAPBL 0x6d /* R : Timer 1 capture input value B (low) */
#define EZ80_TMR1_CAPBH 0x6e
#define EZ80_TMR2_CTL 0x6f /* RW: Timer 2 control register */
#define EZ80_TMR2_IER 0x70 /* RW: Timer 2 interrupt enable register */
#define EZ80_TMR2_IIR 0x71 /* R : Timer 2 interrupt ID register */
#define EZ80_TMR2_DRL 0x72 /* R : Timer 2 data register (low) */
#define EZ80_TMR2_DRH 0x73 /* R : Timer 2 data register (high) */
#define EZ80_TMR2_RRL 0x72 /* W: Timer 2 reload register (low) */
#define EZ80_TMR2_RRH 0x73 /* W: Timer 2 reload register (high) */
#define EZ80_TMR3_CTL 0x74 /* RW: Timer 3 control register */
#define EZ80_TMR3_IER 0x75 /* RW: Timer 3 interrupt enable register */
#define EZ80_TMR3_IIR 0x76 /* R : Timer 3 interrupt ID register */
#define EZ80_TMR3_DRL 0x77 /* R : Timer 3 data register (low) */
#define EZ80_TMR3_DRH 0x78 /* R : Timer 3 data register (high) */
#define EZ80_TMR3_RRL 0x77 /* W: Timer 3 reload register (low) */
#define EZ80_TMR3_RRH 0x78 /* W: Timer 3 reload register (high) */
#define EZ80_TMR3_CAPCTL 0x7b /* RW: Timer 3 input capture control register */
#define EZ80_TMR3_CAPAL 0x7c /* R : Timer 3 capture input value A (low) */
#define EZ80_TMR3_CAPAH 0x7d /* R : Timer 3 capture input value A (high) */
#define EZ80_TMR3_CAPBL 0x7e /* R : Timer 3 capture input value B (low) */
#define EZ80_TMR3_CAPBH 0x7f /* R : Timer 3 capture input value B (high) */
#define EZ80_TMR3_OCCTL1 0x80 /* RW: Timer 3 output compare control register1 */
#define EZ80_TMR3_OCCTL2 0x81 /* RW: Timer 3 output compare control register2 */
#define EZ80_TMR3_OC0L 0x82 /* RW: Timer 3 output compare value 0 (low) */
#define EZ80_TMR3_OC0H 0x83 /* RW: Timer 3 output compare value 0 (high) */
#define EZ80_TMR3_OC1L 0x84 /* RW: Timer 3 output compare value 1 (low) */
#define EZ80_TMR3_OC1H 0x85 /* RW: Timer 3 output compare value 1 (high) */
#define EZ80_TMR3_OC2L 0x86 /* RW: Timer 3 output compare value 2 (low) */
#define EZ80_TMR3_OC2H 0x87 /* RW: Timer 3 output compare value 2 (high) */
#define EZ80_TMR3_OC3L 0x88 /* RW: Timer 3 output compare value 3 (low) */
#define EZ80_TMR3_OC3H 0x89 /* RW: Timer 3 output compare value 3 (high) */
/* TMR0/1/2/3 CTL Register Bit Definitions *******************************************/
#define EZ80_TMRCTL_BRKSTOP 0x80 /* Bit 7: Stop timer for debug operation */
#define EZ80_TMRCTL_CLKSEL 0x60 /* Bits 6-5: Timer source */
# define EZ80_TMRCLKSEL_SYSCLK 0x00 /* 00: System clock divided by prescaler */
# define EZ80_TMRCLKSEL_RTC 0x20 /* 01: Real time clock input */
# define EZ80_TMRCLKSEL_ECF 0x40 /* 10: Event count input, falling edge */
# define EZ80_TMRCLKSEL_ECR 0x60 /* 11: Event count input, rising edge */
#define EZ80_TMRCTL_CLKDIV 0x18 /* Bits 3-4: Sysem clock divider */
# define EZ80_TMRCLKDIV_4 0x00 /* 00: 4 */
# define EZ80_TMRCLKDIV_16 0x08 /* 01: 16 */
# define EZ80_TMRCLKDIV_64 0x10 /* 10: 64 */
# define EZ80_TMRCLKDIV_256 0x18 /* 11: 256 */
#define EZ80_TMRCTL_TIMCONT 0x04 /* Bit 2: Continusous mode */
#define EZ80_TMRCTL_RLD 0x02 /* Bit 1: Force reload */
#define EZ80_TMRCTL_TIMEN 0x01 /* Bit 0: Programmable reload timer enabled */
/* TMR0/1/2/3 IER Register Bit Definitions *******************************************/
/* Bit 7: Reserved */
#define EZ80_TMRIER_OC3EN 0x40 /* Bit 6: TMR3 OC3 enabled */
#define EZ80_TMRIER_OC2EN 0x20 /* Bit 5: TMR3 OC2 enabled */
#define EZ80_TMRIER_OC1EN 0x10 /* Bit 4: TMR3 OC1 enabled */
#define EZ80_TMRIER_OC0EN 0x08 /* Bit 3: TMR3 OC0 enabled */
#define EZ80_TMRIER_ICBEN 0x04 /* Bit 2: TMR1/3 capture pin enabled */
#define EZ80_TMRIER_ICAEN 0x02 /* Bit 1: TMR1/3 capture pin enabled */
#define EZ80_TMRIER_EOCEN 0x01 /* Bit 0: End of count interrupt enabled */
/* TMR0/1/2/3 IER Register Bit Definitions *******************************************/
/* Bit 7: Reserved */
#define EZ80_TMRIIR_OC3 0x40 /* Bit 6: TMR3 OC3 */
#define EZ80_TMRIIR_OC2 0x20 /* Bit 5: TMR3 OC2 */
#define EZ80_TMRIIR_OC1 0x10 /* Bit 4: TMR3 OC1 */
#define EZ80_TMRIIR_OC0 0x08 /* Bit 3: TMR3 OC0 */
#define EZ80_TMRIIR_ICB 0x04 /* Bit 2: TMR1/3 capture pin */
#define EZ80_TMRIIR_ICA 0x02 /* Bit 1: TMR1/3 capture pin */
#define EZ80_TMRIIR_EOC 0x01 /* Bit 0: End of count interrupt */
/* UART Register Offsets *************************************************************/
/* DLAB=0: */
#define EZ80_UART_THR 0x00 /* W: UART Transmit holding register */
#define EZ80_UART_RBR 0x00 /* R : UART Receive buffer register */
#define EZ80_UART_IER 0x01 /* RW: UART Interrupt enable register */
/* DLAB=1: */
#define EZ80_UART_BRG 0x00 /* RW: UART Baud rate generator register */
#define EZ80_UART_BRGL 0x00 /* RW: UART Baud rate generator register (low) */
#define EZ80_UART_BRGH 0x01 /* RW: UART Baud rate generator register (high) */
/* DLAB=N/A: */
#define EZ80_UART_IIR 0x02 /* R : UART Interrupt identification register */
#define EZ80_UART_FCTL 0x02 /* W: UART FIFO control register */
#define EZ80_UART_LCTL 0x03 /* RW: UART Line control register */
#define EZ80_UART_MCTL 0x04 /* RW: UART Modem control register */
#define EZ80_UART_LSR 0x05 /* R : UART Line status register */
#define EZ80_UART_MSR 0x06 /* R : UART Modem status register */
#define EZ80_UART_SPR 0x07 /* RW: UART Scratchpad register */
/* UART0/1 Base Register Addresses **************************************************/
#define EZ80_UART0_BASE 0xc0
#define EZ80_UART1_BASE 0xd0
/* UART0/1 IER register bits ********************************************************/
#define EZ80_UARTEIR_INTMASK 0x1f /* Bits 5-7: Reserved */
#define EZ80_UARTEIR_TCIE 0x10 /* Bit 4: Transmission complete interrupt */
#define EZ80_UARTEIR_MIIE 0x08 /* Bit 3: Modem status input interrupt */
#define EZ80_UARTEIR_LSIE 0x04 /* Bit 2: Line status interrupt */
#define EZ80_UARTEIR_TIE 0x02 /* Bit 1: Transmit interrupt */
#define EZ80_UARTEIR_RIE 0x01 /* Bit 0: Receive interrupt */
/* UART0/1 IIR register bits ********************************************************/
#define EZ80_UARTIIR_FSTS 0x80 /* Bit 7: FIFO enable */
/* Bits 4-6: Reserved */
#define EZ80_UARTIIR_INSTS 0x0e /* Bits 1-3: Interrupt status code */
# define EZ80_UARTINSTS_CTO 0x0c /* 110: Character timeout */
# define EZ80_UARTINSTS_TC 0x0a /* 101: Transmission complete */
# define EZ80_UARTINSTS_RLS 0x06 /* 011: Receiver line status */
# define EZ80_UARTINSTS_RDR 0x04 /* 010: Receive data ready or trigger level */
# define EZ80_UARTINSTS_TBE 0x02 /* 001: Transmisson buffer empty */
# define EZ80_UARTINSTS_MS 0x00 /* 000: Modem status */
#define EZ80_UARTIIR_INTBIT 0x01 /* Bit 0: Active interrupt source */
#define EZ80_UARTIIR_CAUSEMASK 0x0f
/* UART0/1 FCTL register bits *******************************************************/
#define EZ80_UARTFCTL_TRIG 0xc0 /* Bits 6-7: UART recieve FIFO trigger level */
# define EZ80_UARTTRIG_1 0x00 /* 00: Receive FIFO trigger level=1 */
# define EZ80_UARTTRIG_4 0x40 /* 01: Receive FIFO trigger level=4 */
# define EZ80_UARTTRIG_8 0x80 /* 10: Receive FIFO trigger level=8 */
# define EZ80_UARTTRIG_14 0xc0 /* 11: Receive FIFO trigger level=14 */
/* Bit 3-5: Reserved */
#define EZ80_UARTFCTL_CLRTxF 0x04 /* Bit 2: Transmit enable */
#define EZ80_UARTFCTL_CLRRxF 0x02 /* Bit 1: Receive enable */
#define EZ80_UARTFCTL_FIFOEN 0x01 /* Bit 0: Enable receive/transmit FIFOs */
/* UART0/1 LCTL register bits *******************************************************/
#define EZ80_UARTLCTL_DLAB 0x80 /* Bit 7: Enable access to baud rate generator */
#define EZ80_UARTLCTL_SB 0x40 /* Bit 6: Send break */
#define EZ80_UARTLCTL_FPE 0x20 /* Bit 5: Force parity error */
#define EZ80_UARTLCTL_EPS 0x10 /* Bit 4: Even parity select */
#define EZ80_UARTLCTL_PEN 0x08 /* Bit 3: Parity enable */
#define EZ80_UARTLCTl_2STOP 0x04 /* Bit 2: 2 stop bits */
#define EZ80_UARTLCTL_CHAR 0x03 /* Bits 0-2: Number of data bits */
# define EZ80_UARTCHAR_5BITS 0x00 /* 00: 5 data bits */
# define EZ80_UARTCHAR_6BITS 0x01 /* 01: 6 data bits */
# define EZ80_UARTCHAR_7BITS 0x02 /* 10: 7 data bits */
# define EZ80_UARTCHAR_8BITS 0x03 /* 11: 8 data bits */
#define EZ80_UARTLCTL_MASK 0x3f
/* UART0/1 MCTL register bits *******************************************************/
/* Bit 7: Reserved */
#define EZ80_UARTMCTL_POLARITY 0x40 /* Bit 6: Invert polarity of RxD and TxD */
#define EZ80_UARTMCTL_MDM 0x20 /* Bit 5: Multi-drop mode enable */
#define EZ80_UARTMCTL_LOOP 0x10 /* Bit 4: Loopback mode enable */
#define EZ80_UARTMCTL_OUT2 0x08 /* Bit 3: (loopback mode only) */
#define EZ80_UARTMCTL_OUT1 0x04 /* Bit 2: (loopback mode only) */
#define EZ80_UARTMCTL_RTS 0x02 /* Bit 1: Request to send */
#define EZ80_UARTMCTL_DTR 0x01 /* Bit 0: Data termnal read */
/* UART0/1 LSR register bits ********************************************************/
#define EZ80_UARTLSR_ERR 0x80 /* Bit 7: Error detected in FIFO */
#define EZ80_UARTLSR_TEMT 0x40 /* Bit 6: Transmit FIFO empty and idle */
#define EZ80_UARTLSR_THRE 0x20 /* Bit 5: Transmit FIFO empty */
#define EZ80_UARTLSR_BI 0x10 /* Bit 4: Break on input */
#define EZ80_UARTLSR_FE 0x08 /* Bit 3: Framing error */
#define EZ80_UARTLSR_PE 0x04 /* Bit 2: Parity error */
#define EZ80_UARTLSR_OE 0x02 /* Bit 1: Overrun error */
#define EZ80_UARTLSR_DR 0x01 /* Bit 0: Data ready */
/* UART0/1 MSR register bits ********************************************************/
#define EZ80_UARTMSR_DCD 0x80 /* Bit 7: Data carrier detect */
#define EZ80_UARTMSR_RI 0x40 /* Bit 6: Ring indicator */
#define EZ80_UARTMSR_DSR 0x20 /* Bit 5: Data set ready */
#define EZ80_UARTMSR_CTS 0x10 /* Bit 4: Clear to send */
#define EZ80_UARTMSR_DDCD 0x08 /* Bit 3: Delta on DCD input */
#define EZ80_UARTMSR_TERI 0x04 /* Bit 2: Trailing edge change on RI */
#define EZ80_UARTMSR_DDSR 0x02 /* Bit 1: Delta on DSR input */
#define EZ80_UARTMSR_DCTS 0x01 /* Bit 0: Delta on CTS input */
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __EZ80_CHIP_H */

View File

@@ -0,0 +1,79 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_copystate.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <arch/irq.h>
#include "chip/switch.h"
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: ez80_copystate
****************************************************************************/
/* Maybe a little faster than most memcpy's */
void ez80_copystate(chipreg_t *dest, const chipreg_t *src)
{
int i;
for (i = 0; i < XCPTCONTEXT_REGS; i++)
{
*dest++ = *src++;
}
}

View File

@@ -0,0 +1,92 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_initialstate.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <string.h>
#include <nuttx/arch.h>
#include "chip/chip.h"
#include "up_internal.h"
#include "up_arch.h"
/****************************************************************************
* Private Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_initial_state
*
* Description:
* A new thread is being started and a new TCB
* has been created. This function is called to initialize
* the processor specific portions of the new TCB.
*
* This function must setup the intial architecture registers
* and/or stack so that execution will begin at tcb->start
* on the next context switch.
*
****************************************************************************/
void up_initial_state(_TCB *tcb)
{
struct xcptcontext *xcp = &tcb->xcp;
/* Initialize the initial exception register context structure */
memset(xcp, 0, sizeof(struct xcptcontext));
#ifndef CONFIG_SUPPRESS_INTERRUPTS
((ubyte*)xcp->regs)[XCPT_IF_OFFSET] = EZ80_PV_FLAG; /* Parity/Overflow flag will enable interrupts */
#endif
xcp->regs[XCPT_SP] = (chipreg_t)tcb->adj_stack_ptr;
xcp->regs[XCPT_PC] = (chipreg_t)tcb->start;
}

View File

@@ -0,0 +1,154 @@
;**************************************************************************
; arch/z80/src/ze80/ez80_io.c
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
;**************************************************************************
; Global Symbols Expported
;**************************************************************************
xdef _outp
xdef _inp
;**************************************************************************
; Global Symbols Expported
;**************************************************************************
CONFIG_EZ80_Z80MODE equ 0
;**************************************************************************
; Code
;**************************************************************************
segment CODE
.assume ADL=1
;**************************************************************************
; Name: void outp(uint16 p, ubyte c)
;
; Description:
; Output byte c on port p
;
;**************************************************************************
_outp:
; Create a stack frame
push ix
ld ix, #0
add ix, sp
; Get the arguments from the stack
.if CONFIG_EZ80_Z80MODE
; Stack looks like:
;
; 7-8 Unused
; 6 Value
; 4-5 Port
; 2-3 Return address
; SP: 0-1 Caller's fame pointer
ld bc, (ix + 4) ; Port
ld a, (ix + 6) ; Value
.else
; Stack looks like:
;
; 10-11 Unused
; 9 Value
; 8 Unused
; 6-7 Port
; 3-5 Return address
; SP: 0-2 Caller's frame pointer
ld bc, (ix + 6) ; Port (upper 8 bits not used)
ld a, (ix + 9) ; Value
.endif
; Output the specified by to the specified 8-bit I/O address
out (bc), a
pop ix
ret
;**************************************************************************
; Name: ubyte inp(uint16 p)
;
; Description:
; Input byte from port p
;
;**************************************************************************
_inp:
; Create a stack frame
push ix
ld ix, #0
add ix, sp
; Get the arguments from the stack
.if CONFIG_EZ80_Z80MODE
; Stack looks like:
;
; 4-5 Port
; 2-3 Return address
; SP: 0-1 Caller's fame pointer
ld bc, (ix + 4) ; Port
.else
; Stack looks like:
;
; 8 Unused
; 6-7 Port
; 3-5 Return address
; SP: 0-2 Caller's frame pointer
ld bc, (ix + 6) ; Port (upper 8 bits not used)
.endif
; Return port value in A
in a, (bc)
pop ix
ret
end

View File

@@ -0,0 +1,125 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_irq.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include "chip/switch.h"
#include "up_internal.h"
/****************************************************************************
* Private Definitions
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/* This holds a references to the current interrupt level register storage
* structure. If is non-NULL only during interrupt processing.
*/
chipreg_t *current_regs;
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_irqinitialize
****************************************************************************/
void up_irqinitialize(void)
{
current_regs = NULL;
/* And finally, enable interrupts */
#ifndef CONFIG_SUPPRESS_INTERRUPTS
asm("ei");
#endif
}
/****************************************************************************
* Name: up_disable_irq
*
* Description:
* On many architectures, there are three levels of interrupt enabling: (1)
* at the global level, (2) at the level of the interrupt controller,
* and (3) at the device level. In order to receive interrupts, they
* must be enabled at all three levels.
*
* This function implements disabling of the device specified by 'irq'
* at the interrupt controller level if supported by the architecture
* (irqsave() supports the global level, the device level is hardware
* specific).
*
****************************************************************************/
void up_disable_irq(int irq)
{
/* There are no ez80 interrupt controller settings to disable IRQs */
}
/****************************************************************************
* Name: up_enable_irq
*
* Description:
* This function implements enabling of the device specified by 'irq'
* at the interrupt controller level if supported by the architecture
* (irqsave() supports the global level, the device level is hardware
* specific).
*
****************************************************************************/
void up_enable_irq(int irq)
{
/* There are no ez80 interrupt controller settings to enable IRQs */
}

View File

@@ -0,0 +1,88 @@
;**************************************************************************
; arch/z80/src/ez80/ez80_irqsave.asm
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
;**************************************************************************
; Global Symbols Expported
;**************************************************************************
xdef _irqsave
xdef _irqrestore
;**************************************************************************
; Code
;**************************************************************************
segment CODE
.assume ADL=1
;**************************************************************************
;* Name: irqstate_t irqsave(void)
;*
;* Description:
;* Disable all interrupts; return previous interrupt state
;*
;**************************************************************************
_irqsave:
ld a, i ; AF = interrupt state
di ; Interrupts are disabled (does not affect F)
push af ; Transfer to HL via the stack
pop hl ;
ret ; And return
;**************************************************************************
;* Name: void irqrestore(irqstate_t flags)
;*
;* Description:
;* Restore previous interrupt state
;*
;**************************************************************************
_irqrestore:
di ; Assume disabled
pop hl ; HL = return address
pop af ; AF Parity bit holds interrupt state
jp po, _disabled ; Skip over re-enable if Parity odd
ei ; Re-enable interrupts
_disabled:
push af ; Restore stack
push hl ;
ret ; and return
end

View File

@@ -0,0 +1,191 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_loweruart.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <string.h>
#include <arch/io.h>
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include "chip/chip.h"
#include "common/up_internal.h"
#ifdef CONFIG_USE_LOWUARTINIT
/****************************************************************************
* Private Definitions
****************************************************************************/
/* The system clock frequency is defined in the linkcmd file */
extern unsigned long SYS_CLK_FREQ;
#define _DEFCLK ((unsigned long)&SYS_CLK_FREQ)
#ifdef CONFIG_UART0_SERIAL_CONSOLE
# define ez80_inp(offs) inp((EZ80_UART0_BASE+(offs)))
# define ez80_outp(offs,val) outp((EZ80_UART0_BASE+(offs)), (val))
# define CONFIG_UART_BAUD CONFIG_UART0_BAUD
# if CONFIG_UART0_BITS == 7
# define CONFIG_UART_BITS EZ80_UARTCHAR_7BITS
# else
# define CONFIG_UART_BITS EZ80_UARTCHAR_8BITS
# endif
# if CONFIG_UART0_2STOP != 0
# define CONFIG_UART_2STOP EZ80_UARTLCTl_2STOP
# else
# define CONFIG_UART_2STOP 0
# endif
# if CONFIG_UART0_PARITY == 1 /* Odd parity */
# define CONFIG_UART_PARITY EZ80_UARTLCTL_PEN
# elif CONFIG_UART0_PARITY == 2 /* Even parity */
# define CONFIG_UART_PARITY (EZ80_UARTLCTL_PEN|EZ80_UARTLCTL_EPS)
# else
# define CONFIG_UART_PARITY 0
# endif
#else
# define ez80_inp(offs) inp((EZ80_UART1_BASE+(offs)))
# define ez80_outp(offs.val) outp((EZ80_UART1_BASE+(offs)), (val))
# define CONFIG_UART_BAUD CONFIG_UART1_BAUD
# if CONFIG_UART1_BITS == 7
# define CONFIG_UART_BITS EZ80_UARTCHAR_7BITS
# else
# define CONFIG_UART_BITS EZ80_UARTCHAR_8BITS
# endif
# if CONFIG_UART1_2STOP != 0
# define CONFIG_UART_2STOP EZ80_UARTLCTl_2STOP
# else
# define CONFIG_UART_2STOP 0
# endif
# if CONFIG_UART1_PARITY == 1 /* Odd parity */
# define CONFIG_UART_PARITY EZ80_UARTLCTL_PEN
# elif CONFIG_UART1_PARITY == 2 /* Even parity */
# define CONFIG_UART_PARITY (EZ80_UARTLCTL_PEN|EZ80_UARTLCTL_EPS)
# else
# define CONFIG_UART_PARITY 0
# endif
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
#ifndef CONFIG_SUPPRESS_UART_CONFIG
static void ez80_setbaud(void)
{
uint24 brg_divisor;
ubyte lctl;
/* The resulting BAUD and depends on the system clock frequency and the
* BRG divisor as follows:
*
* BAUD = SYSTEM_CLOCK_FREQUENCY / (16 * BRG_Divisor)
*
* Or
*
* BRG_Divisor = SYSTEM_CLOCK_FREQUENCY / 16 / BAUD
*/
brg_divisor = ( _DEFCLK + (CONFIG_UART_BAUD << 3)) / (CONFIG_UART_BAUD << 4);
/* Set the DLAB bit to enable access to the BRG registers */
lctl = ez80_inp(EZ80_UART_LCTL);
lctl |= EZ80_UARTLCTL_DLAB;
ez80_outp(EZ80_UART_LCTL, lctl);
ez80_outp(EZ80_UART_BRGL, (ubyte)(brg_divisor & 0xff));
ez80_outp(EZ80_UART_BRGH, (ubyte)(brg_divisor >> 8));
lctl &= ~EZ80_UARTLCTL_DLAB;
ez80_outp(EZ80_UART_LCTL, lctl);
}
#endif /* CONFIG_SUPPRESS_UART_CONFIG */
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_lowuartinit
****************************************************************************/
void up_lowuartinit(void)
{
#ifndef CONFIG_SUPPRESS_UART_CONFIG
ubyte reg;
/* Disable interrupts from the UART */
reg = ez80_inp(EZ80_UART_IER);
reg &= ~EZ80_UARTEIR_INTMASK;
ez80_outp(EZ80_UART_IER, reg);
/* Set the baud rate */
ez80_setbaud();
ez80_outp(EZ80_UART_MCTL, 0);
/* Set the character properties */
reg = ez80_inp(EZ80_UART_LCTL);
reg &= ~EZ80_UARTLCTL_MASK;
reg |= (CONFIG_UART_BITS | CONFIG_UART_2STOP | CONFIG_UART_PARITY);
ez80_outp(EZ80_UART_LCTL, reg);
/* Enable and flush the receive FIFO */
reg = EZ80_UARTFCTL_FIFOEN;
ez80_outp(EZ80_UART_FCTL, reg);
reg |= (EZ80_UARTFCTL_CLRTxF|EZ80_UARTFCTL_CLRRxF);
ez80_outp(EZ80_UART_FCTL, reg);
/* Set the receive trigger level to 1 */
reg |= EZ80_UARTTRIG_1;
ez80_outp(EZ80_UART_FCTL, reg);
#endif /* CONFIG_SUPPRESS_UART_CONFIG */
}
#endif /* CONFIG_USE_LOWUARTINIT */

View File

@@ -0,0 +1,103 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_registerdump.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include "chip/switch.h"
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
* debug is not selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef lldbg
# define lldbg lib_lowprintf
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: z80_registerdump
****************************************************************************/
#ifdef CONFIG_ARCH_STACKDUMP
static void ez80_registerdump(void)
{
if (current_regs)
{
#ifdef CONFIG_EZ80_Z80MODE
lldbg("AF: %04x I: %04x\n",
current_regs[XCPT_AF], current_regs[XCPT_I]);
lldbg("BC: %04x DE: %04x HL: %04x\n",
current_regs[XCPT_BC], current_regs[XCPT_DE], current_regs[XCPT_HL]);
lldbg("IX: %04x IY: %04x\n",
current_regs[XCPT_IX], current_regs[XCPT_IY]);
lldbg("SP: %04x PC: %04x\n"
current_regs[XCPT_SP], current_regs[XCPT_PC]);
#else
lldbg("AF: %06x I: %06x\n",
current_regs[XCPT_AF], current_regs[XCPT_I]);
lldbg("BC: %06x DE: %06x HL: %06x\n",
current_regs[XCPT_BC], current_regs[XCPT_DE], current_regs[XCPT_HL]);
lldbg("IX: %06x IY: %06x\n",
current_regs[XCPT_IX], current_regs[XCPT_IY]);
lldbg("SP: %06x PC: %06x\n"
current_regs[XCPT_SP], current_regs[XCPT_PC]);
#endif
}
}
#endif

View File

@@ -0,0 +1,110 @@
;**************************************************************************
; arch/z80/src/ez80/ez80_restorcontext.asm
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
;**************************************************************************
; Global Symbols Expported
;**************************************************************************
xdef _ez80_restorecontext
;**************************************************************************
; Code
;**************************************************************************
segment CODE
.assume ADL=1
;**************************************************************************
; ez80_restorecontext
;**************************************************************************
_ez80_restorecontext:
; On entry, stack contains return address (not used), then address
; of the register save structure
; Discard the return address, we won't be returning
pop hl
; Get the address of the beginning of the state save area. Each
; pop will increment to the next element of the structure
pop hl ; BC = Address of save structure
ld sp, hl ; SP points to top of storage area
; Disable interrupts while we muck with the alternative registers. The
; Correct interrupt state will be restore below
di
; Restore registers. HL points to the beginning of the reg structure to restore
ex af, af' ; Select alternate AF
pop af ; Offset 0: AF' = I with interrupt state in carry
ex af, af' ; Restore original AF
pop bc ; Offset 1: BC
pop de ; Offset 2: DE
pop ix ; Offset 3: IX
pop iy ; Offset 4: IY
exx ; Use alternate BC/DE/HL
pop hl ; Offset 5: HL' = Stack pointer after return
exx ; Restore original BC/DE/HL
pop hl ; Offset 6: HL
pop af ; Offset 7: AF
; Restore the stack pointer
exx ; Use alternate BC/DE/HL
pop de ; DE' = return address
ld sp, hl ; Set SP = saved stack pointer value before return
push de ; Save return address for ret instruction
exx ; Restore original BC/DE/HL
; Restore interrupt state
ex af, af' ; Recover interrupt state
jp po, noinrestore ; No parity, IFF2=0, means disabled
ex af, af' ; Restore AF (before enabling interrupts)
ei ; yes.. Enable interrupts
ret ; and return
noinrestore:
ex af, af' ; Restore AF
ret ; Return with interrupts disabled
end

View File

@@ -0,0 +1,172 @@
;*************************************************************************
; arch/z80/src/ez80/ez80_saveusercontext.asm
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;*************************************************************************
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
;**************************************************************************
; Global Symbols Expported
;**************************************************************************
xdef _ez80_saveusercontext
;*************************************************************************
; Constants
;*************************************************************************
CONFIG_EZ80_Z80MODE equ 0
.if CONFIG_EZ80_Z80MODE
; Register save area layout
XCPT_I equ 2*0 ; Offset 0: Saved I w/interrupt state in carry
XCPT_BC equ 2*1 ; Offset 1: Saved BC register
XCPT_DE equ 2*2 ; Offset 2: Saved DE register
XCPT_IX equ 2*3 ; Offset 3: Saved IX register
XCPT_IY equ 2*4 ; Offset 4: Saved IY register
XCPT_SP equ 2*5 ; Offset 5: Offset to SP at time of interrupt
XCPT_HL equ 2*6 ; Offset 6: Saved HL register
XCPT_AF equ 2*7 ; Offset 7: Saved AF register
XCPT_PC equ 2*8 ; Offset 8: Offset to PC at time of interrupt
; Stack frame
FRAME_IY equ 2*0 ; Location of IY on the stack
FRAME_IX equ 2*1 ; Location of IX on the stack
FRAME_RET equ 2*2 ; Location of return address on the stack
FRAME_REGS equ 2*3 ; Location of reg save area on stack
SP_OFFSET equ 2*3
.else
; Register save area layout
XCPT_I equ 3*0 ; Offset 0: Saved I w/interrupt state in carry
XCPT_BC equ 3*1 ; Offset 1: Saved BC register
XCPT_DE equ 3*2 ; Offset 2: Saved DE register
XCPT_IX equ 3*3 ; Offset 3: Saved IX register
XCPT_IY equ 3*4 ; Offset 4: Saved IY register
XCPT_SP equ 3*5 ; Offset 5: Offset to SP at time of interrupt
XCPT_HL equ 3*6 ; Offset 6: Saved HL register
XCPT_AF equ 3*7 ; Offset 7: Saved AF register
XCPT_PC equ 3*8 ; Offset 8: Offset to PC at time of interrupt .endif
; Stack frame
FRAME_IY equ 3*0 ; Location of IY on the stack
FRAME_IX equ 3*1 ; Location of IX on the stack
FRAME_RET equ 3*2 ; Location of return address on the stack
FRAME_REGS equ 3*3 ; Location of reg save area on stack
SP_OFFSET equ 3*3
.endif
;**************************************************************************
; Code
;**************************************************************************
segment CODE
.assume ADL=1
;*************************************************************************
; Name: z80_saveusercontext
;*************************************************************************
_ez80_saveusercontext:
; Set up a stack frame
push ix ; Save IX and IY
push iy
ld ix, #0
add ix, sp ; IX = stack frame
; Fetch the address of the save area
ld de, (ix + FRAME_REGS) ; DE = save area address
ld iy, #0
add iy, de ; IY = save area address
; Then save the registers
; Save the current interrupt state at offset 0
ld a, i ; Get interrupt state
push af
pop hl
ld (iy + XCPT_I), hl ; Index 0: I w/interrupt state in parity/overflow
; Save BC at offset 1
ld (iy + XCPT_BC), bc ; Index 1: BC
; DE is not preserved (Index 2)
; Save IX at offset 3
ld hl, (ix + FRAME_IX) ; HL = Saved alue of IX
ld (iy + XCPT_IX), hl ; Index 3: IX
; Save IY at index 4
ld hl, (ix + FRAME_IY) ; HL = Saved value of IY
ld (iy + XCPT_IY), hl ; Index 4: IY
; Save that stack pointer as it would be upon return in offset 5
ld hl, #SP_OFFSET ; Value of stack pointer on return
add hl, sp
ld (iy + XCPT_SP), hl ; Index 5 SP
; HL is saved as the value 1 at offset 6
ld hl, #1
ld (iy + XCPT_HL), hl ; Index 2: HL on return (=1)
; AF is not preserved (offset 7)
; Save the return address at index 8
ld hl, (ix + FRAME_RET) ; HL = Saved return address
ld (iy + XCPT_PC), hl ; Index 8: PC
; Return the value 0
ld hl, #0
pop iy
pop ix
ret
end

View File

@@ -0,0 +1,192 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_schedulesigaction.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
#include <arch/irq.h>
#include "chip/switch.h"
#include "os_internal.h"
#include "up_internal.h"
#ifndef CONFIG_DISABLE_SIGNALS
/****************************************************************************
* Private Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: ez80_sigsetup
****************************************************************************/
static void ez80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs)
{
/* Save the return address and interrupt state. These will be restored by
* the signal trampoline after the signals have been delivered.
*/
tcb->xcp.sigdeliver = sigdeliver;
tcb->xcp.saved_pc = regs[XCPT_PC];
tcb->xcp.saved_i = regs[XCPT_I];
/* Then set up to vector to the trampoline with interrupts disabled */
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_I] = 0;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_schedule_sigaction
*
* Description:
* This function is called by the OS when one or more
* signal handling actions have been queued for execution.
* The architecture specific code must configure things so
* that the 'igdeliver' callback is executed on the thread
* specified by 'tcb' as soon as possible.
*
* This function may be called from interrupt handling logic.
*
* This operation should not cause the task to be unblocked
* nor should it cause any immediate execution of sigdeliver.
* Typically, a few cases need to be considered:
*
* (1) This function may be called from an interrupt handler
* During interrupt processing, all xcptcontext structures
* should be valid for all tasks. That structure should
* be modified to invoke sigdeliver() either on return
* from (this) interrupt or on some subsequent context
* switch to the recipient task.
* (2) If not in an interrupt handler and the tcb is NOT
* the currently executing task, then again just modify
* the saved xcptcontext structure for the recipient
* task so it will invoke sigdeliver when that task is
* later resumed.
* (3) If not in an interrupt handler and the tcb IS the
* currently executing task -- just call the signal
* handler now.
*
****************************************************************************/
void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver)
{
dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16)sigdeliver);
/* Refuse to handle nested signal actions */
if (tcb->xcp.sigdeliver == NULL)
{
irqstate_t flags;
/* Make sure that interrupts are disabled */
flags = irqsave();
/* First, handle some special cases when the signal is being delivered
* to the currently executing task.
*/
if (tcb == (FAR _TCB*)g_readytorun.head)
{
/* CASE 1: We are not in an interrupt handler and a task is
* signalling itself for some reason.
*/
if (!IN_INTERRUPT())
{
/* In this case just deliver the signal now. */
sigdeliver(tcb);
}
/* CASE 2: We are in an interrupt handler AND the interrupted task
* is the same as the one that must receive the signal, then we
* will have to modify the return state as well as the state in
* the TCB.
*/
else
{
/* Set up to vector to the trampoline with interrupts disabled. */
ez80_sigsetup(tcb, sigdeliver, IRQ_STATE());
/* And make sure that the saved context in the TCB
* is the same as the interrupt return context.
*/
SAVE_IRQCONTEXT(tcb);
}
}
/* Otherwise, we are (1) signaling a task is not running from an interrupt
* handler or (2) we are not in an interrupt handler and the running task
* is signalling some non-running task.
*/
else
{
/* Set up to vector to the trampoline with interrupts disabled. */
ez80_sigsetup(tcb, sigdeliver, tcb->xcp.regs);
}
irqrestore(flags);
}
}
#endif /* CONFIG_DISABLE_SIGNALS */

View File

@@ -0,0 +1,778 @@
/****************************************************************************
* arch/z80/src/ez08/ez80_serial.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <unistd.h>
#include <semaphore.h>
#include <string.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/serial.h>
#include <arch/serial.h>
#include <arch/io.h>
#include "chip/chip.h"
#include "os_internal.h"
#include "up_internal.h"
#ifdef CONFIG_USE_SERIALDRIVER
/****************************************************************************
* Definitions
****************************************************************************/
/* The system clock frequency is defined in the linkcmd file */
extern unsigned long SYS_CLK_FREQ;
#define _DEFCLK ((unsigned long)&SYS_CLK_FREQ)
/****************************************************************************
* Private Types
****************************************************************************/
struct ez80_dev_s
{
uint16 uartbase; /* Base address of UART registers */
unsigned int baud; /* Configured baud */
ubyte irq; /* IRQ associated with this UART */
ubyte parity; /* 0=none, 1=odd, 2=even */
ubyte bits; /* Number of bits (7 or 8) */
boolean stopbits2; /* TRUE: Configure with 2 (vs 1) */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int ez80_setup(struct uart_dev_s *dev);
static void ez80_shutdown(struct uart_dev_s *dev);
static int ez80_attach(struct uart_dev_s *dev);
static void ez80_detach(struct uart_dev_s *dev);
static int ez80_interrrupt(int irq, void *context);
static int ez80_ioctl(struct file *filep, int cmd, unsigned long arg);
static int ez80_receive(struct uart_dev_s *dev, unsigned int *status);
static void ez80_rxint(struct uart_dev_s *dev, boolean enable);
static boolean ez80_rxavailable(struct uart_dev_s *dev);
static void ez80_send(struct uart_dev_s *dev, int ch);
static void ez80_txint(struct uart_dev_s *dev, boolean enable);
static boolean ez80_txready(struct uart_dev_s *dev);
static boolean ez80_txempty(struct uart_dev_s *dev);
/****************************************************************************
* Private Variables
****************************************************************************/
struct uart_ops_s g_uart_ops =
{
ez80_setup, /* setup */
ez80_shutdown, /* shutdown */
ez80_attach, /* attach */
ez80_detach, /* detach */
ez80_ioctl, /* ioctl */
ez80_receive, /* receive */
ez80_rxint, /* rxint */
ez80_rxavailable, /* rxavailable */
ez80_send, /* send */
ez80_txint, /* txint */
ez80_txready, /* txready */
ez80_txempty /* txempty */
};
/* I/O buffers */
static char g_uart0rxbuffer[CONFIG_UART0_RXBUFSIZE];
static char g_uart0txbuffer[CONFIG_UART0_TXBUFSIZE];
static char g_uart1rxbuffer[CONFIG_UART1_RXBUFSIZE];
static char g_uart1txbuffer[CONFIG_UART1_TXBUFSIZE];
/* This describes the state of the UART0 port. */
static struct ez80_dev_s g_uart0priv =
{
EZ80_UART0_BASE, /* uartbase */
CONFIG_UART0_BAUD, /* baud */
EZ80_UART0_IRQ, /* irq */
CONFIG_UART0_PARITY, /* parity */
CONFIG_UART0_BITS, /* bits */
CONFIG_UART0_2STOP /* stopbits2 */
};
static uart_dev_t g_uart0port =
{
0, /* open_count */
FALSE, /* xmitwaiting */
FALSE, /* recvwaiting */
#ifdef CONFIG_UART0_SERIAL_CONSOLE
TRUE, /* isconsole */
#else
FALSE, /* isconsole */
#endif
{ 0 }, /* closesem */
{ 0 }, /* xmitsem */
{ 0 }, /* recvsem */
{
{ 0 }, /* xmit.sem */
0, /* xmit.head */
0, /* xmit.tail */
CONFIG_UART0_TXBUFSIZE, /* xmit.size */
g_uart0txbuffer, /* xmit.buffer */
},
{
{ 0 }, /* recv.sem */
0, /* recv.head */
0, /* recv.tail */
CONFIG_UART0_RXBUFSIZE, /* recv.size */
g_uart0rxbuffer, /* recv.buffer */
},
&g_uart_ops, /* ops */
&g_uart0priv, /* priv */
};
/* This describes the state of the UART1 port. */
static struct ez80_dev_s g_uart1priv =
{
EZ80_UART1_BASE, /* uartbase */
CONFIG_UART1_BAUD, /* baud */
EZ80_UART1_IRQ, /* irq */
CONFIG_UART1_PARITY, /* parity */
CONFIG_UART1_BITS, /* bits */
CONFIG_UART1_2STOP /* stopbits2 */
};
static uart_dev_t g_uart1port =
{
0, /* open_count */
FALSE, /* xmitwaiting */
FALSE, /* recvwaiting */
#ifdef CONFIG_UART1_SERIAL_CONSOLE
TRUE, /* isconsole */
#else
FALSE, /* isconsole */
#endif
{ 0 }, /* closesem */
{ 0 }, /* xmitsem */
{ 0 }, /* recvsem */
{
{ 0 }, /* xmit.sem */
0, /* xmit.head */
0, /* xmit.tail */
CONFIG_UART1_TXBUFSIZE, /* xmit.size */
g_uart1txbuffer, /* xmit.buffer */
},
{
{ 0 }, /* recv.sem */
0, /* recv.head */
0, /* recv.tail */
CONFIG_UART1_RXBUFSIZE, /* recv.size */
g_uart0rxbuffer, /* recv.buffer */
},
&g_uart_ops, /* ops */
&g_uart1priv, /* priv */
};
/* Now, which one with be tty0/console and which tty1? */
#ifdef CONFIG_UART0_SERIAL_CONSOLE
# define CONSOLE_DEV g_uart0port
# define TTYS0_DEV g_uart0port
# define TTYS1_DEV g_uart1port
#else
# define CONSOLE_DEV g_uart1port
# define TTYS0_DEV g_uart1port
# define TTYS1_DEV g_uart0port
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: ez80_serialin
****************************************************************************/
static inline ubyte ez80_serialin(struct ez80_dev_s *priv, ubyte offset)
{
return inp(priv->uartbase + offset);
}
/****************************************************************************
* Name: ez80_serialout
****************************************************************************/
static inline void ez80_serialout(struct ez80_dev_s *priv, ubyte offset, ubyte value)
{
outp(priv->uartbase + offset, value);
}
/****************************************************************************
* Name: ez80_disableuartint
****************************************************************************/
static inline void ez80_disableuartint(struct ez80_dev_s *priv)
{
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
ier &= ~EZ80_UARTEIR_INTMASK;
ez80_serialout(priv, EZ80_UART_IER, ier);
}
/****************************************************************************
* Name: ez80_restoreuartint
****************************************************************************/
static inline void ez80_restoreuartint(struct ez80_dev_s *priv, ubyte bits)
{
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
ier |= bits & (EZ80_UARTEIR_TIE|EZ80_UARTEIR_RIE);
ez80_serialout(priv, EZ80_UART_IER, ier);
}
/****************************************************************************
* Name: ez80_waittxready
****************************************************************************/
static inline void ez80_waittxready(struct ez80_dev_s *priv)
{
int tmp;
for (tmp = 1000 ; tmp > 0 ; tmp--)
{
if ((ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0)
{
break;
}
}
}
/****************************************************************************
* Name: ez80_setbaud
****************************************************************************/
static inline void ez80_setbaud(struct ez80_dev_s *priv, uint24 baud)
{
uint24 brg_divisor;
ubyte lctl;
/* The resulting BAUD and depends on the system clock frequency and the
* BRG divisor as follows:
*
* BAUD = SYSTEM_CLOCK_FREQUENCY / (16 * BRG_Divisor)
*
* Or
*
* BRG_Divisor = SYSTEM_CLOCK_FREQUENCY / 16 / BAUD
*/
brg_divisor = ( _DEFCLK + (baud << 3)) / (baud << 4);
/* Set the DLAB bit to enable access to the BRG registers */
lctl = ez80_serialin(priv, EZ80_UART_LCTL);
lctl |= EZ80_UARTLCTL_DLAB;
ez80_serialout(priv, EZ80_UART_LCTL, lctl);
ez80_serialout(priv, EZ80_UART_BRGL, (ubyte)(brg_divisor & 0xff));
ez80_serialout(priv, EZ80_UART_BRGH, (ubyte)(brg_divisor >> 8));
lctl &= ~EZ80_UARTLCTL_DLAB;
ez80_serialout(priv, EZ80_UART_LCTL, lctl);
}
/****************************************************************************
* Name: ez80_setup
*
* Description:
* Configure the UART baud, bits, parity, fifos, etc. This method is called
* the first time that the serial port is opened.
*
****************************************************************************/
static int ez80_setup(struct uart_dev_s *dev)
{
#ifndef CONFIG_SUPPRESS_UART_CONFIG
struct ez80_dev_s *priv = dev->priv;
ubyte reg;
ubyte cval;
if (priv->bits == 7)
{
cval = EZ80_UARTCHAR_7BITS;
}
else
{
cval = EZ80_UARTCHAR_8BITS;
}
if (priv->stopbits2)
{
cval |= EZ80_UARTLCTL_2STOP;
}
if (priv->parity == 1) /* Odd parity */
{
cval |= (EZ80_UARTLCTL_PEN);
}
else if (priv->parity == 2) /* Even parity */
{
cval |= (EZ80_UARTLCTL_PEN|EZ80_UARTLCTL_EPS);
}
/* Set the baud rate */
ez80_disableuartint(priv);
ez80_setbaud(priv, priv->baud);
ez80_serialout(priv, EZ80_UART_MCTL, 0);
/* Set the character properties */
reg = (ez80_serialin(priv, EZ80_UART_LCTL) & ~EZ80_UARTLCTL_MASK) | cval;
ez80_serialout(priv, EZ80_UART_LCTL, reg);
/* Enable and flush the receive FIFO */
reg = EZ80_UARTFCTL_FIFOEN;
ez80_serialout(priv, EZ80_UART_FCTL, reg);
reg |= (EZ80_UARTFCTL_CLRTxF|EZ80_UARTFCTL_CLRRxF);
ez80_serialout(priv, EZ80_UART_FCTL, reg);
/* Set the receive trigger level to 4 */
reg |= EZ80_UARTTRIG_4;
ez80_serialout(priv, EZ80_UART_FCTL, reg);
#endif
return OK;
}
/****************************************************************************
* Name: ez80_shutdown
*
* Description:
* Disable the UART. This method is called when the serial port is closed
*
****************************************************************************/
static void ez80_shutdown(struct uart_dev_s *dev)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)CONSOLE_DEV.priv;
ez80_disableuartint(priv);
}
/****************************************************************************
* Name: ez80_attach
*
* Description:
* Configure the UART to operation in interrupt driven mode. This method is
* called when the serial port is opened. Normally, this is just after the
* the setup() method is called, however, the serial console may operate in
* a non-interrupt driven mode during the boot phase.
*
* RX and TX interrupts are not enabled when by the attach method (unless the
* hardware supports multiple levels of interrupt enabling). The RX and TX
* interrupts are not enabled until the txint() and rxint() methods are called.
*
****************************************************************************/
static int ez80_attach(struct uart_dev_s *dev)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
/* Attach the IRQ */
return irq_attach(priv->irq, ez80_interrrupt);
}
/****************************************************************************
* Name: ez80_detach
*
* Description:
* Detach UART interrupts. This method is called when the serial port is
* closed normally just before the shutdown method is called. The exception is
* the serial console which is never shutdown.
*
****************************************************************************/
static void ez80_detach(struct uart_dev_s *dev)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ez80_disableuartint(priv);
irq_detach(priv->irq);
}
/****************************************************************************
* Name: ez80_interrrupt
*
* Description:
* This is the UART interrupt handler. It will be invoked
* when an interrupt received on the 'irq' It should call
* uart_transmitchars or uart_receivechar to perform the
* appropriate data transfers. The interrupt handling logic\
* must be able to map the 'irq' number into the approprite
* uart_dev_s structure in order to call these functions.
*
****************************************************************************/
static int ez80_interrrupt(int irq, void *context)
{
struct uart_dev_s *dev = NULL;
struct ez80_dev_s *priv;
volatile uint32 cause;
if (g_uart0priv.irq == irq)
{
dev = &g_uart0port;
}
else if (g_uart1priv.irq == irq)
{
dev = &g_uart1port;
}
else
{
PANIC(OSERR_INTERNAL);
}
priv = (struct ez80_dev_s*)dev->priv;
cause = ez80_serialin(priv, EZ80_UART_IIR) & EZ80_UARTIIR_CAUSEMASK;
if (cause == (EZ80_UARTINSTS_CTO|EZ80_UARTIIR_INTBIT) ||
cause == (EZ80_UARTINSTS_RDR|EZ80_UARTIIR_INTBIT))
{
/* Receive characters from the RX fifo */
uart_recvchars(dev);
}
else if (cause == (EZ80_UARTINSTS_TC|EZ80_UARTIIR_INTBIT))
{
uart_xmitchars(dev);
}
return OK;
}
/****************************************************************************
* Name: ez80_ioctl
*
* Description:
* All ioctl calls will be routed through this method
*
****************************************************************************/
static int ez80_ioctl(struct file *filep, int cmd, unsigned long arg)
{
*get_errno_ptr() = ENOTTY;
return ERROR;
}
/****************************************************************************
* Name: ez80_receive
*
* Description:
* Called (usually) from the interrupt level to receive one character from
* the UART. Error bits associated with the receipt are provided in the
* the return 'status'.
*
****************************************************************************/
static int ez80_receive(struct uart_dev_s *dev, unsigned int *status)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte rbr = ez80_serialin(priv, EZ80_UART_RBR);
ubyte lsr = ez80_serialin(priv, EZ80_UART_LSR);
*status = (unsigned int)lsr;
return rbr;
}
/****************************************************************************
* Name: ez80_rxint
*
* Description:
* Call to enable or disable RX interrupts
*
****************************************************************************/
static void ez80_rxint(struct uart_dev_s *dev, boolean enable)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
if (enable)
{
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
ier |= EZ80_UARTEIR_RIE;
ez80_serialout(priv, EZ80_UART_IER, ier);
#endif
}
else
{
ier &= ~EZ80_UARTEIR_RIE;
ez80_serialout(priv, EZ80_UART_IER, ier);
}
}
/****************************************************************************
* Name: ez80_rxavailable
*
* Description:
* Return TRUE if the receive fifo is not empty
*
****************************************************************************/
static boolean ez80_rxavailable(struct uart_dev_s *dev)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_DR) != 0;
}
/****************************************************************************
* Name: ez80_send
*
* Description:
* This method will send one byte on the UART
*
****************************************************************************/
static void ez80_send(struct uart_dev_s *dev, int ch)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ez80_serialout(priv, EZ80_UART_THR, (ubyte)ch);
}
/****************************************************************************
* Name: ez80_txint
*
* Description:
* Call to enable or disable TX interrupts
*
****************************************************************************/
static void ez80_txint(struct uart_dev_s *dev, boolean enable)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
if (enable)
{
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
ier |= EZ80_UARTEIR_TIE;
ez80_serialout(priv, EZ80_UART_IER, ier);
#endif
}
else
{
ier &= ~EZ80_UARTEIR_TIE;
ez80_serialout(priv, EZ80_UART_IER, ier);
}
}
/****************************************************************************
* Name: ez80_txready
*
* Description:
* Return TRUE if the tranmsit fifo is not full
*
****************************************************************************/
static boolean ez80_txready(struct uart_dev_s *dev)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0;
}
/****************************************************************************
* Name: ez80_txempty
*
* Description:
* Return TRUE if the transmit fifo is empty
*
****************************************************************************/
static boolean ez80_txempty(struct uart_dev_s *dev)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_TEMT) != 0;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_serialinit
*
* Description:
* Performs the low level UART initialization early in
* debug so that the serial console will be available
* during bootup. This must be called before up_serialinit.
*
****************************************************************************/
void up_earlyserialinit(void)
{
ez80_disableuartint(TTYS0_DEV.priv);
ez80_disableuartint(TTYS1_DEV.priv);
CONSOLE_DEV.isconsole = TRUE;
ez80_setup(&CONSOLE_DEV);
}
/****************************************************************************
* Name: up_serialinit
*
* Description:
* Register serial console and serial ports. This assumes
* that up_earlyserialinit was called previously.
*
****************************************************************************/
void up_serialinit(void)
{
(void)uart_register("/dev/console", &CONSOLE_DEV);
(void)uart_register("/dev/ttyS0", &TTYS0_DEV);
(void)uart_register("/dev/ttyS1", &TTYS1_DEV);
}
/****************************************************************************
* Name: up_putc
*
* Description:
* Provide priority, low-level access to support OS debug
* writes
*
****************************************************************************/
int up_putc(int ch)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)CONSOLE_DEV.priv;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
ez80_disableuartint(priv);
/* Check for LF */
if (ch == '\n')
{
/* Output CR before LF*/
ez80_waittxready(priv);
ez80_serialout(priv, EZ80_UART_THR, '\r');
}
/* Output the character */
ez80_waittxready(priv);
ez80_serialout(priv, EZ80_UART_THR, (ubyte)ch);
/* Wait for the character to be sent before re-enabling interrupts */
ez80_waittxready(priv);
ez80_restoreuartint(priv, ier);
return ch;
}
#else /* CONFIG_USE_SERIALDRIVER */
/****************************************************************************
* Definitions
****************************************************************************/
#ifdef CONFIG_UART1_SERIAL_CONSOLE
# define ez80_inp(offs) inp((EZ80_UART1_BASE+(offs)))
# define ez80_outp(offs,val) outp((EZ80_UART1_BASE+(offs)), (val))
#else
# define ez80_inp(offs) inp((EZ80_UART0_BASE+(offs)))
# define ez80_outp(offs,val) outp((EZ80_UART0_BASE+(offs)), (val))
#endif
#define ez80_txready() ((ez80_inp(EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0)
#define ez80_send(ch) ez80_outp(EZ80_UART_THR, ch)
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Variables
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: ez80_putc
****************************************************************************/
static void ez80_putc(int ch)
{
int tmp;
for (tmp = 1000 ; tmp > 0 && !ez80_txready(); tmp--);
ez80_send(ch);
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_putc
****************************************************************************/
int up_putc(int ch)
{
/* Check for LF */
if (ch == '\n')
{
/* Output CR before LF */
ez80_putc('\r');
}
/* Output character */
ez80_putc(ch);
return ch;
}
#endif /* CONFIG_USE_SERIALDRIVER */

View File

@@ -0,0 +1,141 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_sigdeliver.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include "chip/switch.h"
#include "os_internal.h"
#include "up_internal.h"
#ifndef CONFIG_DISABLE_SIGNALS
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_sigdeliver
*
* Description:
* This is the a signal handling trampoline. When a
* signal action was posted. The task context was mucked
* with and forced to branch to this location with interrupts
* disabled.
*
****************************************************************************/
void up_sigdeliver(void)
{
#ifndef CONFIG_DISABLE_SIGNALS
FAR _TCB *rtcb = (_TCB*)g_readytorun.head;
chipret_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
* so that the the user code final gets the correct errno value (probably
* EINTR).
*/
int saved_errno = rtcb->pterrno;
up_ledon(LED_SIGNAL);
dbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
ASSERT(rtcb->xcp.sigdeliver != NULL);
/* Save the real return state on the stack. */
z80_copystate(regs, rtcb->xcp.regs);
regs[XCPT_PC] = rtcb->xcp.saved_pc;
regs[XCPT_I] = rtcb->xcp.saved_i;
/* Get a local copy of the sigdeliver function pointer. We do this so
* that we can nullify the sigdeliver function point in the TCB and accept
* more signal deliveries while processing the current pending signals.
*/
sigdeliver = rtcb->xcp.sigdeliver;
rtcb->xcp.sigdeliver = NULL;
/* Then restore the task interrupt state. */
irqrestore(regs[XCPT_I]);
/* Deliver the signals */
sigdeliver(rtcb);
/* Output any debug messaged BEFORE restoring errno (because they may alter
* errno), then restore the original errno that is needed by the user logic
* (it is probably EINTR).
*/
dbg("Resuming\n");
rtcb->pterrno = saved_errno;
/* Then restore the correct state for this thread of
* execution.
*/
up_ledoff(LED_SIGNAL);
z80_restoreusercontext(regs);
#endif
}
#endif /* CONFIG_DISABLE_SIGNALS */

View File

@@ -0,0 +1,155 @@
;**************************************************************************
; arch/z80/src/ez80/ez80_startup.asm
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Included Files
;**************************************************************************
;**************************************************************************
; Constants
;**************************************************************************
;**************************************************************************
; Global symbols used
;**************************************************************************
xref __stack
xref _ez80_init
xref _ez80_initvectors
xref _ez80_initsysclk
xref _ez80_lowinit
xref __low_bss ; Low address of bss segment
xref __len_bss ; Length of bss segment
xref __low_data ; Address of initialized data section
xref __low_romdata ; Addr of initialized data section in ROM
xref __len_data ; Length of initialized data section
xref __copy_code_to_ram
xref __len_code
xref __low_code
xref __low_romcode
xref _os_start
xdef _ez80_startup
xdef _ez80_halt
;**************************************************************************
; Code
;**************************************************************************
segment CODE
.assume ADL=1
;**************************************************************************
; System reset start logic
;**************************************************************************
_ez80_startup:
; Set up the stack pointer at the location determined the lincmd
; file
ld sp, __stack
; Peform chip-specific initialization
call _ez80_init
; initialize the interrupt vector table
call _ez80_initvectors
; Initialize the system clock
call _ez80_initsysclk
; Perform C initializations
; Clear the uninitialized data section
ld bc, __len_bss ; Check for non-zero length
ld a, __len_bss >> 16
or a, c
or a, b
jr z, _ez80_bssdone ; BSS is zero-length ...
xor a, a
ld (__low_bss), a
sbc hl, hl ; hl = 0
dec bc ; 1st byte's taken care of
sbc hl, bc
jr z, _ez80_bssdone ; Just 1 byte ...
ld hl, __low_bss ; reset hl
ld de, __low_bss + 1 ; [de] = bss + 1
ldir
_ez80_bssdone:
; Copy the initialized data section
ld bc, __len_data ; [bc] = data length
ld a, __len_data >> 16 ; Check for non-zero length
or a, c
or a, b
jr z, _ez80_datadone ; __len_data is zero-length ...
ld hl, __low_romdata ; [hl] = data_copy
ld de, __low_data ; [de] = data
ldir ; Copy the data section
_ez80_datadone:
; Copy CODE (which may be in FLASH) to RAM if the
; copy_code_to_ram symbol is set in the link control file
ld a, __copy_code_to_ram
or a, a
jr z, _ez80_codedone
ld bc, __len_code ; [bc] = code length
ld a, __len_code >> 16 ; Check for non-zero length
or a, c
or a, b
jr z, _ez80_codedone ; __len_code is zero-length
ld hl, __low_romcode ; [hl] = code_copy
ld de, __low_code ; [de] = code
ldir ; Copy the code section
_ez80_codedone:
; Perform board-specific intialization
call _ez80_lowinit
; Then start NuttX
call _os_start ; jump to the OS entry point
; NuttX will never return, but just in case...
_ez80_halt:
halt ; We should never get here
jp _ez80_halt

View File

@@ -0,0 +1,168 @@
/***************************************************************************
* arch/z80/src/ez80/ez80_timerisr.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
/***************************************************************************
* Included Files
***************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <arch/io.h>
#include <nuttx/arch.h>
#include "chip/chip.h"
#include "clock_internal.h"
#include "up_internal.h"
/***************************************************************************
* Definitions
***************************************************************************/
/* The system clock frequency is defined in the linkcmd file */
extern unsigned long SYS_CLK_FREQ;
#define _DEFCLK ((unsigned long)&SYS_CLK_FREQ)
/***************************************************************************
* Private Types
***************************************************************************/
/***************************************************************************
* Private Functions
***************************************************************************/
/***************************************************************************
* Public Functions
***************************************************************************/
/***************************************************************************
* Function: up_timerisr
*
* Description:
* The timer ISR will perform a variety of services for various portions
* of the system.
*
***************************************************************************/
int up_timerisr(int irq, chipreg_t *regs)
{
ubyte reg;
/* Read the appropropriate timer0 registr to clear the interrupt */
#ifdef _EZ80F91
reg = inp(EZ80_TMR0_IIR);
#else
/* _EZ80190, _EZ80L92, _EZ80F92, _EZ80F93 */
reg = inp(EZ80_TMR0_CTL);
#endif
/* Process timer interrupt */
sched_process_timer();
return 0;
}
/***************************************************************************
* Function: up_timerinit
*
* Description:
* This function is called during start-up to initialize the timer
* interrupt.
*
***************************************************************************/
void up_timerinit(void)
{
uint16 reload;
ubyte reg;
/* Disable the timer */
outp(EZ80_TMR0_CTL, 0x00);
/* Attach system timer interrupts */
irq_attach(EZ80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
/* Set up the timer reload value */
/* Write to the timer reload register to set the reload value.
*
* In continuous mode:
*
* timer_period = reload_value x clock_divider / system_clock_frequency
* or
* reload_value = (timer_period * system_clock_frequency) / clock_divider
*
* For timer_period=10mS, and clock_divider=16, that would yield:
*
* reload_value = system_clock_frequency / 1600
*
* For a system timer of 50,000,000 that would result in a reload value of
* 31,250
*/
reload = (uint16)(_DEFCLK / 1600);
outp(EZ80_TMR0_RRH, (ubyte)(reload >> 8));
outp(EZ80_TMR0_RRL, (ubyte)(reload));
/* Clear any pending timer interrupts */
#if defined(_EZ80F91)
reg = inp(EZ80_TMR0_IIR);
#elif defined(_EZ80L92) || defined(_EZ80F92) ||defined(_EZ80F93)
reg = inp(EZ80_TMR0_CTL);
#endif
/* Configure and enable the timer */
#if defined(_EZ80190)
outp(EZ80_TMR0_CTL, 0x5f);
#elif defined(_EZ80F91)
outp(EZ80_TMR0_CTL, (EZ80_TMRCLKDIV_16|EZ80_TMRCTL_TIMCONT|EZ80_TMRCTL_RLD|EZ80_TMRCTL_TIMEN));
#elif defined(_EZ80L92) || defined(_EZ80F92) ||defined(_EZ80F93)
outp(EZ80_TMR0_CTL, 0x57);
#endif
/* Enable timer end-of-count interrupts */
#if defined(_EZ80F91)
outp(EZ80_TMR0_IER, EZ80_TMRIER_EOCEN);
#endif
}

View File

@@ -0,0 +1,308 @@
;**************************************************************************
; arch/z80/src/ez80/ez80_vectors.asm
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Constants
;**************************************************************************
NVECTORS EQU 64 ; max possible interrupt vectors
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
xref _ez80_startup
xref _up_doirq
;**************************************************************************
; Global Symbols Exported
;**************************************************************************
xdef _ez80_reset
xdef _ez80_initvectors
xdef _ez80_handlers
xdef _ez80_rstcommon
xdef _ez80_initvectors
xdef _ez80_vectable
;**************************************************************************
; Macros
;**************************************************************************
; Define one reset handler
; 1. Disable interrupts
; 2. Dlear mixed memory mode (MADL) flag
; 3. jump to initialization procedure with jp.lil to set ADL
rstvector: macro
di
rsmix
jp.lil _ez80_startup
endmac rstvector
; Define one interrupt handler
irqhandler: macro vectno
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #vectno ; A = vector number
jp _ez80_rstcommon ; Remaining RST handling is common
endmac irqhandler
;**************************************************************************
; Reset entry points
;**************************************************************************
define .RESET, space = ROM
segment .RESET
_ez80_reset:
_rst0:
rstvector
_rst8:
rstvector
_rst10:
rstvector
_rst18:
rstvector
_rst20:
rstvector
_rst28:
rstvector
_rst30:
rstvector
_rst38:
rstvector
ds %26
_nmi:
retn
;**************************************************************************
; Startup logic
;**************************************************************************
define .STARTUP, space = ROM
segment .STARTUP
.assume ADL=1
;**************************************************************************
; Interrupt Vector Handling
;**************************************************************************
_ez80_handlers:
irqhandler 0
handlersize equ $-_ez80handlers
irqhandler 1
irqhandler 2
irqhandler 3
irqhandler 4
irqhandler 5
irqhandler 6
irqhandler 7
irqhandler 8
irqhandler 9
irqhandler 10
irqhandler 11
irqhandler 12
irqhandler 13
irqhandler 14
irqhandler 15
irqhandler 16
irqhandler 17
irqhandler 18
irqhandler 19
irqhandler 20
irqhandler 21
irqhandler 22
irqhandler 23
irqhandler 24
irqhandler 25
irqhandler 26
irqhandler 27
irqhandler 28
irqhandler 29
irqhandler 30
irqhandler 31
irqhandler 32
irqhandler 33
irqhandler 34
irqhandler 35
irqhandler 36
irqhandler 37
irqhandler 38
irqhandler 39
irqhandler 40
irqhandler 41
irqhandler 42
irqhandler 43
irqhandler 44
irqhandler 45
irqhandler 46
irqhandler 47
irqhandler 48
irqhandler 49
irqhandler 50
irqhandler 51
irqhandler 52
irqhandler 53
irqhandler 54
irqhandler 55
irqhandler 56
irqhandler 57
irqhandler 58
irqhandler 59
irqhandler 60
irqhandler 61
irqhandler 62
irqhandler 63
;**************************************************************************
; Common Interrupt handler
;**************************************************************************
_ez80_rstcommon:
; Create a register frame. SP points to top of frame + 4, pushes
; decrement the stack pointer. Already have
;
; Offset 8: Return PC is already on the stack
; Offset 7: AF (retaining flags)
;
; IRQ number is in A
push hl ; Offset 6: HL
ld hl, #(3*2) ; HL is the value of the stack pointer before
add hl, sp ; the interrupt occurred
push hl ; Offset 5: Stack pointer
push iy ; Offset 4: IY
push ix ; Offset 3: IX
push de ; Offset 2: DE
push bc ; Offset 1: BC
ld b, a ; Save the reset number in B
ld a, i ; Carry bit holds interrupt state
push af ; Offset 0: I with interrupt state in carry
di
; Call the interrupt decode logic. SP points to the beggining of the reg structure
ld hl, #0 ; Argument #2 is the beginning of the reg structure
add hl, sp ;
push hl ; Place argument #2 at the top of stack
push bc ; Argument #1 is the Reset number
inc sp ; (make byte sized)
call _up_doirq ; Decode the IRQ
; On return, HL points to the beginning of the reg structure to restore
; Note that (1) the arguments pushed on the stack are not popped, and (2) the
; original stack pointer is lost. In the normal case (no context switch),
; HL will contain the value of the SP before the arguments wer pushed.
ld sp, hl ; Use the new stack pointer
; Restore registers. HL points to the beginning of the reg structure to restore
ex af, af' ; Select alternate AF
pop af ; Offset 0: AF' = I with interrupt state in carry
ex af, af' ; Restore original AF
pop bc ; Offset 1: BC
pop de ; Offset 2: DE
pop ix ; Offset 3: IX
pop iy ; Offset 4: IY
exx ; Use alternate BC/DE/HL
ld hl, #-2 ; Offset of SP to account for ret addr on stack
pop de ; Offset 5: HL' = Stack pointer after return
add hl, de ; HL = Stack pointer value before return
exx ; Restore original BC/DE/HL
pop hl ; Offset 6: HL
pop af ; Offset 7: AF
; Restore the stack pointer
exx ; Use alternate BC/DE/HL
ld sp, hl ; Set SP = saved stack pointer value before return
exx ; Restore original BC/DE/HL
; Restore interrupt state
ex af, af' ; Recover interrupt state
jr nc, nointenable ; No carry, IFF2=0, means disabled
ex af, af' ; Restore AF (before enabling interrupts)
ei ; yes
reti
nointenable:
ex af, af' ; Restore AF
reti
;**************************************************************************
; Vector Setup Logic
;**************************************************************************
_ez80_initvectors:
; Initialize the vector table
ld iy, _ez80_vectable
ld bc, 4
ld b, NVECTORS
ld hl, _ez80_handlers
ld de, handlersize
ld a, 0
$1:
ld (iy), hl ; Store IRQ handler
ld (iy+3), a ; Pad to 4 bytes
add hl, de ; Point to next handler
add iy, bc ; Point to next entry in vector table
djnz $1 ; Loop until all vectors have been written
; Select interrupt mode 2
im 2 ; Interrupt mode 2
; Write the address of the vector table into the interrupt vector base
ld hl, _ez80_vectable >> 8
ld i, hl
ret
;**************************************************************************
; Vector Table
;**************************************************************************
; This segment must be aligned on a 512 byte boundary anywhere in RAM
; Each entry will be a 3-byte address in a 4-byte space
define .IVECTS, space = RAM, align = 200h
segment .IVECTS
_ez80_vectable:
ds NVECTORS * 4

View File

@@ -0,0 +1,257 @@
;**************************************************************************
; arch/z80/src/ez80/ez80f91_init.asm
;
; 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 name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Included Files
;**************************************************************************
include "ez80f91.inc"
;**************************************************************************
; Constants
;**************************************************************************
;PLL_DIV_L EQU %5C
;PLL_DIV_H EQU %5D
;PLL_CTL0 EQU %5E
;PLL_CTL1 EQU %5F
OSC EQU 0
PLL EQU 1
RTC EQU 2
CLK_MUX_OSC EQU %00
CLK_MUX_PLL EQU %01
CLK_MUX_RTC EQU %02
CHRP_CTL_0 EQU %00
CHRP_CTL_1 EQU %40
CHRP_CTL_2 EQU %80
CHRP_CTL_3 EQU %C0
LDS_CTL_0 EQU %00
LDS_CTL_1 EQU %04
LDS_CTL_2 EQU %08
LDS_CTL_3 EQU %0C
LCK_STATUS EQU %20
INT_LOCK EQU %10
INT_UNLOCK EQU %08
INT_LOCK_EN EQU %04
INT_UNLOCK_EN EQU %02
PLL_ENABLE EQU %01
;**************************************************************************
; Global symbols used
;**************************************************************************
; Exported symbols
xdef _ez80_init
xdef _ez80_initsysclk
; Imported symbols
xref __CS0_LBR_INIT_PARAM
xref __CS0_UBR_INIT_PARAM
xref __CS0_CTL_INIT_PARAM
xref __CS1_LBR_INIT_PARAM
xref __CS1_UBR_INIT_PARAM
xref __CS1_CTL_INIT_PARAM
xref __CS2_LBR_INIT_PARAM
xref __CS2_UBR_INIT_PARAM
xref __CS2_CTL_INIT_PARAM
xref __CS3_LBR_INIT_PARAM
xref __CS3_UBR_INIT_PARAM
xref __CS3_CTL_INIT_PARAM
xref __CS0_BMC_INIT_PARAM
xref __CS1_BMC_INIT_PARAM
xref __CS2_BMC_INIT_PARAM
xref __CS3_BMC_INIT_PARAM
xref __FLASH_CTL_INIT_PARAM
xref __FLASH_ADDR_U_INIT_PARAM
xref __RAM_CTL_INIT_PARAM
xref __RAM_ADDR_U_INIT_PARAM
xref _SYS_CLK_SRC
xref _SYS_CLK_FREQ
xref _OSC_FREQ
xref _OSC_FREQ_MULT
xref __PLL_CTL0_INIT_PARAM
;**************************************************************************
; Chip-specific initialization logic
;**************************************************************************
; Minimum default initialization for eZ80F91
define .STARTUP, space = ROM
segment .STARTUP
.assume ADL = 1
_ez80_init:
; Disable internal peripheral interrupt sources
ld a, %ff
out0 (PA_DDR), a ; GPIO
out0 (PB_DDR), a
out0 (PC_DDR), a
out0 (PD_DDR), a
ld a, %00
out0 (PA_ALT1), a
out0 (PB_ALT1), a
out0 (PC_ALT1), a
out0 (PD_ALT1), a
out0 (PA_ALT2), a
out0 (PB_ALT2), a
out0 (PC_ALT2), a
out0 (PD_ALT2), a
out0 (PLL_CTL1), a ; PLL
out0 (TMR0_IER), a ; timers
out0 (TMR1_IER), a
out0 (TMR2_IER), a
out0 (TMR3_IER), a
out0 (UART0_IER), a ; UARTs
out0 (UART1_IER), a
out0 (I2C_CTL), a ; I2C
out0 (EMAC_IEN), a ; EMAC
out0 (FLASH_IRQ), a ; Flash
ld a, %04
out0 (SPI_CTL), a ; SPI
in0 a, (RTC_CTRL) ; RTC,
and a, %be
out0 (RTC_CTRL), a
; Configure external memory/io
ld a, __CS0_LBR_INIT_PARAM
out0 (CS0_LBR), a
ld a, __CS0_UBR_INIT_PARAM
out0 (CS0_UBR), a
ld a, __CS0_BMC_INIT_PARAM
out0 (CS0_BMC), a
ld a, __CS0_CTL_INIT_PARAM
out0 (CS0_CTL), a
ld a, __CS1_LBR_INIT_PARAM
out0 (CS1_LBR), a
ld a, __CS1_UBR_INIT_PARAM
out0 (CS1_UBR), a
ld a, __CS1_BMC_INIT_PARAM
out0 (CS1_BMC), a
ld a, __CS1_CTL_INIT_PARAM
out0 (CS1_CTL), a
ld a, __CS2_LBR_INIT_PARAM
out0 (CS2_LBR), a
ld a, __CS2_UBR_INIT_PARAM
out0 (CS2_UBR), a
ld a, __CS2_BMC_INIT_PARAM
out0 (CS2_BMC), a
ld a, __CS2_CTL_INIT_PARAM
out0 (CS2_CTL), a
ld a, __CS3_LBR_INIT_PARAM
out0 (CS3_LBR), a
ld a, __CS3_UBR_INIT_PARAM
out0 (CS3_UBR), a
ld a, __CS3_BMC_INIT_PARAM
out0 (CS3_BMC), a
ld a, __CS3_CTL_INIT_PARAM
out0 (CS3_CTL), a
; Enable internal memory
ld a, __FLASH_ADDR_U_INIT_PARAM
out0 (FLASH_ADDR_U), a
ld a, __FLASH_CTL_INIT_PARAM
out0 (FLASH_CTRL), a
ld a, __RAM_ADDR_U_INIT_PARAM
out0 (RAM_ADDR_U), a
ld a, __RAM_CTL_INIT_PARAM
out0 (RAM_CTL), a
ret
;*****************************************************************************
; eZ80F91 System Clock Initialization
;*****************************************************************************
_ez80_initsysclk:
; check if the PLL should be used
ld a, (_ez80_sysclksrc)
cp a, PLL
jr nz, _ez80_initsysclkdone
; Load PLL divider
ld a, (_ez80_oscfreqmult) ;CR 6202
out0 (PLL_DIV_L), a
ld a, (_ez80_oscfreqmult+1)
out0 (PLL_DIV_H), a
; Set charge pump and lock criteria
ld a, __PLL_CTL0_INIT_PARAM
and a, %CC ; mask off reserved and clock source bits
out0 (PLL_CTL0), a
; Enable PLL
in0 a, (PLL_CTL1)
set 0, a
out0 (PLL_CTL1), a
; Wait for PLL to lock
_ez80_initsysclkwait:
in0 a, (PLL_CTL1)
and a, LCK_STATUS
cp a, LCK_STATUS
jr nz, _ez80_initsysclkwait
; Select PLL as system clock source
ld a, __PLL_CTL0_INIT_PARAM
set 0, a
out0 (PLL_CTL0), a
_ez80_initsysclkdone:
ret
;_ez80_oscfreq:
; dl _OSC_FREQ
_ez80_oscfreqmult:
dw _OSC_FREQ_MULT
;_ez80_sysclkfreq:
; dl _SYS_CLK_FREQ
_ez80_sysclksrc:
db _SYS_CLK_SRC
end

161
arch/z80/src/ez80/switch.h Normal file
View File

@@ -0,0 +1,161 @@
/************************************************************************************
* arch/z80/src/ez80/switch.h
* arch/z80/src/chip/switch.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __EZ80_SWITCH_H
#define __EZ80_SWITCH_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <sys/types.h>
#ifndef __ASSEMBLY__
# include <nuttx/sched.h>
# include <nuttx/arch.h>
#endif
#include "common/up_internal.h"
/************************************************************************************
* Definitions
************************************************************************************/
/* Macros for portability ***********************************************************
*
* Common logic in arch/z80/src/common is customized for the z8 context switching
* logic via the following macros.
*/
/* Initialize the IRQ state */
#define INIT_IRQCONTEXT() current_regs = NULL
/* IN_INTERRUPT returns TRUE if the system is current operating in the interrupt
* context. IN_INTERRUPT is the inline equivalent of up_interrupt_context().
*/
#define IN_INTERRUPT() (current_regs != NULL)
/* The following macro is used when the system enters interrupt handling logic */
#define IRQ_ENTER(irq, regs) current_regs = (regs)
/* The following macro is used when the system exits interrupt handling logic */
#define IRQ_LEAVE(irq) current_regs = NULL
/* The following macro is used to sample the interrupt state (as a opaque handle) */
#define IRQ_STATE() (current_regs)
/* Save the current IRQ context in the specified TCB */
#define SAVE_IRQCONTEXT(tcb) ez80_copystate((tcb)->xcp.regs, current_regs)
/* Set the current IRQ context to the state specified in the TCB */
#define SET_IRQCONTEXT(tcb) ez80_copystate(current_regs, (tcb)->xcp.regs)
/* Save the user context in the specified TCB. User context saves can be simpler
* because only those registers normally saved in a C called need be stored.
*/
#define SAVE_USERCONTEXT(tcb) ez80_saveusercontext((tcb)->xcp.regs)
/* Restore the full context -- either a simple user state save or the full,
* IRQ state save.
*/
#define RESTORE_USERCONTEXT(tcb) ez80_restorecontext((tcb)->xcp.regs)
/* Dump the current machine registers */
#define _REGISTER_DUMP() ez80_registerdump()
/************************************************************************************
* Public Types
************************************************************************************/
/************************************************************************************
* Public Variables
************************************************************************************/
#ifndef __ASSEMBLY__
/* This holds a references to the current interrupt level register storage structure.
* If is non-NULL only during interrupt processing.
*/
extern chipreg_t *current_regs;
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/* Defined in ez80_copystate.c */
EXTERN void ez80_copystate(chipreg_t *dest, const chipreg_t *src);
/* Defined in ez80_saveusercontext.asm */
EXTERN int ez80_saveusercontext(chipreg_t *regs);
/* Defined in ez80_restorecontext.asm */
EXTERN void ez80_restorecontext(chipreg_t *regs);
/* Defined in ez80_sigsetup.c */
EXTERN void ez80_sigsetup(_TCB *tcb, sig_deliver_t sigdeliver, chipreg_t *regs);
/* Defined in ez80_registerdump.c */
EXTERN void ez80_registerdump(void);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __EZ80_SWITCH_H */

View File

@@ -0,0 +1,86 @@
/************************************************************************************
* arch/z80/src/ez80/up_mem.h
* arch/z80/src/chip/up_mem.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __EZ80_UP_MEM_H
#define __EZ80_UP_MEM_H
/************************************************************************************
* Included Files
************************************************************************************/
/************************************************************************************
* Definitions
************************************************************************************/
/* For the ZiLOG ZDS-II toolchain(s), the heap will be set using linker-
* defined values:
*
* _heapbot : set to the last used address + 1 in RAM
* _stack : set to the highest address + 1 in RAM
*
* The top of the heap is then determined by the amount of stack setaside
* in the NuttX configuration file
*/
#ifndef CONFIG_HEAP1_BASE
extern unsigned long _heapbot;
# define CONFIG_HEAP1_BASE ((uint24)&_heapbot)
#endif
#ifndef CONFIG_HEAP1_END
extern unsigned long _stack;
# define CONFIG_HEAP1_END (((uint24)&_stack) - CONFIG_PROC_STACK_SIZE)
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __EZ80_UP_MEM_H */

86
arch/z80/src/z8/up_mem.h Normal file
View File

@@ -0,0 +1,86 @@
/************************************************************************************
* arch/z80/src/z8/up_mem.h
* arch/z80/src/chip/up_mem.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __Z8_UP_MEM_H
#define __Z8_UP_MEM_H
/************************************************************************************
* Included Files
************************************************************************************/
/************************************************************************************
* Definitions
************************************************************************************/
/* For the ZiLOG ZDS-II toolchain(s), the heap will be set using linker-
* defined values:
*
* far_heapbot : set to the offset to the first unused value in EDATA
* far_stacktop : set to the highest address in EDATA
*
* The top of the heap is then determined by the amount of stack setaside
* in the NuttX configuration file
*/
#ifndef CONFIG_HEAP1_BASE
extern far unsigned long far_heapbot;
# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot)
#endif
#ifndef CONFIG_HEAP1_END
extern far unsigned long far_stacktop;
# define CONFIG_HEAP1_END (((uint16)&far_stacktop) - CONFIG_PROC_STACK_SIZE + 1)
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __Z8_UP_MEM_H */

View File

@@ -216,7 +216,7 @@ static uart_dev_t g_uart1port =
{ 0 }, /* recv.sem */
0, /* recv.head */
0, /* recv.tail */
CONFIG_UART0_RXBUFSIZE, /* recv.size */
CONFIG_UART1_RXBUFSIZE, /* recv.size */
g_uart0rxbuffer, /* recv.buffer */
},
&g_uart_ops, /* ops */

View File

@@ -60,12 +60,13 @@
# define getreg8(a) (*(volatile ubyte *)(a))
# define putreg8(v,a) (*(volatile ubyte *)(a) = (v))
# define getreg16(a) (*(volatile uint16 *)(a))
# define putreg16(v,a) (*(volatile uint16 *)(a) = (v))
# define getreg32(a) (*(volatile uint32 *)(a))
# define putreg32(v,a) (*(volatile uint32 *)(a) = (v))
# define getreg(a) getreg16(1)
# define putreg(v,a) putreg16(v,a)
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/

View File

@@ -56,7 +56,7 @@
****************************************************************************/
/* This holds a references to the current interrupt level register storage
* structure. If is non-NULL only during interrupt processing.
* structure. If is non-NULL only during interrupt processing.
*/
chipreg_t *current_regs;

View File

@@ -85,7 +85,7 @@ static void z80_registerdump(void)
current_regs[XCPT_BC], current_regs[XCPT_DE], current_regs[XCPT_HL]);
lldbg("IX: %04x IY: %04x\n",
current_regs[XCPT_IX], current_regs[XCPT_IY]);
lldbg("SP: %04x PC: $04x\n"
lldbg("SP: %04x PC: %04x\n"
current_regs[XCPT_SP], current_regs[XCPT_PC]);
}
}

View File

@@ -348,6 +348,16 @@ configs/z8encore000zco
development kit, Z8F6403 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
configs/z8f64200100kit
z8Encore! Microcontroller. This port use the Zilog z8f64200100kit
development kit, Z8F6423 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
configs/ez80f0910200kitg
ez80Acclaim! Microcontroller. This port use the Zilog ez80f0910200kitg
development kit, eZ80F091 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
configs/z80sim
z80 Microcontroller. This port uses a Z80 instruction set simulator.
That simulator can be found in the NuttX CVS at

View File

@@ -0,0 +1,57 @@
README.txt
^^^^^^^^^^
ZDS-II Compiler Versions
^^^^^^^^^^^^^^^^^^^^^^^^
4.11.0
This is the only version that this code has been built against.
Although it compiles without error, the 4.11.0 compiler generates
bad code on one of the files, mm/mm_initialize.c. Below is a simple work-
around.
--- mm/mm_initialize.c.SAVE 2008-02-13 08:06:46.833857700 -0600
+++ mm/mm_initialize.c 2008-02-13 08:07:26.367608900 -0600
@@ -94,8 +94,11 @@
{
int i;
+#if 0 /* DO NOT CHECK IN */
CHECK_ALLOCNODE_SIZE;
CHECK_FREENODE_SIZE;
+#endif
/* Set up global variables */
Other Versions
If you use any version of ZDS-II other than 4.11.0 or if you install ZDS-II
at any location other than the default location, you will have to modify
two files: (1) configs/ez80f910200kitg/*/setenv.sh and (2)
configs/ez80f910200kitg/*/Make.defs.
Configuration Subdirectories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- src/ and include/
These directories contain common logic for all ez80f910200kitg
configurations.
Variations on the basic ez80f910200kitg configuration are maintained
in subdirectories. To configure any specific configuration, do the
following steps:
cd <nuttx-top-directory>/tools
./configure.sh ez80f910200kitg/<sub-directory>
cd <nuttx-top-directgory>
make
Where <sub-directory> is the specific board configuration that you
wish to build. The following board-specific configurations are
available:
- ostest
This builds the examples/ostest application for execution from FLASH.
See examples/README.txt for information about ostest.
Check out any README.txt files in these <sub-directory>s.

View File

@@ -0,0 +1,76 @@
/****************************************************************************
* arch/ez80f910200kitg/include/board.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H
#define __ARCH_BOARD_BOARD_H
/****************************************************************************
* Included Files
****************************************************************************/
/****************************************************************************
* Definitions
****************************************************************************/
/* LED pattern definitions */
#define LED_STARTED 0
#define LED_HEAPALLOCATE 1
#define LED_IRQSENABLED 2
#define LED_STACKCREATED 3
#define LED_IDLE 4
#define LED_INIRQ 5
#define LED_ASSERTION 6
#define LED_SIGNAL 6
#define LED_PANIC 7
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ARCH_BOARD_BOARD_H */

View File

@@ -0,0 +1,171 @@
############################################################################
# configs/ez80f910200kitg/ostest/Make.defs
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
# These are the directories where the ZDS-II toolchain is installed
ZDSINSTALLDIR := C:/Program\ Files/ZiLOG/ZDSII_eZ80Acclaim!_4.11.0
ZDSBINDIR := $(ZDSINSTALLDIR)/bin
ZDSSTDINCDIR := $(ZDSINSTALLDIR)/include/std
ZDSZILOGINCDIR := $(ZDSINSTALLDIR)/include/zilog
ZDSSTDLIBDIR := $(ZDSINSTALLDIR)/lib/std
ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)/lib/zilog
# These are the same directories but with the directory separator
# character swapped as needed by the ZDS-II compiler
WTOPDIR := ${shell cygpath -w $(TOPDIR)}
WZDSSTDINCDIR := ${shell cygpath -w $(ZDSSTDINCDIR)}
WZDSZILOGINCDIR := ${shell cygpath -w $(ZDSZILOGINCDIR)}
WZDSSTDLIBDIR := ${shell cygpath -w $(ZDSSTDLIBDIR)}
WZDSZILOGLIBDIR := ${shell cygpath -w $(ZDSZILOGLIBDIR)}
# Escaped versions
ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"}
EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"}
EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"}
# Assembler definitions
ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y)
ARCHCPU = eZ80F91
ARCHCPUDEF = _EZ80F91
ARCHFAMILY = _EZ80ACCLAIM!
endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHASMOPTIMIZATION = -debug -NOsdiopt
else
ARCHASMOPTIMIZATION = -nodebug -NOsdiopt
endif
ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase
ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet
ARCHASMWARNINGS = -warn
ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__
ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)'
EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)'
AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \
$(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)
# Compiler definitions
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -debug -reduceopt
else
ARCHOPTIMIZATION = -nodebug -optsize
endif
ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \
-asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)"
ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm
ARCHPICFLAGS =
ARCHWARNINGS = -warn
ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF)
ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)'
ARCHUSRINCLUDES = -usrinc:'.'
ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES)
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES)
CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__
CPPINCLUDES = -I$(TOPDIR)/include
CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES)
# Librarian definitions
ARFLAGS = -quiet -warn
# Linker definitions
LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200kitg/ostest/ostest.linkcmd
# Tool names/pathes
CROSSDEV =
CC = $(ZDSBINDIR)/eZ80cc.exe
CPP = gcc -E
LD = $(ZDSBINDIR)/eZ80link.exe
AS = $(ZDSBINDIR)/eZ80asm.exe
AR = $(ZDSBINDIR)/eZ80lib.exe
# File extensions
ASMEXT = .asm
OBJEXT = .obj
LIBEXT = .lib
EXEEXT = .lod
HEXEXT = .hex
# These are the macros that will be used in the NuttX make system
# to compile and assembly source files and to insert the resulting
# object files into an archive
define COMPILE
@#echo "CC: $1"
@$(CC) $(CFLAGS) $1
endef
define ASSEMBLE
@#echo "AS: $1"
@$(AS) -c $(AFLAGS) $1
endef
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
endef
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
endef
# This is the tool to use for dependencies (i.e., none)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies
DIRLINK = $(TOPDIR)/tools/winlink.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
# Linux/Cygwin host tool definitions
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =

View File

@@ -0,0 +1,12 @@
README.txt
^^^^^^^^^^
ostest.zdsproj is a simple ZDS-II project that will allow you
to use the ZDS-II debugger. Before using, copy the following
files from the toplevel directory:
nuttx.hex, nuttx.map, nuttx.lod
to this directory as:
ostest.hex, ostest.map, ostest.lod

View File

@@ -0,0 +1,348 @@
############################################################################
# configs/ez80f910200kitg/ostest/defconfig
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
#
# Architecture selection
#
# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
# processor architecture.
# CONFIG_ARCH_name - for use in C code. This identifies the particular
# processor architecture or, more accurately, the specific directory under
# nuttx/arch to use (CONFIG_ARCH_Z80 specifies nuttx/arch/z80).
# CONFIG_ARCH_CHIP - Identifies the specific chip or SoC that implements the
# architecture.
# CONFIG_ARCH_CHIP_chip - for use in C code. This identifies the
# particular chip or SoC that the architecture is implemented
# in (CONFIG_ARCH_CHIP_EZ80)
# CONFIG_ARCH_CHIP_EZ80F91 - Identifies ez80 chip variant
# CONFIG_ARCH_CHIP_EZ80F92
# CONFIG_ARCH_CHIP_EZ80F93
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
# the board that supports the particular chip or SoC.
# CONFIG_ARCH_BOARD_name - for use in C code
# CONFIG_BOARD_LOOPSPERMSEC - for delay loops
# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
# CONFIG_DRAM_SIZE - Describes the installed DRAM.
# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to z8 board architecture.
#
CONFIG_ARCH=z80
CONFIG_ARCH_Z80=y
CONFIG_ARCH_CHIP=ez80
CONFIG_ARCH_CHIP_EZ80=y
CONFIG_ARCH_CHIP_EZ80F91=y
CONFIG_ARCH_CHIP_EZ80F92=n
CONFIG_ARCH_CHIP_EZ80F93=n
CONFIG_ARCH_BOARD=ez80f910200kitg
CONFIG_ARCH_BOARD_EZ80F910200KITG=y
CONFIG_BOARD_LOOPSPERMSEC=1250
CONFIG_ENDIAN_BIG=y
CONFIG_DRAM_SIZE=65536
CONFIG_ARCH_LEDS=n
#
# eZ8 specific device driver settings
#
# CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
# console and ttyS0 (default is the UART0).
# CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
# This specific the size of the receive buffer
# CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
# being sent. This specific the size of the transmit buffer
# CONFIG_UARTn_BAUD - The configure BAUD of the UART.
# CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
# CONFIG_UARTn_2STOP - 0=1 stop bit; 1=Two stop bits
#
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_UART1_SERIAL_CONSOLE=n
CONFIG_UART0_TXBUFSIZE=0
CONFIG_UART1_TXBUFSIZE=0
CONFIG_UART0_RXBUFSIZE=0
CONFIG_UART1_RXBUFSIZE=0
CONFIG_UART0_BAUD=57600
CONFIG_UART1_BAUD=57600
CONFIG_UART0_PARITY=0
CONFIG_UART1_PARITY=0
CONFIG_UART0_2STOP=0
CONFIG_UART1_2STOP=0
#
# General build options
#
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
# BSPs from www.ridgerun.com
# CONFIG_HAVE_LIBM - toolchain supports libm.a
#
CONFIG_RRLOAD_BINARY=n
CONFIG_HAVE_LIBM=n
#
# General OS setup
#
# CONFIG_EXAMPLE - identifies the subdirectory in examples
# that will be used in the build
# CONFIG_DEBUG - enables built-in debug options
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
# CONFIG_MM_REGIONS - If the architecture includes multiple
# regions of memory to allocate from, this specifies the
# number of memory regions that the memory manager must
# handle and enables the API mm_addregion(start, end);
# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
# time console output
# CONFIG_HAVE_GETPUTC - architecture supports low-level, boot
# time console input
# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
# or TICKS_PER_MSEC=10. This setting may be defined to
# inform NuttX that the processor hardware is providing
# system timer interrupts at some interrupt interval other
# than 10 msec.
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
# this number of milliseconds; Round robin scheduling can
# be disabled by setting this value to zero.
# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
# scheduler to monitor system performance
# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
# task name to save in the TCB. Useful if scheduler
# instrumentation is selected. Set to zero to disable.
# CONFIG_JULIAN_TIME - Enables Julian time conversions
# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
# Used to initialize the internal time logic.
# CONFIG_HAVE_LOWUARTINIT - Provides low-level UART initialization
# logic as up_lowuartinit (only needed if there is no
# serial driver).
# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
# provides /dev/console. Enables stdout, stderr, stdin.
# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
# driver (minimul support)
#
CONFIG_EXAMPLE=ostest
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_MM_REGIONS=1
CONFIG_ARCH_LOWPUTC=y
CONFIG_RR_INTERVAL=0
CONFIG_SCHED_INSTRUMENTATION=n
CONFIG_TASK_NAME_SIZE=0
CONFIG_START_YEAR=2008
CONFIG_START_MONTH=2
CONFIG_START_DAY=17
CONFIG_JULIAN_TIME=n
CONFIG_HAVE_LOWUARTINIT=y
CONFIG_DEV_CONSOLE=n
CONFIG_DEV_LOWCONSOLE=n
#
# The following can be used to disable categories of
# APIs supported by the OS. If the compiler supports
# weak functions, then it should not be necessary to
# disable functions unless you want to restrict usage
# of those APIs.
#
# There are certain dependency relationships in these
# features.
#
# o mq_notify logic depends on signals to awaken tasks
# waiting for queues to become full or empty.
# o pthread_condtimedwait() depends on signals to wake
# up waiting tasks.
#
CONFIG_DISABLE_CLOCK=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
CONFIG_DISABLE_SIGNALS=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_MOUNTPOINT=y
CONFIG_DISABLE_ENVIRON=y
#
# Misc libc settings
#
# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
# little smaller if we do not support fieldwidthes
#
CONFIG_NOPRINTF_FIELDWIDTH=y
#
# Allow for architecture optimized implementations
#
# The architecture can provide optimized versions of the
# following to improve sysem performance
#
CONFIG_ARCH_MEMCPY=n
CONFIG_ARCH_MEMCMP=n
CONFIG_ARCH_MEMMOVE=n
CONFIG_ARCH_MEMSET=n
CONFIG_ARCH_STRCMP=n
CONFIG_ARCH_STRCPY=n
CONFIG_ARCH_STRNCPY=n
CONFIG_ARCH_STRLEN=n
CONFIG_ARCH_BZERO=n
CONFIG_ARCH_KMALLOC=n
CONFIG_ARCH_KZMALLOC=n
CONFIG_ARCH_KFREE=n
#
# Sizes of configurable things (0 disables)
#
# CONFIG_MAX_TASKS - The maximum number of simultaneously
# active tasks. This value must be a power of two.
# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
# of parameters that a task may receive (i.e., maxmum value
# of 'argc')
# CONFIG_NPTHREAD_KEYS - The number of items of thread-
# specific data that can be retained
# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
# descriptors (one for each open)
# CONFIG_NFILE_STREAMS - The maximum number of streams that
# can be fopen'ed
# CONFIG_NAME_MAX - The maximum size of a file name.
# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
# CONFIG_NUNGET_CHARS - Number of characters that can be
# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
# structures. The system manages a pool of preallocated
# message structures to minimize dynamic allocations
# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
# a fixed payload size given by this settin (does not include
# other message structure overhead.
# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
# can be passed to a watchdog handler
# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
# structures. The system manages a pool of preallocated
# watchdog structures to minimize dynamic allocations
# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
# timer structures. The system manages a pool of preallocated
# timer structures to minimize dynamic allocations. Set to
# zero for all dynamic allocations.
#
CONFIG_MAX_TASKS=8
CONFIG_MAX_TASK_ARGS=4
CONFIG_NPTHREAD_KEYS=0
CONFIG_NFILE_DESCRIPTORS=0
CONFIG_NFILE_STREAMS=0
CONFIG_NAME_MAX=32
CONFIG_STDIO_BUFFER_SIZE=0
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_MQ_MSGS=0
CONFIG_MQ_MAXMSGSIZE=0
CONFIG_MAX_WDOGPARMS=2
CONFIG_PREALLOC_WDOGS=4
CONFIG_PREALLOC_TIMERS=0
#
# TCP/IP and UDP support via uIP
# CONFIG_NET - Enable or disable all network features
# CONFIG_NET_IPv6 - Build in support for IPv6
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
# CONFIG_NET_BUFSIZE - uIP buffer size
# CONFIG_NET_TCP - TCP support on or off
# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
# CONFIG_NET_UDP - UDP support on or off
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
# CONFIG_NET_ICMP - ICMP ping support on or off
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
# CONFIG_NET_STATISTICS - uIP statistics on or off
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
# CONFIG_NET_BROADCAST - Broadcast support
# CONFIG_NET_LLH_LEN - The link level header length
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
CONFIG_NET=n
CONFIG_NET_IPv6=n
CONFIG_NSOCKET_DESCRIPTORS=0
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
CONFIG_NET_UDP=n
CONFIG_NET_UDP_CHECKSUMS=y
#CONFIG_NET_UDP_CONNS=10
CONFIG_NET_ICMP=n
#CONFIG_NET_PINGADDRCONF=0
CONFIG_NET_STATISTICS=y
#CONFIG_NET_RECEIVE_WINDOW=
#CONFIG_NET_ARPTAB_SIZE=8
CONFIG_NET_BROADCAST=n
#CONFIG_NET_LLH_LEN=14
#CONFIG_NET_FWCACHE_SIZE=2
#
# UIP Network Utilities
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
CONFIG_NET_DHCP_LIGHT=n
CONFIG_NET_RESOLV_ENTRIES=4
#
# Settings for examples/ostest
CONFIG_OSTEST_STACKSIZE=256
#
# Settings for examples/nsh
CONFIG_EXAMPLES_NSH_TELNET=n
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE=512
CONFIG_EXAMPLES_NSH_CMD_SIZE=40
CONFIG_EXAMPLES_NSH_STACKSIZE=512
CONFIG_EXAMPLES_NSH_DHCPC=n
CONFIG_EXAMPLES_NSH_NOMAC=n
CONFIG_EXAMPLES_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
#
# Stack and heap information
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
# operation from FLASH.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
# all stack operations outside of the nuttx model.
# CONFIG_STACK_POINTER - The initial stack pointer
# CONFIG_PROC_STACK_SIZE - The size of the initial stack
# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
CONFIG_BOOT_FROM_FLASH=n
CONFIG_CUSTOM_STACK=n
CONFIG_PROC_STACK_SIZE=256
CONFIG_PTHREAD_STACK_MIN=128
CONFIG_PTHREAD_STACK_DEFAULT=256
CONFIG_HEAP_SIZE=
CONFIG_HEAP_BASE=

View File

@@ -0,0 +1,94 @@
/****************************************************************************/
/* configs/ez80f910200kitg/ostest/ostest.linkcmd */
/* */
/* 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 name NuttX nor the names of its contributors may be */
/* used to endorse or promote products derived from this software */
/* without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
/* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
/* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS */
/* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED */
/* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
/* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
/* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/****************************************************************************/
-FORMAT=OMF695,INTEL32
-map -maxhexlen=64 -quiet -NOwarnoverlap -xref -unresolved=fatal
-sort NAME=ascending -warn -NOdebug -NOigcase
RANGE ROM $000000 : $03FFFF
RANGE RAM $B7E000 : $B7FFFF
RANGE EXTIO $000000 : $00FFFF
RANGE INTIO $000000 : $0000FF
CHANGE STRSECT = ROM
ORDER .RESET,.IVECTS,.STARTUP,CODE,DATA
COPY DATA ROM
DEFINE __low_romdata = copy base of DATA
DEFINE __low_data = base of DATA
DEFINE __len_data = length of DATA
DEFINE __low_bss = base of BSS
DEFINE __len_bss = length of BSS
DEFINE __stack = highaddr of RAM + 1
DEFINE __heaptop = highaddr of RAM
DEFINE __heapbot = top of RAM + 1
DEFINE __low_romcode = copy base of CODE
DEFINE __low_code = base of CODE
DEFINE __len_code = length of CODE
DEFINE __copy_code_to_ram = 0
DEFINE __crtl = 1
DEFINE __CS0_LBR_INIT_PARAM = $10
DEFINE __CS0_UBR_INIT_PARAM = $1f
DEFINE __CS0_CTL_INIT_PARAM = $a8
DEFINE __CS0_BMC_INIT_PARAM = $02
DEFINE __CS1_LBR_INIT_PARAM = $b8
DEFINE __CS1_UBR_INIT_PARAM = $b9
DEFINE __CS1_CTL_INIT_PARAM = $28
DEFINE __CS1_BMC_INIT_PARAM = $02
DEFINE __CS2_LBR_INIT_PARAM = $80
DEFINE __CS2_UBR_INIT_PARAM = $bf
DEFINE __CS2_CTL_INIT_PARAM = $28
DEFINE __CS2_BMC_INIT_PARAM = $02
DEFINE __CS3_LBR_INIT_PARAM = $60
DEFINE __CS3_UBR_INIT_PARAM = $7f
DEFINE __CS3_CTL_INIT_PARAM = $a8
DEFINE __CS3_BMC_INIT_PARAM = $02
DEFINE __RAM_CTL_INIT_PARAM = $C0
DEFINE __RAM_ADDR_U_INIT_PARAM = $B7
DEFINE __FLASH_CTL_INIT_PARAM = $68
DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
define _SYS_CLK_FREQ = 50000000
define _OSC_FREQ = 5000000
define _SYS_CLK_SRC = 1
define _OSC_FREQ_MULT = 10
define __PLL_CTL0_INIT_PARAM = $41
define _zsl_g_clock_xdefine = 50000000
/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */

View File

@@ -0,0 +1,247 @@
<project type="Executable" project-type="Standard" configuration="Debug" created-by="c:4.11:07071801" modified-by="c:4.11:07071801">
<cpu>eZ80F91</cpu>
<!-- file information -->
<files>
<file filter-key="flash">..\..\..\nuttx.hex</file>
</files>
<!-- configuration information -->
<configurations>
<configuration name="Debug" >
<tools>
<tool name="Assembler">
<options>
<option name="define" type="string" change-action="assemble">_EZ80ACCLAIM!=1,_SIMULATE=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">56</option>
<option name="pagewidth" type="integer" change-action="none">80</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="sdiopt" type="boolean" change-action="compile">true</option>
</options>
</tool>
<tool name="Compiler">
<options>
<option name="define" type="string" change-action="compile">_DEBUG,_EZ80F91,_EZ80ACCLAIM!,_SIMULATE</option>
<option name="genprintf" type="boolean" change-action="compile">false</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">true</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="modsect" type="boolean" change-action="compile">false</option>
<option name="optspeed" type="boolean" change-action="compile">false</option>
<option name="promote" type="boolean" change-action="compile">true</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
<option name="usrinc" type="string" change-action="compile"></option>
<option name="watch" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Debugger">
<options>
<option name="target" type="string" change-action="rebuild">eZ80DevPlatform_F91_Flash</option>
<option name="debugtool" type="string" change-action="none">Simulator</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="enableinfopage" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">false</option>
<option name="sn" type="string" change-action="none">0</option>
<option name="snsize" type="integer" change-action="none">0</option>
<option name="snstep" type="integer" change-action="none">0</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
<option name="snbigendian" type="boolean" change-action="none">true</option>
<option name="singleval" type="string" change-action="none">0</option>
<option name="singlevalformat" type="integer" change-action="none">0</option>
<option name="usepageerase" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
<option name="debug" type="boolean" change-action="assemble">true</option>
<option name="debugcache" type="boolean" change-action="none">true</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
<option name="outputdir" type="string" change-action="compile">Debug\</option>
</options>
</tool>
<tool name="Librarian">
<options>
<option name="outfile" type="string" change-action="build">.\Debug\ostest.lib</option>
</options>
</tool>
<tool name="Linker">
<options>
<option name="directives" type="string" change-action="build"></option>
<option name="createnew" type="boolean" change-action="build">true</option>
<option name="exeform" type="string" change-action="build">OMF695,INTEL32</option>
<option name="linkctlfile" type="string" change-action="build"></option>
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="objlibmods" type="string" change-action="build"></option>
<option name="of" type="string" change-action="build">..\..\..\nuttx</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="startuptype" type="string" change-action="build">Included</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnoverlap" type="boolean" change-action="none">true</option>
<option name="xref" type="boolean" change-action="none">true</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
<option name="sort" type="string" change-action="none">NAME</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="fplib" type="string" change-action="build">Real</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="linkconfig" type="string" change-action="build">Standard</option>
<option name="flashinfo" type="string" change-action="build">000000-0001FF</option>
<option name="ram" type="string" change-action="build">B7E000-B7FFFF</option>
<option name="rom" type="string" change-action="build">000000-03FFFF</option>
<option name="extio" type="string" change-action="build">000000-00FFFF</option>
<option name="intio" type="string" change-action="build">000000-0000FF</option>
</options>
</tool>
<tool name="Middleware">
<options>
<option name="usezsl" type="boolean" change-action="rebuild">false</option>
<option name="zslports" type="string" change-action="rebuild"></option>
<option name="zsluarts" type="string" change-action="rebuild"></option>
</options>
</tool>
</tools>
</configuration>
<configuration name="Release" >
<tools>
<tool name="Assembler">
<options>
<option name="define" type="string" change-action="assemble">_EZ80ACCLAIM!=1,_SIMULATE=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">56</option>
<option name="pagewidth" type="integer" change-action="none">80</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="sdiopt" type="boolean" change-action="compile">true</option>
</options>
</tool>
<tool name="Compiler">
<options>
<option name="define" type="string" change-action="compile">NDEBUG,_EZ80F91,_EZ80ACCLAIM!,_SIMULATE</option>
<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">false</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="modsect" type="boolean" change-action="compile">false</option>
<option name="optspeed" type="boolean" change-action="compile">false</option>
<option name="promote" type="boolean" change-action="compile">true</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
<option name="usrinc" type="string" change-action="compile"></option>
<option name="watch" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Debugger">
<options>
<option name="target" type="string" change-action="rebuild">eZ80DevPlatform_F91_Flash</option>
<option name="debugtool" type="string" change-action="none">Simulator</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="enableinfopage" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">false</option>
<option name="sn" type="string" change-action="none">0</option>
<option name="snsize" type="integer" change-action="none">0</option>
<option name="snstep" type="integer" change-action="none">0</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
<option name="snbigendian" type="boolean" change-action="none">true</option>
<option name="singleval" type="string" change-action="none">0</option>
<option name="singlevalformat" type="integer" change-action="none">0</option>
<option name="usepageerase" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
<option name="debug" type="boolean" change-action="assemble">false</option>
<option name="debugcache" type="boolean" change-action="none">false</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
<option name="outputdir" type="string" change-action="compile">.\Release\</option>
</options>
</tool>
<tool name="Librarian">
<options>
<option name="outfile" type="string" change-action="build">.\Release\ostest.lib</option>
</options>
</tool>
<tool name="Linker">
<options>
<option name="directives" type="string" change-action="build"></option>
<option name="createnew" type="boolean" change-action="build">true</option>
<option name="exeform" type="string" change-action="build">OMF695,INTEL32</option>
<option name="linkctlfile" type="string" change-action="build"></option>
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="objlibmods" type="string" change-action="build"></option>
<option name="of" type="string" change-action="build">.\Release\ostest</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="startuptype" type="string" change-action="build">Included</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnoverlap" type="boolean" change-action="none">true</option>
<option name="xref" type="boolean" change-action="none">true</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
<option name="sort" type="string" change-action="none">name</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="fplib" type="string" change-action="build">Real</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="linkconfig" type="string" change-action="build">Standard</option>
<option name="flashinfo" type="string" change-action="build">000000-0001FF</option>
<option name="ram" type="string" change-action="build">B7E000-B7FFFF</option>
<option name="rom" type="string" change-action="build">000000-03FFFF</option>
<option name="extio" type="string" change-action="build">000000-00FFFF</option>
<option name="intio" type="string" change-action="build">000000-0000FF</option>
</options>
</tool>
<tool name="Middleware">
<options>
<option name="usezsl" type="boolean" change-action="rebuild">false</option>
<option name="zslports" type="string" change-action="rebuild"></option>
<option name="zsluarts" type="string" change-action="rebuild"></option>
</options>
</tool>
</tools>
</configuration>
</configurations>
<!-- watch information -->
<watch-elements>
</watch-elements>
<!-- breakpoint information -->
<breakpoints>
</breakpoints>
</project>

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# configs/ez80f910200kitg/ostest/setenv.sh
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Check how we were executed
#
if [ "$(basename $0)" = "setenv.sh" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
#
# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and
# attempts to set the PATH variable do not have the desired effect.
# Instead, alias are provided for all of the ZDS-II command line tools.
# Version 4.10.1 installed in the default location is assumed here.
#
ZDSBINDIR="C:/Program\ Files/ZiLOG/ZDSII_eZ80Acclaim!_4.10.1/bin"
alias ez8asm="${ZDSBINDIR}/ez8asm.exe"
alias ez8cc="${ZDSBINDIR}/ez8cc.exe"
alias ez8lib="${ZDSBINDIR}/ez8lib.exe"
alias ez8link="${ZDSBINDIR}/ez8link.exe"

View File

@@ -0,0 +1,529 @@
This is the output from the z16f target from January 31, 2008
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
While all tests pass per this output, my impression is that some
of the timed delays in during execution of the test were not
correct and I suspect some system timing issues.
stdio_test: write fd=1
stdio_test: write fd=2
stdio_test: Standard I/O Check: printf
user_start: putenv(Variable1=BadValue3)
user_start: setenv(Variable1, GoodValue1, TRUE)
user_start: setenv(Variable2, BadValue1, FALSE)
user_start: setenv(Variable2, GoodValue2, TRUE)
user_start: setenv(Variable3, Variable3, FALSE)
user_start: setenv(Variable3, Variable3, FALSE)
show_variable: Variable=Variable1 has value=GoodValue1
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
user_start: Started user_main at PID=2
stdio_test: Standard I/O Check: fprintf to stderr
user_main: Begin argument test
user_main: Started with argc=5
user_main: argv[0]="<noname>"
user_main: argv[1]="Arg1"
user_main: argv[2]="Arg2"
user_main: argv[3]="Arg3"
user_main: argv[4]="Arg4"
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 2 2
mxordblk 76b20 76b20
uordblks 33d0 33d0
fordblks 78180 78180
show_variable: Variable=Variable1 has value=GoodValue1
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
show_variable: Variable=Variable1 has no value
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 2 3
mxordblk 76b20 76b20
uordblks 33d0 33c0
fordblks 78180 78190
show_variable: Variable=Variable1 has no value
show_variable: Variable=Variable2 has no value
show_variable: Variable=Variable3 has no value
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 33c0 3380
fordblks 78190 781d0
user_main: /dev/null test
dev_null: Read 0 bytes from /dev/null
dev_null: Wrote 1024 bytes to /dev/null
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: mutex test
Initializing mutex
Starting thread 1
Starting thread 2
Thread1 Thread2
Loops 32 32
Errors 0 0
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: cancel test
cancel_test: Test 1: Normal Cancelation
cancel_test: Starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
thread_waiter: Taking mutex
thread_waiter: Starting wait for condition
start_thread: Yielding
cancel_test: Canceling thread
cancel_test: Joining
cancel_test: waiter exited with result=ffffffff
cancel_test: PASS thread terminated with PTHREAD_CANCELED
cancel_test: Test 2: Cancelation of detached thread
cancel_test: Re-starting thread
restart_thread: Destroying cond
restart_thread: Destroying mutex
restart_thread: Re-starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
thread_waiter: Taking mutex
thread_waiter: Starting wait for condition
start_thread: Yielding
cancel_test: Canceling thread
cancel_test: Joining
cancel_test: PASS pthread_join failed with status=ESRCH
cancel_test: Test 3: Non-cancelable threads
cancel_test: Re-starting thread (non-cancelable)
restart_thread: Destroying cond
restart_thread: Destroying mutex
restart_thread: Re-starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
thread_waiter: Taking mutex
thread_waiter: Starting wait for condition
thread_waiter: Setting non-cancelable
start_thread: Yielding
cancel_test: Canceling thread
cancel_test: Joining
thread_waiter: Releasing mutex
thread_waiter: Setting cancelable
cancel_test: waiter exited with result=ffffffff
cancel_test: PASS thread terminated with PTHREAD_CANCELED
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: semaphore test
sem_test: Initializing semaphore to 0
sem_test: Starting waiter thread 1
sem_test: Set thread 1 priority to 191
waiter_func: Thread 1 Started
waiter_func: Thread 1 initial semaphore value = 0
waiter_func: Thread 1 waiting on semaphore
sem_test: Starting waiter thread 2
sem_test: Set thread 2 priority to 128
waiter_func: Thread 2 Started
waiter_func: Thread 2 initial semaphore value = -1
waiter_func: Thread 2 waiting on semaphore
sem_test: Starting poster thread 3
sem_test: Set thread 3 priority to 64
poster_func: Thread 3 started
poster_func: Thread 3 semaphore value = -2
poster_func: Thread 3 posting semaphore
waiter_func: Thread 1 awakened
waiter_func: Thread 1 new semaphore value = -1
waiter_func: Thread 1 done
poster_func: Thread 3 new semaphore value = -1
poster_func: Thread 3 semaphore value = -1
poster_func: Thread 3 posting semaphore
waiter_func: Thread 2 awakened
waiter_func: Thread 2 new semaphore value = 0
waiter_func: Thread 2 done
poster_func: Thread 3 new semaphore value = 0
poster_func: Thread 3 done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: condition variable test
cond_test: Initializing mutex
cond_test: Initializing cond
cond_test: Starting waiter
cond_test: Set thread 1 priority to 128
waiter_thread: Started
cond_test: Starting signaler
cond_test: Set thread 2 priority to 64
thread_signaler: Started
thread_signaler: Terminating
cond_test: signaler terminated, now cancel the waiter
cond_test: Waiter Signaler
cond_test: Loops 32 32
cond_test: Errors 0 0
cond_test:
cond_test: 0 times, waiter did not have to wait for data
cond_test: 0 times, data was already available when the signaler run
cond_test: 0 times, the waiter was in an unexpected state when the signaler ran
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: timed wait test
thread_waiter: Initializing mutex
timedwait_test: Initializing cond
timedwait_test: Starting waiter
timedwait_test: Set thread 2 priority to 177
thread_waiter: Taking mutex
thread_waiter: Starting 5 second wait for condition
timedwait_test: Joining
tcb=0x8057d0 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=8057d0 sigdeliver=13046 sigpendactionq.head=0
Resuming
thread_waiter: pthread_cond_timedwait timed out
thread_waiter: Releasing mutex
thread_waiter: Exit with status 0x12345678
timedwait_test: waiter exited with result=12345678
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: message queue test
mqueue_test: Starting receiver
mqueue_test: Set receiver priority to 128
receiver_thread: Starting
mqueue_test: Starting sender
mqueue_test: Set sender thread priority to 64
mqueue_test: Waiting for sender to complete
sender_thread: Starting
receiver_thread: mq_receive succeeded on msg 0
sender_thread: mq_send succeeded on msg 0
receiver_thread: mq_receive succeeded on msg 1
sender_thread: mq_send succeeded on msg 1
receiver_thread: mq_receive succeeded on msg 2
sender_thread: mq_send succeeded on msg 2
receiver_thread: mq_receive succeeded on msg 3
sender_thread: mq_send succeeded on msg 3
receiver_thread: mq_receive succeeded on msg 4
sender_thread: mq_send succeeded on msg 4
receiver_thread: mq_receive succeeded on msg 5
sender_thread: mq_send succeeded on msg 5
receiver_thread: mq_receive succeeded on msg 6
sender_thread: mq_send succeeded on msg 6
receiver_thread: mq_receive succeeded on msg 7
sender_thread: mq_send succeeded on msg 7
receiver_thread: mq_receive succeeded on msg 8
sender_thread: mq_send succeeded on msg 8
receiver_thread: mq_receive succeeded on msg 9
sender_thread: mq_send succeeded on msg 9
sender_thread: returning ntcb=0x8057d0 sigdeliver=0x13046
rtcb=0x806e30 current_regs=0x0
rtcb=8057d0 sigdeliver=13046 sigpendactionq.head=0
Resuming
errors=0
mqueue_test: Killing receiver
receiver_thread: mq_receive interrupted!
receiver_thread: returning nerrors=0
mqueue_test: Canceling receiver
mqueue_test: receiver has already terminated
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: timed message queue test
timedmqueue_test: Starting sender
sender_thread: Starting
sender_thread: mq_timedsend succeeded on msg 0
sender_thread: mq_timedsend succeeded on msg 1
timedmqueue_test: Waiting for sender to complete
sender_thread: mq_timedsend succeeded on msg 2
sender_thread: mq_timedsend succeeded on msg 3
sender_thread: mq_timedsend succeeded on msg 4
sender_thread: mq_timedsend succeeded on msg 5
sender_thread: mq_timedsend succeeded on msg 6
sender_thread: mq_timedsend succeeded on msg 7
sender_thread: mq_timedsend succeeded on msg 8
sender_thread: mq_timedsend 9 timed out as expected
sender_thread: returning nerrors=0
timedmqueue_test: Starting receiver
receiver_thread: Starting
receiver_thread: mq_timedreceive succeeded on msg 0
receiver_thread: mq_timedreceive succeeded on msg 1
receiver_thread: mq_timedreceive succeeded on msg 2
receiver_thread: mq_timedreceive succeeded on msg 3
timedmqueue_test: Waiting for receiver to complete
receiver_thread: mq_timedreceive succeeded on msg 4
receiver_thread: mq_timedreceive succeeded on msg 5
receiver_thread: mq_timedreceive succeeded on msg 6
receiver_thread: mq_timedreceive succeeded on msg 7
receiver_thread: mq_timedreceive succeeded on msg 8
receiver_thread: Receive 9 timed out as expected
receiver_thread: returning nerrors=0
timedmqueue_test: Test complete
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: signal handler test
sighand_test: Initializing semaphore to 0
sighand_test: Starting waiter task
sighand_test: Started waiter_main pid=20
waiter_main: Waiter started
waiter_main: Unmasking signal 17
waiter_main: Registering signal handler
waiter_main: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
waiter_main: Waiting on semaphore
tcb=0x8057d0 sigdeliver=0x13046
rtcb=0x806e30 current_regs=0x0
sighand_test: Signaling pid=20 with signo=17 sigvalue=42
rtcb=8057d0 sigdeliver=13046 sigpendactionq.head=804b10
Resuming
wakeup_action: Received signal 17
wakeup_action: sival_int=42
wakeup_action: si_code=1
wakeup_action: ucontext=0
waiter_main: sem_wait() successfully interrupted by signal
waiter_main: done
sighand_test: done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 4
mxordblk 76b20 76b20
uordblks 3380 35c0
fordblks 781d0 77f90
user_main: POSIX timer test
timer_test: Initializing semaphore to 0
timer_test: Unmasking signal 17
timer_test: Registering signal handler
timer_test: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
timer_test: Creating timer
timer_test: Starting timer
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b23
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=1
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b36
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=2
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b49
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=3
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf76
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b5c
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=4
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf66
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b6f
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=5
timer_test: Deleting timer
timer_test: done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 4 4
mxordblk 76b20 76b20
uordblks 35c0 35c0
fordblks 77f90 77f90
user_main: round-robin scheduler test
rr_test: Starting sieve1 thread
rr_test: Set thread priority to 1
rr_test: Set thread policty to SCHED_RR
rr_test: Starting sieve1 thread
sieve1 started
rr_test: Waiting for sieves to complete -- this should take awhile
rr_test: If RR scheduling is working, they should start and complete at
rr_test: about the same time
sieve2 started
sieve1 finished
sieve2 finished
rr_test: Done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 4 4
mxordblk 76b20 76b20
uordblks 35c0 35c0
fordblks 77f90 77f90
user_main: barrier test
barrier_test: Initializing barrier
barrier_func: Thread 0 started
barrier_test: Thread 0 created
barrier_func: Thread 1 started
barrier_test: Thread 1 created
barrier_func: Thread 2 started
barrier_test: Thread 2 created
barrier_func: Thread 3 started
barrier_test: Thread 3 created
barrier_func: Thread 0 calling pthread_barrier_wait()
barrier_func: Thread 1 calling pthread_barrier_wait()
barrier_func: Thread 2 calling pthread_barrier_wait()
barrier_func: Thread 4 started
barrier_test: Thread 4 created
barrier_func: Thread 3 calling pthread_barrier_wait()
barrier_func: Thread 4 calling pthread_barrier_wait()
barrier_func: Thread 5 started
barrier_test: Thread 5 created
barrier_func: Thread 6 started
barrier_test: Thread 6 created
barrier_func: Thread 7 started
barrier_test: Thread 7 created
barrier_func: Thread 5 calling pthread_barrier_wait()
barrier_func: Thread 6 calling pthread_barrier_wait()
barrier_func: Thread 7 calling pthread_barrier_wait()
barrier_func: Thread 7, back with status=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL)
barrier_func: Thread 0, back with status=0 (I am not special)
barrier_func: Thread 1, back with status=0 (I am not special)
barrier_func: Thread 2, back with status=0 (I am not special)
barrier_func: Thread 3, back with status=0 (I am not special)
barrier_func: Thread 4, back with status=0 (I am not special)
barrier_func: Thread 5, back with status=0 (I am not special)
barrier_func: Thread 6, back with status=0 (I am not special)
barrier_func: Thread 2 done
barrier_func: Thread 7 done
barrier_func: Thread 0 done
barrier_func: Thread 1 done
barrier_func: Thread 6 done
barrier_func: Thread 3 done
barrier_func: Thread 4 done
barrier_func: Thread 5 done
barrier_test: Thread 0 completed with result=0
barrier_test: Thread 1 completed with result=0
barrier_test: Thread 2 completed with result=0
barrier_test: Thread 3 completed with result=0
barrier_test: Thread 4 completed with result=0
barrier_test: Thread 5 completed with result=0
barrier_test: Thread 6 completed with result=0
barrier_test: Thread 7 completed with result=0
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 4 4
mxordblk 76b20 76b20
uordblks 35c0 35c0
fordblks 77f90 77f90
Final memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 2 4
mxordblk 76b20 76b20
uordblks 33d0 35c0
fordblks 78180 77f90
user_main: Exitting

View File

@@ -0,0 +1,84 @@
############################################################################
# configs/ez80f910200kitg/Makefile
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/Make.defs
ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)}
USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common'
INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES)
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES)
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = ez80_lowinit.c ez80_leds.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
all: libboard$(LIBEXT)
$(ASRCS) $(HEAD_ASRC): %$(ASMEXT): %.S
@$(CPP) $(CPPFLAGS) `cygpath -w $<` -o $@.tmp
@cat $@.tmp | sed -e "s/^#/;/g" > $@
@rm $@.tmp
$(AOBJS): %$(OBJEXT): %$(ASMEXT)
$(call ASSEMBLE, $<, $@)
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
$(call COMPILE, `cygpath -w $<`, $@)
libboard$(LIBEXT): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
depend: .depend
clean:
@rm -f libboard$(LIBEXT) *~ .*.swp
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@@ -0,0 +1,89 @@
/****************************************************************************
* configs/ez80f910200kitg/src/ez80_leds.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <arch/board/board.h>
#include "up_internal.h"
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_ledinit
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void up_ledinit(void)
{
}
/****************************************************************************
* Name: up_ledon
****************************************************************************/
void up_ledon(int led)
{
}
/****************************************************************************
* Name: up_ledoff
****************************************************************************/
void up_ledoff(int led)
{
}
#endif /* CONFIG_ARCH_LEDS */

View File

@@ -0,0 +1,67 @@
/***************************************************************************
* configs/ez80f910200kitg/src/ez80_lowinit.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Based upon sample code included with the Zilog ZDS-II toolchain.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
/***************************************************************************
* Included Files
***************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include "chip/chip.h"
/***************************************************************************
* Definitions
***************************************************************************/
/***************************************************************************
* Private Functions
***************************************************************************/
static void ez80_gpioinit(void)
{
}
/***************************************************************************
* Public Functions
***************************************************************************/
void ez80_lowinit(void)
{
ez80_gpioinit();
}

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* arch/z8encore000zco/iclude/board.h
* arch/z8encore000zco/include/board.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>

View File

@@ -38,7 +38,7 @@
# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
# processor architecture.
# CONFIG_ARCH_name - for use in C code. This identifies the particular
# processor architecture (CONFIG_ARCH_Z16).
# processor architecture (CONFIG_ARCH_Z8).
# CONFIG_ARCH_CHIP - Identifies the specific chip or SoC that implements the
# architecture.
# CONFIG_ARCH_CHIP_chip - for use in C code. This identifies the
@@ -71,7 +71,7 @@ CONFIG_ENDIAN_BIG=y
CONFIG_DRAM_SIZE=65536
CONFIG_ARCH_LEDS=n
#
# Z16F specific device driver settings
# eZ8 specific device driver settings
#
# CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
# console and ttyS0 (default is the UART0).

View File

@@ -0,0 +1,60 @@
README.txt
^^^^^^^^^^
ZDS-II Compiler Versions
^^^^^^^^^^^^^^^^^^^^^^^^
4.10.1
The ZDS-II version 4.10.2 will not compile NuttX. It reports "internal
errors" on one of the files, mm/mm_initialize.c. Below is a simple work-
around. With this work-around in place, NuttX builds successfully with
the 4.10.1 compiler.
--- mm/mm_initialize.c.SAVE 2008-02-13 08:06:46.833857700 -0600
+++ mm/mm_initialize.c 2008-02-13 08:07:26.367608900 -0600
@@ -94,8 +94,11 @@
{
int i;
+#if 0 /* DO NOT CHECK IN */
CHECK_ALLOCNODE_SIZE;
CHECK_FREENODE_SIZE;
+#endif
/* Set up global variables */
4.9.5
This is the latest tool version listed on the ZiLOG site for the Z8F6403.
However, it uses different compiler command line arguments.
Other Versions
If you use any version of ZDS-II other than 4.10.1 or if you install ZDS-II
at any location other than the default location, you will have to modify
two files: (1) configs/z8f64200100kit/*/setenv.sh and (2)
configs/z8f64200100kit/*/Make.defs.
Configuration Subdirectories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- src/ and include/
These directories contain common logic for all z8f64200100kit
configurations.
Variations on the basic z8f64200100kit configuration are maintained
in subdirectories. To configure any specific configuration, do the
following steps:
cd <nuttx-top-directory>/tools
./configure.sh z8f64200100kit/<sub-directory>
cd <nuttx-top-directgory>
make
Where <sub-directory> is the specific board configuration that you
wish to build. The following board-specific configurations are
available:
- ostest
This builds the examples/ostest application for execution from FLASH.
See examples/README.txt for information about ostest.
Check out any README.txt files in these <sub-directory>s.

View File

@@ -0,0 +1,76 @@
/****************************************************************************
* arch/z8f64200100kit/include/board.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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H
#define __ARCH_BOARD_BOARD_H
/****************************************************************************
* Included Files
****************************************************************************/
/****************************************************************************
* Definitions
****************************************************************************/
/* LED pattern definitions */
#define LED_STARTED 0
#define LED_HEAPALLOCATE 1
#define LED_IRQSENABLED 2
#define LED_STACKCREATED 3
#define LED_IDLE 4
#define LED_INIRQ 5
#define LED_ASSERTION 6
#define LED_SIGNAL 6
#define LED_PANIC 7
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ARCH_BOARD_BOARD_H */

View File

@@ -0,0 +1,191 @@
############################################################################
# configs/z8f64200100kit/ostest/Make.defs
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
# These are the directories where the ZDS-II toolchain is installed
ZDSINSTALLDIR := C:/Program\ Files/ZiLOG/ZDSII_Z8Encore!_4.10.1
ZDSBINDIR := $(ZDSINSTALLDIR)/bin
ZDSSTDINCDIR := $(ZDSINSTALLDIR)/include/std
ZDSZILOGINCDIR := $(ZDSINSTALLDIR)/include/zilog
ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y)
ZDSDEVINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F642X
endif
ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y)
ZDSDEVINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F640X
endif
ZDSSTDLIBDIR := $(ZDSINSTALLDIR)/lib/std
ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)/lib/zilog
# These are the same directories but with the directory separator
# character swapped as needed by the ZDS-II compiler
WTOPDIR := ${shell cygpath -w $(TOPDIR)}
WZDSSTDINCDIR := ${shell cygpath -w $(ZDSSTDINCDIR)}
WZDSZILOGINCDIR := ${shell cygpath -w $(ZDSZILOGINCDIR)}
WZDSDEVINCDIR := ${shell cygpath -w $(ZDSDEVINCDIR)}
WZDSSTDLIBDIR := ${shell cygpath -w $(ZDSSTDLIBDIR)}
WZDSZILOGLIBDIR := ${shell cygpath -w $(ZDSZILOGLIBDIR)}
# Escaped versions
ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"}
EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"}
EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"}
# Assembler definitions
ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y)
ARCHFAMILYDEF = _Z8ENCORE_F642X
ARCHSERIESDEF = _Z8ENCORE_64K_SERIES
ARCHREVAA = -NOrevaa
ifeq ($(CONFIG_ARCH_CHIP_Z8F6423),y)
ARCHCPU = Z8F6423
ARCHCPUDEF = _Z8F6423
endif
endif
ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y)
ARCHFAMILYDEF = _Z8ENCORE_F640X
ARCHSERIESDEF = _Z8ENCORE_640_FAMILY
ARCHREVAA = -revaa
ifeq ($(CONFIG_ARCH_CHIP_Z8F6403),y)
ARCHCPU = Z8F6403
ARCHCPUDEF = _Z8F6403
endif
endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHASMOPTIMIZATION = -debug -sdiopt
else
ARCHASMOPTIMIZATION = -nodebug -sdiopt
endif
ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA)
ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet
ARCHASMWARNINGS = -warn
ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 \ -define:__ASSEMBLY__
ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)'
EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)'
AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \
$(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)
# Compiler definitions
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -debug -NOregvar -reduceopt
else
ARCHOPTIMIZATION = -nodebug -regvar
endif
ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \
-asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)"
ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm
ARCHPICFLAGS =
ARCHWARNINGS = -warn
ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF)
ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)'
ARCHUSRINCLUDES = -usrinc:'.'
ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES)
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES)
CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__
CPPINCLUDES = -I$(TOPDIR)/include
CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES)
# Librarian definitions
ARFLAGS = -quiet -warn
# Linker definitions
LINKCMDTEMPLATE = $(TOPDIR)/configs/z8f64200100kit/ostest/ostest.linkcmd
# Tool names/pathes
CROSSDEV =
CC = $(ZDSBINDIR)/ez8cc.exe
CPP = gcc -E
LD = $(ZDSBINDIR)/ez8link.exe
AS = $(ZDSBINDIR)/ez8asm.exe
AR = $(ZDSBINDIR)/ez8lib.exe
# File extensions
ASMEXT = .asm
OBJEXT = .obj
LIBEXT = .lib
EXEEXT = .hex
# These are the macros that will be used in the NuttX make system
# to compile and assembly source files and to insert the resulting
# object files into an archive
define COMPILE
@#echo "CC: $1"
@$(CC) $(CFLAGS) $1
endef
define ASSEMBLE
@#echo "AS: $1"
@$(AS) -c $(AFLAGS) $1
endef
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
endef
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lst
endef
# This is the tool to use for dependencies (i.e., none)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies
DIRLINK = $(TOPDIR)/tools/winlink.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
# Linux/Cygwin host tool definitions
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =

View File

@@ -0,0 +1,12 @@
README.txt
^^^^^^^^^^
ostest.zfpproj is a simple ZDS-II project that will allow you
to use the ZDS-II debugger. Before using, copy the following
files from the toplevel directory:
nuttx.hex, nuttx.map, nuttx.lod
to this directory as:
ostest.hex, ostest.map, ostest.lod

View File

@@ -0,0 +1,349 @@
############################################################################
# configs/z8f64200100kit/ostest/defconfig
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
#
# Architecture selection
#
# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
# processor architecture.
# CONFIG_ARCH_name - for use in C code. This identifies the particular
# processor architecture (CONFIG_ARCH_Z8).
# CONFIG_ARCH_CHIP - Identifies the specific chip or SoC that implements the
# architecture.
# CONFIG_ARCH_CHIP_chip - for use in C code. This identifies the
# particular chip or SoC that the architecture is implemented
# in (CONFIG_ARCH_CHIP_Z8)
# CONFIG_ARCH_CHIP_Z8F642X - Identifies z8 chip variant
# CONFIG_ARCH_CHIP_Z8F6423
# CONFIG_ARCH_CHIP_Z8F640X
# CONFIG_ARCH_CHIP_Z8F6403
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
# the board that supports the particular chip or SoC.
# CONFIG_ARCH_BOARD_name - for use in C code
# CONFIG_BOARD_LOOPSPERMSEC - for delay loops
# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
# CONFIG_DRAM_SIZE - Describes the installed DRAM.
# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to z8 board architecture.
#
CONFIG_ARCH=z80
CONFIG_ARCH_Z8=y
CONFIG_ARCH_CHIP=z8
CONFIG_ARCH_CHIP_Z8=y
CONFIG_ARCH_CHIP_Z8F640X=n
CONFIG_ARCH_CHIP_Z8F6403=n
CONFIG_ARCH_CHIP_Z8F642X=y
CONFIG_ARCH_CHIP_Z8F6423=y
CONFIG_ARCH_BOARD=z8f64200100kit
CONFIG_ARCH_BOARD_Z8F64200100KIT=y
CONFIG_BOARD_LOOPSPERMSEC=1250
CONFIG_ENDIAN_BIG=y
CONFIG_DRAM_SIZE=65536
CONFIG_ARCH_LEDS=n
#
# ez8 specific device driver settings
#
# CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
# console and ttyS0 (default is the UART0).
# CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
# This specific the size of the receive buffer
# CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
# being sent. This specific the size of the transmit buffer
# CONFIG_UARTn_BAUD - The configure BAUD of the UART.
# CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
# CONFIG_UARTn_2STOP - 0=1 stop bit; 1=Two stop bits
#
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_UART1_SERIAL_CONSOLE=n
CONFIG_UART0_TXBUFSIZE=0
CONFIG_UART1_TXBUFSIZE=0
CONFIG_UART0_RXBUFSIZE=0
CONFIG_UART1_RXBUFSIZE=0
CONFIG_UART0_BAUD=57600
CONFIG_UART1_BAUD=57600
CONFIG_UART0_PARITY=0
CONFIG_UART1_PARITY=0
CONFIG_UART0_2STOP=0
CONFIG_UART1_2STOP=0
#
# General build options
#
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
# BSPs from www.ridgerun.com
# CONFIG_HAVE_LIBM - toolchain supports libm.a
#
CONFIG_RRLOAD_BINARY=n
CONFIG_HAVE_LIBM=n
#
# General OS setup
#
# CONFIG_EXAMPLE - identifies the subdirectory in examples
# that will be used in the build
# CONFIG_DEBUG - enables built-in debug options
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
# CONFIG_MM_REGIONS - If the architecture includes multiple
# regions of memory to allocate from, this specifies the
# number of memory regions that the memory manager must
# handle and enables the API mm_addregion(start, end);
# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
# time console output
# CONFIG_HAVE_GETPUTC - architecture supports low-level, boot
# time console input
# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
# or TICKS_PER_MSEC=10. This setting may be defined to
# inform NuttX that the processor hardware is providing
# system timer interrupts at some interrupt interval other
# than 10 msec.
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
# this number of milliseconds; Round robin scheduling can
# be disabled by setting this value to zero.
# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
# scheduler to monitor system performance
# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
# task name to save in the TCB. Useful if scheduler
# instrumentation is selected. Set to zero to disable.
# CONFIG_JULIAN_TIME - Enables Julian time conversions
# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
# Used to initialize the internal time logic.
# CONFIG_HAVE_LOWUARTINIT - Provides low-level UART initialization
# logic as up_lowuartinit (only needed if there is no
# serial driver).
# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
# provides /dev/console. Enables stdout, stderr, stdin.
# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
# driver (minimul support)
#
CONFIG_EXAMPLE=ostest
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_MM_REGIONS=1
CONFIG_ARCH_LOWPUTC=y
CONFIG_RR_INTERVAL=0
CONFIG_SCHED_INSTRUMENTATION=n
CONFIG_TASK_NAME_SIZE=0
CONFIG_START_YEAR=2008
CONFIG_START_MONTH=2
CONFIG_START_DAY=17
CONFIG_JULIAN_TIME=n
CONFIG_HAVE_LOWUARTINIT=y
CONFIG_DEV_CONSOLE=n
CONFIG_DEV_LOWCONSOLE=n
#
# The following can be used to disable categories of
# APIs supported by the OS. If the compiler supports
# weak functions, then it should not be necessary to
# disable functions unless you want to restrict usage
# of those APIs.
#
# There are certain dependency relationships in these
# features.
#
# o mq_notify logic depends on signals to awaken tasks
# waiting for queues to become full or empty.
# o pthread_condtimedwait() depends on signals to wake
# up waiting tasks.
#
CONFIG_DISABLE_CLOCK=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
CONFIG_DISABLE_SIGNALS=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_MOUNTPOINT=y
CONFIG_DISABLE_ENVIRON=y
#
# Misc libc settings
#
# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
# little smaller if we do not support fieldwidthes
#
CONFIG_NOPRINTF_FIELDWIDTH=y
#
# Allow for architecture optimized implementations
#
# The architecture can provide optimized versions of the
# following to improve sysem performance
#
CONFIG_ARCH_MEMCPY=n
CONFIG_ARCH_MEMCMP=n
CONFIG_ARCH_MEMMOVE=n
CONFIG_ARCH_MEMSET=n
CONFIG_ARCH_STRCMP=n
CONFIG_ARCH_STRCPY=n
CONFIG_ARCH_STRNCPY=n
CONFIG_ARCH_STRLEN=n
CONFIG_ARCH_BZERO=n
CONFIG_ARCH_KMALLOC=n
CONFIG_ARCH_KZMALLOC=n
CONFIG_ARCH_KFREE=n
#
# Sizes of configurable things (0 disables)
#
# CONFIG_MAX_TASKS - The maximum number of simultaneously
# active tasks. This value must be a power of two.
# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
# of parameters that a task may receive (i.e., maxmum value
# of 'argc')
# CONFIG_NPTHREAD_KEYS - The number of items of thread-
# specific data that can be retained
# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
# descriptors (one for each open)
# CONFIG_NFILE_STREAMS - The maximum number of streams that
# can be fopen'ed
# CONFIG_NAME_MAX - The maximum size of a file name.
# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
# CONFIG_NUNGET_CHARS - Number of characters that can be
# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
# structures. The system manages a pool of preallocated
# message structures to minimize dynamic allocations
# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
# a fixed payload size given by this settin (does not include
# other message structure overhead.
# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
# can be passed to a watchdog handler
# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
# structures. The system manages a pool of preallocated
# watchdog structures to minimize dynamic allocations
# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
# timer structures. The system manages a pool of preallocated
# timer structures to minimize dynamic allocations. Set to
# zero for all dynamic allocations.
#
CONFIG_MAX_TASKS=8
CONFIG_MAX_TASK_ARGS=4
CONFIG_NPTHREAD_KEYS=0
CONFIG_NFILE_DESCRIPTORS=0
CONFIG_NFILE_STREAMS=0
CONFIG_NAME_MAX=32
CONFIG_STDIO_BUFFER_SIZE=0
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_MQ_MSGS=0
CONFIG_MQ_MAXMSGSIZE=0
CONFIG_MAX_WDOGPARMS=2
CONFIG_PREALLOC_WDOGS=4
CONFIG_PREALLOC_TIMERS=0
#
# TCP/IP and UDP support via uIP
# CONFIG_NET - Enable or disable all network features
# CONFIG_NET_IPv6 - Build in support for IPv6
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
# CONFIG_NET_BUFSIZE - uIP buffer size
# CONFIG_NET_TCP - TCP support on or off
# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
# CONFIG_NET_UDP - UDP support on or off
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
# CONFIG_NET_ICMP - ICMP ping support on or off
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
# CONFIG_NET_STATISTICS - uIP statistics on or off
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
# CONFIG_NET_BROADCAST - Broadcast support
# CONFIG_NET_LLH_LEN - The link level header length
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
CONFIG_NET=n
CONFIG_NET_IPv6=n
CONFIG_NSOCKET_DESCRIPTORS=0
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
CONFIG_NET_UDP=n
CONFIG_NET_UDP_CHECKSUMS=y
#CONFIG_NET_UDP_CONNS=10
CONFIG_NET_ICMP=n
#CONFIG_NET_PINGADDRCONF=0
CONFIG_NET_STATISTICS=y
#CONFIG_NET_RECEIVE_WINDOW=
#CONFIG_NET_ARPTAB_SIZE=8
CONFIG_NET_BROADCAST=n
#CONFIG_NET_LLH_LEN=14
#CONFIG_NET_FWCACHE_SIZE=2
#
# UIP Network Utilities
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
CONFIG_NET_DHCP_LIGHT=n
CONFIG_NET_RESOLV_ENTRIES=4
#
# Settings for examples/ostest
CONFIG_OSTEST_STACKSIZE=256
#
# Settings for examples/nsh
CONFIG_EXAMPLES_NSH_TELNET=n
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE=512
CONFIG_EXAMPLES_NSH_CMD_SIZE=40
CONFIG_EXAMPLES_NSH_STACKSIZE=512
CONFIG_EXAMPLES_NSH_DHCPC=n
CONFIG_EXAMPLES_NSH_NOMAC=n
CONFIG_EXAMPLES_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
#
# Stack and heap information
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
# operation from FLASH.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
# all stack operations outside of the nuttx model.
# CONFIG_STACK_POINTER - The initial stack pointer
# CONFIG_PROC_STACK_SIZE - The size of the initial stack
# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
CONFIG_BOOT_FROM_FLASH=n
CONFIG_CUSTOM_STACK=n
CONFIG_PROC_STACK_SIZE=256
CONFIG_PTHREAD_STACK_MIN=128
CONFIG_PTHREAD_STACK_DEFAULT=256
CONFIG_HEAP_SIZE=
CONFIG_HEAP_BASE=

View File

@@ -0,0 +1,80 @@
/****************************************************************************/
/* configs/z8f64200100kit/ostest/ostest.linkcmd */
/* */
/* 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 name NuttX nor the names of its contributors may be */
/* used to endorse or promote products derived from this software */
/* without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
/* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
/* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS */
/* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED */
/* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
/* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
/* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/****************************************************************************/
-FORMAT=OMF695,INTEL32
-map -maxhexlen=64 -quiet -sort NAME=ascending -unresolved=fatal
-NOwarnoverlap -NOxref -warn -debug -NOigcase -quiet
RANGE ROM $0 : $FFFF
RANGE RDATA $20 : $FF
RANGE EDATA $100 : $EFF
RANGE PRAM FORBIDDEN
CHANGE TEXT=EDATA
CHANGE TEXT=FAR_DATA
change NEAR_TXT=NEAR_DATA
change FAR_TXT=FAR_DATA
ORDER FAR_BSS, FAR_DATA
ORDER NEAR_BSS,NEAR_DATA
COPY NEAR_DATA ROM
COPY FAR_DATA ROM
define _low_near_romdata = copy base of NEAR_DATA
define _low_neardata = base of NEAR_DATA
define _len_neardata = length of NEAR_DATA
define _low_far_romdata = copy base of FAR_DATA
define _low_fardata = base of FAR_DATA
define _len_fardata = length of FAR_DATA
define _low_nearbss = base of NEAR_BSS
define _len_nearbss = length of NEAR_BSS
define _low_farbss = base of FAR_BSS
define _len_farbss = length of FAR_BSS
define _far_stacktop = highaddr of EDATA
define _near_stack = highaddr of RDATA
define _far_heapbot = top of EDATA
define _near_heaptop = highaddr of RDATA
define _near_heapbot = top of RDATA
define _low_pramseg = base of PRAMSEG
define _len_pramseg = length of PRAMSEG
define _low_pram_romdata = copy base of PRAMSEG
define _READ_NVDS=$1000
define _WRITE_NVDS=$10B3
define _READ_NVDS_GET_STATUS=$1000
define _WRITE_NVDS_GET_STATUS=$10B3
/* Set frequency to 18432000 Hz */
define __user_frequency = 18432000
/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */

View File

@@ -0,0 +1,291 @@
<project type="Standard" project-type="Standard" configuration="Debug" created-by="{{build_number}}" modified-by="b:4.10:06121401">
<cpu>Z8F6403</cpu>
<!-- file information -->
<files>
<file filter-key="">.\zsldevinit.asm</file>
<file filter-key="flash">..\..\..\nuttx.hex</file>
</files>
<!-- configuration information -->
<configurations>
<configuration name="Debug" >
<tools>
<tool name="Assembler">
<options>
<option name="define" type="string" change-action="assemble">_Z8F6403=1,_Z8ENCORE_640_FAMILY=1,_Z8ENCORE_F640X=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">56</option>
<option name="pagewidth" type="integer" change-action="none">80</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="revaa" type="boolean" change-action="rebuild">true</option>
<option name="sdiopt" type="boolean" change-action="assemble">true</option>
</options>
</tool>
<tool name="Compiler">
<options>
<option name="codegen" type="string" change-action="none">UserDefined</option>
<option name="const" type="string" change-action="compile">RAM</option>
<option name="define" type="string" change-action="compile">_Z8F6403,_Z16F_SERIES,_Z8ENCORE_640_FAMILY,_Z8ENCORE_F640X</option>
<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">true</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="model" type="string" change-action="compile">L</option>
<option name="optlink" type="boolean" change-action="compile">false</option>
<option name="promote" type="boolean" change-action="compile">true</option>
<option name="regvar" type="string" change-action="compile">Normal</option>
<option name="regvarcache" type="string" change-action="none">Normal</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
<option name="usrinc" type="string" change-action="compile"></option>
<option name="watch" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Debugger">
<options>
<option name="target" type="string" change-action="rebuild">Z8ENCORE00ZC0</option>
<option name="debugtool" type="string" change-action="none">Simulator</option>
<option name="zemul_enableevents" type="boolean" change-action="none">false</option>
<option name="zemul_brkonfull" type="boolean" change-action="none">false</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">true</option>
<option name="sn" type="string" change-action="none">000000000000000000000000</option>
<option name="snsize" type="integer" change-action="none">1</option>
<option name="snstep" type="integer" change-action="none">000000000000000000000001</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
<option name="snbigendian" type="boolean" change-action="none">true</option>
<option name="singleval" type="string" change-action="none">0</option>
<option name="singlevalformat" type="integer" change-action="none">0</option>
<option name="usenvds" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="usepageerase" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
<option name="debug" type="boolean" change-action="assemble">true</option>
<option name="debugcache" type="boolean" change-action="none">true</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
<option name="outputdir" type="string" change-action="compile">.</option>
</options>
</tool>
<tool name="Librarian">
<options>
<option name="outfile" type="string" change-action="build">.\ostest.lib</option>
</options>
</tool>
<tool name="Linker">
<options>
<option name="createnew" type="boolean" change-action="build">false</option>
<option name="directives" type="string" change-action="build"></option>
<option name="edata" type="string" change-action="build">100-EFF</option>
<option name="exeform" type="string" change-action="build">OMF695,INTEL32</option>
<option name="flash" type="string" change-action="build">FF80-FFFF</option>
<option name="fplib" type="string" change-action="build">Dummy</option>
<option name="linkctlfile" type="string" change-action="build"></option>
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="nvds" type="string" change-action="build">0-f</option>
<option name="objlibmods" type="string" change-action="build"></option>
<option name="of" type="string" change-action="build">.\ostest</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="pram" type="string" change-action="build">0-f</option>
<option name="praminuse" type="boolean" change-action="build">false</option>
<option name="quiet" type="boolean" change-action="none">false</option>
<option name="rdata" type="string" change-action="build">20-FF</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="rom" type="string" change-action="build">0-FFF</option>
<option name="sort" type="string" change-action="none">name</option>
<option name="startuptype" type="string" change-action="build">Standard</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
<option name="warnoverlap" type="boolean" change-action="none">true</option>
<option name="xref" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Middleware">
<options>
<option name="usezsl" type="boolean" change-action="rebuild">true</option>
<option name="zslports" type="string" change-action="rebuild"></option>
<option name="zsluarts" type="string" change-action="rebuild"></option>
<option name="zslpramisrs" type="string" change-action="rebuild"></option>
</options>
</tool>
</tools>
</configuration>
<configuration name="Release" >
<tools>
<tool name="Assembler">
<options>
<option name="define" type="string" change-action="assemble">_Z8F6403=1,_Z16F_SERIES=1,_Z8ENCORE_640_FAMILY=1,_Z8ENCORE_F640X=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">56</option>
<option name="pagewidth" type="integer" change-action="none">80</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="revaa" type="boolean" change-action="rebuild">false</option>
<option name="sdiopt" type="boolean" change-action="assemble">true</option>
</options>
</tool>
<tool name="Compiler">
<options>
<option name="codegen" type="string" change-action="none">UserDefined</option>
<option name="const" type="string" change-action="compile">RAM</option>
<option name="define" type="string" change-action="compile">_Z8F6403,_Z16F_SERIES,_Z8ENCORE_640_FAMILY,_Z8ENCORE_F640X</option>
<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">true</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="model" type="string" change-action="compile">S</option>
<option name="optlink" type="boolean" change-action="compile">false</option>
<option name="promote" type="boolean" change-action="compile">true</option>
<option name="regvar" type="string" change-action="compile">Normal</option>
<option name="regvarcache" type="string" change-action="none">Normal</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
<option name="usrinc" type="string" change-action="compile"></option>
<option name="watch" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Debugger">
<options>
<option name="target" type="string" change-action="rebuild"></option>
<option name="debugtool" type="string" change-action="none">Simulator</option>
<option name="zemul_enableevents" type="boolean" change-action="none">false</option>
<option name="zemul_brkonfull" type="boolean" change-action="none">false</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">false</option>
<option name="sn" type="string" change-action="none">0</option>
<option name="snsize" type="integer" change-action="none">0</option>
<option name="snstep" type="integer" change-action="none">1</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
<option name="snbigendian" type="boolean" change-action="none">true</option>
<option name="singleval" type="string" change-action="none">0</option>
<option name="singlevalformat" type="integer" change-action="none">0</option>
<option name="usenvds" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="usepageerase" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
<option name="debug" type="boolean" change-action="assemble">true</option>
<option name="debugcache" type="boolean" change-action="none">true</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
<option name="outputdir" type="string" change-action="compile">.</option>
</options>
</tool>
<tool name="Librarian">
<options>
<option name="outfile" type="string" change-action="build"></option>
</options>
</tool>
<tool name="Linker">
<options>
<option name="createnew" type="boolean" change-action="build">false</option>
<option name="directives" type="string" change-action="build"></option>
<option name="edata" type="string" change-action="build">100-EFF</option>
<option name="exeform" type="string" change-action="build">OMF695,INTEL32</option>
<option name="flash" type="string" change-action="build">FF80-FFFF</option>
<option name="fplib" type="string" change-action="build">Dummy</option>
<option name="linkctlfile" type="string" change-action="build"></option>
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="nvds" type="string" change-action="build">0-f</option>
<option name="objlibmods" type="string" change-action="build"></option>
<option name="of" type="string" change-action="build">.\ostest</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="pram" type="string" change-action="build">0-f</option>
<option name="praminuse" type="boolean" change-action="build">false</option>
<option name="quiet" type="boolean" change-action="none">false</option>
<option name="rdata" type="string" change-action="build">20-FF</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="rom" type="string" change-action="build">0-FFF</option>
<option name="sort" type="string" change-action="none">name</option>
<option name="startuptype" type="string" change-action="build">Standard</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
<option name="warnoverlap" type="boolean" change-action="none">true</option>
<option name="xref" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Middleware">
<options>
<option name="usezsl" type="boolean" change-action="rebuild">true</option>
<option name="zslports" type="string" change-action="rebuild"></option>
<option name="zsluarts" type="string" change-action="rebuild"></option>
<option name="zslpramisrs" type="string" change-action="rebuild"></option>
</options>
</tool>
</tools>
</configuration>
</configurations>
<!-- watch information -->
<watch-elements>
<watch-element expression="0x801d1a" />
</watch-elements>
<!-- breakpoint information -->
<breakpoints>
</breakpoints>
<!-- ice event information -->
<ice-events count="4" enable="0" breakOnFull="0">
<ice-event>
<data>000000000000</data>
<mask>000000000000</mask>
<action>0</action>
</ice-event>
<ice-event>
<data>000000000000</data>
<mask>000000000000</mask>
<action>0</action>
</ice-event>
<ice-event>
<data>000000000000</data>
<mask>000000000000</mask>
<action>0</action>
</ice-event>
<ice-event>
<data>000000000000</data>
<mask>000000000000</mask>
<action>0</action>
</ice-event>
</ice-events>
</project>

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# configs/z8f64200100kit/ostest/setenv.sh
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Check how we were executed
#
if [ "$(basename $0)" = "setenv.sh" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
#
# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and
# attempts to set the PATH variable do not have the desired effect.
# Instead, alias are provided for all of the ZDS-II command line tools.
# Version 4.10.1 installed in the default location is assumed here.
#
ZDSBINDIR="C:/Program\ Files/ZiLOG/ZDSII_Z8Encore!_4.10.1/bin"
alias ez8asm="${ZDSBINDIR}/ez8asm.exe"
alias ez8cc="${ZDSBINDIR}/ez8cc.exe"
alias ez8lib="${ZDSBINDIR}/ez8lib.exe"
alias ez8link="${ZDSBINDIR}/ez8link.exe"

View File

@@ -0,0 +1,529 @@
This is the output from the z16f target from January 31, 2008
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
While all tests pass per this output, my impression is that some
of the timed delays in during execution of the test were not
correct and I suspect some system timing issues.
stdio_test: write fd=1
stdio_test: write fd=2
stdio_test: Standard I/O Check: printf
user_start: putenv(Variable1=BadValue3)
user_start: setenv(Variable1, GoodValue1, TRUE)
user_start: setenv(Variable2, BadValue1, FALSE)
user_start: setenv(Variable2, GoodValue2, TRUE)
user_start: setenv(Variable3, Variable3, FALSE)
user_start: setenv(Variable3, Variable3, FALSE)
show_variable: Variable=Variable1 has value=GoodValue1
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
user_start: Started user_main at PID=2
stdio_test: Standard I/O Check: fprintf to stderr
user_main: Begin argument test
user_main: Started with argc=5
user_main: argv[0]="<noname>"
user_main: argv[1]="Arg1"
user_main: argv[2]="Arg2"
user_main: argv[3]="Arg3"
user_main: argv[4]="Arg4"
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 2 2
mxordblk 76b20 76b20
uordblks 33d0 33d0
fordblks 78180 78180
show_variable: Variable=Variable1 has value=GoodValue1
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
show_variable: Variable=Variable1 has no value
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 2 3
mxordblk 76b20 76b20
uordblks 33d0 33c0
fordblks 78180 78190
show_variable: Variable=Variable1 has no value
show_variable: Variable=Variable2 has no value
show_variable: Variable=Variable3 has no value
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 33c0 3380
fordblks 78190 781d0
user_main: /dev/null test
dev_null: Read 0 bytes from /dev/null
dev_null: Wrote 1024 bytes to /dev/null
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: mutex test
Initializing mutex
Starting thread 1
Starting thread 2
Thread1 Thread2
Loops 32 32
Errors 0 0
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: cancel test
cancel_test: Test 1: Normal Cancelation
cancel_test: Starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
thread_waiter: Taking mutex
thread_waiter: Starting wait for condition
start_thread: Yielding
cancel_test: Canceling thread
cancel_test: Joining
cancel_test: waiter exited with result=ffffffff
cancel_test: PASS thread terminated with PTHREAD_CANCELED
cancel_test: Test 2: Cancelation of detached thread
cancel_test: Re-starting thread
restart_thread: Destroying cond
restart_thread: Destroying mutex
restart_thread: Re-starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
thread_waiter: Taking mutex
thread_waiter: Starting wait for condition
start_thread: Yielding
cancel_test: Canceling thread
cancel_test: Joining
cancel_test: PASS pthread_join failed with status=ESRCH
cancel_test: Test 3: Non-cancelable threads
cancel_test: Re-starting thread (non-cancelable)
restart_thread: Destroying cond
restart_thread: Destroying mutex
restart_thread: Re-starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
thread_waiter: Taking mutex
thread_waiter: Starting wait for condition
thread_waiter: Setting non-cancelable
start_thread: Yielding
cancel_test: Canceling thread
cancel_test: Joining
thread_waiter: Releasing mutex
thread_waiter: Setting cancelable
cancel_test: waiter exited with result=ffffffff
cancel_test: PASS thread terminated with PTHREAD_CANCELED
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: semaphore test
sem_test: Initializing semaphore to 0
sem_test: Starting waiter thread 1
sem_test: Set thread 1 priority to 191
waiter_func: Thread 1 Started
waiter_func: Thread 1 initial semaphore value = 0
waiter_func: Thread 1 waiting on semaphore
sem_test: Starting waiter thread 2
sem_test: Set thread 2 priority to 128
waiter_func: Thread 2 Started
waiter_func: Thread 2 initial semaphore value = -1
waiter_func: Thread 2 waiting on semaphore
sem_test: Starting poster thread 3
sem_test: Set thread 3 priority to 64
poster_func: Thread 3 started
poster_func: Thread 3 semaphore value = -2
poster_func: Thread 3 posting semaphore
waiter_func: Thread 1 awakened
waiter_func: Thread 1 new semaphore value = -1
waiter_func: Thread 1 done
poster_func: Thread 3 new semaphore value = -1
poster_func: Thread 3 semaphore value = -1
poster_func: Thread 3 posting semaphore
waiter_func: Thread 2 awakened
waiter_func: Thread 2 new semaphore value = 0
waiter_func: Thread 2 done
poster_func: Thread 3 new semaphore value = 0
poster_func: Thread 3 done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: condition variable test
cond_test: Initializing mutex
cond_test: Initializing cond
cond_test: Starting waiter
cond_test: Set thread 1 priority to 128
waiter_thread: Started
cond_test: Starting signaler
cond_test: Set thread 2 priority to 64
thread_signaler: Started
thread_signaler: Terminating
cond_test: signaler terminated, now cancel the waiter
cond_test: Waiter Signaler
cond_test: Loops 32 32
cond_test: Errors 0 0
cond_test:
cond_test: 0 times, waiter did not have to wait for data
cond_test: 0 times, data was already available when the signaler run
cond_test: 0 times, the waiter was in an unexpected state when the signaler ran
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: timed wait test
thread_waiter: Initializing mutex
timedwait_test: Initializing cond
timedwait_test: Starting waiter
timedwait_test: Set thread 2 priority to 177
thread_waiter: Taking mutex
thread_waiter: Starting 5 second wait for condition
timedwait_test: Joining
tcb=0x8057d0 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=8057d0 sigdeliver=13046 sigpendactionq.head=0
Resuming
thread_waiter: pthread_cond_timedwait timed out
thread_waiter: Releasing mutex
thread_waiter: Exit with status 0x12345678
timedwait_test: waiter exited with result=12345678
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: message queue test
mqueue_test: Starting receiver
mqueue_test: Set receiver priority to 128
receiver_thread: Starting
mqueue_test: Starting sender
mqueue_test: Set sender thread priority to 64
mqueue_test: Waiting for sender to complete
sender_thread: Starting
receiver_thread: mq_receive succeeded on msg 0
sender_thread: mq_send succeeded on msg 0
receiver_thread: mq_receive succeeded on msg 1
sender_thread: mq_send succeeded on msg 1
receiver_thread: mq_receive succeeded on msg 2
sender_thread: mq_send succeeded on msg 2
receiver_thread: mq_receive succeeded on msg 3
sender_thread: mq_send succeeded on msg 3
receiver_thread: mq_receive succeeded on msg 4
sender_thread: mq_send succeeded on msg 4
receiver_thread: mq_receive succeeded on msg 5
sender_thread: mq_send succeeded on msg 5
receiver_thread: mq_receive succeeded on msg 6
sender_thread: mq_send succeeded on msg 6
receiver_thread: mq_receive succeeded on msg 7
sender_thread: mq_send succeeded on msg 7
receiver_thread: mq_receive succeeded on msg 8
sender_thread: mq_send succeeded on msg 8
receiver_thread: mq_receive succeeded on msg 9
sender_thread: mq_send succeeded on msg 9
sender_thread: returning ntcb=0x8057d0 sigdeliver=0x13046
rtcb=0x806e30 current_regs=0x0
rtcb=8057d0 sigdeliver=13046 sigpendactionq.head=0
Resuming
errors=0
mqueue_test: Killing receiver
receiver_thread: mq_receive interrupted!
receiver_thread: returning nerrors=0
mqueue_test: Canceling receiver
mqueue_test: receiver has already terminated
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: timed message queue test
timedmqueue_test: Starting sender
sender_thread: Starting
sender_thread: mq_timedsend succeeded on msg 0
sender_thread: mq_timedsend succeeded on msg 1
timedmqueue_test: Waiting for sender to complete
sender_thread: mq_timedsend succeeded on msg 2
sender_thread: mq_timedsend succeeded on msg 3
sender_thread: mq_timedsend succeeded on msg 4
sender_thread: mq_timedsend succeeded on msg 5
sender_thread: mq_timedsend succeeded on msg 6
sender_thread: mq_timedsend succeeded on msg 7
sender_thread: mq_timedsend succeeded on msg 8
sender_thread: mq_timedsend 9 timed out as expected
sender_thread: returning nerrors=0
timedmqueue_test: Starting receiver
receiver_thread: Starting
receiver_thread: mq_timedreceive succeeded on msg 0
receiver_thread: mq_timedreceive succeeded on msg 1
receiver_thread: mq_timedreceive succeeded on msg 2
receiver_thread: mq_timedreceive succeeded on msg 3
timedmqueue_test: Waiting for receiver to complete
receiver_thread: mq_timedreceive succeeded on msg 4
receiver_thread: mq_timedreceive succeeded on msg 5
receiver_thread: mq_timedreceive succeeded on msg 6
receiver_thread: mq_timedreceive succeeded on msg 7
receiver_thread: mq_timedreceive succeeded on msg 8
receiver_thread: Receive 9 timed out as expected
receiver_thread: returning nerrors=0
timedmqueue_test: Test complete
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 3
mxordblk 76b20 76b20
uordblks 3380 3380
fordblks 781d0 781d0
user_main: signal handler test
sighand_test: Initializing semaphore to 0
sighand_test: Starting waiter task
sighand_test: Started waiter_main pid=20
waiter_main: Waiter started
waiter_main: Unmasking signal 17
waiter_main: Registering signal handler
waiter_main: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
waiter_main: Waiting on semaphore
tcb=0x8057d0 sigdeliver=0x13046
rtcb=0x806e30 current_regs=0x0
sighand_test: Signaling pid=20 with signo=17 sigvalue=42
rtcb=8057d0 sigdeliver=13046 sigpendactionq.head=804b10
Resuming
wakeup_action: Received signal 17
wakeup_action: sival_int=42
wakeup_action: si_code=1
wakeup_action: ucontext=0
waiter_main: sem_wait() successfully interrupted by signal
waiter_main: done
sighand_test: done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 3 4
mxordblk 76b20 76b20
uordblks 3380 35c0
fordblks 781d0 77f90
user_main: POSIX timer test
timer_test: Initializing semaphore to 0
timer_test: Unmasking signal 17
timer_test: Registering signal handler
timer_test: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
timer_test: Creating timer
timer_test: Starting timer
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b23
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=1
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b36
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=2
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf7a
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b49
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=3
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf76
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b5c
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=4
timer_test: Waiting on semaphore
tcb=0x806e30 sigdeliver=0x13046
rtcb=0x8000c8 current_regs=0xffffbf66
rtcb=806e30 sigdeliver=13046 sigpendactionq.head=804b6f
Resuming
timer_expiration: Received signal 17
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=5
timer_test: Deleting timer
timer_test: done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 4 4
mxordblk 76b20 76b20
uordblks 35c0 35c0
fordblks 77f90 77f90
user_main: round-robin scheduler test
rr_test: Starting sieve1 thread
rr_test: Set thread priority to 1
rr_test: Set thread policty to SCHED_RR
rr_test: Starting sieve1 thread
sieve1 started
rr_test: Waiting for sieves to complete -- this should take awhile
rr_test: If RR scheduling is working, they should start and complete at
rr_test: about the same time
sieve2 started
sieve1 finished
sieve2 finished
rr_test: Done
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 4 4
mxordblk 76b20 76b20
uordblks 35c0 35c0
fordblks 77f90 77f90
user_main: barrier test
barrier_test: Initializing barrier
barrier_func: Thread 0 started
barrier_test: Thread 0 created
barrier_func: Thread 1 started
barrier_test: Thread 1 created
barrier_func: Thread 2 started
barrier_test: Thread 2 created
barrier_func: Thread 3 started
barrier_test: Thread 3 created
barrier_func: Thread 0 calling pthread_barrier_wait()
barrier_func: Thread 1 calling pthread_barrier_wait()
barrier_func: Thread 2 calling pthread_barrier_wait()
barrier_func: Thread 4 started
barrier_test: Thread 4 created
barrier_func: Thread 3 calling pthread_barrier_wait()
barrier_func: Thread 4 calling pthread_barrier_wait()
barrier_func: Thread 5 started
barrier_test: Thread 5 created
barrier_func: Thread 6 started
barrier_test: Thread 6 created
barrier_func: Thread 7 started
barrier_test: Thread 7 created
barrier_func: Thread 5 calling pthread_barrier_wait()
barrier_func: Thread 6 calling pthread_barrier_wait()
barrier_func: Thread 7 calling pthread_barrier_wait()
barrier_func: Thread 7, back with status=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL)
barrier_func: Thread 0, back with status=0 (I am not special)
barrier_func: Thread 1, back with status=0 (I am not special)
barrier_func: Thread 2, back with status=0 (I am not special)
barrier_func: Thread 3, back with status=0 (I am not special)
barrier_func: Thread 4, back with status=0 (I am not special)
barrier_func: Thread 5, back with status=0 (I am not special)
barrier_func: Thread 6, back with status=0 (I am not special)
barrier_func: Thread 2 done
barrier_func: Thread 7 done
barrier_func: Thread 0 done
barrier_func: Thread 1 done
barrier_func: Thread 6 done
barrier_func: Thread 3 done
barrier_func: Thread 4 done
barrier_func: Thread 5 done
barrier_test: Thread 0 completed with result=0
barrier_test: Thread 1 completed with result=0
barrier_test: Thread 2 completed with result=0
barrier_test: Thread 3 completed with result=0
barrier_test: Thread 4 completed with result=0
barrier_test: Thread 5 completed with result=0
barrier_test: Thread 6 completed with result=0
barrier_test: Thread 7 completed with result=0
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 4 4
mxordblk 76b20 76b20
uordblks 35c0 35c0
fordblks 77f90 77f90
Final memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b550 7b550
ordblks 2 4
mxordblk 76b20 76b20
uordblks 33d0 35c0
fordblks 78180 77f90
user_main: Exitting

View File

@@ -0,0 +1,84 @@
############################################################################
# configs/z8f64200100kit/Makefile
#
# 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 name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/Make.defs
ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)}
USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common'
INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES)
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES)
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = z8_lowinit.c z8_leds.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
all: libboard$(LIBEXT)
$(ASRCS) $(HEAD_ASRC): %$(ASMEXT): %.S
@$(CPP) $(CPPFLAGS) `cygpath -w $<` -o $@.tmp
@cat $@.tmp | sed -e "s/^#/;/g" > $@
@rm $@.tmp
$(AOBJS): %$(OBJEXT): %$(ASMEXT)
$(call ASSEMBLE, $<, $@)
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
$(call COMPILE, `cygpath -w $<`, $@)
libboard$(LIBEXT): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
depend: .depend
clean:
@rm -f libboard$(LIBEXT) *~ .*.swp
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@@ -0,0 +1,89 @@
/****************************************************************************
* configs/z8f64200100kit/src/z8_leds.c
*
* 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 name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <arch/board/board.h>
#include "up_internal.h"
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_ledinit
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void up_ledinit(void)
{
}
/****************************************************************************
* Name: up_ledon
****************************************************************************/
void up_ledon(int led)
{
}
/****************************************************************************
* Name: up_ledoff
****************************************************************************/
void up_ledoff(int led)
{
}
#endif /* CONFIG_ARCH_LEDS */

View File

@@ -0,0 +1,67 @@
/***************************************************************************
* configs/z8f64200100kit/src/z8_lowinit.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Based upon sample code included with the Zilog ZDS-II toolchain.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
/***************************************************************************
* Included Files
***************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include "chip/chip.h"
/***************************************************************************
* Definitions
***************************************************************************/
/***************************************************************************
* Private Functions
***************************************************************************/
static void z8_gpioinit(void)
{
}
/***************************************************************************
* Public Functions
***************************************************************************/
void z8_lowinit(void)
{
z8_gpioinit();
}

View File

@@ -379,7 +379,18 @@ EXTERN boolean up_interrupt_context(void);
* Name: up_enable_irq
*
* Description:
* Enable the IRQ specified by 'irq'
* On many architectures, there are three levels of interrupt enabling: (1)
* at the global level, (2) at the level of the interrupt controller,
* and (3) at the device level. In order to receive interrupts, they
* must be enabled at all three levels.
*
* This function implements enabling of the device specified by 'irq'
* at the interrupt controller level if supported by the architecture
* (irqsave() supports the global level, the device level is hardware
* specific).
*
* Since this API is not supported on all architectures, it should be
* avoided in common implementations where possible.
*
****************************************************************************/
@@ -389,7 +400,13 @@ EXTERN void up_enable_irq(int irq);
* Name: up_disable_irq
*
* Description:
* Disable the IRQ specified by 'irq'
* This function implements disabling of the device specified by 'irq'
* at the interrupt controller level if supported by the architecture
* (irqsave() supports the global level, the device level is hardware
* specific).
*
* Since this API is not supported on all architectures, it should be
* avoided in common implementations where possible.
*
****************************************************************************/

View File

@@ -230,7 +230,7 @@
/* At present, only the Zilog ZNeo compiler is recognized */
# if !defined(__ZNEO__) && !defined(__EZ8__)
# if !defined(__ZNEO__) && !defined(__EZ8__) && !defined(__EZ80__)
# warning "Unrecognized Zilog compiler"
# endif
@@ -272,24 +272,38 @@
* Z8Encore!: Far is 16-bits; near is 8-bits of address.
* The supported model is (1) all code on ROM, and (2) all data
* and stacks in internal (far) RAM.
* Z8Acclaim: In Z80 mode, all pointers are 16-bits. In ADL mode, all pointers
* and 24 bits.
*/
# ifdef __ZNEO__
# if defined(__ZNEO__)
# define FAR _Far
# define NEAR _Near
# define DSEG _Far
# define CODE _Erom
# undef CONFIG_SMALL_MEMORY /* Select the large, 32-bit addressing model */
# undef CONFIG_LONG_IS_NOT_INT /* Long and int are the same size */
# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */
# else
# undef CONFIG_SMALL_MEMORY /* Select the large, 32-bit addressing model */
# undef CONFIG_LONG_IS_NOT_INT /* Long and int are the same size */
# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */
# elif defined(__EZ8__)
# define FAR far
# define NEAR near
# define DSEG far
# define CODE rom
# define CONFIG_SMALL_MEMORY 1 /* Select small, 16-bit address model */
# define CONFIG_LONG_IS_NOT_INT 1 /* Long and int are not the same size */
# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */
# define CONFIG_SMALL_MEMORY 1 /* Select small, 16-bit address model */
# define CONFIG_LONG_IS_NOT_INT 1 /* Long and int are not the same size */
# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */
# elif defined(__EZ80__)
# define FAR
# define NEAR
# define DSEG
# define CODE
# undef CONFIG_SMALL_MEMORY /* Select the large, 32-bit addressing model */
# define CONFIG_LONG_IS_NOT_INT 1 /* Long and int are not the same size */
# ifdef CONFIG_EZ80_Z80MODE
# define CONFIG_PTR_IS_NOT_INT 1 /* Pointers and int are not the same size */
# else
# undef CONFIG_PTR_IS_NOT_INT /* Pointers and int are the same size */
# endif
# endif
/* The Zilog compiler does not support inline functions */
@@ -297,9 +311,10 @@
# undef CONFIG_HAVE_INLINE
# define inline
/* The Zilog compiler supports both types double and long long,
* but the size is 32-bits (same as long and single precision)
* so it is safer to say that they are not supported.
/* Older Zilog compilers support both types double and long long, but the size
* is 32-bits (same as long and single precision) so it is safer to say that
* they are not supported. Later versions are more ANSII compliant and
* simply do not support long long or double.
*/
# undef CONFIG_HAVE_DOUBLE

View File

@@ -184,7 +184,7 @@ void lib_releaselist(FAR struct streamlist *list)
(void)sem_destroy(&list->sl_streams[i].fs_sem);
/* Release the IO buffer */
if (&list->sl_streams[i].fs_bufstart)
if (list->sl_streams[i].fs_bufstart)
{
sched_free(list->sl_streams[i].fs_bufstart);
}

View File

@@ -86,7 +86,7 @@ static void timer_free(struct posix_timer_s *timer)
#if CONFIG_PREALLOC_TIMERS > 0
if ((timer->pt_flags & PT_FLAGS_PREALLOCATED) != 0)
{
sq_addlast((FAR sq_entry_t*)&timer, (FAR sq_queue_t*)&g_freetimers);
sq_addlast((FAR sq_entry_t*)timer, (FAR sq_queue_t*)&g_freetimers);
irqrestore(flags);
}
else