// 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();
// Mask and clear all interrupts.
//
s2440INT->rINTMSK = BIT_ALLMSK; // Mask all interrupts (reset value).
s2440INT->rINTMSK &= ~BIT_BAT_FLT;
s2440INT->rSRCPND = BIT_ALLMSK; // Clear pending interrupts.
s2440INT->rINTPND = s2440INT->rINTPND; // S3C2440X developer notice (page 4) warns against writing a 1 to any
// 0 bit field in the INTPND register. Instead we'll write the INTPND value itself.
}