亚洲欧美第一页_禁久久精品乱码_粉嫩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:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看av一区二区| 欧美成人精品二区三区99精品| 欧美视频在线一区| 精品国产乱码91久久久久久网站| 樱花草国产18久久久久| 国产一区久久久| 欧美日韩国产大片| 亚洲人成人一区二区在线观看 | 国产一区二区三区在线看麻豆| 91啪在线观看| 国产拍揄自揄精品视频麻豆| 欧美aa在线视频| 欧美制服丝袜第一页| 亚洲高清不卡在线| 色综合视频一区二区三区高清| 欧美精品一区二| 奇米四色…亚洲| 制服丝袜一区二区三区| 一区二区三区在线视频播放| 成人精品免费视频| 国产日韩欧美一区二区三区综合| 激情综合色综合久久综合| 欧美三级午夜理伦三级中视频| 日韩毛片视频在线看| 成人午夜激情视频| 中文字幕不卡在线| 成人av网站在线观看免费| 久久久久久影视| 久久97超碰色| 国产亚洲欧美一级| 国产成人在线影院| 国产日韩欧美高清| 成人97人人超碰人人99| 国产情人综合久久777777| 国产另类ts人妖一区二区| 日韩欧美亚洲国产精品字幕久久久| 日本欧洲一区二区| 日韩一区二区影院| 国内久久婷婷综合| 国产日韩欧美麻豆| 一本一道综合狠狠老| 中文字幕一区二区三区四区不卡| 国产99久久久久| 国产精品久久久久久久久图文区 | 精品91自产拍在线观看一区| 激情另类小说区图片区视频区| 91精品国产美女浴室洗澡无遮挡| 午夜欧美一区二区三区在线播放| 日韩一级完整毛片| 国产福利一区在线观看| 国产精品大尺度| 欧美日韩精品久久久| 国内久久精品视频| 中文字幕日韩精品一区| 欧美天堂一区二区三区| 免费一级片91| 国产精品免费aⅴ片在线观看| 在线区一区二视频| 极品少妇xxxx精品少妇| 亚洲国产精品成人综合| 91成人在线免费观看| 日韩av不卡一区二区| 国产欧美精品国产国产专区| 在线观看国产日韩| 激情成人午夜视频| 亚洲激情成人在线| 欧美tickling网站挠脚心| 成人动漫精品一区二区| 三级成人在线视频| 中文一区一区三区高中清不卡| 欧美午夜精品免费| 国产ts人妖一区二区| 亚洲综合网站在线观看| 久久女同性恋中文字幕| 欧美在线制服丝袜| 成人午夜激情影院| 久久99深爱久久99精品| 亚洲欧美一区二区三区久本道91| 欧美一卡二卡三卡| 在线观看视频一区二区欧美日韩| 国产福利一区二区三区在线视频| 亚洲成在人线在线播放| 亚洲欧洲综合另类在线| 久久美女艺术照精彩视频福利播放| 在线中文字幕一区| 成人高清av在线| 国产一区二区0| 天天综合网 天天综合色| 欧美激情一区二区三区四区| 日韩三级高清在线| 欧美色图天堂网| 99精品国产视频| 国产成人亚洲综合a∨婷婷| 麻豆精品国产传媒mv男同 | 日本久久一区二区| 大白屁股一区二区视频| 国产综合色在线| 美女一区二区三区| 亚州成人在线电影| 一区2区3区在线看| 亚洲免费av高清| 国产精品欧美久久久久无广告 | 狠狠色伊人亚洲综合成人| 日韩经典中文字幕一区| 亚洲午夜成aⅴ人片| 亚洲综合图片区| 夜夜揉揉日日人人青青一国产精品| 国产精品婷婷午夜在线观看| 国产亚洲自拍一区| 国产亚洲精品bt天堂精选| 久久人人97超碰com| 久久综合九色综合97婷婷女人 | 欧美日韩成人一区二区| 精品视频免费在线| 欧美日韩大陆在线| 91精品国产综合久久精品图片 | 在线视频欧美区| 精品视频123区在线观看| 欧美久久久久久蜜桃| 欧美另类久久久品| 欧美videos大乳护士334| 久久久久国产精品麻豆ai换脸 | 日韩影院免费视频| 日韩电影一区二区三区| 日本成人在线电影网| 精品一区二区三区久久| 国产精品一区二区在线观看不卡| 国产精品1区2区| 成人午夜av在线| 欧亚一区二区三区| 欧美一区二区三区视频免费 | 国产成人亚洲综合a∨猫咪| 成人午夜av电影| 色综合久久精品| 欧美日韩精品三区| 日韩你懂的在线观看| 久久九九影视网| 亚洲另类春色国产| 日韩国产在线观看一区| 国产一区二区精品久久| jlzzjlzz欧美大全| 欧美精品国产精品| 亚洲精品一区在线观看| 国产精品国产三级国产| 亚洲成人激情自拍| 国产呦萝稀缺另类资源| 91麻豆免费在线观看| 欧美伦理视频网站| 国产精品福利一区二区三区| 一个色在线综合| 久久66热偷产精品| 91在线视频免费91| 日韩精品一区二区三区蜜臀| 国产精品成人在线观看| 亚洲成av人片一区二区梦乃| 国产福利一区二区三区视频| 欧美亚洲自拍偷拍| 久久久久国产精品免费免费搜索| 亚洲影院在线观看| 国产91精品入口| 在线播放视频一区| 亚洲欧美日韩久久精品| 精品一区在线看| 精品视频999| 亚洲欧美另类久久久精品2019| 精品一区二区三区在线观看国产| 91国内精品野花午夜精品| 久久久精品国产99久久精品芒果| 亚洲国产中文字幕| 9久草视频在线视频精品| 精品国产自在久精品国产| 亚洲午夜免费视频| 成人成人成人在线视频| 欧美岛国在线观看| 日韩—二三区免费观看av| 色综合久久久久综合体 | 日韩一区二区不卡| 亚洲成人777| 色视频欧美一区二区三区| 亚洲国产精品高清| 国产一区二三区好的| 在线综合亚洲欧美在线视频| 一区二区三区精品在线| www.66久久| 国产精品福利电影一区二区三区四区 | 欧美少妇一区二区| 亚洲精品国产品国语在线app| 国产成人高清在线| 国产三级一区二区三区| 黄色日韩网站视频| 久久夜色精品一区| 国产专区欧美精品| 精品av综合导航| 国产又黄又大久久| 国产亚洲一二三区| 成人午夜电影小说| 亚洲免费伊人电影| 欧美在线|欧美| 亚洲高清免费观看| 欧美一级久久久|