Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150128085905.GD32318@port70.net>
Date: Wed, 28 Jan 2015 09:59:05 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: Re: Custom __set_thread_area for ARM

* Andy Lutomirski <luto@...capital.net> [2015-01-27 15:32:27 -0800]:
> Does musl not use inline asm?  ISTM something like:
> 

it is arch specific code, which is currently either

- in asm in src/DIR/ARCH/foo.s if there is appropriate src/DIR/foo.c
- in c in a header under arch/ARCH
- in c in arch/ARCH/src/foo.c
- in asm in arch/ARCH/src/ARCH/foo.s if there is appropriate foo.c

so under src/thread you cannot have arch specific c code
with the current makefile, it has to be asm there

> struct user_desc desc;
> memset(&desc, 0, sizeof(desc));
> desc.base = whatever;
> // assign other fields
> if (set_thread_area(&desc) != 0)
>     handle error;
> 
> asm volatile ("mov %0,%%fs" : : "=rm" ((desc.entry_number << 3) | 3));
> 
> would be a lot more comprehensible.
> 
> --Andy

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.