4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #include <sys/types.h>
27 #include <sys/procset.h>
28 #include <sys/processor.h>
36 pr_processor_bind(struct ps_prochandle
*Pr
, idtype_t idtype
, id_t id
,
37 int processorid
, int *obind
)
39 sysret_t rval
; /* return value */
40 argdes_t argd
[4]; /* arg descriptors */
41 argdes_t
*adp
= &argd
[0]; /* first argument */
44 if (Pr
== NULL
) /* no subject process */
45 return (processor_bind(idtype
, id
, processorid
, obind
));
47 adp
->arg_value
= idtype
; /* idtype */
48 adp
->arg_object
= NULL
;
49 adp
->arg_type
= AT_BYVAL
;
50 adp
->arg_inout
= AI_INPUT
;
54 adp
->arg_value
= id
; /* id */
55 adp
->arg_object
= NULL
;
56 adp
->arg_type
= AT_BYVAL
;
57 adp
->arg_inout
= AI_INPUT
;
61 adp
->arg_value
= processorid
; /* processorid */
62 adp
->arg_object
= NULL
;
63 adp
->arg_type
= AT_BYVAL
;
64 adp
->arg_inout
= AI_INPUT
;
69 adp
->arg_value
= 0; /* obind */
70 adp
->arg_object
= NULL
;
71 adp
->arg_type
= AT_BYVAL
;
72 adp
->arg_inout
= AI_INPUT
;
76 adp
->arg_object
= obind
;
77 adp
->arg_type
= AT_BYREF
;
78 adp
->arg_inout
= AI_INOUT
;
79 adp
->arg_size
= sizeof (int);
82 error
= Psyscall(Pr
, &rval
, SYS_processor_bind
, 4, &argd
[0]);
85 errno
= (error
< 0)? ENOSYS
: error
;
88 return (rval
.sys_rval1
);