Changeset b0b4592e in mainline for uspace/lib/c/arch/sparc32/include/libarch/tls.h
- Timestamp:
- 2014-03-15T19:21:53Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c773adc
- Parents:
- 2034f98 (diff), 8cffdf5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/sparc32/include/libarch/tls.h
r2034f98 rb0b4592e 1 1 /* 2 2 * Copyright (c) 2006 Ondrej Palkovsky 3 * Copyright (c) 2006 Jakub Jermar 3 4 * All rights reserved. 4 5 * … … 27 28 */ 28 29 29 /** @addtogroup libc 30 /** @addtogroup libcsparc32 30 31 * @{ 31 32 */ 32 33 /** @file 34 * @brief sparc32 TLS functions. 33 35 */ 34 36 35 #ifndef LIBC_ MMAN_H_36 #define LIBC_ MMAN_H_37 #ifndef LIBC_sparc32_TLS_H_ 38 #define LIBC_sparc32_TLS_H_ 37 39 38 #include <as.h> 39 #include <sys/types.h> 40 #define CONFIG_TLS_VARIANT_2 40 41 41 #define MAP_FAILED AS_MAP_FAILED 42 typedef struct { 43 void *self; 44 void *fibril_data; 45 } tcb_t; 42 46 43 #define MAP_SHARED (1 << 0) 44 #define MAP_PRIVATE (1 << 1) 45 #define MAP_FIXED (1 << 2) 46 #define MAP_ANONYMOUS (1 << 3) 47 static inline void __tcb_set(tcb_t *tcb) 48 { 49 asm volatile ( 50 "mov %0, %%g7\n" 51 :: "r" (tcb) 52 : "g7" 53 ); 54 } 47 55 48 #define PROTO_READ AS_AREA_READ 49 #define PROTO_WRITE AS_AREA_WRITE 50 #define PROTO_EXEC AS_AREA_EXEC 51 52 extern void *mmap(void *start, size_t length, int prot, int flags, int fd, 53 aoff64_t offset); 54 extern int munmap(void *start, size_t length); 56 static inline tcb_t *__tcb_get(void) 57 { 58 void *retval; 59 60 asm volatile ( 61 "mov %%g7, %0\n" 62 : "=r" (retval) 63 ); 64 65 return retval; 66 } 55 67 56 68 #endif
Note:
See TracChangeset
for help on using the changeset viewer.