tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pmf(9) and Xen domU suspending?



Jean-Yves Migeon wrote:
Hi list,

I am working on suspend/resume functionality for port-xen under the supervision of Manuel Bouyer (bouyer@) and Stoned Elipot (seb@). Currently, I am mostly trying to get familiar with NetBSD internals, and Xen.

While studying the code regarding devices relating to port-xen (xenbus, xennet, hypervisor...), I was thinking at how I should implement the suspend/resume mechanisms for theses devices and buses (inspired by ACPI states). Manuel suggested me to have a look at pmf(9), but the documentation tends to be scarce (compared to autoconf machinery on "NetBSD internals"). And since pmf(9) is still a WIP, I am a bit lost with it.

The man page points me to the MI implementation of it in the kernel. However, I would like to know if there lies somewhere some "canonical" example (or how-to) I could read just to get a better understanding of it.

Thanking you in advance for your time and patience,

Hi Jean-Yves --

Take a look at any device driver -- sys/dev/pci/esa.c is a typical example.

In a nutshell: The device's suspend/resume callbacks are responsible for stopping and starting the device, and saving/restoring state. The bus driver (eg. pci) is typically responsible for power management control of those devices. sys/dev/pci/pci.c -- start with the call to device_pmf_driver_set_child_register in pciattach.

Cheers,
Jared


Home | Main Index | Thread Index | Old Index