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

📄 init_mmu.c

📁 QNX ADS BSP code for i.MX27 chips
💻 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"extern void	vstart();extern void	arm_get_pte_info();paddr_t		L1_paddr;paddr_t		L1_vaddr;paddr_t		L2_paddr;paddr_t		startup_base;unsigned	startup_size;/* * Section mappings */#define	SCSIZE	0x100000#define SCMASK	(SCSIZE-1)/* * Initialize page tables. This prepares the system to leap into virtual mode. * This code is hardware independant and should not have to be * changed by end users. */voidinit_mmu(void){	unsigned	base;	/*	 * Get the CPU-specific PTE descriptors	 */	arm_get_pte_info();	/*	 * Allocate the L1 table and the "page directory" used to map L2 tables	 */	L1_paddr = calloc_ram(ARM_L1_SIZE, ARM_L1_SIZE);	L2_paddr = calloc_ram(__PAGESIZE, __PAGESIZE);	/*	 * Map the "page directory" within itself	 */	arm_ptmap(L2_paddr, ARM_PTP_BASE);	/*	 * Map the real L1 table	 */	L1_vaddr = arm_map(~0L, L1_paddr, ARM_L1_SIZE, ARM_PTE_RW);	/*	 * Section map startup code to allow transition to virtual addresses.	 * This 1-1 mapping is also used by kdebug to access the imagefs.	 * procnto uses syspage->un.arm.startup_base/startup_size to unmap it.	 */	startup_base = shdr->ram_paddr & ~SCMASK;	startup_size = shdr->ram_size;	for (base = startup_base; base < startup_base + startup_size; base += SCSIZE) {		arm_scmap(base, base, ARM_PTE_RO);	}}

⌨️ 快捷键说明

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