OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [kernel/] [rtos_test.c] - Diff between revs 190 and 194

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 190 Rev 194
Line 381... Line 381...
         (int)(a*(float)1000.0), (int)(b*(float)1000.0));
         (int)(a*(float)1000.0), (int)(b*(float)1000.0));
   }
   }
}
}
#endif
#endif
 
 
 
//******************************************************************
 
#ifndef WIN32
 
static void MySyscall(void *arg)
 
{
 
   uint32 *stack = arg;
 
   stack[STACK_EPC] += 4;  //skip over SYSCALL
 
   printf("Inside MySyscall %d\n", stack[28/4]);
 
}
 
 
 
void TestSyscall(void)
 
{
 
   OS_InterruptRegister((uint32)(1<<31), MySyscall);
 
   OS_Syscall(57);
 
   OS_ThreadSleep(1);
 
   printf("Done\n");
 
}
 
#endif
 
 
#ifdef __MMU_ENUM_H__
#ifdef __MMU_ENUM_H__
void TestProcess(void)
void TestProcess(void)
{
{
   OS_Process_t *process;
   OS_Process_t *process;
   process = (OS_Process_t*)OS_HeapMalloc(NULL, sizeof(OS_Process_t));
   process = (OS_Process_t*)OS_HeapMalloc(NULL, sizeof(OS_Process_t));
Line 425... Line 443...
      printf("4 Semaphore\n");
      printf("4 Semaphore\n");
      printf("5 Mutex\n");
      printf("5 Mutex\n");
      printf("6 MQueue\n");
      printf("6 MQueue\n");
      printf("7 Timer\n");
      printf("7 Timer\n");
      printf("8 Math\n");
      printf("8 Math\n");
      //printf("9 Debugger\n");
      printf("9 Syscall\n");
#ifdef __MMU_ENUM_H__
#ifdef __MMU_ENUM_H__
      printf("p MMU Process\n");
      printf("p MMU Process\n");
#endif
#endif
      printf("> ");
      printf("> ");
      ch = UartRead();
      ch = UartRead();
Line 452... Line 470...
      case '5': TestMutex(); break;
      case '5': TestMutex(); break;
      case '6': TestMQueue(); break;
      case '6': TestMQueue(); break;
      case '7': TestTimer(); break;
      case '7': TestTimer(); break;
      case '8': TestMath(); break;
      case '8': TestMath(); break;
#ifndef WIN32
#ifndef WIN32
      //case '9': OS_DebuggerInit(); break;
      case '9': TestSyscall(); break;
#endif
#endif
#ifdef __MMU_ENUM_H__
#ifdef __MMU_ENUM_H__
      case 'p': TestProcess(); break;
      case 'p': TestProcess(); break;
#endif
#endif
#ifdef WIN32
#ifdef WIN32

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.