Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Oct 2001 01:19:47 -0700
From:      Peter Wemm <peter@wemm.org>
To:        dfr@nlsystems.com
Cc:        ia64@freebsd.org
Subject:   ia64 crti.S and crtn.S
Message-ID:  <20011027081947.A3B56380A@overcee.netplex.com.au>

index | next in thread | raw e-mail

I've discovered there are no crti/crtn implementations in the tree.. I've
hacked together these ultra-trivial crti/crtn implementations:

	.file	"crti.S"

	.section .init
	.global _init#
	.proc _init#
_init:
	alloc loc1 = ar.pfs,0,2,0,0
	mov loc0 = b0			/* Save return addr */
	.endp _init#

	.section .fini
	.global _fini#
	.proc _fini#
_fini:
	alloc loc1 = ar.pfs,0,2,0,0
	mov loc0 = b0			/* Save return addr */
	.endp _fini#

And:
	.file	"crtn.S"

	.section .init
	.regstk 0,2,0,0
	mov b0 = loc0			/* Recover return addr */
	mov ar.pfs = loc1
	br.ret.sptk.many b0
	.endp _init#

	.section .fini
	.regstk 0,2,0,0
	mov b0 = loc0			/* Recover return addr */
	mov ar.pfs = loc1
	br.ret.sptk.many b0
	.endp _fini#

Would anybody care to comment on these?  I'm in the process of putting
together a build script to build the working parts of the userland,
libraries and includes in one go, and these files came up.

Second question.. Can I use a caller-saved register (eg: r4-r7) for this
to avoid the pfs save/restore?  Or would I have to use the register stack
anyway in order to preserve our caller's r4-r7 first, thus defeating
the purpose?

(This is partly based on gcc output for clues).

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ia64" in the body of the message



help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011027081947.A3B56380A>