Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sh3/dev clear ORER, FER and PER bit of the SCSSR reg.



details:   https://anonhg.NetBSD.org/src/rev/f13b16950480
branches:  trunk
changeset: 488134:f13b16950480
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Jun 19 09:32:00 2000 +0000

description:
clear ORER, FER and PER bit of the SCSSR reg.
(This bits aren't cleared automatically)

diffstat:

 sys/arch/sh3/dev/sci.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r db8711d93a20 -r f13b16950480 sys/arch/sh3/dev/sci.c
--- a/sys/arch/sh3/dev/sci.c    Mon Jun 19 09:30:35 2000 +0000
+++ b/sys/arch/sh3/dev/sci.c    Mon Jun 19 09:32:00 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sci.c,v 1.8 2000/03/27 16:24:08 msaitoh Exp $ */
+/* $NetBSD: sci.c,v 1.9 2000/06/19 09:32:00 msaitoh Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -418,8 +418,10 @@
        while (((err_c = SHREG_SCSSR)
                & (SCSSR_RDRF | SCSSR_ORER | SCSSR_FER | SCSSR_PER)) == 0)
                ;
-       if ((err_c & (SCSSR_ORER | SCSSR_FER | SCSSR_PER)) != 0)
+       if ((err_c & (SCSSR_ORER | SCSSR_FER | SCSSR_PER)) != 0) {
+               SHREG_SCSSR &= ~(SCSSR_ORER | SCSSR_FER | SCSSR_PER);
                return(err_c |= 0x80);
+       }
 
        c = SHREG_SCRDR;
 
@@ -720,10 +722,12 @@
        volatile unsigned char c;
 
        if (((err_c = SHREG_SCSSR)
-               & (SCSSR_RDRF | SCSSR_ORER | SCSSR_FER | SCSSR_PER)) != 0) {
+            & (SCSSR_RDRF | SCSSR_ORER | SCSSR_FER | SCSSR_PER)) != 0) {
 
-               if ((err_c & (SCSSR_ORER | SCSSR_FER | SCSSR_PER)) != 0)
+               if ((err_c & (SCSSR_ORER | SCSSR_FER | SCSSR_PER)) != 0) {
+                       SHREG_SCSSR &= ~(SCSSR_ORER | SCSSR_FER | SCSSR_PER);
                        return;
+               }
 
                c = SHREG_SCRDR;
 
@@ -1317,7 +1321,8 @@
                        put[0] = SHREG_SCRDR;
                        put[1] = SHREG_SCSSR & 0x00ff;
 
-                       SHREG_SCSSR &= ~SCSSR_RDRF;
+                       SHREG_SCSSR &= ~(SCSSR_ORER | SCSSR_FER | SCSSR_PER |
+                                        SCSSR_RDRF);
 
                        put += 2;
                        if (put >= end)



Home | Main Index | Thread Index | Old Index