Module Name:    src
Committed By:   riastradh
Date:           Wed Aug  6 13:53:13 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/include/linux: spinlock.h
Added Files:
        src/sys/external/bsd/drm2/include/linux: hrtimer.h reboot.h
            screen_info.h

Log Message:
More Linux goo.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/drm2/include/linux/hrtimer.h \
    src/sys/external/bsd/drm2/include/linux/reboot.h \
    src/sys/external/bsd/drm2/include/linux/screen_info.h
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/spinlock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/spinlock.h
diff -u src/sys/external/bsd/drm2/include/linux/spinlock.h:1.2 src/sys/external/bsd/drm2/include/linux/spinlock.h:1.3
--- src/sys/external/bsd/drm2/include/linux/spinlock.h:1.2	Tue Mar 18 18:20:43 2014
+++ src/sys/external/bsd/drm2/include/linux/spinlock.h	Wed Aug  6 13:53:12 2014
@@ -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 @@ spin_lock_destroy(spinlock_t *spinlock)
 #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_ */

Added files:

Index: src/sys/external/bsd/drm2/include/linux/hrtimer.h
diff -u /dev/null src/sys/external/bsd/drm2/include/linux/hrtimer.h:1.1
--- /dev/null	Wed Aug  6 13:53:13 2014
+++ src/sys/external/bsd/drm2/include/linux/hrtimer.h	Wed Aug  6 13:53:12 2014
@@ -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_ */
Index: src/sys/external/bsd/drm2/include/linux/reboot.h
diff -u /dev/null src/sys/external/bsd/drm2/include/linux/reboot.h:1.1
--- /dev/null	Wed Aug  6 13:53:13 2014
+++ src/sys/external/bsd/drm2/include/linux/reboot.h	Wed Aug  6 13:53:12 2014
@@ -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_ */
Index: src/sys/external/bsd/drm2/include/linux/screen_info.h
diff -u /dev/null src/sys/external/bsd/drm2/include/linux/screen_info.h:1.1
--- /dev/null	Wed Aug  6 13:53:13 2014
+++ src/sys/external/bsd/drm2/include/linux/screen_info.h	Wed Aug  6 13:53:12 2014
@@ -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_ */

Reply via email to