From: David Monro <davidm@amberdata.demon.co.uk>
To: Linux/ppc Dev List <linuxppc-dev@lists.linuxppc.org>
Subject: userland port io - how do we do it on PReP?
Date: Mon, 06 Mar 2000 06:55:10 +0000 [thread overview]
Message-ID: <38C3564E.4A46F577@amberdata.demon.co.uk> (raw)
Hi,
Hope this isn't an FAQ.
I've struck a problem in the X server world - I can't seem to get port
IO (ie inb()) to work.
There are two problems - one is that there doesn't seem to be an
equivalent to ioperm() or iopl() to enable access to the IO ports.
Second is that for MBX and APUS machines the offset to the io port space
appear to be constants, but for other systems we seem to have an
external variables isa_io_base, isa_mem_base and pci_dram_offset. Does
that really mean that programs which do port IO on these systems must
declare and initialize these varibles before doing port IO? And that
MBX, APUS and other systems need different binaries as a result? And
that if /usr/include/linux/autoconfig.h doesn't match the target system
bad things will happen?
The following program doesn't work on my IBM 850:
#include <stdio.h>
#include <asm/io.h>
unsigned long isa_io_base = PREP_ISA_IO_BASE;
main()
{
int x;
x = inb(0x3CC);
printf("x = 0x%02x\n");
}
It just dumps core.
Help?
Cheers,
David
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2000-03-06 6:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-06 6:55 David Monro [this message]
2000-03-06 7:25 ` userland port io - how do we do it on PReP? Geert Uytterhoeven
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=38C3564E.4A46F577@amberdata.demon.co.uk \
--to=davidm@amberdata.demon.co.uk \
--cc=linuxppc-dev@lists.linuxppc.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).