mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-23 02:42:09 +00:00
Stratosphere: Implement sm:->Initialize()
This commit is contained in:
parent
d0ef3b1c71
commit
61cbb0f86e
3 changed files with 15 additions and 4 deletions
|
@ -41,7 +41,8 @@ void __appInit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void __appExit(void) {
|
void __appExit(void) {
|
||||||
/* Nothing to clean up, because we're sm. */
|
/* Disconnect from ourselves. */
|
||||||
|
smExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -51,8 +52,13 @@ int main(int argc, char **argv)
|
||||||
/* TODO: What's a good timeout value to use here? */
|
/* TODO: What's a good timeout value to use here? */
|
||||||
WaitableManager *server_manager = new WaitableManager(U64_MAX);
|
WaitableManager *server_manager = new WaitableManager(U64_MAX);
|
||||||
|
|
||||||
/* Add services to manager. */
|
/* Create sm:, (and thus allow things to register to it). */
|
||||||
server_manager->add_waitable(new ManagedPortServer<UserService>("sm:", 0x40));
|
server_manager->add_waitable(new ManagedPortServer<UserService>("sm:", 0x40));
|
||||||
|
|
||||||
|
/* Initialize, connecting to ourself. */
|
||||||
|
smInitialize();
|
||||||
|
|
||||||
|
/* Create sm:m, using libnx to talk to ourself. */
|
||||||
server_manager->add_waitable(new ServiceServer<ManagerService>("sm:m", 1));
|
server_manager->add_waitable(new ServiceServer<ManagerService>("sm:m", 1));
|
||||||
|
|
||||||
/* Loop forever, servicing our services. */
|
/* Loop forever, servicing our services. */
|
||||||
|
|
|
@ -25,8 +25,8 @@ Result UserService::dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id,
|
||||||
|
|
||||||
|
|
||||||
std::tuple<Result> UserService::initialize(PidDescriptor pid) {
|
std::tuple<Result> UserService::initialize(PidDescriptor pid) {
|
||||||
/* TODO */
|
this->pid = pid.pid;
|
||||||
return std::make_tuple(0xF601);
|
return std::make_tuple(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::tuple<Result, MovedHandle> UserService::get_service(u64 service) {
|
std::tuple<Result, MovedHandle> UserService::get_service(u64 service) {
|
||||||
|
|
|
@ -10,8 +10,13 @@ enum UserServiceCmd {
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserService : IServiceObject {
|
class UserService : IServiceObject {
|
||||||
|
u64 pid;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size);
|
Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size);
|
||||||
|
UserService() {
|
||||||
|
this->pid = U64_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* Actual commands. */
|
/* Actual commands. */
|
||||||
|
|
Loading…
Reference in a new issue