wheres teh semaphore.h and hardware.h

This is a discussion on wheres teh semaphore.h and hardware.h within the Linux Programming forums, part of the Platform Specific Boards category; Im compiling code that had asm/semaphore.h and asm/hardware.h as headers but i get the error that no such file or ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    192

    wheres teh semaphore.h and hardware.h

    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

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    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.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    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

  5. #5
    Registered User
    Join Date
    Aug 2009
    Posts
    192
    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

  6. #6
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by kiros88 View Post
    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:

    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 */
    I have no idea what arch "xtensa" refers to.
    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

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21