SPS2 - Direct PS2 Access Environment - Bugs


Summary |  Forums |  Bugs |  News |  Source |  Files | 

Submit A Bug | Open Bugs | Admin

[ Bug #123 ] iBlockOrder Variable Always Set to 0 in sps2Allocate Func

Date:
2004-May-12 12:33
Submitted By:
liquidjin
Assigned To:
Nobody
Category:
None
Priority:
5
Bug Group:
None
Resolution:
None
Summary:
iBlockOrder Variable Always Set to 0 in sps2Allocate Func

Original Submission:
In sps2lib.h:
FUNC:
static inline sps2Memory_t *sps2Allocate(
unsigned long ulSize,
int iMapOptions,
int iDeviceHandle
)

The variable iBlockOrder will never be set to 0, although there are multiple calculations involving the variable which show that this behavior is probably unexpected.

The code in question:

// we only have 8 bits maximum of map options
if (iMapOptions & (~0xff)) {
errno=-EINVAL;
return (sps2Memory_t *) -1;
}

iBlockOrder=iMapOptions & 7;

if (iBlockOrder > 0 || iBlockOrder<0) {
errno=-EINVAL;
return (sps2Memory_t *) -1;
}

iBlockSize=1 << (SPS2_PAGE_SHIFT+iBlockOrder);

while (iBlockOrder>0 && ulSize<=((unsigned int) iBlockSize >> 1)) {
iBlockSize>>=1;
iBlockOrder--;
}

iMapOptions &= ~7;
iMapOptions |= iBlockOrder;

Add A Comment:

You Are NOT Logged In

Please log in, so followups can be emailed to you.

If you cannot login, then enter your email address here:

Followups

Comment Date By
if you go into sps2mod you will see that the iBlockOrder variable is recalculated and the one in sps2Allocate is not used...2004-Sep-19 08:12Nobody

No Changes Have Been Made to This Bug