/* i386 paging constants */
#define I386_VM_PRESENT 0x001 /* Page is present */
#define I386_VM_WRITE 0x002 /* Read/write access allowed */
+#define I386_VM_READ 0x000 /* Read access only */
#define I386_VM_USER 0x004 /* User access allowed */
#define I386_VM_PWT 0x008 /* Write through */
#define I386_VM_PCD 0x010 /* Cache disable */
/* Mapping flags. */
#define PTF_WRITE I386_VM_WRITE
+#define PTF_READ I386_VM_READ
#define PTF_PRESENT I386_VM_PRESENT
#define PTF_USER I386_VM_USER
#define PTF_GLOBAL I386_VM_GLOBAL
/* For arch-specific PT routines to check if no bits outside
* the regular flags are set.
*/
-#define PTF_ALLFLAGS (PTF_WRITE|PTF_PRESENT|PTF_USER|PTF_GLOBAL|PTF_NOCACHE)
+#define PTF_ALLFLAGS (PTF_READ|PTF_WRITE|PTF_PRESENT|PTF_USER|PTF_GLOBAL|PTF_NOCACHE)
#if SANITYCHECKS
#define PT_SANE(p) { pt_sanitycheck((p), __FILE__, __LINE__); }
if(WRITABLE(vr, pb))
rw = PTF_WRITE;
else
- rw = 0;
+ rw = PTF_READ;
r = pt_writemap(vmp, &vmp->vm_pt, vr->vaddr + pr->offset,
pb->phys, pb->length, PTF_PRESENT | PTF_USER | rw, WMF_VERIFY);
if(WRITABLE(vr, pb))
rw = PTF_WRITE;
else
- rw = 0;
+ rw = PTF_READ;
if(pt_writemap(vmp, &vmp->vm_pt, vr->vaddr + pr->offset,
pb->phys, pb->length, PTF_PRESENT | PTF_USER | rw,
*/
if(flag > 0)
pt_flag |= PTF_WRITE;
+ else
+ pt_flag |= PTF_READ;
/* Map phys blocks in the source process to the destination process. */
end = offset_d + length;