URL
https://opencores.org/ocsvn/plasma/plasma/trunk
[/] [plasma/] [trunk/] [kernel/] [rtos_ex.c] - Diff between revs 416 and 436
Show entire file |
Details |
Blame |
View Log
Rev 416 |
Rev 436 |
Line 9... |
Line 9... |
* DESCRIPTION:
|
* DESCRIPTION:
|
* Support simulation under Windows.
|
* Support simulation under Windows.
|
* Support simulating multiple CPUs using symmetric multiprocessing.
|
* Support simulating multiple CPUs using symmetric multiprocessing.
|
*--------------------------------------------------------------------*/
|
*--------------------------------------------------------------------*/
|
#include "plasma.h"
|
#include "plasma.h"
|
|
#define NO_ELLIPSIS2
|
#include "rtos.h"
|
#include "rtos.h"
|
|
|
/************** WIN32 Simulation Support *************/
|
/************** WIN32 Simulation Support *************/
|
#ifdef WIN32
|
#ifdef WIN32
|
#include <conio.h>
|
#include <conio.h>
|
Line 38... |
Line 39... |
ThreadId[0] = GetCurrentThreadId();
|
ThreadId[0] = GetCurrentThreadId();
|
for(i = 1; i < OS_CPU_COUNT; ++i)
|
for(i = 1; i < OS_CPU_COUNT; ++i)
|
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OS_Start, NULL, 0, &ThreadId[i]);
|
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OS_Start, NULL, 0, &ThreadId[i]);
|
}
|
}
|
#endif //OS_CPU_COUNT > 1
|
#endif //OS_CPU_COUNT > 1
|
|
#else //NWIN32
|
|
#include <unistd.h>
|
|
#define kbhit() 1
|
|
#define getch getchar
|
|
#define putch putchar
|
|
#define Sleep(X) usleep(X*1000)
|
|
#endif //WIN32
|
|
|
|
|
static uint32 Memory[8];
|
static uint32 Memory[8];
|
|
|
//Simulates device register memory reads
|
//Simulates device register memory reads
|
uint32 MemoryRead(uint32 address)
|
uint32 MemoryRead(uint32 address)
|
Line 106... |
Line 115... |
arg4, arg5, arg6, arg7);
|
arg4, arg5, arg6, arg7);
|
while(ptr[0])
|
while(ptr[0])
|
putchar(*ptr++);
|
putchar(*ptr++);
|
}
|
}
|
|
|
#endif //WIN32
|
|
|
|
|
|
#if OS_CPU_COUNT > 1
|
#if OS_CPU_COUNT > 1
|
static volatile uint8 SpinLockArray[OS_CPU_COUNT];
|
static volatile uint8 SpinLockArray[OS_CPU_COUNT];
|
/******************************************/
|
/******************************************/
|
uint32 OS_CpuIndex(void)
|
uint32 OS_CpuIndex(void)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.