1
#ifndef GRUB_CPU_MEMORY_HEADER
2
#define GRUB_CPU_MEMORY_HEADER 1
4
#include <grub/symbol.h>
7
#define LOWMEM_SECTION "_lowmem, _lowmem"
9
#define LOWMEM_SECTION ".lowmem"
13
#define LOWMEM .section LOWMEM_SECTION, "ax"
15
#define LOWMEM __attribute__ ((section (LOWMEM_SECTION)))
18
#define GRUB_MM_MALLOC_LOW 2
19
#define GRUB_MM_MALLOC_LOW_END 3
22
void EXPORT_FUNC(grub_real_to_prot) (void);
23
void EXPORT_FUNC(grub_prot_to_real) (void);
24
#ifdef GRUB_MACHINE_PCBIOS
25
/* Turn on/off Gate A20. */
26
void EXPORT_FUNC(grub_gate_a20) (int on);
31
#define REAL_TO_PROT DATA32 lcall $0, $(EXT_C(grub_real_to_prot))
32
#define PROT_TO_REAL call EXT_C(grub_prot_to_real)
1
/* memory.h - describe the memory map */
3
* GRUB -- GRand Unified Bootloader
4
* Copyright (C) 2002,2007,2008,2009 Free Software Foundation, Inc.
6
* GRUB is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* GRUB is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef GRUB_MEMORY_CPU_HEADER
21
#define GRUB_MEMORY_CPU_HEADER 1
35
23
/* The flag for protected mode. */
36
24
#define GRUB_MEMORY_CPU_CR0_PE_ON 0x1
37
#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000040
25
#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000020
26
#define GRUB_MEMORY_CPU_CR4_PSE_ON 0x00000010
38
27
#define GRUB_MEMORY_CPU_CR0_PAGING_ON 0x80000000
39
28
#define GRUB_MEMORY_CPU_AMD64_MSR 0xc0000080
40
29
#define GRUB_MEMORY_CPU_AMD64_MSR_ON 0x00000100
33
#define GRUB_MMAP_MALLOC_LOW 1
35
#include <grub/types.h>
37
grub_uint64_t grub_mmap_get_upper (void);
38
grub_uint64_t grub_mmap_get_lower (void);
39
grub_uint64_t grub_mmap_get_post64 (void);
41
typedef grub_addr_t grub_phys_addr_t;
43
static inline grub_phys_addr_t
46
return (grub_phys_addr_t) a;
50
grub_map_memory (grub_phys_addr_t a, grub_size_t size __attribute__ ((unused)))
56
grub_unmap_memory (void *a __attribute__ ((unused)),
57
grub_size_t size __attribute__ ((unused)))
63
#endif /* ! GRUB_MEMORY_CPU_HEADER */