/*
 *              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.
 *
 * Description:
 *      Cheesy implementation of rand()
 */

#include <types.h>

static u32 randseed = 0;

void
srand(u32 seed)
{
    randseed = seed;
}

u32
rand(void)
{
    randseed = randseed * 1103515245 + 12345;
    return (u32) ((randseed >> 16) & 0x7fff);
}
