gpu: nvgpu: compile nvgpu allocator for QNX

The patch has the changes for compilation of
common nvgpu allocator for QNX.
This includes some cross-OS compilation changes
and removing some Linux'isms from the allocator.

Change-Id: Ib1ecceec77b497513a196597bff4441615577548
Signed-off-by: Sourab Gupta <sourabg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1540306
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
This commit is contained in:
Sourab Gupta
2017-10-11 13:46:28 +05:30
committed by mobile promotions
parent 2269a8675c
commit 47fe66a461
3 changed files with 15 additions and 6 deletions

View File

@@ -27,7 +27,6 @@
#include <nvgpu/barrier.h>
#include "gk20a/mm_gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "buddy_allocator_priv.h"
@@ -304,17 +303,20 @@ static void nvgpu_buddy_allocator_destroy(struct nvgpu_allocator *__a)
}
if (a->buddy_list_len[i] != 0) {
pr_info("Excess buddies!!! (%d: %llu)\n",
nvgpu_info(__a->g,
"Excess buddies!!! (%d: %llu)\n",
i, a->buddy_list_len[i]);
BUG();
}
if (a->buddy_list_split[i] != 0) {
pr_info("Excess split nodes!!! (%d: %llu)\n",
nvgpu_info(__a->g,
"Excess split nodes!!! (%d: %llu)\n",
i, a->buddy_list_split[i]);
BUG();
}
if (a->buddy_list_alloced[i] != 0) {
pr_info("Excess alloced nodes!!! (%d: %llu)\n",
nvgpu_info(__a->g,
"Excess alloced nodes!!! (%d: %llu)\n",
i, a->buddy_list_alloced[i]);
BUG();
}
@@ -882,7 +884,8 @@ static u64 __nvgpu_balloc_fixed_buddy(struct nvgpu_allocator *__a,
balloc_alloc_fixed(a, falloc);
list_for_each_entry(bud, &falloc->buddies, buddy_entry)
nvgpu_list_for_each_entry(bud, &falloc->buddies,
nvgpu_buddy, buddy_entry)
real_bytes += (bud->end - bud->start);
a->bytes_alloced += len;
@@ -1014,7 +1017,9 @@ static int nvgpu_buddy_reserve_co(struct nvgpu_allocator *__a,
addr = __nvgpu_balloc_fixed_buddy(__a, co->base, co->length, 0);
if (!addr) {
err = -ENOMEM;
pr_warn("%s: Failed to reserve a valid carveout!\n", __func__);
nvgpu_warn(__a->g,
"%s: Failed to reserve a valid carveout!\n",
__func__);
goto done;
}

View File

@@ -38,6 +38,9 @@
*/
#ifdef PAGE_SIZE
#undef PAGE_SIZE
#endif
#ifdef PAGE_ALIGN
#undef PAGE_ALIGN
#endif

View File

@@ -35,6 +35,7 @@
#include <nvgpu/log.h>
#include <nvgpu/lock.h>
#include <nvgpu/list.h>
#include <nvgpu/types.h>
/* #define ALLOCATOR_DEBUG */