diff options
author | phk <phk@FreeBSD.org> | 1999-10-30 06:32:05 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-10-30 06:32:05 +0000 |
commit | 8d8f53dcdc1e1126b75d084478a6ff0d4664f39d (patch) | |
tree | 3c9df194f59066cf56f290cfea6886eefc551a5e /sys/cam/cam_periph.c | |
parent | ad79c6009cc16320a9a1ee513845cb84a567ec52 (diff) | |
download | FreeBSD-src-8d8f53dcdc1e1126b75d084478a6ff0d4664f39d.zip FreeBSD-src-8d8f53dcdc1e1126b75d084478a6ff0d4664f39d.tar.gz |
Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for the
"rw" argument, rather than hijacking B_{READ|WRITE}.
Fix two bugs (physio & cam) resulting by the confusion caused by this.
Submitted by: Tor.Egge@fast.no
Reviewed by: alc, ken (partly)
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", |