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

📄 cpu_startup.c

📁 qnx powerpc MPC8245的 BSP源文件
💻 C
字号:
/* * $QNXLicenseC:  * Copyright 2007, QNX Software Systems.   *   * Licensed under the Apache License, Version 2.0 (the "License"). You   * may not reproduce, modify or distribute this software except in   * compliance with the License. You may obtain a copy of the License   * at: http://www.apache.org/licenses/LICENSE-2.0   *   * Unless required by applicable law or agreed to in writing, software   * distributed under the License is distributed on an "AS IS" basis,   * WITHOUT WARRANTIES OF ANY KIND, either express or implied.  *  * This file may contain contributions from others, either as   * contributors under the License or as licensors under other terms.    * Please review this entire file for other proprietary rights or license   * notices, as well as the QNX Development Suite License Guide at   * http://licensing.qnx.com/license-guide/ for other information.  * $  */#include "startup.h"	//// Perform CPU specific startup initialization.// This code is hardware independant and should not have to be changed// changed by end users.//static voidppcv_cpuconfig_dummy(int cpu) {}static void *ppcv_map_dummy(unsigned size, paddr_t phys, unsigned prot_flags) {	return((void *)(uintptr_t)phys);}static voidppcv_unmap_dummy(void *p) {}static voidppcv_nosupport(void) {	crash("Support for CPU PVR 0x%x not present in startup.\n", get_pvr());}static voidppcv_setup_unknown() {	ppcv_config.cpuconfig2 = (void (*)())&ppcv_nosupport;	ppcv_config.cpuinfo = (void (*)())&ppcv_nosupport;	ppcv_config.qtime = (void (*)())&ppcv_nosupport;}const struct ppcv_chip	*ppcv;struct ppcv_config		ppcv_config = {	-1,	&ppcv_cpuconfig_dummy,	&ppcv_cpuconfig_dummy,	NULL,	// always have a cpuinfo routine set	NULL,	// always have a qtime routine set	&ppcv_map_dummy,	&ppcv_unmap_dummy,};static const struct ppcv_chip ppcv_chip_unknown = {	-1,	0, 0, 0, 0,	0,	0,	"unknown",	&ppcv_setup_unknown};voidcpu_one_startup(int cpu) {	// Make sure address translation is off.	ppc_sync(); 	set_msr(get_msr() & ~(PPC_MSR_DR |PPC_MSR_IR));	ppc_isync();	ppcv_config.cpuconfig1(cpu);	board_cpuconfig1(cpu);}voidcpu_startup() {	unsigned				ppc_chip;	const struct ppcv_chip	**tryp;	const struct ppcv_chip	*try;	ppc_chip = PPC_GET_FAM_MEMBER(get_pvr());	tryp = ppcv_list;	for(;;) {		try = *tryp;		if(try == NULL) {			// Delay reporting the problem that we don't support this			// chip until we have a hope of the error message coming out.			try = &ppcv_chip_unknown;			break;		}		if(try->chip == ppc_chip) break;		++tryp;	}	ppcv = try;	paddr_bits = try->paddr_bits;	try->setup();	cpu_one_startup(0);}

⌨️ 快捷键说明

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