diff --git a/src/kernel/core/arch/x86/arch_x86.S b/src/kernel/core/arch/x86/arch_x86.S index de0c795f78..05e2e72d29 100755 --- a/src/kernel/core/arch/x86/arch_x86.S +++ b/src/kernel/core/arch/x86/arch_x86.S @@ -10,93 +10,6 @@ .text -/* int32 atomic_add(vint32 *val, int32 incr) */ -FUNCTION(atomic_add): - movl 4(%esp),%edx - movl 8(%esp),%eax - lock - xaddl %eax,(%edx) - ret - -/* int32 atomic_and(vint32 *val, int32 incr) */ -FUNCTION(atomic_and): - movl 4(%esp),%edx - -_atomic_and1: - movl 8(%esp),%ecx - movl (%edx),%eax - andl %eax,%ecx - - lock - cmpxchgl %ecx,(%edx) - - jnz _atomic_and1 - - ret - -/* int32 atomic_or(vint32 *val, int32 incr) */ -FUNCTION(atomic_or): - movl 4(%esp),%edx - -_atomic_or1: - movl 8(%esp),%ecx - movl (%edx),%eax - orl %eax,%ecx - - lock - cmpxchgl %ecx,(%edx) - - jnz _atomic_or1 - - ret - -/* int32 atomic_set(vint32 *val, int32 set_to) */ -FUNCTION(atomic_set): - movl 4(%esp),%edx - movl 8(%esp),%eax - xchg %eax,(%edx) - ret - -/* int32 test_and_set(vint32 *val, int32 set_to, int32 test_val) */ -FUNCTION(test_and_set): - movl 4(%esp),%edx - movl 8(%esp),%ecx - movl 12(%esp),%eax - - lock - cmpxchgl %ecx,(%edx) - - ret - -/* saves the conversion factor needed for system_time */ -.global cv_factor -cv_factor: - .word 0 - -FUNCTION(setup_system_time): - movl 4(%esp),%eax - movl %eax,cv_factor - ret - -/* uint64 system_time(); */ -FUNCTION(system_time): - /* load 64-bit factor into %eax (low), %edx (high) */ - rdtsc /* time in %edx,%eax */ - - pushl %ebx - movl cv_factor, %ebx - movl %edx, %ecx /* save high half */ - mull %ebx /* truncate %eax, but keep %edx */ - movl %ecx, %eax - movl %edx, %ecx /* save high half of low */ - mull %ebx /*, %eax*/ - /* now compute [%edx, %eax] + [%ecx], propagating carry */ - subl %ebx, %ebx /* need zero to propagate carry */ - addl %ecx, %eax - adc %ebx, %edx - popl %ebx - ret - /* void arch_cpu_global_TLB_invalidate(); */ FUNCTION(arch_cpu_global_TLB_invalidate): movl %cr3,%eax