Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_thread.c
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
* layout, as exposed by KBI to modules. On head, the KBI is allowed | * layout, as exposed by KBI to modules. On head, the KBI is allowed | ||||
* to drift, change to the structures must be accompanied by the | * to drift, change to the structures must be accompanied by the | ||||
* assert update. | * assert update. | ||||
* | * | ||||
* On the stable branches after KBI freeze, conditions must not be | * On the stable branches after KBI freeze, conditions must not be | ||||
* violated. Typically new fields are moved to the end of the | * violated. Typically new fields are moved to the end of the | ||||
* structures. | * structures. | ||||
*/ | */ | ||||
#ifndef CALLOUT_DEBUG_DRAIN | |||||
hselasky: This ifndef looks like a temporary hack. Will you fix before commit? | |||||
Done Inline ActionsNo it is not a hack, the patch changes KBI of the kernel. On the other hand, I am not sure that this patch is worth committing. It is for debugging. kib: No it is not a hack, the patch changes KBI of the kernel.
On the other hand, I am not sure… | |||||
#ifdef __amd64__ | #ifdef __amd64__ | ||||
_Static_assert(offsetof(struct thread, td_flags) == 0xfc, | _Static_assert(offsetof(struct thread, td_flags) == 0xfc, | ||||
"struct thread KBI td_flags"); | "struct thread KBI td_flags"); | ||||
_Static_assert(offsetof(struct thread, td_pflags) == 0x104, | _Static_assert(offsetof(struct thread, td_pflags) == 0x104, | ||||
"struct thread KBI td_pflags"); | "struct thread KBI td_pflags"); | ||||
_Static_assert(offsetof(struct thread, td_frame) == 0x4a8, | _Static_assert(offsetof(struct thread, td_frame) == 0x4a8, | ||||
"struct thread KBI td_frame"); | "struct thread KBI td_frame"); | ||||
_Static_assert(offsetof(struct thread, td_emuldata) == 0x6b0, | _Static_assert(offsetof(struct thread, td_emuldata) == 0x6b0, | ||||
"struct thread KBI td_emuldata"); | "struct thread KBI td_emuldata"); | ||||
_Static_assert(offsetof(struct proc, p_flag) == 0xb0, | _Static_assert(offsetof(struct proc, p_flag) == 0xb0, | ||||
"struct proc KBI p_flag"); | "struct proc KBI p_flag"); | ||||
_Static_assert(offsetof(struct proc, p_pid) == 0xbc, | _Static_assert(offsetof(struct proc, p_pid) == 0xbc, | ||||
"struct proc KBI p_pid"); | "struct proc KBI p_pid"); | ||||
_Static_assert(offsetof(struct proc, p_filemon) == 0x3b8, | _Static_assert(offsetof(struct proc, p_filemon) == 0x3b8, | ||||
"struct proc KBI p_filemon"); | "struct proc KBI p_filemon"); | ||||
_Static_assert(offsetof(struct proc, p_comm) == 0x3d0, | _Static_assert(offsetof(struct proc, p_comm) == 0x3d0, | ||||
"struct proc KBI p_comm"); | "struct proc KBI p_comm"); | ||||
_Static_assert(offsetof(struct proc, p_emuldata) == 0x4b0, | _Static_assert(offsetof(struct proc, p_emuldata) == 0x4b0, | ||||
"struct proc KBI p_emuldata"); | "struct proc KBI p_emuldata"); | ||||
#endif | #endif /* __amd64__ */ | ||||
#ifdef __i386__ | #ifdef __i386__ | ||||
_Static_assert(offsetof(struct thread, td_flags) == 0x98, | _Static_assert(offsetof(struct thread, td_flags) == 0x98, | ||||
"struct thread KBI td_flags"); | "struct thread KBI td_flags"); | ||||
_Static_assert(offsetof(struct thread, td_pflags) == 0xa0, | _Static_assert(offsetof(struct thread, td_pflags) == 0xa0, | ||||
"struct thread KBI td_pflags"); | "struct thread KBI td_pflags"); | ||||
_Static_assert(offsetof(struct thread, td_frame) == 0x304, | _Static_assert(offsetof(struct thread, td_frame) == 0x304, | ||||
"struct thread KBI td_frame"); | "struct thread KBI td_frame"); | ||||
_Static_assert(offsetof(struct thread, td_emuldata) == 0x348, | _Static_assert(offsetof(struct thread, td_emuldata) == 0x348, | ||||
"struct thread KBI td_emuldata"); | "struct thread KBI td_emuldata"); | ||||
_Static_assert(offsetof(struct proc, p_flag) == 0x68, | _Static_assert(offsetof(struct proc, p_flag) == 0x68, | ||||
"struct proc KBI p_flag"); | "struct proc KBI p_flag"); | ||||
_Static_assert(offsetof(struct proc, p_pid) == 0x74, | _Static_assert(offsetof(struct proc, p_pid) == 0x74, | ||||
"struct proc KBI p_pid"); | "struct proc KBI p_pid"); | ||||
_Static_assert(offsetof(struct proc, p_filemon) == 0x268, | _Static_assert(offsetof(struct proc, p_filemon) == 0x268, | ||||
"struct proc KBI p_filemon"); | "struct proc KBI p_filemon"); | ||||
_Static_assert(offsetof(struct proc, p_comm) == 0x27c, | _Static_assert(offsetof(struct proc, p_comm) == 0x27c, | ||||
"struct proc KBI p_comm"); | "struct proc KBI p_comm"); | ||||
_Static_assert(offsetof(struct proc, p_emuldata) == 0x308, | _Static_assert(offsetof(struct proc, p_emuldata) == 0x308, | ||||
"struct proc KBI p_emuldata"); | "struct proc KBI p_emuldata"); | ||||
#endif | #endif /* __i386__ */ | ||||
#endif /* CALLOUT_DEBUG_DRAIN */ | |||||
SDT_PROVIDER_DECLARE(proc); | SDT_PROVIDER_DECLARE(proc); | ||||
SDT_PROBE_DEFINE(proc, , , lwp__exit); | SDT_PROBE_DEFINE(proc, , , lwp__exit); | ||||
/* | /* | ||||
* thread related storage. | * thread related storage. | ||||
*/ | */ | ||||
static uma_zone_t thread_zone; | static uma_zone_t thread_zone; | ||||
▲ Show 20 Lines • Show All 1,227 Lines • Show Last 20 Lines |
This ifndef looks like a temporary hack. Will you fix before commit?