linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Where are inb/outb macros?
@ 2007-10-06 20:47 Peter Lemenkov
  2007-10-06 21:08 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Lemenkov @ 2007-10-06 20:47 UTC (permalink / raw)
  To: linuxppc-dev

Hello All!
I can't compile one small software title because of lack <sys/io.h>
and inb/outb macros. What sould I do to overcome this obstacle?

My linux distro is Fedora 7 if it is matter.

-- 
With best regards!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Where are inb/outb macros?
  2007-10-06 20:47 Where are inb/outb macros? Peter Lemenkov
@ 2007-10-06 21:08 ` Benjamin Herrenschmidt
  2007-10-06 23:46   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-10-06 21:08 UTC (permalink / raw)
  To: Peter Lemenkov; +Cc: linuxppc-dev


On Sun, 2007-10-07 at 00:47 +0400, Peter Lemenkov wrote:
> Hello All!
> I can't compile one small software title because of lack <sys/io.h>
> and inb/outb macros. What sould I do to overcome this obstacle?
> 
> My linux distro is Fedora 7 if it is matter.

They don't exist in user space on non-x86. You have to do things
differently. What is your software trying to do ? If it's trying to
access a PCI device IO space, you probably want to mmap it in sysfs and
write your own accessors with appropriate memory barriers.

Ben

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Where are inb/outb macros?
  2007-10-06 21:08 ` Benjamin Herrenschmidt
@ 2007-10-06 23:46   ` Arnd Bergmann
  2007-10-08  6:05     ` Misbah khan
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2007-10-06 23:46 UTC (permalink / raw)
  To: linuxppc-dev, benh

On Saturday 06 October 2007, Benjamin Herrenschmidt wrote:
> On Sun, 2007-10-07 at 00:47 +0400, Peter Lemenkov wrote:
> > Hello All!
> > I can't compile one small software title because of lack <sys/io.h>
> > and inb/outb macros. What sould I do to overcome this obstacle?
> > 
> > My linux distro is Fedora 7 if it is matter.
> 
> They don't exist in user space on non-x86. You have to do things
> differently. What is your software trying to do ? If it's trying to
> access a PCI device IO space, you probably want to mmap it in sysfs and
> write your own accessors with appropriate memory barriers.

All cases where I've seen application software use <sys/io.h>, there was
actually a full device driver in the kernel that already exported a 
high-level interface to user space. If that's the case here, the application
should use that instead of sysfs.

	Arnd <><

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Where are inb/outb macros?
  2007-10-06 23:46   ` Arnd Bergmann
@ 2007-10-08  6:05     ` Misbah khan
  2007-10-08  8:11       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Misbah khan @ 2007-10-08  6:05 UTC (permalink / raw)
  To: linuxppc-dev


inb/outb could be used from the usr space on x86 class PC-computer to access
to io ports this is what i assume that you are trying 

You need to compile the program with -O option (expantion of Inline function
)

To perform io operation on ports ioprem/iopl system call must be used (To
get permissio to perform io operation)

Program must run as root 

on non 86 platform try using /dev/port device file in the application 

misbah


Arnd Bergmann wrote:
> 
> On Saturday 06 October 2007, Benjamin Herrenschmidt wrote:
>> On Sun, 2007-10-07 at 00:47 +0400, Peter Lemenkov wrote:
>> > Hello All!
>> > I can't compile one small software title because of lack <sys/io.h>
>> > and inb/outb macros. What sould I do to overcome this obstacle?
>> > 
>> > My linux distro is Fedora 7 if it is matter.
>> 
>> They don't exist in user space on non-x86. You have to do things
>> differently. What is your software trying to do ? If it's trying to
>> access a PCI device IO space, you probably want to mmap it in sysfs and
>> write your own accessors with appropriate memory barriers.
> 
> All cases where I've seen application software use <sys/io.h>, there was
> actually a full device driver in the kernel that already exported a 
> high-level interface to user space. If that's the case here, the
> application
> should use that instead of sysfs.
> 
> 	Arnd <><
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/Where-are-inb-outb-macros--tf4581135.html#a13091078
Sent from the linuxppc-dev mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Where are inb/outb macros?
  2007-10-08  6:05     ` Misbah khan
@ 2007-10-08  8:11       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-10-08  8:11 UTC (permalink / raw)
  To: Misbah khan; +Cc: linuxppc-dev


On Mon, 2007-10-08 at 00:09 -0700, Misbah khan wrote:
> inb/outb could be used from the usr space on x86 class PC-computer to access
> to io ports this is what i assume that you are trying 
> 
> You need to compile the program with -O option (expantion of Inline function
> )
> 
> To perform io operation on ports ioprem/iopl system call must be used (To
> get permissio to perform io operation)
> 
> Program must run as root 
> 
> on non 86 platform try using /dev/port device file in the application 

"io ports" don't mean much on non-x86 platforms (or rather can have
multiple meanings) which is why I'm asking what is he trying to od in
the first place.

Ben.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-08  8:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-06 20:47 Where are inb/outb macros? Peter Lemenkov
2007-10-06 21:08 ` Benjamin Herrenschmidt
2007-10-06 23:46   ` Arnd Bergmann
2007-10-08  6:05     ` Misbah khan
2007-10-08  8:11       ` Benjamin Herrenschmidt

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).