MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / get_next_timer_choice

Function get_next_timer_choice

icicle-cortexm/src/unicorn_api.rs:438–455  ·  view source on GitHub ↗
(ctx: *mut c_void, choice: *mut u8)

Source from the content-addressed store, hash-verified

436pub const TIMER_CHOICE_ADDR: u64 = IRQ_NUMBER_ADDR + 4;
437
438pub unsafe extern "C" fn get_next_timer_choice(ctx: *mut c_void, choice: *mut u8) -> bool {
439 let ctx = &mut *ctx.cast::<Context>();
440 let vm = unsafe { &mut *ctx.vm };
441
442 let mut buf = [0];
443 if vm
444 .cpu
445 .mem
446 .get_io_memory_mut(ctx.io_handle.unwrap())
447 .read(TIMER_CHOICE_ADDR, &mut buf)
448 .is_err()
449 {
450 vm.cpu.exception = Exception::new(ExceptionCode::ReadWatch, TIMER_CHOICE_ADDR);
451 return false;
452 }
453 *choice = buf[0];
454 true
455}

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected