aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/adc.c2
-rw-r--r--kernel/clock.c11
-rw-r--r--kernel/kernel.c15
-rw-r--r--kernel/kernel.h2
4 files changed, 2 insertions, 28 deletions
diff --git a/kernel/adc.c b/kernel/adc.c
index 1c5d17f..0eeadf1 100644
--- a/kernel/adc.c
+++ b/kernel/adc.c
@@ -42,11 +42,9 @@ adc(void *arg)
unlock(Adc);
}
-#if 0
lock(Display);
fprintf(stderr, "\n%8lx%8x", now(), a->value[0]);
unlock(Display);
-#endif
sleep(0, 100000);
}
diff --git a/kernel/clock.c b/kernel/clock.c
index 6993f73..8e83cbe 100644
--- a/kernel/clock.c
+++ b/kernel/clock.c
@@ -28,8 +28,6 @@ clock(void *arg)
{
uint8_t d, h, m, s, ds;
- uint8_t id[16], n, *p;
-
d = h = m = s = ds = 0;
for (;;) {
@@ -39,18 +37,9 @@ clock(void *arg)
if (m == 60) { m = 0; ++h; }
if (h == 24) { h = 0; ++d; }
-#if 0
lock(Display);
fprintf(stderr, "\r%4d:%.2d:%.2d:%.2d.%1d ", d, h, m, s, ds);
unlock(Display);
-#endif
-
- fprintf(stderr, "\r%4d:%.2d:%.2d:%.2d.%1d\n", d, h, m, s, ds);
- n = sizeof(id) / sizeof(id[0]);
- p = id;
- fetchrq(p, n);
- while (n-- > 0)
- fprintf(stderr, "%c", *p++ ? '*' : ' ');
sleep(0, 100000);
}
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 1a39b2e..ca50440 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -213,12 +213,12 @@ lock(uint8_t chan)
/* semaphore busy, go into wait queue */
TAILQ_REMOVE(&kern.rq, kern.cur, r_link);
TAILQ_INSERT_TAIL(&kern.wq[chan], kern.cur, w_link);
- SWITCH();
} else {
/* occupy semaphore and continue */
kern.semaphore |= _BV(chan);
- sei();
}
+
+ SWITCH();
}
void
@@ -285,14 +285,3 @@ reboot(void)
{
kern.reboot = 1;
}
-
-void
-fetchrq(uint8_t *data, uint8_t len)
-{
- struct task *tp;
-
- memset(data, 0, len);
- TAILQ_FOREACH(tp, &kern.rq, r_link)
- if (tp->id < len)
- data[tp->id] = 1;
-}
diff --git a/kernel/kernel.h b/kernel/kernel.h
index c22dc78..555f839 100644
--- a/kernel/kernel.h
+++ b/kernel/kernel.h
@@ -87,8 +87,6 @@ uint32_t now(void);
void reboot(void);
void idle(void);
-void fetchrq(uint8_t *, uint8_t);
-
/* __END_DECLS */
#endif