亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cfw.c

?? share-2440 wince5.0 of LCD drivers 源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE. 
Copyright (c) 2001. Samsung Electronics, co. ltd  All rights reserved.
--*/

#include "windows.h"
#include "nkintr.h"
#include "oalintr.h"
#include "shx.h"
#include "p2.h"
#include "p2debug.h"
#include "tchaud.h"
#include "drv_glob.h"
#include <memory.h>
#ifdef MODULE_CERTIFY
#include "key1024.c"    // OEMLoadInit/OEMLoadModule implementation and the public key used for module signature verification.
#endif
//#include "timer.h"
#include <S2440.h>
#include <pehdr.h>
#include <romldr.h>

extern const unsigned short ScreenBitmap[];

/*
    @doc    EXTERNAL KERNEL HAL

    @module cfwp2.c - P2 HW Support | 
        OEM support Functions for the Windows CE P2 Platform.
    
    @xref <f OEMInit> <f OEMInterruptEnable> <f OEMInterruptDisable> 
          <f OEMInterruptDone> <l HAL Overview.Windows CE Kernel OEM Interface>
          
    @topic Windows CE Kernel OEM Interface |
          This defines the HAL layer - OEM and platform dependent pieces of
          code which we expect the OEM to deliver to us. There are three pieces
          of OEM deliverable code  - the bootstrap loader & monitor (for 
          debugging), the HAL portions which are interfaces between the kernel
          and the firmware, and the driver interface. This topic covers just 
          the HAL portion.

          The philosophy is to keep the HAL layer as simple as possible.  The 
          HAL should not be confused with the machine or CPU independence. HAL 
          is specific for a particular CPU and platform. It includes interfaces 
          for the following devices:<nl>
          Real Time Clock<nl>
          Interval Timer (used for the scheduler operation) <nl>
          Interrupt handlers and support <nl>

          Note that it does not include abstractions for devices like the DMA 
          controller etc. since the kernel does not use one. Also note that the
          list could change for different CPU's and platforms - for instance, 
          some chips might include a lot of peripheral devices (like the 
          interval timer) on the CPU chip itself, removing the need for a 
          separate interface for them.

          The interfaces for the real time clock and interval timer are still 
          being developed. But they should in general be extremely simple and
          straightforward. For details on the interrupt support model in the 
          kernel look at <l Interrupt Support Overview.Kernel Interrupt Support>

    @xref <l Interrupt Support Overview.Kernel Interrupt Support>
          <f OEMInit> <f OEMInterruptEnable> <f OEMInterruptDisable> 
          <f OEMInterruptDone> <f HookInterrupt>
             
 */


unsigned long OEMClockFreq;				// OEM clock frequency is used only in OAL

//
// Kernel global variables used by GetIdleTime( ) to determine CPU utilization
//
extern DWORD idleconv; 					// translation constant in 1 ms units
extern DWORD curridlehigh, curridlelow;	// 64-bit idle time in ms

extern int P2ISR();
extern void InitClock();
extern void HalCpuInit();
extern void HalTimerInit();
extern void HalSleep(DWORD);

extern void TIMERINIT();
extern void InitDebugEther(void);

static void InitDisplay(void);
static void OEMInitInterrupts(void);
static void InitSDMMC(void);
#ifdef SHARE_2440_SUPPORT
static void HzhInitPIO(void);
#endif

typedef volatile WORD *PVWORD;    /* pointer to a volatile word */
typedef volatile DWORD *PVDWORD;    /* pointer to a volatile dword */


#define REG(base, id)   (*(PVWORD)((base)+(id)))
#define REG32(base, id)   (*(PVDWORD)((base)+(id)))

#ifdef SHARE_2440_SUPPORT
#define SDIO_FOR_100BD	0//1
#else
#define SDIO_FOR_100BD	0
#endif
/*
#if (CE_MAJOR_VER == 0x0003)
	//Cedar
	// The kernel exports...
	#ifdef AddrCurMSec
		// Some kernels export a pointer to the CurMSec variable.
		static volatile DWORD * pCurMSec  = (volatile DWORD *) AddrCurMSec;
		static volatile DWORD * pDiffMSec = (volatile DWORD *) AddrDiffMSec;
	#else
		extern volatile DWORD CurMSec;
		extern volatile DWORD DiffMSec;
		static volatile DWORD * pCurMSec = &CurMSec;
		static volatile DWORD * pDiffMSec = &DiffMSec;
	#endif

	extern DWORD dwSleepMin;
	extern DWORD dwPartialDiffMSec;
	extern DWORD ticksleft;

#else
// dougfir or later
//
	#ifdef AddrCurMSec
		// Some kernels export a pointer to the CurMSec variable.
		static volatile DWORD * pCurMSec  = (volatile DWORD *) AddrCurMSec;
	#else
		extern volatile DWORD CurMSec;
		static volatile DWORD * pCurMSec = &CurMSec;
	#endif
	
extern DWORD dwReschedTime;
#endif
*/

// dougfir or later
//
	#ifdef AddrCurMSec
		// Some kernels export a pointer to the CurMSec variable.
		static volatile DWORD * pCurMSec  = (volatile DWORD *) AddrCurMSec;
	#else
		extern volatile DWORD CurMSec;
		static volatile DWORD * pCurMSec = &CurMSec;
	#endif
	
extern DWORD dwReschedTime;


extern BOOL fIntrTime;
extern BOOL bProfileTimerRunning;

volatile ULARGE_INTEGER CurTicks = { 0, 0 };
volatile ULARGE_INTEGER * pCurTicks = &CurTicks;

extern DWORD dwReschedIncrement;
extern DWORD OEMCount1ms;
//extern void Camera_Initialize(void);


#define NOT_FIXEDUP		   (DWORD*)-1
DWORD *pdwXIPLoc = NOT_FIXEDUP;
extern  ROMChain_t         *OEMRomChain;

/*
    @func   void | InitRomChain | Collects chain information for all image regions for the kernel.
    @rdesc  N/A.
    @comm    
    @xref   
*/
/*
void InitRomChain(void)
{
	static		ROMChain_t	s_pNextRom[MAX_ROM] = {0};
	DWORD		dwRomCount = 0;
    DWORD       dwChainCount = 0;
    DWORD		*pdwCurXIP;
    DWORD       dwNumXIPs;
    PXIPCHAIN_ENTRY pChainEntry = NULL;

    if(pdwXIPLoc == NOT_FIXEDUP)
	{
        return;  // no chain or not fixed up properly
    }

    // set the top bit to mark it as a virtual address
    pdwCurXIP = (DWORD*)(((DWORD)pdwXIPLoc) | 0x80000000);

    // first DWORD is number of XIPs
    dwNumXIPs = (*pdwCurXIP);

    if(dwNumXIPs > MAX_ROM)
	{
      lpWriteDebugStringFunc(TEXT("ERROR: Number of XIPs exceeds MAX\n"));
      return;
    }

    pChainEntry = (PXIPCHAIN_ENTRY)(pdwCurXIP + 1);

    while(dwChainCount < dwNumXIPs)
    {
        if ((pChainEntry->usFlags & ROMXIP_OK_TO_LOAD) &&  // flags indicates valid XIP
            *(LPDWORD)(((DWORD)(pChainEntry->pvAddr)) + ROM_SIGNATURE_OFFSET) == ROM_SIGNATURE)
        {
            s_pNextRom[dwRomCount].pTOC = *(ROMHDR **)(((DWORD)(pChainEntry->pvAddr)) + ROM_SIGNATURE_OFFSET + 4);
            s_pNextRom[dwRomCount].pNext = NULL;

            if (dwRomCount != 0)
            {
                s_pNextRom[dwRomCount-1].pNext = &s_pNextRom[dwRomCount];
            }
            else
            {
                OEMRomChain = s_pNextRom;
            }
            dwRomCount++;
        }
        else
        {
            lpWriteDebugStringFunc( _T("Invalid XIP found\n") );
        }

        ++pChainEntry;
		dwChainCount++;
	}
}
*/

#define FROM_BCD(n)		((((n) >> 4) * 10) + ((n) & 0xf))


//------------------------------------------------------------------------------
//
//  @func   void | OEMInit | Initialize Hardware Interfaces
//  @rdesc  none
//  @comm   OEMInit is called by the kernel after it has performed minimal
//          initialization. Interrupts are disabled and the kernel is not
//          ready to handle exceptions. The only kernel service available
//          to this function is <f HookInterrupt>. This should be used to 
//          install ISR's for all the hardware interrupts to be handled by
//          the firmware. Note that ISR's must be installed for any interrupt
//          that is to be routed to a device driver - otherwise the 
//          <f InterruptInitialize> call from the driver will fail.
//  @xref   <l Overview.Windows CE Kernel OEM Interface> <f HookInterrupt>
//          <f InterruptInitialize>
//            
//------------------------------------------------------------------------------
void OEMInit()  
{
	volatile IOPreg *s2440IOP = (IOPreg *)IOP_BASE;

	// Instead of calling OEMWriteDebugString directly, call through exported
	// function pointer.  This will allow these messages to be seen if debug
	// message output is redirected to Ethernet or the parallel port.  Otherwise,
	// lpWriteDebugStringFunc == OEMWriteDebugString.
	lpWriteDebugStringFunc(TEXT("\nWindows CE Firmware Init\r\n"));


#ifdef MODULE_CERTIFY
	//
	// Set the module signature verification hooks
	//
	pOEMLoadInit   = OEMLoadInit;
	pOEMLoadModule = OEMLoadModule;
	//
	// Init the signature verification public key
	//
	InitPubKey(g_bSignPublicKeyBlob,sizeof(g_bSignPublicKeyBlob));
#endif

    //
    // Set up translation constant for GetIdleTime() (1 ms units).
    // Note: Since curridlehigh, curridlelow is counting in ms, and GetIdleTime()
    // reports in ms, the conversion ratio is one.  If curridlehigh, curridlelow
    // were using other units (like ticks), then the conversion would be calculated
    // from the clock frequency.
    //
    idleconv = 1;

	// Initialize interrupts.
	//
    lpWriteDebugStringFunc(TEXT("INFO: Initializing system interrupts...\r\n"));
	OEMInitInterrupts();

	// Initialize the system clock(s).
	//
    lpWriteDebugStringFunc(TEXT("INFO: Initializing system clock(s)...\r\n"));
    InitClock();

    // Initialize driver globals area.
	//
    lpWriteDebugStringFunc(TEXT("INFO: Initializing driver globals area...\r\n"));
    memset((PVOID)DRIVER_GLOBALS_ZEROINIT_START, 0, DRIVER_GLOBALS_ZEROINIT_SIZE);
    
    // Initialize S2440X01 LCD controller
	InitDisplay();
#ifdef SHARE_2440_SUPPORT
	HzhInitPIO();
#endif
	
    // Initialize debug Ethernet (KITL) connection.
    //
	// InitDebugEther();	
 
	// Initialize GPIO	/// ;;; SHL
	s2440IOP->rPAD9 = (1<<12) | (0<<11);	// what is rPAD9? 
	//s2440IOP->rGPJCON = 0x016aaaa;
	//s2440IOP->rGPJUP  = ~((0<<12) | (1<<11));

	s2440IOP->rGPHCON = (s2440IOP->rGPHCON & ~(0xf<<18)) | (1<<20) | (1<<18);	// CLKOUT1, CLKOUT0

	s2440IOP->rDSC0 = 0x3ff;
	s2440IOP->rDSC1 = 0x3fffffff;

	// camera
	//Camera_Initialize();
	//s2440IOP->rGPJCON = 0x2aaaaaa;
	//s2440IOP->rGPJUP  = 0x1fff;

	InitSDMMC();

	// Initialize the ROM chain (multi-region).
	//
//	InitRomChain();
	lpWriteDebugStringFunc(TEXT("OEMInit Done...\r\n"));
}


//------------------------------------------------------------------------------
//  
//  @func   BOOL | OEMInterruptEnable | Enable a hardware interrupt
//  @rdesc  Returns TRUE if valid interrupt ID or FALSE if invalid ID.
//  @comm   This function is called by the Kernel when a device driver
//          calls <f InterruptInitialize>. The system is not preemptible when this
//          function is called.
//  @xref   <l Overview.Windows CE Kernel OEM Interface> <f InterruptInitialize>
//  
//------------------------------------------------------------------------------
BOOL 
OEMInterruptEnable(DWORD  idInt,	// @parm Interrupt ID to be enabled. See <l Interrupt ID's.Interrupt ID's>  for a list of possble values.
				   LPVOID pvData,	// @parm ptr to data passed in in the <f InterruptInitialize> call
		           DWORD  cbData)	// @parm Size of data pointed to be <p pvData>
{
	volatile INTreg *s2440INT = (INTreg *)INT_BASE;
	volatile IOPreg *s2440IOP = (IOPreg *)IOP_BASE;
	volatile MMCreg *s2440SDIO = (MMCreg *)MMC_BACE;
	BOOL bRet = TRUE;

	INTERRUPTS_OFF();
	
	switch (idInt) 
	{
	case SYSINTR_VMINI:		// Vmini.
		//return (TRUE);
		break;

	case SYSINTR_BREAK:		// There is no halt button on P2.
		//return(FALSE);
        break;


    case SYSINTR_DMA0:
        s2440INT->rINTMSK &= ~BIT_DMA0; // SDIO DMA interrupt

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久三级国产网站| 色999日韩国产欧美一区二区| 欧美极品美女视频| 欧美日韩精品一区二区在线播放| 成av人片一区二区| 国产成人aaa| 国产精品羞羞答答xxdd| 久久精品国产久精国产| 天天操天天干天天综合网| 亚洲欧洲成人自拍| 中文字幕精品一区二区三区精品| 日韩女优毛片在线| 欧美一级欧美三级| 欧美一区二区黄色| 91精品国产91久久久久久最新毛片 | 爽好久久久欧美精品| 亚洲电影你懂得| 亚洲五月六月丁香激情| 一二三四区精品视频| 伊人色综合久久天天人手人婷| 中文字幕一区二区三区av| 国产精品动漫网站| 一区二区三区国产精品| 亚洲成人自拍偷拍| 日本不卡视频在线| 久久99精品国产麻豆不卡| 久久国产精品第一页| 国内精品久久久久影院薰衣草| 久久97超碰色| 国产+成+人+亚洲欧洲自线| 99热99精品| 91成人免费在线视频| 99久久伊人网影院| a级精品国产片在线观看| 欧美综合色免费| 欧美日韩欧美一区二区| 91精品国产综合久久精品图片| 日韩一区二区三区在线| 久久久www成人免费毛片麻豆 | 日本久久一区二区三区| 欧美丝袜自拍制服另类| 日韩午夜在线观看视频| 国产丝袜在线精品| 亚洲欧美日韩国产手机在线| 无吗不卡中文字幕| 粉嫩13p一区二区三区| 在线精品观看国产| 精品国产凹凸成av人网站| 欧美国产成人精品| 亚洲成人激情av| 国产做a爰片久久毛片| 色综合久久久久| 日韩一区二区三区电影| 中文字幕一区二区三区蜜月 | 色天使色偷偷av一区二区| 欧美日韩国产小视频| 2021中文字幕一区亚洲| 一区二区成人在线| 国产激情偷乱视频一区二区三区| 欧美中文字幕一二三区视频| 久久久久久99精品| 日日夜夜免费精品| 91蝌蚪porny成人天涯| 精品国产乱码久久久久久老虎| ...xxx性欧美| 国模套图日韩精品一区二区| 91成人免费在线| 欧美激情中文字幕一区二区| 日韩国产欧美在线视频| 色综合久久久久综合体桃花网| 久久影视一区二区| 日韩avvvv在线播放| 欧美亚洲国产bt| 国产精品传媒视频| 精品一区在线看| 欧美日韩和欧美的一区二区| 成人免费视频在线观看| 国产乱国产乱300精品| 91精品在线免费观看| 亚洲国产综合在线| 欧美专区亚洲专区| 亚洲乱码中文字幕| 成年人网站91| 国产精品视频九色porn| 国产一区二区三区| 亚洲精品在线一区二区| 免费成人在线视频观看| 欧美日韩不卡一区| 亚洲国产aⅴ天堂久久| 99re在线精品| 中文在线一区二区| 国产aⅴ综合色| 欧美极品aⅴ影院| 成人教育av在线| 国产日韩欧美激情| 国产91在线观看丝袜| 久久久精品黄色| 国产91精品精华液一区二区三区| 久久网站最新地址| 国产乱一区二区| 欧美激情一区在线| 97精品国产露脸对白| 亚洲柠檬福利资源导航| 91一区在线观看| 亚洲精品高清视频在线观看| 欧美午夜一区二区| 亚欧色一区w666天堂| 欧美日韩的一区二区| 日韩精品1区2区3区| 正在播放一区二区| 极品美女销魂一区二区三区| 久久中文娱乐网| 成人手机在线视频| 亚洲精品日产精品乱码不卡| 欧美在线免费视屏| 日本亚洲视频在线| 久久久三级国产网站| 91碰在线视频| 视频一区国产视频| 久久久蜜桃精品| 久久精品999| 国产精品二三区| 欧美电影影音先锋| 国产乱码精品一区二区三区忘忧草| 国产精品毛片久久久久久| 日本大香伊一区二区三区| 石原莉奈一区二区三区在线观看| 日韩欧美你懂的| 成人黄色在线看| 亚洲国产精品久久人人爱蜜臀 | 久久只精品国产| 99久久国产综合精品色伊| 亚洲国产精品一区二区久久恐怖片| 777奇米成人网| 粉嫩av一区二区三区在线播放 | 久久免费的精品国产v∧| 成人国产电影网| 视频在线观看一区| 欧美激情一区二区三区蜜桃视频| 欧美日韩不卡视频| 成人精品在线视频观看| 蜜臀av一区二区在线免费观看 | 日韩欧美一区二区视频| 成人免费三级在线| 午夜久久久久久| 国产精品理论片在线观看| 欧美精品久久天天躁| 成人午夜大片免费观看| 三级在线观看一区二区| 国产精品二区一区二区aⅴ污介绍| 欧美一区二区视频在线观看| fc2成人免费人成在线观看播放 | 欧美日韩国产在线观看| 懂色av中文字幕一区二区三区| 午夜精品福利久久久| 18成人在线观看| 国产亚洲综合性久久久影院| 欧美疯狂性受xxxxx喷水图片| 91美女片黄在线观看91美女| 国产精品一区二区在线观看网站 | 亚洲蜜臀av乱码久久精品蜜桃| 欧美成人精品高清在线播放| 欧美亚洲丝袜传媒另类| 94色蜜桃网一区二区三区| 国产精品自拍av| 亚洲欧美另类小说| 国产精品一区二区久久精品爱涩 | 91精品国产丝袜白色高跟鞋| 91蝌蚪porny九色| 国产成人免费av在线| 美女爽到高潮91| 亚洲国产欧美在线| 亚洲精品免费在线播放| 亚洲人妖av一区二区| 亚洲视频在线一区二区| 中文字幕一区在线观看| 国产精品美女一区二区三区 | 色综合久久66| 99免费精品视频| 91亚洲永久精品| 色综合天天狠狠| 色婷婷亚洲一区二区三区| 色综合天天性综合| 在线观看亚洲精品| 欧美美女直播网站| 69久久99精品久久久久婷婷 | 奇米四色…亚洲| 免费精品视频在线| 久久99热这里只有精品| 国产自产2019最新不卡| 国产白丝精品91爽爽久久| 北条麻妃国产九九精品视频| av激情综合网| 在线免费观看日韩欧美| 欧美日韩精品专区| 26uuuu精品一区二区| 国产精品入口麻豆九色| 国产精品成人午夜| 亚洲精品国产a| 蜜臀av性久久久久av蜜臀妖精|