Skip to content

Commit 1eef258

Browse files
committed
layout, main: Set identity mapping back to 4 GiB
It turns out we don't need MMIO devices above 4 GiB. Signed-off-by: Joe Richey <joerichey@google.com>
1 parent 11b01a5 commit 1eef258

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

layout.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ SECTIONS
3232

3333
firmware_ram_size = . - ram_min;
3434

35-
/* Memory for 64 GiB identity mapping, keep synced with ADDRESS_SPACE_GIB */
36-
identity_mapped_gbs = 64;
35+
/* Memory for identity mapping, keep synced with ADDRESS_SPACE_GIB */
36+
address_space_gib = 4;
3737
. = ALIGN(4K);
3838
pml2t = .;
39-
. += 4K * identity_mapped_gbs;
39+
. += 4K * address_space_gib;
4040

4141
ASSERT((. <= ram_max - stack_size), "firmware size too big for RAM region")
4242

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ fn panic(info: &PanicInfo) -> ! {
5252

5353
/// Setup page tables to provide an identity mapping over the full 4GiB range
5454
fn setup_pagetables() {
55-
const ADDRESS_SPACE_GIB: u64 = 64;
56-
type Page = [u64; 512];
55+
const ADDRESS_SPACE_GIB: u64 = 4;
56+
type PageTable = [u64; 512];
5757

5858
extern "C" {
59-
static pml3t: Page;
60-
static pml2t: [Page; ADDRESS_SPACE_GIB as usize];
59+
static pml3t: PageTable;
60+
static pml2t: [PageTable; ADDRESS_SPACE_GIB as usize];
6161
}
6262

6363
let pte = mem::MemoryRegion::from_slice(unsafe { &pml2t });

0 commit comments

Comments
 (0)