Date: Tue, 23 Jan 96 22:31:55 MET From: marino.ladavac@aut.alcatel.at To: james@miller.cs.uwm.edu (Jim Lowe) Cc: hackers@freebsd.org Subject: Re: Amancio's tv program with capture! Message-ID: <9601232131.AA07374@atuhc16.atusks01.aut.alcatel.at> In-Reply-To: <199601232053.OAA14413@miller.cs.uwm.edu>; from "Jim Lowe" at Jan 23, 96 2:53 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> > > How does one mark the driver/mmapped memory as shared memory
> > > with the current utilities? It isn't real obvious that one can
> > > actually do this without modifiying the shmat system call (or at
> > > least to me).
> >
> >
> > int fd;
> > caddr_t mapaddr;
> >
> > if( ( fd = open( DEV_NAME, O_RDWR)) == -1) {
> > perror( "open");
> > exit( 1);
> > }
> >
> > mapaddr = mmap( 0, /* map here, 0 = don't care*/
> > DEV_MEM_SIZE, /* device memory window*/
> > PROT_READ|PROT_WRITE, /* will be reading/writing*/
> > MAP_HASSEMAPHORE, /* (?) prevent caching*/
> > fd, /* fd for device*/
> > (off_t)0 /* full window*/
> > );
> >
> I know how to mmap. The question is once you have mapaddr how does
> one attach that to X's shared memory functions through the Xshm
> utilities? I don't beleive I have ever head of map_hassemaphore...
Is it possible to mmap() something to the address returned by shmat()?
Something like:
shmaddr = shmat( shmid, NULL, 0 );
mapaddr = mmap( shmaddr, ... );
I haven't got a slightest clue about this approach.
/Alby
> -Jim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9601232131.AA07374>
