小编bon*_*gsu的帖子

ljmp指令在linux内核fork系统调用中做了什么?

我正在研究linux内核源码(旧版本0.11v).当我检查fork系统调用时,有一些asm代码用于上下文切换,如下所示:

/*
 * switch_to(n) should switch tasks to task nr n, first
 * checking that n isn't the current task, in which case it does nothing.
 * This also clears the TS-flag if the task we switched to has used
 * tha math co-processor latest.
 */
#define switch_to(n) {\
struct {long a,b;} __tmp; \
__asm__("cmpl %%ecx,current\n\t" \
    "je 1f\n\t" \
    "movw %%dx,%1\n\t" \
    "xchgl %%ecx,current\n\t" \
    "ljmp *%0\n\t" \
    "cmpl %%ecx,last_task_used_math\n\t" \
    "jne 1f\n\t" \
    "clts\n" \
    "1:" \
    ::"m" …
Run Code Online (Sandbox Code Playgroud)

x86 assembly gnu-assembler linux-kernel att

7
推荐指数
1
解决办法
1913
查看次数

与 passthrough 相比,binderised hidl 的优势是什么?

在android中,与passthrough hidl相比,binderised hidl有什么优势?

据我所知,有两种 hidl 方式(绑定方式(单独进程中的客户端/服务器),直通方式(同一进程中的客户端/服务器)。与直通方式相比,绑定方式有什么优势?

我认为绑定方式比直通有更多的开销,因为绑定方式需要使用绑定器通信(RPC)。

为什么供应商使用绑定方式?

android hal android-source

5
推荐指数
1
解决办法
2016
查看次数