diff options
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r-- | sys/cam/cam_periph.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 089c5f0..c787c54 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -560,8 +560,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) } if (dirs[i] & CAM_DIR_OUT) { - flags[i] = B_READ; - if (useracc(*data_ptrs[i], lengths[i], B_READ) == 0){ + flags[i] = B_WRITE; + if (!useracc(*data_ptrs[i], lengths[i], + VM_PROT_READ)) { printf("cam_periph_mapmem: error, " "address %p, length %lu isn't " "user accessible for READ\n", @@ -576,8 +577,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) * is all 0's, and so it is "set" all the time. */ if (dirs[i] & CAM_DIR_IN) { - flags[i] |= B_WRITE; - if (useracc(*data_ptrs[i], lengths[i], B_WRITE) == 0){ + flags[i] |= B_READ; + if (!useracc(*data_ptrs[i], lengths[i], + VM_PROT_WRITE)) { printf("cam_periph_mapmem: error, " "address %p, length %lu isn't " "user accessible for WRITE\n", |