2 * arch/s390/mm/page-states.c
4 * Copyright IBM Corp. 2008
6 * Guest page hinting for unused pages.
8 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
11 #include <linux/kernel.h>
12 #include <linux/errno.h>
13 #include <linux/types.h>
15 #include <linux/init.h>
17 #define ESSA_SET_STABLE 1
18 #define ESSA_SET_UNUSED 2
22 static int __init
cmma(char *str
)
26 if (strcmp(parm
, "yes") == 0 || strcmp(parm
, "on") == 0) {
31 if (strcmp(parm
, "no") == 0 || strcmp(parm
, "off") == 0)
36 __setup("cmma=", cmma
);
38 void __init
cmma_init(void)
40 register unsigned long tmp
asm("0") = 0;
41 register int rc
asm("1") = -EOPNOTSUPP
;
46 " .insn rrf,0xb9ab0000,%1,%1,0,0\n"
50 : "+&d" (rc
), "+&d" (tmp
));
55 void arch_free_page(struct page
*page
, int order
)
61 for (i
= 0; i
< (1 << order
); i
++)
62 asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0"
64 : "a" ((page_to_pfn(page
) + i
) << PAGE_SHIFT
),
65 "i" (ESSA_SET_UNUSED
));
68 void arch_alloc_page(struct page
*page
, int order
)
74 for (i
= 0; i
< (1 << order
); i
++)
75 asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0"
77 : "a" ((page_to_pfn(page
) + i
) << PAGE_SHIFT
),
78 "i" (ESSA_SET_STABLE
));