Example #1
0
int
osi_VMDirty_p(struct vcache *avc)
{
    int dirtyPages;

    if (avc->execsOrWriters <= 0)
	return 0;		/* can't be many dirty pages here, I guess */

#if defined (AFS_AIX32_ENV)
#ifdef	notdef
    /* because of the level of hardware involvment with VM and all the
     * warnings about "This routine must be called at VMM interrupt
     * level", I thought it would be safest to disable interrupts while
     * looking at the software page fault table.  */

    /* convert vm handle into index into array:  I think that stoinio is
     * always zero...  Look into this XXX  */
#define VMHASH(handle) ( \
			( ((handle) & ~vmker.stoinio)  \
			 ^ ((((handle) & ~vmker.stoinio) & vmker.stoimask) << vmker.stoihash) \
			 ) & 0x000fffff)

    if (avc->segid) {
	unsigned int pagef, pri, index, next;

	index = VMHASH(avc->segid);
	if (scb_valid(index)) {	/* could almost be an ASSERT */

	    pri = disable_ints();
	    for (pagef = scb_sidlist(index); pagef >= 0; pagef = next) {
		next = pft_sidfwd(pagef);
		if (pft_modbit(pagef)) {	/* has page frame been modified? */
		    enable_ints(pri);
		    return 1;
		}
	    }
	    enable_ints(pri);
	}
    }
#undef VMHASH
#endif
#endif /* AFS_AIX32_ENV */

#if defined (AFS_SUN5_ENV)
    if (avc->f.states & CMAPPED) {
	struct page *pg;
	for (pg = avc->v.v_s.v_Pages; pg; pg = pg->p_vpnext) {
	    if (pg->p_mod) {
		return 1;
	    }
	}
    }
#endif
    return 0;
}
Example #2
0
void mutex_wait(mutex_t *mutex)
{
	disable_ints();

	enable_kernel_preempt();

	enable_ints();
}
Example #3
0
int main()
{
/*	const extern u32 _KERNEL_START[],_KERNEL_END[];
	const extern u32 K_CODE_SEL[], K_DATA_SEL[];
	const extern u32 _KERNEL_TEXT_START[],_KERNEL_TEXT_END[];
	const extern u32 _KERNEL_DATA_START[],_KERNEL_DATA_END[];
	const extern u32 _KERNEL_BSS_START[],_KERNEL_BSS_END[]; */

	tty_cls();

	banner();

	/*if(TEST_BIT(K_MULTIBOOT_INFO->flags,MBI_FLAGS_MMAP)){
		kprintf("MMAP Present: 0x%x\n",K_MULTIBOOT_INFO->mmap_addr);

		memory_map_t *mmap;
		for(mmap=(memory_map_t *)K_MULTIBOOT_INFO->mmap_addr;
			(u32)mmap<K_MULTIBOOT_INFO->mmap_addr + K_MULTIBOOT_INFO->mmap_length;
			mmap=(memory_map_t *)((u32)mmap+mmap->size+sizeof(mmap->size))){
			kprintf("[%d] addr=0x%x-0x%x\n",mmap->type,mmap->base_addr_low,(mmap->base_addr_low+mmap->length_low));

		}
	}*/

	kprintf(" > Initialising system services...\n");
	init_interrupts();
	init_paging();
	init_heap();
	set_cpu_caps();
	init_pic();
	init_timer();
	init_process();

	kprintf(" > Enabling kernel preemption...\n");
	enable_kernel_preempt();
	enable_ints();
	
	kprintf(" > Spawning core process...\n");

	create_process("core",NULL,&core);


	/* We may get to here for a very short amount of time while we enable preemption */
	while(1);
}