iPXE
|
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
unsigned long | strtoul (const char *string, char **endp, int base) |
Convert string to numeric value. More... | |
unsigned long long | strtoull (const char *string, char **endp, int base) |
Convert string to numeric value. More... | |
void *__malloc | malloc (size_t size) |
Allocate memory. More... | |
void * | realloc (void *old_ptr, size_t new_size) |
Reallocate memory. More... | |
void | free (void *ptr) |
Free memory. More... | |
void *__malloc | zalloc (size_t len) |
Allocate cleared memory. More... | |
static void *__malloc | calloc (size_t nmemb, size_t size) |
Allocate cleared memory. More... | |
long int | random (void) |
Generate a pseudo-random number between 0 and 2147483647L or 2147483562? More... | |
void | srandom (unsigned int seed) |
Seed the pseudo-random number generator. More... | |
static int | rand (void) |
static void | srand (unsigned int seed) |
static | __attribute__ ((always_inline)) int abs(int value) |
int | system (const char *command) |
Execute command line. More... | |
__asmcall int | main (void) |
Main entry point. More... | |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
unsigned long strtoul | ( | const char * | string, |
char ** | endp, | ||
int | base | ||
) |
Convert string to numeric value.
string | String |
endp | End pointer (or NULL) |
base | Numeric base (or zero to autodetect) |
value | Numeric value |
Definition at line 484 of file string.c.
References base, digit_value(), strtoul_pre(), and value.
Referenced by aoe_parse_uri(), bzimage_parse_cmdline(), cpio_parse_cmdline(), efi_snp_hii_store(), fc_aton(), fc_id_aton(), ftp_parse_value(), ftp_reply(), gdbserial_init(), http_parse_content_length(), http_parse_retry_after(), http_parse_status(), http_rx_chunk_len(), ib_srp_parse_integer(), inet6_aton(), inet_aton(), iscsi_handle_chap_i_value(), iscsi_handle_maxburstlength_value(), iscsi_handle_targetaddress_value(), iscsi_parse_root_path(), mac_address_from_string_specs(), parse_int_setting(), parse_integer(), parse_setting_tag(), pnm_ascii(), scsi_parse_lun(), slam_parse_multicast_address(), string_test_exec(), tftp_process_blksize(), tftp_process_multicast(), tftp_process_tsize(), uri_decode(), uri_port(), and xenstore_read_num().
unsigned long long strtoull | ( | const char * | string, |
char ** | endp, | ||
int | base | ||
) |
Convert string to numeric value.
string | String |
endp | End pointer (or NULL) |
base | Numeric base (or zero to autodetect) |
value | Numeric value |
Definition at line 519 of file string.c.
References base, digit_value(), strtoul_pre(), and value.
Allocate memory.
size | Requested size |
ptr | Memory, or NULL |
Allocates memory with no particular alignment requirement. ptr
will be aligned to at least a multiple of sizeof(void*).
Definition at line 583 of file malloc.c.
References ASSERTED, DBGC, heap, NULL, realloc(), and size.
Referenced by add_ipv4_miniroute(), add_tls(), aes_unwrap(), aes_wrap(), alloc_iob_raw(), apply_dns_search(), ath5k_hw_rfregs_init(), chap_init(), cmdline_init(), cms_decrypt(), deflate_test_exec(), der_asn1(), derwin(), dhcpv6_rx(), dhe_key(), dupwin(), eap_rx_mschapv2_request(), eap_tx_response(), efi_block_label(), efi_cmdline_init(), efi_download_start(), efi_local_check_volume_name(), efi_local_len(), efi_locate_device(), efi_vasprintf(), efivars_fetch(), eisabus_probe(), fc_ulp_login(), fetch_setting_copy(), format_uri_alloc(), http_format_ntlm_auth(), icert_encode(), int13_hook(), ipair_rx_pubkey(), ipoib_map_remac(), isabus_probe(), isapnpbus_probe(), iscsi_handle_chap_c_value(), iscsi_handle_chap_r_value(), iscsi_rx_buffered_data(), iscsi_scsi_command(), jme_alloc_rx_resources(), jme_alloc_tx_resources(), lldp_rx(), loopback_test(), mcabus_probe(), memcpy_test_speed(), mlx_memory_alloc_priv(), net80211_probe_start(), net80211_register(), newwin(), nfs_uri_symlink(), ntlm_authenticate_okx(), ocsp_response(), ocsp_uri_string(), parse_kv(), parse_net_args(), pci_vpd_resize(), pcibus_probe(), peerblk_decrypt(), peerblk_parse_header(), pem_asn1(), rsa_alloc(), sandev_parse_iso9660(), storef_setting(), storen_setting(), strndup(), t509bus_probe(), tls_new_server_key_exchange(), tls_new_session_ticket(), tls_select_handshake(), tls_send_client_key_exchange_dhe(), tls_send_plaintext(), uhci_enqueue(), usb_config_descriptor(), usb_get_string_descriptor(), usbio_config(), usbio_path(), vasprintf(), vesafb_mode_list(), vmbus_open(), wpa_make_rsn_ie(), wpa_start(), and zalloc().
void* realloc | ( | void * | old_ptr, |
size_t | new_size | ||
) |
Reallocate memory.
old_ptr | Memory previously allocated by malloc(), or NULL |
new_size | Requested size |
new_ptr | Allocated memory, or NULL |
Allocates memory with no particular alignment requirement. new_ptr
will be aligned to at least a multiple of sizeof(void*). If old_ptr
is non-NULL, then the contents of the newly allocated memory will be the same as the contents of the previously allocated memory, up to the minimum of the old and new sizes. The old memory will be freed.
If allocation fails the previously allocated block is left untouched and NULL is returned.
Calling realloc() with a new size of zero is a valid way to free a memory block.
Definition at line 521 of file malloc.c.
References alloc_memblock(), assert(), ASSERTED, container_of, data, autosized_block::data, DBGC, free_memblock(), heap, memcpy(), NOWHERE, NULL, offsetof, autosized_block::size, VALGRIND_FREELIKE_BLOCK, VALGRIND_MAKE_MEM_DEFINED, VALGRIND_MAKE_MEM_NOACCESS, and VALGRIND_MALLOCLIKE_BLOCK.
Referenced by __attribute__(), asn1_grow(), bitmap_resize(), cachedhcp_record(), dhcpopt_init(), efi_ifr_op(), efi_ifr_string(), efivars_find(), free(), ibft_alloc_string(), ibft_install(), line_buffer(), malloc(), nvo_realloc(), process_script(), and xferbuf_malloc_realloc().
void free | ( | void * | ptr | ) |
Free memory.
ptr | Memory allocated by malloc(), or NULL |
Memory allocated with malloc_phys() cannot be freed with free(); it must be freed with free_phys() instead.
If ptr
is NULL, no action is taken.
Definition at line 604 of file malloc.c.
Allocate cleared memory.
size | Requested size |
ptr | Allocated memory |
Allocate memory as per malloc(), and zero it.
This function name is non-standard, but pretty intuitive. zalloc(size) is always equivalent to calloc(1,size)
Definition at line 624 of file malloc.c.
References ASSERTED, data, DBGC, heap, malloc(), memset(), and size.
Referenced by add_dynui_item(), add_parameter(), alloc_form(), alloc_ibdev(), alloc_image(), alloc_netdev(), alloc_pixbuf(), alloc_sandev(), alloc_usb(), alloc_usb_bus(), alloc_usb_hub(), aoecmd_create(), aoedev_open(), ar9300_eeprom_restore_internal(), arbel_alloc(), arbel_create_cq(), arbel_create_qp(), ata_open(), atadev_command(), ath5k_hw_attach(), ath5k_probe(), ath9k_init_softc(), ath_descdma_setup(), atl1e_setup_ring_resources(), autovivify_child_settings(), block_translate(), cachedhcp_record(), calloc(), cms_message(), cms_parse_participants(), concat_args(), create_downloader(), create_dynui(), create_parameters(), create_pinger(), create_validator(), dhcp_deliver(), dhcpv6_register(), dns_resolv(), efi_block_exec(), efi_block_install(), efi_fcp_path(), efi_file_open_image(), efi_ib_srp_path(), efi_image_path(), efi_iscsi_path(), efi_local_open(), efi_netdev_path(), efi_path_uri(), efi_paths(), efi_pxe_install(), efi_snp_hii_fetch(), efi_snp_hii_install(), efi_snp_hii_process(), efi_snp_hii_store(), efi_snp_probe(), efi_uri_path(), efi_usb_install(), efi_usb_open(), efi_usb_path(), efi_usb_probe(), efidev_alloc(), efipci_start(), efivars_find(), ehci_endpoint_open(), ehci_probe(), ehci_ring_alloc(), eoib_create_peer(), exanic_probe(), fc_els_create(), fc_ns_query(), fc_peer_create(), fc_port_open(), fc_ulp_create(), fc_xchg_create(), fcpdev_open(), fcpdev_scsi_command(), fetch_string_setting_copy_alloc(), fetchf_setting_copy(), flexboot_nodnic_create_cq(), flexboot_nodnic_create_qp(), flexboot_nodnic_eth_open(), flexboot_nodnic_probe(), fragment_reassemble(), ftp_open(), generic_settings_store(), golan_alloc(), golan_create_cq(), golan_create_qp_aux(), guestinfo_fetch_type(), hermon_alloc(), hermon_create_cq(), hermon_create_qp(), http_connect(), http_open(), http_open_uri(), hub_probe(), hv_probe(), hvm_probe(), hw_open(), ib_cmrc_open(), ib_create_conn(), ib_create_cq(), ib_create_madx(), ib_create_mi(), ib_create_path(), ib_create_qp(), ib_mcast_attach(), ib_srp_open(), ibft_install(), icert_certs(), imux_probe(), init_mlx_utils(), ipair_create(), ipv6_add_miniroute(), iscsi_open(), linda_create_send_wq(), mlx_memory_zalloc_priv(), ndp_register_settings(), neighbour_create(), net80211_handle_mgmt(), net80211_prepare_assoc(), net80211_probe_start(), net80211_probe_step(), net80211_step_associate(), nfs_open(), nii_map(), numeric_resolv(), ocsp_check(), ocsp_uri_string(), open(), parse_uri(), pcibridge_probe(), peerblk_open(), peerdisc_create(), peerdisc_discovered(), peermux_filter(), ping_open(), png_pixbuf(), pxe_menu_parse(), qib7322_create_send_bufs(), qib7322_create_send_wq(), qib7322_probe(), rc80211_init(), resolv(), resolv_setting(), rtl818x_probe(), scsi_open(), scsidev_command(), sec80211_install(), sis190_mii_probe(), skge_probe(), skge_ring_alloc(), sky2_probe(), sky2_up(), slam_open(), srp_open(), srpdev_scsi_command(), start_dhcp(), start_dhcpv6(), start_ipv6conf(), start_ntp(), start_pxebs(), tcp_open(), tftp_core_open(), tg3_alloc_consistent(), tls_send_certificate(), tls_session(), tls_set_cipher(), txnic_bgx_probe(), txnic_pf_probe(), ucode_exec(), udp_open_common(), uhci_endpoint_open(), uhci_probe(), undipci_probe(), undirom_probe(), uri_dup(), usb_probe_all(), usbblk_probe(), usbio_endpoint_open(), usbio_interfaces(), usbio_interrupt_open(), usbio_start(), usbkbd_probe(), validator_start_download(), virtnet_open_legacy(), virtnet_open_modern(), vmbus_probe(), vmbus_probe_channels(), vxge_hw_device_initialize(), x509_alloc_chain(), x509_append(), x509_certificate(), xcm_create(), xenbus_probe_device(), xenstore_response(), xfer_open_named_socket(), xhci_bus_open(), xhci_device_open(), xhci_endpoint_open(), xhci_probe(), xhci_ring_alloc(), xsigo_ib_probe(), xve_create(), and zlib_deflate().
Allocate cleared memory.
nmemb | Number of members |
size | Size of each member |
ptr | Allocated memory |
Allocate memory as per malloc(), and zero it.
This is implemented as a static inline, with the body of the function in zalloc(), since in most cases nmemb
will be 1 and doing the multiply is just wasteful.
Definition at line 45 of file stdlib.h.
References size, and zalloc().
Referenced by ath5k_desc_alloc(), ath5k_eeprom_convert_pcal_info_2413(), ath5k_eeprom_convert_pcal_info_5111(), ath5k_eeprom_convert_pcal_info_5112(), and slk_init().
long int random | ( | void | ) |
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
rand | Pseudo-random number |
Definition at line 31 of file random.c.
References NULL, rnd_seed, and srandom().
Referenced by arbel_alloc_qpn(), cipher_cost(), digest_cost(), dns_send_packet(), eap_rx_mschapv2_request(), efi_pxe_udp_write(), efi_snp_hii_random_guid(), eth_random_addr(), forcedeth_open(), hermon_alloc_qpn(), http_digest_authenticate(), ib_create_conn(), ib_create_qp(), inject_corruption_nonzero(), inject_fault_nonzero(), iscsi_handle_chap_c_value(), iscsi_open_connection(), loopback_test(), memcpy_test_speed(), ntlm_response(), peerdisc_create(), profile_test_exec(), rand(), start_dhcp(), start_dhcpv6(), tcp_open(), tcpip_bind(), tcpip_random_okx(), tls_client_hello(), tls_new_server_hello(), tls_send_client_key_exchange_pubkey(), vmbus_open(), and wep_encrypt().
void srandom | ( | unsigned int | seed | ) |
|
inlinestatic |
Definition at line 59 of file stdlib.h.
References random().
Referenced by cipher_cost(), digest_cost(), mlx_utils_rand_priv(), oncrpc_init_session(), and register_netdev().
|
inlinestatic |
Definition at line 63 of file stdlib.h.
References srandom().
Referenced by cipher_cost(), digest_cost(), and register_netdev().
|
inlinestatic |
int system | ( | const char * | command | ) |
Execute command line.
command | Command line |
rc | Return status code |
Execute the named command and arguments.
Definition at line 287 of file exec.c.
References command_terminator(), count, ENOMEM, execv(), expand_tokens(), free, free_tokens(), NULL, rc, SHELL_STOP_COMMAND, shell_stopped(), split_command(), and strdup().
__asmcall int main | ( | void | ) |
Main entry point.
rc | Return status code |
Definition at line 28 of file main.c.
References initialise(), ipxe(), NULL, printf(), product_short_name, rc, shutdown_exit(), and startup().
Referenced by _efi_start().