55//! Usually, most Cortex-A based systems will require chip specific start-up code, so the
66//! start-up method can over overriden.
77//!
8+ //! The default startup routine provided by this crate does not include any special handling
9+ //! for multi-core support because this is oftentimes implementation defined and the exact
10+ //! handling depends on the specific chip in use. Many implementations only
11+ //! run the startup routine with one core and will keep other cores in reset until they are woken
12+ //! up by an implementation specific mechanism. For other implementations where multi-core
13+ //! specific startup adaptions are necessary, the startup routine can be overwritten by the user.
14+ //!
815//! ## Features
916//!
1017//! - `vfp-dp`: Enables support for the double-precision VFP floating point support. If your target
4451//!
4552//! ### Functions
4653//!
47- //! * `boot_core` - the `extern "C"` entry point to your application. The CPU ID
48- //! will be passed as the first argument to this function.
54+ //! * `kmain` - the `extern "C"` entry point to your application.
4955//!
5056//! Expected prototype:
5157//!
5258//! ```rust
5359//! #[unsafe(no_mangle)]
54- //! extern "C" fn boot_core(cpu_id: u32 ) -> !;
60+ //! extern "C" fn kmain( ) -> !;
5561//! ```
5662//!
5763//! * `_svc_handler` - an `extern "C"` function to call when an SVC Exception
141147//!
142148//! * `_vector_table` - the start of the interrupt vector table
143149//! * `_default_start` - the default Reset handler, that sets up some stacks and
144- //! calls an `extern "C"` function called `boot_core `.
150+ //! calls an `extern "C"` function called `kmain `.
145151//! * `_asm_default_fiq_handler` - an FIQ handler that just spins
146152//! * `_asm_default_handler` - an exception handler that just spins
147153//! * `_asm_svc_handler` - assembly language trampoline for SVC Exceptions that
@@ -543,7 +549,7 @@ macro_rules! fpu_enable {
543549
544550// Default start-up code for Armv7-A
545551//
546- // We set up our stacks and `boot_core ` in system mode.
552+ // We set up our stacks and `kmain ` in system mode.
547553core:: arch:: global_asm!(
548554 r#"
549555 .section .text.startup
@@ -552,25 +558,6 @@ core::arch::global_asm!(
552558 .global _default_start
553559 .type _default_start, %function
554560 _default_start:
555-
556- // only allow cpu0 through for initialization
557- // Read MPIDR
558- mrc p15,0,r1,c0,c0,5
559- // Extract CPU ID bits. For single-core systems, this should always be 0
560- and r1, r1, #0x3
561- cmp r1, #0
562- beq initialize
563- wait_loop:
564- wfe
565- // When Core 0 emits a SEV, the other cores will wake up.
566- // Load CPU ID, we are CPU0
567- mrc p15,0,r0,c0,c0,5
568- // Extract CPU ID bits.
569- and r0, r0, #0x3
570- bl boot_core
571- // Should never returns, loop permanently here.
572- b .
573- initialize:
574561 // Set up stacks.
575562 ldr r0, =_stack_top
576563 // Set stack pointer (right after) and mask interrupts for for UND mode (Mode 0x1B)
@@ -631,9 +618,7 @@ core::arch::global_asm!(
631618 b 0b
632619 1:
633620 // Jump to application
634- // Load CPU ID, we are CPU0
635- ldr r0, =0x0
636- bl boot_core
621+ bl kmain
637622 // In case the application returns, loop forever
638623 b .
639624 .size _default_start, . - _default_start
0 commit comments