genassym.cf revision 1.1 1 # $NetBSD: genassym.cf,v 1.1 2003/02/03 17:10:09 matt Exp $
2
3 #
4 # Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 # Copyright (C) 1995, 1996 TooLs GmbH.
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
16 # 3. All advertising materials mentioning features or use of this software
17 # must display the following acknowledgement:
18 # This product includes software developed by TooLs GmbH.
19 # 4. The name of TooLs GmbH may not be used to endorse or promote products
20 # derived from this software without specific prior written permission.
21 #
22 # THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 # IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #
33
34 include <sys/param.h>
35 include <sys/time.h>
36 include <sys/proc.h>
37
38 include <uvm/uvm_extern.h>
39
40 include <machine/pcb.h>
41 include <machine/pmap.h>
42
43 include <powerpc/cpu.h>
44
45 define FRAMELEN FRAMELEN
46 define FRAME_0 offsetof(struct trapframe, fixreg[0])
47 define FRAME_1 offsetof(struct trapframe, fixreg[1])
48 define FRAME_2 offsetof(struct trapframe, fixreg[2])
49 define FRAME_3 offsetof(struct trapframe, fixreg[3])
50 define FRAME_LR offsetof(struct trapframe, lr)
51 define FRAME_CR offsetof(struct trapframe, cr)
52 define FRAME_CTR offsetof(struct trapframe, ctr)
53 define FRAME_XER offsetof(struct trapframe, xer)
54 define FRAME_SRR0 offsetof(struct trapframe, srr0)
55 define FRAME_SRR1 offsetof(struct trapframe, srr1)
56 define FRAME_DAR offsetof(struct trapframe, dar)
57 define FRAME_DSISR offsetof(struct trapframe, dsisr)
58 define FRAME_EXC offsetof(struct trapframe, exc)
59 define FRAME_VRSAVE offsetof(struct trapframe, tf_xtra[TF_VRSAVE])
60 define FRAME_MQ offsetof(struct trapframe, tf_xtra[TF_MQ])
61
62 define IFRAMELEN IFRAMELEN
63 define IFRAME_R1 offsetof(struct intrframe, r1)
64 define IFRAME_SRR1 offsetof(struct intrframe, srr1)
65 define IFRAME_SRR0 offsetof(struct intrframe, srr0)
66 define IFRAME_PRI offsetof(struct intrframe, pri)
67 define IFRAME_INTR_DEPTH offsetof(struct intrframe, intrdepth)
68 define IFRAME_PID offsetof(struct intrframe, pid)
69 define IFRAME_CTR offsetof(struct intrframe, ctr)
70 define IFRAME_XER offsetof(struct intrframe, xer)
71 define IFRAME_CR offsetof(struct intrframe, cr)
72 define IFRAME_LR offsetof(struct intrframe, lr)
73 define IFRAME_R12 offsetof(struct intrframe, r12)
74 define IFRAME_R11 offsetof(struct intrframe, r11)
75 define IFRAME_R10 offsetof(struct intrframe, r10)
76 define IFRAME_R9 offsetof(struct intrframe, r9)
77 define IFRAME_R8 offsetof(struct intrframe, r8)
78 define IFRAME_R7 offsetof(struct intrframe, r7)
79 define IFRAME_R6 offsetof(struct intrframe, r6)
80 define IFRAME_R5 offsetof(struct intrframe, r5)
81 define IFRAME_R4 offsetof(struct intrframe, r4)
82 define IFRAME_R3 offsetof(struct intrframe, r3)
83 define IFRAME_R0 offsetof(struct intrframe, r0)
84
85 define PM_SR offsetof(struct pmap, pm_sr[0])
86 define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR])
87 define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR])
88
89 define CALLFRAMELEN CALLFRAMELEN
90 define CFRAME_SP offsetof(struct callframe, sp)
91 define CFRAME_LR offsetof(struct callframe, lr)
92 define CFRAME_R30 offsetof(struct callframe, r30)
93 define CFRAME_R31 offsetof(struct callframe, r31)
94
95 define SFRAMELEN roundup(sizeof(struct switchframe), CALLFRAMELEN)
96 define SFRAME_SP offsetof(struct switchframe, sp)
97 define SFRAME_USER_SR offsetof(struct switchframe, user_sr)
98 define SFRAME_CR offsetof(struct switchframe, cr)
99 define SFRAME_R2 offsetof(struct switchframe, fixreg2)
100 define SFRAME_R19 offsetof(struct switchframe, fixreg[0])
101
102 define PCB_PMR offsetof(struct pcb, pcb_pmreal)
103 define PCB_SP offsetof(struct pcb, pcb_sp)
104 define PCB_SPL offsetof(struct pcb, pcb_spl)
105 define PCB_FAULT offsetof(struct pcb, pcb_onfault)
106
107 define L_FORW offsetof(struct lwp, l_forw)
108 define L_BACK offsetof(struct lwp, l_back)
109 define L_ADDR offsetof(struct lwp, l_addr)
110 define L_STAT offsetof(struct lwp, l_stat)
111 define L_CPU offsetof(struct lwp, l_cpu)
112 define L_PRIORITY offsetof(struct lwp, l_priority)
113 define L_PROC offsetof(struct lwp, l_proc)
114
115 define LSONPROC LSONPROC
116 define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
117
118 define CI_SIZE sizeof(struct cpu_info)
119 define CI_CURLWP offsetof(struct cpu_info, ci_curlwp)
120 define CI_CURPCB offsetof(struct cpu_info, ci_curpcb)
121 define CI_CURPM offsetof(struct cpu_info, ci_curpm)
122 define CI_IDLE_PCB offsetof(struct cpu_info, ci_idle_pcb)
123 define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending)
124 define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)
125 define CI_CPL offsetof(struct cpu_info, ci_cpl)
126 define CI_INTRDEPTH offsetof(struct cpu_info, ci_intrdepth)
127 define CI_INTSTK offsetof(struct cpu_info, ci_intstk)
128 define CI_SPILLSTK offsetof(struct cpu_info, ci_spillstk)
129 define CI_TEMPSAVE offsetof(struct cpu_info, ci_tempsave)
130 define CI_DDBSAVE offsetof(struct cpu_info, ci_ddbsave)
131 define CI_IPKDBSAVE offsetof(struct cpu_info, ci_ipkdbsave)
132 define CI_DISISAVE offsetof(struct cpu_info, ci_disisave)
133
134 define FB_PC offsetof(struct faultbuf, fb_pc)
135 define FB_SP offsetof(struct faultbuf, fb_sp)
136 define FB_R2 offsetof(struct faultbuf, fb_r2)
137 define FB_CR offsetof(struct faultbuf, fb_cr)
138 define FB_FIXREG offsetof(struct faultbuf, fb_fixreg)
139
140 define CACHELINESIZE CACHELINESIZE
141
142 define CPU_CI offsetof(struct cpu_info, ci_ci)
143