libsys/sef.c: cleanup around sef_exit

- use weak_alias for _exit and __exit instead of stub functions
 - remove fallback on PM_EXIT, as sys_exit can't fail, and we busy loop
   afterwards if that fails too. There is no reason that a PM_EXIT would
   work for a driver or server when sys_exit failed anyway.

Change-Id: I0327fb5c6fba25687cc9dc99fbf9c6d4db7d26e8
This commit is contained in:
Lionel Sambuc 2014-05-13 17:26:56 +02:00
parent a65d06ef80
commit f88b0001ba

View file

@ -230,35 +230,15 @@ void sef_exit(int status)
/* Ask the kernel to exit. */
sys_exit();
/* If sys_exit() fails, this is not a system service. Exit through PM. */
memset(&m, 0, sizeof(m));
m.PM_EXIT_STATUS = status;
_syscall(PM_PROC_NR, PM_EXIT, &m);
/* If everything else fails, hang. */
printf("Warning: system service %d couldn't exit\n", sef_self_endpoint);
for(;;) { }
}
/*===========================================================================*
* _exit *
*===========================================================================*/
void _exit(int status)
{
/* Make exit() an alias for sef_exit() for system services. */
sef_exit(status);
panic("sef_exit failed");
}
/*===========================================================================*
* __exit *
*===========================================================================*/
void __exit(int status)
{
/* Make exit() an alias for sef_exit() for system services. */
sef_exit(status);
panic("sef_exit failed");
}
#ifdef __weak_alias
__weak_alias(_exit, sef_exit);
__weak_alias(__exit, sef_exit);
#endif
#if SEF_INIT_DEBUG || SEF_LU_DEBUG || SEF_PING_DEBUG || SEF_SIGNAL_DEBUG
/*===========================================================================*