aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc_wrap.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-04 15:11:18 -0500
committerLioncash <mathew1800@gmail.com>2018-12-04 15:47:55 -0500
commit2a1f59b3017d6937138bfeacd9c04339f7d1526d (patch)
treedfff027340afbdd1d44498c02936528c1036e401 /src/core/hle/kernel/svc_wrap.h
parent465f486160b59c72a85b0f75aca310647b38155c (diff)
kernel/svc: Implement svcCreateEvent()
svcCreateEvent operates by creating both a readable and writable event and then attempts to add both to the current process' handle table. If adding either of the events to the handle table fails, then the relevant error from the handle table is returned. If adding the readable event after the writable event to the table fails, then the writable event is removed from the handle table and the relevant error from the handle table is returned. Note that since we do not currently test resource limits, we don't check the resource limit table yet.
Diffstat (limited to 'src/core/hle/kernel/svc_wrap.h')
-rw-r--r--src/core/hle/kernel/svc_wrap.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h
index fa1116624..24aef46c9 100644
--- a/src/core/hle/kernel/svc_wrap.h
+++ b/src/core/hle/kernel/svc_wrap.h
@@ -59,6 +59,19 @@ void SvcWrap() {
FuncReturn(retval);
}
+template <ResultCode func(u32*, u32*)>
+void SvcWrap() {
+ u32 param_1 = 0;
+ u32 param_2 = 0;
+ const u32 retval = func(&param_1, &param_2).raw;
+
+ auto& arm_interface = Core::CurrentArmInterface();
+ arm_interface.SetReg(1, param_1);
+ arm_interface.SetReg(2, param_2);
+
+ FuncReturn(retval);
+}
+
template <ResultCode func(u32*, u64)>
void SvcWrap() {
u32 param_1 = 0;