void Panic(const char *fmt, ...) { va_list args; va_start(args, fmt); os_panic(fmt, args); va_end(args); /* * Solaris's vcmn_err() is not marked as NORETURN and thus generates a * warning. I'd use NOT_REACHED(), as recommended, except that we are * already in Panic(). */ INFINITE_LOOP(); }
/*=========================================================================== FUNCTION OS_DPRINTF DESCRIPTION Print a string to debug console. Same implementation as os_printf. However, since the function gets a variable argument list, it is not possible to defer the call to os_prinf, and therefore the function needs to be implemented again. DEPENDENCIES RETURN VALUE None. SIDE EFFECTS None. ===========================================================================*/ void os_dprintf(const char *fmt, ...) { int32 result; static char debug_message[HSU_OS_MAX_MESSAGE_LENGTH]; va_list arg_list; /* Ensure NULL termination */ debug_message[sizeof(debug_message) - 1] = '\0'; /*lint -e{530} ** The ARM implementation of va_start raises a Lint error. */ va_start(arg_list, fmt); result = vsnprintf(debug_message, sizeof(debug_message) - 1, fmt, arg_list); va_end(arg_list); if (result < 0) { /* Under RexNT, it's not possible to distinguish whether ** _vsnprintf returned -1 because it really failed or because ** the input string was too long and was truncated. So, under ** RexNT we do noting in this case. */ #ifndef T_REXNT os_panic("os_dprintf Error - vsnprintf function failure."); #endif } else { HSU_MSG_HIGH(debug_message, 0, 0, 0); } } /* os_dprintf */
void os_out_of_memory (void) { os_panic (); }