void startup_cpu_idle_loop(void)
{
/* Just some sanity to ensure that the scheduler is set up okay. */
- ASSERT(current->domain->domain_id == IDLE_DOMAIN_ID);
+ ASSERT(is_idle_vcpu(current));
raise_softirq(SCHEDULE_SOFTIRQ);
continue_cpu_idle_loop();
scheduler_init();
idle_vcpu[0] = (struct vcpu*) ia64_r13;
- idle_domain = domain_create(IDLE_DOMAIN_ID, 0, 0);
+ idle_domain = domain_create(DOMID_IDLE, 0, 0);
if ( idle_domain == NULL )
BUG();
idle_domain->vcpu = idle_vcpu;
}
/*
- * addr is hypervisor addr if domid == IDLE_DOMAIN_ID, else it's guest addr
+ * addr is hypervisor addr if domid == DOMID_IDLE, else it's guest addr
* buf is debugger buffer.
* if toaddr, then addr = buf (write to addr), else buf = addr (rd from guest)
* pgd3: value of init_mm.pgd[3] in guest. see above.
uint64_t pgd3)
{
struct domain *dp = get_domain_by_id(domid);
- int hyp = (domid == IDLE_DOMAIN_ID);
+ int hyp = (domid == DOMID_IDLE);
DBGP2("gmem:addr:%lx buf:%p len:$%d domid:%x toaddr:%x dp:%p\n",
addr, buf, len, domid, toaddr, dp);
/* Domain creation requires that scheduler structures are initialised. */
scheduler_init();
- idle_domain = domain_create(IDLE_DOMAIN_ID, 0, 0);
+ idle_domain = domain_create(DOMID_IDLE, 0, 0);
if ( idle_domain == NULL )
BUG();
idle_domain->vcpu = idle_vcpu;
* DOMID_COW is used as the owner of sharable pages */
#define DOMID_COW (0x7FF3U)
-/* DOMID_INVALID is used to identity invalid domid */
-#define DOMID_INVALID (0x7FFFU)
+/* DOMID_INVALID is used to identify pages with unknown owner. */
+#define DOMID_INVALID (0x7FF4U)
+
+/* Idle domain. */
+#define DOMID_IDLE (0x7FFFU)
/*
* Send an array of these to HYPERVISOR_mmu_update().
};
extern struct vcpu *idle_vcpu[NR_CPUS];
-#define IDLE_DOMAIN_ID (0x7FFFU)
-#define is_idle_domain(d) ((d)->domain_id == IDLE_DOMAIN_ID)
+#define is_idle_domain(d) ((d)->domain_id == DOMID_IDLE)
#define is_idle_vcpu(v) (is_idle_domain((v)->domain))
#define DOMAIN_DESTROYED (1<<31) /* assumes atomic_t is >= 32 bits */
dsec->d = d;
- if ( d->domain_id == IDLE_DOMAIN_ID )
+ if ( is_idle_domain(d) )
{
dsec->sid = SECINITSID_XEN;
dsec->create_sid = SECINITSID_DOM0;