1/*
2 * Copyright (c) 1993-1994 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef HUDSON_MACROS_LOADED
30#define	HUDSON_MACROS_LOADED	    1
31
32#define	STALL \
33    mfpr    r31, pt0
34
35#define	NOP \
36    bis	    $31, $31, $31
37
38/*
39** Align code on an 8K byte page boundary.
40*/
41
42#define	ALIGN_PAGE \
43    .align  13
44
45/*
46** Align code on a 32 byte block boundary.
47*/
48
49#define	ALIGN_BLOCK \
50    .align  5
51
52/*
53** Align code on a quadword boundary.
54*/
55
56#define ALIGN_BRANCH \
57    .align  3
58
59/*
60** Hardware vectors go in .text 0 sub-segment.
61*/
62
63#define	HDW_VECTOR(offset) \
64    . = offset
65
66/*
67** Privileged CALL_PAL functions are in .text 1 sub-segment.
68*/
69
70#define	CALL_PAL_PRIV(vector) \
71    . = (PAL_CALL_PAL_PRIV_ENTRY+(vector<<6))
72
73/*
74** Unprivileged CALL_PAL functions are in .text 1 sub-segment,
75** the privileged bit is removed from these vectors.
76*/
77
78#define CALL_PAL_UNPRIV(vector) \
79    . = (PAL_CALL_PAL_UNPRIV_ENTRY+((vector&0x3F)<<6))
80
81/*
82** Implements a load "immediate" longword function
83*/
84#define LDLI(reg,val) \
85        ldah	reg, ((val+0x8000) >> 16)(zero); \
86        lda	reg, (val&0xffff)(reg)
87
88#endif
89