9
0
Fork 0

I learned how to spell PSEUDO

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5010 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-08-05 17:44:11 +00:00
parent ffd511a6a7
commit 9fc3bfb88d
35 changed files with 1644 additions and 1645 deletions

View File

@ -30,5 +30,5 @@ device.c
device.c implements a simple device driver. Reads from this device device.c implements a simple device driver. Reads from this device
will access the in-memory copy of hello.pex This device driver is will access the in-memory copy of hello.pex This device driver is
registered as /dev/pashello in the psuedo filesystem. registered as /dev/pashello in the pseudo filesystem.

View File

@ -505,14 +505,14 @@ o mkfatfs <path>
Format a fat file system on the block device specified by path. Format a fat file system on the block device specified by path.
NSH provides this command to access the mkfatfs() NuttX API. NSH provides this command to access the mkfatfs() NuttX API.
This block device must reside in the NuttX psuedo filesystem and This block device must reside in the NuttX pseudo filesystem and
must have been created by some call to register_blockdriver() (see must have been created by some call to register_blockdriver() (see
include/nuttx/fs/fs.h). include/nuttx/fs/fs.h).
o mkfifo <path> o mkfifo <path>
Creates a FIFO character device anywhere in the pseudo file system, Creates a FIFO character device anywhere in the pseudo file system,
creating whatever psuedo directories that may be needed to complete creating whatever pseudo directories that may be needed to complete
the full path. By convention, however, device drivers are place in the full path. By convention, however, device drivers are place in
the standard /dev directory. After it is created, the FIFO device the standard /dev directory. After it is created, the FIFO device
may be used as any other device driver. NSH provides this command may be used as any other device driver. NSH provides this command
@ -584,7 +584,7 @@ o mount [-t <fstype> <block-device> <dir-path>]
If the mount parameters are provied on the command after the 'mount' If the mount parameters are provied on the command after the 'mount'
command, then the 'mount' command will mount a file system in the command, then the 'mount' command will mount a file system in the
NuttX psuedo-file system. 'mount' performs a three way association, NuttX pseudo-file system. 'mount' performs a three way association,
binding: binding:
File system. The '-t <fstype>' option identifies the type of File system. The '-t <fstype>' option identifies the type of
@ -592,19 +592,19 @@ o mount [-t <fstype> <block-device> <dir-path>]
of this writing, vfat is the only supported value for <fstype> of this writing, vfat is the only supported value for <fstype>
Block Device. The <block-device> argument is the full or relative Block Device. The <block-device> argument is the full or relative
path to a block driver inode in the psuedo filesystem. By convention, path to a block driver inode in the pseudo filesystem. By convention,
this is a name under the /dev sub-directory. This <block-device> this is a name under the /dev sub-directory. This <block-device>
must have been previously formatted with the same file system must have been previously formatted with the same file system
type as specified by <fstype> type as specified by <fstype>
Mount Point. The mount point is the location in the psuedo file Mount Point. The mount point is the location in the pseudo file
system where the mounted volume will appear. This mount point system where the mounted volume will appear. This mount point
can only reside in the NuttX psuedo filesystem. By convention, this can only reside in the NuttX pseudo filesystem. By convention, this
mount point is a subdirectory under /mnt. The mount command will mount point is a subdirectory under /mnt. The mount command will
create whatever psuedo directories that may be needed to complete create whatever pseudo directories that may be needed to complete
the full path but the full path must not already exist. the full path but the full path must not already exist.
After the volume has been mounted in the NuttX psuedo file After the volume has been mounted in the NuttX pseudo file
system, it may be access in the same way as other objects in the system, it may be access in the same way as other objects in the
file system. file system.

View File

@ -88,12 +88,12 @@
# define MAX_ARGV_ENTRIES (NSH_MAX_ARGUMENTS+4) # define MAX_ARGV_ENTRIES (NSH_MAX_ARGUMENTS+4)
#endif #endif
/* Help layout */ /* Help command summary layout */
#define MAX_CMDLEN 12 #define MAX_CMDLEN 12
#define CMDS_PER_LINE 5 #define CMDS_PER_LINE 6
#define NUM_CMDS (sizeof(g_cmdmap)/sizeof(struct cmdmap_s)) #define NUM_CMDS ((sizeof(g_cmdmap)/sizeof(struct cmdmap_s)) - 1)
#define NUM_CMD_ROWS ((NUM_CMDS + (CMDS_PER_LINE-1)) / CMDS_PER_LINE) #define NUM_CMD_ROWS ((NUM_CMDS + (CMDS_PER_LINE-1)) / CMDS_PER_LINE)
/**************************************************************************** /****************************************************************************
@ -443,7 +443,7 @@ static inline void help_cmdlist(FAR struct nsh_vtbl_s *vtbl)
for (i = 0; i < NUM_CMD_ROWS; i++) for (i = 0; i < NUM_CMD_ROWS; i++)
{ {
nsh_output(vtbl, " "); nsh_output(vtbl, " ");
for (j = 0, k = i; j < CMDS_PER_LINE && k < NUM_CMDS; j++, k += CMDS_PER_LINE) for (j = 0, k = i; j < CMDS_PER_LINE && k < NUM_CMDS; j++, k += NUM_CMD_ROWS)
{ {
nsh_output(vtbl, "%-12s", g_cmdmap[k].cmd); nsh_output(vtbl, "%-12s", g_cmdmap[k].cmd);
} }
@ -516,6 +516,7 @@ static int help_cmd(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd)
{ {
/* Yes... show it */ /* Yes... show it */
nsh_output(vtbl, "%s usage:", cmd);
help_showcmd(vtbl, cmdmap); help_showcmd(vtbl, cmdmap);
return OK; return OK;
} }
@ -574,14 +575,14 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{ {
FAR const char *cmd = NULL; FAR const char *cmd = NULL;
#ifdef CONFIG_NSH_HELP_TERSE #ifndef CONFIG_NSH_HELP_TERSE
bool verbose = false; bool verbose = false;
int i; int i;
#endif #endif
/* The command may be followed by a verbose option */ /* The command may be followed by a verbose option */
#ifdef CONFIG_NSH_HELP_TERSE #ifndef CONFIG_NSH_HELP_TERSE
i = 1; i = 1;
if (argc > i) if (argc > i)
{ {
@ -618,14 +619,13 @@ static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{ {
/* Yes.. show the single command */ /* Yes.. show the single command */
nsh_output(vtbl, "%s usage:", cmd);
help_cmd(vtbl, cmd); help_cmd(vtbl, cmd);
} }
else else
{ {
/* In verbose mode, show detailed help for all commands */ /* In verbose mode, show detailed help for all commands */
#ifdef CONFIG_NSH_HELP_TERSE #ifndef CONFIG_NSH_HELP_TERSE
if (verbose) if (verbose)
{ {
nsh_output(vtbl, "Where <cmd> is one of:\n"); nsh_output(vtbl, "Where <cmd> is one of:\n");
@ -637,7 +637,6 @@ static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
else else
#endif #endif
{ {
nsh_output(vtbl, "help usage:");
help_cmd(vtbl, "help"); help_cmd(vtbl, "help");
nsh_output(vtbl, "\n"); nsh_output(vtbl, "\n");
help_cmdlist(vtbl); help_cmdlist(vtbl);

View File

@ -1,204 +1,204 @@
/*********************************************************************** /***********************************************************************
* podefs.h * podefs.h
* Logical P-code operation code definitions * Logical P-code operation code definitions
* *
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * distribution.
* 3. Neither the name NuttX nor the names of its contributors may be * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
***********************************************************************/ ***********************************************************************/
#ifndef __PODEFS_H #ifndef __PODEFS_H
#define __PODEFS_H #define __PODEFS_H
/* These definitions represent logical operations as needed by the /* These definitions represent logical operations as needed by the
* the compiler. The specific INSN generation layer must interpret * the compiler. The specific INSN generation layer must interpret
* these requests as is appropriate to the supported INSNS. * these requests as is appropriate to the supported INSNS.
*/ */
enum pcode_e enum pcode_e
{ {
/**------------------------------------------------------------------- /**-------------------------------------------------------------------
* OPCODES WITH NO ARGUMENTS * OPCODES WITH NO ARGUMENTS
**-------------------------------------------------------------------**/ **-------------------------------------------------------------------**/
/* Program control (No stack arguments) */ /* Program control (No stack arguments) */
opNOP = 0, opNOP = 0,
/* Arithmetic & logical & and integer conversions (One stack argument) */ /* Arithmetic & logical & and integer conversions (One stack argument) */
opNEG, opABS, opINC, opDEC, opNOT, opNEG, opABS, opINC, opDEC, opNOT,
/* Arithmetic & logical (Two stack arguments) */ /* Arithmetic & logical (Two stack arguments) */
opADD, opSUB, opMUL, opDIV, opMOD, opSLL, opSRL, opSRA, opOR, opAND, opADD, opSUB, opMUL, opDIV, opMOD, opSLL, opSRL, opSRA, opOR, opAND,
/* Comparisons (One stack argument) */ /* Comparisons (One stack argument) */
opEQUZ, opNEQZ, opLTZ, opGTEZ, opGTZ, opLTEZ, opEQUZ, opNEQZ, opLTZ, opGTEZ, opGTZ, opLTEZ,
/* Comparisons (Two stack arguments) */ /* Comparisons (Two stack arguments) */
opEQU, opNEQ, opLT, opGTE, opGT, opLTE, opEQU, opNEQ, opLT, opGTE, opGT, opLTE,
opBIT, opBIT,
/* Load Immediate */ /* Load Immediate */
opLDI, opLDIB, opLDIM, opLDI, opLDIB, opLDIM,
/* Store Immediate */ /* Store Immediate */
opSTI, opSTIB, opSTIM, opSTI, opSTIB, opSTIM,
/* Data stack */ /* Data stack */
opDUP, opPUSHS, opPOPS, opDUP, opPUSHS, opPOPS,
/* Program control (No stack arguments) /* Program control (No stack arguments)
* Behavior: * Behavior:
* Pop return address * Pop return address
* Pop saved base register (BR) * Pop saved base register (BR)
* Discard saved base address * Discard saved base address
* Set program counter (PC) to return address * Set program counter (PC) to return address
*/ */
opRET, opRET,
/* System Functions (No stack arguments) */ /* System Functions (No stack arguments) */
opEND, opEND,
/**------------------------------------------------------------------- /**-------------------------------------------------------------------
** OPCODES WITH ONE ARGUMENT ** OPCODES WITH ONE ARGUMENT
**-------------------------------------------------------------------**/ **-------------------------------------------------------------------**/
/* Floating point operations: arg = FP op-code */ /* Floating point operations: arg = FP op-code */
opFLOAT, opFLOAT,
/* Program control: arg = unsigned label (One stack argument) */ /* Program control: arg = unsigned label (One stack argument) */
opJEQUZ, opJNEQZ, opJEQUZ, opJNEQZ,
/* Program control: arg = unsigned label (no stack arguments) */ /* Program control: arg = unsigned label (no stack arguments) */
opJMP, opJMP,
/* Program control: arg = unsigned label (One stack argument) */ /* Program control: arg = unsigned label (One stack argument) */
opJEQU, opJNEQ, opJLT, opJGTE, opJGT, opJLTE, opJEQU, opJNEQ, opJLT, opJGTE, opJGT, opJLTE,
/* Load: arg = unsigned base offset */ /* Load: arg = unsigned base offset */
opLD, opLDH, opLDB, opLDM, opLD, opLDH, opLDB, opLDM,
/* Store: arg = unsigned base offset */ /* Store: arg = unsigned base offset */
opST, opSTB, opSTM, opST, opSTB, opSTM,
/* Load Indexed: arg = unsigned base offset */ /* Load Indexed: arg = unsigned base offset */
opLDX, opLDXB, opLDXM, opLDX, opLDXB, opLDXM,
/* Store Indexed: arg16 = unsigned base offset */ /* Store Indexed: arg16 = unsigned base offset */
opSTX, opSTXB, opSTXM, opSTX, opSTXB, opSTXM,
/* Load address relative to stack base: arg = unsigned offset */ /* Load address relative to stack base: arg = unsigned offset */
opLA, opLA,
/* Load absolute stack address: arg = RODATA offset (No stack arguments) */ /* Load absolute stack address: arg = RODATA offset (No stack arguments) */
opLAC, opLAC,
/* Data stack: arg = 16 bit signed data (no stack arguments) */ /* Data stack: arg = 16 bit signed data (no stack arguments) */
opPUSH, opINDS, opPUSH, opINDS,
/* Load address relative to stack base: arg1 = unsigned offset, TOS=index */ /* Load address relative to stack base: arg1 = unsigned offset, TOS=index */
opLAX, opLAX,
/* System functions: arg = 16-bit library call identifier */ /* System functions: arg = 16-bit library call identifier */
opLIB, opLIB,
/* Program control: arg = unsigned label (no stack arguments) */ /* Program control: arg = unsigned label (no stack arguments) */
opLABEL, opLABEL,
/**------------------------------------------------------------------- /**-------------------------------------------------------------------
** OPCODES WITH TWO ARGUMENTS ** OPCODES WITH TWO ARGUMENTS
**-------------------------------------------------------------------**/ **-------------------------------------------------------------------**/
/* Program Control: arg1 = level; arg2 = unsigned label */ /* Program Control: arg1 = level; arg2 = unsigned label */
opPCAL, opPCAL,
/* Load: arg1 = level; arg2 = signed frame offset */ /* Load: arg1 = level; arg2 = signed frame offset */
opLDS, opLDSH, opLDSB, opLDSM, opLDS, opLDSH, opLDSB, opLDSM,
/* Store: arg1 = level; arg2 = signed frame offset */ /* Store: arg1 = level; arg2 = signed frame offset */
opSTS, opSTSB, opSTSM, opSTS, opSTSB, opSTSM,
/* Load Indexed: arg1 = level; arg2 = signed frame offset */ /* Load Indexed: arg1 = level; arg2 = signed frame offset */
opLDSX, opLDSXB, opLDSXM, opLDSX, opLDSXB, opLDSXM,
/* Store Indexed: arg1 = level; arg2 = signed frame offset */ /* Store Indexed: arg1 = level; arg2 = signed frame offset */
opSTSX, opSTSXB, opSTSXM, opSTSX, opSTSXB, opSTSXM,
/* FOR LAS/LASX arg1 = level; arg2 = signed frame offset /* FOR LAS/LASX arg1 = level; arg2 = signed frame offset
* (no stack arguments) * (no stack arguments)
*/ */
opLAS, opLASX, opLAS, opLASX,
/* System calls: /* System calls:
* For SYSIO: arg1 = file number; arg2 = sub-function code * For SYSIO: arg1 = file number; arg2 = sub-function code
*/ */
opSYSIO, opSYSIO,
/* Psuedo-operations: /* Pseudo-operations:
* For LINE: arg1 = file number; arg2 = line number * For LINE: arg1 = file number; arg2 = line number
*/ */
opLINE, opLINE,
NUM_OPCODES NUM_OPCODES
}; };
#endif /* __PODEFS_H */ #endif /* __PODEFS_H */

View File

@ -1,408 +1,408 @@
/**************************************************************************** /****************************************************************************
* pinsn16.h * pinsn16.h
* 16-bit P-code operation code definitions * 16-bit P-code operation code definitions
* *
* Copyright (C) 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * distribution.
* 3. Neither the name NuttX nor the names of its contributors may be * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
#ifndef __PINSN16_H #ifndef __PINSN16_H
#define __PINSN16_H #define __PINSN16_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
****************************************************************************/ ****************************************************************************/
/* Op-code bit definitions */ /* Op-code bit definitions */
#define o16 (0x80) #define o16 (0x80)
#define o8 (0x40) #define o8 (0x40)
/* Opcode Encoding Summary: /* Opcode Encoding Summary:
* *
* NO ARGS arg8 ONLY arg16 ONLY BOTH * NO ARGS arg8 ONLY arg16 ONLY BOTH
* 00xx xxxx 01xx xxxx 10xx xxxx 11xx xxxx * 00xx xxxx 01xx xxxx 10xx xxxx 11xx xxxx
* xx00 0000 NOP --- --- --- * xx00 0000 NOP --- --- ---
* xx00 0001 NEG --- --- --- * xx00 0001 NEG --- --- ---
* xx00 0010 ABS --- --- --- * xx00 0010 ABS --- --- ---
* xx00 0011 INC --- --- --- * xx00 0011 INC --- --- ---
* xx00 0100 DEC --- --- --- * xx00 0100 DEC --- --- ---
* xx00 0101 NOT --- --- --- * xx00 0101 NOT --- --- ---
* xx00 0110 ADD --- --- --- * xx00 0110 ADD --- --- ---
* xx00 0111 SUB --- --- --- * xx00 0111 SUB --- --- ---
* xx00 1000 MUL --- --- PCAL l,ilbl * xx00 1000 MUL --- --- PCAL l,ilbl
* xx00 1001 DIV --- --- --- * xx00 1001 DIV --- --- ---
* xx00 1010 MOD --- --- --- * xx00 1010 MOD --- --- ---
* xx00 1011 SLL --- --- --- * xx00 1011 SLL --- --- ---
* xx00 1100 SRL --- --- --- * xx00 1100 SRL --- --- ---
* xx00 1101 SRA --- --- --- * xx00 1101 SRA --- --- ---
* xx00 1110 OR --- --- --- * xx00 1110 OR --- --- ---
* xx00 1111 AND --- --- --- * xx00 1111 AND --- --- ---
* *
* xx01 0000 EQUZ --- JEQUZ ilbl --- * xx01 0000 EQUZ --- JEQUZ ilbl ---
* xx01 0001 NEQZ --- JNEQZ ilbl --- * xx01 0001 NEQZ --- JNEQZ ilbl ---
* xx01 0010 LTZ --- JLTZ ilbl --- * xx01 0010 LTZ --- JLTZ ilbl ---
* xx01 0011 GTEZ --- JGTEZ ilbl --- * xx01 0011 GTEZ --- JGTEZ ilbl ---
* xx01 0100 GTZ --- JGTZ ilbl --- * xx01 0100 GTZ --- JGTZ ilbl ---
* xx01 0101 LTEZ --- JLTEZ ilbl --- * xx01 0101 LTEZ --- JLTEZ ilbl ---
* xx01 0110 --- --- JMP ilbl --- * xx01 0110 --- --- JMP ilbl ---
* xx01 0111 --- --- --- --- * xx01 0111 --- --- --- ---
* xx01 1000 EQU --- JEQU ilbl --- * xx01 1000 EQU --- JEQU ilbl ---
* xx01 1001 NEQ --- JNEQ ilbl --- * xx01 1001 NEQ --- JNEQ ilbl ---
* xx01 1010 LT --- JLT ilbl --- * xx01 1010 LT --- JLT ilbl ---
* xx01 1011 GTE --- JGTE ilbl --- * xx01 1011 GTE --- JGTE ilbl ---
* xx01 1100 GT --- JGT ilbl --- * xx01 1100 GT --- JGT ilbl ---
* xx01 1101 LTE --- JLTE ilbl --- * xx01 1101 LTE --- JLTE ilbl ---
* xx01 1110 --- --- --- --- * xx01 1110 --- --- --- ---
* xx01 1111 BIT --- --- --- * xx01 1111 BIT --- --- ---
* *
* xx10 0000 LDI --- LD uoffs LDS lvl,offs * xx10 0000 LDI --- LD uoffs LDS lvl,offs
* xx10 0001 LDIH --- LDH uoffs LDSH lvl,offs * xx10 0001 LDIH --- LDH uoffs LDSH lvl,offs
* xx10 0010 LDIB --- LDB uoffs LDSB lvl,offs * xx10 0010 LDIB --- LDB uoffs LDSB lvl,offs
* xx10 0011 LDIM --- LDM uoffs LDSM lvl,offs * xx10 0011 LDIM --- LDM uoffs LDSM lvl,offs
* xx10 0100 STI --- ST uoffs STS lvl,offs * xx10 0100 STI --- ST uoffs STS lvl,offs
* xx10 0101 STIH --- STH uoffs STSH lvl,offs * xx10 0101 STIH --- STH uoffs STSH lvl,offs
* xx10 0110 STIB --- STB uoffs STSB lvl,offs * xx10 0110 STIB --- STB uoffs STSB lvl,offs
* xx10 0111 STIM --- STM uoffs STSM lvl,offs * xx10 0111 STIM --- STM uoffs STSM lvl,offs
* xx10 1000 DUP --- LDX uoffs LDSX lvl,offs * xx10 1000 DUP --- LDX uoffs LDSX lvl,offs
* xx10 1001 DUPH --- LDXH uoffs LDSXH lvl,offs * xx10 1001 DUPH --- LDXH uoffs LDSXH lvl,offs
* xx10 1010 PUSHS --- LDXB uoffs LDSXB lvl,offs * xx10 1010 PUSHS --- LDXB uoffs LDSXB lvl,offs
* xx10 1011 POPS --- LDXM uoffs LDSXM lvl,offs * xx10 1011 POPS --- LDXM uoffs LDSXM lvl,offs
* xx10 1100 --- --- STX uoffs STSX lvl,offs * xx10 1100 --- --- STX uoffs STSX lvl,offs
* xx10 1101 --- --- STXH uoffs STSXH lvl,offs * xx10 1101 --- --- STXH uoffs STSXH lvl,offs
* xx10 1110 --- --- STXB uoffs STSXB lvl,offs * xx10 1110 --- --- STXB uoffs STSXB lvl,offs
* xx10 1111 RET --- STXM uoffs STSXM lvl,offs * xx10 1111 RET --- STXM uoffs STSXM lvl,offs
* *
* xx11 0000 --- FLOAT fop LA uoffs LAS lvl,offs * xx11 0000 --- FLOAT fop LA uoffs LAS lvl,offs
* xx11 0001 --- --- LAC dlbl --- * xx11 0001 --- --- LAC dlbl ---
* xx11 0010 --- --- --- --- * xx11 0010 --- --- --- ---
* xx11 0011 --- --- --- --- * xx11 0011 --- --- --- ---
* xx11 0100 --- PUSHB n PUSH nn --- * xx11 0100 --- PUSHB n PUSH nn ---
* xx11 0101 --- --- INDS nn --- * xx11 0101 --- --- INDS nn ---
* xx11 0110 --- --- --- --- * xx11 0110 --- --- --- ---
* xx11 0111 --- --- --- --- * xx11 0111 --- --- --- ---
* xx11 1000 --- --- LAX uoffs LASX lvl,offs * xx11 1000 --- --- LAX uoffs LASX lvl,offs
* xx11 1001 --- --- LIB lop SYSIO fn,sop * xx11 1001 --- --- LIB lop SYSIO fn,sop
* xx11 1010 --- --- --- --- * xx11 1010 --- --- --- ---
* xx11 1011 --- --- --- --- * xx11 1011 --- --- --- ---
* xx11 1100 --- --- --- --- * xx11 1100 --- --- --- ---
* xx11 1101 --- --- --- --- * xx11 1101 --- --- --- ---
* xx11 1110 --- --- --- --- * xx11 1110 --- --- --- ---
* xx11 1111 END --- *LABEL ilbl *LINE fn,lineno * xx11 1111 END --- *LABEL ilbl *LINE fn,lineno
* *
* KEY: * KEY:
* n = 8-bit value (unsigned) * n = 8-bit value (unsigned)
* lvl = 8-bit static nesting level offset (unsigned) * lvl = 8-bit static nesting level offset (unsigned)
* vt = 8-bit type code (unsigned) * vt = 8-bit type code (unsigned)
* nn = 16-bit value (signed) * nn = 16-bit value (signed)
* fop = 8-bit floating point operation * fop = 8-bit floating point operation
* sop = 16-bit sysio operation * sop = 16-bit sysio operation
* lop = 16-bit library call identifier * lop = 16-bit library call identifier
* fn = 8-bit file number * fn = 8-bit file number
* ilbl = instruction space label * ilbl = instruction space label
* dlbl = stack data label * dlbl = stack data label
* offs = 16-bit frame offset (signed) * offs = 16-bit frame offset (signed)
* uoffs = 16-bit base offset (unsigned) * uoffs = 16-bit base offset (unsigned)
* c = string follows psuedo-operation * c = string follows pseudo-operation
* * = Indicates pseudo-operations (these are removed * * = Indicates pseudo-operations (these are removed
* after final fixup of the object file). * after final fixup of the object file).
*/ */
/** OPCODES WITH NO ARGUMENTS ***********************************************/ /** OPCODES WITH NO ARGUMENTS ***********************************************/
/* Program control (No stack arguments) */ /* Program control (No stack arguments) */
#define oNOP (0x00) #define oNOP (0x00)
/* Arithmetic & logical & and integer conversions (One 16-bit stack argument) */ /* Arithmetic & logical & and integer conversions (One 16-bit stack argument) */
#define oNEG (0x01) #define oNEG (0x01)
#define oABS (0x02) #define oABS (0x02)
#define oINC (0x03) #define oINC (0x03)
#define oDEC (0x04) #define oDEC (0x04)
#define oNOT (0x05) #define oNOT (0x05)
/* Arithmetic & logical (Two 16-bit stack arguments) */ /* Arithmetic & logical (Two 16-bit stack arguments) */
#define oADD (0x06) #define oADD (0x06)
#define oSUB (0x07) #define oSUB (0x07)
#define oMUL (0x08) #define oMUL (0x08)
#define oDIV (0x09) #define oDIV (0x09)
#define oMOD (0x0a) #define oMOD (0x0a)
#define oSLL (0x0b) #define oSLL (0x0b)
#define oSRL (0x0c) #define oSRL (0x0c)
#define oSRA (0x0d) #define oSRA (0x0d)
#define oOR (0x0e) #define oOR (0x0e)
#define oAND (0x0f) #define oAND (0x0f)
/* Comparisons (One 16-bit stack argument) */ /* Comparisons (One 16-bit stack argument) */
#define oEQUZ (0x10) #define oEQUZ (0x10)
#define oNEQZ (0x11) #define oNEQZ (0x11)
#define oLTZ (0x12) #define oLTZ (0x12)
#define oGTEZ (0x13) #define oGTEZ (0x13)
#define oGTZ (0x14) #define oGTZ (0x14)
#define oLTEZ (0x15) #define oLTEZ (0x15)
/* 0x16-0x17 -- unassigned */ /* 0x16-0x17 -- unassigned */
/* Comparisons (Two 16-bit stack arguments) */ /* Comparisons (Two 16-bit stack arguments) */
#define oEQU (0x18) #define oEQU (0x18)
#define oNEQ (0x19) #define oNEQ (0x19)
#define oLT (0x1a) #define oLT (0x1a)
#define oGTE (0x1b) #define oGTE (0x1b)
#define oGT (0x1c) #define oGT (0x1c)
#define oLTE (0x1d) #define oLTE (0x1d)
/* 0x1e -- unassigned */ /* 0x1e -- unassigned */
#define oBIT (0x1f) #define oBIT (0x1f)
/* Load Immediate */ /* Load Immediate */
#define oLDI (0x20) /* (One 16-bit stack argument) */ #define oLDI (0x20) /* (One 16-bit stack argument) */
#define oLDIH (0x21) /* (One 16-bit stack argument) */ #define oLDIH (0x21) /* (One 16-bit stack argument) */
#define oLDIB (0x22) /* (One 16-bit stack argument) */ #define oLDIB (0x22) /* (One 16-bit stack argument) */
#define oLDIM (0x23) /* (Two 16-bit stack arguments) */ #define oLDIM (0x23) /* (Two 16-bit stack arguments) */
/* Store Immediate */ /* Store Immediate */
#define oSTI (0x24) /* (One 32-bit and one 16-bit stack arguments) */ #define oSTI (0x24) /* (One 32-bit and one 16-bit stack arguments) */
#define oSTIH (0x25) /* (Two 16-bit stack arguments) */ #define oSTIH (0x25) /* (Two 16-bit stack arguments) */
#define oSTIB (0x26) /* (Two 16-bit stack arguments) */ #define oSTIB (0x26) /* (Two 16-bit stack arguments) */
#define oSTIM (0x27) /* (Two + n 16-bit stack arguments) */ #define oSTIM (0x27) /* (Two + n 16-bit stack arguments) */
/* Data stack */ /* Data stack */
#define oDUP (0x28) /* (One 32-bit stack argument */ #define oDUP (0x28) /* (One 32-bit stack argument */
#define oDUPH (0x29) /* (One 16-bit stack argument) */ #define oDUPH (0x29) /* (One 16-bit stack argument) */
/* 0x2a - 0x2b -- unassigned */ /* 0x2a - 0x2b -- unassigned */
#define oPUSHS (0x2a) /* No arguments */ #define oPUSHS (0x2a) /* No arguments */
#define oPOPS (0x2b) /* (One 16-bit stack argument) */ #define oPOPS (0x2b) /* (One 16-bit stack argument) */
/* 0x2c - 0x2e -- unassigned */ /* 0x2c - 0x2e -- unassigned */
/* Program control (No stack arguments) /* Program control (No stack arguments)
* Behavior: * Behavior:
* Pop return address * Pop return address
* Pop saved base register (BR) * Pop saved base register (BR)
* Discard saved base address * Discard saved base address
* Set program counter (PC) to return address * Set program counter (PC) to return address
*/ */
#define oRET (0x2f) #define oRET (0x2f)
/* 0x30 - 0x3e -- unassigned */ /* 0x30 - 0x3e -- unassigned */
/* System Functions (No stack arguments) */ /* System Functions (No stack arguments) */
#define oEND (0x3f) #define oEND (0x3f)
/** OPCODES WITH SINGLE BYTE ARGUMENT (arg8) ********************************/ /** OPCODES WITH SINGLE BYTE ARGUMENT (arg8) ********************************/
/* (o8|0x00)-(o8|0x2f) -- unassigned */ /* (o8|0x00)-(o8|0x2f) -- unassigned */
/* Floating point operations: arg8 = FP op-code */ /* Floating point operations: arg8 = FP op-code */
#define oFLOAT (o8|0x30) #define oFLOAT (o8|0x30)
/* (o8|0x31)-(o8|0x33) -- unassigned */ /* (o8|0x31)-(o8|0x33) -- unassigned */
/* Data stack: arg8 = 8 bit unsigned data (no stack arguments) */ /* Data stack: arg8 = 8 bit unsigned data (no stack arguments) */
#define oPUSHB (o8|0x34) #define oPUSHB (o8|0x34)
/* (o8|0x35)-(o8|0x3f) -- unassigned */ /* (o8|0x35)-(o8|0x3f) -- unassigned */
/** OPCODES WITH SINGLE 16-BIT ARGUMENT (arg16) *****************************/ /** OPCODES WITH SINGLE 16-BIT ARGUMENT (arg16) *****************************/
/* (o16|0x00)-(o16|0x0f) -- unassigned */ /* (o16|0x00)-(o16|0x0f) -- unassigned */
/* Program control: arg16 = unsigned label (One 16-bit stack argument) */ /* Program control: arg16 = unsigned label (One 16-bit stack argument) */
#define oJEQUZ (o16|0x10) #define oJEQUZ (o16|0x10)
#define oJNEQZ (o16|0x11) #define oJNEQZ (o16|0x11)
#define oJLTZ (o16|0x12) #define oJLTZ (o16|0x12)
#define oJGTEZ (o16|0x13) #define oJGTEZ (o16|0x13)
#define oJGTZ (o16|0x14) #define oJGTZ (o16|0x14)
#define oJLTEZ (o16|0x15) #define oJLTEZ (o16|0x15)
/* Program control: arg16 = unsigned label (no stack arguments) */ /* Program control: arg16 = unsigned label (no stack arguments) */
#define oJMP (o16|0x16) #define oJMP (o16|0x16)
/* (o16|0x17) -- unassigned */ /* (o16|0x17) -- unassigned */
/* Program control: arg16 = unsigned label (One 16-bit stack argument) */ /* Program control: arg16 = unsigned label (One 16-bit stack argument) */
#define oJEQU (o16|0x18) #define oJEQU (o16|0x18)
#define oJNEQ (o16|0x19) #define oJNEQ (o16|0x19)
#define oJLT (o16|0x1a) #define oJLT (o16|0x1a)
#define oJGTE (o16|0x1b) #define oJGTE (o16|0x1b)
#define oJGT (o16|0x1c) #define oJGT (o16|0x1c)
#define oJLTE (o16|0x1d) #define oJLTE (o16|0x1d)
/* (o16|0x1e)-(o16|0x1f) -- unassigned */ /* (o16|0x1e)-(o16|0x1f) -- unassigned */
/* Load: arg16 = unsigned base offset */ /* Load: arg16 = unsigned base offset */
#define oLD (o16|0x20) /* (no stack arguments) */ #define oLD (o16|0x20) /* (no stack arguments) */
#define oLDH (o16|0x21) /* (no stack arguments) */ #define oLDH (o16|0x21) /* (no stack arguments) */
#define oLDB (o16|0x22) /* (no stack arguments) */ #define oLDB (o16|0x22) /* (no stack arguments) */
#define oLDM (o16|0x23) /* (One 16-bit stack argument) */ #define oLDM (o16|0x23) /* (One 16-bit stack argument) */
/* Store: arg16 = unsigned base offset */ /* Store: arg16 = unsigned base offset */
#define oST (o16|0x24) /* (One 32-bit stack argument) */ #define oST (o16|0x24) /* (One 32-bit stack argument) */
#define oSTH (o16|0x25) /* (One 16-bit stack argument) */ #define oSTH (o16|0x25) /* (One 16-bit stack argument) */
#define oSTB (o16|0x26) /* (One 16-bit stack argument) */ #define oSTB (o16|0x26) /* (One 16-bit stack argument) */
#define oSTM (o16|0x27) /* (One+n 16-bit stack arguments) */ #define oSTM (o16|0x27) /* (One+n 16-bit stack arguments) */
/* Load Indexed: arg16 = unsigned base offset */ /* Load Indexed: arg16 = unsigned base offset */
#define oLDX (o16|0x28) /* (One 16-bit stack argument) */ #define oLDX (o16|0x28) /* (One 16-bit stack argument) */
#define oLDXH (o16|0x29) /* (One 16-bit stack argument) */ #define oLDXH (o16|0x29) /* (One 16-bit stack argument) */
#define oLDXB (o16|0x2a) /* (One 16-bit stack argument) */ #define oLDXB (o16|0x2a) /* (One 16-bit stack argument) */
#define oLDXM (o16|0x2b) /* (Two 16-bit stack arguments) */ #define oLDXM (o16|0x2b) /* (Two 16-bit stack arguments) */
/* Store Indexed: arg16 = unsigned base offset */ /* Store Indexed: arg16 = unsigned base offset */
#define oSTX (o16|0x2c) /* (One 32-bit + one 16-bit stack arguments) */ #define oSTX (o16|0x2c) /* (One 32-bit + one 16-bit stack arguments) */
#define oSTXH (o16|0x2d) /* (Two 16-bit stack arguments) */ #define oSTXH (o16|0x2d) /* (Two 16-bit stack arguments) */
#define oSTXB (o16|0x2e) /* (Two 16-bit stack arguments) */ #define oSTXB (o16|0x2e) /* (Two 16-bit stack arguments) */
#define oSTXM (o16|0x2f) /* (Two+n 16-bit stack arguments) */ #define oSTXM (o16|0x2f) /* (Two+n 16-bit stack arguments) */
/* Load address relative to stack base: arg16 = unsigned offset */ /* Load address relative to stack base: arg16 = unsigned offset */
#define oLA (o16|0x30) #define oLA (o16|0x30)
/* Load absolute stack address: arg16 = RODATA offset (No stack arguments) */ /* Load absolute stack address: arg16 = RODATA offset (No stack arguments) */
#define oLAC (o16|0x31) #define oLAC (o16|0x31)
/* (o16|0x32)-(o16|0x33) -- unassigned */ /* (o16|0x32)-(o16|0x33) -- unassigned */
/* Data stack: arg16 = 16 bit signed data (no stack arguments) */ /* Data stack: arg16 = 16 bit signed data (no stack arguments) */
#define oPUSH (o16|0x34) #define oPUSH (o16|0x34)
#define oINDS (o16|0x35) #define oINDS (o16|0x35)
/* (o16|0x34)-(o16|0x37) -- unassigned */ /* (o16|0x34)-(o16|0x37) -- unassigned */
/* Load address relative to stack base: arg16 = unsigned offset, TOS=index */ /* Load address relative to stack base: arg16 = unsigned offset, TOS=index */
#define oLAX (o16|0x38) #define oLAX (o16|0x38)
/* System functions: arg16 = 16-bit library call identifier */ /* System functions: arg16 = 16-bit library call identifier */
#define oLIB (o16|0x39) #define oLIB (o16|0x39)
/* (o16|0x3a)-(o16|0x3e) -- unassigned */ /* (o16|0x3a)-(o16|0x3e) -- unassigned */
/* Program control: arg16 = unsigned label (no stack arguments) */ /* Program control: arg16 = unsigned label (no stack arguments) */
#define oLABEL (o16|0x3f) #define oLABEL (o16|0x3f)
/** OPCODES WITH 24-BITS OF ARGUMENET (arg8 + arg16) ************************/ /** OPCODES WITH 24-BITS OF ARGUMENET (arg8 + arg16) ************************/
/* (o16|o8|0x00)-(o8|o16|0x07) -- unassigned */ /* (o16|o8|0x00)-(o8|o16|0x07) -- unassigned */
/* Program Control: arg8 = level; arg16 = unsigned label /* Program Control: arg8 = level; arg16 = unsigned label
* (No stack arguments) * (No stack arguments)
* Behavior: * Behavior:
* Push base address of level * Push base address of level
* Push base register (BR) value * Push base register (BR) value
* Set new base register value (BR) as top of stack * Set new base register value (BR) as top of stack
* Push return address * Push return address
* Set program counter (PC) for address associated with label * Set program counter (PC) for address associated with label
*/ */
#define oPCAL (o16|o8|0x08) #define oPCAL (o16|o8|0x08)
/* (o16|o8|0x09)-(o8|o16|0x1f) -- unassigned */ /* (o16|o8|0x09)-(o8|o16|0x1f) -- unassigned */
/* Load: arg8 = level; arg16 = signed frame offset */ /* Load: arg8 = level; arg16 = signed frame offset */
#define oLDS (o16|o8|0x20) /* (no stack arguments) */ #define oLDS (o16|o8|0x20) /* (no stack arguments) */
#define oLDSH (o16|o8|0x21) /* (no stack arguments) */ #define oLDSH (o16|o8|0x21) /* (no stack arguments) */
#define oLDSB (o16|o8|0x22) /* (no stack arguments) */ #define oLDSB (o16|o8|0x22) /* (no stack arguments) */
#define oLDSM (o16|o8|0x23) /* (One 16-bit stack argument) */ #define oLDSM (o16|o8|0x23) /* (One 16-bit stack argument) */
/* Store: arg8 = level; arg16 = signed frame offset */ /* Store: arg8 = level; arg16 = signed frame offset */
#define oSTS (o16|o8|0x24) /* (One 32-bit stack argument) */ #define oSTS (o16|o8|0x24) /* (One 32-bit stack argument) */
#define oSTSH (o16|o8|0x25) /* (One 16-bit stack argument) */ #define oSTSH (o16|o8|0x25) /* (One 16-bit stack argument) */
#define oSTSB (o16|o8|0x26) /* (One 16-bit stack argument) */ #define oSTSB (o16|o8|0x26) /* (One 16-bit stack argument) */
#define oSTSM (o16|o8|0x27) /* (One+n 16-bit stack arguments) */ #define oSTSM (o16|o8|0x27) /* (One+n 16-bit stack arguments) */
/* Load Indexed: arg8 = level; arg16 = signed frame offset */ /* Load Indexed: arg8 = level; arg16 = signed frame offset */
#define oLDSX (o16|o8|0x28) /* (One 16-bit stack argument) */ #define oLDSX (o16|o8|0x28) /* (One 16-bit stack argument) */
#define oLDSXH (o16|o8|0x29) /* (One 16-bit stack argument) */ #define oLDSXH (o16|o8|0x29) /* (One 16-bit stack argument) */
#define oLDSXB (o16|o8|0x2a) /* (One 16-bit stack argument) */ #define oLDSXB (o16|o8|0x2a) /* (One 16-bit stack argument) */
#define oLDSXM (o16|o8|0x2b) /* (Two 16-bit stack arguments) */ #define oLDSXM (o16|o8|0x2b) /* (Two 16-bit stack arguments) */
/* Store Indexed: arg8 = level; arg16 = signed frame offset */ /* Store Indexed: arg8 = level; arg16 = signed frame offset */
#define oSTSX (o16|o8|0x2c) /* (One 32-bit + one 16-bit stack arguments) */ #define oSTSX (o16|o8|0x2c) /* (One 32-bit + one 16-bit stack arguments) */
#define oSTSXH (o16|o8|0x2d) /* (Two 16-bit stack arguments) */ #define oSTSXH (o16|o8|0x2d) /* (Two 16-bit stack arguments) */
#define oSTSXB (o16|o8|0x2e) /* (Two 16-bit stack arguments) */ #define oSTSXB (o16|o8|0x2e) /* (Two 16-bit stack arguments) */
#define oSTSXM (o16|o8|0x2f) /* (Two+n 16-bit stack arguments) */ #define oSTSXM (o16|o8|0x2f) /* (Two+n 16-bit stack arguments) */
/* FOR LAS/LASX arg8 = level; arg16 = signed frame offset /* FOR LAS/LASX arg8 = level; arg16 = signed frame offset
* (no stack arguments) * (no stack arguments)
*/ */
#define oLAS (o16|o8|0x30) #define oLAS (o16|o8|0x30)
#define oLASX (o16|o8|0x38) #define oLASX (o16|o8|0x38)
/* System calls: /* System calls:
* For SYSIO: arg8 = file number; arg16 = sub-function code * For SYSIO: arg8 = file number; arg16 = sub-function code
*/ */
#define oSYSIO (o16|o8|0x39) #define oSYSIO (o16|o8|0x39)
/* (o16|o8|0x3a)-(o8|o16|0x3e) -- unassigned */ /* (o16|o8|0x3a)-(o8|o16|0x3e) -- unassigned */
/* Psuedo-operations: /* Pseudo-operations:
* For LINE: arg8 = file number; arg16 = line number * For LINE: arg8 = file number; arg16 = line number
*/ */
#define oLINE (o16|o8|0x3f) #define oLINE (o16|o8|0x3f)
#endif /* __PINSN16_H */ #endif /* __PINSN16_H */

View File

@ -431,7 +431,7 @@ static const struct
/* 0xfd */ { invOp, NOARG16 }, /* 0xfd */ { invOp, NOARG16 },
/* 0xfe */ { invOp, NOARG16 }, /* 0xfe */ { invOp, NOARG16 },
/* Psuedo-operations: /* Pseudo-operations:
* For LINE: arg8 = file number; arg16 = line number * For LINE: arg8 = file number; arg16 = line number
*/ */

View File

@ -2185,7 +2185,7 @@ static int pexec32(FAR struct pexec_s *st, uint8_t opcode, uint8_t imm8, uint16_
ret = pexec_sysio(st, imm8, imm16); ret = pexec_sysio(st, imm8, imm16);
break; break;
/* Psuedo-operations: (No stack arguments) /* Pseudo-operations: (No stack arguments)
* For LINE: imm8 = file number; imm16 = line number * For LINE: imm8 = file number; imm16 = line number
*/ */

View File

@ -1,119 +1,119 @@
32-bit op-code bit definitions 32-bit op-code bit definitions
Machine model: Machine model:
SPB 32-bit Pascal stack base address SPB 32-bit Pascal stack base address
SP 32-bit Pascal stack pointer SP 32-bit Pascal stack pointer
LSP 32-bit Level stack pointer LSP 32-bit Level stack pointer
CSB 32-bit Character stack base address CSB 32-bit Character stack base address
CSP 32-bit Character stack pointer CSP 32-bit Character stack pointer
DS 32-bit Data size register (for multiple reg transfers) DS 32-bit Data size register (for multiple reg transfers)
PC 32-bit Program Counter PC 32-bit Program Counter
CC Condition code register CC Condition code register
--- Volatile general purpose registers --- Volatile general purpose registers
--- Static general purpose registers --- Static general purpose registers
Condition codes: Z(ero), N(egative) Condition codes: Z(ero), N(egative)
+=====+=====+ +=====+=====+
| Z | N | | Z | N |
+=====+=====+=====+ +=====+=====+=====+
| EQ | 1 | - | | EQ | 1 | - |
| NEQ | 0 | - | | NEQ | 0 | - |
| LT | - | 1 | | LT | - | 1 |
| GTE | - | 0 | | GTE | - | 0 |
| GT | 0 | 0 | | GT | 0 | 0 |
| LTE | 1 | 1 | | LTE | 1 | 1 |
+=====+=====+=====+ +=====+=====+=====+
Opcode Encoding Summary: Opcode Encoding Summary:
0rxx xxxx 1rxxx xxxx 0rxx xxxx 1rxxx xxxx
xr00 0000 NOP LD uoffs4 xr00 0000 NOP LD uoffs4
xr00 0001 NEG LDH uoffs3 xr00 0001 NEG LDH uoffs3
xr00 0010 ABS LDB uoffs xr00 0010 ABS LDB uoffs
xr00 0011 INC LDM uoffs4 xr00 0011 INC LDM uoffs4
xr00 0100 DEC ST uoffs4 xr00 0100 DEC ST uoffs4
xr00 0101 NOT STH uoffs2 xr00 0101 NOT STH uoffs2
xr00 0110 ADD STB uoffs xr00 0110 ADD STB uoffs
xr00 0111 SUB STM uoffs4 xr00 0111 SUB STM uoffs4
xr00 1000 MUL LDX uoffs4 xr00 1000 MUL LDX uoffs4
xr00 1001 DIV LDXH uoffs2 xr00 1001 DIV LDXH uoffs2
xr00 1010 MOD LDXB uoffs xr00 1010 MOD LDXB uoffs
xr00 1011 SLL LDXM uoffs4 xr00 1011 SLL LDXM uoffs4
xr00 1100 SRL STX uoffs4 xr00 1100 SRL STX uoffs4
xr00 1101 SRA STXH uoffs2 xr00 1101 SRA STXH uoffs2
xr00 1110 OR STXB uoffs xr00 1110 OR STXB uoffs
xr00 1111 AND STXM uoffs xr00 1111 AND STXM uoffs
xr01 0000 EQUZ JEQUZ ilbl xr01 0000 EQUZ JEQUZ ilbl
xr01 0001 NEQZ JNEQZ ilbl xr01 0001 NEQZ JNEQZ ilbl
xr01 0010 LTZ JLTZ ilbl xr01 0010 LTZ JLTZ ilbl
xr01 0011 GTEZ JGTEZ ilbl xr01 0011 GTEZ JGTEZ ilbl
xr01 0100 GTZ JGTZ ilbl xr01 0100 GTZ JGTZ ilbl
xr01 0101 LTEZ JLTEZ ilbl xr01 0101 LTEZ JLTEZ ilbl
xr01 0110 --- JMP ilbl xr01 0110 --- JMP ilbl
xr01 0111 --- PUSH nn xr01 0111 --- PUSH nn
xr01 1000 EQU JEQU ilbl xr01 1000 EQU JEQU ilbl
xr01 1001 NEQ JNEQ ilbl xr01 1001 NEQ JNEQ ilbl
xr01 1010 LT JLT ilbl xr01 1010 LT JLT ilbl
xr01 1011 GTE JGTE ilbl xr01 1011 GTE JGTE ilbl
xr01 1100 GT JGT ilbl xr01 1100 GT JGT ilbl
xr01 1101 LTE JLTE ilbl xr01 1101 LTE JLTE ilbl
xr01 1110 --- --- xr01 1110 --- ---
xr01 1111 BIT INDS nn xr01 1111 BIT INDS nn
xr10 0000 LDI LDS offs4 xr10 0000 LDI LDS offs4
xr10 0001 LDIH LDSH offs3 xr10 0001 LDIH LDSH offs3
xr10 0010 LDIB LDSB offs xr10 0010 LDIB LDSB offs
xr10 0011 LDIM LDSM offs4 xr10 0011 LDIM LDSM offs4
xr10 0100 STI STS offs4 xr10 0100 STI STS offs4
xr10 0101 STIH STSH offs2 xr10 0101 STIH STSH offs2
xr10 0110 STIB STSB offs xr10 0110 STIB STSB offs
xr10 0111 STIM STSM offs4 xr10 0111 STIM STSM offs4
xr10 1000 DUP LDSX offs4 xr10 1000 DUP LDSX offs4
xr10 1001 --- LDSXH offs2 xr10 1001 --- LDSXH offs2
xr10 1010 PUSHS LDSXB offs xr10 1010 PUSHS LDSXB offs
xr10 1011 POPS LDSXM offs4 xr10 1011 POPS LDSXM offs4
xr10 1100 --- STSX offs4 xr10 1100 --- STSX offs4
xr10 1101 --- STSXH offs2 xr10 1101 --- STSXH offs2
xr10 1110 --- STSXB offs xr10 1110 --- STSXB offs
xr10 1111 RET STSXM offs xr10 1111 RET STSXM offs
xr11 0000 --- LA uoffs xr11 0000 --- LA uoffs
xr11 0001 --- LAS offs xr11 0001 --- LAS offs
xr11 0010 --- LAC dlbl xr11 0010 --- LAC dlbl
xr11 0011 --- --- xr11 0011 --- ---
xr11 0100 --- LAX uoffs xr11 0100 --- LAX uoffs
xr11 0101 --- LASX offs xr11 0101 --- LASX offs
xr11 0110 --- SLSP level xr11 0110 --- SLSP level
xr11 0111 --- SDC uu xr11 0111 --- SDC uu
xr11 1000 --- --- xr11 1000 --- ---
xr11 1001 --- PCAL ilbl xr11 1001 --- PCAL ilbl
xr11 1010 --- SYSIO fn,sop xr11 1010 --- SYSIO fn,sop
xr11 1011 --- LIB lop xr11 1011 --- LIB lop
xr11 1100 --- FLOAT fop xr11 1100 --- FLOAT fop
xr11 1101 --- *LABEL ilbl xr11 1101 --- *LABEL ilbl
xr11 1110 --- *INCLUDE fn xr11 1110 --- *INCLUDE fn
xr11 1111 END *LINE lineno xr11 1111 END *LINE lineno
KEY: KEY:
r = Reserved bit (must be zero) r = Reserved bit (must be zero)
fn = 8-bit file number fn = 8-bit file number
lvl = 8-bit static nexting level lvl = 8-bit static nexting level
sop = 17-bit sysio operation sop = 17-bit sysio operation
lineno = 17-bit line number lineno = 17-bit line number
nn = 32-bit constant value (signed) nn = 32-bit constant value (signed)
uu = 32-bit constant value (unsigned) uu = 32-bit constant value (unsigned)
fop = 32-bit floating point operation fop = 32-bit floating point operation
lop = 32-bit library call identifier lop = 32-bit library call identifier
ilbl = 32-bit Instruction space label number ilbl = 32-bit Instruction space label number
dlbl = 32-stack data label dlbl = 32-stack data label
offs4 = 32-bit word offset with respect to LSP (signed) offs4 = 32-bit word offset with respect to LSP (signed)
offs2 = 32-bit halfword offset with respect to LSP (signed) offs2 = 32-bit halfword offset with respect to LSP (signed)
offs = 32-bit byte offset with respect to LSP (signed) offs = 32-bit byte offset with respect to LSP (signed)
uoffs4 = 32-bit word offset with respect to SPB (unsigned) uoffs4 = 32-bit word offset with respect to SPB (unsigned)
uoffs2 = 32-bit halfword offset with respect to SPB (unsigned) uoffs2 = 32-bit halfword offset with respect to SPB (unsigned)
uoffs = 32-bit byte offset with respect to SPB (unsigned) uoffs = 32-bit byte offset with respect to SPB (unsigned)
c = string follows psuedo-operation c = string follows pseudo-operation
= Indicates pseudo-operations (these are removed = Indicates pseudo-operations (these are removed

View File

@ -1,426 +1,426 @@
/**************************************************************************** /****************************************************************************
* pinsn32.h * pinsn32.h
* 32-bit P-code operation code definitions * 32-bit P-code operation code definitions
* *
* Copyright (C) 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * distribution.
* 3. Neither the name NuttX nor the names of its contributors may be * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
#ifndef __PINSN32_H #ifndef __PINSN32_H
#define __PINSN32_H #define __PINSN32_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
****************************************************************************/ ****************************************************************************/
/* 32-bit op-code bit definitions /* 32-bit op-code bit definitions
* *
* Machine model: * Machine model:
* *
* SPB 32-bit Pascal stack base address * SPB 32-bit Pascal stack base address
* SP 32-bit Pascal stack pointer * SP 32-bit Pascal stack pointer
* LSP 32-bit Level stack pointer * LSP 32-bit Level stack pointer
* CSB 32-bit Character stack base address * CSB 32-bit Character stack base address
* CSP 32-bit Character stack pointer * CSP 32-bit Character stack pointer
* DS 32-bit Data size register (for multiple reg transfers) * DS 32-bit Data size register (for multiple reg transfers)
* PC 32-bit Program Counter * PC 32-bit Program Counter
* CC Condition code register * CC Condition code register
* --- Volatile general purpose registers * --- Volatile general purpose registers
* --- Static general purpose registers * --- Static general purpose registers
* *
* Condition codes: Z(ero), N(egative) * Condition codes: Z(ero), N(egative)
* *
* +=====+=====+ * +=====+=====+
* | Z | N | * | Z | N |
* +=====+=====+=====+ * +=====+=====+=====+
* | EQ | 1 | - | * | EQ | 1 | - |
* | NEQ | 0 | - | * | NEQ | 0 | - |
* | LT | - | 1 | * | LT | - | 1 |
* | GTE | - | 0 | * | GTE | - | 0 |
* | GT | 0 | 0 | * | GT | 0 | 0 |
* | LTE | 1 | 1 | * | LTE | 1 | 1 |
* +=====+=====+=====+ * +=====+=====+=====+
* *
* Opcode Encoding Summary: * Opcode Encoding Summary:
* *
* 0rxx xxxx 1rxxx xxxx * 0rxx xxxx 1rxxx xxxx
* xr00 0000 NOP LD uoffs4 * xr00 0000 NOP LD uoffs4
* xr00 0001 NEG LDH uoffs3 * xr00 0001 NEG LDH uoffs3
* xr00 0010 ABS LDB uoffs * xr00 0010 ABS LDB uoffs
* xr00 0011 INC LDM uoffs4 * xr00 0011 INC LDM uoffs4
* xr00 0100 DEC ST uoffs4 * xr00 0100 DEC ST uoffs4
* xr00 0101 NOT STH uoffs2 * xr00 0101 NOT STH uoffs2
* xr00 0110 ADD STB uoffs * xr00 0110 ADD STB uoffs
* xr00 0111 SUB STM uoffs4 * xr00 0111 SUB STM uoffs4
* xr00 1000 MUL LDX uoffs4 * xr00 1000 MUL LDX uoffs4
* xr00 1001 DIV LDXH uoffs2 * xr00 1001 DIV LDXH uoffs2
* xr00 1010 MOD LDXB uoffs * xr00 1010 MOD LDXB uoffs
* xr00 1011 SLL LDXM uoffs4 * xr00 1011 SLL LDXM uoffs4
* xr00 1100 SRL STX uoffs4 * xr00 1100 SRL STX uoffs4
* xr00 1101 SRA STXH uoffs2 * xr00 1101 SRA STXH uoffs2
* xr00 1110 OR STXB uoffs * xr00 1110 OR STXB uoffs
* xr00 1111 AND STXM uoffs * xr00 1111 AND STXM uoffs
* *
* xr01 0000 EQUZ JEQUZ ilbl * xr01 0000 EQUZ JEQUZ ilbl
* xr01 0001 NEQZ JNEQZ ilbl * xr01 0001 NEQZ JNEQZ ilbl
* xr01 0010 LTZ JLTZ ilbl * xr01 0010 LTZ JLTZ ilbl
* xr01 0011 GTEZ JGTEZ ilbl * xr01 0011 GTEZ JGTEZ ilbl
* xr01 0100 GTZ JGTZ ilbl * xr01 0100 GTZ JGTZ ilbl
* xr01 0101 LTEZ JLTEZ ilbl * xr01 0101 LTEZ JLTEZ ilbl
* xr01 0110 --- JMP ilbl * xr01 0110 --- JMP ilbl
* xr01 0111 --- PUSH nn * xr01 0111 --- PUSH nn
* xr01 1000 EQU JEQU ilbl * xr01 1000 EQU JEQU ilbl
* xr01 1001 NEQ JNEQ ilbl * xr01 1001 NEQ JNEQ ilbl
* xr01 1010 LT JLT ilbl * xr01 1010 LT JLT ilbl
* xr01 1011 GTE JGTE ilbl * xr01 1011 GTE JGTE ilbl
* xr01 1100 GT JGT ilbl * xr01 1100 GT JGT ilbl
* xr01 1101 LTE JLTE ilbl * xr01 1101 LTE JLTE ilbl
* xr01 1110 --- --- * xr01 1110 --- ---
* xr01 1111 BIT INDS nn * xr01 1111 BIT INDS nn
* *
* xr10 0000 LDI LDS offs4 * xr10 0000 LDI LDS offs4
* xr10 0001 LDIH LDSH offs3 * xr10 0001 LDIH LDSH offs3
* xr10 0010 LDIB LDSB offs * xr10 0010 LDIB LDSB offs
* xr10 0011 LDIM LDSM offs4 * xr10 0011 LDIM LDSM offs4
* xr10 0100 STI STS offs4 * xr10 0100 STI STS offs4
* xr10 0101 STIH STSH offs2 * xr10 0101 STIH STSH offs2
* xr10 0110 STIB STSB offs * xr10 0110 STIB STSB offs
* xr10 0111 STIM STSM offs4 * xr10 0111 STIM STSM offs4
* xr10 1000 DUP LDSX offs4 * xr10 1000 DUP LDSX offs4
* xr10 1001 --- LDSXH offs2 * xr10 1001 --- LDSXH offs2
* xr10 1010 PUSHS LDSXB offs * xr10 1010 PUSHS LDSXB offs
* xr10 1011 POPS LDSXM offs4 * xr10 1011 POPS LDSXM offs4
* xr10 1100 --- STSX offs4 * xr10 1100 --- STSX offs4
* xr10 1101 --- STSXH offs2 * xr10 1101 --- STSXH offs2
* xr10 1110 --- STSXB offs * xr10 1110 --- STSXB offs
* xr10 1111 RET STSXM offs * xr10 1111 RET STSXM offs
* *
* xr11 0000 --- LA uoffs * xr11 0000 --- LA uoffs
* xr11 0001 --- LAS offs * xr11 0001 --- LAS offs
* xr11 0010 --- LAC dlbl * xr11 0010 --- LAC dlbl
* xr11 0011 --- --- * xr11 0011 --- ---
* xr11 0100 --- LAX uoffs * xr11 0100 --- LAX uoffs
* xr11 0101 --- LASX offs * xr11 0101 --- LASX offs
* xr11 0110 --- SLSP level * xr11 0110 --- SLSP level
* xr11 0111 --- SDC uu * xr11 0111 --- SDC uu
* xr11 1000 --- --- * xr11 1000 --- ---
* xr11 1001 --- PCAL ilbl * xr11 1001 --- PCAL ilbl
* xr11 1010 --- SYSIO fn,sop * xr11 1010 --- SYSIO fn,sop
* xr11 1011 --- LIB lop * xr11 1011 --- LIB lop
* xr11 1100 --- FLOAT fop * xr11 1100 --- FLOAT fop
* xr11 1101 --- *LABEL ilbl * xr11 1101 --- *LABEL ilbl
* xr11 1110 --- *INCLUDE fn * xr11 1110 --- *INCLUDE fn
* xr11 1111 END *LINE lineno * xr11 1111 END *LINE lineno
* *
* KEY: * KEY:
* r = Reserved bit (must be zero) * r = Reserved bit (must be zero)
* fn = 8-bit file number * fn = 8-bit file number
* lvl = 8-bit static nexting level * lvl = 8-bit static nexting level
* sop = 17-bit sysio operation * sop = 17-bit sysio operation
* lineno = 17-bit line number * lineno = 17-bit line number
* nn = 32-bit constant value (signed) * nn = 32-bit constant value (signed)
* uu = 32-bit constant value (unsigned) * uu = 32-bit constant value (unsigned)
* fop = 32-bit floating point operation * fop = 32-bit floating point operation
* lop = 32-bit library call identifier * lop = 32-bit library call identifier
* ilbl = 32-bit Instruction space label number * ilbl = 32-bit Instruction space label number
* dlbl = 32-stack data label * dlbl = 32-stack data label
* offs4 = 32-bit word offset with respect to LSP (signed) * offs4 = 32-bit word offset with respect to LSP (signed)
* offs2 = 32-bit halfword offset with respect to LSP (signed) * offs2 = 32-bit halfword offset with respect to LSP (signed)
* offs = 32-bit byte offset with respect to LSP (signed) * offs = 32-bit byte offset with respect to LSP (signed)
* uoffs4 = 32-bit word offset with respect to SPB (unsigned) * uoffs4 = 32-bit word offset with respect to SPB (unsigned)
* uoffs2 = 32-bit halfword offset with respect to SPB (unsigned) * uoffs2 = 32-bit halfword offset with respect to SPB (unsigned)
* uoffs = 32-bit byte offset with respect to SPB (unsigned) * uoffs = 32-bit byte offset with respect to SPB (unsigned)
* c = string follows psuedo-operation * c = string follows pseudo-operation
* * = Indicates pseudo-operations (these are removed * * = Indicates pseudo-operations (these are removed
* after final fixup of the object file). * after final fixup of the object file).
*/ */
#define o32 (0x80) #define o32 (0x80)
#define GETOP(o) ((o)->op) #define GETOP(o) ((o)->op)
#define PUTOP(o,v) do { (o)->op = (v); } while (0) #define PUTOP(o,v) do { (o)->op = (v); } while (0)
#define GETARG(o) ((o)->arg) #define GETARG(o) ((o)->arg)
#define PUTARG(o,a) do { (o)->arg = (a); } while (0) #define PUTARG(o,a) do { (o)->arg = (a); } while (0)
#define ARGONES 0xffffffff #define ARGONES 0xffffffff
/* The opcode binary is stored in big endian order (so that the opcode /* The opcode binary is stored in big endian order (so that the opcode
* always comes first). The following definitions simplify ordering * always comes first). The following definitions simplify ordering
* of byte accesses. * of byte accesses.
*/ */
#ifdef CONFIG_ENDIAN_BIG #ifdef CONFIG_ENDIAN_BIG
# define opB1 0 # define opB1 0
# define opB2 1 # define opB2 1
# define opB3 2 # define opB3 2
# define opB4 3 # define opB4 3
#else #else
# define opB1 3 # define opB1 3
# define opB2 2 # define opB2 2
# define opB3 1 # define opB3 1
# define opB4 0 # define opB4 0
#endif #endif
/** 1-BYTE OPCODES WITH NO ARGUMENTS (other than stack arguments) ***********/ /** 1-BYTE OPCODES WITH NO ARGUMENTS (other than stack arguments) ***********/
/* Program control (No stack arguments) */ /* Program control (No stack arguments) */
#define oNOP (0x00) #define oNOP (0x00)
/* Arithmetic & logical & and integer conversions (One 32-bit stack /* Arithmetic & logical & and integer conversions (One 32-bit stack
* argument) * argument)
*/ */
#define oNEG (0x01) #define oNEG (0x01)
#define oABS (0x02) #define oABS (0x02)
#define oINC (0x03) #define oINC (0x03)
#define oDEC (0x04) #define oDEC (0x04)
#define oNOT (0x05) #define oNOT (0x05)
#define oADD (0x06) #define oADD (0x06)
#define oSUB (0x07) #define oSUB (0x07)
#define oMUL (0x08) #define oMUL (0x08)
#define oDIV (0x09) #define oDIV (0x09)
#define oMOD (0x0a) #define oMOD (0x0a)
#define oSLL (0x0b) #define oSLL (0x0b)
#define oSRL (0x0c) #define oSRL (0x0c)
#define oSRA (0x0d) #define oSRA (0x0d)
#define oOR (0x0e) #define oOR (0x0e)
#define oAND (0x0f) #define oAND (0x0f)
/* Comparisons (One 32-bit stack argument) */ /* Comparisons (One 32-bit stack argument) */
#define oEQUZ (0x10) #define oEQUZ (0x10)
#define oNEQZ (0x11) #define oNEQZ (0x11)
#define oLTZ (0x12) #define oLTZ (0x12)
#define oGTEZ (0x13) #define oGTEZ (0x13)
#define oGTZ (0x14) #define oGTZ (0x14)
#define oLTEZ (0x15) #define oLTEZ (0x15)
/* Comparisons (Two 32-bit stack arguments) */ /* Comparisons (Two 32-bit stack arguments) */
#define oEQU (0x18) #define oEQU (0x18)
#define oNEQ (0x19) #define oNEQ (0x19)
#define oLT (0x1a) #define oLT (0x1a)
#define oGTE (0x1b) #define oGTE (0x1b)
#define oGT (0x1c) #define oGT (0x1c)
#define oLTE (0x1d) #define oLTE (0x1d)
#define oBIT (0x1f) #define oBIT (0x1f)
/* Load Immediate */ /* Load Immediate */
#define oLDI (0x20) /* (One 32-bit stack argument) */ #define oLDI (0x20) /* (One 32-bit stack argument) */
#define oLDIH (0x21) /* (One 32-bit stack argument) */ #define oLDIH (0x21) /* (One 32-bit stack argument) */
#define oLDIB (0x22) /* (One 32-bit stack argument) */ #define oLDIB (0x22) /* (One 32-bit stack argument) */
#define oLDIM (0x23) /* (Two 32-bit stack argument) */ #define oLDIM (0x23) /* (Two 32-bit stack argument) */
/* Store Immediate */ /* Store Immediate */
#define oSTI (0x24) /* (Two 32-bit stack argument) */ #define oSTI (0x24) /* (Two 32-bit stack argument) */
#define oSTIH (0x25) /* (Two 32-bit stack argument) */ #define oSTIH (0x25) /* (Two 32-bit stack argument) */
#define oSTIB (0x26) /* (Two 32-bit stack argument) */ #define oSTIB (0x26) /* (Two 32-bit stack argument) */
#define oSTIM (0x27) /* (Two+n 32-bit stack argument) */ #define oSTIM (0x27) /* (Two+n 32-bit stack argument) */
/* Data stack */ /* Data stack */
#define oDUP (0x28) /* (One 32-bit stack argument) */ #define oDUP (0x28) /* (One 32-bit stack argument) */
#define oDUPH (0x29) /* (One 32-bit stack argument) */ #define oDUPH (0x29) /* (One 32-bit stack argument) */
#define oPUSHS (0x2a) /* No stack arguments */ #define oPUSHS (0x2a) /* No stack arguments */
#define oPOPS (0x2b) /* (One 32-bit stack argument) */ #define oPOPS (0x2b) /* (One 32-bit stack argument) */
/* Program control (No stack arguments) /* Program control (No stack arguments)
* Behavior: * Behavior:
* Pop return address * Pop return address
* Pop saved base register (BR) * Pop saved base register (BR)
* Discard saved base address * Discard saved base address
* Set program counter (PC) to return address * Set program counter (PC) to return address
*/ */
#define oRET (0x2f) #define oRET (0x2f)
/* System Functions (No stack arguments) */ /* System Functions (No stack arguments) */
#define oEND (0x3f) #define oEND (0x3f)
/** 4-BYTE OPCODES INCLUDING ONE 32-BIT ARGUMENT ****************************/ /** 4-BYTE OPCODES INCLUDING ONE 32-BIT ARGUMENT ****************************/
/* Load: arg = unsigned base offset */ /* Load: arg = unsigned base offset */
#define oLD (o32|0x00) /* No stack arguments */ #define oLD (o32|0x00) /* No stack arguments */
#define oLDH (o32|0x01) /* No stack arguments */ #define oLDH (o32|0x01) /* No stack arguments */
#define oLDB (o32|0x02) /* No stack arguments */ #define oLDB (o32|0x02) /* No stack arguments */
#define oLDM (o32|0x03) /* One 32-bit stack argument */ #define oLDM (o32|0x03) /* One 32-bit stack argument */
/* Store: arg = unsigned base offset */ /* Store: arg = unsigned base offset */
#define oST (o32|0x04) /* One 32-bit stack argument */ #define oST (o32|0x04) /* One 32-bit stack argument */
#define oSTH (o32|0x05) /* One 32-bit stack argument */ #define oSTH (o32|0x05) /* One 32-bit stack argument */
#define oSTB (o32|0x06) /* One 32-bit stack argument */ #define oSTB (o32|0x06) /* One 32-bit stack argument */
#define oSTM (o32|0x07) /* One+n 32-bit stack argument */ #define oSTM (o32|0x07) /* One+n 32-bit stack argument */
/* Load Indexed: arg = unsigned base offset */ /* Load Indexed: arg = unsigned base offset */
#define oLDX (o32|0x08) /* One 32-bit stack argument */ #define oLDX (o32|0x08) /* One 32-bit stack argument */
#define oLDXH (o32|0x09) /* One 32-bit stack argument */ #define oLDXH (o32|0x09) /* One 32-bit stack argument */
#define oLDXB (o32|0x0a) /* One 32-bit stack argument */ #define oLDXB (o32|0x0a) /* One 32-bit stack argument */
#define oLDXM (o32|0x0b) /* Two 32-bit stack argument */ #define oLDXM (o32|0x0b) /* Two 32-bit stack argument */
/* Store Indexed: arg = unsigned base offset */ /* Store Indexed: arg = unsigned base offset */
#define oSTX (o32|0x0c) /* Two 32-bit stack argument */ #define oSTX (o32|0x0c) /* Two 32-bit stack argument */
#define oSTXH (o32|0x0d) /* Two 32-bit stack argument */ #define oSTXH (o32|0x0d) /* Two 32-bit stack argument */
#define oSTXB (o32|0x0e) /* Two 32-bit stack argument */ #define oSTXB (o32|0x0e) /* Two 32-bit stack argument */
#define oSTXM (o32|0x0f) /* Two+n 32-bit stack argument */ #define oSTXM (o32|0x0f) /* Two+n 32-bit stack argument */
/* Program control: arg = unsigned label (One 32-bit stack argument) */ /* Program control: arg = unsigned label (One 32-bit stack argument) */
#define oJEQUZ (o32|0x10) #define oJEQUZ (o32|0x10)
#define oJNEQZ (o32|0x11) #define oJNEQZ (o32|0x11)
#define oJLTZ (o32|0x12) #define oJLTZ (o32|0x12)
#define oJGTEZ (o32|0x13) #define oJGTEZ (o32|0x13)
#define oJGTZ (o32|0x14) #define oJGTZ (o32|0x14)
#define oJLTEZ (o32|0x15) #define oJLTEZ (o32|0x15)
/* Program control: arg = unsigned label (no stack arguments) */ /* Program control: arg = unsigned label (no stack arguments) */
#define oJMP (o32|0x16) #define oJMP (o32|0x16)
/* Data stack: arg = 32 bit signed data (no stack arguments) */ /* Data stack: arg = 32 bit signed data (no stack arguments) */
#define oPUSH (o32|0x17) #define oPUSH (o32|0x17)
/* Program control: arg = unsigned label (One 32-bit stack argument) */ /* Program control: arg = unsigned label (One 32-bit stack argument) */
#define oJEQU (o32|0x18) #define oJEQU (o32|0x18)
#define oJNEQ (o32|0x19) #define oJNEQ (o32|0x19)
#define oJLT (o32|0x1a) #define oJLT (o32|0x1a)
#define oJGTE (o32|0x1b) #define oJGTE (o32|0x1b)
#define oJGT (o32|0x1c) #define oJGT (o32|0x1c)
#define oJLTE (o32|0x1d) #define oJLTE (o32|0x1d)
/* Data stack: arg = 32 bit signed data (no stack arguments) */ /* Data stack: arg = 32 bit signed data (no stack arguments) */
#define oINDS (o32|0x1f) #define oINDS (o32|0x1f)
/* Load: Uses LSP; arg = signed frame offset */ /* Load: Uses LSP; arg = signed frame offset */
#define oLDS (o32|0x20) /* No stack arguments */ #define oLDS (o32|0x20) /* No stack arguments */
#define oLDSH (o32|0x21) /* No stack arguments */ #define oLDSH (o32|0x21) /* No stack arguments */
#define oLDSB (o32|0x22) /* No stack arguments */ #define oLDSB (o32|0x22) /* No stack arguments */
#define oLDSM (o32|0x23) /* One 32-bit stack argument */ #define oLDSM (o32|0x23) /* One 32-bit stack argument */
/* Store: Uses LSP; arg = signed frame offset */ /* Store: Uses LSP; arg = signed frame offset */
#define oSTS (o32|0x24) /* One 32-bit stack argument */ #define oSTS (o32|0x24) /* One 32-bit stack argument */
#define oSTSH (o32|0x25) /* One 32-bit stack argument */ #define oSTSH (o32|0x25) /* One 32-bit stack argument */
#define oSTSB (o32|0x26) /* One 32-bit stack argument */ #define oSTSB (o32|0x26) /* One 32-bit stack argument */
#define oSTSM (o32|0x27) /* One+n 32-bit stack argument */ #define oSTSM (o32|0x27) /* One+n 32-bit stack argument */
/* Load Indexed: Uses LSP; arg = signed frame offset */ /* Load Indexed: Uses LSP; arg = signed frame offset */
#define oLDSX (o32|0x28) /* One 32-bit stack argument */ #define oLDSX (o32|0x28) /* One 32-bit stack argument */
#define oLDSXH (o32|0x29) /* One 32-bit stack argument */ #define oLDSXH (o32|0x29) /* One 32-bit stack argument */
#define oLDSXB (o32|0x2a) /* One 32-bit stack argument */ #define oLDSXB (o32|0x2a) /* One 32-bit stack argument */
#define oLDSXM (o32|0x2b) /* Two 32-bit stack argument */ #define oLDSXM (o32|0x2b) /* Two 32-bit stack argument */
/* Store Indexed: Uses LSP; arg = signed frame offset */ /* Store Indexed: Uses LSP; arg = signed frame offset */
#define oSTSX (o32|0x2c) /* Two 32-bit stack argument */ #define oSTSX (o32|0x2c) /* Two 32-bit stack argument */
#define oSTSXH (o32|0x2d) /* Two 32-bit stack argument */ #define oSTSXH (o32|0x2d) /* Two 32-bit stack argument */
#define oSTSXB (o32|0x2e) /* Two 32-bit stack argument */ #define oSTSXB (o32|0x2e) /* Two 32-bit stack argument */
#define oSTSXM (o32|0x2f) /* Two+n 32-bit stack argument */ #define oSTSXM (o32|0x2f) /* Two+n 32-bit stack argument */
/* Load address relative to stack base: arg = unsigned offset */ /* Load address relative to stack base: arg = unsigned offset */
#define oLA (o32|0x30) #define oLA (o32|0x30)
/* Load address: Uses SLP, arg = signed frame offset */ /* Load address: Uses SLP, arg = signed frame offset */
#define oLAS (o32|0x31) /* No stack arguments */ #define oLAS (o32|0x31) /* No stack arguments */
/* Load absolute stack address: arg = RODATA offset (No stack arguments) */ /* Load absolute stack address: arg = RODATA offset (No stack arguments) */
#define oLAC (o32|0x32) #define oLAC (o32|0x32)
/* Load address relative to stack base: arg = unsigned offset, TOS=index */ /* Load address relative to stack base: arg = unsigned offset, TOS=index */
#define oLAX (o32|0x34) #define oLAX (o32|0x34)
/* Load address indexed: Uses SLP, arg = signed frame offset */ /* Load address indexed: Uses SLP, arg = signed frame offset */
#define oLASX (o32|0x35) /* No stack arguments */ #define oLASX (o32|0x35) /* No stack arguments */
/* Set LSP: arg = new level that evaluates to LSP value */ /* Set LSP: arg = new level that evaluates to LSP value */
#define oSLSP (o32|0x36) #define oSLSP (o32|0x36)
/* Set DS: arg = new byte count in DS register */ /* Set DS: arg = new byte count in DS register */
#define oSDC (o32|0x37) #define oSDC (o32|0x37)
/* Program Control: Uses LSP; arg = unsigned label /* Program Control: Uses LSP; arg = unsigned label
* (No stack arguments) * (No stack arguments)
* Behavior: * Behavior:
* Push base address of level * Push base address of level
* Push base register (BR) value * Push base register (BR) value
* Set new base register value (BR) as top of stack * Set new base register value (BR) as top of stack
* Push return address * Push return address
* Set program counter (PC) for address associated with label * Set program counter (PC) for address associated with label
*/ */
#define oPCAL (o32|0x39) #define oPCAL (o32|0x39)
/* System calls: arg = file number | sub-function code */ /* System calls: arg = file number | sub-function code */
#define oSYSIO (o32|0x3a) #define oSYSIO (o32|0x3a)
/* System functions: arg = 32-bit library call identifier */ /* System functions: arg = 32-bit library call identifier */
#define oLIB (o32|0x3b) #define oLIB (o32|0x3b)
/* Floating point operations: arg = FP op-code */ /* Floating point operations: arg = FP op-code */
#define oFLOAT (o32|0x3c) #define oFLOAT (o32|0x3c)
/* Program control: arg = unsigned label (no stack arguments) */ /* Program control: arg = unsigned label (no stack arguments) */
#define oLABEL (o32|0x3d) #define oLABEL (o32|0x3d)
/* Psuedo-operations: arg = file number OR line number */ /* Pseudo-operations: arg = file number OR line number */
#define oINCLUDE (o32|0x3e) #define oINCLUDE (o32|0x3e)
#define oLINE (o32|0x3f) #define oLINE (o32|0x3f)
#endif /* __PINSN32_H */ #endif /* __PINSN32_H */

View File

@ -303,7 +303,7 @@ static const struct optab_s g_sArg32OpTable[64] =
/* 0xbd */ { NULL, LABEL_DEC }, /* 0xbd */ { NULL, LABEL_DEC },
/* Psuedo-operations: arg = file number OR line number */ /* Pseudo-operations: arg = file number OR line number */
/* 0xbe */ { "INCLUDE ", FILENO }, /* 0xbe */ { "INCLUDE ", FILENO },
/* 0xbf */ { "LINE ", LINENO }, /* 0xbf */ { "LINE ", LINENO },

View File

@ -272,7 +272,7 @@ void pas_GenerateIoOperation(uint16_t ioOpcode, uint16_t fileNumber)
} }
/***********************************************************************/ /***********************************************************************/
/* Generate a psuedo call to a built-in, standard pascal function */ /* Generate a pseudo call to a built-in, standard pascal function */
void pas_BuiltInFunctionCall(uint16_t libOpcode) void pas_BuiltInFunctionCall(uint16_t libOpcode)
{ {

View File

@ -3119,7 +3119,7 @@
function called stm32_clockenable() that can be used by PM logic to re-start function called stm32_clockenable() that can be used by PM logic to re-start
the PLL after re-awakening from deep sleep modes. the PLL after re-awakening from deep sleep modes.
* fs/fs_foreachinode.c and fs/fs_foreachmountpoint.c: All logic to traverse * fs/fs_foreachinode.c and fs/fs_foreachmountpoint.c: All logic to traverse
inodes and mountpoints in the NuttX psuedo-file system. inodes and mountpoints in the NuttX pseudo-file system.
* fs/fat/fs_fat32.c: Max. filename length reported by statfs() was wrong * fs/fat/fs_fat32.c: Max. filename length reported by statfs() was wrong
if FAT long file names were enabled. if FAT long file names were enabled.
* lib/stdio/lib_libvsprintf.c: Fieldwidth and justification were not * lib/stdio/lib_libvsprintf.c: Fieldwidth and justification were not

View File

@ -1,388 +1,388 @@
<html> <html>
<head> <head>
<title>NFS Client How-To</title> <title>NFS Client How-To</title>
</head> </head>
<body background="backgd.gif"> <body background="backgd.gif">
<hr><hr> <hr><hr>
<table width ="100%"> <table width ="100%">
<tr align="center" bgcolor="#e4e4e4"> <tr align="center" bgcolor="#e4e4e4">
<td> <td>
<h1><big><font color="#3c34ec"><i>NFS Client How-To</i></font></big></h1> <h1><big><font color="#3c34ec"><i>NFS Client How-To</i></font></big></h1>
<p>Last Updated: June 18, 2012</p> <p>Last Updated: June 18, 2012</p>
</td> </td>
</tr> </tr>
</table> </table>
<hr><hr> <hr><hr>
<table width ="100%"> <table width ="100%">
<tr bgcolor="#e4e4e4"> <tr bgcolor="#e4e4e4">
<td> <td>
<h1>Table of Contents</h1> <h1>Table of Contents</h1>
</td> </td>
</tr> </tr>
</table> </table>
<center><table width ="80%"> <center><table width ="80%">
<tr> <tr>
<td> <td>
<table> <table>
<tr> <tr>
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td> <td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
<td> <td>
<a href="#nfsconfiguration">Adding NFS to the NuttX Configuration</a> <a href="#nfsconfiguration">Adding NFS to the NuttX Configuration</a>
</td> </td>
</tr> </tr>
</table> </table>
<table> <table>
<tr> <tr>
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td> <td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
<td> <td>
<a href="#mountinterface">Mount Interface</a> <a href="#mountinterface">Mount Interface</a>
</td> </td>
</tr> </tr>
</table> </table>
<table> <table>
<tr> <tr>
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td> <td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
<td> <td>
<a href="#nfsmount">NFS Mount Command</a> <a href="#nfsmount">NFS Mount Command</a>
</td> </td>
</tr> </tr>
</table> </table>
<table> <table>
<tr> <tr>
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td> <td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
<td> <td>
<a href="#serverconfig">Configuring the NFS server (Ubuntu)</a> <a href="#serverconfig">Configuring the NFS server (Ubuntu)</a>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
</table></center> </table></center>
<table width ="100%"> <table width ="100%">
<tr bgcolor="#e4e4e4"> <tr bgcolor="#e4e4e4">
<td> <td>
<a name="nfsconfiguration"><h1>Adding NFS to the NuttX Configuration</h1></a> <a name="nfsconfiguration"><h1>Adding NFS to the NuttX Configuration</h1></a>
</td> </td>
</tr> </tr>
</table> </table>
<p> <p>
The NFS client is easily added to your configuration: The NFS client is easily added to your configuration:
You simply need to add <code>CONFIG_NFS</code> to your <code>nuttx/.config</code> file. You simply need to add <code>CONFIG_NFS</code> to your <code>nuttx/.config</code> file.
There are, however, a few dependencies on other system settings: There are, however, a few dependencies on other system settings:
</p> </p>
<ol> <ol>
<li> <li>
First, there are number of things that you must configure in order to be able to use any file system: First, there are number of things that you must configure in order to be able to use any file system:
</li> </li>
<ul> <ul>
<li> <li>
<code>CONFIG_NFILE_DESCRIPTORS > 0</code>. You must include support for file descriptors. <code>CONFIG_NFILE_DESCRIPTORS > 0</code>. You must include support for file descriptors.
</li> </li>
<li> <li>
<code>CONFIG_DISABLE_MOUNTPOINT=n</code>. You must include support for mount points in the psuedo-file system. <code>CONFIG_DISABLE_MOUNTPOINT=n</code>. You must include support for mount points in the pseudo-file system.
</li> </li>
</ul> </ul>
<li> <li>
And there are several dependencies on the networking configuration. And there are several dependencies on the networking configuration.
At a minimum, you need to have the following selections: At a minimum, you need to have the following selections:
</li> </li>
<ul> <ul>
<li> <li>
<code>CONFIG_NET=y</code>. General networking support. <code>CONFIG_NET=y</code>. General networking support.
</li> </li>
<li> <li>
<code>CONFIG_NET_UDP=y</code>. Support for UDP. <code>CONFIG_NET_UDP=y</code>. Support for UDP.
</li> </li>
</ul> </ul>
</ol> </ol>
<table width ="100%"> <table width ="100%">
<tr bgcolor="#e4e4e4"> <tr bgcolor="#e4e4e4">
<td> <td>
<a name="mountinterface"><h1>Mount Interface</h1></a> <a name="mountinterface"><h1>Mount Interface</h1></a>
</td> </td>
</tr> </tr>
</table> </table>
<p> <p>
A low-level, C-callable interface is provided to mount a file system. A low-level, C-callable interface is provided to mount a file system.
That interface is called <code>mount()</code> and is mentioned in the <a href="NuttxPortingGuide.html#NxFileSystem"><code>porting guide</code></a> and is prototyped in the header file <code>include/sys/mount.h</code>: That interface is called <code>mount()</code> and is mentioned in the <a href="NuttxPortingGuide.html#NxFileSystem"><code>porting guide</code></a> and is prototyped in the header file <code>include/sys/mount.h</code>:
</p> </p>
<ul><pre> <ul><pre>
int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data);
</pre></ul> </pre></ul>
<p> <p>
<b>Synopsis</b>: <b>Synopsis</b>:
<code>mount()</code> attaches the filesystem specified by the <code>source</code> block device name into the root file system at the path specified by <code>target</code>. <code>mount()</code> attaches the filesystem specified by the <code>source</code> block device name into the root file system at the path specified by <code>target</code>.
</p> </p>
<p> <p>
<b>Input Paramters</b>: <b>Input Paramters</b>:
<ul> <ul>
<li><code>source</code>. A null-terminated string providing the fill path to a block driver in the NuttX psuedo-file system. <li><code>source</code>. A null-terminated string providing the fill path to a block driver in the NuttX pseudo-file system.
<li><code>target</code>. The location in the NuttX psuedo-file system where the volume will be mounted. <li><code>target</code>. The location in the NuttX pseudo-file system where the volume will be mounted.
<li><code>filesystemtype</code>. A string identifying the type of file system to use. <li><code>filesystemtype</code>. A string identifying the type of file system to use.
<li><code>mountflags</code>. Various flags that can be used to qualify how the file system is mounted. <li><code>mountflags</code>. Various flags that can be used to qualify how the file system is mounted.
<li><code>data</code>. Opaque data that is passed to the file system with the mount occurs. <li><code>data</code>. Opaque data that is passed to the file system with the mount occurs.
</ul> </ul>
</p> </p>
<p> <p>
<b>Returned Values</b> <b>Returned Values</b>
Zero is returned on success; -1 is returned on an error and <code>errno</code> is set appropriately: Zero is returned on success; -1 is returned on an error and <code>errno</code> is set appropriately:
<ul> <ul>
<li><code>EACCES</code>. <li><code>EACCES</code>.
A component of a path was not searchable or mounting a read-onlyfilesystem was attempted without giving the <code>MS_RDONLY</code> flag. A component of a path was not searchable or mounting a read-onlyfilesystem was attempted without giving the <code>MS_RDONLY</code> flag.
</li> </li>
<li><code>EBUSY</code>. <li><code>EBUSY</code>.
<code>source</code> is already mounted. <code>source</code> is already mounted.
</li> </li>
<li><code>EFAULT</code>. <li><code>EFAULT</code>.
One of the pointer arguments points outside the user address space. One of the pointer arguments points outside the user address space.
</li> </li>
<li><code>EINVAL</code>. <li><code>EINVAL</code>.
<code>source</code> had an invalid superblock. <code>source</code> had an invalid superblock.
</li> </li>
<li><code>ENODEV</code>. <li><code>ENODEV</code>.
<code>filesystemtype</code> not configured <code>filesystemtype</code> not configured
</li> </li>
<li><code>ENOENT</code>. <li><code>ENOENT</code>.
A pathname was empty or had a nonexistent component. A pathname was empty or had a nonexistent component.
</li> </li>
<li><code>ENOMEM</code>. <li><code>ENOMEM</code>.
Could not allocate a memory to copy filenames or data into. Could not allocate a memory to copy filenames or data into.
</li> </li>
<li><code>ENOTBLK</code>. <li><code>ENOTBLK</code>.
<code>source</code> is not a block device <code>source</code> is not a block device
</li> </li>
</ul> </ul>
</p> </p>
<p> <p>
This same interface can be used to mount a remote, NFS file system using some special parameters. This same interface can be used to mount a remote, NFS file system using some special parameters.
The NFS mount differs from the <i>normal</i> file system mount in that: (1) there is no block driver for the NFS file system, and (2) special parameters must be passed as <code>data</code> to describe the remote NFS server. The NFS mount differs from the <i>normal</i> file system mount in that: (1) there is no block driver for the NFS file system, and (2) special parameters must be passed as <code>data</code> to describe the remote NFS server.
Thus the following code snippet might represent how an NFS file system is mounted: Thus the following code snippet might represent how an NFS file system is mounted:
</p> </p>
<ul><pre> <ul><pre>
#include &lt;sys/mount.h&gt; #include &lt;sys/mount.h&gt;
#include &lt;nuttx/fs/nfs.h&gt; #include &lt;nuttx/fs/nfs.h&gt;
struct nfs_args data; struct nfs_args data;
char *mountpoint; char *mountpoint;
ret = mount(NULL, mountpoint, string &quot;nfs&quot;, 0, (FAR void *)&data); ret = mount(NULL, mountpoint, string &quot;nfs&quot;, 0, (FAR void *)&data);
</pre></ul> </pre></ul>
<p> <p>
NOTE that: (1) the block driver paramter is <code>NULL</code>. NOTE that: (1) the block driver paramter is <code>NULL</code>.
The <code>mount()</code> is smart enough to know that no block driver is needed with the NFS file system. The <code>mount()</code> is smart enough to know that no block driver is needed with the NFS file system.
(2) The NFS file system is identified with the simple string &quot;nfs&quot; (2) The NFS file system is identified with the simple string &quot;nfs&quot;
(3) A reference to <code>struct nfs_args</code> is passed as an NFS-specific argument. (3) A reference to <code>struct nfs_args</code> is passed as an NFS-specific argument.
</p> </p>
<p> <p>
The NFS-specific interface is described in the file <code>include/nuttx/fs/nfs.h</code>. The NFS-specific interface is described in the file <code>include/nuttx/fs/nfs.h</code>.
There you can see that <code>struct nfs_args</code> is defined as: There you can see that <code>struct nfs_args</code> is defined as:
</p> </p>
<ul><pre> <ul><pre>
struct nfs_args struct nfs_args
{ {
uint8_t addrlen; /* Length of address */ uint8_t addrlen; /* Length of address */
uint8_t sotype; /* Socket type */ uint8_t sotype; /* Socket type */
uint8_t flags; /* Flags, determines if following are valid: */ uint8_t flags; /* Flags, determines if following are valid: */
uint8_t timeo; /* Time value in deciseconds (with NFSMNT_TIMEO) */ uint8_t timeo; /* Time value in deciseconds (with NFSMNT_TIMEO) */
uint8_t retrans; /* Times to retry send (with NFSMNT_RETRANS) */ uint8_t retrans; /* Times to retry send (with NFSMNT_RETRANS) */
uint16_t wsize; /* Write size in bytes (with NFSMNT_WSIZE) */ uint16_t wsize; /* Write size in bytes (with NFSMNT_WSIZE) */
uint16_t rsize; /* Read size in bytes (with NFSMNT_RSIZE) */ uint16_t rsize; /* Read size in bytes (with NFSMNT_RSIZE) */
uint16_t readdirsize; /* readdir size in bytes (with NFSMNT_READDIRSIZE) */ uint16_t readdirsize; /* readdir size in bytes (with NFSMNT_READDIRSIZE) */
char *path; /* Server's path of the directory being mount */ char *path; /* Server's path of the directory being mount */
struct sockaddr_storage addr; /* File server address (requires 32-bit alignment) */ struct sockaddr_storage addr; /* File server address (requires 32-bit alignment) */
}; };
</pre></ul> </pre></ul>
<table width ="100%"> <table width ="100%">
<tr bgcolor="#e4e4e4"> <tr bgcolor="#e4e4e4">
<td> <td>
<a name="nfsmount"><h1>NFS Mount Command</h1></a> <a name="nfsmount"><h1>NFS Mount Command</h1></a>
</td> </td>
</tr> </tr>
</table> </table>
<p> <p>
The <a href="NuttShell.html">NuttShell (NSH)</a> also supports a command called <code>nfsmount</code> The <a href="NuttShell.html">NuttShell (NSH)</a> also supports a command called <code>nfsmount</code>
that can be used to mount a remote file system via the NSH command line. that can be used to mount a remote file system via the NSH command line.
</p> </p>
<p> <p>
<b>Command Syntax:</b> <b>Command Syntax:</b>
</p> </p>
<ul><pre> <ul><pre>
nfsmount &lt;server-address&gt; &lt;mount-point&gt; &lt;remote-path&gt; nfsmount &lt;server-address&gt; &lt;mount-point&gt; &lt;remote-path&gt;
</pre></ul> </pre></ul>
<p> <p>
<b>Synopsis</b>. <b>Synopsis</b>.
The <code>nfsmount</code> command mounts a network file system in the NuttX psuedo filesystem. The <code>nfsmount</code> command mounts a network file system in the NuttX pseudo filesystem.
The <code>nfsmount</code> will use NFSv3 UDP protocol to mount the remote file system. The <code>nfsmount</code> will use NFSv3 UDP protocol to mount the remote file system.
</p> </p>
<p> <p>
<b>Command Line Arguments</b>. <b>Command Line Arguments</b>.
The <code>nfsmount</code> takes three arguments: The <code>nfsmount</code> takes three arguments:
</p> </p>
<ol> <ol>
<li> <li>
The <code>&lt;server-address&gt;</code> is the IP address of the server exporting the file system you wish to mount. The <code>&lt;server-address&gt;</code> is the IP address of the server exporting the file system you wish to mount.
This implementation of NFS for the NuttX RTOS is only for a local area network, so the server and client must be in the same network. This implementation of NFS for the NuttX RTOS is only for a local area network, so the server and client must be in the same network.
</li> </li>
<li> <li>
The <code>&lt;mount-point &gt;</code> is the location in the NuttX pseudo filesystem where the mounted volume will appear. The <code>&lt;mount-point &gt;</code> is the location in the NuttX pseudo filesystem where the mounted volume will appear.
This mount point can only reside in the NuttX pseudo filesystem. This mount point can only reside in the NuttX pseudo filesystem.
By convention, this mount point is a subdirectory under <code>/mnt</code>. By convention, this mount point is a subdirectory under <code>/mnt</code>.
The mount command will create whatever psuedo directories that may be needed to complete the full path (but the full path must not already exist). The mount command will create whatever pseudo directories that may be needed to complete the full path (but the full path must not already exist).
</li> </li>
<li> <li>
The <code>&lt;remote-path&gt;</code> is the file system <code>/</code> directory being exported from server. The <code>&lt;remote-path&gt;</code> is the file system <code>/</code> directory being exported from server.
This <code>/</code> directory must have been configured for exportation on the server before when the NFS server was set up. This <code>/</code> directory must have been configured for exportation on the server before when the NFS server was set up.
</li> </li>
</ol> </ol>
<p> <p>
After the volume has been mounted in the NuttX pseudo filesystem, it may be access in the same way as other objects in the file system. After the volume has been mounted in the NuttX pseudo filesystem, it may be access in the same way as other objects in the file system.
</p> </p>
<p> <p>
<b>Example</b>. <b>Example</b>.
Suppose the the NFS server has been configured to export the directory <code>/export/shared</code>. Suppose the the NFS server has been configured to export the directory <code>/export/shared</code>.
The the following command would mount that file system (assuming that the target also has privileges to mount the file system). The the following command would mount that file system (assuming that the target also has privileges to mount the file system).
</p> </p>
<ul><pre> <ul><pre>
NuttShell (NSH) NuttShell (NSH)
nsh&gt; ls /mnt nsh&gt; ls /mnt
/mnt: /mnt:
nsh: ls: no such directory: /mnt nsh: ls: no such directory: /mnt
nsh&gt; nfsmount 10.0.0.1 /mnt/nfs /export/shared nsh&gt; nfsmount 10.0.0.1 /mnt/nfs /export/shared
nsh&gt; ls -l /mnt/nfs nsh&gt; ls -l /mnt/nfs
/mnt/nfs: /mnt/nfs:
drwxrwxrwx 4096 .. drwxrwxrwx 4096 ..
drwxrwxrwx 4096 testdir/ drwxrwxrwx 4096 testdir/
-rw-rw-rw- 6 ctest.txt -rw-rw-rw- 6 ctest.txt
-rw-r--r-- 15 btest.txt -rw-r--r-- 15 btest.txt
drwxrwxrwx 4096 . drwxrwxrwx 4096 .
nsh&gt; echo &quot;This is a test&quot; &gt;/mnt/nfs/testdir/testfile.txt nsh&gt; echo &quot;This is a test&quot; &gt;/mnt/nfs/testdir/testfile.txt
nsh&gt; ls -l /mnt/nfs/testdir nsh&gt; ls -l /mnt/nfs/testdir
/mnt/nfs/testdir: /mnt/nfs/testdir:
-rw-rw-rw- 21 another.txt -rw-rw-rw- 21 another.txt
drwxrwxrwx 4096 .. drwxrwxrwx 4096 ..
drwxrwxrwx 4096 . drwxrwxrwx 4096 .
-rw-rw-rw- 16 testfile.txt -rw-rw-rw- 16 testfile.txt
nsh&gt; cat /mnt/nfs/testdir/testfile.txt nsh&gt; cat /mnt/nfs/testdir/testfile.txt
This is a test This is a test
</pre></ul> </pre></ul>
<table width ="100%"> <table width ="100%">
<tr bgcolor="#e4e4e4"> <tr bgcolor="#e4e4e4">
<td> <td>
<a name="serverconfig"><h1>Configuring the NFS server (Ubuntu)</h1></a> <a name="serverconfig"><h1>Configuring the NFS server (Ubuntu)</h1></a>
</td> </td>
</tr> </tr>
</table> </table>
<p> <p>
Setting up the server will be done in two steps: Setting up the server will be done in two steps:
First, setting up the configuration file for NFS, and then starting the NFS services. First, setting up the configuration file for NFS, and then starting the NFS services.
But first, you need to install the nfs server on Ubuntu with the these two commands: But first, you need to install the nfs server on Ubuntu with the these two commands:
</p> </p>
<ul><pre> <ul><pre>
# sudo apt-get install nfs-common</FONT> # sudo apt-get install nfs-common</FONT>
# sudo apt-get install nfs-kernel-server</FONT> # sudo apt-get install nfs-kernel-server</FONT>
</pre></ul> </pre></ul>
<p> <p>
After that, we need to make or choose the directory we want to export from the NFS server. After that, we need to make or choose the directory we want to export from the NFS server.
In our case, we are going to make a new directory called <code>/export</code>. In our case, we are going to make a new directory called <code>/export</code>.
</p> </p>
<ul><pre> <ul><pre>
# sudo mkdir /export # sudo mkdir /export
</pre></ul> </pre></ul>
<p> <p>
It is important that <code>/export</code> directory allow access to everyone (777 permissions) as we will be accessing the NFS share from the client with no authentication. It is important that <code>/export</code> directory allow access to everyone (777 permissions) as we will be accessing the NFS share from the client with no authentication.
</p> </p>
<ul><pre> <ul><pre>
# sudo chmod 777 /export # sudo chmod 777 /export
</pre></ul> </pre></ul>
<p> <p>
When all this is done, we will need to edit the configuration file to set up an NFS server: <code>/etc/exports</code>. When all this is done, we will need to edit the configuration file to set up an NFS server: <code>/etc/exports</code>.
This file contains a list of entries; This file contains a list of entries;
each entry indicates a volume that is shared and how it is shared. each entry indicates a volume that is shared and how it is shared.
For more information for a complete description of all the setup options for this file you can check in the man pages (<code>man export</code>).</p> For more information for a complete description of all the setup options for this file you can check in the man pages (<code>man export</code>).</p>
An entry in <code>/etc/exports</code> will typically look like this: An entry in <code>/etc/exports</code> will typically look like this:
</p> </p>
<ul><pre> <ul><pre>
directory machine1(option11,option12) directory machine1(option11,option12)
</pre></ul> </pre></ul>
<p> <p>
So for our example we export <coce>/export</code> to the client 10.0.0.2 add the entry: So for our example we export <coce>/export</code> to the client 10.0.0.2 add the entry:
</p> </p>
<ul><pre> <ul><pre>
/export 10.0.0.2(rw) /export 10.0.0.2(rw)
</pre></ul> </pre></ul>
<p> <p>
In our case we are using all the default options except for the <code>ro</code> that we replaced with <code>rw</code> so that our client will have read and write access to the directory that we are exporting. In our case we are using all the default options except for the <code>ro</code> that we replaced with <code>rw</code> so that our client will have read and write access to the directory that we are exporting.
</p> </p>
</p> </p>
After we do all the require configurations, we are ready to start the server with the next command: After we do all the require configurations, we are ready to start the server with the next command:
</p> </p>
<ul><pre> <ul><pre>
# sudo /etc/init.d/nfs-kernel-server start # sudo /etc/init.d/nfs-kernel-server start
</pre></ul> </pre></ul>
</p> </p>
Note: If you later decide to add more NFS exports to the /etc/exports file, you will need to either restart NFS daemon Note: If you later decide to add more NFS exports to the /etc/exports file, you will need to either restart NFS daemon
or run command exportfs. or run command exportfs.
</p> </p>
<ul><pre> <ul><pre>
# sudo /etc/init.d/nfs-kernel-server start # sudo /etc/init.d/nfs-kernel-server start
</pre></ul> </pre></ul>
<p>Or</p> <p>Or</p>
<ul><pre> <ul><pre>
# exportfs -ra # exportfs -ra
</pre></ul> </pre></ul>
<p> <p>
Now we can check if the export directory and our mount point is properly set up. Now we can check if the export directory and our mount point is properly set up.
</p> </p>
<ul><pre> <ul><pre>
# sudo showmount -e # sudo showmount -e
# sudo showmount -a # sudo showmount -a
</pre></ul> </pre></ul>
<p> <p>
And also we can verify if NFS is running in the system with: And also we can verify if NFS is running in the system with:
</p> </p>
<P STYLE="margin-left: 0.49in; margin-bottom: 0in; line-height: 100%"> <P STYLE="margin-left: 0.49in; margin-bottom: 0in; line-height: 100%">
<ul><pre> <ul><pre>
# rpcinfo &ndash;p</FONT> # rpcinfo &ndash;p</FONT>
program vers proto port program vers proto port
100000 2 tcp 111 portmapper 100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper 100000 2 udp 111 portmapper
100011 1 udp 749 rquotad 100011 1 udp 749 rquotad
100011 2 udp 749 rquotad 100011 2 udp 749 rquotad
100005 1 udp 759 mountd 100005 1 udp 759 mountd
100005 1 tcp 761 mountd 100005 1 tcp 761 mountd
100005 2 udp 764 mountd 100005 2 udp 764 mountd
100005 2 tcp 766 mountd 100005 2 tcp 766 mountd
100005 3 udp 769 mountd 100005 3 udp 769 mountd
100005 3 tcp 771 mountd 100005 3 tcp 771 mountd
100003 2 udp 2049 nfs 100003 2 udp 2049 nfs
100003 3 udp 2049 nfs 100003 3 udp 2049 nfs
300019 1 tcp 830 amd 300019 1 tcp 830 amd
300019 1 udp 831 amd 300019 1 udp 831 amd
100024 1 udp 944 status 100024 1 udp 944 status
100024 1 tcp 946 status 100024 1 tcp 946 status
100021 1 udp 1042 nlockmgr 100021 1 udp 1042 nlockmgr
100021 3 udp 1042 nlockmgr 100021 3 udp 1042 nlockmgr
100021 4 udp 1042 nlockmgr 100021 4 udp 1042 nlockmgr
100021 1 tcp 1629 nlockmgr 100021 1 tcp 1629 nlockmgr
100021 3 tcp 1629 nlockmgr 100021 3 tcp 1629 nlockmgr
100021 4 tcp 1629 nlockmgr 100021 4 tcp 1629 nlockmgr
</pre></ul> </pre></ul>
<p> <p>
Now your NFS sever is sharing <code>/export</code> directory to be accessed. Now your NFS sever is sharing <code>/export</code> directory to be accessed.
</p> </p>
</body> </body>
</html> </html>

View File

@ -1400,7 +1400,7 @@ mkfifo &lt;path&gt;
<p> <p>
<b>Synopsis</b>. <b>Synopsis</b>.
Creates a FIFO character device anywhere in the pseudo file system, creating Creates a FIFO character device anywhere in the pseudo file system, creating
whatever psuedo directories that may be needed to complete the <code>&lt;path&gt;</code>. whatever pseudo directories that may be needed to complete the <code>&lt;path&gt;</code>.
By convention, however, device drivers are place in the standard <code>/dev</code> directory. By convention, however, device drivers are place in the standard <code>/dev</code> directory.
After it is created, the FIFO device may be used as any other device driver. After it is created, the FIFO device may be used as any other device driver.
NSH provides this command to access the <a href="NuttxUserGuide.html#mkfifo"><code>mkfifo()</code></a> NuttX API. NSH provides this command to access the <a href="NuttxUserGuide.html#mkfifo"><code>mkfifo()</code></a> NuttX API.
@ -1492,7 +1492,7 @@ mount -t &lt;fstype&gt; &lt;block-device&gt; <code>&lt;dir-path&gt;</code>
If no paramters are provided on the command line after the <code>mount</code> command, then the <code>mount</code> command will enumerate all of the current mountpoints on the console. If no paramters are provided on the command line after the <code>mount</code> command, then the <code>mount</code> command will enumerate all of the current mountpoints on the console.
</p> </p>
<p> <p>
If the mount parameters are provied on the command after the <code>mount</code> command, then the <code>mount</code> command will mount a file system in the NuttX psuedo-file system. If the mount parameters are provied on the command after the <code>mount</code> command, then the <code>mount</code> command will mount a file system in the NuttX pseudo-file system.
<code>mount</code>' performs a three way association, binding: <code>mount</code>' performs a three way association, binding:
</p> </p>
<ol> <ol>
@ -1513,7 +1513,7 @@ mount -t &lt;fstype&gt; &lt;block-device&gt; <code>&lt;dir-path&gt;</code>
<a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> where the mounted volume will appear. <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> where the mounted volume will appear.
This mount point can only reside in the NuttX <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a>. This mount point can only reside in the NuttX <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a>.
By convention, this mount point is a subdirectory under <code>/mnt</code>. By convention, this mount point is a subdirectory under <code>/mnt</code>.
The mount command will create whatever psuedo directories that may be needed to complete the The mount command will create whatever pseudo directories that may be needed to complete the
full path but the full path must not already exist. full path but the full path must not already exist.
</li> </li>
</ol> </ol>

View File

@ -703,9 +703,9 @@ o File system / Generic drivers (fs/, drivers/)
Title: REMOVING PIPES AND FIFOS Title: REMOVING PIPES AND FIFOS
Description: There is no way to remove a FIFO or PIPE created in the Description: There is no way to remove a FIFO or PIPE created in the
psuedo filesystem. Once created, they persist indefinitely pseudo filesystem. Once created, they persist indefinitely
and cannot be unlinked. This is actually a more generic and cannot be unlinked. This is actually a more generic
issue: unlink does not work for anything in the psuedo- issue: unlink does not work for anything in the pseudo-
filesystem. filesystem.
Status: Open, but partially resolved: pipe buffer is at least freed Status: Open, but partially resolved: pipe buffer is at least freed
when there are not open references to the pipe/FIFO. when there are not open references to the pipe/FIFO.

View File

@ -413,7 +413,7 @@ host operations. To make these modifications, do the following:
When this change is made, NSH should be extended to support USB flash When this change is made, NSH should be extended to support USB flash
devices. When a FLASH device is inserted, you should see a device devices. When a FLASH device is inserted, you should see a device
appear in the /dev (psuedo) directory. The device name should be appear in the /dev (pseudo) directory. The device name should be
like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present
it can be mounted from the NSH command line like: it can be mounted from the NSH command line like:

View File

@ -829,7 +829,7 @@ host operations. To make these modifications, do the following:
When this change is made, NSH should be extended to support USB flash When this change is made, NSH should be extended to support USB flash
devices. When a FLASH device is inserted, you should see a device devices. When a FLASH device is inserted, you should see a device
appear in the /dev (psuedo) directory. The device name should be appear in the /dev (pseudo) directory. The device name should be
like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present
it can be mounted from the NSH command line like: it can be mounted from the NSH command line like:

View File

@ -384,7 +384,7 @@ host operations. To make these modifications, do the following:
When this change is made, NSH should be extended to support USB flash When this change is made, NSH should be extended to support USB flash
devices. When a FLASH device is inserted, you should see a device devices. When a FLASH device is inserted, you should see a device
appear in the /dev (psuedo) directory. The device name should be appear in the /dev (pseudo) directory. The device name should be
like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present
it can be mounted from the NSH command line like: it can be mounted from the NSH command line like:

View File

@ -788,7 +788,7 @@ USB host operations. To make these modifications, do the following:
When this change is made, NSH should be extended to support USB flash When this change is made, NSH should be extended to support USB flash
devices. When a FLASH device is inserted, you should see a device devices. When a FLASH device is inserted, you should see a device
appear in the /dev (psuedo) directory. The device name should be appear in the /dev (pseudo) directory. The device name should be
like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present
it can be mounted from the NSH command line like: it can be mounted from the NSH command line like:

View File

@ -96,7 +96,7 @@ int closedir(FAR DIR *dirp)
*/ */
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode) && !DIRENT_ISPSUEDONODE(idir->fd_flags)) if (INODE_IS_MOUNTPT(inode) && !DIRENT_ISPSEUDONODE(idir->fd_flags))
{ {
/* The node is a file system mointpoint. Verify that the mountpoint /* The node is a file system mointpoint. Verify that the mountpoint
* supports the closedir() method (not an error if it does not) * supports the closedir() method (not an error if it does not)
@ -117,13 +117,13 @@ int closedir(FAR DIR *dirp)
else else
#endif #endif
{ {
/* The node is part of the root psuedo file system, release /* The node is part of the root pseudo file system, release
* our contained reference to the 'next' inode. * our contained reference to the 'next' inode.
*/ */
if (idir->u.psuedo.fd_next) if (idir->u.pseudo.fd_next)
{ {
inode_release(idir->u.psuedo.fd_next); inode_release(idir->u.pseudo.fd_next);
} }
} }

View File

@ -342,7 +342,7 @@ int files_dup(FAR struct file *filep1, FAR struct file *filep2)
#endif #endif
#endif #endif
{ {
/* Open the psuedo file or device driver */ /* Open the pseudo file or device driver */
ret = inode->u.i_ops->open(filep2); ret = inode->u.i_ops->open(filep2);
} }

View File

@ -171,7 +171,7 @@ int foreach_inodelevel(FAR struct inode *node, struct inode_path_s *info)
* when the callback 'handler' returns a non-zero value, or when all of * when the callback 'handler' returns a non-zero value, or when all of
* the inodes have been visited. * the inodes have been visited.
* *
* NOTE 1: Use with caution... The psuedo-file system is locked throughout * NOTE 1: Use with caution... The pseudo-file system is locked throughout
* the traversal. * the traversal.
* NOTE 2: The search algorithm is recursive and could, in principle, use * NOTE 2: The search algorithm is recursive and could, in principle, use
* an indeterminant amount of stack space. This will not usually be a * an indeterminant amount of stack space. This will not usually be a

View File

@ -154,7 +154,7 @@ static int mountpoint_filter(FAR struct inode *node,
* mountpoint inodes. It is intended to support the mount() command to * mountpoint inodes. It is intended to support the mount() command to
* when the mount command is used to enumerate mounts. * when the mount command is used to enumerate mounts.
* *
* NOTE 1: Use with caution... The psuedo-file system is locked throughout * NOTE 1: Use with caution... The pseudo-file system is locked throughout
* the traversal. * the traversal.
* NOTE 2: The search algorithm is recursive and could, in principle, use * NOTE 2: The search algorithm is recursive and could, in principle, use
* an indeterminant amount of stack space. This will not usually be a * an indeterminant amount of stack space. This will not usually be a

View File

@ -75,10 +75,10 @@
/* Mountpoint fd_flags values */ /* Mountpoint fd_flags values */
#define DIRENTFLAGS_PSUEDONODE 1 #define DIRENTFLAGS_PSEUDONODE 1
#define DIRENT_SETPSUEDONODE(f) do (f) |= DIRENTFLAGS_PSUEDONODE; while (0) #define DIRENT_SETPSEUDONODE(f) do (f) |= DIRENTFLAGS_PSEUDONODE; while (0)
#define DIRENT_ISPSUEDONODE(f) (((f) & DIRENTFLAGS_PSUEDONODE) != 0) #define DIRENT_ISPSEUDONODE(f) (((f) & DIRENTFLAGS_PSEUDONODE) != 0)
/**************************************************************************** /****************************************************************************
* Public Types * Public Types
@ -236,7 +236,7 @@ EXTERN void inode_release(FAR struct inode *inode);
* when the callback 'handler' returns a non-zero value, or when all of * when the callback 'handler' returns a non-zero value, or when all of
* the inodes have been visited. * the inodes have been visited.
* *
* NOTE 1: Use with caution... The psuedo-file system is locked throughout * NOTE 1: Use with caution... The pseudo-file system is locked throughout
* the traversal. * the traversal.
* NOTE 2: The search algorithm is recursive and could, in principle, use * NOTE 2: The search algorithm is recursive and could, in principle, use
* an indeterminant amount of stack space. This will not usually be a * an indeterminant amount of stack space. This will not usually be a

View File

@ -138,19 +138,19 @@ static inline int open_mountpoint(FAR struct inode *inode,
static void open_pseudodir(FAR struct inode *inode, FAR struct fs_dirent_s *dir) static void open_pseudodir(FAR struct inode *inode, FAR struct fs_dirent_s *dir)
{ {
/* We have a valid psuedo-filesystem node. Take two references on the /* We have a valid pseudo-filesystem node. Take two references on the
* inode -- one for the parent (fd_root) and one for the child (fd_next). * inode -- one for the parent (fd_root) and one for the child (fd_next).
* Note that we do not call inode_addref because we are holding the tree * Note that we do not call inode_addref because we are holding the tree
* semaphore and that would result in deadlock. * semaphore and that would result in deadlock.
*/ */
inode->i_crefs += 2; inode->i_crefs += 2;
dir->u.psuedo.fd_next = inode; /* This is the next node to use for readdir() */ dir->u.pseudo.fd_next = inode; /* This is the next node to use for readdir() */
/* Flag the inode as belonging to the psuedo-filesystem */ /* Flag the inode as belonging to the pseudo-filesystem */
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
DIRENT_SETPSUEDONODE(dir->fd_flags); DIRENT_SETPSEUDONODE(dir->fd_flags);
#endif #endif
} }
@ -242,7 +242,7 @@ FAR DIR *opendir(FAR const char *path)
} }
/* Populate the DIR structure and return it to the caller. The way that /* Populate the DIR structure and return it to the caller. The way that
* we do this depends on whenever this is a "normal" psuedo-file-system * we do this depends on whenever this is a "normal" pseudo-file-system
* inode or a file system mountpoint. * inode or a file system mountpoint.
*/ */
@ -262,7 +262,7 @@ FAR DIR *opendir(FAR const char *path)
open_pseudodir(inode, dir); open_pseudodir(inode, dir);
} }
/* Is this a node in the psuedo filesystem? Or a mountpoint? If the node /* Is this a node in the pseudo filesystem? Or a mountpoint? If the node
* is the root (bisroot == TRUE), then this is a special case. * is the root (bisroot == TRUE), then this is a special case.
*/ */
@ -280,7 +280,7 @@ FAR DIR *opendir(FAR const char *path)
#endif #endif
else else
{ {
/* The node is part of the root psuedo file system. Does the inode have a child? /* The node is part of the root pseudo file system. Does the inode have a child?
* If so that the child would be the 'root' of a list of nodes under * If so that the child would be the 'root' of a list of nodes under
* the directory. * the directory.
*/ */
@ -292,7 +292,7 @@ FAR DIR *opendir(FAR const char *path)
goto errout_with_direntry; goto errout_with_direntry;
} }
/* It looks we have a valid psuedo-filesystem directory node. */ /* It looks we have a valid pseudo-filesystem directory node. */
open_pseudodir(inode, dir); open_pseudodir(inode, dir);
} }

View File

@ -53,16 +53,16 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: readpsuedodir * Name: readpseudodir
****************************************************************************/ ****************************************************************************/
static inline int readpsuedodir(struct fs_dirent_s *idir) static inline int readpseudodir(struct fs_dirent_s *idir)
{ {
FAR struct inode *prev; FAR struct inode *prev;
/* Check if we are at the end of the list */ /* Check if we are at the end of the list */
if (!idir->u.psuedo.fd_next) if (!idir->u.pseudo.fd_next)
{ {
/* End of file and error conditions are not distinguishable /* End of file and error conditions are not distinguishable
* with readdir. Here we return -ENOENT to signal the end * with readdir. Here we return -ENOENT to signal the end
@ -74,21 +74,21 @@ static inline int readpsuedodir(struct fs_dirent_s *idir)
/* Copy the inode name into the dirent structure */ /* Copy the inode name into the dirent structure */
strncpy(idir->fd_dir.d_name, idir->u.psuedo.fd_next->i_name, NAME_MAX+1); strncpy(idir->fd_dir.d_name, idir->u.pseudo.fd_next->i_name, NAME_MAX+1);
/* If the node has file operations, we will say that it is /* If the node has file operations, we will say that it is
* a file. * a file.
*/ */
idir->fd_dir.d_type = 0; idir->fd_dir.d_type = 0;
if (idir->u.psuedo.fd_next->u.i_ops) if (idir->u.pseudo.fd_next->u.i_ops)
{ {
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_BLOCK(idir->u.psuedo.fd_next)) if (INODE_IS_BLOCK(idir->u.pseudo.fd_next))
{ {
idir->fd_dir.d_type |= DTYPE_BLK; idir->fd_dir.d_type |= DTYPE_BLK;
} }
if (INODE_IS_MOUNTPT(idir->u.psuedo.fd_next)) if (INODE_IS_MOUNTPT(idir->u.pseudo.fd_next))
{ {
idir->fd_dir.d_type |= DTYPE_DIRECTORY; idir->fd_dir.d_type |= DTYPE_DIRECTORY;
} }
@ -103,7 +103,7 @@ static inline int readpsuedodir(struct fs_dirent_s *idir)
* is a directory. NOTE: that the node can be both! * is a directory. NOTE: that the node can be both!
*/ */
if (idir->u.psuedo.fd_next->i_child || !idir->u.psuedo.fd_next->u.i_ops) if (idir->u.pseudo.fd_next->i_child || !idir->u.pseudo.fd_next->u.i_ops)
{ {
idir->fd_dir.d_type |= DTYPE_DIRECTORY; idir->fd_dir.d_type |= DTYPE_DIRECTORY;
} }
@ -112,14 +112,14 @@ static inline int readpsuedodir(struct fs_dirent_s *idir)
inode_semtake(); inode_semtake();
prev = idir->u.psuedo.fd_next; prev = idir->u.pseudo.fd_next;
idir->u.psuedo.fd_next = prev->i_peer; /* The next node to visit */ idir->u.pseudo.fd_next = prev->i_peer; /* The next node to visit */
if (idir->u.psuedo.fd_next) if (idir->u.pseudo.fd_next)
{ {
/* Increment the reference count on this next node */ /* Increment the reference count on this next node */
idir->u.psuedo.fd_next->i_crefs++; idir->u.pseudo.fd_next->i_crefs++;
} }
inode_semgive(); inode_semgive();
@ -179,7 +179,7 @@ FAR struct dirent *readdir(DIR *dirp)
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
inode = idir->fd_root; inode = idir->fd_root;
if (INODE_IS_MOUNTPT(inode) && !DIRENT_ISPSUEDONODE(idir->fd_flags)) if (INODE_IS_MOUNTPT(inode) && !DIRENT_ISPSEUDONODE(idir->fd_flags))
{ {
/* The node is a file system mointpoint. Verify that the mountpoint /* The node is a file system mointpoint. Verify that the mountpoint
* supports the readdir() method * supports the readdir() method
@ -198,9 +198,9 @@ FAR struct dirent *readdir(DIR *dirp)
else else
#endif #endif
{ {
/* The node is part of the root psuedo file system */ /* The node is part of the root pseudo file system */
ret = readpsuedodir(idir); ret = readpseudodir(idir);
} }
/* ret < 0 is an error. Special case: ret = -ENOENT is end of file */ /* ret < 0 is an error. Special case: ret = -ENOENT is end of file */

View File

@ -52,10 +52,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: rewindpsuedodir * Name: rewindpseudodir
****************************************************************************/ ****************************************************************************/
static inline void rewindpsuedodir(struct fs_dirent_s *idir) static inline void rewindpseudodir(struct fs_dirent_s *idir)
{ {
struct inode *prev; struct inode *prev;
@ -63,8 +63,8 @@ static inline void rewindpsuedodir(struct fs_dirent_s *idir)
/* Reset the position to the beginning */ /* Reset the position to the beginning */
prev = idir->u.psuedo.fd_next; /* (Save to delete later) */ prev = idir->u.pseudo.fd_next; /* (Save to delete later) */
idir->u.psuedo.fd_next = idir->fd_root; /* The next node to visit */ idir->u.pseudo.fd_next = idir->fd_root; /* The next node to visit */
idir->fd_position = 0; /* Reset position */ idir->fd_position = 0; /* Reset position */
/* Increment the reference count on the root=next node. We /* Increment the reference count on the root=next node. We
@ -138,8 +138,8 @@ void rewinddir(FAR DIR *dirp)
else else
#endif #endif
{ {
/* The node is part of the root psuedo file system */ /* The node is part of the root pseudo file system */
rewindpsuedodir(idir); rewindpseudodir(idir);
} }
} }

View File

@ -53,10 +53,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: seekpsuedodir * Name: seekpseudodir
****************************************************************************/ ****************************************************************************/
static inline void seekpsuedodir(struct fs_dirent_s *idir, off_t offset) static inline void seekpseudodir(struct fs_dirent_s *idir, off_t offset)
{ {
struct inode *curr; struct inode *curr;
struct inode *prev; struct inode *prev;
@ -76,7 +76,7 @@ static inline void seekpsuedodir(struct fs_dirent_s *idir, off_t offset)
else else
{ {
pos = idir->fd_position; pos = idir->fd_position;
curr = idir->u.psuedo.fd_next; curr = idir->u.pseudo.fd_next;
} }
/* Traverse the peer list starting at the 'root' of the /* Traverse the peer list starting at the 'root' of the
@ -90,8 +90,8 @@ static inline void seekpsuedodir(struct fs_dirent_s *idir, off_t offset)
/* Now get the inode to vist next time that readdir() is called */ /* Now get the inode to vist next time that readdir() is called */
prev = idir->u.psuedo.fd_next; prev = idir->u.pseudo.fd_next;
idir->u.psuedo.fd_next = curr; /* The next node to visit (might be null) */ idir->u.pseudo.fd_next = curr; /* The next node to visit (might be null) */
idir->fd_position = pos; /* Might be beyond the last dirent */ idir->fd_position = pos; /* Might be beyond the last dirent */
if (curr) if (curr)
@ -223,8 +223,8 @@ void seekdir(FAR DIR *dirp, off_t offset)
else else
#endif #endif
{ {
/* The node is part of the root psuedo file system */ /* The node is part of the root pseudo file system */
seekpsuedodir(idir, offset); seekpseudodir(idir, offset);
} }
} }

View File

@ -51,10 +51,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: statpsuedo * Name: statpseudo
****************************************************************************/ ****************************************************************************/
static inline int statpsuedo(FAR struct inode *inode, FAR struct stat *buf) static inline int statpseudo(FAR struct inode *inode, FAR struct stat *buf)
{ {
/* Most of the stat entries just do not apply */ /* Most of the stat entries just do not apply */
@ -92,7 +92,7 @@ static inline int statpsuedo(FAR struct inode *inode, FAR struct stat *buf)
{ {
/* If it has no operations, then it must just be a intermediate /* If it has no operations, then it must just be a intermediate
* node in the inode tree. It is something like a directory. * node in the inode tree. It is something like a directory.
* We'll say that all psuedo-directories are read-able but not * We'll say that all pseudo-directories are read-able but not
* write-able. * write-able.
*/ */
@ -195,9 +195,9 @@ int stat(const char *path, FAR struct stat *buf)
else else
#endif #endif
{ {
/* The node is part of the root psuedo file system */ /* The node is part of the root pseudo file system */
ret = statpsuedo(inode, buf); ret = statpseudo(inode, buf);
} }
/* Check if the stat operation was successful */ /* Check if the stat operation was successful */

View File

@ -52,10 +52,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: statpsuedo * Name: statpseudo
****************************************************************************/ ****************************************************************************/
static inline int statpsuedofs(FAR struct inode *inode, FAR struct statfs *buf) static inline int statpseudofs(FAR struct inode *inode, FAR struct statfs *buf)
{ {
memset(buf, 0, sizeof(struct statfs)); memset(buf, 0, sizeof(struct statfs));
buf->f_type = PROC_SUPER_MAGIC; buf->f_type = PROC_SUPER_MAGIC;
@ -137,9 +137,9 @@ int statfs(FAR const char *path, FAR struct statfs *buf)
else else
#endif #endif
{ {
/* The node is part of the root psuedo file system */ /* The node is part of the root pseudo file system */
ret = statpsuedofs(inode, buf); ret = statpseudofs(inode, buf);
} }
/* Check if the statfs operation was successful */ /* Check if the statfs operation was successful */

View File

@ -319,7 +319,7 @@ int syslog_initialize(void)
SYSLOG_OFLAGS, 0666); SYSLOG_OFLAGS, 0666);
} }
/* No... then it must be a character driver in the NuttX psuedo- /* No... then it must be a character driver in the NuttX pseudo-
* file system. * file system.
*/ */

View File

@ -71,7 +71,7 @@
* Name: unregister_blockdriver * Name: unregister_blockdriver
* *
* Description: * Description:
* Remove the block driver inode at 'path' from the psuedo-file system * Remove the block driver inode at 'path' from the pseudo-file system
* *
****************************************************************************/ ****************************************************************************/

View File

@ -71,7 +71,7 @@
* Name: unregister_driver * Name: unregister_driver
* *
* Description: * Description:
* Remove the character driver inode at 'path' from the psuedo-file system * Remove the character driver inode at 'path' from the pseudo-file system
* *
****************************************************************************/ ****************************************************************************/

View File

@ -65,12 +65,12 @@
* reference, a position, a dirent structure, and file-system-specific * reference, a position, a dirent structure, and file-system-specific
* information. * information.
* *
* For the root psuedo-file system, we need retain only the 'next' inode * For the root pseudo-file system, we need retain only the 'next' inode
* need for the next readdir() operation. We hold a reference on this * need for the next readdir() operation. We hold a reference on this
* inode so we know that it will persist until closedir is called. * inode so we know that it will persist until closedir is called.
*/ */
struct fs_psuedodir_s struct fs_pseudodir_s
{ {
struct inode *fd_next; /* The inode for the next call to readdir() */ struct inode *fd_next; /* The inode for the next call to readdir() */
}; };
@ -140,7 +140,7 @@ struct fs_dirent_s
{ {
/* This is the node that was opened by opendir. The type of the inode /* This is the node that was opened by opendir. The type of the inode
* determines the way that the readdir() operations are performed. For the * determines the way that the readdir() operations are performed. For the
* psuedo root psuedo-file system, it is also used to support rewind. * pseudo root pseudo-file system, it is also used to support rewind.
* *
* We hold a reference on this inode so we know that it will persist until * We hold a reference on this inode so we know that it will persist until
* closedir() is called (although inodes linked to this inode may change). * closedir() is called (although inodes linked to this inode may change).
@ -166,9 +166,9 @@ struct fs_dirent_s
union union
{ {
/* Private data used by the built-in psuedo-file system */ /* Private data used by the built-in pseudo-file system */
struct fs_psuedodir_s psuedo; struct fs_pseudodir_s pseudo;
/* Private data used by other file systems */ /* Private data used by other file systems */

View File

@ -199,7 +199,7 @@ union inode_ops_u
#endif #endif
}; };
/* This structure represents one inode in the Nuttx psuedo-file system */ /* This structure represents one inode in the Nuttx pseudo-file system */
struct inode struct inode
{ {
@ -342,7 +342,7 @@ EXTERN void weak_function fs_initialize(void);
* mountpoint inodes. It is intended to support the mount() command to * mountpoint inodes. It is intended to support the mount() command to
* when the mount command is used to enumerate mounts. * when the mount command is used to enumerate mounts.
* *
* NOTE 1: Use with caution... The psuedo-file system is locked throughout * NOTE 1: Use with caution... The pseudo-file system is locked throughout
* the traversal. * the traversal.
* NOTE 2: The search algorithm is recursive and could, in principle, use * NOTE 2: The search algorithm is recursive and could, in principle, use
* an indeterminant amount of stack space. This will not usually be a * an indeterminant amount of stack space. This will not usually be a
@ -415,7 +415,7 @@ EXTERN int register_blockdriver(const char *path,
* Name: unregister_driver * Name: unregister_driver
* *
* Description: * Description:
* Remove the character driver inode at 'path' from the psuedo-file system * Remove the character driver inode at 'path' from the pseudo-file system
* *
****************************************************************************/ ****************************************************************************/
@ -426,7 +426,7 @@ EXTERN int unregister_driver(const char *path);
* Name: unregister_blockdriver * Name: unregister_blockdriver
* *
* Description: * Description:
* Remove the block driver inode at 'path' from the psuedo-file system * Remove the block driver inode at 'path' from the pseudo-file system
* *
****************************************************************************/ ****************************************************************************/