Redo makefiles.
[pintos-anon] / src / lib / debug.c
index 3d9a9b1e28f159f1d1dc0a82d7e117c6a6f02bac..babf2298320bf0c9061487fc601d9f4f1d4820ef 100644 (file)
@@ -1,13 +1,15 @@
 #include "debug.h"
 #include <stdarg.h>
-#include "interrupt.h"
 #include "lib.h"
+#include "threads/interrupt.h"
 
 #define MAX_CLASSES 16
 static bool all_enabled;
 static const char *enabled_classes[MAX_CLASSES];
 static size_t enabled_cnt;
 
+static bool class_is_enabled (const char *class);
+
 /* Enables the debug message classes specified in CLASSES.  The
    string CLASSES is modified by and becomes owned by this
    function. */
@@ -26,22 +28,6 @@ debug_enable (char *classes)
     }
 }
 
-/* Checks whether CLASS is enabled. */
-static bool
-class_is_enabled (const char *class) 
-{
-  size_t i;
-  
-  if (all_enabled)
-    return true;
-
-  for (i = 0; i < enabled_cnt; i++)
-    if (!strcmp (enabled_classes[i], class))
-      return true;
-
-  return false;
-}
-
 /* Prints a debug message along with the source file name, line
    number, and function name of where it was emitted.  CLASS is
    used to filter out unwanted messages. */
@@ -53,7 +39,7 @@ debug_message (const char *file, int line, const char *function,
     {
       va_list args;
 
-      enum if_level old_level = intr_disable ();
+      enum intr_level old_level = intr_disable ();
       printk ("%s:%d: %s(): ", file, line, function);
       va_start (args, message);
       vprintk (message, args);
@@ -100,3 +86,20 @@ debug_backtrace (void)
     printk (" %p", frame[1]);
   printk (".\n");
 }
+\f
+
+/* Returns true if CLASS is enabled, false otherwise. */
+static bool
+class_is_enabled (const char *class) 
+{
+  size_t i;
+  
+  if (all_enabled)
+    return true;
+
+  for (i = 0; i < enabled_cnt; i++)
+    if (!strcmp (enabled_classes[i], class))
+      return true;
+
+  return false;
+}