diff options
Diffstat (limited to 'usr/src/uts/common/syscall/p_online.c')
-rw-r--r-- | usr/src/uts/common/syscall/p_online.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/usr/src/uts/common/syscall/p_online.c b/usr/src/uts/common/syscall/p_online.c index 004627569c..88a0340bf7 100644 --- a/usr/src/uts/common/syscall/p_online.c +++ b/usr/src/uts/common/syscall/p_online.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/param.h> #include <sys/var.h> @@ -49,7 +46,7 @@ * P_FAULTED */ int -p_online_internal(processorid_t cpun, int new_status, int *old_status) +p_online_internal_locked(processorid_t cpun, int new_status, int *old_status) { cpu_t *cp; int status; @@ -59,7 +56,7 @@ p_online_internal(processorid_t cpun, int new_status, int *old_status) /* * Try to get a pointer to the requested CPU structure. */ - mutex_enter(&cpu_lock); /* protects CPU states */ + ASSERT(MUTEX_HELD(&cpu_lock)); if ((cp = cpu_get(cpun)) == NULL) { error = EINVAL; goto out; @@ -219,10 +216,21 @@ p_online_internal(processorid_t cpun, int new_status, int *old_status) break; } out: - mutex_exit(&cpu_lock); return (error); } +int +p_online_internal(processorid_t cpun, int new_status, int *old_status) +{ + int rc; + + mutex_enter(&cpu_lock); /* protects CPU states */ + rc = p_online_internal_locked(cpun, new_status, old_status); + mutex_exit(&cpu_lock); + + return (rc); +} + /* * p_online(2) - get/change processor operational status. * |