The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me understand iPXE code
2013-05-15, 11:24
Post: #1
Help me understand iPXE code
In main.c, it calls initialize() and startup(). Inside each of these functions, it loops through table that contains the registered functions and calls them:

Code:
void startup ( void ) {
    struct startup_fn *startup_fn;

    if ( started )
        return;

    /* Call registered startup functions */
    for_each_table_entry ( startup_fn, STARTUP_FNS ) {
        if ( startup_fn->startup )
            startup_fn->startup();
    }

    started = 1;
}

I don't know where the registered functions are.

STARTUP_FNS:

Code:
#define STARTUP_FNS __table ( struct startup_fn, "startup_fns" )

__table:

Code:
#define __table( type, name ) ( type, name )

__table is the end of what I can look into. The comment says that it "Declare a linker table". But how can it get the functions?

Please help. I really want to understand. Thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Help me understand iPXE code - Rickert - 2013-05-15 11:24



User(s) browsing this thread: 1 Guest(s)