Preparing for V9.0.0 formal release:

+ Update various projects to use the latest versions of their build tools.
This commit is contained in:
Richard Barry 2016-05-20 12:18:59 +00:00
parent 0063b29cdf
commit e23eca901d
265 changed files with 5165 additions and 79132 deletions

View file

@ -1,93 +0,0 @@
/*
FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
RSEG ICODE:CODE
CODE32
EXTERN vEMACISR
PUBLIC vEMACISREntry
; Wrapper for the EMAC interrupt service routine. This can cause a
; context switch so requires an assembly wrapper.
; Defines the portSAVE_CONTEXT and portRESTORE_CONTEXT macros.
#include "ISR_Support.h"
vEMACISREntry:
portSAVE_CONTEXT ; Save the context of the current task.
bl vEMACISR ; Call the ISR routine.
portRESTORE_CONTEXT ; Restore the context of the current task -
; which may be different to the task that
; was interrupted.
END

View file

@ -1,738 +0,0 @@
/*
FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/*
* Basic interrupt driven driver for the EMAC peripheral. This driver is not
* reentrant as with uIP the buffers are only ever accessed from a single task.
*
* The simple buffer management used within uIP allows the EMAC driver to also
* be simplistic. The driver contained within the lwIP demo is more
* comprehensive.
*/
/*
Changes from V3.2.2
+ Corrected the byte order when writing the MAC address to the MAC.
+ Support added for MII interfaces. Previously only RMII was supported.
Changes from V3.2.3
+ The MII interface is now the default.
+ Modified the initialisation sequence slightly to allow auto init more
time to complete.
Changes from V3.2.4
+ Also read the EMAC_RSR register in the EMAC ISR as a work around the
the EMAC bug that can reset the RX bit in EMAC_ISR register before the
bit has been read.
Changes from V4.0.4
+ Corrected the Rx frame length mask when obtaining the length from the
rx descriptor.
*/
/* Standard includes. */
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* uIP includes. */
#include "uip.h"
/* Hardware specific includes. */
#include "Emac.h"
#include "mii.h"
/* USE_RMII_INTERFACE must be defined as 1 to use an RMII interface, or 0
to use an MII interface. */
#define USE_RMII_INTERFACE 0
/* The buffer addresses written into the descriptors must be aligned so the
last few bits are zero. These bits have special meaning for the EMAC
peripheral and cannot be used as part of the address. */
#define emacADDRESS_MASK ( ( unsigned long ) 0xFFFFFFFC )
/* Bit used within the address stored in the descriptor to mark the last
descriptor in the array. */
#define emacRX_WRAP_BIT ( ( unsigned long ) 0x02 )
/* Bit used within the Tx descriptor status to indicate whether the
descriptor is under the control of the EMAC or the software. */
#define emacTX_BUF_USED ( ( unsigned long ) 0x80000000 )
/* A short delay is used to wait for a buffer to become available, should
one not be immediately available when trying to transmit a frame. */
#define emacBUFFER_WAIT_DELAY ( 2 )
#define emacMAX_WAIT_CYCLES ( configTICK_RATE_HZ / 40 )
/* Misc defines. */
#define emacINTERRUPT_LEVEL ( 5 )
#define emacNO_DELAY ( 0 )
#define emacTOTAL_FRAME_HEADER_SIZE ( 54 )
#define emacPHY_INIT_DELAY ( 5000 / portTICK_PERIOD_MS )
#define emacRESET_KEY ( ( unsigned long ) 0xA5000000 )
#define emacRESET_LENGTH ( ( unsigned long ) ( 0x01 << 8 ) )
/* The Atmel header file only defines the TX frame length mask. */
#define emacRX_LENGTH_FRAME ( 0xfff )
/*-----------------------------------------------------------*/
/*
* Prototype for the EMAC interrupt asm wrapper.
*/
extern void vEMACISREntry( void );
/*
* Prototype for the EMAC interrupt function - called by the asm wrapper.
*/
__arm void vEMACISR( void );
/*
* Initialise both the Tx and Rx descriptors used by the EMAC.
*/
static void prvSetupDescriptors(void);
/*
* Write our MAC address into the EMAC. The MAC address is set as one of the
* uip options.
*/
static void prvSetupMACAddress( void );
/*
* Configure the EMAC and AIC for EMAC interrupts.
*/
static void prvSetupEMACInterrupt( void );
/*
* Some initialisation functions taken from the Atmel EMAC sample code.
*/
static void vReadPHY( unsigned char ucPHYAddress, unsigned char ucAddress, unsigned long *pulValue );
#if USE_RMII_INTERFACE != 1
static void vWritePHY( unsigned char ucPHYAddress, unsigned char ucAddress, unsigned long ulValue);
#endif
static portBASE_TYPE xGetLinkSpeed( void );
static portBASE_TYPE prvProbePHY( void );
/*-----------------------------------------------------------*/
/* Buffer written to by the EMAC DMA. Must be aligned as described by the
comment above the emacADDRESS_MASK definition. */
#pragma data_alignment=8
static volatile char pcRxBuffer[ NB_RX_BUFFERS * ETH_RX_BUFFER_SIZE ];
/* Buffer read by the EMAC DMA. Must be aligned as described by he comment
above the emacADDRESS_MASK definition. */
#pragma data_alignment=8
static char pcTxBuffer[ NB_TX_BUFFERS * ETH_TX_BUFFER_SIZE ];
/* Descriptors used to communicate between the program and the EMAC peripheral.
These descriptors hold the locations and state of the Rx and Tx buffers. */
static volatile AT91S_TxTdDescriptor xTxDescriptors[ NB_TX_BUFFERS ];
static volatile AT91S_RxTdDescriptor xRxDescriptors[ NB_RX_BUFFERS ];
/* The IP and Ethernet addresses are read from the uIP setup. */
const char cMACAddress[ 6 ] = { UIP_ETHADDR0, UIP_ETHADDR1, UIP_ETHADDR2, UIP_ETHADDR3, UIP_ETHADDR4, UIP_ETHADDR5 };
const unsigned char ucIPAddress[ 4 ] = { UIP_IPADDR0, UIP_IPADDR1, UIP_IPADDR2, UIP_IPADDR3 };
/* The semaphore used by the EMAC ISR to wake the EMAC task. */
static SemaphoreHandle_t xSemaphore = NULL;
/*-----------------------------------------------------------*/
SemaphoreHandle_t xEMACInit( void )
{
/* Code supplied by Atmel (modified) --------------------*/
/* disable pull up on RXDV => PHY normal mode (not in test mode),
PHY has internal pull down. */
AT91C_BASE_PIOB->PIO_PPUDR = 1 << 15;
#if USE_RMII_INTERFACE != 1
/* PHY has internal pull down : set MII mode. */
AT91C_BASE_PIOB->PIO_PPUDR= 1 << 16;
#endif
/* clear PB18 <=> PHY powerdown. */
AT91F_PIO_CfgOutput( AT91C_BASE_PIOB, 1 << 18 ) ;
AT91F_PIO_ClearOutput( AT91C_BASE_PIOB, 1 << 18) ;
/* After PHY power up, hardware reset. */
AT91C_BASE_RSTC->RSTC_RMR = emacRESET_KEY | emacRESET_LENGTH;
AT91C_BASE_RSTC->RSTC_RCR = emacRESET_KEY | AT91C_RSTC_EXTRST;
/* Wait for hardware reset end. */
while( !( AT91C_BASE_RSTC->RSTC_RSR & AT91C_RSTC_NRSTL ) )
{
__asm( "NOP" );
}
__asm( "NOP" );
/* EMAC IO init for EMAC-PHY com. Remove EF100 config. */
AT91F_EMAC_CfgPIO();
/* Enable com between EMAC PHY.
Enable management port. */
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE;
/* MDC = MCK/32. */
AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10;
/* Wait for PHY auto init end (rather crude delay!). */
vTaskDelay( emacPHY_INIT_DELAY );
/* PHY configuration. */
#if USE_RMII_INTERFACE != 1
{
unsigned long ulControl;
/* PHY has internal pull down : disable MII isolate. */
vReadPHY( AT91C_PHY_ADDR, MII_BMCR, &ulControl );
vReadPHY( AT91C_PHY_ADDR, MII_BMCR, &ulControl );
ulControl &= ~BMCR_ISOLATE;
vWritePHY( AT91C_PHY_ADDR, MII_BMCR, ulControl );
}
#endif
/* Disable management port again. */
AT91C_BASE_EMAC->EMAC_NCR &= ~AT91C_EMAC_MPE;
#if USE_RMII_INTERFACE != 1
/* Enable EMAC in MII mode, enable clock ERXCK and ETXCK. */
AT91C_BASE_EMAC->EMAC_USRIO = AT91C_EMAC_CLKEN ;
#else
/* Enable EMAC in RMII mode, enable RMII clock (50MHz from oscillator
on ERFCK). */
AT91C_BASE_EMAC->EMAC_USRIO = AT91C_EMAC_RMII | AT91C_EMAC_CLKEN ;
#endif
/* End of code supplied by Atmel ------------------------*/
/* Setup the buffers and descriptors. */
prvSetupDescriptors();
/* Load our MAC address into the EMAC. */
prvSetupMACAddress();
/* Try to connect. */
if( prvProbePHY() )
{
/* Enable the interrupt! */
prvSetupEMACInterrupt();
}
return xSemaphore;
}
/*-----------------------------------------------------------*/
long lEMACSend( void )
{
static unsigned portBASE_TYPE uxTxBufferIndex = 0;
portBASE_TYPE xWaitCycles = 0;
long lReturn = pdPASS;
char *pcBuffer;
/* Is a buffer available? */
while( !( xTxDescriptors[ uxTxBufferIndex ].U_Status.status & AT91C_TRANSMIT_OK ) )
{
/* There is no room to write the Tx data to the Tx buffer. Wait a
short while, then try again. */
xWaitCycles++;
if( xWaitCycles > emacMAX_WAIT_CYCLES )
{
/* Give up. */
lReturn = pdFAIL;
break;
}
else
{
vTaskDelay( emacBUFFER_WAIT_DELAY );
}
}
/* lReturn will only be pdPASS if a buffer is available. */
if( lReturn == pdPASS )
{
/* Copy the headers into the Tx buffer. These will be in the uIP buffer. */
pcBuffer = ( char * ) xTxDescriptors[ uxTxBufferIndex ].addr;
memcpy( ( void * ) pcBuffer, ( void * ) uip_buf, emacTOTAL_FRAME_HEADER_SIZE );
if( uip_len > emacTOTAL_FRAME_HEADER_SIZE )
{
memcpy( ( void * ) &( pcBuffer[ emacTOTAL_FRAME_HEADER_SIZE ] ), ( void * ) uip_appdata, ( uip_len - emacTOTAL_FRAME_HEADER_SIZE ) );
}
/* Send. */
portENTER_CRITICAL();
{
if( uxTxBufferIndex >= ( NB_TX_BUFFERS - 1 ) )
{
/* Fill out the necessary in the descriptor to get the data sent. */
xTxDescriptors[ uxTxBufferIndex ].U_Status.status = ( uip_len & ( unsigned long ) AT91C_LENGTH_FRAME )
| AT91C_LAST_BUFFER
| AT91C_TRANSMIT_WRAP;
uxTxBufferIndex = 0;
}
else
{
/* Fill out the necessary in the descriptor to get the data sent. */
xTxDescriptors[ uxTxBufferIndex ].U_Status.status = ( uip_len & ( unsigned long ) AT91C_LENGTH_FRAME )
| AT91C_LAST_BUFFER;
uxTxBufferIndex++;
}
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_TSTART;
}
portEXIT_CRITICAL();
}
return lReturn;
}
/*-----------------------------------------------------------*/
unsigned long ulEMACPoll( void )
{
static unsigned portBASE_TYPE ulNextRxBuffer = 0;
unsigned long ulSectionLength = 0, ulLengthSoFar = 0, ulEOF = pdFALSE;
char *pcSource;
/* Skip any fragments. */
while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !( xRxDescriptors[ ulNextRxBuffer ].U_Status.status & AT91C_SOF ) )
{
/* Mark the buffer as free again. */
xRxDescriptors[ ulNextRxBuffer ].addr &= ~( AT91C_OWNERSHIP_BIT );
ulNextRxBuffer++;
if( ulNextRxBuffer >= NB_RX_BUFFERS )
{
ulNextRxBuffer = 0;
}
}
/* Is there a packet ready? */
while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !ulSectionLength )
{
pcSource = ( char * )( xRxDescriptors[ ulNextRxBuffer ].addr & emacADDRESS_MASK );
ulSectionLength = xRxDescriptors[ ulNextRxBuffer ].U_Status.status & emacRX_LENGTH_FRAME;
if( ulSectionLength == 0 )
{
/* The frame is longer than the buffer pointed to by this
descriptor so copy the entire buffer to uIP - then move onto
the next descriptor to get the rest of the frame. */
if( ( ulLengthSoFar + ETH_RX_BUFFER_SIZE ) <= UIP_BUFSIZE )
{
memcpy( &( uip_buf[ ulLengthSoFar ] ), pcSource, ETH_RX_BUFFER_SIZE );
ulLengthSoFar += ETH_RX_BUFFER_SIZE;
}
}
else
{
/* This is the last section of the frame. Copy the section to
uIP. */
if( ulSectionLength < UIP_BUFSIZE )
{
/* The section length holds the length of the entire frame.
ulLengthSoFar holds the length of the frame sections already
copied to uIP, so the length of the final section is
ulSectionLength - ulLengthSoFar; */
if( ulSectionLength > ulLengthSoFar )
{
memcpy( &( uip_buf[ ulLengthSoFar ] ), pcSource, ( ulSectionLength - ulLengthSoFar ) );
}
}
/* Is this the last buffer for the frame? If not why? */
ulEOF = xRxDescriptors[ ulNextRxBuffer ].U_Status.status & AT91C_EOF;
}
/* Mark the buffer as free again. */
xRxDescriptors[ ulNextRxBuffer ].addr &= ~( AT91C_OWNERSHIP_BIT );
/* Increment to the next buffer, wrapping if necessary. */
ulNextRxBuffer++;
if( ulNextRxBuffer >= NB_RX_BUFFERS )
{
ulNextRxBuffer = 0;
}
}
/* If we obtained data but for some reason did not find the end of the
frame then discard the data as it must contain an error. */
if( !ulEOF )
{
ulSectionLength = 0;
}
return ulSectionLength;
}
/*-----------------------------------------------------------*/
static void prvSetupDescriptors(void)
{
unsigned portBASE_TYPE xIndex;
unsigned long ulAddress;
/* Initialise xRxDescriptors descriptor. */
for( xIndex = 0; xIndex < NB_RX_BUFFERS; ++xIndex )
{
/* Calculate the address of the nth buffer within the array. */
ulAddress = ( unsigned long )( pcRxBuffer + ( xIndex * ETH_RX_BUFFER_SIZE ) );
/* Write the buffer address into the descriptor. The DMA will place
the data at this address when this descriptor is being used. Mask off
the bottom bits of the address as these have special meaning. */
xRxDescriptors[ xIndex ].addr = ulAddress & emacADDRESS_MASK;
}
/* The last buffer has the wrap bit set so the EMAC knows to wrap back
to the first buffer. */
xRxDescriptors[ NB_RX_BUFFERS - 1 ].addr |= emacRX_WRAP_BIT;
/* Initialise xTxDescriptors. */
for( xIndex = 0; xIndex < NB_TX_BUFFERS; ++xIndex )
{
/* Calculate the address of the nth buffer within the array. */
ulAddress = ( unsigned long )( pcTxBuffer + ( xIndex * ETH_TX_BUFFER_SIZE ) );
/* Write the buffer address into the descriptor. The DMA will read
data from here when the descriptor is being used. */
xTxDescriptors[ xIndex ].addr = ulAddress & emacADDRESS_MASK;
xTxDescriptors[ xIndex ].U_Status.status = AT91C_TRANSMIT_OK;
}
/* The last buffer has the wrap bit set so the EMAC knows to wrap back
to the first buffer. */
xTxDescriptors[ NB_TX_BUFFERS - 1 ].U_Status.status = AT91C_TRANSMIT_WRAP | AT91C_TRANSMIT_OK;
/* Tell the EMAC where to find the descriptors. */
AT91C_BASE_EMAC->EMAC_RBQP = ( unsigned long ) xRxDescriptors;
AT91C_BASE_EMAC->EMAC_TBQP = ( unsigned long ) xTxDescriptors;
/* Clear all the bits in the receive status register. */
AT91C_BASE_EMAC->EMAC_RSR = ( AT91C_EMAC_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA );
/* Enable the copy of data into the buffers, ignore broadcasts,
and don't copy FCS. */
AT91C_BASE_EMAC->EMAC_NCFGR |= ( AT91C_EMAC_CAF | AT91C_EMAC_NBC | AT91C_EMAC_DRFCS);
/* Enable Rx and Tx, plus the stats register. */
AT91C_BASE_EMAC->EMAC_NCR |= ( AT91C_EMAC_TE | AT91C_EMAC_RE | AT91C_EMAC_WESTAT );
}
/*-----------------------------------------------------------*/
static void prvSetupMACAddress( void )
{
/* Must be written SA1L then SA1H. */
AT91C_BASE_EMAC->EMAC_SA1L = ( ( unsigned long ) cMACAddress[ 3 ] << 24 ) |
( ( unsigned long ) cMACAddress[ 2 ] << 16 ) |
( ( unsigned long ) cMACAddress[ 1 ] << 8 ) |
cMACAddress[ 0 ];
AT91C_BASE_EMAC->EMAC_SA1H = ( ( unsigned long ) cMACAddress[ 5 ] << 8 ) |
cMACAddress[ 4 ];
}
/*-----------------------------------------------------------*/
static void prvSetupEMACInterrupt( void )
{
/* Create the semaphore used to trigger the EMAC task. */
vSemaphoreCreateBinary( xSemaphore );
if( xSemaphore )
{
/* We start by 'taking' the semaphore so the ISR can 'give' it when the
first interrupt occurs. */
xSemaphoreTake( xSemaphore, emacNO_DELAY );
portENTER_CRITICAL();
{
/* We want to interrupt on Rx events. */
AT91C_BASE_EMAC->EMAC_IER = AT91C_EMAC_RCOMP;
/* Enable the interrupts in the AIC. */
AT91F_AIC_ConfigureIt( AT91C_BASE_AIC, AT91C_ID_EMAC, emacINTERRUPT_LEVEL, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, ( void (*)( void ) ) vEMACISREntry );
AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_EMAC );
}
portEXIT_CRITICAL();
}
}
/*-----------------------------------------------------------*/
__arm void vEMACISR( void )
{
volatile unsigned long ulIntStatus, ulRxStatus;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
ulIntStatus = AT91C_BASE_EMAC->EMAC_ISR;
ulRxStatus = AT91C_BASE_EMAC->EMAC_RSR;
if( ( ulIntStatus & AT91C_EMAC_RCOMP ) || ( ulRxStatus & AT91C_EMAC_REC ) )
{
/* A frame has been received, signal the uIP task so it can process
the Rx descriptors. */
xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken );
AT91C_BASE_EMAC->EMAC_RSR = AT91C_EMAC_REC;
}
/* If a task was woken by either a character being received or a character
being transmitted then we may need to switch to another task. */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
/* Clear the interrupt. */
AT91C_BASE_AIC->AIC_EOICR = 0;
}
/*-----------------------------------------------------------*/
/*
* The following functions are initialisation functions taken from the Atmel
* EMAC sample code.
*/
static portBASE_TYPE prvProbePHY( void )
{
unsigned long ulPHYId1, ulPHYId2, ulStatus;
portBASE_TYPE xReturn = pdPASS;
/* Code supplied by Atmel (reformatted) -----------------*/
/* Enable management port */
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE;
AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10;
/* Read the PHY ID. */
vReadPHY( AT91C_PHY_ADDR, MII_PHYSID1, &ulPHYId1 );
vReadPHY( AT91C_PHY_ADDR, MII_PHYSID2, &ulPHYId2 );
/* AMD AM79C875:
PHY_ID1 = 0x0022
PHY_ID2 = 0x5541
Bits 3:0 Revision Number Four bit manufacturers revision number.
0001 stands for Rev. A, etc.
*/
if( ( ( ulPHYId1 << 16 ) | ( ulPHYId2 & 0xfff0 ) ) != MII_DM9161_ID )
{
/* Did not expect this ID. */
xReturn = pdFAIL;
}
else
{
ulStatus = xGetLinkSpeed();
if( ulStatus != pdPASS )
{
xReturn = pdFAIL;
}
}
/* Disable management port */
AT91C_BASE_EMAC->EMAC_NCR &= ~AT91C_EMAC_MPE;
/* End of code supplied by Atmel ------------------------*/
return xReturn;
}
/*-----------------------------------------------------------*/
static void vReadPHY( unsigned char ucPHYAddress, unsigned char ucAddress, unsigned long *pulValue )
{
/* Code supplied by Atmel (reformatted) ----------------------*/
AT91C_BASE_EMAC->EMAC_MAN = (AT91C_EMAC_SOF & (0x01<<30))
| (2 << 16) | (2 << 28)
| ((ucPHYAddress & 0x1f) << 23)
| (ucAddress << 18);
/* Wait until IDLE bit in Network Status register is cleared. */
while( !( AT91C_BASE_EMAC->EMAC_NSR & AT91C_EMAC_IDLE ) )
{
__asm( "NOP" );
}
*pulValue = ( AT91C_BASE_EMAC->EMAC_MAN & 0x0000ffff );
/* End of code supplied by Atmel ------------------------*/
}
/*-----------------------------------------------------------*/
#if USE_RMII_INTERFACE != 1
static void vWritePHY( unsigned char ucPHYAddress, unsigned char ucAddress, unsigned long ulValue )
{
/* Code supplied by Atmel (reformatted) ----------------------*/
AT91C_BASE_EMAC->EMAC_MAN = (( AT91C_EMAC_SOF & (0x01<<30))
| (2 << 16) | (1 << 28)
| ((ucPHYAddress & 0x1f) << 23)
| (ucAddress << 18))
| (ulValue & 0xffff);
/* Wait until IDLE bit in Network Status register is cleared */
while( !( AT91C_BASE_EMAC->EMAC_NSR & AT91C_EMAC_IDLE ) )
{
__asm( "NOP" );
};
/* End of code supplied by Atmel ------------------------*/
}
#endif
/*-----------------------------------------------------------*/
static portBASE_TYPE xGetLinkSpeed( void )
{
unsigned long ulBMSR, ulBMCR, ulLPA, ulMACCfg, ulSpeed, ulDuplex;
/* Code supplied by Atmel (reformatted) -----------------*/
/* Link status is latched, so read twice to get current value */
vReadPHY(AT91C_PHY_ADDR, MII_BMSR, &ulBMSR);
vReadPHY(AT91C_PHY_ADDR, MII_BMSR, &ulBMSR);
if( !( ulBMSR & BMSR_LSTATUS ) )
{
/* No Link. */
return pdFAIL;
}
vReadPHY(AT91C_PHY_ADDR, MII_BMCR, &ulBMCR);
if (ulBMCR & BMCR_ANENABLE)
{
/* AutoNegotiation is enabled. */
if (!(ulBMSR & BMSR_ANEGCOMPLETE))
{
/* Auto-negotiation in progress. */
return pdFAIL;
}
vReadPHY(AT91C_PHY_ADDR, MII_LPA, &ulLPA);
if( ( ulLPA & LPA_100FULL ) || ( ulLPA & LPA_100HALF ) )
{
ulSpeed = SPEED_100;
}
else
{
ulSpeed = SPEED_10;
}
if( ( ulLPA & LPA_100FULL ) || ( ulLPA & LPA_10FULL ) )
{
ulDuplex = DUPLEX_FULL;
}
else
{
ulDuplex = DUPLEX_HALF;
}
}
else
{
ulSpeed = ( ulBMCR & BMCR_SPEED100 ) ? SPEED_100 : SPEED_10;
ulDuplex = ( ulBMCR & BMCR_FULLDPLX ) ? DUPLEX_FULL : DUPLEX_HALF;
}
/* Update the MAC */
ulMACCfg = AT91C_BASE_EMAC->EMAC_NCFGR & ~( AT91C_EMAC_SPD | AT91C_EMAC_FD );
if( ulSpeed == SPEED_100 )
{
if( ulDuplex == DUPLEX_FULL )
{
/* 100 Full Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_SPD | AT91C_EMAC_FD;
}
else
{
/* 100 Half Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_SPD;
}
}
else
{
if (ulDuplex == DUPLEX_FULL)
{
/* 10 Full Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_FD;
}
else
{
/* 10 Half Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg;
}
}
/* End of code supplied by Atmel ------------------------*/
return pdPASS;
}

View file

@ -1,24 +0,0 @@
#ifndef SAM_7_EMAC_H
#define SAM_7_EMAC_H
/*
* Initialise the EMAC driver. If successful a semaphore is returned that
* is used by the EMAC ISR to indicate that Rx packets have been received.
* If the initialisation fails then NULL is returned.
*/
SemaphoreHandle_t xEMACInit( void );
/*
* Send the current uIP buffer. This copies the uIP buffer to one of the
* EMAC Tx buffers, then indicates to the EMAC that the buffer is ready.
*/
long lEMACSend( void );
/*
* Called in response to an EMAC Rx interrupt. Copies the received frame
* into the uIP buffer.
*/
unsigned long ulEMACPoll( void );
#endif

View file

@ -1,123 +0,0 @@
/*
FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <intrinsics.h>
#include "Board.h"
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 47923200 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 22000 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
#define configQUEUE_REGISTRY_SIZE 10
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
/* This demo makes use of one or more example stats formatting functions. These
format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
#endif /* FREERTOS_CONFIG_H */

View file

@ -1,118 +0,0 @@
/*
FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#include "FreeRTOS.h"
#include "partest.h"
#include "board.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's. LED's can be set, cleared
* or toggled.
*-----------------------------------------------------------*/
const unsigned long ulLED_MASK[ NB_LED ]= { LED1, LED2, LED3, LED4 };
void vParTestInitialise( void )
{
/* Start with all LED's off. */
AT91F_PIO_SetOutput( AT91C_BASE_PIOB, LED_MASK );
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < ( portBASE_TYPE ) NB_LED )
{
if( xValue )
{
AT91F_PIO_SetOutput( AT91C_BASE_PIOB, ulLED_MASK[ uxLED ] );
}
else
{
AT91F_PIO_ClearOutput( AT91C_BASE_PIOB, ulLED_MASK[ uxLED ]);
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < ( portBASE_TYPE ) NB_LED )
{
if( AT91F_PIO_GetInput( AT91C_BASE_PIOB ) & ulLED_MASK[ uxLED ] )
{
AT91F_PIO_ClearOutput( AT91C_BASE_PIOB, ulLED_MASK[ uxLED ]);
}
else
{
AT91F_PIO_SetOutput( AT91C_BASE_PIOB, ulLED_MASK[ uxLED ] );
}
}
}

View file

@ -0,0 +1,5 @@
If you need the demo that used to be in this directory then download FreeRTOS V8.2.3
from http://sourceforge.net/projects/freertos/files/FreeRTOS/
FreeRTOS now uses its own TCP/IP stack: http://www.FreeRTOS.org/TCP

View file

@ -1,69 +0,0 @@
/*----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support - ROUSSET -
*----------------------------------------------------------------------------
* The software is delivered "AS IS" without warranty or condition of any
* kind, either express, implied or statutory. This includes without
* limitation any warranty or condition with respect to merchantability or
* fitness for any particular purpose, or against the infringements of
* intellectual property rights of others.
*----------------------------------------------------------------------------
* File Name : Board.h
* Object : AT91SAM7X Evaluation Board Features Definition File.
*
* Creation : JG 20/Jun/2005
*----------------------------------------------------------------------------
*/
#ifndef Board_h
#define Board_h
#include <AT91SAM7X256.h>
#define __inline static inline
#include <lib_AT91SAM7X256.h>
#define true -1
#define false 0
/*-------------------------------*/
/* SAM7Board Memories Definition */
/*-------------------------------*/
// The AT91SAM7X128 embeds a 32-Kbyte SRAM bank, and 128K-Byte Flash
#define FLASH_PAGE_NB 256
#define FLASH_PAGE_SIZE 128
/*-----------------*/
/* Leds Definition */
/*-----------------*/
#define LED1 (1<<19) // PB19
#define LED2 (1<<20) // PB20
#define LED3 (1<<21) // PB21
#define LED4 (1<<22) // PB22
#define NB_LED 4
#define LED_MASK (LED1|LED2|LED3|LED4)
/*-------------------------*/
/* Push Buttons Definition */
/*-------------------------*/
#define SW1_MASK (1<<21) // PA21
#define SW2_MASK (1<<22) // PA22
#define SW3_MASK (1<<23) // PA23
#define SW4_MASK (1<<24) // PA24
#define SW_MASK (SW1_MASK|SW2_MASK|SW3_MASK|SW4_MASK)
#define SW1 (1<<21) // PA21
#define SW2 (1<<22) // PA22
#define SW3 (1<<23) // PA23
#define SW4 (1<<24) // PA24
/*--------------*/
/* Master Clock */
/*--------------*/
#define EXT_OC 18432000 // Exetrnal ocilator MAINCK
#define MCK 47923200 // MCK (PLLRC div by 2)
#define MCKKHz (MCK/1000) //
#endif /* Board_h */

View file

@ -1,302 +0,0 @@
;* ----------------------------------------------------------------------------
;* ATMEL Microcontroller Software Support - ROUSSET -
;* ----------------------------------------------------------------------------
;* Copyright (c) 2006, Atmel Corporation
;
;* All rights reserved.
;*
;* Redistribution and use in source and binary forms, with or without
;* modification, are permitted provided that the following conditions are met:
;*
;* - Redistributions of source code must retain the above copyright notice,
;* this list of conditions and the disclaimer below.
;*
;* - Redistributions in binary form must reproduce the above copyright notice,
;* this list of conditions and the disclaimer below in the documentation and/or
;* other materials provided with the distribution.
;*
;* Atmel's name may not be used to endorse or promote products derived from
;* this software without specific prior written permission.
;*
;* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
;* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
;* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
;* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
;* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
;* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
;* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
;* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;* ----------------------------------------------------------------------------
;------------------------------------------------------------------------------
; Include your AT91 Library files
;------------------------------------------------------------------------------
#include "AT91SAM7X256_inc.h"
;------------------------------------------------------------------------------
#define TOP_OF_MEMORY (AT91C_ISRAM + AT91C_ISRAM_SIZE)
#define IRQ_STACK_SIZE 200
; 3 words to be saved per interrupt priority level
; Mode, correspords to bits 0-5 in CPSR
MODE_BITS DEFINE 0x1F ; Bit mask for mode bits in CPSR
USR_MODE DEFINE 0x10 ; User mode
FIQ_MODE DEFINE 0x11 ; Fast Interrupt Request mode
IRQ_MODE DEFINE 0x12 ; Interrupt Request mode
SVC_MODE DEFINE 0x13 ; Supervisor mode
ABT_MODE DEFINE 0x17 ; Abort mode
UND_MODE DEFINE 0x1B ; Undefined Instruction mode
SYS_MODE DEFINE 0x1F ; System mode
I_BIT DEFINE 0x80
F_BIT DEFINE 0x40
;------------------------------------------------------------------------------
; ?RESET
; Reset Vector.
; Normally, segment INTVEC is linked at address 0.
; For debugging purposes, INTVEC may be placed at other addresses.
; A debugger that honors the entry point will start the
; program in a normal way even if INTVEC is not at address 0.
;------------------------------------------------------------------------------
SECTION .intvec:CODE:NOROOT(2)
PUBLIC __vector
PUBLIC __iar_program_start
EXTERN vPortYieldProcessor
ARM
__vector:
ldr pc,[pc,#+24] ;; Reset
__und_handler:
ldr pc,[pc,#+24] ;; Undefined instructions
__swi_handler:
ldr pc,[pc,#+24] ;; Software interrupt (SWI/SVC)
__prefetch_handler:
ldr pc,[pc,#+24] ;; Prefetch abort
__data_handler:
ldr pc,[pc,#+24] ;; Data abort
DC32 0xFFFFFFFF ;; RESERVED
__irq_handler:
LDR PC, [PC, #-0xF20]
__fiq_handler:
ldr pc,[pc,#+24] ;; FIQ
DC32 __iar_program_start
DC32 __und_handler
DC32 vPortYieldProcessor
DC32 __prefetch_handler
DC32 __data_handler
B .
DC32 IRQ_Handler_Entry
DC32 FIQ_Handler_Entry
;------------------------------------------------------------------------------
;- Manage exception: The exception must be ensure in ARM mode
;------------------------------------------------------------------------------
SECTION text:CODE:NOROOT(2)
ARM
;------------------------------------------------------------------------------
;- Function : FIQ_Handler_Entry
;- Treatments : FIQ Controller Interrupt Handler.
;- R8 is initialize in Cstartup
;- Called Functions : None only by FIQ
;------------------------------------------------------------------------------
FIQ_Handler_Entry:
;- Switch in SVC/User Mode to allow User Stack access for C code
; because the FIQ is not yet acknowledged
;- Save and r0 in FIQ_Register
mov r9,r0
ldr r0 , [r8, #AIC_FVR]
msr CPSR_c,#I_BIT | F_BIT | SVC_MODE
;- Save scratch/used registers and LR in User Stack
stmfd sp!, { r1-r3, r12, lr}
;- Branch to the routine pointed by the AIC_FVR
mov r14, pc
bx r0
;- Restore scratch/used registers and LR from User Stack
ldmia sp!, { r1-r3, r12, lr}
;- Leave Interrupts disabled and switch back in FIQ mode
msr CPSR_c, #I_BIT | F_BIT | FIQ_MODE
;- Restore the R0 ARM_MODE_SVC register
mov r0,r9
;- Restore the Program Counter using the LR_fiq directly in the PC
subs pc,lr,#4
;------------------------------------------------------------------------------
;- Function : IRQ_Handler_Entry
;- Treatments : IRQ Controller Interrupt Handler.
;- Called Functions : AIC_IVR[interrupt]
;------------------------------------------------------------------------------
IRQ_Handler_Entry:
;-------------------------
;- Manage Exception Entry
;-------------------------
;- Adjust and save LR_irq in IRQ stack
sub lr, lr, #4
stmfd sp!, {lr}
;- Save r0 and SPSR (need to be saved for nested interrupt)
mrs r14, SPSR
stmfd sp!, {r0,r14}
;- Write in the IVR to support Protect Mode
;- No effect in Normal Mode
;- De-assert the NIRQ and clear the source in Protect Mode
ldr r14, =AT91C_BASE_AIC
ldr r0 , [r14, #AIC_IVR]
str r14, [r14, #AIC_IVR]
;- Enable Interrupt and Switch in Supervisor Mode
msr CPSR_c, #SVC_MODE
;- Save scratch/used registers and LR in User Stack
stmfd sp!, { r1-r3, r12, r14}
;----------------------------------------------
;- Branch to the routine pointed by the AIC_IVR
;----------------------------------------------
mov r14, pc
bx r0
;----------------------------------------------
;- Manage Exception Exit
;----------------------------------------------
;- Restore scratch/used registers and LR from User Stack
ldmia sp!, { r1-r3, r12, r14}
;- Disable Interrupt and switch back in IRQ mode
msr CPSR_c, #I_BIT | IRQ_MODE
;- Mark the End of Interrupt on the AIC
ldr r14, =AT91C_BASE_AIC
str r14, [r14, #AIC_EOICR]
;- Restore SPSR_irq and r0 from IRQ stack
ldmia sp!, {r0,r14}
msr SPSR_cxsf, r14
;- Restore adjusted LR_irq from IRQ stack directly in the PC
ldmia sp!, {pc}^
;------------------------------------------------------------------------------
;- Exception Vectors
;------------------------------------------------------------------------------
PUBLIC AT91F_Default_FIQ_handler
PUBLIC AT91F_Default_IRQ_handler
PUBLIC AT91F_Spurious_handler
ARM ; Always ARM mode after exeption
AT91F_Default_FIQ_handler
b AT91F_Default_FIQ_handler
AT91F_Default_IRQ_handler
b AT91F_Default_IRQ_handler
AT91F_Spurious_handler
b AT91F_Spurious_handler
;------------------------------------------------------------------------------
; ?INIT
; Program entry.
;------------------------------------------------------------------------------
SECTION FIQ_STACK:DATA:NOROOT(3)
SECTION IRQ_STACK:DATA:NOROOT(3)
SECTION SVC_STACK:DATA:NOROOT(3)
SECTION ABT_STACK:DATA:NOROOT(3)
SECTION UND_STACK:DATA:NOROOT(3)
SECTION CSTACK:DATA:NOROOT(3)
SECTION text:CODE:NOROOT(2)
REQUIRE __vector
EXTERN ?main
PUBLIC __iar_program_start
EXTERN AT91F_LowLevelInit
__iar_program_start:
;------------------------------------------------------------------------------
;- Low level Init is performed in a C function: AT91F_LowLevelInit
;- Init Stack Pointer to a valid memory area before calling AT91F_LowLevelInit
;------------------------------------------------------------------------------
;- Retrieve end of RAM address
ldr r13,=TOP_OF_MEMORY ;- Temporary stack in internal RAM for Low Level Init execution
ldr r0,=AT91F_LowLevelInit
mov lr, pc
bx r0 ;- Branch on C function (with interworking)
; Initialize the stack pointers.
; The pattern below can be used for any of the exception stacks:
; FIQ, IRQ, SVC, ABT, UND, SYS.
; The USR mode uses the same stack as SYS.
; The stack segments must be defined in the linker command file,
; and be declared above.
mrs r0,cpsr ; Original PSR value
bic r0,r0,#MODE_BITS ; Clear the mode bits
orr r0,r0,#SVC_MODE ; Set SVC mode bits
msr cpsr_c,r0 ; Change the mode
ldr sp,=SFE(SVC_STACK) ; End of SVC_STACK
bic r0,r0,#MODE_BITS ; Clear the mode bits
orr r0,r0,#UND_MODE ; Set UND mode bits
msr cpsr_c,r0 ; Change the mode
ldr sp,=SFE(UND_STACK) ; End of UND_STACK
bic r0,r0,#MODE_BITS ; Clear the mode bits
orr r0,r0,#ABT_MODE ; Set ABT mode bits
msr cpsr_c,r0 ; Change the mode
ldr sp,=SFE(ABT_STACK) ; End of ABT_STACK
bic r0,r0,#MODE_BITS ; Clear the mode bits
orr r0,r0,#FIQ_MODE ; Set FIQ mode bits
msr cpsr_c,r0 ; Change the mode
ldr sp,=SFE(FIQ_STACK) ; End of FIQ_STACK
;- Init the FIQ register
ldr r8, =AT91C_BASE_AIC
bic r0,r0,#MODE_BITS ; Clear the mode bits
orr r0,r0,#IRQ_MODE ; Set IRQ mode bits
msr cpsr_c,r0 ; Change the mode
ldr sp,=SFE(IRQ_STACK) ; End of IRQ_STACK
bic r0,r0,#MODE_BITS ; Clear the mode bits
orr r0,r0,#SYS_MODE ; Set System mode bits
msr cpsr_c,r0 ; Change the mode
ldr sp,=SFE(CSTACK) ; End of CSTACK
#ifdef __ARMVFP__
; Enable the VFP coprocessor.
mov r0, #0x40000000 ; Set EN bit in VFP
fmxr fpexc, r0 ; FPEXC, clear others.
; Disable underflow exceptions by setting flush to zero mode.
; For full IEEE 754 underflow compliance this code should be removed
; and the appropriate exception handler installed.
mov r0, #0x01000000 ; Set FZ bit in VFP
fmxr fpscr, r0 ; FPSCR, clear others.
#endif
; Add more initialization here
msr CPSR_c,#I_BIT | F_BIT | SVC_MODE
; Continue to ?main for more IAR specific system startup
ldr r0,=?main
bx r0
END ;- Terminates the assembly of the last module in a file

View file

@ -1,97 +0,0 @@
//-----------------------------------------------------------------------------
// ATMEL Microcontroller Software Support - ROUSSET -
//-----------------------------------------------------------------------------
// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
// DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
// File Name : Cstartup_SAM7.c
// Object : Low level initialisations written in C for Tools
// For AT91SAM7X256 with 2 flash plane
// Creation : JPP 14-Sep-2006
//-----------------------------------------------------------------------------
#include "Board.h"
// The following functions must be write in ARM mode this function called
// directly by exception vector
extern void AT91F_Spurious_handler(void);
extern void AT91F_Default_IRQ_handler(void);
extern void AT91F_Default_FIQ_handler(void);
//*----------------------------------------------------------------------------
//* \fn AT91F_LowLevelInit
//* \brief This function performs very low level HW initialization
//* this function can use a Stack, depending the compilation
//* optimization mode
//*----------------------------------------------------------------------------
void AT91F_LowLevelInit(void) @ "ICODE"
{
unsigned char i;
///////////////////////////////////////////////////////////////////////////
// EFC Init
///////////////////////////////////////////////////////////////////////////
AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS ;
///////////////////////////////////////////////////////////////////////////
// Init PMC Step 1. Enable Main Oscillator
// Main Oscillator startup time is board specific:
// Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms
// (0x40 for AT91C_CKGR_OSCOUNT field)
///////////////////////////////////////////////////////////////////////////
AT91C_BASE_PMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x40 <<8) | AT91C_CKGR_MOSCEN ));
// Wait Main Oscillator stabilization
while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS));
///////////////////////////////////////////////////////////////////////////
// Init PMC Step 2.
// Set PLL to 96MHz (96,109MHz) and UDP Clock to 48MHz
// PLL Startup time depends on PLL RC filter: worst case is choosen
// UDP Clock (48,058MHz) is compliant with the Universal Serial Bus
// Specification (+/- 0.25% for full speed)
///////////////////////////////////////////////////////////////////////////
AT91C_BASE_PMC->PMC_PLLR = AT91C_CKGR_USBDIV_1 |
(16 << 8) |
(AT91C_CKGR_MUL & (72 << 16)) |
(AT91C_CKGR_DIV & 14);
// Wait for PLL stabilization
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCK) );
// Wait until the master clock is established for the case we already
// turn on the PLL
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) );
///////////////////////////////////////////////////////////////////////////
// Init PMC Step 3.
// Selection of Master Clock MCK equal to (Processor Clock PCK) PLL/2=48MHz
// The PMC_MCKR register must not be programmed in a single write operation
// (see. Product Errata Sheet)
///////////////////////////////////////////////////////////////////////////
AT91C_BASE_PMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2;
// Wait until the master clock is established
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) );
AT91C_BASE_PMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK;
// Wait until the master clock is established
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) );
///////////////////////////////////////////////////////////////////////////
// Disable Watchdog (write once register)
///////////////////////////////////////////////////////////////////////////
AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS;
///////////////////////////////////////////////////////////////////////////
// Init AIC: assign corresponding handler for each interrupt source
///////////////////////////////////////////////////////////////////////////
AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ;
for (i = 1; i < 31; i++) {
AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ;
}
AT91C_BASE_AIC->AIC_SPU = (unsigned int) AT91F_Spurious_handler;
}

View file

@ -1,195 +0,0 @@
//*----------------------------------------------------------------------------
//* ATMEL Microcontroller Software Support - ROUSSET -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name : Emac.h
//* Object : Emac header file
//* Creation : Hi 11/18/2002
//*
//*----------------------------------------------------------------------------
#ifndef AT91C_EMAC_H
#define AT91C_EMAC_H
//* Allows to display all IP header in the main.c
//* If not defined, only ICMP packets are displayed
#define AT91C_DISPLAY_ALL_IPHEADER 0
#define NB_RX_BUFFERS 25 //* Number of receive buffers
#define ETH_RX_BUFFER_SIZE 128 //*
#define NB_TX_BUFFERS 2 //* Number of Transmit buffers
#define ETH_TX_BUFFER_SIZE UIP_BUFSIZE //*
#define AT91C_NO_IPPACKET 0
#define AT91C_IPPACKET 1
#define ARP_REQUEST 0x0001
#define ARP_REPLY 0x0002
#define PROT_ARP 0x0806
#define PROT_IP 0x0800
#define PROT_ICMP 0x01
#define ICMP_ECHO_REQUEST 0x08
#define ICMP_ECHO_REPLY 0x00
#define AT91C_EMAC_CLKEN 0x2
#define SWAP16(x) (((x & 0xff) << 8) | (x >> 8))
#if 0
//* Transfer descriptor structure
typedef struct _AT91S_TdDescriptor {
unsigned int addr;
unsigned int status;
}AT91S_TdDescriptor, *AT91PS_TdDescriptor;
#endif
//* Receive Transfer descriptor structure
typedef struct _AT91S_RxTdDescriptor {
unsigned int addr;
union
{
unsigned int status;
struct {
unsigned int Length:11;
unsigned int Res0:1;
unsigned int Rxbuf_off:2;
unsigned int StartOfFrame:1;
unsigned int EndOfFrame:1;
unsigned int Cfi:1;
unsigned int VlanPriority:3;
unsigned int PriorityTag:1;
unsigned int VlanTag:1;
unsigned int TypeID:1;
unsigned int Sa4Match:1;
unsigned int Sa3Match:1;
unsigned int Sa2Match:1;
unsigned int Sa1Match:1;
unsigned int Res1:1;
unsigned int ExternalAdd:1;
unsigned int UniCast:1;
unsigned int MultiCast:1;
unsigned int BroadCast:1;
}S_Status;
}U_Status;
}AT91S_RxTdDescriptor, *AT91PS_RxTdDescriptor;
//* Transmit Transfer descriptor structure
typedef struct _AT91S_TxTdDescriptor {
unsigned int addr;
union
{
unsigned int status;
struct {
unsigned int Length:11;
unsigned int Res0:4;
unsigned int LastBuff:1;
unsigned int NoCrc:1;
unsigned int Res1:10;
unsigned int BufExhausted:1;
unsigned int TransmitUnderrun:1;
unsigned int TransmitError:1;
unsigned int Wrap:1;
unsigned int BuffUsed:1;
}S_Status;
}U_Status;
}AT91S_TxTdDescriptor, *AT91PS_TxTdDescriptor;
#define AT91C_OWNERSHIP_BIT 0x00000001
/* Receive status defintion */
#define AT91C_BROADCAST_ADDR ((unsigned int) (1 << 31)) //* Broadcat address detected
#define AT91C_MULTICAST_HASH ((unsigned int) (1 << 30)) //* MultiCast hash match
#define AT91C_UNICAST_HASH ((unsigned int) (1 << 29)) //* UniCast hash match
#define AT91C_EXTERNAL_ADDR ((unsigned int) (1 << 28)) //* External Address match
#define AT91C_SA1_ADDR ((unsigned int) (1 << 26)) //* Specific address 1 match
#define AT91C_SA2_ADDR ((unsigned int) (1 << 25)) //* Specific address 2 match
#define AT91C_SA3_ADDR ((unsigned int) (1 << 24)) //* Specific address 3 match
#define AT91C_SA4_ADDR ((unsigned int) (1 << 23)) //* Specific address 4 match
#define AT91C_TYPE_ID ((unsigned int) (1 << 22)) //* Type ID match
#define AT91C_VLAN_TAG ((unsigned int) (1 << 21)) //* VLAN tag detected
#define AT91C_PRIORITY_TAG ((unsigned int) (1 << 20)) //* PRIORITY tag detected
#define AT91C_VLAN_PRIORITY ((unsigned int) (7 << 17)) //* PRIORITY Mask
#define AT91C_CFI_IND ((unsigned int) (1 << 16)) //* CFI indicator
#define AT91C_EOF ((unsigned int) (1 << 15)) //* EOF
#define AT91C_SOF ((unsigned int) (1 << 14)) //* SOF
#define AT91C_RBF_OFFSET ((unsigned int) (3 << 12)) //* Receive Buffer Offset Mask
#define AT91C_LENGTH_FRAME ((unsigned int) 0x07FF) //* Length of frame
/* Transmit Status definition */
#define AT91C_TRANSMIT_OK ((unsigned int) (1 << 31)) //*
#define AT91C_TRANSMIT_WRAP ((unsigned int) (1 << 30)) //* Wrap bit: mark the last descriptor
#define AT91C_TRANSMIT_ERR ((unsigned int) (1 << 29)) //* RLE:transmit error
#define AT91C_TRANSMIT_UND ((unsigned int) (1 << 28)) //* Transmit Underrun
#define AT91C_BUF_EX ((unsigned int) (1 << 27)) //* Buffers exhausted in mid frame
#define AT91C_TRANSMIT_NO_CRC ((unsigned int) (1 << 16)) //* No CRC will be appended to the current frame
#define AT91C_LAST_BUFFER ((unsigned int) (1 << 15)) //*
#define ARP_ETHER 1 /* Ethernet hardware address */
#define ARPOP_REQUEST 1 /* Request to resolve address */
#define ARPOP_REPLY 2 /* Response to previous request */
#define RARPOP_REQUEST 3 /* Request to resolve address */
#define RARPOP_REPLY 4 /* Response to previous request */
typedef struct _AT91S_EthHdr
{
unsigned char et_dest[6]; /* Destination node */
unsigned char et_src[6]; /* Source node */
unsigned short et_protlen; /* Protocol or length */
} AT91S_EthHdr, *AT91PS_EthHdr;
typedef struct _AT91S_ArpHdr
{
unsigned short ar_hrd; /* Format of hardware address */
unsigned short ar_pro; /* Format of protocol address */
unsigned char ar_hln; /* Length of hardware address */
unsigned char ar_pln; /* Length of protocol address */
unsigned short ar_op; /* Operation */
unsigned char ar_sha[6]; /* Sender hardware address */
unsigned char ar_spa[4]; /* Sender protocol address */
unsigned char ar_tha[6]; /* Target hardware address */
unsigned char ar_tpa[4]; /* Target protocol address */
} AT91S_ArpHdr, *AT91PS_ArpHdr;
//* IP Header structure
typedef struct _AT91S_IPheader {
unsigned char ip_hl_v; /* header length and version */
unsigned char ip_tos; /* type of service */
unsigned short ip_len; /* total length */
unsigned short ip_id; /* identification */
unsigned short ip_off; /* fragment offset field */
unsigned char ip_ttl; /* time to live */
unsigned char ip_p; /* protocol */
unsigned short ip_sum; /* checksum */
unsigned char ip_src[4]; /* Source IP address */
unsigned char ip_dst[4]; /* Destination IP address */
unsigned short udp_src; /* UDP source port */
unsigned short udp_dst; /* UDP destination port */
unsigned short udp_len; /* Length of UDP packet */
unsigned short udp_xsum; /* Checksum */
} AT91S_IPheader, *AT91PS_IPheader;
//* ICMP echo header structure
typedef struct _AT91S_IcmpEchoHdr {
unsigned char type; /* type of message */
unsigned char code; /* type subcode */
unsigned short cksum; /* ones complement cksum of struct */
unsigned short id; /* identifier */
unsigned short seq; /* sequence number */
}AT91S_IcmpEchoHdr, *AT91PS_IcmpEchoHdr;
typedef struct _AT91S_EthPack
{
AT91S_EthHdr EthHdr;
AT91S_ArpHdr ArpHdr;
} AT91S_EthPack, *AT91PS_EthPack;
#endif //* AT91C_EMAC_H

View file

@ -1,95 +0,0 @@
//*----------------------------------------------------------------------------
//* ATMEL Microcontroller Software Support - ROUSSET -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name : dbgu.c
//* Object : DBGU routines written in C
//* Creation : JG 16/Aug/2004
//*----------------------------------------------------------------------------
// Include Standard files
#include "Board.h"
//*--------------------------1--------------------------------------------------
//* \fn AT91F_DBGU_Printk
//* \brief This function is used to send a string through the DBGU channel (Very low level debugging)
//*----------------------------------------------------------------------------
void AT91F_DBGU_Printk( char *buffer)
{
AT91PS_DBGU pDbgu = AT91C_BASE_DBGU ;
unsigned int temp;
while(*buffer != '\0')
{
temp=0;
while (temp==0)
{
if ( (pDbgu->DBGU_CSR & 0x0200) == 0)
temp=0;
else
temp=1;
}
pDbgu->DBGU_THR = *buffer;
buffer++;
}
}
void Init_DBGU_CLK(void)
{
AT91F_PMC_EnablePeriphClock(AT91C_BASE_PMC, ((unsigned int) 1 << AT91C_ID_SYS));
}
void Init_DBGU_BGR(unsigned short baud)
{
AT91PS_DBGU pDbgu = AT91C_BASE_DBGU ;
pDbgu->DBGU_BRGR = (unsigned short)baud;
}
void DBGU_TX_Enable(void)
{
AT91PS_DBGU pDbgu = AT91C_BASE_DBGU ;
pDbgu->DBGU_CR = 0x00000040;
}
void DBGU_RX_Enable(void)
{
AT91PS_DBGU pDbgu = AT91C_BASE_DBGU ;
pDbgu->DBGU_CR = 0x00000010;
}
void DBGU_RX_TX_RST_DIS(void)
{
AT91PS_DBGU pDbgu = AT91C_BASE_DBGU ;
pDbgu->DBGU_CR = 0x000000AC;
}
void DBGU_Parity_Cfg(unsigned int par)
{
AT91PS_DBGU pDbgu = AT91C_BASE_DBGU ;
pDbgu->DBGU_MR = par << 9;
}
void Init_DBGU(void)
{
AT91F_DBGU_CfgPIO();
DBGU_RX_TX_RST_DIS();
Init_DBGU_BGR(26); //26 <=> 115kBd
DBGU_Parity_Cfg(4);
DBGU_TX_Enable();
DBGU_RX_Enable();
}

View file

@ -1,22 +0,0 @@
//*----------------------------------------------------------------------------
//* ATMEL Microcontroller Software Support - ROUSSET -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name : dbgu.c
//* Object : DBGU routines written in C
//* Creation : JG 16/Aug/2004
//*----------------------------------------------------------------------------
// Include Standard files
extern void APPLI_DBGU(void);
extern void D1_TEST_REGISTER_RESET_VALUES(void);
extern void D2_CHIP_ID_VALUES(void);

View file

@ -1,31 +0,0 @@
//*----------------------------------------------------------------------------
//* ATMEL Microcontroller Software Support - ROUSSET -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name : init.c
//* Object : Low level initialisations written in C
//* Creation : ODi 06/26/2002
//*
//*----------------------------------------------------------------------------
#include "board.h"
//#include "init.h"
#include <string.h>
//*----------------------------------------------------------------------------
//* \fn AT91F_DBGU_Printk
//* \brief This function is used to send a string through the DBGU channel (Very low level debugging)
//*----------------------------------------------------------------------------
void AT91F_DBGU_Printk(
char *buffer) // \arg pointer to a string ending by \0
{
while(*buffer != '\0') {
while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU));
AT91F_US_PutChar((AT91PS_USART)AT91C_BASE_DBGU, *buffer++);
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,105 +0,0 @@
/* Generic MII registers. */
#define MII_BMCR 0x00 /* Basic mode control register */
#define MII_BMSR 0x01 /* Basic mode status register */
#define MII_PHYSID1 0x02 /* PHYS ID 1 */
#define MII_PHYSID2 0x03 /* PHYS ID 2 */
#define MII_ADVERTISE 0x04 /* Advertisement control reg */
#define MII_LPA 0x05 /* Link partner ability reg */
#define MII_EXPANSION 0x06 /* Expansion register */
#define MII_DCOUNTER 0x12 /* Disconnect counter */
#define MII_FCSCOUNTER 0x13 /* False carrier counter */
#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
#define MII_RERRCOUNTER 0x15 /* Receive error counter */
#define MII_SREVISION 0x16 /* Silicon revision */
#define MII_RESV1 0x17 /* Reserved... */
#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
#define MII_PHYADDR 0x19 /* PHY address */
#define MII_RESV2 0x1a /* Reserved... */
#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
#define MII_NCONFIG 0x1c /* Network interface config */
/* Basic mode control register. */
#define BMCR_RESV 0x007f /* Unused... */
#define BMCR_CTST 0x0080 /* Collision test */
#define BMCR_FULLDPLX 0x0100 /* Full duplex */
#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
#define BMCR_RESET 0x8000 /* Reset the DP83840 */
/* Basic mode status register. */
#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
#define BMSR_JCD 0x0002 /* Jabber detected */
#define BMSR_LSTATUS 0x0004 /* Link status */
#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
#define BMSR_RFAULT 0x0010 /* Remote fault detected */
#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
#define BMSR_RESV 0x07c0 /* Unused... */
#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
/* Advertisement control register. */
#define ADVERTISE_SLCT 0x001f /* Selector bits */
#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
#define ADVERTISE_RESV 0x1c00 /* Unused... */
#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
ADVERTISE_CSMA)
#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
ADVERTISE_100HALF | ADVERTISE_100FULL)
/* Link partner ability register. */
#define LPA_SLCT 0x001f /* Same as advertise selector */
#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
#define LPA_RESV 0x1c00 /* Unused... */
#define LPA_RFAULT 0x2000 /* Link partner faulted */
#define LPA_LPACK 0x4000 /* Link partner acked us */
#define LPA_NPAGE 0x8000 /* Next page bit */
#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
/* Expansion register for auto-negotiation. */
#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
#define EXPANSION_RESV 0xffe0 /* Unused... */
/* N-way test register. */
#define NWAYTEST_RESV1 0x00ff /* Unused... */
#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
#define NWAYTEST_RESV2 0xfe00 /* Unused... */
#define SPEED_10 10
#define SPEED_100 100
/* Duplex, half or full. */
#define DUPLEX_HALF 0x00
#define DUPLEX_FULL 0x01
/* PHY ID */
#define MII_DM9161_ID 0x0181b8a0
#define MII_AM79C875_ID 0x00225540 /* 0x00225541 */
#define AT91C_PHY_ADDR 31

View file

@ -1,289 +0,0 @@
/*
FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/*
* Creates all the application tasks, then starts the scheduler.
*
* A task is also created called "uIP". This executes the uIP stack and small
* WEB server sample. All the other tasks are from the set of standard
* demo tasks. The WEB documentation provides more details of the standard
* demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check the status of all the other demo application
* tasks. LED mainCHECK_LED is toggled every three seconds by the check task
* should no error conditions be detected in any of the standard demo tasks.
* The toggle rate increasing to 500ms indicates that at least one error has
* been detected.
*/
/* Standard includes. */
#include <stdlib.h>
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "partest.h"
#include "PollQ.h"
#include "dynamic.h"
#include "semtest.h"
#include "flash.h"
#include "integer.h"
#include "flop.h"
#include "BlockQ.h"
#include "death.h"
#include "uip_task.h"
/*-----------------------------------------------------------*/
/* Priorities/stacks for the demo application tasks. */
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainUIP_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainFLASH_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainUIP_TASK_STACK_SIZE ( 250 )
/* The rate at which the on board LED will toggle when there is/is not an
error. */
#define mainNO_ERROR_FLASH_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
#define mainERROR_FLASH_PERIOD ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
/* The LED used by the check task to indicate the system status. */
#define mainCHECK_LED ( 3 )
/*-----------------------------------------------------------*/
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file.
*/
static long prvCheckOtherTasksAreStillRunning( void );
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Configure the processor for use with the Atmel demo board. This is very
* minimal as most of the setup is performed in the startup code.
*/
static void prvSetupHardware( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
int main( void )
{
/* Configure the processor. */
prvSetupHardware();
/* Setup the port used to flash the LED's. */
vParTestInitialise();
/* Start the task that handles the TCP/IP and WEB server functionality. */
xTaskCreate( vuIP_TASK, "uIP", mainUIP_TASK_STACK_SIZE, NULL, mainUIP_PRIORITY, NULL );
/* Start the demo/test application tasks. These are created in addition
to the TCP/IP task for demonstration and test purposes. */
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartDynamicPriorityTasks();
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartLEDFlashTasks( mainFLASH_PRIORITY );
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartMathTasks( tskIDLE_PRIORITY );
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
/* Start the check task - which is defined in this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Must be last to get created. */
vCreateSuicidalTasks( mainDEATH_PRIORITY );
/* Now all the tasks have been started - start the scheduler. */
vTaskStartScheduler();
/* Should never reach here because the tasks should now be executing! */
return 0;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
/* When using the JTAG debugger the hardware is not always initialised to
the correct default state. This line just ensures that this does not
cause all interrupts to be masked at the start. */
AT91C_BASE_AIC->AIC_EOICR = 0;
/* Most setup is performed by the low level init function called from the
startup asm file.
Configure the PIO Lines corresponding to LED1 to LED4 to be outputs as
well as the UART Tx line. */
AT91F_PIO_CfgOutput( AT91C_BASE_PIOB, LED_MASK );
/* Enable the peripheral clock. */
AT91F_PMC_EnablePeriphClock( AT91C_BASE_PMC, 1 << AT91C_ID_PIOA );
AT91F_PMC_EnablePeriphClock( AT91C_BASE_PMC, 1 << AT91C_ID_PIOB ) ;
AT91F_PMC_EnablePeriphClock( AT91C_BASE_PMC, 1 << AT91C_ID_EMAC ) ;
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
TickType_t xLastWakeTime;
/* Initialise xLastWakeTime to ensure the first call to vTaskDelayUntil()
functions correctly. */
xLastWakeTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the Check LED flash rate will increase. */
for( ;; )
{
/* Delay until it is time to execute again. The delay period is
shorter following an error. */
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );
/* Check all the standard demo application tasks are executing without
error. */
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
vParTestToggleLED( mainCHECK_LED );
}
}
/*-----------------------------------------------------------*/
static long prvCheckOtherTasksAreStillRunning( void )
{
long lReturn = ( long ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
return lReturn;
}

View file

@ -1,194 +0,0 @@
// ---------------------------------------------------------
// Microcontroller Software Support - ROUSSET -
// ---------------------------------------------------------
// The software is delivered "AS IS" without warranty or
// condition of any kind, either express, implied or
// statutory. This includes without limitation any warranty
// or condition with respect to merchantability or fitness
// for any particular purpose, or against the infringements of
// intellectual property rights of others.
// ---------------------------------------------------------
// File: SAM7.mac
//
// 1.0 08/Mar/04 JPP : Creation
// 1.1 23/Mar/05 JPP : Change Variable name
//
// $Revision: 1.5 $
//
// ---------------------------------------------------------
__var __mac_i;
__var __mac_pt;
execUserReset()
{
AIC();
//* Watchdog Disable
Watchdog();
}
execUserPreload()
{
//* Set the RAM memory at 0x0020 0000 for code AT 0 flash area
CheckRemap();
//* Get the Chip ID (AT91C_DBGU_C1R & AT91C_DBGU_C2R
__mac_i =__readMemory32(0xFFFFF240,"Memory");
__message " ---------------------------------------- Chip ID 0x",__mac_i:%X;
__mac_i =__readMemory32(0xFFFFF244,"Memory");
__message " ---------------------------------------- Extention 0x",__mac_i:%X;
//* Get the chip status
//* Init AIC
AIC();
//* Watchdog Disable
Watchdog();
}
//-----------------------------------------------------------------------------
// Watchdog
//-------------------------------
// Normally, the Watchdog is enable at the reset for load it's preferable to
// Disable.
//-----------------------------------------------------------------------------
Watchdog()
{
//* Watchdog Disable
// AT91C_BASE_WDTC->WDTC_WDMR= AT91C_WDTC_WDDIS;
__writeMemory32(0x00008000,0xFFFFFD44,"Memory");
__message "------------------------------- Watchdog Disable ----------------------------------------";
}
//-----------------------------------------------------------------------------
// Check Remap
//-------------
//-----------------------------------------------------------------------------
CheckRemap()
{
//* Read the value at 0x0
__mac_i =__readMemory32(0x00000000,"Memory");
__mac_i =__mac_i+1;
__writeMemory32(__mac_i,0x00,"Memory");
__mac_pt =__readMemory32(0x00000000,"Memory");
if (__mac_i == __mac_pt)
{
__message "------------------------------- The Remap is done ----------------------------------------";
//* Toggel RESET The remap
__writeMemory32(0x00000001,0xFFFFFF00,"Memory");
} else {
__message "------------------------------- The Remap is NOT -----------------------------------------";
}
}
execUserSetup()
{
ini();
__message "-------------------------------Set PC ----------------------------------------";
__writeMemory32(0x00000000,0xB4,"Register");
}
//-----------------------------------------------------------------------------
// Reset the Interrupt Controller
//-------------------------------
// Normally, the code is executed only if a reset has been actually performed.
// So, the AIC initialization resumes at setting up the default vectors.
//-----------------------------------------------------------------------------
AIC()
{
// Mask All interrupt pAic->AIC_IDCR = 0xFFFFFFFF;
__writeMemory32(0xffffffff,0xFFFFF124,"Memory");
__writeMemory32(0xffffffff,0xFFFFF128,"Memory");
// disable peripheral clock Peripheral Clock Disable Register
__writeMemory32(0xffffffff,0xFFFFFC14,"Memory");
// #define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register
// #define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register
// #define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register
__readMemory32(0xFFFA0020,"Memory");
__readMemory32(0xFFFA0060,"Memory");
__readMemory32(0xFFFA00A0,"Memory");
for (__mac_i=0;__mac_i < 8; __mac_i++)
{
// AT91C_BASE_AIC->AIC_EOICR
__mac_pt = __readMemory32(0xFFFFF130,"Memory");
}
__message "------------------------------- AIC 2 INIT ---------------------------------------------";
}
ini()
{
__writeMemory32(0x0,0x00,"Register");
__writeMemory32(0x0,0x04,"Register");
__writeMemory32(0x0,0x08,"Register");
__writeMemory32(0x0,0x0C,"Register");
__writeMemory32(0x0,0x10,"Register");
__writeMemory32(0x0,0x14,"Register");
__writeMemory32(0x0,0x18,"Register");
__writeMemory32(0x0,0x1C,"Register");
__writeMemory32(0x0,0x20,"Register");
__writeMemory32(0x0,0x24,"Register");
__writeMemory32(0x0,0x28,"Register");
__writeMemory32(0x0,0x2C,"Register");
__writeMemory32(0x0,0x30,"Register");
__writeMemory32(0x0,0x34,"Register");
__writeMemory32(0x0,0x38,"Register");
// Set CPSR
__writeMemory32(0x0D3,0x98,"Register");
}
RG()
{
__mac_i =__readMemory32(0x00,"Register"); __message "R00 0x",__mac_i:%X;
__mac_i =__readMemory32(0x04,"Register"); __message "R01 0x",__mac_i:%X;
__mac_i =__readMemory32(0x08,"Register"); __message "R02 0x",__mac_i:%X;
__mac_i =__readMemory32(0x0C,"Register"); __message "R03 0x",__mac_i:%X;
__mac_i =__readMemory32(0x10,"Register"); __message "R04 0x",__mac_i:%X;
__mac_i =__readMemory32(0x14,"Register"); __message "R05 0x",__mac_i:%X;
__mac_i =__readMemory32(0x18,"Register"); __message "R06 0x",__mac_i:%X;
__mac_i =__readMemory32(0x1C,"Register"); __message "R07 0x",__mac_i:%X;
__mac_i =__readMemory32(0x20,"Register"); __message "R08 0x",__mac_i:%X;
__mac_i =__readMemory32(0x24,"Register"); __message "R09 0x",__mac_i:%X;
__mac_i =__readMemory32(0x28,"Register"); __message "R10 0x",__mac_i:%X;
__mac_i =__readMemory32(0x2C,"Register"); __message "R11 0x",__mac_i:%X;
__mac_i =__readMemory32(0x30,"Register"); __message "R12 0x",__mac_i:%X;
__mac_i =__readMemory32(0x34,"Register"); __message "R13 0x",__mac_i:%X;
__mac_i =__readMemory32(0x38,"Register"); __message "R14 0x",__mac_i:%X;
__mac_i =__readMemory32(0x3C,"Register"); __message "R13 SVC 0x",__mac_i:%X;
__mac_i =__readMemory32(0x40,"Register"); __message "R14 SVC 0x",__mac_i:%X;
__mac_i =__readMemory32(0x44,"Register"); __message "R13 ABT 0x",__mac_i:%X;
__mac_i =__readMemory32(0x48,"Register"); __message "R14 ABT 0x",__mac_i:%X;
__mac_i =__readMemory32(0x4C,"Register"); __message "R13 UND 0x",__mac_i:%X;
__mac_i =__readMemory32(0x50,"Register"); __message "R14 UND 0x",__mac_i:%X;
__mac_i =__readMemory32(0x54,"Register"); __message "R13 IRQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x58,"Register"); __message "R14 IRQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x5C,"Register"); __message "R08 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x60,"Register"); __message "R09 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x64,"Register"); __message "R10 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x68,"Register"); __message "R11 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x6C,"Register"); __message "R12 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x70,"Register"); __message "R13 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x74,"Register"); __message "R14 FIQ0x",__mac_i:%X;
__mac_i =__readMemory32(0x98,"Register"); __message "CPSR ",__mac_i:%X;
__mac_i =__readMemory32(0x94,"Register"); __message "SPSR ",__mac_i:%X;
__mac_i =__readMemory32(0x9C,"Register"); __message "SPSR ABT ",__mac_i:%X;
__mac_i =__readMemory32(0xA0,"Register"); __message "SPSR ABT ",__mac_i:%X;
__mac_i =__readMemory32(0xA4,"Register"); __message "SPSR UND ",__mac_i:%X;
__mac_i =__readMemory32(0xA8,"Register"); __message "SPSR IRQ ",__mac_i:%X;
__mac_i =__readMemory32(0xAC,"Register"); __message "SPSR FIQ ",__mac_i:%X;
__mac_i =__readMemory32(0xB4,"Register"); __message "PC 0x",__mac_i:%X;
}

View file

@ -1,227 +0,0 @@
// ---------------------------------------------------------
// ATMEL Microcontroller Software Support - ROUSSET -
// ---------------------------------------------------------
// The software is delivered "AS IS" without warranty or
// condition of any kind, either express, implied or
// statutory. This includes without limitation any warranty
// or condition with respect to merchantability or fitness
// for any particular purpose, or against the infringements of
// intellectual property rights of others.
// ---------------------------------------------------------
// File: SAM7_RAM.mac
//
// 1.0 08/Mar/05 JPP : Creation
// 1.1 23/Mar/05 JPP : Change Variable name
//
// $Revision: 1.6 $
//
// ---------------------------------------------------------
__var __mac_i;
__var __mac_pt;
__var __mac_mem;
execUserReset()
{
CheckNoRemap();
ini();
AIC();
__message "-------------------------------Set PC Reset ----------------------------------";
__writeMemory32(0x00000000,0xB4,"Register");
}
execUserPreload()
{
//* __message "-------------------------------Set CPSR ----------------------------------";
__writeMemory32(0xD3,0x98,"Register");
__writeMemory32(0xffffffff,0xFFFFFC14,"Memory");
PllSetting();
//* Init AIC
AIC();
//* Set the RAM memory at 0x0020 0000 for code AT 0 flash area
CheckNoRemap();
//* Get the Chip ID (AT91C_DBGU_C1R & AT91C_DBGU_C2R
__mac_i=__readMemory32(0xFFFFF240,"Memory");
__message " ---------------------------------------- Chip ID 0x",__mac_i:%X;
__mac_i=__readMemory32(0xFFFFF244,"Memory");
__message " ---------------------------------------- Extention 0x",__mac_i:%X;
__mac_i=__readMemory32(0xFFFFFF6C,"Memory");
__message " ---------------------------------------- Flash Version 0x",__mac_i:%X;
//* Watchdog Disable
Watchdog();
//* RG();
}
//-----------------------------------------------------------------------------
// PllSetting
//-------------------------------
// Set PLL
//-----------------------------------------------------------------------------
PllSetting()
{
// -1- Enabling the Main Oscillator:
//*#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) // (PMC) Main Oscillator Register
//*#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) // (PMC) PLL Register
//*#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register
//*pPMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x06 <<8) | //0x0000 0600
// AT91C_CKGR_MOSCEN )); //0x0000 0001
__writeMemory32(0x00000601,0xFFFFFC20,"Memory");
// -2- Wait
// -3- Setting PLL and divider:
// - div by 5 Fin = 3,6864 =(18,432 / 5)
// - Mul 25+1: Fout = 95,8464 =(3,6864 *26)
// for 96 MHz the erroe is 0.16%
// Field out NOT USED = 0
// PLLCOUNT pll startup time esrtimate at : 0.844 ms
// PLLCOUNT 28 = 0.000844 /(1/32768)
// pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) | //0x0000 0005
// (AT91C_CKGR_PLLCOUNT & (28<<8)) //0x0000 1C00
// (AT91C_CKGR_MUL & (25<<16))); //0x0019 0000
__writeMemory32(0x00191C05,0xFFFFFC2C,"Memory");
// -2- Wait
// -5- Selection of Master Clock and Processor Clock
// select the PLL clock divided by 2
// pPMC->PMC_MCKR = AT91C_PMC_CSS_PLL_CLK | //0x0000 0003
// AT91C_PMC_PRES_CLK_2 ; //0x0000 0004
__writeMemory32(0x00000007,0xFFFFFC30,"Memory");
__message "------------------------------- PLL Enable ----------------------------------------";
}
//-----------------------------------------------------------------------------
// Watchdog
//-------------------------------
// Normally, the Watchdog is enable at the reset for load it's preferable to
// Disable.
//-----------------------------------------------------------------------------
Watchdog()
{
//* Watchdog Disable
// AT91C_BASE_WDTC->WDTC_WDMR= AT91C_WDTC_WDDIS;
__writeMemory32(0x00008000,0xFFFFFD44,"Memory");
__message "------------------------------- Watchdog Disable ----------------------------------------";
}
CheckNoRemap()
{
//* Read the value at 0x0
__mac_i =__readMemory32(0x00000000,"Memory");
__mac_mem = __mac_i;
__mac_i=__mac_i+1;
__writeMemory32(__mac_i,0x00,"Memory");
__mac_pt=__readMemory32(0x00000000,"Memory");
if (__mac_i == __mac_pt)
{
__message "------------------------------- The Remap is done ----------------------------------------";
__writeMemory32( __mac_mem,0x00000000,"Memory");
} else {
__message "------------------------------- The Remap is NOT -----------------------------------------";
//* Toggel RESET The remap
__writeMemory32(0x00000001,0xFFFFFF00,"Memory");
}
}
//-----------------------------------------------------------------------------
// Reset the Interrupt Controller
//-------------------------------
// Normally, the code is executed only if a reset has been actually performed.
// So, the AIC initialization resumes at setting up the default vectors.
//-----------------------------------------------------------------------------
AIC()
{
// Mask All interrupt pAic->AIC_IDCR = 0xFFFFFFFF;
__writeMemory32(0xffffffff,0xFFFFF124,"Memory");
__writeMemory32(0xffffffff,0xFFFFF128,"Memory");
// disable peripheral clock Peripheral Clock Disable Register
__writeMemory32(0xffffffff,0xFFFFFC14,"Memory");
// #define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register
// #define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register
// #define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register
__readMemory32(0xFFFA0020,"Memory");
__readMemory32(0xFFFA0060,"Memory");
__readMemory32(0xFFFA00A0,"Memory");
for (__mac_i=0;__mac_i < 8; __mac_i++)
{
// AT91C_BASE_AIC->AIC_EOICR
__mac_pt = __readMemory32(0xFFFFF130,"Memory");
}
__message "------------------------------- AIC 2 INIT ---------------------------------------------";
}
ini()
{
__writeMemory32(0x0,0x00,"Register");
__writeMemory32(0x0,0x04,"Register");
__writeMemory32(0x0,0x08,"Register");
__writeMemory32(0x0,0x0C,"Register");
__writeMemory32(0x0,0x10,"Register");
__writeMemory32(0x0,0x14,"Register");
__writeMemory32(0x0,0x18,"Register");
__writeMemory32(0x0,0x1C,"Register");
__writeMemory32(0x0,0x20,"Register");
__writeMemory32(0x0,0x24,"Register");
__writeMemory32(0x0,0x28,"Register");
__writeMemory32(0x0,0x2C,"Register");
__writeMemory32(0x0,0x30,"Register");
__writeMemory32(0x0,0x34,"Register");
__writeMemory32(0x0,0x38,"Register");
// Set CPSR
__writeMemory32(0x0D3,0x98,"Register");
}
RG()
{
__mac_i =__readMemory32(0x00,"Register"); __message "R00 0x",__mac_i:%X;
__mac_i =__readMemory32(0x04,"Register"); __message "R01 0x",__mac_i:%X;
__mac_i =__readMemory32(0x08,"Register"); __message "R02 0x",__mac_i:%X;
__mac_i =__readMemory32(0x0C,"Register"); __message "R03 0x",__mac_i:%X;
__mac_i =__readMemory32(0x10,"Register"); __message "R04 0x",__mac_i:%X;
__mac_i =__readMemory32(0x14,"Register"); __message "R05 0x",__mac_i:%X;
__mac_i =__readMemory32(0x18,"Register"); __message "R06 0x",__mac_i:%X;
__mac_i =__readMemory32(0x1C,"Register"); __message "R07 0x",__mac_i:%X;
__mac_i =__readMemory32(0x20,"Register"); __message "R08 0x",__mac_i:%X;
__mac_i =__readMemory32(0x24,"Register"); __message "R09 0x",__mac_i:%X;
__mac_i =__readMemory32(0x28,"Register"); __message "R10 0x",__mac_i:%X;
__mac_i =__readMemory32(0x2C,"Register"); __message "R11 0x",__mac_i:%X;
__mac_i =__readMemory32(0x30,"Register"); __message "R12 0x",__mac_i:%X;
__mac_i =__readMemory32(0x34,"Register"); __message "R13 0x",__mac_i:%X;
__mac_i =__readMemory32(0x38,"Register"); __message "R14 0x",__mac_i:%X;
__mac_i =__readMemory32(0x3C,"Register"); __message "R13 SVC 0x",__mac_i:%X;
__mac_i =__readMemory32(0x40,"Register"); __message "R14 SVC 0x",__mac_i:%X;
__mac_i =__readMemory32(0x44,"Register"); __message "R13 ABT 0x",__mac_i:%X;
__mac_i =__readMemory32(0x48,"Register"); __message "R14 ABT 0x",__mac_i:%X;
__mac_i =__readMemory32(0x4C,"Register"); __message "R13 UND 0x",__mac_i:%X;
__mac_i =__readMemory32(0x50,"Register"); __message "R14 UND 0x",__mac_i:%X;
__mac_i =__readMemory32(0x54,"Register"); __message "R13 IRQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x58,"Register"); __message "R14 IRQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x5C,"Register"); __message "R08 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x60,"Register"); __message "R09 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x64,"Register"); __message "R10 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x68,"Register"); __message "R11 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x6C,"Register"); __message "R12 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x70,"Register"); __message "R13 FIQ 0x",__mac_i:%X;
__mac_i =__readMemory32(0x74,"Register"); __message "R14 FIQ0x",__mac_i:%X;
__mac_i =__readMemory32(0x98,"Register"); __message "CPSR ",__mac_i:%X;
__mac_i =__readMemory32(0x94,"Register"); __message "SPSR ",__mac_i:%X;
__mac_i =__readMemory32(0x9C,"Register"); __message "SPSR ABT ",__mac_i:%X;
__mac_i =__readMemory32(0xA0,"Register"); __message "SPSR ABT ",__mac_i:%X;
__mac_i =__readMemory32(0xA4,"Register"); __message "SPSR UND ",__mac_i:%X;
__mac_i =__readMemory32(0xA8,"Register"); __message "SPSR IRQ ",__mac_i:%X;
__mac_i =__readMemory32(0xAC,"Register"); __message "SPSR FIQ ",__mac_i:%X;
__mac_i =__readMemory32(0xB4,"Register"); __message "PC 0x",__mac_i:%X;
}

View file

@ -1,43 +0,0 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00100000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00100040;
define symbol __ICFEDIT_region_ROM_end__ = 0x0013FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x00200000;
define symbol __ICFEDIT_region_RAM_end__ = 0x0020FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x400;
define symbol __ICFEDIT_size_svcstack__ = 0x100;
define symbol __ICFEDIT_size_irqstack__ = 0x100;
define symbol __ICFEDIT_size_fiqstack__ = 0x0;
define symbol __ICFEDIT_size_undstack__ = 0x0;
define symbol __ICFEDIT_size_abtstack__ = 0x0;
define symbol __ICFEDIT_size_heap__ = 0x0;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
block UND_STACK, block ABT_STACK, block HEAP };

View file

@ -1,73 +0,0 @@
// ----------------------------------------------------------------------------
// ATMEL Microcontroller Software Support - ROUSSET -
// ----------------------------------------------------------------------------
// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
// DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ----------------------------------------------------------------------------
// File Name : SAM7_FLASH.mac
// Object : Generic Macro File for IAR
// 1.0 17/Aug/05 FBr : Creation
// ----------------------------------------------------------------------------
/*********************************************************************
*
* _InitRSTC()
*
* Function description
* Initializes the RSTC (Reset controller).
* This makes sense since the default is to not allow user resets, which makes it impossible to
* apply a second RESET via J-Link
*/
_InitRSTC() {
__writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset
}
/*********************************************************************
*
* _InitPLL()
* Function description
* Initializes the PMC.
* 1. Enable the Main Oscillator
* 2. Configure PLL to 96MHz
* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz
*/
_InitPLL() {
__message "Enable Main Oscillator";
__writeMemory32(0x00000601,0xFFFFFc20,"Memory"); // MOSC
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) );
__message "Set PLL to 96MHz";
__writeMemory32(0x10191c05,0xFFFFFc2c,"Memory"); // LOCK
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) );
__message "Set Master Clock to 48MHz";
__writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) );
__writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) );
// Set 1 WS for Flash accesses on each EFC
__writeMemory32(0x00480100,0xFFFFFF60,"Memory");
__writeMemory32(0x00480100,0xFFFFFF70,"Memory");
}
/*********************************************************************
*
* execUserReset() : JTAG set initially to Full Speed
*/
execUserReset() {
__message "execUserReset()";
__hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz)
_InitPLL(); // Allow to debug at JTAG Full Speed
_InitRSTC(); // Enable User Reset to allow execUserReset() execution
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\rtosdemo.ewp</path>
</project>
<batchBuild/>
</workspace>

View file

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Project>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>189</Column0><Column1>27</Column1><Column2>27</Column2></ColumnWidths>
</Workspace>
<Disassembly>
<PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><MixedMode>1</MixedMode><CodeCovEnabled>0</CodeCovEnabled><CodeCovShow>0</CodeCovShow></Disassembly>
<Debug-Log/>
<Build/>
<Register><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows></Register><QWatch><Column0>188</Column0><Column1>171</Column1><Column2>100</Column2><Column3>100</Column3></QWatch><Memory><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory><Watch><Format><struct_types/><watch_formats/></Format></Watch></Static>
<Windows>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-23416-30482</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd0>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-12145-30489</Identity>
<TabName>Debug Log</TabName>
<Factory>Debug-Log</Factory>
<Session/>
</Tab>
<Tab>
<Identity>TabID-22894-30492</Identity>
<TabName>Build</TabName>
<Factory>Build</Factory>
<Session/>
</Tab>
</Tabs>
<SelectedTab>1</SelectedTab></Wnd2>
<Wnd4><Tabs><Tab><Identity>TabID-18780-12821</Identity><TabName>Memory</TabName><Factory>Memory</Factory><Session><SelectionAnchor>2097764</SelectionAnchor><SelectionEnd>2097764</SelectionEnd><UnitsPerGroup>1</UnitsPerGroup><EndianMode>0</EndianMode><DataCovEnabled>0</DataCovEnabled><DataCovShown>0</DataCovShown></Session></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd4><Wnd5><Tabs><Tab><Identity>TabID-23506-14575</Identity><TabName>Watch</TabName><Factory>Watch</Factory><Session><Expressions><Expression><Expression>pxCurrentTCB</Expression></Expression><Expression><Expression>ulCriticalNesting</Expression></Expression></Expressions><TabId>0</TabId><Column0>176</Column0><Column1>100</Column1><Column2>100</Column2><Column3>100</Column3></Session></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd5><Wnd1><Tabs><Tab><Identity>TabID-4859-22480</Identity><TabName>Disassembly</TabName><Factory>Disassembly</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1><Wnd3><Tabs><Tab><Identity>TabID-154-22568</Identity><TabName>Register</TabName><Factory>Register</Factory><Session><REG1>0</REG1><REG2>0</REG2><Group>0</Group><States>1</States><State0>CPSR</State0></Session></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\main.c</Filename><XPos>0</XPos><YPos>10</YPos><SelStart>378</SelStart><SelEnd>378</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\source\include\task.h</Filename><XPos>0</XPos><YPos>778</YPos><SelStart>24283</SelStart><SelEnd>24283</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\tasks.c</Filename><XPos>0</XPos><YPos>939</YPos><SelStart>30511</SelStart><SelEnd>30511</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\SrcIAR\Cstartup.s79</Filename><XPos>0</XPos><YPos>48</YPos><SelStart>2226</SelStart><SelEnd>2226</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\Common\Minimal\flash.c</Filename><XPos>0</XPos><YPos>98</YPos><SelStart>4025</SelStart><SelEnd>4025</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\portasm.s79</Filename><XPos>0</XPos><YPos>41</YPos><SelStart>1057</SelStart><SelEnd>1079</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\srciar\lib_AT91SAM7S64.h</Filename><XPos>0</XPos><YPos>2778</YPos><SelStart>108450</SelStart><SelEnd>108450</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\port.c</Filename><XPos>0</XPos><YPos>136</YPos><SelStart>5326</SelStart><SelEnd>5326</SelEnd></Tab><ActiveTab>7</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\ParTest\ParTest.c</Filename><XPos>0</XPos><YPos>36</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\portmacro.h</Filename><XPos>0</XPos><YPos>67</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-0084f8a0><key>IarIdePM1</key></Toolbar-0084f8a0></Sizes></Row0><Row1><Sizes><Toolbar-031ef990><key>DebuggerGui1</key></Toolbar-031ef990></Sizes></Row1></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>715</Bottom><Right>263</Right><x>-2</x><y>-2</y><xscreen>153</xscreen><yscreen>153</yscreen><sizeHorzCX>95625</sizeHorzCX><sizeHorzCY>136729</sizeHorzCY><sizeVertCX>165625</sizeVertCX><sizeVertCY>640750</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>715</Bottom><Right>647</Right><x>-2</x><y>-2</y><xscreen>190</xscreen><yscreen>190</yscreen><sizeHorzCX>118750</sizeHorzCX><sizeHorzCY>169794</sizeHorzCY><sizeVertCX>405625</sizeVertCX><sizeVertCY>640750</sizeVertCY></Rect></Wnd1></Sizes></Row0><Row1><Sizes><Wnd3><Rect><Top>-2</Top><Left>645</Left><Bottom>715</Bottom><Right>1025</Right><x>645</x><y>-2</y><xscreen>190</xscreen><yscreen>190</yscreen><sizeHorzCX>118750</sizeHorzCX><sizeHorzCY>169794</sizeHorzCY><sizeVertCX>237500</sizeVertCX><sizeVertCY>640750</sizeVertCY></Rect></Wnd3></Sizes></Row1></Right><Bottom><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>151</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>153</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>136729</sizeHorzCY><sizeVertCX>95625</sizeVertCX><sizeVertCY>136729</sizeVertCY></Rect></Wnd2></Sizes></Row0><Row1><Sizes><Wnd4><Rect><Top>149</Top><Left>-2</Left><Bottom>333</Bottom><Right>669</Right><x>-2</x><y>149</y><xscreen>671</xscreen><yscreen>184</yscreen><sizeHorzCX>419375</sizeHorzCX><sizeHorzCY>164432</sizeHorzCY><sizeVertCX>114375</sizeVertCX><sizeVertCY>163538</sizeVertCY></Rect></Wnd4><Wnd5><Rect><Top>149</Top><Left>667</Left><Bottom>333</Bottom><Right>1602</Right><x>667</x><y>149</y><xscreen>935</xscreen><yscreen>184</yscreen><sizeHorzCX>584375</sizeHorzCX><sizeHorzCY>164432</sizeHorzCY><sizeVertCX>115000</sizeVertCX><sizeVertCY>598748</sizeVertCY></Rect></Wnd5></Sizes></Row1></Bot
tom><Float><Sizes/></Float></Positions>
</Desktop>
</Project>

View file

@ -1,23 +0,0 @@
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[JLinkDriver]
WatchVectorCatch=_ 0
WatchCond=_ 0
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[Disassemble mode]
mode=0
[Breakpoints]
Bp0=_ "Code" "{E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\port.c}.141.1@1" 1 0 0 0 "" 0 ""
Count=1
[Low Level]
Pipeline mode=0
Initialized=0

View file

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>rtosdemo/Flash Debug</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>232</Column0><Column1>27</Column1><Column2>27</Column2></ColumnWidths>
</Workspace>
<Build/>
<TerminalIO/>
<Profiling/>
<Watch>
<Format>
<struct_types/>
<watch_formats/>
</Format>
</Watch>
<Debug-Log/>
<Disassembly>
<MixedMode>1</MixedMode><CodeCovEnabled>0</CodeCovEnabled><CodeCovShow>0</CodeCovShow></Disassembly>
<CodeCoveragePlugin/><Memory><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory></Static>
<Windows>
<Wnd6>
<Tabs>
<Tab>
<Identity>TabID-29690-30365</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd6><Wnd7>
<Tabs>
<Tab>
<Identity>TabID-27076-30414</Identity>
<TabName>Build</TabName>
<Factory>Build</Factory>
<Session/>
</Tab>
<Tab>
<Identity>TabID-12668-30479</Identity>
<TabName>Debug Log</TabName>
<Factory>Debug-Log</Factory>
<Session/>
</Tab>
</Tabs>
<SelectedTab>1</SelectedTab></Wnd7></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\source\include\task.h</Filename><XPos>0</XPos><YPos>778</YPos><SelStart>24283</SelStart><SelEnd>24283</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\portasm.s79</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>2583</SelStart><SelEnd>2583</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\SrcIAR\Cstartup.s79</Filename><XPos>0</XPos><YPos>30</YPos><SelStart>2226</SelStart><SelEnd>2226</SelEnd></Tab><ActiveTab>3</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\srciar\lib_AT91SAM7S64.h</Filename><XPos>0</XPos><YPos>2371</YPos><SelStart>92638</SelStart><SelEnd>92638</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\Common\Minimal\flash.c</Filename><XPos>0</XPos><YPos>98</YPos><SelStart>4025</SelStart><SelEnd>4025</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\port.c</Filename><XPos>0</XPos><YPos>177</YPos><SelStart>7662</SelStart><SelEnd>7662</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\ParTest\ParTest.c</Filename><XPos>0</XPos><YPos>36</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7\portmacro.h</Filename><XPos>0</XPos><YPos>21</YPos><SelStart>2110</SelStart><SelEnd>2110</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_Ateml_IAR\SrcIAR\Cstartup_SAM7.c</Filename><XPos>0</XPos><YPos>29</YPos><SelStart>3116</SelStart><SelEnd>3116</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c</Filename><XPos>0</XPos><YPos>170</YPos><SelStart>7352</SelStart><SelEnd>7352</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Source\tasks.c</Filename><XPos>0</XPos><YPos>1270</YPos><SelStart>40884</SelStart><SelEnd>40884</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-0084f7c0><key>IarIdePM1</key></Toolbar-0084f7c0></Sizes></Row0></Top><Left><Row0><Sizes><Wnd6><Rect><Top>-2</Top><Left>-2</Left><Bottom>866</Bottom><Right>306</Right><x>-2</x><y>-2</y><xscreen>48</xscreen><yscreen>48</yscreen><sizeHorzCX>30000</sizeHorzCX><sizeHorzCY>42895</sizeHorzCY><sizeVertCX>192500</sizeVertCX><sizeVertCY>775692</sizeVertCY></Rect></Wnd6></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd7><Rect><Top>-2</Top><Left>-2</Left><Bottom>206</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>208</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>185880</sizeHorzCY><sizeVertCX>30000</sizeVertCX><sizeVertCY>42895</sizeVertCY></Rect></Wnd7></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View file

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Project>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>240</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Disassembly>
<PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><CodeCovEnabled>0</CodeCovEnabled><MixedMode>1</MixedMode><CodeCovShow>0</CodeCovShow><InstrProfShow>0</InstrProfShow></Disassembly>
<Debug-Log><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window></Windows></PreferedWindows><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1622</ColumnWidth1></Debug-Log>
<Build><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Debug-Log</Factory></Window></Windows></PreferedWindows></Build>
<Register>
<PreferedWindows>
<Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows>
</Register>
<QWatch><Column0>161</Column0><Column1>100</Column1><Column2>100</Column2><Column3>100</Column3></QWatch><Memory><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory><Breakpoints/><Watch><Format><struct_types/><watch_formats><Fmt><Key>{W}Watch-0:TxBuffIndex</Key><Value>4</Value></Fmt></watch_formats></Format><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><Column0>185</Column0><Column1>316</Column1><Column2>100</Column2><Column3>195</Column3></Watch><QuickWatch><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><Column0>140</Column0><Column1>104</Column1><Column2>100</Column2><Column3>100</Column3></QuickWatch><Find-in-Files><ColumnWidth0>482</ColumnWidth0><ColumnWidth1>68</ColumnWidth1><ColumnWidth2>826</ColumnWidth2></Find-in-Files></Static>
<Windows>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-22256-14845</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/Demo Source</ExpandedNode><ExpandedNode>rtosdemo/Demo Source/EMAClISR.s79</ExpandedNode><ExpandedNode>rtosdemo/FreeRTOS Source</ExpandedNode><ExpandedNode>rtosdemo/FreeRTOS Source/portasm.s79</ExpandedNode><ExpandedNode>rtosdemo/USBSample.c</ExpandedNode><ExpandedNode>rtosdemo/uIP Source</ExpandedNode><ExpandedNode>rtosdemo/uIP Source/Atmel Code</ExpandedNode><ExpandedNode>rtosdemo/uIP Source/fs.c</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd0><Wnd3><Tabs><Tab><Identity>TabID-25021-10902</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab><Tab><Identity>TabID-2772-9628</Identity><TabName>Find in Files</TabName><Factory>Find-in-Files</Factory><Session/></Tab></Tabs><SelectedTab>1</SelectedTab></Wnd3><Wnd4><Tabs><Tab><Identity>TabID-29748-16361</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd4></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\WorkingCopy\Demo\uIP_Demo_IAR_ARM7\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>C:\E\temp\rc\1\FreeRTOS\Demo\uIP_Demo_IAR_ARM7\SrcIAR\Cstartup.s</Filename><XPos>0</XPos><YPos>217</YPos><SelStart>8773</SelStart><SelEnd>8773</SelEnd></Tab><ActiveTab>1</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-00abb198><key>iaridepm.enu1</key></Toolbar-00abb198><Toolbar-0558c218><key>debuggergui.enu1</key></Toolbar-0558c218></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>598</Bottom><Right>330</Right><x>-2</x><y>-2</y><xscreen>0</xscreen><yscreen>0</yscreen><sizeHorzCX>0</sizeHorzCX><sizeHorzCY>0</sizeHorzCY><sizeVertCX>197619</sizeVertCX><sizeVertCY>610998</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>167</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>169</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>172098</sizeHorzCY><sizeVertCX>0</sizeVertCX><sizeVertCY>0</sizeVertCY></Rect></Wnd3></Sizes></Row0><Row1><Sizes><Wnd4><Rect><Top>165</Top><Left>-2</Left><Bottom>340</Bottom><Right>1682</Right><x>-2</x><y>165</y><xscreen>1684</xscreen><yscreen>175</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>178208</sizeHorzCY><sizeVertCX>124405</sizeVertCX><sizeVertCY>178208</sizeVertCY></Rect></Wnd4></Sizes></Row1></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Project>

View file

@ -1,47 +0,0 @@
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[JLinkDriver]
WatchVectorCatch=_ 0
WatchCond=_ 0
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
[Low Level]
Pipeline mode=1
Initialized=0
[CodeCoverage]
Enabled=_ 0
[Profiling]
Enabled=0
[StackPlugin]
Enabled=1
OverflowWarningsEnabled=1
WarningThreshold=90
SpWarningsEnabled=1
WarnHow=0
UseTrigger=1
TriggerName=main
LimitSize=0
ByteLimit=50
[TraceHelper]
Enabled=0
ShowSource=1
[DebugChecksum]
Checksum=447895738
[InstructionProfiling]
Enabled=_ 0
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[DriverProfiling]
Enabled=0
Source=2
Graph=0
[Disassemble mode]
mode=0
[Breakpoints]
Count=0

View file

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>rtosdemo/Flash Debug</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>288</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build><ColumnWidth0>18</ColumnWidth0><ColumnWidth1>1155</ColumnWidth1><ColumnWidth2>308</ColumnWidth2><ColumnWidth3>77</ColumnWidth3></Build>
<Debug-Log><ColumnWidth0>22</ColumnWidth0><ColumnWidth1>1620</ColumnWidth1></Debug-Log>
<TerminalIO/>
<CodeCoveragePlugin/>
<Profiling/>
<Watch>
<Format>
<struct_types/>
<watch_formats/>
</Format>
</Watch>
<Disassembly><CodeCovEnabled>0</CodeCovEnabled><MixedMode>1</MixedMode><CodeCovShow>0</CodeCovShow><InstrProfShow>0</InstrProfShow></Disassembly><Memory><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory><Breakpoints/><Find-in-Files><ColumnWidth0>552</ColumnWidth0><ColumnWidth1>78</ColumnWidth1><ColumnWidth2>946</ColumnWidth2></Find-in-Files></Static>
<Windows>
<Wnd1>
<Tabs>
<Tab>
<Identity>TabID-17425-14382</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd1><Wnd3>
<Tabs>
<Tab>
<Identity>TabID-4084-16269</Identity>
<TabName>Build</TabName>
<Factory>Build</Factory>
<Session/>
</Tab>
<Tab><Identity>TabID-23097-10324</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab><Tab><Identity>TabID-27351-12303</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab><Tab><Identity>TabID-28796-16277</Identity><TabName>Find in Files</TabName><Factory>Find-in-Files</Factory><Session/></Tab></Tabs>
<SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\temp\rc\1\FreeRTOS\Demo\uIP_Demo_IAR_ARM7\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-00abb198><key>iaridepm.enu1</key></Toolbar-00abb198></Sizes></Row0></Top><Left><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>774</Bottom><Right>362</Right><x>-2</x><y>-2</y><xscreen>0</xscreen><yscreen>0</yscreen><sizeHorzCX>0</sizeHorzCX><sizeHorzCY>0</sizeHorzCY><sizeVertCX>216667</sizeVertCX><sizeVertCY>790224</sizeVertCY></Rect></Wnd1></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>164</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>166</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>169043</sizeHorzCY><sizeVertCX>0</sizeVertCX><sizeVertCY>0</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View file

@ -1,207 +0,0 @@
/*
* Modified from an original work that is Copyright (c) 2001-2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: main.c,v 1.10.2.4 2003/10/21 21:27:51 adam Exp $
*
*/
/* Standard includes. */
#include <stdlib.h>
#include <stdio.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* Demo app includes. */
#include "SAM7_EMAC.h"
/* uIP includes. */
#undef HTONS
#include "uip.h"
#include "uip_arp.h"
#include "tapdev.h"
#include "httpd.h"
/* The start of the uIP buffer, which will contain the frame headers. */
#define pucUIP_Buffer ( ( struct uip_eth_hdr * ) &uip_buf[ 0 ] )
/* uIP update frequencies. */
#define RT_CLOCK_SECOND ( configTICK_RATE_HZ )
#define uipARP_FREQUENCY ( 20 )
#define uipMAX_BLOCK_TIME ( RT_CLOCK_SECOND / 4 )
/*-----------------------------------------------------------*/
void vuIP_TASK( void *pvParameters )
{
/* The semaphore used by the EMAC ISR to indicate that an Rx frame is ready
for processing. */
SemaphoreHandle_t xSemaphore = NULL;
portBASE_TYPE xARPTimer;
unsigned portBASE_TYPE uxPriority;
static volatile TickType_t xStartTime, xCurrentTime;
/* Initialize the uIP TCP/IP stack. */
uip_init();
uip_arp_init();
/* Initialize the HTTP server. */
httpd_init();
/* Initialise the local timers. */
xStartTime = xTaskGetTickCount();
xARPTimer = 0;
/* Initialise the EMAC. A semaphore will be returned when this is
successful. This routine contains code that polls status bits. If the
Ethernet cable is not plugged in then this can take a considerable time.
To prevent this starving lower priority tasks of processing time we
lower our priority prior to the call, then raise it back again once the
initialisation is complete. */
uxPriority = uxTaskPriorityGet( NULL );
vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
while( xSemaphore == NULL )
{
xSemaphore = xEMACInit();
}
vTaskPrioritySet( NULL, uxPriority );
for( ;; )
{
/* Let the network device driver read an entire IP packet
into the uip_buf. If it returns > 0, there is a packet in the
uip_buf buffer. */
uip_len = ulEMACPoll();
/* Was a packet placed in the uIP buffer? */
if( uip_len > 0 )
{
/* A packet is present in the uIP buffer. We call the
appropriate ARP functions depending on what kind of packet we
have received. If the packet is an IP packet, we should call
uip_input() as well. */
if( pucUIP_Buffer->type == htons( UIP_ETHTYPE_IP ) )
{
uip_arp_ipin();
uip_input();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
lEMACSend();
}
}
else if( pucUIP_Buffer->type == htons( UIP_ETHTYPE_ARP ) )
{
uip_arp_arpin();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
lEMACSend();
}
}
}
else
{
/* The poll function returned 0, so no packet was
received. Instead we check if it is time that we do the
periodic processing. */
xCurrentTime = xTaskGetTickCount();
if( ( xCurrentTime - xStartTime ) >= RT_CLOCK_SECOND )
{
portBASE_TYPE i;
/* Reset the timer. */
xStartTime = xCurrentTime;
/* Periodic check of all connections. */
for( i = 0; i < UIP_CONNS; i++ )
{
uip_periodic( i );
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
lEMACSend();
}
}
#if UIP_UDP
for( i = 0; i < UIP_UDP_CONNS; i++ )
{
uip_udp_periodic( i );
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
tapdev_send();
}
}
#endif /* UIP_UDP */
/* Periodically call the ARP timer function. */
if( ++xARPTimer == uipARP_FREQUENCY )
{
uip_arp_timer();
xARPTimer = 0;
}
}
else
{
/* We did not receive a packet, and there was no periodic
processing to perform. Block for a fixed period. If a packet
is received during this period we will be woken by the ISR
giving us the Semaphore. */
xSemaphoreTake( xSemaphore, uipMAX_BLOCK_TIME );
}
}
}
}
/*-----------------------------------------------------------------------------------*/

View file

@ -1,8 +0,0 @@
#ifndef UIP_TASK_H
#define UIP_TASK_H
/* The task that handles all uIP data. */
void vuIP_TASK( void *pvParameters );
#endif

View file

@ -1,74 +0,0 @@
# Copyright (c) 2001, Adam Dunkels.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Adam Dunkels.
# 4. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# This file is part of the uIP TCP/IP stack.
#
# $Id: Makefile,v 1.8.2.2 2003/10/04 22:54:17 adam Exp $
#
CC=gcc
CFLAGS=-Wall -g -I../uip -I. -I../apps/httpd -I../apps/resolv -I../apps/webclient -I../apps/smtp -I../apps/telnet -fpack-struct
%.o:
$(CC) $(CFLAGS) -c $(<:.o=.c)
uip: uip.o uip_arch.o tapdev.o httpd.o main.o fs.o uip_arp.o cgi.o
tapdev.o: tapdev.c uipopt.h
main.o: main.c ../uip/uip.h uipopt.h ../apps/httpd/httpd.h \
tapdev.h
uip_arch.o: uip_arch.c ../uip/uip_arch.h ../uip/uip.h uipopt.h \
../apps/httpd/httpd.h
uip.o: ../uip/uip.c ../uip/uip.h uipopt.h ../apps/httpd/httpd.h
uip_arp.o: ../uip/uip_arp.c ../uip/uip_arp.h ../uip/uip.h uipopt.h \
../apps/httpd/httpd.h
$(CC) -o uip_arp.o $(CFLAGS) -fpack-struct -c ../uip/uip_arp.c
cgi.o: ../apps/httpd/cgi.c ../uip/uip.h uipopt.h ../apps/smtp/smtp.h \
../apps/httpd/cgi.h ../apps/httpd/httpd.h ../apps/httpd/fs.h
fs.o: ../apps/httpd/fs.c ../uip/uip.h uipopt.h ../apps/smtp/smtp.h \
../apps/httpd/httpd.h ../apps/httpd/fs.h ../apps/httpd/fsdata.h \
../apps/httpd/fsdata.c
fsdata.o: ../apps/httpd/fsdata.c
httpd.o: ../apps/httpd/httpd.c ../uip/uip.h uipopt.h \
../apps/smtp/smtp.h ../apps/httpd/httpd.h ../apps/httpd/fs.h \
../apps/httpd/fsdata.h ../apps/httpd/cgi.h
clean:
rm -f *.o *~ *core uip

View file

@ -1,225 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server script language C functions file.
* \author Adam Dunkels <adam@dunkels.com>
*
* This file contains functions that are called by the web server
* scripts. The functions takes one argument, and the return value is
* interpreted as follows. A zero means that the function did not
* complete and should be invoked for the next packet as well. A
* non-zero value indicates that the function has completed and that
* the web server should move along to the next script line.
*
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: cgi.c,v 1.23.2.4 2003/10/07 13:22:27 adam Exp $
*
*/
#include "uip.h"
#include "cgi.h"
#include "httpd.h"
#include "fs.h"
#include <stdio.h>
#include <string.h>
static u8_t print_stats(u8_t next);
static u8_t file_stats(u8_t next);
static u8_t tcp_stats(u8_t next);
static u8_t rtos_stats(u8_t next);
cgifunction cgitab[] = {
print_stats, /* CGI function "a" */
file_stats, /* CGI function "b" */
tcp_stats, /* CGI function "c" */
rtos_stats /* CGI function "d" */
};
static const char closed[] = /* "CLOSED",*/
{0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
static const char syn_rcvd[] = /* "SYN-RCVD",*/
{0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56,
0x44, 0};
static const char syn_sent[] = /* "SYN-SENT",*/
{0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e,
0x54, 0};
static const char established[] = /* "ESTABLISHED",*/
{0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48,
0x45, 0x44, 0};
static const char fin_wait_1[] = /* "FIN-WAIT-1",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x31, 0};
static const char fin_wait_2[] = /* "FIN-WAIT-2",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x32, 0};
static const char closing[] = /* "CLOSING",*/
{0x43, 0x4c, 0x4f, 0x53, 0x49,
0x4e, 0x47, 0};
static const char time_wait[] = /* "TIME-WAIT,"*/
{0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41,
0x49, 0x54, 0};
static const char last_ack[] = /* "LAST-ACK"*/
{0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43,
0x4b, 0};
static const char *states[] = {
closed,
syn_rcvd,
syn_sent,
established,
fin_wait_1,
fin_wait_2,
closing,
time_wait,
last_ack};
/*-----------------------------------------------------------------------------------*/
/* print_stats:
*
* Prints out a part of the uIP statistics. The statistics data is
* written into the uip_appdata buffer. It overwrites any incoming
* packet.
*/
static u8_t
print_stats(u8_t next)
{
#if UIP_STATISTICS
u16_t i, j;
u8_t *buf;
u16_t *databytes;
if(next) {
/* If our last data has been acknowledged, we move on the next
chunk of statistics. */
hs->count = hs->count + 4;
if(hs->count >= sizeof(struct uip_stats)/sizeof(u16_t)) {
/* We have printed out all statistics, so we return 1 to
indicate that we are done. */
return 1;
}
}
/* Write part of the statistics into the uip_appdata buffer. */
databytes = (u16_t *)&uip_stat + hs->count;
buf = (u8_t *)uip_appdata;
j = 4 + 1;
i = hs->count;
while (i < sizeof(struct uip_stats)/sizeof(u16_t) && --j > 0) {
sprintf((char *)buf, "%5u\r\n", *databytes);
++databytes;
buf += 6;
++i;
}
/* Send the data. */
uip_send(uip_appdata, buf - uip_appdata);
return 0;
#else
return 1;
#endif /* UIP_STATISTICS */
}
/*-----------------------------------------------------------------------------------*/
static u8_t
file_stats(u8_t next)
{
/* We use sprintf() to print the number of file accesses to a
particular file (given as an argument to the function in the
script). We then use uip_send() to actually send the data. */
if(next) {
return 1;
}
uip_send(uip_appdata, sprintf((char *)uip_appdata, "%5u", fs_count(&hs->script[4])));
return 0;
}
/*-----------------------------------------------------------------------------------*/
static u8_t
tcp_stats(u8_t next)
{
struct uip_conn *conn;
if(next) {
/* If the previously sent data has been acknowledged, we move
forward one connection. */
if(++hs->count == UIP_CONNS) {
/* If all connections has been printed out, we are done and
return 1. */
return 1;
}
}
conn = &uip_conns[hs->count];
if((conn->tcpstateflags & TS_MASK) == CLOSED) {
uip_send(uip_appdata, sprintf((char *)uip_appdata,
"<tr align=\"center\"><td>-</td><td>-</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
conn->nrtx,
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' '));
} else {
uip_send(uip_appdata, sprintf((char *)uip_appdata,
"<tr align=\"center\"><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
htons(conn->ripaddr[0]) >> 8,
htons(conn->ripaddr[0]) & 0xff,
htons(conn->ripaddr[1]) >> 8,
htons(conn->ripaddr[1]) & 0xff,
htons(conn->rport),
states[conn->tcpstateflags & TS_MASK],
conn->nrtx,
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' '));
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
static u8_t
rtos_stats(u8_t next)
{
static char cTraceBuffer[ 1024 ];
extern void ( vTaskList )( char * );
vTaskList( cTraceBuffer );
uip_send( ( void * ) cTraceBuffer, strlen( cTraceBuffer ) );
return 1;
}

View file

@ -1,57 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP script language header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: cgi.h,v 1.3.2.4 2003/10/07 13:22:27 adam Exp $
*
*/
#ifndef __CGI_H__
#define __CGI_H__
typedef u8_t (* cgifunction)(u8_t next);
/**
* A table containing pointers to C functions that can be called from
* a web server script.
*/
extern cgifunction cgitab[];
#endif /* __CGI_H__ */

View file

@ -1,66 +0,0 @@
// Rowley C Compiler, runtime support.
//
// Copyright (c) 2001, 2002, 2003 Rowley Associates Limited.
//
// This file may be distributed under the terms of the License Agreement
// provided with this software.
//
// THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
; Create sections
.data
.bss
; Go to code section.
.code
; Executed upon reset
__reset proc
; Turn off watchdog. You can enable it in main() if required.
mov.w #0x5a80, &0x120
; Set up stack.
mov.w #RAM_Start_Address+RAM_Size, sp
; Copy from initialised data section to data section.
mov.w #SFB(IDATA0), r15
mov.w #data_init_begin, r14
mov.w #data_init_end-data_init_begin, r13
call #_memcpy
; Zero the bss. Ensure the stack is not allocated in the bss!
mov.w #SFB(UDATA0), r15
mov.w #0, r14
mov.w #SFE(UDATA0)-SFB(UDATA0), r13
call #_memset
; Call user entry point void main(void).
call #_main
; If main() returns, kick off again.
jmp __reset
endproc
; Heap data structures; removed by the linker if the heap isn't used.
.break
.data
align WORD
___heap_start__::
DW 0
DW heap_size
DS heap_size-4
; Reset vector
.vectors
.keep
org 0x1e
dw __reset
; Initialise the IDATA0 section by duplicating the contents into the
; CONST section and copying them on startup.
.const
data_init_begin:
.init "IDATA0"
data_init_end:

View file

@ -1,156 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server read-only file system code.
* \author Adam Dunkels <adam@dunkels.com>
*
* A simple read-only filesystem.
*/
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: fs.c,v 1.7.2.3 2003/10/07 13:22:27 adam Exp $
*/
#include "uip.h"
#include "httpd.h"
#include "fs.h"
#include "fsdata.h"
#define NULL (void *)0
#include "fsdata.c"
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
static u16_t count[FS_NUMFILES];
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/
static u8_t
fs_strcmp(const char *str1, const char *str2)
{
u8_t i;
i = 0;
loop:
if(str2[i] == 0 ||
str1[i] == '\r' ||
str1[i] == '\n') {
return 0;
}
if(str1[i] != str2[i]) {
return 1;
}
++i;
goto loop;
}
/*-----------------------------------------------------------------------------------*/
int
fs_open(const char *name, struct fs_file *file)
{
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
u16_t i = 0;
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
struct fsdata_file_noconst *f;
for(f = (struct fsdata_file_noconst *)FS_ROOT;
f != NULL;
f = (struct fsdata_file_noconst *)f->next) {
if(fs_strcmp(name, f->name) == 0) {
file->data = f->data;
file->len = f->len;
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
++count[i];
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
return 1;
}
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
++i;
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
void
fs_init(void)
{
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
u16_t i;
for(i = 0; i < FS_NUMFILES; i++) {
count[i] = 0;
}
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
}
/*-----------------------------------------------------------------------------------*/
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
u16_t fs_count
(char *name)
{
struct fsdata_file_noconst *f;
u16_t i;
i = 0;
for(f = (struct fsdata_file_noconst *)FS_ROOT;
f != NULL;
f = (struct fsdata_file_noconst *)f->next) {
if(fs_strcmp(name, f->name) == 0) {
return count[i];
}
++i;
}
return 0;
}
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/

View file

@ -1,80 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server read-only file system header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: fs.h,v 1.6.2.3 2003/10/07 13:22:27 adam Exp $
*/
#ifndef __FS_H__
#define __FS_H__
#include "uip.h"
/**
* An open file in the read-only file system.
*/
struct fs_file {
char *data; /**< The actual file data. */
int len; /**< The length of the file data. */
};
/**
* Open a file in the read-only file system.
*
* \param name The name of the file.
*
* \param file The file pointer, which must be allocated by caller and
* will be filled in by the function.
*/
int fs_open(const char *name, struct fs_file *file);
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
u16_t fs_count(char *name);
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
/**
* Initialize the read-only file system.
*/
void fs_init(void);
#endif /* __FS_H__ */

View file

@ -1 +0,0 @@
<html><body bgcolor="white"><center><h1>404 - file not found</h1></center></body></html>

View file

@ -1,26 +0,0 @@
# This script shows the access statistics for different files on the
# web server.
#
# First, we include the HTML header.
i /files_header.html
# Print out the name of the file, and call the function that prints
# the access statistics of that file.
t <tr><td><a href="/index.html">/index.html</a></td><td>
c b /index.html
t </td></tr> <tr><td><a href="/control.html">/control.html</a></td><td>
c b /control.html
t </td></tr> <tr><td><a href="/img/logo.png">/img/logo.png</a></td><td>
c b /img/logo.png
t </td></tr> <tr><td><a href="/404.html">/404.html</a></td><td>
c b /404.html
t </td></tr> <tr><td><a href="/cgi/files">/cgi/files</a></td><td>
c b /cgi/files
t </td></tr> <tr><td><a href="/cgi/stats">/cgi/stats</a></td><td>
c b /cgi/stats
t </td></tr> <tr><td><a href="/cgi/tcp">/cgi/tcp</a></td><td>
c b /cgi/tcp
t </td></tr>
# Include the HTML footer.
i /files_footer.plain
# End of script.
.

View file

@ -1,6 +0,0 @@
t <html><head><title>uIP Open Source Embedded TCP/IP Stack On FreeRTOS Kernel</title></head><body BGCOLOR="#CCCCFF"><font face="arial"><small><b><a href="http://www.freertos.org" target="_top">FreeRTOS Homepage</a></b></small><p><H1>AT91SAM7X Embedded WEB Server Demo<br><small>Using uIP and the FreeRTOS real time kernel</small></h1><p>These pages are being served by an Atmel AT91SAM7X256 microcontroller, using Adam Dunkels open source uIP TCP/IP stack.<p>The uIP stack is executing from a single task under control of the FreeRTOS real time kernel. The table below shows the statistics for all the tasks in the demo applicaiton.<p><pre>Task State Priority Stack #<br>************************************************<br>
c d
t </pre></font></body></html>
.

View file

@ -1,4 +0,0 @@
i /stats_header.html
c a
i /stats_footer.plain
.

View file

@ -1,4 +0,0 @@
i /tcp_header.html
c c
i /tcp_footer.plain
.

View file

@ -1,20 +0,0 @@
<html>
<head>
<title>AT91SAM7X Embedded WEB Server using uIP and FreeRTOS</title>
</head>
<body bgcolor="#ccccff">
<font face="arial">
<img src="/img/logo.png" align="right">
<a href="/cgi/rtos" target="main">Tasks</a> |
<a href="/cgi/tcp" target="main">Connections</a> |
<a href="/cgi/files" target="main">Files</a> |
<a href="/cgi/stats" target="main">Statistics</a><br>
<br>
</font>
</body>
</html>

View file

@ -1,3 +0,0 @@
</td></tr></table>
</body>
</html>

View file

@ -1,4 +0,0 @@
<html>
<body bgcolor="#CCCCFF">
<center>
<table width="600" border="0">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -1,15 +0,0 @@
<html>
<head>
</head>
<frameset cols="*" rows="120,*" frameborder="no">
<frame src="control.html">
<frame src="/cgi/rtos" name="main">
</frameset>
<noframes>
<body>
Your browser must support frames
</body>
</noframes>
</html>

View file

@ -1,3 +0,0 @@
</td></tr></table>
</body>
</html>

View file

@ -1,30 +0,0 @@
<html>
<body bgcolor="#ccccff">
<center>
<table width="600" border="0">
<tr><td>
<pre>
IP Packets dropped
Packets received
Packets sent
IP errors IP version/header length
IP length, high byte
IP length, low byte
IP fragments
Header checksum
Wrong protocol
ICMP Packets dropped
Packets received
Packets sent
Type errors
TCP Packets dropped
Packets received
Packets sent
Checksum errors
Data packets without ACKs
Resets
Retransmissions
No connection avaliable
Connection attempts to closed ports
</pre>
</td><td><pre>

View file

@ -1,5 +0,0 @@
</td></tr></table>
</center>
</body>
</html>

View file

@ -1,6 +0,0 @@
<html>
<body bgcolor="#ccccff">
<center>
<table width="600" border="0">
<tr><th>Remote</th><th>State</th><th>Retransmissions</th><th>Timer</th><th>Flags</th></tr>

View file

@ -1,968 +0,0 @@
static const char data_404_html[] = {
/* /404.html */
0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34,
0x30, 0x34, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f,
0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50,
0x2f, 0x30, 0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70,
0x3a, 0x2f, 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f,
0x75, 0x69, 0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a,
0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c,
0xd, 0xa, 0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e,
0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f,
0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65,
0x22, 0x3e, 0x3c, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e,
0x3c, 0x68, 0x31, 0x3e, 0x34, 0x30, 0x34, 0x20, 0x2d, 0x20,
0x66, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66,
0x6f, 0x75, 0x6e, 0x64, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0x3c,
0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e, 0x3c, 0x2f,
0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c, 0x2f, 0x68, 0x74, 0x6d,
0x6c, 0x3e, };
static const char data_control_html[] = {
/* /control.html */
0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa,
0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xd, 0xa, 0x3c, 0x74,
0x69, 0x74, 0x6c, 0x65, 0x3e, 0x41, 0x54, 0x39, 0x31, 0x53,
0x41, 0x4d, 0x37, 0x58, 0x20, 0x45, 0x6d, 0x62, 0x65, 0x64,
0x64, 0x65, 0x64, 0x20, 0x57, 0x45, 0x42, 0x20, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67,
0x20, 0x75, 0x49, 0x50, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x46,
0x72, 0x65, 0x65, 0x52, 0x54, 0x4f, 0x53, 0x3c, 0x2f, 0x74,
0x69, 0x74, 0x6c, 0x65, 0x3e, 0xd, 0xa, 0x3c, 0x2f, 0x68,
0x65, 0x61, 0x64, 0x3e, 0xd, 0xa, 0x3c, 0x62, 0x6f, 0x64,
0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d,
0x22, 0x23, 0x63, 0x63, 0x63, 0x63, 0x66, 0x66, 0x22, 0x3e,
0xd, 0xa, 0x3c, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x66, 0x61,
0x63, 0x65, 0x3d, 0x22, 0x61, 0x72, 0x69, 0x61, 0x6c, 0x22,
0x3e, 0xd, 0xa, 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, 0x72,
0x63, 0x3d, 0x22, 0x2f, 0x69, 0x6d, 0x67, 0x2f, 0x6c, 0x6f,
0x67, 0x6f, 0x2e, 0x70, 0x6e, 0x67, 0x22, 0x20, 0x61, 0x6c,
0x69, 0x67, 0x6e, 0x3d, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74,
0x22, 0x3e, 0xd, 0xa, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65,
0x66, 0x3d, 0x22, 0x2f, 0x63, 0x67, 0x69, 0x2f, 0x72, 0x74,
0x6f, 0x73, 0x22, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
0x3d, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x3e, 0x54, 0x61,
0x73, 0x6b, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x7c, 0xd,
0xa, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22,
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x74, 0x63, 0x70, 0x22, 0x20,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x22, 0x6d, 0x61,
0x69, 0x6e, 0x22, 0x3e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x20,
0x7c, 0xd, 0xa, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66,
0x3d, 0x22, 0x2f, 0x63, 0x67, 0x69, 0x2f, 0x66, 0x69, 0x6c,
0x65, 0x73, 0x22, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
0x3d, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x3e, 0x46, 0x69,
0x6c, 0x65, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x7c, 0xd,
0xa, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22,
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73,
0x22, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x22,
0x6d, 0x61, 0x69, 0x6e, 0x22, 0x3e, 0x53, 0x74, 0x61, 0x74,
0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x3c, 0x2f, 0x61, 0x3e,
0x3c, 0x62, 0x72, 0x3e, 0xd, 0xa, 0x3c, 0x62, 0x72, 0x3e,
0xd, 0xa, 0x3c, 0x2f, 0x66, 0x6f, 0x6e, 0x74, 0x3e, 0xd,
0xa, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xd, 0xa,
0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa, 0xd,
0xa, 0xd, 0xa, 0xd, 0xa, 0xd, 0xa, 0xd, 0xa, };
static const char data_files_footer_plain[] = {
/* /files_footer.plain */
0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0,
0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e,
0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0xd, 0xa,
0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xd, 0xa, 0x3c,
0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa, };
static const char data_files_header_html[] = {
/* /files_header.html */
0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa,
0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f,
0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23, 0x43, 0x43, 0x43, 0x43,
0x46, 0x46, 0x22, 0x3e, 0xd, 0xa, 0x3c, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x3e, 0xd, 0xa, 0x3c, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22,
0x36, 0x30, 0x30, 0x22, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3d, 0x22, 0x30, 0x22, 0x3e, 0xd, 0xa, };
static const char data_stats_footer_plain[] = {
/* /stats_footer.plain */
0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0,
0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e,
0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0xd, 0xa,
0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xd, 0xa, 0x3c,
0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa, };
static const char data_stats_header_html[] = {
/* /stats_header.html */
0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa,
0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f,
0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23, 0x63, 0x63, 0x63, 0x63,
0x66, 0x66, 0x22, 0x3e, 0xd, 0xa, 0x3c, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x3e, 0xd, 0xa, 0x3c, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22,
0x36, 0x30, 0x30, 0x22, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3d, 0x22, 0x30, 0x22, 0x3e, 0xd, 0xa, 0x3c, 0x74,
0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0xd, 0xa, 0x3c, 0x70,
0x72, 0x65, 0x3e, 0xd, 0xa, 0x49, 0x50, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61,
0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x64, 0x72, 0x6f, 0x70,
0x70, 0x65, 0x64, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61,
0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x72, 0x65, 0x63, 0x65,
0x69, 0x76, 0x65, 0x64, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50,
0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x73, 0x65, 0x6e,
0x74, 0xd, 0xa, 0x49, 0x50, 0x20, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x73, 0x20, 0x20, 0x20, 0x20, 0x49, 0x50, 0x20, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x68, 0x65, 0x61,
0x64, 0x65, 0x72, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
0xd, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x50, 0x20, 0x6c, 0x65,
0x6e, 0x67, 0x74, 0x68, 0x2c, 0x20, 0x68, 0x69, 0x67, 0x68,
0x20, 0x62, 0x79, 0x74, 0x65, 0xd, 0xa, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x49, 0x50, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c,
0x20, 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x79, 0x74, 0x65, 0xd,
0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x49, 0x50, 0x20, 0x66, 0x72, 0x61,
0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0xd, 0xa, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x68,
0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0xd, 0xa, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x20, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xd, 0xa, 0x49, 0x43, 0x4d,
0x50, 0x9, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61, 0x63,
0x6b, 0x65, 0x74, 0x73, 0x20, 0x64, 0x72, 0x6f, 0x70, 0x70,
0x65, 0x64, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61, 0x63,
0x6b, 0x65, 0x74, 0x73, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69,
0x76, 0x65, 0x64, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61,
0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x73, 0x65, 0x6e, 0x74,
0xd, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0xd, 0xa, 0x54, 0x43,
0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x64,
0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0xd, 0xa, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x72,
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0xd, 0xa, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20,
0x73, 0x65, 0x6e, 0x74, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x20, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x73, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44,
0x61, 0x74, 0x61, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74,
0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20,
0x41, 0x43, 0x4b, 0x73, 0xd, 0xa, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52,
0x65, 0x73, 0x65, 0x74, 0x73, 0xd, 0xa, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x52, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0xd, 0xa, 0x9, 0x20, 0x20,
0x20, 0x20, 0x20, 0x4e, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x76, 0x61,
0x6c, 0x69, 0x61, 0x62, 0x6c, 0x65, 0xd, 0xa, 0x9, 0x20,
0x20, 0x20, 0x20, 0x20, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d,
0x70, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6c, 0x6f,
0x73, 0x65, 0x64, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x73, 0xd,
0xa, 0x3c, 0x2f, 0x70, 0x72, 0x65, 0x3e, 0x9, 0x20, 0x20,
0x20, 0x20, 0x20, 0xd, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e,
0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x70, 0x72, 0x65, 0x3e, };
static const char data_tcp_footer_plain[] = {
/* /tcp_footer.plain */
0x2f, 0x74, 0x63, 0x70, 0x5f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0,
0xd, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74,
0x72, 0x3e, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e,
0xd, 0xa, 0x3c, 0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x3e, 0xd, 0xa, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
0xd, 0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, };
static const char data_tcp_header_html[] = {
/* /tcp_header.html */
0x2f, 0x74, 0x63, 0x70, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa,
0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f,
0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23, 0x63, 0x63, 0x63, 0x63,
0x66, 0x66, 0x22, 0x3e, 0xd, 0xa, 0x3c, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x3e, 0xd, 0xa, 0x3c, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22,
0x36, 0x30, 0x30, 0x22, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3d, 0x22, 0x30, 0x22, 0x3e, 0xd, 0xa, 0x3c, 0x74,
0x72, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x52, 0x65, 0x6d, 0x6f,
0x74, 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68,
0x3e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x74, 0x68,
0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x52, 0x65, 0x74, 0x72, 0x61,
0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x54,
0x69, 0x6d, 0x65, 0x72, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c,
0x74, 0x68, 0x3e, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x3c, 0x2f,
0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xd, 0xa,
0xd, 0xa, };
static const char data_img_logo_png[] = {
/* /img/logo.png */
0x2f, 0x69, 0x6d, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x6e, 0x67, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69,
0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0xd, 0xa,
0xd, 0xa, 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa,
00, 00, 00, 0xd, 0x49, 0x48, 0x44, 0x52, 00, 00,
00, 0xec, 00, 00, 00, 0x5c, 0x8, 0x3, 00, 00,
00, 0x5a, 0xc7, 0xa9, 0x53, 00, 00, 0x3, 00, 0x50,
0x4c, 0x54, 0x45, 00, 00, 00, 0x3, 0x3, 0x3, 0x4,
0x4, 0x4, 0x6, 0x6, 0x6, 0x8, 0x8, 0x8, 0xa, 0xa,
0xa, 0xc, 0xc, 0xc, 0xe, 0xe, 0xe, 0x10, 0x10, 0x10,
0x12, 0x12, 0x12, 0x14, 0x14, 0x14, 0x16, 0x16, 0x16, 0x18,
0x18, 0x18, 0x1a, 0x1a, 0x1a, 0x1c, 0x1c, 0x1c, 0x21, 0x21,
0x21, 0x25, 0x25, 0x25, 0x28, 0x28, 0x28, 0x2c, 0x2c, 0x2c,
0x2e, 0x2e, 0x2e, 0x30, 0x30, 0x30, 0x32, 0x32, 0x32, 0x34,
0x34, 0x34, 0x36, 0x36, 0x36, 0x38, 0x38, 0x38, 0x3a, 0x3a,
0x3a, 0x3e, 0x3e, 0x3e, 0x40, 0x40, 0x40, 0x43, 0x43, 0x43,
0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x4a, 0x4a, 0x4a, 0x4d,
0x4d, 0x4d, 0x50, 0x50, 0x50, 0x52, 0x52, 0x52, 0x55, 0x55,
0x55, 0x58, 0x58, 0x58, 0x5c, 0x5c, 0x5c, 0x60, 0x60, 0x60,
0x62, 0x62, 0x62, 0x66, 0x66, 0x66, 0x69, 0x69, 0x69, 0x6b,
0x6b, 0x6b, 0x6e, 0x6e, 0x6e, 0x71, 0x71, 0x71, 0x73, 0x73,
0x73, 0x74, 0x74, 0x74, 0x77, 0x77, 0x77, 0x78, 0x78, 0x78,
0x7a, 0x7a, 0x7a, 0x7c, 0x7c, 0x7c, 0x7e, 0x7e, 0x7e, 00,
0xd9, 00, 0x4, 0xd8, 0x4, 0x6, 0xda, 0x6, 0x8, 0xda,
0x8, 0xc, 0xda, 0xc, 0x15, 0xdc, 0x15, 0x18, 0xdc, 0x18,
0x1a,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 0xff, 0xf0, 0xf3, 0xfd, 0xf3, 0xf2, 0xff,
0xf2, 0xf5, 0xfd, 0xf5, 0xf4, 0xfe, 0xf4, 0xf6, 0xfe, 0xf6,
0xf8, 0xf8, 0xf8, 0xfa, 0xfa, 0xfa, 0xf8, 0xfe, 0xf8, 0xfa,
0xfe, 0xfa, 0xff, 00, 00, 0xfc, 0xfe, 0xfc, 0xfe, 0xfe,
0xfe, 0xd7, 0xd6, 0xbe, 0x1c, 00, 00, 00, 0xfe, 0x74,
0x52, 0x4e, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 00, 0xd8, 0xd9, 0xc,
0x71, 00, 00, 0xc, 0xc6, 0x49, 0x44, 0x41, 0x54, 0x78,
0xda, 0xed, 0x9c, 0xf, 0x50, 0x14, 0xd7, 0x19, 0xc0, 0xdf,
0xc2, 0x21, 0x2c, 0x77, 0x27, 0xa0, 0x1, 0x3d, 0x15, 0x10,
0x4, 0x39, 0x23, 0xe3, 0x14, 0x1, 0xeb, 0x1f, 0xc0, 0x51,
0x87, 0x88, 0x81, 0x91, 0x92, 0xa8, 0x41, 0x32, 0x49, 0xac,
0xb6, 0x8e, 0xa5, 0xa6, 0x8e, 0x1d, 0x3b, 0x6d, 0x9c, 0xce,
0x64, 0x3a, 0xda, 0xd8, 0x4e, 0xda, 0x4e, 0x67, 0x9c, 0x74,
0x92, 0x36, 0xa, 0xb6, 0x62, 0xac, 0xa6, 0x15, 0xdb, 0x10,
0xe8, 0x58, 0xb4, 0xa, 0x6, 0x14, 0x73, 0x54, 0x73, 0x53,
0x8e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 0x80, 0xdf, 0xbf, 0xa5, 0x7f, 0x2f, 0xe9, 0x17, 0xcd,
0xf4, 0x47, 0x15, 0x44, 0x8, 0xda, 0xc8, 0x7e, 0x36, 0x50,
0x28, 0x6e, 0x21, 0xfe, 0x1f, 0xd2, 0xa8, 0xa2, 0x91, 0xdc,
0x83, 0x90, 0x3, 00, 00, 00, 00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82, };
static const char data_cgi_files[] = {
/* /cgi/files */
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0,
0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x73, 0x20,
0x74, 0x68, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73,
0x20, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63,
0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x66, 0x66,
0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x65,
0x73, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0xd, 0xa,
0x23, 0x20, 0x77, 0x65, 0x62, 0x20, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x2e, 0xd, 0xa, 0x23, 0xd, 0xa, 0x23, 0x20,
0x46, 0x69, 0x72, 0x73, 0x74, 0x2c, 0x20, 0x77, 0x65, 0x20,
0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x74, 0x68,
0x65, 0x20, 0x48, 0x54, 0x4d, 0x4c, 0x20, 0x68, 0x65, 0x61,
0x64, 0x65, 0x72, 0x2e, 0xd, 0xa, 0x69, 0x20, 0x2f, 0x66,
0x69, 0x6c, 0x65, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa, 0x23, 0x20,
0x50, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20,
0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f,
0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65,
0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x61, 0x6c, 0x6c,
0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x70,
0x72, 0x69, 0x6e, 0x74, 0x73, 0xd, 0xa, 0x23, 0x20, 0x74,
0x68, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20,
0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73,
0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66,
0x69, 0x6c, 0x65, 0x2e, 0xd, 0xa, 0x74, 0x20, 0x3c, 0x74,
0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, 0x68,
0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x2f, 0x69,
0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3c,
0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74,
0x64, 0x3e, 0xd, 0xa, 0x63, 0x20, 0x62, 0x20, 0x2f, 0x69,
0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xd,
0xa, 0x74, 0x20, 0x3c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x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x20, 0x3c, 0x74,
0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, 0x68,
0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x34, 0x30, 0x34, 0x2e,
0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x2f, 0x34, 0x30, 0x34,
0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3c, 0x2f, 0x61, 0x3e, 0x3c,
0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0xd, 0xa,
0x63, 0x20, 0x62, 0x20, 0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68,
0x74, 0x6d, 0x6c, 0xd, 0xa, 0x74, 0x20, 0x3c, 0x2f, 0x74,
0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x20, 0x3c, 0x74,
0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, 0x68,
0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x63, 0x67, 0x69, 0x2f,
0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x3e, 0x2f, 0x63, 0x67,
0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x3c, 0x2f, 0x61,
0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e,
0xd, 0xa, 0x63, 0x20, 0x62, 0x20, 0x2f, 0x63, 0x67, 0x69,
0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0xd, 0xa, 0x74, 0x20,
0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e,
0x20, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c,
0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x63,
0x67, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0x3e,
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73,
0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c,
0x74, 0x64, 0x3e, 0xd, 0xa, 0x63, 0x20, 0x62, 0x20, 0x2f,
0x63, 0x67, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xd,
0xa, 0x74, 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f,
0x74, 0x72, 0x3e, 0x20, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74,
0x64, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d,
0x22, 0x2f, 0x63, 0x67, 0x69, 0x2f, 0x74, 0x63, 0x70, 0x22,
0x3e, 0x2f, 0x63, 0x67, 0x69, 0x2f, 0x74, 0x63, 0x70, 0x3c,
0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74,
0x64, 0x3e, 0xd, 0xa, 0x63, 0x20, 0x62, 0x20, 0x2f, 0x63,
0x67, 0x69, 0x2f, 0x74, 0x63, 0x70, 0xd, 0xa, 0x74, 0x20,
0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e,
0xd, 0xa, 0x23, 0x20, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64,
0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x48, 0x54, 0x4d, 0x4c,
0x20, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0xd, 0xa,
0x69, 0x20, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x66,
0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x6c, 0x61, 0x69,
0x6e, 0xd, 0xa, 0x23, 0x20, 0x45, 0x6e, 0x64, 0x20, 0x6f,
0x66, 0x20, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0xd,
0xa, 0x2e, };
static const char data_cgi_stats[] = {
/* /cgi/stats */
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0,
0x69, 0x20, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x68,
0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c,
0xd, 0xa, 0x63, 0x20, 0x61, 0xd, 0xa, 0x69, 0x20, 0x2f,
0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x66, 0x6f, 0x6f, 0x74,
0x65, 0x72, 0x2e, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0xd, 0xa,
0x2e, 0xd, 0xa, };
static const char data_cgi_tcp[] = {
/* /cgi/tcp */
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x74, 0x63, 0x70, 0,
0x69, 0x20, 0x2f, 0x74, 0x63, 0x70, 0x5f, 0x68, 0x65, 0x61,
0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
0x63, 0x20, 0x63, 0xd, 0xa, 0x69, 0x20, 0x2f, 0x74, 0x63,
0x70, 0x5f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x70,
0x6c, 0x61, 0x69, 0x6e, 0xd, 0xa, 0x2e, };
static const char data_cgi_rtos[] = {
/* /cgi/rtos */
0x2f, 0x63, 0x67, 0x69, 0x2f, 0x72, 0x74, 0x6f, 0x73, 0,
0x74, 0x20, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x3c, 0x68,
0x65, 0x61, 0x64, 0x3e, 0x3c, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x3e, 0x75, 0x49, 0x50, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x20,
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x45, 0x6d, 0x62,
0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x54, 0x43, 0x50, 0x2f,
0x49, 0x50, 0x20, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x20, 0x4f,
0x6e, 0x20, 0x46, 0x72, 0x65, 0x65, 0x52, 0x54, 0x4f, 0x53,
0x20, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x3c, 0x2f, 0x74,
0x69, 0x74, 0x6c, 0x65, 0x3e, 0x3c, 0x2f, 0x68, 0x65, 0x61,
0x64, 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x42, 0x47,
0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x3d, 0x22, 0x23, 0x43, 0x43,
0x43, 0x43, 0x46, 0x46, 0x22, 0x3e, 0x3c, 0x66, 0x6f, 0x6e,
0x74, 0x20, 0x66, 0x61, 0x63, 0x65, 0x3d, 0x22, 0x61, 0x72,
0x69, 0x61, 0x6c, 0x22, 0x3e, 0x3c, 0x73, 0x6d, 0x61, 0x6c,
0x6c, 0x3e, 0x3c, 0x62, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x72,
0x74, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x22, 0x20, 0x74,
0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x22, 0x5f, 0x74, 0x6f,
0x70, 0x22, 0x3e, 0x46, 0x72, 0x65, 0x65, 0x52, 0x54, 0x4f,
0x53, 0x20, 0x48, 0x6f, 0x6d, 0x65, 0x70, 0x61, 0x67, 0x65,
0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x62, 0x3e, 0x3c, 0x2f,
0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x3e, 0x3c, 0x70, 0x3e, 0x3c,
0x48, 0x31, 0x3e, 0x41, 0x54, 0x39, 0x31, 0x53, 0x41, 0x4d,
0x37, 0x58, 0x20, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65,
0x64, 0x20, 0x57, 0x45, 0x42, 0x20, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x20, 0x44, 0x65, 0x6d, 0x6f, 0x3c, 0x62, 0x72,
0x3e, 0x3c, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x3e, 0x55, 0x73,
0x69, 0x6e, 0x67, 0x20, 0x75, 0x49, 0x50, 0x20, 0x61, 0x6e,
0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65,
0x52, 0x54, 0x4f, 0x53, 0x20, 0x72, 0x65, 0x61, 0x6c, 0x20,
0x74, 0x69, 0x6d, 0x65, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65,
0x6c, 0x3c, 0x2f, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x3e, 0x3c,
0x2f, 0x68, 0x31, 0x3e, 0x3c, 0x70, 0x3e, 0x54, 0x68, 0x65,
0x73, 0x65, 0x20, 0x70, 0x61, 0x67, 0x65, 0x73, 0x20, 0x61,
0x72, 0x65, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x73,
0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61,
0x6e, 0x20, 0x41, 0x74, 0x6d, 0x65, 0x6c, 0x20, 0x41, 0x54,
0x39, 0x31, 0x53, 0x41, 0x4d, 0x37, 0x58, 0x32, 0x35, 0x36,
0x20, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x63, 0x6f, 0x6e, 0x74,
0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x75, 0x73,
0x69, 0x6e, 0x67, 0x20, 0x41, 0x64, 0x61, 0x6d, 0x20, 0x44,
0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x20, 0x6f, 0x70, 0x65,
0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x75,
0x49, 0x50, 0x20, 0x54, 0x43, 0x50, 0x2f, 0x49, 0x50, 0x20,
0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x3c, 0x70, 0x3e, 0x54,
0x68, 0x65, 0x20, 0x75, 0x49, 0x50, 0x20, 0x73, 0x74, 0x61,
0x63, 0x6b, 0x20, 0x69, 0x73, 0x20, 0x65, 0x78, 0x65, 0x63,
0x75, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x72, 0x6f, 0x6d,
0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20,
0x74, 0x61, 0x73, 0x6b, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72,
0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x6f,
0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65,
0x52, 0x54, 0x4f, 0x53, 0x20, 0x72, 0x65, 0x61, 0x6c, 0x20,
0x74, 0x69, 0x6d, 0x65, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65,
0x6c, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x20,
0x73, 0x68, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,
0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73,
0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74,
0x68, 0x65, 0x20, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x20, 0x69,
0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x6d, 0x6f,
0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x69, 0x74,
0x6f, 0x6e, 0x2e, 0x3c, 0x70, 0x3e, 0x3c, 0x70, 0x72, 0x65,
0x3e, 0x54, 0x61, 0x73, 0x6b, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x74, 0x61, 0x74, 0x65,
0x20, 0x20, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79,
0x20, 0x20, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x9, 0x23, 0x3c,
0x62, 0x72, 0x3e, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a,
0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a,
0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a,
0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a,
0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a,
0x2a, 0x3c, 0x62, 0x72, 0x3e, 0xa, 0x63, 0x20, 0x64, 0xa,
0x74, 0x20, 0x3c, 0x2f, 0x70, 0x72, 0x65, 0x3e, 0x3c, 0x2f,
0x66, 0x6f, 0x6e, 0x74, 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64,
0x79, 0x3e, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa,
0x2e, 0xa, 0xa, 0xa, };
static const char data_index_html[] = {
/* /index.html */
0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xd, 0xa,
0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xd, 0xa, 0x3c, 0x2f,
0x68, 0x65, 0x61, 0x64, 0x3e, 0xd, 0xa, 0xd, 0xa, 0x3c,
0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x74, 0x20, 0x63,
0x6f, 0x6c, 0x73, 0x3d, 0x22, 0x2a, 0x22, 0x20, 0x72, 0x6f,
0x77, 0x73, 0x3d, 0x22, 0x31, 0x32, 0x30, 0x2c, 0x2a, 0x22,
0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x62, 0x6f, 0x72, 0x64,
0x65, 0x72, 0x3d, 0x22, 0x6e, 0x6f, 0x22, 0x3e, 0x20, 0xd,
0xa, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x20,
0x73, 0x72, 0x63, 0x3d, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x72,
0x6f, 0x6c, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0xd,
0xa, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x20,
0x73, 0x72, 0x63, 0x3d, 0x22, 0x2f, 0x63, 0x67, 0x69, 0x2f,
0x72, 0x74, 0x6f, 0x73, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
0x3d, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x3e, 0xd, 0xa,
0x3c, 0x2f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x74,
0x3e, 0xd, 0xa, 0xd, 0xa, 0x3c, 0x6e, 0x6f, 0x66, 0x72,
0x61, 0x6d, 0x65, 0x73, 0x3e, 0xd, 0xa, 0x3c, 0x62, 0x6f,
0x64, 0x79, 0x3e, 0xd, 0xa, 0x59, 0x6f, 0x75, 0x72, 0x20,
0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x20, 0x6d, 0x75,
0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74,
0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0xd, 0xa, 0x3c,
0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xd, 0xa, 0x3c, 0x2f,
0x6e, 0x6f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x3e, 0xd,
0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, };
const struct fsdata_file file_404_html[] = {{NULL, data_404_html, data_404_html + 10, sizeof(data_404_html) - 10}};
const struct fsdata_file file_control_html[] = {{file_404_html, data_control_html, data_control_html + 14, sizeof(data_control_html) - 14}};
const struct fsdata_file file_files_footer_plain[] = {{file_control_html, data_files_footer_plain, data_files_footer_plain + 20, sizeof(data_files_footer_plain) - 20}};
const struct fsdata_file file_files_header_html[] = {{file_files_footer_plain, data_files_header_html, data_files_header_html + 19, sizeof(data_files_header_html) - 19}};
const struct fsdata_file file_stats_footer_plain[] = {{file_files_header_html, data_stats_footer_plain, data_stats_footer_plain + 20, sizeof(data_stats_footer_plain) - 20}};
const struct fsdata_file file_stats_header_html[] = {{file_stats_footer_plain, data_stats_header_html, data_stats_header_html + 19, sizeof(data_stats_header_html) - 19}};
const struct fsdata_file file_tcp_footer_plain[] = {{file_stats_header_html, data_tcp_footer_plain, data_tcp_footer_plain + 18, sizeof(data_tcp_footer_plain) - 18}};
const struct fsdata_file file_tcp_header_html[] = {{file_tcp_footer_plain, data_tcp_header_html, data_tcp_header_html + 17, sizeof(data_tcp_header_html) - 17}};
const struct fsdata_file file_img_logo_png[] = {{file_tcp_header_html, data_img_logo_png, data_img_logo_png + 14, sizeof(data_img_logo_png) - 14}};
const struct fsdata_file file_cgi_files[] = {{file_img_logo_png, data_cgi_files, data_cgi_files + 11, sizeof(data_cgi_files) - 11}};
const struct fsdata_file file_cgi_stats[] = {{file_cgi_files, data_cgi_stats, data_cgi_stats + 11, sizeof(data_cgi_stats) - 11}};
const struct fsdata_file file_cgi_tcp[] = {{file_cgi_stats, data_cgi_tcp, data_cgi_tcp + 9, sizeof(data_cgi_tcp) - 9}};
const struct fsdata_file file_cgi_rtos[] = {{file_cgi_tcp, data_cgi_rtos, data_cgi_rtos + 10, sizeof(data_cgi_rtos) - 10}};
const struct fsdata_file file_index_html[] = {{file_cgi_rtos, data_index_html, data_index_html + 12, sizeof(data_index_html) - 12}};
#define FS_ROOT file_index_html
#define FS_NUMFILES 14

View file

@ -1,64 +0,0 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: fsdata.h,v 1.4.2.1 2003/10/04 22:54:06 adam Exp $
*/
#ifndef __FSDATA_H__
#define __FSDATA_H__
#include "uipopt.h"
struct fsdata_file {
const struct fsdata_file *next;
const char *name;
const char *data;
const int len;
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
u16_t count;
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
};
struct fsdata_file_noconst {
struct fsdata_file *next;
char *name;
char *data;
int len;
#ifdef FS_STATISTICS
#if FS_STATISTICS == 1
u16_t count;
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
};
#endif /* __FSDATA_H__ */

View file

@ -1,372 +0,0 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \defgroup httpd Web server
* @{
*
* The uIP web server is a very simplistic implementation of an HTTP
* server. It can serve web pages and files from a read-only ROM
* filesystem, and provides a very small scripting language.
*
* The script language is very simple and works as follows. Each
* script line starts with a command character, either "i", "t", "c",
* "#" or ".". The "i" command tells the script interpreter to
* "include" a file from the virtual file system and output it to the
* web browser. The "t" command should be followed by a line of text
* that is to be output to the browser. The "c" command is used to
* call one of the C functions from the httpd-cgi.c file. A line that
* starts with a "#" is ignored (i.e., the "#" denotes a comment), and
* the "." denotes the last script line.
*
* The script that produces the file statistics page looks somewhat
* like this:
*
\code
i /header.html
t <h1>File statistics</h1><br><table width="100%">
t <tr><td><a href="/index.html">/index.html</a></td><td>
c a /index.html
t </td></tr> <tr><td><a href="/cgi/files">/cgi/files</a></td><td>
c a /cgi/files
t </td></tr> <tr><td><a href="/cgi/tcp">/cgi/tcp</a></td><td>
c a /cgi/tcp
t </td></tr> <tr><td><a href="/404.html">/404.html</a></td><td>
c a /404.html
t </td></tr></table>
i /footer.plain
.
\endcode
*
*/
/**
* \file
* HTTP server.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd.c,v 1.28.2.6 2003/10/07 13:22:27 adam Exp $
*
*/
#include "uip.h"
#include "httpd.h"
#include "fs.h"
#include "fsdata.h"
#include "cgi.h"
#define NULL (void *)0
/* The HTTP server states: */
#define HTTP_NOGET 0
#define HTTP_FILE 1
#define HTTP_TEXT 2
#define HTTP_FUNC 3
#define HTTP_END 4
#ifdef DEBUG
#include <stdio.h>
#define PRINT(x)
#define PRINTLN(x)
#else /* DEBUG */
#define PRINT(x)
#define PRINTLN(x)
#endif /* DEBUG */
struct httpd_state *hs;
extern const struct fsdata_file file_index_html;
extern const struct fsdata_file file_404_html;
static void next_scriptline(void);
static void next_scriptstate(void);
#define ISO_G 0x47
#define ISO_E 0x45
#define ISO_T 0x54
#define ISO_slash 0x2f
#define ISO_c 0x63
#define ISO_g 0x67
#define ISO_i 0x69
#define ISO_space 0x20
#define ISO_nl 0x0a
#define ISO_cr 0x0d
#define ISO_a 0x61
#define ISO_t 0x74
#define ISO_hash 0x23
#define ISO_period 0x2e
#define httpPORT 80
/*-----------------------------------------------------------------------------------*/
/**
* Initialize the web server.
*
* Starts to listen for incoming connection requests on TCP port 80.
*/
/*-----------------------------------------------------------------------------------*/
void
httpd_init(void)
{
fs_init();
/* Listen to port 80. */
uip_listen(HTONS(httpPORT));
}
/*-----------------------------------------------------------------------------------*/
void
httpd_appcall(void)
{
struct fs_file fsfile;
u8_t i;
switch(uip_conn->lport) {
/* This is the web server: */
case HTONS(httpPORT):
/* Pick out the application state from the uip_conn structure. */
hs = (struct httpd_state *)(uip_conn->appstate);
/* We use the uip_ test functions to deduce why we were
called. If uip_connected() is non-zero, we were called
because a remote host has connected to us. If
uip_newdata() is non-zero, we were called because the
remote host has sent us new data, and if uip_acked() is
non-zero, the remote host has acknowledged the data we
previously sent to it. */
if(uip_connected()) {
/* Since we have just been connected with the remote host, we
reset the state for this connection. The ->count variable
contains the amount of data that is yet to be sent to the
remote host, and the ->state is set to HTTP_NOGET to signal
that we haven't received any HTTP GET request for this
connection yet. */
hs->state = HTTP_NOGET;
hs->count = 0;
return;
} else if(uip_poll()) {
/* If we are polled ten times, we abort the connection. This is
because we don't want connections lingering indefinately in
the system. */
if(hs->count++ >= 10) {
uip_abort();
}
return;
} else if(uip_newdata() && hs->state == HTTP_NOGET) {
/* This is the first data we receive, and it should contain a
GET. */
/* Check for GET. */
if(uip_appdata[0] != ISO_G ||
uip_appdata[1] != ISO_E ||
uip_appdata[2] != ISO_T ||
uip_appdata[3] != ISO_space) {
/* If it isn't a GET, we abort the connection. */
uip_abort();
return;
}
/* Find the file we are looking for. */
for(i = 4; i < 40; ++i) {
if(uip_appdata[i] == ISO_space ||
uip_appdata[i] == ISO_cr ||
uip_appdata[i] == ISO_nl) {
uip_appdata[i] = 0;
break;
}
}
PRINT("request for file ");
PRINTLN(&uip_appdata[4]);
/* Check for a request for "/". */
if(uip_appdata[4] == ISO_slash &&
uip_appdata[5] == 0) {
fs_open(file_index_html.name, &fsfile);
} else {
if(!fs_open((const char *)&uip_appdata[4], &fsfile)) {
PRINTLN("couldn't open file");
fs_open(file_404_html.name, &fsfile);
}
}
if(uip_appdata[4] == ISO_slash &&
uip_appdata[5] == ISO_c &&
uip_appdata[6] == ISO_g &&
uip_appdata[7] == ISO_i &&
uip_appdata[8] == ISO_slash) {
/* If the request is for a file that starts with "/cgi/", we
prepare for invoking a script. */
hs->script = fsfile.data;
next_scriptstate();
} else {
hs->script = NULL;
/* The web server is now no longer in the HTTP_NOGET state, but
in the HTTP_FILE state since is has now got the GET from
the client and will start transmitting the file. */
hs->state = HTTP_FILE;
/* Point the file pointers in the connection state to point to
the first byte of the file. */
hs->dataptr = fsfile.data;
hs->count = fsfile.len;
}
}
if(hs->state != HTTP_FUNC) {
/* Check if the client (remote end) has acknowledged any data that
we've previously sent. If so, we move the file pointer further
into the file and send back more data. If we are out of data to
send, we close the connection. */
if(uip_acked()) {
if(hs->count >= uip_conn->len) {
hs->count -= uip_conn->len;
hs->dataptr += uip_conn->len;
} else {
hs->count = 0;
}
if(hs->count == 0) {
if(hs->script != NULL) {
next_scriptline();
next_scriptstate();
} else {
uip_close();
}
}
}
} else {
/* Call the CGI function. */
if(cgitab[hs->script[2] - ISO_a](uip_acked())) {
/* If the function returns non-zero, we jump to the next line
in the script. */
next_scriptline();
next_scriptstate();
}
}
if(hs->state != HTTP_FUNC && !uip_poll()) {
/* Send a piece of data, but not more than the MSS of the
connection. */
uip_send(( void * ) hs->dataptr, hs->count);
}
/* Finally, return to uIP. Our outgoing packet will soon be on its
way... */
return;
default:
/* Should never happen. */
uip_abort();
break;
}
}
/*-----------------------------------------------------------------------------------*/
/* next_scriptline():
*
* Reads the script until it finds a newline. */
static void
next_scriptline(void)
{
/* Loop until we find a newline character. */
do {
++(hs->script);
} while(hs->script[0] != ISO_nl);
/* Eat up the newline as well. */
++(hs->script);
}
/*-----------------------------------------------------------------------------------*/
/* next_sciptstate:
*
* Reads one line of script and decides what to do next.
*/
static void
next_scriptstate(void)
{
struct fs_file fsfile;
long i;
again:
switch(hs->script[0]) {
case ISO_t:
/* Send a text string. */
hs->state = HTTP_TEXT;
hs->dataptr = &hs->script[2];
/* Calculate length of string. */
for(i = 0; hs->dataptr[i] != ISO_nl; ++i);
hs->count = i;
break;
case ISO_c:
/* Call a function. */
hs->state = HTTP_FUNC;
hs->dataptr = NULL;
hs->count = 0;
cgitab[hs->script[2] - ISO_a](0);
break;
case ISO_i:
/* Include a file. */
hs->state = HTTP_FILE;
if(!fs_open(&hs->script[2], &fsfile)) {
uip_abort();
}
hs->dataptr = fsfile.data;
hs->count = fsfile.len;
break;
case ISO_hash:
/* Comment line. */
next_scriptline();
goto again;
case ISO_period:
/* End of script. */
hs->state = HTTP_END;
uip_close();
break;
default:
uip_abort();
break;
}
}
/*-----------------------------------------------------------------------------------*/
/** @} */
/** @} */

View file

@ -1,380 +0,0 @@
/*$T httpd.c GC 1.138 07/23/05 13:10:49 */
/*
* \addtogroup exampleapps @{ £
* \defgroup httpd Web server @{ The uIP web server is a very simplistic
* implementation of an HTTP server. It can serve web pages and files from a
* read-only ROM filesystem, and provides a very small scripting language. The
* script language is very simple and works as follows. Each script line starts
* with a command character, either "i", "t", "c", "#" or ".". The "i" command
* tells the script interpreter to "include" a file from the virtual file system
* and output it to the web browser. The "t" command should be followed by a line
* of text that is to be output to the browser. The "c" command is used to call
* one of the C functions from the httpd-cgi.c file. A line that starts with a "#"
* is ignored (i.e., the "#" denotes a comment), and the "." denotes the last
* script line. The script that produces the file statistics page looks somewhat
* like this: \code i /header.html t <h1>File statistics</h1><br><table
* width="100%"> t <tr><td><a href="/index.html">/index.html</a></td><td> c a
* /index.html t </td></tr> <tr><td><a href="/cgi/files">/cgi/files</a></td><td> c
* a /cgi/files t </td></tr> <tr><td><a href="/cgi/tcp">/cgi/tcp</a></td><td> c a
* /cgi/tcp t </td></tr> <tr><td><a href="/404.html">/404.html</a></td><td> c a
* /404.html t </td></tr></table> i /footer.plain . \endcode £
* \file HTTP server. \author Adam Dunkels <adam@dunkels.com> £
* Copyright (c) 2001, Adam Dunkels. All rights reserved. Redistribution and use
* in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met: 1. Redistributions of source
* code must retain the above copyright notice, this list of conditions and the
* following disclaimer. 2. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution. 3. The
* name of the author may not be used to endorse or promote products derived from
* this software without specific prior written permission. THIS SOFTWARE IS
* PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This file is part of the uIP TCP/IP stack. $Id: httpd.c,v 1.28.2.6 2003/10/07
* 13:22:27 adam Exp $
*/
#include "uip.h"
#include "httpd.h"
#include "fs.h"
#include "fsdata.h"
#include "cgi.h"
#define NULL ( void * ) 0
/* The HTTP server states: */
#define HTTP_NOGET 0
#define HTTP_FILE 1
#define HTTP_TEXT 2
#define HTTP_FUNC 3
#define HTTP_END 4
#ifdef DEBUG
#include <stdio.h>
#define PRINT( x )
#define PRINTLN( x )
#else /* DEBUG */
#define PRINT( x )
#define PRINTLN( x )
#endif /* DEBUG */
struct httpd_state *hs;
extern const struct fsdata_file file_index_html;
extern const struct fsdata_file file_404_html;
static void next_scriptline( void );
static void next_scriptstate( void );
#define ISO_G 0x47
#define ISO_E 0x45
#define ISO_T 0x54
#define ISO_slash 0x2f
#define ISO_c 0x63
#define ISO_g 0x67
#define ISO_i 0x69
#define ISO_space 0x20
#define ISO_nl 0x0a
#define ISO_cr 0x0d
#define ISO_a 0x61
#define ISO_t 0x74
#define ISO_hash 0x23
#define ISO_period 0x2e
#define httpPORT 80
/*
=======================================================================================================================
Initialize the web server. Starts to listen for incoming connection requests on TCP port 80.
=======================================================================================================================
*/
void httpd_init( void )
{
fs_init();
/* Listen to port 80. */
uip_listen( HTONS( httpPORT ) );
}
/*
=======================================================================================================================
=======================================================================================================================
*/
void httpd_appcall( void )
{
/*~~~~~~~~~~~~~~~~~~~*/
struct fs_file fsfile;
u8_t i;
/*~~~~~~~~~~~~~~~~~~~*/
switch( uip_conn->lport )
{
/* This is the web server: */
case HTONS( httpPORT ):
/* Pick out the application state from the uip_conn structure. */
hs = ( struct httpd_state * ) ( uip_conn->appstate );
/*
* We use the uip_ test functions to deduce why we were called. If uip_connected()
* is non-zero, we were called because a remote host has connected to us. If
* uip_newdata() is non-zero, we were called because the remote host has sent us
* new data, and if uip_acked() is non-zero, the remote host has acknowledged the
* data we previously sent to it.
*/
if( uip_connected() )
{
/*
* Since we have just been connected with the remote host, we reset the state for
* this connection. The ->count variable contains the amount of data that is yet
* to be sent to the remote host, and the ->state is set to HTTP_NOGET to signal
* that we haven't received any HTTP GET request for this connection yet.
*/
hs->state = HTTP_NOGET;
hs->count = 0;
return;
}
else if( uip_poll() )
{
/*
* If we are polled ten times, we abort the connection. This is because we don't
* want connections lingering indefinately in the system.
*/
if( hs->count++ >= 10 )
{
uip_abort();
}
return;
}
else if( uip_newdata() && hs->state == HTTP_NOGET )
{
/*
* This is the first data we receive, and it should contain a GET. £
* Check for GET.
*/
if
(
uip_appdata[0] != ISO_G
|| uip_appdata[1] != ISO_E
|| uip_appdata[2] != ISO_T
|| uip_appdata[3] != ISO_space
)
{
/* If it isn't a GET, we abort the connection. */
uip_abort();
return;
}
/* Find the file we are looking for. */
for( i = 4; i < 40; ++i )
{
if( uip_appdata[i] == ISO_space || uip_appdata[i] == ISO_cr || uip_appdata[i] == ISO_nl )
{
uip_appdata[i] = 0;
break;
}
}
PRINT( "request for file " );
PRINTLN( &uip_appdata[4] );
/* Check for a request for "/". */
if( uip_appdata[4] == ISO_slash && uip_appdata[5] == 0 )
{
fs_open( file_index_html.name, &fsfile );
}
else
{
if( !fs_open( ( const char * ) &uip_appdata[4], &fsfile ) )
{
PRINTLN( "couldn't open file" );
fs_open( file_404_html.name, &fsfile );
}
}
if
(
uip_appdata[4] == ISO_slash
&& uip_appdata[5] == ISO_c
&& uip_appdata[6] == ISO_g
&& uip_appdata[7] == ISO_i
&& uip_appdata[8] == ISO_slash
)
{
/*
* If the request is for a file that starts with "/cgi/", we prepare for invoking
* a script.
*/
hs->script = fsfile.data;
next_scriptstate();
}
else
{
hs->script = NULL;
/*
* The web server is now no longer in the HTTP_NOGET state, but in the HTTP_FILE
* state since is has now got the GET from the client and will start transmitting
* the file.
*/
hs->state = HTTP_FILE;
/*
* Point the file pointers in the connection state to point to the first byte of
* the file.
*/
hs->dataptr = fsfile.data;
hs->count = fsfile.len;
}
}
if( hs->state != HTTP_FUNC )
{
/*
* Check if the client (remote end) has acknowledged any data that we've
* previously sent. If so, we move the file pointer further into the file and send
* back more data. If we are out of data to send, we close the connection.
*/
if( uip_acked() )
{
if( hs->count >= uip_conn->len )
{
hs->count -= uip_conn->len;
hs->dataptr += uip_conn->len;
}
else
{
hs->count = 0;
}
if( hs->count == 0 )
{
if( hs->script != NULL )
{
next_scriptline();
next_scriptstate();
}
else
{
uip_close();
}
}
}
}
else
{
/* Call the CGI function. */
if( cgitab[hs->script[2] - ISO_a](uip_acked()) )
{
/* If the function returns non-zero, we jump to the next line in the script. */
next_scriptline();
next_scriptstate();
}
}
if( hs->state != HTTP_FUNC && !uip_poll() )
{
/* Send a piece of data, but not more than the MSS of the connection. */
uip_send( ( void * ) hs->dataptr, hs->count );
}
/* Finally, return to uIP. Our outgoing packet will soon be on its way... */
return;
default:
/* Should never happen. */
uip_abort();
break;
}
}
/*
=======================================================================================================================
next_scriptline(): Reads the script until it finds a newline.
=======================================================================================================================
*/
static void next_scriptline( void )
{
/* Loop until we find a newline character. */
do
{
++( hs->script );
} while( hs->script[0] != ISO_nl );
/* Eat up the newline as well. */
++( hs->script );
}
/*
=======================================================================================================================
next_sciptstate: Reads one line of script and decides what to do next.
=======================================================================================================================
*/
static void next_scriptstate( void )
{
/*~~~~~~~~~~~~~~~~~~~*/
struct fs_file fsfile;
u8_t i;
/*~~~~~~~~~~~~~~~~~~~*/
again:
switch( hs->script[0] )
{
case ISO_t:
/* Send a text string. */
hs->state = HTTP_TEXT;
hs->dataptr = &hs->script[2];
/* Calculate length of string. */
for( i = 0; hs->dataptr[i] != ISO_nl; ++i );
hs->count = i;
break;
case ISO_c:
/* Call a function. */
hs->state = HTTP_FUNC;
hs->dataptr = NULL;
hs->count = 0;
cgitab[hs->script[2] - ISO_a]( 0 );
break;
case ISO_i:
/* Include a file. */
hs->state = HTTP_FILE;
if( !fs_open( &hs->script[2], &fsfile ) )
{
uip_abort();
}
hs->dataptr = fsfile.data;
hs->count = fsfile.len;
break;
case ISO_hash:
/* Comment line. */
next_scriptline();
goto again;
case ISO_period:
/* End of script. */
hs->state = HTTP_END;
uip_close();
break;
default:
uip_abort();
break;
}
}
/*
* @} £
* @}
*/

View file

@ -1,77 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd.h,v 1.4.2.3 2003/10/06 22:56:44 adam Exp $
*
*/
#ifndef __HTTPD_H__
#define __HTTPD_H__
void httpd_init(void);
void httpd_appcall(void);
/* UIP_APPCALL: the name of the application function. This function
must return void and take no arguments (i.e., C type "void
appfunc(void)"). */
#ifndef UIP_APPCALL
#define UIP_APPCALL httpd_appcall
#endif
struct httpd_state {
u8_t state;
u16_t count;
char *dataptr;
char *script;
};
/* UIP_APPSTATE_SIZE: The size of the application-specific state
stored in the uip_conn structure. */
#ifndef UIP_APPSTATE_SIZE
#define UIP_APPSTATE_SIZE (sizeof(struct httpd_state))
#endif
#define FS_STATISTICS 1
extern struct httpd_state *hs;
#endif /* __HTTPD_H__ */

View file

@ -1,67 +0,0 @@
// Copyright (c) 2001-2004 Rowley Associates Limited.
//
// This file may be distributed under the terms of the License Agreement
// provided with this software.
//
// THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
////////////////////////////////////////////////////////////////////////////////
//
// Olimex LPC-P1 LED Example
//
// Description
// -----------
// This example demonstrates writing to the programmable peripheral interface.
//
////////////////////////////////////////////////////////////////////////////////
#include <targets/LPC210x.h>
#define LED_RED (1<<8)
#define LED_GREEN (1<<10)
#define LED_YELLOW (1<<11)
#define LED1 LED_YELLOW
static void
ledInit()
{
IODIR |= LED1;
IOSET = LED1;
}
static void
ledOn(void)
{
IOCLR = LED1;
}
static void
ledOff(void)
{
IOSET = LED1;
}
void
delay(int d)
{
for(; d; --d);
}
int
main(void)
{
MAMCR = 2;
ledInit();
while (1)
{
ledOn();
delay(100000);
ledOff();
delay(100000);
}
return 0;
}

View file

@ -1,93 +0,0 @@
#!/usr/bin/perl
open(OUTPUT, "> fsdata.c");
chdir("fs");
open(FILES, "find . -type f |");
while($file = <FILES>) {
# Do not include files in CVS directories nor backup files.
if($file =~ /(CVS|~)/) {
next;
}
chop($file);
open(HEADER, "> /tmp/header") || die $!;
if($file =~ /404.html/) {
print(HEADER "HTTP/1.0 404 File not found\r\n");
} else {
print(HEADER "HTTP/1.0 200 OK\r\n");
}
print(HEADER "Server: uIP/0.9 (http://dunkels.com/adam/uip/)\r\n");
if($file =~ /\.html$/) {
print(HEADER "Content-type: text/html\r\n");
} elsif($file =~ /\.gif$/) {
print(HEADER "Content-type: image/gif\r\n");
} elsif($file =~ /\.png$/) {
print(HEADER "Content-type: image/png\r\n");
} elsif($file =~ /\.jpg$/) {
print(HEADER "Content-type: image/jpeg\r\n");
} else {
print(HEADER "Content-type: text/plain\r\n");
}
print(HEADER "\r\n");
close(HEADER);
unless($file =~ /\.plain$/ || $file =~ /cgi/) {
system("cat /tmp/header $file > /tmp/file");
} else {
system("cp $file /tmp/file");
}
open(FILE, "/tmp/file");
unlink("/tmp/file");
unlink("/tmp/header");
$file =~ s/\.//;
$fvar = $file;
$fvar =~ s-/-_-g;
$fvar =~ s-\.-_-g;
print(OUTPUT "static const char data".$fvar."[] = {\n");
print(OUTPUT "\t/* $file */\n\t");
for($j = 0; $j < length($file); $j++) {
printf(OUTPUT "%#02x, ", unpack("C", substr($file, $j, 1)));
}
printf(OUTPUT "0,\n");
$i = 0;
while(read(FILE, $data, 1)) {
if($i == 0) {
print(OUTPUT "\t");
}
printf(OUTPUT "%#02x, ", unpack("C", $data));
$i++;
if($i == 10) {
print(OUTPUT "\n");
$i = 0;
}
}
print(OUTPUT "};\n\n");
close(FILE);
push(@fvars, $fvar);
push(@files, $file);
}
for($i = 0; $i < @fvars; $i++) {
$file = $files[$i];
$fvar = $fvars[$i];
if($i == 0) {
$prevfile = "NULL";
} else {
$prevfile = "file" . $fvars[$i - 1];
}
print(OUTPUT "const struct fsdata_file file".$fvar."[] = {{$prevfile, data$fvar, ");
print(OUTPUT "data$fvar + ". (length($file) + 1) .", ");
print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n");
}
print(OUTPUT "#define FS_ROOT file$fvars[$i - 1]\n\n");
print(OUTPUT "#define FS_NUMFILES $i");

View file

@ -1,152 +0,0 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \file
* Memory block allocation routines.
* \author Adam Dunkels <adam@sics.se>
*
* The memory block allocation routines provide a simple yet powerful
* set of functions for managing a set of memory blocks of fixed
* size. A set of memory blocks is statically declared with the
* MEMB() macro. Memory blocks are allocated from the declared
* memory by the memb_alloc() function, and are deallocated with the
* memb_free() function.
*
* \note Because of namespace clashes only one MEMB() can be
* declared per C module, and the name scope of a MEMB() memory
* block is local to each C module.
*
* The following example shows how to declare and use a memory block
* called "cmem" which has 8 chunks of memory with each memory chunk
* being 20 bytes large.
*
\code
MEMB(cmem, 20, 8);
int main(int argc, char *argv[]) {
char *ptr;
memb_init(&cmem);
ptr = memb_alloc(&cmem);
if(ptr != NULL) {
do_something(ptr);
} else {
printf("Could not allocate memory.\n");
}
if(memb_free(ptr) == 0) {
printf("Deallocation succeeded.\n");
}
}
\endcode
*
*/
#include <string.h>
#include "memb.h"
/*------------------------------------------------------------------------------*/
/**
* Initialize a memory block that was declared with MEMB().
*
* \param m A memory block previosly declared with MEMB().
*/
/*------------------------------------------------------------------------------*/
void
memb_init(struct memb_blocks *m)
{
memset(m->mem, (m->size + 1) * m->num, 0);
}
/*------------------------------------------------------------------------------*/
/**
* Allocate a memory block from a block of memory declared with MEMB().
*
* \param m A memory block previosly declared with MEMB().
*/
/*------------------------------------------------------------------------------*/
char *
memb_alloc(struct memb_blocks *m)
{
int i;
char *ptr;
ptr = m->mem;
for(i = 0; i < m->num; ++i) {
if(*ptr == 0) {
/* If this block was unused, we increase the reference count to
indicate that it now is used and return a pointer to the
first byte following the reference counter. */
++*ptr;
return ptr + 1;
}
ptr += m->size + 1;
}
/* No free block was found, so we return NULL to indicate failure to
allocate block. */
return NULL;
}
/*------------------------------------------------------------------------------*/
/**
* Deallocate a memory block from a memory block previously declared
* with MEMB().
*
* \param m m A memory block previosly declared with MEMB().
*
* \param ptr A pointer to the memory block that is to be deallocated.
*
* \return The new reference count for the memory block (should be 0
* if successfully deallocated) or -1 if the pointer "ptr" did not
* point to a legal memory block.
*/
/*------------------------------------------------------------------------------*/
char
memb_free(struct memb_blocks *m, char *ptr)
{
int i;
char *ptr2;
/* Walk through the list of blocks and try to find the block to
which the pointer "ptr" points to. */
ptr2 = m->mem;
for(i = 0; i < m->num; ++i) {
if(ptr2 == ptr - 1) {
/* We've found to block to which "ptr" points so we decrease the
reference count and return the new value of it. */
return --*ptr2;
}
ptr2 += m->size + 1;
}
return -1;
}
/*------------------------------------------------------------------------------*/
/**
* Increase the reference count for a memory chunk.
*
* \note No sanity checks are currently made.
*
* \param m m A memory block previosly declared with MEMB().
*
* \param ptr A pointer to the memory chunk for which the reference
* count should be increased.
*
* \return The new reference count.
*/
/*------------------------------------------------------------------------------*/
char
memb_ref(struct memb_blocks *m, char *ptr)
{
return ++*(ptr - 1);
}
/*------------------------------------------------------------------------------*/

View file

@ -1,43 +0,0 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \file
* Memory block allocation routines.
* \author Adam Dunkels <adam@sics.se>
*
*/
#ifndef __MEMB_H__
#define __MEMB_H__
/**
* Declare a memory block.
*
* \param name The name of the memory block (later used with
* memb_init(), memb_alloc() and memb_free()).
*
* \param size The size of each memory chunk, in bytes.
*
* \param num The total number of memory chunks in the block.
*
*/
#define MEMB(name, size, num) \
static char memb_mem[(size + 1) * num]; \
static struct memb_blocks name = {size, num, memb_mem}
struct memb_blocks {
unsigned short size;
unsigned short num;
char *mem;
};
void memb_init(struct memb_blocks *m);
char *memb_alloc(struct memb_blocks *m);
char memb_ref(struct memb_blocks *m, char *ptr);
char memb_free(struct memb_blocks *m, char *ptr);
#endif /* __MEMB_H__ */

View file

@ -1 +0,0 @@
arp -s 172.25.218.210 00-bd-3b-33-05-72

View file

@ -1,202 +0,0 @@
/**
* \addtogroup uip
* @{
*/
/**
* \defgroup slip Serial Line IP (SLIP) protocol
* @{
*
* The SLIP protocol is a very simple way to transmit IP packets over
* a serial line. It does not provide any framing or error control,
* and is therefore not very widely used today.
*
* This SLIP implementation requires two functions for accessing the
* serial device: slipdev_char_poll() and slipdev_char_put(). These
* must be implemented specifically for the system on which the SLIP
* protocol is to be run.
*/
/**
* \file
* SLIP protocol implementation
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: slipdev.c,v 1.1.2.3 2003/10/07 13:23:01 adam Exp $
*
*/
/*
* This is a generic implementation of the SLIP protocol over an RS232
* (serial) device.
*
* Huge thanks to Ullrich von Bassewitz <uz@cc65.org> of cc65 fame for
* and endless supply of bugfixes, insightsful comments and
* suggestions, and improvements to this code!
*/
#include "uip.h"
#define SLIP_END 0300
#define SLIP_ESC 0333
#define SLIP_ESC_END 0334
#define SLIP_ESC_ESC 0335
static u8_t slip_buf[UIP_BUFSIZE];
static u16_t len, tmplen;
static u8_t lastc;
/*-----------------------------------------------------------------------------------*/
/**
* Send the packet in the uip_buf and uip_appdata buffers using the
* SLIP protocol.
*
* The first 40 bytes of the packet (the IP and TCP headers) are read
* from the uip_buf buffer, and the following bytes (the application
* data) are read from the uip_appdata buffer.
*
*/
/*-----------------------------------------------------------------------------------*/
void
slipdev_send(void)
{
u16_t i;
u8_t *ptr;
u8_t c;
slipdev_char_put(SLIP_END);
ptr = uip_buf;
for(i = 0; i < uip_len; ++i) {
if(i == 40) {
ptr = (u8_t *)uip_appdata;
}
c = *ptr++;
switch(c) {
case SLIP_END:
slipdev_char_put(SLIP_ESC);
slipdev_char_put(SLIP_ESC_END);
break;
case SLIP_ESC:
slipdev_char_put(SLIP_ESC);
slipdev_char_put(SLIP_ESC_ESC);
break;
default:
slipdev_char_put(c);
break;
}
}
slipdev_char_put(SLIP_END);
}
/*-----------------------------------------------------------------------------------*/
/**
* Poll the SLIP device for an available packet.
*
* This function will poll the SLIP device to see if a packet is
* available. It uses a buffer in which all avaliable bytes from the
* RS232 interface are read into. When a full packet has been read
* into the buffer, the packet is copied into the uip_buf buffer and
* the length of the packet is returned.
*
* \return The length of the packet placed in the uip_buf buffer, or
* zero if no packet is available.
*/
/*-----------------------------------------------------------------------------------*/
u16_t
slipdev_poll(void)
{
u8_t c;
while(slipdev_char_poll(c)) {
switch(c) {
case SLIP_ESC:
lastc = c;
break;
case SLIP_END:
lastc = c;
/* End marker found, we copy our input buffer to the uip_buf
buffer and return the size of the packet we copied. */
memcpy(uip_buf, slip_buf, len);
tmplen = len;
len = 0;
return tmplen;
default:
if(lastc == SLIP_ESC) {
lastc = c;
/* Previous read byte was an escape byte, so this byte will be
interpreted differently from others. */
switch(c) {
case SLIP_ESC_END:
c = SLIP_END;
break;
case SLIP_ESC_ESC:
c = SLIP_ESC;
break;
}
} else {
lastc = c;
}
slip_buf[len] = c;
++len;
if(len > UIP_BUFSIZE) {
len = 0;
}
break;
}
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
/**
* Initialize the SLIP module.
*
* This function does not initialize the underlying RS232 device, but
* only the SLIP part.
*/
/*-----------------------------------------------------------------------------------*/
void
slipdev_init(void)
{
lastc = len = 0;
}
/*-----------------------------------------------------------------------------------*/
/** @} */
/** @} */

View file

@ -1,88 +0,0 @@
/**
* \addtogroup slip
* @{
*/
/**
* \file
* SLIP header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: slipdev.h,v 1.1.2.3 2003/10/06 22:42:51 adam Exp $
*
*/
#ifndef __SLIPDEV_H__
#define __SLIPDEV_H__
#include "uip.h"
/**
* Put a character on the serial device.
*
* This function is used by the SLIP implementation to put a character
* on the serial device. It must be implemented specifically for the
* system on which the SLIP implementation is to be run.
*
* \param c The character to be put on the serial device.
*/
void slipdev_char_put(u8_t c);
/**
* Poll the serial device for a character.
*
* This function is used by the SLIP implementation to poll the serial
* device for a character. It must be implemented specifically for the
* system on which the SLIP implementation is to be run.
*
* The function should return immediately regardless if a character is
* available or not. If a character is available it should be placed
* at the memory location pointed to by the pointer supplied by the
* arguement c.
*
* \param c A pointer to a byte that is filled in by the function with
* the received character, if available.
*
* \retval 0 If no character is available.
* \retval Non-zero If a character is available.
*/
u8_t slipdev_char_poll(u8_t *c);
void slipdev_init(void);
void slipdev_send(void);
u16_t slipdev_poll(void);
#endif /* __SLIPDEV_H__ */
/** @} */

View file

@ -1,171 +0,0 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: tapdev.c,v 1.7.2.1 2003/10/07 13:23:19 adam Exp $
*/
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/socket.h>
#ifdef linux
#include <sys/ioctl.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#define DEVTAP "/dev/net/tun"
#else /* linux */
#define DEVTAP "/dev/tap0"
#endif /* linux */
#include "uip.h"
static int fd;
static unsigned long lasttime;
static struct timezone tz;
/*-----------------------------------------------------------------------------------*/
void
tapdev_init(void)
{
char buf[1024];
fd = open(DEVTAP, O_RDWR);
if(fd == -1) {
perror("tapdev: tapdev_init: open");
exit(1);
}
#ifdef linux
{
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) {
perror(buf);
exit(1);
}
}
#endif /* Linux */
snprintf(buf, sizeof(buf), "ifconfig tap0 inet %d.%d.%d.%d",
UIP_DRIPADDR0, UIP_DRIPADDR1, UIP_DRIPADDR2, UIP_DRIPADDR3);
system(buf);
lasttime = 0;
}
/*-----------------------------------------------------------------------------------*/
unsigned int
tapdev_read(void)
{
fd_set fdset;
struct timeval tv, now;
int ret;
if(lasttime >= 500000) {
lasttime = 0;
return 0;
}
tv.tv_sec = 0;
tv.tv_usec = 500000 - lasttime;
FD_ZERO(&fdset);
FD_SET(fd, &fdset);
gettimeofday(&now, &tz);
ret = select(fd + 1, &fdset, NULL, NULL, &tv);
if(ret == 0) {
lasttime = 0;
return 0;
}
ret = read(fd, uip_buf, UIP_BUFSIZE);
if(ret == -1) {
perror("tap_dev: tapdev_read: read");
}
gettimeofday(&tv, &tz);
lasttime += (tv.tv_sec - now.tv_sec) * 1000000 + (tv.tv_usec - now.tv_usec);
return ret;
}
/*-----------------------------------------------------------------------------------*/
void
tapdev_send(void)
{
int ret;
struct iovec iov[2];
#ifdef linux
{
char tmpbuf[UIP_BUFSIZE];
int i;
for(i = 0; i < 40 + UIP_LLH_LEN; i++) {
tmpbuf[i] = uip_buf[i];
}
for(; i < uip_len; i++) {
tmpbuf[i] = uip_appdata[i - 40 - UIP_LLH_LEN];
}
ret = write(fd, tmpbuf, uip_len);
}
#else
if(uip_len < 40 + UIP_LLH_LEN) {
ret = write(fd, uip_buf, uip_len + UIP_LLH_LEN);
} else {
iov[0].iov_base = uip_buf;
iov[0].iov_len = 40 + UIP_LLH_LEN;
iov[1].iov_base = (char *)uip_appdata;
iov[1].iov_len = uip_len - (40 + UIP_LLH_LEN);
ret = writev(fd, iov, 2);
}
#endif
if(ret == -1) {
perror("tap_dev: tapdev_send: writev");
exit(1);
}
}
/*-----------------------------------------------------------------------------------*/

View file

@ -1,42 +0,0 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: tapdev.h,v 1.1.2.1 2003/10/04 22:54:17 adam Exp $
*
*/
#ifndef __TAPDEV_H__
#define __TAPDEV_H__
void tapdev_init(void);
unsigned int tapdev_read(void);
void tapdev_send(void);
#endif /* __TAPDEV_H__ */

View file

@ -1,181 +0,0 @@
/**
* \addtogroup telnetd
* @{
*/
/**
* \file
* An example telnet server shell
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki desktop OS.
*
* $Id: telnetd-shell.c,v 1.1.2.1 2003/10/06 22:56:22 adam Exp $
*
*/
#include "uip.h"
#include "telnetd.h"
#include <string.h>
struct ptentry {
char c;
void (* pfunc)(struct telnetd_state *s, char *str);
};
/*-----------------------------------------------------------------------------------*/
static void
parse(struct telnetd_state *s, register char *str, struct ptentry *t)
{
register struct ptentry *p;
char *sstr;
sstr = str;
/* Loop over the parse table entries in t in order to find one that
matches the first character in str. */
for(p = t; p->c != 0; ++p) {
if(*str == p->c) {
/* Skip rest of the characters up to the first space. */
while(*str != ' ') {
++str;
}
/* Skip all spaces.*/
while(*str == ' ') {
++str;
}
/* Call parse table entry function and return. */
p->pfunc(s, str);
return;
}
}
/* Did not find matching entry in parse table. We just call the
default handler supplied by the caller and return. */
p->pfunc(s, str);
}
/*-----------------------------------------------------------------------------------*/
static void
exitt(struct telnetd_state *s, char *str)
{
telnetd_close(s);
}
/*-----------------------------------------------------------------------------------*/
static void
inttostr(register char *str, unsigned int i)
{
str[0] = '0' + i / 100;
if(str[0] == '0') {
str[0] = ' ';
}
str[1] = '0' + (i / 10) % 10;
if(str[1] == '0') {
str[1] = ' ';
}
str[2] = '0' + i % 10;
str[3] = ' ';
str[4] = 0;
}
/*-----------------------------------------------------------------------------------*/
static void
stats(struct telnetd_state *s, char *strr)
{
char str[10];
inttostr(str, uip_stat.ip.recv);
telnetd_output(s, "IP packets received ", str);
inttostr(str, uip_stat.ip.sent);
telnetd_output(s, "IP packets sent ", str);
inttostr(str, uip_stat.ip.drop);
telnetd_output(s, "IP packets dropped ", str);
inttostr(str, uip_stat.icmp.recv);
telnetd_output(s, "ICMP packets received ", str);
inttostr(str, uip_stat.icmp.sent);
telnetd_output(s, "ICMP packets sent ", str);
inttostr(str, uip_stat.icmp.drop);
telnetd_output(s, "ICMP packets dropped ", str);
inttostr(str, uip_stat.tcp.recv);
telnetd_output(s, "TCP packets received ", str);
inttostr(str, uip_stat.tcp.sent);
telnetd_output(s, "TCP packets sent ", str);
inttostr(str, uip_stat.tcp.drop);
telnetd_output(s, "TCP packets dropped ", str);
inttostr(str, uip_stat.tcp.rexmit);
telnetd_output(s, "TCP packets retransmitted ", str);
inttostr(str, uip_stat.tcp.synrst);
telnetd_output(s, "TCP connection attempts ", str);
}
/*-----------------------------------------------------------------------------------*/
static void
help(struct telnetd_state *s, char *str)
{
telnetd_output(s, "Available commands:", "");
telnetd_output(s, "stats - show uIP statistics", "");
telnetd_output(s, "exit - exit shell", "");
telnetd_output(s, "? - show this help", "");
}
/*-----------------------------------------------------------------------------------*/
static void
none(struct telnetd_state *s, char *str)
{
if(strlen(str) > 0) {
telnetd_output(s, "Unknown command", "");
}
}
/*-----------------------------------------------------------------------------------*/
static struct ptentry configparsetab[] =
{{'s', stats},
{'e', exitt},
{'?', help},
/* Default action */
{0, none}};
/*-----------------------------------------------------------------------------------*/
void
telnetd_connected(struct telnetd_state *s)
{
telnetd_output(s, "uIP command shell", "");
telnetd_output(s, "Type '?' for help", "");
telnetd_prompt(s, "uIP-0.9> ");
}
/*-----------------------------------------------------------------------------------*/
void
telnetd_input(struct telnetd_state *s, char *cmd)
{
parse(s, cmd, configparsetab);
telnetd_prompt(s, "uIP-0.9> ");
}
/*-----------------------------------------------------------------------------------*/

View file

@ -1,392 +0,0 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \defgroup telnetd Telnet server
* @{
*
* The uIP telnet server provides a command based interface to uIP. It
* allows using the "telnet" application to access uIP, and implements
* the required telnet option negotiation.
*
* The code is structured in a way which makes it possible to add
* commands without having to rewrite the main telnet code. The main
* telnet code calls two callback functions, telnetd_connected() and
* telnetd_input(), when a telnet connection has been established and
* when a line of text arrives on a telnet connection. These two
* functions can be implemented in a way which suits the particular
* application or environment in which the uIP system is intended to
* be run.
*
* The uIP distribution contains an example telnet shell
* implementation that provides a basic set of commands.
*/
/**
* \file
* Implementation of the Telnet server.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: telnetd.c,v 1.1.2.2 2003/10/07 13:47:50 adam Exp $
*
*/
#include "uip.h"
#include "memb.h"
#include "telnetd.h"
#include <string.h>
#define ISO_nl 0x0a
#define ISO_cr 0x0d
MEMB(linemem, TELNETD_LINELEN, TELNETD_NUMLINES);
static u8_t i;
#define STATE_NORMAL 0
#define STATE_IAC 1
#define STATE_WILL 2
#define STATE_WONT 3
#define STATE_DO 4
#define STATE_DONT 5
#define STATE_CLOSE 6
#define TELNET_IAC 255
#define TELNET_WILL 251
#define TELNET_WONT 252
#define TELNET_DO 253
#define TELNET_DONT 254
/*-----------------------------------------------------------------------------------*/
static char *
alloc_line(void)
{
return memb_alloc(&linemem);
}
/*-----------------------------------------------------------------------------------*/
static void
dealloc_line(char *line)
{
memb_free(&linemem, line);
}
/*-----------------------------------------------------------------------------------*/
static void
sendline(struct telnetd_state *s, char *line)
{
static unsigned int i;
for(i = 0; i < TELNETD_NUMLINES; ++i) {
if(s->lines[i] == NULL) {
s->lines[i] = line;
break;
}
}
if(i == TELNETD_NUMLINES) {
dealloc_line(line);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Close a telnet session.
*
* This function can be called from a telnet command in order to close
* the connection.
*
* \param s The connection which is to be closed.
*
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_close(struct telnetd_state *s)
{
s->state = STATE_CLOSE;
}
/*-----------------------------------------------------------------------------------*/
/**
* Print a prompt on a telnet connection.
*
* This function can be called by the telnet command shell in order to
* print out a command prompt.
*
* \param s A telnet connection.
*
* \param str The command prompt.
*
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_prompt(struct telnetd_state *s, char *str)
{
char *line;
line = alloc_line();
if(line != NULL) {
strncpy(line, str, TELNETD_LINELEN);
sendline(s, line);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Print out a string on a telnet connection.
*
* This function can be called from a telnet command parser in order
* to print out a string of text on the connection. The two strings
* given as arguments to the function will be concatenated, a carrige
* return and a new line character will be added, and the line is
* sent.
*
* \param s The telnet connection.
*
* \param str1 The first string.
*
* \param str2 The second string.
*
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_output(struct telnetd_state *s, char *str1, char *str2)
{
static unsigned len;
char *line;
line = alloc_line();
if(line != NULL) {
len = strlen(str1);
strncpy(line, str1, TELNETD_LINELEN);
if(len < TELNETD_LINELEN) {
strncpy(line + len, str2, TELNETD_LINELEN - len);
}
len = strlen(line);
if(len < TELNETD_LINELEN - 2) {
line[len] = ISO_cr;
line[len+1] = ISO_nl;
line[len+2] = 0;
}
sendline(s, line);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Initialize the telnet server.
*
* This function will perform the necessary initializations and start
* listening on TCP port 23.
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_init(void)
{
memb_init(&linemem);
uip_listen(HTONS(23));
}
/*-----------------------------------------------------------------------------------*/
static void
acked(struct telnetd_state *s)
{
dealloc_line(s->lines[0]);
for(i = 1; i < TELNETD_NUMLINES; ++i) {
s->lines[i - 1] = s->lines[i];
}
}
/*-----------------------------------------------------------------------------------*/
static void
senddata(struct telnetd_state *s)
{
if(s->lines[0] != NULL) {
uip_send(s->lines[0], strlen(s->lines[0]));
}
}
/*-----------------------------------------------------------------------------------*/
static void
getchar(struct telnetd_state *s, u8_t c)
{
if(c == ISO_cr) {
return;
}
s->buf[(int)s->bufptr] = c;
if(s->buf[(int)s->bufptr] == ISO_nl ||
s->bufptr == sizeof(s->buf) - 1) {
if(s->bufptr > 0) {
s->buf[(int)s->bufptr] = 0;
}
telnetd_input(s, s->buf);
s->bufptr = 0;
} else {
++s->bufptr;
}
}
/*-----------------------------------------------------------------------------------*/
static void
sendopt(struct telnetd_state *s, u8_t option, u8_t value)
{
char *line;
line = alloc_line();
if(line != NULL) {
line[0] = TELNET_IAC;
line[1] = option;
line[2] = value;
line[3] = 0;
sendline(s, line);
}
}
/*-----------------------------------------------------------------------------------*/
static void
newdata(struct telnetd_state *s)
{
u16_t len;
u8_t c;
len = uip_datalen();
while(len > 0 && s->bufptr < sizeof(s->buf)) {
c = *uip_appdata;
++uip_appdata;
--len;
switch(s->state) {
case STATE_IAC:
if(c == TELNET_IAC) {
getchar(s, c);
s->state = STATE_NORMAL;
} else {
switch(c) {
case TELNET_WILL:
s->state = STATE_WILL;
break;
case TELNET_WONT:
s->state = STATE_WONT;
break;
case TELNET_DO:
s->state = STATE_DO;
break;
case TELNET_DONT:
s->state = STATE_DONT;
break;
default:
s->state = STATE_NORMAL;
break;
}
}
break;
case STATE_WILL:
/* Reply with a DONT */
sendopt(s, TELNET_DONT, c);
s->state = STATE_NORMAL;
break;
case STATE_WONT:
/* Reply with a DONT */
sendopt(s, TELNET_DONT, c);
s->state = STATE_NORMAL;
break;
case STATE_DO:
/* Reply with a WONT */
sendopt(s, TELNET_WONT, c);
s->state = STATE_NORMAL;
break;
case STATE_DONT:
/* Reply with a WONT */
sendopt(s, TELNET_WONT, c);
s->state = STATE_NORMAL;
break;
case STATE_NORMAL:
if(c == TELNET_IAC) {
s->state = STATE_IAC;
} else {
getchar(s, c);
}
break;
}
}
}
/*-----------------------------------------------------------------------------------*/
void
telnetd_app(void)
{
struct telnetd_state *s;
s = (struct telnetd_state *)uip_conn->appstate;
if(uip_connected()) {
for(i = 0; i < TELNETD_NUMLINES; ++i) {
s->lines[i] = NULL;
}
s->bufptr = 0;
s->state = STATE_NORMAL;
telnetd_connected(s);
senddata(s);
return;
}
if(s->state == STATE_CLOSE) {
s->state = STATE_NORMAL;
uip_close();
return;
}
if(uip_closed()) {
telnetd_output(s, "Connection closed", "");
}
if(uip_aborted()) {
telnetd_output(s, "Connection reset", "");
}
if(uip_timedout()) {
telnetd_output(s, "Connection timed out", "");
}
if(uip_acked()) {
acked(s);
}
if(uip_newdata()) {
newdata(s);
}
if(uip_rexmit() ||
uip_newdata() ||
uip_acked()) {
senddata(s);
} else if(uip_poll()) {
senddata(s);
}
}
/*-----------------------------------------------------------------------------------*/

View file

@ -1,114 +0,0 @@
/**
* \addtogroup telnetd
* @{
*/
/**
* \file
* Header file for the telnet server.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: telnetd.h,v 1.1.2.2 2003/10/07 13:22:27 adam Exp $
*
*/
#ifndef __TELNETD_H__
#define __TELNETD_H__
#include "uip.h"
/**
* The maximum length of a telnet line.
*
* \hideinitializer
*/
#define TELNETD_LINELEN 36
/**
* The number of output lines being buffered for all telnet
* connections.
*
* \hideinitializer
*/
#define TELNETD_NUMLINES 2
/**
* A telnet connection structure.
*/
struct telnetd_state {
char *lines[TELNETD_NUMLINES];
char buf[TELNETD_LINELEN];
char bufptr;
u8_t state;
};
/**
* Callback function that is called when a telnet connection has been
* established.
*
* \param s The telnet connection.
*/
void telnetd_connected(struct telnetd_state *s);
/**
* Callback function that is called when a line of text has arrived on
* a telnet connection.
*
* \param s The telnet connection.
*
* \param cmd The line of text.
*/
void telnetd_input(struct telnetd_state *s, char *cmd);
void telnetd_close(struct telnetd_state *s);
void telnetd_output(struct telnetd_state *s, char *s1, char *s2);
void telnetd_prompt(struct telnetd_state *s, char *str);
void telnetd_app(void);
#ifndef UIP_APPCALL
#define UIP_APPCALL telnetd_app
#endif
#ifndef UIP_APPSTATE_SIZE
#define UIP_APPSTATE_SIZE (sizeof(struct telnetd_state))
#endif
void telnetd_init(void);
#endif /* __TELNET_H__ */
/** @} */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,145 +0,0 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arch.c,v 1.2.2.1 2003/10/04 22:54:17 adam Exp $
*
*/
#include "uip.h"
#include "uip_arch.h"
#define BUF ((uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
#define IP_PROTO_TCP 6
/*-----------------------------------------------------------------------------------*/
void
uip_add32(u8_t *op32, u16_t op16)
{
uip_acc32[3] = op32[3] + (op16 & 0xff);
uip_acc32[2] = op32[2] + (op16 >> 8);
uip_acc32[1] = op32[1];
uip_acc32[0] = op32[0];
if(uip_acc32[2] < (op16 >> 8)) {
++uip_acc32[1];
if(uip_acc32[1] == 0) {
++uip_acc32[0];
}
}
if(uip_acc32[3] < (op16 & 0xff)) {
++uip_acc32[2];
if(uip_acc32[2] == 0) {
++uip_acc32[1];
if(uip_acc32[1] == 0) {
++uip_acc32[0];
}
}
}
}
/*-----------------------------------------------------------------------------------*/
u16_t
uip_chksum(u16_t *sdata, u16_t len)
{
u16_t acc;
for (acc = 0; len > 1; len -= 2) {
u16_t u = ((unsigned char *)sdata)[0] + (((unsigned char *)sdata)[1] << 8);
if ((acc += u) < u) {
/* Overflow, so we add the carry to acc (i.e., increase by
one). */
++acc;
}
++sdata;
}
/* add up any odd byte */
if(len == 1) {
acc += htons(((u16_t)(*(u8_t *)sdata)) << 8);
if(acc < htons(((u16_t)(*(u8_t *)sdata)) << 8)) {
++acc;
}
}
return acc;
}
/*-----------------------------------------------------------------------------------*/
u16_t
uip_ipchksum(void)
{
return uip_chksum((u16_t *)&uip_buf[UIP_LLH_LEN], 20);
}
/*-----------------------------------------------------------------------------------*/
u16_t
uip_tcpchksum(void)
{
u16_t hsum, sum;
/* Compute the checksum of the TCP header. */
hsum = uip_chksum((u16_t *)&uip_buf[20 + UIP_LLH_LEN], 20);
/* Compute the checksum of the data in the TCP packet and add it to
the TCP header checksum. */
sum = uip_chksum((u16_t *)uip_appdata,
(u16_t)(((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 40)));
if((sum += hsum) < hsum) {
++sum;
}
if((sum += BUF->srcipaddr[0]) < BUF->srcipaddr[0]) {
++sum;
}
if((sum += BUF->srcipaddr[1]) < BUF->srcipaddr[1]) {
++sum;
}
if((sum += BUF->destipaddr[0]) < BUF->destipaddr[0]) {
++sum;
}
if((sum += BUF->destipaddr[1]) < BUF->destipaddr[1]) {
++sum;
}
if((sum += (u16_t)htons((u16_t)IP_PROTO_TCP)) < (u16_t)htons((u16_t)IP_PROTO_TCP)) {
++sum;
}
hsum = (u16_t)htons((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 20);
if((sum += hsum) < hsum) {
++sum;
}
return sum;
}
/*-----------------------------------------------------------------------------------*/

View file

@ -1,130 +0,0 @@
/**
* \defgroup uiparch Architecture specific uIP functions
* @{
*
* The functions in the architecture specific module implement the IP
* check sum and 32-bit additions.
*
* The IP checksum calculation is the most computationally expensive
* operation in the TCP/IP stack and it therefore pays off to
* implement this in efficient assembler. The purpose of the uip-arch
* module is to let the checksum functions to be implemented in
* architecture specific assembler.
*
*/
/**
* \file
* Declarations of architecture specific functions.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arch.h,v 1.1.2.2 2003/10/06 15:10:22 adam Exp $
*
*/
#ifndef __UIP_ARCH_H__
#define __UIP_ARCH_H__
#include "uip.h"
/**
* Carry out a 32-bit addition.
*
* Because not all architectures for which uIP is intended has native
* 32-bit arithmetic, uIP uses an external C function for doing the
* required 32-bit additions in the TCP protocol processing. This
* function should add the two arguments and place the result in the
* global variable uip_acc32.
*
* \note The 32-bit integer pointed to by the op32 parameter and the
* result in the uip_acc32 variable are in network byte order (big
* endian).
*
* \param op32 A pointer to a 4-byte array representing a 32-bit
* integer in network byte order (big endian).
*
* \param op16 A 16-bit integer in host byte order.
*/
void uip_add32(u8_t *op32, u16_t op16);
/**
* Calculate the Internet checksum over a buffer.
*
* The Internet checksum is the one's complement of the one's
* complement sum of all 16-bit words in the buffer.
*
* See RFC1071.
*
* \note This function is not called in the current version of uIP,
* but future versions might make use of it.
*
* \param buf A pointer to the buffer over which the checksum is to be
* computed.
*
* \param len The length of the buffer over which the checksum is to
* be computed.
*
* \return The Internet checksum of the buffer.
*/
u16_t uip_chksum(u16_t *buf, u16_t len);
/**
* Calculate the IP header checksum of the packet header in uip_buf.
*
* The IP header checksum is the Internet checksum of the 20 bytes of
* the IP header.
*
* \return The IP header checksum of the IP header in the uip_buf
* buffer.
*/
u16_t uip_ipchksum(void);
/**
* Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
*
* The TCP checksum is the Internet checksum of data contents of the
* TCP segment, and a pseudo-header as defined in RFC793.
*
* \note The uip_appdata pointer that points to the packet data may
* point anywhere in memory, so it is not possible to simply calculate
* the Internet checksum of the contents of the uip_buf buffer.
*
* \return The TCP checksum of the TCP segment in uip_buf and pointed
* to by uip_appdata.
*/
u16_t uip_tcpchksum(void);
/** @} */
#endif /* __UIP_ARCH_H__ */

View file

@ -1,429 +0,0 @@
/**
* \addtogroup uip
* @{
*/
/**
* \defgroup uiparp uIP Address Resolution Protocol
* @{
*
* The Address Resolution Protocol ARP is used for mapping between IP
* addresses and link level addresses such as the Ethernet MAC
* addresses. ARP uses broadcast queries to ask for the link level
* address of a known IP address and the host which is configured with
* the IP address for which the query was meant, will respond with its
* link level address.
*
* \note This ARP implementation only supports Ethernet.
*/
/**
* \file
* Implementation of the ARP Address Resolution Protocol.
* \author Adam Dunkels <adam@dunkels.com>
*
*/
/*
* Copyright (c) 2001-2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arp.c,v 1.7.2.3 2003/10/06 22:42:30 adam Exp $
*
*/
#include "uip_arp.h"
#include <string.h>
struct arp_hdr {
struct uip_eth_hdr ethhdr;
u16_t hwtype;
u16_t protocol;
u8_t hwlen;
u8_t protolen;
u16_t opcode;
struct uip_eth_addr shwaddr;
u16_t sipaddr[2];
struct uip_eth_addr dhwaddr;
u16_t dipaddr[2];
};
struct ethip_hdr {
struct uip_eth_hdr ethhdr;
/* IP header. */
u8_t vhl,
tos,
len[2],
ipid[2],
ipoffset[2],
ttl,
proto;
u16_t ipchksum;
u16_t srcipaddr[2],
destipaddr[2];
};
#define ARP_REQUEST 1
#define ARP_REPLY 2
#define ARP_HWTYPE_ETH 1
struct arp_entry {
u16_t ipaddr[2];
struct uip_eth_addr ethaddr;
u8_t time;
};
struct uip_eth_addr uip_ethaddr = {{UIP_ETHADDR0,
UIP_ETHADDR1,
UIP_ETHADDR2,
UIP_ETHADDR3,
UIP_ETHADDR4,
UIP_ETHADDR5}};
static struct arp_entry arp_table[UIP_ARPTAB_SIZE];
static u16_t ipaddr[2];
static u8_t i, c;
static u8_t arptime;
static u8_t tmpage;
#define BUF ((struct arp_hdr *)&uip_buf[0])
#define IPBUF ((struct ethip_hdr *)&uip_buf[0])
/*-----------------------------------------------------------------------------------*/
/**
* Initialize the ARP module.
*
*/
/*-----------------------------------------------------------------------------------*/
void
uip_arp_init(void)
{
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
memset(arp_table[i].ipaddr, 0, 4);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Periodic ARP processing function.
*
* This function performs periodic timer processing in the ARP module
* and should be called at regular intervals. The recommended interval
* is 10 seconds between the calls.
*
*/
/*-----------------------------------------------------------------------------------*/
void
uip_arp_timer(void)
{
struct arp_entry *tabptr;
++arptime;
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
tabptr = &arp_table[i];
if((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 &&
arptime - tabptr->time >= UIP_ARP_MAXAGE) {
memset(tabptr->ipaddr, 0, 4);
}
}
}
/*-----------------------------------------------------------------------------------*/
static void
uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr)
{
register struct arp_entry *tabptr;
/* Walk through the ARP mapping table and try to find an entry to
update. If none is found, the IP -> MAC address mapping is
inserted in the ARP table. */
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
tabptr = &arp_table[i];
/* Only check those entries that are actually in use. */
if(tabptr->ipaddr[0] != 0 &&
tabptr->ipaddr[1] != 0) {
/* Check if the source IP address of the incoming packet matches
the IP address in this ARP table entry. */
if(ipaddr[0] == tabptr->ipaddr[0] &&
ipaddr[1] == tabptr->ipaddr[1]) {
/* An old entry found, update this and return. */
memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
tabptr->time = arptime;
return;
}
}
}
/* If we get here, no existing ARP table entry was found, so we
create one. */
/* First, we try to find an unused entry in the ARP table. */
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
tabptr = &arp_table[i];
if(tabptr->ipaddr[0] == 0 &&
tabptr->ipaddr[1] == 0) {
break;
}
}
/* If no unused entry is found, we try to find the oldest entry and
throw it away. */
if(i == UIP_ARPTAB_SIZE) {
tmpage = 0;
c = 0;
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
tabptr = &arp_table[i];
if(arptime - tabptr->time > tmpage) {
tmpage = arptime - tabptr->time;
c = i;
}
}
i = c;
}
/* Now, i is the ARP table entry which we will fill with the new
information. */
memcpy(tabptr->ipaddr, ipaddr, 4);
memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
tabptr->time = arptime;
}
/*-----------------------------------------------------------------------------------*/
/**
* ARP processing for incoming IP packets
*
* This function should be called by the device driver when an IP
* packet has been received. The function will check if the address is
* in the ARP cache, and if so the ARP cache entry will be
* refreshed. If no ARP cache entry was found, a new one is created.
*
* This function expects an IP packet with a prepended Ethernet header
* in the uip_buf[] buffer, and the length of the packet in the global
* variable uip_len.
*/
/*-----------------------------------------------------------------------------------*/
void
uip_arp_ipin(void)
{
uip_len -= sizeof(struct uip_eth_hdr);
/* Only insert/update an entry if the source IP address of the
incoming IP packet comes from a host on the local network. */
if((IPBUF->srcipaddr[0] & uip_arp_netmask[0]) !=
(uip_hostaddr[0] & uip_arp_netmask[0])) {
return;
}
if((IPBUF->srcipaddr[1] & uip_arp_netmask[1]) !=
(uip_hostaddr[1] & uip_arp_netmask[1])) {
return;
}
uip_arp_update(IPBUF->srcipaddr, &(IPBUF->ethhdr.src));
return;
}
/*-----------------------------------------------------------------------------------*/
/**
* ARP processing for incoming ARP packets.
*
* This function should be called by the device driver when an ARP
* packet has been received. The function will act differently
* depending on the ARP packet type: if it is a reply for a request
* that we previously sent out, the ARP cache will be filled in with
* the values from the ARP reply. If the incoming ARP packet is an ARP
* request for our IP address, an ARP reply packet is created and put
* into the uip_buf[] buffer.
*
* When the function returns, the value of the global variable uip_len
* indicates whether the device driver should send out a packet or
* not. If uip_len is zero, no packet should be sent. If uip_len is
* non-zero, it contains the length of the outbound packet that is
* present in the uip_buf[] buffer.
*
* This function expects an ARP packet with a prepended Ethernet
* header in the uip_buf[] buffer, and the length of the packet in the
* global variable uip_len.
*/
/*-----------------------------------------------------------------------------------*/
typedef struct arp_hdr aht;
void
uip_arp_arpin(void)
{
int ul;
if(uip_len < sizeof(struct arp_hdr)) {
uip_len = 0;
return;
}
uip_len = 0;
switch(BUF->opcode) {
case HTONS(ARP_REQUEST):
/* ARP request. If it asked for our address, we send out a
reply. */
if(BUF->dipaddr[0] == uip_hostaddr[0] &&
BUF->dipaddr[1] == uip_hostaddr[1]) {
/* The reply opcode is 2. */
BUF->opcode = HTONS(2);
memcpy(BUF->dhwaddr.addr, BUF->shwaddr.addr, 6);
memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
memcpy(BUF->ethhdr.dest.addr, BUF->dhwaddr.addr, 6);
BUF->dipaddr[0] = BUF->sipaddr[0];
BUF->dipaddr[1] = BUF->sipaddr[1];
BUF->sipaddr[0] = uip_hostaddr[0];
BUF->sipaddr[1] = uip_hostaddr[1];
ul = BUF->hwlen;
BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
uip_len = sizeof(struct arp_hdr);
}
break;
case HTONS(ARP_REPLY):
/* ARP reply. We insert or update the ARP table if it was meant
for us. */
if(BUF->dipaddr[0] == uip_hostaddr[0] &&
BUF->dipaddr[1] == uip_hostaddr[1]) {
uip_arp_update(BUF->sipaddr, &BUF->shwaddr);
}
break;
}
( void ) ul;
return;
}
/*-----------------------------------------------------------------------------------*/
/**
* Prepend Ethernet header to an outbound IP packet and see if we need
* to send out an ARP request.
*
* This function should be called before sending out an IP packet. The
* function checks the destination IP address of the IP packet to see
* what Ethernet MAC address that should be used as a destination MAC
* address on the Ethernet.
*
* If the destination IP address is in the local network (determined
* by logical ANDing of netmask and our IP address), the function
* checks the ARP cache to see if an entry for the destination IP
* address is found. If so, an Ethernet header is prepended and the
* function returns. If no ARP cache entry is found for the
* destination IP address, the packet in the uip_buf[] is replaced by
* an ARP request packet for the IP address. The IP packet is dropped
* and it is assumed that they higher level protocols (e.g., TCP)
* eventually will retransmit the dropped packet.
*
* If the destination IP address is not on the local network, the IP
* address of the default router is used instead.
*
* When the function returns, a packet is present in the uip_buf[]
* buffer, and the length of the packet is in the global variable
* uip_len.
*/
/*-----------------------------------------------------------------------------------*/
void
uip_arp_out(void)
{
struct arp_entry *tabptr;
/* Find the destination IP address in the ARP table and construct
the Ethernet header. If the destination IP addres isn't on the
local network, we use the default router's IP address instead.
If not ARP table entry is found, we overwrite the original IP
packet with an ARP request for the IP address. */
/* Check if the destination address is on the local network. */
if((IPBUF->destipaddr[0] & uip_arp_netmask[0]) !=
(uip_hostaddr[0] & uip_arp_netmask[0]) ||
(IPBUF->destipaddr[1] & uip_arp_netmask[1]) !=
(uip_hostaddr[1] & uip_arp_netmask[1])) {
/* Destination address was not on the local network, so we need to
use the default router's IP address instead of the destination
address when determining the MAC address. */
ipaddr[0] = uip_arp_draddr[0];
ipaddr[1] = uip_arp_draddr[1];
} else {
/* Else, we use the destination IP address. */
ipaddr[0] = IPBUF->destipaddr[0];
ipaddr[1] = IPBUF->destipaddr[1];
}
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
tabptr = &arp_table[i];
if(ipaddr[0] == tabptr->ipaddr[0] &&
ipaddr[1] == tabptr->ipaddr[1])
break;
}
if(i == UIP_ARPTAB_SIZE) {
/* The destination address was not in our ARP table, so we
overwrite the IP packet with an ARP request. */
memset(BUF->ethhdr.dest.addr, 0xff, 6);
memset(BUF->dhwaddr.addr, 0x00, 6);
memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
BUF->dipaddr[0] = ipaddr[0];
BUF->dipaddr[1] = ipaddr[1];
BUF->sipaddr[0] = uip_hostaddr[0];
BUF->sipaddr[1] = uip_hostaddr[1];
BUF->opcode = HTONS(ARP_REQUEST); /* ARP request. */
BUF->hwtype = HTONS(ARP_HWTYPE_ETH);
BUF->protocol = HTONS(UIP_ETHTYPE_IP);
BUF->hwlen = 6;
BUF->protolen = 4;
BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
uip_appdata = &uip_buf[40 + UIP_LLH_LEN];
uip_len = sizeof(struct arp_hdr);
return;
}
/* Build an ethernet header. */
memcpy(IPBUF->ethhdr.dest.addr, tabptr->ethaddr.addr, 6);
memcpy(IPBUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
IPBUF->ethhdr.type = HTONS(UIP_ETHTYPE_IP);
uip_len += sizeof(struct uip_eth_hdr);
}
/*-----------------------------------------------------------------------------------*/
/** @} */
/** @} */

View file

@ -1,201 +0,0 @@
/**
* \addtogroup uip
* @{
*/
/**
* \addtogroup uiparp
* @{
*/
/**
* \file
* Macros and definitions for the ARP module.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001-2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arp.h,v 1.3.2.2 2003/10/06 15:10:22 adam Exp $
*
*/
#ifndef __UIP_ARP_H__
#define __UIP_ARP_H__
#include "uip.h"
/**
* Representation of a 48-bit Ethernet address.
*/
struct uip_eth_addr {
u8_t addr[6];
} /*_RB_ __attribute__ ((packed, aligned (1))) */;
extern struct uip_eth_addr uip_ethaddr;
/**
* The Ethernet header.
*/
struct uip_eth_hdr {
struct uip_eth_addr dest;
struct uip_eth_addr src;
u16_t type;
} /*_RB_ __attribute__ ((packed)) */;
#define UIP_ETHTYPE_ARP 0x0806
#define UIP_ETHTYPE_IP 0x0800
#define UIP_ETHTYPE_IP6 0x86dd
/* The uip_arp_init() function must be called before any of the other
ARP functions. */
void uip_arp_init(void);
/* The uip_arp_ipin() function should be called whenever an IP packet
arrives from the Ethernet. This function refreshes the ARP table or
inserts a new mapping if none exists. The function assumes that an
IP packet with an Ethernet header is present in the uip_buf buffer
and that the length of the packet is in the uip_len variable. */
void uip_arp_ipin(void);
/* The uip_arp_arpin() should be called when an ARP packet is received
by the Ethernet driver. This function also assumes that the
Ethernet frame is present in the uip_buf buffer. When the
uip_arp_arpin() function returns, the contents of the uip_buf
buffer should be sent out on the Ethernet if the uip_len variable
is > 0. */
void uip_arp_arpin(void);
/* The uip_arp_out() function should be called when an IP packet
should be sent out on the Ethernet. This function creates an
Ethernet header before the IP header in the uip_buf buffer. The
Ethernet header will have the correct Ethernet MAC destination
address filled in if an ARP table entry for the destination IP
address (or the IP address of the default router) is present. If no
such table entry is found, the IP packet is overwritten with an ARP
request and we rely on TCP to retransmit the packet that was
overwritten. In any case, the uip_len variable holds the length of
the Ethernet frame that should be transmitted. */
void uip_arp_out(void);
/* The uip_arp_timer() function should be called every ten seconds. It
is responsible for flushing old entries in the ARP table. */
void uip_arp_timer(void);
/** @} */
/**
* \addtogroup uipconffunc
* @{
*/
/**
* Set the default router's IP address.
*
* \param addr A pointer to a 4-byte array containing the IP address
* of the default router.
*
* \hideinitializer
*/
#define uip_setdraddr(addr) do { uip_arp_draddr[0] = addr[0]; \
uip_arp_draddr[1] = addr[1]; } while(0)
/**
* Set the netmask.
*
* \param addr A pointer to a 4-byte array containing the IP address
* of the netmask.
*
* \hideinitializer
*/
#define uip_setnetmask(addr) do { uip_arp_netmask[0] = addr[0]; \
uip_arp_netmask[1] = addr[1]; } while(0)
/**
* Get the default router's IP address.
*
* \param addr A pointer to a 4-byte array that will be filled in with
* the IP address of the default router.
*
* \hideinitializer
*/
#define uip_getdraddr(addr) do { addr[0] = uip_arp_draddr[0]; \
addr[1] = uip_arp_draddr[1]; } while(0)
/**
* Get the netmask.
*
* \param addr A pointer to a 4-byte array that will be filled in with
* the value of the netmask.
*
* \hideinitializer
*/
#define uip_getnetmask(addr) do { addr[0] = uip_arp_netmask[0]; \
addr[1] = uip_arp_netmask[1]; } while(0)
/**
* Specifiy the Ethernet MAC address.
*
* The ARP code needs to know the MAC address of the Ethernet card in
* order to be able to respond to ARP queries and to generate working
* Ethernet headers.
*
* \note This macro only specifies the Ethernet MAC address to the ARP
* code. It cannot be used to change the MAC address of the Ethernet
* card.
*
* \param eaddr A pointer to a struct uip_eth_addr containing the
* Ethernet MAC address of the Ethernet card.
*
* \hideinitializer
*/
#define uip_setethaddr(eaddr) do {uip_ethaddr.addr[0] = eaddr.addr[0]; \
uip_ethaddr.addr[1] = eaddr.addr[1];\
uip_ethaddr.addr[2] = eaddr.addr[2];\
uip_ethaddr.addr[3] = eaddr.addr[3];\
uip_ethaddr.addr[4] = eaddr.addr[4];\
uip_ethaddr.addr[5] = eaddr.addr[5];} while(0)
/** @} */
/**
* \internal Internal variables that are set using the macros
* uip_setdraddr and uip_setnetmask.
*/
extern u16_t uip_arp_draddr[2], uip_arp_netmask[2];
#endif /* __UIP_ARP_H__ */

View file

@ -1,560 +0,0 @@
/**
* \defgroup uipopt Configuration options for uIP
* @{
*
* uIP is configured using the per-project configuration file
* "uipopt.h". This file contains all compile-time options for uIP and
* should be tweaked to match each specific project. The uIP
* distribution contains a documented example "uipopt.h" that can be
* copied and modified for each project.
*/
/**
* \file
* Configuration options for uIP.
* \author Adam Dunkels <adam@dunkels.com>
*
* This file is used for tweaking various configuration options for
* uIP. You should make a copy of this file into one of your project's
* directories instead of editing this example "uipopt.h" file that
* comes with the uIP distribution.
*/
/*
* Copyright (c) 2001-2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uipopt.h,v 1.16.2.5 2003/10/07 13:22:51 adam Exp $
*
*/
#ifndef __UIPOPT_H__
#define __UIPOPT_H__
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipopttypedef uIP type definitions
* @{
*/
/**
* The 8-bit unsigned data type.
*
* This may have to be tweaked for your particular compiler. "unsigned
* char" works for most compilers.
*/
typedef unsigned char u8_t;
/**
* The 16-bit unsigned data type.
*
* This may have to be tweaked for your particular compiler. "unsigned
* short" works for most compilers.
*/
typedef unsigned short u16_t;
/**
* The statistics data type.
*
* This datatype determines how high the statistics counters are able
* to count.
*/
typedef unsigned short uip_stats_t;
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptstaticconf Static configuration options
* @{
*
* These configuration options can be used for setting the IP address
* settings statically, but only if UIP_FIXEDADDR is set to 1. The
* configuration options for a specific node includes IP address,
* netmask and default router as well as the Ethernet address. The
* netmask, default router and Ethernet address are appliciable only
* if uIP should be run over Ethernet.
*
* All of these should be changed to suit your project.
*/
/**
* Determines if uIP should use a fixed IP address or not.
*
* If uIP should use a fixed IP address, the settings are set in the
* uipopt.h file. If not, the macros uip_sethostaddr(),
* uip_setdraddr() and uip_setnetmask() should be used instead.
*
* \hideinitializer
*/
#define UIP_FIXEDADDR 1
/**
* Ping IP address asignment.
*
* uIP uses a "ping" packets for setting its own IP address if this
* option is set. If so, uIP will start with an empty IP address and
* the destination IP address of the first incoming "ping" (ICMP echo)
* packet will be used for setting the hosts IP address.
*
* \note This works only if UIP_FIXEDADDR is 0.
*
* \hideinitializer
*/
#define UIP_PINGADDRCONF 0
#define UIP_IPADDR0 172U /**< The first octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_IPADDR1 25U /**< The second octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_IPADDR2 218U /**< The third octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_IPADDR3 11U /**< The fourth octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK0 255 /**< The first octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK1 255 /**< The second octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK2 0 /**< The third octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK3 0 /**< The fourth octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR0 172 /**< The first octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR1 25 /**< The second octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR2 218 /**< The third octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR3 3 /**< The fourth octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
/**
* Specifies if the uIP ARP module should be compiled with a fixed
* Ethernet MAC address or not.
*
* If this configuration option is 0, the macro uip_setethaddr() can
* be used to specify the Ethernet address at run-time.
*
* \hideinitializer
*/
#define UIP_FIXEDETHADDR 0
#define UIP_ETHADDR0 0x00 /**< The first octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR1 0xbd /**< The second octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR2 0x3b /**< The third octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR3 0x33 /**< The fourth octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR4 0x06 /**< The fifth octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR5 0x65 /**< The sixth octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptip IP configuration options
* @{
*
*/
/**
* The IP TTL (time to live) of IP packets sent by uIP.
*
* This should normally not be changed.
*/
#define UIP_TTL 255
/**
* Turn on support for IP packet reassembly.
*
* uIP supports reassembly of fragmented IP packets. This features
* requires an additonal amount of RAM to hold the reassembly buffer
* and the reassembly code size is approximately 700 bytes. The
* reassembly buffer is of the same size as the uip_buf buffer
* (configured by UIP_BUFSIZE).
*
* \note IP packet reassembly is not heavily tested.
*
* \hideinitializer
*/
#define UIP_REASSEMBLY 0
/**
* The maximum time an IP fragment should wait in the reassembly
* buffer before it is dropped.
*
*/
#define UIP_REASS_MAXAGE 40
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptudp UDP configuration options
* @{
*
* \note The UDP support in uIP is still not entirely complete; there
* is no support for sending or receiving broadcast or multicast
* packets, but it works well enough to support a number of vital
* applications such as DNS queries, though
*/
/**
* Toggles wether UDP support should be compiled in or not.
*
* \hideinitializer
*/
#define UIP_UDP 0
/**
* Toggles if UDP checksums should be used or not.
*
* \note Support for UDP checksums is currently not included in uIP,
* so this option has no function.
*
* \hideinitializer
*/
#define UIP_UDP_CHECKSUMS 0
/**
* The maximum amount of concurrent UDP connections.
*
* \hideinitializer
*/
#define UIP_UDP_CONNS 2
/**
* The name of the function that should be called when UDP datagrams arrive.
*
* \hideinitializer
*/
#define UIP_UDP_APPCALL udp_appcall
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipopttcp TCP configuration options
* @{
*/
/**
* Determines if support for opening connections from uIP should be
* compiled in.
*
* If the applications that are running on top of uIP for this project
* do not need to open outgoing TCP connections, this configration
* option can be turned off to reduce the code size of uIP.
*
* \hideinitializer
*/
#define UIP_ACTIVE_OPEN 0
/**
* The maximum number of simultaneously open TCP connections.
*
* Since the TCP connections are statically allocated, turning this
* configuration knob down results in less RAM used. Each TCP
* connection requires approximatly 30 bytes of memory.
*
* \hideinitializer
*/
#define UIP_CONNS 25
/**
* The maximum number of simultaneously listening TCP ports.
*
* Each listening TCP port requires 2 bytes of memory.
*
* \hideinitializer
*/
#define UIP_LISTENPORTS 10
/**
* The size of the advertised receiver's window.
*
* Should be set low (i.e., to the size of the uip_buf buffer) is the
* application is slow to process incoming data, or high (32768 bytes)
* if the application processes data quickly.
*
* \hideinitializer
*/
#define UIP_RECEIVE_WINDOW 32768
/**
* Determines if support for TCP urgent data notification should be
* compiled in.
*
* Urgent data (out-of-band data) is a rarely used TCP feature that
* very seldom would be required.
*
* \hideinitializer
*/
#define UIP_URGDATA 1
/**
* The initial retransmission timeout counted in timer pulses.
*
* This should not be changed.
*/
#define UIP_RTO 3
/**
* The maximum number of times a segment should be retransmitted
* before the connection should be aborted.
*
* This should not be changed.
*/
#define UIP_MAXRTX 8
/**
* The maximum number of times a SYN segment should be retransmitted
* before a connection request should be deemed to have been
* unsuccessful.
*
* This should not need to be changed.
*/
#define UIP_MAXSYNRTX 3
/**
* The TCP maximum segment size.
*
* This is should not be to set to more than UIP_BUFSIZE - UIP_LLH_LEN - 40.
*/
#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - 40)
/**
* How long a connection should stay in the TIME_WAIT state.
*
* This configiration option has no real implication, and it should be
* left untouched.
*/
#define UIP_TIME_WAIT_TIMEOUT 120
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptarp ARP configuration options
* @{
*/
/**
* The size of the ARP table.
*
* This option should be set to a larger value if this uIP node will
* have many connections from the local network.
*
* \hideinitializer
*/
#define UIP_ARPTAB_SIZE 8
/**
* The maxium age of ARP table entries measured in 10ths of seconds.
*
* An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD
* default).
*/
#define UIP_ARP_MAXAGE 120
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptgeneral General configuration options
* @{
*/
/**
* The size of the uIP packet buffer.
*
* The uIP packet buffer should not be smaller than 60 bytes, and does
* not need to be larger than 1500 bytes. Lower size results in lower
* TCP throughput, larger size results in higher TCP throughput.
*
* \hideinitializer
*/
#define UIP_BUFSIZE 1480
/**
* Determines if statistics support should be compiled in.
*
* The statistics is useful for debugging and to show the user.
*
* \hideinitializer
*/
#define UIP_STATISTICS 1
/**
* Determines if logging of certain events should be compiled in.
*
* This is useful mostly for debugging. The function uip_log()
* must be implemented to suit the architecture of the project, if
* logging is turned on.
*
* \hideinitializer
*/
#define UIP_LOGGING 0
/**
* Print out a uIP log message.
*
* This function must be implemented by the module that uses uIP, and
* is called by uIP whenever a log message is generated.
*/
void uip_log(char *msg);
/**
* The link level header length.
*
* This is the offset into the uip_buf where the IP header can be
* found. For Ethernet, this should be set to 14. For SLIP, this
* should be set to 0.
*
* \hideinitializer
*/
#define UIP_LLH_LEN 14
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptcpu CPU architecture configuration
* @{
*
* The CPU architecture configuration is where the endianess of the
* CPU on which uIP is to be run is specified. Most CPUs today are
* little endian, and the most notable exception are the Motorolas
* which are big endian. The BYTE_ORDER macro should be changed to
* reflect the CPU architecture on which uIP is to be run.
*/
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 3412
#endif /* LITTLE_ENDIAN */
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 1234
#endif /* BIGE_ENDIAN */
/**
* The byte order of the CPU architecture on which uIP is to be run.
*
* This option can be either BIG_ENDIAN (Motorola byte order) or
* LITTLE_ENDIAN (Intel byte order).
*
* \hideinitializer
*/
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* BYTE_ORDER */
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptapp Appication specific configurations
* @{
*
* An uIP application is implemented using a single application
* function that is called by uIP whenever a TCP/IP event occurs. The
* name of this function must be registered with uIP at compile time
* using the UIP_APPCALL definition.
*
* uIP applications can store the application state within the
* uip_conn structure by specifying the size of the application
* structure with the UIP_APPSTATE_SIZE macro.
*
* The file containing the definitions must be included in the
* uipopt.h file.
*
* The following example illustrates how this can look.
\code
void httpd_appcall(void);
#define UIP_APPCALL httpd_appcall
struct httpd_state {
u8_t state;
u16_t count;
char *dataptr;
char *script;
};
#define UIP_APPSTATE_SIZE (sizeof(struct httpd_state))
\endcode
*/
/**
* \var #define UIP_APPCALL
*
* The name of the application function that uIP should call in
* response to TCP/IP events.
*
*/
/**
* \var #define UIP_APPSTATE_SIZE
*
* The size of the application state that is to be stored in the
* uip_conn structure.
*/
/** @} */
/* Include the header file for the application program that should be
used. If you don't use the example web server, you should change
this. */
#include "httpd.h"
#endif /* __UIPOPT_H__ */