kernel: timeout: add syscall for runtime clk freq
If the system sets its clock frequency at runtime, this is stored in a variable that can't be directly read by user mode. For this case only, add a system call to fetch its value and modify the definition of sys_clock_hw_cycles_per_sec() to use it. Since this is now a system call, store in a temporary variable inside z_ms_to_ticks(). The syscall overhead only applies when called from user mode, other contexts are completely inlined. Added stub syscall header for mocking framework, to get rid of inclusion errors. Fixes: #16238 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
e541b16c54
commit
fd49cf7d02
3 changed files with 28 additions and 7 deletions
3
subsys/testsuite/ztest/include/syscalls/sys_clock.h
Normal file
3
subsys/testsuite/ztest/include/syscalls/sys_clock.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue