Removing 64bit return type and cleaning up some SHIM* stuff pre-refactor.

This commit is contained in:
Ben Vanik
2015-05-29 17:12:30 -07:00
parent 0a83b49744
commit a4edb7f9e1
11 changed files with 71 additions and 79 deletions

View File

@@ -18,7 +18,7 @@ namespace kernel {
using PPCContext = xe::cpu::frontend::PPCContext;
#define SHIM_CALL void _cdecl
#define SHIM_CALL void _cdecl
#define SHIM_SET_MAPPING(library_name, export_name, shim_data) \
export_resolver->SetFunctionMapping( \
library_name, ordinals::##export_name, shim_data, \
@@ -35,22 +35,12 @@ using PPCContext = xe::cpu::frontend::PPCContext;
#define SHIM_SET_MEM_16(a, v) xe::store_and_swap<uint16_t>(SHIM_MEM_ADDR(a), v)
#define SHIM_SET_MEM_32(a, v) xe::store_and_swap<uint32_t>(SHIM_MEM_ADDR(a), v)
#define SHIM_SET_MEM_64(a, v) xe::store_and_swap<uint64_t>(SHIM_MEM_ADDR(a), v)
#define SHIM_SET_MEM_F32(a, v) xe::store_and_swap<float>(SHIM_MEM_ADDR(a), v)
#define SHIM_SET_MEM_F64(a, v) xe::store_and_swap<double>(SHIM_MEM_ADDR(a), v)
#define SHIM_GPR_8(n) (uint8_t)(ppc_state->r[n])
#define SHIM_GPR_16(n) (uint16_t)(ppc_state->r[n])
#define SHIM_GPR_32(n) (uint32_t)(ppc_state->r[n])
#define SHIM_SET_GPR_32(n, v) ppc_state->r[n] = (uint64_t)((v) & UINT32_MAX)
#define SHIM_GPR_64(n) ppc_state->r[n]
#define SHIM_SET_GPR_64(n, v) ppc_state->r[n] = (uint64_t)(v)
#define SHIM_GET_ARG_8(n) SHIM_GPR_8(3 + n)
#define SHIM_GET_ARG_16(n) SHIM_GPR_16(3 + n)
#define SHIM_GET_ARG_32(n) SHIM_GPR_32(3 + n)
#define SHIM_GET_ARG_64(n) SHIM_GPR_64(3 + n)
#define SHIM_SET_RETURN_32(v) SHIM_SET_GPR_64(3, (uint64_t)(int32_t)v)
#define SHIM_SET_RETURN_64(v) SHIM_SET_GPR_64(3, v)
#define SHIM_GET_ARG_8(n) (uint8_t)(ppc_state->r[3 + n])
#define SHIM_GET_ARG_16(n) (uint16_t)(ppc_state->r[3 + n])
#define SHIM_GET_ARG_32(n) (uint32_t)(ppc_state->r[3 + n])
#define SHIM_GET_ARG_64(n) ppc_state->r[3 + n]
#define SHIM_SET_RETURN_32(v) ppc_state->r[3] = (uint64_t)((int32_t)v)
#define SHIM_STRUCT(type, address) \
reinterpret_cast<type*>(SHIM_MEM_ADDR(address))