[1228] in Coldmud discussion meeting

root meeting help first previous next last

[COLD] cancel() bug [PATCH!!!]

daemon@ATHENA.MIT.EDU (Tue Feb 4 06:27:06 1997 )

Date: Tue, 4 Feb 1997 12:12:32 +0100 (MET)
From: Miroslav Silovic <Miroslav.Silovic@public.srce.hr>
To: coldstuff@cold.org

Okay, this patch contains two things: bugfix for cancel() (and it was
SIMPLE: somebody just forgot to remove a couple of lines when task_delete
went macro) and the function I used to debug the VM. Nothing really calls
this function, but it's good to keep it in the driver, just in case we
need to debug the task handling again.

Eventually I'll write a backtrace dumper, too; that one will be called
during driver PANIC. For now, enjoy the patch. :)

======================================================================

*** Genesis-1.0p22/src/execute.c	Tue Feb  4 12:07:16 1997
--- Genesis-1.0p22-new/src/execute.c	Tue Feb  4 12:07:17 1997
***************
*** 163,174 ****
  
  /*
  // ---------------------------------------------------------------
  */
  void task_delete(VMState *list, VMState *elem) {
-     if (list != suspended)
-         list = list->next;
      while (list && (list->next != elem))
          list = list->next;
      if (list)
          list->next = elem->next;
  }
--- 163,172 ----
***************
*** 379,388 ****
--- 377,407 ----
  }
  
  /*
  // ---------------------------------------------------------------
  */
+ 
+ void show_queues(void) {
+     VMState *v;
+ 
+     /* 
+        Nothing calls this function - it's here as a VM debug utility
+     */
+ 
+     printf ("preempted:");
+     for (v=preempted; v; v=v->next)
+ 	printf ("%x ", v);
+     printf ("\nsuspended:");
+     for (v=suspended; v; v=v->next)
+ 	printf ("%x ", v);
+     printf ("\nvmstore:");
+     for (v=vmstore; v; v=v->next)
+ 	printf ("%x ", v);
+     printf ("\n\n");
+     fflush(stdout);
+ }
+ 
  void task_cancel(Long tid) {
      VMState * vm = task_lookup(tid),
              * old_vm;
  
      old_vm = vm_current();