genassym.cf revision 1.23 1 1.23 matt # $NetBSD: genassym.cf,v 1.23 2011/06/18 21:17:29 matt Exp $
2 1.1 matt
3 1.1 matt #
4 1.1 matt # Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 1.1 matt # Copyright (C) 1995, 1996 TooLs GmbH.
6 1.1 matt # All rights reserved.
7 1.1 matt #
8 1.1 matt # Redistribution and use in source and binary forms, with or without
9 1.1 matt # modification, are permitted provided that the following conditions
10 1.1 matt # are met:
11 1.1 matt # 1. Redistributions of source code must retain the above copyright
12 1.1 matt # notice, this list of conditions and the following disclaimer.
13 1.1 matt # 2. Redistributions in binary form must reproduce the above copyright
14 1.1 matt # notice, this list of conditions and the following disclaimer in the
15 1.1 matt # documentation and/or other materials provided with the distribution.
16 1.1 matt # 3. All advertising materials mentioning features or use of this software
17 1.1 matt # must display the following acknowledgement:
18 1.1 matt # This product includes software developed by TooLs GmbH.
19 1.1 matt # 4. The name of TooLs GmbH may not be used to endorse or promote products
20 1.1 matt # derived from this software without specific prior written permission.
21 1.1 matt #
22 1.1 matt # THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23 1.1 matt # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.1 matt # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.1 matt # IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 1.1 matt # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 1.1 matt # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 1.1 matt # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 1.1 matt # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 1.1 matt # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 1.1 matt # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.1 matt #
33 1.1 matt
34 1.2 matt include "opt_ppcarch.h"
35 1.2 matt
36 1.1 matt include <sys/param.h>
37 1.1 matt include <sys/time.h>
38 1.14 matt include <sys/mutex.h>
39 1.14 matt include <sys/rwlock.h>
40 1.1 matt include <sys/proc.h>
41 1.18 matt include <sys/bitops.h>
42 1.1 matt
43 1.1 matt include <uvm/uvm_extern.h>
44 1.1 matt
45 1.1 matt include <machine/pcb.h>
46 1.1 matt include <machine/pmap.h>
47 1.1 matt
48 1.1 matt include <powerpc/cpu.h>
49 1.13 garbled include <powerpc/oea/cpufeat.h>
50 1.1 matt
51 1.17 matt define FRAME_DAR offsetof(struct ktrapframe, ktf_tf.tf_dar)
52 1.17 matt define FRAME_DSISR offsetof(struct ktrapframe, ktf_tf.tf_dsisr)
53 1.17 matt define FRAME_VRSAVE offsetof(struct ktrapframe, ktf_tf.tf_vrsave)
54 1.17 matt define FRAME_MQ offsetof(struct ktrapframe, ktf_tf.tf_mq)
55 1.1 matt
56 1.2 matt ifdef PPC_OEA64
57 1.2 matt define PM_STEG offsetof(struct pmap, pm_steg_table)
58 1.2 matt else
59 1.23 matt define USER_SR USER_SR
60 1.23 matt define KERNEL_SR KERNEL_SR
61 1.1 matt define PM_SR offsetof(struct pmap, pm_sr[0])
62 1.1 matt define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR])
63 1.1 matt define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR])
64 1.2 matt endif
65 1.1 matt
66 1.23 matt define CI_TEMPSAVE offsetof(struct cpu_info, ci_tempsave)
67 1.23 matt define CI_DDBSAVE offsetof(struct cpu_info, ci_ddbsave)
68 1.23 matt define CI_IPKDBSAVE offsetof(struct cpu_info, ci_ipkdbsave)
69 1.23 matt define CI_DISISAVE offsetof(struct cpu_info, ci_disisave)
70 1.23 matt
71 1.23 matt define CPUSAVE_R28 CPUSAVE_R28*sizeof(register_t)
72 1.23 matt define CPUSAVE_R29 CPUSAVE_R29*sizeof(register_t)
73 1.23 matt define CPUSAVE_R30 CPUSAVE_R30*sizeof(register_t)
74 1.23 matt define CPUSAVE_R31 CPUSAVE_R31*sizeof(register_t)
75 1.23 matt define CPUSAVE_DAR CPUSAVE_DAR*sizeof(register_t)
76 1.23 matt define CPUSAVE_DSISR CPUSAVE_DSISR*sizeof(register_t)
77 1.23 matt define CPUSAVE_SRR0 CPUSAVE_SRR0*sizeof(register_t)
78 1.23 matt define CPUSAVE_SRR1 CPUSAVE_SRR1*sizeof(register_t)
79 1.23 matt
80 1.23 matt define OEACPU_64 OEACPU_64
81 1.23 matt define OEACPU_64_BRIDGE OEACPU_64_BRIDGE
82 1.23 matt define OEACPU_NOBAT OEACPU_NOBAT
83 1.23 matt define OEACPU_HIGHBAT OEACPU_HIGHBAT
84 1.23 matt define OEACPU_601 OEACPU_601
85 1.23 matt define OEACPU_HIGHSPRG OEACPU_HIGHSPRG
86 1.23 matt define OEACPU_ALTIVEC OEACPU_ALTIVEC
87 1.1 matt
88 1.17 matt define FPREG_F0 offsetof(struct fpreg, fpreg[0])
89 1.17 matt define FPREG_F1 offsetof(struct fpreg, fpreg[1])
90 1.17 matt define FPREG_F2 offsetof(struct fpreg, fpreg[2])
91 1.17 matt define FPREG_F3 offsetof(struct fpreg, fpreg[3])
92 1.17 matt define FPREG_F4 offsetof(struct fpreg, fpreg[4])
93 1.17 matt define FPREG_F5 offsetof(struct fpreg, fpreg[5])
94 1.17 matt define FPREG_F6 offsetof(struct fpreg, fpreg[6])
95 1.17 matt define FPREG_F7 offsetof(struct fpreg, fpreg[7])
96 1.17 matt define FPREG_F8 offsetof(struct fpreg, fpreg[8])
97 1.17 matt define FPREG_F9 offsetof(struct fpreg, fpreg[9])
98 1.17 matt define FPREG_F10 offsetof(struct fpreg, fpreg[10])
99 1.17 matt define FPREG_F11 offsetof(struct fpreg, fpreg[11])
100 1.17 matt define FPREG_F12 offsetof(struct fpreg, fpreg[12])
101 1.17 matt define FPREG_F13 offsetof(struct fpreg, fpreg[13])
102 1.17 matt define FPREG_F14 offsetof(struct fpreg, fpreg[14])
103 1.17 matt define FPREG_F15 offsetof(struct fpreg, fpreg[15])
104 1.17 matt define FPREG_F16 offsetof(struct fpreg, fpreg[16])
105 1.17 matt define FPREG_F17 offsetof(struct fpreg, fpreg[17])
106 1.17 matt define FPREG_F18 offsetof(struct fpreg, fpreg[18])
107 1.17 matt define FPREG_F19 offsetof(struct fpreg, fpreg[19])
108 1.17 matt define FPREG_F20 offsetof(struct fpreg, fpreg[20])
109 1.17 matt define FPREG_F21 offsetof(struct fpreg, fpreg[21])
110 1.17 matt define FPREG_F22 offsetof(struct fpreg, fpreg[22])
111 1.17 matt define FPREG_F23 offsetof(struct fpreg, fpreg[23])
112 1.17 matt define FPREG_F24 offsetof(struct fpreg, fpreg[24])
113 1.17 matt define FPREG_F25 offsetof(struct fpreg, fpreg[25])
114 1.17 matt define FPREG_F26 offsetof(struct fpreg, fpreg[26])
115 1.17 matt define FPREG_F27 offsetof(struct fpreg, fpreg[27])
116 1.17 matt define FPREG_F28 offsetof(struct fpreg, fpreg[28])
117 1.17 matt define FPREG_F29 offsetof(struct fpreg, fpreg[29])
118 1.17 matt define FPREG_F30 offsetof(struct fpreg, fpreg[30])
119 1.17 matt define FPREG_F31 offsetof(struct fpreg, fpreg[31])
120 1.17 matt define FPREG_FPSCR offsetof(struct fpreg, fpscr)
121 1.17 matt
122 1.17 matt define VREG_V0 offsetof(struct vreg, vreg[0][0])
123 1.17 matt define VREG_V1 offsetof(struct vreg, vreg[1][0])
124 1.17 matt define VREG_V2 offsetof(struct vreg, vreg[2][0])
125 1.17 matt define VREG_V3 offsetof(struct vreg, vreg[3][0])
126 1.17 matt define VREG_V4 offsetof(struct vreg, vreg[4][0])
127 1.17 matt define VREG_V5 offsetof(struct vreg, vreg[5][0])
128 1.17 matt define VREG_V6 offsetof(struct vreg, vreg[6][0])
129 1.17 matt define VREG_V7 offsetof(struct vreg, vreg[7][0])
130 1.17 matt define VREG_V8 offsetof(struct vreg, vreg[8][0])
131 1.17 matt define VREG_V9 offsetof(struct vreg, vreg[9][0])
132 1.17 matt define VREG_V10 offsetof(struct vreg, vreg[10][0])
133 1.17 matt define VREG_V11 offsetof(struct vreg, vreg[11][0])
134 1.17 matt define VREG_V12 offsetof(struct vreg, vreg[12][0])
135 1.17 matt define VREG_V13 offsetof(struct vreg, vreg[13][0])
136 1.17 matt define VREG_V14 offsetof(struct vreg, vreg[14][0])
137 1.17 matt define VREG_V15 offsetof(struct vreg, vreg[15][0])
138 1.17 matt define VREG_V16 offsetof(struct vreg, vreg[16][0])
139 1.17 matt define VREG_V17 offsetof(struct vreg, vreg[17][0])
140 1.17 matt define VREG_V18 offsetof(struct vreg, vreg[18][0])
141 1.17 matt define VREG_V19 offsetof(struct vreg, vreg[19][0])
142 1.17 matt define VREG_V20 offsetof(struct vreg, vreg[20][0])
143 1.17 matt define VREG_V21 offsetof(struct vreg, vreg[21][0])
144 1.17 matt define VREG_V22 offsetof(struct vreg, vreg[22][0])
145 1.17 matt define VREG_V23 offsetof(struct vreg, vreg[23][0])
146 1.17 matt define VREG_V24 offsetof(struct vreg, vreg[24][0])
147 1.17 matt define VREG_V25 offsetof(struct vreg, vreg[25][0])
148 1.17 matt define VREG_V26 offsetof(struct vreg, vreg[26][0])
149 1.17 matt define VREG_V27 offsetof(struct vreg, vreg[27][0])
150 1.17 matt define VREG_V28 offsetof(struct vreg, vreg[28][0])
151 1.17 matt define VREG_V29 offsetof(struct vreg, vreg[29][0])
152 1.17 matt define VREG_V30 offsetof(struct vreg, vreg[30][0])
153 1.17 matt define VREG_V31 offsetof(struct vreg, vreg[31][0])
154 1.17 matt define VREG_VRSAVE offsetof(struct vreg, vrsave)
155 1.17 matt define VREG_VSCR offsetof(struct vreg, vscr)
156