Changes in uspace/lib/libc/arch/ppc32/src/tls.c [1ea99cc:fa23560] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/ppc32/src/tls.c
r1ea99cc rfa23560 1 1 /* 2 2 * Copyright (c) 2006 Ondrej Palkovsky 3 * Copyright (c) 2008 Jiri Svoboda4 3 * All rights reserved. 5 4 * … … 35 34 36 35 #include <tls.h> 37 #include <align.h>38 36 #include <sys/types.h> 39 37 … … 48 46 } 49 47 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 81 48 /** @} 82 49 */
Note:
See TracChangeset
for help on using the changeset viewer.