[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Patch for oskit-mach



On Wed, Aug 09, 2000 at 09:55:29PM -0400, Igor Khavkine wrote:
> Hi, Marcus.
> 
> I remember that you tried to compile oskit-mach recently and ran into some 
> problems with linking to oskit. Did you completely solve the problem, and if 
> so can you make the patches available?

Yes, I made it compile and the resulting kernel worked like a charm. The
patch I found in my home dir is attached, I hope it was all you need, but I
don't remember too well. Maybe some packaging issues, but if you don't want
to create the deb, you don't need to care.

> If the patches work when will they make 
> it into the main CVS tree?

I doubt that my patches are correct in all parts.
However, Roland has to decide about that, and I am sure he will take care of
it as soon as he can.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
Marcus.Brinkmann@ruhr-uni-bochum.de,     marcus@gnu.org    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       brinkmd@debian.org
diff -ru /mnt/marcus/gnu/cvs/gnumach-oskit/i386/i386/pic.c oskit-mach-1.2.91/i386/i386/pic.c
--- /mnt/marcus/gnu/cvs/gnumach-oskit/i386/i386/pic.c	Fri Apr 28 21:24:32 2000
+++ oskit-mach-1.2.91/i386/i386/pic.c	Sun Jul 30 18:09:41 2000
@@ -67,7 +67,7 @@
 
 picinit()
 {
-  cli();
+asm("cli");
 
 	form_pic_mask();
 
Only in oskit-mach-1.2.91/i386/i386: pic.c~
diff -ru /mnt/marcus/gnu/cvs/gnumach-oskit/oskit/osenv_mem.c oskit-mach-1.2.91/oskit/osenv_mem.c
--- /mnt/marcus/gnu/cvs/gnumach-oskit/oskit/osenv_mem.c	Mon Feb  7 20:35:38 2000
+++ oskit-mach-1.2.91/oskit/osenv_mem.c	Sun Jul 30 18:14:23 2000
@@ -62,6 +62,22 @@
   vm_page_unqueued_count = atop (lmm_avail (&malloc_lmm, 0));
 }
 
+int
+ffs (x)
+    int x;
+{
+  int cnt;
+  int tmp;
+         
+  asm ("xorl %0,%0\n"           /* Set CNT to zero.  */
+       "bsfl %2,%1\n"           /* Count low bits in X and store in %1.  */
+       "jz 1f\n"                /* Jump if OK, i.e. X was non-zero.  */
+       "leal 1(%1),%0\n"        /* Return bsfl-result plus one on %0.  */
+       "1:" : "=&a" (cnt), "=r" (tmp) : "rm" (x));
+
+  return cnt;
+}
+                                         
 
 void *
 alloc_for_oskit (oskit_size_t size, osenv_memflags_t flags, unsigned align)
diff -ru /mnt/marcus/gnu/cvs/gnumach-oskit/oskit/osenv_synch.c oskit-mach-1.2.91/oskit/osenv_synch.c
--- /mnt/marcus/gnu/cvs/gnumach-oskit/oskit/osenv_synch.c	Fri Nov 26 00:27:50 1999
+++ oskit-mach-1.2.91/oskit/osenv_synch.c	Sun Jul 30 17:47:19 2000
@@ -45,3 +45,31 @@
 {
   return curr_ipl < SPLIO;
 }
+
+/*
+ * Disable interrupts returning the old value.  Combo of:
+ *      save = osenv_intr_enabled();
+ *      osenv_intr_disable();
+ */
+int
+osenv_intr_save_disable(void)
+{
+  int enabled;
+
+  if ((enabled = (curr_ipl < SPLIO)) != 0)
+    {
+      /* We can be called with interrupts already disabled! */
+      if (curr_ipl > SPLIO)
+        /* We are already at higher priority than oskit code normally runs.
+           I think this only happens in the calls from oskit_rtc_{get,set}.
+           On the assumption that osenv_intr_enable will be called in
+           parity from the same interrupt level, we will want to stay at the
+           same high interrupt level.  */
+        osenv_intr_spl = curr_ipl;
+      else if (curr_ipl < SPLIO)
+        /* We are at a level where oskit interrupts are enabled, so we must go
+           to splio.  osenv_intr_enable we will return to the current level.  */
+        osenv_intr_spl = splio ();
+    }
+    return enabled;
+}

Reply to: