genassym.cf revision 1.1 1 1.1 matt # $NetBSD: genassym.cf,v 1.1 2003/02/03 17:10:09 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.1 matt include <sys/param.h>
35 1.1 matt include <sys/time.h>
36 1.1 matt include <sys/proc.h>
37 1.1 matt
38 1.1 matt include <uvm/uvm_extern.h>
39 1.1 matt
40 1.1 matt include <machine/pcb.h>
41 1.1 matt include <machine/pmap.h>
42 1.1 matt
43 1.1 matt include <powerpc/cpu.h>
44 1.1 matt
45 1.1 matt define FRAMELEN FRAMELEN
46 1.1 matt define FRAME_0 offsetof(struct trapframe, fixreg[0])
47 1.1 matt define FRAME_1 offsetof(struct trapframe, fixreg[1])
48 1.1 matt define FRAME_2 offsetof(struct trapframe, fixreg[2])
49 1.1 matt define FRAME_3 offsetof(struct trapframe, fixreg[3])
50 1.1 matt define FRAME_LR offsetof(struct trapframe, lr)
51 1.1 matt define FRAME_CR offsetof(struct trapframe, cr)
52 1.1 matt define FRAME_CTR offsetof(struct trapframe, ctr)
53 1.1 matt define FRAME_XER offsetof(struct trapframe, xer)
54 1.1 matt define FRAME_SRR0 offsetof(struct trapframe, srr0)
55 1.1 matt define FRAME_SRR1 offsetof(struct trapframe, srr1)
56 1.1 matt define FRAME_DAR offsetof(struct trapframe, dar)
57 1.1 matt define FRAME_DSISR offsetof(struct trapframe, dsisr)
58 1.1 matt define FRAME_EXC offsetof(struct trapframe, exc)
59 1.1 matt define FRAME_VRSAVE offsetof(struct trapframe, tf_xtra[TF_VRSAVE])
60 1.1 matt define FRAME_MQ offsetof(struct trapframe, tf_xtra[TF_MQ])
61 1.1 matt
62 1.1 matt define IFRAMELEN IFRAMELEN
63 1.1 matt define IFRAME_R1 offsetof(struct intrframe, r1)
64 1.1 matt define IFRAME_SRR1 offsetof(struct intrframe, srr1)
65 1.1 matt define IFRAME_SRR0 offsetof(struct intrframe, srr0)
66 1.1 matt define IFRAME_PRI offsetof(struct intrframe, pri)
67 1.1 matt define IFRAME_INTR_DEPTH offsetof(struct intrframe, intrdepth)
68 1.1 matt define IFRAME_PID offsetof(struct intrframe, pid)
69 1.1 matt define IFRAME_CTR offsetof(struct intrframe, ctr)
70 1.1 matt define IFRAME_XER offsetof(struct intrframe, xer)
71 1.1 matt define IFRAME_CR offsetof(struct intrframe, cr)
72 1.1 matt define IFRAME_LR offsetof(struct intrframe, lr)
73 1.1 matt define IFRAME_R12 offsetof(struct intrframe, r12)
74 1.1 matt define IFRAME_R11 offsetof(struct intrframe, r11)
75 1.1 matt define IFRAME_R10 offsetof(struct intrframe, r10)
76 1.1 matt define IFRAME_R9 offsetof(struct intrframe, r9)
77 1.1 matt define IFRAME_R8 offsetof(struct intrframe, r8)
78 1.1 matt define IFRAME_R7 offsetof(struct intrframe, r7)
79 1.1 matt define IFRAME_R6 offsetof(struct intrframe, r6)
80 1.1 matt define IFRAME_R5 offsetof(struct intrframe, r5)
81 1.1 matt define IFRAME_R4 offsetof(struct intrframe, r4)
82 1.1 matt define IFRAME_R3 offsetof(struct intrframe, r3)
83 1.1 matt define IFRAME_R0 offsetof(struct intrframe, r0)
84 1.1 matt
85 1.1 matt define PM_SR offsetof(struct pmap, pm_sr[0])
86 1.1 matt define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR])
87 1.1 matt define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR])
88 1.1 matt
89 1.1 matt define CALLFRAMELEN CALLFRAMELEN
90 1.1 matt define CFRAME_SP offsetof(struct callframe, sp)
91 1.1 matt define CFRAME_LR offsetof(struct callframe, lr)
92 1.1 matt define CFRAME_R30 offsetof(struct callframe, r30)
93 1.1 matt define CFRAME_R31 offsetof(struct callframe, r31)
94 1.1 matt
95 1.1 matt define SFRAMELEN roundup(sizeof(struct switchframe), CALLFRAMELEN)
96 1.1 matt define SFRAME_SP offsetof(struct switchframe, sp)
97 1.1 matt define SFRAME_USER_SR offsetof(struct switchframe, user_sr)
98 1.1 matt define SFRAME_CR offsetof(struct switchframe, cr)
99 1.1 matt define SFRAME_R2 offsetof(struct switchframe, fixreg2)
100 1.1 matt define SFRAME_R19 offsetof(struct switchframe, fixreg[0])
101 1.1 matt
102 1.1 matt define PCB_PMR offsetof(struct pcb, pcb_pmreal)
103 1.1 matt define PCB_SP offsetof(struct pcb, pcb_sp)
104 1.1 matt define PCB_SPL offsetof(struct pcb, pcb_spl)
105 1.1 matt define PCB_FAULT offsetof(struct pcb, pcb_onfault)
106 1.1 matt
107 1.1 matt define L_FORW offsetof(struct lwp, l_forw)
108 1.1 matt define L_BACK offsetof(struct lwp, l_back)
109 1.1 matt define L_ADDR offsetof(struct lwp, l_addr)
110 1.1 matt define L_STAT offsetof(struct lwp, l_stat)
111 1.1 matt define L_CPU offsetof(struct lwp, l_cpu)
112 1.1 matt define L_PRIORITY offsetof(struct lwp, l_priority)
113 1.1 matt define L_PROC offsetof(struct lwp, l_proc)
114 1.1 matt
115 1.1 matt define LSONPROC LSONPROC
116 1.1 matt define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
117 1.1 matt
118 1.1 matt define CI_SIZE sizeof(struct cpu_info)
119 1.1 matt define CI_CURLWP offsetof(struct cpu_info, ci_curlwp)
120 1.1 matt define CI_CURPCB offsetof(struct cpu_info, ci_curpcb)
121 1.1 matt define CI_CURPM offsetof(struct cpu_info, ci_curpm)
122 1.1 matt define CI_IDLE_PCB offsetof(struct cpu_info, ci_idle_pcb)
123 1.1 matt define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending)
124 1.1 matt define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)
125 1.1 matt define CI_CPL offsetof(struct cpu_info, ci_cpl)
126 1.1 matt define CI_INTRDEPTH offsetof(struct cpu_info, ci_intrdepth)
127 1.1 matt define CI_INTSTK offsetof(struct cpu_info, ci_intstk)
128 1.1 matt define CI_SPILLSTK offsetof(struct cpu_info, ci_spillstk)
129 1.1 matt define CI_TEMPSAVE offsetof(struct cpu_info, ci_tempsave)
130 1.1 matt define CI_DDBSAVE offsetof(struct cpu_info, ci_ddbsave)
131 1.1 matt define CI_IPKDBSAVE offsetof(struct cpu_info, ci_ipkdbsave)
132 1.1 matt define CI_DISISAVE offsetof(struct cpu_info, ci_disisave)
133 1.1 matt
134 1.1 matt define FB_PC offsetof(struct faultbuf, fb_pc)
135 1.1 matt define FB_SP offsetof(struct faultbuf, fb_sp)
136 1.1 matt define FB_R2 offsetof(struct faultbuf, fb_r2)
137 1.1 matt define FB_CR offsetof(struct faultbuf, fb_cr)
138 1.1 matt define FB_FIXREG offsetof(struct faultbuf, fb_fixreg)
139 1.1 matt
140 1.1 matt define CACHELINESIZE CACHELINESIZE
141 1.1 matt
142 1.1 matt define CPU_CI offsetof(struct cpu_info, ci_ci)
143