5
5
//! Usually, most Cortex-A based systems will require chip specific start-up code, so the
6
6
//! start-up method can over overriden.
7
7
//!
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
+ //!
8
15
//! ## Features
9
16
//!
10
17
//! - `vfp-dp`: Enables support for the double-precision VFP floating point support. If your target
44
51
//!
45
52
//! ### Functions
46
53
//!
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.
49
55
//!
50
56
//! Expected prototype:
51
57
//!
52
58
//! ```rust
53
59
//! #[unsafe(no_mangle)]
54
- //! extern "C" fn boot_core(cpu_id: u32 ) -> !;
60
+ //! extern "C" fn kmain( ) -> !;
55
61
//! ```
56
62
//!
57
63
//! * `_svc_handler` - an `extern "C"` function to call when an SVC Exception
141
147
//!
142
148
//! * `_vector_table` - the start of the interrupt vector table
143
149
//! * `_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 `.
145
151
//! * `_asm_default_fiq_handler` - an FIQ handler that just spins
146
152
//! * `_asm_default_handler` - an exception handler that just spins
147
153
//! * `_asm_svc_handler` - assembly language trampoline for SVC Exceptions that
@@ -543,7 +549,7 @@ macro_rules! fpu_enable {
543
549
544
550
// Default start-up code for Armv7-A
545
551
//
546
- // We set up our stacks and `boot_core ` in system mode.
552
+ // We set up our stacks and `kmain ` in system mode.
547
553
core:: arch:: global_asm!(
548
554
r#"
549
555
.section .text.startup
@@ -552,25 +558,6 @@ core::arch::global_asm!(
552
558
.global _default_start
553
559
.type _default_start, %function
554
560
_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:
574
561
// Set up stacks.
575
562
ldr r0, =_stack_top
576
563
// Set stack pointer (right after) and mask interrupts for for UND mode (Mode 0x1B)
@@ -631,9 +618,7 @@ core::arch::global_asm!(
631
618
b 0b
632
619
1:
633
620
// Jump to application
634
- // Load CPU ID, we are CPU0
635
- ldr r0, =0x0
636
- bl boot_core
621
+ bl kmain
637
622
// In case the application returns, loop forever
638
623
b .
639
624
.size _default_start, . - _default_start
0 commit comments