Home | History | Annotate | Download | only in infrastructure
      1 /*
      2  * CDDL HEADER START
      3  *
      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.
      7  *
      8  * You can obtain a copy of the license at usr/src/CDDL.txt
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/CDDL.txt.
     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]
     18  *
     19  * CDDL HEADER END
     20  */
     21 
     22 /*
     23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  *
     26  */
     27 
     28 #ifndef _COPY_H
     29 #define	_COPY_H
     30 
     31 #pragma ident	"@(#)copy.h	1.15	08/05/20 SMI"
     32 
     33 #include <sys/copyops.h>
     34 #include <sys/os.h>
     35 #include <h/sol.h>
     36 
     37 //
     38 // Copy_args is a simple structure to hold the node id and pid that we
     39 // need to identify the process performing an ioctl.
     40 //
     41 class copy_args {
     42 public:
     43 	copy_args(sol::nodeid_t n, sol::pid_t p);
     44 
     45 	sol::nodeid_t	nodeid;
     46 	sol::pid_t	pid;
     47 };
     48 
     49 //
     50 // The copy class provides an interface to the thread-specific storage.
     51 // It is used to hold the copy_args associated with an ioctl.
     52 // It is set/accessed with setcontext/getcontext.
     53 //
     54 // This class is used in response to a system call, and not in
     55 // response to an invocation from a non-global zone. So, while handing
     56 // off the IDL invocation (coming from a non-global zone) at the
     57 // gateway level to a zone threadpool worker thread, we needn't hand
     58 // off this thread-specific data.
     59 //
     60 class copy {
     61 public:
     62 	copy();
     63 	static void setcontext(copy_args *argptr);
     64 	static copy_args *getcontext();
     65 
     66 private:
     67 	static os::tsd context;
     68 };
     69 
     70 #include <orb/infrastructure/copy_in.h>
     71 
     72 #endif	/* _COPY_H */
     73