Email address change in misc/

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5144 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-09-13 17:32:42 +00:00
parent 77888ea156
commit 2cb5c82c18
202 changed files with 3966 additions and 3966 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
* Graphical Widgets for the NuttX RTOS
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -67,4 +67,4 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
********************************************************************************/
+11 -11
View File
@@ -1,16 +1,16 @@
buildroot-0.1.0 2007-03-09 <spudmonkey@racsa.co.cr>
buildroot-0.1.0 2007-03-09 <gnutt@nuttx.org>
Support for arm-elf toolchain
buildroot-0.1.1 (revision number not used)
buildroot-0.1.2 2008-11-06 <spudmonkey@racsa.co.cr>
buildroot-0.1.2 2008-11-06 <gnutt@nuttx.org>
* Add support for m68k-elf and m68hc11 toolchain
* Add patch to build older binutils with newer Texinfo version
* Add support for SH-1 toolchain
buildroot-0.1.3 2009-02-28 <spudmonkey@racsa.co.cr>
buildroot-0.1.3 2009-02-28 <gnutt@nuttx.org>
* Add support for H8/300 toolchain
* Add support for GCC 4.2.4 and binutils 2.19
@@ -18,7 +18,7 @@ buildroot-0.1.3 2009-02-28 <spudmonkey@racsa.co.cr>
* New ARM configuration using GCC 4.2.4 and binutils 2.19
* Add Renesas R8C/M16C/M32C configuration using GCC 4.2.4 and binutils 2.19
buildroot-0.1.4 2009-04-19 <spudmonkey@racsa.co.cr>
buildroot-0.1.4 2009-04-19 <gnutt@nuttx.org>
* Add support for a blackfin toolchain using GCC 4.2.4 and binutils 2.19
* GCC 4.2.4 no longer attempts to build libstdc++. Now we can build g++!
@@ -27,7 +27,7 @@ buildroot-0.1.4 2009-04-19 <spudmonkey@racsa.co.cr>
we do not build a libc. Now it builds almost twice as fast.
* Removed logic to build the target GCC. That is never used.
buildroot-0.1.5 2009-04-25 <spudmonkey@racsa.co.cr>
buildroot-0.1.5 2009-04-25 <gnutt@nuttx.org>
* Replaced config/arm-defconfig-4.2.4 with config/arm920t-defconfig-4.2.4
and config/arm926t-defconfig-4.2.4 because of differences in the
@@ -36,7 +36,7 @@ buildroot-0.1.5 2009-04-25 <spudmonkey@racsa.co.cr>
* Add support for gcc-4.3.3 and the ARM Cortex-M3 processor (thumb2)
* Add support for binutils 2.19.1
buildroot-0.1.6 2009-05-19 <spudmonkey@racsa.co.cr>
buildroot-0.1.6 2009-05-19 <gnutt@nuttx.org>
* Added config/arm7tdmi-defconfig-4.2.4
* Added config/arm920t-defconfig-4.3.3
@@ -45,14 +45,14 @@ buildroot-0.1.6 2009-05-19 <spudmonkey@racsa.co.cr>
* Correct error in gcc-3.4.6/gcc/collect.c. Calls open with O_CREAT but
does not specify mode. Newer host compilers can error out on this.
buildroot-0.1.7 2009-06-26 <spudmonkey@racsa.co.cr>
buildroot-0.1.7 2009-06-26 <gnutt@nuttx.org>
* configs/avr-defconfig-4.3.3: Added support for AVR to support a NuttX
port of the ATmega128.
* toolchain/nxflat: Added logic to build NuttX NXFLAT binding support tools
* toolchain/genromfs: Added support for the genromfs tool
buildroot-1.8 2009-12-21 <spudmonkey@racsa.co.cr>
buildroot-1.8 2009-12-21 <gnutt@nuttx.org>
* configs/cortexm3-defconfig-4.3.3: Added support for NuttX NXFLAT
tools.
@@ -64,7 +64,7 @@ buildroot-1.8 2009-12-21 <spudmonkey@racsa.co.cr>
* configs/m32c-defconfig-4.2.4: Added genromfs
* configs/m32c-defconfig-4.3.3: Update to m32c-defconfig-4.2.4
buildroot-1.9 2011-02-10 <spudmonkey@racsa.co.cr>
buildroot-1.9 2011-02-10 <gnutt@nuttx.org>
* configs/arm926t-defconfig-4.3.3: update arm926t-defconfig-4.2.4
* configs/arm926t-defconfig-nxflat: NXFLAT-only configuration for
@@ -77,7 +77,7 @@ buildroot-1.9 2011-02-10 <spudmonkey@racsa.co.cr>
patches available from http://www.msextra.com/tools courtesy of James
Cortina. Add configs/m9x12x-defconfig-3.3.6.
buildroot-1.10 2011-05-06 <spudmonkey@racsa.co.cr>
buildroot-1.10 2011-05-06 <gnutt@nuttx.org>
* Add patch submitted by Dimiter Georgiev to work around problems in building
GDB 6.8 with versions of Cygwin > 1.7.
@@ -101,7 +101,7 @@ buildroot-1.10 2011-05-06 <spudmonkey@racsa.co.cr>
* configs/arm920t-eabi-defconfig-4.5.2 - Add a configuration to build a
GCC 4.5.2 EABI ARM toolchain for the ARM920t.
buildroot-1.11 2011-xx-xx <spudmonkey@racsa.co.cr>
buildroot-1.11 2011-xx-xx <gnutt@nuttx.org>
* configs/avr-defconfig-4.3.3 - Added --enable-long-long as a GCC
option.
+1 -1
View File
@@ -2,7 +2,7 @@
# toolchain/nxflat/Makefile
#
# Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# toolchain/nxflat/arm/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* ARM thumb2 ELF support for BFD.
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Simply lifted with minimal change from the BFD, binutils 2.19.1:
*
+2 -2
View File
@@ -3,13 +3,13 @@
* ARM Disassembler
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Derived from XFLAT:
*
* Copyright (c) 2006, Cadenux, LLC. All rights reserved.
* Copyright (c) 2006, Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Which simply lifted it from the BFD:
*
@@ -2,7 +2,7 @@
* toolchain/nxflat/arm/dyncall_skeleton.def
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+2 -2
View File
@@ -9,14 +9,14 @@
* will and GOT relocations as well).
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
*
* Modified from ldelf2xflat (see http://xflat.org):
*
* Copyright (c) 2002, 2006, Cadenux, LLC. All rights reserved.
* Copyright (c) 2002, 2006, Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Extended from the FLAT ldnxflat.c (original copyright below )
*
+2 -2
View File
@@ -2,13 +2,13 @@
* xflat/tools/mknxflat.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Modified from ldelflib (see http://xflat.org):
*
* Copyright (c) 2002, 2006, Cadenux, LLC. All rights reserved.
* Copyright (c) 2002, 2006, Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
* toolchain/nxflat/nxflat.h
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# toolchain/nxflat/nxflat.mk
#
# Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+2 -2
View File
@@ -2,13 +2,13 @@
* toolchain/nxflat/readnxflat.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Modified from readxflat (see http://xflat.org):
*
* Copyright (c) 2002, 2006, Cadenux, LLC. All rights reserved.
* Copyright (c) 2002, 2006, Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -3,7 +3,7 @@
* Generic relocation support for BFD.
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Simply lifted with minimal change from the BFD, binutils 2.19.1:
*
@@ -2,7 +2,7 @@
# toolchain/nxflat/thumb2/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -3,7 +3,7 @@
* ARM thumb2 ELF support for BFD.
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Simply lifted with minimal change from the BFD, binutils 2.19.1:
*
@@ -3,7 +3,7 @@
* ARM Thumb2 Disassembler
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
***********************************************************************/
@@ -2,7 +2,7 @@
* toolchain/nxflat/thumb2/dyncall_skeleton.def
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
# Install ALL optional drivers into the NuttX source tree
#
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
# Install the GPLv2 RTL8187x driver into the NuttX source tree
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -5,7 +5,7 @@
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011 Rafael Noronha. All rights reserved.
* Authors: Gregoyr Nutt <spudmonkey@racsa.co.cr>
* Authors: Gregoyr Nutt <gnutt@nuttx.org>
* Rafael Noronha <rafael@pdsolucoes.com.br>
*
* Portions of the logic in this file derives from the KisMAC RTL8187x driver
+5 -5
View File
@@ -1,12 +1,12 @@
pascal-0.1.0 2008-01-07 Gregory Nutt <spudmonkey@racsa.co.cr>
pascal-0.1.0 2008-01-07 Gregory Nutt <gnutt@nuttx.org>
* Initial release
pascal-0.1.1 2008-02-01 Gregory Nutt <spudmonkey@racsa.co.cr>
pascal-0.1.1 2008-02-01 Gregory Nutt <gnutt@nuttx.org>
* Correct some errors in the NuttX installation logic
pascal-0.1.2 2008-02-10 Gregory Nutt <spudmonkey@racsa.co.cr>
pascal-0.1.2 2008-02-10 Gregory Nutt <gnutt@nuttx.org>
* Add logic to build and link with the ZDS-II toolchain
use with the z16f.
@@ -16,13 +16,13 @@ pascal-0.1.2 2008-02-10 Gregory Nutt <spudmonkey@racsa.co.cr>
and eliminate a compiler bug
* Changes so that runtime compiles with SDCC.
pascal-2.0 2009-12-21 Gregory Nutt <spudmonkey@racsa.co.cr>
pascal-2.0 2009-12-21 Gregory Nutt <gnutt@nuttx.org>
* Updated to use standard C99 types in stdint.h and
stdbool.h. This change was necessary for compatibility
with NuttX-5.0 (any beyond).
pascal-3.0 2010-05-15 Gregory Nutt <spudmonkey@racsa.co.cr>
pascal-3.0 2010-05-15 Gregory Nutt <gnutt@nuttx.org>
* nuttx/: The Pascal add-on module now installs and builds under the
apps/interpreters directory. This means that the pascal-3.0 module is
+1 -1
View File
@@ -3,7 +3,7 @@
# Configure
#
# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# Make.config.h
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# Make.defs
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
# Reconfigure
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
# config.info
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+82 -82
View File
@@ -1,82 +1,82 @@
/*************************************************************
* keywords.h
* This file defines the pascal compilation environment
*
* 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 __KEYWORDS_H
#define __KEYWORDS_H
/*************************************************************
* Included Files
*************************************************************/
#include "config.h"
/*************************************************************
*Pre-processor Definitions
*************************************************************/
#ifndef NULL
# define NULL ((void*)0)
#endif
#ifndef CONFIG_DEBUG
# define CONFIG_DEBUG 0
#endif
#if CONFIG_DEBUG
# define DEBUG(stream, format, arg...) fprintf(stream, format, ##arg)
#else
# define DEBUG(x...)
#endif
#ifndef CONFIG_TRACE
# define CONFIG_TRACE 0
#endif
#if CONFIG_TRACE
# define TRACE(stream, format, arg...) fprintf(stream, format, ##arg)
#else
# define TRACE(x...)
#endif
#define FAR
#define dbg(...) fprintf(stderr, __VA_ARGS__)
#define vdbg(...) DEBUG(__VA_ARGS__)
#endif /* __KEYWORDS_H */
/*************************************************************
* keywords.h
* This file defines the pascal compilation environment
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __KEYWORDS_H
#define __KEYWORDS_H
/*************************************************************
* Included Files
*************************************************************/
#include "config.h"
/*************************************************************
*Pre-processor Definitions
*************************************************************/
#ifndef NULL
# define NULL ((void*)0)
#endif
#ifndef CONFIG_DEBUG
# define CONFIG_DEBUG 0
#endif
#if CONFIG_DEBUG
# define DEBUG(stream, format, arg...) fprintf(stream, format, ##arg)
#else
# define DEBUG(x...)
#endif
#ifndef CONFIG_TRACE
# define CONFIG_TRACE 0
#endif
#if CONFIG_TRACE
# define TRACE(stream, format, arg...) fprintf(stream, format, ##arg)
#else
# define TRACE(x...)
#endif
#define FAR
#define dbg(...) fprintf(stderr, __VA_ARGS__)
#define vdbg(...) DEBUG(__VA_ARGS__)
#endif /* __KEYWORDS_H */
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated with paslib
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Common definitions
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Definitions of error codes
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated with perr.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+93 -93
View File
@@ -1,93 +1,93 @@
/***********************************************************************
* pfdefs.h
* Floating point operation codes
*
* Copyright (C) 2008-2009 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 __PFDEFS_H
#define __PFDEFS_H
/***********************************************************************
* FLOATING POINT SUB-OPCODES
***********************************************************************/
/* This bit may be set in the opcode to indicate that the arguments
* is(are) type integer and require(s) conversion. */
#define fpARG1 (0x40)
#define fpARG2 (0x80)
#define fpMASK (0x3f)
#define fpSHIFT 6
/* The "INVALID" floating point operation */
#define fpINVLD (0x00)
/* Floating Pointer Conversions (On 16-bit stack argument: FP or Integer) */
#define fpFLOAT (0x01)
#define fpTRUNC (0x02)
#define fpROUND (0x03)
/* Floating Point arithmetic instructions (Two FP 16-bit stack arguments) */
#define fpADD (0x04)
#define fpSUB (0x05)
#define fpMUL (0x06)
#define fpDIV (0x07)
#define fpMOD (0x08)
/* Floating Point Comparisons (Two FP 16-bit stack arguments) */
#define fpEQU (0x0a)
#define fpNEQ (0x0b)
#define fpLT (0x0c)
#define fpGTE (0x0d)
#define fpGT (0x0e)
#define fpLTE (0x0f)
/* Floating Point arithmetic instructions (One FP 16-bit stack arguments) */
#define fpNEG (0x10)
#define fpABS (0x11)
#define fpSQR (0x12)
#define fpSQRT (0x13)
#define fpSIN (0x14)
#define fpCOS (0x15)
#define fpATAN (0x16)
#define fpLN (0x17)
#define fpEXP (0x18)
#define MAX_FOP (0x19) /* Number of floating point operations */
#endif /* __PFDEFS_H */
/***********************************************************************
* pfdefs.h
* Floating point operation codes
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PFDEFS_H
#define __PFDEFS_H
/***********************************************************************
* FLOATING POINT SUB-OPCODES
***********************************************************************/
/* This bit may be set in the opcode to indicate that the arguments
* is(are) type integer and require(s) conversion. */
#define fpARG1 (0x40)
#define fpARG2 (0x80)
#define fpMASK (0x3f)
#define fpSHIFT 6
/* The "INVALID" floating point operation */
#define fpINVLD (0x00)
/* Floating Pointer Conversions (On 16-bit stack argument: FP or Integer) */
#define fpFLOAT (0x01)
#define fpTRUNC (0x02)
#define fpROUND (0x03)
/* Floating Point arithmetic instructions (Two FP 16-bit stack arguments) */
#define fpADD (0x04)
#define fpSUB (0x05)
#define fpMUL (0x06)
#define fpDIV (0x07)
#define fpMOD (0x08)
/* Floating Point Comparisons (Two FP 16-bit stack arguments) */
#define fpEQU (0x0a)
#define fpNEQ (0x0b)
#define fpLT (0x0c)
#define fpGTE (0x0d)
#define fpGT (0x0e)
#define fpLTE (0x0f)
/* Floating Point arithmetic instructions (One FP 16-bit stack arguments) */
#define fpNEG (0x10)
#define fpABS (0x11)
#define fpSQR (0x12)
#define fpSQRT (0x13)
#define fpSIN (0x14)
#define fpCOS (0x15)
#define fpATAN (0x16)
#define fpLN (0x17)
#define fpEXP (0x18)
#define MAX_FOP (0x19) /* Number of floating point operations */
#endif /* __PFDEFS_H */
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated libinsn.a
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Logical P-code operation code definitions
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Definitions for the PCode Object File Format (POFF)
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Interfaces to the POFF library
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+232 -232
View File
@@ -1,232 +1,232 @@
/***********************************************************************
* pxdefs.h
* Definitions of the arguments of the oSYSIO opcode
*
* Copyright (C) 2008-2009 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 __PXDEFS_H
#define __PXDEFS_H
/***********************************************************************/
/* Codes for system IO calls associated with standard Pascal procedure
* and function calls. These must be confined to the range 0x0000
* through 0xffff.
*/
#define xEOF (0x0001)
#define xEOLN (0x0002)
#define xRESET (0x0003)
#define xREWRITE (0x0004)
#define xREADLN (0x0010)
#define xREAD_PAGE (0x0011)
#define xREAD_BINARY (0x0012)
#define xREAD_INT (0x0013)
#define xREAD_CHAR (0x0014)
#define xREAD_STRING (0x0015)
#define xREAD_REAL (0x0016)
#define xWRITELN (0x0020)
#define xWRITE_PAGE (0x0021)
#define xWRITE_BINARY (0x0022)
#define xWRITE_INT (0x0023)
#define xWRITE_CHAR (0x0024)
#define xWRITE_STRING (0x0025)
#define xWRITE_REAL (0x0026)
#define MAX_XOP (0x0027)
/***********************************************************************/
/* Codes for runtime library interfaces. These must be confined to the
* range 0x0000 through 0xffff.
*/
/* Get an environment string.
* function getent(name : string) : cstring;
* ON INPUT:
* TOS(0)=length of string
* TOS(1)=pointer to string
* ON RETURN: actual parameters released
* TOS(0,1)=32-bit absolute address of string
*/
#define lbGETENV (0x0000)
/* Copy pascal string to a pascal string
* procedure str2str(src : string; var dest : string)
* ON INPUT:
* TOS(0)=address of dest string
* TOS(1)=length of source string
* TOS(2)=pointer to source string
* ON RETURN: actual parameters released.
*/
#define lbSTR2STR (0x0001)
/* Copy C string to a pascal string
* procedure cstr2str(src : cstring; var dest : string)
* ON INPUT:
* TOS(0)=address of dest string
* TOS(1,2)=32-bit absolute address of C string
* ON RETURN: actual parameters released
*/
#define lbCSTR2STR (0x0002)
/* Copy pascal string to a pascal string reference
* procedure str2rstr(src : string; var dest : rstring)
* ON INPUT:
* TOS(0)=address of dest string reference
* TOS(1)=length of source string
* TOS(2)=pointer to source string
* ON RETURN: actual parameters released.
*/
#define lbSTR2RSTR (0x0003)
/* Copy C string to a pascal string reference
* procedure cstr2str(src : cstring; var dest : string)
* ON INPUT:
* TOS(0)=address of dest string reference
* TOS(0)=MS 16-bits of 32-bit C source string pointer
* TOS(1)=LS 16-bits of 32-bit C source string pointer
* ON RETURN: actual parameters released
*/
#define lbCSTR2RSTR (0x0004)
/* Convert a string to a numeric value
* procedure val(const s : string; var v; var code : word);
*
* Description:
* val() converts the value represented in the string S to a numerical
* value, and stores this value in the variable V, which can be of type
* Longint, Real and Byte. If the conversion isn¡Çt succesfull, then the
* parameter Code contains the index of the character in S which
* prevented the conversion. The string S is allowed to contain spaces
* in the beginning.
*
* The string S can contain a number in decimal, hexadecimal, binary or
* octal format, as described in the language reference.
*
* Errors:
* If the conversion doesn¡Çt succeed, the value of Code indicates the
* position where the conversion went wrong.
*
* ON INPUT
* TOS(0)=address of Code
* TOS(1)=address of v
* TOS(2)=length of source string
* TOS(3)=pointer to source string
* ON RETURN: actual parameters released
*/
#define lbVAL (0x0005)
/* Create an empty string
* function mkstk : string;
* ON INPUT
* ON RETURN
* TOS(0)=length of new string
* TOS(1)=pointer to new string
*/
#define lbMKSTK (0x0006)
/* Replace a string with a duplicate string residing in allocated
* string stack.
* function mkstkstr(name : string) : string;
* ON INPUT
* TOS(0)=length of original string
* TOS(1)=pointer to original string
* ON RETURN
* TOS(0)=length of new string
* TOS(1)=pointer to new string
*/
#define lbMKSTKSTR (0x0007)
/* Replace a character with a string residing in allocated string stack.
* function mkstkc(c : char) : string;
* ON INPUT
* TOS(0)=Character value
* ON RETURN
* TOS(0)=length of new string
* TOS(1)=pointer to new string
*/
#define lbMKSTKC (0x0008)
/* Concatenate a string to the end of a string.
* function strcat(name : string, c : char) : string;
* ON INPUT
* TOS(0)=length of string
* TOS(1)=pointer to string
* TOS(2)=length of string
* TOS(3)=pointer to string
* ON OUTPUT
* TOS(1)=new length of string
* TOS(2)=pointer to string
*/
#define lbSTRCAT (0x0009)
/* Concatenate a character to the end of a string.
* function strcatc(name : string, c : char) : string;
* ON INPUT
* TOS(0)=character to concatenate
* TOS(1)=length of string
* TOS(2)=pointer to string
* ON OUTPUT
* TOS(1)=new length of string
* TOS(2)=pointer to string
*/
#define lbSTRCATC (0x000a)
/* Compare two pascal strings
* function strcmp(name1 : string, name2 : string) : integer;
* ON INPUT
* TOS(1)=length of string2
* TOS(2)=address of string2 data
* TOS(3)=length of string1
* TOS(4)=address of string1 data
* ON OUTPUT
* TOS(0)=(-1=less than, 0=equal, 1=greater than}
*/
#define lbSTRCMP (0x000b)
#define MAX_LBOP (0x000c)
#endif /* __PXDEFS_H */
/***********************************************************************
* pxdefs.h
* Definitions of the arguments of the oSYSIO opcode
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PXDEFS_H
#define __PXDEFS_H
/***********************************************************************/
/* Codes for system IO calls associated with standard Pascal procedure
* and function calls. These must be confined to the range 0x0000
* through 0xffff.
*/
#define xEOF (0x0001)
#define xEOLN (0x0002)
#define xRESET (0x0003)
#define xREWRITE (0x0004)
#define xREADLN (0x0010)
#define xREAD_PAGE (0x0011)
#define xREAD_BINARY (0x0012)
#define xREAD_INT (0x0013)
#define xREAD_CHAR (0x0014)
#define xREAD_STRING (0x0015)
#define xREAD_REAL (0x0016)
#define xWRITELN (0x0020)
#define xWRITE_PAGE (0x0021)
#define xWRITE_BINARY (0x0022)
#define xWRITE_INT (0x0023)
#define xWRITE_CHAR (0x0024)
#define xWRITE_STRING (0x0025)
#define xWRITE_REAL (0x0026)
#define MAX_XOP (0x0027)
/***********************************************************************/
/* Codes for runtime library interfaces. These must be confined to the
* range 0x0000 through 0xffff.
*/
/* Get an environment string.
* function getent(name : string) : cstring;
* ON INPUT:
* TOS(0)=length of string
* TOS(1)=pointer to string
* ON RETURN: actual parameters released
* TOS(0,1)=32-bit absolute address of string
*/
#define lbGETENV (0x0000)
/* Copy pascal string to a pascal string
* procedure str2str(src : string; var dest : string)
* ON INPUT:
* TOS(0)=address of dest string
* TOS(1)=length of source string
* TOS(2)=pointer to source string
* ON RETURN: actual parameters released.
*/
#define lbSTR2STR (0x0001)
/* Copy C string to a pascal string
* procedure cstr2str(src : cstring; var dest : string)
* ON INPUT:
* TOS(0)=address of dest string
* TOS(1,2)=32-bit absolute address of C string
* ON RETURN: actual parameters released
*/
#define lbCSTR2STR (0x0002)
/* Copy pascal string to a pascal string reference
* procedure str2rstr(src : string; var dest : rstring)
* ON INPUT:
* TOS(0)=address of dest string reference
* TOS(1)=length of source string
* TOS(2)=pointer to source string
* ON RETURN: actual parameters released.
*/
#define lbSTR2RSTR (0x0003)
/* Copy C string to a pascal string reference
* procedure cstr2str(src : cstring; var dest : string)
* ON INPUT:
* TOS(0)=address of dest string reference
* TOS(0)=MS 16-bits of 32-bit C source string pointer
* TOS(1)=LS 16-bits of 32-bit C source string pointer
* ON RETURN: actual parameters released
*/
#define lbCSTR2RSTR (0x0004)
/* Convert a string to a numeric value
* procedure val(const s : string; var v; var code : word);
*
* Description:
* val() converts the value represented in the string S to a numerical
* value, and stores this value in the variable V, which can be of type
* Longint, Real and Byte. If the conversion isn¡Çt succesfull, then the
* parameter Code contains the index of the character in S which
* prevented the conversion. The string S is allowed to contain spaces
* in the beginning.
*
* The string S can contain a number in decimal, hexadecimal, binary or
* octal format, as described in the language reference.
*
* Errors:
* If the conversion doesn¡Çt succeed, the value of Code indicates the
* position where the conversion went wrong.
*
* ON INPUT
* TOS(0)=address of Code
* TOS(1)=address of v
* TOS(2)=length of source string
* TOS(3)=pointer to source string
* ON RETURN: actual parameters released
*/
#define lbVAL (0x0005)
/* Create an empty string
* function mkstk : string;
* ON INPUT
* ON RETURN
* TOS(0)=length of new string
* TOS(1)=pointer to new string
*/
#define lbMKSTK (0x0006)
/* Replace a string with a duplicate string residing in allocated
* string stack.
* function mkstkstr(name : string) : string;
* ON INPUT
* TOS(0)=length of original string
* TOS(1)=pointer to original string
* ON RETURN
* TOS(0)=length of new string
* TOS(1)=pointer to new string
*/
#define lbMKSTKSTR (0x0007)
/* Replace a character with a string residing in allocated string stack.
* function mkstkc(c : char) : string;
* ON INPUT
* TOS(0)=Character value
* ON RETURN
* TOS(0)=length of new string
* TOS(1)=pointer to new string
*/
#define lbMKSTKC (0x0008)
/* Concatenate a string to the end of a string.
* function strcat(name : string, c : char) : string;
* ON INPUT
* TOS(0)=length of string
* TOS(1)=pointer to string
* TOS(2)=length of string
* TOS(3)=pointer to string
* ON OUTPUT
* TOS(1)=new length of string
* TOS(2)=pointer to string
*/
#define lbSTRCAT (0x0009)
/* Concatenate a character to the end of a string.
* function strcatc(name : string, c : char) : string;
* ON INPUT
* TOS(0)=character to concatenate
* TOS(1)=length of string
* TOS(2)=pointer to string
* ON OUTPUT
* TOS(1)=new length of string
* TOS(2)=pointer to string
*/
#define lbSTRCATC (0x000a)
/* Compare two pascal strings
* function strcmp(name1 : string, name2 : string) : integer;
* ON INPUT
* TOS(1)=length of string2
* TOS(2)=address of string2 data
* TOS(3)=length of string1
* TOS(4)=address of string1 data
* ON OUTPUT
* TOS(0)=(-1=less than, 0=equal, 1=greater than}
*/
#define lbSTRCMP (0x000b)
#define MAX_LBOP (0x000c)
#endif /* __PXDEFS_H */
+1 -1
View File
@@ -2,7 +2,7 @@
# insn16/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+52 -52
View File
@@ -1,52 +1,52 @@
/***************************************************************************
* pdbg.h
* External Declarations associated with the P-Code debugger
*
* 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 __PDBG_H
#define __PDBG_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pexec.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void dbg_run(struct pexec_s *st);
#endif /* __PDBG_H */
/***************************************************************************
* pdbg.h
* External Declarations associated with the P-Code debugger
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PDBG_H
#define __PDBG_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pexec.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void dbg_run(struct pexec_s *st);
#endif /* __PDBG_H */
+1 -1
View File
@@ -2,7 +2,7 @@
* pexec.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* 16-bit P-code operation code definitions
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# insn16/libinsn/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+100 -100
View File
@@ -1,100 +1,100 @@
/**********************************************************************
* paddopcode
* P-Code access utilities
*
* 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 "keywords.h"
#include "podefs.h"
#include "pinsn16.h"
#include "paslib.h"
#include "pofflib.h"
#include "pinsn.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
/**********************************************************************
* Global Variables
**********************************************************************/
/**********************************************************************
* Private Variables
**********************************************************************/
/**********************************************************************
* Private Functions
**********************************************************************/
/**********************************************************************
* Global Functions
**********************************************************************/
/**********************************************************************/
void insn_AddOpCode(poffHandle_t handle, OPTYPE *ptr)
{
/* Write the opcode which is always present */
(void)poffAddProgByte(handle, ptr->op);
/* Write the 8-bit argument if present */
if (ptr->op & o8)
{
(void)poffAddProgByte(handle, ptr->arg1);
}
/* Write the 16-bit argument if present */
if (ptr->op & o16)
{
(void)poffAddProgByte(handle, (ptr->arg2 >> 8));
(void)poffAddProgByte(handle, (ptr->arg2 & 0xff));
}
}
/**********************************************************************/
void insn_ResetOpCodeWrite(poffHandle_t handle)
{
poffResetAccess(handle);
}
/***********************************************************************/
/**********************************************************************
* paddopcode
* P-Code access utilities
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 "keywords.h"
#include "podefs.h"
#include "pinsn16.h"
#include "paslib.h"
#include "pofflib.h"
#include "pinsn.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
/**********************************************************************
* Global Variables
**********************************************************************/
/**********************************************************************
* Private Variables
**********************************************************************/
/**********************************************************************
* Private Functions
**********************************************************************/
/**********************************************************************
* Global Functions
**********************************************************************/
/**********************************************************************/
void insn_AddOpCode(poffHandle_t handle, OPTYPE *ptr)
{
/* Write the opcode which is always present */
(void)poffAddProgByte(handle, ptr->op);
/* Write the 8-bit argument if present */
if (ptr->op & o8)
{
(void)poffAddProgByte(handle, ptr->arg1);
}
/* Write the 16-bit argument if present */
if (ptr->op & o16)
{
(void)poffAddProgByte(handle, (ptr->arg2 >> 8));
(void)poffAddProgByte(handle, (ptr->arg2 & 0xff));
}
}
/**********************************************************************/
void insn_ResetOpCodeWrite(poffHandle_t handle)
{
poffResetAccess(handle);
}
/***********************************************************************/
+100 -100
View File
@@ -1,100 +1,100 @@
/**********************************************************************
* paddtmpopcode
* P-Code access utilities
*
* 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 "keywords.h"
#include "podefs.h"
#include "pinsn16.h"
#include "paslib.h"
#include "pofflib.h"
#include "pinsn.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
/**********************************************************************
* Global Variables
**********************************************************************/
/**********************************************************************
* Private Variables
**********************************************************************/
/**********************************************************************
* Private Functions
**********************************************************************/
/**********************************************************************
* Global Functions
**********************************************************************/
/**********************************************************************/
void insn_AddTmpOpCode(poffProgHandle_t progHandle, OPTYPE *ptr)
{
/* Write the opcode which is always present */
(void)poffAddTmpProgByte(progHandle, ptr->op);
/* Write the 8-bit argument if present */
if (ptr->op & o8)
{
(void)poffAddTmpProgByte(progHandle, ptr->arg1);
}
/* Write the 16-bit argument if present */
if (ptr->op & o16)
{
(void)poffAddTmpProgByte(progHandle, (ptr->arg2 >> 8));
(void)poffAddTmpProgByte(progHandle, (ptr->arg2 & 0xff));
}
}
/**********************************************************************/
void insn_ResetTmpOpCodeWrite(poffProgHandle_t progHandle)
{
poffResetProgHandle(progHandle);
}
/***********************************************************************/
/**********************************************************************
* paddtmpopcode
* P-Code access utilities
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 "keywords.h"
#include "podefs.h"
#include "pinsn16.h"
#include "paslib.h"
#include "pofflib.h"
#include "pinsn.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
/**********************************************************************
* Global Variables
**********************************************************************/
/**********************************************************************
* Private Variables
**********************************************************************/
/**********************************************************************
* Private Functions
**********************************************************************/
/**********************************************************************
* Global Functions
**********************************************************************/
/**********************************************************************/
void insn_AddTmpOpCode(poffProgHandle_t progHandle, OPTYPE *ptr)
{
/* Write the opcode which is always present */
(void)poffAddTmpProgByte(progHandle, ptr->op);
/* Write the 8-bit argument if present */
if (ptr->op & o8)
{
(void)poffAddTmpProgByte(progHandle, ptr->arg1);
}
/* Write the 16-bit argument if present */
if (ptr->op & o16)
{
(void)poffAddTmpProgByte(progHandle, (ptr->arg2 >> 8));
(void)poffAddTmpProgByte(progHandle, (ptr->arg2 & 0xff));
}
}
/**********************************************************************/
void insn_ResetTmpOpCodeWrite(poffProgHandle_t progHandle)
{
poffResetProgHandle(progHandle);
}
/***********************************************************************/
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code Disassembler
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code generation logic
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code access utilities
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Perform P-Code relocations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# insn16/plist/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* POFF file lister
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
# Host system makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Constant Expression Optimizations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated with PCOPT.C
*
* Copyright (C) 200-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Finalization of optimized image
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+54 -54
View File
@@ -1,54 +1,54 @@
/***************************************************************************
* pfopt.h
* External Declarations associated with pfopt.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.
*
***************************************************************************/
#ifndef __PFOPT_H
#define __PFOPT_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pofflib.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void optFinalize(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
#endif /* __PFOPT_H */
/***************************************************************************
* pfopt.h
* External Declarations associated with pfopt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PFOPT_H
#define __PFOPT_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pofflib.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void optFinalize(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
#endif /* __PFOPT_H */
+1 -1
View File
@@ -3,7 +3,7 @@
* Branch Optimizations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated with pjopt.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Load/Store Optimizations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated with plopt.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code Local Optimizer
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* External Declarations associated with polocal.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code Optimizer Main Logic
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+52 -52
View File
@@ -1,52 +1,52 @@
/***************************************************************************
* popt.h
* External Declarations associated with popt.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.
*
***************************************************************************/
#ifndef __POPT_H
#define __POPT_H
/***************************************************************************
* Included Files
****************************************************************************/
/***************************************************************************
* Global Function Prototypes
****************************************************************************/
/***************************************************************************
* Global Variables
****************************************************************************/
#endif /* __POPT_H */
/***************************************************************************
* popt.h
* External Declarations associated with popt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __POPT_H
#define __POPT_H
/***************************************************************************
* Included Files
****************************************************************************/
/***************************************************************************
* Global Function Prototypes
****************************************************************************/
/***************************************************************************
* Global Variables
****************************************************************************/
#endif /* __POPT_H */
+1 -1
View File
@@ -3,7 +3,7 @@
* String Stack Optimizaitons
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+54 -54
View File
@@ -1,54 +1,54 @@
/***************************************************************************
* psopt.h
* External Declarations associated with psopt.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.
*
***************************************************************************/
#ifndef __PSOPT_H
#define __PSOPT_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pofflib.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void stringStackOptimize(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
#endif /* __PSOPT_H */
/***************************************************************************
* psopt.h
* External Declarations associated with psopt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PSOPT_H
#define __PSOPT_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pofflib.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void stringStackOptimize(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
#endif /* __PSOPT_H */
+1 -1
View File
@@ -3,7 +3,7 @@
# NuttX runtime makefile fragment
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
# Host system makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code Debugger
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
* pexec.c
*
* Copyright (C) 200-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
* pload.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
* prun.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# insn32/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Definitions of built-in function calls.
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
* pexec.h
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* 32-bit P-code operation code definitions
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* 32-bit register module instruction definitions
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# insn32/libinsn/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code access utilities
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code access utilities
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code Disassembler
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code generation logic
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* P-Code access utilities
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Perform P-Code relocations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -3,7 +3,7 @@
* P-Code access utilities
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# insn32/plist/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* POFF file lister
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+1 -1
View File
@@ -2,7 +2,7 @@
# insn32/popt/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
+1 -1
View File
@@ -3,7 +3,7 @@
* Constant Expression Optimizations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+47 -47
View File
@@ -1,47 +1,47 @@
/***************************************************************************
* pcopt.h
* External Declarations associated with PCOPT.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.
*
***************************************************************************/
#ifndef __PCOPT_H
#define __PCOPT_H
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern int unaryOptimize ( void );
extern int binaryOptimize ( void );
#endif /* __PCOPT_H */
/***************************************************************************
* pcopt.h
* External Declarations associated with PCOPT.C
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PCOPT_H
#define __PCOPT_H
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern int unaryOptimize ( void );
extern int binaryOptimize ( void );
#endif /* __PCOPT_H */
+1 -1
View File
@@ -3,7 +3,7 @@
* Finalization of optimized image
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+54 -54
View File
@@ -1,54 +1,54 @@
/***************************************************************************
* pfopt.h
* External Declarations associated with pfopt.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.
*
***************************************************************************/
#ifndef __PFOPT_H
#define __PFOPT_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pofflib.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void optFinalize(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
#endif /* __PFOPT_H */
/***************************************************************************
* pfopt.h
* External Declarations associated with pfopt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PFOPT_H
#define __PFOPT_H
/***************************************************************************
* Included Files
***************************************************************************/
#include "pofflib.h"
/***************************************************************************
* Global Function Prototypes
***************************************************************************/
extern void optFinalize(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
#endif /* __PFOPT_H */
+449 -449
View File
@@ -1,449 +1,449 @@
/**********************************************************************
* pjopt.c
* Branch Optimizations
*
* 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 <stdio.h>
#include "keywords.h"
#include "pdefs.h"
#include "pinsn32.h"
#include "popt.h"
#include "polocal.h"
#include "pjopt.h"
/**********************************************************************/
int BranchOptimize (void)
{
int nchanges = 0;
register int i;
TRACE(stderr, "[BranchOptimize]");
/* At least two pcodes are need to perform branch optimizations */
i = 0;
while (i < nops-1)
{
switch (pptr[i]->op)
{
case oNOT :
switch (pptr[i+1]->op)
{
case oJEQUZ :
pptr[i+1]->op = oJNEQZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJEQUZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oNEG :
switch (pptr[i+1]->op)
{
case oJLTZ :
pptr[i+1]->op = oJGTZ;
deletePcode(i);
nchanges++;
break;
case oJGTEZ :
pptr[i+1]->op = oJLTEZ;
deletePcode(i);
nchanges++;
break;
case oJGTZ :
pptr[i+1]->op = oJLTZ;
deletePcode(i);
nchanges++;
break;
case oJLTEZ :
pptr[i+1]->op = oJGTEZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oEQU :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oNEQ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJNEQ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJEQU;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oNEQ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oEQU;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJEQU;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJNEQ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLT :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGTE;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGTE;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLT;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGTE :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLT;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLT;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGTE;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGT :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLTE;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLTE;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGT;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLTE :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGT;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGT;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLTE;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oEQUZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oNEQZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJNEQZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJEQUZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oNEQZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oEQUZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
case oJNEQZ :
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLTZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGTEZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGTEZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLTZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGTEZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLTZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLTZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGTEZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGTZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLTEZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLTEZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGTZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLTEZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGTZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGTZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLTEZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
default :
i++;
break;
} /* end switch */
} /* end while */
return (nchanges);
} /* end BranchOptimize */
/**********************************************************************/
/**********************************************************************
* pjopt.c
* Branch Optimizations
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <stdio.h>
#include "keywords.h"
#include "pdefs.h"
#include "pinsn32.h"
#include "popt.h"
#include "polocal.h"
#include "pjopt.h"
/**********************************************************************/
int BranchOptimize (void)
{
int nchanges = 0;
register int i;
TRACE(stderr, "[BranchOptimize]");
/* At least two pcodes are need to perform branch optimizations */
i = 0;
while (i < nops-1)
{
switch (pptr[i]->op)
{
case oNOT :
switch (pptr[i+1]->op)
{
case oJEQUZ :
pptr[i+1]->op = oJNEQZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJEQUZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oNEG :
switch (pptr[i+1]->op)
{
case oJLTZ :
pptr[i+1]->op = oJGTZ;
deletePcode(i);
nchanges++;
break;
case oJGTEZ :
pptr[i+1]->op = oJLTEZ;
deletePcode(i);
nchanges++;
break;
case oJGTZ :
pptr[i+1]->op = oJLTZ;
deletePcode(i);
nchanges++;
break;
case oJLTEZ :
pptr[i+1]->op = oJGTEZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oEQU :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oNEQ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJNEQ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJEQU;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oNEQ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oEQU;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJEQU;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJNEQ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLT :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGTE;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGTE;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLT;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGTE :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLT;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLT;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGTE;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGT :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLTE;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLTE;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGT;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLTE :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGT;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGT;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLTE;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oEQUZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oNEQZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJNEQZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJEQUZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oNEQZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oEQUZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
case oJNEQZ :
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLTZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGTEZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGTEZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLTZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGTEZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLTZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLTZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGTEZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oGTZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oLTEZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJLTEZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJGTZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
case oLTEZ :
switch (pptr[i+1]->op)
{
case oNOT :
pptr[i]->op = oGTZ;
deletePcode(i+1);
nchanges++;
break;
case oJEQUZ :
pptr[i+1]->op = oJGTZ;
deletePcode(i);
nchanges++;
break;
case oJNEQZ :
pptr[i+1]->op = oJLTEZ;
deletePcode(i);
nchanges++;
break;
default :
i++;
break;
} /* end switch */
break;
default :
i++;
break;
} /* end switch */
} /* end while */
return (nchanges);
} /* end BranchOptimize */
/**********************************************************************/
+44 -44
View File
@@ -1,44 +1,44 @@
/***************************************************************************
* pjopt.h
* External Declarations associated with pjopt.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.
*
***************************************************************************/
#ifndef __PJOPT_H
#define __PJOPT_H
extern int BranchOptimize ( void );
#endif __PJOPT_H
/***************************************************************************
* pjopt.h
* External Declarations associated with pjopt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PJOPT_H
#define __PJOPT_H
extern int BranchOptimize ( void );
#endif __PJOPT_H
+1 -1
View File
@@ -3,7 +3,7 @@
* Load/Store Optimizations
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+43 -43
View File
@@ -1,43 +1,43 @@
/***************************************************************************
* plopt.h
* External Declarations associated with plopt.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.
*
***************************************************************************/
#ifndef __PLOPT_H
#define __PLOPT_H
extern int LoadOptimize ( void );
extern int StoreOptimize ( void );
#endif /* __PLOPT_H */
/***************************************************************************
* plopt.h
* External Declarations associated with plopt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __PLOPT_H
#define __PLOPT_H
extern int LoadOptimize ( void );
extern int StoreOptimize ( void );
#endif /* __PLOPT_H */
+271 -271
View File
@@ -1,271 +1,271 @@
/**********************************************************************
* polocal.c
* P-Code Local Optimizer
*
* 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 <stdio.h>
#include "keywords.h"
#include "podefs.h"
#include "pinsn32.h"
#include "pofflib.h"
#include "paslib.h"
#include "pinsn.h"
#include "pcopt.h"
#include "plopt.h"
#include "pjopt.h"
#include "polocal.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
static void initPTable (void);
static void putPCodeFromTable (void);
static void setupPointer (void);
/**********************************************************************
* Global Variables
**********************************************************************/
OPTYPE ptable [WINDOW]; /* Pcode Table */
OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */
int nops = 0; /* No. Valid Pcode Pointers */
int end_out = 0; /* 1 = oEND pcode has been output */
/**********************************************************************
* Private Variables
**********************************************************************/
static poffHandle_t myPoffHandle; /* Handle to POFF object */
static poffProgHandle_t myPoffProgHandle;/* Handle to temporary POFF object */
/**********************************************************************
* Global Functions
**********************************************************************/
/***********************************************************************/
void localOptimization(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle)
{
int nchanges;
TRACE(stderr, "[pass2]");
/* Save the handles for use by other, private functions */
myPoffHandle = poffHandle;
myPoffProgHandle = poffProgHandle;
/* Initialization */
initPTable();
/* Outer loop traverse the file op-code by op-code until the oEND P-Code
* has been output. NOTE: it is assumed throughout that oEND is the
* final P-Code in the program data section.
*/
while (!(end_out))
{
/* The inner loop optimizes the buffered P-Codes until no further
* changes can be made. Then the outer loop will advance the buffer
* by one P-Code
*/
do
{
nchanges = unaryOptimize ();
nchanges += binaryOptimize();
nchanges += BranchOptimize();
nchanges += LoadOptimize();
nchanges += StoreOptimize();
} while (nchanges);
putPCodeFromTable();
}
}
/***********************************************************************/
void deletePcode(int delIndex)
{
TRACE(stderr, "[deletePcode]");
PUTOP(pptr[delIndex], oNOP);
PUTARG(pptr[delIndex], 0);
setupPointer();
}
/**********************************************************************/
void deletePcodePair(int delIndex1, int delIndex2)
{
TRACE(stderr, "[deletePcodePair]");
PUTOP(pptr[delIndex1], oNOP);
PUTARG(pptr[delIndex1], 0);
PUTOP(pptr[delIndex2], oNOP);
PUTARG(pptr[delIndex2], 0);
setupPointer();
}
/**********************************************************************
* Private Functions
**********************************************************************/
/***********************************************************************/
static void putPCodeFromTable(void)
{
register int i;
TRACE(stderr, "[putPCodeFromTable]");
/* Transfer all buffered P-Codes (except NOPs) to the optimized file */
do
{
if ((GETOP(&ptable[0]) != oNOP) && !(end_out))
{
insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]);
end_out = (GETOP(&ptable[0]) == oEND);
}
/* Move all P-Codes down one slot */
for (i = 1; i < WINDOW; i++)
{
ptable[i-1] = ptable[i];
}
/* Then fill the end slot with a new P-Code from the input file */
insn_GetOpCode(myPoffHandle, &ptable[WINDOW-1]);
} while (GETOP(&ptable[0]) == oNOP);
setupPointer();
}
/**********************************************************************/
static void setupPointer(void)
{
register int pindex;
TRACE(stderr, "[setupPointer]");
for (pindex = 0; pindex < WINDOW; pindex++)
pptr[pindex] = (OPTYPE *) NULL;
nops = 0;
for (pindex = 0; pindex < WINDOW; pindex++)
{
switch (GETOP(&ptable[pindex]))
{
/* Terminate list when a break from sequential logic is
* encountered
*/
case oRET :
case oEND :
case oJMP :
case oLABEL :
case oPCAL :
return;
/* Terminate list when a condition break from sequential logic is
* encountered but include the conditional branch in the list
*/
case oJEQUZ :
case oJNEQZ :
case oJLTZ :
case oJGTEZ :
case oJGTZ :
case oJLTEZ :
pptr[nops] = &ptable[pindex];
nops++;
return;
/* Skip over NOPs and comment class pcodes */
case oNOP :
case oLINE :
break;
/* Include all other pcodes in the optimization list and continue */
default :
pptr[nops] = &ptable[pindex];
nops++;
}
}
}
/**********************************************************************/
static void initPTable(void)
{
register int i;
TRACE(stderr, "[intPTable]");
/* Skip over leading pcodes. NOTE: assumes executable begins after
* the first oLABEL pcode
*/
do
{
insn_GetOpCode(myPoffHandle, &ptable[0]);
insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]);
}
while ((GETOP(&ptable[0]) != oLABEL) && (GETOP(&ptable[0]) != oEND));
/* Fill the pcode window and setup pointers to working section */
for (i = 0; i < WINDOW; i++)
{
insn_GetOpCode(myPoffHandle, &ptable[i]);
}
setupPointer();
}
/***********************************************************************/
/**********************************************************************
* polocal.c
* P-Code Local Optimizer
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <stdio.h>
#include "keywords.h"
#include "podefs.h"
#include "pinsn32.h"
#include "pofflib.h"
#include "paslib.h"
#include "pinsn.h"
#include "pcopt.h"
#include "plopt.h"
#include "pjopt.h"
#include "polocal.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
static void initPTable (void);
static void putPCodeFromTable (void);
static void setupPointer (void);
/**********************************************************************
* Global Variables
**********************************************************************/
OPTYPE ptable [WINDOW]; /* Pcode Table */
OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */
int nops = 0; /* No. Valid Pcode Pointers */
int end_out = 0; /* 1 = oEND pcode has been output */
/**********************************************************************
* Private Variables
**********************************************************************/
static poffHandle_t myPoffHandle; /* Handle to POFF object */
static poffProgHandle_t myPoffProgHandle;/* Handle to temporary POFF object */
/**********************************************************************
* Global Functions
**********************************************************************/
/***********************************************************************/
void localOptimization(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle)
{
int nchanges;
TRACE(stderr, "[pass2]");
/* Save the handles for use by other, private functions */
myPoffHandle = poffHandle;
myPoffProgHandle = poffProgHandle;
/* Initialization */
initPTable();
/* Outer loop traverse the file op-code by op-code until the oEND P-Code
* has been output. NOTE: it is assumed throughout that oEND is the
* final P-Code in the program data section.
*/
while (!(end_out))
{
/* The inner loop optimizes the buffered P-Codes until no further
* changes can be made. Then the outer loop will advance the buffer
* by one P-Code
*/
do
{
nchanges = unaryOptimize ();
nchanges += binaryOptimize();
nchanges += BranchOptimize();
nchanges += LoadOptimize();
nchanges += StoreOptimize();
} while (nchanges);
putPCodeFromTable();
}
}
/***********************************************************************/
void deletePcode(int delIndex)
{
TRACE(stderr, "[deletePcode]");
PUTOP(pptr[delIndex], oNOP);
PUTARG(pptr[delIndex], 0);
setupPointer();
}
/**********************************************************************/
void deletePcodePair(int delIndex1, int delIndex2)
{
TRACE(stderr, "[deletePcodePair]");
PUTOP(pptr[delIndex1], oNOP);
PUTARG(pptr[delIndex1], 0);
PUTOP(pptr[delIndex2], oNOP);
PUTARG(pptr[delIndex2], 0);
setupPointer();
}
/**********************************************************************
* Private Functions
**********************************************************************/
/***********************************************************************/
static void putPCodeFromTable(void)
{
register int i;
TRACE(stderr, "[putPCodeFromTable]");
/* Transfer all buffered P-Codes (except NOPs) to the optimized file */
do
{
if ((GETOP(&ptable[0]) != oNOP) && !(end_out))
{
insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]);
end_out = (GETOP(&ptable[0]) == oEND);
}
/* Move all P-Codes down one slot */
for (i = 1; i < WINDOW; i++)
{
ptable[i-1] = ptable[i];
}
/* Then fill the end slot with a new P-Code from the input file */
insn_GetOpCode(myPoffHandle, &ptable[WINDOW-1]);
} while (GETOP(&ptable[0]) == oNOP);
setupPointer();
}
/**********************************************************************/
static void setupPointer(void)
{
register int pindex;
TRACE(stderr, "[setupPointer]");
for (pindex = 0; pindex < WINDOW; pindex++)
pptr[pindex] = (OPTYPE *) NULL;
nops = 0;
for (pindex = 0; pindex < WINDOW; pindex++)
{
switch (GETOP(&ptable[pindex]))
{
/* Terminate list when a break from sequential logic is
* encountered
*/
case oRET :
case oEND :
case oJMP :
case oLABEL :
case oPCAL :
return;
/* Terminate list when a condition break from sequential logic is
* encountered but include the conditional branch in the list
*/
case oJEQUZ :
case oJNEQZ :
case oJLTZ :
case oJGTEZ :
case oJGTZ :
case oJLTEZ :
pptr[nops] = &ptable[pindex];
nops++;
return;
/* Skip over NOPs and comment class pcodes */
case oNOP :
case oLINE :
break;
/* Include all other pcodes in the optimization list and continue */
default :
pptr[nops] = &ptable[pindex];
nops++;
}
}
}
/**********************************************************************/
static void initPTable(void)
{
register int i;
TRACE(stderr, "[intPTable]");
/* Skip over leading pcodes. NOTE: assumes executable begins after
* the first oLABEL pcode
*/
do
{
insn_GetOpCode(myPoffHandle, &ptable[0]);
insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]);
}
while ((GETOP(&ptable[0]) != oLABEL) && (GETOP(&ptable[0]) != oEND));
/* Fill the pcode window and setup pointers to working section */
for (i = 0; i < WINDOW; i++)
{
insn_GetOpCode(myPoffHandle, &ptable[i]);
}
setupPointer();
}
/***********************************************************************/
+73 -73
View File
@@ -1,73 +1,73 @@
/***************************************************************************
* polocal.h
* External Declarations associated with polocal.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.
*
***************************************************************************/
#ifndef __POLOCAL_H
#define __POLOCAL_H
/***************************************************************************
* Included Files
****************************************************************************/
#include "keywords.h"
#include "pdefs.h"
#include "pofflib.h"
/***************************************************************************
* Definitions
****************************************************************************/
#define WINDOW 10 /* size of optimization window */
/***************************************************************************
* Global Function Prototypes
****************************************************************************/
extern void localOptimization(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
extern void deletePcode (int delIndex);
extern void deletePcodePair (int delIndex1, int delIndex2);
/***************************************************************************
* Global Variables
****************************************************************************/
extern OPTYPE ptable [WINDOW]; /* Pcode Table */
extern OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */
extern int nops; /* No. Valid Pcode Pointers */
extern int end_out; /* 1 = oEND pcode has been output */
#endif /* __PLOCAL_H */
/***************************************************************************
* polocal.h
* External Declarations associated with polocal.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __POLOCAL_H
#define __POLOCAL_H
/***************************************************************************
* Included Files
****************************************************************************/
#include "keywords.h"
#include "pdefs.h"
#include "pofflib.h"
/***************************************************************************
* Definitions
****************************************************************************/
#define WINDOW 10 /* size of optimization window */
/***************************************************************************
* Global Function Prototypes
****************************************************************************/
extern void localOptimization(poffHandle_t poffHandle,
poffProgHandle_t poffProgHandle);
extern void deletePcode (int delIndex);
extern void deletePcodePair (int delIndex1, int delIndex2);
/***************************************************************************
* Global Variables
****************************************************************************/
extern OPTYPE ptable [WINDOW]; /* Pcode Table */
extern OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */
extern int nops; /* No. Valid Pcode Pointers */
extern int end_out; /* 1 = oEND pcode has been output */
#endif /* __PLOCAL_H */
+327 -327
View File
@@ -1,327 +1,327 @@
/**********************************************************************
* popt.c
* P-Code Optimizer Main Logic
*
* 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "keywords.h"
#include "podefs.h"
#include "paslib.h"
#include "pofflib.h"
#include "pinsn.h"
#include "popt.h"
#include "psopt.h"
#include "polocal.h"
#include "pfopt.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
static void showUsage (const char *progname, int errcode);
static void readPoffFile (const char *filename);
static void pass1 (void);
static void pass2 (void);
static void pass3 (void);
static void writePoffFile (const char *filename);
/**********************************************************************
* Global Variables
**********************************************************************/
/**********************************************************************
* Private Variables
**********************************************************************/
static poffHandle_t poffHandle; /* Handle to POFF object */
static int no_resolve = 0;
/**********************************************************************
* Global Functions
**********************************************************************/
/***********************************************************************/
int main(int argc, char *argv[], char *envp[])
{
const char *outfilename;
TRACE(stderr, "[main]");
int option;
/* Process command line argruments */
while ((option = getopt(argc, argv, "rh")) > 0)
{
switch (option)
{
case 'r' :
no_resolve++;
break;
case 'h' :
showUsage(argv[0], 0);
default:
fprintf(stderr, "Unrecognized option\n");
showUsage(argv[0], -1);
}
}
/* Check for existence of filename argument */
if (optind != argc - 1)
{
printf("Filename required at end of command line.\n");
showUsage(argv[0], -1);
} /* end if */
/* Read the POFF file into memory */
outfilename = argv[optind];
readPoffFile(outfilename);
/* Performs pass1 optimization */
pass1();
/* Performs pass2 optimization */
insn_ResetOpCodeRead(poffHandle);
pass2();
if (!no_resolve)
{
/* Create final section offsets and relocation entries */
insn_ResetOpCodeRead(poffHandle);
pass3();
}
/* Write the POFF file */
writePoffFile(outfilename);
return 0;
} /* End main */
/**********************************************************************
* Private Functions
**********************************************************************/
/***********************************************************************/
static void showUsage(const char *progname, int errcode)
{
fprintf(stderr, "USAGE:\n");
fprintf(stderr, " %s -h\n", progname);
fprintf(stderr, " %s [-r] <poff-filename>\n", progname);
fprintf(stderr, "WHERE:\n");
fprintf(stderr, " -r: Disables label resolution (default: labels resolved)\n");
fprintf(stderr, " -h: Shows this message\n");
exit(errcode);
}
/***********************************************************************/
static void readPoffFile(const char *filename)
{
char objname [FNAME_SIZE+1];
FILE *objFile;
int errcode;
TRACE(stderr, "[readPoffFile]");
/* Open the pass1 POFF object file -- Use .o1 extension */
(void)extension(filename, "o1", objname, 1);
if (!(objFile = fopen(objname, "rb")))
{
printf("Error Opening %s\n", objname);
exit(1);
} /* end if */
/* Get a handle to a POFF input object */
poffHandle = poffCreateHandle();
if (!poffHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Read the POFF file into memory */
errcode = poffReadFile(poffHandle, objFile);
if (errcode != 0)
{
printf("Could not read POFF file, errcode=0x%02x\n", errcode);
exit(1);
}
/* Close the input file */
fclose(objFile);
} /* end pass1 */
/***********************************************************************/
static void pass1(void)
{
poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */
TRACE(stderr, "[pass1]");
/* Create a handle to a temporary object to store new POFF program
* data.
*/
poffProgHandle = poffCreateProgHandle();
if (!poffProgHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Clean up garbage left from the wasteful string stack logic */
stringStackOptimize(poffHandle, poffProgHandle);
/* Replace the original program data with the new program data */
poffReplaceProgData(poffHandle, poffProgHandle);
/* Release the temporary POFF object */
poffDestroyProgHandle(poffProgHandle);
} /* end pass1 */
/***********************************************************************/
static void pass2(void)
{
poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */
TRACE(stderr, "[pass2]");
/* Create a handle to a temporary object to store new POFF program
* data.
*/
poffProgHandle = poffCreateProgHandle();
if (!poffProgHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Perform Local Optimizatin Initialization */
localOptimization(poffHandle, poffProgHandle);
/* Replace the original program data with the new program data */
poffReplaceProgData(poffHandle, poffProgHandle);
/* Release the temporary POFF object */
poffDestroyProgHandle(poffProgHandle);
} /* end pass2 */
/***********************************************************************/
static void pass3 (void)
{
poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */
TRACE(stderr, "[pass3]");
/* Create a handle to a temporary object to store new POFF program
* data.
*/
poffProgHandle = poffCreateProgHandle();
if (!poffProgHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Finalize program section, create relocation and line number
* sections.
*/
optFinalize(poffHandle, poffProgHandle);
/* Release the temporary POFF object */
poffDestroyProgHandle(poffProgHandle);
}
/***********************************************************************/
static void writePoffFile(const char *filename)
{
char optname [FNAME_SIZE+1];
FILE *optFile;
TRACE(stderr, "[writePoffFile]");
/* Open optimized p-code file -- Use .o extension */
(void)extension(filename, "o", optname, 1);
if (!(optFile = fopen(optname, "wb")))
{
printf("Error Opening %s\n", optname);
exit(1);
} /* end if */
/* Then write the new POFF file */
poffWriteFile(poffHandle, optFile);
/* Destroy the POFF object */
poffDestroyHandle(poffHandle);
/* Close the files used on writePoffFile */
(void)fclose(optFile);
} /* end writePoffFile */
/***********************************************************************/
/**********************************************************************
* popt.c
* P-Code Optimizer Main Logic
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "keywords.h"
#include "podefs.h"
#include "paslib.h"
#include "pofflib.h"
#include "pinsn.h"
#include "popt.h"
#include "psopt.h"
#include "polocal.h"
#include "pfopt.h"
/**********************************************************************
* Private Function Prototypes
**********************************************************************/
static void showUsage (const char *progname, int errcode);
static void readPoffFile (const char *filename);
static void pass1 (void);
static void pass2 (void);
static void pass3 (void);
static void writePoffFile (const char *filename);
/**********************************************************************
* Global Variables
**********************************************************************/
/**********************************************************************
* Private Variables
**********************************************************************/
static poffHandle_t poffHandle; /* Handle to POFF object */
static int no_resolve = 0;
/**********************************************************************
* Global Functions
**********************************************************************/
/***********************************************************************/
int main(int argc, char *argv[], char *envp[])
{
const char *outfilename;
TRACE(stderr, "[main]");
int option;
/* Process command line argruments */
while ((option = getopt(argc, argv, "rh")) > 0)
{
switch (option)
{
case 'r' :
no_resolve++;
break;
case 'h' :
showUsage(argv[0], 0);
default:
fprintf(stderr, "Unrecognized option\n");
showUsage(argv[0], -1);
}
}
/* Check for existence of filename argument */
if (optind != argc - 1)
{
printf("Filename required at end of command line.\n");
showUsage(argv[0], -1);
} /* end if */
/* Read the POFF file into memory */
outfilename = argv[optind];
readPoffFile(outfilename);
/* Performs pass1 optimization */
pass1();
/* Performs pass2 optimization */
insn_ResetOpCodeRead(poffHandle);
pass2();
if (!no_resolve)
{
/* Create final section offsets and relocation entries */
insn_ResetOpCodeRead(poffHandle);
pass3();
}
/* Write the POFF file */
writePoffFile(outfilename);
return 0;
} /* End main */
/**********************************************************************
* Private Functions
**********************************************************************/
/***********************************************************************/
static void showUsage(const char *progname, int errcode)
{
fprintf(stderr, "USAGE:\n");
fprintf(stderr, " %s -h\n", progname);
fprintf(stderr, " %s [-r] <poff-filename>\n", progname);
fprintf(stderr, "WHERE:\n");
fprintf(stderr, " -r: Disables label resolution (default: labels resolved)\n");
fprintf(stderr, " -h: Shows this message\n");
exit(errcode);
}
/***********************************************************************/
static void readPoffFile(const char *filename)
{
char objname [FNAME_SIZE+1];
FILE *objFile;
int errcode;
TRACE(stderr, "[readPoffFile]");
/* Open the pass1 POFF object file -- Use .o1 extension */
(void)extension(filename, "o1", objname, 1);
if (!(objFile = fopen(objname, "rb")))
{
printf("Error Opening %s\n", objname);
exit(1);
} /* end if */
/* Get a handle to a POFF input object */
poffHandle = poffCreateHandle();
if (!poffHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Read the POFF file into memory */
errcode = poffReadFile(poffHandle, objFile);
if (errcode != 0)
{
printf("Could not read POFF file, errcode=0x%02x\n", errcode);
exit(1);
}
/* Close the input file */
fclose(objFile);
} /* end pass1 */
/***********************************************************************/
static void pass1(void)
{
poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */
TRACE(stderr, "[pass1]");
/* Create a handle to a temporary object to store new POFF program
* data.
*/
poffProgHandle = poffCreateProgHandle();
if (!poffProgHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Clean up garbage left from the wasteful string stack logic */
stringStackOptimize(poffHandle, poffProgHandle);
/* Replace the original program data with the new program data */
poffReplaceProgData(poffHandle, poffProgHandle);
/* Release the temporary POFF object */
poffDestroyProgHandle(poffProgHandle);
} /* end pass1 */
/***********************************************************************/
static void pass2(void)
{
poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */
TRACE(stderr, "[pass2]");
/* Create a handle to a temporary object to store new POFF program
* data.
*/
poffProgHandle = poffCreateProgHandle();
if (!poffProgHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Perform Local Optimizatin Initialization */
localOptimization(poffHandle, poffProgHandle);
/* Replace the original program data with the new program data */
poffReplaceProgData(poffHandle, poffProgHandle);
/* Release the temporary POFF object */
poffDestroyProgHandle(poffProgHandle);
} /* end pass2 */
/***********************************************************************/
static void pass3 (void)
{
poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */
TRACE(stderr, "[pass3]");
/* Create a handle to a temporary object to store new POFF program
* data.
*/
poffProgHandle = poffCreateProgHandle();
if (!poffProgHandle)
{
printf("Could not get POFF handle\n");
exit(1);
} /* end if */
/* Finalize program section, create relocation and line number
* sections.
*/
optFinalize(poffHandle, poffProgHandle);
/* Release the temporary POFF object */
poffDestroyProgHandle(poffProgHandle);
}
/***********************************************************************/
static void writePoffFile(const char *filename)
{
char optname [FNAME_SIZE+1];
FILE *optFile;
TRACE(stderr, "[writePoffFile]");
/* Open optimized p-code file -- Use .o extension */
(void)extension(filename, "o", optname, 1);
if (!(optFile = fopen(optname, "wb")))
{
printf("Error Opening %s\n", optname);
exit(1);
} /* end if */
/* Then write the new POFF file */
poffWriteFile(poffHandle, optFile);
/* Destroy the POFF object */
poffDestroyHandle(poffHandle);
/* Close the files used on writePoffFile */
(void)fclose(optFile);
} /* end writePoffFile */
/***********************************************************************/
+52 -52
View File
@@ -1,52 +1,52 @@
/***************************************************************************
* popt.h
* External Declarations associated with popt.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.
*
***************************************************************************/
#ifndef __POPT_H
#define __POPT_H
/***************************************************************************
* Included Files
****************************************************************************/
/***************************************************************************
* Global Variables
****************************************************************************/
/***************************************************************************
* Global Function Prototypes
****************************************************************************/
#endif /* __POPT_H */
/***************************************************************************
* popt.h
* External Declarations associated with popt.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 __POPT_H
#define __POPT_H
/***************************************************************************
* Included Files
****************************************************************************/
/***************************************************************************
* Global Variables
****************************************************************************/
/***************************************************************************
* Global Function Prototypes
****************************************************************************/
#endif /* __POPT_H */
+1 -1
View File
@@ -3,7 +3,7 @@
* String Stack Optimizaitons
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

Some files were not shown because too many files have changed in this diff Show More