mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
nova: avoid sc_ctrl syscalls on invalid caps
Avoids kernel log messages if TRACE_ERROR is enabled in kernel. Discovered during Turmvilla scenario #1552 and issue #1733.
This commit is contained in:
parent
7f1641e460
commit
94f64ef464
@ -53,9 +53,9 @@ namespace Genode {
|
||||
addr_t _sel_sc() const { return _id_base + 2; }
|
||||
|
||||
/* convenience function to access _feature variable */
|
||||
inline bool is_main_thread() { return _features & MAIN_THREAD; }
|
||||
inline bool is_vcpu() { return _features & VCPU; }
|
||||
inline bool is_worker() { return _features & WORKER; }
|
||||
inline bool is_main_thread() const { return _features & MAIN_THREAD; }
|
||||
inline bool is_vcpu() const { return _features & VCPU; }
|
||||
inline bool is_worker() const { return _features & WORKER; }
|
||||
|
||||
public:
|
||||
|
||||
|
@ -324,11 +324,15 @@ unsigned long long Platform_thread::execution_time() const
|
||||
unsigned long long time = 0;
|
||||
|
||||
/*
|
||||
* Ignore the return value, which indicates success only for global ECs.
|
||||
* For local ECs, we simply return 0 as local ECs are executed with the
|
||||
* time of their callers.
|
||||
*/
|
||||
(void) Nova::sc_ctrl(_sel_sc(), time);
|
||||
if (is_worker())
|
||||
return time;
|
||||
|
||||
uint8_t res = Nova::sc_ctrl(_sel_sc(), time);
|
||||
if (res != Nova::NOVA_OK)
|
||||
PDBG("sc_ctrl failed res=%x", res);
|
||||
|
||||
return time;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user