ck_pr/gcc: Adopt const semantics for load/store in GCC port.

ck_pring
Samy Al Bahra 12 years ago
parent 5c93ee3add
commit a9ed19303f

@ -45,7 +45,7 @@
#define CK_PR_LOAD(S, M, T) \ #define CK_PR_LOAD(S, M, T) \
CK_CC_INLINE static T \ CK_CC_INLINE static T \
ck_pr_load_##S(M *target) \ ck_pr_load_##S(const M *target) \
{ \ { \
T r; \ T r; \
r = CK_PR_ACCESS(*(T *)target); \ r = CK_PR_ACCESS(*(T *)target); \
@ -58,7 +58,21 @@
return; \ return; \
} }
CK_PR_LOAD(ptr, void, void *) CK_CC_INLINE static void *
ck_pr_load_ptr(const void *target)
{
void *r = CK_PR_ACCESS(*(void **)target);
return r;
}
CK_CC_INLINE static void
ck_pr_store_ptr(void *target, const void *v)
{
CK_PR_ACCESS(*(void **)target) = (void *)v;
return;
}
#define CK_PR_LOAD_S(S, T) CK_PR_LOAD(S, T, T) #define CK_PR_LOAD_S(S, T) CK_PR_LOAD(S, T, T)

Loading…
Cancel
Save