Lines Matching refs:hip
48 static int hpet_start_main_counter(hpet_info_t *hip);
49 static int hpet_stop_main_counter(hpet_info_t *hip);
50 static uint64_t hpet_read_main_counter_value(hpet_info_t *hip);
51 static uint64_t hpet_set_leg_rt_cnf(hpet_info_t *hip, uint32_t new_value);
52 static uint64_t hpet_read_gen_cap(hpet_info_t *hip);
53 static uint64_t hpet_read_gen_config(hpet_info_t *hip);
54 static uint64_t hpet_read_gen_intrpt_stat(hpet_info_t *hip);
55 static uint64_t hpet_read_timer_N_config(hpet_info_t *hip, uint_t n);
57 static void hpet_write_gen_config(hpet_info_t *hip, uint64_t l);
58 static void hpet_write_gen_intrpt_stat(hpet_info_t *hip, uint64_t l);
59 static void hpet_write_timer_N_config(hpet_info_t *hip, uint_t n, uint64_t l);
60 static void hpet_write_timer_N_comp(hpet_info_t *hip, uint_t n, uint64_t l);
61 static void hpet_disable_timer(hpet_info_t *hip, uint32_t timer_n);
62 static void hpet_enable_timer(hpet_info_t *hip, uint32_t timer_n);
63 static int hpet_get_IOAPIC_intr_capable_timer(hpet_info_t *hip);
66 static void hpet_timer_set_up(hpet_info_t *hip, uint32_t timer_n,
413 hpet_start_main_counter(hpet_info_t *hip) in hpet_start_main_counter() argument
418 gcr_ptr = (uint64_t *)HPET_GEN_CONFIG_ADDRESS(hip->logical_address); in hpet_start_main_counter()
429 hpet_stop_main_counter(hpet_info_t *hip) in hpet_stop_main_counter() argument
434 gcr_ptr = (uint64_t *)HPET_GEN_CONFIG_ADDRESS(hip->logical_address); in hpet_stop_main_counter()
451 hpet_set_leg_rt_cnf(hpet_info_t *hip, uint32_t new_value) in hpet_set_leg_rt_cnf() argument
453 uint64_t gen_conf = hpet_read_gen_config(hip); in hpet_set_leg_rt_cnf()
468 hpet_write_gen_config(hip, gen_conf); in hpet_set_leg_rt_cnf()
473 hpet_read_gen_cap(hpet_info_t *hip) in hpet_read_gen_cap() argument
475 return (*(uint64_t *)HPET_GEN_CAP_ADDRESS(hip->logical_address)); in hpet_read_gen_cap()
479 hpet_read_gen_config(hpet_info_t *hip) in hpet_read_gen_config() argument
482 HPET_GEN_CONFIG_ADDRESS(hip->logical_address)); in hpet_read_gen_config()
486 hpet_read_gen_intrpt_stat(hpet_info_t *hip) in hpet_read_gen_intrpt_stat() argument
488 hip->gen_intrpt_stat = *(uint64_t *)HPET_GEN_INTR_STAT_ADDRESS( in hpet_read_gen_intrpt_stat()
489 hip->logical_address); in hpet_read_gen_intrpt_stat()
490 return (hip->gen_intrpt_stat); in hpet_read_gen_intrpt_stat()
494 hpet_read_timer_N_config(hpet_info_t *hip, uint_t n) in hpet_read_timer_N_config() argument
497 hip->logical_address, n); in hpet_read_timer_N_config()
498 hip->timer_n_config[n] = hpet_convert_timer_N_config(conf); in hpet_read_timer_N_config()
523 hpet_read_main_counter_value(hpet_info_t *hip) in hpet_read_main_counter_value() argument
529 counter = (uint32_t *)HPET_MAIN_COUNTER_ADDRESS(hip->logical_address); in hpet_read_main_counter_value()
534 if (hip->gen_cap.count_size_cap == 0) { in hpet_read_main_counter_value()
536 hip->main_counter_value = value; in hpet_read_main_counter_value()
552 hip->main_counter_value = value; in hpet_read_main_counter_value()
557 hpet_write_gen_config(hpet_info_t *hip, uint64_t l) in hpet_write_gen_config() argument
559 *(uint64_t *)HPET_GEN_CONFIG_ADDRESS(hip->logical_address) = l; in hpet_write_gen_config()
563 hpet_write_gen_intrpt_stat(hpet_info_t *hip, uint64_t l) in hpet_write_gen_intrpt_stat() argument
565 *(uint64_t *)HPET_GEN_INTR_STAT_ADDRESS(hip->logical_address) = l; in hpet_write_gen_intrpt_stat()
569 hpet_write_timer_N_config(hpet_info_t *hip, uint_t n, uint64_t l) in hpet_write_timer_N_config() argument
571 if (hip->timer_n_config[n].size_cap == 1) in hpet_write_timer_N_config()
573 hip->logical_address, n) = l; in hpet_write_timer_N_config()
576 hip->logical_address, n) = (uint32_t)(0xFFFFFFFF & l); in hpet_write_timer_N_config()
580 hpet_write_timer_N_comp(hpet_info_t *hip, uint_t n, uint64_t l) in hpet_write_timer_N_comp() argument
582 *(uint64_t *)HPET_TIMER_N_COMP_ADDRESS(hip->logical_address, n) = l; in hpet_write_timer_N_comp()
586 hpet_disable_timer(hpet_info_t *hip, uint32_t timer_n) in hpet_disable_timer() argument
590 l = hpet_read_timer_N_config(hip, timer_n); in hpet_disable_timer()
592 hpet_write_timer_N_config(hip, timer_n, l); in hpet_disable_timer()
596 hpet_enable_timer(hpet_info_t *hip, uint32_t timer_n) in hpet_enable_timer() argument
600 l = hpet_read_timer_N_config(hip, timer_n); in hpet_enable_timer()
602 hpet_write_timer_N_config(hip, timer_n, l); in hpet_enable_timer()
633 hpet_get_IOAPIC_intr_capable_timer(hpet_info_t *hip) in hpet_get_IOAPIC_intr_capable_timer() argument
639 timer < hip->gen_cap.num_tim_cap; ++timer) { in hpet_get_IOAPIC_intr_capable_timer()
641 if (!hpet_timer_available(hip->allocated_timers, timer)) in hpet_get_IOAPIC_intr_capable_timer()
644 intr = lowbit(hip->timer_n_config[timer].int_route_cap) - 1; in hpet_get_IOAPIC_intr_capable_timer()
646 hpet_timer_alloc(&hip->allocated_timers, timer); in hpet_get_IOAPIC_intr_capable_timer()
647 hip->cstate_timer.timer = timer; in hpet_get_IOAPIC_intr_capable_timer()
648 hip->cstate_timer.intr = intr; in hpet_get_IOAPIC_intr_capable_timer()
679 hpet_timer_set_up(hpet_info_t *hip, uint32_t timer_n, uint32_t interrupt) in hpet_timer_set_up() argument
683 conf = hpet_read_timer_N_config(hip, timer_n); in hpet_timer_set_up()
696 hpet_write_timer_N_config(hip, timer_n, conf); in hpet_timer_set_up()
717 hpet_timer_program(hpet_info_t *hip, uint32_t timer, uint64_t delta) in hpet_timer_program() argument
721 program = hpet_read_main_counter_value(hip); in hpet_timer_program()
723 hpet_write_timer_N_comp(hip, timer, program); in hpet_timer_program()
725 time = hpet_read_main_counter_value(hip); in hpet_timer_program()