Changeset 145 for trunk/hal/x86_64/core/hal_remote.c
- Timestamp:
- Jul 5, 2017, 11:05:11 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_remote.c
r124 r145 23 23 #include <hal_internal.h> 24 24 25 void hal_remote_sb( xptr_t xp, 26 uint8_t data ) 25 void hal_remote_sb(xptr_t xp, uint8_t data) 27 26 { 28 27 *(uint8_t *)xp = data; 29 28 } 30 29 31 void hal_remote_sw( xptr_t xp, 32 uint32_t data ) 30 void hal_remote_sw(xptr_t xp, uint32_t data) 33 31 { 34 32 *(uint32_t *)xp = data; 35 33 } 36 34 37 void hal_remote_swd( xptr_t xp, 38 uint64_t data ) 35 void hal_remote_swd(xptr_t xp, uint64_t data) 39 36 { 40 37 *(uint64_t *)xp = data; 41 38 } 42 39 43 void hal_remote_spt( xptr_t xp, 44 void * pt ) 40 void hal_remote_spt(xptr_t xp, void *pt) 45 41 { 46 hal_remote_swd( xp , (uint64_t)pt);42 hal_remote_swd(xp, (uint64_t)pt); 47 43 } 48 44 49 uint8_t hal_remote_lb( xptr_t xp)45 uint8_t hal_remote_lb(xptr_t xp) 50 46 { 51 47 return *(uint8_t *)xp; 52 48 } 53 49 54 uint32_t hal_remote_lw( xptr_t xp)50 uint32_t hal_remote_lw(xptr_t xp) 55 51 { 56 52 return *(uint32_t *)xp; 57 53 } 58 54 59 uint64_t hal_remote_lwd( xptr_t xp)55 uint64_t hal_remote_lwd(xptr_t xp) 60 56 { 61 57 return *(uint64_t *)xp; 62 58 } 63 59 64 void *hal_remote_lpt( xptr_t xp)60 void *hal_remote_lpt(xptr_t xp) 65 61 { 66 return (void *)hal_remote_lwd( xp);62 return (void *)hal_remote_lwd(xp); 67 63 } 68 64 69 bool_t hal_remote_atomic_cas( xptr_t xp, 70 uint32_t old, 71 uint32_t new ) 65 bool_t hal_remote_atomic_cas(xptr_t xp, uint32_t old, uint32_t new) 72 66 { 73 67 return (atomic_cas_32((volatile uint32_t *)xp, old, new) == old); 74 68 } 75 69 76 uint32_t hal_remote_atomic_add( xptr_t xp, 77 uint32_t incr ) // XXX define as signed 70 uint32_t hal_remote_atomic_add(xptr_t xp, uint32_t incr) 78 71 { 79 72 return atomic_add_32((volatile uint32_t *)xp, incr); 80 73 } 81 74 82 uint32_t hal_remote_atomic_and( xptr_t xp, 83 uint32_t mask ) 75 uint32_t hal_remote_atomic_and(xptr_t xp, uint32_t mask) 84 76 { 85 77 return atomic_and_32((volatile uint32_t *)xp, mask); 86 78 } 87 79 88 uint32_t hal_remote_atomic_or( xptr_t xp, 89 uint32_t mask ) 80 uint32_t hal_remote_atomic_or(xptr_t xp, uint32_t mask) 90 81 { 91 82 return atomic_or_32((volatile uint32_t *)xp, mask); 92 83 } 93 84 94 error_t hal_remote_atomic_try_add( xptr_t xp, 95 uint32_t incr, 96 uint32_t * old ) 85 error_t hal_remote_atomic_try_add(xptr_t xp, uint32_t incr, uint32_t *old) 97 86 { 98 87 x86_panic((char *)__func__); … … 100 89 } 101 90 102 void hal_remote_memcpy( xptr_t dst, 103 xptr_t src, 104 uint32_t size ) 91 void hal_remote_memcpy(xptr_t dst, xptr_t src, uint32_t size) 105 92 { 106 93 memcpy((void *)dst, (void *)src, size);
Note: See TracChangeset
for help on using the changeset viewer.