summaryrefslogtreecommitdiffstats
path: root/pcilib/register.c
diff options
context:
space:
mode:
authorzilio nicolas <nicolas.zilio@kit.edu>2015-07-07 14:03:39 +0200
committerzilio nicolas <nicolas.zilio@kit.edu>2015-07-07 14:03:39 +0200
commit5a7bcf11b8e3168900a75e7cbf3b1e18f424d271 (patch)
tree3a7ed810b913ed6a6adf50f78dce57f1c3e5dd7f /pcilib/register.c
parentc4f209458c5caa00f8d67033224458c78c374adc (diff)
downloadpcitool-5a7bcf11b8e3168900a75e7cbf3b1e18f424d271.tar.gz
pcitool-5a7bcf11b8e3168900a75e7cbf3b1e18f424d271.tar.bz2
pcitool-5a7bcf11b8e3168900a75e7cbf3b1e18f424d271.tar.xz
pcitool-5a7bcf11b8e3168900a75e7cbf3b1e18f424d271.zip
some modif
Diffstat (limited to 'pcilib/register.c')
-rw-r--r--pcilib/register.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/pcilib/register.c b/pcilib/register.c
index 347bf7c..5909991 100644
--- a/pcilib/register.c
+++ b/pcilib/register.c
@@ -91,16 +91,22 @@ static int pcilib_read_register_space_internal(pcilib_t *ctx, pcilib_register_ba
for (i = 0; i < n; i++) {
err = bapi->read(ctx, bctx, addr + i * access, buf + i);
+ printf("buf +i: %i \n",buf[i]);
+ if(err) printf("err internal 1: %i\n",err);
if (err) break;
}
if ((bits > 0)&&(!err)) {
pcilib_register_value_t val = 0;
err = bapi->read(ctx, bctx, addr + n * access, &val);
-
+
val = (val >> offset)&BIT_MASK(bits);
+ printf("val : %i\n",val);
memcpy(buf + n, &val, sizeof(pcilib_register_value_t));
+ if(err) printf("err internal 2: %i\n",err);
}
+ printf("err internal 3: %i\n",err);
+ printf("buf internal: %i\n",buf[0]);
return err;
}
@@ -143,14 +149,18 @@ int pcilib_read_register_by_id(pcilib_t *ctx, pcilib_register_t reg, pcilib_regi
pcilib_error("Big-endian byte order support is not implemented");
return PCILIB_ERROR_NOTSUPPORTED;
} else {
+ printf("bits: %i, n %lu\n",bits, n);
res = 0;
if (bits) ++n;
for (i = 0; i < n; i++) {
+ printf("res: %i buf[i]: %i\n",res,buf[i]);
res |= buf[i] << (i * b->access);
+ printf("res: %i \n",res);
}
}
*value = res;
+ printf("value : %i\n",*value);
return err;
}