mckernel/lib/include/*.h mckernel/arch/x86/elfboot/* mckernel/arch/x86/kboot/main.c mckernel/arch/x86/kernel/* mckernel/lib/page_alloc.c mckernel/lib/string.c mckernel/lib/include/ihk/* except mckernel/arch/x86/kernel/include/signal.h mckernel/arch/x86/tools/mcreboot-attached-mic.sh.in mckernel/arch/x86/kernel/include/syscall_list.h mckernel/arch/x86/kernel/syscall.c .
52 lines
983 B
C
52 lines
983 B
C
/**
|
|
* \file cpulocal.h
|
|
* License details are found in the file LICENSE.
|
|
* \brief
|
|
* Declare information for individual CPUs.
|
|
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
|
|
* Copyright (C) 2011 - 2012 Taku Shimosawa
|
|
*/
|
|
/*
|
|
* HISTORY
|
|
*/
|
|
|
|
#ifndef HEADER_X86_COMMON_CPULOCAL_H
|
|
#define HEADER_X86_COMMON_CPULOCAL_H
|
|
|
|
#include <types.h>
|
|
#include <registers.h>
|
|
|
|
/*
|
|
* CPU Local Page
|
|
* 0 - : struct x86_cpu_local_varibles
|
|
* - 4096 : kernel stack
|
|
*/
|
|
|
|
#define X86_CPU_LOCAL_OFFSET_TSS 128
|
|
#define X86_CPU_LOCAL_OFFSET_KSTACK 16
|
|
#define X86_CPU_LOCAL_OFFSET_USTACK 24
|
|
|
|
struct x86_cpu_local_variables {
|
|
/* 0 */
|
|
unsigned long processor_id;
|
|
|
|
unsigned long apic_id;
|
|
/* 16 */
|
|
unsigned long kernel_stack;
|
|
unsigned long user_stack;
|
|
|
|
/* 32 */
|
|
struct x86_desc_ptr gdt_ptr;
|
|
unsigned short pad[3];
|
|
/* 48 */
|
|
uint64_t gdt[10];
|
|
/* 128 */
|
|
struct tss64 tss;
|
|
|
|
} __attribute__((packed));
|
|
|
|
struct x86_cpu_local_variables *get_x86_cpu_local_variable(int id);
|
|
|
|
|
|
#endif
|