-
Notifications
You must be signed in to change notification settings - Fork 8
/
notes.txt
107 lines (85 loc) · 4.89 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
The MJVMK consists of two parts:
-a small OS
-a java CLDC interpreter VM
The OS must be ported to a particular system.
The package has been tested running on x86 machines from a boot disk. The OS has been tested as a stand-alone
microkernel.
The java vm has been tested running on top of the OS, as well as running in windows as a windows application.
This was made capable since the VM can run with kernel-level threads or user-level threads. User level threads
allow the VM to run as a standard windows application, allowing for advanced testing of the VM. Kernel level threads
allow for the VM to run directly on an embedded system.
Critical regions
psTime.c handleTick do a context switch from tick ISR
stringPool.c getUTF8StringByChars adding string to UTF8 string table
stringPool.c internString adding string to unicode string table
don't need stringPool.c addGlobalUTF8String adding global string to UTF8 string table
table.c getClassInTableGeneric reserving entry in class table
iterativeLoad.c setChildStatus setting error status of child class in class table
iterativeLoad.c updateClassTable adding class structure to class table
prepare.c preparationUpdateClassTable adding class instance to class table, if not done at loading time
resolve.c resolveConstantPoolClassRef resolution of constant pool class entry when first accessed
resolve.c resolveConstantPoolFieldRef resolution of constant pool field entry when first accessed
resolve.c resolveConstantPoolMethodRef resolution of constant pool method entry when first accessed
resolve.c resolveConstantPoolInterfaceMethodRef resolution of constant pool interface method entry when first accessed
psIo.c psPutCharScreen output character to screen ?? change this maybe although it is currently only platform specific
frameRegisters.h atomicInstructionRead read all byte of an instruction without interrupt (so the code stream cannot be altered while reading it)
frameRegisters.h atomicInstructionSetXXX quicken an instruction
schedule.c setPriority set a thread's priority and switch context if necessary
schedule.c scheduleNewThread let scheduler know of new thread
schedule.c monitorWait wait and context switch
schedule.c monitorNotify notify and context switch if necessary
schedule.c monitorNotifyAll notify all and context switch if necessary
schedule.c threadSleep sleep and context switch
schedule.c threadYield yield and context switch if necessary
schedule.c threadJoin join and context switch
schedule.c removeThread remove thread from scheduler and switch context
schedule.c interruptThread interrupt thread and switch context if necessary
schedule.h monitorExit exit monitor and context switch if necessary
schedule.h monitorEnter enter monitor and context switch if monitor blocked
specialHandlers.c check the timer queue
javaThread.c gcGetActiveThreadList get active threads for gc
javaThread.c scheduleNewJavaThread let java subsystem know of new java thread
javaThread.c removeJavaThread remove java thread from java subsystem
javaThread.c disableNonCurrentJavaThreads disable threads for gc
javaThread.c reenableNonCurrentJavaThreads reenable threads previously disabled
API
initialization
SUCCESS_CODE initializeIdleStack(void (*pReturnAddress)());
SUCCESS_CODE becomeIdleThread(void (*pReturnAddress)());
SUCCESS_CODE initializeOS(); (initializes heap, CPU: sets context switch interrupt, logging)
void startTick(): sets tick interrupt
threads
#define initializeThreadStruct(pInitThread, switchOutFunc, switchInFunc, cleanUpFunc, priority)
SUCCESS_CODE initializeNativeStack(PS_STACK_PARAMS pThreadParameters, void (*pTask)(), PS_STACK_ELEMENT *ppStack);
void cleanUpNativeStack(THREAD pThread);
#define getCurrentThread()
SUCCESS_CODE startNativeThread(void (*pTask)(), void (*pSwitchOut)(THREAD), void (*pSwitchIn)(THREAD), MONITOR pMonitor, UINT8 priority, THREAD *ppThread);
scheduler
void scheduleNewThread(THREAD pNewThread, MONITOR pMonitor);
void removeThread();
void interruptThread(THREAD pThread);
UINT32 getActiveThreadCount();
void setPriority(THREAD pThread, UINT8 priority);
void threadSleep(ELAPSED_TIME pTimeOut);
void threadJoin(THREAD pThreadToJoin);
void weakYield();
void strongYield();
void disableRescheduler();
void enableRescheduler();
#define monitorInit(pMonitor)
#define monitorEnter(pMonitor)
#define monitorExit(pMonitor)
void monitorWait(MONITOR pMonitor, ELAPSED_TIME pTimeOut);
void monitorNotify(MONITOR pMonitor);
void monitorNotifyAll(MONITOR pMonitor);
#define semaphoreInit(pSemaphore, initialValue)
void semaphorePost(SEMAPHORE pSemaphore);
void semaphorePend(SEMAPHORE pSemaphore);
memory
void *memoryAlloc(UINT32 numBytes);
void *memoryCalloc(UINT32 numBytes, UINT32 size);
void memoryFree(void *pMem);
SUCCESS_CODE collectibleMemoryAlloc(UINT32 byteSize, UINT32 blockMask, UINT16 numContainedItems, UINT32 locationByteOffset, void **ppLocation);
SUCCESS_CODE memoryCallocMonitor(MONITOR *ppMonitor);
UINT32 getTotalAvailableMemory();
UINT32 getTotalMemory();