Ignore:
Timestamp:
2007-10-30T22:54:11Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4d21cf8
Parents:
b2a0f6dd
Message:

Unify implementations of TLS variant I and variant II alloc_tls() and
free_tls_arch().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/ppc64/include/thread.h

    rb2a0f6dd rfa23560  
    3636#define LIBC_ppc64_THREAD_H_
    3737
    38 #define PPC_TP_OFFSET 0x7000
    39 
    40 typedef struct {
    41         void *fibril_data;
    42 } tcb_t;
    43 
    44 static inline void __tcb_set(tcb_t *tcb)
    45 {
    46         void *tp = tcb;
    47         tp += PPC_TP_OFFSET + sizeof(tcb_t);
    48        
    49         asm volatile (
    50                 "mr %%r2, %0\n"
    51                 :
    52                 : "r" (tp)
    53         );
    54 }
    55 
    56 static inline tcb_t * __tcb_get(void)
    57 {
    58         void * retval;
    59        
    60         asm volatile (
    61                 "mr %0, %%r2\n"
    62                 : "=r" (retval)
    63         );
    64 
    65         return (tcb_t *)(retval - PPC_TP_OFFSET - sizeof(tcb_t));
    66 }
    67 
    6838#endif
    6939
Note: See TracChangeset for help on using the changeset viewer.