diff options
| author | klaar36 <klas.arvidsson@liu.se> | 2017-03-20 17:57:16 +0100 |
|---|---|---|
| committer | klaar36 <klas.arvidsson@liu.se> | 2017-03-20 17:57:16 +0100 |
| commit | d9ae213323d0a036b7f3594de6822413a4c312c6 (patch) | |
| tree | 4c9f16e408d3cda4682afa28b34b1dc253c47a4c /src | |
| parent | 569371aca6667c0509a404d371a85e4fd5654731 (diff) | |
| download | pintos-rs-d9ae213323d0a036b7f3594de6822413a4c312c6.tar.gz | |
TIMER_FREQ test program compilation fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/devices/timer.c | 4 | ||||
| -rw-r--r-- | src/devices/timer.h | 3 | ||||
| -rw-r--r-- | src/threads/Make.vars | 2 | ||||
| -rw-r--r-- | src/threads/init.c | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/devices/timer.c b/src/devices/timer.c index 750ac4c..70d854b 100644 --- a/src/devices/timer.c +++ b/src/devices/timer.c @@ -17,8 +17,8 @@ static int64_t ticks; Initialized by timer_calibrate(). */ static unsigned loops_per_tick; -/* Interrupts per second, writen only by timer_init */ -static uint16_t TIMER_FREQ = 0; +/* Interrupts per second, written only by timer_init */ +uint16_t TIMER_FREQ = 0; static intr_handler_func timer_interrupt; static bool too_many_loops (unsigned loops); diff --git a/src/devices/timer.h b/src/devices/timer.h index aee6033..e2f0e0b 100644 --- a/src/devices/timer.h +++ b/src/devices/timer.h @@ -17,4 +17,7 @@ void timer_nsleep (int64_t nanoseconds); void timer_print_stats (void); +/* used by thread test programs */ +extern uint16_t TIMER_FREQ; + #endif /* devices/timer.h */ diff --git a/src/threads/Make.vars b/src/threads/Make.vars index dc45c2a..4c36b8f 100644 --- a/src/threads/Make.vars +++ b/src/threads/Make.vars @@ -1,6 +1,6 @@ # -*- makefile -*- -os.dsk: DEFINES = +os.dsk: DEFINES += KERNEL_SUBDIRS = threads devices lib lib/kernel $(TEST_SUBDIRS) TEST_SUBDIRS = tests/threads GRADING_FILE = $(SRCDIR)/tests/threads/Grading diff --git a/src/threads/init.c b/src/threads/init.c index 54cae24..16be95d 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -91,7 +91,9 @@ main (void) /* Initialize ourselves as a thread so we can use locks, then enable console locking. */ thread_init (); +#ifdef USERPROG process_init (); +#endif console_init (); /* Greet user. */ |
