Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux More Linux goo.



details:   https://anonhg.NetBSD.org/src/rev/d98067bdcede
branches:  trunk
changeset: 798011:d98067bdcede
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 06 13:53:12 2014 +0000

description:
More Linux goo.

diffstat:

 sys/external/bsd/drm2/include/linux/hrtimer.h     |  35 ++++++++++++++++++++
 sys/external/bsd/drm2/include/linux/reboot.h      |  40 +++++++++++++++++++++++
 sys/external/bsd/drm2/include/linux/screen_info.h |  35 ++++++++++++++++++++
 sys/external/bsd/drm2/include/linux/spinlock.h    |  17 +++++++++-
 4 files changed, 126 insertions(+), 1 deletions(-)

diffs (151 lines):

diff -r c9686e33e7cb -r d98067bdcede sys/external/bsd/drm2/include/linux/hrtimer.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/drm2/include/linux/hrtimer.h     Wed Aug 06 13:53:12 2014 +0000
@@ -0,0 +1,35 @@
+/*     $NetBSD: hrtimer.h,v 1.1 2014/08/06 13:53:12 riastradh Exp $    */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_HRTIMER_H_
+#define _LINUX_HRTIMER_H_
+
+#endif  /* _LINUX_HRTIMER_H_ */
diff -r c9686e33e7cb -r d98067bdcede sys/external/bsd/drm2/include/linux/reboot.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/drm2/include/linux/reboot.h      Wed Aug 06 13:53:12 2014 +0000
@@ -0,0 +1,40 @@
+/*     $NetBSD: reboot.h,v 1.1 2014/08/06 13:53:12 riastradh Exp $     */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef        _LINUX_REBOOT_H_
+#define        _LINUX_REBOOT_H_
+
+#define        orderly_poweroff        linux_orderly_poweroff
+
+/* XXX Implement this by posting a CRITICAL-OVER envsys event?  */
+int    orderly_poweroff(bool);
+
+#endif /* _LINUX_REBOOT_H_ */
diff -r c9686e33e7cb -r d98067bdcede sys/external/bsd/drm2/include/linux/screen_info.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/drm2/include/linux/screen_info.h Wed Aug 06 13:53:12 2014 +0000
@@ -0,0 +1,35 @@
+/*     $NetBSD: screen_info.h,v 1.1 2014/08/06 13:53:12 riastradh Exp $        */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_SCREEN_INFO_H_
+#define _LINUX_SCREEN_INFO_H_
+
+#endif  /* _LINUX_SCREEN_INFO_H_ */
diff -r c9686e33e7cb -r d98067bdcede sys/external/bsd/drm2/include/linux/spinlock.h
--- a/sys/external/bsd/drm2/include/linux/spinlock.h    Wed Aug 06 13:52:33 2014 +0000
+++ b/sys/external/bsd/drm2/include/linux/spinlock.h    Wed Aug 06 13:53:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spinlock.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $   */
+/*     $NetBSD: spinlock.h,v 1.3 2014/08/06 13:53:12 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -104,4 +104,19 @@
 #define        assert_spin_locked(spinlock)    \
        KASSERT(mutex_owned(&(spinlock)->sl_lock))
 
+/*
+ * Linux rwlocks are reader/writer spin locks.  We implement them as
+ * normal spin locks without reader/writer semantics for expedience.
+ * If that turns out to not work, adapting to reader/writer semantics
+ * shouldn't be too hard.
+ */
+
+#define        rwlock_t                spinlock_t
+#define        rwlock_init             spin_lock_init
+#define        rwlock_destroy          spin_lock_destroy
+#define        write_lock_irq          spin_lock_irq
+#define        write_unlock_irq        spin_unlock_irq
+#define        read_lock               spin_lock
+#define        read_unlock             spin_unlock
+
 #endif  /* _LINUX_SPINLOCK_H_ */



Home | Main Index | Thread Index | Old Index