Example #1
0
int sv_test(void) 
{
	spinlock_t s = SPIN_LOCK_UNLOCKED;

	sv_init(&sv, &s, SV_MON_SPIN);
	printk("sv_test: starting sv_test_1_w.\n");
	kernel_thread(sv_test_1_w, &s, 0);
	printk("sv_test: starting sv_test_1_s.\n");
	kernel_thread(sv_test_1_s, &s, 0);

	printk("sv_test: waiting for talkback.\n");
	down(&talkback); down(&talkback);
	printk("sv_test: talkback happened, sv_destroying.\n");
	sv_destroy(&sv);

	count = 0;

	printk("sv_test: beginning big_test on sv.\n");

	sv_init(&sv, &monitor, SV_MON_SEMA);
	big_test(&sv);
	sv_destroy(&sv);

	printk("sv_test: beginning big_test on sv_filo.\n");
	sv_init(&sv_filo, &monitor, SV_MON_SEMA | SV_ORDER_FILO);
	big_test(&sv_filo);
	sv_destroy(&sv_filo);

	interrupt_test();

	printk("sv_test: done.\n");
	return 0;
}
Example #2
0
void
PRIVATE_TESTER_NAME::master_test
(
    char const *                              test_name,
    typename PRIVATE_TESTER_NAME::value_type  expected
)
{
    std::cout << "Doing test suite for " << test_name << '.' << std::endl;
    compute_test( expected );
    interrupt_test( expected );
    error_test();
}
Example #3
0
int main (void)
{
  int ret;

  printf("except_test\n");

  /* Register bus error handler */
  excpt_buserr = (unsigned long)bus_err_handler;

  /* Register illegal insn handler */
  excpt_illinsn = (unsigned long)ill_insn_handler;

  /* Register tick timer exception handler */
  excpt_tick = (unsigned long)tick_handler;

  /* Register external interrupt handler */
  excpt_int = (unsigned long)int_handler;

  /* Register ITLB miss handler */
  excpt_itlbmiss = (unsigned long)itlb_miss_handler;

  /* Register instruction page fault handler */
  excpt_ipfault = (unsigned long)ipage_fault_handler;

  /* Register DTLB miss handler */
  excpt_dtlbmiss = (unsigned long)dtlb_miss_handler;

  /* Register data page fault handler */
  excpt_dpfault = (unsigned long)dpage_fault_handler;

  /* Register trap handler */
  excpt_trap = (unsigned long)trap_handler;

  /* Register align handler */
  excpt_align = (unsigned long)align_handler;

  /* Register range handler */
  excpt_range = (unsigned long)range_handler;

  /* Exception basic test */
  ret = except_basic ();
  ASSERT(ret == 0);
printf("interupt_test\n");  
  /* Interrupt exception test */
  interrupt_test ();

printf("itlb_test\n");  
  /* ITLB exception test */
  itlb_test ();

printf("dtlb_test\n");
  /* DTLB exception test */
  dtlb_test ();

printf("buserr_test\n");
  /* Bus error exception test */
  buserr_test ();

printf("illegal_insn_test\n");
  /* Bus error exception test */
  /* Illegal insn test */
  illegal_insn_test ();

printf("align_test\n");
  /* Alignment test */
  align_test ();

printf("trap_test\n");
  /* Trap test */
  trap_test ();

printf("except_priority_test\n");
  /* Range test */
//  range_test ();

  /* Exception priority test */
  except_priority_test ();

  report (0xdeaddead);
  exit (0);
 
  return 0;
}