bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hurd,commited] hurd: Add THREAD_GET/SETMEM/_NC


From: Samuel Thibault
Subject: Re: [hurd,commited] hurd: Add THREAD_GET/SETMEM/_NC
Date: Sat, 15 Feb 2020 05:54:36 -0800
User-agent: NeoMutt/20170609 (1.8.3)

Andreas Schwab, le sam. 15 févr. 2020 14:51:24 +0100, a ecrit:
> On Feb 15 2020, Samuel Thibault wrote:
> > diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
> > index c0341ce2c9..7ec8c81a76 100644
> > --- a/sysdeps/mach/hurd/i386/tls.h
> > +++ b/sysdeps/mach/hurd/i386/tls.h
> > @@ -163,6 +163,114 @@ out:
> >           : "i" (offsetof (tcbhead_t, tcb)));                             \
> >       __tcb;})
> >  
> > +/* Read member of the thread descriptor directly.  */
> > +# define THREAD_GETMEM(descr, member) \
> > +  ({ __typeof (descr->member) __value;                                     
> >       \
> > +     if (sizeof (__value) == 1)                                            
> >       \
> > +       asm volatile ("movb %%gs:%P2,%b0"                                 \
> > +                : "=q" (__value)                                         \
> > +                : "0" (0), "i" (offsetof (tcbhead_t, member)));          \
> > +     else if (sizeof (__value) == 4)                                       
> >       \
> > +       asm volatile ("movl %%gs:%P1,%0"                                    
> >       \
> > +                : "=r" (__value)                                         \
> > +                : "i" (offsetof (tcbhead_t, member)));                   \
> > +     else                                                                \
> > +       {                                                                 \
> > +    if (sizeof (__value) != 8)                                           \
> > +      /* There should not be any value with a size other than 1,         \
> > +         4 or 8.  */                                                     \
> > +      abort ();                                                          \
> 
> _Static_assert?

I just copied from i386's tls.h. We should fix them at the same time :)

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]