-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys_sm_shutdown() log minor fixup #12836
Conversation
This is a root syscall, games can't call it. |
rpcs3/Emu/Cell/lv2/sys_sm.cpp
Outdated
} | ||
if (action == 0x200) | ||
{ | ||
Emu.Restart(); |
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.
This is very naive, this is a system reboot - not an application reboot.
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.
In the PS3 Dev Wiki site, it says:
int sys_sm_shutdown(uint16_t op, const void * lpar_parameter, uint64_t parameter_size )
0x1100/0x100 = turn off,
0x1200 = Lv2 Hard Reboot,
0x200 = Lv2 Soft Reboot,
0x8201 = load lpar id 1
0x8202 = load lpar id 2
0x8204 = load lpar id 3 (PS2_NETEMU)
so I think 0x100 and 0x200 are for graceful shutdown (Emu.GracefulShutdown()) and graceful reboot respectively, and 0x1100 and 0x1200 are for hard shutdown (Emu.Kill()) and hard reboot respectively.
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 I mean is that a reboot is not equivalent to Emu.Restart().
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.
Hmm. Is there any equivalent of a system reboot in RPCS3?
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 think an implementation of a reboot doesn't make much sense outside of VSH because of the HLE nature of this emulator and thus it should be handled only for 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.
But I can see GracefulShutdown(false, false);
is also called by Restart()
when !IsStopped()
in System.cpp.
I wonder if there is any more suitable implementation for this syscall.
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.
Since RPCS3 doesn't use something like system shutdown and system reboot, would it be fine to use game stop and game restart as an alternative?
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.
Well, VSH uses it to reboot itself (after rebuilding the database):
{PPU[0x1000000] Thread (main_thread) [sysconf_plugin: 0x01715fe8]} sys_sm TODO: sys_sm_shutdown(op=0x200, param=*0x0, size=0x0)
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.
@elad335 Would it be fine to simply redirect the shutdown request to sys_process_exit()?
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.
Well, leave the syscall as-is until there is more ideal implementation. |
sys_sm_shutdown() log minor fixup