summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2013-06-19 10:05:32 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2013-06-19 10:05:32 +0900
commit058ba0f939f18d890e11828f6a2535559e72bdb7 (patch)
tree3d0dab69d099b39eecd0aae0de29917511334b43
parentb65635756347245c8ea52e9ba2b6f1576834140b (diff)
add chopstx_main
-rw-r--r--ChangeLog3
-rw-r--r--chopstx.c4
-rw-r--r--chopstx.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 199f5a9..c1ba95c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2013-06-19 Niibe Yutaka <gniibe@fsij.org>
+ * chopstx.c (chopstx_main): New.
+ (chx_init): Initialize chopstx_main.
+
* example-cdc/sample.c (usb_intr): No disable/enable interrupt,
but call the handler.
diff --git a/chopstx.c b/chopstx.c
index be4292a..faa727e 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -712,6 +712,8 @@ static uint32_t *const AIRCR = (uint32_t *const)0xE000ED0C;
static uint32_t *const SHPR2 = (uint32_t *const)0xE000ED1C;
static uint32_t *const SHPR3 = (uint32_t *const)0xE000ED20;
+chopstx_t chopstx_main;
+
void
chx_init (struct chx_thread *tp)
{
@@ -741,6 +743,8 @@ chx_init (struct chx_thread *tp)
chx_cpu_sched_lock ();
tp->prio = CHX_PRIO_MAIN;
+
+ chopstx_main = (chopstx_t)tp;
}
diff --git a/chopstx.h b/chopstx.h
index 838616b..da65928 100644
--- a/chopstx.h
+++ b/chopstx.h
@@ -29,6 +29,8 @@
typedef uint32_t chopstx_t;
typedef uint8_t chopstx_prio_t;
+extern chopstx_t chopstx_main;
+
/* NOTE: This signature is different to PTHREAD's one. */
chopstx_t
chopstx_create (uint32_t flags_and_prio,