Postpone clearing the debug syslog buffer signature to the time when going

to start the kernel with the option disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35823 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-03-12 12:57:35 +00:00
parent a0b37b6e38
commit 6b110c63fd

View File

@ -98,9 +98,6 @@ debug_init_post_mmu(void)
size_t signatureLength = strlen(kDebugSyslogSignature);
bool recover = memcmp(buffer, kDebugSyslogSignature, signatureLength) == 0;
// clear the signature
memset(buffer, 0, signatureLength);
size -= signatureLength;
buffer = (uint8*)buffer + ROUNDUP(signatureLength, sizeof(void*));
@ -115,16 +112,25 @@ debug_init_post_mmu(void)
void
debug_cleanup(void)
{
if (gKernelArgs.keep_debug_output_buffer && sDebugSyslogBuffer != NULL) {
// copy the output gathered so far into the ring buffer
ring_buffer_clear(sDebugSyslogBuffer);
ring_buffer_write(sDebugSyslogBuffer, (uint8*)sBuffer, sBufferPosition);
// set the buffer signature, so we'll accept it as valid after reboot
if (sDebugSyslogBuffer != NULL) {
size_t signatureLength = strlen(kDebugSyslogSignature);
memcpy((void*)ROUNDDOWN((addr_t)sDebugSyslogBuffer, B_PAGE_SIZE),
kDebugSyslogSignature, signatureLength);
} else {
void* buffer
= (void*)ROUNDDOWN((addr_t)sDebugSyslogBuffer, B_PAGE_SIZE);
if (gKernelArgs.keep_debug_output_buffer) {
// copy the output gathered so far into the ring buffer
ring_buffer_clear(sDebugSyslogBuffer);
ring_buffer_write(sDebugSyslogBuffer, (uint8*)sBuffer, sBufferPosition);
memcpy(buffer, kDebugSyslogSignature, signatureLength);
} else {
// clear the signature
memset(buffer, 0, signatureLength);
}
} else
gKernelArgs.keep_debug_output_buffer = false;
if (!gKernelArgs.keep_debug_output_buffer) {
gKernelArgs.debug_output = kernel_args_malloc(sBufferPosition);
if (gKernelArgs.debug_output != NULL) {
memcpy(gKernelArgs.debug_output, sBuffer, sBufferPosition);