• uboot的jumptable_init函数分析


    一、函数说明

    函数功能:安装系统函数指针

    函数位置:common/exports.c

    二、函数分析

     1 void jumptable_init (void)
     2 {
     3     int i;
     4 
     5     gd->jt = (void **) malloc (XF_MAX * sizeof (void *)); //在堆中开辟指针空间
     6     for (i = 0; i < XF_MAX; i++)
     7         gd->jt[i] = (void *) dummy;                       //指针空间都初始化成指向空函数
     8     //依次安装函数指针
     9     gd->jt[XF_get_version] = (void *) get_version;
    10     gd->jt[XF_malloc] = (void *) malloc;
    11     gd->jt[XF_free] = (void *) free;
    12     gd->jt[XF_getenv] = (void *) getenv;
    13     gd->jt[XF_setenv] = (void *) setenv;
    14     gd->jt[XF_get_timer] = (void *) get_timer;
    15     gd->jt[XF_simple_strtoul] = (void *) simple_strtoul;
    16     gd->jt[XF_udelay] = (void *) udelay;
    17 #if defined(CONFIG_I386) || defined(CONFIG_PPC)
    18     gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
    19     gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
    20 #endif    /* I386 || PPC */
    21 #if (CONFIG_COMMANDS & CFG_CMD_I2C)
    22     gd->jt[XF_i2c_write] = (void *) i2c_write;
    23     gd->jt[XF_i2c_read] = (void *) i2c_read;
    24 #endif    /* CFG_CMD_I2C */
    25 }

      

  • 相关阅读:
    数位DP
    组合
    卢卡斯Lucas&扩展卢卡斯
    [HNOI2014]道路堵塞
    [模板]三维凸包(无讲解)
    [CF526G]Spiders Evil Plan
    [CCPC2019 ONLINE]H Fishing Master
    [CCPC2019 ONLINE]E huntian oy
    [CF1037H]Security
    [CF1037F]Maximum Reduction
  • 原文地址:https://www.cnblogs.com/amanlikethis/p/3509103.html
Copyright © 2020-2023  润新知