xref: /onnv-gate/usr/src/uts/sun4u/ml/memscrub_asm.s (revision 3876:5643dbdd82be)
10Sstevel@tonic-gate/*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate * with the License.
80Sstevel@tonic-gate *
90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate * See the License for the specific language governing permissions
120Sstevel@tonic-gate * and limitations under the License.
130Sstevel@tonic-gate *
140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate *
200Sstevel@tonic-gate * CDDL HEADER END
210Sstevel@tonic-gate */
220Sstevel@tonic-gate/*
23*3876Spt157919 * Copyright (c) 2007 by Sun Microsystems, Inc.
240Sstevel@tonic-gate */
250Sstevel@tonic-gate
260Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
270Sstevel@tonic-gate
280Sstevel@tonic-gate/*
290Sstevel@tonic-gate * General machine architecture & implementation specific
300Sstevel@tonic-gate * assembly language routines.
310Sstevel@tonic-gate */
320Sstevel@tonic-gate#if defined(lint)
330Sstevel@tonic-gate#include <sys/types.h>
340Sstevel@tonic-gate#include <sys/machsystm.h>
350Sstevel@tonic-gate#include <sys/t_lock.h>
360Sstevel@tonic-gate#else   /* lint */
370Sstevel@tonic-gate#include "assym.h"
380Sstevel@tonic-gate#endif  /* lint */
390Sstevel@tonic-gate
400Sstevel@tonic-gate#include <sys/asm_linkage.h>
410Sstevel@tonic-gate#include <sys/eeprom.h>
420Sstevel@tonic-gate#include <sys/param.h>
430Sstevel@tonic-gate#include <sys/async.h>
440Sstevel@tonic-gate#include <sys/intreg.h>
450Sstevel@tonic-gate#include <sys/machthread.h>
460Sstevel@tonic-gate#include <sys/iocache.h>
470Sstevel@tonic-gate#include <sys/privregs.h>
480Sstevel@tonic-gate#include <sys/archsystm.h>
490Sstevel@tonic-gate
500Sstevel@tonic-gate#if defined(lint)
510Sstevel@tonic-gate
520Sstevel@tonic-gate/*ARGSUSED*/
530Sstevel@tonic-gatevoid
540Sstevel@tonic-gatememscrub_read(caddr_t vaddr, u_int blks)
550Sstevel@tonic-gate{}
560Sstevel@tonic-gate
570Sstevel@tonic-gate#else	/* lint */
580Sstevel@tonic-gate
590Sstevel@tonic-gate	!
600Sstevel@tonic-gate	! void	memscrub_read(caddr_t src, u_int blks)
610Sstevel@tonic-gate	!
620Sstevel@tonic-gate
630Sstevel@tonic-gate	.seg ".text"
640Sstevel@tonic-gate	.align	4
650Sstevel@tonic-gate
660Sstevel@tonic-gate	ENTRY(memscrub_read)
670Sstevel@tonic-gate	srl	%o1, 0, %o1			! clear upper word of blk count
680Sstevel@tonic-gate        rd	%fprs, %o2			! get the status of fp
690Sstevel@tonic-gate	wr	%g0, FPRS_FEF, %fprs		! enable fp
700Sstevel@tonic-gate
710Sstevel@tonic-gate1:
72*3876Spt157919	prefetch [%o0 + 8*64], 0
730Sstevel@tonic-gate	ldda	[%o0]ASI_BLK_P, %d0
740Sstevel@tonic-gate	add	%o0, 64, %o0
75*3876Spt157919	prefetch [%o0 + 8*64], 0
760Sstevel@tonic-gate	ldda	[%o0]ASI_BLK_P, %d16
770Sstevel@tonic-gate	add	%o0, 64, %o0
78*3876Spt157919	prefetch [%o0 + 8*64], 0
790Sstevel@tonic-gate	ldda	[%o0]ASI_BLK_P, %d32
800Sstevel@tonic-gate	add	%o0, 64, %o0
81*3876Spt157919	prefetch [%o0 + 8*64], 0
820Sstevel@tonic-gate	ldda	[%o0]ASI_BLK_P, %d48
830Sstevel@tonic-gate	dec	%o1
840Sstevel@tonic-gate	brnz,a	%o1, 1b
850Sstevel@tonic-gate	add	%o0, 64, %o0
860Sstevel@tonic-gate
870Sstevel@tonic-gate	retl
880Sstevel@tonic-gate	wr	%o2, 0, %fprs			! restore fprs (disabled)
890Sstevel@tonic-gate	SET_SIZE(memscrub_read)
900Sstevel@tonic-gate
910Sstevel@tonic-gate#endif	/* lint */
92