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

Subversion Repositories mlite

[/] [mlite/] [trunk/] [kernel/] [rtos.h] - Diff between revs 150 and 166

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

Rev 150 Rev 166
Line 17... Line 17...
#define scanf      UartScanf
#define scanf      UartScanf
#ifndef WIN32
#ifndef WIN32
#define malloc(S)  OS_HeapMalloc(NULL, S)
#define malloc(S)  OS_HeapMalloc(NULL, S)
#define free(S)    OS_HeapFree(S)
#define free(S)    OS_HeapFree(S)
#endif
#endif
 
#define OS_CPU_COUNT 1 //Symmetric Multi-Processing
 
 
// Typedefs
// Typedefs
typedef unsigned int   uint32;
typedef unsigned int   uint32;
typedef unsigned short uint16;
typedef unsigned short uint16;
typedef unsigned char  uint8;
typedef unsigned char  uint8;
Line 77... Line 78...
int sscanf(char *s, const char *format, ...);
int sscanf(char *s, const char *format, ...);
#endif
#endif
#define _LIBC
#define _LIBC
#endif
#endif
 
 
 
 
/***************** Assembly **************/
/***************** Assembly **************/
#define OS_CriticalBegin() OS_AsmInterruptEnable(0)
 
#define OS_CriticalEnd(S) OS_AsmInterruptEnable(S)
 
typedef uint32 jmp_buf[20];
typedef uint32 jmp_buf[20];
extern uint32 OS_AsmInterruptEnable(uint32 state);
extern uint32 OS_AsmInterruptEnable(uint32 state);
extern void OS_AsmInterruptInit(void);
extern void OS_AsmInterruptInit(void);
extern int setjmp(jmp_buf env);
extern int setjmp(jmp_buf env);
extern void longjmp(jmp_buf env, int val);
extern void longjmp(jmp_buf env, int val);
Line 102... Line 100...
void OS_HeapFree(void *Block);
void OS_HeapFree(void *Block);
void OS_HeapAlternate(OS_Heap_t *Heap, OS_Heap_t *Alternate);
void OS_HeapAlternate(OS_Heap_t *Heap, OS_Heap_t *Alternate);
void OS_HeapRegister(void *Index, OS_Heap_t *Heap);
void OS_HeapRegister(void *Index, OS_Heap_t *Heap);
 
 
/***************** Thread *****************/
/***************** Thread *****************/
 
#if OS_CPU_COUNT <= 1
 
#define OS_CpuIndex() 0
 
#define OS_CriticalBegin() OS_AsmInterruptEnable(0)
 
#define OS_CriticalEnd(S) OS_AsmInterruptEnable(S)
 
#define OS_SpinLock() 0
 
#define OS_SpinUnlock(S) 
 
#define OS_SpinLockGet() 0
 
#define OS_SpinLockSet(S)
 
#else
 
uint32 OS_CpuIndex(void);
 
#define OS_CriticalBegin() OS_SpinLock()
 
#define OS_CriticalEnd(S) OS_SpinUnlock(S)
 
uint32 OS_SpinLock(void);
 
void OS_SpinUnlock(uint32 state);
 
uint32 OS_SpinLockGet(void);
 
void OS_SpinLockSet(uint32 count);
 
#endif
 
 
#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
#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;
OS_Thread_t *OS_ThreadCreate(const char *Name,
OS_Thread_t *OS_ThreadCreate(const char *Name,
                             OS_FuncPtr_t FuncPtr,
                             OS_FuncPtr_t FuncPtr,
                             void *Arg,
                             void *Arg,
Line 189... Line 206...
void UartReadData(uint8 *Data, int Length);
void UartReadData(uint8 *Data, int Length);
#ifndef NO_ELLIPSIS2
#ifndef NO_ELLIPSIS2
void UartPrintf(const char *format, ...);
void UartPrintf(const char *format, ...);
void UartPrintfPoll(const char *format, ...);
void UartPrintfPoll(const char *format, ...);
void UartPrintfCritical(const char *format, ...);
void UartPrintfCritical(const char *format, ...);
 
void UartPrintfNull(const char *format, ...);
void UartScanf(const char *format, ...);
void UartScanf(const char *format, ...);
#endif
#endif
void UartPacketConfig(PacketGetFunc_t PacketGetFunc,
void UartPacketConfig(PacketGetFunc_t PacketGetFunc,
                      int PacketSize,
                      int PacketSize,
                      OS_MQueue_t *mQueue);
                      OS_MQueue_t *mQueue);
Line 202... Line 220...
int kbhit(void);
int kbhit(void);
void LogWrite(int a);
void LogWrite(int a);
void LogDump(void);
void LogDump(void);
void Led(int value);
void Led(int value);
 
 
 
/***************** Keyboard **************/
 
#define KEYBOARD_RAW     0x100
 
#define KEYBOARD_E0      0x200
 
#define KEYBOARD_RELEASE 0x400
 
void KeyboardInit(void);
 
int KeyboardGetch(void);
 
 
/***************** Math ******************/
/***************** Math ******************/
//IEEE single precision floating point math
//IEEE single precision floating point math
#ifndef WIN32
#ifndef WIN32
#define FP_Neg     __negsf2
#define FP_Neg     __negsf2

powered by: WebSVN 2.1.0

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