//
// Copyright (c) 2002 Xilinx, Inc.  All rights reserved. 
// Xilinx, Inc. 
//
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 
// COURTESY TO YOU.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 
// ONE POSSIBLE   IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 
// STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 
// IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 
// FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 
// XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 
// THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 
// ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 
// FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 
// AND FITNESS FOR A PARTICULAR PURPOSE. 
//
// $Id: profile_mcount_ppc.S,v 1.1.2.1 2011/05/17 04:37:58 sadanan Exp $
//
	.globl _mcount
	
	#define _MCOUNT_STACK_FRAME 48			
	.section .text 
	.align 2
	.type _mcount@function


_mcount:
	stwu 1,	-_MCOUNT_STACK_FRAME(1)
	stw 3, 8(1)
	stw 4, 12(1)
	stw 5, 16(1)
	stw 6, 20(1)
	stw 7, 24(1)
	stw 8, 28(1)
	stw 9, 32(1)
	stw 10, 36(1)
	stw 11, 40(1)
	stw 12, 44(1)
	mflr 4
	stw 4, (_MCOUNT_STACK_FRAME+4)(1)
	lwz 3, (_MCOUNT_STACK_FRAME)(1)
	lwz 3, 4(3)	
	bl mcount
	lwz 4, (_MCOUNT_STACK_FRAME+4)(1)
	mtlr 4
	lwz 12, 44(1)
	lwz 11, 40(1)
	lwz 10, 36(1)
	lwz 9, 32(1)
	lwz 8, 28(1)
	lwz 7, 24(1)
	lwz 6, 20(1)
	lwz 5, 16(1)
	lwz 4, 12(1)
	lwz 3, 8(1)	
	addi 1,1, _MCOUNT_STACK_FRAME
	blr
	
