Chinaunix首页 | 论坛 | 博客
  • 博客访问: 317684
  • 博文数量: 208
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 286
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-20 11:39
文章分类

全部博文(208)

文章存档

2014年(208)

我的朋友

分类: 嵌入式

2014-05-20 12:24:35

原文地址:uboot中gd指针定义 作者:andyhzw

uboot版本:uboot-1.1.6


以linux为例:
    Armlinux.c (u-boot-1.1.6\lib_arm) 中,

点击(此处)折叠或打开

  1. #include <common.h>
  2. #include <command.h>
  3. #include <image.h>
  4. #include <zlib.h>
  5. #include <asm/byteorder.h>
  6. #ifdef CONFIG_HAS_DATAFLASH
  7. #include <dataflash.h>
  8. #endif

  9. DECLARE_GLOBAL_DATA_PTR;

DECLARE_GLOBAL_DATA_PTR的定义如下:
    Global_data.h (u-boot-1.1.6\include\asm-arm) 

点击(此处)折叠或打开

  1. #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
含义:定义了一个结构体 gd_t类型的指针gd变量,并把该变量的地址存储在寄存器 r8 中



阅读(342) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~