From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: Re: [kvm-ppc-devel] [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c Date: Tue, 29 Apr 2008 11:36:36 -0500 Message-ID: <1209486996.6456.3.camel@thinkpadL> References: <200804291006.09128.hollisb@us.ibm.com> Reply-To: jyoung5@us.ibm.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-wV/FEtaa/ZOJohrWMfW0" Cc: kvm-ppc-devel@lists.sourceforge.net, kvm-devel@lists.sourceforge.net To: Hollis Blanchard Return-path: In-Reply-To: <200804291006.09128.hollisb@us.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org --=-wV/FEtaa/ZOJohrWMfW0 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, 2008-04-29 at 10:06 -0500, Hollis Blanchard wrote: > On Monday 28 April 2008 16:23:04 Jerone Young wrote: > > +/* This function is to manipulate a cell with multiple values */ > > +void dt_cell_multi(void *fdt, char *node_path, char *property, > > + uint32_t *val_array, int size) > > +{ > > + > > + int offset; > > + int ret; > > Could you please be more careful with your whitespace? Hmmm..I'm looking at the patch on my local machine and it doesn't have any whitespace damage. If there is whitespace damage it was caused by something else (like hg email is doing something). I've attached the orginal patch to this email. > --=-wV/FEtaa/ZOJohrWMfW0 Content-Disposition: attachment; filename=add_cell_multi Content-Type: text/plain; name=add_cell_multi; charset=utf-8 Content-Transfer-Encoding: 7bit Add function dt_cell_multi to hw/device_tree.c This patch adds function dt_cell_multi to allow for manipulation of device tree properties that contain mulitiple 32bit values. Signed-off-by: Jerone Young diff --git a/qemu/hw/device_tree.c b/qemu/hw/device_tree.c --- a/qemu/hw/device_tree.c +++ b/qemu/hw/device_tree.c @@ -162,6 +162,22 @@ void dt_cell(void *fdt, char *node_path, } } +/* This function is to manipulate a cell with multiple values */ +void dt_cell_multi(void *fdt, char *node_path, char *property, + uint32_t *val_array, int size) +{ + + int offset; + int ret; + offset = get_offset_of_node(fdt, node_path); + ret = fdt_setprop(fdt, offset, property, val_array, size); + if (ret < 0) { + printf("Unable to set device tree property '%s'\n", + property); + exit(1); + } +} + void dt_string(void *fdt, char *node_path, char *property, char *string) { diff --git a/qemu/hw/device_tree.h b/qemu/hw/device_tree.h --- a/qemu/hw/device_tree.h +++ b/qemu/hw/device_tree.h @@ -19,6 +19,8 @@ void dump_device_tree_to_file(void *fdt, void dump_device_tree_to_file(void *fdt, char *filename); void dt_cell(void *fdt, char *node_path, char *property, uint32_t val); +void dt_cell_multi(void *fdt, char *node_path, char *property, + uint32_t *val_array, int size); void dt_string(void *fdt, char *node_path, char *property, char *string); void dt_node(void *fdt, char *node_parent_path, char *name); --=-wV/FEtaa/ZOJohrWMfW0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone --=-wV/FEtaa/ZOJohrWMfW0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel --=-wV/FEtaa/ZOJohrWMfW0--