Skip to content
Snippets Groups Projects
Commit 76582956 authored by Mattijs Korpershoek's avatar Mattijs Korpershoek Committed by Vishal Mahaveer
Browse files

TI: plugin_store: Remove use of hardcoded PAGE_SIZE 4096

bionic hard-codes the PAGE_SIZE macro as 4096. This is going away as
Android begins to support larger page sizes [1]

Remove the usage of this hard-coded value by using getpagesize() instead
as recommended by the doc [2].

[1] https://source.android.com/docs/core/architecture/16kb-page-size/16kb
[2] https://source.android.com/docs/core/architecture/16kb-page-size/getting-page-size


Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
parent 15339a08
No related branches found
No related tags found
No related merge requests found
......@@ -171,6 +171,7 @@ class C2CarveoutDmaBufAllocation : public C2LinearAllocation {
c2_status_t C2CarveoutDmaBufAllocation::map(size_t offset, size_t size, C2MemoryUsage usage, C2Fence* fence,
void** addr) {
static const size_t kPageSize = getpagesize();
(void)fence; // TODO: wait for fence
*addr = nullptr;
if (!mMappings.lock()->empty()) {
......@@ -193,7 +194,7 @@ c2_status_t C2CarveoutDmaBufAllocation::map(size_t offset, size_t size, C2Memory
prot |= PROT_WRITE;
}
size_t alignmentBytes = offset % PAGE_SIZE;
size_t alignmentBytes = offset % kPageSize;
size_t mapOffset = offset - alignmentBytes;
size_t mapSize = size + alignmentBytes;
Mapping map = {nullptr, alignmentBytes, mapSize};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment