include/rv/ha_monitor.h
Source file repositories/reference/linux-study-clean/include/rv/ha_monitor.h
File Facts
- System
- Linux kernel
- Corpus path
include/rv/ha_monitor.h- Extension
.h- Size
- 18466 bytes
- Lines
- 562
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rv/automata.hrv/da_monitor.hlinux/seq_buf.h
Detected Declarations
function timerfunction ha_reactfunction ha_monitor_initfunction ha_monitor_destroyfunction ha_monitor_reset_all_storedfunction ha_monitor_init_envfunction ha_monitor_reset_envfunction ha_monitor_env_invalidfunction ha_get_env_stringfunction ha_trace_error_envfunction ha_trace_error_envfunction ha_handle_sched_process_exitfunction ha_monitor_handle_constraintfunction synchronize_rcufunction guardfunction ha_reset_clk_nsfunction ha_set_invariant_nsfunction ha_check_invariant_nsfunction ha_invariant_passed_nsfunction ha_get_clk_jiffyfunction ha_reset_clk_jiffyfunction ha_set_invariant_jiffyfunction ha_check_invariant_jiffyfunction ha_invariant_passed_jiffyfunction timefunction ha_monitor_timer_callbackfunction ha_setup_timerfunction ha_start_timer_jiffyfunction ha_start_timer_nsfunction ha_cancel_timerfunction ha_cancel_timer_syncfunction ha_monitor_timer_callbackfunction ha_setup_timerfunction ha_start_timer_nsfunction ha_start_timer_jiffyfunction ha_cancel_timerfunction ha_cancel_timer_syncfunction ha_setup_timerfunction ha_cancel_timer_sync
Annotated Snippet
static void ha_react(enum states curr_state, enum events event, char *env) { }
#endif
/*
* model_get_state_name - return the (string) name of the given state
*/
static char *model_get_env_name(enum envs env)
{
if ((env < 0) || (env >= ENV_MAX))
return "INVALID";
return RV_AUTOMATON_NAME.env_names[env];
}
/*
* Monitors requiring a timer implementation need to request it explicitly.
*/
#ifndef HA_TIMER_TYPE
#define HA_TIMER_TYPE HA_TIMER_NONE
#endif
#if HA_TIMER_TYPE == HA_TIMER_WHEEL
static void ha_monitor_timer_callback(struct timer_list *timer);
#elif HA_TIMER_TYPE == HA_TIMER_HRTIMER
static enum hrtimer_restart ha_monitor_timer_callback(struct hrtimer *hrtimer);
#endif
/*
* ktime_get_ns is expensive, since we usually don't require precise accounting
* of changes within the same event, cache the current time at the beginning of
* the constraint handler and use the cache for subsequent calls.
* Monitors without ns clocks automatically skip this.
*/
#ifdef HA_CLK_NS
#define ha_get_ns() ktime_get_ns()
#else
#define ha_get_ns() 0
#endif /* HA_CLK_NS */
static bool ha_mon_destroying;
static int ha_monitor_init(void)
{
int ret;
WRITE_ONCE(ha_mon_destroying, false);
ret = da_monitor_init();
if (ret == 0)
ha_monitor_enable_hook();
return ret;
}
static void ha_monitor_destroy(void)
{
WRITE_ONCE(ha_mon_destroying, true);
ha_monitor_disable_hook();
da_monitor_destroy();
}
/* Should be supplied by the monitor */
static u64 ha_get_env(struct ha_monitor *ha_mon, enum envs env, u64 time_ns);
static bool ha_verify_constraint(struct ha_monitor *ha_mon,
enum states curr_state,
enum events event,
enum states next_state,
u64 time_ns);
/*
* ha_monitor_reset_all_stored - reset all environment variables in the monitor
*/
static inline void ha_monitor_reset_all_stored(struct ha_monitor *ha_mon)
{
for (int i = 0; i < ENV_MAX_STORED; i++)
WRITE_ONCE(ha_mon->env_store[i], ENV_INVALID_VALUE);
}
/*
* ha_monitor_init_env - setup timer and reset all environment
*
* Called from a hook in the DA start functions, it supplies the da_mon
* corresponding to the current ha_mon.
* Not all hybrid automata require the timer, still set it for simplicity.
*/
static inline void ha_monitor_init_env(struct da_monitor *da_mon)
{
struct ha_monitor *ha_mon = to_ha_monitor(da_mon);
ha_monitor_reset_all_stored(ha_mon);
ha_setup_timer(ha_mon);
}
Annotation
- Immediate include surface: `rv/automata.h`, `rv/da_monitor.h`, `linux/seq_buf.h`.
- Detected declarations: `function timer`, `function ha_react`, `function ha_monitor_init`, `function ha_monitor_destroy`, `function ha_monitor_reset_all_stored`, `function ha_monitor_init_env`, `function ha_monitor_reset_env`, `function ha_monitor_env_invalid`, `function ha_get_env_string`, `function ha_trace_error_env`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.