From 8d8f53dcdc1e1126b75d084478a6ff0d4664f39d Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 30 Oct 1999 06:32:05 +0000 Subject: 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) --- sys/cam/cam_periph.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/cam') 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", -- cgit v1.1