HelenOS sources
kseg 47 kernel/arch/amd64/src/kseg.c kseg_t *kseg;
kseg 49 kernel/arch/amd64/src/kseg.c kseg = (kseg_t *) malloc(sizeof(kseg_t));
kseg 50 kernel/arch/amd64/src/kseg.c if (!kseg)
kseg 53 kernel/arch/amd64/src/kseg.c kseg->ustack_rsp = 0;
kseg 54 kernel/arch/amd64/src/kseg.c kseg->kstack_rsp = 0;
kseg 55 kernel/arch/amd64/src/kseg.c kseg->fsbase = read_msr(AMD_MSR_FS);
kseg 57 kernel/arch/amd64/src/kseg.c write_msr(AMD_MSR_GS_KERNEL, (uintptr_t) kseg);
kseg 59 kernel/arch/amd64/src/proc/scheduler.c kseg_t *kseg = (kseg_t *) read_msr(AMD_MSR_GS_KERNEL);
kseg 60 kernel/arch/amd64/src/proc/scheduler.c kseg->kstack_rsp = THREAD->arch.kstack_rsp;
HelenOS homepage, sources at GitHub