Changeset 23684b7 in mainline
- Timestamp:
- 2006-03-22T17:21:15Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d71007e
- Parents:
- 45fb65c
- Files:
-
- 1 added
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/include/atomic.h
r45fb65c r23684b7 33 33 #include <arch/barrier.h> 34 34 #include <preemption.h> 35 36 typedef struct { volatile __u64 count; } atomic_t; 37 38 static inline void atomic_set(atomic_t *val, __u64 i) 39 { 40 val->count = i; 41 } 42 43 static inline __u64 atomic_get(atomic_t *val) 44 { 45 return val->count; 46 } 35 #include <typedefs.h> 47 36 48 37 static inline void atomic_inc(atomic_t *val) { … … 62 51 } 63 52 64 static inline count_tatomic_postinc(atomic_t *val)53 static inline long atomic_postinc(atomic_t *val) 65 54 { 66 count_tr;55 long r; 67 56 68 57 __asm__ volatile ( … … 75 64 } 76 65 77 static inline count_tatomic_postdec(atomic_t *val)66 static inline long atomic_postdec(atomic_t *val) 78 67 { 79 count_tr;68 long r; 80 69 81 70 __asm__ volatile ( … … 104 93 105 94 106 /** AMD64 specific fast spinlock */95 /** amd64 specific fast spinlock */ 107 96 static inline void atomic_lock_arch(atomic_t *val) 108 97 { … … 117 106 "mov %0, %1;" 118 107 "testq %1, %1;" 119 "jnz 0b;" /* L eightweight looping on locked spinlock */108 "jnz 0b;" /* Lightweight looping on locked spinlock */ 120 109 121 110 "incq %1;" /* now use the atomic operation */ -
arch/amd64/src/proc/scheduler.c
r45fb65c r23684b7 34 34 #include <arch/asm.h> 35 35 #include <arch/debugger.h> 36 #include <print.h> 36 37 37 #include <print.h>38 38 void before_thread_runs_arch(void) 39 39 { -
arch/ia32/include/atomic.h
r45fb65c r23684b7 33 33 #include <arch/barrier.h> 34 34 #include <preemption.h> 35 36 typedef struct { volatile __u32 count; } atomic_t; 37 38 static inline void atomic_set(atomic_t *val, __u32 i) 39 { 40 val->count = i; 41 } 42 43 static inline __u32 atomic_get(atomic_t *val) 44 { 45 return val->count; 46 } 35 #include <typedefs.h> 47 36 48 37 static inline void atomic_inc(atomic_t *val) { … … 62 51 } 63 52 64 static inline count_tatomic_postinc(atomic_t *val)53 static inline long atomic_postinc(atomic_t *val) 65 54 { 66 count_tr;55 long r; 67 56 68 57 __asm__ volatile ( … … 75 64 } 76 65 77 static inline count_tatomic_postdec(atomic_t *val)66 static inline long atomic_postdec(atomic_t *val) 78 67 { 79 count_tr;68 long r; 80 69 81 70 __asm__ volatile ( … … 103 92 } 104 93 105 /** Ia32 specific fast spinlock */94 /** ia32 specific fast spinlock */ 106 95 static inline void atomic_lock_arch(atomic_t *val) 107 96 { … … 116 105 "mov %0, %1;" 117 106 "testl %1, %1;" 118 "jnz 0b;" /* L eightweight looping on locked spinlock */107 "jnz 0b;" /* Lightweight looping on locked spinlock */ 119 108 120 109 "incl %1;" /* now use the atomic operation */ -
arch/ia32/src/userspace.c
r45fb65c r23684b7 62 62 "pushl %4\n" 63 63 "movl %5, %%eax\n" 64 "iret "64 "iret\n" 65 65 : 66 66 : "i" (selector(UDATA_DES) | PL_USER), "r" (kernel_uarg->uspace_stack+THREAD_STACK_SIZE), -
arch/ia64/include/atomic.h
r45fb65c r23684b7 31 31 32 32 #include <arch/types.h> 33 #include <typedefs.h> 33 34 34 typedef struct { volatile __u64 count; } atomic_t;35 35 36 36 /** Atomic addition. … … 41 41 * @return Value before addition. 42 42 */ 43 static inline count_tatomic_add(atomic_t *val, int imm)43 static inline long atomic_add(atomic_t *val, int imm) 44 44 { 45 count_tv;45 long v; 46 46 47 47 __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (val->count) : "i" (imm)); … … 50 50 } 51 51 52 static inline void atomic_set(atomic_t *val, __u64 i)53 {54 val->count = i;55 }56 57 static inline __u32 atomic_get(atomic_t *val)58 {59 return val->count;60 }61 62 52 static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } 63 53 static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } 64 54 65 static inline count_tatomic_preinc(atomic_t *val) { return atomic_add(val, 1) + 1; }66 static inline count_tatomic_predec(atomic_t *val) { return atomic_add(val, -1) - 1; }55 static inline long atomic_preinc(atomic_t *val) { return atomic_add(val, 1) + 1; } 56 static inline long atomic_predec(atomic_t *val) { return atomic_add(val, -1) - 1; } 67 57 68 static inline count_tatomic_postinc(atomic_t *val) { return atomic_add(val, 1); }69 static inline count_tatomic_postdec(atomic_t *val) { return atomic_add(val, -1); }58 static inline long atomic_postinc(atomic_t *val) { return atomic_add(val, 1); } 59 static inline long atomic_postdec(atomic_t *val) { return atomic_add(val, -1); } 70 60 71 61 #endif -
arch/ia64/src/mm/tlb.c
r45fb65c r23684b7 439 439 page_table_unlock(AS, true); 440 440 if (!as_page_fault(va)) { 441 panic("%s: va=%P, rid=%d \n", __FUNCTION__, istate->cr_ifa, rr.map.rid);441 panic("%s: va=%P, rid=%d, iip=%P\n", __FUNCTION__, istate->cr_ifa, rr.map.rid, istate->cr_iip); 442 442 } 443 443 } -
arch/mips32/include/atomic.h
r45fb65c r23684b7 31 31 32 32 #include <arch/types.h> 33 #include <typedefs.h> 33 34 34 35 #define atomic_inc(x) ((void) atomic_add(x, 1)) … … 41 42 #define atomic_predec(x) atomic_add(x, -1) 42 43 43 typedef struct { volatile __u32 count; } atomic_t;44 45 44 /* Atomic addition of immediate value. 46 45 * … … 50 49 * @return Value after addition. 51 50 */ 52 static inline count_tatomic_add(atomic_t *val, int i)51 static inline long atomic_add(atomic_t *val, int i) 53 52 { 54 count_ttmp, v;53 long tmp, v; 55 54 56 55 __asm__ volatile ( … … 69 68 } 70 69 71 /* Reads/writes are atomic on mips for 4-bytes */72 73 static inline void atomic_set(atomic_t *val, __u32 i)74 {75 val->count = i;76 }77 78 static inline __u32 atomic_get(atomic_t *val)79 {80 return val->count;81 }82 83 70 #endif -
arch/ppc32/include/atomic.h
r45fb65c r23684b7 31 31 32 32 #include <arch/types.h> 33 34 typedef struct { volatile __u32 count; } atomic_t; 33 #include <typedefs.h> 35 34 36 35 static inline void atomic_inc(atomic_t *val) … … 64 63 } 65 64 66 static inline __u32atomic_postinc(atomic_t *val)65 static inline long atomic_postinc(atomic_t *val) 67 66 { 68 67 atomic_inc(val); … … 70 69 } 71 70 72 static inline __u32atomic_postdec(atomic_t *val)71 static inline long atomic_postdec(atomic_t *val) 73 72 { 74 73 atomic_dec(val); … … 76 75 } 77 76 78 static inline __u32atomic_preinc(atomic_t *val)77 static inline long atomic_preinc(atomic_t *val) 79 78 { 80 79 atomic_inc(val); … … 82 81 } 83 82 84 static inline __u32atomic_predec(atomic_t *val)83 static inline long atomic_predec(atomic_t *val) 85 84 { 86 85 atomic_dec(val); … … 88 87 } 89 88 90 static inline void atomic_set(atomic_t *val, __u32 i)91 {92 val->count = i;93 }94 95 static inline __u32 atomic_get(atomic_t *val)96 {97 return val->count;98 }99 100 89 #endif -
arch/sparc64/include/atomic.h
r45fb65c r23684b7 31 31 32 32 #include <arch/types.h> 33 34 typedef struct { volatile __u64 count; } atomic_t; 33 #include <typedefs.h> 35 34 36 35 /** Atomic add operation. … … 43 42 * @return Value of the atomic variable as it existed before addition. 44 43 */ 45 static inline count_tatomic_add(atomic_t *val, int i)44 static inline long atomic_add(atomic_t *val, int i) 46 45 { 47 46 __u64 a, b; … … 63 62 } 64 63 65 static inline count_tatomic_preinc(atomic_t *val)64 static inline long atomic_preinc(atomic_t *val) 66 65 { 67 66 return atomic_add(val, 1) + 1; 68 67 } 69 68 70 static inline count_tatomic_postinc(atomic_t *val)69 static inline long atomic_postinc(atomic_t *val) 71 70 { 72 71 return atomic_add(val, 1); 73 72 } 74 73 75 static inline count_tatomic_predec(atomic_t *val)74 static inline long atomic_predec(atomic_t *val) 76 75 { 77 76 return atomic_add(val, -1) - 1; 78 77 } 79 78 80 static inline count_tatomic_postdec(atomic_t *val)79 static inline long atomic_postdec(atomic_t *val) 81 80 { 82 81 return atomic_add(val, -1); … … 93 92 } 94 93 95 static inline void atomic_set(atomic_t *val, __u64 i)96 {97 val->count = i;98 }99 100 static inline __u64 atomic_get(atomic_t *val)101 {102 return val->count;103 }104 105 94 #endif -
generic/include/func.h
r45fb65c r23684b7 32 32 #include <arch/types.h> 33 33 #include <typedefs.h> 34 #include <a rch/atomic.h>34 #include <atomic.h> 35 35 36 36 extern atomic_t haltstate; -
generic/include/mm/slab.h
r45fb65c r23684b7 32 32 #include <adt/list.h> 33 33 #include <synch/spinlock.h> 34 #include <a rch/atomic.h>34 #include <atomic.h> 35 35 #include <mm/frame.h> 36 36 -
generic/include/proc/scheduler.h
r45fb65c r23684b7 33 33 #include <time/clock.h> /* HZ */ 34 34 #include <typedefs.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <adt/list.h> 37 37 -
generic/include/synch/spinlock.h
r45fb65c r23684b7 33 33 #include <typedefs.h> 34 34 #include <preemption.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <debug.h> 37 37 -
generic/include/typedefs.h
r45fb65c r23684b7 93 93 typedef struct btree btree_t; 94 94 95 typedef struct atomic atomic_t; 96 95 97 #endif -
generic/src/console/console.c
r45fb65c r23684b7 37 37 #include <func.h> 38 38 #include <print.h> 39 #include <a rch/atomic.h>39 #include <atomic.h> 40 40 41 41 #define BUFLEN 2048 -
generic/src/mm/tlb.c
r45fb65c r23684b7 33 33 #include <synch/spinlock.h> 34 34 #include <typedefs.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <arch/interrupt.h> 37 37 #include <config.h> -
generic/src/proc/scheduler.c
r45fb65c r23684b7 35 35 #include <arch/asm.h> 36 36 #include <arch/faddr.h> 37 #include <a rch/atomic.h>37 #include <atomic.h> 38 38 #include <synch/spinlock.h> 39 39 #include <config.h> -
generic/src/proc/thread.c
r45fb65c r23684b7 50 50 #include <smp/ipi.h> 51 51 #include <arch/faddr.h> 52 #include <a rch/atomic.h>52 #include <atomic.h> 53 53 #include <memstr.h> 54 54 #include <print.h> -
generic/src/synch/spinlock.c
r45fb65c r23684b7 28 28 29 29 #include <synch/spinlock.h> 30 #include <a rch/atomic.h>30 #include <atomic.h> 31 31 #include <arch/barrier.h> 32 32 #include <arch.h> -
generic/src/time/clock.c
r45fb65c r23684b7 39 39 #include <arch.h> 40 40 #include <adt/list.h> 41 #include <a rch/atomic.h>41 #include <atomic.h> 42 42 #include <proc/thread.h> 43 43 -
test/atomic/atomic1/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <print.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <debug.h> 33 33 -
test/debug/mips1/test.c
r45fb65c r23684b7 32 32 33 33 #include <test.h> 34 #include <a rch/atomic.h>34 #include <atomic.h> 35 35 #include <proc/thread.h> 36 36 #include <time/delay.h> -
test/fault/fault1/test.c
r45fb65c r23684b7 33 33 34 34 #include <test.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <proc/thread.h> 37 37 -
test/fpu/fpu1/test.c
r45fb65c r23684b7 33 33 34 34 #include <test.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <proc/thread.h> 37 37 -
test/fpu/mips1/test.c
r45fb65c r23684b7 32 32 33 33 #include <test.h> 34 #include <a rch/atomic.h>34 #include <atomic.h> 35 35 #include <proc/thread.h> 36 36 #include <time/delay.h> -
test/fpu/sse1/test.c
r45fb65c r23684b7 32 32 33 33 #include <test.h> 34 #include <a rch/atomic.h>34 #include <atomic.h> 35 35 #include <proc/thread.h> 36 36 #include <time/delay.h> -
test/mm/falloc2/test.c
r45fb65c r23684b7 33 33 #include <arch/mm/page.h> 34 34 #include <arch/types.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <debug.h> 37 37 #include <proc/thread.h> -
test/synch/rwlock1/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/synch/rwlock2/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/synch/rwlock3/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/synch/rwlock4/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/synch/rwlock5/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/synch/semaphore1/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/synch/semaphore2/test.c
r45fb65c r23684b7 29 29 #include <test.h> 30 30 #include <arch.h> 31 #include <a rch/atomic.h>31 #include <atomic.h> 32 32 #include <print.h> 33 33 #include <proc/thread.h> -
test/thread/thread1/test.c
r45fb65c r23684b7 33 33 34 34 #include <test.h> 35 #include <a rch/atomic.h>35 #include <atomic.h> 36 36 #include <proc/thread.h> 37 37
Note:
See TracChangeset
for help on using the changeset viewer.