What should I do next when I read the Linux source code process switching?
Source: Internet
Author: User
The next step of Linux source code process switching requires additional knowledge-general Linux technology-Linux programming and kernel information. The following is a detailed description. # Define switch_to (n ){\
Struct {long a, B;} _ tmp ;\
_ Asm _ ("cmpl % ecx, _ current \ n \ t "\
"Je 1f \ n \ t "\
"Xchgl % ecx, _ current \ n \ t "\
"Movw % dx, % 1 \ n \ t "\
"Ljmp % 0 \ n \ t "\
"Cmpl % ecx, % 2 \ n \ t "\
"Jne 1f \ n \ t "\
"Clts \ n "\
"1 :"\
: "M" (* & __ tmp. a), "m" (* & __ tmp. B ),\
"M" (last_task_used_math), "d" _ TSS (n), "c" (long) task [n]); \
}
There are some questions about this part of the Code, although it is not completely understandable, but some problems need to be solved seriously.
The functions of _ tmp are probably known, but it must be confirmed that the real functions of last_task_used_math need to read more source code. Why should we use clts to clear the TS bit of CR0? We need to carefully read the TSS and task switch sections in Intel's Technical Manual.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service