Merge pull request #1 in PASDK/pasdk_sr from PASDK-318-input-task-code-repetition...
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamInpProc.h
index c29c95f3a17e352f927918dc2a25874fb21e2795..a34bf55f526005a294639828ae08c102a27ce428 100644 (file)
@@ -47,6 +47,7 @@ All rights reserved.
 #include "audioStreamProc_patchs.h"
 #include "audioStreamProc_config.h"
 #include "audioStreamProc_master.h"
+#include "statusOp_common.h"
 
 // Global debug counter */
 extern Uint32 gTaskAsipCnt; // debug counter for ASP task
@@ -425,5 +426,57 @@ PAF_AST_streamChainFunction(
     Int logArg
 );
 
+//   Purpose:   writing 8-bit integer to shared memeory
+static inline
+sharedMemWriteInt8(
+       volatile XDAS_Int8 *address, /* address to write to */
+       Int8 value,                  /* value to write to the adddress */
+       Int gateIdx)                 /* GateMP Index, defined in statusOp_common.h */
+{
+#ifdef NON_CACHE_STATUS
+       statusOp_write((void *)address, (void *)&value, sizeof(Int8), gateIdx);
+#else
+       *address = value;
+#endif
+}
+
+//   Purpose:   read 8-bit integer from shared memeory
+static inline Int8               /* return the value read in the shared memory */
+sharedMemReadInt8(
+       volatile XDAS_Int8 *address, /* address to read from */
+       Int gateIdx)                 /* GateMP Index, defined in statusOp_common.h */
+{
+#ifdef NON_CACHE_STATUS
+       Int8 tempVar;
+       statusOp_read((void *)&tempVar, (void *)address, sizeof(Int8), gateIdx);
+
+       return tempVar;
+#else
+       return(*address);
+#endif
+}
+
+//   Purpose:   writing 32-bit integer to shared memeory
+static inline sharedMemWriteInt(volatile XDAS_Int32 *address, Int value, Int gateIdx)
+{
+#ifdef NON_CACHE_STATUS
+       statusOp_write((void *)address, (void *)&value, sizeof(Int), gateIdx);
+#else
+       *address = value;
+#endif
+}
+
+//   Purpose:   read 32-bit integer from shared memeory
+static inline Int sharedMemReadInt(volatile XDAS_Int32 *address, Int gateIdx)
+{
+#ifdef NON_CACHE_STATUS
+       Int tempVar;
+       statusOp_read((void *)&tempVar, (void *)address, sizeof(Int), gateIdx);
+
+       return tempVar;
+#else
+       return(*address);
+#endif
+}
 
 #endif /* _ASIP_H_ */