From: Nat Ersoz <nat.ersoz@myrio.com>
To: Maharajan Veerabag <maha_prog@yahoo.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: inb outb in C ...
Date: Tue, 10 Jun 2003 14:07:15 -0700 [thread overview]
Message-ID: <3EE64883.9090509@myrio.com> (raw)
In-Reply-To: <20030605152609.43655.qmail@web21507.mail.yahoo.com>
See chapter 16 of "PCI System Architecture" Mindshare, Inc.
For x86 and PowerPC, configuration utilizes 2 32 bit I/O ports located
at 0x0cf8 (address config) and 0x0cfc (data config):
To access a PCI function's config port:
1. Write the target bus number, physical device number, function number,
... to the configuration address port (0x0cf8).
2. Read or Write the I/O port data (0x0cfc)
Make note that these I/O ports are 32 bits wide (really groups of 4 bit
ports, organized as little endian).
Anyway, I don't feel like typing the book's chapter, nor would Mindshare
appreciated it. You could use the 0x0cf8 as an aid to searching the web...
Also, you can get ALSA driver code from the national developer's site
(http://wwwd.national.com/national/developer.nsf/home/welcome.htm) which
is an example of PCI configuration without calling the linux PCI config
functions (and it is ugly).
Also, take a look at the following kernel files:
linux/include/asm-x86_64/pci-direct.h
./arch/x86_64/kernel/pci-pc.c
./arch/i386/kernel/pci-pc.c
Among others...
Nat
Maharajan Veerabag wrote:
>Hi all,
> i am in the process of writing a linux device driver
>in C. is it possible to access the pci local I/O
>address space with inb,outb instructions... directly
>or is any request of space is required. What is the
>exact power of the inb family of instructions..
> can somebody explain this.
>thank you.
>
>regards,
>Maharajan Veerabag.
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>http://calendar.yahoo.com
>-
>To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
_________________________________________
Nat Ersoz nat.ersoz@myrio.com -o)
Myrio Corporation Phone: 425.897.7278 /\\
3500 Carillon Point Cell: 425.417.5182 _\_V
Kirkland, WA 98033 Fax: 425.897.5600
prev parent reply other threads:[~2003-06-10 21:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-05 15:26 inb outb in C Maharajan Veerabag
2003-06-10 21:07 ` Nat Ersoz [this message]
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=3EE64883.9090509@myrio.com \
--to=nat.ersoz@myrio.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=maha_prog@yahoo.com \
/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).