Azure RTOSでRXマイコンが使えるようになったのですね

こんにちは。NoMaYです。

Azure RTOSでRXマイコンが使えるようになったのですね。コンパイラはGNURXが使われていました。

Getting started with the Renesas Starter Kit+ for RX65N-2MB (英文です。)
02/05/2021 Ryan Winter
docs.microsoft.com/ja-jp/samples/azure-rtos/getting-started/getting-started-with-the-renesas-starter-kit-for-rx65n-2mb/
 

Parents
  • こんにちは。NoMaYです。

    Azure RTOSカーネル(Azure RTOS v6.1.12_rel-rx-1.0.0-rc3)内の割り込み禁止処理についてちょっと追ってみました。

    カーネル内の割り込みの禁止/許可は以下のマクロで行われるようです。素朴にPSWのIビットを操作しているもので、PSWのIPLフィールド(4ビット)を操作しているのでは無いものでした。

    続く。

    libs/threadx/ports/rxv3/ccrx/inc/tx_port.h (改行の数とか空白文字の長さとか少し加工しています)

    /* Define ThreadX interrupt lockout and restore macros for protection on 
       access of critical kernel information.  The restore interrupt macro must
       restore the interrupt posture of the running thread prior to the value
       present prior to the disable macro.  In most cases, the save area macro
       is used to define a local function save area for the disable and restore
       macros.  */

    /* UINT   _tx_thread_interrupt_control(UINT new_posture); */

    #pragma inline_asm _tx_thread_interrupt_disable
    static UINT _tx_thread_interrupt_disable(void){
        MVFC PSW,R1  ;
        CLRPSW I     ;
    }

    #pragma inline_asm _tx_thread_interrupt_restore
    static void _tx_thread_interrupt_restore(UINT old_posture){
        MVFC PSW, R2  ;
        BTST #16,r1   ;
        BMC  #16,r2   ;
        MVTC r2,PSW   ;
    }

    #define TX_INTERRUPT_SAVE_AREA  unsigned int interrupt_save;

    #define TX_DISABLE              interrupt_save =  _tx_thread_interrupt_disable();

    #define TX_RESTORE              _tx_thread_interrupt_restore(interrupt_save);

     

Reply
  • こんにちは。NoMaYです。

    Azure RTOSカーネル(Azure RTOS v6.1.12_rel-rx-1.0.0-rc3)内の割り込み禁止処理についてちょっと追ってみました。

    カーネル内の割り込みの禁止/許可は以下のマクロで行われるようです。素朴にPSWのIビットを操作しているもので、PSWのIPLフィールド(4ビット)を操作しているのでは無いものでした。

    続く。

    libs/threadx/ports/rxv3/ccrx/inc/tx_port.h (改行の数とか空白文字の長さとか少し加工しています)

    /* Define ThreadX interrupt lockout and restore macros for protection on 
       access of critical kernel information.  The restore interrupt macro must
       restore the interrupt posture of the running thread prior to the value
       present prior to the disable macro.  In most cases, the save area macro
       is used to define a local function save area for the disable and restore
       macros.  */

    /* UINT   _tx_thread_interrupt_control(UINT new_posture); */

    #pragma inline_asm _tx_thread_interrupt_disable
    static UINT _tx_thread_interrupt_disable(void){
        MVFC PSW,R1  ;
        CLRPSW I     ;
    }

    #pragma inline_asm _tx_thread_interrupt_restore
    static void _tx_thread_interrupt_restore(UINT old_posture){
        MVFC PSW, R2  ;
        BTST #16,r1   ;
        BMC  #16,r2   ;
        MVTC r2,PSW   ;
    }

    #define TX_INTERRUPT_SAVE_AREA  unsigned int interrupt_save;

    #define TX_DISABLE              interrupt_save =  _tx_thread_interrupt_disable();

    #define TX_RESTORE              _tx_thread_interrupt_restore(interrupt_save);

     

Children
No Data