Subject: Those kernel compilation hiccups
To: None <port-mac68k@NetBSD.ORG>
From: Julian Bean <jules@mailbox.co.uk>
List: port-mac68k
Date: 03/10/1996 15:02:59
I am sure that the powers that be are, as you read this, integrating the correct
versions of these changes into the 'sup' tree.

If, however, you just *have* to compile a kernel, you could try these diffs.

Just cd into sys/arch/mac68k/mac68k, and patch < the stuff below, possibly
with the whitespace ignore flag if your mail program or mine have munged
the tabs.

Be warned, I don't really understand kernel-side setjmp code, this is just what
appears to work based on inspired guesses and grepping through kernel code for
similar calls.  What the hell is a label_t anyway? ;-)

Anyway, I created these diffs and ftp'ed them to my mac from a kernel
compiled with them, so something works.  If I have done something stupid, I
would appreciate it if someone would tell me - then I won't do it next time
:-)

Jules

*** fpu.c.orig  Sun Mar 10 14:27:16 1996
--- fpu.c       Sun Mar 10 14:24:39 1996
***************
*** 45,51 ****
  #include <machine/cpu.h>
  #include <machine/frame.h>

! #include <setjmp.h>

  extern int fpu_type;
  extern int *nofault;
--- 45,51 ----
  #include <machine/cpu.h>
  #include <machine/frame.h>

! /*#include <setjmp.h>*/

  extern int fpu_type;
  extern int *nofault;
***************
*** 95,105 ****
         * We, of course, need to have enough room for either.
         */
        int     fpframe[60 / sizeof(int)];
!       jmp_buf faultbuf;
        u_char  b;

        nofault = (int *) &faultbuf;
!       if (setjmp(faultbuf)) {
                nofault = (int *) 0;
                return(0);
        }
--- 95,105 ----
         * We, of course, need to have enough room for either.
         */
        int     fpframe[60 / sizeof(int)];
!       label_t faultbuf;
        u_char  b;

        nofault = (int *) &faultbuf;
!       if (setjmp(&faultbuf)) {
                nofault = (int *) 0;
                return(0);
        }
*** trap.c.orig Sun Mar 10 14:57:47 1996
--- trap.c      Sun Mar 10 14:43:03 1996
***************
*** 321,327 ****
                extern int      *nofault;

                if (nofault)    /* If we're probing. */
!                       longjmp((label_t *) nofault);
                if (type == T_ILLINST)
                        printf("Kernel Illegal Instruction trap.\n");
                else
--- 321,327 ----
                extern int      *nofault;

                if (nofault)    /* If we're probing. */
!                       longjmp((label_t *) nofault,0);
                if (type == T_ILLINST)
                        printf("Kernel Illegal Instruction trap.\n");
                else