Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的调用约定用于进行上下文切换是否重要。如在 AMD64 中,前 4 个参数通过寄存器或其他方式传递。
上下文切换系统是否需要担心这些细节?
上下文切换需要确保保存所有线程上下文:堆栈、CPU 寄存器和一些其他特定于操作系统的东西。
由于上下文切换是保存一切,它不需要知道调用约定。它正在保存寄存器,无论它们是否碰巧保存了当前函数的参数或其他一些数据。