Hi, David.

Does this patch fix the problem I mentioned in my previous emails "
uClinux supports shared memory IPC"?

But the definition of shm_mmap() in my uClinux version (kernel
2.6.17.7-uc1) is like the following:

static int shm_mmap(struct file * file, struct vm_area_struct * vma)
{
        int ret;

        ret = shmem_mmap(file, vma);
        if (ret == 0) {
                vma->vm_ops = &shm_vm_ops;
                if (!(vma->vm_flags & VM_WRITE))
                        vma->vm_flags &= ~VM_MAYWRITE;
                shm_inc(file->f_dentry->d_inode->i_ino);
        }

        return ret;
}

It's different from yours. How to patch it then?

Thanks,

Allen

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Howells
Sent: Thursday, July 26, 2007 3:06 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [email protected]
Subject: [uClinux-dev] [PATCH] NOMMU: Fix SYSV IPC SHM

From: David Howells <[EMAIL PROTECTED]>

Fix the SYSV IPC SHM to work with the changes applied by the new fault
handler
patches when CONFIG_MMU=n.

Signed-off-by: David Howells <[EMAIL PROTECTED]>
---

 fs/ramfs/file-nommu.c |    7 ++++++-
 ipc/shm.c             |    2 ++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index cad2b7a..237fe8b 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -295,5 +295,10 @@ unsigned long ramfs_nommu_get_unmapped_area(struct
file *file,
  */
 int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma)
 {
-       return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS;
+       if (!(vma->vm_flags & VM_SHARED))
+               return -ENOSYS;
+
+       file_accessed(file);
+       vma->vm_ops = &generic_file_vm_ops;
+       return 0;
 }
diff --git a/ipc/shm.c b/ipc/shm.c
index d0259e3..d88ac5a 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -268,7 +268,9 @@ static int shm_mmap(struct file * file, struct
vm_area_struct * vma)
        if (ret != 0)
                return ret;
        sfd->vm_ops = vma->vm_ops;
+#ifdef CONFIG_MMU
        BUG_ON(!sfd->vm_ops->fault);
+#endif
        vma->vm_ops = &shm_vm_ops;
        shm_open(vma);
 

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev





The information contained in this email and attachments to this email are the 
proprietary and confidential property 
of Nucomm, Inc.  The information is provided in strict confidence and shall not 
be reproduced, copied, or
used (partially or wholly) in any manner without prior, express written 
authorization of Nucomm, Inc.

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to