CVS commit: src/sys/external/bsd/drm2/include/asm

2022-10-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct 25 23:33:18 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
linux asm/io.h: Side-load linux/vmalloc.h like Linux does.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/include/asm/io.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/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.9 src/sys/external/bsd/drm2/include/asm/io.h:1.10
--- src/sys/external/bsd/drm2/include/asm/io.h:1.9	Mon Feb 14 00:28:33 2022
+++ src/sys/external/bsd/drm2/include/asm/io.h	Tue Oct 25 23:33:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.9 2022/02/14 00:28:33 riastradh Exp $	*/
+/*	$NetBSD: io.h,v 1.10 2022/10/25 23:33:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 #include 
 
 #include 
+#include 
 
 #define	memcpy_fromio(d,s,n)	memcpy((d),__UNVOLATILE(s),(n))
 #define	memcpy_toio(d,s,n)	memcpy(__UNVOLATILE(d),(s),(n))



CVS commit: src/sys/external/bsd/drm2/include/asm

2022-10-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct 25 23:33:18 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
linux asm/io.h: Side-load linux/vmalloc.h like Linux does.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/include/asm/io.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2022-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 14 00:28:33 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
drm: Delete mmiowb.

This no longer exists in Linux.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/include/asm/io.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/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.8 src/sys/external/bsd/drm2/include/asm/io.h:1.9
--- src/sys/external/bsd/drm2/include/asm/io.h:1.8	Sun Dec 19 10:59:55 2021
+++ src/sys/external/bsd/drm2/include/asm/io.h	Mon Feb 14 00:28:33 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.8 2021/12/19 10:59:55 riastradh Exp $	*/
+/*	$NetBSD: io.h,v 1.9 2022/02/14 00:28:33 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,13 +37,6 @@
 
 #include 
 
-/*
- * XXX This is bollocks, and is wrong on various architectures (should
- * work for x86; who knows what else), but bus_space_barrier won't work
- * because we have no bus space tag or handle or offset or anything.
- */
-#define	mmiowb()	membar_sync()
-
 #define	memcpy_fromio(d,s,n)	memcpy((d),__UNVOLATILE(s),(n))
 #define	memcpy_toio(d,s,n)	memcpy(__UNVOLATILE(d),(s),(n))
 



CVS commit: src/sys/external/bsd/drm2/include/asm

2022-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 14 00:28:33 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
drm: Delete mmiowb.

This no longer exists in Linux.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/include/asm/io.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 11:24:15 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Update to new access_ok prototype

also... this function should probably do something

Author: Maya Rashish 
Committer: Taylor R Campbell 


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/include/asm/uaccess.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/asm/uaccess.h
diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.8 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.9
--- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.8	Sun Dec 19 01:59:41 2021
+++ src/sys/external/bsd/drm2/include/asm/uaccess.h	Sun Dec 19 11:24:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaccess.h,v 1.8 2021/12/19 01:59:41 riastradh Exp $	*/
+/*	$NetBSD: uaccess.h,v 1.9 2021/12/19 11:24:14 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -42,8 +42,7 @@
 #define	VERIFY_READ	0
 #define	VERIFY_WRITE	1
 static inline bool
-access_ok(int verify_op __unused, const void *uaddr __unused,
-size_t nbytes __unused)
+access_ok(const void *uaddr __unused, size_t nbytes __unused)
 {
 	return true;
 }



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 11:24:15 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Update to new access_ok prototype

also... this function should probably do something

Author: Maya Rashish 
Committer: Taylor R Campbell 


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/include/asm/uaccess.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 10:59:55 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
memset_io doesn't need to return anything.

Previous change to make argument volatile broke return, but we don't
need it anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/include/asm/io.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/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.7 src/sys/external/bsd/drm2/include/asm/io.h:1.8
--- src/sys/external/bsd/drm2/include/asm/io.h:1.7	Sun Dec 19 10:48:29 2021
+++ src/sys/external/bsd/drm2/include/asm/io.h	Sun Dec 19 10:59:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.7 2021/12/19 10:48:29 riastradh Exp $	*/
+/*	$NetBSD: io.h,v 1.8 2021/12/19 10:59:55 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
 #define	memcpy_toio(d,s,n)	memcpy(__UNVOLATILE(d),(s),(n))
 
 #if defined(__NetBSD__) && defined(__aarch64__)
-static inline void *
+static inline void
 memset_io(volatile void *b, int c, size_t len)
 {
 	volatile uint8_t *ptr = b;
@@ -57,8 +57,6 @@ memset_io(volatile void *b, int c, size_
 		*ptr++ = c;
 		len--;
 	}
-
-	return b;
 }
 #else
 #define	memset_io(b,c,n)	memset(__UNVOLATILE(b),(c),(n))



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 10:59:55 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
memset_io doesn't need to return anything.

Previous change to make argument volatile broke return, but we don't
need it anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/include/asm/io.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 10:48:29 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
Allow memset_io  to take volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/io.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/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.6 src/sys/external/bsd/drm2/include/asm/io.h:1.7
--- src/sys/external/bsd/drm2/include/asm/io.h:1.6	Sat Jan 18 02:42:23 2020
+++ src/sys/external/bsd/drm2/include/asm/io.h	Sun Dec 19 10:48:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.6 2020/01/18 02:42:23 jmcneill Exp $	*/
+/*	$NetBSD: io.h,v 1.7 2021/12/19 10:48:29 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -44,14 +44,14 @@
  */
 #define	mmiowb()	membar_sync()
 
-#define	memcpy_fromio	memcpy
-#define	memcpy_toio	memcpy
+#define	memcpy_fromio(d,s,n)	memcpy((d),__UNVOLATILE(s),(n))
+#define	memcpy_toio(d,s,n)	memcpy(__UNVOLATILE(d),(s),(n))
 
 #if defined(__NetBSD__) && defined(__aarch64__)
 static inline void *
-memset_io(void *b, int c, size_t len)
+memset_io(volatile void *b, int c, size_t len)
 {
-	uint8_t *ptr = b;
+	volatile uint8_t *ptr = b;
 
 	while (len > 0) {
 		*ptr++ = c;
@@ -61,7 +61,7 @@ memset_io(void *b, int c, size_t len)
 	return b;
 }
 #else
-#define	memset_io	memset
+#define	memset_io(b,c,n)	memset(__UNVOLATILE(b),(c),(n))
 #endif
 
 /* XXX wrong place */



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 10:48:29 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
Allow memset_io  to take volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/io.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:59:41 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
linux/compiler.h for #define __user

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/include/asm/uaccess.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/asm/uaccess.h
diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.7 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.8
--- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.7	Sun Dec 19 01:55:14 2021
+++ src/sys/external/bsd/drm2/include/asm/uaccess.h	Sun Dec 19 01:59:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaccess.h,v 1.7 2021/12/19 01:55:14 riastradh Exp $	*/
+/*	$NetBSD: uaccess.h,v 1.8 2021/12/19 01:59:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,6 +36,8 @@
 #include 
 #include 
 
+#include 
+
 /* XXX This is a cop-out.  */
 #define	VERIFY_READ	0
 #define	VERIFY_WRITE	1



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:59:41 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
linux/compiler.h for #define __user

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/include/asm/uaccess.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:55:14 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Use ufetch(9) instead of removed subyte.

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/uaccess.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/asm/uaccess.h
diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.6 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.7
--- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.6	Sun Dec 19 01:39:41 2021
+++ src/sys/external/bsd/drm2/include/asm/uaccess.h	Sun Dec 19 01:55:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaccess.h,v 1.6 2021/12/19 01:39:41 riastradh Exp $	*/
+/*	$NetBSD: uaccess.h,v 1.7 2021/12/19 01:55:14 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@ clear_user(void __user *user_ptr, size_t
 	 * out an int.
 	 */
 	while (n --> 0) {
-		if (subyte(p, 0) != 0)
+		if (ustore_char(p, 0) != 0)
 			return ++n;
 	}
 



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:55:14 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Use ufetch(9) instead of removed subyte.

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/uaccess.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:51:11 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: agp.h

Log Message:
map_page_into_agp, unmap_page_from_agp stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/asm/agp.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/asm/agp.h
diff -u src/sys/external/bsd/drm2/include/asm/agp.h:1.2 src/sys/external/bsd/drm2/include/asm/agp.h:1.3
--- src/sys/external/bsd/drm2/include/asm/agp.h:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/include/asm/agp.h	Sun Dec 19 01:51:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp.h,v 1.2 2014/03/18 18:20:42 riastradh Exp $	*/
+/*	$NetBSD: agp.h,v 1.3 2021/12/19 01:51:11 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,4 +32,18 @@
 #ifndef _ASM_AGP_H_
 #define _ASM_AGP_H_
 
+struct page;
+
+static inline void
+map_page_into_agp(struct page *p)
+{
+	/* XXX Linux does set_pages_uc here.  */
+}
+
+static inline void
+unmap_page_from_agp(struct page *p)
+{
+	/* XXX Linux does set_pages_wb here.  */
+}
+
 #endif  /* _ASM_AGP_H_ */



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:51:11 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: agp.h

Log Message:
map_page_into_agp, unmap_page_from_agp stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/asm/agp.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:46:09 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: processor.h

Log Message:
Use SPINLOCK_BACKOFF_HOOK, not DELAY(1), for busy waits.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/processor.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/asm/processor.h
diff -u src/sys/external/bsd/drm2/include/asm/processor.h:1.5 src/sys/external/bsd/drm2/include/asm/processor.h:1.6
--- src/sys/external/bsd/drm2/include/asm/processor.h:1.5	Sun Dec 19 01:39:34 2021
+++ src/sys/external/bsd/drm2/include/asm/processor.h	Sun Dec 19 01:46:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: processor.h,v 1.5 2021/12/19 01:39:34 riastradh Exp $	*/
+/*	$NetBSD: processor.h,v 1.6 2021/12/19 01:46:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,9 @@
 
 #include 
 
-#define	cpu_relax()	DELAY(1)	/* XXX */
+#include 
+
+#define	cpu_relax()	SPINLOCK_BACKOFF_HOOK
 
 #if defined(__i386__) || defined(__x86_64__)
 static inline void



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:46:09 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: processor.h

Log Message:
Use SPINLOCK_BACKOFF_HOOK, not DELAY(1), for busy waits.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/processor.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:39:41 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Safe unsafe uaccess stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/uaccess.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/asm/uaccess.h
diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.5 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.6
--- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.5	Sun Dec 19 00:55:01 2021
+++ src/sys/external/bsd/drm2/include/asm/uaccess.h	Sun Dec 19 01:39:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaccess.h,v 1.5 2021/12/19 00:55:01 riastradh Exp $	*/
+/*	$NetBSD: uaccess.h,v 1.6 2021/12/19 01:39:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -72,6 +72,17 @@ copy_to_user(void *user_addr, const void
 	copy_to_user((USER_PTR), &__put_user_tmp, sizeof(__put_user_tmp));\
 })
 
+#define	__get_user	get_user
+#define	__put_user	put_user
+
+#define	user_access_begin()	__nothing
+#define	user_access_end()	__nothing
+
+#define	unsafe_put_user(KERNEL_RVAL, USER_PTR, LABEL)	do {		  \
+	if (__put_user(KERNEL_RVAL, USER_PTR))  \
+		goto LABEL;		  \
+} while (0)
+
 static inline size_t
 clear_user(void __user *user_ptr, size_t size)
 {



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:39:41 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Safe unsafe uaccess stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/uaccess.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:39:34 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: processor.h

Log Message:
Bogus clflushopt that just does clflush for now.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/processor.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/asm/processor.h
diff -u src/sys/external/bsd/drm2/include/asm/processor.h:1.4 src/sys/external/bsd/drm2/include/asm/processor.h:1.5
--- src/sys/external/bsd/drm2/include/asm/processor.h:1.4	Mon May 31 10:33:04 2021
+++ src/sys/external/bsd/drm2/include/asm/processor.h	Sun Dec 19 01:39:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: processor.h,v 1.4 2021/05/31 10:33:04 riastradh Exp $	*/
+/*	$NetBSD: processor.h,v 1.5 2021/12/19 01:39:34 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,4 +36,13 @@
 
 #define	cpu_relax()	DELAY(1)	/* XXX */
 
+#if defined(__i386__) || defined(__x86_64__)
+static inline void
+clflushopt(void *p)
+{
+	/* XXX Test CPUID bit, use CLFLUSHOPT...  */
+	asm volatile ("clflush %0" : : "m" (*(const char *)p));
+}
+#endif
+
 #endif  /* _ASM_PROCESSOR_H_ */



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:39:34 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: processor.h

Log Message:
Bogus clflushopt that just does clflush for now.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/processor.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:25:05 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: cpufeature.h

Log Message:
boot_cpu_has(X86_FEATURE_PAT)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/cpufeature.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/asm/cpufeature.h
diff -u src/sys/external/bsd/drm2/include/asm/cpufeature.h:1.6 src/sys/external/bsd/drm2/include/asm/cpufeature.h:1.7
--- src/sys/external/bsd/drm2/include/asm/cpufeature.h:1.6	Sun Dec 19 01:18:39 2021
+++ src/sys/external/bsd/drm2/include/asm/cpufeature.h	Sun Dec 19 01:25:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufeature.h,v 1.6 2021/12/19 01:18:39 riastradh Exp $	*/
+/*	$NetBSD: cpufeature.h,v 1.7 2021/12/19 01:25:05 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 #define	cpu_has_pat	((cpu_info_primary.ci_feat_val[0] & CPUID_PAT) != 0)
 
 #define	X86_FEATURE_CLFLUSH	0
+#define	X86_FEATURE_PAT		1
 
 static inline bool
 static_cpu_has(int feature)
@@ -47,11 +48,15 @@ static_cpu_has(int feature)
 	switch (feature) {
 	case X86_FEATURE_CLFLUSH:
 		return cpu_has_clflush;
+	case X86_FEATURE_PAT:
+		return cpu_has_pat;
 	default:
 		return false;
 	}
 }
 
+#define	boot_cpu_has	static_cpu_has
+
 static inline size_t
 cache_line_size(void)
 {



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:25:05 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: cpufeature.h

Log Message:
boot_cpu_has(X86_FEATURE_PAT)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/cpufeature.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:18:45 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: page.h

Log Message:
get_order


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/asm/page.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/asm/page.h
diff -u src/sys/external/bsd/drm2/include/asm/page.h:1.2 src/sys/external/bsd/drm2/include/asm/page.h:1.3
--- src/sys/external/bsd/drm2/include/asm/page.h:1.2	Wed Jul 16 20:59:58 2014
+++ src/sys/external/bsd/drm2/include/asm/page.h	Sun Dec 19 01:18:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: page.h,v 1.2 2014/07/16 20:59:58 riastradh Exp $	*/
+/*	$NetBSD: page.h,v 1.3 2021/12/19 01:18:45 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #ifndef _ASM_PAGE_H_
 #define _ASM_PAGE_H_
 
+#include 
 #include 
 
 #include 
@@ -56,4 +57,10 @@ page_to_pfn(struct page *page)
 	return (page_to_phys(page) >> PAGE_SHIFT);
 }
 
+static inline size_t
+get_order(size_t n)
+{
+	return fls64((n - 1) >> PAGE_SHIFT);
+}
+
 #endif	/* _ASM_PAGE_H_ */



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:18:45 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: page.h

Log Message:
get_order


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/asm/page.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:18:39 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: cpufeature.h

Log Message:
Define x86 static_cpu_has(X86_FEATURE_CLFLUSH), clflush.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/cpufeature.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/asm/cpufeature.h
diff -u src/sys/external/bsd/drm2/include/asm/cpufeature.h:1.5 src/sys/external/bsd/drm2/include/asm/cpufeature.h:1.6
--- src/sys/external/bsd/drm2/include/asm/cpufeature.h:1.5	Sat Sep  5 07:45:44 2020
+++ src/sys/external/bsd/drm2/include/asm/cpufeature.h	Sun Dec 19 01:18:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufeature.h,v 1.5 2020/09/05 07:45:44 maxv Exp $	*/
+/*	$NetBSD: cpufeature.h,v 1.6 2021/12/19 01:18:39 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -39,12 +39,31 @@
 #define	cpu_has_clflush	((cpu_info_primary.ci_feat_val[0] & CPUID_CLFSH) != 0)
 #define	cpu_has_pat	((cpu_info_primary.ci_feat_val[0] & CPUID_PAT) != 0)
 
+#define	X86_FEATURE_CLFLUSH	0
+
+static inline bool
+static_cpu_has(int feature)
+{
+	switch (feature) {
+	case X86_FEATURE_CLFLUSH:
+		return cpu_has_clflush;
+	default:
+		return false;
+	}
+}
+
 static inline size_t
 cache_line_size(void)
 {
 	return cpu_info_primary.ci_cflush_lsize;
 }
 
+static inline void
+clflush(const void *p)
+{
+	asm volatile ("clflush %0" : : "m" (*(const char *)p));
+}
+
 #endif	/* x86 */
 
 #endif	/* _LINUX_ASM_CPUFEATURE_H_ */



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:18:39 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: cpufeature.h

Log Message:
Define x86 static_cpu_has(X86_FEATURE_CLFLUSH), clflush.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/cpufeature.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 00:55:01 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Implement hokey slow clear_user.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/uaccess.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/asm/uaccess.h
diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.4 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.5
--- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.4	Sun Dec 19 00:50:11 2021
+++ src/sys/external/bsd/drm2/include/asm/uaccess.h	Sun Dec 19 00:55:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaccess.h,v 1.4 2021/12/19 00:50:11 riastradh Exp $	*/
+/*	$NetBSD: uaccess.h,v 1.5 2021/12/19 00:55:01 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -72,6 +72,25 @@ copy_to_user(void *user_addr, const void
 	copy_to_user((USER_PTR), &__put_user_tmp, sizeof(__put_user_tmp));\
 })
 
+static inline size_t
+clear_user(void __user *user_ptr, size_t size)
+{
+	char __user *p = user_ptr;
+	size_t n = size;
+
+	/*
+	 * This loop which sets up a fault handler on every iteration
+	 * is not going to win any speed records, but it'll do to copy
+	 * out an int.
+	 */
+	while (n --> 0) {
+		if (subyte(p, 0) != 0)
+			return ++n;
+	}
+
+	return 0;
+}
+
 #if 0
 /*
  * XXX These `inatomic' versions are a cop out, but they should do for



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 00:55:01 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Implement hokey slow clear_user.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/uaccess.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 00:50:11 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Tweak get_user and put_user.

- Add type check to get_user.
- Use temporary for put_user, since argument might not be lvalue.
- Clarify argument names.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/asm/uaccess.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/asm/uaccess.h
diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.3 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.4
--- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.3	Sun Sep 10 22:51:48 2017
+++ src/sys/external/bsd/drm2/include/asm/uaccess.h	Sun Dec 19 00:50:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaccess.h,v 1.3 2017/09/10 22:51:48 maya Exp $	*/
+/*	$NetBSD: uaccess.h,v 1.4 2021/12/19 00:50:11 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -63,11 +63,14 @@ copy_to_user(void *user_addr, const void
 	return -copyout(kernel_addr, user_addr, len);
 }
 
-#define	get_user(KERNEL_LOC, USER_ADDR)	\
-	copy_from_user(&(KERNEL_LOC), (USER_ADDR), sizeof(KERNEL_LOC))
-
-#define	put_user(KERNEL_LOC, USER_ADDR)	\
-	copy_to_user((USER_ADDR), &(KERNEL_LOC), sizeof(KERNEL_LOC))
+#define	get_user(KERNEL_LVAL, USER_PTR)	  \
+	copy_from_user(&(KERNEL_LVAL), (USER_PTR), sizeof(*(USER_PTR)) +  \
+	0*sizeof(&(KERNEL_LVAL) - (USER_PTR)))
+
+#define	put_user(KERNEL_RVAL, USER_PTR)	({  \
+	const typeof(*(USER_PTR)) __put_user_tmp = (KERNEL_RVAL);	  \
+	copy_to_user((USER_PTR), &__put_user_tmp, sizeof(__put_user_tmp));\
+})
 
 #if 0
 /*



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 00:50:11 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: uaccess.h

Log Message:
Tweak get_user and put_user.

- Add type check to get_user.
- Use temporary for put_user, since argument might not be lvalue.
- Clarify argument names.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/asm/uaccess.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 00:46:36 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: bug.h

Log Message:
Define BUILD_BUG_ON_INVALID.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/bug.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/asm/bug.h
diff -u src/sys/external/bsd/drm2/include/asm/bug.h:1.6 src/sys/external/bsd/drm2/include/asm/bug.h:1.7
--- src/sys/external/bsd/drm2/include/asm/bug.h:1.6	Fri Sep 20 12:40:23 2019
+++ src/sys/external/bsd/drm2/include/asm/bug.h	Sun Dec 19 00:46:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bug.h,v 1.6 2019/09/20 12:40:23 kamil Exp $	*/
+/*	$NetBSD: bug.h,v 1.7 2021/12/19 00:46:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@
 #define	BUILD_BUG()		do {} while (0)
 #define	BUILD_BUG_ON(CONDITION)	DRMCTASSERT(!(CONDITION))
 #define	BUILD_BUG_ON_MSG(CONDITION,MSG)	DRMCTASSERT(!(CONDITION))
+#define	BUILD_BUG_ON_INVALID(EXPR)	((void)sizeof(EXPR))
 
 /* XXX Rate limit?  */
 #define WARN(CONDITION, FMT, ...)	\



CVS commit: src/sys/external/bsd/drm2/include/asm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 00:46:36 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: bug.h

Log Message:
Define BUILD_BUG_ON_INVALID.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/asm/bug.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 12:40:23 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/include/asm: bug.h

Log Message:
Define DRMCTASSERT() for Compile-Time DRMKMS asserts

Switch CTASSERT() to DRMCTASSERT() in BUILD_BUG_ON().

This fixes build issues with disabled compieler optimization.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/bug.h

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



CVS commit: src/sys/external/bsd/drm2/include/asm

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 12:40:23 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/include/asm: bug.h

Log Message:
Define DRMCTASSERT() for Compile-Time DRMKMS asserts

Switch CTASSERT() to DRMCTASSERT() in BUILD_BUG_ON().

This fixes build issues with disabled compieler optimization.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/bug.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/asm/bug.h
diff -u src/sys/external/bsd/drm2/include/asm/bug.h:1.5 src/sys/external/bsd/drm2/include/asm/bug.h:1.6
--- src/sys/external/bsd/drm2/include/asm/bug.h:1.5	Fri Sep 20 10:54:07 2019
+++ src/sys/external/bsd/drm2/include/asm/bug.h	Fri Sep 20 12:40:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bug.h,v 1.5 2019/09/20 10:54:07 kamil Exp $	*/
+/*	$NetBSD: bug.h,v 1.6 2019/09/20 12:40:23 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,19 +35,20 @@
 #include 
 #include 
 
-#define	BUG()			panic("%s:%d: BUG!", __FILE__, __LINE__)
-#define	BUG_ON(CONDITION)	KASSERT(!(CONDITION))
-
-#define	BUILD_BUG()		do {} while (0)
-#define	BUILD_BUG_ON(CONDITION)	CTASSERT(!(CONDITION))
 /*
  * static_assert is violated with runtime-only compiler semantics in a few
  * places. Instead of breaking the build, stop asserting these corner cases.
  */
-#define	BUILD_BUG_ON_MSG(CONDITION,MSG)	\
-	CTASSERT((__builtin_choose_expr(\
-		__builtin_constant_p(CONDITION), !(CONDITION), 1)))
 
+#define DRMCTASSERT(x)	CTASSERT((__builtin_choose_expr(		\
+			__builtin_constant_p(x), (x), 1)))
+
+#define	BUG()			panic("%s:%d: BUG!", __FILE__, __LINE__)
+#define	BUG_ON(CONDITION)	KASSERT(!(CONDITION))
+
+#define	BUILD_BUG()		do {} while (0)
+#define	BUILD_BUG_ON(CONDITION)	DRMCTASSERT(!(CONDITION))
+#define	BUILD_BUG_ON_MSG(CONDITION,MSG)	DRMCTASSERT(!(CONDITION))
 
 /* XXX Rate limit?  */
 #define WARN(CONDITION, FMT, ...)	\



CVS commit: src/sys/external/bsd/drm2/include/asm

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 10:54:07 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/include/asm: bug.h

Log Message:
Adapt DRMKMS BUILD_BUG_ON_MSG() to static_assert semantics

static_assert is violated with runtime-only compiler semantics in a few
places. Instead of breaking the build, stop asserting these corner cases.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/bug.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/asm/bug.h
diff -u src/sys/external/bsd/drm2/include/asm/bug.h:1.4 src/sys/external/bsd/drm2/include/asm/bug.h:1.5
--- src/sys/external/bsd/drm2/include/asm/bug.h:1.4	Mon Aug 27 06:19:16 2018
+++ src/sys/external/bsd/drm2/include/asm/bug.h	Fri Sep 20 10:54:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bug.h,v 1.4 2018/08/27 06:19:16 riastradh Exp $	*/
+/*	$NetBSD: bug.h,v 1.5 2019/09/20 10:54:07 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,7 +40,13 @@
 
 #define	BUILD_BUG()		do {} while (0)
 #define	BUILD_BUG_ON(CONDITION)	CTASSERT(!(CONDITION))
-#define	BUILD_BUG_ON_MSG(CONDITION,MSG)	CTASSERT(!(CONDITION))
+/*
+ * static_assert is violated with runtime-only compiler semantics in a few
+ * places. Instead of breaking the build, stop asserting these corner cases.
+ */
+#define	BUILD_BUG_ON_MSG(CONDITION,MSG)	\
+	CTASSERT((__builtin_choose_expr(\
+		__builtin_constant_p(CONDITION), !(CONDITION), 1)))
 
 
 /* XXX Rate limit?  */



CVS commit: src/sys/external/bsd/drm2/include/asm

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 10:54:07 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/include/asm: bug.h

Log Message:
Adapt DRMKMS BUILD_BUG_ON_MSG() to static_assert semantics

static_assert is violated with runtime-only compiler semantics in a few
places. Instead of breaking the build, stop asserting these corner cases.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/bug.h

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