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