[ECOS] Native file access under eCos synthetic (stat)

Dominique Henry de Villeneuve d.devilleneuve@ri.silicomp.fr
Tue Dec 18 03:53:00 GMT 2001

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
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).


More information about the Ecos-discuss mailing list