Fix whitespace errors.
This commit is contained in:
parent
ec9ae33666
commit
32253d53bc
@ -278,7 +278,7 @@ whalemating(int nargs, char **args) {
|
|||||||
test_message = "";
|
test_message = "";
|
||||||
|
|
||||||
whalemating_init();
|
whalemating_init();
|
||||||
|
|
||||||
/* Start males and females only. */
|
/* Start males and females only. */
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
for (j = 0; j < NMATING; j++) {
|
for (j = 0; j < NMATING; j++) {
|
||||||
@ -302,12 +302,12 @@ whalemating(int nargs, char **args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for males and females to start. */
|
/* Wait for males and females to start. */
|
||||||
for (i = 0; i < NMATING * 2; i++) {
|
for (i = 0; i < NMATING * 2; i++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
P(startsem);
|
P(startsem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure nothing is happening... */
|
/* Make sure nothing is happening... */
|
||||||
loop_status = SUCCESS;
|
loop_status = SUCCESS;
|
||||||
for (i = 0; i < CHECK_TIMES && loop_status == SUCCESS; i++) {
|
for (i = 0; i < CHECK_TIMES && loop_status == SUCCESS; i++) {
|
||||||
@ -323,7 +323,7 @@ whalemating(int nargs, char **args) {
|
|||||||
if (failif((loop_status == FAIL), "failed: uncoordinated matchmaking is occurring")) {
|
if (failif((loop_status == FAIL), "failed: uncoordinated matchmaking is occurring")) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the matchmakers */
|
/* Create the matchmakers */
|
||||||
for (j = 0; j < NMATING; j++) {
|
for (j = 0; j < NMATING; j++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
@ -336,11 +336,11 @@ whalemating(int nargs, char **args) {
|
|||||||
}
|
}
|
||||||
total_count++;
|
total_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Release a random number of matchmakers and wait for them and their
|
* Release a random number of matchmakers and wait for them and their
|
||||||
* matches to finish.
|
* matches to finish.
|
||||||
*/
|
*/
|
||||||
int pivot = (random() % (NMATING - 2)) + 1;
|
int pivot = (random() % (NMATING - 2)) + 1;
|
||||||
for (i = 0; i < pivot; i++) {
|
for (i = 0; i < pivot; i++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
@ -351,8 +351,8 @@ whalemating(int nargs, char **args) {
|
|||||||
P(endsem);
|
P(endsem);
|
||||||
total_count--;
|
total_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure nothing else is happening... */
|
/* Make sure nothing else is happening... */
|
||||||
loop_status = SUCCESS;
|
loop_status = SUCCESS;
|
||||||
for (i = 0; i < CHECK_TIMES && loop_status == SUCCESS; i++) {
|
for (i = 0; i < CHECK_TIMES && loop_status == SUCCESS; i++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
@ -368,7 +368,7 @@ whalemating(int nargs, char **args) {
|
|||||||
if (failif((loop_status == FAIL), "failed: uncoordinated matchmaking is occurring")) {
|
if (failif((loop_status == FAIL), "failed: uncoordinated matchmaking is occurring")) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Release the rest of the matchmakers and wait for everyone to finish.
|
* Release the rest of the matchmakers and wait for everyone to finish.
|
||||||
*/
|
*/
|
||||||
@ -415,7 +415,7 @@ done:
|
|||||||
sem_destroy(startsem);
|
sem_destroy(startsem);
|
||||||
sem_destroy(endsem);
|
sem_destroy(endsem);
|
||||||
sem_destroy(matcher_sem);
|
sem_destroy(matcher_sem);
|
||||||
|
|
||||||
kprintf_t("\n");
|
kprintf_t("\n");
|
||||||
if (test_status != SUCCESS) {
|
if (test_status != SUCCESS) {
|
||||||
ksecprintf(SECRET, test_message, "sp1");
|
ksecprintf(SECRET, test_message, "sp1");
|
||||||
@ -570,7 +570,7 @@ inQuadrant(int quadrant, uint32_t index) {
|
|||||||
}
|
}
|
||||||
failif((quadrant != target_quadrant), "failed: invalid turn");
|
failif((quadrant != target_quadrant), "failed: invalid turn");
|
||||||
car_turn_times[index]++;
|
car_turn_times[index]++;
|
||||||
|
|
||||||
failif((quadrant_array[quadrant] > 0), "failed: collision");
|
failif((quadrant_array[quadrant] > 0), "failed: collision");
|
||||||
|
|
||||||
quadrant_array[quadrant]++;
|
quadrant_array[quadrant]++;
|
||||||
|
@ -83,7 +83,7 @@ semtestthread(void *junk, unsigned long num)
|
|||||||
(void)junk;
|
(void)junk;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
random_yielder(4);
|
random_yielder(4);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -111,7 +111,7 @@ semtest(int nargs, char **args)
|
|||||||
(void)args;
|
(void)args;
|
||||||
|
|
||||||
int i, result;
|
int i, result;
|
||||||
|
|
||||||
kprintf_n("Starting sem1...\n");
|
kprintf_n("Starting sem1...\n");
|
||||||
for (i=0; i<CREATELOOPS; i++) {
|
for (i=0; i<CREATELOOPS; i++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
@ -207,7 +207,7 @@ locktestthread(void *junk, unsigned long num)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
random_yielder(4);
|
random_yielder(4);
|
||||||
|
|
||||||
if (!(lock_do_i_hold(testlock))) {
|
if (!(lock_do_i_hold(testlock))) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ locktestthread(void *junk, unsigned long num)
|
|||||||
|
|
||||||
lock_release(testlock);
|
lock_release(testlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for solutions that don't track ownership properly */
|
/* Check for solutions that don't track ownership properly */
|
||||||
|
|
||||||
for (i=0; i<NLOCKLOOPS; i++) {
|
for (i=0; i<NLOCKLOOPS; i++) {
|
||||||
@ -244,7 +244,7 @@ locktest(int nargs, char **args)
|
|||||||
(void)args;
|
(void)args;
|
||||||
|
|
||||||
int i, result;
|
int i, result;
|
||||||
|
|
||||||
kprintf_n("Starting lt1...\n");
|
kprintf_n("Starting lt1...\n");
|
||||||
for (i=0; i<CREATELOOPS; i++) {
|
for (i=0; i<CREATELOOPS; i++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
@ -275,7 +275,7 @@ locktest(int nargs, char **args)
|
|||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
P(donesem);
|
P(donesem);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock_destroy(testlock);
|
lock_destroy(testlock);
|
||||||
sem_destroy(donesem);
|
sem_destroy(donesem);
|
||||||
testlock = NULL;
|
testlock = NULL;
|
||||||
@ -293,7 +293,7 @@ locktest2(int nargs, char **args) {
|
|||||||
(void)args;
|
(void)args;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
kprintf_n("Starting lt2...\n");
|
kprintf_n("Starting lt2...\n");
|
||||||
kprintf_n("(This test panics on success!)\n");
|
kprintf_n("(This test panics on success!)\n");
|
||||||
for (i=0; i<CREATELOOPS; i++) {
|
for (i=0; i<CREATELOOPS; i++) {
|
||||||
@ -305,12 +305,12 @@ locktest2(int nargs, char **args) {
|
|||||||
lock_destroy(testlock);
|
lock_destroy(testlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ksecprintf(SECRET, "Should panic...", "lt2");
|
ksecprintf(SECRET, "Should panic...", "lt2");
|
||||||
lock_release(testlock);
|
lock_release(testlock);
|
||||||
|
|
||||||
/* Should not get here on success. */
|
/* Should not get here on success. */
|
||||||
|
|
||||||
success(FAIL, SECRET, "lt2");
|
success(FAIL, SECRET, "lt2");
|
||||||
|
|
||||||
lock_destroy(testlock);
|
lock_destroy(testlock);
|
||||||
@ -323,9 +323,9 @@ int
|
|||||||
locktest3(int nargs, char **args) {
|
locktest3(int nargs, char **args) {
|
||||||
(void)nargs;
|
(void)nargs;
|
||||||
(void)args;
|
(void)args;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
kprintf_n("Starting lt3...\n");
|
kprintf_n("Starting lt3...\n");
|
||||||
kprintf_n("(This test panics on success!)\n");
|
kprintf_n("(This test panics on success!)\n");
|
||||||
for (i=0; i<CREATELOOPS; i++) {
|
for (i=0; i<CREATELOOPS; i++) {
|
||||||
@ -341,9 +341,9 @@ locktest3(int nargs, char **args) {
|
|||||||
ksecprintf(SECRET, "Should panic...", "lt3");
|
ksecprintf(SECRET, "Should panic...", "lt3");
|
||||||
lock_acquire(testlock);
|
lock_acquire(testlock);
|
||||||
lock_destroy(testlock);
|
lock_destroy(testlock);
|
||||||
|
|
||||||
/* Should not get here on success. */
|
/* Should not get here on success. */
|
||||||
|
|
||||||
success(FAIL, SECRET, "lt3");
|
success(FAIL, SECRET, "lt3");
|
||||||
|
|
||||||
testlock = NULL;
|
testlock = NULL;
|
||||||
@ -397,7 +397,7 @@ cvtestthread(void *junk, unsigned long num)
|
|||||||
random_yielder(4);
|
random_yielder(4);
|
||||||
cv_broadcast(testcv, testlock);
|
cv_broadcast(testcv, testlock);
|
||||||
random_yielder(4);
|
random_yielder(4);
|
||||||
failif((testval1 != testval2));
|
failif((testval1 != testval2));
|
||||||
|
|
||||||
kprintf_n("Thread %lu\n", testval2);
|
kprintf_n("Thread %lu\n", testval2);
|
||||||
testval1 = (testval1 + NTHREADS - 1) % NTHREADS;
|
testval1 = (testval1 + NTHREADS - 1) % NTHREADS;
|
||||||
@ -411,9 +411,9 @@ cvtest(int nargs, char **args)
|
|||||||
{
|
{
|
||||||
(void)nargs;
|
(void)nargs;
|
||||||
(void)args;
|
(void)args;
|
||||||
|
|
||||||
int i, result;
|
int i, result;
|
||||||
|
|
||||||
kprintf_n("Starting cvt1...\n");
|
kprintf_n("Starting cvt1...\n");
|
||||||
for (i=0; i<CREATELOOPS; i++) {
|
for (i=0; i<CREATELOOPS; i++) {
|
||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
@ -450,14 +450,14 @@ cvtest(int nargs, char **args)
|
|||||||
kprintf_t(".");
|
kprintf_t(".");
|
||||||
P(donesem);
|
P(donesem);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock_destroy(testlock);
|
lock_destroy(testlock);
|
||||||
cv_destroy(testcv);
|
cv_destroy(testcv);
|
||||||
sem_destroy(donesem);
|
sem_destroy(donesem);
|
||||||
testlock = NULL;
|
testlock = NULL;
|
||||||
testcv = NULL;
|
testcv = NULL;
|
||||||
donesem = NULL;
|
donesem = NULL;
|
||||||
|
|
||||||
kprintf_t("\n");
|
kprintf_t("\n");
|
||||||
success(test_status, SECRET, "cvt1");
|
success(test_status, SECRET, "cvt1");
|
||||||
|
|
||||||
@ -667,9 +667,9 @@ cvtest4(int nargs, char **args) {
|
|||||||
|
|
||||||
ksecprintf(SECRET, "Should panic...", "cvt4");
|
ksecprintf(SECRET, "Should panic...", "cvt4");
|
||||||
cv_broadcast(testcv, testlock);
|
cv_broadcast(testcv, testlock);
|
||||||
|
|
||||||
/* Should not get here on success. */
|
/* Should not get here on success. */
|
||||||
|
|
||||||
success(FAIL, SECRET, "cvt4");
|
success(FAIL, SECRET, "cvt4");
|
||||||
|
|
||||||
lock_destroy(testlock);
|
lock_destroy(testlock);
|
||||||
|
@ -781,8 +781,8 @@ subpage_stats(struct pageref *pr, bool quiet)
|
|||||||
freemap[index/32] |= (1<<(index%32));
|
freemap[index/32] |= (1<<(index%32));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
kprintf("at 0x%08lx: size %-4lu %u/%u free\n",
|
kprintf("at 0x%08lx: size %-4lu %u/%u free\n",
|
||||||
(unsigned long)prpage, (unsigned long) sizes[blktype],
|
(unsigned long)prpage, (unsigned long) sizes[blktype],
|
||||||
(unsigned) pr->nfree, n);
|
(unsigned) pr->nfree, n);
|
||||||
@ -811,7 +811,7 @@ kheap_printstats(void)
|
|||||||
spinlock_acquire(&kmalloc_spinlock);
|
spinlock_acquire(&kmalloc_spinlock);
|
||||||
|
|
||||||
kprintf("Subpage allocator status:\n");
|
kprintf("Subpage allocator status:\n");
|
||||||
|
|
||||||
for (pr = allbase; pr != NULL; pr = pr->next_all) {
|
for (pr = allbase; pr != NULL; pr = pr->next_all) {
|
||||||
subpage_stats(pr, false);
|
subpage_stats(pr, false);
|
||||||
}
|
}
|
||||||
@ -820,7 +820,7 @@ kheap_printstats(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print the whole heap.
|
* Print number of used heap bytes.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
kheap_printused(void)
|
kheap_printused(void)
|
||||||
@ -829,13 +829,13 @@ kheap_printused(void)
|
|||||||
unsigned long total = 0;
|
unsigned long total = 0;
|
||||||
/* print the whole thing with interrupts off */
|
/* print the whole thing with interrupts off */
|
||||||
spinlock_acquire(&kmalloc_spinlock);
|
spinlock_acquire(&kmalloc_spinlock);
|
||||||
|
|
||||||
for (pr = allbase; pr != NULL; pr = pr->next_all) {
|
for (pr = allbase; pr != NULL; pr = pr->next_all) {
|
||||||
total += subpage_stats(pr, true);
|
total += subpage_stats(pr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
spinlock_release(&kmalloc_spinlock);
|
spinlock_release(&kmalloc_spinlock);
|
||||||
|
|
||||||
char total_string[32];
|
char total_string[32];
|
||||||
snprintf(total_string, sizeof(total_string), "%lu", total);
|
snprintf(total_string, sizeof(total_string), "%lu", total);
|
||||||
ksecprintf(SECRET, total_string, "khu");
|
ksecprintf(SECRET, total_string, "khu");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user