summaryrefslogtreecommitdiff
path: root/common/host_command.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-04-05 15:34:01 -0700
committerRandall Spangler <rspangler@chromium.org>2012-04-06 09:06:53 -0700
commita61d8db3d3d7cb145abb3a3580c9a9cfe2d044d7 (patch)
tree6ff786efde031e483645c0900388ca53d51b5255 /common/host_command.c
parent0eb94470511959c09e5cb0f55eda0478dd5c7b04 (diff)
downloadchrome-ec-a61d8db3d3d7cb145abb3a3580c9a9cfe2d044d7.tar.gz
Change task messages to events
Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7461 TEST=manual make BOARD={bds,link,daisy} make tests flash link system and make sure it boots Change-Id: I1241a1895c083e387e38ddab01ac346ca4474eb9
Diffstat (limited to 'common/host_command.c')
-rw-r--r--common/host_command.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/host_command.c b/common/host_command.c
index 671fd93047..cf66b6e057 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -15,6 +15,8 @@
#include "uart.h"
#include "util.h"
+#define TASK_EVENT_SLOT(n) TASK_EVENT_CUSTOM(1 << n)
+
static int host_command[2];
/* Host commands are described in a special section */
@@ -41,9 +43,8 @@ void host_command_received(int slot, int command)
/* Save the command */
host_command[slot] = command;
- /* Wake up the task to handle the command. Use the slot as
- * the task ID. */
- task_send_msg(TASK_ID_HOSTCMD, slot, 0);
+ /* Wake up the task to handle the command for the slot */
+ task_set_event(TASK_ID_HOSTCMD, TASK_EVENT_SLOT(slot), 0);
}
@@ -161,13 +162,12 @@ void host_command_task(void)
host_command_init();
while (1) {
- /* wait for the next command message */
- int m = task_wait_msg(-1);
+ /* wait for the next command event */
+ int evt = task_wait_event(-1);
/* process it */
- /* TODO: use message flags to determine which slots */
- if (m & 0x01)
+ if (evt & TASK_EVENT_SLOT(0))
command_process(0);
- if (m & 0x02)
+ if (evt & TASK_EVENT_SLOT(1))
command_process(1);
}
}