[RFC PATCH 10/10] C-SKY: Linux ABI

Mao Han han_mao@c-sky.com
Tue Mar 20 10:58:00 GMT 2018


Hi Adhemerval,
Thanks a lot for the comment.

On Tue, Mar 20, 2018 at 05:41:59PM +0800, Adhemerval Zanella wrote:
> 
> 
> On 16/03/2018 17:58, Mao Han wrote:
> > diff --git a/sysdeps/unix/sysv/linux/csky/sysdep-cancel.h b/sysdeps/unix/sysv/linux/csky/sysdep-cancel.h
> > new file mode 100644
> > index 0000000..dd39ecf
> > --- /dev/null
> > +++ b/sysdeps/unix/sysv/linux/csky/sysdep-cancel.h
> 
> New ports should not provide sysdep-cancel.h any more, cancellable syscall
> not generated by syscalls.list and if it an advantage for the ABI, it
> can define SINGLE_THREAD_BY_GLOBAL on sysdep.h (so the single-thread
> check will be done by a global variable instead of using a TCB field).
>

OK. I'll remove csky/sysdep-cancel.h, Seems no dependece on this file
as ./socket.S is nolonger used. We are suggest to use __ASSUME_SOCKET_SYSCALL
while upsteam linux kernel. So no need to keep these files.

> > +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN
> > +        /* We translate the system's EWOULDBLOCK error into EAGAIN.
> > +           The GNU C library always defines EWOULDBLOCK==EAGAIN.
> > +           EWOULDBLOCK_sys is the original number.  */
> > +        cmpnei  a0, EWOULDBLOCK	/* Is it the old EWOULDBLOCK?  */
> > +        bt      1f
> > +        mov     a0, EAGAIN	/* Yes; translate it to EAGAIN.  */
> > +#endif
> 
> I am not sure if this is true or required for new ports, does C-SKY
> really require this code snippet?
>

Carlos O'Donell mentions this too. It is not required for new ports.
We do not have legacy UNIX port, It is always true EWOULDBLOCK==EAGAIN
In linux errno.h
#define      EWOULDBLOCK     EAGAIN  /* Operation would block */
I don't think C-SKY needs these code. I'll clean all these up.
 
> > +/* Pointer mangling is not yet supported for CSKY.  */
> > +#define PTR_MANGLE(var) (void) (var)
> > +#define PTR_DEMANGLE(var) (void) (var)
> 
> Is there any special reason to not support it? Other architecture accomplish
> by either using a global variable or a TCB field.

We haven't spent much time work on the safty and profile in glibc.
It seems not hard to implement it. I will add support for pointer mangling.



More information about the Libc-help mailing list