LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 01-16-2008, 03:58 AM   #1
karimasif
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Rep: Reputation: 0
Using kernel functions and macros in userspace


Hi

Is there any way to call kernel functions and macros in user space program.

I am writing a simple program and compiling it through gcc, in which I want to calculate the CPU capability in MHz. For this, I want to use the "cpu_has_tsc" macro and barrier() macro. barrier() macro is present in asm/system.h.

Do I need to use the system call to go through this, if yes how?
 
Old 01-16-2008, 11:34 PM   #2
ashok449
Member
 
Registered: Sep 2007
Location: noida
Distribution: suse
Posts: 63

Rep: Reputation: 16
Your right, you need to use system calls.

use function name with correct arguments along with headers and compile with related optimization levels.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing IP options data to kernel from userspace kaushik1 Programming 2 12-26-2007 11:38 PM
Selective ethernet frame forwarding via userspace / kernel space program neur0tic Linux - Networking 5 12-24-2007 03:52 PM
a question about kernel copy userspace data linwenyuan Programming 0 03-28-2007 09:55 AM
How to access 2.6 kernel macros defined under __KERNEL__ someshwar Linux - Kernel 2 10-31-2006 11:36 PM
Jiffies a kernel only entity, or is it allowed in userspace also? pat_and_cami Programming 0 03-10-2006 12:36 AM


All times are GMT -5. The time now is 07:05 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration