From: mpi Date: Sat, 13 Jan 2018 15:18:11 +0000 (+0000) Subject: Define and use IPL_MPFLOOR in our common mutex implementation. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4965d1a4536ae31f44fece9aedf52ba3da2c14fb;p=openbsd Define and use IPL_MPFLOOR in our common mutex implementation. ok kettenis@, visa@ --- diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h index 1934f691984..4f7ab8356c6 100644 --- a/sys/arch/alpha/include/intr.h +++ b/sys/arch/alpha/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.46 2016/06/13 01:26:14 dlg Exp $ */ +/* $OpenBSD: intr.h,v 1.47 2018/01/13 15:18:11 mpi Exp $ */ /* $NetBSD: intr.h,v 1.26 2000/06/03 20:47:41 thorpej Exp $ */ /*- @@ -125,6 +125,8 @@ struct scbvec { #define IPL_SOFTNET 2 /* network software interrupts */ #define IPL_SOFT 3 /* other software interrupts */ +#define IPL_MPFLOOR IPL_AUDIO + #define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ #define IST_UNUSABLE -1 /* interrupt cannot be used */ diff --git a/sys/arch/alpha/include/mutex.h b/sys/arch/alpha/include/mutex.h index 720a30baba2..20078d4b7f7 100644 --- a/sys/arch/alpha/include/mutex.h +++ b/sys/arch/alpha/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.9 2018/01/04 11:03:48 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.10 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_AUDIO) ? IPL_AUDIO : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif diff --git a/sys/arch/amd64/include/intrdefs.h b/sys/arch/amd64/include/intrdefs.h index 2cfe0ba61b6..f435c672b6e 100644 --- a/sys/arch/amd64/include/intrdefs.h +++ b/sys/arch/amd64/include/intrdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intrdefs.h,v 1.16 2016/06/22 01:12:38 mikeb Exp $ */ +/* $OpenBSD: intrdefs.h,v 1.17 2018/01/13 15:18:11 mpi Exp $ */ /* $NetBSD: intrdefs.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */ #ifndef _AMD64_INTRDEFS_H @@ -34,6 +34,7 @@ #define IPL_IPI 0xe /* inter-processor interrupts */ #define NIPL 16 +#define IPL_MPFLOOR IPL_TTY #define IPL_MPSAFE 0x100 /* Interrupt sharing types. */ diff --git a/sys/arch/amd64/include/mutex.h b/sys/arch/amd64/include/mutex.h index bb4c9d39aa4..20078d4b7f7 100644 --- a/sys/arch/amd64/include/mutex.h +++ b/sys/arch/amd64/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.9 2018/01/12 09:19:32 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.10 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_TTY) ? IPL_TTY : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif diff --git a/sys/arch/arm64/include/intr.h b/sys/arch/arm64/include/intr.h index 2858a29b626..2bab7cda56d 100644 --- a/sys/arch/arm64/include/intr.h +++ b/sys/arch/arm64/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.6 2017/03/09 14:23:59 kettenis Exp $ */ +/* $OpenBSD: intr.h,v 1.7 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -59,6 +59,7 @@ #define IPL_IPI 12 /* interprocessor interrupt */ #define NIPL 13 /* number of levels */ +#define IPL_MPFLOOR IPL_TTY /* Interrupt priority 'flags'. */ #define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ diff --git a/sys/arch/arm64/include/mutex.h b/sys/arch/arm64/include/mutex.h index c42ef1cf233..5247385e106 100644 --- a/sys/arch/arm64/include/mutex.h +++ b/sys/arch/arm64/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.3 2018/01/12 09:19:33 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.4 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_TTY) ? IPL_TTY : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif diff --git a/sys/arch/hppa/include/intr.h b/sys/arch/hppa/include/intr.h index 6d7a1914276..eba861f5765 100644 --- a/sys/arch/hppa/include/intr.h +++ b/sys/arch/hppa/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.43 2017/05/19 00:49:53 dlg Exp $ */ +/* $OpenBSD: intr.h,v 1.44 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -50,6 +50,7 @@ #define IPL_IPI 11 #define IPL_NESTED 12 /* pseudo-level for sub-tables */ +#define IPL_MPFLOOR IPL_AUDIO #define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ #define IST_NONE 0 diff --git a/sys/arch/hppa/include/mutex.h b/sys/arch/hppa/include/mutex.h index 3b16361fb1e..0aa8d1b3230 100644 --- a/sys/arch/hppa/include/mutex.h +++ b/sys/arch/hppa/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.8 2018/01/04 11:03:48 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.9 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -54,7 +54,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_AUDIO) ? IPL_AUDIO : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #ifdef WITNESS #define MUTEX_INITIALIZER_FLAGS(ipl, name, flags) \ { MUTEX_UNLOCKED, __MUTEX_IPL((ipl)), 0, NULL, \ diff --git a/sys/arch/i386/include/intrdefs.h b/sys/arch/i386/include/intrdefs.h index fba06ef79e9..c95b7890396 100644 --- a/sys/arch/i386/include/intrdefs.h +++ b/sys/arch/i386/include/intrdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intrdefs.h,v 1.15 2016/10/21 06:20:58 mlarkin Exp $ */ +/* $OpenBSD: intrdefs.h,v 1.16 2018/01/13 15:18:11 mpi Exp $ */ /* $NetBSD: intrdefs.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */ #ifndef _I386_INTRDEFS_H @@ -70,6 +70,7 @@ #define IPL_HIGH MAKEIPL(10) /* everything */ #define IPL_IPI MAKEIPL(11) /* interprocessor interrupt */ +#define IPL_MPFLOOR IPL_TTY #define IPL_MPSAFE 0x100 /* Interrupt sharing types. */ diff --git a/sys/arch/i386/include/mutex.h b/sys/arch/i386/include/mutex.h index 96db30e8ad6..d3525fc2eff 100644 --- a/sys/arch/i386/include/mutex.h +++ b/sys/arch/i386/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.11 2018/01/12 09:19:33 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.12 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_TTY) ? IPL_TTY : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif diff --git a/sys/arch/luna88k/include/intr.h b/sys/arch/luna88k/include/intr.h index 4d80aae830a..e2db679bf95 100644 --- a/sys/arch/luna88k/include/intr.h +++ b/sys/arch/luna88k/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.9 2014/12/28 13:03:18 aoyama Exp $ */ +/* $OpenBSD: intr.h,v 1.10 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (C) 2000 Steve Murphree, Jr. * All rights reserved. @@ -47,6 +47,7 @@ #define IPL_NMI 7 #define IPL_ABORT 7 +#define IPL_MPFLOOR IPL_TTY #define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ #include diff --git a/sys/arch/m88k/include/mutex.h b/sys/arch/m88k/include/mutex.h index 446a2d92661..2656398b590 100644 --- a/sys/arch/m88k/include/mutex.h +++ b/sys/arch/m88k/include/mutex.h @@ -1,6 +1,6 @@ #ifndef _M88K_MUTEX_H_ #define _M88K_MUTEX_H_ -/* $OpenBSD: mutex.h,v 1.6 2018/01/04 11:03:48 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.7 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_TTY) ? IPL_TTY : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif diff --git a/sys/arch/powerpc/include/intr.h b/sys/arch/powerpc/include/intr.h index d0b3f727c4d..51d124401e7 100644 --- a/sys/arch/powerpc/include/intr.h +++ b/sys/arch/powerpc/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.53 2017/07/25 03:46:59 visa Exp $ */ +/* $OpenBSD: intr.h,v 1.54 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA. @@ -50,6 +50,7 @@ #define IPL_HIGH 12 #define IPL_NUM 13 +#define IPL_MPFLOOR IPL_TTY #define IPL_MPSAFE 0x100 #define IST_NONE 0 diff --git a/sys/arch/powerpc/include/mutex.h b/sys/arch/powerpc/include/mutex.h index 07ea7601c82..2aeefb1a7b4 100644 --- a/sys/arch/powerpc/include/mutex.h +++ b/sys/arch/powerpc/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.7 2018/01/12 09:19:33 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.8 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_TTY) ? IPL_TTY : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif diff --git a/sys/arch/sparc64/include/intr.h b/sys/arch/sparc64/include/intr.h index 88861fab479..9bd7fb8fab4 100644 --- a/sys/arch/sparc64/include/intr.h +++ b/sys/arch/sparc64/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.20 2016/08/17 10:49:09 dlg Exp $ */ +/* $OpenBSD: intr.h,v 1.21 2018/01/13 15:18:11 mpi Exp $ */ /* $NetBSD: intr.h,v 1.8 2001/01/14 23:50:30 thorpej Exp $ */ /*- @@ -102,6 +102,7 @@ void intr_establish(int, struct intrhand *); #define splzs() splserial() +#define IPL_MPFLOOR IPL_SERIAL #define IPL_MPSAFE 0x100 int splraise(int); diff --git a/sys/arch/sparc64/include/mutex.h b/sys/arch/sparc64/include/mutex.h index bfa1c698af0..d6852e2ef43 100644 --- a/sys/arch/sparc64/include/mutex.h +++ b/sys/arch/sparc64/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.6 2018/01/12 09:19:33 mpi Exp $ */ +/* $OpenBSD: mutex.h,v 1.7 2018/01/13 15:18:11 mpi Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -48,7 +48,7 @@ struct mutex { */ #ifdef MULTIPROCESSOR #define __MUTEX_IPL(ipl) \ - (((ipl) > IPL_NONE && (ipl) < IPL_SERIAL) ? IPL_SERIAL : (ipl)) + (((ipl) > IPL_NONE && (ipl) < IPL_MPFLOOR) ? IPL_MPFLOOR : (ipl)) #else #define __MUTEX_IPL(ipl) (ipl) #endif