FreeNOS
ARM64Timer.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Ivan Tan
3 * Copyright (C) 2019 Niek Linnenbank
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <FreeNOS/System.h>
20#include "ARM64Control.h"
21#include "ARM64Timer.h"
22
24 : m_initialTimerCounter(0)
25{
26 m_int = ARMTIMER_IRQ;
27}
28
35
41
47
55
virtual Result setFrequency(const Size hertz)
Set timer frequency.
void setPL1PhysicalTimerValue(const u32 value)
Set Physical Timer 1 value.
void setPL1PhysicalTimerControl(const u32 value)
Set Physical Timer 1 control value.
virtual Result tick()
Process timer tick.
static const u32 TimerControlEnable
Set this bit in the PL1 control register to enable it.
Definition ARM64Timer.h:45
ARM64Timer()
Constructor.
u32 getSystemFrequency(void) const
Retrieve system timer frequency.
Size m_initialTimerCounter
Currently configured initial timer counter.
Definition ARM64Timer.h:99
virtual Result tick()
Process timer tick.
Definition Timer.cpp:74
Size m_int
Timer interrupt number.
Definition Timer.h:165
Result
Result codes.
Definition Timer.h:53
virtual Result setFrequency(Size hertz)
Set timer frequency.
Definition Timer.cpp:38
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
unsigned long long u64
Unsigned 64-bit number.
Definition Types.h:50
u64 read(Register reg)
Read a register from the CP15.
void write(Register reg, u64 value)
Write register to the CP15.