Changeset 0b05082 in mainline for uspace/lib/c/include/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/include/tls.h
r9b1baac r0b05082 37 37 38 38 #include <libarch/tls.h> 39 #include <stdbool.h> 39 40 #include <stddef.h> 40 41 #include <stdint.h> 42 43 static inline void __tcb_reset(void) 44 { 45 __tcb_raw_set(NULL); 46 } 47 48 static inline void __tcb_set(tcb_t *tcb) 49 { 50 __tcb_raw_set((uint8_t *)tcb + ARCH_TP_OFFSET); 51 } 52 53 54 static inline tcb_t *__tcb_get(void) 55 { 56 return (tcb_t *)((uint8_t *)__tcb_raw_get() - ARCH_TP_OFFSET); 57 } 58 59 /* 60 * The TP register is supposed to be zero when the thread is first created 61 * by the kernel. We use this for some debugging assertions. 62 */ 63 static inline bool __tcb_is_set(void) 64 { 65 return __tcb_raw_get() != NULL; 66 } 41 67 42 68 /** DTV Generation number - equals vector length */
Note:
See TracChangeset
for help on using the changeset viewer.