/*
 *               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 <types.h>
#include <sys.h>
#include <ioslibc.h>
#include <ios.h>
#include <iop.h>
#define STACK_SIZE 1024
const u8 _initStack[STACK_SIZE];
const u32 _initStackSize = sizeof(_initStack);
const u32 _initPriority = 10;

void
main(u32 arg)
{
  u32 n = 10;
  u32  i = 0;
  u32 end_time;
  u32 start_time;
  initSysMode(enhancedmode);
  start_time = busRd32(SYS_TIMER_REG);
  for (i = 0; i < n; ++i ) {
      udelay(100);
  }
  end_time = busRd32(SYS_TIMER_REG);
  printf("udelay(100 x 10): %u ticks\n", end_time - start_time);
  printf("expected ticks = %u\n", convertMicrosecondsToTicks(100)*10);
}
