Changeset 0b05082 in mainline for uspace/lib/c/arch/mips32/include/libarch/tls.h
- Timestamp:
- 2018-07-18T18:56:16Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 40abf56
- Parents:
- 9b1baac
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-18 14:25:11)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-18 18:56:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/mips32/include/libarch/tls.h
r9b1baac r0b05082 61 61 * - No assumption about DTV etc., but it will not have a fixed address 62 62 */ 63 #define MIPS_TP_OFFSET 0x700063 #define ARCH_TP_OFFSET (0x7000 + sizeof(tcb_t)) 64 64 65 65 typedef struct { … … 67 67 } tcb_t; 68 68 69 static inline void __tcb_ set(tcb_t *tcb)69 static inline void __tcb_raw_set(void *tls) 70 70 { 71 uint8_t *tp = (uint8_t *) tcb; 72 tp += MIPS_TP_OFFSET + sizeof(tcb_t); 73 74 asm volatile ("add $27, %0, $0" : : "r" (tp)); /* Move tls to K1 */ 71 /* Move tls to K1 */ 72 asm volatile ("add $27, %0, $0" :: "r" (tls)); 75 73 } 76 74 77 static inline tcb_t *__tcb_get(void)75 static inline void *__tcb_raw_get(void) 78 76 { 79 uint8_t *retval; 80 77 void *retval; 81 78 asm volatile ("add %0, $27, $0" : "=r" (retval)); 82 83 return (tcb_t *)(retval - MIPS_TP_OFFSET - sizeof(tcb_t)); 79 return retval; 84 80 } 85 81
Note:
See TracChangeset
for help on using the changeset viewer.