Exemple #1
0
EXPORT_C_(void) PADWriteEvent(keyEvent &evt)
{
    // This function call be called before PADopen. Therefore we cann't
    // guarantee that the spin lock was initialized
    if (mutex_WasInit) {
        SPINLOCK(&mutex_KeyEvent);
        ev_fifo.push(evt);
        SPINUNLOCK(&mutex_KeyEvent);
    }
}
Exemple #2
0
void PollForKeyboardInput(int pad)
{
    keyEvent evt;

    // Keyboard input send by PCSX2
    while (!ev_fifo.empty()) {
        SPINLOCK(&mutex_KeyEvent);

        evt = ev_fifo.front();
        // First platform specific functionality. End if handled.
        if (PlatformAnalyzeKeyEvent(evt))
            AnalyzeKeyEvent(pad, evt);
        ev_fifo.pop();

        SPINUNLOCK(&mutex_KeyEvent);
    }

    // keyboard input
#if 0 // TODO OSX similar logic for OSX, check keyboard input from NSAPI or WX or SDL
    while (XPending(GSdsp) > 0)
    {
        XNextEvent(GSdsp, &E);

        // Change the format of the structure to be compatible with GSOpen2
        // mode (event come from pcsx2 not X)
        evt.evt = E.type;
        switch (E.type) {
            case MotionNotify:
                evt.key = (E.xbutton.x & 0xFFFF) | (E.xbutton.y << 16);
                break;
            case ButtonRelease:
            case ButtonPress:
                evt.key = E.xbutton.button;
                break;
            default:
                evt.key = (int)XLookupKeysym(&E.xkey, 0);
        }

        AnalyzeKeyEvent(pad, evt);
    }
#endif
}
Exemple #3
0
void 
vmm_aspace(PROCESS *actprp, PROCESS **pactprp) {
	ADDRESS					*adp;

	if((adp = actprp->memory)) {
		InterruptDisable();
		SPINLOCK(&asid_spin);
		if(adp->cpu.asid > VM_ASID_BOUNDARY) {
			// later move it out for minimize int disable time
			alloc_asid(adp); 
		}
		SPINUNLOCK(&asid_spin);
		smp_tlb_sync(actprp);

		// Set the ASID
		out32(SH_MMR_CCN_PTEH, 
				(in32(SH_MMR_CCN_PTEH) & ~VM_ASID_MASK)  | adp->cpu.asid);
		// Set the page table
		out32(SH_MMR_CCN_TTB, (uintptr_t)adp->cpu.pgdir);
		*pactprp = actprp;

		InterruptEnable();
	}
}
Exemple #4
0
/*
 * unlock
 */
void DT_Mdep_Unlock(DT_Mdep_LockType * lock_ptr)
{
	SPINUNLOCK(lock_ptr);
}