60 sceSifRegisterRpc(&cb_srv, PWROFF_IRX, &PowerOff_ee_rpc_handler, cb_rpc_buffer, NULL, NULL, &cb_queue);
68 static int _init_count = -1;
70 if (_init_count == _iop_reboot_count)
72 _init_count = _iop_reboot_count;
74 while (((res = sceSifBindRpc(&cd0, PWROFF_IRX, 0)) < 0) || (cd0.server == NULL))
78 if (powerOffThreadId >= 0)
80 TerminateThread(powerOffThreadId);
81 DeleteThread(powerOffThreadId);
82 sceSifRemoveRpc(&cb_srv, &cb_queue);
83 sceSifRemoveRpcQueue(&cb_queue);
84 powerOffThreadId = -1;
87 thread.initial_priority = POWEROFF_THREAD_PRIORITY;
88 thread.stack_size =
sizeof(poffThreadStack);
90 thread.func = PowerOffThread;
91 thread.stack = (
void *)poffThreadStack;
94 powerOffThreadId = CreateThread(&
thread);
95 StartThread(powerOffThreadId, NULL);
97 int autoShutdown[4] = {0};
98 sceSifCallRpc(&cd0, PWROFF_ENABLE_AUTO_SHUTOFF, 0, NULL, 0, autoShutdown,
sizeof(autoShutdown), NULL, NULL);