Commit 35d684a3 authored by Federico Vaga's avatar Federico Vaga Committed by Federico Vaga

sw:*: move shared memory modifier to common header

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@vaga.pv.it>
parent 8b9e49e2
......@@ -158,13 +158,13 @@ struct trtl_tlv {
* that you can use to access the shared memory.
*/
enum trtl_smem_modifier {
TRTL_SMEM_DIRECT = 0, /**< direct read/write of the memory */
TRTL_SMEM_ADD, /**< on write, atomic ADD to memory content */
TRTL_SMEM_SUB, /**< on write, atomic SUB to memory content */
TRTL_SMEM_OR, /**< on write, atomic OR with memory content */
TRTL_SMEM_CLR_AND, /**< on write, atomic AND with complemented memory
content */
TRTL_SMEM_XOR, /**< on write, atomic XOR with memory content */
TRTL_SMEM_TYPE_BASE = 0, /**< no operation */
TRTL_SMEM_TYPE_ADD, /**< atomic addition */
TRTL_SMEM_TYPE_SUB, /**< atomic subtraction */
TRTL_SMEM_TYPE_SET, /**< atomic bit set */
TRTL_SMEM_TYPE_CLR, /**< atomic bit clear */
TRTL_SMEM_TYPE_FLP, /**< atomic bit flip */
TRTL_SMEM_TYPE_TST_SET, /**< atomic test and set */
};
......
......@@ -197,7 +197,7 @@ static ssize_t trtl_store_smem_op(struct device *dev,
if (kstrtol(buf, 0, &val))
return -EINVAL;
if (val < TRTL_SMEM_DIRECT || val > TRTL_SMEM_ADD) {
if (val < TRTL_SMEM_TYPE_BASE || val > TRTL_SMEM_TYPE_ADD) {
dev_err(&trtl->dev, "Unsupported operation %ld\n", val);
return -EINVAL;
}
......
......@@ -13,18 +13,6 @@
#ifndef __TRTL_RT_SMEM_H
#define __TRTL_RT_SMEM_H
/**
* List of supported Shared Memory access type
*/
enum trtl_smem_type {
TRTL_SMEM_TYPE_BASE = 0, /**< no operation */
TRTL_SMEM_TYPE_ADD, /**< atomic addition */
TRTL_SMEM_TYPE_SUB, /**< atomic subtraction */
TRTL_SMEM_TYPE_SET, /**< atomic bit set */
TRTL_SMEM_TYPE_CLR, /**< atomic bit clear */
TRTL_SMEM_TYPE_FLP, /**< atomic bit flip */
TRTL_SMEM_TYPE_TST_SET, /**< atomic test and set */
};
/**
* Shared Memory Size
......
......@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
break;
case 'm':
sscanf(optarg, "%d", &mod);
if (mod > TRTL_SMEM_ADD) {
if (mod > TRTL_SMEM_TYPE_ADD) {
fprintf(stderr, "Invalid operation mode\n");
help();
exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment