Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/asm Partially impleme...
details: https://anonhg.NetBSD.org/src/rev/32c38afaccda
branches: riastradh-drm2
changeset: 788063:32c38afaccda
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 02:03:46 2013 +0000
description:
Partially implement Linux <asm/mtrr.h>.
diffstat:
sys/external/bsd/drm2/include/asm/mtrr.h | 49 +++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diffs (61 lines):
diff -r 516a1538119b -r 32c38afaccda sys/external/bsd/drm2/include/asm/mtrr.h
--- a/sys/external/bsd/drm2/include/asm/mtrr.h Wed Jul 24 02:03:32 2013 +0000
+++ b/sys/external/bsd/drm2/include/asm/mtrr.h Wed Jul 24 02:03:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mtrr.h,v 1.1.2.1 2013/07/24 00:33:11 riastradh Exp $ */
+/* $NetBSD: mtrr.h,v 1.1.2.2 2013/07/24 02:03:46 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,4 +32,51 @@
#ifndef _ASM_MTRR_H_
#define _ASM_MTRR_H_
+#ifdef _KERNEL_OPT
+#include "opt_mtrr.h"
+#endif
+
+#include <machine/mtrr.h>
+
+#define MTRR_TYPE_WRCOMB MTRR_TYPE_WC
+
+static inline int
+mtrr_add(unsigned long base, unsigned long size, int type,
+ bool increment __unused)
+{
+#ifdef MTRR
+ struct mtrr mtrr;
+ int n = 1;
+
+ mtrr.base = base;
+ mtrr.len = size;
+ mtrr.type = type;
+ mtrr.flags = MTRR_VALID;
+
+ /* XXX errno NetBSD->Linux */
+ return -mtrr_set(&mtrr, &n, NULL, MTRR_GETSET_KERNEL);
+#else
+ return 0;
+#endif
+}
+
+static inline int
+mtrr_del(int handle __unused, unsigned long base, unsigned long size)
+{
+#ifdef MTRR
+ struct mtrr mtrr;
+ int n = 1;
+
+ mtrr.base = base;
+ mtrr.len = size;
+ mtrr.type = 0;
+ mtrr.flags = 0; /* not MTRR_VALID */
+
+ /* XXX errno NetBSD->Linux */
+ return -mtrr_set(&mtrr, &n, NULL, MTRR_GETSET_KERNEL);
+#else
+ return 0;
+#endif
+}
+
#endif /* _ASM_MTRR_H_ */
Home |
Main Index |
Thread Index |
Old Index