Lines Matching +full:control +full:- +full:parent

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
33 /*-
62 * \file control.c
64 * \brief Device driver to repond to control domain events that impact
109 #include <xen/xen-os.h>
123 /*--------------------------- Forward Declarations --------------------------*/
132 /*-------------------------- Private Data Structures -------------------------*/
152 /*------------------------------ Event Handlers ------------------------------*/
169 printf("WARNING: xen/control: Suspend not supported!\n"); in xctrl_suspend()
214 * are resuming, and will allow us to reset per-cpu in xctrl_suspend()
226 * are resuming, and will allow us to reset per-cpu in xctrl_suspend()
283 timecounter->tc_get_timecount(timecounter); in xctrl_suspend()
331 /*------------------------------ Event Reception -----------------------------*/
341 error = xs_read(XST_NIL, "control", "shutdown", in xctrl_on_watch_event()
347 error = xs_write(XST_NIL, "control", "shutdown", ""); in xctrl_on_watch_event()
354 if (!strcmp(result, reason->name)) { in xctrl_on_watch_event()
355 reason->handler(); in xctrl_on_watch_event()
364 /*------------------ Private Device Attachment Functions --------------------*/
370 * Notify kernel is ready to handle "control/shutdown" events. Ignore in notify_support()
372 * parent "control" directory should be read-only for the guest. in notify_support()
374 xs_write(XST_NIL, "control", "feature-poweroff", "1"); in notify_support()
375 xs_write(XST_NIL, "control", "feature-reboot", "1"); in notify_support()
376 xs_write(XST_NIL, "control", "feature-suspend", "1"); in notify_support()
383 * \param parent The NewBus parent device for any devices this method adds.
386 xctrl_identify(driver_t *driver, device_t parent) in xctrl_identify() argument
392 BUS_ADD_CHILD(parent, 0, driver->name, 0); in xctrl_identify()
396 * \brief Probe for the existence of the Xen Control device
398 * \param dev NewBus device_t for this Xen control instance.
405 device_set_desc(dev, "Xen Control Device"); in xctrl_probe()
411 * \brief Attach the Xen control device.
413 * \param dev NewBus device_t for this Xen control instance.
426 xctrl->xctrl_watch.node = "control/shutdown"; in xctrl_attach()
427 xctrl->xctrl_watch.callback = xctrl_on_watch_event; in xctrl_attach()
428 xctrl->xctrl_watch.callback_data = (uintptr_t)xctrl; in xctrl_attach()
434 xctrl->xctrl_watch.max_pending = 1; in xctrl_attach()
435 xs_register_watch(&xctrl->xctrl_watch); in xctrl_attach()
446 * \brief Detach the Xen control device.
448 * \param dev NewBus device_t for this Xen control device instance.
461 xs_unregister_watch(&xctrl->xctrl_watch); in xctrl_detach()
474 /*-------------------- Private Device Attachment Data -----------------------*/