diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2016-03-08 20:27:24 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2016-03-08 20:27:24 +0900 |
commit | 25e5f218474fdf0d304ff62ed3716e0b4abcc3d2 (patch) | |
tree | a7d169267d7770fa4df4ce5ce42381ccb8666163 | |
parent | 90ac7f7c137fbddbf0725be68d9ee8776f777aa9 (diff) |
AAPCS stack alignment
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | chopstx.c | 7 | ||||
-rw-r--r-- | chopstx.h | 4 |
3 files changed, 16 insertions, 5 deletions
@@ -1,3 +1,13 @@ +2016-03-08 Niibe Yutaka <gniibe@fsij.org> + + * chopstx.h (CHOPSTX_THREAD_SIZE): Align by 8. + * chopstx.c (struct chx_thread): Add W field to align. This is to + comply AAPCS (ARM Architecture Procedure Call Standard). + (chx_init): Initialize W. + + * example-cdc/{usb_stm32f103.c,usb_lld.h}: Update from Gnuk. + * example-cdc/usb-cdc.c: Update. + 2015-11-05 Niibe Yutaka <gniibe@fsij.org> * example-cdc/sample.c: Enhanced to be echo service. @@ -1,7 +1,8 @@ /* * chopstx.c - Threads and only threads. * - * Copyright (C) 2013, 2014, 2015 Flying Stone Technology + * Copyright (C) 2013, 2014, 2015, 2016 + * Flying Stone Technology * Author: NIIBE Yutaka <gniibe@fsij.org> * * This file is a part of Chopstx, a thread library for embedded. @@ -291,7 +292,7 @@ struct chx_thread { uint32_t : 7; uint32_t prio_orig : 8; uint32_t prio : 8; - uint32_t v; + uint32_t v, w; struct chx_mtx *mutex_list; struct chx_cleanup *clp; }; @@ -639,7 +640,7 @@ chx_init (struct chx_thread *tp) tp->flag_detached = (CHX_FLAGS_MAIN & CHOPSTX_DETACHED)? 1 : 0; tp->prio_orig = CHX_PRIO_MAIN_INIT; tp->prio = 0; - tp->v = 0; + tp->v = tp->w = 0; running = tp; if (CHX_PRIO_MAIN_INIT >= CHOPSTX_PRIO_INHIBIT_PREEMPTION) @@ -1,7 +1,7 @@ /* * chopstx.h - Threads and only threads. * - * Copyright (C) 2013 Flying Stone Technology + * Copyright (C) 2013, 2016 Flying Stone Technology * Author: NIIBE Yutaka <gniibe@fsij.org> * * This file is a part of Chopstx, a thread library for embedded. @@ -135,4 +135,4 @@ void chopstx_cleanup_pop (int execute); void chopstx_wakeup_usec_wait (chopstx_t thd); -#define CHOPSTX_THREAD_SIZE 60 +#define CHOPSTX_THREAD_SIZE 64 |