Changeset 371bd7d in mainline for uspace/lib/c/arch/ia32
- Timestamp:
- 2010-03-27T09:22:17Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36a75a2
- Parents:
- cd82bb1 (diff), eaf22d4 (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/ia32
- Files:
-
- 5 added
- 18 moved
-
Makefile.common (moved) (moved from uspace/lib/softfloat/Makefile.common ) (1 diff)
-
Makefile.inc (added)
-
_link.ld.in (moved) (moved from uspace/lib/libc/arch/ia32/_link.ld.in ) (1 diff)
-
include/atomic.h (moved) (moved from uspace/lib/libc/arch/ia32/include/atomic.h ) (2 diffs)
-
include/config.h (moved) (moved from uspace/lib/libc/arch/ia32/include/config.h )
-
include/ddi.h (moved) (moved from uspace/lib/libc/arch/ia32/include/ddi.h )
-
include/faddr.h (moved) (moved from uspace/lib/libc/arch/ia32/include/faddr.h )
-
include/fibril.h (moved) (moved from uspace/lib/libc/arch/ia32/include/fibril.h ) (1 diff)
-
include/inttypes.h (added)
-
include/istate.h (added)
-
include/limits.h (moved) (moved from uspace/lib/libc/arch/ia32/include/limits.h ) (1 diff)
-
include/syscall.h (moved) (moved from uspace/lib/libc/arch/ia32/include/syscall.h ) (1 diff)
-
include/thread.h (moved) (moved from uspace/lib/libc/arch/ia32/include/thread.h )
-
include/tls.h (moved) (moved from uspace/lib/libc/arch/ia32/include/tls.h ) (1 diff)
-
include/types.h (moved) (moved from uspace/lib/libc/arch/ia32/include/types.h ) (2 diffs)
-
src/entry.s (moved) (moved from uspace/lib/libc/arch/ia32/src/entry.s ) (1 diff)
-
src/fibril.S (moved) (moved from uspace/lib/libc/arch/ia32/src/fibril.S )
-
src/setjmp.S (moved) (moved from uspace/lib/libc/arch/ia32/src/setjmp.S )
-
src/stacktrace.c (added)
-
src/stacktrace_asm.S (added)
-
src/syscall.S (moved) (moved from uspace/lib/libc/arch/ia32/src/syscall.S )
-
src/thread_entry.s (moved) (moved from uspace/lib/libc/arch/ia32/src/thread_entry.s ) (1 diff)
-
src/tls.c (moved) (moved from uspace/lib/libc/arch/ia32/src/tls.c )
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/Makefile.common
rcd82bb1 r371bd7d 27 27 # 28 28 29 CLANG_ARCH = i386 30 GCC_CFLAGS += -march=pentium 29 31 30 ## Common names 31 # 32 ENDIANESS = LE 32 33 33 LIBC_PREFIX = ../libc 34 DEPEND = Makefile.depend 35 DEPEND_PREV = $(DEPEND).prev 36 LIBSOFTFLOAT = libsoftfloat.a 34 BFD_NAME = elf32-i386 35 BFD_ARCH = i386 -
uspace/lib/c/arch/ia32/_link.ld.in
rcd82bb1 r371bd7d 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/ia32/include/atomic.h
rcd82bb1 r371bd7d 36 36 #define LIBC_ia32_ATOMIC_H_ 37 37 38 static inline void atomic_inc(atomic_t *val) { 39 asm volatile ("lock incl %0\n" : "+m" (val->count)); 38 #define LIBC_ARCH_ATOMIC_H_ 39 40 #include <atomicdflt.h> 41 42 static inline void atomic_inc(atomic_t *val) 43 { 44 asm volatile ( 45 "lock incl %[count]\n" 46 : [count] "+m" (val->count) 47 ); 40 48 } 41 49 42 static inline void atomic_dec(atomic_t *val) { 43 asm volatile ("lock decl %0\n" : "+m" (val->count)); 50 static inline void atomic_dec(atomic_t *val) 51 { 52 asm volatile ( 53 "lock decl %[count]\n" 54 : [count] "+m" (val->count) 55 ); 44 56 } 45 57 46 static inline long atomic_postinc(atomic_t *val)58 static inline atomic_count_t atomic_postinc(atomic_t *val) 47 59 { 48 long r; 49 50 asm volatile ( 51 "movl $1, %0\n" 52 "lock xaddl %0, %1\n" 53 : "=r" (r), "+m" (val->count) 54 ); 55 56 return r; 57 } 58 59 static inline long atomic_postdec(atomic_t *val) 60 { 61 long r; 60 atomic_count_t r = 1; 62 61 63 62 asm volatile ( 64 " movl $-1, %0\n"65 "lock xaddl %0, %1\n"66 : "=r" (r), "+m" (val->count)63 "lock xaddl %[r], %[count]\n" 64 : [count] "+m" (val->count), 65 [r] "+r" (r) 67 66 ); 68 67 … … 70 69 } 71 70 72 #define atomic_preinc(val) (atomic_postinc(val) + 1) 73 #define atomic_predec(val) (atomic_postdec(val) - 1) 71 static inline atomic_count_t atomic_postdec(atomic_t *val) 72 { 73 atomic_count_t r = -1; 74 75 asm volatile ( 76 "lock xaddl %[r], %[count]\n" 77 : [count] "+m" (val->count), 78 [r] "+r" (r) 79 ); 80 81 return r; 82 } 83 84 #define atomic_preinc(val) (atomic_postinc(val) + 1) 85 #define atomic_predec(val) (atomic_postdec(val) - 1) 74 86 75 87 #endif -
uspace/lib/c/arch/ia32/include/fibril.h
rcd82bb1 r371bd7d 44 44 #define SP_DELTA (12) 45 45 46 #define context_set(c, _pc, stack, size, ptls) \ 47 do { \ 48 (c)->pc = (sysarg_t) (_pc); \ 49 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 50 (c)->tls = (sysarg_t) (ptls); \ 51 (c)->ebp = 0; \ 52 } while (0) 53 46 54 /* We include only registers that must be preserved 47 55 * during function call -
uspace/lib/c/arch/ia32/include/limits.h
rcd82bb1 r371bd7d 36 36 #define LIBC_ia32__LIMITS_H_ 37 37 38 # define LONG_MIN MIN_INT32 39 # define LONG_MAX MAX_INT32 40 # define ULONG_MIN MIN_UINT32 41 # define ULONG_MAX MAX_UINT32 38 #define LONG_MIN MIN_INT32 39 #define LONG_MAX MAX_INT32 40 #define ULONG_MIN MIN_UINT32 41 #define ULONG_MAX MAX_UINT32 42 43 #define SIZE_MIN MIN_UINT32 44 #define SIZE_MAX MAX_UINT32 45 #define SSIZE_MIN MIN_INT32 46 #define SSIZE_MAX MAX_INT32 42 47 43 48 #endif -
uspace/lib/c/arch/ia32/include/syscall.h
rcd82bb1 r371bd7d 40 40 #include <kernel/syscall/syscall.h> 41 41 42 #define __syscall0 __syscall_fast_func43 #define __syscall1 __syscall_fast_func44 #define __syscall2 __syscall_fast_func45 #define __syscall3 __syscall_fast_func46 #define __syscall4 __syscall_fast_func47 #define __syscall5 __syscall_slow48 #define __syscall6 __syscall_slow42 #define __syscall0 __syscall_fast_func 43 #define __syscall1 __syscall_fast_func 44 #define __syscall2 __syscall_fast_func 45 #define __syscall3 __syscall_fast_func 46 #define __syscall4 __syscall_fast_func 47 #define __syscall5 __syscall_slow 48 #define __syscall6 __syscall_slow 49 49 50 extern sysarg_t 51 (* __syscall_fast_func)(const sysarg_t, const sysarg_t, const sysarg_t, 50 extern sysarg_t (* __syscall_fast_func)(const sysarg_t, const sysarg_t, 51 const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t, 52 const syscall_t); 53 54 extern sysarg_t __syscall_slow(const sysarg_t, const sysarg_t, const sysarg_t, 52 55 const sysarg_t, const sysarg_t, const sysarg_t, const syscall_t); 53 54 extern sysarg_t55 __syscall_slow(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,56 const sysarg_t, const sysarg_t, const syscall_t);57 56 58 57 #endif -
uspace/lib/c/arch/ia32/include/tls.h
rcd82bb1 r371bd7d 53 53 { 54 54 void *retval; 55 56 asm ("movl %%gs:0, %0" : "=r"(retval)); 55 56 asm ( 57 "movl %%gs:0, %0" 58 : "=r" (retval) 59 ); 60 57 61 return retval; 58 62 } -
uspace/lib/c/arch/ia32/include/types.h
rcd82bb1 r371bd7d 36 36 #define LIBC_ia32_TYPES_H_ 37 37 38 #define __32_BITS__ 39 38 40 typedef unsigned int sysarg_t; 39 41 … … 52 54 53 55 typedef uint32_t uintptr_t; 56 typedef uint32_t atomic_count_t; 57 typedef int32_t atomic_signed_t; 54 58 55 59 #endif -
uspace/lib/c/arch/ia32/src/entry.s
rcd82bb1 r371bd7d 55 55 movl $__syscall_fast, (%eax) 56 56 0: 57 # 58 # Create the first stack frame. 59 # 60 pushl $0 61 movl %esp, %ebp 57 62 58 63 # Pass the PCB pointer to __main as the first argument -
uspace/lib/c/arch/ia32/src/thread_entry.s
rcd82bb1 r371bd7d 42 42 43 43 # 44 # Create the first stack frame. 45 # 46 pushl $0 47 mov %esp, %ebp 48 49 # 44 50 # EAX contains address of uarg. 45 51 #
Note:
See TracChangeset
for help on using the changeset viewer.
