/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */

#include <iostypes.h>
#include <hw.h>
#include <ioslibc.h>
#include <apputils.h>
#include <elf.h>

int
m_osrun(char *args, char *d)
{
    char *name;
    u32 rv = 0;
    u32 entry_point;
    if (getNextToken(&name, &args)) {
        if (elfload(name, &entry_point) > 0)
            (*(void (*)(void))(entry_point))();
        else 
           printf("Failed to load ELF file: %s or size = 0\n", name);
    }
    else 
        printf("Usage: osrun <filename>\n");
    return rv;
}
