From 4204309872da5cb401cbb2729d9e2d4869a87f42 Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Thu, 22 Oct 2020 14:58:56 +0900 Subject: agl-basesystem 0.1 --- ...eplace-PAGE_SIZE-with-local-variable-name.patch | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 bsp/meta-ti/recipes-devtools/ion/ion-tests/0001-map_test-Replace-PAGE_SIZE-with-local-variable-name.patch (limited to 'bsp/meta-ti/recipes-devtools/ion/ion-tests/0001-map_test-Replace-PAGE_SIZE-with-local-variable-name.patch') diff --git a/bsp/meta-ti/recipes-devtools/ion/ion-tests/0001-map_test-Replace-PAGE_SIZE-with-local-variable-name.patch b/bsp/meta-ti/recipes-devtools/ion/ion-tests/0001-map_test-Replace-PAGE_SIZE-with-local-variable-name.patch new file mode 100644 index 00000000..8915c642 --- /dev/null +++ b/bsp/meta-ti/recipes-devtools/ion/ion-tests/0001-map_test-Replace-PAGE_SIZE-with-local-variable-name.patch @@ -0,0 +1,69 @@ +From f045cbf9aae0053e9e785e32b772e473aa892443 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 6 Oct 2019 16:08:36 -0700 +Subject: [PATCH] map_test: Replace PAGE_SIZE with local variable name + +PAGE_SIZE is already a define in libc implementations global namespace +e.g. in musl. Therefore its best to use a unique variable name to not +stamp on the global definition. + +Fixes +src/map_test.cpp:59:23: error: expected unqualified-id +unsigned long PAGE_SIZE = sysconf(_SC_PAGESIZE); +^ +/usr/include/limits.h:89:19: note: expanded from macro 'PAGE_SIZE' +^ +/usr/include/bits/limits.h:3:18: note: expanded from macro 'PAGESIZE' +^ + +Upstream-Status: Submitted [https://github.com/glneo/ion-tests/pull/1] + +Signed-off-by: Khem Raj +--- + src/map_test.cpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/map_test.cpp b/src/map_test.cpp +index a7ce2c9..7b5746d 100644 +--- a/src/map_test.cpp ++++ b/src/map_test.cpp +@@ -56,27 +56,27 @@ TEST_F(Map, MapOffset) + SCOPED_TRACE(::testing::Message() << "heap " << heapMask); + int map_fd = -1; + +- unsigned long PAGE_SIZE = sysconf(_SC_PAGESIZE); ++ unsigned long psize = sysconf(_SC_PAGESIZE); + +- ASSERT_EQ(0, ion_alloc(m_ionFd, PAGE_SIZE * 2, heapMask, 0, &map_fd)); ++ ASSERT_EQ(0, ion_alloc(m_ionFd, psize * 2, heapMask, 0, &map_fd)); + ASSERT_GE(map_fd, 0); + + unsigned char *ptr; +- ptr = (unsigned char *)mmap(NULL, PAGE_SIZE * 2, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); ++ ptr = (unsigned char *)mmap(NULL, psize * 2, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); + ASSERT_TRUE(ptr != NULL); + +- memset(ptr, 0, PAGE_SIZE); +- memset(ptr + PAGE_SIZE, 0xaa, PAGE_SIZE); ++ memset(ptr, 0, psize); ++ memset(ptr + psize, 0xaa, psize); + +- ASSERT_EQ(0, munmap(ptr, PAGE_SIZE * 2)); ++ ASSERT_EQ(0, munmap(ptr, psize * 2)); + +- ptr = (unsigned char *)mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, PAGE_SIZE); ++ ptr = (unsigned char *)mmap(NULL, psize, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, psize); + ASSERT_TRUE(ptr != NULL); + + ASSERT_EQ(ptr[0], 0xaa); +- ASSERT_EQ(ptr[PAGE_SIZE - 1], 0xaa); ++ ASSERT_EQ(ptr[psize - 1], 0xaa); + +- ASSERT_EQ(0, munmap(ptr, PAGE_SIZE)); ++ ASSERT_EQ(0, munmap(ptr, psize)); + + ASSERT_EQ(0, close(map_fd)); + } +-- +2.23.0 + -- cgit 1.2.3-korg