Skip to contentSkip to conversation

"sparc_cpu_model" undefined

DISCUSSION Murray Stokely 3 participants 6 messages May 19, 2000 – May 21, 2000

lore
Share & tools
lore
#0 lore raw

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?

Thanks,

- Murray

#1 lore raw
Quoted 8 lines · Murray Stokely

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

#2 lore raw
In reply to Murray Stokely
Quoted 6 lines

Date: Fri, 19 May 2000 05:34:37 -0700 (PDT)
From: Murray Stokely <[email protected]>

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

#3 lore raw
In reply to Murray Stokely

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

#4 lore raw
In reply to Murray Stokely
Quoted 7 lines · Murray Stokely

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.

Quoted 5 lines

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.

Quoted 7 lines

% 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

#5 lore raw
In reply to Murray Stokely

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