* Private Macros *
**************************************************************************/
-/**
- * Retrieve the idle VCPU for a given physical CPU
- */
+/**
+ * Retrieve the idle VCPU for a given physical CPU
+ */
#define IDLETASK(cpu) (idle_vcpu[cpu])
/**
struct list_head list;
} arinc653_vcpu_t;
-/**
+/**
* The sched_entry_t structure holds a single entry of the
* ARINC 653 schedule.
*/
typedef struct a653sched_priv_s
{
/**
- * This array holds the active ARINC 653 schedule.
- *
+ * This array holds the active ARINC 653 schedule.
+ *
* When the system tries to start a new VCPU, this schedule is scanned
* to look for a matching (handle, VCPU #) pair. If both the handle (UUID)
* and VCPU number match, then the VCPU is allowed to run. Its run time
/**
* This variable holds the number of entries that are valid in
- * the arinc653_schedule table.
- *
+ * the arinc653_schedule table.
+ *
* This is not necessarily the same as the number of domains in the
* schedule. A domain could be listed multiple times within the schedule,
* or a domain with multiple VCPUs could have a different
- * schedule entry for each VCPU.
+ * schedule entry for each VCPU.
*/
int num_schedule_entries;
*/
s_time_t next_major_frame;
- /**
- * pointers to all Xen VCPU structures for iterating through
- */
+ /**
+ * pointers to all Xen VCPU structures for iterating through
+ */
struct list_head vcpu_list;
} a653sched_priv_t;
/**
* This function compares two domain handles.
- *
+ *
* @param h1 Pointer to handle 1
* @param h2 Pointer to handle 2
- *
+ *
* @return <ul>
- * <li> <0: handle 1 is less than handle 2
- * <li> 0: handle 1 is equal to handle 2
- * <li> >0: handle 1 is greater than handle 2
+ * <li> <0: handle 1 is less than handle 2
+ * <li> 0: handle 1 is equal to handle 2
+ * <li> >0: handle 1 is greater than handle 2
* </ul>
*/
static int dom_handle_cmp(const xen_domain_handle_t h1,
/**
* This function searches the vcpu list to find a VCPU that matches
* the domain handle and VCPU ID specified.
- *
+ *
* @param ops Pointer to this instance of the scheduler structure
* @param handle Pointer to handler
* @param vcpu_id VCPU ID
- *
+ *
* @return <ul>
* <li> Pointer to the matching VCPU if one is found
* <li> NULL otherwise
/**
* This function updates the pointer to the Xen VCPU structure for each entry
* in the ARINC 653 schedule.
- *
+ *
* @param ops Pointer to this instance of the scheduler structure
* @return <None>
*/
* in place a new ARINC653 schedule.
*
* @param ops Pointer to this instance of the scheduler structure
- *
+ *
* @return <ul>
* <li> 0 = success
* <li> !0 = error
if ( !found_dom0 )
goto fail;
- /*
+ /*
* Error if the major frame is not large enough to run all entries as
* indicated by comparing the total run time to the major frame length.
- */
+ */
if ( total_runtime > schedule->major_frame )
goto fail;
update_schedule_vcpus(ops);
/*
- * The newly-installed schedule takes effect immediately. We do not even
+ * The newly-installed schedule takes effect immediately. We do not even
* wait for the current major frame to expire.
*
- * Signal a new major frame to begin. The next major frame is set up by
+ * Signal a new major frame to begin. The next major frame is set up by
* the do_schedule callback function when it is next invoked.
*/
sched_priv->next_major_frame = NOW();
/*
* Initialize our ARINC 653 scheduler-specific information for the VCPU.
- * The VCPU starts "asleep." When Xen is ready for the VCPU to run, it
- * will call the vcpu_wake scheduler callback function and our scheduler
+ * The VCPU starts "asleep." When Xen is ready for the VCPU to run, it
+ * will call the vcpu_wake scheduler callback function and our scheduler
* will mark the VCPU awake.
*/
svc->vc = vc;
/**
* Xen scheduler callback function to sleep a VCPU
- *
+ *
* @param ops Pointer to this instance of the scheduler structure
* @param vc Pointer to the VCPU structure for the current domain
*/
/**
* Xen scheduler callback function to wake up a VCPU
- *
+ *
* @param ops Pointer to this instance of the scheduler structure
* @param vc Pointer to the VCPU structure for the current domain
*/
/**
* Xen scheduler callback function to select a VCPU to run.
* This is the main scheduler routine.
- *
+ *
* @param ops Pointer to this instance of the scheduler structure
* @param now Current time
- *
+ *
* @return Address of the VCPU structure scheduled to be run next
* Amount of time to execute the returned VCPU
* Flag for whether the VCPU was migrated
}
}
- /*
+ /*
* If we exhausted the domains in the schedule and still have time left
* in the major frame then switch next at the next major frame.
*/
next_switch_time = sched_priv->next_major_frame;
/*
- * If there are more domains to run in the current major frame, set
- * new_task equal to the address of next domain's VCPU structure.
- * Otherwise, set new_task equal to the address of the idle task's VCPU
- * structure.
+ * If there are more domains to run in the current major frame, set
+ * new_task equal to the address of next domain's VCPU structure.
+ * Otherwise, set new_task equal to the address of the idle task's VCPU
+ * structure.
*/
new_task = (sched_index < sched_priv->num_schedule_entries)
? sched_priv->schedule[sched_index].vc
new_task = IDLETASK(0);
BUG_ON(new_task == NULL);
- /*
+ /*
* Check to make sure we did not miss a major frame.
- * This is a good test for robust partitioning.
- */
+ * This is a good test for robust partitioning.
+ */
BUG_ON(now >= sched_priv->next_major_frame);
/* Tasklet work (which runs in idle VCPU context) overrides all else. */
new_task = IDLETASK(0);
/*
- * Return the amount of time the next domain has to run and the address
- * of the selected task's VCPU structure.
+ * Return the amount of time the next domain has to run and the address
+ * of the selected task's VCPU structure.
*/
ret.time = next_switch_time - now;
ret.task = new_task;
/**
* Xen scheduler callback function to select a CPU for the VCPU to run on
- *
+ *
* @param ops Pointer to this instance of the scheduler structure
* @param v Pointer to the VCPU structure for the current domain
- *
+ *
* @return Number of selected physical CPU
*/
static int
.tick_suspend = NULL,
.tick_resume = NULL,
};
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */