+2004-09-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * sysv_shm.cc (vm_object_reference): remove Cygwin specific define.
+ (vm_map_find): Ditto.
+ (vm_map_inherit): Ditto.
+ (kern_shmat): On Cygwin, take shmaddr just as is. Don't call vm
+ system calls on Cygwin. Add comment.
+
2004-09-15 Corinna Vinschen <corinna@vinschen.de>
Fix copyright throughout.
#define vm_object_clear_flag(a,b)
#define vm_object_set_flag(a,b)
#define VM_OBJECT_UNLOCK(a)
-#define vm_object_reference(a)
#define vm_map_remove(a,b,c) KERN_SUCCESS
-#define vm_map_find(a,b,c,d,e,f,g,h,i) KERN_SUCCESS
-#define vm_map_inherit(a,b,c,d)
typedef int vm_prot_t;
#endif /* __CYGWIN__ */
prot |= VM_PROT_WRITE;
flags = MAP_ANON | MAP_SHARED;
debug_printf ("shmaddr: %x, shmflg: %x", shmaddr, shmflg);
+#ifdef __CYGWIN__
+ /* The alignment checks have already been made in the Cygwin DLL
+ and shmat's only job is to keep record of the attached mem.
+ These checks break shm on 9x since MapViewOfFileEx apparently
+ returns memory which isn't aligned to SHMLBA. Go figure! */
+ attach_va = (vm_offset_t)shmaddr;
+#else
if (shmaddr) {
flags |= MAP_FIXED;
if (shmflg & SHM_RND) {
} else if (((vm_offset_t)shmaddr & (SHMLBA-1)) == 0) {
attach_va = (vm_offset_t)shmaddr;
} else {
- debug_printf ("Odd shmaddr: EINVAL");
error = EINVAL;
goto done2;
}
* This is just a hint to vm_map_find() about where to
* put it.
*/
-#ifdef __CYGWIN__
- attach_va = 0;
-#else
attach_va = round_page((vm_offset_t)p->p_vmspace->vm_taddr
+ maxtsiz + maxdsiz);
-#endif
}
shm_handle = shmseg->shm_internal;
}
vm_map_inherit(&p->p_vmspace->vm_map,
attach_va, attach_va + size, VM_INHERIT_SHARE);
+#endif
shmmap_s->va = attach_va;
shmmap_s->shmid = shmid;