unknownbrackets / ps2autotests

A set of test programs run on a PS2, with accompanying results.
ISC License
25 stars 7 forks source link

Added tests for CreateVpl and pAllocateVpl #36

Closed jpd002 closed 8 years ago

jpd002 commented 8 years ago

Simple tests for CreateVpl and pAllocateVpl IOP functions. Requires an up to date PS2SDK to build properly (https://github.com/ps2dev/ps2sdk/pull/19).

unknownbrackets commented 8 years ago

Cool. Maybe I should add notes about the ps2sdk to the README...

I think I mentioned before, but there were some fun tricky issues with VPLs in PPSSPP. One game would double-free all the time, and it turned out that it completely relied on the exact allocation order of the firmware. There was very specific behavior when allocating after a free.

Is the "option" used for anything in vpl create? Maybe thread priority or something?

What's the difference between pAllocateVpl and AllocateVpl? I think ipAllocateVpl is related to interrupts, right?

-[Unknown]

jpd002 commented 8 years ago

I don't know if there's some funky issues like the one you're describing on the PS2, but that sounds really painful to debug. I guess that is the test you've created to verify the kernel's behavior on the PSP: https://github.com/hrydgard/pspautotests/blob/master/tests/threads/vpl/order.cpp.

AFAIK, the option parameter is only for arbitrary user data.

AllocateVpl will put the thread in a wait state till memory is available, while pAllocateVpl will return an error if there's no memory available. ipAllocateVpl is callable from an interrupt handler.

I'll add the ARRAY_SIZE macro and push an updated branch.

unknownbrackets commented 8 years ago

Yes, that's the one. It's a bit painful even looking at that test again, heh. I still don't know what startPlusSeven is for, maybe detecting memory corruption...

Ah, got it. Thanks.

-[Unknown]