Changeset 04803bf in mainline for uspace/lib/c/arch/ppc32
- Timestamp:
- 2011-03-21T22:00:17Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 143932e3
- Parents:
- b50b5af2 (diff), 7308e84 (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/ppc32
- Files:
-
- 5 added
- 19 moved
-
Makefile.common (moved) (moved from boot/arch/ppc32/loader/boot.S ) (1 diff)
-
Makefile.inc (added)
-
_link.ld.in (moved) (moved from uspace/lib/libc/arch/ppc32/_link.ld.in ) (4 diffs)
-
include/atomic.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/atomic.h ) (6 diffs)
-
include/config.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/config.h )
-
include/ddi.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/ddi.h )
-
include/faddr.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/faddr.h )
-
include/fibril.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/fibril.h ) (1 diff)
-
include/inttypes.h (added)
-
include/istate.h (added)
-
include/limits.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/limits.h )
-
include/regname.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/regname.h )
-
include/stackarg.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/stackarg.h )
-
include/syscall.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/syscall.h )
-
include/thread.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/thread.h )
-
include/tls.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/tls.h )
-
include/types.h (moved) (moved from uspace/lib/libc/arch/ppc32/include/types.h ) (3 diffs)
-
src/entry.s (moved) (moved from uspace/lib/libc/arch/ppc32/src/entry.s ) (1 diff)
-
src/fibril.S (moved) (moved from uspace/lib/libc/arch/ppc32/src/fibril.S )
-
src/stacktrace.c (added)
-
src/stacktrace_asm.S (added)
-
src/syscall.c (moved) (moved from uspace/lib/libc/arch/ppc32/src/syscall.c )
-
src/thread_entry.s (moved) (moved from uspace/lib/libc/arch/ppc32/src/thread_entry.s ) (1 diff)
-
src/tls.c (moved) (moved from uspace/lib/libc/arch/ppc32/src/tls.c )
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ppc32/Makefile.common
rb50b5af2 r04803bf 27 27 # 28 28 29 #include "regname.h" 29 GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32 30 AFLAGS = -a32 30 31 31 .section BOOTSTRAP, "ax" 32 ENDIANESS = BE 32 33 33 .global start 34 35 start: 36 lis r4, ofw_cif@ha 37 addi r4, r4, ofw_cif@l 38 stw r5, 0(r4) 39 40 bl ofw_init 41 42 b bootstrap 34 BFD_NAME = elf32-powerpc 35 BFD_ARCH = powerpc:common -
uspace/lib/c/arch/ppc32/_link.ld.in
rb50b5af2 r04803bf 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 … … 9 9 SECTIONS { 10 10 . = 0x1000 + SIZEOF_HEADERS; 11 11 12 12 .init : { 13 13 *(.init); 14 14 } :text 15 15 16 .text : { 16 17 *(.text); 17 18 *(.rodata*); 18 19 } :text 19 20 20 21 . = . + 0x1000; 21 22 22 23 .data : { 23 24 *(.data); 24 25 *(.sdata); 25 26 } :data 27 26 28 .tdata : { 27 29 _tdata_start = .; … … 32 34 _tbss_end = .; 33 35 } :data 36 34 37 _tls_alignment = ALIGNOF(.tdata); 38 35 39 .bss : { 36 40 *(.sbss); … … 38 42 *(.bss); 39 43 } :data 40 41 . = ALIGN(0x1000);42 _heap = .;43 44 44 45 /DISCARD/ : { 45 46 *(*); 46 47 } 47 48 48 } -
uspace/lib/c/arch/ppc32/include/atomic.h
rb50b5af2 r04803bf 27 27 */ 28 28 29 /** @addtogroup libcppc32 29 /** @addtogroup libcppc32 30 30 * @{ 31 31 */ … … 36 36 #define LIBC_ppc32_ATOMIC_H_ 37 37 38 #define LIBC_ARCH_ATOMIC_H_ 39 40 #include <atomicdflt.h> 41 38 42 static inline void atomic_inc(atomic_t *val) 39 43 { 40 longtmp;41 44 atomic_count_t tmp; 45 42 46 asm volatile ( 43 47 "1:\n" … … 46 50 "stwcx. %0, 0, %2\n" 47 51 "bne- 1b" 48 : "=&r" (tmp), "=m" (val->count) 49 : "r" (&val->count), "m" (val->count) 50 : "cc"); 52 : "=&r" (tmp), 53 "=m" (val->count) 54 : "r" (&val->count), 55 "m" (val->count) 56 : "cc" 57 ); 51 58 } 52 59 53 60 static inline void atomic_dec(atomic_t *val) 54 61 { 55 longtmp;56 62 atomic_count_t tmp; 63 57 64 asm volatile ( 58 65 "1:\n" 59 66 "lwarx %0, 0, %2\n" 60 67 "addic %0, %0, -1\n" 61 "stwcx. %0, 0, %2\n"68 "stwcx. %0, 0, %2\n" 62 69 "bne- 1b" 63 : "=&r" (tmp), "=m" (val->count) 64 : "r" (&val->count), "m" (val->count) 65 : "cc"); 70 : "=&r" (tmp), 71 "=m" (val->count) 72 : "r" (&val->count), 73 "m" (val->count) 74 : "cc" 75 ); 66 76 } 67 77 68 static inline longatomic_postinc(atomic_t *val)78 static inline atomic_count_t atomic_postinc(atomic_t *val) 69 79 { 70 80 atomic_inc(val); … … 72 82 } 73 83 74 static inline longatomic_postdec(atomic_t *val)84 static inline atomic_count_t atomic_postdec(atomic_t *val) 75 85 { 76 86 atomic_dec(val); … … 78 88 } 79 89 80 static inline longatomic_preinc(atomic_t *val)90 static inline atomic_count_t atomic_preinc(atomic_t *val) 81 91 { 82 92 atomic_inc(val); … … 84 94 } 85 95 86 static inline longatomic_predec(atomic_t *val)96 static inline atomic_count_t atomic_predec(atomic_t *val) 87 97 { 88 98 atomic_dec(val); -
uspace/lib/c/arch/ppc32/include/fibril.h
rb50b5af2 r04803bf 78 78 } __attribute__ ((packed)) context_t; 79 79 80 static inline uintptr_t context_get_fp(context_t *ctx) 81 { 82 return ctx->sp; 83 } 84 80 85 #endif 81 86 -
uspace/lib/c/arch/ppc32/include/types.h
rb50b5af2 r04803bf 27 27 */ 28 28 29 /** @addtogroup libcppc32 29 /** @addtogroup libcppc32 30 30 * @{ 31 31 */ … … 36 36 #define LIBC_ppc32_TYPES_H_ 37 37 38 typedef unsigned int sysarg_t; 38 #define __32_BITS__ 39 39 40 typedef char int8_t; 41 typedef short int int16_t; 42 typedef int int32_t; 43 typedef long long int int64_t; 40 #include <libarch/common.h> 44 41 45 typedef unsigned char uint8_t; 46 typedef unsigned short int uint16_t; 47 typedef unsigned int uint32_t; 48 typedef unsigned long long int uint64_t; 42 #define SIZE_MIN UINT32_MIN 43 #define SIZE_MAX UINT32_MAX 44 45 #define SSIZE_MIN INT32_MIN 46 #define SSIZE_MAX INT32_MAX 47 48 typedef uint32_t sysarg_t; 49 49 50 50 typedef int32_t ssize_t; … … 52 52 53 53 typedef uint32_t uintptr_t; 54 typedef uint32_t atomic_count_t; 55 typedef int32_t atomic_signed_t; 54 56 55 57 #endif -
uspace/lib/c/arch/ppc32/src/entry.s
rb50b5af2 r04803bf 38 38 # 39 39 __entry: 40 # 41 # Create the first stack frame. 42 # 43 li %r3, 0 44 stw %r3, 0(%r1) 45 stwu %r1, -16(%r1) 46 40 47 # Pass the PCB pointer to __main() as the first argument. 41 48 # The first argument is passed in r3. 42 49 mr %r3, %r6 43 50 bl __main 44 45 bl __exit -
uspace/lib/c/arch/ppc32/src/thread_entry.s
rb50b5af2 r04803bf 35 35 # 36 36 __thread_entry: 37 # 38 # Create the first stack frame. 39 # 40 li %r4, 0 41 stw %r4, 0(%r1) 42 stwu %r1, -16(%r1) 43 37 44 b __thread_main 38 45
Note:
See TracChangeset
for help on using the changeset viewer.
