OSDN Git Service

x86/mm: introduce __set_memory_prot()
[tomoyo/tomoyo-test1.git] / arch / x86 / mm / pat / set_memory.c
index 6d54240..59eca6a 100644 (file)
@@ -1795,6 +1795,19 @@ static inline int cpa_clear_pages_array(struct page **pages, int numpages,
                CPA_PAGES_ARRAY, pages);
 }
 
+/*
+ * _set_memory_prot is an internal helper for callers that have been passed
+ * a pgprot_t value from upper layers and a reservation has already been taken.
+ * If you want to set the pgprot to a specific page protocol, use the
+ * set_memory_xx() functions.
+ */
+int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot)
+{
+       return change_page_attr_set_clr(&addr, numpages, prot,
+                                       __pgprot(~pgprot_val(prot)), 0, 0,
+                                       NULL);
+}
+
 int _set_memory_uc(unsigned long addr, int numpages)
 {
        /*