fromHudsonMacros.h revision 8013:2dfcde2e9998
1/*
2 * Copyright 1993, 1994 Hewlett-Packard Development Company, L.P.
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef HUDSON_MACROS_LOADED
26#define	HUDSON_MACROS_LOADED	    1
27
28#define	STALL \
29    mfpr    r31, pt0
30
31#define	NOP \
32    bis	    $31, $31, $31
33
34/*
35** Align code on an 8K byte page boundary.
36*/
37
38#define	ALIGN_PAGE \
39    .align  13
40
41/*
42** Align code on a 32 byte block boundary.
43*/
44
45#define	ALIGN_BLOCK \
46    .align  5
47
48/*
49** Align code on a quadword boundary.
50*/
51
52#define ALIGN_BRANCH \
53    .align  3
54
55/*
56** Hardware vectors go in .text 0 sub-segment.
57*/
58
59#define	HDW_VECTOR(offset) \
60    . = offset
61
62/*
63** Privileged CALL_PAL functions are in .text 1 sub-segment.
64*/
65
66#define	CALL_PAL_PRIV(vector) \
67    . = (PAL_CALL_PAL_PRIV_ENTRY+(vector<<6))
68
69/*
70** Unprivileged CALL_PAL functions are in .text 1 sub-segment,
71** the privileged bit is removed from these vectors.
72*/
73
74#define CALL_PAL_UNPRIV(vector) \
75    . = (PAL_CALL_PAL_UNPRIV_ENTRY+((vector&0x3F)<<6))
76
77/*
78** Implements a load "immediate" longword function
79*/
80#define LDLI(reg,val) \
81        ldah	reg, ((val+0x8000) >> 16)(zero); \
82        lda	reg, (val&0xffff)(reg)
83
84#endif
85