Commit 14e852c0 authored by He Sheng's avatar He Sheng Committed by guzitao
Browse files

sw64: remove hmcall swpctx from context switch

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG



--------------------------------

It used to switch context in hmcall swpctx, which is not flexible
enough. We try to make it happen in kernel without hmcall swpctx.

To achieve this end, not only fpu state but also usp and tls pointer
have to be saved and restored. For process creation and hibernation,
the current tls pointer has to be read from CSR:TID as it may be out-
of-sync with the saved value. For suspend, it's better to be saved
and restored because there is no guarantee that WAKEUP interrupt will
be used. To do this, we add hmcall fixup to access CSR:TID and obtain
backward compatibility for user.

Besides, the old `unique` is too obscure to be understood. To make it
clear, we rename it to `tp` which is short for tls pointer, and then
retain HMC_rdunique/wrunique as alias of HMC_rdtp/wrtp.

Signed-off-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 2e880672
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment