check core before looking for kernel image

This commit is contained in:
mwojcik 2022-10-10 16:04:07 +08:00
parent 401bc6bcb3
commit 4034be5da8
1 changed files with 5 additions and 1 deletions

View File

@ -5,11 +5,13 @@ use alloc::borrow::ToOwned;
use log::{debug, info, error}; use log::{debug, info, error};
use cslice::CSlice; use cslice::CSlice;
use libregister::RegisterR;
use libcortex_a9::{ use libcortex_a9::{
enable_fpu, enable_fpu,
cache::{dcci_slice, iciallu, bpiall}, cache::{dcci_slice, iciallu, bpiall},
asm::{dsb, isb}, asm::{dsb, isb},
sync_channel, sync_channel,
regs::MPIDR
}; };
use libboard_zynq::{mpcore, gic}; use libboard_zynq::{mpcore, gic};
use libsupport_zynq::ram; use libsupport_zynq::ram;
@ -219,7 +221,9 @@ extern fn dl_unwind_find_exidx(pc: *const u32, len_ptr: *mut u32) -> *const u32
let length; let length;
let start: *const EXIDX_Entry; let start: *const EXIDX_Entry;
unsafe { unsafe {
if &__text_start as *const u32 <= pc && pc < &__text_end as *const u32 { let id = MPIDR.read().cpu_id() as usize;
// try to look up kernel for core 1 only
if (&__text_start as *const u32 <= pc && pc < &__text_end as *const u32) || id == 0 {
length = (&__exidx_end as *const EXIDX_Entry).offset_from(&__exidx_start) as u32; length = (&__exidx_end as *const EXIDX_Entry).offset_from(&__exidx_start) as u32;
start = &__exidx_start; start = &__exidx_start;
} else { } else {