#include "c11/threads.h"
#include "eglglobals.h"
+#include "egldevice.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "egllog.h"
+#include "util/macros.h"
+
#ifdef HAVE_MINCORE
#include <unistd.h>
#include <sys/mman.h>
{
.Mutex = &_eglGlobalMutex,
.DisplayList = NULL,
- .NumAtExitCalls = 2,
+ .DeviceList = &_eglSoftwareDevice,
+ .NumAtExitCalls = 3,
.AtExitCalls = {
/* default AtExitCalls, called in reverse order */
- _eglUnloadDrivers, /* always called last */
- _eglFiniDisplay
+ _eglFiniDevice, /* always called last */
+ _eglUnloadDrivers,
+ _eglFiniDisplay,
},
.ClientOnlyExtensionString =
"EGL_EXT_client_extensions"
+ " EGL_EXT_device_base"
+ " EGL_EXT_device_enumeration"
+ " EGL_EXT_device_query"
" EGL_EXT_platform_base"
" EGL_KHR_client_get_all_proc_addresses"
" EGL_KHR_debug",
#ifdef HAVE_SURFACELESS_PLATFORM
" EGL_MESA_platform_surfaceless"
#endif
+ " EGL_EXT_platform_device"
"",
.ClientExtensionString = NULL,
EGLBoolean
_eglPointerIsDereferencable(void *p)
{
-#ifdef HAVE_MINCORE
uintptr_t addr = (uintptr_t) p;
- unsigned char valid = 0;
const long page_size = getpagesize();
+#ifdef HAVE_MINCORE
+ unsigned char valid = 0;
if (p == NULL)
return EGL_FALSE;
*/
return EGL_TRUE;
#else
- return p != NULL;
+ // Without mincore(), we just assume that the first page is unmapped.
+ return addr >= page_size;
#endif
}