Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/include/mach/rpc.h

1/*
2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32/*
33 * Mach RPC Subsystem Interfaces
34 */
35
36#ifndef_MACH_RPC_H_
37#define _MACH_RPC_H_
38
39#include <mach/boolean.h>
40#include <mach/kern_return.h>
41#include <mach/port.h>
42#include <mach/vm_types.h>
43
44#include <mach/mig.h>
45#include <mach/mig_errors.h>
46#include <mach/machine/rpc.h>
47#include <mach/thread_status.h>
48
49/*
50 * These are the types for RPC-specific variants of the MIG routine
51 * descriptor and subsystem data types.
52 *
53 * THIS IS ONLY FOR COMPATIBILITY. WE WILL NOT BE IMPLEMENTING THIS.
54 */
55
56/*
57 * Basic mach rpc types.
58 */
59typedef unsigned int routine_arg_type;
60typedef unsigned introutine_arg_offset;
61typedef unsigned introutine_arg_size;
62
63/*
64 * Definitions for a signature's argument and routine descriptor's.
65 */
66struct rpc_routine_arg_descriptor {
67routine_arg_typetype; /* Port, Array, etc. */
68 routine_arg_size size; /* element size in bytes */
69 routine_arg_size count; /* number of elements */
70routine_arg_offsetoffset; /* Offset in list of routine args */
71};
72typedef struct rpc_routine_arg_descriptor *rpc_routine_arg_descriptor_t;
73
74struct rpc_routine_descriptor {
75mig_impl_routine_timpl_routine;/* Server work func pointer */
76mig_stub_routine_tstub_routine;/* Unmarshalling func pointer */
77unsigned intargc;/* Number of argument words */
78unsigned intdescr_count;/* Number of complex argument */
79 /* descriptors */
80rpc_routine_arg_descriptor_t
81arg_descr;/* Pointer to beginning of */
82/* the arg_descr array */
83unsigned intmax_reply_msg;/* Max size for reply msg */
84};
85typedef struct rpc_routine_descriptor *rpc_routine_descriptor_t;
86
87#define RPC_DESCR_SIZE(x) ((x)->descr_count * \
88sizeof(struct rpc_routine_arg_descriptor))
89
90struct rpc_signature {
91 struct rpc_routine_descriptor rd;
92 struct rpc_routine_arg_descriptor rad[1];
93};
94
95#define RPC_SIGBUF_SIZE 8
96
97/*
98 *A subsystem describes a set of server routines that can be invoked by
99 *mach_rpc() on the ports that are registered with the subsystem. For
100 *each routine, the routine number is given, along with the
101 *address of the implementation function in the server and a
102 *description of the arguments of the routine (it's "signature").
103 *
104 *This structure definition is only a template for what is really a
105 *variable-length structure (generated by MIG for each subsystem).
106 *The actual structures do not always have one entry in the routine
107 *array, and also have a varying number of entries in the arg_descr
108 *array. Each routine has an array of zero or more arg descriptors
109 *one for each complex arg. These arrays are all catenated together
110 *to form the arg_descr field of the subsystem struct. The
111 *arg_descr field of each routine entry points to a unique sub-sequence
112 *within this catenated array. The goal is to keep everything
113 *contiguous.
114 */
115struct rpc_subsystem {
116void*reserved;/* Reserved for system use */
117
118mach_msg_id_tstart;/* Min routine number */
119mach_msg_id_tend;/* Max routine number + 1 */
120unsigned intmaxsize;/* Max mach_msg size */
121vm_address_tbase_addr;/* Address of this struct in user */
122
123struct rpc_routine_descriptor/* Array of routine descriptors */
124routine[1 /* Actually, (start-end+1) */
125 ];
126
127struct rpc_routine_arg_descriptor
128arg_descriptor[1 /* Actually, the sum of the descr_ */
129]; /* count fields for all routines */
130};
131typedef struct rpc_subsystem *rpc_subsystem_t;
132
133#define RPC_SUBSYSTEM_NULL((rpc_subsystem_t) 0)
134
135#endif/* _MACH_RPC_H_ */
136

Archive Download this file

Revision: 881