iPXE
Functions | Variables
sync.c File Reference

Wait for pending operations to complete. More...

#include <stddef.h>
#include <ipxe/job.h>
#include <ipxe/monojob.h>
#include <ipxe/pending.h>
#include <usr/sync.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int sync_progress (struct interface *intf, struct job_progress *progress __unused)
 Report progress.
int sync (unsigned long timeout)
 Wait for pending operations to complete.

Variables

static struct interface_operation sync_intf_op []
 Synchroniser interface operations.
static struct interface_descriptor sync_intf_desc
 Synchroniser interface descriptor.
static struct interface sync_intf = INTF_INIT ( sync_intf_desc )
 Synchroniser.

Detailed Description

Wait for pending operations to complete.

Definition in file sync.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int sync_progress ( struct interface intf,
struct job_progress *progress  __unused 
) [static]

Report progress.

Parameters:
intfInterface
progressProgress report to fill in
Return values:
ongoing_rcOngoing job status code (if known)

Definition at line 45 of file sync.c.

References have_pending(), and intf_close().

                                                                    {

        /* Terminate successfully if no pending operations remain */
        if ( ! have_pending() )
                intf_close ( intf, 0 );

        return 0;
}
int sync ( unsigned long  timeout)

Wait for pending operations to complete.

Parameters:
timeoutTimeout period, in ticks (0=indefinite)
Return values:
rcReturn status code

Definition at line 73 of file sync.c.

References intf_plug_plug(), monojob, monojob_wait(), and NULL.

Referenced by falcon_xaui_link_ok(), and sync_exec().

                                   {

        /* Attach synchroniser and wait for completion */
        intf_plug_plug ( &monojob, &sync_intf );
        return monojob_wait ( NULL, timeout );
}

Variable Documentation

struct interface_operation sync_intf_op[] [static]
Initial value:

Synchroniser interface operations.

Definition at line 56 of file sync.c.

Initial value:

Synchroniser interface descriptor.

Definition at line 61 of file sync.c.

Synchroniser.

Definition at line 65 of file sync.c.