Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 sun4v: added new function mdesc_name_by_idx...
details: https://anonhg.NetBSD.org/src/rev/3bc3ff1d54e1
branches: trunk
changeset: 336831:3bc3ff1d54e1
user: palle <palle%NetBSD.org@localhost>
date: Sun Mar 22 19:33:21 2015 +0000
description:
sun4v: added new function mdesc_name_by_idx() for retrieving the name of a node
diffstat:
sys/arch/sparc64/include/mdesc.h | 3 ++-
sys/arch/sparc64/sparc64/mdesc.c | 22 +++++++++++++++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diffs (48 lines):
diff -r 8f5cdab2dff1 -r 3bc3ff1d54e1 sys/arch/sparc64/include/mdesc.h
--- a/sys/arch/sparc64/include/mdesc.h Sun Mar 22 17:28:22 2015 +0000
+++ b/sys/arch/sparc64/include/mdesc.h Sun Mar 22 19:33:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mdesc.h,v 1.2 2015/01/19 19:46:08 palle Exp $ */
+/* $NetBSD: mdesc.h,v 1.3 2015/03/22 19:33:21 palle Exp $ */
/* $OpenBSD: mdesc.h,v 1.3 2014/11/30 22:26:14 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
@@ -50,4 +50,5 @@
int mdesc_find_node(const char *);
int mdesc_find_node_by_idx(int, const char *);
int mdesc_next_node(int);
+const char *mdesc_name_by_idx(int);
#endif
diff -r 8f5cdab2dff1 -r 3bc3ff1d54e1 sys/arch/sparc64/sparc64/mdesc.c
--- a/sys/arch/sparc64/sparc64/mdesc.c Sun Mar 22 17:28:22 2015 +0000
+++ b/sys/arch/sparc64/sparc64/mdesc.c Sun Mar 22 19:33:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mdesc.c,v 1.3 2015/01/19 19:46:08 palle Exp $ */
+/* $NetBSD: mdesc.c,v 1.4 2015/03/22 19:33:21 palle Exp $ */
/* $OpenBSD: mdesc.c,v 1.7 2014/11/30 22:26:15 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
@@ -253,3 +253,23 @@
return elem[idx].d.val;
}
+const char *
+mdesc_name_by_idx(int idx)
+{
+ struct md_header *hdr;
+ struct md_element *elem;
+ const char *name_blk;
+ const char *str;
+
+ hdr = (struct md_header *)mdesc;
+ elem = (struct md_element *)(mdesc + sizeof(struct md_header));
+ name_blk = (char *)mdesc + sizeof(struct md_header) + hdr->node_blk_sz;
+
+ str = name_blk + elem[idx].name_offset;
+
+ return str;
+
+}
+
+
+
Home |
Main Index |
Thread Index |
Old Index