diff --git a/drivers/gpu/nvgpu/libnvgpu-drv_safe.export b/drivers/gpu/nvgpu/libnvgpu-drv_safe.export index 9c7fb7833..00c3a5936 100644 --- a/drivers/gpu/nvgpu/libnvgpu-drv_safe.export +++ b/drivers/gpu/nvgpu/libnvgpu-drv_safe.export @@ -1,6 +1,7 @@ # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. bitmap_find_next_zero_area_off +bitmap_find_next_zero_area fb_gv11b_write_mmu_fault_buffer_get find_first_bit find_first_zero_bit diff --git a/userspace/SWUTS.h b/userspace/SWUTS.h index 78017b366..13e3980b3 100644 --- a/userspace/SWUTS.h +++ b/userspace/SWUTS.h @@ -111,6 +111,8 @@ * - @ref SWUTS-posix-timers * - @ref SWUTS-posix-queue * - @ref SWUTS-posix-bug + * - @ref SWUTS-posix-ossched + * - @ref SWUTS-posix-rwsem * - @ref SWUTS-priv_ring * - @ref SWUTS-ptimer * - @ref SWUTS-sdl diff --git a/userspace/SWUTS.sources b/userspace/SWUTS.sources index a91ca5c95..fd177cfa3 100644 --- a/userspace/SWUTS.sources +++ b/userspace/SWUTS.sources @@ -91,6 +91,8 @@ INPUT += ../../../userspace/units/posix/fault-injection/posix-fault-injection-dm INPUT += ../../../userspace/units/posix/sizes/posix-sizes.h INPUT += ../../../userspace/units/posix/thread/posix-thread.h INPUT += ../../../userspace/units/posix/timers/posix-timers.h +INPUT += ../../../userspace/units/posix/os_sched/posix-ossched.h +INPUT += ../../../userspace/units/posix/rwsem/posix-rwsem.h INPUT += ../../../userspace/units/priv_ring/nvgpu-priv_ring.h INPUT += ../../../userspace/units/ptimer/nvgpu-ptimer.h INPUT += ../../../userspace/units/therm/nvgpu-therm.h diff --git a/userspace/units/posix/bitops/posix-bitops.c b/userspace/units/posix/bitops/posix-bitops.c index d88e5a0ff..1bbb5404d 100644 --- a/userspace/units/posix/bitops/posix-bitops.c +++ b/userspace/units/posix/bitops/posix-bitops.c @@ -324,6 +324,29 @@ int test_find_zero_area(struct unit_module *m, struct gk20a *g, void *unused) unsigned long i, j, result; unsigned long words[NUM_WORDS]; + for (i = 0; i < TEST_BITMAP_SIZE; i++) { + result = bitmap_find_next_zero_area(bmap_all_zeros, + TEST_BITMAP_SIZE, i, + TEST_BITMAP_SIZE - i, 0); + if (result != i) + unit_return_fail(m, FAIL_MSG, + "bmap_zeros: alloc-to-end", i); + + result = bitmap_find_next_zero_area(bmap_all_zeros, + TEST_BITMAP_SIZE, + i, 1, 0); + if (result != i) + unit_return_fail(m, FAIL_MSG, + "bmap_zeros: alloc-one-bit", i); + + result = bitmap_find_next_zero_area(bmap_all_zeros, + TEST_BITMAP_SIZE, 0, + TEST_BITMAP_SIZE - i, 0); + if (result != 0) + unit_return_fail(m, FAIL_MSG, + "bmap_zeros: alloc-i-bits-at-0", i); + } + for (i = 0; i < TEST_BITMAP_SIZE; i++) { result = bitmap_find_next_zero_area_off(bmap_all_zeros, TEST_BITMAP_SIZE, diff --git a/userspace/units/posix/bitops/posix-bitops.h b/userspace/units/posix/bitops/posix-bitops.h index 8aab8fa58..31c734f80 100644 --- a/userspace/units/posix/bitops/posix-bitops.h +++ b/userspace/units/posix/bitops/posix-bitops.h @@ -58,7 +58,7 @@ int test_bitmap_info(struct unit_module *m, struct gk20a *g, void *args); * * Test Type: Feature, Boundary values * - * Targets: nvgpu_ffs + * Targets: nvgpu_ffs, nvgpu_posix_ffs * * Input: None * @@ -83,7 +83,7 @@ int test_ffs(struct unit_module *m, struct gk20a *g, void *args); * * Test Type: Feature, Boundary values * - * Targets: nvgpu_fls + * Targets: nvgpu_fls, nvgpu_posix_fls * * Input: None * @@ -189,12 +189,34 @@ int test_find_next_bit(struct unit_module *m, struct gk20a *g, void *__args); * * Test Type: Feature, Boundary values * - * Targets: bitmap_find_next_zero_area_off + * Targets: bitmap_find_next_zero_area, bitmap_find_next_zero_area_off * * Input: None. * * Steps: * - Loop through array of all zeros: + * - Call bitmap_find_next_zero_area() with: + * - array of zeros + * - size of array (in bits) + * - start value of loop index + * - size of bitmap as size of array - 1 (bit) + * - 0 for alignment parameters + * - Verify returns loop index. + * - Call bitmap_find_next_zero_area() with: + * - array of zeros + * - size of array (in bits) + * - start value of loop index + * - size of bitmap as 1 (bit) + * - 0 for alignment parameters + * - Verify returns loop index. + * - Call bitmap_find_next_zero_area() with: + * - array of zeros + * - size of array (in bits) + * - start value of 0 + * - size of bitmap as size of array - loop index + * - 0 for alignment parameters + * - Verify returns 0. + * - Loop through array of all zeros: * - Call bitmap_find_next_zero_area_off() with: * - array of zeros * - size of array (in bits)