]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/include/kern/orb.h
7618dc72e725d0b138cb079f1a5ee32b14334d3a
[polintos/scott/priv.git] / kernel / include / kern / orb.h
1 #ifndef _KERN_ORB_H
2 #define _KERN_ORB_H
3
4 #include <kern/types.h>
5 #include <orb.h>
6
7 #include <util/list.h>
8 #include <System/Objects.h>
9
10 namespace Mem {
11         class AddrSpace;
12 };
13
14 namespace Threads {
15         class Thread;
16 };
17
18 namespace ORB {
19         typedef ulong ID;
20
21         struct CallFrame {
22                 // Address Space and PC to return to
23                 Mem::AddrSpace *ret_aspace;
24                 ulong ret_pc;
25                 
26                 // Caller's PIB Pointer
27                 System::RunTime::ParamInfoBlock *caller_user_pib;
28                 
29                 // Object and Method that were called -- it probably isn't strictly
30                 // necessary to keep track of this here, but it'd help in doing a
31                 // "traceforward" of the method invocation stack in order to
32                 // debug a stalled method call.
33                 
34                 ID object, method;
35         };
36         
37         struct CallStackHeader {
38                 Threads::Thread *thread;
39                 Util::List node;
40                 
41                 // Number of CallFrames under this header.
42                 // For a full page, this is:
43                 //   (Arch::page_size - sizeof(CallStackHeader)) / sizeof(CallFrame)
44                 // There is also a much smaller group of call frames in the Thread
45                 // structure, so that an ORB stack page doesn't need to be allocated
46                 // in the common case of shallow method nesting.
47         
48                 int num_frames;
49                 
50                 CallFrame frames[0];
51         };
52 }
53
54 #endif