mirror of
https://github.com/ipxe/ipxe
synced 2025-12-30 22:08:48 +03:00
[x86_64] Add support for compilation as an x86_64 binary
Currently the only supported platform for x86_64 is EFI. Building an EFI64 gPXE requires a version of gcc that supports __attribute__((ms_abi)). This currently means a development build of gcc; the feature should be present when gcc 4.4 is released. In the meantime; you can grab a suitable gcc tree from git://git.etherboot.org/scm/people/mcb30/gcc/.git
This commit is contained in:
22
src/arch/x86_64/include/bits/byteswap.h
Normal file
22
src/arch/x86_64/include/bits/byteswap.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _BITS_BYTESWAP_H
|
||||
#define _BITS_BYTESWAP_H
|
||||
|
||||
static inline __attribute__ (( always_inline, const )) uint16_t
|
||||
__bswap_variable_16 ( uint16_t x ) {
|
||||
__asm__ ( "xchgb %b0,%h0" : "=Q" ( x ) : "0" ( x ) );
|
||||
return x;
|
||||
}
|
||||
|
||||
static inline __attribute__ (( always_inline, const )) uint32_t
|
||||
__bswap_variable_32 ( uint32_t x ) {
|
||||
__asm__ ( "bswapl %k0" : "=r" ( x ) : "0" ( x ) );
|
||||
return x;
|
||||
}
|
||||
|
||||
static inline __attribute__ (( always_inline, const )) uint64_t
|
||||
__bswap_variable_64 ( uint64_t x ) {
|
||||
__asm__ ( "bswapq %q0" : "=r" ( x ) : "0" ( x ) );
|
||||
return x;
|
||||
}
|
||||
|
||||
#endif /* _BITS_BYTESWAP_H */
|
||||
14
src/arch/x86_64/include/bits/compiler.h
Normal file
14
src/arch/x86_64/include/bits/compiler.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef _BITS_COMPILER_H
|
||||
#define _BITS_COMPILER_H
|
||||
|
||||
#ifndef ASSEMBLY
|
||||
|
||||
/** Declare a function with standard calling conventions */
|
||||
#define __asmcall __attribute__ (( regparm(0) ))
|
||||
|
||||
/** Declare a function with libgcc implicit linkage */
|
||||
#define __libgcc
|
||||
|
||||
#endif /* ASSEMBLY */
|
||||
|
||||
#endif /* _BITS_COMPILER_H */
|
||||
6
src/arch/x86_64/include/bits/endian.h
Normal file
6
src/arch/x86_64/include/bits/endian.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef ETHERBOOT_BITS_ENDIAN_H
|
||||
#define ETHERBOOT_BITS_ENDIAN_H
|
||||
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||
|
||||
#endif /* ETHERBOOT_BITS_ENDIAN_H */
|
||||
11
src/arch/x86_64/include/bits/errfile.h
Normal file
11
src/arch/x86_64/include/bits/errfile.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _BITS_ERRFILE_H
|
||||
#define _BITS_ERRFILE_H
|
||||
|
||||
/**
|
||||
* @addtogroup errfile Error file identifiers
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* _BITS_ERRFILE_H */
|
||||
10
src/arch/x86_64/include/bits/io.h
Normal file
10
src/arch/x86_64/include/bits/io.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _BITS_IO_H
|
||||
#define _BITS_IO_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* x86_64-specific I/O API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* _BITS_IO_H */
|
||||
12
src/arch/x86_64/include/bits/nap.h
Normal file
12
src/arch/x86_64/include/bits/nap.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _BITS_NAP_H
|
||||
#define _BITS_NAP_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* x86_64-specific CPU sleeping API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpxe/efi/efix86_nap.h>
|
||||
|
||||
#endif /* _BITS_MAP_H */
|
||||
10
src/arch/x86_64/include/bits/smbios.h
Normal file
10
src/arch/x86_64/include/bits/smbios.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _BITS_SMBIOS_H
|
||||
#define _BITS_SMBIOS_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* i386-specific SMBIOS API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* _BITS_SMBIOS_H */
|
||||
21
src/arch/x86_64/include/bits/stdint.h
Normal file
21
src/arch/x86_64/include/bits/stdint.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef _BITS_STDINT_H
|
||||
#define _BITS_STDINT_H
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef signed long ssize_t;
|
||||
typedef signed long off_t;
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef signed long long int64_t;
|
||||
|
||||
typedef unsigned long physaddr_t;
|
||||
typedef unsigned long intptr_t;
|
||||
|
||||
#endif /* _BITS_STDINT_H */
|
||||
10
src/arch/x86_64/include/bits/timer.h
Normal file
10
src/arch/x86_64/include/bits/timer.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _BITS_TIMER_H
|
||||
#define _BITS_TIMER_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* x86_64-specific timer API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* _BITS_TIMER_H */
|
||||
10
src/arch/x86_64/include/bits/uaccess.h
Normal file
10
src/arch/x86_64/include/bits/uaccess.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _BITS_UACCESS_H
|
||||
#define _BITS_UACCESS_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* x86_64-specific user access API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* _BITS_UACCESS_H */
|
||||
10
src/arch/x86_64/include/bits/umalloc.h
Normal file
10
src/arch/x86_64/include/bits/umalloc.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _BITS_UMALLOC_H
|
||||
#define _BITS_UMALLOC_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* x86_64-specific user memory allocation API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* _BITS_UMALLOC_H */
|
||||
Reference in New Issue
Block a user