summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppc
diff options
context:
space:
mode:
authornsouch <nsouch@FreeBSD.org>1999-01-30 15:35:39 +0000
committernsouch <nsouch@FreeBSD.org>1999-01-30 15:35:39 +0000
commit10ef2b8422913dafa8c05f64b5d0c07a3d2ad9c0 (patch)
tree40df97b8849853b739d2d4fdbd234d29a62ee63a /sys/dev/ppc
parentc9bc4bf0090c71bd80805b53e37129f6052a7407 (diff)
downloadFreeBSD-src-10ef2b8422913dafa8c05f64b5d0c07a3d2ad9c0.zip
FreeBSD-src-10ef2b8422913dafa8c05f64b5d0c07a3d2ad9c0.tar.gz
Distinguish EPP address/data register. Add EPP address register access to ppi.
Change microseq offsets. Previously, offsets of the program counter where added to the index of the current microinstruction. Make them rely on the index of the next executed microinstruction. Suggested by: Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Diffstat (limited to 'sys/dev/ppc')
-rw-r--r--sys/dev/ppc/ppc.c28
-rw-r--r--sys/dev/ppc/ppcreg.h9
2 files changed, 19 insertions, 18 deletions
diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c
index bd6249b..65e3216 100644
--- a/sys/dev/ppc/ppc.c
+++ b/sys/dev/ppc/ppc.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppc.c,v 1.14 1999/01/10 12:04:53 nsouch Exp $
+ * $Id: ppc.c,v 1.15 1999/01/10 16:41:13 nsouch Exp $
*
*/
#include "ppc.h"
@@ -116,14 +116,16 @@ static void ppc_insl_epp(int unit, char *addr, int cnt) {
static u_char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
static u_char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
static u_char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
-static u_char ppc_repp(int unit) { return r_epp(ppcdata[unit]); }
+static u_char ppc_repp_A(int unit) { return r_epp_A(ppcdata[unit]); }
+static u_char ppc_repp_D(int unit) { return r_epp_D(ppcdata[unit]); }
static u_char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
static u_char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
static void ppc_wdtr(int unit, char byte) { w_dtr(ppcdata[unit], byte); }
static void ppc_wstr(int unit, char byte) { w_str(ppcdata[unit], byte); }
static void ppc_wctr(int unit, char byte) { w_ctr(ppcdata[unit], byte); }
-static void ppc_wepp(int unit, char byte) { w_epp(ppcdata[unit], byte); }
+static void ppc_wepp_A(int unit, char byte) { w_epp_A(ppcdata[unit], byte); }
+static void ppc_wepp_D(int unit, char byte) { w_epp_D(ppcdata[unit], byte); }
static void ppc_wecr(int unit, char byte) { w_ecr(ppcdata[unit], byte); }
static void ppc_wfifo(int unit, char byte) { w_fifo(ppcdata[unit], byte); }
@@ -151,8 +153,8 @@ static struct ppb_adapter ppc_smclike_adapter = {
ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
- ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp, ppc_recr, ppc_rfifo,
- ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp, ppc_wecr, ppc_wfifo
+ ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp_A, ppc_repp_D, ppc_recr, ppc_rfifo,
+ ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp_A, ppc_wepp_D, ppc_wecr, ppc_wfifo
};
static struct ppb_adapter ppc_generic_adapter = {
@@ -168,8 +170,8 @@ static struct ppb_adapter ppc_generic_adapter = {
ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
- ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp, ppc_recr, ppc_rfifo,
- ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp, ppc_wecr, ppc_wfifo
+ ppc_rdtr, ppc_rstr, ppc_rctr, ppc_repp_A, ppc_repp_D, ppc_recr, ppc_rfifo,
+ ppc_wdtr, ppc_wstr, ppc_wctr, ppc_wepp_A, ppc_wepp_D, ppc_wecr, ppc_wfifo
};
/*
@@ -1228,24 +1230,21 @@ ppc_exec_microseq(int unit, struct ppb_microseq **p_msq)
case MS_OP_DBRA:
if (--ppc->ppc_accum > 0)
mi += mi->arg[0].i;
- else
- INCR_PC;
+ INCR_PC;
break;
case MS_OP_BRSET:
cc = r_str(ppc);
if ((cc & (char)mi->arg[0].i) == (char)mi->arg[0].i)
mi += mi->arg[1].i;
- else
- INCR_PC;
+ INCR_PC;
break;
case MS_OP_BRCLEAR:
cc = r_str(ppc);
if ((cc & (char)mi->arg[0].i) == 0)
mi += mi->arg[1].i;
- else
- INCR_PC;
+ INCR_PC;
break;
case MS_OP_BRSTAT:
@@ -1253,8 +1252,7 @@ ppc_exec_microseq(int unit, struct ppb_microseq **p_msq)
if ((cc & ((char)mi->arg[0].i | (char)mi->arg[1].i)) ==
(char)mi->arg[0].i)
mi += mi->arg[2].i;
- else
- INCR_PC;
+ INCR_PC;
break;
case MS_OP_C_CALL:
diff --git a/sys/dev/ppc/ppcreg.h b/sys/dev/ppc/ppcreg.h
index c847e6c..3a61ae7 100644
--- a/sys/dev/ppc/ppcreg.h
+++ b/sys/dev/ppc/ppcreg.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppcreg.h,v 1.6 1999/01/10 12:04:53 nsouch Exp $
+ * $Id: ppcreg.h,v 1.7 1999/01/10 16:41:13 nsouch Exp $
*
*/
#ifndef __PPCREG_H
@@ -102,6 +102,7 @@ struct ppc_data {
#define PPC_ECP_A_FIFO 0 /* ECP Address fifo register */
#define PPC_SPP_STR 1 /* SPP status register */
#define PPC_SPP_CTR 2 /* SPP control register */
+#define PPC_EPP_ADDR 3 /* EPP address register (8 bit) */
#define PPC_EPP_DATA 4 /* EPP data register (8, 16 or 32 bit) */
#define PPC_ECP_D_FIFO 0x400 /* ECP Data fifo register */
#define PPC_ECP_CNFGA 0x400 /* Configuration register A */
@@ -125,7 +126,8 @@ struct ppc_data {
#define r_dtr(ppc) (inb((ppc)->ppc_base + PPC_SPP_DTR))
#define r_str(ppc) (inb((ppc)->ppc_base + PPC_SPP_STR))
#define r_ctr(ppc) (inb((ppc)->ppc_base + PPC_SPP_CTR))
-#define r_epp(ppc) (inb((ppc)->ppc_base + PPC_EPP_DATA))
+#define r_epp_A(ppc) (inb((ppc)->ppc_base + PPC_EPP_ADDR))
+#define r_epp_D(ppc) (inb((ppc)->ppc_base + PPC_EPP_DATA))
#define r_cnfgA(ppc) (inb((ppc)->ppc_base + PPC_ECP_CNFGA))
#define r_cnfgB(ppc) (inb((ppc)->ppc_base + PPC_ECP_CNFGB))
#define r_ecr(ppc) (inb((ppc)->ppc_base + PPC_ECP_ECR))
@@ -134,7 +136,8 @@ struct ppc_data {
#define w_dtr(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_DTR, byte)
#define w_str(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_STR, byte)
#define w_ctr(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_CTR, byte)
-#define w_epp(ppc,byte) outb((ppc)->ppc_base + PPC_EPP_DATA, byte)
+#define w_epp_A(ppc,byte) outb((ppc)->ppc_base + PPC_EPP_ADDR, byte)
+#define w_epp_D(ppc,byte) outb((ppc)->ppc_base + PPC_EPP_DATA, byte)
#define w_ecr(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_ECR, byte)
#define w_fifo(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_D_FIFO, byte)
OpenPOWER on IntegriCloud