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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [os_stubs.c] - Diff between revs 407 and 416

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

Rev 407 Rev 416
Line 10... Line 10...
 *--------------------------------------------------------------------*/
 *--------------------------------------------------------------------*/
#include <stdlib.h>
#include <stdlib.h>
#include "plasma.h"
#include "plasma.h"
#include "rtos.h"
#include "rtos.h"
 
 
unsigned char *flash;
static unsigned char *flash;
int beenInit;
 
 
 
 
void FlashLock(void)   {}
 
void FlashUnlock(void) {}
 
 
void FlashRead(uint16 *dst, uint32 byteOffset, int bytes)
void FlashRead(uint16 *dst, uint32 byteOffset, int bytes)
{
{
   if(beenInit == 0)
   if(flash == NULL)
   {
   {
      beenInit = 1;
 
      flash = (unsigned char*)malloc(1024*1024*16);
      flash = (unsigned char*)malloc(1024*1024*16);
      memset(flash, 0xff, sizeof(flash));
      memset(flash, 0xff, 1024*1024*16);
   }
   }
   memcpy(dst, flash+byteOffset, bytes);
   memcpy(dst, flash+byteOffset, bytes);
}
}
 
 
 
 
Line 41... Line 41...
 
 
 
 
//Stub out RTOS functions
//Stub out RTOS functions
#undef malloc
#undef malloc
#undef free
#undef free
 
#undef printf
 
static void *infoValue;
void *OS_HeapMalloc(OS_Heap_t *heap, int bytes) {(void)heap; return malloc(bytes);}
void *OS_HeapMalloc(OS_Heap_t *heap, int bytes) {(void)heap; return malloc(bytes);}
void OS_HeapFree(void *block)                {free(block);}
void OS_HeapFree(void *block)                {free(block);}
void UartPrintfCritical(const char *format, ...) {(void)format;}
void UartPrintfCritical(const char *format,
 
                        int a, int b, int c, int d, int e, int f, int g, int h)
 
{printf(format,a,b,c,d,e,f,g,h);}
uint32 OS_AsmInterruptEnable(uint32 state)   {(void)state; return 0;}
uint32 OS_AsmInterruptEnable(uint32 state)   {(void)state; return 0;}
void OS_Assert(void)                         {}
void OS_Assert(void)
 
{}
 
OS_Thread_t *OS_ThreadCreate(const char *name,
 
                             OS_FuncPtr_t funcPtr,
 
                             void *arg,
 
                             uint32 priority,
 
                             uint32 stackSize)
 
{(void)name;(void)funcPtr;(void)arg;(void)priority;(void)stackSize;return NULL;}
 
void OS_ThreadExit(void)                     {}
OS_Thread_t *OS_ThreadSelf(void)             {return NULL;}
OS_Thread_t *OS_ThreadSelf(void)             {return NULL;}
void OS_ThreadSleep(int ticks)               {(void)ticks;}
void OS_ThreadSleep(int ticks)               {(void)ticks;}
uint32 OS_ThreadTime(void)                   {return 0;}
uint32 OS_ThreadTime(void)                   {return 0;}
 
void *OS_ThreadInfoGet(OS_Thread_t *thread, uint32 index)
 
{(void)thread;(void)index;return infoValue;}
 
void OS_ThreadInfoSet(OS_Thread_t *thread, uint32 index, void *info)
 
{(void)thread;(void)index;infoValue=info;}
 
 
 
OS_Semaphore_t *OS_SemaphoreCreate(const char *name, uint32 count)
 
{(void)name;(void)count;return NULL;}
 
void OS_SemaphoreDelete(OS_Semaphore_t *semaphore) {(void)semaphore;}
 
int OS_SemaphorePend(OS_Semaphore_t *semaphore, int ticks)
 
{(void)semaphore; (void)ticks; return 0;}
 
void OS_SemaphorePost(OS_Semaphore_t *semaphore) {(void)semaphore;}
 
 
OS_Mutex_t *OS_MutexCreate(const char *name) {(void)name; return NULL; }
OS_Mutex_t *OS_MutexCreate(const char *name) {(void)name; return NULL; }
void OS_MutexDelete(OS_Mutex_t *semaphore)   {(void)semaphore;}
void OS_MutexDelete(OS_Mutex_t *semaphore)   {(void)semaphore;}
void OS_MutexPend(OS_Mutex_t *semaphore)     {(void)semaphore;}
void OS_MutexPend(OS_Mutex_t *semaphore)     {(void)semaphore;}
void OS_MutexPost(OS_Mutex_t *semaphore)     {(void)semaphore;}
void OS_MutexPost(OS_Mutex_t *semaphore)     {(void)semaphore;}
#if OS_CPU_COUNT > 1
#if OS_CPU_COUNT > 1
Line 62... Line 86...
 
 
OS_MQueue_t *OS_MQueueCreate(const char *name,
OS_MQueue_t *OS_MQueueCreate(const char *name,
                             int messageCount,
                             int messageCount,
                             int messageBytes)
                             int messageBytes)
{(void)name;(void)messageCount;(void)messageBytes; return NULL;}
{(void)name;(void)messageCount;(void)messageBytes; return NULL;}
 
 
void OS_MQueueDelete(OS_MQueue_t *mQueue)    {(void)mQueue;}
void OS_MQueueDelete(OS_MQueue_t *mQueue)    {(void)mQueue;}
 
 
int OS_MQueueSend(OS_MQueue_t *mQueue, void *message)
int OS_MQueueSend(OS_MQueue_t *mQueue, void *message)
{(void)mQueue;(void)message; return 0;}
{(void)mQueue;(void)message; return 0;}
 
 
int OS_MQueueGet(OS_MQueue_t *mQueue, void *message, int ticks)
int OS_MQueueGet(OS_MQueue_t *mQueue, void *message, int ticks)
{(void)mQueue;(void)message;(void)ticks; return 0;}
{(void)mQueue;(void)message;(void)ticks; return 0;}
 
 
void OS_Job(JobFunc_t funcPtr, void *arg0, void *arg1, void *arg2)
void OS_Job(JobFunc_t funcPtr, void *arg0, void *arg1, void *arg2)
{funcPtr(arg0, arg1, arg2);}
{funcPtr(arg0, arg1, arg2);}

powered by: WebSVN 2.1.0

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