-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements sys_fs_fcntl 0xC0000008 and 0xC000001A #11957
Conversation
fba5767
to
852163d
Compare
87b2716
to
e4ce382
Compare
@elad335 please review |
2ed420e
to
c9f3551
Compare
I added a free method to lv2_memory_container that serves as a sanity check. |
d0e381a
to
79f5721
Compare
rpcs3/Emu/Cell/lv2/sys_fs.cpp
Outdated
|
||
if (file->io_alloc_addr) | ||
{ | ||
sys_memory_free(ppu, file->io_alloc_addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not what I meant and altering user-memory area is a bad hack especially if coming from lv2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes done by taking and freeing memory should be observable as one by other threads, that's why I said adding the memory stats mutex lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it a bad hack when it's what happens on ps3?
It's meant to allocate memory from a user container...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LV2 memory has nothing to do with user memory. It's in totally diffetent address space. Where user memory is kept under 4GB barrier, LV2's is all about addressing space above it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And allotting more user memory than the game has allocated in user memory area may create a false memory shortage. Yes, it is possible to exhaust vm::user64k area with much less than 256mb of memory in special sequence of code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if take fails? usually LV2 reverts all changes upon failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It always frees the previously allocated memory even if the new allocation fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did, that's how I know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, than it's probably not atomic if it does it this way.
b44cbd5
to
d62088b
Compare
98798a8
to
602efe3
Compare
Closes #2928