xref: /openbsd-src/sys/arch/loongson/include/hibernate_var.h (revision 3fc8f127fcb4c61791a5229f020a7eb71f1cd87f)
1*3fc8f127Spirofti /*	$OpenBSD: hibernate_var.h,v 1.1 2013/06/02 21:46:04 pirofti Exp $	*/
2*3fc8f127Spirofti 
3*3fc8f127Spirofti /*
4*3fc8f127Spirofti  * Copyright (c) 2013 Paul Irofti.
5*3fc8f127Spirofti  *
6*3fc8f127Spirofti  * Permission to use, copy, modify, and distribute this software for any
7*3fc8f127Spirofti  * purpose with or without fee is hereby granted, provided that the above
8*3fc8f127Spirofti  * copyright notice and this permission notice appear in all copies.
9*3fc8f127Spirofti  *
10*3fc8f127Spirofti  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11*3fc8f127Spirofti  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12*3fc8f127Spirofti  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13*3fc8f127Spirofti  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14*3fc8f127Spirofti  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15*3fc8f127Spirofti  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16*3fc8f127Spirofti  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*3fc8f127Spirofti  */
18*3fc8f127Spirofti 
19*3fc8f127Spirofti /* Loongson hibernate support definitions */
20*3fc8f127Spirofti 
21*3fc8f127Spirofti #define PAGE_MASK_4M ((256 * PAGE_SIZE) - 1)
22*3fc8f127Spirofti 
23*3fc8f127Spirofti #define PIGLET_PAGE_MASK ~((paddr_t)PAGE_MASK_4M)
24*3fc8f127Spirofti 
25*3fc8f127Spirofti /*
26*3fc8f127Spirofti  * Steal hibernate pages right after the first page which is reserved
27*3fc8f127Spirofti  * for the exception area.
28*3fc8f127Spirofti  * */
29*3fc8f127Spirofti #define HIBERNATE_STACK_PAGE	(PAGE_SIZE * 1)
30*3fc8f127Spirofti #define HIBERNATE_INFLATE_PAGE	(PAGE_SIZE * 2)
31*3fc8f127Spirofti #define HIBERNATE_COPY_PAGE	(PAGE_SIZE * 3)
32*3fc8f127Spirofti #define HIBERNATE_HIBALLOC_PAGE	(PAGE_SIZE * 4)
33*3fc8f127Spirofti 
34*3fc8f127Spirofti #define HIBERNATE_RESERVED_PAGES	4
35*3fc8f127Spirofti 
36*3fc8f127Spirofti /* Use 4MB hibernation chunks */
37*3fc8f127Spirofti #define HIBERNATE_CHUNK_SIZE		0x400000
38*3fc8f127Spirofti 
39*3fc8f127Spirofti #define HIBERNATE_CHUNK_TABLE_SIZE	0x100000
40