public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5@us.ibm.com>
To: kvm-devel@lists.sourceforge.net
Cc: kvm-ppc-devel@lists.sourceforge.net
Subject: [PATCH 1 of 2] Add function dt_cell_multi to hw/device_tree.c
Date: Mon, 05 May 2008 11:04:53 -0500	[thread overview]
Message-ID: <cf3ccc3add69052aade6.1210003493@thinkpadL> (raw)
In-Reply-To: <patchbomb.1210003492@thinkpadL>

# HG changeset patch
# User Jerone Young <jyoung5@us.ibm.com>
# Date 1210003408 18000
# Branch merge
# Node ID cf3ccc3add69052aade695c746151b1cb8812252
# Parent  97e439fdd4e91c3fb1ef9055f073add55084d69f
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 <jyoung5@us.ibm.com>

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,21 @@ 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);

-------------------------------------------------------------------------
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

  reply	other threads:[~2008-05-05 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-05 16:04 [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model Jerone Young
2008-05-05 16:04 ` Jerone Young [this message]
2008-05-05 16:04 ` [PATCH 2 of 2] Fix memory defined in device tree by declaring it dynamically " Jerone Young
2008-05-05 18:00 ` [kvm-ppc-devel] [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory " Hollis Blanchard
2008-05-06 14:58 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf3ccc3add69052aade6.1210003493@thinkpadL \
    --to=jyoung5@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=kvm-ppc-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox