This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Native file access under eCos synthetic (stat)


using the native syscall cyg_hal_sys_prev_stat().
Apparently some register(s) get corrupted on return.
Pb also on the gpr[] arguments that are not restored on return.
When called from main(), it works ok.


int status(const char * name)
{  int rc;
   struct stat stabBuf;
 
   rc = cyg_hal_sys_stat(name, &statBuf);
   return rc;
}

Breakpoint 1, status (name=0x103d484 "/usr/include/sys/stat.h") at
stat.c:32
32	  return rc;
(gdb) x/5i $pc
0x100004e <my_status+70 at stat.c:32>:	mov    0xfffffff4(%ebp),%eax
0x1000051 <my_status+73 at stat.c:32>:	mov    %eax,%eax
0x1000053 <my_status+75 at stat.c:33>:	leave  
0x1000054 <my_status+76 at stat.c:33>:	ret    
0x1000055 <my_status+77 at stat.c:33>:	lea    0x0(%esi),%esi
(gdb) stepi
0x01000051	32	  return rc;
(gdb) stepi
33	}
(gdb) stepi
0x01000054 in my_status (name=???) at stat.c:33
33	}
(gdb) stepi
0x00000000 in ?? ()

I've added STATCALL2(stat) in syscall-i386-linux-1.0.S.
Same behaviour with cyg_hal_sys_prev_stat() + SYSCALL2(stat).

Thanks,
Dominique


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]