Skip to content

Commit

Permalink
proxy: Add EL0 SMP ops
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Martin <[email protected]>
  • Loading branch information
marcan committed Apr 9, 2024
1 parent 3b9a714 commit af6ca83
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions proxyclient/m1n1/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ class M1N1Proxy(Reloadable):
P_SMP_STOP_SECONDARIES = 0x506
P_SMP_CALL_EL1 = 0x507
P_SMP_CALL_SYNC_EL1 = 0x508
P_SMP_CALL_EL0 = 0x509
P_SMP_CALL_SYNC_EL0 = 0x50a

P_HEAPBLOCK_ALLOC = 0x600
P_MALLOC = 0x601
Expand Down Expand Up @@ -970,6 +972,14 @@ def smp_call_sync_el1(self, cpu, addr, *args):
if len(args) > 3:
raise ValueError("Too many arguments")
return self.request(self.P_SMP_CALL_SYNC_EL1, cpu, addr, *args)
def smp_call_el0(self, cpu, addr, *args):
if len(args) > 3:
raise ValueError("Too many arguments")
self.request(self.P_SMP_CALL_EL0, cpu, addr, *args)
def smp_call_sync_el0(self, cpu, addr, *args):
if len(args) > 3:
raise ValueError("Too many arguments")
return self.request(self.P_SMP_CALL_SYNC_EL0, cpu, addr, *args)

def heapblock_alloc(self, size):
return self.request(self.P_HEAPBLOCK_ALLOC, size)
Expand Down
9 changes: 9 additions & 0 deletions src/proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
request->args[3], request->args[4]);
reply->retval = smp_wait(request->args[0]);
break;
case P_SMP_CALL_EL0:
smp_call4(request->args[0], el0_call, request->args[1], request->args[2],
request->args[3], request->args[4]);
break;
case P_SMP_CALL_EL0_SYNC:
smp_call4(request->args[0], el0_call, request->args[1], request->args[2],
request->args[3], request->args[4]);
reply->retval = smp_wait(request->args[0]);
break;

case P_HEAPBLOCK_ALLOC:
reply->retval = (u64)heapblock_alloc(request->args[0]);
Expand Down
2 changes: 2 additions & 0 deletions src/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ typedef enum {
P_SMP_STOP_SECONDARIES,
P_SMP_CALL_EL1,
P_SMP_CALL_EL1_SYNC,
P_SMP_CALL_EL0,
P_SMP_CALL_EL0_SYNC,

P_HEAPBLOCK_ALLOC = 0x600, // Heap and memory management ops
P_MALLOC,
Expand Down

0 comments on commit af6ca83

Please sign in to comment.