#ifndef _DRM_AGPSUPPORT_H_ #define _DRM_AGPSUPPORT_H_ #include #include #include #include #include #include #include struct drm_device; struct drm_file; struct drm_agp_head { struct agp_kern_info agp_info; struct list_head memory; unsigned long mode; struct agp_bridge_data *bridge; int enabled; int acquired; unsigned long base; int agp_mtrr; int cant_use_aperture; unsigned long page_mask; }; #if IS_ENABLED(CONFIG_AGP) void drm_free_agp(struct agp_memory * handle, int pages); int drm_bind_agp(struct agp_memory * handle, unsigned int start); int drm_unbind_agp(struct agp_memory * handle); struct agp_memory *drm_agp_bind_pages(struct drm_device *dev, struct page **pages, unsigned long num_pages, uint32_t gtt_offset, uint32_t type); struct drm_agp_head *drm_agp_init(struct drm_device *dev); void drm_legacy_agp_clear(struct drm_device *dev); int drm_agp_acquire(struct drm_device *dev); int drm_agp_acquire_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_release(struct drm_device *dev); int drm_agp_release_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode); int drm_agp_enable_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info); int drm_agp_info_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request); int drm_agp_alloc_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request); int drm_agp_free_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request); int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request); int drm_agp_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); #else /* CONFIG_AGP */ static inline void drm_free_agp(struct agp_memory * handle, int pages) { } static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start) { return -ENODEV; } static inline int drm_unbind_agp(struct agp_memory * handle) { return -ENODEV; } static inline struct agp_memory *drm_agp_bind_pages(struct drm_device *dev, struct page **pages, unsigned long num_pages, uint32_t gtt_offset, uint32_t type) { return NULL; } static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev) { return NULL; } static inline void drm_legacy_agp_clear(struct drm_device *dev) { } static inline int drm_agp_acquire(struct drm_device *dev) { return -ENODEV; } static inline int drm_agp_release(struct drm_device *dev) { return -ENODEV; } static inline int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode) { return -ENODEV; } static inline int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info) { return -ENODEV; } static inline int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request) { return -ENODEV; } static inline int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request) { return -ENODEV; } static inline int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request) { return -ENODEV; } static inline int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) { return -ENODEV; } #endif /* CONFIG_AGP */ #endif /* _DRM_AGPSUPPORT_H_ */ value='0' selected='selected'>includemode:
authorzhong jiang <zhongjiang@huawei.com>2017-01-24 15:18:52 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:26:14 -0800
commit3277953de2f31dd03c6375e9a9f680ac37fc9d27 (patch)
tree6ba22924faa1b82ef2f0277db10a3f5abdc44157 /include/trace
parent3705ccfdd1e8b539225ce20e3925a945cc788d67 (diff)
mm: do not export ioremap_page_range symbol for external module
Recently, I've found cases in which ioremap_page_range was used incorrectly, in external modules, leading to crashes. This can be partly attributed to the fact that ioremap_page_range is lower-level, with fewer protections, as compared to the other functions that an external module would typically call. Those include: ioremap_cache ioremap_nocache ioremap_prot ioremap_uc ioremap_wc ioremap_wt ...each of which wraps __ioremap_caller, which in turn provides a safer way to achieve the mapping. Therefore, stop EXPORT-ing ioremap_page_range. Link: http://lkml.kernel.org/r/1485173220-29010-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang <zhongjiang@huawei.com> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Suggested-by: John Hubbard <jhubbard@nvidia.com> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace')