/*
 *               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 <ios.h>
#include <lomem.h>
#include <ioslibc.h>

extern void iosFlushDCache(void *ptr, u32 bytes);

u32
setLoMemOSVersion(u32 version)
{
    u32 rv;
    OSLoMem *m = (OSLoMem *) RVL_LOMEM_BASE;
    rv = m->iosVersion;
    if (version && version != rv) {
        m->iosVersion = version;
        iosFlushDCache(&m->iosVersion, sizeof(u32));
        printf("Set OS version to %u\n", version);
    }
    printf("Returning old OS version %u\n", version);
    return rv;
}
