PDA

View Full Version : wheres teh semaphore.h and hardware.h



kiros88
05-21-2010, 12:48 PM
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

tabstop
05-21-2010, 12:52 PM
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.

Salem
05-21-2010, 01:36 PM
Porting code from one OS to another is a minefield.

Which OS was the code for to begin with?

MK27
05-21-2010, 01:39 PM
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.

kiros88
05-21-2010, 02:10 PM
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

MK27
05-21-2010, 02:19 PM
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:



/*
* 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 */

I have no idea what arch "xtensa" refers to.