projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanups; take advantage of gcc asm() features.
[unix-history]
/
usr
/
src
/
lib
/
csu
/
i386
/
crt0.c
diff --git
a/usr/src/lib/csu/i386/crt0.c
b/usr/src/lib/csu/i386/crt0.c
index
e3d6560
..
67bb0a9
100644
(file)
--- a/
usr/src/lib/csu/i386/crt0.c
+++ b/
usr/src/lib/csu/i386/crt0.c
@@
-6,7
+6,7
@@
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)crt0.c 5.
3
(Berkeley) %G%";
+static char sccsid[] = "@(#)crt0.c 5.
4
(Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
/*
#endif /* LIBC_SCCS and not lint */
/*
@@
-21,12
+21,13
@@
static char sccsid[] = "@(#)crt0.c 5.3 (Berkeley) %G%";
char **environ = (char **)0;
static int fd;
char **environ = (char **)0;
static int fd;
-asm("#define _start start");
-asm("#define _eprol eprol");
-asm(" .text");
-asm(" .long 0xc000c000");
+asm(".text");
+asm(".long 0xc000c000");
+
extern unsigned char etext;
extern unsigned char etext;
-extern unsigned char eprol;
+extern unsigned char eprol asm ("eprol");
+extern start() asm("start");
+
start()
{
struct kframe {
start()
{
struct kframe {
@@
-47,7
+48,7
@@
start()
kfp = 0;
initcode = initcode = 0;
#else not lint
kfp = 0;
initcode = initcode = 0;
#else not lint
- asm("
lea 4(%ebp),%ebx");
/* catch it quick */
+ asm("
lea 4(%ebp),%ebx");
/* catch it quick */
#endif not lint
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
#endif not lint
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
@@
-77,19
+78,17
@@
asm("eprol:");
errno = 0;
exit(main(kfp->kargc, argv, environ));
}
errno = 0;
exit(main(kfp->kargc, argv, environ));
}
-asm("#undef _start");
-asm("#undef _eprol");
#ifdef MCRT0
/*ARGSUSED*/
exit(code)
#ifdef MCRT0
/*ARGSUSED*/
exit(code)
- register int code;
/* r11 */
+ register int code;
{
monitor(0);
_cleanup();
{
monitor(0);
_cleanup();
- asm("
pushl 8(
bp)") ;
- asm("
movl $1,%eax");
- asm("
.byte 0x9a; .long 0; .word 0");
+ asm("
pushl 8(%e
bp)") ;
+ asm("movl $1,%eax");
+ asm(".byte 0x9a; .long 0; .word 0");
}
#endif MCRT0
}
#endif MCRT0
@@
-103,6
+102,6
@@
moncontrol(val)
{
}
{
}
-asm("
.globl
mcount");
-asm("mcount:
ret");
+asm("
.globl
mcount");
+asm("mcount: ret");
#endif CRT0
#endif CRT0