Changeset 04803bf in mainline for uspace/lib/c/arch/mips32
- 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/mips32
- Files:
-
- 5 added
- 18 moved
-
Makefile.common (added)
-
Makefile.inc (moved) (moved from uspace/lib/libc/arch/amd64/Makefile.inc ) (1 diff)
-
_link.ld.in (moved) (moved from uspace/lib/libc/arch/mips32/_link.ld.in ) (2 diffs)
-
include/atomic.h (moved) (moved from uspace/lib/libc/arch/mips32/include/atomic.h ) (3 diffs)
-
include/config.h (moved) (moved from uspace/lib/libc/arch/mips32/include/config.h )
-
include/ddi.h (moved) (moved from uspace/lib/libc/arch/mips32/include/ddi.h )
-
include/faddr.h (moved) (moved from uspace/lib/libc/arch/mips32/include/faddr.h )
-
include/fibril.h (moved) (moved from uspace/lib/libc/arch/mips32/include/fibril.h ) (1 diff)
-
include/inttypes.h (added)
-
include/istate.h (added)
-
include/limits.h (moved) (moved from uspace/lib/libc/arch/mips32/include/limits.h )
-
include/stackarg.h (moved) (moved from uspace/lib/libc/arch/mips32/include/stackarg.h )
-
include/syscall.h (moved) (moved from uspace/lib/libc/arch/mips32/include/syscall.h )
-
include/thread.h (moved) (moved from uspace/lib/libc/arch/mips32/include/thread.h )
-
include/tls.h (moved) (moved from uspace/lib/libc/arch/mips32/include/tls.h )
-
include/types.h (moved) (moved from uspace/lib/libc/arch/mips32/include/types.h ) (3 diffs)
-
src/entry.s (moved) (moved from uspace/lib/libc/arch/mips32/src/entry.s ) (2 diffs)
-
src/fibril.S (moved) (moved from uspace/lib/libc/arch/mips32/src/fibril.S )
-
src/stacktrace.c (added)
-
src/stacktrace_asm.S (added)
-
src/syscall.c (moved) (moved from uspace/lib/libc/arch/mips32/src/syscall.c )
-
src/thread_entry.s (moved) (moved from uspace/lib/libc/arch/mips32/src/thread_entry.s )
-
src/tls.c (moved) (moved from uspace/lib/libc/arch/mips32/src/tls.c )
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/mips32/Makefile.inc
rb50b5af2 r04803bf 27 27 # 28 28 29 ## Toolchain configuration 30 # 29 ARCH_SOURCES = \ 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/thread_entry.s \ 32 arch/$(UARCH)/src/syscall.c \ 33 arch/$(UARCH)/src/fibril.S \ 34 arch/$(UARCH)/src/tls.c \ 35 arch/$(UARCH)/src/stacktrace.c \ 36 arch/$(UARCH)/src/stacktrace_asm.S 31 37 32 TARGET = amd64-linux-gnu 33 TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin 34 35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ 36 arch/$(UARCH)/src/fibril.S \ 37 arch/$(UARCH)/src/tls.c 38 39 LFLAGS += -N 40 41 ENDIANESS = LE 42 43 BFD_NAME = elf64-x86-64 44 BFD_ARCH = i386:x86-64 38 .PRECIOUS: arch/$(UARCH)/src/entry.o -
uspace/lib/c/arch/mips32/_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 … … 13 13 *(.init); 14 14 } :text 15 15 16 .text : { 16 *(.text);17 *(.text); 17 18 *(.rodata*); 18 19 } :text 19 20 20 21 . = . + 0x4000; 21 22 22 23 .data : { 23 24 *(.data); 24 25 *(.data.rel*); 25 26 } :data 26 27 27 28 .got : { 28 29 _gp = .; 29 30 *(.got); 30 31 } :data 31 32 32 33 .tdata : { 33 34 _tdata_start = .; 34 35 *(.tdata); 35 36 _tdata_end = .; 37 } :data 38 39 .tbss : { 36 40 _tbss_start = .; 37 41 *(.tbss); 38 42 _tbss_end = .; 39 43 } :data 40 _tls_alignment = ALIGNOF(.tdata); 41 44 45 _tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); 46 42 47 .sbss : { 43 48 *(.scommon); 44 49 *(.sbss); 45 } 50 } 51 46 52 .bss : { 47 53 *(.bss); 48 54 *(COMMON); 49 55 } :data 50 51 . = ALIGN(0x4000); 52 _heap = .; 53 56 54 57 /DISCARD/ : { 55 58 *(*); -
uspace/lib/c/arch/mips32/include/atomic.h
rb50b5af2 r04803bf 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32eb 33 * @ingroup libcmips32eb 34 34 */ 35 35 … … 37 37 #define LIBC_mips32_ATOMIC_H_ 38 38 39 #define atomic_inc(x) ((void) atomic_add(x, 1)) 40 #define atomic_dec(x) ((void) atomic_add(x, -1)) 39 #define LIBC_ARCH_ATOMIC_H_ 41 40 42 #define atomic_postinc(x) (atomic_add(x, 1) - 1) 43 #define atomic_postdec(x) (atomic_add(x, -1) + 1) 41 #include <atomicdflt.h> 44 42 45 #define atomic_preinc(x) atomic_add(x, 1) 46 #define atomic_predec(x) atomic_add(x, -1) 43 #define atomic_inc(x) ((void) atomic_add(x, 1)) 44 #define atomic_dec(x) ((void) atomic_add(x, -1)) 45 46 #define atomic_postinc(x) (atomic_add(x, 1) - 1) 47 #define atomic_postdec(x) (atomic_add(x, -1) + 1) 48 49 #define atomic_preinc(x) atomic_add(x, 1) 50 #define atomic_predec(x) atomic_add(x, -1) 47 51 48 52 /* Atomic addition of immediate value. 49 53 * 50 54 * @param val Memory location to which will be the immediate value added. 51 * @param i Signed immediate that will be added to *val.55 * @param i Signed immediate that will be added to *val. 52 56 * 53 57 * @return Value after addition. 58 * 54 59 */ 55 static inline long atomic_add(atomic_t *val, int i)60 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 56 61 { 57 long tmp, v; 58 62 atomic_count_t tmp; 63 atomic_count_t v; 64 59 65 asm volatile ( 60 66 "1:\n" … … 66 72 /* nop */ /* nop is inserted automatically by compiler */ 67 73 " nop\n" 68 : "=&r" (tmp), "+m" (val->count), "=&r" (v) 69 : "r" (i), "i" (0) 70 ); 71 74 : "=&r" (tmp), 75 "+m" (val->count), 76 "=&r" (v) 77 : "r" (i), 78 "i" (0) 79 ); 80 72 81 return v; 73 82 } -
uspace/lib/c/arch/mips32/include/fibril.h
rb50b5af2 r04803bf 85 85 } context_t; 86 86 87 static inline uintptr_t context_get_fp(context_t *ctx) 88 { 89 return ctx->sp; 90 } 91 87 92 #endif 88 93 -
uspace/lib/c/arch/mips32/include/types.h
rb50b5af2 r04803bf 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ … … 37 37 #define LIBC_mips32_TYPES_H_ 38 38 39 typedef unsigned int sysarg_t; 39 #define __32_BITS__ 40 40 41 typedef char int8_t; 42 typedef short int int16_t; 43 typedef long int int32_t; 44 typedef long long int int64_t; 41 #include <libarch/common.h> 45 42 46 typedef unsigned char uint8_t; 47 typedef unsigned short int uint16_t; 48 typedef unsigned long int uint32_t; 49 typedef unsigned long long int uint64_t; 43 #define SIZE_MIN UINT32_MIN 44 #define SIZE_MAX UINT32_MAX 45 46 #define SSIZE_MIN INT32_MIN 47 #define SSIZE_MAX INT32_MAX 48 49 typedef uint32_t sysarg_t; 50 50 51 51 typedef int32_t ssize_t; … … 53 53 54 54 typedef uint32_t uintptr_t; 55 typedef uint32_t atomic_count_t; 56 typedef int32_t atomic_signed_t; 55 57 56 58 #endif -
uspace/lib/c/arch/mips32/src/entry.s
rb50b5af2 r04803bf 29 29 .text 30 30 .section .init, "ax" 31 31 32 .global __entry 32 .global __entry_driver 33 33 34 .set noreorder 34 35 .option pic2 … … 56 57 jal __main 57 58 nop 58 59 jal __exit60 nop61 59 .end 62 63 # Alignment of output section data to 0x400064 .section .data65 .align 14
Note:
See TracChangeset
for help on using the changeset viewer.
