* Re: "sparc_cpu_model" undefined
2000-05-19 12:34 "sparc_cpu_model" undefined Murray Stokely
@ 2000-05-19 12:49 ` Jakub Jelinek
2000-05-19 15:23 ` Pete Zaitcev
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jakub Jelinek @ 2000-05-19 12:49 UTC (permalink / raw)
To: ultralinux
On Fri, May 19, 2000 at 05:34:37AM -0700, Murray Stokely wrote:
>
> I can't compile any code that includes asm/io.h with Red Hat 6.1, or
> 6.2 on my Ultra5. This includes many useful programs such as 'sane',
> the scanner drivers. The defines are all messed up so that the
> headers can't tell what type of sparc you are compiling for. This
> problem has been reported on this list before but I've never seen a
> solution and can't find any with the search engine. Can someone point
> me in the right direction?
Don't include asm/io.h ever.
sane package Red Hat ships has this fixed (see sane src.rpm in PowerTools).
Jakub
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: "sparc_cpu_model" undefined
2000-05-19 12:34 "sparc_cpu_model" undefined Murray Stokely
2000-05-19 12:49 ` Jakub Jelinek
@ 2000-05-19 15:23 ` Pete Zaitcev
2000-05-20 1:44 ` Murray Stokely
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Pete Zaitcev @ 2000-05-19 15:23 UTC (permalink / raw)
To: ultralinux
> Date: Fri, 19 May 2000 05:34:37 -0700 (PDT)
> From: Murray Stokely <murray@cdrom.com>
> I can't compile any code that includes asm/io.h with Red Hat 6.1, or
> 6.2 on my Ultra5. This includes many useful programs such as 'sane',
> the scanner drivers. [...]
Complain to application maintainers. It is their fault to include
what they are not supposed to include.
Imagine for a second that we make an <asm/io.h> on sparc that
gets included in your program without errors. What makes you think
that inb/outb there may be useful to you, even after ioperm() ?
They easily may happen to be defined as stba/lduba instructions,
or may require port address to be offset.
Programs that resort to direct I/O must carry machine and system
dependent parts with them, including definitions of inb/outb.
If they do not, we cannot help it.
--Pete
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: "sparc_cpu_model" undefined
2000-05-19 12:34 "sparc_cpu_model" undefined Murray Stokely
2000-05-19 12:49 ` Jakub Jelinek
2000-05-19 15:23 ` Pete Zaitcev
@ 2000-05-20 1:44 ` Murray Stokely
2000-05-20 6:05 ` Jakub Jelinek
2000-05-21 21:48 ` Murray Stokely
4 siblings, 0 replies; 6+ messages in thread
From: Murray Stokely @ 2000-05-20 1:44 UTC (permalink / raw)
To: ultralinux
On Fri, 19 May 2000, Pete Zaitcev wrote:
% Imagine for a second that we make an <asm/io.h> on sparc that
% gets included in your program without errors. What makes you think
% that inb/outb there may be useful to you, even after ioperm() ?
% They easily may happen to be defined as stba/lduba instructions,
% or may require port address to be offset.
Ok, so how do I get around these problems to write a few bytes
directly to an IO port. As an example, I would like to write a few
bytes to the parallel port to control a LED or program a
microcontroller. With Linux/x86 I just call ioperm() and then outb().
How do I do this under Linux/sparc?
% Programs that resort to direct I/O must carry machine and system
% dependent parts with them, including definitions of inb/outb.
% If they do not, we cannot help it.
You feel this is always the case? That inb/outb should not be a
function of the OS libraries/headers?
Murray
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: "sparc_cpu_model" undefined
2000-05-19 12:34 "sparc_cpu_model" undefined Murray Stokely
` (2 preceding siblings ...)
2000-05-20 1:44 ` Murray Stokely
@ 2000-05-20 6:05 ` Jakub Jelinek
2000-05-21 21:48 ` Murray Stokely
4 siblings, 0 replies; 6+ messages in thread
From: Jakub Jelinek @ 2000-05-20 6:05 UTC (permalink / raw)
To: ultralinux
On Fri, May 19, 2000 at 06:44:38PM -0700, Murray Stokely wrote:
> On Fri, 19 May 2000, Pete Zaitcev wrote:
> % Imagine for a second that we make an <asm/io.h> on sparc that
> % gets included in your program without errors. What makes you think
> % that inb/outb there may be useful to you, even after ioperm() ?
> % They easily may happen to be defined as stba/lduba instructions,
> % or may require port address to be offset.
>
> Ok, so how do I get around these problems to write a few bytes
> directly to an IO port. As an example, I would like to write a few
> bytes to the parallel port to control a LED or program a
> microcontroller. With Linux/x86 I just call ioperm() and then outb().
> How do I do this under Linux/sparc?
There are __NO I/O PORTS__ on SPARC. Everything is I/O mapped.
>
> % Programs that resort to direct I/O must carry machine and system
> % dependent parts with them, including definitions of inb/outb.
> % If they do not, we cannot help it.
>
> You feel this is always the case? That inb/outb should not be a
> function of the OS libraries/headers?
Yes, that's always the case. You really have to know exactly what kind of
hardware are you accessing and how do you drive it.
Jakub
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: "sparc_cpu_model" undefined
2000-05-19 12:34 "sparc_cpu_model" undefined Murray Stokely
` (3 preceding siblings ...)
2000-05-20 6:05 ` Jakub Jelinek
@ 2000-05-21 21:48 ` Murray Stokely
4 siblings, 0 replies; 6+ messages in thread
From: Murray Stokely @ 2000-05-21 21:48 UTC (permalink / raw)
To: ultralinux
On Sat, 20 May 2000, Jakub Jelinek wrote:
% On Fri, May 19, 2000 at 06:44:38PM -0700, Murray Stokely wrote:
% > On Fri, 19 May 2000, Pete Zaitcev wrote:
% > % Imagine for a second that we make an <asm/io.h> on sparc that
% > % gets included in your program without errors. What makes you think
% > % that inb/outb there may be useful to you, even after ioperm() ?
% > % They easily may happen to be defined as stba/lduba instructions,
% > % or may require port address to be offset.
% >
% > Ok, so how do I get around these problems to write a few bytes
% > directly to an IO port. As an example, I would like to write a few
% > bytes to the parallel port to control a LED or program a
% > microcontroller. With Linux/x86 I just call ioperm() and then outb().
% > How do I do this under Linux/sparc?
%
% There are __NO I/O PORTS__ on SPARC. Everything is I/O mapped.
What address is the parallel port mapped to? What book, example
source, or web site can I read to learn more about IO programming on
Sparcs?
- Murray
^ permalink raw reply [flat|nested] 6+ messages in thread