Home > error asm bitops h > error asm/bitops.h

Error Asm/bitops.h

1 /* 2 * Copyright 1995, Russell King. 3 * Various bits and pieces copyrights include: 4 * Linus Torvalds (test_bit). 5 * Big endian support: Copyright 2001, Nicolas Pitre 6 * reworked by rmk. 7 * 8 * bit 0 is the LSB of an "unsigned long" quantity. 9 * 10 * Please note that the code in this file should never be included 11 * from user space. Many of these are not implemented in assembler 12 * since they would be too costly. Also, they require privileged 13 * instructions (which are not available from user mode) to ensure 14 * that they are atomic. 15 */ 16 17 #ifndef __ASM_ARM_BITOPS_H 18 #define __ASM_ARM_BITOPS_H 19 20 #ifdef __KERNEL__ 21 22 #ifndef _LINUX_BITOPS_H 23 #error only can be included directly 24 #endif 25 26 #include 27 #include 28 #include 29 30 /* 31 * These functions are the basis of our bit ops. 32 * 33 * First, the atomic bitops. These use native endian. 34 */ 35 static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p) 36 { 37 unsigned long flags; 38 unsigned long mask = BIT_MASK(bit); 39 40 p += BIT_WORD(bit); 41 42 raw_local_irq_save(flags); 43 *p |= mask; 44 raw_local_irq_restore(flags); 45 } 46 47 static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p) 48 { 49 unsigned long flags; 50 unsigned long mask = BIT_MASK(bit); 51 52 p += BIT_WORD(bit); 53 54 raw_local_irq_save(flags); 55 *p &= ~mask; 56 raw_local_irq_restore(flags); 57 } 58 59 static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p) 60 { 61 unsigned long flags; 62 unsigned long mask = BIT_MASK(bit); 63 64 p += BIT_WORD(bit); 65 66 raw_local_irq_save(flags); 67 *p ^= mask; 68 raw_local_irq_restore(flags); 69 } 70 71 static inline int 72 ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p) 73 { 74 unsigned long flags; 75 unsigned int res; 76 unsigned long mask = BIT_MASK(bit); 77 78 p += BIT_WORD(bit); 79 80 raw_local_irq_save(flags); 81 res = *p; 82 *p = res | mask; 83 raw_local_irq_restore(flags); 84 85 return (res & mask) != 0; 86 } 87 88 static inline int 89 ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p) 90 { 91 unsigned long flags; 92 unsigned int res; 93 unsigned long mask = BIT_MASK(bit); 94 95

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up http://lxr.free-electrons.com/source/arch/arm/include/asm/bitops.h How to include kernel headers in a program up vote 0 down vote favorite 1 I am writing a libnetfilter_queue program. I am new to linux kernel programming. I need to include linux/skbuff.h, net/checksum.h and many related kernel headers which are not present in /usr/include/linux. I get following error on compilation fatal error: linux/skbuff.h: No such file or directory fatal error: net/checksum.h: No http://stackoverflow.com/questions/12898107/how-to-include-kernel-headers-in-a-program such file or directory c linux network-programming linux-kernel header-files share|improve this question edited Oct 15 '12 at 16:46 asked Oct 15 '12 at 14:45 adnan kamili 2,44211341 I guess if you installed them, a -I/usr/include/linux should work... How did you installed your kernel's headers? –shkschneider Oct 15 '12 at 14:47 i use ubuntu 12.04, the following package is already installed linux-headers-3.2.0-32 –adnan kamili Oct 15 '12 at 14:50 You probably only need the kernel headers if you are compiling a kernel module; in that case your module & kernel specific makefile should deal with that. –Basile Starynkevitch Oct 15 '12 at 17:05 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted try this find / -name skbuff.h 2>/dev/null then when it finds the location use the -I/path/to/folder when you compile your program.. If it doesn't find the header you don't have it! share|improve this answer answered Oct 15 '12 at 14:48 pyCthon 3,06473274 find /usr [...] should be enough ^^ –shkschneider Oct 15 '12 at 14:51 I added the path /usr/src/linux-headers

instructions: Windows Mac Red Hat Linux Ubuntu Click URL instructions: Right-click on ad, choose "Copy Link", then paste here → (This may not be possible with some types of ads) More information about https://sourceforge.net/p/sd4l/mailman/message/28265035/ our ad policies X You seem to have CSS turned off. Please don't fill out this field. You seem to have CSS turned off. Please don't fill out this field. Briefly describe the http://forum.ubuntu-it.org/viewtopic.php?t=470899 problem (required): Upload screenshot of ad (required): Select a file, or drag & drop file here. ✔ ✘ Please provide the ad click URL, if possible: Home Browse ScramDisk 4 Linux Mailing Lists error asm/bitops.h ScramDisk 4 Linux Brought to you by: argonavis, huj Summary Files Reviews Support Wiki Mailing Lists Tickets ▾ Bugs Support Requests Feature Requests News Code sd4l-announce sd4l-devel sd4l-user Re: [SD4L-user] Compiling on kernel 3.0.0.12 Re: [SD4L-user] Compiling on kernel 3.0.0.12 From: Jonathan Coles - 2011-10-22 12:16:32 Ulrich, The find command found nothing. But I do have many different files named bitops.h in the /usr/src/linux-headers-3.0.0-12 directories error asm/bitops.h on my system. Looking at the Makefile, I can't see what to change. There is no path specified to /lib/modules that I can change to /usr/src/linux-headers. Is there some other file where this is specified? I need another clue or two. Thanks. On 11-10-20 03:52 PM, Hans-Ulrich Juettner wrote: > Hi Jonathan, > > I'm sorry, I haven't tried to compile SD4l on Ubuntu 11.10 or > with a 3.0 kernel. As I have no time to do so in the near > future I can only guess that asm/bitops.h must also be found > in the kernel headers package. Try the command > > find /lib/modules/3.0.0-12-generic -name bitops.h > > May bee the Makefile has to be adjusted for compiling SD4L > with a 3.0 kernel so that the asm/bitops.h will be found. > And may bee there are other issues with the Makefile and > the new kernel numbering scheme. > > Best regards > Ulrich > > Jonathan Coles wrote: >> When I tried to compile on kernel 3.0.0.12 (Ubuntu 11.10) I >> got the following error: >> >> /lib/modules/3.0.0-12-generic/build/include/linux/bitops.h:22:24: >> >> fatal error: asm/bitops.h: No such file or directory >> >> Searches

senza risposta • Discussioni attive Modifica la dimensione del carattere Stampa pagina [driver] problema compilazione Linguaggi di programmazione: php, perl, python, C, bash, ecc. Rispondi al messaggio 9 messaggi • Pagina 1 di 1 Rispondi citando [driver] problema compilazione da bigboss1984 » venerdì 8 luglio 2011, 16:43 ciao a tutti, per un esame che dovrei sostenere dovrei compilare un driver fatto da me, nella traccia c'è scritto di compilare con :gcc -c -I/usr/src/linux/include -DMODULE -D__KERNEL__ -o miodriver.oio non ho la cartella :/usr/src/linux/includeho invece una cartella:/usr/src/linux-headers-2.6.35-22/include/quindi compilo con:gcc -c -I/usr/src/linux/include -DMODULE -D__KERNEL__ -o miodriver.oil problema che lanciando questo comando l'output è:Codice: Seleziona tuttosoluzione.c:3:26: error: linux/module.h: No such file or directory
soluzione.c:4:25: error: asm/uaccess.h: No such file or directory
soluzione.c:5:24: error: linux/init.h: No such file or directory
soluzione.c:6:20: error: asm/io.h: No such file or directory
soluzione.c:7:21: error: strings.h: No such file or directory
soluzione.c:9: warning: data definition has no type or storage class
soluzione.c:15: warning: ‘struct file’ declared inside parameter list
soluzione.c:15: warning: its scope is only this definition or declaration, which is probably not what you want
soluzione.c:15: warning: ‘struct inode’ declared inside parameter list
soluzione.c: In function ‘my_open’:
soluzione.c:17: error: ‘MOD_INC_USE_COUNT’ undeclared (first use in this function)
soluzione.c:17: error: (Each undeclared identifier is reported only once
soluzione.c:17: error: for each function it appears in.)
soluzione.c: At top level:
soluzione.c:21: warning: ‘struct file’ declared inside parameter list
soluzione.c:21: warning: ‘struct inode’ declared inside parameter list
soluzione.c: In function ‘my_release’:
soluzione.c:23: error: ‘MOD_DEC_USE_COUNT’ undeclared (first use in this function)
soluzione.c: At

 

Related content

No related pages.