Lines Matching defs:cpu
11 #include <cpu.h>
97 unsigned SetTSS(unsigned cpu,
99 unsigned SetUserTLS(unsigned cpu,
270 GlobalDescriptorTable::SetTSS(unsigned cpu, const TSSDescriptor& tss)
272 auto index = kFirstTSS + cpu * 3;
281 GlobalDescriptorTable::SetUserTLS(unsigned cpu, uintptr_t base, size_t limit)
283 auto index = kFirstTSS + cpu * 3 + 2;
355 cpu_ent* cpu = &gCPU[smp_get_current_cpu()];
356 if (cpu->fault_handler != 0) {
358 frame->ip = cpu->fault_handler;
359 frame->bp = cpu->fault_handler_stack_pointer;
381 x86_descriptors_preboot_init_percpu(kernel_args* args, int cpu)
383 if (cpu == 0) {
391 memset(&gCPU[cpu].arch.tss, 0, sizeof(struct tss));
392 gCPU[cpu].arch.tss.io_map_base = sizeof(struct tss);
395 struct tss* tss = &gCPU[cpu].arch.tss;
397 tss->ist1 = (addr_t)x86_get_double_fault_stack(cpu, &stackSize);
401 auto tssIndex = sGDT.SetTSS(cpu,
402 TSSDescriptor(uintptr_t(&gCPU[cpu].arch.tss), sizeof(struct tss)));
405 sGDT.SetUserTLS(cpu, 0, TLS_COMPAT_SIZE);
446 x86_64_set_user_tls_segment_base(int cpu, addr_t base)
448 return sGDT.SetUserTLS(cpu, base, TLS_COMPAT_SIZE);