<commit_before>/**
 * @file
 * @brief Link layer between timers and clock sources.
 *
 * @date 09.07.2012
 * @author <NAME>
 */

#include <embox/unit.h>
#include <kernel/time/clock_source.h>
#include <kernel/time/timer.h>
#include <kernel/softirq.h>

EMBOX_UNIT_INIT(init);

extern struct clock_source jiffies;
extern cycle_t volatile sys_ticks;

/**
 * Handling of the clock tick.
 */
void clock_tick_handler(int irq_num, void *dev_id) {
	if (irq_num == jiffies.event_device->irq_nr) {
		sys_ticks++;
		softirq_raise(SOFTIRQ_NR_TIMER);
	}
}

static void soft_clock_handler(unsigned int softirq_nr, void *data) {
	timer_strat_sched();
}<commit_msg>fixed: timer tick's handling before jiffies initializing<commit_after>/**
 * @file
 * @brief Link layer between timers and clock sources.
 *
 * @date 09.07.2012
 * @author <NAME>
 */

#include <embox/unit.h>
#include <kernel/time/clock_source.h>
#include <kernel/time/timer.h>
#include <kernel/softirq.h>

EMBOX_UNIT_INIT(init);

extern struct clock_source jiffies;
extern cycle_t volatile sys_ticks;

/**
 * Handling of the clock tick.
 */
void clock_tick_handler(int irq_num, void *dev_id) {
	if (jiffies.event_device && irq_num == jiffies.event_device->irq_nr) {
		sys_ticks++;
		softirq_raise(SOFTIRQ_NR_TIMER);
	}
}

static void soft_clock_handler(unsigned int softirq_nr, void *data) {
	timer_strat_sched();
}
{'fraction_non_alphanumeric': 0.12986060161408658, 'fraction_numerical': 0.01173881144534116, 'mean_word_length': 4.982456140350878, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1272456', 'n_tokens_mistral': 533, 'n_tokens_neox': 509, 'n_words': 115}