From 01e980a512c91a4c3eae0a25176eb9a7ee07e455 Mon Sep 17 00:00:00 2001 From: scole Date: Fri, 5 Aug 2016 16:59:26 +0000 Subject: [PATCH] PR port-ia64/51261 Add mb_read mb_write mb_memory --- sys/arch/ia64/include/lock.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/arch/ia64/include/lock.h b/sys/arch/ia64/include/lock.h index 327923ce9c01..46dc1f9cf91c 100644 --- a/sys/arch/ia64/include/lock.h +++ b/sys/arch/ia64/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.4 2009/07/20 04:41:37 kiyohara Exp $ */ +/* $NetBSD: lock.h,v 1.5 2016/08/05 16:59:26 scole Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -116,4 +116,26 @@ __cpu_simple_unlock(__cpu_simple_lock_t *lockp) *lockp = __SIMPLELOCK_UNLOCKED; } +/* XXX mf.a overkill for these? */ +static __inline void +mb_read(void) +{ + __asm __volatile("mf.a \n" + "mf \n" ::: "memory"); +} + +static __inline void +mb_write(void) +{ + __asm __volatile("mf.a \n" + "mf \n" ::: "memory"); +} + +static __inline void +mb_memory(void) +{ + __asm __volatile("mf.a \n" + "mf \n" ::: "memory"); +} + #endif /* _IA64_LOCK_H_ */