From 6d375727d91ed7f690719392accf39552350b915 Mon Sep 17 00:00:00 2001 From: Akira Moroo Date: Fri, 5 Mar 2021 17:13:40 +0900 Subject: [PATCH] build: Remove const_in_array_repeat_expressions The `const_in_array_repeat_expressions` feature has been removed from Rust [rust-lang/rust #80404](https://github.com/rust-lang/rust/pull/80404). Signed-off-by: Akira Moroo --- src/main.rs | 2 +- src/paging.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8de0c6eb..73b62825 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ // limitations under the License. #![feature(alloc_error_handler)] -#![feature(global_asm, const_in_array_repeat_expressions)] +#![feature(global_asm)] #![cfg_attr(not(test), no_std)] #![cfg_attr(not(test), no_main)] #![cfg_attr(test, allow(unused_imports, dead_code))] diff --git a/src/paging.rs b/src/paging.rs index 448ede42..d185dfd4 100644 --- a/src/paging.rs +++ b/src/paging.rs @@ -6,6 +6,7 @@ use x86_64::{ // Amount of memory we identity map in setup(), max 512 GiB. const ADDRESS_SPACE_GIB: usize = 4; +const TABLE: PageTable = PageTable::new(); // Put the Page Tables in static muts to make linking easier #[no_mangle] @@ -13,7 +14,7 @@ static mut L4_TABLE: PageTable = PageTable::new(); #[no_mangle] static mut L3_TABLE: PageTable = PageTable::new(); #[no_mangle] -static mut L2_TABLES: [PageTable; ADDRESS_SPACE_GIB] = [PageTable::new(); ADDRESS_SPACE_GIB]; +static mut L2_TABLES: [PageTable; ADDRESS_SPACE_GIB] = [TABLE; ADDRESS_SPACE_GIB]; pub fn setup() { // SAFETY: This function is idempontent and only writes to static memory and