boot loader: Wire up net_stack_cleanup()

Add a platform cleanup hook before starting the kernel. The openfirmware
and PXE loaders clean up their network stack there, while the other
loaders currently do nothing.

This closes ticket #6166

Change-Id: I34765892dfd9b2310c6af97c9ff7d414afae49e5
Reviewed-on: https://review.haiku-os.org/c/50
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Andreas Faerber
2019-03-26 20:25:19 +00:00
committed by waddlesplash
parent 8741bcf4f1
commit e1b41d44a3
9 changed files with 45 additions and 1 deletions
+1
View File
@@ -61,6 +61,7 @@ extern status_t platform_add_block_devices(struct stage2_args *args, NodeList *d
extern status_t platform_get_boot_partitions(struct stage2_args *args, Node *bootDevice,
NodeList *partitions, NodeList *bootPartitions);
extern status_t platform_register_boot_device(Node *device);
extern void platform_cleanup_devices();
/* menu functions */
+3 -1
View File
@@ -14,6 +14,7 @@
#include <boot/heap.h>
#include <boot/PathBlacklist.h>
#include <boot/stdio.h>
#include <boot/net/NetStack.h>
#include "file_systems/packagefs/packagefs.h"
@@ -146,7 +147,8 @@ main(stage2_args *args)
gKernelArgs.boot_volume = buffer;
gKernelArgs.boot_volume_size = gBootVolume.ContentSize();
// ToDo: cleanup, heap_release() etc.
platform_cleanup_devices();
// TODO: cleanup, heap_release() etc.
heap_print_statistics();
platform_start_kernel();
}
@@ -194,3 +194,8 @@ platform_register_boot_device(Node *device)
return B_OK;
}
void
platform_cleanup_devices()
{
}
@@ -1238,3 +1238,8 @@ platform_register_boot_device(Node *device)
return B_OK;
}
void
platform_cleanup_devices()
{
}
@@ -923,3 +923,8 @@ platform_register_boot_device(Node *device)
return B_OK;
}
void
platform_cleanup_devices()
{
}
+6
View File
@@ -522,3 +522,9 @@ platform_register_boot_device(Node *device)
return B_OK;
}
void
platform_cleanup_devices()
{
}
@@ -132,6 +132,13 @@ platform_get_boot_partitions(struct stage2_args *args, Node *device,
}
void
platform_cleanup_devices()
{
net_stack_cleanup();
}
#define DUMPED_BLOCK_SIZE 16
void
@@ -182,3 +182,10 @@ platform_register_boot_device(Node *device)
return B_OK;
}
void
platform_cleanup_devices()
{
net_stack_cleanup();
}
@@ -91,3 +91,9 @@ platform_register_boot_device(Node *device)
return B_OK;
}
void
platform_cleanup_devices()
{
}