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

Subversion Repositories mlite

[/] [mlite/] [trunk/] [kernel/] [rtos.h] - Diff between revs 232 and 254

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

Rev 232 Rev 254
Line 38... Line 38...
   #define MemoryRead(A) (*(volatile uint32*)(A))
   #define MemoryRead(A) (*(volatile uint32*)(A))
   #define MemoryWrite(A,V) *(volatile uint32*)(A)=(V)
   #define MemoryWrite(A,V) *(volatile uint32*)(A)=(V)
#endif
#endif
 
 
/***************** LibC ******************/
/***************** LibC ******************/
#ifndef _LIBC
#if !defined(_LIBC) && !defined(_CTYPE_DEFINED)
#ifndef NULL
#ifndef NULL
#define NULL (void*)0
#define NULL (void*)0
#endif
#endif
 
 
#define assert(A) if((A)==0){OS_Assert();UartPrintfCritical("\r\nAssert %s:%d\r\n", __FILE__, __LINE__);}
#define assert(A) if((A)==0){OS_Assert();UartPrintfCritical("\r\nAssert %s:%d\r\n", __FILE__, __LINE__);}
Line 150... Line 150...
   #define OS_CpuIndex() 0
   #define OS_CpuIndex() 0
   #define OS_CriticalBegin() OS_AsmInterruptEnable(0)
   #define OS_CriticalBegin() OS_AsmInterruptEnable(0)
   #define OS_CriticalEnd(S) OS_AsmInterruptEnable(S)
   #define OS_CriticalEnd(S) OS_AsmInterruptEnable(S)
   #define OS_SpinLock() 0
   #define OS_SpinLock() 0
   #define OS_SpinUnlock(S) 
   #define OS_SpinUnlock(S) 
   #define OS_SpinCountGet() 0
 
   #define OS_SpinCountSet(S)
 
#else
#else
   // Symmetric multiprocessing
   // Symmetric multiprocessing
   uint32 OS_CpuIndex(void);
   uint32 OS_CpuIndex(void);
   #define OS_CriticalBegin() OS_SpinLock()
   #define OS_CriticalBegin() OS_SpinLock()
   #define OS_CriticalEnd(S) OS_SpinUnlock(S)
   #define OS_CriticalEnd(S) OS_SpinUnlock(S)
   uint32 OS_SpinLock(void);
   uint32 OS_SpinLock(void);
   void OS_SpinUnlock(uint32 state);
   void OS_SpinUnlock(uint32 state);
   uint32 OS_SpinCountGet(void);
 
   void OS_SpinCountSet(uint32 count);
 
   void OS_CpuInterrupt(uint32 cpuIndex, uint32 bitfield);
 
#endif
#endif
 
 
/***************** Thread *****************/
/***************** Thread *****************/
#ifdef WIN32
#ifdef WIN32
   #define STACK_SIZE_MINIMUM (1024*4)
   #define STACK_SIZE_MINIMUM (1024*4)
#else
#else
   #define STACK_SIZE_MINIMUM (1024*1)
   #define STACK_SIZE_MINIMUM (1024*1)
#endif
#endif
#define STACK_SIZE_DEFAULT 1024*2
#define STACK_SIZE_DEFAULT 1024*2
 
#undef THREAD_PRIORITY_IDLE
#define THREAD_PRIORITY_IDLE 0
#define THREAD_PRIORITY_IDLE 0
#define THREAD_PRIORITY_MAX 255
#define THREAD_PRIORITY_MAX 255
 
 
typedef void (*OS_FuncPtr_t)(void *arg);
typedef void (*OS_FuncPtr_t)(void *arg);
typedef struct OS_Thread_s OS_Thread_t;
typedef struct OS_Thread_s OS_Thread_t;
Line 185... Line 181...
                             uint32 stackSize);
                             uint32 stackSize);
void OS_ThreadExit(void);
void OS_ThreadExit(void);
OS_Thread_t *OS_ThreadSelf(void);
OS_Thread_t *OS_ThreadSelf(void);
void OS_ThreadSleep(int ticks);
void OS_ThreadSleep(int ticks);
uint32 OS_ThreadTime(void);
uint32 OS_ThreadTime(void);
void OS_ThreadInfoSet(OS_Thread_t *thread, void *info);
void OS_ThreadInfoSet(OS_Thread_t *thread, uint32 index, void *info);
void *OS_ThreadInfoGet(OS_Thread_t *thread);
void *OS_ThreadInfoGet(OS_Thread_t *thread, uint32 index);
uint32 OS_ThreadPriorityGet(OS_Thread_t *thread);
uint32 OS_ThreadPriorityGet(OS_Thread_t *thread);
void OS_ThreadPrioritySet(OS_Thread_t *thread, uint32 priority);
void OS_ThreadPrioritySet(OS_Thread_t *thread, uint32 priority);
void OS_ThreadProcessId(OS_Thread_t *thread, uint32 processId, OS_Heap_t *heap);
void OS_ThreadProcessId(OS_Thread_t *thread, uint32 processId, OS_Heap_t *heap);
void OS_ThreadTick(void *arg);
void OS_ThreadTick(void *arg);
void OS_ThreadCpuLock(OS_Thread_t *thread, int cpuIndex);
void OS_ThreadCpuLock(OS_Thread_t *thread, int cpuIndex);

powered by: WebSVN 2.1.0

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