sparc64: move retry logic out of stickcmpr_set()
authorcheloha <cheloha@openbsd.org>
Thu, 22 Dec 2022 19:51:11 +0000 (19:51 +0000)
committercheloha <cheloha@openbsd.org>
Thu, 22 Dec 2022 19:51:11 +0000 (19:51 +0000)
commit2f31c0f799d693315c02e9626bf14d90b50461c7
treede1ee040fb4945441614ffae5bcee0fb1398feba
parent1678ab6ab7fd4e836897e52fb97f83b8fa1029bf
sparc64: move retry logic out of stickcmpr_set()

In some cases, stickcmpr_set() fails to ensure that %STICK_CMPR leads
%STICK before returning to the caller.  Rewriting the retry logic in C
trivially fixes the issue.  So move the retry logic out into a new
function, stick_rearm().

Issue discovered by miod@, fix tested by miod@.

Link: https://marc.info/?l=openbsd-tech&m=167122933414238&w=2
ok kettenis@
sys/arch/sparc64/sparc64/clock.c
sys/arch/sparc64/sparc64/locore.s