2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 1987 Sun Microsystems, Inc.
2N/A */
2N/A
2N/A#ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A .file "stret.s"
2N/A
2N/A#include <sys/asm_linkage.h>
2N/A
2N/A#define FROM %o0
2N/A#define SIZE %o1
2N/A#define TO %i0
2N/A#define MEMWORD %o3 /* use o-registers as temps */
2N/A#define TEMP %o4
2N/A#define TEMP2 %o5
2N/A#define UNIMP 0
2N/A#define MASK 0x00000fff
2N/A#define STRUCT_VAL_OFF (16*4)
2N/A#if STRET4
2N/A# define BYTES_PER_MOVE 4
2N/A# define LD ld
2N/A# define ST st
2N/A ENTRY2(.stret4,.stret8)
2N/A#endif
2N/A#if STRET2
2N/A# define BYTES_PER_MOVE 2
2N/A# define LD lduh
2N/A# define ST sth
2N/A ENTRY(.stret2)
2N/A#endif
2N/A#if STRET1
2N/A# define BYTES_PER_MOVE 1
2N/A# define LD ldub
2N/A# define ST stb
2N/A ENTRY(.stret1)
2N/A#endif
2N/A
2N/A /*
2N/A * see if key matches: if not,
2N/A * structure value not expected,
2N/A * so just return
2N/A */
2N/A ld [%i7+8],MEMWORD
2N/A and SIZE,MASK,TEMP
2N/A sethi %hi(UNIMP),TEMP2
2N/A or TEMP,TEMP2,TEMP2
2N/A cmp TEMP2,MEMWORD
2N/A bne .LE12
2N/A .empty
2N/A /*
2N/A * set expected return value
2N/A */
2N/A.L14:
2N/A ld [%fp+STRUCT_VAL_OFF],TO /* (DELAY SLOT) */
2N/A /*
2N/A * copy the struct using the same loop the compiler does
2N/A * for large structure assignment
2N/A */
2N/A.L15:
2N/A subcc SIZE,BYTES_PER_MOVE,SIZE
2N/A LD [FROM+SIZE],TEMP
2N/A bg .L15
2N/A ST TEMP,[TO+SIZE] /* (DELAY SLOT) */
2N/A /* bump return address */
2N/A add %i7,0x4,%i7
2N/A.LE12:
2N/A jmp %i7+8
2N/A restore
2N/A
2N/A#if STRET4
2N/A SET_SIZE(.stret4)
2N/A SET_SIZE(.stret8)
2N/A#endif
2N/A#if STRET2
2N/A SET_SIZE(.stret2)
2N/A#endif
2N/A#if STRET1
2N/A SET_SIZE(.stret1)
2N/A#endif