clang-format on most of kernel/

This commit is contained in:
Ben Vanik
2014-08-17 13:13:03 -07:00
parent 854bcdb60a
commit 1c4dcd5e0e
76 changed files with 2075 additions and 3169 deletions

View File

@@ -15,68 +15,56 @@
#include <xenia/kernel/objects/xevent.h>
#include <xenia/kernel/util/shim_utils.h>
namespace xe {
namespace kernel {
SHIM_CALL XMsgInProcessCall_shim(
PPCContext* ppc_state, KernelState* state) {
SHIM_CALL XMsgInProcessCall_shim(PPCContext* ppc_state, KernelState* state) {
uint32_t app = SHIM_GET_ARG_32(0);
uint32_t message = SHIM_GET_ARG_32(1);
uint32_t arg1 = SHIM_GET_ARG_32(2);
uint32_t arg2 = SHIM_GET_ARG_32(3);
XELOGD(
"XMsgInProcessCall(%.8X, %.8X, %.8X, %.8X)",
app, message, arg1, arg2);
XELOGD("XMsgInProcessCall(%.8X, %.8X, %.8X, %.8X)", app, message, arg1, arg2);
auto result = state->app_manager()->DispatchMessageSync(
app, message, arg1, arg2);
auto result =
state->app_manager()->DispatchMessageSync(app, message, arg1, arg2);
if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgInProcessCall: app %.8X undefined", app);
}
SHIM_SET_RETURN_32(result);
}
SHIM_CALL XMsgStartIORequest_shim(
PPCContext* ppc_state, KernelState* state) {
SHIM_CALL XMsgStartIORequest_shim(PPCContext* ppc_state, KernelState* state) {
uint32_t app = SHIM_GET_ARG_32(0);
uint32_t message = SHIM_GET_ARG_32(1);
uint32_t overlapped_ptr = SHIM_GET_ARG_32(2);
uint32_t buffer = SHIM_GET_ARG_32(3);
uint32_t buffer_length = SHIM_GET_ARG_32(4);
XELOGD(
"XMsgStartIORequest(%.8X, %.8X, %.8X, %.8X, %d)",
app, message, overlapped_ptr, buffer, buffer_length);
XELOGD("XMsgStartIORequest(%.8X, %.8X, %.8X, %.8X, %d)", app, message,
overlapped_ptr, buffer, buffer_length);
assert_zero(overlapped_ptr);
auto result = state->app_manager()->DispatchMessageAsync(
app, message, buffer, buffer_length);
auto result = state->app_manager()->DispatchMessageAsync(app, message, buffer,
buffer_length);
if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgStartIORequest: app %.8X undefined", app);
}
SHIM_SET_RETURN_32(result);
}
SHIM_CALL XMsgCancelIORequest_shim(
PPCContext* ppc_state, KernelState* state) {
SHIM_CALL XMsgCancelIORequest_shim(PPCContext* ppc_state, KernelState* state) {
uint32_t overlapped_ptr = SHIM_GET_ARG_32(0);
uint32_t wait = SHIM_GET_ARG_32(1);
XELOGD(
"XMsgCancelIORequest(%.8X, %d)",
overlapped_ptr, wait);
XELOGD("XMsgCancelIORequest(%.8X, %d)", overlapped_ptr, wait);
X_HANDLE event_handle = XOverlappedGetEvent(SHIM_MEM_ADDR(overlapped_ptr));
if (event_handle && wait) {
XEvent* ev = nullptr;
if (XSUCCEEDED(state->object_table()->GetObject(
event_handle, reinterpret_cast<XObject**>(&ev)))) {
event_handle, reinterpret_cast<XObject**>(&ev)))) {
ev->Wait(0, 0, true, nullptr);
ev->Release();
}
@@ -85,13 +73,11 @@ SHIM_CALL XMsgCancelIORequest_shim(
SHIM_SET_RETURN_32(0);
}
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterMsgExports(
ExportResolver* export_resolver, KernelState* state) {
void xe::kernel::xam::RegisterMsgExports(ExportResolver* export_resolver,
KernelState* state) {
SHIM_SET_MAPPING("xam.xex", XMsgInProcessCall, state);
SHIM_SET_MAPPING("xam.xex", XMsgStartIORequest, state);
SHIM_SET_MAPPING("xam.xex", XMsgCancelIORequest, state);