genassym.cf revision 1.29 1 1.29 thorpej # $NetBSD: genassym.cf,v 1.29 2021/02/24 16:42:38 thorpej 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.28 rin #ifdef _KERNEL_OPT
35 1.2 matt include "opt_ppcarch.h"
36 1.28 rin #endif
37 1.2 matt
38 1.1 matt include <sys/param.h>
39 1.1 matt include <sys/time.h>
40 1.14 matt include <sys/mutex.h>
41 1.14 matt include <sys/rwlock.h>
42 1.1 matt include <sys/proc.h>
43 1.18 matt include <sys/bitops.h>
44 1.1 matt
45 1.1 matt include <uvm/uvm_extern.h>
46 1.1 matt
47 1.1 matt include <machine/pcb.h>
48 1.1 matt include <machine/pmap.h>
49 1.1 matt
50 1.1 matt include <powerpc/cpu.h>
51 1.26 matt include <powerpc/oea/bat.h>
52 1.13 garbled include <powerpc/oea/cpufeat.h>
53 1.1 matt
54 1.17 matt define FRAME_DAR offsetof(struct ktrapframe, ktf_tf.tf_dar)
55 1.17 matt define FRAME_DSISR offsetof(struct ktrapframe, ktf_tf.tf_dsisr)
56 1.17 matt define FRAME_VRSAVE offsetof(struct ktrapframe, ktf_tf.tf_vrsave)
57 1.17 matt define FRAME_MQ offsetof(struct ktrapframe, ktf_tf.tf_mq)
58 1.1 matt
59 1.2 matt ifdef PPC_OEA64
60 1.2 matt define PM_STEG offsetof(struct pmap, pm_steg_table)
61 1.2 matt else
62 1.23 matt define USER_SR USER_SR
63 1.23 matt define KERNEL_SR KERNEL_SR
64 1.1 matt define PM_SR offsetof(struct pmap, pm_sr[0])
65 1.1 matt define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR])
66 1.1 matt define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR])
67 1.2 matt endif
68 1.1 matt
69 1.29 thorpej define CI_BATTABLE offsetof(struct cpu_info, ci_battable)
70 1.24 matt define CI_TEMPSAVE offsetof(struct cpu_info, ci_savearea[CI_SAVETEMP])
71 1.24 matt define CI_DDBSAVE offsetof(struct cpu_info, ci_savearea[CI_SAVEDDB])
72 1.24 matt define CI_DISISAVE offsetof(struct cpu_info, ci_savearea[CI_SAVEMMU])
73 1.23 matt
74 1.23 matt define CPUSAVE_R28 CPUSAVE_R28*sizeof(register_t)
75 1.23 matt define CPUSAVE_R29 CPUSAVE_R29*sizeof(register_t)
76 1.23 matt define CPUSAVE_R30 CPUSAVE_R30*sizeof(register_t)
77 1.23 matt define CPUSAVE_R31 CPUSAVE_R31*sizeof(register_t)
78 1.23 matt define CPUSAVE_DAR CPUSAVE_DAR*sizeof(register_t)
79 1.23 matt define CPUSAVE_DSISR CPUSAVE_DSISR*sizeof(register_t)
80 1.23 matt define CPUSAVE_SRR0 CPUSAVE_SRR0*sizeof(register_t)
81 1.23 matt define CPUSAVE_SRR1 CPUSAVE_SRR1*sizeof(register_t)
82 1.23 matt
83 1.23 matt define OEACPU_64 OEACPU_64
84 1.23 matt define OEACPU_64_BRIDGE OEACPU_64_BRIDGE
85 1.23 matt define OEACPU_NOBAT OEACPU_NOBAT
86 1.23 matt define OEACPU_HIGHBAT OEACPU_HIGHBAT
87 1.23 matt define OEACPU_601 OEACPU_601
88 1.23 matt define OEACPU_HIGHSPRG OEACPU_HIGHSPRG
89 1.23 matt define OEACPU_ALTIVEC OEACPU_ALTIVEC
90 1.1 matt
91 1.26 matt define BAT_ADDR_SHIFT ilog2(BAT_IDX2VA(1))
92 1.26 matt
93 1.25 matt define PTE_REF PTE_REF
94 1.25 matt define PTE_CHG PTE_CHG
95 1.25 matt define PTE_HID PTE_HID
96 1.25 matt define PTE_G PTE_G
97 1.25 matt
98 1.17 matt define FPREG_F0 offsetof(struct fpreg, fpreg[0])
99 1.17 matt define FPREG_F1 offsetof(struct fpreg, fpreg[1])
100 1.17 matt define FPREG_F2 offsetof(struct fpreg, fpreg[2])
101 1.17 matt define FPREG_F3 offsetof(struct fpreg, fpreg[3])
102 1.17 matt define FPREG_F4 offsetof(struct fpreg, fpreg[4])
103 1.17 matt define FPREG_F5 offsetof(struct fpreg, fpreg[5])
104 1.17 matt define FPREG_F6 offsetof(struct fpreg, fpreg[6])
105 1.17 matt define FPREG_F7 offsetof(struct fpreg, fpreg[7])
106 1.17 matt define FPREG_F8 offsetof(struct fpreg, fpreg[8])
107 1.17 matt define FPREG_F9 offsetof(struct fpreg, fpreg[9])
108 1.17 matt define FPREG_F10 offsetof(struct fpreg, fpreg[10])
109 1.17 matt define FPREG_F11 offsetof(struct fpreg, fpreg[11])
110 1.17 matt define FPREG_F12 offsetof(struct fpreg, fpreg[12])
111 1.17 matt define FPREG_F13 offsetof(struct fpreg, fpreg[13])
112 1.17 matt define FPREG_F14 offsetof(struct fpreg, fpreg[14])
113 1.17 matt define FPREG_F15 offsetof(struct fpreg, fpreg[15])
114 1.17 matt define FPREG_F16 offsetof(struct fpreg, fpreg[16])
115 1.17 matt define FPREG_F17 offsetof(struct fpreg, fpreg[17])
116 1.17 matt define FPREG_F18 offsetof(struct fpreg, fpreg[18])
117 1.17 matt define FPREG_F19 offsetof(struct fpreg, fpreg[19])
118 1.17 matt define FPREG_F20 offsetof(struct fpreg, fpreg[20])
119 1.17 matt define FPREG_F21 offsetof(struct fpreg, fpreg[21])
120 1.17 matt define FPREG_F22 offsetof(struct fpreg, fpreg[22])
121 1.17 matt define FPREG_F23 offsetof(struct fpreg, fpreg[23])
122 1.17 matt define FPREG_F24 offsetof(struct fpreg, fpreg[24])
123 1.17 matt define FPREG_F25 offsetof(struct fpreg, fpreg[25])
124 1.17 matt define FPREG_F26 offsetof(struct fpreg, fpreg[26])
125 1.17 matt define FPREG_F27 offsetof(struct fpreg, fpreg[27])
126 1.17 matt define FPREG_F28 offsetof(struct fpreg, fpreg[28])
127 1.17 matt define FPREG_F29 offsetof(struct fpreg, fpreg[29])
128 1.17 matt define FPREG_F30 offsetof(struct fpreg, fpreg[30])
129 1.17 matt define FPREG_F31 offsetof(struct fpreg, fpreg[31])
130 1.17 matt define FPREG_FPSCR offsetof(struct fpreg, fpscr)
131 1.17 matt
132 1.17 matt define VREG_V0 offsetof(struct vreg, vreg[0][0])
133 1.17 matt define VREG_V1 offsetof(struct vreg, vreg[1][0])
134 1.17 matt define VREG_V2 offsetof(struct vreg, vreg[2][0])
135 1.17 matt define VREG_V3 offsetof(struct vreg, vreg[3][0])
136 1.17 matt define VREG_V4 offsetof(struct vreg, vreg[4][0])
137 1.17 matt define VREG_V5 offsetof(struct vreg, vreg[5][0])
138 1.17 matt define VREG_V6 offsetof(struct vreg, vreg[6][0])
139 1.17 matt define VREG_V7 offsetof(struct vreg, vreg[7][0])
140 1.17 matt define VREG_V8 offsetof(struct vreg, vreg[8][0])
141 1.17 matt define VREG_V9 offsetof(struct vreg, vreg[9][0])
142 1.17 matt define VREG_V10 offsetof(struct vreg, vreg[10][0])
143 1.17 matt define VREG_V11 offsetof(struct vreg, vreg[11][0])
144 1.17 matt define VREG_V12 offsetof(struct vreg, vreg[12][0])
145 1.17 matt define VREG_V13 offsetof(struct vreg, vreg[13][0])
146 1.17 matt define VREG_V14 offsetof(struct vreg, vreg[14][0])
147 1.17 matt define VREG_V15 offsetof(struct vreg, vreg[15][0])
148 1.17 matt define VREG_V16 offsetof(struct vreg, vreg[16][0])
149 1.17 matt define VREG_V17 offsetof(struct vreg, vreg[17][0])
150 1.17 matt define VREG_V18 offsetof(struct vreg, vreg[18][0])
151 1.17 matt define VREG_V19 offsetof(struct vreg, vreg[19][0])
152 1.17 matt define VREG_V20 offsetof(struct vreg, vreg[20][0])
153 1.17 matt define VREG_V21 offsetof(struct vreg, vreg[21][0])
154 1.17 matt define VREG_V22 offsetof(struct vreg, vreg[22][0])
155 1.17 matt define VREG_V23 offsetof(struct vreg, vreg[23][0])
156 1.17 matt define VREG_V24 offsetof(struct vreg, vreg[24][0])
157 1.17 matt define VREG_V25 offsetof(struct vreg, vreg[25][0])
158 1.17 matt define VREG_V26 offsetof(struct vreg, vreg[26][0])
159 1.17 matt define VREG_V27 offsetof(struct vreg, vreg[27][0])
160 1.17 matt define VREG_V28 offsetof(struct vreg, vreg[28][0])
161 1.17 matt define VREG_V29 offsetof(struct vreg, vreg[29][0])
162 1.17 matt define VREG_V30 offsetof(struct vreg, vreg[30][0])
163 1.17 matt define VREG_V31 offsetof(struct vreg, vreg[31][0])
164 1.17 matt define VREG_VRSAVE offsetof(struct vreg, vrsave)
165 1.17 matt define VREG_VSCR offsetof(struct vreg, vscr)
166