From f4eb010706b6c96c136c7aaa9079159743f33fa8 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 26 Oct 2007 16:54:31 +1000 Subject: [POWERPC] Add of_get_next_parent() Iterating through a device node's parents is simple enough, but dealing with the refcounts properly is a little ugly, and replicating that logic is asking for someone to get it wrong or forget it all together, eg: while (dn != NULL) { /* loop body */ tmp = of_get_parent(dn); of_node_put(dn); dn = tmp; } So add of_get_next_parent(), inspired by of_get_next_child(). The contract is that it returns the parent and drops the reference on the current node, this makes the loop look like: while (dn != NULL) { /* loop body */ dn = of_get_next_parent(dn); } Signed-off-by: Michael Ellerman Acked-by: David S. Miller Signed-off-by: Paul Mackerras --- include/linux/of.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/of.h b/include/linux/of.h index b5f33efcb8e..6981016dcc2 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -50,6 +50,7 @@ extern struct device_node *of_find_matching_node(struct device_node *from, extern struct device_node *of_find_node_by_path(const char *path); extern struct device_node *of_find_node_by_phandle(phandle handle); extern struct device_node *of_get_parent(const struct device_node *node); +extern struct device_node *of_get_next_parent(struct device_node *node); extern struct device_node *of_get_next_child(const struct device_node *node, struct device_node *prev); #define for_each_child_of_node(parent, child) \ -- cgit v1.2.3 From 24f1a849614ba1805e26a05da7cc8c6bd67490ea Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 2 Jan 2008 17:05:48 -0800 Subject: [POWERPC] Add SPE registers to core dumps This makes the SPE register data appear in ELF core dumps, using the new n_type value NT_PPC_SPE (0x101). This new note type is not used by any consumers of core files yet, but support can be added. I don't even have any hardware with SPE capabilities, so I've never seen such a note. But this demonstrates how simple it is to export register information in core dumps when the user_regset style is used for the low-level code. Signed-off-by: Roland McGrath Signed-off-by: Paul Mackerras --- include/linux/elf.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/elf.h b/include/linux/elf.h index 7ceb24d87c1..30eb6fbd532 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -355,6 +355,7 @@ typedef struct elf64_shdr { #define NT_AUXV 6 #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ +#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ -- cgit v1.2.3