mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
emulation: add RebootOnExpiry to wdt
When running the system without the UI, sometimes it's useful to avoid the WDT resetting the whole system. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
f9cf822efb
commit
7087b8f018
1 changed files with 7 additions and 3 deletions
|
|
@ -52,10 +52,13 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted
|
|||
private void OnTick()
|
||||
{
|
||||
Interlocked.Increment(ref counter);
|
||||
if (((uint)counter) >= this.reset_target)
|
||||
if ((((uint)counter) >= reset_target) && RebootOnExpiry)
|
||||
{
|
||||
this.Log(LogLevel.Error, "Watchdog timer expired -- requesting system reset");
|
||||
this.machine.RequestReset();
|
||||
machine.RequestReset();
|
||||
} else if (((uint)counter) == reset_target)
|
||||
{
|
||||
this.Log(LogLevel.Error, "Watchdog timer expired -- not rebooting because RebootOnExpiry is false");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +82,7 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted
|
|||
// Convert "approximately 65MHz" ticks to milliseconds
|
||||
private uint XilinxClockToMs(ulong xilinx_clocks)
|
||||
{
|
||||
uint adjusted = (uint)((xilinx_clocks * 100) / 65000000);
|
||||
uint adjusted = (uint)(xilinx_clocks * 100 / 65000000);
|
||||
this.Log(LogLevel.Debug, "Watchdog timer set for {0}. Will expire after {1} msec", xilinx_clocks, adjusted * 10);
|
||||
return adjusted;
|
||||
}
|
||||
|
|
@ -96,6 +99,7 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted
|
|||
private uint reset_target;
|
||||
private bool enabled;
|
||||
private readonly DoubleWordRegisterCollection registers;
|
||||
public bool RebootOnExpiry = true;
|
||||
private enum Registers
|
||||
{
|
||||
Watchdog = 0x0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue