rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | #ifndef __EL1CD_MTPUBLIC_H__ |
| 2 | #define __EL1CD_MTPUBLIC_H__ |
| 3 | |
| 4 | #define EL1CD_MT_D_END 1023 |
| 5 | #define EL1CD_MT_C_END 2047 |
| 6 | |
| 7 | #if defined(MT_CONFIG_H) // for codegen enum |
| 8 | |
| 9 | #define EL1CD_MT_ENUM_TYPE MT_EL1CD_FUNC_TYPE |
| 10 | #define EL1D_MT_CB_NUM MT_EL1CD_D_NUM |
| 11 | #define EL1C_MT_CB_NUM MT_EL1CD_C_NUM_, MT_EL1CD_C_NUM = (MT_EL1CD_C_NUM_ - EL1CD_MT_D_END) |
| 12 | #define EL1D_MT_CB_END MT_EL1CD_CB_END = EL1CD_MT_D_END |
| 13 | #define EL1C_MT_CB_END MT_EL1CD_CB_END = EL1CD_MT_C_END |
| 14 | /*EL1D*/ |
| 15 | #define EL1D_MT_MOD(mod_id) |
| 16 | #define EL1D_MT_REGISTER(lisr,callback) MT_EL1CD_##lisr##_##callback, |
| 17 | #define EL1D_TAILCB_REGISTER(tail_type,callback) MT_EL1CD_TAILCB_##tail_type##_##callback, |
| 18 | #define EL1D_SFTMR_REGISTOR_CORE0(callback) MT_EL1CD_SFTMR_CORE0_##callback, |
| 19 | #define EL1D_SFTMR_REGISTOR_CORE1(callback) MT_EL1CD_SFTMR_CORE1_##callback, |
| 20 | /*EL1C*/ |
| 21 | #define EL1C_MT_REGISTER(callback) MT_EL1CD_##callback, |
| 22 | |
| 23 | #else // for real target enum |
| 24 | |
| 25 | #define EL1CD_MT_ENUM_TYPE EL1CD_MT_CB_E |
| 26 | #define EL1C_MT_CB_NUM EL1C_MT_CB_NUM_, EL1C_MT_CB_NUM = (EL1C_MT_CB_NUM_ - EL1CD_MT_D_END) |
| 27 | #define EL1D_MT_CB_END EL1D_MT_CB_END = EL1CD_MT_D_END |
| 28 | #define EL1C_MT_CB_END EL1C_MT_CB_END = EL1CD_MT_C_END |
| 29 | /*EL1D*/ |
| 30 | #define EL1D_MT_MOD(mod_id) |
| 31 | #define EL1D_MT_REGISTER(lisr,callback) EL1D_MT_CB_EL1D_MT_LISR_##lisr##_##callback, |
| 32 | #define EL1D_TAILCB_REGISTER(tail_type,callback) EL1D_MT_CB_TAILCB_##tail_type##_##callback, |
| 33 | #define EL1D_SFTMR_REGISTOR_CORE0(callback) EL1D_MT_CB_SFTMR_CORE0_##callback, |
| 34 | #define EL1D_SFTMR_REGISTOR_CORE1(callback) EL1D_MT_CB_SFTMR_CORE1_##callback, |
| 35 | #define EL1D_MT_REGISTER_IDX(lisr,callback) EL1D_MT_CB_##lisr##_##callback |
| 36 | #define EL1D_MT_TAILCB_REGISTER_IDX(tail_type,callback) EL1D_MT_CB_TAILCB_##tail_type##_##callback |
| 37 | #define EL1D_MT_SFTMR_REGISTOR_CORE0_IDX(callback) EL1D_MT_CB_SFTMR_CORE0_##callback |
| 38 | #define EL1D_MT_SFTMR_REGISTOR_CORE1_IDX(callback) EL1D_MT_CB_SFTMR_CORE1_##callback |
| 39 | /*EL1C*/ |
| 40 | #define EL1C_MT_REGISTER(callback) callback##_FUNC_IDX, |
| 41 | #define EL1C_MT_FUNC_IDEX(func_ptr) func_ptr##_FUNC_IDX |
| 42 | |
| 43 | #endif |
| 44 | |
| 45 | typedef enum{ |
| 46 | #include "lmultithreadregtbl.h" |
| 47 | #include "ltailcbregtbl.h" |
| 48 | #include "lsftmrregtbl.h" |
| 49 | EL1D_MT_CB_NUM, |
| 50 | EL1D_MT_CB_END, |
| 51 | #include "el1c_mtregtbl.h" |
| 52 | EL1C_MT_CB_NUM, |
| 53 | EL1C_MT_CB_END |
| 54 | } EL1CD_MT_ENUM_TYPE; |
| 55 | |
| 56 | #undef EL1D_MT_MOD |
| 57 | #undef EL1D_MT_REGISTER |
| 58 | #undef EL1D_TAILCB_REGISTER |
| 59 | #undef EL1D_SFTMR_REGISTOR_CORE0 |
| 60 | #undef EL1D_SFTMR_REGISTOR_CORE1 |
| 61 | |
| 62 | #undef EL1C_MT_REGISTER |
| 63 | |
| 64 | #endif |