-/* $OpenBSD: hibernate_machdep.c,v 1.46 2020/09/11 09:27:09 mpi Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.47 2022/01/16 22:27:46 mlarkin Exp $ */
/*
* Copyright (c) 2012 Mike Larkin <mlarkin@openbsd.org>
if (hiber_info->nranges >= VM_PHYSSEG_MAX)
return (1);
- i = hiber_info->nranges;
+ i = hiber_info->nranges;
hiber_info->ranges[i].base = round_page(bmp->addr);
hiber_info->ranges[i].end = trunc_page(bmp->addr + bmp->size);
hiber_info->image_size += hiber_info->ranges[i].end -
/* First 512GB and 1GB are already mapped */
pde = (pt_entry_t *)(HIBERNATE_PD_LOW +
(pl2_pi(va) * sizeof(pt_entry_t)));
- npde = (pa & PG_LGFRAME) |
+ npde = (pa & PG_LGFRAME) |
PG_RW | PG_V | PG_M | PG_PS | PG_U;
*pde = npde;
} else {
(pl2_pi(va) * sizeof(pt_entry_t)));
npde = (pa & PG_LGFRAME) |
PG_RW | PG_V | PG_M | PG_PS | PG_U;
- *pde = npde;
+ *pde = npde;
}
} else {
/* First map the 512GB containing region */
(pl3_pi(0) * sizeof(pt_entry_t)));
npde = (HIBERNATE_PD_LOW) | PG_RW | PG_V;
*pde = npde;
-
+
/* PD for first 2MB */
pde = (pt_entry_t *)(HIBERNATE_PD_LOW +
(pl2_pi(0) * sizeof(pt_entry_t)));
-/* $OpenBSD: hibernate_machdep.c,v 1.56 2020/09/11 09:27:10 mpi Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.57 2022/01/16 22:27:46 mlarkin Exp $ */
/*
* Copyright (c) 2011 Mike Larkin <mlarkin@openbsd.org>
if (hiber_info->nranges >= VM_PHYSSEG_MAX)
return (1);
- i = hiber_info->nranges;
+ i = hiber_info->nranges;
hiber_info->ranges[i].base = round_page(bmp->addr);
hiber_info->ranges[i].end = trunc_page(bmp->addr + bmp->size);
hiber_info->image_size += hiber_info->ranges[i].end -
-/* $OpenBSD: hibernate.h,v 1.43 2022/01/07 02:47:06 guenther Exp $ */
+/* $OpenBSD: hibernate.h,v 1.44 2022/01/16 22:27:46 mlarkin Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
*/
struct hibernate_disk_chunk {
paddr_t base; /* Base of chunk */
- paddr_t end; /* End of chunk */
+ paddr_t end; /* End of chunk */
daddr_t offset; /* Abs. disk block locating chunk */
size_t compressed_size; /* Compressed size on disk */
short flags; /* Flags */
*/
union hibernate_info {
struct {
- u_int32_t magic;
+ u_int32_t magic;
size_t nranges;
struct hibernate_memory_range ranges[VM_PHYSSEG_MAX];
size_t image_size;