diff --git a/arch/tricore/include/arch.h b/arch/tricore/include/arch.h index 8d022db956..3055a5f1bc 100644 --- a/arch/tricore/include/arch.h +++ b/arch/tricore/include/arch.h @@ -42,6 +42,13 @@ * Pre-processor Definitions ****************************************************************************/ +/* Address <--> Context Save Areas */ + +#define tricore_csa2addr(csa) ((uintptr_t *)((((csa) & 0x000F0000) << 12) \ + | (((csa) & 0x0000FFFF) << 6))) +#define tricore_addr2csa(addr) ((uintptr_t)(((((uintptr_t)(addr)) & 0xF0000000) >> 12) \ + | (((uintptr_t)(addr) & 0x003FFFC0) >> 6))) + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/arch/tricore/src/common/tricore_internal.h b/arch/tricore/src/common/tricore_internal.h index f92ba07094..e90dbe2551 100644 --- a/arch/tricore/src/common/tricore_internal.h +++ b/arch/tricore/src/common/tricore_internal.h @@ -144,13 +144,6 @@ extern void tricore_switchcontext(uintptr_t **saveregs, uintptr_t *restoreregs); #endif -/* Address <--> Context Save Areas */ - -#define tricore_csa2addr(csa) ((uintptr_t *)((((csa) & 0x000F0000) << 12) \ - | (((csa) & 0x0000FFFF) << 6))) -#define tricore_addr2csa(addr) ((uintptr_t)(((((uintptr_t)(addr)) & 0xF0000000) >> 12) \ - | (((uintptr_t)(addr) & 0x003FFFC0) >> 6))) - /**************************************************************************** * Public Types ****************************************************************************/