niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » embedded
ARM11 and flushing cashes in a driver
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
fsl_user
*nix forums beginner


Joined: 07 Oct 2005
Posts: 3

PostPosted: Fri May 12, 2006 4:23 pm    Post subject: ARM11 and flushing cashes in a driver Reply with quote

Hi,

I'm having a driver, which wants to use and share some physical memory
with an application.

1.) What I implemented:
the mmap-implementation of my driver returns a virtual address for a
physical adress known by the driver (cacheable and bufferable) to the
application.

2.) The application may read / write modify the buffer.

3.) at a later moment the driver wants to be sure, that the buffer is
entirely flushed before doing his work.

What function call do I have to do?

More info:

- Linux: 2.6.10
- Processor: ARM11
- driver knows physical address and the virtual address given to the
application
- buffer is cachaeble and bufferable



DRIVER CODE
==========================================
The mmap function without error checking:
my_mmap(struct file *file, struct vm_area_struct *vma)
{
struct my_device *dev = file->private_data;
unsigned long start = vma->vm_start;
unsigned long size = vma->vm_end - vma->vm_start;
vout_data *vout = video_get_drvdata(dev);

pgprot_t my_prot;
my_prot= pgprot_noncached(PAGE_SHARED);
if (remap_pfn_range(vma, start, vma->vm_pgoff, size, my_prot));
return 0;
}


APPLICATION CODE
=====================================================
the application code (pseudo code):


int fd= open(dev_name);
char *buf = mmap (NULL, length,
PROT_READ | PROT_WRITE, MAP_SHARED,
fd, offset);

dosomething_with(buf);

// following ioctl cannot be split
ioctl(fd, DO_SOMETHING_FLUSH_AND_DO_SOMETHING_MORE, param);




thanks for any help



nsp
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 5:18 pm | All times are GMT
navigation Forum index » *nix » Linux » embedded
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Correct use of OCI driver proxy authentication with WebSp... eugene_boulis@hotmail.com Oracle 0 Tue Jul 18, 2006 7:35 pm
No new posts CUPS for Tru64 and printer driver for Toshiba eSTUDIO351c A. Mahendra Rajah Tru64 managers mail-list 0 Mon Jul 17, 2006 5:12 pm
No new posts flushing packets in Apache 2.2 Arjun Datta Apache 3 Thu Jul 13, 2006 7:15 pm
No new posts x freeze with ATI driver and openoffice. wehn Debian 1 Thu Jul 13, 2006 3:30 pm
No new posts sd Driver problem r.a.reissaus@risdi.com Suse 1 Sun Jul 09, 2006 4:38 pm

Looking for Credit Cards? | Arab Girl | Debt Consolidation | Credit Reports | Internet Advertising
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1435s ][ Queries: 16 (0.0800s) ][ GZIP on - Debug on ]