3 // These are the interfaces through which operations are performed on
9 guid: "9C751874-EAB6-11D9-8399-000A95BB581A";
12 // This interface is implemented by the Process class.
13 interface ThreadFactory {
14 guid: "9FDA3678-EAB6-11D9-97D1-000A95BB581A";
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
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.
29 new_thread(ulong pc, ulong stack, ulong param, Thread thread out);
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
35 new_thread_async(ulong pc, ulong stack, ulong param) async;
38 // This interface provides control of the binding between Processes
39 // and AddrSpaces. It is implemented by the Process class.
42 interface ProcAddrSpace {
43 guid: "A3494EFC-EAB6-11D9-955B-000A95BB581A";
45 // Return the AddrSpace in which the process executes
46 get_addr_space(Mem.AddrSpace addr_space out);
48 // Attach the process to an AddrSpace. If the process is currently
49 // attached to an AddrSpace, that address space is first detached.
51 set_addr_space(Mem.AddrSpace addr_space);
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.
58 set_addr_space_and_jump(Mem.AddrSpace addr_space, ulong pc);
61 // This interface is implemented by the Process class.
62 interface ProcTokens {
63 guid: "A616D69E-EAB6-11D9-967E-000A95BB581A";
65 // Sets has_token to true if the process has currently has the
66 // specified token, or false if it does not.
68 has_token(ulong token, bool has_token out);
70 // Grants the specified token to the process. Throws a restartable
71 // TokenFault if the process does not have grant rights to the token.
73 grant_token(ulong token);
76 // This interface is implemented by the Process class.
78 using Traps.Trappable;
79 guid: "A88F3742-EAB6-11D9-B772-000A95BB581A";
81 // Returns a reference to the Trappable object for this process.
82 // Traps sent to this object will be sent to all threads in
85 get_trappable(Trappable trappable out);
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).
95 get_trap_distributor(Trappable trap_distributor out);