/*#define LittleEndian*/
#define NAMES_HAVE_UNDERSCORE
#define DO_BACKTRACK 1
#define BUGGY_GNUG
#define USE_LONGJMP

#ifdef DO_REF_COUNT
#define MARK(body) /* ??? */
#else
#define MARK(body)
#endif

#define PRIM_HANDLER(exname,label) \
  asm(" .long " UNDERSCORE #exname); asm(" .word 1"); asm(UNDERSCORE label ":")
#define JUMP(label) asm(" bra " label)

#define CONT_SAVE_REGS 12
/*#define CONT_SAVE_FP(H) (char*)(H)->save_regs[10]*/
#ifdef USE_LONGJMP
#define CONT_SAVE_SP(H) (char*)0
#else
#define CONT_SAVE_SP(H) (char*)(H)->save_regs[???]
#endif

#define RELOC_FILE "rel_sun3.c"
#define HAVE_AOUT
#define BSD

#define SunOS4 /* Needed by jobs.c */

#if 0
/* Generate the instructions:
   sethi %hi(PTR),%o0
   retl
   or %o0,%lo(PTR),%o0
*/
#define MAKE_RETURN_POINTER_STUB(STUB_ADDRESS, PTR) \
    ((long*)(STUB_ADDRESS))[0] = 0x11000000|((unsigned long)(PTR)>>10),\
    ((long*)(STUB_ADDRESS))[1] = 0x81c3e008,\
    ((long*)(STUB_ADDRESS))[2] = 0x90122000|((unsigned long)(PTR)&0x3FF);
#define MAKE_RETURN_POINTER_STUB_SIZE 12
#endif

extern void* call_c_function(...) asm("_call_c_function");
#define CALL_C_FUNCTION(f,params,length) call_c_function(f,params,length)
#ifdef CONFIG_FUNCTIONS
  asm(" .globl _call_c_function");
  asm("_call_c_function:");
 /* if (params+length != sp) abort();*/
  asm(" ldd [%o1+0x8],%o2");
  asm(" ldd [%o1+0x10],%o4");
  asm(" jmp %o0");
  asm(" ldd [%o1+0x0],%o0");
#endif
