Im compiling code that had asm/semaphore.h and asm/hardware.h as headers but i get the error that no such file or directory exist and i using a linux 2.6.30
Im compiling code that had asm/semaphore.h and asm/hardware.h as headers but i get the error that no such file or directory exist and i using a linux 2.6.30
semaphore.h is just a plain old header. I don't have a hardware.h that I can tell, but I don't do a lot of (i.e. any) fancy hardware programming.
Porting code from one OS to another is a minefield.
Which OS was the code for to begin with?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
The semaphore.h in /usr/include involves the same library functions as the one in the kernel tree (pretty sure anyway), which that's probably what asm/ is referencing. There is a hardware.h in the tree too, but there's not just one "asm" subdirectory, you need to pick an architecture.
You can find the kernel includes via /lib/modules/source/include.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Okay well for semaphore i just did
#include "linux/semaphore.h"
and that didnt give me a compiler error so i guess tahts works but where would tehre be a generic hardware.h
I found one in 2.6.28.7, not much too it and definitely ain't generic:
I have no idea what arch "xtensa" refers to.Code:/* * include/asm-xtensa/platform-iss/hardware.h * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2001 Tensilica Inc. */ /* * This file contains the default configuration of ISS. */ #ifndef _XTENSA_PLATFORM_ISS_HARDWARE_H #define _XTENSA_PLATFORM_ISS_HARDWARE_H /* * Memory configuration. */ #define PLATFORM_DEFAULT_MEM_START 0x00000000 #define PLATFORM_DEFAULT_MEM_SIZE 0x08000000 /* * Interrupt configuration. */ #endif /* _XTENSA_PLATFORM_ISS_HARDWARE_H */
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge