Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to use commands like "pci_get_device, pci_resource_start, pci_resource_end,..." to find base address of my IO card. I know pci.h should be included like this: <linux/pci.h>
There's a file with this name in usr/include/linux but the commands are not defined in this header file.
There is also another file with the same name in
usr/src/linux-2.6.../include/linux
the commands are defined in this file.
Could you please tell me how to include this file & all of its dependancies?
I'm using host-target configuration & a software that sends my codes to linux platform then compile them. I don't know exactly what it does but I guess it uses gcc to compile the codes.
I guess I wasn’t clear. Whatever code makes use of <linux/pci.h> is for a kernel module, it will automatically access the appropriate header when use a kernel makefile. If it is userspace code, it will not have access to the appropriate header.
The userspace version of the header is exactly the same as the kernelspace version, except all declarations armored like so
should be removed. In that case, even if you could modify your include path to gcc (e.g., “gcc -I/lib/modules/`uname -r`/build/include”) your code would not be able to use the declarations unless it was kernel code.
I don’t think so. But you can access a lot of information about the PCI bus in /proc and /sys. Also, if you want to do port IO, you can read and write to /dev/port (having used lseek to get the appropriate port number). Here is a short document about doing that.
that is correct. If you don't want to write kernel code, the only information you can get is found in /proc and /sys. Of course, that information is extensive, depending upon the driver that supports the PCI device, but you won't get at the hardware unless you write kernel code.
It seems the alternative method(dev/port) is not suitable for realtime performance, is it?
I think I have to write kernel code, could you please give me some information about it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.