and change drm_can_sleep() to only use in_atomic() on i386/amd64 as
it isn't defined for other archs currently. Unbreaks the sparc64 build.
Found the hard way by benoit@
-/* $OpenBSD: drmP.h,v 1.189 2015/04/10 06:00:39 jsg Exp $ */
+/* $OpenBSD: drmP.h,v 1.190 2015/04/10 12:06:52 jsg Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
static inline bool
drm_can_sleep(void)
{
+#if defined(__i386__) || defined(__amd64__)
if (in_atomic() || in_dbg_master() || irqs_disabled())
+#else
+ if (in_dbg_master() || irqs_disabled())
+#endif
return false;
return true;
}
-/* $OpenBSD: drm_linux.h,v 1.16 2015/04/10 05:31:25 jsg Exp $ */
+/* $OpenBSD: drm_linux.h,v 1.17 2015/04/10 12:06:52 jsg Exp $ */
/*
* Copyright (c) 2013, 2014 Mark Kettenis
*
return (word >> shift) | (word << (32 - shift));
}
+static inline int
+irqs_disabled(void)
+{
+ return (cold);
+}
+
+static inline int
+in_dbg_master(void)
+{
+#ifdef DDB
+ return (db_is_active);
+#endif
+ return (0);
+}
+
#ifdef __macppc__
static __inline int
of_machine_is_compatible(const char *model)
return curcpu()->ci_inatomic;
}
-static inline int
-irqs_disabled(void)
-{
- return (cold);
-}
-
-static inline int
-in_dbg_master(void)
-{
-#ifdef DDB
- return (db_is_active);
-#endif
- return (0);
-}
-
static inline void *
kmap_atomic(struct vm_page *pg)
{