Changeset c621f4aa in mainline for uspace/lib/c/arch/ia32/include
- 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/ia32/include
- Files:
-
- 12 moved
-
atomic.h (moved) (moved from uspace/lib/libc/arch/ia32/include/atomic.h ) (2 diffs)
-
config.h (moved) (moved from uspace/lib/libc/arch/ia32/include/config.h )
-
ddi.h (moved) (moved from uspace/lib/libc/arch/ia32/include/ddi.h )
-
faddr.h (moved) (moved from uspace/lib/libc/arch/ia32/include/faddr.h )
-
fibril.h (moved) (moved from uspace/lib/libc/arch/ia32/include/fibril.h )
-
inttypes.h (moved) (moved from uspace/lib/libc/arch/ia32/include/inttypes.h )
-
istate.h (moved) (moved from uspace/lib/libc/arch/ia32/include/istate.h )
-
limits.h (moved) (moved from uspace/lib/libc/arch/ia32/include/limits.h )
-
syscall.h (moved) (moved from uspace/lib/libc/arch/ia32/include/syscall.h ) (1 diff)
-
thread.h (moved) (moved from uspace/lib/libc/arch/ia32/include/thread.h )
-
tls.h (moved) (moved from uspace/lib/libc/arch/ia32/include/tls.h ) (1 diff)
-
types.h (moved) (moved from uspace/lib/libc/arch/ia32/include/types.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/include/atomic.h
r24a2517 rc621f4aa 40 40 #include <atomicdflt.h> 41 41 42 static inline void atomic_inc(atomic_t *val) { 43 asm volatile ("lock incl %0\n" : "+m" (val->count)); 42 static inline void atomic_inc(atomic_t *val) 43 { 44 asm volatile ( 45 "lock incl %[count]\n" 46 : [count] "+m" (val->count) 47 ); 44 48 } 45 49 46 static inline void atomic_dec(atomic_t *val) { 47 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 ); 48 56 } 49 57 50 static inline long atomic_postinc(atomic_t *val)58 static inline atomic_count_t atomic_postinc(atomic_t *val) 51 59 { 52 long r; 53 54 asm volatile ( 55 "movl $1, %0\n" 56 "lock xaddl %0, %1\n" 57 : "=r" (r), "+m" (val->count) 58 ); 59 60 return r; 61 } 62 63 static inline long atomic_postdec(atomic_t *val) 64 { 65 long r; 60 atomic_count_t r = 1; 66 61 67 62 asm volatile ( 68 " movl $-1, %0\n"69 "lock xaddl %0, %1\n"70 : "=r" (r), "+m" (val->count)63 "lock xaddl %[r], %[count]\n" 64 : [count] "+m" (val->count), 65 [r] "+r" (r) 71 66 ); 72 67 … … 74 69 } 75 70 76 #define atomic_preinc(val) (atomic_postinc(val) + 1) 77 #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) 78 86 79 87 #endif -
uspace/lib/c/arch/ia32/include/syscall.h
r24a2517 rc621f4aa 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
r24a2517 rc621f4aa 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
r24a2517 rc621f4aa 38 38 #define __32_BITS__ 39 39 40 typedef unsigned int sysarg_t; 40 #include <libarch/common.h> 41 41 42 typedef char int8_t; 43 typedef short int int16_t; 44 typedef int int32_t; 45 typedef long long int int64_t; 42 #define SIZE_MIN UINT32_MIN 43 #define SIZE_MAX UINT32_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 long int uint64_t;45 #define SSIZE_MIN INT32_MIN 46 #define SSIZE_MAX INT32_MAX 47 48 typedef uint32_t sysarg_t; 51 49 52 50 typedef int32_t ssize_t; … … 54 52 55 53 typedef uint32_t uintptr_t; 54 typedef uint32_t atomic_count_t; 55 typedef int32_t atomic_signed_t; 56 56 57 57 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
