From 9e6ef76aeb4dc0562af52660c74d6f8a6ad77c31 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Wed, 28 Oct 2020 11:45:28 +0100 Subject: [PATCH] Make cortex-a platform specific dep --- 01_wait_forever/Cargo.toml | 4 ++++ 02_runtime_init/Cargo.toml | 4 ++++ 03_hacky_hello_world/Cargo.toml | 4 ++++ 04_zero_overhead_abstraction/Cargo.toml | 14 +++++++++---- 04_zero_overhead_abstraction/README.md | 16 ++++++-------- 05_safe_globals/Cargo.toml | 14 +++++++++---- 06_drivers_gpio_uart/Cargo.toml | 14 ++++++++++--- 06_drivers_gpio_uart/README.md | 21 ++++++++++++------- 07_uart_chainloader/Cargo.toml | 14 ++++++++++--- 08_timestamps/Cargo.toml | 14 ++++++++++--- 09_hw_debug_JTAG/Cargo.toml | 14 ++++++++++--- 10_privilege_level/Cargo.toml | 14 ++++++++++--- .../Cargo.toml | 14 ++++++++++--- 12_exceptions_part1_groundwork/Cargo.toml | 14 ++++++++++--- 13_integrated_testing/Cargo.toml | 13 +++++++++--- 13_integrated_testing/README.md | 11 ++++++---- .../Cargo.toml | 13 +++++++++--- 15_virtual_mem_part2_mmio_remap/Cargo.toml | 13 +++++++++--- X1_JTAG_boot/Cargo.toml | 14 ++++++++++--- 19 files changed, 177 insertions(+), 62 deletions(-) diff --git a/01_wait_forever/Cargo.toml b/01_wait_forever/Cargo.toml index d20cb37f..0595aa57 100644 --- a/01_wait_forever/Cargo.toml +++ b/01_wait_forever/Cargo.toml @@ -10,4 +10,8 @@ default = [] bsp_rpi3 = [] bsp_rpi4 = [] +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- + [dependencies] diff --git a/02_runtime_init/Cargo.toml b/02_runtime_init/Cargo.toml index d20cb37f..0595aa57 100644 --- a/02_runtime_init/Cargo.toml +++ b/02_runtime_init/Cargo.toml @@ -10,4 +10,8 @@ default = [] bsp_rpi3 = [] bsp_rpi4 = [] +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- + [dependencies] diff --git a/03_hacky_hello_world/Cargo.toml b/03_hacky_hello_world/Cargo.toml index d20cb37f..0595aa57 100644 --- a/03_hacky_hello_world/Cargo.toml +++ b/03_hacky_hello_world/Cargo.toml @@ -10,4 +10,8 @@ default = [] bsp_rpi3 = [] bsp_rpi4 = [] +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- + [dependencies] diff --git a/04_zero_overhead_abstraction/Cargo.toml b/04_zero_overhead_abstraction/Cargo.toml index 850ca5b0..c4b9e0b8 100644 --- a/04_zero_overhead_abstraction/Cargo.toml +++ b/04_zero_overhead_abstraction/Cargo.toml @@ -7,10 +7,16 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a"] -bsp_rpi4 = ["cortex-a"] +bsp_rpi3 = [] +bsp_rpi4 = [] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] -# Optional dependencies -cortex-a = { version = "4.x.x", optional = true } +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/04_zero_overhead_abstraction/README.md b/04_zero_overhead_abstraction/README.md index 40271ab1..19d66e55 100644 --- a/04_zero_overhead_abstraction/README.md +++ b/04_zero_overhead_abstraction/README.md @@ -13,19 +13,15 @@ diff -uNr 03_hacky_hello_world/Cargo.toml 04_zero_overhead_abstraction/Cargo.toml --- 03_hacky_hello_world/Cargo.toml +++ 04_zero_overhead_abstraction/Cargo.toml -@@ -7,7 +7,10 @@ - # The features section is used to select the target board. - [features] - default = [] --bsp_rpi3 = [] --bsp_rpi4 = [] -+bsp_rpi3 = ["cortex-a"] -+bsp_rpi4 = ["cortex-a"] +@@ -15,3 +15,8 @@ + ##-------------------------------------------------------------------------------------------------- [dependencies] + -+# Optional dependencies -+cortex-a = { version = "4.x.x", optional = true } ++# Platform specific dependencies ++[target.'cfg(target_arch = "aarch64")'.dependencies] ++cortex-a = { version = "4.x.x" } ++ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu/smp.rs 04_zero_overhead_abstraction/src/_arch/aarch64/cpu/smp.rs --- 03_hacky_hello_world/src/_arch/aarch64/cpu/smp.rs diff --git a/05_safe_globals/Cargo.toml b/05_safe_globals/Cargo.toml index 850ca5b0..c4b9e0b8 100644 --- a/05_safe_globals/Cargo.toml +++ b/05_safe_globals/Cargo.toml @@ -7,10 +7,16 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a"] -bsp_rpi4 = ["cortex-a"] +bsp_rpi3 = [] +bsp_rpi4 = [] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] -# Optional dependencies -cortex-a = { version = "4.x.x", optional = true } +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/06_drivers_gpio_uart/Cargo.toml b/06_drivers_gpio_uart/Cargo.toml index 82941512..33dbda85 100644 --- a/06_drivers_gpio_uart/Cargo.toml +++ b/06_drivers_gpio_uart/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/06_drivers_gpio_uart/README.md b/06_drivers_gpio_uart/README.md index 96ba5474..58d46e4c 100644 --- a/06_drivers_gpio_uart/README.md +++ b/06_drivers_gpio_uart/README.md @@ -94,20 +94,27 @@ $ sudo screen /dev/ttyUSB0 230400 diff -uNr 05_safe_globals/Cargo.toml 06_drivers_gpio_uart/Cargo.toml --- 05_safe_globals/Cargo.toml +++ 06_drivers_gpio_uart/Cargo.toml -@@ -7,10 +7,11 @@ +@@ -7,8 +7,8 @@ # The features section is used to select the target board. [features] default = [] --bsp_rpi3 = ["cortex-a"] --bsp_rpi4 = ["cortex-a"] -+bsp_rpi3 = ["cortex-a", "register"] -+bsp_rpi4 = ["cortex-a", "register"] +-bsp_rpi3 = [] +-bsp_rpi4 = [] ++bsp_rpi3 = ["register"] ++bsp_rpi4 = ["register"] + + ##-------------------------------------------------------------------------------------------------- + ## Dependencies +@@ -16,6 +16,9 @@ [dependencies] - # Optional dependencies - cortex-a = { version = "4.x.x", optional = true } ++# Optional dependencies +register = { version = "0.5.x", optional = true } ++ + # Platform specific dependencies + [target.'cfg(target_arch = "aarch64")'.dependencies] + cortex-a = { version = "4.x.x" } diff -uNr 05_safe_globals/src/_arch/aarch64/cpu.rs 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs --- 05_safe_globals/src/_arch/aarch64/cpu.rs diff --git a/07_uart_chainloader/Cargo.toml b/07_uart_chainloader/Cargo.toml index 82941512..33dbda85 100644 --- a/07_uart_chainloader/Cargo.toml +++ b/07_uart_chainloader/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/08_timestamps/Cargo.toml b/08_timestamps/Cargo.toml index 82941512..33dbda85 100644 --- a/08_timestamps/Cargo.toml +++ b/08_timestamps/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/09_hw_debug_JTAG/Cargo.toml b/09_hw_debug_JTAG/Cargo.toml index 82941512..33dbda85 100644 --- a/09_hw_debug_JTAG/Cargo.toml +++ b/09_hw_debug_JTAG/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/10_privilege_level/Cargo.toml b/10_privilege_level/Cargo.toml index 82941512..33dbda85 100644 --- a/10_privilege_level/Cargo.toml +++ b/10_privilege_level/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/11_virtual_mem_part1_identity_mapping/Cargo.toml b/11_virtual_mem_part1_identity_mapping/Cargo.toml index 82941512..33dbda85 100644 --- a/11_virtual_mem_part1_identity_mapping/Cargo.toml +++ b/11_virtual_mem_part1_identity_mapping/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/12_exceptions_part1_groundwork/Cargo.toml b/12_exceptions_part1_groundwork/Cargo.toml index 82941512..33dbda85 100644 --- a/12_exceptions_part1_groundwork/Cargo.toml +++ b/12_exceptions_part1_groundwork/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + diff --git a/13_integrated_testing/Cargo.toml b/13_integrated_testing/Cargo.toml index 4a4ca49b..7ec46f55 100644 --- a/13_integrated_testing/Cargo.toml +++ b/13_integrated_testing/Cargo.toml @@ -7,17 +7,24 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] qemu-exit = "1.0.x" test-types = { path = "test-types" } # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", features = ["no_std_unit_tests"], optional = true } +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + ##-------------------------------------------------------------------------------------------------- ## Testing ##-------------------------------------------------------------------------------------------------- diff --git a/13_integrated_testing/README.md b/13_integrated_testing/README.md index e4f87078..f98e558d 100644 --- a/13_integrated_testing/README.md +++ b/13_integrated_testing/README.md @@ -797,18 +797,21 @@ diff -uNr 12_exceptions_part1_groundwork/.cargo/config.toml 13_integrated_testin diff -uNr 12_exceptions_part1_groundwork/Cargo.toml 13_integrated_testing/Cargo.toml --- 12_exceptions_part1_groundwork/Cargo.toml +++ 13_integrated_testing/Cargo.toml -@@ -11,7 +11,35 @@ - bsp_rpi4 = ["cortex-a", "register"] +@@ -15,11 +15,38 @@ + ##-------------------------------------------------------------------------------------------------- [dependencies] +qemu-exit = "1.0.x" +test-types = { path = "test-types" } # Optional dependencies - cortex-a = { version = "4.x.x", optional = true } -register = { version = "0.5.x", optional = true } +register = { version = "0.5.x", features = ["no_std_unit_tests"], optional = true } -+ + + # Platform specific dependencies + [target.'cfg(target_arch = "aarch64")'.dependencies] + cortex-a = { version = "4.x.x" } + +##-------------------------------------------------------------------------------------------------- +## Testing +##-------------------------------------------------------------------------------------------------- diff --git a/14_exceptions_part2_peripheral_IRQs/Cargo.toml b/14_exceptions_part2_peripheral_IRQs/Cargo.toml index 4a4ca49b..7ec46f55 100644 --- a/14_exceptions_part2_peripheral_IRQs/Cargo.toml +++ b/14_exceptions_part2_peripheral_IRQs/Cargo.toml @@ -7,17 +7,24 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] qemu-exit = "1.0.x" test-types = { path = "test-types" } # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", features = ["no_std_unit_tests"], optional = true } +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + ##-------------------------------------------------------------------------------------------------- ## Testing ##-------------------------------------------------------------------------------------------------- diff --git a/15_virtual_mem_part2_mmio_remap/Cargo.toml b/15_virtual_mem_part2_mmio_remap/Cargo.toml index 4a4ca49b..7ec46f55 100644 --- a/15_virtual_mem_part2_mmio_remap/Cargo.toml +++ b/15_virtual_mem_part2_mmio_remap/Cargo.toml @@ -7,17 +7,24 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] qemu-exit = "1.0.x" test-types = { path = "test-types" } # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", features = ["no_std_unit_tests"], optional = true } +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } + ##-------------------------------------------------------------------------------------------------- ## Testing ##-------------------------------------------------------------------------------------------------- diff --git a/X1_JTAG_boot/Cargo.toml b/X1_JTAG_boot/Cargo.toml index 82941512..33dbda85 100644 --- a/X1_JTAG_boot/Cargo.toml +++ b/X1_JTAG_boot/Cargo.toml @@ -7,11 +7,19 @@ edition = "2018" # The features section is used to select the target board. [features] default = [] -bsp_rpi3 = ["cortex-a", "register"] -bsp_rpi4 = ["cortex-a", "register"] +bsp_rpi3 = ["register"] +bsp_rpi4 = ["register"] + +##-------------------------------------------------------------------------------------------------- +## Dependencies +##-------------------------------------------------------------------------------------------------- [dependencies] # Optional dependencies -cortex-a = { version = "4.x.x", optional = true } register = { version = "0.5.x", optional = true } + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] +cortex-a = { version = "4.x.x" } +