Deleted Added
full compact
ppc.c (42482) ppc.c (43433)
1/*-
2 * Copyright (c) 1997, 1998 Nicolas Souchu
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997, 1998 Nicolas Souchu
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: ppc.c,v 1.14 1999/01/10 12:04:53 nsouch Exp $
26 * $Id: ppc.c,v 1.15 1999/01/10 16:41:13 nsouch Exp $
27 *
28 */
29#include "ppc.h"
30
31#if NPPC > 0
32
33#include <sys/param.h>
34#include <sys/systm.h>

--- 76 unchanged lines hidden (view full) ---

111static void ppc_insw_epp(int unit, char *addr, int cnt) {
112 insw(ppcdata[unit]->ppc_base + PPC_EPP_DATA, addr, cnt); }
113static void ppc_insl_epp(int unit, char *addr, int cnt) {
114 insl(ppcdata[unit]->ppc_base + PPC_EPP_DATA, addr, cnt); }
115
116static u_char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
117static u_char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
118static u_char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
27 *
28 */
29#include "ppc.h"
30
31#if NPPC > 0
32
33#include <sys/param.h>
34#include <sys/systm.h>

--- 76 unchanged lines hidden (view full) ---

111static void ppc_insw_epp(int unit, char *addr, int cnt) {
112 insw(ppcdata[unit]->ppc_base + PPC_EPP_DATA, addr, cnt); }
113static void ppc_insl_epp(int unit, char *addr, int cnt) {
114 insl(ppcdata[unit]->ppc_base + PPC_EPP_DATA, addr, cnt); }
115
116static u_char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
117static u_char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
118static u_char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
119static u_char ppc_repp(int unit) { return r_epp(ppcdata[unit]); }
119static u_char ppc_repp_A(int unit) { return r_epp_A(ppcdata[unit]); }
120static u_char ppc_repp_D(int unit) { return r_epp_D(ppcdata[unit]); }
120static u_char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
121static u_char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
122
123static void ppc_wdtr(int unit, char byte) { w_dtr(ppcdata[unit], byte); }
124static void ppc_wstr(int unit, char byte) { w_str(ppcdata[unit], byte); }
125static void ppc_wctr(int unit, char byte) { w_ctr(ppcdata[unit], byte); }
121static u_char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
122static u_char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
123
124static void ppc_wdtr(int unit, char byte) { w_dtr(ppcdata[unit], byte); }
125static void ppc_wstr(int unit, char byte) { w_str(ppcdata[unit], byte); }
126static void ppc_wctr(int unit, char byte) { w_ctr(ppcdata[unit], byte); }
126static void ppc_wepp(int unit, char byte) { w_epp(ppcdata[unit], byte); }
127static void ppc_wepp_A(int unit, char byte) { w_epp_A(ppcdata[unit], byte); }
128static void ppc_wepp_D(int unit, char byte) { w_epp_D(ppcdata[unit], byte); }
127static void ppc_wecr(int unit, char byte) { w_ecr(ppcdata[unit], byte); }
128static void ppc_wfifo(int unit, char byte) { w_fifo(ppcdata[unit], byte); }
129
130static void ppc_reset_epp_timeout(int);
131static void ppc_ecp_sync(int);
132static ointhand2_t ppcintr;
133
134static int ppc_exec_microseq(int, struct ppb_microseq **);

--- 11 unchanged lines hidden (view full) ---

146
147 ppc_exec_microseq,
148
149 ppc_smclike_setmode, ppc_read, ppc_write,
150
151 ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
152 ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
153
129static void ppc_wecr(int unit, char byte) { w_ecr(ppcdata[unit], byte); }
130static void ppc_wfifo(int unit, char byte) { w_fifo(ppcdata[unit], byte); }
131
132static void ppc_reset_epp_timeout(int);
133static void ppc_ecp_sync(int);
134static ointhand2_t ppcintr;
135
136static int ppc_exec_microseq(int, struct ppb_microseq **);

--- 11 unchanged lines hidden (view full) ---

148
149 ppc_exec_microseq,
150
151 ppc_smclike_setmode, ppc_read, ppc_write,
152
153 ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
154 ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
155
154 ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp, ppc_recr, ppc_rfifo,
155 ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp, ppc_wecr, ppc_wfifo
156 ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp_A, ppc_repp_D, ppc_recr, ppc_rfifo,
157 ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp_A, ppc_wepp_D, ppc_wecr, ppc_wfifo
156};
157
158static struct ppb_adapter ppc_generic_adapter = {
159
160 0, /* no intr handler, filled by chipset dependent code */
161
162 ppc_reset_epp_timeout, ppc_ecp_sync,
163
164 ppc_exec_microseq,
165
166 ppc_generic_setmode, ppc_read, ppc_write,
167
168 ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
169 ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
170
158};
159
160static struct ppb_adapter ppc_generic_adapter = {
161
162 0, /* no intr handler, filled by chipset dependent code */
163
164 ppc_reset_epp_timeout, ppc_ecp_sync,
165
166 ppc_exec_microseq,
167
168 ppc_generic_setmode, ppc_read, ppc_write,
169
170 ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
171 ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
172
171 ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp, ppc_recr, ppc_rfifo,
172 ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp, ppc_wecr, ppc_wfifo
173 ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp_A, ppc_repp_D, ppc_recr, ppc_rfifo,
174 ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp_A, ppc_wepp_D, ppc_wecr, ppc_wfifo
173};
174
175/*
176 * ppc_ecp_sync() XXX
177 */
178static void
179ppc_ecp_sync(int unit) {
180

--- 1042 unchanged lines hidden (view full) ---

1223 case MS_OP_SET:
1224 ppc->ppc_accum = mi->arg[0].i;
1225 INCR_PC;
1226 break;
1227
1228 case MS_OP_DBRA:
1229 if (--ppc->ppc_accum > 0)
1230 mi += mi->arg[0].i;
175};
176
177/*
178 * ppc_ecp_sync() XXX
179 */
180static void
181ppc_ecp_sync(int unit) {
182

--- 1042 unchanged lines hidden (view full) ---

1225 case MS_OP_SET:
1226 ppc->ppc_accum = mi->arg[0].i;
1227 INCR_PC;
1228 break;
1229
1230 case MS_OP_DBRA:
1231 if (--ppc->ppc_accum > 0)
1232 mi += mi->arg[0].i;
1231 else
1232 INCR_PC;
1233 INCR_PC;
1233 break;
1234
1235 case MS_OP_BRSET:
1236 cc = r_str(ppc);
1237 if ((cc & (char)mi->arg[0].i) == (char)mi->arg[0].i)
1238 mi += mi->arg[1].i;
1234 break;
1235
1236 case MS_OP_BRSET:
1237 cc = r_str(ppc);
1238 if ((cc & (char)mi->arg[0].i) == (char)mi->arg[0].i)
1239 mi += mi->arg[1].i;
1239 else
1240 INCR_PC;
1240 INCR_PC;
1241 break;
1242
1243 case MS_OP_BRCLEAR:
1244 cc = r_str(ppc);
1245 if ((cc & (char)mi->arg[0].i) == 0)
1246 mi += mi->arg[1].i;
1241 break;
1242
1243 case MS_OP_BRCLEAR:
1244 cc = r_str(ppc);
1245 if ((cc & (char)mi->arg[0].i) == 0)
1246 mi += mi->arg[1].i;
1247 else
1248 INCR_PC;
1247 INCR_PC;
1249 break;
1250
1251 case MS_OP_BRSTAT:
1252 cc = r_str(ppc);
1253 if ((cc & ((char)mi->arg[0].i | (char)mi->arg[1].i)) ==
1254 (char)mi->arg[0].i)
1255 mi += mi->arg[2].i;
1248 break;
1249
1250 case MS_OP_BRSTAT:
1251 cc = r_str(ppc);
1252 if ((cc & ((char)mi->arg[0].i | (char)mi->arg[1].i)) ==
1253 (char)mi->arg[0].i)
1254 mi += mi->arg[2].i;
1256 else
1257 INCR_PC;
1255 INCR_PC;
1258 break;
1259
1260 case MS_OP_C_CALL:
1261 /*
1262 * If the C call returns !0 then end the microseq.
1263 * The current state of ptr is passed to the C function
1264 */
1265 if ((error = mi->arg[0].f(mi->arg[1].p, ppc->ppc_ptr)))

--- 529 unchanged lines hidden ---
1256 break;
1257
1258 case MS_OP_C_CALL:
1259 /*
1260 * If the C call returns !0 then end the microseq.
1261 * The current state of ptr is passed to the C function
1262 */
1263 if ((error = mi->arg[0].f(mi->arg[1].p, ppc->ppc_ptr)))

--- 529 unchanged lines hidden ---