summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-11-27 15:56:12 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-11-27 15:56:12 +0000
commit520bcc36cc6706cd491659afa02bfe6531718f68 (patch)
tree63e175caf088b3b28895fb3407cde0d4c693316c /sys/arch
parentf433f76fb87c981ed09ba271cd1d72b12ad1071c (diff)
ARGH. Work has poisoned my mind. KNF the braces.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/lock_machdep.c14
-rw-r--r--sys/arch/i386/i386/lock_machdep.c14
2 files changed, 18 insertions, 10 deletions
diff --git a/sys/arch/amd64/amd64/lock_machdep.c b/sys/arch/amd64/amd64/lock_machdep.c
index c9c76015956..f1740fae4e0 100644
--- a/sys/arch/amd64/amd64/lock_machdep.c
+++ b/sys/arch/amd64/amd64/lock_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock_machdep.c,v 1.1 2007/11/26 23:50:03 art Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.2 2007/11/27 15:55:29 art Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
@@ -119,7 +119,8 @@ __mp_unlock(struct __mp_lock *mpl)
}
int
-__mp_release_all(struct __mp_lock *mpl) {
+__mp_release_all(struct __mp_lock *mpl)
+{
int rv = mpl->mpl_count - 1;
long rf = read_rflags();
@@ -139,7 +140,8 @@ __mp_release_all(struct __mp_lock *mpl) {
}
int
-__mp_release_all_but_one(struct __mp_lock *mpl) {
+__mp_release_all_but_one(struct __mp_lock *mpl)
+{
int rv = mpl->mpl_count - 2;
#ifdef MP_LOCKDEBUG
@@ -155,13 +157,15 @@ __mp_release_all_but_one(struct __mp_lock *mpl) {
}
void
-__mp_acquire_count(struct __mp_lock *mpl, int count) {
+__mp_acquire_count(struct __mp_lock *mpl, int count)
+{
while (count--)
__mp_lock(mpl);
}
int
-__mp_lock_held(struct __mp_lock *mpl) {
+__mp_lock_held(struct __mp_lock *mpl)
+{
return mpl->mpl_cpu == curcpu();
}
diff --git a/sys/arch/i386/i386/lock_machdep.c b/sys/arch/i386/i386/lock_machdep.c
index 43b0ab646c2..a6cca09cb2e 100644
--- a/sys/arch/i386/i386/lock_machdep.c
+++ b/sys/arch/i386/i386/lock_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock_machdep.c,v 1.8 2007/11/26 19:00:56 art Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.9 2007/11/27 15:56:11 art Exp $ */
/* $NetBSD: lock_machdep.c,v 1.1.2.3 2000/05/03 14:40:30 sommerfeld Exp $ */
/*-
@@ -209,7 +209,8 @@ __mp_unlock(struct __mp_lock *mpl)
}
int
-__mp_release_all(struct __mp_lock *mpl) {
+__mp_release_all(struct __mp_lock *mpl)
+{
int rv = mpl->mpl_count - 1;
int ef = read_eflags();
@@ -229,7 +230,8 @@ __mp_release_all(struct __mp_lock *mpl) {
}
int
-__mp_release_all_but_one(struct __mp_lock *mpl) {
+__mp_release_all_but_one(struct __mp_lock *mpl)
+{
int rv = mpl->mpl_count - 2;
#ifdef MP_LOCKDEBUG
@@ -245,13 +247,15 @@ __mp_release_all_but_one(struct __mp_lock *mpl) {
}
void
-__mp_acquire_count(struct __mp_lock *mpl, int count) {
+__mp_acquire_count(struct __mp_lock *mpl, int count)
+{
while (count--)
__mp_lock(mpl);
}
int
-__mp_lock_held(struct __mp_lock *mpl) {
+__mp_lock_held(struct __mp_lock *mpl)
+{
return mpl->mpl_cpu == curcpu();
}