diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-01-10 18:32:45 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-01-25 18:23:48 +0000 |
commit | 16e43a3d0d902f6c2771a2362f7e7dd40b3ddeee (patch) | |
tree | fb870f709bb43a9ddb8bf2f2865a81ff3c8f1432 /include/task_id.h | |
parent | d356dea61ee170366acddc373953dad20f6fc48e (diff) | |
download | chrome-ec-16e43a3d0d902f6c2771a2362f7e7dd40b3ddeee.tar.gz |
Initial mutex implementation
They are designed to protect shared hardware resources (e.g. I2C
controller).
Please refrain using them as a general purpose synchronization primitive
for the tasks to avoid unintended slippery effects (e.g. priority inversion),
use the provided message-passing functions instead for that purpose.
The mutex variable (ie the "struct mutex") should be initially filled
with 0, but this is the default compiler behavior if you declare it as a
global variable.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=make qemu-tests
Change-Id: I328f7eadf5257560944dbbbeda0b99d5b24520e8
Diffstat (limited to 'include/task_id.h')
-rw-r--r-- | include/task_id.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/task_id.h b/include/task_id.h index 8b6e14721f..a2fb17ca7a 100644 --- a/include/task_id.h +++ b/include/task_id.h @@ -32,6 +32,7 @@ enum { /* Number of tasks */ TASK_ID_COUNT, /* Special task identifiers */ + TASK_ID_MUTEX = 0x1e, /* signal mutex unlocking */ TASK_ID_TIMER = 0x1f, /* message from an expired timer */ TASK_ID_CURRENT = 0xfe, /* the currently running task */ TASK_ID_INVALID = 0xff /* unable to find the task */ |