]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kinst: replace KINST_TRAMP_INIT
authorChristos Margiolis <christos@FreeBSD.org>
Tue, 23 May 2023 13:58:36 +0000 (16:58 +0300)
committerChristos Margiolis <christos@FreeBSD.org>
Tue, 23 May 2023 13:58:36 +0000 (16:58 +0300)
commitecca3180855a2aa7eb394706c7ae69d9c67b87b5
tree764bb21dfd43226f1a5d833fd3ba752a18185fb6
parent940e6d36de1ef010f731e290c9b2b08535fff424
kinst: replace KINST_TRAMP_INIT

The current implementation of KINST_TRAMP_INIT is working only on amd64,
where the breakpoint instruction is one byte long, which might not be
the case for other architectures (e.g in RISC-V it's either 2 or 4
bytes). This patch introduces two machine-dependent constants,
KINST_TRAMP_FILL_PATTERN and KINST_TRAMP_FILL_SIZE, which hold the fill
instruction and the size of that instruction in bytes respectively.

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39504
sys/cddl/dev/kinst/amd64/kinst_isa.h
sys/cddl/dev/kinst/trampoline.c