Skip to content

Commit 54f44be

Browse files
committed
hv_exc: Add hv_add_time() function & proxy thunk
Signed-off-by: Hector Martin <[email protected]>
1 parent 9e9693e commit 54f44be

5 files changed

Lines changed: 13 additions & 0 deletions

File tree

proxyclient/m1n1/proxy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ class M1N1Proxy(Reloadable):
600600
P_HV_MAP_VIRTIO = 0xc0d
601601
P_VIRTIO_PUT_BUFFER = 0xc0e
602602
P_HV_EXIT_CPU = 0xc0f
603+
P_HV_ADD_TIME = 0xc10
603604

604605
P_FB_INIT = 0xd00
605606
P_FB_SHUTDOWN = 0xd01
@@ -1047,6 +1048,8 @@ def virtio_put_buffer(self, base, qu, idx, length):
10471048
return self.request(self.P_VIRTIO_PUT_BUFFER, base, qu, idx, length)
10481049
def hv_exit_cpu(self, cpu=-1):
10491050
return self.request(self.P_HV_EXIT_CPU, cpu)
1051+
def hv_add_time(self, time):
1052+
return self.request(self.P_HV_ADD_TIME, time)
10501053

10511054
def fb_init(self):
10521055
return self.request(self.P_FB_INIT)

src/hv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ void virtio_put_buffer(u64 base, int qu, u32 id, u32 len);
7777
/* Exceptions */
7878
void hv_exc_proxy(struct exc_info *ctx, uartproxy_boot_reason_t reason, u32 type, void *extra);
7979
void hv_set_time_stealing(bool enabled, bool reset);
80+
void hv_add_time(s64 time);
8081

8182
/* WDT */
8283
void hv_wdt_pet(void);

src/hv_exc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ void hv_set_time_stealing(bool enabled, bool reset)
146146
stolen_time = 0;
147147
}
148148

149+
void hv_add_time(s64 time)
150+
{
151+
stolen_time -= (u64)time;
152+
}
153+
149154
static void hv_update_fiq(void)
150155
{
151156
u64 hcr = mrs(HCR_EL2);

src/proxy.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
496496
case P_HV_EXIT_CPU:
497497
hv_exit_cpu(request->args[0]);
498498
break;
499+
case P_HV_ADD_TIME:
500+
hv_add_time(request->args[0]);
501+
break;
499502

500503
case P_FB_INIT:
501504
fb_init(request->args[0]);

src/proxy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ typedef enum {
136136
P_HV_MAP_VIRTIO,
137137
P_VIRTIO_PUT_BUFFER,
138138
P_HV_EXIT_CPU,
139+
P_HV_ADD_TIME,
139140

140141
P_FB_INIT = 0xd00,
141142
P_FB_SHUTDOWN,

0 commit comments

Comments
 (0)