On Thu, 13 Sep 2001, Warner Losh wrote:

> In message <[EMAIL PROTECTED]> Julian Elischer writes:
> : All looks good.. obviously the logic of what was going on was easy
> : enough to pick up :-)
> :
> : the only bit I didn't see so easily was:
> : ...
> : @@ -2860,7 +2861,7 @@
> :         /*
> :          * keep the process from being swapped
> :          */
> : -       PHOLD(p);
> : +       PROC_LOCK(p);
> :         bzero((void *)bp, sizeof(*bp));
> :         bp->bio_cmd = BIO_FORMAT;
> : ...
> : the replacement of PHOLD with PROC_LOCK().. I'm not sure of what this actualy
> : means..

This means that this version of fd.c has been broken :-).

> Since I don't know what either PHOLD or PROC_LOCK are, I don't know if
> I did this right.  Maybe it is bogus.

PHOLD() used to hold the user pages in core while the process waited for
i/o to complete.  The pc98 version of fd.c is rather out of date, so it
still rather bogusly does DMA from the address where sys_generic.c:ioctl()
copied the user data.  This address may be on the kernel stack, so the
driver needs to lock down the user pages until the DMA completes.  I'm
not sure if PROC_LOCK() does this accidentally.  It gives a lock that is
too strong in most ways.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to