Hi,
with the below patch, oskit-mach works for me. The ffs and cli problem
should be solved more portable, though.
Roland, if you want to tell me how to do this cleanly, and apply it and
upload the Debian package, let me know.
Thanks,
Marcus
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;
+}
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server
Marcus Brinkmann GNU http://www.gnu.org for public PGP Key
[EMAIL PROTECTED], [EMAIL PROTECTED] PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ [EMAIL PROTECTED]