Changeset 98 for trunk/hal/x86_64
- Timestamp:
- Jun 29, 2017, 2:27:35 PM (8 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_cpu.S
r97 r98 111 111 ret 112 112 113 ASM_ENTRY(atomic_and_32) 114 movl (%rdi),%eax 115 1: 116 movl %eax,%ecx 117 andl %esi,%ecx 118 lock 119 cmpxchgl %ecx,(%rdi) 120 jnz 1b 121 /* %eax now contains the old value */ 122 ret 123 124 ASM_ENTRY(atomic_or_32) 125 movl (%rdi),%eax 126 1: 127 movl %eax,%ecx 128 orl %esi,%ecx 129 lock 130 cmpxchgl %ecx,(%rdi) 131 jnz 1b 132 /* %eax now contains the old value */ 133 ret 134 -
trunk/hal/x86_64/core/hal_internal.h
r96 r98 43 43 uint32_t atomic_cas_32(volatile uint32_t *ptr, uint32_t exp, uint32_t new); 44 44 uint32_t atomic_add_32(volatile uint32_t *ptr, int32_t incr); 45 uint32_t atomic_and_32(volatile uint32_t *ptr, uint32_t mask); 46 uint32_t atomic_or_32(volatile uint32_t *ptr, uint32_t mask); 45 47 46 48 /* hal_gpt.c */ -
trunk/hal/x86_64/core/hal_remote.c
r96 r98 86 86 uint32_t mask ) 87 87 { 88 x86_panic((char *)__func__); 89 return 0; 88 return atomic_and_32((volatile uint32_t *)xp, mask); 90 89 } 91 90 … … 93 92 uint32_t mask ) 94 93 { 95 x86_panic((char *)__func__); 96 return 0; 94 return atomic_or_32((volatile uint32_t *)xp, mask); 97 95 } 98 96
Note: See TracChangeset
for help on using the changeset viewer.