iPXE
compiler.h File Reference

Global compiler definitions. More...

#include <bits/compiler.h>

Go to the source code of this file.

Macros

#define __attribute__(x)
#define _C1(x, y)
 Concatenate non-expanded arguments.
#define _C2(x, y)
 Concatenate expanded arguments.
#define _S1(x)
 Stringify non-expanded argument.
#define _S2(x)
 Stringify expanded argument.
#define PROGBITS_OPS   _S2 ( ASM_TCHAR_OPS ) "progbits"
#define PROGBITS   _S2 ( ASM_TCHAR ) "progbits"
#define NOBITS_OPS   _S2 ( ASM_TCHAR_OPS ) "nobits"
#define NOBITS   _S2 ( ASM_TCHAR ) "nobits"
#define PROVIDE_SYMBOL(symbol)
 Provide a symbol within this object file.
#define REQUEST_SYMBOL(symbol)
 Request a symbol.
#define REQUIRE_SYMBOL(symbol)
 Require a symbol.
#define REQUIRING_SYMBOL(symbol)
 Specify the file's requiring symbol.
#define PROVIDE_REQUIRING_SYMBOL()
 Provide a file's requiring symbol.
#define PREFIX_OBJECT(_prefix)
#define OBJECT_SYMBOL   PREFIX_OBJECT ( obj_ )
#define REQUEST_OBJECT(object)
 Request an object.
#define REQUIRE_OBJECT(object)
 Require an object.
#define ERRFILE   PREFIX_OBJECT ( ERRFILE_ )
 Select file identifier for errno.h (if used)
#define __weak   __attribute__ (( weak, noinline ))
 Declare a function as weak (use before the definition)
#define NDEBUG
#define DBGLVL_MAX   0
#define DBGLVL_DFLT   DBGLVL_MAX
#define __debug_disable(object)
#define DBG_DISABLE_OBJECT(object, level)
#define DBG_ENABLE_OBJECT(object, level)
#define DBGLVL   0
#define DBG_DISABLE(level)
#define DBG_ENABLE(level)
#define DBGLVL_LOG   1
#define DBG_LOG   ( DBGLVL & DBGLVL_LOG )
#define DBGLVL_EXTRA   2
#define DBG_EXTRA   ( DBGLVL & DBGLVL_EXTRA )
#define DBGLVL_PROFILE   4
#define DBG_PROFILE   ( DBGLVL & DBGLVL_PROFILE )
#define DBGLVL_IO   8
#define DBG_IO   ( DBGLVL & DBGLVL_IO )
#define DBG_IF(level, ...)
 Print debugging message if we are at a certain debug level.
#define DBG_HDA_IF(level, dispaddr, data, len)
 Print a hex dump if we are at a certain debug level.
#define DBG_HD_IF(level, data, len)
 Print a hex dump if we are at a certain debug level.
#define DBG_MD5A_IF(level, dispaddr, data, len)
 Print an MD5 checksum if we are at a certain debug level.
#define DBG_MD5_IF(level, data, len)
 Print an MD5 checksum if we are at a certain debug level.
#define DBG_PAUSE_IF(level, ...)
 Prompt for key press if we are at a certain debug level.
#define DBG_MORE_IF(level, ...)
 Prompt for more output data if we are at a certain debug level.
#define DBG_AC_IF(level, id)
 Select colour for debug messages if we are at a certain debug level.
#define DBG_DC_IF(level)
 Revert colour for debug messages if we are at a certain debug level.
#define DBGC_IF(level, id, ...)
#define DBGC_HDA_IF(level, id, ...)
#define DBGC_HD_IF(level, id, ...)
#define DBGC_MD5A_IF(level, id, ...)
#define DBGC_MD5_IF(level, id, ...)
#define DBGC_PAUSE_IF(level, id)
#define DBGC_MORE_IF(level, id)
#define DBG(...)
 Print a debugging message.
#define DBG_HDA(...)
#define DBG_HD(...)
#define DBG_MD5A(...)
#define DBG_MD5(...)
#define DBG_PAUSE(...)
#define DBG_MORE(...)
#define DBGC(...)
#define DBGC_HDA(...)
#define DBGC_HD(...)
#define DBGC_MD5A(...)
#define DBGC_MD5(...)
#define DBGC_PAUSE(...)
#define DBGC_MORE(...)
#define DBG2(...)
#define DBG2_HDA(...)
#define DBG2_HD(...)
#define DBG2_MD5A(...)
#define DBG2_MD5(...)
#define DBG2_PAUSE(...)
#define DBG2_MORE(...)
#define DBGC2(...)
#define DBGC2_HDA(...)
#define DBGC2_HD(...)
#define DBGC2_MD5A(...)
#define DBGC2_MD5(...)
#define DBGC2_PAUSE(...)
#define DBGC2_MORE(...)
#define DBGP(...)
#define DBGP_HDA(...)
#define DBGP_HD(...)
#define DBGP_MD5A(...)
#define DBGP_MD5(...)
#define DBGP_PAUSE(...)
#define DBGP_MORE(...)
#define DBGCP(...)
#define DBGCP_HDA(...)
#define DBGCP_HD(...)
#define DBGCP_MD5A(...)
#define DBGCP_MD5(...)
#define DBGCP_PAUSE(...)
#define DBGCP_MORE(...)
#define DBGIO(...)
#define DBGIO_HDA(...)
#define DBGIO_HD(...)
#define DBGIO_MD5A(...)
#define DBGIO_MD5(...)
#define DBGIO_PAUSE(...)
#define DBGIO_MORE(...)
#define DBGCIO(...)
#define DBGCIO_HDA(...)
#define DBGCIO_HD(...)
#define DBGCIO_MD5A(...)
#define DBGCIO_MD5(...)
#define DBGCIO_PAUSE(...)
#define DBGCIO_MORE(...)
#define __unused   __attribute__ (( unused ))
 Declare a variable or data structure as unused.
#define __pure   __attribute__ (( pure ))
 Declare a function as pure - i.e.
#define __const   __attribute__ (( const ))
 Declare a function as const - i.e.
#define __nonnull   __attribute__ (( nonnull ))
 Declare a function's pointer parameters as non-null - i.e.
#define __malloc   __attribute__ (( malloc ))
 Declare a pointer returned by a function as a unique memory address as returned by malloc-type functions.
#define __used   __attribute__ (( used ))
 Declare a function as used.
#define __aligned   __attribute__ (( aligned ( 16 ) ))
 Declare a data structure to be aligned with 16-byte alignment.
#define __always_inline   __attribute__ (( always_inline ))
 Declare a function to be always inline.
#define inline   inline __attribute__ (( no_instrument_function ))
#define barrier()
 Optimisation barrier.
#define ARRAY_SIZE(array)
 Array size.
#define ABS_SYMBOL(name)
 Declare an absolute symbol (e.g.
#define ABS_VALUE_INIT(name)
 Get value of an absolute symbol for use in a static initializer.
#define ABS_VALUE(name)
 Get value of an absolute symbol.
#define FILE_LICENCE_PUBLIC_DOMAIN    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__public_domain__ ) )
 Declare a file as being in the public domain.
#define FILE_LICENCE_GPL2_OR_LATER    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl2_or_later__ ) )
 Declare a file as being under version 2 (or later) of the GNU GPL.
#define FILE_LICENCE_GPL2_ONLY    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl2_only__ ) )
 Declare a file as being under version 2 of the GNU GPL.
#define FILE_LICENCE_GPL_ANY    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl_any__ ) )
 Declare a file as being under any version of the GNU GPL.
#define FILE_LICENCE_BSD3    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__bsd3__ ) )
 Declare a file as being under the three-clause BSD licence.
#define FILE_LICENCE_BSD2    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__bsd2__ ) )
 Declare a file as being under the two-clause BSD licence.
#define FILE_LICENCE_BSD2_PATENT    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__bsd2_patent__ ) )
 Declare a file as being under the two-clause BSD plus patent licence.
#define FILE_LICENCE_MIT    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__mit__ ) )
 Declare a file as being under the one-clause MIT-style licence.
#define FILE_LICENCE_GPL2_OR_LATER_OR_UBDL    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl2_or_later_or_ubdl__ ) )
 Declare a file as being under GPLv2+ or UBDL.
#define FILE_LICENCE(_licence)
 Declare a particular licence as applying to a file.
#define FILE_SECBOOT_PERMITTED    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __secboot__permitted__ ) )
 Declare a file as being permitted in a UEFI Secure Boot build.
#define FILE_SECBOOT_FORBIDDEN    PROVIDE_SYMBOL ( PREFIX_OBJECT ( __secboot__forbidden__ ) )
 Declare a file as being forbidden in a UEFI Secure Boot build.
#define FILE_SECBOOT(_status)
 Declare a file's UEFI Secure Boot permission status.

Functions

 PROVIDE_SYMBOL (OBJECT_SYMBOL)
 Always provide the symbol for the current object (defined by -DOBJECT)
void dbg_printf (const char *fmt,...)
 printf() for debugging
void dbg_autocolourise (unsigned long id)
 Select automatic colour for debug messages.
void dbg_decolourise (void)
 Revert to normal colour.
void dbg_hex_dump_da (unsigned long dispaddr, const void *data, unsigned long len)
 Print hex dump with specified display address.
void dbg_md5_da (unsigned long dispaddr, const void *data, unsigned long len)
 Print an MD5 checksum with specified display address.
void dbg_pause (void)
 Pause until a key is pressed.
void dbg_more (void)
 Indicate more data to follow and pause until a key is pressed.
char __debug_disable (OBJECT)
 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)

Detailed Description

Global compiler definitions.

This file is implicitly included by every .c file in Etherboot. It defines global macros such as DBG().

We arrange for each object to export the symbol obj_OBJECT (where OBJECT is the object name, e.g. rtl8139) as a global symbol, so that the linker can drag in selected object files from the library using -u obj_OBJECT .

Definition in file compiler.h.

Macro Definition Documentation

◆ __attribute__

#define __attribute__ ( x)

Definition at line 10 of file compiler.h.

Referenced by __attribute__(), __attribute__(), __attribute__(), __attribute__(), aes_entry_column(), asn1_boolean(), asn1_enter_bits(), asn1_generalized_time(), bigint_add_sample(), bigint_bit_is_set_sample(), bigint_copy_sample(), bigint_done_sample(), bigint_grow_sample(), bigint_init_sample(), bigint_is_geq_sample(), bigint_is_zero_sample(), bigint_ladder_raw(), bigint_max_set_bit_sample(), bigint_mod_exp_ladder(), bigint_mod_exp_raw(), bigint_mod_exp_sample(), bigint_mod_invert_raw(), bigint_mod_invert_sample(), bigint_montgomery_raw(), bigint_montgomery_relaxed_raw(), bigint_montgomery_sample(), bigint_multiply_raw(), bigint_multiply_sample(), bigint_ntoa_raw(), bigint_reduce_raw(), bigint_reduce_sample(), bigint_shl_sample(), bigint_shr_sample(), bigint_shrink_sample(), bigint_subtract_sample(), bigint_swap_sample(), bofm_dummy_harvest(), dhe_key(), eap_rx_md5(), ecdsa_init_values(), ecdsa_invert(), ecdsa_parse_signature(), ecdsa_prepend_signature(), ecdsa_sign_rs(), ecdsa_verify_rs(), efi_fcp_path(), efi_ifr_package(), fc_els_prli_detect(), fc_els_prli_rx(), fc_els_prli_tx(), fcoe_fip_tx_keepalive(), fcoe_fip_tx_solicitation(), fcoe_fip_tx_vlan(), fdt_set(), find_dhcp_option_with_encap(), find_strings_terminator(), get_entropy_input_tmp(), golan_set_access_reg(), hash_df(), hv_map_hypercall(), hvm_cpuid_base(), int13_load_eltorito(), intelxl_admin_mac_write(), ipv4_add_static(), mlx_memory_alloc_dma_priv(), mlx_memory_alloc_priv(), mlx_memory_free_dma_priv(), mlx_memory_free_priv(), mlx_memory_map_dma_priv(), mlx_memory_ummap_dma_priv(), mlx_memory_zalloc_priv(), mlx_pci_gw_teardown(), mlx_pci_mem_read_priv(), mlx_pci_mem_write_priv(), mlx_pci_teardown_priv(), peerblk_parse_header(), rsa_alloc(), script_probe(), tls_client_hello(), tls_new_alert(), tls_new_certificate(), tls_new_change_cipher(), tls_new_ciphertext(), tls_new_finished(), tls_new_handshake(), tls_new_server_hello(), tls_new_server_hello_done(), tls_new_session_ticket(), tls_parse_chain(), tls_send_certificate(), tls_send_certificate_verify(), tls_send_change_cipher(), tls_send_client_key_exchange_dhe(), tls_send_client_key_exchange_ecdhe(), tls_send_client_key_exchange_pubkey(), tls_send_finished(), tls_send_record(), tls_verify_dh_params(), usb_get_default_language(), usb_get_string_descriptor(), vmbus_establish_gpadl(), vmbus_send_data(), vmxnet3_get_hw_addr(), vmxnet3_set_ll_addr(), weierstrass_add_ladder(), weierstrass_add_raw(), weierstrass_done_raw(), weierstrass_exec(), weierstrass_init_curve(), weierstrass_init_raw(), weierstrass_multiply(), weierstrass_verify_raw(), and wpa_derive_ptk().

◆ _C1

#define _C1 ( x,
y )
Value:
x ## y
static unsigned int unsigned int y
Definition pixbuf.h:63
static unsigned int x
Definition pixbuf.h:63

Concatenate non-expanded arguments.

Definition at line 46 of file compiler.h.

◆ _C2

#define _C2 ( x,
y )
Value:
_C1 ( x, y )
#define _C1(x, y)
Concatenate non-expanded arguments.
Definition compiler.h:46

Concatenate expanded arguments.

Definition at line 48 of file compiler.h.

◆ _S1

#define _S1 ( x)
Value:
#x

Stringify non-expanded argument.

Definition at line 51 of file compiler.h.

◆ _S2

#define _S2 ( x)
Value:
_S1 ( x )
#define _S1(x)
Stringify non-expanded argument.
Definition compiler.h:51

Stringify expanded argument.

Definition at line 53 of file compiler.h.

Referenced by buildarch_fetch(), platform_fetch(), run_all_tests(), and xsigo_xds_complete().

◆ PROGBITS_OPS

#define PROGBITS_OPS   _S2 ( ASM_TCHAR_OPS ) "progbits"

Definition at line 60 of file compiler.h.

◆ PROGBITS

#define PROGBITS   _S2 ( ASM_TCHAR ) "progbits"

Definition at line 61 of file compiler.h.

Referenced by __asm__().

◆ NOBITS_OPS

#define NOBITS_OPS   _S2 ( ASM_TCHAR_OPS ) "nobits"

Definition at line 62 of file compiler.h.

◆ NOBITS

#define NOBITS   _S2 ( ASM_TCHAR ) "nobits"

Definition at line 63 of file compiler.h.

◆ ERRFILE

#define ERRFILE   PREFIX_OBJECT ( ERRFILE_ )

Select file identifier for errno.h (if used)

Definition at line 207 of file compiler.h.

◆ __weak

#define __weak   __attribute__ (( weak, noinline ))

Declare a function as weak (use before the definition)

Due to a bug in at least GCC 4.4.4 and earlier, weak symbols may be inlined if they have hidden visibility (see above for why hidden visibility is used). This results in the non-weak symbol never being used, so explicitly mark the function as noinline to prevent inlining.

Definition at line 219 of file compiler.h.

Referenced by ansicol_set(), efi_fdt_install(), efi_fdt_uninstall(), ehci_companion(), format_ipv4_setting(), format_ipv6_setting(), http_block_read(), http_block_read_capacity(), parse_ipv4_setting(), parse_ipv6_setting(), ping_rx(), pxe_api_call_weak(), pxe_menu_boot(), sec80211_detect(), uart_register_fixed(), vlan_netdev_rx(), vlan_netdev_rx_err(), and vlan_tci().

◆ barrier

#define barrier ( )
Value:
__asm__ __volatile__ ( "" : : : "memory" )
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")

Optimisation barrier.

Definition at line 633 of file compiler.h.

Referenced by arbel_cmd(), arbel_create_cq(), arbel_create_eq(), arbel_poll_cq(), arbel_poll_eq(), arbel_post_recv(), arbel_post_send(), arbel_ring_doorbell(), bnxt_tx_avail(), hermon_cmd(), hermon_create_cq(), hermon_create_eq(), hermon_post_recv(), hermon_post_send(), mlx_pci_mem_write_priv(), and tg3_tx_avail().

◆ ARRAY_SIZE

#define ARRAY_SIZE ( array)
Value:
( sizeof (array) / sizeof ( (array)[0] ) )
uint32_t array
Array number.
Definition edd.h:1

Array size.

Definition at line 640 of file compiler.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )