Re: Triggering Z_SYSCALL_HANDLER calls


Boie, Andrew P
 

You need to call the API from user mode in order to exercise the handler functions. If you call the APIs from supervisor mode, the software interrupt and handler function are bypassed and control goes directly into the implementation function.

 

HTH,

Andrew

 

From: devel@... [mailto:devel@...] On Behalf Of Ooi, Cinly
Sent: Wednesday, March 20, 2019 5:24 AM
To: devel@...
Subject: [Zephyr-devel] Triggering Z_SYSCALL_HANDLER calls

 

Dear All

 

I am trying to write some coverage test to cover  Z_SYSCALL_HANDLERs and I need some clue on how to start.  I know I have to set CONFIG_USERSPACE.

 

 

Normally for  Z_SYSCALL_HANDLER(funcA), gcov reports that  z_impl_funcA() were called, but the line Z_SYSCALL_HANDLER() might not be called. This is despite other Z_SYSCALL_HANDLER() are called. I see this in kernel/timer.c where

(1) Z_SYSCALL_HANDLER(k_timer_status_get) and z_impl_k_timer_status_get() were both being called, but

(2) Z_SYSCALL_HANDLER(k_timer_stop) not called but z_impl_k_timer_stop() was called

 

Many thanks in advance

Cinly

Join devel@lists.zephyrproject.org to automatically receive all group messages.