summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-04-10 12:06:53 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-04-10 12:06:53 +0000
commit724ac0908913728f3bbd76fc94280a32dea0aa10 (patch)
tree3c13ea93c719fb9c968408b6538661fdda1cbac0 /sys/dev/pci/drm
parenta6e54c88bfd37ed200d9a8373f0e35d0e50c55ee (diff)
Move irqs_disabled() and in_dbg_master() out of the i386/amd64 ifdef block
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@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/drmP.h6
-rw-r--r--sys/dev/pci/drm/drm_linux.h32
2 files changed, 21 insertions, 17 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 36dc0220553..129b3c01fb8 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -1,4 +1,4 @@
-/* $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
*/
@@ -159,7 +159,11 @@ extern struct cfdriver drm_cd;
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;
}
diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h
index e6d71f7fa27..8fac1c8ef4f 100644
--- a/sys/dev/pci/drm/drm_linux.h
+++ b/sys/dev/pci/drm/drm_linux.h
@@ -1,4 +1,4 @@
-/* $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
*
@@ -513,6 +513,21 @@ static inline uint32_t ror32(uint32_t word, unsigned int shift)
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)
@@ -544,21 +559,6 @@ in_atomic(void)
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)
{