+++ /dev/null
-iPXE README File
-
-Quick start guide:
-
- cd src
- make
-
-For any more detailed instructions, see http://ipxe.org
extern int pxe_deactivate ( void );
extern int pxe_start_nbp ( void );
extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 );
-extern int _pxe_api_call_weak ( struct i386_all_regs *ix86 )
- __attribute__ (( weak ));
-
-/**
- * Dispatch PXE API call weakly
- *
- * @v ix86 Registers for PXE call
- * @ret present Zero if the PXE stack is present, nonzero if not
- *
- * A successful return only indicates that the PXE stack was available
- * for dispatching the call; it says nothing about the success of
- * whatever the call asked for.
- */
-static inline int pxe_api_call_weak ( struct i386_all_regs *ix86 )
-{
- if ( _pxe_api_call_weak != NULL )
- return _pxe_api_call_weak ( ix86 );
- return -1;
-}
+extern int pxe_api_call_weak ( struct i386_all_regs *ix86 );
#endif /* _PXE_CALL_H */
* @v ix86 Registers for PXE call
* @ret present Zero (PXE stack present)
*/
-int _pxe_api_call_weak ( struct i386_all_regs *ix86 )
+int pxe_api_call_weak ( struct i386_all_regs *ix86 )
{
pxe_api_call ( ix86 );
return 0;
/**
* Present cached DHCP packet if it exists
*/
-void __weak_impl ( get_cached_dhcpack ) ( void ) {
+void get_cached_dhcpack ( void ) {
struct undi_device *undi;
struct s_PXENV_GET_CACHED_INFO get_cached_info;
int rc;
}
+/**
+ * Dispatch PXE API call weakly
+ *
+ * @v ix86 Registers for PXE call
+ * @ret present Zero if the PXE stack is present, nonzero if not
+ *
+ * A successful return only indicates that the PXE stack was available
+ * for dispatching the call; it says nothing about the success of
+ * whatever the call asked for.
+ */
+__weak int pxe_api_call_weak ( struct i386_all_regs *ix86 __unused ) {
+ return -1;
+}
+
/**
* SYSLINUX API
*/
/** Select file identifier for errno.h (if used) */
#define ERRFILE PREFIX_OBJECT ( ERRFILE_ )
-/**
- * @defgroup weakmacros Macros to manage weak symbol definitions
- *
- * Weak symbols allow one to reference a function in another file
- * without necessarily requiring that file to be linked in. In their
- * native form, the function will be @c NULL if its file is not linked
- * in; these macros provide an inline wrapper that returns an
- * appropriate error indication or default value.
- *
- * @{
- */
#ifndef ASSEMBLY
-/** Mangle @a name into its weakly-referenced implementation */
-#define __weak_impl( name ) _w_ ## name
-
-/**
- * Declare a weak function with inline safety wrapper
- *
- * @v ret Return type of weak function
- * @v name Name of function to expose
- * @v proto Parenthesized list of arguments with types
- * @v args Parenthesized list of argument names
- * @v dfl Value to return if weak function is not available
- */
-#define __weak_decl( ret, name, proto, args, dfl ) \
- ret __weak_impl( name ) proto __attribute__ (( weak )); \
- static inline ret name proto { \
- if ( __weak_impl( name ) ) \
- return __weak_impl( name ) args; \
- return dfl; \
- }
+/** Declare a function as weak (use *before* the definition) */
+#define __weak __attribute__ (( weak ))
#endif
-/** @} */
/** @defgroup dbg Debugging infrastructure
* @{
* should look for such a packet and call store_cached_dhcpack() with
* it if it exists.
*/
-__weak_decl ( void, get_cached_dhcpack, ( void ), (), );
+extern void get_cached_dhcpack ( void );
extern void store_cached_dhcpack ( userptr_t data, size_t len );
/** @file
*
* Definitions for general secured-network routines.
- *
- * Any function in this file which may be referenced by code which is
- * not exclusive to encryption-enabled builds (e.g. sec80211_detect(),
- * which is called by net80211_probe_step() to fill the net80211_wlan
- * structure's security fields) must be declared as a weak symbol,
- * using an inline interface similar to that used for
- * sec80211_detect() below. This prevents secure network support from
- * bloating general builds by any more than a few tiny hooks to call
- * crypto functions when crypto structures are non-NULL.
*/
-int _sec80211_detect ( struct io_buffer *iob,
- enum net80211_security_proto *secprot,
- enum net80211_crypto_alg *crypt )
- __attribute__ (( weak ));
-
-
-/**
- * Inline safety wrapper for _sec80211_detect()
- *
- * @v iob I/O buffer containing beacon frame
- * @ret secprot Security handshaking protocol used by network
- * @ret crypt Cryptosystem used by network
- * @ret rc Return status code
- *
- * This function transparently calls _sec80211_detect() if the file
- * containing it was compiled in, or returns an error indication of
- * @c -ENOTSUP if not.
- */
-static inline int sec80211_detect ( struct io_buffer *iob,
- enum net80211_security_proto *secprot,
- enum net80211_crypto_alg *crypt ) {
- if ( _sec80211_detect )
- return _sec80211_detect ( iob, secprot, crypt );
- return -ENOTSUP;
-}
+int sec80211_detect ( struct io_buffer *iob,
+ enum net80211_security_proto *secprot,
+ enum net80211_crypto_alg *crypt );
int sec80211_detect_ie ( int is_rsn, u8 *start, u8 *end,
enum net80211_security_proto *secprot,
const char *filename );
extern int boot_root_path ( const char *root_path );
-extern int pxe_menu_boot ( struct net_device *netdev )
- __attribute__ (( weak ));
+extern int pxe_menu_boot ( struct net_device *netdev );
#endif /* _USR_AUTOBOOT_H */
int times_tried;
};
+/**
+ * Detect secure 802.11 network when security support is not available
+ *
+ * @return -ENOTSUP, always.
+ */
+__weak int sec80211_detect ( struct io_buffer *iob __unused,
+ enum net80211_security_proto *secprot __unused,
+ enum net80211_crypto_alg *crypt __unused ) {
+ return -ENOTSUP;
+}
+
/**
* @defgroup net80211_netdev Network device interface functions
* @{
.sa_family = AF_INET,
};
+/**
+ * Get cached DHCPACK where none exists
+ */
+__weak void get_cached_dhcpack ( void ) {}
+
/**
* Start DHCP state machine on a network device
*
/** Shutdown flags for exit */
int shutdown_exit_flags = 0;
+/**
+ * Perform PXE menu boot when PXE stack is not available
+ */
+__weak int pxe_menu_boot ( struct net_device *netdev __unused ) {
+ return -ENOTSUP;
+}
+
/**
* Identify the boot network device
*
buf, sizeof ( buf ) );
pxe_discovery_control =
fetch_uintz_setting ( NULL, &pxe_discovery_control_setting );
- if ( ( strcmp ( buf, "PXEClient" ) == 0 ) && pxe_menu_boot != NULL &&
+ if ( ( strcmp ( buf, "PXEClient" ) == 0 ) &&
setting_exists ( NULL, &pxe_boot_menu_setting ) &&
( ! ( ( pxe_discovery_control & PXEBS_SKIP ) &&
setting_exists ( NULL, &filename_setting ) ) ) ) {