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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [os_stubs.c] - Blame information for rev 402

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 rhoads
/*--------------------------------------------------------------------
2
 * TITLE: OS stubs
3
 * AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
 * DATE CREATED: 2/18/08
5
 * FILENAME: os_stubs.c
6
 * PROJECT: Plasma CPU core
7
 * COPYRIGHT: Software placed into the public domain by the author.
8
 *    Software 'as is' without warranty.  Author liable for nothing.
9
 * DESCRIPTION:
10
 *--------------------------------------------------------------------*/
11
#include <stdlib.h>
12
#include "plasma.h"
13
#include "rtos.h"
14
 
15
unsigned char *flash;
16
int beenInit;
17
 
18
 
19
void FlashRead(uint16 *dst, uint32 byteOffset, int bytes)
20
{
21
   if(beenInit == 0)
22
   {
23
      beenInit = 1;
24
      flash = (unsigned char*)malloc(1024*1024*16);
25
      memset(flash, 0xff, sizeof(flash));
26
   }
27
   memcpy(dst, flash+byteOffset, bytes);
28
}
29
 
30
 
31
void FlashWrite(uint16 *src, uint32 byteOffset, int bytes)
32
{
33
   memcpy(flash+byteOffset, src, bytes);
34
}
35
 
36
 
37
void FlashErase(uint32 byteOffset)
38
{
39
   memset(flash+byteOffset, 0xff, 1024*128);
40
}
41
 
42
 
43
//Stub out RTOS functions
44
void UartPrintfCritical(const char *format, ...) {(void)format;}
45
uint32 OS_AsmInterruptEnable(uint32 state)   {(void)state; return 0;}
46
void OS_Assert(void)                         {}
47
OS_Thread_t *OS_ThreadSelf(void)             {return NULL;}
48
void OS_ThreadSleep(int ticks)               {(void)ticks;}
49
uint32 OS_ThreadTime(void)                   {return 0;}
50
OS_Mutex_t *OS_MutexCreate(const char *name) {(void)name; return NULL; }
51
void OS_MutexDelete(OS_Mutex_t *semaphore)   {(void)semaphore;}
52
void OS_MutexPend(OS_Mutex_t *semaphore)     {(void)semaphore;}
53
void OS_MutexPost(OS_Mutex_t *semaphore)     {(void)semaphore;}
54 402 rhoads
#if OS_CPU_COUNT > 1
55
   uint32 OS_SpinLock(void)                     {return 0;}
56
   void OS_SpinUnlock(uint32 state)             {(void)state;}
57
#endif
58 302 rhoads
 
59
OS_MQueue_t *OS_MQueueCreate(const char *name,
60
                             int messageCount,
61
                             int messageBytes)
62
{(void)name;(void)messageCount;(void)messageBytes; return NULL;}
63
 
64
void OS_MQueueDelete(OS_MQueue_t *mQueue)    {(void)mQueue;}
65
 
66
int OS_MQueueSend(OS_MQueue_t *mQueue, void *message)
67
{(void)mQueue;(void)message; return 0;}
68
 
69
int OS_MQueueGet(OS_MQueue_t *mQueue, void *message, int ticks)
70
{(void)mQueue;(void)message;(void)ticks; return 0;}
71
 
72 400 rhoads
void OS_Job(JobFunc_t funcPtr, void *arg0, void *arg1, void *arg2)
73 302 rhoads
{funcPtr(arg0, arg1, arg2);}
74
 
75
 

powered by: WebSVN 2.1.0

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