Changeset 7f9bc04 in mainline for uspace/lib/c/arch/ppc32/src/tls.c
- Timestamp:
- 2011-05-01T12:38:43Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e515a827
- Parents:
- 3f10d92
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ppc32/src/tls.c
r3f10d92 r7f9bc04 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 /*51 static void kputint(unsigned i)52 {53 asm volatile (54 "mr %%r3, %0\n"55 "li %%r9, 32\n"56 "sc\n"57 :58 : "r" (i)59 : "%r3","%r9"60 ) ;61 }62 */63 64 typedef struct {65 unsigned long int ti_module;66 unsigned long int ti_offset;67 } tls_index;68 69 void *__tls_get_addr(tls_index *ti);70 71 /* ppc32 uses TLS variant 1 */72 void *__tls_get_addr(tls_index *ti)73 {74 uint8_t *tls;75 76 /* The TLS section is just after TCB */77 tls = (uint8_t *)__tcb_get() + sizeof(tcb_t);78 79 /* Hopefully this is right. No docs found. */80 return tls + ti->ti_offset + 32768;81 }82 83 48 /** @} 84 49 */
Note:
See TracChangeset
for help on using the changeset viewer.