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