Trying to get closer to the original OS/161 sources.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include <vfs.h> // for vfs_sync()
|
||||
#include <lamebus/ltrace.h> // for ltrace_stop()
|
||||
#include <kern/secret.h>
|
||||
#include <test.h>
|
||||
|
||||
|
||||
/* Flags word for DEBUG() macro. */
|
||||
@@ -93,9 +94,10 @@ console_send(void *junk, const char *data, size_t len)
|
||||
/*
|
||||
* kprintf and tprintf helper function.
|
||||
*/
|
||||
static
|
||||
inline
|
||||
int
|
||||
vkprintf(const char *fmt, va_list ap)
|
||||
__kprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
int chars;
|
||||
bool dolock;
|
||||
@@ -134,7 +136,7 @@ kprintf(const char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
chars = vkprintf(fmt, ap);
|
||||
chars = __kprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return chars;
|
||||
@@ -154,7 +156,7 @@ tkprintf(const char *fmt, ...)
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
chars = vkprintf(fmt, ap);
|
||||
chars = __kprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return chars;
|
||||
@@ -173,7 +175,7 @@ nkprintf(const char *fmt, ...)
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
chars = vkprintf(fmt, ap);
|
||||
chars = __kprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return chars;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user