diff options
author | Volodymyr Babchuk <vlad.babchuk@gmail.com> | 2017-02-15 19:54:33 +0200 |
---|---|---|
committer | Volodymyr Babchuk <vlad.babchuk@gmail.com> | 2017-04-11 18:17:35 +0300 |
commit | 40ea51dee3aa8ae6f07ff8bf1299bfe7799a4db5 (patch) | |
tree | 290b07114c1fb9ee36aef8a14c8acc6568637d2c /lib/libutils/isoc/bget_malloc.c | |
parent | 702609a7a5ff8c05ab54bc967d762f1acf18fd9d (diff) |
spinlock: add cpu_spin_lock_xsave()/xrestore() functions
These are functions like spin_lock_irqsave() functions in linux kernel.
They should replace xxx_lock() functions in different modules.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'lib/libutils/isoc/bget_malloc.c')
-rw-r--r-- | lib/libutils/isoc/bget_malloc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libutils/isoc/bget_malloc.c b/lib/libutils/isoc/bget_malloc.c index a4f77595..552fdaf5 100644 --- a/lib/libutils/isoc/bget_malloc.c +++ b/lib/libutils/isoc/bget_malloc.c @@ -115,18 +115,12 @@ static uint32_t malloc_lock(void) { - uint32_t exceptions; - - exceptions = thread_mask_exceptions( - THREAD_EXCP_NATIVE_INTR | THREAD_EXCP_FOREIGN_INTR); - cpu_spin_lock(&__malloc_spinlock); - return exceptions; + return cpu_spin_lock_xsave(&__malloc_spinlock); } static void malloc_unlock(uint32_t exceptions) { - cpu_spin_unlock(&__malloc_spinlock); - thread_unmask_exceptions(exceptions); + cpu_spin_unlock_xrestore(&__malloc_spinlock, exceptions); } static void tag_asan_free(void *buf, size_t len) |