diff options
author | Richard Braun <rbraun@sceen.net> | 2014-11-17 22:07:16 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-11-17 22:07:16 +0100 |
commit | 590a42d12b908d41fb587dfcf09489e59bd1ff1a (patch) | |
tree | 5c017d381e59d4c9ea112becedae4b0cb69452e0 /test | |
parent | 39b2de403498163ae5e1d8f545030ec5c2af895c (diff) |
test: update calls
Adjust calls to functions that were recently changed.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_llsync_defer.c | 14 | ||||
-rw-r--r-- | test/test_pmap_update_mp.c | 16 | ||||
-rw-r--r-- | test/test_sref_noref.c | 8 | ||||
-rw-r--r-- | test/test_x86_pmap_remove_ptp.c | 4 |
4 files changed, 20 insertions, 22 deletions
diff --git a/test/test_llsync_defer.c b/test/test_llsync_defer.c index 5a52bd4d..ebb1caf0 100644 --- a/test/test_llsync_defer.c +++ b/test/test_llsync_defer.c @@ -46,7 +46,7 @@ struct test_pdsc { struct work work; - unsigned long va; + void *addr; }; #define TEST_VALIDATION_BYTE 0xab @@ -76,10 +76,10 @@ test_alloc(void *arg) pdsc = kmem_cache_alloc(&test_pdsc_cache); if (pdsc != NULL) { - pdsc->va = vm_kmem_alloc(PAGE_SIZE); + pdsc->addr = vm_kmem_alloc(PAGE_SIZE); - if (pdsc->va != 0) - memset((void *)pdsc->va, TEST_VALIDATION_BYTE, PAGE_SIZE); + if (pdsc->addr != NULL) + memset(pdsc->addr, TEST_VALIDATION_BYTE, PAGE_SIZE); } llsync_assign_ptr(test_pdsc, pdsc); @@ -99,8 +99,8 @@ test_deferred_free(struct work *work) pdsc = structof(work, struct test_pdsc, work); - if (pdsc->va != 0) - vm_kmem_free(pdsc->va, PAGE_SIZE); + if (pdsc->addr != NULL) + vm_kmem_free(pdsc->addr, PAGE_SIZE); kmem_cache_free(&test_pdsc_cache, pdsc); } @@ -155,7 +155,7 @@ test_read(void *arg) pdsc = llsync_read_ptr(test_pdsc); if (pdsc != NULL) { - s = (const unsigned char *)pdsc->va; + s = (const unsigned char *)pdsc->addr; if (s != NULL) { for (j = 0; j < PAGE_SIZE; j++) diff --git a/test/test_pmap_update_mp.c b/test/test_pmap_update_mp.c index 975e55f5..3f7f505b 100644 --- a/test/test_pmap_update_mp.c +++ b/test/test_pmap_update_mp.c @@ -39,7 +39,7 @@ static struct condition test_condition; static struct mutex test_lock; -static unsigned long test_va; +static void *test_va; static void test_run1(void *arg) @@ -49,14 +49,14 @@ test_run1(void *arg) (void)arg; printk("allocating page\n"); - ptr = (void *)vm_kmem_alloc(PAGE_SIZE); + ptr = vm_kmem_alloc(PAGE_SIZE); printk("writing page\n"); memset(ptr, 'a', PAGE_SIZE); printk("passing page to second thread (%p)\n", ptr); mutex_lock(&test_lock); - test_va = (unsigned long)ptr; + test_va = ptr; condition_signal(&test_condition); mutex_unlock(&test_lock); } @@ -64,7 +64,7 @@ test_run1(void *arg) static void test_run2(void *arg) { - const char *ptr; + char *ptr; unsigned int i; (void)arg; @@ -73,10 +73,10 @@ test_run2(void *arg) mutex_lock(&test_lock); - while (test_va == 0) + while (test_va == NULL) condition_wait(&test_condition, &test_lock); - ptr = (const char *)test_va; + ptr = test_va; mutex_unlock(&test_lock); @@ -86,7 +86,7 @@ test_run2(void *arg) if (ptr[i] != 'a') panic("invalid content"); - vm_kmem_free((unsigned long)ptr, PAGE_SIZE); + vm_kmem_free(ptr, PAGE_SIZE); printk("done\n"); } @@ -100,7 +100,7 @@ test_setup(void) condition_init(&test_condition); mutex_init(&test_lock); - test_va = 0; + test_va = NULL; error = cpumap_create(&cpumap); error_check(error, "cpumap_create"); diff --git a/test/test_sref_noref.c b/test/test_sref_noref.c index 208eab25..394f4793 100644 --- a/test/test_sref_noref.c +++ b/test/test_sref_noref.c @@ -98,7 +98,7 @@ test_obj_noref(struct sref_counter *counter) struct test_obj *obj; obj = structof(counter, struct test_obj, ref_counter); - vm_kmem_free((unsigned long)obj, sizeof(*obj)); + vm_kmem_free(obj, sizeof(*obj)); printk("0 references, page released\n"); evcnt_info("sref_epoch"); evcnt_info("sref_dirty_zero"); @@ -113,7 +113,6 @@ test_run(void *arg) struct thread **threads; struct test_obj *obj; volatile unsigned long loop; - unsigned long va; unsigned int i, nr_threads; int error; @@ -133,12 +132,11 @@ test_run(void *arg) } printk("allocating page\n"); - va = vm_kmem_alloc(sizeof(*obj)); + obj = vm_kmem_alloc(sizeof(*obj)); - if (va == 0) + if (obj == NULL) panic("vm_kmem_alloc: %s", error_str(ERROR_NOMEM)); - obj = (void *)va; sref_counter_init(&obj->ref_counter, test_obj_noref); printk("page allocated, 1 reference, publishing\n"); diff --git a/test/test_x86_pmap_remove_ptp.c b/test/test_x86_pmap_remove_ptp.c index 1ddb26b6..88acc969 100644 --- a/test/test_x86_pmap_remove_ptp.c +++ b/test/test_x86_pmap_remove_ptp.c @@ -67,8 +67,8 @@ test_run(void *arg) va = 0; flags = VM_MAP_FLAGS(VM_PROT_ALL, VM_PROT_ALL, VM_INHERIT_NONE, VM_ADV_DEFAULT, 0); - error = vm_map_enter(kernel_map, NULL, 0, &va, - (1UL << 22), (1UL << 22), flags); + error = vm_map_enter(kernel_map, &va, (1UL << 22), (1UL << 22), flags, + NULL, 0); error_check(error, "vm_map_enter"); pmap_enter(kernel_pmap, va, vm_page_to_pa(page), VM_PROT_READ | VM_PROT_WRITE, PMAP_PEF_GLOBAL); |