This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于中断向量表初始化函数的问题



请问这个+3操作的目的是什么?

另外PieVectTableInit这个结构体里面全部都是函数名,这个函数名在保存在flash中的时候会自动变成函数地址吗?这是c语言的语法定义的还是ccs编译器定义的语法呢?

  • 图片显示失败,请您以附件形式上传一下图片,谢谢
  • void
    InitPieVectTable(void)
    {
    int16 i;
    Uint32 *Source = (void *) &PieVectTableInit;
    Uint32 *Dest = (void *) &PieVectTable;

    //
    // Do not write over first 3 32-bit locations (these locations are
    // initialized by Boot ROM with boot variables)
    //
    Source = Source + 3;
    Dest = Dest + 3;

    EALLOW;
    for(i=0; i < 125; i++)
    {
    *Dest++ = *Source++;
    }
    EDIS;

    //
    // Enable the PIE Vector Table
    //
    PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
    }
    请问这个+3操作的目的是什么?

    另外PieVectTableInit这个结构体里面全部都是函数名,这个函数名在保存在flash中的时候会自动变成函数地址吗?这是c语言的语法定义的还是ccs编译器定义的语法呢?

    抱歉我没找到 添加附件的方法,所以只能给您复制源码。
  • 如注释所说

    //
    // Do not write over first 3 32-bit locations (these locations are
    // initialized by Boot ROM with boot variables)
    //

    前3 个 32-bit 的位置已经被boot variables占用了,不能再重新写入,所以在清除时跳开了该位置

    user5891914 说:
    另外PieVectTableInit这个结构体里面全部都是函数名,这个函数名在保存在flash中的时候会自动变成函数地址吗?

    该结构体是根据芯片的中断向量表来定义的,如图

    不是很理解您所说的意思