From a9ed19303f9ccc682dfd92e40e8f2082415fc911 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sun, 7 Oct 2012 22:45:23 -0400 Subject: [PATCH] ck_pr/gcc: Adopt const semantics for load/store in GCC port. --- include/gcc/ck_pr.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/include/gcc/ck_pr.h b/include/gcc/ck_pr.h index c16587c..1892877 100644 --- a/include/gcc/ck_pr.h +++ b/include/gcc/ck_pr.h @@ -45,7 +45,7 @@ #define CK_PR_LOAD(S, M, T) \ CK_CC_INLINE static T \ - ck_pr_load_##S(M *target) \ + ck_pr_load_##S(const M *target) \ { \ T r; \ r = CK_PR_ACCESS(*(T *)target); \ @@ -58,7 +58,21 @@ 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)