mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 00:43:12 +00:00
Patch series "set_memory_* functions header refactor", v3. The set_memory_* APIs came out of a desire to have a better way to change memory attributes. Many of these attributes were linked to cache functionality so the prototypes were put in cacheflush.h. These days, the APIs have grown and have a much wider use than just cache APIs. To support this growth, split off set_memory_* and friends into a separate header file to avoid growing cacheflush.h for APIs that have nothing to do with caches. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Laura Abbott <[email protected]> Acked-by: Russell King <[email protected]> Acked-by: Mark Rutland <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
32 lines
740 B
C
32 lines
740 B
C
#ifndef _ASMS390_SET_MEMORY_H
|
|
#define _ASMS390_SET_MEMORY_H
|
|
|
|
#define SET_MEMORY_RO 1UL
|
|
#define SET_MEMORY_RW 2UL
|
|
#define SET_MEMORY_NX 4UL
|
|
#define SET_MEMORY_X 8UL
|
|
|
|
int __set_memory(unsigned long addr, int numpages, unsigned long flags);
|
|
|
|
static inline int set_memory_ro(unsigned long addr, int numpages)
|
|
{
|
|
return __set_memory(addr, numpages, SET_MEMORY_RO);
|
|
}
|
|
|
|
static inline int set_memory_rw(unsigned long addr, int numpages)
|
|
{
|
|
return __set_memory(addr, numpages, SET_MEMORY_RW);
|
|
}
|
|
|
|
static inline int set_memory_nx(unsigned long addr, int numpages)
|
|
{
|
|
return __set_memory(addr, numpages, SET_MEMORY_NX);
|
|
}
|
|
|
|
static inline int set_memory_x(unsigned long addr, int numpages)
|
|
{
|
|
return __set_memory(addr, numpages, SET_MEMORY_X);
|
|
}
|
|
|
|
#endif
|