wince5.0 标准三星BSPOAL详细分析
来源:互联网 发布:南昌泰豪软件 编辑:程序博客网 时间:2024/05/17 04:58
首先看如下函数,是OAL的初始化函数,我看后大吃一惊,因为和4.2升级到5.0的BSP相差太大了。
- //------------------------------------------------------------------------------
- //
- // Function: OEMInit
- //
- // This is Windows CE OAL initialization function. It is called from kernel
- // after basic initialization is made.
- //
- void OEMInit()
- {
- OALMSG(OAL_FUNC, (L"+OEMInit/r/n"));//连串口打印函都变了
- CEProcessorType=PROCESSOR_STRONGARM;
- // Set memory size for DrWatson kernel support
- dwNKDrWatsonSize = 128 * 1024;
- // Initilize cache globals
- OALCacheGlobalsInit();
- OALLogSerial(
- L"DCache: %d sets, %d ways, %d line size, %d size/r/n",
- g_oalCacheInfo.L1DSetsPerWay, g_oalCacheInfo.L1DNumWays,
- g_oalCacheInfo.L1DLineSize, g_oalCacheInfo.L1DSize
- );
- OALLogSerial(
- L"ICache: %d sets, %d ways, %d line size, %d size/r/n",
- g_oalCacheInfo.L1ISetsPerWay, g_oalCacheInfo.L1INumWays,
- g_oalCacheInfo.L1ILineSize, g_oalCacheInfo.L1ISize
- );
- // Initialize interrupts
- if (!OALIntrInit()) {
- OALMSG(OAL_ERROR, (
- L"ERROR: OEMInit: failed to initialize interrupts/r/n"
- ));
- }
- // Initialize system clock
- OALTimerInit(1, 17, 0); //S3C2440A_PCLK/245/16/1000=16.992
- ConfigureGPIO();
- InitDisplay();
- // Initialize the KITL connection if required
- OALKitlStart();
- OALMSG(OAL_FUNC, (L"-OEMInit/r/n"));
- }
再看看这个中断转换函数
- //------------------------------------------------------------------------------
- //
- // Function: OEMInterruptHandler
- //
- ULONG OEMInterruptHandler(ULONG ra)
- {
- UINT32 sysIntr = SYSINTR_NOP;
- UINT32 irq, irq2, mask;
- // Get pending interrupt(s)
- irq = INREG32(&g_pIntrRegs->INTOFFSET);
- // System timer interrupt?
- if (irq == IRQ_TIMER4) {
- // Clear the interrupt
- OUTREG32(&g_pIntrRegs->SRCPND, 1 << IRQ_TIMER4);
- OUTREG32(&g_pIntrRegs->INTPND, 1 << IRQ_TIMER4);
- // Rest is on timer interrupt handler
- sysIntr = OALTimerIntrHandler();
- }
- // Profiling timer interrupt?
- else if (irq == IRQ_TIMER2)
- {
- // Mask and Clear the interrupt.
- mask = 1 << irq;
- SETREG32(&g_pIntrRegs->INTMSK, mask);
- OUTREG32(&g_pIntrRegs->SRCPND, mask);
- OUTREG32(&g_pIntrRegs->INTPND, mask);
- // The rest is up to the profiling interrupt handler (if profiling
- // is enabled).
- //
- if (g_pProfilerISR)
- {
- sysIntr = g_pProfilerISR(ra);
- }
- }
- else
- {
- #ifdef OAL_ILTIMING
- if (g_oalILT.active) {
- g_oalILT.isrTime1 = OALTimerCountsSinceSysTick();
- g_oalILT.savedPC = 0;
- g_oalILT.interrupts++;
- }
- #endif
- if (irq == IRQ_EINT4_7 || irq == IRQ_EINT8_23) { // 4 or 5
- // Find external interrupt number
- mask = INREG32(&g_pPortRegs->EINTPEND);
- mask &= ~INREG32(&g_pPortRegs->EINTMASK);
- mask = (mask ^ (mask - 1)) >> 5;
- irq2 = IRQ_EINT4;
- while (mask != 0) {
- mask >>= 1;
- irq2++;
- }
- // Mask and clear interrupt
- mask = 1 << (irq2 - IRQ_EINT4 + 4);
- SETREG32(&g_pPortRegs->EINTMASK, mask);
- OUTREG32(&g_pPortRegs->EINTPEND, mask);
- // Clear primary interrupt
- mask = 1 << irq;
- OUTREG32(&g_pIntrRegs->SRCPND, mask);
- OUTREG32(&g_pIntrRegs->INTPND, mask);
- // From now we care about this irq
- irq = irq2;
- } else {
- // Mask and clear interrupt
- mask = 1 << irq;
- SETREG32(&g_pIntrRegs->INTMSK, mask);
- OUTREG32(&g_pIntrRegs->SRCPND, mask);
- OUTREG32(&g_pIntrRegs->INTPND, mask);
- }
- // First find if IRQ is claimed by chain
- sysIntr = NKCallIntChain((UCHAR)irq);
- if (sysIntr == SYSINTR_CHAIN || !NKIsSysIntrValid(sysIntr)) {
- // IRQ wasn't claimed, use static mapping
- sysIntr = OALIntrTranslateIrq(irq);
- }
- }
- g_oalLastSysIntr = sysIntr;
- return sysIntr;
- }
- //------------------------------------------------------------------------------
- wince5.0 标准三星BSPOAL详细分析
- 三星2440 wince5.0 nandflash驱动分析
- 标准wince5.0 BSP之SD卡驱动分析
- 标准wince5.0 BSP之SD卡驱动分析
- wince5.0中断分析
- wince5.0中断详细解释
- 三星2440,wince5.0系统睡眠唤醒方式
- Wince5.0 Camera 驱动分析
- Wince5.0 Camera 驱动分析
- wince5.0中断分析--精辟
- wince5.0中断的详细解释
- wince5.0下Camera驱动程序分析
- wince5.0电池驱动样本分析
- wince5.0下S3C2412SD卡驱动分析
- wince5.0下Camera驱动程序分析
- wince5.0的KernelIoControl分析和应用
- wince5.0下Camera驱动程序分析
- wince5.0下Camera驱动程序分析
- 图片验证码的生成
- org.apache.taglibs.standard.tag.rt.core.ForEachTag
- 中兴面试题,数字数组按首位逐列打印
- DSP问答100问
- 生病了,而且病得不轻
- wince5.0 标准三星BSPOAL详细分析
- 开播第一天
- 10月26日
- VC编程技巧整理
- 微软瞄向网页内容安全领域:沙盘技术
- Mastering Web Services Security
- Microsoft Visual C# .NET 2003 Unleashed
- Microsoft SQL Server High Availability
- Project Management: A Systems Approach to Planning, Scheduling, and Controlling