Trying to get closer to the original OS/161 sources.

This commit is contained in:
Geoffrey Challen
2016-01-11 20:54:52 -05:00
parent 202cc3eab4
commit a6878c822b
13 changed files with 164 additions and 161 deletions

View File

@@ -30,7 +30,6 @@
#include <types.h>
#include <kern/errmsg.h>
#include <lib.h>
#include <thread.h>
/*
* Like strdup, but calls kmalloc.
@@ -61,27 +60,3 @@ strerror(int errcode)
panic("Invalid error code %d\n", errcode);
return NULL;
}
/*
* Helper functions used by testing and problem driver code
* to establish better mixtures of threads.
*/
void
random_yielder(uint32_t max_yield_count)
{
uint32_t i;
for (i = 0; i < random() % max_yield_count; i++) {
thread_yield();
}
}
void
random_spinner(uint32_t max_spin_count)
{
uint32_t i;
volatile int spin;
for (i = 0; i < random() % max_spin_count; i++) {
spin += i;
}
}