Blame sysdeps/unix/sysv/linux/ia64/__start_context.S

Packit 6c4009
/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
/* When a context set up by __makecontext() is activated, control
Packit 6c4009
   transfers to __start_context.  When we get here:
Packit 6c4009
Packit 6c4009
	b1 = entry point of function to call
Packit 6c4009
	in0 = address of UCP to resume after function returns
Packit 6c4009
	in1 = global pointer for __start_context
Packit 6c4009
	out0 .. outN = arguments for function  */
Packit 6c4009
Packit 6c4009
ENTRY(__start_context)
Packit 6c4009
	.prologue
Packit 6c4009
	alloc r2 = ar.pfs, 2, 0, 8, 0
Packit 6c4009
Packit 6c4009
	.save rp, r4		// terminate call chain with a NULL rp
Packit 6c4009
	mov r4 = r0
Packit 6c4009
	;;
Packit 6c4009
Packit 6c4009
	.body
Packit 6c4009
	br.call.sptk rp = b1
Packit 6c4009
1:
Packit 6c4009
	mov gp = in1			// restore gp
Packit 6c4009
	cmp.ne p6,p0 = in0, r0		// uc_link != 0 ?
Packit 6c4009
	;;
Packit 6c4009
(p6)	mov out0 = in0
Packit 6c4009
(p6)	br.call.sptk rp = __setcontext
Packit 6c4009
.Lexit:
Packit 6c4009
	mov out0 = 0
Packit 6c4009
	br.call.sptk rp = HIDDEN_JUMPTARGET(exit)
Packit 6c4009
Packit 6c4009
1:	br.cond.sptk .Lexit
Packit 6c4009
END(__start_context)