diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-10-30 06:32:05 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-10-30 06:32:05 +0000 |
commit | 02c58685a4354c39fd2387a4b20e00c3f5d26096 (patch) | |
tree | 3c9df194f59066cf56f290cfea6886eefc551a5e /sys/cam | |
parent | 1c6972cf901bc9353c445d55f23bbe92d54e3dfe (diff) | |
download | src-02c58685a4354c39fd2387a4b20e00c3f5d26096.tar.gz src-02c58685a4354c39fd2387a4b20e00c3f5d26096.zip |
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)
Notes
Notes:
svn path=/head/; revision=52644
Diffstat (limited to 'sys/cam')
-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 089c5f095ab4..c787c54034d3 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", |