Module Name:    src
Committed By:   bouyer
Date:           Mon Nov 30 17:02:27 UTC 2020

Modified Files:
        src/sys/arch/amd64/amd64: cpufunc.S
        src/sys/arch/amd64/include: cpufunc.h

Log Message:
Introduce smap_enable()/smap_disable() functions, to be used from
C code.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/amd64/amd64/cpufunc.S
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amd64/include/cpufunc.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/arch/amd64/amd64/cpufunc.S
diff -u src/sys/arch/amd64/amd64/cpufunc.S:1.64 src/sys/arch/amd64/amd64/cpufunc.S:1.65
--- src/sys/arch/amd64/amd64/cpufunc.S:1.64	Sun Jul 19 07:35:08 2020
+++ src/sys/arch/amd64/amd64/cpufunc.S	Mon Nov 30 17:02:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.64 2020/07/19 07:35:08 maxv Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.65 2020/11/30 17:02:27 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -167,6 +167,16 @@ END(x86_write_flags)
 
 STRONG_ALIAS(x86_write_psl,x86_write_flags)
 
+ENTRY(smap_enable)
+	SMAP_ENABLE
+	ret
+END(smap_enable)
+
+ENTRY(smap_disable)
+	SMAP_DISABLE
+	ret
+END(smap_disable)
+
 /*
  * %rdi = name
  * %rsi = sel

Index: src/sys/arch/amd64/include/cpufunc.h
diff -u src/sys/arch/amd64/include/cpufunc.h:1.19 src/sys/arch/amd64/include/cpufunc.h:1.20
--- src/sys/arch/amd64/include/cpufunc.h:1.19	Wed Oct 17 19:53:03 2007
+++ src/sys/arch/amd64/include/cpufunc.h	Mon Nov 30 17:02:27 2020
@@ -1,3 +1,6 @@
-/*	$NetBSD: cpufunc.h,v 1.19 2007/10/17 19:53:03 garbled Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.20 2020/11/30 17:02:27 bouyer Exp $	*/
 
 #include <x86/cpufunc.h>
+
+void smap_enable(void);
+void smap_disable(void);

Reply via email to