Consolidate buffer dumping; fix all occurrences of 'the the'

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1951 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-06-25 17:44:35 +00:00
parent 72f8421e97
commit e72dce9e1b
96 changed files with 286 additions and 368 deletions

View file

@ -1652,7 +1652,7 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a> that specifies the
window that will receive the bitmap image.
<dt><code>dest</code>
<dd> Describes the rectangular on the display that will receive the the bit map.
<dd> Describes the rectangular on the display that will receive the bit map.
<dt><code>src</code>
<dd>The start of the source image. This is an array source images of size
<code>CONFIG_NX_NPLANES</code> (probably 1).

View file

@ -1348,7 +1348,7 @@ mount -t &lt;fstype&gt; &lt;block-device&gt; <code>&lt;dir-path&gt;</code>
</li>
</ol>
<p>
After the the volume has been mounted in the NuttX
After the volume has been mounted in the NuttX
<a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a>,
it may be access in the same way as other objects in thefile system.
</p>
@ -2108,7 +2108,7 @@ nsh>
<tr>
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_DHCPC</code></b></td>
<td>
Obtain the the IP address via DHCP.
Obtain the IP address via DHCP.
</td>
</tr>
<tr>

View file

@ -1214,7 +1214,7 @@ m68k, m68hc11, m68hc12, and SuperH ports.</blockquote>
<td>
<p>
This is a tougher environment.
In this case, the Windows native toolchain is unaware of the the
In this case, the Windows native toolchain is unaware of the
Cygwin <i>sandbox</i> and, instead, operates in the native Windows environment.
The primary difficulties with this are:
</p>

View file

@ -170,7 +170,7 @@ paragraphs.
</p>
</p>
If CONFIG_DEV_CONSOLE is defined, the first three file descriptors (corresponding
to stdin, stdout, stderr) will be duplicated for the the new task.
to stdin, stdout, stderr) will be duplicated for the new task.
Since these file descriptors are duplicated, the child task can free close
them or manipulate them in any way without effecting the parent task.
File-related operations (open, close, etc.) within a task will have no effect
@ -2430,7 +2430,7 @@ VxWorks provides the following comparable interface:
</pre>
<p>
<b>Description:</b>
This function returns the time remaining before the the specified watchdog expires.
This function returns the time remaining before the specified watchdog expires.
</p>
<p>
<b>Input Parameters:</b>
@ -4490,7 +4490,7 @@ per-thread basis and persist for the life of the calling
thread.
<p>
Upon key creation, the value <I>NULL</I> will be associated with
the the new key in all active threads. Upon thread
the new key in all active threads. Upon thread
creation, the value <I>NULL</I> will be associated with all
defined keys in the new thread.
<p>

View file

@ -801,7 +801,7 @@ support for two new architectures:
been integrated due to toolchain issues.
* Renesas M16C/20. Support for the Renesas SKP16C20 board has been included in
the NuttX source tree. However, as the the eZ80Acclaim!, testing and integration
the NuttX source tree. However, as the eZ80Acclaim!, testing and integration
of that port is stalled due to toolchain issues.
These changes were verified only on the ZiLOG eZ80910200zcog-d board. Please report any errors

View file

@ -160,7 +160,7 @@ static inline irqstate_t irqsave(void)
{
unsigned short primask;
/* Return the the current value of primask register and set
/* Return the current value of primask register and set
* bit 0 of the primask register to disable interrupts
*/

View file

@ -86,7 +86,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
* signal handling so that the the user code final gets
* signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/

View file

@ -415,53 +415,16 @@ static void c5471_macassign(struct c5471_driver_s *c5471);
****************************************************************************/
#ifdef CONFIG_C5471_NET_DUMPBUFFER
static void c5471_dumpbuffer(const char *buffer, ssize_t nbytes)
static inline void c5471_dumpbuffer(const char *msg, const ubyte *buffer, unsigned int nbytes)
{
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_NET)
char line[128];
int ch;
int i;
int j;
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
* defined or the following does nothing.
*/
for (i = 0; i < nbytes; i += 16)
{
sprintf(line, "%04x: ", i);
for (j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
sprintf(&line[strlen(line)], "%02x", buffer[i+j] );
}
else
{
strcpy(&line[strlen(line)], " ");
}
if (j == 7 || j == 15)
{
strcpy(&line[strlen(line)], " ");
}
}
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
ch = buffer[i+j];
sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
}
if (j == 7 || j == 15)
{
strcpy(&line[strlen(line)], " ");
}
}
ndbg("%s\n", line);
}
#endif
nvdbgdumpbuffer(msg, buffer, nbytes);
}
#else
# define c5471_dumpbuffer(buffer,nbytes)
# define c5471_dumpbuffer(msg, buffer,nbytes)
#endif
/****************************************************************************
@ -494,7 +457,7 @@ static void c5471_mdtxbit (int bit_state)
putreg32((getreg32(GPIO_CIO) & ~GPIO_CIO_MDIO), GPIO_CIO);
/* Select the the bit output state */
/* Select the bit output state */
if (bit_state)
{
@ -907,7 +870,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
c5471->c_lastdescstart = c5471->c_rxcpudesc;
nvdbg("Packet size: %d RX CPU desc: %08x\n", nbytes, c5471->c_rxcpudesc);
c5471_dumpbuffer(dev->d_buf, dev->d_len);
c5471_dumpbuffer("Transmit packet", dev->d_buf, dev->d_len);
while (nbytes)
{
@ -1276,7 +1239,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
dev->d_len = packetlen;
nvdbg("Received packet, packetlen: %d type: %02x\n", packetlen, ntohs(BUF->type));
c5471_dumpbuffer(dev->d_buf, dev->d_len);
c5471_dumpbuffer("Received packet", dev->d_buf, dev->d_len);
/* We only accept IP packets of the configured type and ARP packets */
@ -2006,7 +1969,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
putreg32(ENET_ADR_BROADCAST|ENET_ADR_PROMISCUOUS, ENET0_ADRMODE_EN);
#else
/* The CPU port is not PROMISCUOUS, it wants a no-promiscuous address
* match yet the the SWITCH receives packets from the PROMISCUOUS ENET0
* match yet the SWITCH receives packets from the PROMISCUOUS ENET0
* which routes all packets for filter matching at the CPU port which
* then allows the s/w to see the new incoming packetes that passed
* the filter. Here we are setting the main SWITCH closest the ether

View file

@ -287,7 +287,7 @@ static int wdt_ioctl(struct file *filep, int cmd, uint32 arg)
{
dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg);
/* Process the the IOCTL command (see arch/watchdog.h) */
/* Process the IOCTL command (see arch/watchdog.h) */
switch(cmd)
{

View file

@ -74,7 +74,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new

View file

@ -136,7 +136,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
****************************************************************************/

View file

@ -74,7 +74,7 @@
/* Macros to handle saving and restore interrupt state. In the current ARM
* model, the state is always copied to and from the stack and TCB. In the
* Cortex-M3 model, the state is copied from the stack to the TCB, but only
* a referenced is passed to get the the state from the TCB.
* a referenced is passed to get the state from the TCB.
*/
#ifdef CONFIG_ARCH_CORTEXM3

View file

@ -86,7 +86,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
* signal handling so that the the user code final gets
* signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/

View file

@ -110,7 +110,7 @@ up_phyrestart:
bic r0, r0, #(CR_S|CR_I|CR_V|CR_RR)
mcr p15, 0, r0, c1, c0, 0 /* Write control reg */
/* We know that the the bootloader entry point is at the
/* We know that the bootloader entry point is at the
* beginning of flash.
*/
#if 1

View file

@ -587,7 +587,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
* receipt are provided in the the return 'status'.
* receipt are provided in the return 'status'.
*
****************************************************************************/

View file

@ -911,7 +911,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
* receipt are provided in the the return 'status'.
* receipt are provided in the return 'status'.
*
****************************************************************************/

View file

@ -674,7 +674,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
* receipt are provided in the the return 'status'.
* receipt are provided in the return 'status'.
*
****************************************************************************/

View file

@ -612,7 +612,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
* receipt are provided in the the return 'status'.
* receipt are provided in the return 'status'.
*
****************************************************************************/

View file

@ -783,7 +783,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
* receipt are provided in the the return 'status'.
* receipt are provided in the return 'status'.
*
****************************************************************************/

View file

@ -59,7 +59,7 @@
* For SDCC, sizeof(int) is 16 and sizeof(long) is 32.
* long long and double are not supported.
*
* Generic pointers are 3 bytes in length with the the
* Generic pointers are 3 bytes in length with the
* first byte holding data space intformation.
*/

View file

@ -71,7 +71,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new

View file

@ -69,7 +69,7 @@
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
****************************************************************************/

View file

@ -71,7 +71,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new

View file

@ -134,7 +134,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
****************************************************************************/

View file

@ -906,7 +906,7 @@ static boolean up_rxavailable(struct uart_dev_s *dev)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
/* Return true if the there is data available in the read buffer */
/* Return true if there is data available in the read buffer */
return ((up_serialin(priv, M16C_UART_C1) & UART_C1_RI) != 0);
}

View file

@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
* signal handling so that the the user code final gets
* signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/

View file

@ -644,7 +644,7 @@ static int up_interrupt(int irq, void *context)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the SCI. Error bits associated with the
* receipt are provided in the the return 'status'.
* receipt are provided in the return 'status'.
*
****************************************************************************/

View file

@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
* signal handling so that the the user code final gets
* signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/

View file

@ -71,7 +71,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new

View file

@ -68,7 +68,7 @@
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
****************************************************************************/

View file

@ -163,7 +163,7 @@
#ifndef __ASSEMBLY__
/* This is the the type of the register save array */
/* This is the type of the register save array */
typedef uint16 chipreg_t;

View file

@ -74,7 +74,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new

View file

@ -138,7 +138,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
****************************************************************************/

View file

@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
* so that the the user code final gets the correct errno value (probably
* so that the user code final gets the correct errno value (probably
* EINTR).
*/

View file

@ -89,7 +89,7 @@ void z16f_sysexec(FAR chipreg_t *regs)
current_regs = regs;
/* The cause of the the system exception is indicated in the SYSEXCPH&L
/* The cause of the system exception is indicated in the SYSEXCPH&L
* registers
*/

View file

@ -304,7 +304,7 @@
#ifndef __ASSEMBLY__
/* This is the the type of the register save array */
/* This is the type of the register save array */
typedef uint16 chipreg_t;

View file

@ -88,7 +88,7 @@
#ifndef __ASSEMBLY__
/* This is the the type of the register save array */
/* This is the type of the register save array */
typedef uint16 chipreg_t;

View file

@ -75,7 +75,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new

View file

@ -138,7 +138,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
****************************************************************************/

View file

@ -2119,7 +2119,7 @@ int up_multicastfilter(FAR struct uip_driver_s *dev, FAR ubyte *mac, boolean ena
* is '0', the multicast packet is rejected.
*/
/* Apply the hash algorithm to the the hash table index and bit number
/* Apply the hash algorithm to the hash table index and bit number
* corresponding to this MAC
*/

View file

@ -88,7 +88,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
* so that the the user code final gets the correct errno value (probably
* so that the user code final gets the correct errno value (probably
* EINTR).
*/

View file

@ -102,7 +102,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
* so that the the user code final gets the correct errno value (probably
* so that the user code final gets the correct errno value (probably
* EINTR).
*/

View file

@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
* so that the the user code final gets the correct errno value (probably
* so that the user code final gets the correct errno value (probably
* EINTR).
*/

View file

@ -51,9 +51,25 @@
#include <nuttx/symtab.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
#undef NXFLAT_DUMPBUFFER /* Define to enable very verbose buffer dumping */
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
* defined or NXFLAT_DUMPBUFFER does nothing.
*/
#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
# undef NXFLAT_DUMPBUFFER
#endif
#ifdef NXFLAT_DUMPBUFFER
# define nxflat_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
#else
# define nxflat_dumpbuffer(m,b,n)
#endif
/****************************************************************************
* Private Types
****************************************************************************/
@ -72,7 +88,7 @@
* Description:
* Perform the NXFLAT_RELOC_TYPE_REL32I binding:
*
* Meaning: Object file contains a 32-bit offset into I-Space at the the offset.
* Meaning: Object file contains a 32-bit offset into I-Space at the offset.
* Fixup: Add mapped I-Space address to the offset.
*
* Returned Value:
@ -111,7 +127,7 @@ static inline int nxflat_bindrel32i(FAR struct nxflat_loadinfo_s *loadinfo,
* Description:
* Perform the NXFLAT_RELOC_TYPE_REL32D binding:
*
* Meaning: Object file contains a 32-bit offset into D-Space at the the offset.
* Meaning: Object file contains a 32-bit offset into D-Space at the offset.
* Fixup: Add allocated D-Space address to the offset.
*
* Returned Value:
@ -246,7 +262,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
{
/* NXFLAT_RELOC_TYPE_REL32I Meaning: Object file contains a 32-bit offset
* into I-Space at the the offset.
* into I-Space at the offset.
* Fixup: Add mapped I-Space address to the offset.
*/
@ -257,7 +273,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
break;
/* NXFLAT_RELOC_TYPE_REL32D Meaning: Object file contains a 32-bit offset
* into D-Space at the the offset.
* into D-Space at the offset.
* Fixup: Add allocated D-Space address to the
* offset.
*/
@ -301,6 +317,15 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
}
}
/* Dump the relocation got */
#ifdef NXFLAT_DUMPBUFFER
if (ret == OK && nrelocs > 0)
{
relocs = (FAR struct nxflat_reloc_s*)(offset - loadinfo->isize + loadinfo->dspace->region);
nxflat_dumpbuffer("GOT", (FAR const ubyte*)relocs, nrelocs * sizeof(struct nxflat_reloc_s));
}
#endif
return ret;
}
@ -396,11 +421,19 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
imports[i].i_funcaddress = (uint32)symbol->sym_value;
bvdbg("Bound imported function '%s' to address %08x\n",
symname, imports[i].i_funcaddress);
bvdbg("Bound import %d (%08p) to export 's' (%08x)\n",
i, &imports[i], symname, imports[i].i_funcaddress);
}
}
/* Dump the relocation import table */
#ifdef NXFLAT_DUMPBUFFER
if (nimports > 0)
{
nxflat_dumpbuffer("Imports", (FAR const ubyte*)imports, nimports * sizeof(struct nxflat_import_s));
}
#endif
return OK;
}

View file

@ -84,7 +84,7 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header)
/* Check the FLT header -- magic number and revision.
*
* If the the magic number does not match. Just return
* If the magic number does not match. Just return
* silently. This is not our binary.
*/

View file

@ -55,13 +55,32 @@
* Pre-processor Definitions
****************************************************************************/
#undef NXFLAT_DUMPBUFFER /* Define to enable very verbose buffer dumping */
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
* defined or NXFLAT_DUMPBUFFER does nothing.
*/
#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
# undef NXFLAT_DUMPBUFFER
#endif
#ifdef NXFLAT_DUMPBUFFER
# define nxflat_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
#else
# define nxflat_dumpbuffer(m,b,n)
#endif
#ifndef MIN
# define MIN(a,b) (a < b ? a : b)
#endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int nxflat_loadbinary(struct binary_s *binp);
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT)
static void nxflat_dumpmemory(void *addr, int nbytes);
static void nxflat_dumploadinfo(struct nxflat_loadinfo_s *loadinfo);
#endif
@ -79,25 +98,6 @@ static struct binfmt_s g_nxflatbinfmt =
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: nnxflat_dumpmemory
****************************************************************************/
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT)
static void nxflat_dumpmemory(void *addr, int nbytes)
{
ubyte *ptr;
bdbg(" ADDRESS VALUE\n");
for (ptr = (ubyte*)addr; nbytes > 0; ptr += 4, nbytes -= 4)
{
bdbg(" %p: %02x %02x %02x %02x\n", ptr, ptr[0], ptr[1], ptr[2], ptr[3]);
}
}
#else
# define nxflat_dumpmemory(a,n)
#endif
/****************************************************************************
* Name: nxflat_dumploadinfo
****************************************************************************/
@ -115,7 +115,7 @@ static void nxflat_dumploadinfo(struct nxflat_loadinfo_s *loadinfo)
bdbg(" DSPACE:\n");
bdbg(" dspace: %08lx\n", loadinfo->dspace);
if (oadinfo->dspace != NULL)
if (loadinfo->dspace != NULL)
{
bdbg(" crefs: %d\n", loadinfo->dspace->crefs);
bdbg(" region: %08lx\n", loadinfo->dspace->region);
@ -196,8 +196,7 @@ static int nxflat_loadbinary(struct binary_s *binp)
binp->isize = loadinfo.isize;
binp->stacksize = loadinfo.stacksize;
bvdbg("ENTRY CODE:\n");
nxflat_dumpmemory(binp->entrypt, 16*sizeof(uint32));
nxflat_dumpbuffer("Entry code", (FAR const ubyte*)binp->entrypt, MIN(binp->isize,512));
nxflat_uninit(&loadinfo);
return OK;
}

View file

@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
* if the the Eagle100 Ethernet bootloader is used, then the entry point must
* if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/

View file

@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
* if the the Eagle100 Ethernet bootloader is used, then the entry point must
* if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/

View file

@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
* if the the Eagle100 Ethernet bootloader is used, then the entry point must
* if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/

View file

@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
* if the the Eagle100 Ethernet bootloader is used, then the entry point must
* if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/

View file

@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
* if the the Eagle100 Ethernet bootloader is used, then the entry point must
* if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/

View file

@ -78,7 +78,7 @@ void up_irqinitialize(void)
*
* NOTE: Normally, there are seperate enables for "global" interrupts
* and specific device interrupts. In such a "normal" case, the timer
* interrupt should be attached and enabled in the the function up_timerinit()
* interrupt should be attached and enabled in the function up_timerinit()
*/
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);

View file

@ -78,7 +78,7 @@ void up_irqinitialize(void)
*
* NOTE: Normally, there are seperate enables for "global" interrupts
* and specific device interrupts. In such a "normal" case, the timer
* interrupt should be attached and enabled in the the function up_timerinit()
* interrupt should be attached and enabled in the function up_timerinit()
*/
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);

View file

@ -81,68 +81,6 @@
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: mmcsd_dmpcsd
*
* Description:
* Dump the contents a buffer
*
****************************************************************************/
#ifdef CONFIG_MMCSD_DUMPALL
void mmcsd_dumpbuffer(FAR const ubyte *buffer, unsigned int buflen)
{
int i, j, k;
for (i = 0; i < buflen; i += 32)
{
message("%04x: ", i);
for (j = 0; j < 32; j++)
{
k = i + j;
if (j == 16)
{
message(" ");
}
if (k < buflen)
{
message("%02x", buffer[k]);
}
else
{
message(" ");
}
}
message(" ");
for (j = 0; j < 32; j++)
{
k = i + j;
if (j == 16)
{
message(" ");
}
if (k < buflen)
{
if (buffer[k] >= 0x20 && buffer[k] < 0x7f)
{
message("%c", buffer[k]);
}
else
{
message(".");
}
}
}
message("\n");
}
}
#endif
/****************************************************************************
* Name: mmcsd_dmpcsd
*

View file

@ -1,7 +1,7 @@
/****************************************************************************
* drivers/mmcsd/mmcsd_internal.h
*
* Copyright (C) 20082009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -42,6 +42,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
/****************************************************************************
* Pre-Processor Definitions
@ -85,9 +86,9 @@ extern "C" {
#endif
#ifdef CONFIG_MMCSD_DUMPALL
EXTERN void mmcsd_dumpbuffer(FAR const ubyte *buffer, unsigned int buflen);
# define mmcsd_dumpbuffer(m,b,l) fvdbgdumpbuffer(m,b,l)
#else
# define mmcsd_dumpbuffer(b,l)
# define mmcsd_dumpbuffer(m,b,l)
#endif
#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_FS)

View file

@ -347,7 +347,7 @@ static void mmcsd_semtake(sem_t *sem)
* Name: mmcsd_waitready
*
* Description:
* Wait until the the card is no longer busy
* Wait until the card is no longer busy
*
* Assumptions:
* MMC/SD card already selected
@ -1170,7 +1170,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
mmcsd_semgive(&slot->sem);
fvdbg("Read %d bytes:\n", nbytes);
mmcsd_dumpbuffer(buffer, nbytes);
mmcsd_dumpbuffer("Read buffer", buffer, nbytes);
return nsectors;
errout_with_eio:
@ -1264,7 +1264,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer,
offset = start_sector * SECTORSIZE(slot);
fvdbg("nbytes=%d byte offset=%d\n", nbytes, offset);
}
mmcsd_dumpbuffer(buffer, nbytes);
mmcsd_dumpbuffer("Write buffer", buffer, nbytes);
/* Select the slave */

View file

@ -823,7 +823,7 @@ static int cs89x0_txavail(struct uip_driver_s *dev)
* Initialize the Ethernet driver
*
* Parameters:
* impl - decribes the the implementation of the cs89x00 implementation.
* impl - decribes the implementation of the cs89x00 implementation.
* This reference is retained so so must remain stable throughout the
* life of the driver instance.
* devno - Identifies the device number. This must be a number between

View file

@ -1900,7 +1900,7 @@ static int usbstrg_cmdparsestate(FAR struct usbstrg_dev_s *priv)
if (priv->cbwdir == USBSTRG_FLAGS_DIRDEVICE2HOST)
{
/* The number of bytes in the response cannot exceed the the host
/* The number of bytes in the response cannot exceed the host
* 'allocation length' in the command.
*/

View file

@ -349,7 +349,7 @@ examples/usbserial
dmesg
At the end of the dmesg output, you should see the the seria
At the end of the dmesg output, you should see the serial
device was successfully idenfied and assigned to a tty device,
probably /dev/ttyUSB0.

View file

@ -551,7 +551,7 @@ o mount -t <fstype> <block-device> <dir-path>
create whatever psuedo directories that may be needed to complete
the full path but the full path must not already exist.
After the the volume has been mounted in the NuttX psuedo file
After the volume has been mounted in the NuttX psuedo file
system, it may be access in the same way as other objects in the
file system.
@ -898,7 +898,7 @@ NSH-Specific Configuration Settings
receiving TELNET commands/reponses
* CONFIG_EXAMPLES_NSH_DHCPC
Obtain the the IP address via DHCP.
Obtain the IP address via DHCP.
* CONFIG_EXAMPLES_NSH_IPADDR
If CONFIG_EXAMPLES_NSH_DHCPC is NOT set, then the static IP

View file

@ -719,7 +719,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
fullpath = nsh_getfullpath(vtbl, localfile);
/* Open the the local file for writing */
/* Open the local file for writing */
fd = open(fullpath, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (fd < 0)

View file

@ -93,7 +93,7 @@
#define ROMFSDEV "/dev/ram0"
#define MOUNTPT "/mnt/romfs"
/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the the
/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the
* output will be synchronous with the debug output.
*/

View file

@ -123,7 +123,7 @@ $(BIN2): $(BIN2).r2
@$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
# BIN3 and BIN4 require that we include --cxx in the xflat-ld command.
# This will instruct xflat-ld that we want it to put togethe the correct
# This will instruct xflat-ld that we want it to put together the correct
# startup files to handle the C++ static initializers.
#
# BIN3 is equivalent to BIN2 except that is uses static initializers

View file

@ -85,7 +85,7 @@ static ssize_t hello_read(struct file *filep, char *buffer, size_t len)
if (offset < hello_pex_len)
{
/* Make sure the the read does not extend beyond the .pex file */
/* Make sure the read does not extend beyond the .pex file */
nread = len;
if (nread + offset > hello_pex_len)

View file

@ -2492,7 +2492,7 @@ int fat_currentsector(struct fat_mountpt_s *fs, struct fat_file_s *ff,
sectoroffset = SEC_NSECTORS(fs, position) & CLUS_NDXMASK(fs);
/* The current cluster is the the first sector of the cluster plus
/* The current cluster is the first sector of the cluster plus
* the sector offset
*/

View file

@ -304,7 +304,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
poll_semtake(&sem);
}
/* Teardown the the poll operation and get the count of events */
/* Teardown the poll operation and get the count of events */
ret = poll_teardown(fds, nfds, &count);
}

View file

@ -166,7 +166,7 @@ static inline void seekmountptdir(struct internal_dir_s *idir, off_t offset)
pos++;
}
/* If we get here the the directory position has been successfully set */
/* If we get here the directory position has been successfully set */
idir->fd_position = pos;
}

View file

@ -50,7 +50,7 @@
* Pre-Processor Definitions
****************************************************************************/
/* Make sure the the bits-per-pixel value has been set */
/* Make sure the bits-per-pixel value has been set */
#ifndef NXFONTS_BITSPERPIXEL
# error "NXFONTS_BITSPERPIXEL must be defined on the command line"

View file

@ -49,7 +49,7 @@
* Pre-Processor Definitions
****************************************************************************/
/* Make sure the the bits-per-pixel value has been set by the includer of
/* Make sure the bits-per-pixel value has been set by the includer of
* this header file.
*/

View file

@ -118,7 +118,7 @@ struct nxfe_conn_s
/* Server state structure ***************************************************/
/* This the the server 'front-end' state structure */
/* This the server 'front-end' state structure */
struct nxfe_state_s
{
@ -443,7 +443,7 @@ extern "C" {
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free() the the window.
* free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect

View file

@ -85,7 +85,7 @@
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free() the the window.
* free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect

View file

@ -61,7 +61,7 @@
/* Server state structure ***************************************************/
/* This the the server 'front-end' state structure. It is really the same
/* This the server 'front-end' state structure. It is really the same
* as the back-end state, but we wrap the back-end state so that we can add
* things to the structure in the future
*/
@ -108,7 +108,7 @@ EXTERN const struct nx_callback_s g_bkgdcb;
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free() the the window.
* free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect

View file

@ -85,7 +85,7 @@
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free() the the window.
* free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect

View file

@ -322,6 +322,86 @@
#endif /* CONFIG_CPP_HAVE_VARARGS */
/* Buffer dumping macros do not depend on varargs */
#ifdef CONFIG_DEBUG
# define dbgdumpbuffer(m,b,n) lib_dumpbuffer(m,b,n)
# ifdef CONFIG_DEBUG_VERBOSE
# define vdbgdumpbuffer(m,b,n) lib_dumpbuffer(m,b,n)
# else
# define vdbgdumpbuffer(m,b,n)
# endif
#else
# define dbgdumpbuffer(m,b,n)
# define vdbgdumpbuffer(m,b,n)
# endif
/* Subsystem specific debug */
#ifdef CONFIG_DEBUG_MM
# define mdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define mvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define mdbgdumpbuffer(m,b,n)
# define mvdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_SCHED
# define sdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define svdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define sdbgdumpbuffer(m,b,n)
# define svdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_NET
# define ndbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define nvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define ndbgdumpbuffer(m,b,n)
# define nvdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_USB
# define udbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define uvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define udbgdumpbuffer(m,b,n)
# define uvdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_FS
# define fdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define fvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define fdbgdumpbuffer(m,b,n)
# define fvdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_GRAPHICS
# define gdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define gvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define gdbgdumpbuffer(m,b,n)
# define gvdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_BINFMT
# define bdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define bvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define bdbgdumpbuffer(m,b,n)
# define bvdbgdumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_LIB
# define ldbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
# define lvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
#else
# define ldbgdumpbuffer(m,b,n)
# define lvdbgdumpbuffer(m,b,n)
#endif
/****************************************************************************
* Public Type Declarations
****************************************************************************/
@ -354,6 +434,10 @@ EXTERN int lib_rawprintf(const char *format, ...);
EXTERN int lib_lowprintf(const char *format, ...);
#endif
/* Dump a buffer of data */
EXTERN int lib_dumpbuffer(FAR const char *msg, FAR const ubyte *buffer, unsigned int buflen);
/* If the cross-compiler's pre-processor does not support variable
* length arguments, then these additional APIs will be built.
*/

View file

@ -229,7 +229,7 @@ EXTERN void up_unblock_task(FAR _TCB *tcb);
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
* the task at the the head of the list). It most be
* the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
@ -293,7 +293,7 @@ EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority);
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the the next ready to run task.
* a context switch must be perform to the next ready to run task.
*
* Unlike other UP APIs, this function may be called directly from user
* programs in various states. The implementation of this function should

View file

@ -195,7 +195,7 @@ struct can_ops_s
CODE int (*co_send)(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg);
/* Return TRUE if all message have been sent. If for example, the CAN
* hardware implements FIFOs, then this would mean the the transmit FIFO is
* hardware implements FIFOs, then this would mean the transmit FIFO is
* empty. This method is called when the driver needs to make sure that
* all characters are "drained" from the TX hardware before calling co_shutdown().
*/

View file

@ -140,7 +140,7 @@ extern "C" {
* Initialize the Ethernet driver
*
* Parameters:
* impl - decribes the the implementation of the cs89x00 implementation.
* impl - decribes the implementation of the cs89x00 implementation.
* This reference is retained so so must remain stable throughout the
* life of the driver instance.
* devno - Identifies the device number. This must be a number between

View file

@ -167,7 +167,7 @@ struct uart_ops_s
CODE boolean (*txready)(FAR struct uart_dev_s *dev);
/* Return TRUE if all characters have been sent. If for example, the UART
* hardware implements FIFOs, then this would mean the the transmit FIFO is
* hardware implements FIFOs, then this would mean the transmit FIFO is
* empty. This method is called when the driver needs to make sure that
* all characters are "drained" from the TX hardware.
*/

View file

@ -73,7 +73,7 @@ struct nxflat_hdr_s
/* The following fields provide the memory map for the nxflat binary.
*
* h_entry - Offset to the the first executable insruction from
* h_entry - Offset to the first executable insruction from
* the beginning of the file.
* h_datastart - Offset to the beginning of the data segment from
* the beginning of the file. This field can also

View file

@ -53,7 +53,7 @@ STRING_SRCS = lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memcpy.c \
CTYPE_SRCS =
STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c lib_dbg.c \
STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c \
lib_sprintf.c lib_snprintf.c lib_libsprintf.c lib_vsprintf.c \
lib_vsnprintf.c lib_libvsprintf.c lib_meminstream.c \
lib_memoutstream.c lib_lowinstream.c lib_lowoutstream.c \
@ -93,8 +93,11 @@ SQ_SRCS = sq_addlast.c sq_addfirst.c sq_addafter.c \
DQ_SRCS = dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \
dq_rem.c dq_remlast.c dq_remfirst.c
DBG_SRCS = lib_dbg.c lib_dumpbuffer.c
CSRCS = $(MISC_SRCS) $(STRING_SRCS) $(CTYPE_SRCS) $(STDIO_SRCS) $(STDLIB_SRCS) \
$(MATH_SRCS) $(UNISTD_SRCS) $(NET_SRCS) $(LIBGEN_SRCS) $(SQ_SRCS) $(DQ_SRCS)
$(MATH_SRCS) $(UNISTD_SRCS) $(NET_SRCS) $(LIBGEN_SRCS) $(SQ_SRCS) \
$(DQ_SRCS) $(DBG_SRCS)
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)

View file

@ -55,7 +55,7 @@
* Reduce the size of the chunk specified by the node
* structure to the specified size. this internal logic
* is used both from memalign to dispose of any trailing
* memory in the the aligned allocation and also by realloc
* memory in the aligned allocation and also by realloc
* when there is a request to reduce the size of an allocation.
*
* NOTES:

View file

@ -132,7 +132,7 @@ int netdev_register(FAR struct uip_driver_s *dev)
int devnum;
netdev_semtake();
/* Assign a device name to the the interface */
/* Assign a device name to the interface */
devnum = g_next_devnum++;
snprintf( dev->d_ifname, IFNAMSIZ, "eth%d", devnum );

View file

@ -171,7 +171,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn,
else
{
/* Check if this is a ICMP ECHO reply. If so, return the sequence
* number to the the caller. NOTE: We may not even have sent the
* number to the caller. NOTE: We may not even have sent the
* requested ECHO request; this could have been the delayed ECHO
* response from a previous ping.
*/

View file

@ -120,7 +120,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg)
return -ENOMEM;
}
/* Then add all of the pre-allocated containers to the the free list */
/* Then add all of the pre-allocated containers to the free list */
blc = (FAR struct uip_blcontainer_s*)(((FAR ubyte*)bls) + offset);
for (i = 0; i < nblg; i++)

View file

@ -512,7 +512,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
state = STATE_HAVE_LEASE;
}
/* NAK means the the server has refused our request. Break out of
/* NAK means the server has refused our request. Break out of
* this loop with state == STATE_HAVE_OFFER and send DISCOVER again
*/

View file

@ -127,42 +127,13 @@ struct telnetd_s
****************************************************************************/
#ifdef CONFIG_NETUTILS_TELNETD_DUMPBUFFER
static void telnetd_dumpbuffer(const char *msg, const char *buffer, ssize_t nbytes)
static inline void telnetd_dumpbuffer(FAR const char *msg, FAR const char *buffer, unsigned int nbytes)
{
#ifdef CONFIG_DEBUG
char line[128];
int ch;
int i;
int j;
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
* defined or the following does nothing.
*/
dbg("%s:\n", msg);
for (i = 0; i < nbytes; i += 16)
{
sprintf(line, "%04x: ", i);
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
sprintf(&line[strlen(line)], "%02x ", buffer[i+j] );
}
else
{
strcpy(&line[strlen(line)], " ");
}
}
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
ch = buffer[i+j];
sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
}
}
dbg("%s\n", line);
}
#endif
nvdbgdumpbuffer(msg, (FAR const ubyte*)buffer, nbytes);
}
#else
# define telnetd_dumpbuffer(msg,buffer,nbytes)

View file

@ -161,7 +161,7 @@ extern ssize_t tftp_recvfrom(int sd, void *buf, size_t len, struct sockaddr_in *
extern ssize_t tftp_sendto(int sd, const void *buf, size_t len, struct sockaddr_in *to);
#ifdef CONFIG_NETUTILS_TFTP_DUMPBUFFERS
extern void tftp_dumpbuffer(const char *msg, ubyte *buffer, int nbytes);
# define tftp_dumpbuffer(msg, buffer, nbytes) nvdbgdumpbuffer(msg, buffer, nbytes)
#else
# define tftp_dumpbuffer(msg, buffer, nbytes)
#endif

View file

@ -1,7 +1,7 @@
/****************************************************************************
* netuils/tftp/tftpc_packets.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -326,52 +326,4 @@ ssize_t tftp_sendto(int sd, const void *buf, size_t len, struct sockaddr_in *to)
}
}
/****************************************************************************
* Name: tftp_sendto
*
* Description:
* Dump a buffer of data
*
****************************************************************************/
#ifdef CONFIG_NETUTILS_TFTP_DUMPBUFFERS
void tftp_dumpbuffer(const char *msg, ubyte *buffer, int nbytes)
{
#ifdef CONFIG_DEBUG
char line[128];
int ch;
int i;
int j;
dbg("%s:\n", msg);
for (i = 0; i < nbytes; i += 16)
{
sprintf(line, "%04x: ", i);
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
sprintf(&line[strlen(line)], "%02x ", buffer[i+j] );
}
else
{
strcpy(&line[strlen(line)], " ");
}
}
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
ch = buffer[i+j];
sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
}
}
dbg("%s\n", line);
}
#endif
}
#endif
#endif /* CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS */

View file

@ -115,42 +115,16 @@ static const char g_httpheader404[] =
****************************************************************************/
#ifdef CONFIG_NETUTILS_HTTPD_DUMPBUFFER
static void httpd_dumpbuffer(const char *buffer, ssize_t nbytes)
static void httpd_dumpbuffer(FAR const char *msg, FAR const char *buffer, unsigned int nbytes)
{
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_NET)
char line[128];
int ch;
int i;
int j;
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
* defined or the following does nothing.
*/
for (i = 0; i < nbytes; i += 16)
{
sprintf(line, "%04x: ", i);
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
sprintf(&line[strlen(line)], "%02x ", buffer[i+j] );
}
else
{
strcpy(&line[strlen(line)], " ");
}
}
for ( j = 0; j < 16; j++)
{
if (i + j < nbytes)
{
ch = buffer[i+j];
sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
}
}
nvdbg("%s\n", line);
}
#endif
nvdbgdumpbuffer(msg, (FAR const ubyte*)buffer, nbytes);
}
#else
# define httpd_dumpbuffer(buffer,nbytes)
# define httpd_dumpbuffer(msg,buffer,nbytes)
#endif
#ifdef CONFIG_NETUTILS_HTTPD_DUMPPSTATE
@ -280,7 +254,7 @@ static int httpd_addchunk(struct httpd_state *pstate, const char *buffer, int le
{
/* The buffer is full.. Send what we have and reset to send again */
httpd_dumpbuffer(pstate->ht_buffer, newlen);
httpd_dumpbuffer("Outgoing buffer", pstate->ht_buffer, newlen);
ret = send(pstate->ht_sockfd, pstate->ht_buffer, newlen, 0);
if (ret < 0)
{
@ -382,7 +356,7 @@ static int httpd_sendfile(struct httpd_state *pstate)
if (ret == OK && pstate->ht_sndlen > 0)
{
httpd_dumpbuffer(pstate->ht_buffer, pstate->ht_sndlen);
httpd_dumpbuffer("Outgoing buffer", pstate->ht_buffer, pstate->ht_sndlen);
if (send(pstate->ht_sockfd, pstate->ht_buffer, pstate->ht_sndlen, 0) < 0)
{
ret = ERROR;
@ -405,7 +379,7 @@ static inline int httpd_cmd(struct httpd_state *pstate)
ndbg("[%d] recv failed: %d\n", pstate->ht_sockfd, errno);
return ERROR;
}
httpd_dumpbuffer(pstate->ht_buffer, recvlen);
httpd_dumpbuffer("Incoming buffer", pstate->ht_buffer, recvlen);
/* We will handle only GET */

View file

@ -114,7 +114,7 @@ static void mq_rcvtimeout(int argc, uint32 pid)
wtcb->pterrno = ETIMEDOUT;
/* Restart the the task. */
/* Restart the task. */
up_unblock_task(wtcb);
}

View file

@ -115,7 +115,7 @@ static void mq_sndtimeout(int argc, uint32 pid)
wtcb->pterrno = ETIMEDOUT;
/* Restart the the task. */
/* Restart the task. */
up_unblock_task(wtcb);
}

View file

@ -113,7 +113,7 @@ void mq_waitirq(FAR _TCB *wtcb)
wtcb->pterrno = EINTR;
/* Restart the the task. */
/* Restart the task. */
up_unblock_task(wtcb);
}

View file

@ -81,7 +81,7 @@
* thread.
*
* Upon key creation, the value NULL will be associated with
* the the new key in all active threads. Upon thread
* the new key in all active threads. Upon thread
* creation, the value NULL will be associated with all
* defined keys in the new thread.
*

View file

@ -114,7 +114,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem)
pholder->flink = sem->hlist.flink;
sem->hlist.flink = pholder;
/* Make sure the the initial count is zero */
/* Make sure the initial count is zero */
pholder->counts = 0;
}

View file

@ -117,7 +117,7 @@ void sem_waitirq(FAR _TCB *wtcb)
wtcb->pterrno = EINTR;
/* Restart the the task. */
/* Restart the task. */
up_unblock_task(wtcb);
}

View file

@ -70,7 +70,7 @@
* Function: wd_gettime
*
* Description:
* This function returns the time remaining before the the specified watchdog
* This function returns the time remaining before the specified watchdog
* expires.
*
* Parameters: