Rename frequency() -> timer_frequency()

This commit is contained in:
Baptiste Wicht 2016-08-10 19:14:45 +02:00
parent 63437983eb
commit b08c84dbc4
6 changed files with 10 additions and 10 deletions

View File

@ -40,12 +40,12 @@ void tick();
/*!
* \brief Return the frequency in Hz of the current timer system.
*/
uint64_t frequency();
uint64_t timer_frequency();
/*!
* \brief Sets the frequency in Hz of the current timer system.
*/
void frequency(uint64_t freq);
void timer_frequency(uint64_t freq);
} //end of timer namespace

View File

@ -152,7 +152,7 @@ void hpet::late_install(){
// Update the current frequency (this will update the sleeping task as well)
timer::frequency(current_frequency);
timer::timer_frequency(current_frequency);
// Uninstall the PIT driver
pit::remove();

View File

@ -29,7 +29,7 @@ bool pit::install(){
out_byte(0x40, static_cast<uint8_t>(divisor >> 8));
// Indicate the timer frequency
timer::frequency(1000);
timer::timer_frequency(1000);
if(!interrupt::register_irq_handler(0, timer_handler, nullptr)){
logging::logf(logging::log_level::ERROR, "Unable to register PIT IRQ handler 0\n");

View File

@ -875,7 +875,7 @@ void scheduler::sleep_ms(pid_t pid, size_t time){
thor_assert(pcb[pid].state == process_state::RUNNING, "Only RUNNING processes can sleep");
// Compute the amount of ticks to sleep
auto sleep_ticks = time * (timer::frequency() / 1000);
auto sleep_ticks = time * (timer::timer_frequency() / 1000);
sleep_ticks = !sleep_ticks ? 1 : sleep_ticks;
logging::logf(logging::log_level::DEBUG, "Put %u to sleep for %u ticks\n", pid, sleep_ticks);

View File

@ -167,7 +167,7 @@ void AcpiOsSleep(UINT64 ms){
*/
void AcpiOsStall(UINT32 us){
auto ticks = timer::ticks();
auto wait = us * (timer::frequency() / 1000000);
auto wait = us * (timer::timer_frequency() / 1000000);
wait = !wait ? 1 : wait;
while(timer::ticks() != ticks + wait){

View File

@ -59,11 +59,11 @@ void timer::tick(){
scheduler::tick();
if(_timer_ticks % frequency() == 0){
if(_timer_ticks % timer_frequency() == 0){
++_timer_seconds;
}
if(_timer_ticks % (frequency() / 1000) == 0){
if(_timer_ticks % (timer_frequency() / 1000) == 0){
++_timer_milliseconds;
}
}
@ -80,11 +80,11 @@ uint64_t timer::milliseconds(){
return _timer_milliseconds;
}
uint64_t timer::frequency(){
uint64_t timer::timer_frequency(){
return _timer_frequency;
}
void timer::frequency(uint64_t freq){
void timer::timer_frequency(uint64_t freq){
auto old_frequency = _timer_frequency;
_timer_frequency = freq;