-#ifdef APOLLO
-extern char *malloc(), *realloc(), *(*_libc_malloc) (), *(*_libc_realloc)();
-extern void free(), (*_libc_free) (); extern int main();
-std_$call void unix_$main();
-
-_start()
-{
- _libc_malloc = malloc;
- _libc_realloc = realloc;
- _libc_free = free;
- unix_$main(main); /* no return */
-}
-#endif /* APOLLO */
-
-#if defined(orion) || defined(pyramid) || defined(celerity) || defined(ALLIANT) || defined(clipper) || defined(sps7)
-
-#if defined(sps7) && defined(V3x)
- asm(" section 10");
- asm(" ds.b 0xb0");
-#endif
-
-#ifdef ALLIANT
-/* _start must initialize _curbrk and _minbrk on the first startup;
- when starting up after dumping, it must initialize them to what they were
- before the dumping, since they are in the shared library and
- are not dumped. See ADJUST_EXEC_HEADER in m-alliant.h. */
-extern unsigned char *_curbrk, *_minbrk;
-extern unsigned char end;
-unsigned char *_setbrk = &end;
-#ifdef ALLIANT_2800
-unsigned char *_end = &end;
-#endif
-#endif
-
-#ifndef DUMMIES
-#define DUMMIES
-#endif
-
-_start (DUMMIES argc, argv, envp)
- int argc;
- char **argv, **envp;
-{
-#ifdef ALLIANT
-#ifdef ALLIANT_2800
- _curbrk = _end;
- _minbrk = _end;
-#else
- _curbrk = _setbrk;
- _minbrk = _setbrk;
-#endif
-#endif
-
- environ = envp;
-
- exit (main (argc, argv, envp));
-}
-
-#endif /* orion or pyramid or celerity or alliant or clipper */
-
-#if defined (ns16000) && !defined (sequent) && !defined (UMAX) && !defined (CRT0_DUMMIES)
-
-_start ()
-{
-/* On 16000, _start pushes fp onto stack */
- start1 ();
-}
-
-/* ignore takes care of skipping the fp value pushed in start. */
-static
-start1 (ignore, argc, argv)
- int ignore;
- int argc;
- register char **argv;
-{
- environ = argv + argc + 1;
-
- if (environ == *argv)
- environ--;
- exit (main (argc, argv, environ));
-}
-#endif /* ns16000, not sequent and not UMAX, and not the CRT0_DUMMIES method */
-
-#ifdef UMAX
-_start()
-{
- asm(" exit [] # undo enter");
- asm(" .set exitsc,1");
- asm(" .set sigcatchall,0x400");
-
- asm(" .globl _exit");
- asm(" .globl start");
- asm(" .globl __start");
- asm(" .globl _main");
- asm(" .globl _environ");
- asm(" .globl _sigvec");
- asm(" .globl sigentry");
-
- asm("start:");
- asm(" br .xstart");
- asm(" .org 0x20");
- asm(" .double p_glbl,0,0xf00000,0");
- asm(" .org 0x30");
- asm(".xstart:");
- asm(" adjspb $8");
- asm(" movd 8(sp),0(sp) # argc");
- asm(" addr 12(sp),r0");
- asm(" movd r0,4(sp) # argv");
- asm("L1:");
- asm(" movd r0,r1");
- asm(" addqd $4,r0");
- asm(" cmpqd $0,0(r1) # null args term ?");
- asm(" bne L1");
- asm(" cmpd r0,0(4(sp)) # end of 'env' or 'argv' ?");
- asm(" blt L2");
- asm(" addqd $-4,r0 # envp's are in list");
- asm("L2:");
- asm(" movd r0,8(sp) # env");
- asm(" movd r0,@_environ # indir is 0 if no env ; not 0 if env");
- asm(" movqd $0,tos # setup intermediate signal handler");
- asm(" addr @sv,tos");
- asm(" movzwd $sigcatchall,tos");
- asm(" jsr @_sigvec");
- asm(" adjspb $-12");
- asm(" jsr @_main");
- asm(" adjspb $-12");
- asm(" movd r0,tos");
- asm(" jsr @_exit");
- asm(" adjspb $-4");
- asm(" addr @exitsc,r0");
- asm(" svc");
- asm(" .align 4 # sigvec arg");
- asm("sv:");
- asm(" .double sigentry");
- asm(" .double 0");
- asm(" .double 0");
-
- asm(" .comm p_glbl,1");
-}
-#endif /* UMAX */
-