📄 math_emulate.c
字号:
<!doctype html public "-//W3C//DTD HTML 3.2//EN"><html><head><title>Linux/kernel/math/math_emulate.c</title><meta http-equiv=Content-Type content="text/html; charset=gb2312"><base href="http://oldlinux.org/lxr/http/"></head><body bgcolor=white><div align=center> [<b><i>源代码浏览</i></b>] [<a href="diff/kernel/math/math_emulate.c">区别标定</a>] [<a href="ident">标识符搜索</a>] [<a href="search">文本搜索</a>] [<a href="find">文件搜索</a>]</div><h1 align=center> <a href="http:/"> OldLinux</a> <a href="http:blurb.html"> 交叉引用</a><br> <a href="source/">Linux</a>/<a href="source/kernel/">kernel</a>/<a href="source/kernel/math/">math</a>/<a href="source/kernel/math/math_emulate.c">math_emulate.c</a></h1><div align=center> <b>版本:</b> [<a href="source/kernel/math/math_emulate.c?v=1.0">1.0</a>] [<a href="source/kernel/math/math_emulate.c?v=0.99.11">0.99.11</a>] [<a href="source/kernel/math/math_emulate.c?v=0.99">0.99</a>] [<a href="source/kernel/math/math_emulate.c?v=0.97">0.97</a>] [<a href="source/kernel/math/math_emulate.c?v=0.96a">0.96a</a>] [<a href="source/kernel/math/math_emulate.c?v=0.95">0.95</a>] [<a href="source/kernel/math/math_emulate.c?v=0.12">0.12</a>] [<b><i>0.11</i></b>] [<a href="source/kernel/math/math_emulate.c?v=0.01">0.01</a>] <br> <b>体系结构:</b> [<b><i>i386</i></b>] <br></div><hr><pre> <a name=L1 href="source/kernel/math/math_emulate.c#L1">1</a> <b><i>/*</i></b> <a name=L2 href="source/kernel/math/math_emulate.c#L2">2</a> <b><i> * linux/kernel/math/math_emulate.c</i></b> <a name=L3 href="source/kernel/math/math_emulate.c#L3">3</a> <b><i> *</i></b> <a name=L4 href="source/kernel/math/math_emulate.c#L4">4</a> <b><i> * (C) 1991 Linus Torvalds</i></b> <a name=L5 href="source/kernel/math/math_emulate.c#L5">5</a> <b><i> */</i></b> <a name=L6 href="source/kernel/math/math_emulate.c#L6">6</a> <a name=L7 href="source/kernel/math/math_emulate.c#L7">7</a> <b><i>/*</i></b> <a name=L8 href="source/kernel/math/math_emulate.c#L8">8</a> <b><i> * This directory should contain the math-emulation code.</i></b> <a name=L9 href="source/kernel/math/math_emulate.c#L9">9</a> <b><i> * Currently only results in a signal.</i></b> <a name=L10 href="source/kernel/math/math_emulate.c#L10">10</a> <b><i> */</i></b> <a name=L11 href="source/kernel/math/math_emulate.c#L11">11</a> <a name=L12 href="source/kernel/math/math_emulate.c#L12">12</a> #include <signal.h> <a name=L13 href="source/kernel/math/math_emulate.c#L13">13</a> <a name=L14 href="source/kernel/math/math_emulate.c#L14">14</a> #include <linux/sched.h> <a name=L15 href="source/kernel/math/math_emulate.c#L15">15</a> #include <linux/kernel.h> <a name=L16 href="source/kernel/math/math_emulate.c#L16">16</a> #include <asm/segment.h> <a name=L17 href="source/kernel/math/math_emulate.c#L17">17</a> <a name=L18 href="source/kernel/math/math_emulate.c#L18">18</a> void <a href="ident?i=math_emulate">math_emulate</a>(long edi, long esi, long ebp, long sys_call_ret, <a name=L19 href="source/kernel/math/math_emulate.c#L19">19</a> long eax,long ebx,long ecx,long edx, <a name=L20 href="source/kernel/math/math_emulate.c#L20">20</a> unsigned short fs,unsigned short es,unsigned short ds, <a name=L21 href="source/kernel/math/math_emulate.c#L21">21</a> unsigned long eip,unsigned short cs,unsigned long eflags, <a name=L22 href="source/kernel/math/math_emulate.c#L22">22</a> unsigned short ss, unsigned long esp) <a name=L23 href="source/kernel/math/math_emulate.c#L23">23</a> { <a name=L24 href="source/kernel/math/math_emulate.c#L24">24</a> unsigned char first, second; <a name=L25 href="source/kernel/math/math_emulate.c#L25">25</a> <a name=L26 href="source/kernel/math/math_emulate.c#L26">26</a> <b><i>/* 0x0007 means user code space */</i></b> <a name=L27 href="source/kernel/math/math_emulate.c#L27">27</a> if (cs != 0x000F) { <a name=L28 href="source/kernel/math/math_emulate.c#L28">28</a> <a href="ident?i=printk">printk</a>(<i>"math_emulate: %04x:%08x\n\r"</i>,cs,eip); <a name=L29 href="source/kernel/math/math_emulate.c#L29">29</a> <a href="ident?i=panic">panic</a>(<i>"Math emulation needed in kernel"</i>); <a name=L30 href="source/kernel/math/math_emulate.c#L30">30</a> } <a name=L31 href="source/kernel/math/math_emulate.c#L31">31</a> first = <a href="ident?i=get_fs_byte">get_fs_byte</a>((char *)((*&eip)++)); <a name=L32 href="source/kernel/math/math_emulate.c#L32">32</a> second = <a href="ident?i=get_fs_byte">get_fs_byte</a>((char *)((*&eip)++)); <a name=L33 href="source/kernel/math/math_emulate.c#L33">33</a> <a href="ident?i=printk">printk</a>(<i>"%04x:%08x %02x %02x\n\r"</i>,cs,eip-2,first,second); <a name=L34 href="source/kernel/math/math_emulate.c#L34">34</a> <a href="ident?i=current">current</a>->signal |= 1<<(<a href="ident?i=SIGFPE">SIGFPE</a>-1); <a name=L35 href="source/kernel/math/math_emulate.c#L35">35</a> } <a name=L36 href="source/kernel/math/math_emulate.c#L36">36</a> <a name=L37 href="source/kernel/math/math_emulate.c#L37">37</a> void <a href="ident?i=math_error">math_error</a>(void) <a name=L38 href="source/kernel/math/math_emulate.c#L38">38</a> { <a name=L39 href="source/kernel/math/math_emulate.c#L39">39</a> __asm__(<i>"fnclex"</i>); <a name=L40 href="source/kernel/math/math_emulate.c#L40">40</a> if (<a href="ident?i=last_task_used_math">last_task_used_math</a>) <a name=L41 href="source/kernel/math/math_emulate.c#L41">41</a> <a href="ident?i=last_task_used_math">last_task_used_math</a>->signal |= 1<<(<a href="ident?i=SIGFPE">SIGFPE</a>-1); <a name=L42 href="source/kernel/math/math_emulate.c#L42">42</a> } <a name=L43 href="source/kernel/math/math_emulate.c#L43">43</a> </pre><hr><div align=center> [<b><i>源代码浏览</i></b>] [<a href="diff/kernel/math/math_emulate.c">区别标定</a>] [<a href="ident">标识符搜索</a>] [<a href="search">文本搜索</a>] [<a href="find">文件搜索</a>] </div><hr>本网页由 <a href="http:blurb.html">LXR引擎</a> 自动生成.<br></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -