9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: blstuart@bellsouth.net, 9fans@9fans.net
Subject: Re: [9fans] The late upamalloc
Date: Sat, 27 Sep 2008 12:02:53 -0400	[thread overview]
Message-ID: <06f018ade84c82f7491574c48e885f14@quanstro.net> (raw)

> Okay, I've been taking a crack at the broadcom driver
> that's been lying around.  It's pretty old and used
> the upamalloc call.  But upamalloc is now gone and
> I don't seem to be able to find the right way to
> replace it.  After looking at other drivers and at
> the old upamalloc code on sourcesdump, I've tried
> several way to replace it, but most end up in a panic.
> The original code (edited to the relevant lines)
> looked like:
>
> port = upamalloc(bar & ~0x0F, p->mem[0].size, 0);
> ctlr->port = port;
> ctlr->nic = KADDR(ctlr->port);
>
> My most recent attempt replaced the upamalloc call
> with:
>
> upareserve(bar & ~0x0F, p->mem[0].size);
> pdbmap(MACH(0)->pdb, bar & ~0x0F, 0, p->mem[0].size);
> port = bar & ~0x0F;
>
> There is currently a upaalloc call, and the comment
> to it seems to imply that vmap should be used either
> in conjunction with upaalloc or by it self.  I've
> tried a few permutations of that with no luck.
>
> If someone knows off the top of their head the right
> way to replace an old upamalloc call, it would save
> me some time, and I could get on to seeing if I can
> manage to get the controller to work.
>

upamalloc should be replaced with vmap.  but be careful.
the address returned is a virtual kernel address.  so anyone
assuming that the address returned is going to be a physical
address is going to loose.  i think you wish

	ctlr->nic = vmap(p->mem[Abar].bar & ~0xf, p->mem[0].size);
	ctlr->port = PCIWADDR(ctlr->nic);

- erik



             reply	other threads:[~2008-09-27 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-27 16:02 erik quanstrom [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-09-27 15:43 Brian L. Stuart
2008-09-27 16:03 ` erik quanstrom
2008-09-27 19:50 ` Uriel
2008-09-29 14:37   ` Brian L. Stuart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06f018ade84c82f7491574c48e885f14@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    --cc=blstuart@bellsouth.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).