From e607f3034ddf8dab3fa84409b85e696b20ab03f9 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 10 Sep 2024 11:21:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=B8=20=D0=BF=D0=BE=D1=80=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=BE=20Ethernet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- Core/Inc/main.h | 15 +- Core/Inc/pribors.h | 9 + Core/Src/main.c | 156 +- Debug/yau-07b.list | 52880 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 53026 insertions(+), 38 deletions(-) create mode 100644 Debug/yau-07b.list diff --git a/.gitignore b/.gitignore index dd8b7b2..8dfda73 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,6 @@ src/MDK/OUT/* !src/MDK/OUT/keep-dir.txt *.swp *.uvguix.* -JLinkLog.txt \ No newline at end of file +JLinkLog.txt + +*.cyclo \ No newline at end of file diff --git a/Core/Inc/main.h b/Core/Inc/main.h index 518c0ad..8328551 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -25,7 +25,6 @@ #ifdef __cplusplus extern "C" { #endif -#include /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" @@ -33,16 +32,13 @@ extern "C" { /* USER CODE BEGIN Includes */ #include -#include "lwip.h" -#include "lwip/udp.h" -#include "lwip/debug.h" + /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ typedef struct rcv_msg { - uint32_t rcv_addr; uint16_t port; uint16_t cmd_num; uint16_t cmd_code; @@ -52,6 +48,15 @@ typedef struct rcv_msg uint16_t con_timeout; }_rcv_msg; + +typedef struct tsm_msg +{ + unsigned char tx_buf[1400]; + uint16_t status_len; + uint16_t length; + uint16_t cmd_len; +}_tsm_msg; + /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ diff --git a/Core/Inc/pribors.h b/Core/Inc/pribors.h index 40286c7..dc5a5ca 100644 --- a/Core/Inc/pribors.h +++ b/Core/Inc/pribors.h @@ -56,6 +56,15 @@ uint32_t get_ip(void); uint16_t get_port(void); uint16_t set_status(unsigned char *buf); +enum +{ + IN_PROGRESS = 0, + NO_ERROR, + ERR_SIZE, + + ERR_UNKNOW_COMMAND = 255 +}; + #endif /* INC_PRIBORS_H_ */ diff --git a/Core/Src/main.c b/Core/Src/main.c index c47cb49..5159d21 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -18,7 +18,9 @@ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" - +#include "lwip.h" +#include "lwip/udp.h" +#include "lwip/debug.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ @@ -46,9 +48,9 @@ SRAM_HandleTypeDef hsram1; /* USER CODE BEGIN PV */ uint32_t br_counter = 0; -uint16_t reply_len = 0; -unsigned char msg[1400]; +ip_addr_t rx_addr; struct rcv_msg rx_msg; +struct tsm_msg tx_msg; _Bool need_send_private = 0; /* USER CODE END PV */ @@ -107,15 +109,10 @@ int main(void) /* USER CODE BEGIN 2 */ struct udp_pcb * pcb = udp_new(); sock_init(pcb); - memset(msg, 0, sizeof msg); - msg[0] = 1; - msg[1] = 2; - msg[2] = 3; - msg[3] = 4; - struct pbuf *p = pbuf_alloc(0, sizeof msg, PBUF_RAM); + memset(tx_msg.tx_buf, 0, sizeof tx_msg.tx_buf); + struct pbuf *p = pbuf_alloc(0, sizeof tx_msg.tx_buf, PBUF_RAM); uint32_t br_addr = ipaddr_addr("10.1.1.255"); u16_t br_port = 50000U; - set_pbuf_params(p, sizeof msg); // timer start if (HAL_TIM_Base_Start_IT(&htim3) != HAL_OK) { @@ -132,15 +129,14 @@ int main(void) if (need_send_private == 1) { need_send_private = 0; - create_header(); - set_pbuf_params(p, create_header() + reply_len); - err_t errok = udp_sendto(pcb, p, (ip_addr_t*)&rx_msg.rcv_addr, rx_msg.port); + set_pbuf_params(p, tx_msg.status_len + tx_msg.cmd_len); + err_t errok = udp_sendto(pcb, p, &rx_addr, rx_msg.port); br_counter = 0; } if (br_counter > 99) { create_header(); - set_pbuf_params(p, create_header() + reply_len); + set_pbuf_params(p, create_header() + tx_msg.cmd_len); err_t errok = udp_sendto(pcb, p, (ip_addr_t*)&br_addr, br_port); br_counter = 0; } @@ -342,22 +338,21 @@ static void MX_GPIO_Init(void) uint16_t create_header(void) { - uint16_t status_len; - msg[0] = 0; - msg[1] = 0; - msg[2] = rx_msg.rx_buf[2]; - msg[3] = rx_msg.rx_buf[3]; - msg[5] = 0; - msg[6] = 0; - status_len = set_status(msg); - return status_len + 6; + tx_msg.tx_buf[0] = 0; + tx_msg.tx_buf[1] = 0; + tx_msg.tx_buf[2] = rx_msg.rx_buf[2]; + tx_msg.tx_buf[3] = rx_msg.rx_buf[3]; + tx_msg.tx_buf[5] = 0; + tx_msg.tx_buf[6] = 0; + tx_msg.status_len = set_status(tx_msg.tx_buf) + 6; + return tx_msg.status_len; } void set_pbuf_params(struct pbuf *p, u16_t length) { p->len = length; p->tot_len = p->len; - memcpy(p->payload, msg, p->tot_len); + memcpy(p->payload, tx_msg.tx_buf, p->tot_len); } void sock_init(struct udp_pcb * pcb) @@ -366,12 +361,13 @@ void sock_init(struct udp_pcb * pcb) u16_t port = get_port(); err_t errok = udp_bind(pcb, (ip_addr_t*)&ipaddr, port); udp_recv(pcb, udp_echo_recv, NULL); - rx_msg.rcv_addr = 0; rx_msg.port = 0; rx_msg.cmd_num = 0; rx_msg.cmd_code = 0; rx_msg.clnt_con = 0; rx_msg.length = 0; + tx_msg.status_len = 0; + tx_msg.cmd_len = 0; memset(rx_msg.rx_buf, 0, sizeof rx_msg.rx_buf); return; } @@ -380,20 +376,20 @@ void udp_echo_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) { if (p != NULL) { - ip_addr_t rcv_addr = addr[0]; if (p->tot_len < sizeof rx_msg.rx_buf) { if (p->tot_len < 6) { return; } + memcpy(rx_msg.rx_buf, p->payload, p->tot_len); if (rx_msg.clnt_con == 1) { - /*if ((rx_msg.rcv_addr != (uint32_t) rcv_addr.addr) || (rx_msg.port != port)) + if ((memcmp(&rx_addr, addr, sizeof rx_addr)!= 0) || (rx_msg.port != port)) { return; - }*/ - u16_t cmd_num = rx_msg.rx_buf[2] | (rx_msg.rx_buf[3] << 8); + } + uint16_t cmd_num = rx_msg.rx_buf[2] | (rx_msg.rx_buf[3] << 8); if (cmd_num != (rx_msg.cmd_num + 1)) { return; @@ -401,12 +397,11 @@ void udp_echo_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, } else { - rx_msg.rcv_addr = (uint32_t) rcv_addr.addr; + memcpy(&rx_addr, addr, sizeof rx_addr); rx_msg.port = port; } rx_msg.con_timeout = 0; rx_msg.clnt_con = 1; - memcpy(rx_msg.rx_buf, p->payload, p->tot_len); rx_msg.length = p->tot_len; rcv_command(); } @@ -417,10 +412,107 @@ void udp_echo_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, void rcv_command(void) { + uint16_t ports_amount = 0; + uint16_t i = 0; rx_msg.cmd_num = rx_msg.rx_buf[2] | (rx_msg.rx_buf[3] << 8); rx_msg.cmd_code = rx_msg.rx_buf[6]; - need_send_private = 1; + tx_msg.status_len = create_header(); + unsigned char *cmd_buf = &tx_msg.tx_buf[tx_msg.status_len]; + switch(rx_msg.cmd_code) // код команды + { + case 0: + //----------------------------------------------------------- + // КОМАНДА №0 + // ЧТЕНИЕ МАССИВА ПОРТОВ + //----------------------------------------------------------- + + cmd_buf[0] = rx_msg.cmd_code; // - код команды + ports_amount = rx_msg.rx_buf[7]; + + // Проверка размера принятого буфера + if( rx_msg.length < (8 + ports_amount * 2)) + { + // Размер принятого пакета меньше чем долно быть + // Установить ошибку + // КОД = 2 + cmd_buf[1] = ERR_SIZE; + + // Установить размер буфера = 2 + tx_msg.cmd_len = 2; + + } + else + { + // Установить ВЫПОЛНЕНО + cmd_buf[1] = NO_ERROR; + // Колличество прочитаных портов + cmd_buf[2] = rx_msg.rx_buf[7]; + + uint16_t port_data = 0xFFFF; + uint16_t port_addr = 0x0000; + for (i = 0; i> 8; + } + // Установить размер буфера + tx_msg.cmd_len = (ports_amount << 2) + 3; + } + break; + + case 1: + //----------------------------------------------------------- + // КОМАНДА №1 + // ЗАПИСЬ МАССИВА ПОРТОВ + //----------------------------------------------------------- + + cmd_buf[0] = rx_msg.cmd_code; // - код команды + ports_amount = rx_msg.rx_buf[7]; + + // Проверка размера принятого буфера + if( rx_msg.length < (8 + ports_amount * 4)) + { + // Размер принятого пакета меньше чем долно быть + // Установить ошибку + // КОД = 2 + cmd_buf[1] = ERR_SIZE; + + // Установить размер буфера = 2 + tx_msg.cmd_len = 2; + + } + else + { + // Установить ВЫПОЛНЕНО + cmd_buf[1] = NO_ERROR; + // Колличество прочитаных портов + cmd_buf[2] = rx_msg.rx_buf[7]; + + uint16_t port_data; + uint16_t port_addr; + for (i = 0; i> 8; + } + // Установить размер буфера + tx_msg.cmd_len = (ports_amount << 2) + 3; + } + break; + } + + need_send_private = 1; } diff --git a/Debug/yau-07b.list b/Debug/yau-07b.list new file mode 100644 index 0000000..81d38d6 --- /dev/null +++ b/Debug/yau-07b.list @@ -0,0 +1,52880 @@ + +yau-07b.elf: file format elf32-littlearm + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .isr_vector 000001ac 08000000 08000000 00001000 2**0 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 1 .text 00015df8 080001b0 080001b0 000011b0 2**4 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 2 .rodata 000032cc 08015fa8 08015fa8 00016fa8 2**3 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 3 .ARM.extab 00000000 08019274 08019274 0001b6e0 2**0 + CONTENTS + 4 .ARM 00000008 08019274 08019274 0001a274 2**2 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 5 .preinit_array 00000000 0801927c 0801927c 0001b6e0 2**0 + CONTENTS, ALLOC, LOAD, DATA + 6 .init_array 00000008 0801927c 0801927c 0001a27c 2**2 + CONTENTS, ALLOC, LOAD, DATA + 7 .fini_array 00000004 08019284 08019284 0001a284 2**2 + CONTENTS, ALLOC, LOAD, DATA + 8 .data 000006e0 20000000 08019288 0001b000 2**3 + CONTENTS, ALLOC, LOAD, DATA + 9 .ccmram 00000000 10000000 10000000 0001b6e0 2**0 + CONTENTS + 10 .bss 00018e64 200006e0 200006e0 0001b6e0 2**2 + ALLOC + 11 ._user_heap_stack 00000604 20019544 20019544 0001b6e0 2**0 + ALLOC + 12 .ARM.attributes 00000030 00000000 00000000 0001b6e0 2**0 + CONTENTS, READONLY + 13 .debug_info 0001fe92 00000000 00000000 0001b710 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + 14 .debug_abbrev 000057af 00000000 00000000 0003b5a2 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + 15 .debug_aranges 00001958 00000000 00000000 00040d58 2**3 + CONTENTS, READONLY, DEBUGGING, OCTETS + 16 .debug_rnglists 00001449 00000000 00000000 000426b0 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + 17 .debug_macro 00030527 00000000 00000000 00043af9 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + 18 .debug_line 000281d5 00000000 00000000 00074020 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + 19 .debug_str 000f533e 00000000 00000000 0009c1f5 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + 20 .comment 00000043 00000000 00000000 00191533 2**0 + CONTENTS, READONLY + 21 .debug_frame 00007c24 00000000 00000000 00191578 2**2 + CONTENTS, READONLY, DEBUGGING, OCTETS + 22 .debug_line_str 0000004e 00000000 00000000 0019919c 2**0 + CONTENTS, READONLY, DEBUGGING, OCTETS + +Disassembly of section .text: + +080001b0 <__do_global_dtors_aux>: + 80001b0: b510 push {r4, lr} + 80001b2: 4c05 ldr r4, [pc, #20] @ (80001c8 <__do_global_dtors_aux+0x18>) + 80001b4: 7823 ldrb r3, [r4, #0] + 80001b6: b933 cbnz r3, 80001c6 <__do_global_dtors_aux+0x16> + 80001b8: 4b04 ldr r3, [pc, #16] @ (80001cc <__do_global_dtors_aux+0x1c>) + 80001ba: b113 cbz r3, 80001c2 <__do_global_dtors_aux+0x12> + 80001bc: 4804 ldr r0, [pc, #16] @ (80001d0 <__do_global_dtors_aux+0x20>) + 80001be: f3af 8000 nop.w + 80001c2: 2301 movs r3, #1 + 80001c4: 7023 strb r3, [r4, #0] + 80001c6: bd10 pop {r4, pc} + 80001c8: 200006e0 .word 0x200006e0 + 80001cc: 00000000 .word 0x00000000 + 80001d0: 08015f90 .word 0x08015f90 + +080001d4 : + 80001d4: b508 push {r3, lr} + 80001d6: 4b03 ldr r3, [pc, #12] @ (80001e4 ) + 80001d8: b11b cbz r3, 80001e2 + 80001da: 4903 ldr r1, [pc, #12] @ (80001e8 ) + 80001dc: 4803 ldr r0, [pc, #12] @ (80001ec ) + 80001de: f3af 8000 nop.w + 80001e2: bd08 pop {r3, pc} + 80001e4: 00000000 .word 0x00000000 + 80001e8: 200006e4 .word 0x200006e4 + 80001ec: 08015f90 .word 0x08015f90 + +080001f0 : + 80001f0: 4603 mov r3, r0 + 80001f2: f813 2b01 ldrb.w r2, [r3], #1 + 80001f6: 2a00 cmp r2, #0 + 80001f8: d1fb bne.n 80001f2 + 80001fa: 1a18 subs r0, r3, r0 + 80001fc: 3801 subs r0, #1 + 80001fe: 4770 bx lr + +08000200 : + 8000200: f001 01ff and.w r1, r1, #255 @ 0xff + 8000204: 2a10 cmp r2, #16 + 8000206: db2b blt.n 8000260 + 8000208: f010 0f07 tst.w r0, #7 + 800020c: d008 beq.n 8000220 + 800020e: f810 3b01 ldrb.w r3, [r0], #1 + 8000212: 3a01 subs r2, #1 + 8000214: 428b cmp r3, r1 + 8000216: d02d beq.n 8000274 + 8000218: f010 0f07 tst.w r0, #7 + 800021c: b342 cbz r2, 8000270 + 800021e: d1f6 bne.n 800020e + 8000220: b4f0 push {r4, r5, r6, r7} + 8000222: ea41 2101 orr.w r1, r1, r1, lsl #8 + 8000226: ea41 4101 orr.w r1, r1, r1, lsl #16 + 800022a: f022 0407 bic.w r4, r2, #7 + 800022e: f07f 0700 mvns.w r7, #0 + 8000232: 2300 movs r3, #0 + 8000234: e8f0 5602 ldrd r5, r6, [r0], #8 + 8000238: 3c08 subs r4, #8 + 800023a: ea85 0501 eor.w r5, r5, r1 + 800023e: ea86 0601 eor.w r6, r6, r1 + 8000242: fa85 f547 uadd8 r5, r5, r7 + 8000246: faa3 f587 sel r5, r3, r7 + 800024a: fa86 f647 uadd8 r6, r6, r7 + 800024e: faa5 f687 sel r6, r5, r7 + 8000252: b98e cbnz r6, 8000278 + 8000254: d1ee bne.n 8000234 + 8000256: bcf0 pop {r4, r5, r6, r7} + 8000258: f001 01ff and.w r1, r1, #255 @ 0xff + 800025c: f002 0207 and.w r2, r2, #7 + 8000260: b132 cbz r2, 8000270 + 8000262: f810 3b01 ldrb.w r3, [r0], #1 + 8000266: 3a01 subs r2, #1 + 8000268: ea83 0301 eor.w r3, r3, r1 + 800026c: b113 cbz r3, 8000274 + 800026e: d1f8 bne.n 8000262 + 8000270: 2000 movs r0, #0 + 8000272: 4770 bx lr + 8000274: 3801 subs r0, #1 + 8000276: 4770 bx lr + 8000278: 2d00 cmp r5, #0 + 800027a: bf06 itte eq + 800027c: 4635 moveq r5, r6 + 800027e: 3803 subeq r0, #3 + 8000280: 3807 subne r0, #7 + 8000282: f015 0f01 tst.w r5, #1 + 8000286: d107 bne.n 8000298 + 8000288: 3001 adds r0, #1 + 800028a: f415 7f80 tst.w r5, #256 @ 0x100 + 800028e: bf02 ittt eq + 8000290: 3001 addeq r0, #1 + 8000292: f415 3fc0 tsteq.w r5, #98304 @ 0x18000 + 8000296: 3001 addeq r0, #1 + 8000298: bcf0 pop {r4, r5, r6, r7} + 800029a: 3801 subs r0, #1 + 800029c: 4770 bx lr + 800029e: bf00 nop + +080002a0 <__aeabi_drsub>: + 80002a0: f081 4100 eor.w r1, r1, #2147483648 @ 0x80000000 + 80002a4: e002 b.n 80002ac <__adddf3> + 80002a6: bf00 nop + +080002a8 <__aeabi_dsub>: + 80002a8: f083 4300 eor.w r3, r3, #2147483648 @ 0x80000000 + +080002ac <__adddf3>: + 80002ac: b530 push {r4, r5, lr} + 80002ae: ea4f 0441 mov.w r4, r1, lsl #1 + 80002b2: ea4f 0543 mov.w r5, r3, lsl #1 + 80002b6: ea94 0f05 teq r4, r5 + 80002ba: bf08 it eq + 80002bc: ea90 0f02 teqeq r0, r2 + 80002c0: bf1f itttt ne + 80002c2: ea54 0c00 orrsne.w ip, r4, r0 + 80002c6: ea55 0c02 orrsne.w ip, r5, r2 + 80002ca: ea7f 5c64 mvnsne.w ip, r4, asr #21 + 80002ce: ea7f 5c65 mvnsne.w ip, r5, asr #21 + 80002d2: f000 80e2 beq.w 800049a <__adddf3+0x1ee> + 80002d6: ea4f 5454 mov.w r4, r4, lsr #21 + 80002da: ebd4 5555 rsbs r5, r4, r5, lsr #21 + 80002de: bfb8 it lt + 80002e0: 426d neglt r5, r5 + 80002e2: dd0c ble.n 80002fe <__adddf3+0x52> + 80002e4: 442c add r4, r5 + 80002e6: ea80 0202 eor.w r2, r0, r2 + 80002ea: ea81 0303 eor.w r3, r1, r3 + 80002ee: ea82 0000 eor.w r0, r2, r0 + 80002f2: ea83 0101 eor.w r1, r3, r1 + 80002f6: ea80 0202 eor.w r2, r0, r2 + 80002fa: ea81 0303 eor.w r3, r1, r3 + 80002fe: 2d36 cmp r5, #54 @ 0x36 + 8000300: bf88 it hi + 8000302: bd30 pophi {r4, r5, pc} + 8000304: f011 4f00 tst.w r1, #2147483648 @ 0x80000000 + 8000308: ea4f 3101 mov.w r1, r1, lsl #12 + 800030c: f44f 1c80 mov.w ip, #1048576 @ 0x100000 + 8000310: ea4c 3111 orr.w r1, ip, r1, lsr #12 + 8000314: d002 beq.n 800031c <__adddf3+0x70> + 8000316: 4240 negs r0, r0 + 8000318: eb61 0141 sbc.w r1, r1, r1, lsl #1 + 800031c: f013 4f00 tst.w r3, #2147483648 @ 0x80000000 + 8000320: ea4f 3303 mov.w r3, r3, lsl #12 + 8000324: ea4c 3313 orr.w r3, ip, r3, lsr #12 + 8000328: d002 beq.n 8000330 <__adddf3+0x84> + 800032a: 4252 negs r2, r2 + 800032c: eb63 0343 sbc.w r3, r3, r3, lsl #1 + 8000330: ea94 0f05 teq r4, r5 + 8000334: f000 80a7 beq.w 8000486 <__adddf3+0x1da> + 8000338: f1a4 0401 sub.w r4, r4, #1 + 800033c: f1d5 0e20 rsbs lr, r5, #32 + 8000340: db0d blt.n 800035e <__adddf3+0xb2> + 8000342: fa02 fc0e lsl.w ip, r2, lr + 8000346: fa22 f205 lsr.w r2, r2, r5 + 800034a: 1880 adds r0, r0, r2 + 800034c: f141 0100 adc.w r1, r1, #0 + 8000350: fa03 f20e lsl.w r2, r3, lr + 8000354: 1880 adds r0, r0, r2 + 8000356: fa43 f305 asr.w r3, r3, r5 + 800035a: 4159 adcs r1, r3 + 800035c: e00e b.n 800037c <__adddf3+0xd0> + 800035e: f1a5 0520 sub.w r5, r5, #32 + 8000362: f10e 0e20 add.w lr, lr, #32 + 8000366: 2a01 cmp r2, #1 + 8000368: fa03 fc0e lsl.w ip, r3, lr + 800036c: bf28 it cs + 800036e: f04c 0c02 orrcs.w ip, ip, #2 + 8000372: fa43 f305 asr.w r3, r3, r5 + 8000376: 18c0 adds r0, r0, r3 + 8000378: eb51 71e3 adcs.w r1, r1, r3, asr #31 + 800037c: f001 4500 and.w r5, r1, #2147483648 @ 0x80000000 + 8000380: d507 bpl.n 8000392 <__adddf3+0xe6> + 8000382: f04f 0e00 mov.w lr, #0 + 8000386: f1dc 0c00 rsbs ip, ip, #0 + 800038a: eb7e 0000 sbcs.w r0, lr, r0 + 800038e: eb6e 0101 sbc.w r1, lr, r1 + 8000392: f5b1 1f80 cmp.w r1, #1048576 @ 0x100000 + 8000396: d31b bcc.n 80003d0 <__adddf3+0x124> + 8000398: f5b1 1f00 cmp.w r1, #2097152 @ 0x200000 + 800039c: d30c bcc.n 80003b8 <__adddf3+0x10c> + 800039e: 0849 lsrs r1, r1, #1 + 80003a0: ea5f 0030 movs.w r0, r0, rrx + 80003a4: ea4f 0c3c mov.w ip, ip, rrx + 80003a8: f104 0401 add.w r4, r4, #1 + 80003ac: ea4f 5244 mov.w r2, r4, lsl #21 + 80003b0: f512 0f80 cmn.w r2, #4194304 @ 0x400000 + 80003b4: f080 809a bcs.w 80004ec <__adddf3+0x240> + 80003b8: f1bc 4f00 cmp.w ip, #2147483648 @ 0x80000000 + 80003bc: bf08 it eq + 80003be: ea5f 0c50 movseq.w ip, r0, lsr #1 + 80003c2: f150 0000 adcs.w r0, r0, #0 + 80003c6: eb41 5104 adc.w r1, r1, r4, lsl #20 + 80003ca: ea41 0105 orr.w r1, r1, r5 + 80003ce: bd30 pop {r4, r5, pc} + 80003d0: ea5f 0c4c movs.w ip, ip, lsl #1 + 80003d4: 4140 adcs r0, r0 + 80003d6: eb41 0101 adc.w r1, r1, r1 + 80003da: 3c01 subs r4, #1 + 80003dc: bf28 it cs + 80003de: f5b1 1f80 cmpcs.w r1, #1048576 @ 0x100000 + 80003e2: d2e9 bcs.n 80003b8 <__adddf3+0x10c> + 80003e4: f091 0f00 teq r1, #0 + 80003e8: bf04 itt eq + 80003ea: 4601 moveq r1, r0 + 80003ec: 2000 moveq r0, #0 + 80003ee: fab1 f381 clz r3, r1 + 80003f2: bf08 it eq + 80003f4: 3320 addeq r3, #32 + 80003f6: f1a3 030b sub.w r3, r3, #11 + 80003fa: f1b3 0220 subs.w r2, r3, #32 + 80003fe: da0c bge.n 800041a <__adddf3+0x16e> + 8000400: 320c adds r2, #12 + 8000402: dd08 ble.n 8000416 <__adddf3+0x16a> + 8000404: f102 0c14 add.w ip, r2, #20 + 8000408: f1c2 020c rsb r2, r2, #12 + 800040c: fa01 f00c lsl.w r0, r1, ip + 8000410: fa21 f102 lsr.w r1, r1, r2 + 8000414: e00c b.n 8000430 <__adddf3+0x184> + 8000416: f102 0214 add.w r2, r2, #20 + 800041a: bfd8 it le + 800041c: f1c2 0c20 rsble ip, r2, #32 + 8000420: fa01 f102 lsl.w r1, r1, r2 + 8000424: fa20 fc0c lsr.w ip, r0, ip + 8000428: bfdc itt le + 800042a: ea41 010c orrle.w r1, r1, ip + 800042e: 4090 lslle r0, r2 + 8000430: 1ae4 subs r4, r4, r3 + 8000432: bfa2 ittt ge + 8000434: eb01 5104 addge.w r1, r1, r4, lsl #20 + 8000438: 4329 orrge r1, r5 + 800043a: bd30 popge {r4, r5, pc} + 800043c: ea6f 0404 mvn.w r4, r4 + 8000440: 3c1f subs r4, #31 + 8000442: da1c bge.n 800047e <__adddf3+0x1d2> + 8000444: 340c adds r4, #12 + 8000446: dc0e bgt.n 8000466 <__adddf3+0x1ba> + 8000448: f104 0414 add.w r4, r4, #20 + 800044c: f1c4 0220 rsb r2, r4, #32 + 8000450: fa20 f004 lsr.w r0, r0, r4 + 8000454: fa01 f302 lsl.w r3, r1, r2 + 8000458: ea40 0003 orr.w r0, r0, r3 + 800045c: fa21 f304 lsr.w r3, r1, r4 + 8000460: ea45 0103 orr.w r1, r5, r3 + 8000464: bd30 pop {r4, r5, pc} + 8000466: f1c4 040c rsb r4, r4, #12 + 800046a: f1c4 0220 rsb r2, r4, #32 + 800046e: fa20 f002 lsr.w r0, r0, r2 + 8000472: fa01 f304 lsl.w r3, r1, r4 + 8000476: ea40 0003 orr.w r0, r0, r3 + 800047a: 4629 mov r1, r5 + 800047c: bd30 pop {r4, r5, pc} + 800047e: fa21 f004 lsr.w r0, r1, r4 + 8000482: 4629 mov r1, r5 + 8000484: bd30 pop {r4, r5, pc} + 8000486: f094 0f00 teq r4, #0 + 800048a: f483 1380 eor.w r3, r3, #1048576 @ 0x100000 + 800048e: bf06 itte eq + 8000490: f481 1180 eoreq.w r1, r1, #1048576 @ 0x100000 + 8000494: 3401 addeq r4, #1 + 8000496: 3d01 subne r5, #1 + 8000498: e74e b.n 8000338 <__adddf3+0x8c> + 800049a: ea7f 5c64 mvns.w ip, r4, asr #21 + 800049e: bf18 it ne + 80004a0: ea7f 5c65 mvnsne.w ip, r5, asr #21 + 80004a4: d029 beq.n 80004fa <__adddf3+0x24e> + 80004a6: ea94 0f05 teq r4, r5 + 80004aa: bf08 it eq + 80004ac: ea90 0f02 teqeq r0, r2 + 80004b0: d005 beq.n 80004be <__adddf3+0x212> + 80004b2: ea54 0c00 orrs.w ip, r4, r0 + 80004b6: bf04 itt eq + 80004b8: 4619 moveq r1, r3 + 80004ba: 4610 moveq r0, r2 + 80004bc: bd30 pop {r4, r5, pc} + 80004be: ea91 0f03 teq r1, r3 + 80004c2: bf1e ittt ne + 80004c4: 2100 movne r1, #0 + 80004c6: 2000 movne r0, #0 + 80004c8: bd30 popne {r4, r5, pc} + 80004ca: ea5f 5c54 movs.w ip, r4, lsr #21 + 80004ce: d105 bne.n 80004dc <__adddf3+0x230> + 80004d0: 0040 lsls r0, r0, #1 + 80004d2: 4149 adcs r1, r1 + 80004d4: bf28 it cs + 80004d6: f041 4100 orrcs.w r1, r1, #2147483648 @ 0x80000000 + 80004da: bd30 pop {r4, r5, pc} + 80004dc: f514 0480 adds.w r4, r4, #4194304 @ 0x400000 + 80004e0: bf3c itt cc + 80004e2: f501 1180 addcc.w r1, r1, #1048576 @ 0x100000 + 80004e6: bd30 popcc {r4, r5, pc} + 80004e8: f001 4500 and.w r5, r1, #2147483648 @ 0x80000000 + 80004ec: f045 41fe orr.w r1, r5, #2130706432 @ 0x7f000000 + 80004f0: f441 0170 orr.w r1, r1, #15728640 @ 0xf00000 + 80004f4: f04f 0000 mov.w r0, #0 + 80004f8: bd30 pop {r4, r5, pc} + 80004fa: ea7f 5c64 mvns.w ip, r4, asr #21 + 80004fe: bf1a itte ne + 8000500: 4619 movne r1, r3 + 8000502: 4610 movne r0, r2 + 8000504: ea7f 5c65 mvnseq.w ip, r5, asr #21 + 8000508: bf1c itt ne + 800050a: 460b movne r3, r1 + 800050c: 4602 movne r2, r0 + 800050e: ea50 3401 orrs.w r4, r0, r1, lsl #12 + 8000512: bf06 itte eq + 8000514: ea52 3503 orrseq.w r5, r2, r3, lsl #12 + 8000518: ea91 0f03 teqeq r1, r3 + 800051c: f441 2100 orrne.w r1, r1, #524288 @ 0x80000 + 8000520: bd30 pop {r4, r5, pc} + 8000522: bf00 nop + +08000524 <__aeabi_ui2d>: + 8000524: f090 0f00 teq r0, #0 + 8000528: bf04 itt eq + 800052a: 2100 moveq r1, #0 + 800052c: 4770 bxeq lr + 800052e: b530 push {r4, r5, lr} + 8000530: f44f 6480 mov.w r4, #1024 @ 0x400 + 8000534: f104 0432 add.w r4, r4, #50 @ 0x32 + 8000538: f04f 0500 mov.w r5, #0 + 800053c: f04f 0100 mov.w r1, #0 + 8000540: e750 b.n 80003e4 <__adddf3+0x138> + 8000542: bf00 nop + +08000544 <__aeabi_i2d>: + 8000544: f090 0f00 teq r0, #0 + 8000548: bf04 itt eq + 800054a: 2100 moveq r1, #0 + 800054c: 4770 bxeq lr + 800054e: b530 push {r4, r5, lr} + 8000550: f44f 6480 mov.w r4, #1024 @ 0x400 + 8000554: f104 0432 add.w r4, r4, #50 @ 0x32 + 8000558: f010 4500 ands.w r5, r0, #2147483648 @ 0x80000000 + 800055c: bf48 it mi + 800055e: 4240 negmi r0, r0 + 8000560: f04f 0100 mov.w r1, #0 + 8000564: e73e b.n 80003e4 <__adddf3+0x138> + 8000566: bf00 nop + +08000568 <__aeabi_f2d>: + 8000568: 0042 lsls r2, r0, #1 + 800056a: ea4f 01e2 mov.w r1, r2, asr #3 + 800056e: ea4f 0131 mov.w r1, r1, rrx + 8000572: ea4f 7002 mov.w r0, r2, lsl #28 + 8000576: bf1f itttt ne + 8000578: f012 437f andsne.w r3, r2, #4278190080 @ 0xff000000 + 800057c: f093 4f7f teqne r3, #4278190080 @ 0xff000000 + 8000580: f081 5160 eorne.w r1, r1, #939524096 @ 0x38000000 + 8000584: 4770 bxne lr + 8000586: f032 427f bics.w r2, r2, #4278190080 @ 0xff000000 + 800058a: bf08 it eq + 800058c: 4770 bxeq lr + 800058e: f093 4f7f teq r3, #4278190080 @ 0xff000000 + 8000592: bf04 itt eq + 8000594: f441 2100 orreq.w r1, r1, #524288 @ 0x80000 + 8000598: 4770 bxeq lr + 800059a: b530 push {r4, r5, lr} + 800059c: f44f 7460 mov.w r4, #896 @ 0x380 + 80005a0: f001 4500 and.w r5, r1, #2147483648 @ 0x80000000 + 80005a4: f021 4100 bic.w r1, r1, #2147483648 @ 0x80000000 + 80005a8: e71c b.n 80003e4 <__adddf3+0x138> + 80005aa: bf00 nop + +080005ac <__aeabi_ul2d>: + 80005ac: ea50 0201 orrs.w r2, r0, r1 + 80005b0: bf08 it eq + 80005b2: 4770 bxeq lr + 80005b4: b530 push {r4, r5, lr} + 80005b6: f04f 0500 mov.w r5, #0 + 80005ba: e00a b.n 80005d2 <__aeabi_l2d+0x16> + +080005bc <__aeabi_l2d>: + 80005bc: ea50 0201 orrs.w r2, r0, r1 + 80005c0: bf08 it eq + 80005c2: 4770 bxeq lr + 80005c4: b530 push {r4, r5, lr} + 80005c6: f011 4500 ands.w r5, r1, #2147483648 @ 0x80000000 + 80005ca: d502 bpl.n 80005d2 <__aeabi_l2d+0x16> + 80005cc: 4240 negs r0, r0 + 80005ce: eb61 0141 sbc.w r1, r1, r1, lsl #1 + 80005d2: f44f 6480 mov.w r4, #1024 @ 0x400 + 80005d6: f104 0432 add.w r4, r4, #50 @ 0x32 + 80005da: ea5f 5c91 movs.w ip, r1, lsr #22 + 80005de: f43f aed8 beq.w 8000392 <__adddf3+0xe6> + 80005e2: f04f 0203 mov.w r2, #3 + 80005e6: ea5f 0cdc movs.w ip, ip, lsr #3 + 80005ea: bf18 it ne + 80005ec: 3203 addne r2, #3 + 80005ee: ea5f 0cdc movs.w ip, ip, lsr #3 + 80005f2: bf18 it ne + 80005f4: 3203 addne r2, #3 + 80005f6: eb02 02dc add.w r2, r2, ip, lsr #3 + 80005fa: f1c2 0320 rsb r3, r2, #32 + 80005fe: fa00 fc03 lsl.w ip, r0, r3 + 8000602: fa20 f002 lsr.w r0, r0, r2 + 8000606: fa01 fe03 lsl.w lr, r1, r3 + 800060a: ea40 000e orr.w r0, r0, lr + 800060e: fa21 f102 lsr.w r1, r1, r2 + 8000612: 4414 add r4, r2 + 8000614: e6bd b.n 8000392 <__adddf3+0xe6> + 8000616: bf00 nop + +08000618 <__aeabi_dmul>: + 8000618: b570 push {r4, r5, r6, lr} + 800061a: f04f 0cff mov.w ip, #255 @ 0xff + 800061e: f44c 6ce0 orr.w ip, ip, #1792 @ 0x700 + 8000622: ea1c 5411 ands.w r4, ip, r1, lsr #20 + 8000626: bf1d ittte ne + 8000628: ea1c 5513 andsne.w r5, ip, r3, lsr #20 + 800062c: ea94 0f0c teqne r4, ip + 8000630: ea95 0f0c teqne r5, ip + 8000634: f000 f8de bleq 80007f4 <__aeabi_dmul+0x1dc> + 8000638: 442c add r4, r5 + 800063a: ea81 0603 eor.w r6, r1, r3 + 800063e: ea21 514c bic.w r1, r1, ip, lsl #21 + 8000642: ea23 534c bic.w r3, r3, ip, lsl #21 + 8000646: ea50 3501 orrs.w r5, r0, r1, lsl #12 + 800064a: bf18 it ne + 800064c: ea52 3503 orrsne.w r5, r2, r3, lsl #12 + 8000650: f441 1180 orr.w r1, r1, #1048576 @ 0x100000 + 8000654: f443 1380 orr.w r3, r3, #1048576 @ 0x100000 + 8000658: d038 beq.n 80006cc <__aeabi_dmul+0xb4> + 800065a: fba0 ce02 umull ip, lr, r0, r2 + 800065e: f04f 0500 mov.w r5, #0 + 8000662: fbe1 e502 umlal lr, r5, r1, r2 + 8000666: f006 4200 and.w r2, r6, #2147483648 @ 0x80000000 + 800066a: fbe0 e503 umlal lr, r5, r0, r3 + 800066e: f04f 0600 mov.w r6, #0 + 8000672: fbe1 5603 umlal r5, r6, r1, r3 + 8000676: f09c 0f00 teq ip, #0 + 800067a: bf18 it ne + 800067c: f04e 0e01 orrne.w lr, lr, #1 + 8000680: f1a4 04ff sub.w r4, r4, #255 @ 0xff + 8000684: f5b6 7f00 cmp.w r6, #512 @ 0x200 + 8000688: f564 7440 sbc.w r4, r4, #768 @ 0x300 + 800068c: d204 bcs.n 8000698 <__aeabi_dmul+0x80> + 800068e: ea5f 0e4e movs.w lr, lr, lsl #1 + 8000692: 416d adcs r5, r5 + 8000694: eb46 0606 adc.w r6, r6, r6 + 8000698: ea42 21c6 orr.w r1, r2, r6, lsl #11 + 800069c: ea41 5155 orr.w r1, r1, r5, lsr #21 + 80006a0: ea4f 20c5 mov.w r0, r5, lsl #11 + 80006a4: ea40 505e orr.w r0, r0, lr, lsr #21 + 80006a8: ea4f 2ece mov.w lr, lr, lsl #11 + 80006ac: f1b4 0cfd subs.w ip, r4, #253 @ 0xfd + 80006b0: bf88 it hi + 80006b2: f5bc 6fe0 cmphi.w ip, #1792 @ 0x700 + 80006b6: d81e bhi.n 80006f6 <__aeabi_dmul+0xde> + 80006b8: f1be 4f00 cmp.w lr, #2147483648 @ 0x80000000 + 80006bc: bf08 it eq + 80006be: ea5f 0e50 movseq.w lr, r0, lsr #1 + 80006c2: f150 0000 adcs.w r0, r0, #0 + 80006c6: eb41 5104 adc.w r1, r1, r4, lsl #20 + 80006ca: bd70 pop {r4, r5, r6, pc} + 80006cc: f006 4600 and.w r6, r6, #2147483648 @ 0x80000000 + 80006d0: ea46 0101 orr.w r1, r6, r1 + 80006d4: ea40 0002 orr.w r0, r0, r2 + 80006d8: ea81 0103 eor.w r1, r1, r3 + 80006dc: ebb4 045c subs.w r4, r4, ip, lsr #1 + 80006e0: bfc2 ittt gt + 80006e2: ebd4 050c rsbsgt r5, r4, ip + 80006e6: ea41 5104 orrgt.w r1, r1, r4, lsl #20 + 80006ea: bd70 popgt {r4, r5, r6, pc} + 80006ec: f441 1180 orr.w r1, r1, #1048576 @ 0x100000 + 80006f0: f04f 0e00 mov.w lr, #0 + 80006f4: 3c01 subs r4, #1 + 80006f6: f300 80ab bgt.w 8000850 <__aeabi_dmul+0x238> + 80006fa: f114 0f36 cmn.w r4, #54 @ 0x36 + 80006fe: bfde ittt le + 8000700: 2000 movle r0, #0 + 8000702: f001 4100 andle.w r1, r1, #2147483648 @ 0x80000000 + 8000706: bd70 pople {r4, r5, r6, pc} + 8000708: f1c4 0400 rsb r4, r4, #0 + 800070c: 3c20 subs r4, #32 + 800070e: da35 bge.n 800077c <__aeabi_dmul+0x164> + 8000710: 340c adds r4, #12 + 8000712: dc1b bgt.n 800074c <__aeabi_dmul+0x134> + 8000714: f104 0414 add.w r4, r4, #20 + 8000718: f1c4 0520 rsb r5, r4, #32 + 800071c: fa00 f305 lsl.w r3, r0, r5 + 8000720: fa20 f004 lsr.w r0, r0, r4 + 8000724: fa01 f205 lsl.w r2, r1, r5 + 8000728: ea40 0002 orr.w r0, r0, r2 + 800072c: f001 4200 and.w r2, r1, #2147483648 @ 0x80000000 + 8000730: f021 4100 bic.w r1, r1, #2147483648 @ 0x80000000 + 8000734: eb10 70d3 adds.w r0, r0, r3, lsr #31 + 8000738: fa21 f604 lsr.w r6, r1, r4 + 800073c: eb42 0106 adc.w r1, r2, r6 + 8000740: ea5e 0e43 orrs.w lr, lr, r3, lsl #1 + 8000744: bf08 it eq + 8000746: ea20 70d3 biceq.w r0, r0, r3, lsr #31 + 800074a: bd70 pop {r4, r5, r6, pc} + 800074c: f1c4 040c rsb r4, r4, #12 + 8000750: f1c4 0520 rsb r5, r4, #32 + 8000754: fa00 f304 lsl.w r3, r0, r4 + 8000758: fa20 f005 lsr.w r0, r0, r5 + 800075c: fa01 f204 lsl.w r2, r1, r4 + 8000760: ea40 0002 orr.w r0, r0, r2 + 8000764: f001 4100 and.w r1, r1, #2147483648 @ 0x80000000 + 8000768: eb10 70d3 adds.w r0, r0, r3, lsr #31 + 800076c: f141 0100 adc.w r1, r1, #0 + 8000770: ea5e 0e43 orrs.w lr, lr, r3, lsl #1 + 8000774: bf08 it eq + 8000776: ea20 70d3 biceq.w r0, r0, r3, lsr #31 + 800077a: bd70 pop {r4, r5, r6, pc} + 800077c: f1c4 0520 rsb r5, r4, #32 + 8000780: fa00 f205 lsl.w r2, r0, r5 + 8000784: ea4e 0e02 orr.w lr, lr, r2 + 8000788: fa20 f304 lsr.w r3, r0, r4 + 800078c: fa01 f205 lsl.w r2, r1, r5 + 8000790: ea43 0302 orr.w r3, r3, r2 + 8000794: fa21 f004 lsr.w r0, r1, r4 + 8000798: f001 4100 and.w r1, r1, #2147483648 @ 0x80000000 + 800079c: fa21 f204 lsr.w r2, r1, r4 + 80007a0: ea20 0002 bic.w r0, r0, r2 + 80007a4: eb00 70d3 add.w r0, r0, r3, lsr #31 + 80007a8: ea5e 0e43 orrs.w lr, lr, r3, lsl #1 + 80007ac: bf08 it eq + 80007ae: ea20 70d3 biceq.w r0, r0, r3, lsr #31 + 80007b2: bd70 pop {r4, r5, r6, pc} + 80007b4: f094 0f00 teq r4, #0 + 80007b8: d10f bne.n 80007da <__aeabi_dmul+0x1c2> + 80007ba: f001 4600 and.w r6, r1, #2147483648 @ 0x80000000 + 80007be: 0040 lsls r0, r0, #1 + 80007c0: eb41 0101 adc.w r1, r1, r1 + 80007c4: f411 1f80 tst.w r1, #1048576 @ 0x100000 + 80007c8: bf08 it eq + 80007ca: 3c01 subeq r4, #1 + 80007cc: d0f7 beq.n 80007be <__aeabi_dmul+0x1a6> + 80007ce: ea41 0106 orr.w r1, r1, r6 + 80007d2: f095 0f00 teq r5, #0 + 80007d6: bf18 it ne + 80007d8: 4770 bxne lr + 80007da: f003 4600 and.w r6, r3, #2147483648 @ 0x80000000 + 80007de: 0052 lsls r2, r2, #1 + 80007e0: eb43 0303 adc.w r3, r3, r3 + 80007e4: f413 1f80 tst.w r3, #1048576 @ 0x100000 + 80007e8: bf08 it eq + 80007ea: 3d01 subeq r5, #1 + 80007ec: d0f7 beq.n 80007de <__aeabi_dmul+0x1c6> + 80007ee: ea43 0306 orr.w r3, r3, r6 + 80007f2: 4770 bx lr + 80007f4: ea94 0f0c teq r4, ip + 80007f8: ea0c 5513 and.w r5, ip, r3, lsr #20 + 80007fc: bf18 it ne + 80007fe: ea95 0f0c teqne r5, ip + 8000802: d00c beq.n 800081e <__aeabi_dmul+0x206> + 8000804: ea50 0641 orrs.w r6, r0, r1, lsl #1 + 8000808: bf18 it ne + 800080a: ea52 0643 orrsne.w r6, r2, r3, lsl #1 + 800080e: d1d1 bne.n 80007b4 <__aeabi_dmul+0x19c> + 8000810: ea81 0103 eor.w r1, r1, r3 + 8000814: f001 4100 and.w r1, r1, #2147483648 @ 0x80000000 + 8000818: f04f 0000 mov.w r0, #0 + 800081c: bd70 pop {r4, r5, r6, pc} + 800081e: ea50 0641 orrs.w r6, r0, r1, lsl #1 + 8000822: bf06 itte eq + 8000824: 4610 moveq r0, r2 + 8000826: 4619 moveq r1, r3 + 8000828: ea52 0643 orrsne.w r6, r2, r3, lsl #1 + 800082c: d019 beq.n 8000862 <__aeabi_dmul+0x24a> + 800082e: ea94 0f0c teq r4, ip + 8000832: d102 bne.n 800083a <__aeabi_dmul+0x222> + 8000834: ea50 3601 orrs.w r6, r0, r1, lsl #12 + 8000838: d113 bne.n 8000862 <__aeabi_dmul+0x24a> + 800083a: ea95 0f0c teq r5, ip + 800083e: d105 bne.n 800084c <__aeabi_dmul+0x234> + 8000840: ea52 3603 orrs.w r6, r2, r3, lsl #12 + 8000844: bf1c itt ne + 8000846: 4610 movne r0, r2 + 8000848: 4619 movne r1, r3 + 800084a: d10a bne.n 8000862 <__aeabi_dmul+0x24a> + 800084c: ea81 0103 eor.w r1, r1, r3 + 8000850: f001 4100 and.w r1, r1, #2147483648 @ 0x80000000 + 8000854: f041 41fe orr.w r1, r1, #2130706432 @ 0x7f000000 + 8000858: f441 0170 orr.w r1, r1, #15728640 @ 0xf00000 + 800085c: f04f 0000 mov.w r0, #0 + 8000860: bd70 pop {r4, r5, r6, pc} + 8000862: f041 41fe orr.w r1, r1, #2130706432 @ 0x7f000000 + 8000866: f441 0178 orr.w r1, r1, #16252928 @ 0xf80000 + 800086a: bd70 pop {r4, r5, r6, pc} + +0800086c <__aeabi_ddiv>: + 800086c: b570 push {r4, r5, r6, lr} + 800086e: f04f 0cff mov.w ip, #255 @ 0xff + 8000872: f44c 6ce0 orr.w ip, ip, #1792 @ 0x700 + 8000876: ea1c 5411 ands.w r4, ip, r1, lsr #20 + 800087a: bf1d ittte ne + 800087c: ea1c 5513 andsne.w r5, ip, r3, lsr #20 + 8000880: ea94 0f0c teqne r4, ip + 8000884: ea95 0f0c teqne r5, ip + 8000888: f000 f8a7 bleq 80009da <__aeabi_ddiv+0x16e> + 800088c: eba4 0405 sub.w r4, r4, r5 + 8000890: ea81 0e03 eor.w lr, r1, r3 + 8000894: ea52 3503 orrs.w r5, r2, r3, lsl #12 + 8000898: ea4f 3101 mov.w r1, r1, lsl #12 + 800089c: f000 8088 beq.w 80009b0 <__aeabi_ddiv+0x144> + 80008a0: ea4f 3303 mov.w r3, r3, lsl #12 + 80008a4: f04f 5580 mov.w r5, #268435456 @ 0x10000000 + 80008a8: ea45 1313 orr.w r3, r5, r3, lsr #4 + 80008ac: ea43 6312 orr.w r3, r3, r2, lsr #24 + 80008b0: ea4f 2202 mov.w r2, r2, lsl #8 + 80008b4: ea45 1511 orr.w r5, r5, r1, lsr #4 + 80008b8: ea45 6510 orr.w r5, r5, r0, lsr #24 + 80008bc: ea4f 2600 mov.w r6, r0, lsl #8 + 80008c0: f00e 4100 and.w r1, lr, #2147483648 @ 0x80000000 + 80008c4: 429d cmp r5, r3 + 80008c6: bf08 it eq + 80008c8: 4296 cmpeq r6, r2 + 80008ca: f144 04fd adc.w r4, r4, #253 @ 0xfd + 80008ce: f504 7440 add.w r4, r4, #768 @ 0x300 + 80008d2: d202 bcs.n 80008da <__aeabi_ddiv+0x6e> + 80008d4: 085b lsrs r3, r3, #1 + 80008d6: ea4f 0232 mov.w r2, r2, rrx + 80008da: 1ab6 subs r6, r6, r2 + 80008dc: eb65 0503 sbc.w r5, r5, r3 + 80008e0: 085b lsrs r3, r3, #1 + 80008e2: ea4f 0232 mov.w r2, r2, rrx + 80008e6: f44f 1080 mov.w r0, #1048576 @ 0x100000 + 80008ea: f44f 2c00 mov.w ip, #524288 @ 0x80000 + 80008ee: ebb6 0e02 subs.w lr, r6, r2 + 80008f2: eb75 0e03 sbcs.w lr, r5, r3 + 80008f6: bf22 ittt cs + 80008f8: 1ab6 subcs r6, r6, r2 + 80008fa: 4675 movcs r5, lr + 80008fc: ea40 000c orrcs.w r0, r0, ip + 8000900: 085b lsrs r3, r3, #1 + 8000902: ea4f 0232 mov.w r2, r2, rrx + 8000906: ebb6 0e02 subs.w lr, r6, r2 + 800090a: eb75 0e03 sbcs.w lr, r5, r3 + 800090e: bf22 ittt cs + 8000910: 1ab6 subcs r6, r6, r2 + 8000912: 4675 movcs r5, lr + 8000914: ea40 005c orrcs.w r0, r0, ip, lsr #1 + 8000918: 085b lsrs r3, r3, #1 + 800091a: ea4f 0232 mov.w r2, r2, rrx + 800091e: ebb6 0e02 subs.w lr, r6, r2 + 8000922: eb75 0e03 sbcs.w lr, r5, r3 + 8000926: bf22 ittt cs + 8000928: 1ab6 subcs r6, r6, r2 + 800092a: 4675 movcs r5, lr + 800092c: ea40 009c orrcs.w r0, r0, ip, lsr #2 + 8000930: 085b lsrs r3, r3, #1 + 8000932: ea4f 0232 mov.w r2, r2, rrx + 8000936: ebb6 0e02 subs.w lr, r6, r2 + 800093a: eb75 0e03 sbcs.w lr, r5, r3 + 800093e: bf22 ittt cs + 8000940: 1ab6 subcs r6, r6, r2 + 8000942: 4675 movcs r5, lr + 8000944: ea40 00dc orrcs.w r0, r0, ip, lsr #3 + 8000948: ea55 0e06 orrs.w lr, r5, r6 + 800094c: d018 beq.n 8000980 <__aeabi_ddiv+0x114> + 800094e: ea4f 1505 mov.w r5, r5, lsl #4 + 8000952: ea45 7516 orr.w r5, r5, r6, lsr #28 + 8000956: ea4f 1606 mov.w r6, r6, lsl #4 + 800095a: ea4f 03c3 mov.w r3, r3, lsl #3 + 800095e: ea43 7352 orr.w r3, r3, r2, lsr #29 + 8000962: ea4f 02c2 mov.w r2, r2, lsl #3 + 8000966: ea5f 1c1c movs.w ip, ip, lsr #4 + 800096a: d1c0 bne.n 80008ee <__aeabi_ddiv+0x82> + 800096c: f411 1f80 tst.w r1, #1048576 @ 0x100000 + 8000970: d10b bne.n 800098a <__aeabi_ddiv+0x11e> + 8000972: ea41 0100 orr.w r1, r1, r0 + 8000976: f04f 0000 mov.w r0, #0 + 800097a: f04f 4c00 mov.w ip, #2147483648 @ 0x80000000 + 800097e: e7b6 b.n 80008ee <__aeabi_ddiv+0x82> + 8000980: f411 1f80 tst.w r1, #1048576 @ 0x100000 + 8000984: bf04 itt eq + 8000986: 4301 orreq r1, r0 + 8000988: 2000 moveq r0, #0 + 800098a: f1b4 0cfd subs.w ip, r4, #253 @ 0xfd + 800098e: bf88 it hi + 8000990: f5bc 6fe0 cmphi.w ip, #1792 @ 0x700 + 8000994: f63f aeaf bhi.w 80006f6 <__aeabi_dmul+0xde> + 8000998: ebb5 0c03 subs.w ip, r5, r3 + 800099c: bf04 itt eq + 800099e: ebb6 0c02 subseq.w ip, r6, r2 + 80009a2: ea5f 0c50 movseq.w ip, r0, lsr #1 + 80009a6: f150 0000 adcs.w r0, r0, #0 + 80009aa: eb41 5104 adc.w r1, r1, r4, lsl #20 + 80009ae: bd70 pop {r4, r5, r6, pc} + 80009b0: f00e 4e00 and.w lr, lr, #2147483648 @ 0x80000000 + 80009b4: ea4e 3111 orr.w r1, lr, r1, lsr #12 + 80009b8: eb14 045c adds.w r4, r4, ip, lsr #1 + 80009bc: bfc2 ittt gt + 80009be: ebd4 050c rsbsgt r5, r4, ip + 80009c2: ea41 5104 orrgt.w r1, r1, r4, lsl #20 + 80009c6: bd70 popgt {r4, r5, r6, pc} + 80009c8: f441 1180 orr.w r1, r1, #1048576 @ 0x100000 + 80009cc: f04f 0e00 mov.w lr, #0 + 80009d0: 3c01 subs r4, #1 + 80009d2: e690 b.n 80006f6 <__aeabi_dmul+0xde> + 80009d4: ea45 0e06 orr.w lr, r5, r6 + 80009d8: e68d b.n 80006f6 <__aeabi_dmul+0xde> + 80009da: ea0c 5513 and.w r5, ip, r3, lsr #20 + 80009de: ea94 0f0c teq r4, ip + 80009e2: bf08 it eq + 80009e4: ea95 0f0c teqeq r5, ip + 80009e8: f43f af3b beq.w 8000862 <__aeabi_dmul+0x24a> + 80009ec: ea94 0f0c teq r4, ip + 80009f0: d10a bne.n 8000a08 <__aeabi_ddiv+0x19c> + 80009f2: ea50 3401 orrs.w r4, r0, r1, lsl #12 + 80009f6: f47f af34 bne.w 8000862 <__aeabi_dmul+0x24a> + 80009fa: ea95 0f0c teq r5, ip + 80009fe: f47f af25 bne.w 800084c <__aeabi_dmul+0x234> + 8000a02: 4610 mov r0, r2 + 8000a04: 4619 mov r1, r3 + 8000a06: e72c b.n 8000862 <__aeabi_dmul+0x24a> + 8000a08: ea95 0f0c teq r5, ip + 8000a0c: d106 bne.n 8000a1c <__aeabi_ddiv+0x1b0> + 8000a0e: ea52 3503 orrs.w r5, r2, r3, lsl #12 + 8000a12: f43f aefd beq.w 8000810 <__aeabi_dmul+0x1f8> + 8000a16: 4610 mov r0, r2 + 8000a18: 4619 mov r1, r3 + 8000a1a: e722 b.n 8000862 <__aeabi_dmul+0x24a> + 8000a1c: ea50 0641 orrs.w r6, r0, r1, lsl #1 + 8000a20: bf18 it ne + 8000a22: ea52 0643 orrsne.w r6, r2, r3, lsl #1 + 8000a26: f47f aec5 bne.w 80007b4 <__aeabi_dmul+0x19c> + 8000a2a: ea50 0441 orrs.w r4, r0, r1, lsl #1 + 8000a2e: f47f af0d bne.w 800084c <__aeabi_dmul+0x234> + 8000a32: ea52 0543 orrs.w r5, r2, r3, lsl #1 + 8000a36: f47f aeeb bne.w 8000810 <__aeabi_dmul+0x1f8> + 8000a3a: e712 b.n 8000862 <__aeabi_dmul+0x24a> + +08000a3c <__gedf2>: + 8000a3c: f04f 3cff mov.w ip, #4294967295 + 8000a40: e006 b.n 8000a50 <__cmpdf2+0x4> + 8000a42: bf00 nop + +08000a44 <__ledf2>: + 8000a44: f04f 0c01 mov.w ip, #1 + 8000a48: e002 b.n 8000a50 <__cmpdf2+0x4> + 8000a4a: bf00 nop + +08000a4c <__cmpdf2>: + 8000a4c: f04f 0c01 mov.w ip, #1 + 8000a50: f84d cd04 str.w ip, [sp, #-4]! + 8000a54: ea4f 0c41 mov.w ip, r1, lsl #1 + 8000a58: ea7f 5c6c mvns.w ip, ip, asr #21 + 8000a5c: ea4f 0c43 mov.w ip, r3, lsl #1 + 8000a60: bf18 it ne + 8000a62: ea7f 5c6c mvnsne.w ip, ip, asr #21 + 8000a66: d01b beq.n 8000aa0 <__cmpdf2+0x54> + 8000a68: b001 add sp, #4 + 8000a6a: ea50 0c41 orrs.w ip, r0, r1, lsl #1 + 8000a6e: bf0c ite eq + 8000a70: ea52 0c43 orrseq.w ip, r2, r3, lsl #1 + 8000a74: ea91 0f03 teqne r1, r3 + 8000a78: bf02 ittt eq + 8000a7a: ea90 0f02 teqeq r0, r2 + 8000a7e: 2000 moveq r0, #0 + 8000a80: 4770 bxeq lr + 8000a82: f110 0f00 cmn.w r0, #0 + 8000a86: ea91 0f03 teq r1, r3 + 8000a8a: bf58 it pl + 8000a8c: 4299 cmppl r1, r3 + 8000a8e: bf08 it eq + 8000a90: 4290 cmpeq r0, r2 + 8000a92: bf2c ite cs + 8000a94: 17d8 asrcs r0, r3, #31 + 8000a96: ea6f 70e3 mvncc.w r0, r3, asr #31 + 8000a9a: f040 0001 orr.w r0, r0, #1 + 8000a9e: 4770 bx lr + 8000aa0: ea4f 0c41 mov.w ip, r1, lsl #1 + 8000aa4: ea7f 5c6c mvns.w ip, ip, asr #21 + 8000aa8: d102 bne.n 8000ab0 <__cmpdf2+0x64> + 8000aaa: ea50 3c01 orrs.w ip, r0, r1, lsl #12 + 8000aae: d107 bne.n 8000ac0 <__cmpdf2+0x74> + 8000ab0: ea4f 0c43 mov.w ip, r3, lsl #1 + 8000ab4: ea7f 5c6c mvns.w ip, ip, asr #21 + 8000ab8: d1d6 bne.n 8000a68 <__cmpdf2+0x1c> + 8000aba: ea52 3c03 orrs.w ip, r2, r3, lsl #12 + 8000abe: d0d3 beq.n 8000a68 <__cmpdf2+0x1c> + 8000ac0: f85d 0b04 ldr.w r0, [sp], #4 + 8000ac4: 4770 bx lr + 8000ac6: bf00 nop + +08000ac8 <__aeabi_cdrcmple>: + 8000ac8: 4684 mov ip, r0 + 8000aca: 4610 mov r0, r2 + 8000acc: 4662 mov r2, ip + 8000ace: 468c mov ip, r1 + 8000ad0: 4619 mov r1, r3 + 8000ad2: 4663 mov r3, ip + 8000ad4: e000 b.n 8000ad8 <__aeabi_cdcmpeq> + 8000ad6: bf00 nop + +08000ad8 <__aeabi_cdcmpeq>: + 8000ad8: b501 push {r0, lr} + 8000ada: f7ff ffb7 bl 8000a4c <__cmpdf2> + 8000ade: 2800 cmp r0, #0 + 8000ae0: bf48 it mi + 8000ae2: f110 0f00 cmnmi.w r0, #0 + 8000ae6: bd01 pop {r0, pc} + +08000ae8 <__aeabi_dcmpeq>: + 8000ae8: f84d ed08 str.w lr, [sp, #-8]! + 8000aec: f7ff fff4 bl 8000ad8 <__aeabi_cdcmpeq> + 8000af0: bf0c ite eq + 8000af2: 2001 moveq r0, #1 + 8000af4: 2000 movne r0, #0 + 8000af6: f85d fb08 ldr.w pc, [sp], #8 + 8000afa: bf00 nop + +08000afc <__aeabi_dcmplt>: + 8000afc: f84d ed08 str.w lr, [sp, #-8]! + 8000b00: f7ff ffea bl 8000ad8 <__aeabi_cdcmpeq> + 8000b04: bf34 ite cc + 8000b06: 2001 movcc r0, #1 + 8000b08: 2000 movcs r0, #0 + 8000b0a: f85d fb08 ldr.w pc, [sp], #8 + 8000b0e: bf00 nop + +08000b10 <__aeabi_dcmple>: + 8000b10: f84d ed08 str.w lr, [sp, #-8]! + 8000b14: f7ff ffe0 bl 8000ad8 <__aeabi_cdcmpeq> + 8000b18: bf94 ite ls + 8000b1a: 2001 movls r0, #1 + 8000b1c: 2000 movhi r0, #0 + 8000b1e: f85d fb08 ldr.w pc, [sp], #8 + 8000b22: bf00 nop + +08000b24 <__aeabi_dcmpge>: + 8000b24: f84d ed08 str.w lr, [sp, #-8]! + 8000b28: f7ff ffce bl 8000ac8 <__aeabi_cdrcmple> + 8000b2c: bf94 ite ls + 8000b2e: 2001 movls r0, #1 + 8000b30: 2000 movhi r0, #0 + 8000b32: f85d fb08 ldr.w pc, [sp], #8 + 8000b36: bf00 nop + +08000b38 <__aeabi_dcmpgt>: + 8000b38: f84d ed08 str.w lr, [sp, #-8]! + 8000b3c: f7ff ffc4 bl 8000ac8 <__aeabi_cdrcmple> + 8000b40: bf34 ite cc + 8000b42: 2001 movcc r0, #1 + 8000b44: 2000 movcs r0, #0 + 8000b46: f85d fb08 ldr.w pc, [sp], #8 + 8000b4a: bf00 nop + +08000b4c <__aeabi_dcmpun>: + 8000b4c: ea4f 0c41 mov.w ip, r1, lsl #1 + 8000b50: ea7f 5c6c mvns.w ip, ip, asr #21 + 8000b54: d102 bne.n 8000b5c <__aeabi_dcmpun+0x10> + 8000b56: ea50 3c01 orrs.w ip, r0, r1, lsl #12 + 8000b5a: d10a bne.n 8000b72 <__aeabi_dcmpun+0x26> + 8000b5c: ea4f 0c43 mov.w ip, r3, lsl #1 + 8000b60: ea7f 5c6c mvns.w ip, ip, asr #21 + 8000b64: d102 bne.n 8000b6c <__aeabi_dcmpun+0x20> + 8000b66: ea52 3c03 orrs.w ip, r2, r3, lsl #12 + 8000b6a: d102 bne.n 8000b72 <__aeabi_dcmpun+0x26> + 8000b6c: f04f 0000 mov.w r0, #0 + 8000b70: 4770 bx lr + 8000b72: f04f 0001 mov.w r0, #1 + 8000b76: 4770 bx lr + +08000b78 <__aeabi_d2iz>: + 8000b78: ea4f 0241 mov.w r2, r1, lsl #1 + 8000b7c: f512 1200 adds.w r2, r2, #2097152 @ 0x200000 + 8000b80: d215 bcs.n 8000bae <__aeabi_d2iz+0x36> + 8000b82: d511 bpl.n 8000ba8 <__aeabi_d2iz+0x30> + 8000b84: f46f 7378 mvn.w r3, #992 @ 0x3e0 + 8000b88: ebb3 5262 subs.w r2, r3, r2, asr #21 + 8000b8c: d912 bls.n 8000bb4 <__aeabi_d2iz+0x3c> + 8000b8e: ea4f 23c1 mov.w r3, r1, lsl #11 + 8000b92: f043 4300 orr.w r3, r3, #2147483648 @ 0x80000000 + 8000b96: ea43 5350 orr.w r3, r3, r0, lsr #21 + 8000b9a: f011 4f00 tst.w r1, #2147483648 @ 0x80000000 + 8000b9e: fa23 f002 lsr.w r0, r3, r2 + 8000ba2: bf18 it ne + 8000ba4: 4240 negne r0, r0 + 8000ba6: 4770 bx lr + 8000ba8: f04f 0000 mov.w r0, #0 + 8000bac: 4770 bx lr + 8000bae: ea50 3001 orrs.w r0, r0, r1, lsl #12 + 8000bb2: d105 bne.n 8000bc0 <__aeabi_d2iz+0x48> + 8000bb4: f011 4000 ands.w r0, r1, #2147483648 @ 0x80000000 + 8000bb8: bf08 it eq + 8000bba: f06f 4000 mvneq.w r0, #2147483648 @ 0x80000000 + 8000bbe: 4770 bx lr + 8000bc0: f04f 0000 mov.w r0, #0 + 8000bc4: 4770 bx lr + 8000bc6: bf00 nop + +08000bc8 <__aeabi_uldivmod>: + 8000bc8: b953 cbnz r3, 8000be0 <__aeabi_uldivmod+0x18> + 8000bca: b94a cbnz r2, 8000be0 <__aeabi_uldivmod+0x18> + 8000bcc: 2900 cmp r1, #0 + 8000bce: bf08 it eq + 8000bd0: 2800 cmpeq r0, #0 + 8000bd2: bf1c itt ne + 8000bd4: f04f 31ff movne.w r1, #4294967295 + 8000bd8: f04f 30ff movne.w r0, #4294967295 + 8000bdc: f000 b96a b.w 8000eb4 <__aeabi_idiv0> + 8000be0: f1ad 0c08 sub.w ip, sp, #8 + 8000be4: e96d ce04 strd ip, lr, [sp, #-16]! + 8000be8: f000 f806 bl 8000bf8 <__udivmoddi4> + 8000bec: f8dd e004 ldr.w lr, [sp, #4] + 8000bf0: e9dd 2302 ldrd r2, r3, [sp, #8] + 8000bf4: b004 add sp, #16 + 8000bf6: 4770 bx lr + +08000bf8 <__udivmoddi4>: + 8000bf8: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 8000bfc: 9d08 ldr r5, [sp, #32] + 8000bfe: 460c mov r4, r1 + 8000c00: 2b00 cmp r3, #0 + 8000c02: d14e bne.n 8000ca2 <__udivmoddi4+0xaa> + 8000c04: 4694 mov ip, r2 + 8000c06: 458c cmp ip, r1 + 8000c08: 4686 mov lr, r0 + 8000c0a: fab2 f282 clz r2, r2 + 8000c0e: d962 bls.n 8000cd6 <__udivmoddi4+0xde> + 8000c10: b14a cbz r2, 8000c26 <__udivmoddi4+0x2e> + 8000c12: f1c2 0320 rsb r3, r2, #32 + 8000c16: 4091 lsls r1, r2 + 8000c18: fa20 f303 lsr.w r3, r0, r3 + 8000c1c: fa0c fc02 lsl.w ip, ip, r2 + 8000c20: 4319 orrs r1, r3 + 8000c22: fa00 fe02 lsl.w lr, r0, r2 + 8000c26: ea4f 471c mov.w r7, ip, lsr #16 + 8000c2a: fa1f f68c uxth.w r6, ip + 8000c2e: fbb1 f4f7 udiv r4, r1, r7 + 8000c32: ea4f 431e mov.w r3, lr, lsr #16 + 8000c36: fb07 1114 mls r1, r7, r4, r1 + 8000c3a: ea43 4301 orr.w r3, r3, r1, lsl #16 + 8000c3e: fb04 f106 mul.w r1, r4, r6 + 8000c42: 4299 cmp r1, r3 + 8000c44: d90a bls.n 8000c5c <__udivmoddi4+0x64> + 8000c46: eb1c 0303 adds.w r3, ip, r3 + 8000c4a: f104 30ff add.w r0, r4, #4294967295 + 8000c4e: f080 8112 bcs.w 8000e76 <__udivmoddi4+0x27e> + 8000c52: 4299 cmp r1, r3 + 8000c54: f240 810f bls.w 8000e76 <__udivmoddi4+0x27e> + 8000c58: 3c02 subs r4, #2 + 8000c5a: 4463 add r3, ip + 8000c5c: 1a59 subs r1, r3, r1 + 8000c5e: fa1f f38e uxth.w r3, lr + 8000c62: fbb1 f0f7 udiv r0, r1, r7 + 8000c66: fb07 1110 mls r1, r7, r0, r1 + 8000c6a: ea43 4301 orr.w r3, r3, r1, lsl #16 + 8000c6e: fb00 f606 mul.w r6, r0, r6 + 8000c72: 429e cmp r6, r3 + 8000c74: d90a bls.n 8000c8c <__udivmoddi4+0x94> + 8000c76: eb1c 0303 adds.w r3, ip, r3 + 8000c7a: f100 31ff add.w r1, r0, #4294967295 + 8000c7e: f080 80fc bcs.w 8000e7a <__udivmoddi4+0x282> + 8000c82: 429e cmp r6, r3 + 8000c84: f240 80f9 bls.w 8000e7a <__udivmoddi4+0x282> + 8000c88: 4463 add r3, ip + 8000c8a: 3802 subs r0, #2 + 8000c8c: 1b9b subs r3, r3, r6 + 8000c8e: ea40 4004 orr.w r0, r0, r4, lsl #16 + 8000c92: 2100 movs r1, #0 + 8000c94: b11d cbz r5, 8000c9e <__udivmoddi4+0xa6> + 8000c96: 40d3 lsrs r3, r2 + 8000c98: 2200 movs r2, #0 + 8000c9a: e9c5 3200 strd r3, r2, [r5] + 8000c9e: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} + 8000ca2: 428b cmp r3, r1 + 8000ca4: d905 bls.n 8000cb2 <__udivmoddi4+0xba> + 8000ca6: b10d cbz r5, 8000cac <__udivmoddi4+0xb4> + 8000ca8: e9c5 0100 strd r0, r1, [r5] + 8000cac: 2100 movs r1, #0 + 8000cae: 4608 mov r0, r1 + 8000cb0: e7f5 b.n 8000c9e <__udivmoddi4+0xa6> + 8000cb2: fab3 f183 clz r1, r3 + 8000cb6: 2900 cmp r1, #0 + 8000cb8: d146 bne.n 8000d48 <__udivmoddi4+0x150> + 8000cba: 42a3 cmp r3, r4 + 8000cbc: d302 bcc.n 8000cc4 <__udivmoddi4+0xcc> + 8000cbe: 4290 cmp r0, r2 + 8000cc0: f0c0 80f0 bcc.w 8000ea4 <__udivmoddi4+0x2ac> + 8000cc4: 1a86 subs r6, r0, r2 + 8000cc6: eb64 0303 sbc.w r3, r4, r3 + 8000cca: 2001 movs r0, #1 + 8000ccc: 2d00 cmp r5, #0 + 8000cce: d0e6 beq.n 8000c9e <__udivmoddi4+0xa6> + 8000cd0: e9c5 6300 strd r6, r3, [r5] + 8000cd4: e7e3 b.n 8000c9e <__udivmoddi4+0xa6> + 8000cd6: 2a00 cmp r2, #0 + 8000cd8: f040 8090 bne.w 8000dfc <__udivmoddi4+0x204> + 8000cdc: eba1 040c sub.w r4, r1, ip + 8000ce0: ea4f 481c mov.w r8, ip, lsr #16 + 8000ce4: fa1f f78c uxth.w r7, ip + 8000ce8: 2101 movs r1, #1 + 8000cea: fbb4 f6f8 udiv r6, r4, r8 + 8000cee: ea4f 431e mov.w r3, lr, lsr #16 + 8000cf2: fb08 4416 mls r4, r8, r6, r4 + 8000cf6: ea43 4304 orr.w r3, r3, r4, lsl #16 + 8000cfa: fb07 f006 mul.w r0, r7, r6 + 8000cfe: 4298 cmp r0, r3 + 8000d00: d908 bls.n 8000d14 <__udivmoddi4+0x11c> + 8000d02: eb1c 0303 adds.w r3, ip, r3 + 8000d06: f106 34ff add.w r4, r6, #4294967295 + 8000d0a: d202 bcs.n 8000d12 <__udivmoddi4+0x11a> + 8000d0c: 4298 cmp r0, r3 + 8000d0e: f200 80cd bhi.w 8000eac <__udivmoddi4+0x2b4> + 8000d12: 4626 mov r6, r4 + 8000d14: 1a1c subs r4, r3, r0 + 8000d16: fa1f f38e uxth.w r3, lr + 8000d1a: fbb4 f0f8 udiv r0, r4, r8 + 8000d1e: fb08 4410 mls r4, r8, r0, r4 + 8000d22: ea43 4304 orr.w r3, r3, r4, lsl #16 + 8000d26: fb00 f707 mul.w r7, r0, r7 + 8000d2a: 429f cmp r7, r3 + 8000d2c: d908 bls.n 8000d40 <__udivmoddi4+0x148> + 8000d2e: eb1c 0303 adds.w r3, ip, r3 + 8000d32: f100 34ff add.w r4, r0, #4294967295 + 8000d36: d202 bcs.n 8000d3e <__udivmoddi4+0x146> + 8000d38: 429f cmp r7, r3 + 8000d3a: f200 80b0 bhi.w 8000e9e <__udivmoddi4+0x2a6> + 8000d3e: 4620 mov r0, r4 + 8000d40: 1bdb subs r3, r3, r7 + 8000d42: ea40 4006 orr.w r0, r0, r6, lsl #16 + 8000d46: e7a5 b.n 8000c94 <__udivmoddi4+0x9c> + 8000d48: f1c1 0620 rsb r6, r1, #32 + 8000d4c: 408b lsls r3, r1 + 8000d4e: fa22 f706 lsr.w r7, r2, r6 + 8000d52: 431f orrs r7, r3 + 8000d54: fa20 fc06 lsr.w ip, r0, r6 + 8000d58: fa04 f301 lsl.w r3, r4, r1 + 8000d5c: ea43 030c orr.w r3, r3, ip + 8000d60: 40f4 lsrs r4, r6 + 8000d62: fa00 f801 lsl.w r8, r0, r1 + 8000d66: 0c38 lsrs r0, r7, #16 + 8000d68: ea4f 4913 mov.w r9, r3, lsr #16 + 8000d6c: fbb4 fef0 udiv lr, r4, r0 + 8000d70: fa1f fc87 uxth.w ip, r7 + 8000d74: fb00 441e mls r4, r0, lr, r4 + 8000d78: ea49 4404 orr.w r4, r9, r4, lsl #16 + 8000d7c: fb0e f90c mul.w r9, lr, ip + 8000d80: 45a1 cmp r9, r4 + 8000d82: fa02 f201 lsl.w r2, r2, r1 + 8000d86: d90a bls.n 8000d9e <__udivmoddi4+0x1a6> + 8000d88: 193c adds r4, r7, r4 + 8000d8a: f10e 3aff add.w sl, lr, #4294967295 + 8000d8e: f080 8084 bcs.w 8000e9a <__udivmoddi4+0x2a2> + 8000d92: 45a1 cmp r9, r4 + 8000d94: f240 8081 bls.w 8000e9a <__udivmoddi4+0x2a2> + 8000d98: f1ae 0e02 sub.w lr, lr, #2 + 8000d9c: 443c add r4, r7 + 8000d9e: eba4 0409 sub.w r4, r4, r9 + 8000da2: fa1f f983 uxth.w r9, r3 + 8000da6: fbb4 f3f0 udiv r3, r4, r0 + 8000daa: fb00 4413 mls r4, r0, r3, r4 + 8000dae: ea49 4404 orr.w r4, r9, r4, lsl #16 + 8000db2: fb03 fc0c mul.w ip, r3, ip + 8000db6: 45a4 cmp ip, r4 + 8000db8: d907 bls.n 8000dca <__udivmoddi4+0x1d2> + 8000dba: 193c adds r4, r7, r4 + 8000dbc: f103 30ff add.w r0, r3, #4294967295 + 8000dc0: d267 bcs.n 8000e92 <__udivmoddi4+0x29a> + 8000dc2: 45a4 cmp ip, r4 + 8000dc4: d965 bls.n 8000e92 <__udivmoddi4+0x29a> + 8000dc6: 3b02 subs r3, #2 + 8000dc8: 443c add r4, r7 + 8000dca: ea43 400e orr.w r0, r3, lr, lsl #16 + 8000dce: fba0 9302 umull r9, r3, r0, r2 + 8000dd2: eba4 040c sub.w r4, r4, ip + 8000dd6: 429c cmp r4, r3 + 8000dd8: 46ce mov lr, r9 + 8000dda: 469c mov ip, r3 + 8000ddc: d351 bcc.n 8000e82 <__udivmoddi4+0x28a> + 8000dde: d04e beq.n 8000e7e <__udivmoddi4+0x286> + 8000de0: b155 cbz r5, 8000df8 <__udivmoddi4+0x200> + 8000de2: ebb8 030e subs.w r3, r8, lr + 8000de6: eb64 040c sbc.w r4, r4, ip + 8000dea: fa04 f606 lsl.w r6, r4, r6 + 8000dee: 40cb lsrs r3, r1 + 8000df0: 431e orrs r6, r3 + 8000df2: 40cc lsrs r4, r1 + 8000df4: e9c5 6400 strd r6, r4, [r5] + 8000df8: 2100 movs r1, #0 + 8000dfa: e750 b.n 8000c9e <__udivmoddi4+0xa6> + 8000dfc: f1c2 0320 rsb r3, r2, #32 + 8000e00: fa20 f103 lsr.w r1, r0, r3 + 8000e04: fa0c fc02 lsl.w ip, ip, r2 + 8000e08: fa24 f303 lsr.w r3, r4, r3 + 8000e0c: 4094 lsls r4, r2 + 8000e0e: 430c orrs r4, r1 + 8000e10: ea4f 481c mov.w r8, ip, lsr #16 + 8000e14: fa00 fe02 lsl.w lr, r0, r2 + 8000e18: fa1f f78c uxth.w r7, ip + 8000e1c: fbb3 f0f8 udiv r0, r3, r8 + 8000e20: fb08 3110 mls r1, r8, r0, r3 + 8000e24: 0c23 lsrs r3, r4, #16 + 8000e26: ea43 4301 orr.w r3, r3, r1, lsl #16 + 8000e2a: fb00 f107 mul.w r1, r0, r7 + 8000e2e: 4299 cmp r1, r3 + 8000e30: d908 bls.n 8000e44 <__udivmoddi4+0x24c> + 8000e32: eb1c 0303 adds.w r3, ip, r3 + 8000e36: f100 36ff add.w r6, r0, #4294967295 + 8000e3a: d22c bcs.n 8000e96 <__udivmoddi4+0x29e> + 8000e3c: 4299 cmp r1, r3 + 8000e3e: d92a bls.n 8000e96 <__udivmoddi4+0x29e> + 8000e40: 3802 subs r0, #2 + 8000e42: 4463 add r3, ip + 8000e44: 1a5b subs r3, r3, r1 + 8000e46: b2a4 uxth r4, r4 + 8000e48: fbb3 f1f8 udiv r1, r3, r8 + 8000e4c: fb08 3311 mls r3, r8, r1, r3 + 8000e50: ea44 4403 orr.w r4, r4, r3, lsl #16 + 8000e54: fb01 f307 mul.w r3, r1, r7 + 8000e58: 42a3 cmp r3, r4 + 8000e5a: d908 bls.n 8000e6e <__udivmoddi4+0x276> + 8000e5c: eb1c 0404 adds.w r4, ip, r4 + 8000e60: f101 36ff add.w r6, r1, #4294967295 + 8000e64: d213 bcs.n 8000e8e <__udivmoddi4+0x296> + 8000e66: 42a3 cmp r3, r4 + 8000e68: d911 bls.n 8000e8e <__udivmoddi4+0x296> + 8000e6a: 3902 subs r1, #2 + 8000e6c: 4464 add r4, ip + 8000e6e: 1ae4 subs r4, r4, r3 + 8000e70: ea41 4100 orr.w r1, r1, r0, lsl #16 + 8000e74: e739 b.n 8000cea <__udivmoddi4+0xf2> + 8000e76: 4604 mov r4, r0 + 8000e78: e6f0 b.n 8000c5c <__udivmoddi4+0x64> + 8000e7a: 4608 mov r0, r1 + 8000e7c: e706 b.n 8000c8c <__udivmoddi4+0x94> + 8000e7e: 45c8 cmp r8, r9 + 8000e80: d2ae bcs.n 8000de0 <__udivmoddi4+0x1e8> + 8000e82: ebb9 0e02 subs.w lr, r9, r2 + 8000e86: eb63 0c07 sbc.w ip, r3, r7 + 8000e8a: 3801 subs r0, #1 + 8000e8c: e7a8 b.n 8000de0 <__udivmoddi4+0x1e8> + 8000e8e: 4631 mov r1, r6 + 8000e90: e7ed b.n 8000e6e <__udivmoddi4+0x276> + 8000e92: 4603 mov r3, r0 + 8000e94: e799 b.n 8000dca <__udivmoddi4+0x1d2> + 8000e96: 4630 mov r0, r6 + 8000e98: e7d4 b.n 8000e44 <__udivmoddi4+0x24c> + 8000e9a: 46d6 mov lr, sl + 8000e9c: e77f b.n 8000d9e <__udivmoddi4+0x1a6> + 8000e9e: 4463 add r3, ip + 8000ea0: 3802 subs r0, #2 + 8000ea2: e74d b.n 8000d40 <__udivmoddi4+0x148> + 8000ea4: 4606 mov r6, r0 + 8000ea6: 4623 mov r3, r4 + 8000ea8: 4608 mov r0, r1 + 8000eaa: e70f b.n 8000ccc <__udivmoddi4+0xd4> + 8000eac: 3e02 subs r6, #2 + 8000eae: 4463 add r3, ip + 8000eb0: e730 b.n 8000d14 <__udivmoddi4+0x11c> + 8000eb2: bf00 nop + +08000eb4 <__aeabi_idiv0>: + 8000eb4: 4770 bx lr + 8000eb6: bf00 nop + +08000eb8
: +/** + * @brief The application entry point. + * @retval int + */ +int main(void) +{ + 8000eb8: b580 push {r7, lr} + 8000eba: b084 sub sp, #16 + 8000ebc: af00 add r7, sp, #0 + /* USER CODE END 1 */ + + /* MCU Configuration--------------------------------------------------------*/ + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + 8000ebe: f000 ffb5 bl 8001e2c + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + 8000ec2: f000 f883 bl 8000fcc + /* USER CODE BEGIN SysInit */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + MX_GPIO_Init(); + 8000ec6: f000 f99d bl 8001204 + MX_LWIP_Init(); + 8000eca: f003 fe25 bl 8004b18 + MX_FMC_Init(); + 8000ece: f000 f937 bl 8001140 + MX_TIM3_Init(); + 8000ed2: f000 f8e7 bl 80010a4 + /* USER CODE BEGIN 2 */ + struct udp_pcb * pcb = udp_new(); + 8000ed6: f00b ffb7 bl 800ce48 + 8000eda: 60f8 str r0, [r7, #12] + sock_init(pcb); + 8000edc: 68f8 ldr r0, [r7, #12] + 8000ede: f000 fa6d bl 80013bc + memset(tx_msg.tx_buf, 0, sizeof tx_msg.tx_buf); + 8000ee2: f44f 62af mov.w r2, #1400 @ 0x578 + 8000ee6: 2100 movs r1, #0 + 8000ee8: 4831 ldr r0, [pc, #196] @ (8000fb0 ) + 8000eea: f010 fc04 bl 80116f6 + struct pbuf *p = pbuf_alloc(0, sizeof tx_msg.tx_buf, PBUF_RAM); + 8000eee: f44f 7220 mov.w r2, #640 @ 0x280 + 8000ef2: f44f 61af mov.w r1, #1400 @ 0x578 + 8000ef6: 2000 movs r0, #0 + 8000ef8: f005 fab4 bl 8006464 + 8000efc: 60b8 str r0, [r7, #8] + uint32_t br_addr = ipaddr_addr("10.1.1.255"); + 8000efe: 482d ldr r0, [pc, #180] @ (8000fb4 ) + 8000f00: f00f fa49 bl 8010396 + 8000f04: 4603 mov r3, r0 + 8000f06: 603b str r3, [r7, #0] + u16_t br_port = 50000U; + 8000f08: f24c 3350 movw r3, #50000 @ 0xc350 + 8000f0c: 80fb strh r3, [r7, #6] + // timer start + if (HAL_TIM_Base_Start_IT(&htim3) != HAL_OK) + 8000f0e: 482a ldr r0, [pc, #168] @ (8000fb8 ) + 8000f10: f003 f8b8 bl 8004084 + 8000f14: 4603 mov r3, r0 + 8000f16: 2b00 cmp r3, #0 + 8000f18: d001 beq.n 8000f1e + { + /* Starting Error */ + Error_Handler(); + 8000f1a: f000 fc6e bl 80017fa + + /* Infinite loop */ + /* USER CODE BEGIN WHILE */ + while (1) + { + MX_LWIP_Process(); + 8000f1e: f003 fe67 bl 8004bf0 + if (need_send_private == 1) + 8000f22: 4b26 ldr r3, [pc, #152] @ (8000fbc ) + 8000f24: 781b ldrb r3, [r3, #0] + 8000f26: 2b00 cmp r3, #0 + 8000f28: d01a beq.n 8000f60 + { + need_send_private = 0; + 8000f2a: 4b24 ldr r3, [pc, #144] @ (8000fbc ) + 8000f2c: 2200 movs r2, #0 + 8000f2e: 701a strb r2, [r3, #0] + set_pbuf_params(p, tx_msg.status_len + tx_msg.cmd_len); + 8000f30: 4b1f ldr r3, [pc, #124] @ (8000fb0 ) + 8000f32: f8b3 2578 ldrh.w r2, [r3, #1400] @ 0x578 + 8000f36: 4b1e ldr r3, [pc, #120] @ (8000fb0 ) + 8000f38: f8b3 357c ldrh.w r3, [r3, #1404] @ 0x57c + 8000f3c: 4413 add r3, r2 + 8000f3e: b29b uxth r3, r3 + 8000f40: 4619 mov r1, r3 + 8000f42: 68b8 ldr r0, [r7, #8] + 8000f44: f000 fa1e bl 8001384 + err_t errok = udp_sendto(pcb, p, &rx_addr, rx_msg.port); + 8000f48: 4b1d ldr r3, [pc, #116] @ (8000fc0 ) + 8000f4a: 881b ldrh r3, [r3, #0] + 8000f4c: 4a1d ldr r2, [pc, #116] @ (8000fc4 ) + 8000f4e: 68b9 ldr r1, [r7, #8] + 8000f50: 68f8 ldr r0, [r7, #12] + 8000f52: f00b fc6b bl 800c82c + 8000f56: 4603 mov r3, r0 + 8000f58: 717b strb r3, [r7, #5] + br_counter = 0; + 8000f5a: 4b1b ldr r3, [pc, #108] @ (8000fc8 ) + 8000f5c: 2200 movs r2, #0 + 8000f5e: 601a str r2, [r3, #0] + } + if (br_counter > 99) + 8000f60: 4b19 ldr r3, [pc, #100] @ (8000fc8 ) + 8000f62: 681b ldr r3, [r3, #0] + 8000f64: 2b63 cmp r3, #99 @ 0x63 + 8000f66: d919 bls.n 8000f9c + { + create_header(); + 8000f68: f000 f9e4 bl 8001334 + set_pbuf_params(p, create_header() + tx_msg.cmd_len); + 8000f6c: f000 f9e2 bl 8001334 + 8000f70: 4603 mov r3, r0 + 8000f72: 461a mov r2, r3 + 8000f74: 4b0e ldr r3, [pc, #56] @ (8000fb0 ) + 8000f76: f8b3 357c ldrh.w r3, [r3, #1404] @ 0x57c + 8000f7a: 4413 add r3, r2 + 8000f7c: b29b uxth r3, r3 + 8000f7e: 4619 mov r1, r3 + 8000f80: 68b8 ldr r0, [r7, #8] + 8000f82: f000 f9ff bl 8001384 + err_t errok = udp_sendto(pcb, p, (ip_addr_t*)&br_addr, br_port); + 8000f86: 88fb ldrh r3, [r7, #6] + 8000f88: 463a mov r2, r7 + 8000f8a: 68b9 ldr r1, [r7, #8] + 8000f8c: 68f8 ldr r0, [r7, #12] + 8000f8e: f00b fc4d bl 800c82c + 8000f92: 4603 mov r3, r0 + 8000f94: 713b strb r3, [r7, #4] + br_counter = 0; + 8000f96: 4b0c ldr r3, [pc, #48] @ (8000fc8 ) + 8000f98: 2200 movs r2, #0 + 8000f9a: 601a str r2, [r3, #0] + } + + if (rx_msg.con_timeout > 1999) + 8000f9c: 4b08 ldr r3, [pc, #32] @ (8000fc0 ) + 8000f9e: f8b3 380a ldrh.w r3, [r3, #2058] @ 0x80a + 8000fa2: f5b3 6ffa cmp.w r3, #2000 @ 0x7d0 + 8000fa6: d3ba bcc.n 8000f1e + { + rx_msg.clnt_con = 0; + 8000fa8: 4b05 ldr r3, [pc, #20] @ (8000fc0 ) + 8000faa: 2200 movs r2, #0 + 8000fac: 719a strb r2, [r3, #6] + MX_LWIP_Process(); + 8000fae: e7b6 b.n 8000f1e + 8000fb0: 20000fa8 .word 0x20000fa8 + 8000fb4: 08015fa8 .word 0x08015fa8 + 8000fb8: 200006fc .word 0x200006fc + 8000fbc: 20001526 .word 0x20001526 + 8000fc0: 2000079c .word 0x2000079c + 8000fc4: 20000798 .word 0x20000798 + 8000fc8: 20000794 .word 0x20000794 + +08000fcc : +/** + * @brief System Clock Configuration + * @retval None + */ +void SystemClock_Config(void) +{ + 8000fcc: b580 push {r7, lr} + 8000fce: b094 sub sp, #80 @ 0x50 + 8000fd0: af00 add r7, sp, #0 + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + 8000fd2: f107 0320 add.w r3, r7, #32 + 8000fd6: 2230 movs r2, #48 @ 0x30 + 8000fd8: 2100 movs r1, #0 + 8000fda: 4618 mov r0, r3 + 8000fdc: f010 fb8b bl 80116f6 + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + 8000fe0: f107 030c add.w r3, r7, #12 + 8000fe4: 2200 movs r2, #0 + 8000fe6: 601a str r2, [r3, #0] + 8000fe8: 605a str r2, [r3, #4] + 8000fea: 609a str r2, [r3, #8] + 8000fec: 60da str r2, [r3, #12] + 8000fee: 611a str r2, [r3, #16] + + /** Configure the main internal regulator output voltage + */ + __HAL_RCC_PWR_CLK_ENABLE(); + 8000ff0: 2300 movs r3, #0 + 8000ff2: 60bb str r3, [r7, #8] + 8000ff4: 4b29 ldr r3, [pc, #164] @ (800109c ) + 8000ff6: 6c1b ldr r3, [r3, #64] @ 0x40 + 8000ff8: 4a28 ldr r2, [pc, #160] @ (800109c ) + 8000ffa: f043 5380 orr.w r3, r3, #268435456 @ 0x10000000 + 8000ffe: 6413 str r3, [r2, #64] @ 0x40 + 8001000: 4b26 ldr r3, [pc, #152] @ (800109c ) + 8001002: 6c1b ldr r3, [r3, #64] @ 0x40 + 8001004: f003 5380 and.w r3, r3, #268435456 @ 0x10000000 + 8001008: 60bb str r3, [r7, #8] + 800100a: 68bb ldr r3, [r7, #8] + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3); + 800100c: 2300 movs r3, #0 + 800100e: 607b str r3, [r7, #4] + 8001010: 4b23 ldr r3, [pc, #140] @ (80010a0 ) + 8001012: 681b ldr r3, [r3, #0] + 8001014: f423 4340 bic.w r3, r3, #49152 @ 0xc000 + 8001018: 4a21 ldr r2, [pc, #132] @ (80010a0 ) + 800101a: f443 4380 orr.w r3, r3, #16384 @ 0x4000 + 800101e: 6013 str r3, [r2, #0] + 8001020: 4b1f ldr r3, [pc, #124] @ (80010a0 ) + 8001022: 681b ldr r3, [r3, #0] + 8001024: f403 4340 and.w r3, r3, #49152 @ 0xc000 + 8001028: 607b str r3, [r7, #4] + 800102a: 687b ldr r3, [r7, #4] + + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + 800102c: 2302 movs r3, #2 + 800102e: 623b str r3, [r7, #32] + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + 8001030: 2301 movs r3, #1 + 8001032: 62fb str r3, [r7, #44] @ 0x2c + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + 8001034: 2310 movs r3, #16 + 8001036: 633b str r3, [r7, #48] @ 0x30 + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + 8001038: 2302 movs r3, #2 + 800103a: 63bb str r3, [r7, #56] @ 0x38 + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + 800103c: 2300 movs r3, #0 + 800103e: 63fb str r3, [r7, #60] @ 0x3c + RCC_OscInitStruct.PLL.PLLM = 8; + 8001040: 2308 movs r3, #8 + 8001042: 643b str r3, [r7, #64] @ 0x40 + RCC_OscInitStruct.PLL.PLLN = 100; + 8001044: 2364 movs r3, #100 @ 0x64 + 8001046: 647b str r3, [r7, #68] @ 0x44 + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + 8001048: 2302 movs r3, #2 + 800104a: 64bb str r3, [r7, #72] @ 0x48 + RCC_OscInitStruct.PLL.PLLQ = 4; + 800104c: 2304 movs r3, #4 + 800104e: 64fb str r3, [r7, #76] @ 0x4c + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + 8001050: f107 0320 add.w r3, r7, #32 + 8001054: 4618 mov r0, r3 + 8001056: f002 fb4d bl 80036f4 + 800105a: 4603 mov r3, r0 + 800105c: 2b00 cmp r3, #0 + 800105e: d001 beq.n 8001064 + { + Error_Handler(); + 8001060: f000 fbcb bl 80017fa + } + + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + 8001064: 230f movs r3, #15 + 8001066: 60fb str r3, [r7, #12] + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + 8001068: 2302 movs r3, #2 + 800106a: 613b str r3, [r7, #16] + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + 800106c: 2300 movs r3, #0 + 800106e: 617b str r3, [r7, #20] + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + 8001070: f44f 53a0 mov.w r3, #5120 @ 0x1400 + 8001074: 61bb str r3, [r7, #24] + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + 8001076: f44f 5380 mov.w r3, #4096 @ 0x1000 + 800107a: 61fb str r3, [r7, #28] + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) + 800107c: f107 030c add.w r3, r7, #12 + 8001080: 2103 movs r1, #3 + 8001082: 4618 mov r0, r3 + 8001084: f002 fdae bl 8003be4 + 8001088: 4603 mov r3, r0 + 800108a: 2b00 cmp r3, #0 + 800108c: d001 beq.n 8001092 + { + Error_Handler(); + 800108e: f000 fbb4 bl 80017fa + } +} + 8001092: bf00 nop + 8001094: 3750 adds r7, #80 @ 0x50 + 8001096: 46bd mov sp, r7 + 8001098: bd80 pop {r7, pc} + 800109a: bf00 nop + 800109c: 40023800 .word 0x40023800 + 80010a0: 40007000 .word 0x40007000 + +080010a4 : + * @brief TIM3 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM3_Init(void) +{ + 80010a4: b580 push {r7, lr} + 80010a6: b086 sub sp, #24 + 80010a8: af00 add r7, sp, #0 + + /* USER CODE BEGIN TIM3_Init 0 */ + + /* USER CODE END TIM3_Init 0 */ + + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + 80010aa: f107 0308 add.w r3, r7, #8 + 80010ae: 2200 movs r2, #0 + 80010b0: 601a str r2, [r3, #0] + 80010b2: 605a str r2, [r3, #4] + 80010b4: 609a str r2, [r3, #8] + 80010b6: 60da str r2, [r3, #12] + TIM_MasterConfigTypeDef sMasterConfig = {0}; + 80010b8: 463b mov r3, r7 + 80010ba: 2200 movs r2, #0 + 80010bc: 601a str r2, [r3, #0] + 80010be: 605a str r2, [r3, #4] + + /* USER CODE BEGIN TIM3_Init 1 */ + + /* USER CODE END TIM3_Init 1 */ + htim3.Instance = TIM3; + 80010c0: 4b1d ldr r3, [pc, #116] @ (8001138 ) + 80010c2: 4a1e ldr r2, [pc, #120] @ (800113c ) + 80010c4: 601a str r2, [r3, #0] + htim3.Init.Prescaler = 22; + 80010c6: 4b1c ldr r3, [pc, #112] @ (8001138 ) + 80010c8: 2216 movs r2, #22 + 80010ca: 605a str r2, [r3, #4] + htim3.Init.CounterMode = TIM_COUNTERMODE_UP; + 80010cc: 4b1a ldr r3, [pc, #104] @ (8001138 ) + 80010ce: 2200 movs r2, #0 + 80010d0: 609a str r2, [r3, #8] + htim3.Init.Period = 2170; + 80010d2: 4b19 ldr r3, [pc, #100] @ (8001138 ) + 80010d4: f640 027a movw r2, #2170 @ 0x87a + 80010d8: 60da str r2, [r3, #12] + htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + 80010da: 4b17 ldr r3, [pc, #92] @ (8001138 ) + 80010dc: 2200 movs r2, #0 + 80010de: 611a str r2, [r3, #16] + htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + 80010e0: 4b15 ldr r3, [pc, #84] @ (8001138 ) + 80010e2: 2200 movs r2, #0 + 80010e4: 619a str r2, [r3, #24] + if (HAL_TIM_Base_Init(&htim3) != HAL_OK) + 80010e6: 4814 ldr r0, [pc, #80] @ (8001138 ) + 80010e8: f002 ff7c bl 8003fe4 + 80010ec: 4603 mov r3, r0 + 80010ee: 2b00 cmp r3, #0 + 80010f0: d001 beq.n 80010f6 + { + Error_Handler(); + 80010f2: f000 fb82 bl 80017fa + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + 80010f6: f44f 5380 mov.w r3, #4096 @ 0x1000 + 80010fa: 60bb str r3, [r7, #8] + if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK) + 80010fc: f107 0308 add.w r3, r7, #8 + 8001100: 4619 mov r1, r3 + 8001102: 480d ldr r0, [pc, #52] @ (8001138 ) + 8001104: f003 f936 bl 8004374 + 8001108: 4603 mov r3, r0 + 800110a: 2b00 cmp r3, #0 + 800110c: d001 beq.n 8001112 + { + Error_Handler(); + 800110e: f000 fb74 bl 80017fa + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + 8001112: 2300 movs r3, #0 + 8001114: 603b str r3, [r7, #0] + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + 8001116: 2300 movs r3, #0 + 8001118: 607b str r3, [r7, #4] + if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK) + 800111a: 463b mov r3, r7 + 800111c: 4619 mov r1, r3 + 800111e: 4806 ldr r0, [pc, #24] @ (8001138 ) + 8001120: f003 fb5c bl 80047dc + 8001124: 4603 mov r3, r0 + 8001126: 2b00 cmp r3, #0 + 8001128: d001 beq.n 800112e + { + Error_Handler(); + 800112a: f000 fb66 bl 80017fa + } + /* USER CODE BEGIN TIM3_Init 2 */ + + /* USER CODE END TIM3_Init 2 */ + +} + 800112e: bf00 nop + 8001130: 3718 adds r7, #24 + 8001132: 46bd mov sp, r7 + 8001134: bd80 pop {r7, pc} + 8001136: bf00 nop + 8001138: 200006fc .word 0x200006fc + 800113c: 40000400 .word 0x40000400 + +08001140 : + +/* FMC initialization function */ +static void MX_FMC_Init(void) +{ + 8001140: b580 push {r7, lr} + 8001142: b088 sub sp, #32 + 8001144: af00 add r7, sp, #0 + + /* USER CODE BEGIN FMC_Init 0 */ + + /* USER CODE END FMC_Init 0 */ + + FMC_NORSRAM_TimingTypeDef Timing = {0}; + 8001146: 1d3b adds r3, r7, #4 + 8001148: 2200 movs r2, #0 + 800114a: 601a str r2, [r3, #0] + 800114c: 605a str r2, [r3, #4] + 800114e: 609a str r2, [r3, #8] + 8001150: 60da str r2, [r3, #12] + 8001152: 611a str r2, [r3, #16] + 8001154: 615a str r2, [r3, #20] + 8001156: 619a str r2, [r3, #24] + + /* USER CODE END FMC_Init 1 */ + + /** Perform the SRAM1 memory initialization sequence + */ + hsram1.Instance = FMC_NORSRAM_DEVICE; + 8001158: 4b28 ldr r3, [pc, #160] @ (80011fc ) + 800115a: f04f 4220 mov.w r2, #2684354560 @ 0xa0000000 + 800115e: 601a str r2, [r3, #0] + hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE; + 8001160: 4b26 ldr r3, [pc, #152] @ (80011fc ) + 8001162: 4a27 ldr r2, [pc, #156] @ (8001200 ) + 8001164: 605a str r2, [r3, #4] + /* hsram1.Init */ + hsram1.Init.NSBank = FMC_NORSRAM_BANK1; + 8001166: 4b25 ldr r3, [pc, #148] @ (80011fc ) + 8001168: 2200 movs r2, #0 + 800116a: 609a str r2, [r3, #8] + hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE; + 800116c: 4b23 ldr r3, [pc, #140] @ (80011fc ) + 800116e: 2200 movs r2, #0 + 8001170: 60da str r2, [r3, #12] + hsram1.Init.MemoryType = FMC_MEMORY_TYPE_SRAM; + 8001172: 4b22 ldr r3, [pc, #136] @ (80011fc ) + 8001174: 2200 movs r2, #0 + 8001176: 611a str r2, [r3, #16] + hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16; + 8001178: 4b20 ldr r3, [pc, #128] @ (80011fc ) + 800117a: 2210 movs r2, #16 + 800117c: 615a str r2, [r3, #20] + hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE; + 800117e: 4b1f ldr r3, [pc, #124] @ (80011fc ) + 8001180: 2200 movs r2, #0 + 8001182: 619a str r2, [r3, #24] + hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW; + 8001184: 4b1d ldr r3, [pc, #116] @ (80011fc ) + 8001186: 2200 movs r2, #0 + 8001188: 61da str r2, [r3, #28] + hsram1.Init.WrapMode = FMC_WRAP_MODE_DISABLE; + 800118a: 4b1c ldr r3, [pc, #112] @ (80011fc ) + 800118c: 2200 movs r2, #0 + 800118e: 621a str r2, [r3, #32] + hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS; + 8001190: 4b1a ldr r3, [pc, #104] @ (80011fc ) + 8001192: 2200 movs r2, #0 + 8001194: 625a str r2, [r3, #36] @ 0x24 + hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE; + 8001196: 4b19 ldr r3, [pc, #100] @ (80011fc ) + 8001198: f44f 5280 mov.w r2, #4096 @ 0x1000 + 800119c: 629a str r2, [r3, #40] @ 0x28 + hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE; + 800119e: 4b17 ldr r3, [pc, #92] @ (80011fc ) + 80011a0: 2200 movs r2, #0 + 80011a2: 62da str r2, [r3, #44] @ 0x2c + hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE; + 80011a4: 4b15 ldr r3, [pc, #84] @ (80011fc ) + 80011a6: 2200 movs r2, #0 + 80011a8: 631a str r2, [r3, #48] @ 0x30 + hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE; + 80011aa: 4b14 ldr r3, [pc, #80] @ (80011fc ) + 80011ac: 2200 movs r2, #0 + 80011ae: 635a str r2, [r3, #52] @ 0x34 + hsram1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE; + 80011b0: 4b12 ldr r3, [pc, #72] @ (80011fc ) + 80011b2: 2200 movs r2, #0 + 80011b4: 639a str r2, [r3, #56] @ 0x38 + hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY; + 80011b6: 4b11 ldr r3, [pc, #68] @ (80011fc ) + 80011b8: 2200 movs r2, #0 + 80011ba: 63da str r2, [r3, #60] @ 0x3c + hsram1.Init.PageSize = FMC_PAGE_SIZE_NONE; + 80011bc: 4b0f ldr r3, [pc, #60] @ (80011fc ) + 80011be: 2200 movs r2, #0 + 80011c0: 645a str r2, [r3, #68] @ 0x44 + /* Timing */ + Timing.AddressSetupTime = 15; + 80011c2: 230f movs r3, #15 + 80011c4: 607b str r3, [r7, #4] + Timing.AddressHoldTime = 15; + 80011c6: 230f movs r3, #15 + 80011c8: 60bb str r3, [r7, #8] + Timing.DataSetupTime = 255; + 80011ca: 23ff movs r3, #255 @ 0xff + 80011cc: 60fb str r3, [r7, #12] + Timing.BusTurnAroundDuration = 15; + 80011ce: 230f movs r3, #15 + 80011d0: 613b str r3, [r7, #16] + Timing.CLKDivision = 16; + 80011d2: 2310 movs r3, #16 + 80011d4: 617b str r3, [r7, #20] + Timing.DataLatency = 17; + 80011d6: 2311 movs r3, #17 + 80011d8: 61bb str r3, [r7, #24] + Timing.AccessMode = FMC_ACCESS_MODE_A; + 80011da: 2300 movs r3, #0 + 80011dc: 61fb str r3, [r7, #28] + /* ExtTiming */ + + if (HAL_SRAM_Init(&hsram1, &Timing, NULL) != HAL_OK) + 80011de: 1d3b adds r3, r7, #4 + 80011e0: 2200 movs r2, #0 + 80011e2: 4619 mov r1, r3 + 80011e4: 4805 ldr r0, [pc, #20] @ (80011fc ) + 80011e6: f002 feb5 bl 8003f54 + 80011ea: 4603 mov r3, r0 + 80011ec: 2b00 cmp r3, #0 + 80011ee: d001 beq.n 80011f4 + { + Error_Handler( ); + 80011f0: f000 fb03 bl 80017fa + } + + /* USER CODE BEGIN FMC_Init 2 */ + + /* USER CODE END FMC_Init 2 */ +} + 80011f4: bf00 nop + 80011f6: 3720 adds r7, #32 + 80011f8: 46bd mov sp, r7 + 80011fa: bd80 pop {r7, pc} + 80011fc: 20000744 .word 0x20000744 + 8001200: a0000104 .word 0xa0000104 + +08001204 : + * @brief GPIO Initialization Function + * @param None + * @retval None + */ +static void MX_GPIO_Init(void) +{ + 8001204: b580 push {r7, lr} + 8001206: b08c sub sp, #48 @ 0x30 + 8001208: af00 add r7, sp, #0 + GPIO_InitTypeDef GPIO_InitStruct = {0}; + 800120a: f107 031c add.w r3, r7, #28 + 800120e: 2200 movs r2, #0 + 8001210: 601a str r2, [r3, #0] + 8001212: 605a str r2, [r3, #4] + 8001214: 609a str r2, [r3, #8] + 8001216: 60da str r2, [r3, #12] + 8001218: 611a str r2, [r3, #16] + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOE_CLK_ENABLE(); + 800121a: 2300 movs r3, #0 + 800121c: 61bb str r3, [r7, #24] + 800121e: 4b43 ldr r3, [pc, #268] @ (800132c ) + 8001220: 6b1b ldr r3, [r3, #48] @ 0x30 + 8001222: 4a42 ldr r2, [pc, #264] @ (800132c ) + 8001224: f043 0310 orr.w r3, r3, #16 + 8001228: 6313 str r3, [r2, #48] @ 0x30 + 800122a: 4b40 ldr r3, [pc, #256] @ (800132c ) + 800122c: 6b1b ldr r3, [r3, #48] @ 0x30 + 800122e: f003 0310 and.w r3, r3, #16 + 8001232: 61bb str r3, [r7, #24] + 8001234: 69bb ldr r3, [r7, #24] + __HAL_RCC_GPIOC_CLK_ENABLE(); + 8001236: 2300 movs r3, #0 + 8001238: 617b str r3, [r7, #20] + 800123a: 4b3c ldr r3, [pc, #240] @ (800132c ) + 800123c: 6b1b ldr r3, [r3, #48] @ 0x30 + 800123e: 4a3b ldr r2, [pc, #236] @ (800132c ) + 8001240: f043 0304 orr.w r3, r3, #4 + 8001244: 6313 str r3, [r2, #48] @ 0x30 + 8001246: 4b39 ldr r3, [pc, #228] @ (800132c ) + 8001248: 6b1b ldr r3, [r3, #48] @ 0x30 + 800124a: f003 0304 and.w r3, r3, #4 + 800124e: 617b str r3, [r7, #20] + 8001250: 697b ldr r3, [r7, #20] + __HAL_RCC_GPIOF_CLK_ENABLE(); + 8001252: 2300 movs r3, #0 + 8001254: 613b str r3, [r7, #16] + 8001256: 4b35 ldr r3, [pc, #212] @ (800132c ) + 8001258: 6b1b ldr r3, [r3, #48] @ 0x30 + 800125a: 4a34 ldr r2, [pc, #208] @ (800132c ) + 800125c: f043 0320 orr.w r3, r3, #32 + 8001260: 6313 str r3, [r2, #48] @ 0x30 + 8001262: 4b32 ldr r3, [pc, #200] @ (800132c ) + 8001264: 6b1b ldr r3, [r3, #48] @ 0x30 + 8001266: f003 0320 and.w r3, r3, #32 + 800126a: 613b str r3, [r7, #16] + 800126c: 693b ldr r3, [r7, #16] + __HAL_RCC_GPIOA_CLK_ENABLE(); + 800126e: 2300 movs r3, #0 + 8001270: 60fb str r3, [r7, #12] + 8001272: 4b2e ldr r3, [pc, #184] @ (800132c ) + 8001274: 6b1b ldr r3, [r3, #48] @ 0x30 + 8001276: 4a2d ldr r2, [pc, #180] @ (800132c ) + 8001278: f043 0301 orr.w r3, r3, #1 + 800127c: 6313 str r3, [r2, #48] @ 0x30 + 800127e: 4b2b ldr r3, [pc, #172] @ (800132c ) + 8001280: 6b1b ldr r3, [r3, #48] @ 0x30 + 8001282: f003 0301 and.w r3, r3, #1 + 8001286: 60fb str r3, [r7, #12] + 8001288: 68fb ldr r3, [r7, #12] + __HAL_RCC_GPIOG_CLK_ENABLE(); + 800128a: 2300 movs r3, #0 + 800128c: 60bb str r3, [r7, #8] + 800128e: 4b27 ldr r3, [pc, #156] @ (800132c ) + 8001290: 6b1b ldr r3, [r3, #48] @ 0x30 + 8001292: 4a26 ldr r2, [pc, #152] @ (800132c ) + 8001294: f043 0340 orr.w r3, r3, #64 @ 0x40 + 8001298: 6313 str r3, [r2, #48] @ 0x30 + 800129a: 4b24 ldr r3, [pc, #144] @ (800132c ) + 800129c: 6b1b ldr r3, [r3, #48] @ 0x30 + 800129e: f003 0340 and.w r3, r3, #64 @ 0x40 + 80012a2: 60bb str r3, [r7, #8] + 80012a4: 68bb ldr r3, [r7, #8] + __HAL_RCC_GPIOB_CLK_ENABLE(); + 80012a6: 2300 movs r3, #0 + 80012a8: 607b str r3, [r7, #4] + 80012aa: 4b20 ldr r3, [pc, #128] @ (800132c ) + 80012ac: 6b1b ldr r3, [r3, #48] @ 0x30 + 80012ae: 4a1f ldr r2, [pc, #124] @ (800132c ) + 80012b0: f043 0302 orr.w r3, r3, #2 + 80012b4: 6313 str r3, [r2, #48] @ 0x30 + 80012b6: 4b1d ldr r3, [pc, #116] @ (800132c ) + 80012b8: 6b1b ldr r3, [r3, #48] @ 0x30 + 80012ba: f003 0302 and.w r3, r3, #2 + 80012be: 607b str r3, [r7, #4] + 80012c0: 687b ldr r3, [r7, #4] + __HAL_RCC_GPIOD_CLK_ENABLE(); + 80012c2: 2300 movs r3, #0 + 80012c4: 603b str r3, [r7, #0] + 80012c6: 4b19 ldr r3, [pc, #100] @ (800132c ) + 80012c8: 6b1b ldr r3, [r3, #48] @ 0x30 + 80012ca: 4a18 ldr r2, [pc, #96] @ (800132c ) + 80012cc: f043 0308 orr.w r3, r3, #8 + 80012d0: 6313 str r3, [r2, #48] @ 0x30 + 80012d2: 4b16 ldr r3, [pc, #88] @ (800132c ) + 80012d4: 6b1b ldr r3, [r3, #48] @ 0x30 + 80012d6: f003 0308 and.w r3, r3, #8 + 80012da: 603b str r3, [r7, #0] + 80012dc: 683b ldr r3, [r7, #0] + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_RESET); + 80012de: 2200 movs r2, #0 + 80012e0: f44f 4180 mov.w r1, #16384 @ 0x4000 + 80012e4: 4812 ldr r0, [pc, #72] @ (8001330 ) + 80012e6: f002 f9eb bl 80036c0 + + /*Configure GPIO pins : PC13 PC6 PC7 PC8 + PC12 */ + GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8 + 80012ea: f44f 5347 mov.w r3, #12736 @ 0x31c0 + 80012ee: 61fb str r3, [r7, #28] + |GPIO_PIN_12; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + 80012f0: 2300 movs r3, #0 + 80012f2: 623b str r3, [r7, #32] + GPIO_InitStruct.Pull = GPIO_NOPULL; + 80012f4: 2300 movs r3, #0 + 80012f6: 627b str r3, [r7, #36] @ 0x24 + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + 80012f8: f107 031c add.w r3, r7, #28 + 80012fc: 4619 mov r1, r3 + 80012fe: 480c ldr r0, [pc, #48] @ (8001330 ) + 8001300: f002 f832 bl 8003368 + + /*Configure GPIO pin : PC14 */ + GPIO_InitStruct.Pin = GPIO_PIN_14; + 8001304: f44f 4380 mov.w r3, #16384 @ 0x4000 + 8001308: 61fb str r3, [r7, #28] + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + 800130a: 2301 movs r3, #1 + 800130c: 623b str r3, [r7, #32] + GPIO_InitStruct.Pull = GPIO_NOPULL; + 800130e: 2300 movs r3, #0 + 8001310: 627b str r3, [r7, #36] @ 0x24 + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + 8001312: 2300 movs r3, #0 + 8001314: 62bb str r3, [r7, #40] @ 0x28 + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + 8001316: f107 031c add.w r3, r7, #28 + 800131a: 4619 mov r1, r3 + 800131c: 4804 ldr r0, [pc, #16] @ (8001330 ) + 800131e: f002 f823 bl 8003368 + +} + 8001322: bf00 nop + 8001324: 3730 adds r7, #48 @ 0x30 + 8001326: 46bd mov sp, r7 + 8001328: bd80 pop {r7, pc} + 800132a: bf00 nop + 800132c: 40023800 .word 0x40023800 + 8001330: 40020800 .word 0x40020800 + +08001334 : + +/* USER CODE BEGIN 4 */ + +uint16_t create_header(void) +{ + 8001334: b580 push {r7, lr} + 8001336: af00 add r7, sp, #0 + tx_msg.tx_buf[0] = 0; + 8001338: 4b10 ldr r3, [pc, #64] @ (800137c ) + 800133a: 2200 movs r2, #0 + 800133c: 701a strb r2, [r3, #0] + tx_msg.tx_buf[1] = 0; + 800133e: 4b0f ldr r3, [pc, #60] @ (800137c ) + 8001340: 2200 movs r2, #0 + 8001342: 705a strb r2, [r3, #1] + tx_msg.tx_buf[2] = rx_msg.rx_buf[2]; + 8001344: 4b0e ldr r3, [pc, #56] @ (8001380 ) + 8001346: 7a5a ldrb r2, [r3, #9] + 8001348: 4b0c ldr r3, [pc, #48] @ (800137c ) + 800134a: 709a strb r2, [r3, #2] + tx_msg.tx_buf[3] = rx_msg.rx_buf[3]; + 800134c: 4b0c ldr r3, [pc, #48] @ (8001380 ) + 800134e: 7a9a ldrb r2, [r3, #10] + 8001350: 4b0a ldr r3, [pc, #40] @ (800137c ) + 8001352: 70da strb r2, [r3, #3] + tx_msg.tx_buf[5] = 0; + 8001354: 4b09 ldr r3, [pc, #36] @ (800137c ) + 8001356: 2200 movs r2, #0 + 8001358: 715a strb r2, [r3, #5] + tx_msg.tx_buf[6] = 0; + 800135a: 4b08 ldr r3, [pc, #32] @ (800137c ) + 800135c: 2200 movs r2, #0 + 800135e: 719a strb r2, [r3, #6] + tx_msg.status_len = set_status(tx_msg.tx_buf) + 6; + 8001360: 4806 ldr r0, [pc, #24] @ (800137c ) + 8001362: f000 fa97 bl 8001894 + 8001366: 4603 mov r3, r0 + 8001368: 3306 adds r3, #6 + 800136a: b29a uxth r2, r3 + 800136c: 4b03 ldr r3, [pc, #12] @ (800137c ) + 800136e: f8a3 2578 strh.w r2, [r3, #1400] @ 0x578 + return tx_msg.status_len; + 8001372: 4b02 ldr r3, [pc, #8] @ (800137c ) + 8001374: f8b3 3578 ldrh.w r3, [r3, #1400] @ 0x578 +} + 8001378: 4618 mov r0, r3 + 800137a: bd80 pop {r7, pc} + 800137c: 20000fa8 .word 0x20000fa8 + 8001380: 2000079c .word 0x2000079c + +08001384 : + +void set_pbuf_params(struct pbuf *p, u16_t length) +{ + 8001384: b580 push {r7, lr} + 8001386: b082 sub sp, #8 + 8001388: af00 add r7, sp, #0 + 800138a: 6078 str r0, [r7, #4] + 800138c: 460b mov r3, r1 + 800138e: 807b strh r3, [r7, #2] + p->len = length; + 8001390: 687b ldr r3, [r7, #4] + 8001392: 887a ldrh r2, [r7, #2] + 8001394: 815a strh r2, [r3, #10] + p->tot_len = p->len; + 8001396: 687b ldr r3, [r7, #4] + 8001398: 895a ldrh r2, [r3, #10] + 800139a: 687b ldr r3, [r7, #4] + 800139c: 811a strh r2, [r3, #8] + memcpy(p->payload, tx_msg.tx_buf, p->tot_len); + 800139e: 687b ldr r3, [r7, #4] + 80013a0: 6858 ldr r0, [r3, #4] + 80013a2: 687b ldr r3, [r7, #4] + 80013a4: 891b ldrh r3, [r3, #8] + 80013a6: 461a mov r2, r3 + 80013a8: 4903 ldr r1, [pc, #12] @ (80013b8 ) + 80013aa: f010 fa21 bl 80117f0 +} + 80013ae: bf00 nop + 80013b0: 3708 adds r7, #8 + 80013b2: 46bd mov sp, r7 + 80013b4: bd80 pop {r7, pc} + 80013b6: bf00 nop + 80013b8: 20000fa8 .word 0x20000fa8 + +080013bc : + +void sock_init(struct udp_pcb * pcb) +{ + 80013bc: b580 push {r7, lr} + 80013be: b084 sub sp, #16 + 80013c0: af00 add r7, sp, #0 + 80013c2: 6078 str r0, [r7, #4] + uint32_t ipaddr = get_ip(); + 80013c4: f000 fa20 bl 8001808 + 80013c8: 4603 mov r3, r0 + 80013ca: 60bb str r3, [r7, #8] + u16_t port = get_port(); + 80013cc: f000 fa42 bl 8001854 + 80013d0: 4603 mov r3, r0 + 80013d2: 81fb strh r3, [r7, #14] + err_t errok = udp_bind(pcb, (ip_addr_t*)&ipaddr, port); + 80013d4: 89fa ldrh r2, [r7, #14] + 80013d6: f107 0308 add.w r3, r7, #8 + 80013da: 4619 mov r1, r3 + 80013dc: 6878 ldr r0, [r7, #4] + 80013de: f00b fbdb bl 800cb98 + 80013e2: 4603 mov r3, r0 + 80013e4: 737b strb r3, [r7, #13] + udp_recv(pcb, udp_echo_recv, NULL); + 80013e6: 2200 movs r2, #0 + 80013e8: 4912 ldr r1, [pc, #72] @ (8001434 ) + 80013ea: 6878 ldr r0, [r7, #4] + 80013ec: f00b fcca bl 800cd84 + rx_msg.port = 0; + 80013f0: 4b11 ldr r3, [pc, #68] @ (8001438 ) + 80013f2: 2200 movs r2, #0 + 80013f4: 801a strh r2, [r3, #0] + rx_msg.cmd_num = 0; + 80013f6: 4b10 ldr r3, [pc, #64] @ (8001438 ) + 80013f8: 2200 movs r2, #0 + 80013fa: 805a strh r2, [r3, #2] + rx_msg.cmd_code = 0; + 80013fc: 4b0e ldr r3, [pc, #56] @ (8001438 ) + 80013fe: 2200 movs r2, #0 + 8001400: 809a strh r2, [r3, #4] + rx_msg.clnt_con = 0; + 8001402: 4b0d ldr r3, [pc, #52] @ (8001438 ) + 8001404: 2200 movs r2, #0 + 8001406: 719a strb r2, [r3, #6] + rx_msg.length = 0; + 8001408: 4b0b ldr r3, [pc, #44] @ (8001438 ) + 800140a: 2200 movs r2, #0 + 800140c: f8a3 2808 strh.w r2, [r3, #2056] @ 0x808 + tx_msg.status_len = 0; + 8001410: 4b0a ldr r3, [pc, #40] @ (800143c ) + 8001412: 2200 movs r2, #0 + 8001414: f8a3 2578 strh.w r2, [r3, #1400] @ 0x578 + tx_msg.cmd_len = 0; + 8001418: 4b08 ldr r3, [pc, #32] @ (800143c ) + 800141a: 2200 movs r2, #0 + 800141c: f8a3 257c strh.w r2, [r3, #1404] @ 0x57c + memset(rx_msg.rx_buf, 0, sizeof rx_msg.rx_buf); + 8001420: f44f 6200 mov.w r2, #2048 @ 0x800 + 8001424: 2100 movs r1, #0 + 8001426: 4806 ldr r0, [pc, #24] @ (8001440 ) + 8001428: f010 f965 bl 80116f6 + return; + 800142c: bf00 nop +} + 800142e: 3710 adds r7, #16 + 8001430: 46bd mov sp, r7 + 8001432: bd80 pop {r7, pc} + 8001434: 08001445 .word 0x08001445 + 8001438: 2000079c .word 0x2000079c + 800143c: 20000fa8 .word 0x20000fa8 + 8001440: 200007a3 .word 0x200007a3 + +08001444 : + +void udp_echo_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *addr, u16_t port) +{ + 8001444: b580 push {r7, lr} + 8001446: b086 sub sp, #24 + 8001448: af00 add r7, sp, #0 + 800144a: 60f8 str r0, [r7, #12] + 800144c: 60b9 str r1, [r7, #8] + 800144e: 607a str r2, [r7, #4] + 8001450: 603b str r3, [r7, #0] + if (p != NULL) { + 8001452: 687b ldr r3, [r7, #4] + 8001454: 2b00 cmp r3, #0 + 8001456: d04f beq.n 80014f8 + if (p->tot_len < sizeof rx_msg.rx_buf) + 8001458: 687b ldr r3, [r7, #4] + 800145a: 891b ldrh r3, [r3, #8] + 800145c: f5b3 6f00 cmp.w r3, #2048 @ 0x800 + 8001460: d243 bcs.n 80014ea + { + if (p->tot_len < 6) + 8001462: 687b ldr r3, [r7, #4] + 8001464: 891b ldrh r3, [r3, #8] + 8001466: 2b05 cmp r3, #5 + 8001468: d943 bls.n 80014f2 + { + return; + } + memcpy(rx_msg.rx_buf, p->payload, p->tot_len); + 800146a: 687b ldr r3, [r7, #4] + 800146c: 6859 ldr r1, [r3, #4] + 800146e: 687b ldr r3, [r7, #4] + 8001470: 891b ldrh r3, [r3, #8] + 8001472: 461a mov r2, r3 + 8001474: 4822 ldr r0, [pc, #136] @ (8001500 ) + 8001476: f010 f9bb bl 80117f0 + if (rx_msg.clnt_con == 1) + 800147a: 4b22 ldr r3, [pc, #136] @ (8001504 ) + 800147c: 799b ldrb r3, [r3, #6] + 800147e: 2b00 cmp r3, #0 + 8001480: d01d beq.n 80014be + { + if ((memcmp(&rx_addr, addr, sizeof rx_addr)!= 0) || (rx_msg.port != port)) + 8001482: 2204 movs r2, #4 + 8001484: 6839 ldr r1, [r7, #0] + 8001486: 4820 ldr r0, [pc, #128] @ (8001508 ) + 8001488: f010 f90b bl 80116a2 + 800148c: 4603 mov r3, r0 + 800148e: 2b00 cmp r3, #0 + 8001490: d131 bne.n 80014f6 + 8001492: 4b1c ldr r3, [pc, #112] @ (8001504 ) + 8001494: 881b ldrh r3, [r3, #0] + 8001496: 8c3a ldrh r2, [r7, #32] + 8001498: 429a cmp r2, r3 + 800149a: d12c bne.n 80014f6 + { + return; + } + uint16_t cmd_num = rx_msg.rx_buf[2] | (rx_msg.rx_buf[3] << 8); + 800149c: 4b19 ldr r3, [pc, #100] @ (8001504 ) + 800149e: 7a5b ldrb r3, [r3, #9] + 80014a0: b21a sxth r2, r3 + 80014a2: 4b18 ldr r3, [pc, #96] @ (8001504 ) + 80014a4: 7a9b ldrb r3, [r3, #10] + 80014a6: 021b lsls r3, r3, #8 + 80014a8: b21b sxth r3, r3 + 80014aa: 4313 orrs r3, r2 + 80014ac: b21b sxth r3, r3 + 80014ae: 82fb strh r3, [r7, #22] + if (cmd_num != (rx_msg.cmd_num + 1)) + 80014b0: 8afa ldrh r2, [r7, #22] + 80014b2: 4b14 ldr r3, [pc, #80] @ (8001504 ) + 80014b4: 885b ldrh r3, [r3, #2] + 80014b6: 3301 adds r3, #1 + 80014b8: 429a cmp r2, r3 + 80014ba: d008 beq.n 80014ce + { + return; + 80014bc: e01c b.n 80014f8 + } + } + else + { + memcpy(&rx_addr, addr, sizeof rx_addr); + 80014be: 683b ldr r3, [r7, #0] + 80014c0: 681b ldr r3, [r3, #0] + 80014c2: 461a mov r2, r3 + 80014c4: 4b10 ldr r3, [pc, #64] @ (8001508 ) + 80014c6: 601a str r2, [r3, #0] + rx_msg.port = port; + 80014c8: 4a0e ldr r2, [pc, #56] @ (8001504 ) + 80014ca: 8c3b ldrh r3, [r7, #32] + 80014cc: 8013 strh r3, [r2, #0] + } + rx_msg.con_timeout = 0; + 80014ce: 4b0d ldr r3, [pc, #52] @ (8001504 ) + 80014d0: 2200 movs r2, #0 + 80014d2: f8a3 280a strh.w r2, [r3, #2058] @ 0x80a + rx_msg.clnt_con = 1; + 80014d6: 4b0b ldr r3, [pc, #44] @ (8001504 ) + 80014d8: 2201 movs r2, #1 + 80014da: 719a strb r2, [r3, #6] + rx_msg.length = p->tot_len; + 80014dc: 687b ldr r3, [r7, #4] + 80014de: 891a ldrh r2, [r3, #8] + 80014e0: 4b08 ldr r3, [pc, #32] @ (8001504 ) + 80014e2: f8a3 2808 strh.w r2, [r3, #2056] @ 0x808 + rcv_command(); + 80014e6: f000 f811 bl 800150c + } + /* free the pbuf */ + pbuf_free(p); + 80014ea: 6878 ldr r0, [r7, #4] + 80014ec: f005 fa9c bl 8006a28 + 80014f0: e002 b.n 80014f8 + return; + 80014f2: bf00 nop + 80014f4: e000 b.n 80014f8 + return; + 80014f6: bf00 nop + } +} + 80014f8: 3718 adds r7, #24 + 80014fa: 46bd mov sp, r7 + 80014fc: bd80 pop {r7, pc} + 80014fe: bf00 nop + 8001500: 200007a3 .word 0x200007a3 + 8001504: 2000079c .word 0x2000079c + 8001508: 20000798 .word 0x20000798 + +0800150c : + +void rcv_command(void) +{ + 800150c: b580 push {r7, lr} + 800150e: b084 sub sp, #16 + 8001510: af00 add r7, sp, #0 + uint16_t ports_amount = 0; + 8001512: 2300 movs r3, #0 + 8001514: 81bb strh r3, [r7, #12] + uint16_t i = 0; + 8001516: 2300 movs r3, #0 + 8001518: 81fb strh r3, [r7, #14] + rx_msg.cmd_num = rx_msg.rx_buf[2] | (rx_msg.rx_buf[3] << 8); + 800151a: 4ba1 ldr r3, [pc, #644] @ (80017a0 ) + 800151c: 7a5b ldrb r3, [r3, #9] + 800151e: b21a sxth r2, r3 + 8001520: 4b9f ldr r3, [pc, #636] @ (80017a0 ) + 8001522: 7a9b ldrb r3, [r3, #10] + 8001524: 021b lsls r3, r3, #8 + 8001526: b21b sxth r3, r3 + 8001528: 4313 orrs r3, r2 + 800152a: b21b sxth r3, r3 + 800152c: b29a uxth r2, r3 + 800152e: 4b9c ldr r3, [pc, #624] @ (80017a0 ) + 8001530: 805a strh r2, [r3, #2] + rx_msg.cmd_code = rx_msg.rx_buf[6]; + 8001532: 4b9b ldr r3, [pc, #620] @ (80017a0 ) + 8001534: 7b5b ldrb r3, [r3, #13] + 8001536: 461a mov r2, r3 + 8001538: 4b99 ldr r3, [pc, #612] @ (80017a0 ) + 800153a: 809a strh r2, [r3, #4] + tx_msg.status_len = create_header(); + 800153c: f7ff fefa bl 8001334 + 8001540: 4603 mov r3, r0 + 8001542: 461a mov r2, r3 + 8001544: 4b97 ldr r3, [pc, #604] @ (80017a4 ) + 8001546: f8a3 2578 strh.w r2, [r3, #1400] @ 0x578 + + unsigned char *cmd_buf = &tx_msg.tx_buf[tx_msg.status_len]; + 800154a: 4b96 ldr r3, [pc, #600] @ (80017a4 ) + 800154c: f8b3 3578 ldrh.w r3, [r3, #1400] @ 0x578 + 8001550: 461a mov r2, r3 + 8001552: 4b94 ldr r3, [pc, #592] @ (80017a4 ) + 8001554: 4413 add r3, r2 + 8001556: 60bb str r3, [r7, #8] + switch(rx_msg.cmd_code) // код команды + 8001558: 4b91 ldr r3, [pc, #580] @ (80017a0 ) + 800155a: 889b ldrh r3, [r3, #4] + 800155c: 2b00 cmp r3, #0 + 800155e: d003 beq.n 8001568 + 8001560: 2b01 cmp r3, #1 + 8001562: f000 8082 beq.w 800166a + 8001566: e113 b.n 8001790 + //----------------------------------------------------------- + // КОМАНДА №0 + // ЧТЕНИЕ МАССИВА ПОРТОВ + //----------------------------------------------------------- + + cmd_buf[0] = rx_msg.cmd_code; // - код команды + 8001568: 4b8d ldr r3, [pc, #564] @ (80017a0 ) + 800156a: 889b ldrh r3, [r3, #4] + 800156c: b2da uxtb r2, r3 + 800156e: 68bb ldr r3, [r7, #8] + 8001570: 701a strb r2, [r3, #0] + ports_amount = rx_msg.rx_buf[7]; + 8001572: 4b8b ldr r3, [pc, #556] @ (80017a0 ) + 8001574: 7b9b ldrb r3, [r3, #14] + 8001576: 81bb strh r3, [r7, #12] + + // Проверка размера принятого буфера + if( rx_msg.length < (8 + ports_amount * 2)) + 8001578: 4b89 ldr r3, [pc, #548] @ (80017a0 ) + 800157a: f8b3 3808 ldrh.w r3, [r3, #2056] @ 0x808 + 800157e: 461a mov r2, r3 + 8001580: 89bb ldrh r3, [r7, #12] + 8001582: 3304 adds r3, #4 + 8001584: 005b lsls r3, r3, #1 + 8001586: 429a cmp r2, r3 + 8001588: da08 bge.n 800159c + { + // Размер принятого пакета меньше чем долно быть + // Установить ошибку + // КОД = 2 + cmd_buf[1] = ERR_SIZE; + 800158a: 68bb ldr r3, [r7, #8] + 800158c: 3301 adds r3, #1 + 800158e: 2202 movs r2, #2 + 8001590: 701a strb r2, [r3, #0] + + // Установить размер буфера = 2 + tx_msg.cmd_len = 2; + 8001592: 4b84 ldr r3, [pc, #528] @ (80017a4 ) + 8001594: 2202 movs r2, #2 + 8001596: f8a3 257c strh.w r2, [r3, #1404] @ 0x57c + cmd_buf[6 + (i*4)] = port_data >> 8; + } + // Установить размер буфера + tx_msg.cmd_len = (ports_amount << 2) + 3; + } + break; + 800159a: e0f9 b.n 8001790 + cmd_buf[1] = NO_ERROR; + 800159c: 68bb ldr r3, [r7, #8] + 800159e: 3301 adds r3, #1 + 80015a0: 2201 movs r2, #1 + 80015a2: 701a strb r2, [r3, #0] + cmd_buf[2] = rx_msg.rx_buf[7]; + 80015a4: 68bb ldr r3, [r7, #8] + 80015a6: 3302 adds r3, #2 + 80015a8: 4a7d ldr r2, [pc, #500] @ (80017a0 ) + 80015aa: 7b92 ldrb r2, [r2, #14] + 80015ac: 701a strb r2, [r3, #0] + uint16_t port_data = 0xFFFF; + 80015ae: f64f 73ff movw r3, #65535 @ 0xffff + 80015b2: 807b strh r3, [r7, #2] + uint16_t port_addr = 0x0000; + 80015b4: 2300 movs r3, #0 + 80015b6: 803b strh r3, [r7, #0] + for (i = 0; i + port_addr = rx_msg.rx_buf[8 + i * 2] + (rx_msg.rx_buf[9 + i * 2] << 8); + 80015be: 89fb ldrh r3, [r7, #14] + 80015c0: 3304 adds r3, #4 + 80015c2: 005b lsls r3, r3, #1 + 80015c4: 4a76 ldr r2, [pc, #472] @ (80017a0 ) + 80015c6: 4413 add r3, r2 + 80015c8: 79db ldrb r3, [r3, #7] + 80015ca: 4619 mov r1, r3 + 80015cc: 89fb ldrh r3, [r7, #14] + 80015ce: 005b lsls r3, r3, #1 + 80015d0: 3309 adds r3, #9 + 80015d2: 4a73 ldr r2, [pc, #460] @ (80017a0 ) + 80015d4: 4413 add r3, r2 + 80015d6: 79db ldrb r3, [r3, #7] + 80015d8: 021b lsls r3, r3, #8 + 80015da: b29b uxth r3, r3 + 80015dc: 440b add r3, r1 + 80015de: 803b strh r3, [r7, #0] + cmd_buf[3 + (i*4)] = rx_msg.rx_buf[8 + i * 2]; + 80015e0: 89fb ldrh r3, [r7, #14] + 80015e2: 3304 adds r3, #4 + 80015e4: 005a lsls r2, r3, #1 + 80015e6: 89fb ldrh r3, [r7, #14] + 80015e8: 009b lsls r3, r3, #2 + 80015ea: 3303 adds r3, #3 + 80015ec: 4619 mov r1, r3 + 80015ee: 68bb ldr r3, [r7, #8] + 80015f0: 440b add r3, r1 + 80015f2: 496b ldr r1, [pc, #428] @ (80017a0 ) + 80015f4: 440a add r2, r1 + 80015f6: 79d2 ldrb r2, [r2, #7] + 80015f8: 701a strb r2, [r3, #0] + cmd_buf[4 + (i*4)] = rx_msg.rx_buf[9 + i * 2]; + 80015fa: 89fb ldrh r3, [r7, #14] + 80015fc: 005b lsls r3, r3, #1 + 80015fe: f103 0209 add.w r2, r3, #9 + 8001602: 89fb ldrh r3, [r7, #14] + 8001604: 3301 adds r3, #1 + 8001606: 009b lsls r3, r3, #2 + 8001608: 4619 mov r1, r3 + 800160a: 68bb ldr r3, [r7, #8] + 800160c: 440b add r3, r1 + 800160e: 4964 ldr r1, [pc, #400] @ (80017a0 ) + 8001610: 440a add r2, r1 + 8001612: 79d2 ldrb r2, [r2, #7] + 8001614: 701a strb r2, [r3, #0] + port_data = read_isa(port_addr); + 8001616: 883b ldrh r3, [r7, #0] + 8001618: 4618 mov r0, r3 + 800161a: f000 f8c7 bl 80017ac + 800161e: 4603 mov r3, r0 + 8001620: 807b strh r3, [r7, #2] + cmd_buf[5 + (i*4)] = port_data & 0xFF; + 8001622: 89fb ldrh r3, [r7, #14] + 8001624: 009b lsls r3, r3, #2 + 8001626: 3305 adds r3, #5 + 8001628: 461a mov r2, r3 + 800162a: 68bb ldr r3, [r7, #8] + 800162c: 4413 add r3, r2 + 800162e: 887a ldrh r2, [r7, #2] + 8001630: b2d2 uxtb r2, r2 + 8001632: 701a strb r2, [r3, #0] + cmd_buf[6 + (i*4)] = port_data >> 8; + 8001634: 887b ldrh r3, [r7, #2] + 8001636: 0a1b lsrs r3, r3, #8 + 8001638: b29a uxth r2, r3 + 800163a: 89fb ldrh r3, [r7, #14] + 800163c: 009b lsls r3, r3, #2 + 800163e: 3306 adds r3, #6 + 8001640: 4619 mov r1, r3 + 8001642: 68bb ldr r3, [r7, #8] + 8001644: 440b add r3, r1 + 8001646: b2d2 uxtb r2, r2 + 8001648: 701a strb r2, [r3, #0] + for (i = 0; i + tx_msg.cmd_len = (ports_amount << 2) + 3; + 8001658: 89bb ldrh r3, [r7, #12] + 800165a: 009b lsls r3, r3, #2 + 800165c: b29b uxth r3, r3 + 800165e: 3303 adds r3, #3 + 8001660: b29a uxth r2, r3 + 8001662: 4b50 ldr r3, [pc, #320] @ (80017a4 ) + 8001664: f8a3 257c strh.w r2, [r3, #1404] @ 0x57c + break; + 8001668: e092 b.n 8001790 + //----------------------------------------------------------- + // КОМАНДА №1 + // ЗАПИСЬ МАССИВА ПОРТОВ + //----------------------------------------------------------- + + cmd_buf[0] = rx_msg.cmd_code; // - код команды + 800166a: 4b4d ldr r3, [pc, #308] @ (80017a0 ) + 800166c: 889b ldrh r3, [r3, #4] + 800166e: b2da uxtb r2, r3 + 8001670: 68bb ldr r3, [r7, #8] + 8001672: 701a strb r2, [r3, #0] + ports_amount = rx_msg.rx_buf[7]; + 8001674: 4b4a ldr r3, [pc, #296] @ (80017a0 ) + 8001676: 7b9b ldrb r3, [r3, #14] + 8001678: 81bb strh r3, [r7, #12] + + // Проверка размера принятого буфера + if( rx_msg.length < (8 + ports_amount * 4)) + 800167a: 4b49 ldr r3, [pc, #292] @ (80017a0 ) + 800167c: f8b3 3808 ldrh.w r3, [r3, #2056] @ 0x808 + 8001680: 461a mov r2, r3 + 8001682: 89bb ldrh r3, [r7, #12] + 8001684: 3302 adds r3, #2 + 8001686: 009b lsls r3, r3, #2 + 8001688: 429a cmp r2, r3 + 800168a: da08 bge.n 800169e + { + // Размер принятого пакета меньше чем долно быть + // Установить ошибку + // КОД = 2 + cmd_buf[1] = ERR_SIZE; + 800168c: 68bb ldr r3, [r7, #8] + 800168e: 3301 adds r3, #1 + 8001690: 2202 movs r2, #2 + 8001692: 701a strb r2, [r3, #0] + + // Установить размер буфера = 2 + tx_msg.cmd_len = 2; + 8001694: 4b43 ldr r3, [pc, #268] @ (80017a4 ) + 8001696: 2202 movs r2, #2 + 8001698: f8a3 257c strh.w r2, [r3, #1404] @ 0x57c + cmd_buf[6 + (i*4)] = port_data >> 8; + } + // Установить размер буфера + tx_msg.cmd_len = (ports_amount << 2) + 3; + } + break; + 800169c: e077 b.n 800178e + cmd_buf[1] = NO_ERROR; + 800169e: 68bb ldr r3, [r7, #8] + 80016a0: 3301 adds r3, #1 + 80016a2: 2201 movs r2, #1 + 80016a4: 701a strb r2, [r3, #0] + cmd_buf[2] = rx_msg.rx_buf[7]; + 80016a6: 68bb ldr r3, [r7, #8] + 80016a8: 3302 adds r3, #2 + 80016aa: 4a3d ldr r2, [pc, #244] @ (80017a0 ) + 80016ac: 7b92 ldrb r2, [r2, #14] + 80016ae: 701a strb r2, [r3, #0] + for (i = 0; i + port_addr = rx_msg.rx_buf[8 + i * 4] + (rx_msg.rx_buf[9 + i * 4] << 8); + 80016b6: 89fb ldrh r3, [r7, #14] + 80016b8: 3302 adds r3, #2 + 80016ba: 009b lsls r3, r3, #2 + 80016bc: 4a38 ldr r2, [pc, #224] @ (80017a0 ) + 80016be: 4413 add r3, r2 + 80016c0: 79db ldrb r3, [r3, #7] + 80016c2: 4619 mov r1, r3 + 80016c4: 89fb ldrh r3, [r7, #14] + 80016c6: 009b lsls r3, r3, #2 + 80016c8: 3309 adds r3, #9 + 80016ca: 4a35 ldr r2, [pc, #212] @ (80017a0 ) + 80016cc: 4413 add r3, r2 + 80016ce: 79db ldrb r3, [r3, #7] + 80016d0: 021b lsls r3, r3, #8 + 80016d2: b29b uxth r3, r3 + 80016d4: 440b add r3, r1 + 80016d6: 80fb strh r3, [r7, #6] + port_data = rx_msg.rx_buf[10 + i * 4] + (rx_msg.rx_buf[11 + i * 4] << 8); + 80016d8: 89fb ldrh r3, [r7, #14] + 80016da: 009b lsls r3, r3, #2 + 80016dc: 330a adds r3, #10 + 80016de: 4a30 ldr r2, [pc, #192] @ (80017a0 ) + 80016e0: 4413 add r3, r2 + 80016e2: 79db ldrb r3, [r3, #7] + 80016e4: 4619 mov r1, r3 + 80016e6: 89fb ldrh r3, [r7, #14] + 80016e8: 009b lsls r3, r3, #2 + 80016ea: 330b adds r3, #11 + 80016ec: 4a2c ldr r2, [pc, #176] @ (80017a0 ) + 80016ee: 4413 add r3, r2 + 80016f0: 79db ldrb r3, [r3, #7] + 80016f2: 021b lsls r3, r3, #8 + 80016f4: b29b uxth r3, r3 + 80016f6: 440b add r3, r1 + 80016f8: 80bb strh r3, [r7, #4] + cmd_buf[3 + (i*4)] = rx_msg.rx_buf[8 + i * 4]; + 80016fa: 89fb ldrh r3, [r7, #14] + 80016fc: 3302 adds r3, #2 + 80016fe: 009a lsls r2, r3, #2 + 8001700: 89fb ldrh r3, [r7, #14] + 8001702: 009b lsls r3, r3, #2 + 8001704: 3303 adds r3, #3 + 8001706: 4619 mov r1, r3 + 8001708: 68bb ldr r3, [r7, #8] + 800170a: 440b add r3, r1 + 800170c: 4924 ldr r1, [pc, #144] @ (80017a0 ) + 800170e: 440a add r2, r1 + 8001710: 79d2 ldrb r2, [r2, #7] + 8001712: 701a strb r2, [r3, #0] + cmd_buf[4 + (i*4)] = rx_msg.rx_buf[9 + i * 4]; + 8001714: 89fb ldrh r3, [r7, #14] + 8001716: 009b lsls r3, r3, #2 + 8001718: f103 0209 add.w r2, r3, #9 + 800171c: 89fb ldrh r3, [r7, #14] + 800171e: 3301 adds r3, #1 + 8001720: 009b lsls r3, r3, #2 + 8001722: 4619 mov r1, r3 + 8001724: 68bb ldr r3, [r7, #8] + 8001726: 440b add r3, r1 + 8001728: 491d ldr r1, [pc, #116] @ (80017a0 ) + 800172a: 440a add r2, r1 + 800172c: 79d2 ldrb r2, [r2, #7] + 800172e: 701a strb r2, [r3, #0] + write_isa(port_addr, port_data); + 8001730: 88ba ldrh r2, [r7, #4] + 8001732: 88fb ldrh r3, [r7, #6] + 8001734: 4611 mov r1, r2 + 8001736: 4618 mov r0, r3 + 8001738: f000 f848 bl 80017cc + port_data = read_isa(port_addr); + 800173c: 88fb ldrh r3, [r7, #6] + 800173e: 4618 mov r0, r3 + 8001740: f000 f834 bl 80017ac + 8001744: 4603 mov r3, r0 + 8001746: 80bb strh r3, [r7, #4] + cmd_buf[5 + (i*4)] = port_data & 0xFF; + 8001748: 89fb ldrh r3, [r7, #14] + 800174a: 009b lsls r3, r3, #2 + 800174c: 3305 adds r3, #5 + 800174e: 461a mov r2, r3 + 8001750: 68bb ldr r3, [r7, #8] + 8001752: 4413 add r3, r2 + 8001754: 88ba ldrh r2, [r7, #4] + 8001756: b2d2 uxtb r2, r2 + 8001758: 701a strb r2, [r3, #0] + cmd_buf[6 + (i*4)] = port_data >> 8; + 800175a: 88bb ldrh r3, [r7, #4] + 800175c: 0a1b lsrs r3, r3, #8 + 800175e: b29a uxth r2, r3 + 8001760: 89fb ldrh r3, [r7, #14] + 8001762: 009b lsls r3, r3, #2 + 8001764: 3306 adds r3, #6 + 8001766: 4619 mov r1, r3 + 8001768: 68bb ldr r3, [r7, #8] + 800176a: 440b add r3, r1 + 800176c: b2d2 uxtb r2, r2 + 800176e: 701a strb r2, [r3, #0] + for (i = 0; i + tx_msg.cmd_len = (ports_amount << 2) + 3; + 800177e: 89bb ldrh r3, [r7, #12] + 8001780: 009b lsls r3, r3, #2 + 8001782: b29b uxth r3, r3 + 8001784: 3303 adds r3, #3 + 8001786: b29a uxth r2, r3 + 8001788: 4b06 ldr r3, [pc, #24] @ (80017a4 ) + 800178a: f8a3 257c strh.w r2, [r3, #1404] @ 0x57c + break; + 800178e: bf00 nop + } + + need_send_private = 1; + 8001790: 4b05 ldr r3, [pc, #20] @ (80017a8 ) + 8001792: 2201 movs r2, #1 + 8001794: 701a strb r2, [r3, #0] + +} + 8001796: bf00 nop + 8001798: 3710 adds r7, #16 + 800179a: 46bd mov sp, r7 + 800179c: bd80 pop {r7, pc} + 800179e: bf00 nop + 80017a0: 2000079c .word 0x2000079c + 80017a4: 20000fa8 .word 0x20000fa8 + 80017a8: 20001526 .word 0x20001526 + +080017ac : + +uint16_t read_isa(uint16_t addr) +{ + 80017ac: b480 push {r7} + 80017ae: b083 sub sp, #12 + 80017b0: af00 add r7, sp, #0 + 80017b2: 4603 mov r3, r0 + 80017b4: 80fb strh r3, [r7, #6] + return *(uint16_t*)(ISA_BASE_RD + (addr << 1)); + 80017b6: 88fb ldrh r3, [r7, #6] + 80017b8: 005b lsls r3, r3, #1 + 80017ba: f103 43c0 add.w r3, r3, #1610612736 @ 0x60000000 + 80017be: 881b ldrh r3, [r3, #0] +} + 80017c0: 4618 mov r0, r3 + 80017c2: 370c adds r7, #12 + 80017c4: 46bd mov sp, r7 + 80017c6: f85d 7b04 ldr.w r7, [sp], #4 + 80017ca: 4770 bx lr + +080017cc : + +void write_isa(uint16_t addr, uint16_t data) +{ + 80017cc: b480 push {r7} + 80017ce: b083 sub sp, #12 + 80017d0: af00 add r7, sp, #0 + 80017d2: 4603 mov r3, r0 + 80017d4: 460a mov r2, r1 + 80017d6: 80fb strh r3, [r7, #6] + 80017d8: 4613 mov r3, r2 + 80017da: 80bb strh r3, [r7, #4] + *(uint16_t*)(ISA_BASE_WR + (addr << 1)) = data; + 80017dc: 88fb ldrh r3, [r7, #6] + 80017de: 005b lsls r3, r3, #1 + 80017e0: f103 43c0 add.w r3, r3, #1610612736 @ 0x60000000 + 80017e4: f503 0380 add.w r3, r3, #4194304 @ 0x400000 + 80017e8: 461a mov r2, r3 + 80017ea: 88bb ldrh r3, [r7, #4] + 80017ec: 8013 strh r3, [r2, #0] +} + 80017ee: bf00 nop + 80017f0: 370c adds r7, #12 + 80017f2: 46bd mov sp, r7 + 80017f4: f85d 7b04 ldr.w r7, [sp], #4 + 80017f8: 4770 bx lr + +080017fa : +/** + * @brief This function is executed in case of error occurrence. + * @retval None + */ +void Error_Handler(void) +{ + 80017fa: b480 push {r7} + 80017fc: af00 add r7, sp, #0 + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); + 80017fe: b672 cpsid i +} + 8001800: bf00 nop + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + __disable_irq(); + while (1) + 8001802: bf00 nop + 8001804: e7fd b.n 8001802 + ... + +08001808 : + */ +#include "pribors.h" +#include "lwip/ip_addr.h" + +uint32_t get_ip(void) +{ + 8001808: b580 push {r7, lr} + 800180a: b082 sub sp, #8 + 800180c: af00 add r7, sp, #0 + uint32_t pribor = (((GPIOC->IDR) >> 6) & 0x7) | (((GPIOC->IDR) >> 9) & 0x18); + 800180e: 4b0e ldr r3, [pc, #56] @ (8001848 ) + 8001810: 691b ldr r3, [r3, #16] + 8001812: 099b lsrs r3, r3, #6 + 8001814: f003 0207 and.w r2, r3, #7 + 8001818: 4b0b ldr r3, [pc, #44] @ (8001848 ) + 800181a: 691b ldr r3, [r3, #16] + 800181c: 0a5b lsrs r3, r3, #9 + 800181e: f003 0318 and.w r3, r3, #24 + 8001822: 4313 orrs r3, r2 + 8001824: 607b str r3, [r7, #4] + if (pribor == PRIBOR_UF) return ipaddr_addr(IP_PRIBOR_UF); + 8001826: 687b ldr r3, [r7, #4] + 8001828: 2b1b cmp r3, #27 + 800182a: d104 bne.n 8001836 + 800182c: 4807 ldr r0, [pc, #28] @ (800184c ) + 800182e: f00e fdb2 bl 8010396 + 8001832: 4603 mov r3, r0 + 8001834: e003 b.n 800183e + else return ipaddr_addr("10.1.1.69"); + 8001836: 4806 ldr r0, [pc, #24] @ (8001850 ) + 8001838: f00e fdad bl 8010396 + 800183c: 4603 mov r3, r0 +} + 800183e: 4618 mov r0, r3 + 8001840: 3708 adds r7, #8 + 8001842: 46bd mov sp, r7 + 8001844: bd80 pop {r7, pc} + 8001846: bf00 nop + 8001848: 40020800 .word 0x40020800 + 800184c: 08015fb4 .word 0x08015fb4 + 8001850: 08015fc0 .word 0x08015fc0 + +08001854 : + +uint16_t get_port(void) +{ + 8001854: b480 push {r7} + 8001856: b083 sub sp, #12 + 8001858: af00 add r7, sp, #0 + uint32_t pribor = (((GPIOC->IDR) >> 6) & 0x7) | (((GPIOC->IDR) >> 9) & 0x18); + 800185a: 4b0d ldr r3, [pc, #52] @ (8001890 ) + 800185c: 691b ldr r3, [r3, #16] + 800185e: 099b lsrs r3, r3, #6 + 8001860: f003 0207 and.w r2, r3, #7 + 8001864: 4b0a ldr r3, [pc, #40] @ (8001890 ) + 8001866: 691b ldr r3, [r3, #16] + 8001868: 0a5b lsrs r3, r3, #9 + 800186a: f003 0318 and.w r3, r3, #24 + 800186e: 4313 orrs r3, r2 + 8001870: 607b str r3, [r7, #4] + if (pribor == PRIBOR_UF) return 50000U + PORT_PRIBOR_UF; + 8001872: 687b ldr r3, [r7, #4] + 8001874: 2b1b cmp r3, #27 + 8001876: d102 bne.n 800187e + 8001878: f24c 3384 movw r3, #50052 @ 0xc384 + 800187c: e001 b.n 8001882 + else return 50069U; + 800187e: f24c 3395 movw r3, #50069 @ 0xc395 +} + 8001882: 4618 mov r0, r3 + 8001884: 370c adds r7, #12 + 8001886: 46bd mov sp, r7 + 8001888: f85d 7b04 ldr.w r7, [sp], #4 + 800188c: 4770 bx lr + 800188e: bf00 nop + 8001890: 40020800 .word 0x40020800 + +08001894 : + +uint16_t set_status(unsigned char *buf) +{ + 8001894: b480 push {r7} + 8001896: b083 sub sp, #12 + 8001898: af00 add r7, sp, #0 + 800189a: 6078 str r0, [r7, #4] + buf[6] = 2; + 800189c: 687b ldr r3, [r7, #4] + 800189e: 3306 adds r3, #6 + 80018a0: 2202 movs r2, #2 + 80018a2: 701a strb r2, [r3, #0] + buf[7] = 0; + 80018a4: 687b ldr r3, [r7, #4] + 80018a6: 3307 adds r3, #7 + 80018a8: 2200 movs r2, #0 + 80018aa: 701a strb r2, [r3, #0] + + buf[8] = 1; + 80018ac: 687b ldr r3, [r7, #4] + 80018ae: 3308 adds r3, #8 + 80018b0: 2201 movs r2, #1 + 80018b2: 701a strb r2, [r3, #0] + buf[9] = 2; + 80018b4: 687b ldr r3, [r7, #4] + 80018b6: 3309 adds r3, #9 + 80018b8: 2202 movs r2, #2 + 80018ba: 701a strb r2, [r3, #0] + + return(4); + 80018bc: 2304 movs r3, #4 +} + 80018be: 4618 mov r0, r3 + 80018c0: 370c adds r7, #12 + 80018c2: 46bd mov sp, r7 + 80018c4: f85d 7b04 ldr.w r7, [sp], #4 + 80018c8: 4770 bx lr + ... + +080018cc : +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + 80018cc: b480 push {r7} + 80018ce: b083 sub sp, #12 + 80018d0: af00 add r7, sp, #0 + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_SYSCFG_CLK_ENABLE(); + 80018d2: 2300 movs r3, #0 + 80018d4: 607b str r3, [r7, #4] + 80018d6: 4b10 ldr r3, [pc, #64] @ (8001918 ) + 80018d8: 6c5b ldr r3, [r3, #68] @ 0x44 + 80018da: 4a0f ldr r2, [pc, #60] @ (8001918 ) + 80018dc: f443 4380 orr.w r3, r3, #16384 @ 0x4000 + 80018e0: 6453 str r3, [r2, #68] @ 0x44 + 80018e2: 4b0d ldr r3, [pc, #52] @ (8001918 ) + 80018e4: 6c5b ldr r3, [r3, #68] @ 0x44 + 80018e6: f403 4380 and.w r3, r3, #16384 @ 0x4000 + 80018ea: 607b str r3, [r7, #4] + 80018ec: 687b ldr r3, [r7, #4] + __HAL_RCC_PWR_CLK_ENABLE(); + 80018ee: 2300 movs r3, #0 + 80018f0: 603b str r3, [r7, #0] + 80018f2: 4b09 ldr r3, [pc, #36] @ (8001918 ) + 80018f4: 6c1b ldr r3, [r3, #64] @ 0x40 + 80018f6: 4a08 ldr r2, [pc, #32] @ (8001918 ) + 80018f8: f043 5380 orr.w r3, r3, #268435456 @ 0x10000000 + 80018fc: 6413 str r3, [r2, #64] @ 0x40 + 80018fe: 4b06 ldr r3, [pc, #24] @ (8001918 ) + 8001900: 6c1b ldr r3, [r3, #64] @ 0x40 + 8001902: f003 5380 and.w r3, r3, #268435456 @ 0x10000000 + 8001906: 603b str r3, [r7, #0] + 8001908: 683b ldr r3, [r7, #0] + /* System interrupt init*/ + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + 800190a: bf00 nop + 800190c: 370c adds r7, #12 + 800190e: 46bd mov sp, r7 + 8001910: f85d 7b04 ldr.w r7, [sp], #4 + 8001914: 4770 bx lr + 8001916: bf00 nop + 8001918: 40023800 .word 0x40023800 + +0800191c : +* This function configures the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) +{ + 800191c: b580 push {r7, lr} + 800191e: b084 sub sp, #16 + 8001920: af00 add r7, sp, #0 + 8001922: 6078 str r0, [r7, #4] + if(htim_base->Instance==TIM3) + 8001924: 687b ldr r3, [r7, #4] + 8001926: 681b ldr r3, [r3, #0] + 8001928: 4a0e ldr r2, [pc, #56] @ (8001964 ) + 800192a: 4293 cmp r3, r2 + 800192c: d115 bne.n 800195a + { + /* USER CODE BEGIN TIM3_MspInit 0 */ + + /* USER CODE END TIM3_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM3_CLK_ENABLE(); + 800192e: 2300 movs r3, #0 + 8001930: 60fb str r3, [r7, #12] + 8001932: 4b0d ldr r3, [pc, #52] @ (8001968 ) + 8001934: 6c1b ldr r3, [r3, #64] @ 0x40 + 8001936: 4a0c ldr r2, [pc, #48] @ (8001968 ) + 8001938: f043 0302 orr.w r3, r3, #2 + 800193c: 6413 str r3, [r2, #64] @ 0x40 + 800193e: 4b0a ldr r3, [pc, #40] @ (8001968 ) + 8001940: 6c1b ldr r3, [r3, #64] @ 0x40 + 8001942: f003 0302 and.w r3, r3, #2 + 8001946: 60fb str r3, [r7, #12] + 8001948: 68fb ldr r3, [r7, #12] + /* TIM3 interrupt Init */ + HAL_NVIC_SetPriority(TIM3_IRQn, 0, 0); + 800194a: 2200 movs r2, #0 + 800194c: 2100 movs r1, #0 + 800194e: 201d movs r0, #29 + 8001950: f000 fbdd bl 800210e + HAL_NVIC_EnableIRQ(TIM3_IRQn); + 8001954: 201d movs r0, #29 + 8001956: f000 fbf6 bl 8002146 + /* USER CODE BEGIN TIM3_MspInit 1 */ + + /* USER CODE END TIM3_MspInit 1 */ + } + +} + 800195a: bf00 nop + 800195c: 3710 adds r7, #16 + 800195e: 46bd mov sp, r7 + 8001960: bd80 pop {r7, pc} + 8001962: bf00 nop + 8001964: 40000400 .word 0x40000400 + 8001968: 40023800 .word 0x40023800 + +0800196c : + +} + +static uint32_t FMC_Initialized = 0; + +static void HAL_FMC_MspInit(void){ + 800196c: b580 push {r7, lr} + 800196e: b086 sub sp, #24 + 8001970: af00 add r7, sp, #0 + /* USER CODE BEGIN FMC_MspInit 0 */ + + /* USER CODE END FMC_MspInit 0 */ + GPIO_InitTypeDef GPIO_InitStruct ={0}; + 8001972: 1d3b adds r3, r7, #4 + 8001974: 2200 movs r2, #0 + 8001976: 601a str r2, [r3, #0] + 8001978: 605a str r2, [r3, #4] + 800197a: 609a str r2, [r3, #8] + 800197c: 60da str r2, [r3, #12] + 800197e: 611a str r2, [r3, #16] + if (FMC_Initialized) { + 8001980: 4b2c ldr r3, [pc, #176] @ (8001a34 ) + 8001982: 681b ldr r3, [r3, #0] + 8001984: 2b00 cmp r3, #0 + 8001986: d150 bne.n 8001a2a + return; + } + FMC_Initialized = 1; + 8001988: 4b2a ldr r3, [pc, #168] @ (8001a34 ) + 800198a: 2201 movs r2, #1 + 800198c: 601a str r2, [r3, #0] + + /* Peripheral clock enable */ + __HAL_RCC_FMC_CLK_ENABLE(); + 800198e: 2300 movs r3, #0 + 8001990: 603b str r3, [r7, #0] + 8001992: 4b29 ldr r3, [pc, #164] @ (8001a38 ) + 8001994: 6b9b ldr r3, [r3, #56] @ 0x38 + 8001996: 4a28 ldr r2, [pc, #160] @ (8001a38 ) + 8001998: f043 0301 orr.w r3, r3, #1 + 800199c: 6393 str r3, [r2, #56] @ 0x38 + 800199e: 4b26 ldr r3, [pc, #152] @ (8001a38 ) + 80019a0: 6b9b ldr r3, [r3, #56] @ 0x38 + 80019a2: f003 0301 and.w r3, r3, #1 + 80019a6: 603b str r3, [r7, #0] + 80019a8: 683b ldr r3, [r7, #0] + PD5 ------> FMC_NWE + PD7 ------> FMC_NE1 + PE0 ------> FMC_NBL0 + PE1 ------> FMC_NBL1 + */ + GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6 + 80019aa: f64f 73fb movw r3, #65531 @ 0xfffb + 80019ae: 607b str r3, [r7, #4] + |GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 + |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 + |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 80019b0: 2302 movs r3, #2 + 80019b2: 60bb str r3, [r7, #8] + GPIO_InitStruct.Pull = GPIO_NOPULL; + 80019b4: 2300 movs r3, #0 + 80019b6: 60fb str r3, [r7, #12] + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 80019b8: 2303 movs r3, #3 + 80019ba: 613b str r3, [r7, #16] + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; + 80019bc: 230c movs r3, #12 + 80019be: 617b str r3, [r7, #20] + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); + 80019c0: 1d3b adds r3, r7, #4 + 80019c2: 4619 mov r1, r3 + 80019c4: 481d ldr r0, [pc, #116] @ (8001a3c ) + 80019c6: f001 fccf bl 8003368 + + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 + 80019ca: f24f 033f movw r3, #61503 @ 0xf03f + 80019ce: 607b str r3, [r7, #4] + |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_13 + |GPIO_PIN_14|GPIO_PIN_15; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 80019d0: 2302 movs r3, #2 + 80019d2: 60bb str r3, [r7, #8] + GPIO_InitStruct.Pull = GPIO_NOPULL; + 80019d4: 2300 movs r3, #0 + 80019d6: 60fb str r3, [r7, #12] + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 80019d8: 2303 movs r3, #3 + 80019da: 613b str r3, [r7, #16] + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; + 80019dc: 230c movs r3, #12 + 80019de: 617b str r3, [r7, #20] + HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); + 80019e0: 1d3b adds r3, r7, #4 + 80019e2: 4619 mov r1, r3 + 80019e4: 4816 ldr r0, [pc, #88] @ (8001a40 ) + 80019e6: f001 fcbf bl 8003368 + + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 + 80019ea: 233f movs r3, #63 @ 0x3f + 80019ec: 607b str r3, [r7, #4] + |GPIO_PIN_4|GPIO_PIN_5; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 80019ee: 2302 movs r3, #2 + 80019f0: 60bb str r3, [r7, #8] + GPIO_InitStruct.Pull = GPIO_NOPULL; + 80019f2: 2300 movs r3, #0 + 80019f4: 60fb str r3, [r7, #12] + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 80019f6: 2303 movs r3, #3 + 80019f8: 613b str r3, [r7, #16] + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; + 80019fa: 230c movs r3, #12 + 80019fc: 617b str r3, [r7, #20] + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); + 80019fe: 1d3b adds r3, r7, #4 + 8001a00: 4619 mov r1, r3 + 8001a02: 4810 ldr r0, [pc, #64] @ (8001a44 ) + 8001a04: f001 fcb0 bl 8003368 + + GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11 + 8001a08: f64f 73b3 movw r3, #65459 @ 0xffb3 + 8001a0c: 607b str r3, [r7, #4] + |GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15 + |GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5 + |GPIO_PIN_7; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 8001a0e: 2302 movs r3, #2 + 8001a10: 60bb str r3, [r7, #8] + GPIO_InitStruct.Pull = GPIO_NOPULL; + 8001a12: 2300 movs r3, #0 + 8001a14: 60fb str r3, [r7, #12] + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 8001a16: 2303 movs r3, #3 + 8001a18: 613b str r3, [r7, #16] + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; + 8001a1a: 230c movs r3, #12 + 8001a1c: 617b str r3, [r7, #20] + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + 8001a1e: 1d3b adds r3, r7, #4 + 8001a20: 4619 mov r1, r3 + 8001a22: 4809 ldr r0, [pc, #36] @ (8001a48 ) + 8001a24: f001 fca0 bl 8003368 + 8001a28: e000 b.n 8001a2c + return; + 8001a2a: bf00 nop + + /* USER CODE BEGIN FMC_MspInit 1 */ + + /* USER CODE END FMC_MspInit 1 */ +} + 8001a2c: 3718 adds r7, #24 + 8001a2e: 46bd mov sp, r7 + 8001a30: bd80 pop {r7, pc} + 8001a32: bf00 nop + 8001a34: 20001528 .word 0x20001528 + 8001a38: 40023800 .word 0x40023800 + 8001a3c: 40021000 .word 0x40021000 + 8001a40: 40021400 .word 0x40021400 + 8001a44: 40021800 .word 0x40021800 + 8001a48: 40020c00 .word 0x40020c00 + +08001a4c : + +void HAL_SRAM_MspInit(SRAM_HandleTypeDef* hsram){ + 8001a4c: b580 push {r7, lr} + 8001a4e: b082 sub sp, #8 + 8001a50: af00 add r7, sp, #0 + 8001a52: 6078 str r0, [r7, #4] + /* USER CODE BEGIN SRAM_MspInit 0 */ + + /* USER CODE END SRAM_MspInit 0 */ + HAL_FMC_MspInit(); + 8001a54: f7ff ff8a bl 800196c + /* USER CODE BEGIN SRAM_MspInit 1 */ + + /* USER CODE END SRAM_MspInit 1 */ +} + 8001a58: bf00 nop + 8001a5a: 3708 adds r7, #8 + 8001a5c: 46bd mov sp, r7 + 8001a5e: bd80 pop {r7, pc} + +08001a60 : +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + 8001a60: b480 push {r7} + 8001a62: af00 add r7, sp, #0 + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + while (1) + 8001a64: bf00 nop + 8001a66: e7fd b.n 8001a64 + +08001a68 : + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + 8001a68: b480 push {r7} + 8001a6a: af00 add r7, sp, #0 + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + 8001a6c: bf00 nop + 8001a6e: e7fd b.n 8001a6c + +08001a70 : + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + 8001a70: b480 push {r7} + 8001a72: af00 add r7, sp, #0 + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + 8001a74: bf00 nop + 8001a76: e7fd b.n 8001a74 + +08001a78 : + +/** + * @brief This function handles Pre-fetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + 8001a78: b480 push {r7} + 8001a7a: af00 add r7, sp, #0 + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + 8001a7c: bf00 nop + 8001a7e: e7fd b.n 8001a7c + +08001a80 : + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + 8001a80: b480 push {r7} + 8001a82: af00 add r7, sp, #0 + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + 8001a84: bf00 nop + 8001a86: e7fd b.n 8001a84 + +08001a88 : + +/** + * @brief This function handles System service call via SWI instruction. + */ +void SVC_Handler(void) +{ + 8001a88: b480 push {r7} + 8001a8a: af00 add r7, sp, #0 + + /* USER CODE END SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 1 */ + + /* USER CODE END SVCall_IRQn 1 */ +} + 8001a8c: bf00 nop + 8001a8e: 46bd mov sp, r7 + 8001a90: f85d 7b04 ldr.w r7, [sp], #4 + 8001a94: 4770 bx lr + +08001a96 : + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + 8001a96: b480 push {r7} + 8001a98: af00 add r7, sp, #0 + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + 8001a9a: bf00 nop + 8001a9c: 46bd mov sp, r7 + 8001a9e: f85d 7b04 ldr.w r7, [sp], #4 + 8001aa2: 4770 bx lr + +08001aa4 : + +/** + * @brief This function handles Pendable request for system service. + */ +void PendSV_Handler(void) +{ + 8001aa4: b480 push {r7} + 8001aa6: af00 add r7, sp, #0 + + /* USER CODE END PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 1 */ + + /* USER CODE END PendSV_IRQn 1 */ +} + 8001aa8: bf00 nop + 8001aaa: 46bd mov sp, r7 + 8001aac: f85d 7b04 ldr.w r7, [sp], #4 + 8001ab0: 4770 bx lr + +08001ab2 : + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + 8001ab2: b580 push {r7, lr} + 8001ab4: af00 add r7, sp, #0 + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + HAL_IncTick(); + 8001ab6: f000 fa0b bl 8001ed0 + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + 8001aba: bf00 nop + 8001abc: bd80 pop {r7, pc} + ... + +08001ac0 : + +/** + * @brief This function handles TIM3 global interrupt. + */ +void TIM3_IRQHandler(void) +{ + 8001ac0: b580 push {r7, lr} + 8001ac2: af00 add r7, sp, #0 + /* USER CODE BEGIN TIM3_IRQn 0 */ + + /* USER CODE END TIM3_IRQn 0 */ + HAL_TIM_IRQHandler(&htim3); + 8001ac4: 4808 ldr r0, [pc, #32] @ (8001ae8 ) + 8001ac6: f002 fb4d bl 8004164 + /* USER CODE BEGIN TIM3_IRQn 1 */ + br_counter++; + 8001aca: 4b08 ldr r3, [pc, #32] @ (8001aec ) + 8001acc: 681b ldr r3, [r3, #0] + 8001ace: 3301 adds r3, #1 + 8001ad0: 4a06 ldr r2, [pc, #24] @ (8001aec ) + 8001ad2: 6013 str r3, [r2, #0] + rx_msg.con_timeout++; + 8001ad4: 4b06 ldr r3, [pc, #24] @ (8001af0 ) + 8001ad6: f8b3 380a ldrh.w r3, [r3, #2058] @ 0x80a + 8001ada: 3301 adds r3, #1 + 8001adc: b29a uxth r2, r3 + 8001ade: 4b04 ldr r3, [pc, #16] @ (8001af0 ) + 8001ae0: f8a3 280a strh.w r2, [r3, #2058] @ 0x80a + + /* USER CODE END TIM3_IRQn 1 */ +} + 8001ae4: bf00 nop + 8001ae6: bd80 pop {r7, pc} + 8001ae8: 200006fc .word 0x200006fc + 8001aec: 20000794 .word 0x20000794 + 8001af0: 2000079c .word 0x2000079c + +08001af4 : + * configuration. + * @param None + * @retval None + */ +void SystemInit(void) +{ + 8001af4: b480 push {r7} + 8001af6: af00 add r7, sp, #0 + /* FPU settings ------------------------------------------------------------*/ + #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ + 8001af8: 4b06 ldr r3, [pc, #24] @ (8001b14 ) + 8001afa: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 8001afe: 4a05 ldr r2, [pc, #20] @ (8001b14 ) + 8001b00: f443 0370 orr.w r3, r3, #15728640 @ 0xf00000 + 8001b04: f8c2 3088 str.w r3, [r2, #136] @ 0x88 + + /* Configure the Vector Table location -------------------------------------*/ +#if defined(USER_VECT_TAB_ADDRESS) + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ +#endif /* USER_VECT_TAB_ADDRESS */ +} + 8001b08: bf00 nop + 8001b0a: 46bd mov sp, r7 + 8001b0c: f85d 7b04 ldr.w r7, [sp], #4 + 8001b10: 4770 bx lr + 8001b12: bf00 nop + 8001b14: e000ed00 .word 0xe000ed00 + +08001b18 : + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr r0, =_estack + 8001b18: 480d ldr r0, [pc, #52] @ (8001b50 ) + mov sp, r0 /* set stack pointer */ + 8001b1a: 4685 mov sp, r0 +/* Call the clock system initialization function.*/ + bl SystemInit + 8001b1c: f7ff ffea bl 8001af4 + +/* Copy the data segment initializers from flash to SRAM */ + ldr r0, =_sdata + 8001b20: 480c ldr r0, [pc, #48] @ (8001b54 ) + ldr r1, =_edata + 8001b22: 490d ldr r1, [pc, #52] @ (8001b58 ) + ldr r2, =_sidata + 8001b24: 4a0d ldr r2, [pc, #52] @ (8001b5c ) + movs r3, #0 + 8001b26: 2300 movs r3, #0 + b LoopCopyDataInit + 8001b28: e002 b.n 8001b30 + +08001b2a : + +CopyDataInit: + ldr r4, [r2, r3] + 8001b2a: 58d4 ldr r4, [r2, r3] + str r4, [r0, r3] + 8001b2c: 50c4 str r4, [r0, r3] + adds r3, r3, #4 + 8001b2e: 3304 adds r3, #4 + +08001b30 : + +LoopCopyDataInit: + adds r4, r0, r3 + 8001b30: 18c4 adds r4, r0, r3 + cmp r4, r1 + 8001b32: 428c cmp r4, r1 + bcc CopyDataInit + 8001b34: d3f9 bcc.n 8001b2a + +/* Zero fill the bss segment. */ + ldr r2, =_sbss + 8001b36: 4a0a ldr r2, [pc, #40] @ (8001b60 ) + ldr r4, =_ebss + 8001b38: 4c0a ldr r4, [pc, #40] @ (8001b64 ) + movs r3, #0 + 8001b3a: 2300 movs r3, #0 + b LoopFillZerobss + 8001b3c: e001 b.n 8001b42 + +08001b3e : + +FillZerobss: + str r3, [r2] + 8001b3e: 6013 str r3, [r2, #0] + adds r2, r2, #4 + 8001b40: 3204 adds r2, #4 + +08001b42 : + +LoopFillZerobss: + cmp r2, r4 + 8001b42: 42a2 cmp r2, r4 + bcc FillZerobss + 8001b44: d3fb bcc.n 8001b3e + +/* Call static constructors */ + bl __libc_init_array + 8001b46: f00f fe2b bl 80117a0 <__libc_init_array> +/* Call the application's entry point.*/ + bl main + 8001b4a: f7ff f9b5 bl 8000eb8
+ +08001b4e : + +LoopForever: + b LoopForever + 8001b4e: e7fe b.n 8001b4e + ldr r0, =_estack + 8001b50: 20030000 .word 0x20030000 + ldr r0, =_sdata + 8001b54: 20000000 .word 0x20000000 + ldr r1, =_edata + 8001b58: 200006e0 .word 0x200006e0 + ldr r2, =_sidata + 8001b5c: 08019288 .word 0x08019288 + ldr r2, =_sbss + 8001b60: 200006e0 .word 0x200006e0 + ldr r4, =_ebss + 8001b64: 20019544 .word 0x20019544 + +08001b68 : + * @retval : None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + 8001b68: e7fe b.n 8001b68 + +08001b6a : + * @param ioctx: holds device IO functions. + * @retval DP83848_STATUS_OK if OK + * DP83848_STATUS_ERROR if missing mandatory function + */ +int32_t DP83848_RegisterBusIO(dp83848_Object_t *pObj, dp83848_IOCtx_t *ioctx) +{ + 8001b6a: b480 push {r7} + 8001b6c: b083 sub sp, #12 + 8001b6e: af00 add r7, sp, #0 + 8001b70: 6078 str r0, [r7, #4] + 8001b72: 6039 str r1, [r7, #0] + if(!pObj || !ioctx->ReadReg || !ioctx->WriteReg || !ioctx->GetTick) + 8001b74: 687b ldr r3, [r7, #4] + 8001b76: 2b00 cmp r3, #0 + 8001b78: d00b beq.n 8001b92 + 8001b7a: 683b ldr r3, [r7, #0] + 8001b7c: 68db ldr r3, [r3, #12] + 8001b7e: 2b00 cmp r3, #0 + 8001b80: d007 beq.n 8001b92 + 8001b82: 683b ldr r3, [r7, #0] + 8001b84: 689b ldr r3, [r3, #8] + 8001b86: 2b00 cmp r3, #0 + 8001b88: d003 beq.n 8001b92 + 8001b8a: 683b ldr r3, [r7, #0] + 8001b8c: 691b ldr r3, [r3, #16] + 8001b8e: 2b00 cmp r3, #0 + 8001b90: d102 bne.n 8001b98 + { + return DP83848_STATUS_ERROR; + 8001b92: f04f 33ff mov.w r3, #4294967295 + 8001b96: e014 b.n 8001bc2 + } + + pObj->IO.Init = ioctx->Init; + 8001b98: 683b ldr r3, [r7, #0] + 8001b9a: 681a ldr r2, [r3, #0] + 8001b9c: 687b ldr r3, [r7, #4] + 8001b9e: 609a str r2, [r3, #8] + pObj->IO.DeInit = ioctx->DeInit; + 8001ba0: 683b ldr r3, [r7, #0] + 8001ba2: 685a ldr r2, [r3, #4] + 8001ba4: 687b ldr r3, [r7, #4] + 8001ba6: 60da str r2, [r3, #12] + pObj->IO.ReadReg = ioctx->ReadReg; + 8001ba8: 683b ldr r3, [r7, #0] + 8001baa: 68da ldr r2, [r3, #12] + 8001bac: 687b ldr r3, [r7, #4] + 8001bae: 615a str r2, [r3, #20] + pObj->IO.WriteReg = ioctx->WriteReg; + 8001bb0: 683b ldr r3, [r7, #0] + 8001bb2: 689a ldr r2, [r3, #8] + 8001bb4: 687b ldr r3, [r7, #4] + 8001bb6: 611a str r2, [r3, #16] + pObj->IO.GetTick = ioctx->GetTick; + 8001bb8: 683b ldr r3, [r7, #0] + 8001bba: 691a ldr r2, [r3, #16] + 8001bbc: 687b ldr r3, [r7, #4] + 8001bbe: 619a str r2, [r3, #24] + + return DP83848_STATUS_OK; + 8001bc0: 2300 movs r3, #0 +} + 8001bc2: 4618 mov r0, r3 + 8001bc4: 370c adds r7, #12 + 8001bc6: 46bd mov sp, r7 + 8001bc8: f85d 7b04 ldr.w r7, [sp], #4 + 8001bcc: 4770 bx lr + +08001bce : + * DP83848_STATUS_READ_ERROR if connot read register + * DP83848_STATUS_WRITE_ERROR if connot write to register + * DP83848_STATUS_RESET_TIMEOUT if cannot perform a software reset + */ + int32_t DP83848_Init(dp83848_Object_t *pObj) + { + 8001bce: b580 push {r7, lr} + 8001bd0: b086 sub sp, #24 + 8001bd2: af00 add r7, sp, #0 + 8001bd4: 6078 str r0, [r7, #4] + uint32_t tickstart = 0, regvalue = 0, addr = 0; + 8001bd6: 2300 movs r3, #0 + 8001bd8: 60fb str r3, [r7, #12] + 8001bda: 2300 movs r3, #0 + 8001bdc: 60bb str r3, [r7, #8] + 8001bde: 2300 movs r3, #0 + 8001be0: 617b str r3, [r7, #20] + int32_t status = DP83848_STATUS_OK; + 8001be2: 2300 movs r3, #0 + 8001be4: 613b str r3, [r7, #16] + + if(pObj->Is_Initialized == 0) + 8001be6: 687b ldr r3, [r7, #4] + 8001be8: 685b ldr r3, [r3, #4] + 8001bea: 2b00 cmp r3, #0 + 8001bec: d17c bne.n 8001ce8 + { + if(pObj->IO.Init != 0) + 8001bee: 687b ldr r3, [r7, #4] + 8001bf0: 689b ldr r3, [r3, #8] + 8001bf2: 2b00 cmp r3, #0 + 8001bf4: d002 beq.n 8001bfc + { + /* GPIO and Clocks initialization */ + pObj->IO.Init(); + 8001bf6: 687b ldr r3, [r7, #4] + 8001bf8: 689b ldr r3, [r3, #8] + 8001bfa: 4798 blx r3 + } + + /* for later check */ + pObj->DevAddr = DP83848_MAX_DEV_ADDR + 1; + 8001bfc: 687b ldr r3, [r7, #4] + 8001bfe: 2220 movs r2, #32 + 8001c00: 601a str r2, [r3, #0] + + /* Get the device address from special mode register */ + for(addr = 0; addr <= DP83848_MAX_DEV_ADDR; addr ++) + 8001c02: 2300 movs r3, #0 + 8001c04: 617b str r3, [r7, #20] + 8001c06: e01c b.n 8001c42 + { + if(pObj->IO.ReadReg(addr, DP83848_SMR, ®value) < 0) + 8001c08: 687b ldr r3, [r7, #4] + 8001c0a: 695b ldr r3, [r3, #20] + 8001c0c: f107 0208 add.w r2, r7, #8 + 8001c10: 2119 movs r1, #25 + 8001c12: 6978 ldr r0, [r7, #20] + 8001c14: 4798 blx r3 + 8001c16: 4603 mov r3, r0 + 8001c18: 2b00 cmp r3, #0 + 8001c1a: da03 bge.n 8001c24 + { + status = DP83848_STATUS_READ_ERROR; + 8001c1c: f06f 0304 mvn.w r3, #4 + 8001c20: 613b str r3, [r7, #16] + /* Can't read from this device address + continue with next address */ + continue; + 8001c22: e00b b.n 8001c3c + } + + if((regvalue & DP83848_SMR_PHY_ADDR) == addr) + 8001c24: 68bb ldr r3, [r7, #8] + 8001c26: f003 031f and.w r3, r3, #31 + 8001c2a: 697a ldr r2, [r7, #20] + 8001c2c: 429a cmp r2, r3 + 8001c2e: d105 bne.n 8001c3c + { + pObj->DevAddr = addr; + 8001c30: 687b ldr r3, [r7, #4] + 8001c32: 697a ldr r2, [r7, #20] + 8001c34: 601a str r2, [r3, #0] + status = DP83848_STATUS_OK; + 8001c36: 2300 movs r3, #0 + 8001c38: 613b str r3, [r7, #16] + break; + 8001c3a: e005 b.n 8001c48 + for(addr = 0; addr <= DP83848_MAX_DEV_ADDR; addr ++) + 8001c3c: 697b ldr r3, [r7, #20] + 8001c3e: 3301 adds r3, #1 + 8001c40: 617b str r3, [r7, #20] + 8001c42: 697b ldr r3, [r7, #20] + 8001c44: 2b1f cmp r3, #31 + 8001c46: d9df bls.n 8001c08 + } + } + + if(pObj->DevAddr > DP83848_MAX_DEV_ADDR) + 8001c48: 687b ldr r3, [r7, #4] + 8001c4a: 681b ldr r3, [r3, #0] + 8001c4c: 2b1f cmp r3, #31 + 8001c4e: d902 bls.n 8001c56 + { + status = DP83848_STATUS_ADDRESS_ERROR; + 8001c50: f06f 0302 mvn.w r3, #2 + 8001c54: 613b str r3, [r7, #16] + } + + /* if device address is matched */ + if(status == DP83848_STATUS_OK) + 8001c56: 693b ldr r3, [r7, #16] + 8001c58: 2b00 cmp r3, #0 + 8001c5a: d145 bne.n 8001ce8 + { + /* set a software reset */ + if(pObj->IO.WriteReg(pObj->DevAddr, DP83848_BCR, DP83848_BCR_SOFT_RESET) >= 0) + 8001c5c: 687b ldr r3, [r7, #4] + 8001c5e: 691b ldr r3, [r3, #16] + 8001c60: 687a ldr r2, [r7, #4] + 8001c62: 6810 ldr r0, [r2, #0] + 8001c64: f44f 4200 mov.w r2, #32768 @ 0x8000 + 8001c68: 2100 movs r1, #0 + 8001c6a: 4798 blx r3 + 8001c6c: 4603 mov r3, r0 + 8001c6e: 2b00 cmp r3, #0 + 8001c70: db37 blt.n 8001ce2 + { + /* get software reset status */ + if(pObj->IO.ReadReg(pObj->DevAddr, DP83848_BCR, ®value) >= 0) + 8001c72: 687b ldr r3, [r7, #4] + 8001c74: 695b ldr r3, [r3, #20] + 8001c76: 687a ldr r2, [r7, #4] + 8001c78: 6810 ldr r0, [r2, #0] + 8001c7a: f107 0208 add.w r2, r7, #8 + 8001c7e: 2100 movs r1, #0 + 8001c80: 4798 blx r3 + 8001c82: 4603 mov r3, r0 + 8001c84: 2b00 cmp r3, #0 + 8001c86: db28 blt.n 8001cda + { + tickstart = pObj->IO.GetTick(); + 8001c88: 687b ldr r3, [r7, #4] + 8001c8a: 699b ldr r3, [r3, #24] + 8001c8c: 4798 blx r3 + 8001c8e: 4603 mov r3, r0 + 8001c90: 60fb str r3, [r7, #12] + + /* wait until software reset is done or timeout occured */ + while(regvalue & DP83848_BCR_SOFT_RESET) + 8001c92: e01c b.n 8001cce + { + if((pObj->IO.GetTick() - tickstart) <= DP83848_SW_RESET_TO) + 8001c94: 687b ldr r3, [r7, #4] + 8001c96: 699b ldr r3, [r3, #24] + 8001c98: 4798 blx r3 + 8001c9a: 4603 mov r3, r0 + 8001c9c: 461a mov r2, r3 + 8001c9e: 68fb ldr r3, [r7, #12] + 8001ca0: 1ad3 subs r3, r2, r3 + 8001ca2: f5b3 7ffa cmp.w r3, #500 @ 0x1f4 + 8001ca6: d80e bhi.n 8001cc6 + { + if(pObj->IO.ReadReg(pObj->DevAddr, DP83848_BCR, ®value) < 0) + 8001ca8: 687b ldr r3, [r7, #4] + 8001caa: 695b ldr r3, [r3, #20] + 8001cac: 687a ldr r2, [r7, #4] + 8001cae: 6810 ldr r0, [r2, #0] + 8001cb0: f107 0208 add.w r2, r7, #8 + 8001cb4: 2100 movs r1, #0 + 8001cb6: 4798 blx r3 + 8001cb8: 4603 mov r3, r0 + 8001cba: 2b00 cmp r3, #0 + 8001cbc: da07 bge.n 8001cce + { + status = DP83848_STATUS_READ_ERROR; + 8001cbe: f06f 0304 mvn.w r3, #4 + 8001cc2: 613b str r3, [r7, #16] + break; + 8001cc4: e010 b.n 8001ce8 + } + } + else + { + status = DP83848_STATUS_RESET_TIMEOUT; + 8001cc6: f06f 0301 mvn.w r3, #1 + 8001cca: 613b str r3, [r7, #16] + break; + 8001ccc: e00c b.n 8001ce8 + while(regvalue & DP83848_BCR_SOFT_RESET) + 8001cce: 68bb ldr r3, [r7, #8] + 8001cd0: f403 4300 and.w r3, r3, #32768 @ 0x8000 + 8001cd4: 2b00 cmp r3, #0 + 8001cd6: d1dd bne.n 8001c94 + 8001cd8: e006 b.n 8001ce8 + } + } + } + else + { + status = DP83848_STATUS_READ_ERROR; + 8001cda: f06f 0304 mvn.w r3, #4 + 8001cde: 613b str r3, [r7, #16] + 8001ce0: e002 b.n 8001ce8 + } + } + else + { + status = DP83848_STATUS_WRITE_ERROR; + 8001ce2: f06f 0303 mvn.w r3, #3 + 8001ce6: 613b str r3, [r7, #16] + } + } + } + + if(status == DP83848_STATUS_OK) + 8001ce8: 693b ldr r3, [r7, #16] + 8001cea: 2b00 cmp r3, #0 + 8001cec: d112 bne.n 8001d14 + { + tickstart = pObj->IO.GetTick(); + 8001cee: 687b ldr r3, [r7, #4] + 8001cf0: 699b ldr r3, [r3, #24] + 8001cf2: 4798 blx r3 + 8001cf4: 4603 mov r3, r0 + 8001cf6: 60fb str r3, [r7, #12] + + /* Wait for 2s to perform initialization */ + while((pObj->IO.GetTick() - tickstart) <= DP83848_INIT_TO) + 8001cf8: bf00 nop + 8001cfa: 687b ldr r3, [r7, #4] + 8001cfc: 699b ldr r3, [r3, #24] + 8001cfe: 4798 blx r3 + 8001d00: 4603 mov r3, r0 + 8001d02: 461a mov r2, r3 + 8001d04: 68fb ldr r3, [r7, #12] + 8001d06: 1ad3 subs r3, r2, r3 + 8001d08: f5b3 6ffa cmp.w r3, #2000 @ 0x7d0 + 8001d0c: d9f5 bls.n 8001cfa + { + } + pObj->Is_Initialized = 1; + 8001d0e: 687b ldr r3, [r7, #4] + 8001d10: 2201 movs r2, #1 + 8001d12: 605a str r2, [r3, #4] + } + + return status; + 8001d14: 693b ldr r3, [r7, #16] + } + 8001d16: 4618 mov r0, r3 + 8001d18: 3718 adds r7, #24 + 8001d1a: 46bd mov sp, r7 + 8001d1c: bd80 pop {r7, pc} + +08001d1e : + * DP83848_STATUS_10MBITS_HALFDUPLEX if 10Mb/s HD + * DP83848_STATUS_READ_ERROR if connot read register + * DP83848_STATUS_WRITE_ERROR if connot write to register + */ +int32_t DP83848_GetLinkState(dp83848_Object_t *pObj) +{ + 8001d1e: b580 push {r7, lr} + 8001d20: b084 sub sp, #16 + 8001d22: af00 add r7, sp, #0 + 8001d24: 6078 str r0, [r7, #4] + uint32_t readval = 0; + 8001d26: 2300 movs r3, #0 + 8001d28: 60fb str r3, [r7, #12] + + /* Read Status register */ + if(pObj->IO.ReadReg(pObj->DevAddr, DP83848_BSR, &readval) < 0) + 8001d2a: 687b ldr r3, [r7, #4] + 8001d2c: 695b ldr r3, [r3, #20] + 8001d2e: 687a ldr r2, [r7, #4] + 8001d30: 6810 ldr r0, [r2, #0] + 8001d32: f107 020c add.w r2, r7, #12 + 8001d36: 2101 movs r1, #1 + 8001d38: 4798 blx r3 + 8001d3a: 4603 mov r3, r0 + 8001d3c: 2b00 cmp r3, #0 + 8001d3e: da02 bge.n 8001d46 + { + return DP83848_STATUS_READ_ERROR; + 8001d40: f06f 0304 mvn.w r3, #4 + 8001d44: e06e b.n 8001e24 + } + + /* Read Status register again */ + if(pObj->IO.ReadReg(pObj->DevAddr, DP83848_BSR, &readval) < 0) + 8001d46: 687b ldr r3, [r7, #4] + 8001d48: 695b ldr r3, [r3, #20] + 8001d4a: 687a ldr r2, [r7, #4] + 8001d4c: 6810 ldr r0, [r2, #0] + 8001d4e: f107 020c add.w r2, r7, #12 + 8001d52: 2101 movs r1, #1 + 8001d54: 4798 blx r3 + 8001d56: 4603 mov r3, r0 + 8001d58: 2b00 cmp r3, #0 + 8001d5a: da02 bge.n 8001d62 + { + return DP83848_STATUS_READ_ERROR; + 8001d5c: f06f 0304 mvn.w r3, #4 + 8001d60: e060 b.n 8001e24 + } + + if((readval & DP83848_BSR_LINK_STATUS) == 0) + 8001d62: 68fb ldr r3, [r7, #12] + 8001d64: f003 0304 and.w r3, r3, #4 + 8001d68: 2b00 cmp r3, #0 + 8001d6a: d101 bne.n 8001d70 + { + /* Return Link Down status */ + return DP83848_STATUS_LINK_DOWN; + 8001d6c: 2301 movs r3, #1 + 8001d6e: e059 b.n 8001e24 + } + + /* Check Auto negotiaition */ + if(pObj->IO.ReadReg(pObj->DevAddr, DP83848_BCR, &readval) < 0) + 8001d70: 687b ldr r3, [r7, #4] + 8001d72: 695b ldr r3, [r3, #20] + 8001d74: 687a ldr r2, [r7, #4] + 8001d76: 6810 ldr r0, [r2, #0] + 8001d78: f107 020c add.w r2, r7, #12 + 8001d7c: 2100 movs r1, #0 + 8001d7e: 4798 blx r3 + 8001d80: 4603 mov r3, r0 + 8001d82: 2b00 cmp r3, #0 + 8001d84: da02 bge.n 8001d8c + { + return DP83848_STATUS_READ_ERROR; + 8001d86: f06f 0304 mvn.w r3, #4 + 8001d8a: e04b b.n 8001e24 + } + + if((readval & DP83848_BCR_AUTONEGO_EN) != DP83848_BCR_AUTONEGO_EN) + 8001d8c: 68fb ldr r3, [r7, #12] + 8001d8e: f403 5380 and.w r3, r3, #4096 @ 0x1000 + 8001d92: 2b00 cmp r3, #0 + 8001d94: d11b bne.n 8001dce + { + if(((readval & DP83848_BCR_SPEED_SELECT) == DP83848_BCR_SPEED_SELECT) && ((readval & DP83848_BCR_DUPLEX_MODE) == DP83848_BCR_DUPLEX_MODE)) + 8001d96: 68fb ldr r3, [r7, #12] + 8001d98: f403 5300 and.w r3, r3, #8192 @ 0x2000 + 8001d9c: 2b00 cmp r3, #0 + 8001d9e: d006 beq.n 8001dae + 8001da0: 68fb ldr r3, [r7, #12] + 8001da2: f403 7380 and.w r3, r3, #256 @ 0x100 + 8001da6: 2b00 cmp r3, #0 + 8001da8: d001 beq.n 8001dae + { + return DP83848_STATUS_100MBITS_FULLDUPLEX; + 8001daa: 2302 movs r3, #2 + 8001dac: e03a b.n 8001e24 + } + else if ((readval & DP83848_BCR_SPEED_SELECT) == DP83848_BCR_SPEED_SELECT) + 8001dae: 68fb ldr r3, [r7, #12] + 8001db0: f403 5300 and.w r3, r3, #8192 @ 0x2000 + 8001db4: 2b00 cmp r3, #0 + 8001db6: d001 beq.n 8001dbc + { + return DP83848_STATUS_100MBITS_HALFDUPLEX; + 8001db8: 2303 movs r3, #3 + 8001dba: e033 b.n 8001e24 + } + else if ((readval & DP83848_BCR_DUPLEX_MODE) == DP83848_BCR_DUPLEX_MODE) + 8001dbc: 68fb ldr r3, [r7, #12] + 8001dbe: f403 7380 and.w r3, r3, #256 @ 0x100 + 8001dc2: 2b00 cmp r3, #0 + 8001dc4: d001 beq.n 8001dca + { + return DP83848_STATUS_10MBITS_FULLDUPLEX; + 8001dc6: 2304 movs r3, #4 + 8001dc8: e02c b.n 8001e24 + } + else + { + return DP83848_STATUS_10MBITS_HALFDUPLEX; + 8001dca: 2305 movs r3, #5 + 8001dcc: e02a b.n 8001e24 + } + } + else /* Auto Nego enabled */ + { + if(pObj->IO.ReadReg(pObj->DevAddr, DP83848_PHYSCSR, &readval) < 0) + 8001dce: 687b ldr r3, [r7, #4] + 8001dd0: 695b ldr r3, [r3, #20] + 8001dd2: 687a ldr r2, [r7, #4] + 8001dd4: 6810 ldr r0, [r2, #0] + 8001dd6: f107 020c add.w r2, r7, #12 + 8001dda: 2110 movs r1, #16 + 8001ddc: 4798 blx r3 + 8001dde: 4603 mov r3, r0 + 8001de0: 2b00 cmp r3, #0 + 8001de2: da02 bge.n 8001dea + { + return DP83848_STATUS_READ_ERROR; + 8001de4: f06f 0304 mvn.w r3, #4 + 8001de8: e01c b.n 8001e24 + } + + /* Check if auto nego not done */ + if((readval & DP83848_PHYSCSR_AUTONEGO_DONE) == 0) + 8001dea: 68fb ldr r3, [r7, #12] + 8001dec: f403 7380 and.w r3, r3, #256 @ 0x100 + 8001df0: 2b00 cmp r3, #0 + 8001df2: d101 bne.n 8001df8 + { + return DP83848_STATUS_AUTONEGO_NOTDONE; + 8001df4: 2306 movs r3, #6 + 8001df6: e015 b.n 8001e24 + } + + if((readval & DP83848_PHYSCSR_HCDSPEEDMASK) == DP83848_PHYSCSR_100BTX_FD) + 8001df8: 68fb ldr r3, [r7, #12] + 8001dfa: f003 0306 and.w r3, r3, #6 + 8001dfe: 2b04 cmp r3, #4 + 8001e00: d101 bne.n 8001e06 + { + return DP83848_STATUS_100MBITS_FULLDUPLEX; + 8001e02: 2302 movs r3, #2 + 8001e04: e00e b.n 8001e24 + } + else if ((readval & DP83848_PHYSCSR_HCDSPEEDMASK) == DP83848_PHYSCSR_100BTX_HD) + 8001e06: 68fb ldr r3, [r7, #12] + 8001e08: f003 0306 and.w r3, r3, #6 + 8001e0c: 2b00 cmp r3, #0 + 8001e0e: d101 bne.n 8001e14 + { + return DP83848_STATUS_100MBITS_HALFDUPLEX; + 8001e10: 2303 movs r3, #3 + 8001e12: e007 b.n 8001e24 + } + else if ((readval & DP83848_PHYSCSR_HCDSPEEDMASK) == DP83848_PHYSCSR_10BT_FD) + 8001e14: 68fb ldr r3, [r7, #12] + 8001e16: f003 0306 and.w r3, r3, #6 + 8001e1a: 2b06 cmp r3, #6 + 8001e1c: d101 bne.n 8001e22 + { + return DP83848_STATUS_10MBITS_FULLDUPLEX; + 8001e1e: 2304 movs r3, #4 + 8001e20: e000 b.n 8001e24 + } + else + { + return DP83848_STATUS_10MBITS_HALFDUPLEX; + 8001e22: 2305 movs r3, #5 + } + } +} + 8001e24: 4618 mov r0, r3 + 8001e26: 3710 adds r7, #16 + 8001e28: 46bd mov sp, r7 + 8001e2a: bd80 pop {r7, pc} + +08001e2c : + * need to ensure that the SysTick time base is always set to 1 millisecond + * to have correct HAL operation. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_Init(void) +{ + 8001e2c: b580 push {r7, lr} + 8001e2e: af00 add r7, sp, #0 + /* Configure Flash prefetch, Instruction cache, Data cache */ +#if (INSTRUCTION_CACHE_ENABLE != 0U) + __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); + 8001e30: 4b0e ldr r3, [pc, #56] @ (8001e6c ) + 8001e32: 681b ldr r3, [r3, #0] + 8001e34: 4a0d ldr r2, [pc, #52] @ (8001e6c ) + 8001e36: f443 7300 orr.w r3, r3, #512 @ 0x200 + 8001e3a: 6013 str r3, [r2, #0] +#endif /* INSTRUCTION_CACHE_ENABLE */ + +#if (DATA_CACHE_ENABLE != 0U) + __HAL_FLASH_DATA_CACHE_ENABLE(); + 8001e3c: 4b0b ldr r3, [pc, #44] @ (8001e6c ) + 8001e3e: 681b ldr r3, [r3, #0] + 8001e40: 4a0a ldr r2, [pc, #40] @ (8001e6c ) + 8001e42: f443 6380 orr.w r3, r3, #1024 @ 0x400 + 8001e46: 6013 str r3, [r2, #0] +#endif /* DATA_CACHE_ENABLE */ + +#if (PREFETCH_ENABLE != 0U) + __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); + 8001e48: 4b08 ldr r3, [pc, #32] @ (8001e6c ) + 8001e4a: 681b ldr r3, [r3, #0] + 8001e4c: 4a07 ldr r2, [pc, #28] @ (8001e6c ) + 8001e4e: f443 7380 orr.w r3, r3, #256 @ 0x100 + 8001e52: 6013 str r3, [r2, #0] +#endif /* PREFETCH_ENABLE */ + + /* Set Interrupt Group Priority */ + HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); + 8001e54: 2003 movs r0, #3 + 8001e56: f000 f94f bl 80020f8 + + /* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */ + HAL_InitTick(TICK_INT_PRIORITY); + 8001e5a: 200f movs r0, #15 + 8001e5c: f000 f808 bl 8001e70 + + /* Init the low level hardware */ + HAL_MspInit(); + 8001e60: f7ff fd34 bl 80018cc + + /* Return function status */ + return HAL_OK; + 8001e64: 2300 movs r3, #0 +} + 8001e66: 4618 mov r0, r3 + 8001e68: bd80 pop {r7, pc} + 8001e6a: bf00 nop + 8001e6c: 40023c00 .word 0x40023c00 + +08001e70 : + * implementation in user file. + * @param TickPriority Tick interrupt priority. + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) +{ + 8001e70: b580 push {r7, lr} + 8001e72: b082 sub sp, #8 + 8001e74: af00 add r7, sp, #0 + 8001e76: 6078 str r0, [r7, #4] + /* Configure the SysTick to have interrupt in 1ms time basis*/ + if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U) + 8001e78: 4b12 ldr r3, [pc, #72] @ (8001ec4 ) + 8001e7a: 681a ldr r2, [r3, #0] + 8001e7c: 4b12 ldr r3, [pc, #72] @ (8001ec8 ) + 8001e7e: 781b ldrb r3, [r3, #0] + 8001e80: 4619 mov r1, r3 + 8001e82: f44f 737a mov.w r3, #1000 @ 0x3e8 + 8001e86: fbb3 f3f1 udiv r3, r3, r1 + 8001e8a: fbb2 f3f3 udiv r3, r2, r3 + 8001e8e: 4618 mov r0, r3 + 8001e90: f000 f967 bl 8002162 + 8001e94: 4603 mov r3, r0 + 8001e96: 2b00 cmp r3, #0 + 8001e98: d001 beq.n 8001e9e + { + return HAL_ERROR; + 8001e9a: 2301 movs r3, #1 + 8001e9c: e00e b.n 8001ebc + } + + /* Configure the SysTick IRQ priority */ + if (TickPriority < (1UL << __NVIC_PRIO_BITS)) + 8001e9e: 687b ldr r3, [r7, #4] + 8001ea0: 2b0f cmp r3, #15 + 8001ea2: d80a bhi.n 8001eba + { + HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U); + 8001ea4: 2200 movs r2, #0 + 8001ea6: 6879 ldr r1, [r7, #4] + 8001ea8: f04f 30ff mov.w r0, #4294967295 + 8001eac: f000 f92f bl 800210e + uwTickPrio = TickPriority; + 8001eb0: 4a06 ldr r2, [pc, #24] @ (8001ecc ) + 8001eb2: 687b ldr r3, [r7, #4] + 8001eb4: 6013 str r3, [r2, #0] + { + return HAL_ERROR; + } + + /* Return function status */ + return HAL_OK; + 8001eb6: 2300 movs r3, #0 + 8001eb8: e000 b.n 8001ebc + return HAL_ERROR; + 8001eba: 2301 movs r3, #1 +} + 8001ebc: 4618 mov r0, r3 + 8001ebe: 3708 adds r7, #8 + 8001ec0: 46bd mov sp, r7 + 8001ec2: bd80 pop {r7, pc} + 8001ec4: 20000000 .word 0x20000000 + 8001ec8: 20000008 .word 0x20000008 + 8001ecc: 20000004 .word 0x20000004 + +08001ed0 : + * @note This function is declared as __weak to be overwritten in case of other + * implementations in user file. + * @retval None + */ +__weak void HAL_IncTick(void) +{ + 8001ed0: b480 push {r7} + 8001ed2: af00 add r7, sp, #0 + uwTick += uwTickFreq; + 8001ed4: 4b06 ldr r3, [pc, #24] @ (8001ef0 ) + 8001ed6: 781b ldrb r3, [r3, #0] + 8001ed8: 461a mov r2, r3 + 8001eda: 4b06 ldr r3, [pc, #24] @ (8001ef4 ) + 8001edc: 681b ldr r3, [r3, #0] + 8001ede: 4413 add r3, r2 + 8001ee0: 4a04 ldr r2, [pc, #16] @ (8001ef4 ) + 8001ee2: 6013 str r3, [r2, #0] +} + 8001ee4: bf00 nop + 8001ee6: 46bd mov sp, r7 + 8001ee8: f85d 7b04 ldr.w r7, [sp], #4 + 8001eec: 4770 bx lr + 8001eee: bf00 nop + 8001ef0: 20000008 .word 0x20000008 + 8001ef4: 2000152c .word 0x2000152c + +08001ef8 : + * @note This function is declared as __weak to be overwritten in case of other + * implementations in user file. + * @retval tick value + */ +__weak uint32_t HAL_GetTick(void) +{ + 8001ef8: b480 push {r7} + 8001efa: af00 add r7, sp, #0 + return uwTick; + 8001efc: 4b03 ldr r3, [pc, #12] @ (8001f0c ) + 8001efe: 681b ldr r3, [r3, #0] +} + 8001f00: 4618 mov r0, r3 + 8001f02: 46bd mov sp, r7 + 8001f04: f85d 7b04 ldr.w r7, [sp], #4 + 8001f08: 4770 bx lr + 8001f0a: bf00 nop + 8001f0c: 2000152c .word 0x2000152c + +08001f10 : + * implementations in user file. + * @param Delay specifies the delay time length, in milliseconds. + * @retval None + */ +__weak void HAL_Delay(uint32_t Delay) +{ + 8001f10: b580 push {r7, lr} + 8001f12: b084 sub sp, #16 + 8001f14: af00 add r7, sp, #0 + 8001f16: 6078 str r0, [r7, #4] + uint32_t tickstart = HAL_GetTick(); + 8001f18: f7ff ffee bl 8001ef8 + 8001f1c: 60b8 str r0, [r7, #8] + uint32_t wait = Delay; + 8001f1e: 687b ldr r3, [r7, #4] + 8001f20: 60fb str r3, [r7, #12] + + /* Add a freq to guarantee minimum wait */ + if (wait < HAL_MAX_DELAY) + 8001f22: 68fb ldr r3, [r7, #12] + 8001f24: f1b3 3fff cmp.w r3, #4294967295 + 8001f28: d005 beq.n 8001f36 + { + wait += (uint32_t)(uwTickFreq); + 8001f2a: 4b0a ldr r3, [pc, #40] @ (8001f54 ) + 8001f2c: 781b ldrb r3, [r3, #0] + 8001f2e: 461a mov r2, r3 + 8001f30: 68fb ldr r3, [r7, #12] + 8001f32: 4413 add r3, r2 + 8001f34: 60fb str r3, [r7, #12] + } + + while((HAL_GetTick() - tickstart) < wait) + 8001f36: bf00 nop + 8001f38: f7ff ffde bl 8001ef8 + 8001f3c: 4602 mov r2, r0 + 8001f3e: 68bb ldr r3, [r7, #8] + 8001f40: 1ad3 subs r3, r2, r3 + 8001f42: 68fa ldr r2, [r7, #12] + 8001f44: 429a cmp r2, r3 + 8001f46: d8f7 bhi.n 8001f38 + { + } +} + 8001f48: bf00 nop + 8001f4a: bf00 nop + 8001f4c: 3710 adds r7, #16 + 8001f4e: 46bd mov sp, r7 + 8001f50: bd80 pop {r7, pc} + 8001f52: bf00 nop + 8001f54: 20000008 .word 0x20000008 + +08001f58 <__NVIC_SetPriorityGrouping>: + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + 8001f58: b480 push {r7} + 8001f5a: b085 sub sp, #20 + 8001f5c: af00 add r7, sp, #0 + 8001f5e: 6078 str r0, [r7, #4] + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + 8001f60: 687b ldr r3, [r7, #4] + 8001f62: f003 0307 and.w r3, r3, #7 + 8001f66: 60fb str r3, [r7, #12] + + reg_value = SCB->AIRCR; /* read old register configuration */ + 8001f68: 4b0c ldr r3, [pc, #48] @ (8001f9c <__NVIC_SetPriorityGrouping+0x44>) + 8001f6a: 68db ldr r3, [r3, #12] + 8001f6c: 60bb str r3, [r7, #8] + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + 8001f6e: 68ba ldr r2, [r7, #8] + 8001f70: f64f 03ff movw r3, #63743 @ 0xf8ff + 8001f74: 4013 ands r3, r2 + 8001f76: 60bb str r3, [r7, #8] + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + 8001f78: 68fb ldr r3, [r7, #12] + 8001f7a: 021a lsls r2, r3, #8 + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + 8001f7c: 68bb ldr r3, [r7, #8] + 8001f7e: 4313 orrs r3, r2 + reg_value = (reg_value | + 8001f80: f043 63bf orr.w r3, r3, #100139008 @ 0x5f80000 + 8001f84: f443 3300 orr.w r3, r3, #131072 @ 0x20000 + 8001f88: 60bb str r3, [r7, #8] + SCB->AIRCR = reg_value; + 8001f8a: 4a04 ldr r2, [pc, #16] @ (8001f9c <__NVIC_SetPriorityGrouping+0x44>) + 8001f8c: 68bb ldr r3, [r7, #8] + 8001f8e: 60d3 str r3, [r2, #12] +} + 8001f90: bf00 nop + 8001f92: 3714 adds r7, #20 + 8001f94: 46bd mov sp, r7 + 8001f96: f85d 7b04 ldr.w r7, [sp], #4 + 8001f9a: 4770 bx lr + 8001f9c: e000ed00 .word 0xe000ed00 + +08001fa0 <__NVIC_GetPriorityGrouping>: + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + 8001fa0: b480 push {r7} + 8001fa2: af00 add r7, sp, #0 + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); + 8001fa4: 4b04 ldr r3, [pc, #16] @ (8001fb8 <__NVIC_GetPriorityGrouping+0x18>) + 8001fa6: 68db ldr r3, [r3, #12] + 8001fa8: 0a1b lsrs r3, r3, #8 + 8001faa: f003 0307 and.w r3, r3, #7 +} + 8001fae: 4618 mov r0, r3 + 8001fb0: 46bd mov sp, r7 + 8001fb2: f85d 7b04 ldr.w r7, [sp], #4 + 8001fb6: 4770 bx lr + 8001fb8: e000ed00 .word 0xe000ed00 + +08001fbc <__NVIC_EnableIRQ>: + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + 8001fbc: b480 push {r7} + 8001fbe: b083 sub sp, #12 + 8001fc0: af00 add r7, sp, #0 + 8001fc2: 4603 mov r3, r0 + 8001fc4: 71fb strb r3, [r7, #7] + if ((int32_t)(IRQn) >= 0) + 8001fc6: f997 3007 ldrsb.w r3, [r7, #7] + 8001fca: 2b00 cmp r3, #0 + 8001fcc: db0b blt.n 8001fe6 <__NVIC_EnableIRQ+0x2a> + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + 8001fce: 79fb ldrb r3, [r7, #7] + 8001fd0: f003 021f and.w r2, r3, #31 + 8001fd4: 4907 ldr r1, [pc, #28] @ (8001ff4 <__NVIC_EnableIRQ+0x38>) + 8001fd6: f997 3007 ldrsb.w r3, [r7, #7] + 8001fda: 095b lsrs r3, r3, #5 + 8001fdc: 2001 movs r0, #1 + 8001fde: fa00 f202 lsl.w r2, r0, r2 + 8001fe2: f841 2023 str.w r2, [r1, r3, lsl #2] + } +} + 8001fe6: bf00 nop + 8001fe8: 370c adds r7, #12 + 8001fea: 46bd mov sp, r7 + 8001fec: f85d 7b04 ldr.w r7, [sp], #4 + 8001ff0: 4770 bx lr + 8001ff2: bf00 nop + 8001ff4: e000e100 .word 0xe000e100 + +08001ff8 <__NVIC_SetPriority>: + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + 8001ff8: b480 push {r7} + 8001ffa: b083 sub sp, #12 + 8001ffc: af00 add r7, sp, #0 + 8001ffe: 4603 mov r3, r0 + 8002000: 6039 str r1, [r7, #0] + 8002002: 71fb strb r3, [r7, #7] + if ((int32_t)(IRQn) >= 0) + 8002004: f997 3007 ldrsb.w r3, [r7, #7] + 8002008: 2b00 cmp r3, #0 + 800200a: db0a blt.n 8002022 <__NVIC_SetPriority+0x2a> + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + 800200c: 683b ldr r3, [r7, #0] + 800200e: b2da uxtb r2, r3 + 8002010: 490c ldr r1, [pc, #48] @ (8002044 <__NVIC_SetPriority+0x4c>) + 8002012: f997 3007 ldrsb.w r3, [r7, #7] + 8002016: 0112 lsls r2, r2, #4 + 8002018: b2d2 uxtb r2, r2 + 800201a: 440b add r3, r1 + 800201c: f883 2300 strb.w r2, [r3, #768] @ 0x300 + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + 8002020: e00a b.n 8002038 <__NVIC_SetPriority+0x40> + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + 8002022: 683b ldr r3, [r7, #0] + 8002024: b2da uxtb r2, r3 + 8002026: 4908 ldr r1, [pc, #32] @ (8002048 <__NVIC_SetPriority+0x50>) + 8002028: 79fb ldrb r3, [r7, #7] + 800202a: f003 030f and.w r3, r3, #15 + 800202e: 3b04 subs r3, #4 + 8002030: 0112 lsls r2, r2, #4 + 8002032: b2d2 uxtb r2, r2 + 8002034: 440b add r3, r1 + 8002036: 761a strb r2, [r3, #24] +} + 8002038: bf00 nop + 800203a: 370c adds r7, #12 + 800203c: 46bd mov sp, r7 + 800203e: f85d 7b04 ldr.w r7, [sp], #4 + 8002042: 4770 bx lr + 8002044: e000e100 .word 0xe000e100 + 8002048: e000ed00 .word 0xe000ed00 + +0800204c : + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + 800204c: b480 push {r7} + 800204e: b089 sub sp, #36 @ 0x24 + 8002050: af00 add r7, sp, #0 + 8002052: 60f8 str r0, [r7, #12] + 8002054: 60b9 str r1, [r7, #8] + 8002056: 607a str r2, [r7, #4] + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + 8002058: 68fb ldr r3, [r7, #12] + 800205a: f003 0307 and.w r3, r3, #7 + 800205e: 61fb str r3, [r7, #28] + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + 8002060: 69fb ldr r3, [r7, #28] + 8002062: f1c3 0307 rsb r3, r3, #7 + 8002066: 2b04 cmp r3, #4 + 8002068: bf28 it cs + 800206a: 2304 movcs r3, #4 + 800206c: 61bb str r3, [r7, #24] + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + 800206e: 69fb ldr r3, [r7, #28] + 8002070: 3304 adds r3, #4 + 8002072: 2b06 cmp r3, #6 + 8002074: d902 bls.n 800207c + 8002076: 69fb ldr r3, [r7, #28] + 8002078: 3b03 subs r3, #3 + 800207a: e000 b.n 800207e + 800207c: 2300 movs r3, #0 + 800207e: 617b str r3, [r7, #20] + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + 8002080: f04f 32ff mov.w r2, #4294967295 + 8002084: 69bb ldr r3, [r7, #24] + 8002086: fa02 f303 lsl.w r3, r2, r3 + 800208a: 43da mvns r2, r3 + 800208c: 68bb ldr r3, [r7, #8] + 800208e: 401a ands r2, r3 + 8002090: 697b ldr r3, [r7, #20] + 8002092: 409a lsls r2, r3 + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + 8002094: f04f 31ff mov.w r1, #4294967295 + 8002098: 697b ldr r3, [r7, #20] + 800209a: fa01 f303 lsl.w r3, r1, r3 + 800209e: 43d9 mvns r1, r3 + 80020a0: 687b ldr r3, [r7, #4] + 80020a2: 400b ands r3, r1 + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + 80020a4: 4313 orrs r3, r2 + ); +} + 80020a6: 4618 mov r0, r3 + 80020a8: 3724 adds r7, #36 @ 0x24 + 80020aa: 46bd mov sp, r7 + 80020ac: f85d 7b04 ldr.w r7, [sp], #4 + 80020b0: 4770 bx lr + ... + +080020b4 : + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + 80020b4: b580 push {r7, lr} + 80020b6: b082 sub sp, #8 + 80020b8: af00 add r7, sp, #0 + 80020ba: 6078 str r0, [r7, #4] + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + 80020bc: 687b ldr r3, [r7, #4] + 80020be: 3b01 subs r3, #1 + 80020c0: f1b3 7f80 cmp.w r3, #16777216 @ 0x1000000 + 80020c4: d301 bcc.n 80020ca + { + return (1UL); /* Reload value impossible */ + 80020c6: 2301 movs r3, #1 + 80020c8: e00f b.n 80020ea + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + 80020ca: 4a0a ldr r2, [pc, #40] @ (80020f4 ) + 80020cc: 687b ldr r3, [r7, #4] + 80020ce: 3b01 subs r3, #1 + 80020d0: 6053 str r3, [r2, #4] + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + 80020d2: 210f movs r1, #15 + 80020d4: f04f 30ff mov.w r0, #4294967295 + 80020d8: f7ff ff8e bl 8001ff8 <__NVIC_SetPriority> + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + 80020dc: 4b05 ldr r3, [pc, #20] @ (80020f4 ) + 80020de: 2200 movs r2, #0 + 80020e0: 609a str r2, [r3, #8] + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + 80020e2: 4b04 ldr r3, [pc, #16] @ (80020f4 ) + 80020e4: 2207 movs r2, #7 + 80020e6: 601a str r2, [r3, #0] + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ + 80020e8: 2300 movs r3, #0 +} + 80020ea: 4618 mov r0, r3 + 80020ec: 3708 adds r7, #8 + 80020ee: 46bd mov sp, r7 + 80020f0: bd80 pop {r7, pc} + 80020f2: bf00 nop + 80020f4: e000e010 .word 0xe000e010 + +080020f8 : + * @note When the NVIC_PriorityGroup_0 is selected, IRQ preemption is no more possible. + * The pending IRQ priority will be managed only by the subpriority. + * @retval None + */ +void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + 80020f8: b580 push {r7, lr} + 80020fa: b082 sub sp, #8 + 80020fc: af00 add r7, sp, #0 + 80020fe: 6078 str r0, [r7, #4] + /* Check the parameters */ + assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup)); + + /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */ + NVIC_SetPriorityGrouping(PriorityGroup); + 8002100: 6878 ldr r0, [r7, #4] + 8002102: f7ff ff29 bl 8001f58 <__NVIC_SetPriorityGrouping> +} + 8002106: bf00 nop + 8002108: 3708 adds r7, #8 + 800210a: 46bd mov sp, r7 + 800210c: bd80 pop {r7, pc} + +0800210e : + * This parameter can be a value between 0 and 15 + * A lower priority value indicates a higher priority. + * @retval None + */ +void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority) +{ + 800210e: b580 push {r7, lr} + 8002110: b086 sub sp, #24 + 8002112: af00 add r7, sp, #0 + 8002114: 4603 mov r3, r0 + 8002116: 60b9 str r1, [r7, #8] + 8002118: 607a str r2, [r7, #4] + 800211a: 73fb strb r3, [r7, #15] + uint32_t prioritygroup = 0x00U; + 800211c: 2300 movs r3, #0 + 800211e: 617b str r3, [r7, #20] + + /* Check the parameters */ + assert_param(IS_NVIC_SUB_PRIORITY(SubPriority)); + assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority)); + + prioritygroup = NVIC_GetPriorityGrouping(); + 8002120: f7ff ff3e bl 8001fa0 <__NVIC_GetPriorityGrouping> + 8002124: 6178 str r0, [r7, #20] + + NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority)); + 8002126: 687a ldr r2, [r7, #4] + 8002128: 68b9 ldr r1, [r7, #8] + 800212a: 6978 ldr r0, [r7, #20] + 800212c: f7ff ff8e bl 800204c + 8002130: 4602 mov r2, r0 + 8002132: f997 300f ldrsb.w r3, [r7, #15] + 8002136: 4611 mov r1, r2 + 8002138: 4618 mov r0, r3 + 800213a: f7ff ff5d bl 8001ff8 <__NVIC_SetPriority> +} + 800213e: bf00 nop + 8002140: 3718 adds r7, #24 + 8002142: 46bd mov sp, r7 + 8002144: bd80 pop {r7, pc} + +08002146 : + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) + * @retval None + */ +void HAL_NVIC_EnableIRQ(IRQn_Type IRQn) +{ + 8002146: b580 push {r7, lr} + 8002148: b082 sub sp, #8 + 800214a: af00 add r7, sp, #0 + 800214c: 4603 mov r3, r0 + 800214e: 71fb strb r3, [r7, #7] + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + + /* Enable interrupt */ + NVIC_EnableIRQ(IRQn); + 8002150: f997 3007 ldrsb.w r3, [r7, #7] + 8002154: 4618 mov r0, r3 + 8002156: f7ff ff31 bl 8001fbc <__NVIC_EnableIRQ> +} + 800215a: bf00 nop + 800215c: 3708 adds r7, #8 + 800215e: 46bd mov sp, r7 + 8002160: bd80 pop {r7, pc} + +08002162 : + * @param TicksNumb Specifies the ticks Number of ticks between two interrupts. + * @retval status: - 0 Function succeeded. + * - 1 Function failed. + */ +uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb) +{ + 8002162: b580 push {r7, lr} + 8002164: b082 sub sp, #8 + 8002166: af00 add r7, sp, #0 + 8002168: 6078 str r0, [r7, #4] + return SysTick_Config(TicksNumb); + 800216a: 6878 ldr r0, [r7, #4] + 800216c: f7ff ffa2 bl 80020b4 + 8002170: 4603 mov r3, r0 +} + 8002172: 4618 mov r0, r3 + 8002174: 3708 adds r7, #8 + 8002176: 46bd mov sp, r7 + 8002178: bd80 pop {r7, pc} + ... + +0800217c : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth) +{ + 800217c: b580 push {r7, lr} + 800217e: b084 sub sp, #16 + 8002180: af00 add r7, sp, #0 + 8002182: 6078 str r0, [r7, #4] + uint32_t tickstart; + + if (heth == NULL) + 8002184: 687b ldr r3, [r7, #4] + 8002186: 2b00 cmp r3, #0 + 8002188: d101 bne.n 800218e + { + return HAL_ERROR; + 800218a: 2301 movs r3, #1 + 800218c: e06c b.n 8002268 + } + if (heth->gState == HAL_ETH_STATE_RESET) + 800218e: 687b ldr r3, [r7, #4] + 8002190: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8002194: 2b00 cmp r3, #0 + 8002196: d106 bne.n 80021a6 + { + heth->gState = HAL_ETH_STATE_BUSY; + 8002198: 687b ldr r3, [r7, #4] + 800219a: 2223 movs r2, #35 @ 0x23 + 800219c: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + + /* Init the low level hardware */ + heth->MspInitCallback(heth); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC. */ + HAL_ETH_MspInit(heth); + 80021a0: 6878 ldr r0, [r7, #4] + 80021a2: f002 fee1 bl 8004f68 + +#endif /* (USE_HAL_ETH_REGISTER_CALLBACKS) */ + } + + __HAL_RCC_SYSCFG_CLK_ENABLE(); + 80021a6: 2300 movs r3, #0 + 80021a8: 60bb str r3, [r7, #8] + 80021aa: 4b31 ldr r3, [pc, #196] @ (8002270 ) + 80021ac: 6c5b ldr r3, [r3, #68] @ 0x44 + 80021ae: 4a30 ldr r2, [pc, #192] @ (8002270 ) + 80021b0: f443 4380 orr.w r3, r3, #16384 @ 0x4000 + 80021b4: 6453 str r3, [r2, #68] @ 0x44 + 80021b6: 4b2e ldr r3, [pc, #184] @ (8002270 ) + 80021b8: 6c5b ldr r3, [r3, #68] @ 0x44 + 80021ba: f403 4380 and.w r3, r3, #16384 @ 0x4000 + 80021be: 60bb str r3, [r7, #8] + 80021c0: 68bb ldr r3, [r7, #8] + + /* Select MII or RMII Mode*/ + SYSCFG->PMC &= ~(SYSCFG_PMC_MII_RMII_SEL); + 80021c2: 4b2c ldr r3, [pc, #176] @ (8002274 ) + 80021c4: 685b ldr r3, [r3, #4] + 80021c6: 4a2b ldr r2, [pc, #172] @ (8002274 ) + 80021c8: f423 0300 bic.w r3, r3, #8388608 @ 0x800000 + 80021cc: 6053 str r3, [r2, #4] + SYSCFG->PMC |= (uint32_t)heth->Init.MediaInterface; + 80021ce: 4b29 ldr r3, [pc, #164] @ (8002274 ) + 80021d0: 685a ldr r2, [r3, #4] + 80021d2: 687b ldr r3, [r7, #4] + 80021d4: 689b ldr r3, [r3, #8] + 80021d6: 4927 ldr r1, [pc, #156] @ (8002274 ) + 80021d8: 4313 orrs r3, r2 + 80021da: 604b str r3, [r1, #4] + /* Dummy read to sync SYSCFG with ETH */ + (void)SYSCFG->PMC; + 80021dc: 4b25 ldr r3, [pc, #148] @ (8002274 ) + 80021de: 685b ldr r3, [r3, #4] + + /* Ethernet Software reset */ + /* Set the SWR bit: resets all MAC subsystem internal registers and logic */ + /* After reset all the registers holds their respective reset values */ + SET_BIT(heth->Instance->DMABMR, ETH_DMABMR_SR); + 80021e0: 687b ldr r3, [r7, #4] + 80021e2: 681b ldr r3, [r3, #0] + 80021e4: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 80021e8: 681b ldr r3, [r3, #0] + 80021ea: 687a ldr r2, [r7, #4] + 80021ec: 6812 ldr r2, [r2, #0] + 80021ee: f043 0301 orr.w r3, r3, #1 + 80021f2: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 80021f6: 6013 str r3, [r2, #0] + + /* Get tick */ + tickstart = HAL_GetTick(); + 80021f8: f7ff fe7e bl 8001ef8 + 80021fc: 60f8 str r0, [r7, #12] + + /* Wait for software reset */ + while (READ_BIT(heth->Instance->DMABMR, ETH_DMABMR_SR) > 0U) + 80021fe: e011 b.n 8002224 + { + if (((HAL_GetTick() - tickstart) > ETH_SWRESET_TIMEOUT)) + 8002200: f7ff fe7a bl 8001ef8 + 8002204: 4602 mov r2, r0 + 8002206: 68fb ldr r3, [r7, #12] + 8002208: 1ad3 subs r3, r2, r3 + 800220a: f5b3 7ffa cmp.w r3, #500 @ 0x1f4 + 800220e: d909 bls.n 8002224 + { + /* Set Error Code */ + heth->ErrorCode = HAL_ETH_ERROR_TIMEOUT; + 8002210: 687b ldr r3, [r7, #4] + 8002212: 2204 movs r2, #4 + 8002214: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + /* Set State as Error */ + heth->gState = HAL_ETH_STATE_ERROR; + 8002218: 687b ldr r3, [r7, #4] + 800221a: 22e0 movs r2, #224 @ 0xe0 + 800221c: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + /* Return Error */ + return HAL_ERROR; + 8002220: 2301 movs r3, #1 + 8002222: e021 b.n 8002268 + while (READ_BIT(heth->Instance->DMABMR, ETH_DMABMR_SR) > 0U) + 8002224: 687b ldr r3, [r7, #4] + 8002226: 681b ldr r3, [r3, #0] + 8002228: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 800222c: 681b ldr r3, [r3, #0] + 800222e: f003 0301 and.w r3, r3, #1 + 8002232: 2b00 cmp r3, #0 + 8002234: d1e4 bne.n 8002200 + } + } + + + /*------------------ MAC, MTL and DMA default Configuration ----------------*/ + ETH_MACDMAConfig(heth); + 8002236: 6878 ldr r0, [r7, #4] + 8002238: f000 fdf0 bl 8002e1c + + + /*------------------ DMA Tx Descriptors Configuration ----------------------*/ + ETH_DMATxDescListInit(heth); + 800223c: 6878 ldr r0, [r7, #4] + 800223e: f000 fe97 bl 8002f70 + + /*------------------ DMA Rx Descriptors Configuration ----------------------*/ + ETH_DMARxDescListInit(heth); + 8002242: 6878 ldr r0, [r7, #4] + 8002244: f000 feed bl 8003022 + + /*--------------------- ETHERNET MAC Address Configuration ------------------*/ + ETH_MACAddressConfig(heth, ETH_MAC_ADDRESS0, heth->Init.MACAddr); + 8002248: 687b ldr r3, [r7, #4] + 800224a: 685b ldr r3, [r3, #4] + 800224c: 461a mov r2, r3 + 800224e: 2100 movs r1, #0 + 8002250: 6878 ldr r0, [r7, #4] + 8002252: f000 fe55 bl 8002f00 + + heth->ErrorCode = HAL_ETH_ERROR_NONE; + 8002256: 687b ldr r3, [r7, #4] + 8002258: 2200 movs r2, #0 + 800225a: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + heth->gState = HAL_ETH_STATE_READY; + 800225e: 687b ldr r3, [r7, #4] + 8002260: 2210 movs r2, #16 + 8002262: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + + return HAL_OK; + 8002266: 2300 movs r3, #0 +} + 8002268: 4618 mov r0, r3 + 800226a: 3710 adds r7, #16 + 800226c: 46bd mov sp, r7 + 800226e: bd80 pop {r7, pc} + 8002270: 40023800 .word 0x40023800 + 8002274: 40013800 .word 0x40013800 + +08002278 : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_Start(ETH_HandleTypeDef *heth) +{ + 8002278: b580 push {r7, lr} + 800227a: b084 sub sp, #16 + 800227c: af00 add r7, sp, #0 + 800227e: 6078 str r0, [r7, #4] + uint32_t tmpreg1; + + if (heth->gState == HAL_ETH_STATE_READY) + 8002280: 687b ldr r3, [r7, #4] + 8002282: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8002286: 2b10 cmp r3, #16 + 8002288: d150 bne.n 800232c + { + heth->gState = HAL_ETH_STATE_BUSY; + 800228a: 687b ldr r3, [r7, #4] + 800228c: 2223 movs r2, #35 @ 0x23 + 800228e: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + + /* Set nombre of descriptors to build */ + heth->RxDescList.RxBuildDescCnt = ETH_RX_DESC_CNT; + 8002292: 687b ldr r3, [r7, #4] + 8002294: 2204 movs r2, #4 + 8002296: 66da str r2, [r3, #108] @ 0x6c + + /* Build all descriptors */ + ETH_UpdateDescriptor(heth); + 8002298: 6878 ldr r0, [r7, #4] + 800229a: f000 f9fd bl 8002698 + + /* Enable the MAC transmission */ + SET_BIT(heth->Instance->MACCR, ETH_MACCR_TE); + 800229e: 687b ldr r3, [r7, #4] + 80022a0: 681b ldr r3, [r3, #0] + 80022a2: 681a ldr r2, [r3, #0] + 80022a4: 687b ldr r3, [r7, #4] + 80022a6: 681b ldr r3, [r3, #0] + 80022a8: f042 0208 orr.w r2, r2, #8 + 80022ac: 601a str r2, [r3, #0] + + /* Wait until the write operation will be taken into account : + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->MACCR; + 80022ae: 687b ldr r3, [r7, #4] + 80022b0: 681b ldr r3, [r3, #0] + 80022b2: 681b ldr r3, [r3, #0] + 80022b4: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 80022b6: 2001 movs r0, #1 + 80022b8: f7ff fe2a bl 8001f10 + (heth->Instance)->MACCR = tmpreg1; + 80022bc: 687b ldr r3, [r7, #4] + 80022be: 681b ldr r3, [r3, #0] + 80022c0: 68fa ldr r2, [r7, #12] + 80022c2: 601a str r2, [r3, #0] + + /* Enable the MAC reception */ + SET_BIT(heth->Instance->MACCR, ETH_MACCR_RE); + 80022c4: 687b ldr r3, [r7, #4] + 80022c6: 681b ldr r3, [r3, #0] + 80022c8: 681a ldr r2, [r3, #0] + 80022ca: 687b ldr r3, [r7, #4] + 80022cc: 681b ldr r3, [r3, #0] + 80022ce: f042 0204 orr.w r2, r2, #4 + 80022d2: 601a str r2, [r3, #0] + + /* Wait until the write operation will be taken into account : + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->MACCR; + 80022d4: 687b ldr r3, [r7, #4] + 80022d6: 681b ldr r3, [r3, #0] + 80022d8: 681b ldr r3, [r3, #0] + 80022da: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 80022dc: 2001 movs r0, #1 + 80022de: f7ff fe17 bl 8001f10 + (heth->Instance)->MACCR = tmpreg1; + 80022e2: 687b ldr r3, [r7, #4] + 80022e4: 681b ldr r3, [r3, #0] + 80022e6: 68fa ldr r2, [r7, #12] + 80022e8: 601a str r2, [r3, #0] + + /* Flush Transmit FIFO */ + ETH_FlushTransmitFIFO(heth); + 80022ea: 6878 ldr r0, [r7, #4] + 80022ec: f000 fc36 bl 8002b5c + + /* Enable the DMA transmission */ + SET_BIT(heth->Instance->DMAOMR, ETH_DMAOMR_ST); + 80022f0: 687b ldr r3, [r7, #4] + 80022f2: 681b ldr r3, [r3, #0] + 80022f4: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 80022f8: 699b ldr r3, [r3, #24] + 80022fa: 687a ldr r2, [r7, #4] + 80022fc: 6812 ldr r2, [r2, #0] + 80022fe: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 8002302: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 8002306: 6193 str r3, [r2, #24] + + /* Enable the DMA reception */ + SET_BIT(heth->Instance->DMAOMR, ETH_DMAOMR_SR); + 8002308: 687b ldr r3, [r7, #4] + 800230a: 681b ldr r3, [r3, #0] + 800230c: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002310: 699b ldr r3, [r3, #24] + 8002312: 687a ldr r2, [r7, #4] + 8002314: 6812 ldr r2, [r2, #0] + 8002316: f043 0302 orr.w r3, r3, #2 + 800231a: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 800231e: 6193 str r3, [r2, #24] + + heth->gState = HAL_ETH_STATE_STARTED; + 8002320: 687b ldr r3, [r7, #4] + 8002322: 2223 movs r2, #35 @ 0x23 + 8002324: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + + return HAL_OK; + 8002328: 2300 movs r3, #0 + 800232a: e000 b.n 800232e + } + else + { + return HAL_ERROR; + 800232c: 2301 movs r3, #1 + } +} + 800232e: 4618 mov r0, r3 + 8002330: 3710 adds r7, #16 + 8002332: 46bd mov sp, r7 + 8002334: bd80 pop {r7, pc} + +08002336 : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_Stop(ETH_HandleTypeDef *heth) +{ + 8002336: b580 push {r7, lr} + 8002338: b084 sub sp, #16 + 800233a: af00 add r7, sp, #0 + 800233c: 6078 str r0, [r7, #4] + uint32_t tmpreg1; + + if (heth->gState == HAL_ETH_STATE_STARTED) + 800233e: 687b ldr r3, [r7, #4] + 8002340: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8002344: 2b23 cmp r3, #35 @ 0x23 + 8002346: d14a bne.n 80023de + { + /* Set the ETH peripheral state to BUSY */ + heth->gState = HAL_ETH_STATE_BUSY; + 8002348: 687b ldr r3, [r7, #4] + 800234a: 2223 movs r2, #35 @ 0x23 + 800234c: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + /* Disable the DMA transmission */ + CLEAR_BIT(heth->Instance->DMAOMR, ETH_DMAOMR_ST); + 8002350: 687b ldr r3, [r7, #4] + 8002352: 681b ldr r3, [r3, #0] + 8002354: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002358: 699b ldr r3, [r3, #24] + 800235a: 687a ldr r2, [r7, #4] + 800235c: 6812 ldr r2, [r2, #0] + 800235e: f423 5300 bic.w r3, r3, #8192 @ 0x2000 + 8002362: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 8002366: 6193 str r3, [r2, #24] + + /* Disable the DMA reception */ + CLEAR_BIT(heth->Instance->DMAOMR, ETH_DMAOMR_SR); + 8002368: 687b ldr r3, [r7, #4] + 800236a: 681b ldr r3, [r3, #0] + 800236c: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002370: 699b ldr r3, [r3, #24] + 8002372: 687a ldr r2, [r7, #4] + 8002374: 6812 ldr r2, [r2, #0] + 8002376: f023 0302 bic.w r3, r3, #2 + 800237a: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 800237e: 6193 str r3, [r2, #24] + + /* Disable the MAC reception */ + CLEAR_BIT(heth->Instance->MACCR, ETH_MACCR_RE); + 8002380: 687b ldr r3, [r7, #4] + 8002382: 681b ldr r3, [r3, #0] + 8002384: 681a ldr r2, [r3, #0] + 8002386: 687b ldr r3, [r7, #4] + 8002388: 681b ldr r3, [r3, #0] + 800238a: f022 0204 bic.w r2, r2, #4 + 800238e: 601a str r2, [r3, #0] + + /* Wait until the write operation will be taken into account : + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->MACCR; + 8002390: 687b ldr r3, [r7, #4] + 8002392: 681b ldr r3, [r3, #0] + 8002394: 681b ldr r3, [r3, #0] + 8002396: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 8002398: 2001 movs r0, #1 + 800239a: f7ff fdb9 bl 8001f10 + (heth->Instance)->MACCR = tmpreg1; + 800239e: 687b ldr r3, [r7, #4] + 80023a0: 681b ldr r3, [r3, #0] + 80023a2: 68fa ldr r2, [r7, #12] + 80023a4: 601a str r2, [r3, #0] + + /* Flush Transmit FIFO */ + ETH_FlushTransmitFIFO(heth); + 80023a6: 6878 ldr r0, [r7, #4] + 80023a8: f000 fbd8 bl 8002b5c + + /* Disable the MAC transmission */ + CLEAR_BIT(heth->Instance->MACCR, ETH_MACCR_TE); + 80023ac: 687b ldr r3, [r7, #4] + 80023ae: 681b ldr r3, [r3, #0] + 80023b0: 681a ldr r2, [r3, #0] + 80023b2: 687b ldr r3, [r7, #4] + 80023b4: 681b ldr r3, [r3, #0] + 80023b6: f022 0208 bic.w r2, r2, #8 + 80023ba: 601a str r2, [r3, #0] + + /* Wait until the write operation will be taken into account : + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->MACCR; + 80023bc: 687b ldr r3, [r7, #4] + 80023be: 681b ldr r3, [r3, #0] + 80023c0: 681b ldr r3, [r3, #0] + 80023c2: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 80023c4: 2001 movs r0, #1 + 80023c6: f7ff fda3 bl 8001f10 + (heth->Instance)->MACCR = tmpreg1; + 80023ca: 687b ldr r3, [r7, #4] + 80023cc: 681b ldr r3, [r3, #0] + 80023ce: 68fa ldr r2, [r7, #12] + 80023d0: 601a str r2, [r3, #0] + + heth->gState = HAL_ETH_STATE_READY; + 80023d2: 687b ldr r3, [r7, #4] + 80023d4: 2210 movs r2, #16 + 80023d6: f8c3 2084 str.w r2, [r3, #132] @ 0x84 + + /* Return function status */ + return HAL_OK; + 80023da: 2300 movs r3, #0 + 80023dc: e000 b.n 80023e0 + } + else + { + return HAL_ERROR; + 80023de: 2301 movs r3, #1 + } +} + 80023e0: 4618 mov r0, r3 + 80023e2: 3710 adds r7, #16 + 80023e4: 46bd mov sp, r7 + 80023e6: bd80 pop {r7, pc} + +080023e8 : + * @param pTxConfig: Hold the configuration of packet to be transmitted + * @param Timeout: timeout value + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_Transmit(ETH_HandleTypeDef *heth, ETH_TxPacketConfig *pTxConfig, uint32_t Timeout) +{ + 80023e8: b580 push {r7, lr} + 80023ea: b086 sub sp, #24 + 80023ec: af00 add r7, sp, #0 + 80023ee: 60f8 str r0, [r7, #12] + 80023f0: 60b9 str r1, [r7, #8] + 80023f2: 607a str r2, [r7, #4] + uint32_t tickstart; + ETH_DMADescTypeDef *dmatxdesc; + + if (pTxConfig == NULL) + 80023f4: 68bb ldr r3, [r7, #8] + 80023f6: 2b00 cmp r3, #0 + 80023f8: d109 bne.n 800240e + { + heth->ErrorCode |= HAL_ETH_ERROR_PARAM; + 80023fa: 68fb ldr r3, [r7, #12] + 80023fc: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 8002400: f043 0201 orr.w r2, r3, #1 + 8002404: 68fb ldr r3, [r7, #12] + 8002406: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + return HAL_ERROR; + 800240a: 2301 movs r3, #1 + 800240c: e07c b.n 8002508 + } + + if (heth->gState == HAL_ETH_STATE_STARTED) + 800240e: 68fb ldr r3, [r7, #12] + 8002410: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8002414: 2b23 cmp r3, #35 @ 0x23 + 8002416: d176 bne.n 8002506 + { + /* Config DMA Tx descriptor by Tx Packet info */ + if (ETH_Prepare_Tx_Descriptors(heth, pTxConfig, 0) != HAL_ETH_ERROR_NONE) + 8002418: 2200 movs r2, #0 + 800241a: 68b9 ldr r1, [r7, #8] + 800241c: 68f8 ldr r0, [r7, #12] + 800241e: f000 fe6d bl 80030fc + 8002422: 4603 mov r3, r0 + 8002424: 2b00 cmp r3, #0 + 8002426: d009 beq.n 800243c + { + /* Set the ETH error code */ + heth->ErrorCode |= HAL_ETH_ERROR_BUSY; + 8002428: 68fb ldr r3, [r7, #12] + 800242a: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 800242e: f043 0202 orr.w r2, r3, #2 + 8002432: 68fb ldr r3, [r7, #12] + 8002434: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + return HAL_ERROR; + 8002438: 2301 movs r3, #1 + 800243a: e065 b.n 8002508 + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__STATIC_FORCEINLINE void __DSB(void) +{ + __ASM volatile ("dsb 0xF":::"memory"); + 800243c: f3bf 8f4f dsb sy +} + 8002440: bf00 nop + } + + /* Ensure completion of descriptor preparation before transmission start */ + __DSB(); + + dmatxdesc = (ETH_DMADescTypeDef *)(&heth->TxDescList)->TxDesc[heth->TxDescList.CurTxDesc]; + 8002442: 68fb ldr r3, [r7, #12] + 8002444: 6a9a ldr r2, [r3, #40] @ 0x28 + 8002446: 68fb ldr r3, [r7, #12] + 8002448: 3206 adds r2, #6 + 800244a: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 800244e: 617b str r3, [r7, #20] + + /* Incr current tx desc index */ + INCR_TX_DESC_INDEX(heth->TxDescList.CurTxDesc, 1U); + 8002450: 68fb ldr r3, [r7, #12] + 8002452: 6a9b ldr r3, [r3, #40] @ 0x28 + 8002454: 1c5a adds r2, r3, #1 + 8002456: 68fb ldr r3, [r7, #12] + 8002458: 629a str r2, [r3, #40] @ 0x28 + 800245a: 68fb ldr r3, [r7, #12] + 800245c: 6a9b ldr r3, [r3, #40] @ 0x28 + 800245e: 2b03 cmp r3, #3 + 8002460: d904 bls.n 800246c + 8002462: 68fb ldr r3, [r7, #12] + 8002464: 6a9b ldr r3, [r3, #40] @ 0x28 + 8002466: 1f1a subs r2, r3, #4 + 8002468: 68fb ldr r3, [r7, #12] + 800246a: 629a str r2, [r3, #40] @ 0x28 + + /* Start transmission */ + /* issue a poll command to Tx DMA by writing address of next immediate free descriptor */ + WRITE_REG(heth->Instance->DMATPDR, (uint32_t)(heth->TxDescList.TxDesc[heth->TxDescList.CurTxDesc])); + 800246c: 68fb ldr r3, [r7, #12] + 800246e: 6a99 ldr r1, [r3, #40] @ 0x28 + 8002470: 68fb ldr r3, [r7, #12] + 8002472: 681a ldr r2, [r3, #0] + 8002474: 68fb ldr r3, [r7, #12] + 8002476: 3106 adds r1, #6 + 8002478: f853 3021 ldr.w r3, [r3, r1, lsl #2] + 800247c: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 8002480: 6053 str r3, [r2, #4] + + tickstart = HAL_GetTick(); + 8002482: f7ff fd39 bl 8001ef8 + 8002486: 6138 str r0, [r7, #16] + + /* Wait for data to be transmitted or timeout occurred */ + while ((dmatxdesc->DESC0 & ETH_DMATXDESC_OWN) != (uint32_t)RESET) + 8002488: e037 b.n 80024fa + { + if ((heth->Instance->DMASR & ETH_DMASR_FBES) != (uint32_t)RESET) + 800248a: 68fb ldr r3, [r7, #12] + 800248c: 681b ldr r3, [r3, #0] + 800248e: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002492: 695b ldr r3, [r3, #20] + 8002494: f403 5300 and.w r3, r3, #8192 @ 0x2000 + 8002498: 2b00 cmp r3, #0 + 800249a: d011 beq.n 80024c0 + { + heth->ErrorCode |= HAL_ETH_ERROR_DMA; + 800249c: 68fb ldr r3, [r7, #12] + 800249e: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 80024a2: f043 0208 orr.w r2, r3, #8 + 80024a6: 68fb ldr r3, [r7, #12] + 80024a8: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + heth->DMAErrorCode = heth->Instance->DMASR; + 80024ac: 68fb ldr r3, [r7, #12] + 80024ae: 681b ldr r3, [r3, #0] + 80024b0: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 80024b4: 695a ldr r2, [r3, #20] + 80024b6: 68fb ldr r3, [r7, #12] + 80024b8: f8c3 208c str.w r2, [r3, #140] @ 0x8c + /* Return function status */ + return HAL_ERROR; + 80024bc: 2301 movs r3, #1 + 80024be: e023 b.n 8002508 + } + + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + 80024c0: 687b ldr r3, [r7, #4] + 80024c2: f1b3 3fff cmp.w r3, #4294967295 + 80024c6: d018 beq.n 80024fa + { + if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U)) + 80024c8: f7ff fd16 bl 8001ef8 + 80024cc: 4602 mov r2, r0 + 80024ce: 693b ldr r3, [r7, #16] + 80024d0: 1ad3 subs r3, r2, r3 + 80024d2: 687a ldr r2, [r7, #4] + 80024d4: 429a cmp r2, r3 + 80024d6: d302 bcc.n 80024de + 80024d8: 687b ldr r3, [r7, #4] + 80024da: 2b00 cmp r3, #0 + 80024dc: d10d bne.n 80024fa + { + heth->ErrorCode |= HAL_ETH_ERROR_TIMEOUT; + 80024de: 68fb ldr r3, [r7, #12] + 80024e0: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 80024e4: f043 0204 orr.w r2, r3, #4 + 80024e8: 68fb ldr r3, [r7, #12] + 80024ea: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + /* Clear TX descriptor so that we can proceed */ + dmatxdesc->DESC0 = (ETH_DMATXDESC_FS | ETH_DMATXDESC_LS); + 80024ee: 697b ldr r3, [r7, #20] + 80024f0: f04f 5240 mov.w r2, #805306368 @ 0x30000000 + 80024f4: 601a str r2, [r3, #0] + return HAL_ERROR; + 80024f6: 2301 movs r3, #1 + 80024f8: e006 b.n 8002508 + while ((dmatxdesc->DESC0 & ETH_DMATXDESC_OWN) != (uint32_t)RESET) + 80024fa: 697b ldr r3, [r7, #20] + 80024fc: 681b ldr r3, [r3, #0] + 80024fe: 2b00 cmp r3, #0 + 8002500: dbc3 blt.n 800248a + } + } + } + + /* Return function status */ + return HAL_OK; + 8002502: 2300 movs r3, #0 + 8002504: e000 b.n 8002508 + } + else + { + return HAL_ERROR; + 8002506: 2301 movs r3, #1 + } +} + 8002508: 4618 mov r0, r3 + 800250a: 3718 adds r7, #24 + 800250c: 46bd mov sp, r7 + 800250e: bd80 pop {r7, pc} + +08002510 : + * the configuration information for ETHERNET module + * @param pAppBuff: Pointer to an application buffer to receive the packet. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_ReadData(ETH_HandleTypeDef *heth, void **pAppBuff) +{ + 8002510: b580 push {r7, lr} + 8002512: b088 sub sp, #32 + 8002514: af00 add r7, sp, #0 + 8002516: 6078 str r0, [r7, #4] + 8002518: 6039 str r1, [r7, #0] + uint32_t descidx; + ETH_DMADescTypeDef *dmarxdesc; + uint32_t desccnt = 0U; + 800251a: 2300 movs r3, #0 + 800251c: 617b str r3, [r7, #20] + uint32_t desccntmax; + uint32_t bufflength; + uint8_t rxdataready = 0U; + 800251e: 2300 movs r3, #0 + 8002520: 73fb strb r3, [r7, #15] + + + if (pAppBuff == NULL) + 8002522: 683b ldr r3, [r7, #0] + 8002524: 2b00 cmp r3, #0 + 8002526: d109 bne.n 800253c + { + heth->ErrorCode |= HAL_ETH_ERROR_PARAM; + 8002528: 687b ldr r3, [r7, #4] + 800252a: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 800252e: f043 0201 orr.w r2, r3, #1 + 8002532: 687b ldr r3, [r7, #4] + 8002534: f8c3 2088 str.w r2, [r3, #136] @ 0x88 + return HAL_ERROR; + 8002538: 2301 movs r3, #1 + 800253a: e0a8 b.n 800268e + } + + if (heth->gState != HAL_ETH_STATE_STARTED) + 800253c: 687b ldr r3, [r7, #4] + 800253e: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8002542: 2b23 cmp r3, #35 @ 0x23 + 8002544: d001 beq.n 800254a + { + return HAL_ERROR; + 8002546: 2301 movs r3, #1 + 8002548: e0a1 b.n 800268e + } + + descidx = heth->RxDescList.RxDescIdx; + 800254a: 687b ldr r3, [r7, #4] + 800254c: 6ddb ldr r3, [r3, #92] @ 0x5c + 800254e: 61fb str r3, [r7, #28] + dmarxdesc = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx]; + 8002550: 687b ldr r3, [r7, #4] + 8002552: 69fa ldr r2, [r7, #28] + 8002554: 3212 adds r2, #18 + 8002556: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 800255a: 61bb str r3, [r7, #24] + desccntmax = ETH_RX_DESC_CNT - heth->RxDescList.RxBuildDescCnt; + 800255c: 687b ldr r3, [r7, #4] + 800255e: 6edb ldr r3, [r3, #108] @ 0x6c + 8002560: f1c3 0304 rsb r3, r3, #4 + 8002564: 60bb str r3, [r7, #8] + + /* Check if descriptor is not owned by DMA */ + while ((READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_OWN) == (uint32_t)RESET) && (desccnt < desccntmax) + 8002566: e06a b.n 800263e + && (rxdataready == 0U)) + { + if (READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_LS) != (uint32_t)RESET) + 8002568: 69bb ldr r3, [r7, #24] + 800256a: 681b ldr r3, [r3, #0] + 800256c: f403 7380 and.w r3, r3, #256 @ 0x100 + 8002570: 2b00 cmp r3, #0 + 8002572: d007 beq.n 8002584 + { + /* Get timestamp high */ + heth->RxDescList.TimeStamp.TimeStampHigh = dmarxdesc->DESC6; + 8002574: 69bb ldr r3, [r7, #24] + 8002576: 699a ldr r2, [r3, #24] + 8002578: 687b ldr r3, [r7, #4] + 800257a: 679a str r2, [r3, #120] @ 0x78 + /* Get timestamp low */ + heth->RxDescList.TimeStamp.TimeStampLow = dmarxdesc->DESC7; + 800257c: 69bb ldr r3, [r7, #24] + 800257e: 69da ldr r2, [r3, #28] + 8002580: 687b ldr r3, [r7, #4] + 8002582: 675a str r2, [r3, #116] @ 0x74 + } + if ((READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_FS) != (uint32_t)RESET) || (heth->RxDescList.pRxStart != NULL)) + 8002584: 69bb ldr r3, [r7, #24] + 8002586: 681b ldr r3, [r3, #0] + 8002588: f403 7300 and.w r3, r3, #512 @ 0x200 + 800258c: 2b00 cmp r3, #0 + 800258e: d103 bne.n 8002598 + 8002590: 687b ldr r3, [r7, #4] + 8002592: 6fdb ldr r3, [r3, #124] @ 0x7c + 8002594: 2b00 cmp r3, #0 + 8002596: d040 beq.n 800261a + { + /* Check first descriptor */ + if (READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_FS) != (uint32_t)RESET) + 8002598: 69bb ldr r3, [r7, #24] + 800259a: 681b ldr r3, [r3, #0] + 800259c: f403 7300 and.w r3, r3, #512 @ 0x200 + 80025a0: 2b00 cmp r3, #0 + 80025a2: d005 beq.n 80025b0 + { + heth->RxDescList.RxDescCnt = 0; + 80025a4: 687b ldr r3, [r7, #4] + 80025a6: 2200 movs r2, #0 + 80025a8: 661a str r2, [r3, #96] @ 0x60 + heth->RxDescList.RxDataLength = 0; + 80025aa: 687b ldr r3, [r7, #4] + 80025ac: 2200 movs r2, #0 + 80025ae: 665a str r2, [r3, #100] @ 0x64 + } + + /* Check if last descriptor */ + bufflength = heth->Init.RxBuffLen; + 80025b0: 687b ldr r3, [r7, #4] + 80025b2: 695b ldr r3, [r3, #20] + 80025b4: 613b str r3, [r7, #16] + if (READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_LS) != (uint32_t)RESET) + 80025b6: 69bb ldr r3, [r7, #24] + 80025b8: 681b ldr r3, [r3, #0] + 80025ba: f403 7380 and.w r3, r3, #256 @ 0x100 + 80025be: 2b00 cmp r3, #0 + 80025c0: d00c beq.n 80025dc + { + /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */ + bufflength = ((dmarxdesc->DESC0 & ETH_DMARXDESC_FL) >> ETH_DMARXDESC_FRAMELENGTHSHIFT) - 4U; + 80025c2: 69bb ldr r3, [r7, #24] + 80025c4: 681b ldr r3, [r3, #0] + 80025c6: 0c1b lsrs r3, r3, #16 + 80025c8: f3c3 030d ubfx r3, r3, #0, #14 + 80025cc: 3b04 subs r3, #4 + 80025ce: 613b str r3, [r7, #16] + + /* Save Last descriptor index */ + heth->RxDescList.pRxLastRxDesc = dmarxdesc->DESC0; + 80025d0: 69bb ldr r3, [r7, #24] + 80025d2: 681a ldr r2, [r3, #0] + 80025d4: 687b ldr r3, [r7, #4] + 80025d6: 671a str r2, [r3, #112] @ 0x70 + + /* Packet ready */ + rxdataready = 1; + 80025d8: 2301 movs r3, #1 + 80025da: 73fb strb r3, [r7, #15] + } + + /* Link data */ + WRITE_REG(dmarxdesc->BackupAddr0, dmarxdesc->DESC2); + 80025dc: 69bb ldr r3, [r7, #24] + 80025de: 689a ldr r2, [r3, #8] + 80025e0: 69bb ldr r3, [r7, #24] + 80025e2: 621a str r2, [r3, #32] + /*Call registered Link callback*/ + heth->rxLinkCallback(&heth->RxDescList.pRxStart, &heth->RxDescList.pRxEnd, + (uint8_t *)dmarxdesc->BackupAddr0, bufflength); +#else + /* Link callback */ + HAL_ETH_RxLinkCallback(&heth->RxDescList.pRxStart, &heth->RxDescList.pRxEnd, + 80025e4: 687b ldr r3, [r7, #4] + 80025e6: f103 007c add.w r0, r3, #124 @ 0x7c + 80025ea: 687b ldr r3, [r7, #4] + 80025ec: f103 0180 add.w r1, r3, #128 @ 0x80 + (uint8_t *)dmarxdesc->BackupAddr0, (uint16_t) bufflength); + 80025f0: 69bb ldr r3, [r7, #24] + 80025f2: 6a1b ldr r3, [r3, #32] + HAL_ETH_RxLinkCallback(&heth->RxDescList.pRxStart, &heth->RxDescList.pRxEnd, + 80025f4: 461a mov r2, r3 + 80025f6: 693b ldr r3, [r7, #16] + 80025f8: b29b uxth r3, r3 + 80025fa: f002 fe85 bl 8005308 +#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */ + heth->RxDescList.RxDescCnt++; + 80025fe: 687b ldr r3, [r7, #4] + 8002600: 6e1b ldr r3, [r3, #96] @ 0x60 + 8002602: 1c5a adds r2, r3, #1 + 8002604: 687b ldr r3, [r7, #4] + 8002606: 661a str r2, [r3, #96] @ 0x60 + heth->RxDescList.RxDataLength += bufflength; + 8002608: 687b ldr r3, [r7, #4] + 800260a: 6e5a ldr r2, [r3, #100] @ 0x64 + 800260c: 693b ldr r3, [r7, #16] + 800260e: 441a add r2, r3 + 8002610: 687b ldr r3, [r7, #4] + 8002612: 665a str r2, [r3, #100] @ 0x64 + + /* Clear buffer pointer */ + dmarxdesc->BackupAddr0 = 0; + 8002614: 69bb ldr r3, [r7, #24] + 8002616: 2200 movs r2, #0 + 8002618: 621a str r2, [r3, #32] + } + + /* Increment current rx descriptor index */ + INCR_RX_DESC_INDEX(descidx, 1U); + 800261a: 69fb ldr r3, [r7, #28] + 800261c: 3301 adds r3, #1 + 800261e: 61fb str r3, [r7, #28] + 8002620: 69fb ldr r3, [r7, #28] + 8002622: 2b03 cmp r3, #3 + 8002624: d902 bls.n 800262c + 8002626: 69fb ldr r3, [r7, #28] + 8002628: 3b04 subs r3, #4 + 800262a: 61fb str r3, [r7, #28] + /* Get current descriptor address */ + dmarxdesc = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx]; + 800262c: 687b ldr r3, [r7, #4] + 800262e: 69fa ldr r2, [r7, #28] + 8002630: 3212 adds r2, #18 + 8002632: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 8002636: 61bb str r3, [r7, #24] + desccnt++; + 8002638: 697b ldr r3, [r7, #20] + 800263a: 3301 adds r3, #1 + 800263c: 617b str r3, [r7, #20] + while ((READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_OWN) == (uint32_t)RESET) && (desccnt < desccntmax) + 800263e: 69bb ldr r3, [r7, #24] + 8002640: 681b ldr r3, [r3, #0] + && (rxdataready == 0U)) + 8002642: 2b00 cmp r3, #0 + 8002644: db06 blt.n 8002654 + while ((READ_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_OWN) == (uint32_t)RESET) && (desccnt < desccntmax) + 8002646: 697a ldr r2, [r7, #20] + 8002648: 68bb ldr r3, [r7, #8] + 800264a: 429a cmp r2, r3 + 800264c: d202 bcs.n 8002654 + && (rxdataready == 0U)) + 800264e: 7bfb ldrb r3, [r7, #15] + 8002650: 2b00 cmp r3, #0 + 8002652: d089 beq.n 8002568 + } + + heth->RxDescList.RxBuildDescCnt += desccnt; + 8002654: 687b ldr r3, [r7, #4] + 8002656: 6eda ldr r2, [r3, #108] @ 0x6c + 8002658: 697b ldr r3, [r7, #20] + 800265a: 441a add r2, r3 + 800265c: 687b ldr r3, [r7, #4] + 800265e: 66da str r2, [r3, #108] @ 0x6c + if ((heth->RxDescList.RxBuildDescCnt) != 0U) + 8002660: 687b ldr r3, [r7, #4] + 8002662: 6edb ldr r3, [r3, #108] @ 0x6c + 8002664: 2b00 cmp r3, #0 + 8002666: d002 beq.n 800266e + { + /* Update Descriptors */ + ETH_UpdateDescriptor(heth); + 8002668: 6878 ldr r0, [r7, #4] + 800266a: f000 f815 bl 8002698 + } + + heth->RxDescList.RxDescIdx = descidx; + 800266e: 687b ldr r3, [r7, #4] + 8002670: 69fa ldr r2, [r7, #28] + 8002672: 65da str r2, [r3, #92] @ 0x5c + + if (rxdataready == 1U) + 8002674: 7bfb ldrb r3, [r7, #15] + 8002676: 2b01 cmp r3, #1 + 8002678: d108 bne.n 800268c + { + /* Return received packet */ + *pAppBuff = heth->RxDescList.pRxStart; + 800267a: 687b ldr r3, [r7, #4] + 800267c: 6fda ldr r2, [r3, #124] @ 0x7c + 800267e: 683b ldr r3, [r7, #0] + 8002680: 601a str r2, [r3, #0] + /* Reset first element */ + heth->RxDescList.pRxStart = NULL; + 8002682: 687b ldr r3, [r7, #4] + 8002684: 2200 movs r2, #0 + 8002686: 67da str r2, [r3, #124] @ 0x7c + + return HAL_OK; + 8002688: 2300 movs r3, #0 + 800268a: e000 b.n 800268e + } + + /* Packet not ready */ + return HAL_ERROR; + 800268c: 2301 movs r3, #1 +} + 800268e: 4618 mov r0, r3 + 8002690: 3720 adds r7, #32 + 8002692: 46bd mov sp, r7 + 8002694: bd80 pop {r7, pc} + ... + +08002698 : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval HAL status + */ +static void ETH_UpdateDescriptor(ETH_HandleTypeDef *heth) +{ + 8002698: b580 push {r7, lr} + 800269a: b088 sub sp, #32 + 800269c: af00 add r7, sp, #0 + 800269e: 6078 str r0, [r7, #4] + uint32_t descidx; + uint32_t desccount; + ETH_DMADescTypeDef *dmarxdesc; + uint8_t *buff = NULL; + 80026a0: 2300 movs r3, #0 + 80026a2: 60fb str r3, [r7, #12] + uint8_t allocStatus = 1U; + 80026a4: 2301 movs r3, #1 + 80026a6: 74fb strb r3, [r7, #19] + + descidx = heth->RxDescList.RxBuildDescIdx; + 80026a8: 687b ldr r3, [r7, #4] + 80026aa: 6e9b ldr r3, [r3, #104] @ 0x68 + 80026ac: 61fb str r3, [r7, #28] + dmarxdesc = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx]; + 80026ae: 687b ldr r3, [r7, #4] + 80026b0: 69fa ldr r2, [r7, #28] + 80026b2: 3212 adds r2, #18 + 80026b4: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 80026b8: 617b str r3, [r7, #20] + desccount = heth->RxDescList.RxBuildDescCnt; + 80026ba: 687b ldr r3, [r7, #4] + 80026bc: 6edb ldr r3, [r3, #108] @ 0x6c + 80026be: 61bb str r3, [r7, #24] + + while ((desccount > 0U) && (allocStatus != 0U)) + 80026c0: e040 b.n 8002744 + { + /* Check if a buffer's attached the descriptor */ + if (READ_REG(dmarxdesc->BackupAddr0) == 0U) + 80026c2: 697b ldr r3, [r7, #20] + 80026c4: 6a1b ldr r3, [r3, #32] + 80026c6: 2b00 cmp r3, #0 + 80026c8: d112 bne.n 80026f0 +#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1) + /*Call registered Allocate callback*/ + heth->rxAllocateCallback(&buff); +#else + /* Allocate callback */ + HAL_ETH_RxAllocateCallback(&buff); + 80026ca: f107 030c add.w r3, r7, #12 + 80026ce: 4618 mov r0, r3 + 80026d0: f002 fdea bl 80052a8 +#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */ + if (buff == NULL) + 80026d4: 68fb ldr r3, [r7, #12] + 80026d6: 2b00 cmp r3, #0 + 80026d8: d102 bne.n 80026e0 + { + allocStatus = 0U; + 80026da: 2300 movs r3, #0 + 80026dc: 74fb strb r3, [r7, #19] + 80026de: e007 b.n 80026f0 + } + else + { + WRITE_REG(dmarxdesc->BackupAddr0, (uint32_t)buff); + 80026e0: 68fb ldr r3, [r7, #12] + 80026e2: 461a mov r2, r3 + 80026e4: 697b ldr r3, [r7, #20] + 80026e6: 621a str r2, [r3, #32] + WRITE_REG(dmarxdesc->DESC2, (uint32_t)buff); + 80026e8: 68fb ldr r3, [r7, #12] + 80026ea: 461a mov r2, r3 + 80026ec: 697b ldr r3, [r7, #20] + 80026ee: 609a str r2, [r3, #8] + } + } + + if (allocStatus != 0U) + 80026f0: 7cfb ldrb r3, [r7, #19] + 80026f2: 2b00 cmp r3, #0 + 80026f4: d026 beq.n 8002744 + { + if (heth->RxDescList.ItMode == 0U) + 80026f6: 687b ldr r3, [r7, #4] + 80026f8: 6d9b ldr r3, [r3, #88] @ 0x58 + 80026fa: 2b00 cmp r3, #0 + 80026fc: d103 bne.n 8002706 + { + WRITE_REG(dmarxdesc->DESC1, ETH_DMARXDESC_DIC | ETH_RX_BUF_SIZE | ETH_DMARXDESC_RCH); + 80026fe: 697b ldr r3, [r7, #20] + 8002700: 4a1e ldr r2, [pc, #120] @ (800277c ) + 8002702: 605a str r2, [r3, #4] + 8002704: e003 b.n 800270e + } + else + { + WRITE_REG(dmarxdesc->DESC1, ETH_RX_BUF_SIZE | ETH_DMARXDESC_RCH); + 8002706: 697b ldr r3, [r7, #20] + 8002708: f244 52f8 movw r2, #17912 @ 0x45f8 + 800270c: 605a str r2, [r3, #4] + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__STATIC_FORCEINLINE void __DMB(void) +{ + __ASM volatile ("dmb 0xF":::"memory"); + 800270e: f3bf 8f5f dmb sy +} + 8002712: bf00 nop + is fully performed. + The __DMB() instruction is added to avoid any potential compiler optimization that + may lead to abnormal behavior. */ + __DMB(); + + SET_BIT(dmarxdesc->DESC0, ETH_DMARXDESC_OWN); + 8002714: 697b ldr r3, [r7, #20] + 8002716: 681b ldr r3, [r3, #0] + 8002718: f043 4200 orr.w r2, r3, #2147483648 @ 0x80000000 + 800271c: 697b ldr r3, [r7, #20] + 800271e: 601a str r2, [r3, #0] + + /* Increment current rx descriptor index */ + INCR_RX_DESC_INDEX(descidx, 1U); + 8002720: 69fb ldr r3, [r7, #28] + 8002722: 3301 adds r3, #1 + 8002724: 61fb str r3, [r7, #28] + 8002726: 69fb ldr r3, [r7, #28] + 8002728: 2b03 cmp r3, #3 + 800272a: d902 bls.n 8002732 + 800272c: 69fb ldr r3, [r7, #28] + 800272e: 3b04 subs r3, #4 + 8002730: 61fb str r3, [r7, #28] + /* Get current descriptor address */ + dmarxdesc = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx]; + 8002732: 687b ldr r3, [r7, #4] + 8002734: 69fa ldr r2, [r7, #28] + 8002736: 3212 adds r2, #18 + 8002738: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 800273c: 617b str r3, [r7, #20] + desccount--; + 800273e: 69bb ldr r3, [r7, #24] + 8002740: 3b01 subs r3, #1 + 8002742: 61bb str r3, [r7, #24] + while ((desccount > 0U) && (allocStatus != 0U)) + 8002744: 69bb ldr r3, [r7, #24] + 8002746: 2b00 cmp r3, #0 + 8002748: d002 beq.n 8002750 + 800274a: 7cfb ldrb r3, [r7, #19] + 800274c: 2b00 cmp r3, #0 + 800274e: d1b8 bne.n 80026c2 + } + } + + if (heth->RxDescList.RxBuildDescCnt != desccount) + 8002750: 687b ldr r3, [r7, #4] + 8002752: 6edb ldr r3, [r3, #108] @ 0x6c + 8002754: 69ba ldr r2, [r7, #24] + 8002756: 429a cmp r2, r3 + 8002758: d00c beq.n 8002774 + { + /* Set the Tail pointer address */ + WRITE_REG(heth->Instance->DMARPDR, 0); + 800275a: 687b ldr r3, [r7, #4] + 800275c: 681b ldr r3, [r3, #0] + 800275e: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002762: 461a mov r2, r3 + 8002764: 2300 movs r3, #0 + 8002766: 6093 str r3, [r2, #8] + + heth->RxDescList.RxBuildDescIdx = descidx; + 8002768: 687b ldr r3, [r7, #4] + 800276a: 69fa ldr r2, [r7, #28] + 800276c: 669a str r2, [r3, #104] @ 0x68 + heth->RxDescList.RxBuildDescCnt = desccount; + 800276e: 687b ldr r3, [r7, #4] + 8002770: 69ba ldr r2, [r7, #24] + 8002772: 66da str r2, [r3, #108] @ 0x6c + } +} + 8002774: bf00 nop + 8002776: 3720 adds r7, #32 + 8002778: 46bd mov sp, r7 + 800277a: bd80 pop {r7, pc} + 800277c: 800045f8 .word 0x800045f8 + +08002780 : + * @param pRegValue: parameter to hold read value + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, + uint32_t *pRegValue) +{ + 8002780: b580 push {r7, lr} + 8002782: b086 sub sp, #24 + 8002784: af00 add r7, sp, #0 + 8002786: 60f8 str r0, [r7, #12] + 8002788: 60b9 str r1, [r7, #8] + 800278a: 607a str r2, [r7, #4] + 800278c: 603b str r3, [r7, #0] + uint32_t tmpreg1; + uint32_t tickstart; + + /* Get the ETHERNET MACMIIAR value */ + tmpreg1 = heth->Instance->MACMIIAR; + 800278e: 68fb ldr r3, [r7, #12] + 8002790: 681b ldr r3, [r3, #0] + 8002792: 691b ldr r3, [r3, #16] + 8002794: 617b str r3, [r7, #20] + + /* Keep only the CSR Clock Range CR[2:0] bits value */ + tmpreg1 &= ~ETH_MACMIIAR_CR_MASK; + 8002796: 697b ldr r3, [r7, #20] + 8002798: f003 031c and.w r3, r3, #28 + 800279c: 617b str r3, [r7, #20] + + /* Prepare the MII address register value */ + tmpreg1 |= ((PHYAddr << 11U) & ETH_MACMIIAR_PA); /* Set the PHY device address */ + 800279e: 68bb ldr r3, [r7, #8] + 80027a0: 02db lsls r3, r3, #11 + 80027a2: b29b uxth r3, r3 + 80027a4: 697a ldr r2, [r7, #20] + 80027a6: 4313 orrs r3, r2 + 80027a8: 617b str r3, [r7, #20] + tmpreg1 |= (((uint32_t)PHYReg << 6U) & ETH_MACMIIAR_MR); /* Set the PHY register address */ + 80027aa: 687b ldr r3, [r7, #4] + 80027ac: 019b lsls r3, r3, #6 + 80027ae: f403 63f8 and.w r3, r3, #1984 @ 0x7c0 + 80027b2: 697a ldr r2, [r7, #20] + 80027b4: 4313 orrs r3, r2 + 80027b6: 617b str r3, [r7, #20] + tmpreg1 &= ~ETH_MACMIIAR_MW; /* Set the read mode */ + 80027b8: 697b ldr r3, [r7, #20] + 80027ba: f023 0302 bic.w r3, r3, #2 + 80027be: 617b str r3, [r7, #20] + tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */ + 80027c0: 697b ldr r3, [r7, #20] + 80027c2: f043 0301 orr.w r3, r3, #1 + 80027c6: 617b str r3, [r7, #20] + + /* Write the result value into the MII Address register */ + heth->Instance->MACMIIAR = tmpreg1; + 80027c8: 68fb ldr r3, [r7, #12] + 80027ca: 681b ldr r3, [r3, #0] + 80027cc: 697a ldr r2, [r7, #20] + 80027ce: 611a str r2, [r3, #16] + + + tickstart = HAL_GetTick(); + 80027d0: f7ff fb92 bl 8001ef8 + 80027d4: 6138 str r0, [r7, #16] + + /* Check for the Busy flag */ + while ((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) + 80027d6: e00d b.n 80027f4 + { + /* Check for the Timeout */ + if ((HAL_GetTick() - tickstart) > PHY_READ_TO) + 80027d8: f7ff fb8e bl 8001ef8 + 80027dc: 4602 mov r2, r0 + 80027de: 693b ldr r3, [r7, #16] + 80027e0: 1ad3 subs r3, r2, r3 + 80027e2: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80027e6: d301 bcc.n 80027ec + { + return HAL_ERROR; + 80027e8: 2301 movs r3, #1 + 80027ea: e010 b.n 800280e + } + + tmpreg1 = heth->Instance->MACMIIAR; + 80027ec: 68fb ldr r3, [r7, #12] + 80027ee: 681b ldr r3, [r3, #0] + 80027f0: 691b ldr r3, [r3, #16] + 80027f2: 617b str r3, [r7, #20] + while ((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) + 80027f4: 697b ldr r3, [r7, #20] + 80027f6: f003 0301 and.w r3, r3, #1 + 80027fa: 2b00 cmp r3, #0 + 80027fc: d1ec bne.n 80027d8 + } + + /* Get MACMIIDR value */ + *pRegValue = (uint16_t)(heth->Instance->MACMIIDR); + 80027fe: 68fb ldr r3, [r7, #12] + 8002800: 681b ldr r3, [r3, #0] + 8002802: 695b ldr r3, [r3, #20] + 8002804: b29b uxth r3, r3 + 8002806: 461a mov r2, r3 + 8002808: 683b ldr r3, [r7, #0] + 800280a: 601a str r2, [r3, #0] + + return HAL_OK; + 800280c: 2300 movs r3, #0 +} + 800280e: 4618 mov r0, r3 + 8002810: 3718 adds r7, #24 + 8002812: 46bd mov sp, r7 + 8002814: bd80 pop {r7, pc} + +08002816 : + * @param RegValue: the value to write + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, + uint32_t RegValue) +{ + 8002816: b580 push {r7, lr} + 8002818: b086 sub sp, #24 + 800281a: af00 add r7, sp, #0 + 800281c: 60f8 str r0, [r7, #12] + 800281e: 60b9 str r1, [r7, #8] + 8002820: 607a str r2, [r7, #4] + 8002822: 603b str r3, [r7, #0] + uint32_t tmpreg1; + uint32_t tickstart; + + /* Get the ETHERNET MACMIIAR value */ + tmpreg1 = heth->Instance->MACMIIAR; + 8002824: 68fb ldr r3, [r7, #12] + 8002826: 681b ldr r3, [r3, #0] + 8002828: 691b ldr r3, [r3, #16] + 800282a: 617b str r3, [r7, #20] + + /* Keep only the CSR Clock Range CR[2:0] bits value */ + tmpreg1 &= ~ETH_MACMIIAR_CR_MASK; + 800282c: 697b ldr r3, [r7, #20] + 800282e: f003 031c and.w r3, r3, #28 + 8002832: 617b str r3, [r7, #20] + + /* Prepare the MII register address value */ + tmpreg1 |= ((PHYAddr << 11U) & ETH_MACMIIAR_PA); /* Set the PHY device address */ + 8002834: 68bb ldr r3, [r7, #8] + 8002836: 02db lsls r3, r3, #11 + 8002838: b29b uxth r3, r3 + 800283a: 697a ldr r2, [r7, #20] + 800283c: 4313 orrs r3, r2 + 800283e: 617b str r3, [r7, #20] + tmpreg1 |= (((uint32_t)PHYReg << 6U) & ETH_MACMIIAR_MR); /* Set the PHY register address */ + 8002840: 687b ldr r3, [r7, #4] + 8002842: 019b lsls r3, r3, #6 + 8002844: f403 63f8 and.w r3, r3, #1984 @ 0x7c0 + 8002848: 697a ldr r2, [r7, #20] + 800284a: 4313 orrs r3, r2 + 800284c: 617b str r3, [r7, #20] + tmpreg1 |= ETH_MACMIIAR_MW; /* Set the write mode */ + 800284e: 697b ldr r3, [r7, #20] + 8002850: f043 0302 orr.w r3, r3, #2 + 8002854: 617b str r3, [r7, #20] + tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */ + 8002856: 697b ldr r3, [r7, #20] + 8002858: f043 0301 orr.w r3, r3, #1 + 800285c: 617b str r3, [r7, #20] + + /* Give the value to the MII data register */ + heth->Instance->MACMIIDR = (uint16_t)RegValue; + 800285e: 683b ldr r3, [r7, #0] + 8002860: b29a uxth r2, r3 + 8002862: 68fb ldr r3, [r7, #12] + 8002864: 681b ldr r3, [r3, #0] + 8002866: 615a str r2, [r3, #20] + + /* Write the result value into the MII Address register */ + heth->Instance->MACMIIAR = tmpreg1; + 8002868: 68fb ldr r3, [r7, #12] + 800286a: 681b ldr r3, [r3, #0] + 800286c: 697a ldr r2, [r7, #20] + 800286e: 611a str r2, [r3, #16] + + /* Get tick */ + tickstart = HAL_GetTick(); + 8002870: f7ff fb42 bl 8001ef8 + 8002874: 6138 str r0, [r7, #16] + + /* Check for the Busy flag */ + while ((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) + 8002876: e00d b.n 8002894 + { + /* Check for the Timeout */ + if ((HAL_GetTick() - tickstart) > PHY_WRITE_TO) + 8002878: f7ff fb3e bl 8001ef8 + 800287c: 4602 mov r2, r0 + 800287e: 693b ldr r3, [r7, #16] + 8002880: 1ad3 subs r3, r2, r3 + 8002882: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8002886: d301 bcc.n 800288c + { + return HAL_ERROR; + 8002888: 2301 movs r3, #1 + 800288a: e009 b.n 80028a0 + } + + tmpreg1 = heth->Instance->MACMIIAR; + 800288c: 68fb ldr r3, [r7, #12] + 800288e: 681b ldr r3, [r3, #0] + 8002890: 691b ldr r3, [r3, #16] + 8002892: 617b str r3, [r7, #20] + while ((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) + 8002894: 697b ldr r3, [r7, #20] + 8002896: f003 0301 and.w r3, r3, #1 + 800289a: 2b00 cmp r3, #0 + 800289c: d1ec bne.n 8002878 + } + + return HAL_OK; + 800289e: 2300 movs r3, #0 +} + 80028a0: 4618 mov r0, r3 + 80028a2: 3718 adds r7, #24 + 80028a4: 46bd mov sp, r7 + 80028a6: bd80 pop {r7, pc} + +080028a8 : + * @param macconf: pointer to a ETH_MACConfigTypeDef structure that will hold + * the configuration of the MAC. + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_ETH_GetMACConfig(ETH_HandleTypeDef *heth, ETH_MACConfigTypeDef *macconf) +{ + 80028a8: b480 push {r7} + 80028aa: b083 sub sp, #12 + 80028ac: af00 add r7, sp, #0 + 80028ae: 6078 str r0, [r7, #4] + 80028b0: 6039 str r1, [r7, #0] + if (macconf == NULL) + 80028b2: 683b ldr r3, [r7, #0] + 80028b4: 2b00 cmp r3, #0 + 80028b6: d101 bne.n 80028bc + { + return HAL_ERROR; + 80028b8: 2301 movs r3, #1 + 80028ba: e0d9 b.n 8002a70 + } + + /* Get MAC parameters */ + macconf->DeferralCheck = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_DC) >> 4) > 0U) ? ENABLE : DISABLE; + 80028bc: 687b ldr r3, [r7, #4] + 80028be: 681b ldr r3, [r3, #0] + 80028c0: 681b ldr r3, [r3, #0] + 80028c2: f003 0310 and.w r3, r3, #16 + 80028c6: 2b00 cmp r3, #0 + 80028c8: bf14 ite ne + 80028ca: 2301 movne r3, #1 + 80028cc: 2300 moveq r3, #0 + 80028ce: b2db uxtb r3, r3 + 80028d0: 461a mov r2, r3 + 80028d2: 683b ldr r3, [r7, #0] + 80028d4: f883 2028 strb.w r2, [r3, #40] @ 0x28 + macconf->BackOffLimit = READ_BIT(heth->Instance->MACCR, ETH_MACCR_BL); + 80028d8: 687b ldr r3, [r7, #4] + 80028da: 681b ldr r3, [r3, #0] + 80028dc: 681b ldr r3, [r3, #0] + 80028de: f003 0260 and.w r2, r3, #96 @ 0x60 + 80028e2: 683b ldr r3, [r7, #0] + 80028e4: 625a str r2, [r3, #36] @ 0x24 + macconf->RetryTransmission = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_RD) >> 9) == 0U) ? ENABLE : DISABLE; + 80028e6: 687b ldr r3, [r7, #4] + 80028e8: 681b ldr r3, [r3, #0] + 80028ea: 681b ldr r3, [r3, #0] + 80028ec: f403 7300 and.w r3, r3, #512 @ 0x200 + 80028f0: 2b00 cmp r3, #0 + 80028f2: bf0c ite eq + 80028f4: 2301 moveq r3, #1 + 80028f6: 2300 movne r3, #0 + 80028f8: b2db uxtb r3, r3 + 80028fa: 461a mov r2, r3 + 80028fc: 683b ldr r3, [r7, #0] + 80028fe: f883 2020 strb.w r2, [r3, #32] + macconf->CarrierSenseDuringTransmit = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_CSD) >> 16) > 0U) + 8002902: 687b ldr r3, [r7, #4] + 8002904: 681b ldr r3, [r3, #0] + 8002906: 681b ldr r3, [r3, #0] + 8002908: f403 3380 and.w r3, r3, #65536 @ 0x10000 + ? ENABLE : DISABLE; + 800290c: 2b00 cmp r3, #0 + 800290e: bf14 ite ne + 8002910: 2301 movne r3, #1 + 8002912: 2300 moveq r3, #0 + 8002914: b2db uxtb r3, r3 + 8002916: 461a mov r2, r3 + macconf->CarrierSenseDuringTransmit = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_CSD) >> 16) > 0U) + 8002918: 683b ldr r3, [r7, #0] + 800291a: 77da strb r2, [r3, #31] + macconf->ReceiveOwn = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_ROD) >> 13) == 0U) ? ENABLE : DISABLE; + 800291c: 687b ldr r3, [r7, #4] + 800291e: 681b ldr r3, [r3, #0] + 8002920: 681b ldr r3, [r3, #0] + 8002922: f403 5300 and.w r3, r3, #8192 @ 0x2000 + 8002926: 2b00 cmp r3, #0 + 8002928: bf0c ite eq + 800292a: 2301 moveq r3, #1 + 800292c: 2300 movne r3, #0 + 800292e: b2db uxtb r3, r3 + 8002930: 461a mov r2, r3 + 8002932: 683b ldr r3, [r7, #0] + 8002934: 779a strb r2, [r3, #30] + macconf->LoopbackMode = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_LM) >> 12) > 0U) ? ENABLE : DISABLE; + 8002936: 687b ldr r3, [r7, #4] + 8002938: 681b ldr r3, [r3, #0] + 800293a: 681b ldr r3, [r3, #0] + 800293c: f403 5380 and.w r3, r3, #4096 @ 0x1000 + 8002940: 2b00 cmp r3, #0 + 8002942: bf14 ite ne + 8002944: 2301 movne r3, #1 + 8002946: 2300 moveq r3, #0 + 8002948: b2db uxtb r3, r3 + 800294a: 461a mov r2, r3 + 800294c: 683b ldr r3, [r7, #0] + 800294e: 771a strb r2, [r3, #28] + macconf->DuplexMode = READ_BIT(heth->Instance->MACCR, ETH_MACCR_DM); + 8002950: 687b ldr r3, [r7, #4] + 8002952: 681b ldr r3, [r3, #0] + 8002954: 681b ldr r3, [r3, #0] + 8002956: f403 6200 and.w r2, r3, #2048 @ 0x800 + 800295a: 683b ldr r3, [r7, #0] + 800295c: 619a str r2, [r3, #24] + macconf->Speed = READ_BIT(heth->Instance->MACCR, ETH_MACCR_FES); + 800295e: 687b ldr r3, [r7, #4] + 8002960: 681b ldr r3, [r3, #0] + 8002962: 681b ldr r3, [r3, #0] + 8002964: f403 4280 and.w r2, r3, #16384 @ 0x4000 + 8002968: 683b ldr r3, [r7, #0] + 800296a: 615a str r2, [r3, #20] + macconf->Jabber = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_JD) >> 22) == 0U) ? ENABLE : DISABLE; + 800296c: 687b ldr r3, [r7, #4] + 800296e: 681b ldr r3, [r3, #0] + 8002970: 681b ldr r3, [r3, #0] + 8002972: f403 0380 and.w r3, r3, #4194304 @ 0x400000 + 8002976: 2b00 cmp r3, #0 + 8002978: bf0c ite eq + 800297a: 2301 moveq r3, #1 + 800297c: 2300 movne r3, #0 + 800297e: b2db uxtb r3, r3 + 8002980: 461a mov r2, r3 + 8002982: 683b ldr r3, [r7, #0] + 8002984: 745a strb r2, [r3, #17] + macconf->Watchdog = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_WD) >> 23) == 0U) ? ENABLE : DISABLE; + 8002986: 687b ldr r3, [r7, #4] + 8002988: 681b ldr r3, [r3, #0] + 800298a: 681b ldr r3, [r3, #0] + 800298c: f403 0300 and.w r3, r3, #8388608 @ 0x800000 + 8002990: 2b00 cmp r3, #0 + 8002992: bf0c ite eq + 8002994: 2301 moveq r3, #1 + 8002996: 2300 movne r3, #0 + 8002998: b2db uxtb r3, r3 + 800299a: 461a mov r2, r3 + 800299c: 683b ldr r3, [r7, #0] + 800299e: 741a strb r2, [r3, #16] + macconf->AutomaticPadCRCStrip = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_APCS) >> 7) > 0U) ? ENABLE : DISABLE; + 80029a0: 687b ldr r3, [r7, #4] + 80029a2: 681b ldr r3, [r3, #0] + 80029a4: 681b ldr r3, [r3, #0] + 80029a6: f003 0380 and.w r3, r3, #128 @ 0x80 + 80029aa: 2b00 cmp r3, #0 + 80029ac: bf14 ite ne + 80029ae: 2301 movne r3, #1 + 80029b0: 2300 moveq r3, #0 + 80029b2: b2db uxtb r3, r3 + 80029b4: 461a mov r2, r3 + 80029b6: 683b ldr r3, [r7, #0] + 80029b8: 73da strb r2, [r3, #15] + macconf->InterPacketGapVal = READ_BIT(heth->Instance->MACCR, ETH_MACCR_IFG); + 80029ba: 687b ldr r3, [r7, #4] + 80029bc: 681b ldr r3, [r3, #0] + 80029be: 681b ldr r3, [r3, #0] + 80029c0: f403 2260 and.w r2, r3, #917504 @ 0xe0000 + 80029c4: 683b ldr r3, [r7, #0] + 80029c6: 609a str r2, [r3, #8] + macconf->ChecksumOffload = ((READ_BIT(heth->Instance->MACCR, ETH_MACCR_IPCO) >> 10U) > 0U) ? ENABLE : DISABLE; + 80029c8: 687b ldr r3, [r7, #4] + 80029ca: 681b ldr r3, [r3, #0] + 80029cc: 681b ldr r3, [r3, #0] + 80029ce: f403 6380 and.w r3, r3, #1024 @ 0x400 + 80029d2: 2b00 cmp r3, #0 + 80029d4: bf14 ite ne + 80029d6: 2301 movne r3, #1 + 80029d8: 2300 moveq r3, #0 + 80029da: b2db uxtb r3, r3 + 80029dc: 461a mov r2, r3 + 80029de: 683b ldr r3, [r7, #0] + 80029e0: 711a strb r2, [r3, #4] + + + macconf->TransmitFlowControl = ((READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_TFCE) >> 1) > 0U) ? ENABLE : DISABLE; + 80029e2: 687b ldr r3, [r7, #4] + 80029e4: 681b ldr r3, [r3, #0] + 80029e6: 699b ldr r3, [r3, #24] + 80029e8: f003 0302 and.w r3, r3, #2 + 80029ec: 2b00 cmp r3, #0 + 80029ee: bf14 ite ne + 80029f0: 2301 movne r3, #1 + 80029f2: 2300 moveq r3, #0 + 80029f4: b2db uxtb r3, r3 + 80029f6: 461a mov r2, r3 + 80029f8: 683b ldr r3, [r7, #0] + 80029fa: f883 2054 strb.w r2, [r3, #84] @ 0x54 + macconf->ZeroQuantaPause = ((READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_ZQPD) >> 7) == 0U) ? ENABLE : DISABLE; + 80029fe: 687b ldr r3, [r7, #4] + 8002a00: 681b ldr r3, [r3, #0] + 8002a02: 699b ldr r3, [r3, #24] + 8002a04: f003 0380 and.w r3, r3, #128 @ 0x80 + 8002a08: 2b00 cmp r3, #0 + 8002a0a: bf0c ite eq + 8002a0c: 2301 moveq r3, #1 + 8002a0e: 2300 movne r3, #0 + 8002a10: b2db uxtb r3, r3 + 8002a12: 461a mov r2, r3 + 8002a14: 683b ldr r3, [r7, #0] + 8002a16: f883 204c strb.w r2, [r3, #76] @ 0x4c + macconf->PauseLowThreshold = READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_PLT); + 8002a1a: 687b ldr r3, [r7, #4] + 8002a1c: 681b ldr r3, [r3, #0] + 8002a1e: 699b ldr r3, [r3, #24] + 8002a20: f003 0230 and.w r2, r3, #48 @ 0x30 + 8002a24: 683b ldr r3, [r7, #0] + 8002a26: 651a str r2, [r3, #80] @ 0x50 + macconf->PauseTime = (READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_PT) >> 16); + 8002a28: 687b ldr r3, [r7, #4] + 8002a2a: 681b ldr r3, [r3, #0] + 8002a2c: 699b ldr r3, [r3, #24] + 8002a2e: 0c1b lsrs r3, r3, #16 + 8002a30: b29a uxth r2, r3 + 8002a32: 683b ldr r3, [r7, #0] + 8002a34: 649a str r2, [r3, #72] @ 0x48 + macconf->ReceiveFlowControl = ((READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_RFCE) >> 2U) > 0U) ? ENABLE : DISABLE; + 8002a36: 687b ldr r3, [r7, #4] + 8002a38: 681b ldr r3, [r3, #0] + 8002a3a: 699b ldr r3, [r3, #24] + 8002a3c: f003 0304 and.w r3, r3, #4 + 8002a40: 2b00 cmp r3, #0 + 8002a42: bf14 ite ne + 8002a44: 2301 movne r3, #1 + 8002a46: 2300 moveq r3, #0 + 8002a48: b2db uxtb r3, r3 + 8002a4a: 461a mov r2, r3 + 8002a4c: 683b ldr r3, [r7, #0] + 8002a4e: f883 2056 strb.w r2, [r3, #86] @ 0x56 + macconf->UnicastPausePacketDetect = ((READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_UPFD) >> 3U) > 0U) + 8002a52: 687b ldr r3, [r7, #4] + 8002a54: 681b ldr r3, [r3, #0] + 8002a56: 699b ldr r3, [r3, #24] + 8002a58: f003 0308 and.w r3, r3, #8 + ? ENABLE : DISABLE; + 8002a5c: 2b00 cmp r3, #0 + 8002a5e: bf14 ite ne + 8002a60: 2301 movne r3, #1 + 8002a62: 2300 moveq r3, #0 + 8002a64: b2db uxtb r3, r3 + 8002a66: 461a mov r2, r3 + macconf->UnicastPausePacketDetect = ((READ_BIT(heth->Instance->MACFCR, ETH_MACFCR_UPFD) >> 3U) > 0U) + 8002a68: 683b ldr r3, [r7, #0] + 8002a6a: f883 2055 strb.w r2, [r3, #85] @ 0x55 + + return HAL_OK; + 8002a6e: 2300 movs r3, #0 +} + 8002a70: 4618 mov r0, r3 + 8002a72: 370c adds r7, #12 + 8002a74: 46bd mov sp, r7 + 8002a76: f85d 7b04 ldr.w r7, [sp], #4 + 8002a7a: 4770 bx lr + +08002a7c : + * @param macconf: pointer to a ETH_MACConfigTypeDef structure that contains + * the configuration of the MAC. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ETH_SetMACConfig(ETH_HandleTypeDef *heth, ETH_MACConfigTypeDef *macconf) +{ + 8002a7c: b580 push {r7, lr} + 8002a7e: b082 sub sp, #8 + 8002a80: af00 add r7, sp, #0 + 8002a82: 6078 str r0, [r7, #4] + 8002a84: 6039 str r1, [r7, #0] + if (macconf == NULL) + 8002a86: 683b ldr r3, [r7, #0] + 8002a88: 2b00 cmp r3, #0 + 8002a8a: d101 bne.n 8002a90 + { + return HAL_ERROR; + 8002a8c: 2301 movs r3, #1 + 8002a8e: e00b b.n 8002aa8 + } + + if (heth->gState == HAL_ETH_STATE_READY) + 8002a90: 687b ldr r3, [r7, #4] + 8002a92: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8002a96: 2b10 cmp r3, #16 + 8002a98: d105 bne.n 8002aa6 + { + ETH_SetMACConfig(heth, macconf); + 8002a9a: 6839 ldr r1, [r7, #0] + 8002a9c: 6878 ldr r0, [r7, #4] + 8002a9e: f000 f883 bl 8002ba8 + + return HAL_OK; + 8002aa2: 2300 movs r3, #0 + 8002aa4: e000 b.n 8002aa8 + } + else + { + return HAL_ERROR; + 8002aa6: 2301 movs r3, #1 + } +} + 8002aa8: 4618 mov r0, r3 + 8002aaa: 3708 adds r7, #8 + 8002aac: 46bd mov sp, r7 + 8002aae: bd80 pop {r7, pc} + +08002ab0 : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval None + */ +void HAL_ETH_SetMDIOClockRange(ETH_HandleTypeDef *heth) +{ + 8002ab0: b580 push {r7, lr} + 8002ab2: b084 sub sp, #16 + 8002ab4: af00 add r7, sp, #0 + 8002ab6: 6078 str r0, [r7, #4] + uint32_t hclk; + uint32_t tmpreg; + + /* Get the ETHERNET MACMIIAR value */ + tmpreg = (heth->Instance)->MACMIIAR; + 8002ab8: 687b ldr r3, [r7, #4] + 8002aba: 681b ldr r3, [r3, #0] + 8002abc: 691b ldr r3, [r3, #16] + 8002abe: 60fb str r3, [r7, #12] + /* Clear CSR Clock Range CR[2:0] bits */ + tmpreg &= ETH_MACMIIAR_CR_MASK; + 8002ac0: 68fb ldr r3, [r7, #12] + 8002ac2: f023 031c bic.w r3, r3, #28 + 8002ac6: 60fb str r3, [r7, #12] + + /* Get hclk frequency value */ + hclk = HAL_RCC_GetHCLKFreq(); + 8002ac8: f001 fa38 bl 8003f3c + 8002acc: 60b8 str r0, [r7, #8] + + /* Set CR bits depending on hclk value */ + if ((hclk >= 20000000U) && (hclk < 35000000U)) + 8002ace: 68bb ldr r3, [r7, #8] + 8002ad0: 4a1d ldr r2, [pc, #116] @ (8002b48 ) + 8002ad2: 4293 cmp r3, r2 + 8002ad4: d908 bls.n 8002ae8 + 8002ad6: 68bb ldr r3, [r7, #8] + 8002ad8: 4a1c ldr r2, [pc, #112] @ (8002b4c ) + 8002ada: 4293 cmp r3, r2 + 8002adc: d804 bhi.n 8002ae8 + { + /* CSR Clock Range between 20-35 MHz */ + tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div16; + 8002ade: 68fb ldr r3, [r7, #12] + 8002ae0: f043 0308 orr.w r3, r3, #8 + 8002ae4: 60fb str r3, [r7, #12] + 8002ae6: e027 b.n 8002b38 + } + else if ((hclk >= 35000000U) && (hclk < 60000000U)) + 8002ae8: 68bb ldr r3, [r7, #8] + 8002aea: 4a18 ldr r2, [pc, #96] @ (8002b4c ) + 8002aec: 4293 cmp r3, r2 + 8002aee: d908 bls.n 8002b02 + 8002af0: 68bb ldr r3, [r7, #8] + 8002af2: 4a17 ldr r2, [pc, #92] @ (8002b50 ) + 8002af4: 4293 cmp r3, r2 + 8002af6: d204 bcs.n 8002b02 + { + /* CSR Clock Range between 35-60 MHz */ + tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div26; + 8002af8: 68fb ldr r3, [r7, #12] + 8002afa: f043 030c orr.w r3, r3, #12 + 8002afe: 60fb str r3, [r7, #12] + 8002b00: e01a b.n 8002b38 + } + else if ((hclk >= 60000000U) && (hclk < 100000000U)) + 8002b02: 68bb ldr r3, [r7, #8] + 8002b04: 4a12 ldr r2, [pc, #72] @ (8002b50 ) + 8002b06: 4293 cmp r3, r2 + 8002b08: d303 bcc.n 8002b12 + 8002b0a: 68bb ldr r3, [r7, #8] + 8002b0c: 4a11 ldr r2, [pc, #68] @ (8002b54 ) + 8002b0e: 4293 cmp r3, r2 + 8002b10: d911 bls.n 8002b36 + { + /* CSR Clock Range between 60-100 MHz */ + tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div42; + } + else if ((hclk >= 100000000U) && (hclk < 150000000U)) + 8002b12: 68bb ldr r3, [r7, #8] + 8002b14: 4a0f ldr r2, [pc, #60] @ (8002b54 ) + 8002b16: 4293 cmp r3, r2 + 8002b18: d908 bls.n 8002b2c + 8002b1a: 68bb ldr r3, [r7, #8] + 8002b1c: 4a0e ldr r2, [pc, #56] @ (8002b58 ) + 8002b1e: 4293 cmp r3, r2 + 8002b20: d804 bhi.n 8002b2c + { + /* CSR Clock Range between 100-150 MHz */ + tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div62; + 8002b22: 68fb ldr r3, [r7, #12] + 8002b24: f043 0304 orr.w r3, r3, #4 + 8002b28: 60fb str r3, [r7, #12] + 8002b2a: e005 b.n 8002b38 + } + else /* ((hclk >= 150000000)&&(hclk <= 183000000))*/ + { + /* CSR Clock Range between 150-183 MHz */ + tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div102; + 8002b2c: 68fb ldr r3, [r7, #12] + 8002b2e: f043 0310 orr.w r3, r3, #16 + 8002b32: 60fb str r3, [r7, #12] + 8002b34: e000 b.n 8002b38 + tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div42; + 8002b36: bf00 nop + } + + /* Write to ETHERNET MAC MIIAR: Configure the ETHERNET CSR Clock Range */ + (heth->Instance)->MACMIIAR = (uint32_t)tmpreg; + 8002b38: 687b ldr r3, [r7, #4] + 8002b3a: 681b ldr r3, [r3, #0] + 8002b3c: 68fa ldr r2, [r7, #12] + 8002b3e: 611a str r2, [r3, #16] +} + 8002b40: bf00 nop + 8002b42: 3710 adds r7, #16 + 8002b44: 46bd mov sp, r7 + 8002b46: bd80 pop {r7, pc} + 8002b48: 01312cff .word 0x01312cff + 8002b4c: 02160ebf .word 0x02160ebf + 8002b50: 03938700 .word 0x03938700 + 8002b54: 05f5e0ff .word 0x05f5e0ff + 8002b58: 08f0d17f .word 0x08f0d17f + +08002b5c : + * @param heth pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval None + */ +static void ETH_FlushTransmitFIFO(ETH_HandleTypeDef *heth) +{ + 8002b5c: b580 push {r7, lr} + 8002b5e: b084 sub sp, #16 + 8002b60: af00 add r7, sp, #0 + 8002b62: 6078 str r0, [r7, #4] + __IO uint32_t tmpreg = 0; + 8002b64: 2300 movs r3, #0 + 8002b66: 60fb str r3, [r7, #12] + + /* Set the Flush Transmit FIFO bit */ + (heth->Instance)->DMAOMR |= ETH_DMAOMR_FTF; + 8002b68: 687b ldr r3, [r7, #4] + 8002b6a: 681b ldr r3, [r3, #0] + 8002b6c: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002b70: 699b ldr r3, [r3, #24] + 8002b72: 687a ldr r2, [r7, #4] + 8002b74: 6812 ldr r2, [r2, #0] + 8002b76: f443 1380 orr.w r3, r3, #1048576 @ 0x100000 + 8002b7a: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 8002b7e: 6193 str r3, [r2, #24] + + /* Wait until the write operation will be taken into account: + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg = (heth->Instance)->DMAOMR; + 8002b80: 687b ldr r3, [r7, #4] + 8002b82: 681b ldr r3, [r3, #0] + 8002b84: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002b88: 699b ldr r3, [r3, #24] + 8002b8a: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 8002b8c: 2001 movs r0, #1 + 8002b8e: f7ff f9bf bl 8001f10 + (heth->Instance)->DMAOMR = tmpreg; + 8002b92: 687b ldr r3, [r7, #4] + 8002b94: 681a ldr r2, [r3, #0] + 8002b96: 68fb ldr r3, [r7, #12] + 8002b98: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 8002b9c: 6193 str r3, [r2, #24] +} + 8002b9e: bf00 nop + 8002ba0: 3710 adds r7, #16 + 8002ba2: 46bd mov sp, r7 + 8002ba4: bd80 pop {r7, pc} + ... + +08002ba8 : + +static void ETH_SetMACConfig(ETH_HandleTypeDef *heth, ETH_MACConfigTypeDef *macconf) +{ + 8002ba8: b580 push {r7, lr} + 8002baa: b084 sub sp, #16 + 8002bac: af00 add r7, sp, #0 + 8002bae: 6078 str r0, [r7, #4] + 8002bb0: 6039 str r1, [r7, #0] + uint32_t tmpreg1; + + /*------------------------ ETHERNET MACCR Configuration --------------------*/ + /* Get the ETHERNET MACCR value */ + tmpreg1 = (heth->Instance)->MACCR; + 8002bb2: 687b ldr r3, [r7, #4] + 8002bb4: 681b ldr r3, [r3, #0] + 8002bb6: 681b ldr r3, [r3, #0] + 8002bb8: 60fb str r3, [r7, #12] + /* Clear WD, PCE, PS, TE and RE bits */ + tmpreg1 &= ETH_MACCR_CLEAR_MASK; + 8002bba: 68fa ldr r2, [r7, #12] + 8002bbc: 4b51 ldr r3, [pc, #324] @ (8002d04 ) + 8002bbe: 4013 ands r3, r2 + 8002bc0: 60fb str r3, [r7, #12] + + tmpreg1 |= (uint32_t)(((uint32_t)((macconf->Watchdog == DISABLE) ? 1U : 0U) << 23U) | + 8002bc2: 683b ldr r3, [r7, #0] + 8002bc4: 7c1b ldrb r3, [r3, #16] + 8002bc6: 2b00 cmp r3, #0 + 8002bc8: d102 bne.n 8002bd0 + 8002bca: f44f 0200 mov.w r2, #8388608 @ 0x800000 + 8002bce: e000 b.n 8002bd2 + 8002bd0: 2200 movs r2, #0 + ((uint32_t)((macconf->Jabber == DISABLE) ? 1U : 0U) << 22U) | + 8002bd2: 683b ldr r3, [r7, #0] + 8002bd4: 7c5b ldrb r3, [r3, #17] + 8002bd6: 2b00 cmp r3, #0 + 8002bd8: d102 bne.n 8002be0 + 8002bda: f44f 0380 mov.w r3, #4194304 @ 0x400000 + 8002bde: e000 b.n 8002be2 + 8002be0: 2300 movs r3, #0 + tmpreg1 |= (uint32_t)(((uint32_t)((macconf->Watchdog == DISABLE) ? 1U : 0U) << 23U) | + 8002be2: 431a orrs r2, r3 + (uint32_t)macconf->InterPacketGapVal | + 8002be4: 683b ldr r3, [r7, #0] + 8002be6: 689b ldr r3, [r3, #8] + ((uint32_t)((macconf->Jabber == DISABLE) ? 1U : 0U) << 22U) | + 8002be8: 431a orrs r2, r3 + ((uint32_t)macconf->CarrierSenseDuringTransmit << 16U) | + 8002bea: 683b ldr r3, [r7, #0] + 8002bec: 7fdb ldrb r3, [r3, #31] + 8002bee: 041b lsls r3, r3, #16 + (uint32_t)macconf->InterPacketGapVal | + 8002bf0: 431a orrs r2, r3 + macconf->Speed | + 8002bf2: 683b ldr r3, [r7, #0] + 8002bf4: 695b ldr r3, [r3, #20] + ((uint32_t)macconf->CarrierSenseDuringTransmit << 16U) | + 8002bf6: 4313 orrs r3, r2 + ((uint32_t)((macconf->ReceiveOwn == DISABLE) ? 1U : 0U) << 13U) | + 8002bf8: 683a ldr r2, [r7, #0] + 8002bfa: 7f92 ldrb r2, [r2, #30] + 8002bfc: 2a00 cmp r2, #0 + 8002bfe: d102 bne.n 8002c06 + 8002c00: f44f 5200 mov.w r2, #8192 @ 0x2000 + 8002c04: e000 b.n 8002c08 + 8002c06: 2200 movs r2, #0 + macconf->Speed | + 8002c08: 431a orrs r2, r3 + ((uint32_t)macconf->LoopbackMode << 12U) | + 8002c0a: 683b ldr r3, [r7, #0] + 8002c0c: 7f1b ldrb r3, [r3, #28] + 8002c0e: 031b lsls r3, r3, #12 + ((uint32_t)((macconf->ReceiveOwn == DISABLE) ? 1U : 0U) << 13U) | + 8002c10: 431a orrs r2, r3 + macconf->DuplexMode | + 8002c12: 683b ldr r3, [r7, #0] + 8002c14: 699b ldr r3, [r3, #24] + ((uint32_t)macconf->LoopbackMode << 12U) | + 8002c16: 431a orrs r2, r3 + ((uint32_t)macconf->ChecksumOffload << 10U) | + 8002c18: 683b ldr r3, [r7, #0] + 8002c1a: 791b ldrb r3, [r3, #4] + 8002c1c: 029b lsls r3, r3, #10 + macconf->DuplexMode | + 8002c1e: 4313 orrs r3, r2 + ((uint32_t)((macconf->RetryTransmission == DISABLE) ? 1U : 0U) << 9U) | + 8002c20: 683a ldr r2, [r7, #0] + 8002c22: f892 2020 ldrb.w r2, [r2, #32] + 8002c26: 2a00 cmp r2, #0 + 8002c28: d102 bne.n 8002c30 + 8002c2a: f44f 7200 mov.w r2, #512 @ 0x200 + 8002c2e: e000 b.n 8002c32 + 8002c30: 2200 movs r2, #0 + ((uint32_t)macconf->ChecksumOffload << 10U) | + 8002c32: 431a orrs r2, r3 + ((uint32_t)macconf->AutomaticPadCRCStrip << 7U) | + 8002c34: 683b ldr r3, [r7, #0] + 8002c36: 7bdb ldrb r3, [r3, #15] + 8002c38: 01db lsls r3, r3, #7 + ((uint32_t)((macconf->RetryTransmission == DISABLE) ? 1U : 0U) << 9U) | + 8002c3a: 431a orrs r2, r3 + macconf->BackOffLimit | + 8002c3c: 683b ldr r3, [r7, #0] + 8002c3e: 6a5b ldr r3, [r3, #36] @ 0x24 + ((uint32_t)macconf->AutomaticPadCRCStrip << 7U) | + 8002c40: 431a orrs r2, r3 + ((uint32_t)macconf->DeferralCheck << 4U)); + 8002c42: 683b ldr r3, [r7, #0] + 8002c44: f893 3028 ldrb.w r3, [r3, #40] @ 0x28 + 8002c48: 011b lsls r3, r3, #4 + tmpreg1 |= (uint32_t)(((uint32_t)((macconf->Watchdog == DISABLE) ? 1U : 0U) << 23U) | + 8002c4a: 4313 orrs r3, r2 + 8002c4c: 68fa ldr r2, [r7, #12] + 8002c4e: 4313 orrs r3, r2 + 8002c50: 60fb str r3, [r7, #12] + + /* Write to ETHERNET MACCR */ + (heth->Instance)->MACCR = (uint32_t)tmpreg1; + 8002c52: 687b ldr r3, [r7, #4] + 8002c54: 681b ldr r3, [r3, #0] + 8002c56: 68fa ldr r2, [r7, #12] + 8002c58: 601a str r2, [r3, #0] + + /* Wait until the write operation will be taken into account : + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->MACCR; + 8002c5a: 687b ldr r3, [r7, #4] + 8002c5c: 681b ldr r3, [r3, #0] + 8002c5e: 681b ldr r3, [r3, #0] + 8002c60: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 8002c62: 2001 movs r0, #1 + 8002c64: f7ff f954 bl 8001f10 + (heth->Instance)->MACCR = tmpreg1; + 8002c68: 687b ldr r3, [r7, #4] + 8002c6a: 681b ldr r3, [r3, #0] + 8002c6c: 68fa ldr r2, [r7, #12] + 8002c6e: 601a str r2, [r3, #0] + + /*----------------------- ETHERNET MACFCR Configuration --------------------*/ + + /* Get the ETHERNET MACFCR value */ + tmpreg1 = (heth->Instance)->MACFCR; + 8002c70: 687b ldr r3, [r7, #4] + 8002c72: 681b ldr r3, [r3, #0] + 8002c74: 699b ldr r3, [r3, #24] + 8002c76: 60fb str r3, [r7, #12] + /* Clear xx bits */ + tmpreg1 &= ETH_MACFCR_CLEAR_MASK; + 8002c78: 68fa ldr r2, [r7, #12] + 8002c7a: f64f 7341 movw r3, #65345 @ 0xff41 + 8002c7e: 4013 ands r3, r2 + 8002c80: 60fb str r3, [r7, #12] + + tmpreg1 |= (uint32_t)((macconf->PauseTime << 16U) | + 8002c82: 683b ldr r3, [r7, #0] + 8002c84: 6c9b ldr r3, [r3, #72] @ 0x48 + 8002c86: 041b lsls r3, r3, #16 + ((uint32_t)((macconf->ZeroQuantaPause == DISABLE) ? 1U : 0U) << 7U) | + 8002c88: 683a ldr r2, [r7, #0] + 8002c8a: f892 204c ldrb.w r2, [r2, #76] @ 0x4c + 8002c8e: 2a00 cmp r2, #0 + 8002c90: d101 bne.n 8002c96 + 8002c92: 2280 movs r2, #128 @ 0x80 + 8002c94: e000 b.n 8002c98 + 8002c96: 2200 movs r2, #0 + tmpreg1 |= (uint32_t)((macconf->PauseTime << 16U) | + 8002c98: 431a orrs r2, r3 + macconf->PauseLowThreshold | + 8002c9a: 683b ldr r3, [r7, #0] + 8002c9c: 6d1b ldr r3, [r3, #80] @ 0x50 + ((uint32_t)((macconf->ZeroQuantaPause == DISABLE) ? 1U : 0U) << 7U) | + 8002c9e: 4313 orrs r3, r2 + ((uint32_t)((macconf->UnicastPausePacketDetect == ENABLE) ? 1U : 0U) << 3U) | + 8002ca0: 683a ldr r2, [r7, #0] + 8002ca2: f892 2055 ldrb.w r2, [r2, #85] @ 0x55 + 8002ca6: 2a01 cmp r2, #1 + 8002ca8: d101 bne.n 8002cae + 8002caa: 2208 movs r2, #8 + 8002cac: e000 b.n 8002cb0 + 8002cae: 2200 movs r2, #0 + macconf->PauseLowThreshold | + 8002cb0: 4313 orrs r3, r2 + ((uint32_t)((macconf->ReceiveFlowControl == ENABLE) ? 1U : 0U) << 2U) | + 8002cb2: 683a ldr r2, [r7, #0] + 8002cb4: f892 2056 ldrb.w r2, [r2, #86] @ 0x56 + 8002cb8: 2a01 cmp r2, #1 + 8002cba: d101 bne.n 8002cc0 + 8002cbc: 2204 movs r2, #4 + 8002cbe: e000 b.n 8002cc2 + 8002cc0: 2200 movs r2, #0 + ((uint32_t)((macconf->UnicastPausePacketDetect == ENABLE) ? 1U : 0U) << 3U) | + 8002cc2: 4313 orrs r3, r2 + ((uint32_t)((macconf->TransmitFlowControl == ENABLE) ? 1U : 0U) << 1U)); + 8002cc4: 683a ldr r2, [r7, #0] + 8002cc6: f892 2054 ldrb.w r2, [r2, #84] @ 0x54 + 8002cca: 2a01 cmp r2, #1 + 8002ccc: d101 bne.n 8002cd2 + 8002cce: 2202 movs r2, #2 + 8002cd0: e000 b.n 8002cd4 + 8002cd2: 2200 movs r2, #0 + tmpreg1 |= (uint32_t)((macconf->PauseTime << 16U) | + 8002cd4: 4313 orrs r3, r2 + 8002cd6: 68fa ldr r2, [r7, #12] + 8002cd8: 4313 orrs r3, r2 + 8002cda: 60fb str r3, [r7, #12] + + /* Write to ETHERNET MACFCR */ + (heth->Instance)->MACFCR = (uint32_t)tmpreg1; + 8002cdc: 687b ldr r3, [r7, #4] + 8002cde: 681b ldr r3, [r3, #0] + 8002ce0: 68fa ldr r2, [r7, #12] + 8002ce2: 619a str r2, [r3, #24] + + /* Wait until the write operation will be taken into account : + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->MACFCR; + 8002ce4: 687b ldr r3, [r7, #4] + 8002ce6: 681b ldr r3, [r3, #0] + 8002ce8: 699b ldr r3, [r3, #24] + 8002cea: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 8002cec: 2001 movs r0, #1 + 8002cee: f7ff f90f bl 8001f10 + (heth->Instance)->MACFCR = tmpreg1; + 8002cf2: 687b ldr r3, [r7, #4] + 8002cf4: 681b ldr r3, [r3, #0] + 8002cf6: 68fa ldr r2, [r7, #12] + 8002cf8: 619a str r2, [r3, #24] +} + 8002cfa: bf00 nop + 8002cfc: 3710 adds r7, #16 + 8002cfe: 46bd mov sp, r7 + 8002d00: bd80 pop {r7, pc} + 8002d02: bf00 nop + 8002d04: ff20810f .word 0xff20810f + +08002d08 : + +static void ETH_SetDMAConfig(ETH_HandleTypeDef *heth, ETH_DMAConfigTypeDef *dmaconf) +{ + 8002d08: b580 push {r7, lr} + 8002d0a: b084 sub sp, #16 + 8002d0c: af00 add r7, sp, #0 + 8002d0e: 6078 str r0, [r7, #4] + 8002d10: 6039 str r1, [r7, #0] + uint32_t tmpreg1; + + /*----------------------- ETHERNET DMAOMR Configuration --------------------*/ + /* Get the ETHERNET DMAOMR value */ + tmpreg1 = (heth->Instance)->DMAOMR; + 8002d12: 687b ldr r3, [r7, #4] + 8002d14: 681b ldr r3, [r3, #0] + 8002d16: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002d1a: 699b ldr r3, [r3, #24] + 8002d1c: 60fb str r3, [r7, #12] + /* Clear xx bits */ + tmpreg1 &= ETH_DMAOMR_CLEAR_MASK; + 8002d1e: 68fa ldr r2, [r7, #12] + 8002d20: 4b3d ldr r3, [pc, #244] @ (8002e18 ) + 8002d22: 4013 ands r3, r2 + 8002d24: 60fb str r3, [r7, #12] + + tmpreg1 |= (uint32_t)(((uint32_t)((dmaconf->DropTCPIPChecksumErrorFrame == DISABLE) ? 1U : 0U) << 26U) | + 8002d26: 683b ldr r3, [r7, #0] + 8002d28: 7b1b ldrb r3, [r3, #12] + 8002d2a: 2b00 cmp r3, #0 + 8002d2c: d102 bne.n 8002d34 + 8002d2e: f04f 6280 mov.w r2, #67108864 @ 0x4000000 + 8002d32: e000 b.n 8002d36 + 8002d34: 2200 movs r2, #0 + ((uint32_t)dmaconf->ReceiveStoreForward << 25U) | + 8002d36: 683b ldr r3, [r7, #0] + 8002d38: 7b5b ldrb r3, [r3, #13] + 8002d3a: 065b lsls r3, r3, #25 + tmpreg1 |= (uint32_t)(((uint32_t)((dmaconf->DropTCPIPChecksumErrorFrame == DISABLE) ? 1U : 0U) << 26U) | + 8002d3c: 4313 orrs r3, r2 + ((uint32_t)((dmaconf->FlushRxPacket == DISABLE) ? 1U : 0U) << 20U) | + 8002d3e: 683a ldr r2, [r7, #0] + 8002d40: 7f52 ldrb r2, [r2, #29] + 8002d42: 2a00 cmp r2, #0 + 8002d44: d102 bne.n 8002d4c + 8002d46: f44f 1280 mov.w r2, #1048576 @ 0x100000 + 8002d4a: e000 b.n 8002d4e + 8002d4c: 2200 movs r2, #0 + ((uint32_t)dmaconf->ReceiveStoreForward << 25U) | + 8002d4e: 431a orrs r2, r3 + ((uint32_t)dmaconf->TransmitStoreForward << 21U) | + 8002d50: 683b ldr r3, [r7, #0] + 8002d52: 7b9b ldrb r3, [r3, #14] + 8002d54: 055b lsls r3, r3, #21 + ((uint32_t)((dmaconf->FlushRxPacket == DISABLE) ? 1U : 0U) << 20U) | + 8002d56: 431a orrs r2, r3 + dmaconf->TransmitThresholdControl | + 8002d58: 683b ldr r3, [r7, #0] + 8002d5a: 695b ldr r3, [r3, #20] + ((uint32_t)dmaconf->TransmitStoreForward << 21U) | + 8002d5c: 431a orrs r2, r3 + ((uint32_t)dmaconf->ForwardErrorFrames << 7U) | + 8002d5e: 683b ldr r3, [r7, #0] + 8002d60: 7f1b ldrb r3, [r3, #28] + 8002d62: 01db lsls r3, r3, #7 + dmaconf->TransmitThresholdControl | + 8002d64: 431a orrs r2, r3 + ((uint32_t)dmaconf->ForwardUndersizedGoodFrames << 6U) | + 8002d66: 683b ldr r3, [r7, #0] + 8002d68: 7f9b ldrb r3, [r3, #30] + 8002d6a: 019b lsls r3, r3, #6 + ((uint32_t)dmaconf->ForwardErrorFrames << 7U) | + 8002d6c: 431a orrs r2, r3 + dmaconf->ReceiveThresholdControl | + 8002d6e: 683b ldr r3, [r7, #0] + 8002d70: 6a1b ldr r3, [r3, #32] + ((uint32_t)dmaconf->ForwardUndersizedGoodFrames << 6U) | + 8002d72: 431a orrs r2, r3 + ((uint32_t)dmaconf->SecondFrameOperate << 2U)); + 8002d74: 683b ldr r3, [r7, #0] + 8002d76: f893 3024 ldrb.w r3, [r3, #36] @ 0x24 + 8002d7a: 009b lsls r3, r3, #2 + tmpreg1 |= (uint32_t)(((uint32_t)((dmaconf->DropTCPIPChecksumErrorFrame == DISABLE) ? 1U : 0U) << 26U) | + 8002d7c: 4313 orrs r3, r2 + 8002d7e: 68fa ldr r2, [r7, #12] + 8002d80: 4313 orrs r3, r2 + 8002d82: 60fb str r3, [r7, #12] + + /* Write to ETHERNET DMAOMR */ + (heth->Instance)->DMAOMR = (uint32_t)tmpreg1; + 8002d84: 687b ldr r3, [r7, #4] + 8002d86: 681b ldr r3, [r3, #0] + 8002d88: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002d8c: 461a mov r2, r3 + 8002d8e: 68fb ldr r3, [r7, #12] + 8002d90: 6193 str r3, [r2, #24] + + /* Wait until the write operation will be taken into account: + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->DMAOMR; + 8002d92: 687b ldr r3, [r7, #4] + 8002d94: 681b ldr r3, [r3, #0] + 8002d96: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002d9a: 699b ldr r3, [r3, #24] + 8002d9c: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 8002d9e: 2001 movs r0, #1 + 8002da0: f7ff f8b6 bl 8001f10 + (heth->Instance)->DMAOMR = tmpreg1; + 8002da4: 687b ldr r3, [r7, #4] + 8002da6: 681b ldr r3, [r3, #0] + 8002da8: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002dac: 461a mov r2, r3 + 8002dae: 68fb ldr r3, [r7, #12] + 8002db0: 6193 str r3, [r2, #24] + + /*----------------------- ETHERNET DMABMR Configuration --------------------*/ + (heth->Instance)->DMABMR = (uint32_t)(((uint32_t)dmaconf->AddressAlignedBeats << 25U) | + 8002db2: 683b ldr r3, [r7, #0] + 8002db4: 791b ldrb r3, [r3, #4] + 8002db6: 065a lsls r2, r3, #25 + dmaconf->BurstMode | + 8002db8: 683b ldr r3, [r7, #0] + 8002dba: 689b ldr r3, [r3, #8] + (heth->Instance)->DMABMR = (uint32_t)(((uint32_t)dmaconf->AddressAlignedBeats << 25U) | + 8002dbc: 431a orrs r2, r3 + dmaconf->RxDMABurstLength | /* !! if 4xPBL is selected for Tx or + 8002dbe: 683b ldr r3, [r7, #0] + 8002dc0: 699b ldr r3, [r3, #24] + dmaconf->BurstMode | + 8002dc2: 431a orrs r2, r3 + Rx it is applied for the other */ + dmaconf->TxDMABurstLength | + 8002dc4: 683b ldr r3, [r7, #0] + 8002dc6: 691b ldr r3, [r3, #16] + dmaconf->RxDMABurstLength | /* !! if 4xPBL is selected for Tx or + 8002dc8: 431a orrs r2, r3 + ((uint32_t)dmaconf->EnhancedDescriptorFormat << 7U) | + 8002dca: 683b ldr r3, [r7, #0] + 8002dcc: f893 3025 ldrb.w r3, [r3, #37] @ 0x25 + 8002dd0: 01db lsls r3, r3, #7 + dmaconf->TxDMABurstLength | + 8002dd2: 431a orrs r2, r3 + (dmaconf->DescriptorSkipLength << 2U) | + 8002dd4: 683b ldr r3, [r7, #0] + 8002dd6: 6a9b ldr r3, [r3, #40] @ 0x28 + 8002dd8: 009b lsls r3, r3, #2 + ((uint32_t)dmaconf->EnhancedDescriptorFormat << 7U) | + 8002dda: 431a orrs r2, r3 + dmaconf->DMAArbitration | + 8002ddc: 683b ldr r3, [r7, #0] + 8002dde: 681b ldr r3, [r3, #0] + (dmaconf->DescriptorSkipLength << 2U) | + 8002de0: 4313 orrs r3, r2 + (heth->Instance)->DMABMR = (uint32_t)(((uint32_t)dmaconf->AddressAlignedBeats << 25U) | + 8002de2: 687a ldr r2, [r7, #4] + 8002de4: 6812 ldr r2, [r2, #0] + 8002de6: f443 0300 orr.w r3, r3, #8388608 @ 0x800000 + 8002dea: f502 5280 add.w r2, r2, #4096 @ 0x1000 + 8002dee: 6013 str r3, [r2, #0] + ETH_DMABMR_USP); /* Enable use of separate PBL for Rx and Tx */ + + /* Wait until the write operation will be taken into account: + at least four TX_CLK/RX_CLK clock cycles */ + tmpreg1 = (heth->Instance)->DMABMR; + 8002df0: 687b ldr r3, [r7, #4] + 8002df2: 681b ldr r3, [r3, #0] + 8002df4: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002df8: 681b ldr r3, [r3, #0] + 8002dfa: 60fb str r3, [r7, #12] + HAL_Delay(ETH_REG_WRITE_DELAY); + 8002dfc: 2001 movs r0, #1 + 8002dfe: f7ff f887 bl 8001f10 + (heth->Instance)->DMABMR = tmpreg1; + 8002e02: 687b ldr r3, [r7, #4] + 8002e04: 681b ldr r3, [r3, #0] + 8002e06: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8002e0a: 461a mov r2, r3 + 8002e0c: 68fb ldr r3, [r7, #12] + 8002e0e: 6013 str r3, [r2, #0] +} + 8002e10: bf00 nop + 8002e12: 3710 adds r7, #16 + 8002e14: 46bd mov sp, r7 + 8002e16: bd80 pop {r7, pc} + 8002e18: f8de3f23 .word 0xf8de3f23 + +08002e1c : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval HAL status + */ +static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth) +{ + 8002e1c: b580 push {r7, lr} + 8002e1e: b0a6 sub sp, #152 @ 0x98 + 8002e20: af00 add r7, sp, #0 + 8002e22: 6078 str r0, [r7, #4] + ETH_MACConfigTypeDef macDefaultConf; + ETH_DMAConfigTypeDef dmaDefaultConf; + + /*--------------- ETHERNET MAC registers default Configuration --------------*/ + macDefaultConf.Watchdog = ENABLE; + 8002e24: 2301 movs r3, #1 + 8002e26: f887 3044 strb.w r3, [r7, #68] @ 0x44 + macDefaultConf.Jabber = ENABLE; + 8002e2a: 2301 movs r3, #1 + 8002e2c: f887 3045 strb.w r3, [r7, #69] @ 0x45 + macDefaultConf.InterPacketGapVal = ETH_INTERFRAMEGAP_96BIT; + 8002e30: 2300 movs r3, #0 + 8002e32: 63fb str r3, [r7, #60] @ 0x3c + macDefaultConf.CarrierSenseDuringTransmit = DISABLE; + 8002e34: 2300 movs r3, #0 + 8002e36: f887 3053 strb.w r3, [r7, #83] @ 0x53 + macDefaultConf.ReceiveOwn = ENABLE; + 8002e3a: 2301 movs r3, #1 + 8002e3c: f887 3052 strb.w r3, [r7, #82] @ 0x52 + macDefaultConf.LoopbackMode = DISABLE; + 8002e40: 2300 movs r3, #0 + 8002e42: f887 3050 strb.w r3, [r7, #80] @ 0x50 + macDefaultConf.ChecksumOffload = ENABLE; + 8002e46: 2301 movs r3, #1 + 8002e48: f887 3038 strb.w r3, [r7, #56] @ 0x38 + macDefaultConf.RetryTransmission = DISABLE; + 8002e4c: 2300 movs r3, #0 + 8002e4e: f887 3054 strb.w r3, [r7, #84] @ 0x54 + macDefaultConf.AutomaticPadCRCStrip = DISABLE; + 8002e52: 2300 movs r3, #0 + 8002e54: f887 3043 strb.w r3, [r7, #67] @ 0x43 + macDefaultConf.BackOffLimit = ETH_BACKOFFLIMIT_10; + 8002e58: 2300 movs r3, #0 + 8002e5a: 65bb str r3, [r7, #88] @ 0x58 + macDefaultConf.DeferralCheck = DISABLE; + 8002e5c: 2300 movs r3, #0 + 8002e5e: f887 305c strb.w r3, [r7, #92] @ 0x5c + macDefaultConf.PauseTime = 0x0U; + 8002e62: 2300 movs r3, #0 + 8002e64: 67fb str r3, [r7, #124] @ 0x7c + macDefaultConf.ZeroQuantaPause = DISABLE; + 8002e66: 2300 movs r3, #0 + 8002e68: f887 3080 strb.w r3, [r7, #128] @ 0x80 + macDefaultConf.PauseLowThreshold = ETH_PAUSELOWTHRESHOLD_MINUS4; + 8002e6c: 2300 movs r3, #0 + 8002e6e: f8c7 3084 str.w r3, [r7, #132] @ 0x84 + macDefaultConf.ReceiveFlowControl = DISABLE; + 8002e72: 2300 movs r3, #0 + 8002e74: f887 308a strb.w r3, [r7, #138] @ 0x8a + macDefaultConf.TransmitFlowControl = DISABLE; + 8002e78: 2300 movs r3, #0 + 8002e7a: f887 3088 strb.w r3, [r7, #136] @ 0x88 + macDefaultConf.Speed = ETH_SPEED_100M; + 8002e7e: f44f 4380 mov.w r3, #16384 @ 0x4000 + 8002e82: 64bb str r3, [r7, #72] @ 0x48 + macDefaultConf.DuplexMode = ETH_FULLDUPLEX_MODE; + 8002e84: f44f 6300 mov.w r3, #2048 @ 0x800 + 8002e88: 64fb str r3, [r7, #76] @ 0x4c + macDefaultConf.UnicastPausePacketDetect = DISABLE; + 8002e8a: 2300 movs r3, #0 + 8002e8c: f887 3089 strb.w r3, [r7, #137] @ 0x89 + + /* MAC default configuration */ + ETH_SetMACConfig(heth, &macDefaultConf); + 8002e90: f107 0334 add.w r3, r7, #52 @ 0x34 + 8002e94: 4619 mov r1, r3 + 8002e96: 6878 ldr r0, [r7, #4] + 8002e98: f7ff fe86 bl 8002ba8 + + /*--------------- ETHERNET DMA registers default Configuration --------------*/ + dmaDefaultConf.DropTCPIPChecksumErrorFrame = ENABLE; + 8002e9c: 2301 movs r3, #1 + 8002e9e: 753b strb r3, [r7, #20] + dmaDefaultConf.ReceiveStoreForward = ENABLE; + 8002ea0: 2301 movs r3, #1 + 8002ea2: 757b strb r3, [r7, #21] + dmaDefaultConf.FlushRxPacket = ENABLE; + 8002ea4: 2301 movs r3, #1 + 8002ea6: f887 3025 strb.w r3, [r7, #37] @ 0x25 + dmaDefaultConf.TransmitStoreForward = ENABLE; + 8002eaa: 2301 movs r3, #1 + 8002eac: 75bb strb r3, [r7, #22] + dmaDefaultConf.TransmitThresholdControl = ETH_TRANSMITTHRESHOLDCONTROL_64BYTES; + 8002eae: 2300 movs r3, #0 + 8002eb0: 61fb str r3, [r7, #28] + dmaDefaultConf.ForwardErrorFrames = DISABLE; + 8002eb2: 2300 movs r3, #0 + 8002eb4: f887 3024 strb.w r3, [r7, #36] @ 0x24 + dmaDefaultConf.ForwardUndersizedGoodFrames = DISABLE; + 8002eb8: 2300 movs r3, #0 + 8002eba: f887 3026 strb.w r3, [r7, #38] @ 0x26 + dmaDefaultConf.ReceiveThresholdControl = ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES; + 8002ebe: 2300 movs r3, #0 + 8002ec0: 62bb str r3, [r7, #40] @ 0x28 + dmaDefaultConf.SecondFrameOperate = ENABLE; + 8002ec2: 2301 movs r3, #1 + 8002ec4: f887 302c strb.w r3, [r7, #44] @ 0x2c + dmaDefaultConf.AddressAlignedBeats = ENABLE; + 8002ec8: 2301 movs r3, #1 + 8002eca: 733b strb r3, [r7, #12] + dmaDefaultConf.BurstMode = ETH_BURSTLENGTH_FIXED; + 8002ecc: f44f 3380 mov.w r3, #65536 @ 0x10000 + 8002ed0: 613b str r3, [r7, #16] + dmaDefaultConf.RxDMABurstLength = ETH_RXDMABURSTLENGTH_32BEAT; + 8002ed2: f44f 0380 mov.w r3, #4194304 @ 0x400000 + 8002ed6: 623b str r3, [r7, #32] + dmaDefaultConf.TxDMABurstLength = ETH_TXDMABURSTLENGTH_32BEAT; + 8002ed8: f44f 5300 mov.w r3, #8192 @ 0x2000 + 8002edc: 61bb str r3, [r7, #24] + dmaDefaultConf.EnhancedDescriptorFormat = ENABLE; + 8002ede: 2301 movs r3, #1 + 8002ee0: f887 302d strb.w r3, [r7, #45] @ 0x2d + dmaDefaultConf.DescriptorSkipLength = 0x0U; + 8002ee4: 2300 movs r3, #0 + 8002ee6: 633b str r3, [r7, #48] @ 0x30 + dmaDefaultConf.DMAArbitration = ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1; + 8002ee8: 2300 movs r3, #0 + 8002eea: 60bb str r3, [r7, #8] + + /* DMA default configuration */ + ETH_SetDMAConfig(heth, &dmaDefaultConf); + 8002eec: f107 0308 add.w r3, r7, #8 + 8002ef0: 4619 mov r1, r3 + 8002ef2: 6878 ldr r0, [r7, #4] + 8002ef4: f7ff ff08 bl 8002d08 +} + 8002ef8: bf00 nop + 8002efa: 3798 adds r7, #152 @ 0x98 + 8002efc: 46bd mov sp, r7 + 8002efe: bd80 pop {r7, pc} + +08002f00 : + * @arg ETH_MAC_Address3: MAC Address3 + * @param Addr Pointer to MAC address buffer data (6 bytes) + * @retval HAL status + */ +static void ETH_MACAddressConfig(ETH_HandleTypeDef *heth, uint32_t MacAddr, uint8_t *Addr) +{ + 8002f00: b480 push {r7} + 8002f02: b087 sub sp, #28 + 8002f04: af00 add r7, sp, #0 + 8002f06: 60f8 str r0, [r7, #12] + 8002f08: 60b9 str r1, [r7, #8] + 8002f0a: 607a str r2, [r7, #4] + + /* Prevent unused argument(s) compilation warning */ + UNUSED(heth); + + /* Calculate the selected MAC address high register */ + tmpreg1 = ((uint32_t)Addr[5U] << 8U) | (uint32_t)Addr[4U]; + 8002f0c: 687b ldr r3, [r7, #4] + 8002f0e: 3305 adds r3, #5 + 8002f10: 781b ldrb r3, [r3, #0] + 8002f12: 021b lsls r3, r3, #8 + 8002f14: 687a ldr r2, [r7, #4] + 8002f16: 3204 adds r2, #4 + 8002f18: 7812 ldrb r2, [r2, #0] + 8002f1a: 4313 orrs r3, r2 + 8002f1c: 617b str r3, [r7, #20] + /* Load the selected MAC address high register */ + (*(__IO uint32_t *)((uint32_t)(ETH_MAC_ADDR_HBASE + MacAddr))) = tmpreg1; + 8002f1e: 68ba ldr r2, [r7, #8] + 8002f20: 4b11 ldr r3, [pc, #68] @ (8002f68 ) + 8002f22: 4413 add r3, r2 + 8002f24: 461a mov r2, r3 + 8002f26: 697b ldr r3, [r7, #20] + 8002f28: 6013 str r3, [r2, #0] + /* Calculate the selected MAC address low register */ + tmpreg1 = ((uint32_t)Addr[3U] << 24U) | ((uint32_t)Addr[2U] << 16U) | ((uint32_t)Addr[1U] << 8U) | Addr[0U]; + 8002f2a: 687b ldr r3, [r7, #4] + 8002f2c: 3303 adds r3, #3 + 8002f2e: 781b ldrb r3, [r3, #0] + 8002f30: 061a lsls r2, r3, #24 + 8002f32: 687b ldr r3, [r7, #4] + 8002f34: 3302 adds r3, #2 + 8002f36: 781b ldrb r3, [r3, #0] + 8002f38: 041b lsls r3, r3, #16 + 8002f3a: 431a orrs r2, r3 + 8002f3c: 687b ldr r3, [r7, #4] + 8002f3e: 3301 adds r3, #1 + 8002f40: 781b ldrb r3, [r3, #0] + 8002f42: 021b lsls r3, r3, #8 + 8002f44: 4313 orrs r3, r2 + 8002f46: 687a ldr r2, [r7, #4] + 8002f48: 7812 ldrb r2, [r2, #0] + 8002f4a: 4313 orrs r3, r2 + 8002f4c: 617b str r3, [r7, #20] + + /* Load the selected MAC address low register */ + (*(__IO uint32_t *)((uint32_t)(ETH_MAC_ADDR_LBASE + MacAddr))) = tmpreg1; + 8002f4e: 68ba ldr r2, [r7, #8] + 8002f50: 4b06 ldr r3, [pc, #24] @ (8002f6c ) + 8002f52: 4413 add r3, r2 + 8002f54: 461a mov r2, r3 + 8002f56: 697b ldr r3, [r7, #20] + 8002f58: 6013 str r3, [r2, #0] +} + 8002f5a: bf00 nop + 8002f5c: 371c adds r7, #28 + 8002f5e: 46bd mov sp, r7 + 8002f60: f85d 7b04 ldr.w r7, [sp], #4 + 8002f64: 4770 bx lr + 8002f66: bf00 nop + 8002f68: 40028040 .word 0x40028040 + 8002f6c: 40028044 .word 0x40028044 + +08002f70 : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval None + */ +static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth) +{ + 8002f70: b480 push {r7} + 8002f72: b085 sub sp, #20 + 8002f74: af00 add r7, sp, #0 + 8002f76: 6078 str r0, [r7, #4] + ETH_DMADescTypeDef *dmatxdesc; + uint32_t i; + + /* Fill each DMATxDesc descriptor with the right values */ + for (i = 0; i < (uint32_t)ETH_TX_DESC_CNT; i++) + 8002f78: 2300 movs r3, #0 + 8002f7a: 60fb str r3, [r7, #12] + 8002f7c: e03e b.n 8002ffc + { + dmatxdesc = heth->Init.TxDesc + i; + 8002f7e: 687b ldr r3, [r7, #4] + 8002f80: 68d9 ldr r1, [r3, #12] + 8002f82: 68fa ldr r2, [r7, #12] + 8002f84: 4613 mov r3, r2 + 8002f86: 009b lsls r3, r3, #2 + 8002f88: 4413 add r3, r2 + 8002f8a: 00db lsls r3, r3, #3 + 8002f8c: 440b add r3, r1 + 8002f8e: 60bb str r3, [r7, #8] + + WRITE_REG(dmatxdesc->DESC0, 0x0); + 8002f90: 68bb ldr r3, [r7, #8] + 8002f92: 2200 movs r2, #0 + 8002f94: 601a str r2, [r3, #0] + WRITE_REG(dmatxdesc->DESC1, 0x0); + 8002f96: 68bb ldr r3, [r7, #8] + 8002f98: 2200 movs r2, #0 + 8002f9a: 605a str r2, [r3, #4] + WRITE_REG(dmatxdesc->DESC2, 0x0); + 8002f9c: 68bb ldr r3, [r7, #8] + 8002f9e: 2200 movs r2, #0 + 8002fa0: 609a str r2, [r3, #8] + WRITE_REG(dmatxdesc->DESC3, 0x0); + 8002fa2: 68bb ldr r3, [r7, #8] + 8002fa4: 2200 movs r2, #0 + 8002fa6: 60da str r2, [r3, #12] + + WRITE_REG(heth->TxDescList.TxDesc[i], (uint32_t)dmatxdesc); + 8002fa8: 68b9 ldr r1, [r7, #8] + 8002faa: 687b ldr r3, [r7, #4] + 8002fac: 68fa ldr r2, [r7, #12] + 8002fae: 3206 adds r2, #6 + 8002fb0: f843 1022 str.w r1, [r3, r2, lsl #2] + + /* Set Second Address Chained bit */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_TCH); + 8002fb4: 68bb ldr r3, [r7, #8] + 8002fb6: 681b ldr r3, [r3, #0] + 8002fb8: f443 1280 orr.w r2, r3, #1048576 @ 0x100000 + 8002fbc: 68bb ldr r3, [r7, #8] + 8002fbe: 601a str r2, [r3, #0] + + if (i < ((uint32_t)ETH_TX_DESC_CNT - 1U)) + 8002fc0: 68fb ldr r3, [r7, #12] + 8002fc2: 2b02 cmp r3, #2 + 8002fc4: d80c bhi.n 8002fe0 + { + WRITE_REG(dmatxdesc->DESC3, (uint32_t)(heth->Init.TxDesc + i + 1U)); + 8002fc6: 687b ldr r3, [r7, #4] + 8002fc8: 68d9 ldr r1, [r3, #12] + 8002fca: 68fb ldr r3, [r7, #12] + 8002fcc: 1c5a adds r2, r3, #1 + 8002fce: 4613 mov r3, r2 + 8002fd0: 009b lsls r3, r3, #2 + 8002fd2: 4413 add r3, r2 + 8002fd4: 00db lsls r3, r3, #3 + 8002fd6: 440b add r3, r1 + 8002fd8: 461a mov r2, r3 + 8002fda: 68bb ldr r3, [r7, #8] + 8002fdc: 60da str r2, [r3, #12] + 8002fde: e004 b.n 8002fea + } + else + { + WRITE_REG(dmatxdesc->DESC3, (uint32_t)(heth->Init.TxDesc)); + 8002fe0: 687b ldr r3, [r7, #4] + 8002fe2: 68db ldr r3, [r3, #12] + 8002fe4: 461a mov r2, r3 + 8002fe6: 68bb ldr r3, [r7, #8] + 8002fe8: 60da str r2, [r3, #12] + } + + /* Set the DMA Tx descriptors checksum insertion */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL); + 8002fea: 68bb ldr r3, [r7, #8] + 8002fec: 681b ldr r3, [r3, #0] + 8002fee: f443 0240 orr.w r2, r3, #12582912 @ 0xc00000 + 8002ff2: 68bb ldr r3, [r7, #8] + 8002ff4: 601a str r2, [r3, #0] + for (i = 0; i < (uint32_t)ETH_TX_DESC_CNT; i++) + 8002ff6: 68fb ldr r3, [r7, #12] + 8002ff8: 3301 adds r3, #1 + 8002ffa: 60fb str r3, [r7, #12] + 8002ffc: 68fb ldr r3, [r7, #12] + 8002ffe: 2b03 cmp r3, #3 + 8003000: d9bd bls.n 8002f7e + } + + heth->TxDescList.CurTxDesc = 0; + 8003002: 687b ldr r3, [r7, #4] + 8003004: 2200 movs r2, #0 + 8003006: 629a str r2, [r3, #40] @ 0x28 + + /* Set Transmit Descriptor List Address */ + WRITE_REG(heth->Instance->DMATDLAR, (uint32_t) heth->Init.TxDesc); + 8003008: 687b ldr r3, [r7, #4] + 800300a: 68da ldr r2, [r3, #12] + 800300c: 687b ldr r3, [r7, #4] + 800300e: 681b ldr r3, [r3, #0] + 8003010: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 8003014: 611a str r2, [r3, #16] +} + 8003016: bf00 nop + 8003018: 3714 adds r7, #20 + 800301a: 46bd mov sp, r7 + 800301c: f85d 7b04 ldr.w r7, [sp], #4 + 8003020: 4770 bx lr + +08003022 : + * @param heth: pointer to a ETH_HandleTypeDef structure that contains + * the configuration information for ETHERNET module + * @retval None + */ +static void ETH_DMARxDescListInit(ETH_HandleTypeDef *heth) +{ + 8003022: b480 push {r7} + 8003024: b085 sub sp, #20 + 8003026: af00 add r7, sp, #0 + 8003028: 6078 str r0, [r7, #4] + ETH_DMADescTypeDef *dmarxdesc; + uint32_t i; + + for (i = 0; i < (uint32_t)ETH_RX_DESC_CNT; i++) + 800302a: 2300 movs r3, #0 + 800302c: 60fb str r3, [r7, #12] + 800302e: e046 b.n 80030be + { + dmarxdesc = heth->Init.RxDesc + i; + 8003030: 687b ldr r3, [r7, #4] + 8003032: 6919 ldr r1, [r3, #16] + 8003034: 68fa ldr r2, [r7, #12] + 8003036: 4613 mov r3, r2 + 8003038: 009b lsls r3, r3, #2 + 800303a: 4413 add r3, r2 + 800303c: 00db lsls r3, r3, #3 + 800303e: 440b add r3, r1 + 8003040: 60bb str r3, [r7, #8] + + WRITE_REG(dmarxdesc->DESC0, 0x0); + 8003042: 68bb ldr r3, [r7, #8] + 8003044: 2200 movs r2, #0 + 8003046: 601a str r2, [r3, #0] + WRITE_REG(dmarxdesc->DESC1, 0x0); + 8003048: 68bb ldr r3, [r7, #8] + 800304a: 2200 movs r2, #0 + 800304c: 605a str r2, [r3, #4] + WRITE_REG(dmarxdesc->DESC2, 0x0); + 800304e: 68bb ldr r3, [r7, #8] + 8003050: 2200 movs r2, #0 + 8003052: 609a str r2, [r3, #8] + WRITE_REG(dmarxdesc->DESC3, 0x0); + 8003054: 68bb ldr r3, [r7, #8] + 8003056: 2200 movs r2, #0 + 8003058: 60da str r2, [r3, #12] + WRITE_REG(dmarxdesc->BackupAddr0, 0x0); + 800305a: 68bb ldr r3, [r7, #8] + 800305c: 2200 movs r2, #0 + 800305e: 621a str r2, [r3, #32] + WRITE_REG(dmarxdesc->BackupAddr1, 0x0); + 8003060: 68bb ldr r3, [r7, #8] + 8003062: 2200 movs r2, #0 + 8003064: 625a str r2, [r3, #36] @ 0x24 + + /* Set Own bit of the Rx descriptor Status */ + dmarxdesc->DESC0 = ETH_DMARXDESC_OWN; + 8003066: 68bb ldr r3, [r7, #8] + 8003068: f04f 4200 mov.w r2, #2147483648 @ 0x80000000 + 800306c: 601a str r2, [r3, #0] + + /* Set Buffer1 size and Second Address Chained bit */ + dmarxdesc->DESC1 = ETH_DMARXDESC_RCH | ETH_RX_BUF_SIZE; + 800306e: 68bb ldr r3, [r7, #8] + 8003070: f244 52f8 movw r2, #17912 @ 0x45f8 + 8003074: 605a str r2, [r3, #4] + + /* Enable Ethernet DMA Rx Descriptor interrupt */ + dmarxdesc->DESC1 &= ~ETH_DMARXDESC_DIC; + 8003076: 68bb ldr r3, [r7, #8] + 8003078: 685b ldr r3, [r3, #4] + 800307a: f023 4200 bic.w r2, r3, #2147483648 @ 0x80000000 + 800307e: 68bb ldr r3, [r7, #8] + 8003080: 605a str r2, [r3, #4] + + /* Set Rx descritors addresses */ + WRITE_REG(heth->RxDescList.RxDesc[i], (uint32_t)dmarxdesc); + 8003082: 68b9 ldr r1, [r7, #8] + 8003084: 687b ldr r3, [r7, #4] + 8003086: 68fa ldr r2, [r7, #12] + 8003088: 3212 adds r2, #18 + 800308a: f843 1022 str.w r1, [r3, r2, lsl #2] + + if (i < ((uint32_t)ETH_RX_DESC_CNT - 1U)) + 800308e: 68fb ldr r3, [r7, #12] + 8003090: 2b02 cmp r3, #2 + 8003092: d80c bhi.n 80030ae + { + WRITE_REG(dmarxdesc->DESC3, (uint32_t)(heth->Init.RxDesc + i + 1U)); + 8003094: 687b ldr r3, [r7, #4] + 8003096: 6919 ldr r1, [r3, #16] + 8003098: 68fb ldr r3, [r7, #12] + 800309a: 1c5a adds r2, r3, #1 + 800309c: 4613 mov r3, r2 + 800309e: 009b lsls r3, r3, #2 + 80030a0: 4413 add r3, r2 + 80030a2: 00db lsls r3, r3, #3 + 80030a4: 440b add r3, r1 + 80030a6: 461a mov r2, r3 + 80030a8: 68bb ldr r3, [r7, #8] + 80030aa: 60da str r2, [r3, #12] + 80030ac: e004 b.n 80030b8 + } + else + { + WRITE_REG(dmarxdesc->DESC3, (uint32_t)(heth->Init.RxDesc)); + 80030ae: 687b ldr r3, [r7, #4] + 80030b0: 691b ldr r3, [r3, #16] + 80030b2: 461a mov r2, r3 + 80030b4: 68bb ldr r3, [r7, #8] + 80030b6: 60da str r2, [r3, #12] + for (i = 0; i < (uint32_t)ETH_RX_DESC_CNT; i++) + 80030b8: 68fb ldr r3, [r7, #12] + 80030ba: 3301 adds r3, #1 + 80030bc: 60fb str r3, [r7, #12] + 80030be: 68fb ldr r3, [r7, #12] + 80030c0: 2b03 cmp r3, #3 + 80030c2: d9b5 bls.n 8003030 + } + } + + WRITE_REG(heth->RxDescList.RxDescIdx, 0); + 80030c4: 687b ldr r3, [r7, #4] + 80030c6: 2200 movs r2, #0 + 80030c8: 65da str r2, [r3, #92] @ 0x5c + WRITE_REG(heth->RxDescList.RxDescCnt, 0); + 80030ca: 687b ldr r3, [r7, #4] + 80030cc: 2200 movs r2, #0 + 80030ce: 661a str r2, [r3, #96] @ 0x60 + WRITE_REG(heth->RxDescList.RxBuildDescIdx, 0); + 80030d0: 687b ldr r3, [r7, #4] + 80030d2: 2200 movs r2, #0 + 80030d4: 669a str r2, [r3, #104] @ 0x68 + WRITE_REG(heth->RxDescList.RxBuildDescCnt, 0); + 80030d6: 687b ldr r3, [r7, #4] + 80030d8: 2200 movs r2, #0 + 80030da: 66da str r2, [r3, #108] @ 0x6c + WRITE_REG(heth->RxDescList.ItMode, 0); + 80030dc: 687b ldr r3, [r7, #4] + 80030de: 2200 movs r2, #0 + 80030e0: 659a str r2, [r3, #88] @ 0x58 + + /* Set Receive Descriptor List Address */ + WRITE_REG(heth->Instance->DMARDLAR, (uint32_t) heth->Init.RxDesc); + 80030e2: 687b ldr r3, [r7, #4] + 80030e4: 691a ldr r2, [r3, #16] + 80030e6: 687b ldr r3, [r7, #4] + 80030e8: 681b ldr r3, [r3, #0] + 80030ea: f503 5380 add.w r3, r3, #4096 @ 0x1000 + 80030ee: 60da str r2, [r3, #12] +} + 80030f0: bf00 nop + 80030f2: 3714 adds r7, #20 + 80030f4: 46bd mov sp, r7 + 80030f6: f85d 7b04 ldr.w r7, [sp], #4 + 80030fa: 4770 bx lr + +080030fc : + * @param pTxConfig: Tx packet configuration + * @param ItMode: Enable or disable Tx EOT interrept + * @retval Status + */ +static uint32_t ETH_Prepare_Tx_Descriptors(ETH_HandleTypeDef *heth, ETH_TxPacketConfig *pTxConfig, uint32_t ItMode) +{ + 80030fc: b480 push {r7} + 80030fe: b08d sub sp, #52 @ 0x34 + 8003100: af00 add r7, sp, #0 + 8003102: 60f8 str r0, [r7, #12] + 8003104: 60b9 str r1, [r7, #8] + 8003106: 607a str r2, [r7, #4] + ETH_TxDescListTypeDef *dmatxdesclist = &heth->TxDescList; + 8003108: 68fb ldr r3, [r7, #12] + 800310a: 3318 adds r3, #24 + 800310c: 617b str r3, [r7, #20] + uint32_t descidx = dmatxdesclist->CurTxDesc; + 800310e: 697b ldr r3, [r7, #20] + 8003110: 691b ldr r3, [r3, #16] + 8003112: 62fb str r3, [r7, #44] @ 0x2c + uint32_t firstdescidx = dmatxdesclist->CurTxDesc; + 8003114: 697b ldr r3, [r7, #20] + 8003116: 691b ldr r3, [r3, #16] + 8003118: 613b str r3, [r7, #16] + uint32_t idx; + uint32_t descnbr = 0; + 800311a: 2300 movs r3, #0 + 800311c: 627b str r3, [r7, #36] @ 0x24 + ETH_DMADescTypeDef *dmatxdesc = (ETH_DMADescTypeDef *)dmatxdesclist->TxDesc[descidx]; + 800311e: 697b ldr r3, [r7, #20] + 8003120: 6afa ldr r2, [r7, #44] @ 0x2c + 8003122: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 8003126: 623b str r3, [r7, #32] + + ETH_BufferTypeDef *txbuffer = pTxConfig->TxBuffer; + 8003128: 68bb ldr r3, [r7, #8] + 800312a: 689b ldr r3, [r3, #8] + 800312c: 61fb str r3, [r7, #28] + uint32_t bd_count = 0; + 800312e: 2300 movs r3, #0 + 8003130: 61bb str r3, [r7, #24] + + /* Current Tx Descriptor Owned by DMA: cannot be used by the application */ + if ((READ_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_OWN) == ETH_DMATXDESC_OWN) + 8003132: 6a3b ldr r3, [r7, #32] + 8003134: 681b ldr r3, [r3, #0] + 8003136: f003 4300 and.w r3, r3, #2147483648 @ 0x80000000 + 800313a: f1b3 4f00 cmp.w r3, #2147483648 @ 0x80000000 + 800313e: d007 beq.n 8003150 + || (dmatxdesclist->PacketAddress[descidx] != NULL)) + 8003140: 697a ldr r2, [r7, #20] + 8003142: 6afb ldr r3, [r7, #44] @ 0x2c + 8003144: 3304 adds r3, #4 + 8003146: 009b lsls r3, r3, #2 + 8003148: 4413 add r3, r2 + 800314a: 685b ldr r3, [r3, #4] + 800314c: 2b00 cmp r3, #0 + 800314e: d001 beq.n 8003154 + { + return HAL_ETH_ERROR_BUSY; + 8003150: 2302 movs r3, #2 + 8003152: e103 b.n 800335c + } + + + descnbr += 1U; + 8003154: 6a7b ldr r3, [r7, #36] @ 0x24 + 8003156: 3301 adds r3, #1 + 8003158: 627b str r3, [r7, #36] @ 0x24 + + /* Set header or buffer 1 address */ + WRITE_REG(dmatxdesc->DESC2, (uint32_t)txbuffer->buffer); + 800315a: 69fb ldr r3, [r7, #28] + 800315c: 681b ldr r3, [r3, #0] + 800315e: 461a mov r2, r3 + 8003160: 6a3b ldr r3, [r7, #32] + 8003162: 609a str r2, [r3, #8] + + /* Set header or buffer 1 Length */ + MODIFY_REG(dmatxdesc->DESC1, ETH_DMATXDESC_TBS1, txbuffer->len); + 8003164: 6a3b ldr r3, [r7, #32] + 8003166: 685b ldr r3, [r3, #4] + 8003168: f423 53ff bic.w r3, r3, #8160 @ 0x1fe0 + 800316c: f023 031f bic.w r3, r3, #31 + 8003170: 69fa ldr r2, [r7, #28] + 8003172: 6852 ldr r2, [r2, #4] + 8003174: 431a orrs r2, r3 + 8003176: 6a3b ldr r3, [r7, #32] + 8003178: 605a str r2, [r3, #4] + + if (READ_BIT(pTxConfig->Attributes, ETH_TX_PACKETS_FEATURES_CSUM) != 0U) + 800317a: 68bb ldr r3, [r7, #8] + 800317c: 681b ldr r3, [r3, #0] + 800317e: f003 0301 and.w r3, r3, #1 + 8003182: 2b00 cmp r3, #0 + 8003184: d008 beq.n 8003198 + { + MODIFY_REG(dmatxdesc->DESC0, ETH_DMATXDESC_CIC, pTxConfig->ChecksumCtrl); + 8003186: 6a3b ldr r3, [r7, #32] + 8003188: 681b ldr r3, [r3, #0] + 800318a: f423 0240 bic.w r2, r3, #12582912 @ 0xc00000 + 800318e: 68bb ldr r3, [r7, #8] + 8003190: 695b ldr r3, [r3, #20] + 8003192: 431a orrs r2, r3 + 8003194: 6a3b ldr r3, [r7, #32] + 8003196: 601a str r2, [r3, #0] + } + + if (READ_BIT(pTxConfig->Attributes, ETH_TX_PACKETS_FEATURES_CRCPAD) != 0U) + 8003198: 68bb ldr r3, [r7, #8] + 800319a: 681b ldr r3, [r3, #0] + 800319c: f003 0320 and.w r3, r3, #32 + 80031a0: 2b00 cmp r3, #0 + 80031a2: d008 beq.n 80031b6 + { + MODIFY_REG(dmatxdesc->DESC0, ETH_CRC_PAD_DISABLE, pTxConfig->CRCPadCtrl); + 80031a4: 6a3b ldr r3, [r7, #32] + 80031a6: 681b ldr r3, [r3, #0] + 80031a8: f023 6240 bic.w r2, r3, #201326592 @ 0xc000000 + 80031ac: 68bb ldr r3, [r7, #8] + 80031ae: 691b ldr r3, [r3, #16] + 80031b0: 431a orrs r2, r3 + 80031b2: 6a3b ldr r3, [r7, #32] + 80031b4: 601a str r2, [r3, #0] + } + + + if (READ_BIT(pTxConfig->Attributes, ETH_TX_PACKETS_FEATURES_VLANTAG) != 0U) + 80031b6: 68bb ldr r3, [r7, #8] + 80031b8: 681b ldr r3, [r3, #0] + 80031ba: f003 0304 and.w r3, r3, #4 + 80031be: 2b00 cmp r3, #0 + 80031c0: d005 beq.n 80031ce + { + /* Set Vlan Type */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_VF); + 80031c2: 6a3b ldr r3, [r7, #32] + 80031c4: 681b ldr r3, [r3, #0] + 80031c6: f043 0280 orr.w r2, r3, #128 @ 0x80 + 80031ca: 6a3b ldr r3, [r7, #32] + 80031cc: 601a str r2, [r3, #0] + } + + /* Mark it as First Descriptor */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_FS); + 80031ce: 6a3b ldr r3, [r7, #32] + 80031d0: 681b ldr r3, [r3, #0] + 80031d2: f043 5280 orr.w r2, r3, #268435456 @ 0x10000000 + 80031d6: 6a3b ldr r3, [r7, #32] + 80031d8: 601a str r2, [r3, #0] + __ASM volatile ("dmb 0xF":::"memory"); + 80031da: f3bf 8f5f dmb sy +} + 80031de: bf00 nop + + /* Ensure rest of descriptor is written to RAM before the OWN bit */ + __DMB(); + /* set OWN bit of FIRST descriptor */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_OWN); + 80031e0: 6a3b ldr r3, [r7, #32] + 80031e2: 681b ldr r3, [r3, #0] + 80031e4: f043 4200 orr.w r2, r3, #2147483648 @ 0x80000000 + 80031e8: 6a3b ldr r3, [r7, #32] + 80031ea: 601a str r2, [r3, #0] + + /* only if the packet is split into more than one descriptors > 1 */ + while (txbuffer->next != NULL) + 80031ec: e084 b.n 80032f8 + { + /* Clear the LD bit of previous descriptor */ + CLEAR_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_LS); + 80031ee: 6a3b ldr r3, [r7, #32] + 80031f0: 681b ldr r3, [r3, #0] + 80031f2: f023 5200 bic.w r2, r3, #536870912 @ 0x20000000 + 80031f6: 6a3b ldr r3, [r7, #32] + 80031f8: 601a str r2, [r3, #0] + if (ItMode != ((uint32_t)RESET)) + 80031fa: 687b ldr r3, [r7, #4] + 80031fc: 2b00 cmp r3, #0 + 80031fe: d006 beq.n 800320e + { + /* Set Interrupt on completion bit */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_IC); + 8003200: 6a3b ldr r3, [r7, #32] + 8003202: 681b ldr r3, [r3, #0] + 8003204: f043 4280 orr.w r2, r3, #1073741824 @ 0x40000000 + 8003208: 6a3b ldr r3, [r7, #32] + 800320a: 601a str r2, [r3, #0] + 800320c: e005 b.n 800321a + } + else + { + /* Clear Interrupt on completion bit */ + CLEAR_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_IC); + 800320e: 6a3b ldr r3, [r7, #32] + 8003210: 681b ldr r3, [r3, #0] + 8003212: f023 4280 bic.w r2, r3, #1073741824 @ 0x40000000 + 8003216: 6a3b ldr r3, [r7, #32] + 8003218: 601a str r2, [r3, #0] + } + /* Increment current tx descriptor index */ + INCR_TX_DESC_INDEX(descidx, 1U); + 800321a: 6afb ldr r3, [r7, #44] @ 0x2c + 800321c: 3301 adds r3, #1 + 800321e: 62fb str r3, [r7, #44] @ 0x2c + 8003220: 6afb ldr r3, [r7, #44] @ 0x2c + 8003222: 2b03 cmp r3, #3 + 8003224: d902 bls.n 800322c + 8003226: 6afb ldr r3, [r7, #44] @ 0x2c + 8003228: 3b04 subs r3, #4 + 800322a: 62fb str r3, [r7, #44] @ 0x2c + /* Get current descriptor address */ + dmatxdesc = (ETH_DMADescTypeDef *)dmatxdesclist->TxDesc[descidx]; + 800322c: 697b ldr r3, [r7, #20] + 800322e: 6afa ldr r2, [r7, #44] @ 0x2c + 8003230: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 8003234: 623b str r3, [r7, #32] + + /* Clear the FD bit of new Descriptor */ + CLEAR_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_FS); + 8003236: 6a3b ldr r3, [r7, #32] + 8003238: 681b ldr r3, [r3, #0] + 800323a: f023 5280 bic.w r2, r3, #268435456 @ 0x10000000 + 800323e: 6a3b ldr r3, [r7, #32] + 8003240: 601a str r2, [r3, #0] + + /* Current Tx Descriptor Owned by DMA: cannot be used by the application */ + if ((READ_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_OWN) == ETH_DMATXDESC_OWN) + 8003242: 6a3b ldr r3, [r7, #32] + 8003244: 681b ldr r3, [r3, #0] + 8003246: f003 4300 and.w r3, r3, #2147483648 @ 0x80000000 + 800324a: f1b3 4f00 cmp.w r3, #2147483648 @ 0x80000000 + 800324e: d007 beq.n 8003260 + || (dmatxdesclist->PacketAddress[descidx] != NULL)) + 8003250: 697a ldr r2, [r7, #20] + 8003252: 6afb ldr r3, [r7, #44] @ 0x2c + 8003254: 3304 adds r3, #4 + 8003256: 009b lsls r3, r3, #2 + 8003258: 4413 add r3, r2 + 800325a: 685b ldr r3, [r3, #4] + 800325c: 2b00 cmp r3, #0 + 800325e: d029 beq.n 80032b4 + { + descidx = firstdescidx; + 8003260: 693b ldr r3, [r7, #16] + 8003262: 62fb str r3, [r7, #44] @ 0x2c + dmatxdesc = (ETH_DMADescTypeDef *)dmatxdesclist->TxDesc[descidx]; + 8003264: 697b ldr r3, [r7, #20] + 8003266: 6afa ldr r2, [r7, #44] @ 0x2c + 8003268: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 800326c: 623b str r3, [r7, #32] + + /* clear previous desc own bit */ + for (idx = 0; idx < descnbr; idx ++) + 800326e: 2300 movs r3, #0 + 8003270: 62bb str r3, [r7, #40] @ 0x28 + 8003272: e019 b.n 80032a8 + __ASM volatile ("dmb 0xF":::"memory"); + 8003274: f3bf 8f5f dmb sy +} + 8003278: bf00 nop + { + /* Ensure rest of descriptor is written to RAM before the OWN bit */ + __DMB(); + + CLEAR_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_OWN); + 800327a: 6a3b ldr r3, [r7, #32] + 800327c: 681b ldr r3, [r3, #0] + 800327e: f023 4200 bic.w r2, r3, #2147483648 @ 0x80000000 + 8003282: 6a3b ldr r3, [r7, #32] + 8003284: 601a str r2, [r3, #0] + + /* Increment current tx descriptor index */ + INCR_TX_DESC_INDEX(descidx, 1U); + 8003286: 6afb ldr r3, [r7, #44] @ 0x2c + 8003288: 3301 adds r3, #1 + 800328a: 62fb str r3, [r7, #44] @ 0x2c + 800328c: 6afb ldr r3, [r7, #44] @ 0x2c + 800328e: 2b03 cmp r3, #3 + 8003290: d902 bls.n 8003298 + 8003292: 6afb ldr r3, [r7, #44] @ 0x2c + 8003294: 3b04 subs r3, #4 + 8003296: 62fb str r3, [r7, #44] @ 0x2c + /* Get current descriptor address */ + dmatxdesc = (ETH_DMADescTypeDef *)dmatxdesclist->TxDesc[descidx]; + 8003298: 697b ldr r3, [r7, #20] + 800329a: 6afa ldr r2, [r7, #44] @ 0x2c + 800329c: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 80032a0: 623b str r3, [r7, #32] + for (idx = 0; idx < descnbr; idx ++) + 80032a2: 6abb ldr r3, [r7, #40] @ 0x28 + 80032a4: 3301 adds r3, #1 + 80032a6: 62bb str r3, [r7, #40] @ 0x28 + 80032a8: 6aba ldr r2, [r7, #40] @ 0x28 + 80032aa: 6a7b ldr r3, [r7, #36] @ 0x24 + 80032ac: 429a cmp r2, r3 + 80032ae: d3e1 bcc.n 8003274 + } + + return HAL_ETH_ERROR_BUSY; + 80032b0: 2302 movs r3, #2 + 80032b2: e053 b.n 800335c + } + + descnbr += 1U; + 80032b4: 6a7b ldr r3, [r7, #36] @ 0x24 + 80032b6: 3301 adds r3, #1 + 80032b8: 627b str r3, [r7, #36] @ 0x24 + + /* Get the next Tx buffer in the list */ + txbuffer = txbuffer->next; + 80032ba: 69fb ldr r3, [r7, #28] + 80032bc: 689b ldr r3, [r3, #8] + 80032be: 61fb str r3, [r7, #28] + + /* Set header or buffer 1 address */ + WRITE_REG(dmatxdesc->DESC2, (uint32_t)txbuffer->buffer); + 80032c0: 69fb ldr r3, [r7, #28] + 80032c2: 681b ldr r3, [r3, #0] + 80032c4: 461a mov r2, r3 + 80032c6: 6a3b ldr r3, [r7, #32] + 80032c8: 609a str r2, [r3, #8] + + /* Set header or buffer 1 Length */ + MODIFY_REG(dmatxdesc->DESC1, ETH_DMATXDESC_TBS1, txbuffer->len); + 80032ca: 6a3b ldr r3, [r7, #32] + 80032cc: 685b ldr r3, [r3, #4] + 80032ce: f423 53ff bic.w r3, r3, #8160 @ 0x1fe0 + 80032d2: f023 031f bic.w r3, r3, #31 + 80032d6: 69fa ldr r2, [r7, #28] + 80032d8: 6852 ldr r2, [r2, #4] + 80032da: 431a orrs r2, r3 + 80032dc: 6a3b ldr r3, [r7, #32] + 80032de: 605a str r2, [r3, #4] + + bd_count += 1U; + 80032e0: 69bb ldr r3, [r7, #24] + 80032e2: 3301 adds r3, #1 + 80032e4: 61bb str r3, [r7, #24] + __ASM volatile ("dmb 0xF":::"memory"); + 80032e6: f3bf 8f5f dmb sy +} + 80032ea: bf00 nop + + /* Ensure rest of descriptor is written to RAM before the OWN bit */ + __DMB(); + /* Set Own bit */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_OWN); + 80032ec: 6a3b ldr r3, [r7, #32] + 80032ee: 681b ldr r3, [r3, #0] + 80032f0: f043 4200 orr.w r2, r3, #2147483648 @ 0x80000000 + 80032f4: 6a3b ldr r3, [r7, #32] + 80032f6: 601a str r2, [r3, #0] + while (txbuffer->next != NULL) + 80032f8: 69fb ldr r3, [r7, #28] + 80032fa: 689b ldr r3, [r3, #8] + 80032fc: 2b00 cmp r3, #0 + 80032fe: f47f af76 bne.w 80031ee + } + + if (ItMode != ((uint32_t)RESET)) + 8003302: 687b ldr r3, [r7, #4] + 8003304: 2b00 cmp r3, #0 + 8003306: d006 beq.n 8003316 + { + /* Set Interrupt on completion bit */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_IC); + 8003308: 6a3b ldr r3, [r7, #32] + 800330a: 681b ldr r3, [r3, #0] + 800330c: f043 4280 orr.w r2, r3, #1073741824 @ 0x40000000 + 8003310: 6a3b ldr r3, [r7, #32] + 8003312: 601a str r2, [r3, #0] + 8003314: e005 b.n 8003322 + } + else + { + /* Clear Interrupt on completion bit */ + CLEAR_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_IC); + 8003316: 6a3b ldr r3, [r7, #32] + 8003318: 681b ldr r3, [r3, #0] + 800331a: f023 4280 bic.w r2, r3, #1073741824 @ 0x40000000 + 800331e: 6a3b ldr r3, [r7, #32] + 8003320: 601a str r2, [r3, #0] + } + + /* Mark it as LAST descriptor */ + SET_BIT(dmatxdesc->DESC0, ETH_DMATXDESC_LS); + 8003322: 6a3b ldr r3, [r7, #32] + 8003324: 681b ldr r3, [r3, #0] + 8003326: f043 5200 orr.w r2, r3, #536870912 @ 0x20000000 + 800332a: 6a3b ldr r3, [r7, #32] + 800332c: 601a str r2, [r3, #0] + /* Save the current packet address to expose it to the application */ + dmatxdesclist->PacketAddress[descidx] = dmatxdesclist->CurrentPacketAddress; + 800332e: 697b ldr r3, [r7, #20] + 8003330: 6a5a ldr r2, [r3, #36] @ 0x24 + 8003332: 6979 ldr r1, [r7, #20] + 8003334: 6afb ldr r3, [r7, #44] @ 0x2c + 8003336: 3304 adds r3, #4 + 8003338: 009b lsls r3, r3, #2 + 800333a: 440b add r3, r1 + 800333c: 605a str r2, [r3, #4] + + dmatxdesclist->CurTxDesc = descidx; + 800333e: 697b ldr r3, [r7, #20] + 8003340: 6afa ldr r2, [r7, #44] @ 0x2c + 8003342: 611a str r2, [r3, #16] + __ASM volatile ("cpsid i" : : : "memory"); + 8003344: b672 cpsid i +} + 8003346: bf00 nop + + /* disable the interrupt */ + __disable_irq(); + + dmatxdesclist->BuffersInUse += bd_count + 1U; + 8003348: 697b ldr r3, [r7, #20] + 800334a: 6a9a ldr r2, [r3, #40] @ 0x28 + 800334c: 69bb ldr r3, [r7, #24] + 800334e: 4413 add r3, r2 + 8003350: 1c5a adds r2, r3, #1 + 8003352: 697b ldr r3, [r7, #20] + 8003354: 629a str r2, [r3, #40] @ 0x28 + __ASM volatile ("cpsie i" : : : "memory"); + 8003356: b662 cpsie i +} + 8003358: bf00 nop + /* Enable interrupts back */ + __enable_irq(); + + + /* Return function status */ + return HAL_ETH_ERROR_NONE; + 800335a: 2300 movs r3, #0 +} + 800335c: 4618 mov r0, r3 + 800335e: 3734 adds r7, #52 @ 0x34 + 8003360: 46bd mov sp, r7 + 8003362: f85d 7b04 ldr.w r7, [sp], #4 + 8003366: 4770 bx lr + +08003368 : + * @param GPIO_Init pointer to a GPIO_InitTypeDef structure that contains + * the configuration information for the specified GPIO peripheral. + * @retval None + */ +void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) +{ + 8003368: b480 push {r7} + 800336a: b089 sub sp, #36 @ 0x24 + 800336c: af00 add r7, sp, #0 + 800336e: 6078 str r0, [r7, #4] + 8003370: 6039 str r1, [r7, #0] + uint32_t position; + uint32_t ioposition = 0x00U; + 8003372: 2300 movs r3, #0 + 8003374: 617b str r3, [r7, #20] + uint32_t iocurrent = 0x00U; + 8003376: 2300 movs r3, #0 + 8003378: 613b str r3, [r7, #16] + uint32_t temp = 0x00U; + 800337a: 2300 movs r3, #0 + 800337c: 61bb str r3, [r7, #24] + assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Init->Pin)); + assert_param(IS_GPIO_MODE(GPIO_Init->Mode)); + + /* Configure the port pins */ + for(position = 0U; position < GPIO_NUMBER; position++) + 800337e: 2300 movs r3, #0 + 8003380: 61fb str r3, [r7, #28] + 8003382: e177 b.n 8003674 + { + /* Get the IO position */ + ioposition = 0x01U << position; + 8003384: 2201 movs r2, #1 + 8003386: 69fb ldr r3, [r7, #28] + 8003388: fa02 f303 lsl.w r3, r2, r3 + 800338c: 617b str r3, [r7, #20] + /* Get the current IO position */ + iocurrent = (uint32_t)(GPIO_Init->Pin) & ioposition; + 800338e: 683b ldr r3, [r7, #0] + 8003390: 681b ldr r3, [r3, #0] + 8003392: 697a ldr r2, [r7, #20] + 8003394: 4013 ands r3, r2 + 8003396: 613b str r3, [r7, #16] + + if(iocurrent == ioposition) + 8003398: 693a ldr r2, [r7, #16] + 800339a: 697b ldr r3, [r7, #20] + 800339c: 429a cmp r2, r3 + 800339e: f040 8166 bne.w 800366e + { + /*--------------------- GPIO Mode Configuration ------------------------*/ + /* In case of Output or Alternate function mode selection */ + if(((GPIO_Init->Mode & GPIO_MODE) == MODE_OUTPUT) || \ + 80033a2: 683b ldr r3, [r7, #0] + 80033a4: 685b ldr r3, [r3, #4] + 80033a6: f003 0303 and.w r3, r3, #3 + 80033aa: 2b01 cmp r3, #1 + 80033ac: d005 beq.n 80033ba + (GPIO_Init->Mode & GPIO_MODE) == MODE_AF) + 80033ae: 683b ldr r3, [r7, #0] + 80033b0: 685b ldr r3, [r3, #4] + 80033b2: f003 0303 and.w r3, r3, #3 + if(((GPIO_Init->Mode & GPIO_MODE) == MODE_OUTPUT) || \ + 80033b6: 2b02 cmp r3, #2 + 80033b8: d130 bne.n 800341c + { + /* Check the Speed parameter */ + assert_param(IS_GPIO_SPEED(GPIO_Init->Speed)); + /* Configure the IO Speed */ + temp = GPIOx->OSPEEDR; + 80033ba: 687b ldr r3, [r7, #4] + 80033bc: 689b ldr r3, [r3, #8] + 80033be: 61bb str r3, [r7, #24] + temp &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2U)); + 80033c0: 69fb ldr r3, [r7, #28] + 80033c2: 005b lsls r3, r3, #1 + 80033c4: 2203 movs r2, #3 + 80033c6: fa02 f303 lsl.w r3, r2, r3 + 80033ca: 43db mvns r3, r3 + 80033cc: 69ba ldr r2, [r7, #24] + 80033ce: 4013 ands r3, r2 + 80033d0: 61bb str r3, [r7, #24] + temp |= (GPIO_Init->Speed << (position * 2U)); + 80033d2: 683b ldr r3, [r7, #0] + 80033d4: 68da ldr r2, [r3, #12] + 80033d6: 69fb ldr r3, [r7, #28] + 80033d8: 005b lsls r3, r3, #1 + 80033da: fa02 f303 lsl.w r3, r2, r3 + 80033de: 69ba ldr r2, [r7, #24] + 80033e0: 4313 orrs r3, r2 + 80033e2: 61bb str r3, [r7, #24] + GPIOx->OSPEEDR = temp; + 80033e4: 687b ldr r3, [r7, #4] + 80033e6: 69ba ldr r2, [r7, #24] + 80033e8: 609a str r2, [r3, #8] + + /* Configure the IO Output Type */ + temp = GPIOx->OTYPER; + 80033ea: 687b ldr r3, [r7, #4] + 80033ec: 685b ldr r3, [r3, #4] + 80033ee: 61bb str r3, [r7, #24] + temp &= ~(GPIO_OTYPER_OT_0 << position) ; + 80033f0: 2201 movs r2, #1 + 80033f2: 69fb ldr r3, [r7, #28] + 80033f4: fa02 f303 lsl.w r3, r2, r3 + 80033f8: 43db mvns r3, r3 + 80033fa: 69ba ldr r2, [r7, #24] + 80033fc: 4013 ands r3, r2 + 80033fe: 61bb str r3, [r7, #24] + temp |= (((GPIO_Init->Mode & OUTPUT_TYPE) >> OUTPUT_TYPE_Pos) << position); + 8003400: 683b ldr r3, [r7, #0] + 8003402: 685b ldr r3, [r3, #4] + 8003404: 091b lsrs r3, r3, #4 + 8003406: f003 0201 and.w r2, r3, #1 + 800340a: 69fb ldr r3, [r7, #28] + 800340c: fa02 f303 lsl.w r3, r2, r3 + 8003410: 69ba ldr r2, [r7, #24] + 8003412: 4313 orrs r3, r2 + 8003414: 61bb str r3, [r7, #24] + GPIOx->OTYPER = temp; + 8003416: 687b ldr r3, [r7, #4] + 8003418: 69ba ldr r2, [r7, #24] + 800341a: 605a str r2, [r3, #4] + } + + if((GPIO_Init->Mode & GPIO_MODE) != MODE_ANALOG) + 800341c: 683b ldr r3, [r7, #0] + 800341e: 685b ldr r3, [r3, #4] + 8003420: f003 0303 and.w r3, r3, #3 + 8003424: 2b03 cmp r3, #3 + 8003426: d017 beq.n 8003458 + { + /* Check the parameters */ + assert_param(IS_GPIO_PULL(GPIO_Init->Pull)); + + /* Activate the Pull-up or Pull down resistor for the current IO */ + temp = GPIOx->PUPDR; + 8003428: 687b ldr r3, [r7, #4] + 800342a: 68db ldr r3, [r3, #12] + 800342c: 61bb str r3, [r7, #24] + temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U)); + 800342e: 69fb ldr r3, [r7, #28] + 8003430: 005b lsls r3, r3, #1 + 8003432: 2203 movs r2, #3 + 8003434: fa02 f303 lsl.w r3, r2, r3 + 8003438: 43db mvns r3, r3 + 800343a: 69ba ldr r2, [r7, #24] + 800343c: 4013 ands r3, r2 + 800343e: 61bb str r3, [r7, #24] + temp |= ((GPIO_Init->Pull) << (position * 2U)); + 8003440: 683b ldr r3, [r7, #0] + 8003442: 689a ldr r2, [r3, #8] + 8003444: 69fb ldr r3, [r7, #28] + 8003446: 005b lsls r3, r3, #1 + 8003448: fa02 f303 lsl.w r3, r2, r3 + 800344c: 69ba ldr r2, [r7, #24] + 800344e: 4313 orrs r3, r2 + 8003450: 61bb str r3, [r7, #24] + GPIOx->PUPDR = temp; + 8003452: 687b ldr r3, [r7, #4] + 8003454: 69ba ldr r2, [r7, #24] + 8003456: 60da str r2, [r3, #12] + } + + /* In case of Alternate function mode selection */ + if((GPIO_Init->Mode & GPIO_MODE) == MODE_AF) + 8003458: 683b ldr r3, [r7, #0] + 800345a: 685b ldr r3, [r3, #4] + 800345c: f003 0303 and.w r3, r3, #3 + 8003460: 2b02 cmp r3, #2 + 8003462: d123 bne.n 80034ac + { + /* Check the Alternate function parameter */ + assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); + /* Configure Alternate function mapped with the current IO */ + temp = GPIOx->AFR[position >> 3U]; + 8003464: 69fb ldr r3, [r7, #28] + 8003466: 08da lsrs r2, r3, #3 + 8003468: 687b ldr r3, [r7, #4] + 800346a: 3208 adds r2, #8 + 800346c: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 8003470: 61bb str r3, [r7, #24] + temp &= ~(0xFU << ((uint32_t)(position & 0x07U) * 4U)) ; + 8003472: 69fb ldr r3, [r7, #28] + 8003474: f003 0307 and.w r3, r3, #7 + 8003478: 009b lsls r3, r3, #2 + 800347a: 220f movs r2, #15 + 800347c: fa02 f303 lsl.w r3, r2, r3 + 8003480: 43db mvns r3, r3 + 8003482: 69ba ldr r2, [r7, #24] + 8003484: 4013 ands r3, r2 + 8003486: 61bb str r3, [r7, #24] + temp |= ((uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & 0x07U) * 4U)); + 8003488: 683b ldr r3, [r7, #0] + 800348a: 691a ldr r2, [r3, #16] + 800348c: 69fb ldr r3, [r7, #28] + 800348e: f003 0307 and.w r3, r3, #7 + 8003492: 009b lsls r3, r3, #2 + 8003494: fa02 f303 lsl.w r3, r2, r3 + 8003498: 69ba ldr r2, [r7, #24] + 800349a: 4313 orrs r3, r2 + 800349c: 61bb str r3, [r7, #24] + GPIOx->AFR[position >> 3U] = temp; + 800349e: 69fb ldr r3, [r7, #28] + 80034a0: 08da lsrs r2, r3, #3 + 80034a2: 687b ldr r3, [r7, #4] + 80034a4: 3208 adds r2, #8 + 80034a6: 69b9 ldr r1, [r7, #24] + 80034a8: f843 1022 str.w r1, [r3, r2, lsl #2] + } + + /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ + temp = GPIOx->MODER; + 80034ac: 687b ldr r3, [r7, #4] + 80034ae: 681b ldr r3, [r3, #0] + 80034b0: 61bb str r3, [r7, #24] + temp &= ~(GPIO_MODER_MODER0 << (position * 2U)); + 80034b2: 69fb ldr r3, [r7, #28] + 80034b4: 005b lsls r3, r3, #1 + 80034b6: 2203 movs r2, #3 + 80034b8: fa02 f303 lsl.w r3, r2, r3 + 80034bc: 43db mvns r3, r3 + 80034be: 69ba ldr r2, [r7, #24] + 80034c0: 4013 ands r3, r2 + 80034c2: 61bb str r3, [r7, #24] + temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U)); + 80034c4: 683b ldr r3, [r7, #0] + 80034c6: 685b ldr r3, [r3, #4] + 80034c8: f003 0203 and.w r2, r3, #3 + 80034cc: 69fb ldr r3, [r7, #28] + 80034ce: 005b lsls r3, r3, #1 + 80034d0: fa02 f303 lsl.w r3, r2, r3 + 80034d4: 69ba ldr r2, [r7, #24] + 80034d6: 4313 orrs r3, r2 + 80034d8: 61bb str r3, [r7, #24] + GPIOx->MODER = temp; + 80034da: 687b ldr r3, [r7, #4] + 80034dc: 69ba ldr r2, [r7, #24] + 80034de: 601a str r2, [r3, #0] + + /*--------------------- EXTI Mode Configuration ------------------------*/ + /* Configure the External Interrupt or event for the current IO */ + if((GPIO_Init->Mode & EXTI_MODE) != 0x00U) + 80034e0: 683b ldr r3, [r7, #0] + 80034e2: 685b ldr r3, [r3, #4] + 80034e4: f403 3340 and.w r3, r3, #196608 @ 0x30000 + 80034e8: 2b00 cmp r3, #0 + 80034ea: f000 80c0 beq.w 800366e + { + /* Enable SYSCFG Clock */ + __HAL_RCC_SYSCFG_CLK_ENABLE(); + 80034ee: 2300 movs r3, #0 + 80034f0: 60fb str r3, [r7, #12] + 80034f2: 4b66 ldr r3, [pc, #408] @ (800368c ) + 80034f4: 6c5b ldr r3, [r3, #68] @ 0x44 + 80034f6: 4a65 ldr r2, [pc, #404] @ (800368c ) + 80034f8: f443 4380 orr.w r3, r3, #16384 @ 0x4000 + 80034fc: 6453 str r3, [r2, #68] @ 0x44 + 80034fe: 4b63 ldr r3, [pc, #396] @ (800368c ) + 8003500: 6c5b ldr r3, [r3, #68] @ 0x44 + 8003502: f403 4380 and.w r3, r3, #16384 @ 0x4000 + 8003506: 60fb str r3, [r7, #12] + 8003508: 68fb ldr r3, [r7, #12] + + temp = SYSCFG->EXTICR[position >> 2U]; + 800350a: 4a61 ldr r2, [pc, #388] @ (8003690 ) + 800350c: 69fb ldr r3, [r7, #28] + 800350e: 089b lsrs r3, r3, #2 + 8003510: 3302 adds r3, #2 + 8003512: f852 3023 ldr.w r3, [r2, r3, lsl #2] + 8003516: 61bb str r3, [r7, #24] + temp &= ~(0x0FU << (4U * (position & 0x03U))); + 8003518: 69fb ldr r3, [r7, #28] + 800351a: f003 0303 and.w r3, r3, #3 + 800351e: 009b lsls r3, r3, #2 + 8003520: 220f movs r2, #15 + 8003522: fa02 f303 lsl.w r3, r2, r3 + 8003526: 43db mvns r3, r3 + 8003528: 69ba ldr r2, [r7, #24] + 800352a: 4013 ands r3, r2 + 800352c: 61bb str r3, [r7, #24] + temp |= ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U))); + 800352e: 687b ldr r3, [r7, #4] + 8003530: 4a58 ldr r2, [pc, #352] @ (8003694 ) + 8003532: 4293 cmp r3, r2 + 8003534: d037 beq.n 80035a6 + 8003536: 687b ldr r3, [r7, #4] + 8003538: 4a57 ldr r2, [pc, #348] @ (8003698 ) + 800353a: 4293 cmp r3, r2 + 800353c: d031 beq.n 80035a2 + 800353e: 687b ldr r3, [r7, #4] + 8003540: 4a56 ldr r2, [pc, #344] @ (800369c ) + 8003542: 4293 cmp r3, r2 + 8003544: d02b beq.n 800359e + 8003546: 687b ldr r3, [r7, #4] + 8003548: 4a55 ldr r2, [pc, #340] @ (80036a0 ) + 800354a: 4293 cmp r3, r2 + 800354c: d025 beq.n 800359a + 800354e: 687b ldr r3, [r7, #4] + 8003550: 4a54 ldr r2, [pc, #336] @ (80036a4 ) + 8003552: 4293 cmp r3, r2 + 8003554: d01f beq.n 8003596 + 8003556: 687b ldr r3, [r7, #4] + 8003558: 4a53 ldr r2, [pc, #332] @ (80036a8 ) + 800355a: 4293 cmp r3, r2 + 800355c: d019 beq.n 8003592 + 800355e: 687b ldr r3, [r7, #4] + 8003560: 4a52 ldr r2, [pc, #328] @ (80036ac ) + 8003562: 4293 cmp r3, r2 + 8003564: d013 beq.n 800358e + 8003566: 687b ldr r3, [r7, #4] + 8003568: 4a51 ldr r2, [pc, #324] @ (80036b0 ) + 800356a: 4293 cmp r3, r2 + 800356c: d00d beq.n 800358a + 800356e: 687b ldr r3, [r7, #4] + 8003570: 4a50 ldr r2, [pc, #320] @ (80036b4 ) + 8003572: 4293 cmp r3, r2 + 8003574: d007 beq.n 8003586 + 8003576: 687b ldr r3, [r7, #4] + 8003578: 4a4f ldr r2, [pc, #316] @ (80036b8 ) + 800357a: 4293 cmp r3, r2 + 800357c: d101 bne.n 8003582 + 800357e: 2309 movs r3, #9 + 8003580: e012 b.n 80035a8 + 8003582: 230a movs r3, #10 + 8003584: e010 b.n 80035a8 + 8003586: 2308 movs r3, #8 + 8003588: e00e b.n 80035a8 + 800358a: 2307 movs r3, #7 + 800358c: e00c b.n 80035a8 + 800358e: 2306 movs r3, #6 + 8003590: e00a b.n 80035a8 + 8003592: 2305 movs r3, #5 + 8003594: e008 b.n 80035a8 + 8003596: 2304 movs r3, #4 + 8003598: e006 b.n 80035a8 + 800359a: 2303 movs r3, #3 + 800359c: e004 b.n 80035a8 + 800359e: 2302 movs r3, #2 + 80035a0: e002 b.n 80035a8 + 80035a2: 2301 movs r3, #1 + 80035a4: e000 b.n 80035a8 + 80035a6: 2300 movs r3, #0 + 80035a8: 69fa ldr r2, [r7, #28] + 80035aa: f002 0203 and.w r2, r2, #3 + 80035ae: 0092 lsls r2, r2, #2 + 80035b0: 4093 lsls r3, r2 + 80035b2: 69ba ldr r2, [r7, #24] + 80035b4: 4313 orrs r3, r2 + 80035b6: 61bb str r3, [r7, #24] + SYSCFG->EXTICR[position >> 2U] = temp; + 80035b8: 4935 ldr r1, [pc, #212] @ (8003690 ) + 80035ba: 69fb ldr r3, [r7, #28] + 80035bc: 089b lsrs r3, r3, #2 + 80035be: 3302 adds r3, #2 + 80035c0: 69ba ldr r2, [r7, #24] + 80035c2: f841 2023 str.w r2, [r1, r3, lsl #2] + + /* Clear Rising Falling edge configuration */ + temp = EXTI->RTSR; + 80035c6: 4b3d ldr r3, [pc, #244] @ (80036bc ) + 80035c8: 689b ldr r3, [r3, #8] + 80035ca: 61bb str r3, [r7, #24] + temp &= ~((uint32_t)iocurrent); + 80035cc: 693b ldr r3, [r7, #16] + 80035ce: 43db mvns r3, r3 + 80035d0: 69ba ldr r2, [r7, #24] + 80035d2: 4013 ands r3, r2 + 80035d4: 61bb str r3, [r7, #24] + if((GPIO_Init->Mode & TRIGGER_RISING) != 0x00U) + 80035d6: 683b ldr r3, [r7, #0] + 80035d8: 685b ldr r3, [r3, #4] + 80035da: f403 1380 and.w r3, r3, #1048576 @ 0x100000 + 80035de: 2b00 cmp r3, #0 + 80035e0: d003 beq.n 80035ea + { + temp |= iocurrent; + 80035e2: 69ba ldr r2, [r7, #24] + 80035e4: 693b ldr r3, [r7, #16] + 80035e6: 4313 orrs r3, r2 + 80035e8: 61bb str r3, [r7, #24] + } + EXTI->RTSR = temp; + 80035ea: 4a34 ldr r2, [pc, #208] @ (80036bc ) + 80035ec: 69bb ldr r3, [r7, #24] + 80035ee: 6093 str r3, [r2, #8] + + temp = EXTI->FTSR; + 80035f0: 4b32 ldr r3, [pc, #200] @ (80036bc ) + 80035f2: 68db ldr r3, [r3, #12] + 80035f4: 61bb str r3, [r7, #24] + temp &= ~((uint32_t)iocurrent); + 80035f6: 693b ldr r3, [r7, #16] + 80035f8: 43db mvns r3, r3 + 80035fa: 69ba ldr r2, [r7, #24] + 80035fc: 4013 ands r3, r2 + 80035fe: 61bb str r3, [r7, #24] + if((GPIO_Init->Mode & TRIGGER_FALLING) != 0x00U) + 8003600: 683b ldr r3, [r7, #0] + 8003602: 685b ldr r3, [r3, #4] + 8003604: f403 1300 and.w r3, r3, #2097152 @ 0x200000 + 8003608: 2b00 cmp r3, #0 + 800360a: d003 beq.n 8003614 + { + temp |= iocurrent; + 800360c: 69ba ldr r2, [r7, #24] + 800360e: 693b ldr r3, [r7, #16] + 8003610: 4313 orrs r3, r2 + 8003612: 61bb str r3, [r7, #24] + } + EXTI->FTSR = temp; + 8003614: 4a29 ldr r2, [pc, #164] @ (80036bc ) + 8003616: 69bb ldr r3, [r7, #24] + 8003618: 60d3 str r3, [r2, #12] + + temp = EXTI->EMR; + 800361a: 4b28 ldr r3, [pc, #160] @ (80036bc ) + 800361c: 685b ldr r3, [r3, #4] + 800361e: 61bb str r3, [r7, #24] + temp &= ~((uint32_t)iocurrent); + 8003620: 693b ldr r3, [r7, #16] + 8003622: 43db mvns r3, r3 + 8003624: 69ba ldr r2, [r7, #24] + 8003626: 4013 ands r3, r2 + 8003628: 61bb str r3, [r7, #24] + if((GPIO_Init->Mode & EXTI_EVT) != 0x00U) + 800362a: 683b ldr r3, [r7, #0] + 800362c: 685b ldr r3, [r3, #4] + 800362e: f403 3300 and.w r3, r3, #131072 @ 0x20000 + 8003632: 2b00 cmp r3, #0 + 8003634: d003 beq.n 800363e + { + temp |= iocurrent; + 8003636: 69ba ldr r2, [r7, #24] + 8003638: 693b ldr r3, [r7, #16] + 800363a: 4313 orrs r3, r2 + 800363c: 61bb str r3, [r7, #24] + } + EXTI->EMR = temp; + 800363e: 4a1f ldr r2, [pc, #124] @ (80036bc ) + 8003640: 69bb ldr r3, [r7, #24] + 8003642: 6053 str r3, [r2, #4] + + /* Clear EXTI line configuration */ + temp = EXTI->IMR; + 8003644: 4b1d ldr r3, [pc, #116] @ (80036bc ) + 8003646: 681b ldr r3, [r3, #0] + 8003648: 61bb str r3, [r7, #24] + temp &= ~((uint32_t)iocurrent); + 800364a: 693b ldr r3, [r7, #16] + 800364c: 43db mvns r3, r3 + 800364e: 69ba ldr r2, [r7, #24] + 8003650: 4013 ands r3, r2 + 8003652: 61bb str r3, [r7, #24] + if((GPIO_Init->Mode & EXTI_IT) != 0x00U) + 8003654: 683b ldr r3, [r7, #0] + 8003656: 685b ldr r3, [r3, #4] + 8003658: f403 3380 and.w r3, r3, #65536 @ 0x10000 + 800365c: 2b00 cmp r3, #0 + 800365e: d003 beq.n 8003668 + { + temp |= iocurrent; + 8003660: 69ba ldr r2, [r7, #24] + 8003662: 693b ldr r3, [r7, #16] + 8003664: 4313 orrs r3, r2 + 8003666: 61bb str r3, [r7, #24] + } + EXTI->IMR = temp; + 8003668: 4a14 ldr r2, [pc, #80] @ (80036bc ) + 800366a: 69bb ldr r3, [r7, #24] + 800366c: 6013 str r3, [r2, #0] + for(position = 0U; position < GPIO_NUMBER; position++) + 800366e: 69fb ldr r3, [r7, #28] + 8003670: 3301 adds r3, #1 + 8003672: 61fb str r3, [r7, #28] + 8003674: 69fb ldr r3, [r7, #28] + 8003676: 2b0f cmp r3, #15 + 8003678: f67f ae84 bls.w 8003384 + } + } + } +} + 800367c: bf00 nop + 800367e: bf00 nop + 8003680: 3724 adds r7, #36 @ 0x24 + 8003682: 46bd mov sp, r7 + 8003684: f85d 7b04 ldr.w r7, [sp], #4 + 8003688: 4770 bx lr + 800368a: bf00 nop + 800368c: 40023800 .word 0x40023800 + 8003690: 40013800 .word 0x40013800 + 8003694: 40020000 .word 0x40020000 + 8003698: 40020400 .word 0x40020400 + 800369c: 40020800 .word 0x40020800 + 80036a0: 40020c00 .word 0x40020c00 + 80036a4: 40021000 .word 0x40021000 + 80036a8: 40021400 .word 0x40021400 + 80036ac: 40021800 .word 0x40021800 + 80036b0: 40021c00 .word 0x40021c00 + 80036b4: 40022000 .word 0x40022000 + 80036b8: 40022400 .word 0x40022400 + 80036bc: 40013c00 .word 0x40013c00 + +080036c0 : + * @arg GPIO_PIN_RESET: to clear the port pin + * @arg GPIO_PIN_SET: to set the port pin + * @retval None + */ +void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState) +{ + 80036c0: b480 push {r7} + 80036c2: b083 sub sp, #12 + 80036c4: af00 add r7, sp, #0 + 80036c6: 6078 str r0, [r7, #4] + 80036c8: 460b mov r3, r1 + 80036ca: 807b strh r3, [r7, #2] + 80036cc: 4613 mov r3, r2 + 80036ce: 707b strb r3, [r7, #1] + /* Check the parameters */ + assert_param(IS_GPIO_PIN(GPIO_Pin)); + assert_param(IS_GPIO_PIN_ACTION(PinState)); + + if(PinState != GPIO_PIN_RESET) + 80036d0: 787b ldrb r3, [r7, #1] + 80036d2: 2b00 cmp r3, #0 + 80036d4: d003 beq.n 80036de + { + GPIOx->BSRR = GPIO_Pin; + 80036d6: 887a ldrh r2, [r7, #2] + 80036d8: 687b ldr r3, [r7, #4] + 80036da: 619a str r2, [r3, #24] + } + else + { + GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U; + } +} + 80036dc: e003 b.n 80036e6 + GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U; + 80036de: 887b ldrh r3, [r7, #2] + 80036e0: 041a lsls r2, r3, #16 + 80036e2: 687b ldr r3, [r7, #4] + 80036e4: 619a str r2, [r3, #24] +} + 80036e6: bf00 nop + 80036e8: 370c adds r7, #12 + 80036ea: 46bd mov sp, r7 + 80036ec: f85d 7b04 ldr.w r7, [sp], #4 + 80036f0: 4770 bx lr + ... + +080036f4 : + * supported by this API. User should request a transition to HSE Off + * first and then HSE On or HSE Bypass. + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +{ + 80036f4: b580 push {r7, lr} + 80036f6: b086 sub sp, #24 + 80036f8: af00 add r7, sp, #0 + 80036fa: 6078 str r0, [r7, #4] + uint32_t tickstart, pll_config; + + /* Check Null pointer */ + if(RCC_OscInitStruct == NULL) + 80036fc: 687b ldr r3, [r7, #4] + 80036fe: 2b00 cmp r3, #0 + 8003700: d101 bne.n 8003706 + { + return HAL_ERROR; + 8003702: 2301 movs r3, #1 + 8003704: e267 b.n 8003bd6 + } + + /* Check the parameters */ + assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType)); + /*------------------------------- HSE Configuration ------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) + 8003706: 687b ldr r3, [r7, #4] + 8003708: 681b ldr r3, [r3, #0] + 800370a: f003 0301 and.w r3, r3, #1 + 800370e: 2b00 cmp r3, #0 + 8003710: d075 beq.n 80037fe + { + /* Check the parameters */ + assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState)); + /* When the HSE is used as system clock or clock source for PLL in these cases HSE will not disabled */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) ||\ + 8003712: 4b88 ldr r3, [pc, #544] @ (8003934 ) + 8003714: 689b ldr r3, [r3, #8] + 8003716: f003 030c and.w r3, r3, #12 + 800371a: 2b04 cmp r3, #4 + 800371c: d00c beq.n 8003738 + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE))) + 800371e: 4b85 ldr r3, [pc, #532] @ (8003934 ) + 8003720: 689b ldr r3, [r3, #8] + 8003722: f003 030c and.w r3, r3, #12 + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) ||\ + 8003726: 2b08 cmp r3, #8 + 8003728: d112 bne.n 8003750 + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE))) + 800372a: 4b82 ldr r3, [pc, #520] @ (8003934 ) + 800372c: 685b ldr r3, [r3, #4] + 800372e: f403 0380 and.w r3, r3, #4194304 @ 0x400000 + 8003732: f5b3 0f80 cmp.w r3, #4194304 @ 0x400000 + 8003736: d10b bne.n 8003750 + { + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) + 8003738: 4b7e ldr r3, [pc, #504] @ (8003934 ) + 800373a: 681b ldr r3, [r3, #0] + 800373c: f403 3300 and.w r3, r3, #131072 @ 0x20000 + 8003740: 2b00 cmp r3, #0 + 8003742: d05b beq.n 80037fc + 8003744: 687b ldr r3, [r7, #4] + 8003746: 685b ldr r3, [r3, #4] + 8003748: 2b00 cmp r3, #0 + 800374a: d157 bne.n 80037fc + { + return HAL_ERROR; + 800374c: 2301 movs r3, #1 + 800374e: e242 b.n 8003bd6 + } + } + else + { + /* Set the new HSE configuration ---------------------------------------*/ + __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); + 8003750: 687b ldr r3, [r7, #4] + 8003752: 685b ldr r3, [r3, #4] + 8003754: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8003758: d106 bne.n 8003768 + 800375a: 4b76 ldr r3, [pc, #472] @ (8003934 ) + 800375c: 681b ldr r3, [r3, #0] + 800375e: 4a75 ldr r2, [pc, #468] @ (8003934 ) + 8003760: f443 3380 orr.w r3, r3, #65536 @ 0x10000 + 8003764: 6013 str r3, [r2, #0] + 8003766: e01d b.n 80037a4 + 8003768: 687b ldr r3, [r7, #4] + 800376a: 685b ldr r3, [r3, #4] + 800376c: f5b3 2fa0 cmp.w r3, #327680 @ 0x50000 + 8003770: d10c bne.n 800378c + 8003772: 4b70 ldr r3, [pc, #448] @ (8003934 ) + 8003774: 681b ldr r3, [r3, #0] + 8003776: 4a6f ldr r2, [pc, #444] @ (8003934 ) + 8003778: f443 2380 orr.w r3, r3, #262144 @ 0x40000 + 800377c: 6013 str r3, [r2, #0] + 800377e: 4b6d ldr r3, [pc, #436] @ (8003934 ) + 8003780: 681b ldr r3, [r3, #0] + 8003782: 4a6c ldr r2, [pc, #432] @ (8003934 ) + 8003784: f443 3380 orr.w r3, r3, #65536 @ 0x10000 + 8003788: 6013 str r3, [r2, #0] + 800378a: e00b b.n 80037a4 + 800378c: 4b69 ldr r3, [pc, #420] @ (8003934 ) + 800378e: 681b ldr r3, [r3, #0] + 8003790: 4a68 ldr r2, [pc, #416] @ (8003934 ) + 8003792: f423 3380 bic.w r3, r3, #65536 @ 0x10000 + 8003796: 6013 str r3, [r2, #0] + 8003798: 4b66 ldr r3, [pc, #408] @ (8003934 ) + 800379a: 681b ldr r3, [r3, #0] + 800379c: 4a65 ldr r2, [pc, #404] @ (8003934 ) + 800379e: f423 2380 bic.w r3, r3, #262144 @ 0x40000 + 80037a2: 6013 str r3, [r2, #0] + + /* Check the HSE State */ + if((RCC_OscInitStruct->HSEState) != RCC_HSE_OFF) + 80037a4: 687b ldr r3, [r7, #4] + 80037a6: 685b ldr r3, [r3, #4] + 80037a8: 2b00 cmp r3, #0 + 80037aa: d013 beq.n 80037d4 + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 80037ac: f7fe fba4 bl 8001ef8 + 80037b0: 6138 str r0, [r7, #16] + + /* Wait till HSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) + 80037b2: e008 b.n 80037c6 + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + 80037b4: f7fe fba0 bl 8001ef8 + 80037b8: 4602 mov r2, r0 + 80037ba: 693b ldr r3, [r7, #16] + 80037bc: 1ad3 subs r3, r2, r3 + 80037be: 2b64 cmp r3, #100 @ 0x64 + 80037c0: d901 bls.n 80037c6 + { + return HAL_TIMEOUT; + 80037c2: 2303 movs r3, #3 + 80037c4: e207 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) + 80037c6: 4b5b ldr r3, [pc, #364] @ (8003934 ) + 80037c8: 681b ldr r3, [r3, #0] + 80037ca: f403 3300 and.w r3, r3, #131072 @ 0x20000 + 80037ce: 2b00 cmp r3, #0 + 80037d0: d0f0 beq.n 80037b4 + 80037d2: e014 b.n 80037fe + } + } + else + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 80037d4: f7fe fb90 bl 8001ef8 + 80037d8: 6138 str r0, [r7, #16] + + /* Wait till HSE is bypassed or disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) + 80037da: e008 b.n 80037ee + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + 80037dc: f7fe fb8c bl 8001ef8 + 80037e0: 4602 mov r2, r0 + 80037e2: 693b ldr r3, [r7, #16] + 80037e4: 1ad3 subs r3, r2, r3 + 80037e6: 2b64 cmp r3, #100 @ 0x64 + 80037e8: d901 bls.n 80037ee + { + return HAL_TIMEOUT; + 80037ea: 2303 movs r3, #3 + 80037ec: e1f3 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) + 80037ee: 4b51 ldr r3, [pc, #324] @ (8003934 ) + 80037f0: 681b ldr r3, [r3, #0] + 80037f2: f403 3300 and.w r3, r3, #131072 @ 0x20000 + 80037f6: 2b00 cmp r3, #0 + 80037f8: d1f0 bne.n 80037dc + 80037fa: e000 b.n 80037fe + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) + 80037fc: bf00 nop + } + } + } + } + /*----------------------------- HSI Configuration --------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) + 80037fe: 687b ldr r3, [r7, #4] + 8003800: 681b ldr r3, [r3, #0] + 8003802: f003 0302 and.w r3, r3, #2 + 8003806: 2b00 cmp r3, #0 + 8003808: d063 beq.n 80038d2 + /* Check the parameters */ + assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState)); + assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue)); + + /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) ||\ + 800380a: 4b4a ldr r3, [pc, #296] @ (8003934 ) + 800380c: 689b ldr r3, [r3, #8] + 800380e: f003 030c and.w r3, r3, #12 + 8003812: 2b00 cmp r3, #0 + 8003814: d00b beq.n 800382e + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI))) + 8003816: 4b47 ldr r3, [pc, #284] @ (8003934 ) + 8003818: 689b ldr r3, [r3, #8] + 800381a: f003 030c and.w r3, r3, #12 + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) ||\ + 800381e: 2b08 cmp r3, #8 + 8003820: d11c bne.n 800385c + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI))) + 8003822: 4b44 ldr r3, [pc, #272] @ (8003934 ) + 8003824: 685b ldr r3, [r3, #4] + 8003826: f403 0380 and.w r3, r3, #4194304 @ 0x400000 + 800382a: 2b00 cmp r3, #0 + 800382c: d116 bne.n 800385c + { + /* When HSI is used as system clock it will not disabled */ + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) + 800382e: 4b41 ldr r3, [pc, #260] @ (8003934 ) + 8003830: 681b ldr r3, [r3, #0] + 8003832: f003 0302 and.w r3, r3, #2 + 8003836: 2b00 cmp r3, #0 + 8003838: d005 beq.n 8003846 + 800383a: 687b ldr r3, [r7, #4] + 800383c: 68db ldr r3, [r3, #12] + 800383e: 2b01 cmp r3, #1 + 8003840: d001 beq.n 8003846 + { + return HAL_ERROR; + 8003842: 2301 movs r3, #1 + 8003844: e1c7 b.n 8003bd6 + } + /* Otherwise, just the calibration is allowed */ + else + { + /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ + __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); + 8003846: 4b3b ldr r3, [pc, #236] @ (8003934 ) + 8003848: 681b ldr r3, [r3, #0] + 800384a: f023 02f8 bic.w r2, r3, #248 @ 0xf8 + 800384e: 687b ldr r3, [r7, #4] + 8003850: 691b ldr r3, [r3, #16] + 8003852: 00db lsls r3, r3, #3 + 8003854: 4937 ldr r1, [pc, #220] @ (8003934 ) + 8003856: 4313 orrs r3, r2 + 8003858: 600b str r3, [r1, #0] + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) + 800385a: e03a b.n 80038d2 + } + } + else + { + /* Check the HSI State */ + if((RCC_OscInitStruct->HSIState)!= RCC_HSI_OFF) + 800385c: 687b ldr r3, [r7, #4] + 800385e: 68db ldr r3, [r3, #12] + 8003860: 2b00 cmp r3, #0 + 8003862: d020 beq.n 80038a6 + { + /* Enable the Internal High Speed oscillator (HSI). */ + __HAL_RCC_HSI_ENABLE(); + 8003864: 4b34 ldr r3, [pc, #208] @ (8003938 ) + 8003866: 2201 movs r2, #1 + 8003868: 601a str r2, [r3, #0] + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + 800386a: f7fe fb45 bl 8001ef8 + 800386e: 6138 str r0, [r7, #16] + + /* Wait till HSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) + 8003870: e008 b.n 8003884 + { + if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) + 8003872: f7fe fb41 bl 8001ef8 + 8003876: 4602 mov r2, r0 + 8003878: 693b ldr r3, [r7, #16] + 800387a: 1ad3 subs r3, r2, r3 + 800387c: 2b02 cmp r3, #2 + 800387e: d901 bls.n 8003884 + { + return HAL_TIMEOUT; + 8003880: 2303 movs r3, #3 + 8003882: e1a8 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) + 8003884: 4b2b ldr r3, [pc, #172] @ (8003934 ) + 8003886: 681b ldr r3, [r3, #0] + 8003888: f003 0302 and.w r3, r3, #2 + 800388c: 2b00 cmp r3, #0 + 800388e: d0f0 beq.n 8003872 + } + } + + /* Adjusts the Internal High Speed oscillator (HSI) calibration value. */ + __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); + 8003890: 4b28 ldr r3, [pc, #160] @ (8003934 ) + 8003892: 681b ldr r3, [r3, #0] + 8003894: f023 02f8 bic.w r2, r3, #248 @ 0xf8 + 8003898: 687b ldr r3, [r7, #4] + 800389a: 691b ldr r3, [r3, #16] + 800389c: 00db lsls r3, r3, #3 + 800389e: 4925 ldr r1, [pc, #148] @ (8003934 ) + 80038a0: 4313 orrs r3, r2 + 80038a2: 600b str r3, [r1, #0] + 80038a4: e015 b.n 80038d2 + } + else + { + /* Disable the Internal High Speed oscillator (HSI). */ + __HAL_RCC_HSI_DISABLE(); + 80038a6: 4b24 ldr r3, [pc, #144] @ (8003938 ) + 80038a8: 2200 movs r2, #0 + 80038aa: 601a str r2, [r3, #0] + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + 80038ac: f7fe fb24 bl 8001ef8 + 80038b0: 6138 str r0, [r7, #16] + + /* Wait till HSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) + 80038b2: e008 b.n 80038c6 + { + if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) + 80038b4: f7fe fb20 bl 8001ef8 + 80038b8: 4602 mov r2, r0 + 80038ba: 693b ldr r3, [r7, #16] + 80038bc: 1ad3 subs r3, r2, r3 + 80038be: 2b02 cmp r3, #2 + 80038c0: d901 bls.n 80038c6 + { + return HAL_TIMEOUT; + 80038c2: 2303 movs r3, #3 + 80038c4: e187 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) + 80038c6: 4b1b ldr r3, [pc, #108] @ (8003934 ) + 80038c8: 681b ldr r3, [r3, #0] + 80038ca: f003 0302 and.w r3, r3, #2 + 80038ce: 2b00 cmp r3, #0 + 80038d0: d1f0 bne.n 80038b4 + } + } + } + } + /*------------------------------ LSI Configuration -------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) + 80038d2: 687b ldr r3, [r7, #4] + 80038d4: 681b ldr r3, [r3, #0] + 80038d6: f003 0308 and.w r3, r3, #8 + 80038da: 2b00 cmp r3, #0 + 80038dc: d036 beq.n 800394c + { + /* Check the parameters */ + assert_param(IS_RCC_LSI(RCC_OscInitStruct->LSIState)); + + /* Check the LSI State */ + if((RCC_OscInitStruct->LSIState)!= RCC_LSI_OFF) + 80038de: 687b ldr r3, [r7, #4] + 80038e0: 695b ldr r3, [r3, #20] + 80038e2: 2b00 cmp r3, #0 + 80038e4: d016 beq.n 8003914 + { + /* Enable the Internal Low Speed oscillator (LSI). */ + __HAL_RCC_LSI_ENABLE(); + 80038e6: 4b15 ldr r3, [pc, #84] @ (800393c ) + 80038e8: 2201 movs r2, #1 + 80038ea: 601a str r2, [r3, #0] + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + 80038ec: f7fe fb04 bl 8001ef8 + 80038f0: 6138 str r0, [r7, #16] + + /* Wait till LSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == RESET) + 80038f2: e008 b.n 8003906 + { + if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) + 80038f4: f7fe fb00 bl 8001ef8 + 80038f8: 4602 mov r2, r0 + 80038fa: 693b ldr r3, [r7, #16] + 80038fc: 1ad3 subs r3, r2, r3 + 80038fe: 2b02 cmp r3, #2 + 8003900: d901 bls.n 8003906 + { + return HAL_TIMEOUT; + 8003902: 2303 movs r3, #3 + 8003904: e167 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == RESET) + 8003906: 4b0b ldr r3, [pc, #44] @ (8003934 ) + 8003908: 6f5b ldr r3, [r3, #116] @ 0x74 + 800390a: f003 0302 and.w r3, r3, #2 + 800390e: 2b00 cmp r3, #0 + 8003910: d0f0 beq.n 80038f4 + 8003912: e01b b.n 800394c + } + } + else + { + /* Disable the Internal Low Speed oscillator (LSI). */ + __HAL_RCC_LSI_DISABLE(); + 8003914: 4b09 ldr r3, [pc, #36] @ (800393c ) + 8003916: 2200 movs r2, #0 + 8003918: 601a str r2, [r3, #0] + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 800391a: f7fe faed bl 8001ef8 + 800391e: 6138 str r0, [r7, #16] + + /* Wait till LSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != RESET) + 8003920: e00e b.n 8003940 + { + if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) + 8003922: f7fe fae9 bl 8001ef8 + 8003926: 4602 mov r2, r0 + 8003928: 693b ldr r3, [r7, #16] + 800392a: 1ad3 subs r3, r2, r3 + 800392c: 2b02 cmp r3, #2 + 800392e: d907 bls.n 8003940 + { + return HAL_TIMEOUT; + 8003930: 2303 movs r3, #3 + 8003932: e150 b.n 8003bd6 + 8003934: 40023800 .word 0x40023800 + 8003938: 42470000 .word 0x42470000 + 800393c: 42470e80 .word 0x42470e80 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != RESET) + 8003940: 4b88 ldr r3, [pc, #544] @ (8003b64 ) + 8003942: 6f5b ldr r3, [r3, #116] @ 0x74 + 8003944: f003 0302 and.w r3, r3, #2 + 8003948: 2b00 cmp r3, #0 + 800394a: d1ea bne.n 8003922 + } + } + } + } + /*------------------------------ LSE Configuration -------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) + 800394c: 687b ldr r3, [r7, #4] + 800394e: 681b ldr r3, [r3, #0] + 8003950: f003 0304 and.w r3, r3, #4 + 8003954: 2b00 cmp r3, #0 + 8003956: f000 8097 beq.w 8003a88 + { + FlagStatus pwrclkchanged = RESET; + 800395a: 2300 movs r3, #0 + 800395c: 75fb strb r3, [r7, #23] + /* Check the parameters */ + assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState)); + + /* Update LSE configuration in Backup Domain control register */ + /* Requires to enable write access to Backup Domain of necessary */ + if(__HAL_RCC_PWR_IS_CLK_DISABLED()) + 800395e: 4b81 ldr r3, [pc, #516] @ (8003b64 ) + 8003960: 6c1b ldr r3, [r3, #64] @ 0x40 + 8003962: f003 5380 and.w r3, r3, #268435456 @ 0x10000000 + 8003966: 2b00 cmp r3, #0 + 8003968: d10f bne.n 800398a + { + __HAL_RCC_PWR_CLK_ENABLE(); + 800396a: 2300 movs r3, #0 + 800396c: 60bb str r3, [r7, #8] + 800396e: 4b7d ldr r3, [pc, #500] @ (8003b64 ) + 8003970: 6c1b ldr r3, [r3, #64] @ 0x40 + 8003972: 4a7c ldr r2, [pc, #496] @ (8003b64 ) + 8003974: f043 5380 orr.w r3, r3, #268435456 @ 0x10000000 + 8003978: 6413 str r3, [r2, #64] @ 0x40 + 800397a: 4b7a ldr r3, [pc, #488] @ (8003b64 ) + 800397c: 6c1b ldr r3, [r3, #64] @ 0x40 + 800397e: f003 5380 and.w r3, r3, #268435456 @ 0x10000000 + 8003982: 60bb str r3, [r7, #8] + 8003984: 68bb ldr r3, [r7, #8] + pwrclkchanged = SET; + 8003986: 2301 movs r3, #1 + 8003988: 75fb strb r3, [r7, #23] + } + + if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + 800398a: 4b77 ldr r3, [pc, #476] @ (8003b68 ) + 800398c: 681b ldr r3, [r3, #0] + 800398e: f403 7380 and.w r3, r3, #256 @ 0x100 + 8003992: 2b00 cmp r3, #0 + 8003994: d118 bne.n 80039c8 + { + /* Enable write access to Backup domain */ + SET_BIT(PWR->CR, PWR_CR_DBP); + 8003996: 4b74 ldr r3, [pc, #464] @ (8003b68 ) + 8003998: 681b ldr r3, [r3, #0] + 800399a: 4a73 ldr r2, [pc, #460] @ (8003b68 ) + 800399c: f443 7380 orr.w r3, r3, #256 @ 0x100 + 80039a0: 6013 str r3, [r2, #0] + + /* Wait for Backup domain Write protection disable */ + tickstart = HAL_GetTick(); + 80039a2: f7fe faa9 bl 8001ef8 + 80039a6: 6138 str r0, [r7, #16] + + while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + 80039a8: e008 b.n 80039bc + { + if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) + 80039aa: f7fe faa5 bl 8001ef8 + 80039ae: 4602 mov r2, r0 + 80039b0: 693b ldr r3, [r7, #16] + 80039b2: 1ad3 subs r3, r2, r3 + 80039b4: 2b02 cmp r3, #2 + 80039b6: d901 bls.n 80039bc + { + return HAL_TIMEOUT; + 80039b8: 2303 movs r3, #3 + 80039ba: e10c b.n 8003bd6 + while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + 80039bc: 4b6a ldr r3, [pc, #424] @ (8003b68 ) + 80039be: 681b ldr r3, [r3, #0] + 80039c0: f403 7380 and.w r3, r3, #256 @ 0x100 + 80039c4: 2b00 cmp r3, #0 + 80039c6: d0f0 beq.n 80039aa + } + } + } + + /* Set the new LSE configuration -----------------------------------------*/ + __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState); + 80039c8: 687b ldr r3, [r7, #4] + 80039ca: 689b ldr r3, [r3, #8] + 80039cc: 2b01 cmp r3, #1 + 80039ce: d106 bne.n 80039de + 80039d0: 4b64 ldr r3, [pc, #400] @ (8003b64 ) + 80039d2: 6f1b ldr r3, [r3, #112] @ 0x70 + 80039d4: 4a63 ldr r2, [pc, #396] @ (8003b64 ) + 80039d6: f043 0301 orr.w r3, r3, #1 + 80039da: 6713 str r3, [r2, #112] @ 0x70 + 80039dc: e01c b.n 8003a18 + 80039de: 687b ldr r3, [r7, #4] + 80039e0: 689b ldr r3, [r3, #8] + 80039e2: 2b05 cmp r3, #5 + 80039e4: d10c bne.n 8003a00 + 80039e6: 4b5f ldr r3, [pc, #380] @ (8003b64 ) + 80039e8: 6f1b ldr r3, [r3, #112] @ 0x70 + 80039ea: 4a5e ldr r2, [pc, #376] @ (8003b64 ) + 80039ec: f043 0304 orr.w r3, r3, #4 + 80039f0: 6713 str r3, [r2, #112] @ 0x70 + 80039f2: 4b5c ldr r3, [pc, #368] @ (8003b64 ) + 80039f4: 6f1b ldr r3, [r3, #112] @ 0x70 + 80039f6: 4a5b ldr r2, [pc, #364] @ (8003b64 ) + 80039f8: f043 0301 orr.w r3, r3, #1 + 80039fc: 6713 str r3, [r2, #112] @ 0x70 + 80039fe: e00b b.n 8003a18 + 8003a00: 4b58 ldr r3, [pc, #352] @ (8003b64 ) + 8003a02: 6f1b ldr r3, [r3, #112] @ 0x70 + 8003a04: 4a57 ldr r2, [pc, #348] @ (8003b64 ) + 8003a06: f023 0301 bic.w r3, r3, #1 + 8003a0a: 6713 str r3, [r2, #112] @ 0x70 + 8003a0c: 4b55 ldr r3, [pc, #340] @ (8003b64 ) + 8003a0e: 6f1b ldr r3, [r3, #112] @ 0x70 + 8003a10: 4a54 ldr r2, [pc, #336] @ (8003b64 ) + 8003a12: f023 0304 bic.w r3, r3, #4 + 8003a16: 6713 str r3, [r2, #112] @ 0x70 + /* Check the LSE State */ + if((RCC_OscInitStruct->LSEState) != RCC_LSE_OFF) + 8003a18: 687b ldr r3, [r7, #4] + 8003a1a: 689b ldr r3, [r3, #8] + 8003a1c: 2b00 cmp r3, #0 + 8003a1e: d015 beq.n 8003a4c + { + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + 8003a20: f7fe fa6a bl 8001ef8 + 8003a24: 6138 str r0, [r7, #16] + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) + 8003a26: e00a b.n 8003a3e + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + 8003a28: f7fe fa66 bl 8001ef8 + 8003a2c: 4602 mov r2, r0 + 8003a2e: 693b ldr r3, [r7, #16] + 8003a30: 1ad3 subs r3, r2, r3 + 8003a32: f241 3288 movw r2, #5000 @ 0x1388 + 8003a36: 4293 cmp r3, r2 + 8003a38: d901 bls.n 8003a3e + { + return HAL_TIMEOUT; + 8003a3a: 2303 movs r3, #3 + 8003a3c: e0cb b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) + 8003a3e: 4b49 ldr r3, [pc, #292] @ (8003b64 ) + 8003a40: 6f1b ldr r3, [r3, #112] @ 0x70 + 8003a42: f003 0302 and.w r3, r3, #2 + 8003a46: 2b00 cmp r3, #0 + 8003a48: d0ee beq.n 8003a28 + 8003a4a: e014 b.n 8003a76 + } + } + else + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 8003a4c: f7fe fa54 bl 8001ef8 + 8003a50: 6138 str r0, [r7, #16] + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) + 8003a52: e00a b.n 8003a6a + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + 8003a54: f7fe fa50 bl 8001ef8 + 8003a58: 4602 mov r2, r0 + 8003a5a: 693b ldr r3, [r7, #16] + 8003a5c: 1ad3 subs r3, r2, r3 + 8003a5e: f241 3288 movw r2, #5000 @ 0x1388 + 8003a62: 4293 cmp r3, r2 + 8003a64: d901 bls.n 8003a6a + { + return HAL_TIMEOUT; + 8003a66: 2303 movs r3, #3 + 8003a68: e0b5 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) + 8003a6a: 4b3e ldr r3, [pc, #248] @ (8003b64 ) + 8003a6c: 6f1b ldr r3, [r3, #112] @ 0x70 + 8003a6e: f003 0302 and.w r3, r3, #2 + 8003a72: 2b00 cmp r3, #0 + 8003a74: d1ee bne.n 8003a54 + } + } + } + + /* Restore clock configuration if changed */ + if(pwrclkchanged == SET) + 8003a76: 7dfb ldrb r3, [r7, #23] + 8003a78: 2b01 cmp r3, #1 + 8003a7a: d105 bne.n 8003a88 + { + __HAL_RCC_PWR_CLK_DISABLE(); + 8003a7c: 4b39 ldr r3, [pc, #228] @ (8003b64 ) + 8003a7e: 6c1b ldr r3, [r3, #64] @ 0x40 + 8003a80: 4a38 ldr r2, [pc, #224] @ (8003b64 ) + 8003a82: f023 5380 bic.w r3, r3, #268435456 @ 0x10000000 + 8003a86: 6413 str r3, [r2, #64] @ 0x40 + } + } + /*-------------------------------- PLL Configuration -----------------------*/ + /* Check the parameters */ + assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState)); + if ((RCC_OscInitStruct->PLL.PLLState) != RCC_PLL_NONE) + 8003a88: 687b ldr r3, [r7, #4] + 8003a8a: 699b ldr r3, [r3, #24] + 8003a8c: 2b00 cmp r3, #0 + 8003a8e: f000 80a1 beq.w 8003bd4 + { + /* Check if the PLL is used as system clock or not */ + if(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL) + 8003a92: 4b34 ldr r3, [pc, #208] @ (8003b64 ) + 8003a94: 689b ldr r3, [r3, #8] + 8003a96: f003 030c and.w r3, r3, #12 + 8003a9a: 2b08 cmp r3, #8 + 8003a9c: d05c beq.n 8003b58 + { + if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_ON) + 8003a9e: 687b ldr r3, [r7, #4] + 8003aa0: 699b ldr r3, [r3, #24] + 8003aa2: 2b02 cmp r3, #2 + 8003aa4: d141 bne.n 8003b2a + assert_param(IS_RCC_PLLN_VALUE(RCC_OscInitStruct->PLL.PLLN)); + assert_param(IS_RCC_PLLP_VALUE(RCC_OscInitStruct->PLL.PLLP)); + assert_param(IS_RCC_PLLQ_VALUE(RCC_OscInitStruct->PLL.PLLQ)); + + /* Disable the main PLL. */ + __HAL_RCC_PLL_DISABLE(); + 8003aa6: 4b31 ldr r3, [pc, #196] @ (8003b6c ) + 8003aa8: 2200 movs r2, #0 + 8003aaa: 601a str r2, [r3, #0] + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 8003aac: f7fe fa24 bl 8001ef8 + 8003ab0: 6138 str r0, [r7, #16] + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + 8003ab2: e008 b.n 8003ac6 + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + 8003ab4: f7fe fa20 bl 8001ef8 + 8003ab8: 4602 mov r2, r0 + 8003aba: 693b ldr r3, [r7, #16] + 8003abc: 1ad3 subs r3, r2, r3 + 8003abe: 2b02 cmp r3, #2 + 8003ac0: d901 bls.n 8003ac6 + { + return HAL_TIMEOUT; + 8003ac2: 2303 movs r3, #3 + 8003ac4: e087 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + 8003ac6: 4b27 ldr r3, [pc, #156] @ (8003b64 ) + 8003ac8: 681b ldr r3, [r3, #0] + 8003aca: f003 7300 and.w r3, r3, #33554432 @ 0x2000000 + 8003ace: 2b00 cmp r3, #0 + 8003ad0: d1f0 bne.n 8003ab4 + } + } + + /* Configure the main PLL clock source, multiplication and division factors. */ + WRITE_REG(RCC->PLLCFGR, (RCC_OscInitStruct->PLL.PLLSource | \ + 8003ad2: 687b ldr r3, [r7, #4] + 8003ad4: 69da ldr r2, [r3, #28] + 8003ad6: 687b ldr r3, [r7, #4] + 8003ad8: 6a1b ldr r3, [r3, #32] + 8003ada: 431a orrs r2, r3 + 8003adc: 687b ldr r3, [r7, #4] + 8003ade: 6a5b ldr r3, [r3, #36] @ 0x24 + 8003ae0: 019b lsls r3, r3, #6 + 8003ae2: 431a orrs r2, r3 + 8003ae4: 687b ldr r3, [r7, #4] + 8003ae6: 6a9b ldr r3, [r3, #40] @ 0x28 + 8003ae8: 085b lsrs r3, r3, #1 + 8003aea: 3b01 subs r3, #1 + 8003aec: 041b lsls r3, r3, #16 + 8003aee: 431a orrs r2, r3 + 8003af0: 687b ldr r3, [r7, #4] + 8003af2: 6adb ldr r3, [r3, #44] @ 0x2c + 8003af4: 061b lsls r3, r3, #24 + 8003af6: 491b ldr r1, [pc, #108] @ (8003b64 ) + 8003af8: 4313 orrs r3, r2 + 8003afa: 604b str r3, [r1, #4] + RCC_OscInitStruct->PLL.PLLM | \ + (RCC_OscInitStruct->PLL.PLLN << RCC_PLLCFGR_PLLN_Pos) | \ + (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U) << RCC_PLLCFGR_PLLP_Pos) | \ + (RCC_OscInitStruct->PLL.PLLQ << RCC_PLLCFGR_PLLQ_Pos))); + /* Enable the main PLL. */ + __HAL_RCC_PLL_ENABLE(); + 8003afc: 4b1b ldr r3, [pc, #108] @ (8003b6c ) + 8003afe: 2201 movs r2, #1 + 8003b00: 601a str r2, [r3, #0] + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 8003b02: f7fe f9f9 bl 8001ef8 + 8003b06: 6138 str r0, [r7, #16] + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + 8003b08: e008 b.n 8003b1c + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + 8003b0a: f7fe f9f5 bl 8001ef8 + 8003b0e: 4602 mov r2, r0 + 8003b10: 693b ldr r3, [r7, #16] + 8003b12: 1ad3 subs r3, r2, r3 + 8003b14: 2b02 cmp r3, #2 + 8003b16: d901 bls.n 8003b1c + { + return HAL_TIMEOUT; + 8003b18: 2303 movs r3, #3 + 8003b1a: e05c b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + 8003b1c: 4b11 ldr r3, [pc, #68] @ (8003b64 ) + 8003b1e: 681b ldr r3, [r3, #0] + 8003b20: f003 7300 and.w r3, r3, #33554432 @ 0x2000000 + 8003b24: 2b00 cmp r3, #0 + 8003b26: d0f0 beq.n 8003b0a + 8003b28: e054 b.n 8003bd4 + } + } + else + { + /* Disable the main PLL. */ + __HAL_RCC_PLL_DISABLE(); + 8003b2a: 4b10 ldr r3, [pc, #64] @ (8003b6c ) + 8003b2c: 2200 movs r2, #0 + 8003b2e: 601a str r2, [r3, #0] + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 8003b30: f7fe f9e2 bl 8001ef8 + 8003b34: 6138 str r0, [r7, #16] + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + 8003b36: e008 b.n 8003b4a + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + 8003b38: f7fe f9de bl 8001ef8 + 8003b3c: 4602 mov r2, r0 + 8003b3e: 693b ldr r3, [r7, #16] + 8003b40: 1ad3 subs r3, r2, r3 + 8003b42: 2b02 cmp r3, #2 + 8003b44: d901 bls.n 8003b4a + { + return HAL_TIMEOUT; + 8003b46: 2303 movs r3, #3 + 8003b48: e045 b.n 8003bd6 + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + 8003b4a: 4b06 ldr r3, [pc, #24] @ (8003b64 ) + 8003b4c: 681b ldr r3, [r3, #0] + 8003b4e: f003 7300 and.w r3, r3, #33554432 @ 0x2000000 + 8003b52: 2b00 cmp r3, #0 + 8003b54: d1f0 bne.n 8003b38 + 8003b56: e03d b.n 8003bd4 + } + } + else + { + /* Check if there is a request to disable the PLL used as System clock source */ + if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF) + 8003b58: 687b ldr r3, [r7, #4] + 8003b5a: 699b ldr r3, [r3, #24] + 8003b5c: 2b01 cmp r3, #1 + 8003b5e: d107 bne.n 8003b70 + { + return HAL_ERROR; + 8003b60: 2301 movs r3, #1 + 8003b62: e038 b.n 8003bd6 + 8003b64: 40023800 .word 0x40023800 + 8003b68: 40007000 .word 0x40007000 + 8003b6c: 42470060 .word 0x42470060 + } + else + { + /* Do not return HAL_ERROR if request repeats the current configuration */ + pll_config = RCC->PLLCFGR; + 8003b70: 4b1b ldr r3, [pc, #108] @ (8003be0 ) + 8003b72: 685b ldr r3, [r3, #4] + 8003b74: 60fb str r3, [r7, #12] + (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != (RCC_OscInitStruct->PLL.PLLN) << RCC_PLLCFGR_PLLN_Pos) || + (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U)) << RCC_PLLCFGR_PLLP_Pos) || + (READ_BIT(pll_config, RCC_PLLCFGR_PLLQ) != (RCC_OscInitStruct->PLL.PLLQ << RCC_PLLCFGR_PLLQ_Pos)) || + (READ_BIT(pll_config, RCC_PLLCFGR_PLLR) != (RCC_OscInitStruct->PLL.PLLR << RCC_PLLCFGR_PLLR_Pos))) +#else + if (((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF) || + 8003b76: 687b ldr r3, [r7, #4] + 8003b78: 699b ldr r3, [r3, #24] + 8003b7a: 2b01 cmp r3, #1 + 8003b7c: d028 beq.n 8003bd0 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || + 8003b7e: 68fb ldr r3, [r7, #12] + 8003b80: f403 0280 and.w r2, r3, #4194304 @ 0x400000 + 8003b84: 687b ldr r3, [r7, #4] + 8003b86: 69db ldr r3, [r3, #28] + if (((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF) || + 8003b88: 429a cmp r2, r3 + 8003b8a: d121 bne.n 8003bd0 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != (RCC_OscInitStruct->PLL.PLLM) << RCC_PLLCFGR_PLLM_Pos) || + 8003b8c: 68fb ldr r3, [r7, #12] + 8003b8e: f003 023f and.w r2, r3, #63 @ 0x3f + 8003b92: 687b ldr r3, [r7, #4] + 8003b94: 6a1b ldr r3, [r3, #32] + (READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || + 8003b96: 429a cmp r2, r3 + 8003b98: d11a bne.n 8003bd0 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != (RCC_OscInitStruct->PLL.PLLN) << RCC_PLLCFGR_PLLN_Pos) || + 8003b9a: 68fa ldr r2, [r7, #12] + 8003b9c: f647 73c0 movw r3, #32704 @ 0x7fc0 + 8003ba0: 4013 ands r3, r2 + 8003ba2: 687a ldr r2, [r7, #4] + 8003ba4: 6a52 ldr r2, [r2, #36] @ 0x24 + 8003ba6: 0192 lsls r2, r2, #6 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != (RCC_OscInitStruct->PLL.PLLM) << RCC_PLLCFGR_PLLM_Pos) || + 8003ba8: 4293 cmp r3, r2 + 8003baa: d111 bne.n 8003bd0 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U)) << RCC_PLLCFGR_PLLP_Pos) || + 8003bac: 68fb ldr r3, [r7, #12] + 8003bae: f403 3240 and.w r2, r3, #196608 @ 0x30000 + 8003bb2: 687b ldr r3, [r7, #4] + 8003bb4: 6a9b ldr r3, [r3, #40] @ 0x28 + 8003bb6: 085b lsrs r3, r3, #1 + 8003bb8: 3b01 subs r3, #1 + 8003bba: 041b lsls r3, r3, #16 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != (RCC_OscInitStruct->PLL.PLLN) << RCC_PLLCFGR_PLLN_Pos) || + 8003bbc: 429a cmp r2, r3 + 8003bbe: d107 bne.n 8003bd0 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLQ) != (RCC_OscInitStruct->PLL.PLLQ << RCC_PLLCFGR_PLLQ_Pos))) + 8003bc0: 68fb ldr r3, [r7, #12] + 8003bc2: f003 6270 and.w r2, r3, #251658240 @ 0xf000000 + 8003bc6: 687b ldr r3, [r7, #4] + 8003bc8: 6adb ldr r3, [r3, #44] @ 0x2c + 8003bca: 061b lsls r3, r3, #24 + (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U)) << RCC_PLLCFGR_PLLP_Pos) || + 8003bcc: 429a cmp r2, r3 + 8003bce: d001 beq.n 8003bd4 +#endif + { + return HAL_ERROR; + 8003bd0: 2301 movs r3, #1 + 8003bd2: e000 b.n 8003bd6 + } + } + } + } + return HAL_OK; + 8003bd4: 2300 movs r3, #0 +} + 8003bd6: 4618 mov r0, r3 + 8003bd8: 3718 adds r7, #24 + 8003bda: 46bd mov sp, r7 + 8003bdc: bd80 pop {r7, pc} + 8003bde: bf00 nop + 8003be0: 40023800 .word 0x40023800 + +08003be4 : + * HPRE[3:0] bits to ensure that HCLK not exceed the maximum allowed frequency + * (for more details refer to section above "Initialization/de-initialization functions") + * @retval None + */ +HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency) +{ + 8003be4: b580 push {r7, lr} + 8003be6: b084 sub sp, #16 + 8003be8: af00 add r7, sp, #0 + 8003bea: 6078 str r0, [r7, #4] + 8003bec: 6039 str r1, [r7, #0] + uint32_t tickstart; + + /* Check Null pointer */ + if(RCC_ClkInitStruct == NULL) + 8003bee: 687b ldr r3, [r7, #4] + 8003bf0: 2b00 cmp r3, #0 + 8003bf2: d101 bne.n 8003bf8 + { + return HAL_ERROR; + 8003bf4: 2301 movs r3, #1 + 8003bf6: e0cc b.n 8003d92 + /* To correctly read data from FLASH memory, the number of wait states (LATENCY) + must be correctly programmed according to the frequency of the CPU clock + (HCLK) and the supply voltage of the device. */ + + /* Increasing the number of wait states because of higher CPU frequency */ + if(FLatency > __HAL_FLASH_GET_LATENCY()) + 8003bf8: 4b68 ldr r3, [pc, #416] @ (8003d9c ) + 8003bfa: 681b ldr r3, [r3, #0] + 8003bfc: f003 030f and.w r3, r3, #15 + 8003c00: 683a ldr r2, [r7, #0] + 8003c02: 429a cmp r2, r3 + 8003c04: d90c bls.n 8003c20 + { + /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */ + __HAL_FLASH_SET_LATENCY(FLatency); + 8003c06: 4b65 ldr r3, [pc, #404] @ (8003d9c ) + 8003c08: 683a ldr r2, [r7, #0] + 8003c0a: b2d2 uxtb r2, r2 + 8003c0c: 701a strb r2, [r3, #0] + + /* Check that the new number of wait states is taken into account to access the Flash + memory by reading the FLASH_ACR register */ + if(__HAL_FLASH_GET_LATENCY() != FLatency) + 8003c0e: 4b63 ldr r3, [pc, #396] @ (8003d9c ) + 8003c10: 681b ldr r3, [r3, #0] + 8003c12: f003 030f and.w r3, r3, #15 + 8003c16: 683a ldr r2, [r7, #0] + 8003c18: 429a cmp r2, r3 + 8003c1a: d001 beq.n 8003c20 + { + return HAL_ERROR; + 8003c1c: 2301 movs r3, #1 + 8003c1e: e0b8 b.n 8003d92 + } + } + + /*-------------------------- HCLK Configuration --------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK) + 8003c20: 687b ldr r3, [r7, #4] + 8003c22: 681b ldr r3, [r3, #0] + 8003c24: f003 0302 and.w r3, r3, #2 + 8003c28: 2b00 cmp r3, #0 + 8003c2a: d020 beq.n 8003c6e + { + /* Set the highest APBx dividers in order to ensure that we do not go through + a non-spec phase whatever we decrease or increase HCLK. */ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1) + 8003c2c: 687b ldr r3, [r7, #4] + 8003c2e: 681b ldr r3, [r3, #0] + 8003c30: f003 0304 and.w r3, r3, #4 + 8003c34: 2b00 cmp r3, #0 + 8003c36: d005 beq.n 8003c44 + { + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_HCLK_DIV16); + 8003c38: 4b59 ldr r3, [pc, #356] @ (8003da0 ) + 8003c3a: 689b ldr r3, [r3, #8] + 8003c3c: 4a58 ldr r2, [pc, #352] @ (8003da0 ) + 8003c3e: f443 53e0 orr.w r3, r3, #7168 @ 0x1c00 + 8003c42: 6093 str r3, [r2, #8] + } + + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2) + 8003c44: 687b ldr r3, [r7, #4] + 8003c46: 681b ldr r3, [r3, #0] + 8003c48: f003 0308 and.w r3, r3, #8 + 8003c4c: 2b00 cmp r3, #0 + 8003c4e: d005 beq.n 8003c5c + { + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, (RCC_HCLK_DIV16 << 3)); + 8003c50: 4b53 ldr r3, [pc, #332] @ (8003da0 ) + 8003c52: 689b ldr r3, [r3, #8] + 8003c54: 4a52 ldr r2, [pc, #328] @ (8003da0 ) + 8003c56: f443 4360 orr.w r3, r3, #57344 @ 0xe000 + 8003c5a: 6093 str r3, [r2, #8] + } + + assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider)); + MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider); + 8003c5c: 4b50 ldr r3, [pc, #320] @ (8003da0 ) + 8003c5e: 689b ldr r3, [r3, #8] + 8003c60: f023 02f0 bic.w r2, r3, #240 @ 0xf0 + 8003c64: 687b ldr r3, [r7, #4] + 8003c66: 689b ldr r3, [r3, #8] + 8003c68: 494d ldr r1, [pc, #308] @ (8003da0 ) + 8003c6a: 4313 orrs r3, r2 + 8003c6c: 608b str r3, [r1, #8] + } + + /*------------------------- SYSCLK Configuration ---------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK) + 8003c6e: 687b ldr r3, [r7, #4] + 8003c70: 681b ldr r3, [r3, #0] + 8003c72: f003 0301 and.w r3, r3, #1 + 8003c76: 2b00 cmp r3, #0 + 8003c78: d044 beq.n 8003d04 + { + assert_param(IS_RCC_SYSCLKSOURCE(RCC_ClkInitStruct->SYSCLKSource)); + + /* HSE is selected as System Clock Source */ + if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) + 8003c7a: 687b ldr r3, [r7, #4] + 8003c7c: 685b ldr r3, [r3, #4] + 8003c7e: 2b01 cmp r3, #1 + 8003c80: d107 bne.n 8003c92 + { + /* Check the HSE ready flag */ + if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) + 8003c82: 4b47 ldr r3, [pc, #284] @ (8003da0 ) + 8003c84: 681b ldr r3, [r3, #0] + 8003c86: f403 3300 and.w r3, r3, #131072 @ 0x20000 + 8003c8a: 2b00 cmp r3, #0 + 8003c8c: d119 bne.n 8003cc2 + { + return HAL_ERROR; + 8003c8e: 2301 movs r3, #1 + 8003c90: e07f b.n 8003d92 + } + } + /* PLL is selected as System Clock Source */ + else if((RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) || + 8003c92: 687b ldr r3, [r7, #4] + 8003c94: 685b ldr r3, [r3, #4] + 8003c96: 2b02 cmp r3, #2 + 8003c98: d003 beq.n 8003ca2 + (RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLRCLK)) + 8003c9a: 687b ldr r3, [r7, #4] + 8003c9c: 685b ldr r3, [r3, #4] + else if((RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) || + 8003c9e: 2b03 cmp r3, #3 + 8003ca0: d107 bne.n 8003cb2 + { + /* Check the PLL ready flag */ + if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + 8003ca2: 4b3f ldr r3, [pc, #252] @ (8003da0 ) + 8003ca4: 681b ldr r3, [r3, #0] + 8003ca6: f003 7300 and.w r3, r3, #33554432 @ 0x2000000 + 8003caa: 2b00 cmp r3, #0 + 8003cac: d109 bne.n 8003cc2 + { + return HAL_ERROR; + 8003cae: 2301 movs r3, #1 + 8003cb0: e06f b.n 8003d92 + } + /* HSI is selected as System Clock Source */ + else + { + /* Check the HSI ready flag */ + if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) + 8003cb2: 4b3b ldr r3, [pc, #236] @ (8003da0 ) + 8003cb4: 681b ldr r3, [r3, #0] + 8003cb6: f003 0302 and.w r3, r3, #2 + 8003cba: 2b00 cmp r3, #0 + 8003cbc: d101 bne.n 8003cc2 + { + return HAL_ERROR; + 8003cbe: 2301 movs r3, #1 + 8003cc0: e067 b.n 8003d92 + } + } + + __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource); + 8003cc2: 4b37 ldr r3, [pc, #220] @ (8003da0 ) + 8003cc4: 689b ldr r3, [r3, #8] + 8003cc6: f023 0203 bic.w r2, r3, #3 + 8003cca: 687b ldr r3, [r7, #4] + 8003ccc: 685b ldr r3, [r3, #4] + 8003cce: 4934 ldr r1, [pc, #208] @ (8003da0 ) + 8003cd0: 4313 orrs r3, r2 + 8003cd2: 608b str r3, [r1, #8] + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + 8003cd4: f7fe f910 bl 8001ef8 + 8003cd8: 60f8 str r0, [r7, #12] + + while (__HAL_RCC_GET_SYSCLK_SOURCE() != (RCC_ClkInitStruct->SYSCLKSource << RCC_CFGR_SWS_Pos)) + 8003cda: e00a b.n 8003cf2 + { + if ((HAL_GetTick() - tickstart) > CLOCKSWITCH_TIMEOUT_VALUE) + 8003cdc: f7fe f90c bl 8001ef8 + 8003ce0: 4602 mov r2, r0 + 8003ce2: 68fb ldr r3, [r7, #12] + 8003ce4: 1ad3 subs r3, r2, r3 + 8003ce6: f241 3288 movw r2, #5000 @ 0x1388 + 8003cea: 4293 cmp r3, r2 + 8003cec: d901 bls.n 8003cf2 + { + return HAL_TIMEOUT; + 8003cee: 2303 movs r3, #3 + 8003cf0: e04f b.n 8003d92 + while (__HAL_RCC_GET_SYSCLK_SOURCE() != (RCC_ClkInitStruct->SYSCLKSource << RCC_CFGR_SWS_Pos)) + 8003cf2: 4b2b ldr r3, [pc, #172] @ (8003da0 ) + 8003cf4: 689b ldr r3, [r3, #8] + 8003cf6: f003 020c and.w r2, r3, #12 + 8003cfa: 687b ldr r3, [r7, #4] + 8003cfc: 685b ldr r3, [r3, #4] + 8003cfe: 009b lsls r3, r3, #2 + 8003d00: 429a cmp r2, r3 + 8003d02: d1eb bne.n 8003cdc + } + } + } + + /* Decreasing the number of wait states because of lower CPU frequency */ + if(FLatency < __HAL_FLASH_GET_LATENCY()) + 8003d04: 4b25 ldr r3, [pc, #148] @ (8003d9c ) + 8003d06: 681b ldr r3, [r3, #0] + 8003d08: f003 030f and.w r3, r3, #15 + 8003d0c: 683a ldr r2, [r7, #0] + 8003d0e: 429a cmp r2, r3 + 8003d10: d20c bcs.n 8003d2c + { + /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */ + __HAL_FLASH_SET_LATENCY(FLatency); + 8003d12: 4b22 ldr r3, [pc, #136] @ (8003d9c ) + 8003d14: 683a ldr r2, [r7, #0] + 8003d16: b2d2 uxtb r2, r2 + 8003d18: 701a strb r2, [r3, #0] + + /* Check that the new number of wait states is taken into account to access the Flash + memory by reading the FLASH_ACR register */ + if(__HAL_FLASH_GET_LATENCY() != FLatency) + 8003d1a: 4b20 ldr r3, [pc, #128] @ (8003d9c ) + 8003d1c: 681b ldr r3, [r3, #0] + 8003d1e: f003 030f and.w r3, r3, #15 + 8003d22: 683a ldr r2, [r7, #0] + 8003d24: 429a cmp r2, r3 + 8003d26: d001 beq.n 8003d2c + { + return HAL_ERROR; + 8003d28: 2301 movs r3, #1 + 8003d2a: e032 b.n 8003d92 + } + } + + /*-------------------------- PCLK1 Configuration ---------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1) + 8003d2c: 687b ldr r3, [r7, #4] + 8003d2e: 681b ldr r3, [r3, #0] + 8003d30: f003 0304 and.w r3, r3, #4 + 8003d34: 2b00 cmp r3, #0 + 8003d36: d008 beq.n 8003d4a + { + assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB1CLKDivider)); + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_ClkInitStruct->APB1CLKDivider); + 8003d38: 4b19 ldr r3, [pc, #100] @ (8003da0 ) + 8003d3a: 689b ldr r3, [r3, #8] + 8003d3c: f423 52e0 bic.w r2, r3, #7168 @ 0x1c00 + 8003d40: 687b ldr r3, [r7, #4] + 8003d42: 68db ldr r3, [r3, #12] + 8003d44: 4916 ldr r1, [pc, #88] @ (8003da0 ) + 8003d46: 4313 orrs r3, r2 + 8003d48: 608b str r3, [r1, #8] + } + + /*-------------------------- PCLK2 Configuration ---------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2) + 8003d4a: 687b ldr r3, [r7, #4] + 8003d4c: 681b ldr r3, [r3, #0] + 8003d4e: f003 0308 and.w r3, r3, #8 + 8003d52: 2b00 cmp r3, #0 + 8003d54: d009 beq.n 8003d6a + { + assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB2CLKDivider)); + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, ((RCC_ClkInitStruct->APB2CLKDivider) << 3U)); + 8003d56: 4b12 ldr r3, [pc, #72] @ (8003da0 ) + 8003d58: 689b ldr r3, [r3, #8] + 8003d5a: f423 4260 bic.w r2, r3, #57344 @ 0xe000 + 8003d5e: 687b ldr r3, [r7, #4] + 8003d60: 691b ldr r3, [r3, #16] + 8003d62: 00db lsls r3, r3, #3 + 8003d64: 490e ldr r1, [pc, #56] @ (8003da0 ) + 8003d66: 4313 orrs r3, r2 + 8003d68: 608b str r3, [r1, #8] + } + + /* Update the SystemCoreClock global variable */ + SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_Pos]; + 8003d6a: f000 f821 bl 8003db0 + 8003d6e: 4602 mov r2, r0 + 8003d70: 4b0b ldr r3, [pc, #44] @ (8003da0 ) + 8003d72: 689b ldr r3, [r3, #8] + 8003d74: 091b lsrs r3, r3, #4 + 8003d76: f003 030f and.w r3, r3, #15 + 8003d7a: 490a ldr r1, [pc, #40] @ (8003da4 ) + 8003d7c: 5ccb ldrb r3, [r1, r3] + 8003d7e: fa22 f303 lsr.w r3, r2, r3 + 8003d82: 4a09 ldr r2, [pc, #36] @ (8003da8 ) + 8003d84: 6013 str r3, [r2, #0] + + /* Configure the source of time base considering new system clocks settings */ + HAL_InitTick (uwTickPrio); + 8003d86: 4b09 ldr r3, [pc, #36] @ (8003dac ) + 8003d88: 681b ldr r3, [r3, #0] + 8003d8a: 4618 mov r0, r3 + 8003d8c: f7fe f870 bl 8001e70 + + return HAL_OK; + 8003d90: 2300 movs r3, #0 +} + 8003d92: 4618 mov r0, r3 + 8003d94: 3710 adds r7, #16 + 8003d96: 46bd mov sp, r7 + 8003d98: bd80 pop {r7, pc} + 8003d9a: bf00 nop + 8003d9c: 40023c00 .word 0x40023c00 + 8003da0: 40023800 .word 0x40023800 + 8003da4: 08018dd8 .word 0x08018dd8 + 8003da8: 20000000 .word 0x20000000 + 8003dac: 20000004 .word 0x20000004 + +08003db0 : + * + * + * @retval SYSCLK frequency + */ +__weak uint32_t HAL_RCC_GetSysClockFreq(void) +{ + 8003db0: e92d 4fb0 stmdb sp!, {r4, r5, r7, r8, r9, sl, fp, lr} + 8003db4: b090 sub sp, #64 @ 0x40 + 8003db6: af00 add r7, sp, #0 + uint32_t pllm = 0U, pllvco = 0U, pllp = 0U; + 8003db8: 2300 movs r3, #0 + 8003dba: 637b str r3, [r7, #52] @ 0x34 + 8003dbc: 2300 movs r3, #0 + 8003dbe: 63fb str r3, [r7, #60] @ 0x3c + 8003dc0: 2300 movs r3, #0 + 8003dc2: 633b str r3, [r7, #48] @ 0x30 + uint32_t sysclockfreq = 0U; + 8003dc4: 2300 movs r3, #0 + 8003dc6: 63bb str r3, [r7, #56] @ 0x38 + + /* Get SYSCLK source -------------------------------------------------------*/ + switch (RCC->CFGR & RCC_CFGR_SWS) + 8003dc8: 4b59 ldr r3, [pc, #356] @ (8003f30 ) + 8003dca: 689b ldr r3, [r3, #8] + 8003dcc: f003 030c and.w r3, r3, #12 + 8003dd0: 2b08 cmp r3, #8 + 8003dd2: d00d beq.n 8003df0 + 8003dd4: 2b08 cmp r3, #8 + 8003dd6: f200 80a1 bhi.w 8003f1c + 8003dda: 2b00 cmp r3, #0 + 8003ddc: d002 beq.n 8003de4 + 8003dde: 2b04 cmp r3, #4 + 8003de0: d003 beq.n 8003dea + 8003de2: e09b b.n 8003f1c + { + case RCC_CFGR_SWS_HSI: /* HSI used as system clock source */ + { + sysclockfreq = HSI_VALUE; + 8003de4: 4b53 ldr r3, [pc, #332] @ (8003f34 ) + 8003de6: 63bb str r3, [r7, #56] @ 0x38 + break; + 8003de8: e09b b.n 8003f22 + } + case RCC_CFGR_SWS_HSE: /* HSE used as system clock source */ + { + sysclockfreq = HSE_VALUE; + 8003dea: 4b53 ldr r3, [pc, #332] @ (8003f38 ) + 8003dec: 63bb str r3, [r7, #56] @ 0x38 + break; + 8003dee: e098 b.n 8003f22 + } + case RCC_CFGR_SWS_PLL: /* PLL used as system clock source */ + { + /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN + SYSCLK = PLL_VCO / PLLP */ + pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; + 8003df0: 4b4f ldr r3, [pc, #316] @ (8003f30 ) + 8003df2: 685b ldr r3, [r3, #4] + 8003df4: f003 033f and.w r3, r3, #63 @ 0x3f + 8003df8: 637b str r3, [r7, #52] @ 0x34 + if(__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI) + 8003dfa: 4b4d ldr r3, [pc, #308] @ (8003f30 ) + 8003dfc: 685b ldr r3, [r3, #4] + 8003dfe: f403 0380 and.w r3, r3, #4194304 @ 0x400000 + 8003e02: 2b00 cmp r3, #0 + 8003e04: d028 beq.n 8003e58 + { + /* HSE used as PLL clock source */ + pllvco = (uint32_t) ((((uint64_t) HSE_VALUE * ((uint64_t) ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos)))) / (uint64_t)pllm); + 8003e06: 4b4a ldr r3, [pc, #296] @ (8003f30 ) + 8003e08: 685b ldr r3, [r3, #4] + 8003e0a: 099b lsrs r3, r3, #6 + 8003e0c: 2200 movs r2, #0 + 8003e0e: 623b str r3, [r7, #32] + 8003e10: 627a str r2, [r7, #36] @ 0x24 + 8003e12: 6a3b ldr r3, [r7, #32] + 8003e14: f3c3 0008 ubfx r0, r3, #0, #9 + 8003e18: 2100 movs r1, #0 + 8003e1a: 4b47 ldr r3, [pc, #284] @ (8003f38 ) + 8003e1c: fb03 f201 mul.w r2, r3, r1 + 8003e20: 2300 movs r3, #0 + 8003e22: fb00 f303 mul.w r3, r0, r3 + 8003e26: 4413 add r3, r2 + 8003e28: 4a43 ldr r2, [pc, #268] @ (8003f38 ) + 8003e2a: fba0 1202 umull r1, r2, r0, r2 + 8003e2e: 62fa str r2, [r7, #44] @ 0x2c + 8003e30: 460a mov r2, r1 + 8003e32: 62ba str r2, [r7, #40] @ 0x28 + 8003e34: 6afa ldr r2, [r7, #44] @ 0x2c + 8003e36: 4413 add r3, r2 + 8003e38: 62fb str r3, [r7, #44] @ 0x2c + 8003e3a: 6b7b ldr r3, [r7, #52] @ 0x34 + 8003e3c: 2200 movs r2, #0 + 8003e3e: 61bb str r3, [r7, #24] + 8003e40: 61fa str r2, [r7, #28] + 8003e42: e9d7 2306 ldrd r2, r3, [r7, #24] + 8003e46: e9d7 010a ldrd r0, r1, [r7, #40] @ 0x28 + 8003e4a: f7fc febd bl 8000bc8 <__aeabi_uldivmod> + 8003e4e: 4602 mov r2, r0 + 8003e50: 460b mov r3, r1 + 8003e52: 4613 mov r3, r2 + 8003e54: 63fb str r3, [r7, #60] @ 0x3c + 8003e56: e053 b.n 8003f00 + } + else + { + /* HSI used as PLL clock source */ + pllvco = (uint32_t) ((((uint64_t) HSI_VALUE * ((uint64_t) ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos)))) / (uint64_t)pllm); + 8003e58: 4b35 ldr r3, [pc, #212] @ (8003f30 ) + 8003e5a: 685b ldr r3, [r3, #4] + 8003e5c: 099b lsrs r3, r3, #6 + 8003e5e: 2200 movs r2, #0 + 8003e60: 613b str r3, [r7, #16] + 8003e62: 617a str r2, [r7, #20] + 8003e64: 693b ldr r3, [r7, #16] + 8003e66: f3c3 0a08 ubfx sl, r3, #0, #9 + 8003e6a: f04f 0b00 mov.w fp, #0 + 8003e6e: 4652 mov r2, sl + 8003e70: 465b mov r3, fp + 8003e72: f04f 0000 mov.w r0, #0 + 8003e76: f04f 0100 mov.w r1, #0 + 8003e7a: 0159 lsls r1, r3, #5 + 8003e7c: ea41 61d2 orr.w r1, r1, r2, lsr #27 + 8003e80: 0150 lsls r0, r2, #5 + 8003e82: 4602 mov r2, r0 + 8003e84: 460b mov r3, r1 + 8003e86: ebb2 080a subs.w r8, r2, sl + 8003e8a: eb63 090b sbc.w r9, r3, fp + 8003e8e: f04f 0200 mov.w r2, #0 + 8003e92: f04f 0300 mov.w r3, #0 + 8003e96: ea4f 1389 mov.w r3, r9, lsl #6 + 8003e9a: ea43 6398 orr.w r3, r3, r8, lsr #26 + 8003e9e: ea4f 1288 mov.w r2, r8, lsl #6 + 8003ea2: ebb2 0408 subs.w r4, r2, r8 + 8003ea6: eb63 0509 sbc.w r5, r3, r9 + 8003eaa: f04f 0200 mov.w r2, #0 + 8003eae: f04f 0300 mov.w r3, #0 + 8003eb2: 00eb lsls r3, r5, #3 + 8003eb4: ea43 7354 orr.w r3, r3, r4, lsr #29 + 8003eb8: 00e2 lsls r2, r4, #3 + 8003eba: 4614 mov r4, r2 + 8003ebc: 461d mov r5, r3 + 8003ebe: eb14 030a adds.w r3, r4, sl + 8003ec2: 603b str r3, [r7, #0] + 8003ec4: eb45 030b adc.w r3, r5, fp + 8003ec8: 607b str r3, [r7, #4] + 8003eca: f04f 0200 mov.w r2, #0 + 8003ece: f04f 0300 mov.w r3, #0 + 8003ed2: e9d7 4500 ldrd r4, r5, [r7] + 8003ed6: 4629 mov r1, r5 + 8003ed8: 028b lsls r3, r1, #10 + 8003eda: 4621 mov r1, r4 + 8003edc: ea43 5391 orr.w r3, r3, r1, lsr #22 + 8003ee0: 4621 mov r1, r4 + 8003ee2: 028a lsls r2, r1, #10 + 8003ee4: 4610 mov r0, r2 + 8003ee6: 4619 mov r1, r3 + 8003ee8: 6b7b ldr r3, [r7, #52] @ 0x34 + 8003eea: 2200 movs r2, #0 + 8003eec: 60bb str r3, [r7, #8] + 8003eee: 60fa str r2, [r7, #12] + 8003ef0: e9d7 2302 ldrd r2, r3, [r7, #8] + 8003ef4: f7fc fe68 bl 8000bc8 <__aeabi_uldivmod> + 8003ef8: 4602 mov r2, r0 + 8003efa: 460b mov r3, r1 + 8003efc: 4613 mov r3, r2 + 8003efe: 63fb str r3, [r7, #60] @ 0x3c + } + pllp = ((((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> RCC_PLLCFGR_PLLP_Pos) + 1U) *2U); + 8003f00: 4b0b ldr r3, [pc, #44] @ (8003f30 ) + 8003f02: 685b ldr r3, [r3, #4] + 8003f04: 0c1b lsrs r3, r3, #16 + 8003f06: f003 0303 and.w r3, r3, #3 + 8003f0a: 3301 adds r3, #1 + 8003f0c: 005b lsls r3, r3, #1 + 8003f0e: 633b str r3, [r7, #48] @ 0x30 + + sysclockfreq = pllvco/pllp; + 8003f10: 6bfa ldr r2, [r7, #60] @ 0x3c + 8003f12: 6b3b ldr r3, [r7, #48] @ 0x30 + 8003f14: fbb2 f3f3 udiv r3, r2, r3 + 8003f18: 63bb str r3, [r7, #56] @ 0x38 + break; + 8003f1a: e002 b.n 8003f22 + } + default: + { + sysclockfreq = HSI_VALUE; + 8003f1c: 4b05 ldr r3, [pc, #20] @ (8003f34 ) + 8003f1e: 63bb str r3, [r7, #56] @ 0x38 + break; + 8003f20: bf00 nop + } + } + return sysclockfreq; + 8003f22: 6bbb ldr r3, [r7, #56] @ 0x38 +} + 8003f24: 4618 mov r0, r3 + 8003f26: 3740 adds r7, #64 @ 0x40 + 8003f28: 46bd mov sp, r7 + 8003f2a: e8bd 8fb0 ldmia.w sp!, {r4, r5, r7, r8, r9, sl, fp, pc} + 8003f2e: bf00 nop + 8003f30: 40023800 .word 0x40023800 + 8003f34: 00f42400 .word 0x00f42400 + 8003f38: 017d7840 .word 0x017d7840 + +08003f3c : + * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency + * and updated within this function + * @retval HCLK frequency + */ +uint32_t HAL_RCC_GetHCLKFreq(void) +{ + 8003f3c: b480 push {r7} + 8003f3e: af00 add r7, sp, #0 + return SystemCoreClock; + 8003f40: 4b03 ldr r3, [pc, #12] @ (8003f50 ) + 8003f42: 681b ldr r3, [r3, #0] +} + 8003f44: 4618 mov r0, r3 + 8003f46: 46bd mov sp, r7 + 8003f48: f85d 7b04 ldr.w r7, [sp], #4 + 8003f4c: 4770 bx lr + 8003f4e: bf00 nop + 8003f50: 20000000 .word 0x20000000 + +08003f54 : + * @param ExtTiming Pointer to SRAM extended mode timing structure + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FMC_NORSRAM_TimingTypeDef *Timing, + FMC_NORSRAM_TimingTypeDef *ExtTiming) +{ + 8003f54: b580 push {r7, lr} + 8003f56: b084 sub sp, #16 + 8003f58: af00 add r7, sp, #0 + 8003f5a: 60f8 str r0, [r7, #12] + 8003f5c: 60b9 str r1, [r7, #8] + 8003f5e: 607a str r2, [r7, #4] + /* Check the SRAM handle parameter */ + if (hsram == NULL) + 8003f60: 68fb ldr r3, [r7, #12] + 8003f62: 2b00 cmp r3, #0 + 8003f64: d101 bne.n 8003f6a + { + return HAL_ERROR; + 8003f66: 2301 movs r3, #1 + 8003f68: e038 b.n 8003fdc + } + + if (hsram->State == HAL_SRAM_STATE_RESET) + 8003f6a: 68fb ldr r3, [r7, #12] + 8003f6c: f893 3049 ldrb.w r3, [r3, #73] @ 0x49 + 8003f70: b2db uxtb r3, r3 + 8003f72: 2b00 cmp r3, #0 + 8003f74: d106 bne.n 8003f84 + { + /* Allocate lock resource and initialize it */ + hsram->Lock = HAL_UNLOCKED; + 8003f76: 68fb ldr r3, [r7, #12] + 8003f78: 2200 movs r2, #0 + 8003f7a: f883 2048 strb.w r2, [r3, #72] @ 0x48 + + /* Init the low level hardware */ + hsram->MspInitCallback(hsram); +#else + /* Initialize the low level hardware (MSP) */ + HAL_SRAM_MspInit(hsram); + 8003f7e: 68f8 ldr r0, [r7, #12] + 8003f80: f7fd fd64 bl 8001a4c +#endif /* USE_HAL_SRAM_REGISTER_CALLBACKS */ + } + + /* Initialize SRAM control Interface */ + (void)FMC_NORSRAM_Init(hsram->Instance, &(hsram->Init)); + 8003f84: 68fb ldr r3, [r7, #12] + 8003f86: 681a ldr r2, [r3, #0] + 8003f88: 68fb ldr r3, [r7, #12] + 8003f8a: 3308 adds r3, #8 + 8003f8c: 4619 mov r1, r3 + 8003f8e: 4610 mov r0, r2 + 8003f90: f000 fcb4 bl 80048fc + + /* Initialize SRAM timing Interface */ + (void)FMC_NORSRAM_Timing_Init(hsram->Instance, Timing, hsram->Init.NSBank); + 8003f94: 68fb ldr r3, [r7, #12] + 8003f96: 6818 ldr r0, [r3, #0] + 8003f98: 68fb ldr r3, [r7, #12] + 8003f9a: 689b ldr r3, [r3, #8] + 8003f9c: 461a mov r2, r3 + 8003f9e: 68b9 ldr r1, [r7, #8] + 8003fa0: f000 fd32 bl 8004a08 + + /* Initialize SRAM extended mode timing Interface */ + (void)FMC_NORSRAM_Extended_Timing_Init(hsram->Extended, ExtTiming, hsram->Init.NSBank, + 8003fa4: 68fb ldr r3, [r7, #12] + 8003fa6: 6858 ldr r0, [r3, #4] + 8003fa8: 68fb ldr r3, [r7, #12] + 8003faa: 689a ldr r2, [r3, #8] + 8003fac: 68fb ldr r3, [r7, #12] + 8003fae: 6b1b ldr r3, [r3, #48] @ 0x30 + 8003fb0: 6879 ldr r1, [r7, #4] + 8003fb2: f000 fd79 bl 8004aa8 + hsram->Init.ExtendedMode); + + /* Enable the NORSRAM device */ + __FMC_NORSRAM_ENABLE(hsram->Instance, hsram->Init.NSBank); + 8003fb6: 68fb ldr r3, [r7, #12] + 8003fb8: 681b ldr r3, [r3, #0] + 8003fba: 68fa ldr r2, [r7, #12] + 8003fbc: 6892 ldr r2, [r2, #8] + 8003fbe: f853 1022 ldr.w r1, [r3, r2, lsl #2] + 8003fc2: 68fb ldr r3, [r7, #12] + 8003fc4: 681b ldr r3, [r3, #0] + 8003fc6: 68fa ldr r2, [r7, #12] + 8003fc8: 6892 ldr r2, [r2, #8] + 8003fca: f041 0101 orr.w r1, r1, #1 + 8003fce: f843 1022 str.w r1, [r3, r2, lsl #2] + + /* Initialize the SRAM controller state */ + hsram->State = HAL_SRAM_STATE_READY; + 8003fd2: 68fb ldr r3, [r7, #12] + 8003fd4: 2201 movs r2, #1 + 8003fd6: f883 2049 strb.w r2, [r3, #73] @ 0x49 + + return HAL_OK; + 8003fda: 2300 movs r3, #0 +} + 8003fdc: 4618 mov r0, r3 + 8003fde: 3710 adds r7, #16 + 8003fe0: 46bd mov sp, r7 + 8003fe2: bd80 pop {r7, pc} + +08003fe4 : + * Ex: call @ref HAL_TIM_Base_DeInit() before HAL_TIM_Base_Init() + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim) +{ + 8003fe4: b580 push {r7, lr} + 8003fe6: b082 sub sp, #8 + 8003fe8: af00 add r7, sp, #0 + 8003fea: 6078 str r0, [r7, #4] + /* Check the TIM handle allocation */ + if (htim == NULL) + 8003fec: 687b ldr r3, [r7, #4] + 8003fee: 2b00 cmp r3, #0 + 8003ff0: d101 bne.n 8003ff6 + { + return HAL_ERROR; + 8003ff2: 2301 movs r3, #1 + 8003ff4: e041 b.n 800407a + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + + if (htim->State == HAL_TIM_STATE_RESET) + 8003ff6: 687b ldr r3, [r7, #4] + 8003ff8: f893 303d ldrb.w r3, [r3, #61] @ 0x3d + 8003ffc: b2db uxtb r3, r3 + 8003ffe: 2b00 cmp r3, #0 + 8004000: d106 bne.n 8004010 + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + 8004002: 687b ldr r3, [r7, #4] + 8004004: 2200 movs r2, #0 + 8004006: f883 203c strb.w r2, [r3, #60] @ 0x3c + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->Base_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + HAL_TIM_Base_MspInit(htim); + 800400a: 6878 ldr r0, [r7, #4] + 800400c: f7fd fc86 bl 800191c +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + 8004010: 687b ldr r3, [r7, #4] + 8004012: 2202 movs r2, #2 + 8004014: f883 203d strb.w r2, [r3, #61] @ 0x3d + + /* Set the Time Base configuration */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + 8004018: 687b ldr r3, [r7, #4] + 800401a: 681a ldr r2, [r3, #0] + 800401c: 687b ldr r3, [r7, #4] + 800401e: 3304 adds r3, #4 + 8004020: 4619 mov r1, r3 + 8004022: 4610 mov r0, r2 + 8004024: f000 faa0 bl 8004568 + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + 8004028: 687b ldr r3, [r7, #4] + 800402a: 2201 movs r2, #1 + 800402c: f883 2046 strb.w r2, [r3, #70] @ 0x46 + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + 8004030: 687b ldr r3, [r7, #4] + 8004032: 2201 movs r2, #1 + 8004034: f883 203e strb.w r2, [r3, #62] @ 0x3e + 8004038: 687b ldr r3, [r7, #4] + 800403a: 2201 movs r2, #1 + 800403c: f883 203f strb.w r2, [r3, #63] @ 0x3f + 8004040: 687b ldr r3, [r7, #4] + 8004042: 2201 movs r2, #1 + 8004044: f883 2040 strb.w r2, [r3, #64] @ 0x40 + 8004048: 687b ldr r3, [r7, #4] + 800404a: 2201 movs r2, #1 + 800404c: f883 2041 strb.w r2, [r3, #65] @ 0x41 + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + 8004050: 687b ldr r3, [r7, #4] + 8004052: 2201 movs r2, #1 + 8004054: f883 2042 strb.w r2, [r3, #66] @ 0x42 + 8004058: 687b ldr r3, [r7, #4] + 800405a: 2201 movs r2, #1 + 800405c: f883 2043 strb.w r2, [r3, #67] @ 0x43 + 8004060: 687b ldr r3, [r7, #4] + 8004062: 2201 movs r2, #1 + 8004064: f883 2044 strb.w r2, [r3, #68] @ 0x44 + 8004068: 687b ldr r3, [r7, #4] + 800406a: 2201 movs r2, #1 + 800406c: f883 2045 strb.w r2, [r3, #69] @ 0x45 + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + 8004070: 687b ldr r3, [r7, #4] + 8004072: 2201 movs r2, #1 + 8004074: f883 203d strb.w r2, [r3, #61] @ 0x3d + + return HAL_OK; + 8004078: 2300 movs r3, #0 +} + 800407a: 4618 mov r0, r3 + 800407c: 3708 adds r7, #8 + 800407e: 46bd mov sp, r7 + 8004080: bd80 pop {r7, pc} + ... + +08004084 : + * @brief Starts the TIM Base generation in interrupt mode. + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim) +{ + 8004084: b480 push {r7} + 8004086: b085 sub sp, #20 + 8004088: af00 add r7, sp, #0 + 800408a: 6078 str r0, [r7, #4] + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + /* Check the TIM state */ + if (htim->State != HAL_TIM_STATE_READY) + 800408c: 687b ldr r3, [r7, #4] + 800408e: f893 303d ldrb.w r3, [r3, #61] @ 0x3d + 8004092: b2db uxtb r3, r3 + 8004094: 2b01 cmp r3, #1 + 8004096: d001 beq.n 800409c + { + return HAL_ERROR; + 8004098: 2301 movs r3, #1 + 800409a: e04e b.n 800413a + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + 800409c: 687b ldr r3, [r7, #4] + 800409e: 2202 movs r2, #2 + 80040a0: f883 203d strb.w r2, [r3, #61] @ 0x3d + + /* Enable the TIM Update interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_UPDATE); + 80040a4: 687b ldr r3, [r7, #4] + 80040a6: 681b ldr r3, [r3, #0] + 80040a8: 68da ldr r2, [r3, #12] + 80040aa: 687b ldr r3, [r7, #4] + 80040ac: 681b ldr r3, [r3, #0] + 80040ae: f042 0201 orr.w r2, r2, #1 + 80040b2: 60da str r2, [r3, #12] + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + 80040b4: 687b ldr r3, [r7, #4] + 80040b6: 681b ldr r3, [r3, #0] + 80040b8: 4a23 ldr r2, [pc, #140] @ (8004148 ) + 80040ba: 4293 cmp r3, r2 + 80040bc: d022 beq.n 8004104 + 80040be: 687b ldr r3, [r7, #4] + 80040c0: 681b ldr r3, [r3, #0] + 80040c2: f1b3 4f80 cmp.w r3, #1073741824 @ 0x40000000 + 80040c6: d01d beq.n 8004104 + 80040c8: 687b ldr r3, [r7, #4] + 80040ca: 681b ldr r3, [r3, #0] + 80040cc: 4a1f ldr r2, [pc, #124] @ (800414c ) + 80040ce: 4293 cmp r3, r2 + 80040d0: d018 beq.n 8004104 + 80040d2: 687b ldr r3, [r7, #4] + 80040d4: 681b ldr r3, [r3, #0] + 80040d6: 4a1e ldr r2, [pc, #120] @ (8004150 ) + 80040d8: 4293 cmp r3, r2 + 80040da: d013 beq.n 8004104 + 80040dc: 687b ldr r3, [r7, #4] + 80040de: 681b ldr r3, [r3, #0] + 80040e0: 4a1c ldr r2, [pc, #112] @ (8004154 ) + 80040e2: 4293 cmp r3, r2 + 80040e4: d00e beq.n 8004104 + 80040e6: 687b ldr r3, [r7, #4] + 80040e8: 681b ldr r3, [r3, #0] + 80040ea: 4a1b ldr r2, [pc, #108] @ (8004158 ) + 80040ec: 4293 cmp r3, r2 + 80040ee: d009 beq.n 8004104 + 80040f0: 687b ldr r3, [r7, #4] + 80040f2: 681b ldr r3, [r3, #0] + 80040f4: 4a19 ldr r2, [pc, #100] @ (800415c ) + 80040f6: 4293 cmp r3, r2 + 80040f8: d004 beq.n 8004104 + 80040fa: 687b ldr r3, [r7, #4] + 80040fc: 681b ldr r3, [r3, #0] + 80040fe: 4a18 ldr r2, [pc, #96] @ (8004160 ) + 8004100: 4293 cmp r3, r2 + 8004102: d111 bne.n 8004128 + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + 8004104: 687b ldr r3, [r7, #4] + 8004106: 681b ldr r3, [r3, #0] + 8004108: 689b ldr r3, [r3, #8] + 800410a: f003 0307 and.w r3, r3, #7 + 800410e: 60fb str r3, [r7, #12] + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + 8004110: 68fb ldr r3, [r7, #12] + 8004112: 2b06 cmp r3, #6 + 8004114: d010 beq.n 8004138 + { + __HAL_TIM_ENABLE(htim); + 8004116: 687b ldr r3, [r7, #4] + 8004118: 681b ldr r3, [r3, #0] + 800411a: 681a ldr r2, [r3, #0] + 800411c: 687b ldr r3, [r7, #4] + 800411e: 681b ldr r3, [r3, #0] + 8004120: f042 0201 orr.w r2, r2, #1 + 8004124: 601a str r2, [r3, #0] + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + 8004126: e007 b.n 8004138 + } + } + else + { + __HAL_TIM_ENABLE(htim); + 8004128: 687b ldr r3, [r7, #4] + 800412a: 681b ldr r3, [r3, #0] + 800412c: 681a ldr r2, [r3, #0] + 800412e: 687b ldr r3, [r7, #4] + 8004130: 681b ldr r3, [r3, #0] + 8004132: f042 0201 orr.w r2, r2, #1 + 8004136: 601a str r2, [r3, #0] + } + + /* Return function status */ + return HAL_OK; + 8004138: 2300 movs r3, #0 +} + 800413a: 4618 mov r0, r3 + 800413c: 3714 adds r7, #20 + 800413e: 46bd mov sp, r7 + 8004140: f85d 7b04 ldr.w r7, [sp], #4 + 8004144: 4770 bx lr + 8004146: bf00 nop + 8004148: 40010000 .word 0x40010000 + 800414c: 40000400 .word 0x40000400 + 8004150: 40000800 .word 0x40000800 + 8004154: 40000c00 .word 0x40000c00 + 8004158: 40010400 .word 0x40010400 + 800415c: 40014000 .word 0x40014000 + 8004160: 40001800 .word 0x40001800 + +08004164 : + * @brief This function handles TIM interrupts requests. + * @param htim TIM handle + * @retval None + */ +void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) +{ + 8004164: b580 push {r7, lr} + 8004166: b082 sub sp, #8 + 8004168: af00 add r7, sp, #0 + 800416a: 6078 str r0, [r7, #4] + /* Capture compare 1 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC1) != RESET) + 800416c: 687b ldr r3, [r7, #4] + 800416e: 681b ldr r3, [r3, #0] + 8004170: 691b ldr r3, [r3, #16] + 8004172: f003 0302 and.w r3, r3, #2 + 8004176: 2b02 cmp r3, #2 + 8004178: d122 bne.n 80041c0 + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC1) != RESET) + 800417a: 687b ldr r3, [r7, #4] + 800417c: 681b ldr r3, [r3, #0] + 800417e: 68db ldr r3, [r3, #12] + 8004180: f003 0302 and.w r3, r3, #2 + 8004184: 2b02 cmp r3, #2 + 8004186: d11b bne.n 80041c0 + { + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC1); + 8004188: 687b ldr r3, [r7, #4] + 800418a: 681b ldr r3, [r3, #0] + 800418c: f06f 0202 mvn.w r2, #2 + 8004190: 611a str r2, [r3, #16] + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + 8004192: 687b ldr r3, [r7, #4] + 8004194: 2201 movs r2, #1 + 8004196: 771a strb r2, [r3, #28] + + /* Input capture event */ + if ((htim->Instance->CCMR1 & TIM_CCMR1_CC1S) != 0x00U) + 8004198: 687b ldr r3, [r7, #4] + 800419a: 681b ldr r3, [r3, #0] + 800419c: 699b ldr r3, [r3, #24] + 800419e: f003 0303 and.w r3, r3, #3 + 80041a2: 2b00 cmp r3, #0 + 80041a4: d003 beq.n 80041ae + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); + 80041a6: 6878 ldr r0, [r7, #4] + 80041a8: f000 f9bf bl 800452a + 80041ac: e005 b.n 80041ba + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + 80041ae: 6878 ldr r0, [r7, #4] + 80041b0: f000 f9b1 bl 8004516 + HAL_TIM_PWM_PulseFinishedCallback(htim); + 80041b4: 6878 ldr r0, [r7, #4] + 80041b6: f000 f9c2 bl 800453e +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + 80041ba: 687b ldr r3, [r7, #4] + 80041bc: 2200 movs r2, #0 + 80041be: 771a strb r2, [r3, #28] + } + } + } + /* Capture compare 2 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC2) != RESET) + 80041c0: 687b ldr r3, [r7, #4] + 80041c2: 681b ldr r3, [r3, #0] + 80041c4: 691b ldr r3, [r3, #16] + 80041c6: f003 0304 and.w r3, r3, #4 + 80041ca: 2b04 cmp r3, #4 + 80041cc: d122 bne.n 8004214 + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC2) != RESET) + 80041ce: 687b ldr r3, [r7, #4] + 80041d0: 681b ldr r3, [r3, #0] + 80041d2: 68db ldr r3, [r3, #12] + 80041d4: f003 0304 and.w r3, r3, #4 + 80041d8: 2b04 cmp r3, #4 + 80041da: d11b bne.n 8004214 + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC2); + 80041dc: 687b ldr r3, [r7, #4] + 80041de: 681b ldr r3, [r3, #0] + 80041e0: f06f 0204 mvn.w r2, #4 + 80041e4: 611a str r2, [r3, #16] + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + 80041e6: 687b ldr r3, [r7, #4] + 80041e8: 2202 movs r2, #2 + 80041ea: 771a strb r2, [r3, #28] + /* Input capture event */ + if ((htim->Instance->CCMR1 & TIM_CCMR1_CC2S) != 0x00U) + 80041ec: 687b ldr r3, [r7, #4] + 80041ee: 681b ldr r3, [r3, #0] + 80041f0: 699b ldr r3, [r3, #24] + 80041f2: f403 7340 and.w r3, r3, #768 @ 0x300 + 80041f6: 2b00 cmp r3, #0 + 80041f8: d003 beq.n 8004202 + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); + 80041fa: 6878 ldr r0, [r7, #4] + 80041fc: f000 f995 bl 800452a + 8004200: e005 b.n 800420e + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + 8004202: 6878 ldr r0, [r7, #4] + 8004204: f000 f987 bl 8004516 + HAL_TIM_PWM_PulseFinishedCallback(htim); + 8004208: 6878 ldr r0, [r7, #4] + 800420a: f000 f998 bl 800453e +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + 800420e: 687b ldr r3, [r7, #4] + 8004210: 2200 movs r2, #0 + 8004212: 771a strb r2, [r3, #28] + } + } + /* Capture compare 3 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC3) != RESET) + 8004214: 687b ldr r3, [r7, #4] + 8004216: 681b ldr r3, [r3, #0] + 8004218: 691b ldr r3, [r3, #16] + 800421a: f003 0308 and.w r3, r3, #8 + 800421e: 2b08 cmp r3, #8 + 8004220: d122 bne.n 8004268 + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC3) != RESET) + 8004222: 687b ldr r3, [r7, #4] + 8004224: 681b ldr r3, [r3, #0] + 8004226: 68db ldr r3, [r3, #12] + 8004228: f003 0308 and.w r3, r3, #8 + 800422c: 2b08 cmp r3, #8 + 800422e: d11b bne.n 8004268 + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC3); + 8004230: 687b ldr r3, [r7, #4] + 8004232: 681b ldr r3, [r3, #0] + 8004234: f06f 0208 mvn.w r2, #8 + 8004238: 611a str r2, [r3, #16] + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + 800423a: 687b ldr r3, [r7, #4] + 800423c: 2204 movs r2, #4 + 800423e: 771a strb r2, [r3, #28] + /* Input capture event */ + if ((htim->Instance->CCMR2 & TIM_CCMR2_CC3S) != 0x00U) + 8004240: 687b ldr r3, [r7, #4] + 8004242: 681b ldr r3, [r3, #0] + 8004244: 69db ldr r3, [r3, #28] + 8004246: f003 0303 and.w r3, r3, #3 + 800424a: 2b00 cmp r3, #0 + 800424c: d003 beq.n 8004256 + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); + 800424e: 6878 ldr r0, [r7, #4] + 8004250: f000 f96b bl 800452a + 8004254: e005 b.n 8004262 + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + 8004256: 6878 ldr r0, [r7, #4] + 8004258: f000 f95d bl 8004516 + HAL_TIM_PWM_PulseFinishedCallback(htim); + 800425c: 6878 ldr r0, [r7, #4] + 800425e: f000 f96e bl 800453e +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + 8004262: 687b ldr r3, [r7, #4] + 8004264: 2200 movs r2, #0 + 8004266: 771a strb r2, [r3, #28] + } + } + /* Capture compare 4 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC4) != RESET) + 8004268: 687b ldr r3, [r7, #4] + 800426a: 681b ldr r3, [r3, #0] + 800426c: 691b ldr r3, [r3, #16] + 800426e: f003 0310 and.w r3, r3, #16 + 8004272: 2b10 cmp r3, #16 + 8004274: d122 bne.n 80042bc + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC4) != RESET) + 8004276: 687b ldr r3, [r7, #4] + 8004278: 681b ldr r3, [r3, #0] + 800427a: 68db ldr r3, [r3, #12] + 800427c: f003 0310 and.w r3, r3, #16 + 8004280: 2b10 cmp r3, #16 + 8004282: d11b bne.n 80042bc + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC4); + 8004284: 687b ldr r3, [r7, #4] + 8004286: 681b ldr r3, [r3, #0] + 8004288: f06f 0210 mvn.w r2, #16 + 800428c: 611a str r2, [r3, #16] + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + 800428e: 687b ldr r3, [r7, #4] + 8004290: 2208 movs r2, #8 + 8004292: 771a strb r2, [r3, #28] + /* Input capture event */ + if ((htim->Instance->CCMR2 & TIM_CCMR2_CC4S) != 0x00U) + 8004294: 687b ldr r3, [r7, #4] + 8004296: 681b ldr r3, [r3, #0] + 8004298: 69db ldr r3, [r3, #28] + 800429a: f403 7340 and.w r3, r3, #768 @ 0x300 + 800429e: 2b00 cmp r3, #0 + 80042a0: d003 beq.n 80042aa + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); + 80042a2: 6878 ldr r0, [r7, #4] + 80042a4: f000 f941 bl 800452a + 80042a8: e005 b.n 80042b6 + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + 80042aa: 6878 ldr r0, [r7, #4] + 80042ac: f000 f933 bl 8004516 + HAL_TIM_PWM_PulseFinishedCallback(htim); + 80042b0: 6878 ldr r0, [r7, #4] + 80042b2: f000 f944 bl 800453e +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + 80042b6: 687b ldr r3, [r7, #4] + 80042b8: 2200 movs r2, #0 + 80042ba: 771a strb r2, [r3, #28] + } + } + /* TIM Update event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_UPDATE) != RESET) + 80042bc: 687b ldr r3, [r7, #4] + 80042be: 681b ldr r3, [r3, #0] + 80042c0: 691b ldr r3, [r3, #16] + 80042c2: f003 0301 and.w r3, r3, #1 + 80042c6: 2b01 cmp r3, #1 + 80042c8: d10e bne.n 80042e8 + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_UPDATE) != RESET) + 80042ca: 687b ldr r3, [r7, #4] + 80042cc: 681b ldr r3, [r3, #0] + 80042ce: 68db ldr r3, [r3, #12] + 80042d0: f003 0301 and.w r3, r3, #1 + 80042d4: 2b01 cmp r3, #1 + 80042d6: d107 bne.n 80042e8 + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); + 80042d8: 687b ldr r3, [r7, #4] + 80042da: 681b ldr r3, [r3, #0] + 80042dc: f06f 0201 mvn.w r2, #1 + 80042e0: 611a str r2, [r3, #16] +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PeriodElapsedCallback(htim); +#else + HAL_TIM_PeriodElapsedCallback(htim); + 80042e2: 6878 ldr r0, [r7, #4] + 80042e4: f000 f90d bl 8004502 +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } + /* TIM Break input event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK) != RESET) + 80042e8: 687b ldr r3, [r7, #4] + 80042ea: 681b ldr r3, [r3, #0] + 80042ec: 691b ldr r3, [r3, #16] + 80042ee: f003 0380 and.w r3, r3, #128 @ 0x80 + 80042f2: 2b80 cmp r3, #128 @ 0x80 + 80042f4: d10e bne.n 8004314 + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET) + 80042f6: 687b ldr r3, [r7, #4] + 80042f8: 681b ldr r3, [r3, #0] + 80042fa: 68db ldr r3, [r3, #12] + 80042fc: f003 0380 and.w r3, r3, #128 @ 0x80 + 8004300: 2b80 cmp r3, #128 @ 0x80 + 8004302: d107 bne.n 8004314 + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_BREAK); + 8004304: 687b ldr r3, [r7, #4] + 8004306: 681b ldr r3, [r3, #0] + 8004308: f06f 0280 mvn.w r2, #128 @ 0x80 + 800430c: 611a str r2, [r3, #16] +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->BreakCallback(htim); +#else + HAL_TIMEx_BreakCallback(htim); + 800430e: 6878 ldr r0, [r7, #4] + 8004310: f000 faea bl 80048e8 +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } + /* TIM Trigger detection event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_TRIGGER) != RESET) + 8004314: 687b ldr r3, [r7, #4] + 8004316: 681b ldr r3, [r3, #0] + 8004318: 691b ldr r3, [r3, #16] + 800431a: f003 0340 and.w r3, r3, #64 @ 0x40 + 800431e: 2b40 cmp r3, #64 @ 0x40 + 8004320: d10e bne.n 8004340 + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_TRIGGER) != RESET) + 8004322: 687b ldr r3, [r7, #4] + 8004324: 681b ldr r3, [r3, #0] + 8004326: 68db ldr r3, [r3, #12] + 8004328: f003 0340 and.w r3, r3, #64 @ 0x40 + 800432c: 2b40 cmp r3, #64 @ 0x40 + 800432e: d107 bne.n 8004340 + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_TRIGGER); + 8004330: 687b ldr r3, [r7, #4] + 8004332: 681b ldr r3, [r3, #0] + 8004334: f06f 0240 mvn.w r2, #64 @ 0x40 + 8004338: 611a str r2, [r3, #16] +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->TriggerCallback(htim); +#else + HAL_TIM_TriggerCallback(htim); + 800433a: 6878 ldr r0, [r7, #4] + 800433c: f000 f909 bl 8004552 +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } + /* TIM commutation event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_COM) != RESET) + 8004340: 687b ldr r3, [r7, #4] + 8004342: 681b ldr r3, [r3, #0] + 8004344: 691b ldr r3, [r3, #16] + 8004346: f003 0320 and.w r3, r3, #32 + 800434a: 2b20 cmp r3, #32 + 800434c: d10e bne.n 800436c + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_COM) != RESET) + 800434e: 687b ldr r3, [r7, #4] + 8004350: 681b ldr r3, [r3, #0] + 8004352: 68db ldr r3, [r3, #12] + 8004354: f003 0320 and.w r3, r3, #32 + 8004358: 2b20 cmp r3, #32 + 800435a: d107 bne.n 800436c + { + __HAL_TIM_CLEAR_IT(htim, TIM_FLAG_COM); + 800435c: 687b ldr r3, [r7, #4] + 800435e: 681b ldr r3, [r3, #0] + 8004360: f06f 0220 mvn.w r2, #32 + 8004364: 611a str r2, [r3, #16] +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->CommutationCallback(htim); +#else + HAL_TIMEx_CommutCallback(htim); + 8004366: 6878 ldr r0, [r7, #4] + 8004368: f000 fab4 bl 80048d4 +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } +} + 800436c: bf00 nop + 800436e: 3708 adds r7, #8 + 8004370: 46bd mov sp, r7 + 8004372: bd80 pop {r7, pc} + +08004374 : + * @param sClockSourceConfig pointer to a TIM_ClockConfigTypeDef structure that + * contains the clock source information for the TIM peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockConfigTypeDef *sClockSourceConfig) +{ + 8004374: b580 push {r7, lr} + 8004376: b084 sub sp, #16 + 8004378: af00 add r7, sp, #0 + 800437a: 6078 str r0, [r7, #4] + 800437c: 6039 str r1, [r7, #0] + HAL_StatusTypeDef status = HAL_OK; + 800437e: 2300 movs r3, #0 + 8004380: 73fb strb r3, [r7, #15] + uint32_t tmpsmcr; + + /* Process Locked */ + __HAL_LOCK(htim); + 8004382: 687b ldr r3, [r7, #4] + 8004384: f893 303c ldrb.w r3, [r3, #60] @ 0x3c + 8004388: 2b01 cmp r3, #1 + 800438a: d101 bne.n 8004390 + 800438c: 2302 movs r3, #2 + 800438e: e0b4 b.n 80044fa + 8004390: 687b ldr r3, [r7, #4] + 8004392: 2201 movs r2, #1 + 8004394: f883 203c strb.w r2, [r3, #60] @ 0x3c + + htim->State = HAL_TIM_STATE_BUSY; + 8004398: 687b ldr r3, [r7, #4] + 800439a: 2202 movs r2, #2 + 800439c: f883 203d strb.w r2, [r3, #61] @ 0x3d + + /* Check the parameters */ + assert_param(IS_TIM_CLOCKSOURCE(sClockSourceConfig->ClockSource)); + + /* Reset the SMS, TS, ECE, ETPS and ETRF bits */ + tmpsmcr = htim->Instance->SMCR; + 80043a0: 687b ldr r3, [r7, #4] + 80043a2: 681b ldr r3, [r3, #0] + 80043a4: 689b ldr r3, [r3, #8] + 80043a6: 60bb str r3, [r7, #8] + tmpsmcr &= ~(TIM_SMCR_SMS | TIM_SMCR_TS); + 80043a8: 68bb ldr r3, [r7, #8] + 80043aa: f023 0377 bic.w r3, r3, #119 @ 0x77 + 80043ae: 60bb str r3, [r7, #8] + tmpsmcr &= ~(TIM_SMCR_ETF | TIM_SMCR_ETPS | TIM_SMCR_ECE | TIM_SMCR_ETP); + 80043b0: 68bb ldr r3, [r7, #8] + 80043b2: f423 437f bic.w r3, r3, #65280 @ 0xff00 + 80043b6: 60bb str r3, [r7, #8] + htim->Instance->SMCR = tmpsmcr; + 80043b8: 687b ldr r3, [r7, #4] + 80043ba: 681b ldr r3, [r3, #0] + 80043bc: 68ba ldr r2, [r7, #8] + 80043be: 609a str r2, [r3, #8] + + switch (sClockSourceConfig->ClockSource) + 80043c0: 683b ldr r3, [r7, #0] + 80043c2: 681b ldr r3, [r3, #0] + 80043c4: f5b3 5f00 cmp.w r3, #8192 @ 0x2000 + 80043c8: d03e beq.n 8004448 + 80043ca: f5b3 5f00 cmp.w r3, #8192 @ 0x2000 + 80043ce: f200 8087 bhi.w 80044e0 + 80043d2: f5b3 5f80 cmp.w r3, #4096 @ 0x1000 + 80043d6: f000 8086 beq.w 80044e6 + 80043da: f5b3 5f80 cmp.w r3, #4096 @ 0x1000 + 80043de: d87f bhi.n 80044e0 + 80043e0: 2b70 cmp r3, #112 @ 0x70 + 80043e2: d01a beq.n 800441a + 80043e4: 2b70 cmp r3, #112 @ 0x70 + 80043e6: d87b bhi.n 80044e0 + 80043e8: 2b60 cmp r3, #96 @ 0x60 + 80043ea: d050 beq.n 800448e + 80043ec: 2b60 cmp r3, #96 @ 0x60 + 80043ee: d877 bhi.n 80044e0 + 80043f0: 2b50 cmp r3, #80 @ 0x50 + 80043f2: d03c beq.n 800446e + 80043f4: 2b50 cmp r3, #80 @ 0x50 + 80043f6: d873 bhi.n 80044e0 + 80043f8: 2b40 cmp r3, #64 @ 0x40 + 80043fa: d058 beq.n 80044ae + 80043fc: 2b40 cmp r3, #64 @ 0x40 + 80043fe: d86f bhi.n 80044e0 + 8004400: 2b30 cmp r3, #48 @ 0x30 + 8004402: d064 beq.n 80044ce + 8004404: 2b30 cmp r3, #48 @ 0x30 + 8004406: d86b bhi.n 80044e0 + 8004408: 2b20 cmp r3, #32 + 800440a: d060 beq.n 80044ce + 800440c: 2b20 cmp r3, #32 + 800440e: d867 bhi.n 80044e0 + 8004410: 2b00 cmp r3, #0 + 8004412: d05c beq.n 80044ce + 8004414: 2b10 cmp r3, #16 + 8004416: d05a beq.n 80044ce + 8004418: e062 b.n 80044e0 + assert_param(IS_TIM_CLOCKPRESCALER(sClockSourceConfig->ClockPrescaler)); + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + /* Configure the ETR Clock source */ + TIM_ETR_SetConfig(htim->Instance, + 800441a: 687b ldr r3, [r7, #4] + 800441c: 6818 ldr r0, [r3, #0] + 800441e: 683b ldr r3, [r7, #0] + 8004420: 6899 ldr r1, [r3, #8] + 8004422: 683b ldr r3, [r7, #0] + 8004424: 685a ldr r2, [r3, #4] + 8004426: 683b ldr r3, [r7, #0] + 8004428: 68db ldr r3, [r3, #12] + 800442a: f000 f9b7 bl 800479c + sClockSourceConfig->ClockPrescaler, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + + /* Select the External clock mode1 and the ETRF trigger */ + tmpsmcr = htim->Instance->SMCR; + 800442e: 687b ldr r3, [r7, #4] + 8004430: 681b ldr r3, [r3, #0] + 8004432: 689b ldr r3, [r3, #8] + 8004434: 60bb str r3, [r7, #8] + tmpsmcr |= (TIM_SLAVEMODE_EXTERNAL1 | TIM_CLOCKSOURCE_ETRMODE1); + 8004436: 68bb ldr r3, [r7, #8] + 8004438: f043 0377 orr.w r3, r3, #119 @ 0x77 + 800443c: 60bb str r3, [r7, #8] + /* Write to TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + 800443e: 687b ldr r3, [r7, #4] + 8004440: 681b ldr r3, [r3, #0] + 8004442: 68ba ldr r2, [r7, #8] + 8004444: 609a str r2, [r3, #8] + break; + 8004446: e04f b.n 80044e8 + assert_param(IS_TIM_CLOCKPRESCALER(sClockSourceConfig->ClockPrescaler)); + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + /* Configure the ETR Clock source */ + TIM_ETR_SetConfig(htim->Instance, + 8004448: 687b ldr r3, [r7, #4] + 800444a: 6818 ldr r0, [r3, #0] + 800444c: 683b ldr r3, [r7, #0] + 800444e: 6899 ldr r1, [r3, #8] + 8004450: 683b ldr r3, [r7, #0] + 8004452: 685a ldr r2, [r3, #4] + 8004454: 683b ldr r3, [r7, #0] + 8004456: 68db ldr r3, [r3, #12] + 8004458: f000 f9a0 bl 800479c + sClockSourceConfig->ClockPrescaler, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + /* Enable the External clock mode2 */ + htim->Instance->SMCR |= TIM_SMCR_ECE; + 800445c: 687b ldr r3, [r7, #4] + 800445e: 681b ldr r3, [r3, #0] + 8004460: 689a ldr r2, [r3, #8] + 8004462: 687b ldr r3, [r7, #4] + 8004464: 681b ldr r3, [r3, #0] + 8004466: f442 4280 orr.w r2, r2, #16384 @ 0x4000 + 800446a: 609a str r2, [r3, #8] + break; + 800446c: e03c b.n 80044e8 + + /* Check TI1 input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + TIM_TI1_ConfigInputStage(htim->Instance, + 800446e: 687b ldr r3, [r7, #4] + 8004470: 6818 ldr r0, [r3, #0] + 8004472: 683b ldr r3, [r7, #0] + 8004474: 6859 ldr r1, [r3, #4] + 8004476: 683b ldr r3, [r7, #0] + 8004478: 68db ldr r3, [r3, #12] + 800447a: 461a mov r2, r3 + 800447c: f000 f914 bl 80046a8 + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + TIM_ITRx_SetConfig(htim->Instance, TIM_CLOCKSOURCE_TI1); + 8004480: 687b ldr r3, [r7, #4] + 8004482: 681b ldr r3, [r3, #0] + 8004484: 2150 movs r1, #80 @ 0x50 + 8004486: 4618 mov r0, r3 + 8004488: f000 f96d bl 8004766 + break; + 800448c: e02c b.n 80044e8 + + /* Check TI2 input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + TIM_TI2_ConfigInputStage(htim->Instance, + 800448e: 687b ldr r3, [r7, #4] + 8004490: 6818 ldr r0, [r3, #0] + 8004492: 683b ldr r3, [r7, #0] + 8004494: 6859 ldr r1, [r3, #4] + 8004496: 683b ldr r3, [r7, #0] + 8004498: 68db ldr r3, [r3, #12] + 800449a: 461a mov r2, r3 + 800449c: f000 f933 bl 8004706 + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + TIM_ITRx_SetConfig(htim->Instance, TIM_CLOCKSOURCE_TI2); + 80044a0: 687b ldr r3, [r7, #4] + 80044a2: 681b ldr r3, [r3, #0] + 80044a4: 2160 movs r1, #96 @ 0x60 + 80044a6: 4618 mov r0, r3 + 80044a8: f000 f95d bl 8004766 + break; + 80044ac: e01c b.n 80044e8 + + /* Check TI1 input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + TIM_TI1_ConfigInputStage(htim->Instance, + 80044ae: 687b ldr r3, [r7, #4] + 80044b0: 6818 ldr r0, [r3, #0] + 80044b2: 683b ldr r3, [r7, #0] + 80044b4: 6859 ldr r1, [r3, #4] + 80044b6: 683b ldr r3, [r7, #0] + 80044b8: 68db ldr r3, [r3, #12] + 80044ba: 461a mov r2, r3 + 80044bc: f000 f8f4 bl 80046a8 + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + TIM_ITRx_SetConfig(htim->Instance, TIM_CLOCKSOURCE_TI1ED); + 80044c0: 687b ldr r3, [r7, #4] + 80044c2: 681b ldr r3, [r3, #0] + 80044c4: 2140 movs r1, #64 @ 0x40 + 80044c6: 4618 mov r0, r3 + 80044c8: f000 f94d bl 8004766 + break; + 80044cc: e00c b.n 80044e8 + case TIM_CLOCKSOURCE_ITR3: + { + /* Check whether or not the timer instance supports internal trigger input */ + assert_param(IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(htim->Instance)); + + TIM_ITRx_SetConfig(htim->Instance, sClockSourceConfig->ClockSource); + 80044ce: 687b ldr r3, [r7, #4] + 80044d0: 681a ldr r2, [r3, #0] + 80044d2: 683b ldr r3, [r7, #0] + 80044d4: 681b ldr r3, [r3, #0] + 80044d6: 4619 mov r1, r3 + 80044d8: 4610 mov r0, r2 + 80044da: f000 f944 bl 8004766 + break; + 80044de: e003 b.n 80044e8 + } + + default: + status = HAL_ERROR; + 80044e0: 2301 movs r3, #1 + 80044e2: 73fb strb r3, [r7, #15] + break; + 80044e4: e000 b.n 80044e8 + break; + 80044e6: bf00 nop + } + htim->State = HAL_TIM_STATE_READY; + 80044e8: 687b ldr r3, [r7, #4] + 80044ea: 2201 movs r2, #1 + 80044ec: f883 203d strb.w r2, [r3, #61] @ 0x3d + + __HAL_UNLOCK(htim); + 80044f0: 687b ldr r3, [r7, #4] + 80044f2: 2200 movs r2, #0 + 80044f4: f883 203c strb.w r2, [r3, #60] @ 0x3c + + return status; + 80044f8: 7bfb ldrb r3, [r7, #15] +} + 80044fa: 4618 mov r0, r3 + 80044fc: 3710 adds r7, #16 + 80044fe: 46bd mov sp, r7 + 8004500: bd80 pop {r7, pc} + +08004502 : + * @brief Period elapsed callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) +{ + 8004502: b480 push {r7} + 8004504: b083 sub sp, #12 + 8004506: af00 add r7, sp, #0 + 8004508: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PeriodElapsedCallback could be implemented in the user file + */ +} + 800450a: bf00 nop + 800450c: 370c adds r7, #12 + 800450e: 46bd mov sp, r7 + 8004510: f85d 7b04 ldr.w r7, [sp], #4 + 8004514: 4770 bx lr + +08004516 : + * @brief Output Compare callback in non-blocking mode + * @param htim TIM OC handle + * @retval None + */ +__weak void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim) +{ + 8004516: b480 push {r7} + 8004518: b083 sub sp, #12 + 800451a: af00 add r7, sp, #0 + 800451c: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_OC_DelayElapsedCallback could be implemented in the user file + */ +} + 800451e: bf00 nop + 8004520: 370c adds r7, #12 + 8004522: 46bd mov sp, r7 + 8004524: f85d 7b04 ldr.w r7, [sp], #4 + 8004528: 4770 bx lr + +0800452a : + * @brief Input Capture callback in non-blocking mode + * @param htim TIM IC handle + * @retval None + */ +__weak void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) +{ + 800452a: b480 push {r7} + 800452c: b083 sub sp, #12 + 800452e: af00 add r7, sp, #0 + 8004530: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_IC_CaptureCallback could be implemented in the user file + */ +} + 8004532: bf00 nop + 8004534: 370c adds r7, #12 + 8004536: 46bd mov sp, r7 + 8004538: f85d 7b04 ldr.w r7, [sp], #4 + 800453c: 4770 bx lr + +0800453e : + * @brief PWM Pulse finished callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) +{ + 800453e: b480 push {r7} + 8004540: b083 sub sp, #12 + 8004542: af00 add r7, sp, #0 + 8004544: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PWM_PulseFinishedCallback could be implemented in the user file + */ +} + 8004546: bf00 nop + 8004548: 370c adds r7, #12 + 800454a: 46bd mov sp, r7 + 800454c: f85d 7b04 ldr.w r7, [sp], #4 + 8004550: 4770 bx lr + +08004552 : + * @brief Hall Trigger detection callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_TriggerCallback(TIM_HandleTypeDef *htim) +{ + 8004552: b480 push {r7} + 8004554: b083 sub sp, #12 + 8004556: af00 add r7, sp, #0 + 8004558: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_TriggerCallback could be implemented in the user file + */ +} + 800455a: bf00 nop + 800455c: 370c adds r7, #12 + 800455e: 46bd mov sp, r7 + 8004560: f85d 7b04 ldr.w r7, [sp], #4 + 8004564: 4770 bx lr + ... + +08004568 : + * @param TIMx TIM peripheral + * @param Structure TIM Base configuration structure + * @retval None + */ +void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure) +{ + 8004568: b480 push {r7} + 800456a: b085 sub sp, #20 + 800456c: af00 add r7, sp, #0 + 800456e: 6078 str r0, [r7, #4] + 8004570: 6039 str r1, [r7, #0] + uint32_t tmpcr1; + tmpcr1 = TIMx->CR1; + 8004572: 687b ldr r3, [r7, #4] + 8004574: 681b ldr r3, [r3, #0] + 8004576: 60fb str r3, [r7, #12] + + /* Set TIM Time Base Unit parameters ---------------------------------------*/ + if (IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx)) + 8004578: 687b ldr r3, [r7, #4] + 800457a: 4a40 ldr r2, [pc, #256] @ (800467c ) + 800457c: 4293 cmp r3, r2 + 800457e: d013 beq.n 80045a8 + 8004580: 687b ldr r3, [r7, #4] + 8004582: f1b3 4f80 cmp.w r3, #1073741824 @ 0x40000000 + 8004586: d00f beq.n 80045a8 + 8004588: 687b ldr r3, [r7, #4] + 800458a: 4a3d ldr r2, [pc, #244] @ (8004680 ) + 800458c: 4293 cmp r3, r2 + 800458e: d00b beq.n 80045a8 + 8004590: 687b ldr r3, [r7, #4] + 8004592: 4a3c ldr r2, [pc, #240] @ (8004684 ) + 8004594: 4293 cmp r3, r2 + 8004596: d007 beq.n 80045a8 + 8004598: 687b ldr r3, [r7, #4] + 800459a: 4a3b ldr r2, [pc, #236] @ (8004688 ) + 800459c: 4293 cmp r3, r2 + 800459e: d003 beq.n 80045a8 + 80045a0: 687b ldr r3, [r7, #4] + 80045a2: 4a3a ldr r2, [pc, #232] @ (800468c ) + 80045a4: 4293 cmp r3, r2 + 80045a6: d108 bne.n 80045ba + { + /* Select the Counter Mode */ + tmpcr1 &= ~(TIM_CR1_DIR | TIM_CR1_CMS); + 80045a8: 68fb ldr r3, [r7, #12] + 80045aa: f023 0370 bic.w r3, r3, #112 @ 0x70 + 80045ae: 60fb str r3, [r7, #12] + tmpcr1 |= Structure->CounterMode; + 80045b0: 683b ldr r3, [r7, #0] + 80045b2: 685b ldr r3, [r3, #4] + 80045b4: 68fa ldr r2, [r7, #12] + 80045b6: 4313 orrs r3, r2 + 80045b8: 60fb str r3, [r7, #12] + } + + if (IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx)) + 80045ba: 687b ldr r3, [r7, #4] + 80045bc: 4a2f ldr r2, [pc, #188] @ (800467c ) + 80045be: 4293 cmp r3, r2 + 80045c0: d02b beq.n 800461a + 80045c2: 687b ldr r3, [r7, #4] + 80045c4: f1b3 4f80 cmp.w r3, #1073741824 @ 0x40000000 + 80045c8: d027 beq.n 800461a + 80045ca: 687b ldr r3, [r7, #4] + 80045cc: 4a2c ldr r2, [pc, #176] @ (8004680 ) + 80045ce: 4293 cmp r3, r2 + 80045d0: d023 beq.n 800461a + 80045d2: 687b ldr r3, [r7, #4] + 80045d4: 4a2b ldr r2, [pc, #172] @ (8004684 ) + 80045d6: 4293 cmp r3, r2 + 80045d8: d01f beq.n 800461a + 80045da: 687b ldr r3, [r7, #4] + 80045dc: 4a2a ldr r2, [pc, #168] @ (8004688 ) + 80045de: 4293 cmp r3, r2 + 80045e0: d01b beq.n 800461a + 80045e2: 687b ldr r3, [r7, #4] + 80045e4: 4a29 ldr r2, [pc, #164] @ (800468c ) + 80045e6: 4293 cmp r3, r2 + 80045e8: d017 beq.n 800461a + 80045ea: 687b ldr r3, [r7, #4] + 80045ec: 4a28 ldr r2, [pc, #160] @ (8004690 ) + 80045ee: 4293 cmp r3, r2 + 80045f0: d013 beq.n 800461a + 80045f2: 687b ldr r3, [r7, #4] + 80045f4: 4a27 ldr r2, [pc, #156] @ (8004694 ) + 80045f6: 4293 cmp r3, r2 + 80045f8: d00f beq.n 800461a + 80045fa: 687b ldr r3, [r7, #4] + 80045fc: 4a26 ldr r2, [pc, #152] @ (8004698 ) + 80045fe: 4293 cmp r3, r2 + 8004600: d00b beq.n 800461a + 8004602: 687b ldr r3, [r7, #4] + 8004604: 4a25 ldr r2, [pc, #148] @ (800469c ) + 8004606: 4293 cmp r3, r2 + 8004608: d007 beq.n 800461a + 800460a: 687b ldr r3, [r7, #4] + 800460c: 4a24 ldr r2, [pc, #144] @ (80046a0 ) + 800460e: 4293 cmp r3, r2 + 8004610: d003 beq.n 800461a + 8004612: 687b ldr r3, [r7, #4] + 8004614: 4a23 ldr r2, [pc, #140] @ (80046a4 ) + 8004616: 4293 cmp r3, r2 + 8004618: d108 bne.n 800462c + { + /* Set the clock division */ + tmpcr1 &= ~TIM_CR1_CKD; + 800461a: 68fb ldr r3, [r7, #12] + 800461c: f423 7340 bic.w r3, r3, #768 @ 0x300 + 8004620: 60fb str r3, [r7, #12] + tmpcr1 |= (uint32_t)Structure->ClockDivision; + 8004622: 683b ldr r3, [r7, #0] + 8004624: 68db ldr r3, [r3, #12] + 8004626: 68fa ldr r2, [r7, #12] + 8004628: 4313 orrs r3, r2 + 800462a: 60fb str r3, [r7, #12] + } + + /* Set the auto-reload preload */ + MODIFY_REG(tmpcr1, TIM_CR1_ARPE, Structure->AutoReloadPreload); + 800462c: 68fb ldr r3, [r7, #12] + 800462e: f023 0280 bic.w r2, r3, #128 @ 0x80 + 8004632: 683b ldr r3, [r7, #0] + 8004634: 695b ldr r3, [r3, #20] + 8004636: 4313 orrs r3, r2 + 8004638: 60fb str r3, [r7, #12] + + TIMx->CR1 = tmpcr1; + 800463a: 687b ldr r3, [r7, #4] + 800463c: 68fa ldr r2, [r7, #12] + 800463e: 601a str r2, [r3, #0] + + /* Set the Autoreload value */ + TIMx->ARR = (uint32_t)Structure->Period ; + 8004640: 683b ldr r3, [r7, #0] + 8004642: 689a ldr r2, [r3, #8] + 8004644: 687b ldr r3, [r7, #4] + 8004646: 62da str r2, [r3, #44] @ 0x2c + + /* Set the Prescaler value */ + TIMx->PSC = Structure->Prescaler; + 8004648: 683b ldr r3, [r7, #0] + 800464a: 681a ldr r2, [r3, #0] + 800464c: 687b ldr r3, [r7, #4] + 800464e: 629a str r2, [r3, #40] @ 0x28 + + if (IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx)) + 8004650: 687b ldr r3, [r7, #4] + 8004652: 4a0a ldr r2, [pc, #40] @ (800467c ) + 8004654: 4293 cmp r3, r2 + 8004656: d003 beq.n 8004660 + 8004658: 687b ldr r3, [r7, #4] + 800465a: 4a0c ldr r2, [pc, #48] @ (800468c ) + 800465c: 4293 cmp r3, r2 + 800465e: d103 bne.n 8004668 + { + /* Set the Repetition Counter value */ + TIMx->RCR = Structure->RepetitionCounter; + 8004660: 683b ldr r3, [r7, #0] + 8004662: 691a ldr r2, [r3, #16] + 8004664: 687b ldr r3, [r7, #4] + 8004666: 631a str r2, [r3, #48] @ 0x30 + } + + /* Generate an update event to reload the Prescaler + and the repetition counter (only for advanced timer) value immediately */ + TIMx->EGR = TIM_EGR_UG; + 8004668: 687b ldr r3, [r7, #4] + 800466a: 2201 movs r2, #1 + 800466c: 615a str r2, [r3, #20] +} + 800466e: bf00 nop + 8004670: 3714 adds r7, #20 + 8004672: 46bd mov sp, r7 + 8004674: f85d 7b04 ldr.w r7, [sp], #4 + 8004678: 4770 bx lr + 800467a: bf00 nop + 800467c: 40010000 .word 0x40010000 + 8004680: 40000400 .word 0x40000400 + 8004684: 40000800 .word 0x40000800 + 8004688: 40000c00 .word 0x40000c00 + 800468c: 40010400 .word 0x40010400 + 8004690: 40014000 .word 0x40014000 + 8004694: 40014400 .word 0x40014400 + 8004698: 40014800 .word 0x40014800 + 800469c: 40001800 .word 0x40001800 + 80046a0: 40001c00 .word 0x40001c00 + 80046a4: 40002000 .word 0x40002000 + +080046a8 : + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TIM_TI1_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter) +{ + 80046a8: b480 push {r7} + 80046aa: b087 sub sp, #28 + 80046ac: af00 add r7, sp, #0 + 80046ae: 60f8 str r0, [r7, #12] + 80046b0: 60b9 str r1, [r7, #8] + 80046b2: 607a str r2, [r7, #4] + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Disable the Channel 1: Reset the CC1E Bit */ + tmpccer = TIMx->CCER; + 80046b4: 68fb ldr r3, [r7, #12] + 80046b6: 6a1b ldr r3, [r3, #32] + 80046b8: 617b str r3, [r7, #20] + TIMx->CCER &= ~TIM_CCER_CC1E; + 80046ba: 68fb ldr r3, [r7, #12] + 80046bc: 6a1b ldr r3, [r3, #32] + 80046be: f023 0201 bic.w r2, r3, #1 + 80046c2: 68fb ldr r3, [r7, #12] + 80046c4: 621a str r2, [r3, #32] + tmpccmr1 = TIMx->CCMR1; + 80046c6: 68fb ldr r3, [r7, #12] + 80046c8: 699b ldr r3, [r3, #24] + 80046ca: 613b str r3, [r7, #16] + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC1F; + 80046cc: 693b ldr r3, [r7, #16] + 80046ce: f023 03f0 bic.w r3, r3, #240 @ 0xf0 + 80046d2: 613b str r3, [r7, #16] + tmpccmr1 |= (TIM_ICFilter << 4U); + 80046d4: 687b ldr r3, [r7, #4] + 80046d6: 011b lsls r3, r3, #4 + 80046d8: 693a ldr r2, [r7, #16] + 80046da: 4313 orrs r3, r2 + 80046dc: 613b str r3, [r7, #16] + + /* Select the Polarity and set the CC1E Bit */ + tmpccer &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP); + 80046de: 697b ldr r3, [r7, #20] + 80046e0: f023 030a bic.w r3, r3, #10 + 80046e4: 617b str r3, [r7, #20] + tmpccer |= TIM_ICPolarity; + 80046e6: 697a ldr r2, [r7, #20] + 80046e8: 68bb ldr r3, [r7, #8] + 80046ea: 4313 orrs r3, r2 + 80046ec: 617b str r3, [r7, #20] + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1; + 80046ee: 68fb ldr r3, [r7, #12] + 80046f0: 693a ldr r2, [r7, #16] + 80046f2: 619a str r2, [r3, #24] + TIMx->CCER = tmpccer; + 80046f4: 68fb ldr r3, [r7, #12] + 80046f6: 697a ldr r2, [r7, #20] + 80046f8: 621a str r2, [r3, #32] +} + 80046fa: bf00 nop + 80046fc: 371c adds r7, #28 + 80046fe: 46bd mov sp, r7 + 8004700: f85d 7b04 ldr.w r7, [sp], #4 + 8004704: 4770 bx lr + +08004706 : + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TIM_TI2_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter) +{ + 8004706: b480 push {r7} + 8004708: b087 sub sp, #28 + 800470a: af00 add r7, sp, #0 + 800470c: 60f8 str r0, [r7, #12] + 800470e: 60b9 str r1, [r7, #8] + 8004710: 607a str r2, [r7, #4] + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= ~TIM_CCER_CC2E; + 8004712: 68fb ldr r3, [r7, #12] + 8004714: 6a1b ldr r3, [r3, #32] + 8004716: f023 0210 bic.w r2, r3, #16 + 800471a: 68fb ldr r3, [r7, #12] + 800471c: 621a str r2, [r3, #32] + tmpccmr1 = TIMx->CCMR1; + 800471e: 68fb ldr r3, [r7, #12] + 8004720: 699b ldr r3, [r3, #24] + 8004722: 617b str r3, [r7, #20] + tmpccer = TIMx->CCER; + 8004724: 68fb ldr r3, [r7, #12] + 8004726: 6a1b ldr r3, [r3, #32] + 8004728: 613b str r3, [r7, #16] + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC2F; + 800472a: 697b ldr r3, [r7, #20] + 800472c: f423 4370 bic.w r3, r3, #61440 @ 0xf000 + 8004730: 617b str r3, [r7, #20] + tmpccmr1 |= (TIM_ICFilter << 12U); + 8004732: 687b ldr r3, [r7, #4] + 8004734: 031b lsls r3, r3, #12 + 8004736: 697a ldr r2, [r7, #20] + 8004738: 4313 orrs r3, r2 + 800473a: 617b str r3, [r7, #20] + + /* Select the Polarity and set the CC2E Bit */ + tmpccer &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP); + 800473c: 693b ldr r3, [r7, #16] + 800473e: f023 03a0 bic.w r3, r3, #160 @ 0xa0 + 8004742: 613b str r3, [r7, #16] + tmpccer |= (TIM_ICPolarity << 4U); + 8004744: 68bb ldr r3, [r7, #8] + 8004746: 011b lsls r3, r3, #4 + 8004748: 693a ldr r2, [r7, #16] + 800474a: 4313 orrs r3, r2 + 800474c: 613b str r3, [r7, #16] + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1 ; + 800474e: 68fb ldr r3, [r7, #12] + 8004750: 697a ldr r2, [r7, #20] + 8004752: 619a str r2, [r3, #24] + TIMx->CCER = tmpccer; + 8004754: 68fb ldr r3, [r7, #12] + 8004756: 693a ldr r2, [r7, #16] + 8004758: 621a str r2, [r3, #32] +} + 800475a: bf00 nop + 800475c: 371c adds r7, #28 + 800475e: 46bd mov sp, r7 + 8004760: f85d 7b04 ldr.w r7, [sp], #4 + 8004764: 4770 bx lr + +08004766 : + * @arg TIM_TS_TI2FP2: Filtered Timer Input 2 + * @arg TIM_TS_ETRF: External Trigger input + * @retval None + */ +static void TIM_ITRx_SetConfig(TIM_TypeDef *TIMx, uint32_t InputTriggerSource) +{ + 8004766: b480 push {r7} + 8004768: b085 sub sp, #20 + 800476a: af00 add r7, sp, #0 + 800476c: 6078 str r0, [r7, #4] + 800476e: 6039 str r1, [r7, #0] + uint32_t tmpsmcr; + + /* Get the TIMx SMCR register value */ + tmpsmcr = TIMx->SMCR; + 8004770: 687b ldr r3, [r7, #4] + 8004772: 689b ldr r3, [r3, #8] + 8004774: 60fb str r3, [r7, #12] + /* Reset the TS Bits */ + tmpsmcr &= ~TIM_SMCR_TS; + 8004776: 68fb ldr r3, [r7, #12] + 8004778: f023 0370 bic.w r3, r3, #112 @ 0x70 + 800477c: 60fb str r3, [r7, #12] + /* Set the Input Trigger source and the slave mode*/ + tmpsmcr |= (InputTriggerSource | TIM_SLAVEMODE_EXTERNAL1); + 800477e: 683a ldr r2, [r7, #0] + 8004780: 68fb ldr r3, [r7, #12] + 8004782: 4313 orrs r3, r2 + 8004784: f043 0307 orr.w r3, r3, #7 + 8004788: 60fb str r3, [r7, #12] + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; + 800478a: 687b ldr r3, [r7, #4] + 800478c: 68fa ldr r2, [r7, #12] + 800478e: 609a str r2, [r3, #8] +} + 8004790: bf00 nop + 8004792: 3714 adds r7, #20 + 8004794: 46bd mov sp, r7 + 8004796: f85d 7b04 ldr.w r7, [sp], #4 + 800479a: 4770 bx lr + +0800479c : + * This parameter must be a value between 0x00 and 0x0F + * @retval None + */ +void TIM_ETR_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ExtTRGPrescaler, + uint32_t TIM_ExtTRGPolarity, uint32_t ExtTRGFilter) +{ + 800479c: b480 push {r7} + 800479e: b087 sub sp, #28 + 80047a0: af00 add r7, sp, #0 + 80047a2: 60f8 str r0, [r7, #12] + 80047a4: 60b9 str r1, [r7, #8] + 80047a6: 607a str r2, [r7, #4] + 80047a8: 603b str r3, [r7, #0] + uint32_t tmpsmcr; + + tmpsmcr = TIMx->SMCR; + 80047aa: 68fb ldr r3, [r7, #12] + 80047ac: 689b ldr r3, [r3, #8] + 80047ae: 617b str r3, [r7, #20] + + /* Reset the ETR Bits */ + tmpsmcr &= ~(TIM_SMCR_ETF | TIM_SMCR_ETPS | TIM_SMCR_ECE | TIM_SMCR_ETP); + 80047b0: 697b ldr r3, [r7, #20] + 80047b2: f423 437f bic.w r3, r3, #65280 @ 0xff00 + 80047b6: 617b str r3, [r7, #20] + + /* Set the Prescaler, the Filter value and the Polarity */ + tmpsmcr |= (uint32_t)(TIM_ExtTRGPrescaler | (TIM_ExtTRGPolarity | (ExtTRGFilter << 8U))); + 80047b8: 683b ldr r3, [r7, #0] + 80047ba: 021a lsls r2, r3, #8 + 80047bc: 687b ldr r3, [r7, #4] + 80047be: 431a orrs r2, r3 + 80047c0: 68bb ldr r3, [r7, #8] + 80047c2: 4313 orrs r3, r2 + 80047c4: 697a ldr r2, [r7, #20] + 80047c6: 4313 orrs r3, r2 + 80047c8: 617b str r3, [r7, #20] + + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; + 80047ca: 68fb ldr r3, [r7, #12] + 80047cc: 697a ldr r2, [r7, #20] + 80047ce: 609a str r2, [r3, #8] +} + 80047d0: bf00 nop + 80047d2: 371c adds r7, #28 + 80047d4: 46bd mov sp, r7 + 80047d6: f85d 7b04 ldr.w r7, [sp], #4 + 80047da: 4770 bx lr + +080047dc : + * mode. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, + TIM_MasterConfigTypeDef *sMasterConfig) +{ + 80047dc: b480 push {r7} + 80047de: b085 sub sp, #20 + 80047e0: af00 add r7, sp, #0 + 80047e2: 6078 str r0, [r7, #4] + 80047e4: 6039 str r1, [r7, #0] + assert_param(IS_TIM_MASTER_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRGO_SOURCE(sMasterConfig->MasterOutputTrigger)); + assert_param(IS_TIM_MSM_STATE(sMasterConfig->MasterSlaveMode)); + + /* Check input state */ + __HAL_LOCK(htim); + 80047e6: 687b ldr r3, [r7, #4] + 80047e8: f893 303c ldrb.w r3, [r3, #60] @ 0x3c + 80047ec: 2b01 cmp r3, #1 + 80047ee: d101 bne.n 80047f4 + 80047f0: 2302 movs r3, #2 + 80047f2: e05a b.n 80048aa + 80047f4: 687b ldr r3, [r7, #4] + 80047f6: 2201 movs r2, #1 + 80047f8: f883 203c strb.w r2, [r3, #60] @ 0x3c + + /* Change the handler state */ + htim->State = HAL_TIM_STATE_BUSY; + 80047fc: 687b ldr r3, [r7, #4] + 80047fe: 2202 movs r2, #2 + 8004800: f883 203d strb.w r2, [r3, #61] @ 0x3d + + /* Get the TIMx CR2 register value */ + tmpcr2 = htim->Instance->CR2; + 8004804: 687b ldr r3, [r7, #4] + 8004806: 681b ldr r3, [r3, #0] + 8004808: 685b ldr r3, [r3, #4] + 800480a: 60fb str r3, [r7, #12] + + /* Get the TIMx SMCR register value */ + tmpsmcr = htim->Instance->SMCR; + 800480c: 687b ldr r3, [r7, #4] + 800480e: 681b ldr r3, [r3, #0] + 8004810: 689b ldr r3, [r3, #8] + 8004812: 60bb str r3, [r7, #8] + + /* Reset the MMS Bits */ + tmpcr2 &= ~TIM_CR2_MMS; + 8004814: 68fb ldr r3, [r7, #12] + 8004816: f023 0370 bic.w r3, r3, #112 @ 0x70 + 800481a: 60fb str r3, [r7, #12] + /* Select the TRGO source */ + tmpcr2 |= sMasterConfig->MasterOutputTrigger; + 800481c: 683b ldr r3, [r7, #0] + 800481e: 681b ldr r3, [r3, #0] + 8004820: 68fa ldr r2, [r7, #12] + 8004822: 4313 orrs r3, r2 + 8004824: 60fb str r3, [r7, #12] + + /* Update TIMx CR2 */ + htim->Instance->CR2 = tmpcr2; + 8004826: 687b ldr r3, [r7, #4] + 8004828: 681b ldr r3, [r3, #0] + 800482a: 68fa ldr r2, [r7, #12] + 800482c: 605a str r2, [r3, #4] + + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + 800482e: 687b ldr r3, [r7, #4] + 8004830: 681b ldr r3, [r3, #0] + 8004832: 4a21 ldr r2, [pc, #132] @ (80048b8 ) + 8004834: 4293 cmp r3, r2 + 8004836: d022 beq.n 800487e + 8004838: 687b ldr r3, [r7, #4] + 800483a: 681b ldr r3, [r3, #0] + 800483c: f1b3 4f80 cmp.w r3, #1073741824 @ 0x40000000 + 8004840: d01d beq.n 800487e + 8004842: 687b ldr r3, [r7, #4] + 8004844: 681b ldr r3, [r3, #0] + 8004846: 4a1d ldr r2, [pc, #116] @ (80048bc ) + 8004848: 4293 cmp r3, r2 + 800484a: d018 beq.n 800487e + 800484c: 687b ldr r3, [r7, #4] + 800484e: 681b ldr r3, [r3, #0] + 8004850: 4a1b ldr r2, [pc, #108] @ (80048c0 ) + 8004852: 4293 cmp r3, r2 + 8004854: d013 beq.n 800487e + 8004856: 687b ldr r3, [r7, #4] + 8004858: 681b ldr r3, [r3, #0] + 800485a: 4a1a ldr r2, [pc, #104] @ (80048c4 ) + 800485c: 4293 cmp r3, r2 + 800485e: d00e beq.n 800487e + 8004860: 687b ldr r3, [r7, #4] + 8004862: 681b ldr r3, [r3, #0] + 8004864: 4a18 ldr r2, [pc, #96] @ (80048c8 ) + 8004866: 4293 cmp r3, r2 + 8004868: d009 beq.n 800487e + 800486a: 687b ldr r3, [r7, #4] + 800486c: 681b ldr r3, [r3, #0] + 800486e: 4a17 ldr r2, [pc, #92] @ (80048cc ) + 8004870: 4293 cmp r3, r2 + 8004872: d004 beq.n 800487e + 8004874: 687b ldr r3, [r7, #4] + 8004876: 681b ldr r3, [r3, #0] + 8004878: 4a15 ldr r2, [pc, #84] @ (80048d0 ) + 800487a: 4293 cmp r3, r2 + 800487c: d10c bne.n 8004898 + { + /* Reset the MSM Bit */ + tmpsmcr &= ~TIM_SMCR_MSM; + 800487e: 68bb ldr r3, [r7, #8] + 8004880: f023 0380 bic.w r3, r3, #128 @ 0x80 + 8004884: 60bb str r3, [r7, #8] + /* Set master mode */ + tmpsmcr |= sMasterConfig->MasterSlaveMode; + 8004886: 683b ldr r3, [r7, #0] + 8004888: 685b ldr r3, [r3, #4] + 800488a: 68ba ldr r2, [r7, #8] + 800488c: 4313 orrs r3, r2 + 800488e: 60bb str r3, [r7, #8] + + /* Update TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + 8004890: 687b ldr r3, [r7, #4] + 8004892: 681b ldr r3, [r3, #0] + 8004894: 68ba ldr r2, [r7, #8] + 8004896: 609a str r2, [r3, #8] + } + + /* Change the htim state */ + htim->State = HAL_TIM_STATE_READY; + 8004898: 687b ldr r3, [r7, #4] + 800489a: 2201 movs r2, #1 + 800489c: f883 203d strb.w r2, [r3, #61] @ 0x3d + + __HAL_UNLOCK(htim); + 80048a0: 687b ldr r3, [r7, #4] + 80048a2: 2200 movs r2, #0 + 80048a4: f883 203c strb.w r2, [r3, #60] @ 0x3c + + return HAL_OK; + 80048a8: 2300 movs r3, #0 +} + 80048aa: 4618 mov r0, r3 + 80048ac: 3714 adds r7, #20 + 80048ae: 46bd mov sp, r7 + 80048b0: f85d 7b04 ldr.w r7, [sp], #4 + 80048b4: 4770 bx lr + 80048b6: bf00 nop + 80048b8: 40010000 .word 0x40010000 + 80048bc: 40000400 .word 0x40000400 + 80048c0: 40000800 .word 0x40000800 + 80048c4: 40000c00 .word 0x40000c00 + 80048c8: 40010400 .word 0x40010400 + 80048cc: 40014000 .word 0x40014000 + 80048d0: 40001800 .word 0x40001800 + +080048d4 : + * @brief Hall commutation changed callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim) +{ + 80048d4: b480 push {r7} + 80048d6: b083 sub sp, #12 + 80048d8: af00 add r7, sp, #0 + 80048da: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_CommutCallback could be implemented in the user file + */ +} + 80048dc: bf00 nop + 80048de: 370c adds r7, #12 + 80048e0: 46bd mov sp, r7 + 80048e2: f85d 7b04 ldr.w r7, [sp], #4 + 80048e6: 4770 bx lr + +080048e8 : + * @brief Hall Break detection callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim) +{ + 80048e8: b480 push {r7} + 80048ea: b083 sub sp, #12 + 80048ec: af00 add r7, sp, #0 + 80048ee: 6078 str r0, [r7, #4] + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_BreakCallback could be implemented in the user file + */ +} + 80048f0: bf00 nop + 80048f2: 370c adds r7, #12 + 80048f4: 46bd mov sp, r7 + 80048f6: f85d 7b04 ldr.w r7, [sp], #4 + 80048fa: 4770 bx lr + +080048fc : + * @param Init Pointer to NORSRAM Initialization structure + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, + FMC_NORSRAM_InitTypeDef *Init) +{ + 80048fc: b480 push {r7} + 80048fe: b087 sub sp, #28 + 8004900: af00 add r7, sp, #0 + 8004902: 6078 str r0, [r7, #4] + 8004904: 6039 str r1, [r7, #0] + assert_param(IS_FMC_WRITE_FIFO(Init->WriteFifo)); +#endif /* FMC_BCR1_WFDIS */ + assert_param(IS_FMC_PAGESIZE(Init->PageSize)); + + /* Disable NORSRAM Device */ + __FMC_NORSRAM_DISABLE(Device, Init->NSBank); + 8004906: 683b ldr r3, [r7, #0] + 8004908: 681a ldr r2, [r3, #0] + 800490a: 687b ldr r3, [r7, #4] + 800490c: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 8004910: 683a ldr r2, [r7, #0] + 8004912: 6812 ldr r2, [r2, #0] + 8004914: f023 0101 bic.w r1, r3, #1 + 8004918: 687b ldr r3, [r7, #4] + 800491a: f843 1022 str.w r1, [r3, r2, lsl #2] + + /* Set NORSRAM device control parameters */ + if (Init->MemoryType == FMC_MEMORY_TYPE_NOR) + 800491e: 683b ldr r3, [r7, #0] + 8004920: 689b ldr r3, [r3, #8] + 8004922: 2b08 cmp r3, #8 + 8004924: d102 bne.n 800492c + { + flashaccess = FMC_NORSRAM_FLASH_ACCESS_ENABLE; + 8004926: 2340 movs r3, #64 @ 0x40 + 8004928: 617b str r3, [r7, #20] + 800492a: e001 b.n 8004930 + } + else + { + flashaccess = FMC_NORSRAM_FLASH_ACCESS_DISABLE; + 800492c: 2300 movs r3, #0 + 800492e: 617b str r3, [r7, #20] + } + + btcr_reg = (flashaccess | \ + Init->DataAddressMux | \ + 8004930: 683b ldr r3, [r7, #0] + 8004932: 685a ldr r2, [r3, #4] + btcr_reg = (flashaccess | \ + 8004934: 697b ldr r3, [r7, #20] + 8004936: 431a orrs r2, r3 + Init->MemoryType | \ + 8004938: 683b ldr r3, [r7, #0] + 800493a: 689b ldr r3, [r3, #8] + Init->DataAddressMux | \ + 800493c: 431a orrs r2, r3 + Init->MemoryDataWidth | \ + 800493e: 683b ldr r3, [r7, #0] + 8004940: 68db ldr r3, [r3, #12] + Init->MemoryType | \ + 8004942: 431a orrs r2, r3 + Init->BurstAccessMode | \ + 8004944: 683b ldr r3, [r7, #0] + 8004946: 691b ldr r3, [r3, #16] + Init->MemoryDataWidth | \ + 8004948: 431a orrs r2, r3 + Init->WaitSignalPolarity | \ + 800494a: 683b ldr r3, [r7, #0] + 800494c: 695b ldr r3, [r3, #20] + Init->BurstAccessMode | \ + 800494e: 431a orrs r2, r3 + Init->WaitSignalActive | \ + 8004950: 683b ldr r3, [r7, #0] + 8004952: 69db ldr r3, [r3, #28] + Init->WaitSignalPolarity | \ + 8004954: 431a orrs r2, r3 + Init->WriteOperation | \ + 8004956: 683b ldr r3, [r7, #0] + 8004958: 6a1b ldr r3, [r3, #32] + Init->WaitSignalActive | \ + 800495a: 431a orrs r2, r3 + Init->WaitSignal | \ + 800495c: 683b ldr r3, [r7, #0] + 800495e: 6a5b ldr r3, [r3, #36] @ 0x24 + Init->WriteOperation | \ + 8004960: 431a orrs r2, r3 + Init->ExtendedMode | \ + 8004962: 683b ldr r3, [r7, #0] + 8004964: 6a9b ldr r3, [r3, #40] @ 0x28 + Init->WaitSignal | \ + 8004966: 431a orrs r2, r3 + Init->AsynchronousWait | \ + 8004968: 683b ldr r3, [r7, #0] + 800496a: 6adb ldr r3, [r3, #44] @ 0x2c + Init->ExtendedMode | \ + 800496c: 431a orrs r2, r3 + Init->WriteBurst); + 800496e: 683b ldr r3, [r7, #0] + 8004970: 6b1b ldr r3, [r3, #48] @ 0x30 + btcr_reg = (flashaccess | \ + 8004972: 4313 orrs r3, r2 + 8004974: 613b str r3, [r7, #16] + +#if defined(FMC_BCR1_WRAPMOD) + btcr_reg |= Init->WrapMode; + 8004976: 683b ldr r3, [r7, #0] + 8004978: 699b ldr r3, [r3, #24] + 800497a: 693a ldr r2, [r7, #16] + 800497c: 4313 orrs r3, r2 + 800497e: 613b str r3, [r7, #16] +#endif /* FMC_BCR1_WRAPMOD */ +#if defined(FMC_BCR1_CCLKEN) + btcr_reg |= Init->ContinuousClock; + 8004980: 683b ldr r3, [r7, #0] + 8004982: 6b5b ldr r3, [r3, #52] @ 0x34 + 8004984: 693a ldr r2, [r7, #16] + 8004986: 4313 orrs r3, r2 + 8004988: 613b str r3, [r7, #16] +#endif /* FMC_BCR1_CCLKEN */ +#if defined(FMC_BCR1_WFDIS) + btcr_reg |= Init->WriteFifo; +#endif /* FMC_BCR1_WFDIS */ + btcr_reg |= Init->PageSize; + 800498a: 683b ldr r3, [r7, #0] + 800498c: 6bdb ldr r3, [r3, #60] @ 0x3c + 800498e: 693a ldr r2, [r7, #16] + 8004990: 4313 orrs r3, r2 + 8004992: 613b str r3, [r7, #16] + + mask = (FMC_BCR1_MBKEN | + 8004994: 4b1b ldr r3, [pc, #108] @ (8004a04 ) + 8004996: 60fb str r3, [r7, #12] + FMC_BCR1_EXTMOD | + FMC_BCR1_ASYNCWAIT | + FMC_BCR1_CBURSTRW); + +#if defined(FMC_BCR1_WRAPMOD) + mask |= FMC_BCR1_WRAPMOD; + 8004998: 68fb ldr r3, [r7, #12] + 800499a: f443 6380 orr.w r3, r3, #1024 @ 0x400 + 800499e: 60fb str r3, [r7, #12] +#endif /* FMC_BCR1_WRAPMOD */ +#if defined(FMC_BCR1_CCLKEN) + mask |= FMC_BCR1_CCLKEN; + 80049a0: 68fb ldr r3, [r7, #12] + 80049a2: f443 1380 orr.w r3, r3, #1048576 @ 0x100000 + 80049a6: 60fb str r3, [r7, #12] +#endif +#if defined(FMC_BCR1_WFDIS) + mask |= FMC_BCR1_WFDIS; +#endif /* FMC_BCR1_WFDIS */ + mask |= FMC_BCR1_CPSIZE; + 80049a8: 68fb ldr r3, [r7, #12] + 80049aa: f443 23e0 orr.w r3, r3, #458752 @ 0x70000 + 80049ae: 60fb str r3, [r7, #12] + + MODIFY_REG(Device->BTCR[Init->NSBank], mask, btcr_reg); + 80049b0: 683b ldr r3, [r7, #0] + 80049b2: 681a ldr r2, [r3, #0] + 80049b4: 687b ldr r3, [r7, #4] + 80049b6: f853 2022 ldr.w r2, [r3, r2, lsl #2] + 80049ba: 68fb ldr r3, [r7, #12] + 80049bc: 43db mvns r3, r3 + 80049be: ea02 0103 and.w r1, r2, r3 + 80049c2: 683b ldr r3, [r7, #0] + 80049c4: 681a ldr r2, [r3, #0] + 80049c6: 693b ldr r3, [r7, #16] + 80049c8: 4319 orrs r1, r3 + 80049ca: 687b ldr r3, [r7, #4] + 80049cc: f843 1022 str.w r1, [r3, r2, lsl #2] + +#if defined(FMC_BCR1_CCLKEN) + /* Configure synchronous mode when Continuous clock is enabled for bank2..4 */ + if ((Init->ContinuousClock == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC) && (Init->NSBank != FMC_NORSRAM_BANK1)) + 80049d0: 683b ldr r3, [r7, #0] + 80049d2: 6b5b ldr r3, [r3, #52] @ 0x34 + 80049d4: f5b3 1f80 cmp.w r3, #1048576 @ 0x100000 + 80049d8: d10c bne.n 80049f4 + 80049da: 683b ldr r3, [r7, #0] + 80049dc: 681b ldr r3, [r3, #0] + 80049de: 2b00 cmp r3, #0 + 80049e0: d008 beq.n 80049f4 + { + MODIFY_REG(Device->BTCR[FMC_NORSRAM_BANK1], FMC_BCR1_CCLKEN, Init->ContinuousClock); + 80049e2: 687b ldr r3, [r7, #4] + 80049e4: 681b ldr r3, [r3, #0] + 80049e6: f423 1280 bic.w r2, r3, #1048576 @ 0x100000 + 80049ea: 683b ldr r3, [r7, #0] + 80049ec: 6b5b ldr r3, [r3, #52] @ 0x34 + 80049ee: 431a orrs r2, r3 + 80049f0: 687b ldr r3, [r7, #4] + 80049f2: 601a str r2, [r3, #0] + /* Configure Write FIFO mode when Write Fifo is enabled for bank2..4 */ + SET_BIT(Device->BTCR[FMC_NORSRAM_BANK1], (uint32_t)(Init->WriteFifo)); + } +#endif /* FMC_BCR1_WFDIS */ + + return HAL_OK; + 80049f4: 2300 movs r3, #0 +} + 80049f6: 4618 mov r0, r3 + 80049f8: 371c adds r7, #28 + 80049fa: 46bd mov sp, r7 + 80049fc: f85d 7b04 ldr.w r7, [sp], #4 + 8004a00: 4770 bx lr + 8004a02: bf00 nop + 8004a04: 0008fb7f .word 0x0008fb7f + +08004a08 : + * @param Bank NORSRAM bank number + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, + FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank) +{ + 8004a08: b480 push {r7} + 8004a0a: b087 sub sp, #28 + 8004a0c: af00 add r7, sp, #0 + 8004a0e: 60f8 str r0, [r7, #12] + 8004a10: 60b9 str r1, [r7, #8] + 8004a12: 607a str r2, [r7, #4] + assert_param(IS_FMC_DATA_LATENCY(Timing->DataLatency)); + assert_param(IS_FMC_ACCESS_MODE(Timing->AccessMode)); + assert_param(IS_FMC_NORSRAM_BANK(Bank)); + + /* Set FMC_NORSRAM device timing parameters */ + MODIFY_REG(Device->BTCR[Bank + 1U], BTR_CLEAR_MASK, (Timing->AddressSetupTime | + 8004a14: 687b ldr r3, [r7, #4] + 8004a16: 1c5a adds r2, r3, #1 + 8004a18: 68fb ldr r3, [r7, #12] + 8004a1a: f853 3022 ldr.w r3, [r3, r2, lsl #2] + 8004a1e: f003 4140 and.w r1, r3, #3221225472 @ 0xc0000000 + 8004a22: 68bb ldr r3, [r7, #8] + 8004a24: 681a ldr r2, [r3, #0] + 8004a26: 68bb ldr r3, [r7, #8] + 8004a28: 685b ldr r3, [r3, #4] + 8004a2a: 011b lsls r3, r3, #4 + 8004a2c: 431a orrs r2, r3 + 8004a2e: 68bb ldr r3, [r7, #8] + 8004a30: 689b ldr r3, [r3, #8] + 8004a32: 021b lsls r3, r3, #8 + 8004a34: 431a orrs r2, r3 + 8004a36: 68bb ldr r3, [r7, #8] + 8004a38: 68db ldr r3, [r3, #12] + 8004a3a: 041b lsls r3, r3, #16 + 8004a3c: 431a orrs r2, r3 + 8004a3e: 68bb ldr r3, [r7, #8] + 8004a40: 691b ldr r3, [r3, #16] + 8004a42: 3b01 subs r3, #1 + 8004a44: 051b lsls r3, r3, #20 + 8004a46: 431a orrs r2, r3 + 8004a48: 68bb ldr r3, [r7, #8] + 8004a4a: 695b ldr r3, [r3, #20] + 8004a4c: 3b02 subs r3, #2 + 8004a4e: 061b lsls r3, r3, #24 + 8004a50: 431a orrs r2, r3 + 8004a52: 68bb ldr r3, [r7, #8] + 8004a54: 699b ldr r3, [r3, #24] + 8004a56: 4313 orrs r3, r2 + 8004a58: 687a ldr r2, [r7, #4] + 8004a5a: 3201 adds r2, #1 + 8004a5c: 4319 orrs r1, r3 + 8004a5e: 68fb ldr r3, [r7, #12] + 8004a60: f843 1022 str.w r1, [r3, r2, lsl #2] + (((Timing->DataLatency) - 2U) << FMC_BTR1_DATLAT_Pos) | + (Timing->AccessMode))); + +#if defined(FMC_BCR1_CCLKEN) + /* Configure Clock division value (in NORSRAM bank 1) when continuous clock is enabled */ + if (HAL_IS_BIT_SET(Device->BTCR[FMC_NORSRAM_BANK1], FMC_BCR1_CCLKEN)) + 8004a64: 68fb ldr r3, [r7, #12] + 8004a66: 681b ldr r3, [r3, #0] + 8004a68: f403 1380 and.w r3, r3, #1048576 @ 0x100000 + 8004a6c: f5b3 1f80 cmp.w r3, #1048576 @ 0x100000 + 8004a70: d113 bne.n 8004a9a + { + tmpr = (uint32_t)(Device->BTCR[FMC_NORSRAM_BANK1 + 1U] & ~((0x0FU) << FMC_BTR1_CLKDIV_Pos)); + 8004a72: 68fb ldr r3, [r7, #12] + 8004a74: 685b ldr r3, [r3, #4] + 8004a76: f423 0370 bic.w r3, r3, #15728640 @ 0xf00000 + 8004a7a: 617b str r3, [r7, #20] + tmpr |= (uint32_t)(((Timing->CLKDivision) - 1U) << FMC_BTR1_CLKDIV_Pos); + 8004a7c: 68bb ldr r3, [r7, #8] + 8004a7e: 691b ldr r3, [r3, #16] + 8004a80: 3b01 subs r3, #1 + 8004a82: 051b lsls r3, r3, #20 + 8004a84: 697a ldr r2, [r7, #20] + 8004a86: 4313 orrs r3, r2 + 8004a88: 617b str r3, [r7, #20] + MODIFY_REG(Device->BTCR[FMC_NORSRAM_BANK1 + 1U], FMC_BTR1_CLKDIV, tmpr); + 8004a8a: 68fb ldr r3, [r7, #12] + 8004a8c: 685b ldr r3, [r3, #4] + 8004a8e: f423 0270 bic.w r2, r3, #15728640 @ 0xf00000 + 8004a92: 697b ldr r3, [r7, #20] + 8004a94: 431a orrs r2, r3 + 8004a96: 68fb ldr r3, [r7, #12] + 8004a98: 605a str r2, [r3, #4] + } + +#endif + return HAL_OK; + 8004a9a: 2300 movs r3, #0 +} + 8004a9c: 4618 mov r0, r3 + 8004a9e: 371c adds r7, #28 + 8004aa0: 46bd mov sp, r7 + 8004aa2: f85d 7b04 ldr.w r7, [sp], #4 + 8004aa6: 4770 bx lr + +08004aa8 : + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device, + FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, + uint32_t ExtendedMode) +{ + 8004aa8: b480 push {r7} + 8004aaa: b085 sub sp, #20 + 8004aac: af00 add r7, sp, #0 + 8004aae: 60f8 str r0, [r7, #12] + 8004ab0: 60b9 str r1, [r7, #8] + 8004ab2: 607a str r2, [r7, #4] + 8004ab4: 603b str r3, [r7, #0] + /* Check the parameters */ + assert_param(IS_FMC_EXTENDED_MODE(ExtendedMode)); + + /* Set NORSRAM device timing register for write configuration, if extended mode is used */ + if (ExtendedMode == FMC_EXTENDED_MODE_ENABLE) + 8004ab6: 683b ldr r3, [r7, #0] + 8004ab8: f5b3 4f80 cmp.w r3, #16384 @ 0x4000 + 8004abc: d11d bne.n 8004afa + assert_param(IS_FMC_TURNAROUND_TIME(Timing->BusTurnAroundDuration)); + assert_param(IS_FMC_ACCESS_MODE(Timing->AccessMode)); + assert_param(IS_FMC_NORSRAM_BANK(Bank)); + + /* Set NORSRAM device timing register for write configuration, if extended mode is used */ + MODIFY_REG(Device->BWTR[Bank], BWTR_CLEAR_MASK, (Timing->AddressSetupTime | + 8004abe: 68fb ldr r3, [r7, #12] + 8004ac0: 687a ldr r2, [r7, #4] + 8004ac2: f853 2022 ldr.w r2, [r3, r2, lsl #2] + 8004ac6: 4b13 ldr r3, [pc, #76] @ (8004b14 ) + 8004ac8: 4013 ands r3, r2 + 8004aca: 68ba ldr r2, [r7, #8] + 8004acc: 6811 ldr r1, [r2, #0] + 8004ace: 68ba ldr r2, [r7, #8] + 8004ad0: 6852 ldr r2, [r2, #4] + 8004ad2: 0112 lsls r2, r2, #4 + 8004ad4: 4311 orrs r1, r2 + 8004ad6: 68ba ldr r2, [r7, #8] + 8004ad8: 6892 ldr r2, [r2, #8] + 8004ada: 0212 lsls r2, r2, #8 + 8004adc: 4311 orrs r1, r2 + 8004ade: 68ba ldr r2, [r7, #8] + 8004ae0: 6992 ldr r2, [r2, #24] + 8004ae2: 4311 orrs r1, r2 + 8004ae4: 68ba ldr r2, [r7, #8] + 8004ae6: 68d2 ldr r2, [r2, #12] + 8004ae8: 0412 lsls r2, r2, #16 + 8004aea: 430a orrs r2, r1 + 8004aec: ea43 0102 orr.w r1, r3, r2 + 8004af0: 68fb ldr r3, [r7, #12] + 8004af2: 687a ldr r2, [r7, #4] + 8004af4: f843 1022 str.w r1, [r3, r2, lsl #2] + 8004af8: e005 b.n 8004b06 + Timing->AccessMode | + ((Timing->BusTurnAroundDuration) << FMC_BWTR1_BUSTURN_Pos))); + } + else + { + Device->BWTR[Bank] = 0x0FFFFFFFU; + 8004afa: 68fb ldr r3, [r7, #12] + 8004afc: 687a ldr r2, [r7, #4] + 8004afe: f06f 4170 mvn.w r1, #4026531840 @ 0xf0000000 + 8004b02: f843 1022 str.w r1, [r3, r2, lsl #2] + } + + return HAL_OK; + 8004b06: 2300 movs r3, #0 +} + 8004b08: 4618 mov r0, r3 + 8004b0a: 3714 adds r7, #20 + 8004b0c: 46bd mov sp, r7 + 8004b0e: f85d 7b04 ldr.w r7, [sp], #4 + 8004b12: 4770 bx lr + 8004b14: cff00000 .word 0xcff00000 + +08004b18 : + +/** + * LwIP initialization function + */ +void MX_LWIP_Init(void) +{ + 8004b18: b580 push {r7, lr} + 8004b1a: b084 sub sp, #16 + 8004b1c: af04 add r7, sp, #16 + /* Initilialize the LwIP stack without RTOS */ + lwip_init(); + 8004b1e: f000 fc61 bl 80053e4 + + /* IP addresses initialization with DHCP (IPv4) */ + ipaddr.addr = get_ip(); + 8004b22: f7fc fe71 bl 8001808 + 8004b26: 4603 mov r3, r0 + 8004b28: 4a1b ldr r2, [pc, #108] @ (8004b98 ) + 8004b2a: 6013 str r3, [r2, #0] + netmask.addr = ipaddr_addr("255.255.255.0"); + 8004b2c: 481b ldr r0, [pc, #108] @ (8004b9c ) + 8004b2e: f00b fc32 bl 8010396 + 8004b32: 4603 mov r3, r0 + 8004b34: 4a1a ldr r2, [pc, #104] @ (8004ba0 ) + 8004b36: 6013 str r3, [r2, #0] + gw.addr = ipaddr_addr("10.1.1.1"); + 8004b38: 481a ldr r0, [pc, #104] @ (8004ba4 ) + 8004b3a: f00b fc2c bl 8010396 + 8004b3e: 4603 mov r3, r0 + 8004b40: 4a19 ldr r2, [pc, #100] @ (8004ba8 ) + 8004b42: 6013 str r3, [r2, #0] + + /* add the network interface (IPv4/IPv6) without RTOS */ + netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, ðernet_input); + 8004b44: 4b19 ldr r3, [pc, #100] @ (8004bac ) + 8004b46: 9302 str r3, [sp, #8] + 8004b48: 4b19 ldr r3, [pc, #100] @ (8004bb0 ) + 8004b4a: 9301 str r3, [sp, #4] + 8004b4c: 2300 movs r3, #0 + 8004b4e: 9300 str r3, [sp, #0] + 8004b50: 4b15 ldr r3, [pc, #84] @ (8004ba8 ) + 8004b52: 4a13 ldr r2, [pc, #76] @ (8004ba0 ) + 8004b54: 4910 ldr r1, [pc, #64] @ (8004b98 ) + 8004b56: 4817 ldr r0, [pc, #92] @ (8004bb4 ) + 8004b58: f001 f918 bl 8005d8c + + /* Registers the default network interface */ + netif_set_default(&gnetif); + 8004b5c: 4815 ldr r0, [pc, #84] @ (8004bb4 ) + 8004b5e: f001 facf bl 8006100 + + if (netif_is_link_up(&gnetif)) + 8004b62: 4b14 ldr r3, [pc, #80] @ (8004bb4 ) + 8004b64: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 8004b68: 089b lsrs r3, r3, #2 + 8004b6a: f003 0301 and.w r3, r3, #1 + 8004b6e: b2db uxtb r3, r3 + 8004b70: 2b00 cmp r3, #0 + 8004b72: d003 beq.n 8004b7c + { + /* When the netif is fully configured this function must be called */ + netif_set_up(&gnetif); + 8004b74: 480f ldr r0, [pc, #60] @ (8004bb4 ) + 8004b76: f001 fad3 bl 8006120 + 8004b7a: e002 b.n 8004b82 + } + else + { + /* When the netif link is down this function must be called */ + netif_set_down(&gnetif); + 8004b7c: 480d ldr r0, [pc, #52] @ (8004bb4 ) + 8004b7e: f001 fb3b bl 80061f8 + } + + /* Set the link callback function, this function is called on change of link status*/ + netif_set_link_callback(&gnetif, ethernet_link_status_updated); + 8004b82: 490d ldr r1, [pc, #52] @ (8004bb8 ) + 8004b84: 480b ldr r0, [pc, #44] @ (8004bb4 ) + 8004b86: f001 fbd1 bl 800632c + + /* Create the Ethernet link handler thread */ + + /* Start DHCP negotiation for a network interface (IPv4) */ + dhcp_start(&gnetif); + 8004b8a: 480a ldr r0, [pc, #40] @ (8004bb4 ) + 8004b8c: f008 fd20 bl 800d5d0 + +/* USER CODE BEGIN 3 */ + +/* USER CODE END 3 */ +} + 8004b90: bf00 nop + 8004b92: 46bd mov sp, r7 + 8004b94: bd80 pop {r7, pc} + 8004b96: bf00 nop + 8004b98: 2000156c .word 0x2000156c + 8004b9c: 08015fcc .word 0x08015fcc + 8004ba0: 20001570 .word 0x20001570 + 8004ba4: 08015fdc .word 0x08015fdc + 8004ba8: 20001574 .word 0x20001574 + 8004bac: 08011291 .word 0x08011291 + 8004bb0: 08004ec9 .word 0x08004ec9 + 8004bb4: 20001534 .word 0x20001534 + 8004bb8: 08004c0d .word 0x08004c0d + +08004bbc : + * @brief Ethernet Link periodic check + * @param netif + * @retval None + */ +static void Ethernet_Link_Periodic_Handle(struct netif *netif) +{ + 8004bbc: b580 push {r7, lr} + 8004bbe: b082 sub sp, #8 + 8004bc0: af00 add r7, sp, #0 + 8004bc2: 6078 str r0, [r7, #4] +/* USER CODE BEGIN 4_4_1 */ +/* USER CODE END 4_4_1 */ + + /* Ethernet Link every 100ms */ + if (HAL_GetTick() - EthernetLinkTimer >= 100) + 8004bc4: f7fd f998 bl 8001ef8 + 8004bc8: 4602 mov r2, r0 + 8004bca: 4b08 ldr r3, [pc, #32] @ (8004bec ) + 8004bcc: 681b ldr r3, [r3, #0] + 8004bce: 1ad3 subs r3, r2, r3 + 8004bd0: 2b63 cmp r3, #99 @ 0x63 + 8004bd2: d907 bls.n 8004be4 + { + EthernetLinkTimer = HAL_GetTick(); + 8004bd4: f7fd f990 bl 8001ef8 + 8004bd8: 4603 mov r3, r0 + 8004bda: 4a04 ldr r2, [pc, #16] @ (8004bec ) + 8004bdc: 6013 str r3, [r2, #0] + ethernet_link_check_state(netif); + 8004bde: 6878 ldr r0, [r7, #4] + 8004be0: f000 fad6 bl 8005190 + } +/* USER CODE BEGIN 4_4 */ +/* USER CODE END 4_4 */ +} + 8004be4: bf00 nop + 8004be6: 3708 adds r7, #8 + 8004be8: 46bd mov sp, r7 + 8004bea: bd80 pop {r7, pc} + 8004bec: 20001530 .word 0x20001530 + +08004bf0 : + * Send it to the lwIP stack for handling + * Handle timeouts if LWIP_TIMERS is set and without RTOS + * Handle the llink status if LWIP_NETIF_LINK_CALLBACK is set and without RTOS + */ +void MX_LWIP_Process(void) +{ + 8004bf0: b580 push {r7, lr} + 8004bf2: af00 add r7, sp, #0 +/* USER CODE BEGIN 4_1 */ +/* USER CODE END 4_1 */ + ethernetif_input(&gnetif); + 8004bf4: 4804 ldr r0, [pc, #16] @ (8004c08 ) + 8004bf6: f000 f947 bl 8004e88 + +/* USER CODE BEGIN 4_2 */ +/* USER CODE END 4_2 */ + /* Handle timeouts */ + sys_check_timeouts(); + 8004bfa: f007 fc13 bl 800c424 + + Ethernet_Link_Periodic_Handle(&gnetif); + 8004bfe: 4802 ldr r0, [pc, #8] @ (8004c08 ) + 8004c00: f7ff ffdc bl 8004bbc + +/* USER CODE BEGIN 4_3 */ +/* USER CODE END 4_3 */ +} + 8004c04: bf00 nop + 8004c06: bd80 pop {r7, pc} + 8004c08: 20001534 .word 0x20001534 + +08004c0c : + * @brief Notify the User about the network interface config status + * @param netif: the network interface + * @retval None + */ +static void ethernet_link_status_updated(struct netif *netif) +{ + 8004c0c: b480 push {r7} + 8004c0e: b083 sub sp, #12 + 8004c10: af00 add r7, sp, #0 + 8004c12: 6078 str r0, [r7, #4] + else /* netif is down */ + { +/* USER CODE BEGIN 6 */ +/* USER CODE END 6 */ + } +} + 8004c14: bf00 nop + 8004c16: 370c adds r7, #12 + 8004c18: 46bd mov sp, r7 + 8004c1a: f85d 7b04 ldr.w r7, [sp], #4 + 8004c1e: 4770 bx lr + +08004c20 : + * + * @param netif the already initialized lwip network interface structure + * for this ethernetif + */ +static void low_level_init(struct netif *netif) +{ + 8004c20: b580 push {r7, lr} + 8004c22: b084 sub sp, #16 + 8004c24: af00 add r7, sp, #0 + 8004c26: 6078 str r0, [r7, #4] + HAL_StatusTypeDef hal_eth_init_status = HAL_OK; + 8004c28: 2300 movs r3, #0 + 8004c2a: 73fb strb r3, [r7, #15] + /* Start ETH HAL Init */ + + uint8_t MACAddr[6] ; + heth.Instance = ETH; + 8004c2c: 4b40 ldr r3, [pc, #256] @ (8004d30 ) + 8004c2e: 4a41 ldr r2, [pc, #260] @ (8004d34 ) + 8004c30: 601a str r2, [r3, #0] + MACAddr[0] = 0x00; + 8004c32: 2300 movs r3, #0 + 8004c34: 723b strb r3, [r7, #8] + MACAddr[1] = 0x80; + 8004c36: 2380 movs r3, #128 @ 0x80 + 8004c38: 727b strb r3, [r7, #9] + MACAddr[2] = 0xE1; + 8004c3a: 23e1 movs r3, #225 @ 0xe1 + 8004c3c: 72bb strb r3, [r7, #10] + MACAddr[3] = 0x00; + 8004c3e: 2300 movs r3, #0 + 8004c40: 72fb strb r3, [r7, #11] + MACAddr[4] = 0x00; + 8004c42: 2300 movs r3, #0 + 8004c44: 733b strb r3, [r7, #12] + MACAddr[5] = 0x00; + 8004c46: 2300 movs r3, #0 + 8004c48: 737b strb r3, [r7, #13] + heth.Init.MACAddr = &MACAddr[0]; + 8004c4a: 4a39 ldr r2, [pc, #228] @ (8004d30 ) + 8004c4c: f107 0308 add.w r3, r7, #8 + 8004c50: 6053 str r3, [r2, #4] + heth.Init.MediaInterface = HAL_ETH_RMII_MODE; + 8004c52: 4b37 ldr r3, [pc, #220] @ (8004d30 ) + 8004c54: f44f 0200 mov.w r2, #8388608 @ 0x800000 + 8004c58: 609a str r2, [r3, #8] + heth.Init.TxDesc = DMATxDscrTab; + 8004c5a: 4b35 ldr r3, [pc, #212] @ (8004d30 ) + 8004c5c: 4a36 ldr r2, [pc, #216] @ (8004d38 ) + 8004c5e: 60da str r2, [r3, #12] + heth.Init.RxDesc = DMARxDscrTab; + 8004c60: 4b33 ldr r3, [pc, #204] @ (8004d30 ) + 8004c62: 4a36 ldr r2, [pc, #216] @ (8004d3c ) + 8004c64: 611a str r2, [r3, #16] + heth.Init.RxBuffLen = 1536; + 8004c66: 4b32 ldr r3, [pc, #200] @ (8004d30 ) + 8004c68: f44f 62c0 mov.w r2, #1536 @ 0x600 + 8004c6c: 615a str r2, [r3, #20] + + /* USER CODE BEGIN MACADDRESS */ + + /* USER CODE END MACADDRESS */ + + hal_eth_init_status = HAL_ETH_Init(&heth); + 8004c6e: 4830 ldr r0, [pc, #192] @ (8004d30 ) + 8004c70: f7fd fa84 bl 800217c + 8004c74: 4603 mov r3, r0 + 8004c76: 73fb strb r3, [r7, #15] + + memset(&TxConfig, 0 , sizeof(ETH_TxPacketConfig)); + 8004c78: 2238 movs r2, #56 @ 0x38 + 8004c7a: 2100 movs r1, #0 + 8004c7c: 4830 ldr r0, [pc, #192] @ (8004d40 ) + 8004c7e: f00c fd3a bl 80116f6 + TxConfig.Attributes = ETH_TX_PACKETS_FEATURES_CSUM | ETH_TX_PACKETS_FEATURES_CRCPAD; + 8004c82: 4b2f ldr r3, [pc, #188] @ (8004d40 ) + 8004c84: 2221 movs r2, #33 @ 0x21 + 8004c86: 601a str r2, [r3, #0] + TxConfig.ChecksumCtrl = ETH_CHECKSUM_IPHDR_PAYLOAD_INSERT_PHDR_CALC; + 8004c88: 4b2d ldr r3, [pc, #180] @ (8004d40 ) + 8004c8a: f44f 0240 mov.w r2, #12582912 @ 0xc00000 + 8004c8e: 615a str r2, [r3, #20] + TxConfig.CRCPadCtrl = ETH_CRC_PAD_INSERT; + 8004c90: 4b2b ldr r3, [pc, #172] @ (8004d40 ) + 8004c92: 2200 movs r2, #0 + 8004c94: 611a str r2, [r3, #16] + + /* End ETH HAL Init */ + + /* Initialize the RX POOL */ + LWIP_MEMPOOL_INIT(RX_POOL); + 8004c96: 482b ldr r0, [pc, #172] @ (8004d44 ) + 8004c98: f000 ff40 bl 8005b1c + +#if LWIP_ARP || LWIP_ETHERNET + + /* set MAC hardware address length */ + netif->hwaddr_len = ETH_HWADDR_LEN; + 8004c9c: 687b ldr r3, [r7, #4] + 8004c9e: 2206 movs r2, #6 + 8004ca0: f883 2030 strb.w r2, [r3, #48] @ 0x30 + + /* set MAC hardware address */ + netif->hwaddr[0] = heth.Init.MACAddr[0]; + 8004ca4: 4b22 ldr r3, [pc, #136] @ (8004d30 ) + 8004ca6: 685b ldr r3, [r3, #4] + 8004ca8: 781a ldrb r2, [r3, #0] + 8004caa: 687b ldr r3, [r7, #4] + 8004cac: f883 202a strb.w r2, [r3, #42] @ 0x2a + netif->hwaddr[1] = heth.Init.MACAddr[1]; + 8004cb0: 4b1f ldr r3, [pc, #124] @ (8004d30 ) + 8004cb2: 685b ldr r3, [r3, #4] + 8004cb4: 785a ldrb r2, [r3, #1] + 8004cb6: 687b ldr r3, [r7, #4] + 8004cb8: f883 202b strb.w r2, [r3, #43] @ 0x2b + netif->hwaddr[2] = heth.Init.MACAddr[2]; + 8004cbc: 4b1c ldr r3, [pc, #112] @ (8004d30 ) + 8004cbe: 685b ldr r3, [r3, #4] + 8004cc0: 789a ldrb r2, [r3, #2] + 8004cc2: 687b ldr r3, [r7, #4] + 8004cc4: f883 202c strb.w r2, [r3, #44] @ 0x2c + netif->hwaddr[3] = heth.Init.MACAddr[3]; + 8004cc8: 4b19 ldr r3, [pc, #100] @ (8004d30 ) + 8004cca: 685b ldr r3, [r3, #4] + 8004ccc: 78da ldrb r2, [r3, #3] + 8004cce: 687b ldr r3, [r7, #4] + 8004cd0: f883 202d strb.w r2, [r3, #45] @ 0x2d + netif->hwaddr[4] = heth.Init.MACAddr[4]; + 8004cd4: 4b16 ldr r3, [pc, #88] @ (8004d30 ) + 8004cd6: 685b ldr r3, [r3, #4] + 8004cd8: 791a ldrb r2, [r3, #4] + 8004cda: 687b ldr r3, [r7, #4] + 8004cdc: f883 202e strb.w r2, [r3, #46] @ 0x2e + netif->hwaddr[5] = heth.Init.MACAddr[5]; + 8004ce0: 4b13 ldr r3, [pc, #76] @ (8004d30 ) + 8004ce2: 685b ldr r3, [r3, #4] + 8004ce4: 795a ldrb r2, [r3, #5] + 8004ce6: 687b ldr r3, [r7, #4] + 8004ce8: f883 202f strb.w r2, [r3, #47] @ 0x2f + + /* maximum transfer unit */ + netif->mtu = ETH_MAX_PAYLOAD; + 8004cec: 687b ldr r3, [r7, #4] + 8004cee: f240 52dc movw r2, #1500 @ 0x5dc + 8004cf2: 851a strh r2, [r3, #40] @ 0x28 + + /* Accept broadcast address and ARP traffic */ + /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ + #if LWIP_ARP + netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP; + 8004cf4: 687b ldr r3, [r7, #4] + 8004cf6: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 8004cfa: f043 030a orr.w r3, r3, #10 + 8004cfe: b2da uxtb r2, r3 + 8004d00: 687b ldr r3, [r7, #4] + 8004d02: f883 2031 strb.w r2, [r3, #49] @ 0x31 + +/* USER CODE BEGIN PHY_PRE_CONFIG */ + +/* USER CODE END PHY_PRE_CONFIG */ + /* Set PHY IO functions */ + DP83848_RegisterBusIO(&DP83848, &DP83848_IOCtx); + 8004d06: 4910 ldr r1, [pc, #64] @ (8004d48 ) + 8004d08: 4810 ldr r0, [pc, #64] @ (8004d4c ) + 8004d0a: f7fc ff2e bl 8001b6a + + /* Initialize the DP83848 ETH PHY */ + DP83848_Init(&DP83848); + 8004d0e: 480f ldr r0, [pc, #60] @ (8004d4c ) + 8004d10: f7fc ff5d bl 8001bce + + if (hal_eth_init_status == HAL_OK) + 8004d14: 7bfb ldrb r3, [r7, #15] + 8004d16: 2b00 cmp r3, #0 + 8004d18: d103 bne.n 8004d22 + { + /* Get link state */ + ethernet_link_check_state(netif); + 8004d1a: 6878 ldr r0, [r7, #4] + 8004d1c: f000 fa38 bl 8005190 +#endif /* LWIP_ARP || LWIP_ETHERNET */ + +/* USER CODE BEGIN LOW_LEVEL_INIT */ + +/* USER CODE END LOW_LEVEL_INIT */ +} + 8004d20: e001 b.n 8004d26 + Error_Handler(); + 8004d22: f7fc fd6a bl 80017fa +} + 8004d26: bf00 nop + 8004d28: 3710 adds r7, #16 + 8004d2a: 46bd mov sp, r7 + 8004d2c: bd80 pop {r7, pc} + 8004d2e: bf00 nop + 8004d30: 20006044 .word 0x20006044 + 8004d34: 40028000 .word 0x40028000 + 8004d38: 20005fa4 .word 0x20005fa4 + 8004d3c: 20005f04 .word 0x20005f04 + 8004d40: 200060f4 .word 0x200060f4 + 8004d44: 08018de8 .word 0x08018de8 + 8004d48: 2000000c .word 0x2000000c + 8004d4c: 2000612c .word 0x2000612c + +08004d50 : + * to become available since the stack doesn't retry to send a packet + * dropped because of memory failure (except for the TCP timers). + */ + +static err_t low_level_output(struct netif *netif, struct pbuf *p) +{ + 8004d50: b580 push {r7, lr} + 8004d52: b092 sub sp, #72 @ 0x48 + 8004d54: af00 add r7, sp, #0 + 8004d56: 6078 str r0, [r7, #4] + 8004d58: 6039 str r1, [r7, #0] + uint32_t i = 0U; + 8004d5a: 2300 movs r3, #0 + 8004d5c: 647b str r3, [r7, #68] @ 0x44 + struct pbuf *q = NULL; + 8004d5e: 2300 movs r3, #0 + 8004d60: 643b str r3, [r7, #64] @ 0x40 + err_t errval = ERR_OK; + 8004d62: 2300 movs r3, #0 + 8004d64: f887 303f strb.w r3, [r7, #63] @ 0x3f + ETH_BufferTypeDef Txbuffer[ETH_TX_DESC_CNT] = {0}; + 8004d68: f107 030c add.w r3, r7, #12 + 8004d6c: 2230 movs r2, #48 @ 0x30 + 8004d6e: 2100 movs r1, #0 + 8004d70: 4618 mov r0, r3 + 8004d72: f00c fcc0 bl 80116f6 + + memset(Txbuffer, 0 , ETH_TX_DESC_CNT*sizeof(ETH_BufferTypeDef)); + 8004d76: f107 030c add.w r3, r7, #12 + 8004d7a: 2230 movs r2, #48 @ 0x30 + 8004d7c: 2100 movs r1, #0 + 8004d7e: 4618 mov r0, r3 + 8004d80: f00c fcb9 bl 80116f6 + + for(q = p; q != NULL; q = q->next) + 8004d84: 683b ldr r3, [r7, #0] + 8004d86: 643b str r3, [r7, #64] @ 0x40 + 8004d88: e045 b.n 8004e16 + { + if(i >= ETH_TX_DESC_CNT) + 8004d8a: 6c7b ldr r3, [r7, #68] @ 0x44 + 8004d8c: 2b03 cmp r3, #3 + 8004d8e: d902 bls.n 8004d96 + return ERR_IF; + 8004d90: f06f 030b mvn.w r3, #11 + 8004d94: e055 b.n 8004e42 + + Txbuffer[i].buffer = q->payload; + 8004d96: 6c3b ldr r3, [r7, #64] @ 0x40 + 8004d98: 6859 ldr r1, [r3, #4] + 8004d9a: 6c7a ldr r2, [r7, #68] @ 0x44 + 8004d9c: 4613 mov r3, r2 + 8004d9e: 005b lsls r3, r3, #1 + 8004da0: 4413 add r3, r2 + 8004da2: 009b lsls r3, r3, #2 + 8004da4: 3348 adds r3, #72 @ 0x48 + 8004da6: 443b add r3, r7 + 8004da8: 3b3c subs r3, #60 @ 0x3c + 8004daa: 6019 str r1, [r3, #0] + Txbuffer[i].len = q->len; + 8004dac: 6c3b ldr r3, [r7, #64] @ 0x40 + 8004dae: 895b ldrh r3, [r3, #10] + 8004db0: 4619 mov r1, r3 + 8004db2: 6c7a ldr r2, [r7, #68] @ 0x44 + 8004db4: 4613 mov r3, r2 + 8004db6: 005b lsls r3, r3, #1 + 8004db8: 4413 add r3, r2 + 8004dba: 009b lsls r3, r3, #2 + 8004dbc: 3348 adds r3, #72 @ 0x48 + 8004dbe: 443b add r3, r7 + 8004dc0: 3b38 subs r3, #56 @ 0x38 + 8004dc2: 6019 str r1, [r3, #0] + + if(i>0) + 8004dc4: 6c7b ldr r3, [r7, #68] @ 0x44 + 8004dc6: 2b00 cmp r3, #0 + 8004dc8: d011 beq.n 8004dee + { + Txbuffer[i-1].next = &Txbuffer[i]; + 8004dca: 6c7b ldr r3, [r7, #68] @ 0x44 + 8004dcc: 1e5a subs r2, r3, #1 + 8004dce: f107 000c add.w r0, r7, #12 + 8004dd2: 6c79 ldr r1, [r7, #68] @ 0x44 + 8004dd4: 460b mov r3, r1 + 8004dd6: 005b lsls r3, r3, #1 + 8004dd8: 440b add r3, r1 + 8004dda: 009b lsls r3, r3, #2 + 8004ddc: 18c1 adds r1, r0, r3 + 8004dde: 4613 mov r3, r2 + 8004de0: 005b lsls r3, r3, #1 + 8004de2: 4413 add r3, r2 + 8004de4: 009b lsls r3, r3, #2 + 8004de6: 3348 adds r3, #72 @ 0x48 + 8004de8: 443b add r3, r7 + 8004dea: 3b34 subs r3, #52 @ 0x34 + 8004dec: 6019 str r1, [r3, #0] + } + + if(q->next == NULL) + 8004dee: 6c3b ldr r3, [r7, #64] @ 0x40 + 8004df0: 681b ldr r3, [r3, #0] + 8004df2: 2b00 cmp r3, #0 + 8004df4: d109 bne.n 8004e0a + { + Txbuffer[i].next = NULL; + 8004df6: 6c7a ldr r2, [r7, #68] @ 0x44 + 8004df8: 4613 mov r3, r2 + 8004dfa: 005b lsls r3, r3, #1 + 8004dfc: 4413 add r3, r2 + 8004dfe: 009b lsls r3, r3, #2 + 8004e00: 3348 adds r3, #72 @ 0x48 + 8004e02: 443b add r3, r7 + 8004e04: 3b34 subs r3, #52 @ 0x34 + 8004e06: 2200 movs r2, #0 + 8004e08: 601a str r2, [r3, #0] + } + + i++; + 8004e0a: 6c7b ldr r3, [r7, #68] @ 0x44 + 8004e0c: 3301 adds r3, #1 + 8004e0e: 647b str r3, [r7, #68] @ 0x44 + for(q = p; q != NULL; q = q->next) + 8004e10: 6c3b ldr r3, [r7, #64] @ 0x40 + 8004e12: 681b ldr r3, [r3, #0] + 8004e14: 643b str r3, [r7, #64] @ 0x40 + 8004e16: 6c3b ldr r3, [r7, #64] @ 0x40 + 8004e18: 2b00 cmp r3, #0 + 8004e1a: d1b6 bne.n 8004d8a + } + + TxConfig.Length = p->tot_len; + 8004e1c: 683b ldr r3, [r7, #0] + 8004e1e: 891b ldrh r3, [r3, #8] + 8004e20: 461a mov r2, r3 + 8004e22: 4b0a ldr r3, [pc, #40] @ (8004e4c ) + 8004e24: 605a str r2, [r3, #4] + TxConfig.TxBuffer = Txbuffer; + 8004e26: 4a09 ldr r2, [pc, #36] @ (8004e4c ) + 8004e28: f107 030c add.w r3, r7, #12 + 8004e2c: 6093 str r3, [r2, #8] + TxConfig.pData = p; + 8004e2e: 4a07 ldr r2, [pc, #28] @ (8004e4c ) + 8004e30: 683b ldr r3, [r7, #0] + 8004e32: 6353 str r3, [r2, #52] @ 0x34 + + HAL_ETH_Transmit(&heth, &TxConfig, ETH_DMA_TRANSMIT_TIMEOUT); + 8004e34: 2214 movs r2, #20 + 8004e36: 4905 ldr r1, [pc, #20] @ (8004e4c ) + 8004e38: 4805 ldr r0, [pc, #20] @ (8004e50 ) + 8004e3a: f7fd fad5 bl 80023e8 + + return errval; + 8004e3e: f997 303f ldrsb.w r3, [r7, #63] @ 0x3f +} + 8004e42: 4618 mov r0, r3 + 8004e44: 3748 adds r7, #72 @ 0x48 + 8004e46: 46bd mov sp, r7 + 8004e48: bd80 pop {r7, pc} + 8004e4a: bf00 nop + 8004e4c: 200060f4 .word 0x200060f4 + 8004e50: 20006044 .word 0x20006044 + +08004e54 : + * @param netif the lwip network interface structure for this ethernetif + * @return a pbuf filled with the received packet (including MAC header) + * NULL on memory error + */ +static struct pbuf * low_level_input(struct netif *netif) +{ + 8004e54: b580 push {r7, lr} + 8004e56: b084 sub sp, #16 + 8004e58: af00 add r7, sp, #0 + 8004e5a: 6078 str r0, [r7, #4] + struct pbuf *p = NULL; + 8004e5c: 2300 movs r3, #0 + 8004e5e: 60fb str r3, [r7, #12] + + if(RxAllocStatus == RX_ALLOC_OK) + 8004e60: 4b07 ldr r3, [pc, #28] @ (8004e80 ) + 8004e62: 781b ldrb r3, [r3, #0] + 8004e64: 2b00 cmp r3, #0 + 8004e66: d105 bne.n 8004e74 + { + HAL_ETH_ReadData(&heth, (void **)&p); + 8004e68: f107 030c add.w r3, r7, #12 + 8004e6c: 4619 mov r1, r3 + 8004e6e: 4805 ldr r0, [pc, #20] @ (8004e84 ) + 8004e70: f7fd fb4e bl 8002510 + } + + return p; + 8004e74: 68fb ldr r3, [r7, #12] +} + 8004e76: 4618 mov r0, r3 + 8004e78: 3710 adds r7, #16 + 8004e7a: 46bd mov sp, r7 + 8004e7c: bd80 pop {r7, pc} + 8004e7e: bf00 nop + 8004e80: 20005f00 .word 0x20005f00 + 8004e84: 20006044 .word 0x20006044 + +08004e88 : + * the appropriate input function is called. + * + * @param netif the lwip network interface structure for this ethernetif + */ +void ethernetif_input(struct netif *netif) +{ + 8004e88: b580 push {r7, lr} + 8004e8a: b084 sub sp, #16 + 8004e8c: af00 add r7, sp, #0 + 8004e8e: 6078 str r0, [r7, #4] + struct pbuf *p = NULL; + 8004e90: 2300 movs r3, #0 + 8004e92: 60fb str r3, [r7, #12] + + do + { + p = low_level_input( netif ); + 8004e94: 6878 ldr r0, [r7, #4] + 8004e96: f7ff ffdd bl 8004e54 + 8004e9a: 60f8 str r0, [r7, #12] + if (p != NULL) + 8004e9c: 68fb ldr r3, [r7, #12] + 8004e9e: 2b00 cmp r3, #0 + 8004ea0: d00a beq.n 8004eb8 + { + if (netif->input( p, netif) != ERR_OK ) + 8004ea2: 687b ldr r3, [r7, #4] + 8004ea4: 691b ldr r3, [r3, #16] + 8004ea6: 6879 ldr r1, [r7, #4] + 8004ea8: 68f8 ldr r0, [r7, #12] + 8004eaa: 4798 blx r3 + 8004eac: 4603 mov r3, r0 + 8004eae: 2b00 cmp r3, #0 + 8004eb0: d002 beq.n 8004eb8 + { + pbuf_free(p); + 8004eb2: 68f8 ldr r0, [r7, #12] + 8004eb4: f001 fdb8 bl 8006a28 + } + } + } while(p!=NULL); + 8004eb8: 68fb ldr r3, [r7, #12] + 8004eba: 2b00 cmp r3, #0 + 8004ebc: d1ea bne.n 8004e94 +} + 8004ebe: bf00 nop + 8004ec0: bf00 nop + 8004ec2: 3710 adds r7, #16 + 8004ec4: 46bd mov sp, r7 + 8004ec6: bd80 pop {r7, pc} + +08004ec8 : + * @return ERR_OK if the loopif is initialized + * ERR_MEM if private data couldn't be allocated + * any other err_t on error + */ +err_t ethernetif_init(struct netif *netif) +{ + 8004ec8: b580 push {r7, lr} + 8004eca: b082 sub sp, #8 + 8004ecc: af00 add r7, sp, #0 + 8004ece: 6078 str r0, [r7, #4] + LWIP_ASSERT("netif != NULL", (netif != NULL)); + 8004ed0: 687b ldr r3, [r7, #4] + 8004ed2: 2b00 cmp r3, #0 + 8004ed4: d106 bne.n 8004ee4 + 8004ed6: 4b0e ldr r3, [pc, #56] @ (8004f10 ) + 8004ed8: f240 126b movw r2, #363 @ 0x16b + 8004edc: 490d ldr r1, [pc, #52] @ (8004f14 ) + 8004ede: 480e ldr r0, [pc, #56] @ (8004f18 ) + 8004ee0: f00c fb8a bl 80115f8 + * The last argument should be replaced with your link speed, in units + * of bits per second. + */ + // MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, LINK_SPEED_OF_YOUR_NETIF_IN_BPS); + + netif->name[0] = IFNAME0; + 8004ee4: 687b ldr r3, [r7, #4] + 8004ee6: 2273 movs r2, #115 @ 0x73 + 8004ee8: f883 2032 strb.w r2, [r3, #50] @ 0x32 + netif->name[1] = IFNAME1; + 8004eec: 687b ldr r3, [r7, #4] + 8004eee: 2274 movs r2, #116 @ 0x74 + 8004ef0: f883 2033 strb.w r2, [r3, #51] @ 0x33 + * is available...) */ + +#if LWIP_IPV4 +#if LWIP_ARP || LWIP_ETHERNET +#if LWIP_ARP + netif->output = etharp_output; + 8004ef4: 687b ldr r3, [r7, #4] + 8004ef6: 4a09 ldr r2, [pc, #36] @ (8004f1c ) + 8004ef8: 615a str r2, [r3, #20] + +#if LWIP_IPV6 + netif->output_ip6 = ethip6_output; +#endif /* LWIP_IPV6 */ + + netif->linkoutput = low_level_output; + 8004efa: 687b ldr r3, [r7, #4] + 8004efc: 4a08 ldr r2, [pc, #32] @ (8004f20 ) + 8004efe: 619a str r2, [r3, #24] + + /* initialize the hardware */ + low_level_init(netif); + 8004f00: 6878 ldr r0, [r7, #4] + 8004f02: f7ff fe8d bl 8004c20 + + return ERR_OK; + 8004f06: 2300 movs r3, #0 +} + 8004f08: 4618 mov r0, r3 + 8004f0a: 3708 adds r7, #8 + 8004f0c: 46bd mov sp, r7 + 8004f0e: bd80 pop {r7, pc} + 8004f10: 08015fe8 .word 0x08015fe8 + 8004f14: 08016004 .word 0x08016004 + 8004f18: 08016014 .word 0x08016014 + 8004f1c: 0800f491 .word 0x0800f491 + 8004f20: 08004d51 .word 0x08004d51 + +08004f24 : + * @brief Custom Rx pbuf free callback + * @param pbuf: pbuf to be freed + * @retval None + */ +void pbuf_free_custom(struct pbuf *p) +{ + 8004f24: b580 push {r7, lr} + 8004f26: b084 sub sp, #16 + 8004f28: af00 add r7, sp, #0 + 8004f2a: 6078 str r0, [r7, #4] + struct pbuf_custom* custom_pbuf = (struct pbuf_custom*)p; + 8004f2c: 687b ldr r3, [r7, #4] + 8004f2e: 60fb str r3, [r7, #12] + LWIP_MEMPOOL_FREE(RX_POOL, custom_pbuf); + 8004f30: 68f9 ldr r1, [r7, #12] + 8004f32: 4807 ldr r0, [pc, #28] @ (8004f50 ) + 8004f34: f000 fed4 bl 8005ce0 + + /* If the Rx Buffer Pool was exhausted, signal the ethernetif_input task to + * call HAL_ETH_GetRxDataBuffer to rebuild the Rx descriptors. */ + + if (RxAllocStatus == RX_ALLOC_ERROR) + 8004f38: 4b06 ldr r3, [pc, #24] @ (8004f54 ) + 8004f3a: 781b ldrb r3, [r3, #0] + 8004f3c: 2b01 cmp r3, #1 + 8004f3e: d102 bne.n 8004f46 + { + RxAllocStatus = RX_ALLOC_OK; + 8004f40: 4b04 ldr r3, [pc, #16] @ (8004f54 ) + 8004f42: 2200 movs r2, #0 + 8004f44: 701a strb r2, [r3, #0] + } +} + 8004f46: bf00 nop + 8004f48: 3710 adds r7, #16 + 8004f4a: 46bd mov sp, r7 + 8004f4c: bd80 pop {r7, pc} + 8004f4e: bf00 nop + 8004f50: 08018de8 .word 0x08018de8 + 8004f54: 20005f00 .word 0x20005f00 + +08004f58 : +* when LWIP_TIMERS == 1 and NO_SYS == 1 +* @param None +* @retval Current Time value +*/ +u32_t sys_now(void) +{ + 8004f58: b580 push {r7, lr} + 8004f5a: af00 add r7, sp, #0 + return HAL_GetTick(); + 8004f5c: f7fc ffcc bl 8001ef8 + 8004f60: 4603 mov r3, r0 +} + 8004f62: 4618 mov r0, r3 + 8004f64: bd80 pop {r7, pc} + ... + +08004f68 : + * @param ethHandle: ETH handle + * @retval None + */ + +void HAL_ETH_MspInit(ETH_HandleTypeDef* ethHandle) +{ + 8004f68: b580 push {r7, lr} + 8004f6a: b08e sub sp, #56 @ 0x38 + 8004f6c: af00 add r7, sp, #0 + 8004f6e: 6078 str r0, [r7, #4] + GPIO_InitTypeDef GPIO_InitStruct = {0}; + 8004f70: f107 0324 add.w r3, r7, #36 @ 0x24 + 8004f74: 2200 movs r2, #0 + 8004f76: 601a str r2, [r3, #0] + 8004f78: 605a str r2, [r3, #4] + 8004f7a: 609a str r2, [r3, #8] + 8004f7c: 60da str r2, [r3, #12] + 8004f7e: 611a str r2, [r3, #16] + if(ethHandle->Instance==ETH) + 8004f80: 687b ldr r3, [r7, #4] + 8004f82: 681b ldr r3, [r3, #0] + 8004f84: 4a55 ldr r2, [pc, #340] @ (80050dc ) + 8004f86: 4293 cmp r3, r2 + 8004f88: f040 80a4 bne.w 80050d4 + { + /* USER CODE BEGIN ETH_MspInit 0 */ + + /* USER CODE END ETH_MspInit 0 */ + /* Enable Peripheral clock */ + __HAL_RCC_ETH_CLK_ENABLE(); + 8004f8c: 2300 movs r3, #0 + 8004f8e: 623b str r3, [r7, #32] + 8004f90: 4b53 ldr r3, [pc, #332] @ (80050e0 ) + 8004f92: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004f94: 4a52 ldr r2, [pc, #328] @ (80050e0 ) + 8004f96: f043 7300 orr.w r3, r3, #33554432 @ 0x2000000 + 8004f9a: 6313 str r3, [r2, #48] @ 0x30 + 8004f9c: 4b50 ldr r3, [pc, #320] @ (80050e0 ) + 8004f9e: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004fa0: f003 7300 and.w r3, r3, #33554432 @ 0x2000000 + 8004fa4: 623b str r3, [r7, #32] + 8004fa6: 6a3b ldr r3, [r7, #32] + 8004fa8: 2300 movs r3, #0 + 8004faa: 61fb str r3, [r7, #28] + 8004fac: 4b4c ldr r3, [pc, #304] @ (80050e0 ) + 8004fae: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004fb0: 4a4b ldr r2, [pc, #300] @ (80050e0 ) + 8004fb2: f043 6380 orr.w r3, r3, #67108864 @ 0x4000000 + 8004fb6: 6313 str r3, [r2, #48] @ 0x30 + 8004fb8: 4b49 ldr r3, [pc, #292] @ (80050e0 ) + 8004fba: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004fbc: f003 6380 and.w r3, r3, #67108864 @ 0x4000000 + 8004fc0: 61fb str r3, [r7, #28] + 8004fc2: 69fb ldr r3, [r7, #28] + 8004fc4: 2300 movs r3, #0 + 8004fc6: 61bb str r3, [r7, #24] + 8004fc8: 4b45 ldr r3, [pc, #276] @ (80050e0 ) + 8004fca: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004fcc: 4a44 ldr r2, [pc, #272] @ (80050e0 ) + 8004fce: f043 6300 orr.w r3, r3, #134217728 @ 0x8000000 + 8004fd2: 6313 str r3, [r2, #48] @ 0x30 + 8004fd4: 4b42 ldr r3, [pc, #264] @ (80050e0 ) + 8004fd6: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004fd8: f003 6300 and.w r3, r3, #134217728 @ 0x8000000 + 8004fdc: 61bb str r3, [r7, #24] + 8004fde: 69bb ldr r3, [r7, #24] + + __HAL_RCC_GPIOC_CLK_ENABLE(); + 8004fe0: 2300 movs r3, #0 + 8004fe2: 617b str r3, [r7, #20] + 8004fe4: 4b3e ldr r3, [pc, #248] @ (80050e0 ) + 8004fe6: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004fe8: 4a3d ldr r2, [pc, #244] @ (80050e0 ) + 8004fea: f043 0304 orr.w r3, r3, #4 + 8004fee: 6313 str r3, [r2, #48] @ 0x30 + 8004ff0: 4b3b ldr r3, [pc, #236] @ (80050e0 ) + 8004ff2: 6b1b ldr r3, [r3, #48] @ 0x30 + 8004ff4: f003 0304 and.w r3, r3, #4 + 8004ff8: 617b str r3, [r7, #20] + 8004ffa: 697b ldr r3, [r7, #20] + __HAL_RCC_GPIOA_CLK_ENABLE(); + 8004ffc: 2300 movs r3, #0 + 8004ffe: 613b str r3, [r7, #16] + 8005000: 4b37 ldr r3, [pc, #220] @ (80050e0 ) + 8005002: 6b1b ldr r3, [r3, #48] @ 0x30 + 8005004: 4a36 ldr r2, [pc, #216] @ (80050e0 ) + 8005006: f043 0301 orr.w r3, r3, #1 + 800500a: 6313 str r3, [r2, #48] @ 0x30 + 800500c: 4b34 ldr r3, [pc, #208] @ (80050e0 ) + 800500e: 6b1b ldr r3, [r3, #48] @ 0x30 + 8005010: f003 0301 and.w r3, r3, #1 + 8005014: 613b str r3, [r7, #16] + 8005016: 693b ldr r3, [r7, #16] + __HAL_RCC_GPIOB_CLK_ENABLE(); + 8005018: 2300 movs r3, #0 + 800501a: 60fb str r3, [r7, #12] + 800501c: 4b30 ldr r3, [pc, #192] @ (80050e0 ) + 800501e: 6b1b ldr r3, [r3, #48] @ 0x30 + 8005020: 4a2f ldr r2, [pc, #188] @ (80050e0 ) + 8005022: f043 0302 orr.w r3, r3, #2 + 8005026: 6313 str r3, [r2, #48] @ 0x30 + 8005028: 4b2d ldr r3, [pc, #180] @ (80050e0 ) + 800502a: 6b1b ldr r3, [r3, #48] @ 0x30 + 800502c: f003 0302 and.w r3, r3, #2 + 8005030: 60fb str r3, [r7, #12] + 8005032: 68fb ldr r3, [r7, #12] + __HAL_RCC_GPIOG_CLK_ENABLE(); + 8005034: 2300 movs r3, #0 + 8005036: 60bb str r3, [r7, #8] + 8005038: 4b29 ldr r3, [pc, #164] @ (80050e0 ) + 800503a: 6b1b ldr r3, [r3, #48] @ 0x30 + 800503c: 4a28 ldr r2, [pc, #160] @ (80050e0 ) + 800503e: f043 0340 orr.w r3, r3, #64 @ 0x40 + 8005042: 6313 str r3, [r2, #48] @ 0x30 + 8005044: 4b26 ldr r3, [pc, #152] @ (80050e0 ) + 8005046: 6b1b ldr r3, [r3, #48] @ 0x30 + 8005048: f003 0340 and.w r3, r3, #64 @ 0x40 + 800504c: 60bb str r3, [r7, #8] + 800504e: 68bb ldr r3, [r7, #8] + PC5 ------> ETH_RXD1 + PB11 ------> ETH_TX_EN + PB12 ------> ETH_TXD0 + PG14 ------> ETH_TXD1 + */ + GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5; + 8005050: 2332 movs r3, #50 @ 0x32 + 8005052: 627b str r3, [r7, #36] @ 0x24 + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 8005054: 2302 movs r3, #2 + 8005056: 62bb str r3, [r7, #40] @ 0x28 + GPIO_InitStruct.Pull = GPIO_NOPULL; + 8005058: 2300 movs r3, #0 + 800505a: 62fb str r3, [r7, #44] @ 0x2c + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 800505c: 2303 movs r3, #3 + 800505e: 633b str r3, [r7, #48] @ 0x30 + GPIO_InitStruct.Alternate = GPIO_AF11_ETH; + 8005060: 230b movs r3, #11 + 8005062: 637b str r3, [r7, #52] @ 0x34 + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + 8005064: f107 0324 add.w r3, r7, #36 @ 0x24 + 8005068: 4619 mov r1, r3 + 800506a: 481e ldr r0, [pc, #120] @ (80050e4 ) + 800506c: f7fe f97c bl 8003368 + + GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7; + 8005070: 2386 movs r3, #134 @ 0x86 + 8005072: 627b str r3, [r7, #36] @ 0x24 + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 8005074: 2302 movs r3, #2 + 8005076: 62bb str r3, [r7, #40] @ 0x28 + GPIO_InitStruct.Pull = GPIO_NOPULL; + 8005078: 2300 movs r3, #0 + 800507a: 62fb str r3, [r7, #44] @ 0x2c + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 800507c: 2303 movs r3, #3 + 800507e: 633b str r3, [r7, #48] @ 0x30 + GPIO_InitStruct.Alternate = GPIO_AF11_ETH; + 8005080: 230b movs r3, #11 + 8005082: 637b str r3, [r7, #52] @ 0x34 + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + 8005084: f107 0324 add.w r3, r7, #36 @ 0x24 + 8005088: 4619 mov r1, r3 + 800508a: 4817 ldr r0, [pc, #92] @ (80050e8 ) + 800508c: f7fe f96c bl 8003368 + + GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; + 8005090: f44f 53c0 mov.w r3, #6144 @ 0x1800 + 8005094: 627b str r3, [r7, #36] @ 0x24 + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 8005096: 2302 movs r3, #2 + 8005098: 62bb str r3, [r7, #40] @ 0x28 + GPIO_InitStruct.Pull = GPIO_NOPULL; + 800509a: 2300 movs r3, #0 + 800509c: 62fb str r3, [r7, #44] @ 0x2c + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 800509e: 2303 movs r3, #3 + 80050a0: 633b str r3, [r7, #48] @ 0x30 + GPIO_InitStruct.Alternate = GPIO_AF11_ETH; + 80050a2: 230b movs r3, #11 + 80050a4: 637b str r3, [r7, #52] @ 0x34 + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + 80050a6: f107 0324 add.w r3, r7, #36 @ 0x24 + 80050aa: 4619 mov r1, r3 + 80050ac: 480f ldr r0, [pc, #60] @ (80050ec ) + 80050ae: f7fe f95b bl 8003368 + + GPIO_InitStruct.Pin = GPIO_PIN_14; + 80050b2: f44f 4380 mov.w r3, #16384 @ 0x4000 + 80050b6: 627b str r3, [r7, #36] @ 0x24 + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + 80050b8: 2302 movs r3, #2 + 80050ba: 62bb str r3, [r7, #40] @ 0x28 + GPIO_InitStruct.Pull = GPIO_NOPULL; + 80050bc: 2300 movs r3, #0 + 80050be: 62fb str r3, [r7, #44] @ 0x2c + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + 80050c0: 2303 movs r3, #3 + 80050c2: 633b str r3, [r7, #48] @ 0x30 + GPIO_InitStruct.Alternate = GPIO_AF11_ETH; + 80050c4: 230b movs r3, #11 + 80050c6: 637b str r3, [r7, #52] @ 0x34 + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); + 80050c8: f107 0324 add.w r3, r7, #36 @ 0x24 + 80050cc: 4619 mov r1, r3 + 80050ce: 4808 ldr r0, [pc, #32] @ (80050f0 ) + 80050d0: f7fe f94a bl 8003368 + + /* USER CODE BEGIN ETH_MspInit 1 */ + + /* USER CODE END ETH_MspInit 1 */ + } +} + 80050d4: bf00 nop + 80050d6: 3738 adds r7, #56 @ 0x38 + 80050d8: 46bd mov sp, r7 + 80050da: bd80 pop {r7, pc} + 80050dc: 40028000 .word 0x40028000 + 80050e0: 40023800 .word 0x40023800 + 80050e4: 40020800 .word 0x40020800 + 80050e8: 40020000 .word 0x40020000 + 80050ec: 40020400 .word 0x40020400 + 80050f0: 40021800 .word 0x40021800 + +080050f4 : + * @brief Initializes the MDIO interface GPIO and clocks. + * @param None + * @retval 0 if OK, -1 if ERROR + */ +int32_t ETH_PHY_IO_Init(void) +{ + 80050f4: b580 push {r7, lr} + 80050f6: af00 add r7, sp, #0 + /* We assume that MDIO GPIO configuration is already done + in the ETH_MspInit() else it should be done here + */ + + /* Configure the MDIO Clock */ + HAL_ETH_SetMDIOClockRange(&heth); + 80050f8: 4802 ldr r0, [pc, #8] @ (8005104 ) + 80050fa: f7fd fcd9 bl 8002ab0 + + return 0; + 80050fe: 2300 movs r3, #0 +} + 8005100: 4618 mov r0, r3 + 8005102: bd80 pop {r7, pc} + 8005104: 20006044 .word 0x20006044 + +08005108 : + * @brief De-Initializes the MDIO interface . + * @param None + * @retval 0 if OK, -1 if ERROR + */ +int32_t ETH_PHY_IO_DeInit (void) +{ + 8005108: b480 push {r7} + 800510a: af00 add r7, sp, #0 + return 0; + 800510c: 2300 movs r3, #0 +} + 800510e: 4618 mov r0, r3 + 8005110: 46bd mov sp, r7 + 8005112: f85d 7b04 ldr.w r7, [sp], #4 + 8005116: 4770 bx lr + +08005118 : + * @param RegAddr: PHY register address + * @param pRegVal: pointer to hold the register value + * @retval 0 if OK -1 if Error + */ +int32_t ETH_PHY_IO_ReadReg(uint32_t DevAddr, uint32_t RegAddr, uint32_t *pRegVal) +{ + 8005118: b580 push {r7, lr} + 800511a: b084 sub sp, #16 + 800511c: af00 add r7, sp, #0 + 800511e: 60f8 str r0, [r7, #12] + 8005120: 60b9 str r1, [r7, #8] + 8005122: 607a str r2, [r7, #4] + if(HAL_ETH_ReadPHYRegister(&heth, DevAddr, RegAddr, pRegVal) != HAL_OK) + 8005124: 687b ldr r3, [r7, #4] + 8005126: 68ba ldr r2, [r7, #8] + 8005128: 68f9 ldr r1, [r7, #12] + 800512a: 4807 ldr r0, [pc, #28] @ (8005148 ) + 800512c: f7fd fb28 bl 8002780 + 8005130: 4603 mov r3, r0 + 8005132: 2b00 cmp r3, #0 + 8005134: d002 beq.n 800513c + { + return -1; + 8005136: f04f 33ff mov.w r3, #4294967295 + 800513a: e000 b.n 800513e + } + + return 0; + 800513c: 2300 movs r3, #0 +} + 800513e: 4618 mov r0, r3 + 8005140: 3710 adds r7, #16 + 8005142: 46bd mov sp, r7 + 8005144: bd80 pop {r7, pc} + 8005146: bf00 nop + 8005148: 20006044 .word 0x20006044 + +0800514c : + * @param RegAddr: PHY register address + * @param RegVal: Value to be written + * @retval 0 if OK -1 if Error + */ +int32_t ETH_PHY_IO_WriteReg(uint32_t DevAddr, uint32_t RegAddr, uint32_t RegVal) +{ + 800514c: b580 push {r7, lr} + 800514e: b084 sub sp, #16 + 8005150: af00 add r7, sp, #0 + 8005152: 60f8 str r0, [r7, #12] + 8005154: 60b9 str r1, [r7, #8] + 8005156: 607a str r2, [r7, #4] + if(HAL_ETH_WritePHYRegister(&heth, DevAddr, RegAddr, RegVal) != HAL_OK) + 8005158: 687b ldr r3, [r7, #4] + 800515a: 68ba ldr r2, [r7, #8] + 800515c: 68f9 ldr r1, [r7, #12] + 800515e: 4807 ldr r0, [pc, #28] @ (800517c ) + 8005160: f7fd fb59 bl 8002816 + 8005164: 4603 mov r3, r0 + 8005166: 2b00 cmp r3, #0 + 8005168: d002 beq.n 8005170 + { + return -1; + 800516a: f04f 33ff mov.w r3, #4294967295 + 800516e: e000 b.n 8005172 + } + + return 0; + 8005170: 2300 movs r3, #0 +} + 8005172: 4618 mov r0, r3 + 8005174: 3710 adds r7, #16 + 8005176: 46bd mov sp, r7 + 8005178: bd80 pop {r7, pc} + 800517a: bf00 nop + 800517c: 20006044 .word 0x20006044 + +08005180 : +/** + * @brief Get the time in millisecons used for internal PHY driver process. + * @retval Time value + */ +int32_t ETH_PHY_IO_GetTick(void) +{ + 8005180: b580 push {r7, lr} + 8005182: af00 add r7, sp, #0 + return HAL_GetTick(); + 8005184: f7fc feb8 bl 8001ef8 + 8005188: 4603 mov r3, r0 +} + 800518a: 4618 mov r0, r3 + 800518c: bd80 pop {r7, pc} + ... + +08005190 : +/** + * @brief Check the ETH link state then update ETH driver and netif link accordingly. + * @retval None + */ +void ethernet_link_check_state(struct netif *netif) +{ + 8005190: b580 push {r7, lr} + 8005192: b0a0 sub sp, #128 @ 0x80 + 8005194: af00 add r7, sp, #0 + 8005196: 6078 str r0, [r7, #4] + ETH_MACConfigTypeDef MACConf = {0}; + 8005198: f107 030c add.w r3, r7, #12 + 800519c: 2264 movs r2, #100 @ 0x64 + 800519e: 2100 movs r1, #0 + 80051a0: 4618 mov r0, r3 + 80051a2: f00c faa8 bl 80116f6 + int32_t PHYLinkState = 0; + 80051a6: 2300 movs r3, #0 + 80051a8: 673b str r3, [r7, #112] @ 0x70 + uint32_t linkchanged = 0U, speed = 0U, duplex = 0U; + 80051aa: 2300 movs r3, #0 + 80051ac: 67fb str r3, [r7, #124] @ 0x7c + 80051ae: 2300 movs r3, #0 + 80051b0: 67bb str r3, [r7, #120] @ 0x78 + 80051b2: 2300 movs r3, #0 + 80051b4: 677b str r3, [r7, #116] @ 0x74 + + PHYLinkState = DP83848_GetLinkState(&DP83848); + 80051b6: 483a ldr r0, [pc, #232] @ (80052a0 ) + 80051b8: f7fc fdb1 bl 8001d1e + 80051bc: 6738 str r0, [r7, #112] @ 0x70 + + if(netif_is_link_up(netif) && (PHYLinkState <= DP83848_STATUS_LINK_DOWN)) + 80051be: 687b ldr r3, [r7, #4] + 80051c0: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 80051c4: 089b lsrs r3, r3, #2 + 80051c6: f003 0301 and.w r3, r3, #1 + 80051ca: b2db uxtb r3, r3 + 80051cc: 2b00 cmp r3, #0 + 80051ce: d00c beq.n 80051ea + 80051d0: 6f3b ldr r3, [r7, #112] @ 0x70 + 80051d2: 2b01 cmp r3, #1 + 80051d4: dc09 bgt.n 80051ea + { + HAL_ETH_Stop(&heth); + 80051d6: 4833 ldr r0, [pc, #204] @ (80052a4 ) + 80051d8: f7fd f8ad bl 8002336 + netif_set_down(netif); + 80051dc: 6878 ldr r0, [r7, #4] + 80051de: f001 f80b bl 80061f8 + netif_set_link_down(netif); + 80051e2: 6878 ldr r0, [r7, #4] + 80051e4: f001 f872 bl 80062cc + netif_set_up(netif); + netif_set_link_up(netif); + } + } + +} + 80051e8: e055 b.n 8005296 + else if(!netif_is_link_up(netif) && (PHYLinkState > DP83848_STATUS_LINK_DOWN)) + 80051ea: 687b ldr r3, [r7, #4] + 80051ec: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 80051f0: f003 0304 and.w r3, r3, #4 + 80051f4: 2b00 cmp r3, #0 + 80051f6: d14e bne.n 8005296 + 80051f8: 6f3b ldr r3, [r7, #112] @ 0x70 + 80051fa: 2b01 cmp r3, #1 + 80051fc: dd4b ble.n 8005296 + switch (PHYLinkState) + 80051fe: 6f3b ldr r3, [r7, #112] @ 0x70 + 8005200: 3b02 subs r3, #2 + 8005202: 2b03 cmp r3, #3 + 8005204: d82a bhi.n 800525c + 8005206: a201 add r2, pc, #4 @ (adr r2, 800520c ) + 8005208: f852 f023 ldr.w pc, [r2, r3, lsl #2] + 800520c: 0800521d .word 0x0800521d + 8005210: 0800522f .word 0x0800522f + 8005214: 0800523f .word 0x0800523f + 8005218: 0800524f .word 0x0800524f + duplex = ETH_FULLDUPLEX_MODE; + 800521c: f44f 6300 mov.w r3, #2048 @ 0x800 + 8005220: 677b str r3, [r7, #116] @ 0x74 + speed = ETH_SPEED_100M; + 8005222: f44f 4380 mov.w r3, #16384 @ 0x4000 + 8005226: 67bb str r3, [r7, #120] @ 0x78 + linkchanged = 1; + 8005228: 2301 movs r3, #1 + 800522a: 67fb str r3, [r7, #124] @ 0x7c + break; + 800522c: e017 b.n 800525e + duplex = ETH_HALFDUPLEX_MODE; + 800522e: 2300 movs r3, #0 + 8005230: 677b str r3, [r7, #116] @ 0x74 + speed = ETH_SPEED_100M; + 8005232: f44f 4380 mov.w r3, #16384 @ 0x4000 + 8005236: 67bb str r3, [r7, #120] @ 0x78 + linkchanged = 1; + 8005238: 2301 movs r3, #1 + 800523a: 67fb str r3, [r7, #124] @ 0x7c + break; + 800523c: e00f b.n 800525e + duplex = ETH_FULLDUPLEX_MODE; + 800523e: f44f 6300 mov.w r3, #2048 @ 0x800 + 8005242: 677b str r3, [r7, #116] @ 0x74 + speed = ETH_SPEED_10M; + 8005244: 2300 movs r3, #0 + 8005246: 67bb str r3, [r7, #120] @ 0x78 + linkchanged = 1; + 8005248: 2301 movs r3, #1 + 800524a: 67fb str r3, [r7, #124] @ 0x7c + break; + 800524c: e007 b.n 800525e + duplex = ETH_HALFDUPLEX_MODE; + 800524e: 2300 movs r3, #0 + 8005250: 677b str r3, [r7, #116] @ 0x74 + speed = ETH_SPEED_10M; + 8005252: 2300 movs r3, #0 + 8005254: 67bb str r3, [r7, #120] @ 0x78 + linkchanged = 1; + 8005256: 2301 movs r3, #1 + 8005258: 67fb str r3, [r7, #124] @ 0x7c + break; + 800525a: e000 b.n 800525e + break; + 800525c: bf00 nop + if(linkchanged) + 800525e: 6ffb ldr r3, [r7, #124] @ 0x7c + 8005260: 2b00 cmp r3, #0 + 8005262: d018 beq.n 8005296 + HAL_ETH_GetMACConfig(&heth, &MACConf); + 8005264: f107 030c add.w r3, r7, #12 + 8005268: 4619 mov r1, r3 + 800526a: 480e ldr r0, [pc, #56] @ (80052a4 ) + 800526c: f7fd fb1c bl 80028a8 + MACConf.DuplexMode = duplex; + 8005270: 6f7b ldr r3, [r7, #116] @ 0x74 + 8005272: 627b str r3, [r7, #36] @ 0x24 + MACConf.Speed = speed; + 8005274: 6fbb ldr r3, [r7, #120] @ 0x78 + 8005276: 623b str r3, [r7, #32] + HAL_ETH_SetMACConfig(&heth, &MACConf); + 8005278: f107 030c add.w r3, r7, #12 + 800527c: 4619 mov r1, r3 + 800527e: 4809 ldr r0, [pc, #36] @ (80052a4 ) + 8005280: f7fd fbfc bl 8002a7c + HAL_ETH_Start(&heth); + 8005284: 4807 ldr r0, [pc, #28] @ (80052a4 ) + 8005286: f7fc fff7 bl 8002278 + netif_set_up(netif); + 800528a: 6878 ldr r0, [r7, #4] + 800528c: f000 ff48 bl 8006120 + netif_set_link_up(netif); + 8005290: 6878 ldr r0, [r7, #4] + 8005292: f000 ffe3 bl 800625c +} + 8005296: bf00 nop + 8005298: 3780 adds r7, #128 @ 0x80 + 800529a: 46bd mov sp, r7 + 800529c: bd80 pop {r7, pc} + 800529e: bf00 nop + 80052a0: 2000612c .word 0x2000612c + 80052a4: 20006044 .word 0x20006044 + +080052a8 : + +void HAL_ETH_RxAllocateCallback(uint8_t **buff) +{ + 80052a8: b580 push {r7, lr} + 80052aa: b086 sub sp, #24 + 80052ac: af02 add r7, sp, #8 + 80052ae: 6078 str r0, [r7, #4] +/* USER CODE BEGIN HAL ETH RxAllocateCallback */ + struct pbuf_custom *p = LWIP_MEMPOOL_ALLOC(RX_POOL); + 80052b0: 4812 ldr r0, [pc, #72] @ (80052fc ) + 80052b2: f000 fca7 bl 8005c04 + 80052b6: 60f8 str r0, [r7, #12] + if (p) + 80052b8: 68fb ldr r3, [r7, #12] + 80052ba: 2b00 cmp r3, #0 + 80052bc: d014 beq.n 80052e8 + { + /* Get the buff from the struct pbuf address. */ + *buff = (uint8_t *)p + offsetof(RxBuff_t, buff); + 80052be: 68fb ldr r3, [r7, #12] + 80052c0: f103 0220 add.w r2, r3, #32 + 80052c4: 687b ldr r3, [r7, #4] + 80052c6: 601a str r2, [r3, #0] + p->custom_free_function = pbuf_free_custom; + 80052c8: 68fb ldr r3, [r7, #12] + 80052ca: 4a0d ldr r2, [pc, #52] @ (8005300 ) + 80052cc: 611a str r2, [r3, #16] + /* Initialize the struct pbuf. + * This must be performed whenever a buffer's allocated because it may be + * changed by lwIP or the app, e.g., pbuf_free decrements ref. */ + pbuf_alloced_custom(PBUF_RAW, 0, PBUF_REF, p, *buff, ETH_RX_BUFFER_SIZE); + 80052ce: 687b ldr r3, [r7, #4] + 80052d0: 681b ldr r3, [r3, #0] + 80052d2: f44f 62c0 mov.w r2, #1536 @ 0x600 + 80052d6: 9201 str r2, [sp, #4] + 80052d8: 9300 str r3, [sp, #0] + 80052da: 68fb ldr r3, [r7, #12] + 80052dc: 2241 movs r2, #65 @ 0x41 + 80052de: 2100 movs r1, #0 + 80052e0: 2000 movs r0, #0 + 80052e2: f001 f9e9 bl 80066b8 + { + RxAllocStatus = RX_ALLOC_ERROR; + *buff = NULL; + } +/* USER CODE END HAL ETH RxAllocateCallback */ +} + 80052e6: e005 b.n 80052f4 + RxAllocStatus = RX_ALLOC_ERROR; + 80052e8: 4b06 ldr r3, [pc, #24] @ (8005304 ) + 80052ea: 2201 movs r2, #1 + 80052ec: 701a strb r2, [r3, #0] + *buff = NULL; + 80052ee: 687b ldr r3, [r7, #4] + 80052f0: 2200 movs r2, #0 + 80052f2: 601a str r2, [r3, #0] +} + 80052f4: bf00 nop + 80052f6: 3710 adds r7, #16 + 80052f8: 46bd mov sp, r7 + 80052fa: bd80 pop {r7, pc} + 80052fc: 08018de8 .word 0x08018de8 + 8005300: 08004f25 .word 0x08004f25 + 8005304: 20005f00 .word 0x20005f00 + +08005308 : + +void HAL_ETH_RxLinkCallback(void **pStart, void **pEnd, uint8_t *buff, uint16_t Length) +{ + 8005308: b480 push {r7} + 800530a: b089 sub sp, #36 @ 0x24 + 800530c: af00 add r7, sp, #0 + 800530e: 60f8 str r0, [r7, #12] + 8005310: 60b9 str r1, [r7, #8] + 8005312: 607a str r2, [r7, #4] + 8005314: 807b strh r3, [r7, #2] +/* USER CODE BEGIN HAL ETH RxLinkCallback */ + + struct pbuf **ppStart = (struct pbuf **)pStart; + 8005316: 68fb ldr r3, [r7, #12] + 8005318: 61bb str r3, [r7, #24] + struct pbuf **ppEnd = (struct pbuf **)pEnd; + 800531a: 68bb ldr r3, [r7, #8] + 800531c: 617b str r3, [r7, #20] + struct pbuf *p = NULL; + 800531e: 2300 movs r3, #0 + 8005320: 61fb str r3, [r7, #28] + + /* Get the struct pbuf from the buff address. */ + p = (struct pbuf *)(buff - offsetof(RxBuff_t, buff)); + 8005322: 687b ldr r3, [r7, #4] + 8005324: 3b20 subs r3, #32 + 8005326: 61fb str r3, [r7, #28] + p->next = NULL; + 8005328: 69fb ldr r3, [r7, #28] + 800532a: 2200 movs r2, #0 + 800532c: 601a str r2, [r3, #0] + p->tot_len = 0; + 800532e: 69fb ldr r3, [r7, #28] + 8005330: 2200 movs r2, #0 + 8005332: 811a strh r2, [r3, #8] + p->len = Length; + 8005334: 69fb ldr r3, [r7, #28] + 8005336: 887a ldrh r2, [r7, #2] + 8005338: 815a strh r2, [r3, #10] + + /* Chain the buffer. */ + if (!*ppStart) + 800533a: 69bb ldr r3, [r7, #24] + 800533c: 681b ldr r3, [r3, #0] + 800533e: 2b00 cmp r3, #0 + 8005340: d103 bne.n 800534a + { + /* The first buffer of the packet. */ + *ppStart = p; + 8005342: 69bb ldr r3, [r7, #24] + 8005344: 69fa ldr r2, [r7, #28] + 8005346: 601a str r2, [r3, #0] + 8005348: e003 b.n 8005352 + } + else + { + /* Chain the buffer to the end of the packet. */ + (*ppEnd)->next = p; + 800534a: 697b ldr r3, [r7, #20] + 800534c: 681b ldr r3, [r3, #0] + 800534e: 69fa ldr r2, [r7, #28] + 8005350: 601a str r2, [r3, #0] + } + *ppEnd = p; + 8005352: 697b ldr r3, [r7, #20] + 8005354: 69fa ldr r2, [r7, #28] + 8005356: 601a str r2, [r3, #0] + + /* Update the total length of all the buffers of the chain. Each pbuf in the chain should have its tot_len + * set to its own length, plus the length of all the following pbufs in the chain. */ + for (p = *ppStart; p != NULL; p = p->next) + 8005358: 69bb ldr r3, [r7, #24] + 800535a: 681b ldr r3, [r3, #0] + 800535c: 61fb str r3, [r7, #28] + 800535e: e009 b.n 8005374 + { + p->tot_len += Length; + 8005360: 69fb ldr r3, [r7, #28] + 8005362: 891a ldrh r2, [r3, #8] + 8005364: 887b ldrh r3, [r7, #2] + 8005366: 4413 add r3, r2 + 8005368: b29a uxth r2, r3 + 800536a: 69fb ldr r3, [r7, #28] + 800536c: 811a strh r2, [r3, #8] + for (p = *ppStart; p != NULL; p = p->next) + 800536e: 69fb ldr r3, [r7, #28] + 8005370: 681b ldr r3, [r3, #0] + 8005372: 61fb str r3, [r7, #28] + 8005374: 69fb ldr r3, [r7, #28] + 8005376: 2b00 cmp r3, #0 + 8005378: d1f2 bne.n 8005360 + } + +/* USER CODE END HAL ETH RxLinkCallback */ +} + 800537a: bf00 nop + 800537c: bf00 nop + 800537e: 3724 adds r7, #36 @ 0x24 + 8005380: 46bd mov sp, r7 + 8005382: f85d 7b04 ldr.w r7, [sp], #4 + 8005386: 4770 bx lr + +08005388 : + * @param n u16_t in host byte order + * @return n in network byte order + */ +u16_t +lwip_htons(u16_t n) +{ + 8005388: b480 push {r7} + 800538a: b083 sub sp, #12 + 800538c: af00 add r7, sp, #0 + 800538e: 4603 mov r3, r0 + 8005390: 80fb strh r3, [r7, #6] + return PP_HTONS(n); + 8005392: 88fb ldrh r3, [r7, #6] + 8005394: 021b lsls r3, r3, #8 + 8005396: b21a sxth r2, r3 + 8005398: 88fb ldrh r3, [r7, #6] + 800539a: 0a1b lsrs r3, r3, #8 + 800539c: b29b uxth r3, r3 + 800539e: b21b sxth r3, r3 + 80053a0: 4313 orrs r3, r2 + 80053a2: b21b sxth r3, r3 + 80053a4: b29b uxth r3, r3 +} + 80053a6: 4618 mov r0, r3 + 80053a8: 370c adds r7, #12 + 80053aa: 46bd mov sp, r7 + 80053ac: f85d 7b04 ldr.w r7, [sp], #4 + 80053b0: 4770 bx lr + +080053b2 : + * @param n u32_t in host byte order + * @return n in network byte order + */ +u32_t +lwip_htonl(u32_t n) +{ + 80053b2: b480 push {r7} + 80053b4: b083 sub sp, #12 + 80053b6: af00 add r7, sp, #0 + 80053b8: 6078 str r0, [r7, #4] + return PP_HTONL(n); + 80053ba: 687b ldr r3, [r7, #4] + 80053bc: 061a lsls r2, r3, #24 + 80053be: 687b ldr r3, [r7, #4] + 80053c0: 021b lsls r3, r3, #8 + 80053c2: f403 037f and.w r3, r3, #16711680 @ 0xff0000 + 80053c6: 431a orrs r2, r3 + 80053c8: 687b ldr r3, [r7, #4] + 80053ca: 0a1b lsrs r3, r3, #8 + 80053cc: f403 437f and.w r3, r3, #65280 @ 0xff00 + 80053d0: 431a orrs r2, r3 + 80053d2: 687b ldr r3, [r7, #4] + 80053d4: 0e1b lsrs r3, r3, #24 + 80053d6: 4313 orrs r3, r2 +} + 80053d8: 4618 mov r0, r3 + 80053da: 370c adds r7, #12 + 80053dc: 46bd mov sp, r7 + 80053de: f85d 7b04 ldr.w r7, [sp], #4 + 80053e2: 4770 bx lr + +080053e4 : + * Initialize all modules. + * Use this in NO_SYS mode. Use tcpip_init() otherwise. + */ +void +lwip_init(void) +{ + 80053e4: b580 push {r7, lr} + 80053e6: b082 sub sp, #8 + 80053e8: af00 add r7, sp, #0 +#ifndef LWIP_SKIP_CONST_CHECK + int a = 0; + 80053ea: 2300 movs r3, #0 + 80053ec: 607b str r3, [r7, #4] + /* Modules initialization */ + stats_init(); +#if !NO_SYS + sys_init(); +#endif /* !NO_SYS */ + mem_init(); + 80053ee: f000 f8d1 bl 8005594 + memp_init(); + 80053f2: f000 fbc3 bl 8005b7c + pbuf_init(); + netif_init(); + 80053f6: f000 fcc1 bl 8005d7c +#endif /* LWIP_IPV4 */ +#if LWIP_RAW + raw_init(); +#endif /* LWIP_RAW */ +#if LWIP_UDP + udp_init(); + 80053fa: f007 f855 bl 800c4a8 +#endif /* LWIP_UDP */ +#if LWIP_TCP + tcp_init(); + 80053fe: f001 fdb1 bl 8006f64 +#if PPP_SUPPORT + ppp_init(); +#endif + +#if LWIP_TIMERS + sys_timeouts_init(); + 8005402: f006 ffc7 bl 800c394 +#endif /* LWIP_TIMERS */ +} + 8005406: bf00 nop + 8005408: 3708 adds r7, #8 + 800540a: 46bd mov sp, r7 + 800540c: bd80 pop {r7, pc} + ... + +08005410 : +#define mem_overflow_check_element(mem) +#endif /* MEM_OVERFLOW_CHECK */ + +static struct mem * +ptr_to_mem(mem_size_t ptr) +{ + 8005410: b480 push {r7} + 8005412: b083 sub sp, #12 + 8005414: af00 add r7, sp, #0 + 8005416: 6078 str r0, [r7, #4] + return (struct mem *)(void *)&ram[ptr]; + 8005418: 4b04 ldr r3, [pc, #16] @ (800542c ) + 800541a: 681a ldr r2, [r3, #0] + 800541c: 687b ldr r3, [r7, #4] + 800541e: 4413 add r3, r2 +} + 8005420: 4618 mov r0, r3 + 8005422: 370c adds r7, #12 + 8005424: 46bd mov sp, r7 + 8005426: f85d 7b04 ldr.w r7, [sp], #4 + 800542a: 4770 bx lr + 800542c: 20016180 .word 0x20016180 + +08005430 : + +static mem_size_t +mem_to_ptr(void *mem) +{ + 8005430: b480 push {r7} + 8005432: b083 sub sp, #12 + 8005434: af00 add r7, sp, #0 + 8005436: 6078 str r0, [r7, #4] + return (mem_size_t)((u8_t *)mem - ram); + 8005438: 4b04 ldr r3, [pc, #16] @ (800544c ) + 800543a: 681b ldr r3, [r3, #0] + 800543c: 687a ldr r2, [r7, #4] + 800543e: 1ad3 subs r3, r2, r3 +} + 8005440: 4618 mov r0, r3 + 8005442: 370c adds r7, #12 + 8005444: 46bd mov sp, r7 + 8005446: f85d 7b04 ldr.w r7, [sp], #4 + 800544a: 4770 bx lr + 800544c: 20016180 .word 0x20016180 + +08005450 : + * This assumes access to the heap is protected by the calling function + * already. + */ +static void +plug_holes(struct mem *mem) +{ + 8005450: b590 push {r4, r7, lr} + 8005452: b085 sub sp, #20 + 8005454: af00 add r7, sp, #0 + 8005456: 6078 str r0, [r7, #4] + struct mem *nmem; + struct mem *pmem; + + LWIP_ASSERT("plug_holes: mem >= ram", (u8_t *)mem >= ram); + 8005458: 4b45 ldr r3, [pc, #276] @ (8005570 ) + 800545a: 681b ldr r3, [r3, #0] + 800545c: 687a ldr r2, [r7, #4] + 800545e: 429a cmp r2, r3 + 8005460: d206 bcs.n 8005470 + 8005462: 4b44 ldr r3, [pc, #272] @ (8005574 ) + 8005464: f240 12df movw r2, #479 @ 0x1df + 8005468: 4943 ldr r1, [pc, #268] @ (8005578 ) + 800546a: 4844 ldr r0, [pc, #272] @ (800557c ) + 800546c: f00c f8c4 bl 80115f8 + LWIP_ASSERT("plug_holes: mem < ram_end", (u8_t *)mem < (u8_t *)ram_end); + 8005470: 4b43 ldr r3, [pc, #268] @ (8005580 ) + 8005472: 681b ldr r3, [r3, #0] + 8005474: 687a ldr r2, [r7, #4] + 8005476: 429a cmp r2, r3 + 8005478: d306 bcc.n 8005488 + 800547a: 4b3e ldr r3, [pc, #248] @ (8005574 ) + 800547c: f44f 72f0 mov.w r2, #480 @ 0x1e0 + 8005480: 4940 ldr r1, [pc, #256] @ (8005584 ) + 8005482: 483e ldr r0, [pc, #248] @ (800557c ) + 8005484: f00c f8b8 bl 80115f8 + LWIP_ASSERT("plug_holes: mem->used == 0", mem->used == 0); + 8005488: 687b ldr r3, [r7, #4] + 800548a: 7a1b ldrb r3, [r3, #8] + 800548c: 2b00 cmp r3, #0 + 800548e: d006 beq.n 800549e + 8005490: 4b38 ldr r3, [pc, #224] @ (8005574 ) + 8005492: f240 12e1 movw r2, #481 @ 0x1e1 + 8005496: 493c ldr r1, [pc, #240] @ (8005588 ) + 8005498: 4838 ldr r0, [pc, #224] @ (800557c ) + 800549a: f00c f8ad bl 80115f8 + + /* plug hole forward */ + LWIP_ASSERT("plug_holes: mem->next <= MEM_SIZE_ALIGNED", mem->next <= MEM_SIZE_ALIGNED); + 800549e: 687b ldr r3, [r7, #4] + 80054a0: 681b ldr r3, [r3, #0] + 80054a2: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80054a6: d906 bls.n 80054b6 + 80054a8: 4b32 ldr r3, [pc, #200] @ (8005574 ) + 80054aa: f44f 72f2 mov.w r2, #484 @ 0x1e4 + 80054ae: 4937 ldr r1, [pc, #220] @ (800558c ) + 80054b0: 4832 ldr r0, [pc, #200] @ (800557c ) + 80054b2: f00c f8a1 bl 80115f8 + + nmem = ptr_to_mem(mem->next); + 80054b6: 687b ldr r3, [r7, #4] + 80054b8: 681b ldr r3, [r3, #0] + 80054ba: 4618 mov r0, r3 + 80054bc: f7ff ffa8 bl 8005410 + 80054c0: 60f8 str r0, [r7, #12] + if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) { + 80054c2: 687a ldr r2, [r7, #4] + 80054c4: 68fb ldr r3, [r7, #12] + 80054c6: 429a cmp r2, r3 + 80054c8: d024 beq.n 8005514 + 80054ca: 68fb ldr r3, [r7, #12] + 80054cc: 7a1b ldrb r3, [r3, #8] + 80054ce: 2b00 cmp r3, #0 + 80054d0: d120 bne.n 8005514 + 80054d2: 4b2b ldr r3, [pc, #172] @ (8005580 ) + 80054d4: 681b ldr r3, [r3, #0] + 80054d6: 68fa ldr r2, [r7, #12] + 80054d8: 429a cmp r2, r3 + 80054da: d01b beq.n 8005514 + /* if mem->next is unused and not end of ram, combine mem and mem->next */ + if (lfree == nmem) { + 80054dc: 4b2c ldr r3, [pc, #176] @ (8005590 ) + 80054de: 681b ldr r3, [r3, #0] + 80054e0: 68fa ldr r2, [r7, #12] + 80054e2: 429a cmp r2, r3 + 80054e4: d102 bne.n 80054ec + lfree = mem; + 80054e6: 4a2a ldr r2, [pc, #168] @ (8005590 ) + 80054e8: 687b ldr r3, [r7, #4] + 80054ea: 6013 str r3, [r2, #0] + } + mem->next = nmem->next; + 80054ec: 68fb ldr r3, [r7, #12] + 80054ee: 681a ldr r2, [r3, #0] + 80054f0: 687b ldr r3, [r7, #4] + 80054f2: 601a str r2, [r3, #0] + if (nmem->next != MEM_SIZE_ALIGNED) { + 80054f4: 68fb ldr r3, [r7, #12] + 80054f6: 681b ldr r3, [r3, #0] + 80054f8: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80054fc: d00a beq.n 8005514 + ptr_to_mem(nmem->next)->prev = mem_to_ptr(mem); + 80054fe: 68fb ldr r3, [r7, #12] + 8005500: 681b ldr r3, [r3, #0] + 8005502: 4618 mov r0, r3 + 8005504: f7ff ff84 bl 8005410 + 8005508: 4604 mov r4, r0 + 800550a: 6878 ldr r0, [r7, #4] + 800550c: f7ff ff90 bl 8005430 + 8005510: 4603 mov r3, r0 + 8005512: 6063 str r3, [r4, #4] + } + } + + /* plug hole backward */ + pmem = ptr_to_mem(mem->prev); + 8005514: 687b ldr r3, [r7, #4] + 8005516: 685b ldr r3, [r3, #4] + 8005518: 4618 mov r0, r3 + 800551a: f7ff ff79 bl 8005410 + 800551e: 60b8 str r0, [r7, #8] + if (pmem != mem && pmem->used == 0) { + 8005520: 68ba ldr r2, [r7, #8] + 8005522: 687b ldr r3, [r7, #4] + 8005524: 429a cmp r2, r3 + 8005526: d01f beq.n 8005568 + 8005528: 68bb ldr r3, [r7, #8] + 800552a: 7a1b ldrb r3, [r3, #8] + 800552c: 2b00 cmp r3, #0 + 800552e: d11b bne.n 8005568 + /* if mem->prev is unused, combine mem and mem->prev */ + if (lfree == mem) { + 8005530: 4b17 ldr r3, [pc, #92] @ (8005590 ) + 8005532: 681b ldr r3, [r3, #0] + 8005534: 687a ldr r2, [r7, #4] + 8005536: 429a cmp r2, r3 + 8005538: d102 bne.n 8005540 + lfree = pmem; + 800553a: 4a15 ldr r2, [pc, #84] @ (8005590 ) + 800553c: 68bb ldr r3, [r7, #8] + 800553e: 6013 str r3, [r2, #0] + } + pmem->next = mem->next; + 8005540: 687b ldr r3, [r7, #4] + 8005542: 681a ldr r2, [r3, #0] + 8005544: 68bb ldr r3, [r7, #8] + 8005546: 601a str r2, [r3, #0] + if (mem->next != MEM_SIZE_ALIGNED) { + 8005548: 687b ldr r3, [r7, #4] + 800554a: 681b ldr r3, [r3, #0] + 800554c: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005550: d00a beq.n 8005568 + ptr_to_mem(mem->next)->prev = mem_to_ptr(pmem); + 8005552: 687b ldr r3, [r7, #4] + 8005554: 681b ldr r3, [r3, #0] + 8005556: 4618 mov r0, r3 + 8005558: f7ff ff5a bl 8005410 + 800555c: 4604 mov r4, r0 + 800555e: 68b8 ldr r0, [r7, #8] + 8005560: f7ff ff66 bl 8005430 + 8005564: 4603 mov r3, r0 + 8005566: 6063 str r3, [r4, #4] + } + } +} + 8005568: bf00 nop + 800556a: 3714 adds r7, #20 + 800556c: 46bd mov sp, r7 + 800556e: bd90 pop {r4, r7, pc} + 8005570: 20016180 .word 0x20016180 + 8005574: 0801603c .word 0x0801603c + 8005578: 0801606c .word 0x0801606c + 800557c: 08016084 .word 0x08016084 + 8005580: 20016184 .word 0x20016184 + 8005584: 080160ac .word 0x080160ac + 8005588: 080160c8 .word 0x080160c8 + 800558c: 080160e4 .word 0x080160e4 + 8005590: 20016188 .word 0x20016188 + +08005594 : +/** + * Zero the heap and initialize start, end and lowest-free + */ +void +mem_init(void) +{ + 8005594: b580 push {r7, lr} + 8005596: b082 sub sp, #8 + 8005598: af00 add r7, sp, #0 + + LWIP_ASSERT("Sanity check alignment", + (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT - 1)) == 0); + + /* align the heap */ + ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER); + 800559a: 4b18 ldr r3, [pc, #96] @ (80055fc ) + 800559c: 3303 adds r3, #3 + 800559e: f023 0303 bic.w r3, r3, #3 + 80055a2: 461a mov r2, r3 + 80055a4: 4b16 ldr r3, [pc, #88] @ (8005600 ) + 80055a6: 601a str r2, [r3, #0] + /* initialize the start of the heap */ + mem = (struct mem *)(void *)ram; + 80055a8: 4b15 ldr r3, [pc, #84] @ (8005600 ) + 80055aa: 681b ldr r3, [r3, #0] + 80055ac: 607b str r3, [r7, #4] + mem->next = MEM_SIZE_ALIGNED; + 80055ae: 687b ldr r3, [r7, #4] + 80055b0: f44f 3280 mov.w r2, #65536 @ 0x10000 + 80055b4: 601a str r2, [r3, #0] + mem->prev = 0; + 80055b6: 687b ldr r3, [r7, #4] + 80055b8: 2200 movs r2, #0 + 80055ba: 605a str r2, [r3, #4] + mem->used = 0; + 80055bc: 687b ldr r3, [r7, #4] + 80055be: 2200 movs r2, #0 + 80055c0: 721a strb r2, [r3, #8] + /* initialize the end of the heap */ + ram_end = ptr_to_mem(MEM_SIZE_ALIGNED); + 80055c2: f44f 3080 mov.w r0, #65536 @ 0x10000 + 80055c6: f7ff ff23 bl 8005410 + 80055ca: 4603 mov r3, r0 + 80055cc: 4a0d ldr r2, [pc, #52] @ (8005604 ) + 80055ce: 6013 str r3, [r2, #0] + ram_end->used = 1; + 80055d0: 4b0c ldr r3, [pc, #48] @ (8005604 ) + 80055d2: 681b ldr r3, [r3, #0] + 80055d4: 2201 movs r2, #1 + 80055d6: 721a strb r2, [r3, #8] + ram_end->next = MEM_SIZE_ALIGNED; + 80055d8: 4b0a ldr r3, [pc, #40] @ (8005604 ) + 80055da: 681b ldr r3, [r3, #0] + 80055dc: f44f 3280 mov.w r2, #65536 @ 0x10000 + 80055e0: 601a str r2, [r3, #0] + ram_end->prev = MEM_SIZE_ALIGNED; + 80055e2: 4b08 ldr r3, [pc, #32] @ (8005604 ) + 80055e4: 681b ldr r3, [r3, #0] + 80055e6: f44f 3280 mov.w r2, #65536 @ 0x10000 + 80055ea: 605a str r2, [r3, #4] + MEM_SANITY(); + + /* initialize the lowest-free pointer to the start of the heap */ + lfree = (struct mem *)(void *)ram; + 80055ec: 4b04 ldr r3, [pc, #16] @ (8005600 ) + 80055ee: 681b ldr r3, [r3, #0] + 80055f0: 4a05 ldr r2, [pc, #20] @ (8005608 ) + 80055f2: 6013 str r3, [r2, #0] + MEM_STATS_AVAIL(avail, MEM_SIZE_ALIGNED); + + if (sys_mutex_new(&mem_mutex) != ERR_OK) { + LWIP_ASSERT("failed to create mem_mutex", 0); + } +} + 80055f4: bf00 nop + 80055f6: 3708 adds r7, #8 + 80055f8: 46bd mov sp, r7 + 80055fa: bd80 pop {r7, pc} + 80055fc: 20006164 .word 0x20006164 + 8005600: 20016180 .word 0x20016180 + 8005604: 20016184 .word 0x20016184 + 8005608: 20016188 .word 0x20016188 + +0800560c : +/* Check if a struct mem is correctly linked. + * If not, double-free is a possible reason. + */ +static int +mem_link_valid(struct mem *mem) +{ + 800560c: b580 push {r7, lr} + 800560e: b086 sub sp, #24 + 8005610: af00 add r7, sp, #0 + 8005612: 6078 str r0, [r7, #4] + struct mem *nmem, *pmem; + mem_size_t rmem_idx; + rmem_idx = mem_to_ptr(mem); + 8005614: 6878 ldr r0, [r7, #4] + 8005616: f7ff ff0b bl 8005430 + 800561a: 6178 str r0, [r7, #20] + nmem = ptr_to_mem(mem->next); + 800561c: 687b ldr r3, [r7, #4] + 800561e: 681b ldr r3, [r3, #0] + 8005620: 4618 mov r0, r3 + 8005622: f7ff fef5 bl 8005410 + 8005626: 6138 str r0, [r7, #16] + pmem = ptr_to_mem(mem->prev); + 8005628: 687b ldr r3, [r7, #4] + 800562a: 685b ldr r3, [r3, #4] + 800562c: 4618 mov r0, r3 + 800562e: f7ff feef bl 8005410 + 8005632: 60f8 str r0, [r7, #12] + if ((mem->next > MEM_SIZE_ALIGNED) || (mem->prev > MEM_SIZE_ALIGNED) || + 8005634: 687b ldr r3, [r7, #4] + 8005636: 681b ldr r3, [r3, #0] + 8005638: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 800563c: d818 bhi.n 8005670 + 800563e: 687b ldr r3, [r7, #4] + 8005640: 685b ldr r3, [r3, #4] + 8005642: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005646: d813 bhi.n 8005670 + ((mem->prev != rmem_idx) && (pmem->next != rmem_idx)) || + 8005648: 687b ldr r3, [r7, #4] + 800564a: 685b ldr r3, [r3, #4] + if ((mem->next > MEM_SIZE_ALIGNED) || (mem->prev > MEM_SIZE_ALIGNED) || + 800564c: 697a ldr r2, [r7, #20] + 800564e: 429a cmp r2, r3 + 8005650: d004 beq.n 800565c + ((mem->prev != rmem_idx) && (pmem->next != rmem_idx)) || + 8005652: 68fb ldr r3, [r7, #12] + 8005654: 681b ldr r3, [r3, #0] + 8005656: 697a ldr r2, [r7, #20] + 8005658: 429a cmp r2, r3 + 800565a: d109 bne.n 8005670 + ((nmem != ram_end) && (nmem->prev != rmem_idx))) { + 800565c: 4b08 ldr r3, [pc, #32] @ (8005680 ) + 800565e: 681b ldr r3, [r3, #0] + ((mem->prev != rmem_idx) && (pmem->next != rmem_idx)) || + 8005660: 693a ldr r2, [r7, #16] + 8005662: 429a cmp r2, r3 + 8005664: d006 beq.n 8005674 + ((nmem != ram_end) && (nmem->prev != rmem_idx))) { + 8005666: 693b ldr r3, [r7, #16] + 8005668: 685b ldr r3, [r3, #4] + 800566a: 697a ldr r2, [r7, #20] + 800566c: 429a cmp r2, r3 + 800566e: d001 beq.n 8005674 + return 0; + 8005670: 2300 movs r3, #0 + 8005672: e000 b.n 8005676 + } + return 1; + 8005674: 2301 movs r3, #1 +} + 8005676: 4618 mov r0, r3 + 8005678: 3718 adds r7, #24 + 800567a: 46bd mov sp, r7 + 800567c: bd80 pop {r7, pc} + 800567e: bf00 nop + 8005680: 20016184 .word 0x20016184 + +08005684 : + * @param rmem is the data portion of a struct mem as returned by a previous + * call to mem_malloc() + */ +void +mem_free(void *rmem) +{ + 8005684: b580 push {r7, lr} + 8005686: b084 sub sp, #16 + 8005688: af00 add r7, sp, #0 + 800568a: 6078 str r0, [r7, #4] + struct mem *mem; + LWIP_MEM_FREE_DECL_PROTECT(); + + if (rmem == NULL) { + 800568c: 687b ldr r3, [r7, #4] + 800568e: 2b00 cmp r3, #0 + 8005690: d04c beq.n 800572c + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("mem_free(p == NULL) was called.\n")); + return; + } + if ((((mem_ptr_t)rmem) & (MEM_ALIGNMENT - 1)) != 0) { + 8005692: 687b ldr r3, [r7, #4] + 8005694: f003 0303 and.w r3, r3, #3 + 8005698: 2b00 cmp r3, #0 + 800569a: d007 beq.n 80056ac + LWIP_MEM_ILLEGAL_FREE("mem_free: sanity check alignment"); + 800569c: 4b25 ldr r3, [pc, #148] @ (8005734 ) + 800569e: f240 2273 movw r2, #627 @ 0x273 + 80056a2: 4925 ldr r1, [pc, #148] @ (8005738 ) + 80056a4: 4825 ldr r0, [pc, #148] @ (800573c ) + 80056a6: f00b ffa7 bl 80115f8 + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: sanity check alignment\n")); + /* protect mem stats from concurrent access */ + MEM_STATS_INC_LOCKED(illegal); + return; + 80056aa: e040 b.n 800572e + } + + /* Get the corresponding struct mem: */ + /* cast through void* to get rid of alignment warnings */ + mem = (struct mem *)(void *)((u8_t *)rmem - (SIZEOF_STRUCT_MEM + MEM_SANITY_OFFSET)); + 80056ac: 687b ldr r3, [r7, #4] + 80056ae: 3b0c subs r3, #12 + 80056b0: 60fb str r3, [r7, #12] + + if ((u8_t *)mem < ram || (u8_t *)rmem + MIN_SIZE_ALIGNED > (u8_t *)ram_end) { + 80056b2: 4b23 ldr r3, [pc, #140] @ (8005740 ) + 80056b4: 681b ldr r3, [r3, #0] + 80056b6: 68fa ldr r2, [r7, #12] + 80056b8: 429a cmp r2, r3 + 80056ba: d306 bcc.n 80056ca + 80056bc: 687b ldr r3, [r7, #4] + 80056be: f103 020c add.w r2, r3, #12 + 80056c2: 4b20 ldr r3, [pc, #128] @ (8005744 ) + 80056c4: 681b ldr r3, [r3, #0] + 80056c6: 429a cmp r2, r3 + 80056c8: d907 bls.n 80056da + LWIP_MEM_ILLEGAL_FREE("mem_free: illegal memory"); + 80056ca: 4b1a ldr r3, [pc, #104] @ (8005734 ) + 80056cc: f240 227f movw r2, #639 @ 0x27f + 80056d0: 491d ldr r1, [pc, #116] @ (8005748 ) + 80056d2: 481a ldr r0, [pc, #104] @ (800573c ) + 80056d4: f00b ff90 bl 80115f8 + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: illegal memory\n")); + /* protect mem stats from concurrent access */ + MEM_STATS_INC_LOCKED(illegal); + return; + 80056d8: e029 b.n 800572e + mem_overflow_check_element(mem); +#endif + /* protect the heap from concurrent access */ + LWIP_MEM_FREE_PROTECT(); + /* mem has to be in a used state */ + if (!mem->used) { + 80056da: 68fb ldr r3, [r7, #12] + 80056dc: 7a1b ldrb r3, [r3, #8] + 80056de: 2b00 cmp r3, #0 + 80056e0: d107 bne.n 80056f2 + LWIP_MEM_ILLEGAL_FREE("mem_free: illegal memory: double free"); + 80056e2: 4b14 ldr r3, [pc, #80] @ (8005734 ) + 80056e4: f44f 7223 mov.w r2, #652 @ 0x28c + 80056e8: 4918 ldr r1, [pc, #96] @ (800574c ) + 80056ea: 4814 ldr r0, [pc, #80] @ (800573c ) + 80056ec: f00b ff84 bl 80115f8 + LWIP_MEM_FREE_UNPROTECT(); + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: illegal memory: double free?\n")); + /* protect mem stats from concurrent access */ + MEM_STATS_INC_LOCKED(illegal); + return; + 80056f0: e01d b.n 800572e + } + + if (!mem_link_valid(mem)) { + 80056f2: 68f8 ldr r0, [r7, #12] + 80056f4: f7ff ff8a bl 800560c + 80056f8: 4603 mov r3, r0 + 80056fa: 2b00 cmp r3, #0 + 80056fc: d107 bne.n 800570e + LWIP_MEM_ILLEGAL_FREE("mem_free: illegal memory: non-linked: double free"); + 80056fe: 4b0d ldr r3, [pc, #52] @ (8005734 ) + 8005700: f240 2295 movw r2, #661 @ 0x295 + 8005704: 4912 ldr r1, [pc, #72] @ (8005750 ) + 8005706: 480d ldr r0, [pc, #52] @ (800573c ) + 8005708: f00b ff76 bl 80115f8 + LWIP_MEM_FREE_UNPROTECT(); + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: illegal memory: non-linked: double free?\n")); + /* protect mem stats from concurrent access */ + MEM_STATS_INC_LOCKED(illegal); + return; + 800570c: e00f b.n 800572e + } + + /* mem is now unused. */ + mem->used = 0; + 800570e: 68fb ldr r3, [r7, #12] + 8005710: 2200 movs r2, #0 + 8005712: 721a strb r2, [r3, #8] + + if (mem < lfree) { + 8005714: 4b0f ldr r3, [pc, #60] @ (8005754 ) + 8005716: 681b ldr r3, [r3, #0] + 8005718: 68fa ldr r2, [r7, #12] + 800571a: 429a cmp r2, r3 + 800571c: d202 bcs.n 8005724 + /* the newly freed struct is now the lowest */ + lfree = mem; + 800571e: 4a0d ldr r2, [pc, #52] @ (8005754 ) + 8005720: 68fb ldr r3, [r7, #12] + 8005722: 6013 str r3, [r2, #0] + } + + MEM_STATS_DEC_USED(used, mem->next - (mem_size_t)(((u8_t *)mem - ram))); + + /* finally, see if prev or next are free also */ + plug_holes(mem); + 8005724: 68f8 ldr r0, [r7, #12] + 8005726: f7ff fe93 bl 8005450 + 800572a: e000 b.n 800572e + return; + 800572c: bf00 nop + MEM_SANITY(); +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + mem_free_count = 1; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_MEM_FREE_UNPROTECT(); +} + 800572e: 3710 adds r7, #16 + 8005730: 46bd mov sp, r7 + 8005732: bd80 pop {r7, pc} + 8005734: 0801603c .word 0x0801603c + 8005738: 08016110 .word 0x08016110 + 800573c: 08016084 .word 0x08016084 + 8005740: 20016180 .word 0x20016180 + 8005744: 20016184 .word 0x20016184 + 8005748: 08016134 .word 0x08016134 + 800574c: 08016150 .word 0x08016150 + 8005750: 08016178 .word 0x08016178 + 8005754: 20016188 .word 0x20016188 + +08005758 : + * or NULL if newsize is > old size, in which case rmem is NOT touched + * or freed! + */ +void * +mem_trim(void *rmem, mem_size_t new_size) +{ + 8005758: b580 push {r7, lr} + 800575a: b08a sub sp, #40 @ 0x28 + 800575c: af00 add r7, sp, #0 + 800575e: 6078 str r0, [r7, #4] + 8005760: 6039 str r1, [r7, #0] + /* use the FREE_PROTECT here: it protects with sem OR SYS_ARCH_PROTECT */ + LWIP_MEM_FREE_DECL_PROTECT(); + + /* Expand the size of the allocated memory region so that we can + adjust for alignment. */ + newsize = (mem_size_t)LWIP_MEM_ALIGN_SIZE(new_size); + 8005762: 683b ldr r3, [r7, #0] + 8005764: 3303 adds r3, #3 + 8005766: f023 0303 bic.w r3, r3, #3 + 800576a: 627b str r3, [r7, #36] @ 0x24 + if (newsize < MIN_SIZE_ALIGNED) { + 800576c: 6a7b ldr r3, [r7, #36] @ 0x24 + 800576e: 2b0b cmp r3, #11 + 8005770: d801 bhi.n 8005776 + /* every data block must be at least MIN_SIZE_ALIGNED long */ + newsize = MIN_SIZE_ALIGNED; + 8005772: 230c movs r3, #12 + 8005774: 627b str r3, [r7, #36] @ 0x24 + } +#if MEM_OVERFLOW_CHECK + newsize += MEM_SANITY_REGION_BEFORE_ALIGNED + MEM_SANITY_REGION_AFTER_ALIGNED; +#endif + if ((newsize > MEM_SIZE_ALIGNED) || (newsize < new_size)) { + 8005776: 6a7b ldr r3, [r7, #36] @ 0x24 + 8005778: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 800577c: d803 bhi.n 8005786 + 800577e: 6a7a ldr r2, [r7, #36] @ 0x24 + 8005780: 683b ldr r3, [r7, #0] + 8005782: 429a cmp r2, r3 + 8005784: d201 bcs.n 800578a + return NULL; + 8005786: 2300 movs r3, #0 + 8005788: e0c4 b.n 8005914 + } + + LWIP_ASSERT("mem_trim: legal memory", (u8_t *)rmem >= (u8_t *)ram && + 800578a: 4b64 ldr r3, [pc, #400] @ (800591c ) + 800578c: 681b ldr r3, [r3, #0] + 800578e: 687a ldr r2, [r7, #4] + 8005790: 429a cmp r2, r3 + 8005792: d304 bcc.n 800579e + 8005794: 4b62 ldr r3, [pc, #392] @ (8005920 ) + 8005796: 681b ldr r3, [r3, #0] + 8005798: 687a ldr r2, [r7, #4] + 800579a: 429a cmp r2, r3 + 800579c: d306 bcc.n 80057ac + 800579e: 4b61 ldr r3, [pc, #388] @ (8005924 ) + 80057a0: f240 22d1 movw r2, #721 @ 0x2d1 + 80057a4: 4960 ldr r1, [pc, #384] @ (8005928 ) + 80057a6: 4861 ldr r0, [pc, #388] @ (800592c ) + 80057a8: f00b ff26 bl 80115f8 + (u8_t *)rmem < (u8_t *)ram_end); + + if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { + 80057ac: 4b5b ldr r3, [pc, #364] @ (800591c ) + 80057ae: 681b ldr r3, [r3, #0] + 80057b0: 687a ldr r2, [r7, #4] + 80057b2: 429a cmp r2, r3 + 80057b4: d304 bcc.n 80057c0 + 80057b6: 4b5a ldr r3, [pc, #360] @ (8005920 ) + 80057b8: 681b ldr r3, [r3, #0] + 80057ba: 687a ldr r2, [r7, #4] + 80057bc: 429a cmp r2, r3 + 80057be: d301 bcc.n 80057c4 + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_trim: illegal memory\n")); + /* protect mem stats from concurrent access */ + MEM_STATS_INC_LOCKED(illegal); + return rmem; + 80057c0: 687b ldr r3, [r7, #4] + 80057c2: e0a7 b.n 8005914 + } + /* Get the corresponding struct mem ... */ + /* cast through void* to get rid of alignment warnings */ + mem = (struct mem *)(void *)((u8_t *)rmem - (SIZEOF_STRUCT_MEM + MEM_SANITY_OFFSET)); + 80057c4: 687b ldr r3, [r7, #4] + 80057c6: 3b0c subs r3, #12 + 80057c8: 623b str r3, [r7, #32] +#if MEM_OVERFLOW_CHECK + mem_overflow_check_element(mem); +#endif + /* ... and its offset pointer */ + ptr = mem_to_ptr(mem); + 80057ca: 6a38 ldr r0, [r7, #32] + 80057cc: f7ff fe30 bl 8005430 + 80057d0: 61f8 str r0, [r7, #28] + + size = (mem_size_t)((mem_size_t)(mem->next - ptr) - (SIZEOF_STRUCT_MEM + MEM_SANITY_OVERHEAD)); + 80057d2: 6a3b ldr r3, [r7, #32] + 80057d4: 681a ldr r2, [r3, #0] + 80057d6: 69fb ldr r3, [r7, #28] + 80057d8: 1ad3 subs r3, r2, r3 + 80057da: 3b0c subs r3, #12 + 80057dc: 61bb str r3, [r7, #24] + LWIP_ASSERT("mem_trim can only shrink memory", newsize <= size); + 80057de: 6a7a ldr r2, [r7, #36] @ 0x24 + 80057e0: 69bb ldr r3, [r7, #24] + 80057e2: 429a cmp r2, r3 + 80057e4: d906 bls.n 80057f4 + 80057e6: 4b4f ldr r3, [pc, #316] @ (8005924 ) + 80057e8: f44f 7239 mov.w r2, #740 @ 0x2e4 + 80057ec: 4950 ldr r1, [pc, #320] @ (8005930 ) + 80057ee: 484f ldr r0, [pc, #316] @ (800592c ) + 80057f0: f00b ff02 bl 80115f8 + if (newsize > size) { + 80057f4: 6a7a ldr r2, [r7, #36] @ 0x24 + 80057f6: 69bb ldr r3, [r7, #24] + 80057f8: 429a cmp r2, r3 + 80057fa: d901 bls.n 8005800 + /* not supported */ + return NULL; + 80057fc: 2300 movs r3, #0 + 80057fe: e089 b.n 8005914 + } + if (newsize == size) { + 8005800: 6a7a ldr r2, [r7, #36] @ 0x24 + 8005802: 69bb ldr r3, [r7, #24] + 8005804: 429a cmp r2, r3 + 8005806: d101 bne.n 800580c + /* No change in size, simply return */ + return rmem; + 8005808: 687b ldr r3, [r7, #4] + 800580a: e083 b.n 8005914 + } + + /* protect the heap from concurrent access */ + LWIP_MEM_FREE_PROTECT(); + + mem2 = ptr_to_mem(mem->next); + 800580c: 6a3b ldr r3, [r7, #32] + 800580e: 681b ldr r3, [r3, #0] + 8005810: 4618 mov r0, r3 + 8005812: f7ff fdfd bl 8005410 + 8005816: 6178 str r0, [r7, #20] + if (mem2->used == 0) { + 8005818: 697b ldr r3, [r7, #20] + 800581a: 7a1b ldrb r3, [r3, #8] + 800581c: 2b00 cmp r3, #0 + 800581e: d13c bne.n 800589a + /* The next struct is unused, we can simply move it at little */ + mem_size_t next; + LWIP_ASSERT("invalid next ptr", mem->next != MEM_SIZE_ALIGNED); + 8005820: 6a3b ldr r3, [r7, #32] + 8005822: 681b ldr r3, [r3, #0] + 8005824: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005828: d106 bne.n 8005838 + 800582a: 4b3e ldr r3, [pc, #248] @ (8005924 ) + 800582c: f240 22f5 movw r2, #757 @ 0x2f5 + 8005830: 4940 ldr r1, [pc, #256] @ (8005934 ) + 8005832: 483e ldr r0, [pc, #248] @ (800592c ) + 8005834: f00b fee0 bl 80115f8 + /* remember the old next pointer */ + next = mem2->next; + 8005838: 697b ldr r3, [r7, #20] + 800583a: 681b ldr r3, [r3, #0] + 800583c: 60fb str r3, [r7, #12] + /* create new struct mem which is moved directly after the shrinked mem */ + ptr2 = (mem_size_t)(ptr + SIZEOF_STRUCT_MEM + newsize); + 800583e: 69fa ldr r2, [r7, #28] + 8005840: 6a7b ldr r3, [r7, #36] @ 0x24 + 8005842: 4413 add r3, r2 + 8005844: 330c adds r3, #12 + 8005846: 613b str r3, [r7, #16] + if (lfree == mem2) { + 8005848: 4b3b ldr r3, [pc, #236] @ (8005938 ) + 800584a: 681b ldr r3, [r3, #0] + 800584c: 697a ldr r2, [r7, #20] + 800584e: 429a cmp r2, r3 + 8005850: d105 bne.n 800585e + lfree = ptr_to_mem(ptr2); + 8005852: 6938 ldr r0, [r7, #16] + 8005854: f7ff fddc bl 8005410 + 8005858: 4603 mov r3, r0 + 800585a: 4a37 ldr r2, [pc, #220] @ (8005938 ) + 800585c: 6013 str r3, [r2, #0] + } + mem2 = ptr_to_mem(ptr2); + 800585e: 6938 ldr r0, [r7, #16] + 8005860: f7ff fdd6 bl 8005410 + 8005864: 6178 str r0, [r7, #20] + mem2->used = 0; + 8005866: 697b ldr r3, [r7, #20] + 8005868: 2200 movs r2, #0 + 800586a: 721a strb r2, [r3, #8] + /* restore the next pointer */ + mem2->next = next; + 800586c: 697b ldr r3, [r7, #20] + 800586e: 68fa ldr r2, [r7, #12] + 8005870: 601a str r2, [r3, #0] + /* link it back to mem */ + mem2->prev = ptr; + 8005872: 697b ldr r3, [r7, #20] + 8005874: 69fa ldr r2, [r7, #28] + 8005876: 605a str r2, [r3, #4] + /* link mem to it */ + mem->next = ptr2; + 8005878: 6a3b ldr r3, [r7, #32] + 800587a: 693a ldr r2, [r7, #16] + 800587c: 601a str r2, [r3, #0] + /* last thing to restore linked list: as we have moved mem2, + * let 'mem2->next->prev' point to mem2 again. but only if mem2->next is not + * the end of the heap */ + if (mem2->next != MEM_SIZE_ALIGNED) { + 800587e: 697b ldr r3, [r7, #20] + 8005880: 681b ldr r3, [r3, #0] + 8005882: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005886: d044 beq.n 8005912 + ptr_to_mem(mem2->next)->prev = ptr2; + 8005888: 697b ldr r3, [r7, #20] + 800588a: 681b ldr r3, [r3, #0] + 800588c: 4618 mov r0, r3 + 800588e: f7ff fdbf bl 8005410 + 8005892: 4602 mov r2, r0 + 8005894: 693b ldr r3, [r7, #16] + 8005896: 6053 str r3, [r2, #4] + 8005898: e03b b.n 8005912 + } + MEM_STATS_DEC_USED(used, (size - newsize)); + /* no need to plug holes, we've already done that */ + } else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) { + 800589a: 6a7b ldr r3, [r7, #36] @ 0x24 + 800589c: 3318 adds r3, #24 + 800589e: 69ba ldr r2, [r7, #24] + 80058a0: 429a cmp r2, r3 + 80058a2: d336 bcc.n 8005912 + * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem + * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED'). + * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty + * region that couldn't hold data, but when mem->next gets freed, + * the 2 regions would be combined, resulting in more free memory */ + ptr2 = (mem_size_t)(ptr + SIZEOF_STRUCT_MEM + newsize); + 80058a4: 69fa ldr r2, [r7, #28] + 80058a6: 6a7b ldr r3, [r7, #36] @ 0x24 + 80058a8: 4413 add r3, r2 + 80058aa: 330c adds r3, #12 + 80058ac: 613b str r3, [r7, #16] + LWIP_ASSERT("invalid next ptr", mem->next != MEM_SIZE_ALIGNED); + 80058ae: 6a3b ldr r3, [r7, #32] + 80058b0: 681b ldr r3, [r3, #0] + 80058b2: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80058b6: d106 bne.n 80058c6 + 80058b8: 4b1a ldr r3, [pc, #104] @ (8005924 ) + 80058ba: f240 3216 movw r2, #790 @ 0x316 + 80058be: 491d ldr r1, [pc, #116] @ (8005934 ) + 80058c0: 481a ldr r0, [pc, #104] @ (800592c ) + 80058c2: f00b fe99 bl 80115f8 + mem2 = ptr_to_mem(ptr2); + 80058c6: 6938 ldr r0, [r7, #16] + 80058c8: f7ff fda2 bl 8005410 + 80058cc: 6178 str r0, [r7, #20] + if (mem2 < lfree) { + 80058ce: 4b1a ldr r3, [pc, #104] @ (8005938 ) + 80058d0: 681b ldr r3, [r3, #0] + 80058d2: 697a ldr r2, [r7, #20] + 80058d4: 429a cmp r2, r3 + 80058d6: d202 bcs.n 80058de + lfree = mem2; + 80058d8: 4a17 ldr r2, [pc, #92] @ (8005938 ) + 80058da: 697b ldr r3, [r7, #20] + 80058dc: 6013 str r3, [r2, #0] + } + mem2->used = 0; + 80058de: 697b ldr r3, [r7, #20] + 80058e0: 2200 movs r2, #0 + 80058e2: 721a strb r2, [r3, #8] + mem2->next = mem->next; + 80058e4: 6a3b ldr r3, [r7, #32] + 80058e6: 681a ldr r2, [r3, #0] + 80058e8: 697b ldr r3, [r7, #20] + 80058ea: 601a str r2, [r3, #0] + mem2->prev = ptr; + 80058ec: 697b ldr r3, [r7, #20] + 80058ee: 69fa ldr r2, [r7, #28] + 80058f0: 605a str r2, [r3, #4] + mem->next = ptr2; + 80058f2: 6a3b ldr r3, [r7, #32] + 80058f4: 693a ldr r2, [r7, #16] + 80058f6: 601a str r2, [r3, #0] + if (mem2->next != MEM_SIZE_ALIGNED) { + 80058f8: 697b ldr r3, [r7, #20] + 80058fa: 681b ldr r3, [r3, #0] + 80058fc: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005900: d007 beq.n 8005912 + ptr_to_mem(mem2->next)->prev = ptr2; + 8005902: 697b ldr r3, [r7, #20] + 8005904: 681b ldr r3, [r3, #0] + 8005906: 4618 mov r0, r3 + 8005908: f7ff fd82 bl 8005410 + 800590c: 4602 mov r2, r0 + 800590e: 693b ldr r3, [r7, #16] + 8005910: 6053 str r3, [r2, #4] + MEM_SANITY(); +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + mem_free_count = 1; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_MEM_FREE_UNPROTECT(); + return rmem; + 8005912: 687b ldr r3, [r7, #4] +} + 8005914: 4618 mov r0, r3 + 8005916: 3728 adds r7, #40 @ 0x28 + 8005918: 46bd mov sp, r7 + 800591a: bd80 pop {r7, pc} + 800591c: 20016180 .word 0x20016180 + 8005920: 20016184 .word 0x20016184 + 8005924: 0801603c .word 0x0801603c + 8005928: 080161ac .word 0x080161ac + 800592c: 08016084 .word 0x08016084 + 8005930: 080161c4 .word 0x080161c4 + 8005934: 080161e4 .word 0x080161e4 + 8005938: 20016188 .word 0x20016188 + +0800593c : + * + * Note that the returned value will always be aligned (as defined by MEM_ALIGNMENT). + */ +void * +mem_malloc(mem_size_t size_in) +{ + 800593c: b580 push {r7, lr} + 800593e: b088 sub sp, #32 + 8005940: af00 add r7, sp, #0 + 8005942: 6078 str r0, [r7, #4] +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + u8_t local_mem_free_count = 0; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_MEM_ALLOC_DECL_PROTECT(); + + if (size_in == 0) { + 8005944: 687b ldr r3, [r7, #4] + 8005946: 2b00 cmp r3, #0 + 8005948: d101 bne.n 800594e + return NULL; + 800594a: 2300 movs r3, #0 + 800594c: e0d0 b.n 8005af0 + } + + /* Expand the size of the allocated memory region so that we can + adjust for alignment. */ + size = (mem_size_t)LWIP_MEM_ALIGN_SIZE(size_in); + 800594e: 687b ldr r3, [r7, #4] + 8005950: 3303 adds r3, #3 + 8005952: f023 0303 bic.w r3, r3, #3 + 8005956: 61bb str r3, [r7, #24] + if (size < MIN_SIZE_ALIGNED) { + 8005958: 69bb ldr r3, [r7, #24] + 800595a: 2b0b cmp r3, #11 + 800595c: d801 bhi.n 8005962 + /* every data block must be at least MIN_SIZE_ALIGNED long */ + size = MIN_SIZE_ALIGNED; + 800595e: 230c movs r3, #12 + 8005960: 61bb str r3, [r7, #24] + } +#if MEM_OVERFLOW_CHECK + size += MEM_SANITY_REGION_BEFORE_ALIGNED + MEM_SANITY_REGION_AFTER_ALIGNED; +#endif + if ((size > MEM_SIZE_ALIGNED) || (size < size_in)) { + 8005962: 69bb ldr r3, [r7, #24] + 8005964: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005968: d803 bhi.n 8005972 + 800596a: 69ba ldr r2, [r7, #24] + 800596c: 687b ldr r3, [r7, #4] + 800596e: 429a cmp r2, r3 + 8005970: d201 bcs.n 8005976 + return NULL; + 8005972: 2300 movs r3, #0 + 8005974: e0bc b.n 8005af0 +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + + /* Scan through the heap searching for a free block that is big enough, + * beginning with the lowest free block. + */ + for (ptr = mem_to_ptr(lfree); ptr < MEM_SIZE_ALIGNED - size; + 8005976: 4b60 ldr r3, [pc, #384] @ (8005af8 ) + 8005978: 681b ldr r3, [r3, #0] + 800597a: 4618 mov r0, r3 + 800597c: f7ff fd58 bl 8005430 + 8005980: 61f8 str r0, [r7, #28] + 8005982: e0ad b.n 8005ae0 + ptr = ptr_to_mem(ptr)->next) { + mem = ptr_to_mem(ptr); + 8005984: 69f8 ldr r0, [r7, #28] + 8005986: f7ff fd43 bl 8005410 + 800598a: 6138 str r0, [r7, #16] + local_mem_free_count = 1; + break; + } +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + + if ((!mem->used) && + 800598c: 693b ldr r3, [r7, #16] + 800598e: 7a1b ldrb r3, [r3, #8] + 8005990: 2b00 cmp r3, #0 + 8005992: f040 809f bne.w 8005ad4 + (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) { + 8005996: 693b ldr r3, [r7, #16] + 8005998: 681a ldr r2, [r3, #0] + 800599a: 69fb ldr r3, [r7, #28] + 800599c: 1ad3 subs r3, r2, r3 + 800599e: 3b0c subs r3, #12 + if ((!mem->used) && + 80059a0: 69ba ldr r2, [r7, #24] + 80059a2: 429a cmp r2, r3 + 80059a4: f200 8096 bhi.w 8005ad4 + /* mem is not used and at least perfect fit is possible: + * mem->next - (ptr + SIZEOF_STRUCT_MEM) gives us the 'user data size' of mem */ + + if (mem->next - (ptr + SIZEOF_STRUCT_MEM) >= (size + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED)) { + 80059a8: 693b ldr r3, [r7, #16] + 80059aa: 681a ldr r2, [r3, #0] + 80059ac: 69fb ldr r3, [r7, #28] + 80059ae: 1ad3 subs r3, r2, r3 + 80059b0: f1a3 020c sub.w r2, r3, #12 + 80059b4: 69bb ldr r3, [r7, #24] + 80059b6: 3318 adds r3, #24 + 80059b8: 429a cmp r2, r3 + 80059ba: d331 bcc.n 8005a20 + * struct mem would fit in but no data between mem2 and mem2->next + * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty + * region that couldn't hold data, but when mem->next gets freed, + * the 2 regions would be combined, resulting in more free memory + */ + ptr2 = (mem_size_t)(ptr + SIZEOF_STRUCT_MEM + size); + 80059bc: 69fa ldr r2, [r7, #28] + 80059be: 69bb ldr r3, [r7, #24] + 80059c0: 4413 add r3, r2 + 80059c2: 330c adds r3, #12 + 80059c4: 60fb str r3, [r7, #12] + LWIP_ASSERT("invalid next ptr",ptr2 != MEM_SIZE_ALIGNED); + 80059c6: 68fb ldr r3, [r7, #12] + 80059c8: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80059cc: d106 bne.n 80059dc + 80059ce: 4b4b ldr r3, [pc, #300] @ (8005afc ) + 80059d0: f240 3287 movw r2, #903 @ 0x387 + 80059d4: 494a ldr r1, [pc, #296] @ (8005b00 ) + 80059d6: 484b ldr r0, [pc, #300] @ (8005b04 ) + 80059d8: f00b fe0e bl 80115f8 + /* create mem2 struct */ + mem2 = ptr_to_mem(ptr2); + 80059dc: 68f8 ldr r0, [r7, #12] + 80059de: f7ff fd17 bl 8005410 + 80059e2: 60b8 str r0, [r7, #8] + mem2->used = 0; + 80059e4: 68bb ldr r3, [r7, #8] + 80059e6: 2200 movs r2, #0 + 80059e8: 721a strb r2, [r3, #8] + mem2->next = mem->next; + 80059ea: 693b ldr r3, [r7, #16] + 80059ec: 681a ldr r2, [r3, #0] + 80059ee: 68bb ldr r3, [r7, #8] + 80059f0: 601a str r2, [r3, #0] + mem2->prev = ptr; + 80059f2: 68bb ldr r3, [r7, #8] + 80059f4: 69fa ldr r2, [r7, #28] + 80059f6: 605a str r2, [r3, #4] + /* and insert it between mem and mem->next */ + mem->next = ptr2; + 80059f8: 693b ldr r3, [r7, #16] + 80059fa: 68fa ldr r2, [r7, #12] + 80059fc: 601a str r2, [r3, #0] + mem->used = 1; + 80059fe: 693b ldr r3, [r7, #16] + 8005a00: 2201 movs r2, #1 + 8005a02: 721a strb r2, [r3, #8] + + if (mem2->next != MEM_SIZE_ALIGNED) { + 8005a04: 68bb ldr r3, [r7, #8] + 8005a06: 681b ldr r3, [r3, #0] + 8005a08: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8005a0c: d00b beq.n 8005a26 + ptr_to_mem(mem2->next)->prev = ptr2; + 8005a0e: 68bb ldr r3, [r7, #8] + 8005a10: 681b ldr r3, [r3, #0] + 8005a12: 4618 mov r0, r3 + 8005a14: f7ff fcfc bl 8005410 + 8005a18: 4602 mov r2, r0 + 8005a1a: 68fb ldr r3, [r7, #12] + 8005a1c: 6053 str r3, [r2, #4] + 8005a1e: e002 b.n 8005a26 + * take care of this). + * -> near fit or exact fit: do not split, no mem2 creation + * also can't move mem->next directly behind mem, since mem->next + * will always be used at this point! + */ + mem->used = 1; + 8005a20: 693b ldr r3, [r7, #16] + 8005a22: 2201 movs r2, #1 + 8005a24: 721a strb r2, [r3, #8] + MEM_STATS_INC_USED(used, mem->next - mem_to_ptr(mem)); + } +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT +mem_malloc_adjust_lfree: +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + if (mem == lfree) { + 8005a26: 4b34 ldr r3, [pc, #208] @ (8005af8 ) + 8005a28: 681b ldr r3, [r3, #0] + 8005a2a: 693a ldr r2, [r7, #16] + 8005a2c: 429a cmp r2, r3 + 8005a2e: d127 bne.n 8005a80 + struct mem *cur = lfree; + 8005a30: 4b31 ldr r3, [pc, #196] @ (8005af8 ) + 8005a32: 681b ldr r3, [r3, #0] + 8005a34: 617b str r3, [r7, #20] + /* Find next free block after mem and update lowest free pointer */ + while (cur->used && cur != ram_end) { + 8005a36: e005 b.n 8005a44 + /* If mem_free or mem_trim have run, we have to restart since they + could have altered our current struct mem or lfree. */ + goto mem_malloc_adjust_lfree; + } +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + cur = ptr_to_mem(cur->next); + 8005a38: 697b ldr r3, [r7, #20] + 8005a3a: 681b ldr r3, [r3, #0] + 8005a3c: 4618 mov r0, r3 + 8005a3e: f7ff fce7 bl 8005410 + 8005a42: 6178 str r0, [r7, #20] + while (cur->used && cur != ram_end) { + 8005a44: 697b ldr r3, [r7, #20] + 8005a46: 7a1b ldrb r3, [r3, #8] + 8005a48: 2b00 cmp r3, #0 + 8005a4a: d004 beq.n 8005a56 + 8005a4c: 4b2e ldr r3, [pc, #184] @ (8005b08 ) + 8005a4e: 681b ldr r3, [r3, #0] + 8005a50: 697a ldr r2, [r7, #20] + 8005a52: 429a cmp r2, r3 + 8005a54: d1f0 bne.n 8005a38 + } + lfree = cur; + 8005a56: 4a28 ldr r2, [pc, #160] @ (8005af8 ) + 8005a58: 697b ldr r3, [r7, #20] + 8005a5a: 6013 str r3, [r2, #0] + LWIP_ASSERT("mem_malloc: !lfree->used", ((lfree == ram_end) || (!lfree->used))); + 8005a5c: 4b26 ldr r3, [pc, #152] @ (8005af8 ) + 8005a5e: 681a ldr r2, [r3, #0] + 8005a60: 4b29 ldr r3, [pc, #164] @ (8005b08 ) + 8005a62: 681b ldr r3, [r3, #0] + 8005a64: 429a cmp r2, r3 + 8005a66: d00b beq.n 8005a80 + 8005a68: 4b23 ldr r3, [pc, #140] @ (8005af8 ) + 8005a6a: 681b ldr r3, [r3, #0] + 8005a6c: 7a1b ldrb r3, [r3, #8] + 8005a6e: 2b00 cmp r3, #0 + 8005a70: d006 beq.n 8005a80 + 8005a72: 4b22 ldr r3, [pc, #136] @ (8005afc ) + 8005a74: f240 32b5 movw r2, #949 @ 0x3b5 + 8005a78: 4924 ldr r1, [pc, #144] @ (8005b0c ) + 8005a7a: 4822 ldr r0, [pc, #136] @ (8005b04 ) + 8005a7c: f00b fdbc bl 80115f8 + } + LWIP_MEM_ALLOC_UNPROTECT(); + sys_mutex_unlock(&mem_mutex); + LWIP_ASSERT("mem_malloc: allocated memory not above ram_end.", + 8005a80: 693a ldr r2, [r7, #16] + 8005a82: 69bb ldr r3, [r7, #24] + 8005a84: 4413 add r3, r2 + 8005a86: 330c adds r3, #12 + 8005a88: 4a1f ldr r2, [pc, #124] @ (8005b08 ) + 8005a8a: 6812 ldr r2, [r2, #0] + 8005a8c: 4293 cmp r3, r2 + 8005a8e: d906 bls.n 8005a9e + 8005a90: 4b1a ldr r3, [pc, #104] @ (8005afc ) + 8005a92: f240 32b9 movw r2, #953 @ 0x3b9 + 8005a96: 491e ldr r1, [pc, #120] @ (8005b10 ) + 8005a98: 481a ldr r0, [pc, #104] @ (8005b04 ) + 8005a9a: f00b fdad bl 80115f8 + (mem_ptr_t)mem + SIZEOF_STRUCT_MEM + size <= (mem_ptr_t)ram_end); + LWIP_ASSERT("mem_malloc: allocated memory properly aligned.", + 8005a9e: 693b ldr r3, [r7, #16] + 8005aa0: f003 0303 and.w r3, r3, #3 + 8005aa4: 2b00 cmp r3, #0 + 8005aa6: d006 beq.n 8005ab6 + 8005aa8: 4b14 ldr r3, [pc, #80] @ (8005afc ) + 8005aaa: f240 32bb movw r2, #955 @ 0x3bb + 8005aae: 4919 ldr r1, [pc, #100] @ (8005b14 ) + 8005ab0: 4814 ldr r0, [pc, #80] @ (8005b04 ) + 8005ab2: f00b fda1 bl 80115f8 + ((mem_ptr_t)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0); + LWIP_ASSERT("mem_malloc: sanity check alignment", + 8005ab6: 693b ldr r3, [r7, #16] + 8005ab8: f003 0303 and.w r3, r3, #3 + 8005abc: 2b00 cmp r3, #0 + 8005abe: d006 beq.n 8005ace + 8005ac0: 4b0e ldr r3, [pc, #56] @ (8005afc ) + 8005ac2: f240 32bd movw r2, #957 @ 0x3bd + 8005ac6: 4914 ldr r1, [pc, #80] @ (8005b18 ) + 8005ac8: 480e ldr r0, [pc, #56] @ (8005b04 ) + 8005aca: f00b fd95 bl 80115f8 + +#if MEM_OVERFLOW_CHECK + mem_overflow_init_element(mem, size_in); +#endif + MEM_SANITY(); + return (u8_t *)mem + SIZEOF_STRUCT_MEM + MEM_SANITY_OFFSET; + 8005ace: 693b ldr r3, [r7, #16] + 8005ad0: 330c adds r3, #12 + 8005ad2: e00d b.n 8005af0 + ptr = ptr_to_mem(ptr)->next) { + 8005ad4: 69f8 ldr r0, [r7, #28] + 8005ad6: f7ff fc9b bl 8005410 + 8005ada: 4603 mov r3, r0 + 8005adc: 681b ldr r3, [r3, #0] + 8005ade: 61fb str r3, [r7, #28] + for (ptr = mem_to_ptr(lfree); ptr < MEM_SIZE_ALIGNED - size; + 8005ae0: 69bb ldr r3, [r7, #24] + 8005ae2: f5c3 3380 rsb r3, r3, #65536 @ 0x10000 + 8005ae6: 69fa ldr r2, [r7, #28] + 8005ae8: 429a cmp r2, r3 + 8005aea: f4ff af4b bcc.w 8005984 +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + MEM_STATS_INC(err); + LWIP_MEM_ALLOC_UNPROTECT(); + sys_mutex_unlock(&mem_mutex); + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size)); + return NULL; + 8005aee: 2300 movs r3, #0 +} + 8005af0: 4618 mov r0, r3 + 8005af2: 3720 adds r7, #32 + 8005af4: 46bd mov sp, r7 + 8005af6: bd80 pop {r7, pc} + 8005af8: 20016188 .word 0x20016188 + 8005afc: 0801603c .word 0x0801603c + 8005b00: 080161e4 .word 0x080161e4 + 8005b04: 08016084 .word 0x08016084 + 8005b08: 20016184 .word 0x20016184 + 8005b0c: 080161f8 .word 0x080161f8 + 8005b10: 08016214 .word 0x08016214 + 8005b14: 08016244 .word 0x08016244 + 8005b18: 08016274 .word 0x08016274 + +08005b1c : + * + * @param desc pool to initialize + */ +void +memp_init_pool(const struct memp_desc *desc) +{ + 8005b1c: b480 push {r7} + 8005b1e: b085 sub sp, #20 + 8005b20: af00 add r7, sp, #0 + 8005b22: 6078 str r0, [r7, #4] + LWIP_UNUSED_ARG(desc); +#else + int i; + struct memp *memp; + + *desc->tab = NULL; + 8005b24: 687b ldr r3, [r7, #4] + 8005b26: 689b ldr r3, [r3, #8] + 8005b28: 2200 movs r2, #0 + 8005b2a: 601a str r2, [r3, #0] + memp = (struct memp *)LWIP_MEM_ALIGN(desc->base); + 8005b2c: 687b ldr r3, [r7, #4] + 8005b2e: 685b ldr r3, [r3, #4] + 8005b30: 3303 adds r3, #3 + 8005b32: f023 0303 bic.w r3, r3, #3 + 8005b36: 60bb str r3, [r7, #8] + + MEM_SANITY_REGION_AFTER_ALIGNED +#endif + )); +#endif + /* create a linked list of memp elements */ + for (i = 0; i < desc->num; ++i) { + 8005b38: 2300 movs r3, #0 + 8005b3a: 60fb str r3, [r7, #12] + 8005b3c: e011 b.n 8005b62 + memp->next = *desc->tab; + 8005b3e: 687b ldr r3, [r7, #4] + 8005b40: 689b ldr r3, [r3, #8] + 8005b42: 681a ldr r2, [r3, #0] + 8005b44: 68bb ldr r3, [r7, #8] + 8005b46: 601a str r2, [r3, #0] + *desc->tab = memp; + 8005b48: 687b ldr r3, [r7, #4] + 8005b4a: 689b ldr r3, [r3, #8] + 8005b4c: 68ba ldr r2, [r7, #8] + 8005b4e: 601a str r2, [r3, #0] +#if MEMP_OVERFLOW_CHECK + memp_overflow_init_element(memp, desc); +#endif /* MEMP_OVERFLOW_CHECK */ + /* cast through void* to get rid of alignment warnings */ + memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + desc->size + 8005b50: 687b ldr r3, [r7, #4] + 8005b52: 881b ldrh r3, [r3, #0] + 8005b54: 461a mov r2, r3 + 8005b56: 68bb ldr r3, [r7, #8] + 8005b58: 4413 add r3, r2 + 8005b5a: 60bb str r3, [r7, #8] + for (i = 0; i < desc->num; ++i) { + 8005b5c: 68fb ldr r3, [r7, #12] + 8005b5e: 3301 adds r3, #1 + 8005b60: 60fb str r3, [r7, #12] + 8005b62: 687b ldr r3, [r7, #4] + 8005b64: 885b ldrh r3, [r3, #2] + 8005b66: 461a mov r2, r3 + 8005b68: 68fb ldr r3, [r7, #12] + 8005b6a: 4293 cmp r3, r2 + 8005b6c: dbe7 blt.n 8005b3e +#endif /* !MEMP_MEM_MALLOC */ + +#if MEMP_STATS && (defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY) + desc->stats->name = desc->desc; +#endif /* MEMP_STATS && (defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY) */ +} + 8005b6e: bf00 nop + 8005b70: bf00 nop + 8005b72: 3714 adds r7, #20 + 8005b74: 46bd mov sp, r7 + 8005b76: f85d 7b04 ldr.w r7, [sp], #4 + 8005b7a: 4770 bx lr + +08005b7c : + * + * Carves out memp_memory into linked lists for each pool-type. + */ +void +memp_init(void) +{ + 8005b7c: b580 push {r7, lr} + 8005b7e: b082 sub sp, #8 + 8005b80: af00 add r7, sp, #0 + u16_t i; + + /* for every pool: */ + for (i = 0; i < LWIP_ARRAYSIZE(memp_pools); i++) { + 8005b82: 2300 movs r3, #0 + 8005b84: 80fb strh r3, [r7, #6] + 8005b86: e009 b.n 8005b9c + memp_init_pool(memp_pools[i]); + 8005b88: 88fb ldrh r3, [r7, #6] + 8005b8a: 4a08 ldr r2, [pc, #32] @ (8005bac ) + 8005b8c: f852 3023 ldr.w r3, [r2, r3, lsl #2] + 8005b90: 4618 mov r0, r3 + 8005b92: f7ff ffc3 bl 8005b1c + for (i = 0; i < LWIP_ARRAYSIZE(memp_pools); i++) { + 8005b96: 88fb ldrh r3, [r7, #6] + 8005b98: 3301 adds r3, #1 + 8005b9a: 80fb strh r3, [r7, #6] + 8005b9c: 88fb ldrh r3, [r7, #6] + 8005b9e: 2b08 cmp r3, #8 + 8005ba0: d9f2 bls.n 8005b88 + +#if MEMP_OVERFLOW_CHECK >= 2 + /* check everything a first time to see if it worked */ + memp_overflow_check_all(); +#endif /* MEMP_OVERFLOW_CHECK >= 2 */ +} + 8005ba2: bf00 nop + 8005ba4: bf00 nop + 8005ba6: 3708 adds r7, #8 + 8005ba8: 46bd mov sp, r7 + 8005baa: bd80 pop {r7, pc} + 8005bac: 08018e60 .word 0x08018e60 + +08005bb0 : +#if !MEMP_OVERFLOW_CHECK +do_memp_malloc_pool(const struct memp_desc *desc) +#else +do_memp_malloc_pool_fn(const struct memp_desc *desc, const char *file, const int line) +#endif +{ + 8005bb0: b580 push {r7, lr} + 8005bb2: b084 sub sp, #16 + 8005bb4: af00 add r7, sp, #0 + 8005bb6: 6078 str r0, [r7, #4] + memp = (struct memp *)mem_malloc(MEMP_SIZE + MEMP_ALIGN_SIZE(desc->size)); + SYS_ARCH_PROTECT(old_level); +#else /* MEMP_MEM_MALLOC */ + SYS_ARCH_PROTECT(old_level); + + memp = *desc->tab; + 8005bb8: 687b ldr r3, [r7, #4] + 8005bba: 689b ldr r3, [r3, #8] + 8005bbc: 681b ldr r3, [r3, #0] + 8005bbe: 60fb str r3, [r7, #12] +#endif /* MEMP_MEM_MALLOC */ + + if (memp != NULL) { + 8005bc0: 68fb ldr r3, [r7, #12] + 8005bc2: 2b00 cmp r3, #0 + 8005bc4: d012 beq.n 8005bec +#if !MEMP_MEM_MALLOC +#if MEMP_OVERFLOW_CHECK == 1 + memp_overflow_check_element(memp, desc); +#endif /* MEMP_OVERFLOW_CHECK */ + + *desc->tab = memp->next; + 8005bc6: 687b ldr r3, [r7, #4] + 8005bc8: 689b ldr r3, [r3, #8] + 8005bca: 68fa ldr r2, [r7, #12] + 8005bcc: 6812 ldr r2, [r2, #0] + 8005bce: 601a str r2, [r3, #0] + memp->line = line; +#if MEMP_MEM_MALLOC + memp_overflow_init_element(memp, desc); +#endif /* MEMP_MEM_MALLOC */ +#endif /* MEMP_OVERFLOW_CHECK */ + LWIP_ASSERT("memp_malloc: memp properly aligned", + 8005bd0: 68fb ldr r3, [r7, #12] + 8005bd2: f003 0303 and.w r3, r3, #3 + 8005bd6: 2b00 cmp r3, #0 + 8005bd8: d006 beq.n 8005be8 + 8005bda: 4b07 ldr r3, [pc, #28] @ (8005bf8 ) + 8005bdc: f44f 728c mov.w r2, #280 @ 0x118 + 8005be0: 4906 ldr r1, [pc, #24] @ (8005bfc ) + 8005be2: 4807 ldr r0, [pc, #28] @ (8005c00 ) + 8005be4: f00b fd08 bl 80115f8 + desc->stats->max = desc->stats->used; + } +#endif + SYS_ARCH_UNPROTECT(old_level); + /* cast through u8_t* to get rid of alignment warnings */ + return ((u8_t *)memp + MEMP_SIZE); + 8005be8: 68fb ldr r3, [r7, #12] + 8005bea: e000 b.n 8005bee +#endif + SYS_ARCH_UNPROTECT(old_level); + LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", desc->desc)); + } + + return NULL; + 8005bec: 2300 movs r3, #0 +} + 8005bee: 4618 mov r0, r3 + 8005bf0: 3710 adds r7, #16 + 8005bf2: 46bd mov sp, r7 + 8005bf4: bd80 pop {r7, pc} + 8005bf6: bf00 nop + 8005bf8: 08016298 .word 0x08016298 + 8005bfc: 080162c8 .word 0x080162c8 + 8005c00: 080162ec .word 0x080162ec + +08005c04 : +#if !MEMP_OVERFLOW_CHECK +memp_malloc_pool(const struct memp_desc *desc) +#else +memp_malloc_pool_fn(const struct memp_desc *desc, const char *file, const int line) +#endif +{ + 8005c04: b580 push {r7, lr} + 8005c06: b082 sub sp, #8 + 8005c08: af00 add r7, sp, #0 + 8005c0a: 6078 str r0, [r7, #4] + LWIP_ASSERT("invalid pool desc", desc != NULL); + 8005c0c: 687b ldr r3, [r7, #4] + 8005c0e: 2b00 cmp r3, #0 + 8005c10: d106 bne.n 8005c20 + 8005c12: 4b0a ldr r3, [pc, #40] @ (8005c3c ) + 8005c14: f44f 729e mov.w r2, #316 @ 0x13c + 8005c18: 4909 ldr r1, [pc, #36] @ (8005c40 ) + 8005c1a: 480a ldr r0, [pc, #40] @ (8005c44 ) + 8005c1c: f00b fcec bl 80115f8 + if (desc == NULL) { + 8005c20: 687b ldr r3, [r7, #4] + 8005c22: 2b00 cmp r3, #0 + 8005c24: d101 bne.n 8005c2a + return NULL; + 8005c26: 2300 movs r3, #0 + 8005c28: e003 b.n 8005c32 + } + +#if !MEMP_OVERFLOW_CHECK + return do_memp_malloc_pool(desc); + 8005c2a: 6878 ldr r0, [r7, #4] + 8005c2c: f7ff ffc0 bl 8005bb0 + 8005c30: 4603 mov r3, r0 +#else + return do_memp_malloc_pool_fn(desc, file, line); +#endif +} + 8005c32: 4618 mov r0, r3 + 8005c34: 3708 adds r7, #8 + 8005c36: 46bd mov sp, r7 + 8005c38: bd80 pop {r7, pc} + 8005c3a: bf00 nop + 8005c3c: 08016298 .word 0x08016298 + 8005c40: 08016314 .word 0x08016314 + 8005c44: 080162ec .word 0x080162ec + +08005c48 : +#if !MEMP_OVERFLOW_CHECK +memp_malloc(memp_t type) +#else +memp_malloc_fn(memp_t type, const char *file, const int line) +#endif +{ + 8005c48: b580 push {r7, lr} + 8005c4a: b084 sub sp, #16 + 8005c4c: af00 add r7, sp, #0 + 8005c4e: 4603 mov r3, r0 + 8005c50: 71fb strb r3, [r7, #7] + void *memp; + LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;); + 8005c52: 79fb ldrb r3, [r7, #7] + 8005c54: 2b08 cmp r3, #8 + 8005c56: d908 bls.n 8005c6a + 8005c58: 4b0a ldr r3, [pc, #40] @ (8005c84 ) + 8005c5a: f240 1257 movw r2, #343 @ 0x157 + 8005c5e: 490a ldr r1, [pc, #40] @ (8005c88 ) + 8005c60: 480a ldr r0, [pc, #40] @ (8005c8c ) + 8005c62: f00b fcc9 bl 80115f8 + 8005c66: 2300 movs r3, #0 + 8005c68: e008 b.n 8005c7c +#if MEMP_OVERFLOW_CHECK >= 2 + memp_overflow_check_all(); +#endif /* MEMP_OVERFLOW_CHECK >= 2 */ + +#if !MEMP_OVERFLOW_CHECK + memp = do_memp_malloc_pool(memp_pools[type]); + 8005c6a: 79fb ldrb r3, [r7, #7] + 8005c6c: 4a08 ldr r2, [pc, #32] @ (8005c90 ) + 8005c6e: f852 3023 ldr.w r3, [r2, r3, lsl #2] + 8005c72: 4618 mov r0, r3 + 8005c74: f7ff ff9c bl 8005bb0 + 8005c78: 60f8 str r0, [r7, #12] +#else + memp = do_memp_malloc_pool_fn(memp_pools[type], file, line); +#endif + + return memp; + 8005c7a: 68fb ldr r3, [r7, #12] +} + 8005c7c: 4618 mov r0, r3 + 8005c7e: 3710 adds r7, #16 + 8005c80: 46bd mov sp, r7 + 8005c82: bd80 pop {r7, pc} + 8005c84: 08016298 .word 0x08016298 + 8005c88: 08016328 .word 0x08016328 + 8005c8c: 080162ec .word 0x080162ec + 8005c90: 08018e60 .word 0x08018e60 + +08005c94 : + +static void +do_memp_free_pool(const struct memp_desc *desc, void *mem) +{ + 8005c94: b580 push {r7, lr} + 8005c96: b084 sub sp, #16 + 8005c98: af00 add r7, sp, #0 + 8005c9a: 6078 str r0, [r7, #4] + 8005c9c: 6039 str r1, [r7, #0] + struct memp *memp; + SYS_ARCH_DECL_PROTECT(old_level); + + LWIP_ASSERT("memp_free: mem properly aligned", + 8005c9e: 683b ldr r3, [r7, #0] + 8005ca0: f003 0303 and.w r3, r3, #3 + 8005ca4: 2b00 cmp r3, #0 + 8005ca6: d006 beq.n 8005cb6 + 8005ca8: 4b0a ldr r3, [pc, #40] @ (8005cd4 ) + 8005caa: f44f 72b6 mov.w r2, #364 @ 0x16c + 8005cae: 490a ldr r1, [pc, #40] @ (8005cd8 ) + 8005cb0: 480a ldr r0, [pc, #40] @ (8005cdc ) + 8005cb2: f00b fca1 bl 80115f8 + ((mem_ptr_t)mem % MEM_ALIGNMENT) == 0); + + /* cast through void* to get rid of alignment warnings */ + memp = (struct memp *)(void *)((u8_t *)mem - MEMP_SIZE); + 8005cb6: 683b ldr r3, [r7, #0] + 8005cb8: 60fb str r3, [r7, #12] +#if MEMP_MEM_MALLOC + LWIP_UNUSED_ARG(desc); + SYS_ARCH_UNPROTECT(old_level); + mem_free(memp); +#else /* MEMP_MEM_MALLOC */ + memp->next = *desc->tab; + 8005cba: 687b ldr r3, [r7, #4] + 8005cbc: 689b ldr r3, [r3, #8] + 8005cbe: 681a ldr r2, [r3, #0] + 8005cc0: 68fb ldr r3, [r7, #12] + 8005cc2: 601a str r2, [r3, #0] + *desc->tab = memp; + 8005cc4: 687b ldr r3, [r7, #4] + 8005cc6: 689b ldr r3, [r3, #8] + 8005cc8: 68fa ldr r2, [r7, #12] + 8005cca: 601a str r2, [r3, #0] + LWIP_ASSERT("memp sanity", memp_sanity(desc)); +#endif /* MEMP_SANITY_CHECK */ + + SYS_ARCH_UNPROTECT(old_level); +#endif /* !MEMP_MEM_MALLOC */ +} + 8005ccc: bf00 nop + 8005cce: 3710 adds r7, #16 + 8005cd0: 46bd mov sp, r7 + 8005cd2: bd80 pop {r7, pc} + 8005cd4: 08016298 .word 0x08016298 + 8005cd8: 08016348 .word 0x08016348 + 8005cdc: 080162ec .word 0x080162ec + +08005ce0 : + * @param desc the pool where to put mem + * @param mem the memp element to free + */ +void +memp_free_pool(const struct memp_desc *desc, void *mem) +{ + 8005ce0: b580 push {r7, lr} + 8005ce2: b082 sub sp, #8 + 8005ce4: af00 add r7, sp, #0 + 8005ce6: 6078 str r0, [r7, #4] + 8005ce8: 6039 str r1, [r7, #0] + LWIP_ASSERT("invalid pool desc", desc != NULL); + 8005cea: 687b ldr r3, [r7, #4] + 8005cec: 2b00 cmp r3, #0 + 8005cee: d106 bne.n 8005cfe + 8005cf0: 4b0a ldr r3, [pc, #40] @ (8005d1c ) + 8005cf2: f240 1295 movw r2, #405 @ 0x195 + 8005cf6: 490a ldr r1, [pc, #40] @ (8005d20 ) + 8005cf8: 480a ldr r0, [pc, #40] @ (8005d24 ) + 8005cfa: f00b fc7d bl 80115f8 + if ((desc == NULL) || (mem == NULL)) { + 8005cfe: 687b ldr r3, [r7, #4] + 8005d00: 2b00 cmp r3, #0 + 8005d02: d007 beq.n 8005d14 + 8005d04: 683b ldr r3, [r7, #0] + 8005d06: 2b00 cmp r3, #0 + 8005d08: d004 beq.n 8005d14 + return; + } + + do_memp_free_pool(desc, mem); + 8005d0a: 6839 ldr r1, [r7, #0] + 8005d0c: 6878 ldr r0, [r7, #4] + 8005d0e: f7ff ffc1 bl 8005c94 + 8005d12: e000 b.n 8005d16 + return; + 8005d14: bf00 nop +} + 8005d16: 3708 adds r7, #8 + 8005d18: 46bd mov sp, r7 + 8005d1a: bd80 pop {r7, pc} + 8005d1c: 08016298 .word 0x08016298 + 8005d20: 08016314 .word 0x08016314 + 8005d24: 080162ec .word 0x080162ec + +08005d28 : + * @param type the pool where to put mem + * @param mem the memp element to free + */ +void +memp_free(memp_t type, void *mem) +{ + 8005d28: b580 push {r7, lr} + 8005d2a: b082 sub sp, #8 + 8005d2c: af00 add r7, sp, #0 + 8005d2e: 4603 mov r3, r0 + 8005d30: 6039 str r1, [r7, #0] + 8005d32: 71fb strb r3, [r7, #7] +#ifdef LWIP_HOOK_MEMP_AVAILABLE + struct memp *old_first; +#endif + + LWIP_ERROR("memp_free: type < MEMP_MAX", (type < MEMP_MAX), return;); + 8005d34: 79fb ldrb r3, [r7, #7] + 8005d36: 2b08 cmp r3, #8 + 8005d38: d907 bls.n 8005d4a + 8005d3a: 4b0c ldr r3, [pc, #48] @ (8005d6c ) + 8005d3c: f44f 72d5 mov.w r2, #426 @ 0x1aa + 8005d40: 490b ldr r1, [pc, #44] @ (8005d70 ) + 8005d42: 480c ldr r0, [pc, #48] @ (8005d74 ) + 8005d44: f00b fc58 bl 80115f8 + 8005d48: e00c b.n 8005d64 + + if (mem == NULL) { + 8005d4a: 683b ldr r3, [r7, #0] + 8005d4c: 2b00 cmp r3, #0 + 8005d4e: d008 beq.n 8005d62 + +#ifdef LWIP_HOOK_MEMP_AVAILABLE + old_first = *memp_pools[type]->tab; +#endif + + do_memp_free_pool(memp_pools[type], mem); + 8005d50: 79fb ldrb r3, [r7, #7] + 8005d52: 4a09 ldr r2, [pc, #36] @ (8005d78 ) + 8005d54: f852 3023 ldr.w r3, [r2, r3, lsl #2] + 8005d58: 6839 ldr r1, [r7, #0] + 8005d5a: 4618 mov r0, r3 + 8005d5c: f7ff ff9a bl 8005c94 + 8005d60: e000 b.n 8005d64 + return; + 8005d62: bf00 nop +#ifdef LWIP_HOOK_MEMP_AVAILABLE + if (old_first == NULL) { + LWIP_HOOK_MEMP_AVAILABLE(type); + } +#endif +} + 8005d64: 3708 adds r7, #8 + 8005d66: 46bd mov sp, r7 + 8005d68: bd80 pop {r7, pc} + 8005d6a: bf00 nop + 8005d6c: 08016298 .word 0x08016298 + 8005d70: 08016368 .word 0x08016368 + 8005d74: 080162ec .word 0x080162ec + 8005d78: 08018e60 .word 0x08018e60 + +08005d7c : +} +#endif /* LWIP_HAVE_LOOPIF */ + +void +netif_init(void) +{ + 8005d7c: b480 push {r7} + 8005d7e: af00 add r7, sp, #0 + + netif_set_link_up(&loop_netif); + netif_set_up(&loop_netif); + +#endif /* LWIP_HAVE_LOOPIF */ +} + 8005d80: bf00 nop + 8005d82: 46bd mov sp, r7 + 8005d84: f85d 7b04 ldr.w r7, [sp], #4 + 8005d88: 4770 bx lr + ... + +08005d8c : +netif_add(struct netif *netif, +#if LWIP_IPV4 + const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, +#endif /* LWIP_IPV4 */ + void *state, netif_init_fn init, netif_input_fn input) +{ + 8005d8c: b580 push {r7, lr} + 8005d8e: b086 sub sp, #24 + 8005d90: af00 add r7, sp, #0 + 8005d92: 60f8 str r0, [r7, #12] + 8005d94: 60b9 str r1, [r7, #8] + 8005d96: 607a str r2, [r7, #4] + 8005d98: 603b str r3, [r7, #0] + LWIP_ASSERT("single netif already set", 0); + return NULL; + } +#endif + + LWIP_ERROR("netif_add: invalid netif", netif != NULL, return NULL); + 8005d9a: 68fb ldr r3, [r7, #12] + 8005d9c: 2b00 cmp r3, #0 + 8005d9e: d108 bne.n 8005db2 + 8005da0: 4b5b ldr r3, [pc, #364] @ (8005f10 ) + 8005da2: f240 1227 movw r2, #295 @ 0x127 + 8005da6: 495b ldr r1, [pc, #364] @ (8005f14 ) + 8005da8: 485b ldr r0, [pc, #364] @ (8005f18 ) + 8005daa: f00b fc25 bl 80115f8 + 8005dae: 2300 movs r3, #0 + 8005db0: e0a9 b.n 8005f06 + LWIP_ERROR("netif_add: No init function given", init != NULL, return NULL); + 8005db2: 6a7b ldr r3, [r7, #36] @ 0x24 + 8005db4: 2b00 cmp r3, #0 + 8005db6: d108 bne.n 8005dca + 8005db8: 4b55 ldr r3, [pc, #340] @ (8005f10 ) + 8005dba: f44f 7294 mov.w r2, #296 @ 0x128 + 8005dbe: 4957 ldr r1, [pc, #348] @ (8005f1c ) + 8005dc0: 4855 ldr r0, [pc, #340] @ (8005f18 ) + 8005dc2: f00b fc19 bl 80115f8 + 8005dc6: 2300 movs r3, #0 + 8005dc8: e09d b.n 8005f06 + +#if LWIP_IPV4 + if (ipaddr == NULL) { + 8005dca: 68bb ldr r3, [r7, #8] + 8005dcc: 2b00 cmp r3, #0 + 8005dce: d101 bne.n 8005dd4 + ipaddr = ip_2_ip4(IP4_ADDR_ANY); + 8005dd0: 4b53 ldr r3, [pc, #332] @ (8005f20 ) + 8005dd2: 60bb str r3, [r7, #8] + } + if (netmask == NULL) { + 8005dd4: 687b ldr r3, [r7, #4] + 8005dd6: 2b00 cmp r3, #0 + 8005dd8: d101 bne.n 8005dde + netmask = ip_2_ip4(IP4_ADDR_ANY); + 8005dda: 4b51 ldr r3, [pc, #324] @ (8005f20 ) + 8005ddc: 607b str r3, [r7, #4] + } + if (gw == NULL) { + 8005dde: 683b ldr r3, [r7, #0] + 8005de0: 2b00 cmp r3, #0 + 8005de2: d101 bne.n 8005de8 + gw = ip_2_ip4(IP4_ADDR_ANY); + 8005de4: 4b4e ldr r3, [pc, #312] @ (8005f20 ) + 8005de6: 603b str r3, [r7, #0] + } + + /* reset new interface configuration state */ + ip_addr_set_zero_ip4(&netif->ip_addr); + 8005de8: 68fb ldr r3, [r7, #12] + 8005dea: 2200 movs r2, #0 + 8005dec: 605a str r2, [r3, #4] + ip_addr_set_zero_ip4(&netif->netmask); + 8005dee: 68fb ldr r3, [r7, #12] + 8005df0: 2200 movs r2, #0 + 8005df2: 609a str r2, [r3, #8] + ip_addr_set_zero_ip4(&netif->gw); + 8005df4: 68fb ldr r3, [r7, #12] + 8005df6: 2200 movs r2, #0 + 8005df8: 60da str r2, [r3, #12] + netif->output = netif_null_output_ip4; + 8005dfa: 68fb ldr r3, [r7, #12] + 8005dfc: 4a49 ldr r2, [pc, #292] @ (8005f24 ) + 8005dfe: 615a str r2, [r3, #20] +#endif /* LWIP_IPV6_ADDRESS_LIFETIMES */ + } + netif->output_ip6 = netif_null_output_ip6; +#endif /* LWIP_IPV6 */ + NETIF_SET_CHECKSUM_CTRL(netif, NETIF_CHECKSUM_ENABLE_ALL); + netif->mtu = 0; + 8005e00: 68fb ldr r3, [r7, #12] + 8005e02: 2200 movs r2, #0 + 8005e04: 851a strh r2, [r3, #40] @ 0x28 + netif->flags = 0; + 8005e06: 68fb ldr r3, [r7, #12] + 8005e08: 2200 movs r2, #0 + 8005e0a: f883 2031 strb.w r2, [r3, #49] @ 0x31 +#ifdef netif_get_client_data + memset(netif->client_data, 0, sizeof(netif->client_data)); + 8005e0e: 68fb ldr r3, [r7, #12] + 8005e10: 3324 adds r3, #36 @ 0x24 + 8005e12: 2204 movs r2, #4 + 8005e14: 2100 movs r1, #0 + 8005e16: 4618 mov r0, r3 + 8005e18: f00b fc6d bl 80116f6 +#endif /* LWIP_IPV6 */ +#if LWIP_NETIF_STATUS_CALLBACK + netif->status_callback = NULL; +#endif /* LWIP_NETIF_STATUS_CALLBACK */ +#if LWIP_NETIF_LINK_CALLBACK + netif->link_callback = NULL; + 8005e1c: 68fb ldr r3, [r7, #12] + 8005e1e: 2200 movs r2, #0 + 8005e20: 61da str r2, [r3, #28] + netif->loop_first = NULL; + netif->loop_last = NULL; +#endif /* ENABLE_LOOPBACK */ + + /* remember netif specific state information data */ + netif->state = state; + 8005e22: 68fb ldr r3, [r7, #12] + 8005e24: 6a3a ldr r2, [r7, #32] + 8005e26: 621a str r2, [r3, #32] + netif->num = netif_num; + 8005e28: 4b3f ldr r3, [pc, #252] @ (8005f28 ) + 8005e2a: 781a ldrb r2, [r3, #0] + 8005e2c: 68fb ldr r3, [r7, #12] + 8005e2e: f883 2034 strb.w r2, [r3, #52] @ 0x34 + netif->input = input; + 8005e32: 68fb ldr r3, [r7, #12] + 8005e34: 6aba ldr r2, [r7, #40] @ 0x28 + 8005e36: 611a str r2, [r3, #16] +#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS + netif->loop_cnt_current = 0; +#endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */ + +#if LWIP_IPV4 + netif_set_addr(netif, ipaddr, netmask, gw); + 8005e38: 683b ldr r3, [r7, #0] + 8005e3a: 687a ldr r2, [r7, #4] + 8005e3c: 68b9 ldr r1, [r7, #8] + 8005e3e: 68f8 ldr r0, [r7, #12] + 8005e40: f000 f914 bl 800606c +#endif /* LWIP_IPV4 */ + + /* call user specified initialization function for netif */ + if (init(netif) != ERR_OK) { + 8005e44: 6a7b ldr r3, [r7, #36] @ 0x24 + 8005e46: 68f8 ldr r0, [r7, #12] + 8005e48: 4798 blx r3 + 8005e4a: 4603 mov r3, r0 + 8005e4c: 2b00 cmp r3, #0 + 8005e4e: d001 beq.n 8005e54 + return NULL; + 8005e50: 2300 movs r3, #0 + 8005e52: e058 b.n 8005f06 + */ + { + struct netif *netif2; + int num_netifs; + do { + if (netif->num == 255) { + 8005e54: 68fb ldr r3, [r7, #12] + 8005e56: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8005e5a: 2bff cmp r3, #255 @ 0xff + 8005e5c: d103 bne.n 8005e66 + netif->num = 0; + 8005e5e: 68fb ldr r3, [r7, #12] + 8005e60: 2200 movs r2, #0 + 8005e62: f883 2034 strb.w r2, [r3, #52] @ 0x34 + } + num_netifs = 0; + 8005e66: 2300 movs r3, #0 + 8005e68: 613b str r3, [r7, #16] + for (netif2 = netif_list; netif2 != NULL; netif2 = netif2->next) { + 8005e6a: 4b30 ldr r3, [pc, #192] @ (8005f2c ) + 8005e6c: 681b ldr r3, [r3, #0] + 8005e6e: 617b str r3, [r7, #20] + 8005e70: e02b b.n 8005eca + LWIP_ASSERT("netif already added", netif2 != netif); + 8005e72: 697a ldr r2, [r7, #20] + 8005e74: 68fb ldr r3, [r7, #12] + 8005e76: 429a cmp r2, r3 + 8005e78: d106 bne.n 8005e88 + 8005e7a: 4b25 ldr r3, [pc, #148] @ (8005f10 ) + 8005e7c: f240 128b movw r2, #395 @ 0x18b + 8005e80: 492b ldr r1, [pc, #172] @ (8005f30 ) + 8005e82: 4825 ldr r0, [pc, #148] @ (8005f18 ) + 8005e84: f00b fbb8 bl 80115f8 + num_netifs++; + 8005e88: 693b ldr r3, [r7, #16] + 8005e8a: 3301 adds r3, #1 + 8005e8c: 613b str r3, [r7, #16] + LWIP_ASSERT("too many netifs, max. supported number is 255", num_netifs <= 255); + 8005e8e: 693b ldr r3, [r7, #16] + 8005e90: 2bff cmp r3, #255 @ 0xff + 8005e92: dd06 ble.n 8005ea2 + 8005e94: 4b1e ldr r3, [pc, #120] @ (8005f10 ) + 8005e96: f240 128d movw r2, #397 @ 0x18d + 8005e9a: 4926 ldr r1, [pc, #152] @ (8005f34 ) + 8005e9c: 481e ldr r0, [pc, #120] @ (8005f18 ) + 8005e9e: f00b fbab bl 80115f8 + if (netif2->num == netif->num) { + 8005ea2: 697b ldr r3, [r7, #20] + 8005ea4: f893 2034 ldrb.w r2, [r3, #52] @ 0x34 + 8005ea8: 68fb ldr r3, [r7, #12] + 8005eaa: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8005eae: 429a cmp r2, r3 + 8005eb0: d108 bne.n 8005ec4 + netif->num++; + 8005eb2: 68fb ldr r3, [r7, #12] + 8005eb4: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8005eb8: 3301 adds r3, #1 + 8005eba: b2da uxtb r2, r3 + 8005ebc: 68fb ldr r3, [r7, #12] + 8005ebe: f883 2034 strb.w r2, [r3, #52] @ 0x34 + break; + 8005ec2: e005 b.n 8005ed0 + for (netif2 = netif_list; netif2 != NULL; netif2 = netif2->next) { + 8005ec4: 697b ldr r3, [r7, #20] + 8005ec6: 681b ldr r3, [r3, #0] + 8005ec8: 617b str r3, [r7, #20] + 8005eca: 697b ldr r3, [r7, #20] + 8005ecc: 2b00 cmp r3, #0 + 8005ece: d1d0 bne.n 8005e72 + } + } + } while (netif2 != NULL); + 8005ed0: 697b ldr r3, [r7, #20] + 8005ed2: 2b00 cmp r3, #0 + 8005ed4: d1be bne.n 8005e54 + } + if (netif->num == 254) { + 8005ed6: 68fb ldr r3, [r7, #12] + 8005ed8: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8005edc: 2bfe cmp r3, #254 @ 0xfe + 8005ede: d103 bne.n 8005ee8 + netif_num = 0; + 8005ee0: 4b11 ldr r3, [pc, #68] @ (8005f28 ) + 8005ee2: 2200 movs r2, #0 + 8005ee4: 701a strb r2, [r3, #0] + 8005ee6: e006 b.n 8005ef6 + } else { + netif_num = (u8_t)(netif->num + 1); + 8005ee8: 68fb ldr r3, [r7, #12] + 8005eea: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8005eee: 3301 adds r3, #1 + 8005ef0: b2da uxtb r2, r3 + 8005ef2: 4b0d ldr r3, [pc, #52] @ (8005f28 ) + 8005ef4: 701a strb r2, [r3, #0] + } + + /* add this netif to the list */ + netif->next = netif_list; + 8005ef6: 4b0d ldr r3, [pc, #52] @ (8005f2c ) + 8005ef8: 681a ldr r2, [r3, #0] + 8005efa: 68fb ldr r3, [r7, #12] + 8005efc: 601a str r2, [r3, #0] + netif_list = netif; + 8005efe: 4a0b ldr r2, [pc, #44] @ (8005f2c ) + 8005f00: 68fb ldr r3, [r7, #12] + 8005f02: 6013 str r3, [r2, #0] +#endif /* LWIP_IPV4 */ + LWIP_DEBUGF(NETIF_DEBUG, ("\n")); + + netif_invoke_ext_callback(netif, LWIP_NSC_NETIF_ADDED, NULL); + + return netif; + 8005f04: 68fb ldr r3, [r7, #12] +} + 8005f06: 4618 mov r0, r3 + 8005f08: 3718 adds r7, #24 + 8005f0a: 46bd mov sp, r7 + 8005f0c: bd80 pop {r7, pc} + 8005f0e: bf00 nop + 8005f10: 08016384 .word 0x08016384 + 8005f14: 08016418 .word 0x08016418 + 8005f18: 080163d4 .word 0x080163d4 + 8005f1c: 08016434 .word 0x08016434 + 8005f20: 08018ed4 .word 0x08018ed4 + 8005f24: 0800634f .word 0x0800634f + 8005f28: 200190a0 .word 0x200190a0 + 8005f2c: 20019098 .word 0x20019098 + 8005f30: 08016458 .word 0x08016458 + 8005f34: 0801646c .word 0x0801646c + +08005f38 : + +static void +netif_do_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr) +{ + 8005f38: b580 push {r7, lr} + 8005f3a: b082 sub sp, #8 + 8005f3c: af00 add r7, sp, #0 + 8005f3e: 6078 str r0, [r7, #4] + 8005f40: 6039 str r1, [r7, #0] +#if LWIP_TCP + tcp_netif_ip_addr_changed(old_addr, new_addr); + 8005f42: 6839 ldr r1, [r7, #0] + 8005f44: 6878 ldr r0, [r7, #4] + 8005f46: f002 fb57 bl 80085f8 +#endif /* LWIP_TCP */ +#if LWIP_UDP + udp_netif_ip_addr_changed(old_addr, new_addr); + 8005f4a: 6839 ldr r1, [r7, #0] + 8005f4c: 6878 ldr r0, [r7, #4] + 8005f4e: f006 ff93 bl 800ce78 +#endif /* LWIP_UDP */ +#if LWIP_RAW + raw_netif_ip_addr_changed(old_addr, new_addr); +#endif /* LWIP_RAW */ +} + 8005f52: bf00 nop + 8005f54: 3708 adds r7, #8 + 8005f56: 46bd mov sp, r7 + 8005f58: bd80 pop {r7, pc} + ... + +08005f5c : + +#if LWIP_IPV4 +static int +netif_do_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr, ip_addr_t *old_addr) +{ + 8005f5c: b580 push {r7, lr} + 8005f5e: b086 sub sp, #24 + 8005f60: af00 add r7, sp, #0 + 8005f62: 60f8 str r0, [r7, #12] + 8005f64: 60b9 str r1, [r7, #8] + 8005f66: 607a str r2, [r7, #4] + LWIP_ASSERT("invalid pointer", ipaddr != NULL); + 8005f68: 68bb ldr r3, [r7, #8] + 8005f6a: 2b00 cmp r3, #0 + 8005f6c: d106 bne.n 8005f7c + 8005f6e: 4b1d ldr r3, [pc, #116] @ (8005fe4 ) + 8005f70: f240 12cb movw r2, #459 @ 0x1cb + 8005f74: 491c ldr r1, [pc, #112] @ (8005fe8 ) + 8005f76: 481d ldr r0, [pc, #116] @ (8005fec ) + 8005f78: f00b fb3e bl 80115f8 + LWIP_ASSERT("invalid pointer", old_addr != NULL); + 8005f7c: 687b ldr r3, [r7, #4] + 8005f7e: 2b00 cmp r3, #0 + 8005f80: d106 bne.n 8005f90 + 8005f82: 4b18 ldr r3, [pc, #96] @ (8005fe4 ) + 8005f84: f44f 72e6 mov.w r2, #460 @ 0x1cc + 8005f88: 4917 ldr r1, [pc, #92] @ (8005fe8 ) + 8005f8a: 4818 ldr r0, [pc, #96] @ (8005fec ) + 8005f8c: f00b fb34 bl 80115f8 + + /* address is actually being changed? */ + if (ip4_addr_cmp(ipaddr, netif_ip4_addr(netif)) == 0) { + 8005f90: 68bb ldr r3, [r7, #8] + 8005f92: 681a ldr r2, [r3, #0] + 8005f94: 68fb ldr r3, [r7, #12] + 8005f96: 3304 adds r3, #4 + 8005f98: 681b ldr r3, [r3, #0] + 8005f9a: 429a cmp r2, r3 + 8005f9c: d01c beq.n 8005fd8 + ip_addr_t new_addr; + *ip_2_ip4(&new_addr) = *ipaddr; + 8005f9e: 68bb ldr r3, [r7, #8] + 8005fa0: 681b ldr r3, [r3, #0] + 8005fa2: 617b str r3, [r7, #20] + IP_SET_TYPE_VAL(new_addr, IPADDR_TYPE_V4); + + ip_addr_copy(*old_addr, *netif_ip_addr4(netif)); + 8005fa4: 68fb ldr r3, [r7, #12] + 8005fa6: 3304 adds r3, #4 + 8005fa8: 681a ldr r2, [r3, #0] + 8005faa: 687b ldr r3, [r7, #4] + 8005fac: 601a str r2, [r3, #0] + + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n")); + netif_do_ip_addr_changed(old_addr, &new_addr); + 8005fae: f107 0314 add.w r3, r7, #20 + 8005fb2: 4619 mov r1, r3 + 8005fb4: 6878 ldr r0, [r7, #4] + 8005fb6: f7ff ffbf bl 8005f38 + + mib2_remove_ip4(netif); + mib2_remove_route_ip4(0, netif); + /* set new IP address to netif */ + ip4_addr_set(ip_2_ip4(&netif->ip_addr), ipaddr); + 8005fba: 68bb ldr r3, [r7, #8] + 8005fbc: 2b00 cmp r3, #0 + 8005fbe: d002 beq.n 8005fc6 + 8005fc0: 68bb ldr r3, [r7, #8] + 8005fc2: 681b ldr r3, [r3, #0] + 8005fc4: e000 b.n 8005fc8 + 8005fc6: 2300 movs r3, #0 + 8005fc8: 68fa ldr r2, [r7, #12] + 8005fca: 6053 str r3, [r2, #4] + IP_SET_TYPE_VAL(netif->ip_addr, IPADDR_TYPE_V4); + mib2_add_ip4(netif); + mib2_add_route_ip4(0, netif); + + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4); + 8005fcc: 2101 movs r1, #1 + 8005fce: 68f8 ldr r0, [r7, #12] + 8005fd0: f000 f8d2 bl 8006178 + + NETIF_STATUS_CALLBACK(netif); + return 1; /* address changed */ + 8005fd4: 2301 movs r3, #1 + 8005fd6: e000 b.n 8005fda + } + return 0; /* address unchanged */ + 8005fd8: 2300 movs r3, #0 +} + 8005fda: 4618 mov r0, r3 + 8005fdc: 3718 adds r7, #24 + 8005fde: 46bd mov sp, r7 + 8005fe0: bd80 pop {r7, pc} + 8005fe2: bf00 nop + 8005fe4: 08016384 .word 0x08016384 + 8005fe8: 0801649c .word 0x0801649c + 8005fec: 080163d4 .word 0x080163d4 + +08005ff0 : + } +} + +static int +netif_do_set_netmask(struct netif *netif, const ip4_addr_t *netmask, ip_addr_t *old_nm) +{ + 8005ff0: b480 push {r7} + 8005ff2: b085 sub sp, #20 + 8005ff4: af00 add r7, sp, #0 + 8005ff6: 60f8 str r0, [r7, #12] + 8005ff8: 60b9 str r1, [r7, #8] + 8005ffa: 607a str r2, [r7, #4] + /* address is actually being changed? */ + if (ip4_addr_cmp(netmask, netif_ip4_netmask(netif)) == 0) { + 8005ffc: 68bb ldr r3, [r7, #8] + 8005ffe: 681a ldr r2, [r3, #0] + 8006000: 68fb ldr r3, [r7, #12] + 8006002: 3308 adds r3, #8 + 8006004: 681b ldr r3, [r3, #0] + 8006006: 429a cmp r2, r3 + 8006008: d00a beq.n 8006020 +#else + LWIP_UNUSED_ARG(old_nm); +#endif + mib2_remove_route_ip4(0, netif); + /* set new netmask to netif */ + ip4_addr_set(ip_2_ip4(&netif->netmask), netmask); + 800600a: 68bb ldr r3, [r7, #8] + 800600c: 2b00 cmp r3, #0 + 800600e: d002 beq.n 8006016 + 8006010: 68bb ldr r3, [r7, #8] + 8006012: 681b ldr r3, [r3, #0] + 8006014: e000 b.n 8006018 + 8006016: 2300 movs r3, #0 + 8006018: 68fa ldr r2, [r7, #12] + 800601a: 6093 str r3, [r2, #8] + netif->name[0], netif->name[1], + ip4_addr1_16(netif_ip4_netmask(netif)), + ip4_addr2_16(netif_ip4_netmask(netif)), + ip4_addr3_16(netif_ip4_netmask(netif)), + ip4_addr4_16(netif_ip4_netmask(netif)))); + return 1; /* netmask changed */ + 800601c: 2301 movs r3, #1 + 800601e: e000 b.n 8006022 + } + return 0; /* netmask unchanged */ + 8006020: 2300 movs r3, #0 +} + 8006022: 4618 mov r0, r3 + 8006024: 3714 adds r7, #20 + 8006026: 46bd mov sp, r7 + 8006028: f85d 7b04 ldr.w r7, [sp], #4 + 800602c: 4770 bx lr + +0800602e : + } +} + +static int +netif_do_set_gw(struct netif *netif, const ip4_addr_t *gw, ip_addr_t *old_gw) +{ + 800602e: b480 push {r7} + 8006030: b085 sub sp, #20 + 8006032: af00 add r7, sp, #0 + 8006034: 60f8 str r0, [r7, #12] + 8006036: 60b9 str r1, [r7, #8] + 8006038: 607a str r2, [r7, #4] + /* address is actually being changed? */ + if (ip4_addr_cmp(gw, netif_ip4_gw(netif)) == 0) { + 800603a: 68bb ldr r3, [r7, #8] + 800603c: 681a ldr r2, [r3, #0] + 800603e: 68fb ldr r3, [r7, #12] + 8006040: 330c adds r3, #12 + 8006042: 681b ldr r3, [r3, #0] + 8006044: 429a cmp r2, r3 + 8006046: d00a beq.n 800605e + ip_addr_copy(*old_gw, *netif_ip_gw4(netif)); +#else + LWIP_UNUSED_ARG(old_gw); +#endif + + ip4_addr_set(ip_2_ip4(&netif->gw), gw); + 8006048: 68bb ldr r3, [r7, #8] + 800604a: 2b00 cmp r3, #0 + 800604c: d002 beq.n 8006054 + 800604e: 68bb ldr r3, [r7, #8] + 8006050: 681b ldr r3, [r3, #0] + 8006052: e000 b.n 8006056 + 8006054: 2300 movs r3, #0 + 8006056: 68fa ldr r2, [r7, #12] + 8006058: 60d3 str r3, [r2, #12] + netif->name[0], netif->name[1], + ip4_addr1_16(netif_ip4_gw(netif)), + ip4_addr2_16(netif_ip4_gw(netif)), + ip4_addr3_16(netif_ip4_gw(netif)), + ip4_addr4_16(netif_ip4_gw(netif)))); + return 1; /* gateway changed */ + 800605a: 2301 movs r3, #1 + 800605c: e000 b.n 8006060 + } + return 0; /* gateway unchanged */ + 800605e: 2300 movs r3, #0 +} + 8006060: 4618 mov r0, r3 + 8006062: 3714 adds r7, #20 + 8006064: 46bd mov sp, r7 + 8006066: f85d 7b04 ldr.w r7, [sp], #4 + 800606a: 4770 bx lr + +0800606c : + * @param gw the new default gateway + */ +void +netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, + const ip4_addr_t *gw) +{ + 800606c: b580 push {r7, lr} + 800606e: b088 sub sp, #32 + 8006070: af00 add r7, sp, #0 + 8006072: 60f8 str r0, [r7, #12] + 8006074: 60b9 str r1, [r7, #8] + 8006076: 607a str r2, [r7, #4] + 8006078: 603b str r3, [r7, #0] + ip_addr_t old_nm_val; + ip_addr_t old_gw_val; + ip_addr_t *old_nm = &old_nm_val; + ip_addr_t *old_gw = &old_gw_val; +#else + ip_addr_t *old_nm = NULL; + 800607a: 2300 movs r3, #0 + 800607c: 61fb str r3, [r7, #28] + ip_addr_t *old_gw = NULL; + 800607e: 2300 movs r3, #0 + 8006080: 61bb str r3, [r7, #24] + int remove; + + LWIP_ASSERT_CORE_LOCKED(); + + /* Don't propagate NULL pointer (IPv4 ANY) to subsequent functions */ + if (ipaddr == NULL) { + 8006082: 68bb ldr r3, [r7, #8] + 8006084: 2b00 cmp r3, #0 + 8006086: d101 bne.n 800608c + ipaddr = IP4_ADDR_ANY4; + 8006088: 4b1c ldr r3, [pc, #112] @ (80060fc ) + 800608a: 60bb str r3, [r7, #8] + } + if (netmask == NULL) { + 800608c: 687b ldr r3, [r7, #4] + 800608e: 2b00 cmp r3, #0 + 8006090: d101 bne.n 8006096 + netmask = IP4_ADDR_ANY4; + 8006092: 4b1a ldr r3, [pc, #104] @ (80060fc ) + 8006094: 607b str r3, [r7, #4] + } + if (gw == NULL) { + 8006096: 683b ldr r3, [r7, #0] + 8006098: 2b00 cmp r3, #0 + 800609a: d101 bne.n 80060a0 + gw = IP4_ADDR_ANY4; + 800609c: 4b17 ldr r3, [pc, #92] @ (80060fc ) + 800609e: 603b str r3, [r7, #0] + } + + remove = ip4_addr_isany(ipaddr); + 80060a0: 68bb ldr r3, [r7, #8] + 80060a2: 2b00 cmp r3, #0 + 80060a4: d003 beq.n 80060ae + 80060a6: 68bb ldr r3, [r7, #8] + 80060a8: 681b ldr r3, [r3, #0] + 80060aa: 2b00 cmp r3, #0 + 80060ac: d101 bne.n 80060b2 + 80060ae: 2301 movs r3, #1 + 80060b0: e000 b.n 80060b4 + 80060b2: 2300 movs r3, #0 + 80060b4: 617b str r3, [r7, #20] + if (remove) { + 80060b6: 697b ldr r3, [r7, #20] + 80060b8: 2b00 cmp r3, #0 + 80060ba: d006 beq.n 80060ca + /* when removing an address, we have to remove it *before* changing netmask/gw + to ensure that tcp RST segment can be sent correctly */ + if (netif_do_set_ipaddr(netif, ipaddr, &old_addr)) { + 80060bc: f107 0310 add.w r3, r7, #16 + 80060c0: 461a mov r2, r3 + 80060c2: 68b9 ldr r1, [r7, #8] + 80060c4: 68f8 ldr r0, [r7, #12] + 80060c6: f7ff ff49 bl 8005f5c + change_reason |= LWIP_NSC_IPV4_ADDRESS_CHANGED; + cb_args.ipv4_changed.old_address = &old_addr; +#endif + } + } + if (netif_do_set_netmask(netif, netmask, old_nm)) { + 80060ca: 69fa ldr r2, [r7, #28] + 80060cc: 6879 ldr r1, [r7, #4] + 80060ce: 68f8 ldr r0, [r7, #12] + 80060d0: f7ff ff8e bl 8005ff0 +#if LWIP_NETIF_EXT_STATUS_CALLBACK + change_reason |= LWIP_NSC_IPV4_NETMASK_CHANGED; + cb_args.ipv4_changed.old_netmask = old_nm; +#endif + } + if (netif_do_set_gw(netif, gw, old_gw)) { + 80060d4: 69ba ldr r2, [r7, #24] + 80060d6: 6839 ldr r1, [r7, #0] + 80060d8: 68f8 ldr r0, [r7, #12] + 80060da: f7ff ffa8 bl 800602e +#if LWIP_NETIF_EXT_STATUS_CALLBACK + change_reason |= LWIP_NSC_IPV4_GATEWAY_CHANGED; + cb_args.ipv4_changed.old_gw = old_gw; +#endif + } + if (!remove) { + 80060de: 697b ldr r3, [r7, #20] + 80060e0: 2b00 cmp r3, #0 + 80060e2: d106 bne.n 80060f2 + /* set ipaddr last to ensure netmask/gw have been set when status callback is called */ + if (netif_do_set_ipaddr(netif, ipaddr, &old_addr)) { + 80060e4: f107 0310 add.w r3, r7, #16 + 80060e8: 461a mov r2, r3 + 80060ea: 68b9 ldr r1, [r7, #8] + 80060ec: 68f8 ldr r0, [r7, #12] + 80060ee: f7ff ff35 bl 8005f5c + if (change_reason != LWIP_NSC_NONE) { + change_reason |= LWIP_NSC_IPV4_SETTINGS_CHANGED; + netif_invoke_ext_callback(netif, change_reason, &cb_args); + } +#endif +} + 80060f2: bf00 nop + 80060f4: 3720 adds r7, #32 + 80060f6: 46bd mov sp, r7 + 80060f8: bd80 pop {r7, pc} + 80060fa: bf00 nop + 80060fc: 08018ed4 .word 0x08018ed4 + +08006100 : + * + * @param netif the default network interface + */ +void +netif_set_default(struct netif *netif) +{ + 8006100: b480 push {r7} + 8006102: b083 sub sp, #12 + 8006104: af00 add r7, sp, #0 + 8006106: 6078 str r0, [r7, #4] + mib2_remove_route_ip4(1, netif); + } else { + /* install default route */ + mib2_add_route_ip4(1, netif); + } + netif_default = netif; + 8006108: 4a04 ldr r2, [pc, #16] @ (800611c ) + 800610a: 687b ldr r3, [r7, #4] + 800610c: 6013 str r3, [r2, #0] + LWIP_DEBUGF(NETIF_DEBUG, ("netif: setting default interface %c%c\n", + netif ? netif->name[0] : '\'', netif ? netif->name[1] : '\'')); +} + 800610e: bf00 nop + 8006110: 370c adds r7, #12 + 8006112: 46bd mov sp, r7 + 8006114: f85d 7b04 ldr.w r7, [sp], #4 + 8006118: 4770 bx lr + 800611a: bf00 nop + 800611c: 2001909c .word 0x2001909c + +08006120 : + * Bring an interface up, available for processing + * traffic. + */ +void +netif_set_up(struct netif *netif) +{ + 8006120: b580 push {r7, lr} + 8006122: b082 sub sp, #8 + 8006124: af00 add r7, sp, #0 + 8006126: 6078 str r0, [r7, #4] + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("netif_set_up: invalid netif", netif != NULL, return); + 8006128: 687b ldr r3, [r7, #4] + 800612a: 2b00 cmp r3, #0 + 800612c: d107 bne.n 800613e + 800612e: 4b0f ldr r3, [pc, #60] @ (800616c ) + 8006130: f44f 7254 mov.w r2, #848 @ 0x350 + 8006134: 490e ldr r1, [pc, #56] @ (8006170 ) + 8006136: 480f ldr r0, [pc, #60] @ (8006174 ) + 8006138: f00b fa5e bl 80115f8 + 800613c: e013 b.n 8006166 + + if (!(netif->flags & NETIF_FLAG_UP)) { + 800613e: 687b ldr r3, [r7, #4] + 8006140: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 8006144: f003 0301 and.w r3, r3, #1 + 8006148: 2b00 cmp r3, #0 + 800614a: d10c bne.n 8006166 + netif_set_flags(netif, NETIF_FLAG_UP); + 800614c: 687b ldr r3, [r7, #4] + 800614e: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 8006152: f043 0301 orr.w r3, r3, #1 + 8006156: b2da uxtb r2, r3 + 8006158: 687b ldr r3, [r7, #4] + 800615a: f883 2031 strb.w r2, [r3, #49] @ 0x31 + args.status_changed.state = 1; + netif_invoke_ext_callback(netif, LWIP_NSC_STATUS_CHANGED, &args); + } +#endif + + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4 | NETIF_REPORT_TYPE_IPV6); + 800615e: 2103 movs r1, #3 + 8006160: 6878 ldr r0, [r7, #4] + 8006162: f000 f809 bl 8006178 +#if LWIP_IPV6 + nd6_restart_netif(netif); +#endif /* LWIP_IPV6 */ + } +} + 8006166: 3708 adds r7, #8 + 8006168: 46bd mov sp, r7 + 800616a: bd80 pop {r7, pc} + 800616c: 08016384 .word 0x08016384 + 8006170: 0801650c .word 0x0801650c + 8006174: 080163d4 .word 0x080163d4 + +08006178 : + +/** Send ARP/IGMP/MLD/RS events, e.g. on link-up/netif-up or addr-change + */ +static void +netif_issue_reports(struct netif *netif, u8_t report_type) +{ + 8006178: b580 push {r7, lr} + 800617a: b082 sub sp, #8 + 800617c: af00 add r7, sp, #0 + 800617e: 6078 str r0, [r7, #4] + 8006180: 460b mov r3, r1 + 8006182: 70fb strb r3, [r7, #3] + LWIP_ASSERT("netif_issue_reports: invalid netif", netif != NULL); + 8006184: 687b ldr r3, [r7, #4] + 8006186: 2b00 cmp r3, #0 + 8006188: d106 bne.n 8006198 + 800618a: 4b18 ldr r3, [pc, #96] @ (80061ec ) + 800618c: f240 326d movw r2, #877 @ 0x36d + 8006190: 4917 ldr r1, [pc, #92] @ (80061f0 ) + 8006192: 4818 ldr r0, [pc, #96] @ (80061f4 ) + 8006194: f00b fa30 bl 80115f8 + + /* Only send reports when both link and admin states are up */ + if (!(netif->flags & NETIF_FLAG_LINK_UP) || + 8006198: 687b ldr r3, [r7, #4] + 800619a: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800619e: f003 0304 and.w r3, r3, #4 + 80061a2: 2b00 cmp r3, #0 + 80061a4: d01e beq.n 80061e4 + !(netif->flags & NETIF_FLAG_UP)) { + 80061a6: 687b ldr r3, [r7, #4] + 80061a8: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 80061ac: f003 0301 and.w r3, r3, #1 + if (!(netif->flags & NETIF_FLAG_LINK_UP) || + 80061b0: 2b00 cmp r3, #0 + 80061b2: d017 beq.n 80061e4 + return; + } + +#if LWIP_IPV4 + if ((report_type & NETIF_REPORT_TYPE_IPV4) && + 80061b4: 78fb ldrb r3, [r7, #3] + 80061b6: f003 0301 and.w r3, r3, #1 + 80061ba: 2b00 cmp r3, #0 + 80061bc: d013 beq.n 80061e6 + !ip4_addr_isany_val(*netif_ip4_addr(netif))) { + 80061be: 687b ldr r3, [r7, #4] + 80061c0: 3304 adds r3, #4 + 80061c2: 681b ldr r3, [r3, #0] + if ((report_type & NETIF_REPORT_TYPE_IPV4) && + 80061c4: 2b00 cmp r3, #0 + 80061c6: d00e beq.n 80061e6 +#if LWIP_ARP + /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ + if (netif->flags & (NETIF_FLAG_ETHARP)) { + 80061c8: 687b ldr r3, [r7, #4] + 80061ca: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 80061ce: f003 0308 and.w r3, r3, #8 + 80061d2: 2b00 cmp r3, #0 + 80061d4: d007 beq.n 80061e6 + etharp_gratuitous(netif); + 80061d6: 687b ldr r3, [r7, #4] + 80061d8: 3304 adds r3, #4 + 80061da: 4619 mov r1, r3 + 80061dc: 6878 ldr r0, [r7, #4] + 80061de: f009 fc45 bl 800fa6c + 80061e2: e000 b.n 80061e6 + return; + 80061e4: bf00 nop + /* send mld memberships */ + mld6_report_groups(netif); +#endif /* LWIP_IPV6_MLD */ + } +#endif /* LWIP_IPV6 */ +} + 80061e6: 3708 adds r7, #8 + 80061e8: 46bd mov sp, r7 + 80061ea: bd80 pop {r7, pc} + 80061ec: 08016384 .word 0x08016384 + 80061f0: 08016528 .word 0x08016528 + 80061f4: 080163d4 .word 0x080163d4 + +080061f8 : + * @ingroup netif + * Bring an interface down, disabling any traffic processing. + */ +void +netif_set_down(struct netif *netif) +{ + 80061f8: b580 push {r7, lr} + 80061fa: b082 sub sp, #8 + 80061fc: af00 add r7, sp, #0 + 80061fe: 6078 str r0, [r7, #4] + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("netif_set_down: invalid netif", netif != NULL, return); + 8006200: 687b ldr r3, [r7, #4] + 8006202: 2b00 cmp r3, #0 + 8006204: d107 bne.n 8006216 + 8006206: 4b12 ldr r3, [pc, #72] @ (8006250 ) + 8006208: f240 329b movw r2, #923 @ 0x39b + 800620c: 4911 ldr r1, [pc, #68] @ (8006254 ) + 800620e: 4812 ldr r0, [pc, #72] @ (8006258 ) + 8006210: f00b f9f2 bl 80115f8 + 8006214: e019 b.n 800624a + + if (netif->flags & NETIF_FLAG_UP) { + 8006216: 687b ldr r3, [r7, #4] + 8006218: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800621c: f003 0301 and.w r3, r3, #1 + 8006220: 2b00 cmp r3, #0 + 8006222: d012 beq.n 800624a + args.status_changed.state = 0; + netif_invoke_ext_callback(netif, LWIP_NSC_STATUS_CHANGED, &args); + } +#endif + + netif_clear_flags(netif, NETIF_FLAG_UP); + 8006224: 687b ldr r3, [r7, #4] + 8006226: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800622a: f023 0301 bic.w r3, r3, #1 + 800622e: b2da uxtb r2, r3 + 8006230: 687b ldr r3, [r7, #4] + 8006232: f883 2031 strb.w r2, [r3, #49] @ 0x31 + MIB2_COPY_SYSUPTIME_TO(&netif->ts); + +#if LWIP_IPV4 && LWIP_ARP + if (netif->flags & NETIF_FLAG_ETHARP) { + 8006236: 687b ldr r3, [r7, #4] + 8006238: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800623c: f003 0308 and.w r3, r3, #8 + 8006240: 2b00 cmp r3, #0 + 8006242: d002 beq.n 800624a + etharp_cleanup_netif(netif); + 8006244: 6878 ldr r0, [r7, #4] + 8006246: f008 ffcb bl 800f1e0 + nd6_cleanup_netif(netif); +#endif /* LWIP_IPV6 */ + + NETIF_STATUS_CALLBACK(netif); + } +} + 800624a: 3708 adds r7, #8 + 800624c: 46bd mov sp, r7 + 800624e: bd80 pop {r7, pc} + 8006250: 08016384 .word 0x08016384 + 8006254: 0801654c .word 0x0801654c + 8006258: 080163d4 .word 0x080163d4 + +0800625c : + * @ingroup netif + * Called by a driver when its link goes up + */ +void +netif_set_link_up(struct netif *netif) +{ + 800625c: b580 push {r7, lr} + 800625e: b082 sub sp, #8 + 8006260: af00 add r7, sp, #0 + 8006262: 6078 str r0, [r7, #4] + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("netif_set_link_up: invalid netif", netif != NULL, return); + 8006264: 687b ldr r3, [r7, #4] + 8006266: 2b00 cmp r3, #0 + 8006268: d107 bne.n 800627a + 800626a: 4b15 ldr r3, [pc, #84] @ (80062c0 ) + 800626c: f44f 7278 mov.w r2, #992 @ 0x3e0 + 8006270: 4914 ldr r1, [pc, #80] @ (80062c4 ) + 8006272: 4815 ldr r0, [pc, #84] @ (80062c8 ) + 8006274: f00b f9c0 bl 80115f8 + 8006278: e01e b.n 80062b8 + + if (!(netif->flags & NETIF_FLAG_LINK_UP)) { + 800627a: 687b ldr r3, [r7, #4] + 800627c: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 8006280: f003 0304 and.w r3, r3, #4 + 8006284: 2b00 cmp r3, #0 + 8006286: d117 bne.n 80062b8 + netif_set_flags(netif, NETIF_FLAG_LINK_UP); + 8006288: 687b ldr r3, [r7, #4] + 800628a: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800628e: f043 0304 orr.w r3, r3, #4 + 8006292: b2da uxtb r2, r3 + 8006294: 687b ldr r3, [r7, #4] + 8006296: f883 2031 strb.w r2, [r3, #49] @ 0x31 + +#if LWIP_DHCP + dhcp_network_changed(netif); + 800629a: 6878 ldr r0, [r7, #4] + 800629c: f007 fa16 bl 800d6cc + +#if LWIP_AUTOIP + autoip_network_changed(netif); +#endif /* LWIP_AUTOIP */ + + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4 | NETIF_REPORT_TYPE_IPV6); + 80062a0: 2103 movs r1, #3 + 80062a2: 6878 ldr r0, [r7, #4] + 80062a4: f7ff ff68 bl 8006178 +#if LWIP_IPV6 + nd6_restart_netif(netif); +#endif /* LWIP_IPV6 */ + + NETIF_LINK_CALLBACK(netif); + 80062a8: 687b ldr r3, [r7, #4] + 80062aa: 69db ldr r3, [r3, #28] + 80062ac: 2b00 cmp r3, #0 + 80062ae: d003 beq.n 80062b8 + 80062b0: 687b ldr r3, [r7, #4] + 80062b2: 69db ldr r3, [r3, #28] + 80062b4: 6878 ldr r0, [r7, #4] + 80062b6: 4798 blx r3 + args.link_changed.state = 1; + netif_invoke_ext_callback(netif, LWIP_NSC_LINK_CHANGED, &args); + } +#endif + } +} + 80062b8: 3708 adds r7, #8 + 80062ba: 46bd mov sp, r7 + 80062bc: bd80 pop {r7, pc} + 80062be: bf00 nop + 80062c0: 08016384 .word 0x08016384 + 80062c4: 0801656c .word 0x0801656c + 80062c8: 080163d4 .word 0x080163d4 + +080062cc : + * @ingroup netif + * Called by a driver when its link goes down + */ +void +netif_set_link_down(struct netif *netif) +{ + 80062cc: b580 push {r7, lr} + 80062ce: b082 sub sp, #8 + 80062d0: af00 add r7, sp, #0 + 80062d2: 6078 str r0, [r7, #4] + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("netif_set_link_down: invalid netif", netif != NULL, return); + 80062d4: 687b ldr r3, [r7, #4] + 80062d6: 2b00 cmp r3, #0 + 80062d8: d107 bne.n 80062ea + 80062da: 4b11 ldr r3, [pc, #68] @ (8006320 ) + 80062dc: f240 4206 movw r2, #1030 @ 0x406 + 80062e0: 4910 ldr r1, [pc, #64] @ (8006324 ) + 80062e2: 4811 ldr r0, [pc, #68] @ (8006328 ) + 80062e4: f00b f988 bl 80115f8 + 80062e8: e017 b.n 800631a + + if (netif->flags & NETIF_FLAG_LINK_UP) { + 80062ea: 687b ldr r3, [r7, #4] + 80062ec: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 80062f0: f003 0304 and.w r3, r3, #4 + 80062f4: 2b00 cmp r3, #0 + 80062f6: d010 beq.n 800631a + netif_clear_flags(netif, NETIF_FLAG_LINK_UP); + 80062f8: 687b ldr r3, [r7, #4] + 80062fa: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 80062fe: f023 0304 bic.w r3, r3, #4 + 8006302: b2da uxtb r2, r3 + 8006304: 687b ldr r3, [r7, #4] + 8006306: f883 2031 strb.w r2, [r3, #49] @ 0x31 + NETIF_LINK_CALLBACK(netif); + 800630a: 687b ldr r3, [r7, #4] + 800630c: 69db ldr r3, [r3, #28] + 800630e: 2b00 cmp r3, #0 + 8006310: d003 beq.n 800631a + 8006312: 687b ldr r3, [r7, #4] + 8006314: 69db ldr r3, [r3, #28] + 8006316: 6878 ldr r0, [r7, #4] + 8006318: 4798 blx r3 + args.link_changed.state = 0; + netif_invoke_ext_callback(netif, LWIP_NSC_LINK_CHANGED, &args); + } +#endif + } +} + 800631a: 3708 adds r7, #8 + 800631c: 46bd mov sp, r7 + 800631e: bd80 pop {r7, pc} + 8006320: 08016384 .word 0x08016384 + 8006324: 08016590 .word 0x08016590 + 8006328: 080163d4 .word 0x080163d4 + +0800632c : + * @ingroup netif + * Set callback to be called when link is brought up/down + */ +void +netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback) +{ + 800632c: b480 push {r7} + 800632e: b083 sub sp, #12 + 8006330: af00 add r7, sp, #0 + 8006332: 6078 str r0, [r7, #4] + 8006334: 6039 str r1, [r7, #0] + LWIP_ASSERT_CORE_LOCKED(); + + if (netif) { + 8006336: 687b ldr r3, [r7, #4] + 8006338: 2b00 cmp r3, #0 + 800633a: d002 beq.n 8006342 + netif->link_callback = link_callback; + 800633c: 687b ldr r3, [r7, #4] + 800633e: 683a ldr r2, [r7, #0] + 8006340: 61da str r2, [r3, #28] + } +} + 8006342: bf00 nop + 8006344: 370c adds r7, #12 + 8006346: 46bd mov sp, r7 + 8006348: f85d 7b04 ldr.w r7, [sp], #4 + 800634c: 4770 bx lr + +0800634e : +#if LWIP_IPV4 +/** Dummy IPv4 output function for netifs not supporting IPv4 + */ +static err_t +netif_null_output_ip4(struct netif *netif, struct pbuf *p, const ip4_addr_t *ipaddr) +{ + 800634e: b480 push {r7} + 8006350: b085 sub sp, #20 + 8006352: af00 add r7, sp, #0 + 8006354: 60f8 str r0, [r7, #12] + 8006356: 60b9 str r1, [r7, #8] + 8006358: 607a str r2, [r7, #4] + LWIP_UNUSED_ARG(netif); + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(ipaddr); + + return ERR_IF; + 800635a: f06f 030b mvn.w r3, #11 +} + 800635e: 4618 mov r0, r3 + 8006360: 3714 adds r7, #20 + 8006362: 46bd mov sp, r7 + 8006364: f85d 7b04 ldr.w r7, [sp], #4 + 8006368: 4770 bx lr + ... + +0800636c : +* +* @param idx index of netif to find +*/ +struct netif * +netif_get_by_index(u8_t idx) +{ + 800636c: b480 push {r7} + 800636e: b085 sub sp, #20 + 8006370: af00 add r7, sp, #0 + 8006372: 4603 mov r3, r0 + 8006374: 71fb strb r3, [r7, #7] + struct netif *netif; + + LWIP_ASSERT_CORE_LOCKED(); + + if (idx != NETIF_NO_INDEX) { + 8006376: 79fb ldrb r3, [r7, #7] + 8006378: 2b00 cmp r3, #0 + 800637a: d013 beq.n 80063a4 + NETIF_FOREACH(netif) { + 800637c: 4b0d ldr r3, [pc, #52] @ (80063b4 ) + 800637e: 681b ldr r3, [r3, #0] + 8006380: 60fb str r3, [r7, #12] + 8006382: e00c b.n 800639e + if (idx == netif_get_index(netif)) { + 8006384: 68fb ldr r3, [r7, #12] + 8006386: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 800638a: 3301 adds r3, #1 + 800638c: b2db uxtb r3, r3 + 800638e: 79fa ldrb r2, [r7, #7] + 8006390: 429a cmp r2, r3 + 8006392: d101 bne.n 8006398 + return netif; /* found! */ + 8006394: 68fb ldr r3, [r7, #12] + 8006396: e006 b.n 80063a6 + NETIF_FOREACH(netif) { + 8006398: 68fb ldr r3, [r7, #12] + 800639a: 681b ldr r3, [r3, #0] + 800639c: 60fb str r3, [r7, #12] + 800639e: 68fb ldr r3, [r7, #12] + 80063a0: 2b00 cmp r3, #0 + 80063a2: d1ef bne.n 8006384 + } + } + } + + return NULL; + 80063a4: 2300 movs r3, #0 +} + 80063a6: 4618 mov r0, r3 + 80063a8: 3714 adds r7, #20 + 80063aa: 46bd mov sp, r7 + 80063ac: f85d 7b04 ldr.w r7, [sp], #4 + 80063b0: 4770 bx lr + 80063b2: bf00 nop + 80063b4: 20019098 .word 0x20019098 + +080063b8 : +#if !NO_SYS +static +#endif /* !NO_SYS */ +void +pbuf_free_ooseq(void) +{ + 80063b8: b580 push {r7, lr} + 80063ba: b082 sub sp, #8 + 80063bc: af00 add r7, sp, #0 + struct tcp_pcb *pcb; + SYS_ARCH_SET(pbuf_free_ooseq_pending, 0); + 80063be: 4b0c ldr r3, [pc, #48] @ (80063f0 ) + 80063c0: 2200 movs r2, #0 + 80063c2: 701a strb r2, [r3, #0] + + for (pcb = tcp_active_pcbs; NULL != pcb; pcb = pcb->next) { + 80063c4: 4b0b ldr r3, [pc, #44] @ (80063f4 ) + 80063c6: 681b ldr r3, [r3, #0] + 80063c8: 607b str r3, [r7, #4] + 80063ca: e00a b.n 80063e2 + if (pcb->ooseq != NULL) { + 80063cc: 687b ldr r3, [r7, #4] + 80063ce: 6f5b ldr r3, [r3, #116] @ 0x74 + 80063d0: 2b00 cmp r3, #0 + 80063d2: d003 beq.n 80063dc + /** Free the ooseq pbufs of one PCB only */ + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free_ooseq: freeing out-of-sequence pbufs\n")); + tcp_free_ooseq(pcb); + 80063d4: 6878 ldr r0, [r7, #4] + 80063d6: f002 f94d bl 8008674 + return; + 80063da: e005 b.n 80063e8 + for (pcb = tcp_active_pcbs; NULL != pcb; pcb = pcb->next) { + 80063dc: 687b ldr r3, [r7, #4] + 80063de: 68db ldr r3, [r3, #12] + 80063e0: 607b str r3, [r7, #4] + 80063e2: 687b ldr r3, [r7, #4] + 80063e4: 2b00 cmp r3, #0 + 80063e6: d1f1 bne.n 80063cc + } + } +} + 80063e8: 3708 adds r7, #8 + 80063ea: 46bd mov sp, r7 + 80063ec: bd80 pop {r7, pc} + 80063ee: bf00 nop + 80063f0: 200190a1 .word 0x200190a1 + 80063f4: 200190b0 .word 0x200190b0 + +080063f8 : +#endif /* !NO_SYS */ + +/** Queue a call to pbuf_free_ooseq if not already queued. */ +static void +pbuf_pool_is_empty(void) +{ + 80063f8: b480 push {r7} + 80063fa: af00 add r7, sp, #0 +#ifndef PBUF_POOL_FREE_OOSEQ_QUEUE_CALL + SYS_ARCH_SET(pbuf_free_ooseq_pending, 1); + 80063fc: 4b03 ldr r3, [pc, #12] @ (800640c ) + 80063fe: 2201 movs r2, #1 + 8006400: 701a strb r2, [r3, #0] + if (!queued) { + /* queue a call to pbuf_free_ooseq if not already queued */ + PBUF_POOL_FREE_OOSEQ_QUEUE_CALL(); + } +#endif /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */ +} + 8006402: bf00 nop + 8006404: 46bd mov sp, r7 + 8006406: f85d 7b04 ldr.w r7, [sp], #4 + 800640a: 4770 bx lr + 800640c: 200190a1 .word 0x200190a1 + +08006410 : +#endif /* !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ */ + +/* Initialize members of struct pbuf after allocation */ +static void +pbuf_init_alloced_pbuf(struct pbuf *p, void *payload, u16_t tot_len, u16_t len, pbuf_type type, u8_t flags) +{ + 8006410: b480 push {r7} + 8006412: b085 sub sp, #20 + 8006414: af00 add r7, sp, #0 + 8006416: 60f8 str r0, [r7, #12] + 8006418: 60b9 str r1, [r7, #8] + 800641a: 4611 mov r1, r2 + 800641c: 461a mov r2, r3 + 800641e: 460b mov r3, r1 + 8006420: 80fb strh r3, [r7, #6] + 8006422: 4613 mov r3, r2 + 8006424: 80bb strh r3, [r7, #4] + p->next = NULL; + 8006426: 68fb ldr r3, [r7, #12] + 8006428: 2200 movs r2, #0 + 800642a: 601a str r2, [r3, #0] + p->payload = payload; + 800642c: 68fb ldr r3, [r7, #12] + 800642e: 68ba ldr r2, [r7, #8] + 8006430: 605a str r2, [r3, #4] + p->tot_len = tot_len; + 8006432: 68fb ldr r3, [r7, #12] + 8006434: 88fa ldrh r2, [r7, #6] + 8006436: 811a strh r2, [r3, #8] + p->len = len; + 8006438: 68fb ldr r3, [r7, #12] + 800643a: 88ba ldrh r2, [r7, #4] + 800643c: 815a strh r2, [r3, #10] + p->type_internal = (u8_t)type; + 800643e: 8b3b ldrh r3, [r7, #24] + 8006440: b2da uxtb r2, r3 + 8006442: 68fb ldr r3, [r7, #12] + 8006444: 731a strb r2, [r3, #12] + p->flags = flags; + 8006446: 68fb ldr r3, [r7, #12] + 8006448: 7f3a ldrb r2, [r7, #28] + 800644a: 735a strb r2, [r3, #13] + p->ref = 1; + 800644c: 68fb ldr r3, [r7, #12] + 800644e: 2201 movs r2, #1 + 8006450: 739a strb r2, [r3, #14] + p->if_idx = NETIF_NO_INDEX; + 8006452: 68fb ldr r3, [r7, #12] + 8006454: 2200 movs r2, #0 + 8006456: 73da strb r2, [r3, #15] +} + 8006458: bf00 nop + 800645a: 3714 adds r7, #20 + 800645c: 46bd mov sp, r7 + 800645e: f85d 7b04 ldr.w r7, [sp], #4 + 8006462: 4770 bx lr + +08006464 : + * @return the allocated pbuf. If multiple pbufs where allocated, this + * is the first pbuf of a pbuf chain. + */ +struct pbuf * +pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) +{ + 8006464: b580 push {r7, lr} + 8006466: b08c sub sp, #48 @ 0x30 + 8006468: af02 add r7, sp, #8 + 800646a: 4603 mov r3, r0 + 800646c: 71fb strb r3, [r7, #7] + 800646e: 460b mov r3, r1 + 8006470: 80bb strh r3, [r7, #4] + 8006472: 4613 mov r3, r2 + 8006474: 807b strh r3, [r7, #2] + struct pbuf *p; + u16_t offset = (u16_t)layer; + 8006476: 79fb ldrb r3, [r7, #7] + 8006478: 847b strh r3, [r7, #34] @ 0x22 + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F")\n", length)); + + switch (type) { + 800647a: 887b ldrh r3, [r7, #2] + 800647c: f5b3 7f20 cmp.w r3, #640 @ 0x280 + 8006480: d07f beq.n 8006582 + 8006482: f5b3 7f20 cmp.w r3, #640 @ 0x280 + 8006486: f300 80c7 bgt.w 8006618 + 800648a: f5b3 7fc1 cmp.w r3, #386 @ 0x182 + 800648e: d010 beq.n 80064b2 + 8006490: f5b3 7fc1 cmp.w r3, #386 @ 0x182 + 8006494: f300 80c0 bgt.w 8006618 + 8006498: 2b01 cmp r3, #1 + 800649a: d002 beq.n 80064a2 + 800649c: 2b41 cmp r3, #65 @ 0x41 + 800649e: f040 80bb bne.w 8006618 + case PBUF_REF: /* fall through */ + case PBUF_ROM: + p = pbuf_alloc_reference(NULL, length, type); + 80064a2: 887a ldrh r2, [r7, #2] + 80064a4: 88bb ldrh r3, [r7, #4] + 80064a6: 4619 mov r1, r3 + 80064a8: 2000 movs r0, #0 + 80064aa: f000 f8d1 bl 8006650 + 80064ae: 6278 str r0, [r7, #36] @ 0x24 + break; + 80064b0: e0bc b.n 800662c + case PBUF_POOL: { + struct pbuf *q, *last; + u16_t rem_len; /* remaining length */ + p = NULL; + 80064b2: 2300 movs r3, #0 + 80064b4: 627b str r3, [r7, #36] @ 0x24 + last = NULL; + 80064b6: 2300 movs r3, #0 + 80064b8: 61fb str r3, [r7, #28] + rem_len = length; + 80064ba: 88bb ldrh r3, [r7, #4] + 80064bc: 837b strh r3, [r7, #26] + do { + u16_t qlen; + q = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL); + 80064be: 2008 movs r0, #8 + 80064c0: f7ff fbc2 bl 8005c48 + 80064c4: 6138 str r0, [r7, #16] + if (q == NULL) { + 80064c6: 693b ldr r3, [r7, #16] + 80064c8: 2b00 cmp r3, #0 + 80064ca: d109 bne.n 80064e0 + PBUF_POOL_IS_EMPTY(); + 80064cc: f7ff ff94 bl 80063f8 + /* free chain so far allocated */ + if (p) { + 80064d0: 6a7b ldr r3, [r7, #36] @ 0x24 + 80064d2: 2b00 cmp r3, #0 + 80064d4: d002 beq.n 80064dc + pbuf_free(p); + 80064d6: 6a78 ldr r0, [r7, #36] @ 0x24 + 80064d8: f000 faa6 bl 8006a28 + } + /* bail out unsuccessfully */ + return NULL; + 80064dc: 2300 movs r3, #0 + 80064de: e0a6 b.n 800662e + } + qlen = LWIP_MIN(rem_len, (u16_t)(PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset))); + 80064e0: 8c7b ldrh r3, [r7, #34] @ 0x22 + 80064e2: 3303 adds r3, #3 + 80064e4: b29b uxth r3, r3 + 80064e6: f023 0303 bic.w r3, r3, #3 + 80064ea: b29b uxth r3, r3 + 80064ec: f5c3 7314 rsb r3, r3, #592 @ 0x250 + 80064f0: b29b uxth r3, r3 + 80064f2: 8b7a ldrh r2, [r7, #26] + 80064f4: 4293 cmp r3, r2 + 80064f6: bf28 it cs + 80064f8: 4613 movcs r3, r2 + 80064fa: 81fb strh r3, [r7, #14] + pbuf_init_alloced_pbuf(q, LWIP_MEM_ALIGN((void *)((u8_t *)q + SIZEOF_STRUCT_PBUF + offset)), + 80064fc: 8c7b ldrh r3, [r7, #34] @ 0x22 + 80064fe: 3310 adds r3, #16 + 8006500: 693a ldr r2, [r7, #16] + 8006502: 4413 add r3, r2 + 8006504: 3303 adds r3, #3 + 8006506: f023 0303 bic.w r3, r3, #3 + 800650a: 4618 mov r0, r3 + 800650c: 89f9 ldrh r1, [r7, #14] + 800650e: 8b7a ldrh r2, [r7, #26] + 8006510: 2300 movs r3, #0 + 8006512: 9301 str r3, [sp, #4] + 8006514: 887b ldrh r3, [r7, #2] + 8006516: 9300 str r3, [sp, #0] + 8006518: 460b mov r3, r1 + 800651a: 4601 mov r1, r0 + 800651c: 6938 ldr r0, [r7, #16] + 800651e: f7ff ff77 bl 8006410 + rem_len, qlen, type, 0); + LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned", + 8006522: 693b ldr r3, [r7, #16] + 8006524: 685b ldr r3, [r3, #4] + 8006526: f003 0303 and.w r3, r3, #3 + 800652a: 2b00 cmp r3, #0 + 800652c: d006 beq.n 800653c + 800652e: 4b42 ldr r3, [pc, #264] @ (8006638 ) + 8006530: f44f 7280 mov.w r2, #256 @ 0x100 + 8006534: 4941 ldr r1, [pc, #260] @ (800663c ) + 8006536: 4842 ldr r0, [pc, #264] @ (8006640 ) + 8006538: f00b f85e bl 80115f8 + ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0); + LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT", + 800653c: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800653e: 3303 adds r3, #3 + 8006540: f023 0303 bic.w r3, r3, #3 + 8006544: f5b3 7f14 cmp.w r3, #592 @ 0x250 + 8006548: d106 bne.n 8006558 + 800654a: 4b3b ldr r3, [pc, #236] @ (8006638 ) + 800654c: f44f 7281 mov.w r2, #258 @ 0x102 + 8006550: 493c ldr r1, [pc, #240] @ (8006644 ) + 8006552: 483b ldr r0, [pc, #236] @ (8006640 ) + 8006554: f00b f850 bl 80115f8 + (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 ); + if (p == NULL) { + 8006558: 6a7b ldr r3, [r7, #36] @ 0x24 + 800655a: 2b00 cmp r3, #0 + 800655c: d102 bne.n 8006564 + /* allocated head of pbuf chain (into p) */ + p = q; + 800655e: 693b ldr r3, [r7, #16] + 8006560: 627b str r3, [r7, #36] @ 0x24 + 8006562: e002 b.n 800656a + } else { + /* make previous pbuf point to this pbuf */ + last->next = q; + 8006564: 69fb ldr r3, [r7, #28] + 8006566: 693a ldr r2, [r7, #16] + 8006568: 601a str r2, [r3, #0] + } + last = q; + 800656a: 693b ldr r3, [r7, #16] + 800656c: 61fb str r3, [r7, #28] + rem_len = (u16_t)(rem_len - qlen); + 800656e: 8b7a ldrh r2, [r7, #26] + 8006570: 89fb ldrh r3, [r7, #14] + 8006572: 1ad3 subs r3, r2, r3 + 8006574: 837b strh r3, [r7, #26] + offset = 0; + 8006576: 2300 movs r3, #0 + 8006578: 847b strh r3, [r7, #34] @ 0x22 + } while (rem_len > 0); + 800657a: 8b7b ldrh r3, [r7, #26] + 800657c: 2b00 cmp r3, #0 + 800657e: d19e bne.n 80064be + break; + 8006580: e054 b.n 800662c + } + case PBUF_RAM: { + u16_t payload_len = (u16_t)(LWIP_MEM_ALIGN_SIZE(offset) + LWIP_MEM_ALIGN_SIZE(length)); + 8006582: 8c7b ldrh r3, [r7, #34] @ 0x22 + 8006584: 3303 adds r3, #3 + 8006586: b29b uxth r3, r3 + 8006588: f023 0303 bic.w r3, r3, #3 + 800658c: b29a uxth r2, r3 + 800658e: 88bb ldrh r3, [r7, #4] + 8006590: 3303 adds r3, #3 + 8006592: b29b uxth r3, r3 + 8006594: f023 0303 bic.w r3, r3, #3 + 8006598: b29b uxth r3, r3 + 800659a: 4413 add r3, r2 + 800659c: 833b strh r3, [r7, #24] + mem_size_t alloc_len = (mem_size_t)(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF) + payload_len); + 800659e: 8b3b ldrh r3, [r7, #24] + 80065a0: 3310 adds r3, #16 + 80065a2: 617b str r3, [r7, #20] + + /* bug #50040: Check for integer overflow when calculating alloc_len */ + if ((payload_len < LWIP_MEM_ALIGN_SIZE(length)) || + 80065a4: 8b3a ldrh r2, [r7, #24] + 80065a6: 88bb ldrh r3, [r7, #4] + 80065a8: 3303 adds r3, #3 + 80065aa: f023 0303 bic.w r3, r3, #3 + 80065ae: 429a cmp r2, r3 + 80065b0: d306 bcc.n 80065c0 + (alloc_len < LWIP_MEM_ALIGN_SIZE(length))) { + 80065b2: 88bb ldrh r3, [r7, #4] + 80065b4: 3303 adds r3, #3 + 80065b6: f023 0303 bic.w r3, r3, #3 + if ((payload_len < LWIP_MEM_ALIGN_SIZE(length)) || + 80065ba: 697a ldr r2, [r7, #20] + 80065bc: 429a cmp r2, r3 + 80065be: d201 bcs.n 80065c4 + return NULL; + 80065c0: 2300 movs r3, #0 + 80065c2: e034 b.n 800662e + } + + /* If pbuf is to be allocated in RAM, allocate memory for it. */ + p = (struct pbuf *)mem_malloc(alloc_len); + 80065c4: 6978 ldr r0, [r7, #20] + 80065c6: f7ff f9b9 bl 800593c + 80065ca: 6278 str r0, [r7, #36] @ 0x24 + if (p == NULL) { + 80065cc: 6a7b ldr r3, [r7, #36] @ 0x24 + 80065ce: 2b00 cmp r3, #0 + 80065d0: d101 bne.n 80065d6 + return NULL; + 80065d2: 2300 movs r3, #0 + 80065d4: e02b b.n 800662e + } + pbuf_init_alloced_pbuf(p, LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset)), + 80065d6: 8c7b ldrh r3, [r7, #34] @ 0x22 + 80065d8: 3310 adds r3, #16 + 80065da: 6a7a ldr r2, [r7, #36] @ 0x24 + 80065dc: 4413 add r3, r2 + 80065de: 3303 adds r3, #3 + 80065e0: f023 0303 bic.w r3, r3, #3 + 80065e4: 4618 mov r0, r3 + 80065e6: 88b9 ldrh r1, [r7, #4] + 80065e8: 88ba ldrh r2, [r7, #4] + 80065ea: 2300 movs r3, #0 + 80065ec: 9301 str r3, [sp, #4] + 80065ee: 887b ldrh r3, [r7, #2] + 80065f0: 9300 str r3, [sp, #0] + 80065f2: 460b mov r3, r1 + 80065f4: 4601 mov r1, r0 + 80065f6: 6a78 ldr r0, [r7, #36] @ 0x24 + 80065f8: f7ff ff0a bl 8006410 + length, length, type, 0); + LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned", + 80065fc: 6a7b ldr r3, [r7, #36] @ 0x24 + 80065fe: 685b ldr r3, [r3, #4] + 8006600: f003 0303 and.w r3, r3, #3 + 8006604: 2b00 cmp r3, #0 + 8006606: d010 beq.n 800662a + 8006608: 4b0b ldr r3, [pc, #44] @ (8006638 ) + 800660a: f44f 7291 mov.w r2, #290 @ 0x122 + 800660e: 490e ldr r1, [pc, #56] @ (8006648 ) + 8006610: 480b ldr r0, [pc, #44] @ (8006640 ) + 8006612: f00a fff1 bl 80115f8 + ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); + break; + 8006616: e008 b.n 800662a + } + default: + LWIP_ASSERT("pbuf_alloc: erroneous type", 0); + 8006618: 4b07 ldr r3, [pc, #28] @ (8006638 ) + 800661a: f240 1227 movw r2, #295 @ 0x127 + 800661e: 490b ldr r1, [pc, #44] @ (800664c ) + 8006620: 4807 ldr r0, [pc, #28] @ (8006640 ) + 8006622: f00a ffe9 bl 80115f8 + return NULL; + 8006626: 2300 movs r3, #0 + 8006628: e001 b.n 800662e + break; + 800662a: bf00 nop + } + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p)); + return p; + 800662c: 6a7b ldr r3, [r7, #36] @ 0x24 +} + 800662e: 4618 mov r0, r3 + 8006630: 3728 adds r7, #40 @ 0x28 + 8006632: 46bd mov sp, r7 + 8006634: bd80 pop {r7, pc} + 8006636: bf00 nop + 8006638: 080165b4 .word 0x080165b4 + 800663c: 080165e4 .word 0x080165e4 + 8006640: 08016614 .word 0x08016614 + 8006644: 0801663c .word 0x0801663c + 8006648: 08016670 .word 0x08016670 + 800664c: 0801669c .word 0x0801669c + +08006650 : + * + * @return the allocated pbuf. + */ +struct pbuf * +pbuf_alloc_reference(void *payload, u16_t length, pbuf_type type) +{ + 8006650: b580 push {r7, lr} + 8006652: b086 sub sp, #24 + 8006654: af02 add r7, sp, #8 + 8006656: 6078 str r0, [r7, #4] + 8006658: 460b mov r3, r1 + 800665a: 807b strh r3, [r7, #2] + 800665c: 4613 mov r3, r2 + 800665e: 803b strh r3, [r7, #0] + struct pbuf *p; + LWIP_ASSERT("invalid pbuf_type", (type == PBUF_REF) || (type == PBUF_ROM)); + 8006660: 883b ldrh r3, [r7, #0] + 8006662: 2b41 cmp r3, #65 @ 0x41 + 8006664: d009 beq.n 800667a + 8006666: 883b ldrh r3, [r7, #0] + 8006668: 2b01 cmp r3, #1 + 800666a: d006 beq.n 800667a + 800666c: 4b0f ldr r3, [pc, #60] @ (80066ac ) + 800666e: f44f 72a5 mov.w r2, #330 @ 0x14a + 8006672: 490f ldr r1, [pc, #60] @ (80066b0 ) + 8006674: 480f ldr r0, [pc, #60] @ (80066b4 ) + 8006676: f00a ffbf bl 80115f8 + /* only allocate memory for the pbuf structure */ + p = (struct pbuf *)memp_malloc(MEMP_PBUF); + 800667a: 2007 movs r0, #7 + 800667c: f7ff fae4 bl 8005c48 + 8006680: 60f8 str r0, [r7, #12] + if (p == NULL) { + 8006682: 68fb ldr r3, [r7, #12] + 8006684: 2b00 cmp r3, #0 + 8006686: d101 bne.n 800668c + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("pbuf_alloc_reference: Could not allocate MEMP_PBUF for PBUF_%s.\n", + (type == PBUF_ROM) ? "ROM" : "REF")); + return NULL; + 8006688: 2300 movs r3, #0 + 800668a: e00b b.n 80066a4 + } + pbuf_init_alloced_pbuf(p, payload, length, length, type, 0); + 800668c: 8879 ldrh r1, [r7, #2] + 800668e: 887a ldrh r2, [r7, #2] + 8006690: 2300 movs r3, #0 + 8006692: 9301 str r3, [sp, #4] + 8006694: 883b ldrh r3, [r7, #0] + 8006696: 9300 str r3, [sp, #0] + 8006698: 460b mov r3, r1 + 800669a: 6879 ldr r1, [r7, #4] + 800669c: 68f8 ldr r0, [r7, #12] + 800669e: f7ff feb7 bl 8006410 + return p; + 80066a2: 68fb ldr r3, [r7, #12] +} + 80066a4: 4618 mov r0, r3 + 80066a6: 3710 adds r7, #16 + 80066a8: 46bd mov sp, r7 + 80066aa: bd80 pop {r7, pc} + 80066ac: 080165b4 .word 0x080165b4 + 80066b0: 080166b8 .word 0x080166b8 + 80066b4: 08016614 .word 0x08016614 + +080066b8 : + * big enough to hold 'length' plus the header size + */ +struct pbuf * +pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p, + void *payload_mem, u16_t payload_mem_len) +{ + 80066b8: b580 push {r7, lr} + 80066ba: b088 sub sp, #32 + 80066bc: af02 add r7, sp, #8 + 80066be: 607b str r3, [r7, #4] + 80066c0: 4603 mov r3, r0 + 80066c2: 73fb strb r3, [r7, #15] + 80066c4: 460b mov r3, r1 + 80066c6: 81bb strh r3, [r7, #12] + 80066c8: 4613 mov r3, r2 + 80066ca: 817b strh r3, [r7, #10] + u16_t offset = (u16_t)l; + 80066cc: 7bfb ldrb r3, [r7, #15] + 80066ce: 827b strh r3, [r7, #18] + void *payload; + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloced_custom(length=%"U16_F")\n", length)); + + if (LWIP_MEM_ALIGN_SIZE(offset) + length > payload_mem_len) { + 80066d0: 8a7b ldrh r3, [r7, #18] + 80066d2: 3303 adds r3, #3 + 80066d4: f023 0203 bic.w r2, r3, #3 + 80066d8: 89bb ldrh r3, [r7, #12] + 80066da: 441a add r2, r3 + 80066dc: 8cbb ldrh r3, [r7, #36] @ 0x24 + 80066de: 429a cmp r2, r3 + 80066e0: d901 bls.n 80066e6 + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_WARNING, ("pbuf_alloced_custom(length=%"U16_F") buffer too short\n", length)); + return NULL; + 80066e2: 2300 movs r3, #0 + 80066e4: e018 b.n 8006718 + } + + if (payload_mem != NULL) { + 80066e6: 6a3b ldr r3, [r7, #32] + 80066e8: 2b00 cmp r3, #0 + 80066ea: d007 beq.n 80066fc + payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset); + 80066ec: 8a7b ldrh r3, [r7, #18] + 80066ee: 3303 adds r3, #3 + 80066f0: f023 0303 bic.w r3, r3, #3 + 80066f4: 6a3a ldr r2, [r7, #32] + 80066f6: 4413 add r3, r2 + 80066f8: 617b str r3, [r7, #20] + 80066fa: e001 b.n 8006700 + } else { + payload = NULL; + 80066fc: 2300 movs r3, #0 + 80066fe: 617b str r3, [r7, #20] + } + pbuf_init_alloced_pbuf(&p->pbuf, payload, length, length, type, PBUF_FLAG_IS_CUSTOM); + 8006700: 6878 ldr r0, [r7, #4] + 8006702: 89b9 ldrh r1, [r7, #12] + 8006704: 89ba ldrh r2, [r7, #12] + 8006706: 2302 movs r3, #2 + 8006708: 9301 str r3, [sp, #4] + 800670a: 897b ldrh r3, [r7, #10] + 800670c: 9300 str r3, [sp, #0] + 800670e: 460b mov r3, r1 + 8006710: 6979 ldr r1, [r7, #20] + 8006712: f7ff fe7d bl 8006410 + return &p->pbuf; + 8006716: 687b ldr r3, [r7, #4] +} + 8006718: 4618 mov r0, r3 + 800671a: 3718 adds r7, #24 + 800671c: 46bd mov sp, r7 + 800671e: bd80 pop {r7, pc} + +08006720 : + * + * @note Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain). + */ +void +pbuf_realloc(struct pbuf *p, u16_t new_len) +{ + 8006720: b580 push {r7, lr} + 8006722: b084 sub sp, #16 + 8006724: af00 add r7, sp, #0 + 8006726: 6078 str r0, [r7, #4] + 8006728: 460b mov r3, r1 + 800672a: 807b strh r3, [r7, #2] + struct pbuf *q; + u16_t rem_len; /* remaining length */ + u16_t shrink; + + LWIP_ASSERT("pbuf_realloc: p != NULL", p != NULL); + 800672c: 687b ldr r3, [r7, #4] + 800672e: 2b00 cmp r3, #0 + 8006730: d106 bne.n 8006740 + 8006732: 4b39 ldr r3, [pc, #228] @ (8006818 ) + 8006734: f44f 72cc mov.w r2, #408 @ 0x198 + 8006738: 4938 ldr r1, [pc, #224] @ (800681c ) + 800673a: 4839 ldr r0, [pc, #228] @ (8006820 ) + 800673c: f00a ff5c bl 80115f8 + + /* desired length larger than current length? */ + if (new_len >= p->tot_len) { + 8006740: 687b ldr r3, [r7, #4] + 8006742: 891b ldrh r3, [r3, #8] + 8006744: 887a ldrh r2, [r7, #2] + 8006746: 429a cmp r2, r3 + 8006748: d261 bcs.n 800680e + return; + } + + /* the pbuf chain grows by (new_len - p->tot_len) bytes + * (which may be negative in case of shrinking) */ + shrink = (u16_t)(p->tot_len - new_len); + 800674a: 687b ldr r3, [r7, #4] + 800674c: 891a ldrh r2, [r3, #8] + 800674e: 887b ldrh r3, [r7, #2] + 8006750: 1ad3 subs r3, r2, r3 + 8006752: 813b strh r3, [r7, #8] + + /* first, step over any pbufs that should remain in the chain */ + rem_len = new_len; + 8006754: 887b ldrh r3, [r7, #2] + 8006756: 817b strh r3, [r7, #10] + q = p; + 8006758: 687b ldr r3, [r7, #4] + 800675a: 60fb str r3, [r7, #12] + /* should this pbuf be kept? */ + while (rem_len > q->len) { + 800675c: e018 b.n 8006790 + /* decrease remaining length by pbuf length */ + rem_len = (u16_t)(rem_len - q->len); + 800675e: 68fb ldr r3, [r7, #12] + 8006760: 895b ldrh r3, [r3, #10] + 8006762: 897a ldrh r2, [r7, #10] + 8006764: 1ad3 subs r3, r2, r3 + 8006766: 817b strh r3, [r7, #10] + /* decrease total length indicator */ + q->tot_len = (u16_t)(q->tot_len - shrink); + 8006768: 68fb ldr r3, [r7, #12] + 800676a: 891a ldrh r2, [r3, #8] + 800676c: 893b ldrh r3, [r7, #8] + 800676e: 1ad3 subs r3, r2, r3 + 8006770: b29a uxth r2, r3 + 8006772: 68fb ldr r3, [r7, #12] + 8006774: 811a strh r2, [r3, #8] + /* proceed to next pbuf in chain */ + q = q->next; + 8006776: 68fb ldr r3, [r7, #12] + 8006778: 681b ldr r3, [r3, #0] + 800677a: 60fb str r3, [r7, #12] + LWIP_ASSERT("pbuf_realloc: q != NULL", q != NULL); + 800677c: 68fb ldr r3, [r7, #12] + 800677e: 2b00 cmp r3, #0 + 8006780: d106 bne.n 8006790 + 8006782: 4b25 ldr r3, [pc, #148] @ (8006818 ) + 8006784: f240 12af movw r2, #431 @ 0x1af + 8006788: 4926 ldr r1, [pc, #152] @ (8006824 ) + 800678a: 4825 ldr r0, [pc, #148] @ (8006820 ) + 800678c: f00a ff34 bl 80115f8 + while (rem_len > q->len) { + 8006790: 68fb ldr r3, [r7, #12] + 8006792: 895b ldrh r3, [r3, #10] + 8006794: 897a ldrh r2, [r7, #10] + 8006796: 429a cmp r2, r3 + 8006798: d8e1 bhi.n 800675e + /* we have now reached the new last pbuf (in q) */ + /* rem_len == desired length for pbuf q */ + + /* shrink allocated memory for PBUF_RAM */ + /* (other types merely adjust their length fields */ + if (pbuf_match_allocsrc(q, PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP) && (rem_len != q->len) + 800679a: 68fb ldr r3, [r7, #12] + 800679c: 7b1b ldrb r3, [r3, #12] + 800679e: f003 030f and.w r3, r3, #15 + 80067a2: 2b00 cmp r3, #0 + 80067a4: d11f bne.n 80067e6 + 80067a6: 68fb ldr r3, [r7, #12] + 80067a8: 895b ldrh r3, [r3, #10] + 80067aa: 897a ldrh r2, [r7, #10] + 80067ac: 429a cmp r2, r3 + 80067ae: d01a beq.n 80067e6 +#if LWIP_SUPPORT_CUSTOM_PBUF + && ((q->flags & PBUF_FLAG_IS_CUSTOM) == 0) + 80067b0: 68fb ldr r3, [r7, #12] + 80067b2: 7b5b ldrb r3, [r3, #13] + 80067b4: f003 0302 and.w r3, r3, #2 + 80067b8: 2b00 cmp r3, #0 + 80067ba: d114 bne.n 80067e6 +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ + ) { + /* reallocate and adjust the length of the pbuf that will be split */ + q = (struct pbuf *)mem_trim(q, (mem_size_t)(((u8_t *)q->payload - (u8_t *)q) + rem_len)); + 80067bc: 68fb ldr r3, [r7, #12] + 80067be: 685a ldr r2, [r3, #4] + 80067c0: 68fb ldr r3, [r7, #12] + 80067c2: 1ad2 subs r2, r2, r3 + 80067c4: 897b ldrh r3, [r7, #10] + 80067c6: 4413 add r3, r2 + 80067c8: 4619 mov r1, r3 + 80067ca: 68f8 ldr r0, [r7, #12] + 80067cc: f7fe ffc4 bl 8005758 + 80067d0: 60f8 str r0, [r7, #12] + LWIP_ASSERT("mem_trim returned q == NULL", q != NULL); + 80067d2: 68fb ldr r3, [r7, #12] + 80067d4: 2b00 cmp r3, #0 + 80067d6: d106 bne.n 80067e6 + 80067d8: 4b0f ldr r3, [pc, #60] @ (8006818 ) + 80067da: f240 12bd movw r2, #445 @ 0x1bd + 80067de: 4912 ldr r1, [pc, #72] @ (8006828 ) + 80067e0: 480f ldr r0, [pc, #60] @ (8006820 ) + 80067e2: f00a ff09 bl 80115f8 + } + /* adjust length fields for new last pbuf */ + q->len = rem_len; + 80067e6: 68fb ldr r3, [r7, #12] + 80067e8: 897a ldrh r2, [r7, #10] + 80067ea: 815a strh r2, [r3, #10] + q->tot_len = q->len; + 80067ec: 68fb ldr r3, [r7, #12] + 80067ee: 895a ldrh r2, [r3, #10] + 80067f0: 68fb ldr r3, [r7, #12] + 80067f2: 811a strh r2, [r3, #8] + + /* any remaining pbufs in chain? */ + if (q->next != NULL) { + 80067f4: 68fb ldr r3, [r7, #12] + 80067f6: 681b ldr r3, [r3, #0] + 80067f8: 2b00 cmp r3, #0 + 80067fa: d004 beq.n 8006806 + /* free remaining pbufs in chain */ + pbuf_free(q->next); + 80067fc: 68fb ldr r3, [r7, #12] + 80067fe: 681b ldr r3, [r3, #0] + 8006800: 4618 mov r0, r3 + 8006802: f000 f911 bl 8006a28 + } + /* q is last packet in chain */ + q->next = NULL; + 8006806: 68fb ldr r3, [r7, #12] + 8006808: 2200 movs r2, #0 + 800680a: 601a str r2, [r3, #0] + 800680c: e000 b.n 8006810 + return; + 800680e: bf00 nop + +} + 8006810: 3710 adds r7, #16 + 8006812: 46bd mov sp, r7 + 8006814: bd80 pop {r7, pc} + 8006816: bf00 nop + 8006818: 080165b4 .word 0x080165b4 + 800681c: 080166cc .word 0x080166cc + 8006820: 08016614 .word 0x08016614 + 8006824: 080166e4 .word 0x080166e4 + 8006828: 080166fc .word 0x080166fc + +0800682c : + * @return non-zero on failure, zero on success. + * + */ +static u8_t +pbuf_add_header_impl(struct pbuf *p, size_t header_size_increment, u8_t force) +{ + 800682c: b580 push {r7, lr} + 800682e: b086 sub sp, #24 + 8006830: af00 add r7, sp, #0 + 8006832: 60f8 str r0, [r7, #12] + 8006834: 60b9 str r1, [r7, #8] + 8006836: 4613 mov r3, r2 + 8006838: 71fb strb r3, [r7, #7] + u16_t type_internal; + void *payload; + u16_t increment_magnitude; + + LWIP_ASSERT("p != NULL", p != NULL); + 800683a: 68fb ldr r3, [r7, #12] + 800683c: 2b00 cmp r3, #0 + 800683e: d106 bne.n 800684e + 8006840: 4b2b ldr r3, [pc, #172] @ (80068f0 ) + 8006842: f240 12df movw r2, #479 @ 0x1df + 8006846: 492b ldr r1, [pc, #172] @ (80068f4 ) + 8006848: 482b ldr r0, [pc, #172] @ (80068f8 ) + 800684a: f00a fed5 bl 80115f8 + if ((p == NULL) || (header_size_increment > 0xFFFF)) { + 800684e: 68fb ldr r3, [r7, #12] + 8006850: 2b00 cmp r3, #0 + 8006852: d003 beq.n 800685c + 8006854: 68bb ldr r3, [r7, #8] + 8006856: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 800685a: d301 bcc.n 8006860 + return 1; + 800685c: 2301 movs r3, #1 + 800685e: e043 b.n 80068e8 + } + if (header_size_increment == 0) { + 8006860: 68bb ldr r3, [r7, #8] + 8006862: 2b00 cmp r3, #0 + 8006864: d101 bne.n 800686a + return 0; + 8006866: 2300 movs r3, #0 + 8006868: e03e b.n 80068e8 + } + + increment_magnitude = (u16_t)header_size_increment; + 800686a: 68bb ldr r3, [r7, #8] + 800686c: 827b strh r3, [r7, #18] + /* Do not allow tot_len to wrap as a result. */ + if ((u16_t)(increment_magnitude + p->tot_len) < increment_magnitude) { + 800686e: 68fb ldr r3, [r7, #12] + 8006870: 891a ldrh r2, [r3, #8] + 8006872: 8a7b ldrh r3, [r7, #18] + 8006874: 4413 add r3, r2 + 8006876: b29b uxth r3, r3 + 8006878: 8a7a ldrh r2, [r7, #18] + 800687a: 429a cmp r2, r3 + 800687c: d901 bls.n 8006882 + return 1; + 800687e: 2301 movs r3, #1 + 8006880: e032 b.n 80068e8 + } + + type_internal = p->type_internal; + 8006882: 68fb ldr r3, [r7, #12] + 8006884: 7b1b ldrb r3, [r3, #12] + 8006886: 823b strh r3, [r7, #16] + + /* pbuf types containing payloads? */ + if (type_internal & PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS) { + 8006888: 8a3b ldrh r3, [r7, #16] + 800688a: f003 0380 and.w r3, r3, #128 @ 0x80 + 800688e: 2b00 cmp r3, #0 + 8006890: d00c beq.n 80068ac + /* set new payload pointer */ + payload = (u8_t *)p->payload - header_size_increment; + 8006892: 68fb ldr r3, [r7, #12] + 8006894: 685a ldr r2, [r3, #4] + 8006896: 68bb ldr r3, [r7, #8] + 8006898: 425b negs r3, r3 + 800689a: 4413 add r3, r2 + 800689c: 617b str r3, [r7, #20] + /* boundary check fails? */ + if ((u8_t *)payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) { + 800689e: 68fb ldr r3, [r7, #12] + 80068a0: 3310 adds r3, #16 + 80068a2: 697a ldr r2, [r7, #20] + 80068a4: 429a cmp r2, r3 + 80068a6: d20d bcs.n 80068c4 + LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, + ("pbuf_add_header: failed as %p < %p (not enough space for new header size)\n", + (void *)payload, (void *)((u8_t *)p + SIZEOF_STRUCT_PBUF))); + /* bail out unsuccessfully */ + return 1; + 80068a8: 2301 movs r3, #1 + 80068aa: e01d b.n 80068e8 + } + /* pbuf types referring to external payloads? */ + } else { + /* hide a header in the payload? */ + if (force) { + 80068ac: 79fb ldrb r3, [r7, #7] + 80068ae: 2b00 cmp r3, #0 + 80068b0: d006 beq.n 80068c0 + payload = (u8_t *)p->payload - header_size_increment; + 80068b2: 68fb ldr r3, [r7, #12] + 80068b4: 685a ldr r2, [r3, #4] + 80068b6: 68bb ldr r3, [r7, #8] + 80068b8: 425b negs r3, r3 + 80068ba: 4413 add r3, r2 + 80068bc: 617b str r3, [r7, #20] + 80068be: e001 b.n 80068c4 + } else { + /* cannot expand payload to front (yet!) + * bail out unsuccessfully */ + return 1; + 80068c0: 2301 movs r3, #1 + 80068c2: e011 b.n 80068e8 + } + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_add_header: old %p new %p (%"U16_F")\n", + (void *)p->payload, (void *)payload, increment_magnitude)); + + /* modify pbuf fields */ + p->payload = payload; + 80068c4: 68fb ldr r3, [r7, #12] + 80068c6: 697a ldr r2, [r7, #20] + 80068c8: 605a str r2, [r3, #4] + p->len = (u16_t)(p->len + increment_magnitude); + 80068ca: 68fb ldr r3, [r7, #12] + 80068cc: 895a ldrh r2, [r3, #10] + 80068ce: 8a7b ldrh r3, [r7, #18] + 80068d0: 4413 add r3, r2 + 80068d2: b29a uxth r2, r3 + 80068d4: 68fb ldr r3, [r7, #12] + 80068d6: 815a strh r2, [r3, #10] + p->tot_len = (u16_t)(p->tot_len + increment_magnitude); + 80068d8: 68fb ldr r3, [r7, #12] + 80068da: 891a ldrh r2, [r3, #8] + 80068dc: 8a7b ldrh r3, [r7, #18] + 80068de: 4413 add r3, r2 + 80068e0: b29a uxth r2, r3 + 80068e2: 68fb ldr r3, [r7, #12] + 80068e4: 811a strh r2, [r3, #8] + + + return 0; + 80068e6: 2300 movs r3, #0 +} + 80068e8: 4618 mov r0, r3 + 80068ea: 3718 adds r7, #24 + 80068ec: 46bd mov sp, r7 + 80068ee: bd80 pop {r7, pc} + 80068f0: 080165b4 .word 0x080165b4 + 80068f4: 08016718 .word 0x08016718 + 80068f8: 08016614 .word 0x08016614 + +080068fc : + * @return non-zero on failure, zero on success. + * + */ +u8_t +pbuf_add_header(struct pbuf *p, size_t header_size_increment) +{ + 80068fc: b580 push {r7, lr} + 80068fe: b082 sub sp, #8 + 8006900: af00 add r7, sp, #0 + 8006902: 6078 str r0, [r7, #4] + 8006904: 6039 str r1, [r7, #0] + return pbuf_add_header_impl(p, header_size_increment, 0); + 8006906: 2200 movs r2, #0 + 8006908: 6839 ldr r1, [r7, #0] + 800690a: 6878 ldr r0, [r7, #4] + 800690c: f7ff ff8e bl 800682c + 8006910: 4603 mov r3, r0 +} + 8006912: 4618 mov r0, r3 + 8006914: 3708 adds r7, #8 + 8006916: 46bd mov sp, r7 + 8006918: bd80 pop {r7, pc} + ... + +0800691c : + * @return non-zero on failure, zero on success. + * + */ +u8_t +pbuf_remove_header(struct pbuf *p, size_t header_size_decrement) +{ + 800691c: b580 push {r7, lr} + 800691e: b084 sub sp, #16 + 8006920: af00 add r7, sp, #0 + 8006922: 6078 str r0, [r7, #4] + 8006924: 6039 str r1, [r7, #0] + void *payload; + u16_t increment_magnitude; + + LWIP_ASSERT("p != NULL", p != NULL); + 8006926: 687b ldr r3, [r7, #4] + 8006928: 2b00 cmp r3, #0 + 800692a: d106 bne.n 800693a + 800692c: 4b20 ldr r3, [pc, #128] @ (80069b0 ) + 800692e: f240 224b movw r2, #587 @ 0x24b + 8006932: 4920 ldr r1, [pc, #128] @ (80069b4 ) + 8006934: 4820 ldr r0, [pc, #128] @ (80069b8 ) + 8006936: f00a fe5f bl 80115f8 + if ((p == NULL) || (header_size_decrement > 0xFFFF)) { + 800693a: 687b ldr r3, [r7, #4] + 800693c: 2b00 cmp r3, #0 + 800693e: d003 beq.n 8006948 + 8006940: 683b ldr r3, [r7, #0] + 8006942: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8006946: d301 bcc.n 800694c + return 1; + 8006948: 2301 movs r3, #1 + 800694a: e02c b.n 80069a6 + } + if (header_size_decrement == 0) { + 800694c: 683b ldr r3, [r7, #0] + 800694e: 2b00 cmp r3, #0 + 8006950: d101 bne.n 8006956 + return 0; + 8006952: 2300 movs r3, #0 + 8006954: e027 b.n 80069a6 + } + + increment_magnitude = (u16_t)header_size_decrement; + 8006956: 683b ldr r3, [r7, #0] + 8006958: 81fb strh r3, [r7, #14] + /* Check that we aren't going to move off the end of the pbuf */ + LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;); + 800695a: 687b ldr r3, [r7, #4] + 800695c: 895b ldrh r3, [r3, #10] + 800695e: 89fa ldrh r2, [r7, #14] + 8006960: 429a cmp r2, r3 + 8006962: d908 bls.n 8006976 + 8006964: 4b12 ldr r3, [pc, #72] @ (80069b0 ) + 8006966: f240 2255 movw r2, #597 @ 0x255 + 800696a: 4914 ldr r1, [pc, #80] @ (80069bc ) + 800696c: 4812 ldr r0, [pc, #72] @ (80069b8 ) + 800696e: f00a fe43 bl 80115f8 + 8006972: 2301 movs r3, #1 + 8006974: e017 b.n 80069a6 + + /* remember current payload pointer */ + payload = p->payload; + 8006976: 687b ldr r3, [r7, #4] + 8006978: 685b ldr r3, [r3, #4] + 800697a: 60bb str r3, [r7, #8] + LWIP_UNUSED_ARG(payload); /* only used in LWIP_DEBUGF below */ + + /* increase payload pointer (guarded by length check above) */ + p->payload = (u8_t *)p->payload + header_size_decrement; + 800697c: 687b ldr r3, [r7, #4] + 800697e: 685a ldr r2, [r3, #4] + 8006980: 683b ldr r3, [r7, #0] + 8006982: 441a add r2, r3 + 8006984: 687b ldr r3, [r7, #4] + 8006986: 605a str r2, [r3, #4] + /* modify pbuf length fields */ + p->len = (u16_t)(p->len - increment_magnitude); + 8006988: 687b ldr r3, [r7, #4] + 800698a: 895a ldrh r2, [r3, #10] + 800698c: 89fb ldrh r3, [r7, #14] + 800698e: 1ad3 subs r3, r2, r3 + 8006990: b29a uxth r2, r3 + 8006992: 687b ldr r3, [r7, #4] + 8006994: 815a strh r2, [r3, #10] + p->tot_len = (u16_t)(p->tot_len - increment_magnitude); + 8006996: 687b ldr r3, [r7, #4] + 8006998: 891a ldrh r2, [r3, #8] + 800699a: 89fb ldrh r3, [r7, #14] + 800699c: 1ad3 subs r3, r2, r3 + 800699e: b29a uxth r2, r3 + 80069a0: 687b ldr r3, [r7, #4] + 80069a2: 811a strh r2, [r3, #8] + + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_remove_header: old %p new %p (%"U16_F")\n", + (void *)payload, (void *)p->payload, increment_magnitude)); + + return 0; + 80069a4: 2300 movs r3, #0 +} + 80069a6: 4618 mov r0, r3 + 80069a8: 3710 adds r7, #16 + 80069aa: 46bd mov sp, r7 + 80069ac: bd80 pop {r7, pc} + 80069ae: bf00 nop + 80069b0: 080165b4 .word 0x080165b4 + 80069b4: 08016718 .word 0x08016718 + 80069b8: 08016614 .word 0x08016614 + 80069bc: 08016724 .word 0x08016724 + +080069c0 : + +static u8_t +pbuf_header_impl(struct pbuf *p, s16_t header_size_increment, u8_t force) +{ + 80069c0: b580 push {r7, lr} + 80069c2: b082 sub sp, #8 + 80069c4: af00 add r7, sp, #0 + 80069c6: 6078 str r0, [r7, #4] + 80069c8: 460b mov r3, r1 + 80069ca: 807b strh r3, [r7, #2] + 80069cc: 4613 mov r3, r2 + 80069ce: 707b strb r3, [r7, #1] + if (header_size_increment < 0) { + 80069d0: f9b7 3002 ldrsh.w r3, [r7, #2] + 80069d4: 2b00 cmp r3, #0 + 80069d6: da08 bge.n 80069ea + return pbuf_remove_header(p, (size_t) - header_size_increment); + 80069d8: f9b7 3002 ldrsh.w r3, [r7, #2] + 80069dc: 425b negs r3, r3 + 80069de: 4619 mov r1, r3 + 80069e0: 6878 ldr r0, [r7, #4] + 80069e2: f7ff ff9b bl 800691c + 80069e6: 4603 mov r3, r0 + 80069e8: e007 b.n 80069fa + } else { + return pbuf_add_header_impl(p, (size_t)header_size_increment, force); + 80069ea: f9b7 3002 ldrsh.w r3, [r7, #2] + 80069ee: 787a ldrb r2, [r7, #1] + 80069f0: 4619 mov r1, r3 + 80069f2: 6878 ldr r0, [r7, #4] + 80069f4: f7ff ff1a bl 800682c + 80069f8: 4603 mov r3, r0 + } +} + 80069fa: 4618 mov r0, r3 + 80069fc: 3708 adds r7, #8 + 80069fe: 46bd mov sp, r7 + 8006a00: bd80 pop {r7, pc} + +08006a02 : + * Same as pbuf_header but does not check if 'header_size > 0' is allowed. + * This is used internally only, to allow PBUF_REF for RX. + */ +u8_t +pbuf_header_force(struct pbuf *p, s16_t header_size_increment) +{ + 8006a02: b580 push {r7, lr} + 8006a04: b082 sub sp, #8 + 8006a06: af00 add r7, sp, #0 + 8006a08: 6078 str r0, [r7, #4] + 8006a0a: 460b mov r3, r1 + 8006a0c: 807b strh r3, [r7, #2] + return pbuf_header_impl(p, header_size_increment, 1); + 8006a0e: f9b7 3002 ldrsh.w r3, [r7, #2] + 8006a12: 2201 movs r2, #1 + 8006a14: 4619 mov r1, r3 + 8006a16: 6878 ldr r0, [r7, #4] + 8006a18: f7ff ffd2 bl 80069c0 + 8006a1c: 4603 mov r3, r0 +} + 8006a1e: 4618 mov r0, r3 + 8006a20: 3708 adds r7, #8 + 8006a22: 46bd mov sp, r7 + 8006a24: bd80 pop {r7, pc} + ... + +08006a28 : + * 1->1->1 becomes ....... + * + */ +u8_t +pbuf_free(struct pbuf *p) +{ + 8006a28: b580 push {r7, lr} + 8006a2a: b086 sub sp, #24 + 8006a2c: af00 add r7, sp, #0 + 8006a2e: 6078 str r0, [r7, #4] + u8_t alloc_src; + struct pbuf *q; + u8_t count; + + if (p == NULL) { + 8006a30: 687b ldr r3, [r7, #4] + 8006a32: 2b00 cmp r3, #0 + 8006a34: d10b bne.n 8006a4e + LWIP_ASSERT("p != NULL", p != NULL); + 8006a36: 687b ldr r3, [r7, #4] + 8006a38: 2b00 cmp r3, #0 + 8006a3a: d106 bne.n 8006a4a + 8006a3c: 4b38 ldr r3, [pc, #224] @ (8006b20 ) + 8006a3e: f44f 7237 mov.w r2, #732 @ 0x2dc + 8006a42: 4938 ldr r1, [pc, #224] @ (8006b24 ) + 8006a44: 4838 ldr r0, [pc, #224] @ (8006b28 ) + 8006a46: f00a fdd7 bl 80115f8 + /* if assertions are disabled, proceed with debug output */ + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("pbuf_free(p == NULL) was called.\n")); + return 0; + 8006a4a: 2300 movs r3, #0 + 8006a4c: e063 b.n 8006b16 + } + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free(%p)\n", (void *)p)); + + PERF_START; + + count = 0; + 8006a4e: 2300 movs r3, #0 + 8006a50: 75fb strb r3, [r7, #23] + /* de-allocate all consecutive pbufs from the head of the chain that + * obtain a zero reference count after decrementing*/ + while (p != NULL) { + 8006a52: e05c b.n 8006b0e + /* Since decrementing ref cannot be guaranteed to be a single machine operation + * we must protect it. We put the new ref into a local variable to prevent + * further protection. */ + SYS_ARCH_PROTECT(old_level); + /* all pbufs in a chain are referenced at least once */ + LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0); + 8006a54: 687b ldr r3, [r7, #4] + 8006a56: 7b9b ldrb r3, [r3, #14] + 8006a58: 2b00 cmp r3, #0 + 8006a5a: d106 bne.n 8006a6a + 8006a5c: 4b30 ldr r3, [pc, #192] @ (8006b20 ) + 8006a5e: f240 22f1 movw r2, #753 @ 0x2f1 + 8006a62: 4932 ldr r1, [pc, #200] @ (8006b2c ) + 8006a64: 4830 ldr r0, [pc, #192] @ (8006b28 ) + 8006a66: f00a fdc7 bl 80115f8 + /* decrease reference count (number of pointers to pbuf) */ + ref = --(p->ref); + 8006a6a: 687b ldr r3, [r7, #4] + 8006a6c: 7b9b ldrb r3, [r3, #14] + 8006a6e: 3b01 subs r3, #1 + 8006a70: b2da uxtb r2, r3 + 8006a72: 687b ldr r3, [r7, #4] + 8006a74: 739a strb r2, [r3, #14] + 8006a76: 687b ldr r3, [r7, #4] + 8006a78: 7b9b ldrb r3, [r3, #14] + 8006a7a: 75bb strb r3, [r7, #22] + SYS_ARCH_UNPROTECT(old_level); + /* this pbuf is no longer referenced to? */ + if (ref == 0) { + 8006a7c: 7dbb ldrb r3, [r7, #22] + 8006a7e: 2b00 cmp r3, #0 + 8006a80: d143 bne.n 8006b0a + /* remember next pbuf in chain for next iteration */ + q = p->next; + 8006a82: 687b ldr r3, [r7, #4] + 8006a84: 681b ldr r3, [r3, #0] + 8006a86: 613b str r3, [r7, #16] + LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p)); + alloc_src = pbuf_get_allocsrc(p); + 8006a88: 687b ldr r3, [r7, #4] + 8006a8a: 7b1b ldrb r3, [r3, #12] + 8006a8c: f003 030f and.w r3, r3, #15 + 8006a90: 73fb strb r3, [r7, #15] +#if LWIP_SUPPORT_CUSTOM_PBUF + /* is this a custom pbuf? */ + if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) { + 8006a92: 687b ldr r3, [r7, #4] + 8006a94: 7b5b ldrb r3, [r3, #13] + 8006a96: f003 0302 and.w r3, r3, #2 + 8006a9a: 2b00 cmp r3, #0 + 8006a9c: d011 beq.n 8006ac2 + struct pbuf_custom *pc = (struct pbuf_custom *)p; + 8006a9e: 687b ldr r3, [r7, #4] + 8006aa0: 60bb str r3, [r7, #8] + LWIP_ASSERT("pc->custom_free_function != NULL", pc->custom_free_function != NULL); + 8006aa2: 68bb ldr r3, [r7, #8] + 8006aa4: 691b ldr r3, [r3, #16] + 8006aa6: 2b00 cmp r3, #0 + 8006aa8: d106 bne.n 8006ab8 + 8006aaa: 4b1d ldr r3, [pc, #116] @ (8006b20 ) + 8006aac: f240 22ff movw r2, #767 @ 0x2ff + 8006ab0: 491f ldr r1, [pc, #124] @ (8006b30 ) + 8006ab2: 481d ldr r0, [pc, #116] @ (8006b28 ) + 8006ab4: f00a fda0 bl 80115f8 + pc->custom_free_function(p); + 8006ab8: 68bb ldr r3, [r7, #8] + 8006aba: 691b ldr r3, [r3, #16] + 8006abc: 6878 ldr r0, [r7, #4] + 8006abe: 4798 blx r3 + 8006ac0: e01d b.n 8006afe + } else +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ + { + /* is this a pbuf from the pool? */ + if (alloc_src == PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL) { + 8006ac2: 7bfb ldrb r3, [r7, #15] + 8006ac4: 2b02 cmp r3, #2 + 8006ac6: d104 bne.n 8006ad2 + memp_free(MEMP_PBUF_POOL, p); + 8006ac8: 6879 ldr r1, [r7, #4] + 8006aca: 2008 movs r0, #8 + 8006acc: f7ff f92c bl 8005d28 + 8006ad0: e015 b.n 8006afe + /* is this a ROM or RAM referencing pbuf? */ + } else if (alloc_src == PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF) { + 8006ad2: 7bfb ldrb r3, [r7, #15] + 8006ad4: 2b01 cmp r3, #1 + 8006ad6: d104 bne.n 8006ae2 + memp_free(MEMP_PBUF, p); + 8006ad8: 6879 ldr r1, [r7, #4] + 8006ada: 2007 movs r0, #7 + 8006adc: f7ff f924 bl 8005d28 + 8006ae0: e00d b.n 8006afe + /* type == PBUF_RAM */ + } else if (alloc_src == PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP) { + 8006ae2: 7bfb ldrb r3, [r7, #15] + 8006ae4: 2b00 cmp r3, #0 + 8006ae6: d103 bne.n 8006af0 + mem_free(p); + 8006ae8: 6878 ldr r0, [r7, #4] + 8006aea: f7fe fdcb bl 8005684 + 8006aee: e006 b.n 8006afe + } else { + /* @todo: support freeing other types */ + LWIP_ASSERT("invalid pbuf type", 0); + 8006af0: 4b0b ldr r3, [pc, #44] @ (8006b20 ) + 8006af2: f240 320f movw r2, #783 @ 0x30f + 8006af6: 490f ldr r1, [pc, #60] @ (8006b34 ) + 8006af8: 480b ldr r0, [pc, #44] @ (8006b28 ) + 8006afa: f00a fd7d bl 80115f8 + } + } + count++; + 8006afe: 7dfb ldrb r3, [r7, #23] + 8006b00: 3301 adds r3, #1 + 8006b02: 75fb strb r3, [r7, #23] + /* proceed to next pbuf */ + p = q; + 8006b04: 693b ldr r3, [r7, #16] + 8006b06: 607b str r3, [r7, #4] + 8006b08: e001 b.n 8006b0e + /* p->ref > 0, this pbuf is still referenced to */ + /* (and so the remaining pbufs in chain as well) */ + } else { + LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: %p has ref %"U16_F", ending here.\n", (void *)p, (u16_t)ref)); + /* stop walking through the chain */ + p = NULL; + 8006b0a: 2300 movs r3, #0 + 8006b0c: 607b str r3, [r7, #4] + while (p != NULL) { + 8006b0e: 687b ldr r3, [r7, #4] + 8006b10: 2b00 cmp r3, #0 + 8006b12: d19f bne.n 8006a54 + } + } + PERF_STOP("pbuf_free"); + /* return number of de-allocated pbufs */ + return count; + 8006b14: 7dfb ldrb r3, [r7, #23] +} + 8006b16: 4618 mov r0, r3 + 8006b18: 3718 adds r7, #24 + 8006b1a: 46bd mov sp, r7 + 8006b1c: bd80 pop {r7, pc} + 8006b1e: bf00 nop + 8006b20: 080165b4 .word 0x080165b4 + 8006b24: 08016718 .word 0x08016718 + 8006b28: 08016614 .word 0x08016614 + 8006b2c: 08016744 .word 0x08016744 + 8006b30: 0801675c .word 0x0801675c + 8006b34: 08016780 .word 0x08016780 + +08006b38 : + * @param p first pbuf of chain + * @return the number of pbufs in a chain + */ +u16_t +pbuf_clen(const struct pbuf *p) +{ + 8006b38: b480 push {r7} + 8006b3a: b085 sub sp, #20 + 8006b3c: af00 add r7, sp, #0 + 8006b3e: 6078 str r0, [r7, #4] + u16_t len; + + len = 0; + 8006b40: 2300 movs r3, #0 + 8006b42: 81fb strh r3, [r7, #14] + while (p != NULL) { + 8006b44: e005 b.n 8006b52 + ++len; + 8006b46: 89fb ldrh r3, [r7, #14] + 8006b48: 3301 adds r3, #1 + 8006b4a: 81fb strh r3, [r7, #14] + p = p->next; + 8006b4c: 687b ldr r3, [r7, #4] + 8006b4e: 681b ldr r3, [r3, #0] + 8006b50: 607b str r3, [r7, #4] + while (p != NULL) { + 8006b52: 687b ldr r3, [r7, #4] + 8006b54: 2b00 cmp r3, #0 + 8006b56: d1f6 bne.n 8006b46 + } + return len; + 8006b58: 89fb ldrh r3, [r7, #14] +} + 8006b5a: 4618 mov r0, r3 + 8006b5c: 3714 adds r7, #20 + 8006b5e: 46bd mov sp, r7 + 8006b60: f85d 7b04 ldr.w r7, [sp], #4 + 8006b64: 4770 bx lr + ... + +08006b68 : + * @param p pbuf to increase reference counter of + * + */ +void +pbuf_ref(struct pbuf *p) +{ + 8006b68: b580 push {r7, lr} + 8006b6a: b082 sub sp, #8 + 8006b6c: af00 add r7, sp, #0 + 8006b6e: 6078 str r0, [r7, #4] + /* pbuf given? */ + if (p != NULL) { + 8006b70: 687b ldr r3, [r7, #4] + 8006b72: 2b00 cmp r3, #0 + 8006b74: d010 beq.n 8006b98 + SYS_ARCH_SET(p->ref, (LWIP_PBUF_REF_T)(p->ref + 1)); + 8006b76: 687b ldr r3, [r7, #4] + 8006b78: 7b9b ldrb r3, [r3, #14] + 8006b7a: 3301 adds r3, #1 + 8006b7c: b2da uxtb r2, r3 + 8006b7e: 687b ldr r3, [r7, #4] + 8006b80: 739a strb r2, [r3, #14] + LWIP_ASSERT("pbuf ref overflow", p->ref > 0); + 8006b82: 687b ldr r3, [r7, #4] + 8006b84: 7b9b ldrb r3, [r3, #14] + 8006b86: 2b00 cmp r3, #0 + 8006b88: d106 bne.n 8006b98 + 8006b8a: 4b05 ldr r3, [pc, #20] @ (8006ba0 ) + 8006b8c: f240 3242 movw r2, #834 @ 0x342 + 8006b90: 4904 ldr r1, [pc, #16] @ (8006ba4 ) + 8006b92: 4805 ldr r0, [pc, #20] @ (8006ba8 ) + 8006b94: f00a fd30 bl 80115f8 + } +} + 8006b98: bf00 nop + 8006b9a: 3708 adds r7, #8 + 8006b9c: 46bd mov sp, r7 + 8006b9e: bd80 pop {r7, pc} + 8006ba0: 080165b4 .word 0x080165b4 + 8006ba4: 08016794 .word 0x08016794 + 8006ba8: 08016614 .word 0x08016614 + +08006bac : + * + * @see pbuf_chain() + */ +void +pbuf_cat(struct pbuf *h, struct pbuf *t) +{ + 8006bac: b580 push {r7, lr} + 8006bae: b084 sub sp, #16 + 8006bb0: af00 add r7, sp, #0 + 8006bb2: 6078 str r0, [r7, #4] + 8006bb4: 6039 str r1, [r7, #0] + struct pbuf *p; + + LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)", + 8006bb6: 687b ldr r3, [r7, #4] + 8006bb8: 2b00 cmp r3, #0 + 8006bba: d002 beq.n 8006bc2 + 8006bbc: 683b ldr r3, [r7, #0] + 8006bbe: 2b00 cmp r3, #0 + 8006bc0: d107 bne.n 8006bd2 + 8006bc2: 4b20 ldr r3, [pc, #128] @ (8006c44 ) + 8006bc4: f240 3259 movw r2, #857 @ 0x359 + 8006bc8: 491f ldr r1, [pc, #124] @ (8006c48 ) + 8006bca: 4820 ldr r0, [pc, #128] @ (8006c4c ) + 8006bcc: f00a fd14 bl 80115f8 + 8006bd0: e034 b.n 8006c3c + ((h != NULL) && (t != NULL)), return;); + + /* proceed to last pbuf of chain */ + for (p = h; p->next != NULL; p = p->next) { + 8006bd2: 687b ldr r3, [r7, #4] + 8006bd4: 60fb str r3, [r7, #12] + 8006bd6: e00a b.n 8006bee + /* add total length of second chain to all totals of first chain */ + p->tot_len = (u16_t)(p->tot_len + t->tot_len); + 8006bd8: 68fb ldr r3, [r7, #12] + 8006bda: 891a ldrh r2, [r3, #8] + 8006bdc: 683b ldr r3, [r7, #0] + 8006bde: 891b ldrh r3, [r3, #8] + 8006be0: 4413 add r3, r2 + 8006be2: b29a uxth r2, r3 + 8006be4: 68fb ldr r3, [r7, #12] + 8006be6: 811a strh r2, [r3, #8] + for (p = h; p->next != NULL; p = p->next) { + 8006be8: 68fb ldr r3, [r7, #12] + 8006bea: 681b ldr r3, [r3, #0] + 8006bec: 60fb str r3, [r7, #12] + 8006bee: 68fb ldr r3, [r7, #12] + 8006bf0: 681b ldr r3, [r3, #0] + 8006bf2: 2b00 cmp r3, #0 + 8006bf4: d1f0 bne.n 8006bd8 + } + /* { p is last pbuf of first h chain, p->next == NULL } */ + LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len); + 8006bf6: 68fb ldr r3, [r7, #12] + 8006bf8: 891a ldrh r2, [r3, #8] + 8006bfa: 68fb ldr r3, [r7, #12] + 8006bfc: 895b ldrh r3, [r3, #10] + 8006bfe: 429a cmp r2, r3 + 8006c00: d006 beq.n 8006c10 + 8006c02: 4b10 ldr r3, [pc, #64] @ (8006c44 ) + 8006c04: f240 3262 movw r2, #866 @ 0x362 + 8006c08: 4911 ldr r1, [pc, #68] @ (8006c50 ) + 8006c0a: 4810 ldr r0, [pc, #64] @ (8006c4c ) + 8006c0c: f00a fcf4 bl 80115f8 + LWIP_ASSERT("p->next == NULL", p->next == NULL); + 8006c10: 68fb ldr r3, [r7, #12] + 8006c12: 681b ldr r3, [r3, #0] + 8006c14: 2b00 cmp r3, #0 + 8006c16: d006 beq.n 8006c26 + 8006c18: 4b0a ldr r3, [pc, #40] @ (8006c44 ) + 8006c1a: f240 3263 movw r2, #867 @ 0x363 + 8006c1e: 490d ldr r1, [pc, #52] @ (8006c54 ) + 8006c20: 480a ldr r0, [pc, #40] @ (8006c4c ) + 8006c22: f00a fce9 bl 80115f8 + /* add total length of second chain to last pbuf total of first chain */ + p->tot_len = (u16_t)(p->tot_len + t->tot_len); + 8006c26: 68fb ldr r3, [r7, #12] + 8006c28: 891a ldrh r2, [r3, #8] + 8006c2a: 683b ldr r3, [r7, #0] + 8006c2c: 891b ldrh r3, [r3, #8] + 8006c2e: 4413 add r3, r2 + 8006c30: b29a uxth r2, r3 + 8006c32: 68fb ldr r3, [r7, #12] + 8006c34: 811a strh r2, [r3, #8] + /* chain last pbuf of head (p) with first of tail (t) */ + p->next = t; + 8006c36: 68fb ldr r3, [r7, #12] + 8006c38: 683a ldr r2, [r7, #0] + 8006c3a: 601a str r2, [r3, #0] + /* p->next now references t, but the caller will drop its reference to t, + * so netto there is no change to the reference count of t. + */ +} + 8006c3c: 3710 adds r7, #16 + 8006c3e: 46bd mov sp, r7 + 8006c40: bd80 pop {r7, pc} + 8006c42: bf00 nop + 8006c44: 080165b4 .word 0x080165b4 + 8006c48: 080167a8 .word 0x080167a8 + 8006c4c: 08016614 .word 0x08016614 + 8006c50: 080167e0 .word 0x080167e0 + 8006c54: 08016810 .word 0x08016810 + +08006c58 : + * The ->ref field of the first pbuf of the tail chain is adjusted. + * + */ +void +pbuf_chain(struct pbuf *h, struct pbuf *t) +{ + 8006c58: b580 push {r7, lr} + 8006c5a: b082 sub sp, #8 + 8006c5c: af00 add r7, sp, #0 + 8006c5e: 6078 str r0, [r7, #4] + 8006c60: 6039 str r1, [r7, #0] + pbuf_cat(h, t); + 8006c62: 6839 ldr r1, [r7, #0] + 8006c64: 6878 ldr r0, [r7, #4] + 8006c66: f7ff ffa1 bl 8006bac + /* t is now referenced by h */ + pbuf_ref(t); + 8006c6a: 6838 ldr r0, [r7, #0] + 8006c6c: f7ff ff7c bl 8006b68 + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t)); +} + 8006c70: bf00 nop + 8006c72: 3708 adds r7, #8 + 8006c74: 46bd mov sp, r7 + 8006c76: bd80 pop {r7, pc} + +08006c78 : + * ERR_ARG if one of the pbufs is NULL or p_to is not big + * enough to hold p_from + */ +err_t +pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from) +{ + 8006c78: b580 push {r7, lr} + 8006c7a: b086 sub sp, #24 + 8006c7c: af00 add r7, sp, #0 + 8006c7e: 6078 str r0, [r7, #4] + 8006c80: 6039 str r1, [r7, #0] + size_t offset_to = 0, offset_from = 0, len; + 8006c82: 2300 movs r3, #0 + 8006c84: 617b str r3, [r7, #20] + 8006c86: 2300 movs r3, #0 + 8006c88: 613b str r3, [r7, #16] + + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy(%p, %p)\n", + (const void *)p_to, (const void *)p_from)); + + /* is the target big enough to hold the source? */ + LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) && + 8006c8a: 687b ldr r3, [r7, #4] + 8006c8c: 2b00 cmp r3, #0 + 8006c8e: d008 beq.n 8006ca2 + 8006c90: 683b ldr r3, [r7, #0] + 8006c92: 2b00 cmp r3, #0 + 8006c94: d005 beq.n 8006ca2 + 8006c96: 687b ldr r3, [r7, #4] + 8006c98: 891a ldrh r2, [r3, #8] + 8006c9a: 683b ldr r3, [r7, #0] + 8006c9c: 891b ldrh r3, [r3, #8] + 8006c9e: 429a cmp r2, r3 + 8006ca0: d209 bcs.n 8006cb6 + 8006ca2: 4b57 ldr r3, [pc, #348] @ (8006e00 ) + 8006ca4: f240 32c9 movw r2, #969 @ 0x3c9 + 8006ca8: 4956 ldr r1, [pc, #344] @ (8006e04 ) + 8006caa: 4857 ldr r0, [pc, #348] @ (8006e08 ) + 8006cac: f00a fca4 bl 80115f8 + 8006cb0: f06f 030f mvn.w r3, #15 + 8006cb4: e09f b.n 8006df6 + (p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;); + + /* iterate through pbuf chain */ + do { + /* copy one part of the original chain */ + if ((p_to->len - offset_to) >= (p_from->len - offset_from)) { + 8006cb6: 687b ldr r3, [r7, #4] + 8006cb8: 895b ldrh r3, [r3, #10] + 8006cba: 461a mov r2, r3 + 8006cbc: 697b ldr r3, [r7, #20] + 8006cbe: 1ad2 subs r2, r2, r3 + 8006cc0: 683b ldr r3, [r7, #0] + 8006cc2: 895b ldrh r3, [r3, #10] + 8006cc4: 4619 mov r1, r3 + 8006cc6: 693b ldr r3, [r7, #16] + 8006cc8: 1acb subs r3, r1, r3 + 8006cca: 429a cmp r2, r3 + 8006ccc: d306 bcc.n 8006cdc + /* complete current p_from fits into current p_to */ + len = p_from->len - offset_from; + 8006cce: 683b ldr r3, [r7, #0] + 8006cd0: 895b ldrh r3, [r3, #10] + 8006cd2: 461a mov r2, r3 + 8006cd4: 693b ldr r3, [r7, #16] + 8006cd6: 1ad3 subs r3, r2, r3 + 8006cd8: 60fb str r3, [r7, #12] + 8006cda: e005 b.n 8006ce8 + } else { + /* current p_from does not fit into current p_to */ + len = p_to->len - offset_to; + 8006cdc: 687b ldr r3, [r7, #4] + 8006cde: 895b ldrh r3, [r3, #10] + 8006ce0: 461a mov r2, r3 + 8006ce2: 697b ldr r3, [r7, #20] + 8006ce4: 1ad3 subs r3, r2, r3 + 8006ce6: 60fb str r3, [r7, #12] + } + MEMCPY((u8_t *)p_to->payload + offset_to, (u8_t *)p_from->payload + offset_from, len); + 8006ce8: 687b ldr r3, [r7, #4] + 8006cea: 685a ldr r2, [r3, #4] + 8006cec: 697b ldr r3, [r7, #20] + 8006cee: 18d0 adds r0, r2, r3 + 8006cf0: 683b ldr r3, [r7, #0] + 8006cf2: 685a ldr r2, [r3, #4] + 8006cf4: 693b ldr r3, [r7, #16] + 8006cf6: 4413 add r3, r2 + 8006cf8: 68fa ldr r2, [r7, #12] + 8006cfa: 4619 mov r1, r3 + 8006cfc: f00a fd78 bl 80117f0 + offset_to += len; + 8006d00: 697a ldr r2, [r7, #20] + 8006d02: 68fb ldr r3, [r7, #12] + 8006d04: 4413 add r3, r2 + 8006d06: 617b str r3, [r7, #20] + offset_from += len; + 8006d08: 693a ldr r2, [r7, #16] + 8006d0a: 68fb ldr r3, [r7, #12] + 8006d0c: 4413 add r3, r2 + 8006d0e: 613b str r3, [r7, #16] + LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len); + 8006d10: 687b ldr r3, [r7, #4] + 8006d12: 895b ldrh r3, [r3, #10] + 8006d14: 461a mov r2, r3 + 8006d16: 697b ldr r3, [r7, #20] + 8006d18: 4293 cmp r3, r2 + 8006d1a: d906 bls.n 8006d2a + 8006d1c: 4b38 ldr r3, [pc, #224] @ (8006e00 ) + 8006d1e: f240 32d9 movw r2, #985 @ 0x3d9 + 8006d22: 493a ldr r1, [pc, #232] @ (8006e0c ) + 8006d24: 4838 ldr r0, [pc, #224] @ (8006e08 ) + 8006d26: f00a fc67 bl 80115f8 + LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len); + 8006d2a: 683b ldr r3, [r7, #0] + 8006d2c: 895b ldrh r3, [r3, #10] + 8006d2e: 461a mov r2, r3 + 8006d30: 693b ldr r3, [r7, #16] + 8006d32: 4293 cmp r3, r2 + 8006d34: d906 bls.n 8006d44 + 8006d36: 4b32 ldr r3, [pc, #200] @ (8006e00 ) + 8006d38: f240 32da movw r2, #986 @ 0x3da + 8006d3c: 4934 ldr r1, [pc, #208] @ (8006e10 ) + 8006d3e: 4832 ldr r0, [pc, #200] @ (8006e08 ) + 8006d40: f00a fc5a bl 80115f8 + if (offset_from >= p_from->len) { + 8006d44: 683b ldr r3, [r7, #0] + 8006d46: 895b ldrh r3, [r3, #10] + 8006d48: 461a mov r2, r3 + 8006d4a: 693b ldr r3, [r7, #16] + 8006d4c: 4293 cmp r3, r2 + 8006d4e: d304 bcc.n 8006d5a + /* on to next p_from (if any) */ + offset_from = 0; + 8006d50: 2300 movs r3, #0 + 8006d52: 613b str r3, [r7, #16] + p_from = p_from->next; + 8006d54: 683b ldr r3, [r7, #0] + 8006d56: 681b ldr r3, [r3, #0] + 8006d58: 603b str r3, [r7, #0] + } + if (offset_to == p_to->len) { + 8006d5a: 687b ldr r3, [r7, #4] + 8006d5c: 895b ldrh r3, [r3, #10] + 8006d5e: 461a mov r2, r3 + 8006d60: 697b ldr r3, [r7, #20] + 8006d62: 4293 cmp r3, r2 + 8006d64: d114 bne.n 8006d90 + /* on to next p_to (if any) */ + offset_to = 0; + 8006d66: 2300 movs r3, #0 + 8006d68: 617b str r3, [r7, #20] + p_to = p_to->next; + 8006d6a: 687b ldr r3, [r7, #4] + 8006d6c: 681b ldr r3, [r3, #0] + 8006d6e: 607b str r3, [r7, #4] + LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL), return ERR_ARG;); + 8006d70: 687b ldr r3, [r7, #4] + 8006d72: 2b00 cmp r3, #0 + 8006d74: d10c bne.n 8006d90 + 8006d76: 683b ldr r3, [r7, #0] + 8006d78: 2b00 cmp r3, #0 + 8006d7a: d009 beq.n 8006d90 + 8006d7c: 4b20 ldr r3, [pc, #128] @ (8006e00 ) + 8006d7e: f44f 7279 mov.w r2, #996 @ 0x3e4 + 8006d82: 4924 ldr r1, [pc, #144] @ (8006e14 ) + 8006d84: 4820 ldr r0, [pc, #128] @ (8006e08 ) + 8006d86: f00a fc37 bl 80115f8 + 8006d8a: f06f 030f mvn.w r3, #15 + 8006d8e: e032 b.n 8006df6 + } + + if ((p_from != NULL) && (p_from->len == p_from->tot_len)) { + 8006d90: 683b ldr r3, [r7, #0] + 8006d92: 2b00 cmp r3, #0 + 8006d94: d013 beq.n 8006dbe + 8006d96: 683b ldr r3, [r7, #0] + 8006d98: 895a ldrh r2, [r3, #10] + 8006d9a: 683b ldr r3, [r7, #0] + 8006d9c: 891b ldrh r3, [r3, #8] + 8006d9e: 429a cmp r2, r3 + 8006da0: d10d bne.n 8006dbe + /* don't copy more than one packet! */ + LWIP_ERROR("pbuf_copy() does not allow packet queues!", + 8006da2: 683b ldr r3, [r7, #0] + 8006da4: 681b ldr r3, [r3, #0] + 8006da6: 2b00 cmp r3, #0 + 8006da8: d009 beq.n 8006dbe + 8006daa: 4b15 ldr r3, [pc, #84] @ (8006e00 ) + 8006dac: f240 32e9 movw r2, #1001 @ 0x3e9 + 8006db0: 4919 ldr r1, [pc, #100] @ (8006e18 ) + 8006db2: 4815 ldr r0, [pc, #84] @ (8006e08 ) + 8006db4: f00a fc20 bl 80115f8 + 8006db8: f06f 0305 mvn.w r3, #5 + 8006dbc: e01b b.n 8006df6 + (p_from->next == NULL), return ERR_VAL;); + } + if ((p_to != NULL) && (p_to->len == p_to->tot_len)) { + 8006dbe: 687b ldr r3, [r7, #4] + 8006dc0: 2b00 cmp r3, #0 + 8006dc2: d013 beq.n 8006dec + 8006dc4: 687b ldr r3, [r7, #4] + 8006dc6: 895a ldrh r2, [r3, #10] + 8006dc8: 687b ldr r3, [r7, #4] + 8006dca: 891b ldrh r3, [r3, #8] + 8006dcc: 429a cmp r2, r3 + 8006dce: d10d bne.n 8006dec + /* don't copy more than one packet! */ + LWIP_ERROR("pbuf_copy() does not allow packet queues!", + 8006dd0: 687b ldr r3, [r7, #4] + 8006dd2: 681b ldr r3, [r3, #0] + 8006dd4: 2b00 cmp r3, #0 + 8006dd6: d009 beq.n 8006dec + 8006dd8: 4b09 ldr r3, [pc, #36] @ (8006e00 ) + 8006dda: f240 32ee movw r2, #1006 @ 0x3ee + 8006dde: 490e ldr r1, [pc, #56] @ (8006e18 ) + 8006de0: 4809 ldr r0, [pc, #36] @ (8006e08 ) + 8006de2: f00a fc09 bl 80115f8 + 8006de6: f06f 0305 mvn.w r3, #5 + 8006dea: e004 b.n 8006df6 + (p_to->next == NULL), return ERR_VAL;); + } + } while (p_from); + 8006dec: 683b ldr r3, [r7, #0] + 8006dee: 2b00 cmp r3, #0 + 8006df0: f47f af61 bne.w 8006cb6 + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n")); + return ERR_OK; + 8006df4: 2300 movs r3, #0 +} + 8006df6: 4618 mov r0, r3 + 8006df8: 3718 adds r7, #24 + 8006dfa: 46bd mov sp, r7 + 8006dfc: bd80 pop {r7, pc} + 8006dfe: bf00 nop + 8006e00: 080165b4 .word 0x080165b4 + 8006e04: 0801685c .word 0x0801685c + 8006e08: 08016614 .word 0x08016614 + 8006e0c: 0801688c .word 0x0801688c + 8006e10: 080168a4 .word 0x080168a4 + 8006e14: 080168c0 .word 0x080168c0 + 8006e18: 080168d0 .word 0x080168d0 + +08006e1c : + * @param offset offset into the packet buffer from where to begin copying len bytes + * @return the number of bytes copied, or 0 on failure + */ +u16_t +pbuf_copy_partial(const struct pbuf *buf, void *dataptr, u16_t len, u16_t offset) +{ + 8006e1c: b580 push {r7, lr} + 8006e1e: b088 sub sp, #32 + 8006e20: af00 add r7, sp, #0 + 8006e22: 60f8 str r0, [r7, #12] + 8006e24: 60b9 str r1, [r7, #8] + 8006e26: 4611 mov r1, r2 + 8006e28: 461a mov r2, r3 + 8006e2a: 460b mov r3, r1 + 8006e2c: 80fb strh r3, [r7, #6] + 8006e2e: 4613 mov r3, r2 + 8006e30: 80bb strh r3, [r7, #4] + const struct pbuf *p; + u16_t left = 0; + 8006e32: 2300 movs r3, #0 + 8006e34: 837b strh r3, [r7, #26] + u16_t buf_copy_len; + u16_t copied_total = 0; + 8006e36: 2300 movs r3, #0 + 8006e38: 82fb strh r3, [r7, #22] + + LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;); + 8006e3a: 68fb ldr r3, [r7, #12] + 8006e3c: 2b00 cmp r3, #0 + 8006e3e: d108 bne.n 8006e52 + 8006e40: 4b2b ldr r3, [pc, #172] @ (8006ef0 ) + 8006e42: f240 420a movw r2, #1034 @ 0x40a + 8006e46: 492b ldr r1, [pc, #172] @ (8006ef4 ) + 8006e48: 482b ldr r0, [pc, #172] @ (8006ef8 ) + 8006e4a: f00a fbd5 bl 80115f8 + 8006e4e: 2300 movs r3, #0 + 8006e50: e04a b.n 8006ee8 + LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;); + 8006e52: 68bb ldr r3, [r7, #8] + 8006e54: 2b00 cmp r3, #0 + 8006e56: d108 bne.n 8006e6a + 8006e58: 4b25 ldr r3, [pc, #148] @ (8006ef0 ) + 8006e5a: f240 420b movw r2, #1035 @ 0x40b + 8006e5e: 4927 ldr r1, [pc, #156] @ (8006efc ) + 8006e60: 4825 ldr r0, [pc, #148] @ (8006ef8 ) + 8006e62: f00a fbc9 bl 80115f8 + 8006e66: 2300 movs r3, #0 + 8006e68: e03e b.n 8006ee8 + + /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */ + for (p = buf; len != 0 && p != NULL; p = p->next) { + 8006e6a: 68fb ldr r3, [r7, #12] + 8006e6c: 61fb str r3, [r7, #28] + 8006e6e: e034 b.n 8006eda + if ((offset != 0) && (offset >= p->len)) { + 8006e70: 88bb ldrh r3, [r7, #4] + 8006e72: 2b00 cmp r3, #0 + 8006e74: d00a beq.n 8006e8c + 8006e76: 69fb ldr r3, [r7, #28] + 8006e78: 895b ldrh r3, [r3, #10] + 8006e7a: 88ba ldrh r2, [r7, #4] + 8006e7c: 429a cmp r2, r3 + 8006e7e: d305 bcc.n 8006e8c + /* don't copy from this buffer -> on to the next */ + offset = (u16_t)(offset - p->len); + 8006e80: 69fb ldr r3, [r7, #28] + 8006e82: 895b ldrh r3, [r3, #10] + 8006e84: 88ba ldrh r2, [r7, #4] + 8006e86: 1ad3 subs r3, r2, r3 + 8006e88: 80bb strh r3, [r7, #4] + 8006e8a: e023 b.n 8006ed4 + } else { + /* copy from this buffer. maybe only partially. */ + buf_copy_len = (u16_t)(p->len - offset); + 8006e8c: 69fb ldr r3, [r7, #28] + 8006e8e: 895a ldrh r2, [r3, #10] + 8006e90: 88bb ldrh r3, [r7, #4] + 8006e92: 1ad3 subs r3, r2, r3 + 8006e94: 833b strh r3, [r7, #24] + if (buf_copy_len > len) { + 8006e96: 8b3a ldrh r2, [r7, #24] + 8006e98: 88fb ldrh r3, [r7, #6] + 8006e9a: 429a cmp r2, r3 + 8006e9c: d901 bls.n 8006ea2 + buf_copy_len = len; + 8006e9e: 88fb ldrh r3, [r7, #6] + 8006ea0: 833b strh r3, [r7, #24] + } + /* copy the necessary parts of the buffer */ + MEMCPY(&((char *)dataptr)[left], &((char *)p->payload)[offset], buf_copy_len); + 8006ea2: 8b7b ldrh r3, [r7, #26] + 8006ea4: 68ba ldr r2, [r7, #8] + 8006ea6: 18d0 adds r0, r2, r3 + 8006ea8: 69fb ldr r3, [r7, #28] + 8006eaa: 685a ldr r2, [r3, #4] + 8006eac: 88bb ldrh r3, [r7, #4] + 8006eae: 4413 add r3, r2 + 8006eb0: 8b3a ldrh r2, [r7, #24] + 8006eb2: 4619 mov r1, r3 + 8006eb4: f00a fc9c bl 80117f0 + copied_total = (u16_t)(copied_total + buf_copy_len); + 8006eb8: 8afa ldrh r2, [r7, #22] + 8006eba: 8b3b ldrh r3, [r7, #24] + 8006ebc: 4413 add r3, r2 + 8006ebe: 82fb strh r3, [r7, #22] + left = (u16_t)(left + buf_copy_len); + 8006ec0: 8b7a ldrh r2, [r7, #26] + 8006ec2: 8b3b ldrh r3, [r7, #24] + 8006ec4: 4413 add r3, r2 + 8006ec6: 837b strh r3, [r7, #26] + len = (u16_t)(len - buf_copy_len); + 8006ec8: 88fa ldrh r2, [r7, #6] + 8006eca: 8b3b ldrh r3, [r7, #24] + 8006ecc: 1ad3 subs r3, r2, r3 + 8006ece: 80fb strh r3, [r7, #6] + offset = 0; + 8006ed0: 2300 movs r3, #0 + 8006ed2: 80bb strh r3, [r7, #4] + for (p = buf; len != 0 && p != NULL; p = p->next) { + 8006ed4: 69fb ldr r3, [r7, #28] + 8006ed6: 681b ldr r3, [r3, #0] + 8006ed8: 61fb str r3, [r7, #28] + 8006eda: 88fb ldrh r3, [r7, #6] + 8006edc: 2b00 cmp r3, #0 + 8006ede: d002 beq.n 8006ee6 + 8006ee0: 69fb ldr r3, [r7, #28] + 8006ee2: 2b00 cmp r3, #0 + 8006ee4: d1c4 bne.n 8006e70 + } + } + return copied_total; + 8006ee6: 8afb ldrh r3, [r7, #22] +} + 8006ee8: 4618 mov r0, r3 + 8006eea: 3720 adds r7, #32 + 8006eec: 46bd mov sp, r7 + 8006eee: bd80 pop {r7, pc} + 8006ef0: 080165b4 .word 0x080165b4 + 8006ef4: 080168fc .word 0x080168fc + 8006ef8: 08016614 .word 0x08016614 + 8006efc: 0801691c .word 0x0801691c + +08006f00 : + * + * @return a new pbuf or NULL if allocation fails + */ +struct pbuf * +pbuf_clone(pbuf_layer layer, pbuf_type type, struct pbuf *p) +{ + 8006f00: b580 push {r7, lr} + 8006f02: b084 sub sp, #16 + 8006f04: af00 add r7, sp, #0 + 8006f06: 4603 mov r3, r0 + 8006f08: 603a str r2, [r7, #0] + 8006f0a: 71fb strb r3, [r7, #7] + 8006f0c: 460b mov r3, r1 + 8006f0e: 80bb strh r3, [r7, #4] + struct pbuf *q; + err_t err; + q = pbuf_alloc(layer, p->tot_len, type); + 8006f10: 683b ldr r3, [r7, #0] + 8006f12: 8919 ldrh r1, [r3, #8] + 8006f14: 88ba ldrh r2, [r7, #4] + 8006f16: 79fb ldrb r3, [r7, #7] + 8006f18: 4618 mov r0, r3 + 8006f1a: f7ff faa3 bl 8006464 + 8006f1e: 60f8 str r0, [r7, #12] + if (q == NULL) { + 8006f20: 68fb ldr r3, [r7, #12] + 8006f22: 2b00 cmp r3, #0 + 8006f24: d101 bne.n 8006f2a + return NULL; + 8006f26: 2300 movs r3, #0 + 8006f28: e011 b.n 8006f4e + } + err = pbuf_copy(q, p); + 8006f2a: 6839 ldr r1, [r7, #0] + 8006f2c: 68f8 ldr r0, [r7, #12] + 8006f2e: f7ff fea3 bl 8006c78 + 8006f32: 4603 mov r3, r0 + 8006f34: 72fb strb r3, [r7, #11] + LWIP_UNUSED_ARG(err); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("pbuf_copy failed", err == ERR_OK); + 8006f36: f997 300b ldrsb.w r3, [r7, #11] + 8006f3a: 2b00 cmp r3, #0 + 8006f3c: d006 beq.n 8006f4c + 8006f3e: 4b06 ldr r3, [pc, #24] @ (8006f58 ) + 8006f40: f240 5224 movw r2, #1316 @ 0x524 + 8006f44: 4905 ldr r1, [pc, #20] @ (8006f5c ) + 8006f46: 4806 ldr r0, [pc, #24] @ (8006f60 ) + 8006f48: f00a fb56 bl 80115f8 + return q; + 8006f4c: 68fb ldr r3, [r7, #12] +} + 8006f4e: 4618 mov r0, r3 + 8006f50: 3710 adds r7, #16 + 8006f52: 46bd mov sp, r7 + 8006f54: bd80 pop {r7, pc} + 8006f56: bf00 nop + 8006f58: 080165b4 .word 0x080165b4 + 8006f5c: 08016a28 .word 0x08016a28 + 8006f60: 08016614 .word 0x08016614 + +08006f64 : +/** + * Initialize this module. + */ +void +tcp_init(void) +{ + 8006f64: b580 push {r7, lr} + 8006f66: af00 add r7, sp, #0 +#ifdef LWIP_RAND + tcp_port = TCP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND()); + 8006f68: f00a fa68 bl 801143c + 8006f6c: 4603 mov r3, r0 + 8006f6e: b29b uxth r3, r3 + 8006f70: f3c3 030d ubfx r3, r3, #0, #14 + 8006f74: b29b uxth r3, r3 + 8006f76: f5a3 4380 sub.w r3, r3, #16384 @ 0x4000 + 8006f7a: b29a uxth r2, r3 + 8006f7c: 4b01 ldr r3, [pc, #4] @ (8006f84 ) + 8006f7e: 801a strh r2, [r3, #0] +#endif /* LWIP_RAND */ +} + 8006f80: bf00 nop + 8006f82: bd80 pop {r7, pc} + 8006f84: 20000020 .word 0x20000020 + +08006f88 : + +/** Free a tcp pcb */ +void +tcp_free(struct tcp_pcb *pcb) +{ + 8006f88: b580 push {r7, lr} + 8006f8a: b082 sub sp, #8 + 8006f8c: af00 add r7, sp, #0 + 8006f8e: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_free: LISTEN", pcb->state != LISTEN); + 8006f90: 687b ldr r3, [r7, #4] + 8006f92: 7d1b ldrb r3, [r3, #20] + 8006f94: 2b01 cmp r3, #1 + 8006f96: d105 bne.n 8006fa4 + 8006f98: 4b06 ldr r3, [pc, #24] @ (8006fb4 ) + 8006f9a: 22d4 movs r2, #212 @ 0xd4 + 8006f9c: 4906 ldr r1, [pc, #24] @ (8006fb8 ) + 8006f9e: 4807 ldr r0, [pc, #28] @ (8006fbc ) + 8006fa0: f00a fb2a bl 80115f8 +#if LWIP_TCP_PCB_NUM_EXT_ARGS + tcp_ext_arg_invoke_callbacks_destroyed(pcb->ext_args); +#endif + memp_free(MEMP_TCP_PCB, pcb); + 8006fa4: 6879 ldr r1, [r7, #4] + 8006fa6: 2001 movs r0, #1 + 8006fa8: f7fe febe bl 8005d28 +} + 8006fac: bf00 nop + 8006fae: 3708 adds r7, #8 + 8006fb0: 46bd mov sp, r7 + 8006fb2: bd80 pop {r7, pc} + 8006fb4: 08016ab4 .word 0x08016ab4 + 8006fb8: 08016ae4 .word 0x08016ae4 + 8006fbc: 08016af8 .word 0x08016af8 + +08006fc0 : + +/** Free a tcp listen pcb */ +static void +tcp_free_listen(struct tcp_pcb *pcb) +{ + 8006fc0: b580 push {r7, lr} + 8006fc2: b082 sub sp, #8 + 8006fc4: af00 add r7, sp, #0 + 8006fc6: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_free_listen: !LISTEN", pcb->state != LISTEN); + 8006fc8: 687b ldr r3, [r7, #4] + 8006fca: 7d1b ldrb r3, [r3, #20] + 8006fcc: 2b01 cmp r3, #1 + 8006fce: d105 bne.n 8006fdc + 8006fd0: 4b06 ldr r3, [pc, #24] @ (8006fec ) + 8006fd2: 22df movs r2, #223 @ 0xdf + 8006fd4: 4906 ldr r1, [pc, #24] @ (8006ff0 ) + 8006fd6: 4807 ldr r0, [pc, #28] @ (8006ff4 ) + 8006fd8: f00a fb0e bl 80115f8 +#if LWIP_TCP_PCB_NUM_EXT_ARGS + tcp_ext_arg_invoke_callbacks_destroyed(pcb->ext_args); +#endif + memp_free(MEMP_TCP_PCB_LISTEN, pcb); + 8006fdc: 6879 ldr r1, [r7, #4] + 8006fde: 2002 movs r0, #2 + 8006fe0: f7fe fea2 bl 8005d28 +} + 8006fe4: bf00 nop + 8006fe6: 3708 adds r7, #8 + 8006fe8: 46bd mov sp, r7 + 8006fea: bd80 pop {r7, pc} + 8006fec: 08016ab4 .word 0x08016ab4 + 8006ff0: 08016b20 .word 0x08016b20 + 8006ff4: 08016af8 .word 0x08016af8 + +08006ff8 : +/** + * Called periodically to dispatch TCP timers. + */ +void +tcp_tmr(void) +{ + 8006ff8: b580 push {r7, lr} + 8006ffa: af00 add r7, sp, #0 + /* Call tcp_fasttmr() every 250 ms */ + tcp_fasttmr(); + 8006ffc: f000 fea4 bl 8007d48 + + if (++tcp_timer & 1) { + 8007000: 4b07 ldr r3, [pc, #28] @ (8007020 ) + 8007002: 781b ldrb r3, [r3, #0] + 8007004: 3301 adds r3, #1 + 8007006: b2da uxtb r2, r3 + 8007008: 4b05 ldr r3, [pc, #20] @ (8007020 ) + 800700a: 701a strb r2, [r3, #0] + 800700c: 4b04 ldr r3, [pc, #16] @ (8007020 ) + 800700e: 781b ldrb r3, [r3, #0] + 8007010: f003 0301 and.w r3, r3, #1 + 8007014: 2b00 cmp r3, #0 + 8007016: d001 beq.n 800701c + /* Call tcp_slowtmr() every 500 ms, i.e., every other timer + tcp_tmr() is called. */ + tcp_slowtmr(); + 8007018: f000 fb54 bl 80076c4 + } +} + 800701c: bf00 nop + 800701e: bd80 pop {r7, pc} + 8007020: 200190b9 .word 0x200190b9 + +08007024 : +/** Called when a listen pcb is closed. Iterates one pcb list and removes the + * closed listener pcb from pcb->listener if matching. + */ +static void +tcp_remove_listener(struct tcp_pcb *list, struct tcp_pcb_listen *lpcb) +{ + 8007024: b580 push {r7, lr} + 8007026: b084 sub sp, #16 + 8007028: af00 add r7, sp, #0 + 800702a: 6078 str r0, [r7, #4] + 800702c: 6039 str r1, [r7, #0] + struct tcp_pcb *pcb; + + LWIP_ASSERT("tcp_remove_listener: invalid listener", lpcb != NULL); + 800702e: 683b ldr r3, [r7, #0] + 8007030: 2b00 cmp r3, #0 + 8007032: d105 bne.n 8007040 + 8007034: 4b0d ldr r3, [pc, #52] @ (800706c ) + 8007036: 22ff movs r2, #255 @ 0xff + 8007038: 490d ldr r1, [pc, #52] @ (8007070 ) + 800703a: 480e ldr r0, [pc, #56] @ (8007074 ) + 800703c: f00a fadc bl 80115f8 + + for (pcb = list; pcb != NULL; pcb = pcb->next) { + 8007040: 687b ldr r3, [r7, #4] + 8007042: 60fb str r3, [r7, #12] + 8007044: e00a b.n 800705c + if (pcb->listener == lpcb) { + 8007046: 68fb ldr r3, [r7, #12] + 8007048: 6fdb ldr r3, [r3, #124] @ 0x7c + 800704a: 683a ldr r2, [r7, #0] + 800704c: 429a cmp r2, r3 + 800704e: d102 bne.n 8007056 + pcb->listener = NULL; + 8007050: 68fb ldr r3, [r7, #12] + 8007052: 2200 movs r2, #0 + 8007054: 67da str r2, [r3, #124] @ 0x7c + for (pcb = list; pcb != NULL; pcb = pcb->next) { + 8007056: 68fb ldr r3, [r7, #12] + 8007058: 68db ldr r3, [r3, #12] + 800705a: 60fb str r3, [r7, #12] + 800705c: 68fb ldr r3, [r7, #12] + 800705e: 2b00 cmp r3, #0 + 8007060: d1f1 bne.n 8007046 + } + } +} + 8007062: bf00 nop + 8007064: bf00 nop + 8007066: 3710 adds r7, #16 + 8007068: 46bd mov sp, r7 + 800706a: bd80 pop {r7, pc} + 800706c: 08016ab4 .word 0x08016ab4 + 8007070: 08016b3c .word 0x08016b3c + 8007074: 08016af8 .word 0x08016af8 + +08007078 : +/** Called when a listen pcb is closed. Iterates all pcb lists and removes the + * closed listener pcb from pcb->listener if matching. + */ +static void +tcp_listen_closed(struct tcp_pcb *pcb) +{ + 8007078: b580 push {r7, lr} + 800707a: b084 sub sp, #16 + 800707c: af00 add r7, sp, #0 + 800707e: 6078 str r0, [r7, #4] +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG + size_t i; + LWIP_ASSERT("pcb != NULL", pcb != NULL); + 8007080: 687b ldr r3, [r7, #4] + 8007082: 2b00 cmp r3, #0 + 8007084: d106 bne.n 8007094 + 8007086: 4b14 ldr r3, [pc, #80] @ (80070d8 ) + 8007088: f240 1211 movw r2, #273 @ 0x111 + 800708c: 4913 ldr r1, [pc, #76] @ (80070dc ) + 800708e: 4814 ldr r0, [pc, #80] @ (80070e0 ) + 8007090: f00a fab2 bl 80115f8 + LWIP_ASSERT("pcb->state == LISTEN", pcb->state == LISTEN); + 8007094: 687b ldr r3, [r7, #4] + 8007096: 7d1b ldrb r3, [r3, #20] + 8007098: 2b01 cmp r3, #1 + 800709a: d006 beq.n 80070aa + 800709c: 4b0e ldr r3, [pc, #56] @ (80070d8 ) + 800709e: f44f 7289 mov.w r2, #274 @ 0x112 + 80070a2: 4910 ldr r1, [pc, #64] @ (80070e4 ) + 80070a4: 480e ldr r0, [pc, #56] @ (80070e0 ) + 80070a6: f00a faa7 bl 80115f8 + for (i = 1; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) { + 80070aa: 2301 movs r3, #1 + 80070ac: 60fb str r3, [r7, #12] + 80070ae: e00b b.n 80070c8 + tcp_remove_listener(*tcp_pcb_lists[i], (struct tcp_pcb_listen *)pcb); + 80070b0: 4a0d ldr r2, [pc, #52] @ (80070e8 ) + 80070b2: 68fb ldr r3, [r7, #12] + 80070b4: f852 3023 ldr.w r3, [r2, r3, lsl #2] + 80070b8: 681b ldr r3, [r3, #0] + 80070ba: 6879 ldr r1, [r7, #4] + 80070bc: 4618 mov r0, r3 + 80070be: f7ff ffb1 bl 8007024 + for (i = 1; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) { + 80070c2: 68fb ldr r3, [r7, #12] + 80070c4: 3301 adds r3, #1 + 80070c6: 60fb str r3, [r7, #12] + 80070c8: 68fb ldr r3, [r7, #12] + 80070ca: 2b03 cmp r3, #3 + 80070cc: d9f0 bls.n 80070b0 + } +#endif + LWIP_UNUSED_ARG(pcb); +} + 80070ce: bf00 nop + 80070d0: bf00 nop + 80070d2: 3710 adds r7, #16 + 80070d4: 46bd mov sp, r7 + 80070d6: bd80 pop {r7, pc} + 80070d8: 08016ab4 .word 0x08016ab4 + 80070dc: 08016b64 .word 0x08016b64 + 80070e0: 08016af8 .word 0x08016af8 + 80070e4: 08016b70 .word 0x08016b70 + 80070e8: 08018e9c .word 0x08018e9c + +080070ec : + * @return ERR_OK if connection has been closed + * another err_t if closing failed and pcb is not freed + */ +static err_t +tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data) +{ + 80070ec: b5b0 push {r4, r5, r7, lr} + 80070ee: b088 sub sp, #32 + 80070f0: af04 add r7, sp, #16 + 80070f2: 6078 str r0, [r7, #4] + 80070f4: 460b mov r3, r1 + 80070f6: 70fb strb r3, [r7, #3] + LWIP_ASSERT("tcp_close_shutdown: invalid pcb", pcb != NULL); + 80070f8: 687b ldr r3, [r7, #4] + 80070fa: 2b00 cmp r3, #0 + 80070fc: d106 bne.n 800710c + 80070fe: 4b63 ldr r3, [pc, #396] @ (800728c ) + 8007100: f44f 72af mov.w r2, #350 @ 0x15e + 8007104: 4962 ldr r1, [pc, #392] @ (8007290 ) + 8007106: 4863 ldr r0, [pc, #396] @ (8007294 ) + 8007108: f00a fa76 bl 80115f8 + + if (rst_on_unacked_data && ((pcb->state == ESTABLISHED) || (pcb->state == CLOSE_WAIT))) { + 800710c: 78fb ldrb r3, [r7, #3] + 800710e: 2b00 cmp r3, #0 + 8007110: d066 beq.n 80071e0 + 8007112: 687b ldr r3, [r7, #4] + 8007114: 7d1b ldrb r3, [r3, #20] + 8007116: 2b04 cmp r3, #4 + 8007118: d003 beq.n 8007122 + 800711a: 687b ldr r3, [r7, #4] + 800711c: 7d1b ldrb r3, [r3, #20] + 800711e: 2b07 cmp r3, #7 + 8007120: d15e bne.n 80071e0 + if ((pcb->refused_data != NULL) || (pcb->rcv_wnd != TCP_WND_MAX(pcb))) { + 8007122: 687b ldr r3, [r7, #4] + 8007124: 6f9b ldr r3, [r3, #120] @ 0x78 + 8007126: 2b00 cmp r3, #0 + 8007128: d104 bne.n 8007134 + 800712a: 687b ldr r3, [r7, #4] + 800712c: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800712e: f5b3 6f06 cmp.w r3, #2144 @ 0x860 + 8007132: d055 beq.n 80071e0 + /* Not all data received by application, send RST to tell the remote + side about this. */ + LWIP_ASSERT("pcb->flags & TF_RXCLOSED", pcb->flags & TF_RXCLOSED); + 8007134: 687b ldr r3, [r7, #4] + 8007136: 8b5b ldrh r3, [r3, #26] + 8007138: f003 0310 and.w r3, r3, #16 + 800713c: 2b00 cmp r3, #0 + 800713e: d106 bne.n 800714e + 8007140: 4b52 ldr r3, [pc, #328] @ (800728c ) + 8007142: f44f 72b2 mov.w r2, #356 @ 0x164 + 8007146: 4954 ldr r1, [pc, #336] @ (8007298 ) + 8007148: 4852 ldr r0, [pc, #328] @ (8007294 ) + 800714a: f00a fa55 bl 80115f8 + + /* don't call tcp_abort here: we must not deallocate the pcb since + that might not be expected when calling tcp_close */ + tcp_rst(pcb, pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip, + 800714e: 687b ldr r3, [r7, #4] + 8007150: 6d18 ldr r0, [r3, #80] @ 0x50 + 8007152: 687b ldr r3, [r7, #4] + 8007154: 6a5c ldr r4, [r3, #36] @ 0x24 + 8007156: 687d ldr r5, [r7, #4] + 8007158: 687b ldr r3, [r7, #4] + 800715a: 3304 adds r3, #4 + 800715c: 687a ldr r2, [r7, #4] + 800715e: 8ad2 ldrh r2, [r2, #22] + 8007160: 6879 ldr r1, [r7, #4] + 8007162: 8b09 ldrh r1, [r1, #24] + 8007164: 9102 str r1, [sp, #8] + 8007166: 9201 str r2, [sp, #4] + 8007168: 9300 str r3, [sp, #0] + 800716a: 462b mov r3, r5 + 800716c: 4622 mov r2, r4 + 800716e: 4601 mov r1, r0 + 8007170: 6878 ldr r0, [r7, #4] + 8007172: f004 fe8d bl 800be90 + pcb->local_port, pcb->remote_port); + + tcp_pcb_purge(pcb); + 8007176: 6878 ldr r0, [r7, #4] + 8007178: f001 f8c8 bl 800830c + TCP_RMV_ACTIVE(pcb); + 800717c: 4b47 ldr r3, [pc, #284] @ (800729c ) + 800717e: 681b ldr r3, [r3, #0] + 8007180: 687a ldr r2, [r7, #4] + 8007182: 429a cmp r2, r3 + 8007184: d105 bne.n 8007192 + 8007186: 4b45 ldr r3, [pc, #276] @ (800729c ) + 8007188: 681b ldr r3, [r3, #0] + 800718a: 68db ldr r3, [r3, #12] + 800718c: 4a43 ldr r2, [pc, #268] @ (800729c ) + 800718e: 6013 str r3, [r2, #0] + 8007190: e013 b.n 80071ba + 8007192: 4b42 ldr r3, [pc, #264] @ (800729c ) + 8007194: 681b ldr r3, [r3, #0] + 8007196: 60fb str r3, [r7, #12] + 8007198: e00c b.n 80071b4 + 800719a: 68fb ldr r3, [r7, #12] + 800719c: 68db ldr r3, [r3, #12] + 800719e: 687a ldr r2, [r7, #4] + 80071a0: 429a cmp r2, r3 + 80071a2: d104 bne.n 80071ae + 80071a4: 687b ldr r3, [r7, #4] + 80071a6: 68da ldr r2, [r3, #12] + 80071a8: 68fb ldr r3, [r7, #12] + 80071aa: 60da str r2, [r3, #12] + 80071ac: e005 b.n 80071ba + 80071ae: 68fb ldr r3, [r7, #12] + 80071b0: 68db ldr r3, [r3, #12] + 80071b2: 60fb str r3, [r7, #12] + 80071b4: 68fb ldr r3, [r7, #12] + 80071b6: 2b00 cmp r3, #0 + 80071b8: d1ef bne.n 800719a + 80071ba: 687b ldr r3, [r7, #4] + 80071bc: 2200 movs r2, #0 + 80071be: 60da str r2, [r3, #12] + 80071c0: 4b37 ldr r3, [pc, #220] @ (80072a0 ) + 80071c2: 2201 movs r2, #1 + 80071c4: 701a strb r2, [r3, #0] + /* Deallocate the pcb since we already sent a RST for it */ + if (tcp_input_pcb == pcb) { + 80071c6: 4b37 ldr r3, [pc, #220] @ (80072a4 ) + 80071c8: 681b ldr r3, [r3, #0] + 80071ca: 687a ldr r2, [r7, #4] + 80071cc: 429a cmp r2, r3 + 80071ce: d102 bne.n 80071d6 + /* prevent using a deallocated pcb: free it from tcp_input later */ + tcp_trigger_input_pcb_close(); + 80071d0: f003 fd5c bl 800ac8c + 80071d4: e002 b.n 80071dc + } else { + tcp_free(pcb); + 80071d6: 6878 ldr r0, [r7, #4] + 80071d8: f7ff fed6 bl 8006f88 + } + return ERR_OK; + 80071dc: 2300 movs r3, #0 + 80071de: e050 b.n 8007282 + } + } + + /* - states which free the pcb are handled here, + - states which send FIN and change state are handled in tcp_close_shutdown_fin() */ + switch (pcb->state) { + 80071e0: 687b ldr r3, [r7, #4] + 80071e2: 7d1b ldrb r3, [r3, #20] + 80071e4: 2b02 cmp r3, #2 + 80071e6: d03b beq.n 8007260 + 80071e8: 2b02 cmp r3, #2 + 80071ea: dc44 bgt.n 8007276 + 80071ec: 2b00 cmp r3, #0 + 80071ee: d002 beq.n 80071f6 + 80071f0: 2b01 cmp r3, #1 + 80071f2: d02a beq.n 800724a + 80071f4: e03f b.n 8007276 + * and the user needs some way to free it should the need arise. + * Calling tcp_close() with a pcb that has already been closed, (i.e. twice) + * or for a pcb that has been used and then entered the CLOSED state + * is erroneous, but this should never happen as the pcb has in those cases + * been freed, and so any remaining handles are bogus. */ + if (pcb->local_port != 0) { + 80071f6: 687b ldr r3, [r7, #4] + 80071f8: 8adb ldrh r3, [r3, #22] + 80071fa: 2b00 cmp r3, #0 + 80071fc: d021 beq.n 8007242 + TCP_RMV(&tcp_bound_pcbs, pcb); + 80071fe: 4b2a ldr r3, [pc, #168] @ (80072a8 ) + 8007200: 681b ldr r3, [r3, #0] + 8007202: 687a ldr r2, [r7, #4] + 8007204: 429a cmp r2, r3 + 8007206: d105 bne.n 8007214 + 8007208: 4b27 ldr r3, [pc, #156] @ (80072a8 ) + 800720a: 681b ldr r3, [r3, #0] + 800720c: 68db ldr r3, [r3, #12] + 800720e: 4a26 ldr r2, [pc, #152] @ (80072a8 ) + 8007210: 6013 str r3, [r2, #0] + 8007212: e013 b.n 800723c + 8007214: 4b24 ldr r3, [pc, #144] @ (80072a8 ) + 8007216: 681b ldr r3, [r3, #0] + 8007218: 60bb str r3, [r7, #8] + 800721a: e00c b.n 8007236 + 800721c: 68bb ldr r3, [r7, #8] + 800721e: 68db ldr r3, [r3, #12] + 8007220: 687a ldr r2, [r7, #4] + 8007222: 429a cmp r2, r3 + 8007224: d104 bne.n 8007230 + 8007226: 687b ldr r3, [r7, #4] + 8007228: 68da ldr r2, [r3, #12] + 800722a: 68bb ldr r3, [r7, #8] + 800722c: 60da str r2, [r3, #12] + 800722e: e005 b.n 800723c + 8007230: 68bb ldr r3, [r7, #8] + 8007232: 68db ldr r3, [r3, #12] + 8007234: 60bb str r3, [r7, #8] + 8007236: 68bb ldr r3, [r7, #8] + 8007238: 2b00 cmp r3, #0 + 800723a: d1ef bne.n 800721c + 800723c: 687b ldr r3, [r7, #4] + 800723e: 2200 movs r2, #0 + 8007240: 60da str r2, [r3, #12] + } + tcp_free(pcb); + 8007242: 6878 ldr r0, [r7, #4] + 8007244: f7ff fea0 bl 8006f88 + break; + 8007248: e01a b.n 8007280 + case LISTEN: + tcp_listen_closed(pcb); + 800724a: 6878 ldr r0, [r7, #4] + 800724c: f7ff ff14 bl 8007078 + tcp_pcb_remove(&tcp_listen_pcbs.pcbs, pcb); + 8007250: 6879 ldr r1, [r7, #4] + 8007252: 4816 ldr r0, [pc, #88] @ (80072ac ) + 8007254: f001 f8aa bl 80083ac + tcp_free_listen(pcb); + 8007258: 6878 ldr r0, [r7, #4] + 800725a: f7ff feb1 bl 8006fc0 + break; + 800725e: e00f b.n 8007280 + case SYN_SENT: + TCP_PCB_REMOVE_ACTIVE(pcb); + 8007260: 6879 ldr r1, [r7, #4] + 8007262: 480e ldr r0, [pc, #56] @ (800729c ) + 8007264: f001 f8a2 bl 80083ac + 8007268: 4b0d ldr r3, [pc, #52] @ (80072a0 ) + 800726a: 2201 movs r2, #1 + 800726c: 701a strb r2, [r3, #0] + tcp_free(pcb); + 800726e: 6878 ldr r0, [r7, #4] + 8007270: f7ff fe8a bl 8006f88 + MIB2_STATS_INC(mib2.tcpattemptfails); + break; + 8007274: e004 b.n 8007280 + default: + return tcp_close_shutdown_fin(pcb); + 8007276: 6878 ldr r0, [r7, #4] + 8007278: f000 f81a bl 80072b0 + 800727c: 4603 mov r3, r0 + 800727e: e000 b.n 8007282 + } + return ERR_OK; + 8007280: 2300 movs r3, #0 +} + 8007282: 4618 mov r0, r3 + 8007284: 3710 adds r7, #16 + 8007286: 46bd mov sp, r7 + 8007288: bdb0 pop {r4, r5, r7, pc} + 800728a: bf00 nop + 800728c: 08016ab4 .word 0x08016ab4 + 8007290: 08016b88 .word 0x08016b88 + 8007294: 08016af8 .word 0x08016af8 + 8007298: 08016ba8 .word 0x08016ba8 + 800729c: 200190b0 .word 0x200190b0 + 80072a0: 200190b8 .word 0x200190b8 + 80072a4: 200190f0 .word 0x200190f0 + 80072a8: 200190a8 .word 0x200190a8 + 80072ac: 200190ac .word 0x200190ac + +080072b0 : + +static err_t +tcp_close_shutdown_fin(struct tcp_pcb *pcb) +{ + 80072b0: b580 push {r7, lr} + 80072b2: b084 sub sp, #16 + 80072b4: af00 add r7, sp, #0 + 80072b6: 6078 str r0, [r7, #4] + err_t err; + LWIP_ASSERT("pcb != NULL", pcb != NULL); + 80072b8: 687b ldr r3, [r7, #4] + 80072ba: 2b00 cmp r3, #0 + 80072bc: d106 bne.n 80072cc + 80072be: 4b2e ldr r3, [pc, #184] @ (8007378 ) + 80072c0: f44f 72ce mov.w r2, #412 @ 0x19c + 80072c4: 492d ldr r1, [pc, #180] @ (800737c ) + 80072c6: 482e ldr r0, [pc, #184] @ (8007380 ) + 80072c8: f00a f996 bl 80115f8 + + switch (pcb->state) { + 80072cc: 687b ldr r3, [r7, #4] + 80072ce: 7d1b ldrb r3, [r3, #20] + 80072d0: 2b07 cmp r3, #7 + 80072d2: d020 beq.n 8007316 + 80072d4: 2b07 cmp r3, #7 + 80072d6: dc2b bgt.n 8007330 + 80072d8: 2b03 cmp r3, #3 + 80072da: d002 beq.n 80072e2 + 80072dc: 2b04 cmp r3, #4 + 80072de: d00d beq.n 80072fc + 80072e0: e026 b.n 8007330 + case SYN_RCVD: + err = tcp_send_fin(pcb); + 80072e2: 6878 ldr r0, [r7, #4] + 80072e4: f003 fee2 bl 800b0ac + 80072e8: 4603 mov r3, r0 + 80072ea: 73fb strb r3, [r7, #15] + if (err == ERR_OK) { + 80072ec: f997 300f ldrsb.w r3, [r7, #15] + 80072f0: 2b00 cmp r3, #0 + 80072f2: d11f bne.n 8007334 + tcp_backlog_accepted(pcb); + MIB2_STATS_INC(mib2.tcpattemptfails); + pcb->state = FIN_WAIT_1; + 80072f4: 687b ldr r3, [r7, #4] + 80072f6: 2205 movs r2, #5 + 80072f8: 751a strb r2, [r3, #20] + } + break; + 80072fa: e01b b.n 8007334 + case ESTABLISHED: + err = tcp_send_fin(pcb); + 80072fc: 6878 ldr r0, [r7, #4] + 80072fe: f003 fed5 bl 800b0ac + 8007302: 4603 mov r3, r0 + 8007304: 73fb strb r3, [r7, #15] + if (err == ERR_OK) { + 8007306: f997 300f ldrsb.w r3, [r7, #15] + 800730a: 2b00 cmp r3, #0 + 800730c: d114 bne.n 8007338 + MIB2_STATS_INC(mib2.tcpestabresets); + pcb->state = FIN_WAIT_1; + 800730e: 687b ldr r3, [r7, #4] + 8007310: 2205 movs r2, #5 + 8007312: 751a strb r2, [r3, #20] + } + break; + 8007314: e010 b.n 8007338 + case CLOSE_WAIT: + err = tcp_send_fin(pcb); + 8007316: 6878 ldr r0, [r7, #4] + 8007318: f003 fec8 bl 800b0ac + 800731c: 4603 mov r3, r0 + 800731e: 73fb strb r3, [r7, #15] + if (err == ERR_OK) { + 8007320: f997 300f ldrsb.w r3, [r7, #15] + 8007324: 2b00 cmp r3, #0 + 8007326: d109 bne.n 800733c + MIB2_STATS_INC(mib2.tcpestabresets); + pcb->state = LAST_ACK; + 8007328: 687b ldr r3, [r7, #4] + 800732a: 2209 movs r2, #9 + 800732c: 751a strb r2, [r3, #20] + } + break; + 800732e: e005 b.n 800733c + default: + /* Has already been closed, do nothing. */ + return ERR_OK; + 8007330: 2300 movs r3, #0 + 8007332: e01c b.n 800736e + break; + 8007334: bf00 nop + 8007336: e002 b.n 800733e + break; + 8007338: bf00 nop + 800733a: e000 b.n 800733e + break; + 800733c: bf00 nop + } + + if (err == ERR_OK) { + 800733e: f997 300f ldrsb.w r3, [r7, #15] + 8007342: 2b00 cmp r3, #0 + 8007344: d103 bne.n 800734e + /* To ensure all data has been sent when tcp_close returns, we have + to make sure tcp_output doesn't fail. + Since we don't really have to ensure all data has been sent when tcp_close + returns (unsent data is sent from tcp timer functions, also), we don't care + for the return value of tcp_output for now. */ + tcp_output(pcb); + 8007346: 6878 ldr r0, [r7, #4] + 8007348: f003 ffee bl 800b328 + 800734c: e00d b.n 800736a + } else if (err == ERR_MEM) { + 800734e: f997 300f ldrsb.w r3, [r7, #15] + 8007352: f1b3 3fff cmp.w r3, #4294967295 + 8007356: d108 bne.n 800736a + /* Mark this pcb for closing. Closing is retried from tcp_tmr. */ + tcp_set_flags(pcb, TF_CLOSEPEND); + 8007358: 687b ldr r3, [r7, #4] + 800735a: 8b5b ldrh r3, [r3, #26] + 800735c: f043 0308 orr.w r3, r3, #8 + 8007360: b29a uxth r2, r3 + 8007362: 687b ldr r3, [r7, #4] + 8007364: 835a strh r2, [r3, #26] + /* We have to return ERR_OK from here to indicate to the callers that this + pcb should not be used any more as it will be freed soon via tcp_tmr. + This is OK here since sending FIN does not guarantee a time frime for + actually freeing the pcb, either (it is left in closure states for + remote ACK or timeout) */ + return ERR_OK; + 8007366: 2300 movs r3, #0 + 8007368: e001 b.n 800736e + } + return err; + 800736a: f997 300f ldrsb.w r3, [r7, #15] +} + 800736e: 4618 mov r0, r3 + 8007370: 3710 adds r7, #16 + 8007372: 46bd mov sp, r7 + 8007374: bd80 pop {r7, pc} + 8007376: bf00 nop + 8007378: 08016ab4 .word 0x08016ab4 + 800737c: 08016b64 .word 0x08016b64 + 8007380: 08016af8 .word 0x08016af8 + +08007384 : + * @return ERR_OK if connection has been closed + * another err_t if closing failed and pcb is not freed + */ +err_t +tcp_close(struct tcp_pcb *pcb) +{ + 8007384: b580 push {r7, lr} + 8007386: b082 sub sp, #8 + 8007388: af00 add r7, sp, #0 + 800738a: 6078 str r0, [r7, #4] + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("tcp_close: invalid pcb", pcb != NULL, return ERR_ARG); + 800738c: 687b ldr r3, [r7, #4] + 800738e: 2b00 cmp r3, #0 + 8007390: d109 bne.n 80073a6 + 8007392: 4b0f ldr r3, [pc, #60] @ (80073d0 ) + 8007394: f44f 72f4 mov.w r2, #488 @ 0x1e8 + 8007398: 490e ldr r1, [pc, #56] @ (80073d4 ) + 800739a: 480f ldr r0, [pc, #60] @ (80073d8 ) + 800739c: f00a f92c bl 80115f8 + 80073a0: f06f 030f mvn.w r3, #15 + 80073a4: e00f b.n 80073c6 + LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in ")); + + tcp_debug_print_state(pcb->state); + + if (pcb->state != LISTEN) { + 80073a6: 687b ldr r3, [r7, #4] + 80073a8: 7d1b ldrb r3, [r3, #20] + 80073aa: 2b01 cmp r3, #1 + 80073ac: d006 beq.n 80073bc + /* Set a flag not to receive any more data... */ + tcp_set_flags(pcb, TF_RXCLOSED); + 80073ae: 687b ldr r3, [r7, #4] + 80073b0: 8b5b ldrh r3, [r3, #26] + 80073b2: f043 0310 orr.w r3, r3, #16 + 80073b6: b29a uxth r2, r3 + 80073b8: 687b ldr r3, [r7, #4] + 80073ba: 835a strh r2, [r3, #26] + } + /* ... and close */ + return tcp_close_shutdown(pcb, 1); + 80073bc: 2101 movs r1, #1 + 80073be: 6878 ldr r0, [r7, #4] + 80073c0: f7ff fe94 bl 80070ec + 80073c4: 4603 mov r3, r0 +} + 80073c6: 4618 mov r0, r3 + 80073c8: 3708 adds r7, #8 + 80073ca: 46bd mov sp, r7 + 80073cc: bd80 pop {r7, pc} + 80073ce: bf00 nop + 80073d0: 08016ab4 .word 0x08016ab4 + 80073d4: 08016bc4 .word 0x08016bc4 + 80073d8: 08016af8 .word 0x08016af8 + +080073dc : + * @param pcb the tcp_pcb to abort + * @param reset boolean to indicate whether a reset should be sent + */ +void +tcp_abandon(struct tcp_pcb *pcb, int reset) +{ + 80073dc: b580 push {r7, lr} + 80073de: b08e sub sp, #56 @ 0x38 + 80073e0: af04 add r7, sp, #16 + 80073e2: 6078 str r0, [r7, #4] + 80073e4: 6039 str r1, [r7, #0] +#endif /* LWIP_CALLBACK_API */ + void *errf_arg; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("tcp_abandon: invalid pcb", pcb != NULL, return); + 80073e6: 687b ldr r3, [r7, #4] + 80073e8: 2b00 cmp r3, #0 + 80073ea: d107 bne.n 80073fc + 80073ec: 4b52 ldr r3, [pc, #328] @ (8007538 ) + 80073ee: f240 223d movw r2, #573 @ 0x23d + 80073f2: 4952 ldr r1, [pc, #328] @ (800753c ) + 80073f4: 4852 ldr r0, [pc, #328] @ (8007540 ) + 80073f6: f00a f8ff bl 80115f8 + 80073fa: e099 b.n 8007530 + + /* pcb->state LISTEN not allowed here */ + LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs", + 80073fc: 687b ldr r3, [r7, #4] + 80073fe: 7d1b ldrb r3, [r3, #20] + 8007400: 2b01 cmp r3, #1 + 8007402: d106 bne.n 8007412 + 8007404: 4b4c ldr r3, [pc, #304] @ (8007538 ) + 8007406: f44f 7210 mov.w r2, #576 @ 0x240 + 800740a: 494e ldr r1, [pc, #312] @ (8007544 ) + 800740c: 484c ldr r0, [pc, #304] @ (8007540 ) + 800740e: f00a f8f3 bl 80115f8 + pcb->state != LISTEN); + /* Figure out on which TCP PCB list we are, and remove us. If we + are in an active state, call the receive function associated with + the PCB with a NULL argument, and send an RST to the remote end. */ + if (pcb->state == TIME_WAIT) { + 8007412: 687b ldr r3, [r7, #4] + 8007414: 7d1b ldrb r3, [r3, #20] + 8007416: 2b0a cmp r3, #10 + 8007418: d107 bne.n 800742a + tcp_pcb_remove(&tcp_tw_pcbs, pcb); + 800741a: 6879 ldr r1, [r7, #4] + 800741c: 484a ldr r0, [pc, #296] @ (8007548 ) + 800741e: f000 ffc5 bl 80083ac + tcp_free(pcb); + 8007422: 6878 ldr r0, [r7, #4] + 8007424: f7ff fdb0 bl 8006f88 + 8007428: e082 b.n 8007530 + } else { + int send_rst = 0; + 800742a: 2300 movs r3, #0 + 800742c: 627b str r3, [r7, #36] @ 0x24 + u16_t local_port = 0; + 800742e: 2300 movs r3, #0 + 8007430: 847b strh r3, [r7, #34] @ 0x22 + enum tcp_state last_state; + seqno = pcb->snd_nxt; + 8007432: 687b ldr r3, [r7, #4] + 8007434: 6d1b ldr r3, [r3, #80] @ 0x50 + 8007436: 61bb str r3, [r7, #24] + ackno = pcb->rcv_nxt; + 8007438: 687b ldr r3, [r7, #4] + 800743a: 6a5b ldr r3, [r3, #36] @ 0x24 + 800743c: 617b str r3, [r7, #20] +#if LWIP_CALLBACK_API + errf = pcb->errf; + 800743e: 687b ldr r3, [r7, #4] + 8007440: f8d3 3090 ldr.w r3, [r3, #144] @ 0x90 + 8007444: 613b str r3, [r7, #16] +#endif /* LWIP_CALLBACK_API */ + errf_arg = pcb->callback_arg; + 8007446: 687b ldr r3, [r7, #4] + 8007448: 691b ldr r3, [r3, #16] + 800744a: 60fb str r3, [r7, #12] + if (pcb->state == CLOSED) { + 800744c: 687b ldr r3, [r7, #4] + 800744e: 7d1b ldrb r3, [r3, #20] + 8007450: 2b00 cmp r3, #0 + 8007452: d126 bne.n 80074a2 + if (pcb->local_port != 0) { + 8007454: 687b ldr r3, [r7, #4] + 8007456: 8adb ldrh r3, [r3, #22] + 8007458: 2b00 cmp r3, #0 + 800745a: d02e beq.n 80074ba + /* bound, not yet opened */ + TCP_RMV(&tcp_bound_pcbs, pcb); + 800745c: 4b3b ldr r3, [pc, #236] @ (800754c ) + 800745e: 681b ldr r3, [r3, #0] + 8007460: 687a ldr r2, [r7, #4] + 8007462: 429a cmp r2, r3 + 8007464: d105 bne.n 8007472 + 8007466: 4b39 ldr r3, [pc, #228] @ (800754c ) + 8007468: 681b ldr r3, [r3, #0] + 800746a: 68db ldr r3, [r3, #12] + 800746c: 4a37 ldr r2, [pc, #220] @ (800754c ) + 800746e: 6013 str r3, [r2, #0] + 8007470: e013 b.n 800749a + 8007472: 4b36 ldr r3, [pc, #216] @ (800754c ) + 8007474: 681b ldr r3, [r3, #0] + 8007476: 61fb str r3, [r7, #28] + 8007478: e00c b.n 8007494 + 800747a: 69fb ldr r3, [r7, #28] + 800747c: 68db ldr r3, [r3, #12] + 800747e: 687a ldr r2, [r7, #4] + 8007480: 429a cmp r2, r3 + 8007482: d104 bne.n 800748e + 8007484: 687b ldr r3, [r7, #4] + 8007486: 68da ldr r2, [r3, #12] + 8007488: 69fb ldr r3, [r7, #28] + 800748a: 60da str r2, [r3, #12] + 800748c: e005 b.n 800749a + 800748e: 69fb ldr r3, [r7, #28] + 8007490: 68db ldr r3, [r3, #12] + 8007492: 61fb str r3, [r7, #28] + 8007494: 69fb ldr r3, [r7, #28] + 8007496: 2b00 cmp r3, #0 + 8007498: d1ef bne.n 800747a + 800749a: 687b ldr r3, [r7, #4] + 800749c: 2200 movs r2, #0 + 800749e: 60da str r2, [r3, #12] + 80074a0: e00b b.n 80074ba + } + } else { + send_rst = reset; + 80074a2: 683b ldr r3, [r7, #0] + 80074a4: 627b str r3, [r7, #36] @ 0x24 + local_port = pcb->local_port; + 80074a6: 687b ldr r3, [r7, #4] + 80074a8: 8adb ldrh r3, [r3, #22] + 80074aa: 847b strh r3, [r7, #34] @ 0x22 + TCP_PCB_REMOVE_ACTIVE(pcb); + 80074ac: 6879 ldr r1, [r7, #4] + 80074ae: 4828 ldr r0, [pc, #160] @ (8007550 ) + 80074b0: f000 ff7c bl 80083ac + 80074b4: 4b27 ldr r3, [pc, #156] @ (8007554 ) + 80074b6: 2201 movs r2, #1 + 80074b8: 701a strb r2, [r3, #0] + } + if (pcb->unacked != NULL) { + 80074ba: 687b ldr r3, [r7, #4] + 80074bc: 6f1b ldr r3, [r3, #112] @ 0x70 + 80074be: 2b00 cmp r3, #0 + 80074c0: d004 beq.n 80074cc + tcp_segs_free(pcb->unacked); + 80074c2: 687b ldr r3, [r7, #4] + 80074c4: 6f1b ldr r3, [r3, #112] @ 0x70 + 80074c6: 4618 mov r0, r3 + 80074c8: f000 fd1e bl 8007f08 + } + if (pcb->unsent != NULL) { + 80074cc: 687b ldr r3, [r7, #4] + 80074ce: 6edb ldr r3, [r3, #108] @ 0x6c + 80074d0: 2b00 cmp r3, #0 + 80074d2: d004 beq.n 80074de + tcp_segs_free(pcb->unsent); + 80074d4: 687b ldr r3, [r7, #4] + 80074d6: 6edb ldr r3, [r3, #108] @ 0x6c + 80074d8: 4618 mov r0, r3 + 80074da: f000 fd15 bl 8007f08 + } +#if TCP_QUEUE_OOSEQ + if (pcb->ooseq != NULL) { + 80074de: 687b ldr r3, [r7, #4] + 80074e0: 6f5b ldr r3, [r3, #116] @ 0x74 + 80074e2: 2b00 cmp r3, #0 + 80074e4: d004 beq.n 80074f0 + tcp_segs_free(pcb->ooseq); + 80074e6: 687b ldr r3, [r7, #4] + 80074e8: 6f5b ldr r3, [r3, #116] @ 0x74 + 80074ea: 4618 mov r0, r3 + 80074ec: f000 fd0c bl 8007f08 + } +#endif /* TCP_QUEUE_OOSEQ */ + tcp_backlog_accepted(pcb); + if (send_rst) { + 80074f0: 6a7b ldr r3, [r7, #36] @ 0x24 + 80074f2: 2b00 cmp r3, #0 + 80074f4: d00e beq.n 8007514 + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n")); + tcp_rst(pcb, seqno, ackno, &pcb->local_ip, &pcb->remote_ip, local_port, pcb->remote_port); + 80074f6: 6879 ldr r1, [r7, #4] + 80074f8: 687b ldr r3, [r7, #4] + 80074fa: 3304 adds r3, #4 + 80074fc: 687a ldr r2, [r7, #4] + 80074fe: 8b12 ldrh r2, [r2, #24] + 8007500: 9202 str r2, [sp, #8] + 8007502: 8c7a ldrh r2, [r7, #34] @ 0x22 + 8007504: 9201 str r2, [sp, #4] + 8007506: 9300 str r3, [sp, #0] + 8007508: 460b mov r3, r1 + 800750a: 697a ldr r2, [r7, #20] + 800750c: 69b9 ldr r1, [r7, #24] + 800750e: 6878 ldr r0, [r7, #4] + 8007510: f004 fcbe bl 800be90 + } + last_state = pcb->state; + 8007514: 687b ldr r3, [r7, #4] + 8007516: 7d1b ldrb r3, [r3, #20] + 8007518: 72fb strb r3, [r7, #11] + tcp_free(pcb); + 800751a: 6878 ldr r0, [r7, #4] + 800751c: f7ff fd34 bl 8006f88 + TCP_EVENT_ERR(last_state, errf, errf_arg, ERR_ABRT); + 8007520: 693b ldr r3, [r7, #16] + 8007522: 2b00 cmp r3, #0 + 8007524: d004 beq.n 8007530 + 8007526: 693b ldr r3, [r7, #16] + 8007528: f06f 010c mvn.w r1, #12 + 800752c: 68f8 ldr r0, [r7, #12] + 800752e: 4798 blx r3 + } +} + 8007530: 3728 adds r7, #40 @ 0x28 + 8007532: 46bd mov sp, r7 + 8007534: bd80 pop {r7, pc} + 8007536: bf00 nop + 8007538: 08016ab4 .word 0x08016ab4 + 800753c: 08016bf8 .word 0x08016bf8 + 8007540: 08016af8 .word 0x08016af8 + 8007544: 08016c14 .word 0x08016c14 + 8007548: 200190b4 .word 0x200190b4 + 800754c: 200190a8 .word 0x200190a8 + 8007550: 200190b0 .word 0x200190b0 + 8007554: 200190b8 .word 0x200190b8 + +08007558 : + * + * @param pcb the tcp pcb to abort + */ +void +tcp_abort(struct tcp_pcb *pcb) +{ + 8007558: b580 push {r7, lr} + 800755a: b082 sub sp, #8 + 800755c: af00 add r7, sp, #0 + 800755e: 6078 str r0, [r7, #4] + tcp_abandon(pcb, 1); + 8007560: 2101 movs r1, #1 + 8007562: 6878 ldr r0, [r7, #4] + 8007564: f7ff ff3a bl 80073dc +} + 8007568: bf00 nop + 800756a: 3708 adds r7, #8 + 800756c: 46bd mov sp, r7 + 800756e: bd80 pop {r7, pc} + +08007570 : + * Returns how much extra window would be advertised if we sent an + * update now. + */ +u32_t +tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb) +{ + 8007570: b580 push {r7, lr} + 8007572: b084 sub sp, #16 + 8007574: af00 add r7, sp, #0 + 8007576: 6078 str r0, [r7, #4] + u32_t new_right_edge; + + LWIP_ASSERT("tcp_update_rcv_ann_wnd: invalid pcb", pcb != NULL); + 8007578: 687b ldr r3, [r7, #4] + 800757a: 2b00 cmp r3, #0 + 800757c: d106 bne.n 800758c + 800757e: 4b25 ldr r3, [pc, #148] @ (8007614 ) + 8007580: f240 32a6 movw r2, #934 @ 0x3a6 + 8007584: 4924 ldr r1, [pc, #144] @ (8007618 ) + 8007586: 4825 ldr r0, [pc, #148] @ (800761c ) + 8007588: f00a f836 bl 80115f8 + new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd; + 800758c: 687b ldr r3, [r7, #4] + 800758e: 6a5b ldr r3, [r3, #36] @ 0x24 + 8007590: 687a ldr r2, [r7, #4] + 8007592: 8d12 ldrh r2, [r2, #40] @ 0x28 + 8007594: 4413 add r3, r2 + 8007596: 60fb str r3, [r7, #12] + + if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) { + 8007598: 687b ldr r3, [r7, #4] + 800759a: 6adb ldr r3, [r3, #44] @ 0x2c + 800759c: 687a ldr r2, [r7, #4] + 800759e: 8e52 ldrh r2, [r2, #50] @ 0x32 + 80075a0: f5b2 6f86 cmp.w r2, #1072 @ 0x430 + 80075a4: bf28 it cs + 80075a6: f44f 6286 movcs.w r2, #1072 @ 0x430 + 80075aa: b292 uxth r2, r2 + 80075ac: 4413 add r3, r2 + 80075ae: 68fa ldr r2, [r7, #12] + 80075b0: 1ad3 subs r3, r2, r3 + 80075b2: 2b00 cmp r3, #0 + 80075b4: db08 blt.n 80075c8 + /* we can advertise more window */ + pcb->rcv_ann_wnd = pcb->rcv_wnd; + 80075b6: 687b ldr r3, [r7, #4] + 80075b8: 8d1a ldrh r2, [r3, #40] @ 0x28 + 80075ba: 687b ldr r3, [r7, #4] + 80075bc: 855a strh r2, [r3, #42] @ 0x2a + return new_right_edge - pcb->rcv_ann_right_edge; + 80075be: 687b ldr r3, [r7, #4] + 80075c0: 6adb ldr r3, [r3, #44] @ 0x2c + 80075c2: 68fa ldr r2, [r7, #12] + 80075c4: 1ad3 subs r3, r2, r3 + 80075c6: e020 b.n 800760a + } else { + if (TCP_SEQ_GT(pcb->rcv_nxt, pcb->rcv_ann_right_edge)) { + 80075c8: 687b ldr r3, [r7, #4] + 80075ca: 6a5a ldr r2, [r3, #36] @ 0x24 + 80075cc: 687b ldr r3, [r7, #4] + 80075ce: 6adb ldr r3, [r3, #44] @ 0x2c + 80075d0: 1ad3 subs r3, r2, r3 + 80075d2: 2b00 cmp r3, #0 + 80075d4: dd03 ble.n 80075de + /* Can happen due to other end sending out of advertised window, + * but within actual available (but not yet advertised) window */ + pcb->rcv_ann_wnd = 0; + 80075d6: 687b ldr r3, [r7, #4] + 80075d8: 2200 movs r2, #0 + 80075da: 855a strh r2, [r3, #42] @ 0x2a + 80075dc: e014 b.n 8007608 + } else { + /* keep the right edge of window constant */ + u32_t new_rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt; + 80075de: 687b ldr r3, [r7, #4] + 80075e0: 6ada ldr r2, [r3, #44] @ 0x2c + 80075e2: 687b ldr r3, [r7, #4] + 80075e4: 6a5b ldr r3, [r3, #36] @ 0x24 + 80075e6: 1ad3 subs r3, r2, r3 + 80075e8: 60bb str r3, [r7, #8] +#if !LWIP_WND_SCALE + LWIP_ASSERT("new_rcv_ann_wnd <= 0xffff", new_rcv_ann_wnd <= 0xffff); + 80075ea: 68bb ldr r3, [r7, #8] + 80075ec: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80075f0: d306 bcc.n 8007600 + 80075f2: 4b08 ldr r3, [pc, #32] @ (8007614 ) + 80075f4: f240 32b6 movw r2, #950 @ 0x3b6 + 80075f8: 4909 ldr r1, [pc, #36] @ (8007620 ) + 80075fa: 4808 ldr r0, [pc, #32] @ (800761c ) + 80075fc: f009 fffc bl 80115f8 +#endif + pcb->rcv_ann_wnd = (tcpwnd_size_t)new_rcv_ann_wnd; + 8007600: 68bb ldr r3, [r7, #8] + 8007602: b29a uxth r2, r3 + 8007604: 687b ldr r3, [r7, #4] + 8007606: 855a strh r2, [r3, #42] @ 0x2a + } + return 0; + 8007608: 2300 movs r3, #0 + } +} + 800760a: 4618 mov r0, r3 + 800760c: 3710 adds r7, #16 + 800760e: 46bd mov sp, r7 + 8007610: bd80 pop {r7, pc} + 8007612: bf00 nop + 8007614: 08016ab4 .word 0x08016ab4 + 8007618: 08016d10 .word 0x08016d10 + 800761c: 08016af8 .word 0x08016af8 + 8007620: 08016d34 .word 0x08016d34 + +08007624 : + * @param pcb the tcp_pcb for which data is read + * @param len the amount of bytes that have been read by the application + */ +void +tcp_recved(struct tcp_pcb *pcb, u16_t len) +{ + 8007624: b580 push {r7, lr} + 8007626: b084 sub sp, #16 + 8007628: af00 add r7, sp, #0 + 800762a: 6078 str r0, [r7, #4] + 800762c: 460b mov r3, r1 + 800762e: 807b strh r3, [r7, #2] + u32_t wnd_inflation; + tcpwnd_size_t rcv_wnd; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("tcp_recved: invalid pcb", pcb != NULL, return); + 8007630: 687b ldr r3, [r7, #4] + 8007632: 2b00 cmp r3, #0 + 8007634: d107 bne.n 8007646 + 8007636: 4b1f ldr r3, [pc, #124] @ (80076b4 ) + 8007638: f240 32cf movw r2, #975 @ 0x3cf + 800763c: 491e ldr r1, [pc, #120] @ (80076b8 ) + 800763e: 481f ldr r0, [pc, #124] @ (80076bc ) + 8007640: f009 ffda bl 80115f8 + 8007644: e032 b.n 80076ac + + /* pcb->state LISTEN not allowed here */ + LWIP_ASSERT("don't call tcp_recved for listen-pcbs", + 8007646: 687b ldr r3, [r7, #4] + 8007648: 7d1b ldrb r3, [r3, #20] + 800764a: 2b01 cmp r3, #1 + 800764c: d106 bne.n 800765c + 800764e: 4b19 ldr r3, [pc, #100] @ (80076b4 ) + 8007650: f240 32d2 movw r2, #978 @ 0x3d2 + 8007654: 491a ldr r1, [pc, #104] @ (80076c0 ) + 8007656: 4819 ldr r0, [pc, #100] @ (80076bc ) + 8007658: f009 ffce bl 80115f8 + pcb->state != LISTEN); + + rcv_wnd = (tcpwnd_size_t)(pcb->rcv_wnd + len); + 800765c: 687b ldr r3, [r7, #4] + 800765e: 8d1a ldrh r2, [r3, #40] @ 0x28 + 8007660: 887b ldrh r3, [r7, #2] + 8007662: 4413 add r3, r2 + 8007664: 81fb strh r3, [r7, #14] + if ((rcv_wnd > TCP_WND_MAX(pcb)) || (rcv_wnd < pcb->rcv_wnd)) { + 8007666: 89fb ldrh r3, [r7, #14] + 8007668: f5b3 6f06 cmp.w r3, #2144 @ 0x860 + 800766c: d804 bhi.n 8007678 + 800766e: 687b ldr r3, [r7, #4] + 8007670: 8d1b ldrh r3, [r3, #40] @ 0x28 + 8007672: 89fa ldrh r2, [r7, #14] + 8007674: 429a cmp r2, r3 + 8007676: d204 bcs.n 8007682 + /* window got too big or tcpwnd_size_t overflow */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: window got too big or tcpwnd_size_t overflow\n")); + pcb->rcv_wnd = TCP_WND_MAX(pcb); + 8007678: 687b ldr r3, [r7, #4] + 800767a: f44f 6206 mov.w r2, #2144 @ 0x860 + 800767e: 851a strh r2, [r3, #40] @ 0x28 + 8007680: e002 b.n 8007688 + } else { + pcb->rcv_wnd = rcv_wnd; + 8007682: 687b ldr r3, [r7, #4] + 8007684: 89fa ldrh r2, [r7, #14] + 8007686: 851a strh r2, [r3, #40] @ 0x28 + } + + wnd_inflation = tcp_update_rcv_ann_wnd(pcb); + 8007688: 6878 ldr r0, [r7, #4] + 800768a: f7ff ff71 bl 8007570 + 800768e: 60b8 str r0, [r7, #8] + + /* If the change in the right edge of window is significant (default + * watermark is TCP_WND/4), then send an explicit update now. + * Otherwise wait for a packet to be sent in the normal course of + * events (or more window to be available later) */ + if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) { + 8007690: 68bb ldr r3, [r7, #8] + 8007692: f5b3 7f06 cmp.w r3, #536 @ 0x218 + 8007696: d309 bcc.n 80076ac + tcp_ack_now(pcb); + 8007698: 687b ldr r3, [r7, #4] + 800769a: 8b5b ldrh r3, [r3, #26] + 800769c: f043 0302 orr.w r3, r3, #2 + 80076a0: b29a uxth r2, r3 + 80076a2: 687b ldr r3, [r7, #4] + 80076a4: 835a strh r2, [r3, #26] + tcp_output(pcb); + 80076a6: 6878 ldr r0, [r7, #4] + 80076a8: f003 fe3e bl 800b328 + } + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F").\n", + len, pcb->rcv_wnd, (u16_t)(TCP_WND_MAX(pcb) - pcb->rcv_wnd))); +} + 80076ac: 3710 adds r7, #16 + 80076ae: 46bd mov sp, r7 + 80076b0: bd80 pop {r7, pc} + 80076b2: bf00 nop + 80076b4: 08016ab4 .word 0x08016ab4 + 80076b8: 08016d50 .word 0x08016d50 + 80076bc: 08016af8 .word 0x08016af8 + 80076c0: 08016d68 .word 0x08016d68 + +080076c4 : + * + * Automatically called from tcp_tmr(). + */ +void +tcp_slowtmr(void) +{ + 80076c4: b5b0 push {r4, r5, r7, lr} + 80076c6: b090 sub sp, #64 @ 0x40 + 80076c8: af04 add r7, sp, #16 + tcpwnd_size_t eff_wnd; + u8_t pcb_remove; /* flag if a PCB should be removed */ + u8_t pcb_reset; /* flag if a RST should be sent when removing */ + err_t err; + + err = ERR_OK; + 80076ca: 2300 movs r3, #0 + 80076cc: f887 3025 strb.w r3, [r7, #37] @ 0x25 + + ++tcp_ticks; + 80076d0: 4b95 ldr r3, [pc, #596] @ (8007928 ) + 80076d2: 681b ldr r3, [r3, #0] + 80076d4: 3301 adds r3, #1 + 80076d6: 4a94 ldr r2, [pc, #592] @ (8007928 ) + 80076d8: 6013 str r3, [r2, #0] + ++tcp_timer_ctr; + 80076da: 4b94 ldr r3, [pc, #592] @ (800792c ) + 80076dc: 781b ldrb r3, [r3, #0] + 80076de: 3301 adds r3, #1 + 80076e0: b2da uxtb r2, r3 + 80076e2: 4b92 ldr r3, [pc, #584] @ (800792c ) + 80076e4: 701a strb r2, [r3, #0] + 80076e6: e000 b.n 80076ea + prev->polltmr = 0; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n")); + tcp_active_pcbs_changed = 0; + TCP_EVENT_POLL(prev, err); + if (tcp_active_pcbs_changed) { + goto tcp_slowtmr_start; + 80076e8: bf00 nop + prev = NULL; + 80076ea: 2300 movs r3, #0 + 80076ec: 62bb str r3, [r7, #40] @ 0x28 + pcb = tcp_active_pcbs; + 80076ee: 4b90 ldr r3, [pc, #576] @ (8007930 ) + 80076f0: 681b ldr r3, [r3, #0] + 80076f2: 62fb str r3, [r7, #44] @ 0x2c + while (pcb != NULL) { + 80076f4: e29f b.n 8007c36 + LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED); + 80076f6: 6afb ldr r3, [r7, #44] @ 0x2c + 80076f8: 7d1b ldrb r3, [r3, #20] + 80076fa: 2b00 cmp r3, #0 + 80076fc: d106 bne.n 800770c + 80076fe: 4b8d ldr r3, [pc, #564] @ (8007934 ) + 8007700: f240 42be movw r2, #1214 @ 0x4be + 8007704: 498c ldr r1, [pc, #560] @ (8007938 ) + 8007706: 488d ldr r0, [pc, #564] @ (800793c ) + 8007708: f009 ff76 bl 80115f8 + LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN); + 800770c: 6afb ldr r3, [r7, #44] @ 0x2c + 800770e: 7d1b ldrb r3, [r3, #20] + 8007710: 2b01 cmp r3, #1 + 8007712: d106 bne.n 8007722 + 8007714: 4b87 ldr r3, [pc, #540] @ (8007934 ) + 8007716: f240 42bf movw r2, #1215 @ 0x4bf + 800771a: 4989 ldr r1, [pc, #548] @ (8007940 ) + 800771c: 4887 ldr r0, [pc, #540] @ (800793c ) + 800771e: f009 ff6b bl 80115f8 + LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT); + 8007722: 6afb ldr r3, [r7, #44] @ 0x2c + 8007724: 7d1b ldrb r3, [r3, #20] + 8007726: 2b0a cmp r3, #10 + 8007728: d106 bne.n 8007738 + 800772a: 4b82 ldr r3, [pc, #520] @ (8007934 ) + 800772c: f44f 6298 mov.w r2, #1216 @ 0x4c0 + 8007730: 4984 ldr r1, [pc, #528] @ (8007944 ) + 8007732: 4882 ldr r0, [pc, #520] @ (800793c ) + 8007734: f009 ff60 bl 80115f8 + if (pcb->last_timer == tcp_timer_ctr) { + 8007738: 6afb ldr r3, [r7, #44] @ 0x2c + 800773a: 7f9a ldrb r2, [r3, #30] + 800773c: 4b7b ldr r3, [pc, #492] @ (800792c ) + 800773e: 781b ldrb r3, [r3, #0] + 8007740: 429a cmp r2, r3 + 8007742: d105 bne.n 8007750 + prev = pcb; + 8007744: 6afb ldr r3, [r7, #44] @ 0x2c + 8007746: 62bb str r3, [r7, #40] @ 0x28 + pcb = pcb->next; + 8007748: 6afb ldr r3, [r7, #44] @ 0x2c + 800774a: 68db ldr r3, [r3, #12] + 800774c: 62fb str r3, [r7, #44] @ 0x2c + continue; + 800774e: e272 b.n 8007c36 + pcb->last_timer = tcp_timer_ctr; + 8007750: 4b76 ldr r3, [pc, #472] @ (800792c ) + 8007752: 781a ldrb r2, [r3, #0] + 8007754: 6afb ldr r3, [r7, #44] @ 0x2c + 8007756: 779a strb r2, [r3, #30] + pcb_remove = 0; + 8007758: 2300 movs r3, #0 + 800775a: f887 3027 strb.w r3, [r7, #39] @ 0x27 + pcb_reset = 0; + 800775e: 2300 movs r3, #0 + 8007760: f887 3026 strb.w r3, [r7, #38] @ 0x26 + if (pcb->state == SYN_SENT && pcb->nrtx >= TCP_SYNMAXRTX) { + 8007764: 6afb ldr r3, [r7, #44] @ 0x2c + 8007766: 7d1b ldrb r3, [r3, #20] + 8007768: 2b02 cmp r3, #2 + 800776a: d10a bne.n 8007782 + 800776c: 6afb ldr r3, [r7, #44] @ 0x2c + 800776e: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 8007772: 2b05 cmp r3, #5 + 8007774: d905 bls.n 8007782 + ++pcb_remove; + 8007776: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800777a: 3301 adds r3, #1 + 800777c: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 8007780: e11e b.n 80079c0 + } else if (pcb->nrtx >= TCP_MAXRTX) { + 8007782: 6afb ldr r3, [r7, #44] @ 0x2c + 8007784: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 8007788: 2b0b cmp r3, #11 + 800778a: d905 bls.n 8007798 + ++pcb_remove; + 800778c: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007790: 3301 adds r3, #1 + 8007792: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 8007796: e113 b.n 80079c0 + if (pcb->persist_backoff > 0) { + 8007798: 6afb ldr r3, [r7, #44] @ 0x2c + 800779a: f893 3099 ldrb.w r3, [r3, #153] @ 0x99 + 800779e: 2b00 cmp r3, #0 + 80077a0: d075 beq.n 800788e + LWIP_ASSERT("tcp_slowtimr: persist ticking with in-flight data", pcb->unacked == NULL); + 80077a2: 6afb ldr r3, [r7, #44] @ 0x2c + 80077a4: 6f1b ldr r3, [r3, #112] @ 0x70 + 80077a6: 2b00 cmp r3, #0 + 80077a8: d006 beq.n 80077b8 + 80077aa: 4b62 ldr r3, [pc, #392] @ (8007934 ) + 80077ac: f240 42d4 movw r2, #1236 @ 0x4d4 + 80077b0: 4965 ldr r1, [pc, #404] @ (8007948 ) + 80077b2: 4862 ldr r0, [pc, #392] @ (800793c ) + 80077b4: f009 ff20 bl 80115f8 + LWIP_ASSERT("tcp_slowtimr: persist ticking with empty send buffer", pcb->unsent != NULL); + 80077b8: 6afb ldr r3, [r7, #44] @ 0x2c + 80077ba: 6edb ldr r3, [r3, #108] @ 0x6c + 80077bc: 2b00 cmp r3, #0 + 80077be: d106 bne.n 80077ce + 80077c0: 4b5c ldr r3, [pc, #368] @ (8007934 ) + 80077c2: f240 42d5 movw r2, #1237 @ 0x4d5 + 80077c6: 4961 ldr r1, [pc, #388] @ (800794c ) + 80077c8: 485c ldr r0, [pc, #368] @ (800793c ) + 80077ca: f009 ff15 bl 80115f8 + if (pcb->persist_probe >= TCP_MAXRTX) { + 80077ce: 6afb ldr r3, [r7, #44] @ 0x2c + 80077d0: f893 309a ldrb.w r3, [r3, #154] @ 0x9a + 80077d4: 2b0b cmp r3, #11 + 80077d6: d905 bls.n 80077e4 + ++pcb_remove; /* max probes reached */ + 80077d8: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 80077dc: 3301 adds r3, #1 + 80077de: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 80077e2: e0ed b.n 80079c0 + u8_t backoff_cnt = tcp_persist_backoff[pcb->persist_backoff - 1]; + 80077e4: 6afb ldr r3, [r7, #44] @ 0x2c + 80077e6: f893 3099 ldrb.w r3, [r3, #153] @ 0x99 + 80077ea: 3b01 subs r3, #1 + 80077ec: 4a58 ldr r2, [pc, #352] @ (8007950 ) + 80077ee: 5cd3 ldrb r3, [r2, r3] + 80077f0: 747b strb r3, [r7, #17] + if (pcb->persist_cnt < backoff_cnt) { + 80077f2: 6afb ldr r3, [r7, #44] @ 0x2c + 80077f4: f893 3098 ldrb.w r3, [r3, #152] @ 0x98 + 80077f8: 7c7a ldrb r2, [r7, #17] + 80077fa: 429a cmp r2, r3 + 80077fc: d907 bls.n 800780e + pcb->persist_cnt++; + 80077fe: 6afb ldr r3, [r7, #44] @ 0x2c + 8007800: f893 3098 ldrb.w r3, [r3, #152] @ 0x98 + 8007804: 3301 adds r3, #1 + 8007806: b2da uxtb r2, r3 + 8007808: 6afb ldr r3, [r7, #44] @ 0x2c + 800780a: f883 2098 strb.w r2, [r3, #152] @ 0x98 + if (pcb->persist_cnt >= backoff_cnt) { + 800780e: 6afb ldr r3, [r7, #44] @ 0x2c + 8007810: f893 3098 ldrb.w r3, [r3, #152] @ 0x98 + 8007814: 7c7a ldrb r2, [r7, #17] + 8007816: 429a cmp r2, r3 + 8007818: f200 80d2 bhi.w 80079c0 + int next_slot = 1; /* increment timer to next slot */ + 800781c: 2301 movs r3, #1 + 800781e: 623b str r3, [r7, #32] + if (pcb->snd_wnd == 0) { + 8007820: 6afb ldr r3, [r7, #44] @ 0x2c + 8007822: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 8007826: 2b00 cmp r3, #0 + 8007828: d108 bne.n 800783c + if (tcp_zero_window_probe(pcb) != ERR_OK) { + 800782a: 6af8 ldr r0, [r7, #44] @ 0x2c + 800782c: f004 fc24 bl 800c078 + 8007830: 4603 mov r3, r0 + 8007832: 2b00 cmp r3, #0 + 8007834: d014 beq.n 8007860 + next_slot = 0; /* try probe again with current slot */ + 8007836: 2300 movs r3, #0 + 8007838: 623b str r3, [r7, #32] + 800783a: e011 b.n 8007860 + if (tcp_split_unsent_seg(pcb, (u16_t)pcb->snd_wnd) == ERR_OK) { + 800783c: 6afb ldr r3, [r7, #44] @ 0x2c + 800783e: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 8007842: 4619 mov r1, r3 + 8007844: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007846: f003 fae9 bl 800ae1c + 800784a: 4603 mov r3, r0 + 800784c: 2b00 cmp r3, #0 + 800784e: d107 bne.n 8007860 + if (tcp_output(pcb) == ERR_OK) { + 8007850: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007852: f003 fd69 bl 800b328 + 8007856: 4603 mov r3, r0 + 8007858: 2b00 cmp r3, #0 + 800785a: d101 bne.n 8007860 + next_slot = 0; + 800785c: 2300 movs r3, #0 + 800785e: 623b str r3, [r7, #32] + if (next_slot) { + 8007860: 6a3b ldr r3, [r7, #32] + 8007862: 2b00 cmp r3, #0 + 8007864: f000 80ac beq.w 80079c0 + pcb->persist_cnt = 0; + 8007868: 6afb ldr r3, [r7, #44] @ 0x2c + 800786a: 2200 movs r2, #0 + 800786c: f883 2098 strb.w r2, [r3, #152] @ 0x98 + if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) { + 8007870: 6afb ldr r3, [r7, #44] @ 0x2c + 8007872: f893 3099 ldrb.w r3, [r3, #153] @ 0x99 + 8007876: 2b06 cmp r3, #6 + 8007878: f200 80a2 bhi.w 80079c0 + pcb->persist_backoff++; + 800787c: 6afb ldr r3, [r7, #44] @ 0x2c + 800787e: f893 3099 ldrb.w r3, [r3, #153] @ 0x99 + 8007882: 3301 adds r3, #1 + 8007884: b2da uxtb r2, r3 + 8007886: 6afb ldr r3, [r7, #44] @ 0x2c + 8007888: f883 2099 strb.w r2, [r3, #153] @ 0x99 + 800788c: e098 b.n 80079c0 + if ((pcb->rtime >= 0) && (pcb->rtime < 0x7FFF)) { + 800788e: 6afb ldr r3, [r7, #44] @ 0x2c + 8007890: f9b3 3030 ldrsh.w r3, [r3, #48] @ 0x30 + 8007894: 2b00 cmp r3, #0 + 8007896: db0f blt.n 80078b8 + 8007898: 6afb ldr r3, [r7, #44] @ 0x2c + 800789a: f9b3 3030 ldrsh.w r3, [r3, #48] @ 0x30 + 800789e: f647 72ff movw r2, #32767 @ 0x7fff + 80078a2: 4293 cmp r3, r2 + 80078a4: d008 beq.n 80078b8 + ++pcb->rtime; + 80078a6: 6afb ldr r3, [r7, #44] @ 0x2c + 80078a8: f9b3 3030 ldrsh.w r3, [r3, #48] @ 0x30 + 80078ac: b29b uxth r3, r3 + 80078ae: 3301 adds r3, #1 + 80078b0: b29b uxth r3, r3 + 80078b2: b21a sxth r2, r3 + 80078b4: 6afb ldr r3, [r7, #44] @ 0x2c + 80078b6: 861a strh r2, [r3, #48] @ 0x30 + if (pcb->rtime >= pcb->rto) { + 80078b8: 6afb ldr r3, [r7, #44] @ 0x2c + 80078ba: f9b3 2030 ldrsh.w r2, [r3, #48] @ 0x30 + 80078be: 6afb ldr r3, [r7, #44] @ 0x2c + 80078c0: f9b3 3040 ldrsh.w r3, [r3, #64] @ 0x40 + 80078c4: 429a cmp r2, r3 + 80078c6: db7b blt.n 80079c0 + if ((tcp_rexmit_rto_prepare(pcb) == ERR_OK) || ((pcb->unacked == NULL) && (pcb->unsent != NULL))) { + 80078c8: 6af8 ldr r0, [r7, #44] @ 0x2c + 80078ca: f004 f821 bl 800b910 + 80078ce: 4603 mov r3, r0 + 80078d0: 2b00 cmp r3, #0 + 80078d2: d007 beq.n 80078e4 + 80078d4: 6afb ldr r3, [r7, #44] @ 0x2c + 80078d6: 6f1b ldr r3, [r3, #112] @ 0x70 + 80078d8: 2b00 cmp r3, #0 + 80078da: d171 bne.n 80079c0 + 80078dc: 6afb ldr r3, [r7, #44] @ 0x2c + 80078de: 6edb ldr r3, [r3, #108] @ 0x6c + 80078e0: 2b00 cmp r3, #0 + 80078e2: d06d beq.n 80079c0 + if (pcb->state != SYN_SENT) { + 80078e4: 6afb ldr r3, [r7, #44] @ 0x2c + 80078e6: 7d1b ldrb r3, [r3, #20] + 80078e8: 2b02 cmp r3, #2 + 80078ea: d03a beq.n 8007962 + u8_t backoff_idx = LWIP_MIN(pcb->nrtx, sizeof(tcp_backoff) - 1); + 80078ec: 6afb ldr r3, [r7, #44] @ 0x2c + 80078ee: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 80078f2: 2b0c cmp r3, #12 + 80078f4: bf28 it cs + 80078f6: 230c movcs r3, #12 + 80078f8: 76fb strb r3, [r7, #27] + int calc_rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[backoff_idx]; + 80078fa: 6afb ldr r3, [r7, #44] @ 0x2c + 80078fc: f9b3 303c ldrsh.w r3, [r3, #60] @ 0x3c + 8007900: 10db asrs r3, r3, #3 + 8007902: b21b sxth r3, r3 + 8007904: 461a mov r2, r3 + 8007906: 6afb ldr r3, [r7, #44] @ 0x2c + 8007908: f9b3 303e ldrsh.w r3, [r3, #62] @ 0x3e + 800790c: 4413 add r3, r2 + 800790e: 7efa ldrb r2, [r7, #27] + 8007910: 4910 ldr r1, [pc, #64] @ (8007954 ) + 8007912: 5c8a ldrb r2, [r1, r2] + 8007914: 4093 lsls r3, r2 + 8007916: 617b str r3, [r7, #20] + pcb->rto = (s16_t)LWIP_MIN(calc_rto, 0x7FFF); + 8007918: 697b ldr r3, [r7, #20] + 800791a: f647 72fe movw r2, #32766 @ 0x7ffe + 800791e: 4293 cmp r3, r2 + 8007920: dc1a bgt.n 8007958 + 8007922: 697b ldr r3, [r7, #20] + 8007924: b21a sxth r2, r3 + 8007926: e019 b.n 800795c + 8007928: 200190a4 .word 0x200190a4 + 800792c: 200190ba .word 0x200190ba + 8007930: 200190b0 .word 0x200190b0 + 8007934: 08016ab4 .word 0x08016ab4 + 8007938: 08016df8 .word 0x08016df8 + 800793c: 08016af8 .word 0x08016af8 + 8007940: 08016e24 .word 0x08016e24 + 8007944: 08016e50 .word 0x08016e50 + 8007948: 08016e80 .word 0x08016e80 + 800794c: 08016eb4 .word 0x08016eb4 + 8007950: 08018e94 .word 0x08018e94 + 8007954: 08018e84 .word 0x08018e84 + 8007958: f647 72ff movw r2, #32767 @ 0x7fff + 800795c: 6afb ldr r3, [r7, #44] @ 0x2c + 800795e: f8a3 2040 strh.w r2, [r3, #64] @ 0x40 + pcb->rtime = 0; + 8007962: 6afb ldr r3, [r7, #44] @ 0x2c + 8007964: 2200 movs r2, #0 + 8007966: 861a strh r2, [r3, #48] @ 0x30 + eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd); + 8007968: 6afb ldr r3, [r7, #44] @ 0x2c + 800796a: f8b3 2060 ldrh.w r2, [r3, #96] @ 0x60 + 800796e: 6afb ldr r3, [r7, #44] @ 0x2c + 8007970: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 8007974: 4293 cmp r3, r2 + 8007976: bf28 it cs + 8007978: 4613 movcs r3, r2 + 800797a: 827b strh r3, [r7, #18] + pcb->ssthresh = eff_wnd >> 1; + 800797c: 8a7b ldrh r3, [r7, #18] + 800797e: 085b lsrs r3, r3, #1 + 8007980: b29a uxth r2, r3 + 8007982: 6afb ldr r3, [r7, #44] @ 0x2c + 8007984: f8a3 204a strh.w r2, [r3, #74] @ 0x4a + if (pcb->ssthresh < (tcpwnd_size_t)(pcb->mss << 1)) { + 8007988: 6afb ldr r3, [r7, #44] @ 0x2c + 800798a: f8b3 204a ldrh.w r2, [r3, #74] @ 0x4a + 800798e: 6afb ldr r3, [r7, #44] @ 0x2c + 8007990: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8007992: 005b lsls r3, r3, #1 + 8007994: b29b uxth r3, r3 + 8007996: 429a cmp r2, r3 + 8007998: d206 bcs.n 80079a8 + pcb->ssthresh = (tcpwnd_size_t)(pcb->mss << 1); + 800799a: 6afb ldr r3, [r7, #44] @ 0x2c + 800799c: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800799e: 005b lsls r3, r3, #1 + 80079a0: b29a uxth r2, r3 + 80079a2: 6afb ldr r3, [r7, #44] @ 0x2c + 80079a4: f8a3 204a strh.w r2, [r3, #74] @ 0x4a + pcb->cwnd = pcb->mss; + 80079a8: 6afb ldr r3, [r7, #44] @ 0x2c + 80079aa: 8e5a ldrh r2, [r3, #50] @ 0x32 + 80079ac: 6afb ldr r3, [r7, #44] @ 0x2c + 80079ae: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + pcb->bytes_acked = 0; + 80079b2: 6afb ldr r3, [r7, #44] @ 0x2c + 80079b4: 2200 movs r2, #0 + 80079b6: f8a3 206a strh.w r2, [r3, #106] @ 0x6a + tcp_rexmit_rto_commit(pcb); + 80079ba: 6af8 ldr r0, [r7, #44] @ 0x2c + 80079bc: f004 f818 bl 800b9f0 + if (pcb->state == FIN_WAIT_2) { + 80079c0: 6afb ldr r3, [r7, #44] @ 0x2c + 80079c2: 7d1b ldrb r3, [r3, #20] + 80079c4: 2b06 cmp r3, #6 + 80079c6: d111 bne.n 80079ec + if (pcb->flags & TF_RXCLOSED) { + 80079c8: 6afb ldr r3, [r7, #44] @ 0x2c + 80079ca: 8b5b ldrh r3, [r3, #26] + 80079cc: f003 0310 and.w r3, r3, #16 + 80079d0: 2b00 cmp r3, #0 + 80079d2: d00b beq.n 80079ec + if ((u32_t)(tcp_ticks - pcb->tmr) > + 80079d4: 4b9d ldr r3, [pc, #628] @ (8007c4c ) + 80079d6: 681a ldr r2, [r3, #0] + 80079d8: 6afb ldr r3, [r7, #44] @ 0x2c + 80079da: 6a1b ldr r3, [r3, #32] + 80079dc: 1ad3 subs r3, r2, r3 + 80079de: 2b28 cmp r3, #40 @ 0x28 + 80079e0: d904 bls.n 80079ec + ++pcb_remove; + 80079e2: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 80079e6: 3301 adds r3, #1 + 80079e8: f887 3027 strb.w r3, [r7, #39] @ 0x27 + if (ip_get_option(pcb, SOF_KEEPALIVE) && + 80079ec: 6afb ldr r3, [r7, #44] @ 0x2c + 80079ee: 7a5b ldrb r3, [r3, #9] + 80079f0: f003 0308 and.w r3, r3, #8 + 80079f4: 2b00 cmp r3, #0 + 80079f6: d04c beq.n 8007a92 + ((pcb->state == ESTABLISHED) || + 80079f8: 6afb ldr r3, [r7, #44] @ 0x2c + 80079fa: 7d1b ldrb r3, [r3, #20] + if (ip_get_option(pcb, SOF_KEEPALIVE) && + 80079fc: 2b04 cmp r3, #4 + 80079fe: d003 beq.n 8007a08 + (pcb->state == CLOSE_WAIT))) { + 8007a00: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a02: 7d1b ldrb r3, [r3, #20] + ((pcb->state == ESTABLISHED) || + 8007a04: 2b07 cmp r3, #7 + 8007a06: d144 bne.n 8007a92 + if ((u32_t)(tcp_ticks - pcb->tmr) > + 8007a08: 4b90 ldr r3, [pc, #576] @ (8007c4c ) + 8007a0a: 681a ldr r2, [r3, #0] + 8007a0c: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a0e: 6a1b ldr r3, [r3, #32] + 8007a10: 1ad2 subs r2, r2, r3 + (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL) { + 8007a12: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a14: f8d3 3094 ldr.w r3, [r3, #148] @ 0x94 + 8007a18: f503 2324 add.w r3, r3, #671744 @ 0xa4000 + 8007a1c: f603 43b8 addw r3, r3, #3256 @ 0xcb8 + 8007a20: 498b ldr r1, [pc, #556] @ (8007c50 ) + 8007a22: fba1 1303 umull r1, r3, r1, r3 + 8007a26: 095b lsrs r3, r3, #5 + if ((u32_t)(tcp_ticks - pcb->tmr) > + 8007a28: 429a cmp r2, r3 + 8007a2a: d90a bls.n 8007a42 + ++pcb_remove; + 8007a2c: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007a30: 3301 adds r3, #1 + 8007a32: f887 3027 strb.w r3, [r7, #39] @ 0x27 + ++pcb_reset; + 8007a36: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 8007a3a: 3301 adds r3, #1 + 8007a3c: f887 3026 strb.w r3, [r7, #38] @ 0x26 + 8007a40: e027 b.n 8007a92 + } else if ((u32_t)(tcp_ticks - pcb->tmr) > + 8007a42: 4b82 ldr r3, [pc, #520] @ (8007c4c ) + 8007a44: 681a ldr r2, [r3, #0] + 8007a46: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a48: 6a1b ldr r3, [r3, #32] + 8007a4a: 1ad2 subs r2, r2, r3 + (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb)) + 8007a4c: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a4e: f8d3 1094 ldr.w r1, [r3, #148] @ 0x94 + 8007a52: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a54: f893 309b ldrb.w r3, [r3, #155] @ 0x9b + 8007a58: 4618 mov r0, r3 + 8007a5a: 4b7e ldr r3, [pc, #504] @ (8007c54 ) + 8007a5c: fb00 f303 mul.w r3, r0, r3 + 8007a60: 440b add r3, r1 + / TCP_SLOW_INTERVAL) { + 8007a62: 497b ldr r1, [pc, #492] @ (8007c50 ) + 8007a64: fba1 1303 umull r1, r3, r1, r3 + 8007a68: 095b lsrs r3, r3, #5 + } else if ((u32_t)(tcp_ticks - pcb->tmr) > + 8007a6a: 429a cmp r2, r3 + 8007a6c: d911 bls.n 8007a92 + err = tcp_keepalive(pcb); + 8007a6e: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007a70: f004 fac2 bl 800bff8 + 8007a74: 4603 mov r3, r0 + 8007a76: f887 3025 strb.w r3, [r7, #37] @ 0x25 + if (err == ERR_OK) { + 8007a7a: f997 3025 ldrsb.w r3, [r7, #37] @ 0x25 + 8007a7e: 2b00 cmp r3, #0 + 8007a80: d107 bne.n 8007a92 + pcb->keep_cnt_sent++; + 8007a82: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a84: f893 309b ldrb.w r3, [r3, #155] @ 0x9b + 8007a88: 3301 adds r3, #1 + 8007a8a: b2da uxtb r2, r3 + 8007a8c: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a8e: f883 209b strb.w r2, [r3, #155] @ 0x9b + if (pcb->ooseq != NULL && + 8007a92: 6afb ldr r3, [r7, #44] @ 0x2c + 8007a94: 6f5b ldr r3, [r3, #116] @ 0x74 + 8007a96: 2b00 cmp r3, #0 + 8007a98: d011 beq.n 8007abe + (tcp_ticks - pcb->tmr >= (u32_t)pcb->rto * TCP_OOSEQ_TIMEOUT)) { + 8007a9a: 4b6c ldr r3, [pc, #432] @ (8007c4c ) + 8007a9c: 681a ldr r2, [r3, #0] + 8007a9e: 6afb ldr r3, [r7, #44] @ 0x2c + 8007aa0: 6a1b ldr r3, [r3, #32] + 8007aa2: 1ad2 subs r2, r2, r3 + 8007aa4: 6afb ldr r3, [r7, #44] @ 0x2c + 8007aa6: f9b3 3040 ldrsh.w r3, [r3, #64] @ 0x40 + 8007aaa: 4619 mov r1, r3 + 8007aac: 460b mov r3, r1 + 8007aae: 005b lsls r3, r3, #1 + 8007ab0: 440b add r3, r1 + 8007ab2: 005b lsls r3, r3, #1 + if (pcb->ooseq != NULL && + 8007ab4: 429a cmp r2, r3 + 8007ab6: d302 bcc.n 8007abe + tcp_free_ooseq(pcb); + 8007ab8: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007aba: f000 fddb bl 8008674 + if (pcb->state == SYN_RCVD) { + 8007abe: 6afb ldr r3, [r7, #44] @ 0x2c + 8007ac0: 7d1b ldrb r3, [r3, #20] + 8007ac2: 2b03 cmp r3, #3 + 8007ac4: d10b bne.n 8007ade + if ((u32_t)(tcp_ticks - pcb->tmr) > + 8007ac6: 4b61 ldr r3, [pc, #388] @ (8007c4c ) + 8007ac8: 681a ldr r2, [r3, #0] + 8007aca: 6afb ldr r3, [r7, #44] @ 0x2c + 8007acc: 6a1b ldr r3, [r3, #32] + 8007ace: 1ad3 subs r3, r2, r3 + 8007ad0: 2b28 cmp r3, #40 @ 0x28 + 8007ad2: d904 bls.n 8007ade + ++pcb_remove; + 8007ad4: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007ad8: 3301 adds r3, #1 + 8007ada: f887 3027 strb.w r3, [r7, #39] @ 0x27 + if (pcb->state == LAST_ACK) { + 8007ade: 6afb ldr r3, [r7, #44] @ 0x2c + 8007ae0: 7d1b ldrb r3, [r3, #20] + 8007ae2: 2b09 cmp r3, #9 + 8007ae4: d10b bne.n 8007afe + if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { + 8007ae6: 4b59 ldr r3, [pc, #356] @ (8007c4c ) + 8007ae8: 681a ldr r2, [r3, #0] + 8007aea: 6afb ldr r3, [r7, #44] @ 0x2c + 8007aec: 6a1b ldr r3, [r3, #32] + 8007aee: 1ad3 subs r3, r2, r3 + 8007af0: 2bf0 cmp r3, #240 @ 0xf0 + 8007af2: d904 bls.n 8007afe + ++pcb_remove; + 8007af4: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007af8: 3301 adds r3, #1 + 8007afa: f887 3027 strb.w r3, [r7, #39] @ 0x27 + if (pcb_remove) { + 8007afe: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007b02: 2b00 cmp r3, #0 + 8007b04: d060 beq.n 8007bc8 + tcp_err_fn err_fn = pcb->errf; + 8007b06: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b08: f8d3 3090 ldr.w r3, [r3, #144] @ 0x90 + 8007b0c: 60fb str r3, [r7, #12] + tcp_pcb_purge(pcb); + 8007b0e: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007b10: f000 fbfc bl 800830c + if (prev != NULL) { + 8007b14: 6abb ldr r3, [r7, #40] @ 0x28 + 8007b16: 2b00 cmp r3, #0 + 8007b18: d010 beq.n 8007b3c + LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_active_pcbs", pcb != tcp_active_pcbs); + 8007b1a: 4b4f ldr r3, [pc, #316] @ (8007c58 ) + 8007b1c: 681b ldr r3, [r3, #0] + 8007b1e: 6afa ldr r2, [r7, #44] @ 0x2c + 8007b20: 429a cmp r2, r3 + 8007b22: d106 bne.n 8007b32 + 8007b24: 4b4d ldr r3, [pc, #308] @ (8007c5c ) + 8007b26: f240 526d movw r2, #1389 @ 0x56d + 8007b2a: 494d ldr r1, [pc, #308] @ (8007c60 ) + 8007b2c: 484d ldr r0, [pc, #308] @ (8007c64 ) + 8007b2e: f009 fd63 bl 80115f8 + prev->next = pcb->next; + 8007b32: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b34: 68da ldr r2, [r3, #12] + 8007b36: 6abb ldr r3, [r7, #40] @ 0x28 + 8007b38: 60da str r2, [r3, #12] + 8007b3a: e00f b.n 8007b5c + LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_active_pcbs", tcp_active_pcbs == pcb); + 8007b3c: 4b46 ldr r3, [pc, #280] @ (8007c58 ) + 8007b3e: 681b ldr r3, [r3, #0] + 8007b40: 6afa ldr r2, [r7, #44] @ 0x2c + 8007b42: 429a cmp r2, r3 + 8007b44: d006 beq.n 8007b54 + 8007b46: 4b45 ldr r3, [pc, #276] @ (8007c5c ) + 8007b48: f240 5271 movw r2, #1393 @ 0x571 + 8007b4c: 4946 ldr r1, [pc, #280] @ (8007c68 ) + 8007b4e: 4845 ldr r0, [pc, #276] @ (8007c64 ) + 8007b50: f009 fd52 bl 80115f8 + tcp_active_pcbs = pcb->next; + 8007b54: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b56: 68db ldr r3, [r3, #12] + 8007b58: 4a3f ldr r2, [pc, #252] @ (8007c58 ) + 8007b5a: 6013 str r3, [r2, #0] + if (pcb_reset) { + 8007b5c: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 8007b60: 2b00 cmp r3, #0 + 8007b62: d013 beq.n 8007b8c + tcp_rst(pcb, pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip, + 8007b64: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b66: 6d18 ldr r0, [r3, #80] @ 0x50 + 8007b68: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b6a: 6a5c ldr r4, [r3, #36] @ 0x24 + 8007b6c: 6afd ldr r5, [r7, #44] @ 0x2c + 8007b6e: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b70: 3304 adds r3, #4 + 8007b72: 6afa ldr r2, [r7, #44] @ 0x2c + 8007b74: 8ad2 ldrh r2, [r2, #22] + 8007b76: 6af9 ldr r1, [r7, #44] @ 0x2c + 8007b78: 8b09 ldrh r1, [r1, #24] + 8007b7a: 9102 str r1, [sp, #8] + 8007b7c: 9201 str r2, [sp, #4] + 8007b7e: 9300 str r3, [sp, #0] + 8007b80: 462b mov r3, r5 + 8007b82: 4622 mov r2, r4 + 8007b84: 4601 mov r1, r0 + 8007b86: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007b88: f004 f982 bl 800be90 + err_arg = pcb->callback_arg; + 8007b8c: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b8e: 691b ldr r3, [r3, #16] + 8007b90: 60bb str r3, [r7, #8] + last_state = pcb->state; + 8007b92: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b94: 7d1b ldrb r3, [r3, #20] + 8007b96: 71fb strb r3, [r7, #7] + pcb2 = pcb; + 8007b98: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b9a: 603b str r3, [r7, #0] + pcb = pcb->next; + 8007b9c: 6afb ldr r3, [r7, #44] @ 0x2c + 8007b9e: 68db ldr r3, [r3, #12] + 8007ba0: 62fb str r3, [r7, #44] @ 0x2c + tcp_free(pcb2); + 8007ba2: 6838 ldr r0, [r7, #0] + 8007ba4: f7ff f9f0 bl 8006f88 + tcp_active_pcbs_changed = 0; + 8007ba8: 4b30 ldr r3, [pc, #192] @ (8007c6c ) + 8007baa: 2200 movs r2, #0 + 8007bac: 701a strb r2, [r3, #0] + TCP_EVENT_ERR(last_state, err_fn, err_arg, ERR_ABRT); + 8007bae: 68fb ldr r3, [r7, #12] + 8007bb0: 2b00 cmp r3, #0 + 8007bb2: d004 beq.n 8007bbe + 8007bb4: 68fb ldr r3, [r7, #12] + 8007bb6: f06f 010c mvn.w r1, #12 + 8007bba: 68b8 ldr r0, [r7, #8] + 8007bbc: 4798 blx r3 + if (tcp_active_pcbs_changed) { + 8007bbe: 4b2b ldr r3, [pc, #172] @ (8007c6c ) + 8007bc0: 781b ldrb r3, [r3, #0] + 8007bc2: 2b00 cmp r3, #0 + 8007bc4: d037 beq.n 8007c36 + goto tcp_slowtmr_start; + 8007bc6: e590 b.n 80076ea + prev = pcb; + 8007bc8: 6afb ldr r3, [r7, #44] @ 0x2c + 8007bca: 62bb str r3, [r7, #40] @ 0x28 + pcb = pcb->next; + 8007bcc: 6afb ldr r3, [r7, #44] @ 0x2c + 8007bce: 68db ldr r3, [r3, #12] + 8007bd0: 62fb str r3, [r7, #44] @ 0x2c + ++prev->polltmr; + 8007bd2: 6abb ldr r3, [r7, #40] @ 0x28 + 8007bd4: 7f1b ldrb r3, [r3, #28] + 8007bd6: 3301 adds r3, #1 + 8007bd8: b2da uxtb r2, r3 + 8007bda: 6abb ldr r3, [r7, #40] @ 0x28 + 8007bdc: 771a strb r2, [r3, #28] + if (prev->polltmr >= prev->pollinterval) { + 8007bde: 6abb ldr r3, [r7, #40] @ 0x28 + 8007be0: 7f1a ldrb r2, [r3, #28] + 8007be2: 6abb ldr r3, [r7, #40] @ 0x28 + 8007be4: 7f5b ldrb r3, [r3, #29] + 8007be6: 429a cmp r2, r3 + 8007be8: d325 bcc.n 8007c36 + prev->polltmr = 0; + 8007bea: 6abb ldr r3, [r7, #40] @ 0x28 + 8007bec: 2200 movs r2, #0 + 8007bee: 771a strb r2, [r3, #28] + tcp_active_pcbs_changed = 0; + 8007bf0: 4b1e ldr r3, [pc, #120] @ (8007c6c ) + 8007bf2: 2200 movs r2, #0 + 8007bf4: 701a strb r2, [r3, #0] + TCP_EVENT_POLL(prev, err); + 8007bf6: 6abb ldr r3, [r7, #40] @ 0x28 + 8007bf8: f8d3 308c ldr.w r3, [r3, #140] @ 0x8c + 8007bfc: 2b00 cmp r3, #0 + 8007bfe: d00b beq.n 8007c18 + 8007c00: 6abb ldr r3, [r7, #40] @ 0x28 + 8007c02: f8d3 308c ldr.w r3, [r3, #140] @ 0x8c + 8007c06: 6aba ldr r2, [r7, #40] @ 0x28 + 8007c08: 6912 ldr r2, [r2, #16] + 8007c0a: 6ab9 ldr r1, [r7, #40] @ 0x28 + 8007c0c: 4610 mov r0, r2 + 8007c0e: 4798 blx r3 + 8007c10: 4603 mov r3, r0 + 8007c12: f887 3025 strb.w r3, [r7, #37] @ 0x25 + 8007c16: e002 b.n 8007c1e + 8007c18: 2300 movs r3, #0 + 8007c1a: f887 3025 strb.w r3, [r7, #37] @ 0x25 + if (tcp_active_pcbs_changed) { + 8007c1e: 4b13 ldr r3, [pc, #76] @ (8007c6c ) + 8007c20: 781b ldrb r3, [r3, #0] + 8007c22: 2b00 cmp r3, #0 + 8007c24: f47f ad60 bne.w 80076e8 + } + /* if err == ERR_ABRT, 'prev' is already deallocated */ + if (err == ERR_OK) { + 8007c28: f997 3025 ldrsb.w r3, [r7, #37] @ 0x25 + 8007c2c: 2b00 cmp r3, #0 + 8007c2e: d102 bne.n 8007c36 + tcp_output(prev); + 8007c30: 6ab8 ldr r0, [r7, #40] @ 0x28 + 8007c32: f003 fb79 bl 800b328 + while (pcb != NULL) { + 8007c36: 6afb ldr r3, [r7, #44] @ 0x2c + 8007c38: 2b00 cmp r3, #0 + 8007c3a: f47f ad5c bne.w 80076f6 + } + } + + + /* Steps through all of the TIME-WAIT PCBs. */ + prev = NULL; + 8007c3e: 2300 movs r3, #0 + 8007c40: 62bb str r3, [r7, #40] @ 0x28 + pcb = tcp_tw_pcbs; + 8007c42: 4b0b ldr r3, [pc, #44] @ (8007c70 ) + 8007c44: 681b ldr r3, [r3, #0] + 8007c46: 62fb str r3, [r7, #44] @ 0x2c + while (pcb != NULL) { + 8007c48: e067 b.n 8007d1a + 8007c4a: bf00 nop + 8007c4c: 200190a4 .word 0x200190a4 + 8007c50: 10624dd3 .word 0x10624dd3 + 8007c54: 000124f8 .word 0x000124f8 + 8007c58: 200190b0 .word 0x200190b0 + 8007c5c: 08016ab4 .word 0x08016ab4 + 8007c60: 08016eec .word 0x08016eec + 8007c64: 08016af8 .word 0x08016af8 + 8007c68: 08016f18 .word 0x08016f18 + 8007c6c: 200190b8 .word 0x200190b8 + 8007c70: 200190b4 .word 0x200190b4 + LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); + 8007c74: 6afb ldr r3, [r7, #44] @ 0x2c + 8007c76: 7d1b ldrb r3, [r3, #20] + 8007c78: 2b0a cmp r3, #10 + 8007c7a: d006 beq.n 8007c8a + 8007c7c: 4b2b ldr r3, [pc, #172] @ (8007d2c ) + 8007c7e: f240 52a1 movw r2, #1441 @ 0x5a1 + 8007c82: 492b ldr r1, [pc, #172] @ (8007d30 ) + 8007c84: 482b ldr r0, [pc, #172] @ (8007d34 ) + 8007c86: f009 fcb7 bl 80115f8 + pcb_remove = 0; + 8007c8a: 2300 movs r3, #0 + 8007c8c: f887 3027 strb.w r3, [r7, #39] @ 0x27 + + /* Check if this PCB has stayed long enough in TIME-WAIT */ + if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { + 8007c90: 4b29 ldr r3, [pc, #164] @ (8007d38 ) + 8007c92: 681a ldr r2, [r3, #0] + 8007c94: 6afb ldr r3, [r7, #44] @ 0x2c + 8007c96: 6a1b ldr r3, [r3, #32] + 8007c98: 1ad3 subs r3, r2, r3 + 8007c9a: 2bf0 cmp r3, #240 @ 0xf0 + 8007c9c: d904 bls.n 8007ca8 + ++pcb_remove; + 8007c9e: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007ca2: 3301 adds r3, #1 + 8007ca4: f887 3027 strb.w r3, [r7, #39] @ 0x27 + } + + /* If the PCB should be removed, do it. */ + if (pcb_remove) { + 8007ca8: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 8007cac: 2b00 cmp r3, #0 + 8007cae: d02f beq.n 8007d10 + struct tcp_pcb *pcb2; + tcp_pcb_purge(pcb); + 8007cb0: 6af8 ldr r0, [r7, #44] @ 0x2c + 8007cb2: f000 fb2b bl 800830c + /* Remove PCB from tcp_tw_pcbs list. */ + if (prev != NULL) { + 8007cb6: 6abb ldr r3, [r7, #40] @ 0x28 + 8007cb8: 2b00 cmp r3, #0 + 8007cba: d010 beq.n 8007cde + LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs); + 8007cbc: 4b1f ldr r3, [pc, #124] @ (8007d3c ) + 8007cbe: 681b ldr r3, [r3, #0] + 8007cc0: 6afa ldr r2, [r7, #44] @ 0x2c + 8007cc2: 429a cmp r2, r3 + 8007cc4: d106 bne.n 8007cd4 + 8007cc6: 4b19 ldr r3, [pc, #100] @ (8007d2c ) + 8007cc8: f240 52af movw r2, #1455 @ 0x5af + 8007ccc: 491c ldr r1, [pc, #112] @ (8007d40 ) + 8007cce: 4819 ldr r0, [pc, #100] @ (8007d34 ) + 8007cd0: f009 fc92 bl 80115f8 + prev->next = pcb->next; + 8007cd4: 6afb ldr r3, [r7, #44] @ 0x2c + 8007cd6: 68da ldr r2, [r3, #12] + 8007cd8: 6abb ldr r3, [r7, #40] @ 0x28 + 8007cda: 60da str r2, [r3, #12] + 8007cdc: e00f b.n 8007cfe + } else { + /* This PCB was the first. */ + LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb); + 8007cde: 4b17 ldr r3, [pc, #92] @ (8007d3c ) + 8007ce0: 681b ldr r3, [r3, #0] + 8007ce2: 6afa ldr r2, [r7, #44] @ 0x2c + 8007ce4: 429a cmp r2, r3 + 8007ce6: d006 beq.n 8007cf6 + 8007ce8: 4b10 ldr r3, [pc, #64] @ (8007d2c ) + 8007cea: f240 52b3 movw r2, #1459 @ 0x5b3 + 8007cee: 4915 ldr r1, [pc, #84] @ (8007d44 ) + 8007cf0: 4810 ldr r0, [pc, #64] @ (8007d34 ) + 8007cf2: f009 fc81 bl 80115f8 + tcp_tw_pcbs = pcb->next; + 8007cf6: 6afb ldr r3, [r7, #44] @ 0x2c + 8007cf8: 68db ldr r3, [r3, #12] + 8007cfa: 4a10 ldr r2, [pc, #64] @ (8007d3c ) + 8007cfc: 6013 str r3, [r2, #0] + } + pcb2 = pcb; + 8007cfe: 6afb ldr r3, [r7, #44] @ 0x2c + 8007d00: 61fb str r3, [r7, #28] + pcb = pcb->next; + 8007d02: 6afb ldr r3, [r7, #44] @ 0x2c + 8007d04: 68db ldr r3, [r3, #12] + 8007d06: 62fb str r3, [r7, #44] @ 0x2c + tcp_free(pcb2); + 8007d08: 69f8 ldr r0, [r7, #28] + 8007d0a: f7ff f93d bl 8006f88 + 8007d0e: e004 b.n 8007d1a + } else { + prev = pcb; + 8007d10: 6afb ldr r3, [r7, #44] @ 0x2c + 8007d12: 62bb str r3, [r7, #40] @ 0x28 + pcb = pcb->next; + 8007d14: 6afb ldr r3, [r7, #44] @ 0x2c + 8007d16: 68db ldr r3, [r3, #12] + 8007d18: 62fb str r3, [r7, #44] @ 0x2c + while (pcb != NULL) { + 8007d1a: 6afb ldr r3, [r7, #44] @ 0x2c + 8007d1c: 2b00 cmp r3, #0 + 8007d1e: d1a9 bne.n 8007c74 + } + } +} + 8007d20: bf00 nop + 8007d22: bf00 nop + 8007d24: 3730 adds r7, #48 @ 0x30 + 8007d26: 46bd mov sp, r7 + 8007d28: bdb0 pop {r4, r5, r7, pc} + 8007d2a: bf00 nop + 8007d2c: 08016ab4 .word 0x08016ab4 + 8007d30: 08016f44 .word 0x08016f44 + 8007d34: 08016af8 .word 0x08016af8 + 8007d38: 200190a4 .word 0x200190a4 + 8007d3c: 200190b4 .word 0x200190b4 + 8007d40: 08016f74 .word 0x08016f74 + 8007d44: 08016f9c .word 0x08016f9c + +08007d48 : + * + * Automatically called from tcp_tmr(). + */ +void +tcp_fasttmr(void) +{ + 8007d48: b580 push {r7, lr} + 8007d4a: b082 sub sp, #8 + 8007d4c: af00 add r7, sp, #0 + struct tcp_pcb *pcb; + + ++tcp_timer_ctr; + 8007d4e: 4b2d ldr r3, [pc, #180] @ (8007e04 ) + 8007d50: 781b ldrb r3, [r3, #0] + 8007d52: 3301 adds r3, #1 + 8007d54: b2da uxtb r2, r3 + 8007d56: 4b2b ldr r3, [pc, #172] @ (8007e04 ) + 8007d58: 701a strb r2, [r3, #0] + +tcp_fasttmr_start: + pcb = tcp_active_pcbs; + 8007d5a: 4b2b ldr r3, [pc, #172] @ (8007e08 ) + 8007d5c: 681b ldr r3, [r3, #0] + 8007d5e: 607b str r3, [r7, #4] + + while (pcb != NULL) { + 8007d60: e048 b.n 8007df4 + if (pcb->last_timer != tcp_timer_ctr) { + 8007d62: 687b ldr r3, [r7, #4] + 8007d64: 7f9a ldrb r2, [r3, #30] + 8007d66: 4b27 ldr r3, [pc, #156] @ (8007e04 ) + 8007d68: 781b ldrb r3, [r3, #0] + 8007d6a: 429a cmp r2, r3 + 8007d6c: d03f beq.n 8007dee + struct tcp_pcb *next; + pcb->last_timer = tcp_timer_ctr; + 8007d6e: 4b25 ldr r3, [pc, #148] @ (8007e04 ) + 8007d70: 781a ldrb r2, [r3, #0] + 8007d72: 687b ldr r3, [r7, #4] + 8007d74: 779a strb r2, [r3, #30] + /* send delayed ACKs */ + if (pcb->flags & TF_ACK_DELAY) { + 8007d76: 687b ldr r3, [r7, #4] + 8007d78: 8b5b ldrh r3, [r3, #26] + 8007d7a: f003 0301 and.w r3, r3, #1 + 8007d7e: 2b00 cmp r3, #0 + 8007d80: d010 beq.n 8007da4 + LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n")); + tcp_ack_now(pcb); + 8007d82: 687b ldr r3, [r7, #4] + 8007d84: 8b5b ldrh r3, [r3, #26] + 8007d86: f043 0302 orr.w r3, r3, #2 + 8007d8a: b29a uxth r2, r3 + 8007d8c: 687b ldr r3, [r7, #4] + 8007d8e: 835a strh r2, [r3, #26] + tcp_output(pcb); + 8007d90: 6878 ldr r0, [r7, #4] + 8007d92: f003 fac9 bl 800b328 + tcp_clear_flags(pcb, TF_ACK_DELAY | TF_ACK_NOW); + 8007d96: 687b ldr r3, [r7, #4] + 8007d98: 8b5b ldrh r3, [r3, #26] + 8007d9a: f023 0303 bic.w r3, r3, #3 + 8007d9e: b29a uxth r2, r3 + 8007da0: 687b ldr r3, [r7, #4] + 8007da2: 835a strh r2, [r3, #26] + } + /* send pending FIN */ + if (pcb->flags & TF_CLOSEPEND) { + 8007da4: 687b ldr r3, [r7, #4] + 8007da6: 8b5b ldrh r3, [r3, #26] + 8007da8: f003 0308 and.w r3, r3, #8 + 8007dac: 2b00 cmp r3, #0 + 8007dae: d009 beq.n 8007dc4 + LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: pending FIN\n")); + tcp_clear_flags(pcb, TF_CLOSEPEND); + 8007db0: 687b ldr r3, [r7, #4] + 8007db2: 8b5b ldrh r3, [r3, #26] + 8007db4: f023 0308 bic.w r3, r3, #8 + 8007db8: b29a uxth r2, r3 + 8007dba: 687b ldr r3, [r7, #4] + 8007dbc: 835a strh r2, [r3, #26] + tcp_close_shutdown_fin(pcb); + 8007dbe: 6878 ldr r0, [r7, #4] + 8007dc0: f7ff fa76 bl 80072b0 + } + + next = pcb->next; + 8007dc4: 687b ldr r3, [r7, #4] + 8007dc6: 68db ldr r3, [r3, #12] + 8007dc8: 603b str r3, [r7, #0] + + /* If there is data which was previously "refused" by upper layer */ + if (pcb->refused_data != NULL) { + 8007dca: 687b ldr r3, [r7, #4] + 8007dcc: 6f9b ldr r3, [r3, #120] @ 0x78 + 8007dce: 2b00 cmp r3, #0 + 8007dd0: d00a beq.n 8007de8 + tcp_active_pcbs_changed = 0; + 8007dd2: 4b0e ldr r3, [pc, #56] @ (8007e0c ) + 8007dd4: 2200 movs r2, #0 + 8007dd6: 701a strb r2, [r3, #0] + tcp_process_refused_data(pcb); + 8007dd8: 6878 ldr r0, [r7, #4] + 8007dda: f000 f819 bl 8007e10 + if (tcp_active_pcbs_changed) { + 8007dde: 4b0b ldr r3, [pc, #44] @ (8007e0c ) + 8007de0: 781b ldrb r3, [r3, #0] + 8007de2: 2b00 cmp r3, #0 + 8007de4: d000 beq.n 8007de8 + /* application callback has changed the pcb list: restart the loop */ + goto tcp_fasttmr_start; + 8007de6: e7b8 b.n 8007d5a + } + } + pcb = next; + 8007de8: 683b ldr r3, [r7, #0] + 8007dea: 607b str r3, [r7, #4] + 8007dec: e002 b.n 8007df4 + } else { + pcb = pcb->next; + 8007dee: 687b ldr r3, [r7, #4] + 8007df0: 68db ldr r3, [r3, #12] + 8007df2: 607b str r3, [r7, #4] + while (pcb != NULL) { + 8007df4: 687b ldr r3, [r7, #4] + 8007df6: 2b00 cmp r3, #0 + 8007df8: d1b3 bne.n 8007d62 + } + } +} + 8007dfa: bf00 nop + 8007dfc: bf00 nop + 8007dfe: 3708 adds r7, #8 + 8007e00: 46bd mov sp, r7 + 8007e02: bd80 pop {r7, pc} + 8007e04: 200190ba .word 0x200190ba + 8007e08: 200190b0 .word 0x200190b0 + 8007e0c: 200190b8 .word 0x200190b8 + +08007e10 : +} + +/** Pass pcb->refused_data to the recv callback */ +err_t +tcp_process_refused_data(struct tcp_pcb *pcb) +{ + 8007e10: b590 push {r4, r7, lr} + 8007e12: b085 sub sp, #20 + 8007e14: af00 add r7, sp, #0 + 8007e16: 6078 str r0, [r7, #4] +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + struct pbuf *rest; +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + + LWIP_ERROR("tcp_process_refused_data: invalid pcb", pcb != NULL, return ERR_ARG); + 8007e18: 687b ldr r3, [r7, #4] + 8007e1a: 2b00 cmp r3, #0 + 8007e1c: d109 bne.n 8007e32 + 8007e1e: 4b37 ldr r3, [pc, #220] @ (8007efc ) + 8007e20: f240 6209 movw r2, #1545 @ 0x609 + 8007e24: 4936 ldr r1, [pc, #216] @ (8007f00 ) + 8007e26: 4837 ldr r0, [pc, #220] @ (8007f04 ) + 8007e28: f009 fbe6 bl 80115f8 + 8007e2c: f06f 030f mvn.w r3, #15 + 8007e30: e060 b.n 8007ef4 +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + while (pcb->refused_data != NULL) +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + { + err_t err; + u8_t refused_flags = pcb->refused_data->flags; + 8007e32: 687b ldr r3, [r7, #4] + 8007e34: 6f9b ldr r3, [r3, #120] @ 0x78 + 8007e36: 7b5b ldrb r3, [r3, #13] + 8007e38: 73bb strb r3, [r7, #14] + /* set pcb->refused_data to NULL in case the callback frees it and then + closes the pcb */ + struct pbuf *refused_data = pcb->refused_data; + 8007e3a: 687b ldr r3, [r7, #4] + 8007e3c: 6f9b ldr r3, [r3, #120] @ 0x78 + 8007e3e: 60bb str r3, [r7, #8] +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + pbuf_split_64k(refused_data, &rest); + pcb->refused_data = rest; +#else /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + pcb->refused_data = NULL; + 8007e40: 687b ldr r3, [r7, #4] + 8007e42: 2200 movs r2, #0 + 8007e44: 679a str r2, [r3, #120] @ 0x78 +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + /* Notify again application with data previously received. */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n")); + TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err); + 8007e46: 687b ldr r3, [r7, #4] + 8007e48: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8007e4c: 2b00 cmp r3, #0 + 8007e4e: d00b beq.n 8007e68 + 8007e50: 687b ldr r3, [r7, #4] + 8007e52: f8d3 4084 ldr.w r4, [r3, #132] @ 0x84 + 8007e56: 687b ldr r3, [r7, #4] + 8007e58: 6918 ldr r0, [r3, #16] + 8007e5a: 2300 movs r3, #0 + 8007e5c: 68ba ldr r2, [r7, #8] + 8007e5e: 6879 ldr r1, [r7, #4] + 8007e60: 47a0 blx r4 + 8007e62: 4603 mov r3, r0 + 8007e64: 73fb strb r3, [r7, #15] + 8007e66: e007 b.n 8007e78 + 8007e68: 2300 movs r3, #0 + 8007e6a: 68ba ldr r2, [r7, #8] + 8007e6c: 6879 ldr r1, [r7, #4] + 8007e6e: 2000 movs r0, #0 + 8007e70: f000 f8a4 bl 8007fbc + 8007e74: 4603 mov r3, r0 + 8007e76: 73fb strb r3, [r7, #15] + if (err == ERR_OK) { + 8007e78: f997 300f ldrsb.w r3, [r7, #15] + 8007e7c: 2b00 cmp r3, #0 + 8007e7e: d12a bne.n 8007ed6 + /* did refused_data include a FIN? */ + if ((refused_flags & PBUF_FLAG_TCP_FIN) + 8007e80: 7bbb ldrb r3, [r7, #14] + 8007e82: f003 0320 and.w r3, r3, #32 + 8007e86: 2b00 cmp r3, #0 + 8007e88: d033 beq.n 8007ef2 + && (rest == NULL) +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + ) { + /* correct rcv_wnd as the application won't call tcp_recved() + for the FIN's seqno */ + if (pcb->rcv_wnd != TCP_WND_MAX(pcb)) { + 8007e8a: 687b ldr r3, [r7, #4] + 8007e8c: 8d1b ldrh r3, [r3, #40] @ 0x28 + 8007e8e: f5b3 6f06 cmp.w r3, #2144 @ 0x860 + 8007e92: d005 beq.n 8007ea0 + pcb->rcv_wnd++; + 8007e94: 687b ldr r3, [r7, #4] + 8007e96: 8d1b ldrh r3, [r3, #40] @ 0x28 + 8007e98: 3301 adds r3, #1 + 8007e9a: b29a uxth r2, r3 + 8007e9c: 687b ldr r3, [r7, #4] + 8007e9e: 851a strh r2, [r3, #40] @ 0x28 + } + TCP_EVENT_CLOSED(pcb, err); + 8007ea0: 687b ldr r3, [r7, #4] + 8007ea2: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8007ea6: 2b00 cmp r3, #0 + 8007ea8: d00b beq.n 8007ec2 + 8007eaa: 687b ldr r3, [r7, #4] + 8007eac: f8d3 4084 ldr.w r4, [r3, #132] @ 0x84 + 8007eb0: 687b ldr r3, [r7, #4] + 8007eb2: 6918 ldr r0, [r3, #16] + 8007eb4: 2300 movs r3, #0 + 8007eb6: 2200 movs r2, #0 + 8007eb8: 6879 ldr r1, [r7, #4] + 8007eba: 47a0 blx r4 + 8007ebc: 4603 mov r3, r0 + 8007ebe: 73fb strb r3, [r7, #15] + 8007ec0: e001 b.n 8007ec6 + 8007ec2: 2300 movs r3, #0 + 8007ec4: 73fb strb r3, [r7, #15] + if (err == ERR_ABRT) { + 8007ec6: f997 300f ldrsb.w r3, [r7, #15] + 8007eca: f113 0f0d cmn.w r3, #13 + 8007ece: d110 bne.n 8007ef2 + return ERR_ABRT; + 8007ed0: f06f 030c mvn.w r3, #12 + 8007ed4: e00e b.n 8007ef4 + } + } + } else if (err == ERR_ABRT) { + 8007ed6: f997 300f ldrsb.w r3, [r7, #15] + 8007eda: f113 0f0d cmn.w r3, #13 + 8007ede: d102 bne.n 8007ee6 + /* if err == ERR_ABRT, 'pcb' is already deallocated */ + /* Drop incoming packets because pcb is "full" (only if the incoming + segment contains data). */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: drop incoming packets, because pcb is \"full\"\n")); + return ERR_ABRT; + 8007ee0: f06f 030c mvn.w r3, #12 + 8007ee4: e006 b.n 8007ef4 +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_cat(refused_data, rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + pcb->refused_data = refused_data; + 8007ee6: 687b ldr r3, [r7, #4] + 8007ee8: 68ba ldr r2, [r7, #8] + 8007eea: 679a str r2, [r3, #120] @ 0x78 + return ERR_INPROGRESS; + 8007eec: f06f 0304 mvn.w r3, #4 + 8007ef0: e000 b.n 8007ef4 + } + } + return ERR_OK; + 8007ef2: 2300 movs r3, #0 +} + 8007ef4: 4618 mov r0, r3 + 8007ef6: 3714 adds r7, #20 + 8007ef8: 46bd mov sp, r7 + 8007efa: bd90 pop {r4, r7, pc} + 8007efc: 08016ab4 .word 0x08016ab4 + 8007f00: 08016fc4 .word 0x08016fc4 + 8007f04: 08016af8 .word 0x08016af8 + +08007f08 : + * + * @param seg tcp_seg list of TCP segments to free + */ +void +tcp_segs_free(struct tcp_seg *seg) +{ + 8007f08: b580 push {r7, lr} + 8007f0a: b084 sub sp, #16 + 8007f0c: af00 add r7, sp, #0 + 8007f0e: 6078 str r0, [r7, #4] + while (seg != NULL) { + 8007f10: e007 b.n 8007f22 + struct tcp_seg *next = seg->next; + 8007f12: 687b ldr r3, [r7, #4] + 8007f14: 681b ldr r3, [r3, #0] + 8007f16: 60fb str r3, [r7, #12] + tcp_seg_free(seg); + 8007f18: 6878 ldr r0, [r7, #4] + 8007f1a: f000 f80a bl 8007f32 + seg = next; + 8007f1e: 68fb ldr r3, [r7, #12] + 8007f20: 607b str r3, [r7, #4] + while (seg != NULL) { + 8007f22: 687b ldr r3, [r7, #4] + 8007f24: 2b00 cmp r3, #0 + 8007f26: d1f4 bne.n 8007f12 + } +} + 8007f28: bf00 nop + 8007f2a: bf00 nop + 8007f2c: 3710 adds r7, #16 + 8007f2e: 46bd mov sp, r7 + 8007f30: bd80 pop {r7, pc} + +08007f32 : + * + * @param seg single tcp_seg to free + */ +void +tcp_seg_free(struct tcp_seg *seg) +{ + 8007f32: b580 push {r7, lr} + 8007f34: b082 sub sp, #8 + 8007f36: af00 add r7, sp, #0 + 8007f38: 6078 str r0, [r7, #4] + if (seg != NULL) { + 8007f3a: 687b ldr r3, [r7, #4] + 8007f3c: 2b00 cmp r3, #0 + 8007f3e: d00c beq.n 8007f5a + if (seg->p != NULL) { + 8007f40: 687b ldr r3, [r7, #4] + 8007f42: 685b ldr r3, [r3, #4] + 8007f44: 2b00 cmp r3, #0 + 8007f46: d004 beq.n 8007f52 + pbuf_free(seg->p); + 8007f48: 687b ldr r3, [r7, #4] + 8007f4a: 685b ldr r3, [r3, #4] + 8007f4c: 4618 mov r0, r3 + 8007f4e: f7fe fd6b bl 8006a28 +#if TCP_DEBUG + seg->p = NULL; +#endif /* TCP_DEBUG */ + } + memp_free(MEMP_TCP_SEG, seg); + 8007f52: 6879 ldr r1, [r7, #4] + 8007f54: 2003 movs r0, #3 + 8007f56: f7fd fee7 bl 8005d28 + } +} + 8007f5a: bf00 nop + 8007f5c: 3708 adds r7, #8 + 8007f5e: 46bd mov sp, r7 + 8007f60: bd80 pop {r7, pc} + ... + +08007f64 : + * @param seg the old tcp_seg + * @return a copy of seg + */ +struct tcp_seg * +tcp_seg_copy(struct tcp_seg *seg) +{ + 8007f64: b580 push {r7, lr} + 8007f66: b084 sub sp, #16 + 8007f68: af00 add r7, sp, #0 + 8007f6a: 6078 str r0, [r7, #4] + struct tcp_seg *cseg; + + LWIP_ASSERT("tcp_seg_copy: invalid seg", seg != NULL); + 8007f6c: 687b ldr r3, [r7, #4] + 8007f6e: 2b00 cmp r3, #0 + 8007f70: d106 bne.n 8007f80 + 8007f72: 4b0f ldr r3, [pc, #60] @ (8007fb0 ) + 8007f74: f240 6282 movw r2, #1666 @ 0x682 + 8007f78: 490e ldr r1, [pc, #56] @ (8007fb4 ) + 8007f7a: 480f ldr r0, [pc, #60] @ (8007fb8 ) + 8007f7c: f009 fb3c bl 80115f8 + + cseg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG); + 8007f80: 2003 movs r0, #3 + 8007f82: f7fd fe61 bl 8005c48 + 8007f86: 60f8 str r0, [r7, #12] + if (cseg == NULL) { + 8007f88: 68fb ldr r3, [r7, #12] + 8007f8a: 2b00 cmp r3, #0 + 8007f8c: d101 bne.n 8007f92 + return NULL; + 8007f8e: 2300 movs r3, #0 + 8007f90: e00a b.n 8007fa8 + } + SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); + 8007f92: 2210 movs r2, #16 + 8007f94: 6879 ldr r1, [r7, #4] + 8007f96: 68f8 ldr r0, [r7, #12] + 8007f98: f009 fc2a bl 80117f0 + pbuf_ref(cseg->p); + 8007f9c: 68fb ldr r3, [r7, #12] + 8007f9e: 685b ldr r3, [r3, #4] + 8007fa0: 4618 mov r0, r3 + 8007fa2: f7fe fde1 bl 8006b68 + return cseg; + 8007fa6: 68fb ldr r3, [r7, #12] +} + 8007fa8: 4618 mov r0, r3 + 8007faa: 3710 adds r7, #16 + 8007fac: 46bd mov sp, r7 + 8007fae: bd80 pop {r7, pc} + 8007fb0: 08016ab4 .word 0x08016ab4 + 8007fb4: 08017008 .word 0x08017008 + 8007fb8: 08016af8 .word 0x08016af8 + +08007fbc : + * Default receive callback that is called if the user didn't register + * a recv callback for the pcb. + */ +err_t +tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) +{ + 8007fbc: b580 push {r7, lr} + 8007fbe: b084 sub sp, #16 + 8007fc0: af00 add r7, sp, #0 + 8007fc2: 60f8 str r0, [r7, #12] + 8007fc4: 60b9 str r1, [r7, #8] + 8007fc6: 607a str r2, [r7, #4] + 8007fc8: 70fb strb r3, [r7, #3] + LWIP_UNUSED_ARG(arg); + + LWIP_ERROR("tcp_recv_null: invalid pcb", pcb != NULL, return ERR_ARG); + 8007fca: 68bb ldr r3, [r7, #8] + 8007fcc: 2b00 cmp r3, #0 + 8007fce: d109 bne.n 8007fe4 + 8007fd0: 4b12 ldr r3, [pc, #72] @ (800801c ) + 8007fd2: f44f 62d3 mov.w r2, #1688 @ 0x698 + 8007fd6: 4912 ldr r1, [pc, #72] @ (8008020 ) + 8007fd8: 4812 ldr r0, [pc, #72] @ (8008024 ) + 8007fda: f009 fb0d bl 80115f8 + 8007fde: f06f 030f mvn.w r3, #15 + 8007fe2: e016 b.n 8008012 + + if (p != NULL) { + 8007fe4: 687b ldr r3, [r7, #4] + 8007fe6: 2b00 cmp r3, #0 + 8007fe8: d009 beq.n 8007ffe + tcp_recved(pcb, p->tot_len); + 8007fea: 687b ldr r3, [r7, #4] + 8007fec: 891b ldrh r3, [r3, #8] + 8007fee: 4619 mov r1, r3 + 8007ff0: 68b8 ldr r0, [r7, #8] + 8007ff2: f7ff fb17 bl 8007624 + pbuf_free(p); + 8007ff6: 6878 ldr r0, [r7, #4] + 8007ff8: f7fe fd16 bl 8006a28 + 8007ffc: e008 b.n 8008010 + } else if (err == ERR_OK) { + 8007ffe: f997 3003 ldrsb.w r3, [r7, #3] + 8008002: 2b00 cmp r3, #0 + 8008004: d104 bne.n 8008010 + return tcp_close(pcb); + 8008006: 68b8 ldr r0, [r7, #8] + 8008008: f7ff f9bc bl 8007384 + 800800c: 4603 mov r3, r0 + 800800e: e000 b.n 8008012 + } + return ERR_OK; + 8008010: 2300 movs r3, #0 +} + 8008012: 4618 mov r0, r3 + 8008014: 3710 adds r7, #16 + 8008016: 46bd mov sp, r7 + 8008018: bd80 pop {r7, pc} + 800801a: bf00 nop + 800801c: 08016ab4 .word 0x08016ab4 + 8008020: 08017024 .word 0x08017024 + 8008024: 08016af8 .word 0x08016af8 + +08008028 : + * + * @param prio minimum priority + */ +static void +tcp_kill_prio(u8_t prio) +{ + 8008028: b580 push {r7, lr} + 800802a: b086 sub sp, #24 + 800802c: af00 add r7, sp, #0 + 800802e: 4603 mov r3, r0 + 8008030: 71fb strb r3, [r7, #7] + struct tcp_pcb *pcb, *inactive; + u32_t inactivity; + u8_t mprio; + + mprio = LWIP_MIN(TCP_PRIO_MAX, prio); + 8008032: f997 3007 ldrsb.w r3, [r7, #7] + 8008036: 2b00 cmp r3, #0 + 8008038: db01 blt.n 800803e + 800803a: 79fb ldrb r3, [r7, #7] + 800803c: e000 b.n 8008040 + 800803e: 237f movs r3, #127 @ 0x7f + 8008040: 72fb strb r3, [r7, #11] + + /* We want to kill connections with a lower prio, so bail out if + * supplied prio is 0 - there can never be a lower prio + */ + if (mprio == 0) { + 8008042: 7afb ldrb r3, [r7, #11] + 8008044: 2b00 cmp r3, #0 + 8008046: d034 beq.n 80080b2 + /* We only want kill connections with a lower prio, so decrement prio by one + * and start searching for oldest connection with same or lower priority than mprio. + * We want to find the connections with the lowest possible prio, and among + * these the one with the longest inactivity time. + */ + mprio--; + 8008048: 7afb ldrb r3, [r7, #11] + 800804a: 3b01 subs r3, #1 + 800804c: 72fb strb r3, [r7, #11] + + inactivity = 0; + 800804e: 2300 movs r3, #0 + 8008050: 60fb str r3, [r7, #12] + inactive = NULL; + 8008052: 2300 movs r3, #0 + 8008054: 613b str r3, [r7, #16] + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + 8008056: 4b19 ldr r3, [pc, #100] @ (80080bc ) + 8008058: 681b ldr r3, [r3, #0] + 800805a: 617b str r3, [r7, #20] + 800805c: e01f b.n 800809e + /* lower prio is always a kill candidate */ + if ((pcb->prio < mprio) || + 800805e: 697b ldr r3, [r7, #20] + 8008060: 7d5b ldrb r3, [r3, #21] + 8008062: 7afa ldrb r2, [r7, #11] + 8008064: 429a cmp r2, r3 + 8008066: d80c bhi.n 8008082 + /* longer inactivity is also a kill candidate */ + ((pcb->prio == mprio) && ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity))) { + 8008068: 697b ldr r3, [r7, #20] + 800806a: 7d5b ldrb r3, [r3, #21] + if ((pcb->prio < mprio) || + 800806c: 7afa ldrb r2, [r7, #11] + 800806e: 429a cmp r2, r3 + 8008070: d112 bne.n 8008098 + ((pcb->prio == mprio) && ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity))) { + 8008072: 4b13 ldr r3, [pc, #76] @ (80080c0 ) + 8008074: 681a ldr r2, [r3, #0] + 8008076: 697b ldr r3, [r7, #20] + 8008078: 6a1b ldr r3, [r3, #32] + 800807a: 1ad3 subs r3, r2, r3 + 800807c: 68fa ldr r2, [r7, #12] + 800807e: 429a cmp r2, r3 + 8008080: d80a bhi.n 8008098 + inactivity = tcp_ticks - pcb->tmr; + 8008082: 4b0f ldr r3, [pc, #60] @ (80080c0 ) + 8008084: 681a ldr r2, [r3, #0] + 8008086: 697b ldr r3, [r7, #20] + 8008088: 6a1b ldr r3, [r3, #32] + 800808a: 1ad3 subs r3, r2, r3 + 800808c: 60fb str r3, [r7, #12] + inactive = pcb; + 800808e: 697b ldr r3, [r7, #20] + 8008090: 613b str r3, [r7, #16] + mprio = pcb->prio; + 8008092: 697b ldr r3, [r7, #20] + 8008094: 7d5b ldrb r3, [r3, #21] + 8008096: 72fb strb r3, [r7, #11] + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + 8008098: 697b ldr r3, [r7, #20] + 800809a: 68db ldr r3, [r3, #12] + 800809c: 617b str r3, [r7, #20] + 800809e: 697b ldr r3, [r7, #20] + 80080a0: 2b00 cmp r3, #0 + 80080a2: d1dc bne.n 800805e + } + } + if (inactive != NULL) { + 80080a4: 693b ldr r3, [r7, #16] + 80080a6: 2b00 cmp r3, #0 + 80080a8: d004 beq.n 80080b4 + LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_prio: killing oldest PCB %p (%"S32_F")\n", + (void *)inactive, inactivity)); + tcp_abort(inactive); + 80080aa: 6938 ldr r0, [r7, #16] + 80080ac: f7ff fa54 bl 8007558 + 80080b0: e000 b.n 80080b4 + return; + 80080b2: bf00 nop + } +} + 80080b4: 3718 adds r7, #24 + 80080b6: 46bd mov sp, r7 + 80080b8: bd80 pop {r7, pc} + 80080ba: bf00 nop + 80080bc: 200190b0 .word 0x200190b0 + 80080c0: 200190a4 .word 0x200190a4 + +080080c4 : + * Kills the oldest connection that is in specific state. + * Called from tcp_alloc() for LAST_ACK and CLOSING if no more connections are available. + */ +static void +tcp_kill_state(enum tcp_state state) +{ + 80080c4: b580 push {r7, lr} + 80080c6: b086 sub sp, #24 + 80080c8: af00 add r7, sp, #0 + 80080ca: 4603 mov r3, r0 + 80080cc: 71fb strb r3, [r7, #7] + struct tcp_pcb *pcb, *inactive; + u32_t inactivity; + + LWIP_ASSERT("invalid state", (state == CLOSING) || (state == LAST_ACK)); + 80080ce: 79fb ldrb r3, [r7, #7] + 80080d0: 2b08 cmp r3, #8 + 80080d2: d009 beq.n 80080e8 + 80080d4: 79fb ldrb r3, [r7, #7] + 80080d6: 2b09 cmp r3, #9 + 80080d8: d006 beq.n 80080e8 + 80080da: 4b1a ldr r3, [pc, #104] @ (8008144 ) + 80080dc: f240 62dd movw r2, #1757 @ 0x6dd + 80080e0: 4919 ldr r1, [pc, #100] @ (8008148 ) + 80080e2: 481a ldr r0, [pc, #104] @ (800814c ) + 80080e4: f009 fa88 bl 80115f8 + + inactivity = 0; + 80080e8: 2300 movs r3, #0 + 80080ea: 60fb str r3, [r7, #12] + inactive = NULL; + 80080ec: 2300 movs r3, #0 + 80080ee: 613b str r3, [r7, #16] + /* Go through the list of active pcbs and get the oldest pcb that is in state + CLOSING/LAST_ACK. */ + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + 80080f0: 4b17 ldr r3, [pc, #92] @ (8008150 ) + 80080f2: 681b ldr r3, [r3, #0] + 80080f4: 617b str r3, [r7, #20] + 80080f6: e017 b.n 8008128 + if (pcb->state == state) { + 80080f8: 697b ldr r3, [r7, #20] + 80080fa: 7d1b ldrb r3, [r3, #20] + 80080fc: 79fa ldrb r2, [r7, #7] + 80080fe: 429a cmp r2, r3 + 8008100: d10f bne.n 8008122 + if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) { + 8008102: 4b14 ldr r3, [pc, #80] @ (8008154 ) + 8008104: 681a ldr r2, [r3, #0] + 8008106: 697b ldr r3, [r7, #20] + 8008108: 6a1b ldr r3, [r3, #32] + 800810a: 1ad3 subs r3, r2, r3 + 800810c: 68fa ldr r2, [r7, #12] + 800810e: 429a cmp r2, r3 + 8008110: d807 bhi.n 8008122 + inactivity = tcp_ticks - pcb->tmr; + 8008112: 4b10 ldr r3, [pc, #64] @ (8008154 ) + 8008114: 681a ldr r2, [r3, #0] + 8008116: 697b ldr r3, [r7, #20] + 8008118: 6a1b ldr r3, [r3, #32] + 800811a: 1ad3 subs r3, r2, r3 + 800811c: 60fb str r3, [r7, #12] + inactive = pcb; + 800811e: 697b ldr r3, [r7, #20] + 8008120: 613b str r3, [r7, #16] + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + 8008122: 697b ldr r3, [r7, #20] + 8008124: 68db ldr r3, [r3, #12] + 8008126: 617b str r3, [r7, #20] + 8008128: 697b ldr r3, [r7, #20] + 800812a: 2b00 cmp r3, #0 + 800812c: d1e4 bne.n 80080f8 + } + } + } + if (inactive != NULL) { + 800812e: 693b ldr r3, [r7, #16] + 8008130: 2b00 cmp r3, #0 + 8008132: d003 beq.n 800813c + LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_closing: killing oldest %s PCB %p (%"S32_F")\n", + tcp_state_str[state], (void *)inactive, inactivity)); + /* Don't send a RST, since no data is lost. */ + tcp_abandon(inactive, 0); + 8008134: 2100 movs r1, #0 + 8008136: 6938 ldr r0, [r7, #16] + 8008138: f7ff f950 bl 80073dc + } +} + 800813c: bf00 nop + 800813e: 3718 adds r7, #24 + 8008140: 46bd mov sp, r7 + 8008142: bd80 pop {r7, pc} + 8008144: 08016ab4 .word 0x08016ab4 + 8008148: 08017040 .word 0x08017040 + 800814c: 08016af8 .word 0x08016af8 + 8008150: 200190b0 .word 0x200190b0 + 8008154: 200190a4 .word 0x200190a4 + +08008158 : + * Kills the oldest connection that is in TIME_WAIT state. + * Called from tcp_alloc() if no more connections are available. + */ +static void +tcp_kill_timewait(void) +{ + 8008158: b580 push {r7, lr} + 800815a: b084 sub sp, #16 + 800815c: af00 add r7, sp, #0 + struct tcp_pcb *pcb, *inactive; + u32_t inactivity; + + inactivity = 0; + 800815e: 2300 movs r3, #0 + 8008160: 607b str r3, [r7, #4] + inactive = NULL; + 8008162: 2300 movs r3, #0 + 8008164: 60bb str r3, [r7, #8] + /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */ + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + 8008166: 4b12 ldr r3, [pc, #72] @ (80081b0 ) + 8008168: 681b ldr r3, [r3, #0] + 800816a: 60fb str r3, [r7, #12] + 800816c: e012 b.n 8008194 + if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) { + 800816e: 4b11 ldr r3, [pc, #68] @ (80081b4 ) + 8008170: 681a ldr r2, [r3, #0] + 8008172: 68fb ldr r3, [r7, #12] + 8008174: 6a1b ldr r3, [r3, #32] + 8008176: 1ad3 subs r3, r2, r3 + 8008178: 687a ldr r2, [r7, #4] + 800817a: 429a cmp r2, r3 + 800817c: d807 bhi.n 800818e + inactivity = tcp_ticks - pcb->tmr; + 800817e: 4b0d ldr r3, [pc, #52] @ (80081b4 ) + 8008180: 681a ldr r2, [r3, #0] + 8008182: 68fb ldr r3, [r7, #12] + 8008184: 6a1b ldr r3, [r3, #32] + 8008186: 1ad3 subs r3, r2, r3 + 8008188: 607b str r3, [r7, #4] + inactive = pcb; + 800818a: 68fb ldr r3, [r7, #12] + 800818c: 60bb str r3, [r7, #8] + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + 800818e: 68fb ldr r3, [r7, #12] + 8008190: 68db ldr r3, [r3, #12] + 8008192: 60fb str r3, [r7, #12] + 8008194: 68fb ldr r3, [r7, #12] + 8008196: 2b00 cmp r3, #0 + 8008198: d1e9 bne.n 800816e + } + } + if (inactive != NULL) { + 800819a: 68bb ldr r3, [r7, #8] + 800819c: 2b00 cmp r3, #0 + 800819e: d002 beq.n 80081a6 + LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_timewait: killing oldest TIME-WAIT PCB %p (%"S32_F")\n", + (void *)inactive, inactivity)); + tcp_abort(inactive); + 80081a0: 68b8 ldr r0, [r7, #8] + 80081a2: f7ff f9d9 bl 8007558 + } +} + 80081a6: bf00 nop + 80081a8: 3710 adds r7, #16 + 80081aa: 46bd mov sp, r7 + 80081ac: bd80 pop {r7, pc} + 80081ae: bf00 nop + 80081b0: 200190b4 .word 0x200190b4 + 80081b4: 200190a4 .word 0x200190a4 + +080081b8 : + * now send the FIN (which failed before), the pcb might be in a state that is + * OK for us to now free it. + */ +static void +tcp_handle_closepend(void) +{ + 80081b8: b580 push {r7, lr} + 80081ba: b082 sub sp, #8 + 80081bc: af00 add r7, sp, #0 + struct tcp_pcb *pcb = tcp_active_pcbs; + 80081be: 4b10 ldr r3, [pc, #64] @ (8008200 ) + 80081c0: 681b ldr r3, [r3, #0] + 80081c2: 607b str r3, [r7, #4] + + while (pcb != NULL) { + 80081c4: e014 b.n 80081f0 + struct tcp_pcb *next = pcb->next; + 80081c6: 687b ldr r3, [r7, #4] + 80081c8: 68db ldr r3, [r3, #12] + 80081ca: 603b str r3, [r7, #0] + /* send pending FIN */ + if (pcb->flags & TF_CLOSEPEND) { + 80081cc: 687b ldr r3, [r7, #4] + 80081ce: 8b5b ldrh r3, [r3, #26] + 80081d0: f003 0308 and.w r3, r3, #8 + 80081d4: 2b00 cmp r3, #0 + 80081d6: d009 beq.n 80081ec + LWIP_DEBUGF(TCP_DEBUG, ("tcp_handle_closepend: pending FIN\n")); + tcp_clear_flags(pcb, TF_CLOSEPEND); + 80081d8: 687b ldr r3, [r7, #4] + 80081da: 8b5b ldrh r3, [r3, #26] + 80081dc: f023 0308 bic.w r3, r3, #8 + 80081e0: b29a uxth r2, r3 + 80081e2: 687b ldr r3, [r7, #4] + 80081e4: 835a strh r2, [r3, #26] + tcp_close_shutdown_fin(pcb); + 80081e6: 6878 ldr r0, [r7, #4] + 80081e8: f7ff f862 bl 80072b0 + } + pcb = next; + 80081ec: 683b ldr r3, [r7, #0] + 80081ee: 607b str r3, [r7, #4] + while (pcb != NULL) { + 80081f0: 687b ldr r3, [r7, #4] + 80081f2: 2b00 cmp r3, #0 + 80081f4: d1e7 bne.n 80081c6 + } +} + 80081f6: bf00 nop + 80081f8: bf00 nop + 80081fa: 3708 adds r7, #8 + 80081fc: 46bd mov sp, r7 + 80081fe: bd80 pop {r7, pc} + 8008200: 200190b0 .word 0x200190b0 + +08008204 : + * @param prio priority for the new pcb + * @return a new tcp_pcb that initially is in state CLOSED + */ +struct tcp_pcb * +tcp_alloc(u8_t prio) +{ + 8008204: b580 push {r7, lr} + 8008206: b084 sub sp, #16 + 8008208: af00 add r7, sp, #0 + 800820a: 4603 mov r3, r0 + 800820c: 71fb strb r3, [r7, #7] + struct tcp_pcb *pcb; + + LWIP_ASSERT_CORE_LOCKED(); + + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + 800820e: 2001 movs r0, #1 + 8008210: f7fd fd1a bl 8005c48 + 8008214: 60f8 str r0, [r7, #12] + if (pcb == NULL) { + 8008216: 68fb ldr r3, [r7, #12] + 8008218: 2b00 cmp r3, #0 + 800821a: d126 bne.n 800826a + /* Try to send FIN for all pcbs stuck in TF_CLOSEPEND first */ + tcp_handle_closepend(); + 800821c: f7ff ffcc bl 80081b8 + + /* Try killing oldest connection in TIME-WAIT. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest TIME-WAIT connection\n")); + tcp_kill_timewait(); + 8008220: f7ff ff9a bl 8008158 + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + 8008224: 2001 movs r0, #1 + 8008226: f7fd fd0f bl 8005c48 + 800822a: 60f8 str r0, [r7, #12] + if (pcb == NULL) { + 800822c: 68fb ldr r3, [r7, #12] + 800822e: 2b00 cmp r3, #0 + 8008230: d11b bne.n 800826a + /* Try killing oldest connection in LAST-ACK (these wouldn't go to TIME-WAIT). */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest LAST-ACK connection\n")); + tcp_kill_state(LAST_ACK); + 8008232: 2009 movs r0, #9 + 8008234: f7ff ff46 bl 80080c4 + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + 8008238: 2001 movs r0, #1 + 800823a: f7fd fd05 bl 8005c48 + 800823e: 60f8 str r0, [r7, #12] + if (pcb == NULL) { + 8008240: 68fb ldr r3, [r7, #12] + 8008242: 2b00 cmp r3, #0 + 8008244: d111 bne.n 800826a + /* Try killing oldest connection in CLOSING. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest CLOSING connection\n")); + tcp_kill_state(CLOSING); + 8008246: 2008 movs r0, #8 + 8008248: f7ff ff3c bl 80080c4 + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + 800824c: 2001 movs r0, #1 + 800824e: f7fd fcfb bl 8005c48 + 8008252: 60f8 str r0, [r7, #12] + if (pcb == NULL) { + 8008254: 68fb ldr r3, [r7, #12] + 8008256: 2b00 cmp r3, #0 + 8008258: d107 bne.n 800826a + /* Try killing oldest active connection with lower priority than the new one. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing oldest connection with prio lower than %d\n", prio)); + tcp_kill_prio(prio); + 800825a: 79fb ldrb r3, [r7, #7] + 800825c: 4618 mov r0, r3 + 800825e: f7ff fee3 bl 8008028 + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + 8008262: 2001 movs r0, #1 + 8008264: f7fd fcf0 bl 8005c48 + 8008268: 60f8 str r0, [r7, #12] + if (pcb != NULL) { + /* adjust err stats: memp_malloc failed above */ + MEMP_STATS_DEC(err, MEMP_TCP_PCB); + } + } + if (pcb != NULL) { + 800826a: 68fb ldr r3, [r7, #12] + 800826c: 2b00 cmp r3, #0 + 800826e: d03f beq.n 80082f0 + /* zero out the whole pcb, so there is no need to initialize members to zero */ + memset(pcb, 0, sizeof(struct tcp_pcb)); + 8008270: 229c movs r2, #156 @ 0x9c + 8008272: 2100 movs r1, #0 + 8008274: 68f8 ldr r0, [r7, #12] + 8008276: f009 fa3e bl 80116f6 + pcb->prio = prio; + 800827a: 68fb ldr r3, [r7, #12] + 800827c: 79fa ldrb r2, [r7, #7] + 800827e: 755a strb r2, [r3, #21] + pcb->snd_buf = TCP_SND_BUF; + 8008280: 68fb ldr r3, [r7, #12] + 8008282: f44f 6286 mov.w r2, #1072 @ 0x430 + 8008286: f8a3 2064 strh.w r2, [r3, #100] @ 0x64 + /* Start with a window that does not need scaling. When window scaling is + enabled and used, the window is enlarged when both sides agree on scaling. */ + pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND); + 800828a: 68fb ldr r3, [r7, #12] + 800828c: f44f 6206 mov.w r2, #2144 @ 0x860 + 8008290: 855a strh r2, [r3, #42] @ 0x2a + 8008292: 68fb ldr r3, [r7, #12] + 8008294: 8d5a ldrh r2, [r3, #42] @ 0x2a + 8008296: 68fb ldr r3, [r7, #12] + 8008298: 851a strh r2, [r3, #40] @ 0x28 + pcb->ttl = TCP_TTL; + 800829a: 68fb ldr r3, [r7, #12] + 800829c: 22ff movs r2, #255 @ 0xff + 800829e: 72da strb r2, [r3, #11] + /* As initial send MSS, we use TCP_MSS but limit it to 536. + The send MSS is updated when an MSS option is received. */ + pcb->mss = INITIAL_MSS; + 80082a0: 68fb ldr r3, [r7, #12] + 80082a2: f44f 7206 mov.w r2, #536 @ 0x218 + 80082a6: 865a strh r2, [r3, #50] @ 0x32 + pcb->rto = 3000 / TCP_SLOW_INTERVAL; + 80082a8: 68fb ldr r3, [r7, #12] + 80082aa: 2206 movs r2, #6 + 80082ac: f8a3 2040 strh.w r2, [r3, #64] @ 0x40 + pcb->sv = 3000 / TCP_SLOW_INTERVAL; + 80082b0: 68fb ldr r3, [r7, #12] + 80082b2: 2206 movs r2, #6 + 80082b4: 87da strh r2, [r3, #62] @ 0x3e + pcb->rtime = -1; + 80082b6: 68fb ldr r3, [r7, #12] + 80082b8: f64f 72ff movw r2, #65535 @ 0xffff + 80082bc: 861a strh r2, [r3, #48] @ 0x30 + pcb->cwnd = 1; + 80082be: 68fb ldr r3, [r7, #12] + 80082c0: 2201 movs r2, #1 + 80082c2: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + pcb->tmr = tcp_ticks; + 80082c6: 4b0d ldr r3, [pc, #52] @ (80082fc ) + 80082c8: 681a ldr r2, [r3, #0] + 80082ca: 68fb ldr r3, [r7, #12] + 80082cc: 621a str r2, [r3, #32] + pcb->last_timer = tcp_timer_ctr; + 80082ce: 4b0c ldr r3, [pc, #48] @ (8008300 ) + 80082d0: 781a ldrb r2, [r3, #0] + 80082d2: 68fb ldr r3, [r7, #12] + 80082d4: 779a strb r2, [r3, #30] + of using the largest advertised receive window. We've seen complications with + receiving TCPs that use window scaling and/or window auto-tuning where the + initial advertised window is very small and then grows rapidly once the + connection is established. To avoid these complications, we set ssthresh to the + largest effective cwnd (amount of in-flight data) that the sender can have. */ + pcb->ssthresh = TCP_SND_BUF; + 80082d6: 68fb ldr r3, [r7, #12] + 80082d8: f44f 6286 mov.w r2, #1072 @ 0x430 + 80082dc: f8a3 204a strh.w r2, [r3, #74] @ 0x4a + +#if LWIP_CALLBACK_API + pcb->recv = tcp_recv_null; + 80082e0: 68fb ldr r3, [r7, #12] + 80082e2: 4a08 ldr r2, [pc, #32] @ (8008304 ) + 80082e4: f8c3 2084 str.w r2, [r3, #132] @ 0x84 +#endif /* LWIP_CALLBACK_API */ + + /* Init KEEPALIVE timer */ + pcb->keep_idle = TCP_KEEPIDLE_DEFAULT; + 80082e8: 68fb ldr r3, [r7, #12] + 80082ea: 4a07 ldr r2, [pc, #28] @ (8008308 ) + 80082ec: f8c3 2094 str.w r2, [r3, #148] @ 0x94 +#if LWIP_TCP_KEEPALIVE + pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT; + pcb->keep_cnt = TCP_KEEPCNT_DEFAULT; +#endif /* LWIP_TCP_KEEPALIVE */ + } + return pcb; + 80082f0: 68fb ldr r3, [r7, #12] +} + 80082f2: 4618 mov r0, r3 + 80082f4: 3710 adds r7, #16 + 80082f6: 46bd mov sp, r7 + 80082f8: bd80 pop {r7, pc} + 80082fa: bf00 nop + 80082fc: 200190a4 .word 0x200190a4 + 8008300: 200190ba .word 0x200190ba + 8008304: 08007fbd .word 0x08007fbd + 8008308: 006ddd00 .word 0x006ddd00 + +0800830c : + * + * @param pcb tcp_pcb to purge. The pcb itself is not deallocated! + */ +void +tcp_pcb_purge(struct tcp_pcb *pcb) +{ + 800830c: b580 push {r7, lr} + 800830e: b082 sub sp, #8 + 8008310: af00 add r7, sp, #0 + 8008312: 6078 str r0, [r7, #4] + LWIP_ERROR("tcp_pcb_purge: invalid pcb", pcb != NULL, return); + 8008314: 687b ldr r3, [r7, #4] + 8008316: 2b00 cmp r3, #0 + 8008318: d107 bne.n 800832a + 800831a: 4b21 ldr r3, [pc, #132] @ (80083a0 ) + 800831c: f640 0251 movw r2, #2129 @ 0x851 + 8008320: 4920 ldr r1, [pc, #128] @ (80083a4 ) + 8008322: 4821 ldr r0, [pc, #132] @ (80083a8 ) + 8008324: f009 f968 bl 80115f8 + 8008328: e037 b.n 800839a + + if (pcb->state != CLOSED && + 800832a: 687b ldr r3, [r7, #4] + 800832c: 7d1b ldrb r3, [r3, #20] + 800832e: 2b00 cmp r3, #0 + 8008330: d033 beq.n 800839a + pcb->state != TIME_WAIT && + 8008332: 687b ldr r3, [r7, #4] + 8008334: 7d1b ldrb r3, [r3, #20] + if (pcb->state != CLOSED && + 8008336: 2b0a cmp r3, #10 + 8008338: d02f beq.n 800839a + pcb->state != LISTEN) { + 800833a: 687b ldr r3, [r7, #4] + 800833c: 7d1b ldrb r3, [r3, #20] + pcb->state != TIME_WAIT && + 800833e: 2b01 cmp r3, #1 + 8008340: d02b beq.n 800839a + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge\n")); + + tcp_backlog_accepted(pcb); + + if (pcb->refused_data != NULL) { + 8008342: 687b ldr r3, [r7, #4] + 8008344: 6f9b ldr r3, [r3, #120] @ 0x78 + 8008346: 2b00 cmp r3, #0 + 8008348: d007 beq.n 800835a + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->refused_data\n")); + pbuf_free(pcb->refused_data); + 800834a: 687b ldr r3, [r7, #4] + 800834c: 6f9b ldr r3, [r3, #120] @ 0x78 + 800834e: 4618 mov r0, r3 + 8008350: f7fe fb6a bl 8006a28 + pcb->refused_data = NULL; + 8008354: 687b ldr r3, [r7, #4] + 8008356: 2200 movs r2, #0 + 8008358: 679a str r2, [r3, #120] @ 0x78 + } + if (pcb->unacked != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->unacked\n")); + } +#if TCP_QUEUE_OOSEQ + if (pcb->ooseq != NULL) { + 800835a: 687b ldr r3, [r7, #4] + 800835c: 6f5b ldr r3, [r3, #116] @ 0x74 + 800835e: 2b00 cmp r3, #0 + 8008360: d002 beq.n 8008368 + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->ooseq\n")); + tcp_free_ooseq(pcb); + 8008362: 6878 ldr r0, [r7, #4] + 8008364: f000 f986 bl 8008674 + } +#endif /* TCP_QUEUE_OOSEQ */ + + /* Stop the retransmission timer as it will expect data on unacked + queue if it fires */ + pcb->rtime = -1; + 8008368: 687b ldr r3, [r7, #4] + 800836a: f64f 72ff movw r2, #65535 @ 0xffff + 800836e: 861a strh r2, [r3, #48] @ 0x30 + + tcp_segs_free(pcb->unsent); + 8008370: 687b ldr r3, [r7, #4] + 8008372: 6edb ldr r3, [r3, #108] @ 0x6c + 8008374: 4618 mov r0, r3 + 8008376: f7ff fdc7 bl 8007f08 + tcp_segs_free(pcb->unacked); + 800837a: 687b ldr r3, [r7, #4] + 800837c: 6f1b ldr r3, [r3, #112] @ 0x70 + 800837e: 4618 mov r0, r3 + 8008380: f7ff fdc2 bl 8007f08 + pcb->unacked = pcb->unsent = NULL; + 8008384: 687b ldr r3, [r7, #4] + 8008386: 2200 movs r2, #0 + 8008388: 66da str r2, [r3, #108] @ 0x6c + 800838a: 687b ldr r3, [r7, #4] + 800838c: 6eda ldr r2, [r3, #108] @ 0x6c + 800838e: 687b ldr r3, [r7, #4] + 8008390: 671a str r2, [r3, #112] @ 0x70 +#if TCP_OVERSIZE + pcb->unsent_oversize = 0; + 8008392: 687b ldr r3, [r7, #4] + 8008394: 2200 movs r2, #0 + 8008396: f8a3 2068 strh.w r2, [r3, #104] @ 0x68 +#endif /* TCP_OVERSIZE */ + } +} + 800839a: 3708 adds r7, #8 + 800839c: 46bd mov sp, r7 + 800839e: bd80 pop {r7, pc} + 80083a0: 08016ab4 .word 0x08016ab4 + 80083a4: 08017100 .word 0x08017100 + 80083a8: 08016af8 .word 0x08016af8 + +080083ac : + * @param pcblist PCB list to purge. + * @param pcb tcp_pcb to purge. The pcb itself is NOT deallocated! + */ +void +tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb) +{ + 80083ac: b580 push {r7, lr} + 80083ae: b084 sub sp, #16 + 80083b0: af00 add r7, sp, #0 + 80083b2: 6078 str r0, [r7, #4] + 80083b4: 6039 str r1, [r7, #0] + LWIP_ASSERT("tcp_pcb_remove: invalid pcb", pcb != NULL); + 80083b6: 683b ldr r3, [r7, #0] + 80083b8: 2b00 cmp r3, #0 + 80083ba: d106 bne.n 80083ca + 80083bc: 4b3e ldr r3, [pc, #248] @ (80084b8 ) + 80083be: f640 0283 movw r2, #2179 @ 0x883 + 80083c2: 493e ldr r1, [pc, #248] @ (80084bc ) + 80083c4: 483e ldr r0, [pc, #248] @ (80084c0 ) + 80083c6: f009 f917 bl 80115f8 + LWIP_ASSERT("tcp_pcb_remove: invalid pcblist", pcblist != NULL); + 80083ca: 687b ldr r3, [r7, #4] + 80083cc: 2b00 cmp r3, #0 + 80083ce: d106 bne.n 80083de + 80083d0: 4b39 ldr r3, [pc, #228] @ (80084b8 ) + 80083d2: f640 0284 movw r2, #2180 @ 0x884 + 80083d6: 493b ldr r1, [pc, #236] @ (80084c4 ) + 80083d8: 4839 ldr r0, [pc, #228] @ (80084c0 ) + 80083da: f009 f90d bl 80115f8 + + TCP_RMV(pcblist, pcb); + 80083de: 687b ldr r3, [r7, #4] + 80083e0: 681b ldr r3, [r3, #0] + 80083e2: 683a ldr r2, [r7, #0] + 80083e4: 429a cmp r2, r3 + 80083e6: d105 bne.n 80083f4 + 80083e8: 687b ldr r3, [r7, #4] + 80083ea: 681b ldr r3, [r3, #0] + 80083ec: 68da ldr r2, [r3, #12] + 80083ee: 687b ldr r3, [r7, #4] + 80083f0: 601a str r2, [r3, #0] + 80083f2: e013 b.n 800841c + 80083f4: 687b ldr r3, [r7, #4] + 80083f6: 681b ldr r3, [r3, #0] + 80083f8: 60fb str r3, [r7, #12] + 80083fa: e00c b.n 8008416 + 80083fc: 68fb ldr r3, [r7, #12] + 80083fe: 68db ldr r3, [r3, #12] + 8008400: 683a ldr r2, [r7, #0] + 8008402: 429a cmp r2, r3 + 8008404: d104 bne.n 8008410 + 8008406: 683b ldr r3, [r7, #0] + 8008408: 68da ldr r2, [r3, #12] + 800840a: 68fb ldr r3, [r7, #12] + 800840c: 60da str r2, [r3, #12] + 800840e: e005 b.n 800841c + 8008410: 68fb ldr r3, [r7, #12] + 8008412: 68db ldr r3, [r3, #12] + 8008414: 60fb str r3, [r7, #12] + 8008416: 68fb ldr r3, [r7, #12] + 8008418: 2b00 cmp r3, #0 + 800841a: d1ef bne.n 80083fc + 800841c: 683b ldr r3, [r7, #0] + 800841e: 2200 movs r2, #0 + 8008420: 60da str r2, [r3, #12] + + tcp_pcb_purge(pcb); + 8008422: 6838 ldr r0, [r7, #0] + 8008424: f7ff ff72 bl 800830c + + /* if there is an outstanding delayed ACKs, send it */ + if ((pcb->state != TIME_WAIT) && + 8008428: 683b ldr r3, [r7, #0] + 800842a: 7d1b ldrb r3, [r3, #20] + 800842c: 2b0a cmp r3, #10 + 800842e: d013 beq.n 8008458 + (pcb->state != LISTEN) && + 8008430: 683b ldr r3, [r7, #0] + 8008432: 7d1b ldrb r3, [r3, #20] + if ((pcb->state != TIME_WAIT) && + 8008434: 2b01 cmp r3, #1 + 8008436: d00f beq.n 8008458 + (pcb->flags & TF_ACK_DELAY)) { + 8008438: 683b ldr r3, [r7, #0] + 800843a: 8b5b ldrh r3, [r3, #26] + 800843c: f003 0301 and.w r3, r3, #1 + (pcb->state != LISTEN) && + 8008440: 2b00 cmp r3, #0 + 8008442: d009 beq.n 8008458 + tcp_ack_now(pcb); + 8008444: 683b ldr r3, [r7, #0] + 8008446: 8b5b ldrh r3, [r3, #26] + 8008448: f043 0302 orr.w r3, r3, #2 + 800844c: b29a uxth r2, r3 + 800844e: 683b ldr r3, [r7, #0] + 8008450: 835a strh r2, [r3, #26] + tcp_output(pcb); + 8008452: 6838 ldr r0, [r7, #0] + 8008454: f002 ff68 bl 800b328 + } + + if (pcb->state != LISTEN) { + 8008458: 683b ldr r3, [r7, #0] + 800845a: 7d1b ldrb r3, [r3, #20] + 800845c: 2b01 cmp r3, #1 + 800845e: d020 beq.n 80084a2 + LWIP_ASSERT("unsent segments leaking", pcb->unsent == NULL); + 8008460: 683b ldr r3, [r7, #0] + 8008462: 6edb ldr r3, [r3, #108] @ 0x6c + 8008464: 2b00 cmp r3, #0 + 8008466: d006 beq.n 8008476 + 8008468: 4b13 ldr r3, [pc, #76] @ (80084b8 ) + 800846a: f640 0293 movw r2, #2195 @ 0x893 + 800846e: 4916 ldr r1, [pc, #88] @ (80084c8 ) + 8008470: 4813 ldr r0, [pc, #76] @ (80084c0 ) + 8008472: f009 f8c1 bl 80115f8 + LWIP_ASSERT("unacked segments leaking", pcb->unacked == NULL); + 8008476: 683b ldr r3, [r7, #0] + 8008478: 6f1b ldr r3, [r3, #112] @ 0x70 + 800847a: 2b00 cmp r3, #0 + 800847c: d006 beq.n 800848c + 800847e: 4b0e ldr r3, [pc, #56] @ (80084b8 ) + 8008480: f640 0294 movw r2, #2196 @ 0x894 + 8008484: 4911 ldr r1, [pc, #68] @ (80084cc ) + 8008486: 480e ldr r0, [pc, #56] @ (80084c0 ) + 8008488: f009 f8b6 bl 80115f8 +#if TCP_QUEUE_OOSEQ + LWIP_ASSERT("ooseq segments leaking", pcb->ooseq == NULL); + 800848c: 683b ldr r3, [r7, #0] + 800848e: 6f5b ldr r3, [r3, #116] @ 0x74 + 8008490: 2b00 cmp r3, #0 + 8008492: d006 beq.n 80084a2 + 8008494: 4b08 ldr r3, [pc, #32] @ (80084b8 ) + 8008496: f640 0296 movw r2, #2198 @ 0x896 + 800849a: 490d ldr r1, [pc, #52] @ (80084d0 ) + 800849c: 4808 ldr r0, [pc, #32] @ (80084c0 ) + 800849e: f009 f8ab bl 80115f8 +#endif /* TCP_QUEUE_OOSEQ */ + } + + pcb->state = CLOSED; + 80084a2: 683b ldr r3, [r7, #0] + 80084a4: 2200 movs r2, #0 + 80084a6: 751a strb r2, [r3, #20] + /* reset the local port to prevent the pcb from being 'bound' */ + pcb->local_port = 0; + 80084a8: 683b ldr r3, [r7, #0] + 80084aa: 2200 movs r2, #0 + 80084ac: 82da strh r2, [r3, #22] + + LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane()); +} + 80084ae: bf00 nop + 80084b0: 3710 adds r7, #16 + 80084b2: 46bd mov sp, r7 + 80084b4: bd80 pop {r7, pc} + 80084b6: bf00 nop + 80084b8: 08016ab4 .word 0x08016ab4 + 80084bc: 0801711c .word 0x0801711c + 80084c0: 08016af8 .word 0x08016af8 + 80084c4: 08017138 .word 0x08017138 + 80084c8: 08017158 .word 0x08017158 + 80084cc: 08017170 .word 0x08017170 + 80084d0: 0801718c .word 0x0801718c + +080084d4 : + * + * @return u32_t pseudo random sequence number + */ +u32_t +tcp_next_iss(struct tcp_pcb *pcb) +{ + 80084d4: b580 push {r7, lr} + 80084d6: b082 sub sp, #8 + 80084d8: af00 add r7, sp, #0 + 80084da: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_next_iss: invalid pcb", pcb != NULL); + return LWIP_HOOK_TCP_ISN(&pcb->local_ip, pcb->local_port, &pcb->remote_ip, pcb->remote_port); +#else /* LWIP_HOOK_TCP_ISN */ + static u32_t iss = 6510; + + LWIP_ASSERT("tcp_next_iss: invalid pcb", pcb != NULL); + 80084dc: 687b ldr r3, [r7, #4] + 80084de: 2b00 cmp r3, #0 + 80084e0: d106 bne.n 80084f0 + 80084e2: 4b0a ldr r3, [pc, #40] @ (800850c ) + 80084e4: f640 02af movw r2, #2223 @ 0x8af + 80084e8: 4909 ldr r1, [pc, #36] @ (8008510 ) + 80084ea: 480a ldr r0, [pc, #40] @ (8008514 ) + 80084ec: f009 f884 bl 80115f8 + LWIP_UNUSED_ARG(pcb); + + iss += tcp_ticks; /* XXX */ + 80084f0: 4b09 ldr r3, [pc, #36] @ (8008518 ) + 80084f2: 681a ldr r2, [r3, #0] + 80084f4: 4b09 ldr r3, [pc, #36] @ (800851c ) + 80084f6: 681b ldr r3, [r3, #0] + 80084f8: 4413 add r3, r2 + 80084fa: 4a07 ldr r2, [pc, #28] @ (8008518 ) + 80084fc: 6013 str r3, [r2, #0] + return iss; + 80084fe: 4b06 ldr r3, [pc, #24] @ (8008518 ) + 8008500: 681b ldr r3, [r3, #0] +#endif /* LWIP_HOOK_TCP_ISN */ +} + 8008502: 4618 mov r0, r3 + 8008504: 3708 adds r7, #8 + 8008506: 46bd mov sp, r7 + 8008508: bd80 pop {r7, pc} + 800850a: bf00 nop + 800850c: 08016ab4 .word 0x08016ab4 + 8008510: 080171a4 .word 0x080171a4 + 8008514: 08016af8 .word 0x08016af8 + 8008518: 20000024 .word 0x20000024 + 800851c: 200190a4 .word 0x200190a4 + +08008520 : + * by calculating the minimum of TCP_MSS and the mtu (if set) of the target + * netif (if not NULL). + */ +u16_t +tcp_eff_send_mss_netif(u16_t sendmss, struct netif *outif, const ip_addr_t *dest) +{ + 8008520: b580 push {r7, lr} + 8008522: b086 sub sp, #24 + 8008524: af00 add r7, sp, #0 + 8008526: 4603 mov r3, r0 + 8008528: 60b9 str r1, [r7, #8] + 800852a: 607a str r2, [r7, #4] + 800852c: 81fb strh r3, [r7, #14] + u16_t mss_s; + u16_t mtu; + + LWIP_UNUSED_ARG(dest); /* in case IPv6 is disabled */ + + LWIP_ASSERT("tcp_eff_send_mss_netif: invalid dst_ip", dest != NULL); + 800852e: 687b ldr r3, [r7, #4] + 8008530: 2b00 cmp r3, #0 + 8008532: d106 bne.n 8008542 + 8008534: 4b14 ldr r3, [pc, #80] @ (8008588 ) + 8008536: f640 02c5 movw r2, #2245 @ 0x8c5 + 800853a: 4914 ldr r1, [pc, #80] @ (800858c ) + 800853c: 4814 ldr r0, [pc, #80] @ (8008590 ) + 800853e: f009 f85b bl 80115f8 + else +#endif /* LWIP_IPV4 */ +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + { + if (outif == NULL) { + 8008542: 68bb ldr r3, [r7, #8] + 8008544: 2b00 cmp r3, #0 + 8008546: d101 bne.n 800854c + return sendmss; + 8008548: 89fb ldrh r3, [r7, #14] + 800854a: e019 b.n 8008580 + } + mtu = outif->mtu; + 800854c: 68bb ldr r3, [r7, #8] + 800854e: 8d1b ldrh r3, [r3, #40] @ 0x28 + 8008550: 82fb strh r3, [r7, #22] + } +#endif /* LWIP_IPV4 */ + + if (mtu != 0) { + 8008552: 8afb ldrh r3, [r7, #22] + 8008554: 2b00 cmp r3, #0 + 8008556: d012 beq.n 800857e + else +#endif /* LWIP_IPV4 */ +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + { + offset = IP_HLEN + TCP_HLEN; + 8008558: 2328 movs r3, #40 @ 0x28 + 800855a: 82bb strh r3, [r7, #20] + } +#endif /* LWIP_IPV4 */ + mss_s = (mtu > offset) ? (u16_t)(mtu - offset) : 0; + 800855c: 8afa ldrh r2, [r7, #22] + 800855e: 8abb ldrh r3, [r7, #20] + 8008560: 429a cmp r2, r3 + 8008562: d904 bls.n 800856e + 8008564: 8afa ldrh r2, [r7, #22] + 8008566: 8abb ldrh r3, [r7, #20] + 8008568: 1ad3 subs r3, r2, r3 + 800856a: b29b uxth r3, r3 + 800856c: e000 b.n 8008570 + 800856e: 2300 movs r3, #0 + 8008570: 827b strh r3, [r7, #18] + /* RFC 1122, chap 4.2.2.6: + * Eff.snd.MSS = min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize + * We correct for TCP options in tcp_write(), and don't support IP options. + */ + sendmss = LWIP_MIN(sendmss, mss_s); + 8008572: 8a7a ldrh r2, [r7, #18] + 8008574: 89fb ldrh r3, [r7, #14] + 8008576: 4293 cmp r3, r2 + 8008578: bf28 it cs + 800857a: 4613 movcs r3, r2 + 800857c: 81fb strh r3, [r7, #14] + } + return sendmss; + 800857e: 89fb ldrh r3, [r7, #14] +} + 8008580: 4618 mov r0, r3 + 8008582: 3718 adds r7, #24 + 8008584: 46bd mov sp, r7 + 8008586: bd80 pop {r7, pc} + 8008588: 08016ab4 .word 0x08016ab4 + 800858c: 080171c0 .word 0x080171c0 + 8008590: 08016af8 .word 0x08016af8 + +08008594 : +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + +/** Helper function for tcp_netif_ip_addr_changed() that iterates a pcb list */ +static void +tcp_netif_ip_addr_changed_pcblist(const ip_addr_t *old_addr, struct tcp_pcb *pcb_list) +{ + 8008594: b580 push {r7, lr} + 8008596: b084 sub sp, #16 + 8008598: af00 add r7, sp, #0 + 800859a: 6078 str r0, [r7, #4] + 800859c: 6039 str r1, [r7, #0] + struct tcp_pcb *pcb; + pcb = pcb_list; + 800859e: 683b ldr r3, [r7, #0] + 80085a0: 60fb str r3, [r7, #12] + + LWIP_ASSERT("tcp_netif_ip_addr_changed_pcblist: invalid old_addr", old_addr != NULL); + 80085a2: 687b ldr r3, [r7, #4] + 80085a4: 2b00 cmp r3, #0 + 80085a6: d119 bne.n 80085dc + 80085a8: 4b10 ldr r3, [pc, #64] @ (80085ec ) + 80085aa: f44f 6210 mov.w r2, #2304 @ 0x900 + 80085ae: 4910 ldr r1, [pc, #64] @ (80085f0 ) + 80085b0: 4810 ldr r0, [pc, #64] @ (80085f4 ) + 80085b2: f009 f821 bl 80115f8 + + while (pcb != NULL) { + 80085b6: e011 b.n 80085dc + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&pcb->local_ip, old_addr) + 80085b8: 68fb ldr r3, [r7, #12] + 80085ba: 681a ldr r2, [r3, #0] + 80085bc: 687b ldr r3, [r7, #4] + 80085be: 681b ldr r3, [r3, #0] + 80085c0: 429a cmp r2, r3 + 80085c2: d108 bne.n 80085d6 + /* connections to link-local addresses must persist (RFC3927 ch. 1.9) */ + && (!IP_IS_V4_VAL(pcb->local_ip) || !ip4_addr_islinklocal(ip_2_ip4(&pcb->local_ip))) +#endif /* LWIP_AUTOIP */ + ) { + /* this connection must be aborted */ + struct tcp_pcb *next = pcb->next; + 80085c4: 68fb ldr r3, [r7, #12] + 80085c6: 68db ldr r3, [r3, #12] + 80085c8: 60bb str r3, [r7, #8] + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb)); + tcp_abort(pcb); + 80085ca: 68f8 ldr r0, [r7, #12] + 80085cc: f7fe ffc4 bl 8007558 + pcb = next; + 80085d0: 68bb ldr r3, [r7, #8] + 80085d2: 60fb str r3, [r7, #12] + 80085d4: e002 b.n 80085dc + } else { + pcb = pcb->next; + 80085d6: 68fb ldr r3, [r7, #12] + 80085d8: 68db ldr r3, [r3, #12] + 80085da: 60fb str r3, [r7, #12] + while (pcb != NULL) { + 80085dc: 68fb ldr r3, [r7, #12] + 80085de: 2b00 cmp r3, #0 + 80085e0: d1ea bne.n 80085b8 + } + } +} + 80085e2: bf00 nop + 80085e4: bf00 nop + 80085e6: 3710 adds r7, #16 + 80085e8: 46bd mov sp, r7 + 80085ea: bd80 pop {r7, pc} + 80085ec: 08016ab4 .word 0x08016ab4 + 80085f0: 080171e8 .word 0x080171e8 + 80085f4: 08016af8 .word 0x08016af8 + +080085f8 : + * @param old_addr IP address of the netif before change + * @param new_addr IP address of the netif after change or NULL if netif has been removed + */ +void +tcp_netif_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr) +{ + 80085f8: b580 push {r7, lr} + 80085fa: b084 sub sp, #16 + 80085fc: af00 add r7, sp, #0 + 80085fe: 6078 str r0, [r7, #4] + 8008600: 6039 str r1, [r7, #0] + struct tcp_pcb_listen *lpcb; + + if (!ip_addr_isany(old_addr)) { + 8008602: 687b ldr r3, [r7, #4] + 8008604: 2b00 cmp r3, #0 + 8008606: d02a beq.n 800865e + 8008608: 687b ldr r3, [r7, #4] + 800860a: 681b ldr r3, [r3, #0] + 800860c: 2b00 cmp r3, #0 + 800860e: d026 beq.n 800865e + tcp_netif_ip_addr_changed_pcblist(old_addr, tcp_active_pcbs); + 8008610: 4b15 ldr r3, [pc, #84] @ (8008668 ) + 8008612: 681b ldr r3, [r3, #0] + 8008614: 4619 mov r1, r3 + 8008616: 6878 ldr r0, [r7, #4] + 8008618: f7ff ffbc bl 8008594 + tcp_netif_ip_addr_changed_pcblist(old_addr, tcp_bound_pcbs); + 800861c: 4b13 ldr r3, [pc, #76] @ (800866c ) + 800861e: 681b ldr r3, [r3, #0] + 8008620: 4619 mov r1, r3 + 8008622: 6878 ldr r0, [r7, #4] + 8008624: f7ff ffb6 bl 8008594 + + if (!ip_addr_isany(new_addr)) { + 8008628: 683b ldr r3, [r7, #0] + 800862a: 2b00 cmp r3, #0 + 800862c: d017 beq.n 800865e + 800862e: 683b ldr r3, [r7, #0] + 8008630: 681b ldr r3, [r3, #0] + 8008632: 2b00 cmp r3, #0 + 8008634: d013 beq.n 800865e + /* PCB bound to current local interface address? */ + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + 8008636: 4b0e ldr r3, [pc, #56] @ (8008670 ) + 8008638: 681b ldr r3, [r3, #0] + 800863a: 60fb str r3, [r7, #12] + 800863c: e00c b.n 8008658 + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&lpcb->local_ip, old_addr)) { + 800863e: 68fb ldr r3, [r7, #12] + 8008640: 681a ldr r2, [r3, #0] + 8008642: 687b ldr r3, [r7, #4] + 8008644: 681b ldr r3, [r3, #0] + 8008646: 429a cmp r2, r3 + 8008648: d103 bne.n 8008652 + /* The PCB is listening to the old ipaddr and + * is set to listen to the new one instead */ + ip_addr_copy(lpcb->local_ip, *new_addr); + 800864a: 683b ldr r3, [r7, #0] + 800864c: 681a ldr r2, [r3, #0] + 800864e: 68fb ldr r3, [r7, #12] + 8008650: 601a str r2, [r3, #0] + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + 8008652: 68fb ldr r3, [r7, #12] + 8008654: 68db ldr r3, [r3, #12] + 8008656: 60fb str r3, [r7, #12] + 8008658: 68fb ldr r3, [r7, #12] + 800865a: 2b00 cmp r3, #0 + 800865c: d1ef bne.n 800863e + } + } + } + } +} + 800865e: bf00 nop + 8008660: 3710 adds r7, #16 + 8008662: 46bd mov sp, r7 + 8008664: bd80 pop {r7, pc} + 8008666: bf00 nop + 8008668: 200190b0 .word 0x200190b0 + 800866c: 200190a8 .word 0x200190a8 + 8008670: 200190ac .word 0x200190ac + +08008674 : + +#if TCP_QUEUE_OOSEQ +/* Free all ooseq pbufs (and possibly reset SACK state) */ +void +tcp_free_ooseq(struct tcp_pcb *pcb) +{ + 8008674: b580 push {r7, lr} + 8008676: b082 sub sp, #8 + 8008678: af00 add r7, sp, #0 + 800867a: 6078 str r0, [r7, #4] + if (pcb->ooseq) { + 800867c: 687b ldr r3, [r7, #4] + 800867e: 6f5b ldr r3, [r3, #116] @ 0x74 + 8008680: 2b00 cmp r3, #0 + 8008682: d007 beq.n 8008694 + tcp_segs_free(pcb->ooseq); + 8008684: 687b ldr r3, [r7, #4] + 8008686: 6f5b ldr r3, [r3, #116] @ 0x74 + 8008688: 4618 mov r0, r3 + 800868a: f7ff fc3d bl 8007f08 + pcb->ooseq = NULL; + 800868e: 687b ldr r3, [r7, #4] + 8008690: 2200 movs r2, #0 + 8008692: 675a str r2, [r3, #116] @ 0x74 +#if LWIP_TCP_SACK_OUT + memset(pcb->rcv_sacks, 0, sizeof(pcb->rcv_sacks)); +#endif /* LWIP_TCP_SACK_OUT */ + } +} + 8008694: bf00 nop + 8008696: 3708 adds r7, #8 + 8008698: 46bd mov sp, r7 + 800869a: bd80 pop {r7, pc} + +0800869c : + * @param p received TCP segment to process (p->payload pointing to the TCP header) + * @param inp network interface on which this segment was received + */ +void +tcp_input(struct pbuf *p, struct netif *inp) +{ + 800869c: b590 push {r4, r7, lr} + 800869e: b08d sub sp, #52 @ 0x34 + 80086a0: af04 add r7, sp, #16 + 80086a2: 6078 str r0, [r7, #4] + 80086a4: 6039 str r1, [r7, #0] + u8_t hdrlen_bytes; + err_t err; + + LWIP_UNUSED_ARG(inp); + LWIP_ASSERT_CORE_LOCKED(); + LWIP_ASSERT("tcp_input: invalid pbuf", p != NULL); + 80086a6: 687b ldr r3, [r7, #4] + 80086a8: 2b00 cmp r3, #0 + 80086aa: d105 bne.n 80086b8 + 80086ac: 4b9b ldr r3, [pc, #620] @ (800891c ) + 80086ae: 2283 movs r2, #131 @ 0x83 + 80086b0: 499b ldr r1, [pc, #620] @ (8008920 ) + 80086b2: 489c ldr r0, [pc, #624] @ (8008924 ) + 80086b4: f008 ffa0 bl 80115f8 + PERF_START; + + TCP_STATS_INC(tcp.recv); + MIB2_STATS_INC(mib2.tcpinsegs); + + tcphdr = (struct tcp_hdr *)p->payload; + 80086b8: 687b ldr r3, [r7, #4] + 80086ba: 685b ldr r3, [r3, #4] + 80086bc: 4a9a ldr r2, [pc, #616] @ (8008928 ) + 80086be: 6013 str r3, [r2, #0] +#if TCP_INPUT_DEBUG + tcp_debug_print(tcphdr); +#endif + + /* Check that TCP header fits in payload */ + if (p->len < TCP_HLEN) { + 80086c0: 687b ldr r3, [r7, #4] + 80086c2: 895b ldrh r3, [r3, #10] + 80086c4: 2b13 cmp r3, #19 + 80086c6: f240 83d1 bls.w 8008e6c + TCP_STATS_INC(tcp.lenerr); + goto dropped; + } + + /* Don't even process incoming broadcasts/multicasts. */ + if (ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif()) || + 80086ca: 4b98 ldr r3, [pc, #608] @ (800892c ) + 80086cc: 695b ldr r3, [r3, #20] + 80086ce: 4a97 ldr r2, [pc, #604] @ (800892c ) + 80086d0: 6812 ldr r2, [r2, #0] + 80086d2: 4611 mov r1, r2 + 80086d4: 4618 mov r0, r3 + 80086d6: f007 fe1d bl 8010314 + 80086da: 4603 mov r3, r0 + 80086dc: 2b00 cmp r3, #0 + 80086de: f040 83c7 bne.w 8008e70 + ip_addr_ismulticast(ip_current_dest_addr())) { + 80086e2: 4b92 ldr r3, [pc, #584] @ (800892c ) + 80086e4: 695b ldr r3, [r3, #20] + 80086e6: f003 03f0 and.w r3, r3, #240 @ 0xf0 + if (ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif()) || + 80086ea: 2be0 cmp r3, #224 @ 0xe0 + 80086ec: f000 83c0 beq.w 8008e70 + } + } +#endif /* CHECKSUM_CHECK_TCP */ + + /* sanity-check header length */ + hdrlen_bytes = TCPH_HDRLEN_BYTES(tcphdr); + 80086f0: 4b8d ldr r3, [pc, #564] @ (8008928 ) + 80086f2: 681b ldr r3, [r3, #0] + 80086f4: 899b ldrh r3, [r3, #12] + 80086f6: b29b uxth r3, r3 + 80086f8: 4618 mov r0, r3 + 80086fa: f7fc fe45 bl 8005388 + 80086fe: 4603 mov r3, r0 + 8008700: 0b1b lsrs r3, r3, #12 + 8008702: b29b uxth r3, r3 + 8008704: b2db uxtb r3, r3 + 8008706: 009b lsls r3, r3, #2 + 8008708: 74bb strb r3, [r7, #18] + if ((hdrlen_bytes < TCP_HLEN) || (hdrlen_bytes > p->tot_len)) { + 800870a: 7cbb ldrb r3, [r7, #18] + 800870c: 2b13 cmp r3, #19 + 800870e: f240 83b1 bls.w 8008e74 + 8008712: 7cbb ldrb r3, [r7, #18] + 8008714: b29a uxth r2, r3 + 8008716: 687b ldr r3, [r7, #4] + 8008718: 891b ldrh r3, [r3, #8] + 800871a: 429a cmp r2, r3 + 800871c: f200 83aa bhi.w 8008e74 + goto dropped; + } + + /* Move the payload pointer in the pbuf so that it points to the + TCP data instead of the TCP header. */ + tcphdr_optlen = (u16_t)(hdrlen_bytes - TCP_HLEN); + 8008720: 7cbb ldrb r3, [r7, #18] + 8008722: b29b uxth r3, r3 + 8008724: 3b14 subs r3, #20 + 8008726: b29a uxth r2, r3 + 8008728: 4b81 ldr r3, [pc, #516] @ (8008930 ) + 800872a: 801a strh r2, [r3, #0] + tcphdr_opt2 = NULL; + 800872c: 4b81 ldr r3, [pc, #516] @ (8008934 ) + 800872e: 2200 movs r2, #0 + 8008730: 601a str r2, [r3, #0] + if (p->len >= hdrlen_bytes) { + 8008732: 687b ldr r3, [r7, #4] + 8008734: 895a ldrh r2, [r3, #10] + 8008736: 7cbb ldrb r3, [r7, #18] + 8008738: b29b uxth r3, r3 + 800873a: 429a cmp r2, r3 + 800873c: d309 bcc.n 8008752 + /* all options are in the first pbuf */ + tcphdr_opt1len = tcphdr_optlen; + 800873e: 4b7c ldr r3, [pc, #496] @ (8008930 ) + 8008740: 881a ldrh r2, [r3, #0] + 8008742: 4b7d ldr r3, [pc, #500] @ (8008938 ) + 8008744: 801a strh r2, [r3, #0] + pbuf_remove_header(p, hdrlen_bytes); /* cannot fail */ + 8008746: 7cbb ldrb r3, [r7, #18] + 8008748: 4619 mov r1, r3 + 800874a: 6878 ldr r0, [r7, #4] + 800874c: f7fe f8e6 bl 800691c + 8008750: e04e b.n 80087f0 + } else { + u16_t opt2len; + /* TCP header fits into first pbuf, options don't - data is in the next pbuf */ + /* there must be a next pbuf, due to hdrlen_bytes sanity check above */ + LWIP_ASSERT("p->next != NULL", p->next != NULL); + 8008752: 687b ldr r3, [r7, #4] + 8008754: 681b ldr r3, [r3, #0] + 8008756: 2b00 cmp r3, #0 + 8008758: d105 bne.n 8008766 + 800875a: 4b70 ldr r3, [pc, #448] @ (800891c ) + 800875c: 22c2 movs r2, #194 @ 0xc2 + 800875e: 4977 ldr r1, [pc, #476] @ (800893c ) + 8008760: 4870 ldr r0, [pc, #448] @ (8008924 ) + 8008762: f008 ff49 bl 80115f8 + + /* advance over the TCP header (cannot fail) */ + pbuf_remove_header(p, TCP_HLEN); + 8008766: 2114 movs r1, #20 + 8008768: 6878 ldr r0, [r7, #4] + 800876a: f7fe f8d7 bl 800691c + + /* determine how long the first and second parts of the options are */ + tcphdr_opt1len = p->len; + 800876e: 687b ldr r3, [r7, #4] + 8008770: 895a ldrh r2, [r3, #10] + 8008772: 4b71 ldr r3, [pc, #452] @ (8008938 ) + 8008774: 801a strh r2, [r3, #0] + opt2len = (u16_t)(tcphdr_optlen - tcphdr_opt1len); + 8008776: 4b6e ldr r3, [pc, #440] @ (8008930 ) + 8008778: 881a ldrh r2, [r3, #0] + 800877a: 4b6f ldr r3, [pc, #444] @ (8008938 ) + 800877c: 881b ldrh r3, [r3, #0] + 800877e: 1ad3 subs r3, r2, r3 + 8008780: 823b strh r3, [r7, #16] + + /* options continue in the next pbuf: set p to zero length and hide the + options in the next pbuf (adjusting p->tot_len) */ + pbuf_remove_header(p, tcphdr_opt1len); + 8008782: 4b6d ldr r3, [pc, #436] @ (8008938 ) + 8008784: 881b ldrh r3, [r3, #0] + 8008786: 4619 mov r1, r3 + 8008788: 6878 ldr r0, [r7, #4] + 800878a: f7fe f8c7 bl 800691c + + /* check that the options fit in the second pbuf */ + if (opt2len > p->next->len) { + 800878e: 687b ldr r3, [r7, #4] + 8008790: 681b ldr r3, [r3, #0] + 8008792: 895b ldrh r3, [r3, #10] + 8008794: 8a3a ldrh r2, [r7, #16] + 8008796: 429a cmp r2, r3 + 8008798: f200 836e bhi.w 8008e78 + TCP_STATS_INC(tcp.lenerr); + goto dropped; + } + + /* remember the pointer to the second part of the options */ + tcphdr_opt2 = (u8_t *)p->next->payload; + 800879c: 687b ldr r3, [r7, #4] + 800879e: 681b ldr r3, [r3, #0] + 80087a0: 685b ldr r3, [r3, #4] + 80087a2: 4a64 ldr r2, [pc, #400] @ (8008934 ) + 80087a4: 6013 str r3, [r2, #0] + + /* advance p->next to point after the options, and manually + adjust p->tot_len to keep it consistent with the changed p->next */ + pbuf_remove_header(p->next, opt2len); + 80087a6: 687b ldr r3, [r7, #4] + 80087a8: 681b ldr r3, [r3, #0] + 80087aa: 8a3a ldrh r2, [r7, #16] + 80087ac: 4611 mov r1, r2 + 80087ae: 4618 mov r0, r3 + 80087b0: f7fe f8b4 bl 800691c + p->tot_len = (u16_t)(p->tot_len - opt2len); + 80087b4: 687b ldr r3, [r7, #4] + 80087b6: 891a ldrh r2, [r3, #8] + 80087b8: 8a3b ldrh r3, [r7, #16] + 80087ba: 1ad3 subs r3, r2, r3 + 80087bc: b29a uxth r2, r3 + 80087be: 687b ldr r3, [r7, #4] + 80087c0: 811a strh r2, [r3, #8] + + LWIP_ASSERT("p->len == 0", p->len == 0); + 80087c2: 687b ldr r3, [r7, #4] + 80087c4: 895b ldrh r3, [r3, #10] + 80087c6: 2b00 cmp r3, #0 + 80087c8: d005 beq.n 80087d6 + 80087ca: 4b54 ldr r3, [pc, #336] @ (800891c ) + 80087cc: 22df movs r2, #223 @ 0xdf + 80087ce: 495c ldr r1, [pc, #368] @ (8008940 ) + 80087d0: 4854 ldr r0, [pc, #336] @ (8008924 ) + 80087d2: f008 ff11 bl 80115f8 + LWIP_ASSERT("p->tot_len == p->next->tot_len", p->tot_len == p->next->tot_len); + 80087d6: 687b ldr r3, [r7, #4] + 80087d8: 891a ldrh r2, [r3, #8] + 80087da: 687b ldr r3, [r7, #4] + 80087dc: 681b ldr r3, [r3, #0] + 80087de: 891b ldrh r3, [r3, #8] + 80087e0: 429a cmp r2, r3 + 80087e2: d005 beq.n 80087f0 + 80087e4: 4b4d ldr r3, [pc, #308] @ (800891c ) + 80087e6: 22e0 movs r2, #224 @ 0xe0 + 80087e8: 4956 ldr r1, [pc, #344] @ (8008944 ) + 80087ea: 484e ldr r0, [pc, #312] @ (8008924 ) + 80087ec: f008 ff04 bl 80115f8 + } + + /* Convert fields in TCP header to host byte order. */ + tcphdr->src = lwip_ntohs(tcphdr->src); + 80087f0: 4b4d ldr r3, [pc, #308] @ (8008928 ) + 80087f2: 681b ldr r3, [r3, #0] + 80087f4: 881b ldrh r3, [r3, #0] + 80087f6: b29b uxth r3, r3 + 80087f8: 4a4b ldr r2, [pc, #300] @ (8008928 ) + 80087fa: 6814 ldr r4, [r2, #0] + 80087fc: 4618 mov r0, r3 + 80087fe: f7fc fdc3 bl 8005388 + 8008802: 4603 mov r3, r0 + 8008804: 8023 strh r3, [r4, #0] + tcphdr->dest = lwip_ntohs(tcphdr->dest); + 8008806: 4b48 ldr r3, [pc, #288] @ (8008928 ) + 8008808: 681b ldr r3, [r3, #0] + 800880a: 885b ldrh r3, [r3, #2] + 800880c: b29b uxth r3, r3 + 800880e: 4a46 ldr r2, [pc, #280] @ (8008928 ) + 8008810: 6814 ldr r4, [r2, #0] + 8008812: 4618 mov r0, r3 + 8008814: f7fc fdb8 bl 8005388 + 8008818: 4603 mov r3, r0 + 800881a: 8063 strh r3, [r4, #2] + seqno = tcphdr->seqno = lwip_ntohl(tcphdr->seqno); + 800881c: 4b42 ldr r3, [pc, #264] @ (8008928 ) + 800881e: 681b ldr r3, [r3, #0] + 8008820: 685b ldr r3, [r3, #4] + 8008822: 4a41 ldr r2, [pc, #260] @ (8008928 ) + 8008824: 6814 ldr r4, [r2, #0] + 8008826: 4618 mov r0, r3 + 8008828: f7fc fdc3 bl 80053b2 + 800882c: 4603 mov r3, r0 + 800882e: 6063 str r3, [r4, #4] + 8008830: 6863 ldr r3, [r4, #4] + 8008832: 4a45 ldr r2, [pc, #276] @ (8008948 ) + 8008834: 6013 str r3, [r2, #0] + ackno = tcphdr->ackno = lwip_ntohl(tcphdr->ackno); + 8008836: 4b3c ldr r3, [pc, #240] @ (8008928 ) + 8008838: 681b ldr r3, [r3, #0] + 800883a: 689b ldr r3, [r3, #8] + 800883c: 4a3a ldr r2, [pc, #232] @ (8008928 ) + 800883e: 6814 ldr r4, [r2, #0] + 8008840: 4618 mov r0, r3 + 8008842: f7fc fdb6 bl 80053b2 + 8008846: 4603 mov r3, r0 + 8008848: 60a3 str r3, [r4, #8] + 800884a: 68a3 ldr r3, [r4, #8] + 800884c: 4a3f ldr r2, [pc, #252] @ (800894c ) + 800884e: 6013 str r3, [r2, #0] + tcphdr->wnd = lwip_ntohs(tcphdr->wnd); + 8008850: 4b35 ldr r3, [pc, #212] @ (8008928 ) + 8008852: 681b ldr r3, [r3, #0] + 8008854: 89db ldrh r3, [r3, #14] + 8008856: b29b uxth r3, r3 + 8008858: 4a33 ldr r2, [pc, #204] @ (8008928 ) + 800885a: 6814 ldr r4, [r2, #0] + 800885c: 4618 mov r0, r3 + 800885e: f7fc fd93 bl 8005388 + 8008862: 4603 mov r3, r0 + 8008864: 81e3 strh r3, [r4, #14] + + flags = TCPH_FLAGS(tcphdr); + 8008866: 4b30 ldr r3, [pc, #192] @ (8008928 ) + 8008868: 681b ldr r3, [r3, #0] + 800886a: 899b ldrh r3, [r3, #12] + 800886c: b29b uxth r3, r3 + 800886e: 4618 mov r0, r3 + 8008870: f7fc fd8a bl 8005388 + 8008874: 4603 mov r3, r0 + 8008876: b2db uxtb r3, r3 + 8008878: f003 033f and.w r3, r3, #63 @ 0x3f + 800887c: b2da uxtb r2, r3 + 800887e: 4b34 ldr r3, [pc, #208] @ (8008950 ) + 8008880: 701a strb r2, [r3, #0] + tcplen = p->tot_len; + 8008882: 687b ldr r3, [r7, #4] + 8008884: 891a ldrh r2, [r3, #8] + 8008886: 4b33 ldr r3, [pc, #204] @ (8008954 ) + 8008888: 801a strh r2, [r3, #0] + if (flags & (TCP_FIN | TCP_SYN)) { + 800888a: 4b31 ldr r3, [pc, #196] @ (8008950 ) + 800888c: 781b ldrb r3, [r3, #0] + 800888e: f003 0303 and.w r3, r3, #3 + 8008892: 2b00 cmp r3, #0 + 8008894: d00c beq.n 80088b0 + tcplen++; + 8008896: 4b2f ldr r3, [pc, #188] @ (8008954 ) + 8008898: 881b ldrh r3, [r3, #0] + 800889a: 3301 adds r3, #1 + 800889c: b29a uxth r2, r3 + 800889e: 4b2d ldr r3, [pc, #180] @ (8008954 ) + 80088a0: 801a strh r2, [r3, #0] + if (tcplen < p->tot_len) { + 80088a2: 687b ldr r3, [r7, #4] + 80088a4: 891a ldrh r2, [r3, #8] + 80088a6: 4b2b ldr r3, [pc, #172] @ (8008954 ) + 80088a8: 881b ldrh r3, [r3, #0] + 80088aa: 429a cmp r2, r3 + 80088ac: f200 82e6 bhi.w 8008e7c + } + } + + /* Demultiplex an incoming segment. First, we check if it is destined + for an active connection. */ + prev = NULL; + 80088b0: 2300 movs r3, #0 + 80088b2: 61bb str r3, [r7, #24] + + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + 80088b4: 4b28 ldr r3, [pc, #160] @ (8008958 ) + 80088b6: 681b ldr r3, [r3, #0] + 80088b8: 61fb str r3, [r7, #28] + 80088ba: e09d b.n 80089f8 + LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED); + 80088bc: 69fb ldr r3, [r7, #28] + 80088be: 7d1b ldrb r3, [r3, #20] + 80088c0: 2b00 cmp r3, #0 + 80088c2: d105 bne.n 80088d0 + 80088c4: 4b15 ldr r3, [pc, #84] @ (800891c ) + 80088c6: 22fb movs r2, #251 @ 0xfb + 80088c8: 4924 ldr r1, [pc, #144] @ (800895c ) + 80088ca: 4816 ldr r0, [pc, #88] @ (8008924 ) + 80088cc: f008 fe94 bl 80115f8 + LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT); + 80088d0: 69fb ldr r3, [r7, #28] + 80088d2: 7d1b ldrb r3, [r3, #20] + 80088d4: 2b0a cmp r3, #10 + 80088d6: d105 bne.n 80088e4 + 80088d8: 4b10 ldr r3, [pc, #64] @ (800891c ) + 80088da: 22fc movs r2, #252 @ 0xfc + 80088dc: 4920 ldr r1, [pc, #128] @ (8008960 ) + 80088de: 4811 ldr r0, [pc, #68] @ (8008924 ) + 80088e0: f008 fe8a bl 80115f8 + LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN); + 80088e4: 69fb ldr r3, [r7, #28] + 80088e6: 7d1b ldrb r3, [r3, #20] + 80088e8: 2b01 cmp r3, #1 + 80088ea: d105 bne.n 80088f8 + 80088ec: 4b0b ldr r3, [pc, #44] @ (800891c ) + 80088ee: 22fd movs r2, #253 @ 0xfd + 80088f0: 491c ldr r1, [pc, #112] @ (8008964 ) + 80088f2: 480c ldr r0, [pc, #48] @ (8008924 ) + 80088f4: f008 fe80 bl 80115f8 + + /* check if PCB is bound to specific netif */ + if ((pcb->netif_idx != NETIF_NO_INDEX) && + 80088f8: 69fb ldr r3, [r7, #28] + 80088fa: 7a1b ldrb r3, [r3, #8] + 80088fc: 2b00 cmp r3, #0 + 80088fe: d033 beq.n 8008968 + (pcb->netif_idx != netif_get_index(ip_data.current_input_netif))) { + 8008900: 69fb ldr r3, [r7, #28] + 8008902: 7a1a ldrb r2, [r3, #8] + 8008904: 4b09 ldr r3, [pc, #36] @ (800892c ) + 8008906: 685b ldr r3, [r3, #4] + 8008908: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 800890c: 3301 adds r3, #1 + 800890e: b2db uxtb r3, r3 + if ((pcb->netif_idx != NETIF_NO_INDEX) && + 8008910: 429a cmp r2, r3 + 8008912: d029 beq.n 8008968 + prev = pcb; + 8008914: 69fb ldr r3, [r7, #28] + 8008916: 61bb str r3, [r7, #24] + continue; + 8008918: e06b b.n 80089f2 + 800891a: bf00 nop + 800891c: 0801721c .word 0x0801721c + 8008920: 08017250 .word 0x08017250 + 8008924: 08017268 .word 0x08017268 + 8008928: 200190cc .word 0x200190cc + 800892c: 2000614c .word 0x2000614c + 8008930: 200190d0 .word 0x200190d0 + 8008934: 200190d4 .word 0x200190d4 + 8008938: 200190d2 .word 0x200190d2 + 800893c: 08017290 .word 0x08017290 + 8008940: 080172a0 .word 0x080172a0 + 8008944: 080172ac .word 0x080172ac + 8008948: 200190dc .word 0x200190dc + 800894c: 200190e0 .word 0x200190e0 + 8008950: 200190e8 .word 0x200190e8 + 8008954: 200190e6 .word 0x200190e6 + 8008958: 200190b0 .word 0x200190b0 + 800895c: 080172cc .word 0x080172cc + 8008960: 080172f4 .word 0x080172f4 + 8008964: 08017320 .word 0x08017320 + } + + if (pcb->remote_port == tcphdr->src && + 8008968: 69fb ldr r3, [r7, #28] + 800896a: 8b1a ldrh r2, [r3, #24] + 800896c: 4b72 ldr r3, [pc, #456] @ (8008b38 ) + 800896e: 681b ldr r3, [r3, #0] + 8008970: 881b ldrh r3, [r3, #0] + 8008972: b29b uxth r3, r3 + 8008974: 429a cmp r2, r3 + 8008976: d13a bne.n 80089ee + pcb->local_port == tcphdr->dest && + 8008978: 69fb ldr r3, [r7, #28] + 800897a: 8ada ldrh r2, [r3, #22] + 800897c: 4b6e ldr r3, [pc, #440] @ (8008b38 ) + 800897e: 681b ldr r3, [r3, #0] + 8008980: 885b ldrh r3, [r3, #2] + 8008982: b29b uxth r3, r3 + if (pcb->remote_port == tcphdr->src && + 8008984: 429a cmp r2, r3 + 8008986: d132 bne.n 80089ee + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()) && + 8008988: 69fb ldr r3, [r7, #28] + 800898a: 685a ldr r2, [r3, #4] + 800898c: 4b6b ldr r3, [pc, #428] @ (8008b3c ) + 800898e: 691b ldr r3, [r3, #16] + pcb->local_port == tcphdr->dest && + 8008990: 429a cmp r2, r3 + 8008992: d12c bne.n 80089ee + ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + 8008994: 69fb ldr r3, [r7, #28] + 8008996: 681a ldr r2, [r3, #0] + 8008998: 4b68 ldr r3, [pc, #416] @ (8008b3c ) + 800899a: 695b ldr r3, [r3, #20] + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()) && + 800899c: 429a cmp r2, r3 + 800899e: d126 bne.n 80089ee + /* Move this PCB to the front of the list so that subsequent + lookups will be faster (we exploit locality in TCP segment + arrivals). */ + LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb); + 80089a0: 69fb ldr r3, [r7, #28] + 80089a2: 68db ldr r3, [r3, #12] + 80089a4: 69fa ldr r2, [r7, #28] + 80089a6: 429a cmp r2, r3 + 80089a8: d106 bne.n 80089b8 + 80089aa: 4b65 ldr r3, [pc, #404] @ (8008b40 ) + 80089ac: f240 120d movw r2, #269 @ 0x10d + 80089b0: 4964 ldr r1, [pc, #400] @ (8008b44 ) + 80089b2: 4865 ldr r0, [pc, #404] @ (8008b48 ) + 80089b4: f008 fe20 bl 80115f8 + if (prev != NULL) { + 80089b8: 69bb ldr r3, [r7, #24] + 80089ba: 2b00 cmp r3, #0 + 80089bc: d00a beq.n 80089d4 + prev->next = pcb->next; + 80089be: 69fb ldr r3, [r7, #28] + 80089c0: 68da ldr r2, [r3, #12] + 80089c2: 69bb ldr r3, [r7, #24] + 80089c4: 60da str r2, [r3, #12] + pcb->next = tcp_active_pcbs; + 80089c6: 4b61 ldr r3, [pc, #388] @ (8008b4c ) + 80089c8: 681a ldr r2, [r3, #0] + 80089ca: 69fb ldr r3, [r7, #28] + 80089cc: 60da str r2, [r3, #12] + tcp_active_pcbs = pcb; + 80089ce: 4a5f ldr r2, [pc, #380] @ (8008b4c ) + 80089d0: 69fb ldr r3, [r7, #28] + 80089d2: 6013 str r3, [r2, #0] + } else { + TCP_STATS_INC(tcp.cachehit); + } + LWIP_ASSERT("tcp_input: pcb->next != pcb (after cache)", pcb->next != pcb); + 80089d4: 69fb ldr r3, [r7, #28] + 80089d6: 68db ldr r3, [r3, #12] + 80089d8: 69fa ldr r2, [r7, #28] + 80089da: 429a cmp r2, r3 + 80089dc: d111 bne.n 8008a02 + 80089de: 4b58 ldr r3, [pc, #352] @ (8008b40 ) + 80089e0: f240 1215 movw r2, #277 @ 0x115 + 80089e4: 495a ldr r1, [pc, #360] @ (8008b50 ) + 80089e6: 4858 ldr r0, [pc, #352] @ (8008b48 ) + 80089e8: f008 fe06 bl 80115f8 + break; + 80089ec: e009 b.n 8008a02 + } + prev = pcb; + 80089ee: 69fb ldr r3, [r7, #28] + 80089f0: 61bb str r3, [r7, #24] + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + 80089f2: 69fb ldr r3, [r7, #28] + 80089f4: 68db ldr r3, [r3, #12] + 80089f6: 61fb str r3, [r7, #28] + 80089f8: 69fb ldr r3, [r7, #28] + 80089fa: 2b00 cmp r3, #0 + 80089fc: f47f af5e bne.w 80088bc + 8008a00: e000 b.n 8008a04 + break; + 8008a02: bf00 nop + } + + if (pcb == NULL) { + 8008a04: 69fb ldr r3, [r7, #28] + 8008a06: 2b00 cmp r3, #0 + 8008a08: f040 80aa bne.w 8008b60 + /* If it did not go to an active connection, we check the connections + in the TIME-WAIT state. */ + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + 8008a0c: 4b51 ldr r3, [pc, #324] @ (8008b54 ) + 8008a0e: 681b ldr r3, [r3, #0] + 8008a10: 61fb str r3, [r7, #28] + 8008a12: e03f b.n 8008a94 + LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); + 8008a14: 69fb ldr r3, [r7, #28] + 8008a16: 7d1b ldrb r3, [r3, #20] + 8008a18: 2b0a cmp r3, #10 + 8008a1a: d006 beq.n 8008a2a + 8008a1c: 4b48 ldr r3, [pc, #288] @ (8008b40 ) + 8008a1e: f240 121f movw r2, #287 @ 0x11f + 8008a22: 494d ldr r1, [pc, #308] @ (8008b58 ) + 8008a24: 4848 ldr r0, [pc, #288] @ (8008b48 ) + 8008a26: f008 fde7 bl 80115f8 + + /* check if PCB is bound to specific netif */ + if ((pcb->netif_idx != NETIF_NO_INDEX) && + 8008a2a: 69fb ldr r3, [r7, #28] + 8008a2c: 7a1b ldrb r3, [r3, #8] + 8008a2e: 2b00 cmp r3, #0 + 8008a30: d009 beq.n 8008a46 + (pcb->netif_idx != netif_get_index(ip_data.current_input_netif))) { + 8008a32: 69fb ldr r3, [r7, #28] + 8008a34: 7a1a ldrb r2, [r3, #8] + 8008a36: 4b41 ldr r3, [pc, #260] @ (8008b3c ) + 8008a38: 685b ldr r3, [r3, #4] + 8008a3a: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8008a3e: 3301 adds r3, #1 + 8008a40: b2db uxtb r3, r3 + if ((pcb->netif_idx != NETIF_NO_INDEX) && + 8008a42: 429a cmp r2, r3 + 8008a44: d122 bne.n 8008a8c + continue; + } + + if (pcb->remote_port == tcphdr->src && + 8008a46: 69fb ldr r3, [r7, #28] + 8008a48: 8b1a ldrh r2, [r3, #24] + 8008a4a: 4b3b ldr r3, [pc, #236] @ (8008b38 ) + 8008a4c: 681b ldr r3, [r3, #0] + 8008a4e: 881b ldrh r3, [r3, #0] + 8008a50: b29b uxth r3, r3 + 8008a52: 429a cmp r2, r3 + 8008a54: d11b bne.n 8008a8e + pcb->local_port == tcphdr->dest && + 8008a56: 69fb ldr r3, [r7, #28] + 8008a58: 8ada ldrh r2, [r3, #22] + 8008a5a: 4b37 ldr r3, [pc, #220] @ (8008b38 ) + 8008a5c: 681b ldr r3, [r3, #0] + 8008a5e: 885b ldrh r3, [r3, #2] + 8008a60: b29b uxth r3, r3 + if (pcb->remote_port == tcphdr->src && + 8008a62: 429a cmp r2, r3 + 8008a64: d113 bne.n 8008a8e + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()) && + 8008a66: 69fb ldr r3, [r7, #28] + 8008a68: 685a ldr r2, [r3, #4] + 8008a6a: 4b34 ldr r3, [pc, #208] @ (8008b3c ) + 8008a6c: 691b ldr r3, [r3, #16] + pcb->local_port == tcphdr->dest && + 8008a6e: 429a cmp r2, r3 + 8008a70: d10d bne.n 8008a8e + ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + 8008a72: 69fb ldr r3, [r7, #28] + 8008a74: 681a ldr r2, [r3, #0] + 8008a76: 4b31 ldr r3, [pc, #196] @ (8008b3c ) + 8008a78: 695b ldr r3, [r3, #20] + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()) && + 8008a7a: 429a cmp r2, r3 + 8008a7c: d107 bne.n 8008a8e +#ifdef LWIP_HOOK_TCP_INPACKET_PCB + if (LWIP_HOOK_TCP_INPACKET_PCB(pcb, tcphdr, tcphdr_optlen, tcphdr_opt1len, + tcphdr_opt2, p) == ERR_OK) +#endif + { + tcp_timewait_input(pcb); + 8008a7e: 69f8 ldr r0, [r7, #28] + 8008a80: f000 fb56 bl 8009130 + } + pbuf_free(p); + 8008a84: 6878 ldr r0, [r7, #4] + 8008a86: f7fd ffcf bl 8006a28 + return; + 8008a8a: e1fd b.n 8008e88 + continue; + 8008a8c: bf00 nop + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + 8008a8e: 69fb ldr r3, [r7, #28] + 8008a90: 68db ldr r3, [r3, #12] + 8008a92: 61fb str r3, [r7, #28] + 8008a94: 69fb ldr r3, [r7, #28] + 8008a96: 2b00 cmp r3, #0 + 8008a98: d1bc bne.n 8008a14 + } + } + + /* Finally, if we still did not get a match, we check all PCBs that + are LISTENing for incoming connections. */ + prev = NULL; + 8008a9a: 2300 movs r3, #0 + 8008a9c: 61bb str r3, [r7, #24] + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + 8008a9e: 4b2f ldr r3, [pc, #188] @ (8008b5c ) + 8008aa0: 681b ldr r3, [r3, #0] + 8008aa2: 617b str r3, [r7, #20] + 8008aa4: e02a b.n 8008afc + /* check if PCB is bound to specific netif */ + if ((lpcb->netif_idx != NETIF_NO_INDEX) && + 8008aa6: 697b ldr r3, [r7, #20] + 8008aa8: 7a1b ldrb r3, [r3, #8] + 8008aaa: 2b00 cmp r3, #0 + 8008aac: d00c beq.n 8008ac8 + (lpcb->netif_idx != netif_get_index(ip_data.current_input_netif))) { + 8008aae: 697b ldr r3, [r7, #20] + 8008ab0: 7a1a ldrb r2, [r3, #8] + 8008ab2: 4b22 ldr r3, [pc, #136] @ (8008b3c ) + 8008ab4: 685b ldr r3, [r3, #4] + 8008ab6: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 8008aba: 3301 adds r3, #1 + 8008abc: b2db uxtb r3, r3 + if ((lpcb->netif_idx != NETIF_NO_INDEX) && + 8008abe: 429a cmp r2, r3 + 8008ac0: d002 beq.n 8008ac8 + prev = (struct tcp_pcb *)lpcb; + 8008ac2: 697b ldr r3, [r7, #20] + 8008ac4: 61bb str r3, [r7, #24] + continue; + 8008ac6: e016 b.n 8008af6 + } + + if (lpcb->local_port == tcphdr->dest) { + 8008ac8: 697b ldr r3, [r7, #20] + 8008aca: 8ada ldrh r2, [r3, #22] + 8008acc: 4b1a ldr r3, [pc, #104] @ (8008b38 ) + 8008ace: 681b ldr r3, [r3, #0] + 8008ad0: 885b ldrh r3, [r3, #2] + 8008ad2: b29b uxth r3, r3 + 8008ad4: 429a cmp r2, r3 + 8008ad6: d10c bne.n 8008af2 + lpcb_prev = prev; +#else /* SO_REUSE */ + break; +#endif /* SO_REUSE */ + } else if (IP_ADDR_PCB_VERSION_MATCH_EXACT(lpcb, ip_current_dest_addr())) { + if (ip_addr_cmp(&lpcb->local_ip, ip_current_dest_addr())) { + 8008ad8: 697b ldr r3, [r7, #20] + 8008ada: 681a ldr r2, [r3, #0] + 8008adc: 4b17 ldr r3, [pc, #92] @ (8008b3c ) + 8008ade: 695b ldr r3, [r3, #20] + 8008ae0: 429a cmp r2, r3 + 8008ae2: d00f beq.n 8008b04 + /* found an exact match */ + break; + } else if (ip_addr_isany(&lpcb->local_ip)) { + 8008ae4: 697b ldr r3, [r7, #20] + 8008ae6: 2b00 cmp r3, #0 + 8008ae8: d00d beq.n 8008b06 + 8008aea: 697b ldr r3, [r7, #20] + 8008aec: 681b ldr r3, [r3, #0] + 8008aee: 2b00 cmp r3, #0 + 8008af0: d009 beq.n 8008b06 + break; +#endif /* SO_REUSE */ + } + } + } + prev = (struct tcp_pcb *)lpcb; + 8008af2: 697b ldr r3, [r7, #20] + 8008af4: 61bb str r3, [r7, #24] + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + 8008af6: 697b ldr r3, [r7, #20] + 8008af8: 68db ldr r3, [r3, #12] + 8008afa: 617b str r3, [r7, #20] + 8008afc: 697b ldr r3, [r7, #20] + 8008afe: 2b00 cmp r3, #0 + 8008b00: d1d1 bne.n 8008aa6 + 8008b02: e000 b.n 8008b06 + break; + 8008b04: bf00 nop + /* only pass to ANY if no specific local IP has been found */ + lpcb = lpcb_any; + prev = lpcb_prev; + } +#endif /* SO_REUSE */ + if (lpcb != NULL) { + 8008b06: 697b ldr r3, [r7, #20] + 8008b08: 2b00 cmp r3, #0 + 8008b0a: d029 beq.n 8008b60 + /* Move this PCB to the front of the list so that subsequent + lookups will be faster (we exploit locality in TCP segment + arrivals). */ + if (prev != NULL) { + 8008b0c: 69bb ldr r3, [r7, #24] + 8008b0e: 2b00 cmp r3, #0 + 8008b10: d00a beq.n 8008b28 + ((struct tcp_pcb_listen *)prev)->next = lpcb->next; + 8008b12: 697b ldr r3, [r7, #20] + 8008b14: 68da ldr r2, [r3, #12] + 8008b16: 69bb ldr r3, [r7, #24] + 8008b18: 60da str r2, [r3, #12] + /* our successor is the remainder of the listening list */ + lpcb->next = tcp_listen_pcbs.listen_pcbs; + 8008b1a: 4b10 ldr r3, [pc, #64] @ (8008b5c ) + 8008b1c: 681a ldr r2, [r3, #0] + 8008b1e: 697b ldr r3, [r7, #20] + 8008b20: 60da str r2, [r3, #12] + /* put this listening pcb at the head of the listening list */ + tcp_listen_pcbs.listen_pcbs = lpcb; + 8008b22: 4a0e ldr r2, [pc, #56] @ (8008b5c ) + 8008b24: 697b ldr r3, [r7, #20] + 8008b26: 6013 str r3, [r2, #0] +#ifdef LWIP_HOOK_TCP_INPACKET_PCB + if (LWIP_HOOK_TCP_INPACKET_PCB((struct tcp_pcb *)lpcb, tcphdr, tcphdr_optlen, + tcphdr_opt1len, tcphdr_opt2, p) == ERR_OK) +#endif + { + tcp_listen_input(lpcb); + 8008b28: 6978 ldr r0, [r7, #20] + 8008b2a: f000 fa03 bl 8008f34 + } + pbuf_free(p); + 8008b2e: 6878 ldr r0, [r7, #4] + 8008b30: f7fd ff7a bl 8006a28 + return; + 8008b34: e1a8 b.n 8008e88 + 8008b36: bf00 nop + 8008b38: 200190cc .word 0x200190cc + 8008b3c: 2000614c .word 0x2000614c + 8008b40: 0801721c .word 0x0801721c + 8008b44: 08017348 .word 0x08017348 + 8008b48: 08017268 .word 0x08017268 + 8008b4c: 200190b0 .word 0x200190b0 + 8008b50: 08017374 .word 0x08017374 + 8008b54: 200190b4 .word 0x200190b4 + 8008b58: 080173a0 .word 0x080173a0 + 8008b5c: 200190ac .word 0x200190ac + tcphdr_opt1len, tcphdr_opt2, p) != ERR_OK) { + pbuf_free(p); + return; + } +#endif + if (pcb != NULL) { + 8008b60: 69fb ldr r3, [r7, #28] + 8008b62: 2b00 cmp r3, #0 + 8008b64: f000 8158 beq.w 8008e18 +#if TCP_INPUT_DEBUG + tcp_debug_print_state(pcb->state); +#endif /* TCP_INPUT_DEBUG */ + + /* Set up a tcp_seg structure. */ + inseg.next = NULL; + 8008b68: 4b95 ldr r3, [pc, #596] @ (8008dc0 ) + 8008b6a: 2200 movs r2, #0 + 8008b6c: 601a str r2, [r3, #0] + inseg.len = p->tot_len; + 8008b6e: 687b ldr r3, [r7, #4] + 8008b70: 891a ldrh r2, [r3, #8] + 8008b72: 4b93 ldr r3, [pc, #588] @ (8008dc0 ) + 8008b74: 811a strh r2, [r3, #8] + inseg.p = p; + 8008b76: 4a92 ldr r2, [pc, #584] @ (8008dc0 ) + 8008b78: 687b ldr r3, [r7, #4] + 8008b7a: 6053 str r3, [r2, #4] + inseg.tcphdr = tcphdr; + 8008b7c: 4b91 ldr r3, [pc, #580] @ (8008dc4 ) + 8008b7e: 681b ldr r3, [r3, #0] + 8008b80: 4a8f ldr r2, [pc, #572] @ (8008dc0 ) + 8008b82: 60d3 str r3, [r2, #12] + + recv_data = NULL; + 8008b84: 4b90 ldr r3, [pc, #576] @ (8008dc8 ) + 8008b86: 2200 movs r2, #0 + 8008b88: 601a str r2, [r3, #0] + recv_flags = 0; + 8008b8a: 4b90 ldr r3, [pc, #576] @ (8008dcc ) + 8008b8c: 2200 movs r2, #0 + 8008b8e: 701a strb r2, [r3, #0] + recv_acked = 0; + 8008b90: 4b8f ldr r3, [pc, #572] @ (8008dd0 ) + 8008b92: 2200 movs r2, #0 + 8008b94: 801a strh r2, [r3, #0] + + if (flags & TCP_PSH) { + 8008b96: 4b8f ldr r3, [pc, #572] @ (8008dd4 ) + 8008b98: 781b ldrb r3, [r3, #0] + 8008b9a: f003 0308 and.w r3, r3, #8 + 8008b9e: 2b00 cmp r3, #0 + 8008ba0: d006 beq.n 8008bb0 + p->flags |= PBUF_FLAG_PUSH; + 8008ba2: 687b ldr r3, [r7, #4] + 8008ba4: 7b5b ldrb r3, [r3, #13] + 8008ba6: f043 0301 orr.w r3, r3, #1 + 8008baa: b2da uxtb r2, r3 + 8008bac: 687b ldr r3, [r7, #4] + 8008bae: 735a strb r2, [r3, #13] + } + + /* If there is data which was previously "refused" by upper layer */ + if (pcb->refused_data != NULL) { + 8008bb0: 69fb ldr r3, [r7, #28] + 8008bb2: 6f9b ldr r3, [r3, #120] @ 0x78 + 8008bb4: 2b00 cmp r3, #0 + 8008bb6: d017 beq.n 8008be8 + if ((tcp_process_refused_data(pcb) == ERR_ABRT) || + 8008bb8: 69f8 ldr r0, [r7, #28] + 8008bba: f7ff f929 bl 8007e10 + 8008bbe: 4603 mov r3, r0 + 8008bc0: f113 0f0d cmn.w r3, #13 + 8008bc4: d007 beq.n 8008bd6 + ((pcb->refused_data != NULL) && (tcplen > 0))) { + 8008bc6: 69fb ldr r3, [r7, #28] + 8008bc8: 6f9b ldr r3, [r3, #120] @ 0x78 + if ((tcp_process_refused_data(pcb) == ERR_ABRT) || + 8008bca: 2b00 cmp r3, #0 + 8008bcc: d00c beq.n 8008be8 + ((pcb->refused_data != NULL) && (tcplen > 0))) { + 8008bce: 4b82 ldr r3, [pc, #520] @ (8008dd8 ) + 8008bd0: 881b ldrh r3, [r3, #0] + 8008bd2: 2b00 cmp r3, #0 + 8008bd4: d008 beq.n 8008be8 + /* pcb has been aborted or refused data is still refused and the new + segment contains data */ + if (pcb->rcv_ann_wnd == 0) { + 8008bd6: 69fb ldr r3, [r7, #28] + 8008bd8: 8d5b ldrh r3, [r3, #42] @ 0x2a + 8008bda: 2b00 cmp r3, #0 + 8008bdc: f040 80e3 bne.w 8008da6 + /* this is a zero-window probe, we respond to it with current RCV.NXT + and drop the data segment */ + tcp_send_empty_ack(pcb); + 8008be0: 69f8 ldr r0, [r7, #28] + 8008be2: f003 f9a7 bl 800bf34 + } + TCP_STATS_INC(tcp.drop); + MIB2_STATS_INC(mib2.tcpinerrs); + goto aborted; + 8008be6: e0de b.n 8008da6 + } + } + tcp_input_pcb = pcb; + 8008be8: 4a7c ldr r2, [pc, #496] @ (8008ddc ) + 8008bea: 69fb ldr r3, [r7, #28] + 8008bec: 6013 str r3, [r2, #0] + err = tcp_process(pcb); + 8008bee: 69f8 ldr r0, [r7, #28] + 8008bf0: f000 fb18 bl 8009224 + 8008bf4: 4603 mov r3, r0 + 8008bf6: 74fb strb r3, [r7, #19] + /* A return value of ERR_ABRT means that tcp_abort() was called + and that the pcb has been freed. If so, we don't do anything. */ + if (err != ERR_ABRT) { + 8008bf8: f997 3013 ldrsb.w r3, [r7, #19] + 8008bfc: f113 0f0d cmn.w r3, #13 + 8008c00: f000 80d3 beq.w 8008daa + if (recv_flags & TF_RESET) { + 8008c04: 4b71 ldr r3, [pc, #452] @ (8008dcc ) + 8008c06: 781b ldrb r3, [r3, #0] + 8008c08: f003 0308 and.w r3, r3, #8 + 8008c0c: 2b00 cmp r3, #0 + 8008c0e: d015 beq.n 8008c3c + /* TF_RESET means that the connection was reset by the other + end. We then call the error callback to inform the + application that the connection is dead before we + deallocate the PCB. */ + TCP_EVENT_ERR(pcb->state, pcb->errf, pcb->callback_arg, ERR_RST); + 8008c10: 69fb ldr r3, [r7, #28] + 8008c12: f8d3 3090 ldr.w r3, [r3, #144] @ 0x90 + 8008c16: 2b00 cmp r3, #0 + 8008c18: d008 beq.n 8008c2c + 8008c1a: 69fb ldr r3, [r7, #28] + 8008c1c: f8d3 3090 ldr.w r3, [r3, #144] @ 0x90 + 8008c20: 69fa ldr r2, [r7, #28] + 8008c22: 6912 ldr r2, [r2, #16] + 8008c24: f06f 010d mvn.w r1, #13 + 8008c28: 4610 mov r0, r2 + 8008c2a: 4798 blx r3 + tcp_pcb_remove(&tcp_active_pcbs, pcb); + 8008c2c: 69f9 ldr r1, [r7, #28] + 8008c2e: 486c ldr r0, [pc, #432] @ (8008de0 ) + 8008c30: f7ff fbbc bl 80083ac + tcp_free(pcb); + 8008c34: 69f8 ldr r0, [r7, #28] + 8008c36: f7fe f9a7 bl 8006f88 + 8008c3a: e0da b.n 8008df2 + } else { + err = ERR_OK; + 8008c3c: 2300 movs r3, #0 + 8008c3e: 74fb strb r3, [r7, #19] + /* If the application has registered a "sent" function to be + called when new send buffer space is available, we call it + now. */ + if (recv_acked > 0) { + 8008c40: 4b63 ldr r3, [pc, #396] @ (8008dd0 ) + 8008c42: 881b ldrh r3, [r3, #0] + 8008c44: 2b00 cmp r3, #0 + 8008c46: d01d beq.n 8008c84 + while (acked > 0) { + acked16 = (u16_t)LWIP_MIN(acked, 0xffffu); + acked -= acked16; +#else + { + acked16 = recv_acked; + 8008c48: 4b61 ldr r3, [pc, #388] @ (8008dd0 ) + 8008c4a: 881b ldrh r3, [r3, #0] + 8008c4c: 81fb strh r3, [r7, #14] +#endif + TCP_EVENT_SENT(pcb, (u16_t)acked16, err); + 8008c4e: 69fb ldr r3, [r7, #28] + 8008c50: f8d3 3080 ldr.w r3, [r3, #128] @ 0x80 + 8008c54: 2b00 cmp r3, #0 + 8008c56: d00a beq.n 8008c6e + 8008c58: 69fb ldr r3, [r7, #28] + 8008c5a: f8d3 3080 ldr.w r3, [r3, #128] @ 0x80 + 8008c5e: 69fa ldr r2, [r7, #28] + 8008c60: 6910 ldr r0, [r2, #16] + 8008c62: 89fa ldrh r2, [r7, #14] + 8008c64: 69f9 ldr r1, [r7, #28] + 8008c66: 4798 blx r3 + 8008c68: 4603 mov r3, r0 + 8008c6a: 74fb strb r3, [r7, #19] + 8008c6c: e001 b.n 8008c72 + 8008c6e: 2300 movs r3, #0 + 8008c70: 74fb strb r3, [r7, #19] + if (err == ERR_ABRT) { + 8008c72: f997 3013 ldrsb.w r3, [r7, #19] + 8008c76: f113 0f0d cmn.w r3, #13 + 8008c7a: f000 8098 beq.w 8008dae + goto aborted; + } + } + recv_acked = 0; + 8008c7e: 4b54 ldr r3, [pc, #336] @ (8008dd0 ) + 8008c80: 2200 movs r2, #0 + 8008c82: 801a strh r2, [r3, #0] + } + if (tcp_input_delayed_close(pcb)) { + 8008c84: 69f8 ldr r0, [r7, #28] + 8008c86: f000 f915 bl 8008eb4 + 8008c8a: 4603 mov r3, r0 + 8008c8c: 2b00 cmp r3, #0 + 8008c8e: f040 8090 bne.w 8008db2 +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + while (recv_data != NULL) { + struct pbuf *rest = NULL; + pbuf_split_64k(recv_data, &rest); +#else /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + if (recv_data != NULL) { + 8008c92: 4b4d ldr r3, [pc, #308] @ (8008dc8 ) + 8008c94: 681b ldr r3, [r3, #0] + 8008c96: 2b00 cmp r3, #0 + 8008c98: d041 beq.n 8008d1e +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + + LWIP_ASSERT("pcb->refused_data == NULL", pcb->refused_data == NULL); + 8008c9a: 69fb ldr r3, [r7, #28] + 8008c9c: 6f9b ldr r3, [r3, #120] @ 0x78 + 8008c9e: 2b00 cmp r3, #0 + 8008ca0: d006 beq.n 8008cb0 + 8008ca2: 4b50 ldr r3, [pc, #320] @ (8008de4 ) + 8008ca4: f44f 72f3 mov.w r2, #486 @ 0x1e6 + 8008ca8: 494f ldr r1, [pc, #316] @ (8008de8 ) + 8008caa: 4850 ldr r0, [pc, #320] @ (8008dec ) + 8008cac: f008 fca4 bl 80115f8 + if (pcb->flags & TF_RXCLOSED) { + 8008cb0: 69fb ldr r3, [r7, #28] + 8008cb2: 8b5b ldrh r3, [r3, #26] + 8008cb4: f003 0310 and.w r3, r3, #16 + 8008cb8: 2b00 cmp r3, #0 + 8008cba: d008 beq.n 8008cce + /* received data although already closed -> abort (send RST) to + notify the remote host that not all data has been processed */ + pbuf_free(recv_data); + 8008cbc: 4b42 ldr r3, [pc, #264] @ (8008dc8 ) + 8008cbe: 681b ldr r3, [r3, #0] + 8008cc0: 4618 mov r0, r3 + 8008cc2: f7fd feb1 bl 8006a28 +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_free(rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + tcp_abort(pcb); + 8008cc6: 69f8 ldr r0, [r7, #28] + 8008cc8: f7fe fc46 bl 8007558 + goto aborted; + 8008ccc: e091 b.n 8008df2 + } + + /* Notify application that data has been received. */ + TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err); + 8008cce: 69fb ldr r3, [r7, #28] + 8008cd0: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8008cd4: 2b00 cmp r3, #0 + 8008cd6: d00c beq.n 8008cf2 + 8008cd8: 69fb ldr r3, [r7, #28] + 8008cda: f8d3 4084 ldr.w r4, [r3, #132] @ 0x84 + 8008cde: 69fb ldr r3, [r7, #28] + 8008ce0: 6918 ldr r0, [r3, #16] + 8008ce2: 4b39 ldr r3, [pc, #228] @ (8008dc8 ) + 8008ce4: 681a ldr r2, [r3, #0] + 8008ce6: 2300 movs r3, #0 + 8008ce8: 69f9 ldr r1, [r7, #28] + 8008cea: 47a0 blx r4 + 8008cec: 4603 mov r3, r0 + 8008cee: 74fb strb r3, [r7, #19] + 8008cf0: e008 b.n 8008d04 + 8008cf2: 4b35 ldr r3, [pc, #212] @ (8008dc8 ) + 8008cf4: 681a ldr r2, [r3, #0] + 8008cf6: 2300 movs r3, #0 + 8008cf8: 69f9 ldr r1, [r7, #28] + 8008cfa: 2000 movs r0, #0 + 8008cfc: f7ff f95e bl 8007fbc + 8008d00: 4603 mov r3, r0 + 8008d02: 74fb strb r3, [r7, #19] + if (err == ERR_ABRT) { + 8008d04: f997 3013 ldrsb.w r3, [r7, #19] + 8008d08: f113 0f0d cmn.w r3, #13 + 8008d0c: d053 beq.n 8008db6 +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + goto aborted; + } + + /* If the upper layer can't receive this data, store it */ + if (err != ERR_OK) { + 8008d0e: f997 3013 ldrsb.w r3, [r7, #19] + 8008d12: 2b00 cmp r3, #0 + 8008d14: d003 beq.n 8008d1e +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_cat(recv_data, rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + pcb->refused_data = recv_data; + 8008d16: 4b2c ldr r3, [pc, #176] @ (8008dc8 ) + 8008d18: 681a ldr r2, [r3, #0] + 8008d1a: 69fb ldr r3, [r7, #28] + 8008d1c: 679a str r2, [r3, #120] @ 0x78 + } + } + + /* If a FIN segment was received, we call the callback + function with a NULL buffer to indicate EOF. */ + if (recv_flags & TF_GOT_FIN) { + 8008d1e: 4b2b ldr r3, [pc, #172] @ (8008dcc ) + 8008d20: 781b ldrb r3, [r3, #0] + 8008d22: f003 0320 and.w r3, r3, #32 + 8008d26: 2b00 cmp r3, #0 + 8008d28: d030 beq.n 8008d8c + if (pcb->refused_data != NULL) { + 8008d2a: 69fb ldr r3, [r7, #28] + 8008d2c: 6f9b ldr r3, [r3, #120] @ 0x78 + 8008d2e: 2b00 cmp r3, #0 + 8008d30: d009 beq.n 8008d46 + /* Delay this if we have refused data. */ + pcb->refused_data->flags |= PBUF_FLAG_TCP_FIN; + 8008d32: 69fb ldr r3, [r7, #28] + 8008d34: 6f9b ldr r3, [r3, #120] @ 0x78 + 8008d36: 7b5a ldrb r2, [r3, #13] + 8008d38: 69fb ldr r3, [r7, #28] + 8008d3a: 6f9b ldr r3, [r3, #120] @ 0x78 + 8008d3c: f042 0220 orr.w r2, r2, #32 + 8008d40: b2d2 uxtb r2, r2 + 8008d42: 735a strb r2, [r3, #13] + 8008d44: e022 b.n 8008d8c + } else { + /* correct rcv_wnd as the application won't call tcp_recved() + for the FIN's seqno */ + if (pcb->rcv_wnd != TCP_WND_MAX(pcb)) { + 8008d46: 69fb ldr r3, [r7, #28] + 8008d48: 8d1b ldrh r3, [r3, #40] @ 0x28 + 8008d4a: f5b3 6f06 cmp.w r3, #2144 @ 0x860 + 8008d4e: d005 beq.n 8008d5c + pcb->rcv_wnd++; + 8008d50: 69fb ldr r3, [r7, #28] + 8008d52: 8d1b ldrh r3, [r3, #40] @ 0x28 + 8008d54: 3301 adds r3, #1 + 8008d56: b29a uxth r2, r3 + 8008d58: 69fb ldr r3, [r7, #28] + 8008d5a: 851a strh r2, [r3, #40] @ 0x28 + } + TCP_EVENT_CLOSED(pcb, err); + 8008d5c: 69fb ldr r3, [r7, #28] + 8008d5e: f8d3 3084 ldr.w r3, [r3, #132] @ 0x84 + 8008d62: 2b00 cmp r3, #0 + 8008d64: d00b beq.n 8008d7e + 8008d66: 69fb ldr r3, [r7, #28] + 8008d68: f8d3 4084 ldr.w r4, [r3, #132] @ 0x84 + 8008d6c: 69fb ldr r3, [r7, #28] + 8008d6e: 6918 ldr r0, [r3, #16] + 8008d70: 2300 movs r3, #0 + 8008d72: 2200 movs r2, #0 + 8008d74: 69f9 ldr r1, [r7, #28] + 8008d76: 47a0 blx r4 + 8008d78: 4603 mov r3, r0 + 8008d7a: 74fb strb r3, [r7, #19] + 8008d7c: e001 b.n 8008d82 + 8008d7e: 2300 movs r3, #0 + 8008d80: 74fb strb r3, [r7, #19] + if (err == ERR_ABRT) { + 8008d82: f997 3013 ldrsb.w r3, [r7, #19] + 8008d86: f113 0f0d cmn.w r3, #13 + 8008d8a: d016 beq.n 8008dba + goto aborted; + } + } + } + + tcp_input_pcb = NULL; + 8008d8c: 4b13 ldr r3, [pc, #76] @ (8008ddc ) + 8008d8e: 2200 movs r2, #0 + 8008d90: 601a str r2, [r3, #0] + if (tcp_input_delayed_close(pcb)) { + 8008d92: 69f8 ldr r0, [r7, #28] + 8008d94: f000 f88e bl 8008eb4 + 8008d98: 4603 mov r3, r0 + 8008d9a: 2b00 cmp r3, #0 + 8008d9c: d128 bne.n 8008df0 + goto aborted; + } + /* Try to send something out. */ + tcp_output(pcb); + 8008d9e: 69f8 ldr r0, [r7, #28] + 8008da0: f002 fac2 bl 800b328 + 8008da4: e025 b.n 8008df2 + goto aborted; + 8008da6: bf00 nop + 8008da8: e023 b.n 8008df2 +#endif /* TCP_INPUT_DEBUG */ + } + } + /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()). + Below this line, 'pcb' may not be dereferenced! */ +aborted: + 8008daa: bf00 nop + 8008dac: e021 b.n 8008df2 + goto aborted; + 8008dae: bf00 nop + 8008db0: e01f b.n 8008df2 + goto aborted; + 8008db2: bf00 nop + 8008db4: e01d b.n 8008df2 + goto aborted; + 8008db6: bf00 nop + 8008db8: e01b b.n 8008df2 + goto aborted; + 8008dba: bf00 nop + 8008dbc: e019 b.n 8008df2 + 8008dbe: bf00 nop + 8008dc0: 200190bc .word 0x200190bc + 8008dc4: 200190cc .word 0x200190cc + 8008dc8: 200190ec .word 0x200190ec + 8008dcc: 200190e9 .word 0x200190e9 + 8008dd0: 200190e4 .word 0x200190e4 + 8008dd4: 200190e8 .word 0x200190e8 + 8008dd8: 200190e6 .word 0x200190e6 + 8008ddc: 200190f0 .word 0x200190f0 + 8008de0: 200190b0 .word 0x200190b0 + 8008de4: 0801721c .word 0x0801721c + 8008de8: 080173d0 .word 0x080173d0 + 8008dec: 08017268 .word 0x08017268 + goto aborted; + 8008df0: bf00 nop + tcp_input_pcb = NULL; + 8008df2: 4b27 ldr r3, [pc, #156] @ (8008e90 ) + 8008df4: 2200 movs r2, #0 + 8008df6: 601a str r2, [r3, #0] + recv_data = NULL; + 8008df8: 4b26 ldr r3, [pc, #152] @ (8008e94 ) + 8008dfa: 2200 movs r2, #0 + 8008dfc: 601a str r2, [r3, #0] + + /* give up our reference to inseg.p */ + if (inseg.p != NULL) { + 8008dfe: 4b26 ldr r3, [pc, #152] @ (8008e98 ) + 8008e00: 685b ldr r3, [r3, #4] + 8008e02: 2b00 cmp r3, #0 + 8008e04: d03f beq.n 8008e86 + pbuf_free(inseg.p); + 8008e06: 4b24 ldr r3, [pc, #144] @ (8008e98 ) + 8008e08: 685b ldr r3, [r3, #4] + 8008e0a: 4618 mov r0, r3 + 8008e0c: f7fd fe0c bl 8006a28 + inseg.p = NULL; + 8008e10: 4b21 ldr r3, [pc, #132] @ (8008e98 ) + 8008e12: 2200 movs r2, #0 + 8008e14: 605a str r2, [r3, #4] + pbuf_free(p); + } + + LWIP_ASSERT("tcp_input: tcp_pcbs_sane()", tcp_pcbs_sane()); + PERF_STOP("tcp_input"); + return; + 8008e16: e036 b.n 8008e86 + if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) { + 8008e18: 4b20 ldr r3, [pc, #128] @ (8008e9c ) + 8008e1a: 681b ldr r3, [r3, #0] + 8008e1c: 899b ldrh r3, [r3, #12] + 8008e1e: b29b uxth r3, r3 + 8008e20: 4618 mov r0, r3 + 8008e22: f7fc fab1 bl 8005388 + 8008e26: 4603 mov r3, r0 + 8008e28: b2db uxtb r3, r3 + 8008e2a: f003 0304 and.w r3, r3, #4 + 8008e2e: 2b00 cmp r3, #0 + 8008e30: d118 bne.n 8008e64 + tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(), + 8008e32: 4b1b ldr r3, [pc, #108] @ (8008ea0 ) + 8008e34: 6819 ldr r1, [r3, #0] + 8008e36: 4b1b ldr r3, [pc, #108] @ (8008ea4 ) + 8008e38: 881b ldrh r3, [r3, #0] + 8008e3a: 461a mov r2, r3 + 8008e3c: 4b1a ldr r3, [pc, #104] @ (8008ea8 ) + 8008e3e: 681b ldr r3, [r3, #0] + 8008e40: 18d0 adds r0, r2, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8008e42: 4b16 ldr r3, [pc, #88] @ (8008e9c ) + 8008e44: 681b ldr r3, [r3, #0] + tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(), + 8008e46: 885b ldrh r3, [r3, #2] + 8008e48: b29b uxth r3, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8008e4a: 4a14 ldr r2, [pc, #80] @ (8008e9c ) + 8008e4c: 6812 ldr r2, [r2, #0] + tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(), + 8008e4e: 8812 ldrh r2, [r2, #0] + 8008e50: b292 uxth r2, r2 + 8008e52: 9202 str r2, [sp, #8] + 8008e54: 9301 str r3, [sp, #4] + 8008e56: 4b15 ldr r3, [pc, #84] @ (8008eac ) + 8008e58: 9300 str r3, [sp, #0] + 8008e5a: 4b15 ldr r3, [pc, #84] @ (8008eb0 ) + 8008e5c: 4602 mov r2, r0 + 8008e5e: 2000 movs r0, #0 + 8008e60: f003 f816 bl 800be90 + pbuf_free(p); + 8008e64: 6878 ldr r0, [r7, #4] + 8008e66: f7fd fddf bl 8006a28 + return; + 8008e6a: e00c b.n 8008e86 + goto dropped; + 8008e6c: bf00 nop + 8008e6e: e006 b.n 8008e7e + goto dropped; + 8008e70: bf00 nop + 8008e72: e004 b.n 8008e7e + goto dropped; + 8008e74: bf00 nop + 8008e76: e002 b.n 8008e7e + goto dropped; + 8008e78: bf00 nop + 8008e7a: e000 b.n 8008e7e + goto dropped; + 8008e7c: bf00 nop +dropped: + TCP_STATS_INC(tcp.drop); + MIB2_STATS_INC(mib2.tcpinerrs); + pbuf_free(p); + 8008e7e: 6878 ldr r0, [r7, #4] + 8008e80: f7fd fdd2 bl 8006a28 + 8008e84: e000 b.n 8008e88 + return; + 8008e86: bf00 nop +} + 8008e88: 3724 adds r7, #36 @ 0x24 + 8008e8a: 46bd mov sp, r7 + 8008e8c: bd90 pop {r4, r7, pc} + 8008e8e: bf00 nop + 8008e90: 200190f0 .word 0x200190f0 + 8008e94: 200190ec .word 0x200190ec + 8008e98: 200190bc .word 0x200190bc + 8008e9c: 200190cc .word 0x200190cc + 8008ea0: 200190e0 .word 0x200190e0 + 8008ea4: 200190e6 .word 0x200190e6 + 8008ea8: 200190dc .word 0x200190dc + 8008eac: 2000615c .word 0x2000615c + 8008eb0: 20006160 .word 0x20006160 + +08008eb4 : + * any more. + * @returns 1 if the pcb has been closed and deallocated, 0 otherwise + */ +static int +tcp_input_delayed_close(struct tcp_pcb *pcb) +{ + 8008eb4: b580 push {r7, lr} + 8008eb6: b082 sub sp, #8 + 8008eb8: af00 add r7, sp, #0 + 8008eba: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_input_delayed_close: invalid pcb", pcb != NULL); + 8008ebc: 687b ldr r3, [r7, #4] + 8008ebe: 2b00 cmp r3, #0 + 8008ec0: d106 bne.n 8008ed0 + 8008ec2: 4b17 ldr r3, [pc, #92] @ (8008f20 ) + 8008ec4: f240 225a movw r2, #602 @ 0x25a + 8008ec8: 4916 ldr r1, [pc, #88] @ (8008f24 ) + 8008eca: 4817 ldr r0, [pc, #92] @ (8008f28 ) + 8008ecc: f008 fb94 bl 80115f8 + + if (recv_flags & TF_CLOSED) { + 8008ed0: 4b16 ldr r3, [pc, #88] @ (8008f2c ) + 8008ed2: 781b ldrb r3, [r3, #0] + 8008ed4: f003 0310 and.w r3, r3, #16 + 8008ed8: 2b00 cmp r3, #0 + 8008eda: d01c beq.n 8008f16 + /* The connection has been closed and we will deallocate the + PCB. */ + if (!(pcb->flags & TF_RXCLOSED)) { + 8008edc: 687b ldr r3, [r7, #4] + 8008ede: 8b5b ldrh r3, [r3, #26] + 8008ee0: f003 0310 and.w r3, r3, #16 + 8008ee4: 2b00 cmp r3, #0 + 8008ee6: d10d bne.n 8008f04 + /* Connection closed although the application has only shut down the + tx side: call the PCB's err callback and indicate the closure to + ensure the application doesn't continue using the PCB. */ + TCP_EVENT_ERR(pcb->state, pcb->errf, pcb->callback_arg, ERR_CLSD); + 8008ee8: 687b ldr r3, [r7, #4] + 8008eea: f8d3 3090 ldr.w r3, [r3, #144] @ 0x90 + 8008eee: 2b00 cmp r3, #0 + 8008ef0: d008 beq.n 8008f04 + 8008ef2: 687b ldr r3, [r7, #4] + 8008ef4: f8d3 3090 ldr.w r3, [r3, #144] @ 0x90 + 8008ef8: 687a ldr r2, [r7, #4] + 8008efa: 6912 ldr r2, [r2, #16] + 8008efc: f06f 010e mvn.w r1, #14 + 8008f00: 4610 mov r0, r2 + 8008f02: 4798 blx r3 + } + tcp_pcb_remove(&tcp_active_pcbs, pcb); + 8008f04: 6879 ldr r1, [r7, #4] + 8008f06: 480a ldr r0, [pc, #40] @ (8008f30 ) + 8008f08: f7ff fa50 bl 80083ac + tcp_free(pcb); + 8008f0c: 6878 ldr r0, [r7, #4] + 8008f0e: f7fe f83b bl 8006f88 + return 1; + 8008f12: 2301 movs r3, #1 + 8008f14: e000 b.n 8008f18 + } + return 0; + 8008f16: 2300 movs r3, #0 +} + 8008f18: 4618 mov r0, r3 + 8008f1a: 3708 adds r7, #8 + 8008f1c: 46bd mov sp, r7 + 8008f1e: bd80 pop {r7, pc} + 8008f20: 0801721c .word 0x0801721c + 8008f24: 080173ec .word 0x080173ec + 8008f28: 08017268 .word 0x08017268 + 8008f2c: 200190e9 .word 0x200190e9 + 8008f30: 200190b0 .word 0x200190b0 + +08008f34 : + * @note the segment which arrived is saved in global variables, therefore only the pcb + * involved is passed as a parameter to this function + */ +static void +tcp_listen_input(struct tcp_pcb_listen *pcb) +{ + 8008f34: b590 push {r4, r7, lr} + 8008f36: b08b sub sp, #44 @ 0x2c + 8008f38: af04 add r7, sp, #16 + 8008f3a: 6078 str r0, [r7, #4] + struct tcp_pcb *npcb; + u32_t iss; + err_t rc; + + if (flags & TCP_RST) { + 8008f3c: 4b6f ldr r3, [pc, #444] @ (80090fc ) + 8008f3e: 781b ldrb r3, [r3, #0] + 8008f40: f003 0304 and.w r3, r3, #4 + 8008f44: 2b00 cmp r3, #0 + 8008f46: f040 80d2 bne.w 80090ee + /* An incoming RST should be ignored. Return. */ + return; + } + + LWIP_ASSERT("tcp_listen_input: invalid pcb", pcb != NULL); + 8008f4a: 687b ldr r3, [r7, #4] + 8008f4c: 2b00 cmp r3, #0 + 8008f4e: d106 bne.n 8008f5e + 8008f50: 4b6b ldr r3, [pc, #428] @ (8009100 ) + 8008f52: f240 2281 movw r2, #641 @ 0x281 + 8008f56: 496b ldr r1, [pc, #428] @ (8009104 ) + 8008f58: 486b ldr r0, [pc, #428] @ (8009108 ) + 8008f5a: f008 fb4d bl 80115f8 + + /* In the LISTEN state, we check for incoming SYN segments, + creates a new PCB, and responds with a SYN|ACK. */ + if (flags & TCP_ACK) { + 8008f5e: 4b67 ldr r3, [pc, #412] @ (80090fc ) + 8008f60: 781b ldrb r3, [r3, #0] + 8008f62: f003 0310 and.w r3, r3, #16 + 8008f66: 2b00 cmp r3, #0 + 8008f68: d019 beq.n 8008f9e + /* For incoming segments with the ACK flag set, respond with a + RST. */ + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n")); + tcp_rst((const struct tcp_pcb *)pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 8008f6a: 4b68 ldr r3, [pc, #416] @ (800910c ) + 8008f6c: 6819 ldr r1, [r3, #0] + 8008f6e: 4b68 ldr r3, [pc, #416] @ (8009110 ) + 8008f70: 881b ldrh r3, [r3, #0] + 8008f72: 461a mov r2, r3 + 8008f74: 4b67 ldr r3, [pc, #412] @ (8009114 ) + 8008f76: 681b ldr r3, [r3, #0] + 8008f78: 18d0 adds r0, r2, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8008f7a: 4b67 ldr r3, [pc, #412] @ (8009118 ) + 8008f7c: 681b ldr r3, [r3, #0] + tcp_rst((const struct tcp_pcb *)pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 8008f7e: 885b ldrh r3, [r3, #2] + 8008f80: b29b uxth r3, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8008f82: 4a65 ldr r2, [pc, #404] @ (8009118 ) + 8008f84: 6812 ldr r2, [r2, #0] + tcp_rst((const struct tcp_pcb *)pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 8008f86: 8812 ldrh r2, [r2, #0] + 8008f88: b292 uxth r2, r2 + 8008f8a: 9202 str r2, [sp, #8] + 8008f8c: 9301 str r3, [sp, #4] + 8008f8e: 4b63 ldr r3, [pc, #396] @ (800911c ) + 8008f90: 9300 str r3, [sp, #0] + 8008f92: 4b63 ldr r3, [pc, #396] @ (8009120 ) + 8008f94: 4602 mov r2, r0 + 8008f96: 6878 ldr r0, [r7, #4] + 8008f98: f002 ff7a bl 800be90 + tcp_abandon(npcb, 0); + return; + } + tcp_output(npcb); + } + return; + 8008f9c: e0a9 b.n 80090f2 + } else if (flags & TCP_SYN) { + 8008f9e: 4b57 ldr r3, [pc, #348] @ (80090fc ) + 8008fa0: 781b ldrb r3, [r3, #0] + 8008fa2: f003 0302 and.w r3, r3, #2 + 8008fa6: 2b00 cmp r3, #0 + 8008fa8: f000 80a3 beq.w 80090f2 + npcb = tcp_alloc(pcb->prio); + 8008fac: 687b ldr r3, [r7, #4] + 8008fae: 7d5b ldrb r3, [r3, #21] + 8008fb0: 4618 mov r0, r3 + 8008fb2: f7ff f927 bl 8008204 + 8008fb6: 6178 str r0, [r7, #20] + if (npcb == NULL) { + 8008fb8: 697b ldr r3, [r7, #20] + 8008fba: 2b00 cmp r3, #0 + 8008fbc: d111 bne.n 8008fe2 + TCP_EVENT_ACCEPT(pcb, NULL, pcb->callback_arg, ERR_MEM, err); + 8008fbe: 687b ldr r3, [r7, #4] + 8008fc0: 699b ldr r3, [r3, #24] + 8008fc2: 2b00 cmp r3, #0 + 8008fc4: d00a beq.n 8008fdc + 8008fc6: 687b ldr r3, [r7, #4] + 8008fc8: 699b ldr r3, [r3, #24] + 8008fca: 687a ldr r2, [r7, #4] + 8008fcc: 6910 ldr r0, [r2, #16] + 8008fce: f04f 32ff mov.w r2, #4294967295 + 8008fd2: 2100 movs r1, #0 + 8008fd4: 4798 blx r3 + 8008fd6: 4603 mov r3, r0 + 8008fd8: 73bb strb r3, [r7, #14] + return; + 8008fda: e08b b.n 80090f4 + TCP_EVENT_ACCEPT(pcb, NULL, pcb->callback_arg, ERR_MEM, err); + 8008fdc: 23f0 movs r3, #240 @ 0xf0 + 8008fde: 73bb strb r3, [r7, #14] + return; + 8008fe0: e088 b.n 80090f4 + ip_addr_copy(npcb->local_ip, *ip_current_dest_addr()); + 8008fe2: 4b50 ldr r3, [pc, #320] @ (8009124 ) + 8008fe4: 695a ldr r2, [r3, #20] + 8008fe6: 697b ldr r3, [r7, #20] + 8008fe8: 601a str r2, [r3, #0] + ip_addr_copy(npcb->remote_ip, *ip_current_src_addr()); + 8008fea: 4b4e ldr r3, [pc, #312] @ (8009124 ) + 8008fec: 691a ldr r2, [r3, #16] + 8008fee: 697b ldr r3, [r7, #20] + 8008ff0: 605a str r2, [r3, #4] + npcb->local_port = pcb->local_port; + 8008ff2: 687b ldr r3, [r7, #4] + 8008ff4: 8ada ldrh r2, [r3, #22] + 8008ff6: 697b ldr r3, [r7, #20] + 8008ff8: 82da strh r2, [r3, #22] + npcb->remote_port = tcphdr->src; + 8008ffa: 4b47 ldr r3, [pc, #284] @ (8009118 ) + 8008ffc: 681b ldr r3, [r3, #0] + 8008ffe: 881b ldrh r3, [r3, #0] + 8009000: b29a uxth r2, r3 + 8009002: 697b ldr r3, [r7, #20] + 8009004: 831a strh r2, [r3, #24] + npcb->state = SYN_RCVD; + 8009006: 697b ldr r3, [r7, #20] + 8009008: 2203 movs r2, #3 + 800900a: 751a strb r2, [r3, #20] + npcb->rcv_nxt = seqno + 1; + 800900c: 4b41 ldr r3, [pc, #260] @ (8009114 ) + 800900e: 681b ldr r3, [r3, #0] + 8009010: 1c5a adds r2, r3, #1 + 8009012: 697b ldr r3, [r7, #20] + 8009014: 625a str r2, [r3, #36] @ 0x24 + npcb->rcv_ann_right_edge = npcb->rcv_nxt; + 8009016: 697b ldr r3, [r7, #20] + 8009018: 6a5a ldr r2, [r3, #36] @ 0x24 + 800901a: 697b ldr r3, [r7, #20] + 800901c: 62da str r2, [r3, #44] @ 0x2c + iss = tcp_next_iss(npcb); + 800901e: 6978 ldr r0, [r7, #20] + 8009020: f7ff fa58 bl 80084d4 + 8009024: 6138 str r0, [r7, #16] + npcb->snd_wl2 = iss; + 8009026: 697b ldr r3, [r7, #20] + 8009028: 693a ldr r2, [r7, #16] + 800902a: 659a str r2, [r3, #88] @ 0x58 + npcb->snd_nxt = iss; + 800902c: 697b ldr r3, [r7, #20] + 800902e: 693a ldr r2, [r7, #16] + 8009030: 651a str r2, [r3, #80] @ 0x50 + npcb->lastack = iss; + 8009032: 697b ldr r3, [r7, #20] + 8009034: 693a ldr r2, [r7, #16] + 8009036: 645a str r2, [r3, #68] @ 0x44 + npcb->snd_lbb = iss; + 8009038: 697b ldr r3, [r7, #20] + 800903a: 693a ldr r2, [r7, #16] + 800903c: 65da str r2, [r3, #92] @ 0x5c + npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */ + 800903e: 4b35 ldr r3, [pc, #212] @ (8009114 ) + 8009040: 681b ldr r3, [r3, #0] + 8009042: 1e5a subs r2, r3, #1 + 8009044: 697b ldr r3, [r7, #20] + 8009046: 655a str r2, [r3, #84] @ 0x54 + npcb->callback_arg = pcb->callback_arg; + 8009048: 687b ldr r3, [r7, #4] + 800904a: 691a ldr r2, [r3, #16] + 800904c: 697b ldr r3, [r7, #20] + 800904e: 611a str r2, [r3, #16] + npcb->listener = pcb; + 8009050: 697b ldr r3, [r7, #20] + 8009052: 687a ldr r2, [r7, #4] + 8009054: 67da str r2, [r3, #124] @ 0x7c + npcb->so_options = pcb->so_options & SOF_INHERITED; + 8009056: 687b ldr r3, [r7, #4] + 8009058: 7a5b ldrb r3, [r3, #9] + 800905a: f003 030c and.w r3, r3, #12 + 800905e: b2da uxtb r2, r3 + 8009060: 697b ldr r3, [r7, #20] + 8009062: 725a strb r2, [r3, #9] + npcb->netif_idx = pcb->netif_idx; + 8009064: 687b ldr r3, [r7, #4] + 8009066: 7a1a ldrb r2, [r3, #8] + 8009068: 697b ldr r3, [r7, #20] + 800906a: 721a strb r2, [r3, #8] + TCP_REG_ACTIVE(npcb); + 800906c: 4b2e ldr r3, [pc, #184] @ (8009128 ) + 800906e: 681a ldr r2, [r3, #0] + 8009070: 697b ldr r3, [r7, #20] + 8009072: 60da str r2, [r3, #12] + 8009074: 4a2c ldr r2, [pc, #176] @ (8009128 ) + 8009076: 697b ldr r3, [r7, #20] + 8009078: 6013 str r3, [r2, #0] + 800907a: f003 f8cb bl 800c214 + 800907e: 4b2b ldr r3, [pc, #172] @ (800912c ) + 8009080: 2201 movs r2, #1 + 8009082: 701a strb r2, [r3, #0] + tcp_parseopt(npcb); + 8009084: 6978 ldr r0, [r7, #20] + 8009086: f001 fd8b bl 800aba0 + npcb->snd_wnd = tcphdr->wnd; + 800908a: 4b23 ldr r3, [pc, #140] @ (8009118 ) + 800908c: 681b ldr r3, [r3, #0] + 800908e: 89db ldrh r3, [r3, #14] + 8009090: b29a uxth r2, r3 + 8009092: 697b ldr r3, [r7, #20] + 8009094: f8a3 2060 strh.w r2, [r3, #96] @ 0x60 + npcb->snd_wnd_max = npcb->snd_wnd; + 8009098: 697b ldr r3, [r7, #20] + 800909a: f8b3 2060 ldrh.w r2, [r3, #96] @ 0x60 + 800909e: 697b ldr r3, [r7, #20] + 80090a0: f8a3 2062 strh.w r2, [r3, #98] @ 0x62 + npcb->mss = tcp_eff_send_mss(npcb->mss, &npcb->local_ip, &npcb->remote_ip); + 80090a4: 697b ldr r3, [r7, #20] + 80090a6: 8e5c ldrh r4, [r3, #50] @ 0x32 + 80090a8: 697b ldr r3, [r7, #20] + 80090aa: 3304 adds r3, #4 + 80090ac: 4618 mov r0, r3 + 80090ae: f006 fe7d bl 800fdac + 80090b2: 4601 mov r1, r0 + 80090b4: 697b ldr r3, [r7, #20] + 80090b6: 3304 adds r3, #4 + 80090b8: 461a mov r2, r3 + 80090ba: 4620 mov r0, r4 + 80090bc: f7ff fa30 bl 8008520 + 80090c0: 4603 mov r3, r0 + 80090c2: 461a mov r2, r3 + 80090c4: 697b ldr r3, [r7, #20] + 80090c6: 865a strh r2, [r3, #50] @ 0x32 + rc = tcp_enqueue_flags(npcb, TCP_SYN | TCP_ACK); + 80090c8: 2112 movs r1, #18 + 80090ca: 6978 ldr r0, [r7, #20] + 80090cc: f002 f83e bl 800b14c + 80090d0: 4603 mov r3, r0 + 80090d2: 73fb strb r3, [r7, #15] + if (rc != ERR_OK) { + 80090d4: f997 300f ldrsb.w r3, [r7, #15] + 80090d8: 2b00 cmp r3, #0 + 80090da: d004 beq.n 80090e6 + tcp_abandon(npcb, 0); + 80090dc: 2100 movs r1, #0 + 80090de: 6978 ldr r0, [r7, #20] + 80090e0: f7fe f97c bl 80073dc + return; + 80090e4: e006 b.n 80090f4 + tcp_output(npcb); + 80090e6: 6978 ldr r0, [r7, #20] + 80090e8: f002 f91e bl 800b328 + return; + 80090ec: e001 b.n 80090f2 + return; + 80090ee: bf00 nop + 80090f0: e000 b.n 80090f4 + return; + 80090f2: bf00 nop +} + 80090f4: 371c adds r7, #28 + 80090f6: 46bd mov sp, r7 + 80090f8: bd90 pop {r4, r7, pc} + 80090fa: bf00 nop + 80090fc: 200190e8 .word 0x200190e8 + 8009100: 0801721c .word 0x0801721c + 8009104: 08017414 .word 0x08017414 + 8009108: 08017268 .word 0x08017268 + 800910c: 200190e0 .word 0x200190e0 + 8009110: 200190e6 .word 0x200190e6 + 8009114: 200190dc .word 0x200190dc + 8009118: 200190cc .word 0x200190cc + 800911c: 2000615c .word 0x2000615c + 8009120: 20006160 .word 0x20006160 + 8009124: 2000614c .word 0x2000614c + 8009128: 200190b0 .word 0x200190b0 + 800912c: 200190b8 .word 0x200190b8 + +08009130 : + * @note the segment which arrived is saved in global variables, therefore only the pcb + * involved is passed as a parameter to this function + */ +static void +tcp_timewait_input(struct tcp_pcb *pcb) +{ + 8009130: b580 push {r7, lr} + 8009132: b086 sub sp, #24 + 8009134: af04 add r7, sp, #16 + 8009136: 6078 str r0, [r7, #4] + /* RFC 1337: in TIME_WAIT, ignore RST and ACK FINs + any 'acceptable' segments */ + /* RFC 793 3.9 Event Processing - Segment Arrives: + * - first check sequence number - we skip that one in TIME_WAIT (always + * acceptable since we only send ACKs) + * - second check the RST bit (... return) */ + if (flags & TCP_RST) { + 8009138: 4b2f ldr r3, [pc, #188] @ (80091f8 ) + 800913a: 781b ldrb r3, [r3, #0] + 800913c: f003 0304 and.w r3, r3, #4 + 8009140: 2b00 cmp r3, #0 + 8009142: d153 bne.n 80091ec + return; + } + + LWIP_ASSERT("tcp_timewait_input: invalid pcb", pcb != NULL); + 8009144: 687b ldr r3, [r7, #4] + 8009146: 2b00 cmp r3, #0 + 8009148: d106 bne.n 8009158 + 800914a: 4b2c ldr r3, [pc, #176] @ (80091fc ) + 800914c: f240 22ee movw r2, #750 @ 0x2ee + 8009150: 492b ldr r1, [pc, #172] @ (8009200 ) + 8009152: 482c ldr r0, [pc, #176] @ (8009204 ) + 8009154: f008 fa50 bl 80115f8 + + /* - fourth, check the SYN bit, */ + if (flags & TCP_SYN) { + 8009158: 4b27 ldr r3, [pc, #156] @ (80091f8 ) + 800915a: 781b ldrb r3, [r3, #0] + 800915c: f003 0302 and.w r3, r3, #2 + 8009160: 2b00 cmp r3, #0 + 8009162: d02a beq.n 80091ba + /* If an incoming segment is not acceptable, an acknowledgment + should be sent in reply */ + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd)) { + 8009164: 4b28 ldr r3, [pc, #160] @ (8009208 ) + 8009166: 681a ldr r2, [r3, #0] + 8009168: 687b ldr r3, [r7, #4] + 800916a: 6a5b ldr r3, [r3, #36] @ 0x24 + 800916c: 1ad3 subs r3, r2, r3 + 800916e: 2b00 cmp r3, #0 + 8009170: db2d blt.n 80091ce + 8009172: 4b25 ldr r3, [pc, #148] @ (8009208 ) + 8009174: 681a ldr r2, [r3, #0] + 8009176: 687b ldr r3, [r7, #4] + 8009178: 6a5b ldr r3, [r3, #36] @ 0x24 + 800917a: 6879 ldr r1, [r7, #4] + 800917c: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800917e: 440b add r3, r1 + 8009180: 1ad3 subs r3, r2, r3 + 8009182: 2b00 cmp r3, #0 + 8009184: dc23 bgt.n 80091ce + /* If the SYN is in the window it is an error, send a reset */ + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 8009186: 4b21 ldr r3, [pc, #132] @ (800920c ) + 8009188: 6819 ldr r1, [r3, #0] + 800918a: 4b21 ldr r3, [pc, #132] @ (8009210 ) + 800918c: 881b ldrh r3, [r3, #0] + 800918e: 461a mov r2, r3 + 8009190: 4b1d ldr r3, [pc, #116] @ (8009208 ) + 8009192: 681b ldr r3, [r3, #0] + 8009194: 18d0 adds r0, r2, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8009196: 4b1f ldr r3, [pc, #124] @ (8009214 ) + 8009198: 681b ldr r3, [r3, #0] + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 800919a: 885b ldrh r3, [r3, #2] + 800919c: b29b uxth r3, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 800919e: 4a1d ldr r2, [pc, #116] @ (8009214 ) + 80091a0: 6812 ldr r2, [r2, #0] + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 80091a2: 8812 ldrh r2, [r2, #0] + 80091a4: b292 uxth r2, r2 + 80091a6: 9202 str r2, [sp, #8] + 80091a8: 9301 str r3, [sp, #4] + 80091aa: 4b1b ldr r3, [pc, #108] @ (8009218 ) + 80091ac: 9300 str r3, [sp, #0] + 80091ae: 4b1b ldr r3, [pc, #108] @ (800921c ) + 80091b0: 4602 mov r2, r0 + 80091b2: 6878 ldr r0, [r7, #4] + 80091b4: f002 fe6c bl 800be90 + return; + 80091b8: e01b b.n 80091f2 + } + } else if (flags & TCP_FIN) { + 80091ba: 4b0f ldr r3, [pc, #60] @ (80091f8 ) + 80091bc: 781b ldrb r3, [r3, #0] + 80091be: f003 0301 and.w r3, r3, #1 + 80091c2: 2b00 cmp r3, #0 + 80091c4: d003 beq.n 80091ce + /* - eighth, check the FIN bit: Remain in the TIME-WAIT state. + Restart the 2 MSL time-wait timeout.*/ + pcb->tmr = tcp_ticks; + 80091c6: 4b16 ldr r3, [pc, #88] @ (8009220 ) + 80091c8: 681a ldr r2, [r3, #0] + 80091ca: 687b ldr r3, [r7, #4] + 80091cc: 621a str r2, [r3, #32] + } + + if ((tcplen > 0)) { + 80091ce: 4b10 ldr r3, [pc, #64] @ (8009210 ) + 80091d0: 881b ldrh r3, [r3, #0] + 80091d2: 2b00 cmp r3, #0 + 80091d4: d00c beq.n 80091f0 + /* Acknowledge data, FIN or out-of-window SYN */ + tcp_ack_now(pcb); + 80091d6: 687b ldr r3, [r7, #4] + 80091d8: 8b5b ldrh r3, [r3, #26] + 80091da: f043 0302 orr.w r3, r3, #2 + 80091de: b29a uxth r2, r3 + 80091e0: 687b ldr r3, [r7, #4] + 80091e2: 835a strh r2, [r3, #26] + tcp_output(pcb); + 80091e4: 6878 ldr r0, [r7, #4] + 80091e6: f002 f89f bl 800b328 + } + return; + 80091ea: e001 b.n 80091f0 + return; + 80091ec: bf00 nop + 80091ee: e000 b.n 80091f2 + return; + 80091f0: bf00 nop +} + 80091f2: 3708 adds r7, #8 + 80091f4: 46bd mov sp, r7 + 80091f6: bd80 pop {r7, pc} + 80091f8: 200190e8 .word 0x200190e8 + 80091fc: 0801721c .word 0x0801721c + 8009200: 08017434 .word 0x08017434 + 8009204: 08017268 .word 0x08017268 + 8009208: 200190dc .word 0x200190dc + 800920c: 200190e0 .word 0x200190e0 + 8009210: 200190e6 .word 0x200190e6 + 8009214: 200190cc .word 0x200190cc + 8009218: 2000615c .word 0x2000615c + 800921c: 20006160 .word 0x20006160 + 8009220: 200190a4 .word 0x200190a4 + +08009224 : + * @note the segment which arrived is saved in global variables, therefore only the pcb + * involved is passed as a parameter to this function + */ +static err_t +tcp_process(struct tcp_pcb *pcb) +{ + 8009224: b590 push {r4, r7, lr} + 8009226: b08d sub sp, #52 @ 0x34 + 8009228: af04 add r7, sp, #16 + 800922a: 6078 str r0, [r7, #4] + struct tcp_seg *rseg; + u8_t acceptable = 0; + 800922c: 2300 movs r3, #0 + 800922e: 76fb strb r3, [r7, #27] + err_t err; + + err = ERR_OK; + 8009230: 2300 movs r3, #0 + 8009232: 76bb strb r3, [r7, #26] + + LWIP_ASSERT("tcp_process: invalid pcb", pcb != NULL); + 8009234: 687b ldr r3, [r7, #4] + 8009236: 2b00 cmp r3, #0 + 8009238: d106 bne.n 8009248 + 800923a: 4b9d ldr r3, [pc, #628] @ (80094b0 ) + 800923c: f44f 7247 mov.w r2, #796 @ 0x31c + 8009240: 499c ldr r1, [pc, #624] @ (80094b4 ) + 8009242: 489d ldr r0, [pc, #628] @ (80094b8 ) + 8009244: f008 f9d8 bl 80115f8 + + /* Process incoming RST segments. */ + if (flags & TCP_RST) { + 8009248: 4b9c ldr r3, [pc, #624] @ (80094bc ) + 800924a: 781b ldrb r3, [r3, #0] + 800924c: f003 0304 and.w r3, r3, #4 + 8009250: 2b00 cmp r3, #0 + 8009252: d04e beq.n 80092f2 + /* First, determine if the reset is acceptable. */ + if (pcb->state == SYN_SENT) { + 8009254: 687b ldr r3, [r7, #4] + 8009256: 7d1b ldrb r3, [r3, #20] + 8009258: 2b02 cmp r3, #2 + 800925a: d108 bne.n 800926e + /* "In the SYN-SENT state (a RST received in response to an initial SYN), + the RST is acceptable if the ACK field acknowledges the SYN." */ + if (ackno == pcb->snd_nxt) { + 800925c: 687b ldr r3, [r7, #4] + 800925e: 6d1a ldr r2, [r3, #80] @ 0x50 + 8009260: 4b97 ldr r3, [pc, #604] @ (80094c0 ) + 8009262: 681b ldr r3, [r3, #0] + 8009264: 429a cmp r2, r3 + 8009266: d123 bne.n 80092b0 + acceptable = 1; + 8009268: 2301 movs r3, #1 + 800926a: 76fb strb r3, [r7, #27] + 800926c: e020 b.n 80092b0 + } + } else { + /* "In all states except SYN-SENT, all reset (RST) segments are validated + by checking their SEQ-fields." */ + if (seqno == pcb->rcv_nxt) { + 800926e: 687b ldr r3, [r7, #4] + 8009270: 6a5a ldr r2, [r3, #36] @ 0x24 + 8009272: 4b94 ldr r3, [pc, #592] @ (80094c4 ) + 8009274: 681b ldr r3, [r3, #0] + 8009276: 429a cmp r2, r3 + 8009278: d102 bne.n 8009280 + acceptable = 1; + 800927a: 2301 movs r3, #1 + 800927c: 76fb strb r3, [r7, #27] + 800927e: e017 b.n 80092b0 + } else if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + 8009280: 4b90 ldr r3, [pc, #576] @ (80094c4 ) + 8009282: 681a ldr r2, [r3, #0] + 8009284: 687b ldr r3, [r7, #4] + 8009286: 6a5b ldr r3, [r3, #36] @ 0x24 + 8009288: 1ad3 subs r3, r2, r3 + 800928a: 2b00 cmp r3, #0 + 800928c: db10 blt.n 80092b0 + 800928e: 4b8d ldr r3, [pc, #564] @ (80094c4 ) + 8009290: 681a ldr r2, [r3, #0] + 8009292: 687b ldr r3, [r7, #4] + 8009294: 6a5b ldr r3, [r3, #36] @ 0x24 + 8009296: 6879 ldr r1, [r7, #4] + 8009298: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800929a: 440b add r3, r1 + 800929c: 1ad3 subs r3, r2, r3 + 800929e: 2b00 cmp r3, #0 + 80092a0: dc06 bgt.n 80092b0 + pcb->rcv_nxt + pcb->rcv_wnd)) { + /* If the sequence number is inside the window, we send a challenge ACK + and wait for a re-send with matching sequence number. + This follows RFC 5961 section 3.2 and addresses CVE-2004-0230 + (RST spoofing attack), which is present in RFC 793 RST handling. */ + tcp_ack_now(pcb); + 80092a2: 687b ldr r3, [r7, #4] + 80092a4: 8b5b ldrh r3, [r3, #26] + 80092a6: f043 0302 orr.w r3, r3, #2 + 80092aa: b29a uxth r2, r3 + 80092ac: 687b ldr r3, [r7, #4] + 80092ae: 835a strh r2, [r3, #26] + } + } + + if (acceptable) { + 80092b0: 7efb ldrb r3, [r7, #27] + 80092b2: 2b00 cmp r3, #0 + 80092b4: d01b beq.n 80092ee + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: Connection RESET\n")); + LWIP_ASSERT("tcp_input: pcb->state != CLOSED", pcb->state != CLOSED); + 80092b6: 687b ldr r3, [r7, #4] + 80092b8: 7d1b ldrb r3, [r3, #20] + 80092ba: 2b00 cmp r3, #0 + 80092bc: d106 bne.n 80092cc + 80092be: 4b7c ldr r3, [pc, #496] @ (80094b0 ) + 80092c0: f44f 724e mov.w r2, #824 @ 0x338 + 80092c4: 4980 ldr r1, [pc, #512] @ (80094c8 ) + 80092c6: 487c ldr r0, [pc, #496] @ (80094b8 ) + 80092c8: f008 f996 bl 80115f8 + recv_flags |= TF_RESET; + 80092cc: 4b7f ldr r3, [pc, #508] @ (80094cc ) + 80092ce: 781b ldrb r3, [r3, #0] + 80092d0: f043 0308 orr.w r3, r3, #8 + 80092d4: b2da uxtb r2, r3 + 80092d6: 4b7d ldr r3, [pc, #500] @ (80094cc ) + 80092d8: 701a strb r2, [r3, #0] + tcp_clear_flags(pcb, TF_ACK_DELAY); + 80092da: 687b ldr r3, [r7, #4] + 80092dc: 8b5b ldrh r3, [r3, #26] + 80092de: f023 0301 bic.w r3, r3, #1 + 80092e2: b29a uxth r2, r3 + 80092e4: 687b ldr r3, [r7, #4] + 80092e6: 835a strh r2, [r3, #26] + return ERR_RST; + 80092e8: f06f 030d mvn.w r3, #13 + 80092ec: e37a b.n 80099e4 + } else { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: unacceptable reset seqno %"U32_F" rcv_nxt %"U32_F"\n", + seqno, pcb->rcv_nxt)); + LWIP_DEBUGF(TCP_DEBUG, ("tcp_process: unacceptable reset seqno %"U32_F" rcv_nxt %"U32_F"\n", + seqno, pcb->rcv_nxt)); + return ERR_OK; + 80092ee: 2300 movs r3, #0 + 80092f0: e378 b.n 80099e4 + } + } + + if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) { + 80092f2: 4b72 ldr r3, [pc, #456] @ (80094bc ) + 80092f4: 781b ldrb r3, [r3, #0] + 80092f6: f003 0302 and.w r3, r3, #2 + 80092fa: 2b00 cmp r3, #0 + 80092fc: d010 beq.n 8009320 + 80092fe: 687b ldr r3, [r7, #4] + 8009300: 7d1b ldrb r3, [r3, #20] + 8009302: 2b02 cmp r3, #2 + 8009304: d00c beq.n 8009320 + 8009306: 687b ldr r3, [r7, #4] + 8009308: 7d1b ldrb r3, [r3, #20] + 800930a: 2b03 cmp r3, #3 + 800930c: d008 beq.n 8009320 + /* Cope with new connection attempt after remote end crashed */ + tcp_ack_now(pcb); + 800930e: 687b ldr r3, [r7, #4] + 8009310: 8b5b ldrh r3, [r3, #26] + 8009312: f043 0302 orr.w r3, r3, #2 + 8009316: b29a uxth r2, r3 + 8009318: 687b ldr r3, [r7, #4] + 800931a: 835a strh r2, [r3, #26] + return ERR_OK; + 800931c: 2300 movs r3, #0 + 800931e: e361 b.n 80099e4 + } + + if ((pcb->flags & TF_RXCLOSED) == 0) { + 8009320: 687b ldr r3, [r7, #4] + 8009322: 8b5b ldrh r3, [r3, #26] + 8009324: f003 0310 and.w r3, r3, #16 + 8009328: 2b00 cmp r3, #0 + 800932a: d103 bne.n 8009334 + /* Update the PCB (in)activity timer unless rx is closed (see tcp_shutdown) */ + pcb->tmr = tcp_ticks; + 800932c: 4b68 ldr r3, [pc, #416] @ (80094d0 ) + 800932e: 681a ldr r2, [r3, #0] + 8009330: 687b ldr r3, [r7, #4] + 8009332: 621a str r2, [r3, #32] + } + pcb->keep_cnt_sent = 0; + 8009334: 687b ldr r3, [r7, #4] + 8009336: 2200 movs r2, #0 + 8009338: f883 209b strb.w r2, [r3, #155] @ 0x9b + pcb->persist_probe = 0; + 800933c: 687b ldr r3, [r7, #4] + 800933e: 2200 movs r2, #0 + 8009340: f883 209a strb.w r2, [r3, #154] @ 0x9a + + tcp_parseopt(pcb); + 8009344: 6878 ldr r0, [r7, #4] + 8009346: f001 fc2b bl 800aba0 + + /* Do different things depending on the TCP state. */ + switch (pcb->state) { + 800934a: 687b ldr r3, [r7, #4] + 800934c: 7d1b ldrb r3, [r3, #20] + 800934e: 3b02 subs r3, #2 + 8009350: 2b07 cmp r3, #7 + 8009352: f200 8337 bhi.w 80099c4 + 8009356: a201 add r2, pc, #4 @ (adr r2, 800935c ) + 8009358: f852 f023 ldr.w pc, [r2, r3, lsl #2] + 800935c: 0800937d .word 0x0800937d + 8009360: 080095ad .word 0x080095ad + 8009364: 08009725 .word 0x08009725 + 8009368: 0800974f .word 0x0800974f + 800936c: 08009873 .word 0x08009873 + 8009370: 08009725 .word 0x08009725 + 8009374: 080098ff .word 0x080098ff + 8009378: 0800998f .word 0x0800998f + case SYN_SENT: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno, + pcb->snd_nxt, lwip_ntohl(pcb->unacked->tcphdr->seqno))); + /* received SYN ACK with expected sequence number? */ + if ((flags & TCP_ACK) && (flags & TCP_SYN) + 800937c: 4b4f ldr r3, [pc, #316] @ (80094bc ) + 800937e: 781b ldrb r3, [r3, #0] + 8009380: f003 0310 and.w r3, r3, #16 + 8009384: 2b00 cmp r3, #0 + 8009386: f000 80e4 beq.w 8009552 + 800938a: 4b4c ldr r3, [pc, #304] @ (80094bc ) + 800938c: 781b ldrb r3, [r3, #0] + 800938e: f003 0302 and.w r3, r3, #2 + 8009392: 2b00 cmp r3, #0 + 8009394: f000 80dd beq.w 8009552 + && (ackno == pcb->lastack + 1)) { + 8009398: 687b ldr r3, [r7, #4] + 800939a: 6c5b ldr r3, [r3, #68] @ 0x44 + 800939c: 1c5a adds r2, r3, #1 + 800939e: 4b48 ldr r3, [pc, #288] @ (80094c0 ) + 80093a0: 681b ldr r3, [r3, #0] + 80093a2: 429a cmp r2, r3 + 80093a4: f040 80d5 bne.w 8009552 + pcb->rcv_nxt = seqno + 1; + 80093a8: 4b46 ldr r3, [pc, #280] @ (80094c4 ) + 80093aa: 681b ldr r3, [r3, #0] + 80093ac: 1c5a adds r2, r3, #1 + 80093ae: 687b ldr r3, [r7, #4] + 80093b0: 625a str r2, [r3, #36] @ 0x24 + pcb->rcv_ann_right_edge = pcb->rcv_nxt; + 80093b2: 687b ldr r3, [r7, #4] + 80093b4: 6a5a ldr r2, [r3, #36] @ 0x24 + 80093b6: 687b ldr r3, [r7, #4] + 80093b8: 62da str r2, [r3, #44] @ 0x2c + pcb->lastack = ackno; + 80093ba: 4b41 ldr r3, [pc, #260] @ (80094c0 ) + 80093bc: 681a ldr r2, [r3, #0] + 80093be: 687b ldr r3, [r7, #4] + 80093c0: 645a str r2, [r3, #68] @ 0x44 + pcb->snd_wnd = tcphdr->wnd; + 80093c2: 4b44 ldr r3, [pc, #272] @ (80094d4 ) + 80093c4: 681b ldr r3, [r3, #0] + 80093c6: 89db ldrh r3, [r3, #14] + 80093c8: b29a uxth r2, r3 + 80093ca: 687b ldr r3, [r7, #4] + 80093cc: f8a3 2060 strh.w r2, [r3, #96] @ 0x60 + pcb->snd_wnd_max = pcb->snd_wnd; + 80093d0: 687b ldr r3, [r7, #4] + 80093d2: f8b3 2060 ldrh.w r2, [r3, #96] @ 0x60 + 80093d6: 687b ldr r3, [r7, #4] + 80093d8: f8a3 2062 strh.w r2, [r3, #98] @ 0x62 + pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */ + 80093dc: 4b39 ldr r3, [pc, #228] @ (80094c4 ) + 80093de: 681b ldr r3, [r3, #0] + 80093e0: 1e5a subs r2, r3, #1 + 80093e2: 687b ldr r3, [r7, #4] + 80093e4: 655a str r2, [r3, #84] @ 0x54 + pcb->state = ESTABLISHED; + 80093e6: 687b ldr r3, [r7, #4] + 80093e8: 2204 movs r2, #4 + 80093ea: 751a strb r2, [r3, #20] + +#if TCP_CALCULATE_EFF_SEND_MSS + pcb->mss = tcp_eff_send_mss(pcb->mss, &pcb->local_ip, &pcb->remote_ip); + 80093ec: 687b ldr r3, [r7, #4] + 80093ee: 8e5c ldrh r4, [r3, #50] @ 0x32 + 80093f0: 687b ldr r3, [r7, #4] + 80093f2: 3304 adds r3, #4 + 80093f4: 4618 mov r0, r3 + 80093f6: f006 fcd9 bl 800fdac + 80093fa: 4601 mov r1, r0 + 80093fc: 687b ldr r3, [r7, #4] + 80093fe: 3304 adds r3, #4 + 8009400: 461a mov r2, r3 + 8009402: 4620 mov r0, r4 + 8009404: f7ff f88c bl 8008520 + 8009408: 4603 mov r3, r0 + 800940a: 461a mov r2, r3 + 800940c: 687b ldr r3, [r7, #4] + 800940e: 865a strh r2, [r3, #50] @ 0x32 +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + + pcb->cwnd = LWIP_TCP_CALC_INITIAL_CWND(pcb->mss); + 8009410: 687b ldr r3, [r7, #4] + 8009412: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009414: 009a lsls r2, r3, #2 + 8009416: 687b ldr r3, [r7, #4] + 8009418: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800941a: 005b lsls r3, r3, #1 + 800941c: f241 111c movw r1, #4380 @ 0x111c + 8009420: 428b cmp r3, r1 + 8009422: bf38 it cc + 8009424: 460b movcc r3, r1 + 8009426: 429a cmp r2, r3 + 8009428: d204 bcs.n 8009434 + 800942a: 687b ldr r3, [r7, #4] + 800942c: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800942e: 009b lsls r3, r3, #2 + 8009430: b29b uxth r3, r3 + 8009432: e00d b.n 8009450 + 8009434: 687b ldr r3, [r7, #4] + 8009436: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009438: 005b lsls r3, r3, #1 + 800943a: f241 121c movw r2, #4380 @ 0x111c + 800943e: 4293 cmp r3, r2 + 8009440: d904 bls.n 800944c + 8009442: 687b ldr r3, [r7, #4] + 8009444: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009446: 005b lsls r3, r3, #1 + 8009448: b29b uxth r3, r3 + 800944a: e001 b.n 8009450 + 800944c: f241 131c movw r3, #4380 @ 0x111c + 8009450: 687a ldr r2, [r7, #4] + 8009452: f8a2 3048 strh.w r3, [r2, #72] @ 0x48 + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_process (SENT): cwnd %"TCPWNDSIZE_F + " ssthresh %"TCPWNDSIZE_F"\n", + pcb->cwnd, pcb->ssthresh)); + LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0)); + 8009456: 687b ldr r3, [r7, #4] + 8009458: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800945c: 2b00 cmp r3, #0 + 800945e: d106 bne.n 800946e + 8009460: 4b13 ldr r3, [pc, #76] @ (80094b0 ) + 8009462: f44f 725b mov.w r2, #876 @ 0x36c + 8009466: 491c ldr r1, [pc, #112] @ (80094d8 ) + 8009468: 4813 ldr r0, [pc, #76] @ (80094b8 ) + 800946a: f008 f8c5 bl 80115f8 + --pcb->snd_queuelen; + 800946e: 687b ldr r3, [r7, #4] + 8009470: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 8009474: 3b01 subs r3, #1 + 8009476: b29a uxth r2, r3 + 8009478: 687b ldr r3, [r7, #4] + 800947a: f8a3 2066 strh.w r2, [r3, #102] @ 0x66 + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"TCPWNDSIZE_F"\n", (tcpwnd_size_t)pcb->snd_queuelen)); + rseg = pcb->unacked; + 800947e: 687b ldr r3, [r7, #4] + 8009480: 6f1b ldr r3, [r3, #112] @ 0x70 + 8009482: 61fb str r3, [r7, #28] + if (rseg == NULL) { + 8009484: 69fb ldr r3, [r7, #28] + 8009486: 2b00 cmp r3, #0 + 8009488: d12a bne.n 80094e0 + /* might happen if tcp_output fails in tcp_rexmit_rto() + in which case the segment is on the unsent list */ + rseg = pcb->unsent; + 800948a: 687b ldr r3, [r7, #4] + 800948c: 6edb ldr r3, [r3, #108] @ 0x6c + 800948e: 61fb str r3, [r7, #28] + LWIP_ASSERT("no segment to free", rseg != NULL); + 8009490: 69fb ldr r3, [r7, #28] + 8009492: 2b00 cmp r3, #0 + 8009494: d106 bne.n 80094a4 + 8009496: 4b06 ldr r3, [pc, #24] @ (80094b0 ) + 8009498: f44f 725d mov.w r2, #884 @ 0x374 + 800949c: 490f ldr r1, [pc, #60] @ (80094dc ) + 800949e: 4806 ldr r0, [pc, #24] @ (80094b8 ) + 80094a0: f008 f8aa bl 80115f8 + pcb->unsent = rseg->next; + 80094a4: 69fb ldr r3, [r7, #28] + 80094a6: 681a ldr r2, [r3, #0] + 80094a8: 687b ldr r3, [r7, #4] + 80094aa: 66da str r2, [r3, #108] @ 0x6c + 80094ac: e01c b.n 80094e8 + 80094ae: bf00 nop + 80094b0: 0801721c .word 0x0801721c + 80094b4: 08017454 .word 0x08017454 + 80094b8: 08017268 .word 0x08017268 + 80094bc: 200190e8 .word 0x200190e8 + 80094c0: 200190e0 .word 0x200190e0 + 80094c4: 200190dc .word 0x200190dc + 80094c8: 08017470 .word 0x08017470 + 80094cc: 200190e9 .word 0x200190e9 + 80094d0: 200190a4 .word 0x200190a4 + 80094d4: 200190cc .word 0x200190cc + 80094d8: 08017490 .word 0x08017490 + 80094dc: 080174a8 .word 0x080174a8 + } else { + pcb->unacked = rseg->next; + 80094e0: 69fb ldr r3, [r7, #28] + 80094e2: 681a ldr r2, [r3, #0] + 80094e4: 687b ldr r3, [r7, #4] + 80094e6: 671a str r2, [r3, #112] @ 0x70 + } + tcp_seg_free(rseg); + 80094e8: 69f8 ldr r0, [r7, #28] + 80094ea: f7fe fd22 bl 8007f32 + + /* If there's nothing left to acknowledge, stop the retransmit + timer, otherwise reset it to start again */ + if (pcb->unacked == NULL) { + 80094ee: 687b ldr r3, [r7, #4] + 80094f0: 6f1b ldr r3, [r3, #112] @ 0x70 + 80094f2: 2b00 cmp r3, #0 + 80094f4: d104 bne.n 8009500 + pcb->rtime = -1; + 80094f6: 687b ldr r3, [r7, #4] + 80094f8: f64f 72ff movw r2, #65535 @ 0xffff + 80094fc: 861a strh r2, [r3, #48] @ 0x30 + 80094fe: e006 b.n 800950e + } else { + pcb->rtime = 0; + 8009500: 687b ldr r3, [r7, #4] + 8009502: 2200 movs r2, #0 + 8009504: 861a strh r2, [r3, #48] @ 0x30 + pcb->nrtx = 0; + 8009506: 687b ldr r3, [r7, #4] + 8009508: 2200 movs r2, #0 + 800950a: f883 2042 strb.w r2, [r3, #66] @ 0x42 + } + + /* Call the user specified function to call when successfully + * connected. */ + TCP_EVENT_CONNECTED(pcb, ERR_OK, err); + 800950e: 687b ldr r3, [r7, #4] + 8009510: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 8009514: 2b00 cmp r3, #0 + 8009516: d00a beq.n 800952e + 8009518: 687b ldr r3, [r7, #4] + 800951a: f8d3 3088 ldr.w r3, [r3, #136] @ 0x88 + 800951e: 687a ldr r2, [r7, #4] + 8009520: 6910 ldr r0, [r2, #16] + 8009522: 2200 movs r2, #0 + 8009524: 6879 ldr r1, [r7, #4] + 8009526: 4798 blx r3 + 8009528: 4603 mov r3, r0 + 800952a: 76bb strb r3, [r7, #26] + 800952c: e001 b.n 8009532 + 800952e: 2300 movs r3, #0 + 8009530: 76bb strb r3, [r7, #26] + if (err == ERR_ABRT) { + 8009532: f997 301a ldrsb.w r3, [r7, #26] + 8009536: f113 0f0d cmn.w r3, #13 + 800953a: d102 bne.n 8009542 + return ERR_ABRT; + 800953c: f06f 030c mvn.w r3, #12 + 8009540: e250 b.n 80099e4 + } + tcp_ack_now(pcb); + 8009542: 687b ldr r3, [r7, #4] + 8009544: 8b5b ldrh r3, [r3, #26] + 8009546: f043 0302 orr.w r3, r3, #2 + 800954a: b29a uxth r2, r3 + 800954c: 687b ldr r3, [r7, #4] + 800954e: 835a strh r2, [r3, #26] + if (pcb->nrtx < TCP_SYNMAXRTX) { + pcb->rtime = 0; + tcp_rexmit_rto(pcb); + } + } + break; + 8009550: e23a b.n 80099c8 + else if (flags & TCP_ACK) { + 8009552: 4b98 ldr r3, [pc, #608] @ (80097b4 ) + 8009554: 781b ldrb r3, [r3, #0] + 8009556: f003 0310 and.w r3, r3, #16 + 800955a: 2b00 cmp r3, #0 + 800955c: f000 8234 beq.w 80099c8 + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 8009560: 4b95 ldr r3, [pc, #596] @ (80097b8 ) + 8009562: 6819 ldr r1, [r3, #0] + 8009564: 4b95 ldr r3, [pc, #596] @ (80097bc ) + 8009566: 881b ldrh r3, [r3, #0] + 8009568: 461a mov r2, r3 + 800956a: 4b95 ldr r3, [pc, #596] @ (80097c0 ) + 800956c: 681b ldr r3, [r3, #0] + 800956e: 18d0 adds r0, r2, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8009570: 4b94 ldr r3, [pc, #592] @ (80097c4 ) + 8009572: 681b ldr r3, [r3, #0] + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 8009574: 885b ldrh r3, [r3, #2] + 8009576: b29b uxth r3, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 8009578: 4a92 ldr r2, [pc, #584] @ (80097c4 ) + 800957a: 6812 ldr r2, [r2, #0] + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 800957c: 8812 ldrh r2, [r2, #0] + 800957e: b292 uxth r2, r2 + 8009580: 9202 str r2, [sp, #8] + 8009582: 9301 str r3, [sp, #4] + 8009584: 4b90 ldr r3, [pc, #576] @ (80097c8 ) + 8009586: 9300 str r3, [sp, #0] + 8009588: 4b90 ldr r3, [pc, #576] @ (80097cc ) + 800958a: 4602 mov r2, r0 + 800958c: 6878 ldr r0, [r7, #4] + 800958e: f002 fc7f bl 800be90 + if (pcb->nrtx < TCP_SYNMAXRTX) { + 8009592: 687b ldr r3, [r7, #4] + 8009594: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 8009598: 2b05 cmp r3, #5 + 800959a: f200 8215 bhi.w 80099c8 + pcb->rtime = 0; + 800959e: 687b ldr r3, [r7, #4] + 80095a0: 2200 movs r2, #0 + 80095a2: 861a strh r2, [r3, #48] @ 0x30 + tcp_rexmit_rto(pcb); + 80095a4: 6878 ldr r0, [r7, #4] + 80095a6: f002 fa4b bl 800ba40 + break; + 80095aa: e20d b.n 80099c8 + case SYN_RCVD: + if (flags & TCP_ACK) { + 80095ac: 4b81 ldr r3, [pc, #516] @ (80097b4 ) + 80095ae: 781b ldrb r3, [r3, #0] + 80095b0: f003 0310 and.w r3, r3, #16 + 80095b4: 2b00 cmp r3, #0 + 80095b6: f000 80a1 beq.w 80096fc + /* expected ACK number? */ + if (TCP_SEQ_BETWEEN(ackno, pcb->lastack + 1, pcb->snd_nxt)) { + 80095ba: 4b7f ldr r3, [pc, #508] @ (80097b8 ) + 80095bc: 681a ldr r2, [r3, #0] + 80095be: 687b ldr r3, [r7, #4] + 80095c0: 6c5b ldr r3, [r3, #68] @ 0x44 + 80095c2: 1ad3 subs r3, r2, r3 + 80095c4: 3b01 subs r3, #1 + 80095c6: 2b00 cmp r3, #0 + 80095c8: db7e blt.n 80096c8 + 80095ca: 4b7b ldr r3, [pc, #492] @ (80097b8 ) + 80095cc: 681a ldr r2, [r3, #0] + 80095ce: 687b ldr r3, [r7, #4] + 80095d0: 6d1b ldr r3, [r3, #80] @ 0x50 + 80095d2: 1ad3 subs r3, r2, r3 + 80095d4: 2b00 cmp r3, #0 + 80095d6: dc77 bgt.n 80096c8 + pcb->state = ESTABLISHED; + 80095d8: 687b ldr r3, [r7, #4] + 80095da: 2204 movs r2, #4 + 80095dc: 751a strb r2, [r3, #20] + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG + if (pcb->listener == NULL) { + 80095de: 687b ldr r3, [r7, #4] + 80095e0: 6fdb ldr r3, [r3, #124] @ 0x7c + 80095e2: 2b00 cmp r3, #0 + 80095e4: d102 bne.n 80095ec + /* listen pcb might be closed by now */ + err = ERR_VAL; + 80095e6: 23fa movs r3, #250 @ 0xfa + 80095e8: 76bb strb r3, [r7, #26] + 80095ea: e01d b.n 8009628 + } else +#endif /* LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG */ + { +#if LWIP_CALLBACK_API + LWIP_ASSERT("pcb->listener->accept != NULL", pcb->listener->accept != NULL); + 80095ec: 687b ldr r3, [r7, #4] + 80095ee: 6fdb ldr r3, [r3, #124] @ 0x7c + 80095f0: 699b ldr r3, [r3, #24] + 80095f2: 2b00 cmp r3, #0 + 80095f4: d106 bne.n 8009604 + 80095f6: 4b76 ldr r3, [pc, #472] @ (80097d0 ) + 80095f8: f44f 726a mov.w r2, #936 @ 0x3a8 + 80095fc: 4975 ldr r1, [pc, #468] @ (80097d4 ) + 80095fe: 4876 ldr r0, [pc, #472] @ (80097d8 ) + 8009600: f007 fffa bl 80115f8 +#endif + tcp_backlog_accepted(pcb); + /* Call the accept function. */ + TCP_EVENT_ACCEPT(pcb->listener, pcb, pcb->callback_arg, ERR_OK, err); + 8009604: 687b ldr r3, [r7, #4] + 8009606: 6fdb ldr r3, [r3, #124] @ 0x7c + 8009608: 699b ldr r3, [r3, #24] + 800960a: 2b00 cmp r3, #0 + 800960c: d00a beq.n 8009624 + 800960e: 687b ldr r3, [r7, #4] + 8009610: 6fdb ldr r3, [r3, #124] @ 0x7c + 8009612: 699b ldr r3, [r3, #24] + 8009614: 687a ldr r2, [r7, #4] + 8009616: 6910 ldr r0, [r2, #16] + 8009618: 2200 movs r2, #0 + 800961a: 6879 ldr r1, [r7, #4] + 800961c: 4798 blx r3 + 800961e: 4603 mov r3, r0 + 8009620: 76bb strb r3, [r7, #26] + 8009622: e001 b.n 8009628 + 8009624: 23f0 movs r3, #240 @ 0xf0 + 8009626: 76bb strb r3, [r7, #26] + } + if (err != ERR_OK) { + 8009628: f997 301a ldrsb.w r3, [r7, #26] + 800962c: 2b00 cmp r3, #0 + 800962e: d00a beq.n 8009646 + /* If the accept function returns with an error, we abort + * the connection. */ + /* Already aborted? */ + if (err != ERR_ABRT) { + 8009630: f997 301a ldrsb.w r3, [r7, #26] + 8009634: f113 0f0d cmn.w r3, #13 + 8009638: d002 beq.n 8009640 + tcp_abort(pcb); + 800963a: 6878 ldr r0, [r7, #4] + 800963c: f7fd ff8c bl 8007558 + } + return ERR_ABRT; + 8009640: f06f 030c mvn.w r3, #12 + 8009644: e1ce b.n 80099e4 + } + /* If there was any data contained within this ACK, + * we'd better pass it on to the application as well. */ + tcp_receive(pcb); + 8009646: 6878 ldr r0, [r7, #4] + 8009648: f000 fae0 bl 8009c0c + + /* Prevent ACK for SYN to generate a sent event */ + if (recv_acked != 0) { + 800964c: 4b63 ldr r3, [pc, #396] @ (80097dc ) + 800964e: 881b ldrh r3, [r3, #0] + 8009650: 2b00 cmp r3, #0 + 8009652: d005 beq.n 8009660 + recv_acked--; + 8009654: 4b61 ldr r3, [pc, #388] @ (80097dc ) + 8009656: 881b ldrh r3, [r3, #0] + 8009658: 3b01 subs r3, #1 + 800965a: b29a uxth r2, r3 + 800965c: 4b5f ldr r3, [pc, #380] @ (80097dc ) + 800965e: 801a strh r2, [r3, #0] + } + + pcb->cwnd = LWIP_TCP_CALC_INITIAL_CWND(pcb->mss); + 8009660: 687b ldr r3, [r7, #4] + 8009662: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009664: 009a lsls r2, r3, #2 + 8009666: 687b ldr r3, [r7, #4] + 8009668: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800966a: 005b lsls r3, r3, #1 + 800966c: f241 111c movw r1, #4380 @ 0x111c + 8009670: 428b cmp r3, r1 + 8009672: bf38 it cc + 8009674: 460b movcc r3, r1 + 8009676: 429a cmp r2, r3 + 8009678: d204 bcs.n 8009684 + 800967a: 687b ldr r3, [r7, #4] + 800967c: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800967e: 009b lsls r3, r3, #2 + 8009680: b29b uxth r3, r3 + 8009682: e00d b.n 80096a0 + 8009684: 687b ldr r3, [r7, #4] + 8009686: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009688: 005b lsls r3, r3, #1 + 800968a: f241 121c movw r2, #4380 @ 0x111c + 800968e: 4293 cmp r3, r2 + 8009690: d904 bls.n 800969c + 8009692: 687b ldr r3, [r7, #4] + 8009694: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009696: 005b lsls r3, r3, #1 + 8009698: b29b uxth r3, r3 + 800969a: e001 b.n 80096a0 + 800969c: f241 131c movw r3, #4380 @ 0x111c + 80096a0: 687a ldr r2, [r7, #4] + 80096a2: f8a2 3048 strh.w r3, [r2, #72] @ 0x48 + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_process (SYN_RCVD): cwnd %"TCPWNDSIZE_F + " ssthresh %"TCPWNDSIZE_F"\n", + pcb->cwnd, pcb->ssthresh)); + + if (recv_flags & TF_GOT_FIN) { + 80096a6: 4b4e ldr r3, [pc, #312] @ (80097e0 ) + 80096a8: 781b ldrb r3, [r3, #0] + 80096aa: f003 0320 and.w r3, r3, #32 + 80096ae: 2b00 cmp r3, #0 + 80096b0: d037 beq.n 8009722 + tcp_ack_now(pcb); + 80096b2: 687b ldr r3, [r7, #4] + 80096b4: 8b5b ldrh r3, [r3, #26] + 80096b6: f043 0302 orr.w r3, r3, #2 + 80096ba: b29a uxth r2, r3 + 80096bc: 687b ldr r3, [r7, #4] + 80096be: 835a strh r2, [r3, #26] + pcb->state = CLOSE_WAIT; + 80096c0: 687b ldr r3, [r7, #4] + 80096c2: 2207 movs r2, #7 + 80096c4: 751a strb r2, [r3, #20] + if (recv_flags & TF_GOT_FIN) { + 80096c6: e02c b.n 8009722 + } + } else { + /* incorrect ACK number, send RST */ + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 80096c8: 4b3b ldr r3, [pc, #236] @ (80097b8 ) + 80096ca: 6819 ldr r1, [r3, #0] + 80096cc: 4b3b ldr r3, [pc, #236] @ (80097bc ) + 80096ce: 881b ldrh r3, [r3, #0] + 80096d0: 461a mov r2, r3 + 80096d2: 4b3b ldr r3, [pc, #236] @ (80097c0 ) + 80096d4: 681b ldr r3, [r3, #0] + 80096d6: 18d0 adds r0, r2, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 80096d8: 4b3a ldr r3, [pc, #232] @ (80097c4 ) + 80096da: 681b ldr r3, [r3, #0] + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 80096dc: 885b ldrh r3, [r3, #2] + 80096de: b29b uxth r3, r3 + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + 80096e0: 4a38 ldr r2, [pc, #224] @ (80097c4 ) + 80096e2: 6812 ldr r2, [r2, #0] + tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), + 80096e4: 8812 ldrh r2, [r2, #0] + 80096e6: b292 uxth r2, r2 + 80096e8: 9202 str r2, [sp, #8] + 80096ea: 9301 str r3, [sp, #4] + 80096ec: 4b36 ldr r3, [pc, #216] @ (80097c8 ) + 80096ee: 9300 str r3, [sp, #0] + 80096f0: 4b36 ldr r3, [pc, #216] @ (80097cc ) + 80096f2: 4602 mov r2, r0 + 80096f4: 6878 ldr r0, [r7, #4] + 80096f6: f002 fbcb bl 800be90 + } + } else if ((flags & TCP_SYN) && (seqno == pcb->rcv_nxt - 1)) { + /* Looks like another copy of the SYN - retransmit our SYN-ACK */ + tcp_rexmit(pcb); + } + break; + 80096fa: e167 b.n 80099cc + } else if ((flags & TCP_SYN) && (seqno == pcb->rcv_nxt - 1)) { + 80096fc: 4b2d ldr r3, [pc, #180] @ (80097b4 ) + 80096fe: 781b ldrb r3, [r3, #0] + 8009700: f003 0302 and.w r3, r3, #2 + 8009704: 2b00 cmp r3, #0 + 8009706: f000 8161 beq.w 80099cc + 800970a: 687b ldr r3, [r7, #4] + 800970c: 6a5b ldr r3, [r3, #36] @ 0x24 + 800970e: 1e5a subs r2, r3, #1 + 8009710: 4b2b ldr r3, [pc, #172] @ (80097c0 ) + 8009712: 681b ldr r3, [r3, #0] + 8009714: 429a cmp r2, r3 + 8009716: f040 8159 bne.w 80099cc + tcp_rexmit(pcb); + 800971a: 6878 ldr r0, [r7, #4] + 800971c: f002 f9b2 bl 800ba84 + break; + 8009720: e154 b.n 80099cc + 8009722: e153 b.n 80099cc + case CLOSE_WAIT: + /* FALLTHROUGH */ + case ESTABLISHED: + tcp_receive(pcb); + 8009724: 6878 ldr r0, [r7, #4] + 8009726: f000 fa71 bl 8009c0c + if (recv_flags & TF_GOT_FIN) { /* passive close */ + 800972a: 4b2d ldr r3, [pc, #180] @ (80097e0 ) + 800972c: 781b ldrb r3, [r3, #0] + 800972e: f003 0320 and.w r3, r3, #32 + 8009732: 2b00 cmp r3, #0 + 8009734: f000 814c beq.w 80099d0 + tcp_ack_now(pcb); + 8009738: 687b ldr r3, [r7, #4] + 800973a: 8b5b ldrh r3, [r3, #26] + 800973c: f043 0302 orr.w r3, r3, #2 + 8009740: b29a uxth r2, r3 + 8009742: 687b ldr r3, [r7, #4] + 8009744: 835a strh r2, [r3, #26] + pcb->state = CLOSE_WAIT; + 8009746: 687b ldr r3, [r7, #4] + 8009748: 2207 movs r2, #7 + 800974a: 751a strb r2, [r3, #20] + } + break; + 800974c: e140 b.n 80099d0 + case FIN_WAIT_1: + tcp_receive(pcb); + 800974e: 6878 ldr r0, [r7, #4] + 8009750: f000 fa5c bl 8009c0c + if (recv_flags & TF_GOT_FIN) { + 8009754: 4b22 ldr r3, [pc, #136] @ (80097e0 ) + 8009756: 781b ldrb r3, [r3, #0] + 8009758: f003 0320 and.w r3, r3, #32 + 800975c: 2b00 cmp r3, #0 + 800975e: d071 beq.n 8009844 + if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + 8009760: 4b14 ldr r3, [pc, #80] @ (80097b4 ) + 8009762: 781b ldrb r3, [r3, #0] + 8009764: f003 0310 and.w r3, r3, #16 + 8009768: 2b00 cmp r3, #0 + 800976a: d060 beq.n 800982e + 800976c: 687b ldr r3, [r7, #4] + 800976e: 6d1a ldr r2, [r3, #80] @ 0x50 + 8009770: 4b11 ldr r3, [pc, #68] @ (80097b8 ) + 8009772: 681b ldr r3, [r3, #0] + 8009774: 429a cmp r2, r3 + 8009776: d15a bne.n 800982e + pcb->unsent == NULL) { + 8009778: 687b ldr r3, [r7, #4] + 800977a: 6edb ldr r3, [r3, #108] @ 0x6c + if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + 800977c: 2b00 cmp r3, #0 + 800977e: d156 bne.n 800982e + LWIP_DEBUGF(TCP_DEBUG, + ("TCP connection closed: FIN_WAIT_1 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + tcp_ack_now(pcb); + 8009780: 687b ldr r3, [r7, #4] + 8009782: 8b5b ldrh r3, [r3, #26] + 8009784: f043 0302 orr.w r3, r3, #2 + 8009788: b29a uxth r2, r3 + 800978a: 687b ldr r3, [r7, #4] + 800978c: 835a strh r2, [r3, #26] + tcp_pcb_purge(pcb); + 800978e: 6878 ldr r0, [r7, #4] + 8009790: f7fe fdbc bl 800830c + TCP_RMV_ACTIVE(pcb); + 8009794: 4b13 ldr r3, [pc, #76] @ (80097e4 ) + 8009796: 681b ldr r3, [r3, #0] + 8009798: 687a ldr r2, [r7, #4] + 800979a: 429a cmp r2, r3 + 800979c: d105 bne.n 80097aa + 800979e: 4b11 ldr r3, [pc, #68] @ (80097e4 ) + 80097a0: 681b ldr r3, [r3, #0] + 80097a2: 68db ldr r3, [r3, #12] + 80097a4: 4a0f ldr r2, [pc, #60] @ (80097e4 ) + 80097a6: 6013 str r3, [r2, #0] + 80097a8: e02e b.n 8009808 + 80097aa: 4b0e ldr r3, [pc, #56] @ (80097e4 ) + 80097ac: 681b ldr r3, [r3, #0] + 80097ae: 617b str r3, [r7, #20] + 80097b0: e027 b.n 8009802 + 80097b2: bf00 nop + 80097b4: 200190e8 .word 0x200190e8 + 80097b8: 200190e0 .word 0x200190e0 + 80097bc: 200190e6 .word 0x200190e6 + 80097c0: 200190dc .word 0x200190dc + 80097c4: 200190cc .word 0x200190cc + 80097c8: 2000615c .word 0x2000615c + 80097cc: 20006160 .word 0x20006160 + 80097d0: 0801721c .word 0x0801721c + 80097d4: 080174bc .word 0x080174bc + 80097d8: 08017268 .word 0x08017268 + 80097dc: 200190e4 .word 0x200190e4 + 80097e0: 200190e9 .word 0x200190e9 + 80097e4: 200190b0 .word 0x200190b0 + 80097e8: 697b ldr r3, [r7, #20] + 80097ea: 68db ldr r3, [r3, #12] + 80097ec: 687a ldr r2, [r7, #4] + 80097ee: 429a cmp r2, r3 + 80097f0: d104 bne.n 80097fc + 80097f2: 687b ldr r3, [r7, #4] + 80097f4: 68da ldr r2, [r3, #12] + 80097f6: 697b ldr r3, [r7, #20] + 80097f8: 60da str r2, [r3, #12] + 80097fa: e005 b.n 8009808 + 80097fc: 697b ldr r3, [r7, #20] + 80097fe: 68db ldr r3, [r3, #12] + 8009800: 617b str r3, [r7, #20] + 8009802: 697b ldr r3, [r7, #20] + 8009804: 2b00 cmp r3, #0 + 8009806: d1ef bne.n 80097e8 + 8009808: 687b ldr r3, [r7, #4] + 800980a: 2200 movs r2, #0 + 800980c: 60da str r2, [r3, #12] + 800980e: 4b77 ldr r3, [pc, #476] @ (80099ec ) + 8009810: 2201 movs r2, #1 + 8009812: 701a strb r2, [r3, #0] + pcb->state = TIME_WAIT; + 8009814: 687b ldr r3, [r7, #4] + 8009816: 220a movs r2, #10 + 8009818: 751a strb r2, [r3, #20] + TCP_REG(&tcp_tw_pcbs, pcb); + 800981a: 4b75 ldr r3, [pc, #468] @ (80099f0 ) + 800981c: 681a ldr r2, [r3, #0] + 800981e: 687b ldr r3, [r7, #4] + 8009820: 60da str r2, [r3, #12] + 8009822: 4a73 ldr r2, [pc, #460] @ (80099f0 ) + 8009824: 687b ldr r3, [r7, #4] + 8009826: 6013 str r3, [r2, #0] + 8009828: f002 fcf4 bl 800c214 + } + } else if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + pcb->unsent == NULL) { + pcb->state = FIN_WAIT_2; + } + break; + 800982c: e0d2 b.n 80099d4 + tcp_ack_now(pcb); + 800982e: 687b ldr r3, [r7, #4] + 8009830: 8b5b ldrh r3, [r3, #26] + 8009832: f043 0302 orr.w r3, r3, #2 + 8009836: b29a uxth r2, r3 + 8009838: 687b ldr r3, [r7, #4] + 800983a: 835a strh r2, [r3, #26] + pcb->state = CLOSING; + 800983c: 687b ldr r3, [r7, #4] + 800983e: 2208 movs r2, #8 + 8009840: 751a strb r2, [r3, #20] + break; + 8009842: e0c7 b.n 80099d4 + } else if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + 8009844: 4b6b ldr r3, [pc, #428] @ (80099f4 ) + 8009846: 781b ldrb r3, [r3, #0] + 8009848: f003 0310 and.w r3, r3, #16 + 800984c: 2b00 cmp r3, #0 + 800984e: f000 80c1 beq.w 80099d4 + 8009852: 687b ldr r3, [r7, #4] + 8009854: 6d1a ldr r2, [r3, #80] @ 0x50 + 8009856: 4b68 ldr r3, [pc, #416] @ (80099f8 ) + 8009858: 681b ldr r3, [r3, #0] + 800985a: 429a cmp r2, r3 + 800985c: f040 80ba bne.w 80099d4 + pcb->unsent == NULL) { + 8009860: 687b ldr r3, [r7, #4] + 8009862: 6edb ldr r3, [r3, #108] @ 0x6c + } else if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + 8009864: 2b00 cmp r3, #0 + 8009866: f040 80b5 bne.w 80099d4 + pcb->state = FIN_WAIT_2; + 800986a: 687b ldr r3, [r7, #4] + 800986c: 2206 movs r2, #6 + 800986e: 751a strb r2, [r3, #20] + break; + 8009870: e0b0 b.n 80099d4 + case FIN_WAIT_2: + tcp_receive(pcb); + 8009872: 6878 ldr r0, [r7, #4] + 8009874: f000 f9ca bl 8009c0c + if (recv_flags & TF_GOT_FIN) { + 8009878: 4b60 ldr r3, [pc, #384] @ (80099fc ) + 800987a: 781b ldrb r3, [r3, #0] + 800987c: f003 0320 and.w r3, r3, #32 + 8009880: 2b00 cmp r3, #0 + 8009882: f000 80a9 beq.w 80099d8 + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: FIN_WAIT_2 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + tcp_ack_now(pcb); + 8009886: 687b ldr r3, [r7, #4] + 8009888: 8b5b ldrh r3, [r3, #26] + 800988a: f043 0302 orr.w r3, r3, #2 + 800988e: b29a uxth r2, r3 + 8009890: 687b ldr r3, [r7, #4] + 8009892: 835a strh r2, [r3, #26] + tcp_pcb_purge(pcb); + 8009894: 6878 ldr r0, [r7, #4] + 8009896: f7fe fd39 bl 800830c + TCP_RMV_ACTIVE(pcb); + 800989a: 4b59 ldr r3, [pc, #356] @ (8009a00 ) + 800989c: 681b ldr r3, [r3, #0] + 800989e: 687a ldr r2, [r7, #4] + 80098a0: 429a cmp r2, r3 + 80098a2: d105 bne.n 80098b0 + 80098a4: 4b56 ldr r3, [pc, #344] @ (8009a00 ) + 80098a6: 681b ldr r3, [r3, #0] + 80098a8: 68db ldr r3, [r3, #12] + 80098aa: 4a55 ldr r2, [pc, #340] @ (8009a00 ) + 80098ac: 6013 str r3, [r2, #0] + 80098ae: e013 b.n 80098d8 + 80098b0: 4b53 ldr r3, [pc, #332] @ (8009a00 ) + 80098b2: 681b ldr r3, [r3, #0] + 80098b4: 613b str r3, [r7, #16] + 80098b6: e00c b.n 80098d2 + 80098b8: 693b ldr r3, [r7, #16] + 80098ba: 68db ldr r3, [r3, #12] + 80098bc: 687a ldr r2, [r7, #4] + 80098be: 429a cmp r2, r3 + 80098c0: d104 bne.n 80098cc + 80098c2: 687b ldr r3, [r7, #4] + 80098c4: 68da ldr r2, [r3, #12] + 80098c6: 693b ldr r3, [r7, #16] + 80098c8: 60da str r2, [r3, #12] + 80098ca: e005 b.n 80098d8 + 80098cc: 693b ldr r3, [r7, #16] + 80098ce: 68db ldr r3, [r3, #12] + 80098d0: 613b str r3, [r7, #16] + 80098d2: 693b ldr r3, [r7, #16] + 80098d4: 2b00 cmp r3, #0 + 80098d6: d1ef bne.n 80098b8 + 80098d8: 687b ldr r3, [r7, #4] + 80098da: 2200 movs r2, #0 + 80098dc: 60da str r2, [r3, #12] + 80098de: 4b43 ldr r3, [pc, #268] @ (80099ec ) + 80098e0: 2201 movs r2, #1 + 80098e2: 701a strb r2, [r3, #0] + pcb->state = TIME_WAIT; + 80098e4: 687b ldr r3, [r7, #4] + 80098e6: 220a movs r2, #10 + 80098e8: 751a strb r2, [r3, #20] + TCP_REG(&tcp_tw_pcbs, pcb); + 80098ea: 4b41 ldr r3, [pc, #260] @ (80099f0 ) + 80098ec: 681a ldr r2, [r3, #0] + 80098ee: 687b ldr r3, [r7, #4] + 80098f0: 60da str r2, [r3, #12] + 80098f2: 4a3f ldr r2, [pc, #252] @ (80099f0 ) + 80098f4: 687b ldr r3, [r7, #4] + 80098f6: 6013 str r3, [r2, #0] + 80098f8: f002 fc8c bl 800c214 + } + break; + 80098fc: e06c b.n 80099d8 + case CLOSING: + tcp_receive(pcb); + 80098fe: 6878 ldr r0, [r7, #4] + 8009900: f000 f984 bl 8009c0c + if ((flags & TCP_ACK) && ackno == pcb->snd_nxt && pcb->unsent == NULL) { + 8009904: 4b3b ldr r3, [pc, #236] @ (80099f4 ) + 8009906: 781b ldrb r3, [r3, #0] + 8009908: f003 0310 and.w r3, r3, #16 + 800990c: 2b00 cmp r3, #0 + 800990e: d065 beq.n 80099dc + 8009910: 687b ldr r3, [r7, #4] + 8009912: 6d1a ldr r2, [r3, #80] @ 0x50 + 8009914: 4b38 ldr r3, [pc, #224] @ (80099f8 ) + 8009916: 681b ldr r3, [r3, #0] + 8009918: 429a cmp r2, r3 + 800991a: d15f bne.n 80099dc + 800991c: 687b ldr r3, [r7, #4] + 800991e: 6edb ldr r3, [r3, #108] @ 0x6c + 8009920: 2b00 cmp r3, #0 + 8009922: d15b bne.n 80099dc + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: CLOSING %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + tcp_pcb_purge(pcb); + 8009924: 6878 ldr r0, [r7, #4] + 8009926: f7fe fcf1 bl 800830c + TCP_RMV_ACTIVE(pcb); + 800992a: 4b35 ldr r3, [pc, #212] @ (8009a00 ) + 800992c: 681b ldr r3, [r3, #0] + 800992e: 687a ldr r2, [r7, #4] + 8009930: 429a cmp r2, r3 + 8009932: d105 bne.n 8009940 + 8009934: 4b32 ldr r3, [pc, #200] @ (8009a00 ) + 8009936: 681b ldr r3, [r3, #0] + 8009938: 68db ldr r3, [r3, #12] + 800993a: 4a31 ldr r2, [pc, #196] @ (8009a00 ) + 800993c: 6013 str r3, [r2, #0] + 800993e: e013 b.n 8009968 + 8009940: 4b2f ldr r3, [pc, #188] @ (8009a00 ) + 8009942: 681b ldr r3, [r3, #0] + 8009944: 60fb str r3, [r7, #12] + 8009946: e00c b.n 8009962 + 8009948: 68fb ldr r3, [r7, #12] + 800994a: 68db ldr r3, [r3, #12] + 800994c: 687a ldr r2, [r7, #4] + 800994e: 429a cmp r2, r3 + 8009950: d104 bne.n 800995c + 8009952: 687b ldr r3, [r7, #4] + 8009954: 68da ldr r2, [r3, #12] + 8009956: 68fb ldr r3, [r7, #12] + 8009958: 60da str r2, [r3, #12] + 800995a: e005 b.n 8009968 + 800995c: 68fb ldr r3, [r7, #12] + 800995e: 68db ldr r3, [r3, #12] + 8009960: 60fb str r3, [r7, #12] + 8009962: 68fb ldr r3, [r7, #12] + 8009964: 2b00 cmp r3, #0 + 8009966: d1ef bne.n 8009948 + 8009968: 687b ldr r3, [r7, #4] + 800996a: 2200 movs r2, #0 + 800996c: 60da str r2, [r3, #12] + 800996e: 4b1f ldr r3, [pc, #124] @ (80099ec ) + 8009970: 2201 movs r2, #1 + 8009972: 701a strb r2, [r3, #0] + pcb->state = TIME_WAIT; + 8009974: 687b ldr r3, [r7, #4] + 8009976: 220a movs r2, #10 + 8009978: 751a strb r2, [r3, #20] + TCP_REG(&tcp_tw_pcbs, pcb); + 800997a: 4b1d ldr r3, [pc, #116] @ (80099f0 ) + 800997c: 681a ldr r2, [r3, #0] + 800997e: 687b ldr r3, [r7, #4] + 8009980: 60da str r2, [r3, #12] + 8009982: 4a1b ldr r2, [pc, #108] @ (80099f0 ) + 8009984: 687b ldr r3, [r7, #4] + 8009986: 6013 str r3, [r2, #0] + 8009988: f002 fc44 bl 800c214 + } + break; + 800998c: e026 b.n 80099dc + case LAST_ACK: + tcp_receive(pcb); + 800998e: 6878 ldr r0, [r7, #4] + 8009990: f000 f93c bl 8009c0c + if ((flags & TCP_ACK) && ackno == pcb->snd_nxt && pcb->unsent == NULL) { + 8009994: 4b17 ldr r3, [pc, #92] @ (80099f4 ) + 8009996: 781b ldrb r3, [r3, #0] + 8009998: f003 0310 and.w r3, r3, #16 + 800999c: 2b00 cmp r3, #0 + 800999e: d01f beq.n 80099e0 + 80099a0: 687b ldr r3, [r7, #4] + 80099a2: 6d1a ldr r2, [r3, #80] @ 0x50 + 80099a4: 4b14 ldr r3, [pc, #80] @ (80099f8 ) + 80099a6: 681b ldr r3, [r3, #0] + 80099a8: 429a cmp r2, r3 + 80099aa: d119 bne.n 80099e0 + 80099ac: 687b ldr r3, [r7, #4] + 80099ae: 6edb ldr r3, [r3, #108] @ 0x6c + 80099b0: 2b00 cmp r3, #0 + 80099b2: d115 bne.n 80099e0 + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: LAST_ACK %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + /* bugfix #21699: don't set pcb->state to CLOSED here or we risk leaking segments */ + recv_flags |= TF_CLOSED; + 80099b4: 4b11 ldr r3, [pc, #68] @ (80099fc ) + 80099b6: 781b ldrb r3, [r3, #0] + 80099b8: f043 0310 orr.w r3, r3, #16 + 80099bc: b2da uxtb r2, r3 + 80099be: 4b0f ldr r3, [pc, #60] @ (80099fc ) + 80099c0: 701a strb r2, [r3, #0] + } + break; + 80099c2: e00d b.n 80099e0 + default: + break; + 80099c4: bf00 nop + 80099c6: e00c b.n 80099e2 + break; + 80099c8: bf00 nop + 80099ca: e00a b.n 80099e2 + break; + 80099cc: bf00 nop + 80099ce: e008 b.n 80099e2 + break; + 80099d0: bf00 nop + 80099d2: e006 b.n 80099e2 + break; + 80099d4: bf00 nop + 80099d6: e004 b.n 80099e2 + break; + 80099d8: bf00 nop + 80099da: e002 b.n 80099e2 + break; + 80099dc: bf00 nop + 80099de: e000 b.n 80099e2 + break; + 80099e0: bf00 nop + } + return ERR_OK; + 80099e2: 2300 movs r3, #0 +} + 80099e4: 4618 mov r0, r3 + 80099e6: 3724 adds r7, #36 @ 0x24 + 80099e8: 46bd mov sp, r7 + 80099ea: bd90 pop {r4, r7, pc} + 80099ec: 200190b8 .word 0x200190b8 + 80099f0: 200190b4 .word 0x200190b4 + 80099f4: 200190e8 .word 0x200190e8 + 80099f8: 200190e0 .word 0x200190e0 + 80099fc: 200190e9 .word 0x200190e9 + 8009a00: 200190b0 .word 0x200190b0 + +08009a04 : + * + * Called from tcp_receive() + */ +static void +tcp_oos_insert_segment(struct tcp_seg *cseg, struct tcp_seg *next) +{ + 8009a04: b590 push {r4, r7, lr} + 8009a06: b085 sub sp, #20 + 8009a08: af00 add r7, sp, #0 + 8009a0a: 6078 str r0, [r7, #4] + 8009a0c: 6039 str r1, [r7, #0] + struct tcp_seg *old_seg; + + LWIP_ASSERT("tcp_oos_insert_segment: invalid cseg", cseg != NULL); + 8009a0e: 687b ldr r3, [r7, #4] + 8009a10: 2b00 cmp r3, #0 + 8009a12: d106 bne.n 8009a22 + 8009a14: 4b3b ldr r3, [pc, #236] @ (8009b04 ) + 8009a16: f240 421f movw r2, #1055 @ 0x41f + 8009a1a: 493b ldr r1, [pc, #236] @ (8009b08 ) + 8009a1c: 483b ldr r0, [pc, #236] @ (8009b0c ) + 8009a1e: f007 fdeb bl 80115f8 + + if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) { + 8009a22: 687b ldr r3, [r7, #4] + 8009a24: 68db ldr r3, [r3, #12] + 8009a26: 899b ldrh r3, [r3, #12] + 8009a28: b29b uxth r3, r3 + 8009a2a: 4618 mov r0, r3 + 8009a2c: f7fb fcac bl 8005388 + 8009a30: 4603 mov r3, r0 + 8009a32: b2db uxtb r3, r3 + 8009a34: f003 0301 and.w r3, r3, #1 + 8009a38: 2b00 cmp r3, #0 + 8009a3a: d028 beq.n 8009a8e + /* received segment overlaps all following segments */ + tcp_segs_free(next); + 8009a3c: 6838 ldr r0, [r7, #0] + 8009a3e: f7fe fa63 bl 8007f08 + next = NULL; + 8009a42: 2300 movs r3, #0 + 8009a44: 603b str r3, [r7, #0] + 8009a46: e056 b.n 8009af6 + oos queue may have segments with FIN flag */ + while (next && + TCP_SEQ_GEQ((seqno + cseg->len), + (next->tcphdr->seqno + next->len))) { + /* cseg with FIN already processed */ + if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) { + 8009a48: 683b ldr r3, [r7, #0] + 8009a4a: 68db ldr r3, [r3, #12] + 8009a4c: 899b ldrh r3, [r3, #12] + 8009a4e: b29b uxth r3, r3 + 8009a50: 4618 mov r0, r3 + 8009a52: f7fb fc99 bl 8005388 + 8009a56: 4603 mov r3, r0 + 8009a58: b2db uxtb r3, r3 + 8009a5a: f003 0301 and.w r3, r3, #1 + 8009a5e: 2b00 cmp r3, #0 + 8009a60: d00d beq.n 8009a7e + TCPH_SET_FLAG(cseg->tcphdr, TCP_FIN); + 8009a62: 687b ldr r3, [r7, #4] + 8009a64: 68db ldr r3, [r3, #12] + 8009a66: 899b ldrh r3, [r3, #12] + 8009a68: b29c uxth r4, r3 + 8009a6a: 2001 movs r0, #1 + 8009a6c: f7fb fc8c bl 8005388 + 8009a70: 4603 mov r3, r0 + 8009a72: 461a mov r2, r3 + 8009a74: 687b ldr r3, [r7, #4] + 8009a76: 68db ldr r3, [r3, #12] + 8009a78: 4322 orrs r2, r4 + 8009a7a: b292 uxth r2, r2 + 8009a7c: 819a strh r2, [r3, #12] + } + old_seg = next; + 8009a7e: 683b ldr r3, [r7, #0] + 8009a80: 60fb str r3, [r7, #12] + next = next->next; + 8009a82: 683b ldr r3, [r7, #0] + 8009a84: 681b ldr r3, [r3, #0] + 8009a86: 603b str r3, [r7, #0] + tcp_seg_free(old_seg); + 8009a88: 68f8 ldr r0, [r7, #12] + 8009a8a: f7fe fa52 bl 8007f32 + while (next && + 8009a8e: 683b ldr r3, [r7, #0] + 8009a90: 2b00 cmp r3, #0 + 8009a92: d00e beq.n 8009ab2 + TCP_SEQ_GEQ((seqno + cseg->len), + 8009a94: 687b ldr r3, [r7, #4] + 8009a96: 891b ldrh r3, [r3, #8] + 8009a98: 461a mov r2, r3 + 8009a9a: 4b1d ldr r3, [pc, #116] @ (8009b10 ) + 8009a9c: 681b ldr r3, [r3, #0] + 8009a9e: 441a add r2, r3 + 8009aa0: 683b ldr r3, [r7, #0] + 8009aa2: 68db ldr r3, [r3, #12] + 8009aa4: 685b ldr r3, [r3, #4] + 8009aa6: 6839 ldr r1, [r7, #0] + 8009aa8: 8909 ldrh r1, [r1, #8] + 8009aaa: 440b add r3, r1 + 8009aac: 1ad3 subs r3, r2, r3 + while (next && + 8009aae: 2b00 cmp r3, #0 + 8009ab0: daca bge.n 8009a48 + } + if (next && + 8009ab2: 683b ldr r3, [r7, #0] + 8009ab4: 2b00 cmp r3, #0 + 8009ab6: d01e beq.n 8009af6 + TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) { + 8009ab8: 687b ldr r3, [r7, #4] + 8009aba: 891b ldrh r3, [r3, #8] + 8009abc: 461a mov r2, r3 + 8009abe: 4b14 ldr r3, [pc, #80] @ (8009b10 ) + 8009ac0: 681b ldr r3, [r3, #0] + 8009ac2: 441a add r2, r3 + 8009ac4: 683b ldr r3, [r7, #0] + 8009ac6: 68db ldr r3, [r3, #12] + 8009ac8: 685b ldr r3, [r3, #4] + 8009aca: 1ad3 subs r3, r2, r3 + if (next && + 8009acc: 2b00 cmp r3, #0 + 8009ace: dd12 ble.n 8009af6 + /* We need to trim the incoming segment. */ + cseg->len = (u16_t)(next->tcphdr->seqno - seqno); + 8009ad0: 683b ldr r3, [r7, #0] + 8009ad2: 68db ldr r3, [r3, #12] + 8009ad4: 685b ldr r3, [r3, #4] + 8009ad6: b29a uxth r2, r3 + 8009ad8: 4b0d ldr r3, [pc, #52] @ (8009b10 ) + 8009ada: 681b ldr r3, [r3, #0] + 8009adc: b29b uxth r3, r3 + 8009ade: 1ad3 subs r3, r2, r3 + 8009ae0: b29a uxth r2, r3 + 8009ae2: 687b ldr r3, [r7, #4] + 8009ae4: 811a strh r2, [r3, #8] + pbuf_realloc(cseg->p, cseg->len); + 8009ae6: 687b ldr r3, [r7, #4] + 8009ae8: 685a ldr r2, [r3, #4] + 8009aea: 687b ldr r3, [r7, #4] + 8009aec: 891b ldrh r3, [r3, #8] + 8009aee: 4619 mov r1, r3 + 8009af0: 4610 mov r0, r2 + 8009af2: f7fc fe15 bl 8006720 + } + } + cseg->next = next; + 8009af6: 687b ldr r3, [r7, #4] + 8009af8: 683a ldr r2, [r7, #0] + 8009afa: 601a str r2, [r3, #0] +} + 8009afc: bf00 nop + 8009afe: 3714 adds r7, #20 + 8009b00: 46bd mov sp, r7 + 8009b02: bd90 pop {r4, r7, pc} + 8009b04: 0801721c .word 0x0801721c + 8009b08: 080174dc .word 0x080174dc + 8009b0c: 08017268 .word 0x08017268 + 8009b10: 200190dc .word 0x200190dc + +08009b14 : + +/** Remove segments from a list if the incoming ACK acknowledges them */ +static struct tcp_seg * +tcp_free_acked_segments(struct tcp_pcb *pcb, struct tcp_seg *seg_list, const char *dbg_list_name, + struct tcp_seg *dbg_other_seg_list) +{ + 8009b14: b5b0 push {r4, r5, r7, lr} + 8009b16: b086 sub sp, #24 + 8009b18: af00 add r7, sp, #0 + 8009b1a: 60f8 str r0, [r7, #12] + 8009b1c: 60b9 str r1, [r7, #8] + 8009b1e: 607a str r2, [r7, #4] + 8009b20: 603b str r3, [r7, #0] + u16_t clen; + + LWIP_UNUSED_ARG(dbg_list_name); + LWIP_UNUSED_ARG(dbg_other_seg_list); + + while (seg_list != NULL && + 8009b22: e03e b.n 8009ba2 + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->%s\n", + lwip_ntohl(seg_list->tcphdr->seqno), + lwip_ntohl(seg_list->tcphdr->seqno) + TCP_TCPLEN(seg_list), + dbg_list_name)); + + next = seg_list; + 8009b24: 68bb ldr r3, [r7, #8] + 8009b26: 617b str r3, [r7, #20] + seg_list = seg_list->next; + 8009b28: 68bb ldr r3, [r7, #8] + 8009b2a: 681b ldr r3, [r3, #0] + 8009b2c: 60bb str r3, [r7, #8] + + clen = pbuf_clen(next->p); + 8009b2e: 697b ldr r3, [r7, #20] + 8009b30: 685b ldr r3, [r3, #4] + 8009b32: 4618 mov r0, r3 + 8009b34: f7fd f800 bl 8006b38 + 8009b38: 4603 mov r3, r0 + 8009b3a: 827b strh r3, [r7, #18] + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"TCPWNDSIZE_F" ... ", + (tcpwnd_size_t)pcb->snd_queuelen)); + LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= clen)); + 8009b3c: 68fb ldr r3, [r7, #12] + 8009b3e: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 8009b42: 8a7a ldrh r2, [r7, #18] + 8009b44: 429a cmp r2, r3 + 8009b46: d906 bls.n 8009b56 + 8009b48: 4b2a ldr r3, [pc, #168] @ (8009bf4 ) + 8009b4a: f240 4257 movw r2, #1111 @ 0x457 + 8009b4e: 492a ldr r1, [pc, #168] @ (8009bf8 ) + 8009b50: 482a ldr r0, [pc, #168] @ (8009bfc ) + 8009b52: f007 fd51 bl 80115f8 + + pcb->snd_queuelen = (u16_t)(pcb->snd_queuelen - clen); + 8009b56: 68fb ldr r3, [r7, #12] + 8009b58: f8b3 2066 ldrh.w r2, [r3, #102] @ 0x66 + 8009b5c: 8a7b ldrh r3, [r7, #18] + 8009b5e: 1ad3 subs r3, r2, r3 + 8009b60: b29a uxth r2, r3 + 8009b62: 68fb ldr r3, [r7, #12] + 8009b64: f8a3 2066 strh.w r2, [r3, #102] @ 0x66 + recv_acked = (tcpwnd_size_t)(recv_acked + next->len); + 8009b68: 697b ldr r3, [r7, #20] + 8009b6a: 891a ldrh r2, [r3, #8] + 8009b6c: 4b24 ldr r3, [pc, #144] @ (8009c00 ) + 8009b6e: 881b ldrh r3, [r3, #0] + 8009b70: 4413 add r3, r2 + 8009b72: b29a uxth r2, r3 + 8009b74: 4b22 ldr r3, [pc, #136] @ (8009c00 ) + 8009b76: 801a strh r2, [r3, #0] + tcp_seg_free(next); + 8009b78: 6978 ldr r0, [r7, #20] + 8009b7a: f7fe f9da bl 8007f32 + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("%"TCPWNDSIZE_F" (after freeing %s)\n", + (tcpwnd_size_t)pcb->snd_queuelen, + dbg_list_name)); + if (pcb->snd_queuelen != 0) { + 8009b7e: 68fb ldr r3, [r7, #12] + 8009b80: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 8009b84: 2b00 cmp r3, #0 + 8009b86: d00c beq.n 8009ba2 + LWIP_ASSERT("tcp_receive: valid queue length", + 8009b88: 68bb ldr r3, [r7, #8] + 8009b8a: 2b00 cmp r3, #0 + 8009b8c: d109 bne.n 8009ba2 + 8009b8e: 683b ldr r3, [r7, #0] + 8009b90: 2b00 cmp r3, #0 + 8009b92: d106 bne.n 8009ba2 + 8009b94: 4b17 ldr r3, [pc, #92] @ (8009bf4 ) + 8009b96: f240 4261 movw r2, #1121 @ 0x461 + 8009b9a: 491a ldr r1, [pc, #104] @ (8009c04 ) + 8009b9c: 4817 ldr r0, [pc, #92] @ (8009bfc ) + 8009b9e: f007 fd2b bl 80115f8 + while (seg_list != NULL && + 8009ba2: 68bb ldr r3, [r7, #8] + 8009ba4: 2b00 cmp r3, #0 + 8009ba6: d020 beq.n 8009bea + TCP_SEQ_LEQ(lwip_ntohl(seg_list->tcphdr->seqno) + + 8009ba8: 68bb ldr r3, [r7, #8] + 8009baa: 68db ldr r3, [r3, #12] + 8009bac: 685b ldr r3, [r3, #4] + 8009bae: 4618 mov r0, r3 + 8009bb0: f7fb fbff bl 80053b2 + 8009bb4: 4604 mov r4, r0 + 8009bb6: 68bb ldr r3, [r7, #8] + 8009bb8: 891b ldrh r3, [r3, #8] + 8009bba: 461d mov r5, r3 + 8009bbc: 68bb ldr r3, [r7, #8] + 8009bbe: 68db ldr r3, [r3, #12] + 8009bc0: 899b ldrh r3, [r3, #12] + 8009bc2: b29b uxth r3, r3 + 8009bc4: 4618 mov r0, r3 + 8009bc6: f7fb fbdf bl 8005388 + 8009bca: 4603 mov r3, r0 + 8009bcc: b2db uxtb r3, r3 + 8009bce: f003 0303 and.w r3, r3, #3 + 8009bd2: 2b00 cmp r3, #0 + 8009bd4: d001 beq.n 8009bda + 8009bd6: 2301 movs r3, #1 + 8009bd8: e000 b.n 8009bdc + 8009bda: 2300 movs r3, #0 + 8009bdc: 442b add r3, r5 + 8009bde: 18e2 adds r2, r4, r3 + 8009be0: 4b09 ldr r3, [pc, #36] @ (8009c08 ) + 8009be2: 681b ldr r3, [r3, #0] + 8009be4: 1ad3 subs r3, r2, r3 + while (seg_list != NULL && + 8009be6: 2b00 cmp r3, #0 + 8009be8: dd9c ble.n 8009b24 + seg_list != NULL || dbg_other_seg_list != NULL); + } + } + return seg_list; + 8009bea: 68bb ldr r3, [r7, #8] +} + 8009bec: 4618 mov r0, r3 + 8009bee: 3718 adds r7, #24 + 8009bf0: 46bd mov sp, r7 + 8009bf2: bdb0 pop {r4, r5, r7, pc} + 8009bf4: 0801721c .word 0x0801721c + 8009bf8: 08017504 .word 0x08017504 + 8009bfc: 08017268 .word 0x08017268 + 8009c00: 200190e4 .word 0x200190e4 + 8009c04: 0801752c .word 0x0801752c + 8009c08: 200190e0 .word 0x200190e0 + +08009c0c : + * + * Called from tcp_process(). + */ +static void +tcp_receive(struct tcp_pcb *pcb) +{ + 8009c0c: b5b0 push {r4, r5, r7, lr} + 8009c0e: b094 sub sp, #80 @ 0x50 + 8009c10: af00 add r7, sp, #0 + 8009c12: 6078 str r0, [r7, #4] + s16_t m; + u32_t right_wnd_edge; + int found_dupack = 0; + 8009c14: 2300 movs r3, #0 + 8009c16: 64bb str r3, [r7, #72] @ 0x48 + + LWIP_ASSERT("tcp_receive: invalid pcb", pcb != NULL); + 8009c18: 687b ldr r3, [r7, #4] + 8009c1a: 2b00 cmp r3, #0 + 8009c1c: d106 bne.n 8009c2c + 8009c1e: 4b91 ldr r3, [pc, #580] @ (8009e64 ) + 8009c20: f240 427b movw r2, #1147 @ 0x47b + 8009c24: 4990 ldr r1, [pc, #576] @ (8009e68 ) + 8009c26: 4891 ldr r0, [pc, #580] @ (8009e6c ) + 8009c28: f007 fce6 bl 80115f8 + LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED); + 8009c2c: 687b ldr r3, [r7, #4] + 8009c2e: 7d1b ldrb r3, [r3, #20] + 8009c30: 2b03 cmp r3, #3 + 8009c32: d806 bhi.n 8009c42 + 8009c34: 4b8b ldr r3, [pc, #556] @ (8009e64 ) + 8009c36: f240 427c movw r2, #1148 @ 0x47c + 8009c3a: 498d ldr r1, [pc, #564] @ (8009e70 ) + 8009c3c: 488b ldr r0, [pc, #556] @ (8009e6c ) + 8009c3e: f007 fcdb bl 80115f8 + + if (flags & TCP_ACK) { + 8009c42: 4b8c ldr r3, [pc, #560] @ (8009e74 ) + 8009c44: 781b ldrb r3, [r3, #0] + 8009c46: f003 0310 and.w r3, r3, #16 + 8009c4a: 2b00 cmp r3, #0 + 8009c4c: f000 8264 beq.w 800a118 + right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2; + 8009c50: 687b ldr r3, [r7, #4] + 8009c52: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 8009c56: 461a mov r2, r3 + 8009c58: 687b ldr r3, [r7, #4] + 8009c5a: 6d9b ldr r3, [r3, #88] @ 0x58 + 8009c5c: 4413 add r3, r2 + 8009c5e: 633b str r3, [r7, #48] @ 0x30 + + /* Update window. */ + if (TCP_SEQ_LT(pcb->snd_wl1, seqno) || + 8009c60: 687b ldr r3, [r7, #4] + 8009c62: 6d5a ldr r2, [r3, #84] @ 0x54 + 8009c64: 4b84 ldr r3, [pc, #528] @ (8009e78 ) + 8009c66: 681b ldr r3, [r3, #0] + 8009c68: 1ad3 subs r3, r2, r3 + 8009c6a: 2b00 cmp r3, #0 + 8009c6c: db1b blt.n 8009ca6 + (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) || + 8009c6e: 687b ldr r3, [r7, #4] + 8009c70: 6d5a ldr r2, [r3, #84] @ 0x54 + 8009c72: 4b81 ldr r3, [pc, #516] @ (8009e78 ) + 8009c74: 681b ldr r3, [r3, #0] + if (TCP_SEQ_LT(pcb->snd_wl1, seqno) || + 8009c76: 429a cmp r2, r3 + 8009c78: d106 bne.n 8009c88 + (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) || + 8009c7a: 687b ldr r3, [r7, #4] + 8009c7c: 6d9a ldr r2, [r3, #88] @ 0x58 + 8009c7e: 4b7f ldr r3, [pc, #508] @ (8009e7c ) + 8009c80: 681b ldr r3, [r3, #0] + 8009c82: 1ad3 subs r3, r2, r3 + 8009c84: 2b00 cmp r3, #0 + 8009c86: db0e blt.n 8009ca6 + (pcb->snd_wl2 == ackno && (u32_t)SND_WND_SCALE(pcb, tcphdr->wnd) > pcb->snd_wnd)) { + 8009c88: 687b ldr r3, [r7, #4] + 8009c8a: 6d9a ldr r2, [r3, #88] @ 0x58 + 8009c8c: 4b7b ldr r3, [pc, #492] @ (8009e7c ) + 8009c8e: 681b ldr r3, [r3, #0] + (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) || + 8009c90: 429a cmp r2, r3 + 8009c92: d125 bne.n 8009ce0 + (pcb->snd_wl2 == ackno && (u32_t)SND_WND_SCALE(pcb, tcphdr->wnd) > pcb->snd_wnd)) { + 8009c94: 4b7a ldr r3, [pc, #488] @ (8009e80 ) + 8009c96: 681b ldr r3, [r3, #0] + 8009c98: 89db ldrh r3, [r3, #14] + 8009c9a: b29a uxth r2, r3 + 8009c9c: 687b ldr r3, [r7, #4] + 8009c9e: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 8009ca2: 429a cmp r2, r3 + 8009ca4: d91c bls.n 8009ce0 + pcb->snd_wnd = SND_WND_SCALE(pcb, tcphdr->wnd); + 8009ca6: 4b76 ldr r3, [pc, #472] @ (8009e80 ) + 8009ca8: 681b ldr r3, [r3, #0] + 8009caa: 89db ldrh r3, [r3, #14] + 8009cac: b29a uxth r2, r3 + 8009cae: 687b ldr r3, [r7, #4] + 8009cb0: f8a3 2060 strh.w r2, [r3, #96] @ 0x60 + /* keep track of the biggest window announced by the remote host to calculate + the maximum segment size */ + if (pcb->snd_wnd_max < pcb->snd_wnd) { + 8009cb4: 687b ldr r3, [r7, #4] + 8009cb6: f8b3 2062 ldrh.w r2, [r3, #98] @ 0x62 + 8009cba: 687b ldr r3, [r7, #4] + 8009cbc: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 8009cc0: 429a cmp r2, r3 + 8009cc2: d205 bcs.n 8009cd0 + pcb->snd_wnd_max = pcb->snd_wnd; + 8009cc4: 687b ldr r3, [r7, #4] + 8009cc6: f8b3 2060 ldrh.w r2, [r3, #96] @ 0x60 + 8009cca: 687b ldr r3, [r7, #4] + 8009ccc: f8a3 2062 strh.w r2, [r3, #98] @ 0x62 + } + pcb->snd_wl1 = seqno; + 8009cd0: 4b69 ldr r3, [pc, #420] @ (8009e78 ) + 8009cd2: 681a ldr r2, [r3, #0] + 8009cd4: 687b ldr r3, [r7, #4] + 8009cd6: 655a str r2, [r3, #84] @ 0x54 + pcb->snd_wl2 = ackno; + 8009cd8: 4b68 ldr r3, [pc, #416] @ (8009e7c ) + 8009cda: 681a ldr r2, [r3, #0] + 8009cdc: 687b ldr r3, [r7, #4] + 8009cde: 659a str r2, [r3, #88] @ 0x58 + * If it only passes 1, should reset dupack counter + * + */ + + /* Clause 1 */ + if (TCP_SEQ_LEQ(ackno, pcb->lastack)) { + 8009ce0: 4b66 ldr r3, [pc, #408] @ (8009e7c ) + 8009ce2: 681a ldr r2, [r3, #0] + 8009ce4: 687b ldr r3, [r7, #4] + 8009ce6: 6c5b ldr r3, [r3, #68] @ 0x44 + 8009ce8: 1ad3 subs r3, r2, r3 + 8009cea: 2b00 cmp r3, #0 + 8009cec: dc58 bgt.n 8009da0 + /* Clause 2 */ + if (tcplen == 0) { + 8009cee: 4b65 ldr r3, [pc, #404] @ (8009e84 ) + 8009cf0: 881b ldrh r3, [r3, #0] + 8009cf2: 2b00 cmp r3, #0 + 8009cf4: d14b bne.n 8009d8e + /* Clause 3 */ + if (pcb->snd_wl2 + pcb->snd_wnd == right_wnd_edge) { + 8009cf6: 687b ldr r3, [r7, #4] + 8009cf8: 6d9b ldr r3, [r3, #88] @ 0x58 + 8009cfa: 687a ldr r2, [r7, #4] + 8009cfc: f8b2 2060 ldrh.w r2, [r2, #96] @ 0x60 + 8009d00: 4413 add r3, r2 + 8009d02: 6b3a ldr r2, [r7, #48] @ 0x30 + 8009d04: 429a cmp r2, r3 + 8009d06: d142 bne.n 8009d8e + /* Clause 4 */ + if (pcb->rtime >= 0) { + 8009d08: 687b ldr r3, [r7, #4] + 8009d0a: f9b3 3030 ldrsh.w r3, [r3, #48] @ 0x30 + 8009d0e: 2b00 cmp r3, #0 + 8009d10: db3d blt.n 8009d8e + /* Clause 5 */ + if (pcb->lastack == ackno) { + 8009d12: 687b ldr r3, [r7, #4] + 8009d14: 6c5a ldr r2, [r3, #68] @ 0x44 + 8009d16: 4b59 ldr r3, [pc, #356] @ (8009e7c ) + 8009d18: 681b ldr r3, [r3, #0] + 8009d1a: 429a cmp r2, r3 + 8009d1c: d137 bne.n 8009d8e + found_dupack = 1; + 8009d1e: 2301 movs r3, #1 + 8009d20: 64bb str r3, [r7, #72] @ 0x48 + if ((u8_t)(pcb->dupacks + 1) > pcb->dupacks) { + 8009d22: 687b ldr r3, [r7, #4] + 8009d24: f893 3043 ldrb.w r3, [r3, #67] @ 0x43 + 8009d28: 2bff cmp r3, #255 @ 0xff + 8009d2a: d007 beq.n 8009d3c + ++pcb->dupacks; + 8009d2c: 687b ldr r3, [r7, #4] + 8009d2e: f893 3043 ldrb.w r3, [r3, #67] @ 0x43 + 8009d32: 3301 adds r3, #1 + 8009d34: b2da uxtb r2, r3 + 8009d36: 687b ldr r3, [r7, #4] + 8009d38: f883 2043 strb.w r2, [r3, #67] @ 0x43 + } + if (pcb->dupacks > 3) { + 8009d3c: 687b ldr r3, [r7, #4] + 8009d3e: f893 3043 ldrb.w r3, [r3, #67] @ 0x43 + 8009d42: 2b03 cmp r3, #3 + 8009d44: d91b bls.n 8009d7e + /* Inflate the congestion window */ + TCP_WND_INC(pcb->cwnd, pcb->mss); + 8009d46: 687b ldr r3, [r7, #4] + 8009d48: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009d4c: 687b ldr r3, [r7, #4] + 8009d4e: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009d50: 4413 add r3, r2 + 8009d52: b29a uxth r2, r3 + 8009d54: 687b ldr r3, [r7, #4] + 8009d56: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 8009d5a: 429a cmp r2, r3 + 8009d5c: d30a bcc.n 8009d74 + 8009d5e: 687b ldr r3, [r7, #4] + 8009d60: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009d64: 687b ldr r3, [r7, #4] + 8009d66: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009d68: 4413 add r3, r2 + 8009d6a: b29a uxth r2, r3 + 8009d6c: 687b ldr r3, [r7, #4] + 8009d6e: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + 8009d72: e004 b.n 8009d7e + 8009d74: 687b ldr r3, [r7, #4] + 8009d76: f64f 72ff movw r2, #65535 @ 0xffff + 8009d7a: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + } + if (pcb->dupacks >= 3) { + 8009d7e: 687b ldr r3, [r7, #4] + 8009d80: f893 3043 ldrb.w r3, [r3, #67] @ 0x43 + 8009d84: 2b02 cmp r3, #2 + 8009d86: d902 bls.n 8009d8e + /* Do fast retransmit (checked via TF_INFR, not via dupacks count) */ + tcp_rexmit_fast(pcb); + 8009d88: 6878 ldr r0, [r7, #4] + 8009d8a: f001 fee7 bl 800bb5c + } + } + } + /* If Clause (1) or more is true, but not a duplicate ack, reset + * count of consecutive duplicate acks */ + if (!found_dupack) { + 8009d8e: 6cbb ldr r3, [r7, #72] @ 0x48 + 8009d90: 2b00 cmp r3, #0 + 8009d92: f040 8161 bne.w 800a058 + pcb->dupacks = 0; + 8009d96: 687b ldr r3, [r7, #4] + 8009d98: 2200 movs r2, #0 + 8009d9a: f883 2043 strb.w r2, [r3, #67] @ 0x43 + 8009d9e: e15b b.n 800a058 + } + } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack + 1, pcb->snd_nxt)) { + 8009da0: 4b36 ldr r3, [pc, #216] @ (8009e7c ) + 8009da2: 681a ldr r2, [r3, #0] + 8009da4: 687b ldr r3, [r7, #4] + 8009da6: 6c5b ldr r3, [r3, #68] @ 0x44 + 8009da8: 1ad3 subs r3, r2, r3 + 8009daa: 3b01 subs r3, #1 + 8009dac: 2b00 cmp r3, #0 + 8009dae: f2c0 814e blt.w 800a04e + 8009db2: 4b32 ldr r3, [pc, #200] @ (8009e7c ) + 8009db4: 681a ldr r2, [r3, #0] + 8009db6: 687b ldr r3, [r7, #4] + 8009db8: 6d1b ldr r3, [r3, #80] @ 0x50 + 8009dba: 1ad3 subs r3, r2, r3 + 8009dbc: 2b00 cmp r3, #0 + 8009dbe: f300 8146 bgt.w 800a04e + tcpwnd_size_t acked; + + /* Reset the "IN Fast Retransmit" flag, since we are no longer + in fast retransmit. Also reset the congestion window to the + slow start threshold. */ + if (pcb->flags & TF_INFR) { + 8009dc2: 687b ldr r3, [r7, #4] + 8009dc4: 8b5b ldrh r3, [r3, #26] + 8009dc6: f003 0304 and.w r3, r3, #4 + 8009dca: 2b00 cmp r3, #0 + 8009dcc: d010 beq.n 8009df0 + tcp_clear_flags(pcb, TF_INFR); + 8009dce: 687b ldr r3, [r7, #4] + 8009dd0: 8b5b ldrh r3, [r3, #26] + 8009dd2: f023 0304 bic.w r3, r3, #4 + 8009dd6: b29a uxth r2, r3 + 8009dd8: 687b ldr r3, [r7, #4] + 8009dda: 835a strh r2, [r3, #26] + pcb->cwnd = pcb->ssthresh; + 8009ddc: 687b ldr r3, [r7, #4] + 8009dde: f8b3 204a ldrh.w r2, [r3, #74] @ 0x4a + 8009de2: 687b ldr r3, [r7, #4] + 8009de4: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + pcb->bytes_acked = 0; + 8009de8: 687b ldr r3, [r7, #4] + 8009dea: 2200 movs r2, #0 + 8009dec: f8a3 206a strh.w r2, [r3, #106] @ 0x6a + } + + /* Reset the number of retransmissions. */ + pcb->nrtx = 0; + 8009df0: 687b ldr r3, [r7, #4] + 8009df2: 2200 movs r2, #0 + 8009df4: f883 2042 strb.w r2, [r3, #66] @ 0x42 + + /* Reset the retransmission time-out. */ + pcb->rto = (s16_t)((pcb->sa >> 3) + pcb->sv); + 8009df8: 687b ldr r3, [r7, #4] + 8009dfa: f9b3 303c ldrsh.w r3, [r3, #60] @ 0x3c + 8009dfe: 10db asrs r3, r3, #3 + 8009e00: b21b sxth r3, r3 + 8009e02: b29a uxth r2, r3 + 8009e04: 687b ldr r3, [r7, #4] + 8009e06: f9b3 303e ldrsh.w r3, [r3, #62] @ 0x3e + 8009e0a: b29b uxth r3, r3 + 8009e0c: 4413 add r3, r2 + 8009e0e: b29b uxth r3, r3 + 8009e10: b21a sxth r2, r3 + 8009e12: 687b ldr r3, [r7, #4] + 8009e14: f8a3 2040 strh.w r2, [r3, #64] @ 0x40 + + /* Record how much data this ACK acks */ + acked = (tcpwnd_size_t)(ackno - pcb->lastack); + 8009e18: 4b18 ldr r3, [pc, #96] @ (8009e7c ) + 8009e1a: 681b ldr r3, [r3, #0] + 8009e1c: b29a uxth r2, r3 + 8009e1e: 687b ldr r3, [r7, #4] + 8009e20: 6c5b ldr r3, [r3, #68] @ 0x44 + 8009e22: b29b uxth r3, r3 + 8009e24: 1ad3 subs r3, r2, r3 + 8009e26: 85fb strh r3, [r7, #46] @ 0x2e + + /* Reset the fast retransmit variables. */ + pcb->dupacks = 0; + 8009e28: 687b ldr r3, [r7, #4] + 8009e2a: 2200 movs r2, #0 + 8009e2c: f883 2043 strb.w r2, [r3, #67] @ 0x43 + pcb->lastack = ackno; + 8009e30: 4b12 ldr r3, [pc, #72] @ (8009e7c ) + 8009e32: 681a ldr r2, [r3, #0] + 8009e34: 687b ldr r3, [r7, #4] + 8009e36: 645a str r2, [r3, #68] @ 0x44 + + /* Update the congestion control variables (cwnd and + ssthresh). */ + if (pcb->state >= ESTABLISHED) { + 8009e38: 687b ldr r3, [r7, #4] + 8009e3a: 7d1b ldrb r3, [r3, #20] + 8009e3c: 2b03 cmp r3, #3 + 8009e3e: f240 8097 bls.w 8009f70 + if (pcb->cwnd < pcb->ssthresh) { + 8009e42: 687b ldr r3, [r7, #4] + 8009e44: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009e48: 687b ldr r3, [r7, #4] + 8009e4a: f8b3 304a ldrh.w r3, [r3, #74] @ 0x4a + 8009e4e: 429a cmp r2, r3 + 8009e50: d245 bcs.n 8009ede + tcpwnd_size_t increase; + /* limit to 1 SMSS segment during period following RTO */ + u8_t num_seg = (pcb->flags & TF_RTO) ? 1 : 2; + 8009e52: 687b ldr r3, [r7, #4] + 8009e54: 8b5b ldrh r3, [r3, #26] + 8009e56: f403 6300 and.w r3, r3, #2048 @ 0x800 + 8009e5a: 2b00 cmp r3, #0 + 8009e5c: d014 beq.n 8009e88 + 8009e5e: 2301 movs r3, #1 + 8009e60: e013 b.n 8009e8a + 8009e62: bf00 nop + 8009e64: 0801721c .word 0x0801721c + 8009e68: 0801754c .word 0x0801754c + 8009e6c: 08017268 .word 0x08017268 + 8009e70: 08017568 .word 0x08017568 + 8009e74: 200190e8 .word 0x200190e8 + 8009e78: 200190dc .word 0x200190dc + 8009e7c: 200190e0 .word 0x200190e0 + 8009e80: 200190cc .word 0x200190cc + 8009e84: 200190e6 .word 0x200190e6 + 8009e88: 2302 movs r3, #2 + 8009e8a: f887 302d strb.w r3, [r7, #45] @ 0x2d + /* RFC 3465, section 2.2 Slow Start */ + increase = LWIP_MIN(acked, (tcpwnd_size_t)(num_seg * pcb->mss)); + 8009e8e: f897 302d ldrb.w r3, [r7, #45] @ 0x2d + 8009e92: b29a uxth r2, r3 + 8009e94: 687b ldr r3, [r7, #4] + 8009e96: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009e98: fb12 f303 smulbb r3, r2, r3 + 8009e9c: b29b uxth r3, r3 + 8009e9e: 8dfa ldrh r2, [r7, #46] @ 0x2e + 8009ea0: 4293 cmp r3, r2 + 8009ea2: bf28 it cs + 8009ea4: 4613 movcs r3, r2 + 8009ea6: 857b strh r3, [r7, #42] @ 0x2a + TCP_WND_INC(pcb->cwnd, increase); + 8009ea8: 687b ldr r3, [r7, #4] + 8009eaa: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009eae: 8d7b ldrh r3, [r7, #42] @ 0x2a + 8009eb0: 4413 add r3, r2 + 8009eb2: b29a uxth r2, r3 + 8009eb4: 687b ldr r3, [r7, #4] + 8009eb6: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 8009eba: 429a cmp r2, r3 + 8009ebc: d309 bcc.n 8009ed2 + 8009ebe: 687b ldr r3, [r7, #4] + 8009ec0: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009ec4: 8d7b ldrh r3, [r7, #42] @ 0x2a + 8009ec6: 4413 add r3, r2 + 8009ec8: b29a uxth r2, r3 + 8009eca: 687b ldr r3, [r7, #4] + 8009ecc: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + 8009ed0: e04e b.n 8009f70 + 8009ed2: 687b ldr r3, [r7, #4] + 8009ed4: f64f 72ff movw r2, #65535 @ 0xffff + 8009ed8: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + 8009edc: e048 b.n 8009f70 + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %"TCPWNDSIZE_F"\n", pcb->cwnd)); + } else { + /* RFC 3465, section 2.1 Congestion Avoidance */ + TCP_WND_INC(pcb->bytes_acked, acked); + 8009ede: 687b ldr r3, [r7, #4] + 8009ee0: f8b3 206a ldrh.w r2, [r3, #106] @ 0x6a + 8009ee4: 8dfb ldrh r3, [r7, #46] @ 0x2e + 8009ee6: 4413 add r3, r2 + 8009ee8: b29a uxth r2, r3 + 8009eea: 687b ldr r3, [r7, #4] + 8009eec: f8b3 306a ldrh.w r3, [r3, #106] @ 0x6a + 8009ef0: 429a cmp r2, r3 + 8009ef2: d309 bcc.n 8009f08 + 8009ef4: 687b ldr r3, [r7, #4] + 8009ef6: f8b3 206a ldrh.w r2, [r3, #106] @ 0x6a + 8009efa: 8dfb ldrh r3, [r7, #46] @ 0x2e + 8009efc: 4413 add r3, r2 + 8009efe: b29a uxth r2, r3 + 8009f00: 687b ldr r3, [r7, #4] + 8009f02: f8a3 206a strh.w r2, [r3, #106] @ 0x6a + 8009f06: e004 b.n 8009f12 + 8009f08: 687b ldr r3, [r7, #4] + 8009f0a: f64f 72ff movw r2, #65535 @ 0xffff + 8009f0e: f8a3 206a strh.w r2, [r3, #106] @ 0x6a + if (pcb->bytes_acked >= pcb->cwnd) { + 8009f12: 687b ldr r3, [r7, #4] + 8009f14: f8b3 206a ldrh.w r2, [r3, #106] @ 0x6a + 8009f18: 687b ldr r3, [r7, #4] + 8009f1a: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 8009f1e: 429a cmp r2, r3 + 8009f20: d326 bcc.n 8009f70 + pcb->bytes_acked = (tcpwnd_size_t)(pcb->bytes_acked - pcb->cwnd); + 8009f22: 687b ldr r3, [r7, #4] + 8009f24: f8b3 206a ldrh.w r2, [r3, #106] @ 0x6a + 8009f28: 687b ldr r3, [r7, #4] + 8009f2a: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 8009f2e: 1ad3 subs r3, r2, r3 + 8009f30: b29a uxth r2, r3 + 8009f32: 687b ldr r3, [r7, #4] + 8009f34: f8a3 206a strh.w r2, [r3, #106] @ 0x6a + TCP_WND_INC(pcb->cwnd, pcb->mss); + 8009f38: 687b ldr r3, [r7, #4] + 8009f3a: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009f3e: 687b ldr r3, [r7, #4] + 8009f40: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009f42: 4413 add r3, r2 + 8009f44: b29a uxth r2, r3 + 8009f46: 687b ldr r3, [r7, #4] + 8009f48: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 8009f4c: 429a cmp r2, r3 + 8009f4e: d30a bcc.n 8009f66 + 8009f50: 687b ldr r3, [r7, #4] + 8009f52: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 8009f56: 687b ldr r3, [r7, #4] + 8009f58: 8e5b ldrh r3, [r3, #50] @ 0x32 + 8009f5a: 4413 add r3, r2 + 8009f5c: b29a uxth r2, r3 + 8009f5e: 687b ldr r3, [r7, #4] + 8009f60: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + 8009f64: e004 b.n 8009f70 + 8009f66: 687b ldr r3, [r7, #4] + 8009f68: f64f 72ff movw r2, #65535 @ 0xffff + 8009f6c: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + pcb->unacked != NULL ? + lwip_ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked) : 0)); + + /* Remove segment from the unacknowledged list if the incoming + ACK acknowledges them. */ + pcb->unacked = tcp_free_acked_segments(pcb, pcb->unacked, "unacked", pcb->unsent); + 8009f70: 687b ldr r3, [r7, #4] + 8009f72: 6f19 ldr r1, [r3, #112] @ 0x70 + 8009f74: 687b ldr r3, [r7, #4] + 8009f76: 6edb ldr r3, [r3, #108] @ 0x6c + 8009f78: 4a98 ldr r2, [pc, #608] @ (800a1dc ) + 8009f7a: 6878 ldr r0, [r7, #4] + 8009f7c: f7ff fdca bl 8009b14 + 8009f80: 4602 mov r2, r0 + 8009f82: 687b ldr r3, [r7, #4] + 8009f84: 671a str r2, [r3, #112] @ 0x70 + on the list are acknowledged by the ACK. This may seem + strange since an "unsent" segment shouldn't be acked. The + rationale is that lwIP puts all outstanding segments on the + ->unsent list after a retransmission, so these segments may + in fact have been sent once. */ + pcb->unsent = tcp_free_acked_segments(pcb, pcb->unsent, "unsent", pcb->unacked); + 8009f86: 687b ldr r3, [r7, #4] + 8009f88: 6ed9 ldr r1, [r3, #108] @ 0x6c + 8009f8a: 687b ldr r3, [r7, #4] + 8009f8c: 6f1b ldr r3, [r3, #112] @ 0x70 + 8009f8e: 4a94 ldr r2, [pc, #592] @ (800a1e0 ) + 8009f90: 6878 ldr r0, [r7, #4] + 8009f92: f7ff fdbf bl 8009b14 + 8009f96: 4602 mov r2, r0 + 8009f98: 687b ldr r3, [r7, #4] + 8009f9a: 66da str r2, [r3, #108] @ 0x6c + + /* If there's nothing left to acknowledge, stop the retransmit + timer, otherwise reset it to start again */ + if (pcb->unacked == NULL) { + 8009f9c: 687b ldr r3, [r7, #4] + 8009f9e: 6f1b ldr r3, [r3, #112] @ 0x70 + 8009fa0: 2b00 cmp r3, #0 + 8009fa2: d104 bne.n 8009fae + pcb->rtime = -1; + 8009fa4: 687b ldr r3, [r7, #4] + 8009fa6: f64f 72ff movw r2, #65535 @ 0xffff + 8009faa: 861a strh r2, [r3, #48] @ 0x30 + 8009fac: e002 b.n 8009fb4 + } else { + pcb->rtime = 0; + 8009fae: 687b ldr r3, [r7, #4] + 8009fb0: 2200 movs r2, #0 + 8009fb2: 861a strh r2, [r3, #48] @ 0x30 + } + + pcb->polltmr = 0; + 8009fb4: 687b ldr r3, [r7, #4] + 8009fb6: 2200 movs r2, #0 + 8009fb8: 771a strb r2, [r3, #28] + +#if TCP_OVERSIZE + if (pcb->unsent == NULL) { + 8009fba: 687b ldr r3, [r7, #4] + 8009fbc: 6edb ldr r3, [r3, #108] @ 0x6c + 8009fbe: 2b00 cmp r3, #0 + 8009fc0: d103 bne.n 8009fca + pcb->unsent_oversize = 0; + 8009fc2: 687b ldr r3, [r7, #4] + 8009fc4: 2200 movs r2, #0 + 8009fc6: f8a3 2068 strh.w r2, [r3, #104] @ 0x68 + /* Inform neighbor reachability of forward progress. */ + nd6_reachability_hint(ip6_current_src_addr()); + } +#endif /* LWIP_IPV6 && LWIP_ND6_TCP_REACHABILITY_HINTS*/ + + pcb->snd_buf = (tcpwnd_size_t)(pcb->snd_buf + recv_acked); + 8009fca: 687b ldr r3, [r7, #4] + 8009fcc: f8b3 2064 ldrh.w r2, [r3, #100] @ 0x64 + 8009fd0: 4b84 ldr r3, [pc, #528] @ (800a1e4 ) + 8009fd2: 881b ldrh r3, [r3, #0] + 8009fd4: 4413 add r3, r2 + 8009fd6: b29a uxth r2, r3 + 8009fd8: 687b ldr r3, [r7, #4] + 8009fda: f8a3 2064 strh.w r2, [r3, #100] @ 0x64 + /* check if this ACK ends our retransmission of in-flight data */ + if (pcb->flags & TF_RTO) { + 8009fde: 687b ldr r3, [r7, #4] + 8009fe0: 8b5b ldrh r3, [r3, #26] + 8009fe2: f403 6300 and.w r3, r3, #2048 @ 0x800 + 8009fe6: 2b00 cmp r3, #0 + 8009fe8: d035 beq.n 800a056 + /* RTO is done if + 1) both queues are empty or + 2) unacked is empty and unsent head contains data not part of RTO or + 3) unacked head contains data not part of RTO */ + if (pcb->unacked == NULL) { + 8009fea: 687b ldr r3, [r7, #4] + 8009fec: 6f1b ldr r3, [r3, #112] @ 0x70 + 8009fee: 2b00 cmp r3, #0 + 8009ff0: d118 bne.n 800a024 + if ((pcb->unsent == NULL) || + 8009ff2: 687b ldr r3, [r7, #4] + 8009ff4: 6edb ldr r3, [r3, #108] @ 0x6c + 8009ff6: 2b00 cmp r3, #0 + 8009ff8: d00c beq.n 800a014 + (TCP_SEQ_LEQ(pcb->rto_end, lwip_ntohl(pcb->unsent->tcphdr->seqno)))) { + 8009ffa: 687b ldr r3, [r7, #4] + 8009ffc: 6cdc ldr r4, [r3, #76] @ 0x4c + 8009ffe: 687b ldr r3, [r7, #4] + 800a000: 6edb ldr r3, [r3, #108] @ 0x6c + 800a002: 68db ldr r3, [r3, #12] + 800a004: 685b ldr r3, [r3, #4] + 800a006: 4618 mov r0, r3 + 800a008: f7fb f9d3 bl 80053b2 + 800a00c: 4603 mov r3, r0 + 800a00e: 1ae3 subs r3, r4, r3 + if ((pcb->unsent == NULL) || + 800a010: 2b00 cmp r3, #0 + 800a012: dc20 bgt.n 800a056 + tcp_clear_flags(pcb, TF_RTO); + 800a014: 687b ldr r3, [r7, #4] + 800a016: 8b5b ldrh r3, [r3, #26] + 800a018: f423 6300 bic.w r3, r3, #2048 @ 0x800 + 800a01c: b29a uxth r2, r3 + 800a01e: 687b ldr r3, [r7, #4] + 800a020: 835a strh r2, [r3, #26] + } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack + 1, pcb->snd_nxt)) { + 800a022: e018 b.n 800a056 + } + } else if (TCP_SEQ_LEQ(pcb->rto_end, lwip_ntohl(pcb->unacked->tcphdr->seqno))) { + 800a024: 687b ldr r3, [r7, #4] + 800a026: 6cdc ldr r4, [r3, #76] @ 0x4c + 800a028: 687b ldr r3, [r7, #4] + 800a02a: 6f1b ldr r3, [r3, #112] @ 0x70 + 800a02c: 68db ldr r3, [r3, #12] + 800a02e: 685b ldr r3, [r3, #4] + 800a030: 4618 mov r0, r3 + 800a032: f7fb f9be bl 80053b2 + 800a036: 4603 mov r3, r0 + 800a038: 1ae3 subs r3, r4, r3 + 800a03a: 2b00 cmp r3, #0 + 800a03c: dc0b bgt.n 800a056 + tcp_clear_flags(pcb, TF_RTO); + 800a03e: 687b ldr r3, [r7, #4] + 800a040: 8b5b ldrh r3, [r3, #26] + 800a042: f423 6300 bic.w r3, r3, #2048 @ 0x800 + 800a046: b29a uxth r2, r3 + 800a048: 687b ldr r3, [r7, #4] + 800a04a: 835a strh r2, [r3, #26] + } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack + 1, pcb->snd_nxt)) { + 800a04c: e003 b.n 800a056 + } + } + /* End of ACK for new data processing. */ + } else { + /* Out of sequence ACK, didn't really ack anything */ + tcp_send_empty_ack(pcb); + 800a04e: 6878 ldr r0, [r7, #4] + 800a050: f001 ff70 bl 800bf34 + 800a054: e000 b.n 800a058 + } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack + 1, pcb->snd_nxt)) { + 800a056: bf00 nop + pcb->rttest, pcb->rtseq, ackno)); + + /* RTT estimation calculations. This is done by checking if the + incoming segment acknowledges the segment we use to take a + round-trip time measurement. */ + if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) { + 800a058: 687b ldr r3, [r7, #4] + 800a05a: 6b5b ldr r3, [r3, #52] @ 0x34 + 800a05c: 2b00 cmp r3, #0 + 800a05e: d05b beq.n 800a118 + 800a060: 687b ldr r3, [r7, #4] + 800a062: 6b9a ldr r2, [r3, #56] @ 0x38 + 800a064: 4b60 ldr r3, [pc, #384] @ (800a1e8 ) + 800a066: 681b ldr r3, [r3, #0] + 800a068: 1ad3 subs r3, r2, r3 + 800a06a: 2b00 cmp r3, #0 + 800a06c: da54 bge.n 800a118 + /* diff between this shouldn't exceed 32K since this are tcp timer ticks + and a round-trip shouldn't be that long... */ + m = (s16_t)(tcp_ticks - pcb->rttest); + 800a06e: 4b5f ldr r3, [pc, #380] @ (800a1ec ) + 800a070: 681b ldr r3, [r3, #0] + 800a072: b29a uxth r2, r3 + 800a074: 687b ldr r3, [r7, #4] + 800a076: 6b5b ldr r3, [r3, #52] @ 0x34 + 800a078: b29b uxth r3, r3 + 800a07a: 1ad3 subs r3, r2, r3 + 800a07c: b29b uxth r3, r3 + 800a07e: f8a7 304e strh.w r3, [r7, #78] @ 0x4e + + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n", + m, (u16_t)(m * TCP_SLOW_INTERVAL))); + + /* This is taken directly from VJs original code in his paper */ + m = (s16_t)(m - (pcb->sa >> 3)); + 800a082: f8b7 204e ldrh.w r2, [r7, #78] @ 0x4e + 800a086: 687b ldr r3, [r7, #4] + 800a088: f9b3 303c ldrsh.w r3, [r3, #60] @ 0x3c + 800a08c: 10db asrs r3, r3, #3 + 800a08e: b21b sxth r3, r3 + 800a090: b29b uxth r3, r3 + 800a092: 1ad3 subs r3, r2, r3 + 800a094: b29b uxth r3, r3 + 800a096: f8a7 304e strh.w r3, [r7, #78] @ 0x4e + pcb->sa = (s16_t)(pcb->sa + m); + 800a09a: 687b ldr r3, [r7, #4] + 800a09c: f9b3 303c ldrsh.w r3, [r3, #60] @ 0x3c + 800a0a0: b29a uxth r2, r3 + 800a0a2: f8b7 304e ldrh.w r3, [r7, #78] @ 0x4e + 800a0a6: 4413 add r3, r2 + 800a0a8: b29b uxth r3, r3 + 800a0aa: b21a sxth r2, r3 + 800a0ac: 687b ldr r3, [r7, #4] + 800a0ae: 879a strh r2, [r3, #60] @ 0x3c + if (m < 0) { + 800a0b0: f9b7 304e ldrsh.w r3, [r7, #78] @ 0x4e + 800a0b4: 2b00 cmp r3, #0 + 800a0b6: da05 bge.n 800a0c4 + m = (s16_t) - m; + 800a0b8: f8b7 304e ldrh.w r3, [r7, #78] @ 0x4e + 800a0bc: 425b negs r3, r3 + 800a0be: b29b uxth r3, r3 + 800a0c0: f8a7 304e strh.w r3, [r7, #78] @ 0x4e + } + m = (s16_t)(m - (pcb->sv >> 2)); + 800a0c4: f8b7 204e ldrh.w r2, [r7, #78] @ 0x4e + 800a0c8: 687b ldr r3, [r7, #4] + 800a0ca: f9b3 303e ldrsh.w r3, [r3, #62] @ 0x3e + 800a0ce: 109b asrs r3, r3, #2 + 800a0d0: b21b sxth r3, r3 + 800a0d2: b29b uxth r3, r3 + 800a0d4: 1ad3 subs r3, r2, r3 + 800a0d6: b29b uxth r3, r3 + 800a0d8: f8a7 304e strh.w r3, [r7, #78] @ 0x4e + pcb->sv = (s16_t)(pcb->sv + m); + 800a0dc: 687b ldr r3, [r7, #4] + 800a0de: f9b3 303e ldrsh.w r3, [r3, #62] @ 0x3e + 800a0e2: b29a uxth r2, r3 + 800a0e4: f8b7 304e ldrh.w r3, [r7, #78] @ 0x4e + 800a0e8: 4413 add r3, r2 + 800a0ea: b29b uxth r3, r3 + 800a0ec: b21a sxth r2, r3 + 800a0ee: 687b ldr r3, [r7, #4] + 800a0f0: 87da strh r2, [r3, #62] @ 0x3e + pcb->rto = (s16_t)((pcb->sa >> 3) + pcb->sv); + 800a0f2: 687b ldr r3, [r7, #4] + 800a0f4: f9b3 303c ldrsh.w r3, [r3, #60] @ 0x3c + 800a0f8: 10db asrs r3, r3, #3 + 800a0fa: b21b sxth r3, r3 + 800a0fc: b29a uxth r2, r3 + 800a0fe: 687b ldr r3, [r7, #4] + 800a100: f9b3 303e ldrsh.w r3, [r3, #62] @ 0x3e + 800a104: b29b uxth r3, r3 + 800a106: 4413 add r3, r2 + 800a108: b29b uxth r3, r3 + 800a10a: b21a sxth r2, r3 + 800a10c: 687b ldr r3, [r7, #4] + 800a10e: f8a3 2040 strh.w r2, [r3, #64] @ 0x40 + + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: RTO %"U16_F" (%"U16_F" milliseconds)\n", + pcb->rto, (u16_t)(pcb->rto * TCP_SLOW_INTERVAL))); + + pcb->rttest = 0; + 800a112: 687b ldr r3, [r7, #4] + 800a114: 2200 movs r2, #0 + 800a116: 635a str r2, [r3, #52] @ 0x34 + + /* If the incoming segment contains data, we must process it + further unless the pcb already received a FIN. + (RFC 793, chapter 3.9, "SEGMENT ARRIVES" in states CLOSE-WAIT, CLOSING, + LAST-ACK and TIME-WAIT: "Ignore the segment text.") */ + if ((tcplen > 0) && (pcb->state < CLOSE_WAIT)) { + 800a118: 4b35 ldr r3, [pc, #212] @ (800a1f0 ) + 800a11a: 881b ldrh r3, [r3, #0] + 800a11c: 2b00 cmp r3, #0 + 800a11e: f000 84df beq.w 800aae0 + 800a122: 687b ldr r3, [r7, #4] + 800a124: 7d1b ldrb r3, [r3, #20] + 800a126: 2b06 cmp r3, #6 + 800a128: f200 84da bhi.w 800aae0 + this if the sequence number of the incoming segment is less + than rcv_nxt, and the sequence number plus the length of the + segment is larger than rcv_nxt. */ + /* if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)) { + if (TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {*/ + if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)) { + 800a12c: 687b ldr r3, [r7, #4] + 800a12e: 6a5a ldr r2, [r3, #36] @ 0x24 + 800a130: 4b30 ldr r3, [pc, #192] @ (800a1f4 ) + 800a132: 681b ldr r3, [r3, #0] + 800a134: 1ad3 subs r3, r2, r3 + 800a136: 3b01 subs r3, #1 + 800a138: 2b00 cmp r3, #0 + 800a13a: f2c0 808f blt.w 800a25c + 800a13e: 687b ldr r3, [r7, #4] + 800a140: 6a5a ldr r2, [r3, #36] @ 0x24 + 800a142: 4b2b ldr r3, [pc, #172] @ (800a1f0 ) + 800a144: 881b ldrh r3, [r3, #0] + 800a146: 4619 mov r1, r3 + 800a148: 4b2a ldr r3, [pc, #168] @ (800a1f4 ) + 800a14a: 681b ldr r3, [r3, #0] + 800a14c: 440b add r3, r1 + 800a14e: 1ad3 subs r3, r2, r3 + 800a150: 3301 adds r3, #1 + 800a152: 2b00 cmp r3, #0 + 800a154: f300 8082 bgt.w 800a25c + + After we are done with adjusting the pbuf pointers we must + adjust the ->data pointer in the seg and the segment + length.*/ + + struct pbuf *p = inseg.p; + 800a158: 4b27 ldr r3, [pc, #156] @ (800a1f8 ) + 800a15a: 685b ldr r3, [r3, #4] + 800a15c: 647b str r3, [r7, #68] @ 0x44 + u32_t off32 = pcb->rcv_nxt - seqno; + 800a15e: 687b ldr r3, [r7, #4] + 800a160: 6a5a ldr r2, [r3, #36] @ 0x24 + 800a162: 4b24 ldr r3, [pc, #144] @ (800a1f4 ) + 800a164: 681b ldr r3, [r3, #0] + 800a166: 1ad3 subs r3, r2, r3 + 800a168: 627b str r3, [r7, #36] @ 0x24 + u16_t new_tot_len, off; + LWIP_ASSERT("inseg.p != NULL", inseg.p); + 800a16a: 4b23 ldr r3, [pc, #140] @ (800a1f8 ) + 800a16c: 685b ldr r3, [r3, #4] + 800a16e: 2b00 cmp r3, #0 + 800a170: d106 bne.n 800a180 + 800a172: 4b22 ldr r3, [pc, #136] @ (800a1fc ) + 800a174: f240 5294 movw r2, #1428 @ 0x594 + 800a178: 4921 ldr r1, [pc, #132] @ (800a200 ) + 800a17a: 4822 ldr r0, [pc, #136] @ (800a204 ) + 800a17c: f007 fa3c bl 80115f8 + LWIP_ASSERT("insane offset!", (off32 < 0xffff)); + 800a180: 6a7b ldr r3, [r7, #36] @ 0x24 + 800a182: f64f 72fe movw r2, #65534 @ 0xfffe + 800a186: 4293 cmp r3, r2 + 800a188: d906 bls.n 800a198 + 800a18a: 4b1c ldr r3, [pc, #112] @ (800a1fc ) + 800a18c: f240 5295 movw r2, #1429 @ 0x595 + 800a190: 491d ldr r1, [pc, #116] @ (800a208 ) + 800a192: 481c ldr r0, [pc, #112] @ (800a204 ) + 800a194: f007 fa30 bl 80115f8 + off = (u16_t)off32; + 800a198: 6a7b ldr r3, [r7, #36] @ 0x24 + 800a19a: f8a7 3042 strh.w r3, [r7, #66] @ 0x42 + LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off)); + 800a19e: 4b16 ldr r3, [pc, #88] @ (800a1f8 ) + 800a1a0: 685b ldr r3, [r3, #4] + 800a1a2: 891b ldrh r3, [r3, #8] + 800a1a4: f8b7 2042 ldrh.w r2, [r7, #66] @ 0x42 + 800a1a8: 429a cmp r2, r3 + 800a1aa: d906 bls.n 800a1ba + 800a1ac: 4b13 ldr r3, [pc, #76] @ (800a1fc ) + 800a1ae: f240 5297 movw r2, #1431 @ 0x597 + 800a1b2: 4916 ldr r1, [pc, #88] @ (800a20c ) + 800a1b4: 4813 ldr r0, [pc, #76] @ (800a204 ) + 800a1b6: f007 fa1f bl 80115f8 + inseg.len -= off; + 800a1ba: 4b0f ldr r3, [pc, #60] @ (800a1f8 ) + 800a1bc: 891a ldrh r2, [r3, #8] + 800a1be: f8b7 3042 ldrh.w r3, [r7, #66] @ 0x42 + 800a1c2: 1ad3 subs r3, r2, r3 + 800a1c4: b29a uxth r2, r3 + 800a1c6: 4b0c ldr r3, [pc, #48] @ (800a1f8 ) + 800a1c8: 811a strh r2, [r3, #8] + new_tot_len = (u16_t)(inseg.p->tot_len - off); + 800a1ca: 4b0b ldr r3, [pc, #44] @ (800a1f8 ) + 800a1cc: 685b ldr r3, [r3, #4] + 800a1ce: 891a ldrh r2, [r3, #8] + 800a1d0: f8b7 3042 ldrh.w r3, [r7, #66] @ 0x42 + 800a1d4: 1ad3 subs r3, r2, r3 + 800a1d6: 847b strh r3, [r7, #34] @ 0x22 + while (p->len < off) { + 800a1d8: e02a b.n 800a230 + 800a1da: bf00 nop + 800a1dc: 08017584 .word 0x08017584 + 800a1e0: 0801758c .word 0x0801758c + 800a1e4: 200190e4 .word 0x200190e4 + 800a1e8: 200190e0 .word 0x200190e0 + 800a1ec: 200190a4 .word 0x200190a4 + 800a1f0: 200190e6 .word 0x200190e6 + 800a1f4: 200190dc .word 0x200190dc + 800a1f8: 200190bc .word 0x200190bc + 800a1fc: 0801721c .word 0x0801721c + 800a200: 08017594 .word 0x08017594 + 800a204: 08017268 .word 0x08017268 + 800a208: 080175a4 .word 0x080175a4 + 800a20c: 080175b4 .word 0x080175b4 + off -= p->len; + 800a210: 6c7b ldr r3, [r7, #68] @ 0x44 + 800a212: 895b ldrh r3, [r3, #10] + 800a214: f8b7 2042 ldrh.w r2, [r7, #66] @ 0x42 + 800a218: 1ad3 subs r3, r2, r3 + 800a21a: f8a7 3042 strh.w r3, [r7, #66] @ 0x42 + /* all pbufs up to and including this one have len==0, so tot_len is equal */ + p->tot_len = new_tot_len; + 800a21e: 6c7b ldr r3, [r7, #68] @ 0x44 + 800a220: 8c7a ldrh r2, [r7, #34] @ 0x22 + 800a222: 811a strh r2, [r3, #8] + p->len = 0; + 800a224: 6c7b ldr r3, [r7, #68] @ 0x44 + 800a226: 2200 movs r2, #0 + 800a228: 815a strh r2, [r3, #10] + p = p->next; + 800a22a: 6c7b ldr r3, [r7, #68] @ 0x44 + 800a22c: 681b ldr r3, [r3, #0] + 800a22e: 647b str r3, [r7, #68] @ 0x44 + while (p->len < off) { + 800a230: 6c7b ldr r3, [r7, #68] @ 0x44 + 800a232: 895b ldrh r3, [r3, #10] + 800a234: f8b7 2042 ldrh.w r2, [r7, #66] @ 0x42 + 800a238: 429a cmp r2, r3 + 800a23a: d8e9 bhi.n 800a210 + } + /* cannot fail... */ + pbuf_remove_header(p, off); + 800a23c: f8b7 3042 ldrh.w r3, [r7, #66] @ 0x42 + 800a240: 4619 mov r1, r3 + 800a242: 6c78 ldr r0, [r7, #68] @ 0x44 + 800a244: f7fc fb6a bl 800691c + inseg.tcphdr->seqno = seqno = pcb->rcv_nxt; + 800a248: 687b ldr r3, [r7, #4] + 800a24a: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a24c: 4a90 ldr r2, [pc, #576] @ (800a490 ) + 800a24e: 6013 str r3, [r2, #0] + 800a250: 4b90 ldr r3, [pc, #576] @ (800a494 ) + 800a252: 68db ldr r3, [r3, #12] + 800a254: 4a8e ldr r2, [pc, #568] @ (800a490 ) + 800a256: 6812 ldr r2, [r2, #0] + 800a258: 605a str r2, [r3, #4] + if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)) { + 800a25a: e00d b.n 800a278 + } else { + if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)) { + 800a25c: 4b8c ldr r3, [pc, #560] @ (800a490 ) + 800a25e: 681a ldr r2, [r3, #0] + 800a260: 687b ldr r3, [r7, #4] + 800a262: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a264: 1ad3 subs r3, r2, r3 + 800a266: 2b00 cmp r3, #0 + 800a268: da06 bge.n 800a278 + /* the whole segment is < rcv_nxt */ + /* must be a duplicate of a packet that has already been correctly handled */ + + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: duplicate seqno %"U32_F"\n", seqno)); + tcp_ack_now(pcb); + 800a26a: 687b ldr r3, [r7, #4] + 800a26c: 8b5b ldrh r3, [r3, #26] + 800a26e: f043 0302 orr.w r3, r3, #2 + 800a272: b29a uxth r2, r3 + 800a274: 687b ldr r3, [r7, #4] + 800a276: 835a strh r2, [r3, #26] + } + + /* The sequence number must be within the window (above rcv_nxt + and below rcv_nxt + rcv_wnd) in order to be further + processed. */ + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + 800a278: 4b85 ldr r3, [pc, #532] @ (800a490 ) + 800a27a: 681a ldr r2, [r3, #0] + 800a27c: 687b ldr r3, [r7, #4] + 800a27e: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a280: 1ad3 subs r3, r2, r3 + 800a282: 2b00 cmp r3, #0 + 800a284: f2c0 8427 blt.w 800aad6 + 800a288: 4b81 ldr r3, [pc, #516] @ (800a490 ) + 800a28a: 681a ldr r2, [r3, #0] + 800a28c: 687b ldr r3, [r7, #4] + 800a28e: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a290: 6879 ldr r1, [r7, #4] + 800a292: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800a294: 440b add r3, r1 + 800a296: 1ad3 subs r3, r2, r3 + 800a298: 3301 adds r3, #1 + 800a29a: 2b00 cmp r3, #0 + 800a29c: f300 841b bgt.w 800aad6 + pcb->rcv_nxt + pcb->rcv_wnd - 1)) { + if (pcb->rcv_nxt == seqno) { + 800a2a0: 687b ldr r3, [r7, #4] + 800a2a2: 6a5a ldr r2, [r3, #36] @ 0x24 + 800a2a4: 4b7a ldr r3, [pc, #488] @ (800a490 ) + 800a2a6: 681b ldr r3, [r3, #0] + 800a2a8: 429a cmp r2, r3 + 800a2aa: f040 8298 bne.w 800a7de + /* The incoming segment is the next in sequence. We check if + we have to trim the end of the segment and update rcv_nxt + and pass the data to the application. */ + tcplen = TCP_TCPLEN(&inseg); + 800a2ae: 4b79 ldr r3, [pc, #484] @ (800a494 ) + 800a2b0: 891c ldrh r4, [r3, #8] + 800a2b2: 4b78 ldr r3, [pc, #480] @ (800a494 ) + 800a2b4: 68db ldr r3, [r3, #12] + 800a2b6: 899b ldrh r3, [r3, #12] + 800a2b8: b29b uxth r3, r3 + 800a2ba: 4618 mov r0, r3 + 800a2bc: f7fb f864 bl 8005388 + 800a2c0: 4603 mov r3, r0 + 800a2c2: b2db uxtb r3, r3 + 800a2c4: f003 0303 and.w r3, r3, #3 + 800a2c8: 2b00 cmp r3, #0 + 800a2ca: d001 beq.n 800a2d0 + 800a2cc: 2301 movs r3, #1 + 800a2ce: e000 b.n 800a2d2 + 800a2d0: 2300 movs r3, #0 + 800a2d2: 4423 add r3, r4 + 800a2d4: b29a uxth r2, r3 + 800a2d6: 4b70 ldr r3, [pc, #448] @ (800a498 ) + 800a2d8: 801a strh r2, [r3, #0] + + if (tcplen > pcb->rcv_wnd) { + 800a2da: 687b ldr r3, [r7, #4] + 800a2dc: 8d1a ldrh r2, [r3, #40] @ 0x28 + 800a2de: 4b6e ldr r3, [pc, #440] @ (800a498 ) + 800a2e0: 881b ldrh r3, [r3, #0] + 800a2e2: 429a cmp r2, r3 + 800a2e4: d274 bcs.n 800a3d0 + LWIP_DEBUGF(TCP_INPUT_DEBUG, + ("tcp_receive: other end overran receive window" + "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", + seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); + if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { + 800a2e6: 4b6b ldr r3, [pc, #428] @ (800a494 ) + 800a2e8: 68db ldr r3, [r3, #12] + 800a2ea: 899b ldrh r3, [r3, #12] + 800a2ec: b29b uxth r3, r3 + 800a2ee: 4618 mov r0, r3 + 800a2f0: f7fb f84a bl 8005388 + 800a2f4: 4603 mov r3, r0 + 800a2f6: b2db uxtb r3, r3 + 800a2f8: f003 0301 and.w r3, r3, #1 + 800a2fc: 2b00 cmp r3, #0 + 800a2fe: d01e beq.n 800a33e + /* Must remove the FIN from the header as we're trimming + * that byte of sequence-space from the packet */ + TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) & ~(unsigned int)TCP_FIN); + 800a300: 4b64 ldr r3, [pc, #400] @ (800a494 ) + 800a302: 68db ldr r3, [r3, #12] + 800a304: 899b ldrh r3, [r3, #12] + 800a306: b29b uxth r3, r3 + 800a308: b21b sxth r3, r3 + 800a30a: f423 537c bic.w r3, r3, #16128 @ 0x3f00 + 800a30e: b21c sxth r4, r3 + 800a310: 4b60 ldr r3, [pc, #384] @ (800a494 ) + 800a312: 68db ldr r3, [r3, #12] + 800a314: 899b ldrh r3, [r3, #12] + 800a316: b29b uxth r3, r3 + 800a318: 4618 mov r0, r3 + 800a31a: f7fb f835 bl 8005388 + 800a31e: 4603 mov r3, r0 + 800a320: b2db uxtb r3, r3 + 800a322: f003 033e and.w r3, r3, #62 @ 0x3e + 800a326: b29b uxth r3, r3 + 800a328: 4618 mov r0, r3 + 800a32a: f7fb f82d bl 8005388 + 800a32e: 4603 mov r3, r0 + 800a330: b21b sxth r3, r3 + 800a332: 4323 orrs r3, r4 + 800a334: b21a sxth r2, r3 + 800a336: 4b57 ldr r3, [pc, #348] @ (800a494 ) + 800a338: 68db ldr r3, [r3, #12] + 800a33a: b292 uxth r2, r2 + 800a33c: 819a strh r2, [r3, #12] + } + /* Adjust length of segment to fit in the window. */ + TCPWND_CHECK16(pcb->rcv_wnd); + inseg.len = (u16_t)pcb->rcv_wnd; + 800a33e: 687b ldr r3, [r7, #4] + 800a340: 8d1a ldrh r2, [r3, #40] @ 0x28 + 800a342: 4b54 ldr r3, [pc, #336] @ (800a494 ) + 800a344: 811a strh r2, [r3, #8] + if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) { + 800a346: 4b53 ldr r3, [pc, #332] @ (800a494 ) + 800a348: 68db ldr r3, [r3, #12] + 800a34a: 899b ldrh r3, [r3, #12] + 800a34c: b29b uxth r3, r3 + 800a34e: 4618 mov r0, r3 + 800a350: f7fb f81a bl 8005388 + 800a354: 4603 mov r3, r0 + 800a356: b2db uxtb r3, r3 + 800a358: f003 0302 and.w r3, r3, #2 + 800a35c: 2b00 cmp r3, #0 + 800a35e: d005 beq.n 800a36c + inseg.len -= 1; + 800a360: 4b4c ldr r3, [pc, #304] @ (800a494 ) + 800a362: 891b ldrh r3, [r3, #8] + 800a364: 3b01 subs r3, #1 + 800a366: b29a uxth r2, r3 + 800a368: 4b4a ldr r3, [pc, #296] @ (800a494 ) + 800a36a: 811a strh r2, [r3, #8] + } + pbuf_realloc(inseg.p, inseg.len); + 800a36c: 4b49 ldr r3, [pc, #292] @ (800a494 ) + 800a36e: 685b ldr r3, [r3, #4] + 800a370: 4a48 ldr r2, [pc, #288] @ (800a494 ) + 800a372: 8912 ldrh r2, [r2, #8] + 800a374: 4611 mov r1, r2 + 800a376: 4618 mov r0, r3 + 800a378: f7fc f9d2 bl 8006720 + tcplen = TCP_TCPLEN(&inseg); + 800a37c: 4b45 ldr r3, [pc, #276] @ (800a494 ) + 800a37e: 891c ldrh r4, [r3, #8] + 800a380: 4b44 ldr r3, [pc, #272] @ (800a494 ) + 800a382: 68db ldr r3, [r3, #12] + 800a384: 899b ldrh r3, [r3, #12] + 800a386: b29b uxth r3, r3 + 800a388: 4618 mov r0, r3 + 800a38a: f7fa fffd bl 8005388 + 800a38e: 4603 mov r3, r0 + 800a390: b2db uxtb r3, r3 + 800a392: f003 0303 and.w r3, r3, #3 + 800a396: 2b00 cmp r3, #0 + 800a398: d001 beq.n 800a39e + 800a39a: 2301 movs r3, #1 + 800a39c: e000 b.n 800a3a0 + 800a39e: 2300 movs r3, #0 + 800a3a0: 4423 add r3, r4 + 800a3a2: b29a uxth r2, r3 + 800a3a4: 4b3c ldr r3, [pc, #240] @ (800a498 ) + 800a3a6: 801a strh r2, [r3, #0] + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n", + 800a3a8: 4b3b ldr r3, [pc, #236] @ (800a498 ) + 800a3aa: 881b ldrh r3, [r3, #0] + 800a3ac: 461a mov r2, r3 + 800a3ae: 4b38 ldr r3, [pc, #224] @ (800a490 ) + 800a3b0: 681b ldr r3, [r3, #0] + 800a3b2: 441a add r2, r3 + 800a3b4: 687b ldr r3, [r7, #4] + 800a3b6: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a3b8: 6879 ldr r1, [r7, #4] + 800a3ba: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800a3bc: 440b add r3, r1 + 800a3be: 429a cmp r2, r3 + 800a3c0: d006 beq.n 800a3d0 + 800a3c2: 4b36 ldr r3, [pc, #216] @ (800a49c ) + 800a3c4: f240 52cb movw r2, #1483 @ 0x5cb + 800a3c8: 4935 ldr r1, [pc, #212] @ (800a4a0 ) + 800a3ca: 4836 ldr r0, [pc, #216] @ (800a4a4 ) + 800a3cc: f007 f914 bl 80115f8 + } +#if TCP_QUEUE_OOSEQ + /* Received in-sequence data, adjust ooseq data if: + - FIN has been received or + - inseq overlaps with ooseq */ + if (pcb->ooseq != NULL) { + 800a3d0: 687b ldr r3, [r7, #4] + 800a3d2: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a3d4: 2b00 cmp r3, #0 + 800a3d6: f000 80e6 beq.w 800a5a6 + if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { + 800a3da: 4b2e ldr r3, [pc, #184] @ (800a494 ) + 800a3dc: 68db ldr r3, [r3, #12] + 800a3de: 899b ldrh r3, [r3, #12] + 800a3e0: b29b uxth r3, r3 + 800a3e2: 4618 mov r0, r3 + 800a3e4: f7fa ffd0 bl 8005388 + 800a3e8: 4603 mov r3, r0 + 800a3ea: b2db uxtb r3, r3 + 800a3ec: f003 0301 and.w r3, r3, #1 + 800a3f0: 2b00 cmp r3, #0 + 800a3f2: d010 beq.n 800a416 + LWIP_DEBUGF(TCP_INPUT_DEBUG, + ("tcp_receive: received in-order FIN, binning ooseq queue\n")); + /* Received in-order FIN means anything that was received + * out of order must now have been received in-order, so + * bin the ooseq queue */ + while (pcb->ooseq != NULL) { + 800a3f4: e00a b.n 800a40c + struct tcp_seg *old_ooseq = pcb->ooseq; + 800a3f6: 687b ldr r3, [r7, #4] + 800a3f8: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a3fa: 60fb str r3, [r7, #12] + pcb->ooseq = pcb->ooseq->next; + 800a3fc: 687b ldr r3, [r7, #4] + 800a3fe: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a400: 681a ldr r2, [r3, #0] + 800a402: 687b ldr r3, [r7, #4] + 800a404: 675a str r2, [r3, #116] @ 0x74 + tcp_seg_free(old_ooseq); + 800a406: 68f8 ldr r0, [r7, #12] + 800a408: f7fd fd93 bl 8007f32 + while (pcb->ooseq != NULL) { + 800a40c: 687b ldr r3, [r7, #4] + 800a40e: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a410: 2b00 cmp r3, #0 + 800a412: d1f0 bne.n 800a3f6 + 800a414: e0c7 b.n 800a5a6 + } + } else { + struct tcp_seg *next = pcb->ooseq; + 800a416: 687b ldr r3, [r7, #4] + 800a418: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a41a: 63fb str r3, [r7, #60] @ 0x3c + /* Remove all segments on ooseq that are covered by inseg already. + * FIN is copied from ooseq to inseg if present. */ + while (next && + 800a41c: e051 b.n 800a4c2 + TCP_SEQ_GEQ(seqno + tcplen, + next->tcphdr->seqno + next->len)) { + struct tcp_seg *tmp; + /* inseg cannot have FIN here (already processed above) */ + if ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0 && + 800a41e: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a420: 68db ldr r3, [r3, #12] + 800a422: 899b ldrh r3, [r3, #12] + 800a424: b29b uxth r3, r3 + 800a426: 4618 mov r0, r3 + 800a428: f7fa ffae bl 8005388 + 800a42c: 4603 mov r3, r0 + 800a42e: b2db uxtb r3, r3 + 800a430: f003 0301 and.w r3, r3, #1 + 800a434: 2b00 cmp r3, #0 + 800a436: d03c beq.n 800a4b2 + (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) == 0) { + 800a438: 4b16 ldr r3, [pc, #88] @ (800a494 ) + 800a43a: 68db ldr r3, [r3, #12] + 800a43c: 899b ldrh r3, [r3, #12] + 800a43e: b29b uxth r3, r3 + 800a440: 4618 mov r0, r3 + 800a442: f7fa ffa1 bl 8005388 + 800a446: 4603 mov r3, r0 + 800a448: b2db uxtb r3, r3 + 800a44a: f003 0302 and.w r3, r3, #2 + if ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0 && + 800a44e: 2b00 cmp r3, #0 + 800a450: d12f bne.n 800a4b2 + TCPH_SET_FLAG(inseg.tcphdr, TCP_FIN); + 800a452: 4b10 ldr r3, [pc, #64] @ (800a494 ) + 800a454: 68db ldr r3, [r3, #12] + 800a456: 899b ldrh r3, [r3, #12] + 800a458: b29c uxth r4, r3 + 800a45a: 2001 movs r0, #1 + 800a45c: f7fa ff94 bl 8005388 + 800a460: 4603 mov r3, r0 + 800a462: 461a mov r2, r3 + 800a464: 4b0b ldr r3, [pc, #44] @ (800a494 ) + 800a466: 68db ldr r3, [r3, #12] + 800a468: 4322 orrs r2, r4 + 800a46a: b292 uxth r2, r2 + 800a46c: 819a strh r2, [r3, #12] + tcplen = TCP_TCPLEN(&inseg); + 800a46e: 4b09 ldr r3, [pc, #36] @ (800a494 ) + 800a470: 891c ldrh r4, [r3, #8] + 800a472: 4b08 ldr r3, [pc, #32] @ (800a494 ) + 800a474: 68db ldr r3, [r3, #12] + 800a476: 899b ldrh r3, [r3, #12] + 800a478: b29b uxth r3, r3 + 800a47a: 4618 mov r0, r3 + 800a47c: f7fa ff84 bl 8005388 + 800a480: 4603 mov r3, r0 + 800a482: b2db uxtb r3, r3 + 800a484: f003 0303 and.w r3, r3, #3 + 800a488: 2b00 cmp r3, #0 + 800a48a: d00d beq.n 800a4a8 + 800a48c: 2301 movs r3, #1 + 800a48e: e00c b.n 800a4aa + 800a490: 200190dc .word 0x200190dc + 800a494: 200190bc .word 0x200190bc + 800a498: 200190e6 .word 0x200190e6 + 800a49c: 0801721c .word 0x0801721c + 800a4a0: 080175c4 .word 0x080175c4 + 800a4a4: 08017268 .word 0x08017268 + 800a4a8: 2300 movs r3, #0 + 800a4aa: 4423 add r3, r4 + 800a4ac: b29a uxth r2, r3 + 800a4ae: 4b98 ldr r3, [pc, #608] @ (800a710 ) + 800a4b0: 801a strh r2, [r3, #0] + } + tmp = next; + 800a4b2: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a4b4: 613b str r3, [r7, #16] + next = next->next; + 800a4b6: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a4b8: 681b ldr r3, [r3, #0] + 800a4ba: 63fb str r3, [r7, #60] @ 0x3c + tcp_seg_free(tmp); + 800a4bc: 6938 ldr r0, [r7, #16] + 800a4be: f7fd fd38 bl 8007f32 + while (next && + 800a4c2: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a4c4: 2b00 cmp r3, #0 + 800a4c6: d00e beq.n 800a4e6 + TCP_SEQ_GEQ(seqno + tcplen, + 800a4c8: 4b91 ldr r3, [pc, #580] @ (800a710 ) + 800a4ca: 881b ldrh r3, [r3, #0] + 800a4cc: 461a mov r2, r3 + 800a4ce: 4b91 ldr r3, [pc, #580] @ (800a714 ) + 800a4d0: 681b ldr r3, [r3, #0] + 800a4d2: 441a add r2, r3 + 800a4d4: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a4d6: 68db ldr r3, [r3, #12] + 800a4d8: 685b ldr r3, [r3, #4] + 800a4da: 6bf9 ldr r1, [r7, #60] @ 0x3c + 800a4dc: 8909 ldrh r1, [r1, #8] + 800a4de: 440b add r3, r1 + 800a4e0: 1ad3 subs r3, r2, r3 + while (next && + 800a4e2: 2b00 cmp r3, #0 + 800a4e4: da9b bge.n 800a41e + } + /* Now trim right side of inseg if it overlaps with the first + * segment on ooseq */ + if (next && + 800a4e6: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a4e8: 2b00 cmp r3, #0 + 800a4ea: d059 beq.n 800a5a0 + TCP_SEQ_GT(seqno + tcplen, + 800a4ec: 4b88 ldr r3, [pc, #544] @ (800a710 ) + 800a4ee: 881b ldrh r3, [r3, #0] + 800a4f0: 461a mov r2, r3 + 800a4f2: 4b88 ldr r3, [pc, #544] @ (800a714 ) + 800a4f4: 681b ldr r3, [r3, #0] + 800a4f6: 441a add r2, r3 + 800a4f8: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a4fa: 68db ldr r3, [r3, #12] + 800a4fc: 685b ldr r3, [r3, #4] + 800a4fe: 1ad3 subs r3, r2, r3 + if (next && + 800a500: 2b00 cmp r3, #0 + 800a502: dd4d ble.n 800a5a0 + next->tcphdr->seqno)) { + /* inseg cannot have FIN here (already processed above) */ + inseg.len = (u16_t)(next->tcphdr->seqno - seqno); + 800a504: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a506: 68db ldr r3, [r3, #12] + 800a508: 685b ldr r3, [r3, #4] + 800a50a: b29a uxth r2, r3 + 800a50c: 4b81 ldr r3, [pc, #516] @ (800a714 ) + 800a50e: 681b ldr r3, [r3, #0] + 800a510: b29b uxth r3, r3 + 800a512: 1ad3 subs r3, r2, r3 + 800a514: b29a uxth r2, r3 + 800a516: 4b80 ldr r3, [pc, #512] @ (800a718 ) + 800a518: 811a strh r2, [r3, #8] + if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) { + 800a51a: 4b7f ldr r3, [pc, #508] @ (800a718 ) + 800a51c: 68db ldr r3, [r3, #12] + 800a51e: 899b ldrh r3, [r3, #12] + 800a520: b29b uxth r3, r3 + 800a522: 4618 mov r0, r3 + 800a524: f7fa ff30 bl 8005388 + 800a528: 4603 mov r3, r0 + 800a52a: b2db uxtb r3, r3 + 800a52c: f003 0302 and.w r3, r3, #2 + 800a530: 2b00 cmp r3, #0 + 800a532: d005 beq.n 800a540 + inseg.len -= 1; + 800a534: 4b78 ldr r3, [pc, #480] @ (800a718 ) + 800a536: 891b ldrh r3, [r3, #8] + 800a538: 3b01 subs r3, #1 + 800a53a: b29a uxth r2, r3 + 800a53c: 4b76 ldr r3, [pc, #472] @ (800a718 ) + 800a53e: 811a strh r2, [r3, #8] + } + pbuf_realloc(inseg.p, inseg.len); + 800a540: 4b75 ldr r3, [pc, #468] @ (800a718 ) + 800a542: 685b ldr r3, [r3, #4] + 800a544: 4a74 ldr r2, [pc, #464] @ (800a718 ) + 800a546: 8912 ldrh r2, [r2, #8] + 800a548: 4611 mov r1, r2 + 800a54a: 4618 mov r0, r3 + 800a54c: f7fc f8e8 bl 8006720 + tcplen = TCP_TCPLEN(&inseg); + 800a550: 4b71 ldr r3, [pc, #452] @ (800a718 ) + 800a552: 891c ldrh r4, [r3, #8] + 800a554: 4b70 ldr r3, [pc, #448] @ (800a718 ) + 800a556: 68db ldr r3, [r3, #12] + 800a558: 899b ldrh r3, [r3, #12] + 800a55a: b29b uxth r3, r3 + 800a55c: 4618 mov r0, r3 + 800a55e: f7fa ff13 bl 8005388 + 800a562: 4603 mov r3, r0 + 800a564: b2db uxtb r3, r3 + 800a566: f003 0303 and.w r3, r3, #3 + 800a56a: 2b00 cmp r3, #0 + 800a56c: d001 beq.n 800a572 + 800a56e: 2301 movs r3, #1 + 800a570: e000 b.n 800a574 + 800a572: 2300 movs r3, #0 + 800a574: 4423 add r3, r4 + 800a576: b29a uxth r2, r3 + 800a578: 4b65 ldr r3, [pc, #404] @ (800a710 ) + 800a57a: 801a strh r2, [r3, #0] + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to ooseq queue\n", + 800a57c: 4b64 ldr r3, [pc, #400] @ (800a710 ) + 800a57e: 881b ldrh r3, [r3, #0] + 800a580: 461a mov r2, r3 + 800a582: 4b64 ldr r3, [pc, #400] @ (800a714 ) + 800a584: 681b ldr r3, [r3, #0] + 800a586: 441a add r2, r3 + 800a588: 6bfb ldr r3, [r7, #60] @ 0x3c + 800a58a: 68db ldr r3, [r3, #12] + 800a58c: 685b ldr r3, [r3, #4] + 800a58e: 429a cmp r2, r3 + 800a590: d006 beq.n 800a5a0 + 800a592: 4b62 ldr r3, [pc, #392] @ (800a71c ) + 800a594: f240 52fc movw r2, #1532 @ 0x5fc + 800a598: 4961 ldr r1, [pc, #388] @ (800a720 ) + 800a59a: 4862 ldr r0, [pc, #392] @ (800a724 ) + 800a59c: f007 f82c bl 80115f8 + (seqno + tcplen) == next->tcphdr->seqno); + } + pcb->ooseq = next; + 800a5a0: 687b ldr r3, [r7, #4] + 800a5a2: 6bfa ldr r2, [r7, #60] @ 0x3c + 800a5a4: 675a str r2, [r3, #116] @ 0x74 + } + } +#endif /* TCP_QUEUE_OOSEQ */ + + pcb->rcv_nxt = seqno + tcplen; + 800a5a6: 4b5a ldr r3, [pc, #360] @ (800a710 ) + 800a5a8: 881b ldrh r3, [r3, #0] + 800a5aa: 461a mov r2, r3 + 800a5ac: 4b59 ldr r3, [pc, #356] @ (800a714 ) + 800a5ae: 681b ldr r3, [r3, #0] + 800a5b0: 441a add r2, r3 + 800a5b2: 687b ldr r3, [r7, #4] + 800a5b4: 625a str r2, [r3, #36] @ 0x24 + + /* Update the receiver's (our) window. */ + LWIP_ASSERT("tcp_receive: tcplen > rcv_wnd\n", pcb->rcv_wnd >= tcplen); + 800a5b6: 687b ldr r3, [r7, #4] + 800a5b8: 8d1a ldrh r2, [r3, #40] @ 0x28 + 800a5ba: 4b55 ldr r3, [pc, #340] @ (800a710 ) + 800a5bc: 881b ldrh r3, [r3, #0] + 800a5be: 429a cmp r2, r3 + 800a5c0: d206 bcs.n 800a5d0 + 800a5c2: 4b56 ldr r3, [pc, #344] @ (800a71c ) + 800a5c4: f240 6207 movw r2, #1543 @ 0x607 + 800a5c8: 4957 ldr r1, [pc, #348] @ (800a728 ) + 800a5ca: 4856 ldr r0, [pc, #344] @ (800a724 ) + 800a5cc: f007 f814 bl 80115f8 + pcb->rcv_wnd -= tcplen; + 800a5d0: 687b ldr r3, [r7, #4] + 800a5d2: 8d1a ldrh r2, [r3, #40] @ 0x28 + 800a5d4: 4b4e ldr r3, [pc, #312] @ (800a710 ) + 800a5d6: 881b ldrh r3, [r3, #0] + 800a5d8: 1ad3 subs r3, r2, r3 + 800a5da: b29a uxth r2, r3 + 800a5dc: 687b ldr r3, [r7, #4] + 800a5de: 851a strh r2, [r3, #40] @ 0x28 + + tcp_update_rcv_ann_wnd(pcb); + 800a5e0: 6878 ldr r0, [r7, #4] + 800a5e2: f7fc ffc5 bl 8007570 + chains its data on this pbuf as well. + + If the segment was a FIN, we set the TF_GOT_FIN flag that will + be used to indicate to the application that the remote side has + closed its end of the connection. */ + if (inseg.p->tot_len > 0) { + 800a5e6: 4b4c ldr r3, [pc, #304] @ (800a718 ) + 800a5e8: 685b ldr r3, [r3, #4] + 800a5ea: 891b ldrh r3, [r3, #8] + 800a5ec: 2b00 cmp r3, #0 + 800a5ee: d006 beq.n 800a5fe + recv_data = inseg.p; + 800a5f0: 4b49 ldr r3, [pc, #292] @ (800a718 ) + 800a5f2: 685b ldr r3, [r3, #4] + 800a5f4: 4a4d ldr r2, [pc, #308] @ (800a72c ) + 800a5f6: 6013 str r3, [r2, #0] + /* Since this pbuf now is the responsibility of the + application, we delete our reference to it so that we won't + (mistakingly) deallocate it. */ + inseg.p = NULL; + 800a5f8: 4b47 ldr r3, [pc, #284] @ (800a718 ) + 800a5fa: 2200 movs r2, #0 + 800a5fc: 605a str r2, [r3, #4] + } + if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { + 800a5fe: 4b46 ldr r3, [pc, #280] @ (800a718 ) + 800a600: 68db ldr r3, [r3, #12] + 800a602: 899b ldrh r3, [r3, #12] + 800a604: b29b uxth r3, r3 + 800a606: 4618 mov r0, r3 + 800a608: f7fa febe bl 8005388 + 800a60c: 4603 mov r3, r0 + 800a60e: b2db uxtb r3, r3 + 800a610: f003 0301 and.w r3, r3, #1 + 800a614: 2b00 cmp r3, #0 + 800a616: f000 80b8 beq.w 800a78a + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received FIN.\n")); + recv_flags |= TF_GOT_FIN; + 800a61a: 4b45 ldr r3, [pc, #276] @ (800a730 ) + 800a61c: 781b ldrb r3, [r3, #0] + 800a61e: f043 0320 orr.w r3, r3, #32 + 800a622: b2da uxtb r2, r3 + 800a624: 4b42 ldr r3, [pc, #264] @ (800a730 ) + 800a626: 701a strb r2, [r3, #0] + } + +#if TCP_QUEUE_OOSEQ + /* We now check if we have segments on the ->ooseq queue that + are now in sequence. */ + while (pcb->ooseq != NULL && + 800a628: e0af b.n 800a78a + pcb->ooseq->tcphdr->seqno == pcb->rcv_nxt) { + + struct tcp_seg *cseg = pcb->ooseq; + 800a62a: 687b ldr r3, [r7, #4] + 800a62c: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a62e: 60bb str r3, [r7, #8] + seqno = pcb->ooseq->tcphdr->seqno; + 800a630: 687b ldr r3, [r7, #4] + 800a632: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a634: 68db ldr r3, [r3, #12] + 800a636: 685b ldr r3, [r3, #4] + 800a638: 4a36 ldr r2, [pc, #216] @ (800a714 ) + 800a63a: 6013 str r3, [r2, #0] + + pcb->rcv_nxt += TCP_TCPLEN(cseg); + 800a63c: 68bb ldr r3, [r7, #8] + 800a63e: 891b ldrh r3, [r3, #8] + 800a640: 461c mov r4, r3 + 800a642: 68bb ldr r3, [r7, #8] + 800a644: 68db ldr r3, [r3, #12] + 800a646: 899b ldrh r3, [r3, #12] + 800a648: b29b uxth r3, r3 + 800a64a: 4618 mov r0, r3 + 800a64c: f7fa fe9c bl 8005388 + 800a650: 4603 mov r3, r0 + 800a652: b2db uxtb r3, r3 + 800a654: f003 0303 and.w r3, r3, #3 + 800a658: 2b00 cmp r3, #0 + 800a65a: d001 beq.n 800a660 + 800a65c: 2301 movs r3, #1 + 800a65e: e000 b.n 800a662 + 800a660: 2300 movs r3, #0 + 800a662: 191a adds r2, r3, r4 + 800a664: 687b ldr r3, [r7, #4] + 800a666: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a668: 441a add r2, r3 + 800a66a: 687b ldr r3, [r7, #4] + 800a66c: 625a str r2, [r3, #36] @ 0x24 + LWIP_ASSERT("tcp_receive: ooseq tcplen > rcv_wnd\n", + 800a66e: 687b ldr r3, [r7, #4] + 800a670: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800a672: 461c mov r4, r3 + 800a674: 68bb ldr r3, [r7, #8] + 800a676: 891b ldrh r3, [r3, #8] + 800a678: 461d mov r5, r3 + 800a67a: 68bb ldr r3, [r7, #8] + 800a67c: 68db ldr r3, [r3, #12] + 800a67e: 899b ldrh r3, [r3, #12] + 800a680: b29b uxth r3, r3 + 800a682: 4618 mov r0, r3 + 800a684: f7fa fe80 bl 8005388 + 800a688: 4603 mov r3, r0 + 800a68a: b2db uxtb r3, r3 + 800a68c: f003 0303 and.w r3, r3, #3 + 800a690: 2b00 cmp r3, #0 + 800a692: d001 beq.n 800a698 + 800a694: 2301 movs r3, #1 + 800a696: e000 b.n 800a69a + 800a698: 2300 movs r3, #0 + 800a69a: 442b add r3, r5 + 800a69c: 429c cmp r4, r3 + 800a69e: d206 bcs.n 800a6ae + 800a6a0: 4b1e ldr r3, [pc, #120] @ (800a71c ) + 800a6a2: f240 622b movw r2, #1579 @ 0x62b + 800a6a6: 4923 ldr r1, [pc, #140] @ (800a734 ) + 800a6a8: 481e ldr r0, [pc, #120] @ (800a724 ) + 800a6aa: f006 ffa5 bl 80115f8 + pcb->rcv_wnd >= TCP_TCPLEN(cseg)); + pcb->rcv_wnd -= TCP_TCPLEN(cseg); + 800a6ae: 68bb ldr r3, [r7, #8] + 800a6b0: 891b ldrh r3, [r3, #8] + 800a6b2: 461c mov r4, r3 + 800a6b4: 68bb ldr r3, [r7, #8] + 800a6b6: 68db ldr r3, [r3, #12] + 800a6b8: 899b ldrh r3, [r3, #12] + 800a6ba: b29b uxth r3, r3 + 800a6bc: 4618 mov r0, r3 + 800a6be: f7fa fe63 bl 8005388 + 800a6c2: 4603 mov r3, r0 + 800a6c4: b2db uxtb r3, r3 + 800a6c6: f003 0303 and.w r3, r3, #3 + 800a6ca: 2b00 cmp r3, #0 + 800a6cc: d001 beq.n 800a6d2 + 800a6ce: 2301 movs r3, #1 + 800a6d0: e000 b.n 800a6d4 + 800a6d2: 2300 movs r3, #0 + 800a6d4: 1919 adds r1, r3, r4 + 800a6d6: 687b ldr r3, [r7, #4] + 800a6d8: 8d1a ldrh r2, [r3, #40] @ 0x28 + 800a6da: b28b uxth r3, r1 + 800a6dc: 1ad3 subs r3, r2, r3 + 800a6de: b29a uxth r2, r3 + 800a6e0: 687b ldr r3, [r7, #4] + 800a6e2: 851a strh r2, [r3, #40] @ 0x28 + + tcp_update_rcv_ann_wnd(pcb); + 800a6e4: 6878 ldr r0, [r7, #4] + 800a6e6: f7fc ff43 bl 8007570 + + if (cseg->p->tot_len > 0) { + 800a6ea: 68bb ldr r3, [r7, #8] + 800a6ec: 685b ldr r3, [r3, #4] + 800a6ee: 891b ldrh r3, [r3, #8] + 800a6f0: 2b00 cmp r3, #0 + 800a6f2: d028 beq.n 800a746 + /* Chain this pbuf onto the pbuf that we will pass to + the application. */ + /* With window scaling, this can overflow recv_data->tot_len, but + that's not a problem since we explicitly fix that before passing + recv_data to the application. */ + if (recv_data) { + 800a6f4: 4b0d ldr r3, [pc, #52] @ (800a72c ) + 800a6f6: 681b ldr r3, [r3, #0] + 800a6f8: 2b00 cmp r3, #0 + 800a6fa: d01d beq.n 800a738 + pbuf_cat(recv_data, cseg->p); + 800a6fc: 4b0b ldr r3, [pc, #44] @ (800a72c ) + 800a6fe: 681a ldr r2, [r3, #0] + 800a700: 68bb ldr r3, [r7, #8] + 800a702: 685b ldr r3, [r3, #4] + 800a704: 4619 mov r1, r3 + 800a706: 4610 mov r0, r2 + 800a708: f7fc fa50 bl 8006bac + 800a70c: e018 b.n 800a740 + 800a70e: bf00 nop + 800a710: 200190e6 .word 0x200190e6 + 800a714: 200190dc .word 0x200190dc + 800a718: 200190bc .word 0x200190bc + 800a71c: 0801721c .word 0x0801721c + 800a720: 080175fc .word 0x080175fc + 800a724: 08017268 .word 0x08017268 + 800a728: 08017638 .word 0x08017638 + 800a72c: 200190ec .word 0x200190ec + 800a730: 200190e9 .word 0x200190e9 + 800a734: 08017658 .word 0x08017658 + } else { + recv_data = cseg->p; + 800a738: 68bb ldr r3, [r7, #8] + 800a73a: 685b ldr r3, [r3, #4] + 800a73c: 4a70 ldr r2, [pc, #448] @ (800a900 ) + 800a73e: 6013 str r3, [r2, #0] + } + cseg->p = NULL; + 800a740: 68bb ldr r3, [r7, #8] + 800a742: 2200 movs r2, #0 + 800a744: 605a str r2, [r3, #4] + } + if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) { + 800a746: 68bb ldr r3, [r7, #8] + 800a748: 68db ldr r3, [r3, #12] + 800a74a: 899b ldrh r3, [r3, #12] + 800a74c: b29b uxth r3, r3 + 800a74e: 4618 mov r0, r3 + 800a750: f7fa fe1a bl 8005388 + 800a754: 4603 mov r3, r0 + 800a756: b2db uxtb r3, r3 + 800a758: f003 0301 and.w r3, r3, #1 + 800a75c: 2b00 cmp r3, #0 + 800a75e: d00d beq.n 800a77c + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: dequeued FIN.\n")); + recv_flags |= TF_GOT_FIN; + 800a760: 4b68 ldr r3, [pc, #416] @ (800a904 ) + 800a762: 781b ldrb r3, [r3, #0] + 800a764: f043 0320 orr.w r3, r3, #32 + 800a768: b2da uxtb r2, r3 + 800a76a: 4b66 ldr r3, [pc, #408] @ (800a904 ) + 800a76c: 701a strb r2, [r3, #0] + if (pcb->state == ESTABLISHED) { /* force passive close or we can move to active close */ + 800a76e: 687b ldr r3, [r7, #4] + 800a770: 7d1b ldrb r3, [r3, #20] + 800a772: 2b04 cmp r3, #4 + 800a774: d102 bne.n 800a77c + pcb->state = CLOSE_WAIT; + 800a776: 687b ldr r3, [r7, #4] + 800a778: 2207 movs r2, #7 + 800a77a: 751a strb r2, [r3, #20] + } + } + + pcb->ooseq = cseg->next; + 800a77c: 68bb ldr r3, [r7, #8] + 800a77e: 681a ldr r2, [r3, #0] + 800a780: 687b ldr r3, [r7, #4] + 800a782: 675a str r2, [r3, #116] @ 0x74 + tcp_seg_free(cseg); + 800a784: 68b8 ldr r0, [r7, #8] + 800a786: f7fd fbd4 bl 8007f32 + while (pcb->ooseq != NULL && + 800a78a: 687b ldr r3, [r7, #4] + 800a78c: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a78e: 2b00 cmp r3, #0 + 800a790: d008 beq.n 800a7a4 + pcb->ooseq->tcphdr->seqno == pcb->rcv_nxt) { + 800a792: 687b ldr r3, [r7, #4] + 800a794: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a796: 68db ldr r3, [r3, #12] + 800a798: 685a ldr r2, [r3, #4] + 800a79a: 687b ldr r3, [r7, #4] + 800a79c: 6a5b ldr r3, [r3, #36] @ 0x24 + while (pcb->ooseq != NULL && + 800a79e: 429a cmp r2, r3 + 800a7a0: f43f af43 beq.w 800a62a +#endif /* LWIP_TCP_SACK_OUT */ +#endif /* TCP_QUEUE_OOSEQ */ + + + /* Acknowledge the segment(s). */ + tcp_ack(pcb); + 800a7a4: 687b ldr r3, [r7, #4] + 800a7a6: 8b5b ldrh r3, [r3, #26] + 800a7a8: f003 0301 and.w r3, r3, #1 + 800a7ac: 2b00 cmp r3, #0 + 800a7ae: d00e beq.n 800a7ce + 800a7b0: 687b ldr r3, [r7, #4] + 800a7b2: 8b5b ldrh r3, [r3, #26] + 800a7b4: f023 0301 bic.w r3, r3, #1 + 800a7b8: b29a uxth r2, r3 + 800a7ba: 687b ldr r3, [r7, #4] + 800a7bc: 835a strh r2, [r3, #26] + 800a7be: 687b ldr r3, [r7, #4] + 800a7c0: 8b5b ldrh r3, [r3, #26] + 800a7c2: f043 0302 orr.w r3, r3, #2 + 800a7c6: b29a uxth r2, r3 + 800a7c8: 687b ldr r3, [r7, #4] + 800a7ca: 835a strh r2, [r3, #26] + if (pcb->rcv_nxt == seqno) { + 800a7cc: e187 b.n 800aade + tcp_ack(pcb); + 800a7ce: 687b ldr r3, [r7, #4] + 800a7d0: 8b5b ldrh r3, [r3, #26] + 800a7d2: f043 0301 orr.w r3, r3, #1 + 800a7d6: b29a uxth r2, r3 + 800a7d8: 687b ldr r3, [r7, #4] + 800a7da: 835a strh r2, [r3, #26] + if (pcb->rcv_nxt == seqno) { + 800a7dc: e17f b.n 800aade + } else { + /* We get here if the incoming segment is out-of-sequence. */ + +#if TCP_QUEUE_OOSEQ + /* We queue the segment on the ->ooseq queue. */ + if (pcb->ooseq == NULL) { + 800a7de: 687b ldr r3, [r7, #4] + 800a7e0: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a7e2: 2b00 cmp r3, #0 + 800a7e4: d106 bne.n 800a7f4 + pcb->ooseq = tcp_seg_copy(&inseg); + 800a7e6: 4848 ldr r0, [pc, #288] @ (800a908 ) + 800a7e8: f7fd fbbc bl 8007f64 + 800a7ec: 4602 mov r2, r0 + 800a7ee: 687b ldr r3, [r7, #4] + 800a7f0: 675a str r2, [r3, #116] @ 0x74 + 800a7f2: e16c b.n 800aace +#if LWIP_TCP_SACK_OUT + /* This is the left edge of the lowest possible SACK range. + It may start before the newly received segment (possibly adjusted below). */ + u32_t sackbeg = TCP_SEQ_LT(seqno, pcb->ooseq->tcphdr->seqno) ? seqno : pcb->ooseq->tcphdr->seqno; +#endif /* LWIP_TCP_SACK_OUT */ + struct tcp_seg *next, *prev = NULL; + 800a7f4: 2300 movs r3, #0 + 800a7f6: 637b str r3, [r7, #52] @ 0x34 + for (next = pcb->ooseq; next != NULL; next = next->next) { + 800a7f8: 687b ldr r3, [r7, #4] + 800a7fa: 6f5b ldr r3, [r3, #116] @ 0x74 + 800a7fc: 63bb str r3, [r7, #56] @ 0x38 + 800a7fe: e156 b.n 800aaae + if (seqno == next->tcphdr->seqno) { + 800a800: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a802: 68db ldr r3, [r3, #12] + 800a804: 685a ldr r2, [r3, #4] + 800a806: 4b41 ldr r3, [pc, #260] @ (800a90c ) + 800a808: 681b ldr r3, [r3, #0] + 800a80a: 429a cmp r2, r3 + 800a80c: d11d bne.n 800a84a + /* The sequence number of the incoming segment is the + same as the sequence number of the segment on + ->ooseq. We check the lengths to see which one to + discard. */ + if (inseg.len > next->len) { + 800a80e: 4b3e ldr r3, [pc, #248] @ (800a908 ) + 800a810: 891a ldrh r2, [r3, #8] + 800a812: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a814: 891b ldrh r3, [r3, #8] + 800a816: 429a cmp r2, r3 + 800a818: f240 814e bls.w 800aab8 + /* The incoming segment is larger than the old + segment. We replace some segments with the new + one. */ + struct tcp_seg *cseg = tcp_seg_copy(&inseg); + 800a81c: 483a ldr r0, [pc, #232] @ (800a908 ) + 800a81e: f7fd fba1 bl 8007f64 + 800a822: 6178 str r0, [r7, #20] + if (cseg != NULL) { + 800a824: 697b ldr r3, [r7, #20] + 800a826: 2b00 cmp r3, #0 + 800a828: f000 8148 beq.w 800aabc + if (prev != NULL) { + 800a82c: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a82e: 2b00 cmp r3, #0 + 800a830: d003 beq.n 800a83a + prev->next = cseg; + 800a832: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a834: 697a ldr r2, [r7, #20] + 800a836: 601a str r2, [r3, #0] + 800a838: e002 b.n 800a840 + } else { + pcb->ooseq = cseg; + 800a83a: 687b ldr r3, [r7, #4] + 800a83c: 697a ldr r2, [r7, #20] + 800a83e: 675a str r2, [r3, #116] @ 0x74 + } + tcp_oos_insert_segment(cseg, next); + 800a840: 6bb9 ldr r1, [r7, #56] @ 0x38 + 800a842: 6978 ldr r0, [r7, #20] + 800a844: f7ff f8de bl 8009a04 + } + break; + 800a848: e138 b.n 800aabc + segment was smaller than the old one; in either + case, we ditch the incoming segment. */ + break; + } + } else { + if (prev == NULL) { + 800a84a: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a84c: 2b00 cmp r3, #0 + 800a84e: d117 bne.n 800a880 + if (TCP_SEQ_LT(seqno, next->tcphdr->seqno)) { + 800a850: 4b2e ldr r3, [pc, #184] @ (800a90c ) + 800a852: 681a ldr r2, [r3, #0] + 800a854: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a856: 68db ldr r3, [r3, #12] + 800a858: 685b ldr r3, [r3, #4] + 800a85a: 1ad3 subs r3, r2, r3 + 800a85c: 2b00 cmp r3, #0 + 800a85e: da57 bge.n 800a910 + /* The sequence number of the incoming segment is lower + than the sequence number of the first segment on the + queue. We put the incoming segment first on the + queue. */ + struct tcp_seg *cseg = tcp_seg_copy(&inseg); + 800a860: 4829 ldr r0, [pc, #164] @ (800a908 ) + 800a862: f7fd fb7f bl 8007f64 + 800a866: 61b8 str r0, [r7, #24] + if (cseg != NULL) { + 800a868: 69bb ldr r3, [r7, #24] + 800a86a: 2b00 cmp r3, #0 + 800a86c: f000 8128 beq.w 800aac0 + pcb->ooseq = cseg; + 800a870: 687b ldr r3, [r7, #4] + 800a872: 69ba ldr r2, [r7, #24] + 800a874: 675a str r2, [r3, #116] @ 0x74 + tcp_oos_insert_segment(cseg, next); + 800a876: 6bb9 ldr r1, [r7, #56] @ 0x38 + 800a878: 69b8 ldr r0, [r7, #24] + 800a87a: f7ff f8c3 bl 8009a04 + } + break; + 800a87e: e11f b.n 800aac0 + } + } else { + /*if (TCP_SEQ_LT(prev->tcphdr->seqno, seqno) && + TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {*/ + if (TCP_SEQ_BETWEEN(seqno, prev->tcphdr->seqno + 1, next->tcphdr->seqno - 1)) { + 800a880: 4b22 ldr r3, [pc, #136] @ (800a90c ) + 800a882: 681a ldr r2, [r3, #0] + 800a884: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a886: 68db ldr r3, [r3, #12] + 800a888: 685b ldr r3, [r3, #4] + 800a88a: 1ad3 subs r3, r2, r3 + 800a88c: 3b01 subs r3, #1 + 800a88e: 2b00 cmp r3, #0 + 800a890: db3e blt.n 800a910 + 800a892: 4b1e ldr r3, [pc, #120] @ (800a90c ) + 800a894: 681a ldr r2, [r3, #0] + 800a896: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a898: 68db ldr r3, [r3, #12] + 800a89a: 685b ldr r3, [r3, #4] + 800a89c: 1ad3 subs r3, r2, r3 + 800a89e: 3301 adds r3, #1 + 800a8a0: 2b00 cmp r3, #0 + 800a8a2: dc35 bgt.n 800a910 + /* The sequence number of the incoming segment is in + between the sequence numbers of the previous and + the next segment on ->ooseq. We trim trim the previous + segment, delete next segments that included in received segment + and trim received, if needed. */ + struct tcp_seg *cseg = tcp_seg_copy(&inseg); + 800a8a4: 4818 ldr r0, [pc, #96] @ (800a908 ) + 800a8a6: f7fd fb5d bl 8007f64 + 800a8aa: 61f8 str r0, [r7, #28] + if (cseg != NULL) { + 800a8ac: 69fb ldr r3, [r7, #28] + 800a8ae: 2b00 cmp r3, #0 + 800a8b0: f000 8108 beq.w 800aac4 + if (TCP_SEQ_GT(prev->tcphdr->seqno + prev->len, seqno)) { + 800a8b4: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a8b6: 68db ldr r3, [r3, #12] + 800a8b8: 685b ldr r3, [r3, #4] + 800a8ba: 6b7a ldr r2, [r7, #52] @ 0x34 + 800a8bc: 8912 ldrh r2, [r2, #8] + 800a8be: 441a add r2, r3 + 800a8c0: 4b12 ldr r3, [pc, #72] @ (800a90c ) + 800a8c2: 681b ldr r3, [r3, #0] + 800a8c4: 1ad3 subs r3, r2, r3 + 800a8c6: 2b00 cmp r3, #0 + 800a8c8: dd12 ble.n 800a8f0 + /* We need to trim the prev segment. */ + prev->len = (u16_t)(seqno - prev->tcphdr->seqno); + 800a8ca: 4b10 ldr r3, [pc, #64] @ (800a90c ) + 800a8cc: 681b ldr r3, [r3, #0] + 800a8ce: b29a uxth r2, r3 + 800a8d0: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a8d2: 68db ldr r3, [r3, #12] + 800a8d4: 685b ldr r3, [r3, #4] + 800a8d6: b29b uxth r3, r3 + 800a8d8: 1ad3 subs r3, r2, r3 + 800a8da: b29a uxth r2, r3 + 800a8dc: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a8de: 811a strh r2, [r3, #8] + pbuf_realloc(prev->p, prev->len); + 800a8e0: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a8e2: 685a ldr r2, [r3, #4] + 800a8e4: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a8e6: 891b ldrh r3, [r3, #8] + 800a8e8: 4619 mov r1, r3 + 800a8ea: 4610 mov r0, r2 + 800a8ec: f7fb ff18 bl 8006720 + } + prev->next = cseg; + 800a8f0: 6b7b ldr r3, [r7, #52] @ 0x34 + 800a8f2: 69fa ldr r2, [r7, #28] + 800a8f4: 601a str r2, [r3, #0] + tcp_oos_insert_segment(cseg, next); + 800a8f6: 6bb9 ldr r1, [r7, #56] @ 0x38 + 800a8f8: 69f8 ldr r0, [r7, #28] + 800a8fa: f7ff f883 bl 8009a04 + } + break; + 800a8fe: e0e1 b.n 800aac4 + 800a900: 200190ec .word 0x200190ec + 800a904: 200190e9 .word 0x200190e9 + 800a908: 200190bc .word 0x200190bc + 800a90c: 200190dc .word 0x200190dc +#endif /* LWIP_TCP_SACK_OUT */ + + /* We don't use 'prev' below, so let's set it to current 'next'. + This way even if we break the loop below, 'prev' will be pointing + at the segment right in front of the newly added one. */ + prev = next; + 800a910: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a912: 637b str r3, [r7, #52] @ 0x34 + + /* If the "next" segment is the last segment on the + ooseq queue, we add the incoming segment to the end + of the list. */ + if (next->next == NULL && + 800a914: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a916: 681b ldr r3, [r3, #0] + 800a918: 2b00 cmp r3, #0 + 800a91a: f040 80c5 bne.w 800aaa8 + TCP_SEQ_GT(seqno, next->tcphdr->seqno)) { + 800a91e: 4b7f ldr r3, [pc, #508] @ (800ab1c ) + 800a920: 681a ldr r2, [r3, #0] + 800a922: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a924: 68db ldr r3, [r3, #12] + 800a926: 685b ldr r3, [r3, #4] + 800a928: 1ad3 subs r3, r2, r3 + if (next->next == NULL && + 800a92a: 2b00 cmp r3, #0 + 800a92c: f340 80bc ble.w 800aaa8 + if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) { + 800a930: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a932: 68db ldr r3, [r3, #12] + 800a934: 899b ldrh r3, [r3, #12] + 800a936: b29b uxth r3, r3 + 800a938: 4618 mov r0, r3 + 800a93a: f7fa fd25 bl 8005388 + 800a93e: 4603 mov r3, r0 + 800a940: b2db uxtb r3, r3 + 800a942: f003 0301 and.w r3, r3, #1 + 800a946: 2b00 cmp r3, #0 + 800a948: f040 80be bne.w 800aac8 + /* segment "next" already contains all data */ + break; + } + next->next = tcp_seg_copy(&inseg); + 800a94c: 4874 ldr r0, [pc, #464] @ (800ab20 ) + 800a94e: f7fd fb09 bl 8007f64 + 800a952: 4602 mov r2, r0 + 800a954: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a956: 601a str r2, [r3, #0] + if (next->next != NULL) { + 800a958: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a95a: 681b ldr r3, [r3, #0] + 800a95c: 2b00 cmp r3, #0 + 800a95e: f000 80b5 beq.w 800aacc + if (TCP_SEQ_GT(next->tcphdr->seqno + next->len, seqno)) { + 800a962: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a964: 68db ldr r3, [r3, #12] + 800a966: 685b ldr r3, [r3, #4] + 800a968: 6bba ldr r2, [r7, #56] @ 0x38 + 800a96a: 8912 ldrh r2, [r2, #8] + 800a96c: 441a add r2, r3 + 800a96e: 4b6b ldr r3, [pc, #428] @ (800ab1c ) + 800a970: 681b ldr r3, [r3, #0] + 800a972: 1ad3 subs r3, r2, r3 + 800a974: 2b00 cmp r3, #0 + 800a976: dd12 ble.n 800a99e + /* We need to trim the last segment. */ + next->len = (u16_t)(seqno - next->tcphdr->seqno); + 800a978: 4b68 ldr r3, [pc, #416] @ (800ab1c ) + 800a97a: 681b ldr r3, [r3, #0] + 800a97c: b29a uxth r2, r3 + 800a97e: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a980: 68db ldr r3, [r3, #12] + 800a982: 685b ldr r3, [r3, #4] + 800a984: b29b uxth r3, r3 + 800a986: 1ad3 subs r3, r2, r3 + 800a988: b29a uxth r2, r3 + 800a98a: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a98c: 811a strh r2, [r3, #8] + pbuf_realloc(next->p, next->len); + 800a98e: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a990: 685a ldr r2, [r3, #4] + 800a992: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a994: 891b ldrh r3, [r3, #8] + 800a996: 4619 mov r1, r3 + 800a998: 4610 mov r0, r2 + 800a99a: f7fb fec1 bl 8006720 + } + /* check if the remote side overruns our receive window */ + if (TCP_SEQ_GT((u32_t)tcplen + seqno, pcb->rcv_nxt + (u32_t)pcb->rcv_wnd)) { + 800a99e: 4b61 ldr r3, [pc, #388] @ (800ab24 ) + 800a9a0: 881b ldrh r3, [r3, #0] + 800a9a2: 461a mov r2, r3 + 800a9a4: 4b5d ldr r3, [pc, #372] @ (800ab1c ) + 800a9a6: 681b ldr r3, [r3, #0] + 800a9a8: 441a add r2, r3 + 800a9aa: 687b ldr r3, [r7, #4] + 800a9ac: 6a5b ldr r3, [r3, #36] @ 0x24 + 800a9ae: 6879 ldr r1, [r7, #4] + 800a9b0: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800a9b2: 440b add r3, r1 + 800a9b4: 1ad3 subs r3, r2, r3 + 800a9b6: 2b00 cmp r3, #0 + 800a9b8: f340 8088 ble.w 800aacc + LWIP_DEBUGF(TCP_INPUT_DEBUG, + ("tcp_receive: other end overran receive window" + "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", + seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); + if (TCPH_FLAGS(next->next->tcphdr) & TCP_FIN) { + 800a9bc: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a9be: 681b ldr r3, [r3, #0] + 800a9c0: 68db ldr r3, [r3, #12] + 800a9c2: 899b ldrh r3, [r3, #12] + 800a9c4: b29b uxth r3, r3 + 800a9c6: 4618 mov r0, r3 + 800a9c8: f7fa fcde bl 8005388 + 800a9cc: 4603 mov r3, r0 + 800a9ce: b2db uxtb r3, r3 + 800a9d0: f003 0301 and.w r3, r3, #1 + 800a9d4: 2b00 cmp r3, #0 + 800a9d6: d021 beq.n 800aa1c + /* Must remove the FIN from the header as we're trimming + * that byte of sequence-space from the packet */ + TCPH_FLAGS_SET(next->next->tcphdr, TCPH_FLAGS(next->next->tcphdr) & ~TCP_FIN); + 800a9d8: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a9da: 681b ldr r3, [r3, #0] + 800a9dc: 68db ldr r3, [r3, #12] + 800a9de: 899b ldrh r3, [r3, #12] + 800a9e0: b29b uxth r3, r3 + 800a9e2: b21b sxth r3, r3 + 800a9e4: f423 537c bic.w r3, r3, #16128 @ 0x3f00 + 800a9e8: b21c sxth r4, r3 + 800a9ea: 6bbb ldr r3, [r7, #56] @ 0x38 + 800a9ec: 681b ldr r3, [r3, #0] + 800a9ee: 68db ldr r3, [r3, #12] + 800a9f0: 899b ldrh r3, [r3, #12] + 800a9f2: b29b uxth r3, r3 + 800a9f4: 4618 mov r0, r3 + 800a9f6: f7fa fcc7 bl 8005388 + 800a9fa: 4603 mov r3, r0 + 800a9fc: b2db uxtb r3, r3 + 800a9fe: f003 033e and.w r3, r3, #62 @ 0x3e + 800aa02: b29b uxth r3, r3 + 800aa04: 4618 mov r0, r3 + 800aa06: f7fa fcbf bl 8005388 + 800aa0a: 4603 mov r3, r0 + 800aa0c: b21b sxth r3, r3 + 800aa0e: 4323 orrs r3, r4 + 800aa10: b21a sxth r2, r3 + 800aa12: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aa14: 681b ldr r3, [r3, #0] + 800aa16: 68db ldr r3, [r3, #12] + 800aa18: b292 uxth r2, r2 + 800aa1a: 819a strh r2, [r3, #12] + } + /* Adjust length of segment to fit in the window. */ + next->next->len = (u16_t)(pcb->rcv_nxt + pcb->rcv_wnd - seqno); + 800aa1c: 687b ldr r3, [r7, #4] + 800aa1e: 6a5b ldr r3, [r3, #36] @ 0x24 + 800aa20: b29a uxth r2, r3 + 800aa22: 687b ldr r3, [r7, #4] + 800aa24: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800aa26: 4413 add r3, r2 + 800aa28: b299 uxth r1, r3 + 800aa2a: 4b3c ldr r3, [pc, #240] @ (800ab1c ) + 800aa2c: 681b ldr r3, [r3, #0] + 800aa2e: b29a uxth r2, r3 + 800aa30: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aa32: 681b ldr r3, [r3, #0] + 800aa34: 1a8a subs r2, r1, r2 + 800aa36: b292 uxth r2, r2 + 800aa38: 811a strh r2, [r3, #8] + pbuf_realloc(next->next->p, next->next->len); + 800aa3a: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aa3c: 681b ldr r3, [r3, #0] + 800aa3e: 685a ldr r2, [r3, #4] + 800aa40: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aa42: 681b ldr r3, [r3, #0] + 800aa44: 891b ldrh r3, [r3, #8] + 800aa46: 4619 mov r1, r3 + 800aa48: 4610 mov r0, r2 + 800aa4a: f7fb fe69 bl 8006720 + tcplen = TCP_TCPLEN(next->next); + 800aa4e: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aa50: 681b ldr r3, [r3, #0] + 800aa52: 891c ldrh r4, [r3, #8] + 800aa54: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aa56: 681b ldr r3, [r3, #0] + 800aa58: 68db ldr r3, [r3, #12] + 800aa5a: 899b ldrh r3, [r3, #12] + 800aa5c: b29b uxth r3, r3 + 800aa5e: 4618 mov r0, r3 + 800aa60: f7fa fc92 bl 8005388 + 800aa64: 4603 mov r3, r0 + 800aa66: b2db uxtb r3, r3 + 800aa68: f003 0303 and.w r3, r3, #3 + 800aa6c: 2b00 cmp r3, #0 + 800aa6e: d001 beq.n 800aa74 + 800aa70: 2301 movs r3, #1 + 800aa72: e000 b.n 800aa76 + 800aa74: 2300 movs r3, #0 + 800aa76: 4423 add r3, r4 + 800aa78: b29a uxth r2, r3 + 800aa7a: 4b2a ldr r3, [pc, #168] @ (800ab24 ) + 800aa7c: 801a strh r2, [r3, #0] + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n", + 800aa7e: 4b29 ldr r3, [pc, #164] @ (800ab24 ) + 800aa80: 881b ldrh r3, [r3, #0] + 800aa82: 461a mov r2, r3 + 800aa84: 4b25 ldr r3, [pc, #148] @ (800ab1c ) + 800aa86: 681b ldr r3, [r3, #0] + 800aa88: 441a add r2, r3 + 800aa8a: 687b ldr r3, [r7, #4] + 800aa8c: 6a5b ldr r3, [r3, #36] @ 0x24 + 800aa8e: 6879 ldr r1, [r7, #4] + 800aa90: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800aa92: 440b add r3, r1 + 800aa94: 429a cmp r2, r3 + 800aa96: d019 beq.n 800aacc + 800aa98: 4b23 ldr r3, [pc, #140] @ (800ab28 ) + 800aa9a: f44f 62df mov.w r2, #1784 @ 0x6f8 + 800aa9e: 4923 ldr r1, [pc, #140] @ (800ab2c ) + 800aaa0: 4823 ldr r0, [pc, #140] @ (800ab30 ) + 800aaa2: f006 fda9 bl 80115f8 + (seqno + tcplen) == (pcb->rcv_nxt + pcb->rcv_wnd)); + } + } + break; + 800aaa6: e011 b.n 800aacc + for (next = pcb->ooseq; next != NULL; next = next->next) { + 800aaa8: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aaaa: 681b ldr r3, [r3, #0] + 800aaac: 63bb str r3, [r7, #56] @ 0x38 + 800aaae: 6bbb ldr r3, [r7, #56] @ 0x38 + 800aab0: 2b00 cmp r3, #0 + 800aab2: f47f aea5 bne.w 800a800 + 800aab6: e00a b.n 800aace + break; + 800aab8: bf00 nop + 800aaba: e008 b.n 800aace + break; + 800aabc: bf00 nop + 800aabe: e006 b.n 800aace + break; + 800aac0: bf00 nop + 800aac2: e004 b.n 800aace + break; + 800aac4: bf00 nop + 800aac6: e002 b.n 800aace + break; + 800aac8: bf00 nop + 800aaca: e000 b.n 800aace + break; + 800aacc: bf00 nop +#endif /* TCP_OOSEQ_BYTES_LIMIT || TCP_OOSEQ_PBUFS_LIMIT */ +#endif /* TCP_QUEUE_OOSEQ */ + + /* We send the ACK packet after we've (potentially) dealt with SACKs, + so they can be included in the acknowledgment. */ + tcp_send_empty_ack(pcb); + 800aace: 6878 ldr r0, [r7, #4] + 800aad0: f001 fa30 bl 800bf34 + if (pcb->rcv_nxt == seqno) { + 800aad4: e003 b.n 800aade + } + } else { + /* The incoming segment is not within the window. */ + tcp_send_empty_ack(pcb); + 800aad6: 6878 ldr r0, [r7, #4] + 800aad8: f001 fa2c bl 800bf34 + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + 800aadc: e01a b.n 800ab14 + 800aade: e019 b.n 800ab14 + } + } else { + /* Segments with length 0 is taken care of here. Segments that + fall out of the window are ACKed. */ + if (!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd - 1)) { + 800aae0: 4b0e ldr r3, [pc, #56] @ (800ab1c ) + 800aae2: 681a ldr r2, [r3, #0] + 800aae4: 687b ldr r3, [r7, #4] + 800aae6: 6a5b ldr r3, [r3, #36] @ 0x24 + 800aae8: 1ad3 subs r3, r2, r3 + 800aaea: 2b00 cmp r3, #0 + 800aaec: db0a blt.n 800ab04 + 800aaee: 4b0b ldr r3, [pc, #44] @ (800ab1c ) + 800aaf0: 681a ldr r2, [r3, #0] + 800aaf2: 687b ldr r3, [r7, #4] + 800aaf4: 6a5b ldr r3, [r3, #36] @ 0x24 + 800aaf6: 6879 ldr r1, [r7, #4] + 800aaf8: 8d09 ldrh r1, [r1, #40] @ 0x28 + 800aafa: 440b add r3, r1 + 800aafc: 1ad3 subs r3, r2, r3 + 800aafe: 3301 adds r3, #1 + 800ab00: 2b00 cmp r3, #0 + 800ab02: dd07 ble.n 800ab14 + tcp_ack_now(pcb); + 800ab04: 687b ldr r3, [r7, #4] + 800ab06: 8b5b ldrh r3, [r3, #26] + 800ab08: f043 0302 orr.w r3, r3, #2 + 800ab0c: b29a uxth r2, r3 + 800ab0e: 687b ldr r3, [r7, #4] + 800ab10: 835a strh r2, [r3, #26] + } + } +} + 800ab12: e7ff b.n 800ab14 + 800ab14: bf00 nop + 800ab16: 3750 adds r7, #80 @ 0x50 + 800ab18: 46bd mov sp, r7 + 800ab1a: bdb0 pop {r4, r5, r7, pc} + 800ab1c: 200190dc .word 0x200190dc + 800ab20: 200190bc .word 0x200190bc + 800ab24: 200190e6 .word 0x200190e6 + 800ab28: 0801721c .word 0x0801721c + 800ab2c: 080175c4 .word 0x080175c4 + 800ab30: 08017268 .word 0x08017268 + +0800ab34 : + +static u8_t +tcp_get_next_optbyte(void) +{ + 800ab34: b480 push {r7} + 800ab36: b083 sub sp, #12 + 800ab38: af00 add r7, sp, #0 + u16_t optidx = tcp_optidx++; + 800ab3a: 4b15 ldr r3, [pc, #84] @ (800ab90 ) + 800ab3c: 881b ldrh r3, [r3, #0] + 800ab3e: 1c5a adds r2, r3, #1 + 800ab40: b291 uxth r1, r2 + 800ab42: 4a13 ldr r2, [pc, #76] @ (800ab90 ) + 800ab44: 8011 strh r1, [r2, #0] + 800ab46: 80fb strh r3, [r7, #6] + if ((tcphdr_opt2 == NULL) || (optidx < tcphdr_opt1len)) { + 800ab48: 4b12 ldr r3, [pc, #72] @ (800ab94 ) + 800ab4a: 681b ldr r3, [r3, #0] + 800ab4c: 2b00 cmp r3, #0 + 800ab4e: d004 beq.n 800ab5a + 800ab50: 4b11 ldr r3, [pc, #68] @ (800ab98 ) + 800ab52: 881b ldrh r3, [r3, #0] + 800ab54: 88fa ldrh r2, [r7, #6] + 800ab56: 429a cmp r2, r3 + 800ab58: d208 bcs.n 800ab6c + u8_t *opts = (u8_t *)tcphdr + TCP_HLEN; + 800ab5a: 4b10 ldr r3, [pc, #64] @ (800ab9c ) + 800ab5c: 681b ldr r3, [r3, #0] + 800ab5e: 3314 adds r3, #20 + 800ab60: 603b str r3, [r7, #0] + return opts[optidx]; + 800ab62: 88fb ldrh r3, [r7, #6] + 800ab64: 683a ldr r2, [r7, #0] + 800ab66: 4413 add r3, r2 + 800ab68: 781b ldrb r3, [r3, #0] + 800ab6a: e00b b.n 800ab84 + } else { + u8_t idx = (u8_t)(optidx - tcphdr_opt1len); + 800ab6c: 88fb ldrh r3, [r7, #6] + 800ab6e: b2da uxtb r2, r3 + 800ab70: 4b09 ldr r3, [pc, #36] @ (800ab98 ) + 800ab72: 881b ldrh r3, [r3, #0] + 800ab74: b2db uxtb r3, r3 + 800ab76: 1ad3 subs r3, r2, r3 + 800ab78: 717b strb r3, [r7, #5] + return tcphdr_opt2[idx]; + 800ab7a: 4b06 ldr r3, [pc, #24] @ (800ab94 ) + 800ab7c: 681a ldr r2, [r3, #0] + 800ab7e: 797b ldrb r3, [r7, #5] + 800ab80: 4413 add r3, r2 + 800ab82: 781b ldrb r3, [r3, #0] + } +} + 800ab84: 4618 mov r0, r3 + 800ab86: 370c adds r7, #12 + 800ab88: 46bd mov sp, r7 + 800ab8a: f85d 7b04 ldr.w r7, [sp], #4 + 800ab8e: 4770 bx lr + 800ab90: 200190d8 .word 0x200190d8 + 800ab94: 200190d4 .word 0x200190d4 + 800ab98: 200190d2 .word 0x200190d2 + 800ab9c: 200190cc .word 0x200190cc + +0800aba0 : + * + * @param pcb the tcp_pcb for which a segment arrived + */ +static void +tcp_parseopt(struct tcp_pcb *pcb) +{ + 800aba0: b580 push {r7, lr} + 800aba2: b084 sub sp, #16 + 800aba4: af00 add r7, sp, #0 + 800aba6: 6078 str r0, [r7, #4] + u16_t mss; +#if LWIP_TCP_TIMESTAMPS + u32_t tsval; +#endif + + LWIP_ASSERT("tcp_parseopt: invalid pcb", pcb != NULL); + 800aba8: 687b ldr r3, [r7, #4] + 800abaa: 2b00 cmp r3, #0 + 800abac: d106 bne.n 800abbc + 800abae: 4b32 ldr r3, [pc, #200] @ (800ac78 ) + 800abb0: f240 727d movw r2, #1917 @ 0x77d + 800abb4: 4931 ldr r1, [pc, #196] @ (800ac7c ) + 800abb6: 4832 ldr r0, [pc, #200] @ (800ac80 ) + 800abb8: f006 fd1e bl 80115f8 + + /* Parse the TCP MSS option, if present. */ + if (tcphdr_optlen != 0) { + 800abbc: 4b31 ldr r3, [pc, #196] @ (800ac84 ) + 800abbe: 881b ldrh r3, [r3, #0] + 800abc0: 2b00 cmp r3, #0 + 800abc2: d056 beq.n 800ac72 + for (tcp_optidx = 0; tcp_optidx < tcphdr_optlen; ) { + 800abc4: 4b30 ldr r3, [pc, #192] @ (800ac88 ) + 800abc6: 2200 movs r2, #0 + 800abc8: 801a strh r2, [r3, #0] + 800abca: e046 b.n 800ac5a + u8_t opt = tcp_get_next_optbyte(); + 800abcc: f7ff ffb2 bl 800ab34 + 800abd0: 4603 mov r3, r0 + 800abd2: 73fb strb r3, [r7, #15] + switch (opt) { + 800abd4: 7bfb ldrb r3, [r7, #15] + 800abd6: 2b02 cmp r3, #2 + 800abd8: d006 beq.n 800abe8 + 800abda: 2b02 cmp r3, #2 + 800abdc: dc2a bgt.n 800ac34 + 800abde: 2b00 cmp r3, #0 + 800abe0: d042 beq.n 800ac68 + 800abe2: 2b01 cmp r3, #1 + 800abe4: d038 beq.n 800ac58 + 800abe6: e025 b.n 800ac34 + /* NOP option. */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: NOP\n")); + break; + case LWIP_TCP_OPT_MSS: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: MSS\n")); + if (tcp_get_next_optbyte() != LWIP_TCP_OPT_LEN_MSS || (tcp_optidx - 2 + LWIP_TCP_OPT_LEN_MSS) > tcphdr_optlen) { + 800abe8: f7ff ffa4 bl 800ab34 + 800abec: 4603 mov r3, r0 + 800abee: 2b04 cmp r3, #4 + 800abf0: d13c bne.n 800ac6c + 800abf2: 4b25 ldr r3, [pc, #148] @ (800ac88 ) + 800abf4: 881b ldrh r3, [r3, #0] + 800abf6: 3301 adds r3, #1 + 800abf8: 4a22 ldr r2, [pc, #136] @ (800ac84 ) + 800abfa: 8812 ldrh r2, [r2, #0] + 800abfc: 4293 cmp r3, r2 + 800abfe: da35 bge.n 800ac6c + /* Bad length */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n")); + return; + } + /* An MSS option with the right option length. */ + mss = (u16_t)(tcp_get_next_optbyte() << 8); + 800ac00: f7ff ff98 bl 800ab34 + 800ac04: 4603 mov r3, r0 + 800ac06: 021b lsls r3, r3, #8 + 800ac08: 81bb strh r3, [r7, #12] + mss |= tcp_get_next_optbyte(); + 800ac0a: f7ff ff93 bl 800ab34 + 800ac0e: 4603 mov r3, r0 + 800ac10: 461a mov r2, r3 + 800ac12: 89bb ldrh r3, [r7, #12] + 800ac14: 4313 orrs r3, r2 + 800ac16: 81bb strh r3, [r7, #12] + /* Limit the mss to the configured TCP_MSS and prevent division by zero */ + pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss; + 800ac18: 89bb ldrh r3, [r7, #12] + 800ac1a: f5b3 7f06 cmp.w r3, #536 @ 0x218 + 800ac1e: d804 bhi.n 800ac2a + 800ac20: 89bb ldrh r3, [r7, #12] + 800ac22: 2b00 cmp r3, #0 + 800ac24: d001 beq.n 800ac2a + 800ac26: 89ba ldrh r2, [r7, #12] + 800ac28: e001 b.n 800ac2e + 800ac2a: f44f 7206 mov.w r2, #536 @ 0x218 + 800ac2e: 687b ldr r3, [r7, #4] + 800ac30: 865a strh r2, [r3, #50] @ 0x32 + break; + 800ac32: e012 b.n 800ac5a + } + break; +#endif /* LWIP_TCP_SACK_OUT */ + default: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: other\n")); + data = tcp_get_next_optbyte(); + 800ac34: f7ff ff7e bl 800ab34 + 800ac38: 4603 mov r3, r0 + 800ac3a: 72fb strb r3, [r7, #11] + if (data < 2) { + 800ac3c: 7afb ldrb r3, [r7, #11] + 800ac3e: 2b01 cmp r3, #1 + 800ac40: d916 bls.n 800ac70 + and we don't process them further. */ + return; + } + /* All other options have a length field, so that we easily + can skip past them. */ + tcp_optidx += data - 2; + 800ac42: 7afb ldrb r3, [r7, #11] + 800ac44: b29a uxth r2, r3 + 800ac46: 4b10 ldr r3, [pc, #64] @ (800ac88 ) + 800ac48: 881b ldrh r3, [r3, #0] + 800ac4a: 4413 add r3, r2 + 800ac4c: b29b uxth r3, r3 + 800ac4e: 3b02 subs r3, #2 + 800ac50: b29a uxth r2, r3 + 800ac52: 4b0d ldr r3, [pc, #52] @ (800ac88 ) + 800ac54: 801a strh r2, [r3, #0] + 800ac56: e000 b.n 800ac5a + break; + 800ac58: bf00 nop + for (tcp_optidx = 0; tcp_optidx < tcphdr_optlen; ) { + 800ac5a: 4b0b ldr r3, [pc, #44] @ (800ac88 ) + 800ac5c: 881a ldrh r2, [r3, #0] + 800ac5e: 4b09 ldr r3, [pc, #36] @ (800ac84 ) + 800ac60: 881b ldrh r3, [r3, #0] + 800ac62: 429a cmp r2, r3 + 800ac64: d3b2 bcc.n 800abcc + 800ac66: e004 b.n 800ac72 + return; + 800ac68: bf00 nop + 800ac6a: e002 b.n 800ac72 + return; + 800ac6c: bf00 nop + 800ac6e: e000 b.n 800ac72 + return; + 800ac70: bf00 nop + } + } + } +} + 800ac72: 3710 adds r7, #16 + 800ac74: 46bd mov sp, r7 + 800ac76: bd80 pop {r7, pc} + 800ac78: 0801721c .word 0x0801721c + 800ac7c: 08017680 .word 0x08017680 + 800ac80: 08017268 .word 0x08017268 + 800ac84: 200190d0 .word 0x200190d0 + 800ac88: 200190d8 .word 0x200190d8 + +0800ac8c : + +void +tcp_trigger_input_pcb_close(void) +{ + 800ac8c: b480 push {r7} + 800ac8e: af00 add r7, sp, #0 + recv_flags |= TF_CLOSED; + 800ac90: 4b05 ldr r3, [pc, #20] @ (800aca8 ) + 800ac92: 781b ldrb r3, [r3, #0] + 800ac94: f043 0310 orr.w r3, r3, #16 + 800ac98: b2da uxtb r2, r3 + 800ac9a: 4b03 ldr r3, [pc, #12] @ (800aca8 ) + 800ac9c: 701a strb r2, [r3, #0] +} + 800ac9e: bf00 nop + 800aca0: 46bd mov sp, r7 + 800aca2: f85d 7b04 ldr.w r7, [sp], #4 + 800aca6: 4770 bx lr + 800aca8: 200190e9 .word 0x200190e9 + +0800acac : +static err_t tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif); + +/* tcp_route: common code that returns a fixed bound netif or calls ip_route */ +static struct netif * +tcp_route(const struct tcp_pcb *pcb, const ip_addr_t *src, const ip_addr_t *dst) +{ + 800acac: b580 push {r7, lr} + 800acae: b084 sub sp, #16 + 800acb0: af00 add r7, sp, #0 + 800acb2: 60f8 str r0, [r7, #12] + 800acb4: 60b9 str r1, [r7, #8] + 800acb6: 607a str r2, [r7, #4] + LWIP_UNUSED_ARG(src); /* in case IPv4-only and source-based routing is disabled */ + + if ((pcb != NULL) && (pcb->netif_idx != NETIF_NO_INDEX)) { + 800acb8: 68fb ldr r3, [r7, #12] + 800acba: 2b00 cmp r3, #0 + 800acbc: d00a beq.n 800acd4 + 800acbe: 68fb ldr r3, [r7, #12] + 800acc0: 7a1b ldrb r3, [r3, #8] + 800acc2: 2b00 cmp r3, #0 + 800acc4: d006 beq.n 800acd4 + return netif_get_by_index(pcb->netif_idx); + 800acc6: 68fb ldr r3, [r7, #12] + 800acc8: 7a1b ldrb r3, [r3, #8] + 800acca: 4618 mov r0, r3 + 800accc: f7fb fb4e bl 800636c + 800acd0: 4603 mov r3, r0 + 800acd2: e003 b.n 800acdc + } else { + return ip_route(src, dst); + 800acd4: 6878 ldr r0, [r7, #4] + 800acd6: f005 f869 bl 800fdac + 800acda: 4603 mov r3, r0 + } +} + 800acdc: 4618 mov r0, r3 + 800acde: 3710 adds r7, #16 + 800ace0: 46bd mov sp, r7 + 800ace2: bd80 pop {r7, pc} + +0800ace4 : + * The TCP header is filled in except ackno and wnd. + * p is freed on failure. + */ +static struct tcp_seg * +tcp_create_segment(const struct tcp_pcb *pcb, struct pbuf *p, u8_t hdrflags, u32_t seqno, u8_t optflags) +{ + 800ace4: b590 push {r4, r7, lr} + 800ace6: b087 sub sp, #28 + 800ace8: af00 add r7, sp, #0 + 800acea: 60f8 str r0, [r7, #12] + 800acec: 60b9 str r1, [r7, #8] + 800acee: 603b str r3, [r7, #0] + 800acf0: 4613 mov r3, r2 + 800acf2: 71fb strb r3, [r7, #7] + struct tcp_seg *seg; + u8_t optlen; + + LWIP_ASSERT("tcp_create_segment: invalid pcb", pcb != NULL); + 800acf4: 68fb ldr r3, [r7, #12] + 800acf6: 2b00 cmp r3, #0 + 800acf8: d105 bne.n 800ad06 + 800acfa: 4b43 ldr r3, [pc, #268] @ (800ae08 ) + 800acfc: 22a3 movs r2, #163 @ 0xa3 + 800acfe: 4943 ldr r1, [pc, #268] @ (800ae0c ) + 800ad00: 4843 ldr r0, [pc, #268] @ (800ae10 ) + 800ad02: f006 fc79 bl 80115f8 + LWIP_ASSERT("tcp_create_segment: invalid pbuf", p != NULL); + 800ad06: 68bb ldr r3, [r7, #8] + 800ad08: 2b00 cmp r3, #0 + 800ad0a: d105 bne.n 800ad18 + 800ad0c: 4b3e ldr r3, [pc, #248] @ (800ae08 ) + 800ad0e: 22a4 movs r2, #164 @ 0xa4 + 800ad10: 4940 ldr r1, [pc, #256] @ (800ae14 ) + 800ad12: 483f ldr r0, [pc, #252] @ (800ae10 ) + 800ad14: f006 fc70 bl 80115f8 + + optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(optflags, pcb); + 800ad18: f897 3028 ldrb.w r3, [r7, #40] @ 0x28 + 800ad1c: 009b lsls r3, r3, #2 + 800ad1e: b2db uxtb r3, r3 + 800ad20: f003 0304 and.w r3, r3, #4 + 800ad24: 75fb strb r3, [r7, #23] + + if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) { + 800ad26: 2003 movs r0, #3 + 800ad28: f7fa ff8e bl 8005c48 + 800ad2c: 6138 str r0, [r7, #16] + 800ad2e: 693b ldr r3, [r7, #16] + 800ad30: 2b00 cmp r3, #0 + 800ad32: d104 bne.n 800ad3e + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_create_segment: no memory.\n")); + pbuf_free(p); + 800ad34: 68b8 ldr r0, [r7, #8] + 800ad36: f7fb fe77 bl 8006a28 + return NULL; + 800ad3a: 2300 movs r3, #0 + 800ad3c: e060 b.n 800ae00 + } + seg->flags = optflags; + 800ad3e: 693b ldr r3, [r7, #16] + 800ad40: f897 2028 ldrb.w r2, [r7, #40] @ 0x28 + 800ad44: 729a strb r2, [r3, #10] + seg->next = NULL; + 800ad46: 693b ldr r3, [r7, #16] + 800ad48: 2200 movs r2, #0 + 800ad4a: 601a str r2, [r3, #0] + seg->p = p; + 800ad4c: 693b ldr r3, [r7, #16] + 800ad4e: 68ba ldr r2, [r7, #8] + 800ad50: 605a str r2, [r3, #4] + LWIP_ASSERT("p->tot_len >= optlen", p->tot_len >= optlen); + 800ad52: 68bb ldr r3, [r7, #8] + 800ad54: 891a ldrh r2, [r3, #8] + 800ad56: 7dfb ldrb r3, [r7, #23] + 800ad58: b29b uxth r3, r3 + 800ad5a: 429a cmp r2, r3 + 800ad5c: d205 bcs.n 800ad6a + 800ad5e: 4b2a ldr r3, [pc, #168] @ (800ae08 ) + 800ad60: 22b0 movs r2, #176 @ 0xb0 + 800ad62: 492d ldr r1, [pc, #180] @ (800ae18 ) + 800ad64: 482a ldr r0, [pc, #168] @ (800ae10 ) + 800ad66: f006 fc47 bl 80115f8 + seg->len = p->tot_len - optlen; + 800ad6a: 68bb ldr r3, [r7, #8] + 800ad6c: 891a ldrh r2, [r3, #8] + 800ad6e: 7dfb ldrb r3, [r7, #23] + 800ad70: b29b uxth r3, r3 + 800ad72: 1ad3 subs r3, r2, r3 + 800ad74: b29a uxth r2, r3 + 800ad76: 693b ldr r3, [r7, #16] + 800ad78: 811a strh r2, [r3, #8] + LWIP_ASSERT("invalid optflags passed: TF_SEG_DATA_CHECKSUMMED", + (optflags & TF_SEG_DATA_CHECKSUMMED) == 0); +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* build TCP header */ + if (pbuf_add_header(p, TCP_HLEN)) { + 800ad7a: 2114 movs r1, #20 + 800ad7c: 68b8 ldr r0, [r7, #8] + 800ad7e: f7fb fdbd bl 80068fc + 800ad82: 4603 mov r3, r0 + 800ad84: 2b00 cmp r3, #0 + 800ad86: d004 beq.n 800ad92 + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_create_segment: no room for TCP header in pbuf.\n")); + TCP_STATS_INC(tcp.err); + tcp_seg_free(seg); + 800ad88: 6938 ldr r0, [r7, #16] + 800ad8a: f7fd f8d2 bl 8007f32 + return NULL; + 800ad8e: 2300 movs r3, #0 + 800ad90: e036 b.n 800ae00 + } + seg->tcphdr = (struct tcp_hdr *)seg->p->payload; + 800ad92: 693b ldr r3, [r7, #16] + 800ad94: 685b ldr r3, [r3, #4] + 800ad96: 685a ldr r2, [r3, #4] + 800ad98: 693b ldr r3, [r7, #16] + 800ad9a: 60da str r2, [r3, #12] + seg->tcphdr->src = lwip_htons(pcb->local_port); + 800ad9c: 68fb ldr r3, [r7, #12] + 800ad9e: 8ada ldrh r2, [r3, #22] + 800ada0: 693b ldr r3, [r7, #16] + 800ada2: 68dc ldr r4, [r3, #12] + 800ada4: 4610 mov r0, r2 + 800ada6: f7fa faef bl 8005388 + 800adaa: 4603 mov r3, r0 + 800adac: 8023 strh r3, [r4, #0] + seg->tcphdr->dest = lwip_htons(pcb->remote_port); + 800adae: 68fb ldr r3, [r7, #12] + 800adb0: 8b1a ldrh r2, [r3, #24] + 800adb2: 693b ldr r3, [r7, #16] + 800adb4: 68dc ldr r4, [r3, #12] + 800adb6: 4610 mov r0, r2 + 800adb8: f7fa fae6 bl 8005388 + 800adbc: 4603 mov r3, r0 + 800adbe: 8063 strh r3, [r4, #2] + seg->tcphdr->seqno = lwip_htonl(seqno); + 800adc0: 693b ldr r3, [r7, #16] + 800adc2: 68dc ldr r4, [r3, #12] + 800adc4: 6838 ldr r0, [r7, #0] + 800adc6: f7fa faf4 bl 80053b2 + 800adca: 4603 mov r3, r0 + 800adcc: 6063 str r3, [r4, #4] + /* ackno is set in tcp_output */ + TCPH_HDRLEN_FLAGS_SET(seg->tcphdr, (5 + optlen / 4), hdrflags); + 800adce: 7dfb ldrb r3, [r7, #23] + 800add0: 089b lsrs r3, r3, #2 + 800add2: b2db uxtb r3, r3 + 800add4: 3305 adds r3, #5 + 800add6: b29b uxth r3, r3 + 800add8: 031b lsls r3, r3, #12 + 800adda: b29a uxth r2, r3 + 800addc: 79fb ldrb r3, [r7, #7] + 800adde: b29b uxth r3, r3 + 800ade0: 4313 orrs r3, r2 + 800ade2: b29a uxth r2, r3 + 800ade4: 693b ldr r3, [r7, #16] + 800ade6: 68dc ldr r4, [r3, #12] + 800ade8: 4610 mov r0, r2 + 800adea: f7fa facd bl 8005388 + 800adee: 4603 mov r3, r0 + 800adf0: 81a3 strh r3, [r4, #12] + /* wnd and chksum are set in tcp_output */ + seg->tcphdr->urgp = 0; + 800adf2: 693b ldr r3, [r7, #16] + 800adf4: 68db ldr r3, [r3, #12] + 800adf6: 2200 movs r2, #0 + 800adf8: 749a strb r2, [r3, #18] + 800adfa: 2200 movs r2, #0 + 800adfc: 74da strb r2, [r3, #19] + return seg; + 800adfe: 693b ldr r3, [r7, #16] +} + 800ae00: 4618 mov r0, r3 + 800ae02: 371c adds r7, #28 + 800ae04: 46bd mov sp, r7 + 800ae06: bd90 pop {r4, r7, pc} + 800ae08: 0801769c .word 0x0801769c + 800ae0c: 080176d0 .word 0x080176d0 + 800ae10: 080176f0 .word 0x080176f0 + 800ae14: 08017718 .word 0x08017718 + 800ae18: 0801773c .word 0x0801773c + +0800ae1c : + * @param pcb the tcp_pcb for which to split the unsent head + * @param split the amount of payload to remain in the head + */ +err_t +tcp_split_unsent_seg(struct tcp_pcb *pcb, u16_t split) +{ + 800ae1c: b590 push {r4, r7, lr} + 800ae1e: b08b sub sp, #44 @ 0x2c + 800ae20: af02 add r7, sp, #8 + 800ae22: 6078 str r0, [r7, #4] + 800ae24: 460b mov r3, r1 + 800ae26: 807b strh r3, [r7, #2] + struct tcp_seg *seg = NULL, *useg = NULL; + 800ae28: 2300 movs r3, #0 + 800ae2a: 61fb str r3, [r7, #28] + 800ae2c: 2300 movs r3, #0 + 800ae2e: 617b str r3, [r7, #20] + struct pbuf *p = NULL; + 800ae30: 2300 movs r3, #0 + 800ae32: 613b str r3, [r7, #16] + u16_t chksum = 0; + u8_t chksum_swapped = 0; + struct pbuf *q; +#endif /* TCP_CHECKSUM_ON_COPY */ + + LWIP_ASSERT("tcp_split_unsent_seg: invalid pcb", pcb != NULL); + 800ae34: 687b ldr r3, [r7, #4] + 800ae36: 2b00 cmp r3, #0 + 800ae38: d106 bne.n 800ae48 + 800ae3a: 4b95 ldr r3, [pc, #596] @ (800b090 ) + 800ae3c: f240 324b movw r2, #843 @ 0x34b + 800ae40: 4994 ldr r1, [pc, #592] @ (800b094 ) + 800ae42: 4895 ldr r0, [pc, #596] @ (800b098 ) + 800ae44: f006 fbd8 bl 80115f8 + + useg = pcb->unsent; + 800ae48: 687b ldr r3, [r7, #4] + 800ae4a: 6edb ldr r3, [r3, #108] @ 0x6c + 800ae4c: 617b str r3, [r7, #20] + if (useg == NULL) { + 800ae4e: 697b ldr r3, [r7, #20] + 800ae50: 2b00 cmp r3, #0 + 800ae52: d102 bne.n 800ae5a + return ERR_MEM; + 800ae54: f04f 33ff mov.w r3, #4294967295 + 800ae58: e116 b.n 800b088 + } + + if (split == 0) { + 800ae5a: 887b ldrh r3, [r7, #2] + 800ae5c: 2b00 cmp r3, #0 + 800ae5e: d109 bne.n 800ae74 + LWIP_ASSERT("Can't split segment into length 0", 0); + 800ae60: 4b8b ldr r3, [pc, #556] @ (800b090 ) + 800ae62: f240 3253 movw r2, #851 @ 0x353 + 800ae66: 498d ldr r1, [pc, #564] @ (800b09c ) + 800ae68: 488b ldr r0, [pc, #556] @ (800b098 ) + 800ae6a: f006 fbc5 bl 80115f8 + return ERR_VAL; + 800ae6e: f06f 0305 mvn.w r3, #5 + 800ae72: e109 b.n 800b088 + } + + if (useg->len <= split) { + 800ae74: 697b ldr r3, [r7, #20] + 800ae76: 891b ldrh r3, [r3, #8] + 800ae78: 887a ldrh r2, [r7, #2] + 800ae7a: 429a cmp r2, r3 + 800ae7c: d301 bcc.n 800ae82 + return ERR_OK; + 800ae7e: 2300 movs r3, #0 + 800ae80: e102 b.n 800b088 + } + + LWIP_ASSERT("split <= mss", split <= pcb->mss); + 800ae82: 687b ldr r3, [r7, #4] + 800ae84: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800ae86: 887a ldrh r2, [r7, #2] + 800ae88: 429a cmp r2, r3 + 800ae8a: d906 bls.n 800ae9a + 800ae8c: 4b80 ldr r3, [pc, #512] @ (800b090 ) + 800ae8e: f240 325b movw r2, #859 @ 0x35b + 800ae92: 4983 ldr r1, [pc, #524] @ (800b0a0 ) + 800ae94: 4880 ldr r0, [pc, #512] @ (800b098 ) + 800ae96: f006 fbaf bl 80115f8 + LWIP_ASSERT("useg->len > 0", useg->len > 0); + 800ae9a: 697b ldr r3, [r7, #20] + 800ae9c: 891b ldrh r3, [r3, #8] + 800ae9e: 2b00 cmp r3, #0 + 800aea0: d106 bne.n 800aeb0 + 800aea2: 4b7b ldr r3, [pc, #492] @ (800b090 ) + 800aea4: f44f 7257 mov.w r2, #860 @ 0x35c + 800aea8: 497e ldr r1, [pc, #504] @ (800b0a4 ) + 800aeaa: 487b ldr r0, [pc, #492] @ (800b098 ) + 800aeac: f006 fba4 bl 80115f8 + * to split this packet so we may actually exceed the max value by + * one! + */ + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue: split_unsent_seg: %u\n", (unsigned int)pcb->snd_queuelen)); + + optflags = useg->flags; + 800aeb0: 697b ldr r3, [r7, #20] + 800aeb2: 7a9b ldrb r3, [r3, #10] + 800aeb4: 73fb strb r3, [r7, #15] +#if TCP_CHECKSUM_ON_COPY + /* Remove since checksum is not stored until after tcp_create_segment() */ + optflags &= ~TF_SEG_DATA_CHECKSUMMED; +#endif /* TCP_CHECKSUM_ON_COPY */ + optlen = LWIP_TCP_OPT_LENGTH(optflags); + 800aeb6: 7bfb ldrb r3, [r7, #15] + 800aeb8: 009b lsls r3, r3, #2 + 800aeba: b2db uxtb r3, r3 + 800aebc: f003 0304 and.w r3, r3, #4 + 800aec0: 73bb strb r3, [r7, #14] + remainder = useg->len - split; + 800aec2: 697b ldr r3, [r7, #20] + 800aec4: 891a ldrh r2, [r3, #8] + 800aec6: 887b ldrh r3, [r7, #2] + 800aec8: 1ad3 subs r3, r2, r3 + 800aeca: 81bb strh r3, [r7, #12] + + /* Create new pbuf for the remainder of the split */ + p = pbuf_alloc(PBUF_TRANSPORT, remainder + optlen, PBUF_RAM); + 800aecc: 7bbb ldrb r3, [r7, #14] + 800aece: b29a uxth r2, r3 + 800aed0: 89bb ldrh r3, [r7, #12] + 800aed2: 4413 add r3, r2 + 800aed4: b29b uxth r3, r3 + 800aed6: f44f 7220 mov.w r2, #640 @ 0x280 + 800aeda: 4619 mov r1, r3 + 800aedc: 2036 movs r0, #54 @ 0x36 + 800aede: f7fb fac1 bl 8006464 + 800aee2: 6138 str r0, [r7, #16] + if (p == NULL) { + 800aee4: 693b ldr r3, [r7, #16] + 800aee6: 2b00 cmp r3, #0 + 800aee8: f000 80b7 beq.w 800b05a + ("tcp_split_unsent_seg: could not allocate memory for pbuf remainder %u\n", remainder)); + goto memerr; + } + + /* Offset into the original pbuf is past TCP/IP headers, options, and split amount */ + offset = useg->p->tot_len - useg->len + split; + 800aeec: 697b ldr r3, [r7, #20] + 800aeee: 685b ldr r3, [r3, #4] + 800aef0: 891a ldrh r2, [r3, #8] + 800aef2: 697b ldr r3, [r7, #20] + 800aef4: 891b ldrh r3, [r3, #8] + 800aef6: 1ad3 subs r3, r2, r3 + 800aef8: b29a uxth r2, r3 + 800aefa: 887b ldrh r3, [r7, #2] + 800aefc: 4413 add r3, r2 + 800aefe: 817b strh r3, [r7, #10] + /* Copy remainder into new pbuf, headers and options will not be filled out */ + if (pbuf_copy_partial(useg->p, (u8_t *)p->payload + optlen, remainder, offset ) != remainder) { + 800af00: 697b ldr r3, [r7, #20] + 800af02: 6858 ldr r0, [r3, #4] + 800af04: 693b ldr r3, [r7, #16] + 800af06: 685a ldr r2, [r3, #4] + 800af08: 7bbb ldrb r3, [r7, #14] + 800af0a: 18d1 adds r1, r2, r3 + 800af0c: 897b ldrh r3, [r7, #10] + 800af0e: 89ba ldrh r2, [r7, #12] + 800af10: f7fb ff84 bl 8006e1c + 800af14: 4603 mov r3, r0 + 800af16: 461a mov r2, r3 + 800af18: 89bb ldrh r3, [r7, #12] + 800af1a: 4293 cmp r3, r2 + 800af1c: f040 809f bne.w 800b05e +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* Options are created when calling tcp_output() */ + + /* Migrate flags from original segment */ + split_flags = TCPH_FLAGS(useg->tcphdr); + 800af20: 697b ldr r3, [r7, #20] + 800af22: 68db ldr r3, [r3, #12] + 800af24: 899b ldrh r3, [r3, #12] + 800af26: b29b uxth r3, r3 + 800af28: 4618 mov r0, r3 + 800af2a: f7fa fa2d bl 8005388 + 800af2e: 4603 mov r3, r0 + 800af30: b2db uxtb r3, r3 + 800af32: f003 033f and.w r3, r3, #63 @ 0x3f + 800af36: 76fb strb r3, [r7, #27] + remainder_flags = 0; /* ACK added in tcp_output() */ + 800af38: 2300 movs r3, #0 + 800af3a: 76bb strb r3, [r7, #26] + + if (split_flags & TCP_PSH) { + 800af3c: 7efb ldrb r3, [r7, #27] + 800af3e: f003 0308 and.w r3, r3, #8 + 800af42: 2b00 cmp r3, #0 + 800af44: d007 beq.n 800af56 + split_flags &= ~TCP_PSH; + 800af46: 7efb ldrb r3, [r7, #27] + 800af48: f023 0308 bic.w r3, r3, #8 + 800af4c: 76fb strb r3, [r7, #27] + remainder_flags |= TCP_PSH; + 800af4e: 7ebb ldrb r3, [r7, #26] + 800af50: f043 0308 orr.w r3, r3, #8 + 800af54: 76bb strb r3, [r7, #26] + } + if (split_flags & TCP_FIN) { + 800af56: 7efb ldrb r3, [r7, #27] + 800af58: f003 0301 and.w r3, r3, #1 + 800af5c: 2b00 cmp r3, #0 + 800af5e: d007 beq.n 800af70 + split_flags &= ~TCP_FIN; + 800af60: 7efb ldrb r3, [r7, #27] + 800af62: f023 0301 bic.w r3, r3, #1 + 800af66: 76fb strb r3, [r7, #27] + remainder_flags |= TCP_FIN; + 800af68: 7ebb ldrb r3, [r7, #26] + 800af6a: f043 0301 orr.w r3, r3, #1 + 800af6e: 76bb strb r3, [r7, #26] + } + /* SYN should be left on split, RST should not be present with data */ + + seg = tcp_create_segment(pcb, p, remainder_flags, lwip_ntohl(useg->tcphdr->seqno) + split, optflags); + 800af70: 697b ldr r3, [r7, #20] + 800af72: 68db ldr r3, [r3, #12] + 800af74: 685b ldr r3, [r3, #4] + 800af76: 4618 mov r0, r3 + 800af78: f7fa fa1b bl 80053b2 + 800af7c: 4602 mov r2, r0 + 800af7e: 887b ldrh r3, [r7, #2] + 800af80: 18d1 adds r1, r2, r3 + 800af82: 7eba ldrb r2, [r7, #26] + 800af84: 7bfb ldrb r3, [r7, #15] + 800af86: 9300 str r3, [sp, #0] + 800af88: 460b mov r3, r1 + 800af8a: 6939 ldr r1, [r7, #16] + 800af8c: 6878 ldr r0, [r7, #4] + 800af8e: f7ff fea9 bl 800ace4 + 800af92: 61f8 str r0, [r7, #28] + if (seg == NULL) { + 800af94: 69fb ldr r3, [r7, #28] + 800af96: 2b00 cmp r3, #0 + 800af98: d063 beq.n 800b062 + seg->chksum_swapped = chksum_swapped; + seg->flags |= TF_SEG_DATA_CHECKSUMMED; +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* Remove this segment from the queue since trimming it may free pbufs */ + pcb->snd_queuelen -= pbuf_clen(useg->p); + 800af9a: 697b ldr r3, [r7, #20] + 800af9c: 685b ldr r3, [r3, #4] + 800af9e: 4618 mov r0, r3 + 800afa0: f7fb fdca bl 8006b38 + 800afa4: 4603 mov r3, r0 + 800afa6: 461a mov r2, r3 + 800afa8: 687b ldr r3, [r7, #4] + 800afaa: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800afae: 1a9b subs r3, r3, r2 + 800afb0: b29a uxth r2, r3 + 800afb2: 687b ldr r3, [r7, #4] + 800afb4: f8a3 2066 strh.w r2, [r3, #102] @ 0x66 + + /* Trim the original pbuf into our split size. At this point our remainder segment must be setup + successfully because we are modifying the original segment */ + pbuf_realloc(useg->p, useg->p->tot_len - remainder); + 800afb8: 697b ldr r3, [r7, #20] + 800afba: 6858 ldr r0, [r3, #4] + 800afbc: 697b ldr r3, [r7, #20] + 800afbe: 685b ldr r3, [r3, #4] + 800afc0: 891a ldrh r2, [r3, #8] + 800afc2: 89bb ldrh r3, [r7, #12] + 800afc4: 1ad3 subs r3, r2, r3 + 800afc6: b29b uxth r3, r3 + 800afc8: 4619 mov r1, r3 + 800afca: f7fb fba9 bl 8006720 + useg->len -= remainder; + 800afce: 697b ldr r3, [r7, #20] + 800afd0: 891a ldrh r2, [r3, #8] + 800afd2: 89bb ldrh r3, [r7, #12] + 800afd4: 1ad3 subs r3, r2, r3 + 800afd6: b29a uxth r2, r3 + 800afd8: 697b ldr r3, [r7, #20] + 800afda: 811a strh r2, [r3, #8] + TCPH_SET_FLAG(useg->tcphdr, split_flags); + 800afdc: 697b ldr r3, [r7, #20] + 800afde: 68db ldr r3, [r3, #12] + 800afe0: 899b ldrh r3, [r3, #12] + 800afe2: b29c uxth r4, r3 + 800afe4: 7efb ldrb r3, [r7, #27] + 800afe6: b29b uxth r3, r3 + 800afe8: 4618 mov r0, r3 + 800afea: f7fa f9cd bl 8005388 + 800afee: 4603 mov r3, r0 + 800aff0: 461a mov r2, r3 + 800aff2: 697b ldr r3, [r7, #20] + 800aff4: 68db ldr r3, [r3, #12] + 800aff6: 4322 orrs r2, r4 + 800aff8: b292 uxth r2, r2 + 800affa: 819a strh r2, [r3, #12] + /* By trimming, realloc may have actually shrunk the pbuf, so clear oversize_left */ + useg->oversize_left = 0; +#endif /* TCP_OVERSIZE_DBGCHECK */ + + /* Add back to the queue with new trimmed pbuf */ + pcb->snd_queuelen += pbuf_clen(useg->p); + 800affc: 697b ldr r3, [r7, #20] + 800affe: 685b ldr r3, [r3, #4] + 800b000: 4618 mov r0, r3 + 800b002: f7fb fd99 bl 8006b38 + 800b006: 4603 mov r3, r0 + 800b008: 461a mov r2, r3 + 800b00a: 687b ldr r3, [r7, #4] + 800b00c: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800b010: 4413 add r3, r2 + 800b012: b29a uxth r2, r3 + 800b014: 687b ldr r3, [r7, #4] + 800b016: f8a3 2066 strh.w r2, [r3, #102] @ 0x66 +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* Update number of segments on the queues. Note that length now may + * exceed TCP_SND_QUEUELEN! We don't have to touch pcb->snd_buf + * because the total amount of data is constant when packet is split */ + pcb->snd_queuelen += pbuf_clen(seg->p); + 800b01a: 69fb ldr r3, [r7, #28] + 800b01c: 685b ldr r3, [r3, #4] + 800b01e: 4618 mov r0, r3 + 800b020: f7fb fd8a bl 8006b38 + 800b024: 4603 mov r3, r0 + 800b026: 461a mov r2, r3 + 800b028: 687b ldr r3, [r7, #4] + 800b02a: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800b02e: 4413 add r3, r2 + 800b030: b29a uxth r2, r3 + 800b032: 687b ldr r3, [r7, #4] + 800b034: f8a3 2066 strh.w r2, [r3, #102] @ 0x66 + + /* Finally insert remainder into queue after split (which stays head) */ + seg->next = useg->next; + 800b038: 697b ldr r3, [r7, #20] + 800b03a: 681a ldr r2, [r3, #0] + 800b03c: 69fb ldr r3, [r7, #28] + 800b03e: 601a str r2, [r3, #0] + useg->next = seg; + 800b040: 697b ldr r3, [r7, #20] + 800b042: 69fa ldr r2, [r7, #28] + 800b044: 601a str r2, [r3, #0] + +#if TCP_OVERSIZE + /* If remainder is last segment on the unsent, ensure we clear the oversize amount + * because the remainder is always sized to the exact remaining amount */ + if (seg->next == NULL) { + 800b046: 69fb ldr r3, [r7, #28] + 800b048: 681b ldr r3, [r3, #0] + 800b04a: 2b00 cmp r3, #0 + 800b04c: d103 bne.n 800b056 + pcb->unsent_oversize = 0; + 800b04e: 687b ldr r3, [r7, #4] + 800b050: 2200 movs r2, #0 + 800b052: f8a3 2068 strh.w r2, [r3, #104] @ 0x68 + } +#endif /* TCP_OVERSIZE */ + + return ERR_OK; + 800b056: 2300 movs r3, #0 + 800b058: e016 b.n 800b088 + goto memerr; + 800b05a: bf00 nop + 800b05c: e002 b.n 800b064 + goto memerr; + 800b05e: bf00 nop + 800b060: e000 b.n 800b064 + goto memerr; + 800b062: bf00 nop +memerr: + TCP_STATS_INC(tcp.memerr); + + LWIP_ASSERT("seg == NULL", seg == NULL); + 800b064: 69fb ldr r3, [r7, #28] + 800b066: 2b00 cmp r3, #0 + 800b068: d006 beq.n 800b078 + 800b06a: 4b09 ldr r3, [pc, #36] @ (800b090 ) + 800b06c: f44f 7276 mov.w r2, #984 @ 0x3d8 + 800b070: 490d ldr r1, [pc, #52] @ (800b0a8 ) + 800b072: 4809 ldr r0, [pc, #36] @ (800b098 ) + 800b074: f006 fac0 bl 80115f8 + if (p != NULL) { + 800b078: 693b ldr r3, [r7, #16] + 800b07a: 2b00 cmp r3, #0 + 800b07c: d002 beq.n 800b084 + pbuf_free(p); + 800b07e: 6938 ldr r0, [r7, #16] + 800b080: f7fb fcd2 bl 8006a28 + } + + return ERR_MEM; + 800b084: f04f 33ff mov.w r3, #4294967295 +} + 800b088: 4618 mov r0, r3 + 800b08a: 3724 adds r7, #36 @ 0x24 + 800b08c: 46bd mov sp, r7 + 800b08e: bd90 pop {r4, r7, pc} + 800b090: 0801769c .word 0x0801769c + 800b094: 08017a30 .word 0x08017a30 + 800b098: 080176f0 .word 0x080176f0 + 800b09c: 08017a54 .word 0x08017a54 + 800b0a0: 08017a78 .word 0x08017a78 + 800b0a4: 08017a88 .word 0x08017a88 + 800b0a8: 08017a98 .word 0x08017a98 + +0800b0ac : + * @param pcb the tcp_pcb over which to send a segment + * @return ERR_OK if sent, another err_t otherwise + */ +err_t +tcp_send_fin(struct tcp_pcb *pcb) +{ + 800b0ac: b590 push {r4, r7, lr} + 800b0ae: b085 sub sp, #20 + 800b0b0: af00 add r7, sp, #0 + 800b0b2: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_send_fin: invalid pcb", pcb != NULL); + 800b0b4: 687b ldr r3, [r7, #4] + 800b0b6: 2b00 cmp r3, #0 + 800b0b8: d106 bne.n 800b0c8 + 800b0ba: 4b21 ldr r3, [pc, #132] @ (800b140 ) + 800b0bc: f240 32eb movw r2, #1003 @ 0x3eb + 800b0c0: 4920 ldr r1, [pc, #128] @ (800b144 ) + 800b0c2: 4821 ldr r0, [pc, #132] @ (800b148 ) + 800b0c4: f006 fa98 bl 80115f8 + + /* first, try to add the fin to the last unsent segment */ + if (pcb->unsent != NULL) { + 800b0c8: 687b ldr r3, [r7, #4] + 800b0ca: 6edb ldr r3, [r3, #108] @ 0x6c + 800b0cc: 2b00 cmp r3, #0 + 800b0ce: d02e beq.n 800b12e + struct tcp_seg *last_unsent; + for (last_unsent = pcb->unsent; last_unsent->next != NULL; + 800b0d0: 687b ldr r3, [r7, #4] + 800b0d2: 6edb ldr r3, [r3, #108] @ 0x6c + 800b0d4: 60fb str r3, [r7, #12] + 800b0d6: e002 b.n 800b0de + last_unsent = last_unsent->next); + 800b0d8: 68fb ldr r3, [r7, #12] + 800b0da: 681b ldr r3, [r3, #0] + 800b0dc: 60fb str r3, [r7, #12] + for (last_unsent = pcb->unsent; last_unsent->next != NULL; + 800b0de: 68fb ldr r3, [r7, #12] + 800b0e0: 681b ldr r3, [r3, #0] + 800b0e2: 2b00 cmp r3, #0 + 800b0e4: d1f8 bne.n 800b0d8 + + if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) { + 800b0e6: 68fb ldr r3, [r7, #12] + 800b0e8: 68db ldr r3, [r3, #12] + 800b0ea: 899b ldrh r3, [r3, #12] + 800b0ec: b29b uxth r3, r3 + 800b0ee: 4618 mov r0, r3 + 800b0f0: f7fa f94a bl 8005388 + 800b0f4: 4603 mov r3, r0 + 800b0f6: b2db uxtb r3, r3 + 800b0f8: f003 0307 and.w r3, r3, #7 + 800b0fc: 2b00 cmp r3, #0 + 800b0fe: d116 bne.n 800b12e + /* no SYN/FIN/RST flag in the header, we can add the FIN flag */ + TCPH_SET_FLAG(last_unsent->tcphdr, TCP_FIN); + 800b100: 68fb ldr r3, [r7, #12] + 800b102: 68db ldr r3, [r3, #12] + 800b104: 899b ldrh r3, [r3, #12] + 800b106: b29c uxth r4, r3 + 800b108: 2001 movs r0, #1 + 800b10a: f7fa f93d bl 8005388 + 800b10e: 4603 mov r3, r0 + 800b110: 461a mov r2, r3 + 800b112: 68fb ldr r3, [r7, #12] + 800b114: 68db ldr r3, [r3, #12] + 800b116: 4322 orrs r2, r4 + 800b118: b292 uxth r2, r2 + 800b11a: 819a strh r2, [r3, #12] + tcp_set_flags(pcb, TF_FIN); + 800b11c: 687b ldr r3, [r7, #4] + 800b11e: 8b5b ldrh r3, [r3, #26] + 800b120: f043 0320 orr.w r3, r3, #32 + 800b124: b29a uxth r2, r3 + 800b126: 687b ldr r3, [r7, #4] + 800b128: 835a strh r2, [r3, #26] + return ERR_OK; + 800b12a: 2300 movs r3, #0 + 800b12c: e004 b.n 800b138 + } + } + /* no data, no length, flags, copy=1, no optdata */ + return tcp_enqueue_flags(pcb, TCP_FIN); + 800b12e: 2101 movs r1, #1 + 800b130: 6878 ldr r0, [r7, #4] + 800b132: f000 f80b bl 800b14c + 800b136: 4603 mov r3, r0 +} + 800b138: 4618 mov r0, r3 + 800b13a: 3714 adds r7, #20 + 800b13c: 46bd mov sp, r7 + 800b13e: bd90 pop {r4, r7, pc} + 800b140: 0801769c .word 0x0801769c + 800b144: 08017aa4 .word 0x08017aa4 + 800b148: 080176f0 .word 0x080176f0 + +0800b14c : + * @param pcb Protocol control block for the TCP connection. + * @param flags TCP header flags to set in the outgoing segment. + */ +err_t +tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags) +{ + 800b14c: b580 push {r7, lr} + 800b14e: b08a sub sp, #40 @ 0x28 + 800b150: af02 add r7, sp, #8 + 800b152: 6078 str r0, [r7, #4] + 800b154: 460b mov r3, r1 + 800b156: 70fb strb r3, [r7, #3] + struct pbuf *p; + struct tcp_seg *seg; + u8_t optflags = 0; + 800b158: 2300 movs r3, #0 + 800b15a: 77fb strb r3, [r7, #31] + u8_t optlen = 0; + 800b15c: 2300 movs r3, #0 + 800b15e: 75fb strb r3, [r7, #23] + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue_flags: queuelen: %"U16_F"\n", (u16_t)pcb->snd_queuelen)); + + LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)", + 800b160: 78fb ldrb r3, [r7, #3] + 800b162: f003 0303 and.w r3, r3, #3 + 800b166: 2b00 cmp r3, #0 + 800b168: d106 bne.n 800b178 + 800b16a: 4b67 ldr r3, [pc, #412] @ (800b308 ) + 800b16c: f240 4211 movw r2, #1041 @ 0x411 + 800b170: 4966 ldr r1, [pc, #408] @ (800b30c ) + 800b172: 4867 ldr r0, [pc, #412] @ (800b310 ) + 800b174: f006 fa40 bl 80115f8 + (flags & (TCP_SYN | TCP_FIN)) != 0); + LWIP_ASSERT("tcp_enqueue_flags: invalid pcb", pcb != NULL); + 800b178: 687b ldr r3, [r7, #4] + 800b17a: 2b00 cmp r3, #0 + 800b17c: d106 bne.n 800b18c + 800b17e: 4b62 ldr r3, [pc, #392] @ (800b308 ) + 800b180: f240 4213 movw r2, #1043 @ 0x413 + 800b184: 4963 ldr r1, [pc, #396] @ (800b314 ) + 800b186: 4862 ldr r0, [pc, #392] @ (800b310 ) + 800b188: f006 fa36 bl 80115f8 + + /* No need to check pcb->snd_queuelen if only SYN or FIN are allowed! */ + + /* Get options for this segment. This is a special case since this is the + only place where a SYN can be sent. */ + if (flags & TCP_SYN) { + 800b18c: 78fb ldrb r3, [r7, #3] + 800b18e: f003 0302 and.w r3, r3, #2 + 800b192: 2b00 cmp r3, #0 + 800b194: d001 beq.n 800b19a + optflags = TF_SEG_OPTS_MSS; + 800b196: 2301 movs r3, #1 + 800b198: 77fb strb r3, [r7, #31] + /* Make sure the timestamp option is only included in data segments if we + agreed about it with the remote host (and in active open SYN segments). */ + optflags |= TF_SEG_OPTS_TS; + } +#endif /* LWIP_TCP_TIMESTAMPS */ + optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(optflags, pcb); + 800b19a: 7ffb ldrb r3, [r7, #31] + 800b19c: 009b lsls r3, r3, #2 + 800b19e: b2db uxtb r3, r3 + 800b1a0: f003 0304 and.w r3, r3, #4 + 800b1a4: 75fb strb r3, [r7, #23] + + /* Allocate pbuf with room for TCP header + options */ + if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) { + 800b1a6: 7dfb ldrb r3, [r7, #23] + 800b1a8: b29b uxth r3, r3 + 800b1aa: f44f 7220 mov.w r2, #640 @ 0x280 + 800b1ae: 4619 mov r1, r3 + 800b1b0: 2036 movs r0, #54 @ 0x36 + 800b1b2: f7fb f957 bl 8006464 + 800b1b6: 6138 str r0, [r7, #16] + 800b1b8: 693b ldr r3, [r7, #16] + 800b1ba: 2b00 cmp r3, #0 + 800b1bc: d109 bne.n 800b1d2 + tcp_set_flags(pcb, TF_NAGLEMEMERR); + 800b1be: 687b ldr r3, [r7, #4] + 800b1c0: 8b5b ldrh r3, [r3, #26] + 800b1c2: f043 0380 orr.w r3, r3, #128 @ 0x80 + 800b1c6: b29a uxth r2, r3 + 800b1c8: 687b ldr r3, [r7, #4] + 800b1ca: 835a strh r2, [r3, #26] + TCP_STATS_INC(tcp.memerr); + return ERR_MEM; + 800b1cc: f04f 33ff mov.w r3, #4294967295 + 800b1d0: e095 b.n 800b2fe + } + LWIP_ASSERT("tcp_enqueue_flags: check that first pbuf can hold optlen", + 800b1d2: 693b ldr r3, [r7, #16] + 800b1d4: 895a ldrh r2, [r3, #10] + 800b1d6: 7dfb ldrb r3, [r7, #23] + 800b1d8: b29b uxth r3, r3 + 800b1da: 429a cmp r2, r3 + 800b1dc: d206 bcs.n 800b1ec + 800b1de: 4b4a ldr r3, [pc, #296] @ (800b308 ) + 800b1e0: f240 4239 movw r2, #1081 @ 0x439 + 800b1e4: 494c ldr r1, [pc, #304] @ (800b318 ) + 800b1e6: 484a ldr r0, [pc, #296] @ (800b310 ) + 800b1e8: f006 fa06 bl 80115f8 + (p->len >= optlen)); + + /* Allocate memory for tcp_seg, and fill in fields. */ + if ((seg = tcp_create_segment(pcb, p, flags, pcb->snd_lbb, optflags)) == NULL) { + 800b1ec: 687b ldr r3, [r7, #4] + 800b1ee: 6dd9 ldr r1, [r3, #92] @ 0x5c + 800b1f0: 78fa ldrb r2, [r7, #3] + 800b1f2: 7ffb ldrb r3, [r7, #31] + 800b1f4: 9300 str r3, [sp, #0] + 800b1f6: 460b mov r3, r1 + 800b1f8: 6939 ldr r1, [r7, #16] + 800b1fa: 6878 ldr r0, [r7, #4] + 800b1fc: f7ff fd72 bl 800ace4 + 800b200: 60f8 str r0, [r7, #12] + 800b202: 68fb ldr r3, [r7, #12] + 800b204: 2b00 cmp r3, #0 + 800b206: d109 bne.n 800b21c + tcp_set_flags(pcb, TF_NAGLEMEMERR); + 800b208: 687b ldr r3, [r7, #4] + 800b20a: 8b5b ldrh r3, [r3, #26] + 800b20c: f043 0380 orr.w r3, r3, #128 @ 0x80 + 800b210: b29a uxth r2, r3 + 800b212: 687b ldr r3, [r7, #4] + 800b214: 835a strh r2, [r3, #26] + TCP_STATS_INC(tcp.memerr); + return ERR_MEM; + 800b216: f04f 33ff mov.w r3, #4294967295 + 800b21a: e070 b.n 800b2fe + } + LWIP_ASSERT("seg->tcphdr not aligned", ((mem_ptr_t)seg->tcphdr % LWIP_MIN(MEM_ALIGNMENT, 4)) == 0); + 800b21c: 68fb ldr r3, [r7, #12] + 800b21e: 68db ldr r3, [r3, #12] + 800b220: f003 0303 and.w r3, r3, #3 + 800b224: 2b00 cmp r3, #0 + 800b226: d006 beq.n 800b236 + 800b228: 4b37 ldr r3, [pc, #220] @ (800b308 ) + 800b22a: f240 4242 movw r2, #1090 @ 0x442 + 800b22e: 493b ldr r1, [pc, #236] @ (800b31c ) + 800b230: 4837 ldr r0, [pc, #220] @ (800b310 ) + 800b232: f006 f9e1 bl 80115f8 + LWIP_ASSERT("tcp_enqueue_flags: invalid segment length", seg->len == 0); + 800b236: 68fb ldr r3, [r7, #12] + 800b238: 891b ldrh r3, [r3, #8] + 800b23a: 2b00 cmp r3, #0 + 800b23c: d006 beq.n 800b24c + 800b23e: 4b32 ldr r3, [pc, #200] @ (800b308 ) + 800b240: f240 4243 movw r2, #1091 @ 0x443 + 800b244: 4936 ldr r1, [pc, #216] @ (800b320 ) + 800b246: 4832 ldr r0, [pc, #200] @ (800b310 ) + 800b248: f006 f9d6 bl 80115f8 + lwip_ntohl(seg->tcphdr->seqno), + lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg), + (u16_t)flags)); + + /* Now append seg to pcb->unsent queue */ + if (pcb->unsent == NULL) { + 800b24c: 687b ldr r3, [r7, #4] + 800b24e: 6edb ldr r3, [r3, #108] @ 0x6c + 800b250: 2b00 cmp r3, #0 + 800b252: d103 bne.n 800b25c + pcb->unsent = seg; + 800b254: 687b ldr r3, [r7, #4] + 800b256: 68fa ldr r2, [r7, #12] + 800b258: 66da str r2, [r3, #108] @ 0x6c + 800b25a: e00d b.n 800b278 + } else { + struct tcp_seg *useg; + for (useg = pcb->unsent; useg->next != NULL; useg = useg->next); + 800b25c: 687b ldr r3, [r7, #4] + 800b25e: 6edb ldr r3, [r3, #108] @ 0x6c + 800b260: 61bb str r3, [r7, #24] + 800b262: e002 b.n 800b26a + 800b264: 69bb ldr r3, [r7, #24] + 800b266: 681b ldr r3, [r3, #0] + 800b268: 61bb str r3, [r7, #24] + 800b26a: 69bb ldr r3, [r7, #24] + 800b26c: 681b ldr r3, [r3, #0] + 800b26e: 2b00 cmp r3, #0 + 800b270: d1f8 bne.n 800b264 + useg->next = seg; + 800b272: 69bb ldr r3, [r7, #24] + 800b274: 68fa ldr r2, [r7, #12] + 800b276: 601a str r2, [r3, #0] + } +#if TCP_OVERSIZE + /* The new unsent tail has no space */ + pcb->unsent_oversize = 0; + 800b278: 687b ldr r3, [r7, #4] + 800b27a: 2200 movs r2, #0 + 800b27c: f8a3 2068 strh.w r2, [r3, #104] @ 0x68 +#endif /* TCP_OVERSIZE */ + + /* SYN and FIN bump the sequence number */ + if ((flags & TCP_SYN) || (flags & TCP_FIN)) { + 800b280: 78fb ldrb r3, [r7, #3] + 800b282: f003 0302 and.w r3, r3, #2 + 800b286: 2b00 cmp r3, #0 + 800b288: d104 bne.n 800b294 + 800b28a: 78fb ldrb r3, [r7, #3] + 800b28c: f003 0301 and.w r3, r3, #1 + 800b290: 2b00 cmp r3, #0 + 800b292: d004 beq.n 800b29e + pcb->snd_lbb++; + 800b294: 687b ldr r3, [r7, #4] + 800b296: 6ddb ldr r3, [r3, #92] @ 0x5c + 800b298: 1c5a adds r2, r3, #1 + 800b29a: 687b ldr r3, [r7, #4] + 800b29c: 65da str r2, [r3, #92] @ 0x5c + /* optlen does not influence snd_buf */ + } + if (flags & TCP_FIN) { + 800b29e: 78fb ldrb r3, [r7, #3] + 800b2a0: f003 0301 and.w r3, r3, #1 + 800b2a4: 2b00 cmp r3, #0 + 800b2a6: d006 beq.n 800b2b6 + tcp_set_flags(pcb, TF_FIN); + 800b2a8: 687b ldr r3, [r7, #4] + 800b2aa: 8b5b ldrh r3, [r3, #26] + 800b2ac: f043 0320 orr.w r3, r3, #32 + 800b2b0: b29a uxth r2, r3 + 800b2b2: 687b ldr r3, [r7, #4] + 800b2b4: 835a strh r2, [r3, #26] + } + + /* update number of segments on the queues */ + pcb->snd_queuelen += pbuf_clen(seg->p); + 800b2b6: 68fb ldr r3, [r7, #12] + 800b2b8: 685b ldr r3, [r3, #4] + 800b2ba: 4618 mov r0, r3 + 800b2bc: f7fb fc3c bl 8006b38 + 800b2c0: 4603 mov r3, r0 + 800b2c2: 461a mov r2, r3 + 800b2c4: 687b ldr r3, [r7, #4] + 800b2c6: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800b2ca: 4413 add r3, r2 + 800b2cc: b29a uxth r2, r3 + 800b2ce: 687b ldr r3, [r7, #4] + 800b2d0: f8a3 2066 strh.w r2, [r3, #102] @ 0x66 + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue_flags: %"S16_F" (after enqueued)\n", pcb->snd_queuelen)); + if (pcb->snd_queuelen != 0) { + 800b2d4: 687b ldr r3, [r7, #4] + 800b2d6: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800b2da: 2b00 cmp r3, #0 + 800b2dc: d00e beq.n 800b2fc + LWIP_ASSERT("tcp_enqueue_flags: invalid queue length", + 800b2de: 687b ldr r3, [r7, #4] + 800b2e0: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b2e2: 2b00 cmp r3, #0 + 800b2e4: d10a bne.n 800b2fc + 800b2e6: 687b ldr r3, [r7, #4] + 800b2e8: 6edb ldr r3, [r3, #108] @ 0x6c + 800b2ea: 2b00 cmp r3, #0 + 800b2ec: d106 bne.n 800b2fc + 800b2ee: 4b06 ldr r3, [pc, #24] @ (800b308 ) + 800b2f0: f240 4265 movw r2, #1125 @ 0x465 + 800b2f4: 490b ldr r1, [pc, #44] @ (800b324 ) + 800b2f6: 4806 ldr r0, [pc, #24] @ (800b310 ) + 800b2f8: f006 f97e bl 80115f8 + pcb->unacked != NULL || pcb->unsent != NULL); + } + + return ERR_OK; + 800b2fc: 2300 movs r3, #0 +} + 800b2fe: 4618 mov r0, r3 + 800b300: 3720 adds r7, #32 + 800b302: 46bd mov sp, r7 + 800b304: bd80 pop {r7, pc} + 800b306: bf00 nop + 800b308: 0801769c .word 0x0801769c + 800b30c: 08017ac0 .word 0x08017ac0 + 800b310: 080176f0 .word 0x080176f0 + 800b314: 08017b18 .word 0x08017b18 + 800b318: 08017b38 .word 0x08017b38 + 800b31c: 08017b74 .word 0x08017b74 + 800b320: 08017b8c .word 0x08017b8c + 800b324: 08017bb8 .word 0x08017bb8 + +0800b328 : + * @return ERR_OK if data has been sent or nothing to send + * another err_t on error + */ +err_t +tcp_output(struct tcp_pcb *pcb) +{ + 800b328: b5b0 push {r4, r5, r7, lr} + 800b32a: b08a sub sp, #40 @ 0x28 + 800b32c: af00 add r7, sp, #0 + 800b32e: 6078 str r0, [r7, #4] + s16_t i = 0; +#endif /* TCP_CWND_DEBUG */ + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ASSERT("tcp_output: invalid pcb", pcb != NULL); + 800b330: 687b ldr r3, [r7, #4] + 800b332: 2b00 cmp r3, #0 + 800b334: d106 bne.n 800b344 + 800b336: 4b8a ldr r3, [pc, #552] @ (800b560 ) + 800b338: f240 42e1 movw r2, #1249 @ 0x4e1 + 800b33c: 4989 ldr r1, [pc, #548] @ (800b564 ) + 800b33e: 488a ldr r0, [pc, #552] @ (800b568 ) + 800b340: f006 f95a bl 80115f8 + /* pcb->state LISTEN not allowed here */ + LWIP_ASSERT("don't call tcp_output for listen-pcbs", + 800b344: 687b ldr r3, [r7, #4] + 800b346: 7d1b ldrb r3, [r3, #20] + 800b348: 2b01 cmp r3, #1 + 800b34a: d106 bne.n 800b35a + 800b34c: 4b84 ldr r3, [pc, #528] @ (800b560 ) + 800b34e: f240 42e3 movw r2, #1251 @ 0x4e3 + 800b352: 4986 ldr r1, [pc, #536] @ (800b56c ) + 800b354: 4884 ldr r0, [pc, #528] @ (800b568 ) + 800b356: f006 f94f bl 80115f8 + + /* First, check if we are invoked by the TCP input processing + code. If so, we do not output anything. Instead, we rely on the + input processing code to call us when input processing is done + with. */ + if (tcp_input_pcb == pcb) { + 800b35a: 4b85 ldr r3, [pc, #532] @ (800b570 ) + 800b35c: 681b ldr r3, [r3, #0] + 800b35e: 687a ldr r2, [r7, #4] + 800b360: 429a cmp r2, r3 + 800b362: d101 bne.n 800b368 + return ERR_OK; + 800b364: 2300 movs r3, #0 + 800b366: e1ce b.n 800b706 + } + + wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd); + 800b368: 687b ldr r3, [r7, #4] + 800b36a: f8b3 2048 ldrh.w r2, [r3, #72] @ 0x48 + 800b36e: 687b ldr r3, [r7, #4] + 800b370: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 800b374: 4293 cmp r3, r2 + 800b376: bf28 it cs + 800b378: 4613 movcs r3, r2 + 800b37a: b29b uxth r3, r3 + 800b37c: 61bb str r3, [r7, #24] + + seg = pcb->unsent; + 800b37e: 687b ldr r3, [r7, #4] + 800b380: 6edb ldr r3, [r3, #108] @ 0x6c + 800b382: 627b str r3, [r7, #36] @ 0x24 + + if (seg == NULL) { + 800b384: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b386: 2b00 cmp r3, #0 + 800b388: d10b bne.n 800b3a2 + ", seg == NULL, ack %"U32_F"\n", + pcb->snd_wnd, pcb->cwnd, wnd, pcb->lastack)); + + /* If the TF_ACK_NOW flag is set and the ->unsent queue is empty, construct + * an empty ACK segment and send it. */ + if (pcb->flags & TF_ACK_NOW) { + 800b38a: 687b ldr r3, [r7, #4] + 800b38c: 8b5b ldrh r3, [r3, #26] + 800b38e: f003 0302 and.w r3, r3, #2 + 800b392: 2b00 cmp r3, #0 + 800b394: f000 81aa beq.w 800b6ec + return tcp_send_empty_ack(pcb); + 800b398: 6878 ldr r0, [r7, #4] + 800b39a: f000 fdcb bl 800bf34 + 800b39e: 4603 mov r3, r0 + 800b3a0: e1b1 b.n 800b706 + pcb->snd_wnd, pcb->cwnd, wnd, + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len, + lwip_ntohl(seg->tcphdr->seqno), pcb->lastack)); + } + + netif = tcp_route(pcb, &pcb->local_ip, &pcb->remote_ip); + 800b3a2: 6879 ldr r1, [r7, #4] + 800b3a4: 687b ldr r3, [r7, #4] + 800b3a6: 3304 adds r3, #4 + 800b3a8: 461a mov r2, r3 + 800b3aa: 6878 ldr r0, [r7, #4] + 800b3ac: f7ff fc7e bl 800acac + 800b3b0: 6178 str r0, [r7, #20] + if (netif == NULL) { + 800b3b2: 697b ldr r3, [r7, #20] + 800b3b4: 2b00 cmp r3, #0 + 800b3b6: d102 bne.n 800b3be + return ERR_RTE; + 800b3b8: f06f 0303 mvn.w r3, #3 + 800b3bc: e1a3 b.n 800b706 + } + + /* If we don't have a local IP address, we get one from netif */ + if (ip_addr_isany(&pcb->local_ip)) { + 800b3be: 687b ldr r3, [r7, #4] + 800b3c0: 2b00 cmp r3, #0 + 800b3c2: d003 beq.n 800b3cc + 800b3c4: 687b ldr r3, [r7, #4] + 800b3c6: 681b ldr r3, [r3, #0] + 800b3c8: 2b00 cmp r3, #0 + 800b3ca: d111 bne.n 800b3f0 + const ip_addr_t *local_ip = ip_netif_get_local_ip(netif, &pcb->remote_ip); + 800b3cc: 697b ldr r3, [r7, #20] + 800b3ce: 2b00 cmp r3, #0 + 800b3d0: d002 beq.n 800b3d8 + 800b3d2: 697b ldr r3, [r7, #20] + 800b3d4: 3304 adds r3, #4 + 800b3d6: e000 b.n 800b3da + 800b3d8: 2300 movs r3, #0 + 800b3da: 613b str r3, [r7, #16] + if (local_ip == NULL) { + 800b3dc: 693b ldr r3, [r7, #16] + 800b3de: 2b00 cmp r3, #0 + 800b3e0: d102 bne.n 800b3e8 + return ERR_RTE; + 800b3e2: f06f 0303 mvn.w r3, #3 + 800b3e6: e18e b.n 800b706 + } + ip_addr_copy(pcb->local_ip, *local_ip); + 800b3e8: 693b ldr r3, [r7, #16] + 800b3ea: 681a ldr r2, [r3, #0] + 800b3ec: 687b ldr r3, [r7, #4] + 800b3ee: 601a str r2, [r3, #0] + } + + /* Handle the current segment not fitting within the window */ + if (lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd) { + 800b3f0: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b3f2: 68db ldr r3, [r3, #12] + 800b3f4: 685b ldr r3, [r3, #4] + 800b3f6: 4618 mov r0, r3 + 800b3f8: f7f9 ffdb bl 80053b2 + 800b3fc: 4602 mov r2, r0 + 800b3fe: 687b ldr r3, [r7, #4] + 800b400: 6c5b ldr r3, [r3, #68] @ 0x44 + 800b402: 1ad3 subs r3, r2, r3 + 800b404: 6a7a ldr r2, [r7, #36] @ 0x24 + 800b406: 8912 ldrh r2, [r2, #8] + 800b408: 4413 add r3, r2 + 800b40a: 69ba ldr r2, [r7, #24] + 800b40c: 429a cmp r2, r3 + 800b40e: d227 bcs.n 800b460 + * within the remaining (could be 0) send window and RTO timer is not running (we + * have no in-flight data). If window is still too small after persist timer fires, + * then we split the segment. We don't consider the congestion window since a cwnd + * smaller than 1 SMSS implies in-flight data + */ + if (wnd == pcb->snd_wnd && pcb->unacked == NULL && pcb->persist_backoff == 0) { + 800b410: 687b ldr r3, [r7, #4] + 800b412: f8b3 3060 ldrh.w r3, [r3, #96] @ 0x60 + 800b416: 461a mov r2, r3 + 800b418: 69bb ldr r3, [r7, #24] + 800b41a: 4293 cmp r3, r2 + 800b41c: d114 bne.n 800b448 + 800b41e: 687b ldr r3, [r7, #4] + 800b420: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b422: 2b00 cmp r3, #0 + 800b424: d110 bne.n 800b448 + 800b426: 687b ldr r3, [r7, #4] + 800b428: f893 3099 ldrb.w r3, [r3, #153] @ 0x99 + 800b42c: 2b00 cmp r3, #0 + 800b42e: d10b bne.n 800b448 + pcb->persist_cnt = 0; + 800b430: 687b ldr r3, [r7, #4] + 800b432: 2200 movs r2, #0 + 800b434: f883 2098 strb.w r2, [r3, #152] @ 0x98 + pcb->persist_backoff = 1; + 800b438: 687b ldr r3, [r7, #4] + 800b43a: 2201 movs r2, #1 + 800b43c: f883 2099 strb.w r2, [r3, #153] @ 0x99 + pcb->persist_probe = 0; + 800b440: 687b ldr r3, [r7, #4] + 800b442: 2200 movs r2, #0 + 800b444: f883 209a strb.w r2, [r3, #154] @ 0x9a + } + /* We need an ACK, but can't send data now, so send an empty ACK */ + if (pcb->flags & TF_ACK_NOW) { + 800b448: 687b ldr r3, [r7, #4] + 800b44a: 8b5b ldrh r3, [r3, #26] + 800b44c: f003 0302 and.w r3, r3, #2 + 800b450: 2b00 cmp r3, #0 + 800b452: f000 814d beq.w 800b6f0 + return tcp_send_empty_ack(pcb); + 800b456: 6878 ldr r0, [r7, #4] + 800b458: f000 fd6c bl 800bf34 + 800b45c: 4603 mov r3, r0 + 800b45e: e152 b.n 800b706 + } + goto output_done; + } + /* Stop persist timer, above conditions are not active */ + pcb->persist_backoff = 0; + 800b460: 687b ldr r3, [r7, #4] + 800b462: 2200 movs r2, #0 + 800b464: f883 2099 strb.w r2, [r3, #153] @ 0x99 + + /* useg should point to last segment on unacked queue */ + useg = pcb->unacked; + 800b468: 687b ldr r3, [r7, #4] + 800b46a: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b46c: 623b str r3, [r7, #32] + if (useg != NULL) { + 800b46e: 6a3b ldr r3, [r7, #32] + 800b470: 2b00 cmp r3, #0 + 800b472: f000 811c beq.w 800b6ae + for (; useg->next != NULL; useg = useg->next); + 800b476: e002 b.n 800b47e + 800b478: 6a3b ldr r3, [r7, #32] + 800b47a: 681b ldr r3, [r3, #0] + 800b47c: 623b str r3, [r7, #32] + 800b47e: 6a3b ldr r3, [r7, #32] + 800b480: 681b ldr r3, [r3, #0] + 800b482: 2b00 cmp r3, #0 + 800b484: d1f8 bne.n 800b478 + } + /* data available and window allows it to be sent? */ + while (seg != NULL && + 800b486: e112 b.n 800b6ae + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) { + LWIP_ASSERT("RST not expected here!", + 800b488: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b48a: 68db ldr r3, [r3, #12] + 800b48c: 899b ldrh r3, [r3, #12] + 800b48e: b29b uxth r3, r3 + 800b490: 4618 mov r0, r3 + 800b492: f7f9 ff79 bl 8005388 + 800b496: 4603 mov r3, r0 + 800b498: b2db uxtb r3, r3 + 800b49a: f003 0304 and.w r3, r3, #4 + 800b49e: 2b00 cmp r3, #0 + 800b4a0: d006 beq.n 800b4b0 + 800b4a2: 4b2f ldr r3, [pc, #188] @ (800b560 ) + 800b4a4: f240 5236 movw r2, #1334 @ 0x536 + 800b4a8: 4932 ldr r1, [pc, #200] @ (800b574 ) + 800b4aa: 482f ldr r0, [pc, #188] @ (800b568 ) + 800b4ac: f006 f8a4 bl 80115f8 + * - if tcp_write had a memory error before (prevent delayed ACK timeout) or + * - if FIN was already enqueued for this PCB (SYN is always alone in a segment - + * either seg->next != NULL or pcb->unacked == NULL; + * RST is no sent using tcp_write/tcp_output. + */ + if ((tcp_do_output_nagle(pcb) == 0) && + 800b4b0: 687b ldr r3, [r7, #4] + 800b4b2: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b4b4: 2b00 cmp r3, #0 + 800b4b6: d01f beq.n 800b4f8 + 800b4b8: 687b ldr r3, [r7, #4] + 800b4ba: 8b5b ldrh r3, [r3, #26] + 800b4bc: f003 0344 and.w r3, r3, #68 @ 0x44 + 800b4c0: 2b00 cmp r3, #0 + 800b4c2: d119 bne.n 800b4f8 + 800b4c4: 687b ldr r3, [r7, #4] + 800b4c6: 6edb ldr r3, [r3, #108] @ 0x6c + 800b4c8: 2b00 cmp r3, #0 + 800b4ca: d00b beq.n 800b4e4 + 800b4cc: 687b ldr r3, [r7, #4] + 800b4ce: 6edb ldr r3, [r3, #108] @ 0x6c + 800b4d0: 681b ldr r3, [r3, #0] + 800b4d2: 2b00 cmp r3, #0 + 800b4d4: d110 bne.n 800b4f8 + 800b4d6: 687b ldr r3, [r7, #4] + 800b4d8: 6edb ldr r3, [r3, #108] @ 0x6c + 800b4da: 891a ldrh r2, [r3, #8] + 800b4dc: 687b ldr r3, [r7, #4] + 800b4de: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800b4e0: 429a cmp r2, r3 + 800b4e2: d209 bcs.n 800b4f8 + 800b4e4: 687b ldr r3, [r7, #4] + 800b4e6: f8b3 3064 ldrh.w r3, [r3, #100] @ 0x64 + 800b4ea: 2b00 cmp r3, #0 + 800b4ec: d004 beq.n 800b4f8 + 800b4ee: 687b ldr r3, [r7, #4] + 800b4f0: f8b3 3066 ldrh.w r3, [r3, #102] @ 0x66 + 800b4f4: 2b08 cmp r3, #8 + 800b4f6: d901 bls.n 800b4fc + 800b4f8: 2301 movs r3, #1 + 800b4fa: e000 b.n 800b4fe + 800b4fc: 2300 movs r3, #0 + 800b4fe: 2b00 cmp r3, #0 + 800b500: d106 bne.n 800b510 + ((pcb->flags & (TF_NAGLEMEMERR | TF_FIN)) == 0)) { + 800b502: 687b ldr r3, [r7, #4] + 800b504: 8b5b ldrh r3, [r3, #26] + 800b506: f003 03a0 and.w r3, r3, #160 @ 0xa0 + if ((tcp_do_output_nagle(pcb) == 0) && + 800b50a: 2b00 cmp r3, #0 + 800b50c: f000 80e4 beq.w 800b6d8 + pcb->lastack, + lwip_ntohl(seg->tcphdr->seqno), pcb->lastack, i)); + ++i; +#endif /* TCP_CWND_DEBUG */ + + if (pcb->state != SYN_SENT) { + 800b510: 687b ldr r3, [r7, #4] + 800b512: 7d1b ldrb r3, [r3, #20] + 800b514: 2b02 cmp r3, #2 + 800b516: d00d beq.n 800b534 + TCPH_SET_FLAG(seg->tcphdr, TCP_ACK); + 800b518: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b51a: 68db ldr r3, [r3, #12] + 800b51c: 899b ldrh r3, [r3, #12] + 800b51e: b29c uxth r4, r3 + 800b520: 2010 movs r0, #16 + 800b522: f7f9 ff31 bl 8005388 + 800b526: 4603 mov r3, r0 + 800b528: 461a mov r2, r3 + 800b52a: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b52c: 68db ldr r3, [r3, #12] + 800b52e: 4322 orrs r2, r4 + 800b530: b292 uxth r2, r2 + 800b532: 819a strh r2, [r3, #12] + } + + err = tcp_output_segment(seg, pcb, netif); + 800b534: 697a ldr r2, [r7, #20] + 800b536: 6879 ldr r1, [r7, #4] + 800b538: 6a78 ldr r0, [r7, #36] @ 0x24 + 800b53a: f000 f909 bl 800b750 + 800b53e: 4603 mov r3, r0 + 800b540: 73fb strb r3, [r7, #15] + if (err != ERR_OK) { + 800b542: f997 300f ldrsb.w r3, [r7, #15] + 800b546: 2b00 cmp r3, #0 + 800b548: d016 beq.n 800b578 + /* segment could not be sent, for whatever reason */ + tcp_set_flags(pcb, TF_NAGLEMEMERR); + 800b54a: 687b ldr r3, [r7, #4] + 800b54c: 8b5b ldrh r3, [r3, #26] + 800b54e: f043 0380 orr.w r3, r3, #128 @ 0x80 + 800b552: b29a uxth r2, r3 + 800b554: 687b ldr r3, [r7, #4] + 800b556: 835a strh r2, [r3, #26] + return err; + 800b558: f997 300f ldrsb.w r3, [r7, #15] + 800b55c: e0d3 b.n 800b706 + 800b55e: bf00 nop + 800b560: 0801769c .word 0x0801769c + 800b564: 08017be0 .word 0x08017be0 + 800b568: 080176f0 .word 0x080176f0 + 800b56c: 08017bf8 .word 0x08017bf8 + 800b570: 200190f0 .word 0x200190f0 + 800b574: 08017c20 .word 0x08017c20 + } +#if TCP_OVERSIZE_DBGCHECK + seg->oversize_left = 0; +#endif /* TCP_OVERSIZE_DBGCHECK */ + pcb->unsent = seg->next; + 800b578: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b57a: 681a ldr r2, [r3, #0] + 800b57c: 687b ldr r3, [r7, #4] + 800b57e: 66da str r2, [r3, #108] @ 0x6c + if (pcb->state != SYN_SENT) { + 800b580: 687b ldr r3, [r7, #4] + 800b582: 7d1b ldrb r3, [r3, #20] + 800b584: 2b02 cmp r3, #2 + 800b586: d006 beq.n 800b596 + tcp_clear_flags(pcb, TF_ACK_DELAY | TF_ACK_NOW); + 800b588: 687b ldr r3, [r7, #4] + 800b58a: 8b5b ldrh r3, [r3, #26] + 800b58c: f023 0303 bic.w r3, r3, #3 + 800b590: b29a uxth r2, r3 + 800b592: 687b ldr r3, [r7, #4] + 800b594: 835a strh r2, [r3, #26] + } + snd_nxt = lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg); + 800b596: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b598: 68db ldr r3, [r3, #12] + 800b59a: 685b ldr r3, [r3, #4] + 800b59c: 4618 mov r0, r3 + 800b59e: f7f9 ff08 bl 80053b2 + 800b5a2: 4604 mov r4, r0 + 800b5a4: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b5a6: 891b ldrh r3, [r3, #8] + 800b5a8: 461d mov r5, r3 + 800b5aa: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b5ac: 68db ldr r3, [r3, #12] + 800b5ae: 899b ldrh r3, [r3, #12] + 800b5b0: b29b uxth r3, r3 + 800b5b2: 4618 mov r0, r3 + 800b5b4: f7f9 fee8 bl 8005388 + 800b5b8: 4603 mov r3, r0 + 800b5ba: b2db uxtb r3, r3 + 800b5bc: f003 0303 and.w r3, r3, #3 + 800b5c0: 2b00 cmp r3, #0 + 800b5c2: d001 beq.n 800b5c8 + 800b5c4: 2301 movs r3, #1 + 800b5c6: e000 b.n 800b5ca + 800b5c8: 2300 movs r3, #0 + 800b5ca: 442b add r3, r5 + 800b5cc: 4423 add r3, r4 + 800b5ce: 60bb str r3, [r7, #8] + if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) { + 800b5d0: 687b ldr r3, [r7, #4] + 800b5d2: 6d1a ldr r2, [r3, #80] @ 0x50 + 800b5d4: 68bb ldr r3, [r7, #8] + 800b5d6: 1ad3 subs r3, r2, r3 + 800b5d8: 2b00 cmp r3, #0 + 800b5da: da02 bge.n 800b5e2 + pcb->snd_nxt = snd_nxt; + 800b5dc: 687b ldr r3, [r7, #4] + 800b5de: 68ba ldr r2, [r7, #8] + 800b5e0: 651a str r2, [r3, #80] @ 0x50 + } + /* put segment on unacknowledged list if length > 0 */ + if (TCP_TCPLEN(seg) > 0) { + 800b5e2: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b5e4: 891b ldrh r3, [r3, #8] + 800b5e6: 461c mov r4, r3 + 800b5e8: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b5ea: 68db ldr r3, [r3, #12] + 800b5ec: 899b ldrh r3, [r3, #12] + 800b5ee: b29b uxth r3, r3 + 800b5f0: 4618 mov r0, r3 + 800b5f2: f7f9 fec9 bl 8005388 + 800b5f6: 4603 mov r3, r0 + 800b5f8: b2db uxtb r3, r3 + 800b5fa: f003 0303 and.w r3, r3, #3 + 800b5fe: 2b00 cmp r3, #0 + 800b600: d001 beq.n 800b606 + 800b602: 2301 movs r3, #1 + 800b604: e000 b.n 800b608 + 800b606: 2300 movs r3, #0 + 800b608: 4423 add r3, r4 + 800b60a: 2b00 cmp r3, #0 + 800b60c: d049 beq.n 800b6a2 + seg->next = NULL; + 800b60e: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b610: 2200 movs r2, #0 + 800b612: 601a str r2, [r3, #0] + /* unacked list is empty? */ + if (pcb->unacked == NULL) { + 800b614: 687b ldr r3, [r7, #4] + 800b616: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b618: 2b00 cmp r3, #0 + 800b61a: d105 bne.n 800b628 + pcb->unacked = seg; + 800b61c: 687b ldr r3, [r7, #4] + 800b61e: 6a7a ldr r2, [r7, #36] @ 0x24 + 800b620: 671a str r2, [r3, #112] @ 0x70 + useg = seg; + 800b622: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b624: 623b str r3, [r7, #32] + 800b626: e03f b.n 800b6a8 + /* unacked list is not empty? */ + } else { + /* In the case of fast retransmit, the packet should not go to the tail + * of the unacked queue, but rather somewhere before it. We need to check for + * this case. -STJ Jul 27, 2004 */ + if (TCP_SEQ_LT(lwip_ntohl(seg->tcphdr->seqno), lwip_ntohl(useg->tcphdr->seqno))) { + 800b628: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b62a: 68db ldr r3, [r3, #12] + 800b62c: 685b ldr r3, [r3, #4] + 800b62e: 4618 mov r0, r3 + 800b630: f7f9 febf bl 80053b2 + 800b634: 4604 mov r4, r0 + 800b636: 6a3b ldr r3, [r7, #32] + 800b638: 68db ldr r3, [r3, #12] + 800b63a: 685b ldr r3, [r3, #4] + 800b63c: 4618 mov r0, r3 + 800b63e: f7f9 feb8 bl 80053b2 + 800b642: 4603 mov r3, r0 + 800b644: 1ae3 subs r3, r4, r3 + 800b646: 2b00 cmp r3, #0 + 800b648: da24 bge.n 800b694 + /* add segment to before tail of unacked list, keeping the list sorted */ + struct tcp_seg **cur_seg = &(pcb->unacked); + 800b64a: 687b ldr r3, [r7, #4] + 800b64c: 3370 adds r3, #112 @ 0x70 + 800b64e: 61fb str r3, [r7, #28] + while (*cur_seg && + 800b650: e002 b.n 800b658 + TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) { + cur_seg = &((*cur_seg)->next ); + 800b652: 69fb ldr r3, [r7, #28] + 800b654: 681b ldr r3, [r3, #0] + 800b656: 61fb str r3, [r7, #28] + while (*cur_seg && + 800b658: 69fb ldr r3, [r7, #28] + 800b65a: 681b ldr r3, [r3, #0] + 800b65c: 2b00 cmp r3, #0 + 800b65e: d011 beq.n 800b684 + TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) { + 800b660: 69fb ldr r3, [r7, #28] + 800b662: 681b ldr r3, [r3, #0] + 800b664: 68db ldr r3, [r3, #12] + 800b666: 685b ldr r3, [r3, #4] + 800b668: 4618 mov r0, r3 + 800b66a: f7f9 fea2 bl 80053b2 + 800b66e: 4604 mov r4, r0 + 800b670: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b672: 68db ldr r3, [r3, #12] + 800b674: 685b ldr r3, [r3, #4] + 800b676: 4618 mov r0, r3 + 800b678: f7f9 fe9b bl 80053b2 + 800b67c: 4603 mov r3, r0 + 800b67e: 1ae3 subs r3, r4, r3 + while (*cur_seg && + 800b680: 2b00 cmp r3, #0 + 800b682: dbe6 blt.n 800b652 + } + seg->next = (*cur_seg); + 800b684: 69fb ldr r3, [r7, #28] + 800b686: 681a ldr r2, [r3, #0] + 800b688: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b68a: 601a str r2, [r3, #0] + (*cur_seg) = seg; + 800b68c: 69fb ldr r3, [r7, #28] + 800b68e: 6a7a ldr r2, [r7, #36] @ 0x24 + 800b690: 601a str r2, [r3, #0] + 800b692: e009 b.n 800b6a8 + } else { + /* add segment to tail of unacked list */ + useg->next = seg; + 800b694: 6a3b ldr r3, [r7, #32] + 800b696: 6a7a ldr r2, [r7, #36] @ 0x24 + 800b698: 601a str r2, [r3, #0] + useg = useg->next; + 800b69a: 6a3b ldr r3, [r7, #32] + 800b69c: 681b ldr r3, [r3, #0] + 800b69e: 623b str r3, [r7, #32] + 800b6a0: e002 b.n 800b6a8 + } + } + /* do not queue empty segments on the unacked list */ + } else { + tcp_seg_free(seg); + 800b6a2: 6a78 ldr r0, [r7, #36] @ 0x24 + 800b6a4: f7fc fc45 bl 8007f32 + } + seg = pcb->unsent; + 800b6a8: 687b ldr r3, [r7, #4] + 800b6aa: 6edb ldr r3, [r3, #108] @ 0x6c + 800b6ac: 627b str r3, [r7, #36] @ 0x24 + while (seg != NULL && + 800b6ae: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b6b0: 2b00 cmp r3, #0 + 800b6b2: d012 beq.n 800b6da + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) { + 800b6b4: 6a7b ldr r3, [r7, #36] @ 0x24 + 800b6b6: 68db ldr r3, [r3, #12] + 800b6b8: 685b ldr r3, [r3, #4] + 800b6ba: 4618 mov r0, r3 + 800b6bc: f7f9 fe79 bl 80053b2 + 800b6c0: 4602 mov r2, r0 + 800b6c2: 687b ldr r3, [r7, #4] + 800b6c4: 6c5b ldr r3, [r3, #68] @ 0x44 + 800b6c6: 1ad3 subs r3, r2, r3 + 800b6c8: 6a7a ldr r2, [r7, #36] @ 0x24 + 800b6ca: 8912 ldrh r2, [r2, #8] + 800b6cc: 4413 add r3, r2 + while (seg != NULL && + 800b6ce: 69ba ldr r2, [r7, #24] + 800b6d0: 429a cmp r2, r3 + 800b6d2: f4bf aed9 bcs.w 800b488 + 800b6d6: e000 b.n 800b6da + break; + 800b6d8: bf00 nop + } +#if TCP_OVERSIZE + if (pcb->unsent == NULL) { + 800b6da: 687b ldr r3, [r7, #4] + 800b6dc: 6edb ldr r3, [r3, #108] @ 0x6c + 800b6de: 2b00 cmp r3, #0 + 800b6e0: d108 bne.n 800b6f4 + /* last unsent has been removed, reset unsent_oversize */ + pcb->unsent_oversize = 0; + 800b6e2: 687b ldr r3, [r7, #4] + 800b6e4: 2200 movs r2, #0 + 800b6e6: f8a3 2068 strh.w r2, [r3, #104] @ 0x68 + 800b6ea: e004 b.n 800b6f6 + goto output_done; + 800b6ec: bf00 nop + 800b6ee: e002 b.n 800b6f6 + goto output_done; + 800b6f0: bf00 nop + 800b6f2: e000 b.n 800b6f6 + } +#endif /* TCP_OVERSIZE */ + +output_done: + 800b6f4: bf00 nop + tcp_clear_flags(pcb, TF_NAGLEMEMERR); + 800b6f6: 687b ldr r3, [r7, #4] + 800b6f8: 8b5b ldrh r3, [r3, #26] + 800b6fa: f023 0380 bic.w r3, r3, #128 @ 0x80 + 800b6fe: b29a uxth r2, r3 + 800b700: 687b ldr r3, [r7, #4] + 800b702: 835a strh r2, [r3, #26] + return ERR_OK; + 800b704: 2300 movs r3, #0 +} + 800b706: 4618 mov r0, r3 + 800b708: 3728 adds r7, #40 @ 0x28 + 800b70a: 46bd mov sp, r7 + 800b70c: bdb0 pop {r4, r5, r7, pc} + 800b70e: bf00 nop + +0800b710 : + * @arg seg the tcp segment to check + * @return 1 if ref != 1, 0 if ref == 1 + */ +static int +tcp_output_segment_busy(const struct tcp_seg *seg) +{ + 800b710: b580 push {r7, lr} + 800b712: b082 sub sp, #8 + 800b714: af00 add r7, sp, #0 + 800b716: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_output_segment_busy: invalid seg", seg != NULL); + 800b718: 687b ldr r3, [r7, #4] + 800b71a: 2b00 cmp r3, #0 + 800b71c: d106 bne.n 800b72c + 800b71e: 4b09 ldr r3, [pc, #36] @ (800b744 ) + 800b720: f240 529a movw r2, #1434 @ 0x59a + 800b724: 4908 ldr r1, [pc, #32] @ (800b748 ) + 800b726: 4809 ldr r0, [pc, #36] @ (800b74c ) + 800b728: f005 ff66 bl 80115f8 + + /* We only need to check the first pbuf here: + If a pbuf is queued for transmission, a driver calls pbuf_ref(), + which only changes the ref count of the first pbuf */ + if (seg->p->ref != 1) { + 800b72c: 687b ldr r3, [r7, #4] + 800b72e: 685b ldr r3, [r3, #4] + 800b730: 7b9b ldrb r3, [r3, #14] + 800b732: 2b01 cmp r3, #1 + 800b734: d001 beq.n 800b73a + /* other reference found */ + return 1; + 800b736: 2301 movs r3, #1 + 800b738: e000 b.n 800b73c + } + /* no other references found */ + return 0; + 800b73a: 2300 movs r3, #0 +} + 800b73c: 4618 mov r0, r3 + 800b73e: 3708 adds r7, #8 + 800b740: 46bd mov sp, r7 + 800b742: bd80 pop {r7, pc} + 800b744: 0801769c .word 0x0801769c + 800b748: 08017c38 .word 0x08017c38 + 800b74c: 080176f0 .word 0x080176f0 + +0800b750 : + * @param pcb the tcp_pcb for the TCP connection used to send the segment + * @param netif the netif used to send the segment + */ +static err_t +tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif) +{ + 800b750: b5b0 push {r4, r5, r7, lr} + 800b752: b08c sub sp, #48 @ 0x30 + 800b754: af04 add r7, sp, #16 + 800b756: 60f8 str r0, [r7, #12] + 800b758: 60b9 str r1, [r7, #8] + 800b75a: 607a str r2, [r7, #4] + u32_t *opts; +#if TCP_CHECKSUM_ON_COPY + int seg_chksum_was_swapped = 0; +#endif + + LWIP_ASSERT("tcp_output_segment: invalid seg", seg != NULL); + 800b75c: 68fb ldr r3, [r7, #12] + 800b75e: 2b00 cmp r3, #0 + 800b760: d106 bne.n 800b770 + 800b762: 4b64 ldr r3, [pc, #400] @ (800b8f4 ) + 800b764: f44f 62b7 mov.w r2, #1464 @ 0x5b8 + 800b768: 4963 ldr r1, [pc, #396] @ (800b8f8 ) + 800b76a: 4864 ldr r0, [pc, #400] @ (800b8fc ) + 800b76c: f005 ff44 bl 80115f8 + LWIP_ASSERT("tcp_output_segment: invalid pcb", pcb != NULL); + 800b770: 68bb ldr r3, [r7, #8] + 800b772: 2b00 cmp r3, #0 + 800b774: d106 bne.n 800b784 + 800b776: 4b5f ldr r3, [pc, #380] @ (800b8f4 ) + 800b778: f240 52b9 movw r2, #1465 @ 0x5b9 + 800b77c: 4960 ldr r1, [pc, #384] @ (800b900 ) + 800b77e: 485f ldr r0, [pc, #380] @ (800b8fc ) + 800b780: f005 ff3a bl 80115f8 + LWIP_ASSERT("tcp_output_segment: invalid netif", netif != NULL); + 800b784: 687b ldr r3, [r7, #4] + 800b786: 2b00 cmp r3, #0 + 800b788: d106 bne.n 800b798 + 800b78a: 4b5a ldr r3, [pc, #360] @ (800b8f4 ) + 800b78c: f240 52ba movw r2, #1466 @ 0x5ba + 800b790: 495c ldr r1, [pc, #368] @ (800b904 ) + 800b792: 485a ldr r0, [pc, #360] @ (800b8fc ) + 800b794: f005 ff30 bl 80115f8 + + if (tcp_output_segment_busy(seg)) { + 800b798: 68f8 ldr r0, [r7, #12] + 800b79a: f7ff ffb9 bl 800b710 + 800b79e: 4603 mov r3, r0 + 800b7a0: 2b00 cmp r3, #0 + 800b7a2: d001 beq.n 800b7a8 + /* This should not happen: rexmit functions should have checked this. + However, since this function modifies p->len, we must not continue in this case. */ + LWIP_DEBUGF(TCP_RTO_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_output_segment: segment busy\n")); + return ERR_OK; + 800b7a4: 2300 movs r3, #0 + 800b7a6: e0a1 b.n 800b8ec + } + + /* The TCP header has already been constructed, but the ackno and + wnd fields remain. */ + seg->tcphdr->ackno = lwip_htonl(pcb->rcv_nxt); + 800b7a8: 68bb ldr r3, [r7, #8] + 800b7aa: 6a5a ldr r2, [r3, #36] @ 0x24 + 800b7ac: 68fb ldr r3, [r7, #12] + 800b7ae: 68dc ldr r4, [r3, #12] + 800b7b0: 4610 mov r0, r2 + 800b7b2: f7f9 fdfe bl 80053b2 + 800b7b6: 4603 mov r3, r0 + 800b7b8: 60a3 str r3, [r4, #8] + the window scale option) is never scaled. */ + seg->tcphdr->wnd = lwip_htons(TCPWND_MIN16(pcb->rcv_ann_wnd)); + } else +#endif /* LWIP_WND_SCALE */ + { + seg->tcphdr->wnd = lwip_htons(TCPWND_MIN16(RCV_WND_SCALE(pcb, pcb->rcv_ann_wnd))); + 800b7ba: 68bb ldr r3, [r7, #8] + 800b7bc: 8d5a ldrh r2, [r3, #42] @ 0x2a + 800b7be: 68fb ldr r3, [r7, #12] + 800b7c0: 68dc ldr r4, [r3, #12] + 800b7c2: 4610 mov r0, r2 + 800b7c4: f7f9 fde0 bl 8005388 + 800b7c8: 4603 mov r3, r0 + 800b7ca: 81e3 strh r3, [r4, #14] + } + + pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd; + 800b7cc: 68bb ldr r3, [r7, #8] + 800b7ce: 6a5b ldr r3, [r3, #36] @ 0x24 + 800b7d0: 68ba ldr r2, [r7, #8] + 800b7d2: 8d52 ldrh r2, [r2, #42] @ 0x2a + 800b7d4: 441a add r2, r3 + 800b7d6: 68bb ldr r3, [r7, #8] + 800b7d8: 62da str r2, [r3, #44] @ 0x2c + + /* Add any requested options. NB MSS option is only set on SYN + packets, so ignore it here */ + /* cast through void* to get rid of alignment warnings */ + opts = (u32_t *)(void *)(seg->tcphdr + 1); + 800b7da: 68fb ldr r3, [r7, #12] + 800b7dc: 68db ldr r3, [r3, #12] + 800b7de: 3314 adds r3, #20 + 800b7e0: 61fb str r3, [r7, #28] + if (seg->flags & TF_SEG_OPTS_MSS) { + 800b7e2: 68fb ldr r3, [r7, #12] + 800b7e4: 7a9b ldrb r3, [r3, #10] + 800b7e6: f003 0301 and.w r3, r3, #1 + 800b7ea: 2b00 cmp r3, #0 + 800b7ec: d015 beq.n 800b81a + u16_t mss; +#if TCP_CALCULATE_EFF_SEND_MSS + mss = tcp_eff_send_mss_netif(TCP_MSS, netif, &pcb->remote_ip); + 800b7ee: 68bb ldr r3, [r7, #8] + 800b7f0: 3304 adds r3, #4 + 800b7f2: 461a mov r2, r3 + 800b7f4: 6879 ldr r1, [r7, #4] + 800b7f6: f44f 7006 mov.w r0, #536 @ 0x218 + 800b7fa: f7fc fe91 bl 8008520 + 800b7fe: 4603 mov r3, r0 + 800b800: 837b strh r3, [r7, #26] +#else /* TCP_CALCULATE_EFF_SEND_MSS */ + mss = TCP_MSS; +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + *opts = TCP_BUILD_MSS_OPTION(mss); + 800b802: 8b7b ldrh r3, [r7, #26] + 800b804: f043 7301 orr.w r3, r3, #33816576 @ 0x2040000 + 800b808: 4618 mov r0, r3 + 800b80a: f7f9 fdd2 bl 80053b2 + 800b80e: 4602 mov r2, r0 + 800b810: 69fb ldr r3, [r7, #28] + 800b812: 601a str r2, [r3, #0] + opts += 1; + 800b814: 69fb ldr r3, [r7, #28] + 800b816: 3304 adds r3, #4 + 800b818: 61fb str r3, [r7, #28] + } +#endif + + /* Set retransmission timer running if it is not currently enabled + This must be set before checking the route. */ + if (pcb->rtime < 0) { + 800b81a: 68bb ldr r3, [r7, #8] + 800b81c: f9b3 3030 ldrsh.w r3, [r3, #48] @ 0x30 + 800b820: 2b00 cmp r3, #0 + 800b822: da02 bge.n 800b82a + pcb->rtime = 0; + 800b824: 68bb ldr r3, [r7, #8] + 800b826: 2200 movs r2, #0 + 800b828: 861a strh r2, [r3, #48] @ 0x30 + } + + if (pcb->rttest == 0) { + 800b82a: 68bb ldr r3, [r7, #8] + 800b82c: 6b5b ldr r3, [r3, #52] @ 0x34 + 800b82e: 2b00 cmp r3, #0 + 800b830: d10c bne.n 800b84c + pcb->rttest = tcp_ticks; + 800b832: 4b35 ldr r3, [pc, #212] @ (800b908 ) + 800b834: 681a ldr r2, [r3, #0] + 800b836: 68bb ldr r3, [r7, #8] + 800b838: 635a str r2, [r3, #52] @ 0x34 + pcb->rtseq = lwip_ntohl(seg->tcphdr->seqno); + 800b83a: 68fb ldr r3, [r7, #12] + 800b83c: 68db ldr r3, [r3, #12] + 800b83e: 685b ldr r3, [r3, #4] + 800b840: 4618 mov r0, r3 + 800b842: f7f9 fdb6 bl 80053b2 + 800b846: 4602 mov r2, r0 + 800b848: 68bb ldr r3, [r7, #8] + 800b84a: 639a str r2, [r3, #56] @ 0x38 + } + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n", + lwip_htonl(seg->tcphdr->seqno), lwip_htonl(seg->tcphdr->seqno) + + seg->len)); + + len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload); + 800b84c: 68fb ldr r3, [r7, #12] + 800b84e: 68da ldr r2, [r3, #12] + 800b850: 68fb ldr r3, [r7, #12] + 800b852: 685b ldr r3, [r3, #4] + 800b854: 685b ldr r3, [r3, #4] + 800b856: 1ad3 subs r3, r2, r3 + 800b858: 833b strh r3, [r7, #24] + if (len == 0) { + /** Exclude retransmitted segments from this count. */ + MIB2_STATS_INC(mib2.tcpoutsegs); + } + + seg->p->len -= len; + 800b85a: 68fb ldr r3, [r7, #12] + 800b85c: 685b ldr r3, [r3, #4] + 800b85e: 8959 ldrh r1, [r3, #10] + 800b860: 68fb ldr r3, [r7, #12] + 800b862: 685b ldr r3, [r3, #4] + 800b864: 8b3a ldrh r2, [r7, #24] + 800b866: 1a8a subs r2, r1, r2 + 800b868: b292 uxth r2, r2 + 800b86a: 815a strh r2, [r3, #10] + seg->p->tot_len -= len; + 800b86c: 68fb ldr r3, [r7, #12] + 800b86e: 685b ldr r3, [r3, #4] + 800b870: 8919 ldrh r1, [r3, #8] + 800b872: 68fb ldr r3, [r7, #12] + 800b874: 685b ldr r3, [r3, #4] + 800b876: 8b3a ldrh r2, [r7, #24] + 800b878: 1a8a subs r2, r1, r2 + 800b87a: b292 uxth r2, r2 + 800b87c: 811a strh r2, [r3, #8] + + seg->p->payload = seg->tcphdr; + 800b87e: 68fb ldr r3, [r7, #12] + 800b880: 685b ldr r3, [r3, #4] + 800b882: 68fa ldr r2, [r7, #12] + 800b884: 68d2 ldr r2, [r2, #12] + 800b886: 605a str r2, [r3, #4] + + seg->tcphdr->chksum = 0; + 800b888: 68fb ldr r3, [r7, #12] + 800b88a: 68db ldr r3, [r3, #12] + 800b88c: 2200 movs r2, #0 + 800b88e: 741a strb r2, [r3, #16] + 800b890: 2200 movs r2, #0 + 800b892: 745a strb r2, [r3, #17] + +#ifdef LWIP_HOOK_TCP_OUT_ADD_TCPOPTS + opts = LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(seg->p, seg->tcphdr, pcb, opts); +#endif + LWIP_ASSERT("options not filled", (u8_t *)opts == ((u8_t *)(seg->tcphdr + 1)) + LWIP_TCP_OPT_LENGTH_SEGMENT(seg->flags, pcb)); + 800b894: 68fb ldr r3, [r7, #12] + 800b896: 68da ldr r2, [r3, #12] + 800b898: 68fb ldr r3, [r7, #12] + 800b89a: 7a9b ldrb r3, [r3, #10] + 800b89c: f003 0301 and.w r3, r3, #1 + 800b8a0: 2b00 cmp r3, #0 + 800b8a2: d001 beq.n 800b8a8 + 800b8a4: 2318 movs r3, #24 + 800b8a6: e000 b.n 800b8aa + 800b8a8: 2314 movs r3, #20 + 800b8aa: 4413 add r3, r2 + 800b8ac: 69fa ldr r2, [r7, #28] + 800b8ae: 429a cmp r2, r3 + 800b8b0: d006 beq.n 800b8c0 + 800b8b2: 4b10 ldr r3, [pc, #64] @ (800b8f4 ) + 800b8b4: f240 621c movw r2, #1564 @ 0x61c + 800b8b8: 4914 ldr r1, [pc, #80] @ (800b90c ) + 800b8ba: 4810 ldr r0, [pc, #64] @ (800b8fc ) + 800b8bc: f005 fe9c bl 80115f8 + } +#endif /* CHECKSUM_GEN_TCP */ + TCP_STATS_INC(tcp.xmit); + + NETIF_SET_HINTS(netif, &(pcb->netif_hints)); + err = ip_output_if(seg->p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, + 800b8c0: 68fb ldr r3, [r7, #12] + 800b8c2: 6858 ldr r0, [r3, #4] + 800b8c4: 68b9 ldr r1, [r7, #8] + 800b8c6: 68bb ldr r3, [r7, #8] + 800b8c8: 1d1c adds r4, r3, #4 + 800b8ca: 68bb ldr r3, [r7, #8] + 800b8cc: 7add ldrb r5, [r3, #11] + 800b8ce: 68bb ldr r3, [r7, #8] + 800b8d0: 7a9b ldrb r3, [r3, #10] + 800b8d2: 687a ldr r2, [r7, #4] + 800b8d4: 9202 str r2, [sp, #8] + 800b8d6: 2206 movs r2, #6 + 800b8d8: 9201 str r2, [sp, #4] + 800b8da: 9300 str r3, [sp, #0] + 800b8dc: 462b mov r3, r5 + 800b8de: 4622 mov r2, r4 + 800b8e0: f004 fc40 bl 8010164 + 800b8e4: 4603 mov r3, r0 + 800b8e6: 75fb strb r3, [r7, #23] + seg->chksum = SWAP_BYTES_IN_WORD(seg->chksum); + seg->chksum_swapped = 1; + } +#endif + + return err; + 800b8e8: f997 3017 ldrsb.w r3, [r7, #23] +} + 800b8ec: 4618 mov r0, r3 + 800b8ee: 3720 adds r7, #32 + 800b8f0: 46bd mov sp, r7 + 800b8f2: bdb0 pop {r4, r5, r7, pc} + 800b8f4: 0801769c .word 0x0801769c + 800b8f8: 08017c60 .word 0x08017c60 + 800b8fc: 080176f0 .word 0x080176f0 + 800b900: 08017c80 .word 0x08017c80 + 800b904: 08017ca0 .word 0x08017ca0 + 800b908: 200190a4 .word 0x200190a4 + 800b90c: 08017cc4 .word 0x08017cc4 + +0800b910 : + * + * @param pcb the tcp_pcb for which to re-enqueue all unacked segments + */ +err_t +tcp_rexmit_rto_prepare(struct tcp_pcb *pcb) +{ + 800b910: b5b0 push {r4, r5, r7, lr} + 800b912: b084 sub sp, #16 + 800b914: af00 add r7, sp, #0 + 800b916: 6078 str r0, [r7, #4] + struct tcp_seg *seg; + + LWIP_ASSERT("tcp_rexmit_rto_prepare: invalid pcb", pcb != NULL); + 800b918: 687b ldr r3, [r7, #4] + 800b91a: 2b00 cmp r3, #0 + 800b91c: d106 bne.n 800b92c + 800b91e: 4b31 ldr r3, [pc, #196] @ (800b9e4 ) + 800b920: f240 6263 movw r2, #1635 @ 0x663 + 800b924: 4930 ldr r1, [pc, #192] @ (800b9e8 ) + 800b926: 4831 ldr r0, [pc, #196] @ (800b9ec ) + 800b928: f005 fe66 bl 80115f8 + + if (pcb->unacked == NULL) { + 800b92c: 687b ldr r3, [r7, #4] + 800b92e: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b930: 2b00 cmp r3, #0 + 800b932: d102 bne.n 800b93a + return ERR_VAL; + 800b934: f06f 0305 mvn.w r3, #5 + 800b938: e050 b.n 800b9dc + + /* Move all unacked segments to the head of the unsent queue. + However, give up if any of the unsent pbufs are still referenced by the + netif driver due to deferred transmission. No point loading the link further + if it is struggling to flush its buffered writes. */ + for (seg = pcb->unacked; seg->next != NULL; seg = seg->next) { + 800b93a: 687b ldr r3, [r7, #4] + 800b93c: 6f1b ldr r3, [r3, #112] @ 0x70 + 800b93e: 60fb str r3, [r7, #12] + 800b940: e00b b.n 800b95a + if (tcp_output_segment_busy(seg)) { + 800b942: 68f8 ldr r0, [r7, #12] + 800b944: f7ff fee4 bl 800b710 + 800b948: 4603 mov r3, r0 + 800b94a: 2b00 cmp r3, #0 + 800b94c: d002 beq.n 800b954 + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit_rto: segment busy\n")); + return ERR_VAL; + 800b94e: f06f 0305 mvn.w r3, #5 + 800b952: e043 b.n 800b9dc + for (seg = pcb->unacked; seg->next != NULL; seg = seg->next) { + 800b954: 68fb ldr r3, [r7, #12] + 800b956: 681b ldr r3, [r3, #0] + 800b958: 60fb str r3, [r7, #12] + 800b95a: 68fb ldr r3, [r7, #12] + 800b95c: 681b ldr r3, [r3, #0] + 800b95e: 2b00 cmp r3, #0 + 800b960: d1ef bne.n 800b942 + } + } + if (tcp_output_segment_busy(seg)) { + 800b962: 68f8 ldr r0, [r7, #12] + 800b964: f7ff fed4 bl 800b710 + 800b968: 4603 mov r3, r0 + 800b96a: 2b00 cmp r3, #0 + 800b96c: d002 beq.n 800b974 + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit_rto: segment busy\n")); + return ERR_VAL; + 800b96e: f06f 0305 mvn.w r3, #5 + 800b972: e033 b.n 800b9dc + } + /* concatenate unsent queue after unacked queue */ + seg->next = pcb->unsent; + 800b974: 687b ldr r3, [r7, #4] + 800b976: 6eda ldr r2, [r3, #108] @ 0x6c + 800b978: 68fb ldr r3, [r7, #12] + 800b97a: 601a str r2, [r3, #0] + if (pcb->unsent == NULL) { + pcb->unsent_oversize = seg->oversize_left; + } +#endif /* TCP_OVERSIZE_DBGCHECK */ + /* unsent queue is the concatenated queue (of unacked, unsent) */ + pcb->unsent = pcb->unacked; + 800b97c: 687b ldr r3, [r7, #4] + 800b97e: 6f1a ldr r2, [r3, #112] @ 0x70 + 800b980: 687b ldr r3, [r7, #4] + 800b982: 66da str r2, [r3, #108] @ 0x6c + /* unacked queue is now empty */ + pcb->unacked = NULL; + 800b984: 687b ldr r3, [r7, #4] + 800b986: 2200 movs r2, #0 + 800b988: 671a str r2, [r3, #112] @ 0x70 + + /* Mark RTO in-progress */ + tcp_set_flags(pcb, TF_RTO); + 800b98a: 687b ldr r3, [r7, #4] + 800b98c: 8b5b ldrh r3, [r3, #26] + 800b98e: f443 6300 orr.w r3, r3, #2048 @ 0x800 + 800b992: b29a uxth r2, r3 + 800b994: 687b ldr r3, [r7, #4] + 800b996: 835a strh r2, [r3, #26] + /* Record the next byte following retransmit */ + pcb->rto_end = lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg); + 800b998: 68fb ldr r3, [r7, #12] + 800b99a: 68db ldr r3, [r3, #12] + 800b99c: 685b ldr r3, [r3, #4] + 800b99e: 4618 mov r0, r3 + 800b9a0: f7f9 fd07 bl 80053b2 + 800b9a4: 4604 mov r4, r0 + 800b9a6: 68fb ldr r3, [r7, #12] + 800b9a8: 891b ldrh r3, [r3, #8] + 800b9aa: 461d mov r5, r3 + 800b9ac: 68fb ldr r3, [r7, #12] + 800b9ae: 68db ldr r3, [r3, #12] + 800b9b0: 899b ldrh r3, [r3, #12] + 800b9b2: b29b uxth r3, r3 + 800b9b4: 4618 mov r0, r3 + 800b9b6: f7f9 fce7 bl 8005388 + 800b9ba: 4603 mov r3, r0 + 800b9bc: b2db uxtb r3, r3 + 800b9be: f003 0303 and.w r3, r3, #3 + 800b9c2: 2b00 cmp r3, #0 + 800b9c4: d001 beq.n 800b9ca + 800b9c6: 2301 movs r3, #1 + 800b9c8: e000 b.n 800b9cc + 800b9ca: 2300 movs r3, #0 + 800b9cc: 442b add r3, r5 + 800b9ce: 18e2 adds r2, r4, r3 + 800b9d0: 687b ldr r3, [r7, #4] + 800b9d2: 64da str r2, [r3, #76] @ 0x4c + /* Don't take any RTT measurements after retransmitting. */ + pcb->rttest = 0; + 800b9d4: 687b ldr r3, [r7, #4] + 800b9d6: 2200 movs r2, #0 + 800b9d8: 635a str r2, [r3, #52] @ 0x34 + + return ERR_OK; + 800b9da: 2300 movs r3, #0 +} + 800b9dc: 4618 mov r0, r3 + 800b9de: 3710 adds r7, #16 + 800b9e0: 46bd mov sp, r7 + 800b9e2: bdb0 pop {r4, r5, r7, pc} + 800b9e4: 0801769c .word 0x0801769c + 800b9e8: 08017cd8 .word 0x08017cd8 + 800b9ec: 080176f0 .word 0x080176f0 + +0800b9f0 : + * + * @param pcb the tcp_pcb for which to re-enqueue all unacked segments + */ +void +tcp_rexmit_rto_commit(struct tcp_pcb *pcb) +{ + 800b9f0: b580 push {r7, lr} + 800b9f2: b082 sub sp, #8 + 800b9f4: af00 add r7, sp, #0 + 800b9f6: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_rexmit_rto_commit: invalid pcb", pcb != NULL); + 800b9f8: 687b ldr r3, [r7, #4] + 800b9fa: 2b00 cmp r3, #0 + 800b9fc: d106 bne.n 800ba0c + 800b9fe: 4b0d ldr r3, [pc, #52] @ (800ba34 ) + 800ba00: f44f 62d3 mov.w r2, #1688 @ 0x698 + 800ba04: 490c ldr r1, [pc, #48] @ (800ba38 ) + 800ba06: 480d ldr r0, [pc, #52] @ (800ba3c ) + 800ba08: f005 fdf6 bl 80115f8 + + /* increment number of retransmissions */ + if (pcb->nrtx < 0xFF) { + 800ba0c: 687b ldr r3, [r7, #4] + 800ba0e: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 800ba12: 2bff cmp r3, #255 @ 0xff + 800ba14: d007 beq.n 800ba26 + ++pcb->nrtx; + 800ba16: 687b ldr r3, [r7, #4] + 800ba18: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 800ba1c: 3301 adds r3, #1 + 800ba1e: b2da uxtb r2, r3 + 800ba20: 687b ldr r3, [r7, #4] + 800ba22: f883 2042 strb.w r2, [r3, #66] @ 0x42 + } + /* Do the actual retransmission */ + tcp_output(pcb); + 800ba26: 6878 ldr r0, [r7, #4] + 800ba28: f7ff fc7e bl 800b328 +} + 800ba2c: bf00 nop + 800ba2e: 3708 adds r7, #8 + 800ba30: 46bd mov sp, r7 + 800ba32: bd80 pop {r7, pc} + 800ba34: 0801769c .word 0x0801769c + 800ba38: 08017cfc .word 0x08017cfc + 800ba3c: 080176f0 .word 0x080176f0 + +0800ba40 : + * + * @param pcb the tcp_pcb for which to re-enqueue all unacked segments + */ +void +tcp_rexmit_rto(struct tcp_pcb *pcb) +{ + 800ba40: b580 push {r7, lr} + 800ba42: b082 sub sp, #8 + 800ba44: af00 add r7, sp, #0 + 800ba46: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_rexmit_rto: invalid pcb", pcb != NULL); + 800ba48: 687b ldr r3, [r7, #4] + 800ba4a: 2b00 cmp r3, #0 + 800ba4c: d106 bne.n 800ba5c + 800ba4e: 4b0a ldr r3, [pc, #40] @ (800ba78 ) + 800ba50: f240 62ad movw r2, #1709 @ 0x6ad + 800ba54: 4909 ldr r1, [pc, #36] @ (800ba7c ) + 800ba56: 480a ldr r0, [pc, #40] @ (800ba80 ) + 800ba58: f005 fdce bl 80115f8 + + if (tcp_rexmit_rto_prepare(pcb) == ERR_OK) { + 800ba5c: 6878 ldr r0, [r7, #4] + 800ba5e: f7ff ff57 bl 800b910 + 800ba62: 4603 mov r3, r0 + 800ba64: 2b00 cmp r3, #0 + 800ba66: d102 bne.n 800ba6e + tcp_rexmit_rto_commit(pcb); + 800ba68: 6878 ldr r0, [r7, #4] + 800ba6a: f7ff ffc1 bl 800b9f0 + } +} + 800ba6e: bf00 nop + 800ba70: 3708 adds r7, #8 + 800ba72: 46bd mov sp, r7 + 800ba74: bd80 pop {r7, pc} + 800ba76: bf00 nop + 800ba78: 0801769c .word 0x0801769c + 800ba7c: 08017d20 .word 0x08017d20 + 800ba80: 080176f0 .word 0x080176f0 + +0800ba84 : + * + * @param pcb the tcp_pcb for which to retransmit the first unacked segment + */ +err_t +tcp_rexmit(struct tcp_pcb *pcb) +{ + 800ba84: b590 push {r4, r7, lr} + 800ba86: b085 sub sp, #20 + 800ba88: af00 add r7, sp, #0 + 800ba8a: 6078 str r0, [r7, #4] + struct tcp_seg *seg; + struct tcp_seg **cur_seg; + + LWIP_ASSERT("tcp_rexmit: invalid pcb", pcb != NULL); + 800ba8c: 687b ldr r3, [r7, #4] + 800ba8e: 2b00 cmp r3, #0 + 800ba90: d106 bne.n 800baa0 + 800ba92: 4b2f ldr r3, [pc, #188] @ (800bb50 ) + 800ba94: f240 62c1 movw r2, #1729 @ 0x6c1 + 800ba98: 492e ldr r1, [pc, #184] @ (800bb54 ) + 800ba9a: 482f ldr r0, [pc, #188] @ (800bb58 ) + 800ba9c: f005 fdac bl 80115f8 + + if (pcb->unacked == NULL) { + 800baa0: 687b ldr r3, [r7, #4] + 800baa2: 6f1b ldr r3, [r3, #112] @ 0x70 + 800baa4: 2b00 cmp r3, #0 + 800baa6: d102 bne.n 800baae + return ERR_VAL; + 800baa8: f06f 0305 mvn.w r3, #5 + 800baac: e04c b.n 800bb48 + } + + seg = pcb->unacked; + 800baae: 687b ldr r3, [r7, #4] + 800bab0: 6f1b ldr r3, [r3, #112] @ 0x70 + 800bab2: 60bb str r3, [r7, #8] + + /* Give up if the segment is still referenced by the netif driver + due to deferred transmission. */ + if (tcp_output_segment_busy(seg)) { + 800bab4: 68b8 ldr r0, [r7, #8] + 800bab6: f7ff fe2b bl 800b710 + 800baba: 4603 mov r3, r0 + 800babc: 2b00 cmp r3, #0 + 800babe: d002 beq.n 800bac6 + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit busy\n")); + return ERR_VAL; + 800bac0: f06f 0305 mvn.w r3, #5 + 800bac4: e040 b.n 800bb48 + } + + /* Move the first unacked segment to the unsent queue */ + /* Keep the unsent queue sorted. */ + pcb->unacked = seg->next; + 800bac6: 68bb ldr r3, [r7, #8] + 800bac8: 681a ldr r2, [r3, #0] + 800baca: 687b ldr r3, [r7, #4] + 800bacc: 671a str r2, [r3, #112] @ 0x70 + + cur_seg = &(pcb->unsent); + 800bace: 687b ldr r3, [r7, #4] + 800bad0: 336c adds r3, #108 @ 0x6c + 800bad2: 60fb str r3, [r7, #12] + while (*cur_seg && + 800bad4: e002 b.n 800badc + TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) { + cur_seg = &((*cur_seg)->next ); + 800bad6: 68fb ldr r3, [r7, #12] + 800bad8: 681b ldr r3, [r3, #0] + 800bada: 60fb str r3, [r7, #12] + while (*cur_seg && + 800badc: 68fb ldr r3, [r7, #12] + 800bade: 681b ldr r3, [r3, #0] + 800bae0: 2b00 cmp r3, #0 + 800bae2: d011 beq.n 800bb08 + TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) { + 800bae4: 68fb ldr r3, [r7, #12] + 800bae6: 681b ldr r3, [r3, #0] + 800bae8: 68db ldr r3, [r3, #12] + 800baea: 685b ldr r3, [r3, #4] + 800baec: 4618 mov r0, r3 + 800baee: f7f9 fc60 bl 80053b2 + 800baf2: 4604 mov r4, r0 + 800baf4: 68bb ldr r3, [r7, #8] + 800baf6: 68db ldr r3, [r3, #12] + 800baf8: 685b ldr r3, [r3, #4] + 800bafa: 4618 mov r0, r3 + 800bafc: f7f9 fc59 bl 80053b2 + 800bb00: 4603 mov r3, r0 + 800bb02: 1ae3 subs r3, r4, r3 + while (*cur_seg && + 800bb04: 2b00 cmp r3, #0 + 800bb06: dbe6 blt.n 800bad6 + } + seg->next = *cur_seg; + 800bb08: 68fb ldr r3, [r7, #12] + 800bb0a: 681a ldr r2, [r3, #0] + 800bb0c: 68bb ldr r3, [r7, #8] + 800bb0e: 601a str r2, [r3, #0] + *cur_seg = seg; + 800bb10: 68fb ldr r3, [r7, #12] + 800bb12: 68ba ldr r2, [r7, #8] + 800bb14: 601a str r2, [r3, #0] +#if TCP_OVERSIZE + if (seg->next == NULL) { + 800bb16: 68bb ldr r3, [r7, #8] + 800bb18: 681b ldr r3, [r3, #0] + 800bb1a: 2b00 cmp r3, #0 + 800bb1c: d103 bne.n 800bb26 + /* the retransmitted segment is last in unsent, so reset unsent_oversize */ + pcb->unsent_oversize = 0; + 800bb1e: 687b ldr r3, [r7, #4] + 800bb20: 2200 movs r2, #0 + 800bb22: f8a3 2068 strh.w r2, [r3, #104] @ 0x68 + } +#endif /* TCP_OVERSIZE */ + + if (pcb->nrtx < 0xFF) { + 800bb26: 687b ldr r3, [r7, #4] + 800bb28: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 800bb2c: 2bff cmp r3, #255 @ 0xff + 800bb2e: d007 beq.n 800bb40 + ++pcb->nrtx; + 800bb30: 687b ldr r3, [r7, #4] + 800bb32: f893 3042 ldrb.w r3, [r3, #66] @ 0x42 + 800bb36: 3301 adds r3, #1 + 800bb38: b2da uxtb r2, r3 + 800bb3a: 687b ldr r3, [r7, #4] + 800bb3c: f883 2042 strb.w r2, [r3, #66] @ 0x42 + } + + /* Don't take any rtt measurements after retransmitting. */ + pcb->rttest = 0; + 800bb40: 687b ldr r3, [r7, #4] + 800bb42: 2200 movs r2, #0 + 800bb44: 635a str r2, [r3, #52] @ 0x34 + + /* Do the actual retransmission. */ + MIB2_STATS_INC(mib2.tcpretranssegs); + /* No need to call tcp_output: we are always called from tcp_input() + and thus tcp_output directly returns. */ + return ERR_OK; + 800bb46: 2300 movs r3, #0 +} + 800bb48: 4618 mov r0, r3 + 800bb4a: 3714 adds r7, #20 + 800bb4c: 46bd mov sp, r7 + 800bb4e: bd90 pop {r4, r7, pc} + 800bb50: 0801769c .word 0x0801769c + 800bb54: 08017d3c .word 0x08017d3c + 800bb58: 080176f0 .word 0x080176f0 + +0800bb5c : + * + * @param pcb the tcp_pcb for which to retransmit the first unacked segment + */ +void +tcp_rexmit_fast(struct tcp_pcb *pcb) +{ + 800bb5c: b580 push {r7, lr} + 800bb5e: b082 sub sp, #8 + 800bb60: af00 add r7, sp, #0 + 800bb62: 6078 str r0, [r7, #4] + LWIP_ASSERT("tcp_rexmit_fast: invalid pcb", pcb != NULL); + 800bb64: 687b ldr r3, [r7, #4] + 800bb66: 2b00 cmp r3, #0 + 800bb68: d106 bne.n 800bb78 + 800bb6a: 4b2a ldr r3, [pc, #168] @ (800bc14 ) + 800bb6c: f240 62f9 movw r2, #1785 @ 0x6f9 + 800bb70: 4929 ldr r1, [pc, #164] @ (800bc18 ) + 800bb72: 482a ldr r0, [pc, #168] @ (800bc1c ) + 800bb74: f005 fd40 bl 80115f8 + + if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) { + 800bb78: 687b ldr r3, [r7, #4] + 800bb7a: 6f1b ldr r3, [r3, #112] @ 0x70 + 800bb7c: 2b00 cmp r3, #0 + 800bb7e: d044 beq.n 800bc0a + 800bb80: 687b ldr r3, [r7, #4] + 800bb82: 8b5b ldrh r3, [r3, #26] + 800bb84: f003 0304 and.w r3, r3, #4 + 800bb88: 2b00 cmp r3, #0 + 800bb8a: d13e bne.n 800bc0a + LWIP_DEBUGF(TCP_FR_DEBUG, + ("tcp_receive: dupacks %"U16_F" (%"U32_F + "), fast retransmit %"U32_F"\n", + (u16_t)pcb->dupacks, pcb->lastack, + lwip_ntohl(pcb->unacked->tcphdr->seqno))); + if (tcp_rexmit(pcb) == ERR_OK) { + 800bb8c: 6878 ldr r0, [r7, #4] + 800bb8e: f7ff ff79 bl 800ba84 + 800bb92: 4603 mov r3, r0 + 800bb94: 2b00 cmp r3, #0 + 800bb96: d138 bne.n 800bc0a + /* Set ssthresh to half of the minimum of the current + * cwnd and the advertised window */ + pcb->ssthresh = LWIP_MIN(pcb->cwnd, pcb->snd_wnd) / 2; + 800bb98: 687b ldr r3, [r7, #4] + 800bb9a: f8b3 2060 ldrh.w r2, [r3, #96] @ 0x60 + 800bb9e: 687b ldr r3, [r7, #4] + 800bba0: f8b3 3048 ldrh.w r3, [r3, #72] @ 0x48 + 800bba4: 4293 cmp r3, r2 + 800bba6: bf28 it cs + 800bba8: 4613 movcs r3, r2 + 800bbaa: b29b uxth r3, r3 + 800bbac: 0fda lsrs r2, r3, #31 + 800bbae: 4413 add r3, r2 + 800bbb0: 105b asrs r3, r3, #1 + 800bbb2: b29a uxth r2, r3 + 800bbb4: 687b ldr r3, [r7, #4] + 800bbb6: f8a3 204a strh.w r2, [r3, #74] @ 0x4a + + /* The minimum value for ssthresh should be 2 MSS */ + if (pcb->ssthresh < (2U * pcb->mss)) { + 800bbba: 687b ldr r3, [r7, #4] + 800bbbc: f8b3 304a ldrh.w r3, [r3, #74] @ 0x4a + 800bbc0: 461a mov r2, r3 + 800bbc2: 687b ldr r3, [r7, #4] + 800bbc4: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800bbc6: 005b lsls r3, r3, #1 + 800bbc8: 429a cmp r2, r3 + 800bbca: d206 bcs.n 800bbda + LWIP_DEBUGF(TCP_FR_DEBUG, + ("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F + " should be min 2 mss %"U16_F"...\n", + pcb->ssthresh, (u16_t)(2 * pcb->mss))); + pcb->ssthresh = 2 * pcb->mss; + 800bbcc: 687b ldr r3, [r7, #4] + 800bbce: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800bbd0: 005b lsls r3, r3, #1 + 800bbd2: b29a uxth r2, r3 + 800bbd4: 687b ldr r3, [r7, #4] + 800bbd6: f8a3 204a strh.w r2, [r3, #74] @ 0x4a + } + + pcb->cwnd = pcb->ssthresh + 3 * pcb->mss; + 800bbda: 687b ldr r3, [r7, #4] + 800bbdc: f8b3 204a ldrh.w r2, [r3, #74] @ 0x4a + 800bbe0: 687b ldr r3, [r7, #4] + 800bbe2: 8e5b ldrh r3, [r3, #50] @ 0x32 + 800bbe4: 4619 mov r1, r3 + 800bbe6: 0049 lsls r1, r1, #1 + 800bbe8: 440b add r3, r1 + 800bbea: b29b uxth r3, r3 + 800bbec: 4413 add r3, r2 + 800bbee: b29a uxth r2, r3 + 800bbf0: 687b ldr r3, [r7, #4] + 800bbf2: f8a3 2048 strh.w r2, [r3, #72] @ 0x48 + tcp_set_flags(pcb, TF_INFR); + 800bbf6: 687b ldr r3, [r7, #4] + 800bbf8: 8b5b ldrh r3, [r3, #26] + 800bbfa: f043 0304 orr.w r3, r3, #4 + 800bbfe: b29a uxth r2, r3 + 800bc00: 687b ldr r3, [r7, #4] + 800bc02: 835a strh r2, [r3, #26] + + /* Reset the retransmission timer to prevent immediate rto retransmissions */ + pcb->rtime = 0; + 800bc04: 687b ldr r3, [r7, #4] + 800bc06: 2200 movs r2, #0 + 800bc08: 861a strh r2, [r3, #48] @ 0x30 + } + } +} + 800bc0a: bf00 nop + 800bc0c: 3708 adds r7, #8 + 800bc0e: 46bd mov sp, r7 + 800bc10: bd80 pop {r7, pc} + 800bc12: bf00 nop + 800bc14: 0801769c .word 0x0801769c + 800bc18: 08017d54 .word 0x08017d54 + 800bc1c: 080176f0 .word 0x080176f0 + +0800bc20 : + +static struct pbuf * +tcp_output_alloc_header_common(u32_t ackno, u16_t optlen, u16_t datalen, + u32_t seqno_be /* already in network byte order */, + u16_t src_port, u16_t dst_port, u8_t flags, u16_t wnd) +{ + 800bc20: b580 push {r7, lr} + 800bc22: b086 sub sp, #24 + 800bc24: af00 add r7, sp, #0 + 800bc26: 60f8 str r0, [r7, #12] + 800bc28: 607b str r3, [r7, #4] + 800bc2a: 460b mov r3, r1 + 800bc2c: 817b strh r3, [r7, #10] + 800bc2e: 4613 mov r3, r2 + 800bc30: 813b strh r3, [r7, #8] + struct tcp_hdr *tcphdr; + struct pbuf *p; + + p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM); + 800bc32: 897a ldrh r2, [r7, #10] + 800bc34: 893b ldrh r3, [r7, #8] + 800bc36: 4413 add r3, r2 + 800bc38: b29b uxth r3, r3 + 800bc3a: 3314 adds r3, #20 + 800bc3c: b29b uxth r3, r3 + 800bc3e: f44f 7220 mov.w r2, #640 @ 0x280 + 800bc42: 4619 mov r1, r3 + 800bc44: 2022 movs r0, #34 @ 0x22 + 800bc46: f7fa fc0d bl 8006464 + 800bc4a: 6178 str r0, [r7, #20] + if (p != NULL) { + 800bc4c: 697b ldr r3, [r7, #20] + 800bc4e: 2b00 cmp r3, #0 + 800bc50: d04d beq.n 800bcee + LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr", + 800bc52: 897b ldrh r3, [r7, #10] + 800bc54: 3313 adds r3, #19 + 800bc56: 697a ldr r2, [r7, #20] + 800bc58: 8952 ldrh r2, [r2, #10] + 800bc5a: 4293 cmp r3, r2 + 800bc5c: db06 blt.n 800bc6c + 800bc5e: 4b26 ldr r3, [pc, #152] @ (800bcf8 ) + 800bc60: f240 7223 movw r2, #1827 @ 0x723 + 800bc64: 4925 ldr r1, [pc, #148] @ (800bcfc ) + 800bc66: 4826 ldr r0, [pc, #152] @ (800bd00 ) + 800bc68: f005 fcc6 bl 80115f8 + (p->len >= TCP_HLEN + optlen)); + tcphdr = (struct tcp_hdr *)p->payload; + 800bc6c: 697b ldr r3, [r7, #20] + 800bc6e: 685b ldr r3, [r3, #4] + 800bc70: 613b str r3, [r7, #16] + tcphdr->src = lwip_htons(src_port); + 800bc72: 8c3b ldrh r3, [r7, #32] + 800bc74: 4618 mov r0, r3 + 800bc76: f7f9 fb87 bl 8005388 + 800bc7a: 4603 mov r3, r0 + 800bc7c: 461a mov r2, r3 + 800bc7e: 693b ldr r3, [r7, #16] + 800bc80: 801a strh r2, [r3, #0] + tcphdr->dest = lwip_htons(dst_port); + 800bc82: 8cbb ldrh r3, [r7, #36] @ 0x24 + 800bc84: 4618 mov r0, r3 + 800bc86: f7f9 fb7f bl 8005388 + 800bc8a: 4603 mov r3, r0 + 800bc8c: 461a mov r2, r3 + 800bc8e: 693b ldr r3, [r7, #16] + 800bc90: 805a strh r2, [r3, #2] + tcphdr->seqno = seqno_be; + 800bc92: 693b ldr r3, [r7, #16] + 800bc94: 687a ldr r2, [r7, #4] + 800bc96: 605a str r2, [r3, #4] + tcphdr->ackno = lwip_htonl(ackno); + 800bc98: 68f8 ldr r0, [r7, #12] + 800bc9a: f7f9 fb8a bl 80053b2 + 800bc9e: 4602 mov r2, r0 + 800bca0: 693b ldr r3, [r7, #16] + 800bca2: 609a str r2, [r3, #8] + TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), flags); + 800bca4: 897b ldrh r3, [r7, #10] + 800bca6: 089b lsrs r3, r3, #2 + 800bca8: b29b uxth r3, r3 + 800bcaa: 3305 adds r3, #5 + 800bcac: b29b uxth r3, r3 + 800bcae: 031b lsls r3, r3, #12 + 800bcb0: b29a uxth r2, r3 + 800bcb2: f897 3028 ldrb.w r3, [r7, #40] @ 0x28 + 800bcb6: b29b uxth r3, r3 + 800bcb8: 4313 orrs r3, r2 + 800bcba: b29b uxth r3, r3 + 800bcbc: 4618 mov r0, r3 + 800bcbe: f7f9 fb63 bl 8005388 + 800bcc2: 4603 mov r3, r0 + 800bcc4: 461a mov r2, r3 + 800bcc6: 693b ldr r3, [r7, #16] + 800bcc8: 819a strh r2, [r3, #12] + tcphdr->wnd = lwip_htons(wnd); + 800bcca: 8dbb ldrh r3, [r7, #44] @ 0x2c + 800bccc: 4618 mov r0, r3 + 800bcce: f7f9 fb5b bl 8005388 + 800bcd2: 4603 mov r3, r0 + 800bcd4: 461a mov r2, r3 + 800bcd6: 693b ldr r3, [r7, #16] + 800bcd8: 81da strh r2, [r3, #14] + tcphdr->chksum = 0; + 800bcda: 693b ldr r3, [r7, #16] + 800bcdc: 2200 movs r2, #0 + 800bcde: 741a strb r2, [r3, #16] + 800bce0: 2200 movs r2, #0 + 800bce2: 745a strb r2, [r3, #17] + tcphdr->urgp = 0; + 800bce4: 693b ldr r3, [r7, #16] + 800bce6: 2200 movs r2, #0 + 800bce8: 749a strb r2, [r3, #18] + 800bcea: 2200 movs r2, #0 + 800bcec: 74da strb r2, [r3, #19] + } + return p; + 800bcee: 697b ldr r3, [r7, #20] +} + 800bcf0: 4618 mov r0, r3 + 800bcf2: 3718 adds r7, #24 + 800bcf4: 46bd mov sp, r7 + 800bcf6: bd80 pop {r7, pc} + 800bcf8: 0801769c .word 0x0801769c + 800bcfc: 08017d74 .word 0x08017d74 + 800bd00: 080176f0 .word 0x080176f0 + +0800bd04 : + * @return pbuf with p->payload being the tcp_hdr + */ +static struct pbuf * +tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen, + u32_t seqno_be /* already in network byte order */) +{ + 800bd04: b5b0 push {r4, r5, r7, lr} + 800bd06: b08a sub sp, #40 @ 0x28 + 800bd08: af04 add r7, sp, #16 + 800bd0a: 60f8 str r0, [r7, #12] + 800bd0c: 607b str r3, [r7, #4] + 800bd0e: 460b mov r3, r1 + 800bd10: 817b strh r3, [r7, #10] + 800bd12: 4613 mov r3, r2 + 800bd14: 813b strh r3, [r7, #8] + struct pbuf *p; + + LWIP_ASSERT("tcp_output_alloc_header: invalid pcb", pcb != NULL); + 800bd16: 68fb ldr r3, [r7, #12] + 800bd18: 2b00 cmp r3, #0 + 800bd1a: d106 bne.n 800bd2a + 800bd1c: 4b15 ldr r3, [pc, #84] @ (800bd74 ) + 800bd1e: f240 7242 movw r2, #1858 @ 0x742 + 800bd22: 4915 ldr r1, [pc, #84] @ (800bd78 ) + 800bd24: 4815 ldr r0, [pc, #84] @ (800bd7c ) + 800bd26: f005 fc67 bl 80115f8 + + p = tcp_output_alloc_header_common(pcb->rcv_nxt, optlen, datalen, + 800bd2a: 68fb ldr r3, [r7, #12] + 800bd2c: 6a58 ldr r0, [r3, #36] @ 0x24 + 800bd2e: 68fb ldr r3, [r7, #12] + 800bd30: 8adb ldrh r3, [r3, #22] + 800bd32: 68fa ldr r2, [r7, #12] + 800bd34: 8b12 ldrh r2, [r2, #24] + 800bd36: 68f9 ldr r1, [r7, #12] + 800bd38: 8d49 ldrh r1, [r1, #42] @ 0x2a + 800bd3a: 893d ldrh r5, [r7, #8] + 800bd3c: 897c ldrh r4, [r7, #10] + 800bd3e: 9103 str r1, [sp, #12] + 800bd40: 2110 movs r1, #16 + 800bd42: 9102 str r1, [sp, #8] + 800bd44: 9201 str r2, [sp, #4] + 800bd46: 9300 str r3, [sp, #0] + 800bd48: 687b ldr r3, [r7, #4] + 800bd4a: 462a mov r2, r5 + 800bd4c: 4621 mov r1, r4 + 800bd4e: f7ff ff67 bl 800bc20 + 800bd52: 6178 str r0, [r7, #20] + seqno_be, pcb->local_port, pcb->remote_port, TCP_ACK, + TCPWND_MIN16(RCV_WND_SCALE(pcb, pcb->rcv_ann_wnd))); + if (p != NULL) { + 800bd54: 697b ldr r3, [r7, #20] + 800bd56: 2b00 cmp r3, #0 + 800bd58: d006 beq.n 800bd68 + /* If we're sending a packet, update the announced right window edge */ + pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd; + 800bd5a: 68fb ldr r3, [r7, #12] + 800bd5c: 6a5b ldr r3, [r3, #36] @ 0x24 + 800bd5e: 68fa ldr r2, [r7, #12] + 800bd60: 8d52 ldrh r2, [r2, #42] @ 0x2a + 800bd62: 441a add r2, r3 + 800bd64: 68fb ldr r3, [r7, #12] + 800bd66: 62da str r2, [r3, #44] @ 0x2c + } + return p; + 800bd68: 697b ldr r3, [r7, #20] +} + 800bd6a: 4618 mov r0, r3 + 800bd6c: 3718 adds r7, #24 + 800bd6e: 46bd mov sp, r7 + 800bd70: bdb0 pop {r4, r5, r7, pc} + 800bd72: bf00 nop + 800bd74: 0801769c .word 0x0801769c + 800bd78: 08017da4 .word 0x08017da4 + 800bd7c: 080176f0 .word 0x080176f0 + +0800bd80 : + +/* Fill in options for control segments */ +static void +tcp_output_fill_options(const struct tcp_pcb *pcb, struct pbuf *p, u8_t optflags, u8_t num_sacks) +{ + 800bd80: b580 push {r7, lr} + 800bd82: b088 sub sp, #32 + 800bd84: af00 add r7, sp, #0 + 800bd86: 60f8 str r0, [r7, #12] + 800bd88: 60b9 str r1, [r7, #8] + 800bd8a: 4611 mov r1, r2 + 800bd8c: 461a mov r2, r3 + 800bd8e: 460b mov r3, r1 + 800bd90: 71fb strb r3, [r7, #7] + 800bd92: 4613 mov r3, r2 + 800bd94: 71bb strb r3, [r7, #6] + struct tcp_hdr *tcphdr; + u32_t *opts; + u16_t sacks_len = 0; + 800bd96: 2300 movs r3, #0 + 800bd98: 83fb strh r3, [r7, #30] + + LWIP_ASSERT("tcp_output_fill_options: invalid pbuf", p != NULL); + 800bd9a: 68bb ldr r3, [r7, #8] + 800bd9c: 2b00 cmp r3, #0 + 800bd9e: d106 bne.n 800bdae + 800bda0: 4b12 ldr r3, [pc, #72] @ (800bdec ) + 800bda2: f240 7256 movw r2, #1878 @ 0x756 + 800bda6: 4912 ldr r1, [pc, #72] @ (800bdf0 ) + 800bda8: 4812 ldr r0, [pc, #72] @ (800bdf4 ) + 800bdaa: f005 fc25 bl 80115f8 + + tcphdr = (struct tcp_hdr *)p->payload; + 800bdae: 68bb ldr r3, [r7, #8] + 800bdb0: 685b ldr r3, [r3, #4] + 800bdb2: 61bb str r3, [r7, #24] + opts = (u32_t *)(void *)(tcphdr + 1); + 800bdb4: 69bb ldr r3, [r7, #24] + 800bdb6: 3314 adds r3, #20 + 800bdb8: 617b str r3, [r7, #20] + opts = LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, tcphdr, pcb, opts); +#endif + + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(sacks_len); + LWIP_ASSERT("options not filled", (u8_t *)opts == ((u8_t *)(tcphdr + 1)) + sacks_len * 4 + LWIP_TCP_OPT_LENGTH_SEGMENT(optflags, pcb)); + 800bdba: 8bfb ldrh r3, [r7, #30] + 800bdbc: 009b lsls r3, r3, #2 + 800bdbe: 461a mov r2, r3 + 800bdc0: 79fb ldrb r3, [r7, #7] + 800bdc2: 009b lsls r3, r3, #2 + 800bdc4: f003 0304 and.w r3, r3, #4 + 800bdc8: 4413 add r3, r2 + 800bdca: 3314 adds r3, #20 + 800bdcc: 69ba ldr r2, [r7, #24] + 800bdce: 4413 add r3, r2 + 800bdd0: 697a ldr r2, [r7, #20] + 800bdd2: 429a cmp r2, r3 + 800bdd4: d006 beq.n 800bde4 + 800bdd6: 4b05 ldr r3, [pc, #20] @ (800bdec ) + 800bdd8: f240 7275 movw r2, #1909 @ 0x775 + 800bddc: 4906 ldr r1, [pc, #24] @ (800bdf8 ) + 800bdde: 4805 ldr r0, [pc, #20] @ (800bdf4 ) + 800bde0: f005 fc0a bl 80115f8 + LWIP_UNUSED_ARG(optflags); /* for LWIP_NOASSERT */ + LWIP_UNUSED_ARG(opts); /* for LWIP_NOASSERT */ +} + 800bde4: bf00 nop + 800bde6: 3720 adds r7, #32 + 800bde8: 46bd mov sp, r7 + 800bdea: bd80 pop {r7, pc} + 800bdec: 0801769c .word 0x0801769c + 800bdf0: 08017dcc .word 0x08017dcc + 800bdf4: 080176f0 .word 0x080176f0 + 800bdf8: 08017cc4 .word 0x08017cc4 + +0800bdfc : + * header checksum and calling ip_output_if while handling netif hints and stats. + */ +static err_t +tcp_output_control_segment(const struct tcp_pcb *pcb, struct pbuf *p, + const ip_addr_t *src, const ip_addr_t *dst) +{ + 800bdfc: b580 push {r7, lr} + 800bdfe: b08a sub sp, #40 @ 0x28 + 800be00: af04 add r7, sp, #16 + 800be02: 60f8 str r0, [r7, #12] + 800be04: 60b9 str r1, [r7, #8] + 800be06: 607a str r2, [r7, #4] + 800be08: 603b str r3, [r7, #0] + err_t err; + struct netif *netif; + + LWIP_ASSERT("tcp_output_control_segment: invalid pbuf", p != NULL); + 800be0a: 68bb ldr r3, [r7, #8] + 800be0c: 2b00 cmp r3, #0 + 800be0e: d106 bne.n 800be1e + 800be10: 4b1c ldr r3, [pc, #112] @ (800be84 ) + 800be12: f240 7287 movw r2, #1927 @ 0x787 + 800be16: 491c ldr r1, [pc, #112] @ (800be88 ) + 800be18: 481c ldr r0, [pc, #112] @ (800be8c ) + 800be1a: f005 fbed bl 80115f8 + + netif = tcp_route(pcb, src, dst); + 800be1e: 683a ldr r2, [r7, #0] + 800be20: 6879 ldr r1, [r7, #4] + 800be22: 68f8 ldr r0, [r7, #12] + 800be24: f7fe ff42 bl 800acac + 800be28: 6138 str r0, [r7, #16] + if (netif == NULL) { + 800be2a: 693b ldr r3, [r7, #16] + 800be2c: 2b00 cmp r3, #0 + 800be2e: d102 bne.n 800be36 + err = ERR_RTE; + 800be30: 23fc movs r3, #252 @ 0xfc + 800be32: 75fb strb r3, [r7, #23] + 800be34: e01c b.n 800be70 + struct tcp_hdr *tcphdr = (struct tcp_hdr *)p->payload; + tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + src, dst); + } +#endif + if (pcb != NULL) { + 800be36: 68fb ldr r3, [r7, #12] + 800be38: 2b00 cmp r3, #0 + 800be3a: d006 beq.n 800be4a + NETIF_SET_HINTS(netif, LWIP_CONST_CAST(struct netif_hint*, &(pcb->netif_hints))); + ttl = pcb->ttl; + 800be3c: 68fb ldr r3, [r7, #12] + 800be3e: 7adb ldrb r3, [r3, #11] + 800be40: 75bb strb r3, [r7, #22] + tos = pcb->tos; + 800be42: 68fb ldr r3, [r7, #12] + 800be44: 7a9b ldrb r3, [r3, #10] + 800be46: 757b strb r3, [r7, #21] + 800be48: e003 b.n 800be52 + } else { + /* Send output with hardcoded TTL/HL since we have no access to the pcb */ + ttl = TCP_TTL; + 800be4a: 23ff movs r3, #255 @ 0xff + 800be4c: 75bb strb r3, [r7, #22] + tos = 0; + 800be4e: 2300 movs r3, #0 + 800be50: 757b strb r3, [r7, #21] + } + TCP_STATS_INC(tcp.xmit); + err = ip_output_if(p, src, dst, ttl, tos, IP_PROTO_TCP, netif); + 800be52: 7dba ldrb r2, [r7, #22] + 800be54: 693b ldr r3, [r7, #16] + 800be56: 9302 str r3, [sp, #8] + 800be58: 2306 movs r3, #6 + 800be5a: 9301 str r3, [sp, #4] + 800be5c: 7d7b ldrb r3, [r7, #21] + 800be5e: 9300 str r3, [sp, #0] + 800be60: 4613 mov r3, r2 + 800be62: 683a ldr r2, [r7, #0] + 800be64: 6879 ldr r1, [r7, #4] + 800be66: 68b8 ldr r0, [r7, #8] + 800be68: f004 f97c bl 8010164 + 800be6c: 4603 mov r3, r0 + 800be6e: 75fb strb r3, [r7, #23] + NETIF_RESET_HINTS(netif); + } + pbuf_free(p); + 800be70: 68b8 ldr r0, [r7, #8] + 800be72: f7fa fdd9 bl 8006a28 + return err; + 800be76: f997 3017 ldrsb.w r3, [r7, #23] +} + 800be7a: 4618 mov r0, r3 + 800be7c: 3718 adds r7, #24 + 800be7e: 46bd mov sp, r7 + 800be80: bd80 pop {r7, pc} + 800be82: bf00 nop + 800be84: 0801769c .word 0x0801769c + 800be88: 08017df4 .word 0x08017df4 + 800be8c: 080176f0 .word 0x080176f0 + +0800be90 : + */ +void +tcp_rst(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno, + const ip_addr_t *local_ip, const ip_addr_t *remote_ip, + u16_t local_port, u16_t remote_port) +{ + 800be90: b590 push {r4, r7, lr} + 800be92: b08b sub sp, #44 @ 0x2c + 800be94: af04 add r7, sp, #16 + 800be96: 60f8 str r0, [r7, #12] + 800be98: 60b9 str r1, [r7, #8] + 800be9a: 607a str r2, [r7, #4] + 800be9c: 603b str r3, [r7, #0] + struct pbuf *p; + u16_t wnd; + u8_t optlen; + + LWIP_ASSERT("tcp_rst: invalid local_ip", local_ip != NULL); + 800be9e: 683b ldr r3, [r7, #0] + 800bea0: 2b00 cmp r3, #0 + 800bea2: d106 bne.n 800beb2 + 800bea4: 4b1f ldr r3, [pc, #124] @ (800bf24 ) + 800bea6: f240 72c4 movw r2, #1988 @ 0x7c4 + 800beaa: 491f ldr r1, [pc, #124] @ (800bf28 ) + 800beac: 481f ldr r0, [pc, #124] @ (800bf2c ) + 800beae: f005 fba3 bl 80115f8 + LWIP_ASSERT("tcp_rst: invalid remote_ip", remote_ip != NULL); + 800beb2: 6abb ldr r3, [r7, #40] @ 0x28 + 800beb4: 2b00 cmp r3, #0 + 800beb6: d106 bne.n 800bec6 + 800beb8: 4b1a ldr r3, [pc, #104] @ (800bf24 ) + 800beba: f240 72c5 movw r2, #1989 @ 0x7c5 + 800bebe: 491c ldr r1, [pc, #112] @ (800bf30 ) + 800bec0: 481a ldr r0, [pc, #104] @ (800bf2c ) + 800bec2: f005 fb99 bl 80115f8 + + optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb); + 800bec6: 2300 movs r3, #0 + 800bec8: 75fb strb r3, [r7, #23] + +#if LWIP_WND_SCALE + wnd = PP_HTONS(((TCP_WND >> TCP_RCV_SCALE) & 0xFFFF)); +#else + wnd = PP_HTONS(TCP_WND); + 800beca: f246 0308 movw r3, #24584 @ 0x6008 + 800bece: 82bb strh r3, [r7, #20] +#endif + + p = tcp_output_alloc_header_common(ackno, optlen, 0, lwip_htonl(seqno), local_port, + 800bed0: 7dfb ldrb r3, [r7, #23] + 800bed2: b29c uxth r4, r3 + 800bed4: 68b8 ldr r0, [r7, #8] + 800bed6: f7f9 fa6c bl 80053b2 + 800beda: 4602 mov r2, r0 + 800bedc: 8abb ldrh r3, [r7, #20] + 800bede: 9303 str r3, [sp, #12] + 800bee0: 2314 movs r3, #20 + 800bee2: 9302 str r3, [sp, #8] + 800bee4: 8e3b ldrh r3, [r7, #48] @ 0x30 + 800bee6: 9301 str r3, [sp, #4] + 800bee8: 8dbb ldrh r3, [r7, #44] @ 0x2c + 800beea: 9300 str r3, [sp, #0] + 800beec: 4613 mov r3, r2 + 800beee: 2200 movs r2, #0 + 800bef0: 4621 mov r1, r4 + 800bef2: 6878 ldr r0, [r7, #4] + 800bef4: f7ff fe94 bl 800bc20 + 800bef8: 6138 str r0, [r7, #16] + remote_port, TCP_RST | TCP_ACK, wnd); + if (p == NULL) { + 800befa: 693b ldr r3, [r7, #16] + 800befc: 2b00 cmp r3, #0 + 800befe: d00c beq.n 800bf1a + LWIP_DEBUGF(TCP_DEBUG, ("tcp_rst: could not allocate memory for pbuf\n")); + return; + } + tcp_output_fill_options(pcb, p, 0, optlen); + 800bf00: 7dfb ldrb r3, [r7, #23] + 800bf02: 2200 movs r2, #0 + 800bf04: 6939 ldr r1, [r7, #16] + 800bf06: 68f8 ldr r0, [r7, #12] + 800bf08: f7ff ff3a bl 800bd80 + + MIB2_STATS_INC(mib2.tcpoutrsts); + + tcp_output_control_segment(pcb, p, local_ip, remote_ip); + 800bf0c: 6abb ldr r3, [r7, #40] @ 0x28 + 800bf0e: 683a ldr r2, [r7, #0] + 800bf10: 6939 ldr r1, [r7, #16] + 800bf12: 68f8 ldr r0, [r7, #12] + 800bf14: f7ff ff72 bl 800bdfc + 800bf18: e000 b.n 800bf1c + return; + 800bf1a: bf00 nop + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno)); +} + 800bf1c: 371c adds r7, #28 + 800bf1e: 46bd mov sp, r7 + 800bf20: bd90 pop {r4, r7, pc} + 800bf22: bf00 nop + 800bf24: 0801769c .word 0x0801769c + 800bf28: 08017e20 .word 0x08017e20 + 800bf2c: 080176f0 .word 0x080176f0 + 800bf30: 08017e3c .word 0x08017e3c + +0800bf34 : + * + * @param pcb Protocol control block for the TCP connection to send the ACK + */ +err_t +tcp_send_empty_ack(struct tcp_pcb *pcb) +{ + 800bf34: b590 push {r4, r7, lr} + 800bf36: b087 sub sp, #28 + 800bf38: af00 add r7, sp, #0 + 800bf3a: 6078 str r0, [r7, #4] + err_t err; + struct pbuf *p; + u8_t optlen, optflags = 0; + 800bf3c: 2300 movs r3, #0 + 800bf3e: 75fb strb r3, [r7, #23] + u8_t num_sacks = 0; + 800bf40: 2300 movs r3, #0 + 800bf42: 75bb strb r3, [r7, #22] + + LWIP_ASSERT("tcp_send_empty_ack: invalid pcb", pcb != NULL); + 800bf44: 687b ldr r3, [r7, #4] + 800bf46: 2b00 cmp r3, #0 + 800bf48: d106 bne.n 800bf58 + 800bf4a: 4b28 ldr r3, [pc, #160] @ (800bfec ) + 800bf4c: f240 72ea movw r2, #2026 @ 0x7ea + 800bf50: 4927 ldr r1, [pc, #156] @ (800bff0 ) + 800bf52: 4828 ldr r0, [pc, #160] @ (800bff4 ) + 800bf54: f005 fb50 bl 80115f8 +#if LWIP_TCP_TIMESTAMPS + if (pcb->flags & TF_TIMESTAMP) { + optflags = TF_SEG_OPTS_TS; + } +#endif + optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(optflags, pcb); + 800bf58: 7dfb ldrb r3, [r7, #23] + 800bf5a: 009b lsls r3, r3, #2 + 800bf5c: b2db uxtb r3, r3 + 800bf5e: f003 0304 and.w r3, r3, #4 + 800bf62: 757b strb r3, [r7, #21] + if ((num_sacks = tcp_get_num_sacks(pcb, optlen)) > 0) { + optlen += 4 + num_sacks * 8; /* 4 bytes for header (including 2*NOP), plus 8B for each SACK */ + } +#endif + + p = tcp_output_alloc_header(pcb, optlen, 0, lwip_htonl(pcb->snd_nxt)); + 800bf64: 7d7b ldrb r3, [r7, #21] + 800bf66: b29c uxth r4, r3 + 800bf68: 687b ldr r3, [r7, #4] + 800bf6a: 6d1b ldr r3, [r3, #80] @ 0x50 + 800bf6c: 4618 mov r0, r3 + 800bf6e: f7f9 fa20 bl 80053b2 + 800bf72: 4603 mov r3, r0 + 800bf74: 2200 movs r2, #0 + 800bf76: 4621 mov r1, r4 + 800bf78: 6878 ldr r0, [r7, #4] + 800bf7a: f7ff fec3 bl 800bd04 + 800bf7e: 6138 str r0, [r7, #16] + if (p == NULL) { + 800bf80: 693b ldr r3, [r7, #16] + 800bf82: 2b00 cmp r3, #0 + 800bf84: d109 bne.n 800bf9a + /* let tcp_fasttmr retry sending this ACK */ + tcp_set_flags(pcb, TF_ACK_DELAY | TF_ACK_NOW); + 800bf86: 687b ldr r3, [r7, #4] + 800bf88: 8b5b ldrh r3, [r3, #26] + 800bf8a: f043 0303 orr.w r3, r3, #3 + 800bf8e: b29a uxth r2, r3 + 800bf90: 687b ldr r3, [r7, #4] + 800bf92: 835a strh r2, [r3, #26] + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: (ACK) could not allocate pbuf\n")); + return ERR_BUF; + 800bf94: f06f 0301 mvn.w r3, #1 + 800bf98: e023 b.n 800bfe2 + } + tcp_output_fill_options(pcb, p, optflags, num_sacks); + 800bf9a: 7dbb ldrb r3, [r7, #22] + 800bf9c: 7dfa ldrb r2, [r7, #23] + 800bf9e: 6939 ldr r1, [r7, #16] + 800bfa0: 6878 ldr r0, [r7, #4] + 800bfa2: f7ff feed bl 800bd80 + pcb->ts_lastacksent = pcb->rcv_nxt; +#endif + + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, + ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt)); + err = tcp_output_control_segment(pcb, p, &pcb->local_ip, &pcb->remote_ip); + 800bfa6: 687a ldr r2, [r7, #4] + 800bfa8: 687b ldr r3, [r7, #4] + 800bfaa: 3304 adds r3, #4 + 800bfac: 6939 ldr r1, [r7, #16] + 800bfae: 6878 ldr r0, [r7, #4] + 800bfb0: f7ff ff24 bl 800bdfc + 800bfb4: 4603 mov r3, r0 + 800bfb6: 73fb strb r3, [r7, #15] + if (err != ERR_OK) { + 800bfb8: f997 300f ldrsb.w r3, [r7, #15] + 800bfbc: 2b00 cmp r3, #0 + 800bfbe: d007 beq.n 800bfd0 + /* let tcp_fasttmr retry sending this ACK */ + tcp_set_flags(pcb, TF_ACK_DELAY | TF_ACK_NOW); + 800bfc0: 687b ldr r3, [r7, #4] + 800bfc2: 8b5b ldrh r3, [r3, #26] + 800bfc4: f043 0303 orr.w r3, r3, #3 + 800bfc8: b29a uxth r2, r3 + 800bfca: 687b ldr r3, [r7, #4] + 800bfcc: 835a strh r2, [r3, #26] + 800bfce: e006 b.n 800bfde + } else { + /* remove ACK flags from the PCB, as we sent an empty ACK now */ + tcp_clear_flags(pcb, TF_ACK_DELAY | TF_ACK_NOW); + 800bfd0: 687b ldr r3, [r7, #4] + 800bfd2: 8b5b ldrh r3, [r3, #26] + 800bfd4: f023 0303 bic.w r3, r3, #3 + 800bfd8: b29a uxth r2, r3 + 800bfda: 687b ldr r3, [r7, #4] + 800bfdc: 835a strh r2, [r3, #26] + } + + return err; + 800bfde: f997 300f ldrsb.w r3, [r7, #15] +} + 800bfe2: 4618 mov r0, r3 + 800bfe4: 371c adds r7, #28 + 800bfe6: 46bd mov sp, r7 + 800bfe8: bd90 pop {r4, r7, pc} + 800bfea: bf00 nop + 800bfec: 0801769c .word 0x0801769c + 800bff0: 08017e58 .word 0x08017e58 + 800bff4: 080176f0 .word 0x080176f0 + +0800bff8 : + * + * @param pcb the tcp_pcb for which to send a keepalive packet + */ +err_t +tcp_keepalive(struct tcp_pcb *pcb) +{ + 800bff8: b590 push {r4, r7, lr} + 800bffa: b087 sub sp, #28 + 800bffc: af00 add r7, sp, #0 + 800bffe: 6078 str r0, [r7, #4] + err_t err; + struct pbuf *p; + u8_t optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb); + 800c000: 2300 movs r3, #0 + 800c002: 75fb strb r3, [r7, #23] + + LWIP_ASSERT("tcp_keepalive: invalid pcb", pcb != NULL); + 800c004: 687b ldr r3, [r7, #4] + 800c006: 2b00 cmp r3, #0 + 800c008: d106 bne.n 800c018 + 800c00a: 4b18 ldr r3, [pc, #96] @ (800c06c ) + 800c00c: f640 0224 movw r2, #2084 @ 0x824 + 800c010: 4917 ldr r1, [pc, #92] @ (800c070 ) + 800c012: 4818 ldr r0, [pc, #96] @ (800c074 ) + 800c014: f005 faf0 bl 80115f8 + LWIP_DEBUGF(TCP_DEBUG, ("\n")); + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent)); + + p = tcp_output_alloc_header(pcb, optlen, 0, lwip_htonl(pcb->snd_nxt - 1)); + 800c018: 7dfb ldrb r3, [r7, #23] + 800c01a: b29c uxth r4, r3 + 800c01c: 687b ldr r3, [r7, #4] + 800c01e: 6d1b ldr r3, [r3, #80] @ 0x50 + 800c020: 3b01 subs r3, #1 + 800c022: 4618 mov r0, r3 + 800c024: f7f9 f9c5 bl 80053b2 + 800c028: 4603 mov r3, r0 + 800c02a: 2200 movs r2, #0 + 800c02c: 4621 mov r1, r4 + 800c02e: 6878 ldr r0, [r7, #4] + 800c030: f7ff fe68 bl 800bd04 + 800c034: 6138 str r0, [r7, #16] + if (p == NULL) { + 800c036: 693b ldr r3, [r7, #16] + 800c038: 2b00 cmp r3, #0 + 800c03a: d102 bne.n 800c042 + LWIP_DEBUGF(TCP_DEBUG, + ("tcp_keepalive: could not allocate memory for pbuf\n")); + return ERR_MEM; + 800c03c: f04f 33ff mov.w r3, #4294967295 + 800c040: e010 b.n 800c064 + } + tcp_output_fill_options(pcb, p, 0, optlen); + 800c042: 7dfb ldrb r3, [r7, #23] + 800c044: 2200 movs r2, #0 + 800c046: 6939 ldr r1, [r7, #16] + 800c048: 6878 ldr r0, [r7, #4] + 800c04a: f7ff fe99 bl 800bd80 + err = tcp_output_control_segment(pcb, p, &pcb->local_ip, &pcb->remote_ip); + 800c04e: 687a ldr r2, [r7, #4] + 800c050: 687b ldr r3, [r7, #4] + 800c052: 3304 adds r3, #4 + 800c054: 6939 ldr r1, [r7, #16] + 800c056: 6878 ldr r0, [r7, #4] + 800c058: f7ff fed0 bl 800bdfc + 800c05c: 4603 mov r3, r0 + 800c05e: 73fb strb r3, [r7, #15] + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F" err %d.\n", + pcb->snd_nxt - 1, pcb->rcv_nxt, (int)err)); + return err; + 800c060: f997 300f ldrsb.w r3, [r7, #15] +} + 800c064: 4618 mov r0, r3 + 800c066: 371c adds r7, #28 + 800c068: 46bd mov sp, r7 + 800c06a: bd90 pop {r4, r7, pc} + 800c06c: 0801769c .word 0x0801769c + 800c070: 08017e78 .word 0x08017e78 + 800c074: 080176f0 .word 0x080176f0 + +0800c078 : + * + * @param pcb the tcp_pcb for which to send a zero-window probe packet + */ +err_t +tcp_zero_window_probe(struct tcp_pcb *pcb) +{ + 800c078: b590 push {r4, r7, lr} + 800c07a: b08b sub sp, #44 @ 0x2c + 800c07c: af00 add r7, sp, #0 + 800c07e: 6078 str r0, [r7, #4] + struct tcp_hdr *tcphdr; + struct tcp_seg *seg; + u16_t len; + u8_t is_fin; + u32_t snd_nxt; + u8_t optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb); + 800c080: 2300 movs r3, #0 + 800c082: f887 3027 strb.w r3, [r7, #39] @ 0x27 + + LWIP_ASSERT("tcp_zero_window_probe: invalid pcb", pcb != NULL); + 800c086: 687b ldr r3, [r7, #4] + 800c088: 2b00 cmp r3, #0 + 800c08a: d106 bne.n 800c09a + 800c08c: 4b4c ldr r3, [pc, #304] @ (800c1c0 ) + 800c08e: f640 024f movw r2, #2127 @ 0x84f + 800c092: 494c ldr r1, [pc, #304] @ (800c1c4 ) + 800c094: 484c ldr r0, [pc, #304] @ (800c1c8 ) + 800c096: f005 faaf bl 80115f8 + ("tcp_zero_window_probe: tcp_ticks %"U32_F + " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent)); + + /* Only consider unsent, persist timer should be off when there is data in-flight */ + seg = pcb->unsent; + 800c09a: 687b ldr r3, [r7, #4] + 800c09c: 6edb ldr r3, [r3, #108] @ 0x6c + 800c09e: 623b str r3, [r7, #32] + if (seg == NULL) { + 800c0a0: 6a3b ldr r3, [r7, #32] + 800c0a2: 2b00 cmp r3, #0 + 800c0a4: d101 bne.n 800c0aa + /* Not expected, persist timer should be off when the send buffer is empty */ + return ERR_OK; + 800c0a6: 2300 movs r3, #0 + 800c0a8: e086 b.n 800c1b8 + + /* increment probe count. NOTE: we record probe even if it fails + to actually transmit due to an error. This ensures memory exhaustion/ + routing problem doesn't leave a zero-window pcb as an indefinite zombie. + RTO mechanism has similar behavior, see pcb->nrtx */ + if (pcb->persist_probe < 0xFF) { + 800c0aa: 687b ldr r3, [r7, #4] + 800c0ac: f893 309a ldrb.w r3, [r3, #154] @ 0x9a + 800c0b0: 2bff cmp r3, #255 @ 0xff + 800c0b2: d007 beq.n 800c0c4 + ++pcb->persist_probe; + 800c0b4: 687b ldr r3, [r7, #4] + 800c0b6: f893 309a ldrb.w r3, [r3, #154] @ 0x9a + 800c0ba: 3301 adds r3, #1 + 800c0bc: b2da uxtb r2, r3 + 800c0be: 687b ldr r3, [r7, #4] + 800c0c0: f883 209a strb.w r2, [r3, #154] @ 0x9a + } + + is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0); + 800c0c4: 6a3b ldr r3, [r7, #32] + 800c0c6: 68db ldr r3, [r3, #12] + 800c0c8: 899b ldrh r3, [r3, #12] + 800c0ca: b29b uxth r3, r3 + 800c0cc: 4618 mov r0, r3 + 800c0ce: f7f9 f95b bl 8005388 + 800c0d2: 4603 mov r3, r0 + 800c0d4: b2db uxtb r3, r3 + 800c0d6: f003 0301 and.w r3, r3, #1 + 800c0da: 2b00 cmp r3, #0 + 800c0dc: d005 beq.n 800c0ea + 800c0de: 6a3b ldr r3, [r7, #32] + 800c0e0: 891b ldrh r3, [r3, #8] + 800c0e2: 2b00 cmp r3, #0 + 800c0e4: d101 bne.n 800c0ea + 800c0e6: 2301 movs r3, #1 + 800c0e8: e000 b.n 800c0ec + 800c0ea: 2300 movs r3, #0 + 800c0ec: 77fb strb r3, [r7, #31] + /* we want to send one seqno: either FIN or data (no options) */ + len = is_fin ? 0 : 1; + 800c0ee: 7ffb ldrb r3, [r7, #31] + 800c0f0: 2b00 cmp r3, #0 + 800c0f2: bf0c ite eq + 800c0f4: 2301 moveq r3, #1 + 800c0f6: 2300 movne r3, #0 + 800c0f8: b2db uxtb r3, r3 + 800c0fa: 83bb strh r3, [r7, #28] + + p = tcp_output_alloc_header(pcb, optlen, len, seg->tcphdr->seqno); + 800c0fc: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800c100: b299 uxth r1, r3 + 800c102: 6a3b ldr r3, [r7, #32] + 800c104: 68db ldr r3, [r3, #12] + 800c106: 685b ldr r3, [r3, #4] + 800c108: 8bba ldrh r2, [r7, #28] + 800c10a: 6878 ldr r0, [r7, #4] + 800c10c: f7ff fdfa bl 800bd04 + 800c110: 61b8 str r0, [r7, #24] + if (p == NULL) { + 800c112: 69bb ldr r3, [r7, #24] + 800c114: 2b00 cmp r3, #0 + 800c116: d102 bne.n 800c11e + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: no memory for pbuf\n")); + return ERR_MEM; + 800c118: f04f 33ff mov.w r3, #4294967295 + 800c11c: e04c b.n 800c1b8 + } + tcphdr = (struct tcp_hdr *)p->payload; + 800c11e: 69bb ldr r3, [r7, #24] + 800c120: 685b ldr r3, [r3, #4] + 800c122: 617b str r3, [r7, #20] + + if (is_fin) { + 800c124: 7ffb ldrb r3, [r7, #31] + 800c126: 2b00 cmp r3, #0 + 800c128: d011 beq.n 800c14e + /* FIN segment, no data */ + TCPH_FLAGS_SET(tcphdr, TCP_ACK | TCP_FIN); + 800c12a: 697b ldr r3, [r7, #20] + 800c12c: 899b ldrh r3, [r3, #12] + 800c12e: b29b uxth r3, r3 + 800c130: b21b sxth r3, r3 + 800c132: f423 537c bic.w r3, r3, #16128 @ 0x3f00 + 800c136: b21c sxth r4, r3 + 800c138: 2011 movs r0, #17 + 800c13a: f7f9 f925 bl 8005388 + 800c13e: 4603 mov r3, r0 + 800c140: b21b sxth r3, r3 + 800c142: 4323 orrs r3, r4 + 800c144: b21b sxth r3, r3 + 800c146: b29a uxth r2, r3 + 800c148: 697b ldr r3, [r7, #20] + 800c14a: 819a strh r2, [r3, #12] + 800c14c: e010 b.n 800c170 + } else { + /* Data segment, copy in one byte from the head of the unacked queue */ + char *d = ((char *)p->payload + TCP_HLEN); + 800c14e: 69bb ldr r3, [r7, #24] + 800c150: 685b ldr r3, [r3, #4] + 800c152: 3314 adds r3, #20 + 800c154: 613b str r3, [r7, #16] + /* Depending on whether the segment has already been sent (unacked) or not + (unsent), seg->p->payload points to the IP header or TCP header. + Ensure we copy the first TCP data byte: */ + pbuf_copy_partial(seg->p, d, 1, seg->p->tot_len - seg->len); + 800c156: 6a3b ldr r3, [r7, #32] + 800c158: 6858 ldr r0, [r3, #4] + 800c15a: 6a3b ldr r3, [r7, #32] + 800c15c: 685b ldr r3, [r3, #4] + 800c15e: 891a ldrh r2, [r3, #8] + 800c160: 6a3b ldr r3, [r7, #32] + 800c162: 891b ldrh r3, [r3, #8] + 800c164: 1ad3 subs r3, r2, r3 + 800c166: b29b uxth r3, r3 + 800c168: 2201 movs r2, #1 + 800c16a: 6939 ldr r1, [r7, #16] + 800c16c: f7fa fe56 bl 8006e1c + } + + /* The byte may be acknowledged without the window being opened. */ + snd_nxt = lwip_ntohl(seg->tcphdr->seqno) + 1; + 800c170: 6a3b ldr r3, [r7, #32] + 800c172: 68db ldr r3, [r3, #12] + 800c174: 685b ldr r3, [r3, #4] + 800c176: 4618 mov r0, r3 + 800c178: f7f9 f91b bl 80053b2 + 800c17c: 4603 mov r3, r0 + 800c17e: 3301 adds r3, #1 + 800c180: 60fb str r3, [r7, #12] + if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) { + 800c182: 687b ldr r3, [r7, #4] + 800c184: 6d1a ldr r2, [r3, #80] @ 0x50 + 800c186: 68fb ldr r3, [r7, #12] + 800c188: 1ad3 subs r3, r2, r3 + 800c18a: 2b00 cmp r3, #0 + 800c18c: da02 bge.n 800c194 + pcb->snd_nxt = snd_nxt; + 800c18e: 687b ldr r3, [r7, #4] + 800c190: 68fa ldr r2, [r7, #12] + 800c192: 651a str r2, [r3, #80] @ 0x50 + } + tcp_output_fill_options(pcb, p, 0, optlen); + 800c194: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800c198: 2200 movs r2, #0 + 800c19a: 69b9 ldr r1, [r7, #24] + 800c19c: 6878 ldr r0, [r7, #4] + 800c19e: f7ff fdef bl 800bd80 + + err = tcp_output_control_segment(pcb, p, &pcb->local_ip, &pcb->remote_ip); + 800c1a2: 687a ldr r2, [r7, #4] + 800c1a4: 687b ldr r3, [r7, #4] + 800c1a6: 3304 adds r3, #4 + 800c1a8: 69b9 ldr r1, [r7, #24] + 800c1aa: 6878 ldr r0, [r7, #4] + 800c1ac: f7ff fe26 bl 800bdfc + 800c1b0: 4603 mov r3, r0 + 800c1b2: 72fb strb r3, [r7, #11] + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F + " ackno %"U32_F" err %d.\n", + pcb->snd_nxt - 1, pcb->rcv_nxt, (int)err)); + return err; + 800c1b4: f997 300b ldrsb.w r3, [r7, #11] +} + 800c1b8: 4618 mov r0, r3 + 800c1ba: 372c adds r7, #44 @ 0x2c + 800c1bc: 46bd mov sp, r7 + 800c1be: bd90 pop {r4, r7, pc} + 800c1c0: 0801769c .word 0x0801769c + 800c1c4: 08017e94 .word 0x08017e94 + 800c1c8: 080176f0 .word 0x080176f0 + +0800c1cc : + * + * @param arg unused argument + */ +static void +tcpip_tcp_timer(void *arg) +{ + 800c1cc: b580 push {r7, lr} + 800c1ce: b082 sub sp, #8 + 800c1d0: af00 add r7, sp, #0 + 800c1d2: 6078 str r0, [r7, #4] + LWIP_UNUSED_ARG(arg); + + /* call TCP timer handler */ + tcp_tmr(); + 800c1d4: f7fa ff10 bl 8006ff8 + /* timer still needed? */ + if (tcp_active_pcbs || tcp_tw_pcbs) { + 800c1d8: 4b0a ldr r3, [pc, #40] @ (800c204 ) + 800c1da: 681b ldr r3, [r3, #0] + 800c1dc: 2b00 cmp r3, #0 + 800c1de: d103 bne.n 800c1e8 + 800c1e0: 4b09 ldr r3, [pc, #36] @ (800c208 ) + 800c1e2: 681b ldr r3, [r3, #0] + 800c1e4: 2b00 cmp r3, #0 + 800c1e6: d005 beq.n 800c1f4 + /* restart timer */ + sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); + 800c1e8: 2200 movs r2, #0 + 800c1ea: 4908 ldr r1, [pc, #32] @ (800c20c ) + 800c1ec: 20fa movs r0, #250 @ 0xfa + 800c1ee: f000 f8f3 bl 800c3d8 + 800c1f2: e003 b.n 800c1fc + } else { + /* disable timer */ + tcpip_tcp_timer_active = 0; + 800c1f4: 4b06 ldr r3, [pc, #24] @ (800c210 ) + 800c1f6: 2200 movs r2, #0 + 800c1f8: 601a str r2, [r3, #0] + } +} + 800c1fa: bf00 nop + 800c1fc: bf00 nop + 800c1fe: 3708 adds r7, #8 + 800c200: 46bd mov sp, r7 + 800c202: bd80 pop {r7, pc} + 800c204: 200190b0 .word 0x200190b0 + 800c208: 200190b4 .word 0x200190b4 + 800c20c: 0800c1cd .word 0x0800c1cd + 800c210: 200190fc .word 0x200190fc + +0800c214 : + * the reason is to have the TCP timer only running when + * there are active (or time-wait) PCBs. + */ +void +tcp_timer_needed(void) +{ + 800c214: b580 push {r7, lr} + 800c216: af00 add r7, sp, #0 + LWIP_ASSERT_CORE_LOCKED(); + + /* timer is off but needed again? */ + if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) { + 800c218: 4b0a ldr r3, [pc, #40] @ (800c244 ) + 800c21a: 681b ldr r3, [r3, #0] + 800c21c: 2b00 cmp r3, #0 + 800c21e: d10f bne.n 800c240 + 800c220: 4b09 ldr r3, [pc, #36] @ (800c248 ) + 800c222: 681b ldr r3, [r3, #0] + 800c224: 2b00 cmp r3, #0 + 800c226: d103 bne.n 800c230 + 800c228: 4b08 ldr r3, [pc, #32] @ (800c24c ) + 800c22a: 681b ldr r3, [r3, #0] + 800c22c: 2b00 cmp r3, #0 + 800c22e: d007 beq.n 800c240 + /* enable and start timer */ + tcpip_tcp_timer_active = 1; + 800c230: 4b04 ldr r3, [pc, #16] @ (800c244 ) + 800c232: 2201 movs r2, #1 + 800c234: 601a str r2, [r3, #0] + sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); + 800c236: 2200 movs r2, #0 + 800c238: 4905 ldr r1, [pc, #20] @ (800c250 ) + 800c23a: 20fa movs r0, #250 @ 0xfa + 800c23c: f000 f8cc bl 800c3d8 + } +} + 800c240: bf00 nop + 800c242: bd80 pop {r7, pc} + 800c244: 200190fc .word 0x200190fc + 800c248: 200190b0 .word 0x200190b0 + 800c24c: 200190b4 .word 0x200190b4 + 800c250: 0800c1cd .word 0x0800c1cd + +0800c254 : +#if LWIP_DEBUG_TIMERNAMES +sys_timeout_abs(u32_t abs_time, sys_timeout_handler handler, void *arg, const char *handler_name) +#else /* LWIP_DEBUG_TIMERNAMES */ +sys_timeout_abs(u32_t abs_time, sys_timeout_handler handler, void *arg) +#endif +{ + 800c254: b580 push {r7, lr} + 800c256: b086 sub sp, #24 + 800c258: af00 add r7, sp, #0 + 800c25a: 60f8 str r0, [r7, #12] + 800c25c: 60b9 str r1, [r7, #8] + 800c25e: 607a str r2, [r7, #4] + struct sys_timeo *timeout, *t; + + timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT); + 800c260: 2006 movs r0, #6 + 800c262: f7f9 fcf1 bl 8005c48 + 800c266: 6138 str r0, [r7, #16] + if (timeout == NULL) { + 800c268: 693b ldr r3, [r7, #16] + 800c26a: 2b00 cmp r3, #0 + 800c26c: d109 bne.n 800c282 + LWIP_ASSERT("sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout != NULL); + 800c26e: 693b ldr r3, [r7, #16] + 800c270: 2b00 cmp r3, #0 + 800c272: d151 bne.n 800c318 + 800c274: 4b2a ldr r3, [pc, #168] @ (800c320 ) + 800c276: 22be movs r2, #190 @ 0xbe + 800c278: 492a ldr r1, [pc, #168] @ (800c324 ) + 800c27a: 482b ldr r0, [pc, #172] @ (800c328 ) + 800c27c: f005 f9bc bl 80115f8 + return; + 800c280: e04a b.n 800c318 + } + + timeout->next = NULL; + 800c282: 693b ldr r3, [r7, #16] + 800c284: 2200 movs r2, #0 + 800c286: 601a str r2, [r3, #0] + timeout->h = handler; + 800c288: 693b ldr r3, [r7, #16] + 800c28a: 68ba ldr r2, [r7, #8] + 800c28c: 609a str r2, [r3, #8] + timeout->arg = arg; + 800c28e: 693b ldr r3, [r7, #16] + 800c290: 687a ldr r2, [r7, #4] + 800c292: 60da str r2, [r3, #12] + timeout->time = abs_time; + 800c294: 693b ldr r3, [r7, #16] + 800c296: 68fa ldr r2, [r7, #12] + 800c298: 605a str r2, [r3, #4] + timeout->handler_name = handler_name; + LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p abs_time=%"U32_F" handler=%s arg=%p\n", + (void *)timeout, abs_time, handler_name, (void *)arg)); +#endif /* LWIP_DEBUG_TIMERNAMES */ + + if (next_timeout == NULL) { + 800c29a: 4b24 ldr r3, [pc, #144] @ (800c32c ) + 800c29c: 681b ldr r3, [r3, #0] + 800c29e: 2b00 cmp r3, #0 + 800c2a0: d103 bne.n 800c2aa + next_timeout = timeout; + 800c2a2: 4a22 ldr r2, [pc, #136] @ (800c32c ) + 800c2a4: 693b ldr r3, [r7, #16] + 800c2a6: 6013 str r3, [r2, #0] + return; + 800c2a8: e037 b.n 800c31a + } + if (TIME_LESS_THAN(timeout->time, next_timeout->time)) { + 800c2aa: 693b ldr r3, [r7, #16] + 800c2ac: 685a ldr r2, [r3, #4] + 800c2ae: 4b1f ldr r3, [pc, #124] @ (800c32c ) + 800c2b0: 681b ldr r3, [r3, #0] + 800c2b2: 685b ldr r3, [r3, #4] + 800c2b4: 1ad3 subs r3, r2, r3 + 800c2b6: 0fdb lsrs r3, r3, #31 + 800c2b8: f003 0301 and.w r3, r3, #1 + 800c2bc: b2db uxtb r3, r3 + 800c2be: 2b00 cmp r3, #0 + 800c2c0: d007 beq.n 800c2d2 + timeout->next = next_timeout; + 800c2c2: 4b1a ldr r3, [pc, #104] @ (800c32c ) + 800c2c4: 681a ldr r2, [r3, #0] + 800c2c6: 693b ldr r3, [r7, #16] + 800c2c8: 601a str r2, [r3, #0] + next_timeout = timeout; + 800c2ca: 4a18 ldr r2, [pc, #96] @ (800c32c ) + 800c2cc: 693b ldr r3, [r7, #16] + 800c2ce: 6013 str r3, [r2, #0] + 800c2d0: e023 b.n 800c31a + } else { + for (t = next_timeout; t != NULL; t = t->next) { + 800c2d2: 4b16 ldr r3, [pc, #88] @ (800c32c ) + 800c2d4: 681b ldr r3, [r3, #0] + 800c2d6: 617b str r3, [r7, #20] + 800c2d8: e01a b.n 800c310 + if ((t->next == NULL) || TIME_LESS_THAN(timeout->time, t->next->time)) { + 800c2da: 697b ldr r3, [r7, #20] + 800c2dc: 681b ldr r3, [r3, #0] + 800c2de: 2b00 cmp r3, #0 + 800c2e0: d00b beq.n 800c2fa + 800c2e2: 693b ldr r3, [r7, #16] + 800c2e4: 685a ldr r2, [r3, #4] + 800c2e6: 697b ldr r3, [r7, #20] + 800c2e8: 681b ldr r3, [r3, #0] + 800c2ea: 685b ldr r3, [r3, #4] + 800c2ec: 1ad3 subs r3, r2, r3 + 800c2ee: 0fdb lsrs r3, r3, #31 + 800c2f0: f003 0301 and.w r3, r3, #1 + 800c2f4: b2db uxtb r3, r3 + 800c2f6: 2b00 cmp r3, #0 + 800c2f8: d007 beq.n 800c30a + timeout->next = t->next; + 800c2fa: 697b ldr r3, [r7, #20] + 800c2fc: 681a ldr r2, [r3, #0] + 800c2fe: 693b ldr r3, [r7, #16] + 800c300: 601a str r2, [r3, #0] + t->next = timeout; + 800c302: 697b ldr r3, [r7, #20] + 800c304: 693a ldr r2, [r7, #16] + 800c306: 601a str r2, [r3, #0] + break; + 800c308: e007 b.n 800c31a + for (t = next_timeout; t != NULL; t = t->next) { + 800c30a: 697b ldr r3, [r7, #20] + 800c30c: 681b ldr r3, [r3, #0] + 800c30e: 617b str r3, [r7, #20] + 800c310: 697b ldr r3, [r7, #20] + 800c312: 2b00 cmp r3, #0 + 800c314: d1e1 bne.n 800c2da + 800c316: e000 b.n 800c31a + return; + 800c318: bf00 nop + } + } + } +} + 800c31a: 3718 adds r7, #24 + 800c31c: 46bd mov sp, r7 + 800c31e: bd80 pop {r7, pc} + 800c320: 08017eb8 .word 0x08017eb8 + 800c324: 08017eec .word 0x08017eec + 800c328: 08017f2c .word 0x08017f2c + 800c32c: 200190f4 .word 0x200190f4 + +0800c330 : +#if !LWIP_TESTMODE +static +#endif +void +lwip_cyclic_timer(void *arg) +{ + 800c330: b580 push {r7, lr} + 800c332: b086 sub sp, #24 + 800c334: af00 add r7, sp, #0 + 800c336: 6078 str r0, [r7, #4] + u32_t now; + u32_t next_timeout_time; + const struct lwip_cyclic_timer *cyclic = (const struct lwip_cyclic_timer *)arg; + 800c338: 687b ldr r3, [r7, #4] + 800c33a: 617b str r3, [r7, #20] + +#if LWIP_DEBUG_TIMERNAMES + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: %s()\n", cyclic->handler_name)); +#endif + cyclic->handler(); + 800c33c: 697b ldr r3, [r7, #20] + 800c33e: 685b ldr r3, [r3, #4] + 800c340: 4798 blx r3 + + now = sys_now(); + 800c342: f7f8 fe09 bl 8004f58 + 800c346: 6138 str r0, [r7, #16] + next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */ + 800c348: 697b ldr r3, [r7, #20] + 800c34a: 681a ldr r2, [r3, #0] + 800c34c: 4b0f ldr r3, [pc, #60] @ (800c38c ) + 800c34e: 681b ldr r3, [r3, #0] + 800c350: 4413 add r3, r2 + 800c352: 60fb str r3, [r7, #12] + if (TIME_LESS_THAN(next_timeout_time, now)) { + 800c354: 68fa ldr r2, [r7, #12] + 800c356: 693b ldr r3, [r7, #16] + 800c358: 1ad3 subs r3, r2, r3 + 800c35a: 0fdb lsrs r3, r3, #31 + 800c35c: f003 0301 and.w r3, r3, #1 + 800c360: b2db uxtb r3, r3 + 800c362: 2b00 cmp r3, #0 + 800c364: d009 beq.n 800c37a + /* timer would immediately expire again -> "overload" -> restart without any correction */ +#if LWIP_DEBUG_TIMERNAMES + sys_timeout_abs((u32_t)(now + cyclic->interval_ms), lwip_cyclic_timer, arg, cyclic->handler_name); +#else + sys_timeout_abs((u32_t)(now + cyclic->interval_ms), lwip_cyclic_timer, arg); + 800c366: 697b ldr r3, [r7, #20] + 800c368: 681a ldr r2, [r3, #0] + 800c36a: 693b ldr r3, [r7, #16] + 800c36c: 4413 add r3, r2 + 800c36e: 687a ldr r2, [r7, #4] + 800c370: 4907 ldr r1, [pc, #28] @ (800c390 ) + 800c372: 4618 mov r0, r3 + 800c374: f7ff ff6e bl 800c254 + sys_timeout_abs(next_timeout_time, lwip_cyclic_timer, arg, cyclic->handler_name); +#else + sys_timeout_abs(next_timeout_time, lwip_cyclic_timer, arg); +#endif + } +} + 800c378: e004 b.n 800c384 + sys_timeout_abs(next_timeout_time, lwip_cyclic_timer, arg); + 800c37a: 687a ldr r2, [r7, #4] + 800c37c: 4904 ldr r1, [pc, #16] @ (800c390 ) + 800c37e: 68f8 ldr r0, [r7, #12] + 800c380: f7ff ff68 bl 800c254 +} + 800c384: bf00 nop + 800c386: 3718 adds r7, #24 + 800c388: 46bd mov sp, r7 + 800c38a: bd80 pop {r7, pc} + 800c38c: 200190f8 .word 0x200190f8 + 800c390: 0800c331 .word 0x0800c331 + +0800c394 : + +/** Initialize this module */ +void sys_timeouts_init(void) +{ + 800c394: b580 push {r7, lr} + 800c396: b082 sub sp, #8 + 800c398: af00 add r7, sp, #0 + size_t i; + /* tcp_tmr() at index 0 is started on demand */ + for (i = (LWIP_TCP ? 1 : 0); i < LWIP_ARRAYSIZE(lwip_cyclic_timers); i++) { + 800c39a: 2301 movs r3, #1 + 800c39c: 607b str r3, [r7, #4] + 800c39e: e00e b.n 800c3be + /* we have to cast via size_t to get rid of const warning + (this is OK as cyclic_timer() casts back to const* */ + sys_timeout(lwip_cyclic_timers[i].interval_ms, lwip_cyclic_timer, LWIP_CONST_CAST(void *, &lwip_cyclic_timers[i])); + 800c3a0: 4a0b ldr r2, [pc, #44] @ (800c3d0 ) + 800c3a2: 687b ldr r3, [r7, #4] + 800c3a4: f852 0033 ldr.w r0, [r2, r3, lsl #3] + 800c3a8: 687b ldr r3, [r7, #4] + 800c3aa: 00db lsls r3, r3, #3 + 800c3ac: 4a08 ldr r2, [pc, #32] @ (800c3d0 ) + 800c3ae: 4413 add r3, r2 + 800c3b0: 461a mov r2, r3 + 800c3b2: 4908 ldr r1, [pc, #32] @ (800c3d4 ) + 800c3b4: f000 f810 bl 800c3d8 + for (i = (LWIP_TCP ? 1 : 0); i < LWIP_ARRAYSIZE(lwip_cyclic_timers); i++) { + 800c3b8: 687b ldr r3, [r7, #4] + 800c3ba: 3301 adds r3, #1 + 800c3bc: 607b str r3, [r7, #4] + 800c3be: 687b ldr r3, [r7, #4] + 800c3c0: 2b04 cmp r3, #4 + 800c3c2: d9ed bls.n 800c3a0 + } +} + 800c3c4: bf00 nop + 800c3c6: bf00 nop + 800c3c8: 3708 adds r7, #8 + 800c3ca: 46bd mov sp, r7 + 800c3cc: bd80 pop {r7, pc} + 800c3ce: bf00 nop + 800c3d0: 08018eac .word 0x08018eac + 800c3d4: 0800c331 .word 0x0800c331 + +0800c3d8 : +sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char *handler_name) +#else /* LWIP_DEBUG_TIMERNAMES */ +void +sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) +#endif /* LWIP_DEBUG_TIMERNAMES */ +{ + 800c3d8: b580 push {r7, lr} + 800c3da: b086 sub sp, #24 + 800c3dc: af00 add r7, sp, #0 + 800c3de: 60f8 str r0, [r7, #12] + 800c3e0: 60b9 str r1, [r7, #8] + 800c3e2: 607a str r2, [r7, #4] + u32_t next_timeout_time; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ASSERT("Timeout time too long, max is LWIP_UINT32_MAX/4 msecs", msecs <= (LWIP_UINT32_MAX / 4)); + 800c3e4: 68fb ldr r3, [r7, #12] + 800c3e6: f1b3 4f80 cmp.w r3, #1073741824 @ 0x40000000 + 800c3ea: d306 bcc.n 800c3fa + 800c3ec: 4b0a ldr r3, [pc, #40] @ (800c418 ) + 800c3ee: f240 1229 movw r2, #297 @ 0x129 + 800c3f2: 490a ldr r1, [pc, #40] @ (800c41c ) + 800c3f4: 480a ldr r0, [pc, #40] @ (800c420 ) + 800c3f6: f005 f8ff bl 80115f8 + + next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */ + 800c3fa: f7f8 fdad bl 8004f58 + 800c3fe: 4602 mov r2, r0 + 800c400: 68fb ldr r3, [r7, #12] + 800c402: 4413 add r3, r2 + 800c404: 617b str r3, [r7, #20] + +#if LWIP_DEBUG_TIMERNAMES + sys_timeout_abs(next_timeout_time, handler, arg, handler_name); +#else + sys_timeout_abs(next_timeout_time, handler, arg); + 800c406: 687a ldr r2, [r7, #4] + 800c408: 68b9 ldr r1, [r7, #8] + 800c40a: 6978 ldr r0, [r7, #20] + 800c40c: f7ff ff22 bl 800c254 +#endif +} + 800c410: bf00 nop + 800c412: 3718 adds r7, #24 + 800c414: 46bd mov sp, r7 + 800c416: bd80 pop {r7, pc} + 800c418: 08017eb8 .word 0x08017eb8 + 800c41c: 08017f54 .word 0x08017f54 + 800c420: 08017f2c .word 0x08017f2c + +0800c424 : + * + * Must be called periodically from your main loop. + */ +void +sys_check_timeouts(void) +{ + 800c424: b580 push {r7, lr} + 800c426: b084 sub sp, #16 + 800c428: af00 add r7, sp, #0 + u32_t now; + + LWIP_ASSERT_CORE_LOCKED(); + + /* Process only timers expired at the start of the function. */ + now = sys_now(); + 800c42a: f7f8 fd95 bl 8004f58 + 800c42e: 60f8 str r0, [r7, #12] + do { + struct sys_timeo *tmptimeout; + sys_timeout_handler handler; + void *arg; + + PBUF_CHECK_FREE_OOSEQ(); + 800c430: 4b1a ldr r3, [pc, #104] @ (800c49c ) + 800c432: 781b ldrb r3, [r3, #0] + 800c434: b2db uxtb r3, r3 + 800c436: 2b00 cmp r3, #0 + 800c438: d001 beq.n 800c43e + 800c43a: f7f9 ffbd bl 80063b8 + + tmptimeout = next_timeout; + 800c43e: 4b18 ldr r3, [pc, #96] @ (800c4a0 ) + 800c440: 681b ldr r3, [r3, #0] + 800c442: 60bb str r3, [r7, #8] + if (tmptimeout == NULL) { + 800c444: 68bb ldr r3, [r7, #8] + 800c446: 2b00 cmp r3, #0 + 800c448: d022 beq.n 800c490 + return; + } + + if (TIME_LESS_THAN(now, tmptimeout->time)) { + 800c44a: 68bb ldr r3, [r7, #8] + 800c44c: 685b ldr r3, [r3, #4] + 800c44e: 68fa ldr r2, [r7, #12] + 800c450: 1ad3 subs r3, r2, r3 + 800c452: 0fdb lsrs r3, r3, #31 + 800c454: f003 0301 and.w r3, r3, #1 + 800c458: b2db uxtb r3, r3 + 800c45a: 2b00 cmp r3, #0 + 800c45c: d11a bne.n 800c494 + return; + } + + /* Timeout has expired */ + next_timeout = tmptimeout->next; + 800c45e: 68bb ldr r3, [r7, #8] + 800c460: 681b ldr r3, [r3, #0] + 800c462: 4a0f ldr r2, [pc, #60] @ (800c4a0 ) + 800c464: 6013 str r3, [r2, #0] + handler = tmptimeout->h; + 800c466: 68bb ldr r3, [r7, #8] + 800c468: 689b ldr r3, [r3, #8] + 800c46a: 607b str r3, [r7, #4] + arg = tmptimeout->arg; + 800c46c: 68bb ldr r3, [r7, #8] + 800c46e: 68db ldr r3, [r3, #12] + 800c470: 603b str r3, [r7, #0] + current_timeout_due_time = tmptimeout->time; + 800c472: 68bb ldr r3, [r7, #8] + 800c474: 685b ldr r3, [r3, #4] + 800c476: 4a0b ldr r2, [pc, #44] @ (800c4a4 ) + 800c478: 6013 str r3, [r2, #0] + if (handler != NULL) { + LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%s t=%"U32_F" arg=%p\n", + tmptimeout->handler_name, sys_now() - tmptimeout->time, arg)); + } +#endif /* LWIP_DEBUG_TIMERNAMES */ + memp_free(MEMP_SYS_TIMEOUT, tmptimeout); + 800c47a: 68b9 ldr r1, [r7, #8] + 800c47c: 2006 movs r0, #6 + 800c47e: f7f9 fc53 bl 8005d28 + if (handler != NULL) { + 800c482: 687b ldr r3, [r7, #4] + 800c484: 2b00 cmp r3, #0 + 800c486: d0d3 beq.n 800c430 + handler(arg); + 800c488: 687b ldr r3, [r7, #4] + 800c48a: 6838 ldr r0, [r7, #0] + 800c48c: 4798 blx r3 + do { + 800c48e: e7cf b.n 800c430 + return; + 800c490: bf00 nop + 800c492: e000 b.n 800c496 + return; + 800c494: bf00 nop + } + LWIP_TCPIP_THREAD_ALIVE(); + + /* Repeat until all expired timers have been called */ + } while (1); +} + 800c496: 3710 adds r7, #16 + 800c498: 46bd mov sp, r7 + 800c49a: bd80 pop {r7, pc} + 800c49c: 200190a1 .word 0x200190a1 + 800c4a0: 200190f4 .word 0x200190f4 + 800c4a4: 200190f8 .word 0x200190f8 + +0800c4a8 : +/** + * Initialize this module. + */ +void +udp_init(void) +{ + 800c4a8: b580 push {r7, lr} + 800c4aa: af00 add r7, sp, #0 +#ifdef LWIP_RAND + udp_port = UDP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND()); + 800c4ac: f004 ffc6 bl 801143c + 800c4b0: 4603 mov r3, r0 + 800c4b2: b29b uxth r3, r3 + 800c4b4: f3c3 030d ubfx r3, r3, #0, #14 + 800c4b8: b29b uxth r3, r3 + 800c4ba: f5a3 4380 sub.w r3, r3, #16384 @ 0x4000 + 800c4be: b29a uxth r2, r3 + 800c4c0: 4b01 ldr r3, [pc, #4] @ (800c4c8 ) + 800c4c2: 801a strh r2, [r3, #0] +#endif /* LWIP_RAND */ +} + 800c4c4: bf00 nop + 800c4c6: bd80 pop {r7, pc} + 800c4c8: 20000028 .word 0x20000028 + +0800c4cc : + * + * @return a new (free) local UDP port number + */ +static u16_t +udp_new_port(void) +{ + 800c4cc: b480 push {r7} + 800c4ce: b083 sub sp, #12 + 800c4d0: af00 add r7, sp, #0 + u16_t n = 0; + 800c4d2: 2300 movs r3, #0 + 800c4d4: 80fb strh r3, [r7, #6] + struct udp_pcb *pcb; + +again: + if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) { + 800c4d6: 4b17 ldr r3, [pc, #92] @ (800c534 ) + 800c4d8: 881b ldrh r3, [r3, #0] + 800c4da: 1c5a adds r2, r3, #1 + 800c4dc: b291 uxth r1, r2 + 800c4de: 4a15 ldr r2, [pc, #84] @ (800c534 ) + 800c4e0: 8011 strh r1, [r2, #0] + 800c4e2: f64f 72ff movw r2, #65535 @ 0xffff + 800c4e6: 4293 cmp r3, r2 + 800c4e8: d103 bne.n 800c4f2 + udp_port = UDP_LOCAL_PORT_RANGE_START; + 800c4ea: 4b12 ldr r3, [pc, #72] @ (800c534 ) + 800c4ec: f44f 4240 mov.w r2, #49152 @ 0xc000 + 800c4f0: 801a strh r2, [r3, #0] + } + /* Check all PCBs. */ + for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + 800c4f2: 4b11 ldr r3, [pc, #68] @ (800c538 ) + 800c4f4: 681b ldr r3, [r3, #0] + 800c4f6: 603b str r3, [r7, #0] + 800c4f8: e011 b.n 800c51e + if (pcb->local_port == udp_port) { + 800c4fa: 683b ldr r3, [r7, #0] + 800c4fc: 8a5a ldrh r2, [r3, #18] + 800c4fe: 4b0d ldr r3, [pc, #52] @ (800c534 ) + 800c500: 881b ldrh r3, [r3, #0] + 800c502: 429a cmp r2, r3 + 800c504: d108 bne.n 800c518 + if (++n > (UDP_LOCAL_PORT_RANGE_END - UDP_LOCAL_PORT_RANGE_START)) { + 800c506: 88fb ldrh r3, [r7, #6] + 800c508: 3301 adds r3, #1 + 800c50a: 80fb strh r3, [r7, #6] + 800c50c: 88fb ldrh r3, [r7, #6] + 800c50e: f5b3 4f80 cmp.w r3, #16384 @ 0x4000 + 800c512: d3e0 bcc.n 800c4d6 + return 0; + 800c514: 2300 movs r3, #0 + 800c516: e007 b.n 800c528 + for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + 800c518: 683b ldr r3, [r7, #0] + 800c51a: 68db ldr r3, [r3, #12] + 800c51c: 603b str r3, [r7, #0] + 800c51e: 683b ldr r3, [r7, #0] + 800c520: 2b00 cmp r3, #0 + 800c522: d1ea bne.n 800c4fa + } + goto again; + } + } + return udp_port; + 800c524: 4b03 ldr r3, [pc, #12] @ (800c534 ) + 800c526: 881b ldrh r3, [r3, #0] +} + 800c528: 4618 mov r0, r3 + 800c52a: 370c adds r7, #12 + 800c52c: 46bd mov sp, r7 + 800c52e: f85d 7b04 ldr.w r7, [sp], #4 + 800c532: 4770 bx lr + 800c534: 20000028 .word 0x20000028 + 800c538: 20019100 .word 0x20019100 + +0800c53c : + * @param broadcast 1 if his is an IPv4 broadcast (global or subnet-only), 0 otherwise (only used for IPv4) + * @return 1 on match, 0 otherwise + */ +static u8_t +udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast) +{ + 800c53c: b580 push {r7, lr} + 800c53e: b084 sub sp, #16 + 800c540: af00 add r7, sp, #0 + 800c542: 60f8 str r0, [r7, #12] + 800c544: 60b9 str r1, [r7, #8] + 800c546: 4613 mov r3, r2 + 800c548: 71fb strb r3, [r7, #7] + LWIP_UNUSED_ARG(inp); /* in IPv6 only case */ + LWIP_UNUSED_ARG(broadcast); /* in IPv6 only case */ + + LWIP_ASSERT("udp_input_local_match: invalid pcb", pcb != NULL); + 800c54a: 68fb ldr r3, [r7, #12] + 800c54c: 2b00 cmp r3, #0 + 800c54e: d105 bne.n 800c55c + 800c550: 4b27 ldr r3, [pc, #156] @ (800c5f0 ) + 800c552: 2287 movs r2, #135 @ 0x87 + 800c554: 4927 ldr r1, [pc, #156] @ (800c5f4 ) + 800c556: 4828 ldr r0, [pc, #160] @ (800c5f8 ) + 800c558: f005 f84e bl 80115f8 + LWIP_ASSERT("udp_input_local_match: invalid netif", inp != NULL); + 800c55c: 68bb ldr r3, [r7, #8] + 800c55e: 2b00 cmp r3, #0 + 800c560: d105 bne.n 800c56e + 800c562: 4b23 ldr r3, [pc, #140] @ (800c5f0 ) + 800c564: 2288 movs r2, #136 @ 0x88 + 800c566: 4925 ldr r1, [pc, #148] @ (800c5fc ) + 800c568: 4823 ldr r0, [pc, #140] @ (800c5f8 ) + 800c56a: f005 f845 bl 80115f8 + + /* check if PCB is bound to specific netif */ + if ((pcb->netif_idx != NETIF_NO_INDEX) && + 800c56e: 68fb ldr r3, [r7, #12] + 800c570: 7a1b ldrb r3, [r3, #8] + 800c572: 2b00 cmp r3, #0 + 800c574: d00b beq.n 800c58e + (pcb->netif_idx != netif_get_index(ip_data.current_input_netif))) { + 800c576: 68fb ldr r3, [r7, #12] + 800c578: 7a1a ldrb r2, [r3, #8] + 800c57a: 4b21 ldr r3, [pc, #132] @ (800c600 ) + 800c57c: 685b ldr r3, [r3, #4] + 800c57e: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 800c582: 3301 adds r3, #1 + 800c584: b2db uxtb r3, r3 + if ((pcb->netif_idx != NETIF_NO_INDEX) && + 800c586: 429a cmp r2, r3 + 800c588: d001 beq.n 800c58e + return 0; + 800c58a: 2300 movs r3, #0 + 800c58c: e02b b.n 800c5e6 + /* Only need to check PCB if incoming IP version matches PCB IP version */ + if (IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ip_current_dest_addr())) { +#if LWIP_IPV4 + /* Special case: IPv4 broadcast: all or broadcasts in my subnet + * Note: broadcast variable can only be 1 if it is an IPv4 broadcast */ + if (broadcast != 0) { + 800c58e: 79fb ldrb r3, [r7, #7] + 800c590: 2b00 cmp r3, #0 + 800c592: d018 beq.n 800c5c6 +#if IP_SOF_BROADCAST_RECV + if (ip_get_option(pcb, SOF_BROADCAST)) +#endif /* IP_SOF_BROADCAST_RECV */ + { + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip)) || + 800c594: 68fb ldr r3, [r7, #12] + 800c596: 2b00 cmp r3, #0 + 800c598: d013 beq.n 800c5c2 + 800c59a: 68fb ldr r3, [r7, #12] + 800c59c: 681b ldr r3, [r3, #0] + 800c59e: 2b00 cmp r3, #0 + 800c5a0: d00f beq.n 800c5c2 + ((ip4_current_dest_addr()->addr == IPADDR_BROADCAST)) || + 800c5a2: 4b17 ldr r3, [pc, #92] @ (800c600 ) + 800c5a4: 695b ldr r3, [r3, #20] + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip)) || + 800c5a6: f1b3 3fff cmp.w r3, #4294967295 + 800c5aa: d00a beq.n 800c5c2 + ip4_addr_netcmp(ip_2_ip4(&pcb->local_ip), ip4_current_dest_addr(), netif_ip4_netmask(inp))) { + 800c5ac: 68fb ldr r3, [r7, #12] + 800c5ae: 681a ldr r2, [r3, #0] + 800c5b0: 4b13 ldr r3, [pc, #76] @ (800c600 ) + 800c5b2: 695b ldr r3, [r3, #20] + 800c5b4: 405a eors r2, r3 + 800c5b6: 68bb ldr r3, [r7, #8] + 800c5b8: 3308 adds r3, #8 + 800c5ba: 681b ldr r3, [r3, #0] + 800c5bc: 4013 ands r3, r2 + ((ip4_current_dest_addr()->addr == IPADDR_BROADCAST)) || + 800c5be: 2b00 cmp r3, #0 + 800c5c0: d110 bne.n 800c5e4 + return 1; + 800c5c2: 2301 movs r3, #1 + 800c5c4: e00f b.n 800c5e6 + } + } + } else +#endif /* LWIP_IPV4 */ + /* Handle IPv4 and IPv6: all or exact match */ + if (ip_addr_isany(&pcb->local_ip) || ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + 800c5c6: 68fb ldr r3, [r7, #12] + 800c5c8: 2b00 cmp r3, #0 + 800c5ca: d009 beq.n 800c5e0 + 800c5cc: 68fb ldr r3, [r7, #12] + 800c5ce: 681b ldr r3, [r3, #0] + 800c5d0: 2b00 cmp r3, #0 + 800c5d2: d005 beq.n 800c5e0 + 800c5d4: 68fb ldr r3, [r7, #12] + 800c5d6: 681a ldr r2, [r3, #0] + 800c5d8: 4b09 ldr r3, [pc, #36] @ (800c600 ) + 800c5da: 695b ldr r3, [r3, #20] + 800c5dc: 429a cmp r2, r3 + 800c5de: d101 bne.n 800c5e4 + return 1; + 800c5e0: 2301 movs r3, #1 + 800c5e2: e000 b.n 800c5e6 + } + } + + return 0; + 800c5e4: 2300 movs r3, #0 +} + 800c5e6: 4618 mov r0, r3 + 800c5e8: 3710 adds r7, #16 + 800c5ea: 46bd mov sp, r7 + 800c5ec: bd80 pop {r7, pc} + 800c5ee: bf00 nop + 800c5f0: 08017fa0 .word 0x08017fa0 + 800c5f4: 08017fd0 .word 0x08017fd0 + 800c5f8: 08017ff4 .word 0x08017ff4 + 800c5fc: 0801801c .word 0x0801801c + 800c600: 2000614c .word 0x2000614c + +0800c604 : + * @param inp network interface on which the datagram was received. + * + */ +void +udp_input(struct pbuf *p, struct netif *inp) +{ + 800c604: b590 push {r4, r7, lr} + 800c606: b08d sub sp, #52 @ 0x34 + 800c608: af02 add r7, sp, #8 + 800c60a: 6078 str r0, [r7, #4] + 800c60c: 6039 str r1, [r7, #0] + struct udp_hdr *udphdr; + struct udp_pcb *pcb, *prev; + struct udp_pcb *uncon_pcb; + u16_t src, dest; + u8_t broadcast; + u8_t for_us = 0; + 800c60e: 2300 movs r3, #0 + 800c610: 76fb strb r3, [r7, #27] + + LWIP_UNUSED_ARG(inp); + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ASSERT("udp_input: invalid pbuf", p != NULL); + 800c612: 687b ldr r3, [r7, #4] + 800c614: 2b00 cmp r3, #0 + 800c616: d105 bne.n 800c624 + 800c618: 4b7c ldr r3, [pc, #496] @ (800c80c ) + 800c61a: 22cf movs r2, #207 @ 0xcf + 800c61c: 497c ldr r1, [pc, #496] @ (800c810 ) + 800c61e: 487d ldr r0, [pc, #500] @ (800c814 ) + 800c620: f004 ffea bl 80115f8 + LWIP_ASSERT("udp_input: invalid netif", inp != NULL); + 800c624: 683b ldr r3, [r7, #0] + 800c626: 2b00 cmp r3, #0 + 800c628: d105 bne.n 800c636 + 800c62a: 4b78 ldr r3, [pc, #480] @ (800c80c ) + 800c62c: 22d0 movs r2, #208 @ 0xd0 + 800c62e: 497a ldr r1, [pc, #488] @ (800c818 ) + 800c630: 4878 ldr r0, [pc, #480] @ (800c814 ) + 800c632: f004 ffe1 bl 80115f8 + PERF_START; + + UDP_STATS_INC(udp.recv); + + /* Check minimum length (UDP header) */ + if (p->len < UDP_HLEN) { + 800c636: 687b ldr r3, [r7, #4] + 800c638: 895b ldrh r3, [r3, #10] + 800c63a: 2b07 cmp r3, #7 + 800c63c: d803 bhi.n 800c646 + LWIP_DEBUGF(UDP_DEBUG, + ("udp_input: short UDP datagram (%"U16_F" bytes) discarded\n", p->tot_len)); + UDP_STATS_INC(udp.lenerr); + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpinerrors); + pbuf_free(p); + 800c63e: 6878 ldr r0, [r7, #4] + 800c640: f7fa f9f2 bl 8006a28 + goto end; + 800c644: e0de b.n 800c804 + } + + udphdr = (struct udp_hdr *)p->payload; + 800c646: 687b ldr r3, [r7, #4] + 800c648: 685b ldr r3, [r3, #4] + 800c64a: 617b str r3, [r7, #20] + + /* is broadcast packet ? */ + broadcast = ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif()); + 800c64c: 4b73 ldr r3, [pc, #460] @ (800c81c ) + 800c64e: 695b ldr r3, [r3, #20] + 800c650: 4a72 ldr r2, [pc, #456] @ (800c81c ) + 800c652: 6812 ldr r2, [r2, #0] + 800c654: 4611 mov r1, r2 + 800c656: 4618 mov r0, r3 + 800c658: f003 fe5c bl 8010314 + 800c65c: 4603 mov r3, r0 + 800c65e: 74fb strb r3, [r7, #19] + + LWIP_DEBUGF(UDP_DEBUG, ("udp_input: received datagram of length %"U16_F"\n", p->tot_len)); + + /* convert src and dest ports to host byte order */ + src = lwip_ntohs(udphdr->src); + 800c660: 697b ldr r3, [r7, #20] + 800c662: 881b ldrh r3, [r3, #0] + 800c664: b29b uxth r3, r3 + 800c666: 4618 mov r0, r3 + 800c668: f7f8 fe8e bl 8005388 + 800c66c: 4603 mov r3, r0 + 800c66e: 823b strh r3, [r7, #16] + dest = lwip_ntohs(udphdr->dest); + 800c670: 697b ldr r3, [r7, #20] + 800c672: 885b ldrh r3, [r3, #2] + 800c674: b29b uxth r3, r3 + 800c676: 4618 mov r0, r3 + 800c678: f7f8 fe86 bl 8005388 + 800c67c: 4603 mov r3, r0 + 800c67e: 81fb strh r3, [r7, #14] + ip_addr_debug_print_val(UDP_DEBUG, *ip_current_dest_addr()); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F") <-- (", lwip_ntohs(udphdr->dest))); + ip_addr_debug_print_val(UDP_DEBUG, *ip_current_src_addr()); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F")\n", lwip_ntohs(udphdr->src))); + + pcb = NULL; + 800c680: 2300 movs r3, #0 + 800c682: 627b str r3, [r7, #36] @ 0x24 + prev = NULL; + 800c684: 2300 movs r3, #0 + 800c686: 623b str r3, [r7, #32] + uncon_pcb = NULL; + 800c688: 2300 movs r3, #0 + 800c68a: 61fb str r3, [r7, #28] + /* Iterate through the UDP pcb list for a matching pcb. + * 'Perfect match' pcbs (connected to the remote port & ip address) are + * preferred. If no perfect match is found, the first unconnected pcb that + * matches the local port and ip address gets the datagram. */ + for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + 800c68c: 4b64 ldr r3, [pc, #400] @ (800c820 ) + 800c68e: 681b ldr r3, [r3, #0] + 800c690: 627b str r3, [r7, #36] @ 0x24 + 800c692: e054 b.n 800c73e + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F") <-- (", pcb->local_port)); + ip_addr_debug_print_val(UDP_DEBUG, pcb->remote_ip); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F")\n", pcb->remote_port)); + + /* compare PCB local addr+port to UDP destination addr+port */ + if ((pcb->local_port == dest) && + 800c694: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c696: 8a5b ldrh r3, [r3, #18] + 800c698: 89fa ldrh r2, [r7, #14] + 800c69a: 429a cmp r2, r3 + 800c69c: d14a bne.n 800c734 + (udp_input_local_match(pcb, inp, broadcast) != 0)) { + 800c69e: 7cfb ldrb r3, [r7, #19] + 800c6a0: 461a mov r2, r3 + 800c6a2: 6839 ldr r1, [r7, #0] + 800c6a4: 6a78 ldr r0, [r7, #36] @ 0x24 + 800c6a6: f7ff ff49 bl 800c53c + 800c6aa: 4603 mov r3, r0 + if ((pcb->local_port == dest) && + 800c6ac: 2b00 cmp r3, #0 + 800c6ae: d041 beq.n 800c734 + if ((pcb->flags & UDP_FLAGS_CONNECTED) == 0) { + 800c6b0: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c6b2: 7c1b ldrb r3, [r3, #16] + 800c6b4: f003 0304 and.w r3, r3, #4 + 800c6b8: 2b00 cmp r3, #0 + 800c6ba: d11d bne.n 800c6f8 + if (uncon_pcb == NULL) { + 800c6bc: 69fb ldr r3, [r7, #28] + 800c6be: 2b00 cmp r3, #0 + 800c6c0: d102 bne.n 800c6c8 + /* the first unconnected matching PCB */ + uncon_pcb = pcb; + 800c6c2: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c6c4: 61fb str r3, [r7, #28] + 800c6c6: e017 b.n 800c6f8 +#if LWIP_IPV4 + } else if (broadcast && ip4_current_dest_addr()->addr == IPADDR_BROADCAST) { + 800c6c8: 7cfb ldrb r3, [r7, #19] + 800c6ca: 2b00 cmp r3, #0 + 800c6cc: d014 beq.n 800c6f8 + 800c6ce: 4b53 ldr r3, [pc, #332] @ (800c81c ) + 800c6d0: 695b ldr r3, [r3, #20] + 800c6d2: f1b3 3fff cmp.w r3, #4294967295 + 800c6d6: d10f bne.n 800c6f8 + /* global broadcast address (only valid for IPv4; match was checked before) */ + if (!IP_IS_V4_VAL(uncon_pcb->local_ip) || !ip4_addr_cmp(ip_2_ip4(&uncon_pcb->local_ip), netif_ip4_addr(inp))) { + 800c6d8: 69fb ldr r3, [r7, #28] + 800c6da: 681a ldr r2, [r3, #0] + 800c6dc: 683b ldr r3, [r7, #0] + 800c6de: 3304 adds r3, #4 + 800c6e0: 681b ldr r3, [r3, #0] + 800c6e2: 429a cmp r2, r3 + 800c6e4: d008 beq.n 800c6f8 + /* uncon_pcb does not match the input netif, check this pcb */ + if (IP_IS_V4_VAL(pcb->local_ip) && ip4_addr_cmp(ip_2_ip4(&pcb->local_ip), netif_ip4_addr(inp))) { + 800c6e6: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c6e8: 681a ldr r2, [r3, #0] + 800c6ea: 683b ldr r3, [r7, #0] + 800c6ec: 3304 adds r3, #4 + 800c6ee: 681b ldr r3, [r3, #0] + 800c6f0: 429a cmp r2, r3 + 800c6f2: d101 bne.n 800c6f8 + /* better match */ + uncon_pcb = pcb; + 800c6f4: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c6f6: 61fb str r3, [r7, #28] + } +#endif /* SO_REUSE */ + } + + /* compare PCB remote addr+port to UDP source addr+port */ + if ((pcb->remote_port == src) && + 800c6f8: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c6fa: 8a9b ldrh r3, [r3, #20] + 800c6fc: 8a3a ldrh r2, [r7, #16] + 800c6fe: 429a cmp r2, r3 + 800c700: d118 bne.n 800c734 + (ip_addr_isany_val(pcb->remote_ip) || + 800c702: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c704: 685b ldr r3, [r3, #4] + if ((pcb->remote_port == src) && + 800c706: 2b00 cmp r3, #0 + 800c708: d005 beq.n 800c716 + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()))) { + 800c70a: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c70c: 685a ldr r2, [r3, #4] + 800c70e: 4b43 ldr r3, [pc, #268] @ (800c81c ) + 800c710: 691b ldr r3, [r3, #16] + (ip_addr_isany_val(pcb->remote_ip) || + 800c712: 429a cmp r2, r3 + 800c714: d10e bne.n 800c734 + /* the first fully matching PCB */ + if (prev != NULL) { + 800c716: 6a3b ldr r3, [r7, #32] + 800c718: 2b00 cmp r3, #0 + 800c71a: d014 beq.n 800c746 + /* move the pcb to the front of udp_pcbs so that is + found faster next time */ + prev->next = pcb->next; + 800c71c: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c71e: 68da ldr r2, [r3, #12] + 800c720: 6a3b ldr r3, [r7, #32] + 800c722: 60da str r2, [r3, #12] + pcb->next = udp_pcbs; + 800c724: 4b3e ldr r3, [pc, #248] @ (800c820 ) + 800c726: 681a ldr r2, [r3, #0] + 800c728: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c72a: 60da str r2, [r3, #12] + udp_pcbs = pcb; + 800c72c: 4a3c ldr r2, [pc, #240] @ (800c820 ) + 800c72e: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c730: 6013 str r3, [r2, #0] + } else { + UDP_STATS_INC(udp.cachehit); + } + break; + 800c732: e008 b.n 800c746 + } + } + + prev = pcb; + 800c734: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c736: 623b str r3, [r7, #32] + for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + 800c738: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c73a: 68db ldr r3, [r3, #12] + 800c73c: 627b str r3, [r7, #36] @ 0x24 + 800c73e: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c740: 2b00 cmp r3, #0 + 800c742: d1a7 bne.n 800c694 + 800c744: e000 b.n 800c748 + break; + 800c746: bf00 nop + } + /* no fully matching pcb found? then look for an unconnected pcb */ + if (pcb == NULL) { + 800c748: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c74a: 2b00 cmp r3, #0 + 800c74c: d101 bne.n 800c752 + pcb = uncon_pcb; + 800c74e: 69fb ldr r3, [r7, #28] + 800c750: 627b str r3, [r7, #36] @ 0x24 + } + + /* Check checksum if this is a match or if it was directed at us. */ + if (pcb != NULL) { + 800c752: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c754: 2b00 cmp r3, #0 + 800c756: d002 beq.n 800c75e + for_us = 1; + 800c758: 2301 movs r3, #1 + 800c75a: 76fb strb r3, [r7, #27] + 800c75c: e00a b.n 800c774 + for_us = netif_get_ip6_addr_match(inp, ip6_current_dest_addr()) >= 0; + } +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + if (!ip_current_is_v6()) { + for_us = ip4_addr_cmp(netif_ip4_addr(inp), ip4_current_dest_addr()); + 800c75e: 683b ldr r3, [r7, #0] + 800c760: 3304 adds r3, #4 + 800c762: 681a ldr r2, [r3, #0] + 800c764: 4b2d ldr r3, [pc, #180] @ (800c81c ) + 800c766: 695b ldr r3, [r3, #20] + 800c768: 429a cmp r2, r3 + 800c76a: bf0c ite eq + 800c76c: 2301 moveq r3, #1 + 800c76e: 2300 movne r3, #0 + 800c770: b2db uxtb r3, r3 + 800c772: 76fb strb r3, [r7, #27] + } +#endif /* LWIP_IPV4 */ + } + + if (for_us) { + 800c774: 7efb ldrb r3, [r7, #27] + 800c776: 2b00 cmp r3, #0 + 800c778: d041 beq.n 800c7fe + } + } + } + } +#endif /* CHECKSUM_CHECK_UDP */ + if (pbuf_remove_header(p, UDP_HLEN)) { + 800c77a: 2108 movs r1, #8 + 800c77c: 6878 ldr r0, [r7, #4] + 800c77e: f7fa f8cd bl 800691c + 800c782: 4603 mov r3, r0 + 800c784: 2b00 cmp r3, #0 + 800c786: d00a beq.n 800c79e + /* Can we cope with this failing? Just assert for now */ + LWIP_ASSERT("pbuf_remove_header failed\n", 0); + 800c788: 4b20 ldr r3, [pc, #128] @ (800c80c ) + 800c78a: f44f 72b8 mov.w r2, #368 @ 0x170 + 800c78e: 4925 ldr r1, [pc, #148] @ (800c824 ) + 800c790: 4820 ldr r0, [pc, #128] @ (800c814 ) + 800c792: f004 ff31 bl 80115f8 + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpinerrors); + pbuf_free(p); + 800c796: 6878 ldr r0, [r7, #4] + 800c798: f7fa f946 bl 8006a28 + goto end; + 800c79c: e032 b.n 800c804 + } + + if (pcb != NULL) { + 800c79e: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c7a0: 2b00 cmp r3, #0 + 800c7a2: d012 beq.n 800c7ca + } + } + } +#endif /* SO_REUSE && SO_REUSE_RXTOALL */ + /* callback */ + if (pcb->recv != NULL) { + 800c7a4: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c7a6: 699b ldr r3, [r3, #24] + 800c7a8: 2b00 cmp r3, #0 + 800c7aa: d00a beq.n 800c7c2 + /* now the recv function is responsible for freeing p */ + pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr(), src); + 800c7ac: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c7ae: 699c ldr r4, [r3, #24] + 800c7b0: 6a7b ldr r3, [r7, #36] @ 0x24 + 800c7b2: 69d8 ldr r0, [r3, #28] + 800c7b4: 8a3b ldrh r3, [r7, #16] + 800c7b6: 9300 str r3, [sp, #0] + 800c7b8: 4b1b ldr r3, [pc, #108] @ (800c828 ) + 800c7ba: 687a ldr r2, [r7, #4] + 800c7bc: 6a79 ldr r1, [r7, #36] @ 0x24 + 800c7be: 47a0 blx r4 + } else { + pbuf_free(p); + } +end: + PERF_STOP("udp_input"); + return; + 800c7c0: e021 b.n 800c806 + pbuf_free(p); + 800c7c2: 6878 ldr r0, [r7, #4] + 800c7c4: f7fa f930 bl 8006a28 + goto end; + 800c7c8: e01c b.n 800c804 + if (!broadcast && !ip_addr_ismulticast(ip_current_dest_addr())) { + 800c7ca: 7cfb ldrb r3, [r7, #19] + 800c7cc: 2b00 cmp r3, #0 + 800c7ce: d112 bne.n 800c7f6 + 800c7d0: 4b12 ldr r3, [pc, #72] @ (800c81c ) + 800c7d2: 695b ldr r3, [r3, #20] + 800c7d4: f003 03f0 and.w r3, r3, #240 @ 0xf0 + 800c7d8: 2be0 cmp r3, #224 @ 0xe0 + 800c7da: d00c beq.n 800c7f6 + pbuf_header_force(p, (s16_t)(ip_current_header_tot_len() + UDP_HLEN)); + 800c7dc: 4b0f ldr r3, [pc, #60] @ (800c81c ) + 800c7de: 899b ldrh r3, [r3, #12] + 800c7e0: 3308 adds r3, #8 + 800c7e2: b29b uxth r3, r3 + 800c7e4: b21b sxth r3, r3 + 800c7e6: 4619 mov r1, r3 + 800c7e8: 6878 ldr r0, [r7, #4] + 800c7ea: f7fa f90a bl 8006a02 + icmp_port_unreach(ip_current_is_v6(), p); + 800c7ee: 2103 movs r1, #3 + 800c7f0: 6878 ldr r0, [r7, #4] + 800c7f2: f003 fa51 bl 800fc98 + pbuf_free(p); + 800c7f6: 6878 ldr r0, [r7, #4] + 800c7f8: f7fa f916 bl 8006a28 + return; + 800c7fc: e003 b.n 800c806 + pbuf_free(p); + 800c7fe: 6878 ldr r0, [r7, #4] + 800c800: f7fa f912 bl 8006a28 + return; + 800c804: bf00 nop + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpinerrors); + pbuf_free(p); + PERF_STOP("udp_input"); +#endif /* CHECKSUM_CHECK_UDP */ +} + 800c806: 372c adds r7, #44 @ 0x2c + 800c808: 46bd mov sp, r7 + 800c80a: bd90 pop {r4, r7, pc} + 800c80c: 08017fa0 .word 0x08017fa0 + 800c810: 08018044 .word 0x08018044 + 800c814: 08017ff4 .word 0x08017ff4 + 800c818: 0801805c .word 0x0801805c + 800c81c: 2000614c .word 0x2000614c + 800c820: 20019100 .word 0x20019100 + 800c824: 08018078 .word 0x08018078 + 800c828: 2000615c .word 0x2000615c + +0800c82c : + * @see udp_disconnect() udp_send() + */ +err_t +udp_sendto(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port) +{ + 800c82c: b580 push {r7, lr} + 800c82e: b088 sub sp, #32 + 800c830: af02 add r7, sp, #8 + 800c832: 60f8 str r0, [r7, #12] + 800c834: 60b9 str r1, [r7, #8] + 800c836: 607a str r2, [r7, #4] + 800c838: 807b strh r3, [r7, #2] + u16_t dst_port, u8_t have_chksum, u16_t chksum) +{ +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + struct netif *netif; + + LWIP_ERROR("udp_sendto: invalid pcb", pcb != NULL, return ERR_ARG); + 800c83a: 68fb ldr r3, [r7, #12] + 800c83c: 2b00 cmp r3, #0 + 800c83e: d109 bne.n 800c854 + 800c840: 4b23 ldr r3, [pc, #140] @ (800c8d0 ) + 800c842: f44f 7206 mov.w r2, #536 @ 0x218 + 800c846: 4923 ldr r1, [pc, #140] @ (800c8d4 ) + 800c848: 4823 ldr r0, [pc, #140] @ (800c8d8 ) + 800c84a: f004 fed5 bl 80115f8 + 800c84e: f06f 030f mvn.w r3, #15 + 800c852: e038 b.n 800c8c6 + LWIP_ERROR("udp_sendto: invalid pbuf", p != NULL, return ERR_ARG); + 800c854: 68bb ldr r3, [r7, #8] + 800c856: 2b00 cmp r3, #0 + 800c858: d109 bne.n 800c86e + 800c85a: 4b1d ldr r3, [pc, #116] @ (800c8d0 ) + 800c85c: f240 2219 movw r2, #537 @ 0x219 + 800c860: 491e ldr r1, [pc, #120] @ (800c8dc ) + 800c862: 481d ldr r0, [pc, #116] @ (800c8d8 ) + 800c864: f004 fec8 bl 80115f8 + 800c868: f06f 030f mvn.w r3, #15 + 800c86c: e02b b.n 800c8c6 + LWIP_ERROR("udp_sendto: invalid dst_ip", dst_ip != NULL, return ERR_ARG); + 800c86e: 687b ldr r3, [r7, #4] + 800c870: 2b00 cmp r3, #0 + 800c872: d109 bne.n 800c888 + 800c874: 4b16 ldr r3, [pc, #88] @ (800c8d0 ) + 800c876: f240 221a movw r2, #538 @ 0x21a + 800c87a: 4919 ldr r1, [pc, #100] @ (800c8e0 ) + 800c87c: 4816 ldr r0, [pc, #88] @ (800c8d8 ) + 800c87e: f004 febb bl 80115f8 + 800c882: f06f 030f mvn.w r3, #15 + 800c886: e01e b.n 800c8c6 + return ERR_VAL; + } + + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send\n")); + + if (pcb->netif_idx != NETIF_NO_INDEX) { + 800c888: 68fb ldr r3, [r7, #12] + 800c88a: 7a1b ldrb r3, [r3, #8] + 800c88c: 2b00 cmp r3, #0 + 800c88e: d006 beq.n 800c89e + netif = netif_get_by_index(pcb->netif_idx); + 800c890: 68fb ldr r3, [r7, #12] + 800c892: 7a1b ldrb r3, [r3, #8] + 800c894: 4618 mov r0, r3 + 800c896: f7f9 fd69 bl 800636c + 800c89a: 6178 str r0, [r7, #20] + 800c89c: e003 b.n 800c8a6 + + if (netif == NULL) +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + { + /* find the outgoing network interface for this packet */ + netif = ip_route(&pcb->local_ip, dst_ip); + 800c89e: 6878 ldr r0, [r7, #4] + 800c8a0: f003 fa84 bl 800fdac + 800c8a4: 6178 str r0, [r7, #20] + } + } + + /* no outgoing network interface could be found? */ + if (netif == NULL) { + 800c8a6: 697b ldr r3, [r7, #20] + 800c8a8: 2b00 cmp r3, #0 + 800c8aa: d102 bne.n 800c8b2 + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: No route to ")); + ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, dst_ip); + LWIP_DEBUGF(UDP_DEBUG, ("\n")); + UDP_STATS_INC(udp.rterr); + return ERR_RTE; + 800c8ac: f06f 0303 mvn.w r3, #3 + 800c8b0: e009 b.n 800c8c6 + } +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, have_chksum, chksum); +#else /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + return udp_sendto_if(pcb, p, dst_ip, dst_port, netif); + 800c8b2: 887a ldrh r2, [r7, #2] + 800c8b4: 697b ldr r3, [r7, #20] + 800c8b6: 9300 str r3, [sp, #0] + 800c8b8: 4613 mov r3, r2 + 800c8ba: 687a ldr r2, [r7, #4] + 800c8bc: 68b9 ldr r1, [r7, #8] + 800c8be: 68f8 ldr r0, [r7, #12] + 800c8c0: f000 f810 bl 800c8e4 + 800c8c4: 4603 mov r3, r0 +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ +} + 800c8c6: 4618 mov r0, r3 + 800c8c8: 3718 adds r7, #24 + 800c8ca: 46bd mov sp, r7 + 800c8cc: bd80 pop {r7, pc} + 800c8ce: bf00 nop + 800c8d0: 08017fa0 .word 0x08017fa0 + 800c8d4: 080180c4 .word 0x080180c4 + 800c8d8: 08017ff4 .word 0x08017ff4 + 800c8dc: 080180dc .word 0x080180dc + 800c8e0: 080180f8 .word 0x080180f8 + +0800c8e4 : + * @see udp_disconnect() udp_send() + */ +err_t +udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif) +{ + 800c8e4: b580 push {r7, lr} + 800c8e6: b088 sub sp, #32 + 800c8e8: af02 add r7, sp, #8 + 800c8ea: 60f8 str r0, [r7, #12] + 800c8ec: 60b9 str r1, [r7, #8] + 800c8ee: 607a str r2, [r7, #4] + 800c8f0: 807b strh r3, [r7, #2] + u16_t chksum) +{ +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + const ip_addr_t *src_ip; + + LWIP_ERROR("udp_sendto_if: invalid pcb", pcb != NULL, return ERR_ARG); + 800c8f2: 68fb ldr r3, [r7, #12] + 800c8f4: 2b00 cmp r3, #0 + 800c8f6: d109 bne.n 800c90c + 800c8f8: 4b2e ldr r3, [pc, #184] @ (800c9b4 ) + 800c8fa: f44f 7220 mov.w r2, #640 @ 0x280 + 800c8fe: 492e ldr r1, [pc, #184] @ (800c9b8 ) + 800c900: 482e ldr r0, [pc, #184] @ (800c9bc ) + 800c902: f004 fe79 bl 80115f8 + 800c906: f06f 030f mvn.w r3, #15 + 800c90a: e04f b.n 800c9ac + LWIP_ERROR("udp_sendto_if: invalid pbuf", p != NULL, return ERR_ARG); + 800c90c: 68bb ldr r3, [r7, #8] + 800c90e: 2b00 cmp r3, #0 + 800c910: d109 bne.n 800c926 + 800c912: 4b28 ldr r3, [pc, #160] @ (800c9b4 ) + 800c914: f240 2281 movw r2, #641 @ 0x281 + 800c918: 4929 ldr r1, [pc, #164] @ (800c9c0 ) + 800c91a: 4828 ldr r0, [pc, #160] @ (800c9bc ) + 800c91c: f004 fe6c bl 80115f8 + 800c920: f06f 030f mvn.w r3, #15 + 800c924: e042 b.n 800c9ac + LWIP_ERROR("udp_sendto_if: invalid dst_ip", dst_ip != NULL, return ERR_ARG); + 800c926: 687b ldr r3, [r7, #4] + 800c928: 2b00 cmp r3, #0 + 800c92a: d109 bne.n 800c940 + 800c92c: 4b21 ldr r3, [pc, #132] @ (800c9b4 ) + 800c92e: f240 2282 movw r2, #642 @ 0x282 + 800c932: 4924 ldr r1, [pc, #144] @ (800c9c4 ) + 800c934: 4821 ldr r0, [pc, #132] @ (800c9bc ) + 800c936: f004 fe5f bl 80115f8 + 800c93a: f06f 030f mvn.w r3, #15 + 800c93e: e035 b.n 800c9ac + LWIP_ERROR("udp_sendto_if: invalid netif", netif != NULL, return ERR_ARG); + 800c940: 6a3b ldr r3, [r7, #32] + 800c942: 2b00 cmp r3, #0 + 800c944: d109 bne.n 800c95a + 800c946: 4b1b ldr r3, [pc, #108] @ (800c9b4 ) + 800c948: f240 2283 movw r2, #643 @ 0x283 + 800c94c: 491e ldr r1, [pc, #120] @ (800c9c8 ) + 800c94e: 481b ldr r0, [pc, #108] @ (800c9bc ) + 800c950: f004 fe52 bl 80115f8 + 800c954: f06f 030f mvn.w r3, #15 + 800c958: e028 b.n 800c9ac +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 && LWIP_IPV6 + else +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_IPV4 + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip)) || + 800c95a: 68fb ldr r3, [r7, #12] + 800c95c: 2b00 cmp r3, #0 + 800c95e: d009 beq.n 800c974 + 800c960: 68fb ldr r3, [r7, #12] + 800c962: 681b ldr r3, [r3, #0] + 800c964: 2b00 cmp r3, #0 + 800c966: d005 beq.n 800c974 + ip4_addr_ismulticast(ip_2_ip4(&pcb->local_ip))) { + 800c968: 68fb ldr r3, [r7, #12] + 800c96a: 681b ldr r3, [r3, #0] + 800c96c: f003 03f0 and.w r3, r3, #240 @ 0xf0 + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip)) || + 800c970: 2be0 cmp r3, #224 @ 0xe0 + 800c972: d103 bne.n 800c97c + /* if the local_ip is any or multicast + * use the outgoing network interface IP address as source address */ + src_ip = netif_ip_addr4(netif); + 800c974: 6a3b ldr r3, [r7, #32] + 800c976: 3304 adds r3, #4 + 800c978: 617b str r3, [r7, #20] + 800c97a: e00b b.n 800c994 + } else { + /* check if UDP PCB local IP address is correct + * this could be an old address if netif->ip_addr has changed */ + if (!ip4_addr_cmp(ip_2_ip4(&(pcb->local_ip)), netif_ip4_addr(netif))) { + 800c97c: 68fb ldr r3, [r7, #12] + 800c97e: 681a ldr r2, [r3, #0] + 800c980: 6a3b ldr r3, [r7, #32] + 800c982: 3304 adds r3, #4 + 800c984: 681b ldr r3, [r3, #0] + 800c986: 429a cmp r2, r3 + 800c988: d002 beq.n 800c990 + /* local_ip doesn't match, drop the packet */ + return ERR_RTE; + 800c98a: f06f 0303 mvn.w r3, #3 + 800c98e: e00d b.n 800c9ac + } + /* use UDP PCB local IP address as source address */ + src_ip = &pcb->local_ip; + 800c990: 68fb ldr r3, [r7, #12] + 800c992: 617b str r3, [r7, #20] + } +#endif /* LWIP_IPV4 */ +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_if_src_chksum(pcb, p, dst_ip, dst_port, netif, have_chksum, chksum, src_ip); +#else /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + return udp_sendto_if_src(pcb, p, dst_ip, dst_port, netif, src_ip); + 800c994: 887a ldrh r2, [r7, #2] + 800c996: 697b ldr r3, [r7, #20] + 800c998: 9301 str r3, [sp, #4] + 800c99a: 6a3b ldr r3, [r7, #32] + 800c99c: 9300 str r3, [sp, #0] + 800c99e: 4613 mov r3, r2 + 800c9a0: 687a ldr r2, [r7, #4] + 800c9a2: 68b9 ldr r1, [r7, #8] + 800c9a4: 68f8 ldr r0, [r7, #12] + 800c9a6: f000 f811 bl 800c9cc + 800c9aa: 4603 mov r3, r0 +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ +} + 800c9ac: 4618 mov r0, r3 + 800c9ae: 3718 adds r7, #24 + 800c9b0: 46bd mov sp, r7 + 800c9b2: bd80 pop {r7, pc} + 800c9b4: 08017fa0 .word 0x08017fa0 + 800c9b8: 08018114 .word 0x08018114 + 800c9bc: 08017ff4 .word 0x08017ff4 + 800c9c0: 08018130 .word 0x08018130 + 800c9c4: 0801814c .word 0x0801814c + 800c9c8: 0801816c .word 0x0801816c + +0800c9cc : +/** @ingroup udp_raw + * Same as @ref udp_sendto_if, but with source address */ +err_t +udp_sendto_if_src(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif, const ip_addr_t *src_ip) +{ + 800c9cc: b580 push {r7, lr} + 800c9ce: b08c sub sp, #48 @ 0x30 + 800c9d0: af04 add r7, sp, #16 + 800c9d2: 60f8 str r0, [r7, #12] + 800c9d4: 60b9 str r1, [r7, #8] + 800c9d6: 607a str r2, [r7, #4] + 800c9d8: 807b strh r3, [r7, #2] + u8_t ip_proto; + u8_t ttl; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("udp_sendto_if_src: invalid pcb", pcb != NULL, return ERR_ARG); + 800c9da: 68fb ldr r3, [r7, #12] + 800c9dc: 2b00 cmp r3, #0 + 800c9de: d109 bne.n 800c9f4 + 800c9e0: 4b65 ldr r3, [pc, #404] @ (800cb78 ) + 800c9e2: f240 22d1 movw r2, #721 @ 0x2d1 + 800c9e6: 4965 ldr r1, [pc, #404] @ (800cb7c ) + 800c9e8: 4865 ldr r0, [pc, #404] @ (800cb80 ) + 800c9ea: f004 fe05 bl 80115f8 + 800c9ee: f06f 030f mvn.w r3, #15 + 800c9f2: e0bc b.n 800cb6e + LWIP_ERROR("udp_sendto_if_src: invalid pbuf", p != NULL, return ERR_ARG); + 800c9f4: 68bb ldr r3, [r7, #8] + 800c9f6: 2b00 cmp r3, #0 + 800c9f8: d109 bne.n 800ca0e + 800c9fa: 4b5f ldr r3, [pc, #380] @ (800cb78 ) + 800c9fc: f240 22d2 movw r2, #722 @ 0x2d2 + 800ca00: 4960 ldr r1, [pc, #384] @ (800cb84 ) + 800ca02: 485f ldr r0, [pc, #380] @ (800cb80 ) + 800ca04: f004 fdf8 bl 80115f8 + 800ca08: f06f 030f mvn.w r3, #15 + 800ca0c: e0af b.n 800cb6e + LWIP_ERROR("udp_sendto_if_src: invalid dst_ip", dst_ip != NULL, return ERR_ARG); + 800ca0e: 687b ldr r3, [r7, #4] + 800ca10: 2b00 cmp r3, #0 + 800ca12: d109 bne.n 800ca28 + 800ca14: 4b58 ldr r3, [pc, #352] @ (800cb78 ) + 800ca16: f240 22d3 movw r2, #723 @ 0x2d3 + 800ca1a: 495b ldr r1, [pc, #364] @ (800cb88 ) + 800ca1c: 4858 ldr r0, [pc, #352] @ (800cb80 ) + 800ca1e: f004 fdeb bl 80115f8 + 800ca22: f06f 030f mvn.w r3, #15 + 800ca26: e0a2 b.n 800cb6e + LWIP_ERROR("udp_sendto_if_src: invalid src_ip", src_ip != NULL, return ERR_ARG); + 800ca28: 6afb ldr r3, [r7, #44] @ 0x2c + 800ca2a: 2b00 cmp r3, #0 + 800ca2c: d109 bne.n 800ca42 + 800ca2e: 4b52 ldr r3, [pc, #328] @ (800cb78 ) + 800ca30: f44f 7235 mov.w r2, #724 @ 0x2d4 + 800ca34: 4955 ldr r1, [pc, #340] @ (800cb8c ) + 800ca36: 4852 ldr r0, [pc, #328] @ (800cb80 ) + 800ca38: f004 fdde bl 80115f8 + 800ca3c: f06f 030f mvn.w r3, #15 + 800ca40: e095 b.n 800cb6e + LWIP_ERROR("udp_sendto_if_src: invalid netif", netif != NULL, return ERR_ARG); + 800ca42: 6abb ldr r3, [r7, #40] @ 0x28 + 800ca44: 2b00 cmp r3, #0 + 800ca46: d109 bne.n 800ca5c + 800ca48: 4b4b ldr r3, [pc, #300] @ (800cb78 ) + 800ca4a: f240 22d5 movw r2, #725 @ 0x2d5 + 800ca4e: 4950 ldr r1, [pc, #320] @ (800cb90 ) + 800ca50: 484b ldr r0, [pc, #300] @ (800cb80 ) + 800ca52: f004 fdd1 bl 80115f8 + 800ca56: f06f 030f mvn.w r3, #15 + 800ca5a: e088 b.n 800cb6e + return ERR_VAL; + } +#endif /* LWIP_IPV4 && IP_SOF_BROADCAST */ + + /* if the PCB is not yet bound to a port, bind it here */ + if (pcb->local_port == 0) { + 800ca5c: 68fb ldr r3, [r7, #12] + 800ca5e: 8a5b ldrh r3, [r3, #18] + 800ca60: 2b00 cmp r3, #0 + 800ca62: d10f bne.n 800ca84 + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send: not yet bound to a port, binding now\n")); + err = udp_bind(pcb, &pcb->local_ip, pcb->local_port); + 800ca64: 68f9 ldr r1, [r7, #12] + 800ca66: 68fb ldr r3, [r7, #12] + 800ca68: 8a5b ldrh r3, [r3, #18] + 800ca6a: 461a mov r2, r3 + 800ca6c: 68f8 ldr r0, [r7, #12] + 800ca6e: f000 f893 bl 800cb98 + 800ca72: 4603 mov r3, r0 + 800ca74: 76fb strb r3, [r7, #27] + if (err != ERR_OK) { + 800ca76: f997 301b ldrsb.w r3, [r7, #27] + 800ca7a: 2b00 cmp r3, #0 + 800ca7c: d002 beq.n 800ca84 + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: forced port bind failed\n")); + return err; + 800ca7e: f997 301b ldrsb.w r3, [r7, #27] + 800ca82: e074 b.n 800cb6e + } + } + + /* packet too large to add a UDP header without causing an overflow? */ + if ((u16_t)(p->tot_len + UDP_HLEN) < p->tot_len) { + 800ca84: 68bb ldr r3, [r7, #8] + 800ca86: 891b ldrh r3, [r3, #8] + 800ca88: f64f 72f7 movw r2, #65527 @ 0xfff7 + 800ca8c: 4293 cmp r3, r2 + 800ca8e: d902 bls.n 800ca96 + return ERR_MEM; + 800ca90: f04f 33ff mov.w r3, #4294967295 + 800ca94: e06b b.n 800cb6e + } + /* not enough space to add an UDP header to first pbuf in given p chain? */ + if (pbuf_add_header(p, UDP_HLEN)) { + 800ca96: 2108 movs r1, #8 + 800ca98: 68b8 ldr r0, [r7, #8] + 800ca9a: f7f9 ff2f bl 80068fc + 800ca9e: 4603 mov r3, r0 + 800caa0: 2b00 cmp r3, #0 + 800caa2: d015 beq.n 800cad0 + /* allocate header in a separate new pbuf */ + q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM); + 800caa4: f44f 7220 mov.w r2, #640 @ 0x280 + 800caa8: 2108 movs r1, #8 + 800caaa: 2022 movs r0, #34 @ 0x22 + 800caac: f7f9 fcda bl 8006464 + 800cab0: 61f8 str r0, [r7, #28] + /* new header pbuf could not be allocated? */ + if (q == NULL) { + 800cab2: 69fb ldr r3, [r7, #28] + 800cab4: 2b00 cmp r3, #0 + 800cab6: d102 bne.n 800cabe + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n")); + return ERR_MEM; + 800cab8: f04f 33ff mov.w r3, #4294967295 + 800cabc: e057 b.n 800cb6e + } + if (p->tot_len != 0) { + 800cabe: 68bb ldr r3, [r7, #8] + 800cac0: 891b ldrh r3, [r3, #8] + 800cac2: 2b00 cmp r3, #0 + 800cac4: d006 beq.n 800cad4 + /* chain header q in front of given pbuf p (only if p contains data) */ + pbuf_chain(q, p); + 800cac6: 68b9 ldr r1, [r7, #8] + 800cac8: 69f8 ldr r0, [r7, #28] + 800caca: f7fa f8c5 bl 8006c58 + 800cace: e001 b.n 800cad4 + LWIP_DEBUGF(UDP_DEBUG, + ("udp_send: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p)); + } else { + /* adding space for header within p succeeded */ + /* first pbuf q equals given pbuf */ + q = p; + 800cad0: 68bb ldr r3, [r7, #8] + 800cad2: 61fb str r3, [r7, #28] + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p)); + } + LWIP_ASSERT("check that first pbuf can hold struct udp_hdr", + 800cad4: 69fb ldr r3, [r7, #28] + 800cad6: 895b ldrh r3, [r3, #10] + 800cad8: 2b07 cmp r3, #7 + 800cada: d806 bhi.n 800caea + 800cadc: 4b26 ldr r3, [pc, #152] @ (800cb78 ) + 800cade: f240 320d movw r2, #781 @ 0x30d + 800cae2: 492c ldr r1, [pc, #176] @ (800cb94 ) + 800cae4: 4826 ldr r0, [pc, #152] @ (800cb80 ) + 800cae6: f004 fd87 bl 80115f8 + (q->len >= sizeof(struct udp_hdr))); + /* q now represents the packet to be sent */ + udphdr = (struct udp_hdr *)q->payload; + 800caea: 69fb ldr r3, [r7, #28] + 800caec: 685b ldr r3, [r3, #4] + 800caee: 617b str r3, [r7, #20] + udphdr->src = lwip_htons(pcb->local_port); + 800caf0: 68fb ldr r3, [r7, #12] + 800caf2: 8a5b ldrh r3, [r3, #18] + 800caf4: 4618 mov r0, r3 + 800caf6: f7f8 fc47 bl 8005388 + 800cafa: 4603 mov r3, r0 + 800cafc: 461a mov r2, r3 + 800cafe: 697b ldr r3, [r7, #20] + 800cb00: 801a strh r2, [r3, #0] + udphdr->dest = lwip_htons(dst_port); + 800cb02: 887b ldrh r3, [r7, #2] + 800cb04: 4618 mov r0, r3 + 800cb06: f7f8 fc3f bl 8005388 + 800cb0a: 4603 mov r3, r0 + 800cb0c: 461a mov r2, r3 + 800cb0e: 697b ldr r3, [r7, #20] + 800cb10: 805a strh r2, [r3, #2] + /* in UDP, 0 checksum means 'no checksum' */ + udphdr->chksum = 0x0000; + 800cb12: 697b ldr r3, [r7, #20] + 800cb14: 2200 movs r2, #0 + 800cb16: 719a strb r2, [r3, #6] + 800cb18: 2200 movs r2, #0 + 800cb1a: 71da strb r2, [r3, #7] + ip_proto = IP_PROTO_UDPLITE; + } else +#endif /* LWIP_UDPLITE */ + { /* UDP */ + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len)); + udphdr->len = lwip_htons(q->tot_len); + 800cb1c: 69fb ldr r3, [r7, #28] + 800cb1e: 891b ldrh r3, [r3, #8] + 800cb20: 4618 mov r0, r3 + 800cb22: f7f8 fc31 bl 8005388 + 800cb26: 4603 mov r3, r0 + 800cb28: 461a mov r2, r3 + 800cb2a: 697b ldr r3, [r7, #20] + 800cb2c: 809a strh r2, [r3, #4] + } + udphdr->chksum = udpchksum; + } + } +#endif /* CHECKSUM_GEN_UDP */ + ip_proto = IP_PROTO_UDP; + 800cb2e: 2311 movs r3, #17 + 800cb30: 74fb strb r3, [r7, #19] + + /* Determine TTL to use */ +#if LWIP_MULTICAST_TX_OPTIONS + ttl = (ip_addr_ismulticast(dst_ip) ? udp_get_multicast_ttl(pcb) : pcb->ttl); +#else /* LWIP_MULTICAST_TX_OPTIONS */ + ttl = pcb->ttl; + 800cb32: 68fb ldr r3, [r7, #12] + 800cb34: 7adb ldrb r3, [r3, #11] + 800cb36: 74bb strb r3, [r7, #18] + + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum)); + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,0x%02"X16_F",)\n", (u16_t)ip_proto)); + /* output to IP */ + NETIF_SET_HINTS(netif, &(pcb->netif_hints)); + err = ip_output_if_src(q, src_ip, dst_ip, ttl, pcb->tos, ip_proto, netif); + 800cb38: 68fb ldr r3, [r7, #12] + 800cb3a: 7a9b ldrb r3, [r3, #10] + 800cb3c: 7cb9 ldrb r1, [r7, #18] + 800cb3e: 6aba ldr r2, [r7, #40] @ 0x28 + 800cb40: 9202 str r2, [sp, #8] + 800cb42: 7cfa ldrb r2, [r7, #19] + 800cb44: 9201 str r2, [sp, #4] + 800cb46: 9300 str r3, [sp, #0] + 800cb48: 460b mov r3, r1 + 800cb4a: 687a ldr r2, [r7, #4] + 800cb4c: 6af9 ldr r1, [r7, #44] @ 0x2c + 800cb4e: 69f8 ldr r0, [r7, #28] + 800cb50: f003 fb32 bl 80101b8 + 800cb54: 4603 mov r3, r0 + 800cb56: 76fb strb r3, [r7, #27] + + /* @todo: must this be increased even if error occurred? */ + MIB2_STATS_INC(mib2.udpoutdatagrams); + + /* did we chain a separate header pbuf earlier? */ + if (q != p) { + 800cb58: 69fa ldr r2, [r7, #28] + 800cb5a: 68bb ldr r3, [r7, #8] + 800cb5c: 429a cmp r2, r3 + 800cb5e: d004 beq.n 800cb6a + /* free the header pbuf */ + pbuf_free(q); + 800cb60: 69f8 ldr r0, [r7, #28] + 800cb62: f7f9 ff61 bl 8006a28 + q = NULL; + 800cb66: 2300 movs r3, #0 + 800cb68: 61fb str r3, [r7, #28] + /* p is still referenced by the caller, and will live on */ + } + + UDP_STATS_INC(udp.xmit); + return err; + 800cb6a: f997 301b ldrsb.w r3, [r7, #27] +} + 800cb6e: 4618 mov r0, r3 + 800cb70: 3720 adds r7, #32 + 800cb72: 46bd mov sp, r7 + 800cb74: bd80 pop {r7, pc} + 800cb76: bf00 nop + 800cb78: 08017fa0 .word 0x08017fa0 + 800cb7c: 0801818c .word 0x0801818c + 800cb80: 08017ff4 .word 0x08017ff4 + 800cb84: 080181ac .word 0x080181ac + 800cb88: 080181cc .word 0x080181cc + 800cb8c: 080181f0 .word 0x080181f0 + 800cb90: 08018214 .word 0x08018214 + 800cb94: 08018238 .word 0x08018238 + +0800cb98 : + * + * @see udp_disconnect() + */ +err_t +udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) +{ + 800cb98: b580 push {r7, lr} + 800cb9a: b086 sub sp, #24 + 800cb9c: af00 add r7, sp, #0 + 800cb9e: 60f8 str r0, [r7, #12] + 800cba0: 60b9 str r1, [r7, #8] + 800cba2: 4613 mov r3, r2 + 800cba4: 80fb strh r3, [r7, #6] + + LWIP_ASSERT_CORE_LOCKED(); + +#if LWIP_IPV4 + /* Don't propagate NULL pointer (IPv4 ANY) to subsequent functions */ + if (ipaddr == NULL) { + 800cba6: 68bb ldr r3, [r7, #8] + 800cba8: 2b00 cmp r3, #0 + 800cbaa: d101 bne.n 800cbb0 + ipaddr = IP4_ADDR_ANY; + 800cbac: 4b39 ldr r3, [pc, #228] @ (800cc94 ) + 800cbae: 60bb str r3, [r7, #8] + } +#else /* LWIP_IPV4 */ + LWIP_ERROR("udp_bind: invalid ipaddr", ipaddr != NULL, return ERR_ARG); +#endif /* LWIP_IPV4 */ + + LWIP_ERROR("udp_bind: invalid pcb", pcb != NULL, return ERR_ARG); + 800cbb0: 68fb ldr r3, [r7, #12] + 800cbb2: 2b00 cmp r3, #0 + 800cbb4: d109 bne.n 800cbca + 800cbb6: 4b38 ldr r3, [pc, #224] @ (800cc98 ) + 800cbb8: f240 32b7 movw r2, #951 @ 0x3b7 + 800cbbc: 4937 ldr r1, [pc, #220] @ (800cc9c ) + 800cbbe: 4838 ldr r0, [pc, #224] @ (800cca0 ) + 800cbc0: f004 fd1a bl 80115f8 + 800cbc4: f06f 030f mvn.w r3, #15 + 800cbc8: e060 b.n 800cc8c + + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_bind(ipaddr = ")); + ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE, ipaddr); + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port)); + + rebind = 0; + 800cbca: 2300 movs r3, #0 + 800cbcc: 74fb strb r3, [r7, #19] + /* Check for double bind and rebind of the same pcb */ + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + 800cbce: 4b35 ldr r3, [pc, #212] @ (800cca4 ) + 800cbd0: 681b ldr r3, [r3, #0] + 800cbd2: 617b str r3, [r7, #20] + 800cbd4: e009 b.n 800cbea + /* is this UDP PCB already on active list? */ + if (pcb == ipcb) { + 800cbd6: 68fa ldr r2, [r7, #12] + 800cbd8: 697b ldr r3, [r7, #20] + 800cbda: 429a cmp r2, r3 + 800cbdc: d102 bne.n 800cbe4 + rebind = 1; + 800cbde: 2301 movs r3, #1 + 800cbe0: 74fb strb r3, [r7, #19] + break; + 800cbe2: e005 b.n 800cbf0 + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + 800cbe4: 697b ldr r3, [r7, #20] + 800cbe6: 68db ldr r3, [r3, #12] + 800cbe8: 617b str r3, [r7, #20] + 800cbea: 697b ldr r3, [r7, #20] + 800cbec: 2b00 cmp r3, #0 + 800cbee: d1f2 bne.n 800cbd6 + ipaddr = &zoned_ipaddr; + } +#endif /* LWIP_IPV6 && LWIP_IPV6_SCOPES */ + + /* no port specified? */ + if (port == 0) { + 800cbf0: 88fb ldrh r3, [r7, #6] + 800cbf2: 2b00 cmp r3, #0 + 800cbf4: d109 bne.n 800cc0a + port = udp_new_port(); + 800cbf6: f7ff fc69 bl 800c4cc + 800cbfa: 4603 mov r3, r0 + 800cbfc: 80fb strh r3, [r7, #6] + if (port == 0) { + 800cbfe: 88fb ldrh r3, [r7, #6] + 800cc00: 2b00 cmp r3, #0 + 800cc02: d12c bne.n 800cc5e + /* no more ports available in local range */ + LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n")); + return ERR_USE; + 800cc04: f06f 0307 mvn.w r3, #7 + 800cc08: e040 b.n 800cc8c + } + } else { + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + 800cc0a: 4b26 ldr r3, [pc, #152] @ (800cca4 ) + 800cc0c: 681b ldr r3, [r3, #0] + 800cc0e: 617b str r3, [r7, #20] + 800cc10: e022 b.n 800cc58 + if (pcb != ipcb) { + 800cc12: 68fa ldr r2, [r7, #12] + 800cc14: 697b ldr r3, [r7, #20] + 800cc16: 429a cmp r2, r3 + 800cc18: d01b beq.n 800cc52 + if (!ip_get_option(pcb, SOF_REUSEADDR) || + !ip_get_option(ipcb, SOF_REUSEADDR)) +#endif /* SO_REUSE */ + { + /* port matches that of PCB in list and REUSEADDR not set -> reject */ + if ((ipcb->local_port == port) && + 800cc1a: 697b ldr r3, [r7, #20] + 800cc1c: 8a5b ldrh r3, [r3, #18] + 800cc1e: 88fa ldrh r2, [r7, #6] + 800cc20: 429a cmp r2, r3 + 800cc22: d116 bne.n 800cc52 + /* IP address matches or any IP used? */ + (ip_addr_cmp(&ipcb->local_ip, ipaddr) || ip_addr_isany(ipaddr) || + 800cc24: 697b ldr r3, [r7, #20] + 800cc26: 681a ldr r2, [r3, #0] + 800cc28: 68bb ldr r3, [r7, #8] + 800cc2a: 681b ldr r3, [r3, #0] + if ((ipcb->local_port == port) && + 800cc2c: 429a cmp r2, r3 + 800cc2e: d00d beq.n 800cc4c + (ip_addr_cmp(&ipcb->local_ip, ipaddr) || ip_addr_isany(ipaddr) || + 800cc30: 68bb ldr r3, [r7, #8] + 800cc32: 2b00 cmp r3, #0 + 800cc34: d00a beq.n 800cc4c + 800cc36: 68bb ldr r3, [r7, #8] + 800cc38: 681b ldr r3, [r3, #0] + 800cc3a: 2b00 cmp r3, #0 + 800cc3c: d006 beq.n 800cc4c + ip_addr_isany(&ipcb->local_ip))) { + 800cc3e: 697b ldr r3, [r7, #20] + (ip_addr_cmp(&ipcb->local_ip, ipaddr) || ip_addr_isany(ipaddr) || + 800cc40: 2b00 cmp r3, #0 + 800cc42: d003 beq.n 800cc4c + ip_addr_isany(&ipcb->local_ip))) { + 800cc44: 697b ldr r3, [r7, #20] + 800cc46: 681b ldr r3, [r3, #0] + 800cc48: 2b00 cmp r3, #0 + 800cc4a: d102 bne.n 800cc52 + /* other PCB already binds to this local IP and port */ + LWIP_DEBUGF(UDP_DEBUG, + ("udp_bind: local port %"U16_F" already bound by another pcb\n", port)); + return ERR_USE; + 800cc4c: f06f 0307 mvn.w r3, #7 + 800cc50: e01c b.n 800cc8c + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + 800cc52: 697b ldr r3, [r7, #20] + 800cc54: 68db ldr r3, [r3, #12] + 800cc56: 617b str r3, [r7, #20] + 800cc58: 697b ldr r3, [r7, #20] + 800cc5a: 2b00 cmp r3, #0 + 800cc5c: d1d9 bne.n 800cc12 + } + } + } + } + + ip_addr_set_ipaddr(&pcb->local_ip, ipaddr); + 800cc5e: 68bb ldr r3, [r7, #8] + 800cc60: 2b00 cmp r3, #0 + 800cc62: d002 beq.n 800cc6a + 800cc64: 68bb ldr r3, [r7, #8] + 800cc66: 681b ldr r3, [r3, #0] + 800cc68: e000 b.n 800cc6c + 800cc6a: 2300 movs r3, #0 + 800cc6c: 68fa ldr r2, [r7, #12] + 800cc6e: 6013 str r3, [r2, #0] + + pcb->local_port = port; + 800cc70: 68fb ldr r3, [r7, #12] + 800cc72: 88fa ldrh r2, [r7, #6] + 800cc74: 825a strh r2, [r3, #18] + mib2_udp_bind(pcb); + /* pcb not active yet? */ + if (rebind == 0) { + 800cc76: 7cfb ldrb r3, [r7, #19] + 800cc78: 2b00 cmp r3, #0 + 800cc7a: d106 bne.n 800cc8a + /* place the PCB on the active list if not already there */ + pcb->next = udp_pcbs; + 800cc7c: 4b09 ldr r3, [pc, #36] @ (800cca4 ) + 800cc7e: 681a ldr r2, [r3, #0] + 800cc80: 68fb ldr r3, [r7, #12] + 800cc82: 60da str r2, [r3, #12] + udp_pcbs = pcb; + 800cc84: 4a07 ldr r2, [pc, #28] @ (800cca4 ) + 800cc86: 68fb ldr r3, [r7, #12] + 800cc88: 6013 str r3, [r2, #0] + } + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_bind: bound to ")); + ip_addr_debug_print_val(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, pcb->local_ip); + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->local_port)); + return ERR_OK; + 800cc8a: 2300 movs r3, #0 +} + 800cc8c: 4618 mov r0, r3 + 800cc8e: 3718 adds r7, #24 + 800cc90: 46bd mov sp, r7 + 800cc92: bd80 pop {r7, pc} + 800cc94: 08018ed4 .word 0x08018ed4 + 800cc98: 08017fa0 .word 0x08017fa0 + 800cc9c: 08018268 .word 0x08018268 + 800cca0: 08017ff4 .word 0x08017ff4 + 800cca4: 20019100 .word 0x20019100 + +0800cca8 : + * + * @see udp_disconnect() + */ +err_t +udp_connect(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) +{ + 800cca8: b580 push {r7, lr} + 800ccaa: b086 sub sp, #24 + 800ccac: af00 add r7, sp, #0 + 800ccae: 60f8 str r0, [r7, #12] + 800ccb0: 60b9 str r1, [r7, #8] + 800ccb2: 4613 mov r3, r2 + 800ccb4: 80fb strh r3, [r7, #6] + struct udp_pcb *ipcb; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("udp_connect: invalid pcb", pcb != NULL, return ERR_ARG); + 800ccb6: 68fb ldr r3, [r7, #12] + 800ccb8: 2b00 cmp r3, #0 + 800ccba: d109 bne.n 800ccd0 + 800ccbc: 4b2c ldr r3, [pc, #176] @ (800cd70 ) + 800ccbe: f240 4235 movw r2, #1077 @ 0x435 + 800ccc2: 492c ldr r1, [pc, #176] @ (800cd74 ) + 800ccc4: 482c ldr r0, [pc, #176] @ (800cd78 ) + 800ccc6: f004 fc97 bl 80115f8 + 800ccca: f06f 030f mvn.w r3, #15 + 800ccce: e04b b.n 800cd68 + LWIP_ERROR("udp_connect: invalid ipaddr", ipaddr != NULL, return ERR_ARG); + 800ccd0: 68bb ldr r3, [r7, #8] + 800ccd2: 2b00 cmp r3, #0 + 800ccd4: d109 bne.n 800ccea + 800ccd6: 4b26 ldr r3, [pc, #152] @ (800cd70 ) + 800ccd8: f240 4236 movw r2, #1078 @ 0x436 + 800ccdc: 4927 ldr r1, [pc, #156] @ (800cd7c ) + 800ccde: 4826 ldr r0, [pc, #152] @ (800cd78 ) + 800cce0: f004 fc8a bl 80115f8 + 800cce4: f06f 030f mvn.w r3, #15 + 800cce8: e03e b.n 800cd68 + + if (pcb->local_port == 0) { + 800ccea: 68fb ldr r3, [r7, #12] + 800ccec: 8a5b ldrh r3, [r3, #18] + 800ccee: 2b00 cmp r3, #0 + 800ccf0: d10f bne.n 800cd12 + err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port); + 800ccf2: 68f9 ldr r1, [r7, #12] + 800ccf4: 68fb ldr r3, [r7, #12] + 800ccf6: 8a5b ldrh r3, [r3, #18] + 800ccf8: 461a mov r2, r3 + 800ccfa: 68f8 ldr r0, [r7, #12] + 800ccfc: f7ff ff4c bl 800cb98 + 800cd00: 4603 mov r3, r0 + 800cd02: 74fb strb r3, [r7, #19] + if (err != ERR_OK) { + 800cd04: f997 3013 ldrsb.w r3, [r7, #19] + 800cd08: 2b00 cmp r3, #0 + 800cd0a: d002 beq.n 800cd12 + return err; + 800cd0c: f997 3013 ldrsb.w r3, [r7, #19] + 800cd10: e02a b.n 800cd68 + } + } + + ip_addr_set_ipaddr(&pcb->remote_ip, ipaddr); + 800cd12: 68bb ldr r3, [r7, #8] + 800cd14: 2b00 cmp r3, #0 + 800cd16: d002 beq.n 800cd1e + 800cd18: 68bb ldr r3, [r7, #8] + 800cd1a: 681b ldr r3, [r3, #0] + 800cd1c: e000 b.n 800cd20 + 800cd1e: 2300 movs r3, #0 + 800cd20: 68fa ldr r2, [r7, #12] + 800cd22: 6053 str r3, [r2, #4] + ip6_addr_lacks_zone(ip_2_ip6(&pcb->remote_ip), IP6_UNKNOWN)) { + ip6_addr_select_zone(ip_2_ip6(&pcb->remote_ip), ip_2_ip6(&pcb->local_ip)); + } +#endif /* LWIP_IPV6 && LWIP_IPV6_SCOPES */ + + pcb->remote_port = port; + 800cd24: 68fb ldr r3, [r7, #12] + 800cd26: 88fa ldrh r2, [r7, #6] + 800cd28: 829a strh r2, [r3, #20] + pcb->flags |= UDP_FLAGS_CONNECTED; + 800cd2a: 68fb ldr r3, [r7, #12] + 800cd2c: 7c1b ldrb r3, [r3, #16] + 800cd2e: f043 0304 orr.w r3, r3, #4 + 800cd32: b2da uxtb r2, r3 + 800cd34: 68fb ldr r3, [r7, #12] + 800cd36: 741a strb r2, [r3, #16] + ip_addr_debug_print_val(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + pcb->remote_ip); + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->remote_port)); + + /* Insert UDP PCB into the list of active UDP PCBs. */ + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + 800cd38: 4b11 ldr r3, [pc, #68] @ (800cd80 ) + 800cd3a: 681b ldr r3, [r3, #0] + 800cd3c: 617b str r3, [r7, #20] + 800cd3e: e008 b.n 800cd52 + if (pcb == ipcb) { + 800cd40: 68fa ldr r2, [r7, #12] + 800cd42: 697b ldr r3, [r7, #20] + 800cd44: 429a cmp r2, r3 + 800cd46: d101 bne.n 800cd4c + /* already on the list, just return */ + return ERR_OK; + 800cd48: 2300 movs r3, #0 + 800cd4a: e00d b.n 800cd68 + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + 800cd4c: 697b ldr r3, [r7, #20] + 800cd4e: 68db ldr r3, [r3, #12] + 800cd50: 617b str r3, [r7, #20] + 800cd52: 697b ldr r3, [r7, #20] + 800cd54: 2b00 cmp r3, #0 + 800cd56: d1f3 bne.n 800cd40 + } + } + /* PCB not yet on the list, add PCB now */ + pcb->next = udp_pcbs; + 800cd58: 4b09 ldr r3, [pc, #36] @ (800cd80 ) + 800cd5a: 681a ldr r2, [r3, #0] + 800cd5c: 68fb ldr r3, [r7, #12] + 800cd5e: 60da str r2, [r3, #12] + udp_pcbs = pcb; + 800cd60: 4a07 ldr r2, [pc, #28] @ (800cd80 ) + 800cd62: 68fb ldr r3, [r7, #12] + 800cd64: 6013 str r3, [r2, #0] + return ERR_OK; + 800cd66: 2300 movs r3, #0 +} + 800cd68: 4618 mov r0, r3 + 800cd6a: 3718 adds r7, #24 + 800cd6c: 46bd mov sp, r7 + 800cd6e: bd80 pop {r7, pc} + 800cd70: 08017fa0 .word 0x08017fa0 + 800cd74: 08018280 .word 0x08018280 + 800cd78: 08017ff4 .word 0x08017ff4 + 800cd7c: 0801829c .word 0x0801829c + 800cd80: 20019100 .word 0x20019100 + +0800cd84 : + * @param recv function pointer of the callback function + * @param recv_arg additional argument to pass to the callback function + */ +void +udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg) +{ + 800cd84: b580 push {r7, lr} + 800cd86: b084 sub sp, #16 + 800cd88: af00 add r7, sp, #0 + 800cd8a: 60f8 str r0, [r7, #12] + 800cd8c: 60b9 str r1, [r7, #8] + 800cd8e: 607a str r2, [r7, #4] + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("udp_recv: invalid pcb", pcb != NULL, return); + 800cd90: 68fb ldr r3, [r7, #12] + 800cd92: 2b00 cmp r3, #0 + 800cd94: d107 bne.n 800cda6 + 800cd96: 4b08 ldr r3, [pc, #32] @ (800cdb8 ) + 800cd98: f240 428a movw r2, #1162 @ 0x48a + 800cd9c: 4907 ldr r1, [pc, #28] @ (800cdbc ) + 800cd9e: 4808 ldr r0, [pc, #32] @ (800cdc0 ) + 800cda0: f004 fc2a bl 80115f8 + 800cda4: e005 b.n 800cdb2 + + /* remember recv() callback and user data */ + pcb->recv = recv; + 800cda6: 68fb ldr r3, [r7, #12] + 800cda8: 68ba ldr r2, [r7, #8] + 800cdaa: 619a str r2, [r3, #24] + pcb->recv_arg = recv_arg; + 800cdac: 68fb ldr r3, [r7, #12] + 800cdae: 687a ldr r2, [r7, #4] + 800cdb0: 61da str r2, [r3, #28] +} + 800cdb2: 3710 adds r7, #16 + 800cdb4: 46bd mov sp, r7 + 800cdb6: bd80 pop {r7, pc} + 800cdb8: 08017fa0 .word 0x08017fa0 + 800cdbc: 080182d4 .word 0x080182d4 + 800cdc0: 08017ff4 .word 0x08017ff4 + +0800cdc4 : + * + * @see udp_new() + */ +void +udp_remove(struct udp_pcb *pcb) +{ + 800cdc4: b580 push {r7, lr} + 800cdc6: b084 sub sp, #16 + 800cdc8: af00 add r7, sp, #0 + 800cdca: 6078 str r0, [r7, #4] + struct udp_pcb *pcb2; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("udp_remove: invalid pcb", pcb != NULL, return); + 800cdcc: 687b ldr r3, [r7, #4] + 800cdce: 2b00 cmp r3, #0 + 800cdd0: d107 bne.n 800cde2 + 800cdd2: 4b19 ldr r3, [pc, #100] @ (800ce38 ) + 800cdd4: f240 42a1 movw r2, #1185 @ 0x4a1 + 800cdd8: 4918 ldr r1, [pc, #96] @ (800ce3c ) + 800cdda: 4819 ldr r0, [pc, #100] @ (800ce40 ) + 800cddc: f004 fc0c bl 80115f8 + 800cde0: e026 b.n 800ce30 + + mib2_udp_unbind(pcb); + /* pcb to be removed is first in list? */ + if (udp_pcbs == pcb) { + 800cde2: 4b18 ldr r3, [pc, #96] @ (800ce44 ) + 800cde4: 681b ldr r3, [r3, #0] + 800cde6: 687a ldr r2, [r7, #4] + 800cde8: 429a cmp r2, r3 + 800cdea: d105 bne.n 800cdf8 + /* make list start at 2nd pcb */ + udp_pcbs = udp_pcbs->next; + 800cdec: 4b15 ldr r3, [pc, #84] @ (800ce44 ) + 800cdee: 681b ldr r3, [r3, #0] + 800cdf0: 68db ldr r3, [r3, #12] + 800cdf2: 4a14 ldr r2, [pc, #80] @ (800ce44 ) + 800cdf4: 6013 str r3, [r2, #0] + 800cdf6: e017 b.n 800ce28 + /* pcb not 1st in list */ + } else { + for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) { + 800cdf8: 4b12 ldr r3, [pc, #72] @ (800ce44 ) + 800cdfa: 681b ldr r3, [r3, #0] + 800cdfc: 60fb str r3, [r7, #12] + 800cdfe: e010 b.n 800ce22 + /* find pcb in udp_pcbs list */ + if (pcb2->next != NULL && pcb2->next == pcb) { + 800ce00: 68fb ldr r3, [r7, #12] + 800ce02: 68db ldr r3, [r3, #12] + 800ce04: 2b00 cmp r3, #0 + 800ce06: d009 beq.n 800ce1c + 800ce08: 68fb ldr r3, [r7, #12] + 800ce0a: 68db ldr r3, [r3, #12] + 800ce0c: 687a ldr r2, [r7, #4] + 800ce0e: 429a cmp r2, r3 + 800ce10: d104 bne.n 800ce1c + /* remove pcb from list */ + pcb2->next = pcb->next; + 800ce12: 687b ldr r3, [r7, #4] + 800ce14: 68da ldr r2, [r3, #12] + 800ce16: 68fb ldr r3, [r7, #12] + 800ce18: 60da str r2, [r3, #12] + break; + 800ce1a: e005 b.n 800ce28 + for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) { + 800ce1c: 68fb ldr r3, [r7, #12] + 800ce1e: 68db ldr r3, [r3, #12] + 800ce20: 60fb str r3, [r7, #12] + 800ce22: 68fb ldr r3, [r7, #12] + 800ce24: 2b00 cmp r3, #0 + 800ce26: d1eb bne.n 800ce00 + } + } + } + memp_free(MEMP_UDP_PCB, pcb); + 800ce28: 6879 ldr r1, [r7, #4] + 800ce2a: 2000 movs r0, #0 + 800ce2c: f7f8 ff7c bl 8005d28 +} + 800ce30: 3710 adds r7, #16 + 800ce32: 46bd mov sp, r7 + 800ce34: bd80 pop {r7, pc} + 800ce36: bf00 nop + 800ce38: 08017fa0 .word 0x08017fa0 + 800ce3c: 080182ec .word 0x080182ec + 800ce40: 08017ff4 .word 0x08017ff4 + 800ce44: 20019100 .word 0x20019100 + +0800ce48 : + * + * @see udp_remove() + */ +struct udp_pcb * +udp_new(void) +{ + 800ce48: b580 push {r7, lr} + 800ce4a: b082 sub sp, #8 + 800ce4c: af00 add r7, sp, #0 + struct udp_pcb *pcb; + + LWIP_ASSERT_CORE_LOCKED(); + + pcb = (struct udp_pcb *)memp_malloc(MEMP_UDP_PCB); + 800ce4e: 2000 movs r0, #0 + 800ce50: f7f8 fefa bl 8005c48 + 800ce54: 6078 str r0, [r7, #4] + /* could allocate UDP PCB? */ + if (pcb != NULL) { + 800ce56: 687b ldr r3, [r7, #4] + 800ce58: 2b00 cmp r3, #0 + 800ce5a: d007 beq.n 800ce6c + /* UDP Lite: by initializing to all zeroes, chksum_len is set to 0 + * which means checksum is generated over the whole datagram per default + * (recommended as default by RFC 3828). */ + /* initialize PCB to all zeroes */ + memset(pcb, 0, sizeof(struct udp_pcb)); + 800ce5c: 2220 movs r2, #32 + 800ce5e: 2100 movs r1, #0 + 800ce60: 6878 ldr r0, [r7, #4] + 800ce62: f004 fc48 bl 80116f6 + pcb->ttl = UDP_TTL; + 800ce66: 687b ldr r3, [r7, #4] + 800ce68: 22ff movs r2, #255 @ 0xff + 800ce6a: 72da strb r2, [r3, #11] +#if LWIP_MULTICAST_TX_OPTIONS + udp_set_multicast_ttl(pcb, UDP_TTL); +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + } + return pcb; + 800ce6c: 687b ldr r3, [r7, #4] +} + 800ce6e: 4618 mov r0, r3 + 800ce70: 3708 adds r7, #8 + 800ce72: 46bd mov sp, r7 + 800ce74: bd80 pop {r7, pc} + ... + +0800ce78 : + * + * @param old_addr IP address of the netif before change + * @param new_addr IP address of the netif after change + */ +void udp_netif_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr) +{ + 800ce78: b480 push {r7} + 800ce7a: b085 sub sp, #20 + 800ce7c: af00 add r7, sp, #0 + 800ce7e: 6078 str r0, [r7, #4] + 800ce80: 6039 str r1, [r7, #0] + struct udp_pcb *upcb; + + if (!ip_addr_isany(old_addr) && !ip_addr_isany(new_addr)) { + 800ce82: 687b ldr r3, [r7, #4] + 800ce84: 2b00 cmp r3, #0 + 800ce86: d01e beq.n 800cec6 + 800ce88: 687b ldr r3, [r7, #4] + 800ce8a: 681b ldr r3, [r3, #0] + 800ce8c: 2b00 cmp r3, #0 + 800ce8e: d01a beq.n 800cec6 + 800ce90: 683b ldr r3, [r7, #0] + 800ce92: 2b00 cmp r3, #0 + 800ce94: d017 beq.n 800cec6 + 800ce96: 683b ldr r3, [r7, #0] + 800ce98: 681b ldr r3, [r3, #0] + 800ce9a: 2b00 cmp r3, #0 + 800ce9c: d013 beq.n 800cec6 + for (upcb = udp_pcbs; upcb != NULL; upcb = upcb->next) { + 800ce9e: 4b0d ldr r3, [pc, #52] @ (800ced4 ) + 800cea0: 681b ldr r3, [r3, #0] + 800cea2: 60fb str r3, [r7, #12] + 800cea4: e00c b.n 800cec0 + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&upcb->local_ip, old_addr)) { + 800cea6: 68fb ldr r3, [r7, #12] + 800cea8: 681a ldr r2, [r3, #0] + 800ceaa: 687b ldr r3, [r7, #4] + 800ceac: 681b ldr r3, [r3, #0] + 800ceae: 429a cmp r2, r3 + 800ceb0: d103 bne.n 800ceba + /* The PCB is bound to the old ipaddr and + * is set to bound to the new one instead */ + ip_addr_copy(upcb->local_ip, *new_addr); + 800ceb2: 683b ldr r3, [r7, #0] + 800ceb4: 681a ldr r2, [r3, #0] + 800ceb6: 68fb ldr r3, [r7, #12] + 800ceb8: 601a str r2, [r3, #0] + for (upcb = udp_pcbs; upcb != NULL; upcb = upcb->next) { + 800ceba: 68fb ldr r3, [r7, #12] + 800cebc: 68db ldr r3, [r3, #12] + 800cebe: 60fb str r3, [r7, #12] + 800cec0: 68fb ldr r3, [r7, #12] + 800cec2: 2b00 cmp r3, #0 + 800cec4: d1ef bne.n 800cea6 + } + } + } +} + 800cec6: bf00 nop + 800cec8: 3714 adds r7, #20 + 800ceca: 46bd mov sp, r7 + 800cecc: f85d 7b04 ldr.w r7, [sp], #4 + 800ced0: 4770 bx lr + 800ced2: bf00 nop + 800ced4: 20019100 .word 0x20019100 + +0800ced8 : +static void dhcp_option_trailer(u16_t options_out_len, u8_t *options, struct pbuf *p_out); + +/** Ensure DHCP PCB is allocated and bound */ +static err_t +dhcp_inc_pcb_refcount(void) +{ + 800ced8: b580 push {r7, lr} + 800ceda: af00 add r7, sp, #0 + if (dhcp_pcb_refcount == 0) { + 800cedc: 4b20 ldr r3, [pc, #128] @ (800cf60 ) + 800cede: 781b ldrb r3, [r3, #0] + 800cee0: 2b00 cmp r3, #0 + 800cee2: d133 bne.n 800cf4c + LWIP_ASSERT("dhcp_inc_pcb_refcount(): memory leak", dhcp_pcb == NULL); + 800cee4: 4b1f ldr r3, [pc, #124] @ (800cf64 ) + 800cee6: 681b ldr r3, [r3, #0] + 800cee8: 2b00 cmp r3, #0 + 800ceea: d005 beq.n 800cef8 + 800ceec: 4b1e ldr r3, [pc, #120] @ (800cf68 ) + 800ceee: 22e5 movs r2, #229 @ 0xe5 + 800cef0: 491e ldr r1, [pc, #120] @ (800cf6c ) + 800cef2: 481f ldr r0, [pc, #124] @ (800cf70 ) + 800cef4: f004 fb80 bl 80115f8 + + /* allocate UDP PCB */ + dhcp_pcb = udp_new(); + 800cef8: f7ff ffa6 bl 800ce48 + 800cefc: 4603 mov r3, r0 + 800cefe: 4a19 ldr r2, [pc, #100] @ (800cf64 ) + 800cf00: 6013 str r3, [r2, #0] + + if (dhcp_pcb == NULL) { + 800cf02: 4b18 ldr r3, [pc, #96] @ (800cf64 ) + 800cf04: 681b ldr r3, [r3, #0] + 800cf06: 2b00 cmp r3, #0 + 800cf08: d102 bne.n 800cf10 + return ERR_MEM; + 800cf0a: f04f 33ff mov.w r3, #4294967295 + 800cf0e: e024 b.n 800cf5a + } + + ip_set_option(dhcp_pcb, SOF_BROADCAST); + 800cf10: 4b14 ldr r3, [pc, #80] @ (800cf64 ) + 800cf12: 681b ldr r3, [r3, #0] + 800cf14: 7a5a ldrb r2, [r3, #9] + 800cf16: 4b13 ldr r3, [pc, #76] @ (800cf64 ) + 800cf18: 681b ldr r3, [r3, #0] + 800cf1a: f042 0220 orr.w r2, r2, #32 + 800cf1e: b2d2 uxtb r2, r2 + 800cf20: 725a strb r2, [r3, #9] + + /* set up local and remote port for the pcb -> listen on all interfaces on all src/dest IPs */ + udp_bind(dhcp_pcb, IP4_ADDR_ANY, LWIP_IANA_PORT_DHCP_CLIENT); + 800cf22: 4b10 ldr r3, [pc, #64] @ (800cf64 ) + 800cf24: 681b ldr r3, [r3, #0] + 800cf26: 2244 movs r2, #68 @ 0x44 + 800cf28: 4912 ldr r1, [pc, #72] @ (800cf74 ) + 800cf2a: 4618 mov r0, r3 + 800cf2c: f7ff fe34 bl 800cb98 + udp_connect(dhcp_pcb, IP4_ADDR_ANY, LWIP_IANA_PORT_DHCP_SERVER); + 800cf30: 4b0c ldr r3, [pc, #48] @ (800cf64 ) + 800cf32: 681b ldr r3, [r3, #0] + 800cf34: 2243 movs r2, #67 @ 0x43 + 800cf36: 490f ldr r1, [pc, #60] @ (800cf74 ) + 800cf38: 4618 mov r0, r3 + 800cf3a: f7ff feb5 bl 800cca8 + udp_recv(dhcp_pcb, dhcp_recv, NULL); + 800cf3e: 4b09 ldr r3, [pc, #36] @ (800cf64 ) + 800cf40: 681b ldr r3, [r3, #0] + 800cf42: 2200 movs r2, #0 + 800cf44: 490c ldr r1, [pc, #48] @ (800cf78 ) + 800cf46: 4618 mov r0, r3 + 800cf48: f7ff ff1c bl 800cd84 + } + + dhcp_pcb_refcount++; + 800cf4c: 4b04 ldr r3, [pc, #16] @ (800cf60 ) + 800cf4e: 781b ldrb r3, [r3, #0] + 800cf50: 3301 adds r3, #1 + 800cf52: b2da uxtb r2, r3 + 800cf54: 4b02 ldr r3, [pc, #8] @ (800cf60 ) + 800cf56: 701a strb r2, [r3, #0] + + return ERR_OK; + 800cf58: 2300 movs r3, #0 +} + 800cf5a: 4618 mov r0, r3 + 800cf5c: bd80 pop {r7, pc} + 800cf5e: bf00 nop + 800cf60: 20019130 .word 0x20019130 + 800cf64: 2001912c .word 0x2001912c + 800cf68: 08018304 .word 0x08018304 + 800cf6c: 0801833c .word 0x0801833c + 800cf70: 08018364 .word 0x08018364 + 800cf74: 08018ed4 .word 0x08018ed4 + 800cf78: 0800e801 .word 0x0800e801 + +0800cf7c : + +/** Free DHCP PCB if the last netif stops using it */ +static void +dhcp_dec_pcb_refcount(void) +{ + 800cf7c: b580 push {r7, lr} + 800cf7e: af00 add r7, sp, #0 + LWIP_ASSERT("dhcp_pcb_refcount(): refcount error", (dhcp_pcb_refcount > 0)); + 800cf80: 4b0e ldr r3, [pc, #56] @ (800cfbc ) + 800cf82: 781b ldrb r3, [r3, #0] + 800cf84: 2b00 cmp r3, #0 + 800cf86: d105 bne.n 800cf94 + 800cf88: 4b0d ldr r3, [pc, #52] @ (800cfc0 ) + 800cf8a: 22ff movs r2, #255 @ 0xff + 800cf8c: 490d ldr r1, [pc, #52] @ (800cfc4 ) + 800cf8e: 480e ldr r0, [pc, #56] @ (800cfc8 ) + 800cf90: f004 fb32 bl 80115f8 + dhcp_pcb_refcount--; + 800cf94: 4b09 ldr r3, [pc, #36] @ (800cfbc ) + 800cf96: 781b ldrb r3, [r3, #0] + 800cf98: 3b01 subs r3, #1 + 800cf9a: b2da uxtb r2, r3 + 800cf9c: 4b07 ldr r3, [pc, #28] @ (800cfbc ) + 800cf9e: 701a strb r2, [r3, #0] + + if (dhcp_pcb_refcount == 0) { + 800cfa0: 4b06 ldr r3, [pc, #24] @ (800cfbc ) + 800cfa2: 781b ldrb r3, [r3, #0] + 800cfa4: 2b00 cmp r3, #0 + 800cfa6: d107 bne.n 800cfb8 + udp_remove(dhcp_pcb); + 800cfa8: 4b08 ldr r3, [pc, #32] @ (800cfcc ) + 800cfaa: 681b ldr r3, [r3, #0] + 800cfac: 4618 mov r0, r3 + 800cfae: f7ff ff09 bl 800cdc4 + dhcp_pcb = NULL; + 800cfb2: 4b06 ldr r3, [pc, #24] @ (800cfcc ) + 800cfb4: 2200 movs r2, #0 + 800cfb6: 601a str r2, [r3, #0] + } +} + 800cfb8: bf00 nop + 800cfba: bd80 pop {r7, pc} + 800cfbc: 20019130 .word 0x20019130 + 800cfc0: 08018304 .word 0x08018304 + 800cfc4: 0801838c .word 0x0801838c + 800cfc8: 08018364 .word 0x08018364 + 800cfcc: 2001912c .word 0x2001912c + +0800cfd0 : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_handle_nak(struct netif *netif) +{ + 800cfd0: b580 push {r7, lr} + 800cfd2: b084 sub sp, #16 + 800cfd4: af00 add r7, sp, #0 + 800cfd6: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800cfd8: 687b ldr r3, [r7, #4] + 800cfda: 6a5b ldr r3, [r3, #36] @ 0x24 + 800cfdc: 60fb str r3, [r7, #12] + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", + (void *)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + /* Change to a defined state - set this before assigning the address + to ensure the callback can use dhcp_supplied_address() */ + dhcp_set_state(dhcp, DHCP_STATE_BACKING_OFF); + 800cfde: 210c movs r1, #12 + 800cfe0: 68f8 ldr r0, [r7, #12] + 800cfe2: f001 f84f bl 800e084 + /* remove IP address from interface (must no longer be used, as per RFC2131) */ + netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4); + 800cfe6: 4b06 ldr r3, [pc, #24] @ (800d000 ) + 800cfe8: 4a05 ldr r2, [pc, #20] @ (800d000 ) + 800cfea: 4905 ldr r1, [pc, #20] @ (800d000 ) + 800cfec: 6878 ldr r0, [r7, #4] + 800cfee: f7f9 f83d bl 800606c + /* We can immediately restart discovery */ + dhcp_discover(netif); + 800cff2: 6878 ldr r0, [r7, #4] + 800cff4: f000 fc48 bl 800d888 +} + 800cff8: bf00 nop + 800cffa: 3710 adds r7, #16 + 800cffc: 46bd mov sp, r7 + 800cffe: bd80 pop {r7, pc} + 800d000: 08018ed4 .word 0x08018ed4 + +0800d004 : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_check(struct netif *netif) +{ + 800d004: b580 push {r7, lr} + 800d006: b084 sub sp, #16 + 800d008: af00 add r7, sp, #0 + 800d00a: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d00c: 687b ldr r3, [r7, #4] + 800d00e: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d010: 60fb str r3, [r7, #12] + err_t result; + u16_t msecs; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_check(netif=%p) %c%c\n", (void *)netif, (s16_t)netif->name[0], + (s16_t)netif->name[1])); + dhcp_set_state(dhcp, DHCP_STATE_CHECKING); + 800d012: 2108 movs r1, #8 + 800d014: 68f8 ldr r0, [r7, #12] + 800d016: f001 f835 bl 800e084 + /* create an ARP query for the offered IP address, expecting that no host + responds, as the IP address should not be in use. */ + result = etharp_query(netif, &dhcp->offered_ip_addr, NULL); + 800d01a: 68fb ldr r3, [r7, #12] + 800d01c: 331c adds r3, #28 + 800d01e: 2200 movs r2, #0 + 800d020: 4619 mov r1, r3 + 800d022: 6878 ldr r0, [r7, #4] + 800d024: f002 fb36 bl 800f694 + 800d028: 4603 mov r3, r0 + 800d02a: 72fb strb r3, [r7, #11] + if (result != ERR_OK) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_check: could not perform ARP query\n")); + } + if (dhcp->tries < 255) { + 800d02c: 68fb ldr r3, [r7, #12] + 800d02e: 799b ldrb r3, [r3, #6] + 800d030: 2bff cmp r3, #255 @ 0xff + 800d032: d005 beq.n 800d040 + dhcp->tries++; + 800d034: 68fb ldr r3, [r7, #12] + 800d036: 799b ldrb r3, [r3, #6] + 800d038: 3301 adds r3, #1 + 800d03a: b2da uxtb r2, r3 + 800d03c: 68fb ldr r3, [r7, #12] + 800d03e: 719a strb r2, [r3, #6] + } + msecs = 500; + 800d040: f44f 73fa mov.w r3, #500 @ 0x1f4 + 800d044: 813b strh r3, [r7, #8] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800d046: 893b ldrh r3, [r7, #8] + 800d048: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800d04c: 4a06 ldr r2, [pc, #24] @ (800d068 ) + 800d04e: fb82 1203 smull r1, r2, r2, r3 + 800d052: 1152 asrs r2, r2, #5 + 800d054: 17db asrs r3, r3, #31 + 800d056: 1ad3 subs r3, r2, r3 + 800d058: b29a uxth r2, r3 + 800d05a: 68fb ldr r3, [r7, #12] + 800d05c: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_check(): set request timeout %"U16_F" msecs\n", msecs)); +} + 800d05e: bf00 nop + 800d060: 3710 adds r7, #16 + 800d062: 46bd mov sp, r7 + 800d064: bd80 pop {r7, pc} + 800d066: bf00 nop + 800d068: 10624dd3 .word 0x10624dd3 + +0800d06c : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_handle_offer(struct netif *netif, struct dhcp_msg *msg_in) +{ + 800d06c: b580 push {r7, lr} + 800d06e: b084 sub sp, #16 + 800d070: af00 add r7, sp, #0 + 800d072: 6078 str r0, [r7, #4] + 800d074: 6039 str r1, [r7, #0] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d076: 687b ldr r3, [r7, #4] + 800d078: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d07a: 60fb str r3, [r7, #12] + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n", + (void *)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + /* obtain the server address */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) { + 800d07c: 4b0c ldr r3, [pc, #48] @ (800d0b0 ) + 800d07e: 789b ldrb r3, [r3, #2] + 800d080: 2b00 cmp r3, #0 + 800d082: d011 beq.n 800d0a8 + dhcp->request_timeout = 0; /* stop timer */ + 800d084: 68fb ldr r3, [r7, #12] + 800d086: 2200 movs r2, #0 + 800d088: 811a strh r2, [r3, #8] + + ip_addr_set_ip4_u32(&dhcp->server_ip_addr, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID))); + 800d08a: 4b0a ldr r3, [pc, #40] @ (800d0b4 ) + 800d08c: 689b ldr r3, [r3, #8] + 800d08e: 4618 mov r0, r3 + 800d090: f7f8 f98f bl 80053b2 + 800d094: 4602 mov r2, r0 + 800d096: 68fb ldr r3, [r7, #12] + 800d098: 619a str r2, [r3, #24] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n", + ip4_addr_get_u32(ip_2_ip4(&dhcp->server_ip_addr)))); + /* remember offered address */ + ip4_addr_copy(dhcp->offered_ip_addr, msg_in->yiaddr); + 800d09a: 683b ldr r3, [r7, #0] + 800d09c: 691a ldr r2, [r3, #16] + 800d09e: 68fb ldr r3, [r7, #12] + 800d0a0: 61da str r2, [r3, #28] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n", + ip4_addr_get_u32(&dhcp->offered_ip_addr))); + + dhcp_select(netif); + 800d0a2: 6878 ldr r0, [r7, #4] + 800d0a4: f000 f808 bl 800d0b8 + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("dhcp_handle_offer(netif=%p) did not get server ID!\n", (void *)netif)); + } +} + 800d0a8: bf00 nop + 800d0aa: 3710 adds r7, #16 + 800d0ac: 46bd mov sp, r7 + 800d0ae: bd80 pop {r7, pc} + 800d0b0: 20019124 .word 0x20019124 + 800d0b4: 20019104 .word 0x20019104 + +0800d0b8 : + * @param netif the netif under DHCP control + * @return lwIP specific error (see error.h) + */ +static err_t +dhcp_select(struct netif *netif) +{ + 800d0b8: b5b0 push {r4, r5, r7, lr} + 800d0ba: b08a sub sp, #40 @ 0x28 + 800d0bc: af02 add r7, sp, #8 + 800d0be: 6078 str r0, [r7, #4] + u16_t msecs; + u8_t i; + struct pbuf *p_out; + u16_t options_out_len; + + LWIP_ERROR("dhcp_select: netif != NULL", (netif != NULL), return ERR_ARG;); + 800d0c0: 687b ldr r3, [r7, #4] + 800d0c2: 2b00 cmp r3, #0 + 800d0c4: d109 bne.n 800d0da + 800d0c6: 4b71 ldr r3, [pc, #452] @ (800d28c ) + 800d0c8: f240 1277 movw r2, #375 @ 0x177 + 800d0cc: 4970 ldr r1, [pc, #448] @ (800d290 ) + 800d0ce: 4871 ldr r0, [pc, #452] @ (800d294 ) + 800d0d0: f004 fa92 bl 80115f8 + 800d0d4: f06f 030f mvn.w r3, #15 + 800d0d8: e0d3 b.n 800d282 + dhcp = netif_dhcp_data(netif); + 800d0da: 687b ldr r3, [r7, #4] + 800d0dc: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d0de: 61bb str r3, [r7, #24] + LWIP_ERROR("dhcp_select: dhcp != NULL", (dhcp != NULL), return ERR_VAL;); + 800d0e0: 69bb ldr r3, [r7, #24] + 800d0e2: 2b00 cmp r3, #0 + 800d0e4: d109 bne.n 800d0fa + 800d0e6: 4b69 ldr r3, [pc, #420] @ (800d28c ) + 800d0e8: f240 1279 movw r2, #377 @ 0x179 + 800d0ec: 496a ldr r1, [pc, #424] @ (800d298 ) + 800d0ee: 4869 ldr r0, [pc, #420] @ (800d294 ) + 800d0f0: f004 fa82 bl 80115f8 + 800d0f4: f06f 0305 mvn.w r3, #5 + 800d0f8: e0c3 b.n 800d282 + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_select(netif=%p) %c%c%"U16_F"\n", (void *)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + dhcp_set_state(dhcp, DHCP_STATE_REQUESTING); + 800d0fa: 2101 movs r1, #1 + 800d0fc: 69b8 ldr r0, [r7, #24] + 800d0fe: f000 ffc1 bl 800e084 + + /* create and initialize the DHCP message header */ + p_out = dhcp_create_msg(netif, dhcp, DHCP_REQUEST, &options_out_len); + 800d102: f107 030c add.w r3, r7, #12 + 800d106: 2203 movs r2, #3 + 800d108: 69b9 ldr r1, [r7, #24] + 800d10a: 6878 ldr r0, [r7, #4] + 800d10c: f001 fc46 bl 800e99c + 800d110: 6178 str r0, [r7, #20] + if (p_out != NULL) { + 800d112: 697b ldr r3, [r7, #20] + 800d114: 2b00 cmp r3, #0 + 800d116: f000 8085 beq.w 800d224 + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800d11a: 697b ldr r3, [r7, #20] + 800d11c: 685b ldr r3, [r3, #4] + 800d11e: 613b str r3, [r7, #16] + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + 800d120: 89b8 ldrh r0, [r7, #12] + 800d122: 693b ldr r3, [r7, #16] + 800d124: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d128: 2302 movs r3, #2 + 800d12a: 2239 movs r2, #57 @ 0x39 + 800d12c: f000 ffc4 bl 800e0b8 + 800d130: 4603 mov r3, r0 + 800d132: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_short(options_out_len, msg_out->options, DHCP_MAX_MSG_LEN(netif)); + 800d134: 89b8 ldrh r0, [r7, #12] + 800d136: 693b ldr r3, [r7, #16] + 800d138: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d13c: 687b ldr r3, [r7, #4] + 800d13e: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800d140: 461a mov r2, r3 + 800d142: f001 f813 bl 800e16c + 800d146: 4603 mov r3, r0 + 800d148: 81bb strh r3, [r7, #12] + + /* MUST request the offered IP address */ + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_REQUESTED_IP, 4); + 800d14a: 89b8 ldrh r0, [r7, #12] + 800d14c: 693b ldr r3, [r7, #16] + 800d14e: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d152: 2304 movs r3, #4 + 800d154: 2232 movs r2, #50 @ 0x32 + 800d156: f000 ffaf bl 800e0b8 + 800d15a: 4603 mov r3, r0 + 800d15c: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_long(options_out_len, msg_out->options, lwip_ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr))); + 800d15e: 89bc ldrh r4, [r7, #12] + 800d160: 693b ldr r3, [r7, #16] + 800d162: f103 05f0 add.w r5, r3, #240 @ 0xf0 + 800d166: 69bb ldr r3, [r7, #24] + 800d168: 69db ldr r3, [r3, #28] + 800d16a: 4618 mov r0, r3 + 800d16c: f7f8 f921 bl 80053b2 + 800d170: 4603 mov r3, r0 + 800d172: 461a mov r2, r3 + 800d174: 4629 mov r1, r5 + 800d176: 4620 mov r0, r4 + 800d178: f001 f82a bl 800e1d0 + 800d17c: 4603 mov r3, r0 + 800d17e: 81bb strh r3, [r7, #12] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_SERVER_ID, 4); + 800d180: 89b8 ldrh r0, [r7, #12] + 800d182: 693b ldr r3, [r7, #16] + 800d184: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d188: 2304 movs r3, #4 + 800d18a: 2236 movs r2, #54 @ 0x36 + 800d18c: f000 ff94 bl 800e0b8 + 800d190: 4603 mov r3, r0 + 800d192: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_long(options_out_len, msg_out->options, lwip_ntohl(ip4_addr_get_u32(ip_2_ip4(&dhcp->server_ip_addr)))); + 800d194: 89bc ldrh r4, [r7, #12] + 800d196: 693b ldr r3, [r7, #16] + 800d198: f103 05f0 add.w r5, r3, #240 @ 0xf0 + 800d19c: 69bb ldr r3, [r7, #24] + 800d19e: 699b ldr r3, [r3, #24] + 800d1a0: 4618 mov r0, r3 + 800d1a2: f7f8 f906 bl 80053b2 + 800d1a6: 4603 mov r3, r0 + 800d1a8: 461a mov r2, r3 + 800d1aa: 4629 mov r1, r5 + 800d1ac: 4620 mov r0, r4 + 800d1ae: f001 f80f bl 800e1d0 + 800d1b2: 4603 mov r3, r0 + 800d1b4: 81bb strh r3, [r7, #12] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + 800d1b6: 89b8 ldrh r0, [r7, #12] + 800d1b8: 693b ldr r3, [r7, #16] + 800d1ba: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d1be: 2303 movs r3, #3 + 800d1c0: 2237 movs r2, #55 @ 0x37 + 800d1c2: f000 ff79 bl 800e0b8 + 800d1c6: 4603 mov r3, r0 + 800d1c8: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800d1ca: 2300 movs r3, #0 + 800d1cc: 77bb strb r3, [r7, #30] + 800d1ce: e00e b.n 800d1ee + options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]); + 800d1d0: 89b8 ldrh r0, [r7, #12] + 800d1d2: 693b ldr r3, [r7, #16] + 800d1d4: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d1d8: 7fbb ldrb r3, [r7, #30] + 800d1da: 4a30 ldr r2, [pc, #192] @ (800d29c ) + 800d1dc: 5cd3 ldrb r3, [r2, r3] + 800d1de: 461a mov r2, r3 + 800d1e0: f000 ff9e bl 800e120 + 800d1e4: 4603 mov r3, r0 + 800d1e6: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800d1e8: 7fbb ldrb r3, [r7, #30] + 800d1ea: 3301 adds r3, #1 + 800d1ec: 77bb strb r3, [r7, #30] + 800d1ee: 7fbb ldrb r3, [r7, #30] + 800d1f0: 2b02 cmp r3, #2 + 800d1f2: d9ed bls.n 800d1d0 +#if LWIP_NETIF_HOSTNAME + options_out_len = dhcp_option_hostname(options_out_len, msg_out->options, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_REQUESTING, msg_out, DHCP_REQUEST, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800d1f4: 89b8 ldrh r0, [r7, #12] + 800d1f6: 693b ldr r3, [r7, #16] + 800d1f8: 33f0 adds r3, #240 @ 0xf0 + 800d1fa: 697a ldr r2, [r7, #20] + 800d1fc: 4619 mov r1, r3 + 800d1fe: f001 fca3 bl 800eb48 + + /* send broadcast to any DHCP server */ + result = udp_sendto_if_src(dhcp_pcb, p_out, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER, netif, IP4_ADDR_ANY); + 800d202: 4b27 ldr r3, [pc, #156] @ (800d2a0 ) + 800d204: 6818 ldr r0, [r3, #0] + 800d206: 4b27 ldr r3, [pc, #156] @ (800d2a4 ) + 800d208: 9301 str r3, [sp, #4] + 800d20a: 687b ldr r3, [r7, #4] + 800d20c: 9300 str r3, [sp, #0] + 800d20e: 2343 movs r3, #67 @ 0x43 + 800d210: 4a25 ldr r2, [pc, #148] @ (800d2a8 ) + 800d212: 6979 ldr r1, [r7, #20] + 800d214: f7ff fbda bl 800c9cc + 800d218: 4603 mov r3, r0 + 800d21a: 77fb strb r3, [r7, #31] + pbuf_free(p_out); + 800d21c: 6978 ldr r0, [r7, #20] + 800d21e: f7f9 fc03 bl 8006a28 + 800d222: e001 b.n 800d228 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_select: could not allocate DHCP request\n")); + result = ERR_MEM; + 800d224: 23ff movs r3, #255 @ 0xff + 800d226: 77fb strb r3, [r7, #31] + } + if (dhcp->tries < 255) { + 800d228: 69bb ldr r3, [r7, #24] + 800d22a: 799b ldrb r3, [r3, #6] + 800d22c: 2bff cmp r3, #255 @ 0xff + 800d22e: d005 beq.n 800d23c + dhcp->tries++; + 800d230: 69bb ldr r3, [r7, #24] + 800d232: 799b ldrb r3, [r3, #6] + 800d234: 3301 adds r3, #1 + 800d236: b2da uxtb r2, r3 + 800d238: 69bb ldr r3, [r7, #24] + 800d23a: 719a strb r2, [r3, #6] + } + msecs = (u16_t)((dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000); + 800d23c: 69bb ldr r3, [r7, #24] + 800d23e: 799b ldrb r3, [r3, #6] + 800d240: 2b05 cmp r3, #5 + 800d242: d80d bhi.n 800d260 + 800d244: 69bb ldr r3, [r7, #24] + 800d246: 799b ldrb r3, [r3, #6] + 800d248: 461a mov r2, r3 + 800d24a: 2301 movs r3, #1 + 800d24c: 4093 lsls r3, r2 + 800d24e: b29b uxth r3, r3 + 800d250: 461a mov r2, r3 + 800d252: 0152 lsls r2, r2, #5 + 800d254: 1ad2 subs r2, r2, r3 + 800d256: 0092 lsls r2, r2, #2 + 800d258: 4413 add r3, r2 + 800d25a: 00db lsls r3, r3, #3 + 800d25c: b29b uxth r3, r3 + 800d25e: e001 b.n 800d264 + 800d260: f64e 2360 movw r3, #60000 @ 0xea60 + 800d264: 81fb strh r3, [r7, #14] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800d266: 89fb ldrh r3, [r7, #14] + 800d268: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800d26c: 4a0f ldr r2, [pc, #60] @ (800d2ac ) + 800d26e: fb82 1203 smull r1, r2, r2, r3 + 800d272: 1152 asrs r2, r2, #5 + 800d274: 17db asrs r3, r3, #31 + 800d276: 1ad3 subs r3, r2, r3 + 800d278: b29a uxth r2, r3 + 800d27a: 69bb ldr r3, [r7, #24] + 800d27c: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_select(): set request timeout %"U16_F" msecs\n", msecs)); + return result; + 800d27e: f997 301f ldrsb.w r3, [r7, #31] +} + 800d282: 4618 mov r0, r3 + 800d284: 3720 adds r7, #32 + 800d286: 46bd mov sp, r7 + 800d288: bdb0 pop {r4, r5, r7, pc} + 800d28a: bf00 nop + 800d28c: 08018304 .word 0x08018304 + 800d290: 080183b0 .word 0x080183b0 + 800d294: 08018364 .word 0x08018364 + 800d298: 080183cc .word 0x080183cc + 800d29c: 2000002c .word 0x2000002c + 800d2a0: 2001912c .word 0x2001912c + 800d2a4: 08018ed4 .word 0x08018ed4 + 800d2a8: 08018ed8 .word 0x08018ed8 + 800d2ac: 10624dd3 .word 0x10624dd3 + +0800d2b0 : + * The DHCP timer that checks for lease renewal/rebind timeouts. + * Must be called once a minute (see @ref DHCP_COARSE_TIMER_SECS). + */ +void +dhcp_coarse_tmr(void) +{ + 800d2b0: b580 push {r7, lr} + 800d2b2: b082 sub sp, #8 + 800d2b4: af00 add r7, sp, #0 + struct netif *netif; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n")); + /* iterate through all network interfaces */ + NETIF_FOREACH(netif) { + 800d2b6: 4b27 ldr r3, [pc, #156] @ (800d354 ) + 800d2b8: 681b ldr r3, [r3, #0] + 800d2ba: 607b str r3, [r7, #4] + 800d2bc: e042 b.n 800d344 + /* only act on DHCP configured interfaces */ + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d2be: 687b ldr r3, [r7, #4] + 800d2c0: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d2c2: 603b str r3, [r7, #0] + if ((dhcp != NULL) && (dhcp->state != DHCP_STATE_OFF)) { + 800d2c4: 683b ldr r3, [r7, #0] + 800d2c6: 2b00 cmp r3, #0 + 800d2c8: d039 beq.n 800d33e + 800d2ca: 683b ldr r3, [r7, #0] + 800d2cc: 795b ldrb r3, [r3, #5] + 800d2ce: 2b00 cmp r3, #0 + 800d2d0: d035 beq.n 800d33e + /* compare lease time to expire timeout */ + if (dhcp->t0_timeout && (++dhcp->lease_used == dhcp->t0_timeout)) { + 800d2d2: 683b ldr r3, [r7, #0] + 800d2d4: 8a9b ldrh r3, [r3, #20] + 800d2d6: 2b00 cmp r3, #0 + 800d2d8: d012 beq.n 800d300 + 800d2da: 683b ldr r3, [r7, #0] + 800d2dc: 8a5b ldrh r3, [r3, #18] + 800d2de: 3301 adds r3, #1 + 800d2e0: b29a uxth r2, r3 + 800d2e2: 683b ldr r3, [r7, #0] + 800d2e4: 825a strh r2, [r3, #18] + 800d2e6: 683b ldr r3, [r7, #0] + 800d2e8: 8a5a ldrh r2, [r3, #18] + 800d2ea: 683b ldr r3, [r7, #0] + 800d2ec: 8a9b ldrh r3, [r3, #20] + 800d2ee: 429a cmp r2, r3 + 800d2f0: d106 bne.n 800d300 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t0 timeout\n")); + /* this clients' lease time has expired */ + dhcp_release_and_stop(netif); + 800d2f2: 6878 ldr r0, [r7, #4] + 800d2f4: f000 fe2c bl 800df50 + dhcp_start(netif); + 800d2f8: 6878 ldr r0, [r7, #4] + 800d2fa: f000 f969 bl 800d5d0 + 800d2fe: e01e b.n 800d33e + /* timer is active (non zero), and triggers (zeroes) now? */ + } else if (dhcp->t2_rebind_time && (dhcp->t2_rebind_time-- == 1)) { + 800d300: 683b ldr r3, [r7, #0] + 800d302: 8a1b ldrh r3, [r3, #16] + 800d304: 2b00 cmp r3, #0 + 800d306: d00b beq.n 800d320 + 800d308: 683b ldr r3, [r7, #0] + 800d30a: 8a1b ldrh r3, [r3, #16] + 800d30c: 1e5a subs r2, r3, #1 + 800d30e: b291 uxth r1, r2 + 800d310: 683a ldr r2, [r7, #0] + 800d312: 8211 strh r1, [r2, #16] + 800d314: 2b01 cmp r3, #1 + 800d316: d103 bne.n 800d320 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t2 timeout\n")); + /* this clients' rebind timeout triggered */ + dhcp_t2_timeout(netif); + 800d318: 6878 ldr r0, [r7, #4] + 800d31a: f000 f8c6 bl 800d4aa + 800d31e: e00e b.n 800d33e + /* timer is active (non zero), and triggers (zeroes) now */ + } else if (dhcp->t1_renew_time && (dhcp->t1_renew_time-- == 1)) { + 800d320: 683b ldr r3, [r7, #0] + 800d322: 89db ldrh r3, [r3, #14] + 800d324: 2b00 cmp r3, #0 + 800d326: d00a beq.n 800d33e + 800d328: 683b ldr r3, [r7, #0] + 800d32a: 89db ldrh r3, [r3, #14] + 800d32c: 1e5a subs r2, r3, #1 + 800d32e: b291 uxth r1, r2 + 800d330: 683a ldr r2, [r7, #0] + 800d332: 81d1 strh r1, [r2, #14] + 800d334: 2b01 cmp r3, #1 + 800d336: d102 bne.n 800d33e + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t1 timeout\n")); + /* this clients' renewal timeout triggered */ + dhcp_t1_timeout(netif); + 800d338: 6878 ldr r0, [r7, #4] + 800d33a: f000 f888 bl 800d44e + NETIF_FOREACH(netif) { + 800d33e: 687b ldr r3, [r7, #4] + 800d340: 681b ldr r3, [r3, #0] + 800d342: 607b str r3, [r7, #4] + 800d344: 687b ldr r3, [r7, #4] + 800d346: 2b00 cmp r3, #0 + 800d348: d1b9 bne.n 800d2be + } + } + } +} + 800d34a: bf00 nop + 800d34c: bf00 nop + 800d34e: 3708 adds r7, #8 + 800d350: 46bd mov sp, r7 + 800d352: bd80 pop {r7, pc} + 800d354: 20019098 .word 0x20019098 + +0800d358 : + * A DHCP server is expected to respond within a short period of time. + * This timer checks whether an outstanding DHCP request is timed out. + */ +void +dhcp_fine_tmr(void) +{ + 800d358: b580 push {r7, lr} + 800d35a: b082 sub sp, #8 + 800d35c: af00 add r7, sp, #0 + struct netif *netif; + /* loop through netif's */ + NETIF_FOREACH(netif) { + 800d35e: 4b16 ldr r3, [pc, #88] @ (800d3b8 ) + 800d360: 681b ldr r3, [r3, #0] + 800d362: 607b str r3, [r7, #4] + 800d364: e020 b.n 800d3a8 + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d366: 687b ldr r3, [r7, #4] + 800d368: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d36a: 603b str r3, [r7, #0] + /* only act on DHCP configured interfaces */ + if (dhcp != NULL) { + 800d36c: 683b ldr r3, [r7, #0] + 800d36e: 2b00 cmp r3, #0 + 800d370: d017 beq.n 800d3a2 + /* timer is active (non zero), and is about to trigger now */ + if (dhcp->request_timeout > 1) { + 800d372: 683b ldr r3, [r7, #0] + 800d374: 891b ldrh r3, [r3, #8] + 800d376: 2b01 cmp r3, #1 + 800d378: d906 bls.n 800d388 + dhcp->request_timeout--; + 800d37a: 683b ldr r3, [r7, #0] + 800d37c: 891b ldrh r3, [r3, #8] + 800d37e: 3b01 subs r3, #1 + 800d380: b29a uxth r2, r3 + 800d382: 683b ldr r3, [r7, #0] + 800d384: 811a strh r2, [r3, #8] + 800d386: e00c b.n 800d3a2 + } else if (dhcp->request_timeout == 1) { + 800d388: 683b ldr r3, [r7, #0] + 800d38a: 891b ldrh r3, [r3, #8] + 800d38c: 2b01 cmp r3, #1 + 800d38e: d108 bne.n 800d3a2 + dhcp->request_timeout--; + 800d390: 683b ldr r3, [r7, #0] + 800d392: 891b ldrh r3, [r3, #8] + 800d394: 3b01 subs r3, #1 + 800d396: b29a uxth r2, r3 + 800d398: 683b ldr r3, [r7, #0] + 800d39a: 811a strh r2, [r3, #8] + /* { dhcp->request_timeout == 0 } */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_fine_tmr(): request timeout\n")); + /* this client's request timeout triggered */ + dhcp_timeout(netif); + 800d39c: 6878 ldr r0, [r7, #4] + 800d39e: f000 f80d bl 800d3bc + NETIF_FOREACH(netif) { + 800d3a2: 687b ldr r3, [r7, #4] + 800d3a4: 681b ldr r3, [r3, #0] + 800d3a6: 607b str r3, [r7, #4] + 800d3a8: 687b ldr r3, [r7, #4] + 800d3aa: 2b00 cmp r3, #0 + 800d3ac: d1db bne.n 800d366 + } + } + } +} + 800d3ae: bf00 nop + 800d3b0: bf00 nop + 800d3b2: 3708 adds r7, #8 + 800d3b4: 46bd mov sp, r7 + 800d3b6: bd80 pop {r7, pc} + 800d3b8: 20019098 .word 0x20019098 + +0800d3bc : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_timeout(struct netif *netif) +{ + 800d3bc: b580 push {r7, lr} + 800d3be: b084 sub sp, #16 + 800d3c0: af00 add r7, sp, #0 + 800d3c2: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d3c4: 687b ldr r3, [r7, #4] + 800d3c6: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d3c8: 60fb str r3, [r7, #12] + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout()\n")); + /* back-off period has passed, or server selection timed out */ + if ((dhcp->state == DHCP_STATE_BACKING_OFF) || (dhcp->state == DHCP_STATE_SELECTING)) { + 800d3ca: 68fb ldr r3, [r7, #12] + 800d3cc: 795b ldrb r3, [r3, #5] + 800d3ce: 2b0c cmp r3, #12 + 800d3d0: d003 beq.n 800d3da + 800d3d2: 68fb ldr r3, [r7, #12] + 800d3d4: 795b ldrb r3, [r3, #5] + 800d3d6: 2b06 cmp r3, #6 + 800d3d8: d103 bne.n 800d3e2 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n")); + dhcp_discover(netif); + 800d3da: 6878 ldr r0, [r7, #4] + 800d3dc: f000 fa54 bl 800d888 + dhcp_reboot(netif); + } else { + dhcp_discover(netif); + } + } +} + 800d3e0: e031 b.n 800d446 + } else if (dhcp->state == DHCP_STATE_REQUESTING) { + 800d3e2: 68fb ldr r3, [r7, #12] + 800d3e4: 795b ldrb r3, [r3, #5] + 800d3e6: 2b01 cmp r3, #1 + 800d3e8: d10e bne.n 800d408 + if (dhcp->tries <= 5) { + 800d3ea: 68fb ldr r3, [r7, #12] + 800d3ec: 799b ldrb r3, [r3, #6] + 800d3ee: 2b05 cmp r3, #5 + 800d3f0: d803 bhi.n 800d3fa + dhcp_select(netif); + 800d3f2: 6878 ldr r0, [r7, #4] + 800d3f4: f7ff fe60 bl 800d0b8 +} + 800d3f8: e025 b.n 800d446 + dhcp_release_and_stop(netif); + 800d3fa: 6878 ldr r0, [r7, #4] + 800d3fc: f000 fda8 bl 800df50 + dhcp_start(netif); + 800d400: 6878 ldr r0, [r7, #4] + 800d402: f000 f8e5 bl 800d5d0 +} + 800d406: e01e b.n 800d446 + } else if (dhcp->state == DHCP_STATE_CHECKING) { + 800d408: 68fb ldr r3, [r7, #12] + 800d40a: 795b ldrb r3, [r3, #5] + 800d40c: 2b08 cmp r3, #8 + 800d40e: d10b bne.n 800d428 + if (dhcp->tries <= 1) { + 800d410: 68fb ldr r3, [r7, #12] + 800d412: 799b ldrb r3, [r3, #6] + 800d414: 2b01 cmp r3, #1 + 800d416: d803 bhi.n 800d420 + dhcp_check(netif); + 800d418: 6878 ldr r0, [r7, #4] + 800d41a: f7ff fdf3 bl 800d004 +} + 800d41e: e012 b.n 800d446 + dhcp_bind(netif); + 800d420: 6878 ldr r0, [r7, #4] + 800d422: f000 fad3 bl 800d9cc +} + 800d426: e00e b.n 800d446 + } else if (dhcp->state == DHCP_STATE_REBOOTING) { + 800d428: 68fb ldr r3, [r7, #12] + 800d42a: 795b ldrb r3, [r3, #5] + 800d42c: 2b03 cmp r3, #3 + 800d42e: d10a bne.n 800d446 + if (dhcp->tries < REBOOT_TRIES) { + 800d430: 68fb ldr r3, [r7, #12] + 800d432: 799b ldrb r3, [r3, #6] + 800d434: 2b01 cmp r3, #1 + 800d436: d803 bhi.n 800d440 + dhcp_reboot(netif); + 800d438: 6878 ldr r0, [r7, #4] + 800d43a: f000 fcd5 bl 800dde8 +} + 800d43e: e002 b.n 800d446 + dhcp_discover(netif); + 800d440: 6878 ldr r0, [r7, #4] + 800d442: f000 fa21 bl 800d888 +} + 800d446: bf00 nop + 800d448: 3710 adds r7, #16 + 800d44a: 46bd mov sp, r7 + 800d44c: bd80 pop {r7, pc} + +0800d44e : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_t1_timeout(struct netif *netif) +{ + 800d44e: b580 push {r7, lr} + 800d450: b084 sub sp, #16 + 800d452: af00 add r7, sp, #0 + 800d454: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d456: 687b ldr r3, [r7, #4] + 800d458: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d45a: 60fb str r3, [r7, #12] + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_t1_timeout()\n")); + if ((dhcp->state == DHCP_STATE_REQUESTING) || (dhcp->state == DHCP_STATE_BOUND) || + 800d45c: 68fb ldr r3, [r7, #12] + 800d45e: 795b ldrb r3, [r3, #5] + 800d460: 2b01 cmp r3, #1 + 800d462: d007 beq.n 800d474 + 800d464: 68fb ldr r3, [r7, #12] + 800d466: 795b ldrb r3, [r3, #5] + 800d468: 2b0a cmp r3, #10 + 800d46a: d003 beq.n 800d474 + (dhcp->state == DHCP_STATE_RENEWING)) { + 800d46c: 68fb ldr r3, [r7, #12] + 800d46e: 795b ldrb r3, [r3, #5] + if ((dhcp->state == DHCP_STATE_REQUESTING) || (dhcp->state == DHCP_STATE_BOUND) || + 800d470: 2b05 cmp r3, #5 + 800d472: d116 bne.n 800d4a2 + * eventually time-out if renew tries fail. */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("dhcp_t1_timeout(): must renew\n")); + /* This slightly different to RFC2131: DHCPREQUEST will be sent from state + DHCP_STATE_RENEWING, not DHCP_STATE_BOUND */ + dhcp_renew(netif); + 800d474: 6878 ldr r0, [r7, #4] + 800d476: f000 fb83 bl 800db80 + /* Calculate next timeout */ + if (((dhcp->t2_timeout - dhcp->lease_used) / 2) >= ((60 + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS)) { + 800d47a: 68fb ldr r3, [r7, #12] + 800d47c: 899b ldrh r3, [r3, #12] + 800d47e: 461a mov r2, r3 + 800d480: 68fb ldr r3, [r7, #12] + 800d482: 8a5b ldrh r3, [r3, #18] + 800d484: 1ad3 subs r3, r2, r3 + 800d486: 2b01 cmp r3, #1 + 800d488: dd0b ble.n 800d4a2 + dhcp->t1_renew_time = (u16_t)((dhcp->t2_timeout - dhcp->lease_used) / 2); + 800d48a: 68fb ldr r3, [r7, #12] + 800d48c: 899b ldrh r3, [r3, #12] + 800d48e: 461a mov r2, r3 + 800d490: 68fb ldr r3, [r7, #12] + 800d492: 8a5b ldrh r3, [r3, #18] + 800d494: 1ad3 subs r3, r2, r3 + 800d496: 0fda lsrs r2, r3, #31 + 800d498: 4413 add r3, r2 + 800d49a: 105b asrs r3, r3, #1 + 800d49c: b29a uxth r2, r3 + 800d49e: 68fb ldr r3, [r7, #12] + 800d4a0: 81da strh r2, [r3, #14] + } + } +} + 800d4a2: bf00 nop + 800d4a4: 3710 adds r7, #16 + 800d4a6: 46bd mov sp, r7 + 800d4a8: bd80 pop {r7, pc} + +0800d4aa : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_t2_timeout(struct netif *netif) +{ + 800d4aa: b580 push {r7, lr} + 800d4ac: b084 sub sp, #16 + 800d4ae: af00 add r7, sp, #0 + 800d4b0: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d4b2: 687b ldr r3, [r7, #4] + 800d4b4: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d4b6: 60fb str r3, [r7, #12] + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_t2_timeout()\n")); + if ((dhcp->state == DHCP_STATE_REQUESTING) || (dhcp->state == DHCP_STATE_BOUND) || + 800d4b8: 68fb ldr r3, [r7, #12] + 800d4ba: 795b ldrb r3, [r3, #5] + 800d4bc: 2b01 cmp r3, #1 + 800d4be: d00b beq.n 800d4d8 + 800d4c0: 68fb ldr r3, [r7, #12] + 800d4c2: 795b ldrb r3, [r3, #5] + 800d4c4: 2b0a cmp r3, #10 + 800d4c6: d007 beq.n 800d4d8 + (dhcp->state == DHCP_STATE_RENEWING) || (dhcp->state == DHCP_STATE_REBINDING)) { + 800d4c8: 68fb ldr r3, [r7, #12] + 800d4ca: 795b ldrb r3, [r3, #5] + if ((dhcp->state == DHCP_STATE_REQUESTING) || (dhcp->state == DHCP_STATE_BOUND) || + 800d4cc: 2b05 cmp r3, #5 + 800d4ce: d003 beq.n 800d4d8 + (dhcp->state == DHCP_STATE_RENEWING) || (dhcp->state == DHCP_STATE_REBINDING)) { + 800d4d0: 68fb ldr r3, [r7, #12] + 800d4d2: 795b ldrb r3, [r3, #5] + 800d4d4: 2b04 cmp r3, #4 + 800d4d6: d116 bne.n 800d506 + /* just retry to rebind */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("dhcp_t2_timeout(): must rebind\n")); + /* This slightly different to RFC2131: DHCPREQUEST will be sent from state + DHCP_STATE_REBINDING, not DHCP_STATE_BOUND */ + dhcp_rebind(netif); + 800d4d8: 6878 ldr r0, [r7, #4] + 800d4da: f000 fbeb bl 800dcb4 + /* Calculate next timeout */ + if (((dhcp->t0_timeout - dhcp->lease_used) / 2) >= ((60 + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS)) { + 800d4de: 68fb ldr r3, [r7, #12] + 800d4e0: 8a9b ldrh r3, [r3, #20] + 800d4e2: 461a mov r2, r3 + 800d4e4: 68fb ldr r3, [r7, #12] + 800d4e6: 8a5b ldrh r3, [r3, #18] + 800d4e8: 1ad3 subs r3, r2, r3 + 800d4ea: 2b01 cmp r3, #1 + 800d4ec: dd0b ble.n 800d506 + dhcp->t2_rebind_time = (u16_t)((dhcp->t0_timeout - dhcp->lease_used) / 2); + 800d4ee: 68fb ldr r3, [r7, #12] + 800d4f0: 8a9b ldrh r3, [r3, #20] + 800d4f2: 461a mov r2, r3 + 800d4f4: 68fb ldr r3, [r7, #12] + 800d4f6: 8a5b ldrh r3, [r3, #18] + 800d4f8: 1ad3 subs r3, r2, r3 + 800d4fa: 0fda lsrs r2, r3, #31 + 800d4fc: 4413 add r3, r2 + 800d4fe: 105b asrs r3, r3, #1 + 800d500: b29a uxth r2, r3 + 800d502: 68fb ldr r3, [r7, #12] + 800d504: 821a strh r2, [r3, #16] + } + } +} + 800d506: bf00 nop + 800d508: 3710 adds r7, #16 + 800d50a: 46bd mov sp, r7 + 800d50c: bd80 pop {r7, pc} + ... + +0800d510 : + * + * @param netif the netif under DHCP control + */ +static void +dhcp_handle_ack(struct netif *netif, struct dhcp_msg *msg_in) +{ + 800d510: b580 push {r7, lr} + 800d512: b084 sub sp, #16 + 800d514: af00 add r7, sp, #0 + 800d516: 6078 str r0, [r7, #4] + 800d518: 6039 str r1, [r7, #0] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d51a: 687b ldr r3, [r7, #4] + 800d51c: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d51e: 60fb str r3, [r7, #12] +#if LWIP_DHCP_GET_NTP_SRV + ip4_addr_t ntp_server_addrs[LWIP_DHCP_MAX_NTP_SERVERS]; +#endif + + /* clear options we might not get from the ACK */ + ip4_addr_set_zero(&dhcp->offered_sn_mask); + 800d520: 68fb ldr r3, [r7, #12] + 800d522: 2200 movs r2, #0 + 800d524: 621a str r2, [r3, #32] + ip4_addr_set_zero(&dhcp->offered_gw_addr); + 800d526: 68fb ldr r3, [r7, #12] + 800d528: 2200 movs r2, #0 + 800d52a: 625a str r2, [r3, #36] @ 0x24 +#if LWIP_DHCP_BOOTP_FILE + ip4_addr_set_zero(&dhcp->offered_si_addr); +#endif /* LWIP_DHCP_BOOTP_FILE */ + + /* lease time given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_LEASE_TIME)) { + 800d52c: 4b26 ldr r3, [pc, #152] @ (800d5c8 ) + 800d52e: 78db ldrb r3, [r3, #3] + 800d530: 2b00 cmp r3, #0 + 800d532: d003 beq.n 800d53c + /* remember offered lease time */ + dhcp->offered_t0_lease = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_LEASE_TIME); + 800d534: 4b25 ldr r3, [pc, #148] @ (800d5cc ) + 800d536: 68da ldr r2, [r3, #12] + 800d538: 68fb ldr r3, [r7, #12] + 800d53a: 629a str r2, [r3, #40] @ 0x28 + } + /* renewal period given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T1)) { + 800d53c: 4b22 ldr r3, [pc, #136] @ (800d5c8 ) + 800d53e: 791b ldrb r3, [r3, #4] + 800d540: 2b00 cmp r3, #0 + 800d542: d004 beq.n 800d54e + /* remember given renewal period */ + dhcp->offered_t1_renew = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T1); + 800d544: 4b21 ldr r3, [pc, #132] @ (800d5cc ) + 800d546: 691a ldr r2, [r3, #16] + 800d548: 68fb ldr r3, [r7, #12] + 800d54a: 62da str r2, [r3, #44] @ 0x2c + 800d54c: e004 b.n 800d558 + } else { + /* calculate safe periods for renewal */ + dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2; + 800d54e: 68fb ldr r3, [r7, #12] + 800d550: 6a9b ldr r3, [r3, #40] @ 0x28 + 800d552: 085a lsrs r2, r3, #1 + 800d554: 68fb ldr r3, [r7, #12] + 800d556: 62da str r2, [r3, #44] @ 0x2c + } + + /* renewal period given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T2)) { + 800d558: 4b1b ldr r3, [pc, #108] @ (800d5c8 ) + 800d55a: 795b ldrb r3, [r3, #5] + 800d55c: 2b00 cmp r3, #0 + 800d55e: d004 beq.n 800d56a + /* remember given rebind period */ + dhcp->offered_t2_rebind = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T2); + 800d560: 4b1a ldr r3, [pc, #104] @ (800d5cc ) + 800d562: 695a ldr r2, [r3, #20] + 800d564: 68fb ldr r3, [r7, #12] + 800d566: 631a str r2, [r3, #48] @ 0x30 + 800d568: e007 b.n 800d57a + } else { + /* calculate safe periods for rebinding (offered_t0_lease * 0.875 -> 87.5%)*/ + dhcp->offered_t2_rebind = (dhcp->offered_t0_lease * 7U) / 8U; + 800d56a: 68fb ldr r3, [r7, #12] + 800d56c: 6a9a ldr r2, [r3, #40] @ 0x28 + 800d56e: 4613 mov r3, r2 + 800d570: 00db lsls r3, r3, #3 + 800d572: 1a9b subs r3, r3, r2 + 800d574: 08da lsrs r2, r3, #3 + 800d576: 68fb ldr r3, [r7, #12] + 800d578: 631a str r2, [r3, #48] @ 0x30 + } + + /* (y)our internet address */ + ip4_addr_copy(dhcp->offered_ip_addr, msg_in->yiaddr); + 800d57a: 683b ldr r3, [r7, #0] + 800d57c: 691a ldr r2, [r3, #16] + 800d57e: 68fb ldr r3, [r7, #12] + 800d580: 61da str r2, [r3, #28] + boot file name copied in dhcp_parse_reply if not overloaded */ + ip4_addr_copy(dhcp->offered_si_addr, msg_in->siaddr); +#endif /* LWIP_DHCP_BOOTP_FILE */ + + /* subnet mask given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) { + 800d582: 4b11 ldr r3, [pc, #68] @ (800d5c8 ) + 800d584: 799b ldrb r3, [r3, #6] + 800d586: 2b00 cmp r3, #0 + 800d588: d00b beq.n 800d5a2 + /* remember given subnet mask */ + ip4_addr_set_u32(&dhcp->offered_sn_mask, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK))); + 800d58a: 4b10 ldr r3, [pc, #64] @ (800d5cc ) + 800d58c: 699b ldr r3, [r3, #24] + 800d58e: 4618 mov r0, r3 + 800d590: f7f7 ff0f bl 80053b2 + 800d594: 4602 mov r2, r0 + 800d596: 68fb ldr r3, [r7, #12] + 800d598: 621a str r2, [r3, #32] + dhcp->subnet_mask_given = 1; + 800d59a: 68fb ldr r3, [r7, #12] + 800d59c: 2201 movs r2, #1 + 800d59e: 71da strb r2, [r3, #7] + 800d5a0: e002 b.n 800d5a8 + } else { + dhcp->subnet_mask_given = 0; + 800d5a2: 68fb ldr r3, [r7, #12] + 800d5a4: 2200 movs r2, #0 + 800d5a6: 71da strb r2, [r3, #7] + } + + /* gateway router */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) { + 800d5a8: 4b07 ldr r3, [pc, #28] @ (800d5c8 ) + 800d5aa: 79db ldrb r3, [r3, #7] + 800d5ac: 2b00 cmp r3, #0 + 800d5ae: d007 beq.n 800d5c0 + ip4_addr_set_u32(&dhcp->offered_gw_addr, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER))); + 800d5b0: 4b06 ldr r3, [pc, #24] @ (800d5cc ) + 800d5b2: 69db ldr r3, [r3, #28] + 800d5b4: 4618 mov r0, r3 + 800d5b6: f7f7 fefc bl 80053b2 + 800d5ba: 4602 mov r2, r0 + 800d5bc: 68fb ldr r3, [r7, #12] + 800d5be: 625a str r2, [r3, #36] @ 0x24 + ip_addr_t dns_addr; + ip_addr_set_ip4_u32_val(dns_addr, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_DNS_SERVER + n))); + dns_setserver(n, &dns_addr); + } +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS */ +} + 800d5c0: bf00 nop + 800d5c2: 3710 adds r7, #16 + 800d5c4: 46bd mov sp, r7 + 800d5c6: bd80 pop {r7, pc} + 800d5c8: 20019124 .word 0x20019124 + 800d5cc: 20019104 .word 0x20019104 + +0800d5d0 : + * - ERR_OK - No error + * - ERR_MEM - Out of memory + */ +err_t +dhcp_start(struct netif *netif) +{ + 800d5d0: b580 push {r7, lr} + 800d5d2: b084 sub sp, #16 + 800d5d4: af00 add r7, sp, #0 + 800d5d6: 6078 str r0, [r7, #4] + struct dhcp *dhcp; + err_t result; + + LWIP_ASSERT_CORE_LOCKED(); + LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;); + 800d5d8: 687b ldr r3, [r7, #4] + 800d5da: 2b00 cmp r3, #0 + 800d5dc: d109 bne.n 800d5f2 + 800d5de: 4b37 ldr r3, [pc, #220] @ (800d6bc ) + 800d5e0: f240 22e7 movw r2, #743 @ 0x2e7 + 800d5e4: 4936 ldr r1, [pc, #216] @ (800d6c0 ) + 800d5e6: 4837 ldr r0, [pc, #220] @ (800d6c4 ) + 800d5e8: f004 f806 bl 80115f8 + 800d5ec: f06f 030f mvn.w r3, #15 + 800d5f0: e060 b.n 800d6b4 + LWIP_ERROR("netif is not up, old style port?", netif_is_up(netif), return ERR_ARG;); + 800d5f2: 687b ldr r3, [r7, #4] + 800d5f4: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800d5f8: f003 0301 and.w r3, r3, #1 + 800d5fc: 2b00 cmp r3, #0 + 800d5fe: d109 bne.n 800d614 + 800d600: 4b2e ldr r3, [pc, #184] @ (800d6bc ) + 800d602: f44f 723a mov.w r2, #744 @ 0x2e8 + 800d606: 4930 ldr r1, [pc, #192] @ (800d6c8 ) + 800d608: 482e ldr r0, [pc, #184] @ (800d6c4 ) + 800d60a: f003 fff5 bl 80115f8 + 800d60e: f06f 030f mvn.w r3, #15 + 800d612: e04f b.n 800d6b4 + dhcp = netif_dhcp_data(netif); + 800d614: 687b ldr r3, [r7, #4] + 800d616: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d618: 60fb str r3, [r7, #12] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void *)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + + /* check MTU of the netif */ + if (netif->mtu < DHCP_MAX_MSG_LEN_MIN_REQUIRED) { + 800d61a: 687b ldr r3, [r7, #4] + 800d61c: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800d61e: f5b3 7f10 cmp.w r3, #576 @ 0x240 + 800d622: d202 bcs.n 800d62a + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): Cannot use this netif with DHCP: MTU is too small\n")); + return ERR_MEM; + 800d624: f04f 33ff mov.w r3, #4294967295 + 800d628: e044 b.n 800d6b4 + } + + /* no DHCP client attached yet? */ + if (dhcp == NULL) { + 800d62a: 68fb ldr r3, [r7, #12] + 800d62c: 2b00 cmp r3, #0 + 800d62e: d10d bne.n 800d64c + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): mallocing new DHCP client\n")); + dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp)); + 800d630: 2034 movs r0, #52 @ 0x34 + 800d632: f7f8 f983 bl 800593c + 800d636: 60f8 str r0, [r7, #12] + if (dhcp == NULL) { + 800d638: 68fb ldr r3, [r7, #12] + 800d63a: 2b00 cmp r3, #0 + 800d63c: d102 bne.n 800d644 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n")); + return ERR_MEM; + 800d63e: f04f 33ff mov.w r3, #4294967295 + 800d642: e037 b.n 800d6b4 + } + + /* store this dhcp client in the netif */ + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, dhcp); + 800d644: 687b ldr r3, [r7, #4] + 800d646: 68fa ldr r2, [r7, #12] + 800d648: 625a str r2, [r3, #36] @ 0x24 + 800d64a: e005 b.n 800d658 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp")); + /* already has DHCP client attached */ + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(): restarting DHCP configuration\n")); + + if (dhcp->pcb_allocated != 0) { + 800d64c: 68fb ldr r3, [r7, #12] + 800d64e: 791b ldrb r3, [r3, #4] + 800d650: 2b00 cmp r3, #0 + 800d652: d001 beq.n 800d658 + dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */ + 800d654: f7ff fc92 bl 800cf7c + } + /* dhcp is cleared below, no need to reset flag*/ + } + + /* clear data structure */ + memset(dhcp, 0, sizeof(struct dhcp)); + 800d658: 2234 movs r2, #52 @ 0x34 + 800d65a: 2100 movs r1, #0 + 800d65c: 68f8 ldr r0, [r7, #12] + 800d65e: f004 f84a bl 80116f6 + /* dhcp_set_state(&dhcp, DHCP_STATE_OFF); */ + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n")); + + if (dhcp_inc_pcb_refcount() != ERR_OK) { /* ensure DHCP PCB is allocated */ + 800d662: f7ff fc39 bl 800ced8 + 800d666: 4603 mov r3, r0 + 800d668: 2b00 cmp r3, #0 + 800d66a: d002 beq.n 800d672 + return ERR_MEM; + 800d66c: f04f 33ff mov.w r3, #4294967295 + 800d670: e020 b.n 800d6b4 + } + dhcp->pcb_allocated = 1; + 800d672: 68fb ldr r3, [r7, #12] + 800d674: 2201 movs r2, #1 + 800d676: 711a strb r2, [r3, #4] + + if (!netif_is_link_up(netif)) { + 800d678: 687b ldr r3, [r7, #4] + 800d67a: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800d67e: f003 0304 and.w r3, r3, #4 + 800d682: 2b00 cmp r3, #0 + 800d684: d105 bne.n 800d692 + /* set state INIT and wait for dhcp_network_changed() to call dhcp_discover() */ + dhcp_set_state(dhcp, DHCP_STATE_INIT); + 800d686: 2102 movs r1, #2 + 800d688: 68f8 ldr r0, [r7, #12] + 800d68a: f000 fcfb bl 800e084 + return ERR_OK; + 800d68e: 2300 movs r3, #0 + 800d690: e010 b.n 800d6b4 + } + + /* (re)start the DHCP negotiation */ + result = dhcp_discover(netif); + 800d692: 6878 ldr r0, [r7, #4] + 800d694: f000 f8f8 bl 800d888 + 800d698: 4603 mov r3, r0 + 800d69a: 72fb strb r3, [r7, #11] + if (result != ERR_OK) { + 800d69c: f997 300b ldrsb.w r3, [r7, #11] + 800d6a0: 2b00 cmp r3, #0 + 800d6a2: d005 beq.n 800d6b0 + /* free resources allocated above */ + dhcp_release_and_stop(netif); + 800d6a4: 6878 ldr r0, [r7, #4] + 800d6a6: f000 fc53 bl 800df50 + return ERR_MEM; + 800d6aa: f04f 33ff mov.w r3, #4294967295 + 800d6ae: e001 b.n 800d6b4 + } + return result; + 800d6b0: f997 300b ldrsb.w r3, [r7, #11] +} + 800d6b4: 4618 mov r0, r3 + 800d6b6: 3710 adds r7, #16 + 800d6b8: 46bd mov sp, r7 + 800d6ba: bd80 pop {r7, pc} + 800d6bc: 08018304 .word 0x08018304 + 800d6c0: 080183e8 .word 0x080183e8 + 800d6c4: 08018364 .word 0x08018364 + 800d6c8: 0801842c .word 0x0801842c + +0800d6cc : + * This enters the REBOOTING state to verify that the currently bound + * address is still valid. + */ +void +dhcp_network_changed(struct netif *netif) +{ + 800d6cc: b580 push {r7, lr} + 800d6ce: b084 sub sp, #16 + 800d6d0: af00 add r7, sp, #0 + 800d6d2: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d6d4: 687b ldr r3, [r7, #4] + 800d6d6: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d6d8: 60fb str r3, [r7, #12] + + if (!dhcp) { + 800d6da: 68fb ldr r3, [r7, #12] + 800d6dc: 2b00 cmp r3, #0 + 800d6de: d025 beq.n 800d72c + return; + } + switch (dhcp->state) { + 800d6e0: 68fb ldr r3, [r7, #12] + 800d6e2: 795b ldrb r3, [r3, #5] + 800d6e4: 2b0a cmp r3, #10 + 800d6e6: d008 beq.n 800d6fa + 800d6e8: 2b0a cmp r3, #10 + 800d6ea: dc0d bgt.n 800d708 + 800d6ec: 2b00 cmp r3, #0 + 800d6ee: d01f beq.n 800d730 + 800d6f0: 2b00 cmp r3, #0 + 800d6f2: db09 blt.n 800d708 + 800d6f4: 3b03 subs r3, #3 + 800d6f6: 2b02 cmp r3, #2 + 800d6f8: d806 bhi.n 800d708 + case DHCP_STATE_REBINDING: + case DHCP_STATE_RENEWING: + case DHCP_STATE_BOUND: + case DHCP_STATE_REBOOTING: + dhcp->tries = 0; + 800d6fa: 68fb ldr r3, [r7, #12] + 800d6fc: 2200 movs r2, #0 + 800d6fe: 719a strb r2, [r3, #6] + dhcp_reboot(netif); + 800d700: 6878 ldr r0, [r7, #4] + 800d702: f000 fb71 bl 800dde8 + break; + 800d706: e014 b.n 800d732 + case DHCP_STATE_OFF: + /* stay off */ + break; + default: + LWIP_ASSERT("invalid dhcp->state", dhcp->state <= DHCP_STATE_BACKING_OFF); + 800d708: 68fb ldr r3, [r7, #12] + 800d70a: 795b ldrb r3, [r3, #5] + 800d70c: 2b0c cmp r3, #12 + 800d70e: d906 bls.n 800d71e + 800d710: 4b09 ldr r3, [pc, #36] @ (800d738 ) + 800d712: f240 326d movw r2, #877 @ 0x36d + 800d716: 4909 ldr r1, [pc, #36] @ (800d73c ) + 800d718: 4809 ldr r0, [pc, #36] @ (800d740 ) + 800d71a: f003 ff6d bl 80115f8 + autoip_stop(netif); + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF; + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + /* ensure we start with short timeouts, even if already discovering */ + dhcp->tries = 0; + 800d71e: 68fb ldr r3, [r7, #12] + 800d720: 2200 movs r2, #0 + 800d722: 719a strb r2, [r3, #6] + dhcp_discover(netif); + 800d724: 6878 ldr r0, [r7, #4] + 800d726: f000 f8af bl 800d888 + break; + 800d72a: e002 b.n 800d732 + return; + 800d72c: bf00 nop + 800d72e: e000 b.n 800d732 + break; + 800d730: bf00 nop + } +} + 800d732: 3710 adds r7, #16 + 800d734: 46bd mov sp, r7 + 800d736: bd80 pop {r7, pc} + 800d738: 08018304 .word 0x08018304 + 800d73c: 08018450 .word 0x08018450 + 800d740: 08018364 .word 0x08018364 + +0800d744 : + * @param netif the network interface on which the reply was received + * @param addr The IP address we received a reply from + */ +void +dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr) +{ + 800d744: b580 push {r7, lr} + 800d746: b084 sub sp, #16 + 800d748: af00 add r7, sp, #0 + 800d74a: 6078 str r0, [r7, #4] + 800d74c: 6039 str r1, [r7, #0] + struct dhcp *dhcp; + + LWIP_ERROR("netif != NULL", (netif != NULL), return;); + 800d74e: 687b ldr r3, [r7, #4] + 800d750: 2b00 cmp r3, #0 + 800d752: d107 bne.n 800d764 + 800d754: 4b0e ldr r3, [pc, #56] @ (800d790 ) + 800d756: f240 328b movw r2, #907 @ 0x38b + 800d75a: 490e ldr r1, [pc, #56] @ (800d794 ) + 800d75c: 480e ldr r0, [pc, #56] @ (800d798 ) + 800d75e: f003 ff4b bl 80115f8 + 800d762: e012 b.n 800d78a + dhcp = netif_dhcp_data(netif); + 800d764: 687b ldr r3, [r7, #4] + 800d766: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d768: 60fb str r3, [r7, #12] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_arp_reply()\n")); + /* is a DHCP client doing an ARP check? */ + if ((dhcp != NULL) && (dhcp->state == DHCP_STATE_CHECKING)) { + 800d76a: 68fb ldr r3, [r7, #12] + 800d76c: 2b00 cmp r3, #0 + 800d76e: d00c beq.n 800d78a + 800d770: 68fb ldr r3, [r7, #12] + 800d772: 795b ldrb r3, [r3, #5] + 800d774: 2b08 cmp r3, #8 + 800d776: d108 bne.n 800d78a + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_arp_reply(): CHECKING, arp reply for 0x%08"X32_F"\n", + ip4_addr_get_u32(addr))); + /* did a host respond with the address we + were offered by the DHCP server? */ + if (ip4_addr_cmp(addr, &dhcp->offered_ip_addr)) { + 800d778: 683b ldr r3, [r7, #0] + 800d77a: 681a ldr r2, [r3, #0] + 800d77c: 68fb ldr r3, [r7, #12] + 800d77e: 69db ldr r3, [r3, #28] + 800d780: 429a cmp r2, r3 + 800d782: d102 bne.n 800d78a + /* we will not accept the offered address */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING, + ("dhcp_arp_reply(): arp reply matched with offered address, declining\n")); + dhcp_decline(netif); + 800d784: 6878 ldr r0, [r7, #4] + 800d786: f000 f809 bl 800d79c + } + } +} + 800d78a: 3710 adds r7, #16 + 800d78c: 46bd mov sp, r7 + 800d78e: bd80 pop {r7, pc} + 800d790: 08018304 .word 0x08018304 + 800d794: 080183e8 .word 0x080183e8 + 800d798: 08018364 .word 0x08018364 + +0800d79c : + * + * @param netif the netif under DHCP control + */ +static err_t +dhcp_decline(struct netif *netif) +{ + 800d79c: b5b0 push {r4, r5, r7, lr} + 800d79e: b08a sub sp, #40 @ 0x28 + 800d7a0: af02 add r7, sp, #8 + 800d7a2: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d7a4: 687b ldr r3, [r7, #4] + 800d7a6: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d7a8: 61bb str r3, [r7, #24] + u16_t msecs; + struct pbuf *p_out; + u16_t options_out_len; + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_decline()\n")); + dhcp_set_state(dhcp, DHCP_STATE_BACKING_OFF); + 800d7aa: 210c movs r1, #12 + 800d7ac: 69b8 ldr r0, [r7, #24] + 800d7ae: f000 fc69 bl 800e084 + /* create and initialize the DHCP message header */ + p_out = dhcp_create_msg(netif, dhcp, DHCP_DECLINE, &options_out_len); + 800d7b2: f107 030c add.w r3, r7, #12 + 800d7b6: 2204 movs r2, #4 + 800d7b8: 69b9 ldr r1, [r7, #24] + 800d7ba: 6878 ldr r0, [r7, #4] + 800d7bc: f001 f8ee bl 800e99c + 800d7c0: 6178 str r0, [r7, #20] + if (p_out != NULL) { + 800d7c2: 697b ldr r3, [r7, #20] + 800d7c4: 2b00 cmp r3, #0 + 800d7c6: d035 beq.n 800d834 + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800d7c8: 697b ldr r3, [r7, #20] + 800d7ca: 685b ldr r3, [r3, #4] + 800d7cc: 613b str r3, [r7, #16] + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_REQUESTED_IP, 4); + 800d7ce: 89b8 ldrh r0, [r7, #12] + 800d7d0: 693b ldr r3, [r7, #16] + 800d7d2: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d7d6: 2304 movs r3, #4 + 800d7d8: 2232 movs r2, #50 @ 0x32 + 800d7da: f000 fc6d bl 800e0b8 + 800d7de: 4603 mov r3, r0 + 800d7e0: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_long(options_out_len, msg_out->options, lwip_ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr))); + 800d7e2: 89bc ldrh r4, [r7, #12] + 800d7e4: 693b ldr r3, [r7, #16] + 800d7e6: f103 05f0 add.w r5, r3, #240 @ 0xf0 + 800d7ea: 69bb ldr r3, [r7, #24] + 800d7ec: 69db ldr r3, [r3, #28] + 800d7ee: 4618 mov r0, r3 + 800d7f0: f7f7 fddf bl 80053b2 + 800d7f4: 4603 mov r3, r0 + 800d7f6: 461a mov r2, r3 + 800d7f8: 4629 mov r1, r5 + 800d7fa: 4620 mov r0, r4 + 800d7fc: f000 fce8 bl 800e1d0 + 800d800: 4603 mov r3, r0 + 800d802: 81bb strh r3, [r7, #12] + + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_BACKING_OFF, msg_out, DHCP_DECLINE, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800d804: 89b8 ldrh r0, [r7, #12] + 800d806: 693b ldr r3, [r7, #16] + 800d808: 33f0 adds r3, #240 @ 0xf0 + 800d80a: 697a ldr r2, [r7, #20] + 800d80c: 4619 mov r1, r3 + 800d80e: f001 f99b bl 800eb48 + + /* per section 4.4.4, broadcast DECLINE messages */ + result = udp_sendto_if_src(dhcp_pcb, p_out, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER, netif, IP4_ADDR_ANY); + 800d812: 4b19 ldr r3, [pc, #100] @ (800d878 ) + 800d814: 6818 ldr r0, [r3, #0] + 800d816: 4b19 ldr r3, [pc, #100] @ (800d87c ) + 800d818: 9301 str r3, [sp, #4] + 800d81a: 687b ldr r3, [r7, #4] + 800d81c: 9300 str r3, [sp, #0] + 800d81e: 2343 movs r3, #67 @ 0x43 + 800d820: 4a17 ldr r2, [pc, #92] @ (800d880 ) + 800d822: 6979 ldr r1, [r7, #20] + 800d824: f7ff f8d2 bl 800c9cc + 800d828: 4603 mov r3, r0 + 800d82a: 77fb strb r3, [r7, #31] + pbuf_free(p_out); + 800d82c: 6978 ldr r0, [r7, #20] + 800d82e: f7f9 f8fb bl 8006a28 + 800d832: e001 b.n 800d838 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_decline: BACKING OFF\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("dhcp_decline: could not allocate DHCP request\n")); + result = ERR_MEM; + 800d834: 23ff movs r3, #255 @ 0xff + 800d836: 77fb strb r3, [r7, #31] + } + if (dhcp->tries < 255) { + 800d838: 69bb ldr r3, [r7, #24] + 800d83a: 799b ldrb r3, [r3, #6] + 800d83c: 2bff cmp r3, #255 @ 0xff + 800d83e: d005 beq.n 800d84c + dhcp->tries++; + 800d840: 69bb ldr r3, [r7, #24] + 800d842: 799b ldrb r3, [r3, #6] + 800d844: 3301 adds r3, #1 + 800d846: b2da uxtb r2, r3 + 800d848: 69bb ldr r3, [r7, #24] + 800d84a: 719a strb r2, [r3, #6] + } + msecs = 10 * 1000; + 800d84c: f242 7310 movw r3, #10000 @ 0x2710 + 800d850: 81fb strh r3, [r7, #14] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800d852: 89fb ldrh r3, [r7, #14] + 800d854: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800d858: 4a0a ldr r2, [pc, #40] @ (800d884 ) + 800d85a: fb82 1203 smull r1, r2, r2, r3 + 800d85e: 1152 asrs r2, r2, #5 + 800d860: 17db asrs r3, r3, #31 + 800d862: 1ad3 subs r3, r2, r3 + 800d864: b29a uxth r2, r3 + 800d866: 69bb ldr r3, [r7, #24] + 800d868: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_decline(): set request timeout %"U16_F" msecs\n", msecs)); + return result; + 800d86a: f997 301f ldrsb.w r3, [r7, #31] +} + 800d86e: 4618 mov r0, r3 + 800d870: 3720 adds r7, #32 + 800d872: 46bd mov sp, r7 + 800d874: bdb0 pop {r4, r5, r7, pc} + 800d876: bf00 nop + 800d878: 2001912c .word 0x2001912c + 800d87c: 08018ed4 .word 0x08018ed4 + 800d880: 08018ed8 .word 0x08018ed8 + 800d884: 10624dd3 .word 0x10624dd3 + +0800d888 : + * + * @param netif the netif under DHCP control + */ +static err_t +dhcp_discover(struct netif *netif) +{ + 800d888: b580 push {r7, lr} + 800d88a: b08a sub sp, #40 @ 0x28 + 800d88c: af02 add r7, sp, #8 + 800d88e: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800d890: 687b ldr r3, [r7, #4] + 800d892: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d894: 61bb str r3, [r7, #24] + err_t result = ERR_OK; + 800d896: 2300 movs r3, #0 + 800d898: 75fb strb r3, [r7, #23] + struct pbuf *p_out; + u16_t options_out_len; + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover()\n")); + + ip4_addr_set_any(&dhcp->offered_ip_addr); + 800d89a: 69bb ldr r3, [r7, #24] + 800d89c: 2200 movs r2, #0 + 800d89e: 61da str r2, [r3, #28] + dhcp_set_state(dhcp, DHCP_STATE_SELECTING); + 800d8a0: 2106 movs r1, #6 + 800d8a2: 69b8 ldr r0, [r7, #24] + 800d8a4: f000 fbee bl 800e084 + /* create and initialize the DHCP message header */ + p_out = dhcp_create_msg(netif, dhcp, DHCP_DISCOVER, &options_out_len); + 800d8a8: f107 0308 add.w r3, r7, #8 + 800d8ac: 2201 movs r2, #1 + 800d8ae: 69b9 ldr r1, [r7, #24] + 800d8b0: 6878 ldr r0, [r7, #4] + 800d8b2: f001 f873 bl 800e99c + 800d8b6: 6138 str r0, [r7, #16] + if (p_out != NULL) { + 800d8b8: 693b ldr r3, [r7, #16] + 800d8ba: 2b00 cmp r3, #0 + 800d8bc: d04b beq.n 800d956 + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800d8be: 693b ldr r3, [r7, #16] + 800d8c0: 685b ldr r3, [r3, #4] + 800d8c2: 60fb str r3, [r7, #12] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: making request\n")); + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + 800d8c4: 8938 ldrh r0, [r7, #8] + 800d8c6: 68fb ldr r3, [r7, #12] + 800d8c8: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d8cc: 2302 movs r3, #2 + 800d8ce: 2239 movs r2, #57 @ 0x39 + 800d8d0: f000 fbf2 bl 800e0b8 + 800d8d4: 4603 mov r3, r0 + 800d8d6: 813b strh r3, [r7, #8] + options_out_len = dhcp_option_short(options_out_len, msg_out->options, DHCP_MAX_MSG_LEN(netif)); + 800d8d8: 8938 ldrh r0, [r7, #8] + 800d8da: 68fb ldr r3, [r7, #12] + 800d8dc: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d8e0: 687b ldr r3, [r7, #4] + 800d8e2: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800d8e4: 461a mov r2, r3 + 800d8e6: f000 fc41 bl 800e16c + 800d8ea: 4603 mov r3, r0 + 800d8ec: 813b strh r3, [r7, #8] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + 800d8ee: 8938 ldrh r0, [r7, #8] + 800d8f0: 68fb ldr r3, [r7, #12] + 800d8f2: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d8f6: 2303 movs r3, #3 + 800d8f8: 2237 movs r2, #55 @ 0x37 + 800d8fa: f000 fbdd bl 800e0b8 + 800d8fe: 4603 mov r3, r0 + 800d900: 813b strh r3, [r7, #8] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800d902: 2300 movs r3, #0 + 800d904: 77fb strb r3, [r7, #31] + 800d906: e00e b.n 800d926 + options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]); + 800d908: 8938 ldrh r0, [r7, #8] + 800d90a: 68fb ldr r3, [r7, #12] + 800d90c: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800d910: 7ffb ldrb r3, [r7, #31] + 800d912: 4a29 ldr r2, [pc, #164] @ (800d9b8 ) + 800d914: 5cd3 ldrb r3, [r2, r3] + 800d916: 461a mov r2, r3 + 800d918: f000 fc02 bl 800e120 + 800d91c: 4603 mov r3, r0 + 800d91e: 813b strh r3, [r7, #8] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800d920: 7ffb ldrb r3, [r7, #31] + 800d922: 3301 adds r3, #1 + 800d924: 77fb strb r3, [r7, #31] + 800d926: 7ffb ldrb r3, [r7, #31] + 800d928: 2b02 cmp r3, #2 + 800d92a: d9ed bls.n 800d908 + } + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_SELECTING, msg_out, DHCP_DISCOVER, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800d92c: 8938 ldrh r0, [r7, #8] + 800d92e: 68fb ldr r3, [r7, #12] + 800d930: 33f0 adds r3, #240 @ 0xf0 + 800d932: 693a ldr r2, [r7, #16] + 800d934: 4619 mov r1, r3 + 800d936: f001 f907 bl 800eb48 + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER)\n")); + udp_sendto_if_src(dhcp_pcb, p_out, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER, netif, IP4_ADDR_ANY); + 800d93a: 4b20 ldr r3, [pc, #128] @ (800d9bc ) + 800d93c: 6818 ldr r0, [r3, #0] + 800d93e: 4b20 ldr r3, [pc, #128] @ (800d9c0 ) + 800d940: 9301 str r3, [sp, #4] + 800d942: 687b ldr r3, [r7, #4] + 800d944: 9300 str r3, [sp, #0] + 800d946: 2343 movs r3, #67 @ 0x43 + 800d948: 4a1e ldr r2, [pc, #120] @ (800d9c4 ) + 800d94a: 6939 ldr r1, [r7, #16] + 800d94c: f7ff f83e bl 800c9cc + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: deleting()ing\n")); + pbuf_free(p_out); + 800d950: 6938 ldr r0, [r7, #16] + 800d952: f7f9 f869 bl 8006a28 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_discover: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + 800d956: 69bb ldr r3, [r7, #24] + 800d958: 799b ldrb r3, [r3, #6] + 800d95a: 2bff cmp r3, #255 @ 0xff + 800d95c: d005 beq.n 800d96a + dhcp->tries++; + 800d95e: 69bb ldr r3, [r7, #24] + 800d960: 799b ldrb r3, [r3, #6] + 800d962: 3301 adds r3, #1 + 800d964: b2da uxtb r2, r3 + 800d966: 69bb ldr r3, [r7, #24] + 800d968: 719a strb r2, [r3, #6] + if (dhcp->tries >= LWIP_DHCP_AUTOIP_COOP_TRIES && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) { + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON; + autoip_start(netif); + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + msecs = (u16_t)((dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000); + 800d96a: 69bb ldr r3, [r7, #24] + 800d96c: 799b ldrb r3, [r3, #6] + 800d96e: 2b05 cmp r3, #5 + 800d970: d80d bhi.n 800d98e + 800d972: 69bb ldr r3, [r7, #24] + 800d974: 799b ldrb r3, [r3, #6] + 800d976: 461a mov r2, r3 + 800d978: 2301 movs r3, #1 + 800d97a: 4093 lsls r3, r2 + 800d97c: b29b uxth r3, r3 + 800d97e: 461a mov r2, r3 + 800d980: 0152 lsls r2, r2, #5 + 800d982: 1ad2 subs r2, r2, r3 + 800d984: 0092 lsls r2, r2, #2 + 800d986: 4413 add r3, r2 + 800d988: 00db lsls r3, r3, #3 + 800d98a: b29b uxth r3, r3 + 800d98c: e001 b.n 800d992 + 800d98e: f64e 2360 movw r3, #60000 @ 0xea60 + 800d992: 817b strh r3, [r7, #10] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800d994: 897b ldrh r3, [r7, #10] + 800d996: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800d99a: 4a0b ldr r2, [pc, #44] @ (800d9c8 ) + 800d99c: fb82 1203 smull r1, r2, r2, r3 + 800d9a0: 1152 asrs r2, r2, #5 + 800d9a2: 17db asrs r3, r3, #31 + 800d9a4: 1ad3 subs r3, r2, r3 + 800d9a6: b29a uxth r2, r3 + 800d9a8: 69bb ldr r3, [r7, #24] + 800d9aa: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover(): set request timeout %"U16_F" msecs\n", msecs)); + return result; + 800d9ac: f997 3017 ldrsb.w r3, [r7, #23] +} + 800d9b0: 4618 mov r0, r3 + 800d9b2: 3720 adds r7, #32 + 800d9b4: 46bd mov sp, r7 + 800d9b6: bd80 pop {r7, pc} + 800d9b8: 2000002c .word 0x2000002c + 800d9bc: 2001912c .word 0x2001912c + 800d9c0: 08018ed4 .word 0x08018ed4 + 800d9c4: 08018ed8 .word 0x08018ed8 + 800d9c8: 10624dd3 .word 0x10624dd3 + +0800d9cc : + * + * @param netif network interface to bind to the offered address + */ +static void +dhcp_bind(struct netif *netif) +{ + 800d9cc: b580 push {r7, lr} + 800d9ce: b088 sub sp, #32 + 800d9d0: af00 add r7, sp, #0 + 800d9d2: 6078 str r0, [r7, #4] + u32_t timeout; + struct dhcp *dhcp; + ip4_addr_t sn_mask, gw_addr; + LWIP_ERROR("dhcp_bind: netif != NULL", (netif != NULL), return;); + 800d9d4: 687b ldr r3, [r7, #4] + 800d9d6: 2b00 cmp r3, #0 + 800d9d8: d107 bne.n 800d9ea + 800d9da: 4b64 ldr r3, [pc, #400] @ (800db6c ) + 800d9dc: f240 4215 movw r2, #1045 @ 0x415 + 800d9e0: 4963 ldr r1, [pc, #396] @ (800db70 ) + 800d9e2: 4864 ldr r0, [pc, #400] @ (800db74 ) + 800d9e4: f003 fe08 bl 80115f8 + 800d9e8: e0bc b.n 800db64 + dhcp = netif_dhcp_data(netif); + 800d9ea: 687b ldr r3, [r7, #4] + 800d9ec: 6a5b ldr r3, [r3, #36] @ 0x24 + 800d9ee: 61bb str r3, [r7, #24] + LWIP_ERROR("dhcp_bind: dhcp != NULL", (dhcp != NULL), return;); + 800d9f0: 69bb ldr r3, [r7, #24] + 800d9f2: 2b00 cmp r3, #0 + 800d9f4: d107 bne.n 800da06 + 800d9f6: 4b5d ldr r3, [pc, #372] @ (800db6c ) + 800d9f8: f240 4217 movw r2, #1047 @ 0x417 + 800d9fc: 495e ldr r1, [pc, #376] @ (800db78 ) + 800d9fe: 485d ldr r0, [pc, #372] @ (800db74 ) + 800da00: f003 fdfa bl 80115f8 + 800da04: e0ae b.n 800db64 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(netif=%p) %c%c%"U16_F"\n", (void *)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + + /* reset time used of lease */ + dhcp->lease_used = 0; + 800da06: 69bb ldr r3, [r7, #24] + 800da08: 2200 movs r2, #0 + 800da0a: 825a strh r2, [r3, #18] + + if (dhcp->offered_t0_lease != 0xffffffffUL) { + 800da0c: 69bb ldr r3, [r7, #24] + 800da0e: 6a9b ldr r3, [r3, #40] @ 0x28 + 800da10: f1b3 3fff cmp.w r3, #4294967295 + 800da14: d019 beq.n 800da4a + /* set renewal period timer */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t0 renewal timer %"U32_F" secs\n", dhcp->offered_t0_lease)); + timeout = (dhcp->offered_t0_lease + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS; + 800da16: 69bb ldr r3, [r7, #24] + 800da18: 6a9b ldr r3, [r3, #40] @ 0x28 + 800da1a: 331e adds r3, #30 + 800da1c: 4a57 ldr r2, [pc, #348] @ (800db7c ) + 800da1e: fba2 2303 umull r2, r3, r2, r3 + 800da22: 095b lsrs r3, r3, #5 + 800da24: 61fb str r3, [r7, #28] + if (timeout > 0xffff) { + 800da26: 69fb ldr r3, [r7, #28] + 800da28: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 800da2c: d302 bcc.n 800da34 + timeout = 0xffff; + 800da2e: f64f 73ff movw r3, #65535 @ 0xffff + 800da32: 61fb str r3, [r7, #28] + } + dhcp->t0_timeout = (u16_t)timeout; + 800da34: 69fb ldr r3, [r7, #28] + 800da36: b29a uxth r2, r3 + 800da38: 69bb ldr r3, [r7, #24] + 800da3a: 829a strh r2, [r3, #20] + if (dhcp->t0_timeout == 0) { + 800da3c: 69bb ldr r3, [r7, #24] + 800da3e: 8a9b ldrh r3, [r3, #20] + 800da40: 2b00 cmp r3, #0 + 800da42: d102 bne.n 800da4a + dhcp->t0_timeout = 1; + 800da44: 69bb ldr r3, [r7, #24] + 800da46: 2201 movs r2, #1 + 800da48: 829a strh r2, [r3, #20] + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t0_lease * 1000)); + } + + /* temporary DHCP lease? */ + if (dhcp->offered_t1_renew != 0xffffffffUL) { + 800da4a: 69bb ldr r3, [r7, #24] + 800da4c: 6adb ldr r3, [r3, #44] @ 0x2c + 800da4e: f1b3 3fff cmp.w r3, #4294967295 + 800da52: d01d beq.n 800da90 + /* set renewal period timer */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t1 renewal timer %"U32_F" secs\n", dhcp->offered_t1_renew)); + timeout = (dhcp->offered_t1_renew + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS; + 800da54: 69bb ldr r3, [r7, #24] + 800da56: 6adb ldr r3, [r3, #44] @ 0x2c + 800da58: 331e adds r3, #30 + 800da5a: 4a48 ldr r2, [pc, #288] @ (800db7c ) + 800da5c: fba2 2303 umull r2, r3, r2, r3 + 800da60: 095b lsrs r3, r3, #5 + 800da62: 61fb str r3, [r7, #28] + if (timeout > 0xffff) { + 800da64: 69fb ldr r3, [r7, #28] + 800da66: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 800da6a: d302 bcc.n 800da72 + timeout = 0xffff; + 800da6c: f64f 73ff movw r3, #65535 @ 0xffff + 800da70: 61fb str r3, [r7, #28] + } + dhcp->t1_timeout = (u16_t)timeout; + 800da72: 69fb ldr r3, [r7, #28] + 800da74: b29a uxth r2, r3 + 800da76: 69bb ldr r3, [r7, #24] + 800da78: 815a strh r2, [r3, #10] + if (dhcp->t1_timeout == 0) { + 800da7a: 69bb ldr r3, [r7, #24] + 800da7c: 895b ldrh r3, [r3, #10] + 800da7e: 2b00 cmp r3, #0 + 800da80: d102 bne.n 800da88 + dhcp->t1_timeout = 1; + 800da82: 69bb ldr r3, [r7, #24] + 800da84: 2201 movs r2, #1 + 800da86: 815a strh r2, [r3, #10] + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t1_renew * 1000)); + dhcp->t1_renew_time = dhcp->t1_timeout; + 800da88: 69bb ldr r3, [r7, #24] + 800da8a: 895a ldrh r2, [r3, #10] + 800da8c: 69bb ldr r3, [r7, #24] + 800da8e: 81da strh r2, [r3, #14] + } + /* set renewal period timer */ + if (dhcp->offered_t2_rebind != 0xffffffffUL) { + 800da90: 69bb ldr r3, [r7, #24] + 800da92: 6b1b ldr r3, [r3, #48] @ 0x30 + 800da94: f1b3 3fff cmp.w r3, #4294967295 + 800da98: d01d beq.n 800dad6 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t2 rebind timer %"U32_F" secs\n", dhcp->offered_t2_rebind)); + timeout = (dhcp->offered_t2_rebind + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS; + 800da9a: 69bb ldr r3, [r7, #24] + 800da9c: 6b1b ldr r3, [r3, #48] @ 0x30 + 800da9e: 331e adds r3, #30 + 800daa0: 4a36 ldr r2, [pc, #216] @ (800db7c ) + 800daa2: fba2 2303 umull r2, r3, r2, r3 + 800daa6: 095b lsrs r3, r3, #5 + 800daa8: 61fb str r3, [r7, #28] + if (timeout > 0xffff) { + 800daaa: 69fb ldr r3, [r7, #28] + 800daac: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 800dab0: d302 bcc.n 800dab8 + timeout = 0xffff; + 800dab2: f64f 73ff movw r3, #65535 @ 0xffff + 800dab6: 61fb str r3, [r7, #28] + } + dhcp->t2_timeout = (u16_t)timeout; + 800dab8: 69fb ldr r3, [r7, #28] + 800daba: b29a uxth r2, r3 + 800dabc: 69bb ldr r3, [r7, #24] + 800dabe: 819a strh r2, [r3, #12] + if (dhcp->t2_timeout == 0) { + 800dac0: 69bb ldr r3, [r7, #24] + 800dac2: 899b ldrh r3, [r3, #12] + 800dac4: 2b00 cmp r3, #0 + 800dac6: d102 bne.n 800dace + dhcp->t2_timeout = 1; + 800dac8: 69bb ldr r3, [r7, #24] + 800daca: 2201 movs r2, #1 + 800dacc: 819a strh r2, [r3, #12] + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind * 1000)); + dhcp->t2_rebind_time = dhcp->t2_timeout; + 800dace: 69bb ldr r3, [r7, #24] + 800dad0: 899a ldrh r2, [r3, #12] + 800dad2: 69bb ldr r3, [r7, #24] + 800dad4: 821a strh r2, [r3, #16] + } + + /* If we have sub 1 minute lease, t2 and t1 will kick in at the same time. */ + if ((dhcp->t1_timeout >= dhcp->t2_timeout) && (dhcp->t2_timeout > 0)) { + 800dad6: 69bb ldr r3, [r7, #24] + 800dad8: 895a ldrh r2, [r3, #10] + 800dada: 69bb ldr r3, [r7, #24] + 800dadc: 899b ldrh r3, [r3, #12] + 800dade: 429a cmp r2, r3 + 800dae0: d306 bcc.n 800daf0 + 800dae2: 69bb ldr r3, [r7, #24] + 800dae4: 899b ldrh r3, [r3, #12] + 800dae6: 2b00 cmp r3, #0 + 800dae8: d002 beq.n 800daf0 + dhcp->t1_timeout = 0; + 800daea: 69bb ldr r3, [r7, #24] + 800daec: 2200 movs r2, #0 + 800daee: 815a strh r2, [r3, #10] + } + + if (dhcp->subnet_mask_given) { + 800daf0: 69bb ldr r3, [r7, #24] + 800daf2: 79db ldrb r3, [r3, #7] + 800daf4: 2b00 cmp r3, #0 + 800daf6: d003 beq.n 800db00 + /* copy offered network mask */ + ip4_addr_copy(sn_mask, dhcp->offered_sn_mask); + 800daf8: 69bb ldr r3, [r7, #24] + 800dafa: 6a1b ldr r3, [r3, #32] + 800dafc: 613b str r3, [r7, #16] + 800dafe: e014 b.n 800db2a + } else { + /* subnet mask not given, choose a safe subnet mask given the network class */ + u8_t first_octet = ip4_addr1(&dhcp->offered_ip_addr); + 800db00: 69bb ldr r3, [r7, #24] + 800db02: 331c adds r3, #28 + 800db04: 781b ldrb r3, [r3, #0] + 800db06: 75fb strb r3, [r7, #23] + if (first_octet <= 127) { + 800db08: f997 3017 ldrsb.w r3, [r7, #23] + 800db0c: 2b00 cmp r3, #0 + 800db0e: db02 blt.n 800db16 + ip4_addr_set_u32(&sn_mask, PP_HTONL(0xff000000UL)); + 800db10: 23ff movs r3, #255 @ 0xff + 800db12: 613b str r3, [r7, #16] + 800db14: e009 b.n 800db2a + } else if (first_octet >= 192) { + 800db16: 7dfb ldrb r3, [r7, #23] + 800db18: 2bbf cmp r3, #191 @ 0xbf + 800db1a: d903 bls.n 800db24 + ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffffff00UL)); + 800db1c: f06f 437f mvn.w r3, #4278190080 @ 0xff000000 + 800db20: 613b str r3, [r7, #16] + 800db22: e002 b.n 800db2a + } else { + ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffff0000UL)); + 800db24: f64f 73ff movw r3, #65535 @ 0xffff + 800db28: 613b str r3, [r7, #16] + } + } + + ip4_addr_copy(gw_addr, dhcp->offered_gw_addr); + 800db2a: 69bb ldr r3, [r7, #24] + 800db2c: 6a5b ldr r3, [r3, #36] @ 0x24 + 800db2e: 60fb str r3, [r7, #12] + /* gateway address not given? */ + if (ip4_addr_isany_val(gw_addr)) { + 800db30: 68fb ldr r3, [r7, #12] + 800db32: 2b00 cmp r3, #0 + 800db34: d108 bne.n 800db48 + /* copy network address */ + ip4_addr_get_network(&gw_addr, &dhcp->offered_ip_addr, &sn_mask); + 800db36: 69bb ldr r3, [r7, #24] + 800db38: 69da ldr r2, [r3, #28] + 800db3a: 693b ldr r3, [r7, #16] + 800db3c: 4013 ands r3, r2 + 800db3e: 60fb str r3, [r7, #12] + /* use first host address on network as gateway */ + ip4_addr_set_u32(&gw_addr, ip4_addr_get_u32(&gw_addr) | PP_HTONL(0x00000001UL)); + 800db40: 68fb ldr r3, [r7, #12] + 800db42: f043 7380 orr.w r3, r3, #16777216 @ 0x1000000 + 800db46: 60fb str r3, [r7, #12] + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): IP: 0x%08"X32_F" SN: 0x%08"X32_F" GW: 0x%08"X32_F"\n", + ip4_addr_get_u32(&dhcp->offered_ip_addr), ip4_addr_get_u32(&sn_mask), ip4_addr_get_u32(&gw_addr))); + /* netif is now bound to DHCP leased address - set this before assigning the address + to ensure the callback can use dhcp_supplied_address() */ + dhcp_set_state(dhcp, DHCP_STATE_BOUND); + 800db48: 210a movs r1, #10 + 800db4a: 69b8 ldr r0, [r7, #24] + 800db4c: f000 fa9a bl 800e084 + + netif_set_addr(netif, &dhcp->offered_ip_addr, &sn_mask, &gw_addr); + 800db50: 69bb ldr r3, [r7, #24] + 800db52: f103 011c add.w r1, r3, #28 + 800db56: f107 030c add.w r3, r7, #12 + 800db5a: f107 0210 add.w r2, r7, #16 + 800db5e: 6878 ldr r0, [r7, #4] + 800db60: f7f8 fa84 bl 800606c + /* interface is used by routing now that an address is set */ +} + 800db64: 3720 adds r7, #32 + 800db66: 46bd mov sp, r7 + 800db68: bd80 pop {r7, pc} + 800db6a: bf00 nop + 800db6c: 08018304 .word 0x08018304 + 800db70: 08018464 .word 0x08018464 + 800db74: 08018364 .word 0x08018364 + 800db78: 08018480 .word 0x08018480 + 800db7c: 88888889 .word 0x88888889 + +0800db80 : + * + * @param netif network interface which must renew its lease + */ +err_t +dhcp_renew(struct netif *netif) +{ + 800db80: b580 push {r7, lr} + 800db82: b08a sub sp, #40 @ 0x28 + 800db84: af02 add r7, sp, #8 + 800db86: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800db88: 687b ldr r3, [r7, #4] + 800db8a: 6a5b ldr r3, [r3, #36] @ 0x24 + 800db8c: 61bb str r3, [r7, #24] + struct pbuf *p_out; + u16_t options_out_len; + + LWIP_ASSERT_CORE_LOCKED(); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_renew()\n")); + dhcp_set_state(dhcp, DHCP_STATE_RENEWING); + 800db8e: 2105 movs r1, #5 + 800db90: 69b8 ldr r0, [r7, #24] + 800db92: f000 fa77 bl 800e084 + + /* create and initialize the DHCP message header */ + p_out = dhcp_create_msg(netif, dhcp, DHCP_REQUEST, &options_out_len); + 800db96: f107 030c add.w r3, r7, #12 + 800db9a: 2203 movs r2, #3 + 800db9c: 69b9 ldr r1, [r7, #24] + 800db9e: 6878 ldr r0, [r7, #4] + 800dba0: f000 fefc bl 800e99c + 800dba4: 6178 str r0, [r7, #20] + if (p_out != NULL) { + 800dba6: 697b ldr r3, [r7, #20] + 800dba8: 2b00 cmp r3, #0 + 800dbaa: d04e beq.n 800dc4a + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800dbac: 697b ldr r3, [r7, #20] + 800dbae: 685b ldr r3, [r3, #4] + 800dbb0: 613b str r3, [r7, #16] + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + 800dbb2: 89b8 ldrh r0, [r7, #12] + 800dbb4: 693b ldr r3, [r7, #16] + 800dbb6: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dbba: 2302 movs r3, #2 + 800dbbc: 2239 movs r2, #57 @ 0x39 + 800dbbe: f000 fa7b bl 800e0b8 + 800dbc2: 4603 mov r3, r0 + 800dbc4: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_short(options_out_len, msg_out->options, DHCP_MAX_MSG_LEN(netif)); + 800dbc6: 89b8 ldrh r0, [r7, #12] + 800dbc8: 693b ldr r3, [r7, #16] + 800dbca: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dbce: 687b ldr r3, [r7, #4] + 800dbd0: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800dbd2: 461a mov r2, r3 + 800dbd4: f000 faca bl 800e16c + 800dbd8: 4603 mov r3, r0 + 800dbda: 81bb strh r3, [r7, #12] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + 800dbdc: 89b8 ldrh r0, [r7, #12] + 800dbde: 693b ldr r3, [r7, #16] + 800dbe0: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dbe4: 2303 movs r3, #3 + 800dbe6: 2237 movs r2, #55 @ 0x37 + 800dbe8: f000 fa66 bl 800e0b8 + 800dbec: 4603 mov r3, r0 + 800dbee: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800dbf0: 2300 movs r3, #0 + 800dbf2: 77bb strb r3, [r7, #30] + 800dbf4: e00e b.n 800dc14 + options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]); + 800dbf6: 89b8 ldrh r0, [r7, #12] + 800dbf8: 693b ldr r3, [r7, #16] + 800dbfa: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dbfe: 7fbb ldrb r3, [r7, #30] + 800dc00: 4a29 ldr r2, [pc, #164] @ (800dca8 ) + 800dc02: 5cd3 ldrb r3, [r2, r3] + 800dc04: 461a mov r2, r3 + 800dc06: f000 fa8b bl 800e120 + 800dc0a: 4603 mov r3, r0 + 800dc0c: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800dc0e: 7fbb ldrb r3, [r7, #30] + 800dc10: 3301 adds r3, #1 + 800dc12: 77bb strb r3, [r7, #30] + 800dc14: 7fbb ldrb r3, [r7, #30] + 800dc16: 2b02 cmp r3, #2 + 800dc18: d9ed bls.n 800dbf6 +#if LWIP_NETIF_HOSTNAME + options_out_len = dhcp_option_hostname(options_out_len, msg_out->options, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_RENEWING, msg_out, DHCP_REQUEST, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800dc1a: 89b8 ldrh r0, [r7, #12] + 800dc1c: 693b ldr r3, [r7, #16] + 800dc1e: 33f0 adds r3, #240 @ 0xf0 + 800dc20: 697a ldr r2, [r7, #20] + 800dc22: 4619 mov r1, r3 + 800dc24: f000 ff90 bl 800eb48 + + result = udp_sendto_if(dhcp_pcb, p_out, &dhcp->server_ip_addr, LWIP_IANA_PORT_DHCP_SERVER, netif); + 800dc28: 4b20 ldr r3, [pc, #128] @ (800dcac ) + 800dc2a: 6818 ldr r0, [r3, #0] + 800dc2c: 69bb ldr r3, [r7, #24] + 800dc2e: f103 0218 add.w r2, r3, #24 + 800dc32: 687b ldr r3, [r7, #4] + 800dc34: 9300 str r3, [sp, #0] + 800dc36: 2343 movs r3, #67 @ 0x43 + 800dc38: 6979 ldr r1, [r7, #20] + 800dc3a: f7fe fe53 bl 800c8e4 + 800dc3e: 4603 mov r3, r0 + 800dc40: 77fb strb r3, [r7, #31] + pbuf_free(p_out); + 800dc42: 6978 ldr r0, [r7, #20] + 800dc44: f7f8 fef0 bl 8006a28 + 800dc48: e001 b.n 800dc4e + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_renew: could not allocate DHCP request\n")); + result = ERR_MEM; + 800dc4a: 23ff movs r3, #255 @ 0xff + 800dc4c: 77fb strb r3, [r7, #31] + } + if (dhcp->tries < 255) { + 800dc4e: 69bb ldr r3, [r7, #24] + 800dc50: 799b ldrb r3, [r3, #6] + 800dc52: 2bff cmp r3, #255 @ 0xff + 800dc54: d005 beq.n 800dc62 + dhcp->tries++; + 800dc56: 69bb ldr r3, [r7, #24] + 800dc58: 799b ldrb r3, [r3, #6] + 800dc5a: 3301 adds r3, #1 + 800dc5c: b2da uxtb r2, r3 + 800dc5e: 69bb ldr r3, [r7, #24] + 800dc60: 719a strb r2, [r3, #6] + } + /* back-off on retries, but to a maximum of 20 seconds */ + msecs = (u16_t)(dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000); + 800dc62: 69bb ldr r3, [r7, #24] + 800dc64: 799b ldrb r3, [r3, #6] + 800dc66: 2b09 cmp r3, #9 + 800dc68: d809 bhi.n 800dc7e + 800dc6a: 69bb ldr r3, [r7, #24] + 800dc6c: 799b ldrb r3, [r3, #6] + 800dc6e: 461a mov r2, r3 + 800dc70: 0152 lsls r2, r2, #5 + 800dc72: 1ad2 subs r2, r2, r3 + 800dc74: 0092 lsls r2, r2, #2 + 800dc76: 4413 add r3, r2 + 800dc78: 011b lsls r3, r3, #4 + 800dc7a: b29b uxth r3, r3 + 800dc7c: e001 b.n 800dc82 + 800dc7e: f644 6320 movw r3, #20000 @ 0x4e20 + 800dc82: 81fb strh r3, [r7, #14] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800dc84: 89fb ldrh r3, [r7, #14] + 800dc86: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800dc8a: 4a09 ldr r2, [pc, #36] @ (800dcb0 ) + 800dc8c: fb82 1203 smull r1, r2, r2, r3 + 800dc90: 1152 asrs r2, r2, #5 + 800dc92: 17db asrs r3, r3, #31 + 800dc94: 1ad3 subs r3, r2, r3 + 800dc96: b29a uxth r2, r3 + 800dc98: 69bb ldr r3, [r7, #24] + 800dc9a: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew(): set request timeout %"U16_F" msecs\n", msecs)); + return result; + 800dc9c: f997 301f ldrsb.w r3, [r7, #31] +} + 800dca0: 4618 mov r0, r3 + 800dca2: 3720 adds r7, #32 + 800dca4: 46bd mov sp, r7 + 800dca6: bd80 pop {r7, pc} + 800dca8: 2000002c .word 0x2000002c + 800dcac: 2001912c .word 0x2001912c + 800dcb0: 10624dd3 .word 0x10624dd3 + +0800dcb4 : + * + * @param netif network interface which must rebind with a DHCP server + */ +static err_t +dhcp_rebind(struct netif *netif) +{ + 800dcb4: b580 push {r7, lr} + 800dcb6: b08a sub sp, #40 @ 0x28 + 800dcb8: af02 add r7, sp, #8 + 800dcba: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800dcbc: 687b ldr r3, [r7, #4] + 800dcbe: 6a5b ldr r3, [r3, #36] @ 0x24 + 800dcc0: 61bb str r3, [r7, #24] + u8_t i; + struct pbuf *p_out; + u16_t options_out_len; + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind()\n")); + dhcp_set_state(dhcp, DHCP_STATE_REBINDING); + 800dcc2: 2104 movs r1, #4 + 800dcc4: 69b8 ldr r0, [r7, #24] + 800dcc6: f000 f9dd bl 800e084 + + /* create and initialize the DHCP message header */ + p_out = dhcp_create_msg(netif, dhcp, DHCP_REQUEST, &options_out_len); + 800dcca: f107 030c add.w r3, r7, #12 + 800dcce: 2203 movs r2, #3 + 800dcd0: 69b9 ldr r1, [r7, #24] + 800dcd2: 6878 ldr r0, [r7, #4] + 800dcd4: f000 fe62 bl 800e99c + 800dcd8: 6178 str r0, [r7, #20] + if (p_out != NULL) { + 800dcda: 697b ldr r3, [r7, #20] + 800dcdc: 2b00 cmp r3, #0 + 800dcde: d04c beq.n 800dd7a + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800dce0: 697b ldr r3, [r7, #20] + 800dce2: 685b ldr r3, [r3, #4] + 800dce4: 613b str r3, [r7, #16] + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + 800dce6: 89b8 ldrh r0, [r7, #12] + 800dce8: 693b ldr r3, [r7, #16] + 800dcea: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dcee: 2302 movs r3, #2 + 800dcf0: 2239 movs r2, #57 @ 0x39 + 800dcf2: f000 f9e1 bl 800e0b8 + 800dcf6: 4603 mov r3, r0 + 800dcf8: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_short(options_out_len, msg_out->options, DHCP_MAX_MSG_LEN(netif)); + 800dcfa: 89b8 ldrh r0, [r7, #12] + 800dcfc: 693b ldr r3, [r7, #16] + 800dcfe: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dd02: 687b ldr r3, [r7, #4] + 800dd04: 8d1b ldrh r3, [r3, #40] @ 0x28 + 800dd06: 461a mov r2, r3 + 800dd08: f000 fa30 bl 800e16c + 800dd0c: 4603 mov r3, r0 + 800dd0e: 81bb strh r3, [r7, #12] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + 800dd10: 89b8 ldrh r0, [r7, #12] + 800dd12: 693b ldr r3, [r7, #16] + 800dd14: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dd18: 2303 movs r3, #3 + 800dd1a: 2237 movs r2, #55 @ 0x37 + 800dd1c: f000 f9cc bl 800e0b8 + 800dd20: 4603 mov r3, r0 + 800dd22: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800dd24: 2300 movs r3, #0 + 800dd26: 77bb strb r3, [r7, #30] + 800dd28: e00e b.n 800dd48 + options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]); + 800dd2a: 89b8 ldrh r0, [r7, #12] + 800dd2c: 693b ldr r3, [r7, #16] + 800dd2e: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dd32: 7fbb ldrb r3, [r7, #30] + 800dd34: 4a28 ldr r2, [pc, #160] @ (800ddd8 ) + 800dd36: 5cd3 ldrb r3, [r2, r3] + 800dd38: 461a mov r2, r3 + 800dd3a: f000 f9f1 bl 800e120 + 800dd3e: 4603 mov r3, r0 + 800dd40: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800dd42: 7fbb ldrb r3, [r7, #30] + 800dd44: 3301 adds r3, #1 + 800dd46: 77bb strb r3, [r7, #30] + 800dd48: 7fbb ldrb r3, [r7, #30] + 800dd4a: 2b02 cmp r3, #2 + 800dd4c: d9ed bls.n 800dd2a +#if LWIP_NETIF_HOSTNAME + options_out_len = dhcp_option_hostname(options_out_len, msg_out->options, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_REBINDING, msg_out, DHCP_DISCOVER, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800dd4e: 89b8 ldrh r0, [r7, #12] + 800dd50: 693b ldr r3, [r7, #16] + 800dd52: 33f0 adds r3, #240 @ 0xf0 + 800dd54: 697a ldr r2, [r7, #20] + 800dd56: 4619 mov r1, r3 + 800dd58: f000 fef6 bl 800eb48 + + /* broadcast to server */ + result = udp_sendto_if(dhcp_pcb, p_out, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER, netif); + 800dd5c: 4b1f ldr r3, [pc, #124] @ (800dddc ) + 800dd5e: 6818 ldr r0, [r3, #0] + 800dd60: 687b ldr r3, [r7, #4] + 800dd62: 9300 str r3, [sp, #0] + 800dd64: 2343 movs r3, #67 @ 0x43 + 800dd66: 4a1e ldr r2, [pc, #120] @ (800dde0 ) + 800dd68: 6979 ldr r1, [r7, #20] + 800dd6a: f7fe fdbb bl 800c8e4 + 800dd6e: 4603 mov r3, r0 + 800dd70: 77fb strb r3, [r7, #31] + pbuf_free(p_out); + 800dd72: 6978 ldr r0, [r7, #20] + 800dd74: f7f8 fe58 bl 8006a28 + 800dd78: e001 b.n 800dd7e + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_rebind: could not allocate DHCP request\n")); + result = ERR_MEM; + 800dd7a: 23ff movs r3, #255 @ 0xff + 800dd7c: 77fb strb r3, [r7, #31] + } + if (dhcp->tries < 255) { + 800dd7e: 69bb ldr r3, [r7, #24] + 800dd80: 799b ldrb r3, [r3, #6] + 800dd82: 2bff cmp r3, #255 @ 0xff + 800dd84: d005 beq.n 800dd92 + dhcp->tries++; + 800dd86: 69bb ldr r3, [r7, #24] + 800dd88: 799b ldrb r3, [r3, #6] + 800dd8a: 3301 adds r3, #1 + 800dd8c: b2da uxtb r2, r3 + 800dd8e: 69bb ldr r3, [r7, #24] + 800dd90: 719a strb r2, [r3, #6] + } + msecs = (u16_t)(dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000); + 800dd92: 69bb ldr r3, [r7, #24] + 800dd94: 799b ldrb r3, [r3, #6] + 800dd96: 2b09 cmp r3, #9 + 800dd98: d809 bhi.n 800ddae + 800dd9a: 69bb ldr r3, [r7, #24] + 800dd9c: 799b ldrb r3, [r3, #6] + 800dd9e: 461a mov r2, r3 + 800dda0: 0152 lsls r2, r2, #5 + 800dda2: 1ad2 subs r2, r2, r3 + 800dda4: 0092 lsls r2, r2, #2 + 800dda6: 4413 add r3, r2 + 800dda8: 00db lsls r3, r3, #3 + 800ddaa: b29b uxth r3, r3 + 800ddac: e001 b.n 800ddb2 + 800ddae: f242 7310 movw r3, #10000 @ 0x2710 + 800ddb2: 81fb strh r3, [r7, #14] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800ddb4: 89fb ldrh r3, [r7, #14] + 800ddb6: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800ddba: 4a0a ldr r2, [pc, #40] @ (800dde4 ) + 800ddbc: fb82 1203 smull r1, r2, r2, r3 + 800ddc0: 1152 asrs r2, r2, #5 + 800ddc2: 17db asrs r3, r3, #31 + 800ddc4: 1ad3 subs r3, r2, r3 + 800ddc6: b29a uxth r2, r3 + 800ddc8: 69bb ldr r3, [r7, #24] + 800ddca: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind(): set request timeout %"U16_F" msecs\n", msecs)); + return result; + 800ddcc: f997 301f ldrsb.w r3, [r7, #31] +} + 800ddd0: 4618 mov r0, r3 + 800ddd2: 3720 adds r7, #32 + 800ddd4: 46bd mov sp, r7 + 800ddd6: bd80 pop {r7, pc} + 800ddd8: 2000002c .word 0x2000002c + 800dddc: 2001912c .word 0x2001912c + 800dde0: 08018ed8 .word 0x08018ed8 + 800dde4: 10624dd3 .word 0x10624dd3 + +0800dde8 : + * + * @param netif network interface which must reboot + */ +static err_t +dhcp_reboot(struct netif *netif) +{ + 800dde8: b5b0 push {r4, r5, r7, lr} + 800ddea: b08a sub sp, #40 @ 0x28 + 800ddec: af02 add r7, sp, #8 + 800ddee: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800ddf0: 687b ldr r3, [r7, #4] + 800ddf2: 6a5b ldr r3, [r3, #36] @ 0x24 + 800ddf4: 61bb str r3, [r7, #24] + u8_t i; + struct pbuf *p_out; + u16_t options_out_len; + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot()\n")); + dhcp_set_state(dhcp, DHCP_STATE_REBOOTING); + 800ddf6: 2103 movs r1, #3 + 800ddf8: 69b8 ldr r0, [r7, #24] + 800ddfa: f000 f943 bl 800e084 + + /* create and initialize the DHCP message header */ + p_out = dhcp_create_msg(netif, dhcp, DHCP_REQUEST, &options_out_len); + 800ddfe: f107 030c add.w r3, r7, #12 + 800de02: 2203 movs r2, #3 + 800de04: 69b9 ldr r1, [r7, #24] + 800de06: 6878 ldr r0, [r7, #4] + 800de08: f000 fdc8 bl 800e99c + 800de0c: 6178 str r0, [r7, #20] + if (p_out != NULL) { + 800de0e: 697b ldr r3, [r7, #20] + 800de10: 2b00 cmp r3, #0 + 800de12: d066 beq.n 800dee2 + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800de14: 697b ldr r3, [r7, #20] + 800de16: 685b ldr r3, [r3, #4] + 800de18: 613b str r3, [r7, #16] + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + 800de1a: 89b8 ldrh r0, [r7, #12] + 800de1c: 693b ldr r3, [r7, #16] + 800de1e: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800de22: 2302 movs r3, #2 + 800de24: 2239 movs r2, #57 @ 0x39 + 800de26: f000 f947 bl 800e0b8 + 800de2a: 4603 mov r3, r0 + 800de2c: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_short(options_out_len, msg_out->options, DHCP_MAX_MSG_LEN_MIN_REQUIRED); + 800de2e: 89b8 ldrh r0, [r7, #12] + 800de30: 693b ldr r3, [r7, #16] + 800de32: 33f0 adds r3, #240 @ 0xf0 + 800de34: f44f 7210 mov.w r2, #576 @ 0x240 + 800de38: 4619 mov r1, r3 + 800de3a: f000 f997 bl 800e16c + 800de3e: 4603 mov r3, r0 + 800de40: 81bb strh r3, [r7, #12] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_REQUESTED_IP, 4); + 800de42: 89b8 ldrh r0, [r7, #12] + 800de44: 693b ldr r3, [r7, #16] + 800de46: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800de4a: 2304 movs r3, #4 + 800de4c: 2232 movs r2, #50 @ 0x32 + 800de4e: f000 f933 bl 800e0b8 + 800de52: 4603 mov r3, r0 + 800de54: 81bb strh r3, [r7, #12] + options_out_len = dhcp_option_long(options_out_len, msg_out->options, lwip_ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr))); + 800de56: 89bc ldrh r4, [r7, #12] + 800de58: 693b ldr r3, [r7, #16] + 800de5a: f103 05f0 add.w r5, r3, #240 @ 0xf0 + 800de5e: 69bb ldr r3, [r7, #24] + 800de60: 69db ldr r3, [r3, #28] + 800de62: 4618 mov r0, r3 + 800de64: f7f7 faa5 bl 80053b2 + 800de68: 4603 mov r3, r0 + 800de6a: 461a mov r2, r3 + 800de6c: 4629 mov r1, r5 + 800de6e: 4620 mov r0, r4 + 800de70: f000 f9ae bl 800e1d0 + 800de74: 4603 mov r3, r0 + 800de76: 81bb strh r3, [r7, #12] + + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + 800de78: 89b8 ldrh r0, [r7, #12] + 800de7a: 693b ldr r3, [r7, #16] + 800de7c: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800de80: 2303 movs r3, #3 + 800de82: 2237 movs r2, #55 @ 0x37 + 800de84: f000 f918 bl 800e0b8 + 800de88: 4603 mov r3, r0 + 800de8a: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800de8c: 2300 movs r3, #0 + 800de8e: 77bb strb r3, [r7, #30] + 800de90: e00e b.n 800deb0 + options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]); + 800de92: 89b8 ldrh r0, [r7, #12] + 800de94: 693b ldr r3, [r7, #16] + 800de96: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800de9a: 7fbb ldrb r3, [r7, #30] + 800de9c: 4a28 ldr r2, [pc, #160] @ (800df40 ) + 800de9e: 5cd3 ldrb r3, [r2, r3] + 800dea0: 461a mov r2, r3 + 800dea2: f000 f93d bl 800e120 + 800dea6: 4603 mov r3, r0 + 800dea8: 81bb strh r3, [r7, #12] + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + 800deaa: 7fbb ldrb r3, [r7, #30] + 800deac: 3301 adds r3, #1 + 800deae: 77bb strb r3, [r7, #30] + 800deb0: 7fbb ldrb r3, [r7, #30] + 800deb2: 2b02 cmp r3, #2 + 800deb4: d9ed bls.n 800de92 +#if LWIP_NETIF_HOSTNAME + options_out_len = dhcp_option_hostname(options_out_len, msg_out->options, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_REBOOTING, msg_out, DHCP_REQUEST, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800deb6: 89b8 ldrh r0, [r7, #12] + 800deb8: 693b ldr r3, [r7, #16] + 800deba: 33f0 adds r3, #240 @ 0xf0 + 800debc: 697a ldr r2, [r7, #20] + 800debe: 4619 mov r1, r3 + 800dec0: f000 fe42 bl 800eb48 + + /* broadcast to server */ + result = udp_sendto_if(dhcp_pcb, p_out, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER, netif); + 800dec4: 4b1f ldr r3, [pc, #124] @ (800df44 ) + 800dec6: 6818 ldr r0, [r3, #0] + 800dec8: 687b ldr r3, [r7, #4] + 800deca: 9300 str r3, [sp, #0] + 800decc: 2343 movs r3, #67 @ 0x43 + 800dece: 4a1e ldr r2, [pc, #120] @ (800df48 ) + 800ded0: 6979 ldr r1, [r7, #20] + 800ded2: f7fe fd07 bl 800c8e4 + 800ded6: 4603 mov r3, r0 + 800ded8: 77fb strb r3, [r7, #31] + pbuf_free(p_out); + 800deda: 6978 ldr r0, [r7, #20] + 800dedc: f7f8 fda4 bl 8006a28 + 800dee0: e001 b.n 800dee6 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot: REBOOTING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_reboot: could not allocate DHCP request\n")); + result = ERR_MEM; + 800dee2: 23ff movs r3, #255 @ 0xff + 800dee4: 77fb strb r3, [r7, #31] + } + if (dhcp->tries < 255) { + 800dee6: 69bb ldr r3, [r7, #24] + 800dee8: 799b ldrb r3, [r3, #6] + 800deea: 2bff cmp r3, #255 @ 0xff + 800deec: d005 beq.n 800defa + dhcp->tries++; + 800deee: 69bb ldr r3, [r7, #24] + 800def0: 799b ldrb r3, [r3, #6] + 800def2: 3301 adds r3, #1 + 800def4: b2da uxtb r2, r3 + 800def6: 69bb ldr r3, [r7, #24] + 800def8: 719a strb r2, [r3, #6] + } + msecs = (u16_t)(dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000); + 800defa: 69bb ldr r3, [r7, #24] + 800defc: 799b ldrb r3, [r3, #6] + 800defe: 2b09 cmp r3, #9 + 800df00: d809 bhi.n 800df16 + 800df02: 69bb ldr r3, [r7, #24] + 800df04: 799b ldrb r3, [r3, #6] + 800df06: 461a mov r2, r3 + 800df08: 0152 lsls r2, r2, #5 + 800df0a: 1ad2 subs r2, r2, r3 + 800df0c: 0092 lsls r2, r2, #2 + 800df0e: 4413 add r3, r2 + 800df10: 00db lsls r3, r3, #3 + 800df12: b29b uxth r3, r3 + 800df14: e001 b.n 800df1a + 800df16: f242 7310 movw r3, #10000 @ 0x2710 + 800df1a: 81fb strh r3, [r7, #14] + dhcp->request_timeout = (u16_t)((msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS); + 800df1c: 89fb ldrh r3, [r7, #14] + 800df1e: f203 13f3 addw r3, r3, #499 @ 0x1f3 + 800df22: 4a0a ldr r2, [pc, #40] @ (800df4c ) + 800df24: fb82 1203 smull r1, r2, r2, r3 + 800df28: 1152 asrs r2, r2, #5 + 800df2a: 17db asrs r3, r3, #31 + 800df2c: 1ad3 subs r3, r2, r3 + 800df2e: b29a uxth r2, r3 + 800df30: 69bb ldr r3, [r7, #24] + 800df32: 811a strh r2, [r3, #8] + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot(): set request timeout %"U16_F" msecs\n", msecs)); + return result; + 800df34: f997 301f ldrsb.w r3, [r7, #31] +} + 800df38: 4618 mov r0, r3 + 800df3a: 3720 adds r7, #32 + 800df3c: 46bd mov sp, r7 + 800df3e: bdb0 pop {r4, r5, r7, pc} + 800df40: 2000002c .word 0x2000002c + 800df44: 2001912c .word 0x2001912c + 800df48: 08018ed8 .word 0x08018ed8 + 800df4c: 10624dd3 .word 0x10624dd3 + +0800df50 : + * + * @param netif network interface + */ +void +dhcp_release_and_stop(struct netif *netif) +{ + 800df50: b5b0 push {r4, r5, r7, lr} + 800df52: b08a sub sp, #40 @ 0x28 + 800df54: af02 add r7, sp, #8 + 800df56: 6078 str r0, [r7, #4] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800df58: 687b ldr r3, [r7, #4] + 800df5a: 6a5b ldr r3, [r3, #36] @ 0x24 + 800df5c: 61fb str r3, [r7, #28] + ip_addr_t server_ip_addr; + + LWIP_ASSERT_CORE_LOCKED(); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_release_and_stop()\n")); + if (dhcp == NULL) { + 800df5e: 69fb ldr r3, [r7, #28] + 800df60: 2b00 cmp r3, #0 + 800df62: f000 8084 beq.w 800e06e + return; + } + + /* already off? -> nothing to do */ + if (dhcp->state == DHCP_STATE_OFF) { + 800df66: 69fb ldr r3, [r7, #28] + 800df68: 795b ldrb r3, [r3, #5] + 800df6a: 2b00 cmp r3, #0 + 800df6c: f000 8081 beq.w 800e072 + return; + } + + ip_addr_copy(server_ip_addr, dhcp->server_ip_addr); + 800df70: 69fb ldr r3, [r7, #28] + 800df72: 699b ldr r3, [r3, #24] + 800df74: 613b str r3, [r7, #16] + + /* clean old DHCP offer */ + ip_addr_set_zero_ip4(&dhcp->server_ip_addr); + 800df76: 69fb ldr r3, [r7, #28] + 800df78: 2200 movs r2, #0 + 800df7a: 619a str r2, [r3, #24] + ip4_addr_set_zero(&dhcp->offered_ip_addr); + 800df7c: 69fb ldr r3, [r7, #28] + 800df7e: 2200 movs r2, #0 + 800df80: 61da str r2, [r3, #28] + ip4_addr_set_zero(&dhcp->offered_sn_mask); + 800df82: 69fb ldr r3, [r7, #28] + 800df84: 2200 movs r2, #0 + 800df86: 621a str r2, [r3, #32] + ip4_addr_set_zero(&dhcp->offered_gw_addr); + 800df88: 69fb ldr r3, [r7, #28] + 800df8a: 2200 movs r2, #0 + 800df8c: 625a str r2, [r3, #36] @ 0x24 +#if LWIP_DHCP_BOOTP_FILE + ip4_addr_set_zero(&dhcp->offered_si_addr); +#endif /* LWIP_DHCP_BOOTP_FILE */ + dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0; + 800df8e: 69fb ldr r3, [r7, #28] + 800df90: 2200 movs r2, #0 + 800df92: 631a str r2, [r3, #48] @ 0x30 + 800df94: 69fb ldr r3, [r7, #28] + 800df96: 6b1a ldr r2, [r3, #48] @ 0x30 + 800df98: 69fb ldr r3, [r7, #28] + 800df9a: 62da str r2, [r3, #44] @ 0x2c + 800df9c: 69fb ldr r3, [r7, #28] + 800df9e: 6ada ldr r2, [r3, #44] @ 0x2c + 800dfa0: 69fb ldr r3, [r7, #28] + 800dfa2: 629a str r2, [r3, #40] @ 0x28 + dhcp->t1_renew_time = dhcp->t2_rebind_time = dhcp->lease_used = dhcp->t0_timeout = 0; + 800dfa4: 69fb ldr r3, [r7, #28] + 800dfa6: 2200 movs r2, #0 + 800dfa8: 829a strh r2, [r3, #20] + 800dfaa: 69fb ldr r3, [r7, #28] + 800dfac: 8a9a ldrh r2, [r3, #20] + 800dfae: 69fb ldr r3, [r7, #28] + 800dfb0: 825a strh r2, [r3, #18] + 800dfb2: 69fb ldr r3, [r7, #28] + 800dfb4: 8a5a ldrh r2, [r3, #18] + 800dfb6: 69fb ldr r3, [r7, #28] + 800dfb8: 821a strh r2, [r3, #16] + 800dfba: 69fb ldr r3, [r7, #28] + 800dfbc: 8a1a ldrh r2, [r3, #16] + 800dfbe: 69fb ldr r3, [r7, #28] + 800dfc0: 81da strh r2, [r3, #14] + + /* send release message when current IP was assigned via DHCP */ + if (dhcp_supplied_address(netif)) { + 800dfc2: 6878 ldr r0, [r7, #4] + 800dfc4: f000 fdee bl 800eba4 + 800dfc8: 4603 mov r3, r0 + 800dfca: 2b00 cmp r3, #0 + 800dfcc: d03b beq.n 800e046 + /* create and initialize the DHCP message header */ + struct pbuf *p_out; + u16_t options_out_len; + p_out = dhcp_create_msg(netif, dhcp, DHCP_RELEASE, &options_out_len); + 800dfce: f107 030e add.w r3, r7, #14 + 800dfd2: 2207 movs r2, #7 + 800dfd4: 69f9 ldr r1, [r7, #28] + 800dfd6: 6878 ldr r0, [r7, #4] + 800dfd8: f000 fce0 bl 800e99c + 800dfdc: 61b8 str r0, [r7, #24] + if (p_out != NULL) { + 800dfde: 69bb ldr r3, [r7, #24] + 800dfe0: 2b00 cmp r3, #0 + 800dfe2: d030 beq.n 800e046 + struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload; + 800dfe4: 69bb ldr r3, [r7, #24] + 800dfe6: 685b ldr r3, [r3, #4] + 800dfe8: 617b str r3, [r7, #20] + options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_SERVER_ID, 4); + 800dfea: 89f8 ldrh r0, [r7, #14] + 800dfec: 697b ldr r3, [r7, #20] + 800dfee: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800dff2: 2304 movs r3, #4 + 800dff4: 2236 movs r2, #54 @ 0x36 + 800dff6: f000 f85f bl 800e0b8 + 800dffa: 4603 mov r3, r0 + 800dffc: 81fb strh r3, [r7, #14] + options_out_len = dhcp_option_long(options_out_len, msg_out->options, lwip_ntohl(ip4_addr_get_u32(ip_2_ip4(&server_ip_addr)))); + 800dffe: 89fc ldrh r4, [r7, #14] + 800e000: 697b ldr r3, [r7, #20] + 800e002: f103 05f0 add.w r5, r3, #240 @ 0xf0 + 800e006: 693b ldr r3, [r7, #16] + 800e008: 4618 mov r0, r3 + 800e00a: f7f7 f9d2 bl 80053b2 + 800e00e: 4603 mov r3, r0 + 800e010: 461a mov r2, r3 + 800e012: 4629 mov r1, r5 + 800e014: 4620 mov r0, r4 + 800e016: f000 f8db bl 800e1d0 + 800e01a: 4603 mov r3, r0 + 800e01c: 81fb strh r3, [r7, #14] + + LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, dhcp->state, msg_out, DHCP_RELEASE, &options_out_len); + dhcp_option_trailer(options_out_len, msg_out->options, p_out); + 800e01e: 89f8 ldrh r0, [r7, #14] + 800e020: 697b ldr r3, [r7, #20] + 800e022: 33f0 adds r3, #240 @ 0xf0 + 800e024: 69ba ldr r2, [r7, #24] + 800e026: 4619 mov r1, r3 + 800e028: f000 fd8e bl 800eb48 + + udp_sendto_if(dhcp_pcb, p_out, &server_ip_addr, LWIP_IANA_PORT_DHCP_SERVER, netif); + 800e02c: 4b13 ldr r3, [pc, #76] @ (800e07c ) + 800e02e: 6818 ldr r0, [r3, #0] + 800e030: f107 0210 add.w r2, r7, #16 + 800e034: 687b ldr r3, [r7, #4] + 800e036: 9300 str r3, [sp, #0] + 800e038: 2343 movs r3, #67 @ 0x43 + 800e03a: 69b9 ldr r1, [r7, #24] + 800e03c: f7fe fc52 bl 800c8e4 + pbuf_free(p_out); + 800e040: 69b8 ldr r0, [r7, #24] + 800e042: f7f8 fcf1 bl 8006a28 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_release: could not allocate DHCP request\n")); + } + } + + /* remove IP address from interface (prevents routing from selecting this interface) */ + netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4); + 800e046: 4b0e ldr r3, [pc, #56] @ (800e080 ) + 800e048: 4a0d ldr r2, [pc, #52] @ (800e080 ) + 800e04a: 490d ldr r1, [pc, #52] @ (800e080 ) + 800e04c: 6878 ldr r0, [r7, #4] + 800e04e: f7f8 f80d bl 800606c + autoip_stop(netif); + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF; + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + + dhcp_set_state(dhcp, DHCP_STATE_OFF); + 800e052: 2100 movs r1, #0 + 800e054: 69f8 ldr r0, [r7, #28] + 800e056: f000 f815 bl 800e084 + + if (dhcp->pcb_allocated != 0) { + 800e05a: 69fb ldr r3, [r7, #28] + 800e05c: 791b ldrb r3, [r3, #4] + 800e05e: 2b00 cmp r3, #0 + 800e060: d008 beq.n 800e074 + dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */ + 800e062: f7fe ff8b bl 800cf7c + dhcp->pcb_allocated = 0; + 800e066: 69fb ldr r3, [r7, #28] + 800e068: 2200 movs r2, #0 + 800e06a: 711a strb r2, [r3, #4] + 800e06c: e002 b.n 800e074 + return; + 800e06e: bf00 nop + 800e070: e000 b.n 800e074 + return; + 800e072: bf00 nop + } +} + 800e074: 3720 adds r7, #32 + 800e076: 46bd mov sp, r7 + 800e078: bdb0 pop {r4, r5, r7, pc} + 800e07a: bf00 nop + 800e07c: 2001912c .word 0x2001912c + 800e080: 08018ed4 .word 0x08018ed4 + +0800e084 : + * + * If the state changed, reset the number of tries. + */ +static void +dhcp_set_state(struct dhcp *dhcp, u8_t new_state) +{ + 800e084: b480 push {r7} + 800e086: b083 sub sp, #12 + 800e088: af00 add r7, sp, #0 + 800e08a: 6078 str r0, [r7, #4] + 800e08c: 460b mov r3, r1 + 800e08e: 70fb strb r3, [r7, #3] + if (new_state != dhcp->state) { + 800e090: 687b ldr r3, [r7, #4] + 800e092: 795b ldrb r3, [r3, #5] + 800e094: 78fa ldrb r2, [r7, #3] + 800e096: 429a cmp r2, r3 + 800e098: d008 beq.n 800e0ac + dhcp->state = new_state; + 800e09a: 687b ldr r3, [r7, #4] + 800e09c: 78fa ldrb r2, [r7, #3] + 800e09e: 715a strb r2, [r3, #5] + dhcp->tries = 0; + 800e0a0: 687b ldr r3, [r7, #4] + 800e0a2: 2200 movs r2, #0 + 800e0a4: 719a strb r2, [r3, #6] + dhcp->request_timeout = 0; + 800e0a6: 687b ldr r3, [r7, #4] + 800e0a8: 2200 movs r2, #0 + 800e0aa: 811a strh r2, [r3, #8] + } +} + 800e0ac: bf00 nop + 800e0ae: 370c adds r7, #12 + 800e0b0: 46bd mov sp, r7 + 800e0b2: f85d 7b04 ldr.w r7, [sp], #4 + 800e0b6: 4770 bx lr + +0800e0b8 : + * DHCP message. + * + */ +static u16_t +dhcp_option(u16_t options_out_len, u8_t *options, u8_t option_type, u8_t option_len) +{ + 800e0b8: b580 push {r7, lr} + 800e0ba: b082 sub sp, #8 + 800e0bc: af00 add r7, sp, #0 + 800e0be: 6039 str r1, [r7, #0] + 800e0c0: 4611 mov r1, r2 + 800e0c2: 461a mov r2, r3 + 800e0c4: 4603 mov r3, r0 + 800e0c6: 80fb strh r3, [r7, #6] + 800e0c8: 460b mov r3, r1 + 800e0ca: 717b strb r3, [r7, #5] + 800e0cc: 4613 mov r3, r2 + 800e0ce: 713b strb r3, [r7, #4] + LWIP_ASSERT("dhcp_option: options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN); + 800e0d0: 88fa ldrh r2, [r7, #6] + 800e0d2: 793b ldrb r3, [r7, #4] + 800e0d4: 4413 add r3, r2 + 800e0d6: 3302 adds r3, #2 + 800e0d8: 2b44 cmp r3, #68 @ 0x44 + 800e0da: d906 bls.n 800e0ea + 800e0dc: 4b0d ldr r3, [pc, #52] @ (800e114 ) + 800e0de: f240 529a movw r2, #1434 @ 0x59a + 800e0e2: 490d ldr r1, [pc, #52] @ (800e118 ) + 800e0e4: 480d ldr r0, [pc, #52] @ (800e11c ) + 800e0e6: f003 fa87 bl 80115f8 + options[options_out_len++] = option_type; + 800e0ea: 88fb ldrh r3, [r7, #6] + 800e0ec: 1c5a adds r2, r3, #1 + 800e0ee: 80fa strh r2, [r7, #6] + 800e0f0: 461a mov r2, r3 + 800e0f2: 683b ldr r3, [r7, #0] + 800e0f4: 4413 add r3, r2 + 800e0f6: 797a ldrb r2, [r7, #5] + 800e0f8: 701a strb r2, [r3, #0] + options[options_out_len++] = option_len; + 800e0fa: 88fb ldrh r3, [r7, #6] + 800e0fc: 1c5a adds r2, r3, #1 + 800e0fe: 80fa strh r2, [r7, #6] + 800e100: 461a mov r2, r3 + 800e102: 683b ldr r3, [r7, #0] + 800e104: 4413 add r3, r2 + 800e106: 793a ldrb r2, [r7, #4] + 800e108: 701a strb r2, [r3, #0] + return options_out_len; + 800e10a: 88fb ldrh r3, [r7, #6] +} + 800e10c: 4618 mov r0, r3 + 800e10e: 3708 adds r7, #8 + 800e110: 46bd mov sp, r7 + 800e112: bd80 pop {r7, pc} + 800e114: 08018304 .word 0x08018304 + 800e118: 08018498 .word 0x08018498 + 800e11c: 08018364 .word 0x08018364 + +0800e120 : + * Concatenate a single byte to the outgoing DHCP message. + * + */ +static u16_t +dhcp_option_byte(u16_t options_out_len, u8_t *options, u8_t value) +{ + 800e120: b580 push {r7, lr} + 800e122: b082 sub sp, #8 + 800e124: af00 add r7, sp, #0 + 800e126: 4603 mov r3, r0 + 800e128: 6039 str r1, [r7, #0] + 800e12a: 80fb strh r3, [r7, #6] + 800e12c: 4613 mov r3, r2 + 800e12e: 717b strb r3, [r7, #5] + LWIP_ASSERT("dhcp_option_byte: options_out_len < DHCP_OPTIONS_LEN", options_out_len < DHCP_OPTIONS_LEN); + 800e130: 88fb ldrh r3, [r7, #6] + 800e132: 2b43 cmp r3, #67 @ 0x43 + 800e134: d906 bls.n 800e144 + 800e136: 4b0a ldr r3, [pc, #40] @ (800e160 ) + 800e138: f240 52a6 movw r2, #1446 @ 0x5a6 + 800e13c: 4909 ldr r1, [pc, #36] @ (800e164 ) + 800e13e: 480a ldr r0, [pc, #40] @ (800e168 ) + 800e140: f003 fa5a bl 80115f8 + options[options_out_len++] = value; + 800e144: 88fb ldrh r3, [r7, #6] + 800e146: 1c5a adds r2, r3, #1 + 800e148: 80fa strh r2, [r7, #6] + 800e14a: 461a mov r2, r3 + 800e14c: 683b ldr r3, [r7, #0] + 800e14e: 4413 add r3, r2 + 800e150: 797a ldrb r2, [r7, #5] + 800e152: 701a strb r2, [r3, #0] + return options_out_len; + 800e154: 88fb ldrh r3, [r7, #6] +} + 800e156: 4618 mov r0, r3 + 800e158: 3708 adds r7, #8 + 800e15a: 46bd mov sp, r7 + 800e15c: bd80 pop {r7, pc} + 800e15e: bf00 nop + 800e160: 08018304 .word 0x08018304 + 800e164: 080184dc .word 0x080184dc + 800e168: 08018364 .word 0x08018364 + +0800e16c : + +static u16_t +dhcp_option_short(u16_t options_out_len, u8_t *options, u16_t value) +{ + 800e16c: b580 push {r7, lr} + 800e16e: b082 sub sp, #8 + 800e170: af00 add r7, sp, #0 + 800e172: 4603 mov r3, r0 + 800e174: 6039 str r1, [r7, #0] + 800e176: 80fb strh r3, [r7, #6] + 800e178: 4613 mov r3, r2 + 800e17a: 80bb strh r3, [r7, #4] + LWIP_ASSERT("dhcp_option_short: options_out_len + 2 <= DHCP_OPTIONS_LEN", options_out_len + 2U <= DHCP_OPTIONS_LEN); + 800e17c: 88fb ldrh r3, [r7, #6] + 800e17e: 3302 adds r3, #2 + 800e180: 2b44 cmp r3, #68 @ 0x44 + 800e182: d906 bls.n 800e192 + 800e184: 4b0f ldr r3, [pc, #60] @ (800e1c4 ) + 800e186: f240 52ae movw r2, #1454 @ 0x5ae + 800e18a: 490f ldr r1, [pc, #60] @ (800e1c8 ) + 800e18c: 480f ldr r0, [pc, #60] @ (800e1cc ) + 800e18e: f003 fa33 bl 80115f8 + options[options_out_len++] = (u8_t)((value & 0xff00U) >> 8); + 800e192: 88bb ldrh r3, [r7, #4] + 800e194: 0a1b lsrs r3, r3, #8 + 800e196: b29a uxth r2, r3 + 800e198: 88fb ldrh r3, [r7, #6] + 800e19a: 1c59 adds r1, r3, #1 + 800e19c: 80f9 strh r1, [r7, #6] + 800e19e: 4619 mov r1, r3 + 800e1a0: 683b ldr r3, [r7, #0] + 800e1a2: 440b add r3, r1 + 800e1a4: b2d2 uxtb r2, r2 + 800e1a6: 701a strb r2, [r3, #0] + options[options_out_len++] = (u8_t) (value & 0x00ffU); + 800e1a8: 88fb ldrh r3, [r7, #6] + 800e1aa: 1c5a adds r2, r3, #1 + 800e1ac: 80fa strh r2, [r7, #6] + 800e1ae: 461a mov r2, r3 + 800e1b0: 683b ldr r3, [r7, #0] + 800e1b2: 4413 add r3, r2 + 800e1b4: 88ba ldrh r2, [r7, #4] + 800e1b6: b2d2 uxtb r2, r2 + 800e1b8: 701a strb r2, [r3, #0] + return options_out_len; + 800e1ba: 88fb ldrh r3, [r7, #6] +} + 800e1bc: 4618 mov r0, r3 + 800e1be: 3708 adds r7, #8 + 800e1c0: 46bd mov sp, r7 + 800e1c2: bd80 pop {r7, pc} + 800e1c4: 08018304 .word 0x08018304 + 800e1c8: 08018514 .word 0x08018514 + 800e1cc: 08018364 .word 0x08018364 + +0800e1d0 : + +static u16_t +dhcp_option_long(u16_t options_out_len, u8_t *options, u32_t value) +{ + 800e1d0: b580 push {r7, lr} + 800e1d2: b084 sub sp, #16 + 800e1d4: af00 add r7, sp, #0 + 800e1d6: 4603 mov r3, r0 + 800e1d8: 60b9 str r1, [r7, #8] + 800e1da: 607a str r2, [r7, #4] + 800e1dc: 81fb strh r3, [r7, #14] + LWIP_ASSERT("dhcp_option_long: options_out_len + 4 <= DHCP_OPTIONS_LEN", options_out_len + 4U <= DHCP_OPTIONS_LEN); + 800e1de: 89fb ldrh r3, [r7, #14] + 800e1e0: 3304 adds r3, #4 + 800e1e2: 2b44 cmp r3, #68 @ 0x44 + 800e1e4: d906 bls.n 800e1f4 + 800e1e6: 4b19 ldr r3, [pc, #100] @ (800e24c ) + 800e1e8: f240 52b7 movw r2, #1463 @ 0x5b7 + 800e1ec: 4918 ldr r1, [pc, #96] @ (800e250 ) + 800e1ee: 4819 ldr r0, [pc, #100] @ (800e254 ) + 800e1f0: f003 fa02 bl 80115f8 + options[options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24); + 800e1f4: 687b ldr r3, [r7, #4] + 800e1f6: 0e1a lsrs r2, r3, #24 + 800e1f8: 89fb ldrh r3, [r7, #14] + 800e1fa: 1c59 adds r1, r3, #1 + 800e1fc: 81f9 strh r1, [r7, #14] + 800e1fe: 4619 mov r1, r3 + 800e200: 68bb ldr r3, [r7, #8] + 800e202: 440b add r3, r1 + 800e204: b2d2 uxtb r2, r2 + 800e206: 701a strb r2, [r3, #0] + options[options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16); + 800e208: 687b ldr r3, [r7, #4] + 800e20a: 0c1a lsrs r2, r3, #16 + 800e20c: 89fb ldrh r3, [r7, #14] + 800e20e: 1c59 adds r1, r3, #1 + 800e210: 81f9 strh r1, [r7, #14] + 800e212: 4619 mov r1, r3 + 800e214: 68bb ldr r3, [r7, #8] + 800e216: 440b add r3, r1 + 800e218: b2d2 uxtb r2, r2 + 800e21a: 701a strb r2, [r3, #0] + options[options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8); + 800e21c: 687b ldr r3, [r7, #4] + 800e21e: 0a1a lsrs r2, r3, #8 + 800e220: 89fb ldrh r3, [r7, #14] + 800e222: 1c59 adds r1, r3, #1 + 800e224: 81f9 strh r1, [r7, #14] + 800e226: 4619 mov r1, r3 + 800e228: 68bb ldr r3, [r7, #8] + 800e22a: 440b add r3, r1 + 800e22c: b2d2 uxtb r2, r2 + 800e22e: 701a strb r2, [r3, #0] + options[options_out_len++] = (u8_t)((value & 0x000000ffUL)); + 800e230: 89fb ldrh r3, [r7, #14] + 800e232: 1c5a adds r2, r3, #1 + 800e234: 81fa strh r2, [r7, #14] + 800e236: 461a mov r2, r3 + 800e238: 68bb ldr r3, [r7, #8] + 800e23a: 4413 add r3, r2 + 800e23c: 687a ldr r2, [r7, #4] + 800e23e: b2d2 uxtb r2, r2 + 800e240: 701a strb r2, [r3, #0] + return options_out_len; + 800e242: 89fb ldrh r3, [r7, #14] +} + 800e244: 4618 mov r0, r3 + 800e246: 3710 adds r7, #16 + 800e248: 46bd mov sp, r7 + 800e24a: bd80 pop {r7, pc} + 800e24c: 08018304 .word 0x08018304 + 800e250: 08018550 .word 0x08018550 + 800e254: 08018364 .word 0x08018364 + +0800e258 : + * use that further on. + * + */ +static err_t +dhcp_parse_reply(struct pbuf *p, struct dhcp *dhcp) +{ + 800e258: b580 push {r7, lr} + 800e25a: b090 sub sp, #64 @ 0x40 + 800e25c: af00 add r7, sp, #0 + 800e25e: 6078 str r0, [r7, #4] + 800e260: 6039 str r1, [r7, #0] + u16_t offset; + u16_t offset_max; + u16_t options_idx; + u16_t options_idx_max; + struct pbuf *q; + int parse_file_as_options = 0; + 800e262: 2300 movs r3, #0 + 800e264: 62fb str r3, [r7, #44] @ 0x2c + int parse_sname_as_options = 0; + 800e266: 2300 movs r3, #0 + 800e268: 62bb str r3, [r7, #40] @ 0x28 +#endif + + LWIP_UNUSED_ARG(dhcp); + + /* clear received options */ + dhcp_clear_all_options(dhcp); + 800e26a: 2208 movs r2, #8 + 800e26c: 2100 movs r1, #0 + 800e26e: 48b5 ldr r0, [pc, #724] @ (800e544 ) + 800e270: f003 fa41 bl 80116f6 + /* check that beginning of dhcp_msg (up to and including chaddr) is in first pbuf */ + if (p->len < DHCP_SNAME_OFS) { + 800e274: 687b ldr r3, [r7, #4] + 800e276: 895b ldrh r3, [r3, #10] + 800e278: 2b2b cmp r3, #43 @ 0x2b + 800e27a: d802 bhi.n 800e282 + return ERR_BUF; + 800e27c: f06f 0301 mvn.w r3, #1 + 800e280: e2a7 b.n 800e7d2 + } + msg_in = (struct dhcp_msg *)p->payload; + 800e282: 687b ldr r3, [r7, #4] + 800e284: 685b ldr r3, [r3, #4] + 800e286: 61bb str r3, [r7, #24] +#endif /* LWIP_DHCP_BOOTP_FILE */ + + /* parse options */ + + /* start with options field */ + options_idx = DHCP_OPTIONS_OFS; + 800e288: 23f0 movs r3, #240 @ 0xf0 + 800e28a: 86fb strh r3, [r7, #54] @ 0x36 + /* parse options to the end of the received packet */ + options_idx_max = p->tot_len; + 800e28c: 687b ldr r3, [r7, #4] + 800e28e: 891b ldrh r3, [r3, #8] + 800e290: 86bb strh r3, [r7, #52] @ 0x34 +again: + q = p; + 800e292: 687b ldr r3, [r7, #4] + 800e294: 633b str r3, [r7, #48] @ 0x30 + while ((q != NULL) && (options_idx >= q->len)) { + 800e296: e00c b.n 800e2b2 + options_idx = (u16_t)(options_idx - q->len); + 800e298: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e29a: 895b ldrh r3, [r3, #10] + 800e29c: 8efa ldrh r2, [r7, #54] @ 0x36 + 800e29e: 1ad3 subs r3, r2, r3 + 800e2a0: 86fb strh r3, [r7, #54] @ 0x36 + options_idx_max = (u16_t)(options_idx_max - q->len); + 800e2a2: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e2a4: 895b ldrh r3, [r3, #10] + 800e2a6: 8eba ldrh r2, [r7, #52] @ 0x34 + 800e2a8: 1ad3 subs r3, r2, r3 + 800e2aa: 86bb strh r3, [r7, #52] @ 0x34 + q = q->next; + 800e2ac: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e2ae: 681b ldr r3, [r3, #0] + 800e2b0: 633b str r3, [r7, #48] @ 0x30 + while ((q != NULL) && (options_idx >= q->len)) { + 800e2b2: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e2b4: 2b00 cmp r3, #0 + 800e2b6: d004 beq.n 800e2c2 + 800e2b8: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e2ba: 895b ldrh r3, [r3, #10] + 800e2bc: 8efa ldrh r2, [r7, #54] @ 0x36 + 800e2be: 429a cmp r2, r3 + 800e2c0: d2ea bcs.n 800e298 + } + if (q == NULL) { + 800e2c2: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e2c4: 2b00 cmp r3, #0 + 800e2c6: d102 bne.n 800e2ce + return ERR_BUF; + 800e2c8: f06f 0301 mvn.w r3, #1 + 800e2cc: e281 b.n 800e7d2 + } + offset = options_idx; + 800e2ce: 8efb ldrh r3, [r7, #54] @ 0x36 + 800e2d0: 877b strh r3, [r7, #58] @ 0x3a + offset_max = options_idx_max; + 800e2d2: 8ebb ldrh r3, [r7, #52] @ 0x34 + 800e2d4: 873b strh r3, [r7, #56] @ 0x38 + options = (u8_t *)q->payload; + 800e2d6: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e2d8: 685b ldr r3, [r3, #4] + 800e2da: 63fb str r3, [r7, #60] @ 0x3c + /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */ + while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) { + 800e2dc: e239 b.n 800e752 + u8_t op = options[offset]; + 800e2de: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e2e0: 6bfa ldr r2, [r7, #60] @ 0x3c + 800e2e2: 4413 add r3, r2 + 800e2e4: 781b ldrb r3, [r3, #0] + 800e2e6: 75fb strb r3, [r7, #23] + u8_t len; + u8_t decode_len = 0; + 800e2e8: 2300 movs r3, #0 + 800e2ea: f887 3026 strb.w r3, [r7, #38] @ 0x26 + int decode_idx = -1; + 800e2ee: f04f 33ff mov.w r3, #4294967295 + 800e2f2: 623b str r3, [r7, #32] + u16_t val_offset = (u16_t)(offset + 2); + 800e2f4: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e2f6: 3302 adds r3, #2 + 800e2f8: 83fb strh r3, [r7, #30] + if (val_offset < offset) { + 800e2fa: 8bfa ldrh r2, [r7, #30] + 800e2fc: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e2fe: 429a cmp r2, r3 + 800e300: d202 bcs.n 800e308 + /* overflow */ + return ERR_BUF; + 800e302: f06f 0301 mvn.w r3, #1 + 800e306: e264 b.n 800e7d2 + } + /* len byte might be in the next pbuf */ + if ((offset + 1) < q->len) { + 800e308: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e30a: 3301 adds r3, #1 + 800e30c: 6b3a ldr r2, [r7, #48] @ 0x30 + 800e30e: 8952 ldrh r2, [r2, #10] + 800e310: 4293 cmp r3, r2 + 800e312: da07 bge.n 800e324 + len = options[offset + 1]; + 800e314: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e316: 3301 adds r3, #1 + 800e318: 6bfa ldr r2, [r7, #60] @ 0x3c + 800e31a: 4413 add r3, r2 + 800e31c: 781b ldrb r3, [r3, #0] + 800e31e: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 800e322: e00b b.n 800e33c + } else { + len = (q->next != NULL ? ((u8_t *)q->next->payload)[0] : 0); + 800e324: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e326: 681b ldr r3, [r3, #0] + 800e328: 2b00 cmp r3, #0 + 800e32a: d004 beq.n 800e336 + 800e32c: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e32e: 681b ldr r3, [r3, #0] + 800e330: 685b ldr r3, [r3, #4] + 800e332: 781b ldrb r3, [r3, #0] + 800e334: e000 b.n 800e338 + 800e336: 2300 movs r3, #0 + 800e338: f887 3027 strb.w r3, [r7, #39] @ 0x27 + } + /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */ + decode_len = len; + 800e33c: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e340: f887 3026 strb.w r3, [r7, #38] @ 0x26 + switch (op) { + 800e344: 7dfb ldrb r3, [r7, #23] + 800e346: 2b3b cmp r3, #59 @ 0x3b + 800e348: f200 812c bhi.w 800e5a4 + 800e34c: a201 add r2, pc, #4 @ (adr r2, 800e354 ) + 800e34e: f852 f023 ldr.w pc, [r2, r3, lsl #2] + 800e352: bf00 nop + 800e354: 0800e445 .word 0x0800e445 + 800e358: 0800e455 .word 0x0800e455 + 800e35c: 0800e5a5 .word 0x0800e5a5 + 800e360: 0800e477 .word 0x0800e477 + 800e364: 0800e5a5 .word 0x0800e5a5 + 800e368: 0800e5a5 .word 0x0800e5a5 + 800e36c: 0800e5a5 .word 0x0800e5a5 + 800e370: 0800e5a5 .word 0x0800e5a5 + 800e374: 0800e5a5 .word 0x0800e5a5 + 800e378: 0800e5a5 .word 0x0800e5a5 + 800e37c: 0800e5a5 .word 0x0800e5a5 + 800e380: 0800e5a5 .word 0x0800e5a5 + 800e384: 0800e5a5 .word 0x0800e5a5 + 800e388: 0800e5a5 .word 0x0800e5a5 + 800e38c: 0800e5a5 .word 0x0800e5a5 + 800e390: 0800e5a5 .word 0x0800e5a5 + 800e394: 0800e5a5 .word 0x0800e5a5 + 800e398: 0800e5a5 .word 0x0800e5a5 + 800e39c: 0800e5a5 .word 0x0800e5a5 + 800e3a0: 0800e5a5 .word 0x0800e5a5 + 800e3a4: 0800e5a5 .word 0x0800e5a5 + 800e3a8: 0800e5a5 .word 0x0800e5a5 + 800e3ac: 0800e5a5 .word 0x0800e5a5 + 800e3b0: 0800e5a5 .word 0x0800e5a5 + 800e3b4: 0800e5a5 .word 0x0800e5a5 + 800e3b8: 0800e5a5 .word 0x0800e5a5 + 800e3bc: 0800e5a5 .word 0x0800e5a5 + 800e3c0: 0800e5a5 .word 0x0800e5a5 + 800e3c4: 0800e5a5 .word 0x0800e5a5 + 800e3c8: 0800e5a5 .word 0x0800e5a5 + 800e3cc: 0800e5a5 .word 0x0800e5a5 + 800e3d0: 0800e5a5 .word 0x0800e5a5 + 800e3d4: 0800e5a5 .word 0x0800e5a5 + 800e3d8: 0800e5a5 .word 0x0800e5a5 + 800e3dc: 0800e5a5 .word 0x0800e5a5 + 800e3e0: 0800e5a5 .word 0x0800e5a5 + 800e3e4: 0800e5a5 .word 0x0800e5a5 + 800e3e8: 0800e5a5 .word 0x0800e5a5 + 800e3ec: 0800e5a5 .word 0x0800e5a5 + 800e3f0: 0800e5a5 .word 0x0800e5a5 + 800e3f4: 0800e5a5 .word 0x0800e5a5 + 800e3f8: 0800e5a5 .word 0x0800e5a5 + 800e3fc: 0800e5a5 .word 0x0800e5a5 + 800e400: 0800e5a5 .word 0x0800e5a5 + 800e404: 0800e5a5 .word 0x0800e5a5 + 800e408: 0800e5a5 .word 0x0800e5a5 + 800e40c: 0800e5a5 .word 0x0800e5a5 + 800e410: 0800e5a5 .word 0x0800e5a5 + 800e414: 0800e5a5 .word 0x0800e5a5 + 800e418: 0800e5a5 .word 0x0800e5a5 + 800e41c: 0800e5a5 .word 0x0800e5a5 + 800e420: 0800e4a3 .word 0x0800e4a3 + 800e424: 0800e4c5 .word 0x0800e4c5 + 800e428: 0800e501 .word 0x0800e501 + 800e42c: 0800e523 .word 0x0800e523 + 800e430: 0800e5a5 .word 0x0800e5a5 + 800e434: 0800e5a5 .word 0x0800e5a5 + 800e438: 0800e5a5 .word 0x0800e5a5 + 800e43c: 0800e561 .word 0x0800e561 + 800e440: 0800e583 .word 0x0800e583 + /* case(DHCP_OPTION_END): handled above */ + case (DHCP_OPTION_PAD): + /* special option: no len encoded */ + decode_len = len = 0; + 800e444: 2300 movs r3, #0 + 800e446: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 800e44a: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e44e: f887 3026 strb.w r3, [r7, #38] @ 0x26 + /* will be increased below */ + break; + 800e452: e0ab b.n 800e5ac + case (DHCP_OPTION_SUBNET_MASK): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + 800e454: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e458: 2b04 cmp r3, #4 + 800e45a: d009 beq.n 800e470 + 800e45c: 4b3a ldr r3, [pc, #232] @ (800e548 ) + 800e45e: f240 622e movw r2, #1582 @ 0x62e + 800e462: 493a ldr r1, [pc, #232] @ (800e54c ) + 800e464: 483a ldr r0, [pc, #232] @ (800e550 ) + 800e466: f003 f8c7 bl 80115f8 + 800e46a: f06f 0305 mvn.w r3, #5 + 800e46e: e1b0 b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_SUBNET_MASK; + 800e470: 2306 movs r3, #6 + 800e472: 623b str r3, [r7, #32] + break; + 800e474: e09a b.n 800e5ac + case (DHCP_OPTION_ROUTER): + decode_len = 4; /* only copy the first given router */ + 800e476: 2304 movs r3, #4 + 800e478: f887 3026 strb.w r3, [r7, #38] @ 0x26 + LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;); + 800e47c: f897 2027 ldrb.w r2, [r7, #39] @ 0x27 + 800e480: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e484: 429a cmp r2, r3 + 800e486: d209 bcs.n 800e49c + 800e488: 4b2f ldr r3, [pc, #188] @ (800e548 ) + 800e48a: f240 6233 movw r2, #1587 @ 0x633 + 800e48e: 4931 ldr r1, [pc, #196] @ (800e554 ) + 800e490: 482f ldr r0, [pc, #188] @ (800e550 ) + 800e492: f003 f8b1 bl 80115f8 + 800e496: f06f 0305 mvn.w r3, #5 + 800e49a: e19a b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_ROUTER; + 800e49c: 2307 movs r3, #7 + 800e49e: 623b str r3, [r7, #32] + break; + 800e4a0: e084 b.n 800e5ac + LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_DNS_SERVER; + break; +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS */ + case (DHCP_OPTION_LEASE_TIME): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + 800e4a2: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e4a6: 2b04 cmp r3, #4 + 800e4a8: d009 beq.n 800e4be + 800e4aa: 4b27 ldr r3, [pc, #156] @ (800e548 ) + 800e4ac: f240 6241 movw r2, #1601 @ 0x641 + 800e4b0: 4926 ldr r1, [pc, #152] @ (800e54c ) + 800e4b2: 4827 ldr r0, [pc, #156] @ (800e550 ) + 800e4b4: f003 f8a0 bl 80115f8 + 800e4b8: f06f 0305 mvn.w r3, #5 + 800e4bc: e189 b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_LEASE_TIME; + 800e4be: 2303 movs r3, #3 + 800e4c0: 623b str r3, [r7, #32] + break; + 800e4c2: e073 b.n 800e5ac + LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_NTP_SERVER; + break; +#endif /* LWIP_DHCP_GET_NTP_SRV*/ + case (DHCP_OPTION_OVERLOAD): + LWIP_ERROR("len == 1", len == 1, return ERR_VAL;); + 800e4c4: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e4c8: 2b01 cmp r3, #1 + 800e4ca: d009 beq.n 800e4e0 + 800e4cc: 4b1e ldr r3, [pc, #120] @ (800e548 ) + 800e4ce: f240 624f movw r2, #1615 @ 0x64f + 800e4d2: 4921 ldr r1, [pc, #132] @ (800e558 ) + 800e4d4: 481e ldr r0, [pc, #120] @ (800e550 ) + 800e4d6: f003 f88f bl 80115f8 + 800e4da: f06f 0305 mvn.w r3, #5 + 800e4de: e178 b.n 800e7d2 + /* decode overload only in options, not in file/sname: invalid packet */ + LWIP_ERROR("overload in file/sname", options_idx == DHCP_OPTIONS_OFS, return ERR_VAL;); + 800e4e0: 8efb ldrh r3, [r7, #54] @ 0x36 + 800e4e2: 2bf0 cmp r3, #240 @ 0xf0 + 800e4e4: d009 beq.n 800e4fa + 800e4e6: 4b18 ldr r3, [pc, #96] @ (800e548 ) + 800e4e8: f240 6251 movw r2, #1617 @ 0x651 + 800e4ec: 491b ldr r1, [pc, #108] @ (800e55c ) + 800e4ee: 4818 ldr r0, [pc, #96] @ (800e550 ) + 800e4f0: f003 f882 bl 80115f8 + 800e4f4: f06f 0305 mvn.w r3, #5 + 800e4f8: e16b b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_OVERLOAD; + 800e4fa: 2300 movs r3, #0 + 800e4fc: 623b str r3, [r7, #32] + break; + 800e4fe: e055 b.n 800e5ac + case (DHCP_OPTION_MESSAGE_TYPE): + LWIP_ERROR("len == 1", len == 1, return ERR_VAL;); + 800e500: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e504: 2b01 cmp r3, #1 + 800e506: d009 beq.n 800e51c + 800e508: 4b0f ldr r3, [pc, #60] @ (800e548 ) + 800e50a: f240 6255 movw r2, #1621 @ 0x655 + 800e50e: 4912 ldr r1, [pc, #72] @ (800e558 ) + 800e510: 480f ldr r0, [pc, #60] @ (800e550 ) + 800e512: f003 f871 bl 80115f8 + 800e516: f06f 0305 mvn.w r3, #5 + 800e51a: e15a b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_MSG_TYPE; + 800e51c: 2301 movs r3, #1 + 800e51e: 623b str r3, [r7, #32] + break; + 800e520: e044 b.n 800e5ac + case (DHCP_OPTION_SERVER_ID): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + 800e522: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e526: 2b04 cmp r3, #4 + 800e528: d009 beq.n 800e53e + 800e52a: 4b07 ldr r3, [pc, #28] @ (800e548 ) + 800e52c: f240 6259 movw r2, #1625 @ 0x659 + 800e530: 4906 ldr r1, [pc, #24] @ (800e54c ) + 800e532: 4807 ldr r0, [pc, #28] @ (800e550 ) + 800e534: f003 f860 bl 80115f8 + 800e538: f06f 0305 mvn.w r3, #5 + 800e53c: e149 b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_SERVER_ID; + 800e53e: 2302 movs r3, #2 + 800e540: 623b str r3, [r7, #32] + break; + 800e542: e033 b.n 800e5ac + 800e544: 20019124 .word 0x20019124 + 800e548: 08018304 .word 0x08018304 + 800e54c: 0801858c .word 0x0801858c + 800e550: 08018364 .word 0x08018364 + 800e554: 08018598 .word 0x08018598 + 800e558: 080185ac .word 0x080185ac + 800e55c: 080185b8 .word 0x080185b8 + case (DHCP_OPTION_T1): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + 800e560: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e564: 2b04 cmp r3, #4 + 800e566: d009 beq.n 800e57c + 800e568: 4b9c ldr r3, [pc, #624] @ (800e7dc ) + 800e56a: f240 625d movw r2, #1629 @ 0x65d + 800e56e: 499c ldr r1, [pc, #624] @ (800e7e0 ) + 800e570: 489c ldr r0, [pc, #624] @ (800e7e4 ) + 800e572: f003 f841 bl 80115f8 + 800e576: f06f 0305 mvn.w r3, #5 + 800e57a: e12a b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_T1; + 800e57c: 2304 movs r3, #4 + 800e57e: 623b str r3, [r7, #32] + break; + 800e580: e014 b.n 800e5ac + case (DHCP_OPTION_T2): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + 800e582: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e586: 2b04 cmp r3, #4 + 800e588: d009 beq.n 800e59e + 800e58a: 4b94 ldr r3, [pc, #592] @ (800e7dc ) + 800e58c: f240 6261 movw r2, #1633 @ 0x661 + 800e590: 4993 ldr r1, [pc, #588] @ (800e7e0 ) + 800e592: 4894 ldr r0, [pc, #592] @ (800e7e4 ) + 800e594: f003 f830 bl 80115f8 + 800e598: f06f 0305 mvn.w r3, #5 + 800e59c: e119 b.n 800e7d2 + decode_idx = DHCP_OPTION_IDX_T2; + 800e59e: 2305 movs r3, #5 + 800e5a0: 623b str r3, [r7, #32] + break; + 800e5a2: e003 b.n 800e5ac + default: + decode_len = 0; + 800e5a4: 2300 movs r3, #0 + 800e5a6: f887 3026 strb.w r3, [r7, #38] @ 0x26 + LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", (u16_t)op)); + LWIP_HOOK_DHCP_PARSE_OPTION(ip_current_netif(), dhcp, dhcp->state, msg_in, + dhcp_option_given(dhcp, DHCP_OPTION_IDX_MSG_TYPE) ? (u8_t)dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_MSG_TYPE) : 0, + op, len, q, val_offset); + break; + 800e5aa: bf00 nop + } + if (op == DHCP_OPTION_PAD) { + 800e5ac: 7dfb ldrb r3, [r7, #23] + 800e5ae: 2b00 cmp r3, #0 + 800e5b0: d103 bne.n 800e5ba + offset++; + 800e5b2: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e5b4: 3301 adds r3, #1 + 800e5b6: 877b strh r3, [r7, #58] @ 0x3a + 800e5b8: e0a1 b.n 800e6fe + } else { + if (offset + len + 2 > 0xFFFF) { + 800e5ba: 8f7a ldrh r2, [r7, #58] @ 0x3a + 800e5bc: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e5c0: 4413 add r3, r2 + 800e5c2: f64f 72fd movw r2, #65533 @ 0xfffd + 800e5c6: 4293 cmp r3, r2 + 800e5c8: dd02 ble.n 800e5d0 + /* overflow */ + return ERR_BUF; + 800e5ca: f06f 0301 mvn.w r3, #1 + 800e5ce: e100 b.n 800e7d2 + } + offset = (u16_t)(offset + len + 2); + 800e5d0: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e5d4: b29a uxth r2, r3 + 800e5d6: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e5d8: 4413 add r3, r2 + 800e5da: b29b uxth r3, r3 + 800e5dc: 3302 adds r3, #2 + 800e5de: 877b strh r3, [r7, #58] @ 0x3a + if (decode_len > 0) { + 800e5e0: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e5e4: 2b00 cmp r3, #0 + 800e5e6: f000 808a beq.w 800e6fe + u32_t value = 0; + 800e5ea: 2300 movs r3, #0 + 800e5ec: 60bb str r3, [r7, #8] + u16_t copy_len; +decode_next: + LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX); + 800e5ee: 6a3b ldr r3, [r7, #32] + 800e5f0: 2b00 cmp r3, #0 + 800e5f2: db02 blt.n 800e5fa + 800e5f4: 6a3b ldr r3, [r7, #32] + 800e5f6: 2b07 cmp r3, #7 + 800e5f8: dd06 ble.n 800e608 + 800e5fa: 4b78 ldr r3, [pc, #480] @ (800e7dc ) + 800e5fc: f44f 62cf mov.w r2, #1656 @ 0x678 + 800e600: 4979 ldr r1, [pc, #484] @ (800e7e8 ) + 800e602: 4878 ldr r0, [pc, #480] @ (800e7e4 ) + 800e604: f002 fff8 bl 80115f8 + if (!dhcp_option_given(dhcp, decode_idx)) { + 800e608: 4a78 ldr r2, [pc, #480] @ (800e7ec ) + 800e60a: 6a3b ldr r3, [r7, #32] + 800e60c: 4413 add r3, r2 + 800e60e: 781b ldrb r3, [r3, #0] + 800e610: 2b00 cmp r3, #0 + 800e612: d174 bne.n 800e6fe + copy_len = LWIP_MIN(decode_len, 4); + 800e614: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e618: 2b04 cmp r3, #4 + 800e61a: bf28 it cs + 800e61c: 2304 movcs r3, #4 + 800e61e: b2db uxtb r3, r3 + 800e620: 82bb strh r3, [r7, #20] + if (pbuf_copy_partial(q, &value, copy_len, val_offset) != copy_len) { + 800e622: 8bfb ldrh r3, [r7, #30] + 800e624: 8aba ldrh r2, [r7, #20] + 800e626: f107 0108 add.w r1, r7, #8 + 800e62a: 6b38 ldr r0, [r7, #48] @ 0x30 + 800e62c: f7f8 fbf6 bl 8006e1c + 800e630: 4603 mov r3, r0 + 800e632: 461a mov r2, r3 + 800e634: 8abb ldrh r3, [r7, #20] + 800e636: 4293 cmp r3, r2 + 800e638: d002 beq.n 800e640 + return ERR_BUF; + 800e63a: f06f 0301 mvn.w r3, #1 + 800e63e: e0c8 b.n 800e7d2 + } + if (decode_len > 4) { + 800e640: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e644: 2b04 cmp r3, #4 + 800e646: d933 bls.n 800e6b0 + /* decode more than one u32_t */ + u16_t next_val_offset; + LWIP_ERROR("decode_len %% 4 == 0", decode_len % 4 == 0, return ERR_VAL;); + 800e648: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e64c: f003 0303 and.w r3, r3, #3 + 800e650: b2db uxtb r3, r3 + 800e652: 2b00 cmp r3, #0 + 800e654: d009 beq.n 800e66a + 800e656: 4b61 ldr r3, [pc, #388] @ (800e7dc ) + 800e658: f240 6281 movw r2, #1665 @ 0x681 + 800e65c: 4964 ldr r1, [pc, #400] @ (800e7f0 ) + 800e65e: 4861 ldr r0, [pc, #388] @ (800e7e4 ) + 800e660: f002 ffca bl 80115f8 + 800e664: f06f 0305 mvn.w r3, #5 + 800e668: e0b3 b.n 800e7d2 + dhcp_got_option(dhcp, decode_idx); + 800e66a: 4a60 ldr r2, [pc, #384] @ (800e7ec ) + 800e66c: 6a3b ldr r3, [r7, #32] + 800e66e: 4413 add r3, r2 + 800e670: 2201 movs r2, #1 + 800e672: 701a strb r2, [r3, #0] + dhcp_set_option_value(dhcp, decode_idx, lwip_htonl(value)); + 800e674: 68bb ldr r3, [r7, #8] + 800e676: 4618 mov r0, r3 + 800e678: f7f6 fe9b bl 80053b2 + 800e67c: 4602 mov r2, r0 + 800e67e: 495d ldr r1, [pc, #372] @ (800e7f4 ) + 800e680: 6a3b ldr r3, [r7, #32] + 800e682: f841 2023 str.w r2, [r1, r3, lsl #2] + decode_len = (u8_t)(decode_len - 4); + 800e686: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e68a: 3b04 subs r3, #4 + 800e68c: f887 3026 strb.w r3, [r7, #38] @ 0x26 + next_val_offset = (u16_t)(val_offset + 4); + 800e690: 8bfb ldrh r3, [r7, #30] + 800e692: 3304 adds r3, #4 + 800e694: 827b strh r3, [r7, #18] + if (next_val_offset < val_offset) { + 800e696: 8a7a ldrh r2, [r7, #18] + 800e698: 8bfb ldrh r3, [r7, #30] + 800e69a: 429a cmp r2, r3 + 800e69c: d202 bcs.n 800e6a4 + /* overflow */ + return ERR_BUF; + 800e69e: f06f 0301 mvn.w r3, #1 + 800e6a2: e096 b.n 800e7d2 + } + val_offset = next_val_offset; + 800e6a4: 8a7b ldrh r3, [r7, #18] + 800e6a6: 83fb strh r3, [r7, #30] + decode_idx++; + 800e6a8: 6a3b ldr r3, [r7, #32] + 800e6aa: 3301 adds r3, #1 + 800e6ac: 623b str r3, [r7, #32] + goto decode_next; + 800e6ae: e79e b.n 800e5ee + } else if (decode_len == 4) { + 800e6b0: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e6b4: 2b04 cmp r3, #4 + 800e6b6: d106 bne.n 800e6c6 + value = lwip_ntohl(value); + 800e6b8: 68bb ldr r3, [r7, #8] + 800e6ba: 4618 mov r0, r3 + 800e6bc: f7f6 fe79 bl 80053b2 + 800e6c0: 4603 mov r3, r0 + 800e6c2: 60bb str r3, [r7, #8] + 800e6c4: e011 b.n 800e6ea + } else { + LWIP_ERROR("invalid decode_len", decode_len == 1, return ERR_VAL;); + 800e6c6: f897 3026 ldrb.w r3, [r7, #38] @ 0x26 + 800e6ca: 2b01 cmp r3, #1 + 800e6cc: d009 beq.n 800e6e2 + 800e6ce: 4b43 ldr r3, [pc, #268] @ (800e7dc ) + 800e6d0: f44f 62d2 mov.w r2, #1680 @ 0x690 + 800e6d4: 4948 ldr r1, [pc, #288] @ (800e7f8 ) + 800e6d6: 4843 ldr r0, [pc, #268] @ (800e7e4 ) + 800e6d8: f002 ff8e bl 80115f8 + 800e6dc: f06f 0305 mvn.w r3, #5 + 800e6e0: e077 b.n 800e7d2 + value = ((u8_t *)&value)[0]; + 800e6e2: f107 0308 add.w r3, r7, #8 + 800e6e6: 781b ldrb r3, [r3, #0] + 800e6e8: 60bb str r3, [r7, #8] + } + dhcp_got_option(dhcp, decode_idx); + 800e6ea: 4a40 ldr r2, [pc, #256] @ (800e7ec ) + 800e6ec: 6a3b ldr r3, [r7, #32] + 800e6ee: 4413 add r3, r2 + 800e6f0: 2201 movs r2, #1 + 800e6f2: 701a strb r2, [r3, #0] + dhcp_set_option_value(dhcp, decode_idx, value); + 800e6f4: 68ba ldr r2, [r7, #8] + 800e6f6: 493f ldr r1, [pc, #252] @ (800e7f4 ) + 800e6f8: 6a3b ldr r3, [r7, #32] + 800e6fa: f841 2023 str.w r2, [r1, r3, lsl #2] + } + } + } + if (offset >= q->len) { + 800e6fe: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e700: 895b ldrh r3, [r3, #10] + 800e702: 8f7a ldrh r2, [r7, #58] @ 0x3a + 800e704: 429a cmp r2, r3 + 800e706: d324 bcc.n 800e752 + offset = (u16_t)(offset - q->len); + 800e708: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e70a: 895b ldrh r3, [r3, #10] + 800e70c: 8f7a ldrh r2, [r7, #58] @ 0x3a + 800e70e: 1ad3 subs r3, r2, r3 + 800e710: 877b strh r3, [r7, #58] @ 0x3a + offset_max = (u16_t)(offset_max - q->len); + 800e712: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e714: 895b ldrh r3, [r3, #10] + 800e716: 8f3a ldrh r2, [r7, #56] @ 0x38 + 800e718: 1ad3 subs r3, r2, r3 + 800e71a: 873b strh r3, [r7, #56] @ 0x38 + if (offset < offset_max) { + 800e71c: 8f7a ldrh r2, [r7, #58] @ 0x3a + 800e71e: 8f3b ldrh r3, [r7, #56] @ 0x38 + 800e720: 429a cmp r2, r3 + 800e722: d213 bcs.n 800e74c + q = q->next; + 800e724: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e726: 681b ldr r3, [r3, #0] + 800e728: 633b str r3, [r7, #48] @ 0x30 + LWIP_ERROR("next pbuf was null", q != NULL, return ERR_VAL;); + 800e72a: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e72c: 2b00 cmp r3, #0 + 800e72e: d109 bne.n 800e744 + 800e730: 4b2a ldr r3, [pc, #168] @ (800e7dc ) + 800e732: f240 629d movw r2, #1693 @ 0x69d + 800e736: 4931 ldr r1, [pc, #196] @ (800e7fc ) + 800e738: 482a ldr r0, [pc, #168] @ (800e7e4 ) + 800e73a: f002 ff5d bl 80115f8 + 800e73e: f06f 0305 mvn.w r3, #5 + 800e742: e046 b.n 800e7d2 + options = (u8_t *)q->payload; + 800e744: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e746: 685b ldr r3, [r3, #4] + 800e748: 63fb str r3, [r7, #60] @ 0x3c + 800e74a: e002 b.n 800e752 + } else { + /* We've run out of bytes, probably no end marker. Don't proceed. */ + return ERR_BUF; + 800e74c: f06f 0301 mvn.w r3, #1 + 800e750: e03f b.n 800e7d2 + while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) { + 800e752: 6b3b ldr r3, [r7, #48] @ 0x30 + 800e754: 2b00 cmp r3, #0 + 800e756: d00a beq.n 800e76e + 800e758: 8f7a ldrh r2, [r7, #58] @ 0x3a + 800e75a: 8f3b ldrh r3, [r7, #56] @ 0x38 + 800e75c: 429a cmp r2, r3 + 800e75e: d206 bcs.n 800e76e + 800e760: 8f7b ldrh r3, [r7, #58] @ 0x3a + 800e762: 6bfa ldr r2, [r7, #60] @ 0x3c + 800e764: 4413 add r3, r2 + 800e766: 781b ldrb r3, [r3, #0] + 800e768: 2bff cmp r3, #255 @ 0xff + 800e76a: f47f adb8 bne.w 800e2de + } + } + } + /* is this an overloaded message? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) { + 800e76e: 4b1f ldr r3, [pc, #124] @ (800e7ec ) + 800e770: 781b ldrb r3, [r3, #0] + 800e772: 2b00 cmp r3, #0 + 800e774: d018 beq.n 800e7a8 + u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD); + 800e776: 4b1f ldr r3, [pc, #124] @ (800e7f4 ) + 800e778: 681b ldr r3, [r3, #0] + 800e77a: 60fb str r3, [r7, #12] + dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD); + 800e77c: 4b1b ldr r3, [pc, #108] @ (800e7ec ) + 800e77e: 2200 movs r2, #0 + 800e780: 701a strb r2, [r3, #0] + if (overload == DHCP_OVERLOAD_FILE) { + 800e782: 68fb ldr r3, [r7, #12] + 800e784: 2b01 cmp r3, #1 + 800e786: d102 bne.n 800e78e + parse_file_as_options = 1; + 800e788: 2301 movs r3, #1 + 800e78a: 62fb str r3, [r7, #44] @ 0x2c + 800e78c: e00c b.n 800e7a8 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded file field\n")); + } else if (overload == DHCP_OVERLOAD_SNAME) { + 800e78e: 68fb ldr r3, [r7, #12] + 800e790: 2b02 cmp r3, #2 + 800e792: d102 bne.n 800e79a + parse_sname_as_options = 1; + 800e794: 2301 movs r3, #1 + 800e796: 62bb str r3, [r7, #40] @ 0x28 + 800e798: e006 b.n 800e7a8 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname field\n")); + } else if (overload == DHCP_OVERLOAD_SNAME_FILE) { + 800e79a: 68fb ldr r3, [r7, #12] + 800e79c: 2b03 cmp r3, #3 + 800e79e: d103 bne.n 800e7a8 + parse_sname_as_options = 1; + 800e7a0: 2301 movs r3, #1 + 800e7a2: 62bb str r3, [r7, #40] @ 0x28 + parse_file_as_options = 1; + 800e7a4: 2301 movs r3, #1 + 800e7a6: 62fb str r3, [r7, #44] @ 0x2c + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname and file field\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("invalid overload option: %d\n", (int)overload)); + } + } + if (parse_file_as_options) { + 800e7a8: 6afb ldr r3, [r7, #44] @ 0x2c + 800e7aa: 2b00 cmp r3, #0 + 800e7ac: d006 beq.n 800e7bc + /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */ + parse_file_as_options = 0; + 800e7ae: 2300 movs r3, #0 + 800e7b0: 62fb str r3, [r7, #44] @ 0x2c + options_idx = DHCP_FILE_OFS; + 800e7b2: 236c movs r3, #108 @ 0x6c + 800e7b4: 86fb strh r3, [r7, #54] @ 0x36 + options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN; + 800e7b6: 23ec movs r3, #236 @ 0xec + 800e7b8: 86bb strh r3, [r7, #52] @ 0x34 +#if LWIP_DHCP_BOOTP_FILE + file_overloaded = 1; +#endif + goto again; + 800e7ba: e56a b.n 800e292 + } else if (parse_sname_as_options) { + 800e7bc: 6abb ldr r3, [r7, #40] @ 0x28 + 800e7be: 2b00 cmp r3, #0 + 800e7c0: d006 beq.n 800e7d0 + parse_sname_as_options = 0; + 800e7c2: 2300 movs r3, #0 + 800e7c4: 62bb str r3, [r7, #40] @ 0x28 + options_idx = DHCP_SNAME_OFS; + 800e7c6: 232c movs r3, #44 @ 0x2c + 800e7c8: 86fb strh r3, [r7, #54] @ 0x36 + options_idx_max = DHCP_SNAME_OFS + DHCP_SNAME_LEN; + 800e7ca: 236c movs r3, #108 @ 0x6c + 800e7cc: 86bb strh r3, [r7, #52] @ 0x34 + goto again; + 800e7ce: e560 b.n 800e292 + } + /* make sure the string is really NULL-terminated */ + dhcp->boot_file_name[DHCP_FILE_LEN-1] = 0; + } +#endif /* LWIP_DHCP_BOOTP_FILE */ + return ERR_OK; + 800e7d0: 2300 movs r3, #0 +} + 800e7d2: 4618 mov r0, r3 + 800e7d4: 3740 adds r7, #64 @ 0x40 + 800e7d6: 46bd mov sp, r7 + 800e7d8: bd80 pop {r7, pc} + 800e7da: bf00 nop + 800e7dc: 08018304 .word 0x08018304 + 800e7e0: 0801858c .word 0x0801858c + 800e7e4: 08018364 .word 0x08018364 + 800e7e8: 080185d0 .word 0x080185d0 + 800e7ec: 20019124 .word 0x20019124 + 800e7f0: 080185e4 .word 0x080185e4 + 800e7f4: 20019104 .word 0x20019104 + 800e7f8: 080185fc .word 0x080185fc + 800e7fc: 08018610 .word 0x08018610 + +0800e800 : +/** + * If an incoming DHCP message is in response to us, then trigger the state machine + */ +static void +dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + 800e800: b580 push {r7, lr} + 800e802: b08a sub sp, #40 @ 0x28 + 800e804: af00 add r7, sp, #0 + 800e806: 60f8 str r0, [r7, #12] + 800e808: 60b9 str r1, [r7, #8] + 800e80a: 607a str r2, [r7, #4] + 800e80c: 603b str r3, [r7, #0] + struct netif *netif = ip_current_input_netif(); + 800e80e: 4b60 ldr r3, [pc, #384] @ (800e990 ) + 800e810: 685b ldr r3, [r3, #4] + 800e812: 623b str r3, [r7, #32] + struct dhcp *dhcp = netif_dhcp_data(netif); + 800e814: 6a3b ldr r3, [r7, #32] + 800e816: 6a5b ldr r3, [r3, #36] @ 0x24 + 800e818: 61fb str r3, [r7, #28] + struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload; + 800e81a: 687b ldr r3, [r7, #4] + 800e81c: 685b ldr r3, [r3, #4] + 800e81e: 61bb str r3, [r7, #24] + struct dhcp_msg *msg_in; + + LWIP_UNUSED_ARG(arg); + + /* Caught DHCP message from netif that does not have DHCP enabled? -> not interested */ + if ((dhcp == NULL) || (dhcp->pcb_allocated == 0)) { + 800e820: 69fb ldr r3, [r7, #28] + 800e822: 2b00 cmp r3, #0 + 800e824: f000 809d beq.w 800e962 + 800e828: 69fb ldr r3, [r7, #28] + 800e82a: 791b ldrb r3, [r3, #4] + 800e82c: 2b00 cmp r3, #0 + 800e82e: f000 8098 beq.w 800e962 + /* prevent warnings about unused arguments */ + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(addr); + LWIP_UNUSED_ARG(port); + + if (p->len < DHCP_MIN_REPLY_LEN) { + 800e832: 687b ldr r3, [r7, #4] + 800e834: 895b ldrh r3, [r3, #10] + 800e836: 2b2b cmp r3, #43 @ 0x2b + 800e838: f240 8095 bls.w 800e966 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP reply message or pbuf too short\n")); + goto free_pbuf_and_return; + } + + if (reply_msg->op != DHCP_BOOTREPLY) { + 800e83c: 69bb ldr r3, [r7, #24] + 800e83e: 781b ldrb r3, [r3, #0] + 800e840: 2b02 cmp r3, #2 + 800e842: f040 8092 bne.w 800e96a + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op)); + goto free_pbuf_and_return; + } + /* iterate through hardware address and match against DHCP message */ + for (i = 0; i < netif->hwaddr_len && i < LWIP_MIN(DHCP_CHADDR_LEN, NETIF_MAX_HWADDR_LEN); i++) { + 800e846: 2300 movs r3, #0 + 800e848: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 800e84c: e012 b.n 800e874 + if (netif->hwaddr[i] != reply_msg->chaddr[i]) { + 800e84e: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e852: 6a3a ldr r2, [r7, #32] + 800e854: 4413 add r3, r2 + 800e856: f893 202a ldrb.w r2, [r3, #42] @ 0x2a + 800e85a: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e85e: 69b9 ldr r1, [r7, #24] + 800e860: 440b add r3, r1 + 800e862: 7f1b ldrb r3, [r3, #28] + 800e864: 429a cmp r2, r3 + 800e866: f040 8082 bne.w 800e96e + for (i = 0; i < netif->hwaddr_len && i < LWIP_MIN(DHCP_CHADDR_LEN, NETIF_MAX_HWADDR_LEN); i++) { + 800e86a: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e86e: 3301 adds r3, #1 + 800e870: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 800e874: 6a3b ldr r3, [r7, #32] + 800e876: f893 3030 ldrb.w r3, [r3, #48] @ 0x30 + 800e87a: f897 2027 ldrb.w r2, [r7, #39] @ 0x27 + 800e87e: 429a cmp r2, r3 + 800e880: d203 bcs.n 800e88a + 800e882: f897 3027 ldrb.w r3, [r7, #39] @ 0x27 + 800e886: 2b05 cmp r3, #5 + 800e888: d9e1 bls.n 800e84e + (u16_t)i, (u16_t)netif->hwaddr[i], (u16_t)i, (u16_t)reply_msg->chaddr[i])); + goto free_pbuf_and_return; + } + } + /* match transaction ID against what we expected */ + if (lwip_ntohl(reply_msg->xid) != dhcp->xid) { + 800e88a: 69bb ldr r3, [r7, #24] + 800e88c: 685b ldr r3, [r3, #4] + 800e88e: 4618 mov r0, r3 + 800e890: f7f6 fd8f bl 80053b2 + 800e894: 4602 mov r2, r0 + 800e896: 69fb ldr r3, [r7, #28] + 800e898: 681b ldr r3, [r3, #0] + 800e89a: 429a cmp r2, r3 + 800e89c: d169 bne.n 800e972 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("transaction id mismatch reply_msg->xid(%"X32_F")!=dhcp->xid(%"X32_F")\n", lwip_ntohl(reply_msg->xid), dhcp->xid)); + goto free_pbuf_and_return; + } + /* option fields could be unfold? */ + if (dhcp_parse_reply(p, dhcp) != ERR_OK) { + 800e89e: 69f9 ldr r1, [r7, #28] + 800e8a0: 6878 ldr r0, [r7, #4] + 800e8a2: f7ff fcd9 bl 800e258 + 800e8a6: 4603 mov r3, r0 + 800e8a8: 2b00 cmp r3, #0 + 800e8aa: d164 bne.n 800e976 + goto free_pbuf_and_return; + } + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("searching DHCP_OPTION_MESSAGE_TYPE\n")); + /* obtain pointer to DHCP message type */ + if (!dhcp_option_given(dhcp, DHCP_OPTION_IDX_MSG_TYPE)) { + 800e8ac: 4b39 ldr r3, [pc, #228] @ (800e994 ) + 800e8ae: 785b ldrb r3, [r3, #1] + 800e8b0: 2b00 cmp r3, #0 + 800e8b2: d062 beq.n 800e97a + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP_OPTION_MESSAGE_TYPE option not found\n")); + goto free_pbuf_and_return; + } + + msg_in = (struct dhcp_msg *)p->payload; + 800e8b4: 687b ldr r3, [r7, #4] + 800e8b6: 685b ldr r3, [r3, #4] + 800e8b8: 617b str r3, [r7, #20] + /* read DHCP message type */ + msg_type = (u8_t)dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_MSG_TYPE); + 800e8ba: 4b37 ldr r3, [pc, #220] @ (800e998 ) + 800e8bc: 685b ldr r3, [r3, #4] + 800e8be: 74fb strb r3, [r7, #19] + /* message type is DHCP ACK? */ + if (msg_type == DHCP_ACK) { + 800e8c0: 7cfb ldrb r3, [r7, #19] + 800e8c2: 2b05 cmp r3, #5 + 800e8c4: d12a bne.n 800e91c + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_ACK received\n")); + /* in requesting state? */ + if (dhcp->state == DHCP_STATE_REQUESTING) { + 800e8c6: 69fb ldr r3, [r7, #28] + 800e8c8: 795b ldrb r3, [r3, #5] + 800e8ca: 2b01 cmp r3, #1 + 800e8cc: d112 bne.n 800e8f4 + dhcp_handle_ack(netif, msg_in); + 800e8ce: 6979 ldr r1, [r7, #20] + 800e8d0: 6a38 ldr r0, [r7, #32] + 800e8d2: f7fe fe1d bl 800d510 +#if DHCP_DOES_ARP_CHECK + if ((netif->flags & NETIF_FLAG_ETHARP) != 0) { + 800e8d6: 6a3b ldr r3, [r7, #32] + 800e8d8: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800e8dc: f003 0308 and.w r3, r3, #8 + 800e8e0: 2b00 cmp r3, #0 + 800e8e2: d003 beq.n 800e8ec + /* check if the acknowledged lease address is already in use */ + dhcp_check(netif); + 800e8e4: 6a38 ldr r0, [r7, #32] + 800e8e6: f7fe fb8d bl 800d004 + 800e8ea: e049 b.n 800e980 + } else { + /* bind interface to the acknowledged lease address */ + dhcp_bind(netif); + 800e8ec: 6a38 ldr r0, [r7, #32] + 800e8ee: f7ff f86d bl 800d9cc + 800e8f2: e045 b.n 800e980 + /* bind interface to the acknowledged lease address */ + dhcp_bind(netif); +#endif + } + /* already bound to the given lease address? */ + else if ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REBINDING) || + 800e8f4: 69fb ldr r3, [r7, #28] + 800e8f6: 795b ldrb r3, [r3, #5] + 800e8f8: 2b03 cmp r3, #3 + 800e8fa: d007 beq.n 800e90c + 800e8fc: 69fb ldr r3, [r7, #28] + 800e8fe: 795b ldrb r3, [r3, #5] + 800e900: 2b04 cmp r3, #4 + 800e902: d003 beq.n 800e90c + (dhcp->state == DHCP_STATE_RENEWING)) { + 800e904: 69fb ldr r3, [r7, #28] + 800e906: 795b ldrb r3, [r3, #5] + else if ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REBINDING) || + 800e908: 2b05 cmp r3, #5 + 800e90a: d139 bne.n 800e980 + dhcp_handle_ack(netif, msg_in); + 800e90c: 6979 ldr r1, [r7, #20] + 800e90e: 6a38 ldr r0, [r7, #32] + 800e910: f7fe fdfe bl 800d510 + dhcp_bind(netif); + 800e914: 6a38 ldr r0, [r7, #32] + 800e916: f7ff f859 bl 800d9cc + 800e91a: e031 b.n 800e980 + } + } + /* received a DHCP_NAK in appropriate state? */ + else if ((msg_type == DHCP_NAK) && + 800e91c: 7cfb ldrb r3, [r7, #19] + 800e91e: 2b06 cmp r3, #6 + 800e920: d113 bne.n 800e94a + ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REQUESTING) || + 800e922: 69fb ldr r3, [r7, #28] + 800e924: 795b ldrb r3, [r3, #5] + else if ((msg_type == DHCP_NAK) && + 800e926: 2b03 cmp r3, #3 + 800e928: d00b beq.n 800e942 + ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REQUESTING) || + 800e92a: 69fb ldr r3, [r7, #28] + 800e92c: 795b ldrb r3, [r3, #5] + 800e92e: 2b01 cmp r3, #1 + 800e930: d007 beq.n 800e942 + (dhcp->state == DHCP_STATE_REBINDING) || (dhcp->state == DHCP_STATE_RENEWING ))) { + 800e932: 69fb ldr r3, [r7, #28] + 800e934: 795b ldrb r3, [r3, #5] + ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REQUESTING) || + 800e936: 2b04 cmp r3, #4 + 800e938: d003 beq.n 800e942 + (dhcp->state == DHCP_STATE_REBINDING) || (dhcp->state == DHCP_STATE_RENEWING ))) { + 800e93a: 69fb ldr r3, [r7, #28] + 800e93c: 795b ldrb r3, [r3, #5] + 800e93e: 2b05 cmp r3, #5 + 800e940: d103 bne.n 800e94a + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_NAK received\n")); + dhcp_handle_nak(netif); + 800e942: 6a38 ldr r0, [r7, #32] + 800e944: f7fe fb44 bl 800cfd0 + 800e948: e01a b.n 800e980 + } + /* received a DHCP_OFFER in DHCP_STATE_SELECTING state? */ + else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_STATE_SELECTING)) { + 800e94a: 7cfb ldrb r3, [r7, #19] + 800e94c: 2b02 cmp r3, #2 + 800e94e: d116 bne.n 800e97e + 800e950: 69fb ldr r3, [r7, #28] + 800e952: 795b ldrb r3, [r3, #5] + 800e954: 2b06 cmp r3, #6 + 800e956: d112 bne.n 800e97e + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_OFFER received in DHCP_STATE_SELECTING state\n")); + /* remember offered lease */ + dhcp_handle_offer(netif, msg_in); + 800e958: 6979 ldr r1, [r7, #20] + 800e95a: 6a38 ldr r0, [r7, #32] + 800e95c: f7fe fb86 bl 800d06c + 800e960: e00e b.n 800e980 + goto free_pbuf_and_return; + 800e962: bf00 nop + 800e964: e00c b.n 800e980 + goto free_pbuf_and_return; + 800e966: bf00 nop + 800e968: e00a b.n 800e980 + goto free_pbuf_and_return; + 800e96a: bf00 nop + 800e96c: e008 b.n 800e980 + goto free_pbuf_and_return; + 800e96e: bf00 nop + 800e970: e006 b.n 800e980 + goto free_pbuf_and_return; + 800e972: bf00 nop + 800e974: e004 b.n 800e980 + goto free_pbuf_and_return; + 800e976: bf00 nop + 800e978: e002 b.n 800e980 + goto free_pbuf_and_return; + 800e97a: bf00 nop + 800e97c: e000 b.n 800e980 + } + +free_pbuf_and_return: + 800e97e: bf00 nop + pbuf_free(p); + 800e980: 6878 ldr r0, [r7, #4] + 800e982: f7f8 f851 bl 8006a28 +} + 800e986: bf00 nop + 800e988: 3728 adds r7, #40 @ 0x28 + 800e98a: 46bd mov sp, r7 + 800e98c: bd80 pop {r7, pc} + 800e98e: bf00 nop + 800e990: 2000614c .word 0x2000614c + 800e994: 20019124 .word 0x20019124 + 800e998: 20019104 .word 0x20019104 + +0800e99c : + * @param dhcp dhcp control struct + * @param message_type message type of the request + */ +static struct pbuf * +dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type, u16_t *options_out_len) +{ + 800e99c: b580 push {r7, lr} + 800e99e: b088 sub sp, #32 + 800e9a0: af00 add r7, sp, #0 + 800e9a2: 60f8 str r0, [r7, #12] + 800e9a4: 60b9 str r1, [r7, #8] + 800e9a6: 603b str r3, [r7, #0] + 800e9a8: 4613 mov r3, r2 + 800e9aa: 71fb strb r3, [r7, #7] + if (!xid_initialised) { + xid = DHCP_GLOBAL_XID; + xid_initialised = !xid_initialised; + } +#endif + LWIP_ERROR("dhcp_create_msg: netif != NULL", (netif != NULL), return NULL;); + 800e9ac: 68fb ldr r3, [r7, #12] + 800e9ae: 2b00 cmp r3, #0 + 800e9b0: d108 bne.n 800e9c4 + 800e9b2: 4b5f ldr r3, [pc, #380] @ (800eb30 ) + 800e9b4: f240 7269 movw r2, #1897 @ 0x769 + 800e9b8: 495e ldr r1, [pc, #376] @ (800eb34 ) + 800e9ba: 485f ldr r0, [pc, #380] @ (800eb38 ) + 800e9bc: f002 fe1c bl 80115f8 + 800e9c0: 2300 movs r3, #0 + 800e9c2: e0b1 b.n 800eb28 + LWIP_ERROR("dhcp_create_msg: dhcp != NULL", (dhcp != NULL), return NULL;); + 800e9c4: 68bb ldr r3, [r7, #8] + 800e9c6: 2b00 cmp r3, #0 + 800e9c8: d108 bne.n 800e9dc + 800e9ca: 4b59 ldr r3, [pc, #356] @ (800eb30 ) + 800e9cc: f240 726a movw r2, #1898 @ 0x76a + 800e9d0: 495a ldr r1, [pc, #360] @ (800eb3c ) + 800e9d2: 4859 ldr r0, [pc, #356] @ (800eb38 ) + 800e9d4: f002 fe10 bl 80115f8 + 800e9d8: 2300 movs r3, #0 + 800e9da: e0a5 b.n 800eb28 + p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM); + 800e9dc: f44f 7220 mov.w r2, #640 @ 0x280 + 800e9e0: f44f 719a mov.w r1, #308 @ 0x134 + 800e9e4: 2036 movs r0, #54 @ 0x36 + 800e9e6: f7f7 fd3d bl 8006464 + 800e9ea: 61b8 str r0, [r7, #24] + if (p_out == NULL) { + 800e9ec: 69bb ldr r3, [r7, #24] + 800e9ee: 2b00 cmp r3, #0 + 800e9f0: d101 bne.n 800e9f6 + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("dhcp_create_msg(): could not allocate pbuf\n")); + return NULL; + 800e9f2: 2300 movs r3, #0 + 800e9f4: e098 b.n 800eb28 + } + LWIP_ASSERT("dhcp_create_msg: check that first pbuf can hold struct dhcp_msg", + 800e9f6: 69bb ldr r3, [r7, #24] + 800e9f8: 895b ldrh r3, [r3, #10] + 800e9fa: f5b3 7f9a cmp.w r3, #308 @ 0x134 + 800e9fe: d206 bcs.n 800ea0e + 800ea00: 4b4b ldr r3, [pc, #300] @ (800eb30 ) + 800ea02: f240 7271 movw r2, #1905 @ 0x771 + 800ea06: 494e ldr r1, [pc, #312] @ (800eb40 ) + 800ea08: 484b ldr r0, [pc, #300] @ (800eb38 ) + 800ea0a: f002 fdf5 bl 80115f8 + (p_out->len >= sizeof(struct dhcp_msg))); + + /* DHCP_REQUEST should reuse 'xid' from DHCPOFFER */ + if ((message_type != DHCP_REQUEST) || (dhcp->state == DHCP_STATE_REBOOTING)) { + 800ea0e: 79fb ldrb r3, [r7, #7] + 800ea10: 2b03 cmp r3, #3 + 800ea12: d103 bne.n 800ea1c + 800ea14: 68bb ldr r3, [r7, #8] + 800ea16: 795b ldrb r3, [r3, #5] + 800ea18: 2b03 cmp r3, #3 + 800ea1a: d10d bne.n 800ea38 + /* reuse transaction identifier in retransmissions */ + if (dhcp->tries == 0) { + 800ea1c: 68bb ldr r3, [r7, #8] + 800ea1e: 799b ldrb r3, [r3, #6] + 800ea20: 2b00 cmp r3, #0 + 800ea22: d105 bne.n 800ea30 +#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND) + xid = LWIP_RAND(); + 800ea24: f002 fd0a bl 801143c + 800ea28: 4603 mov r3, r0 + 800ea2a: 461a mov r2, r3 + 800ea2c: 4b45 ldr r3, [pc, #276] @ (800eb44 ) + 800ea2e: 601a str r2, [r3, #0] +#else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */ + xid++; +#endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */ + } + dhcp->xid = xid; + 800ea30: 4b44 ldr r3, [pc, #272] @ (800eb44 ) + 800ea32: 681a ldr r2, [r3, #0] + 800ea34: 68bb ldr r3, [r7, #8] + 800ea36: 601a str r2, [r3, #0] + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, + ("transaction id xid(%"X32_F")\n", xid)); + + msg_out = (struct dhcp_msg *)p_out->payload; + 800ea38: 69bb ldr r3, [r7, #24] + 800ea3a: 685b ldr r3, [r3, #4] + 800ea3c: 617b str r3, [r7, #20] + memset(msg_out, 0, sizeof(struct dhcp_msg)); + 800ea3e: f44f 729a mov.w r2, #308 @ 0x134 + 800ea42: 2100 movs r1, #0 + 800ea44: 6978 ldr r0, [r7, #20] + 800ea46: f002 fe56 bl 80116f6 + + msg_out->op = DHCP_BOOTREQUEST; + 800ea4a: 697b ldr r3, [r7, #20] + 800ea4c: 2201 movs r2, #1 + 800ea4e: 701a strb r2, [r3, #0] + /* @todo: make link layer independent */ + msg_out->htype = LWIP_IANA_HWTYPE_ETHERNET; + 800ea50: 697b ldr r3, [r7, #20] + 800ea52: 2201 movs r2, #1 + 800ea54: 705a strb r2, [r3, #1] + msg_out->hlen = netif->hwaddr_len; + 800ea56: 68fb ldr r3, [r7, #12] + 800ea58: f893 2030 ldrb.w r2, [r3, #48] @ 0x30 + 800ea5c: 697b ldr r3, [r7, #20] + 800ea5e: 709a strb r2, [r3, #2] + msg_out->xid = lwip_htonl(dhcp->xid); + 800ea60: 68bb ldr r3, [r7, #8] + 800ea62: 681b ldr r3, [r3, #0] + 800ea64: 4618 mov r0, r3 + 800ea66: f7f6 fca4 bl 80053b2 + 800ea6a: 4602 mov r2, r0 + 800ea6c: 697b ldr r3, [r7, #20] + 800ea6e: 605a str r2, [r3, #4] + /* we don't need the broadcast flag since we can receive unicast traffic + before being fully configured! */ + /* set ciaddr to netif->ip_addr based on message_type and state */ + if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) || (message_type == DHCP_RELEASE) || + 800ea70: 79fb ldrb r3, [r7, #7] + 800ea72: 2b08 cmp r3, #8 + 800ea74: d010 beq.n 800ea98 + 800ea76: 79fb ldrb r3, [r7, #7] + 800ea78: 2b04 cmp r3, #4 + 800ea7a: d00d beq.n 800ea98 + 800ea7c: 79fb ldrb r3, [r7, #7] + 800ea7e: 2b07 cmp r3, #7 + 800ea80: d00a beq.n 800ea98 + 800ea82: 79fb ldrb r3, [r7, #7] + 800ea84: 2b03 cmp r3, #3 + 800ea86: d10c bne.n 800eaa2 + ((message_type == DHCP_REQUEST) && /* DHCP_STATE_BOUND not used for sending! */ + ((dhcp->state == DHCP_STATE_RENEWING) || dhcp->state == DHCP_STATE_REBINDING))) { + 800ea88: 68bb ldr r3, [r7, #8] + 800ea8a: 795b ldrb r3, [r3, #5] + ((message_type == DHCP_REQUEST) && /* DHCP_STATE_BOUND not used for sending! */ + 800ea8c: 2b05 cmp r3, #5 + 800ea8e: d003 beq.n 800ea98 + ((dhcp->state == DHCP_STATE_RENEWING) || dhcp->state == DHCP_STATE_REBINDING))) { + 800ea90: 68bb ldr r3, [r7, #8] + 800ea92: 795b ldrb r3, [r3, #5] + 800ea94: 2b04 cmp r3, #4 + 800ea96: d104 bne.n 800eaa2 + ip4_addr_copy(msg_out->ciaddr, *netif_ip4_addr(netif)); + 800ea98: 68fb ldr r3, [r7, #12] + 800ea9a: 3304 adds r3, #4 + 800ea9c: 681a ldr r2, [r3, #0] + 800ea9e: 697b ldr r3, [r7, #20] + 800eaa0: 60da str r2, [r3, #12] + } + for (i = 0; i < LWIP_MIN(DHCP_CHADDR_LEN, NETIF_MAX_HWADDR_LEN); i++) { + 800eaa2: 2300 movs r3, #0 + 800eaa4: 83fb strh r3, [r7, #30] + 800eaa6: e00c b.n 800eac2 + /* copy netif hardware address (padded with zeroes through memset already) */ + msg_out->chaddr[i] = netif->hwaddr[i]; + 800eaa8: 8bfa ldrh r2, [r7, #30] + 800eaaa: 8bfb ldrh r3, [r7, #30] + 800eaac: 68f9 ldr r1, [r7, #12] + 800eaae: 440a add r2, r1 + 800eab0: f892 102a ldrb.w r1, [r2, #42] @ 0x2a + 800eab4: 697a ldr r2, [r7, #20] + 800eab6: 4413 add r3, r2 + 800eab8: 460a mov r2, r1 + 800eaba: 771a strb r2, [r3, #28] + for (i = 0; i < LWIP_MIN(DHCP_CHADDR_LEN, NETIF_MAX_HWADDR_LEN); i++) { + 800eabc: 8bfb ldrh r3, [r7, #30] + 800eabe: 3301 adds r3, #1 + 800eac0: 83fb strh r3, [r7, #30] + 800eac2: 8bfb ldrh r3, [r7, #30] + 800eac4: 2b05 cmp r3, #5 + 800eac6: d9ef bls.n 800eaa8 + } + msg_out->cookie = PP_HTONL(DHCP_MAGIC_COOKIE); + 800eac8: 697b ldr r3, [r7, #20] + 800eaca: 2200 movs r2, #0 + 800eacc: f042 0263 orr.w r2, r2, #99 @ 0x63 + 800ead0: f883 20ec strb.w r2, [r3, #236] @ 0xec + 800ead4: 2200 movs r2, #0 + 800ead6: f062 027d orn r2, r2, #125 @ 0x7d + 800eada: f883 20ed strb.w r2, [r3, #237] @ 0xed + 800eade: 2200 movs r2, #0 + 800eae0: f042 0253 orr.w r2, r2, #83 @ 0x53 + 800eae4: f883 20ee strb.w r2, [r3, #238] @ 0xee + 800eae8: 2200 movs r2, #0 + 800eaea: f042 0263 orr.w r2, r2, #99 @ 0x63 + 800eaee: f883 20ef strb.w r2, [r3, #239] @ 0xef + /* Add option MESSAGE_TYPE */ + options_out_len_loc = dhcp_option(0, msg_out->options, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN); + 800eaf2: 697b ldr r3, [r7, #20] + 800eaf4: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800eaf8: 2301 movs r3, #1 + 800eafa: 2235 movs r2, #53 @ 0x35 + 800eafc: 2000 movs r0, #0 + 800eafe: f7ff fadb bl 800e0b8 + 800eb02: 4603 mov r3, r0 + 800eb04: 827b strh r3, [r7, #18] + options_out_len_loc = dhcp_option_byte(options_out_len_loc, msg_out->options, message_type); + 800eb06: 697b ldr r3, [r7, #20] + 800eb08: f103 01f0 add.w r1, r3, #240 @ 0xf0 + 800eb0c: 79fa ldrb r2, [r7, #7] + 800eb0e: 8a7b ldrh r3, [r7, #18] + 800eb10: 4618 mov r0, r3 + 800eb12: f7ff fb05 bl 800e120 + 800eb16: 4603 mov r3, r0 + 800eb18: 827b strh r3, [r7, #18] + if (options_out_len) { + 800eb1a: 683b ldr r3, [r7, #0] + 800eb1c: 2b00 cmp r3, #0 + 800eb1e: d002 beq.n 800eb26 + *options_out_len = options_out_len_loc; + 800eb20: 683b ldr r3, [r7, #0] + 800eb22: 8a7a ldrh r2, [r7, #18] + 800eb24: 801a strh r2, [r3, #0] + } + return p_out; + 800eb26: 69bb ldr r3, [r7, #24] +} + 800eb28: 4618 mov r0, r3 + 800eb2a: 3720 adds r7, #32 + 800eb2c: 46bd mov sp, r7 + 800eb2e: bd80 pop {r7, pc} + 800eb30: 08018304 .word 0x08018304 + 800eb34: 08018624 .word 0x08018624 + 800eb38: 08018364 .word 0x08018364 + 800eb3c: 08018644 .word 0x08018644 + 800eb40: 08018664 .word 0x08018664 + 800eb44: 20019134 .word 0x20019134 + +0800eb48 : + * Adds the END option to the DHCP message, and if + * necessary, up to three padding bytes. + */ +static void +dhcp_option_trailer(u16_t options_out_len, u8_t *options, struct pbuf *p_out) +{ + 800eb48: b580 push {r7, lr} + 800eb4a: b084 sub sp, #16 + 800eb4c: af00 add r7, sp, #0 + 800eb4e: 4603 mov r3, r0 + 800eb50: 60b9 str r1, [r7, #8] + 800eb52: 607a str r2, [r7, #4] + 800eb54: 81fb strh r3, [r7, #14] + options[options_out_len++] = DHCP_OPTION_END; + 800eb56: 89fb ldrh r3, [r7, #14] + 800eb58: 1c5a adds r2, r3, #1 + 800eb5a: 81fa strh r2, [r7, #14] + 800eb5c: 461a mov r2, r3 + 800eb5e: 68bb ldr r3, [r7, #8] + 800eb60: 4413 add r3, r2 + 800eb62: 22ff movs r2, #255 @ 0xff + 800eb64: 701a strb r2, [r3, #0] + /* packet is too small, or not 4 byte aligned? */ + while (((options_out_len < DHCP_MIN_OPTIONS_LEN) || (options_out_len & 3)) && + 800eb66: e007 b.n 800eb78 + (options_out_len < DHCP_OPTIONS_LEN)) { + /* add a fill/padding byte */ + options[options_out_len++] = 0; + 800eb68: 89fb ldrh r3, [r7, #14] + 800eb6a: 1c5a adds r2, r3, #1 + 800eb6c: 81fa strh r2, [r7, #14] + 800eb6e: 461a mov r2, r3 + 800eb70: 68bb ldr r3, [r7, #8] + 800eb72: 4413 add r3, r2 + 800eb74: 2200 movs r2, #0 + 800eb76: 701a strb r2, [r3, #0] + while (((options_out_len < DHCP_MIN_OPTIONS_LEN) || (options_out_len & 3)) && + 800eb78: 89fb ldrh r3, [r7, #14] + 800eb7a: 2b43 cmp r3, #67 @ 0x43 + 800eb7c: d904 bls.n 800eb88 + 800eb7e: 89fb ldrh r3, [r7, #14] + 800eb80: f003 0303 and.w r3, r3, #3 + 800eb84: 2b00 cmp r3, #0 + 800eb86: d002 beq.n 800eb8e + 800eb88: 89fb ldrh r3, [r7, #14] + 800eb8a: 2b43 cmp r3, #67 @ 0x43 + 800eb8c: d9ec bls.n 800eb68 + } + /* shrink the pbuf to the actual content length */ + pbuf_realloc(p_out, (u16_t)(sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + options_out_len)); + 800eb8e: 89fb ldrh r3, [r7, #14] + 800eb90: 33f0 adds r3, #240 @ 0xf0 + 800eb92: b29b uxth r3, r3 + 800eb94: 4619 mov r1, r3 + 800eb96: 6878 ldr r0, [r7, #4] + 800eb98: f7f7 fdc2 bl 8006720 +} + 800eb9c: bf00 nop + 800eb9e: 3710 adds r7, #16 + 800eba0: 46bd mov sp, r7 + 800eba2: bd80 pop {r7, pc} + +0800eba4 : + * @return 1 if DHCP supplied netif->ip_addr (states BOUND or RENEWING), + * 0 otherwise + */ +u8_t +dhcp_supplied_address(const struct netif *netif) +{ + 800eba4: b480 push {r7} + 800eba6: b085 sub sp, #20 + 800eba8: af00 add r7, sp, #0 + 800ebaa: 6078 str r0, [r7, #4] + if ((netif != NULL) && (netif_dhcp_data(netif) != NULL)) { + 800ebac: 687b ldr r3, [r7, #4] + 800ebae: 2b00 cmp r3, #0 + 800ebb0: d017 beq.n 800ebe2 + 800ebb2: 687b ldr r3, [r7, #4] + 800ebb4: 6a5b ldr r3, [r3, #36] @ 0x24 + 800ebb6: 2b00 cmp r3, #0 + 800ebb8: d013 beq.n 800ebe2 + struct dhcp *dhcp = netif_dhcp_data(netif); + 800ebba: 687b ldr r3, [r7, #4] + 800ebbc: 6a5b ldr r3, [r3, #36] @ 0x24 + 800ebbe: 60fb str r3, [r7, #12] + return (dhcp->state == DHCP_STATE_BOUND) || (dhcp->state == DHCP_STATE_RENEWING) || + 800ebc0: 68fb ldr r3, [r7, #12] + 800ebc2: 795b ldrb r3, [r3, #5] + 800ebc4: 2b0a cmp r3, #10 + 800ebc6: d007 beq.n 800ebd8 + 800ebc8: 68fb ldr r3, [r7, #12] + 800ebca: 795b ldrb r3, [r3, #5] + 800ebcc: 2b05 cmp r3, #5 + 800ebce: d003 beq.n 800ebd8 + (dhcp->state == DHCP_STATE_REBINDING); + 800ebd0: 68fb ldr r3, [r7, #12] + 800ebd2: 795b ldrb r3, [r3, #5] + return (dhcp->state == DHCP_STATE_BOUND) || (dhcp->state == DHCP_STATE_RENEWING) || + 800ebd4: 2b04 cmp r3, #4 + 800ebd6: d101 bne.n 800ebdc + 800ebd8: 2301 movs r3, #1 + 800ebda: e000 b.n 800ebde + 800ebdc: 2300 movs r3, #0 + 800ebde: b2db uxtb r3, r3 + 800ebe0: e000 b.n 800ebe4 + } + return 0; + 800ebe2: 2300 movs r3, #0 +} + 800ebe4: 4618 mov r0, r3 + 800ebe6: 3714 adds r7, #20 + 800ebe8: 46bd mov sp, r7 + 800ebea: f85d 7b04 ldr.w r7, [sp], #4 + 800ebee: 4770 bx lr + +0800ebf0 : +#endif /* ARP_QUEUEING */ + +/** Clean up ARP table entries */ +static void +etharp_free_entry(int i) +{ + 800ebf0: b580 push {r7, lr} + 800ebf2: b082 sub sp, #8 + 800ebf4: af00 add r7, sp, #0 + 800ebf6: 6078 str r0, [r7, #4] + /* remove from SNMP ARP index tree */ + mib2_remove_arp_entry(arp_table[i].netif, &arp_table[i].ipaddr); + /* and empty packet queue */ + if (arp_table[i].q != NULL) { + 800ebf8: 4915 ldr r1, [pc, #84] @ (800ec50 ) + 800ebfa: 687a ldr r2, [r7, #4] + 800ebfc: 4613 mov r3, r2 + 800ebfe: 005b lsls r3, r3, #1 + 800ec00: 4413 add r3, r2 + 800ec02: 00db lsls r3, r3, #3 + 800ec04: 440b add r3, r1 + 800ec06: 681b ldr r3, [r3, #0] + 800ec08: 2b00 cmp r3, #0 + 800ec0a: d013 beq.n 800ec34 + /* remove all queued packets */ + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_free_entry: freeing entry %"U16_F", packet queue %p.\n", (u16_t)i, (void *)(arp_table[i].q))); + free_etharp_q(arp_table[i].q); + 800ec0c: 4910 ldr r1, [pc, #64] @ (800ec50 ) + 800ec0e: 687a ldr r2, [r7, #4] + 800ec10: 4613 mov r3, r2 + 800ec12: 005b lsls r3, r3, #1 + 800ec14: 4413 add r3, r2 + 800ec16: 00db lsls r3, r3, #3 + 800ec18: 440b add r3, r1 + 800ec1a: 681b ldr r3, [r3, #0] + 800ec1c: 4618 mov r0, r3 + 800ec1e: f7f7 ff03 bl 8006a28 + arp_table[i].q = NULL; + 800ec22: 490b ldr r1, [pc, #44] @ (800ec50 ) + 800ec24: 687a ldr r2, [r7, #4] + 800ec26: 4613 mov r3, r2 + 800ec28: 005b lsls r3, r3, #1 + 800ec2a: 4413 add r3, r2 + 800ec2c: 00db lsls r3, r3, #3 + 800ec2e: 440b add r3, r1 + 800ec30: 2200 movs r2, #0 + 800ec32: 601a str r2, [r3, #0] + } + /* recycle entry for re-use */ + arp_table[i].state = ETHARP_STATE_EMPTY; + 800ec34: 4906 ldr r1, [pc, #24] @ (800ec50 ) + 800ec36: 687a ldr r2, [r7, #4] + 800ec38: 4613 mov r3, r2 + 800ec3a: 005b lsls r3, r3, #1 + 800ec3c: 4413 add r3, r2 + 800ec3e: 00db lsls r3, r3, #3 + 800ec40: 440b add r3, r1 + 800ec42: 3314 adds r3, #20 + 800ec44: 2200 movs r2, #0 + 800ec46: 701a strb r2, [r3, #0] + arp_table[i].ctime = 0; + arp_table[i].netif = NULL; + ip4_addr_set_zero(&arp_table[i].ipaddr); + arp_table[i].ethaddr = ethzero; +#endif /* LWIP_DEBUG */ +} + 800ec48: bf00 nop + 800ec4a: 3708 adds r7, #8 + 800ec4c: 46bd mov sp, r7 + 800ec4e: bd80 pop {r7, pc} + 800ec50: 20019138 .word 0x20019138 + +0800ec54 : + * This function should be called every ARP_TMR_INTERVAL milliseconds (1 second), + * in order to expire entries in the ARP table. + */ +void +etharp_tmr(void) +{ + 800ec54: b580 push {r7, lr} + 800ec56: b082 sub sp, #8 + 800ec58: af00 add r7, sp, #0 + int i; + + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n")); + /* remove expired entries from the ARP table */ + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + 800ec5a: 2300 movs r3, #0 + 800ec5c: 607b str r3, [r7, #4] + 800ec5e: e096 b.n 800ed8e + u8_t state = arp_table[i].state; + 800ec60: 494f ldr r1, [pc, #316] @ (800eda0 ) + 800ec62: 687a ldr r2, [r7, #4] + 800ec64: 4613 mov r3, r2 + 800ec66: 005b lsls r3, r3, #1 + 800ec68: 4413 add r3, r2 + 800ec6a: 00db lsls r3, r3, #3 + 800ec6c: 440b add r3, r1 + 800ec6e: 3314 adds r3, #20 + 800ec70: 781b ldrb r3, [r3, #0] + 800ec72: 70fb strb r3, [r7, #3] + if (state != ETHARP_STATE_EMPTY + 800ec74: 78fb ldrb r3, [r7, #3] + 800ec76: 2b00 cmp r3, #0 + 800ec78: f000 8086 beq.w 800ed88 +#if ETHARP_SUPPORT_STATIC_ENTRIES + && (state != ETHARP_STATE_STATIC) +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + ) { + arp_table[i].ctime++; + 800ec7c: 4948 ldr r1, [pc, #288] @ (800eda0 ) + 800ec7e: 687a ldr r2, [r7, #4] + 800ec80: 4613 mov r3, r2 + 800ec82: 005b lsls r3, r3, #1 + 800ec84: 4413 add r3, r2 + 800ec86: 00db lsls r3, r3, #3 + 800ec88: 440b add r3, r1 + 800ec8a: 3312 adds r3, #18 + 800ec8c: 881b ldrh r3, [r3, #0] + 800ec8e: 3301 adds r3, #1 + 800ec90: b298 uxth r0, r3 + 800ec92: 4943 ldr r1, [pc, #268] @ (800eda0 ) + 800ec94: 687a ldr r2, [r7, #4] + 800ec96: 4613 mov r3, r2 + 800ec98: 005b lsls r3, r3, #1 + 800ec9a: 4413 add r3, r2 + 800ec9c: 00db lsls r3, r3, #3 + 800ec9e: 440b add r3, r1 + 800eca0: 3312 adds r3, #18 + 800eca2: 4602 mov r2, r0 + 800eca4: 801a strh r2, [r3, #0] + if ((arp_table[i].ctime >= ARP_MAXAGE) || + 800eca6: 493e ldr r1, [pc, #248] @ (800eda0 ) + 800eca8: 687a ldr r2, [r7, #4] + 800ecaa: 4613 mov r3, r2 + 800ecac: 005b lsls r3, r3, #1 + 800ecae: 4413 add r3, r2 + 800ecb0: 00db lsls r3, r3, #3 + 800ecb2: 440b add r3, r1 + 800ecb4: 3312 adds r3, #18 + 800ecb6: 881b ldrh r3, [r3, #0] + 800ecb8: f5b3 7f96 cmp.w r3, #300 @ 0x12c + 800ecbc: d215 bcs.n 800ecea + ((arp_table[i].state == ETHARP_STATE_PENDING) && + 800ecbe: 4938 ldr r1, [pc, #224] @ (800eda0 ) + 800ecc0: 687a ldr r2, [r7, #4] + 800ecc2: 4613 mov r3, r2 + 800ecc4: 005b lsls r3, r3, #1 + 800ecc6: 4413 add r3, r2 + 800ecc8: 00db lsls r3, r3, #3 + 800ecca: 440b add r3, r1 + 800eccc: 3314 adds r3, #20 + 800ecce: 781b ldrb r3, [r3, #0] + if ((arp_table[i].ctime >= ARP_MAXAGE) || + 800ecd0: 2b01 cmp r3, #1 + 800ecd2: d10e bne.n 800ecf2 + (arp_table[i].ctime >= ARP_MAXPENDING))) { + 800ecd4: 4932 ldr r1, [pc, #200] @ (800eda0 ) + 800ecd6: 687a ldr r2, [r7, #4] + 800ecd8: 4613 mov r3, r2 + 800ecda: 005b lsls r3, r3, #1 + 800ecdc: 4413 add r3, r2 + 800ecde: 00db lsls r3, r3, #3 + 800ece0: 440b add r3, r1 + 800ece2: 3312 adds r3, #18 + 800ece4: 881b ldrh r3, [r3, #0] + ((arp_table[i].state == ETHARP_STATE_PENDING) && + 800ece6: 2b04 cmp r3, #4 + 800ece8: d903 bls.n 800ecf2 + /* pending or stable entry has become old! */ + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired %s entry %d.\n", + arp_table[i].state >= ETHARP_STATE_STABLE ? "stable" : "pending", i)); + /* clean up entries that have just been expired */ + etharp_free_entry(i); + 800ecea: 6878 ldr r0, [r7, #4] + 800ecec: f7ff ff80 bl 800ebf0 + 800ecf0: e04a b.n 800ed88 + } else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING_1) { + 800ecf2: 492b ldr r1, [pc, #172] @ (800eda0 ) + 800ecf4: 687a ldr r2, [r7, #4] + 800ecf6: 4613 mov r3, r2 + 800ecf8: 005b lsls r3, r3, #1 + 800ecfa: 4413 add r3, r2 + 800ecfc: 00db lsls r3, r3, #3 + 800ecfe: 440b add r3, r1 + 800ed00: 3314 adds r3, #20 + 800ed02: 781b ldrb r3, [r3, #0] + 800ed04: 2b03 cmp r3, #3 + 800ed06: d10a bne.n 800ed1e + /* Don't send more than one request every 2 seconds. */ + arp_table[i].state = ETHARP_STATE_STABLE_REREQUESTING_2; + 800ed08: 4925 ldr r1, [pc, #148] @ (800eda0 ) + 800ed0a: 687a ldr r2, [r7, #4] + 800ed0c: 4613 mov r3, r2 + 800ed0e: 005b lsls r3, r3, #1 + 800ed10: 4413 add r3, r2 + 800ed12: 00db lsls r3, r3, #3 + 800ed14: 440b add r3, r1 + 800ed16: 3314 adds r3, #20 + 800ed18: 2204 movs r2, #4 + 800ed1a: 701a strb r2, [r3, #0] + 800ed1c: e034 b.n 800ed88 + } else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING_2) { + 800ed1e: 4920 ldr r1, [pc, #128] @ (800eda0 ) + 800ed20: 687a ldr r2, [r7, #4] + 800ed22: 4613 mov r3, r2 + 800ed24: 005b lsls r3, r3, #1 + 800ed26: 4413 add r3, r2 + 800ed28: 00db lsls r3, r3, #3 + 800ed2a: 440b add r3, r1 + 800ed2c: 3314 adds r3, #20 + 800ed2e: 781b ldrb r3, [r3, #0] + 800ed30: 2b04 cmp r3, #4 + 800ed32: d10a bne.n 800ed4a + /* Reset state to stable, so that the next transmitted packet will + re-send an ARP request. */ + arp_table[i].state = ETHARP_STATE_STABLE; + 800ed34: 491a ldr r1, [pc, #104] @ (800eda0 ) + 800ed36: 687a ldr r2, [r7, #4] + 800ed38: 4613 mov r3, r2 + 800ed3a: 005b lsls r3, r3, #1 + 800ed3c: 4413 add r3, r2 + 800ed3e: 00db lsls r3, r3, #3 + 800ed40: 440b add r3, r1 + 800ed42: 3314 adds r3, #20 + 800ed44: 2202 movs r2, #2 + 800ed46: 701a strb r2, [r3, #0] + 800ed48: e01e b.n 800ed88 + } else if (arp_table[i].state == ETHARP_STATE_PENDING) { + 800ed4a: 4915 ldr r1, [pc, #84] @ (800eda0 ) + 800ed4c: 687a ldr r2, [r7, #4] + 800ed4e: 4613 mov r3, r2 + 800ed50: 005b lsls r3, r3, #1 + 800ed52: 4413 add r3, r2 + 800ed54: 00db lsls r3, r3, #3 + 800ed56: 440b add r3, r1 + 800ed58: 3314 adds r3, #20 + 800ed5a: 781b ldrb r3, [r3, #0] + 800ed5c: 2b01 cmp r3, #1 + 800ed5e: d113 bne.n 800ed88 + /* still pending, resend an ARP query */ + etharp_request(arp_table[i].netif, &arp_table[i].ipaddr); + 800ed60: 490f ldr r1, [pc, #60] @ (800eda0 ) + 800ed62: 687a ldr r2, [r7, #4] + 800ed64: 4613 mov r3, r2 + 800ed66: 005b lsls r3, r3, #1 + 800ed68: 4413 add r3, r2 + 800ed6a: 00db lsls r3, r3, #3 + 800ed6c: 440b add r3, r1 + 800ed6e: 3308 adds r3, #8 + 800ed70: 6818 ldr r0, [r3, #0] + 800ed72: 687a ldr r2, [r7, #4] + 800ed74: 4613 mov r3, r2 + 800ed76: 005b lsls r3, r3, #1 + 800ed78: 4413 add r3, r2 + 800ed7a: 00db lsls r3, r3, #3 + 800ed7c: 4a08 ldr r2, [pc, #32] @ (800eda0 ) + 800ed7e: 4413 add r3, r2 + 800ed80: 3304 adds r3, #4 + 800ed82: 4619 mov r1, r3 + 800ed84: f000 fe72 bl 800fa6c + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + 800ed88: 687b ldr r3, [r7, #4] + 800ed8a: 3301 adds r3, #1 + 800ed8c: 607b str r3, [r7, #4] + 800ed8e: 687b ldr r3, [r7, #4] + 800ed90: 2b09 cmp r3, #9 + 800ed92: f77f af65 ble.w 800ec60 + } + } + } +} + 800ed96: bf00 nop + 800ed98: bf00 nop + 800ed9a: 3708 adds r7, #8 + 800ed9c: 46bd mov sp, r7 + 800ed9e: bd80 pop {r7, pc} + 800eda0: 20019138 .word 0x20019138 + +0800eda4 : + * @return The ARP entry index that matched or is created, ERR_MEM if no + * entry is found or could be recycled. + */ +static s16_t +etharp_find_entry(const ip4_addr_t *ipaddr, u8_t flags, struct netif *netif) +{ + 800eda4: b580 push {r7, lr} + 800eda6: b08a sub sp, #40 @ 0x28 + 800eda8: af00 add r7, sp, #0 + 800edaa: 60f8 str r0, [r7, #12] + 800edac: 460b mov r3, r1 + 800edae: 607a str r2, [r7, #4] + 800edb0: 72fb strb r3, [r7, #11] + s16_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE; + 800edb2: 230a movs r3, #10 + 800edb4: 84fb strh r3, [r7, #38] @ 0x26 + 800edb6: 230a movs r3, #10 + 800edb8: 84bb strh r3, [r7, #36] @ 0x24 + s16_t empty = ARP_TABLE_SIZE; + 800edba: 230a movs r3, #10 + 800edbc: 847b strh r3, [r7, #34] @ 0x22 + s16_t i = 0; + 800edbe: 2300 movs r3, #0 + 800edc0: 843b strh r3, [r7, #32] + /* oldest entry with packets on queue */ + s16_t old_queue = ARP_TABLE_SIZE; + 800edc2: 230a movs r3, #10 + 800edc4: 83fb strh r3, [r7, #30] + /* its age */ + u16_t age_queue = 0, age_pending = 0, age_stable = 0; + 800edc6: 2300 movs r3, #0 + 800edc8: 83bb strh r3, [r7, #28] + 800edca: 2300 movs r3, #0 + 800edcc: 837b strh r3, [r7, #26] + 800edce: 2300 movs r3, #0 + 800edd0: 833b strh r3, [r7, #24] + * 4) remember the oldest pending entry with queued packets (if any) + * 5) search for a matching IP entry, either pending or stable + * until 5 matches, or all entries are searched for. + */ + + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + 800edd2: 2300 movs r3, #0 + 800edd4: 843b strh r3, [r7, #32] + 800edd6: e0ae b.n 800ef36 + u8_t state = arp_table[i].state; + 800edd8: f9b7 2020 ldrsh.w r2, [r7, #32] + 800eddc: 49a6 ldr r1, [pc, #664] @ (800f078 ) + 800edde: 4613 mov r3, r2 + 800ede0: 005b lsls r3, r3, #1 + 800ede2: 4413 add r3, r2 + 800ede4: 00db lsls r3, r3, #3 + 800ede6: 440b add r3, r1 + 800ede8: 3314 adds r3, #20 + 800edea: 781b ldrb r3, [r3, #0] + 800edec: 75fb strb r3, [r7, #23] + /* no empty entry found yet and now we do find one? */ + if ((empty == ARP_TABLE_SIZE) && (state == ETHARP_STATE_EMPTY)) { + 800edee: f9b7 3022 ldrsh.w r3, [r7, #34] @ 0x22 + 800edf2: 2b0a cmp r3, #10 + 800edf4: d105 bne.n 800ee02 + 800edf6: 7dfb ldrb r3, [r7, #23] + 800edf8: 2b00 cmp r3, #0 + 800edfa: d102 bne.n 800ee02 + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_find_entry: found empty entry %d\n", (int)i)); + /* remember first empty entry */ + empty = i; + 800edfc: 8c3b ldrh r3, [r7, #32] + 800edfe: 847b strh r3, [r7, #34] @ 0x22 + 800ee00: e095 b.n 800ef2e + } else if (state != ETHARP_STATE_EMPTY) { + 800ee02: 7dfb ldrb r3, [r7, #23] + 800ee04: 2b00 cmp r3, #0 + 800ee06: f000 8092 beq.w 800ef2e + LWIP_ASSERT("state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE", + 800ee0a: 7dfb ldrb r3, [r7, #23] + 800ee0c: 2b01 cmp r3, #1 + 800ee0e: d009 beq.n 800ee24 + 800ee10: 7dfb ldrb r3, [r7, #23] + 800ee12: 2b01 cmp r3, #1 + 800ee14: d806 bhi.n 800ee24 + 800ee16: 4b99 ldr r3, [pc, #612] @ (800f07c ) + 800ee18: f240 1223 movw r2, #291 @ 0x123 + 800ee1c: 4998 ldr r1, [pc, #608] @ (800f080 ) + 800ee1e: 4899 ldr r0, [pc, #612] @ (800f084 ) + 800ee20: f002 fbea bl 80115f8 + state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE); + /* if given, does IP address match IP address in ARP entry? */ + if (ipaddr && ip4_addr_cmp(ipaddr, &arp_table[i].ipaddr) + 800ee24: 68fb ldr r3, [r7, #12] + 800ee26: 2b00 cmp r3, #0 + 800ee28: d020 beq.n 800ee6c + 800ee2a: 68fb ldr r3, [r7, #12] + 800ee2c: 6819 ldr r1, [r3, #0] + 800ee2e: f9b7 2020 ldrsh.w r2, [r7, #32] + 800ee32: 4891 ldr r0, [pc, #580] @ (800f078 ) + 800ee34: 4613 mov r3, r2 + 800ee36: 005b lsls r3, r3, #1 + 800ee38: 4413 add r3, r2 + 800ee3a: 00db lsls r3, r3, #3 + 800ee3c: 4403 add r3, r0 + 800ee3e: 3304 adds r3, #4 + 800ee40: 681b ldr r3, [r3, #0] + 800ee42: 4299 cmp r1, r3 + 800ee44: d112 bne.n 800ee6c +#if ETHARP_TABLE_MATCH_NETIF + && ((netif == NULL) || (netif == arp_table[i].netif)) + 800ee46: 687b ldr r3, [r7, #4] + 800ee48: 2b00 cmp r3, #0 + 800ee4a: d00c beq.n 800ee66 + 800ee4c: f9b7 2020 ldrsh.w r2, [r7, #32] + 800ee50: 4989 ldr r1, [pc, #548] @ (800f078 ) + 800ee52: 4613 mov r3, r2 + 800ee54: 005b lsls r3, r3, #1 + 800ee56: 4413 add r3, r2 + 800ee58: 00db lsls r3, r3, #3 + 800ee5a: 440b add r3, r1 + 800ee5c: 3308 adds r3, #8 + 800ee5e: 681b ldr r3, [r3, #0] + 800ee60: 687a ldr r2, [r7, #4] + 800ee62: 429a cmp r2, r3 + 800ee64: d102 bne.n 800ee6c +#endif /* ETHARP_TABLE_MATCH_NETIF */ + ) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: found matching entry %d\n", (int)i)); + /* found exact IP address match, simply bail out */ + return i; + 800ee66: f9b7 3020 ldrsh.w r3, [r7, #32] + 800ee6a: e100 b.n 800f06e + } + /* pending entry? */ + if (state == ETHARP_STATE_PENDING) { + 800ee6c: 7dfb ldrb r3, [r7, #23] + 800ee6e: 2b01 cmp r3, #1 + 800ee70: d140 bne.n 800eef4 + /* pending with queued packets? */ + if (arp_table[i].q != NULL) { + 800ee72: f9b7 2020 ldrsh.w r2, [r7, #32] + 800ee76: 4980 ldr r1, [pc, #512] @ (800f078 ) + 800ee78: 4613 mov r3, r2 + 800ee7a: 005b lsls r3, r3, #1 + 800ee7c: 4413 add r3, r2 + 800ee7e: 00db lsls r3, r3, #3 + 800ee80: 440b add r3, r1 + 800ee82: 681b ldr r3, [r3, #0] + 800ee84: 2b00 cmp r3, #0 + 800ee86: d01a beq.n 800eebe + if (arp_table[i].ctime >= age_queue) { + 800ee88: f9b7 2020 ldrsh.w r2, [r7, #32] + 800ee8c: 497a ldr r1, [pc, #488] @ (800f078 ) + 800ee8e: 4613 mov r3, r2 + 800ee90: 005b lsls r3, r3, #1 + 800ee92: 4413 add r3, r2 + 800ee94: 00db lsls r3, r3, #3 + 800ee96: 440b add r3, r1 + 800ee98: 3312 adds r3, #18 + 800ee9a: 881b ldrh r3, [r3, #0] + 800ee9c: 8bba ldrh r2, [r7, #28] + 800ee9e: 429a cmp r2, r3 + 800eea0: d845 bhi.n 800ef2e + old_queue = i; + 800eea2: 8c3b ldrh r3, [r7, #32] + 800eea4: 83fb strh r3, [r7, #30] + age_queue = arp_table[i].ctime; + 800eea6: f9b7 2020 ldrsh.w r2, [r7, #32] + 800eeaa: 4973 ldr r1, [pc, #460] @ (800f078 ) + 800eeac: 4613 mov r3, r2 + 800eeae: 005b lsls r3, r3, #1 + 800eeb0: 4413 add r3, r2 + 800eeb2: 00db lsls r3, r3, #3 + 800eeb4: 440b add r3, r1 + 800eeb6: 3312 adds r3, #18 + 800eeb8: 881b ldrh r3, [r3, #0] + 800eeba: 83bb strh r3, [r7, #28] + 800eebc: e037 b.n 800ef2e + } + } else + /* pending without queued packets? */ + { + if (arp_table[i].ctime >= age_pending) { + 800eebe: f9b7 2020 ldrsh.w r2, [r7, #32] + 800eec2: 496d ldr r1, [pc, #436] @ (800f078 ) + 800eec4: 4613 mov r3, r2 + 800eec6: 005b lsls r3, r3, #1 + 800eec8: 4413 add r3, r2 + 800eeca: 00db lsls r3, r3, #3 + 800eecc: 440b add r3, r1 + 800eece: 3312 adds r3, #18 + 800eed0: 881b ldrh r3, [r3, #0] + 800eed2: 8b7a ldrh r2, [r7, #26] + 800eed4: 429a cmp r2, r3 + 800eed6: d82a bhi.n 800ef2e + old_pending = i; + 800eed8: 8c3b ldrh r3, [r7, #32] + 800eeda: 84fb strh r3, [r7, #38] @ 0x26 + age_pending = arp_table[i].ctime; + 800eedc: f9b7 2020 ldrsh.w r2, [r7, #32] + 800eee0: 4965 ldr r1, [pc, #404] @ (800f078 ) + 800eee2: 4613 mov r3, r2 + 800eee4: 005b lsls r3, r3, #1 + 800eee6: 4413 add r3, r2 + 800eee8: 00db lsls r3, r3, #3 + 800eeea: 440b add r3, r1 + 800eeec: 3312 adds r3, #18 + 800eeee: 881b ldrh r3, [r3, #0] + 800eef0: 837b strh r3, [r7, #26] + 800eef2: e01c b.n 800ef2e + } + } + /* stable entry? */ + } else if (state >= ETHARP_STATE_STABLE) { + 800eef4: 7dfb ldrb r3, [r7, #23] + 800eef6: 2b01 cmp r3, #1 + 800eef8: d919 bls.n 800ef2e + /* don't record old_stable for static entries since they never expire */ + if (state < ETHARP_STATE_STATIC) +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + { + /* remember entry with oldest stable entry in oldest, its age in maxtime */ + if (arp_table[i].ctime >= age_stable) { + 800eefa: f9b7 2020 ldrsh.w r2, [r7, #32] + 800eefe: 495e ldr r1, [pc, #376] @ (800f078 ) + 800ef00: 4613 mov r3, r2 + 800ef02: 005b lsls r3, r3, #1 + 800ef04: 4413 add r3, r2 + 800ef06: 00db lsls r3, r3, #3 + 800ef08: 440b add r3, r1 + 800ef0a: 3312 adds r3, #18 + 800ef0c: 881b ldrh r3, [r3, #0] + 800ef0e: 8b3a ldrh r2, [r7, #24] + 800ef10: 429a cmp r2, r3 + 800ef12: d80c bhi.n 800ef2e + old_stable = i; + 800ef14: 8c3b ldrh r3, [r7, #32] + 800ef16: 84bb strh r3, [r7, #36] @ 0x24 + age_stable = arp_table[i].ctime; + 800ef18: f9b7 2020 ldrsh.w r2, [r7, #32] + 800ef1c: 4956 ldr r1, [pc, #344] @ (800f078 ) + 800ef1e: 4613 mov r3, r2 + 800ef20: 005b lsls r3, r3, #1 + 800ef22: 4413 add r3, r2 + 800ef24: 00db lsls r3, r3, #3 + 800ef26: 440b add r3, r1 + 800ef28: 3312 adds r3, #18 + 800ef2a: 881b ldrh r3, [r3, #0] + 800ef2c: 833b strh r3, [r7, #24] + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + 800ef2e: 8c3b ldrh r3, [r7, #32] + 800ef30: 3301 adds r3, #1 + 800ef32: b29b uxth r3, r3 + 800ef34: 843b strh r3, [r7, #32] + 800ef36: f9b7 3020 ldrsh.w r3, [r7, #32] + 800ef3a: 2b09 cmp r3, #9 + 800ef3c: f77f af4c ble.w 800edd8 + } + } + /* { we have no match } => try to create a new entry */ + + /* don't create new entry, only search? */ + if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) || + 800ef40: 7afb ldrb r3, [r7, #11] + 800ef42: f003 0302 and.w r3, r3, #2 + 800ef46: 2b00 cmp r3, #0 + 800ef48: d108 bne.n 800ef5c + 800ef4a: f9b7 3022 ldrsh.w r3, [r7, #34] @ 0x22 + 800ef4e: 2b0a cmp r3, #10 + 800ef50: d107 bne.n 800ef62 + /* or no empty entry found and not allowed to recycle? */ + ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_FLAG_TRY_HARD) == 0))) { + 800ef52: 7afb ldrb r3, [r7, #11] + 800ef54: f003 0301 and.w r3, r3, #1 + 800ef58: 2b00 cmp r3, #0 + 800ef5a: d102 bne.n 800ef62 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty entry found and not allowed to recycle\n")); + return (s16_t)ERR_MEM; + 800ef5c: f04f 33ff mov.w r3, #4294967295 + 800ef60: e085 b.n 800f06e + * + * { ETHARP_FLAG_TRY_HARD is set at this point } + */ + + /* 1) empty entry available? */ + if (empty < ARP_TABLE_SIZE) { + 800ef62: f9b7 3022 ldrsh.w r3, [r7, #34] @ 0x22 + 800ef66: 2b09 cmp r3, #9 + 800ef68: dc02 bgt.n 800ef70 + i = empty; + 800ef6a: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800ef6c: 843b strh r3, [r7, #32] + 800ef6e: e039 b.n 800efe4 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting empty entry %d\n", (int)i)); + } else { + /* 2) found recyclable stable entry? */ + if (old_stable < ARP_TABLE_SIZE) { + 800ef70: f9b7 3024 ldrsh.w r3, [r7, #36] @ 0x24 + 800ef74: 2b09 cmp r3, #9 + 800ef76: dc14 bgt.n 800efa2 + /* recycle oldest stable*/ + i = old_stable; + 800ef78: 8cbb ldrh r3, [r7, #36] @ 0x24 + 800ef7a: 843b strh r3, [r7, #32] + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest stable entry %d\n", (int)i)); + /* no queued packets should exist on stable entries */ + LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL); + 800ef7c: f9b7 2020 ldrsh.w r2, [r7, #32] + 800ef80: 493d ldr r1, [pc, #244] @ (800f078 ) + 800ef82: 4613 mov r3, r2 + 800ef84: 005b lsls r3, r3, #1 + 800ef86: 4413 add r3, r2 + 800ef88: 00db lsls r3, r3, #3 + 800ef8a: 440b add r3, r1 + 800ef8c: 681b ldr r3, [r3, #0] + 800ef8e: 2b00 cmp r3, #0 + 800ef90: d018 beq.n 800efc4 + 800ef92: 4b3a ldr r3, [pc, #232] @ (800f07c ) + 800ef94: f240 126d movw r2, #365 @ 0x16d + 800ef98: 493b ldr r1, [pc, #236] @ (800f088 ) + 800ef9a: 483a ldr r0, [pc, #232] @ (800f084 ) + 800ef9c: f002 fb2c bl 80115f8 + 800efa0: e010 b.n 800efc4 + /* 3) found recyclable pending entry without queued packets? */ + } else if (old_pending < ARP_TABLE_SIZE) { + 800efa2: f9b7 3026 ldrsh.w r3, [r7, #38] @ 0x26 + 800efa6: 2b09 cmp r3, #9 + 800efa8: dc02 bgt.n 800efb0 + /* recycle oldest pending */ + i = old_pending; + 800efaa: 8cfb ldrh r3, [r7, #38] @ 0x26 + 800efac: 843b strh r3, [r7, #32] + 800efae: e009 b.n 800efc4 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest pending entry %d (without queue)\n", (int)i)); + /* 4) found recyclable pending entry with queued packets? */ + } else if (old_queue < ARP_TABLE_SIZE) { + 800efb0: f9b7 301e ldrsh.w r3, [r7, #30] + 800efb4: 2b09 cmp r3, #9 + 800efb6: dc02 bgt.n 800efbe + /* recycle oldest pending (queued packets are free in etharp_free_entry) */ + i = old_queue; + 800efb8: 8bfb ldrh r3, [r7, #30] + 800efba: 843b strh r3, [r7, #32] + 800efbc: e002 b.n 800efc4 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest pending entry %d, freeing packet queue %p\n", (int)i, (void *)(arp_table[i].q))); + /* no empty or recyclable entries found */ + } else { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty or recyclable entries found\n")); + return (s16_t)ERR_MEM; + 800efbe: f04f 33ff mov.w r3, #4294967295 + 800efc2: e054 b.n 800f06e + } + + /* { empty or recyclable entry found } */ + LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE); + 800efc4: f9b7 3020 ldrsh.w r3, [r7, #32] + 800efc8: 2b09 cmp r3, #9 + 800efca: dd06 ble.n 800efda + 800efcc: 4b2b ldr r3, [pc, #172] @ (800f07c ) + 800efce: f240 127f movw r2, #383 @ 0x17f + 800efd2: 492e ldr r1, [pc, #184] @ (800f08c ) + 800efd4: 482b ldr r0, [pc, #172] @ (800f084 ) + 800efd6: f002 fb0f bl 80115f8 + etharp_free_entry(i); + 800efda: f9b7 3020 ldrsh.w r3, [r7, #32] + 800efde: 4618 mov r0, r3 + 800efe0: f7ff fe06 bl 800ebf0 + } + + LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE); + 800efe4: f9b7 3020 ldrsh.w r3, [r7, #32] + 800efe8: 2b09 cmp r3, #9 + 800efea: dd06 ble.n 800effa + 800efec: 4b23 ldr r3, [pc, #140] @ (800f07c ) + 800efee: f240 1283 movw r2, #387 @ 0x183 + 800eff2: 4926 ldr r1, [pc, #152] @ (800f08c ) + 800eff4: 4823 ldr r0, [pc, #140] @ (800f084 ) + 800eff6: f002 faff bl 80115f8 + LWIP_ASSERT("arp_table[i].state == ETHARP_STATE_EMPTY", + 800effa: f9b7 2020 ldrsh.w r2, [r7, #32] + 800effe: 491e ldr r1, [pc, #120] @ (800f078 ) + 800f000: 4613 mov r3, r2 + 800f002: 005b lsls r3, r3, #1 + 800f004: 4413 add r3, r2 + 800f006: 00db lsls r3, r3, #3 + 800f008: 440b add r3, r1 + 800f00a: 3314 adds r3, #20 + 800f00c: 781b ldrb r3, [r3, #0] + 800f00e: 2b00 cmp r3, #0 + 800f010: d006 beq.n 800f020 + 800f012: 4b1a ldr r3, [pc, #104] @ (800f07c ) + 800f014: f44f 72c2 mov.w r2, #388 @ 0x184 + 800f018: 491d ldr r1, [pc, #116] @ (800f090 ) + 800f01a: 481a ldr r0, [pc, #104] @ (800f084 ) + 800f01c: f002 faec bl 80115f8 + arp_table[i].state == ETHARP_STATE_EMPTY); + + /* IP address given? */ + if (ipaddr != NULL) { + 800f020: 68fb ldr r3, [r7, #12] + 800f022: 2b00 cmp r3, #0 + 800f024: d00b beq.n 800f03e + /* set IP address */ + ip4_addr_copy(arp_table[i].ipaddr, *ipaddr); + 800f026: f9b7 2020 ldrsh.w r2, [r7, #32] + 800f02a: 68fb ldr r3, [r7, #12] + 800f02c: 6819 ldr r1, [r3, #0] + 800f02e: 4812 ldr r0, [pc, #72] @ (800f078 ) + 800f030: 4613 mov r3, r2 + 800f032: 005b lsls r3, r3, #1 + 800f034: 4413 add r3, r2 + 800f036: 00db lsls r3, r3, #3 + 800f038: 4403 add r3, r0 + 800f03a: 3304 adds r3, #4 + 800f03c: 6019 str r1, [r3, #0] + } + arp_table[i].ctime = 0; + 800f03e: f9b7 2020 ldrsh.w r2, [r7, #32] + 800f042: 490d ldr r1, [pc, #52] @ (800f078 ) + 800f044: 4613 mov r3, r2 + 800f046: 005b lsls r3, r3, #1 + 800f048: 4413 add r3, r2 + 800f04a: 00db lsls r3, r3, #3 + 800f04c: 440b add r3, r1 + 800f04e: 3312 adds r3, #18 + 800f050: 2200 movs r2, #0 + 800f052: 801a strh r2, [r3, #0] +#if ETHARP_TABLE_MATCH_NETIF + arp_table[i].netif = netif; + 800f054: f9b7 2020 ldrsh.w r2, [r7, #32] + 800f058: 4907 ldr r1, [pc, #28] @ (800f078 ) + 800f05a: 4613 mov r3, r2 + 800f05c: 005b lsls r3, r3, #1 + 800f05e: 4413 add r3, r2 + 800f060: 00db lsls r3, r3, #3 + 800f062: 440b add r3, r1 + 800f064: 3308 adds r3, #8 + 800f066: 687a ldr r2, [r7, #4] + 800f068: 601a str r2, [r3, #0] +#endif /* ETHARP_TABLE_MATCH_NETIF */ + return (s16_t)i; + 800f06a: f9b7 3020 ldrsh.w r3, [r7, #32] +} + 800f06e: 4618 mov r0, r3 + 800f070: 3728 adds r7, #40 @ 0x28 + 800f072: 46bd mov sp, r7 + 800f074: bd80 pop {r7, pc} + 800f076: bf00 nop + 800f078: 20019138 .word 0x20019138 + 800f07c: 080186a4 .word 0x080186a4 + 800f080: 080186dc .word 0x080186dc + 800f084: 0801871c .word 0x0801871c + 800f088: 08018744 .word 0x08018744 + 800f08c: 0801875c .word 0x0801875c + 800f090: 08018770 .word 0x08018770 + +0800f094 : + * + * @see pbuf_free() + */ +static err_t +etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags) +{ + 800f094: b580 push {r7, lr} + 800f096: b088 sub sp, #32 + 800f098: af02 add r7, sp, #8 + 800f09a: 60f8 str r0, [r7, #12] + 800f09c: 60b9 str r1, [r7, #8] + 800f09e: 607a str r2, [r7, #4] + 800f0a0: 70fb strb r3, [r7, #3] + s16_t i; + LWIP_ASSERT("netif->hwaddr_len == ETH_HWADDR_LEN", netif->hwaddr_len == ETH_HWADDR_LEN); + 800f0a2: 68fb ldr r3, [r7, #12] + 800f0a4: f893 3030 ldrb.w r3, [r3, #48] @ 0x30 + 800f0a8: 2b06 cmp r3, #6 + 800f0aa: d006 beq.n 800f0ba + 800f0ac: 4b48 ldr r3, [pc, #288] @ (800f1d0 ) + 800f0ae: f240 12a9 movw r2, #425 @ 0x1a9 + 800f0b2: 4948 ldr r1, [pc, #288] @ (800f1d4 ) + 800f0b4: 4848 ldr r0, [pc, #288] @ (800f1d8 ) + 800f0b6: f002 fa9f bl 80115f8 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n", + ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr), + (u16_t)ethaddr->addr[0], (u16_t)ethaddr->addr[1], (u16_t)ethaddr->addr[2], + (u16_t)ethaddr->addr[3], (u16_t)ethaddr->addr[4], (u16_t)ethaddr->addr[5])); + /* non-unicast address? */ + if (ip4_addr_isany(ipaddr) || + 800f0ba: 68bb ldr r3, [r7, #8] + 800f0bc: 2b00 cmp r3, #0 + 800f0be: d012 beq.n 800f0e6 + 800f0c0: 68bb ldr r3, [r7, #8] + 800f0c2: 681b ldr r3, [r3, #0] + 800f0c4: 2b00 cmp r3, #0 + 800f0c6: d00e beq.n 800f0e6 + ip4_addr_isbroadcast(ipaddr, netif) || + 800f0c8: 68bb ldr r3, [r7, #8] + 800f0ca: 681b ldr r3, [r3, #0] + 800f0cc: 68f9 ldr r1, [r7, #12] + 800f0ce: 4618 mov r0, r3 + 800f0d0: f001 f920 bl 8010314 + 800f0d4: 4603 mov r3, r0 + if (ip4_addr_isany(ipaddr) || + 800f0d6: 2b00 cmp r3, #0 + 800f0d8: d105 bne.n 800f0e6 + ip4_addr_ismulticast(ipaddr)) { + 800f0da: 68bb ldr r3, [r7, #8] + 800f0dc: 681b ldr r3, [r3, #0] + 800f0de: f003 03f0 and.w r3, r3, #240 @ 0xf0 + ip4_addr_isbroadcast(ipaddr, netif) || + 800f0e2: 2be0 cmp r3, #224 @ 0xe0 + 800f0e4: d102 bne.n 800f0ec + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: will not add non-unicast IP address to ARP cache\n")); + return ERR_ARG; + 800f0e6: f06f 030f mvn.w r3, #15 + 800f0ea: e06c b.n 800f1c6 + } + /* find or create ARP entry */ + i = etharp_find_entry(ipaddr, flags, netif); + 800f0ec: 78fb ldrb r3, [r7, #3] + 800f0ee: 68fa ldr r2, [r7, #12] + 800f0f0: 4619 mov r1, r3 + 800f0f2: 68b8 ldr r0, [r7, #8] + 800f0f4: f7ff fe56 bl 800eda4 + 800f0f8: 4603 mov r3, r0 + 800f0fa: 82fb strh r3, [r7, #22] + /* bail out if no entry could be found */ + if (i < 0) { + 800f0fc: f9b7 3016 ldrsh.w r3, [r7, #22] + 800f100: 2b00 cmp r3, #0 + 800f102: da02 bge.n 800f10a + return (err_t)i; + 800f104: 8afb ldrh r3, [r7, #22] + 800f106: b25b sxtb r3, r3 + 800f108: e05d b.n 800f1c6 + return ERR_VAL; + } else +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + { + /* mark it stable */ + arp_table[i].state = ETHARP_STATE_STABLE; + 800f10a: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f10e: 4933 ldr r1, [pc, #204] @ (800f1dc ) + 800f110: 4613 mov r3, r2 + 800f112: 005b lsls r3, r3, #1 + 800f114: 4413 add r3, r2 + 800f116: 00db lsls r3, r3, #3 + 800f118: 440b add r3, r1 + 800f11a: 3314 adds r3, #20 + 800f11c: 2202 movs r2, #2 + 800f11e: 701a strb r2, [r3, #0] + } + + /* record network interface */ + arp_table[i].netif = netif; + 800f120: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f124: 492d ldr r1, [pc, #180] @ (800f1dc ) + 800f126: 4613 mov r3, r2 + 800f128: 005b lsls r3, r3, #1 + 800f12a: 4413 add r3, r2 + 800f12c: 00db lsls r3, r3, #3 + 800f12e: 440b add r3, r1 + 800f130: 3308 adds r3, #8 + 800f132: 68fa ldr r2, [r7, #12] + 800f134: 601a str r2, [r3, #0] + /* insert in SNMP ARP index tree */ + mib2_add_arp_entry(netif, &arp_table[i].ipaddr); + + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: updating stable entry %"S16_F"\n", i)); + /* update address */ + SMEMCPY(&arp_table[i].ethaddr, ethaddr, ETH_HWADDR_LEN); + 800f136: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f13a: 4613 mov r3, r2 + 800f13c: 005b lsls r3, r3, #1 + 800f13e: 4413 add r3, r2 + 800f140: 00db lsls r3, r3, #3 + 800f142: 3308 adds r3, #8 + 800f144: 4a25 ldr r2, [pc, #148] @ (800f1dc ) + 800f146: 4413 add r3, r2 + 800f148: 3304 adds r3, #4 + 800f14a: 2206 movs r2, #6 + 800f14c: 6879 ldr r1, [r7, #4] + 800f14e: 4618 mov r0, r3 + 800f150: f002 fb4e bl 80117f0 + /* reset time stamp */ + arp_table[i].ctime = 0; + 800f154: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f158: 4920 ldr r1, [pc, #128] @ (800f1dc ) + 800f15a: 4613 mov r3, r2 + 800f15c: 005b lsls r3, r3, #1 + 800f15e: 4413 add r3, r2 + 800f160: 00db lsls r3, r3, #3 + 800f162: 440b add r3, r1 + 800f164: 3312 adds r3, #18 + 800f166: 2200 movs r2, #0 + 800f168: 801a strh r2, [r3, #0] + /* get the packet pointer */ + p = q->p; + /* now queue entry can be freed */ + memp_free(MEMP_ARP_QUEUE, q); +#else /* ARP_QUEUEING */ + if (arp_table[i].q != NULL) { + 800f16a: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f16e: 491b ldr r1, [pc, #108] @ (800f1dc ) + 800f170: 4613 mov r3, r2 + 800f172: 005b lsls r3, r3, #1 + 800f174: 4413 add r3, r2 + 800f176: 00db lsls r3, r3, #3 + 800f178: 440b add r3, r1 + 800f17a: 681b ldr r3, [r3, #0] + 800f17c: 2b00 cmp r3, #0 + 800f17e: d021 beq.n 800f1c4 + struct pbuf *p = arp_table[i].q; + 800f180: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f184: 4915 ldr r1, [pc, #84] @ (800f1dc ) + 800f186: 4613 mov r3, r2 + 800f188: 005b lsls r3, r3, #1 + 800f18a: 4413 add r3, r2 + 800f18c: 00db lsls r3, r3, #3 + 800f18e: 440b add r3, r1 + 800f190: 681b ldr r3, [r3, #0] + 800f192: 613b str r3, [r7, #16] + arp_table[i].q = NULL; + 800f194: f9b7 2016 ldrsh.w r2, [r7, #22] + 800f198: 4910 ldr r1, [pc, #64] @ (800f1dc ) + 800f19a: 4613 mov r3, r2 + 800f19c: 005b lsls r3, r3, #1 + 800f19e: 4413 add r3, r2 + 800f1a0: 00db lsls r3, r3, #3 + 800f1a2: 440b add r3, r1 + 800f1a4: 2200 movs r2, #0 + 800f1a6: 601a str r2, [r3, #0] +#endif /* ARP_QUEUEING */ + /* send the queued IP packet */ + ethernet_output(netif, p, (struct eth_addr *)(netif->hwaddr), ethaddr, ETHTYPE_IP); + 800f1a8: 68fb ldr r3, [r7, #12] + 800f1aa: f103 022a add.w r2, r3, #42 @ 0x2a + 800f1ae: f44f 6300 mov.w r3, #2048 @ 0x800 + 800f1b2: 9300 str r3, [sp, #0] + 800f1b4: 687b ldr r3, [r7, #4] + 800f1b6: 6939 ldr r1, [r7, #16] + 800f1b8: 68f8 ldr r0, [r7, #12] + 800f1ba: f002 f8f7 bl 80113ac + /* free the queued IP packet */ + pbuf_free(p); + 800f1be: 6938 ldr r0, [r7, #16] + 800f1c0: f7f7 fc32 bl 8006a28 + } + return ERR_OK; + 800f1c4: 2300 movs r3, #0 +} + 800f1c6: 4618 mov r0, r3 + 800f1c8: 3718 adds r7, #24 + 800f1ca: 46bd mov sp, r7 + 800f1cc: bd80 pop {r7, pc} + 800f1ce: bf00 nop + 800f1d0: 080186a4 .word 0x080186a4 + 800f1d4: 0801879c .word 0x0801879c + 800f1d8: 0801871c .word 0x0801871c + 800f1dc: 20019138 .word 0x20019138 + +0800f1e0 : + * + * @param netif points to a network interface + */ +void +etharp_cleanup_netif(struct netif *netif) +{ + 800f1e0: b580 push {r7, lr} + 800f1e2: b084 sub sp, #16 + 800f1e4: af00 add r7, sp, #0 + 800f1e6: 6078 str r0, [r7, #4] + int i; + + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + 800f1e8: 2300 movs r3, #0 + 800f1ea: 60fb str r3, [r7, #12] + 800f1ec: e01e b.n 800f22c + u8_t state = arp_table[i].state; + 800f1ee: 4913 ldr r1, [pc, #76] @ (800f23c ) + 800f1f0: 68fa ldr r2, [r7, #12] + 800f1f2: 4613 mov r3, r2 + 800f1f4: 005b lsls r3, r3, #1 + 800f1f6: 4413 add r3, r2 + 800f1f8: 00db lsls r3, r3, #3 + 800f1fa: 440b add r3, r1 + 800f1fc: 3314 adds r3, #20 + 800f1fe: 781b ldrb r3, [r3, #0] + 800f200: 72fb strb r3, [r7, #11] + if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) { + 800f202: 7afb ldrb r3, [r7, #11] + 800f204: 2b00 cmp r3, #0 + 800f206: d00e beq.n 800f226 + 800f208: 490c ldr r1, [pc, #48] @ (800f23c ) + 800f20a: 68fa ldr r2, [r7, #12] + 800f20c: 4613 mov r3, r2 + 800f20e: 005b lsls r3, r3, #1 + 800f210: 4413 add r3, r2 + 800f212: 00db lsls r3, r3, #3 + 800f214: 440b add r3, r1 + 800f216: 3308 adds r3, #8 + 800f218: 681b ldr r3, [r3, #0] + 800f21a: 687a ldr r2, [r7, #4] + 800f21c: 429a cmp r2, r3 + 800f21e: d102 bne.n 800f226 + etharp_free_entry(i); + 800f220: 68f8 ldr r0, [r7, #12] + 800f222: f7ff fce5 bl 800ebf0 + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + 800f226: 68fb ldr r3, [r7, #12] + 800f228: 3301 adds r3, #1 + 800f22a: 60fb str r3, [r7, #12] + 800f22c: 68fb ldr r3, [r7, #12] + 800f22e: 2b09 cmp r3, #9 + 800f230: dddd ble.n 800f1ee + } + } +} + 800f232: bf00 nop + 800f234: bf00 nop + 800f236: 3710 adds r7, #16 + 800f238: 46bd mov sp, r7 + 800f23a: bd80 pop {r7, pc} + 800f23c: 20019138 .word 0x20019138 + +0800f240 : + * + * @see pbuf_free() + */ +void +etharp_input(struct pbuf *p, struct netif *netif) +{ + 800f240: b5b0 push {r4, r5, r7, lr} + 800f242: b08a sub sp, #40 @ 0x28 + 800f244: af04 add r7, sp, #16 + 800f246: 6078 str r0, [r7, #4] + 800f248: 6039 str r1, [r7, #0] + ip4_addr_t sipaddr, dipaddr; + u8_t for_us; + + LWIP_ASSERT_CORE_LOCKED(); + + LWIP_ERROR("netif != NULL", (netif != NULL), return;); + 800f24a: 683b ldr r3, [r7, #0] + 800f24c: 2b00 cmp r3, #0 + 800f24e: d107 bne.n 800f260 + 800f250: 4b3f ldr r3, [pc, #252] @ (800f350 ) + 800f252: f240 228a movw r2, #650 @ 0x28a + 800f256: 493f ldr r1, [pc, #252] @ (800f354 ) + 800f258: 483f ldr r0, [pc, #252] @ (800f358 ) + 800f25a: f002 f9cd bl 80115f8 + 800f25e: e074 b.n 800f34a + + hdr = (struct etharp_hdr *)p->payload; + 800f260: 687b ldr r3, [r7, #4] + 800f262: 685b ldr r3, [r3, #4] + 800f264: 613b str r3, [r7, #16] + + /* RFC 826 "Packet Reception": */ + if ((hdr->hwtype != PP_HTONS(LWIP_IANA_HWTYPE_ETHERNET)) || + 800f266: 693b ldr r3, [r7, #16] + 800f268: 881b ldrh r3, [r3, #0] + 800f26a: b29b uxth r3, r3 + 800f26c: f5b3 7f80 cmp.w r3, #256 @ 0x100 + 800f270: d10c bne.n 800f28c + (hdr->hwlen != ETH_HWADDR_LEN) || + 800f272: 693b ldr r3, [r7, #16] + 800f274: 791b ldrb r3, [r3, #4] + if ((hdr->hwtype != PP_HTONS(LWIP_IANA_HWTYPE_ETHERNET)) || + 800f276: 2b06 cmp r3, #6 + 800f278: d108 bne.n 800f28c + (hdr->protolen != sizeof(ip4_addr_t)) || + 800f27a: 693b ldr r3, [r7, #16] + 800f27c: 795b ldrb r3, [r3, #5] + (hdr->hwlen != ETH_HWADDR_LEN) || + 800f27e: 2b04 cmp r3, #4 + 800f280: d104 bne.n 800f28c + (hdr->proto != PP_HTONS(ETHTYPE_IP))) { + 800f282: 693b ldr r3, [r7, #16] + 800f284: 885b ldrh r3, [r3, #2] + 800f286: b29b uxth r3, r3 + (hdr->protolen != sizeof(ip4_addr_t)) || + 800f288: 2b08 cmp r3, #8 + 800f28a: d003 beq.n 800f294 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("etharp_input: packet dropped, wrong hw type, hwlen, proto, protolen or ethernet type (%"U16_F"/%"U16_F"/%"U16_F"/%"U16_F")\n", + hdr->hwtype, (u16_t)hdr->hwlen, hdr->proto, (u16_t)hdr->protolen)); + ETHARP_STATS_INC(etharp.proterr); + ETHARP_STATS_INC(etharp.drop); + pbuf_free(p); + 800f28c: 6878 ldr r0, [r7, #4] + 800f28e: f7f7 fbcb bl 8006a28 + return; + 800f292: e05a b.n 800f34a + autoip_arp_reply(netif, hdr); +#endif /* LWIP_AUTOIP */ + + /* Copy struct ip4_addr_wordaligned to aligned ip4_addr, to support compilers without + * structure packing (not using structure copy which breaks strict-aliasing rules). */ + IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&sipaddr, &hdr->sipaddr); + 800f294: 693b ldr r3, [r7, #16] + 800f296: 330e adds r3, #14 + 800f298: 681b ldr r3, [r3, #0] + 800f29a: 60fb str r3, [r7, #12] + IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&dipaddr, &hdr->dipaddr); + 800f29c: 693b ldr r3, [r7, #16] + 800f29e: 3318 adds r3, #24 + 800f2a0: 681b ldr r3, [r3, #0] + 800f2a2: 60bb str r3, [r7, #8] + + /* this interface is not configured? */ + if (ip4_addr_isany_val(*netif_ip4_addr(netif))) { + 800f2a4: 683b ldr r3, [r7, #0] + 800f2a6: 3304 adds r3, #4 + 800f2a8: 681b ldr r3, [r3, #0] + 800f2aa: 2b00 cmp r3, #0 + 800f2ac: d102 bne.n 800f2b4 + for_us = 0; + 800f2ae: 2300 movs r3, #0 + 800f2b0: 75fb strb r3, [r7, #23] + 800f2b2: e009 b.n 800f2c8 + } else { + /* ARP packet directed to us? */ + for_us = (u8_t)ip4_addr_cmp(&dipaddr, netif_ip4_addr(netif)); + 800f2b4: 68ba ldr r2, [r7, #8] + 800f2b6: 683b ldr r3, [r7, #0] + 800f2b8: 3304 adds r3, #4 + 800f2ba: 681b ldr r3, [r3, #0] + 800f2bc: 429a cmp r2, r3 + 800f2be: bf0c ite eq + 800f2c0: 2301 moveq r3, #1 + 800f2c2: 2300 movne r3, #0 + 800f2c4: b2db uxtb r3, r3 + 800f2c6: 75fb strb r3, [r7, #23] + /* ARP message directed to us? + -> add IP address in ARP cache; assume requester wants to talk to us, + can result in directly sending the queued packets for this host. + ARP message not directed to us? + -> update the source IP address in the cache, if present */ + etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), + 800f2c8: 693b ldr r3, [r7, #16] + 800f2ca: f103 0208 add.w r2, r3, #8 + 800f2ce: 7dfb ldrb r3, [r7, #23] + 800f2d0: 2b00 cmp r3, #0 + 800f2d2: d001 beq.n 800f2d8 + 800f2d4: 2301 movs r3, #1 + 800f2d6: e000 b.n 800f2da + 800f2d8: 2302 movs r3, #2 + 800f2da: f107 010c add.w r1, r7, #12 + 800f2de: 6838 ldr r0, [r7, #0] + 800f2e0: f7ff fed8 bl 800f094 + for_us ? ETHARP_FLAG_TRY_HARD : ETHARP_FLAG_FIND_ONLY); + + /* now act on the message itself */ + switch (hdr->opcode) { + 800f2e4: 693b ldr r3, [r7, #16] + 800f2e6: 88db ldrh r3, [r3, #6] + 800f2e8: b29b uxth r3, r3 + 800f2ea: f5b3 7f80 cmp.w r3, #256 @ 0x100 + 800f2ee: d003 beq.n 800f2f8 + 800f2f0: f5b3 7f00 cmp.w r3, #512 @ 0x200 + 800f2f4: d01e beq.n 800f334 +#endif /* (LWIP_DHCP && DHCP_DOES_ARP_CHECK) */ + break; + default: + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_input: ARP unknown opcode type %"S16_F"\n", lwip_htons(hdr->opcode))); + ETHARP_STATS_INC(etharp.err); + break; + 800f2f6: e025 b.n 800f344 + if (for_us) { + 800f2f8: 7dfb ldrb r3, [r7, #23] + 800f2fa: 2b00 cmp r3, #0 + 800f2fc: d021 beq.n 800f342 + (struct eth_addr *)netif->hwaddr, &hdr->shwaddr, + 800f2fe: 683b ldr r3, [r7, #0] + 800f300: f103 002a add.w r0, r3, #42 @ 0x2a + 800f304: 693b ldr r3, [r7, #16] + 800f306: f103 0408 add.w r4, r3, #8 + (struct eth_addr *)netif->hwaddr, netif_ip4_addr(netif), + 800f30a: 683b ldr r3, [r7, #0] + 800f30c: f103 052a add.w r5, r3, #42 @ 0x2a + 800f310: 683b ldr r3, [r7, #0] + 800f312: 3304 adds r3, #4 + &hdr->shwaddr, &sipaddr, + 800f314: 693a ldr r2, [r7, #16] + 800f316: 3208 adds r2, #8 + etharp_raw(netif, + 800f318: 2102 movs r1, #2 + 800f31a: 9103 str r1, [sp, #12] + 800f31c: f107 010c add.w r1, r7, #12 + 800f320: 9102 str r1, [sp, #8] + 800f322: 9201 str r2, [sp, #4] + 800f324: 9300 str r3, [sp, #0] + 800f326: 462b mov r3, r5 + 800f328: 4622 mov r2, r4 + 800f32a: 4601 mov r1, r0 + 800f32c: 6838 ldr r0, [r7, #0] + 800f32e: f000 faef bl 800f910 + break; + 800f332: e006 b.n 800f342 + dhcp_arp_reply(netif, &sipaddr); + 800f334: f107 030c add.w r3, r7, #12 + 800f338: 4619 mov r1, r3 + 800f33a: 6838 ldr r0, [r7, #0] + 800f33c: f7fe fa02 bl 800d744 + break; + 800f340: e000 b.n 800f344 + break; + 800f342: bf00 nop + } + /* free ARP packet */ + pbuf_free(p); + 800f344: 6878 ldr r0, [r7, #4] + 800f346: f7f7 fb6f bl 8006a28 +} + 800f34a: 3718 adds r7, #24 + 800f34c: 46bd mov sp, r7 + 800f34e: bdb0 pop {r4, r5, r7, pc} + 800f350: 080186a4 .word 0x080186a4 + 800f354: 080187f4 .word 0x080187f4 + 800f358: 0801871c .word 0x0801871c + +0800f35c : +/** Just a small helper function that sends a pbuf to an ethernet address + * in the arp_table specified by the index 'arp_idx'. + */ +static err_t +etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, netif_addr_idx_t arp_idx) +{ + 800f35c: b580 push {r7, lr} + 800f35e: b086 sub sp, #24 + 800f360: af02 add r7, sp, #8 + 800f362: 60f8 str r0, [r7, #12] + 800f364: 60b9 str r1, [r7, #8] + 800f366: 4613 mov r3, r2 + 800f368: 71fb strb r3, [r7, #7] + LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE", + 800f36a: 79fa ldrb r2, [r7, #7] + 800f36c: 4944 ldr r1, [pc, #272] @ (800f480 ) + 800f36e: 4613 mov r3, r2 + 800f370: 005b lsls r3, r3, #1 + 800f372: 4413 add r3, r2 + 800f374: 00db lsls r3, r3, #3 + 800f376: 440b add r3, r1 + 800f378: 3314 adds r3, #20 + 800f37a: 781b ldrb r3, [r3, #0] + 800f37c: 2b01 cmp r3, #1 + 800f37e: d806 bhi.n 800f38e + 800f380: 4b40 ldr r3, [pc, #256] @ (800f484 ) + 800f382: f240 22ee movw r2, #750 @ 0x2ee + 800f386: 4940 ldr r1, [pc, #256] @ (800f488 ) + 800f388: 4840 ldr r0, [pc, #256] @ (800f48c ) + 800f38a: f002 f935 bl 80115f8 + arp_table[arp_idx].state >= ETHARP_STATE_STABLE); + /* if arp table entry is about to expire: re-request it, + but only if its state is ETHARP_STATE_STABLE to prevent flooding the + network with ARP requests if this address is used frequently. */ + if (arp_table[arp_idx].state == ETHARP_STATE_STABLE) { + 800f38e: 79fa ldrb r2, [r7, #7] + 800f390: 493b ldr r1, [pc, #236] @ (800f480 ) + 800f392: 4613 mov r3, r2 + 800f394: 005b lsls r3, r3, #1 + 800f396: 4413 add r3, r2 + 800f398: 00db lsls r3, r3, #3 + 800f39a: 440b add r3, r1 + 800f39c: 3314 adds r3, #20 + 800f39e: 781b ldrb r3, [r3, #0] + 800f3a0: 2b02 cmp r3, #2 + 800f3a2: d153 bne.n 800f44c + if (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED_BROADCAST) { + 800f3a4: 79fa ldrb r2, [r7, #7] + 800f3a6: 4936 ldr r1, [pc, #216] @ (800f480 ) + 800f3a8: 4613 mov r3, r2 + 800f3aa: 005b lsls r3, r3, #1 + 800f3ac: 4413 add r3, r2 + 800f3ae: 00db lsls r3, r3, #3 + 800f3b0: 440b add r3, r1 + 800f3b2: 3312 adds r3, #18 + 800f3b4: 881b ldrh r3, [r3, #0] + 800f3b6: f5b3 7f8e cmp.w r3, #284 @ 0x11c + 800f3ba: d919 bls.n 800f3f0 + /* issue a standard request using broadcast */ + if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) { + 800f3bc: 79fa ldrb r2, [r7, #7] + 800f3be: 4613 mov r3, r2 + 800f3c0: 005b lsls r3, r3, #1 + 800f3c2: 4413 add r3, r2 + 800f3c4: 00db lsls r3, r3, #3 + 800f3c6: 4a2e ldr r2, [pc, #184] @ (800f480 ) + 800f3c8: 4413 add r3, r2 + 800f3ca: 3304 adds r3, #4 + 800f3cc: 4619 mov r1, r3 + 800f3ce: 68f8 ldr r0, [r7, #12] + 800f3d0: f000 fb4c bl 800fa6c + 800f3d4: 4603 mov r3, r0 + 800f3d6: 2b00 cmp r3, #0 + 800f3d8: d138 bne.n 800f44c + arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING_1; + 800f3da: 79fa ldrb r2, [r7, #7] + 800f3dc: 4928 ldr r1, [pc, #160] @ (800f480 ) + 800f3de: 4613 mov r3, r2 + 800f3e0: 005b lsls r3, r3, #1 + 800f3e2: 4413 add r3, r2 + 800f3e4: 00db lsls r3, r3, #3 + 800f3e6: 440b add r3, r1 + 800f3e8: 3314 adds r3, #20 + 800f3ea: 2203 movs r2, #3 + 800f3ec: 701a strb r2, [r3, #0] + 800f3ee: e02d b.n 800f44c + } + } else if (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED_UNICAST) { + 800f3f0: 79fa ldrb r2, [r7, #7] + 800f3f2: 4923 ldr r1, [pc, #140] @ (800f480 ) + 800f3f4: 4613 mov r3, r2 + 800f3f6: 005b lsls r3, r3, #1 + 800f3f8: 4413 add r3, r2 + 800f3fa: 00db lsls r3, r3, #3 + 800f3fc: 440b add r3, r1 + 800f3fe: 3312 adds r3, #18 + 800f400: 881b ldrh r3, [r3, #0] + 800f402: f5b3 7f87 cmp.w r3, #270 @ 0x10e + 800f406: d321 bcc.n 800f44c + /* issue a unicast request (for 15 seconds) to prevent unnecessary broadcast */ + if (etharp_request_dst(netif, &arp_table[arp_idx].ipaddr, &arp_table[arp_idx].ethaddr) == ERR_OK) { + 800f408: 79fa ldrb r2, [r7, #7] + 800f40a: 4613 mov r3, r2 + 800f40c: 005b lsls r3, r3, #1 + 800f40e: 4413 add r3, r2 + 800f410: 00db lsls r3, r3, #3 + 800f412: 4a1b ldr r2, [pc, #108] @ (800f480 ) + 800f414: 4413 add r3, r2 + 800f416: 1d19 adds r1, r3, #4 + 800f418: 79fa ldrb r2, [r7, #7] + 800f41a: 4613 mov r3, r2 + 800f41c: 005b lsls r3, r3, #1 + 800f41e: 4413 add r3, r2 + 800f420: 00db lsls r3, r3, #3 + 800f422: 3308 adds r3, #8 + 800f424: 4a16 ldr r2, [pc, #88] @ (800f480 ) + 800f426: 4413 add r3, r2 + 800f428: 3304 adds r3, #4 + 800f42a: 461a mov r2, r3 + 800f42c: 68f8 ldr r0, [r7, #12] + 800f42e: f000 fafb bl 800fa28 + 800f432: 4603 mov r3, r0 + 800f434: 2b00 cmp r3, #0 + 800f436: d109 bne.n 800f44c + arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING_1; + 800f438: 79fa ldrb r2, [r7, #7] + 800f43a: 4911 ldr r1, [pc, #68] @ (800f480 ) + 800f43c: 4613 mov r3, r2 + 800f43e: 005b lsls r3, r3, #1 + 800f440: 4413 add r3, r2 + 800f442: 00db lsls r3, r3, #3 + 800f444: 440b add r3, r1 + 800f446: 3314 adds r3, #20 + 800f448: 2203 movs r2, #3 + 800f44a: 701a strb r2, [r3, #0] + } + } + } + + return ethernet_output(netif, q, (struct eth_addr *)(netif->hwaddr), &arp_table[arp_idx].ethaddr, ETHTYPE_IP); + 800f44c: 68fb ldr r3, [r7, #12] + 800f44e: f103 012a add.w r1, r3, #42 @ 0x2a + 800f452: 79fa ldrb r2, [r7, #7] + 800f454: 4613 mov r3, r2 + 800f456: 005b lsls r3, r3, #1 + 800f458: 4413 add r3, r2 + 800f45a: 00db lsls r3, r3, #3 + 800f45c: 3308 adds r3, #8 + 800f45e: 4a08 ldr r2, [pc, #32] @ (800f480 ) + 800f460: 4413 add r3, r2 + 800f462: 3304 adds r3, #4 + 800f464: f44f 6200 mov.w r2, #2048 @ 0x800 + 800f468: 9200 str r2, [sp, #0] + 800f46a: 460a mov r2, r1 + 800f46c: 68b9 ldr r1, [r7, #8] + 800f46e: 68f8 ldr r0, [r7, #12] + 800f470: f001 ff9c bl 80113ac + 800f474: 4603 mov r3, r0 +} + 800f476: 4618 mov r0, r3 + 800f478: 3710 adds r7, #16 + 800f47a: 46bd mov sp, r7 + 800f47c: bd80 pop {r7, pc} + 800f47e: bf00 nop + 800f480: 20019138 .word 0x20019138 + 800f484: 080186a4 .word 0x080186a4 + 800f488: 08018814 .word 0x08018814 + 800f48c: 0801871c .word 0x0801871c + +0800f490 : + * - ERR_RTE No route to destination (no gateway to external networks), + * or the return type of either etharp_query() or ethernet_output(). + */ +err_t +etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr) +{ + 800f490: b580 push {r7, lr} + 800f492: b08a sub sp, #40 @ 0x28 + 800f494: af02 add r7, sp, #8 + 800f496: 60f8 str r0, [r7, #12] + 800f498: 60b9 str r1, [r7, #8] + 800f49a: 607a str r2, [r7, #4] + const struct eth_addr *dest; + struct eth_addr mcastaddr; + const ip4_addr_t *dst_addr = ipaddr; + 800f49c: 687b ldr r3, [r7, #4] + 800f49e: 61bb str r3, [r7, #24] + + LWIP_ASSERT_CORE_LOCKED(); + LWIP_ASSERT("netif != NULL", netif != NULL); + 800f4a0: 68fb ldr r3, [r7, #12] + 800f4a2: 2b00 cmp r3, #0 + 800f4a4: d106 bne.n 800f4b4 + 800f4a6: 4b73 ldr r3, [pc, #460] @ (800f674 ) + 800f4a8: f240 321e movw r2, #798 @ 0x31e + 800f4ac: 4972 ldr r1, [pc, #456] @ (800f678 ) + 800f4ae: 4873 ldr r0, [pc, #460] @ (800f67c ) + 800f4b0: f002 f8a2 bl 80115f8 + LWIP_ASSERT("q != NULL", q != NULL); + 800f4b4: 68bb ldr r3, [r7, #8] + 800f4b6: 2b00 cmp r3, #0 + 800f4b8: d106 bne.n 800f4c8 + 800f4ba: 4b6e ldr r3, [pc, #440] @ (800f674 ) + 800f4bc: f240 321f movw r2, #799 @ 0x31f + 800f4c0: 496f ldr r1, [pc, #444] @ (800f680 ) + 800f4c2: 486e ldr r0, [pc, #440] @ (800f67c ) + 800f4c4: f002 f898 bl 80115f8 + LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL); + 800f4c8: 687b ldr r3, [r7, #4] + 800f4ca: 2b00 cmp r3, #0 + 800f4cc: d106 bne.n 800f4dc + 800f4ce: 4b69 ldr r3, [pc, #420] @ (800f674 ) + 800f4d0: f44f 7248 mov.w r2, #800 @ 0x320 + 800f4d4: 496b ldr r1, [pc, #428] @ (800f684 ) + 800f4d6: 4869 ldr r0, [pc, #420] @ (800f67c ) + 800f4d8: f002 f88e bl 80115f8 + + /* Determine on destination hardware address. Broadcasts and multicasts + * are special, other IP addresses are looked up in the ARP table. */ + + /* broadcast destination IP address? */ + if (ip4_addr_isbroadcast(ipaddr, netif)) { + 800f4dc: 687b ldr r3, [r7, #4] + 800f4de: 681b ldr r3, [r3, #0] + 800f4e0: 68f9 ldr r1, [r7, #12] + 800f4e2: 4618 mov r0, r3 + 800f4e4: f000 ff16 bl 8010314 + 800f4e8: 4603 mov r3, r0 + 800f4ea: 2b00 cmp r3, #0 + 800f4ec: d002 beq.n 800f4f4 + /* broadcast on Ethernet also */ + dest = (const struct eth_addr *)ðbroadcast; + 800f4ee: 4b66 ldr r3, [pc, #408] @ (800f688 ) + 800f4f0: 61fb str r3, [r7, #28] + 800f4f2: e0af b.n 800f654 + /* multicast destination IP address? */ + } else if (ip4_addr_ismulticast(ipaddr)) { + 800f4f4: 687b ldr r3, [r7, #4] + 800f4f6: 681b ldr r3, [r3, #0] + 800f4f8: f003 03f0 and.w r3, r3, #240 @ 0xf0 + 800f4fc: 2be0 cmp r3, #224 @ 0xe0 + 800f4fe: d118 bne.n 800f532 + /* Hash IP multicast address to MAC address.*/ + mcastaddr.addr[0] = LL_IP4_MULTICAST_ADDR_0; + 800f500: 2301 movs r3, #1 + 800f502: 743b strb r3, [r7, #16] + mcastaddr.addr[1] = LL_IP4_MULTICAST_ADDR_1; + 800f504: 2300 movs r3, #0 + 800f506: 747b strb r3, [r7, #17] + mcastaddr.addr[2] = LL_IP4_MULTICAST_ADDR_2; + 800f508: 235e movs r3, #94 @ 0x5e + 800f50a: 74bb strb r3, [r7, #18] + mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f; + 800f50c: 687b ldr r3, [r7, #4] + 800f50e: 3301 adds r3, #1 + 800f510: 781b ldrb r3, [r3, #0] + 800f512: f003 037f and.w r3, r3, #127 @ 0x7f + 800f516: b2db uxtb r3, r3 + 800f518: 74fb strb r3, [r7, #19] + mcastaddr.addr[4] = ip4_addr3(ipaddr); + 800f51a: 687b ldr r3, [r7, #4] + 800f51c: 3302 adds r3, #2 + 800f51e: 781b ldrb r3, [r3, #0] + 800f520: 753b strb r3, [r7, #20] + mcastaddr.addr[5] = ip4_addr4(ipaddr); + 800f522: 687b ldr r3, [r7, #4] + 800f524: 3303 adds r3, #3 + 800f526: 781b ldrb r3, [r3, #0] + 800f528: 757b strb r3, [r7, #21] + /* destination Ethernet address is multicast */ + dest = &mcastaddr; + 800f52a: f107 0310 add.w r3, r7, #16 + 800f52e: 61fb str r3, [r7, #28] + 800f530: e090 b.n 800f654 + /* unicast destination IP address? */ + } else { + netif_addr_idx_t i; + /* outside local network? if so, this can neither be a global broadcast nor + a subnet broadcast. */ + if (!ip4_addr_netcmp(ipaddr, netif_ip4_addr(netif), netif_ip4_netmask(netif)) && + 800f532: 687b ldr r3, [r7, #4] + 800f534: 681a ldr r2, [r3, #0] + 800f536: 68fb ldr r3, [r7, #12] + 800f538: 3304 adds r3, #4 + 800f53a: 681b ldr r3, [r3, #0] + 800f53c: 405a eors r2, r3 + 800f53e: 68fb ldr r3, [r7, #12] + 800f540: 3308 adds r3, #8 + 800f542: 681b ldr r3, [r3, #0] + 800f544: 4013 ands r3, r2 + 800f546: 2b00 cmp r3, #0 + 800f548: d012 beq.n 800f570 + !ip4_addr_islinklocal(ipaddr)) { + 800f54a: 687b ldr r3, [r7, #4] + 800f54c: 681b ldr r3, [r3, #0] + 800f54e: b29b uxth r3, r3 + if (!ip4_addr_netcmp(ipaddr, netif_ip4_addr(netif), netif_ip4_netmask(netif)) && + 800f550: f64f 62a9 movw r2, #65193 @ 0xfea9 + 800f554: 4293 cmp r3, r2 + 800f556: d00b beq.n 800f570 + dst_addr = LWIP_HOOK_ETHARP_GET_GW(netif, ipaddr); + if (dst_addr == NULL) +#endif /* LWIP_HOOK_ETHARP_GET_GW */ + { + /* interface has default gateway? */ + if (!ip4_addr_isany_val(*netif_ip4_gw(netif))) { + 800f558: 68fb ldr r3, [r7, #12] + 800f55a: 330c adds r3, #12 + 800f55c: 681b ldr r3, [r3, #0] + 800f55e: 2b00 cmp r3, #0 + 800f560: d003 beq.n 800f56a + /* send to hardware address of default gateway IP address */ + dst_addr = netif_ip4_gw(netif); + 800f562: 68fb ldr r3, [r7, #12] + 800f564: 330c adds r3, #12 + 800f566: 61bb str r3, [r7, #24] + 800f568: e002 b.n 800f570 + /* no default gateway available */ + } else { + /* no route to destination error (default gateway missing) */ + return ERR_RTE; + 800f56a: f06f 0303 mvn.w r3, #3 + 800f56e: e07d b.n 800f66c + if (netif->hints != NULL) { + /* per-pcb cached entry was given */ + netif_addr_idx_t etharp_cached_entry = netif->hints->addr_hint; + if (etharp_cached_entry < ARP_TABLE_SIZE) { +#endif /* LWIP_NETIF_HWADDRHINT */ + if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) && + 800f570: 4b46 ldr r3, [pc, #280] @ (800f68c ) + 800f572: 781b ldrb r3, [r3, #0] + 800f574: 4619 mov r1, r3 + 800f576: 4a46 ldr r2, [pc, #280] @ (800f690 ) + 800f578: 460b mov r3, r1 + 800f57a: 005b lsls r3, r3, #1 + 800f57c: 440b add r3, r1 + 800f57e: 00db lsls r3, r3, #3 + 800f580: 4413 add r3, r2 + 800f582: 3314 adds r3, #20 + 800f584: 781b ldrb r3, [r3, #0] + 800f586: 2b01 cmp r3, #1 + 800f588: d925 bls.n 800f5d6 +#if ETHARP_TABLE_MATCH_NETIF + (arp_table[etharp_cached_entry].netif == netif) && + 800f58a: 4b40 ldr r3, [pc, #256] @ (800f68c ) + 800f58c: 781b ldrb r3, [r3, #0] + 800f58e: 4619 mov r1, r3 + 800f590: 4a3f ldr r2, [pc, #252] @ (800f690 ) + 800f592: 460b mov r3, r1 + 800f594: 005b lsls r3, r3, #1 + 800f596: 440b add r3, r1 + 800f598: 00db lsls r3, r3, #3 + 800f59a: 4413 add r3, r2 + 800f59c: 3308 adds r3, #8 + 800f59e: 681b ldr r3, [r3, #0] + if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) && + 800f5a0: 68fa ldr r2, [r7, #12] + 800f5a2: 429a cmp r2, r3 + 800f5a4: d117 bne.n 800f5d6 +#endif + (ip4_addr_cmp(dst_addr, &arp_table[etharp_cached_entry].ipaddr))) { + 800f5a6: 69bb ldr r3, [r7, #24] + 800f5a8: 681a ldr r2, [r3, #0] + 800f5aa: 4b38 ldr r3, [pc, #224] @ (800f68c ) + 800f5ac: 781b ldrb r3, [r3, #0] + 800f5ae: 4618 mov r0, r3 + 800f5b0: 4937 ldr r1, [pc, #220] @ (800f690 ) + 800f5b2: 4603 mov r3, r0 + 800f5b4: 005b lsls r3, r3, #1 + 800f5b6: 4403 add r3, r0 + 800f5b8: 00db lsls r3, r3, #3 + 800f5ba: 440b add r3, r1 + 800f5bc: 3304 adds r3, #4 + 800f5be: 681b ldr r3, [r3, #0] + (arp_table[etharp_cached_entry].netif == netif) && + 800f5c0: 429a cmp r2, r3 + 800f5c2: d108 bne.n 800f5d6 + /* the per-pcb-cached entry is stable and the right one! */ + ETHARP_STATS_INC(etharp.cachehit); + return etharp_output_to_arp_index(netif, q, etharp_cached_entry); + 800f5c4: 4b31 ldr r3, [pc, #196] @ (800f68c ) + 800f5c6: 781b ldrb r3, [r3, #0] + 800f5c8: 461a mov r2, r3 + 800f5ca: 68b9 ldr r1, [r7, #8] + 800f5cc: 68f8 ldr r0, [r7, #12] + 800f5ce: f7ff fec5 bl 800f35c + 800f5d2: 4603 mov r3, r0 + 800f5d4: e04a b.n 800f66c + } +#endif /* LWIP_NETIF_HWADDRHINT */ + + /* find stable entry: do this here since this is a critical path for + throughput and etharp_find_entry() is kind of slow */ + for (i = 0; i < ARP_TABLE_SIZE; i++) { + 800f5d6: 2300 movs r3, #0 + 800f5d8: 75fb strb r3, [r7, #23] + 800f5da: e031 b.n 800f640 + if ((arp_table[i].state >= ETHARP_STATE_STABLE) && + 800f5dc: 7dfa ldrb r2, [r7, #23] + 800f5de: 492c ldr r1, [pc, #176] @ (800f690 ) + 800f5e0: 4613 mov r3, r2 + 800f5e2: 005b lsls r3, r3, #1 + 800f5e4: 4413 add r3, r2 + 800f5e6: 00db lsls r3, r3, #3 + 800f5e8: 440b add r3, r1 + 800f5ea: 3314 adds r3, #20 + 800f5ec: 781b ldrb r3, [r3, #0] + 800f5ee: 2b01 cmp r3, #1 + 800f5f0: d923 bls.n 800f63a +#if ETHARP_TABLE_MATCH_NETIF + (arp_table[i].netif == netif) && + 800f5f2: 7dfa ldrb r2, [r7, #23] + 800f5f4: 4926 ldr r1, [pc, #152] @ (800f690 ) + 800f5f6: 4613 mov r3, r2 + 800f5f8: 005b lsls r3, r3, #1 + 800f5fa: 4413 add r3, r2 + 800f5fc: 00db lsls r3, r3, #3 + 800f5fe: 440b add r3, r1 + 800f600: 3308 adds r3, #8 + 800f602: 681b ldr r3, [r3, #0] + if ((arp_table[i].state >= ETHARP_STATE_STABLE) && + 800f604: 68fa ldr r2, [r7, #12] + 800f606: 429a cmp r2, r3 + 800f608: d117 bne.n 800f63a +#endif + (ip4_addr_cmp(dst_addr, &arp_table[i].ipaddr))) { + 800f60a: 69bb ldr r3, [r7, #24] + 800f60c: 6819 ldr r1, [r3, #0] + 800f60e: 7dfa ldrb r2, [r7, #23] + 800f610: 481f ldr r0, [pc, #124] @ (800f690 ) + 800f612: 4613 mov r3, r2 + 800f614: 005b lsls r3, r3, #1 + 800f616: 4413 add r3, r2 + 800f618: 00db lsls r3, r3, #3 + 800f61a: 4403 add r3, r0 + 800f61c: 3304 adds r3, #4 + 800f61e: 681b ldr r3, [r3, #0] + (arp_table[i].netif == netif) && + 800f620: 4299 cmp r1, r3 + 800f622: d10a bne.n 800f63a + /* found an existing, stable entry */ + ETHARP_SET_ADDRHINT(netif, i); + 800f624: 4a19 ldr r2, [pc, #100] @ (800f68c ) + 800f626: 7dfb ldrb r3, [r7, #23] + 800f628: 7013 strb r3, [r2, #0] + return etharp_output_to_arp_index(netif, q, i); + 800f62a: 7dfb ldrb r3, [r7, #23] + 800f62c: 461a mov r2, r3 + 800f62e: 68b9 ldr r1, [r7, #8] + 800f630: 68f8 ldr r0, [r7, #12] + 800f632: f7ff fe93 bl 800f35c + 800f636: 4603 mov r3, r0 + 800f638: e018 b.n 800f66c + for (i = 0; i < ARP_TABLE_SIZE; i++) { + 800f63a: 7dfb ldrb r3, [r7, #23] + 800f63c: 3301 adds r3, #1 + 800f63e: 75fb strb r3, [r7, #23] + 800f640: 7dfb ldrb r3, [r7, #23] + 800f642: 2b09 cmp r3, #9 + 800f644: d9ca bls.n 800f5dc + } + } + /* no stable entry found, use the (slower) query function: + queue on destination Ethernet address belonging to ipaddr */ + return etharp_query(netif, dst_addr, q); + 800f646: 68ba ldr r2, [r7, #8] + 800f648: 69b9 ldr r1, [r7, #24] + 800f64a: 68f8 ldr r0, [r7, #12] + 800f64c: f000 f822 bl 800f694 + 800f650: 4603 mov r3, r0 + 800f652: e00b b.n 800f66c + } + + /* continuation for multicast/broadcast destinations */ + /* obtain source Ethernet address of the given interface */ + /* send packet directly on the link */ + return ethernet_output(netif, q, (struct eth_addr *)(netif->hwaddr), dest, ETHTYPE_IP); + 800f654: 68fb ldr r3, [r7, #12] + 800f656: f103 022a add.w r2, r3, #42 @ 0x2a + 800f65a: f44f 6300 mov.w r3, #2048 @ 0x800 + 800f65e: 9300 str r3, [sp, #0] + 800f660: 69fb ldr r3, [r7, #28] + 800f662: 68b9 ldr r1, [r7, #8] + 800f664: 68f8 ldr r0, [r7, #12] + 800f666: f001 fea1 bl 80113ac + 800f66a: 4603 mov r3, r0 +} + 800f66c: 4618 mov r0, r3 + 800f66e: 3720 adds r7, #32 + 800f670: 46bd mov sp, r7 + 800f672: bd80 pop {r7, pc} + 800f674: 080186a4 .word 0x080186a4 + 800f678: 080187f4 .word 0x080187f4 + 800f67c: 0801871c .word 0x0801871c + 800f680: 08018844 .word 0x08018844 + 800f684: 080187e4 .word 0x080187e4 + 800f688: 08018edc .word 0x08018edc + 800f68c: 20019228 .word 0x20019228 + 800f690: 20019138 .word 0x20019138 + +0800f694 : + * - ERR_ARG Non-unicast address given, those will not appear in ARP cache. + * + */ +err_t +etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q) +{ + 800f694: b580 push {r7, lr} + 800f696: b08c sub sp, #48 @ 0x30 + 800f698: af02 add r7, sp, #8 + 800f69a: 60f8 str r0, [r7, #12] + 800f69c: 60b9 str r1, [r7, #8] + 800f69e: 607a str r2, [r7, #4] + struct eth_addr *srcaddr = (struct eth_addr *)netif->hwaddr; + 800f6a0: 68fb ldr r3, [r7, #12] + 800f6a2: 332a adds r3, #42 @ 0x2a + 800f6a4: 617b str r3, [r7, #20] + err_t result = ERR_MEM; + 800f6a6: 23ff movs r3, #255 @ 0xff + 800f6a8: f887 3027 strb.w r3, [r7, #39] @ 0x27 + int is_new_entry = 0; + 800f6ac: 2300 movs r3, #0 + 800f6ae: 623b str r3, [r7, #32] + s16_t i_err; + netif_addr_idx_t i; + + /* non-unicast address? */ + if (ip4_addr_isbroadcast(ipaddr, netif) || + 800f6b0: 68bb ldr r3, [r7, #8] + 800f6b2: 681b ldr r3, [r3, #0] + 800f6b4: 68f9 ldr r1, [r7, #12] + 800f6b6: 4618 mov r0, r3 + 800f6b8: f000 fe2c bl 8010314 + 800f6bc: 4603 mov r3, r0 + 800f6be: 2b00 cmp r3, #0 + 800f6c0: d10c bne.n 800f6dc + ip4_addr_ismulticast(ipaddr) || + 800f6c2: 68bb ldr r3, [r7, #8] + 800f6c4: 681b ldr r3, [r3, #0] + 800f6c6: f003 03f0 and.w r3, r3, #240 @ 0xf0 + if (ip4_addr_isbroadcast(ipaddr, netif) || + 800f6ca: 2be0 cmp r3, #224 @ 0xe0 + 800f6cc: d006 beq.n 800f6dc + ip4_addr_ismulticast(ipaddr) || + 800f6ce: 68bb ldr r3, [r7, #8] + 800f6d0: 2b00 cmp r3, #0 + 800f6d2: d003 beq.n 800f6dc + ip4_addr_isany(ipaddr)) { + 800f6d4: 68bb ldr r3, [r7, #8] + 800f6d6: 681b ldr r3, [r3, #0] + 800f6d8: 2b00 cmp r3, #0 + 800f6da: d102 bne.n 800f6e2 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n")); + return ERR_ARG; + 800f6dc: f06f 030f mvn.w r3, #15 + 800f6e0: e101 b.n 800f8e6 + } + + /* find entry in ARP cache, ask to create entry if queueing packet */ + i_err = etharp_find_entry(ipaddr, ETHARP_FLAG_TRY_HARD, netif); + 800f6e2: 68fa ldr r2, [r7, #12] + 800f6e4: 2101 movs r1, #1 + 800f6e6: 68b8 ldr r0, [r7, #8] + 800f6e8: f7ff fb5c bl 800eda4 + 800f6ec: 4603 mov r3, r0 + 800f6ee: 827b strh r3, [r7, #18] + + /* could not find or create entry? */ + if (i_err < 0) { + 800f6f0: f9b7 3012 ldrsh.w r3, [r7, #18] + 800f6f4: 2b00 cmp r3, #0 + 800f6f6: da02 bge.n 800f6fe + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not create ARP entry\n")); + if (q) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: packet dropped\n")); + ETHARP_STATS_INC(etharp.memerr); + } + return (err_t)i_err; + 800f6f8: 8a7b ldrh r3, [r7, #18] + 800f6fa: b25b sxtb r3, r3 + 800f6fc: e0f3 b.n 800f8e6 + } + LWIP_ASSERT("type overflow", (size_t)i_err < NETIF_ADDR_IDX_MAX); + 800f6fe: 8a7b ldrh r3, [r7, #18] + 800f700: 2b7e cmp r3, #126 @ 0x7e + 800f702: d906 bls.n 800f712 + 800f704: 4b7a ldr r3, [pc, #488] @ (800f8f0 ) + 800f706: f240 32c1 movw r2, #961 @ 0x3c1 + 800f70a: 497a ldr r1, [pc, #488] @ (800f8f4 ) + 800f70c: 487a ldr r0, [pc, #488] @ (800f8f8 ) + 800f70e: f001 ff73 bl 80115f8 + i = (netif_addr_idx_t)i_err; + 800f712: 8a7b ldrh r3, [r7, #18] + 800f714: 747b strb r3, [r7, #17] + + /* mark a fresh entry as pending (we just sent a request) */ + if (arp_table[i].state == ETHARP_STATE_EMPTY) { + 800f716: 7c7a ldrb r2, [r7, #17] + 800f718: 4978 ldr r1, [pc, #480] @ (800f8fc ) + 800f71a: 4613 mov r3, r2 + 800f71c: 005b lsls r3, r3, #1 + 800f71e: 4413 add r3, r2 + 800f720: 00db lsls r3, r3, #3 + 800f722: 440b add r3, r1 + 800f724: 3314 adds r3, #20 + 800f726: 781b ldrb r3, [r3, #0] + 800f728: 2b00 cmp r3, #0 + 800f72a: d115 bne.n 800f758 + is_new_entry = 1; + 800f72c: 2301 movs r3, #1 + 800f72e: 623b str r3, [r7, #32] + arp_table[i].state = ETHARP_STATE_PENDING; + 800f730: 7c7a ldrb r2, [r7, #17] + 800f732: 4972 ldr r1, [pc, #456] @ (800f8fc ) + 800f734: 4613 mov r3, r2 + 800f736: 005b lsls r3, r3, #1 + 800f738: 4413 add r3, r2 + 800f73a: 00db lsls r3, r3, #3 + 800f73c: 440b add r3, r1 + 800f73e: 3314 adds r3, #20 + 800f740: 2201 movs r2, #1 + 800f742: 701a strb r2, [r3, #0] + /* record network interface for re-sending arp request in etharp_tmr */ + arp_table[i].netif = netif; + 800f744: 7c7a ldrb r2, [r7, #17] + 800f746: 496d ldr r1, [pc, #436] @ (800f8fc ) + 800f748: 4613 mov r3, r2 + 800f74a: 005b lsls r3, r3, #1 + 800f74c: 4413 add r3, r2 + 800f74e: 00db lsls r3, r3, #3 + 800f750: 440b add r3, r1 + 800f752: 3308 adds r3, #8 + 800f754: 68fa ldr r2, [r7, #12] + 800f756: 601a str r2, [r3, #0] + } + + /* { i is either a STABLE or (new or existing) PENDING entry } */ + LWIP_ASSERT("arp_table[i].state == PENDING or STABLE", + 800f758: 7c7a ldrb r2, [r7, #17] + 800f75a: 4968 ldr r1, [pc, #416] @ (800f8fc ) + 800f75c: 4613 mov r3, r2 + 800f75e: 005b lsls r3, r3, #1 + 800f760: 4413 add r3, r2 + 800f762: 00db lsls r3, r3, #3 + 800f764: 440b add r3, r1 + 800f766: 3314 adds r3, #20 + 800f768: 781b ldrb r3, [r3, #0] + 800f76a: 2b01 cmp r3, #1 + 800f76c: d011 beq.n 800f792 + 800f76e: 7c7a ldrb r2, [r7, #17] + 800f770: 4962 ldr r1, [pc, #392] @ (800f8fc ) + 800f772: 4613 mov r3, r2 + 800f774: 005b lsls r3, r3, #1 + 800f776: 4413 add r3, r2 + 800f778: 00db lsls r3, r3, #3 + 800f77a: 440b add r3, r1 + 800f77c: 3314 adds r3, #20 + 800f77e: 781b ldrb r3, [r3, #0] + 800f780: 2b01 cmp r3, #1 + 800f782: d806 bhi.n 800f792 + 800f784: 4b5a ldr r3, [pc, #360] @ (800f8f0 ) + 800f786: f240 32cd movw r2, #973 @ 0x3cd + 800f78a: 495d ldr r1, [pc, #372] @ (800f900 ) + 800f78c: 485a ldr r0, [pc, #360] @ (800f8f8 ) + 800f78e: f001 ff33 bl 80115f8 + ((arp_table[i].state == ETHARP_STATE_PENDING) || + (arp_table[i].state >= ETHARP_STATE_STABLE))); + + /* do we have a new entry? or an implicit query request? */ + if (is_new_entry || (q == NULL)) { + 800f792: 6a3b ldr r3, [r7, #32] + 800f794: 2b00 cmp r3, #0 + 800f796: d102 bne.n 800f79e + 800f798: 687b ldr r3, [r7, #4] + 800f79a: 2b00 cmp r3, #0 + 800f79c: d10c bne.n 800f7b8 + /* try to resolve it; send out ARP request */ + result = etharp_request(netif, ipaddr); + 800f79e: 68b9 ldr r1, [r7, #8] + 800f7a0: 68f8 ldr r0, [r7, #12] + 800f7a2: f000 f963 bl 800fa6c + 800f7a6: 4603 mov r3, r0 + 800f7a8: f887 3027 strb.w r3, [r7, #39] @ 0x27 + /* ARP request couldn't be sent */ + /* We don't re-send arp request in etharp_tmr, but we still queue packets, + since this failure could be temporary, and the next packet calling + etharp_query again could lead to sending the queued packets. */ + } + if (q == NULL) { + 800f7ac: 687b ldr r3, [r7, #4] + 800f7ae: 2b00 cmp r3, #0 + 800f7b0: d102 bne.n 800f7b8 + return result; + 800f7b2: f997 3027 ldrsb.w r3, [r7, #39] @ 0x27 + 800f7b6: e096 b.n 800f8e6 + } + } + + /* packet given? */ + LWIP_ASSERT("q != NULL", q != NULL); + 800f7b8: 687b ldr r3, [r7, #4] + 800f7ba: 2b00 cmp r3, #0 + 800f7bc: d106 bne.n 800f7cc + 800f7be: 4b4c ldr r3, [pc, #304] @ (800f8f0 ) + 800f7c0: f240 32e1 movw r2, #993 @ 0x3e1 + 800f7c4: 494f ldr r1, [pc, #316] @ (800f904 ) + 800f7c6: 484c ldr r0, [pc, #304] @ (800f8f8 ) + 800f7c8: f001 ff16 bl 80115f8 + /* stable entry? */ + if (arp_table[i].state >= ETHARP_STATE_STABLE) { + 800f7cc: 7c7a ldrb r2, [r7, #17] + 800f7ce: 494b ldr r1, [pc, #300] @ (800f8fc ) + 800f7d0: 4613 mov r3, r2 + 800f7d2: 005b lsls r3, r3, #1 + 800f7d4: 4413 add r3, r2 + 800f7d6: 00db lsls r3, r3, #3 + 800f7d8: 440b add r3, r1 + 800f7da: 3314 adds r3, #20 + 800f7dc: 781b ldrb r3, [r3, #0] + 800f7de: 2b01 cmp r3, #1 + 800f7e0: d917 bls.n 800f812 + /* we have a valid IP->Ethernet address mapping */ + ETHARP_SET_ADDRHINT(netif, i); + 800f7e2: 4a49 ldr r2, [pc, #292] @ (800f908 ) + 800f7e4: 7c7b ldrb r3, [r7, #17] + 800f7e6: 7013 strb r3, [r2, #0] + /* send the packet */ + result = ethernet_output(netif, q, srcaddr, &(arp_table[i].ethaddr), ETHTYPE_IP); + 800f7e8: 7c7a ldrb r2, [r7, #17] + 800f7ea: 4613 mov r3, r2 + 800f7ec: 005b lsls r3, r3, #1 + 800f7ee: 4413 add r3, r2 + 800f7f0: 00db lsls r3, r3, #3 + 800f7f2: 3308 adds r3, #8 + 800f7f4: 4a41 ldr r2, [pc, #260] @ (800f8fc ) + 800f7f6: 4413 add r3, r2 + 800f7f8: 3304 adds r3, #4 + 800f7fa: f44f 6200 mov.w r2, #2048 @ 0x800 + 800f7fe: 9200 str r2, [sp, #0] + 800f800: 697a ldr r2, [r7, #20] + 800f802: 6879 ldr r1, [r7, #4] + 800f804: 68f8 ldr r0, [r7, #12] + 800f806: f001 fdd1 bl 80113ac + 800f80a: 4603 mov r3, r0 + 800f80c: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 800f810: e067 b.n 800f8e2 + /* pending entry? (either just created or already pending */ + } else if (arp_table[i].state == ETHARP_STATE_PENDING) { + 800f812: 7c7a ldrb r2, [r7, #17] + 800f814: 4939 ldr r1, [pc, #228] @ (800f8fc ) + 800f816: 4613 mov r3, r2 + 800f818: 005b lsls r3, r3, #1 + 800f81a: 4413 add r3, r2 + 800f81c: 00db lsls r3, r3, #3 + 800f81e: 440b add r3, r1 + 800f820: 3314 adds r3, #20 + 800f822: 781b ldrb r3, [r3, #0] + 800f824: 2b01 cmp r3, #1 + 800f826: d15c bne.n 800f8e2 + /* entry is still pending, queue the given packet 'q' */ + struct pbuf *p; + int copy_needed = 0; + 800f828: 2300 movs r3, #0 + 800f82a: 61bb str r3, [r7, #24] + /* IF q includes a pbuf that must be copied, copy the whole chain into a + * new PBUF_RAM. See the definition of PBUF_NEEDS_COPY for details. */ + p = q; + 800f82c: 687b ldr r3, [r7, #4] + 800f82e: 61fb str r3, [r7, #28] + while (p) { + 800f830: e01c b.n 800f86c + LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0)); + 800f832: 69fb ldr r3, [r7, #28] + 800f834: 895a ldrh r2, [r3, #10] + 800f836: 69fb ldr r3, [r7, #28] + 800f838: 891b ldrh r3, [r3, #8] + 800f83a: 429a cmp r2, r3 + 800f83c: d10a bne.n 800f854 + 800f83e: 69fb ldr r3, [r7, #28] + 800f840: 681b ldr r3, [r3, #0] + 800f842: 2b00 cmp r3, #0 + 800f844: d006 beq.n 800f854 + 800f846: 4b2a ldr r3, [pc, #168] @ (800f8f0 ) + 800f848: f240 32f1 movw r2, #1009 @ 0x3f1 + 800f84c: 492f ldr r1, [pc, #188] @ (800f90c ) + 800f84e: 482a ldr r0, [pc, #168] @ (800f8f8 ) + 800f850: f001 fed2 bl 80115f8 + if (PBUF_NEEDS_COPY(p)) { + 800f854: 69fb ldr r3, [r7, #28] + 800f856: 7b1b ldrb r3, [r3, #12] + 800f858: f003 0340 and.w r3, r3, #64 @ 0x40 + 800f85c: 2b00 cmp r3, #0 + 800f85e: d002 beq.n 800f866 + copy_needed = 1; + 800f860: 2301 movs r3, #1 + 800f862: 61bb str r3, [r7, #24] + break; + 800f864: e005 b.n 800f872 + } + p = p->next; + 800f866: 69fb ldr r3, [r7, #28] + 800f868: 681b ldr r3, [r3, #0] + 800f86a: 61fb str r3, [r7, #28] + while (p) { + 800f86c: 69fb ldr r3, [r7, #28] + 800f86e: 2b00 cmp r3, #0 + 800f870: d1df bne.n 800f832 + } + if (copy_needed) { + 800f872: 69bb ldr r3, [r7, #24] + 800f874: 2b00 cmp r3, #0 + 800f876: d007 beq.n 800f888 + /* copy the whole packet into new pbufs */ + p = pbuf_clone(PBUF_LINK, PBUF_RAM, q); + 800f878: 687a ldr r2, [r7, #4] + 800f87a: f44f 7120 mov.w r1, #640 @ 0x280 + 800f87e: 200e movs r0, #14 + 800f880: f7f7 fb3e bl 8006f00 + 800f884: 61f8 str r0, [r7, #28] + 800f886: e004 b.n 800f892 + } else { + /* referencing the old pbuf is enough */ + p = q; + 800f888: 687b ldr r3, [r7, #4] + 800f88a: 61fb str r3, [r7, #28] + pbuf_ref(p); + 800f88c: 69f8 ldr r0, [r7, #28] + 800f88e: f7f7 f96b bl 8006b68 + } + /* packet could be taken over? */ + if (p != NULL) { + 800f892: 69fb ldr r3, [r7, #28] + 800f894: 2b00 cmp r3, #0 + 800f896: d021 beq.n 800f8dc + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q)); + result = ERR_MEM; + } +#else /* ARP_QUEUEING */ + /* always queue one packet per ARP request only, freeing a previously queued packet */ + if (arp_table[i].q != NULL) { + 800f898: 7c7a ldrb r2, [r7, #17] + 800f89a: 4918 ldr r1, [pc, #96] @ (800f8fc ) + 800f89c: 4613 mov r3, r2 + 800f89e: 005b lsls r3, r3, #1 + 800f8a0: 4413 add r3, r2 + 800f8a2: 00db lsls r3, r3, #3 + 800f8a4: 440b add r3, r1 + 800f8a6: 681b ldr r3, [r3, #0] + 800f8a8: 2b00 cmp r3, #0 + 800f8aa: d00a beq.n 800f8c2 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: dropped previously queued packet %p for ARP entry %"U16_F"\n", (void *)q, (u16_t)i)); + pbuf_free(arp_table[i].q); + 800f8ac: 7c7a ldrb r2, [r7, #17] + 800f8ae: 4913 ldr r1, [pc, #76] @ (800f8fc ) + 800f8b0: 4613 mov r3, r2 + 800f8b2: 005b lsls r3, r3, #1 + 800f8b4: 4413 add r3, r2 + 800f8b6: 00db lsls r3, r3, #3 + 800f8b8: 440b add r3, r1 + 800f8ba: 681b ldr r3, [r3, #0] + 800f8bc: 4618 mov r0, r3 + 800f8be: f7f7 f8b3 bl 8006a28 + } + arp_table[i].q = p; + 800f8c2: 7c7a ldrb r2, [r7, #17] + 800f8c4: 490d ldr r1, [pc, #52] @ (800f8fc ) + 800f8c6: 4613 mov r3, r2 + 800f8c8: 005b lsls r3, r3, #1 + 800f8ca: 4413 add r3, r2 + 800f8cc: 00db lsls r3, r3, #3 + 800f8ce: 440b add r3, r1 + 800f8d0: 69fa ldr r2, [r7, #28] + 800f8d2: 601a str r2, [r3, #0] + result = ERR_OK; + 800f8d4: 2300 movs r3, #0 + 800f8d6: f887 3027 strb.w r3, [r7, #39] @ 0x27 + 800f8da: e002 b.n 800f8e2 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"U16_F"\n", (void *)q, (u16_t)i)); +#endif /* ARP_QUEUEING */ + } else { + ETHARP_STATS_INC(etharp.memerr); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q)); + result = ERR_MEM; + 800f8dc: 23ff movs r3, #255 @ 0xff + 800f8de: f887 3027 strb.w r3, [r7, #39] @ 0x27 + } + } + return result; + 800f8e2: f997 3027 ldrsb.w r3, [r7, #39] @ 0x27 +} + 800f8e6: 4618 mov r0, r3 + 800f8e8: 3728 adds r7, #40 @ 0x28 + 800f8ea: 46bd mov sp, r7 + 800f8ec: bd80 pop {r7, pc} + 800f8ee: bf00 nop + 800f8f0: 080186a4 .word 0x080186a4 + 800f8f4: 08018850 .word 0x08018850 + 800f8f8: 0801871c .word 0x0801871c + 800f8fc: 20019138 .word 0x20019138 + 800f900: 08018860 .word 0x08018860 + 800f904: 08018844 .word 0x08018844 + 800f908: 20019228 .word 0x20019228 + 800f90c: 08018888 .word 0x08018888 + +0800f910 : +etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr, + const struct eth_addr *ethdst_addr, + const struct eth_addr *hwsrc_addr, const ip4_addr_t *ipsrc_addr, + const struct eth_addr *hwdst_addr, const ip4_addr_t *ipdst_addr, + const u16_t opcode) +{ + 800f910: b580 push {r7, lr} + 800f912: b08a sub sp, #40 @ 0x28 + 800f914: af02 add r7, sp, #8 + 800f916: 60f8 str r0, [r7, #12] + 800f918: 60b9 str r1, [r7, #8] + 800f91a: 607a str r2, [r7, #4] + 800f91c: 603b str r3, [r7, #0] + struct pbuf *p; + err_t result = ERR_OK; + 800f91e: 2300 movs r3, #0 + 800f920: 77fb strb r3, [r7, #31] + struct etharp_hdr *hdr; + + LWIP_ASSERT("netif != NULL", netif != NULL); + 800f922: 68fb ldr r3, [r7, #12] + 800f924: 2b00 cmp r3, #0 + 800f926: d106 bne.n 800f936 + 800f928: 4b3a ldr r3, [pc, #232] @ (800fa14 ) + 800f92a: f240 4257 movw r2, #1111 @ 0x457 + 800f92e: 493a ldr r1, [pc, #232] @ (800fa18 ) + 800f930: 483a ldr r0, [pc, #232] @ (800fa1c ) + 800f932: f001 fe61 bl 80115f8 + + /* allocate a pbuf for the outgoing ARP request packet */ + p = pbuf_alloc(PBUF_LINK, SIZEOF_ETHARP_HDR, PBUF_RAM); + 800f936: f44f 7220 mov.w r2, #640 @ 0x280 + 800f93a: 211c movs r1, #28 + 800f93c: 200e movs r0, #14 + 800f93e: f7f6 fd91 bl 8006464 + 800f942: 61b8 str r0, [r7, #24] + /* could allocate a pbuf for an ARP request? */ + if (p == NULL) { + 800f944: 69bb ldr r3, [r7, #24] + 800f946: 2b00 cmp r3, #0 + 800f948: d102 bne.n 800f950 + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("etharp_raw: could not allocate pbuf for ARP request.\n")); + ETHARP_STATS_INC(etharp.memerr); + return ERR_MEM; + 800f94a: f04f 33ff mov.w r3, #4294967295 + 800f94e: e05d b.n 800fa0c + } + LWIP_ASSERT("check that first pbuf can hold struct etharp_hdr", + 800f950: 69bb ldr r3, [r7, #24] + 800f952: 895b ldrh r3, [r3, #10] + 800f954: 2b1b cmp r3, #27 + 800f956: d806 bhi.n 800f966 + 800f958: 4b2e ldr r3, [pc, #184] @ (800fa14 ) + 800f95a: f240 4262 movw r2, #1122 @ 0x462 + 800f95e: 4930 ldr r1, [pc, #192] @ (800fa20 ) + 800f960: 482e ldr r0, [pc, #184] @ (800fa1c ) + 800f962: f001 fe49 bl 80115f8 + (p->len >= SIZEOF_ETHARP_HDR)); + + hdr = (struct etharp_hdr *)p->payload; + 800f966: 69bb ldr r3, [r7, #24] + 800f968: 685b ldr r3, [r3, #4] + 800f96a: 617b str r3, [r7, #20] + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n")); + hdr->opcode = lwip_htons(opcode); + 800f96c: 8ebb ldrh r3, [r7, #52] @ 0x34 + 800f96e: 4618 mov r0, r3 + 800f970: f7f5 fd0a bl 8005388 + 800f974: 4603 mov r3, r0 + 800f976: 461a mov r2, r3 + 800f978: 697b ldr r3, [r7, #20] + 800f97a: 80da strh r2, [r3, #6] + + LWIP_ASSERT("netif->hwaddr_len must be the same as ETH_HWADDR_LEN for etharp!", + 800f97c: 68fb ldr r3, [r7, #12] + 800f97e: f893 3030 ldrb.w r3, [r3, #48] @ 0x30 + 800f982: 2b06 cmp r3, #6 + 800f984: d006 beq.n 800f994 + 800f986: 4b23 ldr r3, [pc, #140] @ (800fa14 ) + 800f988: f240 4269 movw r2, #1129 @ 0x469 + 800f98c: 4925 ldr r1, [pc, #148] @ (800fa24 ) + 800f98e: 4823 ldr r0, [pc, #140] @ (800fa1c ) + 800f990: f001 fe32 bl 80115f8 + (netif->hwaddr_len == ETH_HWADDR_LEN)); + + /* Write the ARP MAC-Addresses */ + SMEMCPY(&hdr->shwaddr, hwsrc_addr, ETH_HWADDR_LEN); + 800f994: 697b ldr r3, [r7, #20] + 800f996: 3308 adds r3, #8 + 800f998: 2206 movs r2, #6 + 800f99a: 6839 ldr r1, [r7, #0] + 800f99c: 4618 mov r0, r3 + 800f99e: f001 ff27 bl 80117f0 + SMEMCPY(&hdr->dhwaddr, hwdst_addr, ETH_HWADDR_LEN); + 800f9a2: 697b ldr r3, [r7, #20] + 800f9a4: 3312 adds r3, #18 + 800f9a6: 2206 movs r2, #6 + 800f9a8: 6af9 ldr r1, [r7, #44] @ 0x2c + 800f9aa: 4618 mov r0, r3 + 800f9ac: f001 ff20 bl 80117f0 + /* Copy struct ip4_addr_wordaligned to aligned ip4_addr, to support compilers without + * structure packing. */ + IPADDR_WORDALIGNED_COPY_FROM_IP4_ADDR_T(&hdr->sipaddr, ipsrc_addr); + 800f9b0: 697b ldr r3, [r7, #20] + 800f9b2: 330e adds r3, #14 + 800f9b4: 6aba ldr r2, [r7, #40] @ 0x28 + 800f9b6: 6812 ldr r2, [r2, #0] + 800f9b8: 601a str r2, [r3, #0] + IPADDR_WORDALIGNED_COPY_FROM_IP4_ADDR_T(&hdr->dipaddr, ipdst_addr); + 800f9ba: 697b ldr r3, [r7, #20] + 800f9bc: 3318 adds r3, #24 + 800f9be: 6b3a ldr r2, [r7, #48] @ 0x30 + 800f9c0: 6812 ldr r2, [r2, #0] + 800f9c2: 601a str r2, [r3, #0] + + hdr->hwtype = PP_HTONS(LWIP_IANA_HWTYPE_ETHERNET); + 800f9c4: 697b ldr r3, [r7, #20] + 800f9c6: 2200 movs r2, #0 + 800f9c8: 701a strb r2, [r3, #0] + 800f9ca: 2200 movs r2, #0 + 800f9cc: f042 0201 orr.w r2, r2, #1 + 800f9d0: 705a strb r2, [r3, #1] + hdr->proto = PP_HTONS(ETHTYPE_IP); + 800f9d2: 697b ldr r3, [r7, #20] + 800f9d4: 2200 movs r2, #0 + 800f9d6: f042 0208 orr.w r2, r2, #8 + 800f9da: 709a strb r2, [r3, #2] + 800f9dc: 2200 movs r2, #0 + 800f9de: 70da strb r2, [r3, #3] + /* set hwlen and protolen */ + hdr->hwlen = ETH_HWADDR_LEN; + 800f9e0: 697b ldr r3, [r7, #20] + 800f9e2: 2206 movs r2, #6 + 800f9e4: 711a strb r2, [r3, #4] + hdr->protolen = sizeof(ip4_addr_t); + 800f9e6: 697b ldr r3, [r7, #20] + 800f9e8: 2204 movs r2, #4 + 800f9ea: 715a strb r2, [r3, #5] + if (ip4_addr_islinklocal(ipsrc_addr)) { + ethernet_output(netif, p, ethsrc_addr, ðbroadcast, ETHTYPE_ARP); + } else +#endif /* LWIP_AUTOIP */ + { + ethernet_output(netif, p, ethsrc_addr, ethdst_addr, ETHTYPE_ARP); + 800f9ec: f640 0306 movw r3, #2054 @ 0x806 + 800f9f0: 9300 str r3, [sp, #0] + 800f9f2: 687b ldr r3, [r7, #4] + 800f9f4: 68ba ldr r2, [r7, #8] + 800f9f6: 69b9 ldr r1, [r7, #24] + 800f9f8: 68f8 ldr r0, [r7, #12] + 800f9fa: f001 fcd7 bl 80113ac + } + + ETHARP_STATS_INC(etharp.xmit); + /* free ARP query packet */ + pbuf_free(p); + 800f9fe: 69b8 ldr r0, [r7, #24] + 800fa00: f7f7 f812 bl 8006a28 + p = NULL; + 800fa04: 2300 movs r3, #0 + 800fa06: 61bb str r3, [r7, #24] + /* could not allocate pbuf for ARP request */ + + return result; + 800fa08: f997 301f ldrsb.w r3, [r7, #31] +} + 800fa0c: 4618 mov r0, r3 + 800fa0e: 3720 adds r7, #32 + 800fa10: 46bd mov sp, r7 + 800fa12: bd80 pop {r7, pc} + 800fa14: 080186a4 .word 0x080186a4 + 800fa18: 080187f4 .word 0x080187f4 + 800fa1c: 0801871c .word 0x0801871c + 800fa20: 080188a4 .word 0x080188a4 + 800fa24: 080188d8 .word 0x080188d8 + +0800fa28 : + * ERR_MEM if the ARP packet couldn't be allocated + * any other err_t on failure + */ +static err_t +etharp_request_dst(struct netif *netif, const ip4_addr_t *ipaddr, const struct eth_addr *hw_dst_addr) +{ + 800fa28: b580 push {r7, lr} + 800fa2a: b088 sub sp, #32 + 800fa2c: af04 add r7, sp, #16 + 800fa2e: 60f8 str r0, [r7, #12] + 800fa30: 60b9 str r1, [r7, #8] + 800fa32: 607a str r2, [r7, #4] + return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, hw_dst_addr, + 800fa34: 68fb ldr r3, [r7, #12] + 800fa36: f103 012a add.w r1, r3, #42 @ 0x2a + (struct eth_addr *)netif->hwaddr, netif_ip4_addr(netif), ðzero, + 800fa3a: 68fb ldr r3, [r7, #12] + 800fa3c: f103 002a add.w r0, r3, #42 @ 0x2a + 800fa40: 68fb ldr r3, [r7, #12] + 800fa42: 3304 adds r3, #4 + return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, hw_dst_addr, + 800fa44: 2201 movs r2, #1 + 800fa46: 9203 str r2, [sp, #12] + 800fa48: 68ba ldr r2, [r7, #8] + 800fa4a: 9202 str r2, [sp, #8] + 800fa4c: 4a06 ldr r2, [pc, #24] @ (800fa68 ) + 800fa4e: 9201 str r2, [sp, #4] + 800fa50: 9300 str r3, [sp, #0] + 800fa52: 4603 mov r3, r0 + 800fa54: 687a ldr r2, [r7, #4] + 800fa56: 68f8 ldr r0, [r7, #12] + 800fa58: f7ff ff5a bl 800f910 + 800fa5c: 4603 mov r3, r0 + ipaddr, ARP_REQUEST); +} + 800fa5e: 4618 mov r0, r3 + 800fa60: 3710 adds r7, #16 + 800fa62: 46bd mov sp, r7 + 800fa64: bd80 pop {r7, pc} + 800fa66: bf00 nop + 800fa68: 08018ee4 .word 0x08018ee4 + +0800fa6c : + * ERR_MEM if the ARP packet couldn't be allocated + * any other err_t on failure + */ +err_t +etharp_request(struct netif *netif, const ip4_addr_t *ipaddr) +{ + 800fa6c: b580 push {r7, lr} + 800fa6e: b082 sub sp, #8 + 800fa70: af00 add r7, sp, #0 + 800fa72: 6078 str r0, [r7, #4] + 800fa74: 6039 str r1, [r7, #0] + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n")); + return etharp_request_dst(netif, ipaddr, ðbroadcast); + 800fa76: 4a05 ldr r2, [pc, #20] @ (800fa8c ) + 800fa78: 6839 ldr r1, [r7, #0] + 800fa7a: 6878 ldr r0, [r7, #4] + 800fa7c: f7ff ffd4 bl 800fa28 + 800fa80: 4603 mov r3, r0 +} + 800fa82: 4618 mov r0, r3 + 800fa84: 3708 adds r7, #8 + 800fa86: 46bd mov sp, r7 + 800fa88: bd80 pop {r7, pc} + 800fa8a: bf00 nop + 800fa8c: 08018edc .word 0x08018edc + +0800fa90 : + * @param p the icmp echo request packet, p->payload pointing to the icmp header + * @param inp the netif on which this packet was received + */ +void +icmp_input(struct pbuf *p, struct netif *inp) +{ + 800fa90: b580 push {r7, lr} + 800fa92: b08e sub sp, #56 @ 0x38 + 800fa94: af04 add r7, sp, #16 + 800fa96: 6078 str r0, [r7, #4] + 800fa98: 6039 str r1, [r7, #0] + const ip4_addr_t *src; + + ICMP_STATS_INC(icmp.recv); + MIB2_STATS_INC(mib2.icmpinmsgs); + + iphdr_in = ip4_current_header(); + 800fa9a: 4b79 ldr r3, [pc, #484] @ (800fc80 ) + 800fa9c: 689b ldr r3, [r3, #8] + 800fa9e: 627b str r3, [r7, #36] @ 0x24 + hlen = IPH_HL_BYTES(iphdr_in); + 800faa0: 6a7b ldr r3, [r7, #36] @ 0x24 + 800faa2: 781b ldrb r3, [r3, #0] + 800faa4: f003 030f and.w r3, r3, #15 + 800faa8: b2db uxtb r3, r3 + 800faaa: 009b lsls r3, r3, #2 + 800faac: b2db uxtb r3, r3 + 800faae: 847b strh r3, [r7, #34] @ 0x22 + if (hlen < IP_HLEN) { + 800fab0: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fab2: 2b13 cmp r3, #19 + 800fab4: f240 80cd bls.w 800fc52 + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: short IP header (%"S16_F" bytes) received\n", hlen)); + goto lenerr; + } + if (p->len < sizeof(u16_t) * 2) { + 800fab8: 687b ldr r3, [r7, #4] + 800faba: 895b ldrh r3, [r3, #10] + 800fabc: 2b03 cmp r3, #3 + 800fabe: f240 80ca bls.w 800fc56 + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: short ICMP (%"U16_F" bytes) received\n", p->tot_len)); + goto lenerr; + } + + type = *((u8_t *)p->payload); + 800fac2: 687b ldr r3, [r7, #4] + 800fac4: 685b ldr r3, [r3, #4] + 800fac6: 781b ldrb r3, [r3, #0] + 800fac8: f887 3021 strb.w r3, [r7, #33] @ 0x21 +#ifdef LWIP_DEBUG + code = *(((u8_t *)p->payload) + 1); + /* if debug is enabled but debug statement below is somehow disabled: */ + LWIP_UNUSED_ARG(code); +#endif /* LWIP_DEBUG */ + switch (type) { + 800facc: f897 3021 ldrb.w r3, [r7, #33] @ 0x21 + 800fad0: 2b00 cmp r3, #0 + 800fad2: f000 80b7 beq.w 800fc44 + 800fad6: 2b08 cmp r3, #8 + 800fad8: f040 80b7 bne.w 800fc4a + (as obviously, an echo request has been sent, too). */ + MIB2_STATS_INC(mib2.icmpinechoreps); + break; + case ICMP_ECHO: + MIB2_STATS_INC(mib2.icmpinechos); + src = ip4_current_dest_addr(); + 800fadc: 4b69 ldr r3, [pc, #420] @ (800fc84 ) + 800fade: 61fb str r3, [r7, #28] + /* multicast destination address? */ + if (ip4_addr_ismulticast(ip4_current_dest_addr())) { + 800fae0: 4b67 ldr r3, [pc, #412] @ (800fc80 ) + 800fae2: 695b ldr r3, [r3, #20] + 800fae4: f003 03f0 and.w r3, r3, #240 @ 0xf0 + 800fae8: 2be0 cmp r3, #224 @ 0xe0 + 800faea: f000 80bb beq.w 800fc64 + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast pings\n")); + goto icmperr; +#endif /* LWIP_MULTICAST_PING */ + } + /* broadcast destination address? */ + if (ip4_addr_isbroadcast(ip4_current_dest_addr(), ip_current_netif())) { + 800faee: 4b64 ldr r3, [pc, #400] @ (800fc80 ) + 800faf0: 695b ldr r3, [r3, #20] + 800faf2: 4a63 ldr r2, [pc, #396] @ (800fc80 ) + 800faf4: 6812 ldr r2, [r2, #0] + 800faf6: 4611 mov r1, r2 + 800faf8: 4618 mov r0, r3 + 800fafa: f000 fc0b bl 8010314 + 800fafe: 4603 mov r3, r0 + 800fb00: 2b00 cmp r3, #0 + 800fb02: f040 80b1 bne.w 800fc68 + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to broadcast pings\n")); + goto icmperr; +#endif /* LWIP_BROADCAST_PING */ + } + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n")); + if (p->tot_len < sizeof(struct icmp_echo_hdr)) { + 800fb06: 687b ldr r3, [r7, #4] + 800fb08: 891b ldrh r3, [r3, #8] + 800fb0a: 2b07 cmp r3, #7 + 800fb0c: f240 80a5 bls.w 800fc5a + return; + } + } +#endif +#if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN + if (pbuf_add_header(p, hlen + PBUF_LINK_HLEN + PBUF_LINK_ENCAPSULATION_HLEN)) { + 800fb10: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fb12: 330e adds r3, #14 + 800fb14: 4619 mov r1, r3 + 800fb16: 6878 ldr r0, [r7, #4] + 800fb18: f7f6 fef0 bl 80068fc + 800fb1c: 4603 mov r3, r0 + 800fb1e: 2b00 cmp r3, #0 + 800fb20: d04b beq.n 800fbba + /* p is not big enough to contain link headers + * allocate a new one and copy p into it + */ + struct pbuf *r; + u16_t alloc_len = (u16_t)(p->tot_len + hlen); + 800fb22: 687b ldr r3, [r7, #4] + 800fb24: 891a ldrh r2, [r3, #8] + 800fb26: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fb28: 4413 add r3, r2 + 800fb2a: 837b strh r3, [r7, #26] + if (alloc_len < p->tot_len) { + 800fb2c: 687b ldr r3, [r7, #4] + 800fb2e: 891b ldrh r3, [r3, #8] + 800fb30: 8b7a ldrh r2, [r7, #26] + 800fb32: 429a cmp r2, r3 + 800fb34: f0c0 809a bcc.w 800fc6c + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: allocating new pbuf failed (tot_len overflow)\n")); + goto icmperr; + } + /* allocate new packet buffer with space for link headers */ + r = pbuf_alloc(PBUF_LINK, alloc_len, PBUF_RAM); + 800fb38: 8b7b ldrh r3, [r7, #26] + 800fb3a: f44f 7220 mov.w r2, #640 @ 0x280 + 800fb3e: 4619 mov r1, r3 + 800fb40: 200e movs r0, #14 + 800fb42: f7f6 fc8f bl 8006464 + 800fb46: 6178 str r0, [r7, #20] + if (r == NULL) { + 800fb48: 697b ldr r3, [r7, #20] + 800fb4a: 2b00 cmp r3, #0 + 800fb4c: f000 8090 beq.w 800fc70 + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: allocating new pbuf failed\n")); + goto icmperr; + } + if (r->len < hlen + sizeof(struct icmp_echo_hdr)) { + 800fb50: 697b ldr r3, [r7, #20] + 800fb52: 895b ldrh r3, [r3, #10] + 800fb54: 461a mov r2, r3 + 800fb56: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fb58: 3308 adds r3, #8 + 800fb5a: 429a cmp r2, r3 + 800fb5c: d203 bcs.n 800fb66 + LWIP_DEBUGF(ICMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("first pbuf cannot hold the ICMP header")); + pbuf_free(r); + 800fb5e: 6978 ldr r0, [r7, #20] + 800fb60: f7f6 ff62 bl 8006a28 + goto icmperr; + 800fb64: e085 b.n 800fc72 + } + /* copy the ip header */ + MEMCPY(r->payload, iphdr_in, hlen); + 800fb66: 697b ldr r3, [r7, #20] + 800fb68: 685b ldr r3, [r3, #4] + 800fb6a: 8c7a ldrh r2, [r7, #34] @ 0x22 + 800fb6c: 6a79 ldr r1, [r7, #36] @ 0x24 + 800fb6e: 4618 mov r0, r3 + 800fb70: f001 fe3e bl 80117f0 + /* switch r->payload back to icmp header (cannot fail) */ + if (pbuf_remove_header(r, hlen)) { + 800fb74: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fb76: 4619 mov r1, r3 + 800fb78: 6978 ldr r0, [r7, #20] + 800fb7a: f7f6 fecf bl 800691c + 800fb7e: 4603 mov r3, r0 + 800fb80: 2b00 cmp r3, #0 + 800fb82: d009 beq.n 800fb98 + LWIP_ASSERT("icmp_input: moving r->payload to icmp header failed\n", 0); + 800fb84: 4b40 ldr r3, [pc, #256] @ (800fc88 ) + 800fb86: 22b6 movs r2, #182 @ 0xb6 + 800fb88: 4940 ldr r1, [pc, #256] @ (800fc8c ) + 800fb8a: 4841 ldr r0, [pc, #260] @ (800fc90 ) + 800fb8c: f001 fd34 bl 80115f8 + pbuf_free(r); + 800fb90: 6978 ldr r0, [r7, #20] + 800fb92: f7f6 ff49 bl 8006a28 + goto icmperr; + 800fb96: e06c b.n 800fc72 + } + /* copy the rest of the packet without ip header */ + if (pbuf_copy(r, p) != ERR_OK) { + 800fb98: 6879 ldr r1, [r7, #4] + 800fb9a: 6978 ldr r0, [r7, #20] + 800fb9c: f7f7 f86c bl 8006c78 + 800fba0: 4603 mov r3, r0 + 800fba2: 2b00 cmp r3, #0 + 800fba4: d003 beq.n 800fbae + LWIP_DEBUGF(ICMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("icmp_input: copying to new pbuf failed")); + pbuf_free(r); + 800fba6: 6978 ldr r0, [r7, #20] + 800fba8: f7f6 ff3e bl 8006a28 + goto icmperr; + 800fbac: e061 b.n 800fc72 + } + /* free the original p */ + pbuf_free(p); + 800fbae: 6878 ldr r0, [r7, #4] + 800fbb0: f7f6 ff3a bl 8006a28 + /* we now have an identical copy of p that has room for link headers */ + p = r; + 800fbb4: 697b ldr r3, [r7, #20] + 800fbb6: 607b str r3, [r7, #4] + 800fbb8: e00f b.n 800fbda + } else { + /* restore p->payload to point to icmp header (cannot fail) */ + if (pbuf_remove_header(p, hlen + PBUF_LINK_HLEN + PBUF_LINK_ENCAPSULATION_HLEN)) { + 800fbba: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fbbc: 330e adds r3, #14 + 800fbbe: 4619 mov r1, r3 + 800fbc0: 6878 ldr r0, [r7, #4] + 800fbc2: f7f6 feab bl 800691c + 800fbc6: 4603 mov r3, r0 + 800fbc8: 2b00 cmp r3, #0 + 800fbca: d006 beq.n 800fbda + LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0); + 800fbcc: 4b2e ldr r3, [pc, #184] @ (800fc88 ) + 800fbce: 22c7 movs r2, #199 @ 0xc7 + 800fbd0: 4930 ldr r1, [pc, #192] @ (800fc94 ) + 800fbd2: 482f ldr r0, [pc, #188] @ (800fc90 ) + 800fbd4: f001 fd10 bl 80115f8 + goto icmperr; + 800fbd8: e04b b.n 800fc72 + } +#endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */ + /* At this point, all checks are OK. */ + /* We generate an answer by switching the dest and src ip addresses, + * setting the icmp type to ECHO_RESPONSE and updating the checksum. */ + iecho = (struct icmp_echo_hdr *)p->payload; + 800fbda: 687b ldr r3, [r7, #4] + 800fbdc: 685b ldr r3, [r3, #4] + 800fbde: 613b str r3, [r7, #16] + if (pbuf_add_header(p, hlen)) { + 800fbe0: 8c7b ldrh r3, [r7, #34] @ 0x22 + 800fbe2: 4619 mov r1, r3 + 800fbe4: 6878 ldr r0, [r7, #4] + 800fbe6: f7f6 fe89 bl 80068fc + 800fbea: 4603 mov r3, r0 + 800fbec: 2b00 cmp r3, #0 + 800fbee: d12b bne.n 800fc48 + LWIP_DEBUGF(ICMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Can't move over header in packet")); + } else { + err_t ret; + struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; + 800fbf0: 687b ldr r3, [r7, #4] + 800fbf2: 685b ldr r3, [r3, #4] + 800fbf4: 60fb str r3, [r7, #12] + ip4_addr_copy(iphdr->src, *src); + 800fbf6: 69fb ldr r3, [r7, #28] + 800fbf8: 681a ldr r2, [r3, #0] + 800fbfa: 68fb ldr r3, [r7, #12] + 800fbfc: 60da str r2, [r3, #12] + ip4_addr_copy(iphdr->dest, *ip4_current_src_addr()); + 800fbfe: 4b20 ldr r3, [pc, #128] @ (800fc80 ) + 800fc00: 691a ldr r2, [r3, #16] + 800fc02: 68fb ldr r3, [r7, #12] + 800fc04: 611a str r2, [r3, #16] + ICMPH_TYPE_SET(iecho, ICMP_ER); + 800fc06: 693b ldr r3, [r7, #16] + 800fc08: 2200 movs r2, #0 + 800fc0a: 701a strb r2, [r3, #0] + else { + iecho->chksum = 0; + } +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ +#else /* CHECKSUM_GEN_ICMP */ + iecho->chksum = 0; + 800fc0c: 693b ldr r3, [r7, #16] + 800fc0e: 2200 movs r2, #0 + 800fc10: 709a strb r2, [r3, #2] + 800fc12: 2200 movs r2, #0 + 800fc14: 70da strb r2, [r3, #3] +#endif /* CHECKSUM_GEN_ICMP */ + + /* Set the correct TTL and recalculate the header checksum. */ + IPH_TTL_SET(iphdr, ICMP_TTL); + 800fc16: 68fb ldr r3, [r7, #12] + 800fc18: 22ff movs r2, #255 @ 0xff + 800fc1a: 721a strb r2, [r3, #8] + IPH_CHKSUM_SET(iphdr, 0); + 800fc1c: 68fb ldr r3, [r7, #12] + 800fc1e: 2200 movs r2, #0 + 800fc20: 729a strb r2, [r3, #10] + 800fc22: 2200 movs r2, #0 + 800fc24: 72da strb r2, [r3, #11] + MIB2_STATS_INC(mib2.icmpoutmsgs); + /* increase number of echo replies attempted to send */ + MIB2_STATS_INC(mib2.icmpoutechoreps); + + /* send an ICMP packet */ + ret = ip4_output_if(p, src, LWIP_IP_HDRINCL, + 800fc26: 683b ldr r3, [r7, #0] + 800fc28: 9302 str r3, [sp, #8] + 800fc2a: 2301 movs r3, #1 + 800fc2c: 9301 str r3, [sp, #4] + 800fc2e: 2300 movs r3, #0 + 800fc30: 9300 str r3, [sp, #0] + 800fc32: 23ff movs r3, #255 @ 0xff + 800fc34: 2200 movs r2, #0 + 800fc36: 69f9 ldr r1, [r7, #28] + 800fc38: 6878 ldr r0, [r7, #4] + 800fc3a: f000 fa93 bl 8010164 + 800fc3e: 4603 mov r3, r0 + 800fc40: 72fb strb r3, [r7, #11] + ICMP_TTL, 0, IP_PROTO_ICMP, inp); + if (ret != ERR_OK) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ip_output_if returned an error: %s\n", lwip_strerr(ret))); + } + } + break; + 800fc42: e001 b.n 800fc48 + break; + 800fc44: bf00 nop + 800fc46: e000 b.n 800fc4a + break; + 800fc48: bf00 nop + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", + (s16_t)type, (s16_t)code)); + ICMP_STATS_INC(icmp.proterr); + ICMP_STATS_INC(icmp.drop); + } + pbuf_free(p); + 800fc4a: 6878 ldr r0, [r7, #4] + 800fc4c: f7f6 feec bl 8006a28 + return; + 800fc50: e013 b.n 800fc7a + goto lenerr; + 800fc52: bf00 nop + 800fc54: e002 b.n 800fc5c + goto lenerr; + 800fc56: bf00 nop + 800fc58: e000 b.n 800fc5c + goto lenerr; + 800fc5a: bf00 nop +lenerr: + pbuf_free(p); + 800fc5c: 6878 ldr r0, [r7, #4] + 800fc5e: f7f6 fee3 bl 8006a28 + ICMP_STATS_INC(icmp.lenerr); + MIB2_STATS_INC(mib2.icmpinerrors); + return; + 800fc62: e00a b.n 800fc7a + goto icmperr; + 800fc64: bf00 nop + 800fc66: e004 b.n 800fc72 + goto icmperr; + 800fc68: bf00 nop + 800fc6a: e002 b.n 800fc72 + goto icmperr; + 800fc6c: bf00 nop + 800fc6e: e000 b.n 800fc72 + goto icmperr; + 800fc70: bf00 nop +#if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN || !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING +icmperr: + pbuf_free(p); + 800fc72: 6878 ldr r0, [r7, #4] + 800fc74: f7f6 fed8 bl 8006a28 + ICMP_STATS_INC(icmp.err); + MIB2_STATS_INC(mib2.icmpinerrors); + return; + 800fc78: bf00 nop +#endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN || !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING */ +} + 800fc7a: 3728 adds r7, #40 @ 0x28 + 800fc7c: 46bd mov sp, r7 + 800fc7e: bd80 pop {r7, pc} + 800fc80: 2000614c .word 0x2000614c + 800fc84: 20006160 .word 0x20006160 + 800fc88: 0801891c .word 0x0801891c + 800fc8c: 08018954 .word 0x08018954 + 800fc90: 0801898c .word 0x0801898c + 800fc94: 080189b4 .word 0x080189b4 + +0800fc98 : + * p->payload pointing to the IP header + * @param t type of the 'unreachable' packet + */ +void +icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t) +{ + 800fc98: b580 push {r7, lr} + 800fc9a: b082 sub sp, #8 + 800fc9c: af00 add r7, sp, #0 + 800fc9e: 6078 str r0, [r7, #4] + 800fca0: 460b mov r3, r1 + 800fca2: 70fb strb r3, [r7, #3] + MIB2_STATS_INC(mib2.icmpoutdestunreachs); + icmp_send_response(p, ICMP_DUR, t); + 800fca4: 78fb ldrb r3, [r7, #3] + 800fca6: 461a mov r2, r3 + 800fca8: 2103 movs r1, #3 + 800fcaa: 6878 ldr r0, [r7, #4] + 800fcac: f000 f814 bl 800fcd8 +} + 800fcb0: bf00 nop + 800fcb2: 3708 adds r7, #8 + 800fcb4: 46bd mov sp, r7 + 800fcb6: bd80 pop {r7, pc} + +0800fcb8 : + * p->payload pointing to the IP header + * @param t type of the 'time exceeded' packet + */ +void +icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t) +{ + 800fcb8: b580 push {r7, lr} + 800fcba: b082 sub sp, #8 + 800fcbc: af00 add r7, sp, #0 + 800fcbe: 6078 str r0, [r7, #4] + 800fcc0: 460b mov r3, r1 + 800fcc2: 70fb strb r3, [r7, #3] + MIB2_STATS_INC(mib2.icmpouttimeexcds); + icmp_send_response(p, ICMP_TE, t); + 800fcc4: 78fb ldrb r3, [r7, #3] + 800fcc6: 461a mov r2, r3 + 800fcc8: 210b movs r1, #11 + 800fcca: 6878 ldr r0, [r7, #4] + 800fccc: f000 f804 bl 800fcd8 +} + 800fcd0: bf00 nop + 800fcd2: 3708 adds r7, #8 + 800fcd4: 46bd mov sp, r7 + 800fcd6: bd80 pop {r7, pc} + +0800fcd8 : + * @param type Type of the ICMP header + * @param code Code of the ICMP header + */ +static void +icmp_send_response(struct pbuf *p, u8_t type, u8_t code) +{ + 800fcd8: b580 push {r7, lr} + 800fcda: b08c sub sp, #48 @ 0x30 + 800fcdc: af04 add r7, sp, #16 + 800fcde: 6078 str r0, [r7, #4] + 800fce0: 460b mov r3, r1 + 800fce2: 70fb strb r3, [r7, #3] + 800fce4: 4613 mov r3, r2 + 800fce6: 70bb strb r3, [r7, #2] + + /* increase number of messages attempted to send */ + MIB2_STATS_INC(mib2.icmpoutmsgs); + + /* ICMP header + IP header + 8 bytes of data */ + q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE, + 800fce8: f44f 7220 mov.w r2, #640 @ 0x280 + 800fcec: 2124 movs r1, #36 @ 0x24 + 800fcee: 2022 movs r0, #34 @ 0x22 + 800fcf0: f7f6 fbb8 bl 8006464 + 800fcf4: 61f8 str r0, [r7, #28] + PBUF_RAM); + if (q == NULL) { + 800fcf6: 69fb ldr r3, [r7, #28] + 800fcf8: 2b00 cmp r3, #0 + 800fcfa: d04c beq.n 800fd96 + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_time_exceeded: failed to allocate pbuf for ICMP packet.\n")); + MIB2_STATS_INC(mib2.icmpouterrors); + return; + } + LWIP_ASSERT("check that first pbuf can hold icmp message", + 800fcfc: 69fb ldr r3, [r7, #28] + 800fcfe: 895b ldrh r3, [r3, #10] + 800fd00: 2b23 cmp r3, #35 @ 0x23 + 800fd02: d806 bhi.n 800fd12 + 800fd04: 4b26 ldr r3, [pc, #152] @ (800fda0 ) + 800fd06: f44f 72b4 mov.w r2, #360 @ 0x168 + 800fd0a: 4926 ldr r1, [pc, #152] @ (800fda4 ) + 800fd0c: 4826 ldr r0, [pc, #152] @ (800fda8 ) + 800fd0e: f001 fc73 bl 80115f8 + (q->len >= (sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE))); + + iphdr = (struct ip_hdr *)p->payload; + 800fd12: 687b ldr r3, [r7, #4] + 800fd14: 685b ldr r3, [r3, #4] + 800fd16: 61bb str r3, [r7, #24] + ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->src); + LWIP_DEBUGF(ICMP_DEBUG, (" to ")); + ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->dest); + LWIP_DEBUGF(ICMP_DEBUG, ("\n")); + + icmphdr = (struct icmp_echo_hdr *)q->payload; + 800fd18: 69fb ldr r3, [r7, #28] + 800fd1a: 685b ldr r3, [r3, #4] + 800fd1c: 617b str r3, [r7, #20] + icmphdr->type = type; + 800fd1e: 697b ldr r3, [r7, #20] + 800fd20: 78fa ldrb r2, [r7, #3] + 800fd22: 701a strb r2, [r3, #0] + icmphdr->code = code; + 800fd24: 697b ldr r3, [r7, #20] + 800fd26: 78ba ldrb r2, [r7, #2] + 800fd28: 705a strb r2, [r3, #1] + icmphdr->id = 0; + 800fd2a: 697b ldr r3, [r7, #20] + 800fd2c: 2200 movs r2, #0 + 800fd2e: 711a strb r2, [r3, #4] + 800fd30: 2200 movs r2, #0 + 800fd32: 715a strb r2, [r3, #5] + icmphdr->seqno = 0; + 800fd34: 697b ldr r3, [r7, #20] + 800fd36: 2200 movs r2, #0 + 800fd38: 719a strb r2, [r3, #6] + 800fd3a: 2200 movs r2, #0 + 800fd3c: 71da strb r2, [r3, #7] + + /* copy fields from original packet */ + SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_echo_hdr), (u8_t *)p->payload, + 800fd3e: 69fb ldr r3, [r7, #28] + 800fd40: 685b ldr r3, [r3, #4] + 800fd42: f103 0008 add.w r0, r3, #8 + 800fd46: 687b ldr r3, [r7, #4] + 800fd48: 685b ldr r3, [r3, #4] + 800fd4a: 221c movs r2, #28 + 800fd4c: 4619 mov r1, r3 + 800fd4e: f001 fd4f bl 80117f0 + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE); + + ip4_addr_copy(iphdr_src, iphdr->src); + 800fd52: 69bb ldr r3, [r7, #24] + 800fd54: 68db ldr r3, [r3, #12] + 800fd56: 60fb str r3, [r7, #12] + ip4_addr_t iphdr_dst; + ip4_addr_copy(iphdr_dst, iphdr->dest); + netif = ip4_route_src(&iphdr_dst, &iphdr_src); + } +#else + netif = ip4_route(&iphdr_src); + 800fd58: f107 030c add.w r3, r7, #12 + 800fd5c: 4618 mov r0, r3 + 800fd5e: f000 f825 bl 800fdac + 800fd62: 6138 str r0, [r7, #16] +#endif + if (netif != NULL) { + 800fd64: 693b ldr r3, [r7, #16] + 800fd66: 2b00 cmp r3, #0 + 800fd68: d011 beq.n 800fd8e + /* calculate checksum */ + icmphdr->chksum = 0; + 800fd6a: 697b ldr r3, [r7, #20] + 800fd6c: 2200 movs r2, #0 + 800fd6e: 709a strb r2, [r3, #2] + 800fd70: 2200 movs r2, #0 + 800fd72: 70da strb r2, [r3, #3] + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP) { + icmphdr->chksum = inet_chksum(icmphdr, q->len); + } +#endif + ICMP_STATS_INC(icmp.xmit); + ip4_output_if(q, NULL, &iphdr_src, ICMP_TTL, 0, IP_PROTO_ICMP, netif); + 800fd74: f107 020c add.w r2, r7, #12 + 800fd78: 693b ldr r3, [r7, #16] + 800fd7a: 9302 str r3, [sp, #8] + 800fd7c: 2301 movs r3, #1 + 800fd7e: 9301 str r3, [sp, #4] + 800fd80: 2300 movs r3, #0 + 800fd82: 9300 str r3, [sp, #0] + 800fd84: 23ff movs r3, #255 @ 0xff + 800fd86: 2100 movs r1, #0 + 800fd88: 69f8 ldr r0, [r7, #28] + 800fd8a: f000 f9eb bl 8010164 + } + pbuf_free(q); + 800fd8e: 69f8 ldr r0, [r7, #28] + 800fd90: f7f6 fe4a bl 8006a28 + 800fd94: e000 b.n 800fd98 + return; + 800fd96: bf00 nop +} + 800fd98: 3720 adds r7, #32 + 800fd9a: 46bd mov sp, r7 + 800fd9c: bd80 pop {r7, pc} + 800fd9e: bf00 nop + 800fda0: 0801891c .word 0x0801891c + 800fda4: 080189e8 .word 0x080189e8 + 800fda8: 0801898c .word 0x0801898c + +0800fdac : + * @param dest the destination IP address for which to find the route + * @return the netif on which to send to reach dest + */ +struct netif * +ip4_route(const ip4_addr_t *dest) +{ + 800fdac: b480 push {r7} + 800fdae: b085 sub sp, #20 + 800fdb0: af00 add r7, sp, #0 + 800fdb2: 6078 str r0, [r7, #4] + + /* bug #54569: in case LWIP_SINGLE_NETIF=1 and LWIP_DEBUGF() disabled, the following loop is optimized away */ + LWIP_UNUSED_ARG(dest); + + /* iterate through netifs */ + NETIF_FOREACH(netif) { + 800fdb4: 4b33 ldr r3, [pc, #204] @ (800fe84 ) + 800fdb6: 681b ldr r3, [r3, #0] + 800fdb8: 60fb str r3, [r7, #12] + 800fdba: e036 b.n 800fe2a + /* is the netif up, does it have a link and a valid address? */ + if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif))) { + 800fdbc: 68fb ldr r3, [r7, #12] + 800fdbe: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800fdc2: f003 0301 and.w r3, r3, #1 + 800fdc6: b2db uxtb r3, r3 + 800fdc8: 2b00 cmp r3, #0 + 800fdca: d02b beq.n 800fe24 + 800fdcc: 68fb ldr r3, [r7, #12] + 800fdce: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800fdd2: 089b lsrs r3, r3, #2 + 800fdd4: f003 0301 and.w r3, r3, #1 + 800fdd8: b2db uxtb r3, r3 + 800fdda: 2b00 cmp r3, #0 + 800fddc: d022 beq.n 800fe24 + 800fdde: 68fb ldr r3, [r7, #12] + 800fde0: 3304 adds r3, #4 + 800fde2: 681b ldr r3, [r3, #0] + 800fde4: 2b00 cmp r3, #0 + 800fde6: d01d beq.n 800fe24 + /* network mask matches? */ + if (ip4_addr_netcmp(dest, netif_ip4_addr(netif), netif_ip4_netmask(netif))) { + 800fde8: 687b ldr r3, [r7, #4] + 800fdea: 681a ldr r2, [r3, #0] + 800fdec: 68fb ldr r3, [r7, #12] + 800fdee: 3304 adds r3, #4 + 800fdf0: 681b ldr r3, [r3, #0] + 800fdf2: 405a eors r2, r3 + 800fdf4: 68fb ldr r3, [r7, #12] + 800fdf6: 3308 adds r3, #8 + 800fdf8: 681b ldr r3, [r3, #0] + 800fdfa: 4013 ands r3, r2 + 800fdfc: 2b00 cmp r3, #0 + 800fdfe: d101 bne.n 800fe04 + /* return netif on which to forward IP packet */ + return netif; + 800fe00: 68fb ldr r3, [r7, #12] + 800fe02: e038 b.n 800fe76 + } + /* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */ + if (((netif->flags & NETIF_FLAG_BROADCAST) == 0) && ip4_addr_cmp(dest, netif_ip4_gw(netif))) { + 800fe04: 68fb ldr r3, [r7, #12] + 800fe06: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800fe0a: f003 0302 and.w r3, r3, #2 + 800fe0e: 2b00 cmp r3, #0 + 800fe10: d108 bne.n 800fe24 + 800fe12: 687b ldr r3, [r7, #4] + 800fe14: 681a ldr r2, [r3, #0] + 800fe16: 68fb ldr r3, [r7, #12] + 800fe18: 330c adds r3, #12 + 800fe1a: 681b ldr r3, [r3, #0] + 800fe1c: 429a cmp r2, r3 + 800fe1e: d101 bne.n 800fe24 + /* return netif on which to forward IP packet */ + return netif; + 800fe20: 68fb ldr r3, [r7, #12] + 800fe22: e028 b.n 800fe76 + NETIF_FOREACH(netif) { + 800fe24: 68fb ldr r3, [r7, #12] + 800fe26: 681b ldr r3, [r3, #0] + 800fe28: 60fb str r3, [r7, #12] + 800fe2a: 68fb ldr r3, [r7, #12] + 800fe2c: 2b00 cmp r3, #0 + 800fe2e: d1c5 bne.n 800fdbc + return netif; + } +#endif +#endif /* !LWIP_SINGLE_NETIF */ + + if ((netif_default == NULL) || !netif_is_up(netif_default) || !netif_is_link_up(netif_default) || + 800fe30: 4b15 ldr r3, [pc, #84] @ (800fe88 ) + 800fe32: 681b ldr r3, [r3, #0] + 800fe34: 2b00 cmp r3, #0 + 800fe36: d01a beq.n 800fe6e + 800fe38: 4b13 ldr r3, [pc, #76] @ (800fe88 ) + 800fe3a: 681b ldr r3, [r3, #0] + 800fe3c: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800fe40: f003 0301 and.w r3, r3, #1 + 800fe44: 2b00 cmp r3, #0 + 800fe46: d012 beq.n 800fe6e + 800fe48: 4b0f ldr r3, [pc, #60] @ (800fe88 ) + 800fe4a: 681b ldr r3, [r3, #0] + 800fe4c: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800fe50: f003 0304 and.w r3, r3, #4 + 800fe54: 2b00 cmp r3, #0 + 800fe56: d00a beq.n 800fe6e + ip4_addr_isany_val(*netif_ip4_addr(netif_default)) || ip4_addr_isloopback(dest)) { + 800fe58: 4b0b ldr r3, [pc, #44] @ (800fe88 ) + 800fe5a: 681b ldr r3, [r3, #0] + 800fe5c: 3304 adds r3, #4 + 800fe5e: 681b ldr r3, [r3, #0] + if ((netif_default == NULL) || !netif_is_up(netif_default) || !netif_is_link_up(netif_default) || + 800fe60: 2b00 cmp r3, #0 + 800fe62: d004 beq.n 800fe6e + ip4_addr_isany_val(*netif_ip4_addr(netif_default)) || ip4_addr_isloopback(dest)) { + 800fe64: 687b ldr r3, [r7, #4] + 800fe66: 681b ldr r3, [r3, #0] + 800fe68: b2db uxtb r3, r3 + 800fe6a: 2b7f cmp r3, #127 @ 0x7f + 800fe6c: d101 bne.n 800fe72 + If this is not good enough for you, use LWIP_HOOK_IP4_ROUTE() */ + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip4_route: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest))); + IP_STATS_INC(ip.rterr); + MIB2_STATS_INC(mib2.ipoutnoroutes); + return NULL; + 800fe6e: 2300 movs r3, #0 + 800fe70: e001 b.n 800fe76 + } + + return netif_default; + 800fe72: 4b05 ldr r3, [pc, #20] @ (800fe88 ) + 800fe74: 681b ldr r3, [r3, #0] +} + 800fe76: 4618 mov r0, r3 + 800fe78: 3714 adds r7, #20 + 800fe7a: 46bd mov sp, r7 + 800fe7c: f85d 7b04 ldr.w r7, [sp], #4 + 800fe80: 4770 bx lr + 800fe82: bf00 nop + 800fe84: 20019098 .word 0x20019098 + 800fe88: 2001909c .word 0x2001909c + +0800fe8c : +#endif /* IP_FORWARD */ + +/** Return true if the current input packet should be accepted on this netif */ +static int +ip4_input_accept(struct netif *netif) +{ + 800fe8c: b580 push {r7, lr} + 800fe8e: b082 sub sp, #8 + 800fe90: af00 add r7, sp, #0 + 800fe92: 6078 str r0, [r7, #4] + ip4_addr_get_u32(ip4_current_dest_addr()) & ip4_addr_get_u32(netif_ip4_netmask(netif)), + ip4_addr_get_u32(netif_ip4_addr(netif)) & ip4_addr_get_u32(netif_ip4_netmask(netif)), + ip4_addr_get_u32(ip4_current_dest_addr()) & ~ip4_addr_get_u32(netif_ip4_netmask(netif)))); + + /* interface is up and configured? */ + if ((netif_is_up(netif)) && (!ip4_addr_isany_val(*netif_ip4_addr(netif)))) { + 800fe94: 687b ldr r3, [r7, #4] + 800fe96: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800fe9a: f003 0301 and.w r3, r3, #1 + 800fe9e: b2db uxtb r3, r3 + 800fea0: 2b00 cmp r3, #0 + 800fea2: d016 beq.n 800fed2 + 800fea4: 687b ldr r3, [r7, #4] + 800fea6: 3304 adds r3, #4 + 800fea8: 681b ldr r3, [r3, #0] + 800feaa: 2b00 cmp r3, #0 + 800feac: d011 beq.n 800fed2 + /* unicast to this interface address? */ + if (ip4_addr_cmp(ip4_current_dest_addr(), netif_ip4_addr(netif)) || + 800feae: 4b0b ldr r3, [pc, #44] @ (800fedc ) + 800feb0: 695a ldr r2, [r3, #20] + 800feb2: 687b ldr r3, [r7, #4] + 800feb4: 3304 adds r3, #4 + 800feb6: 681b ldr r3, [r3, #0] + 800feb8: 429a cmp r2, r3 + 800feba: d008 beq.n 800fece + /* or broadcast on this interface network address? */ + ip4_addr_isbroadcast(ip4_current_dest_addr(), netif) + 800febc: 4b07 ldr r3, [pc, #28] @ (800fedc ) + 800febe: 695b ldr r3, [r3, #20] + 800fec0: 6879 ldr r1, [r7, #4] + 800fec2: 4618 mov r0, r3 + 800fec4: f000 fa26 bl 8010314 + 800fec8: 4603 mov r3, r0 + if (ip4_addr_cmp(ip4_current_dest_addr(), netif_ip4_addr(netif)) || + 800feca: 2b00 cmp r3, #0 + 800fecc: d001 beq.n 800fed2 +#endif /* LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF */ + ) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: packet accepted on interface %c%c\n", + netif->name[0], netif->name[1])); + /* accept on this netif */ + return 1; + 800fece: 2301 movs r3, #1 + 800fed0: e000 b.n 800fed4 + /* accept on this netif */ + return 1; + } +#endif /* LWIP_AUTOIP */ + } + return 0; + 800fed2: 2300 movs r3, #0 +} + 800fed4: 4618 mov r0, r3 + 800fed6: 3708 adds r7, #8 + 800fed8: 46bd mov sp, r7 + 800feda: bd80 pop {r7, pc} + 800fedc: 2000614c .word 0x2000614c + +0800fee0 : + * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't + * processed, but currently always returns ERR_OK) + */ +err_t +ip4_input(struct pbuf *p, struct netif *inp) +{ + 800fee0: b580 push {r7, lr} + 800fee2: b088 sub sp, #32 + 800fee4: af00 add r7, sp, #0 + 800fee6: 6078 str r0, [r7, #4] + 800fee8: 6039 str r1, [r7, #0] + const struct ip_hdr *iphdr; + struct netif *netif; + u16_t iphdr_hlen; + u16_t iphdr_len; +#if IP_ACCEPT_LINK_LAYER_ADDRESSING || LWIP_IGMP + int check_ip_src = 1; + 800feea: 2301 movs r3, #1 + 800feec: 617b str r3, [r7, #20] + + IP_STATS_INC(ip.recv); + MIB2_STATS_INC(mib2.ipinreceives); + + /* identify the IP header */ + iphdr = (struct ip_hdr *)p->payload; + 800feee: 687b ldr r3, [r7, #4] + 800fef0: 685b ldr r3, [r3, #4] + 800fef2: 61fb str r3, [r7, #28] + if (IPH_V(iphdr) != 4) { + 800fef4: 69fb ldr r3, [r7, #28] + 800fef6: 781b ldrb r3, [r3, #0] + 800fef8: 091b lsrs r3, r3, #4 + 800fefa: b2db uxtb r3, r3 + 800fefc: 2b04 cmp r3, #4 + 800fefe: d004 beq.n 800ff0a + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IP packet dropped due to bad version number %"U16_F"\n", (u16_t)IPH_V(iphdr))); + ip4_debug_print(p); + pbuf_free(p); + 800ff00: 6878 ldr r0, [r7, #4] + 800ff02: f7f6 fd91 bl 8006a28 + IP_STATS_INC(ip.err); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinhdrerrors); + return ERR_OK; + 800ff06: 2300 movs r3, #0 + 800ff08: e123 b.n 8010152 + return ERR_OK; + } +#endif + + /* obtain IP header length in bytes */ + iphdr_hlen = IPH_HL_BYTES(iphdr); + 800ff0a: 69fb ldr r3, [r7, #28] + 800ff0c: 781b ldrb r3, [r3, #0] + 800ff0e: f003 030f and.w r3, r3, #15 + 800ff12: b2db uxtb r3, r3 + 800ff14: 009b lsls r3, r3, #2 + 800ff16: b2db uxtb r3, r3 + 800ff18: 827b strh r3, [r7, #18] + /* obtain ip length in bytes */ + iphdr_len = lwip_ntohs(IPH_LEN(iphdr)); + 800ff1a: 69fb ldr r3, [r7, #28] + 800ff1c: 885b ldrh r3, [r3, #2] + 800ff1e: b29b uxth r3, r3 + 800ff20: 4618 mov r0, r3 + 800ff22: f7f5 fa31 bl 8005388 + 800ff26: 4603 mov r3, r0 + 800ff28: 823b strh r3, [r7, #16] + + /* Trim pbuf. This is especially required for packets < 60 bytes. */ + if (iphdr_len < p->tot_len) { + 800ff2a: 687b ldr r3, [r7, #4] + 800ff2c: 891b ldrh r3, [r3, #8] + 800ff2e: 8a3a ldrh r2, [r7, #16] + 800ff30: 429a cmp r2, r3 + 800ff32: d204 bcs.n 800ff3e + pbuf_realloc(p, iphdr_len); + 800ff34: 8a3b ldrh r3, [r7, #16] + 800ff36: 4619 mov r1, r3 + 800ff38: 6878 ldr r0, [r7, #4] + 800ff3a: f7f6 fbf1 bl 8006720 + } + + /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */ + if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len) || (iphdr_hlen < IP_HLEN)) { + 800ff3e: 687b ldr r3, [r7, #4] + 800ff40: 895b ldrh r3, [r3, #10] + 800ff42: 8a7a ldrh r2, [r7, #18] + 800ff44: 429a cmp r2, r3 + 800ff46: d807 bhi.n 800ff58 + 800ff48: 687b ldr r3, [r7, #4] + 800ff4a: 891b ldrh r3, [r3, #8] + 800ff4c: 8a3a ldrh r2, [r7, #16] + 800ff4e: 429a cmp r2, r3 + 800ff50: d802 bhi.n 800ff58 + 800ff52: 8a7b ldrh r3, [r7, #18] + 800ff54: 2b13 cmp r3, #19 + 800ff56: d804 bhi.n 800ff62 + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n", + iphdr_len, p->tot_len)); + } + /* free (drop) packet pbufs */ + pbuf_free(p); + 800ff58: 6878 ldr r0, [r7, #4] + 800ff5a: f7f6 fd65 bl 8006a28 + IP_STATS_INC(ip.lenerr); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipindiscards); + return ERR_OK; + 800ff5e: 2300 movs r3, #0 + 800ff60: e0f7 b.n 8010152 + } + } +#endif + + /* copy IP addresses to aligned ip_addr_t */ + ip_addr_copy_from_ip4(ip_data.current_iphdr_dest, iphdr->dest); + 800ff62: 69fb ldr r3, [r7, #28] + 800ff64: 691b ldr r3, [r3, #16] + 800ff66: 4a7d ldr r2, [pc, #500] @ (801015c ) + 800ff68: 6153 str r3, [r2, #20] + ip_addr_copy_from_ip4(ip_data.current_iphdr_src, iphdr->src); + 800ff6a: 69fb ldr r3, [r7, #28] + 800ff6c: 68db ldr r3, [r3, #12] + 800ff6e: 4a7b ldr r2, [pc, #492] @ (801015c ) + 800ff70: 6113 str r3, [r2, #16] + + /* match packet against an interface, i.e. is this packet for us? */ + if (ip4_addr_ismulticast(ip4_current_dest_addr())) { + 800ff72: 4b7a ldr r3, [pc, #488] @ (801015c ) + 800ff74: 695b ldr r3, [r3, #20] + 800ff76: f003 03f0 and.w r3, r3, #240 @ 0xf0 + 800ff7a: 2be0 cmp r3, #224 @ 0xe0 + 800ff7c: d112 bne.n 800ffa4 + netif = inp; + } else { + netif = NULL; + } +#else /* LWIP_IGMP */ + if ((netif_is_up(inp)) && (!ip4_addr_isany_val(*netif_ip4_addr(inp)))) { + 800ff7e: 683b ldr r3, [r7, #0] + 800ff80: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 800ff84: f003 0301 and.w r3, r3, #1 + 800ff88: b2db uxtb r3, r3 + 800ff8a: 2b00 cmp r3, #0 + 800ff8c: d007 beq.n 800ff9e + 800ff8e: 683b ldr r3, [r7, #0] + 800ff90: 3304 adds r3, #4 + 800ff92: 681b ldr r3, [r3, #0] + 800ff94: 2b00 cmp r3, #0 + 800ff96: d002 beq.n 800ff9e + netif = inp; + 800ff98: 683b ldr r3, [r7, #0] + 800ff9a: 61bb str r3, [r7, #24] + 800ff9c: e02a b.n 800fff4 + } else { + netif = NULL; + 800ff9e: 2300 movs r3, #0 + 800ffa0: 61bb str r3, [r7, #24] + 800ffa2: e027 b.n 800fff4 + } +#endif /* LWIP_IGMP */ + } else { + /* start trying with inp. if that's not acceptable, start walking the + list of configured netifs. */ + if (ip4_input_accept(inp)) { + 800ffa4: 6838 ldr r0, [r7, #0] + 800ffa6: f7ff ff71 bl 800fe8c + 800ffaa: 4603 mov r3, r0 + 800ffac: 2b00 cmp r3, #0 + 800ffae: d002 beq.n 800ffb6 + netif = inp; + 800ffb0: 683b ldr r3, [r7, #0] + 800ffb2: 61bb str r3, [r7, #24] + 800ffb4: e01e b.n 800fff4 + } else { + netif = NULL; + 800ffb6: 2300 movs r3, #0 + 800ffb8: 61bb str r3, [r7, #24] +#if !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF + /* Packets sent to the loopback address must not be accepted on an + * interface that does not have the loopback address assigned to it, + * unless a non-loopback interface is used for loopback traffic. */ + if (!ip4_addr_isloopback(ip4_current_dest_addr())) + 800ffba: 4b68 ldr r3, [pc, #416] @ (801015c ) + 800ffbc: 695b ldr r3, [r3, #20] + 800ffbe: b2db uxtb r3, r3 + 800ffc0: 2b7f cmp r3, #127 @ 0x7f + 800ffc2: d017 beq.n 800fff4 +#endif /* !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF */ + { +#if !LWIP_SINGLE_NETIF + NETIF_FOREACH(netif) { + 800ffc4: 4b66 ldr r3, [pc, #408] @ (8010160 ) + 800ffc6: 681b ldr r3, [r3, #0] + 800ffc8: 61bb str r3, [r7, #24] + 800ffca: e00e b.n 800ffea + if (netif == inp) { + 800ffcc: 69ba ldr r2, [r7, #24] + 800ffce: 683b ldr r3, [r7, #0] + 800ffd0: 429a cmp r2, r3 + 800ffd2: d006 beq.n 800ffe2 + /* we checked that before already */ + continue; + } + if (ip4_input_accept(netif)) { + 800ffd4: 69b8 ldr r0, [r7, #24] + 800ffd6: f7ff ff59 bl 800fe8c + 800ffda: 4603 mov r3, r0 + 800ffdc: 2b00 cmp r3, #0 + 800ffde: d108 bne.n 800fff2 + 800ffe0: e000 b.n 800ffe4 + continue; + 800ffe2: bf00 nop + NETIF_FOREACH(netif) { + 800ffe4: 69bb ldr r3, [r7, #24] + 800ffe6: 681b ldr r3, [r3, #0] + 800ffe8: 61bb str r3, [r7, #24] + 800ffea: 69bb ldr r3, [r7, #24] + 800ffec: 2b00 cmp r3, #0 + 800ffee: d1ed bne.n 800ffcc + 800fff0: e000 b.n 800fff4 + break; + 800fff2: bf00 nop + * If you want to accept private broadcast communication while a netif is down, + * define LWIP_IP_ACCEPT_UDP_PORT(dst_port), e.g.: + * + * #define LWIP_IP_ACCEPT_UDP_PORT(dst_port) ((dst_port) == PP_NTOHS(12345)) + */ + if (netif == NULL) { + 800fff4: 69bb ldr r3, [r7, #24] + 800fff6: 2b00 cmp r3, #0 + 800fff8: d111 bne.n 801001e + /* remote port is DHCP server? */ + if (IPH_PROTO(iphdr) == IP_PROTO_UDP) { + 800fffa: 69fb ldr r3, [r7, #28] + 800fffc: 7a5b ldrb r3, [r3, #9] + 800fffe: 2b11 cmp r3, #17 + 8010000: d10d bne.n 801001e + const struct udp_hdr *udphdr = (const struct udp_hdr *)((const u8_t *)iphdr + iphdr_hlen); + 8010002: 8a7b ldrh r3, [r7, #18] + 8010004: 69fa ldr r2, [r7, #28] + 8010006: 4413 add r3, r2 + 8010008: 60fb str r3, [r7, #12] + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip4_input: UDP packet to DHCP client port %"U16_F"\n", + lwip_ntohs(udphdr->dest))); + if (IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(udphdr->dest)) { + 801000a: 68fb ldr r3, [r7, #12] + 801000c: 885b ldrh r3, [r3, #2] + 801000e: b29b uxth r3, r3 + 8010010: f5b3 4f88 cmp.w r3, #17408 @ 0x4400 + 8010014: d103 bne.n 801001e + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip4_input: DHCP packet accepted.\n")); + netif = inp; + 8010016: 683b ldr r3, [r7, #0] + 8010018: 61bb str r3, [r7, #24] + check_ip_src = 0; + 801001a: 2300 movs r3, #0 + 801001c: 617b str r3, [r7, #20] + } +#endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */ + + /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */ +#if LWIP_IGMP || IP_ACCEPT_LINK_LAYER_ADDRESSING + if (check_ip_src + 801001e: 697b ldr r3, [r7, #20] + 8010020: 2b00 cmp r3, #0 + 8010022: d017 beq.n 8010054 +#if IP_ACCEPT_LINK_LAYER_ADDRESSING + /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */ + && !ip4_addr_isany_val(*ip4_current_src_addr()) + 8010024: 4b4d ldr r3, [pc, #308] @ (801015c ) + 8010026: 691b ldr r3, [r3, #16] + 8010028: 2b00 cmp r3, #0 + 801002a: d013 beq.n 8010054 +#endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */ + ) +#endif /* LWIP_IGMP || IP_ACCEPT_LINK_LAYER_ADDRESSING */ + { + if ((ip4_addr_isbroadcast(ip4_current_src_addr(), inp)) || + 801002c: 4b4b ldr r3, [pc, #300] @ (801015c ) + 801002e: 691b ldr r3, [r3, #16] + 8010030: 6839 ldr r1, [r7, #0] + 8010032: 4618 mov r0, r3 + 8010034: f000 f96e bl 8010314 + 8010038: 4603 mov r3, r0 + 801003a: 2b00 cmp r3, #0 + 801003c: d105 bne.n 801004a + (ip4_addr_ismulticast(ip4_current_src_addr()))) { + 801003e: 4b47 ldr r3, [pc, #284] @ (801015c ) + 8010040: 691b ldr r3, [r3, #16] + 8010042: f003 03f0 and.w r3, r3, #240 @ 0xf0 + if ((ip4_addr_isbroadcast(ip4_current_src_addr(), inp)) || + 8010046: 2be0 cmp r3, #224 @ 0xe0 + 8010048: d104 bne.n 8010054 + /* packet source is not valid */ + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("ip4_input: packet source is not valid.\n")); + /* free (drop) packet pbufs */ + pbuf_free(p); + 801004a: 6878 ldr r0, [r7, #4] + 801004c: f7f6 fcec bl 8006a28 + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinaddrerrors); + MIB2_STATS_INC(mib2.ipindiscards); + return ERR_OK; + 8010050: 2300 movs r3, #0 + 8010052: e07e b.n 8010152 + } + } + + /* packet not for us? */ + if (netif == NULL) { + 8010054: 69bb ldr r3, [r7, #24] + 8010056: 2b00 cmp r3, #0 + 8010058: d104 bne.n 8010064 + { + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinaddrerrors); + MIB2_STATS_INC(mib2.ipindiscards); + } + pbuf_free(p); + 801005a: 6878 ldr r0, [r7, #4] + 801005c: f7f6 fce4 bl 8006a28 + return ERR_OK; + 8010060: 2300 movs r3, #0 + 8010062: e076 b.n 8010152 + } + /* packet consists of multiple fragments? */ + if ((IPH_OFFSET(iphdr) & PP_HTONS(IP_OFFMASK | IP_MF)) != 0) { + 8010064: 69fb ldr r3, [r7, #28] + 8010066: 88db ldrh r3, [r3, #6] + 8010068: b29b uxth r3, r3 + 801006a: 461a mov r2, r3 + 801006c: f64f 733f movw r3, #65343 @ 0xff3f + 8010070: 4013 ands r3, r2 + 8010072: 2b00 cmp r3, #0 + 8010074: d00b beq.n 801008e +#if IP_REASSEMBLY /* packet fragment reassembly code present? */ + LWIP_DEBUGF(IP_DEBUG, ("IP packet is a fragment (id=0x%04"X16_F" tot_len=%"U16_F" len=%"U16_F" MF=%"U16_F" offset=%"U16_F"), calling ip4_reass()\n", + lwip_ntohs(IPH_ID(iphdr)), p->tot_len, lwip_ntohs(IPH_LEN(iphdr)), (u16_t)!!(IPH_OFFSET(iphdr) & PP_HTONS(IP_MF)), (u16_t)((lwip_ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK) * 8))); + /* reassemble the packet*/ + p = ip4_reass(p); + 8010076: 6878 ldr r0, [r7, #4] + 8010078: f000 fdd0 bl 8010c1c + 801007c: 6078 str r0, [r7, #4] + /* packet not fully reassembled yet? */ + if (p == NULL) { + 801007e: 687b ldr r3, [r7, #4] + 8010080: 2b00 cmp r3, #0 + 8010082: d101 bne.n 8010088 + return ERR_OK; + 8010084: 2300 movs r3, #0 + 8010086: e064 b.n 8010152 + } + iphdr = (const struct ip_hdr *)p->payload; + 8010088: 687b ldr r3, [r7, #4] + 801008a: 685b ldr r3, [r3, #4] + 801008c: 61fb str r3, [r7, #28] + /* send to upper layers */ + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: \n")); + ip4_debug_print(p); + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len)); + + ip_data.current_netif = netif; + 801008e: 4a33 ldr r2, [pc, #204] @ (801015c ) + 8010090: 69bb ldr r3, [r7, #24] + 8010092: 6013 str r3, [r2, #0] + ip_data.current_input_netif = inp; + 8010094: 4a31 ldr r2, [pc, #196] @ (801015c ) + 8010096: 683b ldr r3, [r7, #0] + 8010098: 6053 str r3, [r2, #4] + ip_data.current_ip4_header = iphdr; + 801009a: 4a30 ldr r2, [pc, #192] @ (801015c ) + 801009c: 69fb ldr r3, [r7, #28] + 801009e: 6093 str r3, [r2, #8] + ip_data.current_ip_header_tot_len = IPH_HL_BYTES(iphdr); + 80100a0: 69fb ldr r3, [r7, #28] + 80100a2: 781b ldrb r3, [r3, #0] + 80100a4: f003 030f and.w r3, r3, #15 + 80100a8: b2db uxtb r3, r3 + 80100aa: 009b lsls r3, r3, #2 + 80100ac: b2db uxtb r3, r3 + 80100ae: 461a mov r2, r3 + 80100b0: 4b2a ldr r3, [pc, #168] @ (801015c ) + 80100b2: 819a strh r2, [r3, #12] + /* raw input did not eat the packet? */ + raw_status = raw_input(p, inp); + if (raw_status != RAW_INPUT_EATEN) +#endif /* LWIP_RAW */ + { + pbuf_remove_header(p, iphdr_hlen); /* Move to payload, no check necessary. */ + 80100b4: 8a7b ldrh r3, [r7, #18] + 80100b6: 4619 mov r1, r3 + 80100b8: 6878 ldr r0, [r7, #4] + 80100ba: f7f6 fc2f bl 800691c + + switch (IPH_PROTO(iphdr)) { + 80100be: 69fb ldr r3, [r7, #28] + 80100c0: 7a5b ldrb r3, [r3, #9] + 80100c2: 2b11 cmp r3, #17 + 80100c4: d006 beq.n 80100d4 + 80100c6: 2b11 cmp r3, #17 + 80100c8: dc13 bgt.n 80100f2 + 80100ca: 2b01 cmp r3, #1 + 80100cc: d00c beq.n 80100e8 + 80100ce: 2b06 cmp r3, #6 + 80100d0: d005 beq.n 80100de + 80100d2: e00e b.n 80100f2 + case IP_PROTO_UDP: +#if LWIP_UDPLITE + case IP_PROTO_UDPLITE: +#endif /* LWIP_UDPLITE */ + MIB2_STATS_INC(mib2.ipindelivers); + udp_input(p, inp); + 80100d4: 6839 ldr r1, [r7, #0] + 80100d6: 6878 ldr r0, [r7, #4] + 80100d8: f7fc fa94 bl 800c604 + break; + 80100dc: e026 b.n 801012c +#endif /* LWIP_UDP */ +#if LWIP_TCP + case IP_PROTO_TCP: + MIB2_STATS_INC(mib2.ipindelivers); + tcp_input(p, inp); + 80100de: 6839 ldr r1, [r7, #0] + 80100e0: 6878 ldr r0, [r7, #4] + 80100e2: f7f8 fadb bl 800869c + break; + 80100e6: e021 b.n 801012c +#endif /* LWIP_TCP */ +#if LWIP_ICMP + case IP_PROTO_ICMP: + MIB2_STATS_INC(mib2.ipindelivers); + icmp_input(p, inp); + 80100e8: 6839 ldr r1, [r7, #0] + 80100ea: 6878 ldr r0, [r7, #4] + 80100ec: f7ff fcd0 bl 800fa90 + break; + 80100f0: e01c b.n 801012c + } else +#endif /* LWIP_RAW */ + { +#if LWIP_ICMP + /* send ICMP destination protocol unreachable unless is was a broadcast */ + if (!ip4_addr_isbroadcast(ip4_current_dest_addr(), netif) && + 80100f2: 4b1a ldr r3, [pc, #104] @ (801015c ) + 80100f4: 695b ldr r3, [r3, #20] + 80100f6: 69b9 ldr r1, [r7, #24] + 80100f8: 4618 mov r0, r3 + 80100fa: f000 f90b bl 8010314 + 80100fe: 4603 mov r3, r0 + 8010100: 2b00 cmp r3, #0 + 8010102: d10f bne.n 8010124 + !ip4_addr_ismulticast(ip4_current_dest_addr())) { + 8010104: 4b15 ldr r3, [pc, #84] @ (801015c ) + 8010106: 695b ldr r3, [r3, #20] + 8010108: f003 03f0 and.w r3, r3, #240 @ 0xf0 + if (!ip4_addr_isbroadcast(ip4_current_dest_addr(), netif) && + 801010c: 2be0 cmp r3, #224 @ 0xe0 + 801010e: d009 beq.n 8010124 + pbuf_header_force(p, (s16_t)iphdr_hlen); /* Move to ip header, no check necessary. */ + 8010110: f9b7 3012 ldrsh.w r3, [r7, #18] + 8010114: 4619 mov r1, r3 + 8010116: 6878 ldr r0, [r7, #4] + 8010118: f7f6 fc73 bl 8006a02 + icmp_dest_unreach(p, ICMP_DUR_PROTO); + 801011c: 2102 movs r1, #2 + 801011e: 6878 ldr r0, [r7, #4] + 8010120: f7ff fdba bl 800fc98 + + IP_STATS_INC(ip.proterr); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinunknownprotos); + } + pbuf_free(p); + 8010124: 6878 ldr r0, [r7, #4] + 8010126: f7f6 fc7f bl 8006a28 + break; + 801012a: bf00 nop + } + } + + /* @todo: this is not really necessary... */ + ip_data.current_netif = NULL; + 801012c: 4b0b ldr r3, [pc, #44] @ (801015c ) + 801012e: 2200 movs r2, #0 + 8010130: 601a str r2, [r3, #0] + ip_data.current_input_netif = NULL; + 8010132: 4b0a ldr r3, [pc, #40] @ (801015c ) + 8010134: 2200 movs r2, #0 + 8010136: 605a str r2, [r3, #4] + ip_data.current_ip4_header = NULL; + 8010138: 4b08 ldr r3, [pc, #32] @ (801015c ) + 801013a: 2200 movs r2, #0 + 801013c: 609a str r2, [r3, #8] + ip_data.current_ip_header_tot_len = 0; + 801013e: 4b07 ldr r3, [pc, #28] @ (801015c ) + 8010140: 2200 movs r2, #0 + 8010142: 819a strh r2, [r3, #12] + ip4_addr_set_any(ip4_current_src_addr()); + 8010144: 4b05 ldr r3, [pc, #20] @ (801015c ) + 8010146: 2200 movs r2, #0 + 8010148: 611a str r2, [r3, #16] + ip4_addr_set_any(ip4_current_dest_addr()); + 801014a: 4b04 ldr r3, [pc, #16] @ (801015c ) + 801014c: 2200 movs r2, #0 + 801014e: 615a str r2, [r3, #20] + + return ERR_OK; + 8010150: 2300 movs r3, #0 +} + 8010152: 4618 mov r0, r3 + 8010154: 3720 adds r7, #32 + 8010156: 46bd mov sp, r7 + 8010158: bd80 pop {r7, pc} + 801015a: bf00 nop + 801015c: 2000614c .word 0x2000614c + 8010160: 20019098 .word 0x20019098 + +08010164 : + */ +err_t +ip4_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, + u8_t proto, struct netif *netif) +{ + 8010164: b580 push {r7, lr} + 8010166: b08a sub sp, #40 @ 0x28 + 8010168: af04 add r7, sp, #16 + 801016a: 60f8 str r0, [r7, #12] + 801016c: 60b9 str r1, [r7, #8] + 801016e: 607a str r2, [r7, #4] + 8010170: 70fb strb r3, [r7, #3] +ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, + u16_t optlen) +{ +#endif /* IP_OPTIONS_SEND */ + const ip4_addr_t *src_used = src; + 8010172: 68bb ldr r3, [r7, #8] + 8010174: 617b str r3, [r7, #20] + if (dest != LWIP_IP_HDRINCL) { + 8010176: 687b ldr r3, [r7, #4] + 8010178: 2b00 cmp r3, #0 + 801017a: d009 beq.n 8010190 + if (ip4_addr_isany(src)) { + 801017c: 68bb ldr r3, [r7, #8] + 801017e: 2b00 cmp r3, #0 + 8010180: d003 beq.n 801018a + 8010182: 68bb ldr r3, [r7, #8] + 8010184: 681b ldr r3, [r3, #0] + 8010186: 2b00 cmp r3, #0 + 8010188: d102 bne.n 8010190 + src_used = netif_ip4_addr(netif); + 801018a: 6abb ldr r3, [r7, #40] @ 0x28 + 801018c: 3304 adds r3, #4 + 801018e: 617b str r3, [r7, #20] + +#if IP_OPTIONS_SEND + return ip4_output_if_opt_src(p, src_used, dest, ttl, tos, proto, netif, + ip_options, optlen); +#else /* IP_OPTIONS_SEND */ + return ip4_output_if_src(p, src_used, dest, ttl, tos, proto, netif); + 8010190: 78fa ldrb r2, [r7, #3] + 8010192: 6abb ldr r3, [r7, #40] @ 0x28 + 8010194: 9302 str r3, [sp, #8] + 8010196: f897 3024 ldrb.w r3, [r7, #36] @ 0x24 + 801019a: 9301 str r3, [sp, #4] + 801019c: f897 3020 ldrb.w r3, [r7, #32] + 80101a0: 9300 str r3, [sp, #0] + 80101a2: 4613 mov r3, r2 + 80101a4: 687a ldr r2, [r7, #4] + 80101a6: 6979 ldr r1, [r7, #20] + 80101a8: 68f8 ldr r0, [r7, #12] + 80101aa: f000 f805 bl 80101b8 + 80101ae: 4603 mov r3, r0 +#endif /* IP_OPTIONS_SEND */ +} + 80101b0: 4618 mov r0, r3 + 80101b2: 3718 adds r7, #24 + 80101b4: 46bd mov sp, r7 + 80101b6: bd80 pop {r7, pc} + +080101b8 : + */ +err_t +ip4_output_if_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, + u8_t proto, struct netif *netif) +{ + 80101b8: b580 push {r7, lr} + 80101ba: b088 sub sp, #32 + 80101bc: af00 add r7, sp, #0 + 80101be: 60f8 str r0, [r7, #12] + 80101c0: 60b9 str r1, [r7, #8] + 80101c2: 607a str r2, [r7, #4] + 80101c4: 70fb strb r3, [r7, #3] +#if CHECKSUM_GEN_IP_INLINE + u32_t chk_sum = 0; +#endif /* CHECKSUM_GEN_IP_INLINE */ + + LWIP_ASSERT_CORE_LOCKED(); + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + 80101c6: 68fb ldr r3, [r7, #12] + 80101c8: 7b9b ldrb r3, [r3, #14] + 80101ca: 2b01 cmp r3, #1 + 80101cc: d006 beq.n 80101dc + 80101ce: 4b4b ldr r3, [pc, #300] @ (80102fc ) + 80101d0: f44f 7255 mov.w r2, #852 @ 0x354 + 80101d4: 494a ldr r1, [pc, #296] @ (8010300 ) + 80101d6: 484b ldr r0, [pc, #300] @ (8010304 ) + 80101d8: f001 fa0e bl 80115f8 + + MIB2_STATS_INC(mib2.ipoutrequests); + + /* Should the IP header be generated or is it already included in p? */ + if (dest != LWIP_IP_HDRINCL) { + 80101dc: 687b ldr r3, [r7, #4] + 80101de: 2b00 cmp r3, #0 + 80101e0: d060 beq.n 80102a4 + u16_t ip_hlen = IP_HLEN; + 80101e2: 2314 movs r3, #20 + 80101e4: 837b strh r3, [r7, #26] + } +#endif /* CHECKSUM_GEN_IP_INLINE */ + } +#endif /* IP_OPTIONS_SEND */ + /* generate IP header */ + if (pbuf_add_header(p, IP_HLEN)) { + 80101e6: 2114 movs r1, #20 + 80101e8: 68f8 ldr r0, [r7, #12] + 80101ea: f7f6 fb87 bl 80068fc + 80101ee: 4603 mov r3, r0 + 80101f0: 2b00 cmp r3, #0 + 80101f2: d002 beq.n 80101fa + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip4_output: not enough room for IP header in pbuf\n")); + + IP_STATS_INC(ip.err); + MIB2_STATS_INC(mib2.ipoutdiscards); + return ERR_BUF; + 80101f4: f06f 0301 mvn.w r3, #1 + 80101f8: e07c b.n 80102f4 + } + + iphdr = (struct ip_hdr *)p->payload; + 80101fa: 68fb ldr r3, [r7, #12] + 80101fc: 685b ldr r3, [r3, #4] + 80101fe: 61fb str r3, [r7, #28] + LWIP_ASSERT("check that first pbuf can hold struct ip_hdr", + 8010200: 68fb ldr r3, [r7, #12] + 8010202: 895b ldrh r3, [r3, #10] + 8010204: 2b13 cmp r3, #19 + 8010206: d806 bhi.n 8010216 + 8010208: 4b3c ldr r3, [pc, #240] @ (80102fc ) + 801020a: f44f 7262 mov.w r2, #904 @ 0x388 + 801020e: 493e ldr r1, [pc, #248] @ (8010308 ) + 8010210: 483c ldr r0, [pc, #240] @ (8010304 ) + 8010212: f001 f9f1 bl 80115f8 + (p->len >= sizeof(struct ip_hdr))); + + IPH_TTL_SET(iphdr, ttl); + 8010216: 69fb ldr r3, [r7, #28] + 8010218: 78fa ldrb r2, [r7, #3] + 801021a: 721a strb r2, [r3, #8] + IPH_PROTO_SET(iphdr, proto); + 801021c: 69fb ldr r3, [r7, #28] + 801021e: f897 202c ldrb.w r2, [r7, #44] @ 0x2c + 8010222: 725a strb r2, [r3, #9] +#if CHECKSUM_GEN_IP_INLINE + chk_sum += PP_NTOHS(proto | (ttl << 8)); +#endif /* CHECKSUM_GEN_IP_INLINE */ + + /* dest cannot be NULL here */ + ip4_addr_copy(iphdr->dest, *dest); + 8010224: 687b ldr r3, [r7, #4] + 8010226: 681a ldr r2, [r3, #0] + 8010228: 69fb ldr r3, [r7, #28] + 801022a: 611a str r2, [r3, #16] +#if CHECKSUM_GEN_IP_INLINE + chk_sum += ip4_addr_get_u32(&iphdr->dest) & 0xFFFF; + chk_sum += ip4_addr_get_u32(&iphdr->dest) >> 16; +#endif /* CHECKSUM_GEN_IP_INLINE */ + + IPH_VHL_SET(iphdr, 4, ip_hlen / 4); + 801022c: 8b7b ldrh r3, [r7, #26] + 801022e: 089b lsrs r3, r3, #2 + 8010230: b29b uxth r3, r3 + 8010232: b2db uxtb r3, r3 + 8010234: f043 0340 orr.w r3, r3, #64 @ 0x40 + 8010238: b2da uxtb r2, r3 + 801023a: 69fb ldr r3, [r7, #28] + 801023c: 701a strb r2, [r3, #0] + IPH_TOS_SET(iphdr, tos); + 801023e: 69fb ldr r3, [r7, #28] + 8010240: f897 2028 ldrb.w r2, [r7, #40] @ 0x28 + 8010244: 705a strb r2, [r3, #1] +#if CHECKSUM_GEN_IP_INLINE + chk_sum += PP_NTOHS(tos | (iphdr->_v_hl << 8)); +#endif /* CHECKSUM_GEN_IP_INLINE */ + IPH_LEN_SET(iphdr, lwip_htons(p->tot_len)); + 8010246: 68fb ldr r3, [r7, #12] + 8010248: 891b ldrh r3, [r3, #8] + 801024a: 4618 mov r0, r3 + 801024c: f7f5 f89c bl 8005388 + 8010250: 4603 mov r3, r0 + 8010252: 461a mov r2, r3 + 8010254: 69fb ldr r3, [r7, #28] + 8010256: 805a strh r2, [r3, #2] +#if CHECKSUM_GEN_IP_INLINE + chk_sum += iphdr->_len; +#endif /* CHECKSUM_GEN_IP_INLINE */ + IPH_OFFSET_SET(iphdr, 0); + 8010258: 69fb ldr r3, [r7, #28] + 801025a: 2200 movs r2, #0 + 801025c: 719a strb r2, [r3, #6] + 801025e: 2200 movs r2, #0 + 8010260: 71da strb r2, [r3, #7] + IPH_ID_SET(iphdr, lwip_htons(ip_id)); + 8010262: 4b2a ldr r3, [pc, #168] @ (801030c ) + 8010264: 881b ldrh r3, [r3, #0] + 8010266: 4618 mov r0, r3 + 8010268: f7f5 f88e bl 8005388 + 801026c: 4603 mov r3, r0 + 801026e: 461a mov r2, r3 + 8010270: 69fb ldr r3, [r7, #28] + 8010272: 809a strh r2, [r3, #4] +#if CHECKSUM_GEN_IP_INLINE + chk_sum += iphdr->_id; +#endif /* CHECKSUM_GEN_IP_INLINE */ + ++ip_id; + 8010274: 4b25 ldr r3, [pc, #148] @ (801030c ) + 8010276: 881b ldrh r3, [r3, #0] + 8010278: 3301 adds r3, #1 + 801027a: b29a uxth r2, r3 + 801027c: 4b23 ldr r3, [pc, #140] @ (801030c ) + 801027e: 801a strh r2, [r3, #0] + + if (src == NULL) { + 8010280: 68bb ldr r3, [r7, #8] + 8010282: 2b00 cmp r3, #0 + 8010284: d104 bne.n 8010290 + ip4_addr_copy(iphdr->src, *IP4_ADDR_ANY4); + 8010286: 4b22 ldr r3, [pc, #136] @ (8010310 ) + 8010288: 681a ldr r2, [r3, #0] + 801028a: 69fb ldr r3, [r7, #28] + 801028c: 60da str r2, [r3, #12] + 801028e: e003 b.n 8010298 + } else { + /* src cannot be NULL here */ + ip4_addr_copy(iphdr->src, *src); + 8010290: 68bb ldr r3, [r7, #8] + 8010292: 681a ldr r2, [r3, #0] + 8010294: 69fb ldr r3, [r7, #28] + 8010296: 60da str r2, [r3, #12] + else { + IPH_CHKSUM_SET(iphdr, 0); + } +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF*/ +#else /* CHECKSUM_GEN_IP_INLINE */ + IPH_CHKSUM_SET(iphdr, 0); + 8010298: 69fb ldr r3, [r7, #28] + 801029a: 2200 movs r2, #0 + 801029c: 729a strb r2, [r3, #10] + 801029e: 2200 movs r2, #0 + 80102a0: 72da strb r2, [r3, #11] + 80102a2: e00f b.n 80102c4 + } +#endif /* CHECKSUM_GEN_IP */ +#endif /* CHECKSUM_GEN_IP_INLINE */ + } else { + /* IP header already included in p */ + if (p->len < IP_HLEN) { + 80102a4: 68fb ldr r3, [r7, #12] + 80102a6: 895b ldrh r3, [r3, #10] + 80102a8: 2b13 cmp r3, #19 + 80102aa: d802 bhi.n 80102b2 + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip4_output: LWIP_IP_HDRINCL but pbuf is too short\n")); + IP_STATS_INC(ip.err); + MIB2_STATS_INC(mib2.ipoutdiscards); + return ERR_BUF; + 80102ac: f06f 0301 mvn.w r3, #1 + 80102b0: e020 b.n 80102f4 + } + iphdr = (struct ip_hdr *)p->payload; + 80102b2: 68fb ldr r3, [r7, #12] + 80102b4: 685b ldr r3, [r3, #4] + 80102b6: 61fb str r3, [r7, #28] + ip4_addr_copy(dest_addr, iphdr->dest); + 80102b8: 69fb ldr r3, [r7, #28] + 80102ba: 691b ldr r3, [r3, #16] + 80102bc: 617b str r3, [r7, #20] + dest = &dest_addr; + 80102be: f107 0314 add.w r3, r7, #20 + 80102c2: 607b str r3, [r7, #4] + } +#endif /* LWIP_MULTICAST_TX_OPTIONS */ +#endif /* ENABLE_LOOPBACK */ +#if IP_FRAG + /* don't fragment if interface has mtu set to 0 [loopif] */ + if (netif->mtu && (p->tot_len > netif->mtu)) { + 80102c4: 6b3b ldr r3, [r7, #48] @ 0x30 + 80102c6: 8d1b ldrh r3, [r3, #40] @ 0x28 + 80102c8: 2b00 cmp r3, #0 + 80102ca: d00c beq.n 80102e6 + 80102cc: 68fb ldr r3, [r7, #12] + 80102ce: 891a ldrh r2, [r3, #8] + 80102d0: 6b3b ldr r3, [r7, #48] @ 0x30 + 80102d2: 8d1b ldrh r3, [r3, #40] @ 0x28 + 80102d4: 429a cmp r2, r3 + 80102d6: d906 bls.n 80102e6 + return ip4_frag(p, netif, dest); + 80102d8: 687a ldr r2, [r7, #4] + 80102da: 6b39 ldr r1, [r7, #48] @ 0x30 + 80102dc: 68f8 ldr r0, [r7, #12] + 80102de: f000 fe91 bl 8011004 + 80102e2: 4603 mov r3, r0 + 80102e4: e006 b.n 80102f4 + } +#endif /* IP_FRAG */ + + LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: call netif->output()\n")); + return netif->output(netif, p, dest); + 80102e6: 6b3b ldr r3, [r7, #48] @ 0x30 + 80102e8: 695b ldr r3, [r3, #20] + 80102ea: 687a ldr r2, [r7, #4] + 80102ec: 68f9 ldr r1, [r7, #12] + 80102ee: 6b38 ldr r0, [r7, #48] @ 0x30 + 80102f0: 4798 blx r3 + 80102f2: 4603 mov r3, r0 +} + 80102f4: 4618 mov r0, r3 + 80102f6: 3720 adds r7, #32 + 80102f8: 46bd mov sp, r7 + 80102fa: bd80 pop {r7, pc} + 80102fc: 08018a14 .word 0x08018a14 + 8010300: 08018a48 .word 0x08018a48 + 8010304: 08018a54 .word 0x08018a54 + 8010308: 08018a7c .word 0x08018a7c + 801030c: 2001922a .word 0x2001922a + 8010310: 08018ed4 .word 0x08018ed4 + +08010314 : + * @param netif the network interface against which the address is checked + * @return returns non-zero if the address is a broadcast address + */ +u8_t +ip4_addr_isbroadcast_u32(u32_t addr, const struct netif *netif) +{ + 8010314: b480 push {r7} + 8010316: b085 sub sp, #20 + 8010318: af00 add r7, sp, #0 + 801031a: 6078 str r0, [r7, #4] + 801031c: 6039 str r1, [r7, #0] + ip4_addr_t ipaddr; + ip4_addr_set_u32(&ipaddr, addr); + 801031e: 687b ldr r3, [r7, #4] + 8010320: 60fb str r3, [r7, #12] + + /* all ones (broadcast) or all zeroes (old skool broadcast) */ + if ((~addr == IPADDR_ANY) || + 8010322: 687b ldr r3, [r7, #4] + 8010324: f1b3 3fff cmp.w r3, #4294967295 + 8010328: d002 beq.n 8010330 + 801032a: 687b ldr r3, [r7, #4] + 801032c: 2b00 cmp r3, #0 + 801032e: d101 bne.n 8010334 + (addr == IPADDR_ANY)) { + return 1; + 8010330: 2301 movs r3, #1 + 8010332: e02a b.n 801038a + /* no broadcast support on this network interface? */ + } else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) { + 8010334: 683b ldr r3, [r7, #0] + 8010336: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 801033a: f003 0302 and.w r3, r3, #2 + 801033e: 2b00 cmp r3, #0 + 8010340: d101 bne.n 8010346 + /* the given address cannot be a broadcast address + * nor can we check against any broadcast addresses */ + return 0; + 8010342: 2300 movs r3, #0 + 8010344: e021 b.n 801038a + /* address matches network interface address exactly? => no broadcast */ + } else if (addr == ip4_addr_get_u32(netif_ip4_addr(netif))) { + 8010346: 683b ldr r3, [r7, #0] + 8010348: 3304 adds r3, #4 + 801034a: 681b ldr r3, [r3, #0] + 801034c: 687a ldr r2, [r7, #4] + 801034e: 429a cmp r2, r3 + 8010350: d101 bne.n 8010356 + return 0; + 8010352: 2300 movs r3, #0 + 8010354: e019 b.n 801038a + /* on the same (sub) network... */ + } else if (ip4_addr_netcmp(&ipaddr, netif_ip4_addr(netif), netif_ip4_netmask(netif)) + 8010356: 68fa ldr r2, [r7, #12] + 8010358: 683b ldr r3, [r7, #0] + 801035a: 3304 adds r3, #4 + 801035c: 681b ldr r3, [r3, #0] + 801035e: 405a eors r2, r3 + 8010360: 683b ldr r3, [r7, #0] + 8010362: 3308 adds r3, #8 + 8010364: 681b ldr r3, [r3, #0] + 8010366: 4013 ands r3, r2 + 8010368: 2b00 cmp r3, #0 + 801036a: d10d bne.n 8010388 + /* ...and host identifier bits are all ones? =>... */ + && ((addr & ~ip4_addr_get_u32(netif_ip4_netmask(netif))) == + 801036c: 683b ldr r3, [r7, #0] + 801036e: 3308 adds r3, #8 + 8010370: 681b ldr r3, [r3, #0] + 8010372: 43da mvns r2, r3 + 8010374: 687b ldr r3, [r7, #4] + 8010376: 401a ands r2, r3 + (IPADDR_BROADCAST & ~ip4_addr_get_u32(netif_ip4_netmask(netif))))) { + 8010378: 683b ldr r3, [r7, #0] + 801037a: 3308 adds r3, #8 + 801037c: 681b ldr r3, [r3, #0] + 801037e: 43db mvns r3, r3 + && ((addr & ~ip4_addr_get_u32(netif_ip4_netmask(netif))) == + 8010380: 429a cmp r2, r3 + 8010382: d101 bne.n 8010388 + /* => network broadcast address */ + return 1; + 8010384: 2301 movs r3, #1 + 8010386: e000 b.n 801038a + } else { + return 0; + 8010388: 2300 movs r3, #0 + } +} + 801038a: 4618 mov r0, r3 + 801038c: 3714 adds r7, #20 + 801038e: 46bd mov sp, r7 + 8010390: f85d 7b04 ldr.w r7, [sp], #4 + 8010394: 4770 bx lr + +08010396 : + * @param cp IP address in ascii representation (e.g. "127.0.0.1") + * @return ip address in network order + */ +u32_t +ipaddr_addr(const char *cp) +{ + 8010396: b580 push {r7, lr} + 8010398: b084 sub sp, #16 + 801039a: af00 add r7, sp, #0 + 801039c: 6078 str r0, [r7, #4] + ip4_addr_t val; + + if (ip4addr_aton(cp, &val)) { + 801039e: f107 030c add.w r3, r7, #12 + 80103a2: 4619 mov r1, r3 + 80103a4: 6878 ldr r0, [r7, #4] + 80103a6: f000 f80b bl 80103c0 + 80103aa: 4603 mov r3, r0 + 80103ac: 2b00 cmp r3, #0 + 80103ae: d001 beq.n 80103b4 + return ip4_addr_get_u32(&val); + 80103b0: 68fb ldr r3, [r7, #12] + 80103b2: e001 b.n 80103b8 + } + return (IPADDR_NONE); + 80103b4: f04f 33ff mov.w r3, #4294967295 +} + 80103b8: 4618 mov r0, r3 + 80103ba: 3710 adds r7, #16 + 80103bc: 46bd mov sp, r7 + 80103be: bd80 pop {r7, pc} + +080103c0 : + * @param addr pointer to which to save the ip address in network order + * @return 1 if cp could be converted to addr, 0 on failure + */ +int +ip4addr_aton(const char *cp, ip4_addr_t *addr) +{ + 80103c0: b580 push {r7, lr} + 80103c2: b08a sub sp, #40 @ 0x28 + 80103c4: af00 add r7, sp, #0 + 80103c6: 6078 str r0, [r7, #4] + 80103c8: 6039 str r1, [r7, #0] + u32_t val; + u8_t base; + char c; + u32_t parts[4]; + u32_t *pp = parts; + 80103ca: f107 030c add.w r3, r7, #12 + 80103ce: 61fb str r3, [r7, #28] + + c = *cp; + 80103d0: 687b ldr r3, [r7, #4] + 80103d2: 781b ldrb r3, [r3, #0] + 80103d4: f887 3022 strb.w r3, [r7, #34] @ 0x22 + /* + * Collect number up to ``.''. + * Values are specified as for C: + * 0x=hex, 0=octal, 1-9=decimal. + */ + if (!lwip_isdigit(c)) { + 80103d8: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 80103dc: 3301 adds r3, #1 + 80103de: 4a89 ldr r2, [pc, #548] @ (8010604 ) + 80103e0: 4413 add r3, r2 + 80103e2: 781b ldrb r3, [r3, #0] + 80103e4: f003 0304 and.w r3, r3, #4 + 80103e8: 2b00 cmp r3, #0 + 80103ea: d101 bne.n 80103f0 + return 0; + 80103ec: 2300 movs r3, #0 + 80103ee: e105 b.n 80105fc + } + val = 0; + 80103f0: 2300 movs r3, #0 + 80103f2: 627b str r3, [r7, #36] @ 0x24 + base = 10; + 80103f4: 230a movs r3, #10 + 80103f6: f887 3023 strb.w r3, [r7, #35] @ 0x23 + if (c == '0') { + 80103fa: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 80103fe: 2b30 cmp r3, #48 @ 0x30 + 8010400: d11c bne.n 801043c + c = *++cp; + 8010402: 687b ldr r3, [r7, #4] + 8010404: 3301 adds r3, #1 + 8010406: 607b str r3, [r7, #4] + 8010408: 687b ldr r3, [r7, #4] + 801040a: 781b ldrb r3, [r3, #0] + 801040c: f887 3022 strb.w r3, [r7, #34] @ 0x22 + if (c == 'x' || c == 'X') { + 8010410: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 8010414: 2b78 cmp r3, #120 @ 0x78 + 8010416: d003 beq.n 8010420 + 8010418: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 801041c: 2b58 cmp r3, #88 @ 0x58 + 801041e: d10a bne.n 8010436 + base = 16; + 8010420: 2310 movs r3, #16 + 8010422: f887 3023 strb.w r3, [r7, #35] @ 0x23 + c = *++cp; + 8010426: 687b ldr r3, [r7, #4] + 8010428: 3301 adds r3, #1 + 801042a: 607b str r3, [r7, #4] + 801042c: 687b ldr r3, [r7, #4] + 801042e: 781b ldrb r3, [r3, #0] + 8010430: f887 3022 strb.w r3, [r7, #34] @ 0x22 + 8010434: e002 b.n 801043c + } else { + base = 8; + 8010436: 2308 movs r3, #8 + 8010438: f887 3023 strb.w r3, [r7, #35] @ 0x23 + } + } + for (;;) { + if (lwip_isdigit(c)) { + 801043c: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 8010440: 3301 adds r3, #1 + 8010442: 4a70 ldr r2, [pc, #448] @ (8010604 ) + 8010444: 4413 add r3, r2 + 8010446: 781b ldrb r3, [r3, #0] + 8010448: f003 0304 and.w r3, r3, #4 + 801044c: 2b00 cmp r3, #0 + 801044e: d011 beq.n 8010474 + val = (val * base) + (u32_t)(c - '0'); + 8010450: f897 3023 ldrb.w r3, [r7, #35] @ 0x23 + 8010454: 6a7a ldr r2, [r7, #36] @ 0x24 + 8010456: fb03 f202 mul.w r2, r3, r2 + 801045a: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 801045e: 4413 add r3, r2 + 8010460: 3b30 subs r3, #48 @ 0x30 + 8010462: 627b str r3, [r7, #36] @ 0x24 + c = *++cp; + 8010464: 687b ldr r3, [r7, #4] + 8010466: 3301 adds r3, #1 + 8010468: 607b str r3, [r7, #4] + 801046a: 687b ldr r3, [r7, #4] + 801046c: 781b ldrb r3, [r3, #0] + 801046e: f887 3022 strb.w r3, [r7, #34] @ 0x22 + 8010472: e7e3 b.n 801043c + } else if (base == 16 && lwip_isxdigit(c)) { + 8010474: f897 3023 ldrb.w r3, [r7, #35] @ 0x23 + 8010478: 2b10 cmp r3, #16 + 801047a: d127 bne.n 80104cc + 801047c: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 8010480: 3301 adds r3, #1 + 8010482: 4a60 ldr r2, [pc, #384] @ (8010604 ) + 8010484: 4413 add r3, r2 + 8010486: 781b ldrb r3, [r3, #0] + 8010488: f003 0344 and.w r3, r3, #68 @ 0x44 + 801048c: 2b00 cmp r3, #0 + 801048e: d01d beq.n 80104cc + val = (val << 4) | (u32_t)(c + 10 - (lwip_islower(c) ? 'a' : 'A')); + 8010490: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010492: 011b lsls r3, r3, #4 + 8010494: f897 2022 ldrb.w r2, [r7, #34] @ 0x22 + 8010498: f102 010a add.w r1, r2, #10 + 801049c: f897 2022 ldrb.w r2, [r7, #34] @ 0x22 + 80104a0: 3201 adds r2, #1 + 80104a2: 4858 ldr r0, [pc, #352] @ (8010604 ) + 80104a4: 4402 add r2, r0 + 80104a6: 7812 ldrb r2, [r2, #0] + 80104a8: f002 0203 and.w r2, r2, #3 + 80104ac: 2a02 cmp r2, #2 + 80104ae: d101 bne.n 80104b4 + 80104b0: 2261 movs r2, #97 @ 0x61 + 80104b2: e000 b.n 80104b6 + 80104b4: 2241 movs r2, #65 @ 0x41 + 80104b6: 1a8a subs r2, r1, r2 + 80104b8: 4313 orrs r3, r2 + 80104ba: 627b str r3, [r7, #36] @ 0x24 + c = *++cp; + 80104bc: 687b ldr r3, [r7, #4] + 80104be: 3301 adds r3, #1 + 80104c0: 607b str r3, [r7, #4] + 80104c2: 687b ldr r3, [r7, #4] + 80104c4: 781b ldrb r3, [r3, #0] + 80104c6: f887 3022 strb.w r3, [r7, #34] @ 0x22 + if (lwip_isdigit(c)) { + 80104ca: e7b7 b.n 801043c + } else { + break; + } + } + if (c == '.') { + 80104cc: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 80104d0: 2b2e cmp r3, #46 @ 0x2e + 80104d2: d114 bne.n 80104fe + * Internet format: + * a.b.c.d + * a.b.c (with c treated as 16 bits) + * a.b (with b treated as 24 bits) + */ + if (pp >= parts + 3) { + 80104d4: f107 030c add.w r3, r7, #12 + 80104d8: 330c adds r3, #12 + 80104da: 69fa ldr r2, [r7, #28] + 80104dc: 429a cmp r2, r3 + 80104de: d301 bcc.n 80104e4 + return 0; + 80104e0: 2300 movs r3, #0 + 80104e2: e08b b.n 80105fc + } + *pp++ = val; + 80104e4: 69fb ldr r3, [r7, #28] + 80104e6: 1d1a adds r2, r3, #4 + 80104e8: 61fa str r2, [r7, #28] + 80104ea: 6a7a ldr r2, [r7, #36] @ 0x24 + 80104ec: 601a str r2, [r3, #0] + c = *++cp; + 80104ee: 687b ldr r3, [r7, #4] + 80104f0: 3301 adds r3, #1 + 80104f2: 607b str r3, [r7, #4] + 80104f4: 687b ldr r3, [r7, #4] + 80104f6: 781b ldrb r3, [r3, #0] + 80104f8: f887 3022 strb.w r3, [r7, #34] @ 0x22 + if (!lwip_isdigit(c)) { + 80104fc: e76c b.n 80103d8 + } else { + break; + 80104fe: bf00 nop + } + } + /* + * Check for trailing characters. + */ + if (c != '\0' && !lwip_isspace(c)) { + 8010500: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 8010504: 2b00 cmp r3, #0 + 8010506: d00b beq.n 8010520 + 8010508: f897 3022 ldrb.w r3, [r7, #34] @ 0x22 + 801050c: 3301 adds r3, #1 + 801050e: 4a3d ldr r2, [pc, #244] @ (8010604 ) + 8010510: 4413 add r3, r2 + 8010512: 781b ldrb r3, [r3, #0] + 8010514: f003 0308 and.w r3, r3, #8 + 8010518: 2b00 cmp r3, #0 + 801051a: d101 bne.n 8010520 + return 0; + 801051c: 2300 movs r3, #0 + 801051e: e06d b.n 80105fc + } + /* + * Concoct the address according to + * the number of parts specified. + */ + switch (pp - parts + 1) { + 8010520: f107 030c add.w r3, r7, #12 + 8010524: 69fa ldr r2, [r7, #28] + 8010526: 1ad3 subs r3, r2, r3 + 8010528: 109b asrs r3, r3, #2 + 801052a: 3301 adds r3, #1 + 801052c: 2b04 cmp r3, #4 + 801052e: d853 bhi.n 80105d8 + 8010530: a201 add r2, pc, #4 @ (adr r2, 8010538 ) + 8010532: f852 f023 ldr.w pc, [r2, r3, lsl #2] + 8010536: bf00 nop + 8010538: 0801054d .word 0x0801054d + 801053c: 080105e7 .word 0x080105e7 + 8010540: 08010551 .word 0x08010551 + 8010544: 08010573 .word 0x08010573 + 8010548: 080105a1 .word 0x080105a1 + + case 0: + return 0; /* initial nondigit */ + 801054c: 2300 movs r3, #0 + 801054e: e055 b.n 80105fc + + case 1: /* a -- 32 bits */ + break; + + case 2: /* a.b -- 8.24 bits */ + if (val > 0xffffffUL) { + 8010550: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010552: f1b3 7f80 cmp.w r3, #16777216 @ 0x1000000 + 8010556: d301 bcc.n 801055c + return 0; + 8010558: 2300 movs r3, #0 + 801055a: e04f b.n 80105fc + } + if (parts[0] > 0xff) { + 801055c: 68fb ldr r3, [r7, #12] + 801055e: 2bff cmp r3, #255 @ 0xff + 8010560: d901 bls.n 8010566 + return 0; + 8010562: 2300 movs r3, #0 + 8010564: e04a b.n 80105fc + } + val |= parts[0] << 24; + 8010566: 68fb ldr r3, [r7, #12] + 8010568: 061b lsls r3, r3, #24 + 801056a: 6a7a ldr r2, [r7, #36] @ 0x24 + 801056c: 4313 orrs r3, r2 + 801056e: 627b str r3, [r7, #36] @ 0x24 + break; + 8010570: e03a b.n 80105e8 + + case 3: /* a.b.c -- 8.8.16 bits */ + if (val > 0xffff) { + 8010572: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010574: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 8010578: d301 bcc.n 801057e + return 0; + 801057a: 2300 movs r3, #0 + 801057c: e03e b.n 80105fc + } + if ((parts[0] > 0xff) || (parts[1] > 0xff)) { + 801057e: 68fb ldr r3, [r7, #12] + 8010580: 2bff cmp r3, #255 @ 0xff + 8010582: d802 bhi.n 801058a + 8010584: 693b ldr r3, [r7, #16] + 8010586: 2bff cmp r3, #255 @ 0xff + 8010588: d901 bls.n 801058e + return 0; + 801058a: 2300 movs r3, #0 + 801058c: e036 b.n 80105fc + } + val |= (parts[0] << 24) | (parts[1] << 16); + 801058e: 68fb ldr r3, [r7, #12] + 8010590: 061a lsls r2, r3, #24 + 8010592: 693b ldr r3, [r7, #16] + 8010594: 041b lsls r3, r3, #16 + 8010596: 4313 orrs r3, r2 + 8010598: 6a7a ldr r2, [r7, #36] @ 0x24 + 801059a: 4313 orrs r3, r2 + 801059c: 627b str r3, [r7, #36] @ 0x24 + break; + 801059e: e023 b.n 80105e8 + + case 4: /* a.b.c.d -- 8.8.8.8 bits */ + if (val > 0xff) { + 80105a0: 6a7b ldr r3, [r7, #36] @ 0x24 + 80105a2: 2bff cmp r3, #255 @ 0xff + 80105a4: d901 bls.n 80105aa + return 0; + 80105a6: 2300 movs r3, #0 + 80105a8: e028 b.n 80105fc + } + if ((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff)) { + 80105aa: 68fb ldr r3, [r7, #12] + 80105ac: 2bff cmp r3, #255 @ 0xff + 80105ae: d805 bhi.n 80105bc + 80105b0: 693b ldr r3, [r7, #16] + 80105b2: 2bff cmp r3, #255 @ 0xff + 80105b4: d802 bhi.n 80105bc + 80105b6: 697b ldr r3, [r7, #20] + 80105b8: 2bff cmp r3, #255 @ 0xff + 80105ba: d901 bls.n 80105c0 + return 0; + 80105bc: 2300 movs r3, #0 + 80105be: e01d b.n 80105fc + } + val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + 80105c0: 68fb ldr r3, [r7, #12] + 80105c2: 061a lsls r2, r3, #24 + 80105c4: 693b ldr r3, [r7, #16] + 80105c6: 041b lsls r3, r3, #16 + 80105c8: 431a orrs r2, r3 + 80105ca: 697b ldr r3, [r7, #20] + 80105cc: 021b lsls r3, r3, #8 + 80105ce: 4313 orrs r3, r2 + 80105d0: 6a7a ldr r2, [r7, #36] @ 0x24 + 80105d2: 4313 orrs r3, r2 + 80105d4: 627b str r3, [r7, #36] @ 0x24 + break; + 80105d6: e007 b.n 80105e8 + default: + LWIP_ASSERT("unhandled", 0); + 80105d8: 4b0b ldr r3, [pc, #44] @ (8010608 ) + 80105da: 22f9 movs r2, #249 @ 0xf9 + 80105dc: 490b ldr r1, [pc, #44] @ (801060c ) + 80105de: 480c ldr r0, [pc, #48] @ (8010610 ) + 80105e0: f001 f80a bl 80115f8 + break; + 80105e4: e000 b.n 80105e8 + break; + 80105e6: bf00 nop + } + if (addr) { + 80105e8: 683b ldr r3, [r7, #0] + 80105ea: 2b00 cmp r3, #0 + 80105ec: d005 beq.n 80105fa + ip4_addr_set_u32(addr, lwip_htonl(val)); + 80105ee: 6a78 ldr r0, [r7, #36] @ 0x24 + 80105f0: f7f4 fedf bl 80053b2 + 80105f4: 4602 mov r2, r0 + 80105f6: 683b ldr r3, [r7, #0] + 80105f8: 601a str r2, [r3, #0] + } + return 1; + 80105fa: 2301 movs r3, #1 +} + 80105fc: 4618 mov r0, r3 + 80105fe: 3728 adds r7, #40 @ 0x28 + 8010600: 46bd mov sp, r7 + 8010602: bd80 pop {r7, pc} + 8010604: 08018eea .word 0x08018eea + 8010608: 08018aac .word 0x08018aac + 801060c: 08018ae8 .word 0x08018ae8 + 8010610: 08018af4 .word 0x08018af4 + +08010614 : + * + * Should be called every 1000 msec (defined by IP_TMR_INTERVAL). + */ +void +ip_reass_tmr(void) +{ + 8010614: b580 push {r7, lr} + 8010616: b084 sub sp, #16 + 8010618: af00 add r7, sp, #0 + struct ip_reassdata *r, *prev = NULL; + 801061a: 2300 movs r3, #0 + 801061c: 60bb str r3, [r7, #8] + + r = reassdatagrams; + 801061e: 4b12 ldr r3, [pc, #72] @ (8010668 ) + 8010620: 681b ldr r3, [r3, #0] + 8010622: 60fb str r3, [r7, #12] + while (r != NULL) { + 8010624: e018 b.n 8010658 + /* Decrement the timer. Once it reaches 0, + * clean up the incomplete fragment assembly */ + if (r->timer > 0) { + 8010626: 68fb ldr r3, [r7, #12] + 8010628: 7fdb ldrb r3, [r3, #31] + 801062a: 2b00 cmp r3, #0 + 801062c: d00b beq.n 8010646 + r->timer--; + 801062e: 68fb ldr r3, [r7, #12] + 8010630: 7fdb ldrb r3, [r3, #31] + 8010632: 3b01 subs r3, #1 + 8010634: b2da uxtb r2, r3 + 8010636: 68fb ldr r3, [r7, #12] + 8010638: 77da strb r2, [r3, #31] + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer dec %"U16_F"\n", (u16_t)r->timer)); + prev = r; + 801063a: 68fb ldr r3, [r7, #12] + 801063c: 60bb str r3, [r7, #8] + r = r->next; + 801063e: 68fb ldr r3, [r7, #12] + 8010640: 681b ldr r3, [r3, #0] + 8010642: 60fb str r3, [r7, #12] + 8010644: e008 b.n 8010658 + } else { + /* reassembly timed out */ + struct ip_reassdata *tmp; + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n")); + tmp = r; + 8010646: 68fb ldr r3, [r7, #12] + 8010648: 607b str r3, [r7, #4] + /* get the next pointer before freeing */ + r = r->next; + 801064a: 68fb ldr r3, [r7, #12] + 801064c: 681b ldr r3, [r3, #0] + 801064e: 60fb str r3, [r7, #12] + /* free the helper struct and all enqueued pbufs */ + ip_reass_free_complete_datagram(tmp, prev); + 8010650: 68b9 ldr r1, [r7, #8] + 8010652: 6878 ldr r0, [r7, #4] + 8010654: f000 f80a bl 801066c + while (r != NULL) { + 8010658: 68fb ldr r3, [r7, #12] + 801065a: 2b00 cmp r3, #0 + 801065c: d1e3 bne.n 8010626 + } + } +} + 801065e: bf00 nop + 8010660: bf00 nop + 8010662: 3710 adds r7, #16 + 8010664: 46bd mov sp, r7 + 8010666: bd80 pop {r7, pc} + 8010668: 2001922c .word 0x2001922c + +0801066c : + * @param prev the previous datagram in the linked list + * @return the number of pbufs freed + */ +static int +ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev) +{ + 801066c: b580 push {r7, lr} + 801066e: b088 sub sp, #32 + 8010670: af00 add r7, sp, #0 + 8010672: 6078 str r0, [r7, #4] + 8010674: 6039 str r1, [r7, #0] + u16_t pbufs_freed = 0; + 8010676: 2300 movs r3, #0 + 8010678: 83fb strh r3, [r7, #30] + u16_t clen; + struct pbuf *p; + struct ip_reass_helper *iprh; + + LWIP_ASSERT("prev != ipr", prev != ipr); + 801067a: 683a ldr r2, [r7, #0] + 801067c: 687b ldr r3, [r7, #4] + 801067e: 429a cmp r2, r3 + 8010680: d105 bne.n 801068e + 8010682: 4b45 ldr r3, [pc, #276] @ (8010798 ) + 8010684: 22ab movs r2, #171 @ 0xab + 8010686: 4945 ldr r1, [pc, #276] @ (801079c ) + 8010688: 4845 ldr r0, [pc, #276] @ (80107a0 ) + 801068a: f000 ffb5 bl 80115f8 + if (prev != NULL) { + 801068e: 683b ldr r3, [r7, #0] + 8010690: 2b00 cmp r3, #0 + 8010692: d00a beq.n 80106aa + LWIP_ASSERT("prev->next == ipr", prev->next == ipr); + 8010694: 683b ldr r3, [r7, #0] + 8010696: 681b ldr r3, [r3, #0] + 8010698: 687a ldr r2, [r7, #4] + 801069a: 429a cmp r2, r3 + 801069c: d005 beq.n 80106aa + 801069e: 4b3e ldr r3, [pc, #248] @ (8010798 ) + 80106a0: 22ad movs r2, #173 @ 0xad + 80106a2: 4940 ldr r1, [pc, #256] @ (80107a4 ) + 80106a4: 483e ldr r0, [pc, #248] @ (80107a0 ) + 80106a6: f000 ffa7 bl 80115f8 + } + + MIB2_STATS_INC(mib2.ipreasmfails); +#if LWIP_ICMP + iprh = (struct ip_reass_helper *)ipr->p->payload; + 80106aa: 687b ldr r3, [r7, #4] + 80106ac: 685b ldr r3, [r3, #4] + 80106ae: 685b ldr r3, [r3, #4] + 80106b0: 617b str r3, [r7, #20] + if (iprh->start == 0) { + 80106b2: 697b ldr r3, [r7, #20] + 80106b4: 889b ldrh r3, [r3, #4] + 80106b6: b29b uxth r3, r3 + 80106b8: 2b00 cmp r3, #0 + 80106ba: d12a bne.n 8010712 + /* The first fragment was received, send ICMP time exceeded. */ + /* First, de-queue the first pbuf from r->p. */ + p = ipr->p; + 80106bc: 687b ldr r3, [r7, #4] + 80106be: 685b ldr r3, [r3, #4] + 80106c0: 61bb str r3, [r7, #24] + ipr->p = iprh->next_pbuf; + 80106c2: 697b ldr r3, [r7, #20] + 80106c4: 681a ldr r2, [r3, #0] + 80106c6: 687b ldr r3, [r7, #4] + 80106c8: 605a str r2, [r3, #4] + /* Then, copy the original header into it. */ + SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN); + 80106ca: 69bb ldr r3, [r7, #24] + 80106cc: 6858 ldr r0, [r3, #4] + 80106ce: 687b ldr r3, [r7, #4] + 80106d0: 3308 adds r3, #8 + 80106d2: 2214 movs r2, #20 + 80106d4: 4619 mov r1, r3 + 80106d6: f001 f88b bl 80117f0 + icmp_time_exceeded(p, ICMP_TE_FRAG); + 80106da: 2101 movs r1, #1 + 80106dc: 69b8 ldr r0, [r7, #24] + 80106de: f7ff faeb bl 800fcb8 + clen = pbuf_clen(p); + 80106e2: 69b8 ldr r0, [r7, #24] + 80106e4: f7f6 fa28 bl 8006b38 + 80106e8: 4603 mov r3, r0 + 80106ea: 827b strh r3, [r7, #18] + LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff); + 80106ec: 8bfa ldrh r2, [r7, #30] + 80106ee: 8a7b ldrh r3, [r7, #18] + 80106f0: 4413 add r3, r2 + 80106f2: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 80106f6: db05 blt.n 8010704 + 80106f8: 4b27 ldr r3, [pc, #156] @ (8010798 ) + 80106fa: 22bc movs r2, #188 @ 0xbc + 80106fc: 492a ldr r1, [pc, #168] @ (80107a8 ) + 80106fe: 4828 ldr r0, [pc, #160] @ (80107a0 ) + 8010700: f000 ff7a bl 80115f8 + pbufs_freed = (u16_t)(pbufs_freed + clen); + 8010704: 8bfa ldrh r2, [r7, #30] + 8010706: 8a7b ldrh r3, [r7, #18] + 8010708: 4413 add r3, r2 + 801070a: 83fb strh r3, [r7, #30] + pbuf_free(p); + 801070c: 69b8 ldr r0, [r7, #24] + 801070e: f7f6 f98b bl 8006a28 + } +#endif /* LWIP_ICMP */ + + /* First, free all received pbufs. The individual pbufs need to be released + separately as they have not yet been chained */ + p = ipr->p; + 8010712: 687b ldr r3, [r7, #4] + 8010714: 685b ldr r3, [r3, #4] + 8010716: 61bb str r3, [r7, #24] + while (p != NULL) { + 8010718: e01f b.n 801075a + struct pbuf *pcur; + iprh = (struct ip_reass_helper *)p->payload; + 801071a: 69bb ldr r3, [r7, #24] + 801071c: 685b ldr r3, [r3, #4] + 801071e: 617b str r3, [r7, #20] + pcur = p; + 8010720: 69bb ldr r3, [r7, #24] + 8010722: 60fb str r3, [r7, #12] + /* get the next pointer before freeing */ + p = iprh->next_pbuf; + 8010724: 697b ldr r3, [r7, #20] + 8010726: 681b ldr r3, [r3, #0] + 8010728: 61bb str r3, [r7, #24] + clen = pbuf_clen(pcur); + 801072a: 68f8 ldr r0, [r7, #12] + 801072c: f7f6 fa04 bl 8006b38 + 8010730: 4603 mov r3, r0 + 8010732: 827b strh r3, [r7, #18] + LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff); + 8010734: 8bfa ldrh r2, [r7, #30] + 8010736: 8a7b ldrh r3, [r7, #18] + 8010738: 4413 add r3, r2 + 801073a: f5b3 3f80 cmp.w r3, #65536 @ 0x10000 + 801073e: db05 blt.n 801074c + 8010740: 4b15 ldr r3, [pc, #84] @ (8010798 ) + 8010742: 22cc movs r2, #204 @ 0xcc + 8010744: 4918 ldr r1, [pc, #96] @ (80107a8 ) + 8010746: 4816 ldr r0, [pc, #88] @ (80107a0 ) + 8010748: f000 ff56 bl 80115f8 + pbufs_freed = (u16_t)(pbufs_freed + clen); + 801074c: 8bfa ldrh r2, [r7, #30] + 801074e: 8a7b ldrh r3, [r7, #18] + 8010750: 4413 add r3, r2 + 8010752: 83fb strh r3, [r7, #30] + pbuf_free(pcur); + 8010754: 68f8 ldr r0, [r7, #12] + 8010756: f7f6 f967 bl 8006a28 + while (p != NULL) { + 801075a: 69bb ldr r3, [r7, #24] + 801075c: 2b00 cmp r3, #0 + 801075e: d1dc bne.n 801071a + } + /* Then, unchain the struct ip_reassdata from the list and free it. */ + ip_reass_dequeue_datagram(ipr, prev); + 8010760: 6839 ldr r1, [r7, #0] + 8010762: 6878 ldr r0, [r7, #4] + 8010764: f000 f8c2 bl 80108ec + LWIP_ASSERT("ip_reass_pbufcount >= pbufs_freed", ip_reass_pbufcount >= pbufs_freed); + 8010768: 4b10 ldr r3, [pc, #64] @ (80107ac ) + 801076a: 881b ldrh r3, [r3, #0] + 801076c: 8bfa ldrh r2, [r7, #30] + 801076e: 429a cmp r2, r3 + 8010770: d905 bls.n 801077e + 8010772: 4b09 ldr r3, [pc, #36] @ (8010798 ) + 8010774: 22d2 movs r2, #210 @ 0xd2 + 8010776: 490e ldr r1, [pc, #56] @ (80107b0 ) + 8010778: 4809 ldr r0, [pc, #36] @ (80107a0 ) + 801077a: f000 ff3d bl 80115f8 + ip_reass_pbufcount = (u16_t)(ip_reass_pbufcount - pbufs_freed); + 801077e: 4b0b ldr r3, [pc, #44] @ (80107ac ) + 8010780: 881a ldrh r2, [r3, #0] + 8010782: 8bfb ldrh r3, [r7, #30] + 8010784: 1ad3 subs r3, r2, r3 + 8010786: b29a uxth r2, r3 + 8010788: 4b08 ldr r3, [pc, #32] @ (80107ac ) + 801078a: 801a strh r2, [r3, #0] + + return pbufs_freed; + 801078c: 8bfb ldrh r3, [r7, #30] +} + 801078e: 4618 mov r0, r3 + 8010790: 3720 adds r7, #32 + 8010792: 46bd mov sp, r7 + 8010794: bd80 pop {r7, pc} + 8010796: bf00 nop + 8010798: 08018b1c .word 0x08018b1c + 801079c: 08018b58 .word 0x08018b58 + 80107a0: 08018b64 .word 0x08018b64 + 80107a4: 08018b8c .word 0x08018b8c + 80107a8: 08018ba0 .word 0x08018ba0 + 80107ac: 20019230 .word 0x20019230 + 80107b0: 08018bc0 .word 0x08018bc0 + +080107b4 : + * (used for freeing other datagrams if not enough space) + * @return the number of pbufs freed + */ +static int +ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed) +{ + 80107b4: b580 push {r7, lr} + 80107b6: b08a sub sp, #40 @ 0x28 + 80107b8: af00 add r7, sp, #0 + 80107ba: 6078 str r0, [r7, #4] + 80107bc: 6039 str r1, [r7, #0] + /* @todo Can't we simply remove the last datagram in the + * linked list behind reassdatagrams? + */ + struct ip_reassdata *r, *oldest, *prev, *oldest_prev; + int pbufs_freed = 0, pbufs_freed_current; + 80107be: 2300 movs r3, #0 + 80107c0: 617b str r3, [r7, #20] + int other_datagrams; + + /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs, + * but don't free the datagram that 'fraghdr' belongs to! */ + do { + oldest = NULL; + 80107c2: 2300 movs r3, #0 + 80107c4: 623b str r3, [r7, #32] + prev = NULL; + 80107c6: 2300 movs r3, #0 + 80107c8: 61fb str r3, [r7, #28] + oldest_prev = NULL; + 80107ca: 2300 movs r3, #0 + 80107cc: 61bb str r3, [r7, #24] + other_datagrams = 0; + 80107ce: 2300 movs r3, #0 + 80107d0: 613b str r3, [r7, #16] + r = reassdatagrams; + 80107d2: 4b28 ldr r3, [pc, #160] @ (8010874 ) + 80107d4: 681b ldr r3, [r3, #0] + 80107d6: 627b str r3, [r7, #36] @ 0x24 + while (r != NULL) { + 80107d8: e030 b.n 801083c + if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) { + 80107da: 6a7b ldr r3, [r7, #36] @ 0x24 + 80107dc: 695a ldr r2, [r3, #20] + 80107de: 687b ldr r3, [r7, #4] + 80107e0: 68db ldr r3, [r3, #12] + 80107e2: 429a cmp r2, r3 + 80107e4: d10c bne.n 8010800 + 80107e6: 6a7b ldr r3, [r7, #36] @ 0x24 + 80107e8: 699a ldr r2, [r3, #24] + 80107ea: 687b ldr r3, [r7, #4] + 80107ec: 691b ldr r3, [r3, #16] + 80107ee: 429a cmp r2, r3 + 80107f0: d106 bne.n 8010800 + 80107f2: 6a7b ldr r3, [r7, #36] @ 0x24 + 80107f4: 899a ldrh r2, [r3, #12] + 80107f6: 687b ldr r3, [r7, #4] + 80107f8: 889b ldrh r3, [r3, #4] + 80107fa: b29b uxth r3, r3 + 80107fc: 429a cmp r2, r3 + 80107fe: d014 beq.n 801082a + /* Not the same datagram as fraghdr */ + other_datagrams++; + 8010800: 693b ldr r3, [r7, #16] + 8010802: 3301 adds r3, #1 + 8010804: 613b str r3, [r7, #16] + if (oldest == NULL) { + 8010806: 6a3b ldr r3, [r7, #32] + 8010808: 2b00 cmp r3, #0 + 801080a: d104 bne.n 8010816 + oldest = r; + 801080c: 6a7b ldr r3, [r7, #36] @ 0x24 + 801080e: 623b str r3, [r7, #32] + oldest_prev = prev; + 8010810: 69fb ldr r3, [r7, #28] + 8010812: 61bb str r3, [r7, #24] + 8010814: e009 b.n 801082a + } else if (r->timer <= oldest->timer) { + 8010816: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010818: 7fda ldrb r2, [r3, #31] + 801081a: 6a3b ldr r3, [r7, #32] + 801081c: 7fdb ldrb r3, [r3, #31] + 801081e: 429a cmp r2, r3 + 8010820: d803 bhi.n 801082a + /* older than the previous oldest */ + oldest = r; + 8010822: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010824: 623b str r3, [r7, #32] + oldest_prev = prev; + 8010826: 69fb ldr r3, [r7, #28] + 8010828: 61bb str r3, [r7, #24] + } + } + if (r->next != NULL) { + 801082a: 6a7b ldr r3, [r7, #36] @ 0x24 + 801082c: 681b ldr r3, [r3, #0] + 801082e: 2b00 cmp r3, #0 + 8010830: d001 beq.n 8010836 + prev = r; + 8010832: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010834: 61fb str r3, [r7, #28] + } + r = r->next; + 8010836: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010838: 681b ldr r3, [r3, #0] + 801083a: 627b str r3, [r7, #36] @ 0x24 + while (r != NULL) { + 801083c: 6a7b ldr r3, [r7, #36] @ 0x24 + 801083e: 2b00 cmp r3, #0 + 8010840: d1cb bne.n 80107da + } + if (oldest != NULL) { + 8010842: 6a3b ldr r3, [r7, #32] + 8010844: 2b00 cmp r3, #0 + 8010846: d008 beq.n 801085a + pbufs_freed_current = ip_reass_free_complete_datagram(oldest, oldest_prev); + 8010848: 69b9 ldr r1, [r7, #24] + 801084a: 6a38 ldr r0, [r7, #32] + 801084c: f7ff ff0e bl 801066c + 8010850: 60f8 str r0, [r7, #12] + pbufs_freed += pbufs_freed_current; + 8010852: 697a ldr r2, [r7, #20] + 8010854: 68fb ldr r3, [r7, #12] + 8010856: 4413 add r3, r2 + 8010858: 617b str r3, [r7, #20] + } + } while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1)); + 801085a: 697a ldr r2, [r7, #20] + 801085c: 683b ldr r3, [r7, #0] + 801085e: 429a cmp r2, r3 + 8010860: da02 bge.n 8010868 + 8010862: 693b ldr r3, [r7, #16] + 8010864: 2b01 cmp r3, #1 + 8010866: dcac bgt.n 80107c2 + return pbufs_freed; + 8010868: 697b ldr r3, [r7, #20] +} + 801086a: 4618 mov r0, r3 + 801086c: 3728 adds r7, #40 @ 0x28 + 801086e: 46bd mov sp, r7 + 8010870: bd80 pop {r7, pc} + 8010872: bf00 nop + 8010874: 2001922c .word 0x2001922c + +08010878 : + * @param clen number of pbufs needed to enqueue (used for freeing other datagrams if not enough space) + * @return A pointer to the queue location into which the fragment was enqueued + */ +static struct ip_reassdata * +ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen) +{ + 8010878: b580 push {r7, lr} + 801087a: b084 sub sp, #16 + 801087c: af00 add r7, sp, #0 + 801087e: 6078 str r0, [r7, #4] + 8010880: 6039 str r1, [r7, #0] +#if ! IP_REASS_FREE_OLDEST + LWIP_UNUSED_ARG(clen); +#endif + + /* No matching previous fragment found, allocate a new reassdata struct */ + ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA); + 8010882: 2004 movs r0, #4 + 8010884: f7f5 f9e0 bl 8005c48 + 8010888: 60f8 str r0, [r7, #12] + if (ipr == NULL) { + 801088a: 68fb ldr r3, [r7, #12] + 801088c: 2b00 cmp r3, #0 + 801088e: d110 bne.n 80108b2 +#if IP_REASS_FREE_OLDEST + if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) { + 8010890: 6839 ldr r1, [r7, #0] + 8010892: 6878 ldr r0, [r7, #4] + 8010894: f7ff ff8e bl 80107b4 + 8010898: 4602 mov r2, r0 + 801089a: 683b ldr r3, [r7, #0] + 801089c: 4293 cmp r3, r2 + 801089e: dc03 bgt.n 80108a8 + ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA); + 80108a0: 2004 movs r0, #4 + 80108a2: f7f5 f9d1 bl 8005c48 + 80108a6: 60f8 str r0, [r7, #12] + } + if (ipr == NULL) + 80108a8: 68fb ldr r3, [r7, #12] + 80108aa: 2b00 cmp r3, #0 + 80108ac: d101 bne.n 80108b2 +#endif /* IP_REASS_FREE_OLDEST */ + { + IPFRAG_STATS_INC(ip_frag.memerr); + LWIP_DEBUGF(IP_REASS_DEBUG, ("Failed to alloc reassdata struct\n")); + return NULL; + 80108ae: 2300 movs r3, #0 + 80108b0: e016 b.n 80108e0 + } + } + memset(ipr, 0, sizeof(struct ip_reassdata)); + 80108b2: 2220 movs r2, #32 + 80108b4: 2100 movs r1, #0 + 80108b6: 68f8 ldr r0, [r7, #12] + 80108b8: f000 ff1d bl 80116f6 + ipr->timer = IP_REASS_MAXAGE; + 80108bc: 68fb ldr r3, [r7, #12] + 80108be: 220f movs r2, #15 + 80108c0: 77da strb r2, [r3, #31] + + /* enqueue the new structure to the front of the list */ + ipr->next = reassdatagrams; + 80108c2: 4b09 ldr r3, [pc, #36] @ (80108e8 ) + 80108c4: 681a ldr r2, [r3, #0] + 80108c6: 68fb ldr r3, [r7, #12] + 80108c8: 601a str r2, [r3, #0] + reassdatagrams = ipr; + 80108ca: 4a07 ldr r2, [pc, #28] @ (80108e8 ) + 80108cc: 68fb ldr r3, [r7, #12] + 80108ce: 6013 str r3, [r2, #0] + /* copy the ip header for later tests and input */ + /* @todo: no ip options supported? */ + SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); + 80108d0: 68fb ldr r3, [r7, #12] + 80108d2: 3308 adds r3, #8 + 80108d4: 2214 movs r2, #20 + 80108d6: 6879 ldr r1, [r7, #4] + 80108d8: 4618 mov r0, r3 + 80108da: f000 ff89 bl 80117f0 + return ipr; + 80108de: 68fb ldr r3, [r7, #12] +} + 80108e0: 4618 mov r0, r3 + 80108e2: 3710 adds r7, #16 + 80108e4: 46bd mov sp, r7 + 80108e6: bd80 pop {r7, pc} + 80108e8: 2001922c .word 0x2001922c + +080108ec : + * Dequeues a datagram from the datagram queue. Doesn't deallocate the pbufs. + * @param ipr points to the queue entry to dequeue + */ +static void +ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev) +{ + 80108ec: b580 push {r7, lr} + 80108ee: b082 sub sp, #8 + 80108f0: af00 add r7, sp, #0 + 80108f2: 6078 str r0, [r7, #4] + 80108f4: 6039 str r1, [r7, #0] + /* dequeue the reass struct */ + if (reassdatagrams == ipr) { + 80108f6: 4b10 ldr r3, [pc, #64] @ (8010938 ) + 80108f8: 681b ldr r3, [r3, #0] + 80108fa: 687a ldr r2, [r7, #4] + 80108fc: 429a cmp r2, r3 + 80108fe: d104 bne.n 801090a + /* it was the first in the list */ + reassdatagrams = ipr->next; + 8010900: 687b ldr r3, [r7, #4] + 8010902: 681b ldr r3, [r3, #0] + 8010904: 4a0c ldr r2, [pc, #48] @ (8010938 ) + 8010906: 6013 str r3, [r2, #0] + 8010908: e00d b.n 8010926 + } else { + /* it wasn't the first, so it must have a valid 'prev' */ + LWIP_ASSERT("sanity check linked list", prev != NULL); + 801090a: 683b ldr r3, [r7, #0] + 801090c: 2b00 cmp r3, #0 + 801090e: d106 bne.n 801091e + 8010910: 4b0a ldr r3, [pc, #40] @ (801093c ) + 8010912: f240 1245 movw r2, #325 @ 0x145 + 8010916: 490a ldr r1, [pc, #40] @ (8010940 ) + 8010918: 480a ldr r0, [pc, #40] @ (8010944 ) + 801091a: f000 fe6d bl 80115f8 + prev->next = ipr->next; + 801091e: 687b ldr r3, [r7, #4] + 8010920: 681a ldr r2, [r3, #0] + 8010922: 683b ldr r3, [r7, #0] + 8010924: 601a str r2, [r3, #0] + } + + /* now we can free the ip_reassdata struct */ + memp_free(MEMP_REASSDATA, ipr); + 8010926: 6879 ldr r1, [r7, #4] + 8010928: 2004 movs r0, #4 + 801092a: f7f5 f9fd bl 8005d28 +} + 801092e: bf00 nop + 8010930: 3708 adds r7, #8 + 8010932: 46bd mov sp, r7 + 8010934: bd80 pop {r7, pc} + 8010936: bf00 nop + 8010938: 2001922c .word 0x2001922c + 801093c: 08018b1c .word 0x08018b1c + 8010940: 08018be4 .word 0x08018be4 + 8010944: 08018b64 .word 0x08018b64 + +08010948 : + * @param is_last is 1 if this pbuf has MF==0 (ipr->flags not updated yet) + * @return see IP_REASS_VALIDATE_* defines + */ +static int +ip_reass_chain_frag_into_datagram_and_validate(struct ip_reassdata *ipr, struct pbuf *new_p, int is_last) +{ + 8010948: b580 push {r7, lr} + 801094a: b08c sub sp, #48 @ 0x30 + 801094c: af00 add r7, sp, #0 + 801094e: 60f8 str r0, [r7, #12] + 8010950: 60b9 str r1, [r7, #8] + 8010952: 607a str r2, [r7, #4] + struct ip_reass_helper *iprh, *iprh_tmp, *iprh_prev = NULL; + 8010954: 2300 movs r3, #0 + 8010956: 62bb str r3, [r7, #40] @ 0x28 + struct pbuf *q; + u16_t offset, len; + u8_t hlen; + struct ip_hdr *fraghdr; + int valid = 1; + 8010958: 2301 movs r3, #1 + 801095a: 623b str r3, [r7, #32] + + /* Extract length and fragment offset from current fragment */ + fraghdr = (struct ip_hdr *)new_p->payload; + 801095c: 68bb ldr r3, [r7, #8] + 801095e: 685b ldr r3, [r3, #4] + 8010960: 61fb str r3, [r7, #28] + len = lwip_ntohs(IPH_LEN(fraghdr)); + 8010962: 69fb ldr r3, [r7, #28] + 8010964: 885b ldrh r3, [r3, #2] + 8010966: b29b uxth r3, r3 + 8010968: 4618 mov r0, r3 + 801096a: f7f4 fd0d bl 8005388 + 801096e: 4603 mov r3, r0 + 8010970: 837b strh r3, [r7, #26] + hlen = IPH_HL_BYTES(fraghdr); + 8010972: 69fb ldr r3, [r7, #28] + 8010974: 781b ldrb r3, [r3, #0] + 8010976: f003 030f and.w r3, r3, #15 + 801097a: b2db uxtb r3, r3 + 801097c: 009b lsls r3, r3, #2 + 801097e: 767b strb r3, [r7, #25] + if (hlen > len) { + 8010980: 7e7b ldrb r3, [r7, #25] + 8010982: b29b uxth r3, r3 + 8010984: 8b7a ldrh r2, [r7, #26] + 8010986: 429a cmp r2, r3 + 8010988: d202 bcs.n 8010990 + /* invalid datagram */ + return IP_REASS_VALIDATE_PBUF_DROPPED; + 801098a: f04f 33ff mov.w r3, #4294967295 + 801098e: e135 b.n 8010bfc + } + len = (u16_t)(len - hlen); + 8010990: 7e7b ldrb r3, [r7, #25] + 8010992: b29b uxth r3, r3 + 8010994: 8b7a ldrh r2, [r7, #26] + 8010996: 1ad3 subs r3, r2, r3 + 8010998: 837b strh r3, [r7, #26] + offset = IPH_OFFSET_BYTES(fraghdr); + 801099a: 69fb ldr r3, [r7, #28] + 801099c: 88db ldrh r3, [r3, #6] + 801099e: b29b uxth r3, r3 + 80109a0: 4618 mov r0, r3 + 80109a2: f7f4 fcf1 bl 8005388 + 80109a6: 4603 mov r3, r0 + 80109a8: f3c3 030c ubfx r3, r3, #0, #13 + 80109ac: b29b uxth r3, r3 + 80109ae: 00db lsls r3, r3, #3 + 80109b0: 82fb strh r3, [r7, #22] + /* overwrite the fragment's ip header from the pbuf with our helper struct, + * and setup the embedded helper structure. */ + /* make sure the struct ip_reass_helper fits into the IP header */ + LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN", + sizeof(struct ip_reass_helper) <= IP_HLEN); + iprh = (struct ip_reass_helper *)new_p->payload; + 80109b2: 68bb ldr r3, [r7, #8] + 80109b4: 685b ldr r3, [r3, #4] + 80109b6: 62fb str r3, [r7, #44] @ 0x2c + iprh->next_pbuf = NULL; + 80109b8: 6afb ldr r3, [r7, #44] @ 0x2c + 80109ba: 2200 movs r2, #0 + 80109bc: 701a strb r2, [r3, #0] + 80109be: 2200 movs r2, #0 + 80109c0: 705a strb r2, [r3, #1] + 80109c2: 2200 movs r2, #0 + 80109c4: 709a strb r2, [r3, #2] + 80109c6: 2200 movs r2, #0 + 80109c8: 70da strb r2, [r3, #3] + iprh->start = offset; + 80109ca: 6afb ldr r3, [r7, #44] @ 0x2c + 80109cc: 8afa ldrh r2, [r7, #22] + 80109ce: 809a strh r2, [r3, #4] + iprh->end = (u16_t)(offset + len); + 80109d0: 8afa ldrh r2, [r7, #22] + 80109d2: 8b7b ldrh r3, [r7, #26] + 80109d4: 4413 add r3, r2 + 80109d6: b29a uxth r2, r3 + 80109d8: 6afb ldr r3, [r7, #44] @ 0x2c + 80109da: 80da strh r2, [r3, #6] + if (iprh->end < offset) { + 80109dc: 6afb ldr r3, [r7, #44] @ 0x2c + 80109de: 88db ldrh r3, [r3, #6] + 80109e0: b29b uxth r3, r3 + 80109e2: 8afa ldrh r2, [r7, #22] + 80109e4: 429a cmp r2, r3 + 80109e6: d902 bls.n 80109ee + /* u16_t overflow, cannot handle this */ + return IP_REASS_VALIDATE_PBUF_DROPPED; + 80109e8: f04f 33ff mov.w r3, #4294967295 + 80109ec: e106 b.n 8010bfc + } + + /* Iterate through until we either get to the end of the list (append), + * or we find one with a larger offset (insert). */ + for (q = ipr->p; q != NULL;) { + 80109ee: 68fb ldr r3, [r7, #12] + 80109f0: 685b ldr r3, [r3, #4] + 80109f2: 627b str r3, [r7, #36] @ 0x24 + 80109f4: e068 b.n 8010ac8 + iprh_tmp = (struct ip_reass_helper *)q->payload; + 80109f6: 6a7b ldr r3, [r7, #36] @ 0x24 + 80109f8: 685b ldr r3, [r3, #4] + 80109fa: 613b str r3, [r7, #16] + if (iprh->start < iprh_tmp->start) { + 80109fc: 6afb ldr r3, [r7, #44] @ 0x2c + 80109fe: 889b ldrh r3, [r3, #4] + 8010a00: b29a uxth r2, r3 + 8010a02: 693b ldr r3, [r7, #16] + 8010a04: 889b ldrh r3, [r3, #4] + 8010a06: b29b uxth r3, r3 + 8010a08: 429a cmp r2, r3 + 8010a0a: d235 bcs.n 8010a78 + /* the new pbuf should be inserted before this */ + iprh->next_pbuf = q; + 8010a0c: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a0e: 6a7a ldr r2, [r7, #36] @ 0x24 + 8010a10: 601a str r2, [r3, #0] + if (iprh_prev != NULL) { + 8010a12: 6abb ldr r3, [r7, #40] @ 0x28 + 8010a14: 2b00 cmp r3, #0 + 8010a16: d020 beq.n 8010a5a + /* not the fragment with the lowest offset */ +#if IP_REASS_CHECK_OVERLAP + if ((iprh->start < iprh_prev->end) || (iprh->end > iprh_tmp->start)) { + 8010a18: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a1a: 889b ldrh r3, [r3, #4] + 8010a1c: b29a uxth r2, r3 + 8010a1e: 6abb ldr r3, [r7, #40] @ 0x28 + 8010a20: 88db ldrh r3, [r3, #6] + 8010a22: b29b uxth r3, r3 + 8010a24: 429a cmp r2, r3 + 8010a26: d307 bcc.n 8010a38 + 8010a28: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a2a: 88db ldrh r3, [r3, #6] + 8010a2c: b29a uxth r2, r3 + 8010a2e: 693b ldr r3, [r7, #16] + 8010a30: 889b ldrh r3, [r3, #4] + 8010a32: b29b uxth r3, r3 + 8010a34: 429a cmp r2, r3 + 8010a36: d902 bls.n 8010a3e + /* fragment overlaps with previous or following, throw away */ + return IP_REASS_VALIDATE_PBUF_DROPPED; + 8010a38: f04f 33ff mov.w r3, #4294967295 + 8010a3c: e0de b.n 8010bfc + } +#endif /* IP_REASS_CHECK_OVERLAP */ + iprh_prev->next_pbuf = new_p; + 8010a3e: 6abb ldr r3, [r7, #40] @ 0x28 + 8010a40: 68ba ldr r2, [r7, #8] + 8010a42: 601a str r2, [r3, #0] + if (iprh_prev->end != iprh->start) { + 8010a44: 6abb ldr r3, [r7, #40] @ 0x28 + 8010a46: 88db ldrh r3, [r3, #6] + 8010a48: b29a uxth r2, r3 + 8010a4a: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a4c: 889b ldrh r3, [r3, #4] + 8010a4e: b29b uxth r3, r3 + 8010a50: 429a cmp r2, r3 + 8010a52: d03d beq.n 8010ad0 + /* There is a fragment missing between the current + * and the previous fragment */ + valid = 0; + 8010a54: 2300 movs r3, #0 + 8010a56: 623b str r3, [r7, #32] + } +#endif /* IP_REASS_CHECK_OVERLAP */ + /* fragment with the lowest offset */ + ipr->p = new_p; + } + break; + 8010a58: e03a b.n 8010ad0 + if (iprh->end > iprh_tmp->start) { + 8010a5a: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a5c: 88db ldrh r3, [r3, #6] + 8010a5e: b29a uxth r2, r3 + 8010a60: 693b ldr r3, [r7, #16] + 8010a62: 889b ldrh r3, [r3, #4] + 8010a64: b29b uxth r3, r3 + 8010a66: 429a cmp r2, r3 + 8010a68: d902 bls.n 8010a70 + return IP_REASS_VALIDATE_PBUF_DROPPED; + 8010a6a: f04f 33ff mov.w r3, #4294967295 + 8010a6e: e0c5 b.n 8010bfc + ipr->p = new_p; + 8010a70: 68fb ldr r3, [r7, #12] + 8010a72: 68ba ldr r2, [r7, #8] + 8010a74: 605a str r2, [r3, #4] + break; + 8010a76: e02b b.n 8010ad0 + } else if (iprh->start == iprh_tmp->start) { + 8010a78: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a7a: 889b ldrh r3, [r3, #4] + 8010a7c: b29a uxth r2, r3 + 8010a7e: 693b ldr r3, [r7, #16] + 8010a80: 889b ldrh r3, [r3, #4] + 8010a82: b29b uxth r3, r3 + 8010a84: 429a cmp r2, r3 + 8010a86: d102 bne.n 8010a8e + /* received the same datagram twice: no need to keep the datagram */ + return IP_REASS_VALIDATE_PBUF_DROPPED; + 8010a88: f04f 33ff mov.w r3, #4294967295 + 8010a8c: e0b6 b.n 8010bfc +#if IP_REASS_CHECK_OVERLAP + } else if (iprh->start < iprh_tmp->end) { + 8010a8e: 6afb ldr r3, [r7, #44] @ 0x2c + 8010a90: 889b ldrh r3, [r3, #4] + 8010a92: b29a uxth r2, r3 + 8010a94: 693b ldr r3, [r7, #16] + 8010a96: 88db ldrh r3, [r3, #6] + 8010a98: b29b uxth r3, r3 + 8010a9a: 429a cmp r2, r3 + 8010a9c: d202 bcs.n 8010aa4 + /* overlap: no need to keep the new datagram */ + return IP_REASS_VALIDATE_PBUF_DROPPED; + 8010a9e: f04f 33ff mov.w r3, #4294967295 + 8010aa2: e0ab b.n 8010bfc +#endif /* IP_REASS_CHECK_OVERLAP */ + } else { + /* Check if the fragments received so far have no holes. */ + if (iprh_prev != NULL) { + 8010aa4: 6abb ldr r3, [r7, #40] @ 0x28 + 8010aa6: 2b00 cmp r3, #0 + 8010aa8: d009 beq.n 8010abe + if (iprh_prev->end != iprh_tmp->start) { + 8010aaa: 6abb ldr r3, [r7, #40] @ 0x28 + 8010aac: 88db ldrh r3, [r3, #6] + 8010aae: b29a uxth r2, r3 + 8010ab0: 693b ldr r3, [r7, #16] + 8010ab2: 889b ldrh r3, [r3, #4] + 8010ab4: b29b uxth r3, r3 + 8010ab6: 429a cmp r2, r3 + 8010ab8: d001 beq.n 8010abe + /* There is a fragment missing between the current + * and the previous fragment */ + valid = 0; + 8010aba: 2300 movs r3, #0 + 8010abc: 623b str r3, [r7, #32] + } + } + } + q = iprh_tmp->next_pbuf; + 8010abe: 693b ldr r3, [r7, #16] + 8010ac0: 681b ldr r3, [r3, #0] + 8010ac2: 627b str r3, [r7, #36] @ 0x24 + iprh_prev = iprh_tmp; + 8010ac4: 693b ldr r3, [r7, #16] + 8010ac6: 62bb str r3, [r7, #40] @ 0x28 + for (q = ipr->p; q != NULL;) { + 8010ac8: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010aca: 2b00 cmp r3, #0 + 8010acc: d193 bne.n 80109f6 + 8010ace: e000 b.n 8010ad2 + break; + 8010ad0: bf00 nop + } + + /* If q is NULL, then we made it to the end of the list. Determine what to do now */ + if (q == NULL) { + 8010ad2: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010ad4: 2b00 cmp r3, #0 + 8010ad6: d12d bne.n 8010b34 + if (iprh_prev != NULL) { + 8010ad8: 6abb ldr r3, [r7, #40] @ 0x28 + 8010ada: 2b00 cmp r3, #0 + 8010adc: d01c beq.n 8010b18 + /* this is (for now), the fragment with the highest offset: + * chain it to the last fragment */ +#if IP_REASS_CHECK_OVERLAP + LWIP_ASSERT("check fragments don't overlap", iprh_prev->end <= iprh->start); + 8010ade: 6abb ldr r3, [r7, #40] @ 0x28 + 8010ae0: 88db ldrh r3, [r3, #6] + 8010ae2: b29a uxth r2, r3 + 8010ae4: 6afb ldr r3, [r7, #44] @ 0x2c + 8010ae6: 889b ldrh r3, [r3, #4] + 8010ae8: b29b uxth r3, r3 + 8010aea: 429a cmp r2, r3 + 8010aec: d906 bls.n 8010afc + 8010aee: 4b45 ldr r3, [pc, #276] @ (8010c04 ) + 8010af0: f44f 72db mov.w r2, #438 @ 0x1b6 + 8010af4: 4944 ldr r1, [pc, #272] @ (8010c08 ) + 8010af6: 4845 ldr r0, [pc, #276] @ (8010c0c ) + 8010af8: f000 fd7e bl 80115f8 +#endif /* IP_REASS_CHECK_OVERLAP */ + iprh_prev->next_pbuf = new_p; + 8010afc: 6abb ldr r3, [r7, #40] @ 0x28 + 8010afe: 68ba ldr r2, [r7, #8] + 8010b00: 601a str r2, [r3, #0] + if (iprh_prev->end != iprh->start) { + 8010b02: 6abb ldr r3, [r7, #40] @ 0x28 + 8010b04: 88db ldrh r3, [r3, #6] + 8010b06: b29a uxth r2, r3 + 8010b08: 6afb ldr r3, [r7, #44] @ 0x2c + 8010b0a: 889b ldrh r3, [r3, #4] + 8010b0c: b29b uxth r3, r3 + 8010b0e: 429a cmp r2, r3 + 8010b10: d010 beq.n 8010b34 + valid = 0; + 8010b12: 2300 movs r3, #0 + 8010b14: 623b str r3, [r7, #32] + 8010b16: e00d b.n 8010b34 + } + } else { +#if IP_REASS_CHECK_OVERLAP + LWIP_ASSERT("no previous fragment, this must be the first fragment!", + 8010b18: 68fb ldr r3, [r7, #12] + 8010b1a: 685b ldr r3, [r3, #4] + 8010b1c: 2b00 cmp r3, #0 + 8010b1e: d006 beq.n 8010b2e + 8010b20: 4b38 ldr r3, [pc, #224] @ (8010c04 ) + 8010b22: f44f 72df mov.w r2, #446 @ 0x1be + 8010b26: 493a ldr r1, [pc, #232] @ (8010c10 ) + 8010b28: 4838 ldr r0, [pc, #224] @ (8010c0c ) + 8010b2a: f000 fd65 bl 80115f8 + ipr->p == NULL); +#endif /* IP_REASS_CHECK_OVERLAP */ + /* this is the first fragment we ever received for this ip datagram */ + ipr->p = new_p; + 8010b2e: 68fb ldr r3, [r7, #12] + 8010b30: 68ba ldr r2, [r7, #8] + 8010b32: 605a str r2, [r3, #4] + } + } + + /* At this point, the validation part begins: */ + /* If we already received the last fragment */ + if (is_last || ((ipr->flags & IP_REASS_FLAG_LASTFRAG) != 0)) { + 8010b34: 687b ldr r3, [r7, #4] + 8010b36: 2b00 cmp r3, #0 + 8010b38: d105 bne.n 8010b46 + 8010b3a: 68fb ldr r3, [r7, #12] + 8010b3c: 7f9b ldrb r3, [r3, #30] + 8010b3e: f003 0301 and.w r3, r3, #1 + 8010b42: 2b00 cmp r3, #0 + 8010b44: d059 beq.n 8010bfa + /* and had no holes so far */ + if (valid) { + 8010b46: 6a3b ldr r3, [r7, #32] + 8010b48: 2b00 cmp r3, #0 + 8010b4a: d04f beq.n 8010bec + /* then check if the rest of the fragments is here */ + /* Check if the queue starts with the first datagram */ + if ((ipr->p == NULL) || (((struct ip_reass_helper *)ipr->p->payload)->start != 0)) { + 8010b4c: 68fb ldr r3, [r7, #12] + 8010b4e: 685b ldr r3, [r3, #4] + 8010b50: 2b00 cmp r3, #0 + 8010b52: d006 beq.n 8010b62 + 8010b54: 68fb ldr r3, [r7, #12] + 8010b56: 685b ldr r3, [r3, #4] + 8010b58: 685b ldr r3, [r3, #4] + 8010b5a: 889b ldrh r3, [r3, #4] + 8010b5c: b29b uxth r3, r3 + 8010b5e: 2b00 cmp r3, #0 + 8010b60: d002 beq.n 8010b68 + valid = 0; + 8010b62: 2300 movs r3, #0 + 8010b64: 623b str r3, [r7, #32] + 8010b66: e041 b.n 8010bec + } else { + /* and check that there are no holes after this datagram */ + iprh_prev = iprh; + 8010b68: 6afb ldr r3, [r7, #44] @ 0x2c + 8010b6a: 62bb str r3, [r7, #40] @ 0x28 + q = iprh->next_pbuf; + 8010b6c: 6afb ldr r3, [r7, #44] @ 0x2c + 8010b6e: 681b ldr r3, [r3, #0] + 8010b70: 627b str r3, [r7, #36] @ 0x24 + while (q != NULL) { + 8010b72: e012 b.n 8010b9a + iprh = (struct ip_reass_helper *)q->payload; + 8010b74: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010b76: 685b ldr r3, [r3, #4] + 8010b78: 62fb str r3, [r7, #44] @ 0x2c + if (iprh_prev->end != iprh->start) { + 8010b7a: 6abb ldr r3, [r7, #40] @ 0x28 + 8010b7c: 88db ldrh r3, [r3, #6] + 8010b7e: b29a uxth r2, r3 + 8010b80: 6afb ldr r3, [r7, #44] @ 0x2c + 8010b82: 889b ldrh r3, [r3, #4] + 8010b84: b29b uxth r3, r3 + 8010b86: 429a cmp r2, r3 + 8010b88: d002 beq.n 8010b90 + valid = 0; + 8010b8a: 2300 movs r3, #0 + 8010b8c: 623b str r3, [r7, #32] + break; + 8010b8e: e007 b.n 8010ba0 + } + iprh_prev = iprh; + 8010b90: 6afb ldr r3, [r7, #44] @ 0x2c + 8010b92: 62bb str r3, [r7, #40] @ 0x28 + q = iprh->next_pbuf; + 8010b94: 6afb ldr r3, [r7, #44] @ 0x2c + 8010b96: 681b ldr r3, [r3, #0] + 8010b98: 627b str r3, [r7, #36] @ 0x24 + while (q != NULL) { + 8010b9a: 6a7b ldr r3, [r7, #36] @ 0x24 + 8010b9c: 2b00 cmp r3, #0 + 8010b9e: d1e9 bne.n 8010b74 + } + /* if still valid, all fragments are received + * (because to the MF==0 already arrived */ + if (valid) { + 8010ba0: 6a3b ldr r3, [r7, #32] + 8010ba2: 2b00 cmp r3, #0 + 8010ba4: d022 beq.n 8010bec + LWIP_ASSERT("sanity check", ipr->p != NULL); + 8010ba6: 68fb ldr r3, [r7, #12] + 8010ba8: 685b ldr r3, [r3, #4] + 8010baa: 2b00 cmp r3, #0 + 8010bac: d106 bne.n 8010bbc + 8010bae: 4b15 ldr r3, [pc, #84] @ (8010c04 ) + 8010bb0: f240 12df movw r2, #479 @ 0x1df + 8010bb4: 4917 ldr r1, [pc, #92] @ (8010c14 ) + 8010bb6: 4815 ldr r0, [pc, #84] @ (8010c0c ) + 8010bb8: f000 fd1e bl 80115f8 + LWIP_ASSERT("sanity check", + 8010bbc: 68fb ldr r3, [r7, #12] + 8010bbe: 685b ldr r3, [r3, #4] + 8010bc0: 685b ldr r3, [r3, #4] + 8010bc2: 6afa ldr r2, [r7, #44] @ 0x2c + 8010bc4: 429a cmp r2, r3 + 8010bc6: d106 bne.n 8010bd6 + 8010bc8: 4b0e ldr r3, [pc, #56] @ (8010c04 ) + 8010bca: f44f 72f0 mov.w r2, #480 @ 0x1e0 + 8010bce: 4911 ldr r1, [pc, #68] @ (8010c14 ) + 8010bd0: 480e ldr r0, [pc, #56] @ (8010c0c ) + 8010bd2: f000 fd11 bl 80115f8 + ((struct ip_reass_helper *)ipr->p->payload) != iprh); + LWIP_ASSERT("validate_datagram:next_pbuf!=NULL", + 8010bd6: 6afb ldr r3, [r7, #44] @ 0x2c + 8010bd8: 681b ldr r3, [r3, #0] + 8010bda: 2b00 cmp r3, #0 + 8010bdc: d006 beq.n 8010bec + 8010bde: 4b09 ldr r3, [pc, #36] @ (8010c04 ) + 8010be0: f44f 72f1 mov.w r2, #482 @ 0x1e2 + 8010be4: 490c ldr r1, [pc, #48] @ (8010c18 ) + 8010be6: 4809 ldr r0, [pc, #36] @ (8010c0c ) + 8010be8: f000 fd06 bl 80115f8 + } + } + /* If valid is 0 here, there are some fragments missing in the middle + * (since MF == 0 has already arrived). Such datagrams simply time out if + * no more fragments are received... */ + return valid ? IP_REASS_VALIDATE_TELEGRAM_FINISHED : IP_REASS_VALIDATE_PBUF_QUEUED; + 8010bec: 6a3b ldr r3, [r7, #32] + 8010bee: 2b00 cmp r3, #0 + 8010bf0: bf14 ite ne + 8010bf2: 2301 movne r3, #1 + 8010bf4: 2300 moveq r3, #0 + 8010bf6: b2db uxtb r3, r3 + 8010bf8: e000 b.n 8010bfc + } + /* If we come here, not all fragments were received, yet! */ + return IP_REASS_VALIDATE_PBUF_QUEUED; /* not yet valid! */ + 8010bfa: 2300 movs r3, #0 +} + 8010bfc: 4618 mov r0, r3 + 8010bfe: 3730 adds r7, #48 @ 0x30 + 8010c00: 46bd mov sp, r7 + 8010c02: bd80 pop {r7, pc} + 8010c04: 08018b1c .word 0x08018b1c + 8010c08: 08018c00 .word 0x08018c00 + 8010c0c: 08018b64 .word 0x08018b64 + 8010c10: 08018c20 .word 0x08018c20 + 8010c14: 08018c58 .word 0x08018c58 + 8010c18: 08018c68 .word 0x08018c68 + +08010c1c : + * @param p points to a pbuf chain of the fragment + * @return NULL if reassembly is incomplete, ? otherwise + */ +struct pbuf * +ip4_reass(struct pbuf *p) +{ + 8010c1c: b580 push {r7, lr} + 8010c1e: b08e sub sp, #56 @ 0x38 + 8010c20: af00 add r7, sp, #0 + 8010c22: 6078 str r0, [r7, #4] + int is_last; + + IPFRAG_STATS_INC(ip_frag.recv); + MIB2_STATS_INC(mib2.ipreasmreqds); + + fraghdr = (struct ip_hdr *)p->payload; + 8010c24: 687b ldr r3, [r7, #4] + 8010c26: 685b ldr r3, [r3, #4] + 8010c28: 62bb str r3, [r7, #40] @ 0x28 + + if (IPH_HL_BYTES(fraghdr) != IP_HLEN) { + 8010c2a: 6abb ldr r3, [r7, #40] @ 0x28 + 8010c2c: 781b ldrb r3, [r3, #0] + 8010c2e: f003 030f and.w r3, r3, #15 + 8010c32: b2db uxtb r3, r3 + 8010c34: 009b lsls r3, r3, #2 + 8010c36: b2db uxtb r3, r3 + 8010c38: 2b14 cmp r3, #20 + 8010c3a: f040 8171 bne.w 8010f20 + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip4_reass: IP options currently not supported!\n")); + IPFRAG_STATS_INC(ip_frag.err); + goto nullreturn; + } + + offset = IPH_OFFSET_BYTES(fraghdr); + 8010c3e: 6abb ldr r3, [r7, #40] @ 0x28 + 8010c40: 88db ldrh r3, [r3, #6] + 8010c42: b29b uxth r3, r3 + 8010c44: 4618 mov r0, r3 + 8010c46: f7f4 fb9f bl 8005388 + 8010c4a: 4603 mov r3, r0 + 8010c4c: f3c3 030c ubfx r3, r3, #0, #13 + 8010c50: b29b uxth r3, r3 + 8010c52: 00db lsls r3, r3, #3 + 8010c54: 84fb strh r3, [r7, #38] @ 0x26 + len = lwip_ntohs(IPH_LEN(fraghdr)); + 8010c56: 6abb ldr r3, [r7, #40] @ 0x28 + 8010c58: 885b ldrh r3, [r3, #2] + 8010c5a: b29b uxth r3, r3 + 8010c5c: 4618 mov r0, r3 + 8010c5e: f7f4 fb93 bl 8005388 + 8010c62: 4603 mov r3, r0 + 8010c64: 84bb strh r3, [r7, #36] @ 0x24 + hlen = IPH_HL_BYTES(fraghdr); + 8010c66: 6abb ldr r3, [r7, #40] @ 0x28 + 8010c68: 781b ldrb r3, [r3, #0] + 8010c6a: f003 030f and.w r3, r3, #15 + 8010c6e: b2db uxtb r3, r3 + 8010c70: 009b lsls r3, r3, #2 + 8010c72: f887 3023 strb.w r3, [r7, #35] @ 0x23 + if (hlen > len) { + 8010c76: f897 3023 ldrb.w r3, [r7, #35] @ 0x23 + 8010c7a: b29b uxth r3, r3 + 8010c7c: 8cba ldrh r2, [r7, #36] @ 0x24 + 8010c7e: 429a cmp r2, r3 + 8010c80: f0c0 8150 bcc.w 8010f24 + /* invalid datagram */ + goto nullreturn; + } + len = (u16_t)(len - hlen); + 8010c84: f897 3023 ldrb.w r3, [r7, #35] @ 0x23 + 8010c88: b29b uxth r3, r3 + 8010c8a: 8cba ldrh r2, [r7, #36] @ 0x24 + 8010c8c: 1ad3 subs r3, r2, r3 + 8010c8e: 84bb strh r3, [r7, #36] @ 0x24 + + /* Check if we are allowed to enqueue more datagrams. */ + clen = pbuf_clen(p); + 8010c90: 6878 ldr r0, [r7, #4] + 8010c92: f7f5 ff51 bl 8006b38 + 8010c96: 4603 mov r3, r0 + 8010c98: 843b strh r3, [r7, #32] + if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) { + 8010c9a: 4b8c ldr r3, [pc, #560] @ (8010ecc ) + 8010c9c: 881b ldrh r3, [r3, #0] + 8010c9e: 461a mov r2, r3 + 8010ca0: 8c3b ldrh r3, [r7, #32] + 8010ca2: 4413 add r3, r2 + 8010ca4: 2b0a cmp r3, #10 + 8010ca6: dd10 ble.n 8010cca +#if IP_REASS_FREE_OLDEST + if (!ip_reass_remove_oldest_datagram(fraghdr, clen) || + 8010ca8: 8c3b ldrh r3, [r7, #32] + 8010caa: 4619 mov r1, r3 + 8010cac: 6ab8 ldr r0, [r7, #40] @ 0x28 + 8010cae: f7ff fd81 bl 80107b4 + 8010cb2: 4603 mov r3, r0 + 8010cb4: 2b00 cmp r3, #0 + 8010cb6: f000 8137 beq.w 8010f28 + ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS)) + 8010cba: 4b84 ldr r3, [pc, #528] @ (8010ecc ) + 8010cbc: 881b ldrh r3, [r3, #0] + 8010cbe: 461a mov r2, r3 + 8010cc0: 8c3b ldrh r3, [r7, #32] + 8010cc2: 4413 add r3, r2 + if (!ip_reass_remove_oldest_datagram(fraghdr, clen) || + 8010cc4: 2b0a cmp r3, #10 + 8010cc6: f300 812f bgt.w 8010f28 + } + } + + /* Look for the datagram the fragment belongs to in the current datagram queue, + * remembering the previous in the queue for later dequeueing. */ + for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) { + 8010cca: 4b81 ldr r3, [pc, #516] @ (8010ed0 ) + 8010ccc: 681b ldr r3, [r3, #0] + 8010cce: 633b str r3, [r7, #48] @ 0x30 + 8010cd0: e015 b.n 8010cfe + /* Check if the incoming fragment matches the one currently present + in the reassembly buffer. If so, we proceed with copying the + fragment into the buffer. */ + if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) { + 8010cd2: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010cd4: 695a ldr r2, [r3, #20] + 8010cd6: 6abb ldr r3, [r7, #40] @ 0x28 + 8010cd8: 68db ldr r3, [r3, #12] + 8010cda: 429a cmp r2, r3 + 8010cdc: d10c bne.n 8010cf8 + 8010cde: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010ce0: 699a ldr r2, [r3, #24] + 8010ce2: 6abb ldr r3, [r7, #40] @ 0x28 + 8010ce4: 691b ldr r3, [r3, #16] + 8010ce6: 429a cmp r2, r3 + 8010ce8: d106 bne.n 8010cf8 + 8010cea: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010cec: 899a ldrh r2, [r3, #12] + 8010cee: 6abb ldr r3, [r7, #40] @ 0x28 + 8010cf0: 889b ldrh r3, [r3, #4] + 8010cf2: b29b uxth r3, r3 + 8010cf4: 429a cmp r2, r3 + 8010cf6: d006 beq.n 8010d06 + for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) { + 8010cf8: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010cfa: 681b ldr r3, [r3, #0] + 8010cfc: 633b str r3, [r7, #48] @ 0x30 + 8010cfe: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010d00: 2b00 cmp r3, #0 + 8010d02: d1e6 bne.n 8010cd2 + 8010d04: e000 b.n 8010d08 + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip4_reass: matching previous fragment ID=%"X16_F"\n", + lwip_ntohs(IPH_ID(fraghdr)))); + IPFRAG_STATS_INC(ip_frag.cachehit); + break; + 8010d06: bf00 nop + } + } + + if (ipr == NULL) { + 8010d08: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010d0a: 2b00 cmp r3, #0 + 8010d0c: d109 bne.n 8010d22 + /* Enqueue a new datagram into the datagram queue */ + ipr = ip_reass_enqueue_new_datagram(fraghdr, clen); + 8010d0e: 8c3b ldrh r3, [r7, #32] + 8010d10: 4619 mov r1, r3 + 8010d12: 6ab8 ldr r0, [r7, #40] @ 0x28 + 8010d14: f7ff fdb0 bl 8010878 + 8010d18: 6338 str r0, [r7, #48] @ 0x30 + /* Bail if unable to enqueue */ + if (ipr == NULL) { + 8010d1a: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010d1c: 2b00 cmp r3, #0 + 8010d1e: d11c bne.n 8010d5a + goto nullreturn; + 8010d20: e105 b.n 8010f2e + } + } else { + if (((lwip_ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && + 8010d22: 6abb ldr r3, [r7, #40] @ 0x28 + 8010d24: 88db ldrh r3, [r3, #6] + 8010d26: b29b uxth r3, r3 + 8010d28: 4618 mov r0, r3 + 8010d2a: f7f4 fb2d bl 8005388 + 8010d2e: 4603 mov r3, r0 + 8010d30: f3c3 030c ubfx r3, r3, #0, #13 + 8010d34: 2b00 cmp r3, #0 + 8010d36: d110 bne.n 8010d5a + ((lwip_ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) { + 8010d38: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010d3a: 89db ldrh r3, [r3, #14] + 8010d3c: 4618 mov r0, r3 + 8010d3e: f7f4 fb23 bl 8005388 + 8010d42: 4603 mov r3, r0 + 8010d44: f3c3 030c ubfx r3, r3, #0, #13 + if (((lwip_ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && + 8010d48: 2b00 cmp r3, #0 + 8010d4a: d006 beq.n 8010d5a + /* ipr->iphdr is not the header from the first fragment, but fraghdr is + * -> copy fraghdr into ipr->iphdr since we want to have the header + * of the first fragment (for ICMP time exceeded and later, for copying + * all options, if supported)*/ + SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); + 8010d4c: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010d4e: 3308 adds r3, #8 + 8010d50: 2214 movs r2, #20 + 8010d52: 6ab9 ldr r1, [r7, #40] @ 0x28 + 8010d54: 4618 mov r0, r3 + 8010d56: f000 fd4b bl 80117f0 + + /* At this point, we have either created a new entry or pointing + * to an existing one */ + + /* check for 'no more fragments', and update queue entry*/ + is_last = (IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0; + 8010d5a: 6abb ldr r3, [r7, #40] @ 0x28 + 8010d5c: 88db ldrh r3, [r3, #6] + 8010d5e: b29b uxth r3, r3 + 8010d60: f003 0320 and.w r3, r3, #32 + 8010d64: 2b00 cmp r3, #0 + 8010d66: bf0c ite eq + 8010d68: 2301 moveq r3, #1 + 8010d6a: 2300 movne r3, #0 + 8010d6c: b2db uxtb r3, r3 + 8010d6e: 61fb str r3, [r7, #28] + if (is_last) { + 8010d70: 69fb ldr r3, [r7, #28] + 8010d72: 2b00 cmp r3, #0 + 8010d74: d00e beq.n 8010d94 + u16_t datagram_len = (u16_t)(offset + len); + 8010d76: 8cfa ldrh r2, [r7, #38] @ 0x26 + 8010d78: 8cbb ldrh r3, [r7, #36] @ 0x24 + 8010d7a: 4413 add r3, r2 + 8010d7c: 837b strh r3, [r7, #26] + if ((datagram_len < offset) || (datagram_len > (0xFFFF - IP_HLEN))) { + 8010d7e: 8b7a ldrh r2, [r7, #26] + 8010d80: 8cfb ldrh r3, [r7, #38] @ 0x26 + 8010d82: 429a cmp r2, r3 + 8010d84: f0c0 80a0 bcc.w 8010ec8 + 8010d88: 8b7b ldrh r3, [r7, #26] + 8010d8a: f64f 72eb movw r2, #65515 @ 0xffeb + 8010d8e: 4293 cmp r3, r2 + 8010d90: f200 809a bhi.w 8010ec8 + goto nullreturn_ipr; + } + } + /* find the right place to insert this pbuf */ + /* @todo: trim pbufs if fragments are overlapping */ + valid = ip_reass_chain_frag_into_datagram_and_validate(ipr, p, is_last); + 8010d94: 69fa ldr r2, [r7, #28] + 8010d96: 6879 ldr r1, [r7, #4] + 8010d98: 6b38 ldr r0, [r7, #48] @ 0x30 + 8010d9a: f7ff fdd5 bl 8010948 + 8010d9e: 6178 str r0, [r7, #20] + if (valid == IP_REASS_VALIDATE_PBUF_DROPPED) { + 8010da0: 697b ldr r3, [r7, #20] + 8010da2: f1b3 3fff cmp.w r3, #4294967295 + 8010da6: f000 809b beq.w 8010ee0 + /* if we come here, the pbuf has been enqueued */ + + /* Track the current number of pbufs current 'in-flight', in order to limit + the number of fragments that may be enqueued at any one time + (overflow checked by testing against IP_REASS_MAX_PBUFS) */ + ip_reass_pbufcount = (u16_t)(ip_reass_pbufcount + clen); + 8010daa: 4b48 ldr r3, [pc, #288] @ (8010ecc ) + 8010dac: 881a ldrh r2, [r3, #0] + 8010dae: 8c3b ldrh r3, [r7, #32] + 8010db0: 4413 add r3, r2 + 8010db2: b29a uxth r2, r3 + 8010db4: 4b45 ldr r3, [pc, #276] @ (8010ecc ) + 8010db6: 801a strh r2, [r3, #0] + if (is_last) { + 8010db8: 69fb ldr r3, [r7, #28] + 8010dba: 2b00 cmp r3, #0 + 8010dbc: d00d beq.n 8010dda + u16_t datagram_len = (u16_t)(offset + len); + 8010dbe: 8cfa ldrh r2, [r7, #38] @ 0x26 + 8010dc0: 8cbb ldrh r3, [r7, #36] @ 0x24 + 8010dc2: 4413 add r3, r2 + 8010dc4: 827b strh r3, [r7, #18] + ipr->datagram_len = datagram_len; + 8010dc6: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010dc8: 8a7a ldrh r2, [r7, #18] + 8010dca: 839a strh r2, [r3, #28] + ipr->flags |= IP_REASS_FLAG_LASTFRAG; + 8010dcc: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010dce: 7f9b ldrb r3, [r3, #30] + 8010dd0: f043 0301 orr.w r3, r3, #1 + 8010dd4: b2da uxtb r2, r3 + 8010dd6: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010dd8: 779a strb r2, [r3, #30] + LWIP_DEBUGF(IP_REASS_DEBUG, + ("ip4_reass: last fragment seen, total len %"S16_F"\n", + ipr->datagram_len)); + } + + if (valid == IP_REASS_VALIDATE_TELEGRAM_FINISHED) { + 8010dda: 697b ldr r3, [r7, #20] + 8010ddc: 2b01 cmp r3, #1 + 8010dde: d171 bne.n 8010ec4 + struct ip_reassdata *ipr_prev; + /* the totally last fragment (flag more fragments = 0) was received at least + * once AND all fragments are received */ + u16_t datagram_len = (u16_t)(ipr->datagram_len + IP_HLEN); + 8010de0: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010de2: 8b9b ldrh r3, [r3, #28] + 8010de4: 3314 adds r3, #20 + 8010de6: 823b strh r3, [r7, #16] + + /* save the second pbuf before copying the header over the pointer */ + r = ((struct ip_reass_helper *)ipr->p->payload)->next_pbuf; + 8010de8: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010dea: 685b ldr r3, [r3, #4] + 8010dec: 685b ldr r3, [r3, #4] + 8010dee: 681b ldr r3, [r3, #0] + 8010df0: 637b str r3, [r7, #52] @ 0x34 + + /* copy the original ip header back to the first pbuf */ + fraghdr = (struct ip_hdr *)(ipr->p->payload); + 8010df2: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010df4: 685b ldr r3, [r3, #4] + 8010df6: 685b ldr r3, [r3, #4] + 8010df8: 62bb str r3, [r7, #40] @ 0x28 + SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN); + 8010dfa: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010dfc: 3308 adds r3, #8 + 8010dfe: 2214 movs r2, #20 + 8010e00: 4619 mov r1, r3 + 8010e02: 6ab8 ldr r0, [r7, #40] @ 0x28 + 8010e04: f000 fcf4 bl 80117f0 + IPH_LEN_SET(fraghdr, lwip_htons(datagram_len)); + 8010e08: 8a3b ldrh r3, [r7, #16] + 8010e0a: 4618 mov r0, r3 + 8010e0c: f7f4 fabc bl 8005388 + 8010e10: 4603 mov r3, r0 + 8010e12: 461a mov r2, r3 + 8010e14: 6abb ldr r3, [r7, #40] @ 0x28 + 8010e16: 805a strh r2, [r3, #2] + IPH_OFFSET_SET(fraghdr, 0); + 8010e18: 6abb ldr r3, [r7, #40] @ 0x28 + 8010e1a: 2200 movs r2, #0 + 8010e1c: 719a strb r2, [r3, #6] + 8010e1e: 2200 movs r2, #0 + 8010e20: 71da strb r2, [r3, #7] + IPH_CHKSUM_SET(fraghdr, 0); + 8010e22: 6abb ldr r3, [r7, #40] @ 0x28 + 8010e24: 2200 movs r2, #0 + 8010e26: 729a strb r2, [r3, #10] + 8010e28: 2200 movs r2, #0 + 8010e2a: 72da strb r2, [r3, #11] + IF__NETIF_CHECKSUM_ENABLED(ip_current_input_netif(), NETIF_CHECKSUM_GEN_IP) { + IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN)); + } +#endif /* CHECKSUM_GEN_IP */ + + p = ipr->p; + 8010e2c: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010e2e: 685b ldr r3, [r3, #4] + 8010e30: 607b str r3, [r7, #4] + + /* chain together the pbufs contained within the reass_data list. */ + while (r != NULL) { + 8010e32: e00d b.n 8010e50 + iprh = (struct ip_reass_helper *)r->payload; + 8010e34: 6b7b ldr r3, [r7, #52] @ 0x34 + 8010e36: 685b ldr r3, [r3, #4] + 8010e38: 60fb str r3, [r7, #12] + + /* hide the ip header for every succeeding fragment */ + pbuf_remove_header(r, IP_HLEN); + 8010e3a: 2114 movs r1, #20 + 8010e3c: 6b78 ldr r0, [r7, #52] @ 0x34 + 8010e3e: f7f5 fd6d bl 800691c + pbuf_cat(p, r); + 8010e42: 6b79 ldr r1, [r7, #52] @ 0x34 + 8010e44: 6878 ldr r0, [r7, #4] + 8010e46: f7f5 feb1 bl 8006bac + r = iprh->next_pbuf; + 8010e4a: 68fb ldr r3, [r7, #12] + 8010e4c: 681b ldr r3, [r3, #0] + 8010e4e: 637b str r3, [r7, #52] @ 0x34 + while (r != NULL) { + 8010e50: 6b7b ldr r3, [r7, #52] @ 0x34 + 8010e52: 2b00 cmp r3, #0 + 8010e54: d1ee bne.n 8010e34 + } + + /* find the previous entry in the linked list */ + if (ipr == reassdatagrams) { + 8010e56: 4b1e ldr r3, [pc, #120] @ (8010ed0 ) + 8010e58: 681b ldr r3, [r3, #0] + 8010e5a: 6b3a ldr r2, [r7, #48] @ 0x30 + 8010e5c: 429a cmp r2, r3 + 8010e5e: d102 bne.n 8010e66 + ipr_prev = NULL; + 8010e60: 2300 movs r3, #0 + 8010e62: 62fb str r3, [r7, #44] @ 0x2c + 8010e64: e010 b.n 8010e88 + } else { + for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { + 8010e66: 4b1a ldr r3, [pc, #104] @ (8010ed0 ) + 8010e68: 681b ldr r3, [r3, #0] + 8010e6a: 62fb str r3, [r7, #44] @ 0x2c + 8010e6c: e007 b.n 8010e7e + if (ipr_prev->next == ipr) { + 8010e6e: 6afb ldr r3, [r7, #44] @ 0x2c + 8010e70: 681b ldr r3, [r3, #0] + 8010e72: 6b3a ldr r2, [r7, #48] @ 0x30 + 8010e74: 429a cmp r2, r3 + 8010e76: d006 beq.n 8010e86 + for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { + 8010e78: 6afb ldr r3, [r7, #44] @ 0x2c + 8010e7a: 681b ldr r3, [r3, #0] + 8010e7c: 62fb str r3, [r7, #44] @ 0x2c + 8010e7e: 6afb ldr r3, [r7, #44] @ 0x2c + 8010e80: 2b00 cmp r3, #0 + 8010e82: d1f4 bne.n 8010e6e + 8010e84: e000 b.n 8010e88 + break; + 8010e86: bf00 nop + } + } + } + + /* release the sources allocate for the fragment queue entry */ + ip_reass_dequeue_datagram(ipr, ipr_prev); + 8010e88: 6af9 ldr r1, [r7, #44] @ 0x2c + 8010e8a: 6b38 ldr r0, [r7, #48] @ 0x30 + 8010e8c: f7ff fd2e bl 80108ec + + /* and adjust the number of pbufs currently queued for reassembly. */ + clen = pbuf_clen(p); + 8010e90: 6878 ldr r0, [r7, #4] + 8010e92: f7f5 fe51 bl 8006b38 + 8010e96: 4603 mov r3, r0 + 8010e98: 843b strh r3, [r7, #32] + LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= clen); + 8010e9a: 4b0c ldr r3, [pc, #48] @ (8010ecc ) + 8010e9c: 881b ldrh r3, [r3, #0] + 8010e9e: 8c3a ldrh r2, [r7, #32] + 8010ea0: 429a cmp r2, r3 + 8010ea2: d906 bls.n 8010eb2 + 8010ea4: 4b0b ldr r3, [pc, #44] @ (8010ed4 ) + 8010ea6: f240 229b movw r2, #667 @ 0x29b + 8010eaa: 490b ldr r1, [pc, #44] @ (8010ed8 ) + 8010eac: 480b ldr r0, [pc, #44] @ (8010edc ) + 8010eae: f000 fba3 bl 80115f8 + ip_reass_pbufcount = (u16_t)(ip_reass_pbufcount - clen); + 8010eb2: 4b06 ldr r3, [pc, #24] @ (8010ecc ) + 8010eb4: 881a ldrh r2, [r3, #0] + 8010eb6: 8c3b ldrh r3, [r7, #32] + 8010eb8: 1ad3 subs r3, r2, r3 + 8010eba: b29a uxth r2, r3 + 8010ebc: 4b03 ldr r3, [pc, #12] @ (8010ecc ) + 8010ebe: 801a strh r2, [r3, #0] + + MIB2_STATS_INC(mib2.ipreasmoks); + + /* Return the pbuf chain */ + return p; + 8010ec0: 687b ldr r3, [r7, #4] + 8010ec2: e038 b.n 8010f36 + } + /* the datagram is not (yet?) reassembled completely */ + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_pbufcount: %d out\n", ip_reass_pbufcount)); + return NULL; + 8010ec4: 2300 movs r3, #0 + 8010ec6: e036 b.n 8010f36 + goto nullreturn_ipr; + 8010ec8: bf00 nop + 8010eca: e00a b.n 8010ee2 + 8010ecc: 20019230 .word 0x20019230 + 8010ed0: 2001922c .word 0x2001922c + 8010ed4: 08018b1c .word 0x08018b1c + 8010ed8: 08018c8c .word 0x08018c8c + 8010edc: 08018b64 .word 0x08018b64 + goto nullreturn_ipr; + 8010ee0: bf00 nop + +nullreturn_ipr: + LWIP_ASSERT("ipr != NULL", ipr != NULL); + 8010ee2: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010ee4: 2b00 cmp r3, #0 + 8010ee6: d106 bne.n 8010ef6 + 8010ee8: 4b15 ldr r3, [pc, #84] @ (8010f40 ) + 8010eea: f44f 722a mov.w r2, #680 @ 0x2a8 + 8010eee: 4915 ldr r1, [pc, #84] @ (8010f44 ) + 8010ef0: 4815 ldr r0, [pc, #84] @ (8010f48 ) + 8010ef2: f000 fb81 bl 80115f8 + if (ipr->p == NULL) { + 8010ef6: 6b3b ldr r3, [r7, #48] @ 0x30 + 8010ef8: 685b ldr r3, [r3, #4] + 8010efa: 2b00 cmp r3, #0 + 8010efc: d116 bne.n 8010f2c + /* dropped pbuf after creating a new datagram entry: remove the entry, too */ + LWIP_ASSERT("not firstalthough just enqueued", ipr == reassdatagrams); + 8010efe: 4b13 ldr r3, [pc, #76] @ (8010f4c ) + 8010f00: 681b ldr r3, [r3, #0] + 8010f02: 6b3a ldr r2, [r7, #48] @ 0x30 + 8010f04: 429a cmp r2, r3 + 8010f06: d006 beq.n 8010f16 + 8010f08: 4b0d ldr r3, [pc, #52] @ (8010f40 ) + 8010f0a: f240 22ab movw r2, #683 @ 0x2ab + 8010f0e: 4910 ldr r1, [pc, #64] @ (8010f50 ) + 8010f10: 480d ldr r0, [pc, #52] @ (8010f48 ) + 8010f12: f000 fb71 bl 80115f8 + ip_reass_dequeue_datagram(ipr, NULL); + 8010f16: 2100 movs r1, #0 + 8010f18: 6b38 ldr r0, [r7, #48] @ 0x30 + 8010f1a: f7ff fce7 bl 80108ec + 8010f1e: e006 b.n 8010f2e + goto nullreturn; + 8010f20: bf00 nop + 8010f22: e004 b.n 8010f2e + goto nullreturn; + 8010f24: bf00 nop + 8010f26: e002 b.n 8010f2e + goto nullreturn; + 8010f28: bf00 nop + 8010f2a: e000 b.n 8010f2e + } + +nullreturn: + 8010f2c: bf00 nop + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip4_reass: nullreturn\n")); + IPFRAG_STATS_INC(ip_frag.drop); + pbuf_free(p); + 8010f2e: 6878 ldr r0, [r7, #4] + 8010f30: f7f5 fd7a bl 8006a28 + return NULL; + 8010f34: 2300 movs r3, #0 +} + 8010f36: 4618 mov r0, r3 + 8010f38: 3738 adds r7, #56 @ 0x38 + 8010f3a: 46bd mov sp, r7 + 8010f3c: bd80 pop {r7, pc} + 8010f3e: bf00 nop + 8010f40: 08018b1c .word 0x08018b1c + 8010f44: 08018ca8 .word 0x08018ca8 + 8010f48: 08018b64 .word 0x08018b64 + 8010f4c: 2001922c .word 0x2001922c + 8010f50: 08018cb4 .word 0x08018cb4 + +08010f54 : +#if IP_FRAG +#if !LWIP_NETIF_TX_SINGLE_PBUF +/** Allocate a new struct pbuf_custom_ref */ +static struct pbuf_custom_ref * +ip_frag_alloc_pbuf_custom_ref(void) +{ + 8010f54: b580 push {r7, lr} + 8010f56: af00 add r7, sp, #0 + return (struct pbuf_custom_ref *)memp_malloc(MEMP_FRAG_PBUF); + 8010f58: 2005 movs r0, #5 + 8010f5a: f7f4 fe75 bl 8005c48 + 8010f5e: 4603 mov r3, r0 +} + 8010f60: 4618 mov r0, r3 + 8010f62: bd80 pop {r7, pc} + +08010f64 : + +/** Free a struct pbuf_custom_ref */ +static void +ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref *p) +{ + 8010f64: b580 push {r7, lr} + 8010f66: b082 sub sp, #8 + 8010f68: af00 add r7, sp, #0 + 8010f6a: 6078 str r0, [r7, #4] + LWIP_ASSERT("p != NULL", p != NULL); + 8010f6c: 687b ldr r3, [r7, #4] + 8010f6e: 2b00 cmp r3, #0 + 8010f70: d106 bne.n 8010f80 + 8010f72: 4b07 ldr r3, [pc, #28] @ (8010f90 ) + 8010f74: f44f 7231 mov.w r2, #708 @ 0x2c4 + 8010f78: 4906 ldr r1, [pc, #24] @ (8010f94 ) + 8010f7a: 4807 ldr r0, [pc, #28] @ (8010f98 ) + 8010f7c: f000 fb3c bl 80115f8 + memp_free(MEMP_FRAG_PBUF, p); + 8010f80: 6879 ldr r1, [r7, #4] + 8010f82: 2005 movs r0, #5 + 8010f84: f7f4 fed0 bl 8005d28 +} + 8010f88: bf00 nop + 8010f8a: 3708 adds r7, #8 + 8010f8c: 46bd mov sp, r7 + 8010f8e: bd80 pop {r7, pc} + 8010f90: 08018b1c .word 0x08018b1c + 8010f94: 08018cd4 .word 0x08018cd4 + 8010f98: 08018b64 .word 0x08018b64 + +08010f9c : + +/** Free-callback function to free a 'struct pbuf_custom_ref', called by + * pbuf_free. */ +static void +ipfrag_free_pbuf_custom(struct pbuf *p) +{ + 8010f9c: b580 push {r7, lr} + 8010f9e: b084 sub sp, #16 + 8010fa0: af00 add r7, sp, #0 + 8010fa2: 6078 str r0, [r7, #4] + struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref *)p; + 8010fa4: 687b ldr r3, [r7, #4] + 8010fa6: 60fb str r3, [r7, #12] + LWIP_ASSERT("pcr != NULL", pcr != NULL); + 8010fa8: 68fb ldr r3, [r7, #12] + 8010faa: 2b00 cmp r3, #0 + 8010fac: d106 bne.n 8010fbc + 8010fae: 4b11 ldr r3, [pc, #68] @ (8010ff4 ) + 8010fb0: f240 22ce movw r2, #718 @ 0x2ce + 8010fb4: 4910 ldr r1, [pc, #64] @ (8010ff8 ) + 8010fb6: 4811 ldr r0, [pc, #68] @ (8010ffc ) + 8010fb8: f000 fb1e bl 80115f8 + LWIP_ASSERT("pcr == p", (void *)pcr == (void *)p); + 8010fbc: 68fa ldr r2, [r7, #12] + 8010fbe: 687b ldr r3, [r7, #4] + 8010fc0: 429a cmp r2, r3 + 8010fc2: d006 beq.n 8010fd2 + 8010fc4: 4b0b ldr r3, [pc, #44] @ (8010ff4 ) + 8010fc6: f240 22cf movw r2, #719 @ 0x2cf + 8010fca: 490d ldr r1, [pc, #52] @ (8011000 ) + 8010fcc: 480b ldr r0, [pc, #44] @ (8010ffc ) + 8010fce: f000 fb13 bl 80115f8 + if (pcr->original != NULL) { + 8010fd2: 68fb ldr r3, [r7, #12] + 8010fd4: 695b ldr r3, [r3, #20] + 8010fd6: 2b00 cmp r3, #0 + 8010fd8: d004 beq.n 8010fe4 + pbuf_free(pcr->original); + 8010fda: 68fb ldr r3, [r7, #12] + 8010fdc: 695b ldr r3, [r3, #20] + 8010fde: 4618 mov r0, r3 + 8010fe0: f7f5 fd22 bl 8006a28 + } + ip_frag_free_pbuf_custom_ref(pcr); + 8010fe4: 68f8 ldr r0, [r7, #12] + 8010fe6: f7ff ffbd bl 8010f64 +} + 8010fea: bf00 nop + 8010fec: 3710 adds r7, #16 + 8010fee: 46bd mov sp, r7 + 8010ff0: bd80 pop {r7, pc} + 8010ff2: bf00 nop + 8010ff4: 08018b1c .word 0x08018b1c + 8010ff8: 08018ce0 .word 0x08018ce0 + 8010ffc: 08018b64 .word 0x08018b64 + 8011000: 08018cec .word 0x08018cec + +08011004 : + * + * @return ERR_OK if sent successfully, err_t otherwise + */ +err_t +ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest) +{ + 8011004: b580 push {r7, lr} + 8011006: b094 sub sp, #80 @ 0x50 + 8011008: af02 add r7, sp, #8 + 801100a: 60f8 str r0, [r7, #12] + 801100c: 60b9 str r1, [r7, #8] + 801100e: 607a str r2, [r7, #4] + struct pbuf *rambuf; +#if !LWIP_NETIF_TX_SINGLE_PBUF + struct pbuf *newpbuf; + u16_t newpbuflen = 0; + 8011010: 2300 movs r3, #0 + 8011012: f8a7 3046 strh.w r3, [r7, #70] @ 0x46 + u16_t left_to_copy; +#endif + struct ip_hdr *original_iphdr; + struct ip_hdr *iphdr; + const u16_t nfb = (u16_t)((netif->mtu - IP_HLEN) / 8); + 8011016: 68bb ldr r3, [r7, #8] + 8011018: 8d1b ldrh r3, [r3, #40] @ 0x28 + 801101a: 3b14 subs r3, #20 + 801101c: 2b00 cmp r3, #0 + 801101e: da00 bge.n 8011022 + 8011020: 3307 adds r3, #7 + 8011022: 10db asrs r3, r3, #3 + 8011024: 877b strh r3, [r7, #58] @ 0x3a + u16_t left, fragsize; + u16_t ofo; + int last; + u16_t poff = IP_HLEN; + 8011026: 2314 movs r3, #20 + 8011028: 87fb strh r3, [r7, #62] @ 0x3e + u16_t tmp; + int mf_set; + + original_iphdr = (struct ip_hdr *)p->payload; + 801102a: 68fb ldr r3, [r7, #12] + 801102c: 685b ldr r3, [r3, #4] + 801102e: 637b str r3, [r7, #52] @ 0x34 + iphdr = original_iphdr; + 8011030: 6b7b ldr r3, [r7, #52] @ 0x34 + 8011032: 633b str r3, [r7, #48] @ 0x30 + if (IPH_HL_BYTES(iphdr) != IP_HLEN) { + 8011034: 6b3b ldr r3, [r7, #48] @ 0x30 + 8011036: 781b ldrb r3, [r3, #0] + 8011038: f003 030f and.w r3, r3, #15 + 801103c: b2db uxtb r3, r3 + 801103e: 009b lsls r3, r3, #2 + 8011040: b2db uxtb r3, r3 + 8011042: 2b14 cmp r3, #20 + 8011044: d002 beq.n 801104c + /* ip4_frag() does not support IP options */ + return ERR_VAL; + 8011046: f06f 0305 mvn.w r3, #5 + 801104a: e110 b.n 801126e + } + LWIP_ERROR("ip4_frag(): pbuf too short", p->len >= IP_HLEN, return ERR_VAL); + 801104c: 68fb ldr r3, [r7, #12] + 801104e: 895b ldrh r3, [r3, #10] + 8011050: 2b13 cmp r3, #19 + 8011052: d809 bhi.n 8011068 + 8011054: 4b88 ldr r3, [pc, #544] @ (8011278 ) + 8011056: f44f 723f mov.w r2, #764 @ 0x2fc + 801105a: 4988 ldr r1, [pc, #544] @ (801127c ) + 801105c: 4888 ldr r0, [pc, #544] @ (8011280 ) + 801105e: f000 facb bl 80115f8 + 8011062: f06f 0305 mvn.w r3, #5 + 8011066: e102 b.n 801126e + + /* Save original offset */ + tmp = lwip_ntohs(IPH_OFFSET(iphdr)); + 8011068: 6b3b ldr r3, [r7, #48] @ 0x30 + 801106a: 88db ldrh r3, [r3, #6] + 801106c: b29b uxth r3, r3 + 801106e: 4618 mov r0, r3 + 8011070: f7f4 f98a bl 8005388 + 8011074: 4603 mov r3, r0 + 8011076: 87bb strh r3, [r7, #60] @ 0x3c + ofo = tmp & IP_OFFMASK; + 8011078: 8fbb ldrh r3, [r7, #60] @ 0x3c + 801107a: f3c3 030c ubfx r3, r3, #0, #13 + 801107e: f8a7 3040 strh.w r3, [r7, #64] @ 0x40 + /* already fragmented? if so, the last fragment we create must have MF, too */ + mf_set = tmp & IP_MF; + 8011082: 8fbb ldrh r3, [r7, #60] @ 0x3c + 8011084: f403 5300 and.w r3, r3, #8192 @ 0x2000 + 8011088: 62fb str r3, [r7, #44] @ 0x2c + + left = (u16_t)(p->tot_len - IP_HLEN); + 801108a: 68fb ldr r3, [r7, #12] + 801108c: 891b ldrh r3, [r3, #8] + 801108e: 3b14 subs r3, #20 + 8011090: f8a7 3042 strh.w r3, [r7, #66] @ 0x42 + + while (left) { + 8011094: e0e1 b.n 801125a + /* Fill this fragment */ + fragsize = LWIP_MIN(left, (u16_t)(nfb * 8)); + 8011096: 8f7b ldrh r3, [r7, #58] @ 0x3a + 8011098: 00db lsls r3, r3, #3 + 801109a: b29b uxth r3, r3 + 801109c: f8b7 2042 ldrh.w r2, [r7, #66] @ 0x42 + 80110a0: 4293 cmp r3, r2 + 80110a2: bf28 it cs + 80110a4: 4613 movcs r3, r2 + 80110a6: 857b strh r3, [r7, #42] @ 0x2a + /* When not using a static buffer, create a chain of pbufs. + * The first will be a PBUF_RAM holding the link and IP header. + * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged, + * but limited to the size of an mtu. + */ + rambuf = pbuf_alloc(PBUF_LINK, IP_HLEN, PBUF_RAM); + 80110a8: f44f 7220 mov.w r2, #640 @ 0x280 + 80110ac: 2114 movs r1, #20 + 80110ae: 200e movs r0, #14 + 80110b0: f7f5 f9d8 bl 8006464 + 80110b4: 6278 str r0, [r7, #36] @ 0x24 + if (rambuf == NULL) { + 80110b6: 6a7b ldr r3, [r7, #36] @ 0x24 + 80110b8: 2b00 cmp r3, #0 + 80110ba: f000 80d5 beq.w 8011268 + goto memerr; + } + LWIP_ASSERT("this needs a pbuf in one piece!", + 80110be: 6a7b ldr r3, [r7, #36] @ 0x24 + 80110c0: 895b ldrh r3, [r3, #10] + 80110c2: 2b13 cmp r3, #19 + 80110c4: d806 bhi.n 80110d4 + 80110c6: 4b6c ldr r3, [pc, #432] @ (8011278 ) + 80110c8: f44f 7249 mov.w r2, #804 @ 0x324 + 80110cc: 496d ldr r1, [pc, #436] @ (8011284 ) + 80110ce: 486c ldr r0, [pc, #432] @ (8011280 ) + 80110d0: f000 fa92 bl 80115f8 + (rambuf->len >= (IP_HLEN))); + SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN); + 80110d4: 6a7b ldr r3, [r7, #36] @ 0x24 + 80110d6: 685b ldr r3, [r3, #4] + 80110d8: 2214 movs r2, #20 + 80110da: 6b79 ldr r1, [r7, #52] @ 0x34 + 80110dc: 4618 mov r0, r3 + 80110de: f000 fb87 bl 80117f0 + iphdr = (struct ip_hdr *)rambuf->payload; + 80110e2: 6a7b ldr r3, [r7, #36] @ 0x24 + 80110e4: 685b ldr r3, [r3, #4] + 80110e6: 633b str r3, [r7, #48] @ 0x30 + + left_to_copy = fragsize; + 80110e8: 8d7b ldrh r3, [r7, #42] @ 0x2a + 80110ea: f8a7 3044 strh.w r3, [r7, #68] @ 0x44 + while (left_to_copy) { + 80110ee: e064 b.n 80111ba + struct pbuf_custom_ref *pcr; + u16_t plen = (u16_t)(p->len - poff); + 80110f0: 68fb ldr r3, [r7, #12] + 80110f2: 895a ldrh r2, [r3, #10] + 80110f4: 8ffb ldrh r3, [r7, #62] @ 0x3e + 80110f6: 1ad3 subs r3, r2, r3 + 80110f8: 83fb strh r3, [r7, #30] + LWIP_ASSERT("p->len >= poff", p->len >= poff); + 80110fa: 68fb ldr r3, [r7, #12] + 80110fc: 895b ldrh r3, [r3, #10] + 80110fe: 8ffa ldrh r2, [r7, #62] @ 0x3e + 8011100: 429a cmp r2, r3 + 8011102: d906 bls.n 8011112 + 8011104: 4b5c ldr r3, [pc, #368] @ (8011278 ) + 8011106: f240 322d movw r2, #813 @ 0x32d + 801110a: 495f ldr r1, [pc, #380] @ (8011288 ) + 801110c: 485c ldr r0, [pc, #368] @ (8011280 ) + 801110e: f000 fa73 bl 80115f8 + newpbuflen = LWIP_MIN(left_to_copy, plen); + 8011112: 8bfa ldrh r2, [r7, #30] + 8011114: f8b7 3044 ldrh.w r3, [r7, #68] @ 0x44 + 8011118: 4293 cmp r3, r2 + 801111a: bf28 it cs + 801111c: 4613 movcs r3, r2 + 801111e: f8a7 3046 strh.w r3, [r7, #70] @ 0x46 + /* Is this pbuf already empty? */ + if (!newpbuflen) { + 8011122: f8b7 3046 ldrh.w r3, [r7, #70] @ 0x46 + 8011126: 2b00 cmp r3, #0 + 8011128: d105 bne.n 8011136 + poff = 0; + 801112a: 2300 movs r3, #0 + 801112c: 87fb strh r3, [r7, #62] @ 0x3e + p = p->next; + 801112e: 68fb ldr r3, [r7, #12] + 8011130: 681b ldr r3, [r3, #0] + 8011132: 60fb str r3, [r7, #12] + continue; + 8011134: e041 b.n 80111ba + } + pcr = ip_frag_alloc_pbuf_custom_ref(); + 8011136: f7ff ff0d bl 8010f54 + 801113a: 61b8 str r0, [r7, #24] + if (pcr == NULL) { + 801113c: 69bb ldr r3, [r7, #24] + 801113e: 2b00 cmp r3, #0 + 8011140: d103 bne.n 801114a + pbuf_free(rambuf); + 8011142: 6a78 ldr r0, [r7, #36] @ 0x24 + 8011144: f7f5 fc70 bl 8006a28 + goto memerr; + 8011148: e08f b.n 801126a + } + /* Mirror this pbuf, although we might not need all of it. */ + newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, + 801114a: 69b8 ldr r0, [r7, #24] + (u8_t *)p->payload + poff, newpbuflen); + 801114c: 68fb ldr r3, [r7, #12] + 801114e: 685a ldr r2, [r3, #4] + newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, + 8011150: 8ffb ldrh r3, [r7, #62] @ 0x3e + 8011152: 4413 add r3, r2 + 8011154: f8b7 1046 ldrh.w r1, [r7, #70] @ 0x46 + 8011158: f8b7 2046 ldrh.w r2, [r7, #70] @ 0x46 + 801115c: 9201 str r2, [sp, #4] + 801115e: 9300 str r3, [sp, #0] + 8011160: 4603 mov r3, r0 + 8011162: 2241 movs r2, #65 @ 0x41 + 8011164: 2000 movs r0, #0 + 8011166: f7f5 faa7 bl 80066b8 + 801116a: 6178 str r0, [r7, #20] + if (newpbuf == NULL) { + 801116c: 697b ldr r3, [r7, #20] + 801116e: 2b00 cmp r3, #0 + 8011170: d106 bne.n 8011180 + ip_frag_free_pbuf_custom_ref(pcr); + 8011172: 69b8 ldr r0, [r7, #24] + 8011174: f7ff fef6 bl 8010f64 + pbuf_free(rambuf); + 8011178: 6a78 ldr r0, [r7, #36] @ 0x24 + 801117a: f7f5 fc55 bl 8006a28 + goto memerr; + 801117e: e074 b.n 801126a + } + pbuf_ref(p); + 8011180: 68f8 ldr r0, [r7, #12] + 8011182: f7f5 fcf1 bl 8006b68 + pcr->original = p; + 8011186: 69bb ldr r3, [r7, #24] + 8011188: 68fa ldr r2, [r7, #12] + 801118a: 615a str r2, [r3, #20] + pcr->pc.custom_free_function = ipfrag_free_pbuf_custom; + 801118c: 69bb ldr r3, [r7, #24] + 801118e: 4a3f ldr r2, [pc, #252] @ (801128c ) + 8011190: 611a str r2, [r3, #16] + + /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain + * so that it is removed when pbuf_dechain is later called on rambuf. + */ + pbuf_cat(rambuf, newpbuf); + 8011192: 6979 ldr r1, [r7, #20] + 8011194: 6a78 ldr r0, [r7, #36] @ 0x24 + 8011196: f7f5 fd09 bl 8006bac + left_to_copy = (u16_t)(left_to_copy - newpbuflen); + 801119a: f8b7 2044 ldrh.w r2, [r7, #68] @ 0x44 + 801119e: f8b7 3046 ldrh.w r3, [r7, #70] @ 0x46 + 80111a2: 1ad3 subs r3, r2, r3 + 80111a4: f8a7 3044 strh.w r3, [r7, #68] @ 0x44 + if (left_to_copy) { + 80111a8: f8b7 3044 ldrh.w r3, [r7, #68] @ 0x44 + 80111ac: 2b00 cmp r3, #0 + 80111ae: d004 beq.n 80111ba + poff = 0; + 80111b0: 2300 movs r3, #0 + 80111b2: 87fb strh r3, [r7, #62] @ 0x3e + p = p->next; + 80111b4: 68fb ldr r3, [r7, #12] + 80111b6: 681b ldr r3, [r3, #0] + 80111b8: 60fb str r3, [r7, #12] + while (left_to_copy) { + 80111ba: f8b7 3044 ldrh.w r3, [r7, #68] @ 0x44 + 80111be: 2b00 cmp r3, #0 + 80111c0: d196 bne.n 80110f0 + } + } + poff = (u16_t)(poff + newpbuflen); + 80111c2: 8ffa ldrh r2, [r7, #62] @ 0x3e + 80111c4: f8b7 3046 ldrh.w r3, [r7, #70] @ 0x46 + 80111c8: 4413 add r3, r2 + 80111ca: 87fb strh r3, [r7, #62] @ 0x3e +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + + /* Correct header */ + last = (left <= netif->mtu - IP_HLEN); + 80111cc: 68bb ldr r3, [r7, #8] + 80111ce: 8d1b ldrh r3, [r3, #40] @ 0x28 + 80111d0: f1a3 0213 sub.w r2, r3, #19 + 80111d4: f8b7 3042 ldrh.w r3, [r7, #66] @ 0x42 + 80111d8: 429a cmp r2, r3 + 80111da: bfcc ite gt + 80111dc: 2301 movgt r3, #1 + 80111de: 2300 movle r3, #0 + 80111e0: b2db uxtb r3, r3 + 80111e2: 623b str r3, [r7, #32] + + /* Set new offset and MF flag */ + tmp = (IP_OFFMASK & (ofo)); + 80111e4: f8b7 3040 ldrh.w r3, [r7, #64] @ 0x40 + 80111e8: f3c3 030c ubfx r3, r3, #0, #13 + 80111ec: 87bb strh r3, [r7, #60] @ 0x3c + if (!last || mf_set) { + 80111ee: 6a3b ldr r3, [r7, #32] + 80111f0: 2b00 cmp r3, #0 + 80111f2: d002 beq.n 80111fa + 80111f4: 6afb ldr r3, [r7, #44] @ 0x2c + 80111f6: 2b00 cmp r3, #0 + 80111f8: d003 beq.n 8011202 + /* the last fragment has MF set if the input frame had it */ + tmp = tmp | IP_MF; + 80111fa: 8fbb ldrh r3, [r7, #60] @ 0x3c + 80111fc: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 8011200: 87bb strh r3, [r7, #60] @ 0x3c + } + IPH_OFFSET_SET(iphdr, lwip_htons(tmp)); + 8011202: 8fbb ldrh r3, [r7, #60] @ 0x3c + 8011204: 4618 mov r0, r3 + 8011206: f7f4 f8bf bl 8005388 + 801120a: 4603 mov r3, r0 + 801120c: 461a mov r2, r3 + 801120e: 6b3b ldr r3, [r7, #48] @ 0x30 + 8011210: 80da strh r2, [r3, #6] + IPH_LEN_SET(iphdr, lwip_htons((u16_t)(fragsize + IP_HLEN))); + 8011212: 8d7b ldrh r3, [r7, #42] @ 0x2a + 8011214: 3314 adds r3, #20 + 8011216: b29b uxth r3, r3 + 8011218: 4618 mov r0, r3 + 801121a: f7f4 f8b5 bl 8005388 + 801121e: 4603 mov r3, r0 + 8011220: 461a mov r2, r3 + 8011222: 6b3b ldr r3, [r7, #48] @ 0x30 + 8011224: 805a strh r2, [r3, #2] + IPH_CHKSUM_SET(iphdr, 0); + 8011226: 6b3b ldr r3, [r7, #48] @ 0x30 + 8011228: 2200 movs r2, #0 + 801122a: 729a strb r2, [r3, #10] + 801122c: 2200 movs r2, #0 + 801122e: 72da strb r2, [r3, #11] +#endif /* CHECKSUM_GEN_IP */ + + /* No need for separate header pbuf - we allowed room for it in rambuf + * when allocated. + */ + netif->output(netif, rambuf, dest); + 8011230: 68bb ldr r3, [r7, #8] + 8011232: 695b ldr r3, [r3, #20] + 8011234: 687a ldr r2, [r7, #4] + 8011236: 6a79 ldr r1, [r7, #36] @ 0x24 + 8011238: 68b8 ldr r0, [r7, #8] + 801123a: 4798 blx r3 + * recreate it next time round the loop. If we're lucky the hardware + * will have already sent the packet, the free will really free, and + * there will be zero memory penalty. + */ + + pbuf_free(rambuf); + 801123c: 6a78 ldr r0, [r7, #36] @ 0x24 + 801123e: f7f5 fbf3 bl 8006a28 + left = (u16_t)(left - fragsize); + 8011242: f8b7 2042 ldrh.w r2, [r7, #66] @ 0x42 + 8011246: 8d7b ldrh r3, [r7, #42] @ 0x2a + 8011248: 1ad3 subs r3, r2, r3 + 801124a: f8a7 3042 strh.w r3, [r7, #66] @ 0x42 + ofo = (u16_t)(ofo + nfb); + 801124e: f8b7 2040 ldrh.w r2, [r7, #64] @ 0x40 + 8011252: 8f7b ldrh r3, [r7, #58] @ 0x3a + 8011254: 4413 add r3, r2 + 8011256: f8a7 3040 strh.w r3, [r7, #64] @ 0x40 + while (left) { + 801125a: f8b7 3042 ldrh.w r3, [r7, #66] @ 0x42 + 801125e: 2b00 cmp r3, #0 + 8011260: f47f af19 bne.w 8011096 + } + MIB2_STATS_INC(mib2.ipfragoks); + return ERR_OK; + 8011264: 2300 movs r3, #0 + 8011266: e002 b.n 801126e + goto memerr; + 8011268: bf00 nop +memerr: + MIB2_STATS_INC(mib2.ipfragfails); + return ERR_MEM; + 801126a: f04f 33ff mov.w r3, #4294967295 +} + 801126e: 4618 mov r0, r3 + 8011270: 3748 adds r7, #72 @ 0x48 + 8011272: 46bd mov sp, r7 + 8011274: bd80 pop {r7, pc} + 8011276: bf00 nop + 8011278: 08018b1c .word 0x08018b1c + 801127c: 08018cf8 .word 0x08018cf8 + 8011280: 08018b64 .word 0x08018b64 + 8011284: 08018d14 .word 0x08018d14 + 8011288: 08018d34 .word 0x08018d34 + 801128c: 08010f9d .word 0x08010f9d + +08011290 : + * @see ETHARP_SUPPORT_VLAN + * @see LWIP_HOOK_VLAN_CHECK + */ +err_t +ethernet_input(struct pbuf *p, struct netif *netif) +{ + 8011290: b580 push {r7, lr} + 8011292: b086 sub sp, #24 + 8011294: af00 add r7, sp, #0 + 8011296: 6078 str r0, [r7, #4] + 8011298: 6039 str r1, [r7, #0] + struct eth_hdr *ethhdr; + u16_t type; +#if LWIP_ARP || ETHARP_SUPPORT_VLAN || LWIP_IPV6 + u16_t next_hdr_offset = SIZEOF_ETH_HDR; + 801129a: 230e movs r3, #14 + 801129c: 82fb strh r3, [r7, #22] +#endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */ + + LWIP_ASSERT_CORE_LOCKED(); + + if (p->len <= SIZEOF_ETH_HDR) { + 801129e: 687b ldr r3, [r7, #4] + 80112a0: 895b ldrh r3, [r3, #10] + 80112a2: 2b0e cmp r3, #14 + 80112a4: d96e bls.n 8011384 + ETHARP_STATS_INC(etharp.drop); + MIB2_STATS_NETIF_INC(netif, ifinerrors); + goto free_and_return; + } + + if (p->if_idx == NETIF_NO_INDEX) { + 80112a6: 687b ldr r3, [r7, #4] + 80112a8: 7bdb ldrb r3, [r3, #15] + 80112aa: 2b00 cmp r3, #0 + 80112ac: d106 bne.n 80112bc + p->if_idx = netif_get_index(netif); + 80112ae: 683b ldr r3, [r7, #0] + 80112b0: f893 3034 ldrb.w r3, [r3, #52] @ 0x34 + 80112b4: 3301 adds r3, #1 + 80112b6: b2da uxtb r2, r3 + 80112b8: 687b ldr r3, [r7, #4] + 80112ba: 73da strb r2, [r3, #15] + } + + /* points to packet payload, which starts with an Ethernet header */ + ethhdr = (struct eth_hdr *)p->payload; + 80112bc: 687b ldr r3, [r7, #4] + 80112be: 685b ldr r3, [r3, #4] + 80112c0: 613b str r3, [r7, #16] + (unsigned char)ethhdr->dest.addr[3], (unsigned char)ethhdr->dest.addr[4], (unsigned char)ethhdr->dest.addr[5], + (unsigned char)ethhdr->src.addr[0], (unsigned char)ethhdr->src.addr[1], (unsigned char)ethhdr->src.addr[2], + (unsigned char)ethhdr->src.addr[3], (unsigned char)ethhdr->src.addr[4], (unsigned char)ethhdr->src.addr[5], + lwip_htons(ethhdr->type))); + + type = ethhdr->type; + 80112c2: 693b ldr r3, [r7, #16] + 80112c4: 7b1a ldrb r2, [r3, #12] + 80112c6: 7b5b ldrb r3, [r3, #13] + 80112c8: 021b lsls r3, r3, #8 + 80112ca: 4313 orrs r3, r2 + 80112cc: 81fb strh r3, [r7, #14] + +#if LWIP_ARP_FILTER_NETIF + netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, lwip_htons(type)); +#endif /* LWIP_ARP_FILTER_NETIF*/ + + if (ethhdr->dest.addr[0] & 1) { + 80112ce: 693b ldr r3, [r7, #16] + 80112d0: 781b ldrb r3, [r3, #0] + 80112d2: f003 0301 and.w r3, r3, #1 + 80112d6: 2b00 cmp r3, #0 + 80112d8: d023 beq.n 8011322 + /* this might be a multicast or broadcast packet */ + if (ethhdr->dest.addr[0] == LL_IP4_MULTICAST_ADDR_0) { + 80112da: 693b ldr r3, [r7, #16] + 80112dc: 781b ldrb r3, [r3, #0] + 80112de: 2b01 cmp r3, #1 + 80112e0: d10f bne.n 8011302 +#if LWIP_IPV4 + if ((ethhdr->dest.addr[1] == LL_IP4_MULTICAST_ADDR_1) && + 80112e2: 693b ldr r3, [r7, #16] + 80112e4: 785b ldrb r3, [r3, #1] + 80112e6: 2b00 cmp r3, #0 + 80112e8: d11b bne.n 8011322 + (ethhdr->dest.addr[2] == LL_IP4_MULTICAST_ADDR_2)) { + 80112ea: 693b ldr r3, [r7, #16] + 80112ec: 789b ldrb r3, [r3, #2] + if ((ethhdr->dest.addr[1] == LL_IP4_MULTICAST_ADDR_1) && + 80112ee: 2b5e cmp r3, #94 @ 0x5e + 80112f0: d117 bne.n 8011322 + /* mark the pbuf as link-layer multicast */ + p->flags |= PBUF_FLAG_LLMCAST; + 80112f2: 687b ldr r3, [r7, #4] + 80112f4: 7b5b ldrb r3, [r3, #13] + 80112f6: f043 0310 orr.w r3, r3, #16 + 80112fa: b2da uxtb r2, r3 + 80112fc: 687b ldr r3, [r7, #4] + 80112fe: 735a strb r2, [r3, #13] + 8011300: e00f b.n 8011322 + (ethhdr->dest.addr[1] == LL_IP6_MULTICAST_ADDR_1)) { + /* mark the pbuf as link-layer multicast */ + p->flags |= PBUF_FLAG_LLMCAST; + } +#endif /* LWIP_IPV6 */ + else if (eth_addr_cmp(ðhdr->dest, ðbroadcast)) { + 8011302: 693b ldr r3, [r7, #16] + 8011304: 2206 movs r2, #6 + 8011306: 4928 ldr r1, [pc, #160] @ (80113a8 ) + 8011308: 4618 mov r0, r3 + 801130a: f000 f9ca bl 80116a2 + 801130e: 4603 mov r3, r0 + 8011310: 2b00 cmp r3, #0 + 8011312: d106 bne.n 8011322 + /* mark the pbuf as link-layer broadcast */ + p->flags |= PBUF_FLAG_LLBCAST; + 8011314: 687b ldr r3, [r7, #4] + 8011316: 7b5b ldrb r3, [r3, #13] + 8011318: f043 0308 orr.w r3, r3, #8 + 801131c: b2da uxtb r2, r3 + 801131e: 687b ldr r3, [r7, #4] + 8011320: 735a strb r2, [r3, #13] + } + } + + switch (type) { + 8011322: 89fb ldrh r3, [r7, #14] + 8011324: 2b08 cmp r3, #8 + 8011326: d003 beq.n 8011330 + 8011328: f5b3 6fc1 cmp.w r3, #1544 @ 0x608 + 801132c: d014 beq.n 8011358 + } +#endif + ETHARP_STATS_INC(etharp.proterr); + ETHARP_STATS_INC(etharp.drop); + MIB2_STATS_NETIF_INC(netif, ifinunknownprotos); + goto free_and_return; + 801132e: e032 b.n 8011396 + if (!(netif->flags & NETIF_FLAG_ETHARP)) { + 8011330: 683b ldr r3, [r7, #0] + 8011332: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 8011336: f003 0308 and.w r3, r3, #8 + 801133a: 2b00 cmp r3, #0 + 801133c: d024 beq.n 8011388 + if (pbuf_remove_header(p, next_hdr_offset)) { + 801133e: 8afb ldrh r3, [r7, #22] + 8011340: 4619 mov r1, r3 + 8011342: 6878 ldr r0, [r7, #4] + 8011344: f7f5 faea bl 800691c + 8011348: 4603 mov r3, r0 + 801134a: 2b00 cmp r3, #0 + 801134c: d11e bne.n 801138c + ip4_input(p, netif); + 801134e: 6839 ldr r1, [r7, #0] + 8011350: 6878 ldr r0, [r7, #4] + 8011352: f7fe fdc5 bl 800fee0 + break; + 8011356: e013 b.n 8011380 + if (!(netif->flags & NETIF_FLAG_ETHARP)) { + 8011358: 683b ldr r3, [r7, #0] + 801135a: f893 3031 ldrb.w r3, [r3, #49] @ 0x31 + 801135e: f003 0308 and.w r3, r3, #8 + 8011362: 2b00 cmp r3, #0 + 8011364: d014 beq.n 8011390 + if (pbuf_remove_header(p, next_hdr_offset)) { + 8011366: 8afb ldrh r3, [r7, #22] + 8011368: 4619 mov r1, r3 + 801136a: 6878 ldr r0, [r7, #4] + 801136c: f7f5 fad6 bl 800691c + 8011370: 4603 mov r3, r0 + 8011372: 2b00 cmp r3, #0 + 8011374: d10e bne.n 8011394 + etharp_input(p, netif); + 8011376: 6839 ldr r1, [r7, #0] + 8011378: 6878 ldr r0, [r7, #4] + 801137a: f7fd ff61 bl 800f240 + break; + 801137e: bf00 nop + } + + /* This means the pbuf is freed or consumed, + so the caller doesn't have to free it again */ + return ERR_OK; + 8011380: 2300 movs r3, #0 + 8011382: e00c b.n 801139e + goto free_and_return; + 8011384: bf00 nop + 8011386: e006 b.n 8011396 + goto free_and_return; + 8011388: bf00 nop + 801138a: e004 b.n 8011396 + goto free_and_return; + 801138c: bf00 nop + 801138e: e002 b.n 8011396 + goto free_and_return; + 8011390: bf00 nop + 8011392: e000 b.n 8011396 + goto free_and_return; + 8011394: bf00 nop + +free_and_return: + pbuf_free(p); + 8011396: 6878 ldr r0, [r7, #4] + 8011398: f7f5 fb46 bl 8006a28 + return ERR_OK; + 801139c: 2300 movs r3, #0 +} + 801139e: 4618 mov r0, r3 + 80113a0: 3718 adds r7, #24 + 80113a2: 46bd mov sp, r7 + 80113a4: bd80 pop {r7, pc} + 80113a6: bf00 nop + 80113a8: 08018edc .word 0x08018edc + +080113ac : + * @return ERR_OK if the packet was sent, any other err_t on failure + */ +err_t +ethernet_output(struct netif * netif, struct pbuf * p, + const struct eth_addr * src, const struct eth_addr * dst, + u16_t eth_type) { + 80113ac: b580 push {r7, lr} + 80113ae: b086 sub sp, #24 + 80113b0: af00 add r7, sp, #0 + 80113b2: 60f8 str r0, [r7, #12] + 80113b4: 60b9 str r1, [r7, #8] + 80113b6: 607a str r2, [r7, #4] + 80113b8: 603b str r3, [r7, #0] + struct eth_hdr *ethhdr; + u16_t eth_type_be = lwip_htons(eth_type); + 80113ba: 8c3b ldrh r3, [r7, #32] + 80113bc: 4618 mov r0, r3 + 80113be: f7f3 ffe3 bl 8005388 + 80113c2: 4603 mov r3, r0 + 80113c4: 82fb strh r3, [r7, #22] + + eth_type_be = PP_HTONS(ETHTYPE_VLAN); + } else +#endif /* ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET) */ + { + if (pbuf_add_header(p, SIZEOF_ETH_HDR) != 0) { + 80113c6: 210e movs r1, #14 + 80113c8: 68b8 ldr r0, [r7, #8] + 80113ca: f7f5 fa97 bl 80068fc + 80113ce: 4603 mov r3, r0 + 80113d0: 2b00 cmp r3, #0 + 80113d2: d125 bne.n 8011420 + } + } + + LWIP_ASSERT_CORE_LOCKED(); + + ethhdr = (struct eth_hdr *)p->payload; + 80113d4: 68bb ldr r3, [r7, #8] + 80113d6: 685b ldr r3, [r3, #4] + 80113d8: 613b str r3, [r7, #16] + ethhdr->type = eth_type_be; + 80113da: 693b ldr r3, [r7, #16] + 80113dc: 8afa ldrh r2, [r7, #22] + 80113de: 819a strh r2, [r3, #12] + SMEMCPY(ðhdr->dest, dst, ETH_HWADDR_LEN); + 80113e0: 693b ldr r3, [r7, #16] + 80113e2: 2206 movs r2, #6 + 80113e4: 6839 ldr r1, [r7, #0] + 80113e6: 4618 mov r0, r3 + 80113e8: f000 fa02 bl 80117f0 + SMEMCPY(ðhdr->src, src, ETH_HWADDR_LEN); + 80113ec: 693b ldr r3, [r7, #16] + 80113ee: 3306 adds r3, #6 + 80113f0: 2206 movs r2, #6 + 80113f2: 6879 ldr r1, [r7, #4] + 80113f4: 4618 mov r0, r3 + 80113f6: f000 f9fb bl 80117f0 + + LWIP_ASSERT("netif->hwaddr_len must be 6 for ethernet_output!", + 80113fa: 68fb ldr r3, [r7, #12] + 80113fc: f893 3030 ldrb.w r3, [r3, #48] @ 0x30 + 8011400: 2b06 cmp r3, #6 + 8011402: d006 beq.n 8011412 + 8011404: 4b0a ldr r3, [pc, #40] @ (8011430 ) + 8011406: f44f 7299 mov.w r2, #306 @ 0x132 + 801140a: 490a ldr r1, [pc, #40] @ (8011434 ) + 801140c: 480a ldr r0, [pc, #40] @ (8011438 ) + 801140e: f000 f8f3 bl 80115f8 + (netif->hwaddr_len == ETH_HWADDR_LEN)); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, + ("ethernet_output: sending packet %p\n", (void *)p)); + + /* send the packet */ + return netif->linkoutput(netif, p); + 8011412: 68fb ldr r3, [r7, #12] + 8011414: 699b ldr r3, [r3, #24] + 8011416: 68b9 ldr r1, [r7, #8] + 8011418: 68f8 ldr r0, [r7, #12] + 801141a: 4798 blx r3 + 801141c: 4603 mov r3, r0 + 801141e: e002 b.n 8011426 + goto pbuf_header_failed; + 8011420: bf00 nop + +pbuf_header_failed: + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("ethernet_output: could not allocate room for header.\n")); + LINK_STATS_INC(link.lenerr); + return ERR_BUF; + 8011422: f06f 0301 mvn.w r3, #1 +} + 8011426: 4618 mov r0, r3 + 8011428: 3718 adds r7, #24 + 801142a: 46bd mov sp, r7 + 801142c: bd80 pop {r7, pc} + 801142e: bf00 nop + 8011430: 08018d44 .word 0x08018d44 + 8011434: 08018d7c .word 0x08018d7c + 8011438: 08018db0 .word 0x08018db0 + +0801143c : + 801143c: 4b0a ldr r3, [pc, #40] @ (8011468 ) + 801143e: 480b ldr r0, [pc, #44] @ (801146c ) + 8011440: 6819 ldr r1, [r3, #0] + 8011442: 4a0b ldr r2, [pc, #44] @ (8011470 ) + 8011444: f8d1 3098 ldr.w r3, [r1, #152] @ 0x98 + 8011448: b510 push {r4, lr} + 801144a: f8d1 409c ldr.w r4, [r1, #156] @ 0x9c + 801144e: 4358 muls r0, r3 + 8011450: fb02 0004 mla r0, r2, r4, r0 + 8011454: fba3 3202 umull r3, r2, r3, r2 + 8011458: 3301 adds r3, #1 + 801145a: eb40 0002 adc.w r0, r0, r2 + 801145e: e9c1 3026 strd r3, r0, [r1, #152] @ 0x98 + 8011462: f020 4000 bic.w r0, r0, #2147483648 @ 0x80000000 + 8011466: bd10 pop {r4, pc} + 8011468: 2000003c .word 0x2000003c + 801146c: 5851f42d .word 0x5851f42d + 8011470: 4c957f2d .word 0x4c957f2d + +08011474 : + 8011474: 2300 movs r3, #0 + 8011476: b510 push {r4, lr} + 8011478: 4604 mov r4, r0 + 801147a: e9c0 3300 strd r3, r3, [r0] + 801147e: e9c0 3304 strd r3, r3, [r0, #16] + 8011482: 6083 str r3, [r0, #8] + 8011484: 8181 strh r1, [r0, #12] + 8011486: 6643 str r3, [r0, #100] @ 0x64 + 8011488: 81c2 strh r2, [r0, #14] + 801148a: 6183 str r3, [r0, #24] + 801148c: 4619 mov r1, r3 + 801148e: 2208 movs r2, #8 + 8011490: 305c adds r0, #92 @ 0x5c + 8011492: f000 f930 bl 80116f6 + 8011496: 4b0d ldr r3, [pc, #52] @ (80114cc ) + 8011498: 6223 str r3, [r4, #32] + 801149a: 4b0d ldr r3, [pc, #52] @ (80114d0 ) + 801149c: 6263 str r3, [r4, #36] @ 0x24 + 801149e: 4b0d ldr r3, [pc, #52] @ (80114d4 ) + 80114a0: 62a3 str r3, [r4, #40] @ 0x28 + 80114a2: 4b0d ldr r3, [pc, #52] @ (80114d8 ) + 80114a4: 62e3 str r3, [r4, #44] @ 0x2c + 80114a6: 4b0d ldr r3, [pc, #52] @ (80114dc ) + 80114a8: 61e4 str r4, [r4, #28] + 80114aa: 429c cmp r4, r3 + 80114ac: d006 beq.n 80114bc + 80114ae: f103 0268 add.w r2, r3, #104 @ 0x68 + 80114b2: 4294 cmp r4, r2 + 80114b4: d002 beq.n 80114bc + 80114b6: 33d0 adds r3, #208 @ 0xd0 + 80114b8: 429c cmp r4, r3 + 80114ba: d105 bne.n 80114c8 + 80114bc: f104 0058 add.w r0, r4, #88 @ 0x58 + 80114c0: e8bd 4010 ldmia.w sp!, {r4, lr} + 80114c4: f000 b990 b.w 80117e8 <__retarget_lock_init_recursive> + 80114c8: bd10 pop {r4, pc} + 80114ca: bf00 nop + 80114cc: 0801161d .word 0x0801161d + 80114d0: 0801163f .word 0x0801163f + 80114d4: 08011677 .word 0x08011677 + 80114d8: 0801169b .word 0x0801169b + 80114dc: 20019234 .word 0x20019234 + +080114e0 : + 80114e0: 4a02 ldr r2, [pc, #8] @ (80114ec ) + 80114e2: 4903 ldr r1, [pc, #12] @ (80114f0 ) + 80114e4: 4803 ldr r0, [pc, #12] @ (80114f4 ) + 80114e6: f000 b869 b.w 80115bc <_fwalk_sglue> + 80114ea: bf00 nop + 80114ec: 20000030 .word 0x20000030 + 80114f0: 08013db5 .word 0x08013db5 + 80114f4: 20000040 .word 0x20000040 + +080114f8 : + 80114f8: 6841 ldr r1, [r0, #4] + 80114fa: 4b0c ldr r3, [pc, #48] @ (801152c ) + 80114fc: 4299 cmp r1, r3 + 80114fe: b510 push {r4, lr} + 8011500: 4604 mov r4, r0 + 8011502: d001 beq.n 8011508 + 8011504: f002 fc56 bl 8013db4 <_fclose_r> + 8011508: 68a1 ldr r1, [r4, #8] + 801150a: 4b09 ldr r3, [pc, #36] @ (8011530 ) + 801150c: 4299 cmp r1, r3 + 801150e: d002 beq.n 8011516 + 8011510: 4620 mov r0, r4 + 8011512: f002 fc4f bl 8013db4 <_fclose_r> + 8011516: 68e1 ldr r1, [r4, #12] + 8011518: 4b06 ldr r3, [pc, #24] @ (8011534 ) + 801151a: 4299 cmp r1, r3 + 801151c: d004 beq.n 8011528 + 801151e: 4620 mov r0, r4 + 8011520: e8bd 4010 ldmia.w sp!, {r4, lr} + 8011524: f002 bc46 b.w 8013db4 <_fclose_r> + 8011528: bd10 pop {r4, pc} + 801152a: bf00 nop + 801152c: 20019234 .word 0x20019234 + 8011530: 2001929c .word 0x2001929c + 8011534: 20019304 .word 0x20019304 + +08011538 : + 8011538: b510 push {r4, lr} + 801153a: 4b0b ldr r3, [pc, #44] @ (8011568 ) + 801153c: 4c0b ldr r4, [pc, #44] @ (801156c ) + 801153e: 4a0c ldr r2, [pc, #48] @ (8011570 ) + 8011540: 601a str r2, [r3, #0] + 8011542: 4620 mov r0, r4 + 8011544: 2200 movs r2, #0 + 8011546: 2104 movs r1, #4 + 8011548: f7ff ff94 bl 8011474 + 801154c: f104 0068 add.w r0, r4, #104 @ 0x68 + 8011550: 2201 movs r2, #1 + 8011552: 2109 movs r1, #9 + 8011554: f7ff ff8e bl 8011474 + 8011558: f104 00d0 add.w r0, r4, #208 @ 0xd0 + 801155c: 2202 movs r2, #2 + 801155e: e8bd 4010 ldmia.w sp!, {r4, lr} + 8011562: 2112 movs r1, #18 + 8011564: f7ff bf86 b.w 8011474 + 8011568: 2001936c .word 0x2001936c + 801156c: 20019234 .word 0x20019234 + 8011570: 080114e1 .word 0x080114e1 + +08011574 <__sfp_lock_acquire>: + 8011574: 4801 ldr r0, [pc, #4] @ (801157c <__sfp_lock_acquire+0x8>) + 8011576: f000 b939 b.w 80117ec <__retarget_lock_acquire_recursive> + 801157a: bf00 nop + 801157c: 20019376 .word 0x20019376 + +08011580 <__sfp_lock_release>: + 8011580: 4801 ldr r0, [pc, #4] @ (8011588 <__sfp_lock_release+0x8>) + 8011582: f000 b934 b.w 80117ee <__retarget_lock_release_recursive> + 8011586: bf00 nop + 8011588: 20019376 .word 0x20019376 + +0801158c <__sinit>: + 801158c: b510 push {r4, lr} + 801158e: 4604 mov r4, r0 + 8011590: f7ff fff0 bl 8011574 <__sfp_lock_acquire> + 8011594: 6b63 ldr r3, [r4, #52] @ 0x34 + 8011596: b11b cbz r3, 80115a0 <__sinit+0x14> + 8011598: e8bd 4010 ldmia.w sp!, {r4, lr} + 801159c: f7ff bff0 b.w 8011580 <__sfp_lock_release> + 80115a0: 4b04 ldr r3, [pc, #16] @ (80115b4 <__sinit+0x28>) + 80115a2: 6363 str r3, [r4, #52] @ 0x34 + 80115a4: 4b04 ldr r3, [pc, #16] @ (80115b8 <__sinit+0x2c>) + 80115a6: 681b ldr r3, [r3, #0] + 80115a8: 2b00 cmp r3, #0 + 80115aa: d1f5 bne.n 8011598 <__sinit+0xc> + 80115ac: f7ff ffc4 bl 8011538 + 80115b0: e7f2 b.n 8011598 <__sinit+0xc> + 80115b2: bf00 nop + 80115b4: 080114f9 .word 0x080114f9 + 80115b8: 2001936c .word 0x2001936c + +080115bc <_fwalk_sglue>: + 80115bc: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr} + 80115c0: 4607 mov r7, r0 + 80115c2: 4688 mov r8, r1 + 80115c4: 4614 mov r4, r2 + 80115c6: 2600 movs r6, #0 + 80115c8: e9d4 9501 ldrd r9, r5, [r4, #4] + 80115cc: f1b9 0901 subs.w r9, r9, #1 + 80115d0: d505 bpl.n 80115de <_fwalk_sglue+0x22> + 80115d2: 6824 ldr r4, [r4, #0] + 80115d4: 2c00 cmp r4, #0 + 80115d6: d1f7 bne.n 80115c8 <_fwalk_sglue+0xc> + 80115d8: 4630 mov r0, r6 + 80115da: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc} + 80115de: 89ab ldrh r3, [r5, #12] + 80115e0: 2b01 cmp r3, #1 + 80115e2: d907 bls.n 80115f4 <_fwalk_sglue+0x38> + 80115e4: f9b5 300e ldrsh.w r3, [r5, #14] + 80115e8: 3301 adds r3, #1 + 80115ea: d003 beq.n 80115f4 <_fwalk_sglue+0x38> + 80115ec: 4629 mov r1, r5 + 80115ee: 4638 mov r0, r7 + 80115f0: 47c0 blx r8 + 80115f2: 4306 orrs r6, r0 + 80115f4: 3568 adds r5, #104 @ 0x68 + 80115f6: e7e9 b.n 80115cc <_fwalk_sglue+0x10> + +080115f8 : + 80115f8: b40f push {r0, r1, r2, r3} + 80115fa: b507 push {r0, r1, r2, lr} + 80115fc: 4906 ldr r1, [pc, #24] @ (8011618 ) + 80115fe: ab04 add r3, sp, #16 + 8011600: 6808 ldr r0, [r1, #0] + 8011602: f853 2b04 ldr.w r2, [r3], #4 + 8011606: 6881 ldr r1, [r0, #8] + 8011608: 9301 str r3, [sp, #4] + 801160a: f000 fc6d bl 8011ee8 <_vfprintf_r> + 801160e: b003 add sp, #12 + 8011610: f85d eb04 ldr.w lr, [sp], #4 + 8011614: b004 add sp, #16 + 8011616: 4770 bx lr + 8011618: 2000003c .word 0x2000003c + +0801161c <__sread>: + 801161c: b510 push {r4, lr} + 801161e: 460c mov r4, r1 + 8011620: f9b1 100e ldrsh.w r1, [r1, #14] + 8011624: f000 f892 bl 801174c <_read_r> + 8011628: 2800 cmp r0, #0 + 801162a: bfab itete ge + 801162c: 6d23 ldrge r3, [r4, #80] @ 0x50 + 801162e: 89a3 ldrhlt r3, [r4, #12] + 8011630: 181b addge r3, r3, r0 + 8011632: f423 5380 biclt.w r3, r3, #4096 @ 0x1000 + 8011636: bfac ite ge + 8011638: 6523 strge r3, [r4, #80] @ 0x50 + 801163a: 81a3 strhlt r3, [r4, #12] + 801163c: bd10 pop {r4, pc} + +0801163e <__swrite>: + 801163e: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} + 8011642: 461f mov r7, r3 + 8011644: 898b ldrh r3, [r1, #12] + 8011646: 05db lsls r3, r3, #23 + 8011648: 4605 mov r5, r0 + 801164a: 460c mov r4, r1 + 801164c: 4616 mov r6, r2 + 801164e: d505 bpl.n 801165c <__swrite+0x1e> + 8011650: f9b1 100e ldrsh.w r1, [r1, #14] + 8011654: 2302 movs r3, #2 + 8011656: 2200 movs r2, #0 + 8011658: f000 f866 bl 8011728 <_lseek_r> + 801165c: 89a3 ldrh r3, [r4, #12] + 801165e: f9b4 100e ldrsh.w r1, [r4, #14] + 8011662: f423 5380 bic.w r3, r3, #4096 @ 0x1000 + 8011666: 81a3 strh r3, [r4, #12] + 8011668: 4632 mov r2, r6 + 801166a: 463b mov r3, r7 + 801166c: 4628 mov r0, r5 + 801166e: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr} + 8011672: f000 b87d b.w 8011770 <_write_r> + +08011676 <__sseek>: + 8011676: b510 push {r4, lr} + 8011678: 460c mov r4, r1 + 801167a: f9b1 100e ldrsh.w r1, [r1, #14] + 801167e: f000 f853 bl 8011728 <_lseek_r> + 8011682: 1c43 adds r3, r0, #1 + 8011684: 89a3 ldrh r3, [r4, #12] + 8011686: bf15 itete ne + 8011688: 6520 strne r0, [r4, #80] @ 0x50 + 801168a: f423 5380 biceq.w r3, r3, #4096 @ 0x1000 + 801168e: f443 5380 orrne.w r3, r3, #4096 @ 0x1000 + 8011692: 81a3 strheq r3, [r4, #12] + 8011694: bf18 it ne + 8011696: 81a3 strhne r3, [r4, #12] + 8011698: bd10 pop {r4, pc} + +0801169a <__sclose>: + 801169a: f9b1 100e ldrsh.w r1, [r1, #14] + 801169e: f000 b833 b.w 8011708 <_close_r> + +080116a2 : + 80116a2: b510 push {r4, lr} + 80116a4: 3901 subs r1, #1 + 80116a6: 4402 add r2, r0 + 80116a8: 4290 cmp r0, r2 + 80116aa: d101 bne.n 80116b0 + 80116ac: 2000 movs r0, #0 + 80116ae: e005 b.n 80116bc + 80116b0: 7803 ldrb r3, [r0, #0] + 80116b2: f811 4f01 ldrb.w r4, [r1, #1]! + 80116b6: 42a3 cmp r3, r4 + 80116b8: d001 beq.n 80116be + 80116ba: 1b18 subs r0, r3, r4 + 80116bc: bd10 pop {r4, pc} + 80116be: 3001 adds r0, #1 + 80116c0: e7f2 b.n 80116a8 + +080116c2 : + 80116c2: 4288 cmp r0, r1 + 80116c4: b510 push {r4, lr} + 80116c6: eb01 0402 add.w r4, r1, r2 + 80116ca: d902 bls.n 80116d2 + 80116cc: 4284 cmp r4, r0 + 80116ce: 4623 mov r3, r4 + 80116d0: d807 bhi.n 80116e2 + 80116d2: 1e43 subs r3, r0, #1 + 80116d4: 42a1 cmp r1, r4 + 80116d6: d008 beq.n 80116ea + 80116d8: f811 2b01 ldrb.w r2, [r1], #1 + 80116dc: f803 2f01 strb.w r2, [r3, #1]! + 80116e0: e7f8 b.n 80116d4 + 80116e2: 4402 add r2, r0 + 80116e4: 4601 mov r1, r0 + 80116e6: 428a cmp r2, r1 + 80116e8: d100 bne.n 80116ec + 80116ea: bd10 pop {r4, pc} + 80116ec: f813 4d01 ldrb.w r4, [r3, #-1]! + 80116f0: f802 4d01 strb.w r4, [r2, #-1]! + 80116f4: e7f7 b.n 80116e6 + +080116f6 : + 80116f6: 4402 add r2, r0 + 80116f8: 4603 mov r3, r0 + 80116fa: 4293 cmp r3, r2 + 80116fc: d100 bne.n 8011700 + 80116fe: 4770 bx lr + 8011700: f803 1b01 strb.w r1, [r3], #1 + 8011704: e7f9 b.n 80116fa + ... + +08011708 <_close_r>: + 8011708: b538 push {r3, r4, r5, lr} + 801170a: 4d06 ldr r5, [pc, #24] @ (8011724 <_close_r+0x1c>) + 801170c: 2300 movs r3, #0 + 801170e: 4604 mov r4, r0 + 8011710: 4608 mov r0, r1 + 8011712: 602b str r3, [r5, #0] + 8011714: f004 fbec bl 8015ef0 <_close> + 8011718: 1c43 adds r3, r0, #1 + 801171a: d102 bne.n 8011722 <_close_r+0x1a> + 801171c: 682b ldr r3, [r5, #0] + 801171e: b103 cbz r3, 8011722 <_close_r+0x1a> + 8011720: 6023 str r3, [r4, #0] + 8011722: bd38 pop {r3, r4, r5, pc} + 8011724: 20019370 .word 0x20019370 + +08011728 <_lseek_r>: + 8011728: b538 push {r3, r4, r5, lr} + 801172a: 4d07 ldr r5, [pc, #28] @ (8011748 <_lseek_r+0x20>) + 801172c: 4604 mov r4, r0 + 801172e: 4608 mov r0, r1 + 8011730: 4611 mov r1, r2 + 8011732: 2200 movs r2, #0 + 8011734: 602a str r2, [r5, #0] + 8011736: 461a mov r2, r3 + 8011738: f004 fc02 bl 8015f40 <_lseek> + 801173c: 1c43 adds r3, r0, #1 + 801173e: d102 bne.n 8011746 <_lseek_r+0x1e> + 8011740: 682b ldr r3, [r5, #0] + 8011742: b103 cbz r3, 8011746 <_lseek_r+0x1e> + 8011744: 6023 str r3, [r4, #0] + 8011746: bd38 pop {r3, r4, r5, pc} + 8011748: 20019370 .word 0x20019370 + +0801174c <_read_r>: + 801174c: b538 push {r3, r4, r5, lr} + 801174e: 4d07 ldr r5, [pc, #28] @ (801176c <_read_r+0x20>) + 8011750: 4604 mov r4, r0 + 8011752: 4608 mov r0, r1 + 8011754: 4611 mov r1, r2 + 8011756: 2200 movs r2, #0 + 8011758: 602a str r2, [r5, #0] + 801175a: 461a mov r2, r3 + 801175c: f004 fbf8 bl 8015f50 <_read> + 8011760: 1c43 adds r3, r0, #1 + 8011762: d102 bne.n 801176a <_read_r+0x1e> + 8011764: 682b ldr r3, [r5, #0] + 8011766: b103 cbz r3, 801176a <_read_r+0x1e> + 8011768: 6023 str r3, [r4, #0] + 801176a: bd38 pop {r3, r4, r5, pc} + 801176c: 20019370 .word 0x20019370 + +08011770 <_write_r>: + 8011770: b538 push {r3, r4, r5, lr} + 8011772: 4d07 ldr r5, [pc, #28] @ (8011790 <_write_r+0x20>) + 8011774: 4604 mov r4, r0 + 8011776: 4608 mov r0, r1 + 8011778: 4611 mov r1, r2 + 801177a: 2200 movs r2, #0 + 801177c: 602a str r2, [r5, #0] + 801177e: 461a mov r2, r3 + 8011780: f004 fbfc bl 8015f7c <_write> + 8011784: 1c43 adds r3, r0, #1 + 8011786: d102 bne.n 801178e <_write_r+0x1e> + 8011788: 682b ldr r3, [r5, #0] + 801178a: b103 cbz r3, 801178e <_write_r+0x1e> + 801178c: 6023 str r3, [r4, #0] + 801178e: bd38 pop {r3, r4, r5, pc} + 8011790: 20019370 .word 0x20019370 + +08011794 <__errno>: + 8011794: 4b01 ldr r3, [pc, #4] @ (801179c <__errno+0x8>) + 8011796: 6818 ldr r0, [r3, #0] + 8011798: 4770 bx lr + 801179a: bf00 nop + 801179c: 2000003c .word 0x2000003c + +080117a0 <__libc_init_array>: + 80117a0: b570 push {r4, r5, r6, lr} + 80117a2: 4d0d ldr r5, [pc, #52] @ (80117d8 <__libc_init_array+0x38>) + 80117a4: 4c0d ldr r4, [pc, #52] @ (80117dc <__libc_init_array+0x3c>) + 80117a6: 1b64 subs r4, r4, r5 + 80117a8: 10a4 asrs r4, r4, #2 + 80117aa: 2600 movs r6, #0 + 80117ac: 42a6 cmp r6, r4 + 80117ae: d109 bne.n 80117c4 <__libc_init_array+0x24> + 80117b0: 4d0b ldr r5, [pc, #44] @ (80117e0 <__libc_init_array+0x40>) + 80117b2: 4c0c ldr r4, [pc, #48] @ (80117e4 <__libc_init_array+0x44>) + 80117b4: f004 fbec bl 8015f90 <_init> + 80117b8: 1b64 subs r4, r4, r5 + 80117ba: 10a4 asrs r4, r4, #2 + 80117bc: 2600 movs r6, #0 + 80117be: 42a6 cmp r6, r4 + 80117c0: d105 bne.n 80117ce <__libc_init_array+0x2e> + 80117c2: bd70 pop {r4, r5, r6, pc} + 80117c4: f855 3b04 ldr.w r3, [r5], #4 + 80117c8: 4798 blx r3 + 80117ca: 3601 adds r6, #1 + 80117cc: e7ee b.n 80117ac <__libc_init_array+0xc> + 80117ce: f855 3b04 ldr.w r3, [r5], #4 + 80117d2: 4798 blx r3 + 80117d4: 3601 adds r6, #1 + 80117d6: e7f2 b.n 80117be <__libc_init_array+0x1e> + 80117d8: 0801927c .word 0x0801927c + 80117dc: 0801927c .word 0x0801927c + 80117e0: 0801927c .word 0x0801927c + 80117e4: 08019284 .word 0x08019284 + +080117e8 <__retarget_lock_init_recursive>: + 80117e8: 4770 bx lr + +080117ea <__retarget_lock_close_recursive>: + 80117ea: 4770 bx lr + +080117ec <__retarget_lock_acquire_recursive>: + 80117ec: 4770 bx lr + +080117ee <__retarget_lock_release_recursive>: + 80117ee: 4770 bx lr + +080117f0 : + 80117f0: 440a add r2, r1 + 80117f2: 4291 cmp r1, r2 + 80117f4: f100 33ff add.w r3, r0, #4294967295 + 80117f8: d100 bne.n 80117fc + 80117fa: 4770 bx lr + 80117fc: b510 push {r4, lr} + 80117fe: f811 4b01 ldrb.w r4, [r1], #1 + 8011802: f803 4f01 strb.w r4, [r3, #1]! + 8011806: 4291 cmp r1, r2 + 8011808: d1f9 bne.n 80117fe + 801180a: bd10 pop {r4, pc} + +0801180c : + 801180c: 4b02 ldr r3, [pc, #8] @ (8011818 ) + 801180e: b113 cbz r3, 8011816 + 8011810: 4802 ldr r0, [pc, #8] @ (801181c ) + 8011812: f000 b805 b.w 8011820 + 8011816: 4770 bx lr + 8011818: 00000000 .word 0x00000000 + 801181c: 08014431 .word 0x08014431 + +08011820 : + 8011820: 2300 movs r3, #0 + 8011822: 4601 mov r1, r0 + 8011824: 461a mov r2, r3 + 8011826: 4618 mov r0, r3 + 8011828: f002 be58 b.w 80144dc <__register_exitproc> + +0801182c <_malloc_trim_r>: + 801182c: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr} + 8011830: 4606 mov r6, r0 + 8011832: 2008 movs r0, #8 + 8011834: 4689 mov r9, r1 + 8011836: f002 fe0f bl 8014458 + 801183a: 4f24 ldr r7, [pc, #144] @ (80118cc <_malloc_trim_r+0xa0>) + 801183c: 4680 mov r8, r0 + 801183e: 4630 mov r0, r6 + 8011840: f000 fb44 bl 8011ecc <__malloc_lock> + 8011844: 68bb ldr r3, [r7, #8] + 8011846: 685d ldr r5, [r3, #4] + 8011848: f025 0503 bic.w r5, r5, #3 + 801184c: f1a5 0411 sub.w r4, r5, #17 + 8011850: eba4 0409 sub.w r4, r4, r9 + 8011854: 4444 add r4, r8 + 8011856: fbb4 f4f8 udiv r4, r4, r8 + 801185a: 3c01 subs r4, #1 + 801185c: fb08 f404 mul.w r4, r8, r4 + 8011860: 45a0 cmp r8, r4 + 8011862: dd05 ble.n 8011870 <_malloc_trim_r+0x44> + 8011864: 4630 mov r0, r6 + 8011866: f000 fb37 bl 8011ed8 <__malloc_unlock> + 801186a: 2000 movs r0, #0 + 801186c: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc} + 8011870: 2100 movs r1, #0 + 8011872: 4630 mov r0, r6 + 8011874: f002 fdcc bl 8014410 <_sbrk_r> + 8011878: 68bb ldr r3, [r7, #8] + 801187a: 442b add r3, r5 + 801187c: 4298 cmp r0, r3 + 801187e: d1f1 bne.n 8011864 <_malloc_trim_r+0x38> + 8011880: 4261 negs r1, r4 + 8011882: 4630 mov r0, r6 + 8011884: f002 fdc4 bl 8014410 <_sbrk_r> + 8011888: 3001 adds r0, #1 + 801188a: d110 bne.n 80118ae <_malloc_trim_r+0x82> + 801188c: 2100 movs r1, #0 + 801188e: 4630 mov r0, r6 + 8011890: f002 fdbe bl 8014410 <_sbrk_r> + 8011894: 68ba ldr r2, [r7, #8] + 8011896: 1a83 subs r3, r0, r2 + 8011898: 2b0f cmp r3, #15 + 801189a: dde3 ble.n 8011864 <_malloc_trim_r+0x38> + 801189c: 490c ldr r1, [pc, #48] @ (80118d0 <_malloc_trim_r+0xa4>) + 801189e: 6809 ldr r1, [r1, #0] + 80118a0: 1a40 subs r0, r0, r1 + 80118a2: 490c ldr r1, [pc, #48] @ (80118d4 <_malloc_trim_r+0xa8>) + 80118a4: f043 0301 orr.w r3, r3, #1 + 80118a8: 6008 str r0, [r1, #0] + 80118aa: 6053 str r3, [r2, #4] + 80118ac: e7da b.n 8011864 <_malloc_trim_r+0x38> + 80118ae: 68bb ldr r3, [r7, #8] + 80118b0: 4a08 ldr r2, [pc, #32] @ (80118d4 <_malloc_trim_r+0xa8>) + 80118b2: 1b2d subs r5, r5, r4 + 80118b4: f045 0501 orr.w r5, r5, #1 + 80118b8: 605d str r5, [r3, #4] + 80118ba: 6813 ldr r3, [r2, #0] + 80118bc: 4630 mov r0, r6 + 80118be: 1b1b subs r3, r3, r4 + 80118c0: 6013 str r3, [r2, #0] + 80118c2: f000 fb09 bl 8011ed8 <__malloc_unlock> + 80118c6: 2001 movs r0, #1 + 80118c8: e7d0 b.n 801186c <_malloc_trim_r+0x40> + 80118ca: bf00 nop + 80118cc: 2000016c .word 0x2000016c + 80118d0: 20000164 .word 0x20000164 + 80118d4: 2001937c .word 0x2001937c + +080118d8 <_free_r>: + 80118d8: b5f8 push {r3, r4, r5, r6, r7, lr} + 80118da: 4604 mov r4, r0 + 80118dc: 460f mov r7, r1 + 80118de: 2900 cmp r1, #0 + 80118e0: f000 80b1 beq.w 8011a46 <_free_r+0x16e> + 80118e4: f000 faf2 bl 8011ecc <__malloc_lock> + 80118e8: f857 2c04 ldr.w r2, [r7, #-4] + 80118ec: 4d56 ldr r5, [pc, #344] @ (8011a48 <_free_r+0x170>) + 80118ee: f022 0001 bic.w r0, r2, #1 + 80118f2: f1a7 0308 sub.w r3, r7, #8 + 80118f6: eb03 0c00 add.w ip, r3, r0 + 80118fa: 68a9 ldr r1, [r5, #8] + 80118fc: f8dc 6004 ldr.w r6, [ip, #4] + 8011900: 4561 cmp r1, ip + 8011902: f026 0603 bic.w r6, r6, #3 + 8011906: f002 0201 and.w r2, r2, #1 + 801190a: d11b bne.n 8011944 <_free_r+0x6c> + 801190c: 4406 add r6, r0 + 801190e: b93a cbnz r2, 8011920 <_free_r+0x48> + 8011910: f857 2c08 ldr.w r2, [r7, #-8] + 8011914: 1a9b subs r3, r3, r2 + 8011916: 4416 add r6, r2 + 8011918: e9d3 1202 ldrd r1, r2, [r3, #8] + 801191c: 60ca str r2, [r1, #12] + 801191e: 6091 str r1, [r2, #8] + 8011920: f046 0201 orr.w r2, r6, #1 + 8011924: 605a str r2, [r3, #4] + 8011926: 60ab str r3, [r5, #8] + 8011928: 4b48 ldr r3, [pc, #288] @ (8011a4c <_free_r+0x174>) + 801192a: 681b ldr r3, [r3, #0] + 801192c: 42b3 cmp r3, r6 + 801192e: d804 bhi.n 801193a <_free_r+0x62> + 8011930: 4b47 ldr r3, [pc, #284] @ (8011a50 <_free_r+0x178>) + 8011932: 4620 mov r0, r4 + 8011934: 6819 ldr r1, [r3, #0] + 8011936: f7ff ff79 bl 801182c <_malloc_trim_r> + 801193a: 4620 mov r0, r4 + 801193c: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr} + 8011940: f000 baca b.w 8011ed8 <__malloc_unlock> + 8011944: f8cc 6004 str.w r6, [ip, #4] + 8011948: 2a00 cmp r2, #0 + 801194a: d138 bne.n 80119be <_free_r+0xe6> + 801194c: f857 1c08 ldr.w r1, [r7, #-8] + 8011950: 1a5b subs r3, r3, r1 + 8011952: 4408 add r0, r1 + 8011954: 6899 ldr r1, [r3, #8] + 8011956: f105 0708 add.w r7, r5, #8 + 801195a: 42b9 cmp r1, r7 + 801195c: d031 beq.n 80119c2 <_free_r+0xea> + 801195e: 68df ldr r7, [r3, #12] + 8011960: 60cf str r7, [r1, #12] + 8011962: 60b9 str r1, [r7, #8] + 8011964: eb0c 0106 add.w r1, ip, r6 + 8011968: 6849 ldr r1, [r1, #4] + 801196a: 07c9 lsls r1, r1, #31 + 801196c: d40b bmi.n 8011986 <_free_r+0xae> + 801196e: f8dc 1008 ldr.w r1, [ip, #8] + 8011972: 4430 add r0, r6 + 8011974: bb3a cbnz r2, 80119c6 <_free_r+0xee> + 8011976: 4e37 ldr r6, [pc, #220] @ (8011a54 <_free_r+0x17c>) + 8011978: 42b1 cmp r1, r6 + 801197a: d124 bne.n 80119c6 <_free_r+0xee> + 801197c: e9c5 3304 strd r3, r3, [r5, #16] + 8011980: e9c3 1102 strd r1, r1, [r3, #8] + 8011984: 2201 movs r2, #1 + 8011986: f040 0101 orr.w r1, r0, #1 + 801198a: 6059 str r1, [r3, #4] + 801198c: 5018 str r0, [r3, r0] + 801198e: 2a00 cmp r2, #0 + 8011990: d1d3 bne.n 801193a <_free_r+0x62> + 8011992: f5b0 7f00 cmp.w r0, #512 @ 0x200 + 8011996: d21b bcs.n 80119d0 <_free_r+0xf8> + 8011998: 08c2 lsrs r2, r0, #3 + 801199a: 2101 movs r1, #1 + 801199c: 0940 lsrs r0, r0, #5 + 801199e: 4081 lsls r1, r0 + 80119a0: 6868 ldr r0, [r5, #4] + 80119a2: 3201 adds r2, #1 + 80119a4: 4301 orrs r1, r0 + 80119a6: 6069 str r1, [r5, #4] + 80119a8: f855 0032 ldr.w r0, [r5, r2, lsl #3] + 80119ac: eb05 01c2 add.w r1, r5, r2, lsl #3 + 80119b0: 3908 subs r1, #8 + 80119b2: e9c3 0102 strd r0, r1, [r3, #8] + 80119b6: f845 3032 str.w r3, [r5, r2, lsl #3] + 80119ba: 60c3 str r3, [r0, #12] + 80119bc: e7bd b.n 801193a <_free_r+0x62> + 80119be: 2200 movs r2, #0 + 80119c0: e7d0 b.n 8011964 <_free_r+0x8c> + 80119c2: 2201 movs r2, #1 + 80119c4: e7ce b.n 8011964 <_free_r+0x8c> + 80119c6: f8dc 600c ldr.w r6, [ip, #12] + 80119ca: 60ce str r6, [r1, #12] + 80119cc: 60b1 str r1, [r6, #8] + 80119ce: e7da b.n 8011986 <_free_r+0xae> + 80119d0: f5b0 6f20 cmp.w r0, #2560 @ 0xa00 + 80119d4: ea4f 2250 mov.w r2, r0, lsr #9 + 80119d8: d214 bcs.n 8011a04 <_free_r+0x12c> + 80119da: 0982 lsrs r2, r0, #6 + 80119dc: 3238 adds r2, #56 @ 0x38 + 80119de: 1c51 adds r1, r2, #1 + 80119e0: eb05 06c2 add.w r6, r5, r2, lsl #3 + 80119e4: f855 1031 ldr.w r1, [r5, r1, lsl #3] + 80119e8: 428e cmp r6, r1 + 80119ea: d125 bne.n 8011a38 <_free_r+0x160> + 80119ec: 2001 movs r0, #1 + 80119ee: 1092 asrs r2, r2, #2 + 80119f0: fa00 f202 lsl.w r2, r0, r2 + 80119f4: 6868 ldr r0, [r5, #4] + 80119f6: 4302 orrs r2, r0 + 80119f8: 606a str r2, [r5, #4] + 80119fa: e9c3 1602 strd r1, r6, [r3, #8] + 80119fe: 60b3 str r3, [r6, #8] + 8011a00: 60cb str r3, [r1, #12] + 8011a02: e79a b.n 801193a <_free_r+0x62> + 8011a04: 2a14 cmp r2, #20 + 8011a06: d801 bhi.n 8011a0c <_free_r+0x134> + 8011a08: 325b adds r2, #91 @ 0x5b + 8011a0a: e7e8 b.n 80119de <_free_r+0x106> + 8011a0c: 2a54 cmp r2, #84 @ 0x54 + 8011a0e: d802 bhi.n 8011a16 <_free_r+0x13e> + 8011a10: 0b02 lsrs r2, r0, #12 + 8011a12: 326e adds r2, #110 @ 0x6e + 8011a14: e7e3 b.n 80119de <_free_r+0x106> + 8011a16: f5b2 7faa cmp.w r2, #340 @ 0x154 + 8011a1a: d802 bhi.n 8011a22 <_free_r+0x14a> + 8011a1c: 0bc2 lsrs r2, r0, #15 + 8011a1e: 3277 adds r2, #119 @ 0x77 + 8011a20: e7dd b.n 80119de <_free_r+0x106> + 8011a22: f240 5154 movw r1, #1364 @ 0x554 + 8011a26: 428a cmp r2, r1 + 8011a28: bf9a itte ls + 8011a2a: 0c82 lsrls r2, r0, #18 + 8011a2c: 327c addls r2, #124 @ 0x7c + 8011a2e: 227e movhi r2, #126 @ 0x7e + 8011a30: e7d5 b.n 80119de <_free_r+0x106> + 8011a32: 6889 ldr r1, [r1, #8] + 8011a34: 428e cmp r6, r1 + 8011a36: d004 beq.n 8011a42 <_free_r+0x16a> + 8011a38: 684a ldr r2, [r1, #4] + 8011a3a: f022 0203 bic.w r2, r2, #3 + 8011a3e: 4282 cmp r2, r0 + 8011a40: d8f7 bhi.n 8011a32 <_free_r+0x15a> + 8011a42: 68ce ldr r6, [r1, #12] + 8011a44: e7d9 b.n 80119fa <_free_r+0x122> + 8011a46: bdf8 pop {r3, r4, r5, r6, r7, pc} + 8011a48: 2000016c .word 0x2000016c + 8011a4c: 20000168 .word 0x20000168 + 8011a50: 200193ac .word 0x200193ac + 8011a54: 20000174 .word 0x20000174 + +08011a58 <_malloc_r>: + 8011a58: f101 030b add.w r3, r1, #11 + 8011a5c: 2b16 cmp r3, #22 + 8011a5e: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8011a62: 4605 mov r5, r0 + 8011a64: d906 bls.n 8011a74 <_malloc_r+0x1c> + 8011a66: f033 0707 bics.w r7, r3, #7 + 8011a6a: d504 bpl.n 8011a76 <_malloc_r+0x1e> + 8011a6c: 230c movs r3, #12 + 8011a6e: 602b str r3, [r5, #0] + 8011a70: 2400 movs r4, #0 + 8011a72: e1a3 b.n 8011dbc <_malloc_r+0x364> + 8011a74: 2710 movs r7, #16 + 8011a76: 42b9 cmp r1, r7 + 8011a78: d8f8 bhi.n 8011a6c <_malloc_r+0x14> + 8011a7a: 4628 mov r0, r5 + 8011a7c: f000 fa26 bl 8011ecc <__malloc_lock> + 8011a80: f5b7 7ffc cmp.w r7, #504 @ 0x1f8 + 8011a84: 4eaf ldr r6, [pc, #700] @ (8011d44 <_malloc_r+0x2ec>) + 8011a86: d237 bcs.n 8011af8 <_malloc_r+0xa0> + 8011a88: f107 0208 add.w r2, r7, #8 + 8011a8c: 4432 add r2, r6 + 8011a8e: f1a2 0108 sub.w r1, r2, #8 + 8011a92: 6854 ldr r4, [r2, #4] + 8011a94: 428c cmp r4, r1 + 8011a96: ea4f 03d7 mov.w r3, r7, lsr #3 + 8011a9a: d102 bne.n 8011aa2 <_malloc_r+0x4a> + 8011a9c: 68d4 ldr r4, [r2, #12] + 8011a9e: 42a2 cmp r2, r4 + 8011aa0: d010 beq.n 8011ac4 <_malloc_r+0x6c> + 8011aa2: 6863 ldr r3, [r4, #4] + 8011aa4: e9d4 1202 ldrd r1, r2, [r4, #8] + 8011aa8: f023 0303 bic.w r3, r3, #3 + 8011aac: 60ca str r2, [r1, #12] + 8011aae: 4423 add r3, r4 + 8011ab0: 6091 str r1, [r2, #8] + 8011ab2: 685a ldr r2, [r3, #4] + 8011ab4: f042 0201 orr.w r2, r2, #1 + 8011ab8: 605a str r2, [r3, #4] + 8011aba: 4628 mov r0, r5 + 8011abc: f000 fa0c bl 8011ed8 <__malloc_unlock> + 8011ac0: 3408 adds r4, #8 + 8011ac2: e17b b.n 8011dbc <_malloc_r+0x364> + 8011ac4: 3302 adds r3, #2 + 8011ac6: 6934 ldr r4, [r6, #16] + 8011ac8: 499f ldr r1, [pc, #636] @ (8011d48 <_malloc_r+0x2f0>) + 8011aca: 428c cmp r4, r1 + 8011acc: d077 beq.n 8011bbe <_malloc_r+0x166> + 8011ace: 6862 ldr r2, [r4, #4] + 8011ad0: f022 0c03 bic.w ip, r2, #3 + 8011ad4: ebac 0007 sub.w r0, ip, r7 + 8011ad8: 280f cmp r0, #15 + 8011ada: dd48 ble.n 8011b6e <_malloc_r+0x116> + 8011adc: 19e2 adds r2, r4, r7 + 8011ade: f040 0301 orr.w r3, r0, #1 + 8011ae2: f047 0701 orr.w r7, r7, #1 + 8011ae6: 6067 str r7, [r4, #4] + 8011ae8: e9c6 2204 strd r2, r2, [r6, #16] + 8011aec: e9c2 1102 strd r1, r1, [r2, #8] + 8011af0: 6053 str r3, [r2, #4] + 8011af2: f844 000c str.w r0, [r4, ip] + 8011af6: e7e0 b.n 8011aba <_malloc_r+0x62> + 8011af8: 0a7b lsrs r3, r7, #9 + 8011afa: d02a beq.n 8011b52 <_malloc_r+0xfa> + 8011afc: 2b04 cmp r3, #4 + 8011afe: d812 bhi.n 8011b26 <_malloc_r+0xce> + 8011b00: 09bb lsrs r3, r7, #6 + 8011b02: 3338 adds r3, #56 @ 0x38 + 8011b04: 1c5a adds r2, r3, #1 + 8011b06: eb06 02c2 add.w r2, r6, r2, lsl #3 + 8011b0a: f1a2 0c08 sub.w ip, r2, #8 + 8011b0e: 6854 ldr r4, [r2, #4] + 8011b10: 4564 cmp r4, ip + 8011b12: d006 beq.n 8011b22 <_malloc_r+0xca> + 8011b14: 6862 ldr r2, [r4, #4] + 8011b16: f022 0203 bic.w r2, r2, #3 + 8011b1a: 1bd0 subs r0, r2, r7 + 8011b1c: 280f cmp r0, #15 + 8011b1e: dd1c ble.n 8011b5a <_malloc_r+0x102> + 8011b20: 3b01 subs r3, #1 + 8011b22: 3301 adds r3, #1 + 8011b24: e7cf b.n 8011ac6 <_malloc_r+0x6e> + 8011b26: 2b14 cmp r3, #20 + 8011b28: d801 bhi.n 8011b2e <_malloc_r+0xd6> + 8011b2a: 335b adds r3, #91 @ 0x5b + 8011b2c: e7ea b.n 8011b04 <_malloc_r+0xac> + 8011b2e: 2b54 cmp r3, #84 @ 0x54 + 8011b30: d802 bhi.n 8011b38 <_malloc_r+0xe0> + 8011b32: 0b3b lsrs r3, r7, #12 + 8011b34: 336e adds r3, #110 @ 0x6e + 8011b36: e7e5 b.n 8011b04 <_malloc_r+0xac> + 8011b38: f5b3 7faa cmp.w r3, #340 @ 0x154 + 8011b3c: d802 bhi.n 8011b44 <_malloc_r+0xec> + 8011b3e: 0bfb lsrs r3, r7, #15 + 8011b40: 3377 adds r3, #119 @ 0x77 + 8011b42: e7df b.n 8011b04 <_malloc_r+0xac> + 8011b44: f240 5254 movw r2, #1364 @ 0x554 + 8011b48: 4293 cmp r3, r2 + 8011b4a: d804 bhi.n 8011b56 <_malloc_r+0xfe> + 8011b4c: 0cbb lsrs r3, r7, #18 + 8011b4e: 337c adds r3, #124 @ 0x7c + 8011b50: e7d8 b.n 8011b04 <_malloc_r+0xac> + 8011b52: 233f movs r3, #63 @ 0x3f + 8011b54: e7d6 b.n 8011b04 <_malloc_r+0xac> + 8011b56: 237e movs r3, #126 @ 0x7e + 8011b58: e7d4 b.n 8011b04 <_malloc_r+0xac> + 8011b5a: 2800 cmp r0, #0 + 8011b5c: 68e1 ldr r1, [r4, #12] + 8011b5e: db04 blt.n 8011b6a <_malloc_r+0x112> + 8011b60: 68a3 ldr r3, [r4, #8] + 8011b62: 60d9 str r1, [r3, #12] + 8011b64: 608b str r3, [r1, #8] + 8011b66: 18a3 adds r3, r4, r2 + 8011b68: e7a3 b.n 8011ab2 <_malloc_r+0x5a> + 8011b6a: 460c mov r4, r1 + 8011b6c: e7d0 b.n 8011b10 <_malloc_r+0xb8> + 8011b6e: 2800 cmp r0, #0 + 8011b70: e9c6 1104 strd r1, r1, [r6, #16] + 8011b74: db07 blt.n 8011b86 <_malloc_r+0x12e> + 8011b76: 44a4 add ip, r4 + 8011b78: f8dc 3004 ldr.w r3, [ip, #4] + 8011b7c: f043 0301 orr.w r3, r3, #1 + 8011b80: f8cc 3004 str.w r3, [ip, #4] + 8011b84: e799 b.n 8011aba <_malloc_r+0x62> + 8011b86: f5bc 7f00 cmp.w ip, #512 @ 0x200 + 8011b8a: 6870 ldr r0, [r6, #4] + 8011b8c: f080 8095 bcs.w 8011cba <_malloc_r+0x262> + 8011b90: ea4f 02dc mov.w r2, ip, lsr #3 + 8011b94: ea4f 1e5c mov.w lr, ip, lsr #5 + 8011b98: f04f 0c01 mov.w ip, #1 + 8011b9c: 3201 adds r2, #1 + 8011b9e: fa0c fc0e lsl.w ip, ip, lr + 8011ba2: ea4c 0000 orr.w r0, ip, r0 + 8011ba6: 6070 str r0, [r6, #4] + 8011ba8: f856 c032 ldr.w ip, [r6, r2, lsl #3] + 8011bac: eb06 00c2 add.w r0, r6, r2, lsl #3 + 8011bb0: 3808 subs r0, #8 + 8011bb2: e9c4 c002 strd ip, r0, [r4, #8] + 8011bb6: f846 4032 str.w r4, [r6, r2, lsl #3] + 8011bba: f8cc 400c str.w r4, [ip, #12] + 8011bbe: 1098 asrs r0, r3, #2 + 8011bc0: 2201 movs r2, #1 + 8011bc2: 4082 lsls r2, r0 + 8011bc4: 6870 ldr r0, [r6, #4] + 8011bc6: 4290 cmp r0, r2 + 8011bc8: d326 bcc.n 8011c18 <_malloc_r+0x1c0> + 8011bca: 4210 tst r0, r2 + 8011bcc: d106 bne.n 8011bdc <_malloc_r+0x184> + 8011bce: f023 0303 bic.w r3, r3, #3 + 8011bd2: 0052 lsls r2, r2, #1 + 8011bd4: 4210 tst r0, r2 + 8011bd6: f103 0304 add.w r3, r3, #4 + 8011bda: d0fa beq.n 8011bd2 <_malloc_r+0x17a> + 8011bdc: eb06 08c3 add.w r8, r6, r3, lsl #3 + 8011be0: 46c1 mov r9, r8 + 8011be2: 469e mov lr, r3 + 8011be4: f8d9 400c ldr.w r4, [r9, #12] + 8011be8: 454c cmp r4, r9 + 8011bea: f040 80b9 bne.w 8011d60 <_malloc_r+0x308> + 8011bee: f10e 0e01 add.w lr, lr, #1 + 8011bf2: f01e 0f03 tst.w lr, #3 + 8011bf6: f109 0908 add.w r9, r9, #8 + 8011bfa: d1f3 bne.n 8011be4 <_malloc_r+0x18c> + 8011bfc: 0798 lsls r0, r3, #30 + 8011bfe: f040 80e3 bne.w 8011dc8 <_malloc_r+0x370> + 8011c02: 6873 ldr r3, [r6, #4] + 8011c04: ea23 0302 bic.w r3, r3, r2 + 8011c08: 6073 str r3, [r6, #4] + 8011c0a: 6870 ldr r0, [r6, #4] + 8011c0c: 0052 lsls r2, r2, #1 + 8011c0e: 4290 cmp r0, r2 + 8011c10: d302 bcc.n 8011c18 <_malloc_r+0x1c0> + 8011c12: 2a00 cmp r2, #0 + 8011c14: f040 80e5 bne.w 8011de2 <_malloc_r+0x38a> + 8011c18: f8d6 a008 ldr.w sl, [r6, #8] + 8011c1c: f8da 3004 ldr.w r3, [sl, #4] + 8011c20: f023 0903 bic.w r9, r3, #3 + 8011c24: 45b9 cmp r9, r7 + 8011c26: d304 bcc.n 8011c32 <_malloc_r+0x1da> + 8011c28: eba9 0207 sub.w r2, r9, r7 + 8011c2c: 2a0f cmp r2, #15 + 8011c2e: f300 8141 bgt.w 8011eb4 <_malloc_r+0x45c> + 8011c32: 4b46 ldr r3, [pc, #280] @ (8011d4c <_malloc_r+0x2f4>) + 8011c34: 6819 ldr r1, [r3, #0] + 8011c36: 3110 adds r1, #16 + 8011c38: 4439 add r1, r7 + 8011c3a: 2008 movs r0, #8 + 8011c3c: 9101 str r1, [sp, #4] + 8011c3e: f002 fc0b bl 8014458 + 8011c42: 4a43 ldr r2, [pc, #268] @ (8011d50 <_malloc_r+0x2f8>) + 8011c44: 9901 ldr r1, [sp, #4] + 8011c46: 6813 ldr r3, [r2, #0] + 8011c48: 3301 adds r3, #1 + 8011c4a: bf1f itttt ne + 8011c4c: f101 31ff addne.w r1, r1, #4294967295 + 8011c50: 1809 addne r1, r1, r0 + 8011c52: 4243 negne r3, r0 + 8011c54: 4019 andne r1, r3 + 8011c56: 4680 mov r8, r0 + 8011c58: 4628 mov r0, r5 + 8011c5a: 9101 str r1, [sp, #4] + 8011c5c: f002 fbd8 bl 8014410 <_sbrk_r> + 8011c60: 1c42 adds r2, r0, #1 + 8011c62: eb0a 0b09 add.w fp, sl, r9 + 8011c66: 4604 mov r4, r0 + 8011c68: f000 80f7 beq.w 8011e5a <_malloc_r+0x402> + 8011c6c: 4583 cmp fp, r0 + 8011c6e: 9901 ldr r1, [sp, #4] + 8011c70: 4a37 ldr r2, [pc, #220] @ (8011d50 <_malloc_r+0x2f8>) + 8011c72: d902 bls.n 8011c7a <_malloc_r+0x222> + 8011c74: 45b2 cmp sl, r6 + 8011c76: f040 80f0 bne.w 8011e5a <_malloc_r+0x402> + 8011c7a: 4b36 ldr r3, [pc, #216] @ (8011d54 <_malloc_r+0x2fc>) + 8011c7c: 6818 ldr r0, [r3, #0] + 8011c7e: 45a3 cmp fp, r4 + 8011c80: eb00 0e01 add.w lr, r0, r1 + 8011c84: f8c3 e000 str.w lr, [r3] + 8011c88: f108 3cff add.w ip, r8, #4294967295 + 8011c8c: f040 80ab bne.w 8011de6 <_malloc_r+0x38e> + 8011c90: ea1b 0f0c tst.w fp, ip + 8011c94: f040 80a7 bne.w 8011de6 <_malloc_r+0x38e> + 8011c98: 68b2 ldr r2, [r6, #8] + 8011c9a: 4449 add r1, r9 + 8011c9c: f041 0101 orr.w r1, r1, #1 + 8011ca0: 6051 str r1, [r2, #4] + 8011ca2: 4a2d ldr r2, [pc, #180] @ (8011d58 <_malloc_r+0x300>) + 8011ca4: 681b ldr r3, [r3, #0] + 8011ca6: 6811 ldr r1, [r2, #0] + 8011ca8: 428b cmp r3, r1 + 8011caa: bf88 it hi + 8011cac: 6013 strhi r3, [r2, #0] + 8011cae: 4a2b ldr r2, [pc, #172] @ (8011d5c <_malloc_r+0x304>) + 8011cb0: 6811 ldr r1, [r2, #0] + 8011cb2: 428b cmp r3, r1 + 8011cb4: bf88 it hi + 8011cb6: 6013 strhi r3, [r2, #0] + 8011cb8: e0cf b.n 8011e5a <_malloc_r+0x402> + 8011cba: f5bc 6f20 cmp.w ip, #2560 @ 0xa00 + 8011cbe: ea4f 225c mov.w r2, ip, lsr #9 + 8011cc2: d218 bcs.n 8011cf6 <_malloc_r+0x29e> + 8011cc4: ea4f 129c mov.w r2, ip, lsr #6 + 8011cc8: 3238 adds r2, #56 @ 0x38 + 8011cca: f102 0e01 add.w lr, r2, #1 + 8011cce: eb06 08c2 add.w r8, r6, r2, lsl #3 + 8011cd2: f856 e03e ldr.w lr, [r6, lr, lsl #3] + 8011cd6: 45f0 cmp r8, lr + 8011cd8: d12b bne.n 8011d32 <_malloc_r+0x2da> + 8011cda: 1092 asrs r2, r2, #2 + 8011cdc: f04f 0c01 mov.w ip, #1 + 8011ce0: fa0c f202 lsl.w r2, ip, r2 + 8011ce4: 4302 orrs r2, r0 + 8011ce6: 6072 str r2, [r6, #4] + 8011ce8: e9c4 e802 strd lr, r8, [r4, #8] + 8011cec: f8c8 4008 str.w r4, [r8, #8] + 8011cf0: f8ce 400c str.w r4, [lr, #12] + 8011cf4: e763 b.n 8011bbe <_malloc_r+0x166> + 8011cf6: 2a14 cmp r2, #20 + 8011cf8: d801 bhi.n 8011cfe <_malloc_r+0x2a6> + 8011cfa: 325b adds r2, #91 @ 0x5b + 8011cfc: e7e5 b.n 8011cca <_malloc_r+0x272> + 8011cfe: 2a54 cmp r2, #84 @ 0x54 + 8011d00: d803 bhi.n 8011d0a <_malloc_r+0x2b2> + 8011d02: ea4f 321c mov.w r2, ip, lsr #12 + 8011d06: 326e adds r2, #110 @ 0x6e + 8011d08: e7df b.n 8011cca <_malloc_r+0x272> + 8011d0a: f5b2 7faa cmp.w r2, #340 @ 0x154 + 8011d0e: d803 bhi.n 8011d18 <_malloc_r+0x2c0> + 8011d10: ea4f 32dc mov.w r2, ip, lsr #15 + 8011d14: 3277 adds r2, #119 @ 0x77 + 8011d16: e7d8 b.n 8011cca <_malloc_r+0x272> + 8011d18: f240 5e54 movw lr, #1364 @ 0x554 + 8011d1c: 4572 cmp r2, lr + 8011d1e: bf9a itte ls + 8011d20: ea4f 429c movls.w r2, ip, lsr #18 + 8011d24: 327c addls r2, #124 @ 0x7c + 8011d26: 227e movhi r2, #126 @ 0x7e + 8011d28: e7cf b.n 8011cca <_malloc_r+0x272> + 8011d2a: f8de e008 ldr.w lr, [lr, #8] + 8011d2e: 45f0 cmp r8, lr + 8011d30: d005 beq.n 8011d3e <_malloc_r+0x2e6> + 8011d32: f8de 2004 ldr.w r2, [lr, #4] + 8011d36: f022 0203 bic.w r2, r2, #3 + 8011d3a: 4562 cmp r2, ip + 8011d3c: d8f5 bhi.n 8011d2a <_malloc_r+0x2d2> + 8011d3e: f8de 800c ldr.w r8, [lr, #12] + 8011d42: e7d1 b.n 8011ce8 <_malloc_r+0x290> + 8011d44: 2000016c .word 0x2000016c + 8011d48: 20000174 .word 0x20000174 + 8011d4c: 200193ac .word 0x200193ac + 8011d50: 20000164 .word 0x20000164 + 8011d54: 2001937c .word 0x2001937c + 8011d58: 200193a8 .word 0x200193a8 + 8011d5c: 200193a4 .word 0x200193a4 + 8011d60: 6860 ldr r0, [r4, #4] + 8011d62: f8d4 c00c ldr.w ip, [r4, #12] + 8011d66: f020 0003 bic.w r0, r0, #3 + 8011d6a: eba0 0a07 sub.w sl, r0, r7 + 8011d6e: f1ba 0f0f cmp.w sl, #15 + 8011d72: dd12 ble.n 8011d9a <_malloc_r+0x342> + 8011d74: 68a3 ldr r3, [r4, #8] + 8011d76: 19e2 adds r2, r4, r7 + 8011d78: f047 0701 orr.w r7, r7, #1 + 8011d7c: 6067 str r7, [r4, #4] + 8011d7e: f8c3 c00c str.w ip, [r3, #12] + 8011d82: f8cc 3008 str.w r3, [ip, #8] + 8011d86: f04a 0301 orr.w r3, sl, #1 + 8011d8a: e9c6 2204 strd r2, r2, [r6, #16] + 8011d8e: e9c2 1102 strd r1, r1, [r2, #8] + 8011d92: 6053 str r3, [r2, #4] + 8011d94: f844 a000 str.w sl, [r4, r0] + 8011d98: e68f b.n 8011aba <_malloc_r+0x62> + 8011d9a: f1ba 0f00 cmp.w sl, #0 + 8011d9e: db11 blt.n 8011dc4 <_malloc_r+0x36c> + 8011da0: 4420 add r0, r4 + 8011da2: 6843 ldr r3, [r0, #4] + 8011da4: f043 0301 orr.w r3, r3, #1 + 8011da8: 6043 str r3, [r0, #4] + 8011daa: f854 3f08 ldr.w r3, [r4, #8]! + 8011dae: 4628 mov r0, r5 + 8011db0: f8c3 c00c str.w ip, [r3, #12] + 8011db4: f8cc 3008 str.w r3, [ip, #8] + 8011db8: f000 f88e bl 8011ed8 <__malloc_unlock> + 8011dbc: 4620 mov r0, r4 + 8011dbe: b003 add sp, #12 + 8011dc0: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 8011dc4: 4664 mov r4, ip + 8011dc6: e70f b.n 8011be8 <_malloc_r+0x190> + 8011dc8: f858 0908 ldr.w r0, [r8], #-8 + 8011dcc: 4540 cmp r0, r8 + 8011dce: f103 33ff add.w r3, r3, #4294967295 + 8011dd2: f43f af13 beq.w 8011bfc <_malloc_r+0x1a4> + 8011dd6: e718 b.n 8011c0a <_malloc_r+0x1b2> + 8011dd8: 3304 adds r3, #4 + 8011dda: 0052 lsls r2, r2, #1 + 8011ddc: 4210 tst r0, r2 + 8011dde: d0fb beq.n 8011dd8 <_malloc_r+0x380> + 8011de0: e6fc b.n 8011bdc <_malloc_r+0x184> + 8011de2: 4673 mov r3, lr + 8011de4: e7fa b.n 8011ddc <_malloc_r+0x384> + 8011de6: 6810 ldr r0, [r2, #0] + 8011de8: 3001 adds r0, #1 + 8011dea: bf1b ittet ne + 8011dec: eba4 0b0b subne.w fp, r4, fp + 8011df0: eb0b 020e addne.w r2, fp, lr + 8011df4: 6014 streq r4, [r2, #0] + 8011df6: 601a strne r2, [r3, #0] + 8011df8: f014 0b07 ands.w fp, r4, #7 + 8011dfc: bf1a itte ne + 8011dfe: f1cb 0008 rsbne r0, fp, #8 + 8011e02: 1824 addne r4, r4, r0 + 8011e04: 4658 moveq r0, fp + 8011e06: 1862 adds r2, r4, r1 + 8011e08: ea02 010c and.w r1, r2, ip + 8011e0c: 4480 add r8, r0 + 8011e0e: eba8 0801 sub.w r8, r8, r1 + 8011e12: ea08 080c and.w r8, r8, ip + 8011e16: 4641 mov r1, r8 + 8011e18: 4628 mov r0, r5 + 8011e1a: 9201 str r2, [sp, #4] + 8011e1c: f002 faf8 bl 8014410 <_sbrk_r> + 8011e20: 1c43 adds r3, r0, #1 + 8011e22: 9a01 ldr r2, [sp, #4] + 8011e24: 4b28 ldr r3, [pc, #160] @ (8011ec8 <_malloc_r+0x470>) + 8011e26: d107 bne.n 8011e38 <_malloc_r+0x3e0> + 8011e28: f1bb 0f00 cmp.w fp, #0 + 8011e2c: d023 beq.n 8011e76 <_malloc_r+0x41e> + 8011e2e: f1ab 0008 sub.w r0, fp, #8 + 8011e32: 4410 add r0, r2 + 8011e34: f04f 0800 mov.w r8, #0 + 8011e38: 681a ldr r2, [r3, #0] + 8011e3a: 60b4 str r4, [r6, #8] + 8011e3c: 1b00 subs r0, r0, r4 + 8011e3e: 4440 add r0, r8 + 8011e40: 4442 add r2, r8 + 8011e42: f040 0001 orr.w r0, r0, #1 + 8011e46: 45b2 cmp sl, r6 + 8011e48: 601a str r2, [r3, #0] + 8011e4a: 6060 str r0, [r4, #4] + 8011e4c: f43f af29 beq.w 8011ca2 <_malloc_r+0x24a> + 8011e50: f1b9 0f0f cmp.w r9, #15 + 8011e54: d812 bhi.n 8011e7c <_malloc_r+0x424> + 8011e56: 2301 movs r3, #1 + 8011e58: 6063 str r3, [r4, #4] + 8011e5a: 68b3 ldr r3, [r6, #8] + 8011e5c: 685b ldr r3, [r3, #4] + 8011e5e: f023 0303 bic.w r3, r3, #3 + 8011e62: 42bb cmp r3, r7 + 8011e64: eba3 0207 sub.w r2, r3, r7 + 8011e68: d301 bcc.n 8011e6e <_malloc_r+0x416> + 8011e6a: 2a0f cmp r2, #15 + 8011e6c: dc22 bgt.n 8011eb4 <_malloc_r+0x45c> + 8011e6e: 4628 mov r0, r5 + 8011e70: f000 f832 bl 8011ed8 <__malloc_unlock> + 8011e74: e5fc b.n 8011a70 <_malloc_r+0x18> + 8011e76: 4610 mov r0, r2 + 8011e78: 46d8 mov r8, fp + 8011e7a: e7dd b.n 8011e38 <_malloc_r+0x3e0> + 8011e7c: f8da 2004 ldr.w r2, [sl, #4] + 8011e80: f1a9 090c sub.w r9, r9, #12 + 8011e84: f029 0907 bic.w r9, r9, #7 + 8011e88: f002 0201 and.w r2, r2, #1 + 8011e8c: ea42 0209 orr.w r2, r2, r9 + 8011e90: f8ca 2004 str.w r2, [sl, #4] + 8011e94: 2105 movs r1, #5 + 8011e96: eb0a 0209 add.w r2, sl, r9 + 8011e9a: f1b9 0f0f cmp.w r9, #15 + 8011e9e: e9c2 1101 strd r1, r1, [r2, #4] + 8011ea2: f67f aefe bls.w 8011ca2 <_malloc_r+0x24a> + 8011ea6: f10a 0108 add.w r1, sl, #8 + 8011eaa: 4628 mov r0, r5 + 8011eac: f7ff fd14 bl 80118d8 <_free_r> + 8011eb0: 4b05 ldr r3, [pc, #20] @ (8011ec8 <_malloc_r+0x470>) + 8011eb2: e6f6 b.n 8011ca2 <_malloc_r+0x24a> + 8011eb4: 68b4 ldr r4, [r6, #8] + 8011eb6: f047 0301 orr.w r3, r7, #1 + 8011eba: 4427 add r7, r4 + 8011ebc: f042 0201 orr.w r2, r2, #1 + 8011ec0: 6063 str r3, [r4, #4] + 8011ec2: 60b7 str r7, [r6, #8] + 8011ec4: 607a str r2, [r7, #4] + 8011ec6: e5f8 b.n 8011aba <_malloc_r+0x62> + 8011ec8: 2001937c .word 0x2001937c + +08011ecc <__malloc_lock>: + 8011ecc: 4801 ldr r0, [pc, #4] @ (8011ed4 <__malloc_lock+0x8>) + 8011ece: f7ff bc8d b.w 80117ec <__retarget_lock_acquire_recursive> + 8011ed2: bf00 nop + 8011ed4: 20019374 .word 0x20019374 + +08011ed8 <__malloc_unlock>: + 8011ed8: 4801 ldr r0, [pc, #4] @ (8011ee0 <__malloc_unlock+0x8>) + 8011eda: f7ff bc88 b.w 80117ee <__retarget_lock_release_recursive> + 8011ede: bf00 nop + 8011ee0: 20019374 .word 0x20019374 + 8011ee4: 00000000 .word 0x00000000 + +08011ee8 <_vfprintf_r>: + 8011ee8: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8011eec: b0d3 sub sp, #332 @ 0x14c + 8011eee: 468b mov fp, r1 + 8011ef0: 4690 mov r8, r2 + 8011ef2: 461c mov r4, r3 + 8011ef4: 461e mov r6, r3 + 8011ef6: 9003 str r0, [sp, #12] + 8011ef8: f002 fa86 bl 8014408 <_localeconv_r> + 8011efc: 6803 ldr r3, [r0, #0] + 8011efe: 9316 str r3, [sp, #88] @ 0x58 + 8011f00: 4618 mov r0, r3 + 8011f02: f7ee f975 bl 80001f0 + 8011f06: 9b03 ldr r3, [sp, #12] + 8011f08: 900d str r0, [sp, #52] @ 0x34 + 8011f0a: b123 cbz r3, 8011f16 <_vfprintf_r+0x2e> + 8011f0c: 6b5b ldr r3, [r3, #52] @ 0x34 + 8011f0e: b913 cbnz r3, 8011f16 <_vfprintf_r+0x2e> + 8011f10: 9803 ldr r0, [sp, #12] + 8011f12: f7ff fb3b bl 801158c <__sinit> + 8011f16: f8db 3064 ldr.w r3, [fp, #100] @ 0x64 + 8011f1a: 07da lsls r2, r3, #31 + 8011f1c: d407 bmi.n 8011f2e <_vfprintf_r+0x46> + 8011f1e: f8bb 300c ldrh.w r3, [fp, #12] + 8011f22: 059b lsls r3, r3, #22 + 8011f24: d403 bmi.n 8011f2e <_vfprintf_r+0x46> + 8011f26: f8db 0058 ldr.w r0, [fp, #88] @ 0x58 + 8011f2a: f7ff fc5f bl 80117ec <__retarget_lock_acquire_recursive> + 8011f2e: f9bb 300c ldrsh.w r3, [fp, #12] + 8011f32: 049f lsls r7, r3, #18 + 8011f34: d409 bmi.n 8011f4a <_vfprintf_r+0x62> + 8011f36: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 8011f3a: f8ab 300c strh.w r3, [fp, #12] + 8011f3e: f8db 3064 ldr.w r3, [fp, #100] @ 0x64 + 8011f42: f423 5300 bic.w r3, r3, #8192 @ 0x2000 + 8011f46: f8cb 3064 str.w r3, [fp, #100] @ 0x64 + 8011f4a: f8bb 300c ldrh.w r3, [fp, #12] + 8011f4e: 071d lsls r5, r3, #28 + 8011f50: d502 bpl.n 8011f58 <_vfprintf_r+0x70> + 8011f52: f8db 3010 ldr.w r3, [fp, #16] + 8011f56: b9c3 cbnz r3, 8011f8a <_vfprintf_r+0xa2> + 8011f58: 9803 ldr r0, [sp, #12] + 8011f5a: 4659 mov r1, fp + 8011f5c: f002 f97a bl 8014254 <__swsetup_r> + 8011f60: b198 cbz r0, 8011f8a <_vfprintf_r+0xa2> + 8011f62: f8db 3064 ldr.w r3, [fp, #100] @ 0x64 + 8011f66: 07d8 lsls r0, r3, #31 + 8011f68: d506 bpl.n 8011f78 <_vfprintf_r+0x90> + 8011f6a: f04f 33ff mov.w r3, #4294967295 + 8011f6e: 930f str r3, [sp, #60] @ 0x3c + 8011f70: 980f ldr r0, [sp, #60] @ 0x3c + 8011f72: b053 add sp, #332 @ 0x14c + 8011f74: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 8011f78: f8bb 300c ldrh.w r3, [fp, #12] + 8011f7c: 0599 lsls r1, r3, #22 + 8011f7e: d4f4 bmi.n 8011f6a <_vfprintf_r+0x82> + 8011f80: f8db 0058 ldr.w r0, [fp, #88] @ 0x58 + 8011f84: f7ff fc33 bl 80117ee <__retarget_lock_release_recursive> + 8011f88: e7ef b.n 8011f6a <_vfprintf_r+0x82> + 8011f8a: f9bb 300c ldrsh.w r3, [fp, #12] + 8011f8e: f003 021a and.w r2, r3, #26 + 8011f92: 2a0a cmp r2, #10 + 8011f94: d116 bne.n 8011fc4 <_vfprintf_r+0xdc> + 8011f96: f9bb 200e ldrsh.w r2, [fp, #14] + 8011f9a: 2a00 cmp r2, #0 + 8011f9c: db12 blt.n 8011fc4 <_vfprintf_r+0xdc> + 8011f9e: f8db 2064 ldr.w r2, [fp, #100] @ 0x64 + 8011fa2: 07d2 lsls r2, r2, #31 + 8011fa4: d405 bmi.n 8011fb2 <_vfprintf_r+0xca> + 8011fa6: 059b lsls r3, r3, #22 + 8011fa8: d403 bmi.n 8011fb2 <_vfprintf_r+0xca> + 8011faa: f8db 0058 ldr.w r0, [fp, #88] @ 0x58 + 8011fae: f7ff fc1e bl 80117ee <__retarget_lock_release_recursive> + 8011fb2: 9803 ldr r0, [sp, #12] + 8011fb4: 4623 mov r3, r4 + 8011fb6: 4642 mov r2, r8 + 8011fb8: 4659 mov r1, fp + 8011fba: b053 add sp, #332 @ 0x14c + 8011fbc: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8011fc0: f001 b9be b.w 8013340 <__sbprintf> + 8011fc4: ed9f 7b92 vldr d7, [pc, #584] @ 8012210 <_vfprintf_r+0x328> + 8011fc8: 2300 movs r3, #0 + 8011fca: e9cd 3327 strd r3, r3, [sp, #156] @ 0x9c + 8011fce: ed8d 7b0a vstr d7, [sp, #40] @ 0x28 + 8011fd2: e9cd 3318 strd r3, r3, [sp, #96] @ 0x60 + 8011fd6: ac29 add r4, sp, #164 @ 0xa4 + 8011fd8: 9426 str r4, [sp, #152] @ 0x98 + 8011fda: 9304 str r3, [sp, #16] + 8011fdc: 9309 str r3, [sp, #36] @ 0x24 + 8011fde: 9312 str r3, [sp, #72] @ 0x48 + 8011fe0: 9317 str r3, [sp, #92] @ 0x5c + 8011fe2: 930f str r3, [sp, #60] @ 0x3c + 8011fe4: 4643 mov r3, r8 + 8011fe6: 461d mov r5, r3 + 8011fe8: f813 2b01 ldrb.w r2, [r3], #1 + 8011fec: b10a cbz r2, 8011ff2 <_vfprintf_r+0x10a> + 8011fee: 2a25 cmp r2, #37 @ 0x25 + 8011ff0: d1f9 bne.n 8011fe6 <_vfprintf_r+0xfe> + 8011ff2: ebb5 0708 subs.w r7, r5, r8 + 8011ff6: d00d beq.n 8012014 <_vfprintf_r+0x12c> + 8011ff8: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8011ffa: 443b add r3, r7 + 8011ffc: 9328 str r3, [sp, #160] @ 0xa0 + 8011ffe: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012000: 3301 adds r3, #1 + 8012002: 2b07 cmp r3, #7 + 8012004: e9c4 8700 strd r8, r7, [r4] + 8012008: 9327 str r3, [sp, #156] @ 0x9c + 801200a: dc75 bgt.n 80120f8 <_vfprintf_r+0x210> + 801200c: 3408 adds r4, #8 + 801200e: 9b0f ldr r3, [sp, #60] @ 0x3c + 8012010: 443b add r3, r7 + 8012012: 930f str r3, [sp, #60] @ 0x3c + 8012014: 782b ldrb r3, [r5, #0] + 8012016: 2b00 cmp r3, #0 + 8012018: f001 814f beq.w 80132ba <_vfprintf_r+0x13d2> + 801201c: 2200 movs r2, #0 + 801201e: 1c6b adds r3, r5, #1 + 8012020: f88d 207b strb.w r2, [sp, #123] @ 0x7b + 8012024: f04f 39ff mov.w r9, #4294967295 + 8012028: 920e str r2, [sp, #56] @ 0x38 + 801202a: 4615 mov r5, r2 + 801202c: f813 2b01 ldrb.w r2, [r3], #1 + 8012030: 9206 str r2, [sp, #24] + 8012032: 930c str r3, [sp, #48] @ 0x30 + 8012034: 9b06 ldr r3, [sp, #24] + 8012036: 3b20 subs r3, #32 + 8012038: 2b5a cmp r3, #90 @ 0x5a + 801203a: f200 85aa bhi.w 8012b92 <_vfprintf_r+0xcaa> + 801203e: e8df f013 tbh [pc, r3, lsl #1] + 8012042: 009d .short 0x009d + 8012044: 05a805a8 .word 0x05a805a8 + 8012048: 05a800a5 .word 0x05a800a5 + 801204c: 05a805a8 .word 0x05a805a8 + 8012050: 05a80085 .word 0x05a80085 + 8012054: 00a805a8 .word 0x00a805a8 + 8012058: 05a800b2 .word 0x05a800b2 + 801205c: 00b400af .word 0x00b400af + 8012060: 00ce05a8 .word 0x00ce05a8 + 8012064: 00d100d1 .word 0x00d100d1 + 8012068: 00d100d1 .word 0x00d100d1 + 801206c: 00d100d1 .word 0x00d100d1 + 8012070: 00d100d1 .word 0x00d100d1 + 8012074: 05a800d1 .word 0x05a800d1 + 8012078: 05a805a8 .word 0x05a805a8 + 801207c: 05a805a8 .word 0x05a805a8 + 8012080: 05a805a8 .word 0x05a805a8 + 8012084: 05a80146 .word 0x05a80146 + 8012088: 011a0107 .word 0x011a0107 + 801208c: 01460146 .word 0x01460146 + 8012090: 05a80146 .word 0x05a80146 + 8012094: 05a805a8 .word 0x05a805a8 + 8012098: 00e205a8 .word 0x00e205a8 + 801209c: 05a805a8 .word 0x05a805a8 + 80120a0: 05a804a3 .word 0x05a804a3 + 80120a4: 05a805a8 .word 0x05a805a8 + 80120a8: 05a804ed .word 0x05a804ed + 80120ac: 05a8050e .word 0x05a8050e + 80120b0: 053005a8 .word 0x053005a8 + 80120b4: 05a805a8 .word 0x05a805a8 + 80120b8: 05a805a8 .word 0x05a805a8 + 80120bc: 05a805a8 .word 0x05a805a8 + 80120c0: 05a805a8 .word 0x05a805a8 + 80120c4: 05a80146 .word 0x05a80146 + 80120c8: 011c0107 .word 0x011c0107 + 80120cc: 01460146 .word 0x01460146 + 80120d0: 00ed0146 .word 0x00ed0146 + 80120d4: 0101011c .word 0x0101011c + 80120d8: 00fa05a8 .word 0x00fa05a8 + 80120dc: 048705a8 .word 0x048705a8 + 80120e0: 04dc04a5 .word 0x04dc04a5 + 80120e4: 05a80101 .word 0x05a80101 + 80120e8: 009b04ed .word 0x009b04ed + 80120ec: 05a80510 .word 0x05a80510 + 80120f0: 006505a8 .word 0x006505a8 + 80120f4: 009b05a8 .word 0x009b05a8 + 80120f8: 9803 ldr r0, [sp, #12] + 80120fa: aa26 add r2, sp, #152 @ 0x98 + 80120fc: 4659 mov r1, fp + 80120fe: f001 f95f bl 80133c0 <__sprint_r> + 8012102: 2800 cmp r0, #0 + 8012104: f040 814d bne.w 80123a2 <_vfprintf_r+0x4ba> + 8012108: ac29 add r4, sp, #164 @ 0xa4 + 801210a: e780 b.n 801200e <_vfprintf_r+0x126> + 801210c: 4b42 ldr r3, [pc, #264] @ (8012218 <_vfprintf_r+0x330>) + 801210e: 9319 str r3, [sp, #100] @ 0x64 + 8012110: f015 0320 ands.w r3, r5, #32 + 8012114: f000 84c8 beq.w 8012aa8 <_vfprintf_r+0xbc0> + 8012118: 3607 adds r6, #7 + 801211a: f026 0307 bic.w r3, r6, #7 + 801211e: 461a mov r2, r3 + 8012120: 685f ldr r7, [r3, #4] + 8012122: f852 6b08 ldr.w r6, [r2], #8 + 8012126: 9207 str r2, [sp, #28] + 8012128: 07eb lsls r3, r5, #31 + 801212a: d50a bpl.n 8012142 <_vfprintf_r+0x25a> + 801212c: ea56 0307 orrs.w r3, r6, r7 + 8012130: d007 beq.n 8012142 <_vfprintf_r+0x25a> + 8012132: 2330 movs r3, #48 @ 0x30 + 8012134: f88d 307c strb.w r3, [sp, #124] @ 0x7c + 8012138: 9b06 ldr r3, [sp, #24] + 801213a: f88d 307d strb.w r3, [sp, #125] @ 0x7d + 801213e: f045 0502 orr.w r5, r5, #2 + 8012142: f425 6580 bic.w r5, r5, #1024 @ 0x400 + 8012146: 2302 movs r3, #2 + 8012148: f000 bc2e b.w 80129a8 <_vfprintf_r+0xac0> + 801214c: 9803 ldr r0, [sp, #12] + 801214e: f002 f95b bl 8014408 <_localeconv_r> + 8012152: 6843 ldr r3, [r0, #4] + 8012154: 9317 str r3, [sp, #92] @ 0x5c + 8012156: 4618 mov r0, r3 + 8012158: f7ee f84a bl 80001f0 + 801215c: 9012 str r0, [sp, #72] @ 0x48 + 801215e: 9803 ldr r0, [sp, #12] + 8012160: f002 f952 bl 8014408 <_localeconv_r> + 8012164: 6883 ldr r3, [r0, #8] + 8012166: 9309 str r3, [sp, #36] @ 0x24 + 8012168: 9b12 ldr r3, [sp, #72] @ 0x48 + 801216a: b12b cbz r3, 8012178 <_vfprintf_r+0x290> + 801216c: 9b09 ldr r3, [sp, #36] @ 0x24 + 801216e: b11b cbz r3, 8012178 <_vfprintf_r+0x290> + 8012170: 781b ldrb r3, [r3, #0] + 8012172: b10b cbz r3, 8012178 <_vfprintf_r+0x290> + 8012174: f445 6580 orr.w r5, r5, #1024 @ 0x400 + 8012178: 9b0c ldr r3, [sp, #48] @ 0x30 + 801217a: e757 b.n 801202c <_vfprintf_r+0x144> + 801217c: f89d 307b ldrb.w r3, [sp, #123] @ 0x7b + 8012180: 2b00 cmp r3, #0 + 8012182: d1f9 bne.n 8012178 <_vfprintf_r+0x290> + 8012184: 2320 movs r3, #32 + 8012186: f88d 307b strb.w r3, [sp, #123] @ 0x7b + 801218a: e7f5 b.n 8012178 <_vfprintf_r+0x290> + 801218c: f045 0501 orr.w r5, r5, #1 + 8012190: e7f2 b.n 8012178 <_vfprintf_r+0x290> + 8012192: f856 3b04 ldr.w r3, [r6], #4 + 8012196: 930e str r3, [sp, #56] @ 0x38 + 8012198: 2b00 cmp r3, #0 + 801219a: daed bge.n 8012178 <_vfprintf_r+0x290> + 801219c: 425b negs r3, r3 + 801219e: 930e str r3, [sp, #56] @ 0x38 + 80121a0: f045 0504 orr.w r5, r5, #4 + 80121a4: e7e8 b.n 8012178 <_vfprintf_r+0x290> + 80121a6: 232b movs r3, #43 @ 0x2b + 80121a8: e7ed b.n 8012186 <_vfprintf_r+0x29e> + 80121aa: 9b0c ldr r3, [sp, #48] @ 0x30 + 80121ac: f813 2b01 ldrb.w r2, [r3], #1 + 80121b0: 9206 str r2, [sp, #24] + 80121b2: 2a2a cmp r2, #42 @ 0x2a + 80121b4: d10f bne.n 80121d6 <_vfprintf_r+0x2ee> + 80121b6: f856 2b04 ldr.w r2, [r6], #4 + 80121ba: 930c str r3, [sp, #48] @ 0x30 + 80121bc: ea42 79e2 orr.w r9, r2, r2, asr #31 + 80121c0: e7da b.n 8012178 <_vfprintf_r+0x290> + 80121c2: fb01 2909 mla r9, r1, r9, r2 + 80121c6: f813 2b01 ldrb.w r2, [r3], #1 + 80121ca: 9206 str r2, [sp, #24] + 80121cc: 9a06 ldr r2, [sp, #24] + 80121ce: 3a30 subs r2, #48 @ 0x30 + 80121d0: 2a09 cmp r2, #9 + 80121d2: d9f6 bls.n 80121c2 <_vfprintf_r+0x2da> + 80121d4: e72d b.n 8012032 <_vfprintf_r+0x14a> + 80121d6: f04f 0900 mov.w r9, #0 + 80121da: 210a movs r1, #10 + 80121dc: e7f6 b.n 80121cc <_vfprintf_r+0x2e4> + 80121de: f045 0580 orr.w r5, r5, #128 @ 0x80 + 80121e2: e7c9 b.n 8012178 <_vfprintf_r+0x290> + 80121e4: 2200 movs r2, #0 + 80121e6: 9b0c ldr r3, [sp, #48] @ 0x30 + 80121e8: 920e str r2, [sp, #56] @ 0x38 + 80121ea: 210a movs r1, #10 + 80121ec: 9a06 ldr r2, [sp, #24] + 80121ee: 980e ldr r0, [sp, #56] @ 0x38 + 80121f0: 3a30 subs r2, #48 @ 0x30 + 80121f2: fb01 2200 mla r2, r1, r0, r2 + 80121f6: 920e str r2, [sp, #56] @ 0x38 + 80121f8: f813 2b01 ldrb.w r2, [r3], #1 + 80121fc: 9206 str r2, [sp, #24] + 80121fe: 3a30 subs r2, #48 @ 0x30 + 8012200: 2a09 cmp r2, #9 + 8012202: d9f3 bls.n 80121ec <_vfprintf_r+0x304> + 8012204: e715 b.n 8012032 <_vfprintf_r+0x14a> + 8012206: f045 0508 orr.w r5, r5, #8 + 801220a: e7b5 b.n 8012178 <_vfprintf_r+0x290> + 801220c: f3af 8000 nop.w + ... + 8012218: 08018ffb .word 0x08018ffb + 801221c: 9b0c ldr r3, [sp, #48] @ 0x30 + 801221e: 781b ldrb r3, [r3, #0] + 8012220: 2b68 cmp r3, #104 @ 0x68 + 8012222: bf01 itttt eq + 8012224: 9b0c ldreq r3, [sp, #48] @ 0x30 + 8012226: 3301 addeq r3, #1 + 8012228: 930c streq r3, [sp, #48] @ 0x30 + 801222a: f445 7500 orreq.w r5, r5, #512 @ 0x200 + 801222e: bf18 it ne + 8012230: f045 0540 orrne.w r5, r5, #64 @ 0x40 + 8012234: e7a0 b.n 8012178 <_vfprintf_r+0x290> + 8012236: 9b0c ldr r3, [sp, #48] @ 0x30 + 8012238: 781b ldrb r3, [r3, #0] + 801223a: 2b6c cmp r3, #108 @ 0x6c + 801223c: d105 bne.n 801224a <_vfprintf_r+0x362> + 801223e: 9b0c ldr r3, [sp, #48] @ 0x30 + 8012240: 3301 adds r3, #1 + 8012242: 930c str r3, [sp, #48] @ 0x30 + 8012244: f045 0520 orr.w r5, r5, #32 + 8012248: e796 b.n 8012178 <_vfprintf_r+0x290> + 801224a: f045 0510 orr.w r5, r5, #16 + 801224e: e793 b.n 8012178 <_vfprintf_r+0x290> + 8012250: 4632 mov r2, r6 + 8012252: f852 3b04 ldr.w r3, [r2], #4 + 8012256: f88d 30e4 strb.w r3, [sp, #228] @ 0xe4 + 801225a: 2300 movs r3, #0 + 801225c: 9207 str r2, [sp, #28] + 801225e: f88d 307b strb.w r3, [sp, #123] @ 0x7b + 8012262: 469a mov sl, r3 + 8012264: f04f 0901 mov.w r9, #1 + 8012268: 9310 str r3, [sp, #64] @ 0x40 + 801226a: 461f mov r7, r3 + 801226c: 9308 str r3, [sp, #32] + 801226e: 461e mov r6, r3 + 8012270: f10d 08e4 add.w r8, sp, #228 @ 0xe4 + 8012274: e1da b.n 801262c <_vfprintf_r+0x744> + 8012276: f045 0510 orr.w r5, r5, #16 + 801227a: 06af lsls r7, r5, #26 + 801227c: d512 bpl.n 80122a4 <_vfprintf_r+0x3bc> + 801227e: 3607 adds r6, #7 + 8012280: f026 0307 bic.w r3, r6, #7 + 8012284: 461a mov r2, r3 + 8012286: 685f ldr r7, [r3, #4] + 8012288: f852 6b08 ldr.w r6, [r2], #8 + 801228c: 9207 str r2, [sp, #28] + 801228e: 2f00 cmp r7, #0 + 8012290: da06 bge.n 80122a0 <_vfprintf_r+0x3b8> + 8012292: 4276 negs r6, r6 + 8012294: f04f 032d mov.w r3, #45 @ 0x2d + 8012298: eb67 0747 sbc.w r7, r7, r7, lsl #1 + 801229c: f88d 307b strb.w r3, [sp, #123] @ 0x7b + 80122a0: 2301 movs r3, #1 + 80122a2: e384 b.n 80129ae <_vfprintf_r+0xac6> + 80122a4: 4633 mov r3, r6 + 80122a6: 06ee lsls r6, r5, #27 + 80122a8: f853 7b04 ldr.w r7, [r3], #4 + 80122ac: 9307 str r3, [sp, #28] + 80122ae: d502 bpl.n 80122b6 <_vfprintf_r+0x3ce> + 80122b0: 463e mov r6, r7 + 80122b2: 17ff asrs r7, r7, #31 + 80122b4: e7eb b.n 801228e <_vfprintf_r+0x3a6> + 80122b6: 0668 lsls r0, r5, #25 + 80122b8: d503 bpl.n 80122c2 <_vfprintf_r+0x3da> + 80122ba: b23e sxth r6, r7 + 80122bc: f347 37c0 sbfx r7, r7, #15, #1 + 80122c0: e7e5 b.n 801228e <_vfprintf_r+0x3a6> + 80122c2: 05a9 lsls r1, r5, #22 + 80122c4: d5f4 bpl.n 80122b0 <_vfprintf_r+0x3c8> + 80122c6: b27e sxtb r6, r7 + 80122c8: f347 17c0 sbfx r7, r7, #7, #1 + 80122cc: e7df b.n 801228e <_vfprintf_r+0x3a6> + 80122ce: 3607 adds r6, #7 + 80122d0: f026 0307 bic.w r3, r6, #7 + 80122d4: ecb3 7b02 vldmia r3!, {d7} + 80122d8: ed8d 7b0a vstr d7, [sp, #40] @ 0x28 + 80122dc: 9307 str r3, [sp, #28] + 80122de: 9b0a ldr r3, [sp, #40] @ 0x28 + 80122e0: 931a str r3, [sp, #104] @ 0x68 + 80122e2: 9b0b ldr r3, [sp, #44] @ 0x2c + 80122e4: f023 4300 bic.w r3, r3, #2147483648 @ 0x80000000 + 80122e8: 931b str r3, [sp, #108] @ 0x6c + 80122ea: e9dd 011a ldrd r0, r1, [sp, #104] @ 0x68 + 80122ee: 4b85 ldr r3, [pc, #532] @ (8012504 <_vfprintf_r+0x61c>) + 80122f0: f04f 32ff mov.w r2, #4294967295 + 80122f4: f7ee fc2a bl 8000b4c <__aeabi_dcmpun> + 80122f8: bb10 cbnz r0, 8012340 <_vfprintf_r+0x458> + 80122fa: e9dd 011a ldrd r0, r1, [sp, #104] @ 0x68 + 80122fe: 4b81 ldr r3, [pc, #516] @ (8012504 <_vfprintf_r+0x61c>) + 8012300: f04f 32ff mov.w r2, #4294967295 + 8012304: f7ee fc04 bl 8000b10 <__aeabi_dcmple> + 8012308: b9d0 cbnz r0, 8012340 <_vfprintf_r+0x458> + 801230a: e9dd 010a ldrd r0, r1, [sp, #40] @ 0x28 + 801230e: 2200 movs r2, #0 + 8012310: 2300 movs r3, #0 + 8012312: f7ee fbf3 bl 8000afc <__aeabi_dcmplt> + 8012316: b110 cbz r0, 801231e <_vfprintf_r+0x436> + 8012318: 232d movs r3, #45 @ 0x2d + 801231a: f88d 307b strb.w r3, [sp, #123] @ 0x7b + 801231e: 4a7a ldr r2, [pc, #488] @ (8012508 <_vfprintf_r+0x620>) + 8012320: 4b7a ldr r3, [pc, #488] @ (801250c <_vfprintf_r+0x624>) + 8012322: 9906 ldr r1, [sp, #24] + 8012324: f025 0580 bic.w r5, r5, #128 @ 0x80 + 8012328: 2947 cmp r1, #71 @ 0x47 + 801232a: bfd4 ite le + 801232c: 4690 movle r8, r2 + 801232e: 4698 movgt r8, r3 + 8012330: f04f 0a00 mov.w sl, #0 + 8012334: f04f 0903 mov.w r9, #3 + 8012338: f8cd a040 str.w sl, [sp, #64] @ 0x40 + 801233c: f000 bff8 b.w 8013330 <_vfprintf_r+0x1448> + 8012340: e9dd 230a ldrd r2, r3, [sp, #40] @ 0x28 + 8012344: 4610 mov r0, r2 + 8012346: 4619 mov r1, r3 + 8012348: f7ee fc00 bl 8000b4c <__aeabi_dcmpun> + 801234c: 4682 mov sl, r0 + 801234e: b140 cbz r0, 8012362 <_vfprintf_r+0x47a> + 8012350: 9b0b ldr r3, [sp, #44] @ 0x2c + 8012352: 4a6f ldr r2, [pc, #444] @ (8012510 <_vfprintf_r+0x628>) + 8012354: 2b00 cmp r3, #0 + 8012356: bfbc itt lt + 8012358: 232d movlt r3, #45 @ 0x2d + 801235a: f88d 307b strblt.w r3, [sp, #123] @ 0x7b + 801235e: 4b6d ldr r3, [pc, #436] @ (8012514 <_vfprintf_r+0x62c>) + 8012360: e7df b.n 8012322 <_vfprintf_r+0x43a> + 8012362: 9b06 ldr r3, [sp, #24] + 8012364: 2b61 cmp r3, #97 @ 0x61 + 8012366: d02e beq.n 80123c6 <_vfprintf_r+0x4de> + 8012368: 2b41 cmp r3, #65 @ 0x41 + 801236a: d12e bne.n 80123ca <_vfprintf_r+0x4e2> + 801236c: 2358 movs r3, #88 @ 0x58 + 801236e: 2230 movs r2, #48 @ 0x30 + 8012370: f1b9 0f63 cmp.w r9, #99 @ 0x63 + 8012374: f88d 207c strb.w r2, [sp, #124] @ 0x7c + 8012378: f88d 307d strb.w r3, [sp, #125] @ 0x7d + 801237c: f045 0502 orr.w r5, r5, #2 + 8012380: f340 80ae ble.w 80124e0 <_vfprintf_r+0x5f8> + 8012384: 9803 ldr r0, [sp, #12] + 8012386: f109 0101 add.w r1, r9, #1 + 801238a: f7ff fb65 bl 8011a58 <_malloc_r> + 801238e: 4680 mov r8, r0 + 8012390: 2800 cmp r0, #0 + 8012392: f040 80aa bne.w 80124ea <_vfprintf_r+0x602> + 8012396: f8bb 300c ldrh.w r3, [fp, #12] + 801239a: f043 0340 orr.w r3, r3, #64 @ 0x40 + 801239e: f8ab 300c strh.w r3, [fp, #12] + 80123a2: f8db 3064 ldr.w r3, [fp, #100] @ 0x64 + 80123a6: 07d9 lsls r1, r3, #31 + 80123a8: d407 bmi.n 80123ba <_vfprintf_r+0x4d2> + 80123aa: f8bb 300c ldrh.w r3, [fp, #12] + 80123ae: 059a lsls r2, r3, #22 + 80123b0: d403 bmi.n 80123ba <_vfprintf_r+0x4d2> + 80123b2: f8db 0058 ldr.w r0, [fp, #88] @ 0x58 + 80123b6: f7ff fa1a bl 80117ee <__retarget_lock_release_recursive> + 80123ba: f8bb 300c ldrh.w r3, [fp, #12] + 80123be: 065b lsls r3, r3, #25 + 80123c0: f57f add6 bpl.w 8011f70 <_vfprintf_r+0x88> + 80123c4: e5d1 b.n 8011f6a <_vfprintf_r+0x82> + 80123c6: 2378 movs r3, #120 @ 0x78 + 80123c8: e7d1 b.n 801236e <_vfprintf_r+0x486> + 80123ca: f1b9 3fff cmp.w r9, #4294967295 + 80123ce: f000 808e beq.w 80124ee <_vfprintf_r+0x606> + 80123d2: 9b06 ldr r3, [sp, #24] + 80123d4: f023 0320 bic.w r3, r3, #32 + 80123d8: 2b47 cmp r3, #71 @ 0x47 + 80123da: d105 bne.n 80123e8 <_vfprintf_r+0x500> + 80123dc: f1b9 0f00 cmp.w r9, #0 + 80123e0: d102 bne.n 80123e8 <_vfprintf_r+0x500> + 80123e2: 46ca mov sl, r9 + 80123e4: f04f 0901 mov.w r9, #1 + 80123e8: f445 7380 orr.w r3, r5, #256 @ 0x100 + 80123ec: 9311 str r3, [sp, #68] @ 0x44 + 80123ee: 9b0b ldr r3, [sp, #44] @ 0x2c + 80123f0: 2b00 cmp r3, #0 + 80123f2: da7f bge.n 80124f4 <_vfprintf_r+0x60c> + 80123f4: 9b0a ldr r3, [sp, #40] @ 0x28 + 80123f6: 9314 str r3, [sp, #80] @ 0x50 + 80123f8: 9b0b ldr r3, [sp, #44] @ 0x2c + 80123fa: f103 4300 add.w r3, r3, #2147483648 @ 0x80000000 + 80123fe: 9315 str r3, [sp, #84] @ 0x54 + 8012400: 232d movs r3, #45 @ 0x2d + 8012402: 931c str r3, [sp, #112] @ 0x70 + 8012404: 9b06 ldr r3, [sp, #24] + 8012406: f023 0320 bic.w r3, r3, #32 + 801240a: 2b41 cmp r3, #65 @ 0x41 + 801240c: 9308 str r3, [sp, #32] + 801240e: f040 81e7 bne.w 80127e0 <_vfprintf_r+0x8f8> + 8012412: a820 add r0, sp, #128 @ 0x80 + 8012414: ed9d 0b14 vldr d0, [sp, #80] @ 0x50 + 8012418: f002 f82a bl 8014470 + 801241c: 2200 movs r2, #0 + 801241e: f04f 537f mov.w r3, #1069547520 @ 0x3fc00000 + 8012422: ec51 0b10 vmov r0, r1, d0 + 8012426: f7ee f8f7 bl 8000618 <__aeabi_dmul> + 801242a: 4602 mov r2, r0 + 801242c: 460b mov r3, r1 + 801242e: e9cd 2304 strd r2, r3, [sp, #16] + 8012432: 2200 movs r2, #0 + 8012434: 2300 movs r3, #0 + 8012436: f7ee fb57 bl 8000ae8 <__aeabi_dcmpeq> + 801243a: b108 cbz r0, 8012440 <_vfprintf_r+0x558> + 801243c: 2301 movs r3, #1 + 801243e: 9320 str r3, [sp, #128] @ 0x80 + 8012440: 4a35 ldr r2, [pc, #212] @ (8012518 <_vfprintf_r+0x630>) + 8012442: 4b36 ldr r3, [pc, #216] @ (801251c <_vfprintf_r+0x634>) + 8012444: 9906 ldr r1, [sp, #24] + 8012446: 2961 cmp r1, #97 @ 0x61 + 8012448: bf18 it ne + 801244a: 461a movne r2, r3 + 801244c: 9210 str r2, [sp, #64] @ 0x40 + 801244e: f109 37ff add.w r7, r9, #4294967295 + 8012452: 4646 mov r6, r8 + 8012454: e9dd 0104 ldrd r0, r1, [sp, #16] + 8012458: 4b31 ldr r3, [pc, #196] @ (8012520 <_vfprintf_r+0x638>) + 801245a: 2200 movs r2, #0 + 801245c: f7ee f8dc bl 8000618 <__aeabi_dmul> + 8012460: 4602 mov r2, r0 + 8012462: 460b mov r3, r1 + 8012464: e9cd 2304 strd r2, r3, [sp, #16] + 8012468: f7ee fb86 bl 8000b78 <__aeabi_d2iz> + 801246c: 9013 str r0, [sp, #76] @ 0x4c + 801246e: f7ee f869 bl 8000544 <__aeabi_i2d> + 8012472: 4602 mov r2, r0 + 8012474: 460b mov r3, r1 + 8012476: e9dd 0104 ldrd r0, r1, [sp, #16] + 801247a: f7ed ff15 bl 80002a8 <__aeabi_dsub> + 801247e: 4602 mov r2, r0 + 8012480: 460b mov r3, r1 + 8012482: e9cd 2304 strd r2, r3, [sp, #16] + 8012486: 9a13 ldr r2, [sp, #76] @ 0x4c + 8012488: 9b10 ldr r3, [sp, #64] @ 0x40 + 801248a: 5c9b ldrb r3, [r3, r2] + 801248c: f806 3b01 strb.w r3, [r6], #1 + 8012490: 1c7a adds r2, r7, #1 + 8012492: d006 beq.n 80124a2 <_vfprintf_r+0x5ba> + 8012494: 1e7b subs r3, r7, #1 + 8012496: 931d str r3, [sp, #116] @ 0x74 + 8012498: 2200 movs r2, #0 + 801249a: 2300 movs r3, #0 + 801249c: f7ee fb24 bl 8000ae8 <__aeabi_dcmpeq> + 80124a0: b370 cbz r0, 8012500 <_vfprintf_r+0x618> + 80124a2: e9dd 0104 ldrd r0, r1, [sp, #16] + 80124a6: 4b1f ldr r3, [pc, #124] @ (8012524 <_vfprintf_r+0x63c>) + 80124a8: 2200 movs r2, #0 + 80124aa: f7ee fb45 bl 8000b38 <__aeabi_dcmpgt> + 80124ae: 2800 cmp r0, #0 + 80124b0: d13a bne.n 8012528 <_vfprintf_r+0x640> + 80124b2: e9dd 0104 ldrd r0, r1, [sp, #16] + 80124b6: 4b1b ldr r3, [pc, #108] @ (8012524 <_vfprintf_r+0x63c>) + 80124b8: 2200 movs r2, #0 + 80124ba: f7ee fb15 bl 8000ae8 <__aeabi_dcmpeq> + 80124be: b110 cbz r0, 80124c6 <_vfprintf_r+0x5de> + 80124c0: 9b13 ldr r3, [sp, #76] @ 0x4c + 80124c2: 07db lsls r3, r3, #31 + 80124c4: d430 bmi.n 8012528 <_vfprintf_r+0x640> + 80124c6: 4633 mov r3, r6 + 80124c8: 19f1 adds r1, r6, r7 + 80124ca: 2030 movs r0, #48 @ 0x30 + 80124cc: 1aca subs r2, r1, r3 + 80124ce: 2a00 cmp r2, #0 + 80124d0: f280 8183 bge.w 80127da <_vfprintf_r+0x8f2> + 80124d4: 1c7b adds r3, r7, #1 + 80124d6: 3701 adds r7, #1 + 80124d8: bfb8 it lt + 80124da: 2300 movlt r3, #0 + 80124dc: 441e add r6, r3 + 80124de: e037 b.n 8012550 <_vfprintf_r+0x668> + 80124e0: f04f 0a00 mov.w sl, #0 + 80124e4: f10d 08e4 add.w r8, sp, #228 @ 0xe4 + 80124e8: e77e b.n 80123e8 <_vfprintf_r+0x500> + 80124ea: 4682 mov sl, r0 + 80124ec: e77c b.n 80123e8 <_vfprintf_r+0x500> + 80124ee: f04f 0906 mov.w r9, #6 + 80124f2: e779 b.n 80123e8 <_vfprintf_r+0x500> + 80124f4: ed9d 7b0a vldr d7, [sp, #40] @ 0x28 + 80124f8: 2300 movs r3, #0 + 80124fa: ed8d 7b14 vstr d7, [sp, #80] @ 0x50 + 80124fe: e780 b.n 8012402 <_vfprintf_r+0x51a> + 8012500: 9f1d ldr r7, [sp, #116] @ 0x74 + 8012502: e7a7 b.n 8012454 <_vfprintf_r+0x56c> + 8012504: 7fefffff .word 0x7fefffff + 8012508: 08018feb .word 0x08018feb + 801250c: 08018fef .word 0x08018fef + 8012510: 08018ff3 .word 0x08018ff3 + 8012514: 08018ff7 .word 0x08018ff7 + 8012518: 08018ffb .word 0x08018ffb + 801251c: 0801900c .word 0x0801900c + 8012520: 40300000 .word 0x40300000 + 8012524: 3fe00000 .word 0x3fe00000 + 8012528: 9b10 ldr r3, [sp, #64] @ 0x40 + 801252a: 9624 str r6, [sp, #144] @ 0x90 + 801252c: 7bd9 ldrb r1, [r3, #15] + 801252e: 2030 movs r0, #48 @ 0x30 + 8012530: 9a24 ldr r2, [sp, #144] @ 0x90 + 8012532: 1e53 subs r3, r2, #1 + 8012534: 9324 str r3, [sp, #144] @ 0x90 + 8012536: f812 3c01 ldrb.w r3, [r2, #-1] + 801253a: 428b cmp r3, r1 + 801253c: f000 814a beq.w 80127d4 <_vfprintf_r+0x8ec> + 8012540: 2b39 cmp r3, #57 @ 0x39 + 8012542: bf0b itete eq + 8012544: 9b10 ldreq r3, [sp, #64] @ 0x40 + 8012546: 3301 addne r3, #1 + 8012548: 7a9b ldrbeq r3, [r3, #10] + 801254a: b2db uxtbne r3, r3 + 801254c: f802 3c01 strb.w r3, [r2, #-1] + 8012550: eba6 0308 sub.w r3, r6, r8 + 8012554: 9304 str r3, [sp, #16] + 8012556: 9b08 ldr r3, [sp, #32] + 8012558: 9e20 ldr r6, [sp, #128] @ 0x80 + 801255a: 2b47 cmp r3, #71 @ 0x47 + 801255c: f040 8189 bne.w 8012872 <_vfprintf_r+0x98a> + 8012560: 1cf1 adds r1, r6, #3 + 8012562: db02 blt.n 801256a <_vfprintf_r+0x682> + 8012564: 45b1 cmp r9, r6 + 8012566: f280 81a7 bge.w 80128b8 <_vfprintf_r+0x9d0> + 801256a: 9b06 ldr r3, [sp, #24] + 801256c: 3b02 subs r3, #2 + 801256e: 9306 str r3, [sp, #24] + 8012570: 9906 ldr r1, [sp, #24] + 8012572: f89d 2018 ldrb.w r2, [sp, #24] + 8012576: f021 0120 bic.w r1, r1, #32 + 801257a: 2941 cmp r1, #65 @ 0x41 + 801257c: bf08 it eq + 801257e: 320f addeq r2, #15 + 8012580: f106 33ff add.w r3, r6, #4294967295 + 8012584: bf06 itte eq + 8012586: b2d2 uxtbeq r2, r2 + 8012588: 2101 moveq r1, #1 + 801258a: 2100 movne r1, #0 + 801258c: 2b00 cmp r3, #0 + 801258e: 9320 str r3, [sp, #128] @ 0x80 + 8012590: bfb8 it lt + 8012592: f1c6 0301 rsblt r3, r6, #1 + 8012596: f88d 2088 strb.w r2, [sp, #136] @ 0x88 + 801259a: bfb4 ite lt + 801259c: 222d movlt r2, #45 @ 0x2d + 801259e: 222b movge r2, #43 @ 0x2b + 80125a0: 2b09 cmp r3, #9 + 80125a2: f88d 2089 strb.w r2, [sp, #137] @ 0x89 + 80125a6: f340 817a ble.w 801289e <_vfprintf_r+0x9b6> + 80125aa: f10d 0097 add.w r0, sp, #151 @ 0x97 + 80125ae: 270a movs r7, #10 + 80125b0: 4602 mov r2, r0 + 80125b2: fbb3 f6f7 udiv r6, r3, r7 + 80125b6: fb07 3116 mls r1, r7, r6, r3 + 80125ba: 3130 adds r1, #48 @ 0x30 + 80125bc: f802 1c01 strb.w r1, [r2, #-1] + 80125c0: 4619 mov r1, r3 + 80125c2: 2963 cmp r1, #99 @ 0x63 + 80125c4: f100 30ff add.w r0, r0, #4294967295 + 80125c8: 4633 mov r3, r6 + 80125ca: dcf1 bgt.n 80125b0 <_vfprintf_r+0x6c8> + 80125cc: 3330 adds r3, #48 @ 0x30 + 80125ce: 1e91 subs r1, r2, #2 + 80125d0: f800 3c01 strb.w r3, [r0, #-1] + 80125d4: f10d 0689 add.w r6, sp, #137 @ 0x89 + 80125d8: 460b mov r3, r1 + 80125da: f10d 0097 add.w r0, sp, #151 @ 0x97 + 80125de: 4283 cmp r3, r0 + 80125e0: f0c0 8158 bcc.w 8012894 <_vfprintf_r+0x9ac> + 80125e4: f10d 0399 add.w r3, sp, #153 @ 0x99 + 80125e8: 1a9b subs r3, r3, r2 + 80125ea: 4281 cmp r1, r0 + 80125ec: bf88 it hi + 80125ee: 2300 movhi r3, #0 + 80125f0: f10d 028a add.w r2, sp, #138 @ 0x8a + 80125f4: 441a add r2, r3 + 80125f6: ab22 add r3, sp, #136 @ 0x88 + 80125f8: 1ad3 subs r3, r2, r3 + 80125fa: 9a04 ldr r2, [sp, #16] + 80125fc: 9318 str r3, [sp, #96] @ 0x60 + 80125fe: 2a01 cmp r2, #1 + 8012600: eb03 0902 add.w r9, r3, r2 + 8012604: dc01 bgt.n 801260a <_vfprintf_r+0x722> + 8012606: 07ea lsls r2, r5, #31 + 8012608: d501 bpl.n 801260e <_vfprintf_r+0x726> + 801260a: 9b0d ldr r3, [sp, #52] @ 0x34 + 801260c: 4499 add r9, r3 + 801260e: f425 6580 bic.w r5, r5, #1024 @ 0x400 + 8012612: 2700 movs r7, #0 + 8012614: f445 7380 orr.w r3, r5, #256 @ 0x100 + 8012618: 9311 str r3, [sp, #68] @ 0x44 + 801261a: 9708 str r7, [sp, #32] + 801261c: 463e mov r6, r7 + 801261e: 9b1c ldr r3, [sp, #112] @ 0x70 + 8012620: 2b00 cmp r3, #0 + 8012622: f040 8191 bne.w 8012948 <_vfprintf_r+0xa60> + 8012626: 2300 movs r3, #0 + 8012628: 9d11 ldr r5, [sp, #68] @ 0x44 + 801262a: 9310 str r3, [sp, #64] @ 0x40 + 801262c: 9b10 ldr r3, [sp, #64] @ 0x40 + 801262e: 454b cmp r3, r9 + 8012630: bfb8 it lt + 8012632: 464b movlt r3, r9 + 8012634: 9311 str r3, [sp, #68] @ 0x44 + 8012636: f89d 307b ldrb.w r3, [sp, #123] @ 0x7b + 801263a: b113 cbz r3, 8012642 <_vfprintf_r+0x75a> + 801263c: 9b11 ldr r3, [sp, #68] @ 0x44 + 801263e: 3301 adds r3, #1 + 8012640: 9311 str r3, [sp, #68] @ 0x44 + 8012642: f015 0302 ands.w r3, r5, #2 + 8012646: 931c str r3, [sp, #112] @ 0x70 + 8012648: bf1e ittt ne + 801264a: 9b11 ldrne r3, [sp, #68] @ 0x44 + 801264c: 3302 addne r3, #2 + 801264e: 9311 strne r3, [sp, #68] @ 0x44 + 8012650: f015 0384 ands.w r3, r5, #132 @ 0x84 + 8012654: 931d str r3, [sp, #116] @ 0x74 + 8012656: d122 bne.n 801269e <_vfprintf_r+0x7b6> + 8012658: 9b0e ldr r3, [sp, #56] @ 0x38 + 801265a: 9a11 ldr r2, [sp, #68] @ 0x44 + 801265c: 1a9b subs r3, r3, r2 + 801265e: 2b00 cmp r3, #0 + 8012660: 9313 str r3, [sp, #76] @ 0x4c + 8012662: dd1c ble.n 801269e <_vfprintf_r+0x7b6> + 8012664: 9813 ldr r0, [sp, #76] @ 0x4c + 8012666: e9dd 2327 ldrd r2, r3, [sp, #156] @ 0x9c + 801266a: 2810 cmp r0, #16 + 801266c: 489f ldr r0, [pc, #636] @ (80128ec <_vfprintf_r+0xa04>) + 801266e: 6020 str r0, [r4, #0] + 8012670: f102 0201 add.w r2, r2, #1 + 8012674: f104 0108 add.w r1, r4, #8 + 8012678: f300 8297 bgt.w 8012baa <_vfprintf_r+0xcc2> + 801267c: 9813 ldr r0, [sp, #76] @ 0x4c + 801267e: 6060 str r0, [r4, #4] + 8012680: 4403 add r3, r0 + 8012682: 2a07 cmp r2, #7 + 8012684: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012688: f340 82a4 ble.w 8012bd4 <_vfprintf_r+0xcec> + 801268c: 9803 ldr r0, [sp, #12] + 801268e: aa26 add r2, sp, #152 @ 0x98 + 8012690: 4659 mov r1, fp + 8012692: f000 fe95 bl 80133c0 <__sprint_r> + 8012696: 2800 cmp r0, #0 + 8012698: f040 85ed bne.w 8013276 <_vfprintf_r+0x138e> + 801269c: ac29 add r4, sp, #164 @ 0xa4 + 801269e: f89d 207b ldrb.w r2, [sp, #123] @ 0x7b + 80126a2: 9b28 ldr r3, [sp, #160] @ 0xa0 + 80126a4: b16a cbz r2, 80126c2 <_vfprintf_r+0x7da> + 80126a6: f10d 027b add.w r2, sp, #123 @ 0x7b + 80126aa: 6022 str r2, [r4, #0] + 80126ac: 2201 movs r2, #1 + 80126ae: 4413 add r3, r2 + 80126b0: 9328 str r3, [sp, #160] @ 0xa0 + 80126b2: 9b27 ldr r3, [sp, #156] @ 0x9c + 80126b4: 6062 str r2, [r4, #4] + 80126b6: 4413 add r3, r2 + 80126b8: 2b07 cmp r3, #7 + 80126ba: 9327 str r3, [sp, #156] @ 0x9c + 80126bc: f300 828c bgt.w 8012bd8 <_vfprintf_r+0xcf0> + 80126c0: 3408 adds r4, #8 + 80126c2: 9a1c ldr r2, [sp, #112] @ 0x70 + 80126c4: 9b28 ldr r3, [sp, #160] @ 0xa0 + 80126c6: b162 cbz r2, 80126e2 <_vfprintf_r+0x7fa> + 80126c8: aa1f add r2, sp, #124 @ 0x7c + 80126ca: 6022 str r2, [r4, #0] + 80126cc: 2202 movs r2, #2 + 80126ce: 4413 add r3, r2 + 80126d0: 9328 str r3, [sp, #160] @ 0xa0 + 80126d2: 9b27 ldr r3, [sp, #156] @ 0x9c + 80126d4: 6062 str r2, [r4, #4] + 80126d6: 3301 adds r3, #1 + 80126d8: 2b07 cmp r3, #7 + 80126da: 9327 str r3, [sp, #156] @ 0x9c + 80126dc: f300 8286 bgt.w 8012bec <_vfprintf_r+0xd04> + 80126e0: 3408 adds r4, #8 + 80126e2: 9b1d ldr r3, [sp, #116] @ 0x74 + 80126e4: 2b80 cmp r3, #128 @ 0x80 + 80126e6: d122 bne.n 801272e <_vfprintf_r+0x846> + 80126e8: 9b0e ldr r3, [sp, #56] @ 0x38 + 80126ea: 9a11 ldr r2, [sp, #68] @ 0x44 + 80126ec: 1a9b subs r3, r3, r2 + 80126ee: 2b00 cmp r3, #0 + 80126f0: 9313 str r3, [sp, #76] @ 0x4c + 80126f2: dd1c ble.n 801272e <_vfprintf_r+0x846> + 80126f4: 9813 ldr r0, [sp, #76] @ 0x4c + 80126f6: e9dd 2327 ldrd r2, r3, [sp, #156] @ 0x9c + 80126fa: 2810 cmp r0, #16 + 80126fc: 487c ldr r0, [pc, #496] @ (80128f0 <_vfprintf_r+0xa08>) + 80126fe: 6020 str r0, [r4, #0] + 8012700: f102 0201 add.w r2, r2, #1 + 8012704: f104 0108 add.w r1, r4, #8 + 8012708: f300 827a bgt.w 8012c00 <_vfprintf_r+0xd18> + 801270c: 9813 ldr r0, [sp, #76] @ 0x4c + 801270e: 6060 str r0, [r4, #4] + 8012710: 4403 add r3, r0 + 8012712: 2a07 cmp r2, #7 + 8012714: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012718: f340 8287 ble.w 8012c2a <_vfprintf_r+0xd42> + 801271c: 9803 ldr r0, [sp, #12] + 801271e: aa26 add r2, sp, #152 @ 0x98 + 8012720: 4659 mov r1, fp + 8012722: f000 fe4d bl 80133c0 <__sprint_r> + 8012726: 2800 cmp r0, #0 + 8012728: f040 85a5 bne.w 8013276 <_vfprintf_r+0x138e> + 801272c: ac29 add r4, sp, #164 @ 0xa4 + 801272e: 9b10 ldr r3, [sp, #64] @ 0x40 + 8012730: eba3 0309 sub.w r3, r3, r9 + 8012734: 2b00 cmp r3, #0 + 8012736: 9310 str r3, [sp, #64] @ 0x40 + 8012738: dd1c ble.n 8012774 <_vfprintf_r+0x88c> + 801273a: 9810 ldr r0, [sp, #64] @ 0x40 + 801273c: e9dd 2327 ldrd r2, r3, [sp, #156] @ 0x9c + 8012740: 2810 cmp r0, #16 + 8012742: 486b ldr r0, [pc, #428] @ (80128f0 <_vfprintf_r+0xa08>) + 8012744: 6020 str r0, [r4, #0] + 8012746: f102 0201 add.w r2, r2, #1 + 801274a: f104 0108 add.w r1, r4, #8 + 801274e: f300 826e bgt.w 8012c2e <_vfprintf_r+0xd46> + 8012752: 9810 ldr r0, [sp, #64] @ 0x40 + 8012754: 6060 str r0, [r4, #4] + 8012756: 4403 add r3, r0 + 8012758: 2a07 cmp r2, #7 + 801275a: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 801275e: f340 827b ble.w 8012c58 <_vfprintf_r+0xd70> + 8012762: 9803 ldr r0, [sp, #12] + 8012764: aa26 add r2, sp, #152 @ 0x98 + 8012766: 4659 mov r1, fp + 8012768: f000 fe2a bl 80133c0 <__sprint_r> + 801276c: 2800 cmp r0, #0 + 801276e: f040 8582 bne.w 8013276 <_vfprintf_r+0x138e> + 8012772: ac29 add r4, sp, #164 @ 0xa4 + 8012774: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8012776: 9310 str r3, [sp, #64] @ 0x40 + 8012778: 05e8 lsls r0, r5, #23 + 801277a: f100 8273 bmi.w 8012c64 <_vfprintf_r+0xd7c> + 801277e: 444b add r3, r9 + 8012780: 9328 str r3, [sp, #160] @ 0xa0 + 8012782: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012784: 3301 adds r3, #1 + 8012786: 2b07 cmp r3, #7 + 8012788: e9c4 8900 strd r8, r9, [r4] + 801278c: 9327 str r3, [sp, #156] @ 0x9c + 801278e: f300 82af bgt.w 8012cf0 <_vfprintf_r+0xe08> + 8012792: 3408 adds r4, #8 + 8012794: 0768 lsls r0, r5, #29 + 8012796: f100 8550 bmi.w 801323a <_vfprintf_r+0x1352> + 801279a: e9dd 230e ldrd r2, r3, [sp, #56] @ 0x38 + 801279e: 9911 ldr r1, [sp, #68] @ 0x44 + 80127a0: 428a cmp r2, r1 + 80127a2: bfac ite ge + 80127a4: 189b addge r3, r3, r2 + 80127a6: 185b addlt r3, r3, r1 + 80127a8: 930f str r3, [sp, #60] @ 0x3c + 80127aa: 9b28 ldr r3, [sp, #160] @ 0xa0 + 80127ac: b13b cbz r3, 80127be <_vfprintf_r+0x8d6> + 80127ae: 9803 ldr r0, [sp, #12] + 80127b0: aa26 add r2, sp, #152 @ 0x98 + 80127b2: 4659 mov r1, fp + 80127b4: f000 fe04 bl 80133c0 <__sprint_r> + 80127b8: 2800 cmp r0, #0 + 80127ba: f040 855c bne.w 8013276 <_vfprintf_r+0x138e> + 80127be: 2300 movs r3, #0 + 80127c0: 9327 str r3, [sp, #156] @ 0x9c + 80127c2: f1ba 0f00 cmp.w sl, #0 + 80127c6: f040 8572 bne.w 80132ae <_vfprintf_r+0x13c6> + 80127ca: 9e07 ldr r6, [sp, #28] + 80127cc: ac29 add r4, sp, #164 @ 0xa4 + 80127ce: f8dd 8030 ldr.w r8, [sp, #48] @ 0x30 + 80127d2: e407 b.n 8011fe4 <_vfprintf_r+0xfc> + 80127d4: f802 0c01 strb.w r0, [r2, #-1] + 80127d8: e6aa b.n 8012530 <_vfprintf_r+0x648> + 80127da: f803 0b01 strb.w r0, [r3], #1 + 80127de: e675 b.n 80124cc <_vfprintf_r+0x5e4> + 80127e0: 9b08 ldr r3, [sp, #32] + 80127e2: 2b46 cmp r3, #70 @ 0x46 + 80127e4: d005 beq.n 80127f2 <_vfprintf_r+0x90a> + 80127e6: 2b45 cmp r3, #69 @ 0x45 + 80127e8: d11a bne.n 8012820 <_vfprintf_r+0x938> + 80127ea: f109 0601 add.w r6, r9, #1 + 80127ee: 2102 movs r1, #2 + 80127f0: e001 b.n 80127f6 <_vfprintf_r+0x90e> + 80127f2: 464e mov r6, r9 + 80127f4: 2103 movs r1, #3 + 80127f6: ab24 add r3, sp, #144 @ 0x90 + 80127f8: 9301 str r3, [sp, #4] + 80127fa: ab21 add r3, sp, #132 @ 0x84 + 80127fc: 9300 str r3, [sp, #0] + 80127fe: ed9d 0b14 vldr d0, [sp, #80] @ 0x50 + 8012802: ab20 add r3, sp, #128 @ 0x80 + 8012804: 9803 ldr r0, [sp, #12] + 8012806: 4632 mov r2, r6 + 8012808: f001 ff32 bl 8014670 <_dtoa_r> + 801280c: 9b08 ldr r3, [sp, #32] + 801280e: 2b47 cmp r3, #71 @ 0x47 + 8012810: 4680 mov r8, r0 + 8012812: d119 bne.n 8012848 <_vfprintf_r+0x960> + 8012814: 07e8 lsls r0, r5, #31 + 8012816: d405 bmi.n 8012824 <_vfprintf_r+0x93c> + 8012818: 9b24 ldr r3, [sp, #144] @ 0x90 + 801281a: eba3 0308 sub.w r3, r3, r8 + 801281e: e699 b.n 8012554 <_vfprintf_r+0x66c> + 8012820: 464e mov r6, r9 + 8012822: e7e4 b.n 80127ee <_vfprintf_r+0x906> + 8012824: eb08 0706 add.w r7, r8, r6 + 8012828: e9dd 0114 ldrd r0, r1, [sp, #80] @ 0x50 + 801282c: 2200 movs r2, #0 + 801282e: 2300 movs r3, #0 + 8012830: f7ee f95a bl 8000ae8 <__aeabi_dcmpeq> + 8012834: b100 cbz r0, 8012838 <_vfprintf_r+0x950> + 8012836: 9724 str r7, [sp, #144] @ 0x90 + 8012838: 2230 movs r2, #48 @ 0x30 + 801283a: 9b24 ldr r3, [sp, #144] @ 0x90 + 801283c: 429f cmp r7, r3 + 801283e: d9eb bls.n 8012818 <_vfprintf_r+0x930> + 8012840: 1c59 adds r1, r3, #1 + 8012842: 9124 str r1, [sp, #144] @ 0x90 + 8012844: 701a strb r2, [r3, #0] + 8012846: e7f8 b.n 801283a <_vfprintf_r+0x952> + 8012848: 9b08 ldr r3, [sp, #32] + 801284a: 2b46 cmp r3, #70 @ 0x46 + 801284c: eb00 0706 add.w r7, r0, r6 + 8012850: d1ea bne.n 8012828 <_vfprintf_r+0x940> + 8012852: 7803 ldrb r3, [r0, #0] + 8012854: 2b30 cmp r3, #48 @ 0x30 + 8012856: d109 bne.n 801286c <_vfprintf_r+0x984> + 8012858: e9dd 0114 ldrd r0, r1, [sp, #80] @ 0x50 + 801285c: 2200 movs r2, #0 + 801285e: 2300 movs r3, #0 + 8012860: f7ee f942 bl 8000ae8 <__aeabi_dcmpeq> + 8012864: b910 cbnz r0, 801286c <_vfprintf_r+0x984> + 8012866: f1c6 0601 rsb r6, r6, #1 + 801286a: 9620 str r6, [sp, #128] @ 0x80 + 801286c: 9b20 ldr r3, [sp, #128] @ 0x80 + 801286e: 441f add r7, r3 + 8012870: e7da b.n 8012828 <_vfprintf_r+0x940> + 8012872: 9b08 ldr r3, [sp, #32] + 8012874: 2b46 cmp r3, #70 @ 0x46 + 8012876: f47f ae7b bne.w 8012570 <_vfprintf_r+0x688> + 801287a: f005 0301 and.w r3, r5, #1 + 801287e: 2e00 cmp r6, #0 + 8012880: ea43 0309 orr.w r3, r3, r9 + 8012884: dd25 ble.n 80128d2 <_vfprintf_r+0x9ea> + 8012886: b37b cbz r3, 80128e8 <_vfprintf_r+0xa00> + 8012888: 9b0d ldr r3, [sp, #52] @ 0x34 + 801288a: 18f3 adds r3, r6, r3 + 801288c: 4499 add r9, r3 + 801288e: 2366 movs r3, #102 @ 0x66 + 8012890: 9306 str r3, [sp, #24] + 8012892: e033 b.n 80128fc <_vfprintf_r+0xa14> + 8012894: f813 7b01 ldrb.w r7, [r3], #1 + 8012898: f806 7f01 strb.w r7, [r6, #1]! + 801289c: e69f b.n 80125de <_vfprintf_r+0x6f6> + 801289e: b941 cbnz r1, 80128b2 <_vfprintf_r+0x9ca> + 80128a0: 2230 movs r2, #48 @ 0x30 + 80128a2: f88d 208a strb.w r2, [sp, #138] @ 0x8a + 80128a6: f10d 028b add.w r2, sp, #139 @ 0x8b + 80128aa: 3330 adds r3, #48 @ 0x30 + 80128ac: f802 3b01 strb.w r3, [r2], #1 + 80128b0: e6a1 b.n 80125f6 <_vfprintf_r+0x70e> + 80128b2: f10d 028a add.w r2, sp, #138 @ 0x8a + 80128b6: e7f8 b.n 80128aa <_vfprintf_r+0x9c2> + 80128b8: 9b04 ldr r3, [sp, #16] + 80128ba: 42b3 cmp r3, r6 + 80128bc: dd0d ble.n 80128da <_vfprintf_r+0x9f2> + 80128be: 9b04 ldr r3, [sp, #16] + 80128c0: 9a0d ldr r2, [sp, #52] @ 0x34 + 80128c2: 2e00 cmp r6, #0 + 80128c4: eb03 0902 add.w r9, r3, r2 + 80128c8: dc0c bgt.n 80128e4 <_vfprintf_r+0x9fc> + 80128ca: f1c6 0301 rsb r3, r6, #1 + 80128ce: 4499 add r9, r3 + 80128d0: e008 b.n 80128e4 <_vfprintf_r+0x9fc> + 80128d2: b17b cbz r3, 80128f4 <_vfprintf_r+0xa0c> + 80128d4: 9b0d ldr r3, [sp, #52] @ 0x34 + 80128d6: 3301 adds r3, #1 + 80128d8: e7d8 b.n 801288c <_vfprintf_r+0x9a4> + 80128da: 07eb lsls r3, r5, #31 + 80128dc: d521 bpl.n 8012922 <_vfprintf_r+0xa3a> + 80128de: 9b0d ldr r3, [sp, #52] @ 0x34 + 80128e0: eb06 0903 add.w r9, r6, r3 + 80128e4: 2367 movs r3, #103 @ 0x67 + 80128e6: e7d3 b.n 8012890 <_vfprintf_r+0x9a8> + 80128e8: 46b1 mov r9, r6 + 80128ea: e7d0 b.n 801288e <_vfprintf_r+0x9a6> + 80128ec: 0801902f .word 0x0801902f + 80128f0: 0801901f .word 0x0801901f + 80128f4: 2366 movs r3, #102 @ 0x66 + 80128f6: 9306 str r3, [sp, #24] + 80128f8: f04f 0901 mov.w r9, #1 + 80128fc: f415 6380 ands.w r3, r5, #1024 @ 0x400 + 8012900: 9308 str r3, [sp, #32] + 8012902: d01f beq.n 8012944 <_vfprintf_r+0xa5c> + 8012904: 2700 movs r7, #0 + 8012906: 2e00 cmp r6, #0 + 8012908: 9708 str r7, [sp, #32] + 801290a: f77f ae88 ble.w 801261e <_vfprintf_r+0x736> + 801290e: 9b09 ldr r3, [sp, #36] @ 0x24 + 8012910: 781b ldrb r3, [r3, #0] + 8012912: 2bff cmp r3, #255 @ 0xff + 8012914: d107 bne.n 8012926 <_vfprintf_r+0xa3e> + 8012916: 9b08 ldr r3, [sp, #32] + 8012918: 9a12 ldr r2, [sp, #72] @ 0x48 + 801291a: 443b add r3, r7 + 801291c: fb02 9903 mla r9, r2, r3, r9 + 8012920: e67d b.n 801261e <_vfprintf_r+0x736> + 8012922: 46b1 mov r9, r6 + 8012924: e7de b.n 80128e4 <_vfprintf_r+0x9fc> + 8012926: 42b3 cmp r3, r6 + 8012928: daf5 bge.n 8012916 <_vfprintf_r+0xa2e> + 801292a: 1af6 subs r6, r6, r3 + 801292c: 9b09 ldr r3, [sp, #36] @ 0x24 + 801292e: 785b ldrb r3, [r3, #1] + 8012930: b133 cbz r3, 8012940 <_vfprintf_r+0xa58> + 8012932: 9b08 ldr r3, [sp, #32] + 8012934: 3301 adds r3, #1 + 8012936: 9308 str r3, [sp, #32] + 8012938: 9b09 ldr r3, [sp, #36] @ 0x24 + 801293a: 3301 adds r3, #1 + 801293c: 9309 str r3, [sp, #36] @ 0x24 + 801293e: e7e6 b.n 801290e <_vfprintf_r+0xa26> + 8012940: 3701 adds r7, #1 + 8012942: e7e4 b.n 801290e <_vfprintf_r+0xa26> + 8012944: 9f08 ldr r7, [sp, #32] + 8012946: e66a b.n 801261e <_vfprintf_r+0x736> + 8012948: 232d movs r3, #45 @ 0x2d + 801294a: f88d 307b strb.w r3, [sp, #123] @ 0x7b + 801294e: e66a b.n 8012626 <_vfprintf_r+0x73e> + 8012950: 06af lsls r7, r5, #26 + 8012952: d507 bpl.n 8012964 <_vfprintf_r+0xa7c> + 8012954: 9a0f ldr r2, [sp, #60] @ 0x3c + 8012956: 6833 ldr r3, [r6, #0] + 8012958: 990f ldr r1, [sp, #60] @ 0x3c + 801295a: 17d2 asrs r2, r2, #31 + 801295c: e9c3 1200 strd r1, r2, [r3] + 8012960: 3604 adds r6, #4 + 8012962: e734 b.n 80127ce <_vfprintf_r+0x8e6> + 8012964: 06e8 lsls r0, r5, #27 + 8012966: d503 bpl.n 8012970 <_vfprintf_r+0xa88> + 8012968: 6833 ldr r3, [r6, #0] + 801296a: 9a0f ldr r2, [sp, #60] @ 0x3c + 801296c: 601a str r2, [r3, #0] + 801296e: e7f7 b.n 8012960 <_vfprintf_r+0xa78> + 8012970: 0669 lsls r1, r5, #25 + 8012972: d503 bpl.n 801297c <_vfprintf_r+0xa94> + 8012974: 6833 ldr r3, [r6, #0] + 8012976: 9a0f ldr r2, [sp, #60] @ 0x3c + 8012978: 801a strh r2, [r3, #0] + 801297a: e7f1 b.n 8012960 <_vfprintf_r+0xa78> + 801297c: 05aa lsls r2, r5, #22 + 801297e: d5f3 bpl.n 8012968 <_vfprintf_r+0xa80> + 8012980: 6833 ldr r3, [r6, #0] + 8012982: 9a0f ldr r2, [sp, #60] @ 0x3c + 8012984: 701a strb r2, [r3, #0] + 8012986: e7eb b.n 8012960 <_vfprintf_r+0xa78> + 8012988: f045 0510 orr.w r5, r5, #16 + 801298c: f015 0320 ands.w r3, r5, #32 + 8012990: d020 beq.n 80129d4 <_vfprintf_r+0xaec> + 8012992: 3607 adds r6, #7 + 8012994: f026 0307 bic.w r3, r6, #7 + 8012998: 461a mov r2, r3 + 801299a: 685f ldr r7, [r3, #4] + 801299c: f852 6b08 ldr.w r6, [r2], #8 + 80129a0: 9207 str r2, [sp, #28] + 80129a2: f425 6580 bic.w r5, r5, #1024 @ 0x400 + 80129a6: 2300 movs r3, #0 + 80129a8: 2200 movs r2, #0 + 80129aa: f88d 207b strb.w r2, [sp, #123] @ 0x7b + 80129ae: f1b9 3fff cmp.w r9, #4294967295 + 80129b2: f000 8491 beq.w 80132d8 <_vfprintf_r+0x13f0> + 80129b6: f025 0280 bic.w r2, r5, #128 @ 0x80 + 80129ba: 9208 str r2, [sp, #32] + 80129bc: ea56 0207 orrs.w r2, r6, r7 + 80129c0: f040 848f bne.w 80132e2 <_vfprintf_r+0x13fa> + 80129c4: f1b9 0f00 cmp.w r9, #0 + 80129c8: f000 80db beq.w 8012b82 <_vfprintf_r+0xc9a> + 80129cc: 2b01 cmp r3, #1 + 80129ce: f040 848b bne.w 80132e8 <_vfprintf_r+0x1400> + 80129d2: e083 b.n 8012adc <_vfprintf_r+0xbf4> + 80129d4: 4632 mov r2, r6 + 80129d6: f015 0710 ands.w r7, r5, #16 + 80129da: f852 6b04 ldr.w r6, [r2], #4 + 80129de: 9207 str r2, [sp, #28] + 80129e0: d001 beq.n 80129e6 <_vfprintf_r+0xafe> + 80129e2: 461f mov r7, r3 + 80129e4: e7dd b.n 80129a2 <_vfprintf_r+0xaba> + 80129e6: f015 0340 ands.w r3, r5, #64 @ 0x40 + 80129ea: d001 beq.n 80129f0 <_vfprintf_r+0xb08> + 80129ec: b2b6 uxth r6, r6 + 80129ee: e7d8 b.n 80129a2 <_vfprintf_r+0xaba> + 80129f0: f415 7700 ands.w r7, r5, #512 @ 0x200 + 80129f4: d0d5 beq.n 80129a2 <_vfprintf_r+0xaba> + 80129f6: b2f6 uxtb r6, r6 + 80129f8: e7f3 b.n 80129e2 <_vfprintf_r+0xafa> + 80129fa: 4633 mov r3, r6 + 80129fc: 2278 movs r2, #120 @ 0x78 + 80129fe: f853 6b04 ldr.w r6, [r3], #4 + 8012a02: 9307 str r3, [sp, #28] + 8012a04: f647 0330 movw r3, #30768 @ 0x7830 + 8012a08: f8ad 307c strh.w r3, [sp, #124] @ 0x7c + 8012a0c: 4b93 ldr r3, [pc, #588] @ (8012c5c <_vfprintf_r+0xd74>) + 8012a0e: 9319 str r3, [sp, #100] @ 0x64 + 8012a10: 2700 movs r7, #0 + 8012a12: f045 0502 orr.w r5, r5, #2 + 8012a16: 2302 movs r3, #2 + 8012a18: 9206 str r2, [sp, #24] + 8012a1a: e7c5 b.n 80129a8 <_vfprintf_r+0xac0> + 8012a1c: 4633 mov r3, r6 + 8012a1e: f1b9 3fff cmp.w r9, #4294967295 + 8012a22: f853 8b04 ldr.w r8, [r3], #4 + 8012a26: 9307 str r3, [sp, #28] + 8012a28: f04f 0600 mov.w r6, #0 + 8012a2c: f88d 607b strb.w r6, [sp, #123] @ 0x7b + 8012a30: d00f beq.n 8012a52 <_vfprintf_r+0xb6a> + 8012a32: 464a mov r2, r9 + 8012a34: 4631 mov r1, r6 + 8012a36: 4640 mov r0, r8 + 8012a38: f7ed fbe2 bl 8000200 + 8012a3c: 4682 mov sl, r0 + 8012a3e: 2800 cmp r0, #0 + 8012a40: f43f ac7a beq.w 8012338 <_vfprintf_r+0x450> + 8012a44: eba0 0908 sub.w r9, r0, r8 + 8012a48: 46b2 mov sl, r6 + 8012a4a: 9610 str r6, [sp, #64] @ 0x40 + 8012a4c: 4637 mov r7, r6 + 8012a4e: 9608 str r6, [sp, #32] + 8012a50: e5ec b.n 801262c <_vfprintf_r+0x744> + 8012a52: 4640 mov r0, r8 + 8012a54: f7ed fbcc bl 80001f0 + 8012a58: 46b2 mov sl, r6 + 8012a5a: 4681 mov r9, r0 + 8012a5c: e46c b.n 8012338 <_vfprintf_r+0x450> + 8012a5e: f045 0510 orr.w r5, r5, #16 + 8012a62: f015 0320 ands.w r3, r5, #32 + 8012a66: d009 beq.n 8012a7c <_vfprintf_r+0xb94> + 8012a68: 3607 adds r6, #7 + 8012a6a: f026 0307 bic.w r3, r6, #7 + 8012a6e: 461a mov r2, r3 + 8012a70: 685f ldr r7, [r3, #4] + 8012a72: f852 6b08 ldr.w r6, [r2], #8 + 8012a76: 9207 str r2, [sp, #28] + 8012a78: 2301 movs r3, #1 + 8012a7a: e795 b.n 80129a8 <_vfprintf_r+0xac0> + 8012a7c: 4632 mov r2, r6 + 8012a7e: f015 0710 ands.w r7, r5, #16 + 8012a82: f852 6b04 ldr.w r6, [r2], #4 + 8012a86: 9207 str r2, [sp, #28] + 8012a88: d001 beq.n 8012a8e <_vfprintf_r+0xba6> + 8012a8a: 461f mov r7, r3 + 8012a8c: e7f4 b.n 8012a78 <_vfprintf_r+0xb90> + 8012a8e: f015 0340 ands.w r3, r5, #64 @ 0x40 + 8012a92: d001 beq.n 8012a98 <_vfprintf_r+0xbb0> + 8012a94: b2b6 uxth r6, r6 + 8012a96: e7ef b.n 8012a78 <_vfprintf_r+0xb90> + 8012a98: f415 7700 ands.w r7, r5, #512 @ 0x200 + 8012a9c: d0ec beq.n 8012a78 <_vfprintf_r+0xb90> + 8012a9e: b2f6 uxtb r6, r6 + 8012aa0: e7f3 b.n 8012a8a <_vfprintf_r+0xba2> + 8012aa2: 4b6f ldr r3, [pc, #444] @ (8012c60 <_vfprintf_r+0xd78>) + 8012aa4: f7ff bb33 b.w 801210e <_vfprintf_r+0x226> + 8012aa8: 4632 mov r2, r6 + 8012aaa: f015 0710 ands.w r7, r5, #16 + 8012aae: f852 6b04 ldr.w r6, [r2], #4 + 8012ab2: 9207 str r2, [sp, #28] + 8012ab4: d002 beq.n 8012abc <_vfprintf_r+0xbd4> + 8012ab6: 461f mov r7, r3 + 8012ab8: f7ff bb36 b.w 8012128 <_vfprintf_r+0x240> + 8012abc: f015 0340 ands.w r3, r5, #64 @ 0x40 + 8012ac0: d002 beq.n 8012ac8 <_vfprintf_r+0xbe0> + 8012ac2: b2b6 uxth r6, r6 + 8012ac4: f7ff bb30 b.w 8012128 <_vfprintf_r+0x240> + 8012ac8: f415 7700 ands.w r7, r5, #512 @ 0x200 + 8012acc: f43f ab2c beq.w 8012128 <_vfprintf_r+0x240> + 8012ad0: b2f6 uxtb r6, r6 + 8012ad2: e7f0 b.n 8012ab6 <_vfprintf_r+0xbce> + 8012ad4: 2e0a cmp r6, #10 + 8012ad6: f177 0300 sbcs.w r3, r7, #0 + 8012ada: d207 bcs.n 8012aec <_vfprintf_r+0xc04> + 8012adc: 3630 adds r6, #48 @ 0x30 + 8012ade: b2f6 uxtb r6, r6 + 8012ae0: f88d 6147 strb.w r6, [sp, #327] @ 0x147 + 8012ae4: f20d 1847 addw r8, sp, #327 @ 0x147 + 8012ae8: f000 bc1a b.w 8013320 <_vfprintf_r+0x1438> + 8012aec: 2300 movs r3, #0 + 8012aee: 9304 str r3, [sp, #16] + 8012af0: 9b08 ldr r3, [sp, #32] + 8012af2: f403 6380 and.w r3, r3, #1024 @ 0x400 + 8012af6: ad52 add r5, sp, #328 @ 0x148 + 8012af8: 9310 str r3, [sp, #64] @ 0x40 + 8012afa: 220a movs r2, #10 + 8012afc: 2300 movs r3, #0 + 8012afe: 4630 mov r0, r6 + 8012b00: 4639 mov r1, r7 + 8012b02: f7ee f861 bl 8000bc8 <__aeabi_uldivmod> + 8012b06: 9b04 ldr r3, [sp, #16] + 8012b08: 9011 str r0, [sp, #68] @ 0x44 + 8012b0a: 3301 adds r3, #1 + 8012b0c: 9304 str r3, [sp, #16] + 8012b0e: 9b10 ldr r3, [sp, #64] @ 0x40 + 8012b10: 3230 adds r2, #48 @ 0x30 + 8012b12: 468a mov sl, r1 + 8012b14: f105 38ff add.w r8, r5, #4294967295 + 8012b18: f805 2c01 strb.w r2, [r5, #-1] + 8012b1c: b1d3 cbz r3, 8012b54 <_vfprintf_r+0xc6c> + 8012b1e: 9b09 ldr r3, [sp, #36] @ 0x24 + 8012b20: 9a04 ldr r2, [sp, #16] + 8012b22: 781b ldrb r3, [r3, #0] + 8012b24: 429a cmp r2, r3 + 8012b26: d115 bne.n 8012b54 <_vfprintf_r+0xc6c> + 8012b28: 2aff cmp r2, #255 @ 0xff + 8012b2a: d013 beq.n 8012b54 <_vfprintf_r+0xc6c> + 8012b2c: 2e0a cmp r6, #10 + 8012b2e: f177 0300 sbcs.w r3, r7, #0 + 8012b32: d30f bcc.n 8012b54 <_vfprintf_r+0xc6c> + 8012b34: 9b12 ldr r3, [sp, #72] @ 0x48 + 8012b36: 9917 ldr r1, [sp, #92] @ 0x5c + 8012b38: eba8 0803 sub.w r8, r8, r3 + 8012b3c: 461a mov r2, r3 + 8012b3e: 4640 mov r0, r8 + 8012b40: f001 fc48 bl 80143d4 + 8012b44: 9b09 ldr r3, [sp, #36] @ 0x24 + 8012b46: 785b ldrb r3, [r3, #1] + 8012b48: b11b cbz r3, 8012b52 <_vfprintf_r+0xc6a> + 8012b4a: 9b09 ldr r3, [sp, #36] @ 0x24 + 8012b4c: 3301 adds r3, #1 + 8012b4e: 9309 str r3, [sp, #36] @ 0x24 + 8012b50: 2300 movs r3, #0 + 8012b52: 9304 str r3, [sp, #16] + 8012b54: 2e0a cmp r6, #10 + 8012b56: f177 0700 sbcs.w r7, r7, #0 + 8012b5a: f0c0 83e1 bcc.w 8013320 <_vfprintf_r+0x1438> + 8012b5e: 9e11 ldr r6, [sp, #68] @ 0x44 + 8012b60: 4657 mov r7, sl + 8012b62: 4645 mov r5, r8 + 8012b64: e7c9 b.n 8012afa <_vfprintf_r+0xc12> + 8012b66: f006 030f and.w r3, r6, #15 + 8012b6a: 9a19 ldr r2, [sp, #100] @ 0x64 + 8012b6c: 0936 lsrs r6, r6, #4 + 8012b6e: 5cd3 ldrb r3, [r2, r3] + 8012b70: f808 3d01 strb.w r3, [r8, #-1]! + 8012b74: ea46 7607 orr.w r6, r6, r7, lsl #28 + 8012b78: 093f lsrs r7, r7, #4 + 8012b7a: ea56 0307 orrs.w r3, r6, r7 + 8012b7e: d1f2 bne.n 8012b66 <_vfprintf_r+0xc7e> + 8012b80: e3ce b.n 8013320 <_vfprintf_r+0x1438> + 8012b82: b91b cbnz r3, 8012b8c <_vfprintf_r+0xca4> + 8012b84: 07ed lsls r5, r5, #31 + 8012b86: d501 bpl.n 8012b8c <_vfprintf_r+0xca4> + 8012b88: 2630 movs r6, #48 @ 0x30 + 8012b8a: e7a9 b.n 8012ae0 <_vfprintf_r+0xbf8> + 8012b8c: f50d 78a4 add.w r8, sp, #328 @ 0x148 + 8012b90: e3c6 b.n 8013320 <_vfprintf_r+0x1438> + 8012b92: 9b06 ldr r3, [sp, #24] + 8012b94: 2b00 cmp r3, #0 + 8012b96: f000 8390 beq.w 80132ba <_vfprintf_r+0x13d2> + 8012b9a: f88d 30e4 strb.w r3, [sp, #228] @ 0xe4 + 8012b9e: 2300 movs r3, #0 + 8012ba0: f88d 307b strb.w r3, [sp, #123] @ 0x7b + 8012ba4: 9607 str r6, [sp, #28] + 8012ba6: f7ff bb5c b.w 8012262 <_vfprintf_r+0x37a> + 8012baa: 2010 movs r0, #16 + 8012bac: 4403 add r3, r0 + 8012bae: 2a07 cmp r2, #7 + 8012bb0: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012bb4: 6060 str r0, [r4, #4] + 8012bb6: dd08 ble.n 8012bca <_vfprintf_r+0xce2> + 8012bb8: 9803 ldr r0, [sp, #12] + 8012bba: aa26 add r2, sp, #152 @ 0x98 + 8012bbc: 4659 mov r1, fp + 8012bbe: f000 fbff bl 80133c0 <__sprint_r> + 8012bc2: 2800 cmp r0, #0 + 8012bc4: f040 8357 bne.w 8013276 <_vfprintf_r+0x138e> + 8012bc8: a929 add r1, sp, #164 @ 0xa4 + 8012bca: 9b13 ldr r3, [sp, #76] @ 0x4c + 8012bcc: 3b10 subs r3, #16 + 8012bce: 9313 str r3, [sp, #76] @ 0x4c + 8012bd0: 460c mov r4, r1 + 8012bd2: e547 b.n 8012664 <_vfprintf_r+0x77c> + 8012bd4: 460c mov r4, r1 + 8012bd6: e562 b.n 801269e <_vfprintf_r+0x7b6> + 8012bd8: 9803 ldr r0, [sp, #12] + 8012bda: aa26 add r2, sp, #152 @ 0x98 + 8012bdc: 4659 mov r1, fp + 8012bde: f000 fbef bl 80133c0 <__sprint_r> + 8012be2: 2800 cmp r0, #0 + 8012be4: f040 8347 bne.w 8013276 <_vfprintf_r+0x138e> + 8012be8: ac29 add r4, sp, #164 @ 0xa4 + 8012bea: e56a b.n 80126c2 <_vfprintf_r+0x7da> + 8012bec: 9803 ldr r0, [sp, #12] + 8012bee: aa26 add r2, sp, #152 @ 0x98 + 8012bf0: 4659 mov r1, fp + 8012bf2: f000 fbe5 bl 80133c0 <__sprint_r> + 8012bf6: 2800 cmp r0, #0 + 8012bf8: f040 833d bne.w 8013276 <_vfprintf_r+0x138e> + 8012bfc: ac29 add r4, sp, #164 @ 0xa4 + 8012bfe: e570 b.n 80126e2 <_vfprintf_r+0x7fa> + 8012c00: 2010 movs r0, #16 + 8012c02: 4403 add r3, r0 + 8012c04: 2a07 cmp r2, #7 + 8012c06: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012c0a: 6060 str r0, [r4, #4] + 8012c0c: dd08 ble.n 8012c20 <_vfprintf_r+0xd38> + 8012c0e: 9803 ldr r0, [sp, #12] + 8012c10: aa26 add r2, sp, #152 @ 0x98 + 8012c12: 4659 mov r1, fp + 8012c14: f000 fbd4 bl 80133c0 <__sprint_r> + 8012c18: 2800 cmp r0, #0 + 8012c1a: f040 832c bne.w 8013276 <_vfprintf_r+0x138e> + 8012c1e: a929 add r1, sp, #164 @ 0xa4 + 8012c20: 9b13 ldr r3, [sp, #76] @ 0x4c + 8012c22: 3b10 subs r3, #16 + 8012c24: 9313 str r3, [sp, #76] @ 0x4c + 8012c26: 460c mov r4, r1 + 8012c28: e564 b.n 80126f4 <_vfprintf_r+0x80c> + 8012c2a: 460c mov r4, r1 + 8012c2c: e57f b.n 801272e <_vfprintf_r+0x846> + 8012c2e: 2010 movs r0, #16 + 8012c30: 4403 add r3, r0 + 8012c32: 2a07 cmp r2, #7 + 8012c34: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012c38: 6060 str r0, [r4, #4] + 8012c3a: dd08 ble.n 8012c4e <_vfprintf_r+0xd66> + 8012c3c: 9803 ldr r0, [sp, #12] + 8012c3e: aa26 add r2, sp, #152 @ 0x98 + 8012c40: 4659 mov r1, fp + 8012c42: f000 fbbd bl 80133c0 <__sprint_r> + 8012c46: 2800 cmp r0, #0 + 8012c48: f040 8315 bne.w 8013276 <_vfprintf_r+0x138e> + 8012c4c: a929 add r1, sp, #164 @ 0xa4 + 8012c4e: 9b10 ldr r3, [sp, #64] @ 0x40 + 8012c50: 3b10 subs r3, #16 + 8012c52: 9310 str r3, [sp, #64] @ 0x40 + 8012c54: 460c mov r4, r1 + 8012c56: e570 b.n 801273a <_vfprintf_r+0x852> + 8012c58: 460c mov r4, r1 + 8012c5a: e58b b.n 8012774 <_vfprintf_r+0x88c> + 8012c5c: 08018ffb .word 0x08018ffb + 8012c60: 0801900c .word 0x0801900c + 8012c64: 9b06 ldr r3, [sp, #24] + 8012c66: 2b65 cmp r3, #101 @ 0x65 + 8012c68: f340 8245 ble.w 80130f6 <_vfprintf_r+0x120e> + 8012c6c: e9dd 010a ldrd r0, r1, [sp, #40] @ 0x28 + 8012c70: 2200 movs r2, #0 + 8012c72: 2300 movs r3, #0 + 8012c74: f7ed ff38 bl 8000ae8 <__aeabi_dcmpeq> + 8012c78: 2800 cmp r0, #0 + 8012c7a: d06a beq.n 8012d52 <_vfprintf_r+0xe6a> + 8012c7c: 4b73 ldr r3, [pc, #460] @ (8012e4c <_vfprintf_r+0xf64>) + 8012c7e: 6023 str r3, [r4, #0] + 8012c80: 2301 movs r3, #1 + 8012c82: 6063 str r3, [r4, #4] + 8012c84: 9b10 ldr r3, [sp, #64] @ 0x40 + 8012c86: 3301 adds r3, #1 + 8012c88: 9328 str r3, [sp, #160] @ 0xa0 + 8012c8a: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012c8c: 3301 adds r3, #1 + 8012c8e: 2b07 cmp r3, #7 + 8012c90: 9327 str r3, [sp, #156] @ 0x9c + 8012c92: dc37 bgt.n 8012d04 <_vfprintf_r+0xe1c> + 8012c94: 3408 adds r4, #8 + 8012c96: 9b20 ldr r3, [sp, #128] @ 0x80 + 8012c98: 9a04 ldr r2, [sp, #16] + 8012c9a: 4293 cmp r3, r2 + 8012c9c: db02 blt.n 8012ca4 <_vfprintf_r+0xdbc> + 8012c9e: 07e9 lsls r1, r5, #31 + 8012ca0: f57f ad78 bpl.w 8012794 <_vfprintf_r+0x8ac> + 8012ca4: 9b16 ldr r3, [sp, #88] @ 0x58 + 8012ca6: 6023 str r3, [r4, #0] + 8012ca8: 9b0d ldr r3, [sp, #52] @ 0x34 + 8012caa: 9a0d ldr r2, [sp, #52] @ 0x34 + 8012cac: 6063 str r3, [r4, #4] + 8012cae: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8012cb0: 4413 add r3, r2 + 8012cb2: 9328 str r3, [sp, #160] @ 0xa0 + 8012cb4: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012cb6: 3301 adds r3, #1 + 8012cb8: 2b07 cmp r3, #7 + 8012cba: 9327 str r3, [sp, #156] @ 0x9c + 8012cbc: dc2c bgt.n 8012d18 <_vfprintf_r+0xe30> + 8012cbe: 3408 adds r4, #8 + 8012cc0: 9b04 ldr r3, [sp, #16] + 8012cc2: 1e5e subs r6, r3, #1 + 8012cc4: 2e00 cmp r6, #0 + 8012cc6: f77f ad65 ble.w 8012794 <_vfprintf_r+0x8ac> + 8012cca: 4f61 ldr r7, [pc, #388] @ (8012e50 <_vfprintf_r+0xf68>) + 8012ccc: f04f 0810 mov.w r8, #16 + 8012cd0: e9dd 3227 ldrd r3, r2, [sp, #156] @ 0x9c + 8012cd4: 2e10 cmp r6, #16 + 8012cd6: f103 0301 add.w r3, r3, #1 + 8012cda: f104 0108 add.w r1, r4, #8 + 8012cde: 6027 str r7, [r4, #0] + 8012ce0: dc24 bgt.n 8012d2c <_vfprintf_r+0xe44> + 8012ce2: 6066 str r6, [r4, #4] + 8012ce4: 2b07 cmp r3, #7 + 8012ce6: 4416 add r6, r2 + 8012ce8: e9cd 3627 strd r3, r6, [sp, #156] @ 0x9c + 8012cec: f340 82a2 ble.w 8013234 <_vfprintf_r+0x134c> + 8012cf0: 9803 ldr r0, [sp, #12] + 8012cf2: aa26 add r2, sp, #152 @ 0x98 + 8012cf4: 4659 mov r1, fp + 8012cf6: f000 fb63 bl 80133c0 <__sprint_r> + 8012cfa: 2800 cmp r0, #0 + 8012cfc: f040 82bb bne.w 8013276 <_vfprintf_r+0x138e> + 8012d00: ac29 add r4, sp, #164 @ 0xa4 + 8012d02: e547 b.n 8012794 <_vfprintf_r+0x8ac> + 8012d04: 9803 ldr r0, [sp, #12] + 8012d06: aa26 add r2, sp, #152 @ 0x98 + 8012d08: 4659 mov r1, fp + 8012d0a: f000 fb59 bl 80133c0 <__sprint_r> + 8012d0e: 2800 cmp r0, #0 + 8012d10: f040 82b1 bne.w 8013276 <_vfprintf_r+0x138e> + 8012d14: ac29 add r4, sp, #164 @ 0xa4 + 8012d16: e7be b.n 8012c96 <_vfprintf_r+0xdae> + 8012d18: 9803 ldr r0, [sp, #12] + 8012d1a: aa26 add r2, sp, #152 @ 0x98 + 8012d1c: 4659 mov r1, fp + 8012d1e: f000 fb4f bl 80133c0 <__sprint_r> + 8012d22: 2800 cmp r0, #0 + 8012d24: f040 82a7 bne.w 8013276 <_vfprintf_r+0x138e> + 8012d28: ac29 add r4, sp, #164 @ 0xa4 + 8012d2a: e7c9 b.n 8012cc0 <_vfprintf_r+0xdd8> + 8012d2c: 3210 adds r2, #16 + 8012d2e: 2b07 cmp r3, #7 + 8012d30: e9cd 3227 strd r3, r2, [sp, #156] @ 0x9c + 8012d34: f8c4 8004 str.w r8, [r4, #4] + 8012d38: dd08 ble.n 8012d4c <_vfprintf_r+0xe64> + 8012d3a: 9803 ldr r0, [sp, #12] + 8012d3c: aa26 add r2, sp, #152 @ 0x98 + 8012d3e: 4659 mov r1, fp + 8012d40: f000 fb3e bl 80133c0 <__sprint_r> + 8012d44: 2800 cmp r0, #0 + 8012d46: f040 8296 bne.w 8013276 <_vfprintf_r+0x138e> + 8012d4a: a929 add r1, sp, #164 @ 0xa4 + 8012d4c: 3e10 subs r6, #16 + 8012d4e: 460c mov r4, r1 + 8012d50: e7be b.n 8012cd0 <_vfprintf_r+0xde8> + 8012d52: 9b20 ldr r3, [sp, #128] @ 0x80 + 8012d54: 2b00 cmp r3, #0 + 8012d56: dc7d bgt.n 8012e54 <_vfprintf_r+0xf6c> + 8012d58: 4b3c ldr r3, [pc, #240] @ (8012e4c <_vfprintf_r+0xf64>) + 8012d5a: 6023 str r3, [r4, #0] + 8012d5c: 2301 movs r3, #1 + 8012d5e: 6063 str r3, [r4, #4] + 8012d60: 9b10 ldr r3, [sp, #64] @ 0x40 + 8012d62: 3301 adds r3, #1 + 8012d64: 9328 str r3, [sp, #160] @ 0xa0 + 8012d66: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012d68: 3301 adds r3, #1 + 8012d6a: 2b07 cmp r3, #7 + 8012d6c: 9327 str r3, [sp, #156] @ 0x9c + 8012d6e: dc46 bgt.n 8012dfe <_vfprintf_r+0xf16> + 8012d70: 3408 adds r4, #8 + 8012d72: 9904 ldr r1, [sp, #16] + 8012d74: 9b20 ldr r3, [sp, #128] @ 0x80 + 8012d76: 9a28 ldr r2, [sp, #160] @ 0xa0 + 8012d78: 430b orrs r3, r1 + 8012d7a: f005 0101 and.w r1, r5, #1 + 8012d7e: 430b orrs r3, r1 + 8012d80: f43f ad08 beq.w 8012794 <_vfprintf_r+0x8ac> + 8012d84: 9b16 ldr r3, [sp, #88] @ 0x58 + 8012d86: 6023 str r3, [r4, #0] + 8012d88: 9b0d ldr r3, [sp, #52] @ 0x34 + 8012d8a: 6063 str r3, [r4, #4] + 8012d8c: 441a add r2, r3 + 8012d8e: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012d90: 9228 str r2, [sp, #160] @ 0xa0 + 8012d92: 3301 adds r3, #1 + 8012d94: 2b07 cmp r3, #7 + 8012d96: 9327 str r3, [sp, #156] @ 0x9c + 8012d98: dc3b bgt.n 8012e12 <_vfprintf_r+0xf2a> + 8012d9a: f104 0308 add.w r3, r4, #8 + 8012d9e: 9e20 ldr r6, [sp, #128] @ 0x80 + 8012da0: 2e00 cmp r6, #0 + 8012da2: da1b bge.n 8012ddc <_vfprintf_r+0xef4> + 8012da4: 4f2a ldr r7, [pc, #168] @ (8012e50 <_vfprintf_r+0xf68>) + 8012da6: 4276 negs r6, r6 + 8012da8: 461a mov r2, r3 + 8012daa: 2410 movs r4, #16 + 8012dac: e9dd 1027 ldrd r1, r0, [sp, #156] @ 0x9c + 8012db0: 2e10 cmp r6, #16 + 8012db2: f101 0101 add.w r1, r1, #1 + 8012db6: f103 0308 add.w r3, r3, #8 + 8012dba: 6017 str r7, [r2, #0] + 8012dbc: dc33 bgt.n 8012e26 <_vfprintf_r+0xf3e> + 8012dbe: 6056 str r6, [r2, #4] + 8012dc0: 2907 cmp r1, #7 + 8012dc2: 4406 add r6, r0 + 8012dc4: e9cd 1627 strd r1, r6, [sp, #156] @ 0x9c + 8012dc8: dd08 ble.n 8012ddc <_vfprintf_r+0xef4> + 8012dca: 9803 ldr r0, [sp, #12] + 8012dcc: aa26 add r2, sp, #152 @ 0x98 + 8012dce: 4659 mov r1, fp + 8012dd0: f000 faf6 bl 80133c0 <__sprint_r> + 8012dd4: 2800 cmp r0, #0 + 8012dd6: f040 824e bne.w 8013276 <_vfprintf_r+0x138e> + 8012dda: ab29 add r3, sp, #164 @ 0xa4 + 8012ddc: 9a04 ldr r2, [sp, #16] + 8012dde: 9904 ldr r1, [sp, #16] + 8012de0: 605a str r2, [r3, #4] + 8012de2: 9a28 ldr r2, [sp, #160] @ 0xa0 + 8012de4: f8c3 8000 str.w r8, [r3] + 8012de8: 440a add r2, r1 + 8012dea: 9228 str r2, [sp, #160] @ 0xa0 + 8012dec: 9a27 ldr r2, [sp, #156] @ 0x9c + 8012dee: 3201 adds r2, #1 + 8012df0: 2a07 cmp r2, #7 + 8012df2: 9227 str r2, [sp, #156] @ 0x9c + 8012df4: f73f af7c bgt.w 8012cf0 <_vfprintf_r+0xe08> + 8012df8: f103 0408 add.w r4, r3, #8 + 8012dfc: e4ca b.n 8012794 <_vfprintf_r+0x8ac> + 8012dfe: 9803 ldr r0, [sp, #12] + 8012e00: aa26 add r2, sp, #152 @ 0x98 + 8012e02: 4659 mov r1, fp + 8012e04: f000 fadc bl 80133c0 <__sprint_r> + 8012e08: 2800 cmp r0, #0 + 8012e0a: f040 8234 bne.w 8013276 <_vfprintf_r+0x138e> + 8012e0e: ac29 add r4, sp, #164 @ 0xa4 + 8012e10: e7af b.n 8012d72 <_vfprintf_r+0xe8a> + 8012e12: 9803 ldr r0, [sp, #12] + 8012e14: aa26 add r2, sp, #152 @ 0x98 + 8012e16: 4659 mov r1, fp + 8012e18: f000 fad2 bl 80133c0 <__sprint_r> + 8012e1c: 2800 cmp r0, #0 + 8012e1e: f040 822a bne.w 8013276 <_vfprintf_r+0x138e> + 8012e22: ab29 add r3, sp, #164 @ 0xa4 + 8012e24: e7bb b.n 8012d9e <_vfprintf_r+0xeb6> + 8012e26: 3010 adds r0, #16 + 8012e28: 2907 cmp r1, #7 + 8012e2a: e9cd 1027 strd r1, r0, [sp, #156] @ 0x9c + 8012e2e: 6054 str r4, [r2, #4] + 8012e30: dd08 ble.n 8012e44 <_vfprintf_r+0xf5c> + 8012e32: 9803 ldr r0, [sp, #12] + 8012e34: aa26 add r2, sp, #152 @ 0x98 + 8012e36: 4659 mov r1, fp + 8012e38: f000 fac2 bl 80133c0 <__sprint_r> + 8012e3c: 2800 cmp r0, #0 + 8012e3e: f040 821a bne.w 8013276 <_vfprintf_r+0x138e> + 8012e42: ab29 add r3, sp, #164 @ 0xa4 + 8012e44: 3e10 subs r6, #16 + 8012e46: 461a mov r2, r3 + 8012e48: e7b0 b.n 8012dac <_vfprintf_r+0xec4> + 8012e4a: bf00 nop + 8012e4c: 0801901d .word 0x0801901d + 8012e50: 0801901f .word 0x0801901f + 8012e54: 9b04 ldr r3, [sp, #16] + 8012e56: 4443 add r3, r8 + 8012e58: 9313 str r3, [sp, #76] @ 0x4c + 8012e5a: 9b04 ldr r3, [sp, #16] + 8012e5c: 42b3 cmp r3, r6 + 8012e5e: bfa8 it ge + 8012e60: 4633 movge r3, r6 + 8012e62: 2b00 cmp r3, #0 + 8012e64: 4699 mov r9, r3 + 8012e66: dd0b ble.n 8012e80 <_vfprintf_r+0xf98> + 8012e68: e9c4 8300 strd r8, r3, [r4] + 8012e6c: 9b10 ldr r3, [sp, #64] @ 0x40 + 8012e6e: 444b add r3, r9 + 8012e70: 9328 str r3, [sp, #160] @ 0xa0 + 8012e72: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012e74: 3301 adds r3, #1 + 8012e76: 2b07 cmp r3, #7 + 8012e78: 9327 str r3, [sp, #156] @ 0x9c + 8012e7a: f300 8089 bgt.w 8012f90 <_vfprintf_r+0x10a8> + 8012e7e: 3408 adds r4, #8 + 8012e80: f1b9 0f00 cmp.w r9, #0 + 8012e84: bfac ite ge + 8012e86: eba6 0309 subge.w r3, r6, r9 + 8012e8a: 4633 movlt r3, r6 + 8012e8c: 2b00 cmp r3, #0 + 8012e8e: 9306 str r3, [sp, #24] + 8012e90: dd1c ble.n 8012ecc <_vfprintf_r+0xfe4> + 8012e92: f8df 9364 ldr.w r9, [pc, #868] @ 80131f8 <_vfprintf_r+0x1310> + 8012e96: 9806 ldr r0, [sp, #24] + 8012e98: f8c4 9000 str.w r9, [r4] + 8012e9c: e9dd 2327 ldrd r2, r3, [sp, #156] @ 0x9c + 8012ea0: 2810 cmp r0, #16 + 8012ea2: f102 0201 add.w r2, r2, #1 + 8012ea6: f104 0108 add.w r1, r4, #8 + 8012eaa: dc7b bgt.n 8012fa4 <_vfprintf_r+0x10bc> + 8012eac: 4403 add r3, r0 + 8012eae: 2a07 cmp r2, #7 + 8012eb0: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012eb4: 6060 str r0, [r4, #4] + 8012eb6: f340 808a ble.w 8012fce <_vfprintf_r+0x10e6> + 8012eba: 9803 ldr r0, [sp, #12] + 8012ebc: aa26 add r2, sp, #152 @ 0x98 + 8012ebe: 4659 mov r1, fp + 8012ec0: f000 fa7e bl 80133c0 <__sprint_r> + 8012ec4: 2800 cmp r0, #0 + 8012ec6: f040 81d6 bne.w 8013276 <_vfprintf_r+0x138e> + 8012eca: ac29 add r4, sp, #164 @ 0xa4 + 8012ecc: 056a lsls r2, r5, #21 + 8012ece: 44b0 add r8, r6 + 8012ed0: d508 bpl.n 8012ee4 <_vfprintf_r+0xffc> + 8012ed2: 9b08 ldr r3, [sp, #32] + 8012ed4: 2b00 cmp r3, #0 + 8012ed6: d17c bne.n 8012fd2 <_vfprintf_r+0x10ea> + 8012ed8: 2f00 cmp r7, #0 + 8012eda: d17c bne.n 8012fd6 <_vfprintf_r+0x10ee> + 8012edc: 9b13 ldr r3, [sp, #76] @ 0x4c + 8012ede: 4598 cmp r8, r3 + 8012ee0: bf28 it cs + 8012ee2: 4698 movcs r8, r3 + 8012ee4: 9b20 ldr r3, [sp, #128] @ 0x80 + 8012ee6: 9a04 ldr r2, [sp, #16] + 8012ee8: 4293 cmp r3, r2 + 8012eea: db01 blt.n 8012ef0 <_vfprintf_r+0x1008> + 8012eec: 07eb lsls r3, r5, #31 + 8012eee: d50e bpl.n 8012f0e <_vfprintf_r+0x1026> + 8012ef0: 9b16 ldr r3, [sp, #88] @ 0x58 + 8012ef2: 6023 str r3, [r4, #0] + 8012ef4: 9b0d ldr r3, [sp, #52] @ 0x34 + 8012ef6: 9a0d ldr r2, [sp, #52] @ 0x34 + 8012ef8: 6063 str r3, [r4, #4] + 8012efa: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8012efc: 4413 add r3, r2 + 8012efe: 9328 str r3, [sp, #160] @ 0xa0 + 8012f00: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012f02: 3301 adds r3, #1 + 8012f04: 2b07 cmp r3, #7 + 8012f06: 9327 str r3, [sp, #156] @ 0x9c + 8012f08: f300 80e1 bgt.w 80130ce <_vfprintf_r+0x11e6> + 8012f0c: 3408 adds r4, #8 + 8012f0e: 9b04 ldr r3, [sp, #16] + 8012f10: 9f20 ldr r7, [sp, #128] @ 0x80 + 8012f12: 1bdf subs r7, r3, r7 + 8012f14: 9b13 ldr r3, [sp, #76] @ 0x4c + 8012f16: eba3 0308 sub.w r3, r3, r8 + 8012f1a: 429f cmp r7, r3 + 8012f1c: bfa8 it ge + 8012f1e: 461f movge r7, r3 + 8012f20: 2f00 cmp r7, #0 + 8012f22: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8012f24: dd0a ble.n 8012f3c <_vfprintf_r+0x1054> + 8012f26: 443b add r3, r7 + 8012f28: 9328 str r3, [sp, #160] @ 0xa0 + 8012f2a: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012f2c: 3301 adds r3, #1 + 8012f2e: 2b07 cmp r3, #7 + 8012f30: e9c4 8700 strd r8, r7, [r4] + 8012f34: 9327 str r3, [sp, #156] @ 0x9c + 8012f36: f300 80d4 bgt.w 80130e2 <_vfprintf_r+0x11fa> + 8012f3a: 3408 adds r4, #8 + 8012f3c: 9e20 ldr r6, [sp, #128] @ 0x80 + 8012f3e: 9b04 ldr r3, [sp, #16] + 8012f40: 2f00 cmp r7, #0 + 8012f42: eba3 0606 sub.w r6, r3, r6 + 8012f46: bfa8 it ge + 8012f48: 1bf6 subge r6, r6, r7 + 8012f4a: 2e00 cmp r6, #0 + 8012f4c: f77f ac22 ble.w 8012794 <_vfprintf_r+0x8ac> + 8012f50: 4fa9 ldr r7, [pc, #676] @ (80131f8 <_vfprintf_r+0x1310>) + 8012f52: f04f 0810 mov.w r8, #16 + 8012f56: e9dd 3227 ldrd r3, r2, [sp, #156] @ 0x9c + 8012f5a: 2e10 cmp r6, #16 + 8012f5c: f103 0301 add.w r3, r3, #1 + 8012f60: f104 0108 add.w r1, r4, #8 + 8012f64: 6027 str r7, [r4, #0] + 8012f66: f77f aebc ble.w 8012ce2 <_vfprintf_r+0xdfa> + 8012f6a: 3210 adds r2, #16 + 8012f6c: 2b07 cmp r3, #7 + 8012f6e: e9cd 3227 strd r3, r2, [sp, #156] @ 0x9c + 8012f72: f8c4 8004 str.w r8, [r4, #4] + 8012f76: dd08 ble.n 8012f8a <_vfprintf_r+0x10a2> + 8012f78: 9803 ldr r0, [sp, #12] + 8012f7a: aa26 add r2, sp, #152 @ 0x98 + 8012f7c: 4659 mov r1, fp + 8012f7e: f000 fa1f bl 80133c0 <__sprint_r> + 8012f82: 2800 cmp r0, #0 + 8012f84: f040 8177 bne.w 8013276 <_vfprintf_r+0x138e> + 8012f88: a929 add r1, sp, #164 @ 0xa4 + 8012f8a: 3e10 subs r6, #16 + 8012f8c: 460c mov r4, r1 + 8012f8e: e7e2 b.n 8012f56 <_vfprintf_r+0x106e> + 8012f90: 9803 ldr r0, [sp, #12] + 8012f92: aa26 add r2, sp, #152 @ 0x98 + 8012f94: 4659 mov r1, fp + 8012f96: f000 fa13 bl 80133c0 <__sprint_r> + 8012f9a: 2800 cmp r0, #0 + 8012f9c: f040 816b bne.w 8013276 <_vfprintf_r+0x138e> + 8012fa0: ac29 add r4, sp, #164 @ 0xa4 + 8012fa2: e76d b.n 8012e80 <_vfprintf_r+0xf98> + 8012fa4: 2010 movs r0, #16 + 8012fa6: 4403 add r3, r0 + 8012fa8: 2a07 cmp r2, #7 + 8012faa: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8012fae: 6060 str r0, [r4, #4] + 8012fb0: dd08 ble.n 8012fc4 <_vfprintf_r+0x10dc> + 8012fb2: 9803 ldr r0, [sp, #12] + 8012fb4: aa26 add r2, sp, #152 @ 0x98 + 8012fb6: 4659 mov r1, fp + 8012fb8: f000 fa02 bl 80133c0 <__sprint_r> + 8012fbc: 2800 cmp r0, #0 + 8012fbe: f040 815a bne.w 8013276 <_vfprintf_r+0x138e> + 8012fc2: a929 add r1, sp, #164 @ 0xa4 + 8012fc4: 9b06 ldr r3, [sp, #24] + 8012fc6: 3b10 subs r3, #16 + 8012fc8: 9306 str r3, [sp, #24] + 8012fca: 460c mov r4, r1 + 8012fcc: e763 b.n 8012e96 <_vfprintf_r+0xfae> + 8012fce: 460c mov r4, r1 + 8012fd0: e77c b.n 8012ecc <_vfprintf_r+0xfe4> + 8012fd2: 2f00 cmp r7, #0 + 8012fd4: d04b beq.n 801306e <_vfprintf_r+0x1186> + 8012fd6: 3f01 subs r7, #1 + 8012fd8: 9b17 ldr r3, [sp, #92] @ 0x5c + 8012fda: 6023 str r3, [r4, #0] + 8012fdc: 9b12 ldr r3, [sp, #72] @ 0x48 + 8012fde: 9a12 ldr r2, [sp, #72] @ 0x48 + 8012fe0: 6063 str r3, [r4, #4] + 8012fe2: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8012fe4: 4413 add r3, r2 + 8012fe6: 9328 str r3, [sp, #160] @ 0xa0 + 8012fe8: 9b27 ldr r3, [sp, #156] @ 0x9c + 8012fea: 3301 adds r3, #1 + 8012fec: 2b07 cmp r3, #7 + 8012fee: 9327 str r3, [sp, #156] @ 0x9c + 8012ff0: dc44 bgt.n 801307c <_vfprintf_r+0x1194> + 8012ff2: 3408 adds r4, #8 + 8012ff4: 9b09 ldr r3, [sp, #36] @ 0x24 + 8012ff6: f893 9000 ldrb.w r9, [r3] + 8012ffa: 9b13 ldr r3, [sp, #76] @ 0x4c + 8012ffc: eba3 0308 sub.w r3, r3, r8 + 8013000: 4599 cmp r9, r3 + 8013002: bfa8 it ge + 8013004: 4699 movge r9, r3 + 8013006: f1b9 0f00 cmp.w r9, #0 + 801300a: 9b28 ldr r3, [sp, #160] @ 0xa0 + 801300c: dd09 ble.n 8013022 <_vfprintf_r+0x113a> + 801300e: 444b add r3, r9 + 8013010: 9328 str r3, [sp, #160] @ 0xa0 + 8013012: 9b27 ldr r3, [sp, #156] @ 0x9c + 8013014: 3301 adds r3, #1 + 8013016: 2b07 cmp r3, #7 + 8013018: e9c4 8900 strd r8, r9, [r4] + 801301c: 9327 str r3, [sp, #156] @ 0x9c + 801301e: dc37 bgt.n 8013090 <_vfprintf_r+0x11a8> + 8013020: 3408 adds r4, #8 + 8013022: 9b09 ldr r3, [sp, #36] @ 0x24 + 8013024: 781e ldrb r6, [r3, #0] + 8013026: f1b9 0f00 cmp.w r9, #0 + 801302a: bfa8 it ge + 801302c: eba6 0609 subge.w r6, r6, r9 + 8013030: 2e00 cmp r6, #0 + 8013032: dd18 ble.n 8013066 <_vfprintf_r+0x117e> + 8013034: e9dd 3227 ldrd r3, r2, [sp, #156] @ 0x9c + 8013038: 486f ldr r0, [pc, #444] @ (80131f8 <_vfprintf_r+0x1310>) + 801303a: 6020 str r0, [r4, #0] + 801303c: 2e10 cmp r6, #16 + 801303e: f103 0301 add.w r3, r3, #1 + 8013042: f104 0108 add.w r1, r4, #8 + 8013046: dc2d bgt.n 80130a4 <_vfprintf_r+0x11bc> + 8013048: 6066 str r6, [r4, #4] + 801304a: 2b07 cmp r3, #7 + 801304c: 4416 add r6, r2 + 801304e: e9cd 3627 strd r3, r6, [sp, #156] @ 0x9c + 8013052: dd3a ble.n 80130ca <_vfprintf_r+0x11e2> + 8013054: 9803 ldr r0, [sp, #12] + 8013056: aa26 add r2, sp, #152 @ 0x98 + 8013058: 4659 mov r1, fp + 801305a: f000 f9b1 bl 80133c0 <__sprint_r> + 801305e: 2800 cmp r0, #0 + 8013060: f040 8109 bne.w 8013276 <_vfprintf_r+0x138e> + 8013064: ac29 add r4, sp, #164 @ 0xa4 + 8013066: 9b09 ldr r3, [sp, #36] @ 0x24 + 8013068: 781b ldrb r3, [r3, #0] + 801306a: 4498 add r8, r3 + 801306c: e731 b.n 8012ed2 <_vfprintf_r+0xfea> + 801306e: 9b09 ldr r3, [sp, #36] @ 0x24 + 8013070: 3b01 subs r3, #1 + 8013072: 9309 str r3, [sp, #36] @ 0x24 + 8013074: 9b08 ldr r3, [sp, #32] + 8013076: 3b01 subs r3, #1 + 8013078: 9308 str r3, [sp, #32] + 801307a: e7ad b.n 8012fd8 <_vfprintf_r+0x10f0> + 801307c: 9803 ldr r0, [sp, #12] + 801307e: aa26 add r2, sp, #152 @ 0x98 + 8013080: 4659 mov r1, fp + 8013082: f000 f99d bl 80133c0 <__sprint_r> + 8013086: 2800 cmp r0, #0 + 8013088: f040 80f5 bne.w 8013276 <_vfprintf_r+0x138e> + 801308c: ac29 add r4, sp, #164 @ 0xa4 + 801308e: e7b1 b.n 8012ff4 <_vfprintf_r+0x110c> + 8013090: 9803 ldr r0, [sp, #12] + 8013092: aa26 add r2, sp, #152 @ 0x98 + 8013094: 4659 mov r1, fp + 8013096: f000 f993 bl 80133c0 <__sprint_r> + 801309a: 2800 cmp r0, #0 + 801309c: f040 80eb bne.w 8013276 <_vfprintf_r+0x138e> + 80130a0: ac29 add r4, sp, #164 @ 0xa4 + 80130a2: e7be b.n 8013022 <_vfprintf_r+0x113a> + 80130a4: 2010 movs r0, #16 + 80130a6: 4402 add r2, r0 + 80130a8: 2b07 cmp r3, #7 + 80130aa: e9cd 3227 strd r3, r2, [sp, #156] @ 0x9c + 80130ae: 6060 str r0, [r4, #4] + 80130b0: dd08 ble.n 80130c4 <_vfprintf_r+0x11dc> + 80130b2: 9803 ldr r0, [sp, #12] + 80130b4: aa26 add r2, sp, #152 @ 0x98 + 80130b6: 4659 mov r1, fp + 80130b8: f000 f982 bl 80133c0 <__sprint_r> + 80130bc: 2800 cmp r0, #0 + 80130be: f040 80da bne.w 8013276 <_vfprintf_r+0x138e> + 80130c2: a929 add r1, sp, #164 @ 0xa4 + 80130c4: 3e10 subs r6, #16 + 80130c6: 460c mov r4, r1 + 80130c8: e7b4 b.n 8013034 <_vfprintf_r+0x114c> + 80130ca: 460c mov r4, r1 + 80130cc: e7cb b.n 8013066 <_vfprintf_r+0x117e> + 80130ce: 9803 ldr r0, [sp, #12] + 80130d0: aa26 add r2, sp, #152 @ 0x98 + 80130d2: 4659 mov r1, fp + 80130d4: f000 f974 bl 80133c0 <__sprint_r> + 80130d8: 2800 cmp r0, #0 + 80130da: f040 80cc bne.w 8013276 <_vfprintf_r+0x138e> + 80130de: ac29 add r4, sp, #164 @ 0xa4 + 80130e0: e715 b.n 8012f0e <_vfprintf_r+0x1026> + 80130e2: 9803 ldr r0, [sp, #12] + 80130e4: aa26 add r2, sp, #152 @ 0x98 + 80130e6: 4659 mov r1, fp + 80130e8: f000 f96a bl 80133c0 <__sprint_r> + 80130ec: 2800 cmp r0, #0 + 80130ee: f040 80c2 bne.w 8013276 <_vfprintf_r+0x138e> + 80130f2: ac29 add r4, sp, #164 @ 0xa4 + 80130f4: e722 b.n 8012f3c <_vfprintf_r+0x1054> + 80130f6: 9904 ldr r1, [sp, #16] + 80130f8: 9b10 ldr r3, [sp, #64] @ 0x40 + 80130fa: 9a27 ldr r2, [sp, #156] @ 0x9c + 80130fc: 2901 cmp r1, #1 + 80130fe: f103 0301 add.w r3, r3, #1 + 8013102: f102 0201 add.w r2, r2, #1 + 8013106: f104 0608 add.w r6, r4, #8 + 801310a: dc02 bgt.n 8013112 <_vfprintf_r+0x122a> + 801310c: 07ef lsls r7, r5, #31 + 801310e: f140 8086 bpl.w 801321e <_vfprintf_r+0x1336> + 8013112: 2101 movs r1, #1 + 8013114: 2a07 cmp r2, #7 + 8013116: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 801311a: f8c4 8000 str.w r8, [r4] + 801311e: 6061 str r1, [r4, #4] + 8013120: dd08 ble.n 8013134 <_vfprintf_r+0x124c> + 8013122: 9803 ldr r0, [sp, #12] + 8013124: aa26 add r2, sp, #152 @ 0x98 + 8013126: 4659 mov r1, fp + 8013128: f000 f94a bl 80133c0 <__sprint_r> + 801312c: 2800 cmp r0, #0 + 801312e: f040 80a2 bne.w 8013276 <_vfprintf_r+0x138e> + 8013132: ae29 add r6, sp, #164 @ 0xa4 + 8013134: 9b16 ldr r3, [sp, #88] @ 0x58 + 8013136: 6033 str r3, [r6, #0] + 8013138: 9b0d ldr r3, [sp, #52] @ 0x34 + 801313a: 9a0d ldr r2, [sp, #52] @ 0x34 + 801313c: 6073 str r3, [r6, #4] + 801313e: 9b28 ldr r3, [sp, #160] @ 0xa0 + 8013140: 4413 add r3, r2 + 8013142: 9328 str r3, [sp, #160] @ 0xa0 + 8013144: 9b27 ldr r3, [sp, #156] @ 0x9c + 8013146: 3301 adds r3, #1 + 8013148: 2b07 cmp r3, #7 + 801314a: 9327 str r3, [sp, #156] @ 0x9c + 801314c: dc33 bgt.n 80131b6 <_vfprintf_r+0x12ce> + 801314e: 3608 adds r6, #8 + 8013150: 9b04 ldr r3, [sp, #16] + 8013152: e9dd 010a ldrd r0, r1, [sp, #40] @ 0x28 + 8013156: 1e5c subs r4, r3, #1 + 8013158: 2200 movs r2, #0 + 801315a: 2300 movs r3, #0 + 801315c: e9dd 9727 ldrd r9, r7, [sp, #156] @ 0x9c + 8013160: f7ed fcc2 bl 8000ae8 <__aeabi_dcmpeq> + 8013164: 2800 cmp r0, #0 + 8013166: d12f bne.n 80131c8 <_vfprintf_r+0x12e0> + 8013168: f108 0201 add.w r2, r8, #1 + 801316c: e9c6 2400 strd r2, r4, [r6] + 8013170: 9a04 ldr r2, [sp, #16] + 8013172: f109 0301 add.w r3, r9, #1 + 8013176: 3f01 subs r7, #1 + 8013178: 4417 add r7, r2 + 801317a: 2b07 cmp r3, #7 + 801317c: e9cd 3727 strd r3, r7, [sp, #156] @ 0x9c + 8013180: dd56 ble.n 8013230 <_vfprintf_r+0x1348> + 8013182: 9803 ldr r0, [sp, #12] + 8013184: aa26 add r2, sp, #152 @ 0x98 + 8013186: 4659 mov r1, fp + 8013188: f000 f91a bl 80133c0 <__sprint_r> + 801318c: 2800 cmp r0, #0 + 801318e: d172 bne.n 8013276 <_vfprintf_r+0x138e> + 8013190: ae29 add r6, sp, #164 @ 0xa4 + 8013192: ab22 add r3, sp, #136 @ 0x88 + 8013194: 6033 str r3, [r6, #0] + 8013196: 9b18 ldr r3, [sp, #96] @ 0x60 + 8013198: 9a18 ldr r2, [sp, #96] @ 0x60 + 801319a: 6073 str r3, [r6, #4] + 801319c: 9b28 ldr r3, [sp, #160] @ 0xa0 + 801319e: 4413 add r3, r2 + 80131a0: 9328 str r3, [sp, #160] @ 0xa0 + 80131a2: 9b27 ldr r3, [sp, #156] @ 0x9c + 80131a4: 3301 adds r3, #1 + 80131a6: 2b07 cmp r3, #7 + 80131a8: 9327 str r3, [sp, #156] @ 0x9c + 80131aa: f73f ada1 bgt.w 8012cf0 <_vfprintf_r+0xe08> + 80131ae: f106 0408 add.w r4, r6, #8 + 80131b2: f7ff baef b.w 8012794 <_vfprintf_r+0x8ac> + 80131b6: 9803 ldr r0, [sp, #12] + 80131b8: aa26 add r2, sp, #152 @ 0x98 + 80131ba: 4659 mov r1, fp + 80131bc: f000 f900 bl 80133c0 <__sprint_r> + 80131c0: 2800 cmp r0, #0 + 80131c2: d158 bne.n 8013276 <_vfprintf_r+0x138e> + 80131c4: ae29 add r6, sp, #164 @ 0xa4 + 80131c6: e7c3 b.n 8013150 <_vfprintf_r+0x1268> + 80131c8: 9b04 ldr r3, [sp, #16] + 80131ca: 2b01 cmp r3, #1 + 80131cc: dde1 ble.n 8013192 <_vfprintf_r+0x12aa> + 80131ce: 4f0a ldr r7, [pc, #40] @ (80131f8 <_vfprintf_r+0x1310>) + 80131d0: f04f 0810 mov.w r8, #16 + 80131d4: e9dd 3227 ldrd r3, r2, [sp, #156] @ 0x9c + 80131d8: 2c10 cmp r4, #16 + 80131da: f103 0301 add.w r3, r3, #1 + 80131de: f106 0108 add.w r1, r6, #8 + 80131e2: 6037 str r7, [r6, #0] + 80131e4: dc0a bgt.n 80131fc <_vfprintf_r+0x1314> + 80131e6: 6074 str r4, [r6, #4] + 80131e8: 2b07 cmp r3, #7 + 80131ea: 4414 add r4, r2 + 80131ec: e9cd 3427 strd r3, r4, [sp, #156] @ 0x9c + 80131f0: dcc7 bgt.n 8013182 <_vfprintf_r+0x129a> + 80131f2: 460e mov r6, r1 + 80131f4: e7cd b.n 8013192 <_vfprintf_r+0x12aa> + 80131f6: bf00 nop + 80131f8: 0801901f .word 0x0801901f + 80131fc: 3210 adds r2, #16 + 80131fe: 2b07 cmp r3, #7 + 8013200: e9cd 3227 strd r3, r2, [sp, #156] @ 0x9c + 8013204: f8c6 8004 str.w r8, [r6, #4] + 8013208: dd06 ble.n 8013218 <_vfprintf_r+0x1330> + 801320a: 9803 ldr r0, [sp, #12] + 801320c: aa26 add r2, sp, #152 @ 0x98 + 801320e: 4659 mov r1, fp + 8013210: f000 f8d6 bl 80133c0 <__sprint_r> + 8013214: bb78 cbnz r0, 8013276 <_vfprintf_r+0x138e> + 8013216: a929 add r1, sp, #164 @ 0xa4 + 8013218: 3c10 subs r4, #16 + 801321a: 460e mov r6, r1 + 801321c: e7da b.n 80131d4 <_vfprintf_r+0x12ec> + 801321e: 2101 movs r1, #1 + 8013220: 2a07 cmp r2, #7 + 8013222: e9cd 2327 strd r2, r3, [sp, #156] @ 0x9c + 8013226: f8c4 8000 str.w r8, [r4] + 801322a: 6061 str r1, [r4, #4] + 801322c: ddb1 ble.n 8013192 <_vfprintf_r+0x12aa> + 801322e: e7a8 b.n 8013182 <_vfprintf_r+0x129a> + 8013230: 3608 adds r6, #8 + 8013232: e7ae b.n 8013192 <_vfprintf_r+0x12aa> + 8013234: 460c mov r4, r1 + 8013236: f7ff baad b.w 8012794 <_vfprintf_r+0x8ac> + 801323a: 9b0e ldr r3, [sp, #56] @ 0x38 + 801323c: 9a11 ldr r2, [sp, #68] @ 0x44 + 801323e: 1a9d subs r5, r3, r2 + 8013240: 2d00 cmp r5, #0 + 8013242: f77f aaaa ble.w 801279a <_vfprintf_r+0x8b2> + 8013246: 4e3d ldr r6, [pc, #244] @ (801333c <_vfprintf_r+0x1454>) + 8013248: 2710 movs r7, #16 + 801324a: e9dd 3227 ldrd r3, r2, [sp, #156] @ 0x9c + 801324e: 2d10 cmp r5, #16 + 8013250: f103 0301 add.w r3, r3, #1 + 8013254: 6026 str r6, [r4, #0] + 8013256: dc18 bgt.n 801328a <_vfprintf_r+0x13a2> + 8013258: 6065 str r5, [r4, #4] + 801325a: 2b07 cmp r3, #7 + 801325c: 4415 add r5, r2 + 801325e: e9cd 3527 strd r3, r5, [sp, #156] @ 0x9c + 8013262: f77f aa9a ble.w 801279a <_vfprintf_r+0x8b2> + 8013266: 9803 ldr r0, [sp, #12] + 8013268: aa26 add r2, sp, #152 @ 0x98 + 801326a: 4659 mov r1, fp + 801326c: f000 f8a8 bl 80133c0 <__sprint_r> + 8013270: 2800 cmp r0, #0 + 8013272: f43f aa92 beq.w 801279a <_vfprintf_r+0x8b2> + 8013276: f1ba 0f00 cmp.w sl, #0 + 801327a: f43f a892 beq.w 80123a2 <_vfprintf_r+0x4ba> + 801327e: 9803 ldr r0, [sp, #12] + 8013280: 4651 mov r1, sl + 8013282: f7fe fb29 bl 80118d8 <_free_r> + 8013286: f7ff b88c b.w 80123a2 <_vfprintf_r+0x4ba> + 801328a: 3210 adds r2, #16 + 801328c: 2b07 cmp r3, #7 + 801328e: e9cd 3227 strd r3, r2, [sp, #156] @ 0x9c + 8013292: 6067 str r7, [r4, #4] + 8013294: dc02 bgt.n 801329c <_vfprintf_r+0x13b4> + 8013296: 3408 adds r4, #8 + 8013298: 3d10 subs r5, #16 + 801329a: e7d6 b.n 801324a <_vfprintf_r+0x1362> + 801329c: 9803 ldr r0, [sp, #12] + 801329e: aa26 add r2, sp, #152 @ 0x98 + 80132a0: 4659 mov r1, fp + 80132a2: f000 f88d bl 80133c0 <__sprint_r> + 80132a6: 2800 cmp r0, #0 + 80132a8: d1e5 bne.n 8013276 <_vfprintf_r+0x138e> + 80132aa: ac29 add r4, sp, #164 @ 0xa4 + 80132ac: e7f4 b.n 8013298 <_vfprintf_r+0x13b0> + 80132ae: 9803 ldr r0, [sp, #12] + 80132b0: 4651 mov r1, sl + 80132b2: f7fe fb11 bl 80118d8 <_free_r> + 80132b6: f7ff ba88 b.w 80127ca <_vfprintf_r+0x8e2> + 80132ba: 9b28 ldr r3, [sp, #160] @ 0xa0 + 80132bc: b91b cbnz r3, 80132c6 <_vfprintf_r+0x13de> + 80132be: 2300 movs r3, #0 + 80132c0: 9327 str r3, [sp, #156] @ 0x9c + 80132c2: f7ff b86e b.w 80123a2 <_vfprintf_r+0x4ba> + 80132c6: 9803 ldr r0, [sp, #12] + 80132c8: aa26 add r2, sp, #152 @ 0x98 + 80132ca: 4659 mov r1, fp + 80132cc: f000 f878 bl 80133c0 <__sprint_r> + 80132d0: 2800 cmp r0, #0 + 80132d2: d0f4 beq.n 80132be <_vfprintf_r+0x13d6> + 80132d4: f7ff b865 b.w 80123a2 <_vfprintf_r+0x4ba> + 80132d8: ea56 0207 orrs.w r2, r6, r7 + 80132dc: 9508 str r5, [sp, #32] + 80132de: f43f ab75 beq.w 80129cc <_vfprintf_r+0xae4> + 80132e2: 2b01 cmp r3, #1 + 80132e4: f43f abf6 beq.w 8012ad4 <_vfprintf_r+0xbec> + 80132e8: 2b02 cmp r3, #2 + 80132ea: f50d 78a4 add.w r8, sp, #328 @ 0x148 + 80132ee: f43f ac3a beq.w 8012b66 <_vfprintf_r+0xc7e> + 80132f2: f006 0307 and.w r3, r6, #7 + 80132f6: 08f6 lsrs r6, r6, #3 + 80132f8: ea46 7647 orr.w r6, r6, r7, lsl #29 + 80132fc: 08ff lsrs r7, r7, #3 + 80132fe: 3330 adds r3, #48 @ 0x30 + 8013300: ea56 0107 orrs.w r1, r6, r7 + 8013304: 4642 mov r2, r8 + 8013306: f808 3d01 strb.w r3, [r8, #-1]! + 801330a: d1f2 bne.n 80132f2 <_vfprintf_r+0x140a> + 801330c: 9908 ldr r1, [sp, #32] + 801330e: 07ce lsls r6, r1, #31 + 8013310: d506 bpl.n 8013320 <_vfprintf_r+0x1438> + 8013312: 2b30 cmp r3, #48 @ 0x30 + 8013314: d004 beq.n 8013320 <_vfprintf_r+0x1438> + 8013316: 2330 movs r3, #48 @ 0x30 + 8013318: f808 3c01 strb.w r3, [r8, #-1] + 801331c: f1a2 0802 sub.w r8, r2, #2 + 8013320: ab52 add r3, sp, #328 @ 0x148 + 8013322: 9d08 ldr r5, [sp, #32] + 8013324: f8cd 9040 str.w r9, [sp, #64] @ 0x40 + 8013328: f04f 0a00 mov.w sl, #0 + 801332c: eba3 0908 sub.w r9, r3, r8 + 8013330: 4657 mov r7, sl + 8013332: f8cd a020 str.w sl, [sp, #32] + 8013336: 4656 mov r6, sl + 8013338: f7ff b978 b.w 801262c <_vfprintf_r+0x744> + 801333c: 0801902f .word 0x0801902f + +08013340 <__sbprintf>: + 8013340: b5f0 push {r4, r5, r6, r7, lr} + 8013342: 461f mov r7, r3 + 8013344: 898b ldrh r3, [r1, #12] + 8013346: f2ad 4d6c subw sp, sp, #1132 @ 0x46c + 801334a: f023 0302 bic.w r3, r3, #2 + 801334e: f8ad 300c strh.w r3, [sp, #12] + 8013352: 6e4b ldr r3, [r1, #100] @ 0x64 + 8013354: 9319 str r3, [sp, #100] @ 0x64 + 8013356: 89cb ldrh r3, [r1, #14] + 8013358: f8ad 300e strh.w r3, [sp, #14] + 801335c: 69cb ldr r3, [r1, #28] + 801335e: 9307 str r3, [sp, #28] + 8013360: 6a4b ldr r3, [r1, #36] @ 0x24 + 8013362: 9309 str r3, [sp, #36] @ 0x24 + 8013364: ab1a add r3, sp, #104 @ 0x68 + 8013366: 9300 str r3, [sp, #0] + 8013368: 9304 str r3, [sp, #16] + 801336a: f44f 6380 mov.w r3, #1024 @ 0x400 + 801336e: 4615 mov r5, r2 + 8013370: 4606 mov r6, r0 + 8013372: 9302 str r3, [sp, #8] + 8013374: 9305 str r3, [sp, #20] + 8013376: a816 add r0, sp, #88 @ 0x58 + 8013378: 2300 movs r3, #0 + 801337a: 460c mov r4, r1 + 801337c: 9306 str r3, [sp, #24] + 801337e: f7fe fa33 bl 80117e8 <__retarget_lock_init_recursive> + 8013382: 462a mov r2, r5 + 8013384: 463b mov r3, r7 + 8013386: 4669 mov r1, sp + 8013388: 4630 mov r0, r6 + 801338a: f7fe fdad bl 8011ee8 <_vfprintf_r> + 801338e: 1e05 subs r5, r0, #0 + 8013390: db07 blt.n 80133a2 <__sbprintf+0x62> + 8013392: 4669 mov r1, sp + 8013394: 4630 mov r0, r6 + 8013396: f000 fdeb bl 8013f70 <_fflush_r> + 801339a: 2800 cmp r0, #0 + 801339c: bf18 it ne + 801339e: f04f 35ff movne.w r5, #4294967295 + 80133a2: f8bd 300c ldrh.w r3, [sp, #12] + 80133a6: 9816 ldr r0, [sp, #88] @ 0x58 + 80133a8: 065b lsls r3, r3, #25 + 80133aa: bf42 ittt mi + 80133ac: 89a3 ldrhmi r3, [r4, #12] + 80133ae: f043 0340 orrmi.w r3, r3, #64 @ 0x40 + 80133b2: 81a3 strhmi r3, [r4, #12] + 80133b4: f7fe fa19 bl 80117ea <__retarget_lock_close_recursive> + 80133b8: 4628 mov r0, r5 + 80133ba: f20d 4d6c addw sp, sp, #1132 @ 0x46c + 80133be: bdf0 pop {r4, r5, r6, r7, pc} + +080133c0 <__sprint_r>: + 80133c0: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 80133c4: 6893 ldr r3, [r2, #8] + 80133c6: 4680 mov r8, r0 + 80133c8: 460e mov r6, r1 + 80133ca: 4614 mov r4, r2 + 80133cc: b343 cbz r3, 8013420 <__sprint_r+0x60> + 80133ce: 6e4b ldr r3, [r1, #100] @ 0x64 + 80133d0: 049d lsls r5, r3, #18 + 80133d2: d522 bpl.n 801341a <__sprint_r+0x5a> + 80133d4: 6815 ldr r5, [r2, #0] + 80133d6: 68a0 ldr r0, [r4, #8] + 80133d8: 3508 adds r5, #8 + 80133da: b928 cbnz r0, 80133e8 <__sprint_r+0x28> + 80133dc: 2300 movs r3, #0 + 80133de: 60a3 str r3, [r4, #8] + 80133e0: 2300 movs r3, #0 + 80133e2: 6063 str r3, [r4, #4] + 80133e4: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} + 80133e8: e955 b702 ldrd fp, r7, [r5, #-8] + 80133ec: f04f 0900 mov.w r9, #0 + 80133f0: ea4f 0a97 mov.w sl, r7, lsr #2 + 80133f4: 45ca cmp sl, r9 + 80133f6: dc05 bgt.n 8013404 <__sprint_r+0x44> + 80133f8: 68a3 ldr r3, [r4, #8] + 80133fa: f027 0703 bic.w r7, r7, #3 + 80133fe: 1bdb subs r3, r3, r7 + 8013400: 60a3 str r3, [r4, #8] + 8013402: e7e8 b.n 80133d6 <__sprint_r+0x16> + 8013404: f85b 1029 ldr.w r1, [fp, r9, lsl #2] + 8013408: 4632 mov r2, r6 + 801340a: 4640 mov r0, r8 + 801340c: f000 ffb9 bl 8014382 <_fputwc_r> + 8013410: 1c43 adds r3, r0, #1 + 8013412: d0e3 beq.n 80133dc <__sprint_r+0x1c> + 8013414: f109 0901 add.w r9, r9, #1 + 8013418: e7ec b.n 80133f4 <__sprint_r+0x34> + 801341a: f000 fdcf bl 8013fbc <__sfvwrite_r> + 801341e: e7dd b.n 80133dc <__sprint_r+0x1c> + 8013420: 4618 mov r0, r3 + 8013422: e7dd b.n 80133e0 <__sprint_r+0x20> + +08013424 <_vfiprintf_r>: + 8013424: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8013428: b0bb sub sp, #236 @ 0xec + 801342a: 460f mov r7, r1 + 801342c: 4693 mov fp, r2 + 801342e: 461c mov r4, r3 + 8013430: 461d mov r5, r3 + 8013432: 9000 str r0, [sp, #0] + 8013434: b118 cbz r0, 801343e <_vfiprintf_r+0x1a> + 8013436: 6b43 ldr r3, [r0, #52] @ 0x34 + 8013438: b90b cbnz r3, 801343e <_vfiprintf_r+0x1a> + 801343a: f7fe f8a7 bl 801158c <__sinit> + 801343e: 6e7b ldr r3, [r7, #100] @ 0x64 + 8013440: 07db lsls r3, r3, #31 + 8013442: d405 bmi.n 8013450 <_vfiprintf_r+0x2c> + 8013444: 89bb ldrh r3, [r7, #12] + 8013446: 059e lsls r6, r3, #22 + 8013448: d402 bmi.n 8013450 <_vfiprintf_r+0x2c> + 801344a: 6db8 ldr r0, [r7, #88] @ 0x58 + 801344c: f7fe f9ce bl 80117ec <__retarget_lock_acquire_recursive> + 8013450: f9b7 300c ldrsh.w r3, [r7, #12] + 8013454: 0498 lsls r0, r3, #18 + 8013456: d406 bmi.n 8013466 <_vfiprintf_r+0x42> + 8013458: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 801345c: 81bb strh r3, [r7, #12] + 801345e: 6e7b ldr r3, [r7, #100] @ 0x64 + 8013460: f423 5300 bic.w r3, r3, #8192 @ 0x2000 + 8013464: 667b str r3, [r7, #100] @ 0x64 + 8013466: 89bb ldrh r3, [r7, #12] + 8013468: 0719 lsls r1, r3, #28 + 801346a: d501 bpl.n 8013470 <_vfiprintf_r+0x4c> + 801346c: 693b ldr r3, [r7, #16] + 801346e: b9ab cbnz r3, 801349c <_vfiprintf_r+0x78> + 8013470: 9800 ldr r0, [sp, #0] + 8013472: 4639 mov r1, r7 + 8013474: f000 feee bl 8014254 <__swsetup_r> + 8013478: b180 cbz r0, 801349c <_vfiprintf_r+0x78> + 801347a: 6e7b ldr r3, [r7, #100] @ 0x64 + 801347c: 07da lsls r2, r3, #31 + 801347e: d506 bpl.n 801348e <_vfiprintf_r+0x6a> + 8013480: f04f 33ff mov.w r3, #4294967295 + 8013484: 9303 str r3, [sp, #12] + 8013486: 9803 ldr r0, [sp, #12] + 8013488: b03b add sp, #236 @ 0xec + 801348a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 801348e: 89bb ldrh r3, [r7, #12] + 8013490: 059b lsls r3, r3, #22 + 8013492: d4f5 bmi.n 8013480 <_vfiprintf_r+0x5c> + 8013494: 6db8 ldr r0, [r7, #88] @ 0x58 + 8013496: f7fe f9aa bl 80117ee <__retarget_lock_release_recursive> + 801349a: e7f1 b.n 8013480 <_vfiprintf_r+0x5c> + 801349c: f9b7 300c ldrsh.w r3, [r7, #12] + 80134a0: f003 021a and.w r2, r3, #26 + 80134a4: 2a0a cmp r2, #10 + 80134a6: d114 bne.n 80134d2 <_vfiprintf_r+0xae> + 80134a8: f9b7 200e ldrsh.w r2, [r7, #14] + 80134ac: 2a00 cmp r2, #0 + 80134ae: db10 blt.n 80134d2 <_vfiprintf_r+0xae> + 80134b0: 6e7a ldr r2, [r7, #100] @ 0x64 + 80134b2: 07d6 lsls r6, r2, #31 + 80134b4: d404 bmi.n 80134c0 <_vfiprintf_r+0x9c> + 80134b6: 059d lsls r5, r3, #22 + 80134b8: d402 bmi.n 80134c0 <_vfiprintf_r+0x9c> + 80134ba: 6db8 ldr r0, [r7, #88] @ 0x58 + 80134bc: f7fe f997 bl 80117ee <__retarget_lock_release_recursive> + 80134c0: 9800 ldr r0, [sp, #0] + 80134c2: 4623 mov r3, r4 + 80134c4: 465a mov r2, fp + 80134c6: 4639 mov r1, r7 + 80134c8: b03b add sp, #236 @ 0xec + 80134ca: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 80134ce: f000 bc31 b.w 8013d34 <__sbprintf> + 80134d2: 2300 movs r3, #0 + 80134d4: e9cd 330f strd r3, r3, [sp, #60] @ 0x3c + 80134d8: e9cd 3305 strd r3, r3, [sp, #20] + 80134dc: ae11 add r6, sp, #68 @ 0x44 + 80134de: 960e str r6, [sp, #56] @ 0x38 + 80134e0: 9307 str r3, [sp, #28] + 80134e2: 9309 str r3, [sp, #36] @ 0x24 + 80134e4: 9303 str r3, [sp, #12] + 80134e6: 465b mov r3, fp + 80134e8: 461c mov r4, r3 + 80134ea: f813 2b01 ldrb.w r2, [r3], #1 + 80134ee: b10a cbz r2, 80134f4 <_vfiprintf_r+0xd0> + 80134f0: 2a25 cmp r2, #37 @ 0x25 + 80134f2: d1f9 bne.n 80134e8 <_vfiprintf_r+0xc4> + 80134f4: ebb4 080b subs.w r8, r4, fp + 80134f8: d00d beq.n 8013516 <_vfiprintf_r+0xf2> + 80134fa: 9b10 ldr r3, [sp, #64] @ 0x40 + 80134fc: 4443 add r3, r8 + 80134fe: 9310 str r3, [sp, #64] @ 0x40 + 8013500: 9b0f ldr r3, [sp, #60] @ 0x3c + 8013502: 3301 adds r3, #1 + 8013504: 2b07 cmp r3, #7 + 8013506: e9c6 b800 strd fp, r8, [r6] + 801350a: 930f str r3, [sp, #60] @ 0x3c + 801350c: dc75 bgt.n 80135fa <_vfiprintf_r+0x1d6> + 801350e: 3608 adds r6, #8 + 8013510: 9b03 ldr r3, [sp, #12] + 8013512: 4443 add r3, r8 + 8013514: 9303 str r3, [sp, #12] + 8013516: 7823 ldrb r3, [r4, #0] + 8013518: 2b00 cmp r3, #0 + 801351a: f000 83cd beq.w 8013cb8 <_vfiprintf_r+0x894> + 801351e: 2300 movs r3, #0 + 8013520: f04f 32ff mov.w r2, #4294967295 + 8013524: e9cd 2301 strd r2, r3, [sp, #4] + 8013528: 3401 adds r4, #1 + 801352a: f88d 3033 strb.w r3, [sp, #51] @ 0x33 + 801352e: 469a mov sl, r3 + 8013530: 46a3 mov fp, r4 + 8013532: f81b 3b01 ldrb.w r3, [fp], #1 + 8013536: f1a3 0220 sub.w r2, r3, #32 + 801353a: 2a5a cmp r2, #90 @ 0x5a + 801353c: f200 8316 bhi.w 8013b6c <_vfiprintf_r+0x748> + 8013540: e8df f012 tbh [pc, r2, lsl #1] + 8013544: 0314009a .word 0x0314009a + 8013548: 00a20314 .word 0x00a20314 + 801354c: 03140314 .word 0x03140314 + 8013550: 00820314 .word 0x00820314 + 8013554: 03140314 .word 0x03140314 + 8013558: 00af00a5 .word 0x00af00a5 + 801355c: 00ac0314 .word 0x00ac0314 + 8013560: 031400b1 .word 0x031400b1 + 8013564: 00d000cd .word 0x00d000cd + 8013568: 00d000d0 .word 0x00d000d0 + 801356c: 00d000d0 .word 0x00d000d0 + 8013570: 00d000d0 .word 0x00d000d0 + 8013574: 00d000d0 .word 0x00d000d0 + 8013578: 03140314 .word 0x03140314 + 801357c: 03140314 .word 0x03140314 + 8013580: 03140314 .word 0x03140314 + 8013584: 03140314 .word 0x03140314 + 8013588: 00f70314 .word 0x00f70314 + 801358c: 03140104 .word 0x03140104 + 8013590: 03140314 .word 0x03140314 + 8013594: 03140314 .word 0x03140314 + 8013598: 03140314 .word 0x03140314 + 801359c: 03140314 .word 0x03140314 + 80135a0: 01520314 .word 0x01520314 + 80135a4: 03140314 .word 0x03140314 + 80135a8: 019a0314 .word 0x019a0314 + 80135ac: 027a0314 .word 0x027a0314 + 80135b0: 03140314 .word 0x03140314 + 80135b4: 0314029a .word 0x0314029a + 80135b8: 03140314 .word 0x03140314 + 80135bc: 03140314 .word 0x03140314 + 80135c0: 03140314 .word 0x03140314 + 80135c4: 03140314 .word 0x03140314 + 80135c8: 00f70314 .word 0x00f70314 + 80135cc: 03140106 .word 0x03140106 + 80135d0: 03140314 .word 0x03140314 + 80135d4: 010600e0 .word 0x010600e0 + 80135d8: 031400f1 .word 0x031400f1 + 80135dc: 031400eb .word 0x031400eb + 80135e0: 01540132 .word 0x01540132 + 80135e4: 00f10189 .word 0x00f10189 + 80135e8: 019a0314 .word 0x019a0314 + 80135ec: 027c0098 .word 0x027c0098 + 80135f0: 03140314 .word 0x03140314 + 80135f4: 03140065 .word 0x03140065 + 80135f8: 0098 .short 0x0098 + 80135fa: 9800 ldr r0, [sp, #0] + 80135fc: aa0e add r2, sp, #56 @ 0x38 + 80135fe: 4639 mov r1, r7 + 8013600: f7ff fede bl 80133c0 <__sprint_r> + 8013604: 2800 cmp r0, #0 + 8013606: f040 8336 bne.w 8013c76 <_vfiprintf_r+0x852> + 801360a: ae11 add r6, sp, #68 @ 0x44 + 801360c: e780 b.n 8013510 <_vfiprintf_r+0xec> + 801360e: 4a99 ldr r2, [pc, #612] @ (8013874 <_vfiprintf_r+0x450>) + 8013610: 9205 str r2, [sp, #20] + 8013612: f01a 0220 ands.w r2, sl, #32 + 8013616: f000 8231 beq.w 8013a7c <_vfiprintf_r+0x658> + 801361a: 3507 adds r5, #7 + 801361c: f025 0507 bic.w r5, r5, #7 + 8013620: 46a8 mov r8, r5 + 8013622: 686d ldr r5, [r5, #4] + 8013624: f858 4b08 ldr.w r4, [r8], #8 + 8013628: f01a 0f01 tst.w sl, #1 + 801362c: d009 beq.n 8013642 <_vfiprintf_r+0x21e> + 801362e: ea54 0205 orrs.w r2, r4, r5 + 8013632: bf1f itttt ne + 8013634: 2230 movne r2, #48 @ 0x30 + 8013636: f88d 2034 strbne.w r2, [sp, #52] @ 0x34 + 801363a: f88d 3035 strbne.w r3, [sp, #53] @ 0x35 + 801363e: f04a 0a02 orrne.w sl, sl, #2 + 8013642: f42a 6a80 bic.w sl, sl, #1024 @ 0x400 + 8013646: e112 b.n 801386e <_vfiprintf_r+0x44a> + 8013648: 9800 ldr r0, [sp, #0] + 801364a: f000 fedd bl 8014408 <_localeconv_r> + 801364e: 6843 ldr r3, [r0, #4] + 8013650: 9309 str r3, [sp, #36] @ 0x24 + 8013652: 4618 mov r0, r3 + 8013654: f7ec fdcc bl 80001f0 + 8013658: 9007 str r0, [sp, #28] + 801365a: 9800 ldr r0, [sp, #0] + 801365c: f000 fed4 bl 8014408 <_localeconv_r> + 8013660: 6883 ldr r3, [r0, #8] + 8013662: 9306 str r3, [sp, #24] + 8013664: 9b07 ldr r3, [sp, #28] + 8013666: b12b cbz r3, 8013674 <_vfiprintf_r+0x250> + 8013668: 9b06 ldr r3, [sp, #24] + 801366a: b11b cbz r3, 8013674 <_vfiprintf_r+0x250> + 801366c: 781b ldrb r3, [r3, #0] + 801366e: b10b cbz r3, 8013674 <_vfiprintf_r+0x250> + 8013670: f44a 6a80 orr.w sl, sl, #1024 @ 0x400 + 8013674: 465c mov r4, fp + 8013676: e75b b.n 8013530 <_vfiprintf_r+0x10c> + 8013678: f89d 3033 ldrb.w r3, [sp, #51] @ 0x33 + 801367c: 2b00 cmp r3, #0 + 801367e: d1f9 bne.n 8013674 <_vfiprintf_r+0x250> + 8013680: 2320 movs r3, #32 + 8013682: f88d 3033 strb.w r3, [sp, #51] @ 0x33 + 8013686: e7f5 b.n 8013674 <_vfiprintf_r+0x250> + 8013688: f04a 0a01 orr.w sl, sl, #1 + 801368c: e7f2 b.n 8013674 <_vfiprintf_r+0x250> + 801368e: f855 3b04 ldr.w r3, [r5], #4 + 8013692: 9302 str r3, [sp, #8] + 8013694: 2b00 cmp r3, #0 + 8013696: daed bge.n 8013674 <_vfiprintf_r+0x250> + 8013698: 425b negs r3, r3 + 801369a: 9302 str r3, [sp, #8] + 801369c: f04a 0a04 orr.w sl, sl, #4 + 80136a0: e7e8 b.n 8013674 <_vfiprintf_r+0x250> + 80136a2: 232b movs r3, #43 @ 0x2b + 80136a4: e7ed b.n 8013682 <_vfiprintf_r+0x25e> + 80136a6: 465a mov r2, fp + 80136a8: f812 3b01 ldrb.w r3, [r2], #1 + 80136ac: 2b2a cmp r3, #42 @ 0x2a + 80136ae: d112 bne.n 80136d6 <_vfiprintf_r+0x2b2> + 80136b0: f855 3b04 ldr.w r3, [r5], #4 + 80136b4: ea43 73e3 orr.w r3, r3, r3, asr #31 + 80136b8: 9301 str r3, [sp, #4] + 80136ba: 4693 mov fp, r2 + 80136bc: e7da b.n 8013674 <_vfiprintf_r+0x250> + 80136be: 9b01 ldr r3, [sp, #4] + 80136c0: fb00 1303 mla r3, r0, r3, r1 + 80136c4: 9301 str r3, [sp, #4] + 80136c6: f812 3b01 ldrb.w r3, [r2], #1 + 80136ca: f1a3 0130 sub.w r1, r3, #48 @ 0x30 + 80136ce: 2909 cmp r1, #9 + 80136d0: d9f5 bls.n 80136be <_vfiprintf_r+0x29a> + 80136d2: 4693 mov fp, r2 + 80136d4: e72f b.n 8013536 <_vfiprintf_r+0x112> + 80136d6: 2100 movs r1, #0 + 80136d8: 9101 str r1, [sp, #4] + 80136da: 200a movs r0, #10 + 80136dc: e7f5 b.n 80136ca <_vfiprintf_r+0x2a6> + 80136de: f04a 0a80 orr.w sl, sl, #128 @ 0x80 + 80136e2: e7c7 b.n 8013674 <_vfiprintf_r+0x250> + 80136e4: 2100 movs r1, #0 + 80136e6: 465a mov r2, fp + 80136e8: 9102 str r1, [sp, #8] + 80136ea: 200a movs r0, #10 + 80136ec: 9902 ldr r1, [sp, #8] + 80136ee: 3b30 subs r3, #48 @ 0x30 + 80136f0: fb00 3301 mla r3, r0, r1, r3 + 80136f4: 9302 str r3, [sp, #8] + 80136f6: f812 3b01 ldrb.w r3, [r2], #1 + 80136fa: f1a3 0130 sub.w r1, r3, #48 @ 0x30 + 80136fe: 2909 cmp r1, #9 + 8013700: d9f4 bls.n 80136ec <_vfiprintf_r+0x2c8> + 8013702: e7e6 b.n 80136d2 <_vfiprintf_r+0x2ae> + 8013704: f89b 3000 ldrb.w r3, [fp] + 8013708: 2b68 cmp r3, #104 @ 0x68 + 801370a: bf06 itte eq + 801370c: f10b 0b01 addeq.w fp, fp, #1 + 8013710: f44a 7a00 orreq.w sl, sl, #512 @ 0x200 + 8013714: f04a 0a40 orrne.w sl, sl, #64 @ 0x40 + 8013718: e7ac b.n 8013674 <_vfiprintf_r+0x250> + 801371a: f89b 3000 ldrb.w r3, [fp] + 801371e: 2b6c cmp r3, #108 @ 0x6c + 8013720: d104 bne.n 801372c <_vfiprintf_r+0x308> + 8013722: f10b 0b01 add.w fp, fp, #1 + 8013726: f04a 0a20 orr.w sl, sl, #32 + 801372a: e7a3 b.n 8013674 <_vfiprintf_r+0x250> + 801372c: f04a 0a10 orr.w sl, sl, #16 + 8013730: e7a0 b.n 8013674 <_vfiprintf_r+0x250> + 8013732: 46a8 mov r8, r5 + 8013734: 2400 movs r4, #0 + 8013736: f858 3b04 ldr.w r3, [r8], #4 + 801373a: f88d 3084 strb.w r3, [sp, #132] @ 0x84 + 801373e: f88d 4033 strb.w r4, [sp, #51] @ 0x33 + 8013742: 2301 movs r3, #1 + 8013744: 9301 str r3, [sp, #4] + 8013746: f10d 0984 add.w r9, sp, #132 @ 0x84 + 801374a: e0ab b.n 80138a4 <_vfiprintf_r+0x480> + 801374c: f04a 0a10 orr.w sl, sl, #16 + 8013750: f01a 0f20 tst.w sl, #32 + 8013754: d011 beq.n 801377a <_vfiprintf_r+0x356> + 8013756: 3507 adds r5, #7 + 8013758: f025 0507 bic.w r5, r5, #7 + 801375c: 46a8 mov r8, r5 + 801375e: 686d ldr r5, [r5, #4] + 8013760: f858 4b08 ldr.w r4, [r8], #8 + 8013764: 2d00 cmp r5, #0 + 8013766: da06 bge.n 8013776 <_vfiprintf_r+0x352> + 8013768: 4264 negs r4, r4 + 801376a: f04f 032d mov.w r3, #45 @ 0x2d + 801376e: eb65 0545 sbc.w r5, r5, r5, lsl #1 + 8013772: f88d 3033 strb.w r3, [sp, #51] @ 0x33 + 8013776: 2301 movs r3, #1 + 8013778: e048 b.n 801380c <_vfiprintf_r+0x3e8> + 801377a: 46a8 mov r8, r5 + 801377c: f01a 0f10 tst.w sl, #16 + 8013780: f858 5b04 ldr.w r5, [r8], #4 + 8013784: d002 beq.n 801378c <_vfiprintf_r+0x368> + 8013786: 462c mov r4, r5 + 8013788: 17ed asrs r5, r5, #31 + 801378a: e7eb b.n 8013764 <_vfiprintf_r+0x340> + 801378c: f01a 0f40 tst.w sl, #64 @ 0x40 + 8013790: d003 beq.n 801379a <_vfiprintf_r+0x376> + 8013792: b22c sxth r4, r5 + 8013794: f345 35c0 sbfx r5, r5, #15, #1 + 8013798: e7e4 b.n 8013764 <_vfiprintf_r+0x340> + 801379a: f41a 7f00 tst.w sl, #512 @ 0x200 + 801379e: d0f2 beq.n 8013786 <_vfiprintf_r+0x362> + 80137a0: b26c sxtb r4, r5 + 80137a2: f345 15c0 sbfx r5, r5, #7, #1 + 80137a6: e7dd b.n 8013764 <_vfiprintf_r+0x340> + 80137a8: f01a 0f20 tst.w sl, #32 + 80137ac: d007 beq.n 80137be <_vfiprintf_r+0x39a> + 80137ae: 9a03 ldr r2, [sp, #12] + 80137b0: 682b ldr r3, [r5, #0] + 80137b2: 9903 ldr r1, [sp, #12] + 80137b4: 17d2 asrs r2, r2, #31 + 80137b6: e9c3 1200 strd r1, r2, [r3] + 80137ba: 3504 adds r5, #4 + 80137bc: e693 b.n 80134e6 <_vfiprintf_r+0xc2> + 80137be: f01a 0f10 tst.w sl, #16 + 80137c2: d003 beq.n 80137cc <_vfiprintf_r+0x3a8> + 80137c4: 682b ldr r3, [r5, #0] + 80137c6: 9a03 ldr r2, [sp, #12] + 80137c8: 601a str r2, [r3, #0] + 80137ca: e7f6 b.n 80137ba <_vfiprintf_r+0x396> + 80137cc: f01a 0f40 tst.w sl, #64 @ 0x40 + 80137d0: d003 beq.n 80137da <_vfiprintf_r+0x3b6> + 80137d2: 682b ldr r3, [r5, #0] + 80137d4: 9a03 ldr r2, [sp, #12] + 80137d6: 801a strh r2, [r3, #0] + 80137d8: e7ef b.n 80137ba <_vfiprintf_r+0x396> + 80137da: f41a 7f00 tst.w sl, #512 @ 0x200 + 80137de: d0f1 beq.n 80137c4 <_vfiprintf_r+0x3a0> + 80137e0: 682b ldr r3, [r5, #0] + 80137e2: 9a03 ldr r2, [sp, #12] + 80137e4: 701a strb r2, [r3, #0] + 80137e6: e7e8 b.n 80137ba <_vfiprintf_r+0x396> + 80137e8: f04a 0a10 orr.w sl, sl, #16 + 80137ec: f01a 0320 ands.w r3, sl, #32 + 80137f0: d01f beq.n 8013832 <_vfiprintf_r+0x40e> + 80137f2: 3507 adds r5, #7 + 80137f4: f025 0507 bic.w r5, r5, #7 + 80137f8: 46a8 mov r8, r5 + 80137fa: 686d ldr r5, [r5, #4] + 80137fc: f858 4b08 ldr.w r4, [r8], #8 + 8013800: f42a 6a80 bic.w sl, sl, #1024 @ 0x400 + 8013804: 2300 movs r3, #0 + 8013806: 2200 movs r2, #0 + 8013808: f88d 2033 strb.w r2, [sp, #51] @ 0x33 + 801380c: 9a01 ldr r2, [sp, #4] + 801380e: 3201 adds r2, #1 + 8013810: f000 825f beq.w 8013cd2 <_vfiprintf_r+0x8ae> + 8013814: f02a 0280 bic.w r2, sl, #128 @ 0x80 + 8013818: 9204 str r2, [sp, #16] + 801381a: ea54 0205 orrs.w r2, r4, r5 + 801381e: f040 825e bne.w 8013cde <_vfiprintf_r+0x8ba> + 8013822: 9a01 ldr r2, [sp, #4] + 8013824: 2a00 cmp r2, #0 + 8013826: f000 8198 beq.w 8013b5a <_vfiprintf_r+0x736> + 801382a: 2b01 cmp r3, #1 + 801382c: f040 825a bne.w 8013ce4 <_vfiprintf_r+0x8c0> + 8013830: e13b b.n 8013aaa <_vfiprintf_r+0x686> + 8013832: 46a8 mov r8, r5 + 8013834: f01a 0510 ands.w r5, sl, #16 + 8013838: f858 4b04 ldr.w r4, [r8], #4 + 801383c: d001 beq.n 8013842 <_vfiprintf_r+0x41e> + 801383e: 461d mov r5, r3 + 8013840: e7de b.n 8013800 <_vfiprintf_r+0x3dc> + 8013842: f01a 0340 ands.w r3, sl, #64 @ 0x40 + 8013846: d001 beq.n 801384c <_vfiprintf_r+0x428> + 8013848: b2a4 uxth r4, r4 + 801384a: e7d9 b.n 8013800 <_vfiprintf_r+0x3dc> + 801384c: f41a 7500 ands.w r5, sl, #512 @ 0x200 + 8013850: d0d6 beq.n 8013800 <_vfiprintf_r+0x3dc> + 8013852: b2e4 uxtb r4, r4 + 8013854: e7f3 b.n 801383e <_vfiprintf_r+0x41a> + 8013856: 46a8 mov r8, r5 + 8013858: f647 0330 movw r3, #30768 @ 0x7830 + 801385c: f8ad 3034 strh.w r3, [sp, #52] @ 0x34 + 8013860: f858 4b04 ldr.w r4, [r8], #4 + 8013864: 4b03 ldr r3, [pc, #12] @ (8013874 <_vfiprintf_r+0x450>) + 8013866: 9305 str r3, [sp, #20] + 8013868: 2500 movs r5, #0 + 801386a: f04a 0a02 orr.w sl, sl, #2 + 801386e: 2302 movs r3, #2 + 8013870: e7c9 b.n 8013806 <_vfiprintf_r+0x3e2> + 8013872: bf00 nop + 8013874: 08018ffb .word 0x08018ffb + 8013878: 9b01 ldr r3, [sp, #4] + 801387a: 46a8 mov r8, r5 + 801387c: 1c5c adds r4, r3, #1 + 801387e: f04f 0500 mov.w r5, #0 + 8013882: f858 9b04 ldr.w r9, [r8], #4 + 8013886: f88d 5033 strb.w r5, [sp, #51] @ 0x33 + 801388a: f000 80d0 beq.w 8013a2e <_vfiprintf_r+0x60a> + 801388e: 461a mov r2, r3 + 8013890: 4629 mov r1, r5 + 8013892: 4648 mov r0, r9 + 8013894: f7ec fcb4 bl 8000200 + 8013898: 4604 mov r4, r0 + 801389a: b118 cbz r0, 80138a4 <_vfiprintf_r+0x480> + 801389c: eba0 0309 sub.w r3, r0, r9 + 80138a0: 9301 str r3, [sp, #4] + 80138a2: 462c mov r4, r5 + 80138a4: 9b01 ldr r3, [sp, #4] + 80138a6: 42a3 cmp r3, r4 + 80138a8: bfb8 it lt + 80138aa: 4623 movlt r3, r4 + 80138ac: 9304 str r3, [sp, #16] + 80138ae: f89d 3033 ldrb.w r3, [sp, #51] @ 0x33 + 80138b2: b113 cbz r3, 80138ba <_vfiprintf_r+0x496> + 80138b4: 9b04 ldr r3, [sp, #16] + 80138b6: 3301 adds r3, #1 + 80138b8: 9304 str r3, [sp, #16] + 80138ba: f01a 0302 ands.w r3, sl, #2 + 80138be: 9308 str r3, [sp, #32] + 80138c0: bf1e ittt ne + 80138c2: 9b04 ldrne r3, [sp, #16] + 80138c4: 3302 addne r3, #2 + 80138c6: 9304 strne r3, [sp, #16] + 80138c8: f01a 0384 ands.w r3, sl, #132 @ 0x84 + 80138cc: 930a str r3, [sp, #40] @ 0x28 + 80138ce: d11f bne.n 8013910 <_vfiprintf_r+0x4ec> + 80138d0: 9b02 ldr r3, [sp, #8] + 80138d2: 9a04 ldr r2, [sp, #16] + 80138d4: 1a9d subs r5, r3, r2 + 80138d6: 2d00 cmp r5, #0 + 80138d8: dd1a ble.n 8013910 <_vfiprintf_r+0x4ec> + 80138da: 4ba9 ldr r3, [pc, #676] @ (8013b80 <_vfiprintf_r+0x75c>) + 80138dc: 6033 str r3, [r6, #0] + 80138de: e9dd 2c0f ldrd r2, ip, [sp, #60] @ 0x3c + 80138e2: 2d10 cmp r5, #16 + 80138e4: f102 0201 add.w r2, r2, #1 + 80138e8: f106 0008 add.w r0, r6, #8 + 80138ec: f300 814e bgt.w 8013b8c <_vfiprintf_r+0x768> + 80138f0: 6075 str r5, [r6, #4] + 80138f2: 2a07 cmp r2, #7 + 80138f4: 4465 add r5, ip + 80138f6: e9cd 250f strd r2, r5, [sp, #60] @ 0x3c + 80138fa: f340 815a ble.w 8013bb2 <_vfiprintf_r+0x78e> + 80138fe: 9800 ldr r0, [sp, #0] + 8013900: aa0e add r2, sp, #56 @ 0x38 + 8013902: 4639 mov r1, r7 + 8013904: f7ff fd5c bl 80133c0 <__sprint_r> + 8013908: 2800 cmp r0, #0 + 801390a: f040 81b4 bne.w 8013c76 <_vfiprintf_r+0x852> + 801390e: ae11 add r6, sp, #68 @ 0x44 + 8013910: f89d 1033 ldrb.w r1, [sp, #51] @ 0x33 + 8013914: e9dd 320f ldrd r3, r2, [sp, #60] @ 0x3c + 8013918: b161 cbz r1, 8013934 <_vfiprintf_r+0x510> + 801391a: f10d 0133 add.w r1, sp, #51 @ 0x33 + 801391e: 3301 adds r3, #1 + 8013920: 6031 str r1, [r6, #0] + 8013922: 2101 movs r1, #1 + 8013924: 440a add r2, r1 + 8013926: 2b07 cmp r3, #7 + 8013928: e9cd 320f strd r3, r2, [sp, #60] @ 0x3c + 801392c: 6071 str r1, [r6, #4] + 801392e: f300 8142 bgt.w 8013bb6 <_vfiprintf_r+0x792> + 8013932: 3608 adds r6, #8 + 8013934: 9908 ldr r1, [sp, #32] + 8013936: e9dd 320f ldrd r3, r2, [sp, #60] @ 0x3c + 801393a: b159 cbz r1, 8013954 <_vfiprintf_r+0x530> + 801393c: a90d add r1, sp, #52 @ 0x34 + 801393e: 3301 adds r3, #1 + 8013940: 6031 str r1, [r6, #0] + 8013942: 2102 movs r1, #2 + 8013944: 440a add r2, r1 + 8013946: 2b07 cmp r3, #7 + 8013948: e9cd 320f strd r3, r2, [sp, #60] @ 0x3c + 801394c: 6071 str r1, [r6, #4] + 801394e: f300 813b bgt.w 8013bc8 <_vfiprintf_r+0x7a4> + 8013952: 3608 adds r6, #8 + 8013954: 9b0a ldr r3, [sp, #40] @ 0x28 + 8013956: 2b80 cmp r3, #128 @ 0x80 + 8013958: d11f bne.n 801399a <_vfiprintf_r+0x576> + 801395a: 9b02 ldr r3, [sp, #8] + 801395c: 9a04 ldr r2, [sp, #16] + 801395e: 1a9d subs r5, r3, r2 + 8013960: 2d00 cmp r5, #0 + 8013962: dd1a ble.n 801399a <_vfiprintf_r+0x576> + 8013964: 4b87 ldr r3, [pc, #540] @ (8013b84 <_vfiprintf_r+0x760>) + 8013966: 6033 str r3, [r6, #0] + 8013968: e9dd 2c0f ldrd r2, ip, [sp, #60] @ 0x3c + 801396c: 2d10 cmp r5, #16 + 801396e: f102 0201 add.w r2, r2, #1 + 8013972: f106 0008 add.w r0, r6, #8 + 8013976: f300 8130 bgt.w 8013bda <_vfiprintf_r+0x7b6> + 801397a: 6075 str r5, [r6, #4] + 801397c: 2a07 cmp r2, #7 + 801397e: 4465 add r5, ip + 8013980: e9cd 250f strd r2, r5, [sp, #60] @ 0x3c + 8013984: f340 813c ble.w 8013c00 <_vfiprintf_r+0x7dc> + 8013988: 9800 ldr r0, [sp, #0] + 801398a: aa0e add r2, sp, #56 @ 0x38 + 801398c: 4639 mov r1, r7 + 801398e: f7ff fd17 bl 80133c0 <__sprint_r> + 8013992: 2800 cmp r0, #0 + 8013994: f040 816f bne.w 8013c76 <_vfiprintf_r+0x852> + 8013998: ae11 add r6, sp, #68 @ 0x44 + 801399a: 9b01 ldr r3, [sp, #4] + 801399c: 1ae4 subs r4, r4, r3 + 801399e: 2c00 cmp r4, #0 + 80139a0: dd1a ble.n 80139d8 <_vfiprintf_r+0x5b4> + 80139a2: e9dd 320f ldrd r3, r2, [sp, #60] @ 0x3c + 80139a6: 4877 ldr r0, [pc, #476] @ (8013b84 <_vfiprintf_r+0x760>) + 80139a8: 6030 str r0, [r6, #0] + 80139aa: 2c10 cmp r4, #16 + 80139ac: f103 0301 add.w r3, r3, #1 + 80139b0: f106 0108 add.w r1, r6, #8 + 80139b4: f300 8126 bgt.w 8013c04 <_vfiprintf_r+0x7e0> + 80139b8: 6074 str r4, [r6, #4] + 80139ba: 2b07 cmp r3, #7 + 80139bc: 4414 add r4, r2 + 80139be: e9cd 340f strd r3, r4, [sp, #60] @ 0x3c + 80139c2: f340 8130 ble.w 8013c26 <_vfiprintf_r+0x802> + 80139c6: 9800 ldr r0, [sp, #0] + 80139c8: aa0e add r2, sp, #56 @ 0x38 + 80139ca: 4639 mov r1, r7 + 80139cc: f7ff fcf8 bl 80133c0 <__sprint_r> + 80139d0: 2800 cmp r0, #0 + 80139d2: f040 8150 bne.w 8013c76 <_vfiprintf_r+0x852> + 80139d6: ae11 add r6, sp, #68 @ 0x44 + 80139d8: 9b01 ldr r3, [sp, #4] + 80139da: 9a01 ldr r2, [sp, #4] + 80139dc: 6073 str r3, [r6, #4] + 80139de: 9b10 ldr r3, [sp, #64] @ 0x40 + 80139e0: f8c6 9000 str.w r9, [r6] + 80139e4: 4413 add r3, r2 + 80139e6: 9310 str r3, [sp, #64] @ 0x40 + 80139e8: 9b0f ldr r3, [sp, #60] @ 0x3c + 80139ea: 3301 adds r3, #1 + 80139ec: 2b07 cmp r3, #7 + 80139ee: 930f str r3, [sp, #60] @ 0x3c + 80139f0: f300 811b bgt.w 8013c2a <_vfiprintf_r+0x806> + 80139f4: f106 0308 add.w r3, r6, #8 + 80139f8: f01a 0f04 tst.w sl, #4 + 80139fc: f040 811d bne.w 8013c3a <_vfiprintf_r+0x816> + 8013a00: e9dd 2302 ldrd r2, r3, [sp, #8] + 8013a04: 9904 ldr r1, [sp, #16] + 8013a06: 428a cmp r2, r1 + 8013a08: bfac ite ge + 8013a0a: 189b addge r3, r3, r2 + 8013a0c: 185b addlt r3, r3, r1 + 8013a0e: 9303 str r3, [sp, #12] + 8013a10: 9b10 ldr r3, [sp, #64] @ 0x40 + 8013a12: b13b cbz r3, 8013a24 <_vfiprintf_r+0x600> + 8013a14: 9800 ldr r0, [sp, #0] + 8013a16: aa0e add r2, sp, #56 @ 0x38 + 8013a18: 4639 mov r1, r7 + 8013a1a: f7ff fcd1 bl 80133c0 <__sprint_r> + 8013a1e: 2800 cmp r0, #0 + 8013a20: f040 8129 bne.w 8013c76 <_vfiprintf_r+0x852> + 8013a24: 2300 movs r3, #0 + 8013a26: 930f str r3, [sp, #60] @ 0x3c + 8013a28: 4645 mov r5, r8 + 8013a2a: ae11 add r6, sp, #68 @ 0x44 + 8013a2c: e55b b.n 80134e6 <_vfiprintf_r+0xc2> + 8013a2e: 4648 mov r0, r9 + 8013a30: f7ec fbde bl 80001f0 + 8013a34: 9001 str r0, [sp, #4] + 8013a36: e734 b.n 80138a2 <_vfiprintf_r+0x47e> + 8013a38: f04a 0a10 orr.w sl, sl, #16 + 8013a3c: f01a 0320 ands.w r3, sl, #32 + 8013a40: d008 beq.n 8013a54 <_vfiprintf_r+0x630> + 8013a42: 3507 adds r5, #7 + 8013a44: f025 0507 bic.w r5, r5, #7 + 8013a48: 46a8 mov r8, r5 + 8013a4a: 686d ldr r5, [r5, #4] + 8013a4c: f858 4b08 ldr.w r4, [r8], #8 + 8013a50: 2301 movs r3, #1 + 8013a52: e6d8 b.n 8013806 <_vfiprintf_r+0x3e2> + 8013a54: 46a8 mov r8, r5 + 8013a56: f01a 0510 ands.w r5, sl, #16 + 8013a5a: f858 4b04 ldr.w r4, [r8], #4 + 8013a5e: d001 beq.n 8013a64 <_vfiprintf_r+0x640> + 8013a60: 461d mov r5, r3 + 8013a62: e7f5 b.n 8013a50 <_vfiprintf_r+0x62c> + 8013a64: f01a 0340 ands.w r3, sl, #64 @ 0x40 + 8013a68: d001 beq.n 8013a6e <_vfiprintf_r+0x64a> + 8013a6a: b2a4 uxth r4, r4 + 8013a6c: e7f0 b.n 8013a50 <_vfiprintf_r+0x62c> + 8013a6e: f41a 7500 ands.w r5, sl, #512 @ 0x200 + 8013a72: d0ed beq.n 8013a50 <_vfiprintf_r+0x62c> + 8013a74: b2e4 uxtb r4, r4 + 8013a76: e7f3 b.n 8013a60 <_vfiprintf_r+0x63c> + 8013a78: 4a43 ldr r2, [pc, #268] @ (8013b88 <_vfiprintf_r+0x764>) + 8013a7a: e5c9 b.n 8013610 <_vfiprintf_r+0x1ec> + 8013a7c: 46a8 mov r8, r5 + 8013a7e: f01a 0510 ands.w r5, sl, #16 + 8013a82: f858 4b04 ldr.w r4, [r8], #4 + 8013a86: d001 beq.n 8013a8c <_vfiprintf_r+0x668> + 8013a88: 4615 mov r5, r2 + 8013a8a: e5cd b.n 8013628 <_vfiprintf_r+0x204> + 8013a8c: f01a 0240 ands.w r2, sl, #64 @ 0x40 + 8013a90: d001 beq.n 8013a96 <_vfiprintf_r+0x672> + 8013a92: b2a4 uxth r4, r4 + 8013a94: e5c8 b.n 8013628 <_vfiprintf_r+0x204> + 8013a96: f41a 7500 ands.w r5, sl, #512 @ 0x200 + 8013a9a: f43f adc5 beq.w 8013628 <_vfiprintf_r+0x204> + 8013a9e: b2e4 uxtb r4, r4 + 8013aa0: e7f2 b.n 8013a88 <_vfiprintf_r+0x664> + 8013aa2: 2c0a cmp r4, #10 + 8013aa4: f175 0300 sbcs.w r3, r5, #0 + 8013aa8: d206 bcs.n 8013ab8 <_vfiprintf_r+0x694> + 8013aaa: 3430 adds r4, #48 @ 0x30 + 8013aac: b2e4 uxtb r4, r4 + 8013aae: f88d 40e7 strb.w r4, [sp, #231] @ 0xe7 + 8013ab2: f10d 09e7 add.w r9, sp, #231 @ 0xe7 + 8013ab6: e131 b.n 8013d1c <_vfiprintf_r+0x8f8> + 8013ab8: ab3a add r3, sp, #232 @ 0xe8 + 8013aba: 9308 str r3, [sp, #32] + 8013abc: 9b04 ldr r3, [sp, #16] + 8013abe: f403 6380 and.w r3, r3, #1024 @ 0x400 + 8013ac2: f04f 0a00 mov.w sl, #0 + 8013ac6: 930a str r3, [sp, #40] @ 0x28 + 8013ac8: 220a movs r2, #10 + 8013aca: 2300 movs r3, #0 + 8013acc: 4620 mov r0, r4 + 8013ace: 4629 mov r1, r5 + 8013ad0: f7ed f87a bl 8000bc8 <__aeabi_uldivmod> + 8013ad4: 460b mov r3, r1 + 8013ad6: 9908 ldr r1, [sp, #32] + 8013ad8: 900b str r0, [sp, #44] @ 0x2c + 8013ada: 3230 adds r2, #48 @ 0x30 + 8013adc: f801 2c01 strb.w r2, [r1, #-1] + 8013ae0: 9a0a ldr r2, [sp, #40] @ 0x28 + 8013ae2: f101 39ff add.w r9, r1, #4294967295 + 8013ae6: f10a 0a01 add.w sl, sl, #1 + 8013aea: b1e2 cbz r2, 8013b26 <_vfiprintf_r+0x702> + 8013aec: 9a06 ldr r2, [sp, #24] + 8013aee: 7812 ldrb r2, [r2, #0] + 8013af0: 4552 cmp r2, sl + 8013af2: d118 bne.n 8013b26 <_vfiprintf_r+0x702> + 8013af4: f1ba 0fff cmp.w sl, #255 @ 0xff + 8013af8: d015 beq.n 8013b26 <_vfiprintf_r+0x702> + 8013afa: 2c0a cmp r4, #10 + 8013afc: f175 0200 sbcs.w r2, r5, #0 + 8013b00: d311 bcc.n 8013b26 <_vfiprintf_r+0x702> + 8013b02: 9308 str r3, [sp, #32] + 8013b04: 9b07 ldr r3, [sp, #28] + 8013b06: 9909 ldr r1, [sp, #36] @ 0x24 + 8013b08: eba9 0903 sub.w r9, r9, r3 + 8013b0c: 461a mov r2, r3 + 8013b0e: 4648 mov r0, r9 + 8013b10: f000 fc60 bl 80143d4 + 8013b14: 9b06 ldr r3, [sp, #24] + 8013b16: 785a ldrb r2, [r3, #1] + 8013b18: 9b08 ldr r3, [sp, #32] + 8013b1a: b172 cbz r2, 8013b3a <_vfiprintf_r+0x716> + 8013b1c: 9a06 ldr r2, [sp, #24] + 8013b1e: 3201 adds r2, #1 + 8013b20: 9206 str r2, [sp, #24] + 8013b22: f04f 0a00 mov.w sl, #0 + 8013b26: 2c0a cmp r4, #10 + 8013b28: f175 0500 sbcs.w r5, r5, #0 + 8013b2c: f0c0 80f6 bcc.w 8013d1c <_vfiprintf_r+0x8f8> + 8013b30: 9c0b ldr r4, [sp, #44] @ 0x2c + 8013b32: f8cd 9020 str.w r9, [sp, #32] + 8013b36: 461d mov r5, r3 + 8013b38: e7c6 b.n 8013ac8 <_vfiprintf_r+0x6a4> + 8013b3a: 4692 mov sl, r2 + 8013b3c: e7f3 b.n 8013b26 <_vfiprintf_r+0x702> + 8013b3e: f004 030f and.w r3, r4, #15 + 8013b42: 9a05 ldr r2, [sp, #20] + 8013b44: 0924 lsrs r4, r4, #4 + 8013b46: 5cd3 ldrb r3, [r2, r3] + 8013b48: f809 3d01 strb.w r3, [r9, #-1]! + 8013b4c: ea44 7405 orr.w r4, r4, r5, lsl #28 + 8013b50: 092d lsrs r5, r5, #4 + 8013b52: ea54 0305 orrs.w r3, r4, r5 + 8013b56: d1f2 bne.n 8013b3e <_vfiprintf_r+0x71a> + 8013b58: e0e0 b.n 8013d1c <_vfiprintf_r+0x8f8> + 8013b5a: b923 cbnz r3, 8013b66 <_vfiprintf_r+0x742> + 8013b5c: f01a 0f01 tst.w sl, #1 + 8013b60: d001 beq.n 8013b66 <_vfiprintf_r+0x742> + 8013b62: 2430 movs r4, #48 @ 0x30 + 8013b64: e7a3 b.n 8013aae <_vfiprintf_r+0x68a> + 8013b66: f10d 09e8 add.w r9, sp, #232 @ 0xe8 + 8013b6a: e0d7 b.n 8013d1c <_vfiprintf_r+0x8f8> + 8013b6c: 2b00 cmp r3, #0 + 8013b6e: f000 80a3 beq.w 8013cb8 <_vfiprintf_r+0x894> + 8013b72: 2400 movs r4, #0 + 8013b74: f88d 3084 strb.w r3, [sp, #132] @ 0x84 + 8013b78: f88d 4033 strb.w r4, [sp, #51] @ 0x33 + 8013b7c: 46a8 mov r8, r5 + 8013b7e: e5e0 b.n 8013742 <_vfiprintf_r+0x31e> + 8013b80: 0801904f .word 0x0801904f + 8013b84: 0801903f .word 0x0801903f + 8013b88: 0801900c .word 0x0801900c + 8013b8c: 2110 movs r1, #16 + 8013b8e: 6071 str r1, [r6, #4] + 8013b90: 2a07 cmp r2, #7 + 8013b92: 4461 add r1, ip + 8013b94: e9cd 210f strd r2, r1, [sp, #60] @ 0x3c + 8013b98: dd08 ble.n 8013bac <_vfiprintf_r+0x788> + 8013b9a: 9800 ldr r0, [sp, #0] + 8013b9c: aa0e add r2, sp, #56 @ 0x38 + 8013b9e: 4639 mov r1, r7 + 8013ba0: f7ff fc0e bl 80133c0 <__sprint_r> + 8013ba4: 2800 cmp r0, #0 + 8013ba6: d166 bne.n 8013c76 <_vfiprintf_r+0x852> + 8013ba8: 4b60 ldr r3, [pc, #384] @ (8013d2c <_vfiprintf_r+0x908>) + 8013baa: a811 add r0, sp, #68 @ 0x44 + 8013bac: 3d10 subs r5, #16 + 8013bae: 4606 mov r6, r0 + 8013bb0: e694 b.n 80138dc <_vfiprintf_r+0x4b8> + 8013bb2: 4606 mov r6, r0 + 8013bb4: e6ac b.n 8013910 <_vfiprintf_r+0x4ec> + 8013bb6: 9800 ldr r0, [sp, #0] + 8013bb8: aa0e add r2, sp, #56 @ 0x38 + 8013bba: 4639 mov r1, r7 + 8013bbc: f7ff fc00 bl 80133c0 <__sprint_r> + 8013bc0: 2800 cmp r0, #0 + 8013bc2: d158 bne.n 8013c76 <_vfiprintf_r+0x852> + 8013bc4: ae11 add r6, sp, #68 @ 0x44 + 8013bc6: e6b5 b.n 8013934 <_vfiprintf_r+0x510> + 8013bc8: 9800 ldr r0, [sp, #0] + 8013bca: aa0e add r2, sp, #56 @ 0x38 + 8013bcc: 4639 mov r1, r7 + 8013bce: f7ff fbf7 bl 80133c0 <__sprint_r> + 8013bd2: 2800 cmp r0, #0 + 8013bd4: d14f bne.n 8013c76 <_vfiprintf_r+0x852> + 8013bd6: ae11 add r6, sp, #68 @ 0x44 + 8013bd8: e6bc b.n 8013954 <_vfiprintf_r+0x530> + 8013bda: 2110 movs r1, #16 + 8013bdc: 6071 str r1, [r6, #4] + 8013bde: 2a07 cmp r2, #7 + 8013be0: 4461 add r1, ip + 8013be2: e9cd 210f strd r2, r1, [sp, #60] @ 0x3c + 8013be6: dd08 ble.n 8013bfa <_vfiprintf_r+0x7d6> + 8013be8: 9800 ldr r0, [sp, #0] + 8013bea: aa0e add r2, sp, #56 @ 0x38 + 8013bec: 4639 mov r1, r7 + 8013bee: f7ff fbe7 bl 80133c0 <__sprint_r> + 8013bf2: 2800 cmp r0, #0 + 8013bf4: d13f bne.n 8013c76 <_vfiprintf_r+0x852> + 8013bf6: 4b4e ldr r3, [pc, #312] @ (8013d30 <_vfiprintf_r+0x90c>) + 8013bf8: a811 add r0, sp, #68 @ 0x44 + 8013bfa: 3d10 subs r5, #16 + 8013bfc: 4606 mov r6, r0 + 8013bfe: e6b2 b.n 8013966 <_vfiprintf_r+0x542> + 8013c00: 4606 mov r6, r0 + 8013c02: e6ca b.n 801399a <_vfiprintf_r+0x576> + 8013c04: 2010 movs r0, #16 + 8013c06: 4402 add r2, r0 + 8013c08: 2b07 cmp r3, #7 + 8013c0a: e9cd 320f strd r3, r2, [sp, #60] @ 0x3c + 8013c0e: 6070 str r0, [r6, #4] + 8013c10: dd06 ble.n 8013c20 <_vfiprintf_r+0x7fc> + 8013c12: 9800 ldr r0, [sp, #0] + 8013c14: aa0e add r2, sp, #56 @ 0x38 + 8013c16: 4639 mov r1, r7 + 8013c18: f7ff fbd2 bl 80133c0 <__sprint_r> + 8013c1c: bb58 cbnz r0, 8013c76 <_vfiprintf_r+0x852> + 8013c1e: a911 add r1, sp, #68 @ 0x44 + 8013c20: 3c10 subs r4, #16 + 8013c22: 460e mov r6, r1 + 8013c24: e6bd b.n 80139a2 <_vfiprintf_r+0x57e> + 8013c26: 460e mov r6, r1 + 8013c28: e6d6 b.n 80139d8 <_vfiprintf_r+0x5b4> + 8013c2a: 9800 ldr r0, [sp, #0] + 8013c2c: aa0e add r2, sp, #56 @ 0x38 + 8013c2e: 4639 mov r1, r7 + 8013c30: f7ff fbc6 bl 80133c0 <__sprint_r> + 8013c34: b9f8 cbnz r0, 8013c76 <_vfiprintf_r+0x852> + 8013c36: ab11 add r3, sp, #68 @ 0x44 + 8013c38: e6de b.n 80139f8 <_vfiprintf_r+0x5d4> + 8013c3a: 9a02 ldr r2, [sp, #8] + 8013c3c: 9904 ldr r1, [sp, #16] + 8013c3e: 1a54 subs r4, r2, r1 + 8013c40: 2c00 cmp r4, #0 + 8013c42: f77f aedd ble.w 8013a00 <_vfiprintf_r+0x5dc> + 8013c46: 4d39 ldr r5, [pc, #228] @ (8013d2c <_vfiprintf_r+0x908>) + 8013c48: 2610 movs r6, #16 + 8013c4a: e9dd 210f ldrd r2, r1, [sp, #60] @ 0x3c + 8013c4e: 2c10 cmp r4, #16 + 8013c50: f102 0201 add.w r2, r2, #1 + 8013c54: 601d str r5, [r3, #0] + 8013c56: dc1d bgt.n 8013c94 <_vfiprintf_r+0x870> + 8013c58: 605c str r4, [r3, #4] + 8013c5a: 2a07 cmp r2, #7 + 8013c5c: 440c add r4, r1 + 8013c5e: e9cd 240f strd r2, r4, [sp, #60] @ 0x3c + 8013c62: f77f aecd ble.w 8013a00 <_vfiprintf_r+0x5dc> + 8013c66: 9800 ldr r0, [sp, #0] + 8013c68: aa0e add r2, sp, #56 @ 0x38 + 8013c6a: 4639 mov r1, r7 + 8013c6c: f7ff fba8 bl 80133c0 <__sprint_r> + 8013c70: 2800 cmp r0, #0 + 8013c72: f43f aec5 beq.w 8013a00 <_vfiprintf_r+0x5dc> + 8013c76: 6e7b ldr r3, [r7, #100] @ 0x64 + 8013c78: 07d9 lsls r1, r3, #31 + 8013c7a: d405 bmi.n 8013c88 <_vfiprintf_r+0x864> + 8013c7c: 89bb ldrh r3, [r7, #12] + 8013c7e: 059a lsls r2, r3, #22 + 8013c80: d402 bmi.n 8013c88 <_vfiprintf_r+0x864> + 8013c82: 6db8 ldr r0, [r7, #88] @ 0x58 + 8013c84: f7fd fdb3 bl 80117ee <__retarget_lock_release_recursive> + 8013c88: 89bb ldrh r3, [r7, #12] + 8013c8a: 065b lsls r3, r3, #25 + 8013c8c: f57f abfb bpl.w 8013486 <_vfiprintf_r+0x62> + 8013c90: f7ff bbf6 b.w 8013480 <_vfiprintf_r+0x5c> + 8013c94: 3110 adds r1, #16 + 8013c96: 2a07 cmp r2, #7 + 8013c98: e9cd 210f strd r2, r1, [sp, #60] @ 0x3c + 8013c9c: 605e str r6, [r3, #4] + 8013c9e: dc02 bgt.n 8013ca6 <_vfiprintf_r+0x882> + 8013ca0: 3308 adds r3, #8 + 8013ca2: 3c10 subs r4, #16 + 8013ca4: e7d1 b.n 8013c4a <_vfiprintf_r+0x826> + 8013ca6: 9800 ldr r0, [sp, #0] + 8013ca8: aa0e add r2, sp, #56 @ 0x38 + 8013caa: 4639 mov r1, r7 + 8013cac: f7ff fb88 bl 80133c0 <__sprint_r> + 8013cb0: 2800 cmp r0, #0 + 8013cb2: d1e0 bne.n 8013c76 <_vfiprintf_r+0x852> + 8013cb4: ab11 add r3, sp, #68 @ 0x44 + 8013cb6: e7f4 b.n 8013ca2 <_vfiprintf_r+0x87e> + 8013cb8: 9b10 ldr r3, [sp, #64] @ 0x40 + 8013cba: b913 cbnz r3, 8013cc2 <_vfiprintf_r+0x89e> + 8013cbc: 2300 movs r3, #0 + 8013cbe: 930f str r3, [sp, #60] @ 0x3c + 8013cc0: e7d9 b.n 8013c76 <_vfiprintf_r+0x852> + 8013cc2: 9800 ldr r0, [sp, #0] + 8013cc4: aa0e add r2, sp, #56 @ 0x38 + 8013cc6: 4639 mov r1, r7 + 8013cc8: f7ff fb7a bl 80133c0 <__sprint_r> + 8013ccc: 2800 cmp r0, #0 + 8013cce: d0f5 beq.n 8013cbc <_vfiprintf_r+0x898> + 8013cd0: e7d1 b.n 8013c76 <_vfiprintf_r+0x852> + 8013cd2: ea54 0205 orrs.w r2, r4, r5 + 8013cd6: f8cd a010 str.w sl, [sp, #16] + 8013cda: f43f ada6 beq.w 801382a <_vfiprintf_r+0x406> + 8013cde: 2b01 cmp r3, #1 + 8013ce0: f43f aedf beq.w 8013aa2 <_vfiprintf_r+0x67e> + 8013ce4: 2b02 cmp r3, #2 + 8013ce6: f10d 09e8 add.w r9, sp, #232 @ 0xe8 + 8013cea: f43f af28 beq.w 8013b3e <_vfiprintf_r+0x71a> + 8013cee: f004 0307 and.w r3, r4, #7 + 8013cf2: 08e4 lsrs r4, r4, #3 + 8013cf4: ea44 7445 orr.w r4, r4, r5, lsl #29 + 8013cf8: 08ed lsrs r5, r5, #3 + 8013cfa: 3330 adds r3, #48 @ 0x30 + 8013cfc: ea54 0105 orrs.w r1, r4, r5 + 8013d00: 464a mov r2, r9 + 8013d02: f809 3d01 strb.w r3, [r9, #-1]! + 8013d06: d1f2 bne.n 8013cee <_vfiprintf_r+0x8ca> + 8013d08: 9904 ldr r1, [sp, #16] + 8013d0a: 07c8 lsls r0, r1, #31 + 8013d0c: d506 bpl.n 8013d1c <_vfiprintf_r+0x8f8> + 8013d0e: 2b30 cmp r3, #48 @ 0x30 + 8013d10: d004 beq.n 8013d1c <_vfiprintf_r+0x8f8> + 8013d12: 2330 movs r3, #48 @ 0x30 + 8013d14: f809 3c01 strb.w r3, [r9, #-1] + 8013d18: f1a2 0902 sub.w r9, r2, #2 + 8013d1c: ab3a add r3, sp, #232 @ 0xe8 + 8013d1e: eba3 0309 sub.w r3, r3, r9 + 8013d22: 9c01 ldr r4, [sp, #4] + 8013d24: f8dd a010 ldr.w sl, [sp, #16] + 8013d28: 9301 str r3, [sp, #4] + 8013d2a: e5bb b.n 80138a4 <_vfiprintf_r+0x480> + 8013d2c: 0801904f .word 0x0801904f + 8013d30: 0801903f .word 0x0801903f + +08013d34 <__sbprintf>: + 8013d34: b5f0 push {r4, r5, r6, r7, lr} + 8013d36: 461f mov r7, r3 + 8013d38: 898b ldrh r3, [r1, #12] + 8013d3a: f2ad 4d6c subw sp, sp, #1132 @ 0x46c + 8013d3e: f023 0302 bic.w r3, r3, #2 + 8013d42: f8ad 300c strh.w r3, [sp, #12] + 8013d46: 6e4b ldr r3, [r1, #100] @ 0x64 + 8013d48: 9319 str r3, [sp, #100] @ 0x64 + 8013d4a: 89cb ldrh r3, [r1, #14] + 8013d4c: f8ad 300e strh.w r3, [sp, #14] + 8013d50: 69cb ldr r3, [r1, #28] + 8013d52: 9307 str r3, [sp, #28] + 8013d54: 6a4b ldr r3, [r1, #36] @ 0x24 + 8013d56: 9309 str r3, [sp, #36] @ 0x24 + 8013d58: ab1a add r3, sp, #104 @ 0x68 + 8013d5a: 9300 str r3, [sp, #0] + 8013d5c: 9304 str r3, [sp, #16] + 8013d5e: f44f 6380 mov.w r3, #1024 @ 0x400 + 8013d62: 4615 mov r5, r2 + 8013d64: 4606 mov r6, r0 + 8013d66: 9302 str r3, [sp, #8] + 8013d68: 9305 str r3, [sp, #20] + 8013d6a: a816 add r0, sp, #88 @ 0x58 + 8013d6c: 2300 movs r3, #0 + 8013d6e: 460c mov r4, r1 + 8013d70: 9306 str r3, [sp, #24] + 8013d72: f7fd fd39 bl 80117e8 <__retarget_lock_init_recursive> + 8013d76: 462a mov r2, r5 + 8013d78: 463b mov r3, r7 + 8013d7a: 4669 mov r1, sp + 8013d7c: 4630 mov r0, r6 + 8013d7e: f7ff fb51 bl 8013424 <_vfiprintf_r> + 8013d82: 1e05 subs r5, r0, #0 + 8013d84: db07 blt.n 8013d96 <__sbprintf+0x62> + 8013d86: 4669 mov r1, sp + 8013d88: 4630 mov r0, r6 + 8013d8a: f000 f8f1 bl 8013f70 <_fflush_r> + 8013d8e: 2800 cmp r0, #0 + 8013d90: bf18 it ne + 8013d92: f04f 35ff movne.w r5, #4294967295 + 8013d96: f8bd 300c ldrh.w r3, [sp, #12] + 8013d9a: 9816 ldr r0, [sp, #88] @ 0x58 + 8013d9c: 065b lsls r3, r3, #25 + 8013d9e: bf42 ittt mi + 8013da0: 89a3 ldrhmi r3, [r4, #12] + 8013da2: f043 0340 orrmi.w r3, r3, #64 @ 0x40 + 8013da6: 81a3 strhmi r3, [r4, #12] + 8013da8: f7fd fd1f bl 80117ea <__retarget_lock_close_recursive> + 8013dac: 4628 mov r0, r5 + 8013dae: f20d 4d6c addw sp, sp, #1132 @ 0x46c + 8013db2: bdf0 pop {r4, r5, r6, r7, pc} + +08013db4 <_fclose_r>: + 8013db4: b570 push {r4, r5, r6, lr} + 8013db6: 4605 mov r5, r0 + 8013db8: 460c mov r4, r1 + 8013dba: b1b1 cbz r1, 8013dea <_fclose_r+0x36> + 8013dbc: b118 cbz r0, 8013dc6 <_fclose_r+0x12> + 8013dbe: 6b43 ldr r3, [r0, #52] @ 0x34 + 8013dc0: b90b cbnz r3, 8013dc6 <_fclose_r+0x12> + 8013dc2: f7fd fbe3 bl 801158c <__sinit> + 8013dc6: 6e63 ldr r3, [r4, #100] @ 0x64 + 8013dc8: 07de lsls r6, r3, #31 + 8013dca: d405 bmi.n 8013dd8 <_fclose_r+0x24> + 8013dcc: 89a3 ldrh r3, [r4, #12] + 8013dce: 0598 lsls r0, r3, #22 + 8013dd0: d402 bmi.n 8013dd8 <_fclose_r+0x24> + 8013dd2: 6da0 ldr r0, [r4, #88] @ 0x58 + 8013dd4: f7fd fd0a bl 80117ec <__retarget_lock_acquire_recursive> + 8013dd8: f9b4 300c ldrsh.w r3, [r4, #12] + 8013ddc: b943 cbnz r3, 8013df0 <_fclose_r+0x3c> + 8013dde: 6e63 ldr r3, [r4, #100] @ 0x64 + 8013de0: 07d9 lsls r1, r3, #31 + 8013de2: d402 bmi.n 8013dea <_fclose_r+0x36> + 8013de4: 6da0 ldr r0, [r4, #88] @ 0x58 + 8013de6: f7fd fd02 bl 80117ee <__retarget_lock_release_recursive> + 8013dea: 2600 movs r6, #0 + 8013dec: 4630 mov r0, r6 + 8013dee: bd70 pop {r4, r5, r6, pc} + 8013df0: 4621 mov r1, r4 + 8013df2: 4628 mov r0, r5 + 8013df4: f000 f834 bl 8013e60 <__sflush_r> + 8013df8: 6ae3 ldr r3, [r4, #44] @ 0x2c + 8013dfa: 4606 mov r6, r0 + 8013dfc: b133 cbz r3, 8013e0c <_fclose_r+0x58> + 8013dfe: 69e1 ldr r1, [r4, #28] + 8013e00: 4628 mov r0, r5 + 8013e02: 4798 blx r3 + 8013e04: 2800 cmp r0, #0 + 8013e06: bfb8 it lt + 8013e08: f04f 36ff movlt.w r6, #4294967295 + 8013e0c: 89a3 ldrh r3, [r4, #12] + 8013e0e: 061a lsls r2, r3, #24 + 8013e10: d503 bpl.n 8013e1a <_fclose_r+0x66> + 8013e12: 6921 ldr r1, [r4, #16] + 8013e14: 4628 mov r0, r5 + 8013e16: f7fd fd5f bl 80118d8 <_free_r> + 8013e1a: 6b21 ldr r1, [r4, #48] @ 0x30 + 8013e1c: b141 cbz r1, 8013e30 <_fclose_r+0x7c> + 8013e1e: f104 0340 add.w r3, r4, #64 @ 0x40 + 8013e22: 4299 cmp r1, r3 + 8013e24: d002 beq.n 8013e2c <_fclose_r+0x78> + 8013e26: 4628 mov r0, r5 + 8013e28: f7fd fd56 bl 80118d8 <_free_r> + 8013e2c: 2300 movs r3, #0 + 8013e2e: 6323 str r3, [r4, #48] @ 0x30 + 8013e30: 6c61 ldr r1, [r4, #68] @ 0x44 + 8013e32: b121 cbz r1, 8013e3e <_fclose_r+0x8a> + 8013e34: 4628 mov r0, r5 + 8013e36: f7fd fd4f bl 80118d8 <_free_r> + 8013e3a: 2300 movs r3, #0 + 8013e3c: 6463 str r3, [r4, #68] @ 0x44 + 8013e3e: f7fd fb99 bl 8011574 <__sfp_lock_acquire> + 8013e42: 2300 movs r3, #0 + 8013e44: 81a3 strh r3, [r4, #12] + 8013e46: 6e63 ldr r3, [r4, #100] @ 0x64 + 8013e48: 07db lsls r3, r3, #31 + 8013e4a: d402 bmi.n 8013e52 <_fclose_r+0x9e> + 8013e4c: 6da0 ldr r0, [r4, #88] @ 0x58 + 8013e4e: f7fd fcce bl 80117ee <__retarget_lock_release_recursive> + 8013e52: 6da0 ldr r0, [r4, #88] @ 0x58 + 8013e54: f7fd fcc9 bl 80117ea <__retarget_lock_close_recursive> + 8013e58: f7fd fb92 bl 8011580 <__sfp_lock_release> + 8013e5c: e7c6 b.n 8013dec <_fclose_r+0x38> + ... + +08013e60 <__sflush_r>: + 8013e60: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} + 8013e64: 4605 mov r5, r0 + 8013e66: f9b1 000c ldrsh.w r0, [r1, #12] + 8013e6a: 0706 lsls r6, r0, #28 + 8013e6c: 460c mov r4, r1 + 8013e6e: d457 bmi.n 8013f20 <__sflush_r+0xc0> + 8013e70: f440 6300 orr.w r3, r0, #2048 @ 0x800 + 8013e74: 818b strh r3, [r1, #12] + 8013e76: 684b ldr r3, [r1, #4] + 8013e78: 2b00 cmp r3, #0 + 8013e7a: dc02 bgt.n 8013e82 <__sflush_r+0x22> + 8013e7c: 6bcb ldr r3, [r1, #60] @ 0x3c + 8013e7e: 2b00 cmp r3, #0 + 8013e80: dd4c ble.n 8013f1c <__sflush_r+0xbc> + 8013e82: 6aa6 ldr r6, [r4, #40] @ 0x28 + 8013e84: 2e00 cmp r6, #0 + 8013e86: d049 beq.n 8013f1c <__sflush_r+0xbc> + 8013e88: 2300 movs r3, #0 + 8013e8a: f410 5280 ands.w r2, r0, #4096 @ 0x1000 + 8013e8e: 682f ldr r7, [r5, #0] + 8013e90: 69e1 ldr r1, [r4, #28] + 8013e92: 602b str r3, [r5, #0] + 8013e94: d034 beq.n 8013f00 <__sflush_r+0xa0> + 8013e96: 6d22 ldr r2, [r4, #80] @ 0x50 + 8013e98: 89a3 ldrh r3, [r4, #12] + 8013e9a: 0759 lsls r1, r3, #29 + 8013e9c: d505 bpl.n 8013eaa <__sflush_r+0x4a> + 8013e9e: 6863 ldr r3, [r4, #4] + 8013ea0: 1ad2 subs r2, r2, r3 + 8013ea2: 6b23 ldr r3, [r4, #48] @ 0x30 + 8013ea4: b10b cbz r3, 8013eaa <__sflush_r+0x4a> + 8013ea6: 6be3 ldr r3, [r4, #60] @ 0x3c + 8013ea8: 1ad2 subs r2, r2, r3 + 8013eaa: 2300 movs r3, #0 + 8013eac: 6aa6 ldr r6, [r4, #40] @ 0x28 + 8013eae: 69e1 ldr r1, [r4, #28] + 8013eb0: 4628 mov r0, r5 + 8013eb2: 47b0 blx r6 + 8013eb4: 1c43 adds r3, r0, #1 + 8013eb6: d106 bne.n 8013ec6 <__sflush_r+0x66> + 8013eb8: 682a ldr r2, [r5, #0] + 8013eba: 2a1d cmp r2, #29 + 8013ebc: d848 bhi.n 8013f50 <__sflush_r+0xf0> + 8013ebe: 4b2b ldr r3, [pc, #172] @ (8013f6c <__sflush_r+0x10c>) + 8013ec0: 4113 asrs r3, r2 + 8013ec2: 07de lsls r6, r3, #31 + 8013ec4: d444 bmi.n 8013f50 <__sflush_r+0xf0> + 8013ec6: f9b4 300c ldrsh.w r3, [r4, #12] + 8013eca: f423 6200 bic.w r2, r3, #2048 @ 0x800 + 8013ece: 81a2 strh r2, [r4, #12] + 8013ed0: 2200 movs r2, #0 + 8013ed2: 6062 str r2, [r4, #4] + 8013ed4: 04d9 lsls r1, r3, #19 + 8013ed6: 6922 ldr r2, [r4, #16] + 8013ed8: 6022 str r2, [r4, #0] + 8013eda: d504 bpl.n 8013ee6 <__sflush_r+0x86> + 8013edc: 1c42 adds r2, r0, #1 + 8013ede: d101 bne.n 8013ee4 <__sflush_r+0x84> + 8013ee0: 682b ldr r3, [r5, #0] + 8013ee2: b903 cbnz r3, 8013ee6 <__sflush_r+0x86> + 8013ee4: 6520 str r0, [r4, #80] @ 0x50 + 8013ee6: 6b21 ldr r1, [r4, #48] @ 0x30 + 8013ee8: 602f str r7, [r5, #0] + 8013eea: b1b9 cbz r1, 8013f1c <__sflush_r+0xbc> + 8013eec: f104 0340 add.w r3, r4, #64 @ 0x40 + 8013ef0: 4299 cmp r1, r3 + 8013ef2: d002 beq.n 8013efa <__sflush_r+0x9a> + 8013ef4: 4628 mov r0, r5 + 8013ef6: f7fd fcef bl 80118d8 <_free_r> + 8013efa: 2300 movs r3, #0 + 8013efc: 6323 str r3, [r4, #48] @ 0x30 + 8013efe: e00d b.n 8013f1c <__sflush_r+0xbc> + 8013f00: 2301 movs r3, #1 + 8013f02: 4628 mov r0, r5 + 8013f04: 47b0 blx r6 + 8013f06: 4602 mov r2, r0 + 8013f08: 1c50 adds r0, r2, #1 + 8013f0a: d1c5 bne.n 8013e98 <__sflush_r+0x38> + 8013f0c: 682b ldr r3, [r5, #0] + 8013f0e: 2b00 cmp r3, #0 + 8013f10: d0c2 beq.n 8013e98 <__sflush_r+0x38> + 8013f12: 2b1d cmp r3, #29 + 8013f14: d001 beq.n 8013f1a <__sflush_r+0xba> + 8013f16: 2b16 cmp r3, #22 + 8013f18: d11a bne.n 8013f50 <__sflush_r+0xf0> + 8013f1a: 602f str r7, [r5, #0] + 8013f1c: 2000 movs r0, #0 + 8013f1e: e01e b.n 8013f5e <__sflush_r+0xfe> + 8013f20: 690f ldr r7, [r1, #16] + 8013f22: 2f00 cmp r7, #0 + 8013f24: d0fa beq.n 8013f1c <__sflush_r+0xbc> + 8013f26: 0783 lsls r3, r0, #30 + 8013f28: 680e ldr r6, [r1, #0] + 8013f2a: bf08 it eq + 8013f2c: 694b ldreq r3, [r1, #20] + 8013f2e: 600f str r7, [r1, #0] + 8013f30: bf18 it ne + 8013f32: 2300 movne r3, #0 + 8013f34: eba6 0807 sub.w r8, r6, r7 + 8013f38: 608b str r3, [r1, #8] + 8013f3a: f1b8 0f00 cmp.w r8, #0 + 8013f3e: dded ble.n 8013f1c <__sflush_r+0xbc> + 8013f40: 69e1 ldr r1, [r4, #28] + 8013f42: 6a66 ldr r6, [r4, #36] @ 0x24 + 8013f44: 4643 mov r3, r8 + 8013f46: 463a mov r2, r7 + 8013f48: 4628 mov r0, r5 + 8013f4a: 47b0 blx r6 + 8013f4c: 2800 cmp r0, #0 + 8013f4e: dc08 bgt.n 8013f62 <__sflush_r+0x102> + 8013f50: f9b4 300c ldrsh.w r3, [r4, #12] + 8013f54: f043 0340 orr.w r3, r3, #64 @ 0x40 + 8013f58: 81a3 strh r3, [r4, #12] + 8013f5a: f04f 30ff mov.w r0, #4294967295 + 8013f5e: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} + 8013f62: 4407 add r7, r0 + 8013f64: eba8 0800 sub.w r8, r8, r0 + 8013f68: e7e7 b.n 8013f3a <__sflush_r+0xda> + 8013f6a: bf00 nop + 8013f6c: dfbffffe .word 0xdfbffffe + +08013f70 <_fflush_r>: + 8013f70: b538 push {r3, r4, r5, lr} + 8013f72: 460c mov r4, r1 + 8013f74: 4605 mov r5, r0 + 8013f76: b118 cbz r0, 8013f80 <_fflush_r+0x10> + 8013f78: 6b43 ldr r3, [r0, #52] @ 0x34 + 8013f7a: b90b cbnz r3, 8013f80 <_fflush_r+0x10> + 8013f7c: f7fd fb06 bl 801158c <__sinit> + 8013f80: f9b4 000c ldrsh.w r0, [r4, #12] + 8013f84: b1b8 cbz r0, 8013fb6 <_fflush_r+0x46> + 8013f86: 6e63 ldr r3, [r4, #100] @ 0x64 + 8013f88: 07db lsls r3, r3, #31 + 8013f8a: d404 bmi.n 8013f96 <_fflush_r+0x26> + 8013f8c: 0581 lsls r1, r0, #22 + 8013f8e: d402 bmi.n 8013f96 <_fflush_r+0x26> + 8013f90: 6da0 ldr r0, [r4, #88] @ 0x58 + 8013f92: f7fd fc2b bl 80117ec <__retarget_lock_acquire_recursive> + 8013f96: 4628 mov r0, r5 + 8013f98: 4621 mov r1, r4 + 8013f9a: f7ff ff61 bl 8013e60 <__sflush_r> + 8013f9e: 6e63 ldr r3, [r4, #100] @ 0x64 + 8013fa0: 07da lsls r2, r3, #31 + 8013fa2: 4605 mov r5, r0 + 8013fa4: d405 bmi.n 8013fb2 <_fflush_r+0x42> + 8013fa6: 89a3 ldrh r3, [r4, #12] + 8013fa8: 059b lsls r3, r3, #22 + 8013faa: d402 bmi.n 8013fb2 <_fflush_r+0x42> + 8013fac: 6da0 ldr r0, [r4, #88] @ 0x58 + 8013fae: f7fd fc1e bl 80117ee <__retarget_lock_release_recursive> + 8013fb2: 4628 mov r0, r5 + 8013fb4: bd38 pop {r3, r4, r5, pc} + 8013fb6: 4605 mov r5, r0 + 8013fb8: e7fb b.n 8013fb2 <_fflush_r+0x42> + ... + +08013fbc <__sfvwrite_r>: + 8013fbc: 6893 ldr r3, [r2, #8] + 8013fbe: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8013fc2: 4606 mov r6, r0 + 8013fc4: 460c mov r4, r1 + 8013fc6: 4691 mov r9, r2 + 8013fc8: b91b cbnz r3, 8013fd2 <__sfvwrite_r+0x16> + 8013fca: 2000 movs r0, #0 + 8013fcc: b003 add sp, #12 + 8013fce: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 8013fd2: 898b ldrh r3, [r1, #12] + 8013fd4: 0718 lsls r0, r3, #28 + 8013fd6: d550 bpl.n 801407a <__sfvwrite_r+0xbe> + 8013fd8: 690b ldr r3, [r1, #16] + 8013fda: 2b00 cmp r3, #0 + 8013fdc: d04d beq.n 801407a <__sfvwrite_r+0xbe> + 8013fde: f9b4 300c ldrsh.w r3, [r4, #12] + 8013fe2: f8d9 8000 ldr.w r8, [r9] + 8013fe6: f013 0702 ands.w r7, r3, #2 + 8013fea: d16b bne.n 80140c4 <__sfvwrite_r+0x108> + 8013fec: f013 0301 ands.w r3, r3, #1 + 8013ff0: f000 809c beq.w 801412c <__sfvwrite_r+0x170> + 8013ff4: 4638 mov r0, r7 + 8013ff6: 46ba mov sl, r7 + 8013ff8: 46bb mov fp, r7 + 8013ffa: f1bb 0f00 cmp.w fp, #0 + 8013ffe: f000 8103 beq.w 8014208 <__sfvwrite_r+0x24c> + 8014002: b950 cbnz r0, 801401a <__sfvwrite_r+0x5e> + 8014004: 465a mov r2, fp + 8014006: 210a movs r1, #10 + 8014008: 4650 mov r0, sl + 801400a: f7ec f8f9 bl 8000200 + 801400e: 2800 cmp r0, #0 + 8014010: f000 8100 beq.w 8014214 <__sfvwrite_r+0x258> + 8014014: 3001 adds r0, #1 + 8014016: eba0 070a sub.w r7, r0, sl + 801401a: 6820 ldr r0, [r4, #0] + 801401c: 6921 ldr r1, [r4, #16] + 801401e: 68a5 ldr r5, [r4, #8] + 8014020: 6963 ldr r3, [r4, #20] + 8014022: 455f cmp r7, fp + 8014024: 463a mov r2, r7 + 8014026: bf28 it cs + 8014028: 465a movcs r2, fp + 801402a: 4288 cmp r0, r1 + 801402c: f240 80f5 bls.w 801421a <__sfvwrite_r+0x25e> + 8014030: 441d add r5, r3 + 8014032: 42aa cmp r2, r5 + 8014034: f340 80f1 ble.w 801421a <__sfvwrite_r+0x25e> + 8014038: 4651 mov r1, sl + 801403a: 462a mov r2, r5 + 801403c: f7fd fb41 bl 80116c2 + 8014040: 6823 ldr r3, [r4, #0] + 8014042: 442b add r3, r5 + 8014044: 6023 str r3, [r4, #0] + 8014046: 4621 mov r1, r4 + 8014048: 4630 mov r0, r6 + 801404a: f7ff ff91 bl 8013f70 <_fflush_r> + 801404e: 2800 cmp r0, #0 + 8014050: d167 bne.n 8014122 <__sfvwrite_r+0x166> + 8014052: 1b7f subs r7, r7, r5 + 8014054: f040 80f9 bne.w 801424a <__sfvwrite_r+0x28e> + 8014058: 4621 mov r1, r4 + 801405a: 4630 mov r0, r6 + 801405c: f7ff ff88 bl 8013f70 <_fflush_r> + 8014060: 2800 cmp r0, #0 + 8014062: d15e bne.n 8014122 <__sfvwrite_r+0x166> + 8014064: f8d9 3008 ldr.w r3, [r9, #8] + 8014068: 1b5b subs r3, r3, r5 + 801406a: 44aa add sl, r5 + 801406c: ebab 0b05 sub.w fp, fp, r5 + 8014070: f8c9 3008 str.w r3, [r9, #8] + 8014074: 2b00 cmp r3, #0 + 8014076: d1c0 bne.n 8013ffa <__sfvwrite_r+0x3e> + 8014078: e7a7 b.n 8013fca <__sfvwrite_r+0xe> + 801407a: 4621 mov r1, r4 + 801407c: 4630 mov r0, r6 + 801407e: f000 f8e9 bl 8014254 <__swsetup_r> + 8014082: 2800 cmp r0, #0 + 8014084: d0ab beq.n 8013fde <__sfvwrite_r+0x22> + 8014086: f04f 30ff mov.w r0, #4294967295 + 801408a: e79f b.n 8013fcc <__sfvwrite_r+0x10> + 801408c: e9d8 a500 ldrd sl, r5, [r8] + 8014090: f108 0808 add.w r8, r8, #8 + 8014094: f8d4 b024 ldr.w fp, [r4, #36] @ 0x24 + 8014098: 69e1 ldr r1, [r4, #28] + 801409a: 2d00 cmp r5, #0 + 801409c: d0f6 beq.n 801408c <__sfvwrite_r+0xd0> + 801409e: 42bd cmp r5, r7 + 80140a0: 462b mov r3, r5 + 80140a2: 4652 mov r2, sl + 80140a4: bf28 it cs + 80140a6: 463b movcs r3, r7 + 80140a8: 4630 mov r0, r6 + 80140aa: 47d8 blx fp + 80140ac: 2800 cmp r0, #0 + 80140ae: dd38 ble.n 8014122 <__sfvwrite_r+0x166> + 80140b0: f8d9 3008 ldr.w r3, [r9, #8] + 80140b4: 1a1b subs r3, r3, r0 + 80140b6: 4482 add sl, r0 + 80140b8: 1a2d subs r5, r5, r0 + 80140ba: f8c9 3008 str.w r3, [r9, #8] + 80140be: 2b00 cmp r3, #0 + 80140c0: d1e8 bne.n 8014094 <__sfvwrite_r+0xd8> + 80140c2: e782 b.n 8013fca <__sfvwrite_r+0xe> + 80140c4: f04f 0a00 mov.w sl, #0 + 80140c8: 4f61 ldr r7, [pc, #388] @ (8014250 <__sfvwrite_r+0x294>) + 80140ca: 4655 mov r5, sl + 80140cc: e7e2 b.n 8014094 <__sfvwrite_r+0xd8> + 80140ce: e9d8 7a00 ldrd r7, sl, [r8] + 80140d2: f108 0808 add.w r8, r8, #8 + 80140d6: f9b4 300c ldrsh.w r3, [r4, #12] + 80140da: 6820 ldr r0, [r4, #0] + 80140dc: 68a2 ldr r2, [r4, #8] + 80140de: f1ba 0f00 cmp.w sl, #0 + 80140e2: d0f4 beq.n 80140ce <__sfvwrite_r+0x112> + 80140e4: 0599 lsls r1, r3, #22 + 80140e6: d563 bpl.n 80141b0 <__sfvwrite_r+0x1f4> + 80140e8: 4552 cmp r2, sl + 80140ea: d836 bhi.n 801415a <__sfvwrite_r+0x19e> + 80140ec: f413 6f90 tst.w r3, #1152 @ 0x480 + 80140f0: d033 beq.n 801415a <__sfvwrite_r+0x19e> + 80140f2: 6921 ldr r1, [r4, #16] + 80140f4: 6965 ldr r5, [r4, #20] + 80140f6: eba0 0b01 sub.w fp, r0, r1 + 80140fa: eb05 0545 add.w r5, r5, r5, lsl #1 + 80140fe: eb05 75d5 add.w r5, r5, r5, lsr #31 + 8014102: f10b 0201 add.w r2, fp, #1 + 8014106: 106d asrs r5, r5, #1 + 8014108: 4452 add r2, sl + 801410a: 4295 cmp r5, r2 + 801410c: bf38 it cc + 801410e: 4615 movcc r5, r2 + 8014110: 055b lsls r3, r3, #21 + 8014112: d53d bpl.n 8014190 <__sfvwrite_r+0x1d4> + 8014114: 4629 mov r1, r5 + 8014116: 4630 mov r0, r6 + 8014118: f7fd fc9e bl 8011a58 <_malloc_r> + 801411c: b948 cbnz r0, 8014132 <__sfvwrite_r+0x176> + 801411e: 230c movs r3, #12 + 8014120: 6033 str r3, [r6, #0] + 8014122: 89a3 ldrh r3, [r4, #12] + 8014124: f043 0340 orr.w r3, r3, #64 @ 0x40 + 8014128: 81a3 strh r3, [r4, #12] + 801412a: e7ac b.n 8014086 <__sfvwrite_r+0xca> + 801412c: 461f mov r7, r3 + 801412e: 469a mov sl, r3 + 8014130: e7d1 b.n 80140d6 <__sfvwrite_r+0x11a> + 8014132: 465a mov r2, fp + 8014134: 6921 ldr r1, [r4, #16] + 8014136: 9001 str r0, [sp, #4] + 8014138: f7fd fb5a bl 80117f0 + 801413c: 89a2 ldrh r2, [r4, #12] + 801413e: 9b01 ldr r3, [sp, #4] + 8014140: f422 6290 bic.w r2, r2, #1152 @ 0x480 + 8014144: f042 0280 orr.w r2, r2, #128 @ 0x80 + 8014148: 81a2 strh r2, [r4, #12] + 801414a: 6123 str r3, [r4, #16] + 801414c: 6165 str r5, [r4, #20] + 801414e: 445b add r3, fp + 8014150: eba5 050b sub.w r5, r5, fp + 8014154: 6023 str r3, [r4, #0] + 8014156: 4652 mov r2, sl + 8014158: 60a5 str r5, [r4, #8] + 801415a: 4552 cmp r2, sl + 801415c: bf28 it cs + 801415e: 4652 movcs r2, sl + 8014160: 6820 ldr r0, [r4, #0] + 8014162: 9201 str r2, [sp, #4] + 8014164: 4639 mov r1, r7 + 8014166: f7fd faac bl 80116c2 + 801416a: 68a3 ldr r3, [r4, #8] + 801416c: 9a01 ldr r2, [sp, #4] + 801416e: 1a9b subs r3, r3, r2 + 8014170: 60a3 str r3, [r4, #8] + 8014172: 6823 ldr r3, [r4, #0] + 8014174: 4413 add r3, r2 + 8014176: 4655 mov r5, sl + 8014178: 6023 str r3, [r4, #0] + 801417a: f8d9 3008 ldr.w r3, [r9, #8] + 801417e: 1b5b subs r3, r3, r5 + 8014180: 442f add r7, r5 + 8014182: ebaa 0a05 sub.w sl, sl, r5 + 8014186: f8c9 3008 str.w r3, [r9, #8] + 801418a: 2b00 cmp r3, #0 + 801418c: d1a3 bne.n 80140d6 <__sfvwrite_r+0x11a> + 801418e: e71c b.n 8013fca <__sfvwrite_r+0xe> + 8014190: 462a mov r2, r5 + 8014192: 4630 mov r0, r6 + 8014194: f001 fb5e bl 8015854 <_realloc_r> + 8014198: 4603 mov r3, r0 + 801419a: 2800 cmp r0, #0 + 801419c: d1d5 bne.n 801414a <__sfvwrite_r+0x18e> + 801419e: 6921 ldr r1, [r4, #16] + 80141a0: 4630 mov r0, r6 + 80141a2: f7fd fb99 bl 80118d8 <_free_r> + 80141a6: 89a3 ldrh r3, [r4, #12] + 80141a8: f023 0380 bic.w r3, r3, #128 @ 0x80 + 80141ac: 81a3 strh r3, [r4, #12] + 80141ae: e7b6 b.n 801411e <__sfvwrite_r+0x162> + 80141b0: 6923 ldr r3, [r4, #16] + 80141b2: 4283 cmp r3, r0 + 80141b4: d302 bcc.n 80141bc <__sfvwrite_r+0x200> + 80141b6: 6961 ldr r1, [r4, #20] + 80141b8: 4551 cmp r1, sl + 80141ba: d915 bls.n 80141e8 <__sfvwrite_r+0x22c> + 80141bc: 4552 cmp r2, sl + 80141be: bf28 it cs + 80141c0: 4652 movcs r2, sl + 80141c2: 4639 mov r1, r7 + 80141c4: 4615 mov r5, r2 + 80141c6: f7fd fa7c bl 80116c2 + 80141ca: 68a3 ldr r3, [r4, #8] + 80141cc: 6822 ldr r2, [r4, #0] + 80141ce: 1b5b subs r3, r3, r5 + 80141d0: 442a add r2, r5 + 80141d2: 60a3 str r3, [r4, #8] + 80141d4: 6022 str r2, [r4, #0] + 80141d6: 2b00 cmp r3, #0 + 80141d8: d1cf bne.n 801417a <__sfvwrite_r+0x1be> + 80141da: 4621 mov r1, r4 + 80141dc: 4630 mov r0, r6 + 80141de: f7ff fec7 bl 8013f70 <_fflush_r> + 80141e2: 2800 cmp r0, #0 + 80141e4: d0c9 beq.n 801417a <__sfvwrite_r+0x1be> + 80141e6: e79c b.n 8014122 <__sfvwrite_r+0x166> + 80141e8: f06f 4300 mvn.w r3, #2147483648 @ 0x80000000 + 80141ec: 4553 cmp r3, sl + 80141ee: bf28 it cs + 80141f0: 4653 movcs r3, sl + 80141f2: 6a65 ldr r5, [r4, #36] @ 0x24 + 80141f4: fb93 f3f1 sdiv r3, r3, r1 + 80141f8: 463a mov r2, r7 + 80141fa: 434b muls r3, r1 + 80141fc: 4630 mov r0, r6 + 80141fe: 69e1 ldr r1, [r4, #28] + 8014200: 47a8 blx r5 + 8014202: 1e05 subs r5, r0, #0 + 8014204: dcb9 bgt.n 801417a <__sfvwrite_r+0x1be> + 8014206: e78c b.n 8014122 <__sfvwrite_r+0x166> + 8014208: e9d8 ab00 ldrd sl, fp, [r8] + 801420c: 2000 movs r0, #0 + 801420e: f108 0808 add.w r8, r8, #8 + 8014212: e6f2 b.n 8013ffa <__sfvwrite_r+0x3e> + 8014214: f10b 0701 add.w r7, fp, #1 + 8014218: e6ff b.n 801401a <__sfvwrite_r+0x5e> + 801421a: 4293 cmp r3, r2 + 801421c: dc08 bgt.n 8014230 <__sfvwrite_r+0x274> + 801421e: 6a65 ldr r5, [r4, #36] @ 0x24 + 8014220: 69e1 ldr r1, [r4, #28] + 8014222: 4652 mov r2, sl + 8014224: 4630 mov r0, r6 + 8014226: 47a8 blx r5 + 8014228: 1e05 subs r5, r0, #0 + 801422a: f73f af12 bgt.w 8014052 <__sfvwrite_r+0x96> + 801422e: e778 b.n 8014122 <__sfvwrite_r+0x166> + 8014230: 4651 mov r1, sl + 8014232: 9201 str r2, [sp, #4] + 8014234: f7fd fa45 bl 80116c2 + 8014238: 9a01 ldr r2, [sp, #4] + 801423a: 68a3 ldr r3, [r4, #8] + 801423c: 1a9b subs r3, r3, r2 + 801423e: 60a3 str r3, [r4, #8] + 8014240: 6823 ldr r3, [r4, #0] + 8014242: 4413 add r3, r2 + 8014244: 6023 str r3, [r4, #0] + 8014246: 4615 mov r5, r2 + 8014248: e703 b.n 8014052 <__sfvwrite_r+0x96> + 801424a: 2001 movs r0, #1 + 801424c: e70a b.n 8014064 <__sfvwrite_r+0xa8> + 801424e: bf00 nop + 8014250: 7ffffc00 .word 0x7ffffc00 + +08014254 <__swsetup_r>: + 8014254: b538 push {r3, r4, r5, lr} + 8014256: 4b29 ldr r3, [pc, #164] @ (80142fc <__swsetup_r+0xa8>) + 8014258: 4605 mov r5, r0 + 801425a: 6818 ldr r0, [r3, #0] + 801425c: 460c mov r4, r1 + 801425e: b118 cbz r0, 8014268 <__swsetup_r+0x14> + 8014260: 6b43 ldr r3, [r0, #52] @ 0x34 + 8014262: b90b cbnz r3, 8014268 <__swsetup_r+0x14> + 8014264: f7fd f992 bl 801158c <__sinit> + 8014268: f9b4 300c ldrsh.w r3, [r4, #12] + 801426c: 0719 lsls r1, r3, #28 + 801426e: d422 bmi.n 80142b6 <__swsetup_r+0x62> + 8014270: 06da lsls r2, r3, #27 + 8014272: d407 bmi.n 8014284 <__swsetup_r+0x30> + 8014274: 2209 movs r2, #9 + 8014276: 602a str r2, [r5, #0] + 8014278: f043 0340 orr.w r3, r3, #64 @ 0x40 + 801427c: 81a3 strh r3, [r4, #12] + 801427e: f04f 30ff mov.w r0, #4294967295 + 8014282: e033 b.n 80142ec <__swsetup_r+0x98> + 8014284: 0758 lsls r0, r3, #29 + 8014286: d512 bpl.n 80142ae <__swsetup_r+0x5a> + 8014288: 6b21 ldr r1, [r4, #48] @ 0x30 + 801428a: b141 cbz r1, 801429e <__swsetup_r+0x4a> + 801428c: f104 0340 add.w r3, r4, #64 @ 0x40 + 8014290: 4299 cmp r1, r3 + 8014292: d002 beq.n 801429a <__swsetup_r+0x46> + 8014294: 4628 mov r0, r5 + 8014296: f7fd fb1f bl 80118d8 <_free_r> + 801429a: 2300 movs r3, #0 + 801429c: 6323 str r3, [r4, #48] @ 0x30 + 801429e: 89a3 ldrh r3, [r4, #12] + 80142a0: f023 0324 bic.w r3, r3, #36 @ 0x24 + 80142a4: 81a3 strh r3, [r4, #12] + 80142a6: 2300 movs r3, #0 + 80142a8: 6063 str r3, [r4, #4] + 80142aa: 6923 ldr r3, [r4, #16] + 80142ac: 6023 str r3, [r4, #0] + 80142ae: 89a3 ldrh r3, [r4, #12] + 80142b0: f043 0308 orr.w r3, r3, #8 + 80142b4: 81a3 strh r3, [r4, #12] + 80142b6: 6923 ldr r3, [r4, #16] + 80142b8: b94b cbnz r3, 80142ce <__swsetup_r+0x7a> + 80142ba: 89a3 ldrh r3, [r4, #12] + 80142bc: f403 7320 and.w r3, r3, #640 @ 0x280 + 80142c0: f5b3 7f00 cmp.w r3, #512 @ 0x200 + 80142c4: d003 beq.n 80142ce <__swsetup_r+0x7a> + 80142c6: 4621 mov r1, r4 + 80142c8: 4628 mov r0, r5 + 80142ca: f001 fcb7 bl 8015c3c <__smakebuf_r> + 80142ce: f9b4 300c ldrsh.w r3, [r4, #12] + 80142d2: f013 0201 ands.w r2, r3, #1 + 80142d6: d00a beq.n 80142ee <__swsetup_r+0x9a> + 80142d8: 2200 movs r2, #0 + 80142da: 60a2 str r2, [r4, #8] + 80142dc: 6962 ldr r2, [r4, #20] + 80142de: 4252 negs r2, r2 + 80142e0: 61a2 str r2, [r4, #24] + 80142e2: 6922 ldr r2, [r4, #16] + 80142e4: b942 cbnz r2, 80142f8 <__swsetup_r+0xa4> + 80142e6: f013 0080 ands.w r0, r3, #128 @ 0x80 + 80142ea: d1c5 bne.n 8014278 <__swsetup_r+0x24> + 80142ec: bd38 pop {r3, r4, r5, pc} + 80142ee: 0799 lsls r1, r3, #30 + 80142f0: bf58 it pl + 80142f2: 6962 ldrpl r2, [r4, #20] + 80142f4: 60a2 str r2, [r4, #8] + 80142f6: e7f4 b.n 80142e2 <__swsetup_r+0x8e> + 80142f8: 2000 movs r0, #0 + 80142fa: e7f7 b.n 80142ec <__swsetup_r+0x98> + 80142fc: 2000003c .word 0x2000003c + +08014300 <__fputwc>: + 8014300: e92d 43f7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, lr} + 8014304: 4680 mov r8, r0 + 8014306: 460f mov r7, r1 + 8014308: 4614 mov r4, r2 + 801430a: f000 f877 bl 80143fc <__locale_mb_cur_max> + 801430e: 2801 cmp r0, #1 + 8014310: 4605 mov r5, r0 + 8014312: d11b bne.n 801434c <__fputwc+0x4c> + 8014314: 1e7b subs r3, r7, #1 + 8014316: 2bfe cmp r3, #254 @ 0xfe + 8014318: d818 bhi.n 801434c <__fputwc+0x4c> + 801431a: f88d 7004 strb.w r7, [sp, #4] + 801431e: 2600 movs r6, #0 + 8014320: f10d 0904 add.w r9, sp, #4 + 8014324: 42ae cmp r6, r5 + 8014326: d021 beq.n 801436c <__fputwc+0x6c> + 8014328: 68a3 ldr r3, [r4, #8] + 801432a: f816 1009 ldrb.w r1, [r6, r9] + 801432e: 3b01 subs r3, #1 + 8014330: 2b00 cmp r3, #0 + 8014332: 60a3 str r3, [r4, #8] + 8014334: da04 bge.n 8014340 <__fputwc+0x40> + 8014336: 69a2 ldr r2, [r4, #24] + 8014338: 4293 cmp r3, r2 + 801433a: db1b blt.n 8014374 <__fputwc+0x74> + 801433c: 290a cmp r1, #10 + 801433e: d019 beq.n 8014374 <__fputwc+0x74> + 8014340: 6823 ldr r3, [r4, #0] + 8014342: 1c5a adds r2, r3, #1 + 8014344: 6022 str r2, [r4, #0] + 8014346: 7019 strb r1, [r3, #0] + 8014348: 3601 adds r6, #1 + 801434a: e7eb b.n 8014324 <__fputwc+0x24> + 801434c: f104 035c add.w r3, r4, #92 @ 0x5c + 8014350: 463a mov r2, r7 + 8014352: a901 add r1, sp, #4 + 8014354: 4640 mov r0, r8 + 8014356: f001 fc33 bl 8015bc0 <_wcrtomb_r> + 801435a: 1c43 adds r3, r0, #1 + 801435c: 4605 mov r5, r0 + 801435e: d1de bne.n 801431e <__fputwc+0x1e> + 8014360: 89a3 ldrh r3, [r4, #12] + 8014362: f043 0340 orr.w r3, r3, #64 @ 0x40 + 8014366: 81a3 strh r3, [r4, #12] + 8014368: f04f 37ff mov.w r7, #4294967295 + 801436c: 4638 mov r0, r7 + 801436e: b003 add sp, #12 + 8014370: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} + 8014374: 4622 mov r2, r4 + 8014376: 4640 mov r0, r8 + 8014378: f001 fc9c bl 8015cb4 <__swbuf_r> + 801437c: 3001 adds r0, #1 + 801437e: d1e3 bne.n 8014348 <__fputwc+0x48> + 8014380: e7f2 b.n 8014368 <__fputwc+0x68> + +08014382 <_fputwc_r>: + 8014382: 6e53 ldr r3, [r2, #100] @ 0x64 + 8014384: 07db lsls r3, r3, #31 + 8014386: b570 push {r4, r5, r6, lr} + 8014388: 4605 mov r5, r0 + 801438a: 460e mov r6, r1 + 801438c: 4614 mov r4, r2 + 801438e: d405 bmi.n 801439c <_fputwc_r+0x1a> + 8014390: 8993 ldrh r3, [r2, #12] + 8014392: 0598 lsls r0, r3, #22 + 8014394: d402 bmi.n 801439c <_fputwc_r+0x1a> + 8014396: 6d90 ldr r0, [r2, #88] @ 0x58 + 8014398: f7fd fa28 bl 80117ec <__retarget_lock_acquire_recursive> + 801439c: f9b4 300c ldrsh.w r3, [r4, #12] + 80143a0: 0499 lsls r1, r3, #18 + 80143a2: d406 bmi.n 80143b2 <_fputwc_r+0x30> + 80143a4: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 80143a8: 81a3 strh r3, [r4, #12] + 80143aa: 6e63 ldr r3, [r4, #100] @ 0x64 + 80143ac: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 80143b0: 6663 str r3, [r4, #100] @ 0x64 + 80143b2: 4622 mov r2, r4 + 80143b4: 4628 mov r0, r5 + 80143b6: 4631 mov r1, r6 + 80143b8: f7ff ffa2 bl 8014300 <__fputwc> + 80143bc: 6e63 ldr r3, [r4, #100] @ 0x64 + 80143be: 07da lsls r2, r3, #31 + 80143c0: 4605 mov r5, r0 + 80143c2: d405 bmi.n 80143d0 <_fputwc_r+0x4e> + 80143c4: 89a3 ldrh r3, [r4, #12] + 80143c6: 059b lsls r3, r3, #22 + 80143c8: d402 bmi.n 80143d0 <_fputwc_r+0x4e> + 80143ca: 6da0 ldr r0, [r4, #88] @ 0x58 + 80143cc: f7fd fa0f bl 80117ee <__retarget_lock_release_recursive> + 80143d0: 4628 mov r0, r5 + 80143d2: bd70 pop {r4, r5, r6, pc} + +080143d4 : + 80143d4: b510 push {r4, lr} + 80143d6: 3901 subs r1, #1 + 80143d8: 4603 mov r3, r0 + 80143da: b132 cbz r2, 80143ea + 80143dc: f811 4f01 ldrb.w r4, [r1, #1]! + 80143e0: f803 4b01 strb.w r4, [r3], #1 + 80143e4: 3a01 subs r2, #1 + 80143e6: 2c00 cmp r4, #0 + 80143e8: d1f7 bne.n 80143da + 80143ea: 441a add r2, r3 + 80143ec: 2100 movs r1, #0 + 80143ee: 4293 cmp r3, r2 + 80143f0: d100 bne.n 80143f4 + 80143f2: bd10 pop {r4, pc} + 80143f4: f803 1b01 strb.w r1, [r3], #1 + 80143f8: e7f9 b.n 80143ee + ... + +080143fc <__locale_mb_cur_max>: + 80143fc: 4b01 ldr r3, [pc, #4] @ (8014404 <__locale_mb_cur_max+0x8>) + 80143fe: f893 0128 ldrb.w r0, [r3, #296] @ 0x128 + 8014402: 4770 bx lr + 8014404: 20000574 .word 0x20000574 + +08014408 <_localeconv_r>: + 8014408: 4800 ldr r0, [pc, #0] @ (801440c <_localeconv_r+0x4>) + 801440a: 4770 bx lr + 801440c: 20000664 .word 0x20000664 + +08014410 <_sbrk_r>: + 8014410: b538 push {r3, r4, r5, lr} + 8014412: 4d06 ldr r5, [pc, #24] @ (801442c <_sbrk_r+0x1c>) + 8014414: 2300 movs r3, #0 + 8014416: 4604 mov r4, r0 + 8014418: 4608 mov r0, r1 + 801441a: 602b str r3, [r5, #0] + 801441c: f001 fda0 bl 8015f60 <_sbrk> + 8014420: 1c43 adds r3, r0, #1 + 8014422: d102 bne.n 801442a <_sbrk_r+0x1a> + 8014424: 682b ldr r3, [r5, #0] + 8014426: b103 cbz r3, 801442a <_sbrk_r+0x1a> + 8014428: 6023 str r3, [r4, #0] + 801442a: bd38 pop {r3, r4, r5, pc} + 801442c: 20019370 .word 0x20019370 + +08014430 <__libc_fini_array>: + 8014430: b538 push {r3, r4, r5, lr} + 8014432: 4d07 ldr r5, [pc, #28] @ (8014450 <__libc_fini_array+0x20>) + 8014434: 4c07 ldr r4, [pc, #28] @ (8014454 <__libc_fini_array+0x24>) + 8014436: 1b64 subs r4, r4, r5 + 8014438: 10a4 asrs r4, r4, #2 + 801443a: b91c cbnz r4, 8014444 <__libc_fini_array+0x14> + 801443c: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} + 8014440: f001 bdac b.w 8015f9c <_fini> + 8014444: 3c01 subs r4, #1 + 8014446: f855 3024 ldr.w r3, [r5, r4, lsl #2] + 801444a: 4798 blx r3 + 801444c: e7f5 b.n 801443a <__libc_fini_array+0xa> + 801444e: bf00 nop + 8014450: 08019284 .word 0x08019284 + 8014454: 08019288 .word 0x08019288 + +08014458 : + 8014458: 2808 cmp r0, #8 + 801445a: b508 push {r3, lr} + 801445c: d006 beq.n 801446c + 801445e: f7fd f999 bl 8011794 <__errno> + 8014462: 2316 movs r3, #22 + 8014464: 6003 str r3, [r0, #0] + 8014466: f04f 30ff mov.w r0, #4294967295 + 801446a: bd08 pop {r3, pc} + 801446c: 2080 movs r0, #128 @ 0x80 + 801446e: e7fc b.n 801446a + +08014470 : + 8014470: b570 push {r4, r5, r6, lr} + 8014472: 2100 movs r1, #0 + 8014474: ec55 4b10 vmov r4, r5, d0 + 8014478: 6001 str r1, [r0, #0] + 801447a: 4915 ldr r1, [pc, #84] @ (80144d0 ) + 801447c: f025 4200 bic.w r2, r5, #2147483648 @ 0x80000000 + 8014480: 428a cmp r2, r1 + 8014482: 4606 mov r6, r0 + 8014484: 462b mov r3, r5 + 8014486: d820 bhi.n 80144ca + 8014488: 4621 mov r1, r4 + 801448a: 4311 orrs r1, r2 + 801448c: d01d beq.n 80144ca + 801448e: 4911 ldr r1, [pc, #68] @ (80144d4 ) + 8014490: 4029 ands r1, r5 + 8014492: b961 cbnz r1, 80144ae + 8014494: 4b10 ldr r3, [pc, #64] @ (80144d8 ) + 8014496: 2200 movs r2, #0 + 8014498: 4620 mov r0, r4 + 801449a: 4629 mov r1, r5 + 801449c: f7ec f8bc bl 8000618 <__aeabi_dmul> + 80144a0: 460b mov r3, r1 + 80144a2: f021 4200 bic.w r2, r1, #2147483648 @ 0x80000000 + 80144a6: f06f 0135 mvn.w r1, #53 @ 0x35 + 80144aa: 4604 mov r4, r0 + 80144ac: 6031 str r1, [r6, #0] + 80144ae: 6831 ldr r1, [r6, #0] + 80144b0: 1512 asrs r2, r2, #20 + 80144b2: f023 43ff bic.w r3, r3, #2139095040 @ 0x7f800000 + 80144b6: f2a2 32fe subw r2, r2, #1022 @ 0x3fe + 80144ba: f423 03e0 bic.w r3, r3, #7340032 @ 0x700000 + 80144be: 4411 add r1, r2 + 80144c0: f043 557f orr.w r5, r3, #1069547520 @ 0x3fc00000 + 80144c4: 6031 str r1, [r6, #0] + 80144c6: f445 1500 orr.w r5, r5, #2097152 @ 0x200000 + 80144ca: ec45 4b10 vmov d0, r4, r5 + 80144ce: bd70 pop {r4, r5, r6, pc} + 80144d0: 7fefffff .word 0x7fefffff + 80144d4: 7ff00000 .word 0x7ff00000 + 80144d8: 43500000 .word 0x43500000 + +080144dc <__register_exitproc>: + 80144dc: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 80144e0: f8df a074 ldr.w sl, [pc, #116] @ 8014558 <__register_exitproc+0x7c> + 80144e4: 4606 mov r6, r0 + 80144e6: f8da 0000 ldr.w r0, [sl] + 80144ea: 4698 mov r8, r3 + 80144ec: 460f mov r7, r1 + 80144ee: 4691 mov r9, r2 + 80144f0: f7fd f97c bl 80117ec <__retarget_lock_acquire_recursive> + 80144f4: 4b16 ldr r3, [pc, #88] @ (8014550 <__register_exitproc+0x74>) + 80144f6: 681c ldr r4, [r3, #0] + 80144f8: b90c cbnz r4, 80144fe <__register_exitproc+0x22> + 80144fa: 4c16 ldr r4, [pc, #88] @ (8014554 <__register_exitproc+0x78>) + 80144fc: 601c str r4, [r3, #0] + 80144fe: 6865 ldr r5, [r4, #4] + 8014500: f8da 0000 ldr.w r0, [sl] + 8014504: 2d1f cmp r5, #31 + 8014506: dd05 ble.n 8014514 <__register_exitproc+0x38> + 8014508: f7fd f971 bl 80117ee <__retarget_lock_release_recursive> + 801450c: f04f 30ff mov.w r0, #4294967295 + 8014510: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} + 8014514: b19e cbz r6, 801453e <__register_exitproc+0x62> + 8014516: eb04 0185 add.w r1, r4, r5, lsl #2 + 801451a: 2201 movs r2, #1 + 801451c: f8c1 9088 str.w r9, [r1, #136] @ 0x88 + 8014520: f8d4 3188 ldr.w r3, [r4, #392] @ 0x188 + 8014524: 40aa lsls r2, r5 + 8014526: 4313 orrs r3, r2 + 8014528: f8c4 3188 str.w r3, [r4, #392] @ 0x188 + 801452c: 2e02 cmp r6, #2 + 801452e: f8c1 8108 str.w r8, [r1, #264] @ 0x108 + 8014532: bf02 ittt eq + 8014534: f8d4 318c ldreq.w r3, [r4, #396] @ 0x18c + 8014538: 4313 orreq r3, r2 + 801453a: f8c4 318c streq.w r3, [r4, #396] @ 0x18c + 801453e: 1c6b adds r3, r5, #1 + 8014540: 3502 adds r5, #2 + 8014542: 6063 str r3, [r4, #4] + 8014544: f844 7025 str.w r7, [r4, r5, lsl #2] + 8014548: f7fd f951 bl 80117ee <__retarget_lock_release_recursive> + 801454c: 2000 movs r0, #0 + 801454e: e7df b.n 8014510 <__register_exitproc+0x34> + 8014550: 20019378 .word 0x20019378 + 8014554: 200193b0 .word 0x200193b0 + 8014558: 20000160 .word 0x20000160 + +0801455c : + 801455c: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8014560: 6903 ldr r3, [r0, #16] + 8014562: 690c ldr r4, [r1, #16] + 8014564: 42a3 cmp r3, r4 + 8014566: 4607 mov r7, r0 + 8014568: db7e blt.n 8014668 + 801456a: 3c01 subs r4, #1 + 801456c: f101 0814 add.w r8, r1, #20 + 8014570: 00a3 lsls r3, r4, #2 + 8014572: f100 0514 add.w r5, r0, #20 + 8014576: 9300 str r3, [sp, #0] + 8014578: eb05 0384 add.w r3, r5, r4, lsl #2 + 801457c: 9301 str r3, [sp, #4] + 801457e: f858 3024 ldr.w r3, [r8, r4, lsl #2] + 8014582: f855 2024 ldr.w r2, [r5, r4, lsl #2] + 8014586: 3301 adds r3, #1 + 8014588: 429a cmp r2, r3 + 801458a: eb08 0984 add.w r9, r8, r4, lsl #2 + 801458e: fbb2 f6f3 udiv r6, r2, r3 + 8014592: d32e bcc.n 80145f2 + 8014594: f04f 0a00 mov.w sl, #0 + 8014598: 46c4 mov ip, r8 + 801459a: 46ae mov lr, r5 + 801459c: 46d3 mov fp, sl + 801459e: f85c 3b04 ldr.w r3, [ip], #4 + 80145a2: b298 uxth r0, r3 + 80145a4: fb06 a000 mla r0, r6, r0, sl + 80145a8: 0c02 lsrs r2, r0, #16 + 80145aa: 0c1b lsrs r3, r3, #16 + 80145ac: fb06 2303 mla r3, r6, r3, r2 + 80145b0: f8de 2000 ldr.w r2, [lr] + 80145b4: b280 uxth r0, r0 + 80145b6: b292 uxth r2, r2 + 80145b8: 1a12 subs r2, r2, r0 + 80145ba: 445a add r2, fp + 80145bc: f8de 0000 ldr.w r0, [lr] + 80145c0: ea4f 4a13 mov.w sl, r3, lsr #16 + 80145c4: b29b uxth r3, r3 + 80145c6: ebc3 4322 rsb r3, r3, r2, asr #16 + 80145ca: eb03 4310 add.w r3, r3, r0, lsr #16 + 80145ce: b292 uxth r2, r2 + 80145d0: ea42 4203 orr.w r2, r2, r3, lsl #16 + 80145d4: 45e1 cmp r9, ip + 80145d6: f84e 2b04 str.w r2, [lr], #4 + 80145da: ea4f 4b23 mov.w fp, r3, asr #16 + 80145de: d2de bcs.n 801459e + 80145e0: 9b00 ldr r3, [sp, #0] + 80145e2: 58eb ldr r3, [r5, r3] + 80145e4: b92b cbnz r3, 80145f2 + 80145e6: 9b01 ldr r3, [sp, #4] + 80145e8: 3b04 subs r3, #4 + 80145ea: 429d cmp r5, r3 + 80145ec: 461a mov r2, r3 + 80145ee: d32f bcc.n 8014650 + 80145f0: 613c str r4, [r7, #16] + 80145f2: 4638 mov r0, r7 + 80145f4: f001 f826 bl 8015644 <__mcmp> + 80145f8: 2800 cmp r0, #0 + 80145fa: db25 blt.n 8014648 + 80145fc: 4629 mov r1, r5 + 80145fe: 2000 movs r0, #0 + 8014600: f858 2b04 ldr.w r2, [r8], #4 + 8014604: f8d1 c000 ldr.w ip, [r1] + 8014608: fa1f fe82 uxth.w lr, r2 + 801460c: fa1f f38c uxth.w r3, ip + 8014610: eba3 030e sub.w r3, r3, lr + 8014614: 4403 add r3, r0 + 8014616: 0c12 lsrs r2, r2, #16 + 8014618: ebc2 4223 rsb r2, r2, r3, asr #16 + 801461c: eb02 421c add.w r2, r2, ip, lsr #16 + 8014620: b29b uxth r3, r3 + 8014622: ea43 4302 orr.w r3, r3, r2, lsl #16 + 8014626: 45c1 cmp r9, r8 + 8014628: f841 3b04 str.w r3, [r1], #4 + 801462c: ea4f 4022 mov.w r0, r2, asr #16 + 8014630: d2e6 bcs.n 8014600 + 8014632: f855 2024 ldr.w r2, [r5, r4, lsl #2] + 8014636: eb05 0384 add.w r3, r5, r4, lsl #2 + 801463a: b922 cbnz r2, 8014646 + 801463c: 3b04 subs r3, #4 + 801463e: 429d cmp r5, r3 + 8014640: 461a mov r2, r3 + 8014642: d30b bcc.n 801465c + 8014644: 613c str r4, [r7, #16] + 8014646: 3601 adds r6, #1 + 8014648: 4630 mov r0, r6 + 801464a: b003 add sp, #12 + 801464c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 8014650: 6812 ldr r2, [r2, #0] + 8014652: 3b04 subs r3, #4 + 8014654: 2a00 cmp r2, #0 + 8014656: d1cb bne.n 80145f0 + 8014658: 3c01 subs r4, #1 + 801465a: e7c6 b.n 80145ea + 801465c: 6812 ldr r2, [r2, #0] + 801465e: 3b04 subs r3, #4 + 8014660: 2a00 cmp r2, #0 + 8014662: d1ef bne.n 8014644 + 8014664: 3c01 subs r4, #1 + 8014666: e7ea b.n 801463e + 8014668: 2000 movs r0, #0 + 801466a: e7ee b.n 801464a + 801466c: 0000 movs r0, r0 + ... + +08014670 <_dtoa_r>: + 8014670: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8014674: b099 sub sp, #100 @ 0x64 + 8014676: ed8d 0b02 vstr d0, [sp, #8] + 801467a: 9109 str r1, [sp, #36] @ 0x24 + 801467c: 6b81 ldr r1, [r0, #56] @ 0x38 + 801467e: 9e22 ldr r6, [sp, #136] @ 0x88 + 8014680: 920e str r2, [sp, #56] @ 0x38 + 8014682: ec55 4b10 vmov r4, r5, d0 + 8014686: 4683 mov fp, r0 + 8014688: 9313 str r3, [sp, #76] @ 0x4c + 801468a: b149 cbz r1, 80146a0 <_dtoa_r+0x30> + 801468c: 6bc2 ldr r2, [r0, #60] @ 0x3c + 801468e: 604a str r2, [r1, #4] + 8014690: 2301 movs r3, #1 + 8014692: 4093 lsls r3, r2 + 8014694: 608b str r3, [r1, #8] + 8014696: f000 fdce bl 8015236 <_Bfree> + 801469a: 2300 movs r3, #0 + 801469c: f8cb 3038 str.w r3, [fp, #56] @ 0x38 + 80146a0: 1e2b subs r3, r5, #0 + 80146a2: bfb9 ittee lt + 80146a4: f023 4300 biclt.w r3, r3, #2147483648 @ 0x80000000 + 80146a8: 9303 strlt r3, [sp, #12] + 80146aa: 2300 movge r3, #0 + 80146ac: 6033 strge r3, [r6, #0] + 80146ae: 9f03 ldr r7, [sp, #12] + 80146b0: 4b97 ldr r3, [pc, #604] @ (8014910 <_dtoa_r+0x2a0>) + 80146b2: bfbc itt lt + 80146b4: 2201 movlt r2, #1 + 80146b6: 6032 strlt r2, [r6, #0] + 80146b8: 43bb bics r3, r7 + 80146ba: d114 bne.n 80146e6 <_dtoa_r+0x76> + 80146bc: 9a13 ldr r2, [sp, #76] @ 0x4c + 80146be: f242 730f movw r3, #9999 @ 0x270f + 80146c2: 6013 str r3, [r2, #0] + 80146c4: f3c7 0313 ubfx r3, r7, #0, #20 + 80146c8: 4323 orrs r3, r4 + 80146ca: f000 854c beq.w 8015166 <_dtoa_r+0xaf6> + 80146ce: 9b23 ldr r3, [sp, #140] @ 0x8c + 80146d0: f8df a254 ldr.w sl, [pc, #596] @ 8014928 <_dtoa_r+0x2b8> + 80146d4: b11b cbz r3, 80146de <_dtoa_r+0x6e> + 80146d6: f10a 0303 add.w r3, sl, #3 + 80146da: 9a23 ldr r2, [sp, #140] @ 0x8c + 80146dc: 6013 str r3, [r2, #0] + 80146de: 4650 mov r0, sl + 80146e0: b019 add sp, #100 @ 0x64 + 80146e2: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 80146e6: ed9d 7b02 vldr d7, [sp, #8] + 80146ea: 2200 movs r2, #0 + 80146ec: ec51 0b17 vmov r0, r1, d7 + 80146f0: 2300 movs r3, #0 + 80146f2: ed8d 7b0c vstr d7, [sp, #48] @ 0x30 + 80146f6: f7ec f9f7 bl 8000ae8 <__aeabi_dcmpeq> + 80146fa: 4680 mov r8, r0 + 80146fc: b150 cbz r0, 8014714 <_dtoa_r+0xa4> + 80146fe: 9a13 ldr r2, [sp, #76] @ 0x4c + 8014700: 2301 movs r3, #1 + 8014702: 6013 str r3, [r2, #0] + 8014704: 9b23 ldr r3, [sp, #140] @ 0x8c + 8014706: b113 cbz r3, 801470e <_dtoa_r+0x9e> + 8014708: 9a23 ldr r2, [sp, #140] @ 0x8c + 801470a: 4b82 ldr r3, [pc, #520] @ (8014914 <_dtoa_r+0x2a4>) + 801470c: 6013 str r3, [r2, #0] + 801470e: f8df a21c ldr.w sl, [pc, #540] @ 801492c <_dtoa_r+0x2bc> + 8014712: e7e4 b.n 80146de <_dtoa_r+0x6e> + 8014714: ed9d 0b0c vldr d0, [sp, #48] @ 0x30 + 8014718: aa16 add r2, sp, #88 @ 0x58 + 801471a: a917 add r1, sp, #92 @ 0x5c + 801471c: 4658 mov r0, fp + 801471e: f001 f841 bl 80157a4 <__d2b> + 8014722: f3c7 560a ubfx r6, r7, #20, #11 + 8014726: 4681 mov r9, r0 + 8014728: 2e00 cmp r6, #0 + 801472a: d077 beq.n 801481c <_dtoa_r+0x1ac> + 801472c: 9b0d ldr r3, [sp, #52] @ 0x34 + 801472e: f8cd 8050 str.w r8, [sp, #80] @ 0x50 + 8014732: f3c3 0313 ubfx r3, r3, #0, #20 + 8014736: e9dd 010c ldrd r0, r1, [sp, #48] @ 0x30 + 801473a: f043 537f orr.w r3, r3, #1069547520 @ 0x3fc00000 + 801473e: f443 1340 orr.w r3, r3, #3145728 @ 0x300000 + 8014742: f2a6 36ff subw r6, r6, #1023 @ 0x3ff + 8014746: 4619 mov r1, r3 + 8014748: 2200 movs r2, #0 + 801474a: 4b73 ldr r3, [pc, #460] @ (8014918 <_dtoa_r+0x2a8>) + 801474c: f7eb fdac bl 80002a8 <__aeabi_dsub> + 8014750: a369 add r3, pc, #420 @ (adr r3, 80148f8 <_dtoa_r+0x288>) + 8014752: e9d3 2300 ldrd r2, r3, [r3] + 8014756: f7eb ff5f bl 8000618 <__aeabi_dmul> + 801475a: a369 add r3, pc, #420 @ (adr r3, 8014900 <_dtoa_r+0x290>) + 801475c: e9d3 2300 ldrd r2, r3, [r3] + 8014760: f7eb fda4 bl 80002ac <__adddf3> + 8014764: 4604 mov r4, r0 + 8014766: 4630 mov r0, r6 + 8014768: 460d mov r5, r1 + 801476a: f7eb feeb bl 8000544 <__aeabi_i2d> + 801476e: a366 add r3, pc, #408 @ (adr r3, 8014908 <_dtoa_r+0x298>) + 8014770: e9d3 2300 ldrd r2, r3, [r3] + 8014774: f7eb ff50 bl 8000618 <__aeabi_dmul> + 8014778: 4602 mov r2, r0 + 801477a: 460b mov r3, r1 + 801477c: 4620 mov r0, r4 + 801477e: 4629 mov r1, r5 + 8014780: f7eb fd94 bl 80002ac <__adddf3> + 8014784: 4604 mov r4, r0 + 8014786: 460d mov r5, r1 + 8014788: f7ec f9f6 bl 8000b78 <__aeabi_d2iz> + 801478c: 2200 movs r2, #0 + 801478e: 4607 mov r7, r0 + 8014790: 2300 movs r3, #0 + 8014792: 4620 mov r0, r4 + 8014794: 4629 mov r1, r5 + 8014796: f7ec f9b1 bl 8000afc <__aeabi_dcmplt> + 801479a: b140 cbz r0, 80147ae <_dtoa_r+0x13e> + 801479c: 4638 mov r0, r7 + 801479e: f7eb fed1 bl 8000544 <__aeabi_i2d> + 80147a2: 4622 mov r2, r4 + 80147a4: 462b mov r3, r5 + 80147a6: f7ec f99f bl 8000ae8 <__aeabi_dcmpeq> + 80147aa: b900 cbnz r0, 80147ae <_dtoa_r+0x13e> + 80147ac: 3f01 subs r7, #1 + 80147ae: 2f16 cmp r7, #22 + 80147b0: d851 bhi.n 8014856 <_dtoa_r+0x1e6> + 80147b2: 4b5a ldr r3, [pc, #360] @ (801491c <_dtoa_r+0x2ac>) + 80147b4: eb03 03c7 add.w r3, r3, r7, lsl #3 + 80147b8: e9d3 2300 ldrd r2, r3, [r3] + 80147bc: e9dd 010c ldrd r0, r1, [sp, #48] @ 0x30 + 80147c0: f7ec f99c bl 8000afc <__aeabi_dcmplt> + 80147c4: 2800 cmp r0, #0 + 80147c6: d048 beq.n 801485a <_dtoa_r+0x1ea> + 80147c8: 3f01 subs r7, #1 + 80147ca: 2300 movs r3, #0 + 80147cc: 9312 str r3, [sp, #72] @ 0x48 + 80147ce: 9b16 ldr r3, [sp, #88] @ 0x58 + 80147d0: 1b9b subs r3, r3, r6 + 80147d2: 1e5a subs r2, r3, #1 + 80147d4: bf44 itt mi + 80147d6: f1c3 0801 rsbmi r8, r3, #1 + 80147da: 2300 movmi r3, #0 + 80147dc: 9208 str r2, [sp, #32] + 80147de: bf54 ite pl + 80147e0: f04f 0800 movpl.w r8, #0 + 80147e4: 9308 strmi r3, [sp, #32] + 80147e6: 2f00 cmp r7, #0 + 80147e8: db39 blt.n 801485e <_dtoa_r+0x1ee> + 80147ea: 9b08 ldr r3, [sp, #32] + 80147ec: 970f str r7, [sp, #60] @ 0x3c + 80147ee: 443b add r3, r7 + 80147f0: 9308 str r3, [sp, #32] + 80147f2: 2300 movs r3, #0 + 80147f4: 930a str r3, [sp, #40] @ 0x28 + 80147f6: 9b09 ldr r3, [sp, #36] @ 0x24 + 80147f8: 2b09 cmp r3, #9 + 80147fa: d865 bhi.n 80148c8 <_dtoa_r+0x258> + 80147fc: 2b05 cmp r3, #5 + 80147fe: bfc4 itt gt + 8014800: 3b04 subgt r3, #4 + 8014802: 9309 strgt r3, [sp, #36] @ 0x24 + 8014804: 9b09 ldr r3, [sp, #36] @ 0x24 + 8014806: f1a3 0302 sub.w r3, r3, #2 + 801480a: bfcc ite gt + 801480c: 2400 movgt r4, #0 + 801480e: 2401 movle r4, #1 + 8014810: 2b03 cmp r3, #3 + 8014812: d864 bhi.n 80148de <_dtoa_r+0x26e> + 8014814: e8df f003 tbb [pc, r3] + 8014818: 5635372a .word 0x5635372a + 801481c: e9dd 6316 ldrd r6, r3, [sp, #88] @ 0x58 + 8014820: 441e add r6, r3 + 8014822: f206 4332 addw r3, r6, #1074 @ 0x432 + 8014826: 2b20 cmp r3, #32 + 8014828: bfc1 itttt gt + 801482a: f1c3 0340 rsbgt r3, r3, #64 @ 0x40 + 801482e: 409f lslgt r7, r3 + 8014830: f206 4312 addwgt r3, r6, #1042 @ 0x412 + 8014834: fa24 f303 lsrgt.w r3, r4, r3 + 8014838: bfd6 itet le + 801483a: f1c3 0320 rsble r3, r3, #32 + 801483e: ea47 0003 orrgt.w r0, r7, r3 + 8014842: fa04 f003 lslle.w r0, r4, r3 + 8014846: f7eb fe6d bl 8000524 <__aeabi_ui2d> + 801484a: 2201 movs r2, #1 + 801484c: f1a1 73f8 sub.w r3, r1, #32505856 @ 0x1f00000 + 8014850: 3e01 subs r6, #1 + 8014852: 9214 str r2, [sp, #80] @ 0x50 + 8014854: e777 b.n 8014746 <_dtoa_r+0xd6> + 8014856: 2301 movs r3, #1 + 8014858: e7b8 b.n 80147cc <_dtoa_r+0x15c> + 801485a: 9012 str r0, [sp, #72] @ 0x48 + 801485c: e7b7 b.n 80147ce <_dtoa_r+0x15e> + 801485e: 427b negs r3, r7 + 8014860: 930a str r3, [sp, #40] @ 0x28 + 8014862: 2300 movs r3, #0 + 8014864: eba8 0807 sub.w r8, r8, r7 + 8014868: 930f str r3, [sp, #60] @ 0x3c + 801486a: e7c4 b.n 80147f6 <_dtoa_r+0x186> + 801486c: 2300 movs r3, #0 + 801486e: 930b str r3, [sp, #44] @ 0x2c + 8014870: 9b0e ldr r3, [sp, #56] @ 0x38 + 8014872: 2b00 cmp r3, #0 + 8014874: dc36 bgt.n 80148e4 <_dtoa_r+0x274> + 8014876: 2301 movs r3, #1 + 8014878: 9300 str r3, [sp, #0] + 801487a: 9307 str r3, [sp, #28] + 801487c: 461a mov r2, r3 + 801487e: 920e str r2, [sp, #56] @ 0x38 + 8014880: e00b b.n 801489a <_dtoa_r+0x22a> + 8014882: 2301 movs r3, #1 + 8014884: e7f3 b.n 801486e <_dtoa_r+0x1fe> + 8014886: 2300 movs r3, #0 + 8014888: 930b str r3, [sp, #44] @ 0x2c + 801488a: 9b0e ldr r3, [sp, #56] @ 0x38 + 801488c: 18fb adds r3, r7, r3 + 801488e: 9300 str r3, [sp, #0] + 8014890: 3301 adds r3, #1 + 8014892: 2b01 cmp r3, #1 + 8014894: 9307 str r3, [sp, #28] + 8014896: bfb8 it lt + 8014898: 2301 movlt r3, #1 + 801489a: 2100 movs r1, #0 + 801489c: 2204 movs r2, #4 + 801489e: f102 0014 add.w r0, r2, #20 + 80148a2: 4298 cmp r0, r3 + 80148a4: d922 bls.n 80148ec <_dtoa_r+0x27c> + 80148a6: f8cb 103c str.w r1, [fp, #60] @ 0x3c + 80148aa: 4658 mov r0, fp + 80148ac: f000 fc9e bl 80151ec <_Balloc> + 80148b0: 4682 mov sl, r0 + 80148b2: 2800 cmp r0, #0 + 80148b4: d13c bne.n 8014930 <_dtoa_r+0x2c0> + 80148b6: 4b1a ldr r3, [pc, #104] @ (8014920 <_dtoa_r+0x2b0>) + 80148b8: 4602 mov r2, r0 + 80148ba: f240 11af movw r1, #431 @ 0x1af + 80148be: 4819 ldr r0, [pc, #100] @ (8014924 <_dtoa_r+0x2b4>) + 80148c0: f001 fa64 bl 8015d8c <__assert_func> + 80148c4: 2301 movs r3, #1 + 80148c6: e7df b.n 8014888 <_dtoa_r+0x218> + 80148c8: 2401 movs r4, #1 + 80148ca: 2300 movs r3, #0 + 80148cc: 9309 str r3, [sp, #36] @ 0x24 + 80148ce: 940b str r4, [sp, #44] @ 0x2c + 80148d0: f04f 33ff mov.w r3, #4294967295 + 80148d4: 9300 str r3, [sp, #0] + 80148d6: 9307 str r3, [sp, #28] + 80148d8: 2200 movs r2, #0 + 80148da: 2312 movs r3, #18 + 80148dc: e7cf b.n 801487e <_dtoa_r+0x20e> + 80148de: 2301 movs r3, #1 + 80148e0: 930b str r3, [sp, #44] @ 0x2c + 80148e2: e7f5 b.n 80148d0 <_dtoa_r+0x260> + 80148e4: 9b0e ldr r3, [sp, #56] @ 0x38 + 80148e6: 9300 str r3, [sp, #0] + 80148e8: 9307 str r3, [sp, #28] + 80148ea: e7d6 b.n 801489a <_dtoa_r+0x22a> + 80148ec: 3101 adds r1, #1 + 80148ee: 0052 lsls r2, r2, #1 + 80148f0: e7d5 b.n 801489e <_dtoa_r+0x22e> + 80148f2: bf00 nop + 80148f4: f3af 8000 nop.w + 80148f8: 636f4361 .word 0x636f4361 + 80148fc: 3fd287a7 .word 0x3fd287a7 + 8014900: 8b60c8b3 .word 0x8b60c8b3 + 8014904: 3fc68a28 .word 0x3fc68a28 + 8014908: 509f79fb .word 0x509f79fb + 801490c: 3fd34413 .word 0x3fd34413 + 8014910: 7ff00000 .word 0x7ff00000 + 8014914: 0801901e .word 0x0801901e + 8014918: 3ff80000 .word 0x3ff80000 + 801491c: 08019170 .word 0x08019170 + 8014920: 08019076 .word 0x08019076 + 8014924: 08019087 .word 0x08019087 + 8014928: 08019072 .word 0x08019072 + 801492c: 0801901d .word 0x0801901d + 8014930: 9b07 ldr r3, [sp, #28] + 8014932: f8cb 0038 str.w r0, [fp, #56] @ 0x38 + 8014936: 2b0e cmp r3, #14 + 8014938: f200 80a4 bhi.w 8014a84 <_dtoa_r+0x414> + 801493c: 2c00 cmp r4, #0 + 801493e: f000 80a1 beq.w 8014a84 <_dtoa_r+0x414> + 8014942: 2f00 cmp r7, #0 + 8014944: dd33 ble.n 80149ae <_dtoa_r+0x33e> + 8014946: 4bae ldr r3, [pc, #696] @ (8014c00 <_dtoa_r+0x590>) + 8014948: f007 020f and.w r2, r7, #15 + 801494c: eb03 03c2 add.w r3, r3, r2, lsl #3 + 8014950: ed93 7b00 vldr d7, [r3] + 8014954: 05f8 lsls r0, r7, #23 + 8014956: ed8d 7b04 vstr d7, [sp, #16] + 801495a: ea4f 1427 mov.w r4, r7, asr #4 + 801495e: d516 bpl.n 801498e <_dtoa_r+0x31e> + 8014960: 4ba8 ldr r3, [pc, #672] @ (8014c04 <_dtoa_r+0x594>) + 8014962: e9dd 010c ldrd r0, r1, [sp, #48] @ 0x30 + 8014966: e9d3 2308 ldrd r2, r3, [r3, #32] + 801496a: f7eb ff7f bl 800086c <__aeabi_ddiv> + 801496e: e9cd 0102 strd r0, r1, [sp, #8] + 8014972: f004 040f and.w r4, r4, #15 + 8014976: 2603 movs r6, #3 + 8014978: 4da2 ldr r5, [pc, #648] @ (8014c04 <_dtoa_r+0x594>) + 801497a: b954 cbnz r4, 8014992 <_dtoa_r+0x322> + 801497c: e9dd 2304 ldrd r2, r3, [sp, #16] + 8014980: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014984: f7eb ff72 bl 800086c <__aeabi_ddiv> + 8014988: e9cd 0102 strd r0, r1, [sp, #8] + 801498c: e028 b.n 80149e0 <_dtoa_r+0x370> + 801498e: 2602 movs r6, #2 + 8014990: e7f2 b.n 8014978 <_dtoa_r+0x308> + 8014992: 07e1 lsls r1, r4, #31 + 8014994: d508 bpl.n 80149a8 <_dtoa_r+0x338> + 8014996: e9dd 0104 ldrd r0, r1, [sp, #16] + 801499a: e9d5 2300 ldrd r2, r3, [r5] + 801499e: f7eb fe3b bl 8000618 <__aeabi_dmul> + 80149a2: e9cd 0104 strd r0, r1, [sp, #16] + 80149a6: 3601 adds r6, #1 + 80149a8: 1064 asrs r4, r4, #1 + 80149aa: 3508 adds r5, #8 + 80149ac: e7e5 b.n 801497a <_dtoa_r+0x30a> + 80149ae: f000 80d2 beq.w 8014b56 <_dtoa_r+0x4e6> + 80149b2: 427c negs r4, r7 + 80149b4: 4b92 ldr r3, [pc, #584] @ (8014c00 <_dtoa_r+0x590>) + 80149b6: 4d93 ldr r5, [pc, #588] @ (8014c04 <_dtoa_r+0x594>) + 80149b8: f004 020f and.w r2, r4, #15 + 80149bc: eb03 03c2 add.w r3, r3, r2, lsl #3 + 80149c0: e9d3 2300 ldrd r2, r3, [r3] + 80149c4: e9dd 010c ldrd r0, r1, [sp, #48] @ 0x30 + 80149c8: f7eb fe26 bl 8000618 <__aeabi_dmul> + 80149cc: e9cd 0102 strd r0, r1, [sp, #8] + 80149d0: 1124 asrs r4, r4, #4 + 80149d2: 2300 movs r3, #0 + 80149d4: 2602 movs r6, #2 + 80149d6: 2c00 cmp r4, #0 + 80149d8: f040 80b2 bne.w 8014b40 <_dtoa_r+0x4d0> + 80149dc: 2b00 cmp r3, #0 + 80149de: d1d3 bne.n 8014988 <_dtoa_r+0x318> + 80149e0: 9b12 ldr r3, [sp, #72] @ 0x48 + 80149e2: e9dd 4502 ldrd r4, r5, [sp, #8] + 80149e6: 2b00 cmp r3, #0 + 80149e8: f000 80b7 beq.w 8014b5a <_dtoa_r+0x4ea> + 80149ec: 4b86 ldr r3, [pc, #536] @ (8014c08 <_dtoa_r+0x598>) + 80149ee: 2200 movs r2, #0 + 80149f0: 4620 mov r0, r4 + 80149f2: 4629 mov r1, r5 + 80149f4: f7ec f882 bl 8000afc <__aeabi_dcmplt> + 80149f8: 2800 cmp r0, #0 + 80149fa: f000 80ae beq.w 8014b5a <_dtoa_r+0x4ea> + 80149fe: 9b07 ldr r3, [sp, #28] + 8014a00: 2b00 cmp r3, #0 + 8014a02: f000 80aa beq.w 8014b5a <_dtoa_r+0x4ea> + 8014a06: 9b00 ldr r3, [sp, #0] + 8014a08: 2b00 cmp r3, #0 + 8014a0a: dd37 ble.n 8014a7c <_dtoa_r+0x40c> + 8014a0c: 1e7b subs r3, r7, #1 + 8014a0e: 9304 str r3, [sp, #16] + 8014a10: 4620 mov r0, r4 + 8014a12: 4b7e ldr r3, [pc, #504] @ (8014c0c <_dtoa_r+0x59c>) + 8014a14: 2200 movs r2, #0 + 8014a16: 4629 mov r1, r5 + 8014a18: f7eb fdfe bl 8000618 <__aeabi_dmul> + 8014a1c: e9cd 0102 strd r0, r1, [sp, #8] + 8014a20: 9c00 ldr r4, [sp, #0] + 8014a22: 3601 adds r6, #1 + 8014a24: 4630 mov r0, r6 + 8014a26: f7eb fd8d bl 8000544 <__aeabi_i2d> + 8014a2a: e9dd 2302 ldrd r2, r3, [sp, #8] + 8014a2e: f7eb fdf3 bl 8000618 <__aeabi_dmul> + 8014a32: 4b77 ldr r3, [pc, #476] @ (8014c10 <_dtoa_r+0x5a0>) + 8014a34: 2200 movs r2, #0 + 8014a36: f7eb fc39 bl 80002ac <__adddf3> + 8014a3a: 4605 mov r5, r0 + 8014a3c: f1a1 7650 sub.w r6, r1, #54525952 @ 0x3400000 + 8014a40: 2c00 cmp r4, #0 + 8014a42: f040 808d bne.w 8014b60 <_dtoa_r+0x4f0> + 8014a46: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014a4a: 4b72 ldr r3, [pc, #456] @ (8014c14 <_dtoa_r+0x5a4>) + 8014a4c: 2200 movs r2, #0 + 8014a4e: f7eb fc2b bl 80002a8 <__aeabi_dsub> + 8014a52: 4602 mov r2, r0 + 8014a54: 460b mov r3, r1 + 8014a56: e9cd 2302 strd r2, r3, [sp, #8] + 8014a5a: 462a mov r2, r5 + 8014a5c: 4633 mov r3, r6 + 8014a5e: f7ec f86b bl 8000b38 <__aeabi_dcmpgt> + 8014a62: 2800 cmp r0, #0 + 8014a64: f040 828c bne.w 8014f80 <_dtoa_r+0x910> + 8014a68: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014a6c: 462a mov r2, r5 + 8014a6e: f106 4300 add.w r3, r6, #2147483648 @ 0x80000000 + 8014a72: f7ec f843 bl 8000afc <__aeabi_dcmplt> + 8014a76: 2800 cmp r0, #0 + 8014a78: f040 8129 bne.w 8014cce <_dtoa_r+0x65e> + 8014a7c: e9dd 340c ldrd r3, r4, [sp, #48] @ 0x30 + 8014a80: e9cd 3402 strd r3, r4, [sp, #8] + 8014a84: 9b17 ldr r3, [sp, #92] @ 0x5c + 8014a86: 2b00 cmp r3, #0 + 8014a88: f2c0 815b blt.w 8014d42 <_dtoa_r+0x6d2> + 8014a8c: 2f0e cmp r7, #14 + 8014a8e: f300 8158 bgt.w 8014d42 <_dtoa_r+0x6d2> + 8014a92: 4b5b ldr r3, [pc, #364] @ (8014c00 <_dtoa_r+0x590>) + 8014a94: eb03 03c7 add.w r3, r3, r7, lsl #3 + 8014a98: ed93 7b00 vldr d7, [r3] + 8014a9c: 9b0e ldr r3, [sp, #56] @ 0x38 + 8014a9e: 2b00 cmp r3, #0 + 8014aa0: ed8d 7b00 vstr d7, [sp] + 8014aa4: da03 bge.n 8014aae <_dtoa_r+0x43e> + 8014aa6: 9b07 ldr r3, [sp, #28] + 8014aa8: 2b00 cmp r3, #0 + 8014aaa: f340 8102 ble.w 8014cb2 <_dtoa_r+0x642> + 8014aae: e9dd 4502 ldrd r4, r5, [sp, #8] + 8014ab2: 4656 mov r6, sl + 8014ab4: e9dd 2300 ldrd r2, r3, [sp] + 8014ab8: 4620 mov r0, r4 + 8014aba: 4629 mov r1, r5 + 8014abc: f7eb fed6 bl 800086c <__aeabi_ddiv> + 8014ac0: f7ec f85a bl 8000b78 <__aeabi_d2iz> + 8014ac4: 4680 mov r8, r0 + 8014ac6: f7eb fd3d bl 8000544 <__aeabi_i2d> + 8014aca: e9dd 2300 ldrd r2, r3, [sp] + 8014ace: f7eb fda3 bl 8000618 <__aeabi_dmul> + 8014ad2: 4602 mov r2, r0 + 8014ad4: 460b mov r3, r1 + 8014ad6: 4620 mov r0, r4 + 8014ad8: 4629 mov r1, r5 + 8014ada: f108 0430 add.w r4, r8, #48 @ 0x30 + 8014ade: f7eb fbe3 bl 80002a8 <__aeabi_dsub> + 8014ae2: f806 4b01 strb.w r4, [r6], #1 + 8014ae6: 9d07 ldr r5, [sp, #28] + 8014ae8: eba6 040a sub.w r4, r6, sl + 8014aec: 42a5 cmp r5, r4 + 8014aee: 4602 mov r2, r0 + 8014af0: 460b mov r3, r1 + 8014af2: f040 8118 bne.w 8014d26 <_dtoa_r+0x6b6> + 8014af6: f7eb fbd9 bl 80002ac <__adddf3> + 8014afa: e9dd 2300 ldrd r2, r3, [sp] + 8014afe: 4604 mov r4, r0 + 8014b00: 460d mov r5, r1 + 8014b02: f7ec f819 bl 8000b38 <__aeabi_dcmpgt> + 8014b06: 2800 cmp r0, #0 + 8014b08: f040 80fa bne.w 8014d00 <_dtoa_r+0x690> + 8014b0c: e9dd 2300 ldrd r2, r3, [sp] + 8014b10: 4620 mov r0, r4 + 8014b12: 4629 mov r1, r5 + 8014b14: f7eb ffe8 bl 8000ae8 <__aeabi_dcmpeq> + 8014b18: b118 cbz r0, 8014b22 <_dtoa_r+0x4b2> + 8014b1a: f018 0f01 tst.w r8, #1 + 8014b1e: f040 80ef bne.w 8014d00 <_dtoa_r+0x690> + 8014b22: 4649 mov r1, r9 + 8014b24: 4658 mov r0, fp + 8014b26: f000 fb86 bl 8015236 <_Bfree> + 8014b2a: 2300 movs r3, #0 + 8014b2c: 7033 strb r3, [r6, #0] + 8014b2e: 9b13 ldr r3, [sp, #76] @ 0x4c + 8014b30: 3701 adds r7, #1 + 8014b32: 601f str r7, [r3, #0] + 8014b34: 9b23 ldr r3, [sp, #140] @ 0x8c + 8014b36: 2b00 cmp r3, #0 + 8014b38: f43f add1 beq.w 80146de <_dtoa_r+0x6e> + 8014b3c: 601e str r6, [r3, #0] + 8014b3e: e5ce b.n 80146de <_dtoa_r+0x6e> + 8014b40: 07e2 lsls r2, r4, #31 + 8014b42: d505 bpl.n 8014b50 <_dtoa_r+0x4e0> + 8014b44: e9d5 2300 ldrd r2, r3, [r5] + 8014b48: f7eb fd66 bl 8000618 <__aeabi_dmul> + 8014b4c: 3601 adds r6, #1 + 8014b4e: 2301 movs r3, #1 + 8014b50: 1064 asrs r4, r4, #1 + 8014b52: 3508 adds r5, #8 + 8014b54: e73f b.n 80149d6 <_dtoa_r+0x366> + 8014b56: 2602 movs r6, #2 + 8014b58: e742 b.n 80149e0 <_dtoa_r+0x370> + 8014b5a: 9c07 ldr r4, [sp, #28] + 8014b5c: 9704 str r7, [sp, #16] + 8014b5e: e761 b.n 8014a24 <_dtoa_r+0x3b4> + 8014b60: 4b27 ldr r3, [pc, #156] @ (8014c00 <_dtoa_r+0x590>) + 8014b62: 990b ldr r1, [sp, #44] @ 0x2c + 8014b64: eb03 03c4 add.w r3, r3, r4, lsl #3 + 8014b68: e953 2302 ldrd r2, r3, [r3, #-8] + 8014b6c: 4454 add r4, sl + 8014b6e: 2900 cmp r1, #0 + 8014b70: d054 beq.n 8014c1c <_dtoa_r+0x5ac> + 8014b72: 4929 ldr r1, [pc, #164] @ (8014c18 <_dtoa_r+0x5a8>) + 8014b74: 2000 movs r0, #0 + 8014b76: f7eb fe79 bl 800086c <__aeabi_ddiv> + 8014b7a: 4633 mov r3, r6 + 8014b7c: 462a mov r2, r5 + 8014b7e: f7eb fb93 bl 80002a8 <__aeabi_dsub> + 8014b82: e9cd 0110 strd r0, r1, [sp, #64] @ 0x40 + 8014b86: 4656 mov r6, sl + 8014b88: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014b8c: f7eb fff4 bl 8000b78 <__aeabi_d2iz> + 8014b90: 4605 mov r5, r0 + 8014b92: f7eb fcd7 bl 8000544 <__aeabi_i2d> + 8014b96: 4602 mov r2, r0 + 8014b98: 460b mov r3, r1 + 8014b9a: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014b9e: f7eb fb83 bl 80002a8 <__aeabi_dsub> + 8014ba2: 3530 adds r5, #48 @ 0x30 + 8014ba4: 4602 mov r2, r0 + 8014ba6: 460b mov r3, r1 + 8014ba8: e9cd 2302 strd r2, r3, [sp, #8] + 8014bac: f806 5b01 strb.w r5, [r6], #1 + 8014bb0: e9dd 2310 ldrd r2, r3, [sp, #64] @ 0x40 + 8014bb4: f7eb ffa2 bl 8000afc <__aeabi_dcmplt> + 8014bb8: 2800 cmp r0, #0 + 8014bba: d172 bne.n 8014ca2 <_dtoa_r+0x632> + 8014bbc: e9dd 2302 ldrd r2, r3, [sp, #8] + 8014bc0: 4911 ldr r1, [pc, #68] @ (8014c08 <_dtoa_r+0x598>) + 8014bc2: 2000 movs r0, #0 + 8014bc4: f7eb fb70 bl 80002a8 <__aeabi_dsub> + 8014bc8: e9dd 2310 ldrd r2, r3, [sp, #64] @ 0x40 + 8014bcc: f7eb ff96 bl 8000afc <__aeabi_dcmplt> + 8014bd0: 2800 cmp r0, #0 + 8014bd2: f040 8096 bne.w 8014d02 <_dtoa_r+0x692> + 8014bd6: 42a6 cmp r6, r4 + 8014bd8: f43f af50 beq.w 8014a7c <_dtoa_r+0x40c> + 8014bdc: e9dd 0110 ldrd r0, r1, [sp, #64] @ 0x40 + 8014be0: 4b0a ldr r3, [pc, #40] @ (8014c0c <_dtoa_r+0x59c>) + 8014be2: 2200 movs r2, #0 + 8014be4: f7eb fd18 bl 8000618 <__aeabi_dmul> + 8014be8: 4b08 ldr r3, [pc, #32] @ (8014c0c <_dtoa_r+0x59c>) + 8014bea: e9cd 0110 strd r0, r1, [sp, #64] @ 0x40 + 8014bee: 2200 movs r2, #0 + 8014bf0: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014bf4: f7eb fd10 bl 8000618 <__aeabi_dmul> + 8014bf8: e9cd 0102 strd r0, r1, [sp, #8] + 8014bfc: e7c4 b.n 8014b88 <_dtoa_r+0x518> + 8014bfe: bf00 nop + 8014c00: 08019170 .word 0x08019170 + 8014c04: 08019148 .word 0x08019148 + 8014c08: 3ff00000 .word 0x3ff00000 + 8014c0c: 40240000 .word 0x40240000 + 8014c10: 401c0000 .word 0x401c0000 + 8014c14: 40140000 .word 0x40140000 + 8014c18: 3fe00000 .word 0x3fe00000 + 8014c1c: 4631 mov r1, r6 + 8014c1e: 4628 mov r0, r5 + 8014c20: f7eb fcfa bl 8000618 <__aeabi_dmul> + 8014c24: e9cd 0110 strd r0, r1, [sp, #64] @ 0x40 + 8014c28: 9415 str r4, [sp, #84] @ 0x54 + 8014c2a: 4656 mov r6, sl + 8014c2c: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014c30: f7eb ffa2 bl 8000b78 <__aeabi_d2iz> + 8014c34: 4605 mov r5, r0 + 8014c36: f7eb fc85 bl 8000544 <__aeabi_i2d> + 8014c3a: 4602 mov r2, r0 + 8014c3c: 460b mov r3, r1 + 8014c3e: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014c42: f7eb fb31 bl 80002a8 <__aeabi_dsub> + 8014c46: 3530 adds r5, #48 @ 0x30 + 8014c48: f806 5b01 strb.w r5, [r6], #1 + 8014c4c: 4602 mov r2, r0 + 8014c4e: 460b mov r3, r1 + 8014c50: 42a6 cmp r6, r4 + 8014c52: e9cd 2302 strd r2, r3, [sp, #8] + 8014c56: f04f 0200 mov.w r2, #0 + 8014c5a: d124 bne.n 8014ca6 <_dtoa_r+0x636> + 8014c5c: 4bac ldr r3, [pc, #688] @ (8014f10 <_dtoa_r+0x8a0>) + 8014c5e: e9dd 0110 ldrd r0, r1, [sp, #64] @ 0x40 + 8014c62: f7eb fb23 bl 80002ac <__adddf3> + 8014c66: 4602 mov r2, r0 + 8014c68: 460b mov r3, r1 + 8014c6a: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014c6e: f7eb ff63 bl 8000b38 <__aeabi_dcmpgt> + 8014c72: 2800 cmp r0, #0 + 8014c74: d145 bne.n 8014d02 <_dtoa_r+0x692> + 8014c76: e9dd 2310 ldrd r2, r3, [sp, #64] @ 0x40 + 8014c7a: 49a5 ldr r1, [pc, #660] @ (8014f10 <_dtoa_r+0x8a0>) + 8014c7c: 2000 movs r0, #0 + 8014c7e: f7eb fb13 bl 80002a8 <__aeabi_dsub> + 8014c82: 4602 mov r2, r0 + 8014c84: 460b mov r3, r1 + 8014c86: e9dd 0102 ldrd r0, r1, [sp, #8] + 8014c8a: f7eb ff37 bl 8000afc <__aeabi_dcmplt> + 8014c8e: 2800 cmp r0, #0 + 8014c90: f43f aef4 beq.w 8014a7c <_dtoa_r+0x40c> + 8014c94: 9e15 ldr r6, [sp, #84] @ 0x54 + 8014c96: 1e73 subs r3, r6, #1 + 8014c98: 9315 str r3, [sp, #84] @ 0x54 + 8014c9a: f816 3c01 ldrb.w r3, [r6, #-1] + 8014c9e: 2b30 cmp r3, #48 @ 0x30 + 8014ca0: d0f8 beq.n 8014c94 <_dtoa_r+0x624> + 8014ca2: 9f04 ldr r7, [sp, #16] + 8014ca4: e73d b.n 8014b22 <_dtoa_r+0x4b2> + 8014ca6: 4b9b ldr r3, [pc, #620] @ (8014f14 <_dtoa_r+0x8a4>) + 8014ca8: f7eb fcb6 bl 8000618 <__aeabi_dmul> + 8014cac: e9cd 0102 strd r0, r1, [sp, #8] + 8014cb0: e7bc b.n 8014c2c <_dtoa_r+0x5bc> + 8014cb2: d10c bne.n 8014cce <_dtoa_r+0x65e> + 8014cb4: 4b98 ldr r3, [pc, #608] @ (8014f18 <_dtoa_r+0x8a8>) + 8014cb6: 2200 movs r2, #0 + 8014cb8: e9dd 0100 ldrd r0, r1, [sp] + 8014cbc: f7eb fcac bl 8000618 <__aeabi_dmul> + 8014cc0: e9dd 2302 ldrd r2, r3, [sp, #8] + 8014cc4: f7eb ff2e bl 8000b24 <__aeabi_dcmpge> + 8014cc8: 2800 cmp r0, #0 + 8014cca: f000 8157 beq.w 8014f7c <_dtoa_r+0x90c> + 8014cce: 2400 movs r4, #0 + 8014cd0: 4625 mov r5, r4 + 8014cd2: 9b0e ldr r3, [sp, #56] @ 0x38 + 8014cd4: 43db mvns r3, r3 + 8014cd6: 9304 str r3, [sp, #16] + 8014cd8: 4656 mov r6, sl + 8014cda: 2700 movs r7, #0 + 8014cdc: 4621 mov r1, r4 + 8014cde: 4658 mov r0, fp + 8014ce0: f000 faa9 bl 8015236 <_Bfree> + 8014ce4: 2d00 cmp r5, #0 + 8014ce6: d0dc beq.n 8014ca2 <_dtoa_r+0x632> + 8014ce8: b12f cbz r7, 8014cf6 <_dtoa_r+0x686> + 8014cea: 42af cmp r7, r5 + 8014cec: d003 beq.n 8014cf6 <_dtoa_r+0x686> + 8014cee: 4639 mov r1, r7 + 8014cf0: 4658 mov r0, fp + 8014cf2: f000 faa0 bl 8015236 <_Bfree> + 8014cf6: 4629 mov r1, r5 + 8014cf8: 4658 mov r0, fp + 8014cfa: f000 fa9c bl 8015236 <_Bfree> + 8014cfe: e7d0 b.n 8014ca2 <_dtoa_r+0x632> + 8014d00: 9704 str r7, [sp, #16] + 8014d02: 4633 mov r3, r6 + 8014d04: 461e mov r6, r3 + 8014d06: f813 2d01 ldrb.w r2, [r3, #-1]! + 8014d0a: 2a39 cmp r2, #57 @ 0x39 + 8014d0c: d107 bne.n 8014d1e <_dtoa_r+0x6ae> + 8014d0e: 459a cmp sl, r3 + 8014d10: d1f8 bne.n 8014d04 <_dtoa_r+0x694> + 8014d12: 9a04 ldr r2, [sp, #16] + 8014d14: 3201 adds r2, #1 + 8014d16: 9204 str r2, [sp, #16] + 8014d18: 2230 movs r2, #48 @ 0x30 + 8014d1a: f88a 2000 strb.w r2, [sl] + 8014d1e: 781a ldrb r2, [r3, #0] + 8014d20: 3201 adds r2, #1 + 8014d22: 701a strb r2, [r3, #0] + 8014d24: e7bd b.n 8014ca2 <_dtoa_r+0x632> + 8014d26: 4b7b ldr r3, [pc, #492] @ (8014f14 <_dtoa_r+0x8a4>) + 8014d28: 2200 movs r2, #0 + 8014d2a: f7eb fc75 bl 8000618 <__aeabi_dmul> + 8014d2e: 2200 movs r2, #0 + 8014d30: 2300 movs r3, #0 + 8014d32: 4604 mov r4, r0 + 8014d34: 460d mov r5, r1 + 8014d36: f7eb fed7 bl 8000ae8 <__aeabi_dcmpeq> + 8014d3a: 2800 cmp r0, #0 + 8014d3c: f43f aeba beq.w 8014ab4 <_dtoa_r+0x444> + 8014d40: e6ef b.n 8014b22 <_dtoa_r+0x4b2> + 8014d42: 9a0b ldr r2, [sp, #44] @ 0x2c + 8014d44: 2a00 cmp r2, #0 + 8014d46: f000 80db beq.w 8014f00 <_dtoa_r+0x890> + 8014d4a: 9a09 ldr r2, [sp, #36] @ 0x24 + 8014d4c: 2a01 cmp r2, #1 + 8014d4e: f300 80bf bgt.w 8014ed0 <_dtoa_r+0x860> + 8014d52: 9a14 ldr r2, [sp, #80] @ 0x50 + 8014d54: 2a00 cmp r2, #0 + 8014d56: f000 80b7 beq.w 8014ec8 <_dtoa_r+0x858> + 8014d5a: f203 4333 addw r3, r3, #1075 @ 0x433 + 8014d5e: 9c0a ldr r4, [sp, #40] @ 0x28 + 8014d60: 4646 mov r6, r8 + 8014d62: 9a08 ldr r2, [sp, #32] + 8014d64: 2101 movs r1, #1 + 8014d66: 441a add r2, r3 + 8014d68: 4658 mov r0, fp + 8014d6a: 4498 add r8, r3 + 8014d6c: 9208 str r2, [sp, #32] + 8014d6e: f000 fafd bl 801536c <__i2b> + 8014d72: 4605 mov r5, r0 + 8014d74: b15e cbz r6, 8014d8e <_dtoa_r+0x71e> + 8014d76: 9b08 ldr r3, [sp, #32] + 8014d78: 2b00 cmp r3, #0 + 8014d7a: dd08 ble.n 8014d8e <_dtoa_r+0x71e> + 8014d7c: 42b3 cmp r3, r6 + 8014d7e: 9a08 ldr r2, [sp, #32] + 8014d80: bfa8 it ge + 8014d82: 4633 movge r3, r6 + 8014d84: eba8 0803 sub.w r8, r8, r3 + 8014d88: 1af6 subs r6, r6, r3 + 8014d8a: 1ad3 subs r3, r2, r3 + 8014d8c: 9308 str r3, [sp, #32] + 8014d8e: 9b0a ldr r3, [sp, #40] @ 0x28 + 8014d90: b1f3 cbz r3, 8014dd0 <_dtoa_r+0x760> + 8014d92: 9b0b ldr r3, [sp, #44] @ 0x2c + 8014d94: 2b00 cmp r3, #0 + 8014d96: f000 80b7 beq.w 8014f08 <_dtoa_r+0x898> + 8014d9a: b18c cbz r4, 8014dc0 <_dtoa_r+0x750> + 8014d9c: 4629 mov r1, r5 + 8014d9e: 4622 mov r2, r4 + 8014da0: 4658 mov r0, fp + 8014da2: f000 fba3 bl 80154ec <__pow5mult> + 8014da6: 464a mov r2, r9 + 8014da8: 4601 mov r1, r0 + 8014daa: 4605 mov r5, r0 + 8014dac: 4658 mov r0, fp + 8014dae: f000 faf3 bl 8015398 <__multiply> + 8014db2: 4649 mov r1, r9 + 8014db4: 9004 str r0, [sp, #16] + 8014db6: 4658 mov r0, fp + 8014db8: f000 fa3d bl 8015236 <_Bfree> + 8014dbc: 9b04 ldr r3, [sp, #16] + 8014dbe: 4699 mov r9, r3 + 8014dc0: 9b0a ldr r3, [sp, #40] @ 0x28 + 8014dc2: 1b1a subs r2, r3, r4 + 8014dc4: d004 beq.n 8014dd0 <_dtoa_r+0x760> + 8014dc6: 4649 mov r1, r9 + 8014dc8: 4658 mov r0, fp + 8014dca: f000 fb8f bl 80154ec <__pow5mult> + 8014dce: 4681 mov r9, r0 + 8014dd0: 2101 movs r1, #1 + 8014dd2: 4658 mov r0, fp + 8014dd4: f000 faca bl 801536c <__i2b> + 8014dd8: 9b0f ldr r3, [sp, #60] @ 0x3c + 8014dda: 4604 mov r4, r0 + 8014ddc: 2b00 cmp r3, #0 + 8014dde: f000 81cc beq.w 801517a <_dtoa_r+0xb0a> + 8014de2: 461a mov r2, r3 + 8014de4: 4601 mov r1, r0 + 8014de6: 4658 mov r0, fp + 8014de8: f000 fb80 bl 80154ec <__pow5mult> + 8014dec: 9b09 ldr r3, [sp, #36] @ 0x24 + 8014dee: 2b01 cmp r3, #1 + 8014df0: 4604 mov r4, r0 + 8014df2: f300 8095 bgt.w 8014f20 <_dtoa_r+0x8b0> + 8014df6: 9b02 ldr r3, [sp, #8] + 8014df8: 2b00 cmp r3, #0 + 8014dfa: f040 8087 bne.w 8014f0c <_dtoa_r+0x89c> + 8014dfe: 9b03 ldr r3, [sp, #12] + 8014e00: f3c3 0313 ubfx r3, r3, #0, #20 + 8014e04: 2b00 cmp r3, #0 + 8014e06: f040 8089 bne.w 8014f1c <_dtoa_r+0x8ac> + 8014e0a: 9b03 ldr r3, [sp, #12] + 8014e0c: f023 4300 bic.w r3, r3, #2147483648 @ 0x80000000 + 8014e10: 0d1b lsrs r3, r3, #20 + 8014e12: 051b lsls r3, r3, #20 + 8014e14: b12b cbz r3, 8014e22 <_dtoa_r+0x7b2> + 8014e16: 9b08 ldr r3, [sp, #32] + 8014e18: 3301 adds r3, #1 + 8014e1a: 9308 str r3, [sp, #32] + 8014e1c: f108 0801 add.w r8, r8, #1 + 8014e20: 2301 movs r3, #1 + 8014e22: 930a str r3, [sp, #40] @ 0x28 + 8014e24: 9b0f ldr r3, [sp, #60] @ 0x3c + 8014e26: 2b00 cmp r3, #0 + 8014e28: f000 81ad beq.w 8015186 <_dtoa_r+0xb16> + 8014e2c: 6923 ldr r3, [r4, #16] + 8014e2e: eb04 0383 add.w r3, r4, r3, lsl #2 + 8014e32: 6918 ldr r0, [r3, #16] + 8014e34: f000 fa4e bl 80152d4 <__hi0bits> + 8014e38: f1c0 0020 rsb r0, r0, #32 + 8014e3c: 9b08 ldr r3, [sp, #32] + 8014e3e: 4418 add r0, r3 + 8014e40: f010 001f ands.w r0, r0, #31 + 8014e44: d077 beq.n 8014f36 <_dtoa_r+0x8c6> + 8014e46: f1c0 0320 rsb r3, r0, #32 + 8014e4a: 2b04 cmp r3, #4 + 8014e4c: dd6b ble.n 8014f26 <_dtoa_r+0x8b6> + 8014e4e: 9b08 ldr r3, [sp, #32] + 8014e50: f1c0 001c rsb r0, r0, #28 + 8014e54: 4403 add r3, r0 + 8014e56: 4480 add r8, r0 + 8014e58: 4406 add r6, r0 + 8014e5a: 9308 str r3, [sp, #32] + 8014e5c: f1b8 0f00 cmp.w r8, #0 + 8014e60: dd05 ble.n 8014e6e <_dtoa_r+0x7fe> + 8014e62: 4649 mov r1, r9 + 8014e64: 4642 mov r2, r8 + 8014e66: 4658 mov r0, fp + 8014e68: f000 fb80 bl 801556c <__lshift> + 8014e6c: 4681 mov r9, r0 + 8014e6e: 9b08 ldr r3, [sp, #32] + 8014e70: 2b00 cmp r3, #0 + 8014e72: dd05 ble.n 8014e80 <_dtoa_r+0x810> + 8014e74: 4621 mov r1, r4 + 8014e76: 461a mov r2, r3 + 8014e78: 4658 mov r0, fp + 8014e7a: f000 fb77 bl 801556c <__lshift> + 8014e7e: 4604 mov r4, r0 + 8014e80: 9b12 ldr r3, [sp, #72] @ 0x48 + 8014e82: 2b00 cmp r3, #0 + 8014e84: d059 beq.n 8014f3a <_dtoa_r+0x8ca> + 8014e86: 4621 mov r1, r4 + 8014e88: 4648 mov r0, r9 + 8014e8a: f000 fbdb bl 8015644 <__mcmp> + 8014e8e: 2800 cmp r0, #0 + 8014e90: da53 bge.n 8014f3a <_dtoa_r+0x8ca> + 8014e92: 1e7b subs r3, r7, #1 + 8014e94: 9304 str r3, [sp, #16] + 8014e96: 4649 mov r1, r9 + 8014e98: 2300 movs r3, #0 + 8014e9a: 220a movs r2, #10 + 8014e9c: 4658 mov r0, fp + 8014e9e: f000 f9d3 bl 8015248 <__multadd> + 8014ea2: 9b0b ldr r3, [sp, #44] @ 0x2c + 8014ea4: 4681 mov r9, r0 + 8014ea6: 2b00 cmp r3, #0 + 8014ea8: f000 816f beq.w 801518a <_dtoa_r+0xb1a> + 8014eac: 2300 movs r3, #0 + 8014eae: 4629 mov r1, r5 + 8014eb0: 220a movs r2, #10 + 8014eb2: 4658 mov r0, fp + 8014eb4: f000 f9c8 bl 8015248 <__multadd> + 8014eb8: 9b00 ldr r3, [sp, #0] + 8014eba: 2b00 cmp r3, #0 + 8014ebc: 4605 mov r5, r0 + 8014ebe: dc67 bgt.n 8014f90 <_dtoa_r+0x920> + 8014ec0: 9b09 ldr r3, [sp, #36] @ 0x24 + 8014ec2: 2b02 cmp r3, #2 + 8014ec4: dc41 bgt.n 8014f4a <_dtoa_r+0x8da> + 8014ec6: e063 b.n 8014f90 <_dtoa_r+0x920> + 8014ec8: 9b16 ldr r3, [sp, #88] @ 0x58 + 8014eca: f1c3 0336 rsb r3, r3, #54 @ 0x36 + 8014ece: e746 b.n 8014d5e <_dtoa_r+0x6ee> + 8014ed0: 9b07 ldr r3, [sp, #28] + 8014ed2: 1e5c subs r4, r3, #1 + 8014ed4: 9b0a ldr r3, [sp, #40] @ 0x28 + 8014ed6: 42a3 cmp r3, r4 + 8014ed8: bfbf itttt lt + 8014eda: 9b0a ldrlt r3, [sp, #40] @ 0x28 + 8014edc: 9a0f ldrlt r2, [sp, #60] @ 0x3c + 8014ede: 940a strlt r4, [sp, #40] @ 0x28 + 8014ee0: 1ae3 sublt r3, r4, r3 + 8014ee2: bfb4 ite lt + 8014ee4: 18d2 addlt r2, r2, r3 + 8014ee6: 1b1c subge r4, r3, r4 + 8014ee8: 9b07 ldr r3, [sp, #28] + 8014eea: bfbc itt lt + 8014eec: 920f strlt r2, [sp, #60] @ 0x3c + 8014eee: 2400 movlt r4, #0 + 8014ef0: 2b00 cmp r3, #0 + 8014ef2: bfb5 itete lt + 8014ef4: eba8 0603 sublt.w r6, r8, r3 + 8014ef8: 9b07 ldrge r3, [sp, #28] + 8014efa: 2300 movlt r3, #0 + 8014efc: 4646 movge r6, r8 + 8014efe: e730 b.n 8014d62 <_dtoa_r+0x6f2> + 8014f00: 9c0a ldr r4, [sp, #40] @ 0x28 + 8014f02: 9d0b ldr r5, [sp, #44] @ 0x2c + 8014f04: 4646 mov r6, r8 + 8014f06: e735 b.n 8014d74 <_dtoa_r+0x704> + 8014f08: 9a0a ldr r2, [sp, #40] @ 0x28 + 8014f0a: e75c b.n 8014dc6 <_dtoa_r+0x756> + 8014f0c: 2300 movs r3, #0 + 8014f0e: e788 b.n 8014e22 <_dtoa_r+0x7b2> + 8014f10: 3fe00000 .word 0x3fe00000 + 8014f14: 40240000 .word 0x40240000 + 8014f18: 40140000 .word 0x40140000 + 8014f1c: 9b02 ldr r3, [sp, #8] + 8014f1e: e780 b.n 8014e22 <_dtoa_r+0x7b2> + 8014f20: 2300 movs r3, #0 + 8014f22: 930a str r3, [sp, #40] @ 0x28 + 8014f24: e782 b.n 8014e2c <_dtoa_r+0x7bc> + 8014f26: d099 beq.n 8014e5c <_dtoa_r+0x7ec> + 8014f28: 9a08 ldr r2, [sp, #32] + 8014f2a: 331c adds r3, #28 + 8014f2c: 441a add r2, r3 + 8014f2e: 4498 add r8, r3 + 8014f30: 441e add r6, r3 + 8014f32: 9208 str r2, [sp, #32] + 8014f34: e792 b.n 8014e5c <_dtoa_r+0x7ec> + 8014f36: 4603 mov r3, r0 + 8014f38: e7f6 b.n 8014f28 <_dtoa_r+0x8b8> + 8014f3a: 9b07 ldr r3, [sp, #28] + 8014f3c: 9704 str r7, [sp, #16] + 8014f3e: 2b00 cmp r3, #0 + 8014f40: dc20 bgt.n 8014f84 <_dtoa_r+0x914> + 8014f42: 9300 str r3, [sp, #0] + 8014f44: 9b09 ldr r3, [sp, #36] @ 0x24 + 8014f46: 2b02 cmp r3, #2 + 8014f48: dd1e ble.n 8014f88 <_dtoa_r+0x918> + 8014f4a: 9b00 ldr r3, [sp, #0] + 8014f4c: 2b00 cmp r3, #0 + 8014f4e: f47f aec0 bne.w 8014cd2 <_dtoa_r+0x662> + 8014f52: 4621 mov r1, r4 + 8014f54: 2205 movs r2, #5 + 8014f56: 4658 mov r0, fp + 8014f58: f000 f976 bl 8015248 <__multadd> + 8014f5c: 4601 mov r1, r0 + 8014f5e: 4604 mov r4, r0 + 8014f60: 4648 mov r0, r9 + 8014f62: f000 fb6f bl 8015644 <__mcmp> + 8014f66: 2800 cmp r0, #0 + 8014f68: f77f aeb3 ble.w 8014cd2 <_dtoa_r+0x662> + 8014f6c: 4656 mov r6, sl + 8014f6e: 2331 movs r3, #49 @ 0x31 + 8014f70: f806 3b01 strb.w r3, [r6], #1 + 8014f74: 9b04 ldr r3, [sp, #16] + 8014f76: 3301 adds r3, #1 + 8014f78: 9304 str r3, [sp, #16] + 8014f7a: e6ae b.n 8014cda <_dtoa_r+0x66a> + 8014f7c: 9c07 ldr r4, [sp, #28] + 8014f7e: 9704 str r7, [sp, #16] + 8014f80: 4625 mov r5, r4 + 8014f82: e7f3 b.n 8014f6c <_dtoa_r+0x8fc> + 8014f84: 9b07 ldr r3, [sp, #28] + 8014f86: 9300 str r3, [sp, #0] + 8014f88: 9b0b ldr r3, [sp, #44] @ 0x2c + 8014f8a: 2b00 cmp r3, #0 + 8014f8c: f000 8101 beq.w 8015192 <_dtoa_r+0xb22> + 8014f90: 2e00 cmp r6, #0 + 8014f92: dd05 ble.n 8014fa0 <_dtoa_r+0x930> + 8014f94: 4629 mov r1, r5 + 8014f96: 4632 mov r2, r6 + 8014f98: 4658 mov r0, fp + 8014f9a: f000 fae7 bl 801556c <__lshift> + 8014f9e: 4605 mov r5, r0 + 8014fa0: 9b0a ldr r3, [sp, #40] @ 0x28 + 8014fa2: 2b00 cmp r3, #0 + 8014fa4: d059 beq.n 801505a <_dtoa_r+0x9ea> + 8014fa6: 6869 ldr r1, [r5, #4] + 8014fa8: 4658 mov r0, fp + 8014faa: f000 f91f bl 80151ec <_Balloc> + 8014fae: 4606 mov r6, r0 + 8014fb0: b920 cbnz r0, 8014fbc <_dtoa_r+0x94c> + 8014fb2: 4b83 ldr r3, [pc, #524] @ (80151c0 <_dtoa_r+0xb50>) + 8014fb4: 4602 mov r2, r0 + 8014fb6: f240 21ef movw r1, #751 @ 0x2ef + 8014fba: e480 b.n 80148be <_dtoa_r+0x24e> + 8014fbc: 692a ldr r2, [r5, #16] + 8014fbe: 3202 adds r2, #2 + 8014fc0: 0092 lsls r2, r2, #2 + 8014fc2: f105 010c add.w r1, r5, #12 + 8014fc6: 300c adds r0, #12 + 8014fc8: f7fc fc12 bl 80117f0 + 8014fcc: 2201 movs r2, #1 + 8014fce: 4631 mov r1, r6 + 8014fd0: 4658 mov r0, fp + 8014fd2: f000 facb bl 801556c <__lshift> + 8014fd6: f10a 0301 add.w r3, sl, #1 + 8014fda: 9307 str r3, [sp, #28] + 8014fdc: 9b00 ldr r3, [sp, #0] + 8014fde: 4453 add r3, sl + 8014fe0: 930b str r3, [sp, #44] @ 0x2c + 8014fe2: 9b02 ldr r3, [sp, #8] + 8014fe4: f003 0301 and.w r3, r3, #1 + 8014fe8: 462f mov r7, r5 + 8014fea: 930a str r3, [sp, #40] @ 0x28 + 8014fec: 4605 mov r5, r0 + 8014fee: 9b07 ldr r3, [sp, #28] + 8014ff0: 4621 mov r1, r4 + 8014ff2: 3b01 subs r3, #1 + 8014ff4: 4648 mov r0, r9 + 8014ff6: 9300 str r3, [sp, #0] + 8014ff8: f7ff fab0 bl 801455c + 8014ffc: 4639 mov r1, r7 + 8014ffe: 9002 str r0, [sp, #8] + 8015000: f100 0830 add.w r8, r0, #48 @ 0x30 + 8015004: 4648 mov r0, r9 + 8015006: f000 fb1d bl 8015644 <__mcmp> + 801500a: 462a mov r2, r5 + 801500c: 9008 str r0, [sp, #32] + 801500e: 4621 mov r1, r4 + 8015010: 4658 mov r0, fp + 8015012: f000 fb33 bl 801567c <__mdiff> + 8015016: 68c2 ldr r2, [r0, #12] + 8015018: 4606 mov r6, r0 + 801501a: bb02 cbnz r2, 801505e <_dtoa_r+0x9ee> + 801501c: 4601 mov r1, r0 + 801501e: 4648 mov r0, r9 + 8015020: f000 fb10 bl 8015644 <__mcmp> + 8015024: 4602 mov r2, r0 + 8015026: 4631 mov r1, r6 + 8015028: 4658 mov r0, fp + 801502a: 920e str r2, [sp, #56] @ 0x38 + 801502c: f000 f903 bl 8015236 <_Bfree> + 8015030: 9b09 ldr r3, [sp, #36] @ 0x24 + 8015032: 9a0e ldr r2, [sp, #56] @ 0x38 + 8015034: 9e07 ldr r6, [sp, #28] + 8015036: ea43 0102 orr.w r1, r3, r2 + 801503a: 9b0a ldr r3, [sp, #40] @ 0x28 + 801503c: 4319 orrs r1, r3 + 801503e: d110 bne.n 8015062 <_dtoa_r+0x9f2> + 8015040: f1b8 0f39 cmp.w r8, #57 @ 0x39 + 8015044: d029 beq.n 801509a <_dtoa_r+0xa2a> + 8015046: 9b08 ldr r3, [sp, #32] + 8015048: 2b00 cmp r3, #0 + 801504a: dd02 ble.n 8015052 <_dtoa_r+0x9e2> + 801504c: 9b02 ldr r3, [sp, #8] + 801504e: f103 0831 add.w r8, r3, #49 @ 0x31 + 8015052: 9b00 ldr r3, [sp, #0] + 8015054: f883 8000 strb.w r8, [r3] + 8015058: e640 b.n 8014cdc <_dtoa_r+0x66c> + 801505a: 4628 mov r0, r5 + 801505c: e7bb b.n 8014fd6 <_dtoa_r+0x966> + 801505e: 2201 movs r2, #1 + 8015060: e7e1 b.n 8015026 <_dtoa_r+0x9b6> + 8015062: 9b08 ldr r3, [sp, #32] + 8015064: 2b00 cmp r3, #0 + 8015066: db04 blt.n 8015072 <_dtoa_r+0xa02> + 8015068: 9909 ldr r1, [sp, #36] @ 0x24 + 801506a: 430b orrs r3, r1 + 801506c: 990a ldr r1, [sp, #40] @ 0x28 + 801506e: 430b orrs r3, r1 + 8015070: d120 bne.n 80150b4 <_dtoa_r+0xa44> + 8015072: 2a00 cmp r2, #0 + 8015074: dded ble.n 8015052 <_dtoa_r+0x9e2> + 8015076: 4649 mov r1, r9 + 8015078: 2201 movs r2, #1 + 801507a: 4658 mov r0, fp + 801507c: f000 fa76 bl 801556c <__lshift> + 8015080: 4621 mov r1, r4 + 8015082: 4681 mov r9, r0 + 8015084: f000 fade bl 8015644 <__mcmp> + 8015088: 2800 cmp r0, #0 + 801508a: dc03 bgt.n 8015094 <_dtoa_r+0xa24> + 801508c: d1e1 bne.n 8015052 <_dtoa_r+0x9e2> + 801508e: f018 0f01 tst.w r8, #1 + 8015092: d0de beq.n 8015052 <_dtoa_r+0x9e2> + 8015094: f1b8 0f39 cmp.w r8, #57 @ 0x39 + 8015098: d1d8 bne.n 801504c <_dtoa_r+0x9dc> + 801509a: 9a00 ldr r2, [sp, #0] + 801509c: 2339 movs r3, #57 @ 0x39 + 801509e: 7013 strb r3, [r2, #0] + 80150a0: 4633 mov r3, r6 + 80150a2: 461e mov r6, r3 + 80150a4: 3b01 subs r3, #1 + 80150a6: f816 2c01 ldrb.w r2, [r6, #-1] + 80150aa: 2a39 cmp r2, #57 @ 0x39 + 80150ac: d052 beq.n 8015154 <_dtoa_r+0xae4> + 80150ae: 3201 adds r2, #1 + 80150b0: 701a strb r2, [r3, #0] + 80150b2: e613 b.n 8014cdc <_dtoa_r+0x66c> + 80150b4: 2a00 cmp r2, #0 + 80150b6: dd07 ble.n 80150c8 <_dtoa_r+0xa58> + 80150b8: f1b8 0f39 cmp.w r8, #57 @ 0x39 + 80150bc: d0ed beq.n 801509a <_dtoa_r+0xa2a> + 80150be: 9a00 ldr r2, [sp, #0] + 80150c0: f108 0301 add.w r3, r8, #1 + 80150c4: 7013 strb r3, [r2, #0] + 80150c6: e609 b.n 8014cdc <_dtoa_r+0x66c> + 80150c8: 9b07 ldr r3, [sp, #28] + 80150ca: 9a07 ldr r2, [sp, #28] + 80150cc: f803 8c01 strb.w r8, [r3, #-1] + 80150d0: 9b0b ldr r3, [sp, #44] @ 0x2c + 80150d2: 4293 cmp r3, r2 + 80150d4: d028 beq.n 8015128 <_dtoa_r+0xab8> + 80150d6: 4649 mov r1, r9 + 80150d8: 2300 movs r3, #0 + 80150da: 220a movs r2, #10 + 80150dc: 4658 mov r0, fp + 80150de: f000 f8b3 bl 8015248 <__multadd> + 80150e2: 42af cmp r7, r5 + 80150e4: 4681 mov r9, r0 + 80150e6: f04f 0300 mov.w r3, #0 + 80150ea: f04f 020a mov.w r2, #10 + 80150ee: 4639 mov r1, r7 + 80150f0: 4658 mov r0, fp + 80150f2: d107 bne.n 8015104 <_dtoa_r+0xa94> + 80150f4: f000 f8a8 bl 8015248 <__multadd> + 80150f8: 4607 mov r7, r0 + 80150fa: 4605 mov r5, r0 + 80150fc: 9b07 ldr r3, [sp, #28] + 80150fe: 3301 adds r3, #1 + 8015100: 9307 str r3, [sp, #28] + 8015102: e774 b.n 8014fee <_dtoa_r+0x97e> + 8015104: f000 f8a0 bl 8015248 <__multadd> + 8015108: 4629 mov r1, r5 + 801510a: 4607 mov r7, r0 + 801510c: 2300 movs r3, #0 + 801510e: 220a movs r2, #10 + 8015110: 4658 mov r0, fp + 8015112: f000 f899 bl 8015248 <__multadd> + 8015116: 4605 mov r5, r0 + 8015118: e7f0 b.n 80150fc <_dtoa_r+0xa8c> + 801511a: 9b00 ldr r3, [sp, #0] + 801511c: 2b00 cmp r3, #0 + 801511e: bfcc ite gt + 8015120: 461e movgt r6, r3 + 8015122: 2601 movle r6, #1 + 8015124: 4456 add r6, sl + 8015126: 2700 movs r7, #0 + 8015128: 4649 mov r1, r9 + 801512a: 2201 movs r2, #1 + 801512c: 4658 mov r0, fp + 801512e: f000 fa1d bl 801556c <__lshift> + 8015132: 4621 mov r1, r4 + 8015134: 4681 mov r9, r0 + 8015136: f000 fa85 bl 8015644 <__mcmp> + 801513a: 2800 cmp r0, #0 + 801513c: dcb0 bgt.n 80150a0 <_dtoa_r+0xa30> + 801513e: d102 bne.n 8015146 <_dtoa_r+0xad6> + 8015140: f018 0f01 tst.w r8, #1 + 8015144: d1ac bne.n 80150a0 <_dtoa_r+0xa30> + 8015146: 4633 mov r3, r6 + 8015148: 461e mov r6, r3 + 801514a: f813 2d01 ldrb.w r2, [r3, #-1]! + 801514e: 2a30 cmp r2, #48 @ 0x30 + 8015150: d0fa beq.n 8015148 <_dtoa_r+0xad8> + 8015152: e5c3 b.n 8014cdc <_dtoa_r+0x66c> + 8015154: 459a cmp sl, r3 + 8015156: d1a4 bne.n 80150a2 <_dtoa_r+0xa32> + 8015158: 9b04 ldr r3, [sp, #16] + 801515a: 3301 adds r3, #1 + 801515c: 9304 str r3, [sp, #16] + 801515e: 2331 movs r3, #49 @ 0x31 + 8015160: f88a 3000 strb.w r3, [sl] + 8015164: e5ba b.n 8014cdc <_dtoa_r+0x66c> + 8015166: 9b23 ldr r3, [sp, #140] @ 0x8c + 8015168: f8df a058 ldr.w sl, [pc, #88] @ 80151c4 <_dtoa_r+0xb54> + 801516c: 2b00 cmp r3, #0 + 801516e: f43f aab6 beq.w 80146de <_dtoa_r+0x6e> + 8015172: f10a 0308 add.w r3, sl, #8 + 8015176: f7ff bab0 b.w 80146da <_dtoa_r+0x6a> + 801517a: 9b09 ldr r3, [sp, #36] @ 0x24 + 801517c: 2b01 cmp r3, #1 + 801517e: f77f ae3a ble.w 8014df6 <_dtoa_r+0x786> + 8015182: 9b0f ldr r3, [sp, #60] @ 0x3c + 8015184: 930a str r3, [sp, #40] @ 0x28 + 8015186: 2001 movs r0, #1 + 8015188: e658 b.n 8014e3c <_dtoa_r+0x7cc> + 801518a: 9b00 ldr r3, [sp, #0] + 801518c: 2b00 cmp r3, #0 + 801518e: f77f aed9 ble.w 8014f44 <_dtoa_r+0x8d4> + 8015192: 4656 mov r6, sl + 8015194: 4621 mov r1, r4 + 8015196: 4648 mov r0, r9 + 8015198: f7ff f9e0 bl 801455c + 801519c: f100 0830 add.w r8, r0, #48 @ 0x30 + 80151a0: f806 8b01 strb.w r8, [r6], #1 + 80151a4: 9b00 ldr r3, [sp, #0] + 80151a6: eba6 020a sub.w r2, r6, sl + 80151aa: 4293 cmp r3, r2 + 80151ac: ddb5 ble.n 801511a <_dtoa_r+0xaaa> + 80151ae: 4649 mov r1, r9 + 80151b0: 2300 movs r3, #0 + 80151b2: 220a movs r2, #10 + 80151b4: 4658 mov r0, fp + 80151b6: f000 f847 bl 8015248 <__multadd> + 80151ba: 4681 mov r9, r0 + 80151bc: e7ea b.n 8015194 <_dtoa_r+0xb24> + 80151be: bf00 nop + 80151c0: 08019076 .word 0x08019076 + 80151c4: 08019069 .word 0x08019069 + +080151c8 <__ascii_mbtowc>: + 80151c8: b082 sub sp, #8 + 80151ca: b901 cbnz r1, 80151ce <__ascii_mbtowc+0x6> + 80151cc: a901 add r1, sp, #4 + 80151ce: b142 cbz r2, 80151e2 <__ascii_mbtowc+0x1a> + 80151d0: b14b cbz r3, 80151e6 <__ascii_mbtowc+0x1e> + 80151d2: 7813 ldrb r3, [r2, #0] + 80151d4: 600b str r3, [r1, #0] + 80151d6: 7812 ldrb r2, [r2, #0] + 80151d8: 1e10 subs r0, r2, #0 + 80151da: bf18 it ne + 80151dc: 2001 movne r0, #1 + 80151de: b002 add sp, #8 + 80151e0: 4770 bx lr + 80151e2: 4610 mov r0, r2 + 80151e4: e7fb b.n 80151de <__ascii_mbtowc+0x16> + 80151e6: f06f 0001 mvn.w r0, #1 + 80151ea: e7f8 b.n 80151de <__ascii_mbtowc+0x16> + +080151ec <_Balloc>: + 80151ec: 6c43 ldr r3, [r0, #68] @ 0x44 + 80151ee: b570 push {r4, r5, r6, lr} + 80151f0: 4605 mov r5, r0 + 80151f2: 460c mov r4, r1 + 80151f4: b17b cbz r3, 8015216 <_Balloc+0x2a> + 80151f6: 6c6b ldr r3, [r5, #68] @ 0x44 + 80151f8: f853 0024 ldr.w r0, [r3, r4, lsl #2] + 80151fc: b9a0 cbnz r0, 8015228 <_Balloc+0x3c> + 80151fe: 2101 movs r1, #1 + 8015200: fa01 f604 lsl.w r6, r1, r4 + 8015204: 1d72 adds r2, r6, #5 + 8015206: 0092 lsls r2, r2, #2 + 8015208: 4628 mov r0, r5 + 801520a: f000 fddd bl 8015dc8 <_calloc_r> + 801520e: b148 cbz r0, 8015224 <_Balloc+0x38> + 8015210: e9c0 4601 strd r4, r6, [r0, #4] + 8015214: e00b b.n 801522e <_Balloc+0x42> + 8015216: 2221 movs r2, #33 @ 0x21 + 8015218: 2104 movs r1, #4 + 801521a: f000 fdd5 bl 8015dc8 <_calloc_r> + 801521e: 6468 str r0, [r5, #68] @ 0x44 + 8015220: 2800 cmp r0, #0 + 8015222: d1e8 bne.n 80151f6 <_Balloc+0xa> + 8015224: 2000 movs r0, #0 + 8015226: bd70 pop {r4, r5, r6, pc} + 8015228: 6802 ldr r2, [r0, #0] + 801522a: f843 2024 str.w r2, [r3, r4, lsl #2] + 801522e: 2300 movs r3, #0 + 8015230: e9c0 3303 strd r3, r3, [r0, #12] + 8015234: e7f7 b.n 8015226 <_Balloc+0x3a> + +08015236 <_Bfree>: + 8015236: b131 cbz r1, 8015246 <_Bfree+0x10> + 8015238: 6c43 ldr r3, [r0, #68] @ 0x44 + 801523a: 684a ldr r2, [r1, #4] + 801523c: f853 0022 ldr.w r0, [r3, r2, lsl #2] + 8015240: 6008 str r0, [r1, #0] + 8015242: f843 1022 str.w r1, [r3, r2, lsl #2] + 8015246: 4770 bx lr + +08015248 <__multadd>: + 8015248: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} + 801524c: 690d ldr r5, [r1, #16] + 801524e: 4607 mov r7, r0 + 8015250: 460c mov r4, r1 + 8015252: 461e mov r6, r3 + 8015254: f101 0c14 add.w ip, r1, #20 + 8015258: 2000 movs r0, #0 + 801525a: f8dc 3000 ldr.w r3, [ip] + 801525e: b299 uxth r1, r3 + 8015260: fb02 6101 mla r1, r2, r1, r6 + 8015264: 0c1e lsrs r6, r3, #16 + 8015266: 0c0b lsrs r3, r1, #16 + 8015268: fb02 3306 mla r3, r2, r6, r3 + 801526c: b289 uxth r1, r1 + 801526e: 3001 adds r0, #1 + 8015270: eb01 4103 add.w r1, r1, r3, lsl #16 + 8015274: 4285 cmp r5, r0 + 8015276: f84c 1b04 str.w r1, [ip], #4 + 801527a: ea4f 4613 mov.w r6, r3, lsr #16 + 801527e: dcec bgt.n 801525a <__multadd+0x12> + 8015280: b30e cbz r6, 80152c6 <__multadd+0x7e> + 8015282: 68a3 ldr r3, [r4, #8] + 8015284: 42ab cmp r3, r5 + 8015286: dc19 bgt.n 80152bc <__multadd+0x74> + 8015288: 6861 ldr r1, [r4, #4] + 801528a: 4638 mov r0, r7 + 801528c: 3101 adds r1, #1 + 801528e: f7ff ffad bl 80151ec <_Balloc> + 8015292: 4680 mov r8, r0 + 8015294: b928 cbnz r0, 80152a2 <__multadd+0x5a> + 8015296: 4602 mov r2, r0 + 8015298: 4b0c ldr r3, [pc, #48] @ (80152cc <__multadd+0x84>) + 801529a: 480d ldr r0, [pc, #52] @ (80152d0 <__multadd+0x88>) + 801529c: 21ba movs r1, #186 @ 0xba + 801529e: f000 fd75 bl 8015d8c <__assert_func> + 80152a2: 6922 ldr r2, [r4, #16] + 80152a4: 3202 adds r2, #2 + 80152a6: f104 010c add.w r1, r4, #12 + 80152aa: 0092 lsls r2, r2, #2 + 80152ac: 300c adds r0, #12 + 80152ae: f7fc fa9f bl 80117f0 + 80152b2: 4621 mov r1, r4 + 80152b4: 4638 mov r0, r7 + 80152b6: f7ff ffbe bl 8015236 <_Bfree> + 80152ba: 4644 mov r4, r8 + 80152bc: eb04 0385 add.w r3, r4, r5, lsl #2 + 80152c0: 3501 adds r5, #1 + 80152c2: 615e str r6, [r3, #20] + 80152c4: 6125 str r5, [r4, #16] + 80152c6: 4620 mov r0, r4 + 80152c8: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} + 80152cc: 08019076 .word 0x08019076 + 80152d0: 080190df .word 0x080190df + +080152d4 <__hi0bits>: + 80152d4: f5b0 3f80 cmp.w r0, #65536 @ 0x10000 + 80152d8: 4603 mov r3, r0 + 80152da: bf36 itet cc + 80152dc: 0403 lslcc r3, r0, #16 + 80152de: 2000 movcs r0, #0 + 80152e0: 2010 movcc r0, #16 + 80152e2: f1b3 7f80 cmp.w r3, #16777216 @ 0x1000000 + 80152e6: bf3c itt cc + 80152e8: 021b lslcc r3, r3, #8 + 80152ea: 3008 addcc r0, #8 + 80152ec: f1b3 5f80 cmp.w r3, #268435456 @ 0x10000000 + 80152f0: bf3c itt cc + 80152f2: 011b lslcc r3, r3, #4 + 80152f4: 3004 addcc r0, #4 + 80152f6: f1b3 4f80 cmp.w r3, #1073741824 @ 0x40000000 + 80152fa: bf3c itt cc + 80152fc: 009b lslcc r3, r3, #2 + 80152fe: 3002 addcc r0, #2 + 8015300: 2b00 cmp r3, #0 + 8015302: db05 blt.n 8015310 <__hi0bits+0x3c> + 8015304: f013 4f80 tst.w r3, #1073741824 @ 0x40000000 + 8015308: f100 0001 add.w r0, r0, #1 + 801530c: bf08 it eq + 801530e: 2020 moveq r0, #32 + 8015310: 4770 bx lr + +08015312 <__lo0bits>: + 8015312: 6803 ldr r3, [r0, #0] + 8015314: 4602 mov r2, r0 + 8015316: f013 0007 ands.w r0, r3, #7 + 801531a: d00b beq.n 8015334 <__lo0bits+0x22> + 801531c: 07d9 lsls r1, r3, #31 + 801531e: d421 bmi.n 8015364 <__lo0bits+0x52> + 8015320: 0798 lsls r0, r3, #30 + 8015322: bf49 itett mi + 8015324: 085b lsrmi r3, r3, #1 + 8015326: 089b lsrpl r3, r3, #2 + 8015328: 2001 movmi r0, #1 + 801532a: 6013 strmi r3, [r2, #0] + 801532c: bf5c itt pl + 801532e: 6013 strpl r3, [r2, #0] + 8015330: 2002 movpl r0, #2 + 8015332: 4770 bx lr + 8015334: b299 uxth r1, r3 + 8015336: b909 cbnz r1, 801533c <__lo0bits+0x2a> + 8015338: 0c1b lsrs r3, r3, #16 + 801533a: 2010 movs r0, #16 + 801533c: b2d9 uxtb r1, r3 + 801533e: b909 cbnz r1, 8015344 <__lo0bits+0x32> + 8015340: 3008 adds r0, #8 + 8015342: 0a1b lsrs r3, r3, #8 + 8015344: 0719 lsls r1, r3, #28 + 8015346: bf04 itt eq + 8015348: 091b lsreq r3, r3, #4 + 801534a: 3004 addeq r0, #4 + 801534c: 0799 lsls r1, r3, #30 + 801534e: bf04 itt eq + 8015350: 089b lsreq r3, r3, #2 + 8015352: 3002 addeq r0, #2 + 8015354: 07d9 lsls r1, r3, #31 + 8015356: d403 bmi.n 8015360 <__lo0bits+0x4e> + 8015358: 085b lsrs r3, r3, #1 + 801535a: f100 0001 add.w r0, r0, #1 + 801535e: d003 beq.n 8015368 <__lo0bits+0x56> + 8015360: 6013 str r3, [r2, #0] + 8015362: 4770 bx lr + 8015364: 2000 movs r0, #0 + 8015366: 4770 bx lr + 8015368: 2020 movs r0, #32 + 801536a: 4770 bx lr + +0801536c <__i2b>: + 801536c: b510 push {r4, lr} + 801536e: 460c mov r4, r1 + 8015370: 2101 movs r1, #1 + 8015372: f7ff ff3b bl 80151ec <_Balloc> + 8015376: 4602 mov r2, r0 + 8015378: b928 cbnz r0, 8015386 <__i2b+0x1a> + 801537a: 4b05 ldr r3, [pc, #20] @ (8015390 <__i2b+0x24>) + 801537c: 4805 ldr r0, [pc, #20] @ (8015394 <__i2b+0x28>) + 801537e: f240 1145 movw r1, #325 @ 0x145 + 8015382: f000 fd03 bl 8015d8c <__assert_func> + 8015386: 2301 movs r3, #1 + 8015388: 6144 str r4, [r0, #20] + 801538a: 6103 str r3, [r0, #16] + 801538c: bd10 pop {r4, pc} + 801538e: bf00 nop + 8015390: 08019076 .word 0x08019076 + 8015394: 080190df .word 0x080190df + +08015398 <__multiply>: + 8015398: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 801539c: 4614 mov r4, r2 + 801539e: 690a ldr r2, [r1, #16] + 80153a0: 6923 ldr r3, [r4, #16] + 80153a2: 429a cmp r2, r3 + 80153a4: bfa8 it ge + 80153a6: 4623 movge r3, r4 + 80153a8: 460f mov r7, r1 + 80153aa: bfa4 itt ge + 80153ac: 460c movge r4, r1 + 80153ae: 461f movge r7, r3 + 80153b0: f8d4 a010 ldr.w sl, [r4, #16] + 80153b4: f8d7 9010 ldr.w r9, [r7, #16] + 80153b8: 68a3 ldr r3, [r4, #8] + 80153ba: 6861 ldr r1, [r4, #4] + 80153bc: eb0a 0609 add.w r6, sl, r9 + 80153c0: 42b3 cmp r3, r6 + 80153c2: b085 sub sp, #20 + 80153c4: bfb8 it lt + 80153c6: 3101 addlt r1, #1 + 80153c8: f7ff ff10 bl 80151ec <_Balloc> + 80153cc: b930 cbnz r0, 80153dc <__multiply+0x44> + 80153ce: 4602 mov r2, r0 + 80153d0: 4b44 ldr r3, [pc, #272] @ (80154e4 <__multiply+0x14c>) + 80153d2: 4845 ldr r0, [pc, #276] @ (80154e8 <__multiply+0x150>) + 80153d4: f44f 71b1 mov.w r1, #354 @ 0x162 + 80153d8: f000 fcd8 bl 8015d8c <__assert_func> + 80153dc: f100 0514 add.w r5, r0, #20 + 80153e0: eb05 0886 add.w r8, r5, r6, lsl #2 + 80153e4: 462b mov r3, r5 + 80153e6: 2200 movs r2, #0 + 80153e8: 4543 cmp r3, r8 + 80153ea: d321 bcc.n 8015430 <__multiply+0x98> + 80153ec: f107 0114 add.w r1, r7, #20 + 80153f0: f104 0214 add.w r2, r4, #20 + 80153f4: eb02 028a add.w r2, r2, sl, lsl #2 + 80153f8: eb01 0389 add.w r3, r1, r9, lsl #2 + 80153fc: 9302 str r3, [sp, #8] + 80153fe: 1b13 subs r3, r2, r4 + 8015400: 3b15 subs r3, #21 + 8015402: f023 0303 bic.w r3, r3, #3 + 8015406: 3304 adds r3, #4 + 8015408: f104 0715 add.w r7, r4, #21 + 801540c: 42ba cmp r2, r7 + 801540e: bf38 it cc + 8015410: 2304 movcc r3, #4 + 8015412: 9301 str r3, [sp, #4] + 8015414: 9b02 ldr r3, [sp, #8] + 8015416: 9103 str r1, [sp, #12] + 8015418: 428b cmp r3, r1 + 801541a: d80c bhi.n 8015436 <__multiply+0x9e> + 801541c: 2e00 cmp r6, #0 + 801541e: dd03 ble.n 8015428 <__multiply+0x90> + 8015420: f858 3d04 ldr.w r3, [r8, #-4]! + 8015424: 2b00 cmp r3, #0 + 8015426: d05b beq.n 80154e0 <__multiply+0x148> + 8015428: 6106 str r6, [r0, #16] + 801542a: b005 add sp, #20 + 801542c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 8015430: f843 2b04 str.w r2, [r3], #4 + 8015434: e7d8 b.n 80153e8 <__multiply+0x50> + 8015436: f8b1 a000 ldrh.w sl, [r1] + 801543a: f1ba 0f00 cmp.w sl, #0 + 801543e: d024 beq.n 801548a <__multiply+0xf2> + 8015440: f104 0e14 add.w lr, r4, #20 + 8015444: 46a9 mov r9, r5 + 8015446: f04f 0c00 mov.w ip, #0 + 801544a: f85e 7b04 ldr.w r7, [lr], #4 + 801544e: f8d9 3000 ldr.w r3, [r9] + 8015452: fa1f fb87 uxth.w fp, r7 + 8015456: b29b uxth r3, r3 + 8015458: fb0a 330b mla r3, sl, fp, r3 + 801545c: ea4f 4b17 mov.w fp, r7, lsr #16 + 8015460: f8d9 7000 ldr.w r7, [r9] + 8015464: 4463 add r3, ip + 8015466: ea4f 4c17 mov.w ip, r7, lsr #16 + 801546a: fb0a c70b mla r7, sl, fp, ip + 801546e: eb07 4713 add.w r7, r7, r3, lsr #16 + 8015472: b29b uxth r3, r3 + 8015474: ea43 4307 orr.w r3, r3, r7, lsl #16 + 8015478: 4572 cmp r2, lr + 801547a: f849 3b04 str.w r3, [r9], #4 + 801547e: ea4f 4c17 mov.w ip, r7, lsr #16 + 8015482: d8e2 bhi.n 801544a <__multiply+0xb2> + 8015484: 9b01 ldr r3, [sp, #4] + 8015486: f845 c003 str.w ip, [r5, r3] + 801548a: 9b03 ldr r3, [sp, #12] + 801548c: f8b3 9002 ldrh.w r9, [r3, #2] + 8015490: 3104 adds r1, #4 + 8015492: f1b9 0f00 cmp.w r9, #0 + 8015496: d021 beq.n 80154dc <__multiply+0x144> + 8015498: 682b ldr r3, [r5, #0] + 801549a: f104 0c14 add.w ip, r4, #20 + 801549e: 46ae mov lr, r5 + 80154a0: f04f 0a00 mov.w sl, #0 + 80154a4: f8bc b000 ldrh.w fp, [ip] + 80154a8: f8be 7002 ldrh.w r7, [lr, #2] + 80154ac: fb09 770b mla r7, r9, fp, r7 + 80154b0: 4457 add r7, sl + 80154b2: b29b uxth r3, r3 + 80154b4: ea43 4307 orr.w r3, r3, r7, lsl #16 + 80154b8: f84e 3b04 str.w r3, [lr], #4 + 80154bc: f85c 3b04 ldr.w r3, [ip], #4 + 80154c0: ea4f 4a13 mov.w sl, r3, lsr #16 + 80154c4: f8be 3000 ldrh.w r3, [lr] + 80154c8: fb09 330a mla r3, r9, sl, r3 + 80154cc: eb03 4317 add.w r3, r3, r7, lsr #16 + 80154d0: 4562 cmp r2, ip + 80154d2: ea4f 4a13 mov.w sl, r3, lsr #16 + 80154d6: d8e5 bhi.n 80154a4 <__multiply+0x10c> + 80154d8: 9f01 ldr r7, [sp, #4] + 80154da: 51eb str r3, [r5, r7] + 80154dc: 3504 adds r5, #4 + 80154de: e799 b.n 8015414 <__multiply+0x7c> + 80154e0: 3e01 subs r6, #1 + 80154e2: e79b b.n 801541c <__multiply+0x84> + 80154e4: 08019076 .word 0x08019076 + 80154e8: 080190df .word 0x080190df + +080154ec <__pow5mult>: + 80154ec: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr} + 80154f0: 4615 mov r5, r2 + 80154f2: f012 0203 ands.w r2, r2, #3 + 80154f6: 4607 mov r7, r0 + 80154f8: 460e mov r6, r1 + 80154fa: d007 beq.n 801550c <__pow5mult+0x20> + 80154fc: 4c1a ldr r4, [pc, #104] @ (8015568 <__pow5mult+0x7c>) + 80154fe: 3a01 subs r2, #1 + 8015500: 2300 movs r3, #0 + 8015502: f854 2022 ldr.w r2, [r4, r2, lsl #2] + 8015506: f7ff fe9f bl 8015248 <__multadd> + 801550a: 4606 mov r6, r0 + 801550c: 10ad asrs r5, r5, #2 + 801550e: d027 beq.n 8015560 <__pow5mult+0x74> + 8015510: 6c3c ldr r4, [r7, #64] @ 0x40 + 8015512: b944 cbnz r4, 8015526 <__pow5mult+0x3a> + 8015514: f240 2171 movw r1, #625 @ 0x271 + 8015518: 4638 mov r0, r7 + 801551a: f7ff ff27 bl 801536c <__i2b> + 801551e: 2300 movs r3, #0 + 8015520: 6438 str r0, [r7, #64] @ 0x40 + 8015522: 4604 mov r4, r0 + 8015524: 6003 str r3, [r0, #0] + 8015526: f04f 0900 mov.w r9, #0 + 801552a: 07eb lsls r3, r5, #31 + 801552c: d50a bpl.n 8015544 <__pow5mult+0x58> + 801552e: 4631 mov r1, r6 + 8015530: 4622 mov r2, r4 + 8015532: 4638 mov r0, r7 + 8015534: f7ff ff30 bl 8015398 <__multiply> + 8015538: 4631 mov r1, r6 + 801553a: 4680 mov r8, r0 + 801553c: 4638 mov r0, r7 + 801553e: f7ff fe7a bl 8015236 <_Bfree> + 8015542: 4646 mov r6, r8 + 8015544: 106d asrs r5, r5, #1 + 8015546: d00b beq.n 8015560 <__pow5mult+0x74> + 8015548: 6820 ldr r0, [r4, #0] + 801554a: b938 cbnz r0, 801555c <__pow5mult+0x70> + 801554c: 4622 mov r2, r4 + 801554e: 4621 mov r1, r4 + 8015550: 4638 mov r0, r7 + 8015552: f7ff ff21 bl 8015398 <__multiply> + 8015556: 6020 str r0, [r4, #0] + 8015558: f8c0 9000 str.w r9, [r0] + 801555c: 4604 mov r4, r0 + 801555e: e7e4 b.n 801552a <__pow5mult+0x3e> + 8015560: 4630 mov r0, r6 + 8015562: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc} + 8015566: bf00 nop + 8015568: 08019138 .word 0x08019138 + +0801556c <__lshift>: + 801556c: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 8015570: 460c mov r4, r1 + 8015572: 6849 ldr r1, [r1, #4] + 8015574: 6923 ldr r3, [r4, #16] + 8015576: eb03 1862 add.w r8, r3, r2, asr #5 + 801557a: 68a3 ldr r3, [r4, #8] + 801557c: 4607 mov r7, r0 + 801557e: 4691 mov r9, r2 + 8015580: ea4f 1a62 mov.w sl, r2, asr #5 + 8015584: f108 0601 add.w r6, r8, #1 + 8015588: 42b3 cmp r3, r6 + 801558a: db0b blt.n 80155a4 <__lshift+0x38> + 801558c: 4638 mov r0, r7 + 801558e: f7ff fe2d bl 80151ec <_Balloc> + 8015592: 4605 mov r5, r0 + 8015594: b948 cbnz r0, 80155aa <__lshift+0x3e> + 8015596: 4602 mov r2, r0 + 8015598: 4b28 ldr r3, [pc, #160] @ (801563c <__lshift+0xd0>) + 801559a: 4829 ldr r0, [pc, #164] @ (8015640 <__lshift+0xd4>) + 801559c: f44f 71ef mov.w r1, #478 @ 0x1de + 80155a0: f000 fbf4 bl 8015d8c <__assert_func> + 80155a4: 3101 adds r1, #1 + 80155a6: 005b lsls r3, r3, #1 + 80155a8: e7ee b.n 8015588 <__lshift+0x1c> + 80155aa: 2300 movs r3, #0 + 80155ac: f100 0114 add.w r1, r0, #20 + 80155b0: f100 0210 add.w r2, r0, #16 + 80155b4: 4618 mov r0, r3 + 80155b6: 4553 cmp r3, sl + 80155b8: db33 blt.n 8015622 <__lshift+0xb6> + 80155ba: 6920 ldr r0, [r4, #16] + 80155bc: ea2a 7aea bic.w sl, sl, sl, asr #31 + 80155c0: f104 0314 add.w r3, r4, #20 + 80155c4: f019 091f ands.w r9, r9, #31 + 80155c8: eb01 018a add.w r1, r1, sl, lsl #2 + 80155cc: eb03 0c80 add.w ip, r3, r0, lsl #2 + 80155d0: d02b beq.n 801562a <__lshift+0xbe> + 80155d2: f1c9 0e20 rsb lr, r9, #32 + 80155d6: 468a mov sl, r1 + 80155d8: 2200 movs r2, #0 + 80155da: 6818 ldr r0, [r3, #0] + 80155dc: fa00 f009 lsl.w r0, r0, r9 + 80155e0: 4310 orrs r0, r2 + 80155e2: f84a 0b04 str.w r0, [sl], #4 + 80155e6: f853 2b04 ldr.w r2, [r3], #4 + 80155ea: 459c cmp ip, r3 + 80155ec: fa22 f20e lsr.w r2, r2, lr + 80155f0: d8f3 bhi.n 80155da <__lshift+0x6e> + 80155f2: ebac 0304 sub.w r3, ip, r4 + 80155f6: 3b15 subs r3, #21 + 80155f8: f023 0303 bic.w r3, r3, #3 + 80155fc: 3304 adds r3, #4 + 80155fe: f104 0015 add.w r0, r4, #21 + 8015602: 4584 cmp ip, r0 + 8015604: bf38 it cc + 8015606: 2304 movcc r3, #4 + 8015608: 50ca str r2, [r1, r3] + 801560a: b10a cbz r2, 8015610 <__lshift+0xa4> + 801560c: f108 0602 add.w r6, r8, #2 + 8015610: 3e01 subs r6, #1 + 8015612: 4638 mov r0, r7 + 8015614: 612e str r6, [r5, #16] + 8015616: 4621 mov r1, r4 + 8015618: f7ff fe0d bl 8015236 <_Bfree> + 801561c: 4628 mov r0, r5 + 801561e: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} + 8015622: f842 0f04 str.w r0, [r2, #4]! + 8015626: 3301 adds r3, #1 + 8015628: e7c5 b.n 80155b6 <__lshift+0x4a> + 801562a: 3904 subs r1, #4 + 801562c: f853 2b04 ldr.w r2, [r3], #4 + 8015630: f841 2f04 str.w r2, [r1, #4]! + 8015634: 459c cmp ip, r3 + 8015636: d8f9 bhi.n 801562c <__lshift+0xc0> + 8015638: e7ea b.n 8015610 <__lshift+0xa4> + 801563a: bf00 nop + 801563c: 08019076 .word 0x08019076 + 8015640: 080190df .word 0x080190df + +08015644 <__mcmp>: + 8015644: 690a ldr r2, [r1, #16] + 8015646: 4603 mov r3, r0 + 8015648: 6900 ldr r0, [r0, #16] + 801564a: 1a80 subs r0, r0, r2 + 801564c: b530 push {r4, r5, lr} + 801564e: d10e bne.n 801566e <__mcmp+0x2a> + 8015650: 3314 adds r3, #20 + 8015652: 3114 adds r1, #20 + 8015654: eb03 0482 add.w r4, r3, r2, lsl #2 + 8015658: eb01 0182 add.w r1, r1, r2, lsl #2 + 801565c: f854 5d04 ldr.w r5, [r4, #-4]! + 8015660: f851 2d04 ldr.w r2, [r1, #-4]! + 8015664: 4295 cmp r5, r2 + 8015666: d003 beq.n 8015670 <__mcmp+0x2c> + 8015668: d205 bcs.n 8015676 <__mcmp+0x32> + 801566a: f04f 30ff mov.w r0, #4294967295 + 801566e: bd30 pop {r4, r5, pc} + 8015670: 42a3 cmp r3, r4 + 8015672: d3f3 bcc.n 801565c <__mcmp+0x18> + 8015674: e7fb b.n 801566e <__mcmp+0x2a> + 8015676: 2001 movs r0, #1 + 8015678: e7f9 b.n 801566e <__mcmp+0x2a> + ... + +0801567c <__mdiff>: + 801567c: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8015680: 4689 mov r9, r1 + 8015682: 4606 mov r6, r0 + 8015684: 4611 mov r1, r2 + 8015686: 4648 mov r0, r9 + 8015688: 4614 mov r4, r2 + 801568a: f7ff ffdb bl 8015644 <__mcmp> + 801568e: 1e05 subs r5, r0, #0 + 8015690: d112 bne.n 80156b8 <__mdiff+0x3c> + 8015692: 4629 mov r1, r5 + 8015694: 4630 mov r0, r6 + 8015696: f7ff fda9 bl 80151ec <_Balloc> + 801569a: 4602 mov r2, r0 + 801569c: b928 cbnz r0, 80156aa <__mdiff+0x2e> + 801569e: 4b3f ldr r3, [pc, #252] @ (801579c <__mdiff+0x120>) + 80156a0: f240 2137 movw r1, #567 @ 0x237 + 80156a4: 483e ldr r0, [pc, #248] @ (80157a0 <__mdiff+0x124>) + 80156a6: f000 fb71 bl 8015d8c <__assert_func> + 80156aa: 2301 movs r3, #1 + 80156ac: e9c0 3504 strd r3, r5, [r0, #16] + 80156b0: 4610 mov r0, r2 + 80156b2: b003 add sp, #12 + 80156b4: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 80156b8: bfbc itt lt + 80156ba: 464b movlt r3, r9 + 80156bc: 46a1 movlt r9, r4 + 80156be: 4630 mov r0, r6 + 80156c0: f8d9 1004 ldr.w r1, [r9, #4] + 80156c4: bfba itte lt + 80156c6: 461c movlt r4, r3 + 80156c8: 2501 movlt r5, #1 + 80156ca: 2500 movge r5, #0 + 80156cc: f7ff fd8e bl 80151ec <_Balloc> + 80156d0: 4602 mov r2, r0 + 80156d2: b918 cbnz r0, 80156dc <__mdiff+0x60> + 80156d4: 4b31 ldr r3, [pc, #196] @ (801579c <__mdiff+0x120>) + 80156d6: f240 2145 movw r1, #581 @ 0x245 + 80156da: e7e3 b.n 80156a4 <__mdiff+0x28> + 80156dc: f8d9 7010 ldr.w r7, [r9, #16] + 80156e0: 6926 ldr r6, [r4, #16] + 80156e2: 60c5 str r5, [r0, #12] + 80156e4: f109 0310 add.w r3, r9, #16 + 80156e8: f109 0514 add.w r5, r9, #20 + 80156ec: f104 0e14 add.w lr, r4, #20 + 80156f0: f100 0b14 add.w fp, r0, #20 + 80156f4: eb05 0887 add.w r8, r5, r7, lsl #2 + 80156f8: eb0e 0686 add.w r6, lr, r6, lsl #2 + 80156fc: 9301 str r3, [sp, #4] + 80156fe: 46d9 mov r9, fp + 8015700: f04f 0c00 mov.w ip, #0 + 8015704: 9b01 ldr r3, [sp, #4] + 8015706: f85e 0b04 ldr.w r0, [lr], #4 + 801570a: f853 af04 ldr.w sl, [r3, #4]! + 801570e: 9301 str r3, [sp, #4] + 8015710: fa1f f38a uxth.w r3, sl + 8015714: 4619 mov r1, r3 + 8015716: b283 uxth r3, r0 + 8015718: 1acb subs r3, r1, r3 + 801571a: 0c00 lsrs r0, r0, #16 + 801571c: 4463 add r3, ip + 801571e: ebc0 401a rsb r0, r0, sl, lsr #16 + 8015722: eb00 4023 add.w r0, r0, r3, asr #16 + 8015726: b29b uxth r3, r3 + 8015728: ea43 4300 orr.w r3, r3, r0, lsl #16 + 801572c: 4576 cmp r6, lr + 801572e: f849 3b04 str.w r3, [r9], #4 + 8015732: ea4f 4c20 mov.w ip, r0, asr #16 + 8015736: d8e5 bhi.n 8015704 <__mdiff+0x88> + 8015738: 1b33 subs r3, r6, r4 + 801573a: 3b15 subs r3, #21 + 801573c: f023 0303 bic.w r3, r3, #3 + 8015740: 3415 adds r4, #21 + 8015742: 3304 adds r3, #4 + 8015744: 42a6 cmp r6, r4 + 8015746: bf38 it cc + 8015748: 2304 movcc r3, #4 + 801574a: 441d add r5, r3 + 801574c: 445b add r3, fp + 801574e: 461e mov r6, r3 + 8015750: 462c mov r4, r5 + 8015752: 4544 cmp r4, r8 + 8015754: d30e bcc.n 8015774 <__mdiff+0xf8> + 8015756: f108 0103 add.w r1, r8, #3 + 801575a: 1b49 subs r1, r1, r5 + 801575c: f021 0103 bic.w r1, r1, #3 + 8015760: 3d03 subs r5, #3 + 8015762: 45a8 cmp r8, r5 + 8015764: bf38 it cc + 8015766: 2100 movcc r1, #0 + 8015768: 440b add r3, r1 + 801576a: f853 1d04 ldr.w r1, [r3, #-4]! + 801576e: b191 cbz r1, 8015796 <__mdiff+0x11a> + 8015770: 6117 str r7, [r2, #16] + 8015772: e79d b.n 80156b0 <__mdiff+0x34> + 8015774: f854 1b04 ldr.w r1, [r4], #4 + 8015778: 46e6 mov lr, ip + 801577a: 0c08 lsrs r0, r1, #16 + 801577c: fa1c fc81 uxtah ip, ip, r1 + 8015780: 4471 add r1, lr + 8015782: eb00 402c add.w r0, r0, ip, asr #16 + 8015786: b289 uxth r1, r1 + 8015788: ea41 4100 orr.w r1, r1, r0, lsl #16 + 801578c: f846 1b04 str.w r1, [r6], #4 + 8015790: ea4f 4c20 mov.w ip, r0, asr #16 + 8015794: e7dd b.n 8015752 <__mdiff+0xd6> + 8015796: 3f01 subs r7, #1 + 8015798: e7e7 b.n 801576a <__mdiff+0xee> + 801579a: bf00 nop + 801579c: 08019076 .word 0x08019076 + 80157a0: 080190df .word 0x080190df + +080157a4 <__d2b>: + 80157a4: e92d 43f7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, lr} + 80157a8: 460f mov r7, r1 + 80157aa: 2101 movs r1, #1 + 80157ac: ec59 8b10 vmov r8, r9, d0 + 80157b0: 4616 mov r6, r2 + 80157b2: f7ff fd1b bl 80151ec <_Balloc> + 80157b6: 4604 mov r4, r0 + 80157b8: b930 cbnz r0, 80157c8 <__d2b+0x24> + 80157ba: 4602 mov r2, r0 + 80157bc: 4b23 ldr r3, [pc, #140] @ (801584c <__d2b+0xa8>) + 80157be: 4824 ldr r0, [pc, #144] @ (8015850 <__d2b+0xac>) + 80157c0: f240 310f movw r1, #783 @ 0x30f + 80157c4: f000 fae2 bl 8015d8c <__assert_func> + 80157c8: f3c9 550a ubfx r5, r9, #20, #11 + 80157cc: f3c9 0313 ubfx r3, r9, #0, #20 + 80157d0: b10d cbz r5, 80157d6 <__d2b+0x32> + 80157d2: f443 1380 orr.w r3, r3, #1048576 @ 0x100000 + 80157d6: 9301 str r3, [sp, #4] + 80157d8: f1b8 0300 subs.w r3, r8, #0 + 80157dc: d023 beq.n 8015826 <__d2b+0x82> + 80157de: 4668 mov r0, sp + 80157e0: 9300 str r3, [sp, #0] + 80157e2: f7ff fd96 bl 8015312 <__lo0bits> + 80157e6: e9dd 1200 ldrd r1, r2, [sp] + 80157ea: b1d0 cbz r0, 8015822 <__d2b+0x7e> + 80157ec: f1c0 0320 rsb r3, r0, #32 + 80157f0: fa02 f303 lsl.w r3, r2, r3 + 80157f4: 430b orrs r3, r1 + 80157f6: 40c2 lsrs r2, r0 + 80157f8: 6163 str r3, [r4, #20] + 80157fa: 9201 str r2, [sp, #4] + 80157fc: 9b01 ldr r3, [sp, #4] + 80157fe: 61a3 str r3, [r4, #24] + 8015800: 2b00 cmp r3, #0 + 8015802: bf0c ite eq + 8015804: 2201 moveq r2, #1 + 8015806: 2202 movne r2, #2 + 8015808: 6122 str r2, [r4, #16] + 801580a: b1a5 cbz r5, 8015836 <__d2b+0x92> + 801580c: f2a5 4533 subw r5, r5, #1075 @ 0x433 + 8015810: 4405 add r5, r0 + 8015812: 603d str r5, [r7, #0] + 8015814: f1c0 0035 rsb r0, r0, #53 @ 0x35 + 8015818: 6030 str r0, [r6, #0] + 801581a: 4620 mov r0, r4 + 801581c: b003 add sp, #12 + 801581e: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} + 8015822: 6161 str r1, [r4, #20] + 8015824: e7ea b.n 80157fc <__d2b+0x58> + 8015826: a801 add r0, sp, #4 + 8015828: f7ff fd73 bl 8015312 <__lo0bits> + 801582c: 9b01 ldr r3, [sp, #4] + 801582e: 6163 str r3, [r4, #20] + 8015830: 3020 adds r0, #32 + 8015832: 2201 movs r2, #1 + 8015834: e7e8 b.n 8015808 <__d2b+0x64> + 8015836: eb04 0382 add.w r3, r4, r2, lsl #2 + 801583a: f2a0 4032 subw r0, r0, #1074 @ 0x432 + 801583e: 6038 str r0, [r7, #0] + 8015840: 6918 ldr r0, [r3, #16] + 8015842: f7ff fd47 bl 80152d4 <__hi0bits> + 8015846: ebc0 1042 rsb r0, r0, r2, lsl #5 + 801584a: e7e5 b.n 8015818 <__d2b+0x74> + 801584c: 08019076 .word 0x08019076 + 8015850: 080190df .word 0x080190df + +08015854 <_realloc_r>: + 8015854: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8015858: 4682 mov sl, r0 + 801585a: 4693 mov fp, r2 + 801585c: 460c mov r4, r1 + 801585e: b929 cbnz r1, 801586c <_realloc_r+0x18> + 8015860: 4611 mov r1, r2 + 8015862: b003 add sp, #12 + 8015864: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 8015868: f7fc b8f6 b.w 8011a58 <_malloc_r> + 801586c: f7fc fb2e bl 8011ecc <__malloc_lock> + 8015870: f10b 080b add.w r8, fp, #11 + 8015874: f854 5c04 ldr.w r5, [r4, #-4] + 8015878: f1b8 0f16 cmp.w r8, #22 + 801587c: f1a4 0908 sub.w r9, r4, #8 + 8015880: f025 0603 bic.w r6, r5, #3 + 8015884: d908 bls.n 8015898 <_realloc_r+0x44> + 8015886: f038 0807 bics.w r8, r8, #7 + 801588a: d507 bpl.n 801589c <_realloc_r+0x48> + 801588c: 230c movs r3, #12 + 801588e: f8ca 3000 str.w r3, [sl] + 8015892: f04f 0b00 mov.w fp, #0 + 8015896: e032 b.n 80158fe <_realloc_r+0xaa> + 8015898: f04f 0810 mov.w r8, #16 + 801589c: 45c3 cmp fp, r8 + 801589e: d8f5 bhi.n 801588c <_realloc_r+0x38> + 80158a0: 4546 cmp r6, r8 + 80158a2: f280 8174 bge.w 8015b8e <_realloc_r+0x33a> + 80158a6: 4b9e ldr r3, [pc, #632] @ (8015b20 <_realloc_r+0x2cc>) + 80158a8: f8d3 c008 ldr.w ip, [r3, #8] + 80158ac: eb09 0106 add.w r1, r9, r6 + 80158b0: 458c cmp ip, r1 + 80158b2: 6848 ldr r0, [r1, #4] + 80158b4: d005 beq.n 80158c2 <_realloc_r+0x6e> + 80158b6: f020 0201 bic.w r2, r0, #1 + 80158ba: 440a add r2, r1 + 80158bc: 6852 ldr r2, [r2, #4] + 80158be: 07d7 lsls r7, r2, #31 + 80158c0: d449 bmi.n 8015956 <_realloc_r+0x102> + 80158c2: f020 0003 bic.w r0, r0, #3 + 80158c6: 458c cmp ip, r1 + 80158c8: eb06 0700 add.w r7, r6, r0 + 80158cc: d11b bne.n 8015906 <_realloc_r+0xb2> + 80158ce: f108 0210 add.w r2, r8, #16 + 80158d2: 42ba cmp r2, r7 + 80158d4: dc41 bgt.n 801595a <_realloc_r+0x106> + 80158d6: eb09 0208 add.w r2, r9, r8 + 80158da: eba7 0708 sub.w r7, r7, r8 + 80158de: f047 0701 orr.w r7, r7, #1 + 80158e2: 609a str r2, [r3, #8] + 80158e4: 6057 str r7, [r2, #4] + 80158e6: f854 3c04 ldr.w r3, [r4, #-4] + 80158ea: f003 0301 and.w r3, r3, #1 + 80158ee: ea43 0308 orr.w r3, r3, r8 + 80158f2: f844 3c04 str.w r3, [r4, #-4] + 80158f6: 4650 mov r0, sl + 80158f8: f7fc faee bl 8011ed8 <__malloc_unlock> + 80158fc: 46a3 mov fp, r4 + 80158fe: 4658 mov r0, fp + 8015900: b003 add sp, #12 + 8015902: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} + 8015906: 45b8 cmp r8, r7 + 8015908: dc27 bgt.n 801595a <_realloc_r+0x106> + 801590a: e9d1 2302 ldrd r2, r3, [r1, #8] + 801590e: 60d3 str r3, [r2, #12] + 8015910: 609a str r2, [r3, #8] + 8015912: f8d9 3004 ldr.w r3, [r9, #4] + 8015916: eba7 0008 sub.w r0, r7, r8 + 801591a: 280f cmp r0, #15 + 801591c: f003 0301 and.w r3, r3, #1 + 8015920: eb09 0207 add.w r2, r9, r7 + 8015924: f240 8135 bls.w 8015b92 <_realloc_r+0x33e> + 8015928: eb09 0108 add.w r1, r9, r8 + 801592c: ea48 0303 orr.w r3, r8, r3 + 8015930: f040 0001 orr.w r0, r0, #1 + 8015934: f8c9 3004 str.w r3, [r9, #4] + 8015938: 6048 str r0, [r1, #4] + 801593a: 6853 ldr r3, [r2, #4] + 801593c: f043 0301 orr.w r3, r3, #1 + 8015940: 6053 str r3, [r2, #4] + 8015942: 3108 adds r1, #8 + 8015944: 4650 mov r0, sl + 8015946: f7fb ffc7 bl 80118d8 <_free_r> + 801594a: 4650 mov r0, sl + 801594c: f7fc fac4 bl 8011ed8 <__malloc_unlock> + 8015950: f109 0b08 add.w fp, r9, #8 + 8015954: e7d3 b.n 80158fe <_realloc_r+0xaa> + 8015956: 2000 movs r0, #0 + 8015958: 4601 mov r1, r0 + 801595a: 07ea lsls r2, r5, #31 + 801595c: f100 80c7 bmi.w 8015aee <_realloc_r+0x29a> + 8015960: f854 5c08 ldr.w r5, [r4, #-8] + 8015964: eba9 0505 sub.w r5, r9, r5 + 8015968: 686a ldr r2, [r5, #4] + 801596a: f022 0203 bic.w r2, r2, #3 + 801596e: 4432 add r2, r6 + 8015970: 9201 str r2, [sp, #4] + 8015972: 2900 cmp r1, #0 + 8015974: f000 8086 beq.w 8015a84 <_realloc_r+0x230> + 8015978: 458c cmp ip, r1 + 801597a: eb00 0702 add.w r7, r0, r2 + 801597e: d149 bne.n 8015a14 <_realloc_r+0x1c0> + 8015980: f108 0210 add.w r2, r8, #16 + 8015984: 42ba cmp r2, r7 + 8015986: dc7d bgt.n 8015a84 <_realloc_r+0x230> + 8015988: 46ab mov fp, r5 + 801598a: 68ea ldr r2, [r5, #12] + 801598c: f85b 1f08 ldr.w r1, [fp, #8]! + 8015990: 60ca str r2, [r1, #12] + 8015992: 6091 str r1, [r2, #8] + 8015994: 1f32 subs r2, r6, #4 + 8015996: 2a24 cmp r2, #36 @ 0x24 + 8015998: d836 bhi.n 8015a08 <_realloc_r+0x1b4> + 801599a: 2a13 cmp r2, #19 + 801599c: d932 bls.n 8015a04 <_realloc_r+0x1b0> + 801599e: 6821 ldr r1, [r4, #0] + 80159a0: 60a9 str r1, [r5, #8] + 80159a2: 6861 ldr r1, [r4, #4] + 80159a4: 60e9 str r1, [r5, #12] + 80159a6: 2a1b cmp r2, #27 + 80159a8: d81a bhi.n 80159e0 <_realloc_r+0x18c> + 80159aa: 3408 adds r4, #8 + 80159ac: f105 0210 add.w r2, r5, #16 + 80159b0: 6821 ldr r1, [r4, #0] + 80159b2: 6011 str r1, [r2, #0] + 80159b4: 6861 ldr r1, [r4, #4] + 80159b6: 6051 str r1, [r2, #4] + 80159b8: 68a1 ldr r1, [r4, #8] + 80159ba: 6091 str r1, [r2, #8] + 80159bc: eb05 0208 add.w r2, r5, r8 + 80159c0: eba7 0708 sub.w r7, r7, r8 + 80159c4: f047 0701 orr.w r7, r7, #1 + 80159c8: 609a str r2, [r3, #8] + 80159ca: 6057 str r7, [r2, #4] + 80159cc: 686b ldr r3, [r5, #4] + 80159ce: f003 0301 and.w r3, r3, #1 + 80159d2: ea43 0308 orr.w r3, r3, r8 + 80159d6: 606b str r3, [r5, #4] + 80159d8: 4650 mov r0, sl + 80159da: f7fc fa7d bl 8011ed8 <__malloc_unlock> + 80159de: e78e b.n 80158fe <_realloc_r+0xaa> + 80159e0: 68a1 ldr r1, [r4, #8] + 80159e2: 6129 str r1, [r5, #16] + 80159e4: 68e1 ldr r1, [r4, #12] + 80159e6: 6169 str r1, [r5, #20] + 80159e8: 2a24 cmp r2, #36 @ 0x24 + 80159ea: bf01 itttt eq + 80159ec: 6922 ldreq r2, [r4, #16] + 80159ee: 61aa streq r2, [r5, #24] + 80159f0: 6961 ldreq r1, [r4, #20] + 80159f2: 61e9 streq r1, [r5, #28] + 80159f4: bf19 ittee ne + 80159f6: 3410 addne r4, #16 + 80159f8: f105 0218 addne.w r2, r5, #24 + 80159fc: f105 0220 addeq.w r2, r5, #32 + 8015a00: 3418 addeq r4, #24 + 8015a02: e7d5 b.n 80159b0 <_realloc_r+0x15c> + 8015a04: 465a mov r2, fp + 8015a06: e7d3 b.n 80159b0 <_realloc_r+0x15c> + 8015a08: 4621 mov r1, r4 + 8015a0a: 4658 mov r0, fp + 8015a0c: f7fb fe59 bl 80116c2 + 8015a10: 4b43 ldr r3, [pc, #268] @ (8015b20 <_realloc_r+0x2cc>) + 8015a12: e7d3 b.n 80159bc <_realloc_r+0x168> + 8015a14: 45b8 cmp r8, r7 + 8015a16: dc35 bgt.n 8015a84 <_realloc_r+0x230> + 8015a18: e9d1 2302 ldrd r2, r3, [r1, #8] + 8015a1c: 4628 mov r0, r5 + 8015a1e: 60d3 str r3, [r2, #12] + 8015a20: 609a str r2, [r3, #8] + 8015a22: f850 2f08 ldr.w r2, [r0, #8]! + 8015a26: 68eb ldr r3, [r5, #12] + 8015a28: 60d3 str r3, [r2, #12] + 8015a2a: 609a str r2, [r3, #8] + 8015a2c: 1f32 subs r2, r6, #4 + 8015a2e: 2a24 cmp r2, #36 @ 0x24 + 8015a30: d824 bhi.n 8015a7c <_realloc_r+0x228> + 8015a32: 2a13 cmp r2, #19 + 8015a34: d908 bls.n 8015a48 <_realloc_r+0x1f4> + 8015a36: 6823 ldr r3, [r4, #0] + 8015a38: 60ab str r3, [r5, #8] + 8015a3a: 6863 ldr r3, [r4, #4] + 8015a3c: 60eb str r3, [r5, #12] + 8015a3e: 2a1b cmp r2, #27 + 8015a40: d80a bhi.n 8015a58 <_realloc_r+0x204> + 8015a42: 3408 adds r4, #8 + 8015a44: f105 0010 add.w r0, r5, #16 + 8015a48: 6823 ldr r3, [r4, #0] + 8015a4a: 6003 str r3, [r0, #0] + 8015a4c: 6863 ldr r3, [r4, #4] + 8015a4e: 6043 str r3, [r0, #4] + 8015a50: 68a3 ldr r3, [r4, #8] + 8015a52: 6083 str r3, [r0, #8] + 8015a54: 46a9 mov r9, r5 + 8015a56: e75c b.n 8015912 <_realloc_r+0xbe> + 8015a58: 68a3 ldr r3, [r4, #8] + 8015a5a: 612b str r3, [r5, #16] + 8015a5c: 68e3 ldr r3, [r4, #12] + 8015a5e: 616b str r3, [r5, #20] + 8015a60: 2a24 cmp r2, #36 @ 0x24 + 8015a62: bf01 itttt eq + 8015a64: 6923 ldreq r3, [r4, #16] + 8015a66: 61ab streq r3, [r5, #24] + 8015a68: 6963 ldreq r3, [r4, #20] + 8015a6a: 61eb streq r3, [r5, #28] + 8015a6c: bf19 ittee ne + 8015a6e: 3410 addne r4, #16 + 8015a70: f105 0018 addne.w r0, r5, #24 + 8015a74: f105 0020 addeq.w r0, r5, #32 + 8015a78: 3418 addeq r4, #24 + 8015a7a: e7e5 b.n 8015a48 <_realloc_r+0x1f4> + 8015a7c: 4621 mov r1, r4 + 8015a7e: f7fb fe20 bl 80116c2 + 8015a82: e7e7 b.n 8015a54 <_realloc_r+0x200> + 8015a84: 9b01 ldr r3, [sp, #4] + 8015a86: 4598 cmp r8, r3 + 8015a88: dc31 bgt.n 8015aee <_realloc_r+0x29a> + 8015a8a: 4628 mov r0, r5 + 8015a8c: 68eb ldr r3, [r5, #12] + 8015a8e: f850 2f08 ldr.w r2, [r0, #8]! + 8015a92: 60d3 str r3, [r2, #12] + 8015a94: 609a str r2, [r3, #8] + 8015a96: 1f32 subs r2, r6, #4 + 8015a98: 2a24 cmp r2, #36 @ 0x24 + 8015a9a: d824 bhi.n 8015ae6 <_realloc_r+0x292> + 8015a9c: 2a13 cmp r2, #19 + 8015a9e: d908 bls.n 8015ab2 <_realloc_r+0x25e> + 8015aa0: 6823 ldr r3, [r4, #0] + 8015aa2: 60ab str r3, [r5, #8] + 8015aa4: 6863 ldr r3, [r4, #4] + 8015aa6: 60eb str r3, [r5, #12] + 8015aa8: 2a1b cmp r2, #27 + 8015aaa: d80a bhi.n 8015ac2 <_realloc_r+0x26e> + 8015aac: 3408 adds r4, #8 + 8015aae: f105 0010 add.w r0, r5, #16 + 8015ab2: 6823 ldr r3, [r4, #0] + 8015ab4: 6003 str r3, [r0, #0] + 8015ab6: 6863 ldr r3, [r4, #4] + 8015ab8: 6043 str r3, [r0, #4] + 8015aba: 68a3 ldr r3, [r4, #8] + 8015abc: 6083 str r3, [r0, #8] + 8015abe: 9f01 ldr r7, [sp, #4] + 8015ac0: e7c8 b.n 8015a54 <_realloc_r+0x200> + 8015ac2: 68a3 ldr r3, [r4, #8] + 8015ac4: 612b str r3, [r5, #16] + 8015ac6: 68e3 ldr r3, [r4, #12] + 8015ac8: 616b str r3, [r5, #20] + 8015aca: 2a24 cmp r2, #36 @ 0x24 + 8015acc: bf01 itttt eq + 8015ace: 6923 ldreq r3, [r4, #16] + 8015ad0: 61ab streq r3, [r5, #24] + 8015ad2: 6963 ldreq r3, [r4, #20] + 8015ad4: 61eb streq r3, [r5, #28] + 8015ad6: bf19 ittee ne + 8015ad8: 3410 addne r4, #16 + 8015ada: f105 0018 addne.w r0, r5, #24 + 8015ade: f105 0020 addeq.w r0, r5, #32 + 8015ae2: 3418 addeq r4, #24 + 8015ae4: e7e5 b.n 8015ab2 <_realloc_r+0x25e> + 8015ae6: 4621 mov r1, r4 + 8015ae8: f7fb fdeb bl 80116c2 + 8015aec: e7e7 b.n 8015abe <_realloc_r+0x26a> + 8015aee: 4659 mov r1, fp + 8015af0: 4650 mov r0, sl + 8015af2: f7fb ffb1 bl 8011a58 <_malloc_r> + 8015af6: 4683 mov fp, r0 + 8015af8: b918 cbnz r0, 8015b02 <_realloc_r+0x2ae> + 8015afa: 4650 mov r0, sl + 8015afc: f7fc f9ec bl 8011ed8 <__malloc_unlock> + 8015b00: e6c7 b.n 8015892 <_realloc_r+0x3e> + 8015b02: f854 3c04 ldr.w r3, [r4, #-4] + 8015b06: f023 0301 bic.w r3, r3, #1 + 8015b0a: 444b add r3, r9 + 8015b0c: f1a0 0208 sub.w r2, r0, #8 + 8015b10: 4293 cmp r3, r2 + 8015b12: d107 bne.n 8015b24 <_realloc_r+0x2d0> + 8015b14: f850 7c04 ldr.w r7, [r0, #-4] + 8015b18: f027 0703 bic.w r7, r7, #3 + 8015b1c: 4437 add r7, r6 + 8015b1e: e6f8 b.n 8015912 <_realloc_r+0xbe> + 8015b20: 2000016c .word 0x2000016c + 8015b24: 1f32 subs r2, r6, #4 + 8015b26: 2a24 cmp r2, #36 @ 0x24 + 8015b28: d82d bhi.n 8015b86 <_realloc_r+0x332> + 8015b2a: 2a13 cmp r2, #19 + 8015b2c: d928 bls.n 8015b80 <_realloc_r+0x32c> + 8015b2e: 6823 ldr r3, [r4, #0] + 8015b30: 6003 str r3, [r0, #0] + 8015b32: 6863 ldr r3, [r4, #4] + 8015b34: 6043 str r3, [r0, #4] + 8015b36: 2a1b cmp r2, #27 + 8015b38: d80e bhi.n 8015b58 <_realloc_r+0x304> + 8015b3a: f104 0208 add.w r2, r4, #8 + 8015b3e: f100 0308 add.w r3, r0, #8 + 8015b42: 6811 ldr r1, [r2, #0] + 8015b44: 6019 str r1, [r3, #0] + 8015b46: 6851 ldr r1, [r2, #4] + 8015b48: 6059 str r1, [r3, #4] + 8015b4a: 6892 ldr r2, [r2, #8] + 8015b4c: 609a str r2, [r3, #8] + 8015b4e: 4621 mov r1, r4 + 8015b50: 4650 mov r0, sl + 8015b52: f7fb fec1 bl 80118d8 <_free_r> + 8015b56: e73f b.n 80159d8 <_realloc_r+0x184> + 8015b58: 68a3 ldr r3, [r4, #8] + 8015b5a: 6083 str r3, [r0, #8] + 8015b5c: 68e3 ldr r3, [r4, #12] + 8015b5e: 60c3 str r3, [r0, #12] + 8015b60: 2a24 cmp r2, #36 @ 0x24 + 8015b62: bf01 itttt eq + 8015b64: 6923 ldreq r3, [r4, #16] + 8015b66: 6103 streq r3, [r0, #16] + 8015b68: 6961 ldreq r1, [r4, #20] + 8015b6a: 6141 streq r1, [r0, #20] + 8015b6c: bf19 ittee ne + 8015b6e: f104 0210 addne.w r2, r4, #16 + 8015b72: f100 0310 addne.w r3, r0, #16 + 8015b76: f104 0218 addeq.w r2, r4, #24 + 8015b7a: f100 0318 addeq.w r3, r0, #24 + 8015b7e: e7e0 b.n 8015b42 <_realloc_r+0x2ee> + 8015b80: 4603 mov r3, r0 + 8015b82: 4622 mov r2, r4 + 8015b84: e7dd b.n 8015b42 <_realloc_r+0x2ee> + 8015b86: 4621 mov r1, r4 + 8015b88: f7fb fd9b bl 80116c2 + 8015b8c: e7df b.n 8015b4e <_realloc_r+0x2fa> + 8015b8e: 4637 mov r7, r6 + 8015b90: e6bf b.n 8015912 <_realloc_r+0xbe> + 8015b92: 431f orrs r7, r3 + 8015b94: f8c9 7004 str.w r7, [r9, #4] + 8015b98: 6853 ldr r3, [r2, #4] + 8015b9a: f043 0301 orr.w r3, r3, #1 + 8015b9e: 6053 str r3, [r2, #4] + 8015ba0: e6d3 b.n 801594a <_realloc_r+0xf6> + 8015ba2: bf00 nop + +08015ba4 <__ascii_wctomb>: + 8015ba4: 4603 mov r3, r0 + 8015ba6: 4608 mov r0, r1 + 8015ba8: b141 cbz r1, 8015bbc <__ascii_wctomb+0x18> + 8015baa: 2aff cmp r2, #255 @ 0xff + 8015bac: d904 bls.n 8015bb8 <__ascii_wctomb+0x14> + 8015bae: 228a movs r2, #138 @ 0x8a + 8015bb0: 601a str r2, [r3, #0] + 8015bb2: f04f 30ff mov.w r0, #4294967295 + 8015bb6: 4770 bx lr + 8015bb8: 700a strb r2, [r1, #0] + 8015bba: 2001 movs r0, #1 + 8015bbc: 4770 bx lr + ... + +08015bc0 <_wcrtomb_r>: + 8015bc0: b5f0 push {r4, r5, r6, r7, lr} + 8015bc2: 4c09 ldr r4, [pc, #36] @ (8015be8 <_wcrtomb_r+0x28>) + 8015bc4: b085 sub sp, #20 + 8015bc6: f8d4 70e0 ldr.w r7, [r4, #224] @ 0xe0 + 8015bca: 4605 mov r5, r0 + 8015bcc: 461e mov r6, r3 + 8015bce: b909 cbnz r1, 8015bd4 <_wcrtomb_r+0x14> + 8015bd0: 460a mov r2, r1 + 8015bd2: a901 add r1, sp, #4 + 8015bd4: 47b8 blx r7 + 8015bd6: 1c43 adds r3, r0, #1 + 8015bd8: bf01 itttt eq + 8015bda: 2300 moveq r3, #0 + 8015bdc: 6033 streq r3, [r6, #0] + 8015bde: 238a moveq r3, #138 @ 0x8a + 8015be0: 602b streq r3, [r5, #0] + 8015be2: b005 add sp, #20 + 8015be4: bdf0 pop {r4, r5, r6, r7, pc} + 8015be6: bf00 nop + 8015be8: 20000574 .word 0x20000574 + +08015bec <__swhatbuf_r>: + 8015bec: b570 push {r4, r5, r6, lr} + 8015bee: 460c mov r4, r1 + 8015bf0: f9b1 100e ldrsh.w r1, [r1, #14] + 8015bf4: 2900 cmp r1, #0 + 8015bf6: b096 sub sp, #88 @ 0x58 + 8015bf8: 4615 mov r5, r2 + 8015bfa: 461e mov r6, r3 + 8015bfc: da07 bge.n 8015c0e <__swhatbuf_r+0x22> + 8015bfe: 89a1 ldrh r1, [r4, #12] + 8015c00: f011 0180 ands.w r1, r1, #128 @ 0x80 + 8015c04: d117 bne.n 8015c36 <__swhatbuf_r+0x4a> + 8015c06: f44f 6380 mov.w r3, #1024 @ 0x400 + 8015c0a: 4608 mov r0, r1 + 8015c0c: e00f b.n 8015c2e <__swhatbuf_r+0x42> + 8015c0e: 466a mov r2, sp + 8015c10: f000 f89a bl 8015d48 <_fstat_r> + 8015c14: 2800 cmp r0, #0 + 8015c16: dbf2 blt.n 8015bfe <__swhatbuf_r+0x12> + 8015c18: 9901 ldr r1, [sp, #4] + 8015c1a: f401 4170 and.w r1, r1, #61440 @ 0xf000 + 8015c1e: f5a1 5300 sub.w r3, r1, #8192 @ 0x2000 + 8015c22: 4259 negs r1, r3 + 8015c24: 4159 adcs r1, r3 + 8015c26: f44f 6000 mov.w r0, #2048 @ 0x800 + 8015c2a: f44f 6380 mov.w r3, #1024 @ 0x400 + 8015c2e: 6031 str r1, [r6, #0] + 8015c30: 602b str r3, [r5, #0] + 8015c32: b016 add sp, #88 @ 0x58 + 8015c34: bd70 pop {r4, r5, r6, pc} + 8015c36: 2100 movs r1, #0 + 8015c38: 2340 movs r3, #64 @ 0x40 + 8015c3a: e7e6 b.n 8015c0a <__swhatbuf_r+0x1e> + +08015c3c <__smakebuf_r>: + 8015c3c: 898b ldrh r3, [r1, #12] + 8015c3e: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} + 8015c40: 079d lsls r5, r3, #30 + 8015c42: 4606 mov r6, r0 + 8015c44: 460c mov r4, r1 + 8015c46: d507 bpl.n 8015c58 <__smakebuf_r+0x1c> + 8015c48: f104 0343 add.w r3, r4, #67 @ 0x43 + 8015c4c: 6023 str r3, [r4, #0] + 8015c4e: 6123 str r3, [r4, #16] + 8015c50: 2301 movs r3, #1 + 8015c52: 6163 str r3, [r4, #20] + 8015c54: b003 add sp, #12 + 8015c56: bdf0 pop {r4, r5, r6, r7, pc} + 8015c58: ab01 add r3, sp, #4 + 8015c5a: 466a mov r2, sp + 8015c5c: f7ff ffc6 bl 8015bec <__swhatbuf_r> + 8015c60: 9f00 ldr r7, [sp, #0] + 8015c62: 4605 mov r5, r0 + 8015c64: 4639 mov r1, r7 + 8015c66: 4630 mov r0, r6 + 8015c68: f7fb fef6 bl 8011a58 <_malloc_r> + 8015c6c: b948 cbnz r0, 8015c82 <__smakebuf_r+0x46> + 8015c6e: f9b4 300c ldrsh.w r3, [r4, #12] + 8015c72: 059a lsls r2, r3, #22 + 8015c74: d4ee bmi.n 8015c54 <__smakebuf_r+0x18> + 8015c76: f023 0303 bic.w r3, r3, #3 + 8015c7a: f043 0302 orr.w r3, r3, #2 + 8015c7e: 81a3 strh r3, [r4, #12] + 8015c80: e7e2 b.n 8015c48 <__smakebuf_r+0xc> + 8015c82: 89a3 ldrh r3, [r4, #12] + 8015c84: 6020 str r0, [r4, #0] + 8015c86: f043 0380 orr.w r3, r3, #128 @ 0x80 + 8015c8a: 81a3 strh r3, [r4, #12] + 8015c8c: 9b01 ldr r3, [sp, #4] + 8015c8e: e9c4 0704 strd r0, r7, [r4, #16] + 8015c92: b15b cbz r3, 8015cac <__smakebuf_r+0x70> + 8015c94: f9b4 100e ldrsh.w r1, [r4, #14] + 8015c98: 4630 mov r0, r6 + 8015c9a: f000 f867 bl 8015d6c <_isatty_r> + 8015c9e: b128 cbz r0, 8015cac <__smakebuf_r+0x70> + 8015ca0: 89a3 ldrh r3, [r4, #12] + 8015ca2: f023 0303 bic.w r3, r3, #3 + 8015ca6: f043 0301 orr.w r3, r3, #1 + 8015caa: 81a3 strh r3, [r4, #12] + 8015cac: 89a3 ldrh r3, [r4, #12] + 8015cae: 431d orrs r5, r3 + 8015cb0: 81a5 strh r5, [r4, #12] + 8015cb2: e7cf b.n 8015c54 <__smakebuf_r+0x18> + +08015cb4 <__swbuf_r>: + 8015cb4: b5f8 push {r3, r4, r5, r6, r7, lr} + 8015cb6: 460e mov r6, r1 + 8015cb8: 4614 mov r4, r2 + 8015cba: 4605 mov r5, r0 + 8015cbc: b118 cbz r0, 8015cc6 <__swbuf_r+0x12> + 8015cbe: 6b43 ldr r3, [r0, #52] @ 0x34 + 8015cc0: b90b cbnz r3, 8015cc6 <__swbuf_r+0x12> + 8015cc2: f7fb fc63 bl 801158c <__sinit> + 8015cc6: 69a3 ldr r3, [r4, #24] + 8015cc8: 60a3 str r3, [r4, #8] + 8015cca: 89a3 ldrh r3, [r4, #12] + 8015ccc: 0719 lsls r1, r3, #28 + 8015cce: d501 bpl.n 8015cd4 <__swbuf_r+0x20> + 8015cd0: 6923 ldr r3, [r4, #16] + 8015cd2: b943 cbnz r3, 8015ce6 <__swbuf_r+0x32> + 8015cd4: 4621 mov r1, r4 + 8015cd6: 4628 mov r0, r5 + 8015cd8: f7fe fabc bl 8014254 <__swsetup_r> + 8015cdc: b118 cbz r0, 8015ce6 <__swbuf_r+0x32> + 8015cde: f04f 37ff mov.w r7, #4294967295 + 8015ce2: 4638 mov r0, r7 + 8015ce4: bdf8 pop {r3, r4, r5, r6, r7, pc} + 8015ce6: f9b4 300c ldrsh.w r3, [r4, #12] + 8015cea: b2f6 uxtb r6, r6 + 8015cec: 049a lsls r2, r3, #18 + 8015cee: 4637 mov r7, r6 + 8015cf0: d406 bmi.n 8015d00 <__swbuf_r+0x4c> + 8015cf2: f443 5300 orr.w r3, r3, #8192 @ 0x2000 + 8015cf6: 81a3 strh r3, [r4, #12] + 8015cf8: 6e63 ldr r3, [r4, #100] @ 0x64 + 8015cfa: f423 5300 bic.w r3, r3, #8192 @ 0x2000 + 8015cfe: 6663 str r3, [r4, #100] @ 0x64 + 8015d00: 6823 ldr r3, [r4, #0] + 8015d02: 6922 ldr r2, [r4, #16] + 8015d04: 1a98 subs r0, r3, r2 + 8015d06: 6963 ldr r3, [r4, #20] + 8015d08: 4283 cmp r3, r0 + 8015d0a: dc05 bgt.n 8015d18 <__swbuf_r+0x64> + 8015d0c: 4621 mov r1, r4 + 8015d0e: 4628 mov r0, r5 + 8015d10: f7fe f92e bl 8013f70 <_fflush_r> + 8015d14: 2800 cmp r0, #0 + 8015d16: d1e2 bne.n 8015cde <__swbuf_r+0x2a> + 8015d18: 68a3 ldr r3, [r4, #8] + 8015d1a: 3b01 subs r3, #1 + 8015d1c: 60a3 str r3, [r4, #8] + 8015d1e: 6823 ldr r3, [r4, #0] + 8015d20: 1c5a adds r2, r3, #1 + 8015d22: 6022 str r2, [r4, #0] + 8015d24: 701e strb r6, [r3, #0] + 8015d26: 6962 ldr r2, [r4, #20] + 8015d28: 1c43 adds r3, r0, #1 + 8015d2a: 429a cmp r2, r3 + 8015d2c: d004 beq.n 8015d38 <__swbuf_r+0x84> + 8015d2e: 89a3 ldrh r3, [r4, #12] + 8015d30: 07db lsls r3, r3, #31 + 8015d32: d5d6 bpl.n 8015ce2 <__swbuf_r+0x2e> + 8015d34: 2e0a cmp r6, #10 + 8015d36: d1d4 bne.n 8015ce2 <__swbuf_r+0x2e> + 8015d38: 4621 mov r1, r4 + 8015d3a: 4628 mov r0, r5 + 8015d3c: f7fe f918 bl 8013f70 <_fflush_r> + 8015d40: 2800 cmp r0, #0 + 8015d42: d0ce beq.n 8015ce2 <__swbuf_r+0x2e> + 8015d44: e7cb b.n 8015cde <__swbuf_r+0x2a> + ... + +08015d48 <_fstat_r>: + 8015d48: b538 push {r3, r4, r5, lr} + 8015d4a: 4d07 ldr r5, [pc, #28] @ (8015d68 <_fstat_r+0x20>) + 8015d4c: 2300 movs r3, #0 + 8015d4e: 4604 mov r4, r0 + 8015d50: 4608 mov r0, r1 + 8015d52: 4611 mov r1, r2 + 8015d54: 602b str r3, [r5, #0] + 8015d56: f000 f8d3 bl 8015f00 <_fstat> + 8015d5a: 1c43 adds r3, r0, #1 + 8015d5c: d102 bne.n 8015d64 <_fstat_r+0x1c> + 8015d5e: 682b ldr r3, [r5, #0] + 8015d60: b103 cbz r3, 8015d64 <_fstat_r+0x1c> + 8015d62: 6023 str r3, [r4, #0] + 8015d64: bd38 pop {r3, r4, r5, pc} + 8015d66: bf00 nop + 8015d68: 20019370 .word 0x20019370 + +08015d6c <_isatty_r>: + 8015d6c: b538 push {r3, r4, r5, lr} + 8015d6e: 4d06 ldr r5, [pc, #24] @ (8015d88 <_isatty_r+0x1c>) + 8015d70: 2300 movs r3, #0 + 8015d72: 4604 mov r4, r0 + 8015d74: 4608 mov r0, r1 + 8015d76: 602b str r3, [r5, #0] + 8015d78: f000 f8d2 bl 8015f20 <_isatty> + 8015d7c: 1c43 adds r3, r0, #1 + 8015d7e: d102 bne.n 8015d86 <_isatty_r+0x1a> + 8015d80: 682b ldr r3, [r5, #0] + 8015d82: b103 cbz r3, 8015d86 <_isatty_r+0x1a> + 8015d84: 6023 str r3, [r4, #0] + 8015d86: bd38 pop {r3, r4, r5, pc} + 8015d88: 20019370 .word 0x20019370 + +08015d8c <__assert_func>: + 8015d8c: b51f push {r0, r1, r2, r3, r4, lr} + 8015d8e: 4614 mov r4, r2 + 8015d90: 461a mov r2, r3 + 8015d92: 4b09 ldr r3, [pc, #36] @ (8015db8 <__assert_func+0x2c>) + 8015d94: 681b ldr r3, [r3, #0] + 8015d96: 4605 mov r5, r0 + 8015d98: 68d8 ldr r0, [r3, #12] + 8015d9a: b954 cbnz r4, 8015db2 <__assert_func+0x26> + 8015d9c: 4b07 ldr r3, [pc, #28] @ (8015dbc <__assert_func+0x30>) + 8015d9e: 461c mov r4, r3 + 8015da0: e9cd 3401 strd r3, r4, [sp, #4] + 8015da4: 9100 str r1, [sp, #0] + 8015da6: 462b mov r3, r5 + 8015da8: 4905 ldr r1, [pc, #20] @ (8015dc0 <__assert_func+0x34>) + 8015daa: f000 f843 bl 8015e34 + 8015dae: f000 f853 bl 8015e58 + 8015db2: 4b04 ldr r3, [pc, #16] @ (8015dc4 <__assert_func+0x38>) + 8015db4: e7f4 b.n 8015da0 <__assert_func+0x14> + 8015db6: bf00 nop + 8015db8: 2000003c .word 0x2000003c + 8015dbc: 08019273 .word 0x08019273 + 8015dc0: 08019245 .word 0x08019245 + 8015dc4: 08019238 .word 0x08019238 + +08015dc8 <_calloc_r>: + 8015dc8: b538 push {r3, r4, r5, lr} + 8015dca: fba1 1502 umull r1, r5, r1, r2 + 8015dce: b935 cbnz r5, 8015dde <_calloc_r+0x16> + 8015dd0: f7fb fe42 bl 8011a58 <_malloc_r> + 8015dd4: 4604 mov r4, r0 + 8015dd6: b938 cbnz r0, 8015de8 <_calloc_r+0x20> + 8015dd8: 2400 movs r4, #0 + 8015dda: 4620 mov r0, r4 + 8015ddc: bd38 pop {r3, r4, r5, pc} + 8015dde: f7fb fcd9 bl 8011794 <__errno> + 8015de2: 230c movs r3, #12 + 8015de4: 6003 str r3, [r0, #0] + 8015de6: e7f7 b.n 8015dd8 <_calloc_r+0x10> + 8015de8: f850 2c04 ldr.w r2, [r0, #-4] + 8015dec: f022 0203 bic.w r2, r2, #3 + 8015df0: 3a04 subs r2, #4 + 8015df2: 2a24 cmp r2, #36 @ 0x24 + 8015df4: d819 bhi.n 8015e2a <_calloc_r+0x62> + 8015df6: 2a13 cmp r2, #19 + 8015df8: d915 bls.n 8015e26 <_calloc_r+0x5e> + 8015dfa: 2a1b cmp r2, #27 + 8015dfc: e9c0 5500 strd r5, r5, [r0] + 8015e00: d806 bhi.n 8015e10 <_calloc_r+0x48> + 8015e02: f100 0308 add.w r3, r0, #8 + 8015e06: 2200 movs r2, #0 + 8015e08: e9c3 2200 strd r2, r2, [r3] + 8015e0c: 609a str r2, [r3, #8] + 8015e0e: e7e4 b.n 8015dda <_calloc_r+0x12> + 8015e10: 2a24 cmp r2, #36 @ 0x24 + 8015e12: e9c0 5502 strd r5, r5, [r0, #8] + 8015e16: bf11 iteee ne + 8015e18: f100 0310 addne.w r3, r0, #16 + 8015e1c: 6105 streq r5, [r0, #16] + 8015e1e: f100 0318 addeq.w r3, r0, #24 + 8015e22: 6145 streq r5, [r0, #20] + 8015e24: e7ef b.n 8015e06 <_calloc_r+0x3e> + 8015e26: 4603 mov r3, r0 + 8015e28: e7ed b.n 8015e06 <_calloc_r+0x3e> + 8015e2a: 4629 mov r1, r5 + 8015e2c: f7fb fc63 bl 80116f6 + 8015e30: e7d3 b.n 8015dda <_calloc_r+0x12> + ... + +08015e34 : + 8015e34: b40e push {r1, r2, r3} + 8015e36: b503 push {r0, r1, lr} + 8015e38: 4601 mov r1, r0 + 8015e3a: ab03 add r3, sp, #12 + 8015e3c: 4805 ldr r0, [pc, #20] @ (8015e54 ) + 8015e3e: f853 2b04 ldr.w r2, [r3], #4 + 8015e42: 6800 ldr r0, [r0, #0] + 8015e44: 9301 str r3, [sp, #4] + 8015e46: f7fd faed bl 8013424 <_vfiprintf_r> + 8015e4a: b002 add sp, #8 + 8015e4c: f85d eb04 ldr.w lr, [sp], #4 + 8015e50: b003 add sp, #12 + 8015e52: 4770 bx lr + 8015e54: 2000003c .word 0x2000003c + +08015e58 : + 8015e58: b508 push {r3, lr} + 8015e5a: 2006 movs r0, #6 + 8015e5c: f000 f82c bl 8015eb8 + 8015e60: 2001 movs r0, #1 + 8015e62: f000 f893 bl 8015f8c <_exit> + +08015e66 <_raise_r>: + 8015e66: 291f cmp r1, #31 + 8015e68: b538 push {r3, r4, r5, lr} + 8015e6a: 4605 mov r5, r0 + 8015e6c: 460c mov r4, r1 + 8015e6e: d904 bls.n 8015e7a <_raise_r+0x14> + 8015e70: 2316 movs r3, #22 + 8015e72: 6003 str r3, [r0, #0] + 8015e74: f04f 30ff mov.w r0, #4294967295 + 8015e78: bd38 pop {r3, r4, r5, pc} + 8015e7a: f8d0 2118 ldr.w r2, [r0, #280] @ 0x118 + 8015e7e: b112 cbz r2, 8015e86 <_raise_r+0x20> + 8015e80: f852 3021 ldr.w r3, [r2, r1, lsl #2] + 8015e84: b94b cbnz r3, 8015e9a <_raise_r+0x34> + 8015e86: 4628 mov r0, r5 + 8015e88: f000 f830 bl 8015eec <_getpid_r> + 8015e8c: 4622 mov r2, r4 + 8015e8e: 4601 mov r1, r0 + 8015e90: 4628 mov r0, r5 + 8015e92: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} + 8015e96: f000 b817 b.w 8015ec8 <_kill_r> + 8015e9a: 2b01 cmp r3, #1 + 8015e9c: d00a beq.n 8015eb4 <_raise_r+0x4e> + 8015e9e: 1c59 adds r1, r3, #1 + 8015ea0: d103 bne.n 8015eaa <_raise_r+0x44> + 8015ea2: 2316 movs r3, #22 + 8015ea4: 6003 str r3, [r0, #0] + 8015ea6: 2001 movs r0, #1 + 8015ea8: e7e6 b.n 8015e78 <_raise_r+0x12> + 8015eaa: 2100 movs r1, #0 + 8015eac: f842 1024 str.w r1, [r2, r4, lsl #2] + 8015eb0: 4620 mov r0, r4 + 8015eb2: 4798 blx r3 + 8015eb4: 2000 movs r0, #0 + 8015eb6: e7df b.n 8015e78 <_raise_r+0x12> + +08015eb8 : + 8015eb8: 4b02 ldr r3, [pc, #8] @ (8015ec4 ) + 8015eba: 4601 mov r1, r0 + 8015ebc: 6818 ldr r0, [r3, #0] + 8015ebe: f7ff bfd2 b.w 8015e66 <_raise_r> + 8015ec2: bf00 nop + 8015ec4: 2000003c .word 0x2000003c + +08015ec8 <_kill_r>: + 8015ec8: b538 push {r3, r4, r5, lr} + 8015eca: 4d07 ldr r5, [pc, #28] @ (8015ee8 <_kill_r+0x20>) + 8015ecc: 2300 movs r3, #0 + 8015ece: 4604 mov r4, r0 + 8015ed0: 4608 mov r0, r1 + 8015ed2: 4611 mov r1, r2 + 8015ed4: 602b str r3, [r5, #0] + 8015ed6: f000 f82b bl 8015f30 <_kill> + 8015eda: 1c43 adds r3, r0, #1 + 8015edc: d102 bne.n 8015ee4 <_kill_r+0x1c> + 8015ede: 682b ldr r3, [r5, #0] + 8015ee0: b103 cbz r3, 8015ee4 <_kill_r+0x1c> + 8015ee2: 6023 str r3, [r4, #0] + 8015ee4: bd38 pop {r3, r4, r5, pc} + 8015ee6: bf00 nop + 8015ee8: 20019370 .word 0x20019370 + +08015eec <_getpid_r>: + 8015eec: f000 b810 b.w 8015f10 <_getpid> + +08015ef0 <_close>: + 8015ef0: 4b02 ldr r3, [pc, #8] @ (8015efc <_close+0xc>) + 8015ef2: 2258 movs r2, #88 @ 0x58 + 8015ef4: 601a str r2, [r3, #0] + 8015ef6: f04f 30ff mov.w r0, #4294967295 + 8015efa: 4770 bx lr + 8015efc: 20019370 .word 0x20019370 + +08015f00 <_fstat>: + 8015f00: 4b02 ldr r3, [pc, #8] @ (8015f0c <_fstat+0xc>) + 8015f02: 2258 movs r2, #88 @ 0x58 + 8015f04: 601a str r2, [r3, #0] + 8015f06: f04f 30ff mov.w r0, #4294967295 + 8015f0a: 4770 bx lr + 8015f0c: 20019370 .word 0x20019370 + +08015f10 <_getpid>: + 8015f10: 4b02 ldr r3, [pc, #8] @ (8015f1c <_getpid+0xc>) + 8015f12: 2258 movs r2, #88 @ 0x58 + 8015f14: 601a str r2, [r3, #0] + 8015f16: f04f 30ff mov.w r0, #4294967295 + 8015f1a: 4770 bx lr + 8015f1c: 20019370 .word 0x20019370 + +08015f20 <_isatty>: + 8015f20: 4b02 ldr r3, [pc, #8] @ (8015f2c <_isatty+0xc>) + 8015f22: 2258 movs r2, #88 @ 0x58 + 8015f24: 601a str r2, [r3, #0] + 8015f26: 2000 movs r0, #0 + 8015f28: 4770 bx lr + 8015f2a: bf00 nop + 8015f2c: 20019370 .word 0x20019370 + +08015f30 <_kill>: + 8015f30: 4b02 ldr r3, [pc, #8] @ (8015f3c <_kill+0xc>) + 8015f32: 2258 movs r2, #88 @ 0x58 + 8015f34: 601a str r2, [r3, #0] + 8015f36: f04f 30ff mov.w r0, #4294967295 + 8015f3a: 4770 bx lr + 8015f3c: 20019370 .word 0x20019370 + +08015f40 <_lseek>: + 8015f40: 4b02 ldr r3, [pc, #8] @ (8015f4c <_lseek+0xc>) + 8015f42: 2258 movs r2, #88 @ 0x58 + 8015f44: 601a str r2, [r3, #0] + 8015f46: f04f 30ff mov.w r0, #4294967295 + 8015f4a: 4770 bx lr + 8015f4c: 20019370 .word 0x20019370 + +08015f50 <_read>: + 8015f50: 4b02 ldr r3, [pc, #8] @ (8015f5c <_read+0xc>) + 8015f52: 2258 movs r2, #88 @ 0x58 + 8015f54: 601a str r2, [r3, #0] + 8015f56: f04f 30ff mov.w r0, #4294967295 + 8015f5a: 4770 bx lr + 8015f5c: 20019370 .word 0x20019370 + +08015f60 <_sbrk>: + 8015f60: 4a04 ldr r2, [pc, #16] @ (8015f74 <_sbrk+0x14>) + 8015f62: 6811 ldr r1, [r2, #0] + 8015f64: 4603 mov r3, r0 + 8015f66: b909 cbnz r1, 8015f6c <_sbrk+0xc> + 8015f68: 4903 ldr r1, [pc, #12] @ (8015f78 <_sbrk+0x18>) + 8015f6a: 6011 str r1, [r2, #0] + 8015f6c: 6810 ldr r0, [r2, #0] + 8015f6e: 4403 add r3, r0 + 8015f70: 6013 str r3, [r2, #0] + 8015f72: 4770 bx lr + 8015f74: 20019540 .word 0x20019540 + 8015f78: 20019548 .word 0x20019548 + +08015f7c <_write>: + 8015f7c: 4b02 ldr r3, [pc, #8] @ (8015f88 <_write+0xc>) + 8015f7e: 2258 movs r2, #88 @ 0x58 + 8015f80: 601a str r2, [r3, #0] + 8015f82: f04f 30ff mov.w r0, #4294967295 + 8015f86: 4770 bx lr + 8015f88: 20019370 .word 0x20019370 + +08015f8c <_exit>: + 8015f8c: e7fe b.n 8015f8c <_exit> + ... + +08015f90 <_init>: + 8015f90: b5f8 push {r3, r4, r5, r6, r7, lr} + 8015f92: bf00 nop + 8015f94: bcf8 pop {r3, r4, r5, r6, r7} + 8015f96: bc08 pop {r3} + 8015f98: 469e mov lr, r3 + 8015f9a: 4770 bx lr + +08015f9c <_fini>: + 8015f9c: b5f8 push {r3, r4, r5, r6, r7, lr} + 8015f9e: bf00 nop + 8015fa0: bcf8 pop {r3, r4, r5, r6, r7} + 8015fa2: bc08 pop {r3} + 8015fa4: 469e mov lr, r3 + 8015fa6: 4770 bx lr