Misc fixes.

This commit is contained in:
Ben Vanik 2013-12-08 16:00:55 -08:00
parent 7c4b2c6d23
commit 60015afdc4
3 changed files with 34 additions and 7 deletions

View File

@ -592,7 +592,7 @@ int Translate_CALL_TRUE(TranslationContext& ctx, Instr* i) {
} }
uint32_t IntCode_CALL_INDIRECT_XX(IntCodeState& ics, const IntCode* i, uint32_t reg) { uint32_t IntCode_CALL_INDIRECT_XX(IntCodeState& ics, const IntCode* i, uint32_t reg) {
uint64_t target = ics.rf[reg].u64; uint64_t target = ics.rf[reg].u32;
// Check if return address - if so, return. // Check if return address - if so, return.
if (target == ics.return_address) { if (target == ics.return_address) {

View File

@ -1455,8 +1455,6 @@ Value* FunctionBuilder::Splat(Value* value, TypeName target_type) {
Value* FunctionBuilder::Permute( Value* FunctionBuilder::Permute(
Value* control, Value* value1, Value* value2, TypeName part_type) { Value* control, Value* value1, Value* value2, TypeName part_type) {
ASSERT_TYPES_EQUAL(value1, value2); ASSERT_TYPES_EQUAL(value1, value2);
// For now.
XEASSERT(part_type == INT32_TYPE || part_type == FLOAT32_TYPE);
// TODO(benvanik): could do some of this as constants. // TODO(benvanik): could do some of this as constants.

View File

@ -210,9 +210,38 @@ SHIM_CALL XexGetModuleHandle_shim(
// } // }
// SHIM_CALL XexGetProcedureAddress_shim( SHIM_CALL XexGetProcedureAddress_shim(
// PPCContext* ppc_state, KernelState* state) { PPCContext* ppc_state, KernelState* state) {
// } uint32_t module_handle = SHIM_GET_ARG_32(0);
uint32_t ordinal = SHIM_GET_ARG_32(1);
uint32_t out_function_ptr = SHIM_GET_ARG_32(2);
XELOGD(
"XexGetProcedureAddress(%.8X, %.8X, %.8X)",
module_handle, ordinal, out_function_ptr);
X_STATUS result = X_STATUS_INVALID_HANDLE;
XModule* module = NULL;
if (!module_handle) {
module = state->GetExecutableModule();
} else {
result = state->object_table()->GetObject(
module_handle, (XObject**)&module);
}
if (XSUCCEEDED(result)) {
// TODO(benvanik): implement. May need to create stub functions on the fly.
// module->GetProcAddressByOrdinal(ordinal);
result = X_STATUS_INVALID_HANDLE;
}
if (module) {
module->Release();
}
SHIM_SET_RETURN(result);
}
} // namespace xboxkrnl } // namespace xboxkrnl
@ -228,5 +257,5 @@ void xe::kernel::xboxkrnl::RegisterModuleExports(
SHIM_SET_MAPPING("xboxkrnl.exe", XexGetModuleHandle, state); SHIM_SET_MAPPING("xboxkrnl.exe", XexGetModuleHandle, state);
// SHIM_SET_MAPPING("xboxkrnl.exe", XexGetModuleSection, state); // SHIM_SET_MAPPING("xboxkrnl.exe", XexGetModuleSection, state);
// SHIM_SET_MAPPING("xboxkrnl.exe", XexGetProcedureAddress, state); SHIM_SET_MAPPING("xboxkrnl.exe", XexGetProcedureAddress, state);
} }