|  | @@ -205,6 +205,12 @@ pub(crate) struct SbiHsm;
 | 
	
		
			
				|  |  |  impl rustsbi::Hsm for SbiHsm {
 | 
	
		
			
				|  |  |      /// Starts execution on a stopped hart.
 | 
	
		
			
				|  |  |      fn hart_start(&self, hartid: usize, start_addr: usize, opaque: usize) -> SbiRet {
 | 
	
		
			
				|  |  | +        let hart_enable = unsafe { PLATFORM.info.cpu_enabled.unwrap() };
 | 
	
		
			
				|  |  | +        let enabled = hart_enable.get(hartid).copied().unwrap_or(false);
 | 
	
		
			
				|  |  | +        if !enabled {
 | 
	
		
			
				|  |  | +            return SbiRet::invalid_param();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          match remote_hsm(hartid) {
 | 
	
		
			
				|  |  |              Some(remote) => {
 | 
	
		
			
				|  |  |                  if remote.start(NextStage {
 | 
	
	
		
			
				|  | @@ -238,6 +244,12 @@ impl rustsbi::Hsm for SbiHsm {
 | 
	
		
			
				|  |  |      /// Gets the current state of a hart.
 | 
	
		
			
				|  |  |      #[inline]
 | 
	
		
			
				|  |  |      fn hart_get_status(&self, hartid: usize) -> SbiRet {
 | 
	
		
			
				|  |  | +        let hart_enable = unsafe { PLATFORM.info.cpu_enabled.unwrap() };
 | 
	
		
			
				|  |  | +        let enabled = hart_enable.get(hartid).copied().unwrap_or(false);
 | 
	
		
			
				|  |  | +        if !enabled {
 | 
	
		
			
				|  |  | +            return SbiRet::invalid_param();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          match remote_hsm(hartid) {
 | 
	
		
			
				|  |  |              Some(remote) => SbiRet::success(remote.get_status()),
 | 
	
		
			
				|  |  |              None => SbiRet::invalid_param(),
 |