RTEMS-6
Annotated Report
libcsupport
Sun Feb 28 12:32:14 2021
4000ebd8 <RTEMS_Malloc_Initialize>:
Heap_Control *RTEMS_Malloc_Initialize(
const Memory_Information *mem,
Heap_Initialization_or_extend_handler extend
)
{
4000ebd8: fd010113 addi sp,sp,-48
heap = &_Malloc_Heap;
RTEMS_Malloc_Heap = heap;
init_or_extend = _Heap_Initialize;
page_size = CPU_HEAP_ALIGNMENT;
for (i = 0; i < _Memory_Get_count( mem ); ++i) {
4000ebdc: 00052783 lw a5,0(a0)
{
4000ebe0: 01512a23 sw s5,20(sp)
RTEMS_Malloc_Heap = heap;
4000ebe4: 40023ab7 lui s5,0x40023
4000ebe8: 150a8693 addi a3,s5,336 # 40023150 <_Malloc_Heap>
{
4000ebec: 02112623 sw ra,44(sp)
4000ebf0: 02812423 sw s0,40(sp)
4000ebf4: 02912223 sw s1,36(sp)
4000ebf8: 03212023 sw s2,32(sp)
4000ebfc: 01312e23 sw s3,28(sp)
4000ec00: 01412c23 sw s4,24(sp)
4000ec04: 01612823 sw s6,16(sp)
4000ec08: 01712623 sw s7,12(sp)
RTEMS_Malloc_Heap = heap;
4000ec0c: 90d1ae23 sw a3,-1764(gp) # 40020d5c <RTEMS_Malloc_Heap>
for (i = 0; i < _Memory_Get_count( mem ); ++i) {
4000ec10: 08078a63 beqz a5,4000eca4 <RTEMS_Malloc_Initialize+0xcc>
init_or_extend = _Heap_Initialize;
4000ec14: 40007a37 lui s4,0x40007
4000ec18: 560a0b93 addi s7,s4,1376 # 40007560 <_Heap_Initialize>
4000ec1c: 00050993 mv s3,a0
4000ec20: 00058b13 mv s6,a1
for (i = 0; i < _Memory_Get_count( mem ); ++i) {
4000ec24: 00000913 li s2,0
4000ec28: 00000493 li s1,0
init_or_extend = _Heap_Initialize;
4000ec2c: 560a0a13 addi s4,s4,1376
return &information->areas[ index ];
4000ec30: 0049a403 lw s0,4(s3)
Memory_Area *area;
uintptr_t space_available;
area = _Memory_Get_area( mem, i );
space_available = ( *init_or_extend )(
4000ec34: 01000693 li a3,16
4000ec38: 150a8513 addi a0,s5,336
4000ec3c: 01240433 add s0,s0,s2
return area->free;
4000ec40: 00442583 lw a1,4(s0)
return (uintptr_t) area->end - (uintptr_t) area->free;
4000ec44: 00842603 lw a2,8(s0)
4000ec48: 40b60633 sub a2,a2,a1
4000ec4c: 000a00e7 jalr s4
_Memory_Get_free_begin( area ),
_Memory_Get_free_size( area ),
page_size
);
if ( space_available > 0 ) {
4000ec50: 00050863 beqz a0,4000ec60 <RTEMS_Malloc_Initialize+0x88>
area->free = (char *) area->free + consume;
4000ec54: 00842783 lw a5,8(s0)
_Memory_Consume( area, _Memory_Get_free_size( area ) );
init_or_extend = extend;
4000ec58: 000b0a13 mv s4,s6
4000ec5c: 00f42223 sw a5,4(s0)
for (i = 0; i < _Memory_Get_count( mem ); ++i) {
4000ec60: 0009a783 lw a5,0(s3)
4000ec64: 00148493 addi s1,s1,1 # 1001 <_ISR_Stack_size+0x1>
4000ec68: 00c90913 addi s2,s2,12
4000ec6c: fcf4e2e3 bltu s1,a5,4000ec30 <RTEMS_Malloc_Initialize+0x58>
}
}
if ( init_or_extend == _Heap_Initialize ) {
4000ec70: 037a0a63 beq s4,s7,4000eca4 <RTEMS_Malloc_Initialize+0xcc>
_Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_HEAP );
}
return heap;
}
4000ec74: 02c12083 lw ra,44(sp)
4000ec78: 02812403 lw s0,40(sp)
4000ec7c: 02412483 lw s1,36(sp)
4000ec80: 02012903 lw s2,32(sp)
4000ec84: 01c12983 lw s3,28(sp)
4000ec88: 01812a03 lw s4,24(sp)
4000ec8c: 01012b03 lw s6,16(sp)
4000ec90: 00c12b83 lw s7,12(sp)
4000ec94: 150a8513 addi a0,s5,336
4000ec98: 01412a83 lw s5,20(sp)
4000ec9c: 03010113 addi sp,sp,48
4000eca0: 00008067 ret
_Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_HEAP );
4000eca4: 01700513 li a0,23
4000eca8: d11f80ef jal ra,400079b8 <_Internal_error> <== NOT EXECUTED
40002a40 <_Console_simple_Read>:
ssize_t _Console_simple_Read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
40002a40: fe010113 addi sp,sp,-32 <== NOT EXECUTED
40002a44: 01312623 sw s3,12(sp) <== NOT EXECUTED
40002a48: 00112e23 sw ra,28(sp) <== NOT EXECUTED
40002a4c: 00812c23 sw s0,24(sp) <== NOT EXECUTED
40002a50: 00912a23 sw s1,20(sp) <== NOT EXECUTED
40002a54: 01212823 sw s2,16(sp) <== NOT EXECUTED
40002a58: 00060993 mv s3,a2 <== NOT EXECUTED
ssize_t n;
buf = buffer;
n = (ssize_t) count;
for ( i = 0; i < n; ++i ) {
40002a5c: 02c05a63 blez a2,40002a90 <_Console_simple_Read+0x50> <== NOT EXECUTED
40002a60: 00058493 mv s1,a1 <== NOT EXECUTED
40002a64: 00c58933 add s2,a1,a2 <== NOT EXECUTED
int c;
while ( true ) {
c = getchark();
if ( c != -1 ) {
40002a68: fff00413 li s0,-1 <== NOT EXECUTED
40002a6c: 0080006f j 40002a74 <_Console_simple_Read+0x34> <== NOT EXECUTED
break;
}
(void) rtems_task_wake_after( 1 );
40002a70: 538040ef jal ra,40006fa8 <rtems_task_wake_after> <== NOT EXECUTED
c = getchark();
40002a74: 23c000ef jal ra,40002cb0 <getchark> <== NOT EXECUTED
40002a78: 00050793 mv a5,a0 <== NOT EXECUTED
(void) rtems_task_wake_after( 1 );
40002a7c: 00100513 li a0,1 <== NOT EXECUTED
if ( c != -1 ) {
40002a80: fe8788e3 beq a5,s0,40002a70 <_Console_simple_Read+0x30> <== NOT EXECUTED
}
buf[ i ] = (char) c;
40002a84: 00f48023 sb a5,0(s1) <== NOT EXECUTED
for ( i = 0; i < n; ++i ) {
40002a88: 00148493 addi s1,s1,1 <== NOT EXECUTED
40002a8c: ff2494e3 bne s1,s2,40002a74 <_Console_simple_Read+0x34> <== NOT EXECUTED
}
return n;
}
40002a90: 01c12083 lw ra,28(sp) <== NOT EXECUTED
40002a94: 01812403 lw s0,24(sp) <== NOT EXECUTED
40002a98: 01412483 lw s1,20(sp) <== NOT EXECUTED
40002a9c: 01012903 lw s2,16(sp) <== NOT EXECUTED
40002aa0: 00098513 mv a0,s3 <== NOT EXECUTED
40002aa4: 00c12983 lw s3,12(sp) <== NOT EXECUTED
40002aa8: 02010113 addi sp,sp,32 <== NOT EXECUTED
40002aac: 00008067 ret <== NOT EXECUTED
40003050 <_Malloc_System_state>:
*
* @return The current system state.
*/
RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
{
return _System_state_Current;
40003050: 9341a783 lw a5,-1740(gp) # 40020d74 <_System_state_Current> <== NOT EXECUTED
Malloc_System_state _Malloc_System_state( void )
{
System_state_Codes state = _System_state_Get();
if ( _System_state_Is_up( state ) ) {
40003054: 00200713 li a4,2 <== NOT EXECUTED
if ( _Thread_Dispatch_is_enabled() ) {
return MALLOC_SYSTEM_STATE_NORMAL;
} else {
return MALLOC_SYSTEM_STATE_NO_ALLOCATION;
}
} else if ( _System_state_Is_before_multitasking( state ) ) {
40003058: fff78513 addi a0,a5,-1 <== NOT EXECUTED
4000305c: 00a03533 snez a0,a0 <== NOT EXECUTED
if ( _System_state_Is_up( state ) ) {
40003060: 00e78463 beq a5,a4,40003068 <_Malloc_System_state+0x18> <== NOT EXECUTED
return MALLOC_SYSTEM_STATE_NORMAL;
} else {
return MALLOC_SYSTEM_STATE_NO_PROTECTION;
}
}
40003064: 00008067 ret <== NOT EXECUTED
ISR_Level level;
_ISR_Local_disable( level );
#endif
enabled = _Thread_Dispatch_disable_level == 0;
40003068: 400237b7 lui a5,0x40023 <== NOT EXECUTED
4000306c: f8078793 addi a5,a5,-128 # 40022f80 <_Per_CPU_Information> <== NOT EXECUTED
40003070: 0307a503 lw a0,48(a5) <== NOT EXECUTED
if ( _Thread_Dispatch_is_enabled() ) {
40003074: fe0508e3 beqz a0,40003064 <_Malloc_System_state+0x14> <== NOT EXECUTED
return MALLOC_SYSTEM_STATE_NO_ALLOCATION;
40003078: 00200513 li a0,2 <== NOT EXECUTED
}
4000307c: 00008067 ret <== NOT EXECUTED
4001dce8 <_gettimeofday_r>:
int _gettimeofday_r(
struct _reent *ignored_reentrancy_stuff RTEMS_UNUSED,
struct timeval *tp,
void *__tz
)
{
4001dce8: ff010113 addi sp,sp,-16
4001dcec: 00112623 sw ra,12(sp)
if ( !tp )
4001dcf0: 00058e63 beqz a1,4001dd0c <_gettimeofday_r+0x24> <== NEVER TAKEN
4001dcf4: 00058513 mv a0,a1
*/
RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
struct timeval *time
)
{
_Timecounter_Microtime( time );
4001dcf8: bf9ea0ef jal ra,400088f0 <_Timecounter_Microtime>
return 0;
4001dcfc: 00000513 li a0,0
struct timezone *tzp = __tz;
return gettimeofday( tp, tzp );
}
4001dd00: 00c12083 lw ra,12(sp)
4001dd04: 01010113 addi sp,sp,16
4001dd08: 00008067 ret
rtems_set_errno_and_return_minus_one( EFAULT );
4001dd0c: 9bdf60ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4001dd10: 00e00793 li a5,14 <== NOT EXECUTED
4001dd14: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4001dd18: fff00513 li a0,-1 <== NOT EXECUTED
4001dd1c: fe5ff06f j 4001dd00 <_gettimeofday_r+0x18> <== NOT EXECUTED
400015d8 <_libcsupport_scangr>:
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
400015d8: fd010113 addi sp,sp,-48
400015dc: 00c12623 sw a2,12(sp)
400015e0: 00d12423 sw a3,8(sp)
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
400015e4: 00000713 li a4,0
400015e8: 00810693 addi a3,sp,8
400015ec: 00c10613 addi a2,sp,12
{
400015f0: 02812423 sw s0,40(sp)
400015f4: 02912223 sw s1,36(sp)
400015f8: 02112623 sw ra,44(sp)
400015fc: 00050413 mv s0,a0
40001600: 00058493 mv s1,a1
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
40001604: bd1ff0ef jal ra,400011d4 <scanString>
40001608: 00051e63 bnez a0,40001624 <_libcsupport_scangr+0x4c>
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
|| !scanInt(fp, &grgid)
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
return 0;
4000160c: 00000513 li a0,0
}
}
grp->gr_mem[memcount] = NULL;
return 1;
}
40001610: 02c12083 lw ra,44(sp)
40001614: 02812403 lw s0,40(sp)
40001618: 02412483 lw s1,36(sp)
4000161c: 03010113 addi sp,sp,48
40001620: 00008067 ret
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
40001624: 00000713 li a4,0
40001628: 00810693 addi a3,sp,8
4000162c: 00c10613 addi a2,sp,12
40001630: 00448593 addi a1,s1,4
40001634: 00040513 mv a0,s0
40001638: b9dff0ef jal ra,400011d4 <scanString>
4000163c: fc0508e3 beqz a0,4000160c <_libcsupport_scangr+0x34> <== NEVER TAKEN
|| !scanInt(fp, &grgid)
40001640: 01810593 addi a1,sp,24
40001644: 00040513 mv a0,s0
40001648: a71ff0ef jal ra,400010b8 <scanInt>
4000164c: fc0500e3 beqz a0,4000160c <_libcsupport_scangr+0x34> <== NEVER TAKEN
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
40001650: 00100713 li a4,1
40001654: 00810693 addi a3,sp,8
40001658: 00c10613 addi a2,sp,12
4000165c: 01c10593 addi a1,sp,28
40001660: 00040513 mv a0,s0
40001664: b71ff0ef jal ra,400011d4 <scanString>
40001668: fa0502e3 beqz a0,4000160c <_libcsupport_scangr+0x34> <== NEVER TAKEN
grp->gr_gid = grgid;
4000166c: 01812783 lw a5,24(sp)
if (grmem[0] == '\0') {
40001670: 01c12503 lw a0,28(sp)
40001674: 01300693 li a3,19
grp->gr_gid = grgid;
40001678: 00f49423 sh a5,8(s1)
if (grmem[0] == '\0') {
4000167c: 00054783 lbu a5,0(a0)
40001680: 02078c63 beqz a5,400016b8 <_libcsupport_scangr+0xe0>
40001684: 00050713 mv a4,a0
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
40001688: 00100613 li a2,1
if(*cp == ',')
4000168c: 02c00593 li a1,44
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
40001690: 00170713 addi a4,a4,1
memcount++;
40001694: 00160693 addi a3,a2,1
if(*cp == ',')
40001698: 00b79863 bne a5,a1,400016a8 <_libcsupport_scangr+0xd0>
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
4000169c: 00260793 addi a5,a2,2
memcount++;
400016a0: 00068613 mv a2,a3
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
400016a4: 00078693 mv a3,a5
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
400016a8: 00074783 lbu a5,0(a4)
400016ac: fe0792e3 bnez a5,40001690 <_libcsupport_scangr+0xb8>
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
400016b0: 00269693 slli a3,a3,0x2
400016b4: 00f68693 addi a3,a3,15
400016b8: 00812783 lw a5,8(sp)
400016bc: f4d7e8e3 bltu a5,a3,4000160c <_libcsupport_scangr+0x34>
grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15);
400016c0: 00c12683 lw a3,12(sp)
400016c4: 00f68693 addi a3,a3,15
400016c8: ff06f693 andi a3,a3,-16
400016cc: 00d4a623 sw a3,12(s1)
if (grmem[0] == '\0') {
400016d0: 00054783 lbu a5,0(a0)
400016d4: 04078a63 beqz a5,40001728 <_libcsupport_scangr+0x150>
grp->gr_mem[0] = grmem;
400016d8: 00a6a023 sw a0,0(a3)
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
400016dc: 01c12783 lw a5,28(sp)
400016e0: 00100593 li a1,1
if(*cp == ',') {
400016e4: 02c00513 li a0,44
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
400016e8: 0007c703 lbu a4,0(a5)
grp->gr_mem[memcount] = NULL;
400016ec: 00468693 addi a3,a3,4
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
400016f0: 02070c63 beqz a4,40001728 <_libcsupport_scangr+0x150> <== NEVER TAKEN
grp->gr_mem[memcount++] = cp + 1;
400016f4: 00259613 slli a2,a1,0x2
400016f8: 00178793 addi a5,a5,1
if(*cp == ',') {
400016fc: 00a71e63 bne a4,a0,40001718 <_libcsupport_scangr+0x140>
*cp = '\0';
40001700: fe078fa3 sb zero,-1(a5)
grp->gr_mem[memcount++] = cp + 1;
40001704: 00c4a703 lw a4,12(s1)
40001708: 00158593 addi a1,a1,1
4000170c: 00c70733 add a4,a4,a2
40001710: 00f72023 sw a5,0(a4)
grp->gr_mem[memcount] = NULL;
40001714: 00460613 addi a2,a2,4
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
40001718: 0007c703 lbu a4,0(a5)
4000171c: fc071ce3 bnez a4,400016f4 <_libcsupport_scangr+0x11c>
grp->gr_mem[memcount] = NULL;
40001720: 00c4a683 lw a3,12(s1)
40001724: 00c686b3 add a3,a3,a2
40001728: 0006a023 sw zero,0(a3)
return 1;
4000172c: 00100513 li a0,1
40001730: ee1ff06f j 40001610 <_libcsupport_scangr+0x38>
40001388 <_libcsupport_scanpw>:
FILE *fp,
struct passwd *pwd,
char *buffer,
size_t bufsize
)
{
40001388: fd010113 addi sp,sp,-48
4000138c: 00c12623 sw a2,12(sp)
40001390: 00d12423 sw a3,8(sp)
int pwuid, pwgid;
if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
40001394: 00000713 li a4,0
40001398: 00810693 addi a3,sp,8
4000139c: 00c10613 addi a2,sp,12
{
400013a0: 02812423 sw s0,40(sp)
400013a4: 02912223 sw s1,36(sp)
400013a8: 02112623 sw ra,44(sp)
400013ac: 00050413 mv s0,a0
400013b0: 00058493 mv s1,a1
if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
400013b4: e21ff0ef jal ra,400011d4 <scanString>
400013b8: 00051e63 bnez a0,400013d4 <_libcsupport_scanpw+0x4c>
|| !scanInt(fp, &pwgid)
|| !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1))
return 0;
400013bc: 00000513 li a0,0
pwd->pw_uid = pwuid;
pwd->pw_gid = pwgid;
return 1;
}
400013c0: 02c12083 lw ra,44(sp)
400013c4: 02812403 lw s0,40(sp)
400013c8: 02412483 lw s1,36(sp)
400013cc: 03010113 addi sp,sp,48
400013d0: 00008067 ret
|| !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0)
400013d4: 00000713 li a4,0
400013d8: 00810693 addi a3,sp,8
400013dc: 00c10613 addi a2,sp,12
400013e0: 00448593 addi a1,s1,4
400013e4: 00040513 mv a0,s0
400013e8: dedff0ef jal ra,400011d4 <scanString>
400013ec: fc0508e3 beqz a0,400013bc <_libcsupport_scanpw+0x34> <== NEVER TAKEN
|| !scanInt(fp, &pwuid)
400013f0: 01810593 addi a1,sp,24
400013f4: 00040513 mv a0,s0
400013f8: cc1ff0ef jal ra,400010b8 <scanInt>
400013fc: fc0500e3 beqz a0,400013bc <_libcsupport_scanpw+0x34>
|| !scanInt(fp, &pwgid)
40001400: 01c10593 addi a1,sp,28
40001404: 00040513 mv a0,s0
40001408: cb1ff0ef jal ra,400010b8 <scanInt>
4000140c: fa0508e3 beqz a0,400013bc <_libcsupport_scanpw+0x34>
|| !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0)
40001410: 00000713 li a4,0
40001414: 00810693 addi a3,sp,8
40001418: 00c10613 addi a2,sp,12
4000141c: 00c48593 addi a1,s1,12
40001420: 00040513 mv a0,s0
40001424: db1ff0ef jal ra,400011d4 <scanString>
40001428: f8050ae3 beqz a0,400013bc <_libcsupport_scanpw+0x34> <== NEVER TAKEN
|| !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0)
4000142c: 00000713 li a4,0
40001430: 00810693 addi a3,sp,8
40001434: 00c10613 addi a2,sp,12
40001438: 01048593 addi a1,s1,16
4000143c: 00040513 mv a0,s0
40001440: d95ff0ef jal ra,400011d4 <scanString>
40001444: f6050ce3 beqz a0,400013bc <_libcsupport_scanpw+0x34> <== NEVER TAKEN
|| !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0)
40001448: 00000713 li a4,0
4000144c: 00810693 addi a3,sp,8
40001450: 00c10613 addi a2,sp,12
40001454: 01448593 addi a1,s1,20
40001458: 00040513 mv a0,s0
4000145c: d79ff0ef jal ra,400011d4 <scanString>
40001460: f4050ee3 beqz a0,400013bc <_libcsupport_scanpw+0x34> <== NEVER TAKEN
|| !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1))
40001464: 00100713 li a4,1
40001468: 00810693 addi a3,sp,8
4000146c: 00c10613 addi a2,sp,12
40001470: 01848593 addi a1,s1,24
40001474: 00040513 mv a0,s0
40001478: d5dff0ef jal ra,400011d4 <scanString>
4000147c: f40500e3 beqz a0,400013bc <_libcsupport_scanpw+0x34>
pwd->pw_uid = pwuid;
40001480: 01812783 lw a5,24(sp)
return 1;
40001484: 00100513 li a0,1
pwd->pw_uid = pwuid;
40001488: 00f49423 sh a5,8(s1)
pwd->pw_gid = pwgid;
4000148c: 01c12783 lw a5,28(sp)
40001490: 00f49523 sh a5,10(s1)
return 1;
40001494: f2dff06f j 400013c0 <_libcsupport_scanpw+0x38>
40003d10 <_read_r>:
struct _reent *ptr RTEMS_UNUSED,
int fd,
void *buf,
size_t nbytes
)
{
40003d10: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40003d14: 00112623 sw ra,12(sp) <== NOT EXECUTED
40003d18: 00060793 mv a5,a2 <== NOT EXECUTED
rtems_libio_check_buffer( buffer );
40003d1c: 04060663 beqz a2,40003d68 <_read_r+0x58> <== NOT EXECUTED
40003d20: 00068613 mv a2,a3 <== NOT EXECUTED
rtems_libio_check_count( count );
40003d24: 02068063 beqz a3,40003d44 <_read_r+0x34> <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_READ, EBADF );
40003d28: 8901a703 lw a4,-1904(gp) # 40020cd0 <rtems_libio_number_iops> <== NOT EXECUTED
40003d2c: 00058513 mv a0,a1 <== NOT EXECUTED
40003d30: 02e5f263 bgeu a1,a4,40003d54 <_read_r+0x44> <== NOT EXECUTED
return read( fd, buf, nbytes );
}
40003d34: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40003d38: 00078593 mv a1,a5 <== NOT EXECUTED
40003d3c: 01010113 addi sp,sp,16 <== NOT EXECUTED
40003d40: ebdff06f j 40003bfc <read.part.0> <== NOT EXECUTED
rtems_libio_check_count( count );
40003d44: 00000513 li a0,0 <== NOT EXECUTED
}
40003d48: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40003d4c: 01010113 addi sp,sp,16 <== NOT EXECUTED
40003d50: 00008067 ret <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_READ, EBADF );
40003d54: 175100ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40003d58: 00900793 li a5,9 <== NOT EXECUTED
40003d5c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40003d60: fff00513 li a0,-1 <== NOT EXECUTED
40003d64: fe5ff06f j 40003d48 <_read_r+0x38> <== NOT EXECUTED
rtems_libio_check_buffer( buffer );
40003d68: 161100ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40003d6c: 01600793 li a5,22 <== NOT EXECUTED
40003d70: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40003d74: fff00513 li a0,-1 <== NOT EXECUTED
40003d78: fd1ff06f j 40003d48 <_read_r+0x38> <== NOT EXECUTED
40000200 <clock>:
#include <rtems/score/timecounter.h>
RTEMS_STATIC_ASSERT( CLOCKS_PER_SEC == 1000000, clocks_per_sec );
clock_t clock( void )
{
40000200: fe010113 addi sp,sp,-32
struct timeval tv;
_Timecounter_Microuptime( &tv );
40000204: 00010513 mv a0,sp
{
40000208: 00112e23 sw ra,28(sp)
_Timecounter_Microuptime( &tv );
4000020c: 0c1030ef jal ra,40003acc <_Timecounter_Microuptime>
return (clock_t) (tv.tv_sec - 1) * CLOCKS_PER_SEC + tv.tv_usec;
40000210: 00012703 lw a4,0(sp)
40000214: 00412583 lw a1,4(sp)
40000218: 000f46b7 lui a3,0xf4
4000021c: 00173793 seqz a5,a4
40000220: 24068693 addi a3,a3,576 # f4240 <bsp_section_text_size+0xe5094>
40000224: fff70713 addi a4,a4,-1
40000228: 40f585b3 sub a1,a1,a5
4000022c: 02d70633 mul a2,a4,a3
40000230: 00812503 lw a0,8(sp)
}
40000234: 01c12083 lw ra,28(sp)
return (clock_t) (tv.tv_sec - 1) * CLOCKS_PER_SEC + tv.tv_usec;
40000238: 41f55813 srai a6,a0,0x1f
}
4000023c: 02010113 addi sp,sp,32
return (clock_t) (tv.tv_sec - 1) * CLOCKS_PER_SEC + tv.tv_usec;
40000240: 02d587b3 mul a5,a1,a3
40000244: 00a60533 add a0,a2,a0
40000248: 00c535b3 sltu a1,a0,a2
4000024c: 02d73733 mulhu a4,a4,a3 <== NOT EXECUTED
40000250: 00e787b3 add a5,a5,a4
40000254: 010787b3 add a5,a5,a6 <== NOT EXECUTED
}
40000258: 00f585b3 add a1,a1,a5
4000025c: 00008067 ret
400028cc <close>:
{
rtems_libio_t *iop;
unsigned int flags;
int rc;
if ( (uint32_t) fd >= rtems_libio_number_iops ) {
400028cc: 8901a783 lw a5,-1904(gp) # 40020cd0 <rtems_libio_number_iops>
{
400028d0: ff010113 addi sp,sp,-16
400028d4: 00112623 sw ra,12(sp)
400028d8: 00812423 sw s0,8(sp)
if ( (uint32_t) fd >= rtems_libio_number_iops ) {
400028dc: 06f57663 bgeu a0,a5,40002948 <close+0x7c>
*
* @return The iop corresponding to the specified file descriptor.
*/
static inline rtems_libio_t *rtems_libio_iop( int fd )
{
return &rtems_libio_iops[ fd ];
400028e0: 00151e13 slli t3,a0,0x1
400028e4: 00ae0433 add s0,t3,a0
400028e8: 40023337 lui t1,0x40023
400028ec: cd830313 addi t1,t1,-808 # 40022cd8 <rtems_libio_iops>
400028f0: 00441413 slli s0,s0,0x4
400028f4: 00830433 add s0,t1,s0
return atomic_load_explicit( obj, order );
#else
unsigned int val;
(void) order;
val = *obj;
400028f8: 00042703 lw a4,0(s0)
if ( ( flags & LIBIO_FLAGS_OPEN ) == 0 ) {
rtems_set_errno_and_return_minus_one( EBADF );
}
/* The expected flags */
flags &= LIBIO_FLAGS_REFERENCE_INC - 1U;
400028fc: 000018b7 lui a7,0x1
40002900: fff88593 addi a1,a7,-1 # fff <bsp_section_data_size+0x8df>
if ( success ) {
break;
}
if ( ( flags & ~( LIBIO_FLAGS_REFERENCE_INC - 1U ) ) != 0 ) {
40002904: fffff837 lui a6,0xfffff
desired = flags & ~LIBIO_FLAGS_OPEN;
40002908: eff88893 addi a7,a7,-257
4000290c: 0300006f j 4000293c <close+0x70>
static inline uint32_t riscv_interrupt_disable( void )
{
unsigned long mstatus;
__asm__ volatile (
40002910: 300476f3 csrrci a3,mstatus,8
"csrrc %0, mstatus, " RTEMS_XSTRING( RISCV_MSTATUS_MIE ) :
"=&r" ( mstatus )
);
return mstatus & RISCV_MSTATUS_MIE;
40002914: 0086f693 andi a3,a3,8
unsigned int actual;
(void) succ;
(void) fail;
_ISR_Local_disable( level );
actual = *obj;
40002918: 00042783 lw a5,0(s0)
success = ( actual == *expected );
if ( success ) {
4000291c: 00f61663 bne a2,a5,40002928 <close+0x5c>
40002920: 01177733 and a4,a4,a7
*obj = desired;
40002924: 00e42023 sw a4,0(s0)
}
static inline void riscv_interrupt_enable( uint32_t level )
{
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002928: 3006a073 csrs mstatus,a3
if ( ( flags & ~( LIBIO_FLAGS_REFERENCE_INC - 1U ) ) != 0 ) {
4000292c: 0107f733 and a4,a5,a6
if ( success ) {
40002930: 02f60e63 beq a2,a5,4000296c <close+0xa0>
if ( ( flags & ~( LIBIO_FLAGS_REFERENCE_INC - 1U ) ) != 0 ) {
40002934: 06071c63 bnez a4,400029ac <close+0xe0> <== ALWAYS TAKEN
40002938: 00078713 mv a4,a5 <== NOT EXECUTED
if ( ( flags & LIBIO_FLAGS_OPEN ) == 0 ) {
4000293c: 10077793 andi a5,a4,256 <== NOT EXECUTED
flags &= LIBIO_FLAGS_REFERENCE_INC - 1U;
40002940: 00b77633 and a2,a4,a1
if ( ( flags & LIBIO_FLAGS_OPEN ) == 0 ) {
40002944: fc0796e3 bnez a5,40002910 <close+0x44>
rtems_set_errno_and_return_minus_one( EBADF );
40002948: 581110ef jal ra,400146c8 <__errno>
4000294c: fff00413 li s0,-1 <== NOT EXECUTED
40002950: 00900793 li a5,9 <== NOT EXECUTED
rc = (*iop->pathinfo.handlers->close_h)( iop );
rtems_libio_free( iop );
return rc;
}
40002954: 00c12083 lw ra,12(sp) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EBADF );
40002958: 00f52023 sw a5,0(a0) <== NOT EXECUTED
}
4000295c: 00040513 mv a0,s0 <== NOT EXECUTED
40002960: 00812403 lw s0,8(sp) <== NOT EXECUTED
40002964: 01010113 addi sp,sp,16 <== NOT EXECUTED
40002968: 00008067 ret <== NOT EXECUTED
rc = (*iop->pathinfo.handlers->close_h)( iop );
4000296c: 00ae0533 add a0,t3,a0 <== NOT EXECUTED
40002970: 00451513 slli a0,a0,0x4
40002974: 00a30333 add t1,t1,a0
40002978: 02032783 lw a5,32(t1)
4000297c: 00040513 mv a0,s0
40002980: 0047a783 lw a5,4(a5)
40002984: 000780e7 jalr a5
40002988: 00050793 mv a5,a0
rtems_libio_free( iop );
4000298c: 00040513 mv a0,s0
rc = (*iop->pathinfo.handlers->close_h)( iop );
40002990: 00078413 mv s0,a5
rtems_libio_free( iop );
40002994: 4b8000ef jal ra,40002e4c <rtems_libio_free>
}
40002998: 00c12083 lw ra,12(sp)
4000299c: 00040513 mv a0,s0
400029a0: 00812403 lw s0,8(sp)
400029a4: 01010113 addi sp,sp,16
400029a8: 00008067 ret
rtems_set_errno_and_return_minus_one( EBUSY );
400029ac: 51d110ef jal ra,400146c8 <__errno>
400029b0: fff00413 li s0,-1 <== NOT EXECUTED
400029b4: 01000793 li a5,16 <== NOT EXECUTED
}
400029b8: 00c12083 lw ra,12(sp) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EBUSY );
400029bc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
}
400029c0: 00040513 mv a0,s0 <== NOT EXECUTED
400029c4: 00812403 lw s0,8(sp) <== NOT EXECUTED
400029c8: 01010113 addi sp,sp,16 <== NOT EXECUTED
400029cc: 00008067 ret <== NOT EXECUTED
400068ac <endgrent>:
void endgrent(void)
{
400068ac: ff010113 addi sp,sp,-16
pthread_once(&grp_once, grp_init);
400068b0: 400065b7 lui a1,0x40006
{
400068b4: 00912223 sw s1,4(sp)
pthread_once(&grp_once, grp_init);
400068b8: 76858593 addi a1,a1,1896 # 40006768 <grp_init>
400068bc: 8b818513 addi a0,gp,-1864 # 400142f8 <grp_once>
{
400068c0: 00112623 sw ra,12(sp)
400068c4: 00812423 sw s0,8(sp)
return pthread_getspecific(grp_key);
400068c8: 8b418493 addi s1,gp,-1868 # 400142f4 <grp_key>
pthread_once(&grp_once, grp_init);
400068cc: ad9fd0ef jal ra,400043a4 <pthread_once>
return pthread_getspecific(grp_key);
400068d0: 0004a503 lw a0,0(s1)
400068d4: 180010ef jal ra,40007a54 <pthread_getspecific>
grp_context *ctx = grp_get_context();
if (ctx == NULL)
400068d8: 02050c63 beqz a0,40006910 <endgrent+0x64>
400068dc: 00050413 mv s0,a0
return;
if (ctx->fp != NULL) {
400068e0: 00052503 lw a0,0(a0)
400068e4: 00050463 beqz a0,400068ec <endgrent+0x40> <== NEVER TAKEN
fclose(ctx->fp);
400068e8: 2a8080ef jal ra,4000eb90 <fclose>
}
free(ctx);
400068ec: 00040513 mv a0,s0
400068f0: cf9ff0ef jal ra,400065e8 <free>
pthread_setspecific(grp_key, NULL);
}
400068f4: 00812403 lw s0,8(sp)
pthread_setspecific(grp_key, NULL);
400068f8: 0004a503 lw a0,0(s1)
}
400068fc: 00c12083 lw ra,12(sp)
40006900: 00412483 lw s1,4(sp)
pthread_setspecific(grp_key, NULL);
40006904: 00000593 li a1,0
}
40006908: 01010113 addi sp,sp,16
pthread_setspecific(grp_key, NULL);
4000690c: 1940106f j 40007aa0 <pthread_setspecific>
}
40006910: 00c12083 lw ra,12(sp)
40006914: 00812403 lw s0,8(sp)
40006918: 00412483 lw s1,4(sp)
4000691c: 01010113 addi sp,sp,16
40006920: 00008067 ret
40000a3c <endpwent>:
void endpwent(void)
{
if (passwd_fp != NULL)
40000a3c: 8b81a503 lw a0,-1864(gp) # 400140e0 <passwd_fp>
40000a40: 00050463 beqz a0,40000a48 <endpwent+0xc> <== NEVER TAKEN
fclose(passwd_fp);
40000a44: 1650e06f j 4000f3a8 <fclose>
}
40000a48: 00008067 ret <== NOT EXECUTED
40001070 <fchdir>:
st.st_mode = 0;
st.st_uid = 0;
st.st_gid = 0;
LIBIO_GET_IOP( fd, iop );
40001070: 88c1a783 lw a5,-1908(gp) # 40019b2c <rtems_libio_number_iops>
{
40001074: f6010113 addi sp,sp,-160
40001078: 08112e23 sw ra,156(sp)
4000107c: 08812c23 sw s0,152(sp)
40001080: 08912a23 sw s1,148(sp)
40001084: 09212823 sw s2,144(sp)
40001088: 09312623 sw s3,140(sp)
4000108c: 09412423 sw s4,136(sp)
40001090: 09512223 sw s5,132(sp)
st.st_mode = 0;
40001094: 02012423 sw zero,40(sp)
st.st_uid = 0;
40001098: 02011723 sh zero,46(sp)
st.st_gid = 0;
4000109c: 02011823 sh zero,48(sp)
LIBIO_GET_IOP( fd, iop );
400010a0: 14f57063 bgeu a0,a5,400011e0 <fchdir+0x170>
400010a4: 00151a13 slli s4,a0,0x1
400010a8: 00aa0433 add s0,s4,a0
400010ac: 4001b4b7 lui s1,0x4001b
400010b0: 00441413 slli s0,s0,0x4
400010b4: 68848493 addi s1,s1,1672 # 4001b688 <rtems_libio_iops>
400010b8: 00050993 mv s3,a0
400010bc: 00848ab3 add s5,s1,s0
__asm__ volatile (
400010c0: 30047773 csrrci a4,mstatus,8
val = *obj;
400010c4: 000aa783 lw a5,0(s5)
*obj = val + arg;
400010c8: 000016b7 lui a3,0x1
400010cc: 00d78633 add a2,a5,a3
400010d0: 00caa023 sw a2,0(s5)
return mstatus & RISCV_MSTATUS_MIE;
400010d4: 00877713 andi a4,a4,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400010d8: 30072073 csrs mstatus,a4
400010dc: 1007f793 andi a5,a5,256
400010e0: 0e078463 beqz a5,400011c8 <fchdir+0x158>
static inline void rtems_filesystem_instance_lock(
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
400010e4: 024aa503 lw a0,36(s5)
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st );
400010e8: 01040413 addi s0,s0,16
400010ec: 00848433 add s0,s1,s0
(*mt_entry->ops->lock_h)( mt_entry );
400010f0: 00c52783 lw a5,12(a0)
400010f4: 0007a783 lw a5,0(a5)
400010f8: 000780e7 jalr a5
400010fc: 020aa783 lw a5,32(s5)
40001100: 01810593 addi a1,sp,24
40001104: 00040513 mv a0,s0
40001108: 0187a783 lw a5,24(a5)
4000110c: 000780e7 jalr a5
40001110: 00050913 mv s2,a0
if ( rv == 0 ) {
40001114: 06050463 beqz a0,4000117c <fchdir+0x10c> <== ALWAYS TAKEN
static inline void rtems_filesystem_instance_unlock(
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
40001118: 013a0a33 add s4,s4,s3
4000111c: 004a1a13 slli s4,s4,0x4
40001120: 01448a33 add s4,s1,s4
40001124: 024a2503 lw a0,36(s4)
(*mt_entry->ops->unlock_h)( mt_entry );
40001128: 00c52783 lw a5,12(a0)
4000112c: 0047a783 lw a5,4(a5)
40001130: 000780e7 jalr a5
__asm__ volatile (
40001134: 300477f3 csrrci a5,mstatus,8
*obj = val - arg;
40001138: 000aa703 lw a4,0(s5)
4000113c: fffff6b7 lui a3,0xfffff
40001140: 00d70733 add a4,a4,a3
40001144: 00eaa023 sw a4,0(s5)
return mstatus & RISCV_MSTATUS_MIE;
40001148: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000114c: 3007a073 csrs mstatus,a5
}
}
rtems_filesystem_instance_unlock( &iop->pathinfo );
rtems_libio_iop_drop( iop );
if ( rv == 0 ) {
40001150: 04090a63 beqz s2,400011a4 <fchdir+0x134>
rv = rtems_filesystem_chdir( &loc );
}
return rv;
}
40001154: 09c12083 lw ra,156(sp)
40001158: 09812403 lw s0,152(sp)
4000115c: 09412483 lw s1,148(sp)
40001160: 08c12983 lw s3,140(sp)
40001164: 08812a03 lw s4,136(sp)
40001168: 08412a83 lw s5,132(sp)
4000116c: 00090513 mv a0,s2
40001170: 09012903 lw s2,144(sp)
40001174: 0a010113 addi sp,sp,160
40001178: 00008067 ret
bool access_ok = rtems_filesystem_check_access(
4000117c: 03015683 lhu a3,48(sp)
40001180: 02e15603 lhu a2,46(sp)
40001184: 02812583 lw a1,40(sp)
40001188: 00100513 li a0,1
4000118c: 631010ef jal ra,40002fbc <rtems_filesystem_check_access>
if ( access_ok ) {
40001190: 02050263 beqz a0,400011b4 <fchdir+0x144>
rtems_filesystem_location_clone( &loc, &iop->pathinfo );
40001194: 00040593 mv a1,s0
40001198: 00010513 mv a0,sp
4000119c: 1c9090ef jal ra,4000ab64 <rtems_filesystem_location_clone>
400011a0: f79ff06f j 40001118 <fchdir+0xa8>
rv = rtems_filesystem_chdir( &loc );
400011a4: 00010513 mv a0,sp
400011a8: 131090ef jal ra,4000aad8 <rtems_filesystem_chdir>
400011ac: 00050913 mv s2,a0
400011b0: fa5ff06f j 40001154 <fchdir+0xe4>
errno = EACCES;
400011b4: 0490f0ef jal ra,400109fc <__errno>
400011b8: 00d00793 li a5,13
400011bc: 00f52023 sw a5,0(a0)
rv = -1;
400011c0: fff00913 li s2,-1
400011c4: f55ff06f j 40001118 <fchdir+0xa8>
__asm__ volatile (
400011c8: 300477f3 csrrci a5,mstatus,8
400011cc: 000aa703 lw a4,0(s5)
400011d0: 40d706b3 sub a3,a4,a3
400011d4: 00daa023 sw a3,0(s5)
return mstatus & RISCV_MSTATUS_MIE;
400011d8: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400011dc: 3007a073 csrs mstatus,a5
LIBIO_GET_IOP( fd, iop );
400011e0: 01d0f0ef jal ra,400109fc <__errno>
400011e4: 00900793 li a5,9
400011e8: 00f52023 sw a5,0(a0)
400011ec: fff00913 li s2,-1
400011f0: f65ff06f j 40001154 <fchdir+0xe4>
400015e4 <fcntl>:
int fcntl(
int fd,
int cmd,
...
)
{
400015e4: fa010113 addi sp,sp,-96
LIBIO_GET_IOP( fd, iop );
400015e8: 88c1a303 lw t1,-1908(gp) # 40019b2c <rtems_libio_number_iops>
int ret;
va_list ap;
va_start( ap, cmd );
400015ec: 04810e13 addi t3,sp,72
{
400015f0: 02112e23 sw ra,60(sp)
400015f4: 02812c23 sw s0,56(sp)
400015f8: 02912a23 sw s1,52(sp)
400015fc: 03212823 sw s2,48(sp)
40001600: 03312623 sw s3,44(sp)
40001604: 03412423 sw s4,40(sp)
40001608: 03512223 sw s5,36(sp)
4000160c: 03612023 sw s6,32(sp)
40001610: 01712e23 sw s7,28(sp)
40001614: 01812c23 sw s8,24(sp)
40001618: 01912a23 sw s9,20(sp)
4000161c: 01a12823 sw s10,16(sp)
40001620: 04c12423 sw a2,72(sp)
40001624: 04d12623 sw a3,76(sp)
40001628: 04e12823 sw a4,80(sp)
4000162c: 04f12a23 sw a5,84(sp)
40001630: 05012c23 sw a6,88(sp)
40001634: 05112e23 sw a7,92(sp)
va_start( ap, cmd );
40001638: 01c12623 sw t3,12(sp)
LIBIO_GET_IOP( fd, iop );
4000163c: 38657663 bgeu a0,t1,400019c8 <fcntl+0x3e4>
40001640: 00151b13 slli s6,a0,0x1
40001644: 00ab09b3 add s3,s6,a0
return &rtems_libio_iops[ fd ];
40001648: 4001b937 lui s2,0x4001b
4000164c: 00499993 slli s3,s3,0x4
40001650: 68890913 addi s2,s2,1672 # 4001b688 <rtems_libio_iops>
40001654: 00050493 mv s1,a0
40001658: 01390433 add s0,s2,s3
__asm__ volatile (
4000165c: 30047773 csrrci a4,mstatus,8
val = *obj;
40001660: 00042783 lw a5,0(s0)
*obj = val + arg;
40001664: 000016b7 lui a3,0x1
40001668: 00d78633 add a2,a5,a3
4000166c: 00c42023 sw a2,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40001670: 00877713 andi a4,a4,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40001674: 30072073 csrs mstatus,a4
40001678: 1007f793 andi a5,a5,256
4000167c: 32078a63 beqz a5,400019b0 <fcntl+0x3cc>
40001680: 01400793 li a5,20
40001684: 00058a93 mv s5,a1
switch ( cmd ) {
40001688: 08b7e263 bltu a5,a1,4000170c <fcntl+0x128>
4000168c: 40018737 lui a4,0x40018
40001690: 00259793 slli a5,a1,0x2
40001694: a9070713 addi a4,a4,-1392 # 40017a90 <_Console_simple_Node_control+0x10>
40001698: 00e787b3 add a5,a5,a4
4000169c: 0007a783 lw a5,0(a5)
400016a0: 00078067 jr a5
errno = ENOTSUP;
400016a4: 3580f0ef jal ra,400109fc <__errno>
400016a8: 08600793 li a5,134
400016ac: 00f52023 sw a5,0(a0)
ret = -1;
400016b0: fff00a13 li s4,-1
__asm__ volatile (
400016b4: 300477f3 csrrci a5,mstatus,8
*obj = val - arg;
400016b8: 00042703 lw a4,0(s0)
400016bc: fffff6b7 lui a3,0xfffff
400016c0: 00d70733 add a4,a4,a3
400016c4: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
400016c8: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400016cc: 3007a073 csrs mstatus,a5
ret = vfcntl(fd,cmd,ap);
va_end(ap);
return ret;
}
400016d0: 03c12083 lw ra,60(sp)
400016d4: 03812403 lw s0,56(sp)
400016d8: 03412483 lw s1,52(sp)
400016dc: 03012903 lw s2,48(sp)
400016e0: 02c12983 lw s3,44(sp)
400016e4: 02412a83 lw s5,36(sp)
400016e8: 02012b03 lw s6,32(sp)
400016ec: 01c12b83 lw s7,28(sp)
400016f0: 01812c03 lw s8,24(sp)
400016f4: 01412c83 lw s9,20(sp)
400016f8: 01012d03 lw s10,16(sp)
400016fc: 000a0513 mv a0,s4
40001700: 02812a03 lw s4,40(sp)
40001704: 06010113 addi sp,sp,96
40001708: 00008067 ret
errno = EINVAL;
4000170c: 2f00f0ef jal ra,400109fc <__errno>
40001710: 01600793 li a5,22
40001714: 00f52023 sw a5,0(a0)
ret = -1;
40001718: fff00a13 li s4,-1
4000171c: f99ff06f j 400016b4 <fcntl+0xd0>
val = *obj;
40001720: 00042503 lw a0,0(s0)
oflag = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
40001724: 7bc000ef jal ra,40001ee0 <rtems_libio_to_fcntl_flags>
40001728: 00050c13 mv s8,a0
diop = rtems_libio_allocate();
4000172c: 001000ef jal ra,40001f2c <rtems_libio_allocate>
40001730: 00050b93 mv s7,a0
if (diop != NULL) {
40001734: 2a050463 beqz a0,400019dc <fcntl+0x3f8> <== NEVER TAKEN
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
40001738: 02442503 lw a0,36(s0)
(*mt_entry->ops->lock_h)( mt_entry );
4000173c: 00c52783 lw a5,12(a0)
40001740: 0007a783 lw a5,0(a5)
40001744: 000780e7 jalr a5
rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo );
40001748: 01098593 addi a1,s3,16
4000174c: 00b905b3 add a1,s2,a1
40001750: 010b8513 addi a0,s7,16
40001754: 410090ef jal ra,4000ab64 <rtems_filesystem_location_clone>
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
40001758: 02442503 lw a0,36(s0)
(*mt_entry->ops->unlock_h)( mt_entry );
4000175c: 00c52783 lw a5,12(a0)
40001760: 0047a783 lw a5,4(a5)
40001764: 000780e7 jalr a5
rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 );
40001768: 020ba783 lw a5,32(s7)
4000176c: 00000693 li a3,0
40001770: 000c0613 mv a2,s8
40001774: 0007a783 lw a5,0(a5)
40001778: 00000593 li a1,0
4000177c: 000b8513 mv a0,s7
40001780: 000780e7 jalr a5
40001784: 00050a13 mv s4,a0
if ( rv == 0 ) {
40001788: 20051863 bnez a0,40001998 <fcntl+0x3b4> <== NEVER TAKEN
LIBIO_FLAGS_OPEN | rtems_libio_fcntl_flags( oflag )
4000178c: 000c0513 mv a0,s8
40001790: 704000ef jal ra,40001e94 <rtems_libio_fcntl_flags>
__asm__ volatile (
40001794: 30047773 csrrci a4,mstatus,8
*obj = val | arg;
40001798: 000ba783 lw a5,0(s7)
4000179c: 00f567b3 or a5,a0,a5
400017a0: 1007e793 ori a5,a5,256
400017a4: 00fba023 sw a5,0(s7)
return mstatus & RISCV_MSTATUS_MIE;
400017a8: 00877793 andi a5,a4,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400017ac: 3007a073 csrs mstatus,a5
rv = rtems_libio_iop_to_descriptor( diop );
400017b0: aaaab537 lui a0,0xaaaab
400017b4: 412b8a33 sub s4,s7,s2
400017b8: 404a5a13 srai s4,s4,0x4
400017bc: aab50513 addi a0,a0,-1365 # aaaaaaab <RamEnd+0x69aaaaab>
400017c0: 02aa0a33 mul s4,s4,a0
if (ret >= 0) {
400017c4: ee0a48e3 bltz s4,400016b4 <fcntl+0xd0> <== NEVER TAKEN
400017c8: 0100006f j 400017d8 <fcntl+0x1f4>
val = *obj;
400017cc: 00042503 lw a0,0(s0)
ret = ((rtems_libio_iop_flags(iop) & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0);
400017d0: 00b55513 srli a0,a0,0xb
400017d4: 00157a13 andi s4,a0,1
int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd );
400017d8: 009b04b3 add s1,s6,s1
400017dc: 00449493 slli s1,s1,0x4
400017e0: 009904b3 add s1,s2,s1
400017e4: 0204a783 lw a5,32(s1)
400017e8: 000a8593 mv a1,s5
400017ec: 00040513 mv a0,s0
400017f0: 0287a783 lw a5,40(a5)
400017f4: 000780e7 jalr a5
400017f8: 00050493 mv s1,a0
if (err) {
400017fc: ea050ce3 beqz a0,400016b4 <fcntl+0xd0> <== ALWAYS TAKEN
errno = err;
40001800: 1fc0f0ef jal ra,400109fc <__errno> <== NOT EXECUTED
40001804: 00952023 sw s1,0(a0) <== NOT EXECUTED
ret = -1;
40001808: fff00a13 li s4,-1 <== NOT EXECUTED
4000180c: ea9ff06f j 400016b4 <fcntl+0xd0> <== NOT EXECUTED
if ( va_arg( ap, int ) )
40001810: 000e2a03 lw s4,0(t3)
40001814: 160a0063 beqz s4,40001974 <fcntl+0x390>
__asm__ volatile (
40001818: 300477f3 csrrci a5,mstatus,8
*obj = val | arg;
4000181c: 00042703 lw a4,0(s0)
40001820: 000016b7 lui a3,0x1
40001824: 80068693 addi a3,a3,-2048 # 800 <bsp_section_data_size+0x138>
40001828: 00d76733 or a4,a4,a3
4000182c: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40001830: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40001834: 3007a073 csrs mstatus,a5
int ret = 0;
40001838: 00000a13 li s4,0
4000183c: f9dff06f j 400017d8 <fcntl+0x1f4>
val = *obj;
40001840: 00042503 lw a0,0(s0)
ret = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
40001844: 69c000ef jal ra,40001ee0 <rtems_libio_to_fcntl_flags>
40001848: 00050a13 mv s4,a0
if (ret >= 0) {
4000184c: e60a44e3 bltz s4,400016b4 <fcntl+0xd0> <== NEVER TAKEN
40001850: f89ff06f j 400017d8 <fcntl+0x1f4>
fd2 = va_arg( ap, int );
40001854: 000e2d03 lw s10,0(t3)
if ( (uint32_t) fd2 >= rtems_libio_number_iops ) {
40001858: 88c1a783 lw a5,-1908(gp) # 40019b2c <rtems_libio_number_iops>
4000185c: 18fd7463 bgeu s10,a5,400019e4 <fcntl+0x400>
return &rtems_libio_iops[ fd ];
40001860: 001d1c13 slli s8,s10,0x1
40001864: 01ac0bb3 add s7,s8,s10
40001868: 004b9b93 slli s7,s7,0x4
4000186c: 01790cb3 add s9,s2,s7
if (iop != iop2)
40001870: 13940c63 beq s0,s9,400019a8 <fcntl+0x3c4>
40001874: 000ca703 lw a4,0(s9)
if ((rtems_libio_iop_flags( iop2 ) & LIBIO_FLAGS_OPEN) != 0) {
40001878: 10077713 andi a4,a4,256
4000187c: 00070e63 beqz a4,40001898 <fcntl+0x2b4> <== NEVER TAKEN
rv = (*iop2->pathinfo.handlers->close_h)( iop2 );
40001880: 020ca783 lw a5,32(s9)
40001884: 000c8513 mv a0,s9
40001888: 0047a783 lw a5,4(a5)
4000188c: 000780e7 jalr a5
40001890: 00050a13 mv s4,a0
if (rv == 0) {
40001894: f20518e3 bnez a0,400017c4 <fcntl+0x1e0> <== NEVER TAKEN
40001898: 00042503 lw a0,0(s0)
oflag = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
4000189c: 644000ef jal ra,40001ee0 <rtems_libio_to_fcntl_flags>
400018a0: 00050a13 mv s4,a0
rtems_libio_iop_flags_set( iop2, rtems_libio_fcntl_flags( oflag ) );
400018a4: 5f0000ef jal ra,40001e94 <rtems_libio_fcntl_flags>
__asm__ volatile (
400018a8: 300477f3 csrrci a5,mstatus,8
*obj = val | arg;
400018ac: 000ca703 lw a4,0(s9)
400018b0: 00a76733 or a4,a4,a0
400018b4: 00eca023 sw a4,0(s9)
return mstatus & RISCV_MSTATUS_MIE;
400018b8: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400018bc: 3007a073 csrs mstatus,a5
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
400018c0: 02442503 lw a0,36(s0)
(*mt_entry->ops->lock_h)( mt_entry );
400018c4: 00c52783 lw a5,12(a0)
400018c8: 0007a783 lw a5,0(a5)
400018cc: 000780e7 jalr a5
rtems_filesystem_location_clone( &iop2->pathinfo, &iop->pathinfo );
400018d0: 01098593 addi a1,s3,16
400018d4: 010b8513 addi a0,s7,16
400018d8: 00b905b3 add a1,s2,a1
400018dc: 00a90533 add a0,s2,a0
400018e0: 284090ef jal ra,4000ab64 <rtems_filesystem_location_clone>
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
400018e4: 02442503 lw a0,36(s0)
(*mt_entry->ops->unlock_h)( mt_entry );
400018e8: 00c52783 lw a5,12(a0)
400018ec: 0047a783 lw a5,4(a5)
400018f0: 000780e7 jalr a5
rv = (*iop2->pathinfo.handlers->open_h)( iop2, NULL, oflag, 0 );
400018f4: 01ac07b3 add a5,s8,s10
400018f8: 00479793 slli a5,a5,0x4
400018fc: 00f907b3 add a5,s2,a5
40001900: 0207a783 lw a5,32(a5)
40001904: 000a0613 mv a2,s4
40001908: 00000693 li a3,0
4000190c: 0007a783 lw a5,0(a5)
40001910: 00000593 li a1,0
40001914: 000c8513 mv a0,s9
40001918: 000780e7 jalr a5
4000191c: 00050a13 mv s4,a0
if ( rv == 0 ) {
40001920: ea0512e3 bnez a0,400017c4 <fcntl+0x1e0> <== NEVER TAKEN
rv = fd2;
40001924: 000d0a13 mv s4,s10
if (ret >= 0) {
40001928: d80a46e3 bltz s4,400016b4 <fcntl+0xd0> <== NEVER TAKEN
4000192c: eadff06f j 400017d8 <fcntl+0x1f4>
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
40001930: 000e2503 lw a0,0(t3)
40001934: 560000ef jal ra,40001e94 <rtems_libio_fcntl_flags>
__asm__ volatile (
40001938: 300477f3 csrrci a5,mstatus,8
*obj = val & arg;
4000193c: 00042703 lw a4,0(s0)
40001940: dfe77713 andi a4,a4,-514
40001944: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40001948: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000194c: 3007a073 csrs mstatus,a5
__asm__ volatile (
40001950: 300477f3 csrrci a5,mstatus,8
*obj = val | arg;
40001954: 00042703 lw a4,0(s0)
rtems_libio_iop_flags_set( iop, flags & mask );
40001958: 20157513 andi a0,a0,513
4000195c: 00a76533 or a0,a4,a0
40001960: 00a42023 sw a0,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40001964: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40001968: 3007a073 csrs mstatus,a5
int ret = 0;
4000196c: 00000a13 li s4,0
40001970: e69ff06f j 400017d8 <fcntl+0x1f4>
__asm__ volatile (
40001974: 300477f3 csrrci a5,mstatus,8
*obj = val & arg;
40001978: 00042703 lw a4,0(s0)
4000197c: fffff6b7 lui a3,0xfffff
40001980: 7ff68693 addi a3,a3,2047 # fffff7ff <RamEnd+0xbefff7ff>
40001984: 00d77733 and a4,a4,a3
40001988: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
4000198c: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40001990: 3007a073 csrs mstatus,a5
if (ret >= 0) {
40001994: e45ff06f j 400017d8 <fcntl+0x1f4>
rtems_libio_free( diop );
40001998: 000b8513 mv a0,s7 <== NOT EXECUTED
4000199c: 5ec000ef jal ra,40001f88 <rtems_libio_free> <== NOT EXECUTED
if (ret >= 0) {
400019a0: d00a4ae3 bltz s4,400016b4 <fcntl+0xd0> <== NOT EXECUTED
400019a4: e35ff06f j 400017d8 <fcntl+0x1f4> <== NOT EXECUTED
int rv = 0;
400019a8: 00000a13 li s4,0 <== NOT EXECUTED
400019ac: e2dff06f j 400017d8 <fcntl+0x1f4> <== NOT EXECUTED
__asm__ volatile (
400019b0: 300477f3 csrrci a5,mstatus,8
*obj = val - arg;
400019b4: 00042703 lw a4,0(s0)
400019b8: 40d706b3 sub a3,a4,a3
400019bc: 00d42023 sw a3,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
400019c0: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400019c4: 3007a073 csrs mstatus,a5
LIBIO_GET_IOP( fd, iop );
400019c8: 0340f0ef jal ra,400109fc <__errno>
400019cc: 00900793 li a5,9
400019d0: 00f52023 sw a5,0(a0)
400019d4: fff00a13 li s4,-1
400019d8: cf9ff06f j 400016d0 <fcntl+0xec>
rv = -1;
400019dc: fff00a13 li s4,-1 <== NOT EXECUTED
400019e0: cd5ff06f j 400016b4 <fcntl+0xd0> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EBADF );
400019e4: 0180f0ef jal ra,400109fc <__errno> <== NOT EXECUTED
400019e8: 00900793 li a5,9 <== NOT EXECUTED
400019ec: 00f52023 sw a5,0(a0) <== NOT EXECUTED
400019f0: fff00a13 li s4,-1 <== NOT EXECUTED
400019f4: cc1ff06f j 400016b4 <fcntl+0xd0> <== NOT EXECUTED
40005b0c <fpathconf>:
{
long return_value;
rtems_libio_t *iop;
const rtems_filesystem_limits_and_options_t *the_limits;
LIBIO_GET_IOP( fd, iop );
40005b0c: 8201a783 lw a5,-2016(gp) # 4000ef88 <rtems_libio_number_iops>
{
40005b10: ff010113 addi sp,sp,-16
40005b14: 00112623 sw ra,12(sp)
40005b18: 00812423 sw s0,8(sp)
LIBIO_GET_IOP( fd, iop );
40005b1c: 10f57e63 bgeu a0,a5,40005c38 <fpathconf+0x12c>
40005b20: 00151413 slli s0,a0,0x1
40005b24: 00a40433 add s0,s0,a0
40005b28: 400107b7 lui a5,0x40010
40005b2c: 5e878793 addi a5,a5,1512 # 400105e8 <rtems_libio_iops>
40005b30: 00441413 slli s0,s0,0x4
40005b34: 00f40433 add s0,s0,a5
__asm__ volatile (
40005b38: 30047773 csrrci a4,mstatus,8
val = *obj;
40005b3c: 00042783 lw a5,0(s0)
*obj = val + arg;
40005b40: 000016b7 lui a3,0x1
40005b44: 00d78633 add a2,a5,a3
40005b48: 00c42023 sw a2,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40005b4c: 00877713 andi a4,a4,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40005b50: 30072073 csrs mstatus,a4
40005b54: 1007f793 andi a5,a5,256
40005b58: 0c078463 beqz a5,40005c20 <fpathconf+0x114> <== NEVER TAKEN
/*
* Now process the information request.
*/
the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options;
40005b5c: 02442703 lw a4,36(s0)
40005b60: 00b00793 li a5,11
40005b64: 02c72703 lw a4,44(a4)
switch ( name ) {
40005b68: 0ab7e263 bltu a5,a1,40005c0c <fpathconf+0x100>
40005b6c: 4000e7b7 lui a5,0x4000e
40005b70: b9878793 addi a5,a5,-1128 # 4000db98 <hex2ascii_data+0x20>
40005b74: 00259593 slli a1,a1,0x2
40005b78: 00f585b3 add a1,a1,a5
40005b7c: 0005a783 lw a5,0(a1)
40005b80: 00078067 jr a5
break;
case _PC_ASYNC_IO:
return_value = the_limits->posix_async_io;
break;
case _PC_PRIO_IO:
return_value = the_limits->posix_prio_io;
40005b84: 02472503 lw a0,36(a4)
__asm__ volatile (
40005b88: 300477f3 csrrci a5,mstatus,8
*obj = val - arg;
40005b8c: 00042703 lw a4,0(s0)
40005b90: fffff6b7 lui a3,0xfffff
40005b94: 00d70733 add a4,a4,a3
40005b98: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40005b9c: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40005ba0: 3007a073 csrs mstatus,a5
break;
}
rtems_libio_iop_drop( iop );
return return_value;
}
40005ba4: 00c12083 lw ra,12(sp)
40005ba8: 00812403 lw s0,8(sp)
40005bac: 01010113 addi sp,sp,16
40005bb0: 00008067 ret
return_value = the_limits->posix_sync_io;
40005bb4: 02872503 lw a0,40(a4)
break;
40005bb8: fd1ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->link_max;
40005bbc: 00072503 lw a0,0(a4)
break;
40005bc0: fc9ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->max_canon;
40005bc4: 00472503 lw a0,4(a4)
break;
40005bc8: fc1ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->max_input;
40005bcc: 00872503 lw a0,8(a4)
break;
40005bd0: fb9ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->name_max;
40005bd4: 00c72503 lw a0,12(a4)
break;
40005bd8: fb1ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->path_max;
40005bdc: 01072503 lw a0,16(a4)
break;
40005be0: fa9ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->pipe_buf;
40005be4: 01472503 lw a0,20(a4)
break;
40005be8: fa1ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->posix_chown_restrictions;
40005bec: 01c72503 lw a0,28(a4)
break;
40005bf0: f99ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->posix_no_trunc;
40005bf4: 02072503 lw a0,32(a4)
break;
40005bf8: f91ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->posix_vdisable;
40005bfc: 02c72503 lw a0,44(a4)
break;
40005c00: f89ff06f j 40005b88 <fpathconf+0x7c>
return_value = the_limits->posix_async_io;
40005c04: 01872503 lw a0,24(a4)
break;
40005c08: f81ff06f j 40005b88 <fpathconf+0x7c>
errno = EINVAL;
40005c0c: 710060ef jal ra,4000c31c <__errno>
40005c10: 01600793 li a5,22
40005c14: 00f52023 sw a5,0(a0)
return_value = -1;
40005c18: fff00513 li a0,-1
break;
40005c1c: f6dff06f j 40005b88 <fpathconf+0x7c>
__asm__ volatile (
40005c20: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
40005c24: 00042703 lw a4,0(s0) <== NOT EXECUTED
40005c28: 40d706b3 sub a3,a4,a3 <== NOT EXECUTED
40005c2c: 00d42023 sw a3,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40005c30: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40005c34: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
LIBIO_GET_IOP( fd, iop );
40005c38: 6e4060ef jal ra,4000c31c <__errno>
40005c3c: 00900793 li a5,9
40005c40: 00f52023 sw a5,0(a0)
40005c44: fff00513 li a0,-1
40005c48: f5dff06f j 40005ba4 <fpathconf+0x98>
40002ab0 <free>:
void free(
void *ptr
)
{
if ( !ptr )
40002ab0: 06050c63 beqz a0,40002b28 <free+0x78> <== NEVER TAKEN
{
40002ab4: ff010113 addi sp,sp,-16
40002ab8: 00812423 sw s0,8(sp)
40002abc: 00112623 sw ra,12(sp)
40002ac0: 00050413 mv s0,a0
return;
/*
* Do not attempt to free memory if in a critical section or ISR.
*/
if ( _Malloc_System_state() != MALLOC_SYSTEM_STATE_NORMAL ) {
40002ac4: 58c000ef jal ra,40003050 <_Malloc_System_state>
40002ac8: 02051263 bnez a0,40002aec <free+0x3c> <== NEVER TAKEN
_Malloc_Deferred_free(ptr);
return;
}
if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) {
40002acc: 91c1a503 lw a0,-1764(gp) # 40020d5c <RTEMS_Malloc_Heap>
40002ad0: 00040593 mv a1,s0
40002ad4: 3a0060ef jal ra,40008e74 <_Protected_heap_Free>
40002ad8: 04050a63 beqz a0,40002b2c <free+0x7c>
rtems_fatal( RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE, (rtems_fatal_code) ptr );
}
}
40002adc: 00c12083 lw ra,12(sp)
40002ae0: 00812403 lw s0,8(sp)
40002ae4: 01010113 addi sp,sp,16
40002ae8: 00008067 ret
__asm__ volatile (
40002aec: 30047773 csrrci a4,mstatus,8
Chain_Node *old_last;
_Assert( _Chain_Is_node_off_chain( the_node ) );
tail = _Chain_Tail( the_chain );
old_last = tail->previous;
40002af0: 400207b7 lui a5,0x40020 <== NOT EXECUTED
40002af4: 71078793 addi a5,a5,1808 # 40020710 <_Malloc_GC_list> <== NOT EXECUTED
40002af8: 0087a683 lw a3,8(a5) <== NOT EXECUTED
the_node->next = tail;
40002afc: 00478613 addi a2,a5,4 <== NOT EXECUTED
40002b00: 00c42023 sw a2,0(s0) <== NOT EXECUTED
tail->previous = the_node;
40002b04: 0087a423 sw s0,8(a5) <== NOT EXECUTED
old_last->next = the_node;
40002b08: 0086a023 sw s0,0(a3) <== NOT EXECUTED
the_node->previous = old_last;
40002b0c: 00d42223 sw a3,4(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002b10: 00877713 andi a4,a4,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002b14: 30072073 csrs mstatus,a4 <== NOT EXECUTED
40002b18: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40002b1c: 00812403 lw s0,8(sp) <== NOT EXECUTED
40002b20: 01010113 addi sp,sp,16 <== NOT EXECUTED
40002b24: 00008067 ret <== NOT EXECUTED
40002b28: 00008067 ret <== NOT EXECUTED
RTEMS_NO_RETURN RTEMS_INLINE_ROUTINE void rtems_fatal(
rtems_fatal_source fatal_source,
rtems_fatal_code error_code
)
{
_Terminate( fatal_source, error_code );
40002b2c: 00040593 mv a1,s0 <== NOT EXECUTED
40002b30: 00c00513 li a0,12 <== NOT EXECUTED
40002b34: 631040ef jal ra,40007964 <_Terminate> <== NOT EXECUTED
40002ba0 <fstat>:
int fstat(
int fd,
struct stat *sbuf
)
{
40002ba0: fe010113 addi sp,sp,-32 <== NOT EXECUTED
40002ba4: 00112e23 sw ra,28(sp) <== NOT EXECUTED
40002ba8: 00812c23 sw s0,24(sp) <== NOT EXECUTED
40002bac: 00912a23 sw s1,20(sp) <== NOT EXECUTED
40002bb0: 01212823 sw s2,16(sp) <== NOT EXECUTED
40002bb4: 01312623 sw s3,12(sp) <== NOT EXECUTED
int rv;
/*
* Check to see if we were passed a valid pointer.
*/
if ( !sbuf )
40002bb8: 0c058c63 beqz a1,40002c90 <fstat+0xf0> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EFAULT );
/*
* Now process the stat() request.
*/
LIBIO_GET_IOP( fd, iop );
40002bbc: 8901a703 lw a4,-1904(gp) # 40020cd0 <rtems_libio_number_iops> <== NOT EXECUTED
40002bc0: 0ae57e63 bgeu a0,a4,40002c7c <fstat+0xdc> <== NOT EXECUTED
40002bc4: 00151413 slli s0,a0,0x1 <== NOT EXECUTED
40002bc8: 00a40433 add s0,s0,a0 <== NOT EXECUTED
40002bcc: 40023937 lui s2,0x40023 <== NOT EXECUTED
40002bd0: 00441413 slli s0,s0,0x4 <== NOT EXECUTED
40002bd4: cd890913 addi s2,s2,-808 # 40022cd8 <rtems_libio_iops> <== NOT EXECUTED
40002bd8: 012404b3 add s1,s0,s2 <== NOT EXECUTED
__asm__ volatile (
40002bdc: 300476f3 csrrci a3,mstatus,8 <== NOT EXECUTED
val = *obj;
40002be0: 0004a703 lw a4,0(s1) <== NOT EXECUTED
*obj = val + arg;
40002be4: 000019b7 lui s3,0x1 <== NOT EXECUTED
40002be8: 01370633 add a2,a4,s3 <== NOT EXECUTED
40002bec: 00c4a023 sw a2,0(s1) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002bf0: 0086f693 andi a3,a3,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002bf4: 3006a073 csrs mstatus,a3 <== NOT EXECUTED
40002bf8: 10077713 andi a4,a4,256 <== NOT EXECUTED
40002bfc: 06070463 beqz a4,40002c64 <fstat+0xc4> <== NOT EXECUTED
/*
* Zero out the stat structure so the various support
* versions of stat don't have to.
*/
memset( sbuf, 0, sizeof(struct stat) );
40002c00: 00058793 mv a5,a1 <== NOT EXECUTED
40002c04: 06800613 li a2,104 <== NOT EXECUTED
40002c08: 00000593 li a1,0 <== NOT EXECUTED
40002c0c: 00078513 mv a0,a5 <== NOT EXECUTED
40002c10: 170120ef jal ra,40014d80 <memset> <== NOT EXECUTED
rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf );
40002c14: 0204a703 lw a4,32(s1) <== NOT EXECUTED
memset( sbuf, 0, sizeof(struct stat) );
40002c18: 00050793 mv a5,a0 <== NOT EXECUTED
rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf );
40002c1c: 00078593 mv a1,a5 <== NOT EXECUTED
40002c20: 01872783 lw a5,24(a4) <== NOT EXECUTED
40002c24: 01040513 addi a0,s0,16 <== NOT EXECUTED
40002c28: 00a90533 add a0,s2,a0 <== NOT EXECUTED
40002c2c: 000780e7 jalr a5 <== NOT EXECUTED
__asm__ volatile (
40002c30: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
*obj = val - arg;
40002c34: 0004a703 lw a4,0(s1) <== NOT EXECUTED
40002c38: 41370733 sub a4,a4,s3 <== NOT EXECUTED
40002c3c: 00e4a023 sw a4,0(s1) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002c40: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002c44: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
rtems_libio_iop_drop( iop );
return rv;
}
40002c48: 01c12083 lw ra,28(sp) <== NOT EXECUTED
40002c4c: 01812403 lw s0,24(sp) <== NOT EXECUTED
40002c50: 01412483 lw s1,20(sp) <== NOT EXECUTED
40002c54: 01012903 lw s2,16(sp) <== NOT EXECUTED
40002c58: 00c12983 lw s3,12(sp) <== NOT EXECUTED
40002c5c: 02010113 addi sp,sp,32 <== NOT EXECUTED
40002c60: 00008067 ret <== NOT EXECUTED
__asm__ volatile (
40002c64: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
40002c68: 0004a703 lw a4,0(s1) <== NOT EXECUTED
40002c6c: 41370733 sub a4,a4,s3 <== NOT EXECUTED
40002c70: 00e4a023 sw a4,0(s1) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002c74: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002c78: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
LIBIO_GET_IOP( fd, iop );
40002c7c: 24d110ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40002c80: 00900793 li a5,9 <== NOT EXECUTED
40002c84: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40002c88: fff00513 li a0,-1 <== NOT EXECUTED
40002c8c: fbdff06f j 40002c48 <fstat+0xa8> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EFAULT );
40002c90: 239110ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40002c94: 00e00793 li a5,14 <== NOT EXECUTED
40002c98: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40002c9c: fff00513 li a0,-1 <== NOT EXECUTED
40002ca0: fa9ff06f j 40002c48 <fstat+0xa8> <== NOT EXECUTED
4000ea7c <ftruncate>:
#include <unistd.h>
#include <rtems/libio_.h>
int ftruncate( int fd, off_t length )
{
4000ea7c: ff010113 addi sp,sp,-16 <== NOT EXECUTED
4000ea80: 00112623 sw ra,12(sp) <== NOT EXECUTED
4000ea84: 00812423 sw s0,8(sp) <== NOT EXECUTED
4000ea88: 00912223 sw s1,4(sp) <== NOT EXECUTED
int rv = 0;
if ( length >= 0 ) {
4000ea8c: 0c064263 bltz a2,4000eb50 <ftruncate+0xd4> <== NOT EXECUTED
rtems_libio_t *iop;
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EINVAL );
4000ea90: 8901a783 lw a5,-1904(gp) # 40020cd0 <rtems_libio_number_iops> <== NOT EXECUTED
4000ea94: 0cf57863 bgeu a0,a5,4000eb64 <ftruncate+0xe8> <== NOT EXECUTED
return &rtems_libio_iops[ fd ];
4000ea98: 00151413 slli s0,a0,0x1 <== NOT EXECUTED
4000ea9c: 00a40433 add s0,s0,a0 <== NOT EXECUTED
4000eaa0: 400237b7 lui a5,0x40023 <== NOT EXECUTED
4000eaa4: cd878793 addi a5,a5,-808 # 40022cd8 <rtems_libio_iops> <== NOT EXECUTED
4000eaa8: 00441413 slli s0,s0,0x4 <== NOT EXECUTED
4000eaac: 00f40433 add s0,s0,a5 <== NOT EXECUTED
__asm__ volatile (
4000eab0: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
val = *obj;
4000eab4: 00042683 lw a3,0(s0) <== NOT EXECUTED
*obj = val + arg;
4000eab8: 000014b7 lui s1,0x1 <== NOT EXECUTED
4000eabc: 00968733 add a4,a3,s1 <== NOT EXECUTED
4000eac0: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
4000eac4: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000eac8: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
4000eacc: 10400793 li a5,260 <== NOT EXECUTED
4000ead0: 1046f713 andi a4,a3,260 <== NOT EXECUTED
4000ead4: 04f71063 bne a4,a5,4000eb14 <ftruncate+0x98> <== NOT EXECUTED
rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length );
4000ead8: 02042783 lw a5,32(s0) <== NOT EXECUTED
4000eadc: 00040513 mv a0,s0 <== NOT EXECUTED
4000eae0: 01c7a783 lw a5,28(a5) <== NOT EXECUTED
4000eae4: 000780e7 jalr a5 <== NOT EXECUTED
__asm__ volatile (
4000eae8: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
*obj = val - arg;
4000eaec: 00042703 lw a4,0(s0) <== NOT EXECUTED
4000eaf0: 40970733 sub a4,a4,s1 <== NOT EXECUTED
4000eaf4: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
4000eaf8: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000eafc: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
errno = EINVAL;
rv = -1;
}
return rv;
}
4000eb00: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4000eb04: 00812403 lw s0,8(sp) <== NOT EXECUTED
4000eb08: 00412483 lw s1,4(sp) <== NOT EXECUTED
4000eb0c: 01010113 addi sp,sp,16 <== NOT EXECUTED
4000eb10: 00008067 ret <== NOT EXECUTED
__asm__ volatile (
4000eb14: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
4000eb18: 00042703 lw a4,0(s0) <== NOT EXECUTED
4000eb1c: 40970733 sub a4,a4,s1 <== NOT EXECUTED
4000eb20: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
4000eb24: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000eb28: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EINVAL );
4000eb2c: 1006f413 andi s0,a3,256 <== NOT EXECUTED
4000eb30: 00143413 seqz s0,s0 <== NOT EXECUTED
4000eb34: 40800433 neg s0,s0 <== NOT EXECUTED
4000eb38: ff347413 andi s0,s0,-13 <== NOT EXECUTED
4000eb3c: 38d050ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4000eb40: 01640413 addi s0,s0,22 <== NOT EXECUTED
4000eb44: 00852023 sw s0,0(a0) <== NOT EXECUTED
4000eb48: fff00513 li a0,-1 <== NOT EXECUTED
4000eb4c: fb5ff06f j 4000eb00 <ftruncate+0x84> <== NOT EXECUTED
errno = EINVAL;
4000eb50: 379050ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4000eb54: 01600793 li a5,22 <== NOT EXECUTED
4000eb58: 00f52023 sw a5,0(a0) <== NOT EXECUTED
rv = -1;
4000eb5c: fff00513 li a0,-1 <== NOT EXECUTED
4000eb60: fa1ff06f j 4000eb00 <ftruncate+0x84> <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EINVAL );
4000eb64: 365050ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4000eb68: 00900793 li a5,9 <== NOT EXECUTED
4000eb6c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000eb70: fff00513 li a0,-1 <== NOT EXECUTED
4000eb74: f8dff06f j 4000eb00 <ftruncate+0x84> <== NOT EXECUTED
40002cb0 <getchark>:
#include <rtems.h>
#include <rtems/bspIo.h>
int getchark(void)
{
if ( BSP_poll_char )
40002cb0: 9041a783 lw a5,-1788(gp) # 40020d44 <BSP_poll_char> <== NOT EXECUTED
40002cb4: 00078463 beqz a5,40002cbc <getchark+0xc> <== NOT EXECUTED
return (*BSP_poll_char)();
40002cb8: 00078067 jr a5 <== NOT EXECUTED
return -1;
}
40002cbc: fff00513 li a0,-1 <== NOT EXECUTED
40002cc0: 00008067 ret <== NOT EXECUTED
40006778 <getgrent>:
}
static grp_context *grp_get_context(void)
{
pthread_once(&grp_once, grp_init);
40006778: 400065b7 lui a1,0x40006
return pthread_getspecific(grp_key);
}
struct group *getgrent(void)
{
4000677c: ff010113 addi sp,sp,-16
pthread_once(&grp_once, grp_init);
40006780: 76858593 addi a1,a1,1896 # 40006768 <grp_init>
40006784: 8b818513 addi a0,gp,-1864 # 400142f8 <grp_once>
{
40006788: 00112623 sw ra,12(sp)
4000678c: 00812423 sw s0,8(sp)
pthread_once(&grp_once, grp_init);
40006790: c15fd0ef jal ra,400043a4 <pthread_once>
return pthread_getspecific(grp_key);
40006794: 8b41a503 lw a0,-1868(gp) # 400142f4 <grp_key>
40006798: 2bc010ef jal ra,40007a54 <pthread_getspecific>
grp_context *ctx = grp_get_context();
if (ctx == NULL)
4000679c: 02050e63 beqz a0,400067d8 <getgrent+0x60>
400067a0: 00050613 mv a2,a0
return NULL;
if (ctx->fp == NULL)
400067a4: 00052503 lw a0,0(a0)
400067a8: 02050863 beqz a0,400067d8 <getgrent+0x60> <== NEVER TAKEN
return NULL;
if (!_libcsupport_scangr(ctx->fp, &ctx->grp, ctx->buf, sizeof(ctx->buf)))
400067ac: 10460413 addi s0,a2,260
400067b0: 10000693 li a3,256
400067b4: 00460613 addi a2,a2,4
400067b8: 00040593 mv a1,s0
400067bc: e1dfa0ef jal ra,400015d8 <_libcsupport_scangr>
400067c0: 00050c63 beqz a0,400067d8 <getgrent+0x60>
return NULL;
return &ctx->grp;
}
400067c4: 00c12083 lw ra,12(sp)
400067c8: 00040513 mv a0,s0
400067cc: 00812403 lw s0,8(sp)
400067d0: 01010113 addi sp,sp,16
400067d4: 00008067 ret
return NULL;
400067d8: 00000413 li s0,0
}
400067dc: 00c12083 lw ra,12(sp)
400067e0: 00040513 mv a0,s0
400067e4: 00812403 lw s0,8(sp)
400067e8: 01010113 addi sp,sp,16
400067ec: 00008067 ret
40000978 <getlogin_r>:
if ( !name )
40000978: 04050e63 beqz a0,400009d4 <getlogin_r+0x5c>
{
4000097c: ff010113 addi sp,sp,-16
40000980: 00812423 sw s0,8(sp)
40000984: 00112623 sw ra,12(sp)
if ( namesize < LOGIN_NAME_MAX )
40000988: 00800793 li a5,8
4000098c: 00050413 mv s0,a0
return ERANGE;
40000990: 02200513 li a0,34
if ( namesize < LOGIN_NAME_MAX )
40000994: 02b7f263 bgeu a5,a1,400009b8 <getlogin_r+0x40>
pw = getpwuid(getuid());
40000998: 0a8000ef jal ra,40000a40 <getuid> <== NOT EXECUTED
4000099c: 05c000ef jal ra,400009f8 <getpwuid> <== NOT EXECUTED
if ( pw )
400009a0: 02050463 beqz a0,400009c8 <getlogin_r+0x50> <== NOT EXECUTED
pname = pw->pw_name;
400009a4: 00052583 lw a1,0(a0) <== NOT EXECUTED
strncpy( name, pname, LOGIN_NAME_MAX );
400009a8: 00900613 li a2,9 <== NOT EXECUTED
400009ac: 00040513 mv a0,s0 <== NOT EXECUTED
400009b0: 260100ef jal ra,40010c10 <strncpy> <== NOT EXECUTED
400009b4: 00000513 li a0,0 <== NOT EXECUTED
return 0;
}
400009b8: 00c12083 lw ra,12(sp)
400009bc: 00812403 lw s0,8(sp)
400009c0: 01010113 addi sp,sp,16
400009c4: 00008067 ret
pname = "";
400009c8: 400115b7 lui a1,0x40011 <== NOT EXECUTED
400009cc: 74058593 addi a1,a1,1856 # 40011740 <bsp_section_rodata_begin+0x60><== NOT EXECUTED
400009d0: fd9ff06f j 400009a8 <getlogin_r+0x30> <== NOT EXECUTED
return EFAULT;
400009d4: 00e00513 li a0,14
}
400009d8: 00008067 ret
400034dc <gettimeofday>:
*/
int gettimeofday(
struct timeval *__restrict tp,
void *__restrict __tz RTEMS_UNUSED
)
{
400034dc: ff010113 addi sp,sp,-16 <== NOT EXECUTED
400034e0: 00112623 sw ra,12(sp) <== NOT EXECUTED
/* struct timezone* tzp = (struct timezone*) __tz; */
if ( !tp )
400034e4: 00050c63 beqz a0,400034fc <gettimeofday+0x20> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
struct timeval *time
)
{
_Timecounter_Microtime( time );
400034e8: 3c8050ef jal ra,400088b0 <_Timecounter_Microtime> <== NOT EXECUTED
* Timezone information ignored by the OS proper. Per email
* with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X
* do it. This puts us in good company.
*/
return 0;
400034ec: 00000513 li a0,0 <== NOT EXECUTED
}
400034f0: 00c12083 lw ra,12(sp) <== NOT EXECUTED
400034f4: 01010113 addi sp,sp,16 <== NOT EXECUTED
400034f8: 00008067 ret <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EFAULT );
400034fc: 1650f0ef jal ra,40012e60 <__errno> <== NOT EXECUTED
40003500: 00e00793 li a5,14 <== NOT EXECUTED
40003504: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40003508: fff00513 li a0,-1 <== NOT EXECUTED
4000350c: fe5ff06f j 400034f0 <gettimeofday+0x14> <== NOT EXECUTED
40002f30 <lseek>:
off_t lseek( int fd, off_t offset, int whence )
{
rtems_libio_t *iop;
off_t rv;
LIBIO_GET_IOP( fd, iop );
40002f30: 8901a783 lw a5,-1904(gp) # 40020cd0 <rtems_libio_number_iops> <== NOT EXECUTED
{
40002f34: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40002f38: 00112623 sw ra,12(sp) <== NOT EXECUTED
40002f3c: 00812423 sw s0,8(sp) <== NOT EXECUTED
40002f40: 00912223 sw s1,4(sp) <== NOT EXECUTED
LIBIO_GET_IOP( fd, iop );
40002f44: 08f57a63 bgeu a0,a5,40002fd8 <lseek+0xa8> <== NOT EXECUTED
40002f48: 00151413 slli s0,a0,0x1 <== NOT EXECUTED
40002f4c: 00a40433 add s0,s0,a0 <== NOT EXECUTED
40002f50: 400237b7 lui a5,0x40023 <== NOT EXECUTED
40002f54: cd878793 addi a5,a5,-808 # 40022cd8 <rtems_libio_iops> <== NOT EXECUTED
40002f58: 00441413 slli s0,s0,0x4 <== NOT EXECUTED
40002f5c: 00f40433 add s0,s0,a5 <== NOT EXECUTED
__asm__ volatile (
40002f60: 30047773 csrrci a4,mstatus,8 <== NOT EXECUTED
val = *obj;
40002f64: 00042783 lw a5,0(s0) <== NOT EXECUTED
*obj = val + arg;
40002f68: 000014b7 lui s1,0x1 <== NOT EXECUTED
40002f6c: 00978533 add a0,a5,s1 <== NOT EXECUTED
40002f70: 00a42023 sw a0,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002f74: 00877713 andi a4,a4,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002f78: 30072073 csrs mstatus,a4 <== NOT EXECUTED
40002f7c: 1007f793 andi a5,a5,256 <== NOT EXECUTED
40002f80: 04078063 beqz a5,40002fc0 <lseek+0x90> <== NOT EXECUTED
rv = (*iop->pathinfo.handlers->lseek_h)( iop, offset, whence );
40002f84: 02042783 lw a5,32(s0) <== NOT EXECUTED
40002f88: 00040513 mv a0,s0 <== NOT EXECUTED
40002f8c: 0147a783 lw a5,20(a5) <== NOT EXECUTED
40002f90: 000780e7 jalr a5 <== NOT EXECUTED
__asm__ volatile (
40002f94: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
*obj = val - arg;
40002f98: 00042703 lw a4,0(s0) <== NOT EXECUTED
40002f9c: 40970733 sub a4,a4,s1 <== NOT EXECUTED
40002fa0: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002fa4: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002fa8: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
rtems_libio_iop_drop( iop );
return rv;
}
40002fac: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40002fb0: 00812403 lw s0,8(sp) <== NOT EXECUTED
40002fb4: 00412483 lw s1,4(sp) <== NOT EXECUTED
40002fb8: 01010113 addi sp,sp,16 <== NOT EXECUTED
40002fbc: 00008067 ret <== NOT EXECUTED
__asm__ volatile (
40002fc0: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
40002fc4: 00042703 lw a4,0(s0) <== NOT EXECUTED
40002fc8: 40970733 sub a4,a4,s1 <== NOT EXECUTED
40002fcc: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40002fd0: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002fd4: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
LIBIO_GET_IOP( fd, iop );
40002fd8: 6f0110ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40002fdc: 00900793 li a5,9 <== NOT EXECUTED
40002fe0: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40002fe4: fff00593 li a1,-1 <== NOT EXECUTED
40002fe8: fff00513 li a0,-1 <== NOT EXECUTED
40002fec: fc1ff06f j 40002fac <lseek+0x7c> <== NOT EXECUTED
40003394 <mount>:
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
40003394: f8010113 addi sp,sp,-128
40003398: 06112e23 sw ra,124(sp)
4000339c: 06812c23 sw s0,120(sp)
400033a0: 06912a23 sw s1,116(sp)
400033a4: 07212823 sw s2,112(sp)
400033a8: 07312623 sw s3,108(sp)
400033ac: 07412423 sw s4,104(sp)
400033b0: 07512223 sw s5,100(sp)
400033b4: 07612023 sw s6,96(sp)
400033b8: 05712e23 sw s7,92(sp)
400033bc: 05812c23 sw s8,88(sp)
400033c0: 05912a23 sw s9,84(sp)
400033c4: 05a12823 sw s10,80(sp)
int rv = 0;
if (
400033c8: 00100793 li a5,1
400033cc: 2cd7ec63 bltu a5,a3,400036a4 <mount+0x310>
400033d0: 00050a13 mv s4,a0
options == RTEMS_FILESYSTEM_READ_ONLY
|| options == RTEMS_FILESYSTEM_READ_WRITE
) {
rtems_filesystem_fsmount_me_t fsmount_me_h =
rtems_filesystem_get_mount_handler( filesystemtype );
400033d4: 00060513 mv a0,a2
400033d8: 00068493 mv s1,a3
400033dc: 00058913 mv s2,a1
400033e0: 00060993 mv s3,a2
400033e4: 00070b93 mv s7,a4
400033e8: 304000ef jal ra,400036ec <rtems_filesystem_get_mount_handler>
400033ec: 00050a93 mv s5,a0
if ( fsmount_me_h != NULL ) {
400033f0: 2a050a63 beqz a0,400036a4 <mount+0x310>
const char *target = target_or_null != NULL ? target_or_null : "/";
400033f4: 1e090663 beqz s2,400035e0 <mount+0x24c>
size_t target_size = strlen( target ) + 1;
400033f8: 00090513 mv a0,s2
400033fc: 198120ef jal ra,40015594 <strlen>
40003400: 00150b13 addi s6,a0,1
40003404: 00090c13 mv s8,s2
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
40003408: 00098513 mv a0,s3
4000340c: 188120ef jal ra,40015594 <strlen>
40003410: 00150c93 addi s9,a0,1
size_t source_size = source_or_null != NULL ?
40003414: 06550413 addi s0,a0,101
strlen( source_or_null ) + 1 : 0;
40003418: 180a0863 beqz s4,400035a8 <mount+0x214>
4000341c: 000a0513 mv a0,s4
40003420: 174120ef jal ra,40015594 <strlen>
40003424: 00150d13 addi s10,a0,1
size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
40003428: 016405b3 add a1,s0,s6
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
4000342c: 01a585b3 add a1,a1,s10
40003430: 00100513 li a0,1
40003434: c50ff0ef jal ra,40002884 <calloc>
40003438: 00050413 mv s0,a0
if ( mt_entry != NULL ) {
4000343c: 1e050463 beqz a0,40003624 <mount+0x290> <== NEVER TAKEN
char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
40003440: 06450793 addi a5,a0,100
memcpy( str, filesystemtype, filesystemtype_size );
40003444: 000c8613 mv a2,s9
40003448: 00098593 mv a1,s3
4000344c: 00078513 mv a0,a5
40003450: 009110ef jal ra,40014c58 <memcpy>
str += filesystemtype_size;
40003454: 01950cb3 add s9,a0,s9
mt_entry->type = str;
40003458: 02a42a23 sw a0,52(s0)
memcpy( str, source_or_null, source_size );
4000345c: 000d0613 mv a2,s10
40003460: 000a0593 mv a1,s4
40003464: 000c8513 mv a0,s9
40003468: 7f0110ef jal ra,40014c58 <memcpy>
rtems_filesystem_global_location_t *mt_fs_root =
4000346c: 04040993 addi s3,s0,64
mt_entry->dev = str;
40003470: 03942c23 sw s9,56(s0)
str += source_size;
40003474: 01ac8d33 add s10,s9,s10
memcpy( str, target, target_size );
40003478: 000b0613 mv a2,s6
4000347c: 000c0593 mv a1,s8
40003480: 000d0513 mv a0,s10
40003484: 7d4110ef jal ra,40014c58 <memcpy>
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
40003488: 4001f7b7 lui a5,0x4001f
mt_entry->mounted = true;
4000348c: 00100713 li a4,1
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
40003490: 9f878793 addi a5,a5,-1544 # 4001e9f8 <rtems_filesystem_default_pathconf>
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
_Chain_Initialize(
40003494: 02400693 li a3,36
40003498: 00100613 li a2,1
4000349c: 00098593 mv a1,s3
400034a0: 01440513 addi a0,s0,20
mt_entry->mounted = true;
400034a4: 02e40423 sb a4,40(s0)
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
400034a8: 02f42623 sw a5,44(s0)
mt_fs_root->reference_count = 1;
400034ac: 04e42c23 sw a4,88(s0)
mt_entry->target = str;
400034b0: 03a42823 sw s10,48(s0)
mt_entry->mt_fs_root = mt_fs_root;
400034b4: 03342223 sw s3,36(s0)
mt_fs_root->location.mt_entry = mt_entry;
400034b8: 04842a23 sw s0,84(s0)
400034bc: 525030ef jal ra,400071e0 <_Chain_Initialize>
filesystemtype,
&target_length
);
if ( mt_entry != NULL ) {
mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE;
400034c0: 0014f493 andi s1,s1,1
400034c4: 029404a3 sb s1,41(s0)
rv = (*fsmount_me_h)( mt_entry, data );
400034c8: 000b8593 mv a1,s7
400034cc: 00040513 mv a0,s0
400034d0: 000a80e7 jalr s5
400034d4: 00050493 mv s1,a0
if ( rv == 0 ) {
400034d8: 08051663 bnez a0,40003564 <mount+0x1d0>
if ( target != NULL ) {
400034dc: 14090e63 beqz s2,40003638 <mount+0x2a4>
rtems_filesystem_eval_path_start( &ctx, target, eval_flags );
400034e0: 00090593 mv a1,s2
400034e4: 01f00613 li a2,31
400034e8: 01810513 addi a0,sp,24
400034ec: 5ad000ef jal ra,40004298 <rtems_filesystem_eval_path_start>
static inline bool rtems_filesystem_location_is_instance_root(
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
400034f0: 01452783 lw a5,20(a0)
return (*mt_entry->ops->are_nodes_equal_h)(
400034f4: 00c7a703 lw a4,12(a5)
400034f8: 0247a583 lw a1,36(a5)
400034fc: 01072783 lw a5,16(a4) # 4010 <bsp_section_bss_size+0x1358>
40003500: 000780e7 jalr a5
if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
40003504: 1a051a63 bnez a0,400036b8 <mount+0x324>
static inline void rtems_filesystem_eval_path_extract_currentloc(
rtems_filesystem_eval_path_context_t *ctx,
rtems_filesystem_location_info_t *get
)
{
rtems_filesystem_location_copy_and_detach(
40003508: 03010593 addi a1,sp,48
4000350c: 00010513 mv a0,sp
40003510: 630010ef jal ra,40004b40 <rtems_filesystem_location_copy_and_detach>
mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
40003514: 00010513 mv a0,sp
40003518: 6e8010ef jal ra,40004c00 <rtems_filesystem_location_transform_to_global>
rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
4000351c: 01452783 lw a5,20(a0)
mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
40003520: 00050913 mv s2,a0
mt_entry->mt_point_node = mt_point_node;
40003524: 02a42023 sw a0,32(s0)
rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
40003528: 00c7a783 lw a5,12(a5)
4000352c: 00040513 mv a0,s0
40003530: 02c7a783 lw a5,44(a5)
40003534: 000780e7 jalr a5
40003538: 00050493 mv s1,a0
if ( rv == 0 ) {
4000353c: 0a050a63 beqz a0,400035f0 <mount+0x25c>
rtems_filesystem_global_location_release( mt_point_node, true );
40003540: 00090513 mv a0,s2
40003544: 00100593 li a1,1
40003548: 544010ef jal ra,40004a8c <rtems_filesystem_global_location_release>
rtems_filesystem_eval_path_cleanup( &ctx );
4000354c: 01810513 addi a0,sp,24
40003550: 769000ef jal ra,400044b8 <rtems_filesystem_eval_path_cleanup>
} else {
rv = register_root_file_system( mt_entry );
}
if ( rv != 0 ) {
(*mt_entry->ops->fsunmount_me_h)( mt_entry );
40003554: 00c42783 lw a5,12(s0)
40003558: 00040513 mv a0,s0
4000355c: 0347a783 lw a5,52(a5)
40003560: 000780e7 jalr a5
}
}
if ( rv != 0 ) {
free( mt_entry );
40003564: 00040513 mv a0,s0
40003568: d48ff0ef jal ra,40002ab0 <free>
errno = EINVAL;
rv = -1;
}
return rv;
}
4000356c: 07c12083 lw ra,124(sp)
40003570: 07812403 lw s0,120(sp)
40003574: 07012903 lw s2,112(sp)
40003578: 06c12983 lw s3,108(sp)
4000357c: 06812a03 lw s4,104(sp)
40003580: 06412a83 lw s5,100(sp)
40003584: 06012b03 lw s6,96(sp)
40003588: 05c12b83 lw s7,92(sp)
4000358c: 05812c03 lw s8,88(sp)
40003590: 05412c83 lw s9,84(sp)
40003594: 05012d03 lw s10,80(sp)
40003598: 00048513 mv a0,s1
4000359c: 07412483 lw s1,116(sp)
400035a0: 08010113 addi sp,sp,128
400035a4: 00008067 ret
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
400035a8: 016405b3 add a1,s0,s6
400035ac: 00100513 li a0,1
400035b0: ad4ff0ef jal ra,40002884 <calloc>
400035b4: 00050413 mv s0,a0
if ( mt_entry != NULL ) {
400035b8: 06050663 beqz a0,40003624 <mount+0x290> <== NEVER TAKEN
char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
400035bc: 06440d13 addi s10,s0,100
memcpy( str, filesystemtype, filesystemtype_size );
400035c0: 00098593 mv a1,s3
400035c4: 000d0513 mv a0,s10
400035c8: 000c8613 mv a2,s9
400035cc: 68c110ef jal ra,40014c58 <memcpy>
rtems_filesystem_global_location_t *mt_fs_root =
400035d0: 04040993 addi s3,s0,64
mt_entry->type = str;
400035d4: 03a42a23 sw s10,52(s0)
str += filesystemtype_size;
400035d8: 019d0d33 add s10,s10,s9
if ( source_or_null != NULL ) {
400035dc: e9dff06f j 40003478 <mount+0xe4>
const char *target = target_or_null != NULL ? target_or_null : "/";
400035e0: 4001ec37 lui s8,0x4001e
400035e4: 00200b13 li s6,2
400035e8: 26cc0c13 addi s8,s8,620 # 4001e26c <bsp_section_rodata_begin+0x144>
400035ec: e1dff06f j 40003408 <mount+0x74>
rtems_libio_lock();
400035f0: 929ff0ef jal ra,40002f18 <rtems_libio_lock>
old_last = tail->previous;
400035f4: 400207b7 lui a5,0x40020
400035f8: 73878793 addi a5,a5,1848 # 40020738 <rtems_filesystem_mount_table>
400035fc: 0087a703 lw a4,8(a5)
the_node->next = tail;
40003600: 00478693 addi a3,a5,4
40003604: 00d42023 sw a3,0(s0)
tail->previous = the_node;
40003608: 0087a423 sw s0,8(a5)
old_last->next = the_node;
4000360c: 00872023 sw s0,0(a4)
the_node->previous = old_last;
40003610: 00e42223 sw a4,4(s0)
rtems_libio_unlock();
40003614: 911ff0ef jal ra,40002f24 <rtems_libio_unlock>
rtems_filesystem_eval_path_cleanup( &ctx );
40003618: 01810513 addi a0,sp,24
4000361c: 69d000ef jal ra,400044b8 <rtems_filesystem_eval_path_cleanup>
if ( rv != 0 ) {
40003620: f4dff06f j 4000356c <mount+0x1d8>
errno = ENOMEM;
40003624: 0a4110ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40003628: 00c00793 li a5,12 <== NOT EXECUTED
4000362c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
rv = -1;
40003630: fff00493 li s1,-1 <== NOT EXECUTED
40003634: f39ff06f j 4000356c <mount+0x1d8> <== NOT EXECUTED
rtems_libio_lock();
40003638: 8e1ff0ef jal ra,40002f18 <rtems_libio_lock>
return _Chain_Immutable_head( the_chain )->next;
4000363c: 400207b7 lui a5,0x40020
40003640: 73878793 addi a5,a5,1848 # 40020738 <rtems_filesystem_mount_table>
if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) {
40003644: 0007a703 lw a4,0(a5)
40003648: 00478693 addi a3,a5,4
4000364c: 08d71463 bne a4,a3,400036d4 <mount+0x340>
old_last = tail->previous;
40003650: 0087a683 lw a3,8(a5)
the_node->next = tail;
40003654: 00e42023 sw a4,0(s0)
tail->previous = the_node;
40003658: 0087a423 sw s0,8(a5)
old_last->next = the_node;
4000365c: 0086a023 sw s0,0(a3)
the_node->previous = old_last;
40003660: 00d42223 sw a3,4(s0)
rtems_libio_unlock();
40003664: 8c1ff0ef jal ra,40002f24 <rtems_libio_unlock>
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
40003668: 02440413 addi s0,s0,36
4000366c: 00040513 mv a0,s0
40003670: 358010ef jal ra,400049c8 <rtems_filesystem_global_location_obtain>
40003674: 00050913 mv s2,a0
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
40003678: 00040513 mv a0,s0
4000367c: 34c010ef jal ra,400049c8 <rtems_filesystem_global_location_obtain>
40003680: 00050413 mv s0,a0
&rtems_filesystem_root,
40003684: 750010ef jal ra,40004dd4 <rtems_current_user_env_get>
rtems_filesystem_global_location_assign(
40003688: 00090593 mv a1,s2
4000368c: 00450513 addi a0,a0,4
40003690: 1a8010ef jal ra,40004838 <rtems_filesystem_global_location_assign>
&rtems_filesystem_current,
40003694: 740010ef jal ra,40004dd4 <rtems_current_user_env_get>
rtems_filesystem_global_location_assign(
40003698: 00040593 mv a1,s0
4000369c: 19c010ef jal ra,40004838 <rtems_filesystem_global_location_assign>
if ( rv != 0 ) {
400036a0: ecdff06f j 4000356c <mount+0x1d8>
errno = EINVAL;
400036a4: 024110ef jal ra,400146c8 <__errno>
400036a8: 01600793 li a5,22
400036ac: 00f52023 sw a5,0(a0)
rv = -1;
400036b0: fff00493 li s1,-1
return rv;
400036b4: eb9ff06f j 4000356c <mount+0x1d8>
rtems_filesystem_eval_path_error( &ctx, EBUSY );
400036b8: 01000593 li a1,16
400036bc: 01810513 addi a0,sp,24
400036c0: 581000ef jal ra,40004440 <rtems_filesystem_eval_path_error>
rtems_filesystem_eval_path_cleanup( &ctx );
400036c4: 01810513 addi a0,sp,24
400036c8: 5f1000ef jal ra,400044b8 <rtems_filesystem_eval_path_cleanup>
rv = -1;
400036cc: fff00493 li s1,-1
400036d0: e85ff06f j 40003554 <mount+0x1c0>
errno = EINVAL;
400036d4: 7f5100ef jal ra,400146c8 <__errno> <== NOT EXECUTED
400036d8: 01600793 li a5,22 <== NOT EXECUTED
400036dc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
400036e0: 845ff0ef jal ra,40002f24 <rtems_libio_unlock> <== NOT EXECUTED
rv = -1;
400036e4: fff00493 li s1,-1 <== NOT EXECUTED
400036e8: e6dff06f j 40003554 <mount+0x1c0> <== NOT EXECUTED
40003198 <mount_and_make_target_path>:
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
40003198: fe010113 addi sp,sp,-32
4000319c: 00112e23 sw ra,28(sp)
400031a0: 00812c23 sw s0,24(sp)
400031a4: 00912a23 sw s1,20(sp)
400031a8: 01212823 sw s2,16(sp)
400031ac: 01312623 sw s3,12(sp)
400031b0: 01412423 sw s4,8(sp)
int rv = -1;
if (target != NULL) {
400031b4: 06058e63 beqz a1,40003230 <mount_and_make_target_path+0x98>
400031b8: 00058413 mv s0,a1
400031bc: 00050493 mv s1,a0
rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
400031c0: 1ff00593 li a1,511
400031c4: 00040513 mv a0,s0
400031c8: 00060913 mv s2,a2
400031cc: 00068993 mv s3,a3
400031d0: 00070a13 mv s4,a4
400031d4: 331000ef jal ra,40003d04 <rtems_mkdir>
if (rv == 0) {
400031d8: 02050263 beqz a0,400031fc <mount_and_make_target_path+0x64> <== ALWAYS TAKEN
} else {
errno = EINVAL;
}
return rv;
}
400031dc: 01c12083 lw ra,28(sp)
400031e0: 01812403 lw s0,24(sp)
400031e4: 01412483 lw s1,20(sp)
400031e8: 01012903 lw s2,16(sp)
400031ec: 00c12983 lw s3,12(sp)
400031f0: 00812a03 lw s4,8(sp)
400031f4: 02010113 addi sp,sp,32
400031f8: 00008067 ret
rv = mount(
400031fc: 00040593 mv a1,s0
}
40003200: 01812403 lw s0,24(sp)
40003204: 01c12083 lw ra,28(sp)
rv = mount(
40003208: 000a0713 mv a4,s4
4000320c: 00098693 mv a3,s3
}
40003210: 00812a03 lw s4,8(sp)
40003214: 00c12983 lw s3,12(sp)
rv = mount(
40003218: 00090613 mv a2,s2
4000321c: 00048513 mv a0,s1
}
40003220: 01012903 lw s2,16(sp)
40003224: 01412483 lw s1,20(sp)
40003228: 02010113 addi sp,sp,32
rv = mount(
4000322c: b4dff06f j 40002d78 <mount>
errno = EINVAL;
40003230: 60c1a0ef jal ra,4001d83c <__errno>
40003234: 01600793 li a5,22
40003238: 00f52023 sw a5,0(a0)
int rv = -1;
4000323c: fff00513 li a0,-1
return rv;
40003240: f9dff06f j 400031dc <mount_and_make_target_path+0x44>
40003854 <open>:
/**
* POSIX 1003.1 5.3.1 - Open a File
*/
int open( const char *path, int oflag, ... )
{
40003854: f1010113 addi sp,sp,-240
40003858: 0ef12223 sw a5,228(sp)
mode_t mode = 0;
rtems_libio_t *iop = NULL;
va_start( ap, oflag );
mode = va_arg( ap, mode_t );
4000385c: 0dc10793 addi a5,sp,220
{
40003860: 0c812423 sw s0,200(sp)
40003864: 0b312e23 sw s3,188(sp)
40003868: 0b412c23 sw s4,184(sp)
4000386c: 0c112623 sw ra,204(sp)
40003870: 0c912223 sw s1,196(sp)
40003874: 0d212023 sw s2,192(sp)
40003878: 0b512a23 sw s5,180(sp)
4000387c: 0b612823 sw s6,176(sp)
40003880: 00050993 mv s3,a0
40003884: 00058413 mv s0,a1
40003888: 0cc12c23 sw a2,216(sp)
4000388c: 0cd12e23 sw a3,220(sp)
40003890: 0ee12023 sw a4,224(sp)
40003894: 0f012423 sw a6,232(sp)
40003898: 0f112623 sw a7,236(sp)
mode = va_arg( ap, mode_t );
4000389c: 00f12623 sw a5,12(sp)
400038a0: 00060a13 mv s4,a2
iop = rtems_libio_allocate();
400038a4: d4cff0ef jal ra,40002df0 <rtems_libio_allocate>
if ( iop != NULL ) {
400038a8: 22050a63 beqz a0,40003adc <open+0x288>
int follow = (oflag & O_NOFOLLOW) == O_NOFOLLOW ? 0 : RTEMS_FS_FOLLOW_LINK;
400038ac: 00b41613 slli a2,s0,0xb
int rwflag = oflag + 1;
400038b0: 00140913 addi s2,s0,1
int follow = (oflag & O_NOFOLLOW) == O_NOFOLLOW ? 0 : RTEMS_FS_FOLLOW_LINK;
400038b4: 41f65613 srai a2,a2,0x1f
bool exclusive = (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL);
400038b8: 000017b7 lui a5,0x1
int follow = (oflag & O_NOFOLLOW) == O_NOFOLLOW ? 0 : RTEMS_FS_FOLLOW_LINK;
400038bc: fe867613 andi a2,a2,-24
bool read_access = (rwflag & _FREAD) == _FREAD;
400038c0: 00197693 andi a3,s2,1
bool exclusive = (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL);
400038c4: a0078793 addi a5,a5,-1536 # a00 <bsp_section_data_size+0x2e0>
400038c8: 00050493 mv s1,a0
bool write_access = (rwflag & _FWRITE) == _FWRITE;
400038cc: 00297913 andi s2,s2,2
bool make = (oflag & O_CREAT) == O_CREAT;
400038d0: 20047713 andi a4,s0,512
bool exclusive = (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL);
400038d4: 00f477b3 and a5,s0,a5
int follow = (oflag & O_NOFOLLOW) == O_NOFOLLOW ? 0 : RTEMS_FS_FOLLOW_LINK;
400038d8: 01860613 addi a2,a2,24
| (read_access ? RTEMS_FS_PERMS_READ : 0)
400038dc: 00068463 beqz a3,400038e4 <open+0x90>
400038e0: 00466613 ori a2,a2,4
| (write_access ? RTEMS_FS_PERMS_WRITE : 0)
400038e4: 00090463 beqz s2,400038ec <open+0x98>
400038e8: 00266613 ori a2,a2,2
| (make ? RTEMS_FS_MAKE : 0)
400038ec: 16071863 bnez a4,40003a5c <open+0x208>
| (exclusive ? RTEMS_FS_EXCLUSIVE : 0);
400038f0: 00001737 lui a4,0x1
400038f4: a0070713 addi a4,a4,-1536 # a00 <bsp_section_data_size+0x2e0>
400038f8: 00e79463 bne a5,a4,40003900 <open+0xac>
int eval_flags = follow
400038fc: 04066613 ori a2,a2,64
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
40003900: 00098593 mv a1,s3
40003904: 01010513 addi a0,sp,16
40003908: 191000ef jal ra,40004298 <rtems_filesystem_eval_path_start>
return ctx->tokenlen > 0;
4000390c: 01c12a83 lw s5,28(sp)
if ( rtems_filesystem_eval_path_has_token( &ctx ) ) {
40003910: 140a9a63 bnez s5,40003a64 <open+0x210>
open_dir = ( oflag & O_DIRECTORY ) == O_DIRECTORY;
40003914: 00200ab7 lui s5,0x200
40003918: 01547ab3 and s5,s0,s5
if ( write_access || open_dir ) {
4000391c: 015967b3 or a5,s2,s5
40003920: 04078263 beqz a5,40003964 <open+0x110>
)
{
struct stat st;
st.st_mode = 0;
(void) ( *loc->handlers->fstat_h )( loc, &st );
40003924: 03812783 lw a5,56(sp)
st.st_mode = 0;
40003928: 04012c23 sw zero,88(sp)
(void) ( *loc->handlers->fstat_h )( loc, &st );
4000392c: 04810593 addi a1,sp,72
40003930: 0187a783 lw a5,24(a5)
40003934: 02810513 addi a0,sp,40
40003938: 000780e7 jalr a5
return st.st_mode;
4000393c: 05812783 lw a5,88(sp)
if ( write_access && S_ISDIR( type ) ) {
40003940: 16090263 beqz s2,40003aa4 <open+0x250>
40003944: 0000f737 lui a4,0xf
40003948: 00e7f7b3 and a5,a5,a4
4000394c: 00004737 lui a4,0x4
40003950: 16e78e63 beq a5,a4,40003acc <open+0x278>
if ( open_dir && !S_ISDIR( type ) ) {
40003954: 000a8863 beqz s5,40003964 <open+0x110> <== ALWAYS TAKEN
rtems_filesystem_eval_path_error( &ctx, ENOTDIR );
40003958: 01400593 li a1,20
4000395c: 01010513 addi a0,sp,16
40003960: 2e1000ef jal ra,40004440 <rtems_filesystem_eval_path_error>
rtems_filesystem_location_copy_and_detach(
40003964: 02810593 addi a1,sp,40
40003968: 01048513 addi a0,s1,16 # 1010 <_ISR_Stack_size+0x10>
4000396c: 1d4010ef jal ra,40004b40 <rtems_filesystem_location_copy_and_detach>
rtems_filesystem_eval_path_cleanup( &ctx );
40003970: 01010513 addi a0,sp,16
40003974: 345000ef jal ra,400044b8 <rtems_filesystem_eval_path_cleanup>
rtems_libio_iop_flags_set( iop, rtems_libio_fcntl_flags( oflag ) );
40003978: 00040513 mv a0,s0
4000397c: c28ff0ef jal ra,40002da4 <rtems_libio_fcntl_flags>
__asm__ volatile (
40003980: 300477f3 csrrci a5,mstatus,8
*obj = val | arg;
40003984: 0004a703 lw a4,0(s1)
40003988: 00a76533 or a0,a4,a0
4000398c: 00a4a023 sw a0,0(s1)
return mstatus & RISCV_MSTATUS_MIE;
40003990: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40003994: 3007a073 csrs mstatus,a5
rv = (*iop->pathinfo.handlers->open_h)( iop, path, oflag, mode );
40003998: 0204a783 lw a5,32(s1)
4000399c: 000a0693 mv a3,s4
400039a0: 00040613 mv a2,s0
400039a4: 0007a783 lw a5,0(a5)
400039a8: 00098593 mv a1,s3
400039ac: 00048513 mv a0,s1
400039b0: 000780e7 jalr a5
400039b4: 00050913 mv s2,a0
if ( rv == 0 ) {
400039b8: 04051063 bnez a0,400039f8 <open+0x1a4>
int fd = rtems_libio_iop_to_descriptor( iop );
400039bc: 40023937 lui s2,0x40023
400039c0: cd890913 addi s2,s2,-808 # 40022cd8 <rtems_libio_iops>
400039c4: 41248933 sub s2,s1,s2
400039c8: aaaab537 lui a0,0xaaaab
400039cc: aab50513 addi a0,a0,-1365 # aaaaaaab <RamEnd+0x69aaaaab>
400039d0: 40495913 srai s2,s2,0x4
400039d4: 02a90933 mul s2,s2,a0
__asm__ volatile (
400039d8: 300477f3 csrrci a5,mstatus,8
400039dc: 0004a703 lw a4,0(s1)
400039e0: 10076713 ori a4,a4,256
400039e4: 00e4a023 sw a4,0(s1)
return mstatus & RISCV_MSTATUS_MIE;
400039e8: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400039ec: 3007a073 csrs mstatus,a5
bool truncate = (oflag & O_TRUNC) == O_TRUNC;
400039f0: 40047413 andi s0,s0,1024
if ( truncate ) {
400039f4: 02041a63 bnez s0,40003a28 <open+0x1d4>
if ( rv < 0 ) {
400039f8: 04094c63 bltz s2,40003a50 <open+0x1fc>
}
va_end( ap );
return rv;
}
400039fc: 0cc12083 lw ra,204(sp)
40003a00: 0c812403 lw s0,200(sp)
40003a04: 0c412483 lw s1,196(sp)
40003a08: 0bc12983 lw s3,188(sp)
40003a0c: 0b812a03 lw s4,184(sp)
40003a10: 0b412a83 lw s5,180(sp)
40003a14: 0b012b03 lw s6,176(sp)
40003a18: 00090513 mv a0,s2
40003a1c: 0c012903 lw s2,192(sp)
40003a20: 0f010113 addi sp,sp,240
40003a24: 00008067 ret
rv = ftruncate( fd, 0 );
40003a28: 00000593 li a1,0
40003a2c: 00000613 li a2,0
40003a30: 00090513 mv a0,s2
40003a34: 0480b0ef jal ra,4000ea7c <ftruncate>
if ( rv != 0 ) {
40003a38: fc0500e3 beqz a0,400039f8 <open+0x1a4>
(*iop->pathinfo.handlers->close_h)( iop );
40003a3c: 0204a783 lw a5,32(s1)
40003a40: 00048513 mv a0,s1
rv = -1;
40003a44: fff00913 li s2,-1
(*iop->pathinfo.handlers->close_h)( iop );
40003a48: 0047a783 lw a5,4(a5)
40003a4c: 000780e7 jalr a5
rtems_libio_free( iop );
40003a50: 00048513 mv a0,s1
40003a54: bf8ff0ef jal ra,40002e4c <rtems_libio_free>
return rv;
40003a58: fa5ff06f j 400039fc <open+0x1a8>
| (make ? RTEMS_FS_MAKE : 0)
40003a5c: 02066613 ori a2,a2,32
40003a60: e91ff06f j 400038f0 <open+0x9c>
return ctx->token;
40003a64: 01812b03 lw s6,24(sp)
rv = rtems_filesystem_mknod(
40003a68: 000086b7 lui a3,0x8
40003a6c: 00000713 li a4,0
40003a70: 00000793 li a5,0
40003a74: 00da66b3 or a3,s4,a3
40003a78: 000a8613 mv a2,s5
40003a7c: 000b0593 mv a1,s6
40003a80: 02810513 addi a0,sp,40
40003a84: f90ff0ef jal ra,40003214 <rtems_filesystem_mknod>
if ( rv == 0 ) {
40003a88: 02051a63 bnez a0,40003abc <open+0x268>
rtems_filesystem_eval_path_continue( ctx );
40003a8c: 01010513 addi a0,sp,16
ctx->flags = flags;
40003a90: 02012023 sw zero,32(sp)
ctx->path = path;
40003a94: 01612823 sw s6,16(sp)
ctx->pathlen = pathlen;
40003a98: 01512a23 sw s5,20(sp)
40003a9c: 5d0000ef jal ra,4000406c <rtems_filesystem_eval_path_continue>
40003aa0: e75ff06f j 40003914 <open+0xc0>
if ( open_dir && !S_ISDIR( type ) ) {
40003aa4: ec0a80e3 beqz s5,40003964 <open+0x110> <== NEVER TAKEN
40003aa8: 0000f737 lui a4,0xf
40003aac: 00e7f7b3 and a5,a5,a4
40003ab0: 00004737 lui a4,0x4
40003ab4: eae788e3 beq a5,a4,40003964 <open+0x110>
40003ab8: ea1ff06f j 40003958 <open+0x104>
rtems_filesystem_eval_path_error( ctx, 0 );
40003abc: 00000593 li a1,0
40003ac0: 01010513 addi a0,sp,16
40003ac4: 17d000ef jal ra,40004440 <rtems_filesystem_eval_path_error>
40003ac8: e4dff06f j 40003914 <open+0xc0>
rtems_filesystem_eval_path_error( &ctx, EISDIR );
40003acc: 01500593 li a1,21
40003ad0: 01010513 addi a0,sp,16
40003ad4: 16d000ef jal ra,40004440 <rtems_filesystem_eval_path_error>
if ( open_dir && !S_ISDIR( type ) ) {
40003ad8: e8dff06f j 40003964 <open+0x110>
errno = ENFILE;
40003adc: 3ed100ef jal ra,400146c8 <__errno>
40003ae0: 01700793 li a5,23
40003ae4: 00f52023 sw a5,0(a0)
rv = -1;
40003ae8: fff00913 li s2,-1
return rv;
40003aec: f11ff06f j 400039fc <open+0x1a8>
40003684 <posix_memalign>:
void **pointer,
size_t alignment,
size_t size
)
{
if (((alignment - 1) & alignment) != 0 || (alignment < sizeof(void *)))
40003684: fff58713 addi a4,a1,-1
40003688: 00b77733 and a4,a4,a1
4000368c: 00071863 bnez a4,4000369c <posix_memalign+0x18> <== NEVER TAKEN
40003690: 00300713 li a4,3
40003694: 00b77463 bgeu a4,a1,4000369c <posix_memalign+0x18>
/*
* rtems_memalign does all of the error checking work EXCEPT
* for adding restrictionso on the alignment.
*/
return rtems_memalign( pointer, alignment, size );
40003698: 2a00006f j 40003938 <rtems_memalign>
}
4000369c: 01600513 li a0,22
400036a0: 00008067 ret
40003bfc <read.part.0>:
#endif
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500
ssize_t pread (int __fd, void *__buf, size_t __nbytes, off_t __offset);
ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, off_t __offset);
#endif
_READ_WRITE_RETURN_TYPE read (int __fd, void *__buf, size_t __nbyte);
40003bfc: ff010113 addi sp,sp,-16
40003c00: 00812423 sw s0,8(sp)
return &rtems_libio_iops[ fd ];
40003c04: 00151413 slli s0,a0,0x1
40003c08: 00a40433 add s0,s0,a0
40003c0c: 40023537 lui a0,0x40023
40003c10: cd850513 addi a0,a0,-808 # 40022cd8 <rtems_libio_iops>
40003c14: 00441413 slli s0,s0,0x4
40003c18: 00112623 sw ra,12(sp)
40003c1c: 00912223 sw s1,4(sp)
40003c20: 00a40433 add s0,s0,a0
__asm__ volatile (
40003c24: 30047773 csrrci a4,mstatus,8
val = *obj;
40003c28: 00042783 lw a5,0(s0)
*obj = val + arg;
40003c2c: 000014b7 lui s1,0x1
40003c30: 009786b3 add a3,a5,s1
40003c34: 00d42023 sw a3,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40003c38: 00877713 andi a4,a4,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40003c3c: 30072073 csrs mstatus,a4
ssize_t n;
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_READ, EBADF );
40003c40: 10200713 li a4,258
40003c44: 1027f793 andi a5,a5,258
40003c48: 04e79063 bne a5,a4,40003c88 <read.part.0+0x8c>
/*
* Now process the read().
*/
n = (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
40003c4c: 02042783 lw a5,32(s0)
40003c50: 00040513 mv a0,s0
40003c54: 0087a783 lw a5,8(a5)
40003c58: 000780e7 jalr a5
__asm__ volatile (
40003c5c: 300477f3 csrrci a5,mstatus,8
*obj = val - arg;
40003c60: 00042703 lw a4,0(s0)
40003c64: 40970733 sub a4,a4,s1
40003c68: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40003c6c: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40003c70: 3007a073 csrs mstatus,a5
rtems_libio_iop_drop( iop );
return n;
}
40003c74: 00c12083 lw ra,12(sp)
40003c78: 00812403 lw s0,8(sp)
40003c7c: 00412483 lw s1,4(sp)
40003c80: 01010113 addi sp,sp,16
40003c84: 00008067 ret
__asm__ volatile (
40003c88: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
40003c8c: 00042703 lw a4,0(s0) <== NOT EXECUTED
40003c90: 40970733 sub a4,a4,s1 <== NOT EXECUTED
40003c94: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40003c98: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40003c9c: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_READ, EBADF );
40003ca0: 229100ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40003ca4: 00900793 li a5,9 <== NOT EXECUTED
40003ca8: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40003cac: fff00513 li a0,-1 <== NOT EXECUTED
40003cb0: fc5ff06f j 40003c74 <read.part.0+0x78> <== NOT EXECUTED
4001dd4c <realloc>:
return new_ptr;
}
void *realloc( void *ptr, size_t size )
{
4001dd4c: fd010113 addi sp,sp,-48 <== NOT EXECUTED
4001dd50: 02112623 sw ra,44(sp) <== NOT EXECUTED
4001dd54: 02812423 sw s0,40(sp) <== NOT EXECUTED
4001dd58: 02912223 sw s1,36(sp) <== NOT EXECUTED
4001dd5c: 03212023 sw s2,32(sp) <== NOT EXECUTED
4001dd60: 01312e23 sw s3,28(sp) <== NOT EXECUTED
Heap_Control *heap;
Heap_Resize_status status;
uintptr_t old_size;
uintptr_t avail_size;
if ( size == 0 ) {
4001dd64: 12058063 beqz a1,4001de84 <realloc+0x138> <== NOT EXECUTED
4001dd68: 00058493 mv s1,a1 <== NOT EXECUTED
4001dd6c: 00050413 mv s0,a0 <== NOT EXECUTED
free( ptr );
return NULL;
}
if ( ptr == NULL ) {
4001dd70: 0e050a63 beqz a0,4001de64 <realloc+0x118> <== NOT EXECUTED
return malloc( size );
}
heap = RTEMS_Malloc_Heap;
4001dd74: 91c1a903 lw s2,-1764(gp) # 40020d5c <RTEMS_Malloc_Heap> <== NOT EXECUTED
switch ( _Malloc_System_state() ) {
4001dd78: ad8e50ef jal ra,40003050 <_Malloc_System_state> <== NOT EXECUTED
4001dd7c: 0a050e63 beqz a0,4001de38 <realloc+0xec> <== NOT EXECUTED
4001dd80: 00100793 li a5,1 <== NOT EXECUTED
4001dd84: 08f51863 bne a0,a5,4001de14 <realloc+0xc8> <== NOT EXECUTED
_Malloc_Process_deferred_frees();
status = _Heap_Resize_block( heap, ptr, size, &old_size, &avail_size );
_RTEMS_Unlock_allocator();
break;
case MALLOC_SYSTEM_STATE_NO_PROTECTION:
status = _Heap_Resize_block( heap, ptr, size, &old_size, &avail_size );
4001dd88: 00c10713 addi a4,sp,12 <== NOT EXECUTED
4001dd8c: 00810693 addi a3,sp,8 <== NOT EXECUTED
4001dd90: 00048613 mv a2,s1 <== NOT EXECUTED
4001dd94: 00040593 mv a1,s0 <== NOT EXECUTED
4001dd98: 00090513 mv a0,s2 <== NOT EXECUTED
4001dd9c: 1d8000ef jal ra,4001df74 <_Heap_Resize_block> <== NOT EXECUTED
4001dda0: 00050993 mv s3,a0 <== NOT EXECUTED
break;
default:
return NULL;
}
switch ( status ) {
4001dda4: 00040913 mv s2,s0 <== NOT EXECUTED
4001dda8: 06098863 beqz s3,4001de18 <realloc+0xcc> <== NOT EXECUTED
4001ddac: 00100793 li a5,1 <== NOT EXECUTED
4001ddb0: 04f99c63 bne s3,a5,4001de08 <realloc+0xbc> <== NOT EXECUTED
new_ptr = malloc( new_size );
4001ddb4: 00048513 mv a0,s1 <== NOT EXECUTED
case HEAP_RESIZE_SUCCESSFUL:
return ptr;
case HEAP_RESIZE_UNSATISFIED:
return new_alloc( ptr, size, old_size );
4001ddb8: 00812983 lw s3,8(sp) <== NOT EXECUTED
new_ptr = malloc( new_size );
4001ddbc: a48e50ef jal ra,40003004 <malloc> <== NOT EXECUTED
4001ddc0: 00050913 mv s2,a0 <== NOT EXECUTED
if ( new_ptr == NULL ) {
4001ddc4: 04050a63 beqz a0,4001de18 <realloc+0xcc> <== NOT EXECUTED
memcpy( new_ptr, old_ptr, ( new_size < old_size ) ? new_size : old_size );
4001ddc8: 00098613 mv a2,s3 <== NOT EXECUTED
4001ddcc: 0134f463 bgeu s1,s3,4001ddd4 <realloc+0x88> <== NOT EXECUTED
4001ddd0: 00048613 mv a2,s1 <== NOT EXECUTED
4001ddd4: 00040593 mv a1,s0 <== NOT EXECUTED
4001ddd8: 00090513 mv a0,s2 <== NOT EXECUTED
4001dddc: e7df60ef jal ra,40014c58 <memcpy> <== NOT EXECUTED
free( old_ptr );
4001dde0: 00040513 mv a0,s0 <== NOT EXECUTED
4001dde4: ccde40ef jal ra,40002ab0 <free> <== NOT EXECUTED
default:
errno = EINVAL;
return NULL;
}
}
4001dde8: 02c12083 lw ra,44(sp) <== NOT EXECUTED
4001ddec: 02812403 lw s0,40(sp) <== NOT EXECUTED
4001ddf0: 02412483 lw s1,36(sp) <== NOT EXECUTED
4001ddf4: 01c12983 lw s3,28(sp) <== NOT EXECUTED
4001ddf8: 00090513 mv a0,s2 <== NOT EXECUTED
4001ddfc: 02012903 lw s2,32(sp) <== NOT EXECUTED
4001de00: 03010113 addi sp,sp,48 <== NOT EXECUTED
4001de04: 00008067 ret <== NOT EXECUTED
errno = EINVAL;
4001de08: 8c1f60ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4001de0c: 01600793 li a5,22 <== NOT EXECUTED
4001de10: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return NULL;
4001de14: 00000913 li s2,0 <== NOT EXECUTED
}
4001de18: 02c12083 lw ra,44(sp) <== NOT EXECUTED
4001de1c: 02812403 lw s0,40(sp) <== NOT EXECUTED
4001de20: 02412483 lw s1,36(sp) <== NOT EXECUTED
4001de24: 01c12983 lw s3,28(sp) <== NOT EXECUTED
4001de28: 00090513 mv a0,s2 <== NOT EXECUTED
4001de2c: 02012903 lw s2,32(sp) <== NOT EXECUTED
4001de30: 03010113 addi sp,sp,48 <== NOT EXECUTED
4001de34: 00008067 ret <== NOT EXECUTED
_RTEMS_Lock_allocator();
4001de38: afce90ef jal ra,40007134 <_RTEMS_Lock_allocator> <== NOT EXECUTED
_Malloc_Process_deferred_frees();
4001de3c: cfde40ef jal ra,40002b38 <_Malloc_Process_deferred_frees> <== NOT EXECUTED
status = _Heap_Resize_block( heap, ptr, size, &old_size, &avail_size );
4001de40: 00c10713 addi a4,sp,12 <== NOT EXECUTED
4001de44: 00810693 addi a3,sp,8 <== NOT EXECUTED
4001de48: 00048613 mv a2,s1 <== NOT EXECUTED
4001de4c: 00040593 mv a1,s0 <== NOT EXECUTED
4001de50: 00090513 mv a0,s2 <== NOT EXECUTED
4001de54: 120000ef jal ra,4001df74 <_Heap_Resize_block> <== NOT EXECUTED
4001de58: 00050993 mv s3,a0 <== NOT EXECUTED
_RTEMS_Unlock_allocator();
4001de5c: ae4e90ef jal ra,40007140 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
break;
4001de60: f45ff06f j 4001dda4 <realloc+0x58> <== NOT EXECUTED
}
4001de64: 02812403 lw s0,40(sp) <== NOT EXECUTED
4001de68: 02c12083 lw ra,44(sp) <== NOT EXECUTED
4001de6c: 02412483 lw s1,36(sp) <== NOT EXECUTED
4001de70: 02012903 lw s2,32(sp) <== NOT EXECUTED
4001de74: 01c12983 lw s3,28(sp) <== NOT EXECUTED
return malloc( size );
4001de78: 00058513 mv a0,a1 <== NOT EXECUTED
}
4001de7c: 03010113 addi sp,sp,48 <== NOT EXECUTED
return malloc( size );
4001de80: 984e506f j 40003004 <malloc> <== NOT EXECUTED
free( ptr );
4001de84: c2de40ef jal ra,40002ab0 <free> <== NOT EXECUTED
return NULL;
4001de88: 00000913 li s2,0 <== NOT EXECUTED
4001de8c: f8dff06f j 4001de18 <realloc+0xcc> <== NOT EXECUTED
4000e21c <rtems_assoc_32_to_string>:
const rtems_assoc_32_pair *pairs,
size_t pair_count,
const char *separator,
const char *fallback
)
{
4000e21c: fd010113 addi sp,sp,-48
4000e220: 01312e23 sw s3,28(sp)
4000e224: 01412c23 sw s4,24(sp)
4000e228: 01812423 sw s8,8(sp)
4000e22c: 02112623 sw ra,44(sp)
4000e230: 02812423 sw s0,40(sp)
4000e234: 02912223 sw s1,36(sp)
4000e238: 03212023 sw s2,32(sp)
4000e23c: 01512a23 sw s5,20(sp)
4000e240: 01612823 sw s6,16(sp)
4000e244: 01712623 sw s7,12(sp)
4000e248: 00058993 mv s3,a1
4000e24c: 00060a13 mv s4,a2
4000e250: 00080c13 mv s8,a6
size_t len;
size_t i;
len = 0;
for ( i = 0; i < pair_count ; ++i ) {
4000e254: 0a070663 beqz a4,4000e300 <rtems_assoc_32_to_string+0xe4> <== NEVER TAKEN
4000e258: 00070a93 mv s5,a4
4000e25c: 00050b13 mv s6,a0
4000e260: 00078b93 mv s7,a5
4000e264: 00068493 mv s1,a3
4000e268: 00000913 li s2,0
4000e26c: 00000413 li s0,0
const rtems_assoc_32_pair *p;
p = &pairs[ i ];
if ( ( value & p->bits ) != 0 ) {
4000e270: 0004a883 lw a7,0(s1)
for ( i = 0; i < pair_count ; ++i ) {
4000e274: 00190913 addi s2,s2,1
4000e278: 00098513 mv a0,s3
if ( ( value & p->bits ) != 0 ) {
4000e27c: 011b78b3 and a7,s6,a7
4000e280: 04088063 beqz a7,4000e2c0 <rtems_assoc_32_to_string+0xa4>
if ( len > 0 ) {
len += strlcpy( &buffer[ len ], separator, space( buffer_size, len ) );
4000e284: 000b8593 mv a1,s7
if ( len > 0 ) {
4000e288: 02040063 beqz s0,4000e2a8 <rtems_assoc_32_to_string+0x8c>
len += strlcpy( &buffer[ len ], separator, space( buffer_size, len ) );
4000e28c: 00898533 add a0,s3,s0
return 0;
4000e290: 00000613 li a2,0
if ( len < buffer_size ) {
4000e294: 01447463 bgeu s0,s4,4000e29c <rtems_assoc_32_to_string+0x80>
return buffer_size - len;
4000e298: 408a0633 sub a2,s4,s0
len += strlcpy( &buffer[ len ], separator, space( buffer_size, len ) );
4000e29c: 2f80b0ef jal ra,40019594 <strlcpy>
4000e2a0: 00a40433 add s0,s0,a0
}
len += strlcpy( &buffer[ len ], p->name, space( buffer_size, len ) );
4000e2a4: 00898533 add a0,s3,s0
4000e2a8: 0044a583 lw a1,4(s1)
return 0;
4000e2ac: 00000613 li a2,0
if ( len < buffer_size ) {
4000e2b0: 01447463 bgeu s0,s4,4000e2b8 <rtems_assoc_32_to_string+0x9c>
return buffer_size - len;
4000e2b4: 408a0633 sub a2,s4,s0
len += strlcpy( &buffer[ len ], p->name, space( buffer_size, len ) );
4000e2b8: 2dc0b0ef jal ra,40019594 <strlcpy>
4000e2bc: 00a40433 add s0,s0,a0
for ( i = 0; i < pair_count ; ++i ) {
4000e2c0: 00848493 addi s1,s1,8
4000e2c4: fb2a96e3 bne s5,s2,4000e270 <rtems_assoc_32_to_string+0x54>
}
}
if ( len == 0 ) {
4000e2c8: 02040c63 beqz s0,4000e300 <rtems_assoc_32_to_string+0xe4>
len += strlcpy( buffer, fallback, buffer_size );
}
return len;
}
4000e2cc: 02c12083 lw ra,44(sp)
4000e2d0: 00040513 mv a0,s0
4000e2d4: 02812403 lw s0,40(sp)
4000e2d8: 02412483 lw s1,36(sp)
4000e2dc: 02012903 lw s2,32(sp)
4000e2e0: 01c12983 lw s3,28(sp)
4000e2e4: 01812a03 lw s4,24(sp)
4000e2e8: 01412a83 lw s5,20(sp)
4000e2ec: 01012b03 lw s6,16(sp)
4000e2f0: 00c12b83 lw s7,12(sp)
4000e2f4: 00812c03 lw s8,8(sp)
4000e2f8: 03010113 addi sp,sp,48
4000e2fc: 00008067 ret
4000e300: 02812403 lw s0,40(sp)
4000e304: 02c12083 lw ra,44(sp)
4000e308: 02412483 lw s1,36(sp)
4000e30c: 02012903 lw s2,32(sp)
4000e310: 01412a83 lw s5,20(sp)
4000e314: 01012b03 lw s6,16(sp)
4000e318: 00c12b83 lw s7,12(sp)
len += strlcpy( buffer, fallback, buffer_size );
4000e31c: 000a0613 mv a2,s4
4000e320: 000c0593 mv a1,s8
}
4000e324: 01812a03 lw s4,24(sp)
4000e328: 00812c03 lw s8,8(sp)
len += strlcpy( buffer, fallback, buffer_size );
4000e32c: 00098513 mv a0,s3
}
4000e330: 01c12983 lw s3,28(sp)
4000e334: 03010113 addi sp,sp,48
len += strlcpy( buffer, fallback, buffer_size );
4000e338: 25c0b06f j 40019594 <strlcpy>
4000e844 <rtems_assoc_local_by_remote_bitfield>:
uint32_t rtems_assoc_local_by_remote_bitfield(
const rtems_assoc_t *ap,
uint32_t remote_value
)
{
4000e844: fe010113 addi sp,sp,-32
4000e848: 00812c23 sw s0,24(sp)
4000e84c: 00912a23 sw s1,20(sp)
4000e850: 01212823 sw s2,16(sp)
4000e854: 01312623 sw s3,12(sp)
4000e858: 01412423 sw s4,8(sp)
4000e85c: 00112e23 sw ra,28(sp)
4000e860: 00050a13 mv s4,a0
4000e864: 00058913 mv s2,a1
4000e868: 02000493 li s1,32
uint32_t b;
uint32_t local_value = 0;
4000e86c: 00000993 li s3,0
for (b = 1; b; b <<= 1) {
4000e870: 00100413 li s0,1
4000e874: 00c0006f j 4000e880 <rtems_assoc_local_by_remote_bitfield+0x3c>
4000e878: 00141413 slli s0,s0,0x1
4000e87c: 02048463 beqz s1,4000e8a4 <rtems_assoc_local_by_remote_bitfield+0x60>
if (b & remote_value)
4000e880: 008977b3 and a5,s2,s0
for (b = 1; b; b <<= 1) {
4000e884: fff48493 addi s1,s1,-1
if (b & remote_value)
4000e888: fe0788e3 beqz a5,4000e878 <rtems_assoc_local_by_remote_bitfield+0x34>
local_value |= rtems_assoc_local_by_remote(ap, b);
4000e88c: 00040593 mv a1,s0
4000e890: 000a0513 mv a0,s4
4000e894: 034000ef jal ra,4000e8c8 <rtems_assoc_local_by_remote>
4000e898: 00a9e9b3 or s3,s3,a0
for (b = 1; b; b <<= 1) {
4000e89c: 00141413 slli s0,s0,0x1
4000e8a0: fe0490e3 bnez s1,4000e880 <rtems_assoc_local_by_remote_bitfield+0x3c><== ALWAYS TAKEN
}
return local_value;
}
4000e8a4: 01c12083 lw ra,28(sp)
4000e8a8: 01812403 lw s0,24(sp)
4000e8ac: 01412483 lw s1,20(sp)
4000e8b0: 01012903 lw s2,16(sp)
4000e8b4: 00812a03 lw s4,8(sp)
4000e8b8: 00098513 mv a0,s3
4000e8bc: 00c12983 lw s3,12(sp)
4000e8c0: 02010113 addi sp,sp,32
4000e8c4: 00008067 ret
40009de8 <rtems_assoc_ptr_by_local>:
const rtems_assoc_t *rtems_assoc_ptr_by_local(
const rtems_assoc_t *ap,
uint32_t local_value
)
{
40009de8: ff010113 addi sp,sp,-16
40009dec: 00912223 sw s1,4(sp)
40009df0: 00050493 mv s1,a0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
40009df4: 00052503 lw a0,0(a0)
{
40009df8: 00112623 sw ra,12(sp)
40009dfc: 00812423 sw s0,8(sp)
if (rtems_assoc_is_default(ap))
40009e00: 02050e63 beqz a0,40009e3c <rtems_assoc_ptr_by_local+0x54>
40009e04: 00058413 mv s0,a1
40009e08: 400245b7 lui a1,0x40024
40009e0c: 61058593 addi a1,a1,1552 # 40024610 <_Thread_queue_Operations_priority_inherit+0x14>
40009e10: 1040f0ef jal ra,40018f14 <strcmp>
40009e14: 02051e63 bnez a0,40009e50 <rtems_assoc_ptr_by_local+0x68>
default_ap = ap++;
for ( ; ap->name; ap++)
40009e18: 00c4a783 lw a5,12(s1)
default_ap = ap++;
40009e1c: 00c48513 addi a0,s1,12
for ( ; ap->name; ap++)
40009e20: 00079a63 bnez a5,40009e34 <rtems_assoc_ptr_by_local+0x4c> <== ALWAYS TAKEN
40009e24: 0380006f j 40009e5c <rtems_assoc_ptr_by_local+0x74> <== NOT EXECUTED
40009e28: 00c52783 lw a5,12(a0)
40009e2c: 00c50513 addi a0,a0,12
40009e30: 02078663 beqz a5,40009e5c <rtems_assoc_ptr_by_local+0x74>
if (ap->local_value == local_value)
40009e34: 00452783 lw a5,4(a0)
40009e38: fe8798e3 bne a5,s0,40009e28 <rtems_assoc_ptr_by_local+0x40>
return ap;
return default_ap;
}
40009e3c: 00c12083 lw ra,12(sp)
40009e40: 00812403 lw s0,8(sp)
40009e44: 00412483 lw s1,4(sp)
40009e48: 01010113 addi sp,sp,16
40009e4c: 00008067 ret
40009e50: 00048513 mv a0,s1
const rtems_assoc_t *default_ap = 0;
40009e54: 00000493 li s1,0
40009e58: fddff06f j 40009e34 <rtems_assoc_ptr_by_local+0x4c>
}
40009e5c: 00c12083 lw ra,12(sp)
40009e60: 00812403 lw s0,8(sp)
for ( ; ap->name; ap++)
40009e64: 00048513 mv a0,s1
}
40009e68: 00412483 lw s1,4(sp)
40009e6c: 01010113 addi sp,sp,16
40009e70: 00008067 ret
40000eb8 <rtems_assoc_ptr_by_name>:
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
40000eb8: fe010113 addi sp,sp,-32
40000ebc: 00812c23 sw s0,24(sp)
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
40000ec0: 00052403 lw s0,0(a0)
{
40000ec4: 00912a23 sw s1,20(sp)
40000ec8: 00112e23 sw ra,28(sp)
40000ecc: 01212823 sw s2,16(sp)
40000ed0: 01312623 sw s3,12(sp)
const rtems_assoc_t *default_ap = 0;
40000ed4: 00000493 li s1,0
if (rtems_assoc_is_default(ap))
40000ed8: 04040663 beqz s0,40000f24 <rtems_assoc_ptr_by_name+0x6c>
40000edc: 00058913 mv s2,a1
40000ee0: 400105b7 lui a1,0x40010
40000ee4: 00050993 mv s3,a0
40000ee8: c3058593 addi a1,a1,-976 # 4000fc30 <bsp_section_rodata_begin+0x748>
40000eec: 00040513 mv a0,s0
40000ef0: 4d50d0ef jal ra,4000ebc4 <strcmp>
40000ef4: 04051863 bnez a0,40000f44 <rtems_assoc_ptr_by_name+0x8c>
default_ap = ap++;
for ( ; ap->name; ap++)
40000ef8: 00c9a403 lw s0,12(s3)
default_ap = ap++;
40000efc: 00c98493 addi s1,s3,12
for ( ; ap->name; ap++)
40000f00: 00041a63 bnez s0,40000f14 <rtems_assoc_ptr_by_name+0x5c> <== ALWAYS TAKEN
40000f04: 04c0006f j 40000f50 <rtems_assoc_ptr_by_name+0x98> <== NOT EXECUTED
40000f08: 00c4a403 lw s0,12(s1)
40000f0c: 00c48493 addi s1,s1,12
40000f10: 04040063 beqz s0,40000f50 <rtems_assoc_ptr_by_name+0x98>
if (strcmp(ap->name, name) == 0)
40000f14: 00040513 mv a0,s0
40000f18: 00090593 mv a1,s2
40000f1c: 4a90d0ef jal ra,4000ebc4 <strcmp>
40000f20: fe0514e3 bnez a0,40000f08 <rtems_assoc_ptr_by_name+0x50>
return ap;
return default_ap;
}
40000f24: 01c12083 lw ra,28(sp)
40000f28: 01812403 lw s0,24(sp)
40000f2c: 01012903 lw s2,16(sp)
40000f30: 00c12983 lw s3,12(sp)
40000f34: 00048513 mv a0,s1
40000f38: 01412483 lw s1,20(sp)
40000f3c: 02010113 addi sp,sp,32
40000f40: 00008067 ret
40000f44: 00098493 mv s1,s3
const rtems_assoc_t *default_ap = 0;
40000f48: 00000993 li s3,0
40000f4c: fc9ff06f j 40000f14 <rtems_assoc_ptr_by_name+0x5c>
}
40000f50: 01c12083 lw ra,28(sp)
40000f54: 01812403 lw s0,24(sp)
for ( ; ap->name; ap++)
40000f58: 00098493 mv s1,s3
}
40000f5c: 01012903 lw s2,16(sp)
40000f60: 00c12983 lw s3,12(sp)
40000f64: 00048513 mv a0,s1
40000f68: 01412483 lw s1,20(sp)
40000f6c: 02010113 addi sp,sp,32
40000f70: 00008067 ret
4000e8f8 <rtems_assoc_ptr_by_remote>:
const rtems_assoc_t *rtems_assoc_ptr_by_remote(
const rtems_assoc_t *ap,
uint32_t remote_value
)
{
4000e8f8: ff010113 addi sp,sp,-16
4000e8fc: 00912223 sw s1,4(sp)
4000e900: 00050493 mv s1,a0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
4000e904: 00052503 lw a0,0(a0)
{
4000e908: 00112623 sw ra,12(sp)
4000e90c: 00812423 sw s0,8(sp)
if (rtems_assoc_is_default(ap))
4000e910: 02050e63 beqz a0,4000e94c <rtems_assoc_ptr_by_remote+0x54>
4000e914: 00058413 mv s0,a1
4000e918: 4001f5b7 lui a1,0x4001f
4000e91c: 04458593 addi a1,a1,68 # 4001f044 <_Thread_queue_Operations_priority_inherit+0x10c>
4000e920: 1c9060ef jal ra,400152e8 <strcmp>
4000e924: 02051e63 bnez a0,4000e960 <rtems_assoc_ptr_by_remote+0x68>
default_ap = ap++;
for ( ; ap->name; ap++)
4000e928: 00c4a783 lw a5,12(s1)
default_ap = ap++;
4000e92c: 00c48513 addi a0,s1,12
for ( ; ap->name; ap++)
4000e930: 00079a63 bnez a5,4000e944 <rtems_assoc_ptr_by_remote+0x4c> <== ALWAYS TAKEN
4000e934: 0380006f j 4000e96c <rtems_assoc_ptr_by_remote+0x74> <== NOT EXECUTED
4000e938: 00c52783 lw a5,12(a0)
4000e93c: 00c50513 addi a0,a0,12
4000e940: 02078663 beqz a5,4000e96c <rtems_assoc_ptr_by_remote+0x74>
if (ap->remote_value == remote_value)
4000e944: 00852783 lw a5,8(a0)
4000e948: fe8798e3 bne a5,s0,4000e938 <rtems_assoc_ptr_by_remote+0x40>
return ap;
return default_ap;
}
4000e94c: 00c12083 lw ra,12(sp)
4000e950: 00812403 lw s0,8(sp)
4000e954: 00412483 lw s1,4(sp)
4000e958: 01010113 addi sp,sp,16
4000e95c: 00008067 ret
4000e960: 00048513 mv a0,s1
const rtems_assoc_t *default_ap = 0;
4000e964: 00000493 li s1,0
4000e968: fddff06f j 4000e944 <rtems_assoc_ptr_by_remote+0x4c>
}
4000e96c: 00c12083 lw ra,12(sp)
4000e970: 00812403 lw s0,8(sp)
for ( ; ap->name; ap++)
4000e974: 00048513 mv a0,s1
}
4000e978: 00412483 lw s1,4(sp)
4000e97c: 01010113 addi sp,sp,16
4000e980: 00008067 ret
40001000 <rtems_assoc_remote_by_local_bitfield>:
uint32_t rtems_assoc_remote_by_local_bitfield(
const rtems_assoc_t *ap,
uint32_t local_value
)
{
40001000: fe010113 addi sp,sp,-32
40001004: 00812c23 sw s0,24(sp)
40001008: 00912a23 sw s1,20(sp)
4000100c: 01212823 sw s2,16(sp)
40001010: 01312623 sw s3,12(sp)
40001014: 01412423 sw s4,8(sp)
40001018: 00112e23 sw ra,28(sp)
4000101c: 00050a13 mv s4,a0
40001020: 00058913 mv s2,a1
40001024: 02000493 li s1,32
uint32_t b;
uint32_t remote_value = 0;
40001028: 00000993 li s3,0
for (b = 1; b; b <<= 1)
4000102c: 00100413 li s0,1
40001030: 00c0006f j 4000103c <rtems_assoc_remote_by_local_bitfield+0x3c>
40001034: 00141413 slli s0,s0,0x1
40001038: 02048463 beqz s1,40001060 <rtems_assoc_remote_by_local_bitfield+0x60>
if (b & local_value)
4000103c: 008977b3 and a5,s2,s0
for (b = 1; b; b <<= 1)
40001040: fff48493 addi s1,s1,-1
if (b & local_value)
40001044: fe0788e3 beqz a5,40001034 <rtems_assoc_remote_by_local_bitfield+0x34>
remote_value |= rtems_assoc_remote_by_local(ap, b);
40001048: 00040593 mv a1,s0
4000104c: 000a0513 mv a0,s4
40001050: 034000ef jal ra,40001084 <rtems_assoc_remote_by_local>
40001054: 00a9e9b3 or s3,s3,a0
for (b = 1; b; b <<= 1)
40001058: 00141413 slli s0,s0,0x1
4000105c: fe0490e3 bnez s1,4000103c <rtems_assoc_remote_by_local_bitfield+0x3c><== ALWAYS TAKEN
return remote_value;
}
40001060: 01c12083 lw ra,28(sp)
40001064: 01812403 lw s0,24(sp)
40001068: 01412483 lw s1,20(sp)
4000106c: 01012903 lw s2,16(sp)
40001070: 00812a03 lw s4,8(sp)
40001074: 00098513 mv a0,s3
40001078: 00c12983 lw s3,12(sp)
4000107c: 02010113 addi sp,sp,32
40001080: 00008067 ret
4000e984 <rtems_cache_aligned_malloc>:
#include <rtems.h>
#include <rtems/malloc.h>
void *rtems_cache_aligned_malloc( size_t nbytes )
{
4000e984: ff010113 addi sp,sp,-16
4000e988: 00812423 sw s0,8(sp)
4000e98c: 00112623 sw ra,12(sp)
4000e990: 00050413 mv s0,a0
size_t line_size = rtems_cache_get_maximal_line_size();
4000e994: 6d4030ef jal ra,40012068 <rtems_cache_get_maximal_line_size>
4000e998: 00050593 mv a1,a0
if ( line_size > 0 ) {
4000e99c: 00050a63 beqz a0,4000e9b0 <rtems_cache_aligned_malloc+0x2c> <== ALWAYS TAKEN
/* Assume that the cache line size is a power of two */
size_t m = line_size - 1;
nbytes = (nbytes + m) & ~m;
4000e9a0: fff40413 addi s0,s0,-1 <== NOT EXECUTED
4000e9a4: 00a40433 add s0,s0,a0 <== NOT EXECUTED
4000e9a8: 40a00533 neg a0,a0 <== NOT EXECUTED
4000e9ac: 00857433 and s0,a0,s0 <== NOT EXECUTED
}
return rtems_heap_allocate_aligned_with_boundary( nbytes, line_size, 0 );
4000e9b0: 00040513 mv a0,s0
}
4000e9b4: 00812403 lw s0,8(sp)
4000e9b8: 00c12083 lw ra,12(sp)
return rtems_heap_allocate_aligned_with_boundary( nbytes, line_size, 0 );
4000e9bc: 00000613 li a2,0
}
4000e9c0: 01010113 addi sp,sp,16
return rtems_heap_allocate_aligned_with_boundary( nbytes, line_size, 0 );
4000e9c4: ebcf406f j 40003080 <rtems_heap_allocate_aligned_with_boundary>
40001b58 <rtems_cache_coherent_add_area>:
void rtems_cache_coherent_add_area(
void *area_begin,
uintptr_t area_size
)
{
if ( _System_state_Is_up( _System_state_Get()) ) {
40001b58: 8e81a703 lw a4,-1816(gp) # 40012778 <_System_state_Current>
{
40001b5c: fe010113 addi sp,sp,-32
40001b60: 00812c23 sw s0,24(sp)
40001b64: 00112e23 sw ra,28(sp)
40001b68: 00912a23 sw s1,20(sp)
if ( _System_state_Is_up( _System_state_Get()) ) {
40001b6c: 00200793 li a5,2
{
40001b70: 00050413 mv s0,a0
40001b74: 00058613 mv a2,a1
if ( _System_state_Is_up( _System_state_Get()) ) {
40001b78: 02f70663 beq a4,a5,40001ba4 <rtems_cache_coherent_add_area+0x4c>
Heap_Control *heap = cache_coherent_heap;
40001b7c: 8ac18493 addi s1,gp,-1876 # 4001273c <cache_coherent_heap>
40001b80: 0004a503 lw a0,0(s1)
if ( heap == NULL ) {
40001b84: 04050c63 beqz a0,40001bdc <rtems_cache_coherent_add_area+0x84> <== NEVER TAKEN
_Heap_Extend( heap, area_begin, area_size, 0 );
40001b88: 00040593 mv a1,s0
_RTEMS_Unlock_allocator();
} else {
add_area( area_begin, area_size );
}
}
40001b8c: 01812403 lw s0,24(sp)
40001b90: 01c12083 lw ra,28(sp)
40001b94: 01412483 lw s1,20(sp)
_Heap_Extend( heap, area_begin, area_size, 0 );
40001b98: 00000693 li a3,0
}
40001b9c: 02010113 addi sp,sp,32
_Heap_Extend( heap, area_begin, area_size, 0 );
40001ba0: 6950306f j 40005a34 <_Heap_Extend>
Heap_Control *heap = cache_coherent_heap;
40001ba4: 00b12623 sw a1,12(sp)
40001ba8: 8ac18493 addi s1,gp,-1876 # 4001273c <cache_coherent_heap>
_RTEMS_Lock_allocator();
40001bac: 7a4030ef jal ra,40005350 <_RTEMS_Lock_allocator>
Heap_Control *heap = cache_coherent_heap;
40001bb0: 0004a503 lw a0,0(s1)
if ( heap == NULL ) {
40001bb4: 00c12603 lw a2,12(sp)
40001bb8: 04050c63 beqz a0,40001c10 <rtems_cache_coherent_add_area+0xb8>
_Heap_Extend( heap, area_begin, area_size, 0 );
40001bbc: 00000693 li a3,0
40001bc0: 00040593 mv a1,s0
40001bc4: 671030ef jal ra,40005a34 <_Heap_Extend>
}
40001bc8: 01812403 lw s0,24(sp)
40001bcc: 01c12083 lw ra,28(sp)
40001bd0: 01412483 lw s1,20(sp)
40001bd4: 02010113 addi sp,sp,32
_RTEMS_Unlock_allocator();
40001bd8: 7840306f j 4000535c <_RTEMS_Unlock_allocator>
ok = _Heap_Initialize( heap, area_begin, area_size, 0 );
40001bdc: 400157b7 lui a5,0x40015 <== NOT EXECUTED
40001be0: 00040593 mv a1,s0 <== NOT EXECUTED
40001be4: 00000693 li a3,0 <== NOT EXECUTED
40001be8: 2c078513 addi a0,a5,704 # 400152c0 <cache_coherent_heap_instance><== NOT EXECUTED
40001bec: 2c078413 addi s0,a5,704 <== NOT EXECUTED
40001bf0: 369030ef jal ra,40005758 <_Heap_Initialize> <== NOT EXECUTED
if ( ok ) {
40001bf4: 00050463 beqz a0,40001bfc <rtems_cache_coherent_add_area+0xa4> <== NOT EXECUTED
cache_coherent_heap = heap;
40001bf8: 0084a023 sw s0,0(s1) <== NOT EXECUTED
}
40001bfc: 01c12083 lw ra,28(sp) <== NOT EXECUTED
40001c00: 01812403 lw s0,24(sp) <== NOT EXECUTED
40001c04: 01412483 lw s1,20(sp) <== NOT EXECUTED
40001c08: 02010113 addi sp,sp,32 <== NOT EXECUTED
40001c0c: 00008067 ret <== NOT EXECUTED
ok = _Heap_Initialize( heap, area_begin, area_size, 0 );
40001c10: 400157b7 lui a5,0x40015
40001c14: 00040593 mv a1,s0
40001c18: 00000693 li a3,0
40001c1c: 2c078513 addi a0,a5,704 # 400152c0 <cache_coherent_heap_instance>
40001c20: 2c078413 addi s0,a5,704
40001c24: 335030ef jal ra,40005758 <_Heap_Initialize>
if ( ok ) {
40001c28: fa0500e3 beqz a0,40001bc8 <rtems_cache_coherent_add_area+0x70>
cache_coherent_heap = heap;
40001c2c: 0084a023 sw s0,0(s1)
40001c30: f99ff06f j 40001bc8 <rtems_cache_coherent_add_area+0x70>
40001b00 <rtems_cache_coherent_free>:
void rtems_cache_coherent_free( void *ptr )
{
40001b00: ff010113 addi sp,sp,-16
40001b04: 00812423 sw s0,8(sp)
40001b08: 00112623 sw ra,12(sp)
40001b0c: 00050413 mv s0,a0
Heap_Control *heap;
_RTEMS_Lock_allocator();
40001b10: 041030ef jal ra,40005350 <_RTEMS_Lock_allocator>
heap = cache_coherent_heap;
40001b14: 8ac1a503 lw a0,-1876(gp) # 4001273c <cache_coherent_heap>
if ( heap != NULL ) {
40001b18: 02050063 beqz a0,40001b38 <rtems_cache_coherent_free+0x38>
if ( _Heap_Free( heap, ptr ) ) {
40001b1c: 00040593 mv a1,s0
40001b20: 24c040ef jal ra,40005d6c <_Heap_Free>
40001b24: 00050a63 beqz a0,40001b38 <rtems_cache_coherent_free+0x38>
if ( heap != NULL ) {
_Heap_Free( heap, ptr );
}
_RTEMS_Unlock_allocator();
}
40001b28: 00812403 lw s0,8(sp)
40001b2c: 00c12083 lw ra,12(sp)
40001b30: 01010113 addi sp,sp,16
_RTEMS_Unlock_allocator();
40001b34: 0290306f j 4000535c <_RTEMS_Unlock_allocator>
heap = RTEMS_Malloc_Heap;
40001b38: 8b41a503 lw a0,-1868(gp) # 40012744 <RTEMS_Malloc_Heap>
if ( heap != NULL ) {
40001b3c: fe0506e3 beqz a0,40001b28 <rtems_cache_coherent_free+0x28> <== NEVER TAKEN
_Heap_Free( heap, ptr );
40001b40: 00040593 mv a1,s0
40001b44: 228040ef jal ra,40005d6c <_Heap_Free>
}
40001b48: 00812403 lw s0,8(sp)
40001b4c: 00c12083 lw ra,12(sp)
40001b50: 01010113 addi sp,sp,16
_RTEMS_Unlock_allocator();
40001b54: 0090306f j 4000535c <_RTEMS_Unlock_allocator>
4000488c <rtems_filesystem_do_unmount>:
}
void rtems_filesystem_do_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
4000488c: ff010113 addi sp,sp,-16
40004890: 00112623 sw ra,12(sp)
40004894: 00812423 sw s0,8(sp)
40004898: 00050413 mv s0,a0
rtems_libio_lock();
4000489c: e7cfe0ef jal ra,40002f18 <rtems_libio_lock>
next = the_node->next;
400048a0: 00042703 lw a4,0(s0)
previous = the_node->previous;
400048a4: 00442783 lw a5,4(s0)
next->previous = previous;
400048a8: 00f72223 sw a5,4(a4)
previous->next = next;
400048ac: 00e7a023 sw a4,0(a5)
rtems_libio_unlock();
400048b0: e74fe0ef jal ra,40002f24 <rtems_libio_unlock>
release_with_count(global_loc, 1);
400048b4: 02042503 lw a0,32(s0)
400048b8: 00100593 li a1,1
400048bc: 048000ef jal ra,40004904 <release_with_count>
rtems_filesystem_mt_lock();
rtems_chain_extract_unprotected(&mt_entry->mt_node);
rtems_filesystem_mt_unlock();
rtems_filesystem_global_location_release(mt_entry->mt_point_node, false);
(*mt_entry->ops->fsunmount_me_h)(mt_entry);
400048c0: 00c42783 lw a5,12(s0)
400048c4: 00040513 mv a0,s0
400048c8: 0347a783 lw a5,52(a5)
400048cc: 000780e7 jalr a5
if (mt_entry->unmount_task != 0) {
400048d0: 03c42503 lw a0,60(s0)
400048d4: 00050863 beqz a0,400048e4 <rtems_filesystem_do_unmount+0x58> <== NEVER TAKEN
*
* @param id is the identifier of the task to receive the transient event.
*/
static inline rtems_status_code rtems_event_transient_send( rtems_id id )
{
return rtems_event_system_send( id, RTEMS_EVENT_SYSTEM_TRANSIENT );
400048d8: 800005b7 lui a1,0x80000
400048dc: 5ac020ef jal ra,40006e88 <rtems_event_system_send>
rtems_status_code sc =
rtems_event_transient_send(mt_entry->unmount_task);
if (sc != RTEMS_SUCCESSFUL) {
400048e0: 00051c63 bnez a0,400048f8 <rtems_filesystem_do_unmount+0x6c> <== NEVER TAKEN
rtems_fatal_error_occurred(0xdeadbeef);
}
}
free(mt_entry);
400048e4: 00040513 mv a0,s0
}
400048e8: 00812403 lw s0,8(sp)
400048ec: 00c12083 lw ra,12(sp)
400048f0: 01010113 addi sp,sp,16
free(mt_entry);
400048f4: 9bcfe06f j 40002ab0 <free>
rtems_fatal_error_occurred(0xdeadbeef);
400048f8: deadc537 lui a0,0xdeadc <== NOT EXECUTED
400048fc: eef50513 addi a0,a0,-273 # deadbeef <RamEnd+0x9dadbeef> <== NOT EXECUTED
40004900: 788020ef jal ra,40007088 <rtems_fatal_error_occurred> <== NOT EXECUTED
40004440 <rtems_filesystem_eval_path_error>:
if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
40004440: 02852703 lw a4,40(a0) <== NOT EXECUTED
40004444: 4001f7b7 lui a5,0x4001f <== NOT EXECUTED
ctx->path = NULL;
40004448: 00052023 sw zero,0(a0) <== NOT EXECUTED
ctx->pathlen = 0;
4000444c: 00052223 sw zero,4(a0) <== NOT EXECUTED
ctx->token = NULL;
40004450: 00052423 sw zero,8(a0) <== NOT EXECUTED
ctx->tokenlen = 0;
40004454: 00052623 sw zero,12(a0) <== NOT EXECUTED
if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
40004458: b0078793 addi a5,a5,-1280 # 4001eb00 <rtems_filesystem_null_handlers><== NOT EXECUTED
4000445c: 04f70c63 beq a4,a5,400044b4 <rtems_filesystem_eval_path_error+0x74><== NOT EXECUTED
{
40004460: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40004464: 00812423 sw s0,8(sp) <== NOT EXECUTED
40004468: 00912223 sw s1,4(sp) <== NOT EXECUTED
4000446c: 00112623 sw ra,12(sp) <== NOT EXECUTED
40004470: 00050413 mv s0,a0 <== NOT EXECUTED
40004474: 00058493 mv s1,a1 <== NOT EXECUTED
if (eno != 0) {
40004478: 00059e63 bnez a1,40004494 <rtems_filesystem_eval_path_error+0x54><== NOT EXECUTED
rtems_filesystem_location_detach(&ctx->currentloc);
4000447c: 01840513 addi a0,s0,24 <== NOT EXECUTED
}
}
40004480: 00812403 lw s0,8(sp) <== NOT EXECUTED
40004484: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40004488: 00412483 lw s1,4(sp) <== NOT EXECUTED
4000448c: 01010113 addi sp,sp,16 <== NOT EXECUTED
rtems_filesystem_location_detach(&ctx->currentloc);
40004490: 3340006f j 400047c4 <rtems_filesystem_location_detach> <== NOT EXECUTED
errno = eno;
40004494: 234100ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40004498: 00952023 sw s1,0(a0) <== NOT EXECUTED
rtems_filesystem_location_detach(&ctx->currentloc);
4000449c: 01840513 addi a0,s0,24 <== NOT EXECUTED
}
400044a0: 00812403 lw s0,8(sp) <== NOT EXECUTED
400044a4: 00c12083 lw ra,12(sp) <== NOT EXECUTED
400044a8: 00412483 lw s1,4(sp) <== NOT EXECUTED
400044ac: 01010113 addi sp,sp,16 <== NOT EXECUTED
rtems_filesystem_location_detach(&ctx->currentloc);
400044b0: 3140006f j 400047c4 <rtems_filesystem_location_detach> <== NOT EXECUTED
400044b4: 00008067 ret <== NOT EXECUTED
4000ee4c <rtems_filesystem_eval_path_generic>:
void rtems_filesystem_eval_path_generic(
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const rtems_filesystem_eval_path_generic_config *config
)
{
4000ee4c: fd010113 addi sp,sp,-48
4000ee50: 02812423 sw s0,40(sp)
4000ee54: 02912223 sw s1,36(sp)
4000ee58: 03212023 sw s2,32(sp)
4000ee5c: 01312e23 sw s3,28(sp)
4000ee60: 01412c23 sw s4,24(sp)
4000ee64: 01512a23 sw s5,20(sp)
4000ee68: 01612823 sw s6,16(sp)
4000ee6c: 01712623 sw s7,12(sp)
4000ee70: 01812423 sw s8,8(sp)
4000ee74: 02112623 sw ra,44(sp)
4000ee78: 01912223 sw s9,4(sp)
4000ee7c: 01a12023 sw s10,0(sp)
4000ee80: 00050413 mv s0,a0
4000ee84: 00058913 mv s2,a1
4000ee88: 00060493 mv s1,a2
return tokenlen == 1 && token [0] == '.';
4000ee8c: 00100a13 li s4,1
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
4000ee90: 00200993 li s3,2
4000ee94: 02e00a93 li s5,46
return &ctx->currentloc;
4000ee98: 01850b93 addi s7,a0,24
} else {
/* This is the root file system */
status = (*config->eval_token)(ctx, arg, ".", 1);
}
} else {
status = (*config->eval_token)(ctx, arg, "..", 2);
4000ee9c: 4001fc37 lui s8,0x4001f
status = (*config->eval_token)(ctx, arg, ".", 1);
4000eea0: 4001fb37 lui s6,0x4001f
rtems_filesystem_eval_path_next_token(ctx);
4000eea4: 00040513 mv a0,s0
4000eea8: 268000ef jal ra,4000f110 <rtems_filesystem_eval_path_next_token>
*tokenlen = ctx->tokenlen;
4000eeac: 00c42c83 lw s9,12(s0)
*token = ctx->token;
4000eeb0: 00842d03 lw s10,8(s0)
if (tokenlen > 0) {
4000eeb4: 080c8663 beqz s9,4000ef40 <rtems_filesystem_eval_path_generic+0xf4>
if ((*config->is_directory)(ctx, arg)) {
4000eeb8: 0004a783 lw a5,0(s1)
4000eebc: 00090593 mv a1,s2
4000eec0: 00040513 mv a0,s0
4000eec4: 000780e7 jalr a5
4000eec8: 1e050a63 beqz a0,4000f0bc <rtems_filesystem_eval_path_generic+0x270>
return tokenlen == 1 && token [0] == '.';
4000eecc: 034c8a63 beq s9,s4,4000ef00 <rtems_filesystem_eval_path_generic+0xb4>
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
4000eed0: 013c9663 bne s9,s3,4000eedc <rtems_filesystem_eval_path_generic+0x90>
4000eed4: 000d4783 lbu a5,0(s10)
4000eed8: 11578263 beq a5,s5,4000efdc <rtems_filesystem_eval_path_generic+0x190>
}
} else {
status = (*config->eval_token)(ctx, arg, token, tokenlen);
4000eedc: 0044a783 lw a5,4(s1)
4000eee0: 000c8693 mv a3,s9
4000eee4: 000d0613 mv a2,s10
4000eee8: 00090593 mv a1,s2
4000eeec: 00040513 mv a0,s0
4000eef0: 000780e7 jalr a5
}
if (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY) {
4000eef4: 05350263 beq a0,s3,4000ef38 <rtems_filesystem_eval_path_generic+0xec>
while (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE) {
4000eef8: fa0506e3 beqz a0,4000eea4 <rtems_filesystem_eval_path_generic+0x58>
4000eefc: 0440006f j 4000ef40 <rtems_filesystem_eval_path_generic+0xf4>
return tokenlen == 1 && token [0] == '.';
4000ef00: 000d4783 lbu a5,0(s10)
4000ef04: fd579ce3 bne a5,s5,4000eedc <rtems_filesystem_eval_path_generic+0x90>
if (rtems_filesystem_eval_path_has_path(ctx)) {
4000ef08: 00442783 lw a5,4(s0)
4000ef0c: 00079863 bnez a5,4000ef1c <rtems_filesystem_eval_path_generic+0xd0>
if ((eval_flags & RTEMS_FS_REJECT_TERMINAL_DOT) == 0) {
4000ef10: 01042783 lw a5,16(s0)
4000ef14: 1007f793 andi a5,a5,256
4000ef18: 0a079e63 bnez a5,4000efd4 <rtems_filesystem_eval_path_generic+0x188>
status = (*config->eval_token)(ctx, arg, ".", 1);
4000ef1c: 0044a783 lw a5,4(s1)
4000ef20: 00100693 li a3,1
4000ef24: ab0b0613 addi a2,s6,-1360 # 4001eab0 <objects_info_table+0x78>
4000ef28: 00090593 mv a1,s2
4000ef2c: 00040513 mv a0,s0
4000ef30: 000780e7 jalr a5
if (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY) {
4000ef34: fd3512e3 bne a0,s3,4000eef8 <rtems_filesystem_eval_path_generic+0xac>
if (rtems_filesystem_eval_path_has_path(ctx)) {
4000ef38: 00442783 lw a5,4(s0)
4000ef3c: 02079e63 bnez a5,4000ef78 <rtems_filesystem_eval_path_generic+0x12c>
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
}
}
}
4000ef40: 02c12083 lw ra,44(sp)
4000ef44: 02812403 lw s0,40(sp)
4000ef48: 02412483 lw s1,36(sp)
4000ef4c: 02012903 lw s2,32(sp)
4000ef50: 01c12983 lw s3,28(sp)
4000ef54: 01812a03 lw s4,24(sp)
4000ef58: 01412a83 lw s5,20(sp)
4000ef5c: 01012b03 lw s6,16(sp)
4000ef60: 00c12b83 lw s7,12(sp)
4000ef64: 00812c03 lw s8,8(sp)
4000ef68: 00412c83 lw s9,4(sp)
4000ef6c: 00012d03 lw s10,0(sp)
4000ef70: 03010113 addi sp,sp,48
4000ef74: 00008067 ret
rtems_filesystem_eval_path_eat_delimiter(ctx);
4000ef78: 00040513 mv a0,s0
4000ef7c: 148000ef jal ra,4000f0c4 <rtems_filesystem_eval_path_eat_delimiter>
(eval_flags & RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS) == 0
4000ef80: 01042783 lw a5,16(s0)
4000ef84: 0807f793 andi a5,a5,128
if (
4000ef88: 00078663 beqz a5,4000ef94 <rtems_filesystem_eval_path_generic+0x148>
|| rtems_filesystem_eval_path_has_path(ctx)
4000ef8c: 00442783 lw a5,4(s0)
4000ef90: fa0788e3 beqz a5,4000ef40 <rtems_filesystem_eval_path_generic+0xf4>
rtems_filesystem_eval_path_error(ctx, ENOENT);
4000ef94: 00200593 li a1,2
rtems_filesystem_eval_path_error(ctx, ENOTDIR);
4000ef98: 00040513 mv a0,s0
}
4000ef9c: 02812403 lw s0,40(sp)
4000efa0: 02c12083 lw ra,44(sp)
4000efa4: 02412483 lw s1,36(sp)
4000efa8: 02012903 lw s2,32(sp)
4000efac: 01c12983 lw s3,28(sp)
4000efb0: 01812a03 lw s4,24(sp)
4000efb4: 01412a83 lw s5,20(sp)
4000efb8: 01012b03 lw s6,16(sp)
4000efbc: 00c12b83 lw s7,12(sp)
4000efc0: 00812c03 lw s8,8(sp)
4000efc4: 00412c83 lw s9,4(sp)
4000efc8: 00012d03 lw s10,0(sp)
4000efcc: 03010113 addi sp,sp,48
rtems_filesystem_eval_path_error(ctx, ENOTDIR);
4000efd0: c70f506f j 40004440 <rtems_filesystem_eval_path_error>
rtems_filesystem_eval_path_error(ctx, EINVAL);
4000efd4: 01600593 li a1,22
4000efd8: fc1ff06f j 4000ef98 <rtems_filesystem_eval_path_generic+0x14c>
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
4000efdc: 001d4783 lbu a5,1(s10)
4000efe0: ef579ee3 bne a5,s5,4000eedc <rtems_filesystem_eval_path_generic+0x90>
if (is_eval_path_root(ctx, currentloc)) {
4000efe4: 03042583 lw a1,48(s0)
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
4000efe8: 02c42783 lw a5,44(s0)
&& (*mt_entry->ops->are_nodes_equal_h)( loc, rootloc );
4000efec: 0145a703 lw a4,20(a1)
4000eff0: 00c7a683 lw a3,12(a5)
4000eff4: 0106a683 lw a3,16(a3)
4000eff8: 08e78063 beq a5,a4,4000f078 <rtems_filesystem_eval_path_generic+0x22c>
return (*mt_entry->ops->are_nodes_equal_h)( loc, mt_fs_root );
4000effc: 0247a583 lw a1,36(a5)
4000f000: 000b8513 mv a0,s7
4000f004: 000680e7 jalr a3
} else if (is_fs_root(currentloc)) {
4000f008: 08050c63 beqz a0,4000f0a0 <rtems_filesystem_eval_path_generic+0x254>
if (currentloc->mt_entry->mt_point_node != NULL) {
4000f00c: 02c42583 lw a1,44(s0)
4000f010: 0205a783 lw a5,32(a1)
4000f014: f00784e3 beqz a5,4000ef1c <rtems_filesystem_eval_path_generic+0xd0><== NEVER TAKEN
size_t tokenlen = ctx->tokenlen;
4000f018: 00c42683 lw a3,12(s0)
ctx->path -= tokenlen;
4000f01c: 00042703 lw a4,0(s0)
ctx->pathlen += tokenlen;
4000f020: 00442783 lw a5,4(s0)
ctx->tokenlen = 0;
4000f024: 00042623 sw zero,12(s0)
ctx->path -= tokenlen;
4000f028: 40d70733 sub a4,a4,a3
ctx->pathlen += tokenlen;
4000f02c: 00d787b3 add a5,a5,a3
ctx->path -= tokenlen;
4000f030: 00e42023 sw a4,0(s0)
ctx->pathlen += tokenlen;
4000f034: 00f42223 sw a5,4(s0)
rtems_filesystem_eval_path_restart(
4000f038: 00040513 mv a0,s0
}
4000f03c: 02812403 lw s0,40(sp)
4000f040: 02c12083 lw ra,44(sp)
4000f044: 02412483 lw s1,36(sp)
4000f048: 02012903 lw s2,32(sp)
4000f04c: 01c12983 lw s3,28(sp)
4000f050: 01812a03 lw s4,24(sp)
4000f054: 01412a83 lw s5,20(sp)
4000f058: 01012b03 lw s6,16(sp)
4000f05c: 00c12b83 lw s7,12(sp)
4000f060: 00812c03 lw s8,8(sp)
4000f064: 00412c83 lw s9,4(sp)
4000f068: 00012d03 lw s10,0(sp)
rtems_filesystem_eval_path_restart(
4000f06c: 02058593 addi a1,a1,32
}
4000f070: 03010113 addi sp,sp,48
rtems_filesystem_eval_path_restart(
4000f074: d1cf506f j 40004590 <rtems_filesystem_eval_path_restart>
&& (*mt_entry->ops->are_nodes_equal_h)( loc, rootloc );
4000f078: 000b8513 mv a0,s7
4000f07c: 000680e7 jalr a3
4000f080: e8051ee3 bnez a0,4000ef1c <rtems_filesystem_eval_path_generic+0xd0>
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
4000f084: 02c42783 lw a5,44(s0)
return (*mt_entry->ops->are_nodes_equal_h)( loc, mt_fs_root );
4000f088: 000b8513 mv a0,s7
4000f08c: 00c7a703 lw a4,12(a5)
4000f090: 0247a583 lw a1,36(a5)
4000f094: 01072683 lw a3,16(a4)
4000f098: 000680e7 jalr a3
} else if (is_fs_root(currentloc)) {
4000f09c: f60518e3 bnez a0,4000f00c <rtems_filesystem_eval_path_generic+0x1c0><== NEVER TAKEN
status = (*config->eval_token)(ctx, arg, "..", 2);
4000f0a0: 0044a783 lw a5,4(s1)
4000f0a4: 00200693 li a3,2
4000f0a8: 050c0613 addi a2,s8,80 # 4001f050 <_Thread_queue_Operations_priority_inherit+0x118>
4000f0ac: 00090593 mv a1,s2
4000f0b0: 00040513 mv a0,s0
4000f0b4: 000780e7 jalr a5
4000f0b8: e3dff06f j 4000eef4 <rtems_filesystem_eval_path_generic+0xa8>
rtems_filesystem_eval_path_error(ctx, ENOTDIR);
4000f0bc: 01400593 li a1,20
4000f0c0: ed9ff06f j 4000ef98 <rtems_filesystem_eval_path_generic+0x14c>
4000f110 <rtems_filesystem_eval_path_next_token>:
const char *current = ctx->path;
4000f110: 00052783 lw a5,0(a0)
const char *end = current + ctx->pathlen;
4000f114: 00452683 lw a3,4(a0)
4000f118: 00d786b3 add a3,a5,a3
while (current != end && rtems_filesystem_is_delimiter(*current)) {
4000f11c: 06d78863 beq a5,a3,4000f18c <rtems_filesystem_eval_path_next_token+0x7c>
4000f120: 02f00613 li a2,47
4000f124: 05c00593 li a1,92
4000f128: 0007c703 lbu a4,0(a5)
4000f12c: 04c70c63 beq a4,a2,4000f184 <rtems_filesystem_eval_path_next_token+0x74>
4000f130: 04b70a63 beq a4,a1,4000f184 <rtems_filesystem_eval_path_next_token+0x74>
ctx->pathlen = (size_t) (end - current);
4000f134: 40f68833 sub a6,a3,a5
ctx->path = current;
4000f138: 00f52023 sw a5,0(a0)
ctx->pathlen = (size_t) (end - current);
4000f13c: 01052223 sw a6,4(a0)
{
const char *begin = ctx->path;
const char *end = begin + ctx->pathlen;
const char *current = begin;
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
4000f140: 06f68a63 beq a3,a5,4000f1b4 <rtems_filesystem_eval_path_next_token+0xa4>
4000f144: 00078713 mv a4,a5
4000f148: 02f00593 li a1,47
4000f14c: 05c00893 li a7,92
4000f150: 0100006f j 4000f160 <rtems_filesystem_eval_path_next_token+0x50>
4000f154: 01160a63 beq a2,a7,4000f168 <rtems_filesystem_eval_path_next_token+0x58>
++current;
4000f158: 00170713 addi a4,a4,1
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
4000f15c: 04d70063 beq a4,a3,4000f19c <rtems_filesystem_eval_path_next_token+0x8c>
4000f160: 00074603 lbu a2,0(a4)
4000f164: feb618e3 bne a2,a1,4000f154 <rtems_filesystem_eval_path_next_token+0x44>
}
ctx->path = current;
ctx->pathlen = (size_t) (end - current);
4000f168: 40e686b3 sub a3,a3,a4
ctx->token = begin;
ctx->tokenlen = (size_t) (current - begin);
4000f16c: 40f70833 sub a6,a4,a5
ctx->path = current;
4000f170: 00e52023 sw a4,0(a0)
ctx->pathlen = (size_t) (end - current);
4000f174: 00d52223 sw a3,4(a0)
ctx->token = begin;
4000f178: 00f52423 sw a5,8(a0)
ctx->tokenlen = (size_t) (current - begin);
4000f17c: 01052623 sw a6,12(a0)
rtems_filesystem_eval_path_context_t *ctx
)
{
rtems_filesystem_eval_path_eat_delimiter(ctx);
next_token(ctx);
}
4000f180: 00008067 ret
++current;
4000f184: 00178793 addi a5,a5,1
while (current != end && rtems_filesystem_is_delimiter(*current)) {
4000f188: faf690e3 bne a3,a5,4000f128 <rtems_filesystem_eval_path_next_token+0x18>
4000f18c: 00000693 li a3,0
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
4000f190: 00078713 mv a4,a5
4000f194: 00000813 li a6,0
4000f198: fd9ff06f j 4000f170 <rtems_filesystem_eval_path_next_token+0x60>
4000f19c: 00000693 li a3,0
ctx->path = current;
4000f1a0: 00e52023 sw a4,0(a0)
ctx->pathlen = (size_t) (end - current);
4000f1a4: 00d52223 sw a3,4(a0)
ctx->token = begin;
4000f1a8: 00f52423 sw a5,8(a0)
ctx->tokenlen = (size_t) (current - begin);
4000f1ac: 01052623 sw a6,12(a0)
}
4000f1b0: 00008067 ret
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
4000f1b4: 00080693 mv a3,a6 <== NOT EXECUTED
4000f1b8: fd9ff06f j 4000f190 <rtems_filesystem_eval_path_next_token+0x80> <== NOT EXECUTED
4000463c <rtems_filesystem_eval_path_recursive>:
{
4000463c: fd010113 addi sp,sp,-48
40004640: 02812423 sw s0,40(sp)
40004644: 02112623 sw ra,44(sp)
40004648: 03212223 sw s2,36(sp)
4000464c: 03312023 sw s3,32(sp)
40004650: 01412e23 sw s4,28(sp)
40004654: 00050413 mv s0,a0
if (pathlen > 0) {
40004658: 0a060c63 beqz a2,40004710 <rtems_filesystem_eval_path_recursive+0xd4><== NEVER TAKEN
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
4000465c: 01452783 lw a5,20(a0)
40004660: 01f00713 li a4,31
40004664: 08f74063 blt a4,a5,400046e4 <rtems_filesystem_eval_path_recursive+0xa8>
if (rtems_filesystem_is_delimiter(path [0])) {
40004668: 0005c703 lbu a4,0(a1)
return c == '/' || c == '\\';
4000466c: 02f00693 li a3,47
const char *saved_path = ctx->path;
40004670: 00052983 lw s3,0(a0)
size_t saved_pathlen = ctx->pathlen;
40004674: 00452a03 lw s4,4(a0)
40004678: 00058913 mv s2,a1
4000467c: 0ed70063 beq a4,a3,4000475c <rtems_filesystem_eval_path_recursive+0x120>
40004680: 05c00693 li a3,92
40004684: 0cd70c63 beq a4,a3,4000475c <rtems_filesystem_eval_path_recursive+0x120>
++ctx->recursionlevel;
40004688: 00178793 addi a5,a5,1
ctx->path = path;
4000468c: 01242023 sw s2,0(s0)
ctx->pathlen = pathlen;
40004690: 00c42223 sw a2,4(s0)
++ctx->recursionlevel;
40004694: 00f42a23 sw a5,20(s0)
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
40004698: 02c42783 lw a5,44(s0)
4000469c: 00040513 mv a0,s0
400046a0: 00c7a783 lw a5,12(a5)
400046a4: 0087a783 lw a5,8(a5)
400046a8: 000780e7 jalr a5
while (ctx->pathlen > 0) {
400046ac: 00442783 lw a5,4(s0)
400046b0: fe0794e3 bnez a5,40004698 <rtems_filesystem_eval_path_recursive+0x5c>
--ctx->recursionlevel;
400046b4: 01442783 lw a5,20(s0)
ctx->path = saved_path;
400046b8: 01342023 sw s3,0(s0)
ctx->pathlen = saved_pathlen;
400046bc: 01442223 sw s4,4(s0)
--ctx->recursionlevel;
400046c0: fff78793 addi a5,a5,-1
400046c4: 00f42a23 sw a5,20(s0)
}
400046c8: 02c12083 lw ra,44(sp)
400046cc: 02812403 lw s0,40(sp)
400046d0: 02412903 lw s2,36(sp)
400046d4: 02012983 lw s3,32(sp)
400046d8: 01c12a03 lw s4,28(sp)
400046dc: 03010113 addi sp,sp,48
400046e0: 00008067 ret
if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
400046e4: 02852703 lw a4,40(a0)
400046e8: 4001f7b7 lui a5,0x4001f
ctx->path = NULL;
400046ec: 00052023 sw zero,0(a0)
ctx->pathlen = 0;
400046f0: 00052223 sw zero,4(a0)
ctx->token = NULL;
400046f4: 00052423 sw zero,8(a0)
ctx->tokenlen = 0;
400046f8: 00052623 sw zero,12(a0)
if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
400046fc: b0078793 addi a5,a5,-1280 # 4001eb00 <rtems_filesystem_null_handlers>
40004700: fcf704e3 beq a4,a5,400046c8 <rtems_filesystem_eval_path_recursive+0x8c>
errno = eno;
40004704: 7c50f0ef jal ra,400146c8 <__errno>
40004708: 05c00793 li a5,92
4000470c: 02c0006f j 40004738 <rtems_filesystem_eval_path_recursive+0xfc>
if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
40004710: 02852703 lw a4,40(a0) <== NOT EXECUTED
40004714: 4001f7b7 lui a5,0x4001f <== NOT EXECUTED
ctx->path = NULL;
40004718: 00052023 sw zero,0(a0) <== NOT EXECUTED
ctx->pathlen = 0;
4000471c: 00052223 sw zero,4(a0) <== NOT EXECUTED
ctx->token = NULL;
40004720: 00052423 sw zero,8(a0) <== NOT EXECUTED
ctx->tokenlen = 0;
40004724: 00052623 sw zero,12(a0) <== NOT EXECUTED
if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
40004728: b0078793 addi a5,a5,-1280 # 4001eb00 <rtems_filesystem_null_handlers><== NOT EXECUTED
4000472c: f8f70ee3 beq a4,a5,400046c8 <rtems_filesystem_eval_path_recursive+0x8c><== NOT EXECUTED
errno = eno;
40004730: 7990f0ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40004734: 00200793 li a5,2 <== NOT EXECUTED
40004738: 00f52023 sw a5,0(a0)
rtems_filesystem_location_detach(&ctx->currentloc);
4000473c: 01840513 addi a0,s0,24
}
40004740: 02812403 lw s0,40(sp)
40004744: 02c12083 lw ra,44(sp)
40004748: 02412903 lw s2,36(sp)
4000474c: 02012983 lw s3,32(sp)
40004750: 01c12a03 lw s4,28(sp)
40004754: 03010113 addi sp,sp,48
rtems_filesystem_location_detach(&ctx->currentloc);
40004758: 06c0006f j 400047c4 <rtems_filesystem_location_detach>
rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
4000475c: 03040593 addi a1,s0,48
40004760: 00040513 mv a0,s0
40004764: 00c12623 sw a2,12(sp)
40004768: e29ff0ef jal ra,40004590 <rtems_filesystem_eval_path_restart>
++ctx->recursionlevel;
4000476c: 01442783 lw a5,20(s0)
40004770: 00c12603 lw a2,12(sp)
40004774: f15ff06f j 40004688 <rtems_filesystem_eval_path_recursive+0x4c>
40004310 <rtems_filesystem_eval_path_start_with_parent>:
{
40004310: fd010113 addi sp,sp,-48
40004314: 03212023 sw s2,32(sp)
40004318: 00050913 mv s2,a0
size_t pathlen = strlen(path);
4000431c: 00058513 mv a0,a1
{
40004320: 02812423 sw s0,40(sp)
40004324: 02912223 sw s1,36(sp)
40004328: 01312e23 sw s3,28(sp)
4000432c: 01412c23 sw s4,24(sp)
40004330: 01512a23 sw s5,20(sp)
40004334: 01612823 sw s6,16(sp)
40004338: 00058493 mv s1,a1
4000433c: 00068a93 mv s5,a3
40004340: 00070b13 mv s6,a4
40004344: 02112623 sw ra,44(sp)
40004348: 01712623 sw s7,12(sp)
4000434c: 01812423 sw s8,8(sp)
40004350: 00060a13 mv s4,a2
size_t pathlen = strlen(path);
40004354: 240110ef jal ra,40015594 <strlen>
40004358: 00050413 mv s0,a0
size_t i = pathlen - 1;
4000435c: fff40813 addi a6,s0,-1
size_t pathlen = strlen(path);
40004360: 00050993 mv s3,a0
return c == '/' || c == '\\';
40004364: 02f00713 li a4,47
40004368: 05c00693 li a3,92
if (rtems_filesystem_is_delimiter(path [i])) {
4000436c: 010487b3 add a5,s1,a6
while (pathlen > 0) {
40004370: 02040063 beqz s0,40004390 <rtems_filesystem_eval_path_start_with_parent+0x80>
if (rtems_filesystem_is_delimiter(path [i])) {
40004374: 0007c783 lbu a5,0(a5)
40004378: 08e78e63 beq a5,a4,40004414 <rtems_filesystem_eval_path_start_with_parent+0x104>
4000437c: 08d78c63 beq a5,a3,40004414 <rtems_filesystem_eval_path_start_with_parent+0x104>
pathlen = i;
40004380: 00080413 mv s0,a6
size_t i = pathlen - 1;
40004384: fff40813 addi a6,s0,-1
if (rtems_filesystem_is_delimiter(path [i])) {
40004388: 010487b3 add a5,s1,a6
while (pathlen > 0) {
4000438c: fe0414e3 bnez s0,40004374 <rtems_filesystem_eval_path_start_with_parent+0x64>
const char *name = NULL;
40004390: 00000b93 li s7,0
if (pathlen > 0) {
40004394: 08099c63 bnez s3,4000442c <rtems_filesystem_eval_path_start_with_parent+0x11c>
&rtems_filesystem_root,
40004398: 23d000ef jal ra,40004dd4 <rtems_current_user_env_get>
4000439c: 00050c13 mv s8,a0
&rtems_filesystem_current
400043a0: 235000ef jal ra,40004dd4 <rtems_current_user_env_get>
400043a4: 00050793 mv a5,a0
currentloc = rtems_filesystem_eval_path_start_with_root_and_current(
400043a8: 004c0713 addi a4,s8,4
400043ac: 000b0693 mv a3,s6
400043b0: 00040613 mv a2,s0
400043b4: 00048593 mv a1,s1
400043b8: 00090513 mv a0,s2
400043bc: da5ff0ef jal ra,40004160 <rtems_filesystem_eval_path_start_with_root_and_current>
400043c0: 00050593 mv a1,a0
rtems_filesystem_location_clone(parentloc, currentloc);
400043c4: 000a8513 mv a0,s5
400043c8: 6000a0ef jal ra,4000e9c8 <rtems_filesystem_location_clone>
rtems_filesystem_eval_path_continue(ctx);
400043cc: 00090513 mv a0,s2
ctx->path = name;
400043d0: 01792023 sw s7,0(s2)
ctx->pathlen = namelen;
400043d4: 01392223 sw s3,4(s2)
ctx->flags = eval_flags;
400043d8: 01492823 sw s4,16(s2)
rtems_filesystem_eval_path_continue(ctx);
400043dc: c91ff0ef jal ra,4000406c <rtems_filesystem_eval_path_continue>
}
400043e0: 02c12083 lw ra,44(sp)
400043e4: 02812403 lw s0,40(sp)
400043e8: 02412483 lw s1,36(sp)
400043ec: 01c12983 lw s3,28(sp)
400043f0: 01812a03 lw s4,24(sp)
400043f4: 01412a83 lw s5,20(sp)
400043f8: 01012b03 lw s6,16(sp)
400043fc: 00c12b83 lw s7,12(sp)
40004400: 00812c03 lw s8,8(sp)
return &ctx->currentloc;
40004404: 01890513 addi a0,s2,24
}
40004408: 02012903 lw s2,32(sp)
4000440c: 03010113 addi sp,sp,48
40004410: 00008067 ret
if (pathlen > 0) {
40004414: 00098863 beqz s3,40004424 <rtems_filesystem_eval_path_start_with_parent+0x114><== NEVER TAKEN
name = path + parentpathlen;
40004418: 00848bb3 add s7,s1,s0
namelen = pathlen - parentpathlen;
4000441c: 408989b3 sub s3,s3,s0
40004420: f79ff06f j 40004398 <rtems_filesystem_eval_path_start_with_parent+0x88>
const char *name = NULL;
40004424: 00000b93 li s7,0 <== NOT EXECUTED
40004428: f71ff06f j 40004398 <rtems_filesystem_eval_path_start_with_parent+0x88><== NOT EXECUTED
if (pathlen > 0) {
4000442c: 00048b93 mv s7,s1
parentpath = ".";
40004430: 4001f4b7 lui s1,0x4001f
parentpathlen = 1;
40004434: 00100413 li s0,1
parentpath = ".";
40004438: ab048493 addi s1,s1,-1360 # 4001eab0 <objects_info_table+0x78>
4000443c: f5dff06f j 40004398 <rtems_filesystem_eval_path_start_with_parent+0x88>
400036ec <rtems_filesystem_get_mount_handler>:
find_arg fa = {
.type = type,
.mount_h = NULL
};
if ( type != NULL ) {
400036ec: 0a050863 beqz a0,4000379c <rtems_filesystem_get_mount_handler+0xb0><== NEVER TAKEN
{
400036f0: fe010113 addi sp,sp,-32
400036f4: 00812c23 sw s0,24(sp)
while ( table_entry->type && !stop ) {
400036f8: 4001e437 lui s0,0x4001e
{
400036fc: 00912a23 sw s1,20(sp)
40003700: 00050493 mv s1,a0
while ( table_entry->type && !stop ) {
40003704: 52442503 lw a0,1316(s0) # 4001e524 <rtems_filesystem_table>
{
40003708: 00112e23 sw ra,28(sp)
4000370c: 01212823 sw s2,16(sp)
40003710: 52440413 addi s0,s0,1316
while ( table_entry->type && !stop ) {
40003714: 00050e63 beqz a0,40003730 <rtems_filesystem_get_mount_handler+0x44><== NEVER TAKEN
if ( strcmp( entry->type, fa->type ) != 0 ) {
40003718: 00048593 mv a1,s1
4000371c: 3cd110ef jal ra,400152e8 <strcmp>
40003720: 06050063 beqz a0,40003780 <rtems_filesystem_get_mount_handler+0x94>
while ( table_entry->type && !stop ) {
40003724: 00842503 lw a0,8(s0)
++table_entry;
40003728: 00840413 addi s0,s0,8
while ( table_entry->type && !stop ) {
4000372c: fe0516e3 bnez a0,40003718 <rtems_filesystem_get_mount_handler+0x2c>
return _Chain_Immutable_head( the_chain )->next;
40003730: 40020937 lui s2,0x40020
40003734: 74490913 addi s2,s2,1860 # 40020744 <filesystem_chain>
rtems_libio_lock();
40003738: fe0ff0ef jal ra,40002f18 <rtems_libio_lock>
4000373c: 00092403 lw s0,0(s2)
for (
40003740: 00490913 addi s2,s2,4
40003744: 07240463 beq s0,s2,400037ac <rtems_filesystem_get_mount_handler+0xc0>
if ( strcmp( entry->type, fa->type ) != 0 ) {
40003748: 00842503 lw a0,8(s0) <== NOT EXECUTED
4000374c: 00048593 mv a1,s1 <== NOT EXECUTED
40003750: 399110ef jal ra,400152e8 <strcmp> <== NOT EXECUTED
40003754: 04051863 bnez a0,400037a4 <rtems_filesystem_get_mount_handler+0xb8><== NOT EXECUTED
fa->mount_h = entry->mount_h;
40003758: 00c42503 lw a0,12(s0) <== NOT EXECUTED
return &the_chain->Tail.Node;
4000375c: 00a12623 sw a0,12(sp)
rtems_libio_unlock();
40003760: fc4ff0ef jal ra,40002f24 <rtems_libio_unlock>
rtems_filesystem_iterate( find_handler, &fa );
}
return fa.mount_h;
}
40003764: 01c12083 lw ra,28(sp)
40003768: 01812403 lw s0,24(sp)
return fa.mount_h;
4000376c: 00c12503 lw a0,12(sp)
}
40003770: 01412483 lw s1,20(sp)
40003774: 01012903 lw s2,16(sp)
40003778: 02010113 addi sp,sp,32
4000377c: 00008067 ret
fa->mount_h = entry->mount_h;
40003780: 00442503 lw a0,4(s0)
}
40003784: 01c12083 lw ra,28(sp)
40003788: 01812403 lw s0,24(sp)
4000378c: 01412483 lw s1,20(sp)
40003790: 01012903 lw s2,16(sp)
40003794: 02010113 addi sp,sp,32
40003798: 00008067 ret
find_arg fa = {
4000379c: 00000513 li a0,0 <== NOT EXECUTED
}
400037a0: 00008067 ret <== NOT EXECUTED
return the_node->next;
400037a4: 00042403 lw s0,0(s0) <== NOT EXECUTED
for (
400037a8: fb2410e3 bne s0,s2,40003748 <rtems_filesystem_get_mount_handler+0x5c><== NOT EXECUTED
find_arg fa = {
400037ac: 00000513 li a0,0
400037b0: fadff06f j 4000375c <rtems_filesystem_get_mount_handler+0x70>
40004838 <rtems_filesystem_global_location_assign>:
__asm__ volatile (
40004838: 300477f3 csrrci a5,mstatus,8
{
rtems_filesystem_mt_entry_declare_lock_context(lock_context);
rtems_filesystem_global_location_t *lhs_global_loc;
rtems_filesystem_mt_entry_lock(lock_context);
lhs_global_loc = *lhs_global_loc_ptr;
4000483c: 00052703 lw a4,0(a0)
*lhs_global_loc_ptr = rhs_global_loc;
40004840: 00b52023 sw a1,0(a0)
return mstatus & RISCV_MSTATUS_MIE;
40004844: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004848: 3007a073 csrs mstatus,a5
__asm__ volatile (
4000484c: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004850: 0087f793 andi a5,a5,8
} else {
rtems_interrupt_lock_context lock_context;
rtems_interrupt_lock_acquire(&deferred_release_lock, &lock_context);
if (global_loc->deferred_released_count == 0) {
40004854: 02072683 lw a3,32(a4)
40004858: 02069263 bnez a3,4000487c <rtems_filesystem_global_location_assign+0x44>
rtems_filesystem_global_location_t *head =
4000485c: 92018693 addi a3,gp,-1760 # 40020d60 <deferred_released_global_locations>
40004860: 0006a603 lw a2,0(a3)
deferred_released_global_locations;
global_loc->deferred_released_count = 1;
40004864: 00100593 li a1,1
40004868: 02b72023 sw a1,32(a4)
global_loc->deferred_released_next = head;
4000486c: 00c72e23 sw a2,28(a4)
deferred_released_global_locations = global_loc;
40004870: 00e6a023 sw a4,0(a3)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004874: 3007a073 csrs mstatus,a5
}
40004878: 00008067 ret
} else {
++global_loc->deferred_released_count;
4000487c: 00168693 addi a3,a3,1
40004880: 02d72023 sw a3,32(a4)
40004884: 3007a073 csrs mstatus,a5
}
40004888: 00008067 ret
400049c8 <rtems_filesystem_global_location_obtain>:
{
400049c8: ff010113 addi sp,sp,-16
400049cc: 00812423 sw s0,8(sp)
if (deferred_released_global_locations != NULL) {
400049d0: 92018413 addi s0,gp,-1760 # 40020d60 <deferred_released_global_locations>
400049d4: 00042783 lw a5,0(s0)
{
400049d8: 00912223 sw s1,4(sp)
400049dc: 00112623 sw ra,12(sp)
400049e0: 00050493 mv s1,a0
if (deferred_released_global_locations != NULL) {
400049e4: 04078a63 beqz a5,40004a38 <rtems_filesystem_global_location_obtain+0x70>
__asm__ volatile (
400049e8: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400049ec: 0087f793 andi a5,a5,8
current = deferred_released_global_locations;
400049f0: 00042503 lw a0,0(s0)
int count = 0;
400049f4: 00000593 li a1,0
if (current != NULL) {
400049f8: 00050c63 beqz a0,40004a10 <rtems_filesystem_global_location_obtain+0x48>
deferred_released_global_locations = current->deferred_released_next;
400049fc: 01c52703 lw a4,28(a0)
count = current->deferred_released_count;
40004a00: 02052583 lw a1,32(a0)
current->deferred_released_next = NULL;
40004a04: 00052e23 sw zero,28(a0)
deferred_released_global_locations = current->deferred_released_next;
40004a08: 00e42023 sw a4,0(s0)
current->deferred_released_count = 0;
40004a0c: 02052023 sw zero,32(a0)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004a10: 3007a073 csrs mstatus,a5
if (current != NULL) {
40004a14: 02050263 beqz a0,40004a38 <rtems_filesystem_global_location_obtain+0x70>
release_with_count(current, count);
40004a18: eedff0ef jal ra,40004904 <release_with_count>
__asm__ volatile (
40004a1c: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004a20: 0087f793 andi a5,a5,8
current = deferred_released_global_locations;
40004a24: 00042503 lw a0,0(s0)
int count = 0;
40004a28: 00000593 li a1,0
if (current != NULL) {
40004a2c: fc0518e3 bnez a0,400049fc <rtems_filesystem_global_location_obtain+0x34>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004a30: 3007a073 csrs mstatus,a5
if (current != NULL) {
40004a34: fe0512e3 bnez a0,40004a18 <rtems_filesystem_global_location_obtain+0x50>
__asm__ volatile (
40004a38: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004a3c: 0087f413 andi s0,a5,8
global_loc = *global_loc_ptr;
40004a40: 0004a503 lw a0,0(s1)
if (global_loc == NULL || !global_loc->location.mt_entry->mounted) {
40004a44: 00050863 beqz a0,40004a54 <rtems_filesystem_global_location_obtain+0x8c>
40004a48: 01452783 lw a5,20(a0)
40004a4c: 0287c783 lbu a5,40(a5)
40004a50: 00079c63 bnez a5,40004a68 <rtems_filesystem_global_location_obtain+0xa0>
errno = ENXIO;
40004a54: 4750f0ef jal ra,400146c8 <__errno>
40004a58: 00600793 li a5,6 <== NOT EXECUTED
40004a5c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
global_loc = &rtems_filesystem_global_location_null;
40004a60: 40020537 lui a0,0x40020 <== NOT EXECUTED
40004a64: 75050513 addi a0,a0,1872 # 40020750 <rtems_filesystem_global_location_null><== NOT EXECUTED
++global_loc->reference_count;
40004a68: 01852783 lw a5,24(a0) <== NOT EXECUTED
40004a6c: 00178793 addi a5,a5,1
40004a70: 00f52c23 sw a5,24(a0)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004a74: 30042073 csrs mstatus,s0
}
40004a78: 00c12083 lw ra,12(sp)
40004a7c: 00812403 lw s0,8(sp)
40004a80: 00412483 lw s1,4(sp)
40004a84: 01010113 addi sp,sp,16
40004a88: 00008067 ret
40004a8c <rtems_filesystem_global_location_release>:
if (!deferred) {
40004a8c: 04058263 beqz a1,40004ad0 <rtems_filesystem_global_location_release+0x44><== NOT EXECUTED
__asm__ volatile (
40004a90: 30047773 csrrci a4,mstatus,8 <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
40004a94: 00877713 andi a4,a4,8 <== NOT EXECUTED
if (global_loc->deferred_released_count == 0) {
40004a98: 02052683 lw a3,32(a0) <== NOT EXECUTED
40004a9c: 00068a63 beqz a3,40004ab0 <rtems_filesystem_global_location_release+0x24><== NOT EXECUTED
++global_loc->deferred_released_count;
40004aa0: 00168693 addi a3,a3,1 <== NOT EXECUTED
40004aa4: 02d52023 sw a3,32(a0) <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004aa8: 30072073 csrs mstatus,a4 <== NOT EXECUTED
}
40004aac: 00008067 ret <== NOT EXECUTED
rtems_filesystem_global_location_t *head =
40004ab0: 92018693 addi a3,gp,-1760 # 40020d60 <deferred_released_global_locations><== NOT EXECUTED
40004ab4: 0006a603 lw a2,0(a3) <== NOT EXECUTED
global_loc->deferred_released_count = 1;
40004ab8: 00100593 li a1,1 <== NOT EXECUTED
40004abc: 02b52023 sw a1,32(a0) <== NOT EXECUTED
global_loc->deferred_released_next = head;
40004ac0: 00c52e23 sw a2,28(a0) <== NOT EXECUTED
deferred_released_global_locations = global_loc;
40004ac4: 00a6a023 sw a0,0(a3) <== NOT EXECUTED
40004ac8: 30072073 csrs mstatus,a4 <== NOT EXECUTED
}
40004acc: 00008067 ret <== NOT EXECUTED
release_with_count(global_loc, 1);
40004ad0: 00100593 li a1,1 <== NOT EXECUTED
40004ad4: e31ff06f j 40004904 <release_with_count> <== NOT EXECUTED
40002820 <rtems_filesystem_initialize>:
{
int rv = 0;
const rtems_filesystem_mount_configuration *root_config =
&rtems_filesystem_root_configuration;
rv = mount(
40002820: 4001e7b7 lui a5,0x4001e
40002824: 51078793 addi a5,a5,1296 # 4001e510 <rtems_filesystem_root_configuration>
40002828: 0107a703 lw a4,16(a5)
4000282c: 00c7a683 lw a3,12(a5)
40002830: 0087a603 lw a2,8(a5)
40002834: 0047a583 lw a1,4(a5)
40002838: 0007a503 lw a0,0(a5)
{
4000283c: ff010113 addi sp,sp,-16
40002840: 00112623 sw ra,12(sp)
rv = mount(
40002844: 351000ef jal ra,40003394 <mount>
root_config->target,
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
40002848: 02051263 bnez a0,4000286c <rtems_filesystem_initialize+0x4c> <== NEVER TAKEN
* Traditionally RTEMS devices are under "/dev" so install this directory.
*
* If the mkdir() fails, we can't print anything so just fatal error.
*/
rv = mkdir( "/dev", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH );
4000284c: 4001f537 lui a0,0x4001f
40002850: 1ed00593 li a1,493
40002854: 91450513 addi a0,a0,-1772 # 4001e914 <rtems_blkdev_imfs_node+0x70>
40002858: 1a9000ef jal ra,40003200 <mkdir>
if ( rv != 0 )
4000285c: 00051e63 bnez a0,40002878 <rtems_filesystem_initialize+0x58> <== NEVER TAKEN
* it will be mounted onto is created. Moreover, if it is going to
* use a device, then it is REALLY unfair to attempt this
* before device drivers are initialized. So we return via a base
* filesystem image and nothing auto-mounted at this point.
*/
}
40002860: 00c12083 lw ra,12(sp)
40002864: 01010113 addi sp,sp,16
40002868: 00008067 ret
rtems_fatal_error_occurred( 0xABCD0002 );
4000286c: abcd0537 lui a0,0xabcd0 <== NOT EXECUTED
40002870: 00250513 addi a0,a0,2 # abcd0002 <RamEnd+0x6acd0002> <== NOT EXECUTED
40002874: 015040ef jal ra,40007088 <rtems_fatal_error_occurred> <== NOT EXECUTED
rtems_fatal_error_occurred( 0xABCD0003 );
40002878: abcd0537 lui a0,0xabcd0 <== NOT EXECUTED
4000287c: 00350513 addi a0,a0,3 # abcd0003 <RamEnd+0x6acd0003> <== NOT EXECUTED
40002880: 009040ef jal ra,40007088 <rtems_fatal_error_occurred> <== NOT EXECUTED
40004ad8 <rtems_filesystem_location_remove_from_mt_entry>:
__asm__ volatile (
40004ad8: 30047773 csrrci a4,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004adc: 00877713 andi a4,a4,8
do_unmount = rtems_filesystem_is_ready_for_unmount(loc->mt_entry);
40004ae0: 01452783 lw a5,20(a0)
next = the_node->next;
40004ae4: 00052603 lw a2,0(a0)
previous = the_node->previous;
40004ae8: 00452683 lw a3,4(a0)
40004aec: 0287c583 lbu a1,40(a5)
next->previous = previous;
40004af0: 00d62223 sw a3,4(a2)
previous->next = next;
40004af4: 00c6a023 sw a2,0(a3)
40004af8: 00059863 bnez a1,40004b08 <rtems_filesystem_location_remove_from_mt_entry+0x30>
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
40004afc: 0147a603 lw a2,20(a5)
40004b00: 01c7a683 lw a3,28(a5)
40004b04: 00d60663 beq a2,a3,40004b10 <rtems_filesystem_location_remove_from_mt_entry+0x38>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004b08: 30072073 csrs mstatus,a4
}
40004b0c: 00008067 ret
&& mt_entry->mt_fs_root->reference_count == 1;
40004b10: 0247a603 lw a2,36(a5)
40004b14: 00100693 li a3,1
40004b18: 01862603 lw a2,24(a2)
40004b1c: fed616e3 bne a2,a3,40004b08 <rtems_filesystem_location_remove_from_mt_entry+0x30>
return &the_chain->Tail.Node;
40004b20: 01478693 addi a3,a5,20 <== NOT EXECUTED
40004b24: 01878613 addi a2,a5,24 <== NOT EXECUTED
head->next = tail;
40004b28: 00c7aa23 sw a2,20(a5) <== NOT EXECUTED
head->previous = NULL;
40004b2c: 0007ac23 sw zero,24(a5) <== NOT EXECUTED
tail->previous = head;
40004b30: 00d7ae23 sw a3,28(a5) <== NOT EXECUTED
40004b34: 30072073 csrs mstatus,a4 <== NOT EXECUTED
rtems_filesystem_do_unmount(loc->mt_entry);
40004b38: 01452503 lw a0,20(a0) <== NOT EXECUTED
40004b3c: d51ff06f j 4000488c <rtems_filesystem_do_unmount> <== NOT EXECUTED
40004c00 <rtems_filesystem_location_transform_to_global>:
{
40004c00: fe010113 addi sp,sp,-32
40004c04: 00912a23 sw s1,20(sp)
40004c08: 00050493 mv s1,a0
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
40004c0c: 02400513 li a0,36
{
40004c10: 00112e23 sw ra,28(sp)
40004c14: 00812c23 sw s0,24(sp)
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
40004c18: becfe0ef jal ra,40003004 <malloc>
if (global_loc != NULL) {
40004c1c: 08050063 beqz a0,40004c9c <rtems_filesystem_location_transform_to_global+0x9c><== NEVER TAKEN
dst->node_access = src->node_access;
40004c20: 0084a603 lw a2,8(s1)
dst->node_access_2 = src->node_access_2;
40004c24: 00c4a683 lw a3,12(s1)
dst->handlers = src->handlers;
40004c28: 0104a703 lw a4,16(s1)
dst->mt_entry = src->mt_entry;
40004c2c: 0144a783 lw a5,20(s1)
global_loc->reference_count = 1;
40004c30: 00100593 li a1,1
40004c34: 00050413 mv s0,a0
40004c38: 00b52c23 sw a1,24(a0)
global_loc->deferred_released_next = NULL;
40004c3c: 00052e23 sw zero,28(a0)
global_loc->deferred_released_count = 0;
40004c40: 02052023 sw zero,32(a0)
dst->node_access = src->node_access;
40004c44: 00c52423 sw a2,8(a0)
dst->node_access_2 = src->node_access_2;
40004c48: 00d52623 sw a3,12(a0)
dst->handlers = src->handlers;
40004c4c: 00e52823 sw a4,16(a0)
dst->mt_entry = src->mt_entry;
40004c50: 00f52a23 sw a5,20(a0)
__asm__ volatile (
40004c54: 300477f3 csrrci a5,mstatus,8
40004c58: 01452703 lw a4,20(a0)
old_last = tail->previous;
40004c5c: 01c72683 lw a3,28(a4)
return &the_chain->Tail.Node;
40004c60: 01870613 addi a2,a4,24
the_node->next = tail;
40004c64: 00c52023 sw a2,0(a0)
tail->previous = the_node;
40004c68: 00a72e23 sw a0,28(a4)
old_last->next = the_node;
40004c6c: 00a6a023 sw a0,0(a3)
the_node->previous = old_last;
40004c70: 00d52223 sw a3,4(a0)
return mstatus & RISCV_MSTATUS_MIE;
40004c74: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004c78: 3007a073 csrs mstatus,a5
rtems_filesystem_location_remove_from_mt_entry(loc);
40004c7c: 00048513 mv a0,s1
40004c80: e59ff0ef jal ra,40004ad8 <rtems_filesystem_location_remove_from_mt_entry>
}
40004c84: 01c12083 lw ra,28(sp)
40004c88: 00040513 mv a0,s0
40004c8c: 01812403 lw s0,24(sp)
40004c90: 01412483 lw s1,20(sp)
40004c94: 02010113 addi sp,sp,32
40004c98: 00008067 ret
rtems_filesystem_location_free(loc);
40004c9c: 00048513 mv a0,s1 <== NOT EXECUTED
40004ca0: 585090ef jal ra,4000ea24 <rtems_filesystem_location_free> <== NOT EXECUTED
return rtems_filesystem_global_location_obtain( &global_loc );
40004ca4: 00c10513 addi a0,sp,12 <== NOT EXECUTED
rtems_filesystem_global_location_t *global_loc = NULL;
40004ca8: 00012623 sw zero,12(sp) <== NOT EXECUTED
return rtems_filesystem_global_location_obtain( &global_loc );
40004cac: d1dff0ef jal ra,400049c8 <rtems_filesystem_global_location_obtain> <== NOT EXECUTED
40004cb0: 00050413 mv s0,a0 <== NOT EXECUTED
errno = ENOMEM;
40004cb4: 2150f0ef jal ra,400146c8 <__errno> <== NOT EXECUTED
40004cb8: 00c00793 li a5,12 <== NOT EXECUTED
40004cbc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return global_loc;
40004cc0: fc5ff06f j 40004c84 <rtems_filesystem_location_transform_to_global+0x84><== NOT EXECUTED
40003214 <rtems_filesystem_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
40003214: fe010113 addi sp,sp,-32
40003218: 00812c23 sw s0,24(sp)
4000321c: 00912a23 sw s1,20(sp)
40003220: 01212823 sw s2,16(sp)
40003224: 01312623 sw s3,12(sp)
40003228: 01412423 sw s4,8(sp)
4000322c: 01512223 sw s5,4(sp)
40003230: 00068493 mv s1,a3
40003234: 00078993 mv s3,a5
40003238: 00112e23 sw ra,28(sp)
4000323c: 00050413 mv s0,a0
40003240: 00058913 mv s2,a1
40003244: 00060a93 mv s5,a2
40003248: 00070a13 mv s4,a4
int rv = 0;
mode &= ~rtems_filesystem_umask;
4000324c: 389010ef jal ra,40004dd4 <rtems_current_user_env_get>
40003250: 00852803 lw a6,8(a0)
switch (mode & S_IFMT) {
40003254: 000047b7 lui a5,0x4
mode &= ~rtems_filesystem_umask;
40003258: fff84813 not a6,a6
4000325c: 009876b3 and a3,a6,s1
switch (mode & S_IFMT) {
40003260: 0000f837 lui a6,0xf
40003264: 0106f833 and a6,a3,a6
40003268: 06f80263 beq a6,a5,400032cc <rtems_filesystem_mknod+0xb8>
4000326c: 0507f663 bgeu a5,a6,400032b8 <rtems_filesystem_mknod+0xa4>
40003270: ffffa7b7 lui a5,0xffffa
40003274: 00f80833 add a6,a6,a5
40003278: ffffd7b7 lui a5,0xffffd
4000327c: 00f87833 and a6,a6,a5
40003280: 04080663 beqz a6,400032cc <rtems_filesystem_mknod+0xb8> <== ALWAYS TAKEN
case S_IFDIR:
case S_IFIFO:
case S_IFREG:
break;
default:
errno = EINVAL;
40003284: 444110ef jal ra,400146c8 <__errno>
rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
}
return rv;
}
40003288: 01c12083 lw ra,28(sp)
4000328c: 01812403 lw s0,24(sp)
errno = EINVAL;
40003290: 01600793 li a5,22
40003294: 00f52023 sw a5,0(a0)
}
40003298: 01412483 lw s1,20(sp)
4000329c: 01012903 lw s2,16(sp)
400032a0: 00c12983 lw s3,12(sp)
400032a4: 00812a03 lw s4,8(sp)
400032a8: 00412a83 lw s5,4(sp)
400032ac: fff00513 li a0,-1
400032b0: 02010113 addi sp,sp,32
400032b4: 00008067 ret
switch (mode & S_IFMT) {
400032b8: fffff8b7 lui a7,0xfffff
400032bc: 01180833 add a6,a6,a7
400032c0: fff88893 addi a7,a7,-1 # ffffefff <RamEnd+0xbeffefff>
400032c4: 01187833 and a6,a6,a7
400032c8: fa081ee3 bnez a6,40003284 <rtems_filesystem_mknod+0x70>
const rtems_filesystem_operations_table *ops = parentloc->mt_entry->ops;
400032cc: 01442603 lw a2,20(s0)
rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
400032d0: 00040513 mv a0,s0
}
400032d4: 01812403 lw s0,24(sp)
rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
400032d8: 00c62583 lw a1,12(a2)
}
400032dc: 01c12083 lw ra,28(sp)
400032e0: 01412483 lw s1,20(sp)
rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
400032e4: 0145a803 lw a6,20(a1)
400032e8: 000a0713 mv a4,s4
400032ec: 00098793 mv a5,s3
}
400032f0: 00812a03 lw s4,8(sp)
400032f4: 00c12983 lw s3,12(sp)
rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
400032f8: 000a8613 mv a2,s5
400032fc: 00090593 mv a1,s2
}
40003300: 00412a83 lw s5,4(sp)
40003304: 01012903 lw s2,16(sp)
40003308: 02010113 addi sp,sp,32
rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
4000330c: 00080067 jr a6 # f000 <bsp_section_bss_size+0xc348>
40000bfc <rtems_filesystem_register>:
int
rtems_filesystem_register(
const char *type,
rtems_filesystem_fsmount_me_t mount_h
)
{
40000bfc: fe010113 addi sp,sp,-32
40000c00: 00812c23 sw s0,24(sp)
40000c04: 01212823 sw s2,16(sp)
40000c08: 01312623 sw s3,12(sp)
40000c0c: 00112e23 sw ra,28(sp)
40000c10: 00912a23 sw s1,20(sp)
40000c14: 01412423 sw s4,8(sp)
40000c18: 00050913 mv s2,a0
40000c1c: 00058993 mv s3,a1
rtems_chain_control *chain = &filesystem_chain;
size_t type_size = strlen(type) + 1;
40000c20: 50c0d0ef jal ra,4000e12c <strlen>
40000c24: 00050613 mv a2,a0
size_t fsn_size = sizeof( filesystem_node ) + type_size;
filesystem_node *fsn = malloc( fsn_size );
40000c28: 01150513 addi a0,a0,17
size_t type_size = strlen(type) + 1;
40000c2c: 00160413 addi s0,a2,1
filesystem_node *fsn = malloc( fsn_size );
40000c30: 23c060ef jal ra,40006e6c <malloc>
char *type_storage = (char *) fsn + sizeof( *fsn );
if ( fsn == NULL )
40000c34: 10050863 beqz a0,40000d44 <rtems_filesystem_register+0x148>
rtems_set_errno_and_return_minus_one( ENOMEM );
memcpy(type_storage, type, type_size);
40000c38: 01050793 addi a5,a0,16
40000c3c: 00050493 mv s1,a0
40000c40: 00040613 mv a2,s0
40000c44: 00090593 mv a1,s2
40000c48: 00078513 mv a0,a5
40000c4c: 6190c0ef jal ra,4000da64 <memcpy>
fsn->entry.type = type_storage;
40000c50: 00a4a423 sw a0,8(s1)
fsn->entry.mount_h = mount_h;
40000c54: 0134a623 sw s3,12(s1)
rtems_libio_lock();
40000c58: 1fc060ef jal ra,40006e54 <rtems_libio_lock>
while ( table_entry->type && !stop ) {
40000c5c: 4000f437 lui s0,0x4000f
40000c60: c7042503 lw a0,-912(s0) # 4000ec70 <rtems_filesystem_table>
40000c64: 02050063 beqz a0,40000c84 <rtems_filesystem_register+0x88> <== NEVER TAKEN
40000c68: c7040413 addi s0,s0,-912
if ( strcmp( entry->type, fa->type ) != 0 ) {
40000c6c: 00090593 mv a1,s2
40000c70: 1840d0ef jal ra,4000ddf4 <strcmp>
40000c74: 08050863 beqz a0,40000d04 <rtems_filesystem_register+0x108> <== NEVER TAKEN
while ( table_entry->type && !stop ) {
40000c78: 00842503 lw a0,8(s0)
++table_entry;
40000c7c: 00840413 addi s0,s0,8
while ( table_entry->type && !stop ) {
40000c80: fe0516e3 bnez a0,40000c6c <rtems_filesystem_register+0x70> <== NEVER TAKEN
return _Chain_Immutable_head( the_chain )->next;
40000c84: 40010437 lui s0,0x40010
40000c88: 39440413 addi s0,s0,916 # 40010394 <filesystem_chain>
rtems_libio_lock();
40000c8c: 1c8060ef jal ra,40006e54 <rtems_libio_lock>
40000c90: 00042a03 lw s4,0(s0)
for (
40000c94: 00440993 addi s3,s0,4
40000c98: 0b3a0263 beq s4,s3,40000d3c <rtems_filesystem_register+0x140>
if ( strcmp( entry->type, fa->type ) != 0 ) {
40000c9c: 008a2503 lw a0,8(s4)
40000ca0: 00090593 mv a1,s2
40000ca4: 1500d0ef jal ra,4000ddf4 <strcmp>
40000ca8: 06051263 bnez a0,40000d0c <rtems_filesystem_register+0x110>
fa->mount_h = entry->mount_h;
40000cac: 00ca2403 lw s0,12(s4)
rtems_libio_unlock();
40000cb0: 1b0060ef jal ra,40006e60 <rtems_libio_unlock>
if ( rtems_filesystem_get_mount_handler( type ) == NULL ) {
40000cb4: 06041463 bnez s0,40000d1c <rtems_filesystem_register+0x120>
40000cb8: 40010437 lui s0,0x40010
40000cbc: 400109b7 lui s3,0x40010
40000cc0: 39440413 addi s0,s0,916 # 40010394 <filesystem_chain>
40000cc4: 39898993 addi s3,s3,920 # 40010398 <filesystem_chain+0x4>
old_last = tail->previous;
40000cc8: 00842783 lw a5,8(s0)
the_node->next = tail;
40000ccc: 0134a023 sw s3,0(s1)
tail->previous = the_node;
40000cd0: 00942423 sw s1,8(s0)
old_last->next = the_node;
40000cd4: 0097a023 sw s1,0(a5)
the_node->previous = old_last;
40000cd8: 00f4a223 sw a5,4(s1)
rtems_libio_unlock();
free( fsn );
rtems_set_errno_and_return_minus_one( EINVAL );
}
rtems_libio_unlock();
40000cdc: 184060ef jal ra,40006e60 <rtems_libio_unlock>
return 0;
40000ce0: 00000513 li a0,0
}
40000ce4: 01c12083 lw ra,28(sp)
40000ce8: 01812403 lw s0,24(sp)
40000cec: 01412483 lw s1,20(sp)
40000cf0: 01012903 lw s2,16(sp)
40000cf4: 00c12983 lw s3,12(sp)
40000cf8: 00812a03 lw s4,8(sp)
40000cfc: 02010113 addi sp,sp,32
40000d00: 00008067 ret
fa->mount_h = entry->mount_h;
40000d04: 00442403 lw s0,4(s0) <== NOT EXECUTED
if ( !stop ) {
40000d08: fadff06f j 40000cb4 <rtems_filesystem_register+0xb8> <== NOT EXECUTED
return the_node->next;
40000d0c: 000a2a03 lw s4,0(s4)
for (
40000d10: f93a16e3 bne s4,s3,40000c9c <rtems_filesystem_register+0xa0>
find_arg fa = {
40000d14: 00000413 li s0,0
40000d18: f99ff06f j 40000cb0 <rtems_filesystem_register+0xb4>
rtems_libio_unlock();
40000d1c: 144060ef jal ra,40006e60 <rtems_libio_unlock>
free( fsn );
40000d20: 00048513 mv a0,s1
40000d24: 74d050ef jal ra,40006c70 <free>
rtems_set_errno_and_return_minus_one( EINVAL );
40000d28: 4110c0ef jal ra,4000d938 <__errno>
40000d2c: 01600793 li a5,22
40000d30: 00f52023 sw a5,0(a0)
40000d34: fff00513 li a0,-1
40000d38: fadff06f j 40000ce4 <rtems_filesystem_register+0xe8>
rtems_libio_unlock();
40000d3c: 124060ef jal ra,40006e60 <rtems_libio_unlock>
return fa.mount_h;
40000d40: f89ff06f j 40000cc8 <rtems_filesystem_register+0xcc>
rtems_set_errno_and_return_minus_one( ENOMEM );
40000d44: 3f50c0ef jal ra,4000d938 <__errno>
40000d48: 00c00793 li a5,12
40000d4c: 00f52023 sw a5,0(a0)
40000d50: fff00513 li a0,-1
40000d54: f91ff06f j 40000ce4 <rtems_filesystem_register+0xe8>
40000900 <rtems_gxx_key_create>:
}
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
40000900: ff010113 addi sp,sp,-16
40000904: 01212023 sw s2,0(sp)
40000908: 00050913 mv s2,a0
int eno;
pthread_key_t *pkey;
pkey = malloc( sizeof( *pkey ) );
4000090c: 00400513 li a0,4
{
40000910: 00912223 sw s1,4(sp)
40000914: 00112623 sw ra,12(sp)
40000918: 00812423 sw s0,8(sp)
4000091c: 00058493 mv s1,a1
pkey = malloc( sizeof( *pkey ) );
40000920: 2c0000ef jal ra,40000be0 <malloc>
*key = pkey;
40000924: 00a92023 sw a0,0(s2)
if ( pkey == NULL )
40000928: 04050e63 beqz a0,40000984 <rtems_gxx_key_create+0x84> <== NEVER TAKEN
printk(
"gxx_wrappers: create key=%x, dtor=%x, pkey=%x\n", key, dtor, pkey
);
#endif
eno = pthread_key_create(pkey, dtor);
4000092c: 00048593 mv a1,s1
40000930: 00050413 mv s0,a0
40000934: 654030ef jal ra,40003f88 <pthread_key_create>
40000938: 00050493 mv s1,a0
if ( eno != 0 ) {
4000093c: 02051063 bnez a0,4000095c <rtems_gxx_key_create+0x5c> <== NEVER TAKEN
free( pkey );
*key = NULL;
}
return eno;
}
40000940: 00c12083 lw ra,12(sp)
40000944: 00812403 lw s0,8(sp)
40000948: 00012903 lw s2,0(sp)
4000094c: 00048513 mv a0,s1
40000950: 00412483 lw s1,4(sp)
40000954: 01010113 addi sp,sp,16
40000958: 00008067 ret
free( pkey );
4000095c: 00040513 mv a0,s0 <== NOT EXECUTED
40000960: 2ec090ef jal ra,40009c4c <free> <== NOT EXECUTED
}
40000964: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40000968: 00812403 lw s0,8(sp) <== NOT EXECUTED
*key = NULL;
4000096c: 00092023 sw zero,0(s2) <== NOT EXECUTED
}
40000970: 00048513 mv a0,s1 <== NOT EXECUTED
40000974: 00012903 lw s2,0(sp) <== NOT EXECUTED
40000978: 00412483 lw s1,4(sp) <== NOT EXECUTED
4000097c: 01010113 addi sp,sp,16 <== NOT EXECUTED
40000980: 00008067 ret <== NOT EXECUTED
return ENOMEM;
40000984: 00c00493 li s1,12 <== NOT EXECUTED
40000988: fb9ff06f j 40000940 <rtems_gxx_key_create+0x40> <== NOT EXECUTED
40000b28 <rtems_gxx_recursive_mutex_init>:
void rtems_gxx_recursive_mutex_init(__gthread_recursive_mutex_t *mutex)
{
40000b28: 00050713 mv a4,a0
status = rtems_semaphore_create(
40000b2c: 47434537 lui a0,0x47434
{
40000b30: ff010113 addi sp,sp,-16
status = rtems_semaphore_create(
40000b34: 00000693 li a3,0
40000b38: 05400613 li a2,84
40000b3c: 00100593 li a1,1
40000b40: 33250513 addi a0,a0,818 # 47434332 <RamEnd+0x6434332>
{
40000b44: 00112623 sw ra,12(sp)
status = rtems_semaphore_create(
40000b48: 041030ef jal ra,40004388 <rtems_semaphore_create>
if ( status != RTEMS_SUCCESSFUL ) {
40000b4c: 00051863 bnez a0,40000b5c <rtems_gxx_recursive_mutex_init+0x34> <== NEVER TAKEN
rtems_gxx_mutex_init(mutex);
}
40000b50: 00c12083 lw ra,12(sp)
40000b54: 01010113 addi sp,sp,16
40000b58: 00008067 ret
_Internal_error( INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED );
40000b5c: 01600513 li a0,22 <== NOT EXECUTED
40000b60: 3f5040ef jal ra,40005754 <_Internal_error> <== NOT EXECUTED
40003080 <rtems_heap_allocate_aligned_with_boundary>:
40003080: 9341a783 lw a5,-1740(gp) # 40020d74 <_System_state_Current>
void *rtems_heap_allocate_aligned_with_boundary(
size_t size,
uintptr_t alignment,
uintptr_t boundary
)
{
40003084: fe010113 addi sp,sp,-32
40003088: 00912a23 sw s1,20(sp)
4000308c: 01212823 sw s2,16(sp)
40003090: 01312623 sw s3,12(sp)
40003094: 01412423 sw s4,8(sp)
40003098: 00112e23 sw ra,28(sp)
4000309c: 00812c23 sw s0,24(sp)
if ( _System_state_Is_up( state ) ) {
400030a0: 00200713 li a4,2
Heap_Control *heap = RTEMS_Malloc_Heap;
400030a4: 91c1aa03 lw s4,-1764(gp) # 40020d5c <RTEMS_Malloc_Heap>
{
400030a8: 00050913 mv s2,a0
400030ac: 00058493 mv s1,a1
400030b0: 00060993 mv s3,a2
if ( _System_state_Is_up( state ) ) {
400030b4: 06e78063 beq a5,a4,40003114 <rtems_heap_allocate_aligned_with_boundary+0x94>
} else if ( _System_state_Is_before_multitasking( state ) ) {
400030b8: 00100713 li a4,1
400030bc: 06e78463 beq a5,a4,40003124 <rtems_heap_allocate_aligned_with_boundary+0xa4>
boundary
);
_RTEMS_Unlock_allocator();
break;
case MALLOC_SYSTEM_STATE_NO_PROTECTION:
p = _Heap_Allocate_aligned_with_boundary(
400030c0: 00060693 mv a3,a2
400030c4: 00058613 mv a2,a1
400030c8: 00050593 mv a1,a0
400030cc: 000a0513 mv a0,s4
400030d0: 180040ef jal ra,40007250 <_Heap_Allocate_aligned_with_boundary>
400030d4: 00050413 mv s0,a0
* Do not attempt to allocate memory if not in correct system state.
*/
return NULL;
}
if ( p == NULL && alignment == 0 && boundary == 0 ) {
400030d8: 06040a63 beqz s0,4000314c <rtems_heap_allocate_aligned_with_boundary+0xcc>
}
/*
* If the user wants us to dirty the allocated memory, then do it.
*/
if ( p != NULL && rtems_malloc_dirty_helper != NULL )
400030dc: 9181a783 lw a5,-1768(gp) # 40020d58 <rtems_malloc_dirty_helper>
400030e0: 00078863 beqz a5,400030f0 <rtems_heap_allocate_aligned_with_boundary+0x70><== NEVER TAKEN
(*rtems_malloc_dirty_helper)( p, size );
400030e4: 00090593 mv a1,s2
400030e8: 00040513 mv a0,s0
400030ec: 000780e7 jalr a5
return p;
}
400030f0: 01c12083 lw ra,28(sp) <== NOT EXECUTED
400030f4: 00040513 mv a0,s0 <== NOT EXECUTED
400030f8: 01812403 lw s0,24(sp) <== NOT EXECUTED
400030fc: 01412483 lw s1,20(sp)
40003100: 01012903 lw s2,16(sp)
40003104: 00c12983 lw s3,12(sp)
40003108: 00812a03 lw s4,8(sp)
4000310c: 02010113 addi sp,sp,32
40003110: 00008067 ret
40003114: 400237b7 lui a5,0x40023
40003118: f8078793 addi a5,a5,-128 # 40022f80 <_Per_CPU_Information>
4000311c: 0307a783 lw a5,48(a5)
if ( _Thread_Dispatch_is_enabled() ) {
40003120: 04079663 bnez a5,4000316c <rtems_heap_allocate_aligned_with_boundary+0xec>
_RTEMS_Lock_allocator();
40003124: 010040ef jal ra,40007134 <_RTEMS_Lock_allocator>
_Malloc_Process_deferred_frees();
40003128: a11ff0ef jal ra,40002b38 <_Malloc_Process_deferred_frees>
p = _Heap_Allocate_aligned_with_boundary(
4000312c: 00098693 mv a3,s3
40003130: 00048613 mv a2,s1
40003134: 00090593 mv a1,s2
40003138: 000a0513 mv a0,s4
4000313c: 114040ef jal ra,40007250 <_Heap_Allocate_aligned_with_boundary>
40003140: 00050413 mv s0,a0
_RTEMS_Unlock_allocator();
40003144: 7fd030ef jal ra,40007140 <_RTEMS_Unlock_allocator>
if ( p == NULL && alignment == 0 && boundary == 0 ) {
40003148: f8041ae3 bnez s0,400030dc <rtems_heap_allocate_aligned_with_boundary+0x5c>
4000314c: 0134e633 or a2,s1,s3
40003150: 00061e63 bnez a2,4000316c <rtems_heap_allocate_aligned_with_boundary+0xec>
p = (*rtems_malloc_extend_handler)( heap, size );
40003154: 8a41a783 lw a5,-1884(gp) # 40020ce4 <rtems_malloc_extend_handler>
40003158: 00090593 mv a1,s2 <== NOT EXECUTED
4000315c: 000a0513 mv a0,s4 <== NOT EXECUTED
40003160: 000780e7 jalr a5 <== NOT EXECUTED
40003164: 00050413 mv s0,a0 <== NOT EXECUTED
if ( p != NULL && rtems_malloc_dirty_helper != NULL )
40003168: f6051ae3 bnez a0,400030dc <rtems_heap_allocate_aligned_with_boundary+0x5c><== NOT EXECUTED
return NULL;
4000316c: 00000413 li s0,0 <== NOT EXECUTED
40003170: f81ff06f j 400030f0 <rtems_heap_allocate_aligned_with_boundary+0x70><== NOT EXECUTED
40000fe8 <rtems_heap_extend_via_sbrk>:
void *rtems_heap_extend_via_sbrk(
Heap_Control *heap,
size_t alloc_size
)
{
ptrdiff_t sbrk_amount = RTEMS_Malloc_Sbrk_amount;
40000fe8: 8ac1a783 lw a5,-1876(gp) # 40010934 <RTEMS_Malloc_Sbrk_amount>
ptrdiff_t sbrk_size = (ptrdiff_t) alloc_size;
ptrdiff_t misaligned = sbrk_amount != 0 ? sbrk_size % sbrk_amount : 0;
40000fec: 00079663 bnez a5,40000ff8 <rtems_heap_extend_via_sbrk+0x10>
}
}
}
return return_this;
}
40000ff0: 00000513 li a0,0
40000ff4: 00008067 ret
ptrdiff_t misaligned = sbrk_amount != 0 ? sbrk_size % sbrk_amount : 0;
40000ff8: 02f5e733 rem a4,a1,a5
{
40000ffc: ff010113 addi sp,sp,-16
40001000: 00812423 sw s0,8(sp)
40001004: 00912223 sw s1,4(sp)
40001008: 01212023 sw s2,0(sp)
4000100c: 00112623 sw ra,12(sp)
40001010: 00050493 mv s1,a0
40001014: 00058413 mv s0,a1
ptrdiff_t sbrk_size = (ptrdiff_t) alloc_size;
40001018: 00058913 mv s2,a1
if ( misaligned != 0 ) {
4000101c: 00070663 beqz a4,40001028 <rtems_heap_extend_via_sbrk+0x40>
sbrk_size += sbrk_amount - misaligned;
40001020: 40e78733 sub a4,a5,a4
40001024: 00e58933 add s2,a1,a4
if ( sbrk_size > 0 && sbrk_amount > 0 ) {
40001028: 05205e63 blez s2,40001084 <rtems_heap_extend_via_sbrk+0x9c> <== NEVER TAKEN
4000102c: 04f05c63 blez a5,40001084 <rtems_heap_extend_via_sbrk+0x9c> <== NEVER TAKEN
void *area_begin = sbrk( sbrk_size );
40001030: 00090513 mv a0,s2
40001034: c7cff0ef jal ra,400004b0 <sbrk>
if ( area_begin != (void *) -1 ) {
40001038: fff00793 li a5,-1
void *area_begin = sbrk( sbrk_size );
4000103c: 00050593 mv a1,a0
if ( area_begin != (void *) -1 ) {
40001040: 04f50263 beq a0,a5,40001084 <rtems_heap_extend_via_sbrk+0x9c>
bool ok = _Protected_heap_Extend( heap, area_begin, sbrk_size );
40001044: 00090613 mv a2,s2
40001048: 00048513 mv a0,s1
4000104c: 0a8040ef jal ra,400050f4 <_Protected_heap_Extend>
if ( ok ) {
40001050: 02050663 beqz a0,4000107c <rtems_heap_extend_via_sbrk+0x94>
RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
Heap_Control *heap,
uintptr_t size
)
{
return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
40001054: 00040593 mv a1,s0
}
40001058: 00812403 lw s0,8(sp)
4000105c: 00c12083 lw ra,12(sp)
40001060: 00012903 lw s2,0(sp)
40001064: 00048513 mv a0,s1
40001068: 00412483 lw s1,4(sp)
4000106c: 00000693 li a3,0
40001070: 00000613 li a2,0
40001074: 01010113 addi sp,sp,16
40001078: 0140406f j 4000508c <_Protected_heap_Allocate_aligned_with_boundary>
sbrk( -sbrk_size );
4000107c: 41200533 neg a0,s2
40001080: c30ff0ef jal ra,400004b0 <sbrk>
}
40001084: 00c12083 lw ra,12(sp)
40001088: 00812403 lw s0,8(sp)
4000108c: 00412483 lw s1,4(sp)
40001090: 00012903 lw s2,0(sp)
40001094: 00000513 li a0,0
40001098: 01010113 addi sp,sp,16
4000109c: 00008067 ret
40002df0 <rtems_libio_allocate>:
return fcntl_flags;
}
rtems_libio_t *rtems_libio_allocate( void )
{
40002df0: ff010113 addi sp,sp,-16
40002df4: 00812423 sw s0,8(sp)
40002df8: 00112623 sw ra,12(sp)
rtems_libio_t *iop;
rtems_libio_lock();
40002dfc: 11c000ef jal ra,40002f18 <rtems_libio_lock>
iop = rtems_libio_iop_free_head;
40002e00: 9141a403 lw s0,-1772(gp) # 40020d54 <rtems_libio_iop_free_head>
if ( iop != NULL ) {
40002e04: 00040863 beqz s0,40002e14 <rtems_libio_allocate+0x24>
void *next;
next = iop->data1;
40002e08: 02c42703 lw a4,44(s0)
rtems_libio_iop_free_head = next;
40002e0c: 90e1aa23 sw a4,-1772(gp) # 40020d54 <rtems_libio_iop_free_head>
if ( next == NULL ) {
40002e10: 00070e63 beqz a4,40002e2c <rtems_libio_allocate+0x3c>
rtems_libio_iop_free_tail = &rtems_libio_iop_free_head;
}
}
rtems_libio_unlock();
40002e14: 110000ef jal ra,40002f24 <rtems_libio_unlock>
return iop;
}
40002e18: 00c12083 lw ra,12(sp)
40002e1c: 00040513 mv a0,s0
40002e20: 00812403 lw s0,8(sp)
40002e24: 01010113 addi sp,sp,16
40002e28: 00008067 ret
rtems_libio_iop_free_tail = &rtems_libio_iop_free_head;
40002e2c: 91418793 addi a5,gp,-1772 # 40020d54 <rtems_libio_iop_free_head>
40002e30: 8ef1a423 sw a5,-1816(gp) # 40020d28 <rtems_libio_iop_free_tail>
rtems_libio_unlock();
40002e34: 0f0000ef jal ra,40002f24 <rtems_libio_unlock>
}
40002e38: 00c12083 lw ra,12(sp)
40002e3c: 00040513 mv a0,s0
40002e40: 00812403 lw s0,8(sp)
40002e44: 01010113 addi sp,sp,16
40002e48: 00008067 ret
40002e4c <rtems_libio_free>:
void rtems_libio_free(
rtems_libio_t *iop
)
{
40002e4c: ff010113 addi sp,sp,-16
40002e50: 00812423 sw s0,8(sp)
40002e54: 00050413 mv s0,a0
size_t zero;
rtems_filesystem_location_free( &iop->pathinfo );
40002e58: 01050513 addi a0,a0,16
{
40002e5c: 00112623 sw ra,12(sp)
rtems_filesystem_location_free( &iop->pathinfo );
40002e60: 3c50b0ef jal ra,4000ea24 <rtems_filesystem_location_free>
rtems_libio_lock();
40002e64: 0b4000ef jal ra,40002f18 <rtems_libio_lock>
__asm__ volatile (
40002e68: 300477f3 csrrci a5,mstatus,8
*obj = val & arg;
40002e6c: 00042703 lw a4,0(s0)
40002e70: fffff6b7 lui a3,0xfffff
40002e74: 00d77733 and a4,a4,a3
40002e78: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
40002e7c: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40002e80: 3007a073 csrs mstatus,a5
* Clear everything except the reference count part. At this point in time
* there may be still some holders of this file descriptor.
*/
rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_REFERENCE_INC - 1U );
zero = offsetof( rtems_libio_t, offset );
memset( (char *) iop + zero, 0, sizeof( *iop ) - zero );
40002e84: 02800613 li a2,40
40002e88: 00840513 addi a0,s0,8
40002e8c: 00000593 li a1,0
40002e90: 6f1110ef jal ra,40014d80 <memset>
/*
* Append it to the free list. This increases the likelihood that a use
* after close is detected.
*/
*rtems_libio_iop_free_tail = iop;
40002e94: 8e81a683 lw a3,-1816(gp) # 40020d28 <rtems_libio_iop_free_tail>
rtems_libio_iop_free_tail = &iop->data1;
40002e98: 02c40713 addi a4,s0,44
rtems_libio_unlock();
}
40002e9c: 00c12083 lw ra,12(sp)
*rtems_libio_iop_free_tail = iop;
40002ea0: 0086a023 sw s0,0(a3) # fffff000 <RamEnd+0xbefff000>
}
40002ea4: 00812403 lw s0,8(sp)
rtems_libio_iop_free_tail = &iop->data1;
40002ea8: 8ee1a423 sw a4,-1816(gp) # 40020d28 <rtems_libio_iop_free_tail>
}
40002eac: 01010113 addi sp,sp,16
rtems_libio_unlock();
40002eb0: 0740006f j 40002f24 <rtems_libio_unlock>
40001ee0 <rtems_libio_to_fcntl_flags>:
int rtems_libio_to_fcntl_flags( unsigned int flags )
{
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
40001ee0: 00657693 andi a3,a0,6
40001ee4: 00600713 li a4,6
{
40001ee8: 00050793 mv a5,a0
fcntl_flags |= O_RDWR;
40001eec: 00200513 li a0,2
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
40001ef0: 00e68863 beq a3,a4,40001f00 <rtems_libio_to_fcntl_flags+0x20>
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
40001ef4: 0027f713 andi a4,a5,2
fcntl_flags |= O_RDONLY;
40001ef8: 00000513 li a0,0
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
40001efc: 02070263 beqz a4,40001f20 <rtems_libio_to_fcntl_flags+0x40> <== NEVER TAKEN
} else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
fcntl_flags |= O_WRONLY;
}
if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
40001f00: 0017f713 andi a4,a5,1
40001f04: 00070663 beqz a4,40001f10 <rtems_libio_to_fcntl_flags+0x30>
fcntl_flags |= O_NONBLOCK;
40001f08: 00004737 lui a4,0x4
40001f0c: 00e56533 or a0,a0,a4
}
if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
40001f10: 2007f793 andi a5,a5,512
40001f14: 00078463 beqz a5,40001f1c <rtems_libio_to_fcntl_flags+0x3c>
fcntl_flags |= O_APPEND;
40001f18: 00856513 ori a0,a0,8
}
return fcntl_flags;
}
40001f1c: 00008067 ret
} else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
40001f20: 0027d513 srli a0,a5,0x2 <== NOT EXECUTED
40001f24: 00157513 andi a0,a0,1 <== NOT EXECUTED
40001f28: fd9ff06f j 40001f00 <rtems_libio_to_fcntl_flags+0x20> <== NOT EXECUTED
40003d04 <rtems_mkdir>:
return (retval);
}
int
rtems_mkdir(const char *path, mode_t mode)
{
40003d04: f6010113 addi sp,sp,-160
40003d08: 09412423 sw s4,136(sp)
40003d0c: 08112e23 sw ra,156(sp)
40003d10: 08812c23 sw s0,152(sp)
40003d14: 08912a23 sw s1,148(sp)
40003d18: 09212823 sw s2,144(sp)
40003d1c: 09312623 sw s3,140(sp)
40003d20: 09512223 sw s5,132(sp)
40003d24: 09612023 sw s6,128(sp)
40003d28: 07712e23 sw s7,124(sp)
40003d2c: 07812c23 sw s8,120(sp)
40003d30: 07912a23 sw s9,116(sp)
40003d34: 00058a13 mv s4,a1
int success = 0;
char *dup_path = strdup(path);
40003d38: 3cd1c0ef jal ra,40020904 <strdup>
if (dup_path != NULL) {
40003d3c: 16050e63 beqz a0,40003eb8 <rtems_mkdir+0x1b4>
if (p[0] == '/') /* Skip leading '/'. */
40003d40: 00054783 lbu a5,0(a0)
40003d44: 02f00713 li a4,47
40003d48: 00050913 mv s2,a0
40003d4c: 00050413 mv s0,a0
40003d50: 00e79663 bne a5,a4,40003d5c <rtems_mkdir+0x58>
if (p[0] == '\0')
40003d54: 00154783 lbu a5,1(a0)
++p;
40003d58: 00150413 addi s0,a0,1
40003d5c: 00140413 addi s0,s0,1
*p = '/';
40003d60: 00000493 li s1,0
40003d64: 00100713 li a4,1
40003d68: 02f00993 li s3,47
if (errno == EEXIST || errno == EISDIR) {
40003d6c: 01100a93 li s5,17
40003d70: 01500c13 li s8,21
} else if (!S_ISDIR(sb.st_mode)) {
40003d74: 0000fbb7 lui s7,0xf
40003d78: 00004b37 lui s6,0x4
if (p[0] == '\0')
40003d7c: 02078e63 beqz a5,40003db8 <rtems_mkdir+0xb4> <== NEVER TAKEN
else if (p[0] != '/')
40003d80: 03379663 bne a5,s3,40003dac <rtems_mkdir+0xa8>
*p = '\0';
40003d84: fe040fa3 sb zero,-1(s0)
if (!last && p[1] == '\0')
40003d88: 00044c83 lbu s9,0(s0)
if (first) {
40003d8c: 12071a63 bnez a4,40003ec0 <rtems_mkdir+0x1bc>
if (last)
40003d90: 040c8063 beqz s9,40003dd0 <rtems_mkdir+0xcc> <== NEVER TAKEN
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
40003d94: 1ff00593 li a1,511
40003d98: 00090513 mv a0,s2
40003d9c: e49fe0ef jal ra,40002be4 <mkdir>
40003da0: 0c054663 bltz a0,40003e6c <rtems_mkdir+0x168>
*p = '/';
40003da4: ff340fa3 sb s3,-1(s0)
40003da8: 00000713 li a4,0
if (p[0] == '\0')
40003dac: 00044783 lbu a5,0(s0)
40003db0: 00140413 addi s0,s0,1
40003db4: fc0796e3 bnez a5,40003d80 <rtems_mkdir+0x7c>
if (first) {
40003db8: 00070c63 beqz a4,40003dd0 <rtems_mkdir+0xcc>
oumask = umask(0);
40003dbc: 00000513 li a0,0
40003dc0: 751000ef jal ra,40004d10 <umask>
40003dc4: 00050493 mv s1,a0
(void)umask(numask);
40003dc8: f3f57513 andi a0,a0,-193
40003dcc: 745000ef jal ra,40004d10 <umask>
(void)umask(oumask);
40003dd0: 00048513 mv a0,s1
40003dd4: 73d000ef jal ra,40004d10 <umask>
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
40003dd8: 000a0593 mv a1,s4
40003ddc: 00090513 mv a0,s2
40003de0: e05fe0ef jal ra,40002be4 <mkdir>
40003de4: 04054463 bltz a0,40003e2c <rtems_mkdir+0x128>
40003de8: 00000413 li s0,0
success = build(dup_path, mode);
free(dup_path);
40003dec: 00090513 mv a0,s2
40003df0: 97dfe0ef jal ra,4000276c <free>
}
return success != 0 ? 0 : -1;
}
40003df4: 09c12083 lw ra,156(sp)
40003df8: 00040513 mv a0,s0
40003dfc: 09812403 lw s0,152(sp)
40003e00: 09412483 lw s1,148(sp)
40003e04: 09012903 lw s2,144(sp)
40003e08: 08c12983 lw s3,140(sp)
40003e0c: 08812a03 lw s4,136(sp)
40003e10: 08412a83 lw s5,132(sp)
40003e14: 08012b03 lw s6,128(sp)
40003e18: 07c12b83 lw s7,124(sp)
40003e1c: 07812c03 lw s8,120(sp)
40003e20: 07412c83 lw s9,116(sp)
40003e24: 0a010113 addi sp,sp,160
40003e28: 00008067 ret
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
40003e2c: 00100c93 li s9,1
if (errno == EEXIST || errno == EISDIR) {
40003e30: 20d190ef jal ra,4001d83c <__errno>
40003e34: 00052783 lw a5,0(a0)
40003e38: 01578863 beq a5,s5,40003e48 <rtems_mkdir+0x144>
40003e3c: 201190ef jal ra,4001d83c <__errno>
40003e40: 00052783 lw a5,0(a0)
40003e44: 03879863 bne a5,s8,40003e74 <rtems_mkdir+0x170>
if (stat(path, &sb) < 0) {
40003e48: 00810593 addi a1,sp,8
40003e4c: 00090513 mv a0,s2
40003e50: 0cc000ef jal ra,40003f1c <stat>
40003e54: 02054063 bltz a0,40003e74 <rtems_mkdir+0x170> <== NEVER TAKEN
} else if (!S_ISDIR(sb.st_mode)) {
40003e58: 01812783 lw a5,24(sp)
40003e5c: 00fbf7b3 and a5,s7,a5
40003e60: 03679463 bne a5,s6,40003e88 <rtems_mkdir+0x184>
if (last)
40003e64: f80c92e3 bnez s9,40003de8 <rtems_mkdir+0xe4>
40003e68: f3dff06f j 40003da4 <rtems_mkdir+0xa0>
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
40003e6c: 00000c93 li s9,0
40003e70: fc1ff06f j 40003e30 <rtems_mkdir+0x12c>
if (!first && !last)
40003e74: 020c9e63 bnez s9,40003eb0 <rtems_mkdir+0x1ac> <== ALWAYS TAKEN
(void)umask(oumask);
40003e78: 00048513 mv a0,s1
40003e7c: 695000ef jal ra,40004d10 <umask>
40003e80: fff00413 li s0,-1
40003e84: f69ff06f j 40003dec <rtems_mkdir+0xe8>
if (last)
40003e88: 000c8c63 beqz s9,40003ea0 <rtems_mkdir+0x19c>
errno = EEXIST;
40003e8c: 1b1190ef jal ra,4001d83c <__errno>
40003e90: 01100793 li a5,17
40003e94: 00f52023 sw a5,0(a0)
40003e98: fff00413 li s0,-1
40003e9c: f51ff06f j 40003dec <rtems_mkdir+0xe8>
errno = ENOTDIR;
40003ea0: 19d190ef jal ra,4001d83c <__errno>
40003ea4: 01400793 li a5,20
40003ea8: 00f52023 sw a5,0(a0)
if (!first && !last)
40003eac: fcdff06f j 40003e78 <rtems_mkdir+0x174>
free(dup_path);
40003eb0: 00090513 mv a0,s2
40003eb4: 8b9fe0ef jal ra,4000276c <free>
return success != 0 ? 0 : -1;
40003eb8: fff00413 li s0,-1
40003ebc: f39ff06f j 40003df4 <rtems_mkdir+0xf0>
oumask = umask(0);
40003ec0: 00000513 li a0,0
40003ec4: 64d000ef jal ra,40004d10 <umask>
40003ec8: 00050493 mv s1,a0
(void)umask(numask);
40003ecc: f3f57513 andi a0,a0,-193
40003ed0: 641000ef jal ra,40004d10 <umask>
first = 0;
40003ed4: ebdff06f j 40003d90 <rtems_mkdir+0x8c>
40000f34 <rtems_print_printer_fprintf_putc>:
}
void rtems_print_printer_fprintf_putc(rtems_printer *printer)
{
40000f34: ff010113 addi sp,sp,-16
40000f38: 00812423 sw s0,8(sp)
pthread_once(&fprintf_putc_once, fprintf_putc_init);
40000f3c: 400015b7 lui a1,0x40001
{
40000f40: 00050413 mv s0,a0
pthread_once(&fprintf_putc_once, fprintf_putc_init);
40000f44: ea458593 addi a1,a1,-348 # 40000ea4 <fprintf_putc_init>
40000f48: 92818513 addi a0,gp,-1752 # 4001d300 <fprintf_putc_once>
{
40000f4c: 00112623 sw ra,12(sp)
pthread_once(&fprintf_putc_once, fprintf_putc_init);
40000f50: 1d4050ef jal ra,40006124 <pthread_once>
printer->context = &fprintf_putc_file;
40000f54: 400207b7 lui a5,0x40020
40000f58: e3078793 addi a5,a5,-464 # 4001fe30 <fprintf_putc_file>
40000f5c: 00f42023 sw a5,0(s0)
printer->printer = fprintf_putc_printer;
40000f60: 400017b7 lui a5,0x40001
40000f64: ee078793 addi a5,a5,-288 # 40000ee0 <fprintf_putc_printer>
}
40000f68: 00c12083 lw ra,12(sp)
printer->printer = fprintf_putc_printer;
40000f6c: 00f42223 sw a5,4(s0)
}
40000f70: 00812403 lw s0,8(sp)
40000f74: 01010113 addi sp,sp,16
40000f78: 00008067 ret
40003ba4 <rtems_printf>:
int rtems_printf(
const rtems_printer *printer,
const char *format,
...
)
{
40003ba4: fc010113 addi sp,sp,-64
40003ba8: 00112e23 sw ra,28(sp)
40003bac: 02c12423 sw a2,40(sp)
40003bb0: 02d12623 sw a3,44(sp)
40003bb4: 02e12823 sw a4,48(sp)
40003bb8: 02f12a23 sw a5,52(sp)
40003bbc: 03012c23 sw a6,56(sp)
40003bc0: 03112e23 sw a7,60(sp)
40003bc4: 02050463 beqz a0,40003bec <rtems_printf+0x48>
40003bc8: 00452783 lw a5,4(a0)
40003bcc: 02078063 beqz a5,40003bec <rtems_printf+0x48> <== NEVER TAKEN
int len = 0;
if ( rtems_print_printer_valid( printer ) ) {
va_list ap;
va_start( ap, format );
len = printer->printer( printer->context, format, ap );
40003bd0: 00052503 lw a0,0(a0)
va_start( ap, format );
40003bd4: 02810613 addi a2,sp,40
40003bd8: 00c12623 sw a2,12(sp)
len = printer->printer( printer->context, format, ap );
40003bdc: 000780e7 jalr a5
va_end( ap );
}
return len;
}
40003be0: 01c12083 lw ra,28(sp)
40003be4: 04010113 addi sp,sp,64
40003be8: 00008067 ret
40003bec: 01c12083 lw ra,28(sp)
int len = 0;
40003bf0: 00000513 li a0,0
}
40003bf4: 04010113 addi sp,sp,64
40003bf8: 00008067 ret
40003efc <rtems_putc>:
#endif
#include <rtems/bspIo.h>
void rtems_putc(char c)
{
40003efc: ff010113 addi sp,sp,-16
40003f00: 00812423 sw s0,8(sp)
40003f04: 00912223 sw s1,4(sp)
40003f08: 00112623 sw ra,12(sp)
if (c == '\n') {
40003f0c: 00a00713 li a4,10
(*BSP_output_char)('\r');
40003f10: 9001a783 lw a5,-1792(gp) # 40020d40 <BSP_output_char>
{
40003f14: 00050413 mv s0,a0
if (c == '\n') {
40003f18: 00e51863 bne a0,a4,40003f28 <rtems_putc+0x2c>
(*BSP_output_char)('\r');
40003f1c: 00d00513 li a0,13
40003f20: 000780e7 jalr a5
}
(*BSP_output_char)(c);
40003f24: 9001a783 lw a5,-1792(gp) # 40020d40 <BSP_output_char>
40003f28: 00040513 mv a0,s0
}
40003f2c: 00812403 lw s0,8(sp)
40003f30: 00c12083 lw ra,12(sp)
40003f34: 00412483 lw s1,4(sp)
40003f38: 01010113 addi sp,sp,16
(*BSP_output_char)(c);
40003f3c: 00078067 jr a5
40001878 <rtems_resource_snapshot_equal>:
bool rtems_resource_snapshot_equal(
const rtems_resource_snapshot *a,
const rtems_resource_snapshot *b
)
{
40001878: ff010113 addi sp,sp,-16 <== NOT EXECUTED
return memcmp(a, b, sizeof(*a)) == 0;
4000187c: 0f800613 li a2,248 <== NOT EXECUTED
{
40001880: 00112623 sw ra,12(sp) <== NOT EXECUTED
return memcmp(a, b, sizeof(*a)) == 0;
40001884: 43c100ef jal ra,40011cc0 <memcmp> <== NOT EXECUTED
}
40001888: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4000188c: 00153513 seqz a0,a0 <== NOT EXECUTED
40001890: 01010113 addi sp,sp,16 <== NOT EXECUTED
40001894: 00008067 ret <== NOT EXECUTED
40003d7c <rtems_resource_snapshot_take>:
return count;
}
void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
{
40003d7c: fd010113 addi sp,sp,-48
uint32_t *active;
size_t i;
memset(snapshot, 0, sizeof(*snapshot));
40003d80: 0f800613 li a2,248
40003d84: 00000593 li a1,0
{
40003d88: 02112623 sw ra,44(sp)
40003d8c: 02812423 sw s0,40(sp)
40003d90: 02912223 sw s1,36(sp)
40003d94: 03212023 sw s2,32(sp)
40003d98: 01312e23 sw s3,28(sp)
40003d9c: 00050993 mv s3,a0
memset(snapshot, 0, sizeof(*snapshot));
40003da0: 7e1100ef jal ra,40014d80 <memset>
_RTEMS_Lock_allocator();
40003da4: 390030ef jal ra,40007134 <_RTEMS_Lock_allocator>
_Thread_Kill_zombies();
40003da8: 5f5060ef jal ra,4000ab9c <_Thread_Kill_zombies>
_Heap_Get_information(heap, info);
40003dac: 91c1a503 lw a0,-1764(gp) # 40020d5c <RTEMS_Malloc_Heap>
40003db0: 05898593 addi a1,s3,88 # 1058 <_ISR_Stack_size+0x58>
40003db4: 4001f937 lui s2,0x4001f
40003db8: 2b9030ef jal ra,40007870 <_Heap_Get_information>
memset(&info->Stats, 0, sizeof(info->Stats));
40003dbc: 04000613 li a2,64
40003dc0: 00000593 li a1,0
40003dc4: 07098513 addi a0,s3,112
40003dc8: 7b9100ef jal ra,40014d80 <memset>
_Heap_Get_information(heap, info);
40003dcc: 40023537 lui a0,0x40023
40003dd0: 00098593 mv a1,s3
40003dd4: ff050513 addi a0,a0,-16 # 40022ff0 <_Workspace_Area>
40003dd8: 299030ef jal ra,40007870 <_Heap_Get_information>
memset(&info->Stats, 0, sizeof(info->Stats));
40003ddc: 00000593 li a1,0
40003de0: 04000613 li a2,64
40003de4: 01898513 addi a0,s3,24
40003de8: 799100ef jal ra,40014d80 <memset>
get_heap_info(RTEMS_Malloc_Heap, &snapshot->heap_info);
get_heap_info(&_Workspace_Area, &snapshot->workspace_info);
active = &snapshot->active_posix_keys;
for (i = 0; i < RTEMS_ARRAY_SIZE(objects_info_table); ++i) {
40003dec: a3890913 addi s2,s2,-1480 # 4001ea38 <objects_info_table>
40003df0: 00890413 addi s0,s2,8
40003df4: 0b498493 addi s1,s3,180
40003df8: 07890913 addi s2,s2,120
memset(&info->Stats, 0, sizeof(info->Stats));
40003dfc: 00200593 li a1,2
40003e00: 00300513 li a0,3
40003e04: 0100006f j 40003e14 <rtems_resource_snapshot_take+0x98>
const Objects_Information *information;
information = _Objects_Get_information(
40003e08: 00042503 lw a0,0(s0)
40003e0c: 00445583 lhu a1,4(s0)
40003e10: 00840413 addi s0,s0,8
40003e14: 6b5040ef jal ra,40008cc8 <_Objects_Get_information>
objects_info_table[i].api,
objects_info_table[i].cls
);
if (information != NULL) {
40003e18: 00050663 beqz a0,40003e24 <rtems_resource_snapshot_take+0xa8>
active[i] = _Objects_Active_count(information);
40003e1c: 625040ef jal ra,40008c40 <_Objects_Active_count>
40003e20: 00a4a023 sw a0,0(s1) # 1000 <_ISR_Stack_size>
for (i = 0; i < RTEMS_ARRAY_SIZE(objects_info_table); ++i) {
40003e24: 00448493 addi s1,s1,4
40003e28: ff2410e3 bne s0,s2,40003e08 <rtems_resource_snapshot_take+0x8c>
}
}
_RTEMS_Unlock_allocator();
40003e2c: 314030ef jal ra,40007140 <_RTEMS_Unlock_allocator>
uint32_t count = 0;
40003e30: 00000413 li s0,0
Objects_Id id = OBJECTS_ID_INITIAL_INDEX;
40003e34: 00012623 sw zero,12(sp)
while ((the_key = get_next_key(&id)) != NULL ) {
40003e38: 00000513 li a0,0
40003e3c: 400204b7 lui s1,0x40020
40003e40: 0140006f j 40003e54 <rtems_resource_snapshot_take+0xd8>
count += _Chain_Node_count_unprotected(&the_key->Key_value_pairs);
40003e44: 3e8030ef jal ra,4000722c <_Chain_Node_count_unprotected>
40003e48: 00a40433 add s0,s0,a0
* previous thread life protection state and thus may not return if the
* executing thread was restarted or deleted in the mean-time.
*/
RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )
{
_RTEMS_Unlock_allocator();
40003e4c: 2f4030ef jal ra,40007140 <_RTEMS_Unlock_allocator>
_Objects_Get_next(*id, &_POSIX_Keys_Information, id);
40003e50: 00c12503 lw a0,12(sp)
40003e54: 00c10613 addi a2,sp,12
40003e58: 7fc48593 addi a1,s1,2044 # 400207fc <_POSIX_Keys_Information>
40003e5c: 6f9040ef jal ra,40008d54 <_Objects_Get_next>
40003e60: 00050793 mv a5,a0
count += _Chain_Node_count_unprotected(&the_key->Key_value_pairs);
40003e64: 01450513 addi a0,a0,20
while ((the_key = get_next_key(&id)) != NULL ) {
40003e68: fc079ee3 bnez a5,40003e44 <rtems_resource_snapshot_take+0xc8>
snapshot->active_posix_key_value_pairs = get_active_posix_key_value_pairs();
40003e6c: 0a89a823 sw s0,176(s3)
rtems_libio_lock();
40003e70: 8a8ff0ef jal ra,40002f18 <rtems_libio_lock>
iop = rtems_libio_iop_free_head;
40003e74: 9141a783 lw a5,-1772(gp) # 40020d54 <rtems_libio_iop_free_head>
int free_count = 0;
40003e78: 00000413 li s0,0
while (iop != NULL) {
40003e7c: 00078863 beqz a5,40003e8c <rtems_resource_snapshot_take+0x110>
iop = iop->data1;
40003e80: 02c7a783 lw a5,44(a5)
++free_count;
40003e84: 00140413 addi s0,s0,1
while (iop != NULL) {
40003e88: fe079ce3 bnez a5,40003e80 <rtems_resource_snapshot_take+0x104> <== NOT EXECUTED
rtems_libio_unlock();
40003e8c: 898ff0ef jal ra,40002f24 <rtems_libio_unlock> <== NOT EXECUTED
return (int) rtems_libio_number_iops - free_count;
40003e90: 8901a783 lw a5,-1904(gp) # 40020cd0 <rtems_libio_number_iops> <== NOT EXECUTED
snapshot->open_files = open_files();
}
40003e94: 02c12083 lw ra,44(sp)
40003e98: 02412483 lw s1,36(sp)
return (int) rtems_libio_number_iops - free_count;
40003e9c: 40878433 sub s0,a5,s0
snapshot->open_files = open_files();
40003ea0: 0e89a823 sw s0,240(s3)
}
40003ea4: 02812403 lw s0,40(sp)
40003ea8: 02012903 lw s2,32(sp)
40003eac: 01c12983 lw s3,28(sp)
40003eb0: 03010113 addi sp,sp,48
40003eb4: 00008067 ret
40003ce0 <rtems_termios_close>:
struct rtems_termios_tty *tty = args->iop->data1;
40003ce0: 00052783 lw a5,0(a0)
{
40003ce4: ff010113 addi sp,sp,-16
40003ce8: 00912223 sw s1,4(sp)
40003cec: 01212023 sw s2,0(sp)
struct rtems_termios_tty *tty = args->iop->data1;
40003cf0: 02c7a483 lw s1,44(a5)
_Mutex_Acquire( mutex );
40003cf4: 4001b937 lui s2,0x4001b
{
40003cf8: 00812423 sw s0,8(sp)
40003cfc: 00050413 mv s0,a0
40003d00: 61c90513 addi a0,s2,1564 # 4001b61c <rtems_termios_ttyMutex>
40003d04: 00112623 sw ra,12(sp)
40003d08: 26d040ef jal ra,40008774 <_Mutex_Acquire>
if (tty->refcount == 1) {
40003d0c: 0084a783 lw a5,8(s1)
40003d10: 00100713 li a4,1
40003d14: 02e78a63 beq a5,a4,40003d48 <rtems_termios_close+0x68>
if (--tty->refcount == 0) {
40003d18: fff78793 addi a5,a5,-1 <== NOT EXECUTED
40003d1c: 00f4a423 sw a5,8(s1) <== NOT EXECUTED
40003d20: 04078263 beqz a5,40003d64 <rtems_termios_close+0x84> <== NOT EXECUTED
_Mutex_Release( mutex );
40003d24: 61c90513 addi a0,s2,1564
40003d28: 2bd040ef jal ra,400087e4 <_Mutex_Release>
}
40003d2c: 00c12083 lw ra,12(sp)
40003d30: 00812403 lw s0,8(sp)
40003d34: 00412483 lw s1,4(sp)
40003d38: 00012903 lw s2,0(sp)
40003d3c: 00000513 li a0,0
40003d40: 01010113 addi sp,sp,16
40003d44: 00008067 ret
if (tty->forw == NULL) {
40003d48: 0004a703 lw a4,0(s1)
rtems_termios_ttyTail = tty->back;
40003d4c: 0044a783 lw a5,4(s1)
if (tty->forw == NULL) {
40003d50: 02070863 beqz a4,40003d80 <rtems_termios_close+0xa0> <== ALWAYS TAKEN
tty->forw->back = tty->back;
40003d54: 00f72223 sw a5,4(a4) <== NOT EXECUTED
if (tty->back == NULL) {
40003d58: 02078063 beqz a5,40003d78 <rtems_termios_close+0x98> <== NOT EXECUTED
tty->back->forw = tty->forw;
40003d5c: 00e7a023 sw a4,0(a5) <== NOT EXECUTED
if (--tty->refcount == 0) {
40003d60: 0004a423 sw zero,8(s1)
rtems_termios_destroy_tty (tty, arg, true);
40003d64: 00100613 li a2,1
40003d68: 00040593 mv a1,s0
40003d6c: 00048513 mv a0,s1
40003d70: d6cfe0ef jal ra,400022dc <rtems_termios_destroy_tty>
40003d74: fb1ff06f j 40003d24 <rtems_termios_close+0x44>
rtems_termios_ttyHead = tty->forw;
40003d78: 96e1ae23 sw a4,-1668(gp) # 4001bc54 <rtems_termios_ttyHead> <== NOT EXECUTED
rtems_termios_ttyHead->back = NULL;
40003d7c: fe5ff06f j 40003d60 <rtems_termios_close+0x80> <== NOT EXECUTED
rtems_termios_ttyTail = tty->back;
40003d80: 98f1a023 sw a5,-1664(gp) # 4001bc58 <rtems_termios_ttyTail>
if ( rtems_termios_ttyTail != NULL ) {
40003d84: 00078a63 beqz a5,40003d98 <rtems_termios_close+0xb8> <== ALWAYS TAKEN
rtems_termios_ttyTail->forw = NULL;
40003d88: 0007a023 sw zero,0(a5) <== NOT EXECUTED
tty->back->forw = tty->forw;
40003d8c: 0004a703 lw a4,0(s1) <== NOT EXECUTED
40003d90: 00e7a023 sw a4,0(a5) <== NOT EXECUTED
40003d94: fcdff06f j 40003d60 <rtems_termios_close+0x80> <== NOT EXECUTED
rtems_termios_ttyHead = tty->forw;
40003d98: 9601ae23 sw zero,-1668(gp) # 4001bc54 <rtems_termios_ttyHead>
if ( rtems_termios_ttyHead != NULL ) {
40003d9c: fc5ff06f j 40003d60 <rtems_termios_close+0x80>
40004960 <rtems_termios_dequeue_characters>:
tty->t_dqlen += len;
40004960: 0e052703 lw a4,224(a0)
{
40004964: ff010113 addi sp,sp,-16
if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
40004968: 13c52683 lw a3,316(a0)
tty->t_dqlen += len;
4000496c: 00b70733 add a4,a4,a1
{
40004970: 00112623 sw ra,12(sp)
tty->t_dqlen += len;
40004974: 0ee52023 sw a4,224(a0)
if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
40004978: 00200713 li a4,2
4000497c: 02e68e63 beq a3,a4,400049b8 <rtems_termios_dequeue_characters+0x58>
if (tty->t_line == PPPDISC ) {
40004980: 15c52703 lw a4,348(a0)
40004984: 00500793 li a5,5
40004988: 00f70863 beq a4,a5,40004998 <rtems_termios_dequeue_characters+0x38>
}
4000498c: 00c12083 lw ra,12(sp)
40004990: 01010113 addi sp,sp,16
return rtems_termios_refill_transmitter(tty);
40004994: f89fd06f j 4000291c <rtems_termios_refill_transmitter>
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
40004998: 4001e7b7 lui a5,0x4001e
4000499c: 94c7a783 lw a5,-1716(a5) # 4001d94c <rtems_termios_linesw+0xb4>
400049a0: 00078463 beqz a5,400049a8 <rtems_termios_dequeue_characters+0x48><== NEVER TAKEN
rtems_termios_linesw[tty->t_line].l_start(tty);
400049a4: 000780e7 jalr a5
}
400049a8: 00c12083 lw ra,12(sp)
400049ac: 00000513 li a0,0
400049b0: 01010113 addi sp,sp,16
400049b4: 00008067 ret
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
400049b8: 15852503 lw a0,344(a0)
400049bc: 00200593 li a1,2
400049c0: 6e8020ef jal ra,400070a8 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
400049c4: fe0502e3 beqz a0,400049a8 <rtems_termios_dequeue_characters+0x48><== ALWAYS TAKEN
rtems_fatal_error_occurred (sc);
400049c8: 0c0030ef jal ra,40007a88 <rtems_fatal_error_occurred> <== NOT EXECUTED
40010cb8 <rtems_termios_enqueue_raw_characters>:
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
40010cb8: 15c52783 lw a5,348(a0)
{
40010cbc: fa010113 addi sp,sp,-96
40010cc0: 05212823 sw s2,80(sp)
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
40010cc4: 40019937 lui s2,0x40019
40010cc8: 6cc90913 addi s2,s2,1740 # 400196cc <rtems_termios_linesw>
40010ccc: 00579793 slli a5,a5,0x5
40010cd0: 00f907b3 add a5,s2,a5
40010cd4: 0107a783 lw a5,16(a5)
{
40010cd8: 04812c23 sw s0,88(sp)
40010cdc: 04912a23 sw s1,84(sp)
40010ce0: 05312623 sw s3,76(sp)
40010ce4: 04112e23 sw ra,92(sp)
40010ce8: 05412423 sw s4,72(sp)
40010cec: 05512223 sw s5,68(sp)
40010cf0: 05612023 sw s6,64(sp)
40010cf4: 03712e23 sw s7,60(sp)
40010cf8: 03812c23 sw s8,56(sp)
40010cfc: 03912a23 sw s9,52(sp)
40010d00: 03a12823 sw s10,48(sp)
40010d04: 03b12623 sw s11,44(sp)
40010d08: 00050413 mv s0,a0
40010d0c: 00058493 mv s1,a1
40010d10: 00060993 mv s3,a2
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
40010d14: 0a078063 beqz a5,40010db4 <rtems_termios_enqueue_raw_characters+0xfc>
while (len--) {
40010d18: 02060a63 beqz a2,40010d4c <rtems_termios_enqueue_raw_characters+0x94><== NEVER TAKEN
40010d1c: fff60993 addi s3,a2,-1
40010d20: 013589b3 add s3,a1,s3
40010d24: 0180006f j 40010d3c <rtems_termios_enqueue_raw_characters+0x84>
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
40010d28: 15c42783 lw a5,348(s0)
40010d2c: 00148493 addi s1,s1,1
40010d30: 00579793 slli a5,a5,0x5
40010d34: 00f907b3 add a5,s2,a5
40010d38: 0107a783 lw a5,16(a5)
40010d3c: 0004c503 lbu a0,0(s1)
40010d40: 00040593 mv a1,s0
40010d44: 000780e7 jalr a5
while (len--) {
40010d48: ff3490e3 bne s1,s3,40010d28 <rtems_termios_enqueue_raw_characters+0x70>
if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
40010d4c: 16c42783 lw a5,364(s0)
return 0;
40010d50: 00000a13 li s4,0
if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
40010d54: 02078063 beqz a5,40010d74 <rtems_termios_enqueue_raw_characters+0xbc>
40010d58: 17444703 lbu a4,372(s0)
40010d5c: 00071c63 bnez a4,40010d74 <rtems_termios_enqueue_raw_characters+0xbc><== NEVER TAKEN
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
40010d60: 17042583 lw a1,368(s0)
tty->tty_rcvwakeup = true;
40010d64: 00100713 li a4,1
40010d68: 16e40a23 sb a4,372(s0)
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
40010d6c: 05040513 addi a0,s0,80
40010d70: 000780e7 jalr a5
}
40010d74: 05c12083 lw ra,92(sp)
40010d78: 05812403 lw s0,88(sp)
40010d7c: 05412483 lw s1,84(sp)
40010d80: 05012903 lw s2,80(sp)
40010d84: 04c12983 lw s3,76(sp)
40010d88: 04412a83 lw s5,68(sp)
40010d8c: 04012b03 lw s6,64(sp)
40010d90: 03c12b83 lw s7,60(sp)
40010d94: 03812c03 lw s8,56(sp)
40010d98: 03412c83 lw s9,52(sp)
40010d9c: 03012d03 lw s10,48(sp)
40010da0: 02c12d83 lw s11,44(sp)
40010da4: 000a0513 mv a0,s4
40010da8: 04812a03 lw s4,72(sp)
40010dac: 06010113 addi sp,sp,96
40010db0: 00008067 ret
int dropped = 0;
40010db4: 00000a13 li s4,0
while (len--) {
40010db8: 00000713 li a4,0
40010dbc: 14060063 beqz a2,40010efc <rtems_termios_enqueue_raw_characters+0x244><== NEVER TAKEN
rtems_termios_device_context *ctx = tty->device_context;
40010dc0: 17c52d03 lw s10,380(a0)
(void *)&(tty->termios.c_cc[VSTOP]), 1);
40010dc4: 06d50793 addi a5,a0,109
rtems_termios_device_context *ctx = tty->device_context;
40010dc8: 00058913 mv s2,a1
bool flow_rcv = false; /* true, if flow control char received */
40010dcc: 00000c93 li s9,0
int dropped = 0;
40010dd0: 00000a13 li s4,0
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
40010dd4: 02000a93 li s5,32
40010dd8: 00100c13 li s8,1
if (c == '\r' && (tty->termios.c_iflag & IGNCR) != 0) {
40010ddc: 00d00b13 li s6,13
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
40010de0: 05050b93 addi s7,a0,80
(void *)&(tty->termios.c_cc[VSTOP]), 1);
40010de4: 00f12223 sw a5,4(sp)
if (tty->flow_ctrl & FL_MDXON) {
40010de8: 14842783 lw a5,328(s0)
c = *buf++;
40010dec: 00190913 addi s2,s2,1
40010df0: fff94503 lbu a0,-1(s2)
if (tty->flow_ctrl & FL_MDXON) {
40010df4: 2007f793 andi a5,a5,512
40010df8: 00078a63 beqz a5,40010e0c <rtems_termios_enqueue_raw_characters+0x154>
if (c == tty->termios.c_cc[VSTOP]) {
40010dfc: 06d44783 lbu a5,109(s0)
if (c == tty->termios.c_cc[VSTART]) {
40010e00: 06c44603 lbu a2,108(s0)
if (c == tty->termios.c_cc[VSTOP]) {
40010e04: 18a78863 beq a5,a0,40010f94 <rtems_termios_enqueue_raw_characters+0x2dc>
else if (c == tty->termios.c_cc[VSTART]) {
40010e08: 10c50663 beq a0,a2,40010f14 <rtems_termios_enqueue_raw_characters+0x25c>
if (flow_rcv) {
40010e0c: 100c9a63 bnez s9,40010f20 <rtems_termios_enqueue_raw_characters+0x268><== NEVER TAKEN
if (c == '\r' && (tty->termios.c_iflag & IGNCR) != 0) {
40010e10: 19650c63 beq a0,s6,40010fa8 <rtems_termios_enqueue_raw_characters+0x2f0>
c = iprocEarly (c, tty);
40010e14: 00040593 mv a1,s0
40010e18: 9b5fd0ef jal ra,4000e7cc <iprocEarly>
( *context->lock_acquire )( context, lock_context );
40010e1c: 014d2783 lw a5,20(s10)
40010e20: 01c10593 addi a1,sp,28
40010e24: 00050d93 mv s11,a0
40010e28: 000d0513 mv a0,s10
40010e2c: 000780e7 jalr a5
head = tty->rawInBuf.Head;
40010e30: 08442803 lw a6,132(s0)
oldTail = tty->rawInBuf.Tail;
40010e34: 08842783 lw a5,136(s0)
newTail = (oldTail + 1) % tty->rawInBuf.Size;
40010e38: 08c42583 lw a1,140(s0)
if ((tty->flow_ctrl & FL_IREQXOF) != 0 && (((newTail - head) %
40010e3c: 14842603 lw a2,328(s0)
newTail = (oldTail + 1) % tty->rawInBuf.Size;
40010e40: 00178793 addi a5,a5,1
40010e44: 02b7f7b3 remu a5,a5,a1
if ((tty->flow_ctrl & FL_IREQXOF) != 0 && (((newTail - head) %
40010e48: 00167613 andi a2,a2,1
40010e4c: 06060863 beqz a2,40010ebc <rtems_termios_enqueue_raw_characters+0x204><== ALWAYS TAKEN
tty->rawInBuf.Size) > tty->highwater)) {
40010e50: 08c42503 lw a0,140(s0) <== NOT EXECUTED
if ((tty->flow_ctrl & FL_IREQXOF) != 0 && (((newTail - head) %
40010e54: 41078633 sub a2,a5,a6 <== NOT EXECUTED
40010e58: 15042583 lw a1,336(s0) <== NOT EXECUTED
40010e5c: 02a67633 remu a2,a2,a0 <== NOT EXECUTED
40010e60: 04c5fe63 bgeu a1,a2,40010ebc <rtems_termios_enqueue_raw_characters+0x204><== NOT EXECUTED
tty->flow_ctrl |= FL_IREQXOF;
40010e64: 14842603 lw a2,328(s0) <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
40010e68: 40000593 li a1,1024 <== NOT EXECUTED
tty->flow_ctrl |= FL_IREQXOF;
40010e6c: 00166613 ori a2,a2,1 <== NOT EXECUTED
40010e70: 14c42423 sw a2,328(s0) <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
40010e74: 14842603 lw a2,328(s0) <== NOT EXECUTED
40010e78: 40267613 andi a2,a2,1026 <== NOT EXECUTED
40010e7c: 1ab60663 beq a2,a1,40011028 <rtems_termios_enqueue_raw_characters+0x370><== NOT EXECUTED
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
40010e80: 14842603 lw a2,328(s0) <== NOT EXECUTED
40010e84: 10000593 li a1,256 <== NOT EXECUTED
40010e88: 10467613 andi a2,a2,260 <== NOT EXECUTED
40010e8c: 02b61863 bne a2,a1,40010ebc <rtems_termios_enqueue_raw_characters+0x204><== NOT EXECUTED
tty->flow_ctrl |= FL_IRTSOFF;
40010e90: 14842603 lw a2,328(s0) <== NOT EXECUTED
if (tty->flow.stop_remote_tx != NULL) {
40010e94: 14042583 lw a1,320(s0) <== NOT EXECUTED
tty->flow_ctrl |= FL_IRTSOFF;
40010e98: 00466613 ori a2,a2,4 <== NOT EXECUTED
40010e9c: 14c42423 sw a2,328(s0) <== NOT EXECUTED
if (tty->flow.stop_remote_tx != NULL) {
40010ea0: 00058e63 beqz a1,40010ebc <rtems_termios_enqueue_raw_characters+0x204><== NOT EXECUTED
tty->flow.stop_remote_tx(ctx);
40010ea4: 000d0513 mv a0,s10 <== NOT EXECUTED
40010ea8: 00f12623 sw a5,12(sp) <== NOT EXECUTED
40010eac: 01012423 sw a6,8(sp) <== NOT EXECUTED
40010eb0: 000580e7 jalr a1 <== NOT EXECUTED
40010eb4: 00c12783 lw a5,12(sp) <== NOT EXECUTED
40010eb8: 00812803 lw a6,8(sp) <== NOT EXECUTED
if (newTail != head) {
40010ebc: 0ef80e63 beq a6,a5,40010fb8 <rtems_termios_enqueue_raw_characters+0x300>
tty->rawInBuf.theBuf[newTail] = c;
40010ec0: 08042603 lw a2,128(s0)
40010ec4: 00f60633 add a2,a2,a5
40010ec8: 01b60023 sb s11,0(a2)
if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
40010ecc: 16c42603 lw a2,364(s0)
tty->rawInBuf.Tail = newTail;
40010ed0: 08f42423 sw a5,136(s0)
if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
40010ed4: 12060863 beqz a2,40011004 <rtems_termios_enqueue_raw_characters+0x34c>
40010ed8: 17444583 lbu a1,372(s0)
( *context->lock_release )( context, lock_context );
40010edc: 018d2603 lw a2,24(s10)
40010ee0: 18058463 beqz a1,40011068 <rtems_termios_enqueue_raw_characters+0x3b0>
40010ee4: 01c10593 addi a1,sp,28
40010ee8: 000d0513 mv a0,s10
40010eec: 000600e7 jalr a2
while (len--) {
40010ef0: 413907b3 sub a5,s2,s3
40010ef4: ee979ae3 bne a5,s1,40010de8 <rtems_termios_enqueue_raw_characters+0x130>
tty->rawInBufDropped += dropped;
40010ef8: 000a0713 mv a4,s4
40010efc: 0b442783 lw a5,180(s0)
_Semaphore_Post_binary( &binary_semaphore->Semaphore );
40010f00: 09040513 addi a0,s0,144
40010f04: 00e787b3 add a5,a5,a4
40010f08: 0af42a23 sw a5,180(s0)
40010f0c: 1a9000ef jal ra,400118b4 <_Semaphore_Post_binary>
return dropped;
40010f10: e65ff06f j 40010d74 <rtems_termios_enqueue_raw_characters+0xbc>
tty->flow_ctrl &= ~FL_ORCVXOF;
40010f14: 14842783 lw a5,328(s0) <== NOT EXECUTED
40010f18: fef7f793 andi a5,a5,-17 <== NOT EXECUTED
40010f1c: 14f42423 sw a5,328(s0) <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
40010f20: 14842783 lw a5,328(s0)
40010f24: 00100c93 li s9,1
40010f28: 0307f793 andi a5,a5,48
40010f2c: 01578863 beq a5,s5,40010f3c <rtems_termios_enqueue_raw_characters+0x284>
while (len--) {
40010f30: 413907b3 sub a5,s2,s3
40010f34: ea979ae3 bne a5,s1,40010de8 <rtems_termios_enqueue_raw_characters+0x130>
40010f38: fc1ff06f j 40010ef8 <rtems_termios_enqueue_raw_characters+0x240>
( *context->lock_acquire )( context, lock_context );
40010f3c: 014d2783 lw a5,20(s10) <== NOT EXECUTED
40010f40: 01c10593 addi a1,sp,28 <== NOT EXECUTED
40010f44: 000d0513 mv a0,s10 <== NOT EXECUTED
40010f48: 000780e7 jalr a5 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
40010f4c: 14842783 lw a5,328(s0) <== NOT EXECUTED
if (tty->rawOutBufState != rob_idle) {
40010f50: 0e442683 lw a3,228(s0) <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
40010f54: fdf7f793 andi a5,a5,-33 <== NOT EXECUTED
40010f58: 14f42423 sw a5,328(s0) <== NOT EXECUTED
if (tty->rawOutBufState != rob_idle) {
40010f5c: 02068063 beqz a3,40010f7c <rtems_termios_enqueue_raw_characters+0x2c4><== NOT EXECUTED
ctx, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
40010f60: 0c042683 lw a3,192(s0) <== NOT EXECUTED
40010f64: 0b842583 lw a1,184(s0) <== NOT EXECUTED
(*tty->handler.write)(
40010f68: 13042783 lw a5,304(s0) <== NOT EXECUTED
40010f6c: 00100613 li a2,1 <== NOT EXECUTED
40010f70: 00d585b3 add a1,a1,a3 <== NOT EXECUTED
40010f74: 000d0513 mv a0,s10 <== NOT EXECUTED
40010f78: 000780e7 jalr a5 <== NOT EXECUTED
( *context->lock_release )( context, lock_context );
40010f7c: 018d2783 lw a5,24(s10) <== NOT EXECUTED
40010f80: 01c10593 addi a1,sp,28 <== NOT EXECUTED
40010f84: 000d0513 mv a0,s10 <== NOT EXECUTED
40010f88: 000780e7 jalr a5 <== NOT EXECUTED
}
40010f8c: 00100c93 li s9,1 <== NOT EXECUTED
40010f90: fa1ff06f j 40010f30 <rtems_termios_enqueue_raw_characters+0x278> <== NOT EXECUTED
if (c == tty->termios.c_cc[VSTART]) {
40010f94: 08c78263 beq a5,a2,40011018 <rtems_termios_enqueue_raw_characters+0x360>
tty->flow_ctrl |= FL_ORCVXOF;
40010f98: 14842783 lw a5,328(s0)
40010f9c: 0107e793 ori a5,a5,16
40010fa0: 14f42423 sw a5,328(s0)
40010fa4: f7dff06f j 40010f20 <rtems_termios_enqueue_raw_characters+0x268>
if (c == '\r' && (tty->termios.c_iflag & IGNCR) != 0) {
40010fa8: 05042783 lw a5,80(s0)
40010fac: 0807f793 andi a5,a5,128
40010fb0: e60782e3 beqz a5,40010e14 <rtems_termios_enqueue_raw_characters+0x15c>
40010fb4: f7dff06f j 40010f30 <rtems_termios_enqueue_raw_characters+0x278>
if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
40010fb8: 16c42603 lw a2,364(s0)
( *context->lock_release )( context, lock_context );
40010fbc: 018d2783 lw a5,24(s10)
++dropped;
40010fc0: 001a0a13 addi s4,s4,1
if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
40010fc4: 02060863 beqz a2,40010ff4 <rtems_termios_enqueue_raw_characters+0x33c><== NEVER TAKEN
40010fc8: 17444603 lbu a2,372(s0)
40010fcc: 02061463 bnez a2,40010ff4 <rtems_termios_enqueue_raw_characters+0x33c><== NEVER TAKEN
tty->tty_rcvwakeup = true;
40010fd0: 17840a23 sb s8,372(s0)
40010fd4: 01c10593 addi a1,sp,28
40010fd8: 000d0513 mv a0,s10
40010fdc: 000780e7 jalr a5
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
40010fe0: 16c42783 lw a5,364(s0)
40010fe4: 17042583 lw a1,368(s0)
40010fe8: 000b8513 mv a0,s7
40010fec: 000780e7 jalr a5
40010ff0: f41ff06f j 40010f30 <rtems_termios_enqueue_raw_characters+0x278>
40010ff4: 01c10593 addi a1,sp,28 <== NOT EXECUTED
40010ff8: 000d0513 mv a0,s10 <== NOT EXECUTED
40010ffc: 000780e7 jalr a5 <== NOT EXECUTED
if (callReciveCallback) {
40011000: f31ff06f j 40010f30 <rtems_termios_enqueue_raw_characters+0x278> <== NOT EXECUTED
40011004: 018d2783 lw a5,24(s10)
40011008: 01c10593 addi a1,sp,28
4001100c: 000d0513 mv a0,s10
40011010: 000780e7 jalr a5
40011014: f1dff06f j 40010f30 <rtems_termios_enqueue_raw_characters+0x278>
tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF;
40011018: 14842783 lw a5,328(s0) <== NOT EXECUTED
4001101c: 0107c793 xori a5,a5,16 <== NOT EXECUTED
40011020: 14f42423 sw a5,328(s0) <== NOT EXECUTED
40011024: efdff06f j 40010f20 <rtems_termios_enqueue_raw_characters+0x268> <== NOT EXECUTED
if ((tty->flow_ctrl & FL_OSTOP) ||
40011028: 14842603 lw a2,328(s0) <== NOT EXECUTED
4001102c: 02067613 andi a2,a2,32 <== NOT EXECUTED
40011030: 0a060063 beqz a2,400110d0 <rtems_termios_enqueue_raw_characters+0x418><== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
40011034: 14842583 lw a1,328(s0) <== NOT EXECUTED
(*tty->handler.write)(ctx,
40011038: 13042883 lw a7,304(s0) <== NOT EXECUTED
4001103c: 00100613 li a2,1 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
40011040: 0025e593 ori a1,a1,2 <== NOT EXECUTED
40011044: 14b42423 sw a1,328(s0) <== NOT EXECUTED
(*tty->handler.write)(ctx,
40011048: 00412583 lw a1,4(sp) <== NOT EXECUTED
4001104c: 000d0513 mv a0,s10 <== NOT EXECUTED
40011050: 00f12623 sw a5,12(sp) <== NOT EXECUTED
40011054: 01012423 sw a6,8(sp) <== NOT EXECUTED
40011058: 000880e7 jalr a7 <== NOT EXECUTED
4001105c: 00812803 lw a6,8(sp) <== NOT EXECUTED
40011060: 00c12783 lw a5,12(sp) <== NOT EXECUTED
40011064: e59ff06f j 40010ebc <rtems_termios_enqueue_raw_characters+0x204> <== NOT EXECUTED
if ((tty->termios.c_lflag & ICANON) != 0) {
40011068: 05c42583 lw a1,92(s0)
4001106c: 1005f593 andi a1,a1,256
40011070: 02058c63 beqz a1,400110a8 <rtems_termios_enqueue_raw_characters+0x3f0>
c == tty->termios.c_cc[VEOL] || c == tty->termios.c_cc[VEOL2];
40011074: 00a00793 li a5,10
40011078: 04fd8263 beq s11,a5,400110bc <rtems_termios_enqueue_raw_characters+0x404>
return c == '\n' || c == tty->termios.c_cc[VEOF] ||
4001107c: 06044783 lbu a5,96(s0)
40011080: 03b78e63 beq a5,s11,400110bc <rtems_termios_enqueue_raw_characters+0x404>
40011084: 06144783 lbu a5,97(s0)
40011088: 03b78a63 beq a5,s11,400110bc <rtems_termios_enqueue_raw_characters+0x404>
if (mustCallReceiveCallback (tty, c, newTail, head)) {
4001108c: 06244783 lbu a5,98(s0)
40011090: 03b78663 beq a5,s11,400110bc <rtems_termios_enqueue_raw_characters+0x404>
40011094: 01c10593 addi a1,sp,28
40011098: 000d0513 mv a0,s10
4001109c: 000600e7 jalr a2
400110a0: 00000c93 li s9,0
400110a4: e8dff06f j 40010f30 <rtems_termios_enqueue_raw_characters+0x278>
unsigned int rawContentSize = (newTail - head) % tty->rawInBuf.Size;
400110a8: 08c42503 lw a0,140(s0)
400110ac: 410787b3 sub a5,a5,a6
return rawContentSize >= tty->termios.c_cc[VMIN];
400110b0: 07044583 lbu a1,112(s0)
unsigned int rawContentSize = (newTail - head) % tty->rawInBuf.Size;
400110b4: 02a7f7b3 remu a5,a5,a0
if (mustCallReceiveCallback (tty, c, newTail, head)) {
400110b8: fcb7eee3 bltu a5,a1,40011094 <rtems_termios_enqueue_raw_characters+0x3dc>
tty->tty_rcvwakeup = true;
400110bc: 17840a23 sb s8,372(s0)
400110c0: 01c10593 addi a1,sp,28
400110c4: 000d0513 mv a0,s10
400110c8: 000600e7 jalr a2
if (callReciveCallback) {
400110cc: f15ff06f j 40010fe0 <rtems_termios_enqueue_raw_characters+0x328>
if ((tty->flow_ctrl & FL_OSTOP) ||
400110d0: 0e442603 lw a2,228(s0) <== NOT EXECUTED
400110d4: de0614e3 bnez a2,40010ebc <rtems_termios_enqueue_raw_characters+0x204><== NOT EXECUTED
400110d8: f5dff06f j 40011034 <rtems_termios_enqueue_raw_characters+0x37c> <== NOT EXECUTED
400106c4 <rtems_termios_ioctl>:
struct rtems_termios_tty *tty = args->iop->data1;
400106c4: 00052783 lw a5,0(a0)
{
400106c8: fd010113 addi sp,sp,-48
400106cc: 02812423 sw s0,40(sp)
struct rtems_termios_tty *tty = args->iop->data1;
400106d0: 02c7a403 lw s0,44(a5)
{
400106d4: 02912223 sw s1,36(sp)
400106d8: 03212023 sw s2,32(sp)
400106dc: 01412c23 sw s4,24(sp)
400106e0: 02112623 sw ra,44(sp)
400106e4: 01312e23 sw s3,28(sp)
rtems_mutex_lock (&tty->osem);
400106e8: 02840913 addi s2,s0,40
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
400106ec: 00852a03 lw s4,8(a0)
{
400106f0: 00050493 mv s1,a0
args->ioctl_return = 0;
400106f4: 00052623 sw zero,12(a0)
_Mutex_Acquire( mutex );
400106f8: 00090513 mv a0,s2
400106fc: 9b0f40ef jal ra,400048ac <_Mutex_Acquire>
switch (args->command) {
40010700: 0044a583 lw a1,4(s1)
40010704: 80047737 lui a4,0x80047
40010708: 41070793 addi a5,a4,1040 # 80047410 <RamEnd+0x3f047410>
4001070c: 34f58863 beq a1,a5,40010a5c <rtems_termios_ioctl+0x398>
40010710: 1cb7f463 bgeu a5,a1,400108d8 <rtems_termios_ioctl+0x214>
40010714: 800877b7 lui a5,0x80087
40010718: 40c78693 addi a3,a5,1036 # 8008740c <RamEnd+0x3f08740c>
4001071c: 3ad58c63 beq a1,a3,40010ad4 <rtems_termios_ioctl+0x410>
40010720: 2ab6f463 bgeu a3,a1,400109c8 <rtems_termios_ioctl+0x304>
40010724: 7fd39737 lui a4,0x7fd39
40010728: bec70793 addi a5,a4,-1044 # 7fd38bec <RamEnd+0x3ed38bec>
4001072c: 00f587b3 add a5,a1,a5
40010730: 00200693 li a3,2
40010734: 3af6ec63 bltu a3,a5,40010aec <rtems_termios_ioctl+0x428>
tty->termios = *(struct termios *)args->buffer;
40010738: 0084a783 lw a5,8(s1)
if (args->command == TIOCSETAW || args->command == TIOCSETAF) {
4001073c: beb70713 addi a4,a4,-1045
40010740: 00e585b3 add a1,a1,a4
tty->termios = *(struct termios *)args->buffer;
40010744: 0007af83 lw t6,0(a5)
40010748: 0047af03 lw t5,4(a5)
4001074c: 0087ae83 lw t4,8(a5)
40010750: 00c7ae03 lw t3,12(a5)
40010754: 0107a303 lw t1,16(a5)
40010758: 0147a883 lw a7,20(a5)
4001075c: 0187a803 lw a6,24(a5)
40010760: 01c7a503 lw a0,28(a5)
40010764: 0207a603 lw a2,32(a5)
40010768: 0247a683 lw a3,36(a5)
4001076c: 0287a703 lw a4,40(a5)
if (args->command == TIOCSETAW || args->command == TIOCSETAF) {
40010770: 00100793 li a5,1
tty->termios = *(struct termios *)args->buffer;
40010774: 05f42823 sw t6,80(s0)
40010778: 05e42a23 sw t5,84(s0)
4001077c: 05d42c23 sw t4,88(s0)
40010780: 05c42e23 sw t3,92(s0)
40010784: 06642023 sw t1,96(s0)
40010788: 07142223 sw a7,100(s0)
4001078c: 07042423 sw a6,104(s0)
40010790: 06a42623 sw a0,108(s0)
40010794: 06c42823 sw a2,112(s0)
40010798: 06d42a23 sw a3,116(s0)
4001079c: 06e42c23 sw a4,120(s0)
if (args->command == TIOCSETAW || args->command == TIOCSETAF) {
400107a0: 42b7f463 bgeu a5,a1,40010bc8 <rtems_termios_ioctl+0x504>
if (( tty->flow_ctrl & FL_MDXON) &&
400107a4: 14842783 lw a5,328(s0)
rtems_termios_device_context *ctx = tty->device_context;
400107a8: 17c42983 lw s3,380(s0)
if (( tty->flow_ctrl & FL_MDXON) &&
400107ac: 2007f793 andi a5,a5,512
400107b0: 06078c63 beqz a5,40010828 <rtems_termios_ioctl+0x164>
!(tty->termios.c_iflag & IXON)) {
400107b4: 05042783 lw a5,80(s0)
400107b8: 2007f793 andi a5,a5,512
if (( tty->flow_ctrl & FL_MDXON) &&
400107bc: 06079663 bnez a5,40010828 <rtems_termios_ioctl+0x164>
tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF);
400107c0: 14842783 lw a5,328(s0)
400107c4: def7f793 andi a5,a5,-529
400107c8: 14f42423 sw a5,328(s0)
if (tty->flow_ctrl & FL_OSTOP) {
400107cc: 14842783 lw a5,328(s0)
400107d0: 0207f793 andi a5,a5,32
400107d4: 04078a63 beqz a5,40010828 <rtems_termios_ioctl+0x164> <== ALWAYS TAKEN
( *context->lock_acquire )( context, lock_context );
400107d8: 0149a783 lw a5,20(s3) <== NOT EXECUTED
400107dc: 00c10593 addi a1,sp,12 <== NOT EXECUTED
400107e0: 00098513 mv a0,s3 <== NOT EXECUTED
400107e4: 000780e7 jalr a5 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
400107e8: 14842783 lw a5,328(s0) <== NOT EXECUTED
if (tty->rawOutBufState != rob_idle) {
400107ec: 0e442703 lw a4,228(s0) <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
400107f0: fdf7f793 andi a5,a5,-33 <== NOT EXECUTED
400107f4: 14f42423 sw a5,328(s0) <== NOT EXECUTED
if (tty->rawOutBufState != rob_idle) {
400107f8: 02070063 beqz a4,40010818 <rtems_termios_ioctl+0x154> <== NOT EXECUTED
ctx, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
400107fc: 0c042703 lw a4,192(s0) <== NOT EXECUTED
40010800: 0b842583 lw a1,184(s0) <== NOT EXECUTED
(*tty->handler.write)(
40010804: 13042783 lw a5,304(s0) <== NOT EXECUTED
40010808: 00100613 li a2,1 <== NOT EXECUTED
4001080c: 00e585b3 add a1,a1,a4 <== NOT EXECUTED
40010810: 00098513 mv a0,s3 <== NOT EXECUTED
40010814: 000780e7 jalr a5 <== NOT EXECUTED
( *context->lock_release )( context, lock_context );
40010818: 0189a783 lw a5,24(s3) <== NOT EXECUTED
4001081c: 00c10593 addi a1,sp,12 <== NOT EXECUTED
40010820: 00098513 mv a0,s3 <== NOT EXECUTED
40010824: 000780e7 jalr a5 <== NOT EXECUTED
if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
40010828: 14842783 lw a5,328(s0)
4001082c: 4007f793 andi a5,a5,1024
40010830: 00078863 beqz a5,40010840 <rtems_termios_ioctl+0x17c>
40010834: 05042783 lw a5,80(s0)
40010838: 4007f793 andi a5,a5,1024
4001083c: 3e078063 beqz a5,40010c1c <rtems_termios_ioctl+0x558> <== ALWAYS TAKEN
if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
40010840: 14842703 lw a4,328(s0)
40010844: 05842783 lw a5,88(s0)
40010848: 000304b7 lui s1,0x30
4001084c: 10077713 andi a4,a4,256
40010850: 00f4f7b3 and a5,s1,a5
40010854: 36070063 beqz a4,40010bb4 <rtems_termios_ioctl+0x4f0> <== ALWAYS TAKEN
40010858: 32078063 beqz a5,40010b78 <rtems_termios_ioctl+0x4b4> <== NOT EXECUTED
tty->flow_ctrl |= FL_MDRTS;
4001085c: 14842783 lw a5,328(s0) <== NOT EXECUTED
40010860: 1007e793 ori a5,a5,256 <== NOT EXECUTED
40010864: 14f42423 sw a5,328(s0) <== NOT EXECUTED
if (tty->termios.c_iflag & IXOFF) {
40010868: 05042783 lw a5,80(s0)
4001086c: 4007f713 andi a4,a5,1024
40010870: 00070863 beqz a4,40010880 <rtems_termios_ioctl+0x1bc>
tty->flow_ctrl |= FL_MDXOF;
40010874: 14842703 lw a4,328(s0)
40010878: 40076713 ori a4,a4,1024
4001087c: 14e42423 sw a4,328(s0)
if (tty->termios.c_iflag & IXON) {
40010880: 2007f793 andi a5,a5,512
40010884: 00078863 beqz a5,40010894 <rtems_termios_ioctl+0x1d0>
tty->flow_ctrl |= FL_MDXON;
40010888: 14842783 lw a5,328(s0)
4001088c: 2007e793 ori a5,a5,512
40010890: 14f42423 sw a5,328(s0)
if (tty->termios.c_lflag & ICANON) {
40010894: 05c42783 lw a5,92(s0)
40010898: 1007f793 andi a5,a5,256
4001089c: 2a079463 bnez a5,40010b44 <rtems_termios_ioctl+0x480>
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
400108a0: 07144703 lbu a4,113(s0)
400108a4: 8201a783 lw a5,-2016(gp) # 40014a30 <_Watchdog_Ticks_per_second>
rtems_clock_get_ticks_per_second() / 10;
400108a8: 00a00613 li a2,10
if (tty->termios.c_cc[VMIN])
400108ac: 07044683 lbu a3,112(s0)
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
400108b0: 02f707b3 mul a5,a4,a5
rtems_clock_get_ticks_per_second() / 10;
400108b4: 02c7d7b3 divu a5,a5,a2
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
400108b8: 06f42e23 sw a5,124(s0)
if (tty->termios.c_cc[VTIME]) {
400108bc: 34070a63 beqz a4,40010c10 <rtems_termios_ioctl+0x54c>
tty->rawInBufSemaphoreWait = true;
400108c0: 00100713 li a4,1
400108c4: 0ae40423 sb a4,168(s0)
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
400108c8: 0af42623 sw a5,172(s0)
if (tty->termios.c_cc[VMIN])
400108cc: 28069263 bnez a3,40010b50 <rtems_termios_ioctl+0x48c>
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
400108d0: 0af42823 sw a5,176(s0)
400108d4: 2800006f j 40010b54 <rtems_termios_ioctl+0x490>
switch (args->command) {
400108d8: 400477b7 lui a5,0x40047
400108dc: 41a78793 addi a5,a5,1050 # 4004741a <WorkAreaBase+0x2b91a>
400108e0: 22f58e63 beq a1,a5,40010b1c <rtems_termios_ioctl+0x458>
400108e4: 08b7fe63 bgeu a5,a1,40010980 <rtems_termios_ioctl+0x2bc>
400108e8: 402c77b7 lui a5,0x402c7
400108ec: 41378793 addi a5,a5,1043 # 402c7413 <WorkAreaBase+0x2ab913>
400108f0: 1ef59e63 bne a1,a5,40010aec <rtems_termios_ioctl+0x428>
*(struct termios *)args->buffer = tty->termios;
400108f4: 0084a783 lw a5,8(s1) # 30008 <bsp_section_text_size+0x1d8b4>
400108f8: 05042f03 lw t5,80(s0)
400108fc: 05442e83 lw t4,84(s0)
40010900: 05842e03 lw t3,88(s0)
40010904: 05c42303 lw t1,92(s0)
40010908: 06042883 lw a7,96(s0)
4001090c: 06442803 lw a6,100(s0)
40010910: 06842503 lw a0,104(s0)
40010914: 06c42583 lw a1,108(s0)
40010918: 07042603 lw a2,112(s0)
4001091c: 07442683 lw a3,116(s0)
40010920: 07842703 lw a4,120(s0)
sc = RTEMS_SUCCESSFUL;
40010924: 00000993 li s3,0
*(struct termios *)args->buffer = tty->termios;
40010928: 01e7a023 sw t5,0(a5)
4001092c: 01d7a223 sw t4,4(a5)
40010930: 01c7a423 sw t3,8(a5)
40010934: 0067a623 sw t1,12(a5)
40010938: 0117a823 sw a7,16(a5)
4001093c: 0107aa23 sw a6,20(a5)
40010940: 00a7ac23 sw a0,24(a5)
40010944: 00b7ae23 sw a1,28(a5)
40010948: 02c7a023 sw a2,32(a5)
4001094c: 02d7a223 sw a3,36(a5)
40010950: 02e7a423 sw a4,40(a5)
_Mutex_Release( mutex );
40010954: 00090513 mv a0,s2
40010958: fc5f30ef jal ra,4000491c <_Mutex_Release>
}
4001095c: 02c12083 lw ra,44(sp)
40010960: 02812403 lw s0,40(sp)
40010964: 02412483 lw s1,36(sp)
40010968: 02012903 lw s2,32(sp)
4001096c: 01812a03 lw s4,24(sp)
40010970: 00098513 mv a0,s3
40010974: 01c12983 lw s3,28(sp)
40010978: 03010113 addi sp,sp,48
4001097c: 00008067 ret
switch (args->command) {
40010980: 200077b7 lui a5,0x20007
40010984: 45e78793 addi a5,a5,1118 # 2000745e <RamSize+0x1f00745e>
40010988: 0cf58263 beq a1,a5,40010a4c <rtems_termios_ioctl+0x388>
4001098c: 400467b7 lui a5,0x40046
40010990: 67f78793 addi a5,a5,1663 # 4004667f <WorkAreaBase+0x2ab7f>
40010994: 14f59c63 bne a1,a5,40010aec <rtems_termios_ioctl+0x428>
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
40010998: 08842783 lw a5,136(s0) <== NOT EXECUTED
4001099c: 08442703 lw a4,132(s0) <== NOT EXECUTED
400109a0: 40e78733 sub a4,a5,a4 <== NOT EXECUTED
if ( rawnc < 0 )
400109a4: 20074c63 bltz a4,40010bbc <rtems_termios_ioctl+0x4f8> <== NOT EXECUTED
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
400109a8: 04042783 lw a5,64(s0) <== NOT EXECUTED
400109ac: 04442603 lw a2,68(s0) <== NOT EXECUTED
400109b0: 0084a683 lw a3,8(s1) <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
400109b4: 00000993 li s3,0 <== NOT EXECUTED
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
400109b8: 40c787b3 sub a5,a5,a2 <== NOT EXECUTED
400109bc: 00e787b3 add a5,a5,a4 <== NOT EXECUTED
400109c0: 00f6a023 sw a5,0(a3) <== NOT EXECUTED
break;
400109c4: f91ff06f j 40010954 <rtems_termios_ioctl+0x290> <== NOT EXECUTED
switch (args->command) {
400109c8: 41b70713 addi a4,a4,1051
400109cc: 02e58263 beq a1,a4,400109f0 <rtems_termios_ioctl+0x32c>
400109d0: 40b78793 addi a5,a5,1035
400109d4: 10f59c63 bne a1,a5,40010aec <rtems_termios_ioctl+0x428>
tty->tty_snd = *wakeup;
400109d8: 000a2783 lw a5,0(s4)
sc = RTEMS_SUCCESSFUL;
400109dc: 00000993 li s3,0
tty->tty_snd = *wakeup;
400109e0: 16f42223 sw a5,356(s0)
400109e4: 004a2783 lw a5,4(s4)
400109e8: 16f42423 sw a5,360(s0)
break;
400109ec: f69ff06f j 40010954 <rtems_termios_ioctl+0x290>
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
400109f0: 15c42783 lw a5,348(s0)
400109f4: 40019a37 lui s4,0x40019
400109f8: 6cca0a13 addi s4,s4,1740 # 400196cc <rtems_termios_linesw>
400109fc: 00579793 slli a5,a5,0x5
40010a00: 00fa07b3 add a5,s4,a5
40010a04: 0047a783 lw a5,4(a5)
sc = RTEMS_SUCCESSFUL;
40010a08: 00000993 li s3,0
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
40010a0c: 00078863 beqz a5,40010a1c <rtems_termios_ioctl+0x358>
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
40010a10: 00040513 mv a0,s0
40010a14: 000780e7 jalr a5
40010a18: 00050993 mv s3,a0
tty->t_line=*(int*)(args->buffer);
40010a1c: 0084a783 lw a5,8(s1)
40010a20: 0007a783 lw a5,0(a5)
tty->t_sc = NULL; /* ensure that no more valid data */
40010a24: 16042023 sw zero,352(s0)
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
40010a28: 00579713 slli a4,a5,0x5
40010a2c: 00ea0a33 add s4,s4,a4
40010a30: 000a2703 lw a4,0(s4)
tty->t_line=*(int*)(args->buffer);
40010a34: 14f42e23 sw a5,348(s0)
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
40010a38: f0070ee3 beqz a4,40010954 <rtems_termios_ioctl+0x290>
sc = rtems_termios_linesw[tty->t_line].l_open(tty);
40010a3c: 00040513 mv a0,s0
40010a40: 000700e7 jalr a4
40010a44: 00050993 mv s3,a0
40010a48: f0dff06f j 40010954 <rtems_termios_ioctl+0x290>
drainOutput (tty);
40010a4c: 00040513 mv a0,s0
40010a50: e59fd0ef jal ra,4000e8a8 <drainOutput>
sc = RTEMS_SUCCESSFUL;
40010a54: 00000993 li s3,0
break;
40010a58: efdff06f j 40010954 <rtems_termios_ioctl+0x290>
flags = *((int *)args->buffer);
40010a5c: 0084a783 lw a5,8(s1)
40010a60: 0007a783 lw a5,0(a5)
if (flags == 0) {
40010a64: 0c079663 bnez a5,40010b30 <rtems_termios_ioctl+0x46c> <== ALWAYS TAKEN
40010a68: 00100493 li s1,1 <== NOT EXECUTED
rtems_termios_device_context *ctx = tty->device_context;
40010a6c: 17c42983 lw s3,380(s0)
( *context->lock_acquire )( context, lock_context );
40010a70: 00c10593 addi a1,sp,12
40010a74: 0149a783 lw a5,20(s3)
40010a78: 00098513 mv a0,s3
40010a7c: 000780e7 jalr a5
( *context->lock_release )( context, lock_context );
40010a80: 0189a783 lw a5,24(s3)
tty->rawOutBuf.Tail = 0;
40010a84: 0c042023 sw zero,192(s0)
tty->rawOutBuf.Head = 0;
40010a88: 0a042e23 sw zero,188(s0)
tty->rawOutBufState = rob_idle;
40010a8c: 0e042223 sw zero,228(s0)
40010a90: 00c10593 addi a1,sp,12
40010a94: 00098513 mv a0,s3
40010a98: 000780e7 jalr a5
if (flags & FREAD) {
40010a9c: fa048ce3 beqz s1,40010a54 <rtems_termios_ioctl+0x390>
rtems_termios_device_context *ctx = tty->device_context;
40010aa0: 17c42483 lw s1,380(s0)
( *context->lock_acquire )( context, lock_context );
40010aa4: 00c10593 addi a1,sp,12
sc = RTEMS_SUCCESSFUL;
40010aa8: 00000993 li s3,0
40010aac: 0144a783 lw a5,20(s1)
40010ab0: 00048513 mv a0,s1
40010ab4: 000780e7 jalr a5
( *context->lock_release )( context, lock_context );
40010ab8: 0184a783 lw a5,24(s1)
tty->rawInBuf.Tail = 0;
40010abc: 08042423 sw zero,136(s0)
tty->rawInBuf.Head = 0;
40010ac0: 08042223 sw zero,132(s0)
40010ac4: 00c10593 addi a1,sp,12
40010ac8: 00048513 mv a0,s1
40010acc: 000780e7 jalr a5
}
40010ad0: e85ff06f j 40010954 <rtems_termios_ioctl+0x290>
tty->tty_rcv = *wakeup;
40010ad4: 000a2783 lw a5,0(s4)
sc = RTEMS_SUCCESSFUL;
40010ad8: 00000993 li s3,0
tty->tty_rcv = *wakeup;
40010adc: 16f42623 sw a5,364(s0)
40010ae0: 004a2783 lw a5,4(s4)
40010ae4: 16f42823 sw a5,368(s0)
break;
40010ae8: e6dff06f j 40010954 <rtems_termios_ioctl+0x290>
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
40010aec: 15c42783 lw a5,348(s0)
40010af0: 00579713 slli a4,a5,0x5
40010af4: 400197b7 lui a5,0x40019
40010af8: 6cc78793 addi a5,a5,1740 # 400196cc <rtems_termios_linesw>
40010afc: 00e787b3 add a5,a5,a4
40010b00: 0187a783 lw a5,24(a5)
40010b04: 12078a63 beqz a5,40010c38 <rtems_termios_ioctl+0x574>
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
40010b08: 00048593 mv a1,s1
40010b0c: 00040513 mv a0,s0
40010b10: 000780e7 jalr a5
40010b14: 00050993 mv s3,a0
40010b18: e3dff06f j 40010954 <rtems_termios_ioctl+0x290>
*(int*)(args->buffer)=tty->t_line;
40010b1c: 15c42703 lw a4,348(s0)
40010b20: 0084a783 lw a5,8(s1)
sc = RTEMS_SUCCESSFUL;
40010b24: 00000993 li s3,0
*(int*)(args->buffer)=tty->t_line;
40010b28: 00e7a023 sw a4,0(a5)
break;
40010b2c: e29ff06f j 40010954 <rtems_termios_ioctl+0x290>
if (flags & FWRITE) {
40010b30: 0027f713 andi a4,a5,2
if (flags & FREAD) {
40010b34: 0017f493 andi s1,a5,1
if (flags & FWRITE) {
40010b38: f2071ae3 bnez a4,40010a6c <rtems_termios_ioctl+0x3a8>
if (flags & FREAD) {
40010b3c: f0048ce3 beqz s1,40010a54 <rtems_termios_ioctl+0x390> <== NEVER TAKEN
40010b40: f61ff06f j 40010aa0 <rtems_termios_ioctl+0x3dc>
tty->rawInBufSemaphoreWait = true;
40010b44: 00100793 li a5,1
40010b48: 0af40423 sb a5,168(s0)
tty->rawInBufSemaphoreTimeout = 0;
40010b4c: 0a042623 sw zero,172(s0)
tty->rawInBufSemaphoreFirstTimeout = 0;
40010b50: 0a042823 sw zero,176(s0)
if (tty->handler.set_attributes) {
40010b54: 13442783 lw a5,308(s0)
40010b58: ee078ee3 beqz a5,40010a54 <rtems_termios_ioctl+0x390>
sc = (*tty->handler.set_attributes)(tty->device_context, &tty->termios) ?
40010b5c: 17c42503 lw a0,380(s0)
40010b60: 05040593 addi a1,s0,80
RTEMS_SUCCESSFUL : RTEMS_IO_ERROR;
40010b64: 01b00993 li s3,27
sc = (*tty->handler.set_attributes)(tty->device_context, &tty->termios) ?
40010b68: 000780e7 jalr a5
RTEMS_SUCCESSFUL : RTEMS_IO_ERROR;
40010b6c: de0504e3 beqz a0,40010954 <rtems_termios_ioctl+0x290>
sc = RTEMS_SUCCESSFUL;
40010b70: 00000993 li s3,0
40010b74: de1ff06f j 40010954 <rtems_termios_ioctl+0x290>
tty->flow_ctrl &= ~(FL_MDRTS);
40010b78: 14842783 lw a5,328(s0) <== NOT EXECUTED
40010b7c: eff7f793 andi a5,a5,-257 <== NOT EXECUTED
40010b80: 14f42423 sw a5,328(s0) <== NOT EXECUTED
if ((tty->flow_ctrl & FL_IRTSOFF) &&
40010b84: 14842783 lw a5,328(s0) <== NOT EXECUTED
40010b88: 0047f793 andi a5,a5,4 <== NOT EXECUTED
40010b8c: 0c078663 beqz a5,40010c58 <rtems_termios_ioctl+0x594> <== NOT EXECUTED
(tty->flow.start_remote_tx != NULL)) {
40010b90: 14442783 lw a5,324(s0) <== NOT EXECUTED
if ((tty->flow_ctrl & FL_IRTSOFF) &&
40010b94: 0c078263 beqz a5,40010c58 <rtems_termios_ioctl+0x594> <== NOT EXECUTED
tty->flow.start_remote_tx(ctx);
40010b98: 00098513 mv a0,s3 <== NOT EXECUTED
40010b9c: 000780e7 jalr a5 <== NOT EXECUTED
tty->flow_ctrl &= ~(FL_IRTSOFF);
40010ba0: 14842703 lw a4,328(s0) <== NOT EXECUTED
if (tty->termios.c_cflag & CRTSCTS) {
40010ba4: 05842783 lw a5,88(s0) <== NOT EXECUTED
tty->flow_ctrl &= ~(FL_IRTSOFF);
40010ba8: ffb77713 andi a4,a4,-5 <== NOT EXECUTED
if (tty->termios.c_cflag & CRTSCTS) {
40010bac: 00f4f7b3 and a5,s1,a5 <== NOT EXECUTED
tty->flow_ctrl &= ~(FL_IRTSOFF);
40010bb0: 14e42423 sw a4,328(s0) <== NOT EXECUTED
if (tty->termios.c_cflag & CRTSCTS) {
40010bb4: ca078ae3 beqz a5,40010868 <rtems_termios_ioctl+0x1a4> <== ALWAYS TAKEN
40010bb8: ca5ff06f j 4001085c <rtems_termios_ioctl+0x198> <== NOT EXECUTED
rawnc += tty->rawInBuf.Size;
40010bbc: 08c42783 lw a5,140(s0) <== NOT EXECUTED
40010bc0: 00f70733 add a4,a4,a5 <== NOT EXECUTED
40010bc4: de5ff06f j 400109a8 <rtems_termios_ioctl+0x2e4> <== NOT EXECUTED
drainOutput (tty);
40010bc8: 00040513 mv a0,s0
40010bcc: cddfd0ef jal ra,4000e8a8 <drainOutput>
if (args->command == TIOCSETAF) {
40010bd0: 0044a703 lw a4,4(s1)
40010bd4: 802c77b7 lui a5,0x802c7
40010bd8: 41678793 addi a5,a5,1046 # 802c7416 <RamEnd+0x3f2c7416>
40010bdc: bcf714e3 bne a4,a5,400107a4 <rtems_termios_ioctl+0xe0>
rtems_termios_device_context *ctx = tty->device_context;
40010be0: 17c42483 lw s1,380(s0)
( *context->lock_acquire )( context, lock_context );
40010be4: 00c10593 addi a1,sp,12
40010be8: 0144a783 lw a5,20(s1)
40010bec: 00048513 mv a0,s1
40010bf0: 000780e7 jalr a5
( *context->lock_release )( context, lock_context );
40010bf4: 0184a783 lw a5,24(s1)
tty->rawInBuf.Tail = 0;
40010bf8: 08042423 sw zero,136(s0)
tty->rawInBuf.Head = 0;
40010bfc: 08042223 sw zero,132(s0)
40010c00: 00c10593 addi a1,sp,12
40010c04: 00048513 mv a0,s1
40010c08: 000780e7 jalr a5
}
40010c0c: b99ff06f j 400107a4 <rtems_termios_ioctl+0xe0>
if (tty->termios.c_cc[VMIN]) {
40010c10: f2069ae3 bnez a3,40010b44 <rtems_termios_ioctl+0x480>
tty->rawInBufSemaphoreWait = false;
40010c14: 0a040423 sb zero,168(s0)
40010c18: f3dff06f j 40010b54 <rtems_termios_ioctl+0x490>
tty->flow_ctrl &= ~(FL_MDXOF);
40010c1c: 14842783 lw a5,328(s0)
40010c20: bff7f793 andi a5,a5,-1025
40010c24: 14f42423 sw a5,328(s0)
tty->flow_ctrl &= ~(FL_ISNTXOF);
40010c28: 14842783 lw a5,328(s0)
40010c2c: ffd7f793 andi a5,a5,-3
40010c30: 14f42423 sw a5,328(s0)
40010c34: c0dff06f j 40010840 <rtems_termios_ioctl+0x17c>
} else if (tty->handler.ioctl) {
40010c38: 13842783 lw a5,312(s0)
40010c3c: 02078663 beqz a5,40010c68 <rtems_termios_ioctl+0x5a4> <== ALWAYS TAKEN
args->ioctl_return = (*tty->handler.ioctl) (tty->device_context,
40010c40: 0084a603 lw a2,8(s1) <== NOT EXECUTED
40010c44: 17c42503 lw a0,380(s0) <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
40010c48: 00000993 li s3,0 <== NOT EXECUTED
args->ioctl_return = (*tty->handler.ioctl) (tty->device_context,
40010c4c: 000780e7 jalr a5 <== NOT EXECUTED
40010c50: 00a4a623 sw a0,12(s1) <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
40010c54: d01ff06f j 40010954 <rtems_termios_ioctl+0x290> <== NOT EXECUTED
tty->flow_ctrl &= ~(FL_IRTSOFF);
40010c58: 14842783 lw a5,328(s0) <== NOT EXECUTED
40010c5c: ffb7f793 andi a5,a5,-5 <== NOT EXECUTED
40010c60: 14f42423 sw a5,328(s0) <== NOT EXECUTED
if (tty->termios.c_cflag & CRTSCTS) {
40010c64: c05ff06f j 40010868 <rtems_termios_ioctl+0x1a4> <== NOT EXECUTED
sc = RTEMS_INVALID_NUMBER;
40010c68: 00a00993 li s3,10
40010c6c: ce9ff06f j 40010954 <rtems_termios_ioctl+0x290>
40003be8 <rtems_termios_open>:
{
40003be8: fe010113 addi sp,sp,-32
40003bec: 01312623 sw s3,12(sp)
_Mutex_Acquire( mutex );
40003bf0: 4001b9b7 lui s3,0x4001b
40003bf4: 00812c23 sw s0,24(sp)
40003bf8: 01212823 sw s2,16(sp)
40003bfc: 00050413 mv s0,a0
40003c00: 61c98513 addi a0,s3,1564 # 4001b61c <rtems_termios_ttyMutex>
40003c04: 00912a23 sw s1,20(sp)
40003c08: 01412423 sw s4,8(sp)
40003c0c: 01512223 sw s5,4(sp)
40003c10: 00112e23 sw ra,28(sp)
40003c14: 00068a93 mv s5,a3
40003c18: 00058493 mv s1,a1
40003c1c: 00060a13 mv s4,a2
for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
40003c20: 97c18913 addi s2,gp,-1668 # 4001bc54 <rtems_termios_ttyHead>
40003c24: 351040ef jal ra,40008774 <_Mutex_Acquire>
40003c28: 00092683 lw a3,0(s2)
40003c2c: 00069863 bnez a3,40003c3c <rtems_termios_open+0x54> <== NEVER TAKEN
40003c30: 01c0006f j 40003c4c <rtems_termios_open+0x64>
40003c34: 0006a683 lw a3,0(a3) <== NOT EXECUTED
40003c38: 00068a63 beqz a3,40003c4c <rtems_termios_open+0x64> <== NOT EXECUTED
if ((tty->major == major) && (tty->minor == minor))
40003c3c: 00c6a703 lw a4,12(a3) <== NOT EXECUTED
40003c40: fe871ae3 bne a4,s0,40003c34 <rtems_termios_open+0x4c> <== NOT EXECUTED
40003c44: 0106a703 lw a4,16(a3) <== NOT EXECUTED
40003c48: fe9716e3 bne a4,s1,40003c34 <rtems_termios_open+0x4c> <== NOT EXECUTED
tty = rtems_termios_open_tty(
40003c4c: 000a8793 mv a5,s5
40003c50: 00000713 li a4,0
40003c54: 000a0613 mv a2,s4
40003c58: 00048593 mv a1,s1
40003c5c: 00040513 mv a0,s0
40003c60: f8cfe0ef jal ra,400023ec <rtems_termios_open_tty>
if (tty == NULL) {
40003c64: 06050663 beqz a0,40003cd0 <rtems_termios_open+0xe8>
if (tty->refcount == 1) {
40003c68: 00852703 lw a4,8(a0)
40003c6c: 00100793 li a5,1
40003c70: 02f70a63 beq a4,a5,40003ca4 <rtems_termios_open+0xbc>
_Mutex_Release( mutex );
40003c74: 61c98513 addi a0,s3,1564
40003c78: 36d040ef jal ra,400087e4 <_Mutex_Release>
return RTEMS_SUCCESSFUL;
40003c7c: 00000513 li a0,0
}
40003c80: 01c12083 lw ra,28(sp)
40003c84: 01812403 lw s0,24(sp)
40003c88: 01412483 lw s1,20(sp)
40003c8c: 01012903 lw s2,16(sp)
40003c90: 00c12983 lw s3,12(sp)
40003c94: 00812a03 lw s4,8(sp)
40003c98: 00412a83 lw s5,4(sp)
40003c9c: 02010113 addi sp,sp,32
40003ca0: 00008067 ret
tty->forw = rtems_termios_ttyHead;
40003ca4: 00092783 lw a5,0(s2)
tty->back = NULL;
40003ca8: 00052223 sw zero,4(a0)
tty->forw = rtems_termios_ttyHead;
40003cac: 00f52023 sw a5,0(a0)
if (rtems_termios_ttyHead != NULL)
40003cb0: 00078463 beqz a5,40003cb8 <rtems_termios_open+0xd0> <== ALWAYS TAKEN
rtems_termios_ttyHead->back = tty;
40003cb4: 00a7a223 sw a0,4(a5) <== NOT EXECUTED
if (rtems_termios_ttyTail == NULL)
40003cb8: 98018793 addi a5,gp,-1664 # 4001bc58 <rtems_termios_ttyTail>
40003cbc: 0007a703 lw a4,0(a5)
rtems_termios_ttyHead = tty;
40003cc0: 00a92023 sw a0,0(s2)
if (rtems_termios_ttyTail == NULL)
40003cc4: fa0718e3 bnez a4,40003c74 <rtems_termios_open+0x8c> <== NEVER TAKEN
rtems_termios_ttyTail = tty;
40003cc8: 00a7a023 sw a0,0(a5)
40003ccc: fa9ff06f j 40003c74 <rtems_termios_open+0x8c>
40003cd0: 61c98513 addi a0,s3,1564
40003cd4: 311040ef jal ra,400087e4 <_Mutex_Release>
return RTEMS_NO_MEMORY;
40003cd8: 01a00513 li a0,26
40003cdc: fa5ff06f j 40003c80 <rtems_termios_open+0x98>
40004638 <rtems_termios_register_isig_handler>:
if (handler == NULL) {
40004638: 00050863 beqz a0,40004648 <rtems_termios_register_isig_handler+0x10><== NEVER TAKEN
termios_isig_handler = handler;
4000463c: 8aa1a023 sw a0,-1888(gp) # 40016228 <termios_isig_handler>
return RTEMS_SUCCESSFUL;
40004640: 00000513 li a0,0
40004644: 00008067 ret
return RTEMS_INVALID_ADDRESS;
40004648: 00900513 li a0,9 <== NOT EXECUTED
}
4000464c: 00008067 ret <== NOT EXECUTED
40011170 <rtems_termios_set_best_baud>:
{
const rtems_assoc_t *current = &rtems_termios_baud_table[ 0 ];
const rtems_assoc_t *last = current;
speed_t spd;
while ( current->name != NULL && current->local_value < baud ) {
40011170: 400137b7 lui a5,0x40013
40011174: 4d07a703 lw a4,1232(a5) # 400134d0 <rtems_termios_baud_table>
const rtems_assoc_t *last = current;
40011178: 4d078613 addi a2,a5,1232
const rtems_assoc_t *current = &rtems_termios_baud_table[ 0 ];
4001117c: 4d078793 addi a5,a5,1232
while ( current->name != NULL && current->local_value < baud ) {
40011180: 00071c63 bnez a4,40011198 <rtems_termios_set_best_baud+0x28> <== ALWAYS TAKEN
40011184: 0400006f j 400111c4 <rtems_termios_set_best_baud+0x54> <== NOT EXECUTED
40011188: 00c7a703 lw a4,12(a5)
4001118c: 00078613 mv a2,a5
40011190: 00068793 mv a5,a3
40011194: 02070863 beqz a4,400111c4 <rtems_termios_set_best_baud+0x54>
40011198: 0047a703 lw a4,4(a5)
last = current;
++current;
4001119c: 00c78693 addi a3,a5,12
while ( current->name != NULL && current->local_value < baud ) {
400111a0: feb764e3 bltu a4,a1,40011188 <rtems_termios_set_best_baud+0x18>
}
if ( current->name != NULL ) {
uint32_t mid = (last->local_value + current->local_value) / UINT32_C( 2 );
400111a4: 00462683 lw a3,4(a2)
400111a8: 00d70733 add a4,a4,a3
400111ac: 00175713 srli a4,a4,0x1
spd = baud <= mid ? last->remote_value : current->remote_value;
400111b0: 02b76463 bltu a4,a1,400111d8 <rtems_termios_set_best_baud+0x68>
400111b4: 00862783 lw a5,8(a2)
} else {
spd = B460800;
}
term->c_ispeed = spd;
400111b8: 02f52223 sw a5,36(a0)
term->c_ospeed = spd;
400111bc: 02f52423 sw a5,40(a0)
}
400111c0: 00008067 ret
spd = B460800;
400111c4: 000717b7 lui a5,0x71
400111c8: 80078793 addi a5,a5,-2048 # 70800 <bsp_section_text_size+0x5e0ac>
term->c_ispeed = spd;
400111cc: 02f52223 sw a5,36(a0)
term->c_ospeed = spd;
400111d0: 02f52423 sw a5,40(a0)
}
400111d4: 00008067 ret
spd = baud <= mid ? last->remote_value : current->remote_value;
400111d8: 0087a783 lw a5,8(a5)
term->c_ispeed = spd;
400111dc: 02f52223 sw a5,36(a0)
term->c_ospeed = spd;
400111e0: 02f52423 sw a5,40(a0)
}
400111e4: 00008067 ret
40009f38 <rtems_verror>:
int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
40009f38: fe010113 addi sp,sp,-32
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
40009f3c: 200007b7 lui a5,0x20000
{
40009f40: 00812c23 sw s0,24(sp)
40009f44: 01212823 sw s2,16(sp)
40009f48: 01312623 sw s3,12(sp)
40009f4c: 00112e23 sw ra,28(sp)
40009f50: 00912a23 sw s1,20(sp)
40009f54: 01412423 sw s4,8(sp)
if (error_flag & RTEMS_ERROR_PANIC) {
40009f58: 00f577b3 and a5,a0,a5
{
40009f5c: 00050413 mv s0,a0
40009f60: 00058913 mv s2,a1
40009f64: 00060993 mv s3,a2
if (error_flag & RTEMS_ERROR_PANIC) {
40009f68: 00078c63 beqz a5,40009f80 <rtems_verror+0x48>
if (rtems_panic_in_progress++)
40009f6c: 98018793 addi a5,gp,-1664 # 40027aa8 <rtems_panic_in_progress>
40009f70: 0007a703 lw a4,0(a5) # 20000000 <RamSize+0x1f000000>
40009f74: 00170693 addi a3,a4,1
40009f78: 00d7a023 sw a3,0(a5)
40009f7c: 08071663 bnez a4,4000a008 <rtems_verror+0xd0> <== NEVER TAKEN
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
40009f80: cbcf60ef jal ra,4000043c <__getreent>
40009f84: 00852503 lw a0,8(a0)
40009f88: 6810b0ef jal ra,40015e08 <fflush>
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
40009f8c: 400007b7 lui a5,0x40000
status = error_flag & ~RTEMS_ERROR_MASK;
40009f90: 90000537 lui a0,0x90000
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
40009f94: 00f477b3 and a5,s0,a5
status = error_flag & ~RTEMS_ERROR_MASK;
40009f98: fff50513 addi a0,a0,-1 # 8fffffff <RamEnd+0x4effffff>
40009f9c: 00a47433 and s0,s0,a0
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
40009fa0: 08079663 bnez a5,4000a02c <rtems_verror+0xf4>
#if defined(RTEMS_MULTIPROCESSING)
if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%" PRIu16 "] ", rtems_object_get_local_node());
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
40009fa4: c98f60ef jal ra,4000043c <__getreent>
40009fa8: 00c52503 lw a0,12(a0)
40009fac: 00098613 mv a2,s3
40009fb0: 00090593 mv a1,s2
40009fb4: 33c140ef jal ra,4001e2f0 <vfprintf>
40009fb8: 00050493 mv s1,a0
if (status)
40009fbc: 0c041663 bnez s0,4000a088 <rtems_verror+0x150>
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
}
chars_written += fprintf(stderr, "\n");
40009fc0: c7cf60ef jal ra,4000043c <__getreent>
40009fc4: 00c52503 lw a0,12(a0)
40009fc8: 400255b7 lui a1,0x40025
40009fcc: e2058593 addi a1,a1,-480 # 40024e20 <apbuart_handler_polled+0x118>
40009fd0: 6700c0ef jal ra,40016640 <fprintf>
40009fd4: 00a484b3 add s1,s1,a0
(void) fflush(stderr);
40009fd8: c64f60ef jal ra,4000043c <__getreent>
40009fdc: 00c52503 lw a0,12(a0)
40009fe0: 6290b0ef jal ra,40015e08 <fflush>
return chars_written;
}
40009fe4: 01c12083 lw ra,28(sp)
40009fe8: 01812403 lw s0,24(sp)
40009fec: 01012903 lw s2,16(sp)
40009ff0: 00c12983 lw s3,12(sp)
40009ff4: 00812a03 lw s4,8(sp)
40009ff8: 00048513 mv a0,s1
40009ffc: 01412483 lw s1,20(sp)
4000a000: 02010113 addi sp,sp,32
4000a004: 00008067 ret
disable_level = cpu_self->thread_dispatch_disable_level;
4000a008: 4002c7b7 lui a5,0x4002c <== NOT EXECUTED
4000a00c: ac078793 addi a5,a5,-1344 # 4002bac0 <_Per_CPU_Information> <== NOT EXECUTED
4000a010: 0307a703 lw a4,48(a5) <== NOT EXECUTED
if (rtems_panic_in_progress > 2)
4000a014: 00200613 li a2,2 <== NOT EXECUTED
return 0;
4000a018: 00000493 li s1,0 <== NOT EXECUTED
cpu_self->thread_dispatch_disable_level = disable_level + 1;
4000a01c: 00170713 addi a4,a4,1 <== NOT EXECUTED
4000a020: 02e7a823 sw a4,48(a5) <== NOT EXECUTED
if (rtems_panic_in_progress > 2)
4000a024: fcd640e3 blt a2,a3,40009fe4 <rtems_verror+0xac> <== NOT EXECUTED
4000a028: f59ff06f j 40009f80 <rtems_verror+0x48> <== NOT EXECUTED
local_errno = errno;
4000a02c: 0810b0ef jal ra,400158ac <__errno>
4000a030: 00052a03 lw s4,0(a0)
chars_written += vfprintf(stderr, printf_format, arglist);
4000a034: c08f60ef jal ra,4000043c <__getreent>
4000a038: 00c52503 lw a0,12(a0)
4000a03c: 00098613 mv a2,s3
4000a040: 00090593 mv a1,s2
4000a044: 2ac140ef jal ra,4001e2f0 <vfprintf>
4000a048: 00050493 mv s1,a0
if (status)
4000a04c: 04041063 bnez s0,4000a08c <rtems_verror+0x154>
if (local_errno) {
4000a050: f60a08e3 beqz s4,40009fc0 <rtems_verror+0x88>
if ((local_errno > 0) && *strerror(local_errno))
4000a054: 01405a63 blez s4,4000a068 <rtems_verror+0x130>
4000a058: 000a0513 mv a0,s4
4000a05c: 5080f0ef jal ra,40019564 <strerror>
4000a060: 00054783 lbu a5,0(a0)
4000a064: 04079a63 bnez a5,4000a0b8 <rtems_verror+0x180> <== ALWAYS TAKEN
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
4000a068: bd4f60ef jal ra,4000043c <__getreent>
4000a06c: 00c52503 lw a0,12(a0)
4000a070: 400245b7 lui a1,0x40024
4000a074: 000a0613 mv a2,s4
4000a078: 77858593 addi a1,a1,1912 # 40024778 <state_pairs+0xd8>
4000a07c: 5c40c0ef jal ra,40016640 <fprintf>
4000a080: 00a484b3 add s1,s1,a0
4000a084: f3dff06f j 40009fc0 <rtems_verror+0x88>
int local_errno = 0;
4000a088: 00000a13 li s4,0
fprintf(stderr, " (status: %s)", rtems_status_text(status));
4000a08c: bb0f60ef jal ra,4000043c <__getreent>
4000a090: 00c52903 lw s2,12(a0)
4000a094: 00040513 mv a0,s0
4000a098: a7dfb0ef jal ra,40005b14 <rtems_status_text>
4000a09c: 400245b7 lui a1,0x40024
4000a0a0: 00050613 mv a2,a0
4000a0a4: 75858593 addi a1,a1,1880 # 40024758 <state_pairs+0xb8>
4000a0a8: 00090513 mv a0,s2
4000a0ac: 5940c0ef jal ra,40016640 <fprintf>
chars_written +=
4000a0b0: 00a484b3 add s1,s1,a0
4000a0b4: f9dff06f j 4000a050 <rtems_verror+0x118>
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
4000a0b8: b84f60ef jal ra,4000043c <__getreent>
4000a0bc: 00c52403 lw s0,12(a0)
4000a0c0: 000a0513 mv a0,s4
4000a0c4: 4a00f0ef jal ra,40019564 <strerror>
4000a0c8: 400245b7 lui a1,0x40024
4000a0cc: 00050613 mv a2,a0
4000a0d0: 76858593 addi a1,a1,1896 # 40024768 <state_pairs+0xc8>
4000a0d4: 00040513 mv a0,s0
4000a0d8: 5680c0ef jal ra,40016640 <fprintf>
4000a0dc: 00a484b3 add s1,s1,a0
4000a0e0: ee1ff06f j 40009fc0 <rtems_verror+0x88>
40003b88 <rtems_vprintf>:
*
* @return true The printer is valid else false is returned.
*/
static inline bool rtems_print_printer_valid(const rtems_printer *printer)
{
return printer != NULL && printer->printer != NULL;
40003b88: 00050a63 beqz a0,40003b9c <rtems_vprintf+0x14> <== NEVER TAKEN
40003b8c: 00452783 lw a5,4(a0)
40003b90: 00078663 beqz a5,40003b9c <rtems_vprintf+0x14> <== NEVER TAKEN
va_list ap
)
{
int len = 0;
if ( rtems_print_printer_valid( printer ) ) {
len = printer->printer( printer->context, format, ap );
40003b94: 00052503 lw a0,0(a0)
40003b98: 00078067 jr a5
}
return len;
}
40003b9c: 00000513 li a0,0 <== NOT EXECUTED
40003ba0: 00008067 ret <== NOT EXECUTED
400067f0 <setgrent>:
void setgrent(void)
{
400067f0: ff010113 addi sp,sp,-16
pthread_once(&grp_once, grp_init);
400067f4: 400065b7 lui a1,0x40006
{
400067f8: 00912223 sw s1,4(sp)
pthread_once(&grp_once, grp_init);
400067fc: 76858593 addi a1,a1,1896 # 40006768 <grp_init>
40006800: 8b818513 addi a0,gp,-1864 # 400142f8 <grp_once>
{
40006804: 00112623 sw ra,12(sp)
40006808: 00812423 sw s0,8(sp)
4000680c: 01212023 sw s2,0(sp)
return pthread_getspecific(grp_key);
40006810: 8b418493 addi s1,gp,-1868 # 400142f4 <grp_key>
pthread_once(&grp_once, grp_init);
40006814: b91fd0ef jal ra,400043a4 <pthread_once>
return pthread_getspecific(grp_key);
40006818: 0004a503 lw a0,0(s1)
4000681c: 238010ef jal ra,40007a54 <pthread_getspecific>
grp_context *ctx = grp_get_context();
if (ctx == NULL) {
40006820: 00050413 mv s0,a0
40006824: 04050263 beqz a0,40006868 <setgrent+0x78>
return;
}
}
_libcsupport_pwdgrp_init();
40006828: b51fa0ef jal ra,40001378 <_libcsupport_pwdgrp_init>
if (ctx->fp != NULL)
4000682c: 00042503 lw a0,0(s0)
40006830: 00050463 beqz a0,40006838 <setgrent+0x48>
fclose(ctx->fp);
40006834: 35c080ef jal ra,4000eb90 <fclose>
ctx->fp = fopen("/etc/group", "r");
40006838: 400125b7 lui a1,0x40012
4000683c: 40012537 lui a0,0x40012
40006840: 6b058593 addi a1,a1,1712 # 400126b0 <rtems_filesystem_default_pathconf+0x4c>
40006844: 3cc50513 addi a0,a0,972 # 400123cc <bsp_section_rodata_begin+0x29c>
40006848: 48d080ef jal ra,4000f4d4 <fopen>
4000684c: 00a42023 sw a0,0(s0)
}
40006850: 00c12083 lw ra,12(sp)
40006854: 00812403 lw s0,8(sp)
40006858: 00412483 lw s1,4(sp)
4000685c: 00012903 lw s2,0(sp)
40006860: 01010113 addi sp,sp,16
40006864: 00008067 ret
ctx = calloc(1, sizeof(*ctx));
40006868: 11400593 li a1,276
4000686c: 00100513 li a0,1
40006870: bc9ff0ef jal ra,40006438 <calloc>
40006874: 00050913 mv s2,a0
40006878: 00050413 mv s0,a0
if (ctx == NULL)
4000687c: fc050ae3 beqz a0,40006850 <setgrent+0x60> <== NEVER TAKEN
eno = pthread_setspecific(grp_key, ctx);
40006880: 0004a503 lw a0,0(s1)
40006884: 00090593 mv a1,s2
40006888: 218010ef jal ra,40007aa0 <pthread_setspecific>
if (eno != 0) {
4000688c: f8050ee3 beqz a0,40006828 <setgrent+0x38> <== ALWAYS TAKEN
}
40006890: 00812403 lw s0,8(sp) <== NOT EXECUTED
40006894: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40006898: 00412483 lw s1,4(sp) <== NOT EXECUTED
free(ctx);
4000689c: 00090513 mv a0,s2 <== NOT EXECUTED
}
400068a0: 00012903 lw s2,0(sp) <== NOT EXECUTED
400068a4: 01010113 addi sp,sp,16 <== NOT EXECUTED
free(ctx);
400068a8: d41ff06f j 400065e8 <free> <== NOT EXECUTED
400032b8 <unmount>:
* in some form is supported on most UNIX and POSIX systems. This
* routine is necessary to mount instantiations of a file system
* into the file system name space.
*/
int unmount( const char *path )
{
400032b8: fb010113 addi sp,sp,-80
400032bc: 00050593 mv a1,a0
int rv = 0;
rtems_filesystem_eval_path_context_t ctx;
int eval_flags = RTEMS_FS_FOLLOW_LINK;
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
400032c0: 01800613 li a2,24
400032c4: 00810513 addi a0,sp,8
{
400032c8: 04812423 sw s0,72(sp)
400032cc: 04112623 sw ra,76(sp)
400032d0: 04912223 sw s1,68(sp)
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
400032d4: d28ff0ef jal ra,400027fc <rtems_filesystem_eval_path_start>
rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry;
400032d8: 01452403 lw s0,20(a0)
400032dc: 00c42783 lw a5,12(s0)
400032e0: 02442583 lw a1,36(s0)
400032e4: 0107a783 lw a5,16(a5)
400032e8: 000780e7 jalr a5
if ( rtems_filesystem_location_is_instance_root( currentloc ) ) {
400032ec: 0c050263 beqz a0,400033b0 <unmount+0xf8>
&rtems_filesystem_root->location;
400032f0: 15c000ef jal ra,4000344c <rtems_current_user_env_get>
400032f4: 00452483 lw s1,4(a0)
&rtems_filesystem_current->location;
400032f8: 154000ef jal ra,4000344c <rtems_current_user_env_get>
return mt_entry == root->mt_entry || mt_entry == current->mt_entry;
400032fc: 0144a783 lw a5,20(s1)
40003300: 08f40a63 beq s0,a5,40003394 <unmount+0xdc>
40003304: 00052783 lw a5,0(a0)
40003308: 0147a783 lw a5,20(a5)
4000330c: 08f40463 beq s0,a5,40003394 <unmount+0xdc>
if ( !contains_root_or_current_directory( mt_entry ) ) {
const rtems_filesystem_operations_table *mt_point_ops =
mt_entry->mt_point_node->location.mt_entry->ops;
40003310: 02042783 lw a5,32(s0)
rv = (*mt_point_ops->unmount_h)( mt_entry );
40003314: 00040513 mv a0,s0
const rtems_filesystem_operations_table *mt_point_ops =
40003318: 0147a783 lw a5,20(a5)
rv = (*mt_point_ops->unmount_h)( mt_entry );
4000331c: 00c7a783 lw a5,12(a5)
40003320: 0307a783 lw a5,48(a5)
40003324: 000780e7 jalr a5
40003328: 00050493 mv s1,a0
if ( rv == 0 ) {
4000332c: 02050263 beqz a0,40003350 <unmount+0x98>
} else {
errno = EACCES;
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
40003330: 00810513 addi a0,sp,8
40003334: ee8ff0ef jal ra,40002a1c <rtems_filesystem_eval_path_cleanup>
rtems_fatal_error_occurred( 0xdeadbeef );
}
}
return rv;
}
40003338: 04c12083 lw ra,76(sp)
4000333c: 04812403 lw s0,72(sp)
40003340: 00048513 mv a0,s1
40003344: 04412483 lw s1,68(sp)
40003348: 05010113 addi sp,sp,80
4000334c: 00008067 ret
rtems_id self_task_id = rtems_task_self();
40003350: 1f1030ef jal ra,40006d40 <rtems_task_self>
__asm__ volatile (
40003354: 300477f3 csrrci a5,mstatus,8
mt_entry->unmount_task = self_task_id;
40003358: 02a42e23 sw a0,60(s0)
mt_entry->mounted = false;
4000335c: 02040423 sb zero,40(s0)
return mstatus & RISCV_MSTATUS_MIE;
40003360: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40003364: 3007a073 csrs mstatus,a5
rtems_filesystem_eval_path_cleanup( &ctx );
40003368: 00810513 addi a0,sp,8
4000336c: eb0ff0ef jal ra,40002a1c <rtems_filesystem_eval_path_cleanup>
return rtems_event_system_receive(
40003370: 00410693 addi a3,sp,4
40003374: 00000613 li a2,0
40003378: 00000593 li a1,0
4000337c: 80000537 lui a0,0x80000
40003380: 091030ef jal ra,40006c10 <rtems_event_system_receive>
if ( sc != RTEMS_SUCCESSFUL ) {
40003384: fa050ae3 beqz a0,40003338 <unmount+0x80> <== ALWAYS TAKEN
rtems_fatal_error_occurred( 0xdeadbeef );
40003388: deadc537 lui a0,0xdeadc <== NOT EXECUTED
4000338c: eef50513 addi a0,a0,-273 # deadbeef <RamEnd+0x9dadbeef> <== NOT EXECUTED
40003390: 305030ef jal ra,40006e94 <rtems_fatal_error_occurred> <== NOT EXECUTED
errno = EBUSY;
40003394: 3c5170ef jal ra,4001af58 <__errno>
40003398: 01000793 li a5,16
4000339c: 00f52023 sw a5,0(a0)
rtems_filesystem_eval_path_cleanup( &ctx );
400033a0: 00810513 addi a0,sp,8
400033a4: e78ff0ef jal ra,40002a1c <rtems_filesystem_eval_path_cleanup>
rv = -1;
400033a8: fff00493 li s1,-1
400033ac: f8dff06f j 40003338 <unmount+0x80>
errno = EACCES;
400033b0: 3a9170ef jal ra,4001af58 <__errno>
400033b4: 00d00793 li a5,13
400033b8: 00f52023 sw a5,0(a0)
rtems_filesystem_eval_path_cleanup( &ctx );
400033bc: 00810513 addi a0,sp,8
400033c0: e5cff0ef jal ra,40002a1c <rtems_filesystem_eval_path_cleanup>
rv = -1;
400033c4: fff00493 li s1,-1
400033c8: f71ff06f j 40003338 <unmount+0x80>
4001de90 <write>:
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
4001de90: ff010113 addi sp,sp,-16 <== NOT EXECUTED
4001de94: 00112623 sw ra,12(sp) <== NOT EXECUTED
4001de98: 00812423 sw s0,8(sp) <== NOT EXECUTED
4001de9c: 00912223 sw s1,4(sp) <== NOT EXECUTED
rtems_libio_t *iop;
ssize_t n;
rtems_libio_check_buffer( buffer );
4001dea0: 0c058063 beqz a1,4001df60 <write+0xd0> <== NOT EXECUTED
4001dea4: 00050793 mv a5,a0 <== NOT EXECUTED
rtems_libio_check_count( count );
4001dea8: 00000513 li a0,0 <== NOT EXECUTED
4001deac: 06060a63 beqz a2,4001df20 <write+0x90> <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EBADF );
4001deb0: 8901a703 lw a4,-1904(gp) # 40020cd0 <rtems_libio_number_iops> <== NOT EXECUTED
4001deb4: 08e7fc63 bgeu a5,a4,4001df4c <write+0xbc> <== NOT EXECUTED
return &rtems_libio_iops[ fd ];
4001deb8: 00179413 slli s0,a5,0x1 <== NOT EXECUTED
4001debc: 00f40433 add s0,s0,a5 <== NOT EXECUTED
4001dec0: 400237b7 lui a5,0x40023 <== NOT EXECUTED
4001dec4: cd878793 addi a5,a5,-808 # 40022cd8 <rtems_libio_iops> <== NOT EXECUTED
4001dec8: 00441413 slli s0,s0,0x4 <== NOT EXECUTED
4001decc: 00f40433 add s0,s0,a5 <== NOT EXECUTED
__asm__ volatile (
4001ded0: 30047773 csrrci a4,mstatus,8 <== NOT EXECUTED
val = *obj;
4001ded4: 00042783 lw a5,0(s0) <== NOT EXECUTED
*obj = val + arg;
4001ded8: 000014b7 lui s1,0x1 <== NOT EXECUTED
4001dedc: 009786b3 add a3,a5,s1 <== NOT EXECUTED
4001dee0: 00d42023 sw a3,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
4001dee4: 00877713 andi a4,a4,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4001dee8: 30072073 csrs mstatus,a4 <== NOT EXECUTED
4001deec: 10400713 li a4,260 <== NOT EXECUTED
4001def0: 1047f793 andi a5,a5,260 <== NOT EXECUTED
4001def4: 04e79063 bne a5,a4,4001df34 <write+0xa4> <== NOT EXECUTED
/*
* Now process the write() request.
*/
n = (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
4001def8: 02042783 lw a5,32(s0) <== NOT EXECUTED
4001defc: 00040513 mv a0,s0 <== NOT EXECUTED
4001df00: 00c7a783 lw a5,12(a5) <== NOT EXECUTED
4001df04: 000780e7 jalr a5 <== NOT EXECUTED
__asm__ volatile (
4001df08: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
*obj = val - arg;
4001df0c: 00042703 lw a4,0(s0) <== NOT EXECUTED
4001df10: 40970733 sub a4,a4,s1 <== NOT EXECUTED
4001df14: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
4001df18: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4001df1c: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
rtems_libio_iop_drop( iop );
return n;
}
4001df20: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4001df24: 00812403 lw s0,8(sp) <== NOT EXECUTED
4001df28: 00412483 lw s1,4(sp) <== NOT EXECUTED
4001df2c: 01010113 addi sp,sp,16 <== NOT EXECUTED
4001df30: 00008067 ret <== NOT EXECUTED
__asm__ volatile (
4001df34: 300477f3 csrrci a5,mstatus,8 <== NOT EXECUTED
4001df38: 00042703 lw a4,0(s0) <== NOT EXECUTED
4001df3c: 40970733 sub a4,a4,s1 <== NOT EXECUTED
4001df40: 00e42023 sw a4,0(s0) <== NOT EXECUTED
return mstatus & RISCV_MSTATUS_MIE;
4001df44: 0087f793 andi a5,a5,8 <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4001df48: 3007a073 csrs mstatus,a5 <== NOT EXECUTED
LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EBADF );
4001df4c: f7cf60ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4001df50: 00900793 li a5,9 <== NOT EXECUTED
4001df54: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4001df58: fff00513 li a0,-1 <== NOT EXECUTED
4001df5c: fc5ff06f j 4001df20 <write+0x90> <== NOT EXECUTED
rtems_libio_check_buffer( buffer );
4001df60: f68f60ef jal ra,400146c8 <__errno> <== NOT EXECUTED
4001df64: 01600793 li a5,22 <== NOT EXECUTED
4001df68: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4001df6c: fff00513 li a0,-1 <== NOT EXECUTED
4001df70: fb1ff06f j 4001df20 <write+0x90> <== NOT EXECUTED