spin_lock_irqsave(&alloc_lock, flags);
/* Find smallest order which can satisfy the request. */
- for ( i = order; i < FREELIST_SIZE; i++ ) {
+ for ( i = order; i < FREELIST_SIZE; i++ )
if ( !FREELIST_EMPTY(i) )
break;
- }
- if ( i == FREELIST_SIZE ) goto no_memory;
+ if ( i == FREELIST_SIZE )
+ goto no_memory;
/* Unlink a chunk. */
alloc_ch = free_head[i];
return((unsigned long)alloc_ch);
no_memory:
+ spin_unlock_irqrestore(&alloc_lock, flags);
+
if ( attempts++ < 8 )
{
- spin_unlock_irqrestore(&alloc_lock, flags);
kmem_cache_reap(0);
goto retry;
}
* these modifications are (C) 2004 Intel Research Cambridge
*/
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
#include <xen/time.h>
#include <xen/sched.h>
#include <xen/sched-if.h>
struct at_dom_info
{
/* MAW Xen additions */
- struct task_struct *owner; /* the struct task_struct this data belongs to */
- struct list_head waitq; /* wait queue */
- int reason; /* reason domain was last scheduled */
+ struct task_struct *owner; /* the task_struct this data belongs to */
+ struct list_head waitq; /* wait queue */
+ int reason; /* reason domain was last scheduled */
/* (what remains of) the original fields */
prev = WAITQ(sdom->processor);
list_for_each(next, WAITQ(sdom->processor))
{
- struct at_dom_info *i = list_entry(next, struct at_dom_info, waitq);
- if( i->deadline > inf->deadline )
+ struct at_dom_info *i =
+ list_entry(next, struct at_dom_info, waitq);
+ if ( i->deadline > inf->deadline )
{
__list_add(&inf->waitq, prev, next);
break;
/* put the domain on the end of the list if it hasn't been put
* elsewhere */
- if ( next == WAITQ(sdom->processor))
+ if ( next == WAITQ(sdom->processor) )
list_add_tail(&inf->waitq, WAITQ(sdom->processor));
}
- else if(sdom->state == TASK_RUNNING)
+ else if ( sdom->state == TASK_RUNNING )
{
/* insert into ordered run queue */
prev = RUNQ(sdom->processor);
cur_sdom->min_slice = newtime - time;
DOM_INFO(cur_sdom)->reason = reason;
- TRACE_2D(0, cur_sdom->domain >> 32, (u32)cur_sdom->domain);
+ TRACE_2D(0, (cur_sdom->domain >> 32), ((u32)cur_sdom->domain));
return ret;
}