]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - wimboot/wimboot-2.7.3/src/paging.h
5 * Copyright (C) 2021 Michael Brown <mbrown@fensystems.co.uk>.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
32 /** Get CPU features */
33 #define CPUID_FEATURES 0x00000001
35 /** CPU supports PAE */
36 #define CPUID_FEATURE_EDX_PAE 0x00000040
39 #define CR0_PG 0x80000000
41 /* CR4: physical address extensions */
42 #define CR4_PAE 0x00000020
47 /* Page: read/write */
50 /* Page: user/supervisor */
57 #define PAGE_SIZE_2MB 0x200000
59 /** 32-bit address space size */
60 #define ADDR_4GB 0x100000000ULL
62 /** Saved paging state */
64 /** Control register 0 */
66 /** Control register 3 */
68 /** Control register 4 */
74 extern void init_paging ( void );
75 extern void enable_paging ( struct paging_state
*state
);
76 extern void disable_paging ( struct paging_state
*state
);
77 extern uint64_t relocate_memory_high ( void *start
, size_t len
);
79 #endif /* _PAGING_H */