tech-kern archive

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

Re: kernel panic with new pseudo device

On Thu, 21 May 2009, matthew sporleder wrote:

> A rough cut of my code is here:
> Can anyone offer some hints?  I'm a little stuck.

You say its a pseudo-device?

If so, then AFAIK the 'screenblankenvattach' function will be called at
boot time with a single 'int count' argument.

> CFATTACH_DECL_NEW(screenblankenv, sizeof(struct screenblankenv_softc),
>       NULL, screenblankenvattach, NULL, NULL);

it is usual for autoconf functions to use a pseudo_attach, pseudo_detach
etc naming scheme, which also keeps them apart from the pseudoattach

perhaps it is this line causing the panic..?

screenblankenvattach(struct device *parent, struct device *self, void *aux)
        aprint_normal("attaching screenblankenv\n");
        struct screenblankenv_softc *sc = device_private(self);

since that function is being called with no 'self' argument and you are
instead grobbling one off the stack.

Thats my guess anyway. Look at another pseudo device to see what it does -
dev/bluetooth/btuart.c is one such, I imagine the documentation is out of


Home | Main Index | Thread Index | Old Index