Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/ppc32/src/tls.c

    r1ea99cc rfa23560  
    11/*
    22 * Copyright (c) 2006 Ondrej Palkovsky
    3  * Copyright (c) 2008 Jiri Svoboda
    43 * All rights reserved.
    54 *
     
    3534
    3635#include <tls.h>
    37 #include <align.h>
    3836#include <sys/types.h>
    3937
     
    4846}
    4947
    50 static void kputint(unsigned i)
    51 {
    52         asm volatile (
    53                 "mr %%r3, %0\n"
    54                 "li %%r9, 32\n"
    55                 "sc\n"
    56                 :
    57                 : "r" (i)
    58                 : "%r3","%r9"
    59         ) ;
    60 }
    61 
    62 typedef struct {
    63         unsigned long int ti_module;
    64         unsigned long int ti_offset;
    65 } tls_index;
    66 
    67 void *__tls_get_addr(tls_index *ti);
    68 
    69 /* ppc32 uses TLS variant 1 */
    70 void *__tls_get_addr(tls_index *ti)
    71 {
    72         uint8_t *tls;
    73 
    74         /* The TLS section is just after TCB */
    75         tls = (uint8_t *)__tcb_get() + sizeof(tcb_t);
    76 
    77         /* Hopefully this is right. No docs found. */
    78         return tls + ti->ti_offset + 32768;
    79 }
    80 
    8148/** @}
    8249 */
Note: See TracChangeset for help on using the changeset viewer.