mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-29 12:49:49 +00:00
Load buffer is now handled by the autoload() function.
This commit is contained in:
parent
205a7ad5e0
commit
022661283a
@ -24,6 +24,7 @@ Literature dealing with the network protocols:
|
||||
#include "cpu.h"
|
||||
#include "console.h"
|
||||
#include "init.h"
|
||||
#include "image.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef CONFIG_FILO
|
||||
@ -162,6 +163,8 @@ void initialise ( void ) {
|
||||
MAIN - Kick off routine
|
||||
**************************************************************************/
|
||||
int main ( void ) {
|
||||
struct image *image;
|
||||
void *image_context;
|
||||
int skip = 0;
|
||||
|
||||
/* Print out configuration */
|
||||
@ -214,21 +217,28 @@ int main ( void ) {
|
||||
}
|
||||
|
||||
/* Load boot file from the device */
|
||||
init_buffer ( &load_buffer );
|
||||
if ( ! load ( &dev, &load_buffer ) ) {
|
||||
if ( ! autoload ( &dev, &image, &image_context ) ) {
|
||||
/* Load (e.g. TFTP) failed */
|
||||
printf ( "...load failed\n" );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Boot the loaded image */
|
||||
if ( ! boot_image ( &load_buffer ) ) {
|
||||
/* Boot failed (e.g. invalid image) */
|
||||
/* Print out image information */
|
||||
printf ( "\nLoaded %s image\n", image->name );
|
||||
|
||||
/* Disable devices? */
|
||||
cleanup();
|
||||
/* arch_on_exit(0); */
|
||||
|
||||
/* Boot the image */
|
||||
if ( ! image->boot ( image_context ) ) {
|
||||
/* Boot failed */
|
||||
printf ( "...boot failed\n" );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Image returned */
|
||||
printf ( "...image returned\n" );
|
||||
}
|
||||
|
||||
/* Call registered per-object exit functions */
|
||||
|
Loading…
Reference in New Issue
Block a user