irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct rtc_time curr_time; unsigned long rtc_int_flag = 0; int call_rtc_interrupt = 0; hpet_rtc_timer_reinit(); if (UIE_on | AIE_on) { rtc_get_rtc_time(&curr_time); } if (UIE_on) { if (curr_time.tm_sec != prev_update_sec) { /* Set update int info, call real rtc int routine */ call_rtc_interrupt = 1; rtc_int_flag = RTC_UF; prev_update_sec = curr_time.tm_sec; } } if (PIE_on) { PIE_count++; if (PIE_count >= hpet_rtc_int_freq/PIE_freq) { /* Set periodic int info, call real rtc int routine */ call_rtc_interrupt = 1; rtc_int_flag |= RTC_PF; PIE_count = 0; } } if (AIE_on) { if ((curr_time.tm_sec == alarm_time.tm_sec) && (curr_time.tm_min == alarm_time.tm_min) && (curr_time.tm_hour == alarm_time.tm_hour)) { /* Set alarm int info, call real rtc int routine */ call_rtc_interrupt = 1; rtc_int_flag |= RTC_AF; } } if (call_rtc_interrupt) { rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8)); rtc_interrupt(rtc_int_flag, dev_id); } return IRQ_HANDLED; }
//0x36 void INT_RTC (void) { rtc_interrupt(); }