From: Geoff Levand <geoffrey.levand@am•sony.com>
To: paulus@samba•org
Cc: linuxppc-dev@ozlabs•org,
Takashi Yamamoto <TakashiA.Yamamoto@jp•sony.com>
Subject: [patch 2/4 v2] PS3: Add logical performance monitor repository routines
Date: Tue, 08 Jan 2008 22:35:36 -0800 [thread overview]
Message-ID: <47846B38.7010409@am.sony.com> (raw)
In-Reply-To: <477EF59C.2070809@am.sony.com>
From: Takashi Yamamoto <TakashiA.Yamamoto@jp•sony.com>
Add repository routines for the PS3 Logical Performance Monitor (lpm).
Signed-off-by: Takashi Yamamoto <TakashiA.Yamamoto@jp•sony.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am•sony.com>
---
v2: correct Yamamoto-san's mail addr.
arch/powerpc/platforms/ps3/platform.h | 7 ++++
arch/powerpc/platforms/ps3/repository.c | 48 ++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 1 deletion(-)
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -189,7 +189,7 @@ int ps3_repository_read_stor_dev_region(
/* repository pu and memory info */
int ps3_repository_read_num_pu(unsigned int *num_pu);
-int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
+int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id);
int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
int ps3_repository_read_region_total(u64 *region_total);
@@ -203,6 +203,11 @@ int ps3_repository_read_be_node_id(unsig
int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
+/* repository performance monitor info */
+
+int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
+ u64 *rights);
+
/* repository 'Other OS' area */
int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -902,6 +902,54 @@ int ps3_repository_read_be_tb_freq(unsig
: ps3_repository_read_tb_freq(node_id, tb_freq);
}
+int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
+ u64 *rights)
+{
+ int result;
+ u64 node_id;
+
+ *lpar = 0;
+ *rights = 0;
+ result = ps3_repository_read_be_node_id(be_index, &node_id);
+ return result ? result
+ : read_node(PS3_LPAR_ID_PME,
+ make_first_field("be", 0),
+ node_id,
+ make_field("lpm", 0),
+ make_field("priv", 0),
+ lpar, rights);
+}
+
+int ps3_repository_read_num_pu(unsigned int *num_pu)
+{
+ int result;
+ u64 v1;
+
+ v1 = 0;
+ result = read_node(PS3_LPAR_ID_CURRENT,
+ make_first_field("bi", 0),
+ make_field("pun", 0),
+ 0, 0,
+ &v1, NULL);
+ *num_pu = v1;
+ return result;
+}
+
+int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id)
+{
+ int result;
+ u64 v1;
+
+ v1 = 0;
+ result = read_node(PS3_LPAR_ID_CURRENT,
+ make_first_field("bi", 0),
+ make_field("pu", pu_index),
+ 0, 0,
+ &v1, NULL);
+ *pu_id = v1;
+ return result;
+}
+
#if defined(DEBUG)
int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
next prev parent reply other threads:[~2008-01-09 6:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-05 3:12 [patch 0/3] PS3 logical performance monitor patches for 2.6.25 Geoff Levand
2008-01-09 6:35 ` [patch 1/4] POWERPC: Add Cell SPRN bookmark register Geoff Levand
2008-01-09 11:55 ` Arnd Bergmann
2008-01-09 6:35 ` Geoff Levand [this message]
2008-01-09 7:15 ` [patch 2/4 v2] PS3: Add logical performance monitor repository routines Stephen Rothwell
2008-01-09 10:01 ` Geert Uytterhoeven
2008-01-09 21:47 ` Stephen Rothwell
2008-01-10 1:01 ` [patch 2/4 v3] " Geoff Levand
2008-01-09 6:35 ` [patch 3/4 v2] PS3: Add logical performance monitor device support Geoff Levand
2008-01-10 1:01 ` [patch 3/4 v3] " Geoff Levand
2008-01-09 6:35 ` [patch 4/4 v2] PS3: Add logical performance monitor driver support Geoff Levand
2008-01-09 10:41 ` Geert Uytterhoeven
2008-01-09 13:20 ` TakashiYamamoto
2008-01-10 1:01 ` [patch 4/4 v3] " Geoff Levand
2008-01-10 9:44 ` Geert Uytterhoeven
2008-01-10 23:39 ` [patch 4/4 v4] " Geoff Levand
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=47846B38.7010409@am.sony.com \
--to=geoffrey.levand@am$(echo .)sony.com \
--cc=TakashiA.Yamamoto@jp$(echo .)sony.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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