Skip to content

Commit

Permalink
SPURS: More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gopalsr83 committed Feb 19, 2015
1 parent 796d96f commit 68978a0
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 110 deletions.
12 changes: 12 additions & 0 deletions Utilities/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,18 @@ bool get_x64_reg_value(x64_context* context, x64_reg_t reg, size_t d_size, size_
case 8: out_value = (u64)imm_value; return true; // sign-extended
}
}
else if (reg == X64_IMM16)
{
// load the immediate value (assuming it's at the end of the instruction)
out_value = *(s16*)(RIP(context) + i_size - 2);
return true;
}
else if (reg == X64_IMM8)
{
// load the immediate value (assuming it's at the end of the instruction)
out_value = *(s8*)(RIP(context) + i_size - 1);
return true;
}
else if (reg == X64R_ECX)
{
out_value = (u32)RCX(context);
Expand Down
28 changes: 14 additions & 14 deletions rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2767,7 +2767,7 @@ s64 spursCreateTask(vm::ptr<CellSpursTaskset> taskset, vm::ptr<u32> task_id, vm:
alloc_ls_blocks = context_size > 0x3D400 ? 0x7A : ((context_size - 0x400) >> 11);
if (ls_pattern.addr() != 0)
{
u128 ls_pattern_128 = u128::from64r(ls_pattern->_u64[1], ls_pattern->_u64[0]);
u128 ls_pattern_128 = u128::from64r(ls_pattern->_u64[0], ls_pattern->_u64[1]);
u32 ls_blocks = 0;
for (auto i = 0; i < 128; i++)
{
Expand Down Expand Up @@ -2870,19 +2870,19 @@ s64 cellSpursCreateTask(vm::ptr<CellSpursTaskset> taskset, vm::ptr<u32> taskId,

vm::var<u32> tmpTaskId;
auto rc = spursCreateTask(taskset, tmpTaskId, vm::ptr<u32>::make(elf_addr), vm::ptr<u32>::make(context_addr), context_size, lsPattern, argument);
if (rc != CELL_OK)
{
return rc;
}

rc = spursTaskStart(taskset, tmpTaskId);
if (rc != CELL_OK)
{
return rc;
}

*taskId = tmpTaskId;
return CELL_OK;
if (rc != CELL_OK)
{
return rc;
}

rc = spursTaskStart(taskset, tmpTaskId);
if (rc != CELL_OK)
{
return rc;
}

*taskId = tmpTaskId;
return CELL_OK;
#endif
}

Expand Down
52 changes: 26 additions & 26 deletions rpcs3/Emu/SysCalls/Modules/cellSpurs.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,32 +929,32 @@ static_assert(sizeof(SpursKernelContext) == 0x190, "Incorrect size for SpursKern
// The SPURS taskset policy module context. This resides at 0x2700 of the LS.
struct SpursTasksetContext
{
u8 tempAreaTaskset[0x80]; // 0x2700
u8 tempAreaTaskInfo[0x30]; // 0x2780
be_t<u64> x27B0; // 0x27B0
vm::bptr<CellSpursTaskset, 1, u64> taskset; // 0x27B8
be_t<u32> kernelMgmtAddr; // 0x27C0
be_t<u32> syscallAddr; // 0x27C4
be_t<u32> x27C8; // 0x27C8
be_t<u32> spuNum; // 0x27CC
be_t<u32> dmaTagId; // 0x27D0
be_t<u32> taskId; // 0x27D4
u8 x27D8[0x2840 - 0x27D8]; // 0x27D8
u8 moduleId[16]; // 0x2840
u8 stackArea[0x2C80 - 0x2850]; // 0x2850
be_t<u128> savedContextLr; // 0x2C80
be_t<u128> savedContextSp; // 0x2C90
be_t<u128> savedContextR80ToR127[48]; // 0x2CA0
be_t<u128> savedContextFpscr; // 0x2FA0
be_t<u32> savedWriteTagGroupQueryMask; // 0x2FB0
be_t<u32> savedSpuWriteEventMask; // 0x2FB4
be_t<u32> tasksetMgmtAddr; // 0x2FB8
be_t<u32> guidAddr; // 0x2FBC
be_t<u64> x2FC0; // 0x2FC0
be_t<u64> x2FC8; // 0x2FC8
be_t<u32> taskExitCode; // 0x2FD0
be_t<u32> x2FD4; // 0x2FD4
u8 x2FD8[0x3000 - 0x2FD8]; // 0x2FD8
u8 tempAreaTaskset[0x80]; // 0x2700
u8 tempAreaTaskInfo[0x30]; // 0x2780
be_t<u64> x27B0; // 0x27B0
vm::bptr<CellSpursTaskset, 1, u64> taskset; // 0x27B8
be_t<u32> kernelMgmtAddr; // 0x27C0
be_t<u32> syscallAddr; // 0x27C4
be_t<u32> x27C8; // 0x27C8
be_t<u32> spuNum; // 0x27CC
be_t<u32> dmaTagId; // 0x27D0
be_t<u32> taskId; // 0x27D4
u8 x27D8[0x2840 - 0x27D8]; // 0x27D8
u8 moduleId[16]; // 0x2840
u8 stackArea[0x2C80 - 0x2850]; // 0x2850
be_t<u128> savedContextLr; // 0x2C80
be_t<u128> savedContextSp; // 0x2C90
be_t<u128> savedContextR80ToR127[48]; // 0x2CA0
be_t<u128> savedContextFpscr; // 0x2FA0
be_t<u32> savedWriteTagGroupQueryMask; // 0x2FB0
be_t<u32> savedSpuWriteEventMask; // 0x2FB4
be_t<u32> tasksetMgmtAddr; // 0x2FB8
be_t<u32> guidAddr; // 0x2FBC
be_t<u64> x2FC0; // 0x2FC0
be_t<u64> x2FC8; // 0x2FC8
be_t<u32> taskExitCode; // 0x2FD0
be_t<u32> x2FD4; // 0x2FD4
u8 x2FD8[0x3000 - 0x2FD8]; // 0x2FD8
};

static_assert(sizeof(SpursTasksetContext) == 0x900, "Incorrect size for SpursTasksetContext");
Expand Down
Loading

0 comments on commit 68978a0

Please sign in to comment.