Basic VM and other minor improvements.
Not complete, probably not fully debugged or optimized.
This commit is contained in:
@@ -19,9 +19,19 @@ int num; /* number to go with format string */
|
||||
* value of a defined constant.
|
||||
*/
|
||||
message m;
|
||||
endpoint_t me = NONE;
|
||||
char name[20];
|
||||
void (*suicide)(void);
|
||||
|
||||
if(panicing) return;
|
||||
panicing= 1;
|
||||
|
||||
if(sys_whoami(&me, name, sizeof(name)) == OK && me != NONE)
|
||||
printf("%s(%d): ", name, me);
|
||||
else
|
||||
printf("(sys_whoami failed): ");
|
||||
printf("syslib:panic.c: stacktrace: ");
|
||||
util_stacktrace();
|
||||
|
||||
if (NULL != who && NULL != mess) {
|
||||
if (num != NO_NUM) {
|
||||
printf("Panic in %s: %s: %d\n", who, mess, num);
|
||||
@@ -39,12 +49,10 @@ int num; /* number to go with format string */
|
||||
/* If exiting nicely through PM fails for some reason, try to
|
||||
* commit suicide. E.g., message to PM might fail due to deadlock.
|
||||
*/
|
||||
printf("panic: trying exception\n");
|
||||
suicide = (void (*)(void)) -1;
|
||||
suicide();
|
||||
|
||||
/* If committing suicide fails for some reason, hang. */
|
||||
printf("panic: for ever and ever\n");
|
||||
for(;;) { }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user