]> git.buserror.net Git - polintos/scott/priv.git/blob - idl/proc.idl
Initial checkin from Perforce.
[polintos/scott/priv.git] / idl / proc.idl
1 // Process
2 //
3 // These are the interfaces through which operations are performed on
4 // processes.
5
6 namespace Proc;
7
8 interface Process {
9         guid: "9C751874-EAB6-11D9-8399-000A95BB581A";
10 };
11
12 // This interface is implemented by the Process class.
13 interface ThreadFactory {
14         guid: "9FDA3678-EAB6-11D9-97D1-000A95BB581A";
15
16         // Create a new thread in this process.  If pc is 0, then the new
17         // thread begins execution immediately after the call to new_thread. 
18         // Otherwise, the new thread begins execution at the address passed in
19         // pc.  If stack is 0, then the new thread begins with the same stack
20         // pointer as the caller.  Otherwise, the new thread begins with the
21         // stack pointer specified in stack.  Various flags can be specified
22         // by the NewThreadFlags bitmask; see the definition above for
23         // details.
24         // 
25         // Upon return to the caller, the newly created thread is placed in
26         // thread.  If pc is 0, the newly created thread will begin at the same
27         // address that the creator thread returns to, returning NULL in thread.
28
29         new_thread(ulong pc, ulong stack, ulong param, Thread thread out);
30         
31         // This method is identical to new_thread except that it is asynchronous,
32         // and thus cannot return thread, and cannot take a value of 0 for
33         // pc or stack.
34
35         new_thread_async(ulong pc, ulong stack, ulong param) async;
36 };
37
38 // This interface provides control of the binding between Processes
39 // and AddrSpaces.  It is implemented by the Process class.
40
41  
42 interface ProcAddrSpace {
43         guid: "A3494EFC-EAB6-11D9-955B-000A95BB581A";
44
45         // Return the AddrSpace in which the process executes
46         get_addr_space(Mem.AddrSpace addr_space out);
47         
48         // Attach the process to an AddrSpace.  If the process is currently
49         // attached to an AddrSpace, that address space is first detached.
50
51         set_addr_space(Mem.AddrSpace addr_space);
52
53         // This is a hack to implement Unix-like exec() efficiently.
54         // It atomically sets the address space and jumps to the address
55         // given.  If the current thread is not in this process, an
56         // InvalidState exception is thrown.
57
58         set_addr_space_and_jump(Mem.AddrSpace addr_space, ulong pc);
59 };
60
61 // This interface is implemented by the Process class. 
62 interface ProcTokens {  
63         guid: "A616D69E-EAB6-11D9-967E-000A95BB581A";
64
65         // Sets has_token to true if the process has currently has the
66         // specified token, or false if it does not.
67
68         has_token(ulong token, bool has_token out);
69         
70         // Grants the specified token to the process.  Throws a restartable
71         // TokenFault if the process does not have grant rights to the token.
72
73         grant_token(ulong token);
74 };
75
76 // This interface is implemented by the Process class. 
77 interface ProcTraps {
78         using Traps.Trappable;
79         guid: "A88F3742-EAB6-11D9-B772-000A95BB581A";
80
81         // Returns a reference to the Trappable object for this process.
82         // Traps sent to this object will be sent to all threads in
83         // the process.
84         
85         get_trappable(Trappable trappable out);
86
87         // Returns a reference to the TrapDistributor object for
88         // this process.  Traps sent to the distributor object will
89         // be sent to one arbitrary thread in the process, rather than
90         // all threads which are not ignoring the trap.  A trap will
91         // only be sent to a thread that masks the trap if all threads
92         // mask the trap; likewise, a trap will only be ignored if
93         // all threads ignore it (or if the process itself does).
94         
95         get_trap_distributor(Trappable trap_distributor out);
96 };