Changeset c621f4aa in mainline for uspace/lib/c/arch/sparc64
- Timestamp:
- 2010-07-25T10:11:13Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 377cce8
- Parents:
- 24a2517 (diff), a2da43c (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. - Location:
- uspace/lib/c/arch/sparc64
- Files:
-
- 2 added
- 21 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/sparc64/_link.ld.in
r24a2517 rc621f4aa 1 STARTUP(LIBC_P REFIX/arch/UARCH/src/entry.o)1 STARTUP(LIBC_PATH/arch/UARCH/src/entry.o) 2 2 ENTRY(__entry) 3 3 -
uspace/lib/c/arch/sparc64/include/atomic.h
r24a2517 rc621f4aa 46 46 * 47 47 * @param val Atomic variable. 48 * @param i Signed value to be added.48 * @param i Signed value to be added. 49 49 * 50 50 * @return Value of the atomic variable as it existed before addition. 51 * 51 52 */ 52 static inline long atomic_add(atomic_t *val, int i)53 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 53 54 { 54 uint64_t a, b; 55 55 atomic_count_t a; 56 atomic_count_t b; 57 56 58 do { 57 volatile uintptr_t x = (uint64_t) &val->count;58 59 a = *(( uint64_t *) x);59 volatile uintptr_t ptr = (uintptr_t) &val->count; 60 61 a = *((atomic_count_t *) ptr); 60 62 b = a + i; 61 asm volatile ("casx %0, %2, %1\n" : "+m" (*((uint64_t *)x)), "+r" (b) : "r" (a)); 63 64 asm volatile ( 65 "casx %0, %2, %1\n" 66 : "+m" (*((atomic_count_t *) ptr)), 67 "+r" (b) 68 : "r" (a) 69 ); 62 70 } while (a != b); 63 71 64 72 return a; 65 73 } 66 74 67 static inline longatomic_preinc(atomic_t *val)75 static inline atomic_count_t atomic_preinc(atomic_t *val) 68 76 { 69 77 return atomic_add(val, 1) + 1; 70 78 } 71 79 72 static inline longatomic_postinc(atomic_t *val)80 static inline atomic_count_t atomic_postinc(atomic_t *val) 73 81 { 74 82 return atomic_add(val, 1); 75 83 } 76 84 77 static inline longatomic_predec(atomic_t *val)85 static inline atomic_count_t atomic_predec(atomic_t *val) 78 86 { 79 87 return atomic_add(val, -1) - 1; 80 88 } 81 89 82 static inline longatomic_postdec(atomic_t *val)90 static inline atomic_count_t atomic_postdec(atomic_t *val) 83 91 { 84 92 return atomic_add(val, -1); -
uspace/lib/c/arch/sparc64/include/config.h
r24a2517 rc621f4aa 36 36 #define LIBC_sparc64_CONFIG_H_ 37 37 38 #if defined (SUN4U) 38 39 #define PAGE_WIDTH 14 40 #elif defined(SUN4V) 41 #define PAGE_WIDTH 13 42 #endif 43 39 44 #define PAGE_SIZE (1 << PAGE_WIDTH) 40 45 -
uspace/lib/c/arch/sparc64/include/ddi.h
r24a2517 rc621f4aa 37 37 #include <libarch/types.h> 38 38 39 static inline memory_barrier(void)39 static inline void memory_barrier(void) 40 40 { 41 asm volatile ("membar #LoadLoad | #StoreStore\n" ::: "memory"); 41 asm volatile ( 42 "membar #LoadLoad | #StoreStore\n" 43 ::: "memory" 44 ); 42 45 } 43 46 -
uspace/lib/c/arch/sparc64/include/fibril.h
r24a2517 rc621f4aa 48 48 STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \ 49 49 (c)->fp = -STACK_BIAS; \ 50 (c)->tp = ptls; \50 (c)->tp = (uint64_t) ptls; \ 51 51 } while (0) 52 52 -
uspace/lib/c/arch/sparc64/include/types.h
r24a2517 rc621f4aa 27 27 */ 28 28 29 /** @addtogroup libcsparc64 29 /** @addtogroup libcsparc64 30 30 * @{ 31 31 */ … … 38 38 #define __64_BITS__ 39 39 40 typedef unsigned long sysarg_t; 40 #include <libarch/common.h> 41 41 42 typedef signed char int8_t; 43 typedef short int int16_t; 44 typedef int int32_t; 45 typedef long int int64_t; 42 #define SIZE_MIN UINT64_MIN 43 #define SIZE_MAX UINT64_MAX 46 44 47 typedef unsigned char uint8_t; 48 typedef unsigned short int uint16_t; 49 typedef unsigned int uint32_t; 50 typedef u nsigned long int uint64_t;45 #define SSIZE_MIN INT64_MIN 46 #define SSIZE_MAX INT64_MAX 47 48 typedef uint64_t sysarg_t; 51 49 52 50 typedef int64_t ssize_t; … … 54 52 55 53 typedef uint64_t uintptr_t; 54 typedef uint64_t atomic_count_t; 55 typedef int64_t atomic_signed_t; 56 56 57 57 #endif -
uspace/lib/c/arch/sparc64/src/thread_entry.s
r24a2517 rc621f4aa 42 42 add %g0, -0x7ff, %fp 43 43 44 # 45 # Propagate the input arguments to the new window. 46 # 47 mov %i0, %o0 48 44 49 sethi %hi(_gp), %l7 45 50 call __thread_main ! %o0 contains address of uarg
Note:
See TracChangeset
for help on using the changeset viewer.