亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产在线精品视频| 看片的网站亚洲| 国产亚洲欧美激情| a级高清视频欧美日韩| 久久99精品久久久久久久久久久久| 亚洲美女在线一区| 日本一区二区三区在线观看| 欧美一卡2卡3卡4卡| 欧美日韩国产一区| 国产精品资源在线观看| 久久99九九99精品| 青青草一区二区三区| 亚洲精品伦理在线| 久久久99精品免费观看不卡| 精品久久久影院| 精品日韩在线一区| 精品成人一区二区三区| 日韩欧美一二三| 日韩免费福利电影在线观看| 欧美一区日本一区韩国一区| 欧美日韩国产在线播放网站| 欧美另类变人与禽xxxxx| 色久优优欧美色久优优| 色婷婷综合久久久久中文一区二区 | 欧美激情在线免费观看| 久久久久久一二三区| 亚洲精品一线二线三线无人区| 制服丝袜亚洲播放| 日韩欧美自拍偷拍| 久久影院视频免费| 国产欧美日韩亚州综合| 国产欧美视频一区二区| 国产精品久久网站| 亚洲日本电影在线| 亚洲国产美女搞黄色| 日韩极品在线观看| 老司机免费视频一区二区三区| 精品捆绑美女sm三区| 久久综合狠狠综合| 国产精品久久久久7777按摩| 亚洲欧美日韩在线| 亚洲三级免费电影| 亚洲第一搞黄网站| 青娱乐精品视频在线| 国产呦精品一区二区三区网站| 国产风韵犹存在线视精品| 亚洲欧美在线高清| 久久久久久久一区| 亚洲精品乱码久久久久久日本蜜臀| 免费看欧美女人艹b| 成人动漫av在线| 欧美乱熟臀69xxxxxx| 国产精品久久久一区麻豆最新章节| 亚洲福利一区二区| 国产很黄免费观看久久| 欧美日韩一区久久| 国产日产精品1区| 日日骚欧美日韩| 暴力调教一区二区三区| 日韩一级片网址| 亚洲视频一区在线| 久久99精品一区二区三区三区| 91久久国产最好的精华液| 久久久综合视频| 午夜精品久久久久久久99樱桃| 成人久久视频在线观看| 日韩午夜三级在线| 亚洲3atv精品一区二区三区| 处破女av一区二区| 欧美第一区第二区| 亚洲国产另类精品专区| 成人黄页毛片网站| 亚洲精品在线免费观看视频| 亚洲成人免费在线| 色一区在线观看| 国产精品三级久久久久三级| 久久精品国产精品亚洲红杏| 欧美天堂一区二区三区| 综合自拍亚洲综合图不卡区| 国产黄色91视频| 精品91自产拍在线观看一区| 亚洲午夜免费福利视频| 色一区在线观看| 综合激情成人伊人| 成年人网站91| 国产精品剧情在线亚洲| 国产九色精品成人porny| 欧美成人一区二区三区在线观看| 亚洲国产精品视频| 色天使色偷偷av一区二区| 国产女人18水真多18精品一级做| 久久成人免费日本黄色| 51午夜精品国产| 调教+趴+乳夹+国产+精品| 色一情一伦一子一伦一区| 亚洲女与黑人做爰| 色诱视频网站一区| 亚洲欧美另类小说| 91麻豆蜜桃一区二区三区| 国产精品电影一区二区| 99麻豆久久久国产精品免费| 国产精品久久久久久久久图文区| 国产成人免费av在线| 国产一区二区视频在线| 精品国精品国产尤物美女| 蜜臀av一区二区三区| 日韩欧美色综合| 久久国产精品免费| wwwwxxxxx欧美| 福利91精品一区二区三区| 国产精品亲子乱子伦xxxx裸| 成人黄色软件下载| 成人免费在线视频观看| av电影天堂一区二区在线| 亚洲女性喷水在线观看一区| 在线影视一区二区三区| 亚洲无线码一区二区三区| 欧美日本一区二区三区四区| 奇米影视一区二区三区小说| 欧美成人三级电影在线| 国内精品国产成人国产三级粉色| 久久久久久久久久看片| 99久久免费精品高清特色大片| 亚洲视频 欧洲视频| 欧美性猛片xxxx免费看久爱| 日精品一区二区| 精品国产一区a| 99久久婷婷国产| 午夜欧美在线一二页| 久久综合网色—综合色88| 成人免费观看av| 亚洲精品国产一区二区精华液 | 亚洲va国产va欧美va观看| 欧美日韩国产综合一区二区三区| 日韩av电影天堂| 久久免费国产精品| 91在线观看一区二区| 亚洲成人7777| 26uuu国产日韩综合| a在线播放不卡| 日本少妇一区二区| 欧美经典三级视频一区二区三区| 一本大道久久精品懂色aⅴ | 欧美午夜一区二区三区免费大片| 三级成人在线视频| 国产精品美女一区二区| 欧美日韩你懂的| 国产99久久久国产精品| 亚洲欧美一区二区久久| 精品国产一区二区精华| 色婷婷精品久久二区二区蜜臂av| 蜜桃久久久久久| 亚洲精品五月天| 久久只精品国产| 在线精品视频免费观看| 国模娜娜一区二区三区| 亚洲一区二区美女| 久久久久久久久伊人| 欧美日韩综合色| 成人av在线播放网站| 美国一区二区三区在线播放| 亚洲视频免费看| 国产欧美一区二区在线| 91精品蜜臀在线一区尤物| 成人免费毛片嘿嘿连载视频| 图片区小说区国产精品视频| 国产嫩草影院久久久久| 日韩欧美中文字幕制服| 在线视频综合导航| 岛国精品在线播放| 美日韩黄色大片| 欧美日韩一区二区在线观看| 国产 欧美在线| 美脚の诱脚舐め脚责91 | 国产日韩欧美不卡在线| 欧美丰满少妇xxxxx高潮对白| 成人av在线网站| 国产精品一二三四五| 麻豆国产精品一区二区三区| 一级女性全黄久久生活片免费| 国产亚洲午夜高清国产拍精品| 正在播放亚洲一区| 欧美影院精品一区| 99vv1com这只有精品| 国产麻豆视频一区| 免费成人在线观看视频| 亚洲网友自拍偷拍| 亚洲免费观看高清完整| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲大片精品永久免费| 亚洲欧美日韩国产综合| 国产精品久久久久久久久久久免费看| 91精品国产高清一区二区三区蜜臀 | 91蝌蚪porny成人天涯| proumb性欧美在线观看| 成人亚洲一区二区一| 国产高清久久久| 国产高清精品网站| 国产传媒日韩欧美成人| 国内精品免费在线观看|