tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rfc: vmem(9) API/implementation changes

On Wed, Jul 27, 2011 at 04:58:23PM +0000, Eduardo Horvath wrote:
> On Wed, 27 Jul 2011, David Young wrote:
> > There are a couple of changes to the API that I would like to make.
> > First, I don't think that vmem_addr_t 0 should be reserved for error
> > indications (0 == VMEM_ADDR_NULL), but the API should change from
> > this:
> I'd recommend returning -1 on error.  0 is a valid address, but while -1 
> is a valid address, when do you ever use this interface to allocate 
> something that starts at address -1?  And it gets around all the noxious 
> problems involved in returning data through reference parameters.

I tend to agree.
It is probably also worth avoiding allocating address 0 anyway.
What is it address 0 of? The physical address seen on the bus??

I've seen hardware that doesn't like being given address zero!
(IIRC a PCI card in a sun sparc system.)


David Laight:

Home | Main Index | Thread Index | Old Index