unistd.h File Reference

#include <stddef.h>
#include <stdarg.h>
#include <gpxe/timer.h>

Go to the source code of this file.

Defines

#define execl(command, arg,...)
 Execute command.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
int execv (const char *command, char *const argv[])
 Execute command.
unsigned int sleep (unsigned int seconds)
 Delay for a fixed number of seconds.
void mdelay (unsigned long msecs)
 Delay for a fixed number of milliseconds.
static __always_inline void usleep (unsigned long usecs)


Define Documentation

#define execl ( command,
arg,
...   ) 

Value:

( {                                     \
                char * const argv[] = { (arg), ## __VA_ARGS__ };        \
                int rc = execv ( (command), argv );                     \
                rc;                                                     \
        } )
Execute command.

Parameters:
command Command name
arg ... Argument list (starting with argv[0])
Return values:
rc Command exit status
This is a front end to execv().

Definition at line 20 of file unistd.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

int execv ( const char *  command,
char *const   argv[] 
)

Execute command.

Parameters:
command Command name
argv Argument list
Return values:
rc Command exit status
Execute the named command. Unlike a traditional POSIX execv(), this function returns the exit status of the command.

Definition at line 54 of file exec.c.

References COMMANDS, DBG, EINVAL, ENOEXEC, command::exec, for_each_table_entry, command::name, printf(), reset_getopt(), and strcmp().

Referenced by system(), and time_exec().

00054                                                        {
00055         struct command *cmd;
00056         int argc;
00057 
00058         /* Count number of arguments */
00059         for ( argc = 0 ; argv[argc] ; argc++ ) {}
00060 
00061         /* Sanity checks */
00062         if ( ! command ) {
00063                 DBG ( "No command\n" );
00064                 return -EINVAL;
00065         }
00066         if ( ! argc ) {
00067                 DBG ( "%s: empty argument list\n", command );
00068                 return -EINVAL;
00069         }
00070 
00071         /* Reset getopt() library ready for use by the command.  This
00072          * is an artefact of the POSIX getopt() API within the context
00073          * of Etherboot; see the documentation for reset_getopt() for
00074          * details.
00075          */
00076         reset_getopt();
00077 
00078         /* Hand off to command implementation */
00079         for_each_table_entry ( cmd, COMMANDS ) {
00080                 if ( strcmp ( command, cmd->name ) == 0 )
00081                         return cmd->exec ( argc, ( char ** ) argv );
00082         }
00083 
00084         printf ( "%s: command not found\n", command );
00085         return -ENOEXEC;
00086 }

unsigned int sleep ( unsigned int  secs  ) 

Delay for a fixed number of seconds.

Parameters:
secs Number of seconds for which to delay

Definition at line 38 of file timer.c.

References mdelay().

Referenced by efab_init_mac(), t509_enable(), and valert().

00038                                          {
00039         while ( secs-- )
00040                 mdelay ( 1000 );
00041         return 0;
00042 }

void mdelay ( unsigned long  msecs  ) 

Delay for a fixed number of milliseconds.

Parameters:
msecs Number of milliseconds for which to delay

Definition at line 28 of file timer.c.

References udelay().

Referenced by __mdio_cmd(), _wgetc(), amd8111e_wait_tx_ring(), arbel_cmd_wait(), ath5k_hw_attach(), ath5k_hw_nic_wakeup(), ath5k_hw_noise_floor_calibration(), ath5k_hw_radio_revision(), ath5k_hw_reset(), ath5k_hw_rf5110_calibrate(), ath5k_hw_rf5110_channel(), atl1e_down(), atl1e_get_permanent_address(), atl1e_phy_commit(), atl1e_phy_init(), atl1e_reset_hw(), atl1e_setup_pcicmd(), bnx2_fw_sync(), bnx2_probe(), bnx2_reset_chip(), bnx2_set_power_state_0(), bnx2_transmit(), dmfe_init_dm910x(), e1000_configure_rx(), e1000e_acquire_swflag_ich8lan(), e1000e_acquire_swfw_sync_80003es2lan(), e1000e_configure_rx(), e1000e_configure_tx(), e1000e_get_cfg_done(), e1000e_kmrn_lock_loss_workaround_ich8lan(), e1000e_phy_has_link_generic(), efi_ticks_per_sec(), falcon_fini_resources(), falcon_init_sram(), falcon_init_xmac(), falcon_reset(), falcon_tenxpress_phy_init(), hermon_cmd_wait(), hermon_reset(), ifec_net_open(), iflinkwait(), igb_configure_rx(), igb_configure_tx(), linda_trim_ib(), mdio_clause45_reset_mmd(), mdio_clause45_wait_reset_mmds(), mtnic_alloc_eq(), mtnic_close(), mtnic_cmd(), mtnic_disable(), mtnic_open(), mtnic_probe(), mtnic_query_offsets(), mtnic_transmit(), pci_set_power_state(), phantom_clp_wait(), phantom_init_cmdpeg(), phantom_init_rcvpeg(), phantom_read_test_mem_block(), phantom_wait_for_cmd(), phy_reset(), rhine_probe1(), rtl8169_phy_reset(), rtl818x_init_hw(), rtl8225_rf_init(), rtl8225_rf_set_channel(), rtl8225_rf_set_tx_power(), rtl8225_rf_stop(), rtl8225x_rf_init(), rtl8225z2_rf_init(), rtl8225z2_rf_set_tx_power(), rtl_reset(), rtl_soft_reset(), serial_putc(), sfe4001_init(), shell_banner(), sis190_phy_task(), sis190_read_eeprom(), sleep(), smc_phy_configure(), tg3_nvram_init(), tg3_probe(), tg3_setup_fiber_phy(), tg3_transmit(), threewire_write(), TLan_FinishReset(), TLan_PhyFinishAutoNeg(), TLan_PhyPowerDown(), TLan_PhyPowerUp(), TLan_PhyReset(), TLan_PhyStartLink(), update_linkspeed(), velocity_init_registers(), velocity_soft_reset(), write_grf5101(), write_max2820(), and write_sa2400().

00028                                     {
00029         while ( msecs-- )
00030                 udelay ( 1000 );
00031 }

static __always_inline void usleep ( unsigned long  usecs  )  [inline, static]

Definition at line 39 of file unistd.h.

References udelay().

00039                                                                   {
00040         udelay ( usecs );
00041 }


Generated on Tue Apr 6 20:01:53 2010 for gPXE by  doxygen 1.5.7.1