[PATCH] OF device tree update (2.5)

Nathan Lynch nathanl at austin.ibm.com
Thu Oct 9 10:57:41 EST 2003


The attached patch allows the addition and removal of Open Firmware
device tree nodes at runtime, after the system has booted.  This
capability is desirable for supporting hotplug of devices that have
representations in /proc/device-tree (e.g. PCI devices, CPUs).

The mechanism for initiating addition or removal of a node is
/proc/ppc64/ofdt.  The write() callback for the the file takes the
pathname (relative to the base of the device tree) of the node to
remove.  The writev() callback for the file takes the pathname of the
node to be added, followed by name-value pairs for the properties.  This
file is meant for use by userspace tools that would also be initiating
the proper RTAS operations for a hotplug operation.

The device tree and global list are protected by a read-write spinlock.
      The device_node structure has gained a reference count, a flags
field, and a few fields for keeping track of procfs entries.  There is
no per-node lock at this time.

I have included the ppc64 and arch-independent bits all in one patch.
(This includes the "keep track of proc entries in device nodes" stuff I
posted a couple of days ago).  Patch is against latest ameslab bk (cset

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: OF_devtree_update.patch
Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20031008/13ad8712/attachment.txt 

More information about the Linuxppc64-dev mailing list