From d102915727427d29b3df5e22f64d18af1b3cabe0 Mon Sep 17 00:00:00 2001 From: hadaq Date: Sun, 26 Aug 2012 21:02:33 +0000 Subject: [PATCH] trb_set_address works like this on 64-bit perl, mt --- libtrbnet_perl/TrbNet.xs | 4 +++- libtrbnet_perl/lib/HADES/TrbNet.pm | 1 + libtrbnet_perl/test/test.pl | 18 ++++++++++++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libtrbnet_perl/TrbNet.xs b/libtrbnet_perl/TrbNet.xs index 5873cbc..ac6643e 100644 --- a/libtrbnet_perl/TrbNet.xs +++ b/libtrbnet_perl/TrbNet.xs @@ -216,7 +216,7 @@ trb_register_modify(trb_address, reg_address, mode, bitMask, bitValue) void trb_set_address(uid, endpoint, trb_address) - U32 uid + unsigned long uid U8 endpoint U16 trb_address INIT: @@ -229,3 +229,5 @@ trb_set_address(uid, endpoint, trb_address) } else { XPUSHs(sv_2mortal(newSVuv(1))); } + + diff --git a/libtrbnet_perl/lib/HADES/TrbNet.pm b/libtrbnet_perl/lib/HADES/TrbNet.pm index 387f984..4272330 100644 --- a/libtrbnet_perl/lib/HADES/TrbNet.pm +++ b/libtrbnet_perl/lib/HADES/TrbNet.pm @@ -36,6 +36,7 @@ our %EXPORT_TAGS = ( 'all' => [ qw( trb_nettrace trb_nettrace_c trb_setbit + trb_set_address trb_clearbit ) ] ); diff --git a/libtrbnet_perl/test/test.pl b/libtrbnet_perl/test/test.pl index 55671db..073b62d 100755 --- a/libtrbnet_perl/test/test.pl +++ b/libtrbnet_perl/test/test.pl @@ -20,7 +20,7 @@ foreach my $uid (sort {$a <=> $b } keys %$ref) { } # Read all UIDs as array -@array = trb_read_uid_c(0xfffb) or die "trb_read_uid: ", trb_strerror(); +@array = trb_read_uid_c(0xffff) or die "trb_read_uid: ", trb_strerror(); #print Dumper $ref; foreach my $cur_key (@array) { printf "0x%08x\n", $cur_key; @@ -28,7 +28,7 @@ foreach my $cur_key (@array) { # Read ADCM's by mem -$ref = trb_register_read(0xfffb, 0xa000) +$ref = trb_register_read(0xfffe, 0x1) or die "Failed trb_register_read: ", trb_strerror(); foreach my $cur_key (sort {$a <=> $b } keys %$ref) { @@ -40,7 +40,7 @@ foreach my $cur_key (sort {$a <=> $b } keys %$ref) { # Read all UIDs as array -@array = trb_register_read_mem_c(0xfffb, 0xa000, 1, 10) or die "trb_register_read_mem_c: ", trb_strerror(); +@array = trb_register_read_mem_c(0xfffe, 0x4000, 1, 4) or die "trb_register_read_mem_c: ", trb_strerror(); foreach my $cur_key (@array) { printf "0x%08x\n", $cur_key; @@ -48,7 +48,7 @@ foreach my $cur_key (@array) { # Read read mem test -$ref = trb_register_read_mem(0xfffb, 0xa000, 0, 10) or die "trb_register_read_mem: ", trb_strerror(); +$ref = trb_register_read_mem(0xfffe, 0x4000, 0, 4) or die "trb_register_read_mem: ", trb_strerror(); #print Dumper $ref; printf "\n\n\n"; print "Hash content\n"; @@ -61,5 +61,15 @@ foreach my $k (keys %$ref) { print "\n"; } + +#0x2b00000270d5b328 + +print "test trb_set_address\n"; + +#no warnings 'portable'; +$ref = trb_set_address(0x2b00000270d5b328, 0x2, 0x5); +print Dumper $ref; + + exit; -- 2.43.0