From a10d8178e32528e0fd8a7afa24e71a35b1c0582d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Nov 2005 20:25:00 +0000 Subject: Initial port of savage to FreeBSD for the AGP and !ShadowStatus case. Adds drm_mtrr_{add,del} for handling the MTRR setup. Still has a LOR issue with DRM_VERIFYAREA_READ/DRM_COPY_FROM_USER_UNCHECKED in savage_bci.c -- this won't work with the fine-grained locking in use, and just doing a single copyin to a temporary will probably work fine. Also note that the module leaks approximately 4 kb on unload. --- linux-core/drmP.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 7b344c7a..8044780b 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -763,6 +763,21 @@ static inline int drm_core_has_MTRR(struct drm_device *dev) { return drm_core_check_feature(dev, DRIVER_USE_MTRR); } + +#define DRM_MTRR_WC MTRR_TYPE_WRCOMB + +static inline int drm_mtrr_add(unsigned long offset, unsigned long size, + unsigned int flags) +{ + return mtrr_add(offset, size, flags, 1); +} + +static inline int drm_mtrr_del(int handle, unsigned long offset, + unsigned long size, unsigned int flags) +{ + return mtrr_del(handle, offset, size); +} + #else #define drm_core_has_MTRR(dev) (0) #endif -- cgit v1.2.3