Ticket #6166: 0003-Wire-up-net_stack_cleanup.patch

File 0003-Wire-up-net_stack_cleanup.patch, 1.2 KB (added by andreasf, 14 years ago)

proposed patch: wire up net_stack_cleanup()

  • src/system/boot/loader/main.cpp

    From 6fef95cd197003ab117d202c319c08bbad71c22a Mon Sep 17 00:00:00 2001
    From: Andreas Faerber <andreas.faerber@web.de>
    Date: Sun, 13 Jun 2010 17:00:45 +0200
    Subject: [PATCH 3/3] Wire up net_stack_cleanup()
    
    The NetStack.h header is currently not usable from C code. So while
    net_stack_init() is called from platform code, we cannot call
    net_stack_cleanup() from OpenFirmware's platform_start_kernel().
    Thus call it directly from main()'s cleanup TODO, having assured
    that the function is a no-op when no network stack was initialized.
    ---
     src/system/boot/loader/main.cpp |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/src/system/boot/loader/main.cpp b/src/system/boot/loader/main.cpp
    index db23ea9..d198d8f 100644
    a b  
    1313#include <boot/platform.h>
    1414#include <boot/heap.h>
    1515#include <boot/stdio.h>
     16#include <boot/net/NetStack.h>
    1617
    1718#include <util/kernel_cpp.h>
    1819
    main(stage2_args *args)  
    131132            memcpy(buffer, bootVolume.Buffer(), bootVolume.ContentSize());
    132133            bootVolume.SetTo(buffer, bootVolume.ContentSize());
    133134
     135            net_stack_cleanup();
    134136            // ToDo: cleanup, heap_release() etc.
    135137            platform_start_kernel();
    136138        }