博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
慢慢欣赏linux X86中如何使用TSS
阅读量:4069 次
发布时间:2019-05-25

本文共 1059 字,大约阅读时间需要 3 分钟。

以linux 2.6.34版本为例, 以X86_64为例

声明:

DECLARE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss);

初始化:

void __cpuinit cpu_init(void){	struct tss_struct *t;		cpu = stack_smp_processor_id();	t = &per_cpu(init_tss, cpu);		me = current;		*	 * Initialize the per-CPU GDT with the boot GDT,	 * and set up the GDT descriptor:	 */	switch_to_new_gdt(cpu);	loadsegment(fs, 0);	load_idt((const struct desc_ptr *)&idt_descr);	memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);		load_sp0(t, &current->thread);	set_tss_desc(cpu, t);	load_TR_desc();	load_LDT(&init_mm.context);}

进程切换的时候

__notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *next_p){	struct thread_struct *prev = &prev_p->thread;	struct thread_struct *next = &next_p->thread;	int cpu = smp_processor_id();	struct tss_struct *tss = &per_cpu(init_tss, cpu);		/*	 * Reload esp0, LDT and the page table pointer:	 */	load_sp0(tss, next);}

Linux内核TSS的使用

https://www.cnblogs.com/long123king/p/3501853.html

linux内核修炼之利用内核栈切换进程

https://zhuanlan.zhihu.com/p/201549158

你可能感兴趣的文章
network manager
查看>>
OS + Linux Disk disk lvm / disk partition / disk mount / disk io
查看>>
RedHat + OS CPU、MEM、DISK
查看>>
net TCP/IP / TIME_WAIT / tcpip / iperf / cain
查看>>
script webshell jspWebShell / pythonWebShell / phpWebShell
查看>>
project site_dns
查看>>
webServer kzserver/1.0.0
查看>>
hd printer lexmark / dazifuyin / dayin / fuyin
查看>>
OS + Unix IBM Aix basic / topas / nmon / filemon / vmstat / iostat / sysstat/sar
查看>>
monitorServer nagios / cacti / tivoli / zabbix / SaltStack
查看>>
my ReadMap subway / metro / map / ditie / gaotie / traffic / jiaotong
查看>>
OS + Linux DNS Server Bind
查看>>
web test flow
查看>>
web test LoadRunner SAP / java / Java Vuser / web_set_max_html_param_len
查看>>
OS + UNIX AIX command
查看>>
OS + UNIX AIX performance
查看>>
OS + UNIX AIX Tools
查看>>
my ReadBook_liutongjingjixue / circulation economics
查看>>
my ReadBook_wangluoyingxiaoyucehua / network marketing / wangluoyingxiao
查看>>
db base database
查看>>