-/* $OpenBSD: cn30xxfau.c,v 1.5 2014/08/11 18:08:17 miod Exp $ */
+/* $OpenBSD: cn30xxfau.c,v 1.6 2016/07/10 10:18:58 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
uint64_t
cn30xxfau_op_save(struct cn30xxfau_desc *fd)
{
- mips_sync();
+ octeon_synciobdma();
return octeon_cvmseg_read_8(fd->fd_scroff);
}
{
cn30xxfau_op_iobdma_store_data(fd->fd_scroff, v, 0, OCT_FAU_OP_SIZE_64/* XXX */,
fd->fd_regno);
- mips_sync();
+ octeon_synciobdma();
return octeon_cvmseg_read_8(fd->fd_scroff)/* XXX */;
}
{
cn30xxfau_op_iobdma_store_data(fd->fd_scroff, v, 1, OCT_FAU_OP_SIZE_64/* XXX */,
fd->fd_regno);
- /* XXX */
- mips_sync();
- /* XXX */
+ octeon_synciobdma();
return octeon_cvmseg_read_8(fd->fd_scroff)/* XXX */;
}
-/* $OpenBSD: cn30xxfauvar.h,v 1.2 2013/06/01 22:20:35 jasper Exp $ */
+/* $OpenBSD: cn30xxfauvar.h,v 1.3 2016/07/10 10:18:58 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
static inline int64_t
cn30xxfau_op_inc_read_8(struct cn30xxfau_desc *fd)
{
- mips_sync();
+ octeon_synciobdma();
return octeon_cvmseg_read_8(fd->fd_scroff);
}
-/* $OpenBSD: cn30xxpow.c,v 1.7 2014/08/11 18:56:49 miod Exp $ */
+/* $OpenBSD: cn30xxpow.c,v 1.8 2016/07/10 10:18:58 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
{
uint64_t result;
- mips_sync();
+ octeon_synciobdma();
result = octeon_cvmseg_read_8(scraddr);
return (result & POW_IOBDMA_GET_WORK_RESULT_NO_WORK) ?
-/* $OpenBSD: octeonvar.h,v 1.29 2016/07/01 15:12:37 visa Exp $ */
+/* $OpenBSD: octeonvar.h,v 1.30 2016/07/10 10:18:58 visa Exp $ */
/* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */
/*-
return tmp;
}
+static inline void
+octeon_synciobdma(void)
+{
+ __asm volatile (
+ _ASM_PROLOGUE_OCTEON
+ " synciobdma\n"
+ _ASM_EPILOGUE
+ : : : "memory");
+}
+
#endif /* _MIPS_OCTEON_OCTEONVAR_H_ */