⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skyeye_mach_pxa250.c

📁 skyeye-1.2-RC7-3的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
	case ICFP:		data = (pxa250_io.icmr & pxa250_io.icpr) & pxa250_io.iclr;		break;	case ICMR:		data = pxa250_io.icmr;		break;	case ICLR:		data = pxa250_io.iclr;		break;		/* ffuart control */	case FFRBR:		//chy: 2003-08-24 have some question, maybe skyeye will be locked here ????		{			//unsigned char c;			//read(skyeye_config.uart.fd_in, &c, 1);			//data = c;			data = pxa250_io.ffrbr & 0xff;			pxa250_io.icpr &= ~FFUART_IRQ;			pxa250_io.icip &= ~FFUART_IRQ;			pxa250_io.ffiir &= ~0x4;			/*chy 2004-07-21 from lzt, afte read char, should set this bit */			pxa250_io.ffiir |= 0x1;			//printf("SKYEYE: read FFRBR, but set ffiir  and ~04, now %x\n",pxa250_io.ffiir);			pxa250_io.fflsr &= ~0x1;		};		break;	case FFIER:		data = pxa250_io.ffier;		break;	case FFIIR:		//read only		data = pxa250_io.ffiir & 0xcf;		pxa250_io.icpr &= ~FFUART_IRQ;		pxa250_io.icip &= ~FFUART_IRQ;		//printf("SKYEYE: read FFIIR  %x\n",data);		break;	case FFLCR:		data = pxa250_io.fflcr;		break;	case FFLSR:		//read only 		//chy 2003-08-24  NOTICE!		//fixed by ksh 2004-05-09,for FFUART can input char,I am not sure?		//pxa250_io.fflsr=1<<5; // LSR's TDRQ =1 , then the cpu can write char again		pxa250_io.fflsr |= 0x60;	// chy 2003-09-02 for LSR_TEMT|LSR_THRE 0x40|0x20		data = pxa250_io.fflsr & 0xff;		break;		// core clock 	case CCCR:		data = pxa250_io.cccr;		break;	case CKEN:		data = pxa250_io.cken;		break;	case OSCC:		data = pxa250_io.oscc;		break;		//ywc,2004-11-30,add for pxa's LCD simulation#if 0	case LCCR0:		data = pxa250_io.lccr0;		break;	case LCCR1:		data = pxa250_io.lccr1;		break;	case LCCR2:		data = pxa250_io.lccr2;		break;	case LCCR3:		data = pxa250_io.lccr3;		break;	case FDADR0:		data = pxa250_io.fdadr0;		break;	case FDADR1:		data = pxa250_io.fdadr1;		break;	case FSADR0:		data = pxa250_io.fsadr0;		break;	case FSADR1:		data = pxa250_io.fsadr1;		break;#endif		//ywc,2004-11-30,add for pxa's LCD simulation,end#if 0	case FFFCR:		//write only	case FFMCR:		//no use                   	case FFMSR:		//read only no use	case FFSPR:		// no use	case FFISR:		// no use#endif	default:		data = 0;		//chy 2003-09-03 if debug, uncommit it		//log_msg("SKYEYE: pxa250_io_read_word: unknown addr 0x%x, reg15 0x%x \n", addr,state->Reg[15]);	};	return data;};//koodailar add for mingw 2005.12.18 ----------------------------------------#ifdef __MINGW32__static voidpxa250_io_do_cycle (ARMul_State * state){	mingw_start_thread(skyeye_config.uart.fd_in);		 /*RTC*/ if (++pxa250_io.rt_scale >= RT_SCALE) {		pxa250_io.rt_scale = 0;		if (pxa250_io.rt_count++ == (pxa250_io.rttr & 0xffff)) {			pxa250_io.rt_count = 0;			if (pxa250_io.rcnr++ == pxa250_io.rtar) {				if (pxa250_io.rtsr & 0x4) {					pxa250_io.rtsr |= 0x1;				};			}			if (pxa250_io.rtsr & 0x8) {				pxa250_io.rtsr |= 0x2;			}		}		if ((pxa250_io.rtsr & 0x1) && (pxa250_io.rtsr & 0x4))			pxa250_io.icpr |= RTC_ALARM_IRQ;		if ((pxa250_io.rtsr & 0x2) && (pxa250_io.rtsr & 0x8))			pxa250_io.icpr |= RTC_HZ_IRQ;	}	/*OS timer */	if (++pxa250_io.os_scale >= OS_SCALE) {		u32 mask = 0;		u32 count;		pxa250_io.os_scale = 0;		count = pxa250_io.oscr++;		if (count == pxa250_io.osmr0)			mask = 1;		if (count == pxa250_io.osmr1)			mask |= 0x2;		if (count == pxa250_io.osmr2)			mask |= 0x4;		if (count == pxa250_io.osmr3) {			mask |= 0x8;			if (pxa250_io.ower & 1) {				state->NresetSig = LOW;				printf ("************SKYEYE: WatchDog reset!!!!!!!**************\n");			}		}		pxa250_io.ossr |= mask;		mask = pxa250_io.oier & pxa250_io.ossr;		pxa250_io.icpr |= (mask << OS_IRQ_SHF);	}	/*FF UART */	//pxa250_io.utsr0 = 1; /*always TFS, no others*/	//pxa250_io.utsr1 = 0x4; /*TNF*/	if (++pxa250_io.ff_scale >= FF_SCALE) {		pxa250_io.ff_scale = 0;		if (!(FFUART_IRQ & pxa250_io.icpr)) {					if (SDL_SemTryWait(get_mingw_read_sem())==0) 		{	  	if(get_mingw_sem_first_time() != 1 && get_mingw_readed() == 1)			{ 				//pxa250_io.utsr1 |= 0x2;  //RNE				//pxa250_io.utsr0 |= 0x4; //Rx idle				//added by ksh,2004-4-25,get uart data and  set the interrupt				unsigned char c;					c = get_mingw_char_read();					set_mingw_readed(0);				pxa250_io.ffrbr = (int) c;				pxa250_io.ffiir |= 0x4;	//Rx idle				//printf("SKYEYE: io_do_cycle  set ffiir  or 04, now %x\n",pxa250_io.ffiir);				pxa250_io.fflsr |= 0x01;	//Data ready			}			SDL_SemPost(get_mingw_read_sem());      printf(" \b");			fflush(stdout);		}					if ((pxa250_io.ffier & 0x1)			    && (pxa250_io.ffiir & 0x4)) {				pxa250_io.icpr |= FFUART_IRQ;				pxa250_io.ffiir &= ~0x1;			}			/*chy 2004-07-21 from luzhetao: produce a IRQ and ox2 should clean by OS driver */			if (pxa250_io.ffier & 0x2) {				pxa250_io.icpr |= FFUART_IRQ;				pxa250_io.ffiir |= 0x2;				pxa250_io.ffiir &= ~0x1;				pxa250_io.fflsr |= 0x60;			}		}		//ywc,2004-11-30,check and get the mouse event#ifndef NO_LCD		if (!(pxa250_io.icpr & pxa250_io.ts_int)) {	//if now has no ts interrupt,then query 			if (Pen_buffer[6] == 1) {	//should trigger a interrupt				*(pxa250_io.ts_buffer + 0) = Pen_buffer[0];				*(pxa250_io.ts_buffer + 1) = Pen_buffer[1];				*(pxa250_io.ts_buffer + 4) = Pen_buffer[4];				*(pxa250_io.ts_buffer + 6) = Pen_buffer[6];				//set EINT2 bit to trigger a interrupt,ts driver will clear it				pxa250_io.icpr |= pxa250_io.ts_int;				Pen_buffer[6] = 0;			}		}#endif		//ywc,2004-11-30,check and get the mouse event,end	}	pxa250_update_int (state);	/*reset interrupt pin status */	//refresh_irq (state);};#elsestatic voidpxa250_io_do_cycle (ARMul_State * state){		 /*RTC*/ if (++pxa250_io.rt_scale >= RT_SCALE) {		pxa250_io.rt_scale = 0;		if (pxa250_io.rt_count++ == (pxa250_io.rttr & 0xffff)) {			pxa250_io.rt_count = 0;			if (pxa250_io.rcnr++ == pxa250_io.rtar) {				if (pxa250_io.rtsr & 0x4) {					pxa250_io.rtsr |= 0x1;				};			}			if (pxa250_io.rtsr & 0x8) {				pxa250_io.rtsr |= 0x2;			}		}		if ((pxa250_io.rtsr & 0x1) && (pxa250_io.rtsr & 0x4))			pxa250_io.icpr |= RTC_ALARM_IRQ;		if ((pxa250_io.rtsr & 0x2) && (pxa250_io.rtsr & 0x8))			pxa250_io.icpr |= RTC_HZ_IRQ;	}	/*OS timer */	if (++pxa250_io.os_scale >= OS_SCALE) {		u32 mask = 0;		u32 count;		pxa250_io.os_scale = 0;		count = pxa250_io.oscr++;		if (count == pxa250_io.osmr0)			mask = 1;		if (count == pxa250_io.osmr1)			mask |= 0x2;		if (count == pxa250_io.osmr2)			mask |= 0x4;		if (count == pxa250_io.osmr3) {			mask |= 0x8;			if (pxa250_io.ower & 1) {				state->NresetSig = LOW;				printf ("************SKYEYE: WatchDog reset!!!!!!!**************\n");			}		}		pxa250_io.ossr |= mask;		mask = pxa250_io.oier & pxa250_io.ossr;		pxa250_io.icpr |= (mask << OS_IRQ_SHF);	}	/*FF UART */	//pxa250_io.utsr0 = 1; /*always TFS, no others*/	//pxa250_io.utsr1 = 0x4; /*TNF*/	if (++pxa250_io.ff_scale >= FF_SCALE) {		pxa250_io.ff_scale = 0;		if (!(FFUART_IRQ & pxa250_io.icpr)) {			fd_set rset;			struct timeval tv;			FD_ZERO (&rset);			FD_SET (0, &rset);			tv.tv_sec = 0;			tv.tv_usec = 0;			if (select (1, &rset, NULL, NULL, &tv) == 1) {				//pxa250_io.utsr1 |= 0x2;  //RNE				//pxa250_io.utsr0 |= 0x4; //Rx idle				//added by ksh,2004-4-25,get uart data and  set the interrupt				unsigned char c;				read (skyeye_config.uart.fd_in, &c, 1);				pxa250_io.ffrbr = (int) c;				pxa250_io.ffiir |= 0x4;	//Rx idle				//printf("SKYEYE: io_do_cycle  set ffiir  or 04, now %x\n",pxa250_io.ffiir);				pxa250_io.fflsr |= 0x01;	//Data ready			}			if ((pxa250_io.ffier & 0x1)			    && (pxa250_io.ffiir & 0x4)) {				pxa250_io.icpr |= FFUART_IRQ;				pxa250_io.ffiir &= ~0x1;			}			/*chy 2004-07-21 from luzhetao: produce a IRQ and ox2 should clean by OS driver */			if (pxa250_io.ffier & 0x2) {				pxa250_io.icpr |= FFUART_IRQ;				pxa250_io.ffiir |= 0x2;				pxa250_io.ffiir &= ~0x1;				pxa250_io.fflsr |= 0x60;			}		}		//ywc,2004-11-30,check and get the mouse event#ifndef NO_LCD		if (!(pxa250_io.icpr & pxa250_io.ts_int)) {	//if now has no ts interrupt,then query 			if (Pen_buffer[6] == 1) {	//should trigger a interrupt				*(pxa250_io.ts_buffer + 0) = Pen_buffer[0];				*(pxa250_io.ts_buffer + 1) = Pen_buffer[1];				*(pxa250_io.ts_buffer + 4) = Pen_buffer[4];				*(pxa250_io.ts_buffer + 6) = Pen_buffer[6];				//set EINT2 bit to trigger a interrupt,ts driver will clear it				pxa250_io.icpr |= pxa250_io.ts_int;				Pen_buffer[6] = 0;			}		}#endif		//ywc,2004-11-30,check and get the mouse event,end	}	pxa250_update_int (state);	/*reset interrupt pin status */	//refresh_irq (state);};	#endif// end ----------------------------------------------------------------------		voidpxa250_mach_init (ARMul_State * state, machine_config_t * mc){	//chy 2003-08-19, setprocessor	ARMul_SelectProcessor (state,			       ARM_XScale_Prop | ARM_v5_Prop | ARM_v5e_Prop);	//chy 2004-05-09, set lateabtSig	state->lateabtSig = LOW;	state->Reg[1] = 89;	/*lubbock machine id. */	pxa250_io_reset ();	/*added by ksh for energy estimation in 2004-11-26 */	state->energy.cccr = pxa250_io.cccr;	mc->mach_io_do_cycle = pxa250_io_do_cycle;	mc->mach_io_reset = pxa250_io_reset;	mc->mach_io_read_byte = pxa250_io_read_byte;	mc->mach_io_write_byte = pxa250_io_write_byte;	mc->mach_io_read_halfword = pxa250_io_read_halfword;	mc->mach_io_write_halfword = pxa250_io_write_halfword;	mc->mach_io_read_word = pxa250_io_read_word;	mc->mach_io_write_word = pxa250_io_write_word;	mc->mach_set_intr = pxa_set_intr;	mc->mach_pending_intr = pxa_pending_intr;	mc->mach_update_intr = pxa_update_intr;	mc->state = (void *) state;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -