// - Memory Layout
#define MM_USER_MIN 0x00200000
#define USER_STACK_SZ 0x00010000
-#define USER_STACK_TOP 0x00200000
+#define USER_STACK_TOP 0x00800000
#define MM_USER_MAX 0xBC000000
#define MM_PPD_MIN 0xBC000000 // Per-Process Data
#define MM_PPD_VFS 0xBC000000 //
*/
Uint rand()
{
- #if 0
- Uint ret = giRandomState;
- int roll = randomState & 31;
- randomState = (randomState << roll) | (randomState >> (32-roll));
- randomState ^= 0x9A3C5E78;
- return ret;
- #else
Uint old = giRandomState;
+ // Get the next state value
giRandomState = (RANDOM_A*giRandomState + RANDOM_C) & 0xFFFFFFFF;
- if(giRandomState == old) {
- giRandomState += RANDOM_SPRUCE;
- }
- Log("giRandomState = 0x%x", giRandomState);
+ // Check if it has changed, and if it hasn't, change it
+ if(giRandomState == old) giRandomState += RANDOM_SPRUCE;
return giRandomState;
- #endif
}
EXPORT(timestamp);
return gActiveThreads;
}
- Log(" Threads_GetNextToRun: giNumActiveThreads=%i,giTotalTickets=%i",
- giNumActiveThreads, giTotalTickets);
+ //Log(" Threads_GetNextToRun: giNumActiveThreads=%i,giTotalTickets=%i",
+ // giNumActiveThreads, giTotalTickets);
// Get the ticket number
ticket = number = rand() % giTotalTickets;
- Log(" Threads_GetNextToRun: ticket = %i", ticket);
+ //Log(" Threads_GetNextToRun: ticket = %i", ticket);
// Find the next thread
for(thread=gActiveThreads;thread;thread=thread->Next)