> CVSROOT:      /cvs
> Module name:  src
> Changes by:   kette...@cvs.openbsd.org        2015/12/17 04:28:01
>
> Modified files:
>       gnu/gcc/gcc/config/mips: mips.md 
>
> Log message:
> Implement a memory barrier for mips.  Basically this makes 
> __sync_synchronize()
> emit a "sync" instruction.

Index: tcc.c
===================================================================
RCS file: /OpenBSD/src/sys/arch/sgi/localbus/tcc.c,v
retrieving revision 1.7
diff -u -p -r1.7 tcc.c
--- tcc.c       24 Sep 2015 18:37:50 -0000      1.7
+++ tcc.c       18 Dec 2015 12:11:08 -0000
@@ -102,14 +102,25 @@ uint32_t
 tcc_bus_error(uint32_t hwpend, struct trap_frame *tf)
 {
        uint64_t intr, error, addr, errack;
+       unsigned int errtype;
 
        intr = tcc_read(TCC_INTR);
        error = tcc_read(TCC_ERROR);
-       addr = tcc_read(TCC_BERR_ADDR);
 
-       printf("tcc bus error: intr %llx error %llx (%llu) addr %08llx\n",
-           intr, error, (error & TCC_ERROR_TYPE_MASK) >> TCC_ERROR_TYPE_SHIFT,
-           addr);
+       errtype = (error & TCC_ERROR_TYPE_MASK) >> TCC_ERROR_TYPE_SHIFT;
+
+       /*
+        * Execution of the `sync' instruction is not supported by the
+        * T-Bus and raises a machine check exception.
+        * Do not report anything on console in that case, so that
+        * userland does not suffer too much.
+        */
+       if (errtype != TCC_ERROR_TYPE_TBUS || (intr & TCC_INTR_MCHECK) == 0) {
+               addr = tcc_read(TCC_BERR_ADDR);
+
+               printf("tcc bus error: intr %llx error %llx (%u) addr %08llx\n",
+                   intr, error, errtype, addr);
+       }
 
        /* Ack error condition */
        errack = 0;

Reply via email to