1
Fork 0

libcore: Fix 32 bit Rust task structure offsets for unwinding

This commit is contained in:
Patrick Walton 2012-09-24 20:24:10 -07:00
parent ba8750a550
commit 530540025c

View file

@ -33,7 +33,14 @@ struct MemoryRegion { priv opaque: () }
#[cfg(target_arch="x86")] #[cfg(target_arch="x86")]
struct Registers { struct Registers {
data: [u32 * 13] data: [u32 * 16]
}
#[cfg(target_arch="x86")]
struct Context {
regs: Registers,
next: *Context,
pad: [u32 * 3]
} }
#[cfg(target_arch="x86_64")] #[cfg(target_arch="x86_64")]
@ -41,10 +48,11 @@ struct Registers {
data: [u64 * 22] data: [u64 * 22]
} }
#[cfg(target_arch="x86_64")]
struct Context { struct Context {
regs: Registers, regs: Registers,
next: *Context, next: *Context,
pad: u64 pad: uintptr_t
} }
struct BoxedRegion { struct BoxedRegion {
@ -53,6 +61,27 @@ struct BoxedRegion {
live_allocs: *BoxRepr live_allocs: *BoxRepr
} }
#[cfg(target_arch="x86")]
struct Task {
// Public fields
refcount: intptr_t, // 0
id: TaskID, // 4
pad: [u32 * 2], // 8
ctx: Context, // 16
stack_segment: *StackSegment, // 96
runtime_sp: uintptr_t, // 100
scheduler: *Scheduler, // 104
scheduler_loop: *SchedulerLoop, // 108
// Fields known only to the runtime
kernel: *Kernel, // 112
name: *c_char, // 116
list_index: i32, // 120
rendezvous_ptr: *uintptr_t, // 124
boxed_region: BoxedRegion // 128
}
#[cfg(target_arch="x86_64")]
struct Task { struct Task {
// Public fields // Public fields
refcount: intptr_t, refcount: intptr_t,
@ -66,7 +95,7 @@ struct Task {
// Fields known only to the runtime // Fields known only to the runtime
kernel: *Kernel, kernel: *Kernel,
name: *c_char, name: *c_char,
list_index: *i32, list_index: i32,
rendezvous_ptr: *uintptr_t, rendezvous_ptr: *uintptr_t,
boxed_region: BoxedRegion boxed_region: BoxedRegion
} }