semafor.elf: file format elf32-littlenios2 semafor.elf architecture: nios2:r1, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x00000224 Program Header: LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 filesz 0x00000000 memsz 0x00000000 flags r-x LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 filesz 0x00007218 memsz 0x0000736c flags rwx Sections: Idx Name Size VMA LMA File off Algn 0 .entry 00000000 00000000 00000000 00001000 2**5 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .exceptions 00000204 00000020 00000020 00001020 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .text 00005530 00000224 00000224 00001224 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 3 .rodata 00000078 00005754 00005754 00006754 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .rwdata 00001a6c 000057cc 000057cc 000067cc 2**2 CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA 5 .bss 00000154 00007238 00007238 00008238 2**2 ALLOC, SMALL_DATA 6 .mem 00000000 0000738c 0000738c 00008238 2**0 CONTENTS 7 .comment 0000002d 00000000 00000000 00008238 2**0 CONTENTS, READONLY 8 .debug_aranges 000009f8 00000000 00000000 00008268 2**3 CONTENTS, READONLY, DEBUGGING, OCTETS 9 .debug_info 00017df0 00000000 00000000 00008c60 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 10 .debug_abbrev 00006a85 00000000 00000000 00020a50 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 11 .debug_line 00009a4f 00000000 00000000 000274d5 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 12 .debug_frame 00001510 00000000 00000000 00030f24 2**2 CONTENTS, READONLY, DEBUGGING, OCTETS 13 .debug_str 000027a7 00000000 00000000 00032434 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 14 .debug_loc 00005fc0 00000000 00000000 00034bdb 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 15 .debug_alt_sim_info 00000010 00000000 00000000 0003ab9c 2**2 CONTENTS, READONLY, DEBUGGING, OCTETS 16 .debug_ranges 00000888 00000000 00000000 0003abb0 2**3 CONTENTS, READONLY, DEBUGGING, OCTETS 17 .thread_model 00000003 00000000 00000000 0003d75a 2**0 CONTENTS, READONLY 18 .cpu 00000003 00000000 00000000 0003d75d 2**0 CONTENTS, READONLY 19 .qsys 00000001 00000000 00000000 0003d760 2**0 CONTENTS, READONLY 20 .simulation_enabled 00000001 00000000 00000000 0003d761 2**0 CONTENTS, READONLY 21 .stderr_dev 00000009 00000000 00000000 0003d762 2**0 CONTENTS, READONLY 22 .stdin_dev 00000009 00000000 00000000 0003d76b 2**0 CONTENTS, READONLY 23 .stdout_dev 00000009 00000000 00000000 0003d774 2**0 CONTENTS, READONLY 24 .sopc_system_name 00000006 00000000 00000000 0003d77d 2**0 CONTENTS, READONLY 25 .quartus_project_dir 00000022 00000000 00000000 0003d783 2**0 CONTENTS, READONLY 26 .jdi 00004392 00000000 00000000 0003d7a5 2**0 CONTENTS, READONLY 27 .sopcinfo 0003cf5c 00000000 00000000 00041b37 2**0 CONTENTS, READONLY SYMBOL TABLE: 00000000 l d .entry 00000000 .entry 00000020 l d .exceptions 00000000 .exceptions 00000224 l d .text 00000000 .text 00005754 l d .rodata 00000000 .rodata 000057cc l d .rwdata 00000000 .rwdata 00007238 l d .bss 00000000 .bss 0000738c l d .mem 00000000 .mem 00000000 l d .comment 00000000 .comment 00000000 l d .debug_aranges 00000000 .debug_aranges 00000000 l d .debug_info 00000000 .debug_info 00000000 l d .debug_abbrev 00000000 .debug_abbrev 00000000 l d .debug_line 00000000 .debug_line 00000000 l d .debug_frame 00000000 .debug_frame 00000000 l d .debug_str 00000000 .debug_str 00000000 l d .debug_loc 00000000 .debug_loc 00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info 00000000 l d .debug_ranges 00000000 .debug_ranges 00000000 l df *ABS* 00000000 ../semafor_bsp//obj/HAL/src/crt0.o 00000258 l .text 00000000 alt_after_alt_main 00000000 l df *ABS* 00000000 alt_irq_handler.c 00000000 l df *ABS* 00000000 alt_instruction_exception_entry.c 00000000 l df *ABS* 00000000 sem.c 00000000 l df *ABS* 00000000 puts.c 00000000 l df *ABS* 00000000 strlen.c 00000000 l df *ABS* 00000000 findfp.c 00000490 l F .text 00000008 __fp_lock 000004a4 l F .text 00000008 __fp_unlock 000004ac l F .text 00000168 __sinit.part.0 00000000 l df *ABS* 00000000 fvwrite.c 00000000 l df *ABS* 00000000 fwalk.c 00000000 l df *ABS* 00000000 impure.c 000057cc l O .rwdata 00000424 impure_data 00000000 l df *ABS* 00000000 mallocr.c 00000000 l df *ABS* 00000000 memchr.c 00000000 l df *ABS* 00000000 memcpy.c 00000000 l df *ABS* 00000000 memmove.c 00000000 l df *ABS* 00000000 memset.c 00000000 l df *ABS* 00000000 mallocr.c 00000000 l df *ABS* 00000000 sbrkr.c 00000000 l df *ABS* 00000000 stdio.c 00000000 l df *ABS* 00000000 writer.c 00000000 l df *ABS* 00000000 wsetup.c 00000000 l df *ABS* 00000000 closer.c 00000000 l df *ABS* 00000000 fclose.c 0000232c l F .text 000000c0 _fclose_r.part.0 00000000 l df *ABS* 00000000 fflush.c 00000000 l df *ABS* 00000000 mallocr.c 00000000 l df *ABS* 00000000 int_errno.c 00000000 l df *ABS* 00000000 lseekr.c 00000000 l df *ABS* 00000000 makebuf.c 00000000 l df *ABS* 00000000 readr.c 00000000 l df *ABS* 00000000 fstatr.c 00000000 l df *ABS* 00000000 isattyr.c 00000000 l df *ABS* 00000000 lib2-divmod.c 00000000 l df *ABS* 00000000 lib2-mul.c 00000000 l df *ABS* 00000000 alt_close.c 00003194 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_dcache_flush.c 00000000 l df *ABS* 00000000 alt_dev.c 000032d4 l F .text 0000002c alt_dev_null_write 00000000 l df *ABS* 00000000 alt_errno.c 00000000 l df *ABS* 00000000 alt_fstat.c 00003300 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_isatty.c 000033f8 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_lseek.c 000034e4 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_main.c 00000000 l df *ABS* 00000000 alt_malloc_lock.c 00000000 l df *ABS* 00000000 alt_read.c 000036c4 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_release_fd.c 00000000 l df *ABS* 00000000 alt_sbrk.c 00007228 l O .rwdata 00000004 heap_end 00000000 l df *ABS* 00000000 alt_write.c 00003930 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_sys_init.c 00003a70 l F .text 00000034 alt_dev_reg 000061a0 l O .rwdata 00001060 jtag_uart 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_fd.c 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_init.c 00003d64 l F .text 0000020c altera_avalon_jtag_uart_irq 00003f70 l F .text 000000a0 altera_avalon_jtag_uart_timeout 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_ioctl.c 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_read.c 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_write.c 00000000 l df *ABS* 00000000 altera_avalon_timer_sc.c 000045b4 l F .text 0000007c alt_avalon_timer_sc_irq 00000000 l df *ABS* 00000000 alt_alarm_start.c 00000000 l df *ABS* 00000000 alt_dev_llist_insert.c 000047e8 l F .text 0000003c alt_get_errno 00000000 l df *ABS* 00000000 alt_do_ctors.c 00000000 l df *ABS* 00000000 alt_do_dtors.c 00000000 l df *ABS* 00000000 alt_iic.c 00000000 l df *ABS* 00000000 alt_iic_isr_register.c 00000000 l df *ABS* 00000000 alt_io_redirect.c 00004c2c l F .text 000000d4 alt_open_fd 00000000 l df *ABS* 00000000 alt_irq_vars.c 00000000 l df *ABS* 00000000 alt_open.c 00004d7c l F .text 0000003c alt_get_errno 00004db8 l F .text 000000dc alt_file_locked 00000000 l df *ABS* 00000000 alt_tick.c 00000000 l df *ABS* 00000000 altera_nios2_gen2_irq.c 00000000 l df *ABS* 00000000 alt_find_dev.c 00000000 l df *ABS* 00000000 alt_find_file.c 00000000 l df *ABS* 00000000 alt_get_fd.c 00000000 l df *ABS* 00000000 atexit.c 00000000 l df *ABS* 00000000 exit.c 00000000 l df *ABS* 00000000 memcmp.c 00000000 l df *ABS* 00000000 __atexit.c 00000000 l df *ABS* 00000000 __call_atexit.c 00000000 l df *ABS* 00000000 alt_exit.c 00007260 g O .bss 00000004 alt_instruction_exception_handler 00002f60 g F .text 00000058 _isatty_r 00003600 g F .text 0000007c alt_main 0000031c g F .text 000000cc _puts_r 0000728c g O .bss 00000100 alt_irq 00002bf0 g F .text 00000064 _lseek_r 0000738c g *ABS* 00000000 __alt_heap_start 000020a8 g F .text 0000005c __sseek 000007f4 g F .text 00000010 __sinit 00000614 g F .text 00000078 __sfmoreglue 000036a0 g F .text 00000024 __malloc_unlock 00005754 g O .rodata 00000040 divisors 000017f4 g F .text 0000012c memmove 000007e0 g F .text 00000014 _cleanup 000051a0 g F .text 00000024 altera_nios2_gen2_irq_init 00000000 g F .entry 00000000 __reset 00002f00 g F .text 00000060 _fstat_r 00007244 g O .bss 00000004 errno 00002020 g F .text 00000008 __seofread 0000724c g O .bss 00000004 alt_argv 0000f200 g *ABS* 00000000 _gp 00006020 g O .rwdata 00000180 alt_fd_list 000051c4 g F .text 00000090 alt_find_dev 000016f4 g F .text 00000100 memcpy 00000498 g F .text 0000000c _cleanup_r 00004d00 g F .text 0000007c alt_io_redirect 00005754 g *ABS* 00000000 __DTOR_END__ 000003e8 g F .text 00000010 puts 00005414 g F .text 00000098 alt_exception_cause_generated_bad_addr 0000416c g F .text 00000220 altera_avalon_jtag_uart_read 000030ac g F .text 00000064 .hidden __udivsi3 00003434 g F .text 000000b0 isatty 00007240 g O .bss 00000004 __malloc_top_pad 0000083c g F .text 000004c8 __sfvwrite_r 00001f74 g F .text 00000058 _sbrk_r 00002e9c g F .text 00000064 _read_r 000032ac g F .text 00000028 alt_dcache_flush 00007220 g O .rwdata 00000004 alt_max_fd 000023ec g F .text 00000070 _fclose_r 00002754 g F .text 00000084 fflush 0000723c g O .bss 00000004 __malloc_max_sbrked_mem 00003520 g F .text 000000e0 lseek 00007200 g O .rwdata 00000004 _global_impure_ptr 00001a10 g F .text 00000564 _realloc_r 0000738c g *ABS* 00000000 __bss_end 00004b44 g F .text 000000e8 alt_iic_isr_register 00005098 g F .text 00000108 alt_tick 00000814 g F .text 00000014 __fp_lock_all 00004af8 g F .text 0000004c alt_ic_irq_enabled 00000000 g *ABS* 00000000 __alt_mem_mem 00004ff4 g F .text 000000a4 alt_alarm_stop 00007254 g O .bss 00000004 alt_irq_active 000000fc g F .exceptions 000000c8 alt_irq_handler 00005ff8 g O .rwdata 00000028 alt_dev_null 00007218 g O .rwdata 00000008 alt_dev_list 0000396c g F .text 00000104 write 0000333c g F .text 000000bc fstat 00003110 g F .text 0000005c .hidden __umodsi3 0000738c g *ABS* 00000000 end 00003ca4 g F .text 000000c0 altera_avalon_jtag_uart_init 000001c4 g F .exceptions 00000060 alt_instruction_exception_entry 00005754 g *ABS* 00000000 __CTOR_LIST__ 00020000 g *ABS* 00000000 __alt_stack_pointer 00004630 g F .text 00000084 alt_avalon_timer_sc_init 0000438c g F .text 00000228 altera_avalon_jtag_uart_write 00000804 g F .text 00000004 __sfp_lock_acquire 00001624 g F .text 000000d0 memchr 000028f4 g F .text 000002fc _free_r 000055fc g F .text 00000120 __call_exitprocs 00007208 g O .rwdata 00000004 __malloc_sbrk_base 00000224 g F .text 00000038 _start 00007258 g O .bss 00000004 _alt_tick_rate 0000725c g O .bss 00000004 _alt_nticks 00003700 g F .text 00000108 read 00003ae0 g F .text 00000060 alt_sys_init 0000556c g F .text 00000090 __register_exitproc 00004010 g F .text 00000068 altera_avalon_jtag_uart_close 0000316c g F .text 00000028 .hidden __mulsi3 00007264 g O .bss 00000028 __malloc_current_mallinfo 00003b40 g F .text 00000060 altera_avalon_jtag_uart_read_fd 0000535c g F .text 000000b8 alt_get_fd 000022d4 g F .text 00000058 _close_r 000054f4 g F .text 00000078 memcmp 00003c00 g F .text 00000050 altera_avalon_jtag_uart_close_fd 0000738c g *ABS* 00000000 __alt_stack_base 00003c50 g F .text 00000054 altera_avalon_jtag_uart_ioctl_fd 00002170 g F .text 00000164 __swsetup_r 0000068c g F .text 00000154 __sfp 00005bf0 g O .rwdata 00000408 __malloc_av_ 00000810 g F .text 00000004 __sinit_lock_release 00001fcc g F .text 00000054 __sread 00005254 g F .text 00000108 alt_find_file 00004824 g F .text 000000a8 alt_dev_llist_insert 0000367c g F .text 00000024 __malloc_lock 00003878 g F .text 000000b8 sbrk 000026f4 g F .text 00000060 _fflush_r 00007238 g *ABS* 00000000 __bss_start 00001920 g F .text 000000f0 memset 0000025c g F .text 000000c0 main 00007250 g O .bss 00000004 alt_envp 00007238 g O .bss 00000004 __malloc_max_total_mem 00003ba0 g F .text 00000060 altera_avalon_jtag_uart_write_fd 00002104 g F .text 00000008 __sclose 00020000 g *ABS* 00000000 __alt_heap_limit 0000245c g F .text 00000070 fclose 00000e44 g F .text 000007e0 _malloc_r 00007224 g O .rwdata 00000004 alt_errno 00000d04 g F .text 00000098 _fwalk 00002fb8 g F .text 00000080 .hidden __divsi3 000027d8 g F .text 0000011c _malloc_trim_r 00005754 g *ABS* 00000000 __CTOR_END__ 00005754 g *ABS* 00000000 __DTOR_LIST__ 00003aa4 g F .text 0000003c alt_irq_init 00003808 g F .text 00000070 alt_release_fd 000054ac g F .text 00000014 atexit 0000210c g F .text 00000064 _write_r 00007204 g O .rwdata 00000004 _impure_ptr 00007248 g O .bss 00000004 alt_argc 000024cc g F .text 00000228 __sflush_r 00004930 g F .text 00000064 _do_dtors 00000020 g .exceptions 00000000 alt_irq_entry 00000828 g F .text 00000014 __fp_unlock_all 00007210 g O .rwdata 00000008 alt_fs_list 00002e04 g F .text 00000098 __swhatbuf_r 00004994 g F .text 00000050 alt_ic_isr_register 00007238 g *ABS* 00000000 _edata 0000738c g *ABS* 00000000 _end 00004078 g F .text 000000f4 altera_avalon_jtag_uart_ioctl 00004a6c g F .text 0000008c alt_ic_irq_disable 00002028 g F .text 00000080 __swrite 0000720c g O .rwdata 00000004 __malloc_trim_threshold 000054c0 g F .text 00000034 exit 00000d9c g F .text 000000a8 _fwalk_reent 00003038 g F .text 00000074 .hidden __modsi3 00020000 g *ABS* 00000000 __alt_data_end 00000020 g F .exceptions 00000000 alt_exception 00000808 g F .text 00000004 __sfp_lock_release 0000571c g F .text 00000038 _exit 000046b4 g F .text 00000134 alt_alarm_start 00002c54 g F .text 000001b0 __smakebuf_r 000003f8 g F .text 00000098 strlen 00004e94 g F .text 00000160 open 0000722c g O .rwdata 00000004 alt_priority_mask 000049e4 g F .text 00000088 alt_ic_irq_enable 00007230 g O .rwdata 00000008 alt_alarm_list 000048cc g F .text 00000064 _do_ctors 000031d0 g F .text 000000dc close 0000080c g F .text 00000004 __sinit_lock_acquire Disassembly of section .exceptions: 00000020 : #else /* ALT_EXCEPTION_STACK disabled */ /* * Reserve space on normal stack for registers about to be pushed. */ addi sp, sp, -76 20: deffed04 addi sp,sp,-76 * documentation for details). * * Leave a gap in the stack frame at 4(sp) for the muldiv handler to * store zero into. */ stw ra, 0(sp) 24: dfc00015 stw ra,0(sp) stw r1, 8(sp) 28: d8400215 stw at,8(sp) stw r2, 12(sp) 2c: d8800315 stw r2,12(sp) stw r3, 16(sp) 30: d8c00415 stw r3,16(sp) stw r4, 20(sp) 34: d9000515 stw r4,20(sp) stw r5, 24(sp) 38: d9400615 stw r5,24(sp) stw r6, 28(sp) 3c: d9800715 stw r6,28(sp) stw r7, 32(sp) 40: d9c00815 stw r7,32(sp) rdctl r5, estatus /* Read early to avoid usage stall */ 44: 000b307a rdctl r5,estatus stw r8, 36(sp) 48: da000915 stw r8,36(sp) stw r9, 40(sp) 4c: da400a15 stw r9,40(sp) stw r10, 44(sp) 50: da800b15 stw r10,44(sp) stw r11, 48(sp) 54: dac00c15 stw r11,48(sp) stw r12, 52(sp) 58: db000d15 stw r12,52(sp) stw r13, 56(sp) 5c: db400e15 stw r13,56(sp) stw r14, 60(sp) 60: db800f15 stw r14,60(sp) stw r15, 64(sp) 64: dbc01015 stw r15,64(sp) /* * ea-4 contains the address of the instruction being executed * when the exception occured. For interrupt exceptions, we will * will be re-issue the isntruction. Store it in 72(sp) */ stw r5, 68(sp) /* estatus */ 68: d9401115 stw r5,68(sp) addi r15, ea, -4 /* instruction that caused exception */ 6c: ebffff04 addi r15,ea,-4 stw r15, 72(sp) 70: dbc01215 stw r15,72(sp) #else /* * Test to see if the exception was a software exception or caused * by an external interrupt, and vector accordingly. */ rdctl r4, ipending 74: 0009313a rdctl r4,ipending andi r2, r5, 1 78: 2880004c andi r2,r5,1 beq r2, zero, .Lnot_irq 7c: 10000326 beq r2,zero,8c beq r4, zero, .Lnot_irq 80: 20000226 beq r4,zero,8c /* * Now that all necessary registers have been preserved, call * alt_irq_handler() to process the interrupts. */ call alt_irq_handler 84: 00000fc0 call fc .section .exceptions.irqreturn, "xa" br .Lexception_exit 88: 00000706 br a8 * upon completion, so we write ea (address of instruction *after* * the one where the exception occured) into 72(sp). The actual * instruction that caused the exception is written in r2, which these * handlers will utilize. */ stw ea, 72(sp) /* EA is PC+4 so will skip over instruction causing exception */ 8c: df401215 stw ea,72(sp) .Lunknown_16bit: addi.n r4, r4, 2 /* Need PC+2 to skip over instruction causing exception */ stw r4, 72(sp) #else /* CDX is not Enabled and all instructions are 32bits */ ldw r2, -4(ea) /* Instruction value that caused exception */ 90: e8bfff17 ldw r2,-4(ea) * debugger is present) or go into an infinite loop since the * handling behavior is undefined; in that case we will not return here. */ /* Load exception-causing address as first argument (r4) */ addi r4, ea, -4 94: e93fff04 addi r4,ea,-4 /* Call the instruction-exception entry */ call alt_instruction_exception_entry 98: 00001c40 call 1c4 * instruction * * Return code was 0: Skip. The instruction after the exception is * already stored in 72(sp). */ bne r2, r0, .Lexception_exit 9c: 1000021e bne r2,zero,a8 /* * Otherwise, modify 72(sp) to re-issue the instruction that caused the * exception. */ addi r15, ea, -4 /* instruction that caused exception */ a0: ebffff04 addi r15,ea,-4 stw r15, 72(sp) a4: dbc01215 stw r15,72(sp) /* * Restore the saved registers, so that all general purpose registers * have been restored to their state at the time the interrupt occured. */ ldw r5, 68(sp) a8: d9401117 ldw r5,68(sp) ldw ea, 72(sp) /* This becomes the PC once eret is executed */ ac: df401217 ldw ea,72(sp) ldw ra, 0(sp) b0: dfc00017 ldw ra,0(sp) wrctl estatus, r5 b4: 2801707a wrctl estatus,r5 ldw r1, 8(sp) b8: d8400217 ldw at,8(sp) ldw r2, 12(sp) bc: d8800317 ldw r2,12(sp) ldw r3, 16(sp) c0: d8c00417 ldw r3,16(sp) ldw r4, 20(sp) c4: d9000517 ldw r4,20(sp) ldw r5, 24(sp) c8: d9400617 ldw r5,24(sp) ldw r6, 28(sp) cc: d9800717 ldw r6,28(sp) ldw r7, 32(sp) d0: d9c00817 ldw r7,32(sp) #if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) ldw et, %gprel(alt_exception_old_stack_limit)(gp) #endif ldw r8, 36(sp) d4: da000917 ldw r8,36(sp) ldw r9, 40(sp) d8: da400a17 ldw r9,40(sp) ldw r10, 44(sp) dc: da800b17 ldw r10,44(sp) ldw r11, 48(sp) e0: dac00c17 ldw r11,48(sp) ldw r12, 52(sp) e4: db000d17 ldw r12,52(sp) ldw r13, 56(sp) e8: db400e17 ldw r13,56(sp) ldw r14, 60(sp) ec: db800f17 ldw r14,60(sp) ldw r15, 64(sp) f0: dbc01017 ldw r15,64(sp) stw et, %gprel(alt_stack_limit_value)(gp) stw zero, %gprel(alt_exception_old_stack_limit)(gp) #endif /* ALT_STACK_CHECK */ ldw sp, 76(sp) #else /* ALT_EXCEPTION_STACK disabled */ addi sp, sp, 76 f4: dec01304 addi sp,sp,76 /* * Return to the interrupted instruction. */ eret f8: ef80083a eret 000000fc : * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. */ void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); void alt_irq_handler (void) { fc: defff904 addi sp,sp,-28 100: dfc00615 stw ra,24(sp) 104: df000515 stw fp,20(sp) 108: df000504 addi fp,sp,20 /* * Notify the operating system that we are at interrupt level. */ ALT_OS_INT_ENTER(); 10c: 0001883a nop #ifndef NIOS2_EIC_PRESENT static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) { alt_u32 active; NIOS2_READ_IPENDING (active); 110: 0005313a rdctl r2,ipending 114: e0bffc15 stw r2,-16(fp) return active; 118: e0bffc17 ldw r2,-16(fp) * Consider the case where the high priority interupt is asserted during * the interrupt entry sequence for a lower priority interrupt to see why * this is the case. */ active = alt_irq_pending (); 11c: e0bfff15 stw r2,-4(fp) do { i = 0; 120: e03ffd15 stw zero,-12(fp) mask = 1; 124: 00800044 movi r2,1 128: e0bffe15 stw r2,-8(fp) * called to clear the interrupt condition. */ do { if (active & mask) 12c: e0ffff17 ldw r3,-4(fp) 130: e0bffe17 ldw r2,-8(fp) 134: 1884703a and r2,r3,r2 138: 10001126 beq r2,zero,180 { #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT alt_irq[i].handler(alt_irq[i].context); 13c: e0bffd17 ldw r2,-12(fp) 140: 100690fa slli r3,r2,3 144: 00800034 movhi r2,0 148: 1885883a add r2,r3,r2 14c: 10dca317 ldw r3,29324(r2) 150: e0bffd17 ldw r2,-12(fp) 154: 100890fa slli r4,r2,3 158: 00800034 movhi r2,0 15c: 2085883a add r2,r4,r2 160: 109ca417 ldw r2,29328(r2) 164: 1009883a mov r4,r2 168: 183ee83a callr r3 #else alt_irq[i].handler(alt_irq[i].context, i); #endif break; 16c: 0001883a nop NIOS2_READ_IPENDING (active); 170: 0005313a rdctl r2,ipending 174: e0bffb15 stw r2,-20(fp) return active; 178: e0bffb17 ldw r2,-20(fp) 17c: 00000706 br 19c } mask <<= 1; 180: e0bffe17 ldw r2,-8(fp) 184: 1085883a add r2,r2,r2 188: e0bffe15 stw r2,-8(fp) i++; 18c: e0bffd17 ldw r2,-12(fp) 190: 10800044 addi r2,r2,1 194: e0bffd15 stw r2,-12(fp) if (active & mask) 198: 003fe406 br 12c } while (1); active = alt_irq_pending (); 19c: e0bfff15 stw r2,-4(fp) } while (active); 1a0: e0bfff17 ldw r2,-4(fp) 1a4: 103fde1e bne r2,zero,120 /* * Notify the operating system that interrupt processing is complete. */ ALT_OS_INT_EXIT(); 1a8: 0001883a nop } 1ac: 0001883a nop 1b0: e037883a mov sp,fp 1b4: dfc00117 ldw ra,4(sp) 1b8: df000017 ldw fp,0(sp) 1bc: dec00204 addi sp,sp,8 1c0: f800283a ret 000001c4 : * that handler if it has been registered. Absent a handler, it will * break break or hang as discussed below. */ int alt_instruction_exception_entry (alt_u32 exception_pc) { 1c4: defffb04 addi sp,sp,-20 1c8: dfc00415 stw ra,16(sp) 1cc: df000315 stw fp,12(sp) 1d0: df000304 addi fp,sp,12 1d4: e13ffd15 stw r4,-12(fp) cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> NIOS2_EXCEPTION_REG_CAUSE_OFST ); NIOS2_READ_BADADDR(badaddr); #else cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; 1d8: 00bfffc4 movi r2,-1 1dc: e0bfff15 stw r2,-4(fp) badaddr = 0; 1e0: e03ffe15 stw zero,-8(fp) #endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ if(alt_instruction_exception_handler) { 1e4: d0a01817 ldw r2,-32672(gp) 1e8: 10000726 beq r2,zero,208 * Call handler. Its return value indicates whether the exception-causing * instruction should be re-issued. The code that called us, * alt_eceptions_entry.S, will look at this value and adjust the ea * register as necessary */ return alt_instruction_exception_handler(cause, exception_pc, badaddr); 1ec: d0a01817 ldw r2,-32672(gp) 1f0: e0ffff17 ldw r3,-4(fp) 1f4: e1bffe17 ldw r6,-8(fp) 1f8: e17ffd17 ldw r5,-12(fp) 1fc: 1809883a mov r4,r3 200: 103ee83a callr r2 204: 00000206 br 210 * (a peripheral which negates its interrupt output before its * interrupt handler has been executed will cause spurious interrupts) */ else { #ifdef NIOS2_HAS_DEBUG_STUB NIOS2_BREAK(); 208: 003da03a break 0 ; #endif /* NIOS2_HAS_DEBUG_STUB */ } /* We should not get here. Remove compiler warning. */ return NIOS2_EXCEPTION_RETURN_REISSUE_INST; 20c: 0005883a mov r2,zero } 210: e037883a mov sp,fp 214: dfc00117 ldw ra,4(sp) 218: df000017 ldw fp,0(sp) 21c: dec00204 addi sp,sp,8 220: f800283a ret Disassembly of section .text: 00000224 <_start>: /* * Now that the caches are initialized, set up the stack pointer and global pointer. * The values provided by the linker are assumed to be correctly aligned. */ movhi sp, %hi(__alt_stack_pointer) 224: 06c000b4 movhi sp,2 ori sp, sp, %lo(__alt_stack_pointer) 228: dec00014 ori sp,sp,0 movhi gp, %hi(_gp) 22c: 06800034 movhi gp,0 ori gp, gp, %lo(_gp) 230: d6bc8014 ori gp,gp,61952 */ #ifndef ALT_SIM_OPTIMIZE /* Log that the BSS is about to be cleared. */ ALT_LOG_PUTS(alt_log_msg_bss) movhi r2, %hi(__bss_start) 234: 00800034 movhi r2,0 ori r2, r2, %lo(__bss_start) 238: 109c8e14 ori r2,r2,29240 movhi r3, %hi(__bss_end) 23c: 00c00034 movhi r3,0 ori r3, r3, %lo(__bss_end) 240: 18dce314 ori r3,r3,29580 beq r2, r3, 1f 244: 10c00326 beq r2,r3,254 <_start+0x30> 0: stw zero, (r2) 248: 10000015 stw zero,0(r2) addi r2, r2, 4 24c: 10800104 addi r2,r2,4 bltu r2, r3, 0b 250: 10fffd36 bltu r2,r3,248 <_start+0x24> /* Log that alt_main is about to be called. */ ALT_LOG_PUTS(alt_log_msg_alt_main) /* Call the C entry point. It should never return. */ call alt_main 254: 00036000 call 3600 00000258 : /* Wait in infinite loop in case alt_main does return. */ alt_after_alt_main: br alt_after_alt_main 258: 003fff06 br 258 0000025c
: {0x0ff000f1, 0x0ff000f1, 0x0ff000f1, 0x00700011}, {0x0ff000d1, 0x0ff000f1, 0x0ff000f1, 0x00700011} }; int main() { 25c: defffb04 addi sp,sp,-20 260: dfc00415 stw ra,16(sp) 264: df000315 stw fp,12(sp) 268: df000304 addi fp,sp,12 int i,j; volatile alt_u32 *p; alt_u32 tmp; //program divisors p = (alt_u32*) SEM_RAM_SLAVE_BASE; 26c: 008000b4 movhi r2,2 270: 10840004 addi r2,r2,4096 274: e0bffd15 stw r2,-12(fp) for (i = 0; i < TIME_SETS; i++) { 278: e03fff15 stw zero,-4(fp) 27c: 00001a06 br 2e8 for (j = TIME_STATES; j > 0; j--) { 280: 00800104 movi r2,4 284: e0bffe15 stw r2,-8(fp) 288: 00001206 br 2d4 *p = divisors[i][j - 1]; 28c: e0bffe17 ldw r2,-8(fp) 290: 10bfffc4 addi r2,r2,-1 294: e0ffff17 ldw r3,-4(fp) 298: 180690ba slli r3,r3,2 29c: 1885883a add r2,r3,r2 2a0: 100690ba slli r3,r2,2 2a4: 00800034 movhi r2,0 2a8: 1885883a add r2,r3,r2 2ac: 10d5d517 ldw r3,22356(r2) 2b0: e0bffd17 ldw r2,-12(fp) 2b4: 10c00015 stw r3,0(r2) alt_dcache_flush(); 2b8: 00032ac0 call 32ac p++; 2bc: e0bffd17 ldw r2,-12(fp) 2c0: 10800104 addi r2,r2,4 2c4: e0bffd15 stw r2,-12(fp) for (j = TIME_STATES; j > 0; j--) { 2c8: e0bffe17 ldw r2,-8(fp) 2cc: 10bfffc4 addi r2,r2,-1 2d0: e0bffe15 stw r2,-8(fp) 2d4: e0bffe17 ldw r2,-8(fp) 2d8: 00bfec16 blt zero,r2,28c for (i = 0; i < TIME_SETS; i++) { 2dc: e0bfff17 ldw r2,-4(fp) 2e0: 10800044 addi r2,r2,1 2e4: e0bfff15 stw r2,-4(fp) 2e8: e0bfff17 ldw r2,-4(fp) 2ec: 10800110 cmplti r2,r2,4 2f0: 103fe31e bne r2,zero,280 } } //select timeset and run semafor IOWR_ALTERA_AVALON_SEM_DIVSET(SEM_CTL_SLAVE_BASE,0x02); 2f4: 00c00084 movi r3,2 2f8: 008000b4 movhi r2,2 2fc: 10c41935 stwio r3,4196(r2) IOWR_ALTERA_AVALON_SEM_CTL(SEM_CTL_SLAVE_BASE,0x01); 300: 00c00044 movi r3,1 304: 008000b4 movhi r2,2 308: 10c41835 stwio r3,4192(r2) printf("Ready\n"); 30c: 01000034 movhi r4,0 310: 2115e504 addi r4,r4,22420 314: 00003e80 call 3e8 while (1) 318: 003fff06 br 318 0000031c <_puts_r>: 31c: defff504 addi sp,sp,-44 320: dc000815 stw r16,32(sp) 324: 2021883a mov r16,r4 328: 2809883a mov r4,r5 32c: dc400915 stw r17,36(sp) 330: dfc00a15 stw ra,40(sp) 334: 2823883a mov r17,r5 338: 00003f80 call 3f8 33c: 11000044 addi r4,r2,1 340: d8800515 stw r2,20(sp) 344: 00800044 movi r2,1 348: 00c00034 movhi r3,0 34c: d8800715 stw r2,28(sp) 350: d8800404 addi r2,sp,16 354: 18d5e704 addi r3,r3,22428 358: d8800115 stw r2,4(sp) 35c: 00800084 movi r2,2 360: dc400415 stw r17,16(sp) 364: d8c00615 stw r3,24(sp) 368: d9000315 stw r4,12(sp) 36c: d8800215 stw r2,8(sp) 370: 81400217 ldw r5,8(r16) 374: 80000226 beq r16,zero,380 <_puts_r+0x64> 378: 80800e17 ldw r2,56(r16) 37c: 10001326 beq r2,zero,3cc <_puts_r+0xb0> 380: 2880030b ldhu r2,12(r5) 384: 10c8000c andi r3,r2,8192 388: 1800061e bne r3,zero,3a4 <_puts_r+0x88> 38c: 28c01917 ldw r3,100(r5) 390: 0137ffc4 movi r4,-8193 394: 10880014 ori r2,r2,8192 398: 1906703a and r3,r3,r4 39c: 2880030d sth r2,12(r5) 3a0: 28c01915 stw r3,100(r5) 3a4: d9800104 addi r6,sp,4 3a8: 8009883a mov r4,r16 3ac: 000083c0 call 83c <__sfvwrite_r> 3b0: 10000b1e bne r2,zero,3e0 <_puts_r+0xc4> 3b4: 00800284 movi r2,10 3b8: dfc00a17 ldw ra,40(sp) 3bc: dc400917 ldw r17,36(sp) 3c0: dc000817 ldw r16,32(sp) 3c4: dec00b04 addi sp,sp,44 3c8: f800283a ret 3cc: 8009883a mov r4,r16 3d0: d9400015 stw r5,0(sp) 3d4: 00007f40 call 7f4 <__sinit> 3d8: d9400017 ldw r5,0(sp) 3dc: 003fe806 br 380 <_puts_r+0x64> 3e0: 00bfffc4 movi r2,-1 3e4: 003ff406 br 3b8 <_puts_r+0x9c> 000003e8 : 3e8: 00800034 movhi r2,0 3ec: 200b883a mov r5,r4 3f0: 111c8117 ldw r4,29188(r2) 3f4: 000031c1 jmpi 31c <_puts_r> 000003f8 : 3f8: 208000cc andi r2,r4,3 3fc: 10000926 beq r2,zero,424 400: 2005883a mov r2,r4 404: 00000306 br 414 408: 10800044 addi r2,r2,1 40c: 10c000cc andi r3,r2,3 410: 18000526 beq r3,zero,428 414: 10c00007 ldb r3,0(r2) 418: 183ffb1e bne r3,zero,408 41c: 1105c83a sub r2,r2,r4 420: f800283a ret 424: 2005883a mov r2,r4 428: 11400017 ldw r5,0(r2) 42c: 01ffbff4 movhi r7,65279 430: 39ffbfc4 addi r7,r7,-257 434: 29c7883a add r3,r5,r7 438: 01a02074 movhi r6,32897 43c: 014a303a nor r5,zero,r5 440: 1946703a and r3,r3,r5 444: 31a02004 addi r6,r6,-32640 448: 1986703a and r3,r3,r6 44c: 1800071e bne r3,zero,46c 450: 11400117 ldw r5,4(r2) 454: 10800104 addi r2,r2,4 458: 29c7883a add r3,r5,r7 45c: 014a303a nor r5,zero,r5 460: 1946703a and r3,r3,r5 464: 1986703a and r3,r3,r6 468: 183ff926 beq r3,zero,450 46c: 10c00007 ldb r3,0(r2) 470: 183fea26 beq r3,zero,41c 474: 10c00047 ldb r3,1(r2) 478: 10800044 addi r2,r2,1 47c: 183fe726 beq r3,zero,41c 480: 10c00047 ldb r3,1(r2) 484: 10800044 addi r2,r2,1 488: 183ffa1e bne r3,zero,474 48c: 003fe306 br 41c 00000490 <__fp_lock>: 490: 0005883a mov r2,zero 494: f800283a ret 00000498 <_cleanup_r>: 498: 01400034 movhi r5,0 49c: 2948fb04 addi r5,r5,9196 4a0: 0000d9c1 jmpi d9c <_fwalk_reent> 000004a4 <__fp_unlock>: 4a4: 0005883a mov r2,zero 4a8: f800283a ret 000004ac <__sinit.part.0>: 4ac: 00c00034 movhi r3,0 4b0: 20800117 ldw r2,4(r4) 4b4: 18c12604 addi r3,r3,1176 4b8: 20c00f15 stw r3,60(r4) 4bc: 2140bb04 addi r5,r4,748 4c0: 00c000c4 movi r3,3 4c4: 20c0b915 stw r3,740(r4) 4c8: 2140ba15 stw r5,744(r4) 4cc: 2000b815 stw zero,736(r4) 4d0: 10001705 stb zero,92(r2) 4d4: 10001745 stb zero,93(r2) 4d8: 10001785 stb zero,94(r2) 4dc: 100017c5 stb zero,95(r2) 4e0: 10001805 stb zero,96(r2) 4e4: 10001845 stb zero,97(r2) 4e8: 10001885 stb zero,98(r2) 4ec: 100018c5 stb zero,99(r2) 4f0: 00c00104 movi r3,4 4f4: 10c00315 stw r3,12(r2) 4f8: 02000034 movhi r8,0 4fc: 20c00217 ldw r3,8(r4) 500: 01c00034 movhi r7,0 504: 01800034 movhi r6,0 508: 01400034 movhi r5,0 50c: 4207f304 addi r8,r8,8140 510: 39c80a04 addi r7,r7,8232 514: 31882a04 addi r6,r6,8360 518: 29484104 addi r5,r5,8452 51c: 02400074 movhi r9,1 520: 10001915 stw zero,100(r2) 524: 10000015 stw zero,0(r2) 528: 10000115 stw zero,4(r2) 52c: 10000215 stw zero,8(r2) 530: 10000415 stw zero,16(r2) 534: 10000515 stw zero,20(r2) 538: 10000615 stw zero,24(r2) 53c: 10800715 stw r2,28(r2) 540: 12000815 stw r8,32(r2) 544: 11c00915 stw r7,36(r2) 548: 11800a15 stw r6,40(r2) 54c: 11400b15 stw r5,44(r2) 550: 4a400284 addi r9,r9,10 554: 1a400315 stw r9,12(r3) 558: 18001915 stw zero,100(r3) 55c: 18000015 stw zero,0(r3) 560: 18000115 stw zero,4(r3) 564: 18000215 stw zero,8(r3) 568: 18000415 stw zero,16(r3) 56c: 18001705 stb zero,92(r3) 570: 18001745 stb zero,93(r3) 574: 18001785 stb zero,94(r3) 578: 180017c5 stb zero,95(r3) 57c: 18001805 stb zero,96(r3) 580: 18001845 stb zero,97(r3) 584: 18001885 stb zero,98(r3) 588: 180018c5 stb zero,99(r3) 58c: 20800317 ldw r2,12(r4) 590: 024000b4 movhi r9,2 594: 18000515 stw zero,20(r3) 598: 18000615 stw zero,24(r3) 59c: 18c00715 stw r3,28(r3) 5a0: 1a000815 stw r8,32(r3) 5a4: 19c00915 stw r7,36(r3) 5a8: 19800a15 stw r6,40(r3) 5ac: 19400b15 stw r5,44(r3) 5b0: 4a400484 addi r9,r9,18 5b4: 10001915 stw zero,100(r2) 5b8: 10000015 stw zero,0(r2) 5bc: 10000115 stw zero,4(r2) 5c0: 10000215 stw zero,8(r2) 5c4: 12400315 stw r9,12(r2) 5c8: 10000415 stw zero,16(r2) 5cc: 10000515 stw zero,20(r2) 5d0: 10000615 stw zero,24(r2) 5d4: 10001705 stb zero,92(r2) 5d8: 10001745 stb zero,93(r2) 5dc: 10001785 stb zero,94(r2) 5e0: 100017c5 stb zero,95(r2) 5e4: 10001805 stb zero,96(r2) 5e8: 10001845 stb zero,97(r2) 5ec: 10001885 stb zero,98(r2) 5f0: 100018c5 stb zero,99(r2) 5f4: 10800715 stw r2,28(r2) 5f8: 12000815 stw r8,32(r2) 5fc: 11c00915 stw r7,36(r2) 600: 11800a15 stw r6,40(r2) 604: 11400b15 stw r5,44(r2) 608: 00800044 movi r2,1 60c: 20800e15 stw r2,56(r4) 610: f800283a ret 00000614 <__sfmoreglue>: 614: defffc04 addi sp,sp,-16 618: dc800215 stw r18,8(sp) 61c: 2825883a mov r18,r5 620: dc000015 stw r16,0(sp) 624: 01401a04 movi r5,104 628: 2021883a mov r16,r4 62c: 913fffc4 addi r4,r18,-1 630: dfc00315 stw ra,12(sp) 634: dc400115 stw r17,4(sp) 638: 000316c0 call 316c <__mulsi3> 63c: 8009883a mov r4,r16 640: 11401d04 addi r5,r2,116 644: 1023883a mov r17,r2 648: 0000e440 call e44 <_malloc_r> 64c: 1021883a mov r16,r2 650: 10000726 beq r2,zero,670 <__sfmoreglue+0x5c> 654: 11000304 addi r4,r2,12 658: 10000015 stw zero,0(r2) 65c: 14800115 stw r18,4(r2) 660: 11000215 stw r4,8(r2) 664: 89801a04 addi r6,r17,104 668: 000b883a mov r5,zero 66c: 00019200 call 1920 670: 8005883a mov r2,r16 674: dfc00317 ldw ra,12(sp) 678: dc800217 ldw r18,8(sp) 67c: dc400117 ldw r17,4(sp) 680: dc000017 ldw r16,0(sp) 684: dec00404 addi sp,sp,16 688: f800283a ret 0000068c <__sfp>: 68c: defffb04 addi sp,sp,-20 690: 00800034 movhi r2,0 694: dc000015 stw r16,0(sp) 698: 141c8017 ldw r16,29184(r2) 69c: dc400115 stw r17,4(sp) 6a0: dfc00415 stw ra,16(sp) 6a4: 80800e17 ldw r2,56(r16) 6a8: dcc00315 stw r19,12(sp) 6ac: dc800215 stw r18,8(sp) 6b0: 2023883a mov r17,r4 6b4: 10003126 beq r2,zero,77c <__sfp+0xf0> 6b8: 8100ba17 ldw r4,744(r16) 6bc: 8140b917 ldw r5,740(r16) 6c0: 04c00104 movi r19,4 6c4: 8400b804 addi r16,r16,736 6c8: 297fffc4 addi r5,r5,-1 6cc: 2800050e bge r5,zero,6e4 <__sfp+0x58> 6d0: 00002406 br 764 <__sfp+0xd8> 6d4: 297fffc4 addi r5,r5,-1 6d8: 28bfffd8 cmpnei r2,r5,-1 6dc: 21001a04 addi r4,r4,104 6e0: 10002026 beq r2,zero,764 <__sfp+0xd8> 6e4: 2080030f ldh r2,12(r4) 6e8: 103ffa1e bne r2,zero,6d4 <__sfp+0x48> 6ec: 00bffff4 movhi r2,65535 6f0: 10800044 addi r2,r2,1 6f4: 20001915 stw zero,100(r4) 6f8: 20000015 stw zero,0(r4) 6fc: 20000115 stw zero,4(r4) 700: 20000215 stw zero,8(r4) 704: 20800315 stw r2,12(r4) 708: 20000415 stw zero,16(r4) 70c: 20000515 stw zero,20(r4) 710: 20000615 stw zero,24(r4) 714: 20001705 stb zero,92(r4) 718: 20001745 stb zero,93(r4) 71c: 20001785 stb zero,94(r4) 720: 200017c5 stb zero,95(r4) 724: 20001805 stb zero,96(r4) 728: 20001845 stb zero,97(r4) 72c: 20001885 stb zero,98(r4) 730: 200018c5 stb zero,99(r4) 734: 20000c15 stw zero,48(r4) 738: 20000d15 stw zero,52(r4) 73c: 20001115 stw zero,68(r4) 740: 20001215 stw zero,72(r4) 744: 2005883a mov r2,r4 748: dfc00417 ldw ra,16(sp) 74c: dcc00317 ldw r19,12(sp) 750: dc800217 ldw r18,8(sp) 754: dc400117 ldw r17,4(sp) 758: dc000017 ldw r16,0(sp) 75c: dec00504 addi sp,sp,20 760: f800283a ret 764: 80800017 ldw r2,0(r16) 768: 10000726 beq r2,zero,788 <__sfp+0xfc> 76c: 11000217 ldw r4,8(r2) 770: 11400117 ldw r5,4(r2) 774: 1021883a mov r16,r2 778: 003fd306 br 6c8 <__sfp+0x3c> 77c: 8009883a mov r4,r16 780: 00004ac0 call 4ac <__sinit.part.0> 784: 003fcc06 br 6b8 <__sfp+0x2c> 788: 01406b04 movi r5,428 78c: 8809883a mov r4,r17 790: 0000e440 call e44 <_malloc_r> 794: 1025883a mov r18,r2 798: 10000c26 beq r2,zero,7cc <__sfp+0x140> 79c: 11000304 addi r4,r2,12 7a0: 11000215 stw r4,8(r2) 7a4: 000b883a mov r5,zero 7a8: 10000015 stw zero,0(r2) 7ac: 14c00115 stw r19,4(r2) 7b0: 01806804 movi r6,416 7b4: 00019200 call 1920 7b8: 1009883a mov r4,r2 7bc: 84800015 stw r18,0(r16) 7c0: 014000c4 movi r5,3 7c4: 9021883a mov r16,r18 7c8: 003fc606 br 6e4 <__sfp+0x58> 7cc: 80000015 stw zero,0(r16) 7d0: 00800304 movi r2,12 7d4: 88800015 stw r2,0(r17) 7d8: 0009883a mov r4,zero 7dc: 003fd906 br 744 <__sfp+0xb8> 000007e0 <_cleanup>: 7e0: 00800034 movhi r2,0 7e4: 111c8017 ldw r4,29184(r2) 7e8: 01400034 movhi r5,0 7ec: 2948fb04 addi r5,r5,9196 7f0: 0000d9c1 jmpi d9c <_fwalk_reent> 000007f4 <__sinit>: 7f4: 20800e17 ldw r2,56(r4) 7f8: 10000126 beq r2,zero,800 <__sinit+0xc> 7fc: f800283a ret 800: 00004ac1 jmpi 4ac <__sinit.part.0> 00000804 <__sfp_lock_acquire>: 804: f800283a ret 00000808 <__sfp_lock_release>: 808: f800283a ret 0000080c <__sinit_lock_acquire>: 80c: f800283a ret 00000810 <__sinit_lock_release>: 810: f800283a ret 00000814 <__fp_lock_all>: 814: 00800034 movhi r2,0 818: 111c8117 ldw r4,29188(r2) 81c: 01400034 movhi r5,0 820: 29412404 addi r5,r5,1168 824: 0000d041 jmpi d04 <_fwalk> 00000828 <__fp_unlock_all>: 828: 00800034 movhi r2,0 82c: 111c8117 ldw r4,29188(r2) 830: 01400034 movhi r5,0 834: 29412904 addi r5,r5,1188 838: 0000d041 jmpi d04 <_fwalk> 0000083c <__sfvwrite_r>: 83c: 30800217 ldw r2,8(r6) 840: 1000a326 beq r2,zero,ad0 <__sfvwrite_r+0x294> 844: 29c0030b ldhu r7,12(r5) 848: defff404 addi sp,sp,-48 84c: ddc00915 stw r23,36(sp) 850: dd400715 stw r21,28(sp) 854: dc000215 stw r16,8(sp) 858: dfc00b15 stw ra,44(sp) 85c: df000a15 stw fp,40(sp) 860: dd800815 stw r22,32(sp) 864: dd000615 stw r20,24(sp) 868: dcc00515 stw r19,20(sp) 86c: dc800415 stw r18,16(sp) 870: dc400315 stw r17,12(sp) 874: 3880020c andi r2,r7,8 878: 302f883a mov r23,r6 87c: 202b883a mov r21,r4 880: 2821883a mov r16,r5 884: 10002226 beq r2,zero,910 <__sfvwrite_r+0xd4> 888: 28800417 ldw r2,16(r5) 88c: 10002026 beq r2,zero,910 <__sfvwrite_r+0xd4> 890: 3880008c andi r2,r7,2 894: bc400017 ldw r17,0(r23) 898: 10002526 beq r2,zero,930 <__sfvwrite_r+0xf4> 89c: 80800917 ldw r2,36(r16) 8a0: 81400717 ldw r5,28(r16) 8a4: 05200034 movhi r20,32768 8a8: 0027883a mov r19,zero 8ac: 0025883a mov r18,zero 8b0: a53f0004 addi r20,r20,-1024 8b4: 980d883a mov r6,r19 8b8: a809883a mov r4,r21 8bc: 90001026 beq r18,zero,900 <__sfvwrite_r+0xc4> 8c0: 900f883a mov r7,r18 8c4: a480012e bgeu r20,r18,8cc <__sfvwrite_r+0x90> 8c8: a00f883a mov r7,r20 8cc: 103ee83a callr r2 8d0: 00807a0e bge zero,r2,abc <__sfvwrite_r+0x280> 8d4: b9000217 ldw r4,8(r23) 8d8: 98a7883a add r19,r19,r2 8dc: 90a5c83a sub r18,r18,r2 8e0: 2085c83a sub r2,r4,r2 8e4: b8800215 stw r2,8(r23) 8e8: 10006326 beq r2,zero,a78 <__sfvwrite_r+0x23c> 8ec: 80800917 ldw r2,36(r16) 8f0: 81400717 ldw r5,28(r16) 8f4: 980d883a mov r6,r19 8f8: a809883a mov r4,r21 8fc: 903ff01e bne r18,zero,8c0 <__sfvwrite_r+0x84> 900: 8cc00017 ldw r19,0(r17) 904: 8c800117 ldw r18,4(r17) 908: 8c400204 addi r17,r17,8 90c: 003fe906 br 8b4 <__sfvwrite_r+0x78> 910: 800b883a mov r5,r16 914: a809883a mov r4,r21 918: 00021700 call 2170 <__swsetup_r> 91c: 1000f71e bne r2,zero,cfc <__sfvwrite_r+0x4c0> 920: 81c0030b ldhu r7,12(r16) 924: bc400017 ldw r17,0(r23) 928: 3880008c andi r2,r7,2 92c: 103fdb1e bne r2,zero,89c <__sfvwrite_r+0x60> 930: 3880004c andi r2,r7,1 934: 84800217 ldw r18,8(r16) 938: 82000017 ldw r8,0(r16) 93c: 1000661e bne r2,zero,ad8 <__sfvwrite_r+0x29c> 940: 00a00034 movhi r2,32768 944: 10bfff84 addi r2,r2,-2 948: 00e00034 movhi r3,32768 94c: d8800015 stw r2,0(sp) 950: 18bfffc4 addi r2,r3,-1 954: 0039883a mov fp,zero 958: 0027883a mov r19,zero 95c: d8800115 stw r2,4(sp) 960: 98004126 beq r19,zero,a68 <__sfvwrite_r+0x22c> 964: 3880800c andi r2,r7,512 968: 10009726 beq r2,zero,bc8 <__sfvwrite_r+0x38c> 96c: 902d883a mov r22,r18 970: 9c80be36 bltu r19,r18,c6c <__sfvwrite_r+0x430> 974: 3881200c andi r2,r7,1152 978: 10002626 beq r2,zero,a14 <__sfvwrite_r+0x1d8> 97c: 81800517 ldw r6,20(r16) 980: 81400417 ldw r5,16(r16) 984: 98800044 addi r2,r19,1 988: 3189883a add r4,r6,r6 98c: 2189883a add r4,r4,r6 990: 2028d7fa srli r20,r4,31 994: 4165c83a sub r18,r8,r5 998: 1485883a add r2,r2,r18 99c: a109883a add r4,r20,r4 9a0: 2029d07a srai r20,r4,1 9a4: a00d883a mov r6,r20 9a8: a080022e bgeu r20,r2,9b4 <__sfvwrite_r+0x178> 9ac: 1029883a mov r20,r2 9b0: 100d883a mov r6,r2 9b4: 39c1000c andi r7,r7,1024 9b8: 3800c026 beq r7,zero,cbc <__sfvwrite_r+0x480> 9bc: a809883a mov r4,r21 9c0: 300b883a mov r5,r6 9c4: 0000e440 call e44 <_malloc_r> 9c8: 1009883a mov r4,r2 9cc: 1000c726 beq r2,zero,cec <__sfvwrite_r+0x4b0> 9d0: 81400417 ldw r5,16(r16) 9d4: 900d883a mov r6,r18 9d8: 00016f40 call 16f4 9dc: 1009883a mov r4,r2 9e0: 8080030b ldhu r2,12(r16) 9e4: 00fedfc4 movi r3,-1153 9e8: 10c4703a and r2,r2,r3 9ec: 10802014 ori r2,r2,128 9f0: 8080030d sth r2,12(r16) 9f4: 2491883a add r8,r4,r18 9f8: a485c83a sub r2,r20,r18 9fc: 81000415 stw r4,16(r16) a00: 82000015 stw r8,0(r16) a04: 85000515 stw r20,20(r16) a08: 9825883a mov r18,r19 a0c: 80800215 stw r2,8(r16) a10: 982d883a mov r22,r19 a14: 4009883a mov r4,r8 a18: b00d883a mov r6,r22 a1c: e00b883a mov r5,fp a20: 00017f40 call 17f4 a24: 81000217 ldw r4,8(r16) a28: 80800017 ldw r2,0(r16) a2c: 9829883a mov r20,r19 a30: 24a5c83a sub r18,r4,r18 a34: 1585883a add r2,r2,r22 a38: 84800215 stw r18,8(r16) a3c: 80800015 stw r2,0(r16) a40: 0027883a mov r19,zero a44: b8800217 ldw r2,8(r23) a48: e539883a add fp,fp,r20 a4c: 1529c83a sub r20,r2,r20 a50: bd000215 stw r20,8(r23) a54: a0000826 beq r20,zero,a78 <__sfvwrite_r+0x23c> a58: 81c0030b ldhu r7,12(r16) a5c: 84800217 ldw r18,8(r16) a60: 82000017 ldw r8,0(r16) a64: 983fbf1e bne r19,zero,964 <__sfvwrite_r+0x128> a68: 8f000017 ldw fp,0(r17) a6c: 8cc00117 ldw r19,4(r17) a70: 8c400204 addi r17,r17,8 a74: 003fba06 br 960 <__sfvwrite_r+0x124> a78: 0005883a mov r2,zero a7c: dfc00b17 ldw ra,44(sp) a80: df000a17 ldw fp,40(sp) a84: ddc00917 ldw r23,36(sp) a88: dd800817 ldw r22,32(sp) a8c: dd400717 ldw r21,28(sp) a90: dd000617 ldw r20,24(sp) a94: dcc00517 ldw r19,20(sp) a98: dc800417 ldw r18,16(sp) a9c: dc400317 ldw r17,12(sp) aa0: dc000217 ldw r16,8(sp) aa4: dec00c04 addi sp,sp,48 aa8: f800283a ret aac: 800b883a mov r5,r16 ab0: a809883a mov r4,r21 ab4: 00026f40 call 26f4 <_fflush_r> ab8: 10002026 beq r2,zero,b3c <__sfvwrite_r+0x300> abc: 8080030b ldhu r2,12(r16) ac0: 10801014 ori r2,r2,64 ac4: 8080030d sth r2,12(r16) ac8: 00bfffc4 movi r2,-1 acc: 003feb06 br a7c <__sfvwrite_r+0x240> ad0: 0005883a mov r2,zero ad4: f800283a ret ad8: 002d883a mov r22,zero adc: 0027883a mov r19,zero ae0: 0005883a mov r2,zero ae4: 0039883a mov fp,zero ae8: b0001d26 beq r22,zero,b60 <__sfvwrite_r+0x324> aec: 10002026 beq r2,zero,b70 <__sfvwrite_r+0x334> af0: 9829883a mov r20,r19 af4: b500012e bgeu r22,r20,afc <__sfvwrite_r+0x2c0> af8: b029883a mov r20,r22 afc: 80800417 ldw r2,16(r16) b00: 81c00517 ldw r7,20(r16) b04: 1200022e bgeu r2,r8,b10 <__sfvwrite_r+0x2d4> b08: 3ca5883a add r18,r7,r18 b0c: 95002216 blt r18,r20,b98 <__sfvwrite_r+0x35c> b10: a1c05916 blt r20,r7,c78 <__sfvwrite_r+0x43c> b14: 80800917 ldw r2,36(r16) b18: 81400717 ldw r5,28(r16) b1c: e00d883a mov r6,fp b20: a809883a mov r4,r21 b24: 103ee83a callr r2 b28: 1025883a mov r18,r2 b2c: 00bfe30e bge zero,r2,abc <__sfvwrite_r+0x280> b30: 9ca7c83a sub r19,r19,r18 b34: 983fdd26 beq r19,zero,aac <__sfvwrite_r+0x270> b38: 00800044 movi r2,1 b3c: b9800217 ldw r6,8(r23) b40: e4b9883a add fp,fp,r18 b44: b4adc83a sub r22,r22,r18 b48: 34a5c83a sub r18,r6,r18 b4c: bc800215 stw r18,8(r23) b50: 903fc926 beq r18,zero,a78 <__sfvwrite_r+0x23c> b54: 84800217 ldw r18,8(r16) b58: 82000017 ldw r8,0(r16) b5c: b03fe31e bne r22,zero,aec <__sfvwrite_r+0x2b0> b60: 8d800117 ldw r22,4(r17) b64: 8f000017 ldw fp,0(r17) b68: 8c400204 addi r17,r17,8 b6c: b03ffc26 beq r22,zero,b60 <__sfvwrite_r+0x324> b70: b00d883a mov r6,r22 b74: 01400284 movi r5,10 b78: e009883a mov r4,fp b7c: da000015 stw r8,0(sp) b80: 00016240 call 1624 b84: da000017 ldw r8,0(sp) b88: 10004926 beq r2,zero,cb0 <__sfvwrite_r+0x474> b8c: 10800044 addi r2,r2,1 b90: 1727c83a sub r19,r2,fp b94: 003fd606 br af0 <__sfvwrite_r+0x2b4> b98: e00b883a mov r5,fp b9c: 4009883a mov r4,r8 ba0: 900d883a mov r6,r18 ba4: 00017f40 call 17f4 ba8: 80800017 ldw r2,0(r16) bac: 800b883a mov r5,r16 bb0: a809883a mov r4,r21 bb4: 1485883a add r2,r2,r18 bb8: 80800015 stw r2,0(r16) bbc: 00026f40 call 26f4 <_fflush_r> bc0: 103fdb26 beq r2,zero,b30 <__sfvwrite_r+0x2f4> bc4: 003fbd06 br abc <__sfvwrite_r+0x280> bc8: 80800417 ldw r2,16(r16) bcc: 12001436 bltu r2,r8,c20 <__sfvwrite_r+0x3e4> bd0: 85000517 ldw r20,20(r16) bd4: 9d001236 bltu r19,r20,c20 <__sfvwrite_r+0x3e4> bd8: d8800017 ldw r2,0(sp) bdc: 14c0322e bgeu r2,r19,ca8 <__sfvwrite_r+0x46c> be0: d9000117 ldw r4,4(sp) be4: a00b883a mov r5,r20 be8: 0002fb80 call 2fb8 <__divsi3> bec: a00b883a mov r5,r20 bf0: 1009883a mov r4,r2 bf4: 000316c0 call 316c <__mulsi3> bf8: 82000917 ldw r8,36(r16) bfc: 81400717 ldw r5,28(r16) c00: 100f883a mov r7,r2 c04: e00d883a mov r6,fp c08: a809883a mov r4,r21 c0c: 403ee83a callr r8 c10: 1029883a mov r20,r2 c14: 00bfa90e bge zero,r2,abc <__sfvwrite_r+0x280> c18: 9d27c83a sub r19,r19,r20 c1c: 003f8906 br a44 <__sfvwrite_r+0x208> c20: 9029883a mov r20,r18 c24: 9c80012e bgeu r19,r18,c2c <__sfvwrite_r+0x3f0> c28: 9829883a mov r20,r19 c2c: 4009883a mov r4,r8 c30: a00d883a mov r6,r20 c34: e00b883a mov r5,fp c38: 00017f40 call 17f4 c3c: 80800217 ldw r2,8(r16) c40: 81000017 ldw r4,0(r16) c44: 1505c83a sub r2,r2,r20 c48: 2509883a add r4,r4,r20 c4c: 80800215 stw r2,8(r16) c50: 81000015 stw r4,0(r16) c54: 103ff01e bne r2,zero,c18 <__sfvwrite_r+0x3dc> c58: 800b883a mov r5,r16 c5c: a809883a mov r4,r21 c60: 00026f40 call 26f4 <_fflush_r> c64: 103fec26 beq r2,zero,c18 <__sfvwrite_r+0x3dc> c68: 003f9406 br abc <__sfvwrite_r+0x280> c6c: 9825883a mov r18,r19 c70: 982d883a mov r22,r19 c74: 003f6706 br a14 <__sfvwrite_r+0x1d8> c78: 4009883a mov r4,r8 c7c: a00d883a mov r6,r20 c80: e00b883a mov r5,fp c84: 00017f40 call 17f4 c88: 81000217 ldw r4,8(r16) c8c: 80800017 ldw r2,0(r16) c90: a025883a mov r18,r20 c94: 2509c83a sub r4,r4,r20 c98: 1505883a add r2,r2,r20 c9c: 81000215 stw r4,8(r16) ca0: 80800015 stw r2,0(r16) ca4: 003fa206 br b30 <__sfvwrite_r+0x2f4> ca8: 9809883a mov r4,r19 cac: 003fcd06 br be4 <__sfvwrite_r+0x3a8> cb0: b5000044 addi r20,r22,1 cb4: a027883a mov r19,r20 cb8: 003f8e06 br af4 <__sfvwrite_r+0x2b8> cbc: a809883a mov r4,r21 cc0: 0001a100 call 1a10 <_realloc_r> cc4: 1009883a mov r4,r2 cc8: 103f4a1e bne r2,zero,9f4 <__sfvwrite_r+0x1b8> ccc: 81400417 ldw r5,16(r16) cd0: a809883a mov r4,r21 cd4: 00028f40 call 28f4 <_free_r> cd8: 8080030b ldhu r2,12(r16) cdc: 00c00304 movi r3,12 ce0: a8c00015 stw r3,0(r21) ce4: 10bfdfcc andi r2,r2,65407 ce8: 003f7506 br ac0 <__sfvwrite_r+0x284> cec: 00c00304 movi r3,12 cf0: 8080030b ldhu r2,12(r16) cf4: a8c00015 stw r3,0(r21) cf8: 003f7106 br ac0 <__sfvwrite_r+0x284> cfc: 00bfffc4 movi r2,-1 d00: 003f5e06 br a7c <__sfvwrite_r+0x240> 00000d04 <_fwalk>: d04: defffa04 addi sp,sp,-24 d08: dd000415 stw r20,16(sp) d0c: dcc00315 stw r19,12(sp) d10: dc800215 stw r18,8(sp) d14: dfc00515 stw ra,20(sp) d18: dc400115 stw r17,4(sp) d1c: dc000015 stw r16,0(sp) d20: 2827883a mov r19,r5 d24: 2480b804 addi r18,r4,736 d28: 0029883a mov r20,zero d2c: 94400117 ldw r17,4(r18) d30: 94000217 ldw r16,8(r18) d34: 8c7fffc4 addi r17,r17,-1 d38: 88000d16 blt r17,zero,d70 <_fwalk+0x6c> d3c: 8080030b ldhu r2,12(r16) d40: 8c7fffc4 addi r17,r17,-1 d44: 108000b0 cmpltui r2,r2,2 d48: 1000061e bne r2,zero,d64 <_fwalk+0x60> d4c: 8080038f ldh r2,14(r16) d50: 8009883a mov r4,r16 d54: 10bfffe0 cmpeqi r2,r2,-1 d58: 1000021e bne r2,zero,d64 <_fwalk+0x60> d5c: 983ee83a callr r19 d60: a0a8b03a or r20,r20,r2 d64: 88bfffd8 cmpnei r2,r17,-1 d68: 84001a04 addi r16,r16,104 d6c: 103ff31e bne r2,zero,d3c <_fwalk+0x38> d70: 94800017 ldw r18,0(r18) d74: 903fed1e bne r18,zero,d2c <_fwalk+0x28> d78: a005883a mov r2,r20 d7c: dfc00517 ldw ra,20(sp) d80: dd000417 ldw r20,16(sp) d84: dcc00317 ldw r19,12(sp) d88: dc800217 ldw r18,8(sp) d8c: dc400117 ldw r17,4(sp) d90: dc000017 ldw r16,0(sp) d94: dec00604 addi sp,sp,24 d98: f800283a ret 00000d9c <_fwalk_reent>: d9c: defff904 addi sp,sp,-28 da0: dd400515 stw r21,20(sp) da4: dd000415 stw r20,16(sp) da8: dcc00315 stw r19,12(sp) dac: dc800215 stw r18,8(sp) db0: dfc00615 stw ra,24(sp) db4: dc400115 stw r17,4(sp) db8: dc000015 stw r16,0(sp) dbc: 202b883a mov r21,r4 dc0: 2827883a mov r19,r5 dc4: 2480b804 addi r18,r4,736 dc8: 0029883a mov r20,zero dcc: 94400117 ldw r17,4(r18) dd0: 94000217 ldw r16,8(r18) dd4: 8c7fffc4 addi r17,r17,-1 dd8: 88000e16 blt r17,zero,e14 <_fwalk_reent+0x78> ddc: 8080030b ldhu r2,12(r16) de0: 8c7fffc4 addi r17,r17,-1 de4: 108000b0 cmpltui r2,r2,2 de8: 1000071e bne r2,zero,e08 <_fwalk_reent+0x6c> dec: 8080038f ldh r2,14(r16) df0: 800b883a mov r5,r16 df4: a809883a mov r4,r21 df8: 10bfffe0 cmpeqi r2,r2,-1 dfc: 1000021e bne r2,zero,e08 <_fwalk_reent+0x6c> e00: 983ee83a callr r19 e04: a0a8b03a or r20,r20,r2 e08: 88bfffd8 cmpnei r2,r17,-1 e0c: 84001a04 addi r16,r16,104 e10: 103ff21e bne r2,zero,ddc <_fwalk_reent+0x40> e14: 94800017 ldw r18,0(r18) e18: 903fec1e bne r18,zero,dcc <_fwalk_reent+0x30> e1c: a005883a mov r2,r20 e20: dfc00617 ldw ra,24(sp) e24: dd400517 ldw r21,20(sp) e28: dd000417 ldw r20,16(sp) e2c: dcc00317 ldw r19,12(sp) e30: dc800217 ldw r18,8(sp) e34: dc400117 ldw r17,4(sp) e38: dc000017 ldw r16,0(sp) e3c: dec00704 addi sp,sp,28 e40: f800283a ret 00000e44 <_malloc_r>: e44: defff604 addi sp,sp,-40 e48: dc400115 stw r17,4(sp) e4c: 2c4002c4 addi r17,r5,11 e50: dc800215 stw r18,8(sp) e54: dfc00915 stw ra,36(sp) e58: df000815 stw fp,32(sp) e5c: ddc00715 stw r23,28(sp) e60: dd800615 stw r22,24(sp) e64: dd400515 stw r21,20(sp) e68: dd000415 stw r20,16(sp) e6c: dcc00315 stw r19,12(sp) e70: dc000015 stw r16,0(sp) e74: 888005e8 cmpgeui r2,r17,23 e78: 2025883a mov r18,r4 e7c: 10001b1e bne r2,zero,eec <_malloc_r+0xa8> e80: 29400468 cmpgeui r5,r5,17 e84: 2800821e bne r5,zero,1090 <_malloc_r+0x24c> e88: 000367c0 call 367c <__malloc_lock> e8c: 04400404 movi r17,16 e90: 00800604 movi r2,24 e94: 01c00084 movi r7,2 e98: 04c00034 movhi r19,0 e9c: 9cd6fc04 addi r19,r19,23536 ea0: 9885883a add r2,r19,r2 ea4: 14000117 ldw r16,4(r2) ea8: 10fffe04 addi r3,r2,-8 eac: 80c08b26 beq r16,r3,10dc <_malloc_r+0x298> eb0: 80800117 ldw r2,4(r16) eb4: 81000317 ldw r4,12(r16) eb8: 00ffff04 movi r3,-4 ebc: 10c4703a and r2,r2,r3 ec0: 81400217 ldw r5,8(r16) ec4: 8085883a add r2,r16,r2 ec8: 10c00117 ldw r3,4(r2) ecc: 29000315 stw r4,12(r5) ed0: 21400215 stw r5,8(r4) ed4: 18c00054 ori r3,r3,1 ed8: 10c00115 stw r3,4(r2) edc: 9009883a mov r4,r18 ee0: 00036a00 call 36a0 <__malloc_unlock> ee4: 80800204 addi r2,r16,8 ee8: 00006c06 br 109c <_malloc_r+0x258> eec: 00bffe04 movi r2,-8 ef0: 88a2703a and r17,r17,r2 ef4: 88006616 blt r17,zero,1090 <_malloc_r+0x24c> ef8: 89406536 bltu r17,r5,1090 <_malloc_r+0x24c> efc: 000367c0 call 367c <__malloc_lock> f00: 88807e28 cmpgeui r2,r17,504 f04: 10012226 beq r2,zero,1390 <_malloc_r+0x54c> f08: 8804d27a srli r2,r17,9 f0c: 10006f26 beq r2,zero,10cc <_malloc_r+0x288> f10: 10c00168 cmpgeui r3,r2,5 f14: 1800fe1e bne r3,zero,1310 <_malloc_r+0x4cc> f18: 8804d1ba srli r2,r17,6 f1c: 11c00e44 addi r7,r2,57 f20: 380890fa slli r4,r7,3 f24: 12000e04 addi r8,r2,56 f28: 04c00034 movhi r19,0 f2c: 9cd6fc04 addi r19,r19,23536 f30: 9909883a add r4,r19,r4 f34: 24000117 ldw r16,4(r4) f38: 213ffe04 addi r4,r4,-8 f3c: 24000b26 beq r4,r16,f6c <_malloc_r+0x128> f40: 01bfff04 movi r6,-4 f44: 00000306 br f54 <_malloc_r+0x110> f48: 1800d60e bge r3,zero,12a4 <_malloc_r+0x460> f4c: 84000317 ldw r16,12(r16) f50: 24000626 beq r4,r16,f6c <_malloc_r+0x128> f54: 80800117 ldw r2,4(r16) f58: 1184703a and r2,r2,r6 f5c: 1447c83a sub r3,r2,r17 f60: 19400408 cmpgei r5,r3,16 f64: 283ff826 beq r5,zero,f48 <_malloc_r+0x104> f68: 400f883a mov r7,r8 f6c: 9c000417 ldw r16,16(r19) f70: 02400034 movhi r9,0 f74: 4a56fe04 addi r9,r9,23544 f78: 82405f26 beq r16,r9,10f8 <_malloc_r+0x2b4> f7c: 80c00117 ldw r3,4(r16) f80: 00bfff04 movi r2,-4 f84: 1884703a and r2,r3,r2 f88: 1447c83a sub r3,r2,r17 f8c: 19000410 cmplti r4,r3,16 f90: 20010a26 beq r4,zero,13bc <_malloc_r+0x578> f94: 9a400515 stw r9,20(r19) f98: 9a400415 stw r9,16(r19) f9c: 1800ff0e bge r3,zero,139c <_malloc_r+0x558> fa0: 10c08028 cmpgeui r3,r2,512 fa4: 1800c11e bne r3,zero,12ac <_malloc_r+0x468> fa8: 1006d0fa srli r3,r2,3 fac: 1008d17a srli r4,r2,5 fb0: 00800044 movi r2,1 fb4: 18c00044 addi r3,r3,1 fb8: 180690fa slli r3,r3,3 fbc: 99400117 ldw r5,4(r19) fc0: 1104983a sll r2,r2,r4 fc4: 98c7883a add r3,r19,r3 fc8: 19000017 ldw r4,0(r3) fcc: 1144b03a or r2,r2,r5 fd0: 197ffe04 addi r5,r3,-8 fd4: 81400315 stw r5,12(r16) fd8: 81000215 stw r4,8(r16) fdc: 98800115 stw r2,4(r19) fe0: 1c000015 stw r16,0(r3) fe4: 24000315 stw r16,12(r4) fe8: 3807d0ba srai r3,r7,2 fec: 01000044 movi r4,1 ff0: 20c8983a sll r4,r4,r3 ff4: 11004536 bltu r2,r4,110c <_malloc_r+0x2c8> ff8: 2086703a and r3,r4,r2 ffc: 18000a1e bne r3,zero,1028 <_malloc_r+0x1e4> 1000: 00ffff04 movi r3,-4 1004: 2109883a add r4,r4,r4 1008: 38ce703a and r7,r7,r3 100c: 2086703a and r3,r4,r2 1010: 39c00104 addi r7,r7,4 1014: 1800041e bne r3,zero,1028 <_malloc_r+0x1e4> 1018: 2109883a add r4,r4,r4 101c: 2086703a and r3,r4,r2 1020: 39c00104 addi r7,r7,4 1024: 183ffc26 beq r3,zero,1018 <_malloc_r+0x1d4> 1028: 02bfff04 movi r10,-4 102c: 381690fa slli r11,r7,3 1030: 3819883a mov r12,r7 1034: 9ad7883a add r11,r19,r11 1038: 5811883a mov r8,r11 103c: 40800317 ldw r2,12(r8) 1040: 4080bc26 beq r8,r2,1334 <_malloc_r+0x4f0> 1044: 10c00117 ldw r3,4(r2) 1048: 1021883a mov r16,r2 104c: 10800317 ldw r2,12(r2) 1050: 1a86703a and r3,r3,r10 1054: 1c4bc83a sub r5,r3,r17 1058: 29800410 cmplti r6,r5,16 105c: 3000ba26 beq r6,zero,1348 <_malloc_r+0x504> 1060: 283ff716 blt r5,zero,1040 <_malloc_r+0x1fc> 1064: 80c7883a add r3,r16,r3 1068: 19400117 ldw r5,4(r3) 106c: 81800217 ldw r6,8(r16) 1070: 9009883a mov r4,r18 1074: 29400054 ori r5,r5,1 1078: 19400115 stw r5,4(r3) 107c: 30800315 stw r2,12(r6) 1080: 11800215 stw r6,8(r2) 1084: 00036a00 call 36a0 <__malloc_unlock> 1088: 80800204 addi r2,r16,8 108c: 00000306 br 109c <_malloc_r+0x258> 1090: 00800304 movi r2,12 1094: 90800015 stw r2,0(r18) 1098: 0005883a mov r2,zero 109c: dfc00917 ldw ra,36(sp) 10a0: df000817 ldw fp,32(sp) 10a4: ddc00717 ldw r23,28(sp) 10a8: dd800617 ldw r22,24(sp) 10ac: dd400517 ldw r21,20(sp) 10b0: dd000417 ldw r20,16(sp) 10b4: dcc00317 ldw r19,12(sp) 10b8: dc800217 ldw r18,8(sp) 10bc: dc400117 ldw r17,4(sp) 10c0: dc000017 ldw r16,0(sp) 10c4: dec00a04 addi sp,sp,40 10c8: f800283a ret 10cc: 01008004 movi r4,512 10d0: 01c01004 movi r7,64 10d4: 02000fc4 movi r8,63 10d8: 003f9306 br f28 <_malloc_r+0xe4> 10dc: 14000317 ldw r16,12(r2) 10e0: 39c00084 addi r7,r7,2 10e4: 143f721e bne r2,r16,eb0 <_malloc_r+0x6c> 10e8: 9c000417 ldw r16,16(r19) 10ec: 02400034 movhi r9,0 10f0: 4a56fe04 addi r9,r9,23544 10f4: 827fa11e bne r16,r9,f7c <_malloc_r+0x138> 10f8: 3807d0ba srai r3,r7,2 10fc: 01000044 movi r4,1 1100: 98800117 ldw r2,4(r19) 1104: 20c8983a sll r4,r4,r3 1108: 113fbb2e bgeu r2,r4,ff8 <_malloc_r+0x1b4> 110c: 9c000217 ldw r16,8(r19) 1110: 00bfff04 movi r2,-4 1114: 85400117 ldw r21,4(r16) 1118: a8ac703a and r22,r21,r2 111c: b4400336 bltu r22,r17,112c <_malloc_r+0x2e8> 1120: b445c83a sub r2,r22,r17 1124: 10c00408 cmpgei r3,r2,16 1128: 1800541e bne r3,zero,127c <_malloc_r+0x438> 112c: 00800034 movhi r2,0 1130: 109c8217 ldw r2,29192(r2) 1134: 00c00034 movhi r3,0 1138: 1d5c9017 ldw r21,29248(r3) 113c: 10bfffd8 cmpnei r2,r2,-1 1140: 85b9883a add fp,r16,r22 1144: 8d6b883a add r21,r17,r21 1148: 1000d626 beq r2,zero,14a4 <_malloc_r+0x660> 114c: ad4403c4 addi r21,r21,4111 1150: 00bc0004 movi r2,-4096 1154: a8aa703a and r21,r21,r2 1158: a80b883a mov r5,r21 115c: 9009883a mov r4,r18 1160: 0001f740 call 1f74 <_sbrk_r> 1164: 102f883a mov r23,r2 1168: 10bfffd8 cmpnei r2,r2,-1 116c: 1000a826 beq r2,zero,1410 <_malloc_r+0x5cc> 1170: bf00a636 bltu r23,fp,140c <_malloc_r+0x5c8> 1174: 00800034 movhi r2,0 1178: 151c9917 ldw r20,29284(r2) 117c: ad29883a add r20,r21,r20 1180: 151c9915 stw r20,29284(r2) 1184: a007883a mov r3,r20 1188: e5c0ec26 beq fp,r23,153c <_malloc_r+0x6f8> 118c: 00800034 movhi r2,0 1190: 109c8217 ldw r2,29192(r2) 1194: 10bfffd8 cmpnei r2,r2,-1 1198: 1000ef26 beq r2,zero,1558 <_malloc_r+0x714> 119c: bf39c83a sub fp,r23,fp 11a0: e0c7883a add r3,fp,r3 11a4: 00800034 movhi r2,0 11a8: 10dc9915 stw r3,29284(r2) 11ac: bf0001cc andi fp,r23,7 11b0: e000c526 beq fp,zero,14c8 <_malloc_r+0x684> 11b4: bf2fc83a sub r23,r23,fp 11b8: bdc00204 addi r23,r23,8 11bc: 05040204 movi r20,4104 11c0: a729c83a sub r20,r20,fp 11c4: bd6b883a add r21,r23,r21 11c8: a569c83a sub r20,r20,r21 11cc: a503ffcc andi r20,r20,4095 11d0: a00b883a mov r5,r20 11d4: 9009883a mov r4,r18 11d8: 0001f740 call 1f74 <_sbrk_r> 11dc: 10ffffe0 cmpeqi r3,r2,-1 11e0: 1800f31e bne r3,zero,15b0 <_malloc_r+0x76c> 11e4: 15c5c83a sub r2,r2,r23 11e8: 152b883a add r21,r2,r20 11ec: 00800034 movhi r2,0 11f0: 115c9917 ldw r5,29284(r2) 11f4: 9dc00215 stw r23,8(r19) 11f8: ad400054 ori r21,r21,1 11fc: a169883a add r20,r20,r5 1200: 151c9915 stw r20,29284(r2) 1204: bd400115 stw r21,4(r23) 1208: 84c0d626 beq r16,r19,1564 <_malloc_r+0x720> 120c: b0800428 cmpgeui r2,r22,16 1210: 1000d626 beq r2,zero,156c <_malloc_r+0x728> 1214: 80c00117 ldw r3,4(r16) 1218: 013ffe04 movi r4,-8 121c: b0bffd04 addi r2,r22,-12 1220: 1104703a and r2,r2,r4 1224: 18c0004c andi r3,r3,1 1228: 1886b03a or r3,r3,r2 122c: 80c00115 stw r3,4(r16) 1230: 01000144 movi r4,5 1234: 8087883a add r3,r16,r2 1238: 19000115 stw r4,4(r3) 123c: 19000215 stw r4,8(r3) 1240: 10800428 cmpgeui r2,r2,16 1244: 1000df1e bne r2,zero,15c4 <_malloc_r+0x780> 1248: bd400117 ldw r21,4(r23) 124c: b821883a mov r16,r23 1250: 00800034 movhi r2,0 1254: 109c8f17 ldw r2,29244(r2) 1258: 1500022e bgeu r2,r20,1264 <_malloc_r+0x420> 125c: 00800034 movhi r2,0 1260: 151c8f15 stw r20,29244(r2) 1264: 00800034 movhi r2,0 1268: 109c8e17 ldw r2,29240(r2) 126c: 15006a2e bgeu r2,r20,1418 <_malloc_r+0x5d4> 1270: 00800034 movhi r2,0 1274: 151c8e15 stw r20,29240(r2) 1278: 00006706 br 1418 <_malloc_r+0x5d4> 127c: 88c00054 ori r3,r17,1 1280: 80c00115 stw r3,4(r16) 1284: 8463883a add r17,r16,r17 1288: 10800054 ori r2,r2,1 128c: 9c400215 stw r17,8(r19) 1290: 88800115 stw r2,4(r17) 1294: 9009883a mov r4,r18 1298: 00036a00 call 36a0 <__malloc_unlock> 129c: 80800204 addi r2,r16,8 12a0: 003f7e06 br 109c <_malloc_r+0x258> 12a4: 81000317 ldw r4,12(r16) 12a8: 003f0506 br ec0 <_malloc_r+0x7c> 12ac: 1006d27a srli r3,r2,9 12b0: 19000168 cmpgeui r4,r3,5 12b4: 20005026 beq r4,zero,13f8 <_malloc_r+0x5b4> 12b8: 19000568 cmpgeui r4,r3,21 12bc: 20008c1e bne r4,zero,14f0 <_malloc_r+0x6ac> 12c0: 19401704 addi r5,r3,92 12c4: 280a90fa slli r5,r5,3 12c8: 190016c4 addi r4,r3,91 12cc: 994b883a add r5,r19,r5 12d0: 28c00017 ldw r3,0(r5) 12d4: 297ffe04 addi r5,r5,-8 12d8: 28c07426 beq r5,r3,14ac <_malloc_r+0x668> 12dc: 01bfff04 movi r6,-4 12e0: 19000117 ldw r4,4(r3) 12e4: 2188703a and r4,r4,r6 12e8: 1100022e bgeu r2,r4,12f4 <_malloc_r+0x4b0> 12ec: 18c00217 ldw r3,8(r3) 12f0: 28fffb1e bne r5,r3,12e0 <_malloc_r+0x49c> 12f4: 19400317 ldw r5,12(r3) 12f8: 98800117 ldw r2,4(r19) 12fc: 81400315 stw r5,12(r16) 1300: 80c00215 stw r3,8(r16) 1304: 2c000215 stw r16,8(r5) 1308: 1c000315 stw r16,12(r3) 130c: 003f3606 br fe8 <_malloc_r+0x1a4> 1310: 10c00568 cmpgeui r3,r2,21 1314: 18004a26 beq r3,zero,1440 <_malloc_r+0x5fc> 1318: 10c01568 cmpgeui r3,r2,85 131c: 18007b1e bne r3,zero,150c <_malloc_r+0x6c8> 1320: 8804d33a srli r2,r17,12 1324: 11c01bc4 addi r7,r2,111 1328: 380890fa slli r4,r7,3 132c: 12001b84 addi r8,r2,110 1330: 003efd06 br f28 <_malloc_r+0xe4> 1334: 63000044 addi r12,r12,1 1338: 608000cc andi r2,r12,3 133c: 42000204 addi r8,r8,8 1340: 103f3e1e bne r2,zero,103c <_malloc_r+0x1f8> 1344: 00004506 br 145c <_malloc_r+0x618> 1348: 81000217 ldw r4,8(r16) 134c: 89800054 ori r6,r17,1 1350: 81800115 stw r6,4(r16) 1354: 20800315 stw r2,12(r4) 1358: 11000215 stw r4,8(r2) 135c: 8463883a add r17,r16,r17 1360: 9c400515 stw r17,20(r19) 1364: 9c400415 stw r17,16(r19) 1368: 28800054 ori r2,r5,1 136c: 88800115 stw r2,4(r17) 1370: 8a400315 stw r9,12(r17) 1374: 8a400215 stw r9,8(r17) 1378: 80c7883a add r3,r16,r3 137c: 19400015 stw r5,0(r3) 1380: 9009883a mov r4,r18 1384: 00036a00 call 36a0 <__malloc_unlock> 1388: 80800204 addi r2,r16,8 138c: 003f4306 br 109c <_malloc_r+0x258> 1390: 880ed0fa srli r7,r17,3 1394: 88800204 addi r2,r17,8 1398: 003ebf06 br e98 <_malloc_r+0x54> 139c: 8085883a add r2,r16,r2 13a0: 10c00117 ldw r3,4(r2) 13a4: 9009883a mov r4,r18 13a8: 18c00054 ori r3,r3,1 13ac: 10c00115 stw r3,4(r2) 13b0: 00036a00 call 36a0 <__malloc_unlock> 13b4: 80800204 addi r2,r16,8 13b8: 003f3806 br 109c <_malloc_r+0x258> 13bc: 89000054 ori r4,r17,1 13c0: 81000115 stw r4,4(r16) 13c4: 8463883a add r17,r16,r17 13c8: 9c400515 stw r17,20(r19) 13cc: 9c400415 stw r17,16(r19) 13d0: 19000054 ori r4,r3,1 13d4: 89000115 stw r4,4(r17) 13d8: 8085883a add r2,r16,r2 13dc: 8a400315 stw r9,12(r17) 13e0: 8a400215 stw r9,8(r17) 13e4: 10c00015 stw r3,0(r2) 13e8: 9009883a mov r4,r18 13ec: 00036a00 call 36a0 <__malloc_unlock> 13f0: 80800204 addi r2,r16,8 13f4: 003f2906 br 109c <_malloc_r+0x258> 13f8: 1006d1ba srli r3,r2,6 13fc: 19400e44 addi r5,r3,57 1400: 280a90fa slli r5,r5,3 1404: 19000e04 addi r4,r3,56 1408: 003fb006 br 12cc <_malloc_r+0x488> 140c: 84c04626 beq r16,r19,1528 <_malloc_r+0x6e4> 1410: 9c000217 ldw r16,8(r19) 1414: 85400117 ldw r21,4(r16) 1418: 00bfff04 movi r2,-4 141c: a8aa703a and r21,r21,r2 1420: ac45c83a sub r2,r21,r17 1424: ac400236 bltu r21,r17,1430 <_malloc_r+0x5ec> 1428: 10c00408 cmpgei r3,r2,16 142c: 183f931e bne r3,zero,127c <_malloc_r+0x438> 1430: 9009883a mov r4,r18 1434: 00036a00 call 36a0 <__malloc_unlock> 1438: 0005883a mov r2,zero 143c: 003f1706 br 109c <_malloc_r+0x258> 1440: 11c01704 addi r7,r2,92 1444: 380890fa slli r4,r7,3 1448: 120016c4 addi r8,r2,91 144c: 003eb606 br f28 <_malloc_r+0xe4> 1450: 58800217 ldw r2,8(r11) 1454: 39ffffc4 addi r7,r7,-1 1458: 12c0701e bne r2,r11,161c <_malloc_r+0x7d8> 145c: 388000cc andi r2,r7,3 1460: 5afffe04 addi r11,r11,-8 1464: 103ffa1e bne r2,zero,1450 <_malloc_r+0x60c> 1468: 98c00117 ldw r3,4(r19) 146c: 0104303a nor r2,zero,r4 1470: 10c4703a and r2,r2,r3 1474: 98800115 stw r2,4(r19) 1478: 2109883a add r4,r4,r4 147c: 113f2336 bltu r2,r4,110c <_malloc_r+0x2c8> 1480: 203f2226 beq r4,zero,110c <_malloc_r+0x2c8> 1484: 2086703a and r3,r4,r2 1488: 1800041e bne r3,zero,149c <_malloc_r+0x658> 148c: 2109883a add r4,r4,r4 1490: 2086703a and r3,r4,r2 1494: 63000104 addi r12,r12,4 1498: 183ffc26 beq r3,zero,148c <_malloc_r+0x648> 149c: 600f883a mov r7,r12 14a0: 003ee206 br 102c <_malloc_r+0x1e8> 14a4: ad400404 addi r21,r21,16 14a8: 003f2b06 br 1158 <_malloc_r+0x314> 14ac: 2009d0ba srai r4,r4,2 14b0: 00800044 movi r2,1 14b4: 99800117 ldw r6,4(r19) 14b8: 1104983a sll r2,r2,r4 14bc: 1184b03a or r2,r2,r6 14c0: 98800115 stw r2,4(r19) 14c4: 003f8d06 br 12fc <_malloc_r+0x4b8> 14c8: bd69883a add r20,r23,r21 14cc: 0529c83a sub r20,zero,r20 14d0: a503ffcc andi r20,r20,4095 14d4: a00b883a mov r5,r20 14d8: 9009883a mov r4,r18 14dc: 0001f740 call 1f74 <_sbrk_r> 14e0: 10ffffe0 cmpeqi r3,r2,-1 14e4: 183f3f26 beq r3,zero,11e4 <_malloc_r+0x3a0> 14e8: 0029883a mov r20,zero 14ec: 003f3f06 br 11ec <_malloc_r+0x3a8> 14f0: 19001568 cmpgeui r4,r3,85 14f4: 2000201e bne r4,zero,1578 <_malloc_r+0x734> 14f8: 1006d33a srli r3,r2,12 14fc: 19401bc4 addi r5,r3,111 1500: 280a90fa slli r5,r5,3 1504: 19001b84 addi r4,r3,110 1508: 003f7006 br 12cc <_malloc_r+0x488> 150c: 10c05568 cmpgeui r3,r2,341 1510: 1800201e bne r3,zero,1594 <_malloc_r+0x750> 1514: 8804d3fa srli r2,r17,15 1518: 11c01e04 addi r7,r2,120 151c: 380890fa slli r4,r7,3 1520: 12001dc4 addi r8,r2,119 1524: 003e8006 br f28 <_malloc_r+0xe4> 1528: 00800034 movhi r2,0 152c: 10dc9917 ldw r3,29284(r2) 1530: a8c7883a add r3,r21,r3 1534: 10dc9915 stw r3,29284(r2) 1538: 003f1406 br 118c <_malloc_r+0x348> 153c: e083ffcc andi r2,fp,4095 1540: 103f121e bne r2,zero,118c <_malloc_r+0x348> 1544: 9c000217 ldw r16,8(r19) 1548: b56b883a add r21,r22,r21 154c: ad400054 ori r21,r21,1 1550: 85400115 stw r21,4(r16) 1554: 003f3e06 br 1250 <_malloc_r+0x40c> 1558: 00800034 movhi r2,0 155c: 15dc8215 stw r23,29192(r2) 1560: 003f1206 br 11ac <_malloc_r+0x368> 1564: b821883a mov r16,r23 1568: 003f3906 br 1250 <_malloc_r+0x40c> 156c: 00800044 movi r2,1 1570: b8800115 stw r2,4(r23) 1574: 003fae06 br 1430 <_malloc_r+0x5ec> 1578: 19005568 cmpgeui r4,r3,341 157c: 2000191e bne r4,zero,15e4 <_malloc_r+0x7a0> 1580: 1006d3fa srli r3,r2,15 1584: 19401e04 addi r5,r3,120 1588: 280a90fa slli r5,r5,3 158c: 19001dc4 addi r4,r3,119 1590: 003f4e06 br 12cc <_malloc_r+0x488> 1594: 10815568 cmpgeui r2,r2,1365 1598: 1000191e bne r2,zero,1600 <_malloc_r+0x7bc> 159c: 8804d4ba srli r2,r17,18 15a0: 11c01f44 addi r7,r2,125 15a4: 380890fa slli r4,r7,3 15a8: 12001f04 addi r8,r2,124 15ac: 003e5e06 br f28 <_malloc_r+0xe4> 15b0: e73ffe04 addi fp,fp,-8 15b4: af2b883a add r21,r21,fp 15b8: adebc83a sub r21,r21,r23 15bc: 0029883a mov r20,zero 15c0: 003f0a06 br 11ec <_malloc_r+0x3a8> 15c4: 81400204 addi r5,r16,8 15c8: 9009883a mov r4,r18 15cc: 00028f40 call 28f4 <_free_r> 15d0: 9c000217 ldw r16,8(r19) 15d4: 00800034 movhi r2,0 15d8: 151c9917 ldw r20,29284(r2) 15dc: 85400117 ldw r21,4(r16) 15e0: 003f1b06 br 1250 <_malloc_r+0x40c> 15e4: 18c15568 cmpgeui r3,r3,1365 15e8: 1800091e bne r3,zero,1610 <_malloc_r+0x7cc> 15ec: 1006d4ba srli r3,r2,18 15f0: 19401f44 addi r5,r3,125 15f4: 280a90fa slli r5,r5,3 15f8: 19001f04 addi r4,r3,124 15fc: 003f3306 br 12cc <_malloc_r+0x488> 1600: 0100fe04 movi r4,1016 1604: 01c01fc4 movi r7,127 1608: 02001f84 movi r8,126 160c: 003e4606 br f28 <_malloc_r+0xe4> 1610: 0140fe04 movi r5,1016 1614: 01001f84 movi r4,126 1618: 003f2c06 br 12cc <_malloc_r+0x488> 161c: 98800117 ldw r2,4(r19) 1620: 003f9506 br 1478 <_malloc_r+0x634> 00001624 : 1624: 208000cc andi r2,r4,3 1628: 280f883a mov r7,r5 162c: 10000e26 beq r2,zero,1668 1630: 30bfffc4 addi r2,r6,-1 1634: 30001726 beq r6,zero,1694 1638: 29803fcc andi r6,r5,255 163c: 00000606 br 1658 1640: 21000044 addi r4,r4,1 1644: 20c000cc andi r3,r4,3 1648: 18000826 beq r3,zero,166c 164c: 10bfffc4 addi r2,r2,-1 1650: 10ffffe0 cmpeqi r3,r2,-1 1654: 18000f1e bne r3,zero,1694 1658: 20c00003 ldbu r3,0(r4) 165c: 19bff81e bne r3,r6,1640 1660: 2005883a mov r2,r4 1664: f800283a ret 1668: 3005883a mov r2,r6 166c: 10c00128 cmpgeui r3,r2,4 1670: 18000a1e bne r3,zero,169c 1674: 10001e26 beq r2,zero,16f0 1678: 2087883a add r3,r4,r2 167c: 39803fcc andi r6,r7,255 1680: 2005883a mov r2,r4 1684: 11000003 ldbu r4,0(r2) 1688: 21bff626 beq r4,r6,1664 168c: 10800044 addi r2,r2,1 1690: 18bffc1e bne r3,r2,1684 1694: 0005883a mov r2,zero 1698: f800283a ret 169c: 29403fcc andi r5,r5,255 16a0: 280c923a slli r6,r5,8 16a4: 027fbff4 movhi r9,65279 16a8: 02202074 movhi r8,32897 16ac: 314ab03a or r5,r6,r5 16b0: 280c943a slli r6,r5,16 16b4: 4a7fbfc4 addi r9,r9,-257 16b8: 42202004 addi r8,r8,-32640 16bc: 314cb03a or r6,r6,r5 16c0: 20c00017 ldw r3,0(r4) 16c4: 30c6f03a xor r3,r6,r3 16c8: 1a4b883a add r5,r3,r9 16cc: 00c6303a nor r3,zero,r3 16d0: 28c6703a and r3,r5,r3 16d4: 1a06703a and r3,r3,r8 16d8: 183fe71e bne r3,zero,1678 16dc: 10bfff04 addi r2,r2,-4 16e0: 10c00128 cmpgeui r3,r2,4 16e4: 21000104 addi r4,r4,4 16e8: 183ff51e bne r3,zero,16c0 16ec: 003fe106 br 1674 16f0: f800283a ret 000016f4 : 16f4: 30c00430 cmpltui r3,r6,16 16f8: 2005883a mov r2,r4 16fc: 18002d1e bne r3,zero,17b4 1700: 2906b03a or r3,r5,r4 1704: 18c000cc andi r3,r3,3 1708: 1800351e bne r3,zero,17e0 170c: 32fffc04 addi r11,r6,-16 1710: 5816d13a srli r11,r11,4 1714: 280f883a mov r7,r5 1718: 2007883a mov r3,r4 171c: 5ac00044 addi r11,r11,1 1720: 5816913a slli r11,r11,4 1724: 22d5883a add r10,r4,r11 1728: 39000117 ldw r4,4(r7) 172c: 3a400017 ldw r9,0(r7) 1730: 3a000217 ldw r8,8(r7) 1734: 19000115 stw r4,4(r3) 1738: 39000317 ldw r4,12(r7) 173c: 1a400015 stw r9,0(r3) 1740: 1a000215 stw r8,8(r3) 1744: 19000315 stw r4,12(r3) 1748: 18c00404 addi r3,r3,16 174c: 39c00404 addi r7,r7,16 1750: 50fff51e bne r10,r3,1728 1754: 3100030c andi r4,r6,12 1758: 2acb883a add r5,r5,r11 175c: 320003cc andi r8,r6,15 1760: 20002226 beq r4,zero,17ec 1764: 280f883a mov r7,r5 1768: 1813883a mov r9,r3 176c: 39c00104 addi r7,r7,4 1770: 3abfff17 ldw r10,-4(r7) 1774: 41c9c83a sub r4,r8,r7 1778: 2909883a add r4,r5,r4 177c: 4a800015 stw r10,0(r9) 1780: 21000128 cmpgeui r4,r4,4 1784: 4a400104 addi r9,r9,4 1788: 203ff81e bne r4,zero,176c 178c: 413fff04 addi r4,r8,-4 1790: 2008d0ba srli r4,r4,2 1794: 318000cc andi r6,r6,3 1798: 31ffffc4 addi r7,r6,-1 179c: 21000044 addi r4,r4,1 17a0: 200890ba slli r4,r4,2 17a4: 1907883a add r3,r3,r4 17a8: 290b883a add r5,r5,r4 17ac: 3000041e bne r6,zero,17c0 17b0: f800283a ret 17b4: 2007883a mov r3,r4 17b8: 31ffffc4 addi r7,r6,-1 17bc: 303ffc26 beq r6,zero,17b0 17c0: 39c00044 addi r7,r7,1 17c4: 19cf883a add r7,r3,r7 17c8: 29800003 ldbu r6,0(r5) 17cc: 18c00044 addi r3,r3,1 17d0: 29400044 addi r5,r5,1 17d4: 19bfffc5 stb r6,-1(r3) 17d8: 38fffb1e bne r7,r3,17c8 17dc: f800283a ret 17e0: 31ffffc4 addi r7,r6,-1 17e4: 2007883a mov r3,r4 17e8: 003ff506 br 17c0 17ec: 400d883a mov r6,r8 17f0: 003ff106 br 17b8 000017f4 : 17f4: 2005883a mov r2,r4 17f8: 29000a2e bgeu r5,r4,1824 17fc: 2989883a add r4,r5,r6 1800: 1100082e bgeu r2,r4,1824 1804: 1187883a add r3,r2,r6 1808: 30003e26 beq r6,zero,1904 180c: 217fffc3 ldbu r5,-1(r4) 1810: 18ffffc4 addi r3,r3,-1 1814: 213fffc4 addi r4,r4,-1 1818: 19400005 stb r5,0(r3) 181c: 10fffb1e bne r2,r3,180c 1820: f800283a ret 1824: 30c00430 cmpltui r3,r6,16 1828: 18000b26 beq r3,zero,1858 182c: 1007883a mov r3,r2 1830: 31ffffc4 addi r7,r6,-1 1834: 30003726 beq r6,zero,1914 1838: 39c00044 addi r7,r7,1 183c: 29cf883a add r7,r5,r7 1840: 29800003 ldbu r6,0(r5) 1844: 29400044 addi r5,r5,1 1848: 18c00044 addi r3,r3,1 184c: 19bfffc5 stb r6,-1(r3) 1850: 29fffb1e bne r5,r7,1840 1854: f800283a ret 1858: 2886b03a or r3,r5,r2 185c: 18c000cc andi r3,r3,3 1860: 1800291e bne r3,zero,1908 1864: 327ffc04 addi r9,r6,-16 1868: 4812d13a srli r9,r9,4 186c: 280f883a mov r7,r5 1870: 1007883a mov r3,r2 1874: 4a400044 addi r9,r9,1 1878: 4812913a slli r9,r9,4 187c: 1251883a add r8,r2,r9 1880: 39000017 ldw r4,0(r7) 1884: 39c00404 addi r7,r7,16 1888: 18c00404 addi r3,r3,16 188c: 193ffc15 stw r4,-16(r3) 1890: 393ffd17 ldw r4,-12(r7) 1894: 193ffd15 stw r4,-12(r3) 1898: 393ffe17 ldw r4,-8(r7) 189c: 193ffe15 stw r4,-8(r3) 18a0: 393fff17 ldw r4,-4(r7) 18a4: 193fff15 stw r4,-4(r3) 18a8: 40fff51e bne r8,r3,1880 18ac: 3100030c andi r4,r6,12 18b0: 2a4b883a add r5,r5,r9 18b4: 320003cc andi r8,r6,15 18b8: 20001726 beq r4,zero,1918 18bc: 2813883a mov r9,r5 18c0: 180f883a mov r7,r3 18c4: 4a800017 ldw r10,0(r9) 18c8: 39c00104 addi r7,r7,4 18cc: 41c9c83a sub r4,r8,r7 18d0: 1909883a add r4,r3,r4 18d4: 21000128 cmpgeui r4,r4,4 18d8: 3abfff15 stw r10,-4(r7) 18dc: 4a400104 addi r9,r9,4 18e0: 203ff81e bne r4,zero,18c4 18e4: 413fff04 addi r4,r8,-4 18e8: 2008d0ba srli r4,r4,2 18ec: 318000cc andi r6,r6,3 18f0: 21000044 addi r4,r4,1 18f4: 200890ba slli r4,r4,2 18f8: 1907883a add r3,r3,r4 18fc: 290b883a add r5,r5,r4 1900: 003fcb06 br 1830 1904: f800283a ret 1908: 31ffffc4 addi r7,r6,-1 190c: 1007883a mov r3,r2 1910: 003fc906 br 1838 1914: f800283a ret 1918: 400d883a mov r6,r8 191c: 003fc406 br 1830 00001920 : 1920: 20c000cc andi r3,r4,3 1924: 2005883a mov r2,r4 1928: 18003626 beq r3,zero,1a04 192c: 31ffffc4 addi r7,r6,-1 1930: 30003326 beq r6,zero,1a00 1934: 2811883a mov r8,r5 1938: 2007883a mov r3,r4 193c: 00000306 br 194c 1940: 39ffffc4 addi r7,r7,-1 1944: 39bfffe0 cmpeqi r6,r7,-1 1948: 30002d1e bne r6,zero,1a00 194c: 18c00044 addi r3,r3,1 1950: 198000cc andi r6,r3,3 1954: 1a3fffc5 stb r8,-1(r3) 1958: 303ff91e bne r6,zero,1940 195c: 39000130 cmpltui r4,r7,4 1960: 2000221e bne r4,zero,19ec 1964: 29003fcc andi r4,r5,255 1968: 200c923a slli r6,r4,8 196c: 3a000430 cmpltui r8,r7,16 1970: 3108b03a or r4,r6,r4 1974: 200c943a slli r6,r4,16 1978: 310cb03a or r6,r6,r4 197c: 40000e1e bne r8,zero,19b8 1980: 393ffc04 addi r4,r7,-16 1984: 2008d13a srli r4,r4,4 1988: 21000044 addi r4,r4,1 198c: 2008913a slli r4,r4,4 1990: 1909883a add r4,r3,r4 1994: 19800015 stw r6,0(r3) 1998: 19800115 stw r6,4(r3) 199c: 19800215 stw r6,8(r3) 19a0: 19800315 stw r6,12(r3) 19a4: 18c00404 addi r3,r3,16 19a8: 20fffa1e bne r4,r3,1994 19ac: 3900030c andi r4,r7,12 19b0: 39c003cc andi r7,r7,15 19b4: 20000d26 beq r4,zero,19ec 19b8: 1811883a mov r8,r3 19bc: 42000104 addi r8,r8,4 19c0: 3a09c83a sub r4,r7,r8 19c4: 1909883a add r4,r3,r4 19c8: 21000128 cmpgeui r4,r4,4 19cc: 41bfff15 stw r6,-4(r8) 19d0: 203ffa1e bne r4,zero,19bc 19d4: 393fff04 addi r4,r7,-4 19d8: 2008d0ba srli r4,r4,2 19dc: 39c000cc andi r7,r7,3 19e0: 21000044 addi r4,r4,1 19e4: 200890ba slli r4,r4,2 19e8: 1907883a add r3,r3,r4 19ec: 38000426 beq r7,zero,1a00 19f0: 19cf883a add r7,r3,r7 19f4: 18c00044 addi r3,r3,1 19f8: 197fffc5 stb r5,-1(r3) 19fc: 38fffd1e bne r7,r3,19f4 1a00: f800283a ret 1a04: 2007883a mov r3,r4 1a08: 300f883a mov r7,r6 1a0c: 003fd306 br 195c 00001a10 <_realloc_r>: 1a10: defff504 addi sp,sp,-44 1a14: dc800315 stw r18,12(sp) 1a18: dfc00a15 stw ra,40(sp) 1a1c: df000915 stw fp,36(sp) 1a20: ddc00815 stw r23,32(sp) 1a24: dd800715 stw r22,28(sp) 1a28: dd400615 stw r21,24(sp) 1a2c: dd000515 stw r20,20(sp) 1a30: dcc00415 stw r19,16(sp) 1a34: dc400215 stw r17,8(sp) 1a38: dc000115 stw r16,4(sp) 1a3c: 3025883a mov r18,r6 1a40: 28008b26 beq r5,zero,1c70 <_realloc_r+0x260> 1a44: 2821883a mov r16,r5 1a48: 2027883a mov r19,r4 1a4c: 944002c4 addi r17,r18,11 1a50: 000367c0 call 367c <__malloc_lock> 1a54: 888005f0 cmpltui r2,r17,23 1a58: 1000521e bne r2,zero,1ba4 <_realloc_r+0x194> 1a5c: 017ffe04 movi r5,-8 1a60: 8962703a and r17,r17,r5 1a64: 8807883a mov r3,r17 1a68: 88005116 blt r17,zero,1bb0 <_realloc_r+0x1a0> 1a6c: 8c805036 bltu r17,r18,1bb0 <_realloc_r+0x1a0> 1a70: 80bfff17 ldw r2,-4(r16) 1a74: 017fff04 movi r5,-4 1a78: 857ffe04 addi r21,r16,-8 1a7c: 1168703a and r20,r2,r5 1a80: ad2d883a add r22,r21,r20 1a84: a0c0390e bge r20,r3,1b6c <_realloc_r+0x15c> 1a88: 07000034 movhi fp,0 1a8c: e716fc04 addi fp,fp,23536 1a90: e2000217 ldw r8,8(fp) 1a94: b1000117 ldw r4,4(r22) 1a98: 45808e26 beq r8,r22,1cd4 <_realloc_r+0x2c4> 1a9c: 01bfff84 movi r6,-2 1aa0: 218c703a and r6,r4,r6 1aa4: b18d883a add r6,r22,r6 1aa8: 31800117 ldw r6,4(r6) 1aac: 3180004c andi r6,r6,1 1ab0: 30004f1e bne r6,zero,1bf0 <_realloc_r+0x1e0> 1ab4: 2148703a and r4,r4,r5 1ab8: a10b883a add r5,r20,r4 1abc: 28c0bf0e bge r5,r3,1dbc <_realloc_r+0x3ac> 1ac0: 1080004c andi r2,r2,1 1ac4: 10004c1e bne r2,zero,1bf8 <_realloc_r+0x1e8> 1ac8: 81fffe17 ldw r7,-8(r16) 1acc: 00bfff04 movi r2,-4 1ad0: a9cfc83a sub r7,r21,r7 1ad4: 39400117 ldw r5,4(r7) 1ad8: 288a703a and r5,r5,r2 1adc: b0000426 beq r22,zero,1af0 <_realloc_r+0xe0> 1ae0: a16f883a add r23,r20,r5 1ae4: b92f883a add r23,r23,r4 1ae8: 4580bf26 beq r8,r22,1de8 <_realloc_r+0x3d8> 1aec: b8c0930e bge r23,r3,1d3c <_realloc_r+0x32c> 1af0: 38004126 beq r7,zero,1bf8 <_realloc_r+0x1e8> 1af4: a16f883a add r23,r20,r5 1af8: b8c03f16 blt r23,r3,1bf8 <_realloc_r+0x1e8> 1afc: 38800317 ldw r2,12(r7) 1b00: 38c00217 ldw r3,8(r7) 1b04: a1bfff04 addi r6,r20,-4 1b08: 31400968 cmpgeui r5,r6,37 1b0c: 18800315 stw r2,12(r3) 1b10: 10c00215 stw r3,8(r2) 1b14: 39000204 addi r4,r7,8 1b18: 3ded883a add r22,r7,r23 1b1c: 2800941e bne r5,zero,1d70 <_realloc_r+0x360> 1b20: 30800530 cmpltui r2,r6,20 1b24: 80c00017 ldw r3,0(r16) 1b28: 1000df1e bne r2,zero,1ea8 <_realloc_r+0x498> 1b2c: 38c00215 stw r3,8(r7) 1b30: 80c00117 ldw r3,4(r16) 1b34: 30800728 cmpgeui r2,r6,28 1b38: 38c00315 stw r3,12(r7) 1b3c: 1000dc1e bne r2,zero,1eb0 <_realloc_r+0x4a0> 1b40: 80c00217 ldw r3,8(r16) 1b44: 38800404 addi r2,r7,16 1b48: 84000204 addi r16,r16,8 1b4c: 10c00015 stw r3,0(r2) 1b50: 80c00117 ldw r3,4(r16) 1b54: b829883a mov r20,r23 1b58: 382b883a mov r21,r7 1b5c: 10c00115 stw r3,4(r2) 1b60: 80c00217 ldw r3,8(r16) 1b64: 2021883a mov r16,r4 1b68: 10c00215 stw r3,8(r2) 1b6c: a9800117 ldw r6,4(r21) 1b70: a445c83a sub r2,r20,r17 1b74: 10c00430 cmpltui r3,r2,16 1b78: 3180004c andi r6,r6,1 1b7c: 18004926 beq r3,zero,1ca4 <_realloc_r+0x294> 1b80: a18cb03a or r6,r20,r6 1b84: a9800115 stw r6,4(r21) 1b88: b0800117 ldw r2,4(r22) 1b8c: 10800054 ori r2,r2,1 1b90: b0800115 stw r2,4(r22) 1b94: 9809883a mov r4,r19 1b98: 00036a00 call 36a0 <__malloc_unlock> 1b9c: 8025883a mov r18,r16 1ba0: 00000606 br 1bbc <_realloc_r+0x1ac> 1ba4: 04400404 movi r17,16 1ba8: 00c00404 movi r3,16 1bac: 8cbfb02e bgeu r17,r18,1a70 <_realloc_r+0x60> 1bb0: 00800304 movi r2,12 1bb4: 98800015 stw r2,0(r19) 1bb8: 0025883a mov r18,zero 1bbc: 9005883a mov r2,r18 1bc0: dfc00a17 ldw ra,40(sp) 1bc4: df000917 ldw fp,36(sp) 1bc8: ddc00817 ldw r23,32(sp) 1bcc: dd800717 ldw r22,28(sp) 1bd0: dd400617 ldw r21,24(sp) 1bd4: dd000517 ldw r20,20(sp) 1bd8: dcc00417 ldw r19,16(sp) 1bdc: dc800317 ldw r18,12(sp) 1be0: dc400217 ldw r17,8(sp) 1be4: dc000117 ldw r16,4(sp) 1be8: dec00b04 addi sp,sp,44 1bec: f800283a ret 1bf0: 1080004c andi r2,r2,1 1bf4: 10006c26 beq r2,zero,1da8 <_realloc_r+0x398> 1bf8: 900b883a mov r5,r18 1bfc: 9809883a mov r4,r19 1c00: 0000e440 call e44 <_malloc_r> 1c04: 1025883a mov r18,r2 1c08: 10001626 beq r2,zero,1c64 <_realloc_r+0x254> 1c0c: 80bfff17 ldw r2,-4(r16) 1c10: 013fff84 movi r4,-2 1c14: 90fffe04 addi r3,r18,-8 1c18: 1104703a and r2,r2,r4 1c1c: a885883a add r2,r21,r2 1c20: 10c05b26 beq r2,r3,1d90 <_realloc_r+0x380> 1c24: a1bfff04 addi r6,r20,-4 1c28: 30800968 cmpgeui r2,r6,37 1c2c: 10006a1e bne r2,zero,1dd8 <_realloc_r+0x3c8> 1c30: 30800530 cmpltui r2,r6,20 1c34: 81000017 ldw r4,0(r16) 1c38: 10003726 beq r2,zero,1d18 <_realloc_r+0x308> 1c3c: 9005883a mov r2,r18 1c40: 8007883a mov r3,r16 1c44: 11000015 stw r4,0(r2) 1c48: 19000117 ldw r4,4(r3) 1c4c: 11000115 stw r4,4(r2) 1c50: 18c00217 ldw r3,8(r3) 1c54: 10c00215 stw r3,8(r2) 1c58: 800b883a mov r5,r16 1c5c: 9809883a mov r4,r19 1c60: 00028f40 call 28f4 <_free_r> 1c64: 9809883a mov r4,r19 1c68: 00036a00 call 36a0 <__malloc_unlock> 1c6c: 003fd306 br 1bbc <_realloc_r+0x1ac> 1c70: 300b883a mov r5,r6 1c74: dfc00a17 ldw ra,40(sp) 1c78: df000917 ldw fp,36(sp) 1c7c: ddc00817 ldw r23,32(sp) 1c80: dd800717 ldw r22,28(sp) 1c84: dd400617 ldw r21,24(sp) 1c88: dd000517 ldw r20,20(sp) 1c8c: dcc00417 ldw r19,16(sp) 1c90: dc800317 ldw r18,12(sp) 1c94: dc400217 ldw r17,8(sp) 1c98: dc000117 ldw r16,4(sp) 1c9c: dec00b04 addi sp,sp,44 1ca0: 0000e441 jmpi e44 <_malloc_r> 1ca4: 344cb03a or r6,r6,r17 1ca8: a9800115 stw r6,4(r21) 1cac: ac4b883a add r5,r21,r17 1cb0: 10800054 ori r2,r2,1 1cb4: 28800115 stw r2,4(r5) 1cb8: b0800117 ldw r2,4(r22) 1cbc: 29400204 addi r5,r5,8 1cc0: 9809883a mov r4,r19 1cc4: 10800054 ori r2,r2,1 1cc8: b0800115 stw r2,4(r22) 1ccc: 00028f40 call 28f4 <_free_r> 1cd0: 003fb006 br 1b94 <_realloc_r+0x184> 1cd4: 2148703a and r4,r4,r5 1cd8: a10b883a add r5,r20,r4 1cdc: 89800404 addi r6,r17,16 1ce0: 29bf7716 blt r5,r6,1ac0 <_realloc_r+0xb0> 1ce4: ac6b883a add r21,r21,r17 1ce8: 2c45c83a sub r2,r5,r17 1cec: e5400215 stw r21,8(fp) 1cf0: 10800054 ori r2,r2,1 1cf4: a8800115 stw r2,4(r21) 1cf8: 80bfff17 ldw r2,-4(r16) 1cfc: 9809883a mov r4,r19 1d00: 8025883a mov r18,r16 1d04: 1080004c andi r2,r2,1 1d08: 1462b03a or r17,r2,r17 1d0c: 847fff15 stw r17,-4(r16) 1d10: 00036a00 call 36a0 <__malloc_unlock> 1d14: 003fa906 br 1bbc <_realloc_r+0x1ac> 1d18: 91000015 stw r4,0(r18) 1d1c: 80c00117 ldw r3,4(r16) 1d20: 30800728 cmpgeui r2,r6,28 1d24: 90c00115 stw r3,4(r18) 1d28: 1000551e bne r2,zero,1e80 <_realloc_r+0x470> 1d2c: 81000217 ldw r4,8(r16) 1d30: 80c00204 addi r3,r16,8 1d34: 90800204 addi r2,r18,8 1d38: 003fc206 br 1c44 <_realloc_r+0x234> 1d3c: b0800317 ldw r2,12(r22) 1d40: b0c00217 ldw r3,8(r22) 1d44: a1bfff04 addi r6,r20,-4 1d48: 31400968 cmpgeui r5,r6,37 1d4c: 18800315 stw r2,12(r3) 1d50: 10c00215 stw r3,8(r2) 1d54: 38c00217 ldw r3,8(r7) 1d58: 38800317 ldw r2,12(r7) 1d5c: 39000204 addi r4,r7,8 1d60: 3ded883a add r22,r7,r23 1d64: 18800315 stw r2,12(r3) 1d68: 10c00215 stw r3,8(r2) 1d6c: 283f6c26 beq r5,zero,1b20 <_realloc_r+0x110> 1d70: 800b883a mov r5,r16 1d74: d9c00015 stw r7,0(sp) 1d78: 00017f40 call 17f4 1d7c: d9c00017 ldw r7,0(sp) 1d80: 1021883a mov r16,r2 1d84: b829883a mov r20,r23 1d88: 382b883a mov r21,r7 1d8c: 003f7706 br 1b6c <_realloc_r+0x15c> 1d90: 90bfff17 ldw r2,-4(r18) 1d94: 00ffff04 movi r3,-4 1d98: 10c4703a and r2,r2,r3 1d9c: a0a9883a add r20,r20,r2 1da0: ad2d883a add r22,r21,r20 1da4: 003f7106 br 1b6c <_realloc_r+0x15c> 1da8: 81fffe17 ldw r7,-8(r16) 1dac: a9cfc83a sub r7,r21,r7 1db0: 38800117 ldw r2,4(r7) 1db4: 114a703a and r5,r2,r5 1db8: 003f4d06 br 1af0 <_realloc_r+0xe0> 1dbc: b0800317 ldw r2,12(r22) 1dc0: b0c00217 ldw r3,8(r22) 1dc4: 2829883a mov r20,r5 1dc8: a96d883a add r22,r21,r5 1dcc: 18800315 stw r2,12(r3) 1dd0: 10c00215 stw r3,8(r2) 1dd4: 003f6506 br 1b6c <_realloc_r+0x15c> 1dd8: 800b883a mov r5,r16 1ddc: 9009883a mov r4,r18 1de0: 00017f40 call 17f4 1de4: 003f9c06 br 1c58 <_realloc_r+0x248> 1de8: 88800404 addi r2,r17,16 1dec: b8bf4016 blt r23,r2,1af0 <_realloc_r+0xe0> 1df0: 38800317 ldw r2,12(r7) 1df4: 38c00217 ldw r3,8(r7) 1df8: a1bfff04 addi r6,r20,-4 1dfc: 31000968 cmpgeui r4,r6,37 1e00: 18800315 stw r2,12(r3) 1e04: 10c00215 stw r3,8(r2) 1e08: 3c800204 addi r18,r7,8 1e0c: 20003b1e bne r4,zero,1efc <_realloc_r+0x4ec> 1e10: 30800530 cmpltui r2,r6,20 1e14: 80c00017 ldw r3,0(r16) 1e18: 1000361e bne r2,zero,1ef4 <_realloc_r+0x4e4> 1e1c: 38c00215 stw r3,8(r7) 1e20: 80c00117 ldw r3,4(r16) 1e24: 30800728 cmpgeui r2,r6,28 1e28: 38c00315 stw r3,12(r7) 1e2c: 1000401e bne r2,zero,1f30 <_realloc_r+0x520> 1e30: 80c00217 ldw r3,8(r16) 1e34: 38800404 addi r2,r7,16 1e38: 84000204 addi r16,r16,8 1e3c: 10c00015 stw r3,0(r2) 1e40: 80c00117 ldw r3,4(r16) 1e44: 10c00115 stw r3,4(r2) 1e48: 80c00217 ldw r3,8(r16) 1e4c: 10c00215 stw r3,8(r2) 1e50: 3c47883a add r3,r7,r17 1e54: bc45c83a sub r2,r23,r17 1e58: e0c00215 stw r3,8(fp) 1e5c: 10800054 ori r2,r2,1 1e60: 18800115 stw r2,4(r3) 1e64: 38800117 ldw r2,4(r7) 1e68: 9809883a mov r4,r19 1e6c: 1080004c andi r2,r2,1 1e70: 1462b03a or r17,r2,r17 1e74: 3c400115 stw r17,4(r7) 1e78: 00036a00 call 36a0 <__malloc_unlock> 1e7c: 003f4f06 br 1bbc <_realloc_r+0x1ac> 1e80: 80800217 ldw r2,8(r16) 1e84: 31800920 cmpeqi r6,r6,36 1e88: 90800215 stw r2,8(r18) 1e8c: 80800317 ldw r2,12(r16) 1e90: 90800315 stw r2,12(r18) 1e94: 81000417 ldw r4,16(r16) 1e98: 30000f1e bne r6,zero,1ed8 <_realloc_r+0x4c8> 1e9c: 80c00404 addi r3,r16,16 1ea0: 90800404 addi r2,r18,16 1ea4: 003f6706 br 1c44 <_realloc_r+0x234> 1ea8: 2005883a mov r2,r4 1eac: 003f2706 br 1b4c <_realloc_r+0x13c> 1eb0: 80800217 ldw r2,8(r16) 1eb4: 31800920 cmpeqi r6,r6,36 1eb8: 38800415 stw r2,16(r7) 1ebc: 80800317 ldw r2,12(r16) 1ec0: 38800515 stw r2,20(r7) 1ec4: 80c00417 ldw r3,16(r16) 1ec8: 3000121e bne r6,zero,1f14 <_realloc_r+0x504> 1ecc: 38800604 addi r2,r7,24 1ed0: 84000404 addi r16,r16,16 1ed4: 003f1d06 br 1b4c <_realloc_r+0x13c> 1ed8: 91000415 stw r4,16(r18) 1edc: 81000517 ldw r4,20(r16) 1ee0: 80c00604 addi r3,r16,24 1ee4: 90800604 addi r2,r18,24 1ee8: 91000515 stw r4,20(r18) 1eec: 81000617 ldw r4,24(r16) 1ef0: 003f5406 br 1c44 <_realloc_r+0x234> 1ef4: 9005883a mov r2,r18 1ef8: 003fd006 br 1e3c <_realloc_r+0x42c> 1efc: 800b883a mov r5,r16 1f00: 9009883a mov r4,r18 1f04: d9c00015 stw r7,0(sp) 1f08: 00017f40 call 17f4 1f0c: d9c00017 ldw r7,0(sp) 1f10: 003fcf06 br 1e50 <_realloc_r+0x440> 1f14: 84000604 addi r16,r16,24 1f18: 38c00615 stw r3,24(r7) 1f1c: 80ffff17 ldw r3,-4(r16) 1f20: 38800804 addi r2,r7,32 1f24: 38c00715 stw r3,28(r7) 1f28: 80c00017 ldw r3,0(r16) 1f2c: 003f0706 br 1b4c <_realloc_r+0x13c> 1f30: 80800217 ldw r2,8(r16) 1f34: 31800920 cmpeqi r6,r6,36 1f38: 38800415 stw r2,16(r7) 1f3c: 80800317 ldw r2,12(r16) 1f40: 38800515 stw r2,20(r7) 1f44: 80c00417 ldw r3,16(r16) 1f48: 3000031e bne r6,zero,1f58 <_realloc_r+0x548> 1f4c: 38800604 addi r2,r7,24 1f50: 84000404 addi r16,r16,16 1f54: 003fb906 br 1e3c <_realloc_r+0x42c> 1f58: 84000604 addi r16,r16,24 1f5c: 38c00615 stw r3,24(r7) 1f60: 80ffff17 ldw r3,-4(r16) 1f64: 38800804 addi r2,r7,32 1f68: 38c00715 stw r3,28(r7) 1f6c: 80c00017 ldw r3,0(r16) 1f70: 003fb206 br 1e3c <_realloc_r+0x42c> 00001f74 <_sbrk_r>: 1f74: defffe04 addi sp,sp,-8 1f78: dc000015 stw r16,0(sp) 1f7c: 00800034 movhi r2,0 1f80: 2021883a mov r16,r4 1f84: 2809883a mov r4,r5 1f88: dfc00115 stw ra,4(sp) 1f8c: 101c9115 stw zero,29252(r2) 1f90: 00038780 call 3878 1f94: 10ffffd8 cmpnei r3,r2,-1 1f98: 18000426 beq r3,zero,1fac <_sbrk_r+0x38> 1f9c: dfc00117 ldw ra,4(sp) 1fa0: dc000017 ldw r16,0(sp) 1fa4: dec00204 addi sp,sp,8 1fa8: f800283a ret 1fac: 00c00034 movhi r3,0 1fb0: 18dc9117 ldw r3,29252(r3) 1fb4: 183ff926 beq r3,zero,1f9c <_sbrk_r+0x28> 1fb8: 80c00015 stw r3,0(r16) 1fbc: dfc00117 ldw ra,4(sp) 1fc0: dc000017 ldw r16,0(sp) 1fc4: dec00204 addi sp,sp,8 1fc8: f800283a ret 00001fcc <__sread>: 1fcc: defffe04 addi sp,sp,-8 1fd0: dc000015 stw r16,0(sp) 1fd4: 2821883a mov r16,r5 1fd8: 2940038f ldh r5,14(r5) 1fdc: dfc00115 stw ra,4(sp) 1fe0: 0002e9c0 call 2e9c <_read_r> 1fe4: 10000716 blt r2,zero,2004 <__sread+0x38> 1fe8: 80c01417 ldw r3,80(r16) 1fec: 1887883a add r3,r3,r2 1ff0: 80c01415 stw r3,80(r16) 1ff4: dfc00117 ldw ra,4(sp) 1ff8: dc000017 ldw r16,0(sp) 1ffc: dec00204 addi sp,sp,8 2000: f800283a ret 2004: 80c0030b ldhu r3,12(r16) 2008: 18fbffcc andi r3,r3,61439 200c: 80c0030d sth r3,12(r16) 2010: dfc00117 ldw ra,4(sp) 2014: dc000017 ldw r16,0(sp) 2018: dec00204 addi sp,sp,8 201c: f800283a ret 00002020 <__seofread>: 2020: 0005883a mov r2,zero 2024: f800283a ret 00002028 <__swrite>: 2028: 2880030b ldhu r2,12(r5) 202c: defffb04 addi sp,sp,-20 2030: dcc00315 stw r19,12(sp) 2034: dc800215 stw r18,8(sp) 2038: dc400115 stw r17,4(sp) 203c: dc000015 stw r16,0(sp) 2040: dfc00415 stw ra,16(sp) 2044: 10c0400c andi r3,r2,256 2048: 2821883a mov r16,r5 204c: 2023883a mov r17,r4 2050: 2940038f ldh r5,14(r5) 2054: 3025883a mov r18,r6 2058: 3827883a mov r19,r7 205c: 18000c1e bne r3,zero,2090 <__swrite+0x68> 2060: 10bbffcc andi r2,r2,61439 2064: 980f883a mov r7,r19 2068: 900d883a mov r6,r18 206c: 8809883a mov r4,r17 2070: 8080030d sth r2,12(r16) 2074: dfc00417 ldw ra,16(sp) 2078: dcc00317 ldw r19,12(sp) 207c: dc800217 ldw r18,8(sp) 2080: dc400117 ldw r17,4(sp) 2084: dc000017 ldw r16,0(sp) 2088: dec00504 addi sp,sp,20 208c: 000210c1 jmpi 210c <_write_r> 2090: 01c00084 movi r7,2 2094: 000d883a mov r6,zero 2098: 0002bf00 call 2bf0 <_lseek_r> 209c: 8080030b ldhu r2,12(r16) 20a0: 8140038f ldh r5,14(r16) 20a4: 003fee06 br 2060 <__swrite+0x38> 000020a8 <__sseek>: 20a8: defffe04 addi sp,sp,-8 20ac: dc000015 stw r16,0(sp) 20b0: 2821883a mov r16,r5 20b4: 2940038f ldh r5,14(r5) 20b8: dfc00115 stw ra,4(sp) 20bc: 0002bf00 call 2bf0 <_lseek_r> 20c0: 10ffffd8 cmpnei r3,r2,-1 20c4: 18000826 beq r3,zero,20e8 <__sseek+0x40> 20c8: 80c0030b ldhu r3,12(r16) 20cc: 80801415 stw r2,80(r16) 20d0: 18c40014 ori r3,r3,4096 20d4: 80c0030d sth r3,12(r16) 20d8: dfc00117 ldw ra,4(sp) 20dc: dc000017 ldw r16,0(sp) 20e0: dec00204 addi sp,sp,8 20e4: f800283a ret 20e8: 80c0030b ldhu r3,12(r16) 20ec: 18fbffcc andi r3,r3,61439 20f0: 80c0030d sth r3,12(r16) 20f4: dfc00117 ldw ra,4(sp) 20f8: dc000017 ldw r16,0(sp) 20fc: dec00204 addi sp,sp,8 2100: f800283a ret 00002104 <__sclose>: 2104: 2940038f ldh r5,14(r5) 2108: 00022d41 jmpi 22d4 <_close_r> 0000210c <_write_r>: 210c: 2807883a mov r3,r5 2110: defffe04 addi sp,sp,-8 2114: dc000015 stw r16,0(sp) 2118: 300b883a mov r5,r6 211c: 00800034 movhi r2,0 2120: 380d883a mov r6,r7 2124: 2021883a mov r16,r4 2128: 1809883a mov r4,r3 212c: dfc00115 stw ra,4(sp) 2130: 101c9115 stw zero,29252(r2) 2134: 000396c0 call 396c 2138: 10ffffd8 cmpnei r3,r2,-1 213c: 18000426 beq r3,zero,2150 <_write_r+0x44> 2140: dfc00117 ldw ra,4(sp) 2144: dc000017 ldw r16,0(sp) 2148: dec00204 addi sp,sp,8 214c: f800283a ret 2150: 00c00034 movhi r3,0 2154: 18dc9117 ldw r3,29252(r3) 2158: 183ff926 beq r3,zero,2140 <_write_r+0x34> 215c: 80c00015 stw r3,0(r16) 2160: dfc00117 ldw ra,4(sp) 2164: dc000017 ldw r16,0(sp) 2168: dec00204 addi sp,sp,8 216c: f800283a ret 00002170 <__swsetup_r>: 2170: 00800034 movhi r2,0 2174: 109c8117 ldw r2,29188(r2) 2178: defffd04 addi sp,sp,-12 217c: dc400115 stw r17,4(sp) 2180: dc000015 stw r16,0(sp) 2184: dfc00215 stw ra,8(sp) 2188: 2023883a mov r17,r4 218c: 2821883a mov r16,r5 2190: 10000226 beq r2,zero,219c <__swsetup_r+0x2c> 2194: 10c00e17 ldw r3,56(r2) 2198: 18001f26 beq r3,zero,2218 <__swsetup_r+0xa8> 219c: 8180030b ldhu r6,12(r16) 21a0: 30c0020c andi r3,r6,8 21a4: 3005883a mov r2,r6 21a8: 18002126 beq r3,zero,2230 <__swsetup_r+0xc0> 21ac: 80c00417 ldw r3,16(r16) 21b0: 18002826 beq r3,zero,2254 <__swsetup_r+0xe4> 21b4: 1100004c andi r4,r2,1 21b8: 20000b1e bne r4,zero,21e8 <__swsetup_r+0x78> 21bc: 1100008c andi r4,r2,2 21c0: 20002e1e bne r4,zero,227c <__swsetup_r+0x10c> 21c4: 81000517 ldw r4,20(r16) 21c8: 81000215 stw r4,8(r16) 21cc: 18000b26 beq r3,zero,21fc <__swsetup_r+0x8c> 21d0: 0005883a mov r2,zero 21d4: dfc00217 ldw ra,8(sp) 21d8: dc400117 ldw r17,4(sp) 21dc: dc000017 ldw r16,0(sp) 21e0: dec00304 addi sp,sp,12 21e4: f800283a ret 21e8: 81000517 ldw r4,20(r16) 21ec: 80000215 stw zero,8(r16) 21f0: 0109c83a sub r4,zero,r4 21f4: 81000615 stw r4,24(r16) 21f8: 183ff51e bne r3,zero,21d0 <__swsetup_r+0x60> 21fc: 10c0200c andi r3,r2,128 2200: 0005883a mov r2,zero 2204: 183ff326 beq r3,zero,21d4 <__swsetup_r+0x64> 2208: 31801014 ori r6,r6,64 220c: 8180030d sth r6,12(r16) 2210: 00bfffc4 movi r2,-1 2214: 003fef06 br 21d4 <__swsetup_r+0x64> 2218: 1009883a mov r4,r2 221c: 00007f40 call 7f4 <__sinit> 2220: 8180030b ldhu r6,12(r16) 2224: 30c0020c andi r3,r6,8 2228: 3005883a mov r2,r6 222c: 183fdf1e bne r3,zero,21ac <__swsetup_r+0x3c> 2230: 3080040c andi r2,r6,16 2234: 10002126 beq r2,zero,22bc <__swsetup_r+0x14c> 2238: 3080010c andi r2,r6,4 223c: 1000111e bne r2,zero,2284 <__swsetup_r+0x114> 2240: 80c00417 ldw r3,16(r16) 2244: 30800214 ori r2,r6,8 2248: 8080030d sth r2,12(r16) 224c: 100d883a mov r6,r2 2250: 183fd81e bne r3,zero,21b4 <__swsetup_r+0x44> 2254: 1100a00c andi r4,r2,640 2258: 21008020 cmpeqi r4,r4,512 225c: 203fd51e bne r4,zero,21b4 <__swsetup_r+0x44> 2260: 800b883a mov r5,r16 2264: 8809883a mov r4,r17 2268: 0002c540 call 2c54 <__smakebuf_r> 226c: 8180030b ldhu r6,12(r16) 2270: 80c00417 ldw r3,16(r16) 2274: 3005883a mov r2,r6 2278: 003fce06 br 21b4 <__swsetup_r+0x44> 227c: 0009883a mov r4,zero 2280: 003fd106 br 21c8 <__swsetup_r+0x58> 2284: 81400c17 ldw r5,48(r16) 2288: 28000626 beq r5,zero,22a4 <__swsetup_r+0x134> 228c: 80801004 addi r2,r16,64 2290: 28800326 beq r5,r2,22a0 <__swsetup_r+0x130> 2294: 8809883a mov r4,r17 2298: 00028f40 call 28f4 <_free_r> 229c: 8180030b ldhu r6,12(r16) 22a0: 80000c15 stw zero,48(r16) 22a4: 80c00417 ldw r3,16(r16) 22a8: 00bff6c4 movi r2,-37 22ac: 118c703a and r6,r2,r6 22b0: 80000115 stw zero,4(r16) 22b4: 80c00015 stw r3,0(r16) 22b8: 003fe206 br 2244 <__swsetup_r+0xd4> 22bc: 00800244 movi r2,9 22c0: 88800015 stw r2,0(r17) 22c4: 31801014 ori r6,r6,64 22c8: 8180030d sth r6,12(r16) 22cc: 00bfffc4 movi r2,-1 22d0: 003fc006 br 21d4 <__swsetup_r+0x64> 000022d4 <_close_r>: 22d4: defffe04 addi sp,sp,-8 22d8: dc000015 stw r16,0(sp) 22dc: 00800034 movhi r2,0 22e0: 2021883a mov r16,r4 22e4: 2809883a mov r4,r5 22e8: dfc00115 stw ra,4(sp) 22ec: 101c9115 stw zero,29252(r2) 22f0: 00031d00 call 31d0 22f4: 10ffffd8 cmpnei r3,r2,-1 22f8: 18000426 beq r3,zero,230c <_close_r+0x38> 22fc: dfc00117 ldw ra,4(sp) 2300: dc000017 ldw r16,0(sp) 2304: dec00204 addi sp,sp,8 2308: f800283a ret 230c: 00c00034 movhi r3,0 2310: 18dc9117 ldw r3,29252(r3) 2314: 183ff926 beq r3,zero,22fc <_close_r+0x28> 2318: 80c00015 stw r3,0(r16) 231c: dfc00117 ldw ra,4(sp) 2320: dc000017 ldw r16,0(sp) 2324: dec00204 addi sp,sp,8 2328: f800283a ret 0000232c <_fclose_r.part.0>: 232c: defffc04 addi sp,sp,-16 2330: dc800215 stw r18,8(sp) 2334: dc400115 stw r17,4(sp) 2338: dc000015 stw r16,0(sp) 233c: dfc00315 stw ra,12(sp) 2340: 2821883a mov r16,r5 2344: 2023883a mov r17,r4 2348: 00024cc0 call 24cc <__sflush_r> 234c: 80c00b17 ldw r3,44(r16) 2350: 1025883a mov r18,r2 2354: 18000426 beq r3,zero,2368 <_fclose_r.part.0+0x3c> 2358: 81400717 ldw r5,28(r16) 235c: 8809883a mov r4,r17 2360: 183ee83a callr r3 2364: 10001916 blt r2,zero,23cc <_fclose_r.part.0+0xa0> 2368: 8080030b ldhu r2,12(r16) 236c: 1080200c andi r2,r2,128 2370: 10001a1e bne r2,zero,23dc <_fclose_r.part.0+0xb0> 2374: 81400c17 ldw r5,48(r16) 2378: 28000526 beq r5,zero,2390 <_fclose_r.part.0+0x64> 237c: 80801004 addi r2,r16,64 2380: 28800226 beq r5,r2,238c <_fclose_r.part.0+0x60> 2384: 8809883a mov r4,r17 2388: 00028f40 call 28f4 <_free_r> 238c: 80000c15 stw zero,48(r16) 2390: 81401117 ldw r5,68(r16) 2394: 28000326 beq r5,zero,23a4 <_fclose_r.part.0+0x78> 2398: 8809883a mov r4,r17 239c: 00028f40 call 28f4 <_free_r> 23a0: 80001115 stw zero,68(r16) 23a4: 00008040 call 804 <__sfp_lock_acquire> 23a8: 8000030d sth zero,12(r16) 23ac: 00008080 call 808 <__sfp_lock_release> 23b0: 9005883a mov r2,r18 23b4: dfc00317 ldw ra,12(sp) 23b8: dc800217 ldw r18,8(sp) 23bc: dc400117 ldw r17,4(sp) 23c0: dc000017 ldw r16,0(sp) 23c4: dec00404 addi sp,sp,16 23c8: f800283a ret 23cc: 8080030b ldhu r2,12(r16) 23d0: 04bfffc4 movi r18,-1 23d4: 1080200c andi r2,r2,128 23d8: 103fe626 beq r2,zero,2374 <_fclose_r.part.0+0x48> 23dc: 81400417 ldw r5,16(r16) 23e0: 8809883a mov r4,r17 23e4: 00028f40 call 28f4 <_free_r> 23e8: 003fe206 br 2374 <_fclose_r.part.0+0x48> 000023ec <_fclose_r>: 23ec: 28001926 beq r5,zero,2454 <_fclose_r+0x68> 23f0: defffd04 addi sp,sp,-12 23f4: dc000115 stw r16,4(sp) 23f8: dfc00215 stw ra,8(sp) 23fc: 2021883a mov r16,r4 2400: 20000226 beq r4,zero,240c <_fclose_r+0x20> 2404: 20800e17 ldw r2,56(r4) 2408: 10000c26 beq r2,zero,243c <_fclose_r+0x50> 240c: 2880030f ldh r2,12(r5) 2410: 1000051e bne r2,zero,2428 <_fclose_r+0x3c> 2414: 0005883a mov r2,zero 2418: dfc00217 ldw ra,8(sp) 241c: dc000117 ldw r16,4(sp) 2420: dec00304 addi sp,sp,12 2424: f800283a ret 2428: 8009883a mov r4,r16 242c: dfc00217 ldw ra,8(sp) 2430: dc000117 ldw r16,4(sp) 2434: dec00304 addi sp,sp,12 2438: 000232c1 jmpi 232c <_fclose_r.part.0> 243c: d9400015 stw r5,0(sp) 2440: 00007f40 call 7f4 <__sinit> 2444: d9400017 ldw r5,0(sp) 2448: 2880030f ldh r2,12(r5) 244c: 103ff126 beq r2,zero,2414 <_fclose_r+0x28> 2450: 003ff506 br 2428 <_fclose_r+0x3c> 2454: 0005883a mov r2,zero 2458: f800283a ret 0000245c : 245c: 20000826 beq r4,zero,2480 2460: 00800034 movhi r2,0 2464: 200b883a mov r5,r4 2468: 111c8117 ldw r4,29188(r2) 246c: 20000226 beq r4,zero,2478 2470: 20800e17 ldw r2,56(r4) 2474: 10000526 beq r2,zero,248c 2478: 2880030f ldh r2,12(r5) 247c: 1000021e bne r2,zero,2488 2480: 0005883a mov r2,zero 2484: f800283a ret 2488: 000232c1 jmpi 232c <_fclose_r.part.0> 248c: defffd04 addi sp,sp,-12 2490: d9400115 stw r5,4(sp) 2494: d9000015 stw r4,0(sp) 2498: dfc00215 stw ra,8(sp) 249c: 00007f40 call 7f4 <__sinit> 24a0: d9400117 ldw r5,4(sp) 24a4: d9000017 ldw r4,0(sp) 24a8: 2880030f ldh r2,12(r5) 24ac: 10000326 beq r2,zero,24bc 24b0: dfc00217 ldw ra,8(sp) 24b4: dec00304 addi sp,sp,12 24b8: 000232c1 jmpi 232c <_fclose_r.part.0> 24bc: 0005883a mov r2,zero 24c0: dfc00217 ldw ra,8(sp) 24c4: dec00304 addi sp,sp,12 24c8: f800283a ret 000024cc <__sflush_r>: 24cc: 2880030b ldhu r2,12(r5) 24d0: defffb04 addi sp,sp,-20 24d4: dcc00315 stw r19,12(sp) 24d8: dc000015 stw r16,0(sp) 24dc: dfc00415 stw ra,16(sp) 24e0: dc800215 stw r18,8(sp) 24e4: dc400115 stw r17,4(sp) 24e8: 10c0020c andi r3,r2,8 24ec: 2821883a mov r16,r5 24f0: 2027883a mov r19,r4 24f4: 18003f1e bne r3,zero,25f4 <__sflush_r+0x128> 24f8: 28c00117 ldw r3,4(r5) 24fc: 10820014 ori r2,r2,2048 2500: 2880030d sth r2,12(r5) 2504: 00c0550e bge zero,r3,265c <__sflush_r+0x190> 2508: 82000a17 ldw r8,40(r16) 250c: 40003126 beq r8,zero,25d4 <__sflush_r+0x108> 2510: 9c400017 ldw r17,0(r19) 2514: 1104000c andi r4,r2,4096 2518: 98000015 stw zero,0(r19) 251c: 81400717 ldw r5,28(r16) 2520: 1007883a mov r3,r2 2524: 2000521e bne r4,zero,2670 <__sflush_r+0x1a4> 2528: 01c00044 movi r7,1 252c: 000d883a mov r6,zero 2530: 9809883a mov r4,r19 2534: 403ee83a callr r8 2538: 10ffffd8 cmpnei r3,r2,-1 253c: 18005826 beq r3,zero,26a0 <__sflush_r+0x1d4> 2540: 80c0030b ldhu r3,12(r16) 2544: 82000a17 ldw r8,40(r16) 2548: 81400717 ldw r5,28(r16) 254c: 18c0010c andi r3,r3,4 2550: 18000626 beq r3,zero,256c <__sflush_r+0xa0> 2554: 81000117 ldw r4,4(r16) 2558: 80c00c17 ldw r3,48(r16) 255c: 1105c83a sub r2,r2,r4 2560: 18000226 beq r3,zero,256c <__sflush_r+0xa0> 2564: 80c00f17 ldw r3,60(r16) 2568: 10c5c83a sub r2,r2,r3 256c: 100d883a mov r6,r2 2570: 000f883a mov r7,zero 2574: 9809883a mov r4,r19 2578: 403ee83a callr r8 257c: 10ffffd8 cmpnei r3,r2,-1 2580: 18003d1e bne r3,zero,2678 <__sflush_r+0x1ac> 2584: 99000017 ldw r4,0(r19) 2588: 80c0030b ldhu r3,12(r16) 258c: 20004e26 beq r4,zero,26c8 <__sflush_r+0x1fc> 2590: 21400760 cmpeqi r5,r4,29 2594: 2800021e bne r5,zero,25a0 <__sflush_r+0xd4> 2598: 210005a0 cmpeqi r4,r4,22 259c: 20002c26 beq r4,zero,2650 <__sflush_r+0x184> 25a0: 80800417 ldw r2,16(r16) 25a4: 18fdffcc andi r3,r3,63487 25a8: 80c0030d sth r3,12(r16) 25ac: 80000115 stw zero,4(r16) 25b0: 80800015 stw r2,0(r16) 25b4: 81400c17 ldw r5,48(r16) 25b8: 9c400015 stw r17,0(r19) 25bc: 28000526 beq r5,zero,25d4 <__sflush_r+0x108> 25c0: 80801004 addi r2,r16,64 25c4: 28800226 beq r5,r2,25d0 <__sflush_r+0x104> 25c8: 9809883a mov r4,r19 25cc: 00028f40 call 28f4 <_free_r> 25d0: 80000c15 stw zero,48(r16) 25d4: 0005883a mov r2,zero 25d8: dfc00417 ldw ra,16(sp) 25dc: dcc00317 ldw r19,12(sp) 25e0: dc800217 ldw r18,8(sp) 25e4: dc400117 ldw r17,4(sp) 25e8: dc000017 ldw r16,0(sp) 25ec: dec00504 addi sp,sp,20 25f0: f800283a ret 25f4: 2c800417 ldw r18,16(r5) 25f8: 903ff626 beq r18,zero,25d4 <__sflush_r+0x108> 25fc: 2c400017 ldw r17,0(r5) 2600: 108000cc andi r2,r2,3 2604: 2c800015 stw r18,0(r5) 2608: 8ca3c83a sub r17,r17,r18 260c: 1000161e bne r2,zero,2668 <__sflush_r+0x19c> 2610: 28800517 ldw r2,20(r5) 2614: 80800215 stw r2,8(r16) 2618: 04400316 blt zero,r17,2628 <__sflush_r+0x15c> 261c: 003fed06 br 25d4 <__sflush_r+0x108> 2620: 90a5883a add r18,r18,r2 2624: 047feb0e bge zero,r17,25d4 <__sflush_r+0x108> 2628: 80800917 ldw r2,36(r16) 262c: 81400717 ldw r5,28(r16) 2630: 880f883a mov r7,r17 2634: 900d883a mov r6,r18 2638: 9809883a mov r4,r19 263c: 103ee83a callr r2 2640: 88a3c83a sub r17,r17,r2 2644: 00bff616 blt zero,r2,2620 <__sflush_r+0x154> 2648: 80c0030b ldhu r3,12(r16) 264c: 00bfffc4 movi r2,-1 2650: 18c01014 ori r3,r3,64 2654: 80c0030d sth r3,12(r16) 2658: 003fdf06 br 25d8 <__sflush_r+0x10c> 265c: 28c00f17 ldw r3,60(r5) 2660: 00ffa916 blt zero,r3,2508 <__sflush_r+0x3c> 2664: 003fdb06 br 25d4 <__sflush_r+0x108> 2668: 0005883a mov r2,zero 266c: 003fe906 br 2614 <__sflush_r+0x148> 2670: 80801417 ldw r2,80(r16) 2674: 003fb506 br 254c <__sflush_r+0x80> 2678: 80c0030b ldhu r3,12(r16) 267c: 81000417 ldw r4,16(r16) 2680: 80000115 stw zero,4(r16) 2684: 197dffcc andi r5,r3,63487 2688: 8140030d sth r5,12(r16) 268c: 81000015 stw r4,0(r16) 2690: 18c4000c andi r3,r3,4096 2694: 183fc726 beq r3,zero,25b4 <__sflush_r+0xe8> 2698: 80801415 stw r2,80(r16) 269c: 003fc506 br 25b4 <__sflush_r+0xe8> 26a0: 98c00017 ldw r3,0(r19) 26a4: 183fa626 beq r3,zero,2540 <__sflush_r+0x74> 26a8: 19000760 cmpeqi r4,r3,29 26ac: 20000e1e bne r4,zero,26e8 <__sflush_r+0x21c> 26b0: 18c00598 cmpnei r3,r3,22 26b4: 18000c26 beq r3,zero,26e8 <__sflush_r+0x21c> 26b8: 80c0030b ldhu r3,12(r16) 26bc: 18c01014 ori r3,r3,64 26c0: 80c0030d sth r3,12(r16) 26c4: 003fc406 br 25d8 <__sflush_r+0x10c> 26c8: 81000417 ldw r4,16(r16) 26cc: 197dffcc andi r5,r3,63487 26d0: 8140030d sth r5,12(r16) 26d4: 80000115 stw zero,4(r16) 26d8: 81000015 stw r4,0(r16) 26dc: 18c4000c andi r3,r3,4096 26e0: 183fb426 beq r3,zero,25b4 <__sflush_r+0xe8> 26e4: 003fec06 br 2698 <__sflush_r+0x1cc> 26e8: 9c400015 stw r17,0(r19) 26ec: 0005883a mov r2,zero 26f0: 003fb906 br 25d8 <__sflush_r+0x10c> 000026f4 <_fflush_r>: 26f4: defffd04 addi sp,sp,-12 26f8: dc000115 stw r16,4(sp) 26fc: dfc00215 stw ra,8(sp) 2700: 2021883a mov r16,r4 2704: 20000226 beq r4,zero,2710 <_fflush_r+0x1c> 2708: 20800e17 ldw r2,56(r4) 270c: 10000726 beq r2,zero,272c <_fflush_r+0x38> 2710: 2880030f ldh r2,12(r5) 2714: 10000a1e bne r2,zero,2740 <_fflush_r+0x4c> 2718: 0005883a mov r2,zero 271c: dfc00217 ldw ra,8(sp) 2720: dc000117 ldw r16,4(sp) 2724: dec00304 addi sp,sp,12 2728: f800283a ret 272c: d9400015 stw r5,0(sp) 2730: 00007f40 call 7f4 <__sinit> 2734: d9400017 ldw r5,0(sp) 2738: 2880030f ldh r2,12(r5) 273c: 103ff626 beq r2,zero,2718 <_fflush_r+0x24> 2740: 8009883a mov r4,r16 2744: dfc00217 ldw ra,8(sp) 2748: dc000117 ldw r16,4(sp) 274c: dec00304 addi sp,sp,12 2750: 00024cc1 jmpi 24cc <__sflush_r> 00002754 : 2754: 20001726 beq r4,zero,27b4 2758: 00800034 movhi r2,0 275c: 200b883a mov r5,r4 2760: 111c8117 ldw r4,29188(r2) 2764: 20000226 beq r4,zero,2770 2768: 20800e17 ldw r2,56(r4) 276c: 10000526 beq r2,zero,2784 2770: 2880030f ldh r2,12(r5) 2774: 1000021e bne r2,zero,2780 2778: 0005883a mov r2,zero 277c: f800283a ret 2780: 00024cc1 jmpi 24cc <__sflush_r> 2784: defffd04 addi sp,sp,-12 2788: d9400115 stw r5,4(sp) 278c: d9000015 stw r4,0(sp) 2790: dfc00215 stw ra,8(sp) 2794: 00007f40 call 7f4 <__sinit> 2798: d9400117 ldw r5,4(sp) 279c: d9000017 ldw r4,0(sp) 27a0: 2880030f ldh r2,12(r5) 27a4: 10000826 beq r2,zero,27c8 27a8: dfc00217 ldw ra,8(sp) 27ac: dec00304 addi sp,sp,12 27b0: 00024cc1 jmpi 24cc <__sflush_r> 27b4: 00800034 movhi r2,0 27b8: 111c8017 ldw r4,29184(r2) 27bc: 01400034 movhi r5,0 27c0: 2949bd04 addi r5,r5,9972 27c4: 0000d9c1 jmpi d9c <_fwalk_reent> 27c8: 0005883a mov r2,zero 27cc: dfc00217 ldw ra,8(sp) 27d0: dec00304 addi sp,sp,12 27d4: f800283a ret 000027d8 <_malloc_trim_r>: 27d8: defffb04 addi sp,sp,-20 27dc: dcc00315 stw r19,12(sp) 27e0: 04c00034 movhi r19,0 27e4: dc800215 stw r18,8(sp) 27e8: dc400115 stw r17,4(sp) 27ec: dc000015 stw r16,0(sp) 27f0: dfc00415 stw ra,16(sp) 27f4: 2821883a mov r16,r5 27f8: 9cd6fc04 addi r19,r19,23536 27fc: 2025883a mov r18,r4 2800: 000367c0 call 367c <__malloc_lock> 2804: 98800217 ldw r2,8(r19) 2808: 14400117 ldw r17,4(r2) 280c: 00bfff04 movi r2,-4 2810: 88a2703a and r17,r17,r2 2814: 8c21c83a sub r16,r17,r16 2818: 8403fbc4 addi r16,r16,4079 281c: 8020d33a srli r16,r16,12 2820: 843fffc4 addi r16,r16,-1 2824: 8020933a slli r16,r16,12 2828: 80840008 cmpgei r2,r16,4096 282c: 10000626 beq r2,zero,2848 <_malloc_trim_r+0x70> 2830: 000b883a mov r5,zero 2834: 9009883a mov r4,r18 2838: 0001f740 call 1f74 <_sbrk_r> 283c: 98c00217 ldw r3,8(r19) 2840: 1c47883a add r3,r3,r17 2844: 10c00a26 beq r2,r3,2870 <_malloc_trim_r+0x98> 2848: 9009883a mov r4,r18 284c: 00036a00 call 36a0 <__malloc_unlock> 2850: 0005883a mov r2,zero 2854: dfc00417 ldw ra,16(sp) 2858: dcc00317 ldw r19,12(sp) 285c: dc800217 ldw r18,8(sp) 2860: dc400117 ldw r17,4(sp) 2864: dc000017 ldw r16,0(sp) 2868: dec00504 addi sp,sp,20 286c: f800283a ret 2870: 040bc83a sub r5,zero,r16 2874: 9009883a mov r4,r18 2878: 0001f740 call 1f74 <_sbrk_r> 287c: 10bfffd8 cmpnei r2,r2,-1 2880: 10000d26 beq r2,zero,28b8 <_malloc_trim_r+0xe0> 2884: 00800034 movhi r2,0 2888: 109c9917 ldw r2,29284(r2) 288c: 98c00217 ldw r3,8(r19) 2890: 8c23c83a sub r17,r17,r16 2894: 8c400054 ori r17,r17,1 2898: 1421c83a sub r16,r2,r16 289c: 1c400115 stw r17,4(r3) 28a0: 00800034 movhi r2,0 28a4: 9009883a mov r4,r18 28a8: 141c9915 stw r16,29284(r2) 28ac: 00036a00 call 36a0 <__malloc_unlock> 28b0: 00800044 movi r2,1 28b4: 003fe706 br 2854 <_malloc_trim_r+0x7c> 28b8: 000b883a mov r5,zero 28bc: 9009883a mov r4,r18 28c0: 0001f740 call 1f74 <_sbrk_r> 28c4: 99000217 ldw r4,8(r19) 28c8: 1107c83a sub r3,r2,r4 28cc: 19400410 cmplti r5,r3,16 28d0: 283fdd1e bne r5,zero,2848 <_malloc_trim_r+0x70> 28d4: 01400034 movhi r5,0 28d8: 295c8217 ldw r5,29192(r5) 28dc: 18c00054 ori r3,r3,1 28e0: 20c00115 stw r3,4(r4) 28e4: 1145c83a sub r2,r2,r5 28e8: 01400034 movhi r5,0 28ec: 289c9915 stw r2,29284(r5) 28f0: 003fd506 br 2848 <_malloc_trim_r+0x70> 000028f4 <_free_r>: 28f4: 28004f26 beq r5,zero,2a34 <_free_r+0x140> 28f8: defffd04 addi sp,sp,-12 28fc: dc400115 stw r17,4(sp) 2900: dc000015 stw r16,0(sp) 2904: 2023883a mov r17,r4 2908: 2821883a mov r16,r5 290c: dfc00215 stw ra,8(sp) 2910: 000367c0 call 367c <__malloc_lock> 2914: 81ffff17 ldw r7,-4(r16) 2918: 00bfff84 movi r2,-2 291c: 80fffe04 addi r3,r16,-8 2920: 3884703a and r2,r7,r2 2924: 01000034 movhi r4,0 2928: 188d883a add r6,r3,r2 292c: 2116fc04 addi r4,r4,23536 2930: 31400117 ldw r5,4(r6) 2934: 22000217 ldw r8,8(r4) 2938: 027fff04 movi r9,-4 293c: 2a4a703a and r5,r5,r9 2940: 41806426 beq r8,r6,2ad4 <_free_r+0x1e0> 2944: 31400115 stw r5,4(r6) 2948: 39c0004c andi r7,r7,1 294c: 3151883a add r8,r6,r5 2950: 3800281e bne r7,zero,29f4 <_free_r+0x100> 2954: 82bffe17 ldw r10,-8(r16) 2958: 42000117 ldw r8,4(r8) 295c: 01c00034 movhi r7,0 2960: 1a87c83a sub r3,r3,r10 2964: 1a400217 ldw r9,8(r3) 2968: 39d6fe04 addi r7,r7,23544 296c: 1285883a add r2,r2,r10 2970: 4200004c andi r8,r8,1 2974: 49c04c26 beq r9,r7,2aa8 <_free_r+0x1b4> 2978: 1a800317 ldw r10,12(r3) 297c: 4a800315 stw r10,12(r9) 2980: 52400215 stw r9,8(r10) 2984: 40007126 beq r8,zero,2b4c <_free_r+0x258> 2988: 11400054 ori r5,r2,1 298c: 19400115 stw r5,4(r3) 2990: 30800015 stw r2,0(r6) 2994: 11408028 cmpgeui r5,r2,512 2998: 28002c1e bne r5,zero,2a4c <_free_r+0x158> 299c: 100ad0fa srli r5,r2,3 29a0: 100cd17a srli r6,r2,5 29a4: 00800044 movi r2,1 29a8: 29400044 addi r5,r5,1 29ac: 280a90fa slli r5,r5,3 29b0: 21c00117 ldw r7,4(r4) 29b4: 1184983a sll r2,r2,r6 29b8: 214b883a add r5,r4,r5 29bc: 29800017 ldw r6,0(r5) 29c0: 11c4b03a or r2,r2,r7 29c4: 29fffe04 addi r7,r5,-8 29c8: 19c00315 stw r7,12(r3) 29cc: 19800215 stw r6,8(r3) 29d0: 20800115 stw r2,4(r4) 29d4: 28c00015 stw r3,0(r5) 29d8: 30c00315 stw r3,12(r6) 29dc: 8809883a mov r4,r17 29e0: dfc00217 ldw ra,8(sp) 29e4: dc400117 ldw r17,4(sp) 29e8: dc000017 ldw r16,0(sp) 29ec: dec00304 addi sp,sp,12 29f0: 00036a01 jmpi 36a0 <__malloc_unlock> 29f4: 41c00117 ldw r7,4(r8) 29f8: 39c0004c andi r7,r7,1 29fc: 38000e1e bne r7,zero,2a38 <_free_r+0x144> 2a00: 01c00034 movhi r7,0 2a04: 1145883a add r2,r2,r5 2a08: 39d6fe04 addi r7,r7,23544 2a0c: 31400217 ldw r5,8(r6) 2a10: 12400054 ori r9,r2,1 2a14: 1891883a add r8,r3,r2 2a18: 29c05226 beq r5,r7,2b64 <_free_r+0x270> 2a1c: 31800317 ldw r6,12(r6) 2a20: 29800315 stw r6,12(r5) 2a24: 31400215 stw r5,8(r6) 2a28: 1a400115 stw r9,4(r3) 2a2c: 40800015 stw r2,0(r8) 2a30: 003fd806 br 2994 <_free_r+0xa0> 2a34: f800283a ret 2a38: 11400054 ori r5,r2,1 2a3c: 817fff15 stw r5,-4(r16) 2a40: 30800015 stw r2,0(r6) 2a44: 11408028 cmpgeui r5,r2,512 2a48: 283fd426 beq r5,zero,299c <_free_r+0xa8> 2a4c: 100ad27a srli r5,r2,9 2a50: 29800168 cmpgeui r6,r5,5 2a54: 3000341e bne r6,zero,2b28 <_free_r+0x234> 2a58: 100ad1ba srli r5,r2,6 2a5c: 29800e44 addi r6,r5,57 2a60: 300c90fa slli r6,r6,3 2a64: 29c00e04 addi r7,r5,56 2a68: 218d883a add r6,r4,r6 2a6c: 31400017 ldw r5,0(r6) 2a70: 31bffe04 addi r6,r6,-8 2a74: 31404226 beq r6,r5,2b80 <_free_r+0x28c> 2a78: 01ffff04 movi r7,-4 2a7c: 29000117 ldw r4,4(r5) 2a80: 21c8703a and r4,r4,r7 2a84: 1100022e bgeu r2,r4,2a90 <_free_r+0x19c> 2a88: 29400217 ldw r5,8(r5) 2a8c: 317ffb1e bne r6,r5,2a7c <_free_r+0x188> 2a90: 29800317 ldw r6,12(r5) 2a94: 19800315 stw r6,12(r3) 2a98: 19400215 stw r5,8(r3) 2a9c: 30c00215 stw r3,8(r6) 2aa0: 28c00315 stw r3,12(r5) 2aa4: 003fcd06 br 29dc <_free_r+0xe8> 2aa8: 40004d1e bne r8,zero,2be0 <_free_r+0x2ec> 2aac: 31000317 ldw r4,12(r6) 2ab0: 31800217 ldw r6,8(r6) 2ab4: 2885883a add r2,r5,r2 2ab8: 11400054 ori r5,r2,1 2abc: 31000315 stw r4,12(r6) 2ac0: 21800215 stw r6,8(r4) 2ac4: 19400115 stw r5,4(r3) 2ac8: 1887883a add r3,r3,r2 2acc: 18800015 stw r2,0(r3) 2ad0: 003fc206 br 29dc <_free_r+0xe8> 2ad4: 39c0004c andi r7,r7,1 2ad8: 1145883a add r2,r2,r5 2adc: 3800071e bne r7,zero,2afc <_free_r+0x208> 2ae0: 81fffe17 ldw r7,-8(r16) 2ae4: 19c7c83a sub r3,r3,r7 2ae8: 19400317 ldw r5,12(r3) 2aec: 19800217 ldw r6,8(r3) 2af0: 11c5883a add r2,r2,r7 2af4: 31400315 stw r5,12(r6) 2af8: 29800215 stw r6,8(r5) 2afc: 01400034 movhi r5,0 2b00: 11800054 ori r6,r2,1 2b04: 295c8317 ldw r5,29196(r5) 2b08: 19800115 stw r6,4(r3) 2b0c: 20c00215 stw r3,8(r4) 2b10: 117fb236 bltu r2,r5,29dc <_free_r+0xe8> 2b14: 00800034 movhi r2,0 2b18: 115c9017 ldw r5,29248(r2) 2b1c: 8809883a mov r4,r17 2b20: 00027d80 call 27d8 <_malloc_trim_r> 2b24: 003fad06 br 29dc <_free_r+0xe8> 2b28: 29800568 cmpgeui r6,r5,21 2b2c: 30000926 beq r6,zero,2b54 <_free_r+0x260> 2b30: 29801568 cmpgeui r6,r5,85 2b34: 3000191e bne r6,zero,2b9c <_free_r+0x2a8> 2b38: 100ad33a srli r5,r2,12 2b3c: 29801bc4 addi r6,r5,111 2b40: 300c90fa slli r6,r6,3 2b44: 29c01b84 addi r7,r5,110 2b48: 003fc706 br 2a68 <_free_r+0x174> 2b4c: 1145883a add r2,r2,r5 2b50: 003fae06 br 2a0c <_free_r+0x118> 2b54: 29801704 addi r6,r5,92 2b58: 300c90fa slli r6,r6,3 2b5c: 29c016c4 addi r7,r5,91 2b60: 003fc106 br 2a68 <_free_r+0x174> 2b64: 20c00515 stw r3,20(r4) 2b68: 20c00415 stw r3,16(r4) 2b6c: 19c00315 stw r7,12(r3) 2b70: 19c00215 stw r7,8(r3) 2b74: 1a400115 stw r9,4(r3) 2b78: 40800015 stw r2,0(r8) 2b7c: 003f9706 br 29dc <_free_r+0xe8> 2b80: 380fd0ba srai r7,r7,2 2b84: 00800044 movi r2,1 2b88: 22000117 ldw r8,4(r4) 2b8c: 11ce983a sll r7,r2,r7 2b90: 3a0eb03a or r7,r7,r8 2b94: 21c00115 stw r7,4(r4) 2b98: 003fbe06 br 2a94 <_free_r+0x1a0> 2b9c: 29805568 cmpgeui r6,r5,341 2ba0: 3000051e bne r6,zero,2bb8 <_free_r+0x2c4> 2ba4: 100ad3fa srli r5,r2,15 2ba8: 29801e04 addi r6,r5,120 2bac: 300c90fa slli r6,r6,3 2bb0: 29c01dc4 addi r7,r5,119 2bb4: 003fac06 br 2a68 <_free_r+0x174> 2bb8: 29415568 cmpgeui r5,r5,1365 2bbc: 2800051e bne r5,zero,2bd4 <_free_r+0x2e0> 2bc0: 100ad4ba srli r5,r2,18 2bc4: 29801f44 addi r6,r5,125 2bc8: 300c90fa slli r6,r6,3 2bcc: 29c01f04 addi r7,r5,124 2bd0: 003fa506 br 2a68 <_free_r+0x174> 2bd4: 0180fe04 movi r6,1016 2bd8: 01c01f84 movi r7,126 2bdc: 003fa206 br 2a68 <_free_r+0x174> 2be0: 11000054 ori r4,r2,1 2be4: 19000115 stw r4,4(r3) 2be8: 30800015 stw r2,0(r6) 2bec: 003f7b06 br 29dc <_free_r+0xe8> 00002bf0 <_lseek_r>: 2bf0: 2807883a mov r3,r5 2bf4: defffe04 addi sp,sp,-8 2bf8: dc000015 stw r16,0(sp) 2bfc: 300b883a mov r5,r6 2c00: 00800034 movhi r2,0 2c04: 380d883a mov r6,r7 2c08: 2021883a mov r16,r4 2c0c: 1809883a mov r4,r3 2c10: dfc00115 stw ra,4(sp) 2c14: 101c9115 stw zero,29252(r2) 2c18: 00035200 call 3520 2c1c: 10ffffd8 cmpnei r3,r2,-1 2c20: 18000426 beq r3,zero,2c34 <_lseek_r+0x44> 2c24: dfc00117 ldw ra,4(sp) 2c28: dc000017 ldw r16,0(sp) 2c2c: dec00204 addi sp,sp,8 2c30: f800283a ret 2c34: 00c00034 movhi r3,0 2c38: 18dc9117 ldw r3,29252(r3) 2c3c: 183ff926 beq r3,zero,2c24 <_lseek_r+0x34> 2c40: 80c00015 stw r3,0(r16) 2c44: dfc00117 ldw ra,4(sp) 2c48: dc000017 ldw r16,0(sp) 2c4c: dec00204 addi sp,sp,8 2c50: f800283a ret 00002c54 <__smakebuf_r>: 2c54: 2880030b ldhu r2,12(r5) 2c58: deffe804 addi sp,sp,-96 2c5c: dc001215 stw r16,72(sp) 2c60: dfc01715 stw ra,92(sp) 2c64: dd001615 stw r20,88(sp) 2c68: dcc01515 stw r19,84(sp) 2c6c: dc801415 stw r18,80(sp) 2c70: dc401315 stw r17,76(sp) 2c74: 10c0008c andi r3,r2,2 2c78: 2821883a mov r16,r5 2c7c: 18000d26 beq r3,zero,2cb4 <__smakebuf_r+0x60> 2c80: 288010c4 addi r2,r5,67 2c84: 28800015 stw r2,0(r5) 2c88: 28800415 stw r2,16(r5) 2c8c: 00800044 movi r2,1 2c90: 28800515 stw r2,20(r5) 2c94: dfc01717 ldw ra,92(sp) 2c98: dd001617 ldw r20,88(sp) 2c9c: dcc01517 ldw r19,84(sp) 2ca0: dc801417 ldw r18,80(sp) 2ca4: dc401317 ldw r17,76(sp) 2ca8: dc001217 ldw r16,72(sp) 2cac: dec01804 addi sp,sp,96 2cb0: f800283a ret 2cb4: 2940038f ldh r5,14(r5) 2cb8: 2023883a mov r17,r4 2cbc: 28002816 blt r5,zero,2d60 <__smakebuf_r+0x10c> 2cc0: d80d883a mov r6,sp 2cc4: 0002f000 call 2f00 <_fstat_r> 2cc8: 10002416 blt r2,zero,2d5c <__smakebuf_r+0x108> 2ccc: d8800117 ldw r2,4(sp) 2cd0: 10bc000c andi r2,r2,61440 2cd4: 10880018 cmpnei r2,r2,8192 2cd8: 1000461e bne r2,zero,2df4 <__smakebuf_r+0x1a0> 2cdc: 8140038f ldh r5,14(r16) 2ce0: 8809883a mov r4,r17 2ce4: 0002f600 call 2f60 <_isatty_r> 2ce8: 10003e26 beq r2,zero,2de4 <__smakebuf_r+0x190> 2cec: 8080030b ldhu r2,12(r16) 2cf0: 80c010c4 addi r3,r16,67 2cf4: 80c00015 stw r3,0(r16) 2cf8: 10800054 ori r2,r2,1 2cfc: 8080030d sth r2,12(r16) 2d00: 00800044 movi r2,1 2d04: 80c00415 stw r3,16(r16) 2d08: 80800515 stw r2,20(r16) 2d0c: 04c00044 movi r19,1 2d10: 05010004 movi r20,1024 2d14: 04820004 movi r18,2048 2d18: a00b883a mov r5,r20 2d1c: 8809883a mov r4,r17 2d20: 0000e440 call e44 <_malloc_r> 2d24: 10001726 beq r2,zero,2d84 <__smakebuf_r+0x130> 2d28: 80c0030b ldhu r3,12(r16) 2d2c: 01000034 movhi r4,0 2d30: 21012604 addi r4,r4,1176 2d34: 89000f15 stw r4,60(r17) 2d38: 18c02014 ori r3,r3,128 2d3c: 80c0030d sth r3,12(r16) 2d40: 80800015 stw r2,0(r16) 2d44: 80800415 stw r2,16(r16) 2d48: 85000515 stw r20,20(r16) 2d4c: 98001d1e bne r19,zero,2dc4 <__smakebuf_r+0x170> 2d50: 90c6b03a or r3,r18,r3 2d54: 80c0030d sth r3,12(r16) 2d58: 003fce06 br 2c94 <__smakebuf_r+0x40> 2d5c: 8080030b ldhu r2,12(r16) 2d60: 1080200c andi r2,r2,128 2d64: 0027883a mov r19,zero 2d68: 10001326 beq r2,zero,2db8 <__smakebuf_r+0x164> 2d6c: 05001004 movi r20,64 2d70: a00b883a mov r5,r20 2d74: 8809883a mov r4,r17 2d78: 0025883a mov r18,zero 2d7c: 0000e440 call e44 <_malloc_r> 2d80: 103fe91e bne r2,zero,2d28 <__smakebuf_r+0xd4> 2d84: 8080030b ldhu r2,12(r16) 2d88: 10c0800c andi r3,r2,512 2d8c: 183fc11e bne r3,zero,2c94 <__smakebuf_r+0x40> 2d90: 00ffff04 movi r3,-4 2d94: 10c4703a and r2,r2,r3 2d98: 10800094 ori r2,r2,2 2d9c: 80c010c4 addi r3,r16,67 2da0: 8080030d sth r2,12(r16) 2da4: 00800044 movi r2,1 2da8: 80c00015 stw r3,0(r16) 2dac: 80c00415 stw r3,16(r16) 2db0: 80800515 stw r2,20(r16) 2db4: 003fb706 br 2c94 <__smakebuf_r+0x40> 2db8: 05010004 movi r20,1024 2dbc: 0025883a mov r18,zero 2dc0: 003fd506 br 2d18 <__smakebuf_r+0xc4> 2dc4: 8140038f ldh r5,14(r16) 2dc8: 8809883a mov r4,r17 2dcc: 0002f600 call 2f60 <_isatty_r> 2dd0: 80c0030b ldhu r3,12(r16) 2dd4: 103fde26 beq r2,zero,2d50 <__smakebuf_r+0xfc> 2dd8: 18ffff0c andi r3,r3,65532 2ddc: 18c00054 ori r3,r3,1 2de0: 003fdb06 br 2d50 <__smakebuf_r+0xfc> 2de4: 04c00044 movi r19,1 2de8: 05010004 movi r20,1024 2dec: 04820004 movi r18,2048 2df0: 003fc906 br 2d18 <__smakebuf_r+0xc4> 2df4: 0027883a mov r19,zero 2df8: 05010004 movi r20,1024 2dfc: 04820004 movi r18,2048 2e00: 003fc506 br 2d18 <__smakebuf_r+0xc4> 00002e04 <__swhatbuf_r>: 2e04: deffea04 addi sp,sp,-88 2e08: dc001215 stw r16,72(sp) 2e0c: 2821883a mov r16,r5 2e10: 2940038f ldh r5,14(r5) 2e14: dc801415 stw r18,80(sp) 2e18: dc401315 stw r17,76(sp) 2e1c: dfc01515 stw ra,84(sp) 2e20: 3023883a mov r17,r6 2e24: 3825883a mov r18,r7 2e28: 28001016 blt r5,zero,2e6c <__swhatbuf_r+0x68> 2e2c: d80d883a mov r6,sp 2e30: 0002f000 call 2f00 <_fstat_r> 2e34: 10000d16 blt r2,zero,2e6c <__swhatbuf_r+0x68> 2e38: d8c00117 ldw r3,4(sp) 2e3c: 00820004 movi r2,2048 2e40: 18fc000c andi r3,r3,61440 2e44: 18c80020 cmpeqi r3,r3,8192 2e48: 90c00015 stw r3,0(r18) 2e4c: 00c10004 movi r3,1024 2e50: 88c00015 stw r3,0(r17) 2e54: dfc01517 ldw ra,84(sp) 2e58: dc801417 ldw r18,80(sp) 2e5c: dc401317 ldw r17,76(sp) 2e60: dc001217 ldw r16,72(sp) 2e64: dec01604 addi sp,sp,88 2e68: f800283a ret 2e6c: 8080030b ldhu r2,12(r16) 2e70: 90000015 stw zero,0(r18) 2e74: 1080200c andi r2,r2,128 2e78: 10000426 beq r2,zero,2e8c <__swhatbuf_r+0x88> 2e7c: 00801004 movi r2,64 2e80: 88800015 stw r2,0(r17) 2e84: 0005883a mov r2,zero 2e88: 003ff206 br 2e54 <__swhatbuf_r+0x50> 2e8c: 00810004 movi r2,1024 2e90: 88800015 stw r2,0(r17) 2e94: 0005883a mov r2,zero 2e98: 003fee06 br 2e54 <__swhatbuf_r+0x50> 00002e9c <_read_r>: 2e9c: 2807883a mov r3,r5 2ea0: defffe04 addi sp,sp,-8 2ea4: dc000015 stw r16,0(sp) 2ea8: 300b883a mov r5,r6 2eac: 00800034 movhi r2,0 2eb0: 380d883a mov r6,r7 2eb4: 2021883a mov r16,r4 2eb8: 1809883a mov r4,r3 2ebc: dfc00115 stw ra,4(sp) 2ec0: 101c9115 stw zero,29252(r2) 2ec4: 00037000 call 3700 2ec8: 10ffffd8 cmpnei r3,r2,-1 2ecc: 18000426 beq r3,zero,2ee0 <_read_r+0x44> 2ed0: dfc00117 ldw ra,4(sp) 2ed4: dc000017 ldw r16,0(sp) 2ed8: dec00204 addi sp,sp,8 2edc: f800283a ret 2ee0: 00c00034 movhi r3,0 2ee4: 18dc9117 ldw r3,29252(r3) 2ee8: 183ff926 beq r3,zero,2ed0 <_read_r+0x34> 2eec: 80c00015 stw r3,0(r16) 2ef0: dfc00117 ldw ra,4(sp) 2ef4: dc000017 ldw r16,0(sp) 2ef8: dec00204 addi sp,sp,8 2efc: f800283a ret 00002f00 <_fstat_r>: 2f00: 2807883a mov r3,r5 2f04: defffe04 addi sp,sp,-8 2f08: dc000015 stw r16,0(sp) 2f0c: 00800034 movhi r2,0 2f10: 300b883a mov r5,r6 2f14: 2021883a mov r16,r4 2f18: 1809883a mov r4,r3 2f1c: dfc00115 stw ra,4(sp) 2f20: 101c9115 stw zero,29252(r2) 2f24: 000333c0 call 333c 2f28: 10ffffd8 cmpnei r3,r2,-1 2f2c: 18000426 beq r3,zero,2f40 <_fstat_r+0x40> 2f30: dfc00117 ldw ra,4(sp) 2f34: dc000017 ldw r16,0(sp) 2f38: dec00204 addi sp,sp,8 2f3c: f800283a ret 2f40: 00c00034 movhi r3,0 2f44: 18dc9117 ldw r3,29252(r3) 2f48: 183ff926 beq r3,zero,2f30 <_fstat_r+0x30> 2f4c: 80c00015 stw r3,0(r16) 2f50: dfc00117 ldw ra,4(sp) 2f54: dc000017 ldw r16,0(sp) 2f58: dec00204 addi sp,sp,8 2f5c: f800283a ret 00002f60 <_isatty_r>: 2f60: defffe04 addi sp,sp,-8 2f64: dc000015 stw r16,0(sp) 2f68: 00800034 movhi r2,0 2f6c: 2021883a mov r16,r4 2f70: 2809883a mov r4,r5 2f74: dfc00115 stw ra,4(sp) 2f78: 101c9115 stw zero,29252(r2) 2f7c: 00034340 call 3434 2f80: 10ffffd8 cmpnei r3,r2,-1 2f84: 18000426 beq r3,zero,2f98 <_isatty_r+0x38> 2f88: dfc00117 ldw ra,4(sp) 2f8c: dc000017 ldw r16,0(sp) 2f90: dec00204 addi sp,sp,8 2f94: f800283a ret 2f98: 00c00034 movhi r3,0 2f9c: 18dc9117 ldw r3,29252(r3) 2fa0: 183ff926 beq r3,zero,2f88 <_isatty_r+0x28> 2fa4: 80c00015 stw r3,0(r16) 2fa8: dfc00117 ldw ra,4(sp) 2fac: dc000017 ldw r16,0(sp) 2fb0: dec00204 addi sp,sp,8 2fb4: f800283a ret 00002fb8 <__divsi3>: 2fb8: 20001a16 blt r4,zero,3024 <__divsi3+0x6c> 2fbc: 000f883a mov r7,zero 2fc0: 2800020e bge r5,zero,2fcc <__divsi3+0x14> 2fc4: 014bc83a sub r5,zero,r5 2fc8: 39c0005c xori r7,r7,1 2fcc: 200d883a mov r6,r4 2fd0: 00c00044 movi r3,1 2fd4: 2900092e bgeu r5,r4,2ffc <__divsi3+0x44> 2fd8: 00800804 movi r2,32 2fdc: 00c00044 movi r3,1 2fe0: 00000106 br 2fe8 <__divsi3+0x30> 2fe4: 10001226 beq r2,zero,3030 <__divsi3+0x78> 2fe8: 294b883a add r5,r5,r5 2fec: 10bfffc4 addi r2,r2,-1 2ff0: 18c7883a add r3,r3,r3 2ff4: 293ffb36 bltu r5,r4,2fe4 <__divsi3+0x2c> 2ff8: 18000d26 beq r3,zero,3030 <__divsi3+0x78> 2ffc: 0005883a mov r2,zero 3000: 31400236 bltu r6,r5,300c <__divsi3+0x54> 3004: 314dc83a sub r6,r6,r5 3008: 10c4b03a or r2,r2,r3 300c: 1806d07a srli r3,r3,1 3010: 280ad07a srli r5,r5,1 3014: 183ffa1e bne r3,zero,3000 <__divsi3+0x48> 3018: 38000126 beq r7,zero,3020 <__divsi3+0x68> 301c: 0085c83a sub r2,zero,r2 3020: f800283a ret 3024: 0109c83a sub r4,zero,r4 3028: 01c00044 movi r7,1 302c: 003fe406 br 2fc0 <__divsi3+0x8> 3030: 0005883a mov r2,zero 3034: 003ff806 br 3018 <__divsi3+0x60> 00003038 <__modsi3>: 3038: 20001916 blt r4,zero,30a0 <__modsi3+0x68> 303c: 000f883a mov r7,zero 3040: 2005883a mov r2,r4 3044: 2800010e bge r5,zero,304c <__modsi3+0x14> 3048: 014bc83a sub r5,zero,r5 304c: 00c00044 movi r3,1 3050: 2900092e bgeu r5,r4,3078 <__modsi3+0x40> 3054: 01800804 movi r6,32 3058: 00c00044 movi r3,1 305c: 00000106 br 3064 <__modsi3+0x2c> 3060: 30000d26 beq r6,zero,3098 <__modsi3+0x60> 3064: 294b883a add r5,r5,r5 3068: 31bfffc4 addi r6,r6,-1 306c: 18c7883a add r3,r3,r3 3070: 293ffb36 bltu r5,r4,3060 <__modsi3+0x28> 3074: 18000826 beq r3,zero,3098 <__modsi3+0x60> 3078: 1806d07a srli r3,r3,1 307c: 11400136 bltu r2,r5,3084 <__modsi3+0x4c> 3080: 1145c83a sub r2,r2,r5 3084: 280ad07a srli r5,r5,1 3088: 183ffb1e bne r3,zero,3078 <__modsi3+0x40> 308c: 38000126 beq r7,zero,3094 <__modsi3+0x5c> 3090: 0085c83a sub r2,zero,r2 3094: f800283a ret 3098: 2005883a mov r2,r4 309c: 003ffb06 br 308c <__modsi3+0x54> 30a0: 0109c83a sub r4,zero,r4 30a4: 01c00044 movi r7,1 30a8: 003fe506 br 3040 <__modsi3+0x8> 000030ac <__udivsi3>: 30ac: 200d883a mov r6,r4 30b0: 2900152e bgeu r5,r4,3108 <__udivsi3+0x5c> 30b4: 28001416 blt r5,zero,3108 <__udivsi3+0x5c> 30b8: 00800804 movi r2,32 30bc: 00c00044 movi r3,1 30c0: 00000206 br 30cc <__udivsi3+0x20> 30c4: 10000e26 beq r2,zero,3100 <__udivsi3+0x54> 30c8: 28000516 blt r5,zero,30e0 <__udivsi3+0x34> 30cc: 294b883a add r5,r5,r5 30d0: 10bfffc4 addi r2,r2,-1 30d4: 18c7883a add r3,r3,r3 30d8: 293ffa36 bltu r5,r4,30c4 <__udivsi3+0x18> 30dc: 18000826 beq r3,zero,3100 <__udivsi3+0x54> 30e0: 0005883a mov r2,zero 30e4: 31400236 bltu r6,r5,30f0 <__udivsi3+0x44> 30e8: 314dc83a sub r6,r6,r5 30ec: 10c4b03a or r2,r2,r3 30f0: 1806d07a srli r3,r3,1 30f4: 280ad07a srli r5,r5,1 30f8: 183ffa1e bne r3,zero,30e4 <__udivsi3+0x38> 30fc: f800283a ret 3100: 0005883a mov r2,zero 3104: f800283a ret 3108: 00c00044 movi r3,1 310c: 003ff406 br 30e0 <__udivsi3+0x34> 00003110 <__umodsi3>: 3110: 2005883a mov r2,r4 3114: 2900132e bgeu r5,r4,3164 <__umodsi3+0x54> 3118: 28001216 blt r5,zero,3164 <__umodsi3+0x54> 311c: 01800804 movi r6,32 3120: 00c00044 movi r3,1 3124: 00000206 br 3130 <__umodsi3+0x20> 3128: 30000c26 beq r6,zero,315c <__umodsi3+0x4c> 312c: 28000516 blt r5,zero,3144 <__umodsi3+0x34> 3130: 294b883a add r5,r5,r5 3134: 31bfffc4 addi r6,r6,-1 3138: 18c7883a add r3,r3,r3 313c: 293ffa36 bltu r5,r4,3128 <__umodsi3+0x18> 3140: 18000626 beq r3,zero,315c <__umodsi3+0x4c> 3144: 1806d07a srli r3,r3,1 3148: 11400136 bltu r2,r5,3150 <__umodsi3+0x40> 314c: 1145c83a sub r2,r2,r5 3150: 280ad07a srli r5,r5,1 3154: 183ffb1e bne r3,zero,3144 <__umodsi3+0x34> 3158: f800283a ret 315c: 2005883a mov r2,r4 3160: f800283a ret 3164: 00c00044 movi r3,1 3168: 003ff606 br 3144 <__umodsi3+0x34> 0000316c <__mulsi3>: 316c: 0005883a mov r2,zero 3170: 20000726 beq r4,zero,3190 <__mulsi3+0x24> 3174: 20c0004c andi r3,r4,1 3178: 2008d07a srli r4,r4,1 317c: 18000126 beq r3,zero,3184 <__mulsi3+0x18> 3180: 1145883a add r2,r2,r5 3184: 294b883a add r5,r5,r5 3188: 203ffa1e bne r4,zero,3174 <__mulsi3+0x8> 318c: f800283a ret 3190: f800283a ret 00003194 : #undef errno extern int errno; static ALT_INLINE int* alt_get_errno(void) { 3194: defffe04 addi sp,sp,-8 3198: dfc00115 stw ra,4(sp) 319c: df000015 stw fp,0(sp) 31a0: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 31a4: d0a00917 ldw r2,-32732(gp) 31a8: 10000326 beq r2,zero,31b8 31ac: d0a00917 ldw r2,-32732(gp) 31b0: 103ee83a callr r2 31b4: 00000106 br 31bc 31b8: d0a01104 addi r2,gp,-32700 } 31bc: e037883a mov sp,fp 31c0: dfc00117 ldw ra,4(sp) 31c4: df000017 ldw fp,0(sp) 31c8: dec00204 addi sp,sp,8 31cc: f800283a ret 000031d0 : * * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h */ int ALT_CLOSE (int fildes) { 31d0: defffb04 addi sp,sp,-20 31d4: dfc00415 stw ra,16(sp) 31d8: df000315 stw fp,12(sp) 31dc: df000304 addi fp,sp,12 31e0: e13ffd15 stw r4,-12(fp) * A common error case is that when the file descriptor was created, the call * to open() failed resulting in a negative file descriptor. This is trapped * below so that we don't try and process an invalid file descriptor. */ fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; 31e4: e0bffd17 ldw r2,-12(fp) 31e8: 10000916 blt r2,zero,3210 31ec: e0fffd17 ldw r3,-12(fp) 31f0: 1805883a mov r2,r3 31f4: 1085883a add r2,r2,r2 31f8: 10c5883a add r2,r2,r3 31fc: 100490ba slli r2,r2,2 3200: 00c00034 movhi r3,0 3204: 18d80804 addi r3,r3,24608 3208: 10c5883a add r2,r2,r3 320c: 00000106 br 3214 3210: 0005883a mov r2,zero 3214: e0bfff15 stw r2,-4(fp) if (fd) 3218: e0bfff17 ldw r2,-4(fp) 321c: 10001926 beq r2,zero,3284 /* * If the associated file system/device has a close function, call it so * that any necessary cleanup code can run. */ rval = (fd->dev->close) ? fd->dev->close(fd) : 0; 3220: e0bfff17 ldw r2,-4(fp) 3224: 10800017 ldw r2,0(r2) 3228: 10800417 ldw r2,16(r2) 322c: 10000626 beq r2,zero,3248 3230: e0bfff17 ldw r2,-4(fp) 3234: 10800017 ldw r2,0(r2) 3238: 10800417 ldw r2,16(r2) 323c: e13fff17 ldw r4,-4(fp) 3240: 103ee83a callr r2 3244: 00000106 br 324c 3248: 0005883a mov r2,zero 324c: e0bffe15 stw r2,-8(fp) /* Free the file descriptor structure and return. */ alt_release_fd (fildes); 3250: e13ffd17 ldw r4,-12(fp) 3254: 00038080 call 3808 if (rval < 0) 3258: e0bffe17 ldw r2,-8(fp) 325c: 1000070e bge r2,zero,327c { ALT_ERRNO = -rval; 3260: 00031940 call 3194 3264: 1007883a mov r3,r2 3268: e0bffe17 ldw r2,-8(fp) 326c: 0085c83a sub r2,zero,r2 3270: 18800015 stw r2,0(r3) return -1; 3274: 00bfffc4 movi r2,-1 3278: 00000706 br 3298 } return 0; 327c: 0005883a mov r2,zero 3280: 00000506 br 3298 } else { ALT_ERRNO = EBADFD; 3284: 00031940 call 3194 3288: 1007883a mov r3,r2 328c: 00801444 movi r2,81 3290: 18800015 stw r2,0(r3) return -1; 3294: 00bfffc4 movi r2,-1 } } 3298: e037883a mov sp,fp 329c: dfc00117 ldw ra,4(sp) 32a0: df000017 ldw fp,0(sp) 32a4: dec00204 addi sp,sp,8 32a8: f800283a ret 000032ac : * * Any dirty lines in the data cache are written back to memory. */ void alt_dcache_flush (void* start, alt_u32 len) { 32ac: defffd04 addi sp,sp,-12 32b0: df000215 stw fp,8(sp) 32b4: df000204 addi fp,sp,8 32b8: e13fff15 stw r4,-4(fp) 32bc: e17ffe15 stw r5,-8(fp) { ALT_FLUSH_DATA(i); } #endif /* NIOS2_DCACHE_SIZE > 0 */ } 32c0: 0001883a nop 32c4: e037883a mov sp,fp 32c8: df000017 ldw fp,0(sp) 32cc: dec00104 addi sp,sp,4 32d0: f800283a ret 000032d4 : * by the alt_dev_null device. It simple discards all data passed to it, and * indicates that the data has been successfully transmitted. */ static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) { 32d4: defffc04 addi sp,sp,-16 32d8: df000315 stw fp,12(sp) 32dc: df000304 addi fp,sp,12 32e0: e13fff15 stw r4,-4(fp) 32e4: e17ffe15 stw r5,-8(fp) 32e8: e1bffd15 stw r6,-12(fp) return len; 32ec: e0bffd17 ldw r2,-12(fp) } 32f0: e037883a mov sp,fp 32f4: df000017 ldw fp,0(sp) 32f8: dec00104 addi sp,sp,4 32fc: f800283a ret 00003300 : { 3300: defffe04 addi sp,sp,-8 3304: dfc00115 stw ra,4(sp) 3308: df000015 stw fp,0(sp) 330c: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 3310: d0a00917 ldw r2,-32732(gp) 3314: 10000326 beq r2,zero,3324 3318: d0a00917 ldw r2,-32732(gp) 331c: 103ee83a callr r2 3320: 00000106 br 3328 3324: d0a01104 addi r2,gp,-32700 } 3328: e037883a mov sp,fp 332c: dfc00117 ldw ra,4(sp) 3330: df000017 ldw fp,0(sp) 3334: dec00204 addi sp,sp,8 3338: f800283a ret 0000333c : } #else /* !ALT_USE_DIRECT_DRIVERS */ int ALT_FSTAT (int file, struct stat *st) { 333c: defffb04 addi sp,sp,-20 3340: dfc00415 stw ra,16(sp) 3344: df000315 stw fp,12(sp) 3348: df000304 addi fp,sp,12 334c: e13ffe15 stw r4,-8(fp) 3350: e17ffd15 stw r5,-12(fp) * A common error case is that when the file descriptor was created, the call * to open() failed resulting in a negative file descriptor. This is trapped * below so that we don't try and process an invalid file descriptor. */ fd = (file < 0) ? NULL : &alt_fd_list[file]; 3354: e0bffe17 ldw r2,-8(fp) 3358: 10000916 blt r2,zero,3380 335c: e0fffe17 ldw r3,-8(fp) 3360: 1805883a mov r2,r3 3364: 1085883a add r2,r2,r2 3368: 10c5883a add r2,r2,r3 336c: 100490ba slli r2,r2,2 3370: 00c00034 movhi r3,0 3374: 18d80804 addi r3,r3,24608 3378: 10c5883a add r2,r2,r3 337c: 00000106 br 3384 3380: 0005883a mov r2,zero 3384: e0bfff15 stw r2,-4(fp) if (fd) 3388: e0bfff17 ldw r2,-4(fp) 338c: 10001026 beq r2,zero,33d0 { /* Call the drivers fstat() function to fill out the "st" structure. */ if (fd->dev->fstat) 3390: e0bfff17 ldw r2,-4(fp) 3394: 10800017 ldw r2,0(r2) 3398: 10800817 ldw r2,32(r2) 339c: 10000726 beq r2,zero,33bc { return fd->dev->fstat(fd, st); 33a0: e0bfff17 ldw r2,-4(fp) 33a4: 10800017 ldw r2,0(r2) 33a8: 10800817 ldw r2,32(r2) 33ac: e17ffd17 ldw r5,-12(fp) 33b0: e13fff17 ldw r4,-4(fp) 33b4: 103ee83a callr r2 33b8: 00000a06 br 33e4 * device. */ else { st->st_mode = _IFCHR; 33bc: e0bffd17 ldw r2,-12(fp) 33c0: 00c80004 movi r3,8192 33c4: 10c00115 stw r3,4(r2) return 0; 33c8: 0005883a mov r2,zero 33cc: 00000506 br 33e4 } } else { ALT_ERRNO = EBADFD; 33d0: 00033000 call 3300 33d4: 1007883a mov r3,r2 33d8: 00801444 movi r2,81 33dc: 18800015 stw r2,0(r3) return -1; 33e0: 00bfffc4 movi r2,-1 } } 33e4: e037883a mov sp,fp 33e8: dfc00117 ldw ra,4(sp) 33ec: df000017 ldw fp,0(sp) 33f0: dec00204 addi sp,sp,8 33f4: f800283a ret 000033f8 : { 33f8: defffe04 addi sp,sp,-8 33fc: dfc00115 stw ra,4(sp) 3400: df000015 stw fp,0(sp) 3404: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 3408: d0a00917 ldw r2,-32732(gp) 340c: 10000326 beq r2,zero,341c 3410: d0a00917 ldw r2,-32732(gp) 3414: 103ee83a callr r2 3418: 00000106 br 3420 341c: d0a01104 addi r2,gp,-32700 } 3420: e037883a mov sp,fp 3424: dfc00117 ldw ra,4(sp) 3428: df000017 ldw fp,0(sp) 342c: dec00204 addi sp,sp,8 3430: f800283a ret 00003434 : * * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h */ int ALT_ISATTY (int file) { 3434: deffea04 addi sp,sp,-88 3438: dfc01515 stw ra,84(sp) 343c: df001415 stw fp,80(sp) 3440: df001404 addi fp,sp,80 3444: e13fec15 stw r4,-80(fp) * A common error case is that when the file descriptor was created, the call * to open() failed resulting in a negative file descriptor. This is trapped * below so that we don't try and process an invalid file descriptor. */ fd = (file < 0) ? NULL : &alt_fd_list[file]; 3448: e0bfec17 ldw r2,-80(fp) 344c: 10000916 blt r2,zero,3474 3450: e0ffec17 ldw r3,-80(fp) 3454: 1805883a mov r2,r3 3458: 1085883a add r2,r2,r2 345c: 10c5883a add r2,r2,r3 3460: 100490ba slli r2,r2,2 3464: 00c00034 movhi r3,0 3468: 18d80804 addi r3,r3,24608 346c: 10c5883a add r2,r2,r3 3470: 00000106 br 3478 3474: 0005883a mov r2,zero 3478: e0bfff15 stw r2,-4(fp) if (fd) 347c: e0bfff17 ldw r2,-4(fp) 3480: 10000e26 beq r2,zero,34bc /* * If a device driver does not provide an fstat() function, then it is * treated as a terminal device by default. */ if (!fd->dev->fstat) 3484: e0bfff17 ldw r2,-4(fp) 3488: 10800017 ldw r2,0(r2) 348c: 10800817 ldw r2,32(r2) 3490: 1000021e bne r2,zero,349c { return 1; 3494: 00800044 movi r2,1 3498: 00000d06 br 34d0 * this is called so that the device can identify itself. */ else { fstat (file, &stat); 349c: e0bfed04 addi r2,fp,-76 34a0: 100b883a mov r5,r2 34a4: e13fec17 ldw r4,-80(fp) 34a8: 000333c0 call 333c return (stat.st_mode == _IFCHR) ? 1 : 0; 34ac: e0bfee17 ldw r2,-72(fp) 34b0: 10880020 cmpeqi r2,r2,8192 34b4: 10803fcc andi r2,r2,255 34b8: 00000506 br 34d0 } } else { ALT_ERRNO = EBADFD; 34bc: 00033f80 call 33f8 34c0: 1007883a mov r3,r2 34c4: 00801444 movi r2,81 34c8: 18800015 stw r2,0(r3) return 0; 34cc: 0005883a mov r2,zero } } 34d0: e037883a mov sp,fp 34d4: dfc00117 ldw ra,4(sp) 34d8: df000017 ldw fp,0(sp) 34dc: dec00204 addi sp,sp,8 34e0: f800283a ret 000034e4 : { 34e4: defffe04 addi sp,sp,-8 34e8: dfc00115 stw ra,4(sp) 34ec: df000015 stw fp,0(sp) 34f0: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 34f4: d0a00917 ldw r2,-32732(gp) 34f8: 10000326 beq r2,zero,3508 34fc: d0a00917 ldw r2,-32732(gp) 3500: 103ee83a callr r2 3504: 00000106 br 350c 3508: d0a01104 addi r2,gp,-32700 } 350c: e037883a mov sp,fp 3510: dfc00117 ldw ra,4(sp) 3514: df000017 ldw fp,0(sp) 3518: dec00204 addi sp,sp,8 351c: f800283a ret 00003520 : * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h * */ off_t ALT_LSEEK (int file, off_t ptr, int dir) { 3520: defff904 addi sp,sp,-28 3524: dfc00615 stw ra,24(sp) 3528: df000515 stw fp,20(sp) 352c: df000504 addi fp,sp,20 3530: e13ffd15 stw r4,-12(fp) 3534: e17ffc15 stw r5,-16(fp) 3538: e1bffb15 stw r6,-20(fp) alt_fd* fd; off_t rc = 0; 353c: e03fff15 stw zero,-4(fp) * A common error case is that when the file descriptor was created, the call * to open() failed resulting in a negative file descriptor. This is trapped * below so that we don't try and process an invalid file descriptor. */ fd = (file < 0) ? NULL : &alt_fd_list[file]; 3540: e0bffd17 ldw r2,-12(fp) 3544: 10000916 blt r2,zero,356c 3548: e0fffd17 ldw r3,-12(fp) 354c: 1805883a mov r2,r3 3550: 1085883a add r2,r2,r2 3554: 10c5883a add r2,r2,r3 3558: 100490ba slli r2,r2,2 355c: 00c00034 movhi r3,0 3560: 18d80804 addi r3,r3,24608 3564: 10c5883a add r2,r2,r3 3568: 00000106 br 3570 356c: 0005883a mov r2,zero 3570: e0bffe15 stw r2,-8(fp) if (fd) 3574: e0bffe17 ldw r2,-8(fp) 3578: 10001026 beq r2,zero,35bc /* * If the device driver provides an implementation of the lseek() function, * then call that to process the request. */ if (fd->dev->lseek) 357c: e0bffe17 ldw r2,-8(fp) 3580: 10800017 ldw r2,0(r2) 3584: 10800717 ldw r2,28(r2) 3588: 10000926 beq r2,zero,35b0 { rc = fd->dev->lseek(fd, ptr, dir); 358c: e0bffe17 ldw r2,-8(fp) 3590: 10800017 ldw r2,0(r2) 3594: 10800717 ldw r2,28(r2) 3598: e1bffb17 ldw r6,-20(fp) 359c: e17ffc17 ldw r5,-16(fp) 35a0: e13ffe17 ldw r4,-8(fp) 35a4: 103ee83a callr r2 35a8: e0bfff15 stw r2,-4(fp) 35ac: 00000506 br 35c4 * Otherwise return an error. */ else { rc = -ENOTSUP; 35b0: 00bfde84 movi r2,-134 35b4: e0bfff15 stw r2,-4(fp) 35b8: 00000206 br 35c4 } } else { rc = -EBADFD; 35bc: 00bfebc4 movi r2,-81 35c0: e0bfff15 stw r2,-4(fp) } if (rc < 0) 35c4: e0bfff17 ldw r2,-4(fp) 35c8: 1000070e bge r2,zero,35e8 { ALT_ERRNO = -rc; 35cc: 00034e40 call 34e4 35d0: 1007883a mov r3,r2 35d4: e0bfff17 ldw r2,-4(fp) 35d8: 0085c83a sub r2,zero,r2 35dc: 18800015 stw r2,0(r3) rc = -1; 35e0: 00bfffc4 movi r2,-1 35e4: e0bfff15 stw r2,-4(fp) } return rc; 35e8: e0bfff17 ldw r2,-4(fp) } 35ec: e037883a mov sp,fp 35f0: dfc00117 ldw ra,4(sp) 35f4: df000017 ldw fp,0(sp) 35f8: dec00204 addi sp,sp,8 35fc: f800283a ret 00003600 : * devices/filesystems/components in the system; and call the entry point for * the users application, i.e. main(). */ void alt_main (void) { 3600: defffd04 addi sp,sp,-12 3604: dfc00215 stw ra,8(sp) 3608: df000115 stw fp,4(sp) 360c: df000104 addi fp,sp,4 #endif /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); /* Initialize the interrupt controller. */ alt_irq_init (NULL); 3610: 0009883a mov r4,zero 3614: 0003aa40 call 3aa4 /* Initialize the operating system */ ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); ALT_OS_INIT(); 3618: 0001883a nop ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); ALT_SEM_CREATE (&alt_fd_list_lock, 1); /* Initialize the device drivers/software components. */ ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); alt_sys_init(); 361c: 0003ae00 call 3ae0 * devices be present (not equal to /dev/null) and if direct drivers * aren't being used. */ ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); 3620: 01800034 movhi r6,0 3624: 3195eb04 addi r6,r6,22444 3628: 01400034 movhi r5,0 362c: 2955eb04 addi r5,r5,22444 3630: 01000034 movhi r4,0 3634: 2115eb04 addi r4,r4,22444 3638: 0004d000 call 4d00 /* * Call the C++ constructors */ ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); _do_ctors (); 363c: 00048cc0 call 48cc <_do_ctors> * redefined as _exit()). This is in the interest of reducing code footprint, * in that the atexit() overhead is removed when it's not needed. */ ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); atexit (_do_dtors); 3640: 01000034 movhi r4,0 3644: 21124c04 addi r4,r4,18736 3648: 00054ac0 call 54ac ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); #ifdef ALT_NO_EXIT main (alt_argc, alt_argv, alt_envp); #else result = main (alt_argc, alt_argv, alt_envp); 364c: d0a01217 ldw r2,-32696(gp) 3650: d0e01317 ldw r3,-32692(gp) 3654: d1201417 ldw r4,-32688(gp) 3658: 200d883a mov r6,r4 365c: 180b883a mov r5,r3 3660: 1009883a mov r4,r2 3664: 000025c0 call 25c
3668: e0bfff15 stw r2,-4(fp) close(STDOUT_FILENO); 366c: 01000044 movi r4,1 3670: 00031d00 call 31d0 exit (result); 3674: e13fff17 ldw r4,-4(fp) 3678: 00054c00 call 54c0 0000367c <__malloc_lock>: * configuration is single threaded, so there is nothing to do here. Note that * this requires that malloc is never called by an interrupt service routine. */ void __malloc_lock ( struct _reent *_r ) { 367c: defffe04 addi sp,sp,-8 3680: df000115 stw fp,4(sp) 3684: df000104 addi fp,sp,4 3688: e13fff15 stw r4,-4(fp) } 368c: 0001883a nop 3690: e037883a mov sp,fp 3694: df000017 ldw fp,0(sp) 3698: dec00104 addi sp,sp,4 369c: f800283a ret 000036a0 <__malloc_unlock>: /* * */ void __malloc_unlock ( struct _reent *_r ) { 36a0: defffe04 addi sp,sp,-8 36a4: df000115 stw fp,4(sp) 36a8: df000104 addi fp,sp,4 36ac: e13fff15 stw r4,-4(fp) } 36b0: 0001883a nop 36b4: e037883a mov sp,fp 36b8: df000017 ldw fp,0(sp) 36bc: dec00104 addi sp,sp,4 36c0: f800283a ret 000036c4 : { 36c4: defffe04 addi sp,sp,-8 36c8: dfc00115 stw ra,4(sp) 36cc: df000015 stw fp,0(sp) 36d0: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 36d4: d0a00917 ldw r2,-32732(gp) 36d8: 10000326 beq r2,zero,36e8 36dc: d0a00917 ldw r2,-32732(gp) 36e0: 103ee83a callr r2 36e4: 00000106 br 36ec 36e8: d0a01104 addi r2,gp,-32700 } 36ec: e037883a mov sp,fp 36f0: dfc00117 ldw ra,4(sp) 36f4: df000017 ldw fp,0(sp) 36f8: dec00204 addi sp,sp,8 36fc: f800283a ret 00003700 : } #else /* !ALT_USE_DIRECT_DRIVERS */ int ALT_READ (int file, void *ptr, size_t len) { 3700: defff904 addi sp,sp,-28 3704: dfc00615 stw ra,24(sp) 3708: df000515 stw fp,20(sp) 370c: df000504 addi fp,sp,20 3710: e13ffd15 stw r4,-12(fp) 3714: e17ffc15 stw r5,-16(fp) 3718: e1bffb15 stw r6,-20(fp) * A common error case is that when the file descriptor was created, the call * to open() failed resulting in a negative file descriptor. This is trapped * below so that we don't try and process an invalid file descriptor. */ fd = (file < 0) ? NULL : &alt_fd_list[file]; 371c: e0bffd17 ldw r2,-12(fp) 3720: 10000916 blt r2,zero,3748 3724: e0fffd17 ldw r3,-12(fp) 3728: 1805883a mov r2,r3 372c: 1085883a add r2,r2,r2 3730: 10c5883a add r2,r2,r3 3734: 100490ba slli r2,r2,2 3738: 00c00034 movhi r3,0 373c: 18d80804 addi r3,r3,24608 3740: 10c5883a add r2,r2,r3 3744: 00000106 br 374c 3748: 0005883a mov r2,zero 374c: e0bfff15 stw r2,-4(fp) if (fd) 3750: e0bfff17 ldw r2,-4(fp) 3754: 10002226 beq r2,zero,37e0 * If the file has not been opened with read access, or if the driver does * not provide an implementation of read(), generate an error. Otherwise * call the drivers read() function to process the request. */ if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && 3758: e0bfff17 ldw r2,-4(fp) 375c: 10800217 ldw r2,8(r2) 3760: 108000cc andi r2,r2,3 3764: 10800060 cmpeqi r2,r2,1 3768: 1000181e bne r2,zero,37cc (fd->dev->read)) 376c: e0bfff17 ldw r2,-4(fp) 3770: 10800017 ldw r2,0(r2) 3774: 10800517 ldw r2,20(r2) if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && 3778: 10001426 beq r2,zero,37cc { if ((rval = fd->dev->read(fd, ptr, len)) < 0) 377c: e0bfff17 ldw r2,-4(fp) 3780: 10800017 ldw r2,0(r2) 3784: 10800517 ldw r2,20(r2) 3788: e0fffb17 ldw r3,-20(fp) 378c: 180d883a mov r6,r3 3790: e17ffc17 ldw r5,-16(fp) 3794: e13fff17 ldw r4,-4(fp) 3798: 103ee83a callr r2 379c: e0bffe15 stw r2,-8(fp) 37a0: e0bffe17 ldw r2,-8(fp) 37a4: 1000070e bge r2,zero,37c4 { ALT_ERRNO = -rval; 37a8: 00036c40 call 36c4 37ac: 1007883a mov r3,r2 37b0: e0bffe17 ldw r2,-8(fp) 37b4: 0085c83a sub r2,zero,r2 37b8: 18800015 stw r2,0(r3) return -1; 37bc: 00bfffc4 movi r2,-1 37c0: 00000c06 br 37f4 } return rval; 37c4: e0bffe17 ldw r2,-8(fp) 37c8: 00000a06 br 37f4 } else { ALT_ERRNO = EACCES; 37cc: 00036c40 call 36c4 37d0: 1007883a mov r3,r2 37d4: 00800344 movi r2,13 37d8: 18800015 stw r2,0(r3) 37dc: 00000406 br 37f0 } } else { ALT_ERRNO = EBADFD; 37e0: 00036c40 call 36c4 37e4: 1007883a mov r3,r2 37e8: 00801444 movi r2,81 37ec: 18800015 stw r2,0(r3) } return -1; 37f0: 00bfffc4 movi r2,-1 } 37f4: e037883a mov sp,fp 37f8: dfc00117 ldw ra,4(sp) 37fc: df000017 ldw fp,0(sp) 3800: dec00204 addi sp,sp,8 3804: f800283a ret 00003808 : * File descriptors correcponding to standard in, standard out and standard * error cannont be released backed to the pool. They are always reserved. */ void alt_release_fd (int fd) { 3808: defffe04 addi sp,sp,-8 380c: df000115 stw fp,4(sp) 3810: df000104 addi fp,sp,4 3814: e13fff15 stw r4,-4(fp) if (fd > 2) 3818: e0bfff17 ldw r2,-4(fp) 381c: 108000d0 cmplti r2,r2,3 3820: 1000101e bne r2,zero,3864 { alt_fd_list[fd].fd_flags = 0; 3824: e0ffff17 ldw r3,-4(fp) 3828: 1805883a mov r2,r3 382c: 1085883a add r2,r2,r2 3830: 10c5883a add r2,r2,r3 3834: 100490ba slli r2,r2,2 3838: 00c00034 movhi r3,0 383c: 10c7883a add r3,r2,r3 3840: 18180a15 stw zero,24616(r3) alt_fd_list[fd].dev = 0; 3844: e0ffff17 ldw r3,-4(fp) 3848: 1805883a mov r2,r3 384c: 1085883a add r2,r2,r2 3850: 10c5883a add r2,r2,r3 3854: 100490ba slli r2,r2,2 3858: 00c00034 movhi r3,0 385c: 10c7883a add r3,r2,r3 3860: 18180815 stw zero,24608(r3) } } 3864: 0001883a nop 3868: e037883a mov sp,fp 386c: df000017 ldw fp,0(sp) 3870: dec00104 addi sp,sp,4 3874: f800283a ret 00003878 : #endif caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); caddr_t ALT_SBRK (int incr) { 3878: defff904 addi sp,sp,-28 387c: df000615 stw fp,24(sp) 3880: df000604 addi fp,sp,24 3884: e13ffa15 stw r4,-24(fp) NIOS2_READ_STATUS (context); 3888: 0005303a rdctl r2,status 388c: e0bffd15 stw r2,-12(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 3890: e0fffd17 ldw r3,-12(fp) 3894: 00bfff84 movi r2,-2 3898: 1884703a and r2,r3,r2 389c: 1001703a wrctl status,r2 return context; 38a0: e0bffd17 ldw r2,-12(fp) alt_irq_context context; char *prev_heap_end; context = alt_irq_disable_all(); 38a4: e0bfff15 stw r2,-4(fp) /* Always return data aligned on a word boundary */ heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); 38a8: d0a00a17 ldw r2,-32728(gp) 38ac: 10c000c4 addi r3,r2,3 38b0: 00bfff04 movi r2,-4 38b4: 1884703a and r2,r3,r2 38b8: d0a00a15 stw r2,-32728(gp) if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { alt_irq_enable_all(context); return (caddr_t)-1; } #else if ((heap_end + incr) > __alt_heap_limit) { 38bc: d0e00a17 ldw r3,-32728(gp) 38c0: e0bffa17 ldw r2,-24(fp) 38c4: 1887883a add r3,r3,r2 38c8: 008000b4 movhi r2,2 38cc: 10800004 addi r2,r2,0 38d0: 10c0072e bgeu r2,r3,38f0 38d4: e0bfff17 ldw r2,-4(fp) 38d8: e0bffc15 stw r2,-16(fp) NIOS2_WRITE_STATUS (context); 38dc: e0bffc17 ldw r2,-16(fp) 38e0: 1001703a wrctl status,r2 } 38e4: 0001883a nop alt_irq_enable_all(context); return (caddr_t)-1; 38e8: 00bfffc4 movi r2,-1 38ec: 00000c06 br 3920 } #endif prev_heap_end = heap_end; 38f0: d0a00a17 ldw r2,-32728(gp) 38f4: e0bffe15 stw r2,-8(fp) heap_end += incr; 38f8: d0e00a17 ldw r3,-32728(gp) 38fc: e0bffa17 ldw r2,-24(fp) 3900: 1885883a add r2,r3,r2 3904: d0a00a15 stw r2,-32728(gp) 3908: e0bfff17 ldw r2,-4(fp) 390c: e0bffb15 stw r2,-20(fp) NIOS2_WRITE_STATUS (context); 3910: e0bffb17 ldw r2,-20(fp) 3914: 1001703a wrctl status,r2 } 3918: 0001883a nop #endif alt_irq_enable_all(context); return (caddr_t) prev_heap_end; 391c: e0bffe17 ldw r2,-8(fp) } 3920: e037883a mov sp,fp 3924: df000017 ldw fp,0(sp) 3928: dec00104 addi sp,sp,4 392c: f800283a ret 00003930 : { 3930: defffe04 addi sp,sp,-8 3934: dfc00115 stw ra,4(sp) 3938: df000015 stw fp,0(sp) 393c: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 3940: d0a00917 ldw r2,-32732(gp) 3944: 10000326 beq r2,zero,3954 3948: d0a00917 ldw r2,-32732(gp) 394c: 103ee83a callr r2 3950: 00000106 br 3958 3954: d0a01104 addi r2,gp,-32700 } 3958: e037883a mov sp,fp 395c: dfc00117 ldw ra,4(sp) 3960: df000017 ldw fp,0(sp) 3964: dec00204 addi sp,sp,8 3968: f800283a ret 0000396c : } #else /* !ALT_USE_DIRECT_DRIVERS */ int ALT_WRITE (int file, const void *ptr, size_t len) { 396c: defff904 addi sp,sp,-28 3970: dfc00615 stw ra,24(sp) 3974: df000515 stw fp,20(sp) 3978: df000504 addi fp,sp,20 397c: e13ffd15 stw r4,-12(fp) 3980: e17ffc15 stw r5,-16(fp) 3984: e1bffb15 stw r6,-20(fp) * A common error case is that when the file descriptor was created, the call * to open() failed resulting in a negative file descriptor. This is trapped * below so that we don't try and process an invalid file descriptor. */ fd = (file < 0) ? NULL : &alt_fd_list[file]; 3988: e0bffd17 ldw r2,-12(fp) 398c: 10000916 blt r2,zero,39b4 3990: e0fffd17 ldw r3,-12(fp) 3994: 1805883a mov r2,r3 3998: 1085883a add r2,r2,r2 399c: 10c5883a add r2,r2,r3 39a0: 100490ba slli r2,r2,2 39a4: 00c00034 movhi r3,0 39a8: 18d80804 addi r3,r3,24608 39ac: 10c5883a add r2,r2,r3 39b0: 00000106 br 39b8 39b4: 0005883a mov r2,zero 39b8: e0bfff15 stw r2,-4(fp) if (fd) 39bc: e0bfff17 ldw r2,-4(fp) 39c0: 10002126 beq r2,zero,3a48 * If the file has not been opened with write access, or if the driver does * not provide an implementation of write(), generate an error. Otherwise * call the drivers write() function to process the request. */ if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) 39c4: e0bfff17 ldw r2,-4(fp) 39c8: 10800217 ldw r2,8(r2) 39cc: 108000cc andi r2,r2,3 39d0: 10001826 beq r2,zero,3a34 39d4: e0bfff17 ldw r2,-4(fp) 39d8: 10800017 ldw r2,0(r2) 39dc: 10800617 ldw r2,24(r2) 39e0: 10001426 beq r2,zero,3a34 { /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ ALT_LOG_WRITE_FUNCTION(ptr,len); if ((rval = fd->dev->write(fd, ptr, len)) < 0) 39e4: e0bfff17 ldw r2,-4(fp) 39e8: 10800017 ldw r2,0(r2) 39ec: 10800617 ldw r2,24(r2) 39f0: e0fffb17 ldw r3,-20(fp) 39f4: 180d883a mov r6,r3 39f8: e17ffc17 ldw r5,-16(fp) 39fc: e13fff17 ldw r4,-4(fp) 3a00: 103ee83a callr r2 3a04: e0bffe15 stw r2,-8(fp) 3a08: e0bffe17 ldw r2,-8(fp) 3a0c: 1000070e bge r2,zero,3a2c { ALT_ERRNO = -rval; 3a10: 00039300 call 3930 3a14: 1007883a mov r3,r2 3a18: e0bffe17 ldw r2,-8(fp) 3a1c: 0085c83a sub r2,zero,r2 3a20: 18800015 stw r2,0(r3) return -1; 3a24: 00bfffc4 movi r2,-1 3a28: 00000c06 br 3a5c } return rval; 3a2c: e0bffe17 ldw r2,-8(fp) 3a30: 00000a06 br 3a5c } else { ALT_ERRNO = EACCES; 3a34: 00039300 call 3930 3a38: 1007883a mov r3,r2 3a3c: 00800344 movi r2,13 3a40: 18800015 stw r2,0(r3) 3a44: 00000406 br 3a58 } } else { ALT_ERRNO = EBADFD; 3a48: 00039300 call 3930 3a4c: 1007883a mov r3,r2 3a50: 00801444 movi r2,81 3a54: 18800015 stw r2,0(r3) } return -1; 3a58: 00bfffc4 movi r2,-1 } 3a5c: e037883a mov sp,fp 3a60: dfc00117 ldw ra,4(sp) 3a64: df000017 ldw fp,0(sp) 3a68: dec00204 addi sp,sp,8 3a6c: f800283a ret 00003a70 : */ extern int alt_fs_reg (alt_dev* dev); static ALT_INLINE int alt_dev_reg (alt_dev* dev) { 3a70: defffd04 addi sp,sp,-12 3a74: dfc00215 stw ra,8(sp) 3a78: df000115 stw fp,4(sp) 3a7c: df000104 addi fp,sp,4 3a80: e13fff15 stw r4,-4(fp) extern alt_llist alt_dev_list; return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); 3a84: d1600604 addi r5,gp,-32744 3a88: e13fff17 ldw r4,-4(fp) 3a8c: 00048240 call 4824 } 3a90: e037883a mov sp,fp 3a94: dfc00117 ldw ra,4(sp) 3a98: df000017 ldw fp,0(sp) 3a9c: dec00204 addi sp,sp,8 3aa0: f800283a ret 00003aa4 : * The "base" parameter is ignored and only * present for backwards-compatibility. */ void alt_irq_init ( const void* base ) { 3aa4: defffd04 addi sp,sp,-12 3aa8: dfc00215 stw ra,8(sp) 3aac: df000115 stw fp,4(sp) 3ab0: df000104 addi fp,sp,4 3ab4: e13fff15 stw r4,-4(fp) ALTERA_NIOS2_GEN2_IRQ_INIT ( CPU, cpu); 3ab8: 00051a00 call 51a0 NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK 3abc: 00800044 movi r2,1 3ac0: 1001703a wrctl status,r2 } 3ac4: 0001883a nop alt_irq_cpu_enable_interrupts(); } 3ac8: 0001883a nop 3acc: e037883a mov sp,fp 3ad0: dfc00117 ldw ra,4(sp) 3ad4: df000017 ldw fp,0(sp) 3ad8: dec00204 addi sp,sp,8 3adc: f800283a ret 00003ae0 : * Initialize the non-interrupt controller devices. * Called after alt_irq_init(). */ void alt_sys_init( void ) { 3ae0: defffe04 addi sp,sp,-8 3ae4: dfc00115 stw ra,4(sp) 3ae8: df000015 stw fp,0(sp) 3aec: d839883a mov fp,sp ALTERA_AVALON_TIMER_INIT ( SYS_CLK_TIMER, sys_clk_timer); 3af0: 01c0fa04 movi r7,1000 3af4: 000d883a mov r6,zero 3af8: 000b883a mov r5,zero 3afc: 010000b4 movhi r4,2 3b00: 21041004 addi r4,r4,4160 3b04: 00046300 call 4630 ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); 3b08: 01800044 movi r6,1 3b0c: 000b883a mov r5,zero 3b10: 01000034 movhi r4,0 3b14: 21187204 addi r4,r4,25032 3b18: 0003ca40 call 3ca4 3b1c: 01000034 movhi r4,0 3b20: 21186804 addi r4,r4,24992 3b24: 0003a700 call 3a70 } 3b28: 0001883a nop 3b2c: e037883a mov sp,fp 3b30: dfc00117 ldw ra,4(sp) 3b34: df000017 ldw fp,0(sp) 3b38: dec00204 addi sp,sp,8 3b3c: f800283a ret 00003b40 : * */ int altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) { 3b40: defffa04 addi sp,sp,-24 3b44: dfc00515 stw ra,20(sp) 3b48: df000415 stw fp,16(sp) 3b4c: df000404 addi fp,sp,16 3b50: e13ffe15 stw r4,-8(fp) 3b54: e17ffd15 stw r5,-12(fp) 3b58: e1bffc15 stw r6,-16(fp) altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; 3b5c: e0bffe17 ldw r2,-8(fp) 3b60: 10800017 ldw r2,0(r2) 3b64: e0bfff15 stw r2,-4(fp) return altera_avalon_jtag_uart_read(&dev->state, buffer, space, 3b68: e0bfff17 ldw r2,-4(fp) 3b6c: 10c00a04 addi r3,r2,40 3b70: e0bffe17 ldw r2,-8(fp) 3b74: 10800217 ldw r2,8(r2) 3b78: 100f883a mov r7,r2 3b7c: e1bffc17 ldw r6,-16(fp) 3b80: e17ffd17 ldw r5,-12(fp) 3b84: 1809883a mov r4,r3 3b88: 000416c0 call 416c fd->fd_flags); } 3b8c: e037883a mov sp,fp 3b90: dfc00117 ldw ra,4(sp) 3b94: df000017 ldw fp,0(sp) 3b98: dec00204 addi sp,sp,8 3b9c: f800283a ret 00003ba0 : int altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) { 3ba0: defffa04 addi sp,sp,-24 3ba4: dfc00515 stw ra,20(sp) 3ba8: df000415 stw fp,16(sp) 3bac: df000404 addi fp,sp,16 3bb0: e13ffe15 stw r4,-8(fp) 3bb4: e17ffd15 stw r5,-12(fp) 3bb8: e1bffc15 stw r6,-16(fp) altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; 3bbc: e0bffe17 ldw r2,-8(fp) 3bc0: 10800017 ldw r2,0(r2) 3bc4: e0bfff15 stw r2,-4(fp) return altera_avalon_jtag_uart_write(&dev->state, buffer, space, 3bc8: e0bfff17 ldw r2,-4(fp) 3bcc: 10c00a04 addi r3,r2,40 3bd0: e0bffe17 ldw r2,-8(fp) 3bd4: 10800217 ldw r2,8(r2) 3bd8: 100f883a mov r7,r2 3bdc: e1bffc17 ldw r6,-16(fp) 3be0: e17ffd17 ldw r5,-12(fp) 3be4: 1809883a mov r4,r3 3be8: 000438c0 call 438c fd->fd_flags); } 3bec: e037883a mov sp,fp 3bf0: dfc00117 ldw ra,4(sp) 3bf4: df000017 ldw fp,0(sp) 3bf8: dec00204 addi sp,sp,8 3bfc: f800283a ret 00003c00 : #ifndef ALTERA_AVALON_JTAG_UART_SMALL int altera_avalon_jtag_uart_close_fd(alt_fd* fd) { 3c00: defffc04 addi sp,sp,-16 3c04: dfc00315 stw ra,12(sp) 3c08: df000215 stw fp,8(sp) 3c0c: df000204 addi fp,sp,8 3c10: e13ffe15 stw r4,-8(fp) altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; 3c14: e0bffe17 ldw r2,-8(fp) 3c18: 10800017 ldw r2,0(r2) 3c1c: e0bfff15 stw r2,-4(fp) return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); 3c20: e0bfff17 ldw r2,-4(fp) 3c24: 10c00a04 addi r3,r2,40 3c28: e0bffe17 ldw r2,-8(fp) 3c2c: 10800217 ldw r2,8(r2) 3c30: 100b883a mov r5,r2 3c34: 1809883a mov r4,r3 3c38: 00040100 call 4010 } 3c3c: e037883a mov sp,fp 3c40: dfc00117 ldw ra,4(sp) 3c44: df000017 ldw fp,0(sp) 3c48: dec00204 addi sp,sp,8 3c4c: f800283a ret 00003c50 : int altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) { 3c50: defffa04 addi sp,sp,-24 3c54: dfc00515 stw ra,20(sp) 3c58: df000415 stw fp,16(sp) 3c5c: df000404 addi fp,sp,16 3c60: e13ffe15 stw r4,-8(fp) 3c64: e17ffd15 stw r5,-12(fp) 3c68: e1bffc15 stw r6,-16(fp) altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; 3c6c: e0bffe17 ldw r2,-8(fp) 3c70: 10800017 ldw r2,0(r2) 3c74: e0bfff15 stw r2,-4(fp) return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); 3c78: e0bfff17 ldw r2,-4(fp) 3c7c: 10800a04 addi r2,r2,40 3c80: e1bffc17 ldw r6,-16(fp) 3c84: e17ffd17 ldw r5,-12(fp) 3c88: 1009883a mov r4,r2 3c8c: 00040780 call 4078 } 3c90: e037883a mov sp,fp 3c94: dfc00117 ldw ra,4(sp) 3c98: df000017 ldw fp,0(sp) 3c9c: dec00204 addi sp,sp,8 3ca0: f800283a ret 00003ca4 : * Return 1 on sucessful IRQ register and 0 on failure. */ void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, int irq_controller_id, int irq) { 3ca4: defffa04 addi sp,sp,-24 3ca8: dfc00515 stw ra,20(sp) 3cac: df000415 stw fp,16(sp) 3cb0: df000404 addi fp,sp,16 3cb4: e13fff15 stw r4,-4(fp) 3cb8: e17ffe15 stw r5,-8(fp) 3cbc: e1bffd15 stw r6,-12(fp) ALT_FLAG_CREATE(&sp->events, 0); ALT_SEM_CREATE(&sp->read_lock, 1); ALT_SEM_CREATE(&sp->write_lock, 1); /* enable read interrupts at the device */ sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; 3cc0: e0bfff17 ldw r2,-4(fp) 3cc4: 00c00044 movi r3,1 3cc8: 10c00815 stw r3,32(r2) IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); 3ccc: e0bfff17 ldw r2,-4(fp) 3cd0: 10800017 ldw r2,0(r2) 3cd4: 10800104 addi r2,r2,4 3cd8: 1007883a mov r3,r2 3cdc: e0bfff17 ldw r2,-4(fp) 3ce0: 10800817 ldw r2,32(r2) 3ce4: 18800035 stwio r2,0(r3) /* register the interrupt handler */ #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, 3ce8: e0bffe17 ldw r2,-8(fp) 3cec: e0fffd17 ldw r3,-12(fp) 3cf0: d8000015 stw zero,0(sp) 3cf4: e1ffff17 ldw r7,-4(fp) 3cf8: 01800034 movhi r6,0 3cfc: 318f5904 addi r6,r6,15716 3d00: 180b883a mov r5,r3 3d04: 1009883a mov r4,r2 3d08: 00049940 call 4994 #else alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); #endif /* Register an alarm to go off every second to check for presence of host */ sp->host_inactive = 0; 3d0c: e0bfff17 ldw r2,-4(fp) 3d10: 10000915 stw zero,36(r2) if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), 3d14: e0bfff17 ldw r2,-4(fp) 3d18: 10800204 addi r2,r2,8 * Obtain the system clock rate in ticks/s. */ static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) { return _alt_tick_rate; 3d1c: d0e01617 ldw r3,-32680(gp) 3d20: e1ffff17 ldw r7,-4(fp) 3d24: 01800034 movhi r6,0 3d28: 318fdc04 addi r6,r6,16240 3d2c: 180b883a mov r5,r3 3d30: 1009883a mov r4,r2 3d34: 00046b40 call 46b4 3d38: 1000040e bge r2,zero,3d4c &altera_avalon_jtag_uart_timeout, sp) < 0) { /* If we can't set the alarm then record "don't know if host present" * and behave as though the host is present. */ sp->timeout = INT_MAX; 3d3c: e0ffff17 ldw r3,-4(fp) 3d40: 00a00034 movhi r2,32768 3d44: 10bfffc4 addi r2,r2,-1 3d48: 18800115 stw r2,4(r3) } /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); } 3d4c: 0001883a nop 3d50: e037883a mov sp,fp 3d54: dfc00117 ldw ra,4(sp) 3d58: df000017 ldw fp,0(sp) 3d5c: dec00204 addi sp,sp,8 3d60: f800283a ret 00003d64 : #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT static void altera_avalon_jtag_uart_irq(void* context) #else static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) #endif { 3d64: defff804 addi sp,sp,-32 3d68: df000715 stw fp,28(sp) 3d6c: df000704 addi fp,sp,28 3d70: e13ff915 stw r4,-28(fp) altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; 3d74: e0bff917 ldw r2,-28(fp) 3d78: e0bffd15 stw r2,-12(fp) unsigned int base = sp->base; 3d7c: e0bffd17 ldw r2,-12(fp) 3d80: 10800017 ldw r2,0(r2) 3d84: e0bffc15 stw r2,-16(fp) /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); for ( ; ; ) { unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); 3d88: e0bffc17 ldw r2,-16(fp) 3d8c: 10800104 addi r2,r2,4 3d90: 10800037 ldwio r2,0(r2) 3d94: e0bffb15 stw r2,-20(fp) /* Return once nothing more to do */ if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) 3d98: e0bffb17 ldw r2,-20(fp) 3d9c: 1080c00c andi r2,r2,768 3da0: 10006d26 beq r2,zero,3f58 break; if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) 3da4: e0bffb17 ldw r2,-20(fp) 3da8: 1080400c andi r2,r2,256 3dac: 10003526 beq r2,zero,3e84 { /* process a read irq. Start by assuming that there is data in the * receive FIFO (otherwise why would we have been interrupted?) */ unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; 3db0: 00800074 movhi r2,1 3db4: e0bfff15 stw r2,-4(fp) for ( ; ; ) { /* Check whether there is space in the buffer. If not then we must not * read any characters from the buffer as they will be lost. */ unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; 3db8: e0bffd17 ldw r2,-12(fp) 3dbc: 10800a17 ldw r2,40(r2) 3dc0: 10800044 addi r2,r2,1 3dc4: 1081ffcc andi r2,r2,2047 3dc8: e0bffa15 stw r2,-24(fp) if (next == sp->rx_out) 3dcc: e0bffd17 ldw r2,-12(fp) 3dd0: 10800b17 ldw r2,44(r2) 3dd4: e0fffa17 ldw r3,-24(fp) 3dd8: 18801526 beq r3,r2,3e30 break; /* Try to remove a character from the FIFO and find out whether there * are any more characters remaining. */ data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); 3ddc: e0bffc17 ldw r2,-16(fp) 3de0: 10800037 ldwio r2,0(r2) 3de4: e0bfff15 stw r2,-4(fp) if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) 3de8: e0bfff17 ldw r2,-4(fp) 3dec: 10a0000c andi r2,r2,32768 3df0: 10001126 beq r2,zero,3e38 break; sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; 3df4: e0bffd17 ldw r2,-12(fp) 3df8: 10800a17 ldw r2,40(r2) 3dfc: e0ffff17 ldw r3,-4(fp) 3e00: 1809883a mov r4,r3 3e04: e0fffd17 ldw r3,-12(fp) 3e08: 1885883a add r2,r3,r2 3e0c: 11000e05 stb r4,56(r2) sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; 3e10: e0bffd17 ldw r2,-12(fp) 3e14: 10800a17 ldw r2,40(r2) 3e18: 10800044 addi r2,r2,1 3e1c: 10c1ffcc andi r3,r2,2047 3e20: e0bffd17 ldw r2,-12(fp) 3e24: 10c00a15 stw r3,40(r2) * HAL. */ static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) { return 0; 3e28: 0001883a nop { 3e2c: 003fe206 br 3db8 break; 3e30: 0001883a nop 3e34: 00000106 br 3e3c break; 3e38: 0001883a nop /* Post an event to notify jtag_uart_read that a character has been read */ ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); } if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) 3e3c: e0bfff17 ldw r2,-4(fp) 3e40: 10bfffec andhi r2,r2,65535 3e44: 10000f26 beq r2,zero,3e84 { /* If there is still data available here then the buffer is full * so turn off receive interrupts until some space becomes available. */ sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; 3e48: e0bffd17 ldw r2,-12(fp) 3e4c: 10c00817 ldw r3,32(r2) 3e50: 00bfff84 movi r2,-2 3e54: 1886703a and r3,r3,r2 3e58: e0bffd17 ldw r2,-12(fp) 3e5c: 10c00815 stw r3,32(r2) IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); 3e60: e0bffc17 ldw r2,-16(fp) 3e64: 10800104 addi r2,r2,4 3e68: 1007883a mov r3,r2 3e6c: e0bffd17 ldw r2,-12(fp) 3e70: 10800817 ldw r2,32(r2) 3e74: 18800035 stwio r2,0(r3) /* Dummy read to ensure IRQ is cleared prior to ISR completion */ IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); 3e78: e0bffc17 ldw r2,-16(fp) 3e7c: 10800104 addi r2,r2,4 3e80: 10800037 ldwio r2,0(r2) } } if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) 3e84: e0bffb17 ldw r2,-20(fp) 3e88: 1080800c andi r2,r2,512 3e8c: 103fbe26 beq r2,zero,3d88 { /* process a write irq */ unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; 3e90: e0bffb17 ldw r2,-20(fp) 3e94: 1004d43a srli r2,r2,16 3e98: e0bffe15 stw r2,-8(fp) while (space > 0 && sp->tx_out != sp->tx_in) 3e9c: 00001406 br 3ef0 { IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); 3ea0: e0bffc17 ldw r2,-16(fp) 3ea4: e0fffd17 ldw r3,-12(fp) 3ea8: 18c00d17 ldw r3,52(r3) 3eac: e13ffd17 ldw r4,-12(fp) 3eb0: 20c7883a add r3,r4,r3 3eb4: 18c20e03 ldbu r3,2104(r3) 3eb8: 18c03fcc andi r3,r3,255 3ebc: 18c0201c xori r3,r3,128 3ec0: 18ffe004 addi r3,r3,-128 3ec4: 10c00035 stwio r3,0(r2) sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; 3ec8: e0bffd17 ldw r2,-12(fp) 3ecc: 10800d17 ldw r2,52(r2) 3ed0: 10800044 addi r2,r2,1 3ed4: 10c1ffcc andi r3,r2,2047 3ed8: e0bffd17 ldw r2,-12(fp) 3edc: 10c00d15 stw r3,52(r2) 3ee0: 0001883a nop /* Post an event to notify jtag_uart_write that a character has been written */ ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); space--; 3ee4: e0bffe17 ldw r2,-8(fp) 3ee8: 10bfffc4 addi r2,r2,-1 3eec: e0bffe15 stw r2,-8(fp) while (space > 0 && sp->tx_out != sp->tx_in) 3ef0: e0bffe17 ldw r2,-8(fp) 3ef4: 10000526 beq r2,zero,3f0c 3ef8: e0bffd17 ldw r2,-12(fp) 3efc: 10c00d17 ldw r3,52(r2) 3f00: e0bffd17 ldw r2,-12(fp) 3f04: 10800c17 ldw r2,48(r2) 3f08: 18bfe51e bne r3,r2,3ea0 } if (space > 0) 3f0c: e0bffe17 ldw r2,-8(fp) 3f10: 103f9d26 beq r2,zero,3d88 { /* If we don't have any more data available then turn off the TX interrupt */ sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; 3f14: e0bffd17 ldw r2,-12(fp) 3f18: 10c00817 ldw r3,32(r2) 3f1c: 00bfff44 movi r2,-3 3f20: 1886703a and r3,r3,r2 3f24: e0bffd17 ldw r2,-12(fp) 3f28: 10c00815 stw r3,32(r2) IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); 3f2c: e0bffd17 ldw r2,-12(fp) 3f30: 10800017 ldw r2,0(r2) 3f34: 10800104 addi r2,r2,4 3f38: 1007883a mov r3,r2 3f3c: e0bffd17 ldw r2,-12(fp) 3f40: 10800817 ldw r2,32(r2) 3f44: 18800035 stwio r2,0(r3) /* Dummy read to ensure IRQ is cleared prior to ISR completion */ IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); 3f48: e0bffc17 ldw r2,-16(fp) 3f4c: 10800104 addi r2,r2,4 3f50: 10800037 ldwio r2,0(r2) { 3f54: 003f8c06 br 3d88 break; 3f58: 0001883a nop } } } } 3f5c: 0001883a nop 3f60: e037883a mov sp,fp 3f64: df000017 ldw fp,0(sp) 3f68: dec00104 addi sp,sp,4 3f6c: f800283a ret 00003f70 : * Timeout routine is called every second */ static alt_u32 altera_avalon_jtag_uart_timeout(void* context) { 3f70: defffc04 addi sp,sp,-16 3f74: df000315 stw fp,12(sp) 3f78: df000304 addi fp,sp,12 3f7c: e13ffd15 stw r4,-12(fp) altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; 3f80: e0bffd17 ldw r2,-12(fp) 3f84: e0bfff15 stw r2,-4(fp) unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); 3f88: e0bfff17 ldw r2,-4(fp) 3f8c: 10800017 ldw r2,0(r2) 3f90: 10800104 addi r2,r2,4 3f94: 10800037 ldwio r2,0(r2) 3f98: e0bffe15 stw r2,-8(fp) if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) 3f9c: e0bffe17 ldw r2,-8(fp) 3fa0: 1081000c andi r2,r2,1024 3fa4: 10000b26 beq r2,zero,3fd4 { IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); 3fa8: e0bfff17 ldw r2,-4(fp) 3fac: 10800017 ldw r2,0(r2) 3fb0: 10800104 addi r2,r2,4 3fb4: 1007883a mov r3,r2 3fb8: e0bfff17 ldw r2,-4(fp) 3fbc: 10800817 ldw r2,32(r2) 3fc0: 10810014 ori r2,r2,1024 3fc4: 18800035 stwio r2,0(r3) sp->host_inactive = 0; 3fc8: e0bfff17 ldw r2,-4(fp) 3fcc: 10000915 stw zero,36(r2) 3fd0: 00000a06 br 3ffc } else if (sp->host_inactive < INT_MAX - 2) { 3fd4: e0bfff17 ldw r2,-4(fp) 3fd8: 10c00917 ldw r3,36(r2) 3fdc: 00a00034 movhi r2,32768 3fe0: 10bfff04 addi r2,r2,-4 3fe4: 10c00536 bltu r2,r3,3ffc sp->host_inactive++; 3fe8: e0bfff17 ldw r2,-4(fp) 3fec: 10800917 ldw r2,36(r2) 3ff0: 10c00044 addi r3,r2,1 3ff4: e0bfff17 ldw r2,-4(fp) 3ff8: 10c00915 stw r3,36(r2) 3ffc: d0a01617 ldw r2,-32680(gp) ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); } } return alt_ticks_per_second(); } 4000: e037883a mov sp,fp 4004: df000017 ldw fp,0(sp) 4008: dec00104 addi sp,sp,4 400c: f800283a ret 00004010 : * The close routine is not implemented for the small driver; instead it will * map to null. This is because the small driver simply waits while characters * are transmitted; there is no interrupt-serviced buffer to empty */ int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) { 4010: defffd04 addi sp,sp,-12 4014: df000215 stw fp,8(sp) 4018: df000204 addi fp,sp,8 401c: e13fff15 stw r4,-4(fp) 4020: e17ffe15 stw r5,-8(fp) /* * Wait for all transmit data to be emptied by the JTAG UART ISR, or * for a host-inactivity timeout, in which case transmit data will be lost */ while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { 4024: 00000506 br 403c if (flags & O_NONBLOCK) { 4028: e0bffe17 ldw r2,-8(fp) 402c: 1090000c andi r2,r2,16384 4030: 10000226 beq r2,zero,403c return -EWOULDBLOCK; 4034: 00bffd44 movi r2,-11 4038: 00000b06 br 4068 while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { 403c: e0bfff17 ldw r2,-4(fp) 4040: 10c00d17 ldw r3,52(r2) 4044: e0bfff17 ldw r2,-4(fp) 4048: 10800c17 ldw r2,48(r2) 404c: 18800526 beq r3,r2,4064 4050: e0bfff17 ldw r2,-4(fp) 4054: 10c00917 ldw r3,36(r2) 4058: e0bfff17 ldw r2,-4(fp) 405c: 10800117 ldw r2,4(r2) 4060: 18bff136 bltu r3,r2,4028 } } return 0; 4064: 0005883a mov r2,zero } 4068: e037883a mov sp,fp 406c: df000017 ldw fp,0(sp) 4070: dec00104 addi sp,sp,4 4074: f800283a ret 00004078 : /* ----------------------------------------------------------- */ int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, void* arg) { 4078: defffa04 addi sp,sp,-24 407c: df000515 stw fp,20(sp) 4080: df000504 addi fp,sp,20 4084: e13ffd15 stw r4,-12(fp) 4088: e17ffc15 stw r5,-16(fp) 408c: e1bffb15 stw r6,-20(fp) int rc = -ENOTTY; 4090: 00bff9c4 movi r2,-25 4094: e0bfff15 stw r2,-4(fp) switch (req) 4098: e0bffc17 ldw r2,-16(fp) 409c: 109a8060 cmpeqi r2,r2,27137 40a0: 1000041e bne r2,zero,40b4 40a4: e0bffc17 ldw r2,-16(fp) 40a8: 109a80a0 cmpeqi r2,r2,27138 40ac: 1000181e bne r2,zero,4110 rc = 0; } break; default: break; 40b0: 00002906 br 4158 if (sp->timeout != INT_MAX) 40b4: e0bffd17 ldw r2,-12(fp) 40b8: 10c00117 ldw r3,4(r2) 40bc: 00a00034 movhi r2,32768 40c0: 10bfffc4 addi r2,r2,-1 40c4: 18802126 beq r3,r2,414c int timeout = *((int *)arg); 40c8: e0bffb17 ldw r2,-20(fp) 40cc: 10800017 ldw r2,0(r2) 40d0: e0bffe15 stw r2,-8(fp) sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; 40d4: e0bffe17 ldw r2,-8(fp) 40d8: 10800090 cmplti r2,r2,2 40dc: 1000061e bne r2,zero,40f8 40e0: e0fffe17 ldw r3,-8(fp) 40e4: 00a00034 movhi r2,32768 40e8: 10bfffc4 addi r2,r2,-1 40ec: 18800226 beq r3,r2,40f8 40f0: e0bffe17 ldw r2,-8(fp) 40f4: 00000206 br 4100 40f8: 00a00034 movhi r2,32768 40fc: 10bfff84 addi r2,r2,-2 4100: e0fffd17 ldw r3,-12(fp) 4104: 18800115 stw r2,4(r3) rc = 0; 4108: e03fff15 stw zero,-4(fp) break; 410c: 00000f06 br 414c if (sp->timeout != INT_MAX) 4110: e0bffd17 ldw r2,-12(fp) 4114: 10c00117 ldw r3,4(r2) 4118: 00a00034 movhi r2,32768 411c: 10bfffc4 addi r2,r2,-1 4120: 18800c26 beq r3,r2,4154 *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; 4124: e0bffd17 ldw r2,-12(fp) 4128: 10c00917 ldw r3,36(r2) 412c: e0bffd17 ldw r2,-12(fp) 4130: 10800117 ldw r2,4(r2) 4134: 1885803a cmpltu r2,r3,r2 4138: 10c03fcc andi r3,r2,255 413c: e0bffb17 ldw r2,-20(fp) 4140: 10c00015 stw r3,0(r2) rc = 0; 4144: e03fff15 stw zero,-4(fp) break; 4148: 00000206 br 4154 break; 414c: 0001883a nop 4150: 00000106 br 4158 break; 4154: 0001883a nop } return rc; 4158: e0bfff17 ldw r2,-4(fp) } 415c: e037883a mov sp,fp 4160: df000017 ldw fp,0(sp) 4164: dec00104 addi sp,sp,4 4168: f800283a ret 0000416c : /* ----------------------------------------------------------- */ int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, char * buffer, int space, int flags) { 416c: defff304 addi sp,sp,-52 4170: dfc00c15 stw ra,48(sp) 4174: df000b15 stw fp,44(sp) 4178: df000b04 addi fp,sp,44 417c: e13ff815 stw r4,-32(fp) 4180: e17ff715 stw r5,-36(fp) 4184: e1bff615 stw r6,-40(fp) 4188: e1fff515 stw r7,-44(fp) char * ptr = buffer; 418c: e0bff717 ldw r2,-36(fp) 4190: e0bfff15 stw r2,-4(fp) * When running in a multi threaded environment, obtain the "read_lock" * semaphore. This ensures that reading from the device is thread-safe. */ ALT_SEM_PEND (sp->read_lock, 0); while (space > 0) 4194: 00004706 br 42b4 unsigned int in, out; /* Read as much data as possible */ do { in = sp->rx_in; 4198: e0bff817 ldw r2,-32(fp) 419c: 10800a17 ldw r2,40(r2) 41a0: e0bffd15 stw r2,-12(fp) out = sp->rx_out; 41a4: e0bff817 ldw r2,-32(fp) 41a8: 10800b17 ldw r2,44(r2) 41ac: e0bffc15 stw r2,-16(fp) if (in >= out) 41b0: e0fffd17 ldw r3,-12(fp) 41b4: e0bffc17 ldw r2,-16(fp) 41b8: 18800536 bltu r3,r2,41d0 n = in - out; 41bc: e0fffd17 ldw r3,-12(fp) 41c0: e0bffc17 ldw r2,-16(fp) 41c4: 1885c83a sub r2,r3,r2 41c8: e0bffe15 stw r2,-8(fp) 41cc: 00000406 br 41e0 else n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; 41d0: 00c20004 movi r3,2048 41d4: e0bffc17 ldw r2,-16(fp) 41d8: 1885c83a sub r2,r3,r2 41dc: e0bffe15 stw r2,-8(fp) if (n == 0) 41e0: e0bffe17 ldw r2,-8(fp) 41e4: 10001e26 beq r2,zero,4260 break; /* No more data available */ if (n > space) 41e8: e0fff617 ldw r3,-40(fp) 41ec: e0bffe17 ldw r2,-8(fp) 41f0: 1880022e bgeu r3,r2,41fc n = space; 41f4: e0bff617 ldw r2,-40(fp) 41f8: e0bffe15 stw r2,-8(fp) memcpy(ptr, sp->rx_buf + out, n); 41fc: e0bff817 ldw r2,-32(fp) 4200: 10c00e04 addi r3,r2,56 4204: e0bffc17 ldw r2,-16(fp) 4208: 1885883a add r2,r3,r2 420c: e1bffe17 ldw r6,-8(fp) 4210: 100b883a mov r5,r2 4214: e13fff17 ldw r4,-4(fp) 4218: 00016f40 call 16f4 ptr += n; 421c: e0ffff17 ldw r3,-4(fp) 4220: e0bffe17 ldw r2,-8(fp) 4224: 1885883a add r2,r3,r2 4228: e0bfff15 stw r2,-4(fp) space -= n; 422c: e0fff617 ldw r3,-40(fp) 4230: e0bffe17 ldw r2,-8(fp) 4234: 1885c83a sub r2,r3,r2 4238: e0bff615 stw r2,-40(fp) sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; 423c: e0fffc17 ldw r3,-16(fp) 4240: e0bffe17 ldw r2,-8(fp) 4244: 1885883a add r2,r3,r2 4248: 10c1ffcc andi r3,r2,2047 424c: e0bff817 ldw r2,-32(fp) 4250: 10c00b15 stw r3,44(r2) } while (space > 0); 4254: e0bff617 ldw r2,-40(fp) 4258: 00bfcf16 blt zero,r2,4198 425c: 00000106 br 4264 break; /* No more data available */ 4260: 0001883a nop /* If we read any data then return it */ if (ptr != buffer) 4264: e0ffff17 ldw r3,-4(fp) 4268: e0bff717 ldw r2,-36(fp) 426c: 1880141e bne r3,r2,42c0 break; /* If in non-blocking mode then return error */ if (flags & O_NONBLOCK) 4270: e0bff517 ldw r2,-44(fp) 4274: 1090000c andi r2,r2,16384 4278: 1000131e bne r2,zero,42c8 while (in == sp->rx_in && sp->host_inactive < sp->timeout) ; } #else /* No OS: Always spin */ while (in == sp->rx_in && sp->host_inactive < sp->timeout) 427c: 0001883a nop 4280: e0bff817 ldw r2,-32(fp) 4284: 10800a17 ldw r2,40(r2) 4288: e0fffd17 ldw r3,-12(fp) 428c: 1880051e bne r3,r2,42a4 4290: e0bff817 ldw r2,-32(fp) 4294: 10c00917 ldw r3,36(r2) 4298: e0bff817 ldw r2,-32(fp) 429c: 10800117 ldw r2,4(r2) 42a0: 18bff736 bltu r3,r2,4280 ; #endif /* __ucosii__ */ if (in == sp->rx_in) 42a4: e0bff817 ldw r2,-32(fp) 42a8: 10800a17 ldw r2,40(r2) 42ac: e0fffd17 ldw r3,-12(fp) 42b0: 18800726 beq r3,r2,42d0 while (space > 0) 42b4: e0bff617 ldw r2,-40(fp) 42b8: 00bfb716 blt zero,r2,4198 42bc: 00000506 br 42d4 break; 42c0: 0001883a nop 42c4: 00000306 br 42d4 break; 42c8: 0001883a nop 42cc: 00000106 br 42d4 break; 42d0: 0001883a nop * semaphore so that other threads can access the buffer. */ ALT_SEM_POST (sp->read_lock); if (ptr != buffer) 42d4: e0ffff17 ldw r3,-4(fp) 42d8: e0bff717 ldw r2,-36(fp) 42dc: 18801926 beq r3,r2,4344 NIOS2_READ_STATUS (context); 42e0: 0005303a rdctl r2,status 42e4: e0bff915 stw r2,-28(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 42e8: e0fff917 ldw r3,-28(fp) 42ec: 00bfff84 movi r2,-2 42f0: 1884703a and r2,r3,r2 42f4: 1001703a wrctl status,r2 return context; 42f8: e0bff917 ldw r2,-28(fp) { /* If we read any data then there is space in the buffer so enable interrupts */ context = alt_irq_disable_all(); 42fc: e0bffb15 stw r2,-20(fp) sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; 4300: e0bff817 ldw r2,-32(fp) 4304: 10800817 ldw r2,32(r2) 4308: 10c00054 ori r3,r2,1 430c: e0bff817 ldw r2,-32(fp) 4310: 10c00815 stw r3,32(r2) IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); 4314: e0bff817 ldw r2,-32(fp) 4318: 10800017 ldw r2,0(r2) 431c: 10800104 addi r2,r2,4 4320: 1007883a mov r3,r2 4324: e0bff817 ldw r2,-32(fp) 4328: 10800817 ldw r2,32(r2) 432c: 18800035 stwio r2,0(r3) 4330: e0bffb17 ldw r2,-20(fp) 4334: e0bffa15 stw r2,-24(fp) NIOS2_WRITE_STATUS (context); 4338: e0bffa17 ldw r2,-24(fp) 433c: 1001703a wrctl status,r2 } 4340: 0001883a nop alt_irq_enable_all(context); } if (ptr != buffer) 4344: e0ffff17 ldw r3,-4(fp) 4348: e0bff717 ldw r2,-36(fp) 434c: 18800426 beq r3,r2,4360 return ptr - buffer; 4350: e0ffff17 ldw r3,-4(fp) 4354: e0bff717 ldw r2,-36(fp) 4358: 1885c83a sub r2,r3,r2 435c: 00000606 br 4378 else if (flags & O_NONBLOCK) 4360: e0bff517 ldw r2,-44(fp) 4364: 1090000c andi r2,r2,16384 4368: 10000226 beq r2,zero,4374 return -EWOULDBLOCK; 436c: 00bffd44 movi r2,-11 4370: 00000106 br 4378 else return -EIO; 4374: 00bffec4 movi r2,-5 } 4378: e037883a mov sp,fp 437c: dfc00117 ldw ra,4(sp) 4380: df000017 ldw fp,0(sp) 4384: dec00204 addi sp,sp,8 4388: f800283a ret 0000438c : /* ----------------------------------------------------------- */ int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, const char * ptr, int count, int flags) { 438c: defff304 addi sp,sp,-52 4390: dfc00c15 stw ra,48(sp) 4394: df000b15 stw fp,44(sp) 4398: df000b04 addi fp,sp,44 439c: e13ff815 stw r4,-32(fp) 43a0: e17ff715 stw r5,-36(fp) 43a4: e1bff615 stw r6,-40(fp) 43a8: e1fff515 stw r7,-44(fp) /* Remove warning at optimisation level 03 by seting out to 0 */ unsigned int in, out=0; 43ac: e03fff15 stw zero,-4(fp) unsigned int n; alt_irq_context context; const char * start = ptr; 43b0: e0bff717 ldw r2,-36(fp) 43b4: e0bffd15 stw r2,-12(fp) ALT_SEM_PEND (sp->write_lock, 0); do { /* Copy as much as we can into the transmit buffer */ while (count > 0) 43b8: 00003706 br 4498 { /* We need a stable value of the out pointer to calculate the space available */ in = sp->tx_in; 43bc: e0bff817 ldw r2,-32(fp) 43c0: 10800c17 ldw r2,48(r2) 43c4: e0bffc15 stw r2,-16(fp) out = sp->tx_out; 43c8: e0bff817 ldw r2,-32(fp) 43cc: 10800d17 ldw r2,52(r2) 43d0: e0bfff15 stw r2,-4(fp) if (in < out) 43d4: e0fffc17 ldw r3,-16(fp) 43d8: e0bfff17 ldw r2,-4(fp) 43dc: 1880062e bgeu r3,r2,43f8 n = out - 1 - in; 43e0: e0ffff17 ldw r3,-4(fp) 43e4: e0bffc17 ldw r2,-16(fp) 43e8: 1885c83a sub r2,r3,r2 43ec: 10bfffc4 addi r2,r2,-1 43f0: e0bffe15 stw r2,-8(fp) 43f4: 00000b06 br 4424 else if (out > 0) 43f8: e0bfff17 ldw r2,-4(fp) 43fc: 10000526 beq r2,zero,4414 n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; 4400: 00c20004 movi r3,2048 4404: e0bffc17 ldw r2,-16(fp) 4408: 1885c83a sub r2,r3,r2 440c: e0bffe15 stw r2,-8(fp) 4410: 00000406 br 4424 else n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; 4414: 00c1ffc4 movi r3,2047 4418: e0bffc17 ldw r2,-16(fp) 441c: 1885c83a sub r2,r3,r2 4420: e0bffe15 stw r2,-8(fp) if (n == 0) 4424: e0bffe17 ldw r2,-8(fp) 4428: 10001e26 beq r2,zero,44a4 break; if (n > count) 442c: e0fff617 ldw r3,-40(fp) 4430: e0bffe17 ldw r2,-8(fp) 4434: 1880022e bgeu r3,r2,4440 n = count; 4438: e0bff617 ldw r2,-40(fp) 443c: e0bffe15 stw r2,-8(fp) memcpy(sp->tx_buf + in, ptr, n); 4440: e0bff817 ldw r2,-32(fp) 4444: 10c20e04 addi r3,r2,2104 4448: e0bffc17 ldw r2,-16(fp) 444c: 1885883a add r2,r3,r2 4450: e1bffe17 ldw r6,-8(fp) 4454: e17ff717 ldw r5,-36(fp) 4458: 1009883a mov r4,r2 445c: 00016f40 call 16f4 ptr += n; 4460: e0fff717 ldw r3,-36(fp) 4464: e0bffe17 ldw r2,-8(fp) 4468: 1885883a add r2,r3,r2 446c: e0bff715 stw r2,-36(fp) count -= n; 4470: e0fff617 ldw r3,-40(fp) 4474: e0bffe17 ldw r2,-8(fp) 4478: 1885c83a sub r2,r3,r2 447c: e0bff615 stw r2,-40(fp) sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; 4480: e0fffc17 ldw r3,-16(fp) 4484: e0bffe17 ldw r2,-8(fp) 4488: 1885883a add r2,r3,r2 448c: 10c1ffcc andi r3,r2,2047 4490: e0bff817 ldw r2,-32(fp) 4494: 10c00c15 stw r3,48(r2) while (count > 0) 4498: e0bff617 ldw r2,-40(fp) 449c: 00bfc716 blt zero,r2,43bc 44a0: 00000106 br 44a8 break; 44a4: 0001883a nop NIOS2_READ_STATUS (context); 44a8: 0005303a rdctl r2,status 44ac: e0bff915 stw r2,-28(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 44b0: e0fff917 ldw r3,-28(fp) 44b4: 00bfff84 movi r2,-2 44b8: 1884703a and r2,r3,r2 44bc: 1001703a wrctl status,r2 return context; 44c0: e0bff917 ldw r2,-28(fp) * to enable interrupts if there is no space left in the FIFO * * For now kick the interrupt routine every time to make it transmit * the data */ context = alt_irq_disable_all(); 44c4: e0bffb15 stw r2,-20(fp) sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; 44c8: e0bff817 ldw r2,-32(fp) 44cc: 10800817 ldw r2,32(r2) 44d0: 10c00094 ori r3,r2,2 44d4: e0bff817 ldw r2,-32(fp) 44d8: 10c00815 stw r3,32(r2) IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); 44dc: e0bff817 ldw r2,-32(fp) 44e0: 10800017 ldw r2,0(r2) 44e4: 10800104 addi r2,r2,4 44e8: 1007883a mov r3,r2 44ec: e0bff817 ldw r2,-32(fp) 44f0: 10800817 ldw r2,32(r2) 44f4: 18800035 stwio r2,0(r3) 44f8: e0bffb17 ldw r2,-20(fp) 44fc: e0bffa15 stw r2,-24(fp) NIOS2_WRITE_STATUS (context); 4500: e0bffa17 ldw r2,-24(fp) 4504: 1001703a wrctl status,r2 } 4508: 0001883a nop /* * If there is any data left then either return now or block until * some has been sent */ /* consider: test whether there is anything there while doing this and delay for at most 2s. */ if (count > 0) 450c: e0bff617 ldw r2,-40(fp) 4510: 0080100e bge zero,r2,4554 { if (flags & O_NONBLOCK) 4514: e0bff517 ldw r2,-44(fp) 4518: 1090000c andi r2,r2,16384 451c: 1000101e bne r2,zero,4560 /* * No OS present: Always wait for data to be removed from buffer. Once * the interrupt routine has removed some data then we will be able to * insert some more. */ while (out == sp->tx_out && sp->host_inactive < sp->timeout) 4520: 0001883a nop 4524: e0bff817 ldw r2,-32(fp) 4528: 10800d17 ldw r2,52(r2) 452c: e0ffff17 ldw r3,-4(fp) 4530: 1880051e bne r3,r2,4548 4534: e0bff817 ldw r2,-32(fp) 4538: 10c00917 ldw r3,36(r2) 453c: e0bff817 ldw r2,-32(fp) 4540: 10800117 ldw r2,4(r2) 4544: 18bff736 bltu r3,r2,4524 ; #endif /* __ucosii__ */ if (sp->host_inactive) 4548: e0bff817 ldw r2,-32(fp) 454c: 10800917 ldw r2,36(r2) 4550: 1000051e bne r2,zero,4568 break; } } while (count > 0); 4554: e0bff617 ldw r2,-40(fp) 4558: 00bfcf16 blt zero,r2,4498 455c: 00000306 br 456c break; 4560: 0001883a nop 4564: 00000106 br 456c break; 4568: 0001883a nop * Now that access to the circular buffer is complete, release the write * semaphore so that other threads can access the buffer. */ ALT_SEM_POST (sp->write_lock); if (ptr != start) 456c: e0fff717 ldw r3,-36(fp) 4570: e0bffd17 ldw r2,-12(fp) 4574: 18800426 beq r3,r2,4588 return ptr - start; 4578: e0fff717 ldw r3,-36(fp) 457c: e0bffd17 ldw r2,-12(fp) 4580: 1885c83a sub r2,r3,r2 4584: 00000606 br 45a0 else if (flags & O_NONBLOCK) 4588: e0bff517 ldw r2,-44(fp) 458c: 1090000c andi r2,r2,16384 4590: 10000226 beq r2,zero,459c return -EWOULDBLOCK; 4594: 00bffd44 movi r2,-11 4598: 00000106 br 45a0 sp->tx_out = sp->tx_in = 0; return ptr - start + count; } #endif else return -EIO; /* Host not connected */ 459c: 00bffec4 movi r2,-5 } 45a0: e037883a mov sp,fp 45a4: dfc00117 ldw ra,4(sp) 45a8: df000017 ldw fp,0(sp) 45ac: dec00204 addi sp,sp,8 45b0: f800283a ret 000045b4 : #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT static void alt_avalon_timer_sc_irq (void* base) #else static void alt_avalon_timer_sc_irq (void* base, alt_u32 id) #endif { 45b4: defffa04 addi sp,sp,-24 45b8: dfc00515 stw ra,20(sp) 45bc: df000415 stw fp,16(sp) 45c0: df000404 addi fp,sp,16 45c4: e13ffc15 stw r4,-16(fp) alt_irq_context cpu_sr; /* clear the interrupt */ IOWR_ALTERA_AVALON_TIMER_STATUS (base, 0); 45c8: 0007883a mov r3,zero 45cc: e0bffc17 ldw r2,-16(fp) 45d0: 10c00035 stwio r3,0(r2) /* * Dummy read to ensure IRQ is negated before the ISR returns. * The control register is read because reading the status * register has side-effects per the register map documentation. */ IORD_ALTERA_AVALON_TIMER_CONTROL (base); 45d4: e0bffc17 ldw r2,-16(fp) 45d8: 10800104 addi r2,r2,4 45dc: 10800037 ldwio r2,0(r2) NIOS2_READ_STATUS (context); 45e0: 0005303a rdctl r2,status 45e4: e0bffd15 stw r2,-12(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 45e8: e0fffd17 ldw r3,-12(fp) 45ec: 00bfff84 movi r2,-2 45f0: 1884703a and r2,r3,r2 45f4: 1001703a wrctl status,r2 return context; 45f8: e0bffd17 ldw r2,-12(fp) /* * Notify the system of a clock tick. disable interrupts * during this time to safely support ISR preemption */ cpu_sr = alt_irq_disable_all(); 45fc: e0bfff15 stw r2,-4(fp) alt_tick (); 4600: 00050980 call 5098 4604: e0bfff17 ldw r2,-4(fp) 4608: e0bffe15 stw r2,-8(fp) NIOS2_WRITE_STATUS (context); 460c: e0bffe17 ldw r2,-8(fp) 4610: 1001703a wrctl status,r2 } 4614: 0001883a nop alt_irq_enable_all(cpu_sr); } 4618: 0001883a nop 461c: e037883a mov sp,fp 4620: dfc00117 ldw ra,4(sp) 4624: df000017 ldw fp,0(sp) 4628: dec00204 addi sp,sp,8 462c: f800283a ret 00004630 : * auto-generated alt_sys_init() function. */ void alt_avalon_timer_sc_init (void* base, alt_u32 irq_controller_id, alt_u32 irq, alt_u32 freq) { 4630: defff804 addi sp,sp,-32 4634: dfc00715 stw ra,28(sp) 4638: df000615 stw fp,24(sp) 463c: df000604 addi fp,sp,24 4640: e13ffe15 stw r4,-8(fp) 4644: e17ffd15 stw r5,-12(fp) 4648: e1bffc15 stw r6,-16(fp) 464c: e1fffb15 stw r7,-20(fp) 4650: e0bffb17 ldw r2,-20(fp) 4654: e0bfff15 stw r2,-4(fp) * in order to initialise the value of the clock frequency. */ static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) { if (! _alt_tick_rate) 4658: d0a01617 ldw r2,-32680(gp) 465c: 1000031e bne r2,zero,466c { _alt_tick_rate = nticks; 4660: e0bfff17 ldw r2,-4(fp) 4664: d0a01615 stw r2,-32680(gp) return 0; 4668: 00000106 br 4670 } else { return -1; 466c: 0001883a nop alt_sysclk_init (freq); /* set to free running mode */ IOWR_ALTERA_AVALON_TIMER_CONTROL (base, 4670: e0bffe17 ldw r2,-8(fp) 4674: 10800104 addi r2,r2,4 4678: 00c001c4 movi r3,7 467c: 10c00035 stwio r3,0(r2) ALTERA_AVALON_TIMER_CONTROL_CONT_MSK | ALTERA_AVALON_TIMER_CONTROL_START_MSK); /* register the interrupt handler, and enable the interrupt */ #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT alt_ic_isr_register(irq_controller_id, irq, alt_avalon_timer_sc_irq, 4680: d8000015 stw zero,0(sp) 4684: e1fffe17 ldw r7,-8(fp) 4688: 01800034 movhi r6,0 468c: 31916d04 addi r6,r6,17844 4690: e17ffc17 ldw r5,-16(fp) 4694: e13ffd17 ldw r4,-12(fp) 4698: 00049940 call 4994 base, NULL); #else alt_irq_register (irq, base, alt_avalon_timer_sc_irq); #endif } 469c: 0001883a nop 46a0: e037883a mov sp,fp 46a4: dfc00117 ldw ra,4(sp) 46a8: df000017 ldw fp,0(sp) 46ac: dec00204 addi sp,sp,8 46b0: f800283a ret 000046b4 : */ int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, alt_u32 (*callback) (void* context), void* context) { 46b4: defff504 addi sp,sp,-44 46b8: df000a15 stw fp,40(sp) 46bc: df000a04 addi fp,sp,40 46c0: e13ff915 stw r4,-28(fp) 46c4: e17ff815 stw r5,-32(fp) 46c8: e1bff715 stw r6,-36(fp) 46cc: e1fff615 stw r7,-40(fp) alt_irq_context irq_context; alt_u32 current_nticks = 0; 46d0: e03fff15 stw zero,-4(fp) return _alt_tick_rate; 46d4: d0a01617 ldw r2,-32680(gp) if (alt_ticks_per_second ()) 46d8: 10003e26 beq r2,zero,47d4 { if (alarm) 46dc: e0bff917 ldw r2,-28(fp) 46e0: 10003a26 beq r2,zero,47cc { alarm->callback = callback; 46e4: e0bff917 ldw r2,-28(fp) 46e8: e0fff717 ldw r3,-36(fp) 46ec: 10c00315 stw r3,12(r2) alarm->context = context; 46f0: e0bff917 ldw r2,-28(fp) 46f4: e0fff617 ldw r3,-40(fp) 46f8: 10c00515 stw r3,20(r2) NIOS2_READ_STATUS (context); 46fc: 0005303a rdctl r2,status 4700: e0bffd15 stw r2,-12(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 4704: e0fffd17 ldw r3,-12(fp) 4708: 00bfff84 movi r2,-2 470c: 1884703a and r2,r3,r2 4710: 1001703a wrctl status,r2 return context; 4714: e0bffd17 ldw r2,-12(fp) irq_context = alt_irq_disable_all (); 4718: e0bffe15 stw r2,-8(fp) * alt_nticks() returns the elapsed number of system clock ticks since reset. */ static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) { return _alt_nticks; 471c: d0a01717 ldw r2,-32676(gp) current_nticks = alt_nticks(); 4720: e0bfff15 stw r2,-4(fp) alarm->time = nticks + current_nticks + 1; 4724: e0fff817 ldw r3,-32(fp) 4728: e0bfff17 ldw r2,-4(fp) 472c: 1885883a add r2,r3,r2 4730: 10c00044 addi r3,r2,1 4734: e0bff917 ldw r2,-28(fp) 4738: 10c00215 stw r3,8(r2) /* * If the desired alarm time causes a roll-over, set the rollover * flag. This will prevent the subsequent tick event from causing * an alarm too early. */ if(alarm->time < current_nticks) 473c: e0bff917 ldw r2,-28(fp) 4740: 10c00217 ldw r3,8(r2) 4744: e0bfff17 ldw r2,-4(fp) 4748: 1880042e bgeu r3,r2,475c { alarm->rollover = 1; 474c: e0bff917 ldw r2,-28(fp) 4750: 00c00044 movi r3,1 4754: 10c00405 stb r3,16(r2) 4758: 00000206 br 4764 } else { alarm->rollover = 0; 475c: e0bff917 ldw r2,-28(fp) 4760: 10000405 stb zero,16(r2) } alt_llist_insert (&alt_alarm_list, &alarm->llist); 4764: e0bff917 ldw r2,-28(fp) 4768: d0e00c04 addi r3,gp,-32720 476c: e0fffb15 stw r3,-20(fp) 4770: e0bffa15 stw r2,-24(fp) */ static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, alt_llist* entry) { entry->previous = list; 4774: e0bffa17 ldw r2,-24(fp) 4778: e0fffb17 ldw r3,-20(fp) 477c: 10c00115 stw r3,4(r2) entry->next = list->next; 4780: e0bffb17 ldw r2,-20(fp) 4784: 10c00017 ldw r3,0(r2) 4788: e0bffa17 ldw r2,-24(fp) 478c: 10c00015 stw r3,0(r2) list->next->previous = entry; 4790: e0bffb17 ldw r2,-20(fp) 4794: 10800017 ldw r2,0(r2) 4798: e0fffa17 ldw r3,-24(fp) 479c: 10c00115 stw r3,4(r2) list->next = entry; 47a0: e0bffb17 ldw r2,-20(fp) 47a4: e0fffa17 ldw r3,-24(fp) 47a8: 10c00015 stw r3,0(r2) } 47ac: 0001883a nop 47b0: e0bffe17 ldw r2,-8(fp) 47b4: e0bffc15 stw r2,-16(fp) NIOS2_WRITE_STATUS (context); 47b8: e0bffc17 ldw r2,-16(fp) 47bc: 1001703a wrctl status,r2 } 47c0: 0001883a nop alt_irq_enable_all (irq_context); return 0; 47c4: 0005883a mov r2,zero 47c8: 00000306 br 47d8 } else { return -EINVAL; 47cc: 00bffa84 movi r2,-22 47d0: 00000106 br 47d8 } } else { return -ENOTSUP; 47d4: 00bfde84 movi r2,-134 } } 47d8: e037883a mov sp,fp 47dc: df000017 ldw fp,0(sp) 47e0: dec00104 addi sp,sp,4 47e4: f800283a ret 000047e8 : { 47e8: defffe04 addi sp,sp,-8 47ec: dfc00115 stw ra,4(sp) 47f0: df000015 stw fp,0(sp) 47f4: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 47f8: d0a00917 ldw r2,-32732(gp) 47fc: 10000326 beq r2,zero,480c 4800: d0a00917 ldw r2,-32732(gp) 4804: 103ee83a callr r2 4808: 00000106 br 4810 480c: d0a01104 addi r2,gp,-32700 } 4810: e037883a mov sp,fp 4814: dfc00117 ldw ra,4(sp) 4818: df000017 ldw fp,0(sp) 481c: dec00204 addi sp,sp,8 4820: f800283a ret 00004824 : /* * */ int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) { 4824: defffa04 addi sp,sp,-24 4828: dfc00515 stw ra,20(sp) 482c: df000415 stw fp,16(sp) 4830: df000404 addi fp,sp,16 4834: e13ffd15 stw r4,-12(fp) 4838: e17ffc15 stw r5,-16(fp) /* * check that the device exists, and that it has a valid name. */ if (!dev || !dev->name) 483c: e0bffd17 ldw r2,-12(fp) 4840: 10000326 beq r2,zero,4850 4844: e0bffd17 ldw r2,-12(fp) 4848: 10800217 ldw r2,8(r2) 484c: 1000061e bne r2,zero,4868 { ALT_ERRNO = EINVAL; 4850: 00047e80 call 47e8 4854: 1007883a mov r3,r2 4858: 00800584 movi r2,22 485c: 18800015 stw r2,0(r3) return -EINVAL; 4860: 00bffa84 movi r2,-22 4864: 00001406 br 48b8 /* * register the device. */ alt_llist_insert(list, &dev->llist); 4868: e0bffd17 ldw r2,-12(fp) 486c: e0fffc17 ldw r3,-16(fp) 4870: e0ffff15 stw r3,-4(fp) 4874: e0bffe15 stw r2,-8(fp) entry->previous = list; 4878: e0bffe17 ldw r2,-8(fp) 487c: e0ffff17 ldw r3,-4(fp) 4880: 10c00115 stw r3,4(r2) entry->next = list->next; 4884: e0bfff17 ldw r2,-4(fp) 4888: 10c00017 ldw r3,0(r2) 488c: e0bffe17 ldw r2,-8(fp) 4890: 10c00015 stw r3,0(r2) list->next->previous = entry; 4894: e0bfff17 ldw r2,-4(fp) 4898: 10800017 ldw r2,0(r2) 489c: e0fffe17 ldw r3,-8(fp) 48a0: 10c00115 stw r3,4(r2) list->next = entry; 48a4: e0bfff17 ldw r2,-4(fp) 48a8: e0fffe17 ldw r3,-8(fp) 48ac: 10c00015 stw r3,0(r2) } 48b0: 0001883a nop return 0; 48b4: 0005883a mov r2,zero } 48b8: e037883a mov sp,fp 48bc: dfc00117 ldw ra,4(sp) 48c0: df000017 ldw fp,0(sp) 48c4: dec00204 addi sp,sp,8 48c8: f800283a ret 000048cc <_do_ctors>: /* * Run the C++ static constructors. */ void _do_ctors(void) { 48cc: defffd04 addi sp,sp,-12 48d0: dfc00215 stw ra,8(sp) 48d4: df000115 stw fp,4(sp) 48d8: df000104 addi fp,sp,4 constructor* ctor; for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) 48dc: 00800034 movhi r2,0 48e0: 1095d404 addi r2,r2,22352 48e4: e0bfff15 stw r2,-4(fp) 48e8: 00000606 br 4904 <_do_ctors+0x38> (*ctor) (); 48ec: e0bfff17 ldw r2,-4(fp) 48f0: 10800017 ldw r2,0(r2) 48f4: 103ee83a callr r2 for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) 48f8: e0bfff17 ldw r2,-4(fp) 48fc: 10bfff04 addi r2,r2,-4 4900: e0bfff15 stw r2,-4(fp) 4904: e0ffff17 ldw r3,-4(fp) 4908: 00800034 movhi r2,0 490c: 1095d504 addi r2,r2,22356 4910: 18bff62e bgeu r3,r2,48ec <_do_ctors+0x20> } 4914: 0001883a nop 4918: 0001883a nop 491c: e037883a mov sp,fp 4920: dfc00117 ldw ra,4(sp) 4924: df000017 ldw fp,0(sp) 4928: dec00204 addi sp,sp,8 492c: f800283a ret 00004930 <_do_dtors>: /* * Run the C++ static destructors. */ void _do_dtors(void) { 4930: defffd04 addi sp,sp,-12 4934: dfc00215 stw ra,8(sp) 4938: df000115 stw fp,4(sp) 493c: df000104 addi fp,sp,4 destructor* dtor; for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) 4940: 00800034 movhi r2,0 4944: 1095d404 addi r2,r2,22352 4948: e0bfff15 stw r2,-4(fp) 494c: 00000606 br 4968 <_do_dtors+0x38> (*dtor) (); 4950: e0bfff17 ldw r2,-4(fp) 4954: 10800017 ldw r2,0(r2) 4958: 103ee83a callr r2 for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) 495c: e0bfff17 ldw r2,-4(fp) 4960: 10bfff04 addi r2,r2,-4 4964: e0bfff15 stw r2,-4(fp) 4968: e0ffff17 ldw r3,-4(fp) 496c: 00800034 movhi r2,0 4970: 1095d504 addi r2,r2,22356 4974: 18bff62e bgeu r3,r2,4950 <_do_dtors+0x20> } 4978: 0001883a nop 497c: 0001883a nop 4980: e037883a mov sp,fp 4984: dfc00117 ldw ra,4(sp) 4988: df000017 ldw fp,0(sp) 498c: dec00204 addi sp,sp,8 4990: f800283a ret 00004994 : * @param irq IRQ number * @return 0 if successful, else error (-1) */ int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, void *isr_context, void *flags) { 4994: defff904 addi sp,sp,-28 4998: dfc00615 stw ra,24(sp) 499c: df000515 stw fp,20(sp) 49a0: df000504 addi fp,sp,20 49a4: e13fff15 stw r4,-4(fp) 49a8: e17ffe15 stw r5,-8(fp) 49ac: e1bffd15 stw r6,-12(fp) 49b0: e1fffc15 stw r7,-16(fp) return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); 49b4: e0800217 ldw r2,8(fp) 49b8: d8800015 stw r2,0(sp) 49bc: e1fffc17 ldw r7,-16(fp) 49c0: e1bffd17 ldw r6,-12(fp) 49c4: e17ffe17 ldw r5,-8(fp) 49c8: e13fff17 ldw r4,-4(fp) 49cc: 0004b440 call 4b44 } 49d0: e037883a mov sp,fp 49d4: dfc00117 ldw ra,4(sp) 49d8: df000017 ldw fp,0(sp) 49dc: dec00204 addi sp,sp,8 49e0: f800283a ret 000049e4 : * @param ic_id Ignored. * @param irq IRQ number * @return 0 if successful, else error (-1) */ int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) { 49e4: defff904 addi sp,sp,-28 49e8: df000615 stw fp,24(sp) 49ec: df000604 addi fp,sp,24 49f0: e13ffb15 stw r4,-20(fp) 49f4: e17ffa15 stw r5,-24(fp) 49f8: e0bffa17 ldw r2,-24(fp) 49fc: e0bfff15 stw r2,-4(fp) NIOS2_READ_STATUS (context); 4a00: 0005303a rdctl r2,status 4a04: e0bffe15 stw r2,-8(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 4a08: e0fffe17 ldw r3,-8(fp) 4a0c: 00bfff84 movi r2,-2 4a10: 1884703a and r2,r3,r2 4a14: 1001703a wrctl status,r2 return context; 4a18: e0bffe17 ldw r2,-8(fp) static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) { alt_irq_context status; extern volatile alt_u32 alt_irq_active; status = alt_irq_disable_all (); 4a1c: e0bffd15 stw r2,-12(fp) alt_irq_active |= (1 << id); 4a20: 00c00044 movi r3,1 4a24: e0bfff17 ldw r2,-4(fp) 4a28: 1884983a sll r2,r3,r2 4a2c: 1007883a mov r3,r2 4a30: d0a01517 ldw r2,-32684(gp) 4a34: 1884b03a or r2,r3,r2 4a38: d0a01515 stw r2,-32684(gp) NIOS2_WRITE_IENABLE (alt_irq_active); 4a3c: d0a01517 ldw r2,-32684(gp) 4a40: 100170fa wrctl ienable,r2 4a44: e0bffd17 ldw r2,-12(fp) 4a48: e0bffc15 stw r2,-16(fp) NIOS2_WRITE_STATUS (context); 4a4c: e0bffc17 ldw r2,-16(fp) 4a50: 1001703a wrctl status,r2 } 4a54: 0001883a nop alt_irq_enable_all(status); return 0; 4a58: 0005883a mov r2,zero return alt_irq_enable(irq); } 4a5c: e037883a mov sp,fp 4a60: df000017 ldw fp,0(sp) 4a64: dec00104 addi sp,sp,4 4a68: f800283a ret 00004a6c : * @param ic_id Ignored. * @param irq IRQ number * @return 0 if successful, else error (-1) */ int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) { 4a6c: defff904 addi sp,sp,-28 4a70: df000615 stw fp,24(sp) 4a74: df000604 addi fp,sp,24 4a78: e13ffb15 stw r4,-20(fp) 4a7c: e17ffa15 stw r5,-24(fp) 4a80: e0bffa17 ldw r2,-24(fp) 4a84: e0bfff15 stw r2,-4(fp) NIOS2_READ_STATUS (context); 4a88: 0005303a rdctl r2,status 4a8c: e0bffe15 stw r2,-8(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 4a90: e0fffe17 ldw r3,-8(fp) 4a94: 00bfff84 movi r2,-2 4a98: 1884703a and r2,r3,r2 4a9c: 1001703a wrctl status,r2 return context; 4aa0: e0bffe17 ldw r2,-8(fp) status = alt_irq_disable_all (); 4aa4: e0bffd15 stw r2,-12(fp) alt_irq_active &= ~(1 << id); 4aa8: 00c00044 movi r3,1 4aac: e0bfff17 ldw r2,-4(fp) 4ab0: 1884983a sll r2,r3,r2 4ab4: 0084303a nor r2,zero,r2 4ab8: 1007883a mov r3,r2 4abc: d0a01517 ldw r2,-32684(gp) 4ac0: 1884703a and r2,r3,r2 4ac4: d0a01515 stw r2,-32684(gp) NIOS2_WRITE_IENABLE (alt_irq_active); 4ac8: d0a01517 ldw r2,-32684(gp) 4acc: 100170fa wrctl ienable,r2 4ad0: e0bffd17 ldw r2,-12(fp) 4ad4: e0bffc15 stw r2,-16(fp) NIOS2_WRITE_STATUS (context); 4ad8: e0bffc17 ldw r2,-16(fp) 4adc: 1001703a wrctl status,r2 } 4ae0: 0001883a nop return 0; 4ae4: 0005883a mov r2,zero return alt_irq_disable(irq); } 4ae8: e037883a mov sp,fp 4aec: df000017 ldw fp,0(sp) 4af0: dec00104 addi sp,sp,4 4af4: f800283a ret 00004af8 : * @param irq IRQ number * @return Zero if corresponding interrupt is disabled and * non-zero otherwise. */ alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) { 4af8: defffc04 addi sp,sp,-16 4afc: df000315 stw fp,12(sp) 4b00: df000304 addi fp,sp,12 4b04: e13ffe15 stw r4,-8(fp) 4b08: e17ffd15 stw r5,-12(fp) alt_u32 irq_enabled; NIOS2_READ_IENABLE(irq_enabled); 4b0c: 000530fa rdctl r2,ienable 4b10: e0bfff15 stw r2,-4(fp) return (irq_enabled & (1 << irq)) ? 1: 0; 4b14: 00c00044 movi r3,1 4b18: e0bffd17 ldw r2,-12(fp) 4b1c: 1884983a sll r2,r3,r2 4b20: 1007883a mov r3,r2 4b24: e0bfff17 ldw r2,-4(fp) 4b28: 1884703a and r2,r3,r2 4b2c: 1004c03a cmpne r2,r2,zero 4b30: 10803fcc andi r2,r2,255 } 4b34: e037883a mov sp,fp 4b38: df000017 ldw fp,0(sp) 4b3c: dec00104 addi sp,sp,4 4b40: f800283a ret 00004b44 : * @param flags * @return 0 if successful, else error (-1) */ int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, void *isr_context, void *flags) { 4b44: defff504 addi sp,sp,-44 4b48: dfc00a15 stw ra,40(sp) 4b4c: df000915 stw fp,36(sp) 4b50: df000904 addi fp,sp,36 4b54: e13ffa15 stw r4,-24(fp) 4b58: e17ff915 stw r5,-28(fp) 4b5c: e1bff815 stw r6,-32(fp) 4b60: e1fff715 stw r7,-36(fp) int rc = -EINVAL; 4b64: 00bffa84 movi r2,-22 4b68: e0bfff15 stw r2,-4(fp) int id = irq; /* IRQ interpreted as the interrupt ID. */ 4b6c: e0bff917 ldw r2,-28(fp) 4b70: e0bffe15 stw r2,-8(fp) alt_irq_context status; if (id < ALT_NIRQ) 4b74: e0bffe17 ldw r2,-8(fp) 4b78: 10800808 cmpgei r2,r2,32 4b7c: 1000251e bne r2,zero,4c14 NIOS2_READ_STATUS (context); 4b80: 0005303a rdctl r2,status 4b84: e0bffc15 stw r2,-16(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 4b88: e0fffc17 ldw r3,-16(fp) 4b8c: 00bfff84 movi r2,-2 4b90: 1884703a and r2,r3,r2 4b94: 1001703a wrctl status,r2 return context; 4b98: e0bffc17 ldw r2,-16(fp) * interrupts are disabled while the handler tables are updated to ensure * that an interrupt doesn't occur while the tables are in an inconsistant * state. */ status = alt_irq_disable_all(); 4b9c: e0bffd15 stw r2,-12(fp) alt_irq[id].handler = isr; 4ba0: e0bffe17 ldw r2,-8(fp) 4ba4: 100890fa slli r4,r2,3 4ba8: e0fff817 ldw r3,-32(fp) 4bac: 00800034 movhi r2,0 4bb0: 2085883a add r2,r4,r2 4bb4: 10dca315 stw r3,29324(r2) alt_irq[id].context = isr_context; 4bb8: e0bffe17 ldw r2,-8(fp) 4bbc: 100890fa slli r4,r2,3 4bc0: e0fff717 ldw r3,-36(fp) 4bc4: 00800034 movhi r2,0 4bc8: 2085883a add r2,r4,r2 4bcc: 10dca415 stw r3,29328(r2) rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); 4bd0: e0bff817 ldw r2,-32(fp) 4bd4: 10000526 beq r2,zero,4bec 4bd8: e0bffe17 ldw r2,-8(fp) 4bdc: 100b883a mov r5,r2 4be0: e13ffa17 ldw r4,-24(fp) 4be4: 00049e40 call 49e4 4be8: 00000406 br 4bfc 4bec: e0bffe17 ldw r2,-8(fp) 4bf0: 100b883a mov r5,r2 4bf4: e13ffa17 ldw r4,-24(fp) 4bf8: 0004a6c0 call 4a6c 4bfc: e0bfff15 stw r2,-4(fp) 4c00: e0bffd17 ldw r2,-12(fp) 4c04: e0bffb15 stw r2,-20(fp) NIOS2_WRITE_STATUS (context); 4c08: e0bffb17 ldw r2,-20(fp) 4c0c: 1001703a wrctl status,r2 } 4c10: 0001883a nop alt_irq_enable_all(status); } return rc; 4c14: e0bfff17 ldw r2,-4(fp) } 4c18: e037883a mov sp,fp 4c1c: dfc00117 ldw ra,4(sp) 4c20: df000017 ldw fp,0(sp) 4c24: dec00204 addi sp,sp,8 4c28: f800283a ret 00004c2c : * If the device can not be succesfully opened, then the input file descriptor * remains unchanged. */ static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) { 4c2c: defff904 addi sp,sp,-28 4c30: dfc00615 stw ra,24(sp) 4c34: df000515 stw fp,20(sp) 4c38: df000504 addi fp,sp,20 4c3c: e13ffe15 stw r4,-8(fp) 4c40: e17ffd15 stw r5,-12(fp) 4c44: e1bffc15 stw r6,-16(fp) 4c48: e1fffb15 stw r7,-20(fp) int old; old = open (name, flags, mode); 4c4c: e1bffb17 ldw r6,-20(fp) 4c50: e17ffc17 ldw r5,-16(fp) 4c54: e13ffd17 ldw r4,-12(fp) 4c58: 0004e940 call 4e94 4c5c: e0bfff15 stw r2,-4(fp) if (old >= 0) 4c60: e0bfff17 ldw r2,-4(fp) 4c64: 10002016 blt r2,zero,4ce8 { fd->dev = alt_fd_list[old].dev; 4c68: e0ffff17 ldw r3,-4(fp) 4c6c: 1805883a mov r2,r3 4c70: 1085883a add r2,r2,r2 4c74: 10c5883a add r2,r2,r3 4c78: 100490ba slli r2,r2,2 4c7c: 00c00034 movhi r3,0 4c80: 10c7883a add r3,r2,r3 4c84: 18d80817 ldw r3,24608(r3) 4c88: e0bffe17 ldw r2,-8(fp) 4c8c: 10c00015 stw r3,0(r2) fd->priv = alt_fd_list[old].priv; 4c90: e0ffff17 ldw r3,-4(fp) 4c94: 1805883a mov r2,r3 4c98: 1085883a add r2,r2,r2 4c9c: 10c5883a add r2,r2,r3 4ca0: 100490ba slli r2,r2,2 4ca4: 00c00034 movhi r3,0 4ca8: 10c7883a add r3,r2,r3 4cac: 18d80917 ldw r3,24612(r3) 4cb0: e0bffe17 ldw r2,-8(fp) 4cb4: 10c00115 stw r3,4(r2) fd->fd_flags = alt_fd_list[old].fd_flags; 4cb8: e0ffff17 ldw r3,-4(fp) 4cbc: 1805883a mov r2,r3 4cc0: 1085883a add r2,r2,r2 4cc4: 10c5883a add r2,r2,r3 4cc8: 100490ba slli r2,r2,2 4ccc: 00c00034 movhi r3,0 4cd0: 10c7883a add r3,r2,r3 4cd4: 18d80a17 ldw r3,24616(r3) 4cd8: e0bffe17 ldw r2,-8(fp) 4cdc: 10c00215 stw r3,8(r2) alt_release_fd (old); 4ce0: e13fff17 ldw r4,-4(fp) 4ce4: 00038080 call 3808 } } 4ce8: 0001883a nop 4cec: e037883a mov sp,fp 4cf0: dfc00117 ldw ra,4(sp) 4cf4: df000017 ldw fp,0(sp) 4cf8: dec00204 addi sp,sp,8 4cfc: f800283a ret 00004d00 : */ void alt_io_redirect(const char* stdout_dev, const char* stdin_dev, const char* stderr_dev) { 4d00: defffb04 addi sp,sp,-20 4d04: dfc00415 stw ra,16(sp) 4d08: df000315 stw fp,12(sp) 4d0c: df000304 addi fp,sp,12 4d10: e13fff15 stw r4,-4(fp) 4d14: e17ffe15 stw r5,-8(fp) 4d18: e1bffd15 stw r6,-12(fp) /* Redirect the channels */ alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); 4d1c: 01c07fc4 movi r7,511 4d20: 01800044 movi r6,1 4d24: e17fff17 ldw r5,-4(fp) 4d28: 01000034 movhi r4,0 4d2c: 21180b04 addi r4,r4,24620 4d30: 0004c2c0 call 4c2c alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); 4d34: 01c07fc4 movi r7,511 4d38: 000d883a mov r6,zero 4d3c: e17ffe17 ldw r5,-8(fp) 4d40: 01000034 movhi r4,0 4d44: 21180804 addi r4,r4,24608 4d48: 0004c2c0 call 4c2c alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); 4d4c: 01c07fc4 movi r7,511 4d50: 01800044 movi r6,1 4d54: e17ffd17 ldw r5,-12(fp) 4d58: 01000034 movhi r4,0 4d5c: 21180e04 addi r4,r4,24632 4d60: 0004c2c0 call 4c2c } 4d64: 0001883a nop 4d68: e037883a mov sp,fp 4d6c: dfc00117 ldw ra,4(sp) 4d70: df000017 ldw fp,0(sp) 4d74: dec00204 addi sp,sp,8 4d78: f800283a ret 00004d7c : { 4d7c: defffe04 addi sp,sp,-8 4d80: dfc00115 stw ra,4(sp) 4d84: df000015 stw fp,0(sp) 4d88: d839883a mov fp,sp return ((alt_errno) ? alt_errno() : &errno); 4d8c: d0a00917 ldw r2,-32732(gp) 4d90: 10000326 beq r2,zero,4da0 4d94: d0a00917 ldw r2,-32732(gp) 4d98: 103ee83a callr r2 4d9c: 00000106 br 4da4 4da0: d0a01104 addi r2,gp,-32700 } 4da4: e037883a mov sp,fp 4da8: dfc00117 ldw ra,4(sp) 4dac: df000017 ldw fp,0(sp) 4db0: dec00204 addi sp,sp,8 4db4: f800283a ret 00004db8 : * performed for devices. Filesystems are required to handle the ioctl() call * themselves, and report the error from the filesystems open() function. */ static int alt_file_locked (alt_fd* fd) { 4db8: defffd04 addi sp,sp,-12 4dbc: df000215 stw fp,8(sp) 4dc0: df000204 addi fp,sp,8 4dc4: e13ffe15 stw r4,-8(fp) /* * Mark the file descriptor as belonging to a device. */ fd->fd_flags |= ALT_FD_DEV; 4dc8: e0bffe17 ldw r2,-8(fp) 4dcc: 10800217 ldw r2,8(r2) 4dd0: 10d00034 orhi r3,r2,16384 4dd4: e0bffe17 ldw r2,-8(fp) 4dd8: 10c00215 stw r3,8(r2) /* * Loop through all current file descriptors searching for one that's locked * for exclusive access. If a match is found, generate an error. */ for (i = 0; i <= alt_max_fd; i++) 4ddc: e03fff15 stw zero,-4(fp) 4de0: 00002306 br 4e70 { if ((alt_fd_list[i].dev == fd->dev) && 4de4: e0ffff17 ldw r3,-4(fp) 4de8: 1805883a mov r2,r3 4dec: 1085883a add r2,r2,r2 4df0: 10c5883a add r2,r2,r3 4df4: 100490ba slli r2,r2,2 4df8: 00c00034 movhi r3,0 4dfc: 10c7883a add r3,r2,r3 4e00: 18d80817 ldw r3,24608(r3) 4e04: e0bffe17 ldw r2,-8(fp) 4e08: 10800017 ldw r2,0(r2) 4e0c: 1880151e bne r3,r2,4e64 (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && 4e10: e0ffff17 ldw r3,-4(fp) 4e14: 1805883a mov r2,r3 4e18: 1085883a add r2,r2,r2 4e1c: 10c5883a add r2,r2,r3 4e20: 100490ba slli r2,r2,2 4e24: 00c00034 movhi r3,0 4e28: 10c7883a add r3,r2,r3 4e2c: 18980a17 ldw r2,24616(r3) if ((alt_fd_list[i].dev == fd->dev) && 4e30: 10000c0e bge r2,zero,4e64 (&alt_fd_list[i] != fd)) 4e34: e0ffff17 ldw r3,-4(fp) 4e38: 1805883a mov r2,r3 4e3c: 1085883a add r2,r2,r2 4e40: 10c5883a add r2,r2,r3 4e44: 100490ba slli r2,r2,2 4e48: 00c00034 movhi r3,0 4e4c: 18d80804 addi r3,r3,24608 4e50: 10c5883a add r2,r2,r3 (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && 4e54: e0fffe17 ldw r3,-8(fp) 4e58: 18800226 beq r3,r2,4e64 { return -EACCES; 4e5c: 00bffcc4 movi r2,-13 4e60: 00000806 br 4e84 for (i = 0; i <= alt_max_fd; i++) 4e64: e0bfff17 ldw r2,-4(fp) 4e68: 10800044 addi r2,r2,1 4e6c: e0bfff15 stw r2,-4(fp) 4e70: d0a00817 ldw r2,-32736(gp) 4e74: 1007883a mov r3,r2 4e78: e0bfff17 ldw r2,-4(fp) 4e7c: 18bfd92e bgeu r3,r2,4de4 } } /* The device is not locked */ return 0; 4e80: 0005883a mov r2,zero } 4e84: e037883a mov sp,fp 4e88: df000017 ldw fp,0(sp) 4e8c: dec00104 addi sp,sp,4 4e90: f800283a ret 00004e94 : * * ALT_OPEN is mapped onto the open() system call in alt_syscall.h */ int ALT_OPEN (const char* file, int flags, int mode) { 4e94: defff604 addi sp,sp,-40 4e98: dfc00915 stw ra,36(sp) 4e9c: df000815 stw fp,32(sp) 4ea0: df000804 addi fp,sp,32 4ea4: e13ffa15 stw r4,-24(fp) 4ea8: e17ff915 stw r5,-28(fp) 4eac: e1bff815 stw r6,-32(fp) alt_dev* dev; alt_fd* fd; int index = -1; 4eb0: 00bfffc4 movi r2,-1 4eb4: e0bffe15 stw r2,-8(fp) int status = -ENODEV; 4eb8: 00bffb44 movi r2,-19 4ebc: e0bffd15 stw r2,-12(fp) int isafs = 0; 4ec0: e03ffc15 stw zero,-16(fp) /* * Check the device list, to see if a device with a matching name is * registered. */ if (!(dev = alt_find_dev (file, &alt_dev_list))) 4ec4: d1600604 addi r5,gp,-32744 4ec8: e13ffa17 ldw r4,-24(fp) 4ecc: 00051c40 call 51c4 4ed0: e0bfff15 stw r2,-4(fp) 4ed4: e0bfff17 ldw r2,-4(fp) 4ed8: 1000051e bne r2,zero,4ef0 { /* No matching device, so try the filesystem list */ dev = alt_find_file (file); 4edc: e13ffa17 ldw r4,-24(fp) 4ee0: 00052540 call 5254 4ee4: e0bfff15 stw r2,-4(fp) isafs = 1; 4ee8: 00800044 movi r2,1 4eec: e0bffc15 stw r2,-16(fp) /* * If a matching device or filesystem is found, allocate a file descriptor. */ if (dev) 4ef0: e0bfff17 ldw r2,-4(fp) 4ef4: 10002c26 beq r2,zero,4fa8 { if ((index = alt_get_fd (dev)) < 0) 4ef8: e13fff17 ldw r4,-4(fp) 4efc: 000535c0 call 535c 4f00: e0bffe15 stw r2,-8(fp) 4f04: e0bffe17 ldw r2,-8(fp) 4f08: 1000030e bge r2,zero,4f18 { status = index; 4f0c: e0bffe17 ldw r2,-8(fp) 4f10: e0bffd15 stw r2,-12(fp) 4f14: 00002606 br 4fb0 } else { fd = &alt_fd_list[index]; 4f18: e0fffe17 ldw r3,-8(fp) 4f1c: 1805883a mov r2,r3 4f20: 1085883a add r2,r2,r2 4f24: 10c5883a add r2,r2,r3 4f28: 100490ba slli r2,r2,2 4f2c: 00c00034 movhi r3,0 4f30: 18d80804 addi r3,r3,24608 4f34: 10c5883a add r2,r2,r3 4f38: e0bffb15 stw r2,-20(fp) fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); 4f3c: e0fff917 ldw r3,-28(fp) 4f40: 00900034 movhi r2,16384 4f44: 10bfffc4 addi r2,r2,-1 4f48: 1886703a and r3,r3,r2 4f4c: e0bffb17 ldw r2,-20(fp) 4f50: 10c00215 stw r3,8(r2) /* If this is a device, ensure it isn't already locked */ if (isafs || ((status = alt_file_locked (fd)) >= 0)) 4f54: e0bffc17 ldw r2,-16(fp) 4f58: 1000051e bne r2,zero,4f70 4f5c: e13ffb17 ldw r4,-20(fp) 4f60: 0004db80 call 4db8 4f64: e0bffd15 stw r2,-12(fp) 4f68: e0bffd17 ldw r2,-12(fp) 4f6c: 10001016 blt r2,zero,4fb0 /* * If the device or filesystem provides an open() callback function, * call it now to perform any device/filesystem specific operations. */ status = (dev->open) ? dev->open(fd, file, flags, mode): 0; 4f70: e0bfff17 ldw r2,-4(fp) 4f74: 10800317 ldw r2,12(r2) 4f78: 10000826 beq r2,zero,4f9c 4f7c: e0bfff17 ldw r2,-4(fp) 4f80: 10800317 ldw r2,12(r2) 4f84: e1fff817 ldw r7,-32(fp) 4f88: e1bff917 ldw r6,-28(fp) 4f8c: e17ffa17 ldw r5,-24(fp) 4f90: e13ffb17 ldw r4,-20(fp) 4f94: 103ee83a callr r2 4f98: 00000106 br 4fa0 4f9c: 0005883a mov r2,zero 4fa0: e0bffd15 stw r2,-12(fp) 4fa4: 00000206 br 4fb0 } } } else { status = -ENODEV; 4fa8: 00bffb44 movi r2,-19 4fac: e0bffd15 stw r2,-12(fp) } /* Allocation failed, so clean up and return an error */ if (status < 0) 4fb0: e0bffd17 ldw r2,-12(fp) 4fb4: 1000090e bge r2,zero,4fdc { alt_release_fd (index); 4fb8: e13ffe17 ldw r4,-8(fp) 4fbc: 00038080 call 3808 ALT_ERRNO = -status; 4fc0: 0004d7c0 call 4d7c 4fc4: 1007883a mov r3,r2 4fc8: e0bffd17 ldw r2,-12(fp) 4fcc: 0085c83a sub r2,zero,r2 4fd0: 18800015 stw r2,0(r3) return -1; 4fd4: 00bfffc4 movi r2,-1 4fd8: 00000106 br 4fe0 } /* return the reference upon success */ return index; 4fdc: e0bffe17 ldw r2,-8(fp) } 4fe0: e037883a mov sp,fp 4fe4: dfc00117 ldw ra,4(sp) 4fe8: df000017 ldw fp,0(sp) 4fec: dec00204 addi sp,sp,8 4ff0: f800283a ret 00004ff4 : * alarms. Alternatively an alarm can unregister itself by returning zero when * the alarm executes. */ void alt_alarm_stop (alt_alarm* alarm) { 4ff4: defffa04 addi sp,sp,-24 4ff8: df000515 stw fp,20(sp) 4ffc: df000504 addi fp,sp,20 5000: e13ffb15 stw r4,-20(fp) NIOS2_READ_STATUS (context); 5004: 0005303a rdctl r2,status 5008: e0bffc15 stw r2,-16(fp) NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); 500c: e0fffc17 ldw r3,-16(fp) 5010: 00bfff84 movi r2,-2 5014: 1884703a and r2,r3,r2 5018: 1001703a wrctl status,r2 return context; 501c: e0bffc17 ldw r2,-16(fp) alt_irq_context irq_context; irq_context = alt_irq_disable_all(); 5020: e0bfff15 stw r2,-4(fp) alt_llist_remove (&alarm->llist); 5024: e0bffb17 ldw r2,-20(fp) 5028: e0bffd15 stw r2,-12(fp) * input argument is the element to remove. */ static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) { entry->next->previous = entry->previous; 502c: e0bffd17 ldw r2,-12(fp) 5030: 10800017 ldw r2,0(r2) 5034: e0fffd17 ldw r3,-12(fp) 5038: 18c00117 ldw r3,4(r3) 503c: 10c00115 stw r3,4(r2) entry->previous->next = entry->next; 5040: e0bffd17 ldw r2,-12(fp) 5044: 10800117 ldw r2,4(r2) 5048: e0fffd17 ldw r3,-12(fp) 504c: 18c00017 ldw r3,0(r3) 5050: 10c00015 stw r3,0(r2) /* * Set the entry to point to itself, so that any further calls to * alt_llist_remove() are harmless. */ entry->previous = entry; 5054: e0bffd17 ldw r2,-12(fp) 5058: e0fffd17 ldw r3,-12(fp) 505c: 10c00115 stw r3,4(r2) entry->next = entry; 5060: e0bffd17 ldw r2,-12(fp) 5064: e0fffd17 ldw r3,-12(fp) 5068: 10c00015 stw r3,0(r2) } 506c: 0001883a nop 5070: e0bfff17 ldw r2,-4(fp) 5074: e0bffe15 stw r2,-8(fp) NIOS2_WRITE_STATUS (context); 5078: e0bffe17 ldw r2,-8(fp) 507c: 1001703a wrctl status,r2 } 5080: 0001883a nop alt_irq_enable_all (irq_context); } 5084: 0001883a nop 5088: e037883a mov sp,fp 508c: df000017 ldw fp,0(sp) 5090: dec00104 addi sp,sp,4 5094: f800283a ret 00005098 : * * alt_tick() is expected to run at interrupt level. */ void alt_tick (void) { 5098: defffb04 addi sp,sp,-20 509c: dfc00415 stw ra,16(sp) 50a0: df000315 stw fp,12(sp) 50a4: df000304 addi fp,sp,12 alt_alarm* next; alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; 50a8: d0a00c17 ldw r2,-32720(gp) 50ac: e0bfff15 stw r2,-4(fp) alt_u32 next_callback; /* update the tick counter */ _alt_nticks++; 50b0: d0a01717 ldw r2,-32676(gp) 50b4: 10800044 addi r2,r2,1 50b8: d0a01715 stw r2,-32676(gp) /* process the registered callbacks */ while (alarm != (alt_alarm*) &alt_alarm_list) 50bc: 00002e06 br 5178 { next = (alt_alarm*) alarm->llist.next; 50c0: e0bfff17 ldw r2,-4(fp) 50c4: 10800017 ldw r2,0(r2) 50c8: e0bffe15 stw r2,-8(fp) /* * Upon the tick-counter rolling over it is safe to clear the * roll-over flag; once the flag is cleared this (or subsequnt) * tick events are enabled to generate an alarm event. */ if ((alarm->rollover) && (_alt_nticks == 0)) 50cc: e0bfff17 ldw r2,-4(fp) 50d0: 10800403 ldbu r2,16(r2) 50d4: 10803fcc andi r2,r2,255 50d8: 10000426 beq r2,zero,50ec 50dc: d0a01717 ldw r2,-32676(gp) 50e0: 1000021e bne r2,zero,50ec { alarm->rollover = 0; 50e4: e0bfff17 ldw r2,-4(fp) 50e8: 10000405 stb zero,16(r2) } /* if the alarm period has expired, make the callback */ if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) 50ec: e0bfff17 ldw r2,-4(fp) 50f0: 10800217 ldw r2,8(r2) 50f4: d0e01717 ldw r3,-32676(gp) 50f8: 18801d36 bltu r3,r2,5170 50fc: e0bfff17 ldw r2,-4(fp) 5100: 10800403 ldbu r2,16(r2) 5104: 10803fcc andi r2,r2,255 5108: 1000191e bne r2,zero,5170 { next_callback = alarm->callback (alarm->context); 510c: e0bfff17 ldw r2,-4(fp) 5110: 10800317 ldw r2,12(r2) 5114: e0ffff17 ldw r3,-4(fp) 5118: 18c00517 ldw r3,20(r3) 511c: 1809883a mov r4,r3 5120: 103ee83a callr r2 5124: e0bffd15 stw r2,-12(fp) /* deactivate the alarm if the return value is zero */ if (next_callback == 0) 5128: e0bffd17 ldw r2,-12(fp) 512c: 1000031e bne r2,zero,513c { alt_alarm_stop (alarm); 5130: e13fff17 ldw r4,-4(fp) 5134: 0004ff40 call 4ff4 5138: 00000d06 br 5170 } else { alarm->time += next_callback; 513c: e0bfff17 ldw r2,-4(fp) 5140: 10c00217 ldw r3,8(r2) 5144: e0bffd17 ldw r2,-12(fp) 5148: 1887883a add r3,r3,r2 514c: e0bfff17 ldw r2,-4(fp) 5150: 10c00215 stw r3,8(r2) /* * If the desired alarm time causes a roll-over, set the rollover * flag. This will prevent the subsequent tick event from causing * an alarm too early. */ if(alarm->time < _alt_nticks) 5154: e0bfff17 ldw r2,-4(fp) 5158: 10c00217 ldw r3,8(r2) 515c: d0a01717 ldw r2,-32676(gp) 5160: 1880032e bgeu r3,r2,5170 { alarm->rollover = 1; 5164: e0bfff17 ldw r2,-4(fp) 5168: 00c00044 movi r3,1 516c: 10c00405 stb r3,16(r2) } } } alarm = next; 5170: e0bffe17 ldw r2,-8(fp) 5174: e0bfff15 stw r2,-4(fp) while (alarm != (alt_alarm*) &alt_alarm_list) 5178: e0ffff17 ldw r3,-4(fp) 517c: d0a00c04 addi r2,gp,-32720 5180: 18bfcf1e bne r3,r2,50c0 /* * Update the operating system specific timer facilities. */ ALT_OS_TIME_TICK(); 5184: 0001883a nop } 5188: 0001883a nop 518c: e037883a mov sp,fp 5190: dfc00117 ldw ra,4(sp) 5194: df000017 ldw fp,0(sp) 5198: dec00204 addi sp,sp,8 519c: f800283a ret 000051a0 : /* * To initialize the internal interrupt controller, just clear the IENABLE * register so that all possible IRQs are disabled. */ void altera_nios2_gen2_irq_init(void) { 51a0: deffff04 addi sp,sp,-4 51a4: df000015 stw fp,0(sp) 51a8: d839883a mov fp,sp NIOS2_WRITE_IENABLE(0); 51ac: 000170fa wrctl ienable,zero } 51b0: 0001883a nop 51b4: e037883a mov sp,fp 51b8: df000017 ldw fp,0(sp) 51bc: dec00104 addi sp,sp,4 51c0: f800283a ret 000051c4 : * "name" must be an exact match for the devices registered name for a match to * be found. */ alt_dev* alt_find_dev(const char* name, alt_llist* llist) { 51c4: defffa04 addi sp,sp,-24 51c8: dfc00515 stw ra,20(sp) 51cc: df000415 stw fp,16(sp) 51d0: df000404 addi fp,sp,16 51d4: e13ffd15 stw r4,-12(fp) 51d8: e17ffc15 stw r5,-16(fp) alt_dev* next = (alt_dev*) llist->next; 51dc: e0bffc17 ldw r2,-16(fp) 51e0: 10800017 ldw r2,0(r2) 51e4: e0bfff15 stw r2,-4(fp) alt_32 len; len = strlen(name) + 1; 51e8: e13ffd17 ldw r4,-12(fp) 51ec: 00003f80 call 3f8 51f0: 10800044 addi r2,r2,1 51f4: e0bffe15 stw r2,-8(fp) /* * Check each list entry in turn, until a match is found, or we reach the * end of the list (i.e. next winds up pointing back to the list head). */ while (next != (alt_dev*) llist) 51f8: 00000d06 br 5230 /* * memcmp() is used here rather than strcmp() in order to reduce the size * of the executable. */ if (!memcmp (next->name, name, len)) 51fc: e0bfff17 ldw r2,-4(fp) 5200: 10800217 ldw r2,8(r2) 5204: e0fffe17 ldw r3,-8(fp) 5208: 180d883a mov r6,r3 520c: e17ffd17 ldw r5,-12(fp) 5210: 1009883a mov r4,r2 5214: 00054f40 call 54f4 5218: 1000021e bne r2,zero,5224 { /* match found */ return next; 521c: e0bfff17 ldw r2,-4(fp) 5220: 00000706 br 5240 } next = (alt_dev*) next->llist.next; 5224: e0bfff17 ldw r2,-4(fp) 5228: 10800017 ldw r2,0(r2) 522c: e0bfff15 stw r2,-4(fp) while (next != (alt_dev*) llist) 5230: e0ffff17 ldw r3,-4(fp) 5234: e0bffc17 ldw r2,-16(fp) 5238: 18bff01e bne r3,r2,51fc } /* No match found */ return NULL; 523c: 0005883a mov r2,zero } 5240: e037883a mov sp,fp 5244: dfc00117 ldw ra,4(sp) 5248: df000017 ldw fp,0(sp) 524c: dec00204 addi sp,sp,8 5250: f800283a ret 00005254 : * either '/' or '\0' is the prefix of the filename. For example the filename: * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". */ alt_dev* alt_find_file (const char* name) { 5254: defffb04 addi sp,sp,-20 5258: dfc00415 stw ra,16(sp) 525c: df000315 stw fp,12(sp) 5260: df000304 addi fp,sp,12 5264: e13ffd15 stw r4,-12(fp) alt_dev* next = (alt_dev*) alt_fs_list.next; 5268: d0a00417 ldw r2,-32752(gp) 526c: e0bfff15 stw r2,-4(fp) /* * Check each list entry in turn, until a match is found, or we reach the * end of the list (i.e. next winds up pointing back to the list head). */ while (next != (alt_dev*) &alt_fs_list) 5270: 00003106 br 5338 { len = strlen(next->name); 5274: e0bfff17 ldw r2,-4(fp) 5278: 10800217 ldw r2,8(r2) 527c: 1009883a mov r4,r2 5280: 00003f80 call 3f8 5284: e0bffe15 stw r2,-8(fp) if (next->name[len-1] == '/') 5288: e0bfff17 ldw r2,-4(fp) 528c: 10c00217 ldw r3,8(r2) 5290: e0bffe17 ldw r2,-8(fp) 5294: 10bfffc4 addi r2,r2,-1 5298: 1885883a add r2,r3,r2 529c: 10800003 ldbu r2,0(r2) 52a0: 10803fcc andi r2,r2,255 52a4: 1080201c xori r2,r2,128 52a8: 10bfe004 addi r2,r2,-128 52ac: 10800bd8 cmpnei r2,r2,47 52b0: 1000031e bne r2,zero,52c0 { len -= 1; 52b4: e0bffe17 ldw r2,-8(fp) 52b8: 10bfffc4 addi r2,r2,-1 52bc: e0bffe15 stw r2,-8(fp) } if (((name[len] == '/') || (name[len] == '\0')) && 52c0: e0bffe17 ldw r2,-8(fp) 52c4: e0fffd17 ldw r3,-12(fp) 52c8: 1885883a add r2,r3,r2 52cc: 10800003 ldbu r2,0(r2) 52d0: 10803fcc andi r2,r2,255 52d4: 1080201c xori r2,r2,128 52d8: 10bfe004 addi r2,r2,-128 52dc: 10800be0 cmpeqi r2,r2,47 52e0: 1000081e bne r2,zero,5304 52e4: e0bffe17 ldw r2,-8(fp) 52e8: e0fffd17 ldw r3,-12(fp) 52ec: 1885883a add r2,r3,r2 52f0: 10800003 ldbu r2,0(r2) 52f4: 10803fcc andi r2,r2,255 52f8: 1080201c xori r2,r2,128 52fc: 10bfe004 addi r2,r2,-128 5300: 10000a1e bne r2,zero,532c !memcmp (next->name, name, len)) 5304: e0bfff17 ldw r2,-4(fp) 5308: 10800217 ldw r2,8(r2) 530c: e0fffe17 ldw r3,-8(fp) 5310: 180d883a mov r6,r3 5314: e17ffd17 ldw r5,-12(fp) 5318: 1009883a mov r4,r2 531c: 00054f40 call 54f4 if (((name[len] == '/') || (name[len] == '\0')) && 5320: 1000021e bne r2,zero,532c { /* match found */ return next; 5324: e0bfff17 ldw r2,-4(fp) 5328: 00000706 br 5348 } next = (alt_dev*) next->llist.next; 532c: e0bfff17 ldw r2,-4(fp) 5330: 10800017 ldw r2,0(r2) 5334: e0bfff15 stw r2,-4(fp) while (next != (alt_dev*) &alt_fs_list) 5338: e0ffff17 ldw r3,-4(fp) 533c: d0a00404 addi r2,gp,-32752 5340: 18bfcc1e bne r3,r2,5274 } /* No match found */ return NULL; 5344: 0005883a mov r2,zero } 5348: e037883a mov sp,fp 534c: dfc00117 ldw ra,4(sp) 5350: df000017 ldw fp,0(sp) 5354: dec00204 addi sp,sp,8 5358: f800283a ret 0000535c : * the offset of the file descriptor within the file descriptor array). A * negative value indicates failure. */ int alt_get_fd (alt_dev* dev) { 535c: defffc04 addi sp,sp,-16 5360: df000315 stw fp,12(sp) 5364: df000304 addi fp,sp,12 5368: e13ffd15 stw r4,-12(fp) alt_32 i; int rc = -EMFILE; 536c: 00bffa04 movi r2,-24 5370: e0bffe15 stw r2,-8(fp) * indicates the highest file descriptor ever allocated. This is used to * improve efficency when searching the file descriptor list, and * therefore reduce contention on the alt_fd_list_lock semaphore. */ for (i = 0; i < ALT_MAX_FD; i++) 5374: e03fff15 stw zero,-4(fp) 5378: 00001d06 br 53f0 { if (!alt_fd_list[i].dev) 537c: e0ffff17 ldw r3,-4(fp) 5380: 1805883a mov r2,r3 5384: 1085883a add r2,r2,r2 5388: 10c5883a add r2,r2,r3 538c: 100490ba slli r2,r2,2 5390: 00c00034 movhi r3,0 5394: 10c7883a add r3,r2,r3 5398: 18980817 ldw r2,24608(r3) 539c: 1000111e bne r2,zero,53e4 { alt_fd_list[i].dev = dev; 53a0: e0ffff17 ldw r3,-4(fp) 53a4: 1805883a mov r2,r3 53a8: 1085883a add r2,r2,r2 53ac: 10c5883a add r2,r2,r3 53b0: 100490ba slli r2,r2,2 53b4: e13ffd17 ldw r4,-12(fp) 53b8: 00c00034 movhi r3,0 53bc: 10c7883a add r3,r2,r3 53c0: 19180815 stw r4,24608(r3) if (i > alt_max_fd) 53c4: d0e00817 ldw r3,-32736(gp) 53c8: e0bfff17 ldw r2,-4(fp) 53cc: 1880020e bge r3,r2,53d8 { alt_max_fd = i; 53d0: e0bfff17 ldw r2,-4(fp) 53d4: d0a00815 stw r2,-32736(gp) } rc = i; 53d8: e0bfff17 ldw r2,-4(fp) 53dc: e0bffe15 stw r2,-8(fp) goto alt_get_fd_exit; 53e0: 00000706 br 5400 for (i = 0; i < ALT_MAX_FD; i++) 53e4: e0bfff17 ldw r2,-4(fp) 53e8: 10800044 addi r2,r2,1 53ec: e0bfff15 stw r2,-4(fp) 53f0: e0bfff17 ldw r2,-4(fp) 53f4: 10800810 cmplti r2,r2,32 53f8: 103fe01e bne r2,zero,537c } } alt_get_fd_exit: 53fc: 0001883a nop * file descriptor pool. */ ALT_SEM_POST(alt_fd_list_lock); return rc; 5400: e0bffe17 ldw r2,-8(fp) } 5404: e037883a mov sp,fp 5408: df000017 ldw fp,0(sp) 540c: dec00104 addi sp,sp,4 5410: f800283a ret 00005414 : * Return: 1: BADADDR (bad_addr argument to handler) is valid * 0: BADADDR is not valid */ int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) { 5414: defffe04 addi sp,sp,-8 5418: df000115 stw fp,4(sp) 541c: df000104 addi fp,sp,4 5420: e13fff15 stw r4,-4(fp) 5424: e0bfff17 ldw r2,-4(fp) 5428: 10bffe84 addi r2,r2,-6 542c: 10c00428 cmpgeui r3,r2,16 5430: 1800191e bne r3,zero,5498 5434: 100690ba slli r3,r2,2 5438: 00800034 movhi r2,0 543c: 1885883a add r2,r3,r2 5440: 10951217 ldw r2,21576(r2) 5444: 1000683a jmp r2 5448: 00005488 cmpgei zero,zero,338 544c: 00005488 cmpgei zero,zero,338 5450: 00005498 cmpnei zero,zero,338 5454: 00005498 cmpnei zero,zero,338 5458: 00005498 cmpnei zero,zero,338 545c: 00005488 cmpgei zero,zero,338 5460: 00005490 cmplti zero,zero,338 5464: 00005498 cmpnei zero,zero,338 5468: 00005488 cmpgei zero,zero,338 546c: 00005488 cmpgei zero,zero,338 5470: 00005498 cmpnei zero,zero,338 5474: 00005488 cmpgei zero,zero,338 5478: 00005490 cmplti zero,zero,338 547c: 00005498 cmpnei zero,zero,338 5480: 00005498 cmpnei zero,zero,338 5484: 00005488 cmpgei zero,zero,338 case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: case NIOS2_EXCEPTION_ECC_DATA_ERR: return 1; 5488: 00800044 movi r2,1 548c: 00000306 br 549c case NIOS2_EXCEPTION_TLB_MISS: case NIOS2_EXCEPTION_ECC_TLB_ERR: return 0; 5490: 0005883a mov r2,zero 5494: 00000106 br 549c default: return 0; 5498: 0005883a mov r2,zero } } 549c: e037883a mov sp,fp 54a0: df000017 ldw fp,0(sp) 54a4: dec00104 addi sp,sp,4 54a8: f800283a ret 000054ac : 54ac: 200b883a mov r5,r4 54b0: 000f883a mov r7,zero 54b4: 000d883a mov r6,zero 54b8: 0009883a mov r4,zero 54bc: 000556c1 jmpi 556c <__register_exitproc> 000054c0 : 54c0: defffe04 addi sp,sp,-8 54c4: 000b883a mov r5,zero 54c8: dc000015 stw r16,0(sp) 54cc: dfc00115 stw ra,4(sp) 54d0: 2021883a mov r16,r4 54d4: 00055fc0 call 55fc <__call_exitprocs> 54d8: 00800034 movhi r2,0 54dc: 111c8017 ldw r4,29184(r2) 54e0: 20800f17 ldw r2,60(r4) 54e4: 10000126 beq r2,zero,54ec 54e8: 103ee83a callr r2 54ec: 8009883a mov r4,r16 54f0: 000571c0 call 571c <_exit> 000054f4 : 54f4: 30800130 cmpltui r2,r6,4 54f8: 10000b1e bne r2,zero,5528 54fc: 2144b03a or r2,r4,r5 5500: 108000cc andi r2,r2,3 5504: 1000171e bne r2,zero,5564 5508: 20c00017 ldw r3,0(r4) 550c: 28800017 ldw r2,0(r5) 5510: 1880141e bne r3,r2,5564 5514: 31bfff04 addi r6,r6,-4 5518: 30800128 cmpgeui r2,r6,4 551c: 21000104 addi r4,r4,4 5520: 29400104 addi r5,r5,4 5524: 103ff81e bne r2,zero,5508 5528: 30bfffc4 addi r2,r6,-1 552c: 30000b26 beq r6,zero,555c 5530: 11800044 addi r6,r2,1 5534: 218d883a add r6,r4,r6 5538: 00000106 br 5540 553c: 21800726 beq r4,r6,555c 5540: 20800003 ldbu r2,0(r4) 5544: 28c00003 ldbu r3,0(r5) 5548: 21000044 addi r4,r4,1 554c: 29400044 addi r5,r5,1 5550: 10fffa26 beq r2,r3,553c 5554: 10c5c83a sub r2,r2,r3 5558: f800283a ret 555c: 0005883a mov r2,zero 5560: f800283a ret 5564: 30bfffc4 addi r2,r6,-1 5568: 003ff106 br 5530 0000556c <__register_exitproc>: 556c: 00800034 movhi r2,0 5570: 10dc8017 ldw r3,29184(r2) 5574: 18805217 ldw r2,328(r3) 5578: 10001726 beq r2,zero,55d8 <__register_exitproc+0x6c> 557c: 10c00117 ldw r3,4(r2) 5580: 1a000808 cmpgei r8,r3,32 5584: 40001b1e bne r8,zero,55f4 <__register_exitproc+0x88> 5588: 20000b26 beq r4,zero,55b8 <__register_exitproc+0x4c> 558c: 181090ba slli r8,r3,2 5590: 02400044 movi r9,1 5594: 48d2983a sll r9,r9,r3 5598: 1211883a add r8,r2,r8 559c: 41802215 stw r6,136(r8) 55a0: 11806217 ldw r6,392(r2) 55a4: 21000098 cmpnei r4,r4,2 55a8: 324cb03a or r6,r6,r9 55ac: 11806215 stw r6,392(r2) 55b0: 41c04215 stw r7,264(r8) 55b4: 20000b26 beq r4,zero,55e4 <__register_exitproc+0x78> 55b8: 19000084 addi r4,r3,2 55bc: 200890ba slli r4,r4,2 55c0: 18c00044 addi r3,r3,1 55c4: 10c00115 stw r3,4(r2) 55c8: 1105883a add r2,r2,r4 55cc: 11400015 stw r5,0(r2) 55d0: 0005883a mov r2,zero 55d4: f800283a ret 55d8: 18805304 addi r2,r3,332 55dc: 18805215 stw r2,328(r3) 55e0: 003fe606 br 557c <__register_exitproc+0x10> 55e4: 11006317 ldw r4,396(r2) 55e8: 2252b03a or r9,r4,r9 55ec: 12406315 stw r9,396(r2) 55f0: 003ff106 br 55b8 <__register_exitproc+0x4c> 55f4: 00bfffc4 movi r2,-1 55f8: f800283a ret 000055fc <__call_exitprocs>: 55fc: defff704 addi sp,sp,-36 5600: 00800034 movhi r2,0 5604: dcc00315 stw r19,12(sp) 5608: 14dc8017 ldw r19,29184(r2) 560c: dc800215 stw r18,8(sp) 5610: dfc00815 stw ra,32(sp) 5614: 9c805217 ldw r18,328(r19) 5618: ddc00715 stw r23,28(sp) 561c: dd800615 stw r22,24(sp) 5620: dd400515 stw r21,20(sp) 5624: dd000415 stw r20,16(sp) 5628: dc400115 stw r17,4(sp) 562c: dc000015 stw r16,0(sp) 5630: 90001026 beq r18,zero,5674 <__call_exitprocs+0x78> 5634: 202b883a mov r21,r4 5638: 282d883a mov r22,r5 563c: 05000044 movi r20,1 5640: 94000117 ldw r16,4(r18) 5644: 847fffc4 addi r17,r16,-1 5648: 88000a16 blt r17,zero,5674 <__call_exitprocs+0x78> 564c: 84000044 addi r16,r16,1 5650: 802090ba slli r16,r16,2 5654: 9421883a add r16,r18,r16 5658: b0001126 beq r22,zero,56a0 <__call_exitprocs+0xa4> 565c: 80804017 ldw r2,256(r16) 5660: 15800f26 beq r2,r22,56a0 <__call_exitprocs+0xa4> 5664: 8c7fffc4 addi r17,r17,-1 5668: 88bfffd8 cmpnei r2,r17,-1 566c: 843fff04 addi r16,r16,-4 5670: 103ff91e bne r2,zero,5658 <__call_exitprocs+0x5c> 5674: dfc00817 ldw ra,32(sp) 5678: ddc00717 ldw r23,28(sp) 567c: dd800617 ldw r22,24(sp) 5680: dd400517 ldw r21,20(sp) 5684: dd000417 ldw r20,16(sp) 5688: dcc00317 ldw r19,12(sp) 568c: dc800217 ldw r18,8(sp) 5690: dc400117 ldw r17,4(sp) 5694: dc000017 ldw r16,0(sp) 5698: dec00904 addi sp,sp,36 569c: f800283a ret 56a0: 90800117 ldw r2,4(r18) 56a4: 81800017 ldw r6,0(r16) 56a8: 10bfffc4 addi r2,r2,-1 56ac: 14401726 beq r2,r17,570c <__call_exitprocs+0x110> 56b0: 80000015 stw zero,0(r16) 56b4: 303feb26 beq r6,zero,5664 <__call_exitprocs+0x68> 56b8: a446983a sll r3,r20,r17 56bc: 90806217 ldw r2,392(r18) 56c0: 95c00117 ldw r23,4(r18) 56c4: 1884703a and r2,r3,r2 56c8: 1000081e bne r2,zero,56ec <__call_exitprocs+0xf0> 56cc: 303ee83a callr r6 56d0: 90c00117 ldw r3,4(r18) 56d4: 98805217 ldw r2,328(r19) 56d8: 1dc0011e bne r3,r23,56e0 <__call_exitprocs+0xe4> 56dc: 90bfe126 beq r18,r2,5664 <__call_exitprocs+0x68> 56e0: 103fe426 beq r2,zero,5674 <__call_exitprocs+0x78> 56e4: 1025883a mov r18,r2 56e8: 003fd506 br 5640 <__call_exitprocs+0x44> 56ec: 90806317 ldw r2,396(r18) 56f0: 81002017 ldw r4,128(r16) 56f4: 1886703a and r3,r3,r2 56f8: 1800061e bne r3,zero,5714 <__call_exitprocs+0x118> 56fc: 200b883a mov r5,r4 5700: a809883a mov r4,r21 5704: 303ee83a callr r6 5708: 003ff106 br 56d0 <__call_exitprocs+0xd4> 570c: 94400115 stw r17,4(r18) 5710: 003fe806 br 56b4 <__call_exitprocs+0xb8> 5714: 303ee83a callr r6 5718: 003fed06 br 56d0 <__call_exitprocs+0xd4> 0000571c <_exit>: * * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h */ void ALT_EXIT (int exit_code) { 571c: defffd04 addi sp,sp,-12 5720: df000215 stw fp,8(sp) 5724: df000204 addi fp,sp,8 5728: e13ffe15 stw r4,-8(fp) ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); /* Stop all other threads */ ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); ALT_OS_STOP(); 572c: 0001883a nop 5730: e0bffe17 ldw r2,-8(fp) 5734: e0bfff15 stw r2,-4(fp) /* * Routine called on exit. */ static ALT_INLINE ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) { register int r2 asm ("r2") = exit_code; 5738: e0bfff17 ldw r2,-4(fp) __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ __asm__ volatile ("break 2" : : "r"(r2), "r"(r3) ALT_GMON_DATA ); #else /* !DEBUG_STUB */ if (r2) { 573c: 10000226 beq r2,zero,5748 <_exit+0x2c> ALT_SIM_FAIL(); 5740: 002af070 cmpltui zero,zero,43969 } else { ALT_SIM_PASS(); } #endif /* DEBUG_STUB */ } 5744: 00000106 br 574c <_exit+0x30> ALT_SIM_PASS(); 5748: 002af0b0 cmpltui zero,zero,43970 } 574c: 0001883a nop ALT_SIM_HALT(exit_code); /* spin forever, since there's no where to go back to */ ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); while (1); 5750: 003fff06 br 5750 <_exit+0x34>