⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootinit.c

📁 ixp2400 bsp for vxworks
💻 C
📖 第 1 页 / 共 2 页
字号:
           ((UINT *)((UINT)ROM_TEXT_ADRS + ((UINT)BINARRAYEND_ROUNDOFF -           (UINT)romInit)), (UINT *)BINARRAYEND_ROUNDOFF,           ((UINT)wrs_kernel_data_end - (UINT)binArrayEnd) / sizeof (long));#endif /*ixp2400*/#endif	/* CPU_FAMILY == MIPS */#endif	/* UNCOMPRESS */#endif	/* ROM_RESIDENT */#if	(CPU_FAMILY != MIPS) && (!defined (BOOTCODE_IN_RAM))    /* clear all memory if cold booting */    if (startType & BOOT_CLEAR)	{#ifdef ROM_RESIDENT	/* Clear memory not loaded with text & data.	 *	 * We are careful about initializing all memory (except	 * STACK_SAVE bytes) due to parity error generation (on	 * some hardware) at a later stage.  This is usually	 * caused by read accesses without initialization.	 */	fillLongs ((UINT *)SYS_MEM_BOTTOM,		((UINT) RESIDENT_DATA - STACK_SAVE - (UINT)SYS_MEM_BOTTOM)		/ sizeof(long), 0);	fillLongs (((UINT *) wrs_kernel_data_end),	((UINT)SYS_MEM_TOP - ((UINT) wrs_kernel_data_end)) / sizeof(long), 0);#else	/* ROM_RESIDENT */#if defined(IXP2400){        if((*(volatile unsigned int *)(IXP2400_STRAP_OPTIONS) & CFG_PROM_BOOT) ) /*master*/        {                if(!(startType & BOOT_THRU_BM))                {                        fillLongs ((UINT *)((UINT)romInit + ROM_COPY_SIZE),                                ((UINT)SYS_MEM_TOP - ((UINT)romInit + ROM_COPY_SIZE))                                / sizeof(long), 0);                }        }}#else /*IXP2400*/        fillLongs ((UINT *)(SYS_MEM_BOTTOM),                ((UINT)romInit - STACK_SAVE - (UINT)SYS_MEM_BOTTOM) /                sizeof(long), 0);#endif /*IXP2400*/#if     defined (UNCOMPRESS)#if defined(IXP2400){        if((*(volatile unsigned int *)(IXP2400_STRAP_OPTIONS) & CFG_PROM_BOOT) ) /*master*/        {                if(!(startType & BOOT_THRU_BM))                {                        fillLongs ((UINT *)((UINT)romInit + ROM_COPY_SIZE),                                ((UINT)SYS_MEM_TOP - ((UINT)romInit + ROM_COPY_SIZE))                                / sizeof(long), 0);                }        }}#else /*ixp2400*/        fillLongs ((UINT *)((UINT)romInit + ROM_COPY_SIZE),                    ((UINT)SYS_MEM_TOP - ((UINT)romInit + ROM_COPY_SIZE))                    / sizeof(long), 0);#endif/*ixp2400*/#else#if defined(IXP2400){        if((*(volatile unsigned int *)(IXP2400_STRAP_OPTIONS) & CFG_PROM_BOOT) ) /*master*/        {                if(!(startType & BOOT_THRU_BM))                {                        fillLongs ((UINT *)wrs_kernel_data_end,                                ((UINT)SYS_MEM_TOP - (UINT)wrs_kernel_data_end) / sizeof (long), 0);                }        }}#else /*ixp2400*/        fillLongs ((UINT *)wrs_kernel_data_end,                ((UINT)SYS_MEM_TOP - (UINT)wrs_kernel_data_end) / sizeof (long), 0);#endif /*ixp2400*/#endif 	/* UNCOMPRESS */#endif 	/* ROM_RESIDENT */	/* 	 * Ensure the boot line is null. This is necessary for those	 * targets whose boot line is excluded from cleaning.	 */	*(BOOT_LINE_ADRS) = EOS;	}#endif	/* (CPU_FAMILY != MIPS) && (!defined (BOOTCODE_IN_RAM)) */    /* jump to VxWorks entry point (after uncompressing) */#if	defined (UNCOMPRESS) || defined (ROM_RESIDENT)#if	(CPU_FAMILY == I960)    absEntry = (FUNCPTR)sysInitAlt;			/* reinit proc tbl */#else    absEntry = (FUNCPTR)usrInit;			/* on to bootConfig */#endif	/* CPU_FAMILY == I960 */#else    {#if	(CPU_FAMILY == MIPS)    volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN;    if ((absUncompress) ((UCHAR *)ROM_OFFSET(binArrayStart),			 (UCHAR *)K0_TO_K1(RAM_DST_ADRS),			 (int)((UINT)binArrayEnd - (UINT)binArrayStart)) != OK)#elif	(CPU_FAMILY == I80X86) || (CPU_FAMILY == ARM)#if defined(IXP2400){                volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN;                if((*(volatile unsigned int *)(IXP2400_STRAP_OPTIONS) & CFG_PROM_BOOT) ) /*master*/                {                        if(!(startType & BOOT_THRU_BM))                        {                                if ((absUncompress) ((UCHAR *)ROM_OFFSET(binArrayStart),                                        (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)                                {                                        return;                                }                                absEntry = (FUNCPTR)RAM_DST_ADRS;                       /* compressedEntry () */                                absEntry = (FUNCPTR)((UINT32)absEntry | 1);             /* force Thumb state */                                (absEntry) (startType);                        }                        else /*if Thru BM*/                        {                                if(!(startType & BOOTROM_THRU_BM))                                {                                        if ((absUncompress) ((UCHAR *)(binArrayStart),                                                (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)                                                return;                                        absEntry = (FUNCPTR)RAM_DST_ADRS;                       /* compressedEntry () */                                        absEntry = (FUNCPTR)((UINT32)absEntry | 1);             /* force Thumb state */                                        (absEntry) (startType);                                }                                else /*if bootrom booting thru BM*/                                {                                        if ((absUncompress) ((UCHAR *)ROM_OFFSET_BM(binArrayStart),                                                (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)                                                return;                                        absEntry = (FUNCPTR)RAM_DST_ADRS;                       /* compressedEntry () */                                        absEntry = (FUNCPTR)((UINT32)absEntry | 1);            /* force Thumb state */                                        (absEntry) (startType);                                }                        }                }                else                {                        if ((absUncompress) ((UCHAR *)(binArrayStart),                                (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)                                return;                        absEntry = (FUNCPTR)RAM_DST_ADRS;                       /* compressedEntry () */                        absEntry = (FUNCPTR)((UINT32)absEntry | 1);             /* force Thumb state */                        (absEntry) (startType);                }        }        }#else /*ixp2400*/    volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN;    if ((absUncompress) ((UCHAR *)ROM_OFFSET(binArrayStart),                    (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)#endif /*ixp2400*/#else    if (UNCMP_RTN ((UCHAR *)ROM_OFFSET(binArrayStart),	            (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)#endif	/* (CPU_FAMILY == MIPS) */	return;		/* if we return then ROM's will halt */    absEntry = (FUNCPTR)RAM_DST_ADRS;			/* compressedEntry () */    }#endif	/* defined UNCOMPRESS || defined ROM_RESIDENT */#if	((CPU_FAMILY == ARM) && ARM_THUMB)    absEntry = (FUNCPTR)((UINT32)absEntry | 1);		/* force Thumb state */#endif	/* CPU_FAMILY == ARM */    (absEntry) (startType);    }#if     (CPU_FAMILY==ARM) && (!defined(ROM_RESIDENT))#undef fillLongs#endif  /* (CPU_FAMILY==ARM) */#if (CPU_FAMILY==MC680X0) && !defined(ROM_RESIDENT) && !defined(BOOTCODE_IN_RAM)#undef copyLongs	/* undo effects from above define */#endif /* CPU_FAMILY==MC680X0 *//********************************************************************************* copyLongs - copy one buffer to another a long at a time** This routine copies the first <nlongs> longs from <source> to <destination>.*/LOCAL void copyLongs (source, destination, nlongs)    FAST UINT *source;		/* pointer to source buffer      */    FAST UINT *destination;	/* pointer to destination buffer */    UINT nlongs;		/* number of longs to copy       */    {    FAST UINT *dstend = destination + nlongs;    FAST UINT nchunks;    /* Hop by chunks of longs, for speed. */    for (nchunks = nlongs / 8; nchunks; --nchunks)	{#if (CPU_FAMILY == MC680X0)	*destination++ = *source++;	/* 0 */	*destination++ = *source++;	/* 1 */	*destination++ = *source++;	/* 2 */	*destination++ = *source++;	/* 3 */	*destination++ = *source++;	/* 4 */	*destination++ = *source++;	/* 5 */	*destination++ = *source++;	/* 6 */	*destination++ = *source++;	/* 7 */#else	destination[0] = source[0];	destination[1] = source[1];	destination[2] = source[2];	destination[3] = source[3];	destination[4] = source[4];	destination[5] = source[5];	destination[6] = source[6];	destination[7] = source[7];	destination += 8, source += 8;#endif /* CPU_FAMILY == MC680X0 */	}    /* Do the remainder one long at a time. */    while (destination < dstend)	*destination++ = *source++;    }#ifndef	BOOTCODE_IN_RAM/********************************************************************************* fillLongs - fill a buffer with a value a long at a time** This routine fills the first <nlongs> longs of the buffer with <val>.*/LOCAL void fillLongs (buf, nlongs, val)    FAST UINT *buf;	/* pointer to buffer              */    UINT nlongs;	/* number of longs to fill        */    FAST UINT val;	/* char with which to fill buffer */    {    FAST UINT *bufend = buf + nlongs;    FAST UINT nchunks;    /* Hop by chunks of longs, for speed. */    for (nchunks = nlongs / 8; nchunks; --nchunks)	{#if (CPU_FAMILY == MC680X0)	*buf++ = val;	/* 0 */	*buf++ = val;	/* 1 */	*buf++ = val;	/* 2 */	*buf++ = val;	/* 3 */	*buf++ = val;	/* 4 */	*buf++ = val;	/* 5 */	*buf++ = val;	/* 6 */	*buf++ = val;	/* 7 */#else	buf[0] = val;	buf[1] = val;	buf[2] = val;	buf[3] = val;	buf[4] = val;	buf[5] = val;	buf[6] = val;	buf[7] = val;	buf += 8;#endif /* CPU_FAMILY == MC680X0 */	}    /* Do the remainder one long at a time. */    while (buf < bufend)	*buf++ = val;    }#endif	/* BOOTCODE_IN_RAM */#if (CPU==XSCALE)int checkLongs (source, destination, nlongs)    FAST UINT *source;          /* pointer to source buffer      */    FAST UINT *destination;     /* pointer to destination buffer */    UINT nlongs;                /* number of longs to copy       */    {    int fine = 1;    FAST UINT *dstend = destination + nlongs;    while (destination < dstend)        {        if (*destination++ != *source++)            {            fine = 0;            break;            }        }    return fine;    }#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -