Date: Wed, 30 Apr 2003 09:36:26 -0700 (PDT) From: "David E. O'Brien" <obrien@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 30096 for review Message-ID: <200304301636.h3UGaQ4t046510@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=30096 Change 30096 by obrien@obrien_trang on 2003/04/30 09:35:47 Convert to x86-64 ISA using NetBSD as a reference. Affected files ... .. //depot/projects/hammer/lib/libc/amd64/gen/alloca.S#4 edit Differences ... ==== //depot/projects/hammer/lib/libc/amd64/gen/alloca.S#4 (text+ko) ==== @@ -45,15 +45,12 @@ /* like alloc, but automatic automatic free in return */ ENTRY(alloca) - popl %edx /* pop return addr */ - popl %eax /* pop amount to allocate */ - movl %esp,%ecx - addl $3,%eax /* round up to next word */ - andl $0xfffffffc,%eax - subl %eax,%esp - movl %esp,%eax /* base of newly allocated space */ - pushl 8(%ecx) /* copy possible saved registers */ - pushl 4(%ecx) - pushl 0(%ecx) - pushl %eax /* dummy to pop at callsite */ - jmp *%edx /* "return" */ + popq %rdx /* pop return addr */ + movl %rsp,%rcx + addq $15,%rdi /* round up to 16 bytes */ + andq $~15,%rdi + subq %rdi,%rsp + movq %rsp,%rax /* base of newly allocated space */ + jmp *%rdx /* "return" */ + +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304301636.h3UGaQ4t046510>