fromHudsonMacros.h revision 8029
12568SN/A/*
211192Sandreas.hansson@arm.com * Copyright (c) 1993-1994 The Hewlett-Packard Development Company
38713Sandreas.hansson@arm.com * All rights reserved.
48713Sandreas.hansson@arm.com *
58713Sandreas.hansson@arm.com * Redistribution and use in source and binary forms, with or without
68713Sandreas.hansson@arm.com * modification, are permitted provided that the following conditions are
78713Sandreas.hansson@arm.com * met: redistributions of source code must retain the above copyright
88713Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer;
98713Sandreas.hansson@arm.com * redistributions in binary form must reproduce the above copyright
108713Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer in the
118713Sandreas.hansson@arm.com * documentation and/or other materials provided with the distribution;
128713Sandreas.hansson@arm.com * neither the name of the copyright holders nor the names of its
138713Sandreas.hansson@arm.com * contributors may be used to endorse or promote products derived from
142568SN/A * this software without specific prior written permission.
152568SN/A *
162568SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172568SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182568SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192568SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202568SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212568SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222568SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232568SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242568SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252568SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262568SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272568SN/A */
282568SN/A
292568SN/A#ifndef HUDSON_MACROS_LOADED
302568SN/A#define	HUDSON_MACROS_LOADED	    1
312568SN/A
322568SN/A#define	STALL \
332568SN/A    mfpr    r31, pt0
342568SN/A
352568SN/A#define	NOP \
362568SN/A    bis	    $31, $31, $31
372568SN/A
382568SN/A/*
392665Ssaidi@eecs.umich.edu** Align code on an 8K byte page boundary.
402665Ssaidi@eecs.umich.edu*/
412665Ssaidi@eecs.umich.edu
428713Sandreas.hansson@arm.com#define	ALIGN_PAGE \
432568SN/A    .align  13
442568SN/A
452568SN/A/*
462982Sstever@eecs.umich.edu** Align code on a 32 byte block boundary.
4710405Sandreas.hansson@arm.com*/
488713Sandreas.hansson@arm.com
492568SN/A#define	ALIGN_BLOCK \
502568SN/A    .align  5
512568SN/A
529164Sandreas.hansson@arm.com/*
532568SN/A** Align code on a quadword boundary.
544762Snate@binkert.org*/
552568SN/A
569164Sandreas.hansson@arm.com#define ALIGN_BRANCH \
579164Sandreas.hansson@arm.com    .align  3
588851Sandreas.hansson@arm.com
599180Sandreas.hansson@arm.com/*
609235Sandreas.hansson@arm.com** Hardware vectors go in .text 0 sub-segment.
619164Sandreas.hansson@arm.com*/
629164Sandreas.hansson@arm.com
639164Sandreas.hansson@arm.com#define	HDW_VECTOR(offset) \
648851Sandreas.hansson@arm.com    . = offset
658713Sandreas.hansson@arm.com
668713Sandreas.hansson@arm.com/*
678713Sandreas.hansson@arm.com** Privileged CALL_PAL functions are in .text 1 sub-segment.
689164Sandreas.hansson@arm.com*/
699164Sandreas.hansson@arm.com
708851Sandreas.hansson@arm.com#define	CALL_PAL_PRIV(vector) \
719180Sandreas.hansson@arm.com    . = (PAL_CALL_PAL_PRIV_ENTRY+(vector<<6))
729164Sandreas.hansson@arm.com
739164Sandreas.hansson@arm.com/*
742643Sstever@eecs.umich.edu** Unprivileged CALL_PAL functions are in .text 1 sub-segment,
752643Sstever@eecs.umich.edu** the privileged bit is removed from these vectors.
762643Sstever@eecs.umich.edu*/
774435Ssaidi@eecs.umich.edu
785034Smilesck@eecs.umich.edu#define CALL_PAL_UNPRIV(vector) \
799180Sandreas.hansson@arm.com    . = (PAL_CALL_PAL_UNPRIV_ENTRY+((vector&0x3F)<<6))
809180Sandreas.hansson@arm.com
819180Sandreas.hansson@arm.com/*
829180Sandreas.hansson@arm.com** Implements a load "immediate" longword function
832643Sstever@eecs.umich.edu*/
842643Sstever@eecs.umich.edu#define LDLI(reg,val) \
852643Sstever@eecs.umich.edu        ldah	reg, ((val+0x8000) >> 16)(zero); \
869294Sandreas.hansson@arm.com        lda	reg, (val&0xffff)(reg)
879294Sandreas.hansson@arm.com
888922Swilliam.wang@arm.com#endif
898922Swilliam.wang@arm.com