linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Eddie Dawydiuk <eddie@embeddedarm.com>
To: linuxppc-dev@ozlabs.org, Grant Likely <grant.likely@secretlab.ca>
Subject: PowerPC iotable_init equivalent?
Date: Fri, 17 Apr 2009 14:21:27 -0700	[thread overview]
Message-ID: <49E8F2D7.3050603@embeddedarm.com> (raw)

Hello,

In the past I've worked with ARM architectures where I could setup virtual / 
physical address mappings so I don't have to ioremap then pass around pointers. 
Does PowerPC have an equivalent abstraction? If not whats the recommended approach?

That is, is there a better approach to the following...

volatile static unsigned char *my_reg = NULL;

static inline void read_func() {

	if (!my_reg)
         	my_reg = (unsigned char *)
			ioremap(REG_PHYS_BASE, REG_SIZE);
//do something with the reg
}


static inline void write_func() {

	if (!my_reg)
         	my_reg = (unsigned char *)
			ioremap(REG_PHYS_BASE, REG_SIZE);
//do something with the reg
}

-- 
Best Regards,
________________________________________________________________
  Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
  16525 East Laser Drive 	     | fax:    (480) 837-5300
  Fountain Hills, AZ 85268            | web: www.embeddedARM.com

             reply	other threads:[~2009-04-17 21:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 21:21 Eddie Dawydiuk [this message]
2009-04-17 21:31 ` PowerPC iotable_init equivalent? Roderick Colenbrander
2009-04-17 21:32 ` Kumar Gala
2009-04-18  5:42 ` Grant Likely

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=49E8F2D7.3050603@embeddedarm.com \
    --to=eddie@embeddedarm.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@ozlabs.org \
    /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).