firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

eepy: replace manual slot calculation with slot_of_addr

arthomnix d316075f 416a7fae

+3 -3
+3 -3
eepy/src/syscall/kv_store.rs
··· 1 1 use core::hash::Hasher; 2 2 use siphasher::sip::SipHasher; 3 3 use tickv::{ErrorCode, TicKV}; 4 - use eepy_sys::header::{slot, SLOT_SIZE, XIP_BASE}; 4 + use eepy_sys::header::{slot, slot_of_addr}; 5 5 use eepy_sys::kv_store::{AppendKeyError, DeleteKeyError, KvStoreSyscall, PutKeyError, ReadKeyArgs, ReadKeyError, WriteKeyArgs}; 6 6 use eepy_sys::SafeResult; 7 7 use crate::exception::StackFrame; ··· 19 19 } 20 20 21 21 fn hash(stack_values: &mut StackFrame, key: &[u8]) -> u64 { 22 - let slot_number = (stack_values.pc as usize - XIP_BASE as usize) / SLOT_SIZE; 23 - let slot_header = unsafe { slot(slot_number as u8) }; 22 + let slot_number = slot_of_addr(stack_values.pc); 23 + let slot_header = unsafe { slot(slot_number) }; 24 24 let program_name = unsafe { core::slice::from_raw_parts((*slot_header).name_ptr, (*slot_header).name_len) }; 25 25 26 26 let mut hasher = SipHasher::new();