qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Saving state on a context switch
@ 2007-05-02 13:17 eady
  2007-05-02 13:35 ` Paul Brook
  0 siblings, 1 reply; 2+ messages in thread
From: eady @ 2007-05-02 13:17 UTC (permalink / raw)
  To: qemu-devel

Can anyone think of a way to save and restore an additional cpu state 
variable during a context switch without modifying the target operating 
system? Basically I would like to add a variable to the CPUState 
structure that is saved and restored with the registers.

Any ideas?

Thanks,
Nuri

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Saving state on a context switch
  2007-05-02 13:17 [Qemu-devel] Saving state on a context switch eady
@ 2007-05-02 13:35 ` Paul Brook
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Brook @ 2007-05-02 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: eady

On Wednesday 02 May 2007, eady wrote:
> Can anyone think of a way to save and restore an additional cpu state
> variable during a context switch without modifying the target operating
> system? Basically I would like to add a variable to the CPUState
> structure that is saved and restored with the registers.

The short answer is that in general you can't.

Processes and contexts are managed by the host OS, and it is responsible for 
switching state appropriately. Some hardware has features to assist this 
process, but often not enough to reliably identify a particular process.

To do what you want generally requires intimite knowledge of the appropriate 
parts of your OS. Some debuggers are capable of doing this.
There are patches to add scripting support to GDB for this purpose. I don't 
have a URL handy, check the gdb mailing lists.

Paul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-02 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-02 13:17 [Qemu-devel] Saving state on a context switch eady
2007-05-02 13:35 ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).