⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uip.lst

📁 一个AVR 上的UIP移植程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s 			page 1


   1               		.file	"uip.c"
   2               		.arch atmega323
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  10               		.stabs	"C:\\Code\\AVR\\uip-avr/",100,0,0,.Ltext0
  11               		.stabs	"uip.c",100,0,0,.Ltext0
  12               		.text
  13               	.Ltext0:
  14               		.stabs	"gcc2_compiled.",60,0,0,0
  15               		.stabs	"int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0
  16               		.stabs	"char:t(0,2)=r(0,2);0;127;",128,0,0,0
  17               		.stabs	"long int:t(0,3)=@s32;r(0,3);0020000000000;0017777777777;",128,0,0,0
  18               		.stabs	"unsigned int:t(0,4)=r(0,4);0000000000000;0000000177777;",128,0,0,0
  19               		.stabs	"long unsigned int:t(0,5)=@s32;r(0,5);0000000000000;0037777777777;",128,0,0,0
  20               		.stabs	"long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,
  21               		.stabs	"long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;",128,0,0,
  22               		.stabs	"short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0
  23               		.stabs	"short unsigned int:t(0,9)=r(0,9);0000000000000;0000000177777;",128,0,0,0
  24               		.stabs	"signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
  25               		.stabs	"unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
  26               		.stabs	"float:t(0,12)=r(0,1);4;0;",128,0,0,0
  27               		.stabs	"double:t(0,13)=r(0,1);4;0;",128,0,0,0
  28               		.stabs	"long double:t(0,14)=r(0,1);4;0;",128,0,0,0
  29               		.stabs	"complex int:t(0,15)=s4real:(0,1),0,16;imag:(0,1),16,16;;",128,0,0,0
  30               		.stabs	"complex float:t(0,16)=R3;8;0;",128,0,0,0
  31               		.stabs	"complex double:t(0,17)=R3;8;0;",128,0,0,0
  32               		.stabs	"complex long double:t(0,18)=R3;8;0;",128,0,0,0
  33               		.stabs	"__builtin_va_list:t(0,19)=*(0,20)=(0,20)",128,0,0,0
  34               		.stabs	"_Bool:t(0,21)=@s8;-16;",128,0,0,0
  35               		.stabs	"uip.c",130,0,0,0
  36               		.stabs	"uip.h",130,0,0,0
  37               		.stabs	"uipopt.h",130,0,0,0
  38               		.stabs	"u8_t:t(3,1)=(0,11)",128,0,52,0
  39               		.stabs	"u16_t:t(3,2)=(0,9)",128,0,53,0
  40               		.stabs	"app.h",130,0,0,0
  41               		.stabs	"uip.h",130,0,0,0
  42               		.stabn	162,0,0,0
  43               		.stabn	162,0,0,0
  44               		.stabn	162,0,0,0
  45               		.stabs	"uip_conn:T(2,1)=s25tcpstateflags:(3,1),0,8;lport:(3,2),8,16;rport:(3,2),24,16;ripaddr:(2,2
  46               		.stabs	"uip_stats:T(2,6)=s44ip:(2,7)=s18drop:(3,2),0,16;recv:(3,2),16,16;sent:(3,2),32,16;vhlerr:(
  47               		.stabs	"uip_tcpip_hdr:t(2,10)=(2,11)=s44vhl:(3,1),0,8;tos:(3,1),8,8;len:(2,12)=ar(2,3);0;1;(3,1),1
  48               		.stabn	162,0,0,0
  49               		.stabs	"uip_arch.h",130,0,0,0
  50               		.stabn	162,0,0,0
  51               		.stabs	"ipicmphdr:t(1,1)=(1,2)=s28vhl:(3,1),0,8;tos:(3,1),8,8;len:(2,12),16,16;ipid:(2,12),32,16;i
  52               		.stabs	"uip_init:F(0,20)",36,0,187,uip_init
  53               	.global	uip_init
  54               		.type	uip_init, @function
  55               	uip_init:
   1:uip.c         **** /***************************************************************************** 
   2:uip.c         **** *  modified by Louis Beaudoin for uIP-AVR port - September 20, 2002
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s 			page 2


   3:uip.c         **** *  www.embedded-creations.com
   4:uip.c         **** *
   5:uip.c         **** *  Added: Under tcp_send, urgent pointer is reset to zero before sending the
   6:uip.c         **** *           packet.  Ignoring the urgent pointer could have been a problem if
   7:uip.c         **** *           the remote connection sent an urgent pointer (though I have not
   8:uip.c         **** *           seen this yet).  It was added so the TCP header space could be
   9:uip.c         **** *           used by the application to store a small temporary buffer.  This
  10:uip.c         **** *           buffer is used to create a larger contiguous buffer of the
  11:uip.c         **** *           temporary buffer and the new TCP segment's data back to back.
  12:uip.c         **** *           Very useful if there is some data left at the end of a segment
  13:uip.c         **** *           that can't be used until more data arrives.
  14:uip.c         **** *
  15:uip.c         **** *         Under appsend, the TCP_PSH flag is set.  This tells the remote
  16:uip.c         **** *           receiver to immediately forware the segment data to the remote
  17:uip.c         **** *           application even if the packet is small.  Necessary in the
  18:uip.c         **** *           microVNC application because a VNC frame update request is only
  19:uip.c         **** *           10 bytes, and these were getting remotely buffered until about
  20:uip.c         **** *           100-1000 had been sent before an update	reply was finally received
  21:uip.c         **** *
  22:uip.c         **** *  Modified:
  23:uip.c         **** *          Strings used by UIP_LOGGING have been shortened - if UIP_LOGGING is
  24:uip.c         **** *            enabled, the strings won't take up as much program memory and
  25:uip.c         **** *            SRAM
  26:uip.c         **** *****************************************************************************/
  27:uip.c         **** 
  28:uip.c         **** /*
  29:uip.c         ****  * Copyright (c) 2001-2002, Adam Dunkels.
  30:uip.c         ****  * All rights reserved. 
  31:uip.c         ****  *
  32:uip.c         ****  * Redistribution and use in source and binary forms, with or without 
  33:uip.c         ****  * modification, are permitted provided that the following conditions 
  34:uip.c         ****  * are met: 
  35:uip.c         ****  * 1. Redistributions of source code must retain the above copyright 
  36:uip.c         ****  *    notice, this list of conditions and the following disclaimer. 
  37:uip.c         ****  * 2. Redistributions in binary form must reproduce the above copyright 
  38:uip.c         ****  *    notice, this list of conditions and the following disclaimer in the 
  39:uip.c         ****  *    documentation and/or other materials provided with the distribution. 
  40:uip.c         ****  * 3. All advertising materials mentioning features or use of this software
  41:uip.c         ****  *    must display the following acknowledgement:
  42:uip.c         ****  *      This product includes software developed by Adam Dunkels.
  43:uip.c         ****  * 4. The name of the author may not be used to endorse or promote
  44:uip.c         ****  *    products derived from this software without specific prior
  45:uip.c         ****  *    written permission.  
  46:uip.c         ****  *
  47:uip.c         ****  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  48:uip.c         ****  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  49:uip.c         ****  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  50:uip.c         ****  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  51:uip.c         ****  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  52:uip.c         ****  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  53:uip.c         ****  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54:uip.c         ****  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  55:uip.c         ****  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  56:uip.c         ****  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  57:uip.c         ****  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
  58:uip.c         ****  *
  59:uip.c         ****  * This file is part of the uIP TCP/IP stack.
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s 			page 3


  60:uip.c         ****  *
  61:uip.c         ****  * $Id: uip.c,v 1.4 2002/10/01 21:24:36 User Exp $
  62:uip.c         ****  *
  63:uip.c         ****  */
  64:uip.c         **** 
  65:uip.c         **** /*
  66:uip.c         **** This is a small implementation of the IP and TCP protocols (as well as
  67:uip.c         **** some basic ICMP stuff). The implementation couples the IP, TCP and the
  68:uip.c         **** application layers very tightly. To keep the size of the compiled code
  69:uip.c         **** down, this code also features heavy usage of the goto statement.
  70:uip.c         **** 
  71:uip.c         **** The principle is that we have a small buffer, called the uip_buf, in which
  72:uip.c         **** the device driver puts an incoming packet. The TCP/IP stack parses the
  73:uip.c         **** headers in the packet, and calls upon the application. If the remote
  74:uip.c         **** host has sent data to the application, this data is present in the uip_buf
  75:uip.c         **** and the application read the data from there. It is up to the
  76:uip.c         **** application to put this data into a byte stream if needed. The
  77:uip.c         **** application will not be fed with data that is out of sequence.
  78:uip.c         **** 
  79:uip.c         **** If the application whishes to send data to the peer, it should put its
  80:uip.c         **** data into the uip_buf, 40 bytes from the start of the buffer. The TCP/IP
  81:uip.c         **** stack will calculate the checksums, and fill in the necessary header
  82:uip.c         **** fields and finally send the packet back to the peer. */
  83:uip.c         **** 
  84:uip.c         **** #include "uip.h"
  85:uip.c         **** #include "uipopt.h"
  86:uip.c         **** #include "uip_arch.h"
  87:uip.c         **** 
  88:uip.c         **** /*-----------------------------------------------------------------------------------*/
  89:uip.c         **** /* Variable definitions. */
  90:uip.c         **** 
  91:uip.c         **** u8_t uip_buf[UIP_BUFSIZE];   /* The packet buffer that contains
  92:uip.c         **** 				incoming packets. */
  93:uip.c         **** volatile u8_t *uip_appdata;  /* The uip_appdata pointer points to
  94:uip.c         **** 				application data. */
  95:uip.c         **** 
  96:uip.c         **** #if UIP_BUFSIZE > 255
  97:uip.c         **** volatile u16_t uip_len;      /* The uip_len is either 8 or 16 bits,
  98:uip.c         **** 				depending on the maximum packet
  99:uip.c         **** 				size. */
 100:uip.c         **** #else
 101:uip.c         **** volatile u8_t uip_len;
 102:uip.c         **** #endif /* UIP_BUFSIZE > 255 */
 103:uip.c         **** 
 104:uip.c         **** volatile u8_t uip_flags;     /* The uip_flags variable is used for
 105:uip.c         **** 				communication between the TCP/IP stack
 106:uip.c         **** 				and the application program. */
 107:uip.c         **** struct uip_conn *uip_conn;   /* uip_conn always points to the current
 108:uip.c         **** 				connection. */
 109:uip.c         **** 
 110:uip.c         **** struct uip_conn uip_conns[UIP_CONNS];
 111:uip.c         ****                              /* The uip_conns array holds all TCP
 112:uip.c         **** 				connections. */
 113:uip.c         **** u16_t uip_listenports[UIP_LISTENPORTS];
 114:uip.c         ****                              /* The uip_listenports list all currently
 115:uip.c         **** 				listning ports. */
 116:uip.c         **** 
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s 			page 4


 117:uip.c         **** 
 118:uip.c         **** static u16_t ipid;           /* Ths ipid variable is an increasing
 119:uip.c         **** 				number that is used for the IP ID
 120:uip.c         **** 				field. */
 121:uip.c         **** 
 122:uip.c         **** static u8_t iss[4];          /* The iss variable is used for the TCP
 123:uip.c         **** 				initial sequence number. */
 124:uip.c         **** 
 125:uip.c         **** #if UIP_ACTIVE_OPEN
 126:uip.c         **** static u16_t lastport;       /* Keeps track of the last port used for
 127:uip.c         **** 				a new connection. */
 128:uip.c         **** #endif /* UIP_ACTIVE_OPEN */
 129:uip.c         **** 
 130:uip.c         **** /* Temporary variables. */
 131:uip.c         **** static u8_t c, opt;
 132:uip.c         **** static u16_t tmpport;
 133:uip.c         **** 
 134:uip.c         **** /* Structures and definitions. */
 135:uip.c         **** typedef struct {
 136:uip.c         ****   /* IP header. */
 137:uip.c         ****   u8_t vhl,
 138:uip.c         ****     tos,          
 139:uip.c         ****     len[2],       
 140:uip.c         ****     ipid[2],        
 141:uip.c         ****     ipoffset[2],  
 142:uip.c         ****     ttl,          
 143:uip.c         ****     proto;     
 144:uip.c         ****   u16_t ipchksum;
 145:uip.c         ****   u16_t srcipaddr[2], 
 146:uip.c         ****     destipaddr[2];
 147:uip.c         ****   /* ICMP (echo) header. */
 148:uip.c         ****   u8_t type, icode;
 149:uip.c         ****   u16_t icmpchksum;
 150:uip.c         ****   u16_t id, seqno;  
 151:uip.c         **** } ipicmphdr;
 152:uip.c         **** 
 153:uip.c         **** #define TCP_FIN 0x01
 154:uip.c         **** #define TCP_SYN 0x02
 155:uip.c         **** #define TCP_RST 0x04
 156:uip.c         **** #define TCP_PSH 0x08
 157:uip.c         **** #define TCP_ACK 0x10
 158:uip.c         **** #define TCP_URG 0x20
 159:uip.c         **** 
 160:uip.c         **** #define IP_PROTO_ICMP   1
 161:uip.c         **** #define IP_PROTO_TCP    6
 162:uip.c         **** 
 163:uip.c         **** #define ICMP_ECHO_REPLY 0
 164:uip.c         **** #define ICMP_ECHO       8     
 165:uip.c         **** 
 166:uip.c         **** /* Macros. */
 167:uip.c         **** #define BUF ((uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
 168:uip.c         **** #define ICMPBUF ((ipicmphdr *)&uip_buf[UIP_LLH_LEN])
 169:uip.c         **** 
 170:uip.c         **** #if UIP_STATISTICS == 1
 171:uip.c         **** struct uip_stats uip_stat;
 172:uip.c         **** #define UIP_STAT(s) s
 173:uip.c         **** #else
GAS LISTING C:\DOCUME~1\pstang\LOCALS~1\Temp/ccSyaaaa.s 			page 5


 174:uip.c         **** #define UIP_STAT(s)
 175:uip.c         **** #endif /* UIP_STATISTICS == 1 */
 176:uip.c         **** 
 177:uip.c         **** #define UIP_LOGGING 0
 178:uip.c         **** #if UIP_LOGGING == 1
 179:uip.c         **** #define UIP_LOG(m) printf("%s\n", m)
 180:uip.c         **** #else
 181:uip.c         **** #define UIP_LOG(m)
 182:uip.c         **** #endif /* UIP_LOGGING == 1 */
 183:uip.c         **** 
 184:uip.c         **** /*-----------------------------------------------------------------------------------*/
 185:uip.c         **** void
 186:uip.c         **** uip_init(void)
 187:uip.c         **** {
  56               		.stabn 68,0,187,.LM1-uip_init
  57               	.LM1:
  58               	/* prologue: frame size=0 */
  59               	/* prologue end (size=0) */
 188:uip.c         ****   for(c = 0; c < UIP_LISTENPORTS; ++c) {
  60               		.stabn 68,0,188,.LM2-uip_init
  61               	.LM2:
  62 0000 1092 0000 		sts c,__zero_reg__
  63 0004 20E0      		ldi r18,lo8(0)
  64 0006 80E0      		ldi r24,lo8(0)
  65 0008 90E0      		ldi r25,hi8(0)
  66               	.L6:
 189:uip.c         ****     uip_listenports[c] = 0;
  67               		.stabn 68,0,189,.LM3-uip_init
  68               	.LM3:
  69 000a FC01      		movw r30,r24
  70 000c E80F      		add r30,r24
  71 000e F91F      		adc r31,r25
  72 0010 E050      		subi r30,lo8(-(uip_listenports))
  73 0012 F040      		sbci r31,hi8(-(uip_listenports))
  74 0014 1082      		st Z,__zero_reg__
  75 0016 1182      		std Z+1,__zero_reg__
  76               		.stabn 68,0,188,.LM4-uip_init
  77               	.LM4:
  78 0018 2F5F      		subi r18,lo8(-(1))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -