文档介绍:ARM Linux源代码分析(1)
/*
ARMLinux源代码分析(1)--
TigerZ(tigerz@)
/
1. 分析环境
    kernel:
    board: SMDK2410 , 64M SDRAM, 128M SM卡
2.
*/
/*
 * linux/arch/arm/kernel/
 *
 *  Copyright (C) 1994-2002 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *  Kernel startup code for all 32-bit CPUs
 */
#include <linux/>
#include <linux/>
#include <linux/>
#include <asm/>
#include <asm/mach->
#include <asm/>
#include <asm/>
#include <asm/>
#ifndef CONFIG_XIP_KERNEL /* 我在的平台, 这个宏没有定义*/
/*
 * We place the page tables 16K below TEXTADDR.  Therefore, we must make sure
 * that TEXTADDR is correctly set.  Currently, we expect the least significant
 * 16 bits to be 0x8000, but we could probably relax this restriction to
 * TEXTADDR >= PAGE_OFFSET + 0x4000
 *
 * 页表放在比TEXTADDR低16K的地方, 所以我们必须要确认TEXTADDR被正确设定. 目前,
 * 我们希望低16位为0x8000, 不过我们可以放松这个限制为
 * TEXTADDR >= PAGE_OFFSET + 0x4000
 *
 * Note that swapper_pg_dir is the virtual address of the page tables, and
 * pgtbl gives us a position-independent reference to these tables.  We can
 * do this because stext == TEXTADDR
 *
 * 注意swapper_pg_dir是页表的虚拟地址, pgtbl给我们一个位置无关的页表地址, 这是
 * 因为stext == TEXTADDR.
 */
#if (TEXTADDR & 0xffff) != 0x8000
    #error TEXTADDR must start at 0xXXXX8000
#endif
    /* swapper_pg_dir = 0x30008000 - 0x4000 */
    .globl swapper_pg_dir
    .equ    swapper_pg_dir, TEXTADDR - 0x4000
    /* rd = stext - 0x4000, 这里stext == TEXTADDR */
    /* adr指令是在pc值上+/-一个标号的偏移得到的, 所以得到的地址只跟pc和标号到
     * pc的偏移相关, 跟编译地址无关. 在MMU打开前, 代码要是地址无关的, 会经常
     * 用到adr.
     */
    .macro pgtbl, rd, phys
    adr     \rd, stext
    sub     \rd, \rd, #0x4000
    .endm
#else
/*
* XIP Kernel:
*
* We place the page tables 16K below DATAADDR.