summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authornjames <njames@us.ibm.com>2015-02-16 18:30:06 -0600
committernjames <njames@us.ibm.com>2015-02-16 18:30:06 -0600
commit5e733983fdc6bae4ca8f35f7149f44e92530436e (patch)
tree0afe4e1db63a0903e29dd8eea33e69ab8aeced15 /scripts
parent59190275e9f78961f9991be0a164deb5cb4a8bb3 (diff)
downloadserverwiz-5e733983fdc6bae4ca8f35f7149f44e92530436e.tar.gz
serverwiz-5e733983fdc6bae4ca8f35f7149f44e92530436e.zip
support negative attribute values
Diffstat (limited to 'scripts')
-rw-r--r--scripts/processMrw.pl17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/processMrw.pl b/scripts/processMrw.pl
index 908728d..09f0789 100644
--- a/scripts/processMrw.pl
+++ b/scripts/processMrw.pl
@@ -209,19 +209,30 @@ sub processSystem
$targetObj->setAttribute($target, "MAX_PROC_CHIPS_PER_NODE",
$targetObj->{NUM_PROCS_PER_NODE});
parseBitwise($targetObj,$target,"CDM_POLICIES");
+ convertNegativeNumbers($targetObj,$target,"ADC_CHANNEL_OFFSETS",32);
+}
+
+sub convertNegativeNumbers
+{
+ my $targetObj=shift;
+ my $target=shift;
+ my $attribute=shift;
+ my $numbits=shift;
+
my @offset = split(/\,/,
- $targetObj->getAttribute($target,"ADC_CHANNEL_OFFSETS"));
+ $targetObj->getAttribute($target,$attribute));
for (my $i=0;$i<@offset;$i++)
{
if ($offset[$i]<0)
{
- my $neg_offset = 2**32+$offset[$i];
+ my $neg_offset = 2**$numbits+$offset[$i];
$offset[$i]=sprintf("0x%08X",$neg_offset);
}
}
my $new_offset = join(',',@offset);
- $targetObj->setAttribute($target,"ADC_CHANNEL_OFFSETS",$new_offset)
+ $targetObj->setAttribute($target,$attribute,$new_offset)
}
+
sub processBmc
{
my $targetObj = shift;
OpenPOWER on IntegriCloud