Minix Support

This commit is contained in:
2016-01-21 22:56:26 +01:00
committed by sambuc
parent 632fcf01c7
commit 0aba5426c4
66 changed files with 1319 additions and 43 deletions
+8 -1
View File
@@ -43,12 +43,17 @@ Configuration macro:
Use pthread_mutex_timedlock() for `mtx_timedlock()'
Otherwise use mtx_trylock() + *busy loop* emulation.
*/
#if !defined(__CYGWIN__) && !defined(__APPLE__) && !defined(__NetBSD__)
#if !defined(__CYGWIN__) && !defined(__APPLE__) && !defined(__NetBSD__) && !defined(__minix)
#define EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
#endif
#if defined(__minix)
#define _MTHREADIFY_PTHREADS 1
#include <minix/mthread.h>
#else
#include <pthread.h>
#endif /* defined(__minix) */
/*---------------------------- macros ----------------------------*/
#define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
@@ -133,6 +138,7 @@ cnd_signal(cnd_t *cond)
return thrd_success;
}
#if !defined(__minix)
// 7.25.3.5
static inline int
cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
@@ -145,6 +151,7 @@ cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
return thrd_busy;
return (rt == 0) ? thrd_success : thrd_error;
}
#endif /* !defined(__minix) */
// 7.25.3.6
static inline int
@@ -167,7 +167,7 @@
# define PIPE_ARCH_BIG_ENDIAN
#endif
#elif defined(__NetBSD__)
#elif defined(__NetBSD__) || defined(__minix)
#include <sys/types.h>
#include <sys/endian.h>
@@ -222,7 +222,7 @@
#define PIPE_OS_UNIX
#endif
#if defined(__NetBSD__)
#if defined(__NetBSD__) || defined(__minix)
#define PIPE_OS_NETBSD
#define PIPE_OS_BSD
#define PIPE_OS_UNIX
+5
View File
@@ -171,6 +171,11 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
extern int _mesa_glsl_debug;
#endif
#if defined(__minix)
/* Work around a legacy macro we still have... */
#undef EXTERN
#endif /* defined(__minix) */
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
+5
View File
@@ -40,6 +40,11 @@
extern int _mesa_glsl_debug;
#endif
#if defined(__minix)
/* Work around a legacy macro we still have... */
#undef EXTERN
#endif /* defined(__minix) */
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
+5
View File
@@ -33,6 +33,11 @@
#undef yyerror
#if defined(__minix)
/* Work around a legacy macro we still have... */
#undef EXTERN
#endif /* defined(__minix) */
static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
{
_mesa_glsl_error(loc, st, "%s", msg);
+5
View File
@@ -54,7 +54,12 @@
#include "glxconfig.h"
#include "glxhash.h"
#if defined( HAVE_PTHREAD )
# if !defined(__minix)
# include <pthread.h>
# else
# define _MTHREADIFY_PTHREADS 1
# include <minix/mthread.h>
# endif /* !defined(__minix) */
#endif
#include "glxextensions.h"
+9
View File
@@ -33,9 +33,11 @@
* Client-side GLX interface for current context management.
*/
#if !defined(__minix)
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif
#endif /* !defined(__minix) */
#include "glxclient.h"
@@ -180,9 +182,16 @@ glXGetCurrentDrawable(void)
return gc->currentDrawable;
}
#if defined(__minix)
static void
__glXGenerateError(Display * dpy, XID resource,
CARD8 errorCode, CARD16 minorCode)
#else
static void
__glXGenerateError(Display * dpy, XID resource,
BYTE errorCode, CARD16 minorCode)
#endif /* defined(__minix) */
{
xError error;
@@ -39,7 +39,7 @@
#undef GET_PROGRAM_NAME
#if defined(__NetBSD__)
#if defined(__NetBSD__) || defined(__minix)
#include <sys/param.h>
#endif
@@ -57,7 +57,7 @@ extern char *program_invocation_name, *program_invocation_short_name;
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
# endif
#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100) || defined(__minix)
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
#elif defined(__APPLE__)
@@ -29,7 +29,9 @@
* Keith Whitwell <keithw@vmware.com>
*/
#if !defined(__minix)
#include <pthread.h>
#endif /* !defined(__minix) */
#include "main/imports.h"
#include "main/enums.h"
#include "main/shaderobj.h"
+5
View File
@@ -1274,6 +1274,11 @@ struct gl_tex_env_combine_state
* TexGenEnabled flags.
*/
/*@{*/
#if defined(__minix)
/* LSC: It seems we have to better protect include/minix/const.h as itr
* exports MINIXisms to the userland. */
#undef R_BIT
#endif /* defined(__MINIX) */
#define S_BIT 1
#define T_BIT 2
#define R_BIT 4
+1 -1
View File
@@ -74,7 +74,7 @@ fpclassify(double x)
#endif /* _MSC_VER < 1800 */
#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
defined(__OpenBSD__) || defined(__minix) || defined(__NetBSD__) || defined(__DragonFly__) || \
(defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \
(defined(__sun) && defined(__GNUC__)) || defined(ANDROID) || defined(__HAIKU__)
@@ -26,6 +26,7 @@
*
*/
#if !defined(__minix)
#ifdef __SSE4_1__
#include "main/macros.h"
#include "main/streaming-load-memcpy.h"
@@ -86,3 +87,4 @@ _mesa_streaming_load_memcpy(void *restrict dst, void *restrict src, size_t len)
}
#endif
#endif /* !defined(__minix) */