shell: Update commands to use descriptions.

This commit is contained in:
Chris Johns 2016-11-08 21:33:20 +11:00
parent 227aaea494
commit bf61a8b14e
7 changed files with 4101 additions and 4286 deletions

View File

@ -296,91 +296,88 @@ Functions
This section describes the Shell related C functions which are publicly This section describes the Shell related C functions which are publicly
available related to initialization and configuration. available related to initialization and configuration.
.. raw:: latex
\clearpage
rtems_shell_init - Initialize the shell rtems_shell_init - Initialize the shell
--------------------------------------- ---------------------------------------
.. index:: initialization .. index:: initialization
**CALLING SEQUENCE:**
.. index:: rtems_shell_init .. index:: rtems_shell_init
.. code-block:: c CALLING SEQUENCE:
.. code-block:: c
rtems_status_code rtems_shell_init( rtems_status_code rtems_shell_init(
const char *task_name, const char *task_name,
size_t task_stacksize, size_t task_stacksize,
rtems_task_priority task_priority, rtems_task_priority task_priority,
const char *devname, const char *devname,
bool forever, bool forever,
bool wait, bool wait,
rtems_login_check login_check rtems_login_check login_check
); );
**DIRECTIVE STATUS CODES:** DIRECTIVE STATUS CODES:
``RTEMS_SUCCESSFUL`` - Shell task spawned successfully
*others* - to indicate a failure condition
``RTEMS_SUCCESSFUL`` - Shell task spawned successfully DESCRIPTION:
This service creates a task with the specified characteristics to run the RTEMS
Shell attached to the specified ``devname``.
others - to indicate a failure condition NOTES:
This method invokes the ``rtems_task_create`` and ``rtems_task_start``
directives and as such may return any status code that those directives may
return.
**DESCRIPTION:** There is one POSIX key necessary for all shell instances together and one
POSIX key value pair per instance. You should make sure that your RTEMS
configuration accounts for these resources.
This service creates a task with the specified characteristics to run the RTEMS .. raw:: latex
Shell attached to the specified ``devname``.
**NOTES:** \clearpage
This method invokes the ``rtems_task_create`` and ``rtems_task_start``
directives and as such may return any status code that those directives may
return.
There is one POSIX key necessary for all shell instances together and one POSIX
key value pair per instance. You should make sure that your RTEMS configuration
accounts for these resources.
rtems_shell_login_check - Default login check handler rtems_shell_login_check - Default login check handler
----------------------------------------------------- -----------------------------------------------------
.. index:: initialization .. index:: initialization
**CALLING SEQUENCE:**
.. index:: rtems_shell_login_check .. index:: rtems_shell_login_check
.. code:: c CALLING SEQUENCE:
.. code:: c
bool rtems_shell_login_check( bool rtems_shell_login_check(
const char *user, const char *user,
const char *passphrase const char *passphrase
); );
**DIRECTIVE STATUS CODES:** DIRECTIVE STATUS CODES:
``true`` - login is allowed, and
``false`` - otherwise.
``true`` - login is allowed, and DESCRIPTION:
``false`` - otherwise. This function checks if the specified passphrase is valid for the specified
user.
**DESCRIPTION:** NOTES:
As a side-effect if the specified passphrase is valid for the specified
user, this function:
This function checks if the specified passphrase is valid for the specified - performs a filesystem change root operation to the directory of the
user. specified user if the directory path is non-empty,
**NOTES:** - changes the owner of the current shell device to the UID of the specified
user,
As a side-effect if the specified passphrase is valid for the specified user, - sets the real and effective UID of the current user environment to the
this function: UID of the specified user,
- performs a filesystem change root operation to the directory of the specified - sets the real and effective GID of the current user environment to the
user if the directory path is non-empty, GID of the specified user, and
- changes the owner of the current shell device to the UID of the specified - sets the supplementary group IDs of the current user environment to the
user, supplementary group IDs of the specified user.
- sets the real and effective UID of the current user environment to the UID of In case the filesystem change root operation fails, then the environment
the specified user, setup is aborted and ``false`` is returned.
- sets the real and effective GID of the current user environment to the GID of
the specified user, and
- sets the supplementary group IDs of the current user environment to the
supplementary group IDs of the specified user.
In case the filesystem change root operation fails, then the environment setup
is aborted and ``false`` is returned.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ to the Community Project hosted at http://www.rtems.org/.
================ ============================= ================ =============================
.. toctree:: .. toctree::
:maxdepth: 3 :maxdepth: 4
:numbered: :numbered:
preface preface

View File

@ -34,89 +34,90 @@ subsection is dedicated to each of the commands and
describes the behavior and configuration of that describes the behavior and configuration of that
command as well as providing an example usage. command as well as providing an example usage.
.. raw:: latex
\clearpage
.. _mdump: .. _mdump:
mdump - display contents of memory mdump - display contents of memory
---------------------------------- ----------------------------------
.. index:: mdump .. index:: mdump
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell mdump [address [length [size]]]
mdump [address [length [size]]] DESCRIPTION:
This command displays the contents of memory at the ``address`` and
``length`` in ``size`` byte units specified on the command line.
**DESCRIPTION:** When ``size`` is not provided, it defaults to ``1`` byte units. Values of
``1``, ``2``, and ``4`` are valid; all others will cause an error to be
reported.
This command displays the contents of memory at the ``address`` and ``length`` When ``length`` is not provided, it defaults to ``320`` which is twenty
in ``size`` byte units specified on the command line. lines of output with sixteen bytes of output per line.
When ``size`` is not provided, it defaults to ``1`` byte units. Values of When ``address`` is not provided, it defaults to ``0x00000000``.
``1``, ``2``, and ``4`` are valid; all others will cause an error to be
reported.
When ``length`` is not provided, it defaults to ``320`` which is twenty lines EXIT STATUS:
of output with sixteen bytes of output per line. This command always returns 0 to indicate success.
When ``address`` is not provided, it defaults to ``0x00000000``. NOTES:
Dumping memory from a non-existent address may result in an unrecoverable
program fault.
**EXIT STATUS:** EXAMPLES:
The following is an example of how to use ``mdump``:
This command always returns 0 to indicate success. .. code-block:: shell
**NOTES:** SHLL [/] $ mdump 0x10000 32
0x0001000000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
Dumping memory from a non-existent address may result in an unrecoverable 0x0001001000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
program fault. SHLL [/] $ mdump 0x02000000 32
0x02000000A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!.
**EXAMPLES:** 0x02000010A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!.
SHLL [/] $ mdump 0x02001000 32
The following is an example of how to use ``mdump``: 0x0200100003 00 80 00 82 10 60 00-81 98 40 00 83 48 00 00 ......`.....H..
0x0200101084 00 60 01 84 08 A0 07-86 10 20 01 87 28 C0 02 ..`....... ..(..
.. code-block:: shell
SHLL [/] $ mdump 0x10000 32
0x0001000000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
0x0001001000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
SHLL [/] $ mdump 0x02000000 32
0x02000000A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!.
0x02000010A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!.
SHLL [/] $ mdump 0x02001000 32
0x0200100003 00 80 00 82 10 60 00-81 98 40 00 83 48 00 00 ......`.....H..
0x0200101084 00 60 01 84 08 A0 07-86 10 20 01 87 28 C0 02 ..`....... ..(..
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_MDUMP .. index:: CONFIGURE_SHELL_NO_COMMAND_MDUMP
.. index:: CONFIGURE_SHELL_COMMAND_MDUMP .. index:: CONFIGURE_SHELL_COMMAND_MDUMP
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_MDUMP`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_MDUMP`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_MDUMP`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_MDUMP`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_mdump .. index:: rtems_shell_rtems_main_mdump
The ``mdump`` is implemented by a C language function which has the following PROGRAMMING INFORMATION:
prototype: The ``mdump`` is implemented by a C language function which has the
following prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_mdump( int rtems_shell_rtems_main_mdump(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``mdump`` has the following prototype: The configuration structure for the ``mdump`` has the following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_MDUMP_Command; extern rtems_shell_cmd_t rtems_shell_MDUMP_Command;
.. raw:: latex
\clearpage
.. _wdump: .. _wdump:
@ -124,75 +125,72 @@ wdump - display contents of memory (word)
----------------------------------------- -----------------------------------------
.. index:: wdump .. index:: wdump
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell wdump [address [length]]
wdump [address [length]] DESCRIPTION:
This command displays the contents of memory at the ``address`` and
``length`` in bytes specified on the command line.
**DESCRIPTION:** This command is equivalent to ``mdump address length 2``.
This command displays the contents of memory at the ``address`` and ``length`` When ``length`` is not provided, it defaults to ``320`` which is twenty
in bytes specified on the command line. lines of output with eight words of output per line.
This command is equivalent to ``mdump address length 2``. When ``address`` is not provided, it defaults to ``0x00000000``.
When ``length`` is not provided, it defaults to ``320`` which is twenty lines EXIT STATUS:
of output with eight words of output per line. This command always returns 0 to indicate success.
When ``address`` is not provided, it defaults to ``0x00000000``. NOTES:
Dumping memory from a non-existent address may result in an unrecoverable
program fault.
**EXIT STATUS:** EXAMPLES:
The following is an example of how to use ``wdump``:
This command always returns 0 to indicate success. .. code-block:: shell
**NOTES:** SHLL [/] $ wdump 0x02010000 32
0x02010000 0201 08D8 0201 08C0-0201 08AC 0201 0874 ...............t
Dumping memory from a non-existent address may result in an unrecoverable 0x02010010 0201 0894 0201 0718-0201 0640 0201 0798 ...............
program fault.
**EXAMPLES:**
The following is an example of how to use ``wdump``:
.. code-block:: shell
SHLL [/] $ wdump 0x02010000 32
0x02010000 0201 08D8 0201 08C0-0201 08AC 0201 0874 ...............t
0x02010010 0201 0894 0201 0718-0201 0640 0201 0798 ...............
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_WDUMP .. index:: CONFIGURE_SHELL_NO_COMMAND_WDUMP
.. index:: CONFIGURE_SHELL_COMMAND_WDUMP .. index:: CONFIGURE_SHELL_COMMAND_WDUMP
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_WDUMP`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_WDUMP`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_WDUMP`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_WDUMP`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_wdump .. index:: rtems_shell_rtems_main_wdump
The ``wdump`` is implemented by a C language function which has the following PROGRAMMING INFORMATION:
prototype: The ``wdump`` is implemented by a C language function which has the
following prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_wdump( int rtems_shell_rtems_main_wdump(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``wdump`` has the following prototype: The configuration structure for the ``wdump`` has the following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_WDUMP_Command; extern rtems_shell_cmd_t rtems_shell_WDUMP_Command;
.. raw:: latex
\clearpage
.. _ldump: .. _ldump:
@ -200,75 +198,72 @@ ldump - display contents of memory (longword)
--------------------------------------------- ---------------------------------------------
.. index:: ldump .. index:: ldump
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell ldump [address [length]]
ldump [address [length]] DESCRIPTION:
This command displays the contents of memory at the ``address`` and
``length`` in bytes specified on the command line.
**DESCRIPTION:** This command is equivalent to ``mdump address length 4``.
This command displays the contents of memory at the ``address`` and ``length`` When ``length`` is not provided, it defaults to ``320`` which is twenty
in bytes specified on the command line. lines of output with four longwords of output per line.
This command is equivalent to ``mdump address length 4``. When ``address`` is not provided, it defaults to ``0x00000000``.
When ``length`` is not provided, it defaults to ``320`` which is twenty lines EXIT STATUS:
of output with four longwords of output per line. This command always returns 0 to indicate success.
When ``address`` is not provided, it defaults to ``0x00000000``. NOTES:
Dumping memory from a non-existent address may result in an unrecoverable
program fault.
**EXIT STATUS:** EXAMPLES:
The following is an example of how to use ``ldump``:
This command always returns 0 to indicate success. .. code-block:: shell
**NOTES:** SHLL [/] $ ldump 0x02010000 32
0x02010000 020108D8 020108C0-020108AC 02010874 ...............t
Dumping memory from a non-existent address may result in an unrecoverable 0x02010010 020 0894 02010718-02010640 02010798 ...............
program fault.
**EXAMPLES:**
The following is an example of how to use ``ldump``:
.. code-block:: shell
SHLL [/] $ ldump 0x02010000 32
0x02010000 020108D8 020108C0-020108AC 02010874 ...............t
0x02010010 020 0894 02010718-02010640 02010798 ...............
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_LDUMP .. index:: CONFIGURE_SHELL_NO_COMMAND_LDUMP
.. index:: CONFIGURE_SHELL_COMMAND_LDUMP .. index:: CONFIGURE_SHELL_COMMAND_LDUMP
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_LDUMP`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_LDUMP`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_LDUMP`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_LDUMP`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_ldump .. index:: rtems_shell_rtems_main_ldump
The ``ldump`` is implemented by a C language function which has the following PROGRAMMING INFORMATION:
prototype: The ``ldump`` is implemented by a C language function which has the following
prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_ldump( int rtems_shell_rtems_main_ldump(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``ldump`` has the following prototype: The configuration structure for the ``ldump`` has the following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_LDUMP_Command; extern rtems_shell_cmd_t rtems_shell_LDUMP_Command;
.. raw:: latex
\clearpage
.. _medit: .. _medit:
@ -276,73 +271,70 @@ medit - modify contents of memory
--------------------------------- ---------------------------------
.. index:: medit .. index:: medit
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell medit address value1 [value2 ... valueN]
medit address value1 [value2 ... valueN] DESCRIPTION:
This command is used to modify the contents of the memory starting at
``address`` using the octets specified by the parameters``value1`` through
``valueN``.
**DESCRIPTION:** EXIT STATUS:
This command returns 0 on success and non-zero if an error is encountered.
This command is used to modify the contents of the memory starting at NOTES:
``address`` using the octets specified by the parameters``value1`` through Dumping memory from a non-existent address may result in an unrecoverable
``valueN``. program fault.
**EXIT STATUS:** EXAMPLES:
The following is an example of how to use ``medit``:
This command returns 0 on success and non-zero if an error is encountered. .. code-block:: shell
**NOTES:** SHLL [/] $ mdump 0x02000000 32
0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!.
Dumping memory from a non-existent address may result in an unrecoverable 0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!.
program fault. SHLL [/] $ medit 0x02000000 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09
SHLL [/] $ mdump 0x02000000 32
**EXAMPLES:** 0x02000000 01 02 03 04 05 06 07 08-09 00 22 BC A6 10 21 00 .........."...!.
0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!.
The following is an example of how to use ``medit``:
.. code-block:: shell
SHLL [/] $ mdump 0x02000000 32
0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!.
0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!.
SHLL [/] $ medit 0x02000000 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09
SHLL [/] $ mdump 0x02000000 32
0x02000000 01 02 03 04 05 06 07 08-09 00 22 BC A6 10 21 00 .........."...!.
0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!.
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_MEDIT .. index:: CONFIGURE_SHELL_NO_COMMAND_MEDIT
.. index:: CONFIGURE_SHELL_COMMAND_MEDIT .. index:: CONFIGURE_SHELL_COMMAND_MEDIT
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_MEDIT`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_MEDIT`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_MEDIT`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_MEDIT`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_medit .. index:: rtems_shell_rtems_main_medit
The ``medit`` is implemented by a C language function which has the following PROGRAMMING INFORMATION:
prototype: The ``medit`` is implemented by a C language function which has the
following prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_medit( int rtems_shell_rtems_main_medit(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``medit`` has the following prototype: The configuration structure for the ``medit`` has the following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_MEDIT_Command; extern rtems_shell_cmd_t rtems_shell_MEDIT_Command;
.. raw:: latex
\clearpage
.. _mfill: .. _mfill:
@ -350,80 +342,78 @@ mfill - file memory with pattern
-------------------------------- --------------------------------
.. index:: mfill .. index:: mfill
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell mfill address length value
mfill address length value DESCRIPTION:
This command is used to fill the memory starting at ``address`` for the
specified ``length`` in octets when the specified at``value``.
**DESCRIPTION:** EXIT STATUS:
This command returns 0 on success and non-zero if an error is encountered.
This command is used to fill the memory starting at ``address`` for the NOTES:
specified ``length`` in octets when the specified at``value``. Filling a non-existent address range may result in an unrecoverable program
fault. Similarly overwriting interrupt vector tables, code space or
critical data areas can be fatal as shown in the example.
**EXIT STATUS:** EXAMPLES:
In this example, the address used (``0x23d89a0``) as the base address of
the filled area is the end of the stack for the Idle thread. This address
was determined manually using gdb and is very specific to this application
and BSP. The first command in this example is an ``mdump`` to display the
initial contents of this memory. We see that the first 8 bytes are 0xA5
which is the pattern used as a guard by the Stack Checker. On the first
context switch after the pattern is overwritten by the ``mfill`` command,
the Stack Checker detect the pattern has been corrupted and generates a
fatal error.
This command returns 0 on success and non-zero if an error is encountered. .. code-block:: shell
**NOTES:** SHLL [/] $ mdump 0x23d89a0 16
0x023D89A0 A5 A5 A5 A5 A5 A5 A5 A5-FE ED F0 0D 0B AD 0D 06 ................
Filling a non-existent address range may result in an unrecoverable program SHLL [/] $ mfill 0x23d89a0 13 0x5a
fault. Similarly overwriting interrupt vector tables, code space or critical SHLL [/] $ BLOWN STACK!!! Offending task(0x23D4418): id=0x09010001; name=0x0203D908
data areas can be fatal as shown in the example. stack covers range 0x23D89A0 - 0x23D99AF (4112 bytes)
Damaged pattern begins at 0x023D89A8 and is 16 bytes long
**EXAMPLES:**
In this example, the address used (``0x23d89a0``) as the base address of the
filled area is the end of the stack for the Idle thread. This address was
determined manually using gdb and is very specific to this application and BSP.
The first command in this example is an ``mdump`` to display the initial
contents of this memory. We see that the first 8 bytes are 0xA5 which is the
pattern used as a guard by the Stack Checker. On the first context switch
after the pattern is overwritten by the ``mfill`` command, the Stack Checker
detect the pattern has been corrupted and generates a fatal error.
.. code-block:: shell
SHLL [/] $ mdump 0x23d89a0 16
0x023D89A0 A5 A5 A5 A5 A5 A5 A5 A5-FE ED F0 0D 0B AD 0D 06 ................
SHLL [/] $ mfill 0x23d89a0 13 0x5a
SHLL [/] $ BLOWN STACK!!! Offending task(0x23D4418): id=0x09010001; name=0x0203D908
stack covers range 0x23D89A0 - 0x23D99AF (4112 bytes)
Damaged pattern begins at 0x023D89A8 and is 16 bytes long
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_MFILL .. index:: CONFIGURE_SHELL_NO_COMMAND_MFILL
.. index:: CONFIGURE_SHELL_COMMAND_MFILL .. index:: CONFIGURE_SHELL_COMMAND_MFILL
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_MFILL`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_MFILL`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_MFILL`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_MFILL`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_mfill .. index:: rtems_shell_rtems_main_mfill
The ``mfill`` is implemented by a C language function which has the following PROGRAMMING INFORMATION:
prototype: The ``mfill`` is implemented by a C language function which has the
following prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_mfill( int rtems_shell_rtems_main_mfill(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``mfill`` has the The configuration structure for the ``mfill`` has the
following prototype: following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_MFILL_Command; extern rtems_shell_cmd_t rtems_shell_MFILL_Command;
.. raw:: latex
\clearpage
.. _mmove: .. _mmove:
@ -431,71 +421,68 @@ mmove - move contents of memory
------------------------------- -------------------------------
.. index:: mmove .. index:: mmove
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell mmove dst src length
mmove dst src length DESCRIPTION:
This command is used to copy the contents of the memory starting at ``src``
to the memory located at ``dst`` for the specified ``length`` in octets.
**DESCRIPTION:** EXIT STATUS:
This command returns 0 on success and non-zero if an error is encountered.
This command is used to copy the contents of the memory starting at ``src`` to NOTES:
the memory located at ``dst`` for the specified ``length`` in octets. NONE
**EXIT STATUS:** EXAMPLES:
The following is an example of how to use ``mmove``:
This command returns 0 on success and non-zero if an error is encountered. .. code-block:: shell
**NOTES:** SHLL [/] $ mdump 0x023d99a0 16
0x023D99A0 A5 A5 A5 A5 A5 A5 A5 A5-A5 A5 A5 A5 A5 A5 A5 A5 ................
NONE SHLL [/] $ mdump 0x02000000 16
0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!.
**EXAMPLES:** SHLL [/] $ mmove 0x023d99a0 0x02000000 13
SHLL [/] $ mdump 0x023d99a0 16
The following is an example of how to use ``mmove``: 0x023D99A0 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 A5 A5 A5 .H..)..3..".....
.. code-block:: shell
SHLL [/] $ mdump 0x023d99a0 16
0x023D99A0 A5 A5 A5 A5 A5 A5 A5 A5-A5 A5 A5 A5 A5 A5 A5 A5 ................
SHLL [/] $ mdump 0x02000000 16
0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!.
SHLL [/] $ mmove 0x023d99a0 0x02000000 13
SHLL [/] $ mdump 0x023d99a0 16
0x023D99A0 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 A5 A5 A5 .H..)..3..".....
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_MMOVE .. index:: CONFIGURE_SHELL_NO_COMMAND_MMOVE
.. index:: CONFIGURE_SHELL_COMMAND_MMOVE .. index:: CONFIGURE_SHELL_COMMAND_MMOVE
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_MMOVE`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_MMOVE`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_MMOVE`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_MMOVE`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_mmove .. index:: rtems_shell_rtems_main_mmove
The ``mmove`` is implemented by a C language function which has the following PROGRAMMING INFORMATION:
prototype: The ``mmove`` is implemented by a C language function which has the
following prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_mmove( int rtems_shell_rtems_main_mmove(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``mmove`` has the following prototype: The configuration structure for the ``mmove`` has the following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_MMOVE_Command; extern rtems_shell_cmd_t rtems_shell_MMOVE_Command;
.. raw:: latex
\clearpage
.. _malloc: .. _malloc:
@ -503,137 +490,130 @@ malloc - obtain information on C program heap
--------------------------------------------- ---------------------------------------------
.. index:: malloc .. index:: malloc
**SYNOPSYS:** SYNOPSYS:
.. code-block:: shell
.. code-block:: shell malloc [walk]
malloc [walk] DESCRIPTION:
This command prints information about the current state of the C Program
Heap used by the ``malloc()`` family of calls if no or invalid options are
passed to the command. This includes the following information:
**DESCRIPTION:** - Number of free blocks
This command prints information about the current state of the C Program Heap - Largest free block
used by the ``malloc()`` family of calls if no or invalid options are passed to
the command. This includes the following information:
- Number of free blocks - Total bytes free
- Largest free block - Number of used blocks
- Total bytes free - Largest used block
- Number of used blocks - Total bytes used
- Largest used block - Size of the allocatable area in bytes
- Total bytes used - Minimum free size ever in bytes
- Size of the allocatable area in bytes - Maximum number of free blocks ever
- Minimum free size ever in bytes - Maximum number of blocks searched ever
- Maximum number of free blocks ever - Lifetime number of bytes allocated
- Maximum number of blocks searched ever - Lifetime number of bytes freed
- Lifetime number of bytes allocated - Total number of searches
- Lifetime number of bytes freed - Total number of successful allocations
- Total number of searches - Total number of failed allocations
- Total number of successful allocations - Total number of successful frees
- Total number of failed allocations - Total number of successful resizes
- Total number of successful frees When the subcommand ``walk`` is specified, then a heap walk will be
performed and information about each block is printed out.
- Total number of successful resizes EXIT STATUS:
This command returns 0 on success and non-zero if an error is encountered.
When the subcommand ``walk`` is specified, then a heap walk will be performed NOTES:
and information about each block is printed out. NONE
**EXIT STATUS:** EXAMPLES:
The following is an example of how to use the ``malloc`` command.
This command returns 0 on success and non-zero if an error is encountered. .. code-block:: shell
**NOTES:** SHLL [/] $ malloc
C Program Heap and RTEMS Workspace are the same.
NONE Number of free blocks: 2
Largest free block: 266207504
**EXAMPLES:** Total bytes free: 266208392
Number of used blocks: 167
The following is an example of how to use the ``malloc`` command. Largest used block: 16392
Total bytes used: 83536
.. code-block:: shell Size of the allocatable area in bytes: 266291928
Minimum free size ever in bytes: 266207360
SHLL [/] $ malloc Maximum number of free blocks ever: 6
C Program Heap and RTEMS Workspace are the same. Maximum number of blocks searched ever: 5
Number of free blocks: 2 Lifetime number of bytes allocated: 91760
Largest free block: 266207504 Lifetime number of bytes freed: 8224
Total bytes free: 266208392 Total number of searches: 234
Number of used blocks: 167 Total number of successful allocations: 186
Largest used block: 16392 Total number of failed allocations: 0
Total bytes used: 83536 Total number of successful frees: 19
Size of the allocatable area in bytes: 266291928 Total number of successful resizes: 0
Minimum free size ever in bytes: 266207360 SHLL [/] $ malloc walk
Maximum number of free blocks ever: 6 malloc walk
Maximum number of blocks searched ever: 5 PASS[0]: page size 8, min block size 48
Lifetime number of bytes allocated: 91760 area begin 0x00210210, area end 0x0FFFC000
Lifetime number of bytes freed: 8224 first block 0x00210214, last block 0x0FFFBFDC
Total number of searches: 234 first free 0x00228084, last free 0x00228354
Total number of successful allocations: 186 PASS[0]: block 0x00210214: size 88
Total number of failed allocations: 0 ...
Total number of successful frees: 19 PASS[0]: block 0x00220154: size 144
Total number of successful resizes: 0 PASS[0]: block 0x002201E4: size 168, prev 0x002205BC, next 0x00228354 (= last free)
SHLL [/] $ malloc walk PASS[0]: block 0x0022028C: size 168, prev_size 168
malloc walk ...
PASS[0]: page size 8, min block size 48 PASS[0]: block 0x00226E7C: size 4136
area begin 0x00210210, area end 0x0FFFC000 PASS[0]: block 0x00227EA4: size 408, prev 0x00228084 (= first free), next 0x00226CE4
first block 0x00210214, last block 0x0FFFBFDC PASS[0]: block 0x0022803C: size 72, prev_size 408
first free 0x00228084, last free 0x00228354 PASS[0]: block 0x00228084: size 648, prev 0x0020F75C (= head), next 0x00227EA4
PASS[0]: block 0x00210214: size 88 PASS[0]: block 0x0022830C: size 72, prev_size 648
... PASS[0]: block 0x00228354: size 266157192, prev 0x002201E4, next 0x0020F75C (= tail)
PASS[0]: block 0x00220154: size 144 PASS[0]: block 0x0FFFBFDC: size 4028711480, prev_size 266157192
PASS[0]: block 0x002201E4: size 168, prev 0x002205BC, next 0x00228354 (= last free)
PASS[0]: block 0x0022028C: size 168, prev_size 168
...
PASS[0]: block 0x00226E7C: size 4136
PASS[0]: block 0x00227EA4: size 408, prev 0x00228084 (= first free), next 0x00226CE4
PASS[0]: block 0x0022803C: size 72, prev_size 408
PASS[0]: block 0x00228084: size 648, prev 0x0020F75C (= head), next 0x00227EA4
PASS[0]: block 0x0022830C: size 72, prev_size 648
PASS[0]: block 0x00228354: size 266157192, prev 0x002201E4, next 0x0020F75C (= tail)
PASS[0]: block 0x0FFFBFDC: size 4028711480, prev_size 266157192
**CONFIGURATION:**
.. index:: CONFIGURE_SHELL_NO_COMMAND_MALLOC .. index:: CONFIGURE_SHELL_NO_COMMAND_MALLOC
.. index:: CONFIGURE_SHELL_COMMAND_MALLOC .. index:: CONFIGURE_SHELL_COMMAND_MALLOC
This command is included in the default shell command set. When building a CONFIGURATION:
custom command set, define ``CONFIGURE_SHELL_COMMAND_MALLOC`` to have this This command is included in the default shell command set. When building a
command included. custom command set, define ``CONFIGURE_SHELL_COMMAND_MALLOC`` to have this
command included.
This command can be excluded from the shell command set by defining This command can be excluded from the shell command set by defining
``CONFIGURE_SHELL_NO_COMMAND_MALLOC`` when all shell commands have been ``CONFIGURE_SHELL_NO_COMMAND_MALLOC`` when all shell commands have been
configured. configured.
**PROGRAMMING INFORMATION:**
.. index:: rtems_shell_rtems_main_malloc .. index:: rtems_shell_rtems_main_malloc
The ``malloc`` is implemented by a C language function PROGRAMMING INFORMATION:
which has the following prototype: The ``malloc`` is implemented by a C language function which has the
following prototype:
.. code-block:: c .. code-block:: c
int rtems_shell_rtems_main_malloc( int rtems_shell_rtems_main_malloc(
int argc, int argc,
char **argv char **argv
); );
The configuration structure for the ``malloc`` has the following prototype: The configuration structure for the ``malloc`` has the following prototype:
.. code-block:: c .. code-block:: c
extern rtems_shell_cmd_t rtems_shell_MALLOC_Command; extern rtems_shell_cmd_t rtems_shell_MALLOC_Command;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff