Lines Matching refs:hip
54 static int hpet_start_main_counter(hpet_info_t *hip);
55 static int hpet_stop_main_counter(hpet_info_t *hip);
56 static uint64_t hpet_read_main_counter_value(hpet_info_t *hip);
57 static uint64_t hpet_set_leg_rt_cnf(hpet_info_t *hip, uint32_t new_value);
58 static uint64_t hpet_read_gen_cap(hpet_info_t *hip);
59 static uint64_t hpet_read_gen_config(hpet_info_t *hip);
60 static uint64_t hpet_read_gen_intrpt_stat(hpet_info_t *hip);
61 static uint64_t hpet_read_timer_N_config(hpet_info_t *hip, uint_t n);
63 static void hpet_write_gen_config(hpet_info_t *hip, uint64_t l);
64 static void hpet_write_gen_intrpt_stat(hpet_info_t *hip, uint64_t l);
65 static void hpet_write_timer_N_config(hpet_info_t *hip, uint_t n, uint64_t l);
66 static void hpet_write_timer_N_comp(hpet_info_t *hip, uint_t n, uint64_t l);
67 static void hpet_disable_timer(hpet_info_t *hip, uint32_t timer_n);
68 static void hpet_enable_timer(hpet_info_t *hip, uint32_t timer_n);
69 static int hpet_get_IOAPIC_intr_capable_timer(hpet_info_t *hip);
72 static void hpet_timer_set_up(hpet_info_t *hip, uint32_t timer_n,
521 hpet_start_main_counter(hpet_info_t *hip) in hpet_start_main_counter() argument
526 gcr_ptr = (uint64_t *)HPET_GEN_CONFIG_ADDRESS(hip->logical_address); in hpet_start_main_counter()
537 hpet_stop_main_counter(hpet_info_t *hip) in hpet_stop_main_counter() argument
542 gcr_ptr = (uint64_t *)HPET_GEN_CONFIG_ADDRESS(hip->logical_address); in hpet_stop_main_counter()
571 hpet_set_leg_rt_cnf(hpet_info_t *hip, uint32_t new_value) in hpet_set_leg_rt_cnf() argument
573 uint64_t gen_conf = hpet_read_gen_config(hip); in hpet_set_leg_rt_cnf()
588 hpet_write_gen_config(hip, gen_conf); in hpet_set_leg_rt_cnf()
593 hpet_read_gen_cap(hpet_info_t *hip) in hpet_read_gen_cap() argument
595 return (*(uint64_t *)HPET_GEN_CAP_ADDRESS(hip->logical_address)); in hpet_read_gen_cap()
599 hpet_read_gen_config(hpet_info_t *hip) in hpet_read_gen_config() argument
602 HPET_GEN_CONFIG_ADDRESS(hip->logical_address)); in hpet_read_gen_config()
606 hpet_read_gen_intrpt_stat(hpet_info_t *hip) in hpet_read_gen_intrpt_stat() argument
608 hip->gen_intrpt_stat = *(uint64_t *)HPET_GEN_INTR_STAT_ADDRESS( in hpet_read_gen_intrpt_stat()
609 hip->logical_address); in hpet_read_gen_intrpt_stat()
610 return (hip->gen_intrpt_stat); in hpet_read_gen_intrpt_stat()
614 hpet_read_timer_N_config(hpet_info_t *hip, uint_t n) in hpet_read_timer_N_config() argument
617 hip->logical_address, n); in hpet_read_timer_N_config()
618 hip->timer_n_config[n] = hpet_convert_timer_N_config(conf); in hpet_read_timer_N_config()
643 hpet_read_main_counter_value(hpet_info_t *hip) in hpet_read_main_counter_value() argument
649 counter = (uint32_t *)HPET_MAIN_COUNTER_ADDRESS(hip->logical_address); in hpet_read_main_counter_value()
654 if (hip->gen_cap.count_size_cap == 0) { in hpet_read_main_counter_value()
656 hip->main_counter_value = value; in hpet_read_main_counter_value()
672 hip->main_counter_value = value; in hpet_read_main_counter_value()
677 hpet_write_gen_config(hpet_info_t *hip, uint64_t l) in hpet_write_gen_config() argument
679 *(uint64_t *)HPET_GEN_CONFIG_ADDRESS(hip->logical_address) = l; in hpet_write_gen_config()
683 hpet_write_gen_intrpt_stat(hpet_info_t *hip, uint64_t l) in hpet_write_gen_intrpt_stat() argument
685 *(uint64_t *)HPET_GEN_INTR_STAT_ADDRESS(hip->logical_address) = l; in hpet_write_gen_intrpt_stat()
689 hpet_write_timer_N_config(hpet_info_t *hip, uint_t n, uint64_t conf) in hpet_write_timer_N_config() argument
698 hip->logical_address, n); in hpet_write_timer_N_config()
711 hpet_write_timer_N_comp(hpet_info_t *hip, uint_t n, uint64_t l) in hpet_write_timer_N_comp() argument
713 *(uint64_t *)HPET_TIMER_N_COMP_ADDRESS(hip->logical_address, n) = l; in hpet_write_timer_N_comp()
717 hpet_disable_timer(hpet_info_t *hip, uint32_t timer_n) in hpet_disable_timer() argument
721 l = hpet_read_timer_N_config(hip, timer_n); in hpet_disable_timer()
723 hpet_write_timer_N_config(hip, timer_n, l); in hpet_disable_timer()
727 hpet_enable_timer(hpet_info_t *hip, uint32_t timer_n) in hpet_enable_timer() argument
731 l = hpet_read_timer_N_config(hip, timer_n); in hpet_enable_timer()
733 hpet_write_timer_N_config(hip, timer_n, l); in hpet_enable_timer()
764 hpet_get_IOAPIC_intr_capable_timer(hpet_info_t *hip) in hpet_get_IOAPIC_intr_capable_timer() argument
770 timer < hip->gen_cap.num_tim_cap; ++timer) { in hpet_get_IOAPIC_intr_capable_timer()
771 if (!hpet_timer_available(hip->allocated_timers, timer)) in hpet_get_IOAPIC_intr_capable_timer()
774 intr = lowbit(hip->timer_n_config[timer].int_route_cap) - 1; in hpet_get_IOAPIC_intr_capable_timer()
780 hpet_timer_alloc(&hip->allocated_timers, timer); in hpet_get_IOAPIC_intr_capable_timer()
781 hip->cstate_timer.timer = timer; in hpet_get_IOAPIC_intr_capable_timer()
782 hip->cstate_timer.intr = intr; in hpet_get_IOAPIC_intr_capable_timer()
813 hpet_timer_set_up(hpet_info_t *hip, uint32_t timer_n, uint32_t interrupt) in hpet_timer_set_up() argument
821 conf = hpet_read_timer_N_config(hip, timer_n); in hpet_timer_set_up()
837 hpet_write_timer_N_config(hip, timer_n, conf); in hpet_timer_set_up()
859 hpet_timer_program(hpet_info_t *hip, uint32_t timer, uint64_t delta) in hpet_timer_program() argument
863 program = hpet_read_main_counter_value(hip); in hpet_timer_program()
865 hpet_write_timer_N_comp(hip, timer, program); in hpet_timer_program()
867 time = hpet_read_main_counter_value(hip); in hpet_timer_program()