From 47fe66a461db349a884c4eed64a07377bbdb2a91 Mon Sep 17 00:00:00 2001 From: Sourab Gupta Date: Wed, 11 Oct 2017 13:46:28 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1540306 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/common/mm/buddy_allocator.c | 17 +++++++++++------ drivers/gpu/nvgpu/common/mm/page_allocator.c | 3 +++ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/common/mm') diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c index 75c4f427..c6f10a69 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c @@ -27,7 +27,6 @@ #include #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; } diff --git a/drivers/gpu/nvgpu/common/mm/page_allocator.c b/drivers/gpu/nvgpu/common/mm/page_allocator.c index 2b5a595d..d5ce5d8e 100644 --- a/drivers/gpu/nvgpu/common/mm/page_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/page_allocator.c @@ -38,6 +38,9 @@ */ #ifdef PAGE_SIZE #undef PAGE_SIZE +#endif + +#ifdef PAGE_ALIGN #undef PAGE_ALIGN #endif -- cgit v1.2.2