/* * Copyright 2002-2019 Intel Corporation. * * This software is provided to you as Sample Source Code as defined in the accompanying * End User License Agreement for the Intel(R) Software Development Products ("Agreement") * section 1.L. * * This software and the related documents are provided as is, with no express or implied * warranties, other than those that are expressly stated in the License. */ #include #include #include #include #include #include extern "C" int Do32BitOverride (int *dst, int *src); #define MEMSIZE 1024 int src[MEMSIZE]; main (int argc, char *argv[]) { int *ptrTo32BitMem = (int *)mmap(NULL, MEMSIZE, PROT_READ | PROT_WRITE, MAP_32BIT | MAP_PRIVATE | MAP_ANON, -1, 0); printf ("memory allocated at %p\n", ptrTo32BitMem); fflush (stdout); if ((long long)(ptrTo32BitMem) & 0xffffffff00000000L) { printf ("***Error did not get 32bit memory\n"); exit (1); } memset (ptrTo32BitMem, 0, MEMSIZE); for (int i=0; i