You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pit.rs
    path of file: ./repos/kernel/src/arch/x86_64/kernel
    
    the code of the file until where you have to start completion: #![allow(dead_code)]

use x86::io::*;

use crate::arch::x86_64::kernel::pic;

const PIT_CLOCK: u64 = 1_193_182;
pub const PIT_INTERRUPT_NUMBER: u8 = pic::PIC1_INTERRUPT_OFFSET;

const PIT_CHANNEL0_DATA_PORT: u16 = 0x40;
const PIT_CHANNEL1_DATA_PORT: u16 = 0x41;
const PIT_CHANNEL2_DATA_PORT: u16 = 0x42;
const PIT_COMMAND_PORT: u16 = 0x43;

const PIT_BINARY_OUTPUT: u8 = 0b0000_0000;
const PIT_BCD_OUTPUT: u8 = 0b0000_0001;

const PIT_COUNTDOWN_MODE: u8 = 0b0000_0000;
const PIT_ONESHOT_MODE: 
    
pub fn init(frequency_in_hz: u64) {
	pic::unmask(PIT_INTERRUPT_NUMBER);

	unsafe {
		// Reset the Programmable Interval Timer (PIT).
		outb(
			PIT_COMMAND_PORT,
			PIT_BINARY_OUTPUT
				| PIT_RATE_GENERATOR_MODE
				| PIT_LOBYTE_ACCESS
				| PIT_HIBYTE_ACCESS
				| PIT_CHANNEL0,
		);

		// Calculate the reload value to count down (round it to the closest integer).
		// Then transmit it as two individual bytes to the PIT.
		let count = (PIT_CLOCK + frequency_in_hz / 2) / frequency_in_hz;
		outb(PIT_CHANNEL0_DATA_PORT, count as u8);
		outb(PIT_CHANNEL0_DATA_PORT, (count >> 8) as u8);
	}
}