diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2015-05-12 18:12:20 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-21 14:37:03 +1000 |
commit | afde0c6f965344898d448b08e65e434f4962e55f (patch) | |
tree | a73b43ec85faa2175247caab4c23f89e3487de60 /core/test/run-malloc.c | |
parent | 5f4c0b3b86de905e7eac4acdb976254df145f1c1 (diff) | |
download | skiboot-afde0c6f965344898d448b08e65e434f4962e55f.zip skiboot-afde0c6f965344898d448b08e65e434f4962e55f.tar.gz skiboot-afde0c6f965344898d448b08e65e434f4962e55f.tar.bz2 |
core: Add asserts for region free-list locking
This change adds asserts to the mem_region calls that should have the
per-region lock held.
To keep the tests working, they need the lock_held_by_me() function. The
run-mem_region.c test has a bogus implementation of this, as it doesn't
do any locking at the moment. This will be addressed in a later change.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/test/run-malloc.c')
-rw-r--r-- | core/test/run-malloc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/test/run-malloc.c b/core/test/run-malloc.c index 723cb10..4623108 100644 --- a/core/test/run-malloc.c +++ b/core/test/run-malloc.c @@ -69,6 +69,11 @@ void unlock(struct lock *l) l->lock_val = 0; } +bool lock_held_by_me(struct lock *l) +{ + return l->lock_val; +} + static bool heap_empty(void) { const struct alloc_hdr *h = region_start(&skiboot_heap); |