Re: RtlCaptureContext equivalent

From: Borislav Petkov
Date: Sun Mar 20 2016 - 15:13:42 EST


On Sun, Mar 20, 2016 at 03:54:58PM +0200, David Kaplan wrote:
> Hi all
>
> i'm looking for a function within the kernel (for x86_64/amd64) that I
> can use from my module to save/load cpu context (something like
> Windows' RtlCaptureContext fcn).
>
> I assume there's something like that available but having a hard time
> tracking it down.

Something like arch/x86/power/cpu.c::save_processor_state() maybe?

I'm assuming you'll want to supply your own struct saved_context
though... And it doesn't save arch regs. There's also __show_regs()
which dumps arch regs and the rest but that is probably not what you
want...

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.