mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 22:53:04 +00:00
hv_exc: Add support for resetting stolen time delta
This is useful to re-sync AGX, since it shares the same timebase as the CPU. Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
8cd2865c1f
commit
b6d2cc127c
4 changed files with 7 additions and 5 deletions
|
@ -1018,8 +1018,8 @@ class M1N1Proxy(Reloadable):
|
|||
return self.request(self.P_HV_START_SECONDARY, cpu, entry, *args)
|
||||
def hv_switch_cpu(self, cpu):
|
||||
return self.request(self.P_HV_SWITCH_CPU, cpu)
|
||||
def hv_set_time_stealing(self, enabled):
|
||||
return self.request(self.P_HV_SET_TIME_STEALING, int(bool(enabled)))
|
||||
def hv_set_time_stealing(self, enabled, reset):
|
||||
return self.request(self.P_HV_SET_TIME_STEALING, int(bool(enabled)), int(bool(reset)))
|
||||
def hv_pin_cpu(self, cpu):
|
||||
return self.request(self.P_HV_PIN_CPU, cpu)
|
||||
|
||||
|
|
2
src/hv.h
2
src/hv.h
|
@ -70,7 +70,7 @@ void hv_map_vuart(u64 base, int irq, iodev_id_t iodev);
|
|||
|
||||
/* Exceptions */
|
||||
void hv_exc_proxy(struct exc_info *ctx, uartproxy_boot_reason_t reason, u32 type, void *extra);
|
||||
void hv_set_time_stealing(bool enabled);
|
||||
void hv_set_time_stealing(bool enabled, bool reset);
|
||||
|
||||
/* WDT */
|
||||
void hv_wdt_pet(void);
|
||||
|
|
|
@ -139,9 +139,11 @@ void hv_exc_proxy(struct exc_info *ctx, uartproxy_boot_reason_t reason, u32 type
|
|||
hv_maybe_switch_cpu(ctx, reason, type, extra);
|
||||
}
|
||||
|
||||
void hv_set_time_stealing(bool enabled)
|
||||
void hv_set_time_stealing(bool enabled, bool reset)
|
||||
{
|
||||
time_stealing = enabled;
|
||||
if (reset)
|
||||
stolen_time = 0;
|
||||
}
|
||||
|
||||
static void hv_update_fiq(void)
|
||||
|
|
|
@ -468,7 +468,7 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
|
|||
reply->retval = hv_switch_cpu(request->args[0]);
|
||||
break;
|
||||
case P_HV_SET_TIME_STEALING:
|
||||
hv_set_time_stealing(request->args[0]);
|
||||
hv_set_time_stealing(request->args[0], request->args[1]);
|
||||
break;
|
||||
case P_HV_PIN_CPU:
|
||||
hv_pin_cpu(request->args[0]);
|
||||
|
|
Loading…
Reference in a new issue